InterruptAwaiter

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.

The resume contract per the AG-UI draft is a new run whose request body carries resume: [{ interruptId, status, payload? }]. ApprovalResponse models that payload; the transport-side concern of starting the new run lives in the calling app.

See also

Constructors

Link copied to clipboard
constructor(bridge: AguiA2cuiBridge)

Types

Link copied to clipboard
data class ApprovalResponse(val interruptId: String, val status: InterruptAwaiter.ApprovalResponse.Status, val payload: JsonObject? = null)

Functions

Link copied to clipboard
suspend fun awaitApproval(events: Flow<AguiEvent>): Pair<List<Interrupt>, CompletableDeferred<List<InterruptAwaiter.ApprovalResponse>>>

Collect until the first interrupt arrives, then suspend for the user's response.