Skip to content

Commit 2a4b454

Browse files
committed
docs: finalize v0.8/v0.9 catalogs.md and fix links
1 parent 47aa1e6 commit 2a4b454

File tree

4 files changed

+447
-38
lines changed

4 files changed

+447
-38
lines changed

docs/scripts/prepare_docs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ def prepare_docs(repo_root):
5050
shutil.rmtree(dest_path)
5151

5252
# Copy the directory structure, ignoring specified patterns
53-
# We explicitly exclude 'eval' and 'test' directories as requested.
53+
# We explicitly exclude 'eval' and 'test' directories.
5454
shutil.copytree(source_path, dest_path, ignore=shutil.ignore_patterns(
5555
'node_modules', '__pycache__', '.*', 'dist', 'build', 'eval', 'test'
5656
))
Lines changed: 37 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ This guide defines the A2UI Catalog architecture and provides a roadmap for impl
66

77
## Catalog Definition
88

9-
A catalog is a [JSON Schema file](../specification/v0_9/json/a2ui_client_capabilities.json#L62C5-L95C6) outlining the components, functions, and themes that agents can use to define A2UI surfaces using server-driven UI. All A2UI JSON sent from the agent is validated against the chosen catalog.
9+
A catalog is a [JSON Schema file](specification/a2ui_client_capabilities_schema.json#L62C5-L95C6) outlining the components, functions, and themes that agents can use to define A2UI surfaces using server-driven UI. All A2UI JSON sent from the agent is validated against the chosen catalog.
1010

11-
[Catalog JSON Schema](../specification/v0_9/json/a2ui_client_capabilities.json#L62C5-L95C6) is below
11+
[Catalog JSON Schema](specification/a2ui_client_capabilities_schema.json#L62C5-L95C6) is below
1212

1313
```json
1414
{
@@ -59,15 +59,15 @@ Whether you are building a simple prototype or a complex production application,
5959

6060
### The Basic Catalog
6161

62-
To help developers get started quickly, the A2UI team maintains the [Basic Catalog](../specification/v0_9/json/standard_catalog.json).
62+
To help developers get started quickly, the A2UI team maintains the [Basic Catalog](specification/standard_catalog_definition.json).
6363

64-
This is a pre-defined catalog file that contains a standard set of general-purpose components (Buttons, Inputs, Cards) and functions. It is not a special "type" of catalog; it is simply a version of a catalog that we have already written and have open source renderers for.
64+
This is a pre-defined catalog file that contains a standard set of general-purpose components (Buttons, Inputs, Cards) and functions. It is not a special "type" of catalog; it is simply a version of a catalog that we have already written and have open source renderers for.
6565

6666
The basic catalog allows you to bootstrap an application or validate A2UI concepts without needing to write your own schema from scratch. It is intentionally sparse to remain easily implementable by different renderers.
6767

6868
Since A2UI is designed for LLMs to generate the UI at either design time or runtime, we do not think portability requires a standardized catalog across multiple clients; the LLM can interpret the catalog for each individual frontend.
6969

70-
[See the A2UI v0.9 basic catalog](../specification/v0_9/json/standard_catalog.json)
70+
[See the A2UI v0.8 basic catalog](specification/standard_catalog_definition.json)
7171

7272
### Defining Your Own Catalog
7373

@@ -77,7 +77,7 @@ By defining your own catalog, you restrict the agent to using exactly the compon
7777

7878
For simplicity we recommend building catalogs that directly reflect a client's design system rather than trying to map the Basic Catalog to it through an adapter. Since A2UI is designed for GenUI, we expect the LLM can interpret different catalogs for different clients.
7979

80-
[See an example Rizzcharts catalog](../samples/agent/adk/rizzcharts/rizzcharts_catalog_definition.json)
80+
[See an example Rizzcharts catalog](../../samples/agent/adk/rizzcharts/rizzcharts_catalog_definition.json)
8181

8282
### Recommendations
8383

@@ -88,7 +88,7 @@ For simplicity we recommend building catalogs that directly reflect a client's d
8888

8989
## Building a Catalog
9090

91-
A catalog is a JSON Schema file that conforms to the [Catalog schema](../specification/v0_9/json/a2ui_client_capabilities.json#L62C5-L95C6) that defines the components, themes and functions an agent can use when building a surface.
91+
A catalog is a JSON Schema file that conforms to the [Catalog schema](specification/a2ui_client_capabilities_schema.json#L62C5-L95C6) that defines the components, themes and functions an agent can use when building a surface.
9292

9393
### Example: A Minimal Catalog
9494

@@ -151,7 +151,7 @@ When the agent uses that catalog, it generates a payload strictly conforming to
151151

152152
### Freestanding Catalogs
153153

154-
A2UI Catalogs must be standalone (no references to external files) to simplify LLM inference and dependency management.
154+
A2UI Catalogs must be standalone (no references to external files) to simplify LLM inference and dependency management.
155155

156156
While the final catalog must be freestanding, you may still author your catalogs modularly using JSON Schema `$ref` pointing to external documents during local development. Run `scripts/build_catalog.py` before distributing your catalog to bundle all external file references into a single, independent JSON Schema file:
157157

@@ -205,7 +205,7 @@ This catalog imports only `Text` and `Icon` from the Basic Catalog to build a si
205205
{ "$ref": "standard_catalog_definition.json#/components/Text" },
206206
{ "$ref": "standard_catalog_definition.json#/components/Icon" },
207207
{
208-
"Popup": {
208+
"Popup": {
209209
"type": "object",
210210
"description": "A modal overlay that displays an icon and text.",
211211
"properties": {
@@ -226,29 +226,29 @@ This catalog imports only `Text` and `Icon` from the Basic Catalog to build a si
226226

227227
Client renderers implement the catalog by mapping the schema definition to actual code.
228228

229-
[Example Rizzcharts typescript renderer for the hello world catalog](../samples/client/angular/projects/rizzcharts/src/a2ui-catalog/catalog.ts).
229+
[Example Rizzcharts typescript renderer for the hello world catalog](../../samples/client/angular/projects/rizzcharts/src/a2ui-catalog/catalog.ts).
230230

231231
```typescript
232-
import { Catalog, DEFAULT_CATALOG } from '@a2ui/angular';
233-
import { inputBinding } from '@angular/core';
234-
235-
export const RIZZ_CHARTS_CATALOG = {
236-
...DEFAULT_CATALOG, // Include the basic catalog
237-
HelloWorldBanner: {
238-
type: () => import('./hello_world_banner').then((r) => r.HelloWorldBanner),
239-
bindings: ({ properties }) => [
240-
inputBinding('message', () => ('message' in properties && properties['message']) || undefined),
241-
inputBinding('backgroundColor', () => ('backgroundColor' in properties && properties['backgroundColor']) || undefined),
242-
],
243-
},
232+
import { Catalog, DEFAULT_CATALOG } from '@a2ui/angular';
233+
import { inputBinding } from '@angular/core';
234+
235+
export const RIZZ_CHARTS_CATALOG = {
236+
...DEFAULT_CATALOG, // Include the basic catalog
237+
HelloWorldBanner: {
238+
type: () => import('./hello_world_banner').then((r) => r.HelloWorldBanner),
239+
bindings: ({ properties }) => [
240+
inputBinding('message', () => ('message' in properties && properties['message']) || undefined),
241+
inputBinding('backgroundColor', () => ('backgroundColor' in properties && properties['backgroundColor']) || undefined),
242+
],
243+
},
244244
} as Catalog;
245245
```
246246

247247
## A2UI Catalog Negotiation
248248

249249
Because clients and agents can support multiple catalogs, they must agree on which catalog to use through a catalog negotiation handshake.
250250

251-
### Step 1: Agent advertises its support catalogs (optional)
251+
### Step 1: Agent advertises its support catalogs (optional)
252252

253253
The agent may optionally advertise which catalogs it is capable of speaking (e.g., in the A2A Agent Card). This is informational; it helps the client know if the agent supports their specific features, but the client doesn’t have to use it.
254254

@@ -322,19 +322,19 @@ A2UI component catalogs require versioning because catalog definitions are often
322322

323323
The `catalogId` is a unique text identifier used for negotiation between the client and the agent.
324324

325-
* **Format:** While the `catalogId` is technically a string, the A2UI convention is to use a **URI** (e.g., `https://example.com/catalogs/mysurface/v1/catalog.json`).
326-
* **Purpose:** We use URIs to make the ID globally unique and easy for human developers to inspect in a browser.
325+
* **Format:** While the `catalogId` is technically a string, the A2UI convention is to use a **URI** (e.g., `https://example.com/catalogs/mysurface/v1/catalog.json`).
326+
* **Purpose:** We use URIs to make the ID globally unique and easy for human developers to inspect in a browser.
327327
* **No Runtime Fetching:** This URI does not imply that the agent or client downloads the catalog at runtime. **The catalog definition must be known to the agent and client beforehand (at compile/deploy time)**. The URI serves only as a stable identifier.
328328

329329
### Versioning Guidelines
330330

331-
Unlike standard JSON parsers where extra data is safely ignored, A2UI requires strict versioning to prevent semantic errors. If a client silently drops a new component (like a new "Itinerary" component) because it doesn't recognize it, the user misses critical information.
331+
Unlike standard JSON parsers where extra data is safely ignored, A2UI requires strict versioning to prevent semantic errors. If a client silently drops a new component (like a new "Itinerary" component) because it doesn't recognize it, the user misses critical information.
332332

333333
To ensure the agent only generates UI the client can fully render, any structural change—even purely additive ones—requires a new catalog version. This is enforced by the A2UI JSON Schema which generally does not allow for unrecognized properties.
334334

335335
* **Structural Changes (New Version Required)** Any change that alters the semantic meaning of the A2UI JSON payload requires a new catalog version. This ensures the Agent never sends a component the Client cannot render. A new catalog version is required for:
336336
* **Adding a new component:** (e.g., adding `FacePile` or `Itinerary`).
337-
* **Adding a new property:** Even if optional, if the Agent generates it, it expects it to be rendered.
337+
* **Adding a new property:** Even if optional, if the Agent generates it, it expects it to be rendered.
338338
* **Renaming/Removing fields:** These are standard breaking changes.
339339

340340
* **Metadata Changes (Same Version Allowed)** You may keep the same catalog version only if the change has no impact on the generated JSON structure or the renderer's behavior. You can keep the version when
@@ -356,21 +356,21 @@ We recommend including the version in the catalogId. This allows using A2UI cata
356356

357357
To upgrade a catalog without breaking active agents, use A2UI Catalog Negotiation:
358358

359-
1. **Client Update:** The client updates its list of supportedCatalogIds to include *both* the old and new versions (e.g., [".../v2/...", ".../v1/..."]).
360-
2. **Agent Update:** Agents are rebuilt with the v2 schema. When they see the client supports v2, they prefer it.
359+
1. **Client Update:** The client updates its list of supportedCatalogIds to include *both* the old and new versions (e.g., [".../v2/...", ".../v1/..."]).
360+
2. **Agent Update:** Agents are rebuilt with the v2 schema. When they see the client supports v2, they prefer it.
361361
3. **Legacy Support:** Older agents that have not yet been rebuilt will continue to match against v1 in the client's list, ensuring they remain functional.
362362

363-
## A2UI Schema Validation & Fallback
363+
## A2UI Schema Validation & Fallback
364364

365365
To ensure a stable user experience, A2UI employs a two-phase validation strategy. This "defense in depth" approach catches errors as early as possible while ensuring clients remain robust when facing unexpected payloads.
366366

367367
### Two-Phase Validation
368368

369-
1. **Agent-Side (Pre-Send):** Before transmitting any UI payload, the agent runtime validates the generated JSON against the catalog definition.
370-
* Purpose: To catch hallucinated properties or malformed structures at the source.
371-
* Outcome: If validation fails, the agent can attempt to fix or regenerate the A2UI JSON, or it can do graceful degradation such as falling back to text in a conversational app.
372-
2. **Client-Side:** Upon receiving the payload, the client library validates the JSON against its local definition of the catalog.
373-
* Purpose: Security and stability. This ensures that the code executing on the user's device strictly conforms to the expected contract, protecting against version mismatches or compromised agent outputs.
369+
1. **Agent-Side (Pre-Send):** Before transmitting any UI payload, the agent runtime validates the generated JSON against the catalog definition.
370+
* Purpose: To catch hallucinated properties or malformed structures at the source.
371+
* Outcome: If validation fails, the agent can attempt to fix or regenerate the A2UI JSON, or it can do graceful degradation such as falling back to text in a conversational app.
372+
2. **Client-Side:** Upon receiving the payload, the client library validates the JSON against its local definition of the catalog.
373+
* Purpose: Security and stability. This ensures that the code executing on the user's device strictly conforms to the expected contract, protecting against version mismatches or compromised agent outputs.
374374
* Outcome: Failures here are reported back to the agent using the “error” client message
375375

376376
### Graceful Degradation
@@ -379,7 +379,7 @@ Even if a payload passes schema validation, the renderer may encounter runtime i
379379

380380
Clients should not crash when encountering these errors. Instead, they should employ Graceful Degradation:
381381

382-
* **Unknown Components:** If a component is recognized in the schema but not implemented in the renderer, render a "safe" fallback (e.g., a generic card with the component's debug name) or skip rendering that specific node entirely.
382+
* **Unknown Components:** If a component is recognized in the schema but not implemented in the renderer, render a "safe" fallback (e.g., a generic card with the component's debug name) or skip rendering that specific node entirely.
383383
* **Text Fallback:** If the entire surface fails to render, display the raw text description (if available) or a generic error message: *"This interface could not be displayed."*
384384

385385
### Client-to-Server Error Reporting
@@ -404,5 +404,5 @@ Example of client reporting a missing required field
404404

405405
## Inline Catalogs
406406

407-
Inline catalogs sent by the client at runtime are supported but not recommended in production. More details about them can be found [here](../specification/v0_9/docs/a2ui_protocol.md#client-capabilities--metadata).
407+
Inline catalogs sent by the client at runtime are supported but not recommended in production. More details about them can be found [here](specification/docs/v0.8-a2ui.md#catalog-negotiation).
408408

0 commit comments

Comments
 (0)