A2uiPayload

sealed interface A2uiPayload

What one part of a transcript says about an A2UI surface.

A surface reaches a client in three carriers, and the same surface commonly arrives in all three during one run: an ACTIVITY_SNAPSHOT upstream's middleware synthesises, the streamed arguments of a render_a2ui call, and a tool result whose content holds a2ui_operations. The activity also carries the lifecycle before the surface exists -- the middleware sends {"status": "building"} under the same activityType and messageId the surface will later replace in place -- so a payload is not always a surface, and "not a surface" is not an error.

Inheritors

Types

Link copied to clipboard
data class Building(val progressTokens: Int? = null) : A2uiPayload

A surface is being generated; nothing to draw yet but a placeholder.

Link copied to clipboard
object Companion
Link copied to clipboard
data class Failed(val error: String, val attempts: JsonElement? = null, val maxAttempts: Int? = null) : A2uiPayload

Generation was given up on. The conversation goes on; this slot shows why.

Link copied to clipboard
data class Malformed(val reason: String, val content: JsonElement) : A2uiPayload

The carrier claimed to hold A2UI and did not.

Link copied to clipboard
data class Retrying(val attempt: Int? = null, val maxAttempts: Int? = null, val errors: JsonElement? = null) : A2uiPayload

The previous attempt was rejected and the agent is generating again.

Link copied to clipboard
data class Surfaces(val messages: List<AgentToRendererMessage>) : A2uiPayload

A surface, or several: the v1.0 messages that build it, in order.