Skip to content

Interface: IntentSocket

Defined in: aiui-intent-runtime/src/protocol.ts:162

A connected, hello-completed channel socket.

Methods

close()

close(): void

Defined in: aiui-intent-runtime/src/protocol.ts:193

Returns

void


onServerMessage()

onServerMessage(handler): void

Defined in: aiui-intent-runtime/src/protocol.ts:192

Register a handler for server pushes (messages carrying a kind) — the lowered echoes an intent-v1 thread merges back in. Acks are never routed here. Multiple handlers are allowed; each fires per push.

Parameters

handler

(msg) => void

Returns

void


send()

send(threadId, payload, fin): Promise<Ack>

Defined in: aiui-intent-runtime/src/protocol.ts:164

Send one JSON data frame for a thread; resolves with the server's ack.

Parameters

threadId

string

payload

unknown

fin

boolean

Returns

Promise<Ack>


sendAttachment()

sendAttachment(threadId, chunk, bytes, fin?): Promise<Ack>

Defined in: aiui-intent-runtime/src/protocol.ts:174

Send a raw-binary attachment chunk (a shot PNG or a whole audio segment) — the bytes ride the frame's payload verbatim, never base64'd.

Parameters

threadId

string

chunk

AttachmentChunk

bytes

Uint8Array

fin?

boolean

Returns

Promise<Ack>


sendAudio()

sendAudio(threadId, chunk, bytes, fin?): Promise<Ack>

Defined in: aiui-intent-runtime/src/protocol.ts:186

Send one streamed PCM frame of a talk segment (the realtime path) — raw bytes on the payload, seq/id in the envelope chunk. Same wire shape as sendAttachment; a distinct method only so the audio chunk's seq is carried.

Parameters

threadId

string

chunk

AudioChunk

bytes

Uint8Array

fin?

boolean

Returns

Promise<Ack>


sendChunk()

sendChunk(threadId, chunk, payload, fin?): Promise<Ack>

Defined in: aiui-intent-runtime/src/protocol.ts:169

Send a tagged JSON chunk (an events batch) for a streaming thread. fin marks the thread's final frame.

Parameters

threadId

string

chunk

JsonChunk

payload

unknown

fin?

boolean

Returns

Promise<Ack>