Skip to content

Interface: StreamProcessor

Defined in: packages/aiui-claude-channel/src/channel.ts:136

Consumes the decoded message payloads of a single thread.

Methods

onClose()?

optional onClose(): void | Promise<void>

Defined in: packages/aiui-claude-channel/src/channel.ts:152

Optional teardown: the transport connection dropped this thread without a fin (the socket just closed mid-turn). The processor should release any per-thread resources it holds — an upstream realtime session, incremental caches — and must not produce a user-visible side effect (no sendPrompt): an abandoned turn lowers to nothing. Never called for a thread that closed itself via ThreadContext.close. Best-effort — a throw is swallowed so sibling threads still tear down.

Returns

void | Promise<void>


onMessage()

onMessage(payload, meta): void | Promise<void>

Defined in: packages/aiui-claude-channel/src/channel.ts:142

Handle one decoded payload. Calls are serialized in arrival order — an async handler never overlaps the thread's (or connection's) next frame. Throwing rejects that frame (ok: false) without closing the thread.

Parameters

payload

unknown

meta

MessageMeta

Returns

void | Promise<void>