Checks, state and actions
The engine. Checks agent output, holds the interface’s state, handles input and actions, and builds prompts from your catalog. Runs in browsers, Node and Workers.
npm install @cylayo/weaver-core
Let any model answer with a real interface. Weaver checks every A2UI message against your catalog, renders it with your components and sends user actions back to your code. Agent output is data, never code.
Weaver checks what the agent sends, keeps track of the interface’s state, draws it with your components and passes clicks and typing back to your code. Your app keeps the model and the business logic.
Weaver never picks or calls a model. Any model or agent that can produce A2UI works.
Agents describe the interface as data. Weaver never runs the HTML, CSS or JavaScript they send.
You register the components and functions an agent may use. Messages can’t add new ones.
The interface builds as the model streams. A broken line is skipped with a clear error, and the rest still renders.
User actions arrive in your code by name. Nothing happens until your code checks them.
Core runs in browsers, Node and Cloudflare Workers. Add HTTP streaming or MCP only if you need them.
From the model · untrusted
Weaver checks each line
Not valid JSON. Skipped, and nothing on screen changed.
What your user sees
Book a table
Reserve → sent to your code as “reserve”
import { createBasicWebRuntime } from "@cylayo/weaver-web";
import { createA2UIV091StreamIngestion } from "@cylayo/weaver-core";
const created = createBasicWebRuntime();
if (!created.ok) throw new Error(created.error.code);
const web = created.value;
const ingestion = createA2UIV091StreamIngestion({ runtime: web.runtime });
for await (const delta of providerTextDeltas) {
for (const event of ingestion.push(delta)) {
if (!event.ok) report(event.frame, event.error.code);
}
}
ingestion.finish();
web.mount({ surfaceId: "main", target });
Weaver doesn’t guess what the model meant. It won’t strip Markdown fences or patch half-written JSON, and a broken line never half-updates the screen. You get a typed error, and describeWeaverError() turns it into a plain summary and a suggested fix.
The engine. Checks agent output, holds the interface’s state, handles input and actions, and builds prompts from your catalog. Runs in browsers, Node and Workers.
npm install @cylayo/weaver-core
Draws the interface in the browser with ready-made components, wires up clicks and typing, and streams updates over HTTP.
npm install @cylayo/weaver-web
Brings agent interfaces in through an MCP client you already use. Needs Node 20 or later.
npm install @cylayo/weaver-mcp
The prompt tells the model exactly which components and actions your app accepts, so fewer answers get turned away.
generateA2UIV091Prompt()
See each message, input and action in order as it happens. Turn it on when you need it; it never changes a result.
observer
Record a session, replay it on a fresh runtime and see the exact step where something changed.
replayWeaverTrace()
Every error comes with a stable code, a plain summary and a hint on what to change.
describeWeaverError()
More answers in the documentation.
An open format that lets an AI agent describe an interface as data: which components to show, what they say and what their buttons do. Weaver supports version 0.9.1.
No. Your app calls the model. Weaver takes the text it streams back, checks it and draws the interface.
Weaver skips that line and tells you why with a typed error. It never patches the output or applies part of it, so people never see a half-broken screen.
A browser app needs Core and Web. Core alone works in Node and Workers. Add MCP only when your application talks MCP.
No. Weaver never executes agent-provided HTML, CSS or JavaScript, and media stays blocked until your resource policy approves a URL.
Weaver is pre-1.0, so the public API may still change between minor versions. The three packages always release together at one version.