Skip to main content

Module schema

Module schema 

Source
Expand description

The three JSON Schema documents that describe a surface, and surgery on them.

A2UI v0.9 splits its schema into three files that travel together:

  • server-to-client — the message envelopes;
  • common typesComponentId, ChildList, the Dynamic* bindings;
  • catalog — the components and functions themselves.

SchemaBundle holds all three, because everything you do with one you do with all three: put them in a prompt, restrict them to a subset of components, hand them to a validator.

§Why prune

The whole point of the v0.9 “prompt-first” design is that the schema goes into the model’s context. That context is finite, and an agent usually wants the model to use ten components rather than the catalog’s eighty. Pruning is how you say so: SchemaBundle::prune keeps the components (or messages) you allow and then walks $refs to drop every type that nothing kept still refers to — including transitively, so a shared type survives exactly as long as something still points at it.

Structs§

SchemaBundle
The three schema documents describing one surface contract.

Constants§

SCHEMA_BLOCK_END
Closing marker of the prompt’s schema block.
SCHEMA_BLOCK_START
Markers around the schema block in a generated prompt.

Functions§

load_examples
Loads few-shot examples for a prompt.
remove_strict_validation
Removes every additionalProperties: false, recursively.