66 lines
1.6 KiB
Go
66 lines
1.6 KiB
Go
package toolsrv
|
|
|
|
import (
|
|
"encoding/json"
|
|
|
|
"ollie/skills"
|
|
)
|
|
|
|
// SetSkillsRegistry attaches a skills registry to the execute server.
|
|
// The server uses it to serve skill_list, skill_load, and skill_active.
|
|
func (e *Server) SetSkillsRegistry(r *skills.Registry) {
|
|
e.skillsRegistry = r
|
|
}
|
|
|
|
// ListSkillsTools returns ToolInfo entries for the skill_* built-ins.
|
|
// These are included alongside the standard tool_* tools.
|
|
func ListSkillsTools(skillsReg *skills.Registry, sessionID string) []ToolInfo {
|
|
if skillsReg == nil {
|
|
return nil
|
|
}
|
|
tools := []ToolInfo{
|
|
{
|
|
Name: "skill_list",
|
|
Description: `List available skill modules with name and description.
|
|
|
|
Usage: {"name": "skillname"} — if name is provided, loads that skill.
|
|
Otherwise lists all skills with descriptions.`,
|
|
InputSchema: json.RawMessage(`{
|
|
"type": "object",
|
|
"properties": {}
|
|
}`),
|
|
},
|
|
{
|
|
Name: "skill_load",
|
|
Description: `Load a skill module into the current session's context.
|
|
|
|
Usage: {"name": "skillname"}
|
|
|
|
The skill content (SKILL.md body) is injected into the agent's context
|
|
and persists across turns.`,
|
|
InputSchema: json.RawMessage(`{
|
|
"type": "object",
|
|
"required": ["name"],
|
|
"properties": {
|
|
"name": {"type": "string", "description": "Skill name to load."}
|
|
}
|
|
}`),
|
|
},
|
|
{
|
|
Name: "skill_active",
|
|
Description: `List skills currently loaded in this session.
|
|
|
|
Usage: (no arguments)
|
|
|
|
Returns loaded skill names, one per line.`,
|
|
InputSchema: json.RawMessage(`{
|
|
"type": "object",
|
|
"properties": {}
|
|
}`),
|
|
},
|
|
}
|
|
return tools
|
|
}
|
|
|
|
// dispatchSkillList lists all available skills from the global registry.
|