an archetype's prompt prefills the new agent's agents.md in the create form
This commit is contained in:
parent
2acde41e54
commit
a5470d82ae
1 changed files with 179 additions and 12 deletions
|
|
@ -5,6 +5,7 @@
|
|||
import assert from "node:assert/strict";
|
||||
import { test } from "node:test";
|
||||
import {
|
||||
agentsMdAfterPick,
|
||||
agentsMdBody,
|
||||
agentsMdRefusal,
|
||||
} from "../src/pages/CreateAgentAgentsMd.ts";
|
||||
|
|
@ -41,3 +42,29 @@ test("other failures stay with the general error", () => {
|
|||
assert.equal(agentsMdRefusal({ status: 400 }), null);
|
||||
assert.equal(agentsMdRefusal({ detail: "agents_md is too long" }), null);
|
||||
});
|
||||
|
||||
test("a pick fills an empty box with the archetype's prompt", () => {
|
||||
assert.equal(agentsMdAfterPick("", "", "Review only."), "Review only.");
|
||||
assert.equal(agentsMdAfterPick(" \n", "", "Review only."), "Review only.");
|
||||
});
|
||||
|
||||
test("a pick keeps text the operator typed or edited", () => {
|
||||
assert.equal(agentsMdAfterPick("# mine", "", "Review only."), "# mine");
|
||||
assert.equal(
|
||||
agentsMdAfterPick("Review only. Also x.", "Review only.", "Triage."),
|
||||
"Review only. Also x.",
|
||||
);
|
||||
});
|
||||
|
||||
test("a pick over an unedited prefill swaps it, and none clears it", () => {
|
||||
assert.equal(
|
||||
agentsMdAfterPick("Review only.", "Review only.", "Triage."),
|
||||
"Triage.",
|
||||
);
|
||||
assert.equal(agentsMdAfterPick("Review only.", "Review only.", ""), "");
|
||||
});
|
||||
|
||||
test("an archetype without a prompt leaves the box as it is", () => {
|
||||
assert.equal(agentsMdAfterPick("# mine", "", ""), "# mine");
|
||||
assert.equal(agentsMdAfterPick("", "", ""), "");
|
||||
});
|
||||
|
|
|
|||
Loading…
Reference in a new issue