Documentation
¶
Index ¶
- Constants
- func NewSkillsPrompt(listSkills func() ([]skilldomain.Skill, error), customTemplate string) agent.DynamicPrompt
- type Service
- func (s *Service) GetMCPSession(ctx context.Context) (*mcp.ClientSession, error)
- func (s *Service) GetManager() (skilldomain.SkillManager, error)
- func (s *Service) GetSkillsDir() string
- func (s *Service) GetSkillsPrompt(config *state.AgentConfig) (agent.DynamicPrompt, error)
- func (s *Service) RefreshManagerFromConfig()
- type Skill
Constants ¶
const SkillsDirName = "skills"
SkillsDirName is the subdirectory under state dir where skills are stored
Variables ¶
This section is empty.
Functions ¶
func NewSkillsPrompt ¶
func NewSkillsPrompt(listSkills func() ([]skilldomain.Skill, error), customTemplate string) agent.DynamicPrompt
NewSkillsPrompt returns a DynamicPrompt that renders the list of available skills. If customTemplate is non-empty, it is used as a template with {{.Skills}} slice. Otherwise, the default template is used (mimics current XML behavior).
Types ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service manages the skills directory (fixed at stateDir/skills), lazy SkillManager, dynamic prompt, and in-process MCP session
func NewService ¶
NewService creates a skills service. Skills are stored under stateDir/skills.
func (*Service) GetMCPSession ¶
GetMCPSession returns a shared MCP client session connected to the in-process skillserver (starts on first use)
func (*Service) GetManager ¶
func (s *Service) GetManager() (skilldomain.SkillManager, error)
GetManager returns the SkillManager if the skills dir is set, otherwise nil. Manager creation is serialized (createMu) so only one createManager() runs at a time, avoiding concurrent RebuildIndex and filesystem contention.
func (*Service) GetSkillsDir ¶
GetSkillsDir returns the skills directory path (always stateDir/skills)
func (*Service) GetSkillsPrompt ¶
func (s *Service) GetSkillsPrompt(config *state.AgentConfig) (agent.DynamicPrompt, error)
GetSkillsPrompt returns a DynamicPrompt that injects the available skills XML (or nil if no manager). When config is non-nil and config.SkillsPrompt is set, that text is used as the intro; otherwise the default intro is used.
func (*Service) RefreshManagerFromConfig ¶
func (s *Service) RefreshManagerFromConfig()
RefreshManagerFromConfig updates the existing manager's git repo list and rebuilds the index (same as skillserver: UpdateGitRepos + RebuildIndex in place). Does nothing if no manager exists yet. Call this when git repo config changes instead of invalidating; avoids blocking ListSkills on full recreate.