Documentation
¶
Overview ¶
Package skill integrates the standalone github.com/nijaru/agentskills module with Canto's tool and prompt APIs.
The reusable SKILL.md loader, registry, validation, and model types live in the external agentskills module. This package owns the Canto-specific runtime tools and request-time prompt helpers that operate on that shared core.
Index ¶
- func ListPrompt(reg *agentskills.Registry) prompt.RequestProcessor
- func ListPromptWithOptions(reg *agentskills.Registry, opts ListPromptOptions) prompt.RequestProcessor
- func PreloadPrompt(skills ...*agentskills.Skill) prompt.RequestProcessor
- func RuntimeConfig(ctx context.Context, reg *tool.Registry, skills ...*agentskills.Skill) (agent.RuntimeConfig, error)
- type LexicalRouter
- type ListPromptOptions
- type ManageSkillTool
- type ReadSkillTool
- type Router
- type SecurityHooks
- type SkillMetadata
- type Validator
- type ValidatorFunc
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ListPrompt ¶
func ListPrompt(reg *agentskills.Registry) prompt.RequestProcessor
ListPrompt injects a summary list of all available skills.
func ListPromptWithOptions ¶
func ListPromptWithOptions( reg *agentskills.Registry, opts ListPromptOptions, ) prompt.RequestProcessor
func PreloadPrompt ¶
func PreloadPrompt(skills ...*agentskills.Skill) prompt.RequestProcessor
PreloadPrompt injects the full instructions for a selected skill set.
func RuntimeConfig ¶
func RuntimeConfig( ctx context.Context, reg *tool.Registry, skills ...*agentskills.Skill, ) (agent.RuntimeConfig, error)
RuntimeConfig validates and preloads skills for a runtime-scoped agent view.
Types ¶
type LexicalRouter ¶
type LexicalRouter struct {
Registry *agentskills.Registry
NameWeight float64
DescriptionWeight float64
BodyWeight float64
ToolWeight float64
}
func (*LexicalRouter) SelectRelevant ¶
func (r *LexicalRouter) SelectRelevant( _ context.Context, taskDescription string, limit int, ) ([]SkillMetadata, error)
type ListPromptOptions ¶
type ManageSkillTool ¶
type ManageSkillTool struct {
Registry *agentskills.Registry
// Path is the root directory where skill subdirectories are written.
// Each skill is stored at {Path}/{name}/SKILL.md.
Path string
}
ManageSkillTool allows an agent to create, update, or delete SKILL.md files at runtime, enabling closed-loop skill refinement.
func (*ManageSkillTool) Spec ¶
func (t *ManageSkillTool) Spec() llm.Spec
type ReadSkillTool ¶
type ReadSkillTool struct {
Registry *agentskills.Registry
}
ReadSkillTool allows an agent to read the full content of a skill.
func (*ReadSkillTool) Spec ¶
func (t *ReadSkillTool) Spec() llm.Spec
type SecurityHooks ¶
type SecurityHooks struct {
Validators []Validator
}
func DefaultSecurityHooks ¶
func DefaultSecurityHooks() SecurityHooks
func (SecurityHooks) ScopeRegistry ¶
func (h SecurityHooks) ScopeRegistry( reg *tool.Registry, skills ...*agentskills.Skill, ) (*tool.Registry, error)
func (SecurityHooks) Validate ¶
func (h SecurityHooks) Validate( ctx context.Context, skills ...*agentskills.Skill, ) error
type SkillMetadata ¶
type Validator ¶
type Validator interface {
ValidateSkill(ctx context.Context, skill *agentskills.Skill) error
}
type ValidatorFunc ¶
type ValidatorFunc func(ctx context.Context, skill *agentskills.Skill) error
func (ValidatorFunc) ValidateSkill ¶
func (f ValidatorFunc) ValidateSkill( ctx context.Context, skill *agentskills.Skill, ) error