agent.run gains views: the agent may return an OpenUI Lang view of its answer through an optional view tool, read as steps.<id>.view. human.approve stores it as the task's plan_view, and the approval card renders it with the dashboard's own components, falling back to the plan text when there is no view or it does not parse. The feasibility prd step uses it.
15 lines
605 B
TypeScript
15 lines
605 B
TypeScript
// Writes the agent prompt for the dashboard's view components to the path
|
|
// given, from the same schemas the renderer uses.
|
|
import { writeFileSync } from "node:fs";
|
|
|
|
import { viewLibrary, viewPromptOptions } from "../src/genui/view-library.ts";
|
|
|
|
const out = process.argv[2];
|
|
if (!out) throw new Error("usage: genui-prompt.ts <output path>");
|
|
const r = null;
|
|
const library = viewLibrary({
|
|
Stack: r, Section: r, Columns: r, Heading: r, Text: r, Callout: r, Facts: r,
|
|
Fact: r, Files: r, File: r, Checklist: r, Table: r, Code: r,
|
|
});
|
|
writeFileSync(out, library.prompt(viewPromptOptions).trim() + "\n");
|