A2UI guide

Front-end compositions with A2UI and AgentSpaces

An agent draws a page for people by writing A2UI envelopes into a space its group shares. Any member that renders draws the page and writes each click back. This guide shows how the AgentCard and the AppCard declare a page, how to compose one from the open widget library, how it travels, and where AgentSpaces stands in the A2UI ecosystem.

A2UI 1.0 on the wire, in its final formthe 0.7.0 builds of agentspaces-a2ui for Java and @agentspaces/a2ui-react on @a2ui/react 0.16.1two open catalogs, agentspaces-viz and agentspaces-widgetsSPEC v0.1.35 §6.1a
aspace://guide/a2ui/why

Why A2UI in a fleet

This guide is for engineers who want their agents to show people something and hear back. You might want a desk that lists claims, a chat about shared files, or a dashboard of charts. A2UI is an open protocol for exactly that, and AgentSpaces carries it through a group of peers. The how and the why are in the appendix.

The idea in four lines:

  • An agent describes a page as data: a list of components, a data model, and the actions a person may take. Nothing executable crosses the wire.
  • The agent writes that data into a space of its group as ordinary entries, one A2UI envelope per entry.
  • Any member that renders reads the entries in order and draws the page with its own widgets.
  • A person's click comes back as an entry the agent reads, so the agent answers by writing more envelopes.

AgentSpaces adds three things to plain A2UI:

  • Cards. An agent's AgentCard says which components it can show. An AppCard names the application people use and how it travels. Every member finds both by discovery.
  • A widget library. Two open catalogs, agentspaces-viz (charts, tables, maps, the frame of a page) and agentspaces-widgets (a chat, a file tree, a file preview), with builders in Java, TypeScript, and Python and a React renderer.
  • A group to travel in. The envelopes are leased entries that every member replicates, so a renderer that joins late still draws the whole page.

A few words first

From A2UI:

  • A surface is one page an agent draws, named by a surface id.
  • An envelope is one message about a surface: createSurface, updateComponents, updateDataModel, or deleteSurface, each with a version, 1.0 here.
  • A component is one part of a page, such as a Column, a Text, or a Button. Components refer to each other by id, as a flat list.
  • A catalog lists the components a renderer can draw, with the properties of each. A2UI's own is the basic catalog.
  • The data model holds the values components show. A component binds to a path with {"@path": "/status"}.
  • A component's own properties sit beside a few keys A2UI keeps for itself: id, component, and the @-prefixed @catalogId, @accessibility, @metadata, and @checks.
  • An action is what a person's click sends back: name, surfaceId, sourceComponentId, timestamp, and context.
  • A renderer draws envelopes with the widgets of one framework, such as React or Flutter.

From AgentSpaces:

  • A group is the set of peers that work together. A space is a named, replicated store of typed entries inside a group, and every entry has a lease that says how long it lives.
  • A card is a signed, leased advertisement. The four kinds are the AgentCard, the AssetCard, the ModelCard, and the AppCard.
  • A pen is the Surfaces helper of agentspaces-a2ui: each call writes one envelope as a Surface entry.
  • The views space is the space a group's pages travel in. Its name is views by convention.

The picture

ONE PAGE, THREE PARTS: THE AGENT, THE GROUP, THE RENDERERthe A2UI projectAgentSpacesTHE AGENT'S PEERTHE GROUPANY MEMBER THAT RENDERSworkbench agent@AgentSpec, @UiComponentits AgentCard: uia Surfaces pencreate, components, dataone envelope per call,numbered per pageAppCardPublisherissues the AppCardspace viewsSurface seq 1 createSurfaceSurface seq 2 updateComponentsSurface seq 3 updateDataModelSurface seq 4 updateDataModelSurfaceAction write, from anathe ad cacheAgentCard workbench (ui)AppCard workbench (ui)any member: discovery.find@agentspaces/a2ui-reactSurfaces draws the opencatalogs over @a2ui/reacta third-party rendererdraws basic-catalog pagesof A2UI 1.0a personreads, clicks, types12341 the pen writes envelopes as entries; 2 the agent and the app publish their cards; 3 a renderer reads theenvelopes in order and draws them; 4 a person's click goes back as a SurfaceAction, which the pen hands the agent.
One page, three parts. The agent draws by writing entries. The group carries them to every member. Any member that renders draws them for a person and writes the person's action back.
  • The agent's peer holds the agent and a pen. The agent's card and the app's card go into every member's ad cache.
  • The group's views space holds the envelopes in order, numbered per page, and the actions people take.
  • A renderer is any member that reads views. It can be the open React renderer, which draws both open catalogs, or a third-party A2UI renderer, which draws a page written on the basic catalog.

What works today, and what does not

PartState in 0.7.0
A2UI 1.0 envelopes, in both directionssupported: the pen writes them, SurfaceAction carries the action back
The basic catalog of 1.0supported: builders for Text, Column, Row, Card, Button, Divider, and bound text
Calls from a page to the agent (callAgentFunction)supported: Surfaces.functionCall and functionButton write them, and the agent answers with a FunctionResponse
agentspaces-viz and agentspaces-widgetssupported: open catalogs, builders in Java, TypeScript, and Python, drawn by @agentspaces/a2ui-react
The ui block on the AgentCard and the AppCardsupported: SPEC §6.1a.2 and §6.1a.3, golden vectors
The open records ChatMessage, SharedFile, WorkingOn, ChatProgresssupported: SPEC §6.1a.7, Java, TypeScript, and Python codecs, six golden vectors
Transport through the group's views spacesupported end to end in the open core
Transport over A2Adeclared on the card (ui.transport a2a); the Bad Monkey console's gateway serves it, and the open A2A gateway does not carry envelopes
A2UI v0.9.1no longer: 0.6.x wrote it, and 0.7.0 neither writes nor reads it
AG-UI and MCP as transports for envelopesnot shipped; the open records map their task states onto AG-UI's run and tool events for a reader
Inline catalogs and calls from the agent to the renderer (callRendererFunction)not supported
aspace://guide/a2ui/cards

The four cards and the page

Every application in a fleet comes down to four signed cards. A page touches all four:

A card is a signed, leased advertisement that tells the group what one thing offers. Four kinds of card describe the four kinds of thing a fleet holds: agents, data, models, and applications.

CardWhat it advertisesWho issues itHow discovery finds it
AgentCardAn agent: its description and goals, one action per bound method with the entry types it consumes and produces, and the space each input comes from.The binder, when you bind an agent.By the types it consumes or produces, by name, or by meaning. Remote actions and planners read its actions.
AssetCardA data asset: its name, source URI, shape of data, freshness, and how to query or invoke it. A content store advertises itself with one too.A connector peer, one card per asset it holds.By asset name, shape, or access mode, or by meaning.
ModelCardA model the group may route to: its tasks, limits, licence, provenance, residency, engine, and the peers that serve it.The peer that serves the model, or a registry that admits models to the group.By name, task, engine, or residency site, or by meaning.
AppCardAn application that joins the fleet: how it connects, its shape, the spaces it reads, the actions it may request, its views, and the A2UI components it draws.The application's publisher.By kind, origin, or the formats it handles, or by meaning. A console lists the fleet's apps from these cards.

All four travel the same way. The issuer signs the card and gives it a lifetime (its TTL). Gossip carries it on the group's ads stream into every member's local cache, and the issuer refreshes it while the thing it describes is live. A card whose issuer stops refreshing it ages out of every cache when its TTL runs out, so a card can outlive its issuer by up to one TTL.

Every peer finds cards in its own cache, by structure: a card type plus conditions on its fields. Semantic discovery also ranks cards by meaning against a text query. Treat what you find as a hint about a live fleet: work still reaches a worker through its space and entry type, whether or not the card has arrived.

ONE GROUP: FOUR KINDS OF CARD ON ONE ADS STREAMagent peerthe binder issues itAgentCarddescription, goalsactions: consumes, producesspaceBindingsagent key, certificatesigned, leased, refreshedconnectorone card per assetAssetCardasset, uri, descriptionshape, freshnessaccess: query, invoke-opscostHintssigned, leased, refreshedmodel serverserves the modelModelCardname, version, taskslimits, licence, provenanceresidency, engineserverssigned, leased, refreshedapplicationits publisher issues itAppCardname, kind, shape, ownerreads, actions, viewsui: its A2UI componentsorigin, formatssigned, leased, refreshedthe ads stream: gossip carries every card to every member of the groupeach member's ad cache: the newest issue per id, aged out at its TTLfind(type, predicate)by structure: a card type and its fieldssemantic queryby meaning: names, descriptions, and tasksa planner, a console, or a caller reads the cards; work itself still routes by space and entry type
The four cards. An agent peer, a connector, a model server, and an application each sign a card and lease it. Gossip carries every card on the group's ads stream into each member's cache, where any peer finds it by type and fields or by meaning. A card whose issuer stops refreshing it ages out.
  • The AgentCard of the agent that draws the page says which components it can show, in its ui block.
  • The AppCard names the application people use, the agent that draws it, and how its envelopes travel, in its own ui block.
  • An AssetCard advertises where data lives. For a page with shared files, a content store's AssetCard holds the files' bytes.
  • A ModelCard advertises a model. For a page with a chat, it names the model the agent answers with.
THE FOUR CARDS BEHIND ONE PAGEAgentCard workbenchwhat one agent can show (SPEC 6.1a.3)actions summariseui.protocol a2ui ui.version 1.0ui.components tree agentspaces-widgets/FileTree preview agentspaces-widgets/FilePreview chat agentspaces-widgets/Chatui.entries reads SharedFile, ChatMessageui.catalogIds agentspaces-widgetsAppCard workbenchone application people use (SPEC 6.1a.2)kind fed shape a2ui owner benchreads workbench/viewsui.agent workbenchui.transport viewsui.surfaces workbenchui.catalogIds basic, viz, widgetsui.components the agent's threeformats text/csv, text/markdown, <ns>ui.agentcomponentsAssetCard content-store:<name>where the files' bytes live (SPEC 6.1a.6)shape store access.kind content-storeholds the roots of the shared filesModelCard <the chat model>what a chat answer runs on (SPEC 6.1a.1)tasks chat engine, residency, serversthe model an agent answers withSolid: the workbench example publishes it. Dashed: a fuller application adds it, and the page readsthrough it. Every card is signed by its issuer, leased by its ttl, and found with discovery.find.
The cards behind one page. The AgentCard says what the agent can show. The AppCard names the application, the agent that draws it, and how its envelopes travel. An AssetCard and a ModelCard serve the files and the answers of a fuller application.

The AgentCard's ui block

The AgentCard's ui block says what one agent can show (SPEC §6.1a.3). It never carries a page, only a declaration:

FieldWhat it holds
protocol, versiona2ui and 1.0
componentseach id, catalogId, component (the A2UI name in that catalog), entry (the entry type behind it), controls (the card's actions a person may trigger), and role (panel, control, or row)
entriesreads and writes: the entry type IRIs the agent speaks through its components
catalogIdsthe distinct catalogs of the components

You do not write this block by hand. The binder derives it from @UiComponent annotations on the agent:

// Workbench.java
@AgentSpec(name = "workbench", description = "Summarises the files a team shares and answers questions about them")
@UiComponent(catalog = WidgetsCatalog.ID, component = "FileTree", id = "tree", entry = SharedFile.class, entryIri = SharedFile.IRI, controls = {"summarise"})
@UiComponent(catalog = WidgetsCatalog.ID, component = "FilePreview", id = "preview", entry = SharedFile.class, entryIri = SharedFile.IRI)
@UiComponent(catalog = WidgetsCatalog.ID, component = "Chat", id = "chat", entry = ChatMessage.class, entryIri = ChatMessage.IRI, role = "control", writes = true)
public class Workbench {
...
    @SpaceTake(space = "tasks")
    public Summary summarise(SummaryRequest request) {
        return new Summary(request.fileId(), "Travel ran 18 percent over its budget.");
    }
}
  • Each @UiComponent adds one component. Its controls must name actions of the card: summarise is the action of the @SpaceTake method, so the binder accepts it.
  • entryIri names the open record type the component reads, here SharedFile and ChatMessage under https://badmonkey.ai/agentspaces/a2ui/v1/.
  • The other clients declare the same block: uiComponent in TypeScript, ui_component in Python, and a :ui list in a Clojure defagent.

The AppCard's ui block

The AppCard advertises one application people use (SPEC §6.1a.2). Three of its fields set the frame:

  • kind says how the app connects: peer (the app is a member), fed (an agent of the group feeds it), gateway (it sits behind the A2A gateway), or assembled (a static app that reads nothing live).
  • shape says what it is: web, desktop, static, or a2ui. An a2ui app draws itself from envelopes and must carry ui.
  • formats lists the media types and vocabulary IRIs the app reads, so a member can ask card.handles(...).

Its ui block says how a renderer finds and draws the page:

FieldWhat it holds
protocol, versiona2ui and 1.0
catalogIdsthe catalogs the app's pages use
agentthe agent that draws the pages
transportviews (through the group's views space) or a2a (through the A2A gateway)
surfacesthe surface ids of the app's pages
componentsthe same list as the AgentCard's, when the app wants to carry it

The workbench builds its AppCard from its own AgentCard:

// Page.java
static AppCard card(AgentSpaces.GroupContext group, AgentCard agent) {
    AppCard.Ui ui = new AppCard.Ui("a2ui", Surface.A2UI_VERSION, List.of(Surface.BASIC_CATALOG, VizCatalog.ID, WidgetsCatalog.ID),
            agent.agent().localName(), "views", List.of(SURFACE), agent.ui().components());
    return new AppCard("aspace://" + group.id().value() + "/app/" + group.identity().peerId().value() + "/workbench",
            group.identity().peerId(), group.id(), Instant.now(), Duration.ofMinutes(15),
            "workbench", "fed", "a2ui", "bench", List.of(group.name() + "/views"), List.of("summarise"), "", "", "", "1", List.of(),
            ui, null, null, List.of("text/csv", "text/markdown", A2uiRecords.NAMESPACE), null);
}
  • The arguments follow the card's fields in order: id, issuer, group, issued, ttl, name, kind, shape, owner, reads, actions, idpClient, url, pkg, version, views, ui, host, origin, formats, and spill. The workbench leaves host, origin, and spill null.
  • The constructor checks the closed values: a kind, shape, or transport outside its set fails here, before the publisher signs anything.
  • Surface.BASIC_CATALOG is https://a2ui.org/specification/v1_0/catalogs/basic/catalog.json, the id the 1.0 basic catalog carries.
  • The constructor also refuses an a2ui app without ui, because a renderer could not find its pages.

AssetCards and ModelCards behind a page

A page shows data and answers. The other two cards say where those come from:

  • A file a person shares lives on the group's content swarm. A content store advertises itself with an AssetCard whose access.kind is content-store (SPEC §6.1a.6), and the SharedFile record names the file's root there.
  • A chat answer comes from a model. The ModelCard names it, its tasks such as chat, its engine, and where it may run (SPEC §6.1a.1).
  • Neither card carries a ui block. The page reads through them: a host gives the FilePreview each file's address from its root, and the agent finds the model it answers with by its ModelCard.

The developer guide covers all four cards, and the enterprise guide shows how a console admits an AppCard.

aspace://guide/a2ui/compose

Build a composition

This part builds one page, the workbench, from start to finish. It is a Spring Boot app in two instances:

  • The desk runs the workbench agent. It draws the page, publishes the AppCard, and answers chat lines.
  • The looker is a second member that knows nothing in advance. It finds the app by discovery, reads the agent's card, saves the page's envelopes, and sends one chat line as a person would.
  • A render check then draws the saved envelopes with @agentspaces/a2ui-react and checks what a person sees.
THE WORKBENCH PAGE: SIX COMPONENTS FROM THREE CATALOGSWorkbenchQ3 expensesReadySummariseFilesPreviewChatv dataq3-expenses.csvv notesoverspend.mdPick a file to previewChat with workbenchWhere did we overspend?Travel ran 18 percent over.And in Q4?Sendbar: TitleBaragentspaces-vizmain: Splitagentspaces-viztree: FileTreeagentspaces-widgetspreview: FilePreviewagentspaces-widgetschat: Chatagentspaces-widgetsroot: Columnthe basic catalog
The workbench page. A title bar over a split of three panes, from three catalogs. The example in Part 3 builds it and checks it with the React renderer.

Every listing below is an excerpt of one program, the guide's own example, which ran as shown on 2026-11-18. A line of ... marks what an excerpt leaves out.

1. The dependencies

The project uses the Spring Boot 4.1 parent and imports the ai.badmonkey.agentspaces:agentspaces-dependencies BOM of 0.7.0. It needs the A2UI library, the AgentSpaces starter, and Spring Boot's own starter:

# pom.xml
<dependency><groupId>ai.badmonkey.agentspaces</groupId><artifactId>agentspaces-a2ui</artifactId><version>0.7.0</version></dependency>
<dependency><groupId>ai.badmonkey.agentspaces</groupId><artifactId>agentspaces-spring-boot-starter</artifactId></dependency>
<dependency><groupId>org.springframework.boot</groupId><artifactId>spring-boot-starter</artifactId></dependency>

The BOM and the starter come from Maven Central at 0.7.0. agentspaces-a2ui 0.7.0 does not: the release left it out. Central's 0.6.0 is the older v0.9.1 line, which a 0.7.0 member does not read. Build it from a clone of agentspaces-a2ui with mvn install -DskipTests, and the coordinate above resolves from ~/.m2.

2. The group and its spaces

Pages and actions travel in views. The agent takes its work from tasks.

# application.yml
spring.main.web-application-type: none   # the group is the interface
agentspaces:
  bind: 127.0.0.1:${bench.port:7741}
  groups:
    - name: workbench
      founding: workbench-v1
      seeds: ${bench.seeds:}             # empty on the first instance
      spaces:
        - name: views                    # where surfaces and actions travel
        - name: tasks                    # where the agent takes its work

3. The agent and its card

The agent is the Workbench class shown under The AgentCard's ui block. The starter binds it and publishes its AgentCard with three components.

4. The page

The page is a flat list of components built with the catalogs' builders. A TitleBar sits over a Split of three panes, and each pane holds one widget:

// Page.java
static List<Map<String, Object>> components() {
    return List.of(
            Surfaces.column("root", List.of("bar", "main")),
            Surfaces.titleBar("bar", "Workbench", "Q3 expenses", "", Surfaces.titleStatus("/working", "Agent working", "Ready"),
                    List.of(Surfaces.titleAction("summarise", "Summarise", "", "summarise")), ""),
            Surfaces.split("main", "horizontal", "workbench", 720, List.of(
                    Surfaces.pane("left", "tree", 0.25, 180, true, "Files"),
                    Surfaces.pane("mid", "preview", 0.45, 320, false, "Preview"),
                    Surfaces.pane("right", "chat", 0.30, 300, true, "Chat"))),
            Surfaces.fileTree("tree", "/files", Map.of("preview", "preview", "chat", "chat", "actions", List.of("ask", "download"))),
            Surfaces.filePreview("preview", Map.of("@path", "/selected/file"), Map.of("files", "/files")),
            Surfaces.chat("chat", "workbench", "main", Map.of("suggestions", List.of("Summarise the newest file"), "format", "text/markdown")));
}
  • column comes from the basic catalog. titleBar and split come from agentspaces-viz. fileTree, filePreview, and chat come from agentspaces-widgets.
  • Each builder checks its options against its catalog. A misspelled option, or a word the catalog does not take, fails at this line.
  • Map.of("@path", "/selected/file") is an A2UI 1.0 binding. The builders refuse v0.9.1's {"path": ...} and name the property it sits in.
  • Every id is an identifier, as 1.0 requires: barMenu passes, and bar-menu fails when the pen writes the page.
  • The widgets read lists from the data model: the tree reads /files, the chat reads /conversations, and the preview shows the file the tree puts at /selected/file.

The files are open SharedFile records. Version 2 adds the path that the tree folds into folders:

// Page.java
new SharedFile(SharedFile.V2, "f-q3", "q3-expenses.csv", "text/csv", 1840, "", "", "ana", List.of(), at, "data/q3-expenses.csv", ""),
new SharedFile(SharedFile.V2, "f-note", "overspend.md", "text/markdown", 420, "", "", "workbench", List.of(), at, "notes/overspend.md", ""));

5. Draw, publish, and answer

The desk finds its own AgentCard, draws the page with a pen, and publishes the AppCard:

// WorkbenchApp.java
Surfaces pen = new Surfaces(group.space("views"), "workbench", InstantSource.system());
pen.create(Page.SURFACE, WidgetsCatalog.ID)
   .components(Page.SURFACE, Page.components())
   .data(Page.SURFACE, "/", Map.of("files", Page.files().stream().map(Page::row).toList(),
           "conversations", List.of(), "progress", List.of(), "working", List.of()));
AppCardPublisher apps = new AppCardPublisher(group.identity(), group.runtime(), group.discovery());
AppCard card = apps.publish(Page.card(group, agent)).join();
  • create, components, and data each write one envelope, numbered 1, 2, and 3.
  • AppCardPublisher signs the card and reissues it when the group's members change what they can read.

Then the desk answers each chat line. The Chat sends a line as the action write, with the line in its context:

// WorkbenchApp.java
for (SurfaceAction a : pen.actions()) {
    if (!"write".equals(a.action().get("name"))) {
        continue;   // the Chat's send is the page's write action
    }
    Map<?, ?> entry = (Map<?, ?>) ((Map<?, ?>) a.action().get("context")).get("entry");
...
    thread.add(Page.row(asked));
    thread.add(Page.row(answer));
    pen.data(Page.SURFACE, "/conversations", List.copyOf(thread));

The answer is a version 2 ChatMessage in text/markdown, so the Chat draws it as safe Markdown.

6. Find the page from another member

The looker starts with no knowledge of the workbench. It asks discovery for any app that draws pages over the open records, then for the agent that draws it:

// Looker.java
AppCard app = await(() -> group.discovery().find(AppCard.class, c -> c.drawsSurfaces() && c.handles(A2uiRecords.NAMESPACE)));
AgentCard agent = await(() -> group.discovery().find(AgentCard.class,
        c -> c.declaresUi() && c.agent().localName().equals(app.ui().agent())));

It reads the envelopes of the app's first page in sequence order, as every A2UI renderer does, and sends one chat line as the person ana:

// Looker.java
Map<String, Object> entry = Map.of("key", "main", "text", "Where did we overspend in Q3?", "inReplyTo", "", "attachments", List.of());
views.write(new SurfaceAction(SurfaceAction.VERSION, app.ui().agent(), surfaceId, "ana",
        Map.of("name", "write", "surfaceId", surfaceId, "sourceComponentId", "chat", "timestamp", Instant.now().toString(),
                "context", Map.of("type", "ChatMessage", "entry", entry)), Instant.now()), Lease.of(Duration.ofMinutes(5)));

7. Draw it in a browser

A page hands the envelopes to the Surfaces component of @agentspaces/a2ui-react and receives each action. The render check does exactly this in a test DOM:

// render-check.mjs
const envelopes = JSON.parse(readFileSync(process.argv[2] ?? 'envelopes.json', 'utf8'));
const actions = [];
const container = document.createElement('div');
document.body.appendChild(container);
const root = createRoot(container);
await React.act(async () => { root.render(React.createElement(Surfaces, { envelopes, onAction: a => actions.push(a) })); });

In a real page, link @agentspaces/a2ui-react/style.css as well. The package's README quick start draws a title bar over a split the same way.

Run it

Build the jar, start the desk, then start the looker, which joins through it. A script in the example then runs the render check over the envelopes the looker saved:

mvn -q package -DskipTests
java -jar target/workbench-1.0.0.jar &
java -jar target/workbench-1.0.0.jar --bench.port=7742 --bench.seeds=127.0.0.1:7741 --bench.role=looker --bench.out=envelopes.json
node render-check.mjs envelopes.json
kill %1   # stop the desk

The run of 2026-11-18 printed:

desk: drew workbench and published the AppCard workbench (fed, a2ui)
desk: ana asked "Where did we overspend in Q3?"
looker: found the AppCard workbench (fed, a2ui, transport views, catalogs [https://a2ui.org/specification/v1_0/catalogs/basic/catalog.json, agentspaces-viz, agentspaces-widgets])
looker:   the AgentCard of workbench shows tree = agentspaces-widgets/FileTree (panel, https://badmonkey.ai/agentspaces/a2ui/v1/SharedFile)
looker:   the AgentCard of workbench shows preview = agentspaces-widgets/FilePreview (panel, https://badmonkey.ai/agentspaces/a2ui/v1/SharedFile)
looker:   the AgentCard of workbench shows chat = agentspaces-widgets/Chat (control, https://badmonkey.ai/agentspaces/a2ui/v1/ChatMessage)
looker: workbench arrived as 3 envelopes
looker: /conversations now holds 2 lines; the agent answered "Travel ran **18 percent** over its budget."
looker: saved the 4 envelopes for a renderer to envelopes.json
render: drew 4 envelopes: the title bar, 4 tree items, the preview and the chat; a sent line came back as the action "write" from "chat"
PASS  workbench
  • The render check finds the words a person would see: the title, the status, both folders and both files, the question, and the answer.
  • It types "And in Q4?", presses Send, and checks that the renderer hands back the action write from the component chat, the action the desk answers.
aspace://guide/a2ui/library

The widget library

agentspaces-a2ui ships two open catalogs as JSON in its jar, with builders that refuse what a catalog would refuse. @agentspaces/a2ui-react draws both. Both catalogs are open data, so a host adds its own beside them.

agentspaces-viz: what people look at

GroupComponents
DataChart (by the dataviz method), DataTable, Map, Graph, Timeline, Report, Stat, KeyValue
Messages and inputNotification, Notice, Form, Conversation, Prose
PanelsWindow, Toolbar
The frame of a pageTitleBar, Menu, Split
  • An agent names series and paths. The renderer draws them with the host's look and feel, and nothing executes.
  • TitleBar shows the page's title, a status from the WorkingOn rows, buttons, and an overflow Menu.
  • Menu and Split follow the WAI-ARIA Menu Button, Menu, and Window Splitter patterns, with the keyboard each pattern names.
  • The look-and-feel schema holds tokens only (colours, type, spacing, density, radius, shadow) for light and dark modes. It carries no URL, markup, or stylesheet.

agentspaces-widgets: the application components

ComponentWhat a person seesReads
Chata thread as bubbles, the agent's progress and steps, Markdown answers, attachment and citation chips, copy, retry, stop, and feedbackChatMessage, ChatProgress
FileTreethe shared files as folders, with the WAI-ARIA tree keyboard, badges, upload, and a context menuSharedFile, WorkingOn
FilePreviewone file by its media type: text, Markdown, CSV as a table, PNG, JPEG, and PDF in a sandboxed frameSharedFile
ChatInput, FileSharealiases of Chat and FileTree through 0.6.xas above
ApprovalCard, TimelineStripa ballot card over a group's vote, and a request's timelinerows of the data model

On a surface of this catalog, @agentspaces/a2ui-react also draws the basic catalog's components and those of agentspaces-viz. That is how the workbench puts a TitleBar over a Split of widgets inside a basic Column.

A2UI 1.0 lets one page mix catalogs: createSurface names the page's default catalog, and a component from another one names its own with @catalogId. A third-party renderer draws a page only when it knows every catalog the page uses, so write a page on the basic catalog when a third-party renderer must draw it.

The builders in three languages

BuilderJava (Surfaces)TypeScript (a2ui of @agentspaces/client)Python (agentspaces.a2ui)
title bartitleBar, titleStatus, titleActiontitleBar, titleStatus, titleActiontitle_bar, title_status, title_action
menumenu, trigger, menuItem, submenumenu, trigger, menuItem, submenumenu, trigger, menu_item, submenu
splitsplit, panesplit, panesplit, pane
widgetschat, fileTree, filePreviewchat, fileTree, filePreviewchat, file_tree, file_preview
  • Java also builds the rest of agentspaces-viz (chart, dataTable, map, graph, timeline, report, notification, form, stat, window, notice, toolbar, keyValue, prose, conversation) and the basic catalog's common parts (text, bound, column, row, card, button, divider).
  • Java alone builds the analysis parts of agentspaces-viz: visualize(id, rows, mark, x, y, options), a chart of a table by a spec; heatmap(id, rows, x, row, value, options), the heatmap mark, a grid with small multiples and a pick (heatmapPick); and graphView(id, nodes, edges, layout, options), a graph laid out force, tree, or layered. The React renderer draws all three.
  • A heatmap's pick and a table's row actions can also steer a GeoMap of the separate agentspaces-geo catalog, which is not published.
  • The TypeScript and Python builders check the same options and words as the Java ones, so a page built in any of the three has the same shape.
  • All three hold a page to A2UI 1.0. A binding is {"@path": ...}, an id is an identifier, and a component's kept keys carry their @. Each refuses the older form and names where it sits. Java's pen checks the ids as it writes; the TypeScript and Python builders, which have no pen, check them as they build.
  • A button(id, childText, ...) writes its label as a Text whose id is <id>Text, so the button ship draws its label from shipText. Keep that id free.
  • The basic Text takes the variants caption and body. One invalid component refuses its whole surface, so a Text with any other variant, such as h2, draws nothing.
  • Surfaces.draw(surfaceId, envelopes) draws a page authored elsewhere, such as the output of the A2UI Composer, under any surface id.

Calls from a page to the agent

A page can ask the agent that drew it for a value, A2UI 1.0's callAgentFunction:

  • Surfaces.functionCall(function, args) writes the call as a component's action, and Surfaces.functionButton is a button that makes it. The arguments go through the same binding check as every property.
  • The name is an identifier of at most 64 characters, and none of the basic catalog's own functions, which the renderer runs itself.
  • The call reaches the agent as a SurfaceAction whose callsFunction() is true, with function() and args().
  • The agent answers with pen.answer(call, value) or pen.fail(call, code, message). Each writes a FunctionResponse record into views, leased a minute. The value is JSON of at most 32,768 characters.

The open records

Four records under https://badmonkey.ai/agentspaces/a2ui/v1/ carry what the widgets read (SPEC §6.1a.7). They are plain entries, so any agent can write them:

RecordSpaceWhat it holds
ChatMessageconversationsone line of a thread: id, key (the thread), from, text, attachments, inReplyTo, at; version 2 adds format and cites
SharedFilesharedone shared file: name, mediaType, bytes, root on the content swarm, sha256, by, sharedWith; version 2 adds path and replaces
WorkingOnviewswhat an agent holds while it works: agent, key, files, task, state; leased 60 seconds
ChatProgressviewsan agent's progress on one line: state and up to 20 steps (read, tool, write); leased 30 seconds
  • The Space column names the space where an agent writes the record as an entry. A page reads the same shapes as rows of its data model, as the workbench does at /files and /conversations.
  • state takes the task states of A2A: submitted, working, input-required, completed, failed, and canceled.
  • The Java constructors refuse a value outside the bounds, and the TypeScript and Python codecs refuse the same values.
  • A member that reads version 2 advertises the hint a2ui.records=2. A writer asks A2uiRecords.versionFor(...) which version to write.

A standard page: the conversation

An app with a chat and data beside it can take one layout instead of building its own. The Publish names it in options.layout:

// PublishOptionsTest.java
Map<String, Object> layout = Publish.conversation("chat", 0.4, List.of(Publish.area("documents", "Documents", "list"), Publish.area("answer", "How I found it", "")));
  • The top bar carries the app's title, its lede, and the areas as tabs. The page's tools, such as sign-out, sit at its end.
  • The left half draws the chat's page, chat here, at size of the width (0.2 to 0.6; 0.4 when 0). The thread grows down the page as a person chats, and a new line brings the message box back into view.
  • The right half draws the current area's page and stays in view while the chat grows. The chat stays the same across areas. The current area rides in the URL fragment, #page=<id>.
  • Below 900 pixels the halves stack, with the chat first.

Two more pieces suit this page:

  • Window.appearsWith names a path. The window stays hidden until the path holds a row, then appears with a short highlight. Results arrive on the right as the agents produce them, not as empty tables.
  • A look's optional colours: bar, panel, field, button, highlight, highlightInk, and info, beside surface, ink, and accent. Each falls back to what a look without it draws. A dark look for operations rooms sets the bar, the panels, and the input fields apart from the page.
  • New in 0.7.0: line and lineStrong. line draws hairlines: borders, dividers, and table rules. lineStrong draws hover borders and graph edges.
  • New in 0.7.0: inkFaint and accentInk. inkFaint draws the faintest text that still reads, such as counts and timestamps. accentInk draws text on the accent, as on a primary button.
  • New in 0.7.0: type.mono. It names the fixed-width family for code, ids, and figures, as a list like type.family.
  • Every 0.6.0 look stays valid. Each new colour falls back to what a look without it draws. The renderer also derives soft tints of the accent and status colours, an extra-small and an extra-large space, a larger radius, and an overlay shadow.

The React renderer

@agentspaces/a2ui-react is the open renderer of both catalogs. It draws A2UI 1.0 envelopes on top of the A2UI project's own React renderer, @a2ui/react 0.16.1, the first release of the 1.0 final, through its v1_0 entry, and its @a2ui/web_core.

  • Surfaces draws a list of envelopes over the basic catalog and both open catalogs, and hands each action to onAction.
  • registerComponents and registerAlias let a host add its own catalog beside ours.
  • Pages draws a published app's navigation and layout. CommandPalette opens on Ctrl or Cmd and K, so a person runs the page's actions from the keyboard.
  • A host gives a page its uploads through uploaders and its file addresses through fileSources, and adds extras under an answer with registerChatExtra.
  • <agentspaces-split> and <agentspaces-tree> in ./elements work in a page without React.
  • Gallery shows every golden page of both catalogs with the envelopes that draw it, and each frame component in four states: full, empty, loading, and error.

Install it from a clone of the workspace beside React 18 or 19, since npm publication of @agentspaces/* packages is planned. Pin markdown-it 14 and zod 3, the majors the package and @a2ui/react declare:

npm install react react-dom @a2ui/react@0.16.1 @a2ui/web_core@0.16.1 markdown-it@14 zod@3 ../agentspaces-a2ui-react
aspace://guide/a2ui/transports

How a page travels

The AppCard's ui.transport says how a page's envelopes reach people. It has two values.

TWO TRANSPORTS: THE GROUP'S VIEWS SPACE, OR A2A THROUGH A GATEWAYoutside the groupAgentSpacesui.transport viewsagentSurfaces penspace viewsSurface, SurfaceActiona membera renderer joinsa personin a browserui.transport a2aagentSurfaces penspace viewsSurface, SurfaceActionan A2A gatewaya console's, todayan A2A clientapplication/a2ui+jsonThe open core ships the views path end to end. Its A2A gateway carries tasks; a console's gateway carries the envelopes.
Two transports. views keeps everything inside the group. a2a hands the same envelopes to an A2A client through a gateway.

views: through the group

  • The agent's pen writes Surface entries into the group's views space, and a renderer writes SurfaceAction entries back.
  • Any member that reads views can render: a Java peer, a TypeScript peer in a browser, or a feed that serves a web page.
  • A renderer that joins late reads the whole page back in sequence order, because the entries are still alive under their leases.
  • This path is open source end to end. The workbench example uses it.

a2a: through a gateway

  • An app whose kind is gateway writes ui.transport a2a. Its pages reach A2A clients through a gateway.
  • A2UI defines an A2A extension. The envelopes travel in an A2A DataPart whose data is a list of A2UI messages and whose metadata.mimeType is application/a2ui+json. The client lists the catalogs it draws under a2uiRendererCapabilities in its message metadata, which v0.9.1 called a2uiClientCapabilities.
  • AgentSpaces' open A2A gateway (agentspaces-a2a) serves a group's AgentCards as A2A agent cards and its tasks over A2A. It speaks A2A 1.0 and 0.3 at one URL: each card lists both interfaces, 1.0 first, and the client's A2A-Version header picks one. It does not carry A2UI envelopes.
  • The Bad Monkey console's gateway serves an app's pages over A2A 1.0 or 0.3 with the A2UI extension for 1.0. The enterprise guide covers the console.

Publishing a page for end users

  • pen.publish(surfaces, title, host, signOn) writes a Publish entry: a request that a host in the group serve the pages as an application at an address of its own.
  • signOn is idp (the host's identity provider, the default) or none (anyone may open it). Any other value fails closed.
  • The host sets the AppCard's host block: url, port, hostAgent, path, signOn, publishedBy, publishedAt, and status (SPEC §6.1a.4).
  • A static app works the same way without envelopes: the agent publishes a StaticBundle on the content swarm and writes a PublishStatic that names its root. Its AppCard's kind is assembled.
  • The open core defines the records. The app host that serves them ships with the Bad Monkey console.
aspace://guide/a2ui/ecosystem

The A2UI ecosystem

The A2UI project has its own maintainers. AgentSpaces uses its protocol and its renderers, and this part says plainly where the two meet.

THE A2UI ECOSYSTEM, AND WHERE AGENTSPACES SITS IN ITthe A2UI projectAgentSpacesthe A2UI protocola2ui.org, Apache 2.0v1.0 current, stable; AgentSpaces writes this onev0.9.1 previousv0.8 deprecatedagent SDKsturn model output into envelopesa2ui-agent-sdk (Python)@a2ui/agent (TypeScript)a2ui_agent (Dart)official renderersand 20 community renderersReact, Lit, AngularFlutter, SwiftUIJetpack Composeagentspaces-a2uiwrites 1.0 into a spaceSurfaces pen, Java buildersagentspaces-vizagentspaces-widgets@agentspaces/a2ui-reactthe open React rendererdraws both open catalogsbuilt on @a2ui/react 0.16and @a2ui/web_coretransportshow envelopes travelAgentSpaces views space yesA2A (a gateway) a consoleAG-UI, MCP, WebSockets not shippedwritesrendersnot yetAG-UI and MCP bindings, inline catalogscalls from the agent to the rendererworks todaybasic-catalog pages: any 1.0 rendererthe open catalogs: the React rendererFacts from a2ui.org, checked 2026-11-18. AgentSpaces uses the A2UI protocol and its renderers; the project has its own maintainers.
The A2UI ecosystem. AgentSpaces writes the protocol, carries it, and draws it with a renderer built on the project's own. The dashed box lists what it does not do yet.

What A2UI is

  • A2UI (Agent-to-User Interface) is, in its own words, "an open-source generative UI framework and streaming protocol." It is an Apache 2.0 project at github.com/a2ui-project/a2ui.
  • The Google A2UI Team introduced it on December 15, 2025, as "an open-source project, complete with a format optimized for representing updateable, agent-generated UIs."
  • Its core promise is safety and native look: "No untrusted code is executed on the client." An agent may place only the components a client's catalog registers, and the client draws them with its own widgets.

Its versions

VersionStatus at a2ui.orgAgentSpaces
v1.0current, and stable since November 5, 20260.7.0 writes and reads this one
v0.9.1previous, closed December 3, 20250.6.x wrote it; 0.7.0 does not read it
v0.9previousnot read
v0.8deprecatednot supported
  • v1.0 keeps the four envelope names and sets their version to 1.0. It adds function calls in both directions, lets one page mix catalogs, removes theme, and reserves an @ prefix: @path for bindings and @call for function calls.
  • Its final form also moves a component's kept keys under the @: @catalogId, @accessibility, @metadata, and @checks. id and component stay as they are. The open catalogs declare the @ keys on every component.
  • The project's v1.0 evolution guide lists every change. The v1.0 specification is what Surface.A2UI_VERSION names.

Renderers and SDKs

The project ships official renderers (see its SDKs page):

FrameworkPackageA2UI versions
React@a2ui/reactv0.8, v0.9.1, v1.0
Lit@a2ui/litv0.8, v0.9.1, v1.0
Angular@a2ui/angularv0.8, v0.9.1, v1.0
Fluttera2ui_flutterv0.9.1, v1.0
SwiftUIA2UISwiftUIv0.9.1, v1.0
Jetpack Composeandroidx.a2ui.composev0.9.1
  • The community renderers page lists 20 more, among them Vue, Svelte, Lynx, React Native, Compose Multiplatform, and terminal renderers in Go and Ink.
  • Agent SDKs turn model output into envelopes: a2ui-agent-sdk for Python, @a2ui/agent for TypeScript, and a2ui_agent for Dart.
  • Any 1.0 renderer draws an AgentSpaces page written on the basic catalog, and a renderer limited to v0.9.1, such as Jetpack Compose today, does not. To draw a page on agentspaces-viz or agentspaces-widgets, a renderer needs our React renderer or its own implementation of the two catalogs, which are open JSON.

A2UI, A2A, AG-UI, and MCP

These four names come up together, and each does a different job:

  • A2UI describes what the user sees and touches. AG-UI's own documentation puts it this way: "A2UI is a generative UI specification - allowing agents to deliver UI widgets."
  • A2A connects agents to agents. Google developed it and donated it to the Linux Foundation. A2UI's A2A extension carries envelopes as A2A message parts.
  • AG-UI is "the Agent↔User Interaction protocol - which connects an agentic frontend to any agentic backend." The A2UI v1.0 specification calls it "the standard transport binding for Agent-to-User Interaction."
  • MCP connects agents to tools and data. A2UI can travel in MCP tool outputs or resource subscriptions.

Where AgentSpaces fits:

  • A2UI is transport-agnostic. The specification mandates no transport, only a contract, such as delivery in the order the agent wrote. AgentSpaces carries envelopes in a group's space and keeps that order with the pen's per-page sequence number.
  • The open records borrow A2A's task states, and their states and steps map onto AG-UI's RunStarted, RunFinished, ToolCallStart, and ToolCallEnd for a reader that speaks AG-UI. AgentSpaces ships no AG-UI or MCP binding for envelopes today.

Who builds on A2UI

The project's Built with A2UI page lists:

  • Alation, whose AIOS builds data feeds with metric cards and charts.
  • ByteDance, which released an A2UI renderer for its Lynx framework in June 2026.
  • Atlassian, whose Jira agents ask for follow-up input through an interactive card in the work item.
  • Google, in Gemini Notebook and in Gemini Enterprise.

The A2UI v0.9 announcement names AG2, Vercel, Oracle's Agent Spec, and CopilotKit among the projects that work with it.

aspace://guide/a2ui/appendix

Appendix: how it works and why

This appendix explains the mechanics behind the main text, for readers who want to change them or debug them.

How the pen writes a page

  • Each pen call writes one Surface entry: the app, the surface id, the catalog id, a sequence number, the envelope, and the A2UI version.
  • The pen numbers envelopes per surface from 1 and tags each entry with app, surfaceId, kind, and seq, so a renderer can select one page's entries without decoding the rest.
  • A page's creation, its components, its whole data model, and its publish live for the pen's lease, a day unless you give the pen another.
  • An update of one path lives for the pen's update lease, a minute by default (Surfaces.DEFAULT_UPDATE_LEASE). A path updated every second must not leave an entry for every second in a space every member replicates.
  • pen.actions() returns the SurfaceAction entries for the pen's app that it has not handed out yet.

Why a space and not a socket

  • A socket ties a page to one connection. A space keeps the page as leased entries, so a renderer that joins or reconnects reads the page back in order.
  • Every member replicates the entries, so the agent and the renderer need not be up at the same moment, and either can restart.
  • The same entries feed many renderers at once: a browser, a console, and a test, with no fan-out code in the agent.
  • The pattern is the one AgentSpaces uses everywhere: write typed entries, let others read or take them. The developer guide covers the space verbs.

How the binder derives the AgentCard's ui

  • The binder reads every @UiComponent on the agent's class and its public methods, one component per annotation.
  • A component's id defaults to its component name, and each id must be unique within the card.
  • The binder fills entries.reads and entries.writes from each annotation's reads and writes flags, and derives catalogIds from the components.
  • It refuses a control that names no action of the card at bind time, so a card never promises a button nobody answers.
  • At most 32 components, 16 controls per component, and 64 IRIs per list fit in one card.

How the AppCard reaches members

  • AppCardPublisher signs each card with the peer's key and publishes it to the group's ad cache, which gossips it to every member.
  • The fields origin, formats, a host with signOn idp, and spill wait on a gate: the publisher writes them only while every member of its view advertises the hint wire.appcard=2. Otherwise it issues the card without them and counts it in appCardsDowngraded.
  • When a member below that level joins or leaves, the publisher reissues the card at once under a newer issued.
  • A card whose encoding passes 65,536 bytes travels as a stub while the gate is open and a content swarm serves the group: the publisher moves reads, actions, views, and ui into a content-swarm document. discovery.resolve(card) fetches it when a reader needs it.
  • card.handles(format) lower-cases a media type and matches an entry exactly, and type/* matches every subtype.

How a builder checks its options

  • Each builder of the two open catalogs reads the component's property schema from the catalog in the jar.
  • It refuses a key the component does not declare, a word outside an enum, and a number outside its minimum and maximum.
  • It also refuses v0.9.1's {"path": ...} binding and {"call": ...} call, and a kept key written without its @, such as catalogId for @catalogId. The pen refuses an id that is not an identifier when it writes the page. Below a component's top level it refuses any other key that starts with a single @, since 1.0 keeps those; a literal one is written doubled, @@type for @type.
  • So a page that builds is a page the catalog accepts. A mistake fails where you wrote it, and never in a person's browser.

Why nothing executes

  • A2UI sends data, never code. A renderer draws only the components its catalogs register.
  • An AppCard asserts what its issuer signs. The party that admits the card enforces what the app may read and request, and the agent that answers a control checks what a person may do.
  • FilePreview draws PDF in a sandboxed frame, and HTML and SVG as their text.
  • Each browser keeps a random chat secret, which proves to the host that a thread is that visitor's own. The Chat sends it only with the page's write action, so a design that names another action never carries it.

How the records keep old readers working

  • A writer leaves a version 2 field of ChatMessage or SharedFile off the wire while it is null, so a version 1 value encodes to exactly the version 1 bytes.
  • A strict reader refuses a field it does not know, so a writer writes version 2 into a group only when every member that reads the type advertises a2ui.records=2.
  • Readers take both versions through 0.6.x.
  • Golden vectors pin each version's bytes: chat_message_v1, chat_message_v2, shared_file_v1, shared_file_v2, working_on_v1, and chat_progress_v1. The Java, TypeScript, and Python codecs decode the same vectors.

Why 1.0, and since when

  • AgentSpaces pins one A2UI version on the wire, and the cards say which (ui.version), so every member knows what it reads.
  • 0.7.0 moved every writer and reader from v0.9.1 to 1.0 at once, on November 12, 2026. A 0.7.0 member does not read a v0.9.1 page, and a 0.6.x member does not read a 1.0 one, so upgrade a group's agents and renderers together.
  • 1.0 is the current version, and the A2UI project marked it stable on November 5, 2026. Every official renderer but Jetpack Compose reads it.
  • New golden vectors pin the 1.0 envelopes and the cards with ui.version 1.0.

How the example checks itself

  • The example's script refuses to start when port 7741 or 7742 is held, and leaves the other process alone.
  • It builds the jar into a scratch directory, starts the desk, and runs the looker with a 90-second limit.
  • The looker saves the four envelopes it read. render-check.mjs draws them with the built @agentspaces/a2ui-react in happy-dom, checks the words a person sees, and sends a line through the Chat.
  • The script prints PASS only when the looker read the agent's answer and the render check passed.