A2UI — the UI every result carries
A2UI is a declarative UI format: the agent sends JSON, your app draws it with its own native components. aindrive describes the result of every skill as an A2UI surface and sends the same surface over MCP, A2A and AG-UI — one UI definition, three transports.
| Version | 1.0 (messages carry "version": "1.0"; incoming v0.9 actions are still accepted) |
| Catalog | basic catalog https://a2ui.org/specification/v1_0/catalogs/basic/catalog.json — no custom components to install |
| MIME type | application/a2ui+json |
| Renderers | @a2ui/lit, @a2ui/react, @a2ui/angular, Flutter, CopilotKit — or aindrive's tiny dependency-free renderer (shared/a2ui/renderer.js, which also draws AINUI, below) |
Surfaces
| Skill | Surface | What it shows |
|---|---|---|
list_drives | aindrive-drives-* | the user's drives; each opens with aindrive.open_drive |
list_files | aindrive-browser-* | folder title, ⬆ Up, search box, one row per entry (🔒 = paid, not bought) |
search | aindrive-search-* | matches with full paths, same toolbar |
read_file | aindrive-preview-* | text / markdown / code, or the image itself; ⬅ Back |
write_file, delete_path, stat | aindrive-result-* / aindrive-stat-* | a card with the outcome and 📁 Open folder |
| any error | aindrive-error-* | a card with [code] message |
Each surface is three messages — createSurface, updateComponents (a flat
component list with a root), and updateDataModel (path /). List rows are
a template over /items:
{ "label": "📄 report.pdf", "meta": "1.2 MB", "path": "docs/report.pdf",
"is_dir": false, "drive_id": "…" }
Actions (renderer → aindrive)
Buttons fire A2UI action events. Send the resolved action back through the
transport you use; aindrive answers with the next surface.
action.name | context | Runs |
|---|---|---|
aindrive.open | drive_id, path, is_dir | list_files (folder) or read_file (file) |
aindrive.search | drive_id, query, path | search (empty query → list_files) |
aindrive.open_drive | drive_id | list_files at the drive root |
| Transport | Send the action as |
|---|---|
| MCP | tools/call → a2ui_action with { "action": … } |
| A2A | a DataPart { "version": "1.0", "action": … } |
| AG-UI | forwardedProps.a2uiAction = { userAction: … } |
AINUI — grids, thumbnails and write actions (opt-in)
The basic catalog has no grid, no thumbnail tile, no way to point at private file
bytes and no file viewer, so aindrive also speaks AINUI: the same A2UI 1.0
messages with a custom catalog, https://ainui.ainetwork.xyz/catalogs/ainui/v2/catalog.json
(AINUI v2) = the basic catalog plus AIN components such as Grid, Tile, FileView,
Breadcrumbs and Segmented. The v1 document stays at
https://aindrive.ainetwork.ai/ainui/v1/catalog.json for surfaces made before 2026-11-26. Clients that don't ask for it see no change.
| Transport | Ask for AINUI with |
|---|---|
| MCP | request header X-AINUI: 1 |
| AG-UI | forwardedProps.ainui = true |
| A2A | message metadata.ainui = true |
- Folders are a breadcrumb trail, search, a list/grid switch and a grid of tiles (grid by default when at least half of the files are images or videos).
- Files are a
FileViewover an asset reference, not inline bytes:{"$asset": {"drive_id", "path", "variant": "thumb"|"original", "mime", "v"}}. Your host turns it into a URL through a route it is allowed to call — aindrive's/api/drives/{drive_id}/fs/thumbnail|stream?path=…accept the session cookie orAuthorization: Bearer <session JWT>. - Write actions —
aindrive.new_file,aindrive.edit,aindrive.save,aindrive.delete(plusaindrive.viewfor list/grid) — are offered only to callers that may write, and each one passes the same checks as callingwrite_file/delete_pathyourself. Multi-step actions answer with the next screen (new file → editor, save → file, delete → the parent folder).
Full spec: AINUI v1. Try it with the AINUI switch in the playground below.
Rendering it yourself
import { createA2uiRenderer } from "<aindrive>/shared/a2ui/renderer.js"; // or @a2ui/lit / @a2ui/react
const view = createA2uiRenderer(document.getElementById("app"), {
onAction: async (action) => view.replace(await sendToAindrive(action)),
});
view.replace(messages); // the application/a2ui+json payload
Playground
The surfaces below are generated by the same code the endpoints use, with sample data. Click around — the action each click would send is shown under it.
Last action sent by the renderer
(click something above)
A2UI messages for the current surface
[]