Package-level declarations

Types

Link copied to clipboard
data class ActivityPart(val id: String, val messageId: String, val activityType: String, val content: JsonElement) : UiPart

Structured content that is not text and not a tool call: an ACTIVITY_SNAPSHOT stream.

Link copied to clipboard
data class EncryptedReasoningValue(val subtype: String, val entityId: String, val value: String)

An opaque REASONING_ENCRYPTED_VALUE payload, kept verbatim for echoing back to the agent.

Link copied to clipboard
data class FilePart(val id: String, val mimeType: String, val remoteId: String? = null, val url: String? = null, val data: String? = null, val filename: String? = null) : UiPart

A binary attachment on a user message -- an image, a document.

Link copied to clipboard
data class ReasoningPart(val id: String, val text: String, val messageId: String, val title: String? = null, val streaming: Boolean = false, val encryptedValues: List<EncryptedReasoningValue> = emptyList()) : UiPart

The agent's chain of thought.

Link copied to clipboard
sealed interface RunState

Where the current run has got to.

Link copied to clipboard
data class TextPart(val id: String, val text: String, val messageId: String, val streaming: Boolean = false) : UiPart

Assistant or user prose.

Link copied to clipboard
data class ToolCallPart(val id: String, val toolCallId: String, val name: String, val arguments: String = "", val parsedArguments: JsonElement? = null, val status: ToolCallStatus = ToolCallStatus.STREAMING_ARGUMENTS, val result: String? = null, val error: String? = null, val parentMessageId: String? = null, val encryptedValue: String? = null) : UiPart

A tool the agent asked for, and how far it has got.

Link copied to clipboard

How far a ToolCallPart has got.

Link copied to clipboard
data class UiInterrupt(val id: String, val reason: String, val message: String? = null, val toolCallId: String? = null, val responseSchema: JsonElement? = null, val expiresAt: String? = null, val metadata: JsonElement? = null)

One thing a run stopped to ask for: an approval, a choice, a credential.

Link copied to clipboard
data class UiMessage(val id: String, val role: UiRole, val parts: List<UiPart> = emptyList(), val name: String? = null)

One turn in the transcript, as an ordered list of UiParts.

Link copied to clipboard
sealed interface UiPart

One renderable piece of a message, in the position the agent emitted it.

Link copied to clipboard
data class UiResumeEntry(val interruptId: String, val status: UiResumeStatus, val payload: JsonElement? = null)

The client's answer to one UiInterrupt, as the next run carries it.

Link copied to clipboard

How a UiResumeEntry disposes of its interrupt.

Link copied to clipboard
enum UiRole : Enum<UiRole>

Who produced a message.

Link copied to clipboard
data class UiTranscript(val messages: List<UiMessage> = emptyList(), val run: RunState = RunState.Idle, val sharedState: JsonElement = JsonObject(emptyMap()), val steps: List<String> = emptyList())

Everything a renderer needs to draw one conversation, at one instant.

Properties

Link copied to clipboard

What the thread is waiting on: the interrupts of a RunState.Finished that stopped to ask, and nothing for any other state. A renderer that draws the questions asks this rather than casting.