aindrive/docs

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.

Version1.0 (messages carry "version": "1.0"; incoming v0.9 actions are still accepted)
Catalogbasic catalog https://a2ui.org/specification/v1_0/catalogs/basic/catalog.json — no custom components to install
MIME typeapplication/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

SkillSurfaceWhat it shows
list_drivesaindrive-drives-*the user's drives; each opens with aindrive.open_drive
list_filesaindrive-browser-*folder title, ⬆ Up, search box, one row per entry (🔒 = paid, not bought)
searchaindrive-search-*matches with full paths, same toolbar
read_fileaindrive-preview-*text / markdown / code, or the image itself; ⬅ Back
write_file, delete_path, stataindrive-result-* / aindrive-stat-*a card with the outcome and 📁 Open folder
any erroraindrive-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.namecontextRuns
aindrive.opendrive_id, path, is_dirlist_files (folder) or read_file (file)
aindrive.searchdrive_id, query, pathsearch (empty query → list_files)
aindrive.open_drivedrive_idlist_files at the drive root
TransportSend the action as
MCPtools/call → a2ui_action with { "action": … }
A2Aa DataPart { "version": "1.0", "action": … }
AG-UIforwardedProps.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.

TransportAsk for AINUI with
MCPrequest header X-AINUI: 1
AG-UIforwardedProps.ainui = true
A2Amessage 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 FileView over 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 or Authorization: Bearer <session JWT>.
  • Write actions — aindrive.new_file, aindrive.edit, aindrive.save, aindrive.delete (plus aindrive.view for list/grid) — are offered only to callers that may write, and each one passes the same checks as calling write_file / delete_path yourself. 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
[]