Modules
Elixir implementation of the A2UI protocol core engine: versioned message envelopes, catalog schemas, surface state, data model, and processing of agent-to-renderer updates.
What a component tells assistive technology.
A versioned set of component and function definitions: the model of a catalog document.
The basic catalog of a protocol version, ready to evaluate.
A component a catalog declares: the name a message uses and its JSON
Schema as the catalog document writes it (with its allOf mixins and
references), plus the v1.0 composition constraints (allowedParents,
allowedChildren).
Reads a catalog document into the parts of an A2UICore.Catalog
(parse/2) and writes those parts back as a document (build/1), so
that build(parse(document)) equals document, apart from the
components and functions that $defs.anyComponent /
$defs.anyFunction leave out.
A function a catalog declares: its schema plus, when the catalog can evaluate it, an implementation.
The A2UI MCP catalog, ready to evaluate: the catalog through which a surface calls Model Context Protocol tools.
Which properties of a component refer to other components, and how to pull those references out of a component's properties.
Derives, from a catalog's component schemas, which properties are
child references — the data A2UICore.Catalog.RefSpec extracts from.
$ref handling for catalog documents.
Normalizes the schema nodes a catalog's validation schema is assembled from, as the reference catalog does before bundling common types
Builds a catalog's validation schema: the self-contained JSON Schema
messages are validated against (the reference's
Catalog.validation_schema).
Value coercions shared by the catalog functions: truthiness, text and number conversion.
Validates values against the protocol's shared type definitions — the
$defs of each version's common_types.json (DynamicValue,
FunctionCall, ChildList, Action, v1.0 Extensions, …).
The single error struct used across the A2UI packages.
A single structured diagnostic entry attached to an A2UICore.Error.
Parser for A2UI expression templates — the ${…} interpolation
language used by formatString and by dynamic string values.
Locale-sensitive formatting for the basic catalog's formatNumber,
formatCurrency, formatDate and pluralize functions.
The built-in A2UICore.Formatter: en-US conventions for every locale.
Implementations of the basic catalog's functions.
Implementations of the MCP catalog's functions (see
A2UICore.Catalog.MCP).
Functions the runtime supplies to every catalog: the @ namespace.
UAX #31 identifier validation for catalog entity names, with the
upstream pattern ^[\p{XID_Start}_][\p{XID_Continue}]*$, compiled
like a schema pattern by A2UICore.Schema.ECMA262: exact on
Erlang/OTP 28 and later, an approximation on older PCRE.
JMESPath queries over JSON
data: the engine behind the MCP catalog's jmespath function.
JSON values whose objects keep their key order, as
Jason.OrderedObjects, for writing a document in a given order:
Jason.encode!/1 writes an ordered object's keys in order, and a
map's in the map's own order.
Reading A2UI out of Model Context Protocol values: the A2UI messages a tool result or a resource carries, the UI resources a tool or a result names, and the MCP Apps a resource holds.
A connection to a Model Context Protocol server, as the MCP catalog's functions use it.
Wire messages: decode raw agent→renderer payloads into canonical
A2UICore.Message.Operation structs, and encode operations back to
wire-format maps.
Version adapter behaviour and the shared envelope-extraction pipeline.
Resolves version adapters from version strings and raw payloads — a
faithful port of the reference VersionAdapterFactory, including
its error detail paths (messages.0.version, …).
Version-neutral operations: what A2UICore.Message.decode/2 returns
and A2UICore.Processor.apply_operations/3 applies.
An agentFunctionResponse message (v1.0): the agent's answer to the
renderer's call function_call_id, either a value or an error
map with "code" and "message".
A callRendererFunction message (v1.0): the agent asks the renderer
to run function call with args, from the catalog catalog_id,
in the context of surface surface_id (or of no surface when nil).
The answer must carry function_call_id.
A createSurface message: a new surface, the catalog it uses
(catalog_id) and whether the renderer sends its data model back
(send_data_model). theme is kept for v0.9 messages only. A v1.0
message may carry the surface's first components and data_model.
A deleteSurface message.
An updateComponents message: components to add to a surface or
replace in it, as the wire maps.
An updateDataModel message: value written at path (the root by
default) of a surface's data model. A nil value deletes.
Builders for the messages a renderer sends to the agent
(renderer_to_agent.json)
RFC 6901 JSON Pointer parsing, building, and resolution.
Applies agent→renderer messages to a set of surfaces.
The function RPC of protocol v1.0, as a value.
An action property of a resolved component.
Resolves a component's properties to the values a renderer displays.
A resolved dynamic property: the value it currently holds and, when the component bound it to a data path, the absolute path a write goes to.
A data-binding scope: the absolute path relative bindings resolve against, the collection-template iteration index, and — when built for a surface — what is needed to evaluate dynamic values.
One mounted position of a resolved component tree.
Resolves a surface's flat component dictionary into a tree of
A2UICore.Resolution.Nodes.
JSON Schema Draft 2020-12 validator used by A2UI's catalog, envelope, and payload validation.
ECMA-262 → PCRE regex translation for the pattern and
patternProperties keywords.
Loads the A2UI protocol's own JSON Schema documents — vendored under
priv/ from a pinned revision of the specification — plus the shipped
basic catalogs.
Semantic Versioning 2.0.0 parsing and comparison.
One component instance on a surface: its id, catalog type, and properties.
The set of components on a surface, keyed by id.
The reactive JSON data store behind a surface — an immutable port of
the reference DataModel (RFC 6901 pointers, auto-vivifying writes,
cascading change notifications).
The state of one UI surface: its identity, catalog selection, theme, data model and components.
All live surfaces of a session, keyed by surface id.
Validates a batch of incoming components against the surface they update, before any of them is committed.
Options controlling how strictly a component graph and its payloads
are validated — the reference ValidationConfig.
Payload preflight checks that run before schema validation:
global nesting depth, nested function-call depth, and JSON-pointer
path syntax. Ported verbatim from the reference's
validate_recursion_and_paths.
Checks the function calls nested in a v1.0 updateComponents batch
against the catalogs they run in, before anything is committed.
Validates component, function-call and theme payloads against a catalog.
The v1.0 reserved-key rule for dynamic objects.
Component-graph validation: root presence, dangling references, self-references, cycles, depth, unreachable components, and catalog composition constraints.
A2UI protocol-version registry and catalog compatibility rules.