feat: add core contracts
This commit is contained in:
25
packages/core/src/prompt-envelope.test.ts
Normal file
25
packages/core/src/prompt-envelope.test.ts
Normal file
@@ -0,0 +1,25 @@
|
||||
import { describe, expect, it } from "vitest";
|
||||
|
||||
import { PromptEnvelope, renderPromptEnvelope } from "./prompt-envelope.js";
|
||||
|
||||
describe("prompt envelope", () => {
|
||||
it("validates and renders the locked wire markers", () => {
|
||||
const envelope = PromptEnvelope.parse({
|
||||
uuid: "00000000-0000-4000-8000-000000000000",
|
||||
runId: "11111111-1111-4111-8111-111111111111",
|
||||
roleId: "planner",
|
||||
phaseKey: "plan",
|
||||
attempt: 0,
|
||||
expectedArtifact: "/tmp/devflow/spec.json",
|
||||
expectedSchema: "dev/spec@1",
|
||||
dedupKey: "a".repeat(64),
|
||||
instructions: "Write the spec.",
|
||||
});
|
||||
|
||||
expect(renderPromptEnvelope(envelope)).toContain(
|
||||
"DEVFLOW_PROMPT_BEGIN 00000000-0000-4000-8000-000000000000",
|
||||
);
|
||||
expect(renderPromptEnvelope(envelope)).toContain("Phase: plan");
|
||||
expect(renderPromptEnvelope(envelope)).toContain("DEVFLOW_PROMPT_END");
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user