NewYour coding agent can read the release notes before it upgrades.Set up the MCP server →
pub.dev
pub.dev, #5559 most downloaded on pub.dev
Helps a Dart agent generate A2UI: negotiates catalogs with the renderer, teaches the model the catalog, and parses its reply into A2UI messages.
Latest stable
0.3.0
Last release 12 days ago
11 Nov 2026
Ships on a steady schedule
a new release about every 6 weeks
Nearly every release is documented
notes for 3 of 3 stable releases
Nothing withdrawn
no release was ever pulled
3 months old
5 releases · first in 2026
Drag across the ruler to compare, or tap a release to open it.
inline_local_refs is exported from a2ui.core. It writes a schema's local #/ references inline, keeping references to common types, as Catalog.from_jso
inline_local_refs is exported from a2ui.core. It writes a schema's local
#/ references inline, keeping references to common types, as
Catalog.from_json does
(#2966).and, or and not read a ValidationResult
operand by its valid member instead of treating every non-empty dict as
truthy, so the v1.0 specification's nested
and(required, or(required, required)) check is false when a field is
empty. The v0.9 catalog keeps plain truthiness, since its validators return
booleans.DataContext validates a function call's arguments as
written, before resolving the bindings and nested calls in them, and passes
the resolved values to the function body without validating them again.
The catalog's argument schema describes the written shape (a
DynamicBoolean admits a {"@call": ...}), so validating the resolved
values rejected, for example, the ValidationResult a v1.0 validator returns
to and, or or not. This matches web_core. Accordingly,
FunctionImplementation.execute no longer validates its arguments; callers
that invoke it directly validate the written arguments first, with
PayloadValidator.validate_function or the function's schema model.ComponentModel.component_tree names the component under
component, as an updateComponents message does, instead of type. A
property named type no longer replaces the component type in the tree,
and is kept. ComponentModel.validate validates that same dict, so a
property named component or id no longer replaces the model's own
during validation (#2930).validate_recursion_and_paths also read v1.0's @path and @call. A v1.0
payload with a malformed @path, or with @call expressions nested deeper
than the limit, used to pass validation
(#3013).regex (SchemaValidator in
a2ui.core.validation), supporting Unicode property escapes such as
\p{XID_Start} and \p{XID_Continue} natively and anchoring $ to the end
of the string per ECMA-262. clean_schema_node leaves const, enum,
default, and examples values untouched.PayloadValidator reports invalid Extensions keys even with
allow_unknown_elements.DynamicStringList for string list values, as the
basic catalog does, instead of DynamicValue.1.0.0-rc.1 uses v1.0). Unparsable versions raise A2uiCatalogError
when a catalog schema is built.GenericBinder binds $refs to catalog-defined dynamic defs (for example
DynamicDate).CatalogApi, the name for a schema-only Catalog[ComponentApi, FunctionApi], exported from a2ui.core. Catalog.from_json returns it.functionCall and call component actions locally in GenericBinder and prevent SurfaceModel.dispatch_action from emitting them as agent-facing on_action events.ExpressionParser accepts number literals with a leading decimal point
(.5, -.5, +.5, .5e2), including as function-call arguments. .foo
and ./x are still paths.ExpressionParser raises A2uiExpressionError for a number literal outside
the double range, such as 1e999 or a 400-digit integer. It used to return
inf for float literals and an exact int for integer literals. Integer
literals longer than 4,300 digits no longer raise a bare ValueError.default annotations in generated v0.9
and v1.0 Pydantic models are kept in field descriptions instead of becoming
field values. const values remain fixed.BasicCatalog from a2ui.core.basic_catalog is a factory that
returns the basic catalog of a protocol version, for example
BasicCatalog("0.9"). The package no longer re-exports the v0.9 basic
catalog's symbols; import them from a2ui.core.basic_catalog.v0_9.catalog_id is the v0.8 standard catalog ID,
https://a2ui.org/specification/v0_8/standard_catalog_definition.json.PayloadValidator, SurfaceModel, SurfaceGroupModel,
DataContext, and RpcHandler are no longer generic. They take CatalogApi
catalogs, so remove type arguments such as
SurfaceModel[MyComponent, MyFunction].Published to PyPI: a2ui-core 0.3.0
pip install a2ui-core==0.3.0
Your coding agent can read these notes before it upgrades. Set up the MCP server →
One column per month.
a2ui_rpc_callback takes renderer_calls, a provider of the session's
RendererFunctionCalls such as A2uiRendererCallsStore.get, and catalogs
becomes optional (pass one or both). The callback processes each message
with a RendererToAgentMessageProcessor whose
on_renderer_function_response is RendererFunctionCalls.resolve, and
answers the request without running the agent only when every message is
handled. A response to a call the session didn't make, such as one the
model wrote, is declined and goes to the agent. Responses that answer
pending calls always settle them, even in a request that goes to the agent,
and a malformed one fails the call it names. It needs the a2a
extra. #3535a2ui_rpc_interceptor, an A2aAgentExecutor interceptor that ends a
task completed when its request held only callAgentFunction and
rendererFunctionResponse messages and ADK would end it working because
there was nothing to send back. Other final states are left as they are. It
needs the a2a extra.
#3535A2uiRendererCallsStore, which keeps a RendererFunctionCalls for each
session. get returns the session's instance, creating it on first use, and
is the renderer_calls provider of a2ui_rpc_callback. remove disposes a
session's instance, which fails its pending calls.
#3535a2ui_rpc_callback, which returns a before_agent_callback that
answers the renderer's A2UI v1.0 callAgentFunction messages without
running the agent. When the user content holds only such calls, it builds a
RendererToAgentMessageProcessor from the agent's catalogs (or from the
catalogs a provider returns per context, such as the session's
A2uiRequestProcessor.active_catalogs), and returns the
agentFunctionResponse replies as the agent's response, which
A2aAgentExecutor sends as A2UI parts. It reads and writes the parts with
ADK's own A2A part converters. Any other content, including the renderer's
action, error and rendererFunctionResponse messages, goes to the agent.
It needs the a2a extra.
#3795SendA2uiToClientToolset removes the callAgentFunction and
agentFunctionResponse messages from the contents sent to the model; the
session's events keep them. Add exclude_a2ui_rpc_from_prompt, a
before_model_callback that does the same for agents without the toolset.
It needs the a2a extra.
#3795a2ui-agent-sdk>0.10.0 and
a2ui-a2a>0.2.0 (for the a2a extra).Published to PyPI: a2ui-adk 0.3.0
pip install a2ui-adk==0.3.0
get_a2ui_messages, which returns the A2UI messages in an A2A message's
A2UI parts, and create_a2ui_parts, which wraps A2UI messages, such as the
replies of RendererToAgentMessageProcessor, as A2UI parts. Models are
serialized as to_message_dicts serializes them, with only the fields that
were set, so an agentFunctionResponse keeps a value of None, and a
model's default version is written for v0.9 and later.
#3795extract_a2ui_json_to_parts to extract text and <a2ui-json> blocks into
A2A parts without requiring a Catalog or Parser. A block that is unclosed,
is not JSON, or is not a JSON object or array of objects is logged and
skipped. A block whose open tag is missing starts at the first line that
opens a JSON array or object. Requires an a2ui-agent-sdk release later than
0.10.0.
#3790Published to PyPI: a2ui-a2a 0.3.0
pip install a2ui-a2a==0.3.0
Breaking: Requires a2ui_core ^0.7.0, whose types this library
re-exports.
Add readRendererCapabilities(metadata, version), a2uiClientCapabilitiesKey,
and a2uiRendererCapabilitiesKey to extract and validate
A2uiRendererCapabilities from transport metadata.
#4013
(v1_0) Express compiles, decompiles and prompts the protocol's system
functions, which no catalog defines: @index() and @index(offset=1)
compile to {"@call": "@index", ...} without a catalogId, the decompiler
writes such calls back as @index(...), and the v1.0 Express prompt lists
@index(offset?). Before v1.0, @index() is a validation error
(#3725, #4025).
BREAKING: Module paths and validation interfaces moved or changed in v0.2.0. Deprecation shims are provided for renamed public module paths; importing…
BREAKING: Module paths and validation interfaces moved or changed in v0.2.0. Deprecation shims are provided for renamed public module paths; importing them emits a DeprecationWarning naming the new path. These shims will be removed in v0.3.0.
Shimmed Modules (Deprecated; removal in v0.3.0):
Old Path (v0.1.x) |
New Path (v0.2.0) |
Notes |
|---|---|---|
a2ui.core.basic_catalog.{components,function_apis,function_impls,styles} |
a2ui.core.basic_catalog.v0_9.{components,function_apis,function_impls,styles} |
Re-exports v0.9 basic catalog symbols |
a2ui.core.basic_catalog.expression_parser |
a2ui.core.expressions.expression_parser |
Re-exports ExpressionParser, Scanner, and limits |
a2ui.core.schema.{client_capabilities,client_to_server,constants,server_to_client} |
a2ui.core.schema.v0_9.{client_capabilities,client_to_server,constants,server_to_client} |
Also aliases A2uiClientError* and SPEC_VERSION* |
Unshimmed Internal Modules & Renames:
Internal modules were moved without shims; callers should import from the new paths directly:
a2ui.core.rendering (and .component_context, .data_context, .generic_binder): moved to a2ui.core.resolution (and matching submodules).a2ui.core.validating (and .integrity_checker, .topology_analyzer): moved to a2ui.core.validation (and a2ui.core.state.validation_helpers).validate_component_integrity: moved to a2ui.core.validation as (components: dict[str, ComponentModel], root_id: str = ROOT_ID, config: ValidationConfig | None = None) -> None.analyze_topology: moved to a2ui.core.validation as (components: dict[str, ComponentModel], root_id: str = ROOT_ID, config: ValidationConfig | None = None) -> set[str].Removed Modules and APIs:
Removed (v0.1.x) |
Replacement (v0.2.0) |
|---|---|
a2ui.core.validating.validator (A2uiValidator, A2uiValidatorError) |
a2ui.core.validation.PayloadValidator |
a2ui.core.validating.catalog_schema_validator (CatalogSchemaValidator, extract_ref_fields) |
a2ui.core.catalog.reference_map (ComponentRefSpec, build_component_ref_map) |
a2ui.core.validating.integrity_checker.get_component_references |
ComponentRefSpec.extract_child_references, ComponentModel.get_child_references |
a2ui.core.state.{node_graph,component_node} (NodeGraph, ComponentNode) |
Removed |
a2ui.core.basic_catalog.locale_config |
a2ui.core.basic_catalog.locale_formatting (Babel/CLDR) |
a2ui.core.basic_catalog.operator_apis |
a2ui.core.basic_catalog.v1_0.operator_apis |
get_client_capabilities, get_client_data_model |
Removed |
SPEC_VERSION |
PROTOCOL_VERSION (in a2ui.core.schema.v0_9.constants) |
A2uiClientErrorMessage |
A2uiRendererErrorMessage |
Catalog(spec_version=) |
Catalog(protocol_version=) |
MessageProcessor(strict_mode=) |
MessageProcessor(options=) |
BREAKING: DataModel stores data values by reference instead of making deep copies. Callers that mutate nested objects after setting them in DataModel will update internal state directly.
BREAKING: A2uiRpcError argument order is now (message, code, ...).
BREAKING: DataModel.set now raises A2uiDataError instead of resetting the root when attempting to traverse or set a subpath under a primitive root value.
BREAKING: SurfaceComponentsModel.add_component now raises A2uiStateError if a component with the same ID already exists in the model.
BREAKING: pending RPC requests on RpcHandler.dispose() are now rejected with error code CANCELLED (previously DISPOSED).
SurfaceModel now accepts a root_id parameter (defaulting to "root") and provides a deprecated catalog property aliasing default_catalog.
SurfaceComponentsModel.detect_cycles now correctly ignores disconnected orphan components by passing allow_orphan_components=True to topology analysis, reporting cycle and depth limit violations exclusively.
Bound function calls to MAX_FUNCTION_CALL_ARGS (1,000 arguments) across both PayloadValidator.validate_function and runtime DataContext._execute_function resolution.
Bound expression template strings to MAX_EXPRESSION_TEMPLATE_LENGTH (10,000 characters) and parsed expression segments to MAX_EXPRESSION_PARTS (1,000 parts) in ExpressionParser.
Add SemVer parsing and comparison utilities (SemVer, compare_semver, is_at_least_version, normalize_version_string, parse_semver, to_canonical_version, to_semver) in a2ui.core.common.semver.
Add A2uiProtocolVersion and ProtocolVersion enum in a2ui.core.schema.
Remove A2uiCompileError from a2ui_core exception hierarchy.
BREAKING: locale formatting now comes from CLDR by way of babel,
replacing the hand-rolled locale tables. Currency, number, date month and
weekday names, and plural category selection now match what the TypeScript
engine gets from Intl. That was the point: the two engines previously
disagreed for every locale other than en-US, on the symbol chosen and on
which Unicode space separates it from the amount.
a2ui.core.basic_catalog no longer exports LocaleFormattingRules,
register_locale_rules, get_locale_rules or CURRENCY_SYMBOLS, and
locale_config.py is deleted. register_locale_rules was the extension
point for registering a custom locale; that capability goes away rather than
moving, because babel resolves locales from CLDR only.
babel is added as a runtime dependency.
babel reads its patterns and symbols from CLDR but does not implement
CLDR's currencySpacing, which ICU does apply. The package supplies that
rule itself, so a currency whose symbol is alphabetic is separated from the
amount by U+00A0 as Intl separates it: CHF 1,234.56, not CHF1,234.56.
This affects the assigned codes CHF, SEK, DKK, CZK and PLN among
others, in en-US as well as elsewhere.
One difference from Intl remains. For Arabic locales such as ar-EG,
Intl shapes digits in Eastern Arabic numerals while babel emits Latin
ones. babel offers no way to close this: requesting the locale's default
numbering system converts the separators but not the digits, which agrees
with neither engine.
A locale tag the catalog cannot use falls back to en_US rather than
raising. babel raises for a malformed tag and for a well-formed tag CLDR
does not carry, such as xx-YY, either of which would otherwise abort every
format call made by a catalog built with it. The TypeScript engine falls back
for the same tags.
BREAKING: the Dynamic* schema aliases no longer coerce a value of the
wrong primitive type. Each admits one primitive type, a data binding, or a
function call, matching the TypeScript engine and the specification. What
changes in practice:
DynamicNumber rejects the string "1", which previously validated as
1.0, and rejects True, which previously validated as 1.DynamicBoolean rejects 1, 0 and "true", which previously validated
as True, False and True.DynamicValue keeps an integer as an integer. It admitted float but not
int, so a payload carrying 1 came back as 1.0.DynamicString and DynamicStringList are now declared strict for
consistency. This is not a behaviour change: pydantic already refused to
coerce other primitives into a string.Data bindings and function calls are unaffected.
The v0.9 and v1.0 basic catalogs no longer register add, subtract, multiply,
divide, equals, not_equals, greater_than, less_than, contains,
starts_with or ends_with. The published catalogs declare exactly 14
functions, and none of these operators is among them, so an agent had no way to know
they were callable. a2ui.core.basic_catalog no longer exports their
API classes or implementations, aligning Python engine behavior with the
reference typescript implementation.
The v1.0 formatDate ISO pattern now returns the UTC instant with exactly
three fractional digits, as web_core does. It previously echoed back
whichever offset the input carried, so 2025-01-01T12:00:00+02:00 formatted
as itself instead of 2025-01-01T10:00:00.000Z. A timestamp without an
offset is read as UTC, so the result no longer depends on the host time zone.
The v1.0 pluralize function now falls back to the other form only when
the selected category is absent, not when its value is empty. A caller that
supplies zero: "" gets an empty string, matching web_core; previously the
empty form was discarded and the other form rendered in its place.
ExpressionParser.MAX_DEPTH is 100, up from 10, matching web_core and the
Swift engine. An expression nested between 11 and 100 levels deep was
rejected here and accepted there.
A function-call argument now counts toward the expression parser's recursion
depth, as it does in web_core. Only nested interpolations were counted
before, so ${f(a: ${f(a: ...)})} written as ${f(a: f(a: ...))} recursed
unchecked and raised RecursionError from the interpreter rather than a
parse error.
Catalog.from_json accepts a common_types_schema argument and rewrites
cross-document references such as common_types.json#/$defs/ChildList into
local #/$defs/... pointers, satisfying them from the supplied document or
from the built-in definitions. Catalogs that reference the published shared
types now load without the specification/ tree on disk, and the validator
no longer reads schema files at runtime.
Deleting a list index past the end of the list is now a no-op. It previously
padded the list with None up to that index, so deleting /items/10 from a
three-element list produced an eleven-element list.
The shared type definitions used to satisfy common_types.json references
are now checked against the published document by a test, with an explicit
list of the definitions that intentionally differ. Descriptions on
AccessibilityAttributes, DynamicString, DynamicNumber and
DynamicBoolean were brought back into line with the specification.
The conformance harness now fails, rather than silently skipping, when a
suite cannot be parsed, when a case has no name or action, or when an
action has no handler. Suites the core library cannot run are named in
UNRUNNABLE_SUITES with a reason.
Published to PyPI: a2ui-core 0.2.0
pip install a2ui-core==0.2.0
GenAIFileResolver is removed, along with theFileResolver it extended in a2ui-agent-sdk.SendA2uiToClientToolset(a2ui_enabled, a2ui_processor)A2uiRequestProcessor, or an A2uiProcessorProviderRendererState. A2uiCatalogsProvider andA2uiExamplesProvider are removed; markdown examples are no longer accepted,A2uiGenerator or A2uiRequestProcessor. Togenerator.create_processor(capabilities) in anA2uiProcessorStore and pass A2uiProcessorStore.get as theRendererState to the processor it putsa2ui_json toa2ui_payload, in the processor's inference format (Express by default)parse_and_fix, validates it against the processor'svalidate_payload, and still returns A2UIprocessor.prompt_snippet.A2uiPartConverter takes the processor, plus thebypass_tool_check and fallback_text, instead ofcatalogs, parser, version and state. It reads text-based A2UI with theA2uiEventConverter takes the request's processor, ora2ui_processor, instead of reading catalogs from session state. Itscatalogs_key argument and the system:a2ui_catalogs key are removed. WhenResponseStream perParallelAgent don't share a stream. A stream that getsstream_idle_timeout seconds (600 by default), as when a run isA2uiProcessorStore keeps each session's request processor in memory, sinceget and is_enabled methods are providers for SendA2uiToClientToolsetA2uiEventConverter.SendA2uiToClientToolset and A2uiEventConverter log a warning when theyRendererState bound to it,A2uiEventConverter now streams responses in the default ExpressFormat</a2ui> tag.A2uiInstruction, an ADK instruction provider for an agent that writesprompt_snippet to{name} session state templates out${expression} in the basic catalog, so a stringKeyError: "Context variable not found: 'expression'."adk run and adk web. As a provider, A2uiInstruction is used asSendA2uiToClientToolset no longer adds the prompt's rules and catalogprompt_snippet in the Direct JSON format, whose snippetPublished to PyPI: a2ui-adk 0.2.0
pip install a2ui-adk==0.2.0create_a2ui_part labels a part with the message's own version field whenversion is passed, so a v0.9.1 or v1.0 message gets the current A2UI MIMEparse_content_to_parts logs a parse error, which may quote the response,Published to PyPI: a2ui-a2a 0.2.0
pip install a2ui-a2a==0.2.0Breaking: Requires a2ui_core ^0.6.0, whose types this library
re-exports.
(v1_0) validatePayload accepts a callRendererFunction on a surface the
payload never named, as it does an update to one, since an earlier payload
may have created it. A surface the payload deleted earlier, or creates only
later, is still rejected. With a2ui_core's checks, validatePayload,
RendererState.apply and the parsers also reject an agentOnly function
bound into a component, and one nested in the arguments of a
callRendererFunction, a nested @index call there, and a data binding
there that holds a non-string @path or a field other than @path. A call
nested there that names no catalogId is checked against the default
catalog of the surface the message names; on a surface the payload only
assumes, whose default catalog is unknown, it passes if some active catalog
declares the function and the renderer may
make the call
(#3534,
#4008).
Export agentCallableFunctions from package:a2ui_agent/a2ui_agent.dart to return the names of functions across active catalogs that the agent may invoke via callRendererFunction (#3864, #3880).
DirectJsonPromptGenerator.generate() follows the prompt layout
the other SDKs use: the rules without the ## Workflow Description: heading,
then a schema block with the protocol schemas, then one schema block per
catalog, then the examples under ### Examples: followed by a blank line.
Add your own heading around the snippet if you want one.
#3567
(v1_0) Added RendererToAgentMessageProcessor, whose processMessage takes
one v1.0 message a renderer sent and returns a ProcessResult (handled,
replies). It answers callAgentFunction with the catalogs' agent
functions, and passes action, error and rendererFunctionResponse to the
onAction, onError and onRendererFunctionResponse callbacks, which may
return false to decline a message. The library re-exports the agent
function and renderer-to-agent message types from a2ui_core
(#3536, #3861).
(v1_0) Added RendererFunctionCalls, which calls renderer functions from
the agent: call builds the callRendererFunction message with a Future
for the result, and resolve, passed to RendererToAgentMessageProcessor
as onRendererFunctionResponse, settles the call and declines responses to
calls it doesn't track. The library also re-exports
CallRendererFunctionMessage
(#3535).
Given the renderer's catalogs, call refuses a call to a function that
isn't one of their renderer functions (UNKNOWN_FUNCTION), or to one that is
rendererOnly or requires a user activation (INVALID_FUNCTION_CALL).
call checks its arguments in the same order as the Python and TypeScript
SDKs; args must have identifier keys and JSON values, and nested function
calls in it are left for the renderer to check.
resolve holds a response to the v1.0 FunctionResponse schema: version
'1.0' and exactly one of value (null for a function that returns
nothing) and error. A response that breaks it fails its pending call with
UNKNOWN_ERROR.
First release. a2ui.adk moves here from a2ui-agent-sdk , so the agent SDK no longer depends on google-adk or google-genai . Import paths are unchanged
a2ui.adk moves here from a2ui-agent-sdk, so the agent SDKgoogle-adk or google-genai. Import paths areA2uiPartConverter takes its version as a ProtocolVersion, or a versionProtocolVersion.V0_8.A2uiPartConverter, A2uiEventConverter) and theA2uiSubagentMap, SurfaceIdAlreadyExistsError)a2a extra: pip install "a2ui-adk[a2a]". a2ui.adk imports themSendA2uiToClientToolset works without the extra.SendA2uiToClientToolset supports multiple catalogs. Its a2ui_cataloga2ui_catalogs, which takes a sequence of catalogs or anA2uiCatalogsProvider (replacing A2uiCatalogProvider) that returns one.get_part_converter passes all of them on.A2uiEventConverter reads catalogs from the system:a2ui_catalogssystem:a2ui_catalog. Itscatalog_key argument is renamed to catalogs_key.GenAIFileResolver, a FileResolver that returnsgoogle.genai.types.Part objects. It takes over to_genai_part,resolve_all_to_genai_parts and the genai_parts default ofas_tool_decorator from FileResolver.Published to PyPI: a2ui-adk 0.1.0
pip install a2ui-adk==0.1.0a2ui.a2a moves here from a2ui-agent-sdk, so the agent SDKa2a-sdk. Import paths are unchanged.try_activate_a2ui_extension returns the ProtocolVersion ofProtocolVersion.V0_9 instead of "0.9". It only activates extensions whoseProtocolVersion.get_a2ui_extension_uri, get_a2ui_agent_extension and create_a2ui_partProtocolVersion, or a version string with or without a leading "v".ProtocolVersion or a "v"-prefixed string produced an invalid.../a2ui/vv0.9.Published to PyPI: a2ui-a2a 0.1.0
pip install a2ui-a2a==0.1.0codegen command for generating Python client component builders from catalog schemas across protocol versions 0.9, 0.9.1, and 1.0.$defs/Child references as single child components (Child) and target a2ui.builder.v1_0 when generating code from v1.0 catalogs.CLI_VERSION overrides for packageVersion (#3700).a2ui_core dependency to ^0.4.0.Remove (Agent to UI) from the embedded v0.9 server_to_client.json and v1.0
agent_to_renderer.json schema descriptions in DirectJsonPromptGenerator
(#1605).
Add incremental streaming support for the Express inference format via
ExpressResponseStream (ExpressFormat.supportsStreaming and
ExpressParser.supportsStreaming now return true). ExpressFormatFactory,
ExpressFormat, and ExpressParser accept progressiveKeys (defaulting to
defaultExpressProgressiveKeys = {'text'}) to heal unclosed string literals
in matching component properties and data path assignments as chunks arrive,
while gating initial createSurface emission on root = ... for new
surfaces, emitting delta updateComponents and per-path updateDataModel
messages on subsequent chunks, and holding statements with unresolved value
variables until defined (#2896).
surface(...) also accepts update= and sendDataModel= keyword arguments
to update an existing surface without emitting createSurface or to request
client data model echoing on surface creation.
Breaking: Use '1.0' (without a 'v' prefix) as the version field on
v1.0 protocol messages and capabilities in ExpressCompiler,
ExpressDecompiler, DirectJsonParser, RendererState, resolveCatalogs,
and prompt examples (#3097,
#3726).
Support the reserved extensions= keyword argument on surface(...) and component calls in v1.0 A2UI Express (ExpressCompiler and ExpressDecompiler), compiling to and decompiling from metadata.extensions with UAX 31 extension key validation (#3708, #3757).
Requires a2ui_core ^0.5.0.
Breaking: In ExpressCompiler, data path assignments ($/... = ...) in
scopes that update a surface (scopes without a root assignment) now emit one
targeted updateDataModel message per assigned path at its JSON Pointer
path instead of folding all assignments into a single root updateDataModel
with path: "/" (which replaced the entire surface data model on the
renderer). Surface-creating scopes continue to fold data path assignments into
a single root data model and now support list element traversal, canonical
numeric-segment list auto-vivification, and full root replacement via
$/ = {...}. ExpressDecompiler now writes standalone updateDataModel
messages as {path} = {value} ($/ = {...} at root) so map replacements
round-trip without merging into sibling keys, accepts numeric path segments in
updateDataModel (such as /items/0), and sorts map keys when flattening
surface-creation data models into leaf assignments.
Breaking: when ResponseStream.feed or close throws an A2uiError, the
error's partialResults holds the parts the call made ready before the
failure, and they stay applied to the stream's RendererState. Before, a
chunk that finished a block and then failed in the next one threw without
those parts and rolled them back. Show error.partialResults before ending
the stream (#3597).
An A2uiError that Parser.parseResponse throws carries partialResults
too: the parts before the failing block, or only the text when a tree
check fails, since that check spans every block. None of them is applied
to the state (#3597).
Breaking: ResponseStream is now ResponseReader<ResponsePart>, and a
class that implements it adds isInBlock. ResponsePart extends the new
sealed StreamPart. Code that names ResponseStream or
DirectJsonResponseStream compiles unchanged (#3597).
Added Parser.openContinuingStream and
A2uiRequestProcessor.openContinuingStream, which open a
ContinuingResponseStream (ResponseReader<StreamPart>;
DirectJsonContinuingResponseStream for direct JSON and
ExpressContinuingResponseStream for Express) that reads past a
rejected block. It returns an ErrorPart in place of the block, skips the
rest of it, and reads the text and blocks after it; the messages the block
emitted before it was rejected stay in the state. A block still open when
the response ends is returned as an ErrorPart too (#3597).
Added ResponseReader.isInBlock, which tells whether the response read so
far ends inside a block, so a client that joins the chunks of a paused and
resumed response can tell whether a space between them could break a block
(#3597).
Added RendererState.of, a state that checks messages by its own rules and
applies them to the MessageProcessor an app renders from, for an app that
is both agent and renderer. A rollback takes a message back out of the
processor's model, a callRendererFunction reaches the processor only once
the outermost apply or transaction it was applied in succeeds, and
dispose leaves the processor's surfaces to its owner (#3597).
Added StreamedAnswer, which reads one streamed answer into a renderer's
MessageProcessor through RendererState.of, reading past rejected blocks,
and keeps its parts in the order the model wrote them: text
(AnswerTextPart), one part per surface it creates (AnswerSurfacePart),
and an AnswerErrorPart per rejected block (#3597).
Breaking: Event(...) in Express no longer accepts the event name as a
name= keyword argument; pass it positionally, as the TypeScript and Python
compilers require. A keyword Event does not define now throws
A2uiValidationError.
ExpressCompiler accepts userMessage= and context= keyword arguments on
Event(...), compiling userMessage to the v1.0 event.userMessage field,
and throws A2uiValidationError for userMessage before v1.0 and for any
keyword Event does not define, where it used to drop them. A function call
in an action slot nested inside a list item or object property (such as
items: [{label, action: openUrl(...)}]) is now compiled as a
functionCall action. ExpressDecompiler writes userMessage= back, and
ExpressPromptGenerator teaches Event(name, context?, userMessage=...) in
rule 8 for v1.0+ catalogs
(#3598,
#3690,
#3867).
DirectJsonParser.unwrap, DirectJsonResponseStream, and
ExpressParser.unwrap remove the backticks left at the edges of a block when
a model writes the tags as inline code (`<a2ui>` ... `</a2ui>` or
`<a2ui-json>` ... `</a2ui-json>`) and drop text made of nothing but
backticks. In one-shot unwrapping (unwrap and parseResponse), they also
recover at most one block closed with a closing tag when the model opened the
block with a Markdown code fence or omitted the opening tag;
DirectJsonParser.hasFormatContent and ExpressParser.hasFormatContent
delegate to unwrap and count recovered blocks as complete format blocks.
The Direct JSON and Express compilers strip stray unescaped line breaks inside
JSON object keys and identifier/reference properties (id, component,
child, children items, surfaceId, catalogId, and componentId,
leaving user data under updateDataModel values and createSurface.dataModel untouched), at the edges of
single-line Express strings, and inside Express data paths and line-wrapped
identifiers (outside strings and comments, when the joined name resolves to
a declared variable), accept SQL/Lua-style -- comments in Express, and map
a trailing numeric positional argument across optional enum properties when a
component schema declares a single later numeric property.
Express IDENTIFIER and CHECK tokens now follow UAX 31
([\p{XID_Start}_] [\p{XID_Continue}]*) rather than ASCII-only letters,
digits, and underscores. In ExpressDecompiler, non-identifier component ids
before protocol v1.0 (such as title-heading) and reserved-word component
ids in any version (true, false, null, _) are written with a derived
variable name and id="..." so they round-trip through ExpressCompiler;
from v1.0 onward, component ids that are not valid UAX 31 identifiers throw
A2uiValidationError.
Express number literals follow the grammar of the core ${...} expression
parsers: an optional sign, digits with an optional fraction (.5, 1.) and
an optional exponent (1e6, 2.5E-7). A literal outside the double range
(1e999) throws A2uiParseError. ExpressDecompiler now writes doubles
that need exponent notation (1e-7, 1e+21) instead of throwing, and
throws A2uiValidationError only for non-finite values
(#3019).
Breaking: A2uiGenerator.inferenceFormatFactory and
A2uiRequestProcessor.formatFactory default to ExpressFormatFactory
instead of DirectJsonFormatFactory.
The Express compiler throws A2uiValidationError for a check on a
component whose schema declares no checks, such as
Text("hi", ?required($/name)), rather than writing checks onto it.
Add RendererState, the agent's mirror of the surfaces a renderer holds.
It wraps one MessageProcessor for its whole life and checks each message
against everything applied before it, so an agent that keeps one state for
a conversation catches a reference to a component no turn sent, a cycle
with components from an earlier turn, or a new component that nothing
reaches.
apply checks messages and applies them. The call is atomic: if a
message is rejected, the state is left as it was. An update to a surface
the state never saw created is rejected, as a renderer would reject it.transaction makes several calls atomic. Transactions nest: a failed
inner transaction undoes only what it applied, and the outer one goes
on.checkTopology checks the trees of the given surfaces: the root exists,
every reference resolves, and every component added or replaced since
the last check is reachable from the root. A component that an update
detached, by rewriting its parent's children, is accepted, since the
protocol has no message that removes one component.markChecked stops holding the components each surface changed against
later checkTopology calls. A stream that fails after emitting messages,
and a block cut off at the end of a response, mark their surfaces
checked: the renderer holds those components and no message removes one,
so later turns aren't required to make them reachable. Dangling
references and a missing root are still reported.dispose releases the surfaces the state holds.Add validatePayload, which checks one payload with no record of earlier
ones, such as the argument of a tool call. It runs on a short-lived
RendererState that assumes a surface the payload only updates exists, and
replaces the processor that payload checks built for every call.
Breaking: Parser.parseResponse and A2uiRequestProcessor.parseResponse
take an optional state and check every message they compile against it.
Without one, a call checks the response against a new, empty state, as a
chat turn that shows new UI, so an update to a surface the response does
not create is rejected; Parser.parseResponse accepted it before. A
canvas agent keeps one state for the conversation and passes it on every
turn. The response is applied to the state all or nothing, and the trees of
every surface it touches, including surfaces it only updates, are checked
once every block is applied, unless a block is cut off by the end of the
response; the components of a cut-off block are marked checked. Express
output is checked the same way, which rejects inline child ids that collide
with assigned variables and check lists on components that declare none.
Breaking: a parser holds no state, so one parser reads every response of a
request. Parser.parseChunk is removed: open a stream for each response
with parser.openStream(wrapped: ...), call feed(chunk) for each chunk,
and close() after the last one. Parser.openStream and
A2uiRequestProcessor.openStream return a ResponseStream, and the direct
JSON parser a DirectJsonResponseStream:
updateComponents and updateDataModel are emitted while they grow;
any other message, such as createSurface, deleteSurface or
callRendererFunction, is held until its object closes, so it is emitted
once. A message for a surface that does not exist yet is held back, as a
renderer would reject it, and the block throws when it closes.close emits the text held back as a possible tag, throws
A2uiParseError if a block is still open, and checks the tree of an
unwrapped stream.feed then throws StateError, and
close returns nothing. The messages it emitted stay in its state, and
their components are marked checked.Breaking: Parser.compile only translates a block into messages. It
reports what the notation gets wrong, but DirectJsonParser.compile no
longer checks components, function calls, themes or catalog ids against the
catalogs; parseResponse(block, wrapped: false) compiles and checks one
block. A Parser subclass implements the new catalogs getter.
The v1.0 schema in the direct JSON prompt no longer says that createSurface
needs later messages for its components and data. They can be sent inline in
createSurface or in later updateComponents and updateDataModel messages.
#3678
A2uiRequestProcessor reuses one parser, which its parser getter
returns. createState creates an empty RendererState for the active
catalogs. A processor can be bound to a state, through its state
constructor parameter or A2uiGenerator.createProcessor(..., state: ...),
so that parseResponse and openStream use it when a call passes none.
A state for other catalogs throws A2uiCatalogError.
A2uiRequestProcessor.acceptsState tells whether a state holds the
processor's catalogs, so an agent that keeps a state per conversation can
tell when to make a new one.
A2uiRequestProcessor.parseResponse also takes wrapped.
CatalogConfig.transformedCatalog is computed on first access and then
reused, so every request sees the same transformed catalog
(#3575).
Implemented protocol v1.0. The SDK reads and writes the protocol version that the active catalogs target, rather than always v0.9:
FileSystemCatalogProvider and InMemoryCatalogProvider load documents
that declare protocolVersion 1.0, and take
A2uiProtocolVersion.v1_0.resolveCatalogs, and so A2uiGenerator.createProcessor, negotiate a
protocol version with the renderer. The registered catalogs may target
several versions; the latest one the renderer declares capabilities for
is used, or the next earlier one when the two have no catalog in common
there. createProcessor gives each processor the example turns written
in its version, and throws A2uiValidationError for a turn written in a
version no registered catalog targets.resolveCatalogs throws A2uiCatalogError for
registered catalogs of different versions, since nothing says which one
the renderer reads. Given capabilities, it throws it when no catalog is
registered.catalogId argument names a catalog, and a function call
written as a statement of its own compiles to callRendererFunction.instructions.callRendererFunction may call only a function whose allowedCallers
lets the agent call it and that needs no user activation. RendererState,
openStream, parseResponse and ExpressCompiler.compile all check it
through a2ui_core's MessageProcessor.forAgent, so a streamed call the
renderer would reject is never emitted.bufferIncompleteComponents applies only before v1.0.Exported ExpressFormat, ExpressPromptGenerator, ExpressParser,
ExpressCompiler and ExpressDecompiler, which the agent SDK blueprint
lists, as the direct JSON classes are. ExpressFormat has a public
constructor, as DirectJsonFormat does.
DirectJsonFormat and ExpressFormatFactory.createFormat throw
A2uiCatalogError for two catalogs with the same id, since a catalogId
could not say which of the two it names.
Express prompts, compilers and decompilers, and direct JSON parsers, throw
A2uiCatalogError for catalogs that target different protocol versions.
Catalogs of v0.9 and v0.9.1, which share message shapes, mix as v0.9, there
and in resolveCatalogs.
Payload checks run through a2ui_core's MessageProcessor.forAgent.
DirectJsonResponseStream reads and checks only what each chunk adds,
rather than the whole block so far: a message once it closes, after which
it is not read again, a growing updateComponents for its new components,
and a growing updateDataModel for the lists and maps its value gains,
with the value applied once it closes. The time to stream a payload grows
with its size rather than with its square: streaming 6.4 KB in 16-byte
chunks takes about 0.1 s rather than 1.4 s, and 105 KB about 0.3 s. A
message that grows is emitted again with the components it emitted
before, as the same objects.
The Express decompiler rejects a check condition with extra fields rather than dropping them.
The Express prompt gives each function's description.
A streamed string cut inside an escaped surrogate pair is cut before the pair rather than healed with U+FFFD.
The Express compiler rejects an inline component whose id another component has, rather than renaming it.
The Express decompiler writes a single check without brackets, a multiline
string with backslashes as a raw triple-quoted string, and an
updateDataModel below the root as assignments at its path.
A check's default message has no trailing period, as in the other SDKs.
The Direct JSON prompt lists description after type in the
agent-to-renderer and common_types schemas it embeds, following the
reordered specification files.
Align MessageProcessor.model and PayloadValidator usage with a2ui_core.
DirectJsonPromptGenerator embeds the agent-to-renderer schema, the pruned
common_types schema, and each active catalog's Catalog.toJson() document
instead of the deprecated catalogSchema, avoiding duplicate inlined common
type definitions when multiple catalogs are active.
allowedMessages of the Direct JSON format accepts only messages: the
definitions the agent-to-renderer schema lists in oneOf and their envelope
keys. Other definitions, such as v1.0's Component and ComponentsList,
throw ArgumentError.
Payload validation builds its MessageProcessor with defaultVersion.
Payload validation gives MessageProcessor the catalog through
Catalog.withFunctions, so a catalog read by Catalog.fromJson keeps its
protocol version, its authored $defs (a recursive #/$defs/node no
longer fails as an unresolvable reference) and each function's
description and declared allowedCallers and requiresUserActivation.
The Express format reads component signatures from
Catalog.resolvedComponentSchema, since ComponentApi.schema now keeps a
component's schema as the catalog document wrote it.
FileSystemCatalogProvider and InMemoryCatalogProvider pass the
provider's id and protocol version to Catalog.fromJson instead of
writing the id into the document, so load().toJson() writes back a
document that omits its catalogId without one, and the catalog reports
the provider's protocol version when the document declares none.
Include common mixin properties (accessibility, weight) at the end of
Express component signatures (after component-specific properties) so
positional arguments map to component properties while supporting common
properties via keyword arguments; previously they were omitted.
A2uiRequestProcessor checks each example with validatePayload, as one
render: a surface the example creates may arrive across several
updateComponents messages, and must have a root, resolved references and
every component reachable from the root once the whole example is applied.
An example may also update a surface it does not create, which is assumed
to exist; such an example was rejected before. Undeclared component types,
duplicate ids, cycles and malformed data-model paths are still rejected per
message.
DirectJsonParser, DirectJsonFormat and DirectJsonFormatFactory take
bufferIncompleteComponents. When it is true, a streamed component is
emitted only once its JSON object closes, as v1.0 requires, and progressive
keys heal only values outside components. It is false by default, which keeps
the v0.9 behavior of healing a component while it streams.
DirectJsonParser rejects a number out of the range of a double, such as
1e400, with A2uiParseError. A streamed response used to throw a
JsonUnsupportedObjectError for it.
The Direct JSON message reader and the Express decompiler continue to
reject a createSurface message without a catalogId with
A2uiValidationError. The check moved into the agent SDK now that
a2ui_core makes the field optional for v1.0; previously a2ui_core
rejected the message during parsing.
pub.dev now recognizes the license. The package LICENSE linked
https:// where the Apache text has http://, which pana does not match,
and carried the root's notice for eval/bin/transcrypt, a file outside
this package. Also a longer description.
The Express lexer and parser are generated from Express.g4 with ANTLR
instead of written by hand, so the package depends on antlr4. Where the
handwritten parser differed from the grammar, Express now follows the
grammar: a comment ends at a lone \r, r""" without a closing """ is
read as r"" followed by a string, and r" followed by a line break is
read as the name r followed by a string. Syntax errors carry ANTLR's
messages, and their columns count Unicode code points.
ExpressParser.unwrap and hasFormatContent read strings and comments as
Express.g4 does when finding the </a2ui> that ends a block, so a close
tag after one of the constructs above ends the block instead of being read
as part of a string or comment.
An Express integer too large for int compiles to a double instead of
throwing FormatException.
The Direct JSON prompt rule says the JSON part is a JSON array of A2UI messages, each following the schema, instead of "a single, raw JSON object (usually a list of A2UI messages)" that "MUST validate" against it (#3721).
Catalogs are typed CatalogApi, the new name of a2ui_core's
SchemaCatalog.
ComponentPruningTransformer and FunctionPruningTransformer now accept an optional or null allowlist, treating it as empty.
Implemented the rest of the agent SDK blueprint API for protocol v0.9:
CatalogProvider, FileSystemCatalogProvider, InMemoryCatalogProvider
and CatalogConfig.fromPath. A document's id and version are settled with
the provider's; on the web, FileSystemCatalogProvider cannot read files.DirectJsonFormatFactory, DirectJsonFormat,
DirectJsonPromptGenerator and DirectJsonParser. The prompt carries the
v0.9 message schema pruned to allowedMessages, the common types and the
catalogs. parseChunk emits each message once it reads and satisfies the
catalogs, healing progressiveKeys while their values stream.Parser.decompile, and prompt examples
in the Express prompt.resolveCatalogs, when acceptsInlineCatalogs is
true. An inline catalog whose id is already active is dropped.Added CatalogTransformer, ComponentPruningTransformer,
FunctionPruningTransformer and CatalogConfig.transformers.
Added resolveCatalogs, which A2uiGenerator.createProcessor now uses. The
active catalogs are the transformed ones. Renderer capabilities of null,
for a request that carries none, activate every registered catalog.
Added allowedMessages to ExpressFormatFactory. The Express prompt
describes only the statements that compile to the allowed message types.
Added examples to A2uiGenerator, A2uiRequestProcessor,
ExpressPromptGenerator and InferenceFormatFactory.createFormat. A
processor checks each example against its active catalogs when it is
created, and renders its prompt then, so an example the format cannot
write fails there.
A2uiGenerator.createProcessor takes an inferenceFormatFactory that
overrides the generator's.
Parser has new members: hasFormatContent, wrap, decompile,
supportsStreaming and parseChunk. Only the direct JSON parser
implements parseChunk.
The Express compiler reads a block that assigns components but no root
as an update of a surface created earlier, and compiles it to
updateComponents alone.
A payload whose createSurface names an inactive catalog is an
A2uiValidationError rather than an A2uiCatalogError.
The Express syntax rules no longer show Card(...), so a pruned Card
never reaches the prompt.
Breaking: the Express parser reads a direct JSON block (<a2ui-json>) as
text instead of throwing A2uiParseError. A parser reads only its own
format's tags.
Breaking: A2uiGenerator.inferenceFormatFactory and
A2uiRequestProcessor.formatFactory default to DirectJsonFormatFactory
instead of being required, as in the blueprint.
Breaking: custom Parser subclasses must implement the new abstract
members.
Implement full Express format compiler, parser, syntax lexer, and prompt generator for protocol v0.9:
ExpressCompiler: Compiles Express blocks (components, updateComponents, dataModel, updateDataModel, deleteSurface) into canonical A2UI v0.9 message payloads.ExpressParser: Parses streaming LLM output into structured ResponsePart chunks (TextBlock, ExpressBlock), validating message boundaries and syntax.ExpressPromptGenerator / A2uiRequestProcessor.promptSnippet: Dynamically generates system prompt instructions describing Express syntax, active catalog components, functions, and positional signatures.ExpressSyntax: Grammar, token definitions, keywords, and AST representation for Express blocks.conformance/agent/express test suites (express_conformance_test.dart).e2e_test/ targeting Gemini models (gemini-3.6-flash).a2ui_core to ^0.2.2.Nothing published for this version