tests/docs: cover diffs skill loading behavior

This commit is contained in:
Gustavo Madeira Santana
2026-03-03 01:42:37 -05:00
parent b27ee507e4
commit 585697a4e1
2 changed files with 18 additions and 0 deletions

View File

@@ -16,6 +16,8 @@ The tool can return:
- `details.filePath`: a local rendered artifact path when file rendering is requested
- `details.fileFormat`: the rendered file format (`png` or `pdf`)
When the plugin is enabled, it also ships a companion skill from `skills/` that guides when to use `diffs`. This guidance is delivered through normal skill loading, not unconditional prompt-hook injection on every turn.
This means an agent can:
- call `diffs` with `mode=view`, then pass `details.viewerUrl` to `canvas present`

View File

@@ -139,4 +139,20 @@ describe("loadWorkspaceSkillEntries", () => {
expect(entries.map((entry) => entry.skill.name)).toContain("diffs");
});
it("excludes diffs plugin skill when the plugin is disabled", async () => {
const { workspaceDir, managedDir, bundledDir } = await setupWorkspaceWithDiffsPlugin();
const entries = loadWorkspaceSkillEntries(workspaceDir, {
config: {
plugins: {
entries: { diffs: { enabled: false } },
},
},
managedSkillsDir: managedDir,
bundledSkillsDir: bundledDir,
});
expect(entries.map((entry) => entry.skill.name)).not.toContain("diffs");
});
});