New in 0.3: Replay any agent session

WeaverThe runtime for agent-driven UI

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.

Agent app demo

WeaverCore

Everything between the model and the screen

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.

Works with any model

Weaver never picks or calls a model. Any model or agent that can produce A2UI works.

No agent code runs

Agents describe the interface as data. Weaver never runs the HTML, CSS or JavaScript they send.

Only components you approve

You register the components and functions an agent may use. Messages can’t add new ones.

Safe streaming

The interface builds as the model streams. A broken line is skipped with a clear error, and the rest still renders.

You decide what buttons do

User actions arrive in your code by name. Nothing happens until your code checks them.

Runs where you do

Core runs in browsers, Node and Cloudflare Workers. Add HTTP streaming or MCP only if you need them.

Broken output is caught, not patchedand you’re told exactly why

createA2UIV091StreamIngestion({ runtime })

From the model · untrusted

1{"version":"v0.9.1","createSurface":{…}}
2{"version":"v0.9.1","updateComponents":{…}}
3{"version":"v0.9.1","updateComponents":{…}}
4{"version":"v0.9.1","updateComp
5{"version":"v0.9.1","updateDataModel":{…}}

Weaver checks each line

frame 1createSurface
frame 2updateComponents
frame 3updateComponents
frame 4INVALID_JSON

Not valid JSON. Skipped, and nothing on screen changed.

frame 5updateDataModel

What your user sees

Book a table

Reserve → sent to your code as “reserve”

app.tsTypeScript
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.

  • INVALID_JSONThe line isn’t valid JSON
  • FRAME_TOO_LARGEThe line is over the size limit
  • PROTOCOL_VALIDATION_FAILEDIt isn’t a valid A2UI message
  • CATALOG_REGISTRY_ERRORIt doesn’t match your catalog
  • SURFACE_STORE_ERRORIt doesn’t fit the interface’s current state

Install only what you needStart with Core

@cylayo/weaver-coreRequired

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
@cylayo/weaver-webFor browsers

Browser rendering

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
@cylayo/weaver-mcpOptional

MCP bridge

Brings agent interfaces in through an MCP client you already use. Needs Node 20 or later.

npm install @cylayo/weaver-mcp
Weaver0.3

Find out why an interface went wrongRecord it, replay it, read every step

Prompts from your catalog

The prompt tells the model exactly which components and actions your app accepts, so fewer answers get turned away.

generateA2UIV091Prompt()

Watch every event

See each message, input and action in order as it happens. Turn it on when you need it; it never changes a result.

observer

Replay any session

Record a session, replay it on a fresh runtime and see the exact step where something changed.

replayWeaverTrace()

Errors that explain the fix

Every error comes with a stable code, a plain summary and a hint on what to change.

describeWeaverError()

Frequently asked questions

More answers in the documentation.

What is A2UI?

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.

Does Weaver call a model?

No. Your app calls the model. Weaver takes the text it streams back, checks it and draws the interface.

What happens when the model sends broken output?

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.

Which packages do I need?

A browser app needs Core and Web. Core alone works in Node and Workers. Add MCP only when your application talks MCP.

Can an agent run its own code in my page?

No. Weaver never executes agent-provided HTML, CSS or JavaScript, and media stays blocked until your resource policy approves a URL.

Is the API stable?

Weaver is pre-1.0, so the public API may still change between minor versions. The three packages always release together at one version.

Build your first agent interfacein a few lines of TypeScript