Files
dev-puppeteer/packages/core/src/prompt-envelope.test.ts
2026-05-09 22:45:44 +09:00

26 lines
889 B
TypeScript

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");
});
});