Documentation
¶
Overview ¶
Package agents handles agent configuration loading and merging.
Index ¶
- Variables
- func ContractPath(path string) string
- func DetectAgents() map[string]bool
- func ExpandPath(path string) string
- func GetSkillPaths(agentName string) (globalPath, localPath string, err error)
- func SaveAgents(cfg *AgentsConfig, scope Scope) error
- func SelectAgents(agents []SelectableAgent) []string
- type Agent
- type AgentDefinition
- type AgentsConfig
- type ErrAgentNotFound
- type ErrNotInProject
- type Path
- type ResolvedSkill
- type Scope
- type SelectableAgent
Constants ¶
This section is empty.
Variables ¶
var KnownAgents = map[string]AgentDefinition{ "pi": { Name: "pi", DefaultGlobal: "~/.pi/agent/skills", DefaultLocal: ".pi/skills", DetectionPaths: []string{"~/.pi/agent/skills"}, DetectionMarker: ".pi", }, "codex": { Name: "codex", DefaultGlobal: "~/.codex/skills", DefaultLocal: ".codex/skills", DetectionPaths: []string{"~/.codex/skills"}, DetectionMarker: ".codex", }, "claude": { Name: "claude", DefaultGlobal: "~/.claude/skills", DefaultLocal: ".claude/skills", DetectionPaths: []string{"~/.claude/skills"}, DetectionMarker: ".claude", }, }
KnownAgents defines default paths for common agents.
Functions ¶
func ContractPath ¶
ContractPath replaces home directory with ~.
func DetectAgents ¶
DetectAgents scans the filesystem for known agents.
func GetSkillPaths ¶
GetSkillPaths returns the global and local paths for an agent.
func SaveAgents ¶
func SaveAgents(cfg *AgentsConfig, scope Scope) error
SaveAgents saves agent configuration to the appropriate scope.
func SelectAgents ¶
func SelectAgents(agents []SelectableAgent) []string
SelectAgents displays an interactive checkbox selector for agents. Returns the list of agents the user selected.
Types ¶
type Agent ¶
type Agent struct {
Name string `toml:"name"`
Global *Path `toml:"global"`
Local *Path `toml:"local"`
}
Agent represents a single agent's skill paths.
type AgentDefinition ¶
type AgentDefinition struct {
Name string
DefaultGlobal string
DefaultLocal string
DetectionPaths []string
DetectionMarker string
}
AgentDefinition defines how to detect and configure an agent.
type AgentsConfig ¶
AgentsConfig represents the agents.toml configuration.
func LoadAgents ¶
func LoadAgents() (*AgentsConfig, error)
LoadAgents loads agent configuration, merging global and local.
type ErrAgentNotFound ¶
type ErrAgentNotFound struct {
Name string
}
ErrAgentNotFound indicates the requested agent is not configured.
func (*ErrAgentNotFound) Error ¶
func (e *ErrAgentNotFound) Error() string
type ErrNotInProject ¶
type ErrNotInProject struct{}
ErrNotInProject indicates the user is not in a git project.
func (*ErrNotInProject) Error ¶
func (e *ErrNotInProject) Error() string
type Path ¶
type Path struct {
Value string `toml:"value"`
}
Path represents a skill directory path (absolute or relative).
type ResolvedSkill ¶
type ResolvedSkill struct {
Name string
Agent string
Scope string
Path string
Grimoire grimoire.Grimoire
}
ResolvedSkill represents a skill with its resolved paths.
func ResolveSkills ¶
func ResolveSkills() ([]ResolvedSkill, error)
ResolveSkills returns all skills from all configured agents.
type SelectableAgent ¶
type SelectableAgent struct {
Name string
DefaultGlobal string
DefaultLocal string
Detected bool // True if skill directory exists
Selected bool // Current selection state
Configured bool // True if already in config
}
SelectableAgent represents an agent that can be toggled in the selector.