This repository has been archived on 2026-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
ollie-core/agent/config_paths.go

35 lines
766 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.
func PromptsDirs() []string {
return paths.PromptsDirs()
}
// AgentsDirs returns all agent directories.
func AgentsDirs() []string {
return paths.AgentsDirs()
}
// AgentConfigPath resolves the config file path for a named agent.
// It searches all agent directories, falling back to agentsDir.
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"
}