26 lines
941 B
TypeScript
26 lines
941 B
TypeScript
/**
|
|
* agents.test.ts — markdown agent-definition loader.
|
|
*/
|
|
import { describe, expect, it } from "bun:test";
|
|
import { extensionRoot, loadAgents } from "../src/agents.js";
|
|
|
|
describe("loadAgents", () => {
|
|
it("loads scanner.md and fixer.md shipped with the extension", async () => {
|
|
const agents = await loadAgents();
|
|
expect(agents.has("scanner")).toBe(true);
|
|
expect(agents.has("fixer")).toBe(true);
|
|
const scanner = agents.get("scanner");
|
|
expect(scanner).toBeDefined();
|
|
expect(scanner?.systemPrompt).toContain("scanner");
|
|
expect(scanner?.allowedTools).toContain("read");
|
|
expect(scanner?.allowedTools).not.toContain("edit"); // scanner is read-only
|
|
expect(scanner?.sourcePath).toContain("agents/scanner.md");
|
|
const fixer = agents.get("fixer");
|
|
expect(fixer?.allowedTools).toContain("edit");
|
|
});
|
|
|
|
it("extensionRoot resolves to the package directory", () => {
|
|
expect(extensionRoot()).toMatch(/pygienium$/);
|
|
});
|
|
});
|