53 lines
1.7 KiB
TypeScript
53 lines
1.7 KiB
TypeScript
import { describe, expect, it } from "vitest";
|
|
import {
|
|
listGrokSkills,
|
|
syncGrokSkills,
|
|
} from "@paperclipai/adapter-grok-local/server";
|
|
|
|
describe("grok local skill sync", () => {
|
|
const paperclipKey = "paperclipai/paperclip/paperclip";
|
|
|
|
it("defaults the operational Paperclip skill as ephemeral workspace-mounted state", async () => {
|
|
const snapshot = await listGrokSkills({
|
|
agentId: "agent-1",
|
|
companyId: "company-1",
|
|
adapterType: "grok_local",
|
|
config: {},
|
|
});
|
|
|
|
expect(snapshot.adapterType).toBe("grok_local");
|
|
expect(snapshot.supported).toBe(true);
|
|
expect(snapshot.mode).toBe("ephemeral");
|
|
expect(snapshot.desiredSkills).toContain(paperclipKey);
|
|
expect(snapshot.entries.find((entry) => entry.key === paperclipKey)).toMatchObject({
|
|
state: "configured",
|
|
detail: "Will be copied into `.claude/skills` in the execution workspace on the next run.",
|
|
});
|
|
});
|
|
|
|
it("tracks unavailable desired Grok skills as missing without persistent install state", async () => {
|
|
const snapshot = await syncGrokSkills({
|
|
agentId: "agent-2",
|
|
companyId: "company-1",
|
|
adapterType: "grok_local",
|
|
config: {
|
|
paperclipRuntimeSkills: [],
|
|
paperclipSkillSync: {
|
|
desiredSkills: ["unknown-skill"],
|
|
},
|
|
},
|
|
}, ["unknown-skill"]);
|
|
|
|
expect(snapshot.mode).toBe("ephemeral");
|
|
expect(snapshot.warnings).toContain(
|
|
'Desired skill "unknown-skill" is not available from the Paperclip skills directory.',
|
|
);
|
|
expect(snapshot.entries).toContainEqual(expect.objectContaining({
|
|
key: "unknown-skill",
|
|
state: "missing",
|
|
origin: "external_unknown",
|
|
targetPath: null,
|
|
}));
|
|
});
|
|
});
|