fix(#2754): include native PluginInput skills in skill() discovery
The skill tool previously only merged disk-discovered skills and preloaded options.skills, so skills registered natively via ctx.skills (for example from config.skills.paths or other plugins) were prompt-visible but not discoverable by skill(). Fix: - pass ctx.skills from tool-registry into createSkillTool - extend SkillLoadOptions with nativeSkills accessor - merge nativeSkills.all() results into getSkills() - add test covering native PluginInput skill discovery
This commit is contained in:
@@ -581,3 +581,32 @@ describe("skill tool - dynamic description cache invalidation", () => {
|
||||
})
|
||||
})
|
||||
|
||||
|
||||
|
||||
describe("skill tool - nativeSkills integration", () => {
|
||||
it("merges native skills exposed by PluginInput.skills.all()", async () => {
|
||||
//#given
|
||||
const tool = createSkillTool({
|
||||
skills: [],
|
||||
nativeSkills: {
|
||||
async all() {
|
||||
return [{
|
||||
name: "external-plugin-skill",
|
||||
description: "Skill from config.skills.paths",
|
||||
location: "/external/skills/external-plugin-skill/SKILL.md",
|
||||
content: "External plugin skill body",
|
||||
}]
|
||||
},
|
||||
async get() { return undefined },
|
||||
async dirs() { return [] },
|
||||
},
|
||||
})
|
||||
|
||||
//#when
|
||||
const result = await tool.execute({ name: "external-plugin-skill" }, mockContext)
|
||||
|
||||
//#then
|
||||
expect(result).toContain("external-plugin-skill")
|
||||
expect(result).toContain("Test skill body content")
|
||||
})
|
||||
})
|
||||
|
||||
Reference in New Issue
Block a user