Expand description
The transport envelope: {"a2ui_operations": [...]}.
A2UI itself says nothing about how messages reach the renderer. In practice
every toolkit wraps a batch of operations in a single JSON object keyed by
A2UI_OPERATIONS_KEY, and the frontend sniffs for exactly that key to
decide whether a payload is A2UI. The envelope is emitted as a JSON string
because that is what fits in a tool result, an assistant message, or an A2A
data part without further wrapping.
Failure is the other shape, and it is a different object rather than an empty
envelope: see wrap_error_envelope for why a surface that could not be
built must not answer the sniff.
Functionsยง
- is_
operations_ envelope - Whether a value is an A2UI operations envelope.
- operations_
envelope - The envelope as a
Value, for callers that embed it in a larger payload. - unwrap_
operations_ envelope - Reads operations back out of an envelope.
- wrap_
as_ operations_ envelope - Wraps operations in the envelope, as a JSON string ready for transport.
- wrap_
error_ envelope - Builds the payload reporting that a surface could not be produced.