refactor(agent): remove unused definition helpers
This commit is contained in:
parent
72863cf8bc
commit
cca5cd5770
1 changed files with 0 additions and 31 deletions
|
|
@ -3,7 +3,6 @@ package agent
|
||||||
import (
|
import (
|
||||||
"os"
|
"os"
|
||||||
"path/filepath"
|
"path/filepath"
|
||||||
"slices"
|
|
||||||
"strings"
|
"strings"
|
||||||
|
|
||||||
"github.com/gomarkdown/markdown/parser"
|
"github.com/gomarkdown/markdown/parser"
|
||||||
|
|
@ -117,21 +116,6 @@ func loadAgentDefinition(workspace string) AgentContextDefinition {
|
||||||
return definition
|
return definition
|
||||||
}
|
}
|
||||||
|
|
||||||
func (definition AgentContextDefinition) trackedPaths(workspace string) []string {
|
|
||||||
paths := []string{
|
|
||||||
filepath.Join(workspace, string(AgentDefinitionSourceAgent)),
|
|
||||||
filepath.Join(workspace, "SOUL.md"),
|
|
||||||
filepath.Join(workspace, "USER.md"),
|
|
||||||
}
|
|
||||||
if definition.Source != AgentDefinitionSourceAgent {
|
|
||||||
paths = append(paths,
|
|
||||||
filepath.Join(workspace, string(AgentDefinitionSourceAgents)),
|
|
||||||
filepath.Join(workspace, "IDENTITY.md"),
|
|
||||||
)
|
|
||||||
}
|
|
||||||
return uniquePaths(paths)
|
|
||||||
}
|
|
||||||
|
|
||||||
func loadUserDefinition(workspace string) *UserDefinition {
|
func loadUserDefinition(workspace string) *UserDefinition {
|
||||||
userPath := filepath.Join(workspace, "USER.md")
|
userPath := filepath.Join(workspace, "USER.md")
|
||||||
if content, err := os.ReadFile(userPath); err == nil {
|
if content, err := os.ReadFile(userPath); err == nil {
|
||||||
|
|
@ -234,21 +218,6 @@ func relativeWorkspacePath(workspace, path string) string {
|
||||||
return filepath.Clean(path)
|
return filepath.Clean(path)
|
||||||
}
|
}
|
||||||
|
|
||||||
func uniquePaths(paths []string) []string {
|
|
||||||
result := make([]string, 0, len(paths))
|
|
||||||
for _, path := range paths {
|
|
||||||
if strings.TrimSpace(path) == "" {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
cleaned := filepath.Clean(path)
|
|
||||||
if slices.Contains(result, cleaned) {
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
result = append(result, cleaned)
|
|
||||||
}
|
|
||||||
return result
|
|
||||||
}
|
|
||||||
|
|
||||||
func fileExists(path string) bool {
|
func fileExists(path string) bool {
|
||||||
_, err := os.Stat(path)
|
_, err := os.Stat(path)
|
||||||
return err == nil
|
return err == nil
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue