ollie/agent/config_paths.go

34 lines
785 B
Go

package agent
import (
"os"
"ollie/paths"
)
// DefaultPromptsDir returns the default directory for prompt templates.
func DefaultPromptsDir() string {
return paths.CfgDir() + "/prompts"
}
// PromptsDirs returns all prompt directories. Currently just the default.
func PromptsDirs() []string {
return []string{DefaultPromptsDir()}
}
// AgentsDirs returns all agent directories. Currently just the default.
func AgentsDirs() []string {
return []string{paths.CfgDir() + "/agents"}
}
// AgentConfigPath resolves the config file path for a named agent.
func AgentConfigPath(agentsDir, name string) string {
for _, dir := range AgentsDirs() {
p := dir + "/" + name + ".json"
if _, err := os.Stat(p); err == nil {
return p
}
}
return agentsDir + "/" + name + ".json"
}