Squashed 'src/pi/' content from commit d981de122

git-subtree-dir: src/pi
git-subtree-split: d981de1229ef899957bbe968bc8dcda02a21f477
This commit is contained in:
2026-09-13 07:04:45 -04:00
commit 25b62d1feb
1669 changed files with 397627 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
import { describe, expect, it } from "vitest";
import { formatPromptTemplateInvocation } from "../../src/harness/prompt-templates.ts";
import { formatSkillInvocation } from "../../src/harness/skills.ts";
describe("resource formatting helpers", () => {
it("formats skill invocations with additional instructions", () => {
const skill = {
name: "inspect",
description: "Inspect things",
content: "Use inspection tools.",
filePath: "/project/.pi/skills/inspect/SKILL.md",
};
expect(formatSkillInvocation(skill, "Check errors.")).toBe(
'<skill name="inspect" location="/project/.pi/skills/inspect/SKILL.md">\nReferences are relative to /project/.pi/skills/inspect.\n\nUse inspection tools.\n</skill>\n\nCheck errors.',
);
});
it("formats prompt template invocations with positional arguments", () => {
expect(
formatPromptTemplateInvocation({ name: "review", content: "Review $1 with $ARGUMENTS" }, ["a.ts", "care"]),
).toBe("Review a.ts with a.ts care");
});
});