mirror of
https://github.com/alkimake/paperclip.git
synced 2026-06-16 19:00:38 +09:00
Add unmanaged skill provenance to agent skills
Expose adapter-discovered user-installed skills with provenance metadata, share persistent skill snapshot classification across local adapters, and render unmanaged skills as a read-only section in the agent skills UI. Co-Authored-By: Paperclip <noreply@paperclip.ing>
This commit is contained in:
parent
58d7f59477
commit
cfc53bf96b
19 changed files with 497 additions and 501 deletions
49
server/src/__tests__/agent-skill-contract.test.ts
Normal file
49
server/src/__tests__/agent-skill-contract.test.ts
Normal file
|
|
@ -0,0 +1,49 @@
|
|||
import { describe, expect, it } from "vitest";
|
||||
import {
|
||||
agentSkillEntrySchema,
|
||||
agentSkillSnapshotSchema,
|
||||
} from "@paperclipai/shared/validators/adapter-skills";
|
||||
|
||||
describe("agent skill contract", () => {
|
||||
it("accepts optional provenance metadata on skill entries", () => {
|
||||
expect(agentSkillEntrySchema.parse({
|
||||
key: "crack-python",
|
||||
runtimeName: "crack-python",
|
||||
desired: false,
|
||||
managed: false,
|
||||
state: "external",
|
||||
origin: "user_installed",
|
||||
originLabel: "User-installed",
|
||||
locationLabel: "~/.claude/skills",
|
||||
readOnly: true,
|
||||
detail: "Installed outside Paperclip management.",
|
||||
})).toMatchObject({
|
||||
origin: "user_installed",
|
||||
locationLabel: "~/.claude/skills",
|
||||
readOnly: true,
|
||||
});
|
||||
});
|
||||
|
||||
it("remains backward compatible with snapshots that omit provenance metadata", () => {
|
||||
expect(agentSkillSnapshotSchema.parse({
|
||||
adapterType: "claude_local",
|
||||
supported: true,
|
||||
mode: "ephemeral",
|
||||
desiredSkills: [],
|
||||
entries: [{
|
||||
key: "paperclipai/paperclip/paperclip",
|
||||
runtimeName: "paperclip",
|
||||
desired: true,
|
||||
managed: true,
|
||||
state: "configured",
|
||||
}],
|
||||
warnings: [],
|
||||
})).toMatchObject({
|
||||
adapterType: "claude_local",
|
||||
entries: [{
|
||||
key: "paperclipai/paperclip/paperclip",
|
||||
state: "configured",
|
||||
}],
|
||||
});
|
||||
});
|
||||
});
|
||||
Loading…
Add table
Add a link
Reference in a new issue