feat: analysis pipeline with staged SSE
Adds @openuidev/lang-core (one-line reason: the prompt-side library must build in a non-React Node runtime; react-lang's createContext crashes the route's server bundle). Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 4.7
parent
13bd2e6bfd
commit
ac4cbdd9e6
@@ -1,11 +1,15 @@
|
||||
import test from "node:test";
|
||||
import assert from "node:assert/strict";
|
||||
const { library, reportPromptOptions } = await import("../lib/report-ui.ts");
|
||||
const { promptLibrary, reportPromptOptions, specs } = await import("../lib/report-spec.ts");
|
||||
|
||||
test("the prompt advertises every component and the root", () => {
|
||||
const p = library.prompt(reportPromptOptions);
|
||||
const p = promptLibrary.prompt(reportPromptOptions);
|
||||
for (const n of ["Report", "Headline", "VerdictBlock", "MetricGrid", "Findings", "OptionTable",
|
||||
"StepList", "SqlBlock", "ScoreBar", "Callout"]) assert.ok(p.includes(n), `missing ${n}`);
|
||||
assert.match(p, /root/i);
|
||||
assert.match(p, /never invent/i);
|
||||
});
|
||||
test("every spec has a renderer, so the model can never emit an unrenderable block", async () => {
|
||||
const { library } = await import("../lib/report-ui.ts");
|
||||
for (const s of specs) assert.ok(library.components[s.name], `no renderer for ${s.name}`);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user