Package-level declarations

Types

Link copied to clipboard
data class A2uiBatch(val carrier: A2uiCarrier, val messages: List<AgentToRendererMessage>)

The messages to apply for one carrier, as one atomic batch.

Link copied to clipboard
data class A2uiCarried(val carrier: A2uiCarrier, val payload: A2uiPayload)

One payload and the carrier it arrived in.

Link copied to clipboard
sealed interface A2uiCarrier

Where in a transcript an A2uiPayload came from.

Link copied to clipboard
sealed interface A2uiPayload

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

Link copied to clipboard
class A2uiRequest(catalog: CatalogDefinition, renderToolName: String = AguiA2ui.RENDER_TOOL_NAME, guidelines: Boolean = true)

What a run has to carry for an agent to draw A2UI at all: the request side of the convention whose response side the rest of this module reads.

Link copied to clipboard
sealed interface A2uiSlot

What a renderer should draw for one carrier, decided by A2uiSurfaces.

Link copied to clipboard

The surfaces a transcript amounts to, and how to get a renderer from the last transcript to this one.

Link copied to clipboard
class A2uiTranslation(val catalogIds: (String) -> String = ::upstreamCatalogIds, val defaultCatalogId: String = AguiA2ui.V10_BASIC_CATALOG_ID)

Turns what upstream puts on the wire into the v1.0 messages a2ui-core parses.

Link copied to clipboard
object AguiA2ui

The names the A2UI-over-AG-UI convention is made of.

Link copied to clipboard
class RenderA2UiTool(name: String = AguiA2ui.RENDER_TOOL_NAME, translation: A2uiTranslation = A2uiTranslation.Default) : AbstractToolExecutor

The render_a2ui tool as a frontend tool: declared to the agent, and answered by the client.

Functions

Link copied to clipboard
fun UiTranscript.a2uiPayloads(translation: A2uiTranslation = A2uiTranslation.Default, toolNames: Set<String> = setOf(AguiA2ui.RENDER_TOOL_NAME)): List<A2uiCarried>

Every A2UI payload in this transcript, in transcript order.

Link copied to clipboard
fun catalogContext(catalog: CatalogDefinition): Context

The Context entry that tells an agent which catalog this client draws.

Link copied to clipboard
fun AgentToRendererMessage.surfaceIdOrNull(): String?

The surface a message addresses, or null for the two function-call messages, which have none.

Link copied to clipboard
fun ActionMessage.toForwardedProps(): JsonObject

An action the user took on a surface, in the shape upstream's middleware reads it from RunAgentInput.forwardedProps: {"a2uiAction": {"userAction": {...}}}.

Link copied to clipboard
fun ActionMessage.toUserText(): String

The same action as a line of user text, for a stack that does not honour forwardedProps.