35 lines
766 B
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"
|
|
}
|