A2uiCarrier

sealed interface A2uiCarrier

Where in a transcript an A2uiPayload came from.

Keyed by the protocol's ids -- the activity's messageId, the call's toolCallId -- and not by UiPart.id. A MESSAGES_SNAPSHOT at the end of a run rebuilds every part, and a key that changed with the rebuild would tear down and redraw every surface the moment the run finished.

The order of the variants is their precedence. When one surface arrives in several carriers -- the ordinary case with upstream's middleware, which paints the activity progressively and leaves the render_a2ui arguments and the outer tool's result in the transcript -- the highest wins and the others draw nothing. The activity is the middleware's own cumulative, validated form, so it outranks the result, which outranks the arguments the model streamed.

Inheritors

Types

Link copied to clipboard
data class Activity(val messageId: String) : A2uiCarrier

An a2ui-surface activity.

Link copied to clipboard
data class ToolArguments(val toolCallId: String) : A2uiCarrier

The streamed arguments of a render call.

Link copied to clipboard
data class ToolResult(val toolCallId: String) : A2uiCarrier

A tool result holding a2ui_operations.

Properties

Link copied to clipboard
abstract val precedence: Int

Lower draws first; higher takes a surface from lower.