Documentation
¶
Index ¶
- Constants
- func BuildPromptSection(ctx context.Context, build pkgplugins.SystemPromptContext) (pkgplugins.SystemPromptSection, error)
- func FetchSkillFiles(ctx context.Context, source string) (skillName string, files map[string]string, cleanup func(), err error)
- func InstallToStore(ctx context.Context, store pkgplugins.SkillStore, source, scope string, ...) (string, error)
- func ListProjectSkills(root string) ([]pkgplugins.Skill, map[string]string, error)
- func NormalizeSkillStatus(status string) string
- func SkillsDefinition() tools.Definition
- func ValidateSkillName(name, parentDirName string) []string
- func WithProjectRoot(ctx context.Context, projectRoot string) context.Context
- type Tool
Constants ¶
const ( SkillStatusDraft = "draft" SkillStatusActive = "active" SkillStatusDeprecated = "deprecated" )
const PluginID = "tool/skills"
Variables ¶
This section is empty.
Functions ¶
func BuildPromptSection ¶ added in v0.11.0
func BuildPromptSection(ctx context.Context, build pkgplugins.SystemPromptContext) (pkgplugins.SystemPromptSection, error)
func FetchSkillFiles ¶ added in v0.13.0
func FetchSkillFiles(ctx context.Context, source string) (skillName string, files map[string]string, cleanup func(), err error)
FetchSkillFiles resolves source, finds the skill directory, and returns the skill name and a map of file paths (relative to the skill root) → content. cleanup is a no-op for git sources (their path is a shared cache — do NOT delete it). For local sources it is also a no-op because the path is the user's local directory.
func InstallToStore ¶ added in v0.13.0
func InstallToStore(ctx context.Context, store pkgplugins.SkillStore, source, scope string, userID int64, agentID string) (string, error)
InstallToStore fetches a skill from source and stores it in the given SkillStore. scope must be one of "user" or "agent". For scope="user", userID is used; for scope="agent", agentID is used. Returns the installed skill name on success.
func ListProjectSkills ¶ added in v0.13.0
ListProjectSkills walks {root}/.agents/skills/ and returns skill metadata structs with Scope="project". The second return value maps skill name → skill directory path so callers can read file content off disk for a given project skill.
func NormalizeSkillStatus ¶
func SkillsDefinition ¶
func SkillsDefinition() tools.Definition
func ValidateSkillName ¶
ValidateSkillName checks a skill name against the Agent Skills spec.
Types ¶
type Tool ¶
type Tool struct {
// contains filtered or unexported fields
}
func NewTool ¶
func NewTool(store pkgplugins.SkillStore, annaHome, agentRoot, projectRoot, userSkillsDir string, runtime pkgplugins.ToolRuntime) *Tool
func (*Tool) Definition ¶
func (t *Tool) Definition() tools.Definition