mirror of
https://github.com/getcompanion-ai/co-mono.git
synced 2026-04-15 06:04:40 +00:00
soul
This commit is contained in:
parent
0973c1cbc5
commit
3cf69a35f8
5 changed files with 123 additions and 14 deletions
|
|
@ -269,6 +269,16 @@ Content`,
|
|||
expect(agentsFiles.some((f) => f.path.includes("AGENTS.md"))).toBe(true);
|
||||
});
|
||||
|
||||
it("should discover SOUL.md from the project root", async () => {
|
||||
writeFileSync(join(cwd, "SOUL.md"), "# Soul\n\nBe less corporate.");
|
||||
|
||||
const loader = new DefaultResourceLoader({ cwd, agentDir });
|
||||
await loader.reload();
|
||||
|
||||
const { agentsFiles } = loader.getAgentsFiles();
|
||||
expect(agentsFiles.some((f) => f.path.endsWith("SOUL.md"))).toBe(true);
|
||||
});
|
||||
|
||||
it("should discover SYSTEM.md from cwd/.pi", async () => {
|
||||
const piDir = join(cwd, ".pi");
|
||||
mkdirSync(piDir, { recursive: true });
|
||||
|
|
|
|||
|
|
@ -76,4 +76,21 @@ describe("buildSystemPrompt", () => {
|
|||
expect(prompt.match(/- Use dynamic_tool for summaries\./g)).toHaveLength(1);
|
||||
});
|
||||
});
|
||||
|
||||
describe("SOUL.md context", () => {
|
||||
test("adds persona guidance when SOUL.md is present", () => {
|
||||
const prompt = buildSystemPrompt({
|
||||
contextFiles: [
|
||||
{
|
||||
path: "/tmp/project/SOUL.md",
|
||||
content: "# Soul\n\nBe sharp.",
|
||||
},
|
||||
],
|
||||
skills: [],
|
||||
});
|
||||
|
||||
expect(prompt).toContain("If SOUL.md is present, embody its persona and tone.");
|
||||
expect(prompt).toContain("## /tmp/project/SOUL.md");
|
||||
});
|
||||
});
|
||||
});
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue