feat: add user-invocable skill commands
This commit is contained in:
1 parent
eda9410bce
commit
0d6af15d1c
23 files changed
+514
-50
No files matched your search
@@ -0,0 +1,25 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
import { resolveSkillCommandInvocation } from "./skill-commands.js";
|
||||
|
||||
describe("resolveSkillCommandInvocation", () => {
|
||||
it("matches skill commands and parses args", () => {
|
||||
const invocation = resolveSkillCommandInvocation({
|
||||
commandBodyNormalized: "/demo_skill do the thing",
|
||||
skillCommands: [
|
||||
{ name: "demo_skill", skillName: "demo-skill", description: "Demo" },
|
||||
],
|
||||
});
|
||||
expect(invocation?.command.skillName).toBe("demo-skill");
|
||||
expect(invocation?.args).toBe("do the thing");
|
||||
});
|
||||
|
||||
it("returns null for unknown commands", () => {
|
||||
const invocation = resolveSkillCommandInvocation({
|
||||
commandBodyNormalized: "/unknown arg",
|
||||
skillCommands: [
|
||||
{ name: "demo_skill", skillName: "demo-skill", description: "Demo" },
|
||||
],
|
||||
});
|
||||
expect(invocation).toBeNull();
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user