Skip to content

Implement Client Capabilities Generation #841

@jacobsimionato

Description

@jacobsimionato

Proposal: Implement Client Capabilities Generation

Reason

The A2UI server needs to know which components and functions the client supports to generate compatible UI. The MessageProcessor is the logical place to aggregate this information, but it currently lacks the logic to export registered catalogs as JSON Schema.

Design

Implement a getClientCapabilities() method in the MessageProcessor.

  1. Catalog Traversal: Iterate through all Catalog instances provided at construction.
  2. Schema Conversion: Convert Zod schemas for every component and function into standard JSON Schema objects using zod-to-json-schema.
  3. External References: Use the "REF:" description tag convention (e.g., REF:common_types.json#/$defs/DynamicString) to detect common types and replace them with standard $ref pointers in the output, preventing massive inlined schemas.
  4. Envelope Matching: Ensure the generated component schemas are wrapped in the standard adjacency-list envelope (id, component, weight).

Key Files

  • renderers/web_core/src/v0_9/processing/message-processor.ts
  • renderers/web_core/src/v0_9/catalog/types.ts

Metadata

Metadata

Labels

Type

No type

Projects

Status

Todo

Relationships

None yet

Development

No branches or pull requests

Issue actions