Package-level declarations

Types

Link copied to clipboard
class AguiA2cuiBridge(parser: A2uiParser = A2uiParser(), val a2uiCustomEventName: String = "a2ui")

Translation layer sitting between AguiEvents and A2CUI's own abstractions.

Link copied to clipboard
@Serializable
sealed interface AguiEvent

One event from the AG-UI protocol stream. Discriminated by type at the top level, matching the wire format from docs.ag-ui.com.

Link copied to clipboard
class AguiEventParser(json: Json = AguiJson)

Parse a stream of JSON strings (one AG-UI event per element) into typed AguiEvents.

Link copied to clipboard
class AguiStateReducer(val store: DataModel = DataModel())

Applies AG-UI STATE_SNAPSHOT and STATE_DELTA events to a DataModel. This is the agent-level state channel, separate from A2UI's per-surface data model — apps that use CoAgent-style shared state should instantiate one reducer per logical state store.

Link copied to clipboard
sealed interface AguiStreamEvent

Outcome of parsing a single AG-UI event frame.

Link copied to clipboard
@Serializable
data class Interrupt(val id: String, val reason: String, val message: String? = null, val toolCallId: String? = null, val responseSchema: JsonObject? = null, val expiresAt: Long? = null)

One pending approval request inside a RUN_FINISHED { outcome = "interrupt" }.

Link copied to clipboard

Suspends until the next RUN_FINISHED { outcome = "interrupt" } arrives on events, then exposes the interrupts and a resolver so the UI can collect the user's decision.

Link copied to clipboard
object JsonPatch

Minimal RFC 6902 JSON Patch applier. Supports the three load-bearing operations that AG-UI STATE_DELTA emits in practice: add, replace, remove. move, copy, and test are accepted but fall back to replace-like semantics; they can be fleshed out when real-world traffic demands them.

Link copied to clipboard
sealed interface ToolCallEvent

State of one streaming tool call, assembled from TOOL_CALL_START / TOOL_CALL_ARGS / TOOL_CALL_END / TOOL_CALL_RESULT events.

Properties

Link copied to clipboard
val AguiJson: Json

Shared Json instance for AG-UI events. Uses the default type class discriminator, which matches the protocol's wire shape. Unknown keys are ignored for forward-compat with draft events (reasoning, activity, interrupt).

Functions

Link copied to clipboard
fun <T> rememberCoAgentState(name: String, initial: T, serializer: KSerializer<T>, reducer: AguiStateReducer, json: Json = defaultCoAgentJson): MutableState<T>

Bidirectionally bind a Compose MutableState to a slot inside an AG-UI AguiStateReducer.