AguiA2cuiBridge

class AguiA2cuiBridge(parser: A2uiParser = A2uiParser(), val a2uiCustomEventName: String = "a2ui")

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

CopilotKit carries A2UI frames as AG-UI CUSTOM events named "a2ui", with the frame embedded in the value field. This bridge extracts those payloads and re-emits them through the standard A2uiParser path. Tool calls and state events are exposed as separate flows so apps can wire per-concern consumers.

Constructors

Link copied to clipboard
constructor(parser: A2uiParser = A2uiParser(), a2uiCustomEventName: String = "a2ui")

Properties

Link copied to clipboard

Name matched against CUSTOM.name to detect A2UI-carrying events.

Functions

Link copied to clipboard
fun a2uiFrames(events: Flow<AguiEvent>): Flow<A2uiStreamEvent>

Extract A2UI frames from CUSTOM events whose name matches a2uiCustomEventName.

Link copied to clipboard
fun interrupts(events: Flow<AguiEvent>): Flow<List<Interrupt>>

Filter only RUN_FINISHED events whose outcome is "interrupt" — ready to present as HITL prompts.

Link copied to clipboard
fun toolCalls(events: Flow<AguiEvent>): Flow<ToolCallEvent>

Streaming tool-call reducer: builds ToolCallEvents out of TOOL_CALL_* events.