@memberjunction/ai-realtime-client 5.48.0 → 5.49.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"xaiRealtimeClient.js","sourceRoot":"","sources":["../../src/drivers/xaiRealtimeClient.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,kBAAkB,EAAuB,MAAM,+BAA+B,CAAC;AACxF,OAAO,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AACxD,OAAO,EAAwB,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AACjF,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EAAE,mBAAmB,EAAkB,MAAM,qBAAqB,CAAC;AAE1E,kFAAkF;AAElF;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,4BAA4B,CAAC;AAEhE;;;;;GAKG;AACH,MAAM,CAAC,MAAM,oCAAoC,GAAG,oBAAoB,CAAC;AAEzE;;;;GAIG;AACH,MAAM,CAAC,MAAM,mBAAmB,GAAG,KAAK,CAAC;AAuLzC,kFAAkF;AAElF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAEI,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,kBAAkB;IAAlD;;QACH,8EAA8E;QACtE,WAAM,GAA4B,IAAI,CAAC;QACvC,cAAS,GAAuB,IAAI,CAAC;QACrC,eAAU,GAA0B,IAAI,CAAC;QACzC,aAAQ,GAAgC,IAAI,CAAC;QACrD;;;WAGG;QACO,kBAAa,GAAsB,IAAI,CAAC;QAElD,8EAA8E;QAC9E;;;;;WAKG;QACK,wBAAmB,GAAG,KAAK,CAAC;QACpC,0EAA0E;QAClE,yBAAoB,GAAG,EAAE,CAAC;QAClC,+FAA+F;QACvF,mBAAc,GAAG,KAA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C,KAAK,CAAC,iCAAiC,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;QACjE,CAAC;IACL,CAAC;CACJ,CAAA;AA1JY,iBAAiB;IAD7B,aAAa,CAAC,kBAAkB,EAAE,KAAK,CAAC;GAC5B,iBAAiB,CA0J7B;;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB;IACjC,oEAAoE;AACxE,CAAC"}
@@ -0,0 +1,527 @@
1
+ import { ClientRealtimeSessionConfig, JSONObject } from '@memberjunction/ai';
2
+ import { BaseRealtimeClient, RealtimeClientState } from './baseRealtimeClient.js';
3
+ import { IRealtimePcmPlayback } from '../audio/pcmPlayback.js';
4
+ import { IPcmMicCapture } from '../audio/micCapture.js';
5
+ /** Streaming delta of the assistant's spoken-text transcript (GA or beta event name). */
6
+ export interface OAIProtocolTranscriptDelta {
7
+ type: 'response.output_audio_transcript.delta' | 'response.audio_transcript.delta';
8
+ delta: string;
9
+ response_id?: string;
10
+ item_id?: string;
11
+ }
12
+ /** Final assistant transcript for a turn (GA or beta event name). */
13
+ export interface OAIProtocolTranscriptDone {
14
+ type: 'response.output_audio_transcript.done' | 'response.audio_transcript.done';
15
+ transcript: string;
16
+ response_id?: string;
17
+ item_id?: string;
18
+ }
19
+ /** One base64 PCM16 chunk of the agent's spoken output (websocket transports only). */
20
+ export interface OAIProtocolAudioDelta {
21
+ type: 'response.audio.delta' | 'response.output_audio.delta';
22
+ delta: string;
23
+ response_id?: string;
24
+ item_id?: string;
25
+ }
26
+ /** Final transcription of the user's spoken input for a turn. */
27
+ export interface OAIProtocolInputTranscriptionCompleted {
28
+ type: 'conversation.item.input_audio_transcription.completed';
29
+ transcript: string;
30
+ item_id?: string;
31
+ }
32
+ /** The model finished assembling a function (tool) call and wants it executed. */
33
+ export interface OAIProtocolFunctionCallArgumentsDone {
34
+ type: 'response.function_call_arguments.done';
35
+ call_id: string;
36
+ name: string;
37
+ /** JSON-encoded arguments. */
38
+ arguments: string;
39
+ }
40
+ /** The provider detected the user starting to speak (barge-in). */
41
+ export interface OAIProtocolSpeechStarted {
42
+ type: 'input_audio_buffer.speech_started';
43
+ }
44
+ /** A new response (turn) started — tracked so we never start a second overlapping response. */
45
+ export interface OAIProtocolResponseCreated {
46
+ type: 'response.created';
47
+ }
48
+ /** The endpoint confirmed the session exists (used by deferring transports as the config gate). */
49
+ export interface OAIProtocolSessionCreated {
50
+ type: 'session.created';
51
+ }
52
+ /**
53
+ * A full response (turn) completed — carries the usage payload for THIS response
54
+ * (`input_tokens` / `output_tokens`), i.e. per-response DELTAS, exactly the `OnUsage`
55
+ * contract shape.
56
+ */
57
+ export interface OAIProtocolResponseDone {
58
+ type: 'response.done';
59
+ response?: {
60
+ usage?: {
61
+ input_tokens?: number;
62
+ output_tokens?: number;
63
+ [detail: string]: unknown;
64
+ };
65
+ };
66
+ }
67
+ /**
68
+ * WebRTC-only playback events: the provider-managed client audio buffer started/stopped
69
+ * PLAYING. Websocket transports own their playback locally and never receive these.
70
+ */
71
+ export interface OAIProtocolOutputAudioBufferStarted {
72
+ type: 'output_audio_buffer.started';
73
+ }
74
+ export interface OAIProtocolOutputAudioBufferStopped {
75
+ type: 'output_audio_buffer.stopped' | 'output_audio_buffer.cleared';
76
+ }
77
+ /** Provider-side error frame. */
78
+ export interface OAIProtocolErrorEvent {
79
+ type: 'error';
80
+ error?: {
81
+ message?: string;
82
+ code?: string;
83
+ };
84
+ }
85
+ /** Events whose `type` we don't explicitly handle still parse to this shape. */
86
+ export interface OAIProtocolUnknownEvent {
87
+ type: string;
88
+ }
89
+ export type OpenAIProtocolServerEvent = OAIProtocolTranscriptDelta | OAIProtocolTranscriptDone | OAIProtocolAudioDelta | OAIProtocolInputTranscriptionCompleted | OAIProtocolFunctionCallArgumentsDone | OAIProtocolSpeechStarted | OAIProtocolResponseCreated | OAIProtocolSessionCreated | OAIProtocolResponseDone | OAIProtocolOutputAudioBufferStarted | OAIProtocolOutputAudioBufferStopped | OAIProtocolErrorEvent | OAIProtocolUnknownEvent;
90
+ /** Applies the server-built session config (instructions + tools) to the live session. */
91
+ export interface OAIProtocolSessionUpdateEvent {
92
+ type: 'session.update';
93
+ session: JSONObject;
94
+ }
95
+ /** A user or system `message` conversation item. */
96
+ export interface OAIProtocolMessageItem {
97
+ type: 'message';
98
+ role: 'user' | 'system';
99
+ content: Array<{
100
+ type: 'input_text';
101
+ text: string;
102
+ }>;
103
+ }
104
+ /** The output of an executed function (tool) call, correlated by `call_id`. */
105
+ export interface OAIProtocolFunctionCallOutputItem {
106
+ type: 'function_call_output';
107
+ call_id: string;
108
+ output: string;
109
+ }
110
+ /** Creates a conversation item (message or tool output). */
111
+ export interface OAIProtocolConversationItemCreateEvent {
112
+ type: 'conversation.item.create';
113
+ item: OAIProtocolMessageItem | OAIProtocolFunctionCallOutputItem;
114
+ }
115
+ /** Asks the model to produce a response, optionally with one-off instructions. */
116
+ export interface OAIProtocolResponseCreateEvent {
117
+ type: 'response.create';
118
+ response?: {
119
+ instructions: string;
120
+ };
121
+ }
122
+ /** Cancels the model's in-flight response (generation stops; a response.done follows). */
123
+ export interface OAIProtocolResponseCancelEvent {
124
+ type: 'response.cancel';
125
+ }
126
+ /** WebRTC-only: stops + clears the provider-managed output audio buffer immediately. */
127
+ export interface OAIProtocolOutputAudioBufferClearEvent {
128
+ type: 'output_audio_buffer.clear';
129
+ }
130
+ /** Appends one base64 PCM16 mic chunk to the provider's input audio buffer (websocket transports). */
131
+ export interface OAIProtocolInputAudioBufferAppendEvent {
132
+ type: 'input_audio_buffer.append';
133
+ audio: string;
134
+ }
135
+ export type OpenAIProtocolClientEvent = OAIProtocolSessionUpdateEvent | OAIProtocolConversationItemCreateEvent | OAIProtocolResponseCreateEvent | OAIProtocolResponseCancelEvent | OAIProtocolOutputAudioBufferClearEvent | OAIProtocolInputAudioBufferAppendEvent;
136
+ /**
137
+ * The shared **OpenAI-protocol brain** for realtime CLIENT drivers — the transport-agnostic
138
+ * middle layer between {@link BaseRealtimeClient} and the per-provider drivers.
139
+ *
140
+ * Every OpenAI-protocol provider (OpenAI itself over WebRTC, xAI Grok Voice and self-hosted
141
+ * HuggingFace over websockets) shares the exact same event vocabulary and turn discipline, so
142
+ * this class owns — ONCE — the pieces that were previously cloned per driver:
143
+ *
144
+ * - **Inbound event dispatch** ({@link handleEvent}): GA + beta transcript names, input
145
+ * transcription, tool calls, barge-in gating, playback-buffer events, provider error frames.
146
+ * - **The response state machine**: `responseActive` set on `response.created` / cleared on
147
+ * `response.done`; tool-result `response.create`s queued while a response is in flight and
148
+ * flushed on `response.done` so the model ALWAYS voices delegated results.
149
+ * - **Narration-kind tagging**: {@link RequestSpokenUpdate} marks the NEXT response as
150
+ * `'narration'` so its transcripts are emitted with `Kind: 'narration'` (ephemeral).
151
+ * - **The outbound actions**: {@link SendText} (implies barge-in), {@link SendContextNote},
152
+ * {@link SendToolResult}, {@link CancelActiveResponse}, {@link SetMuted}.
153
+ *
154
+ * Transport specifics stay in subclasses through a small set of seams: {@link canSendEvents} /
155
+ * {@link sendProtocolEvent} (the wire), {@link stopAudioOutput} (how already-generated speech is
156
+ * silenced), {@link handleAudioDeltaFrame} (websocket transports enqueue PCM; WebRTC ignores —
157
+ * audio rides the peer connection), and per-provider behavioral overrides
158
+ * ({@link onUserTranscriptFrame}, {@link onSpeechStartedFrame}, {@link releasesBusyFlagOnToolCall}).
159
+ */
160
+ export declare abstract class OpenAIProtocolRealtimeClient extends BaseRealtimeClient {
161
+ /** Accumulates the in-flight assistant transcript across delta frames. */
162
+ protected pendingAssistantText: string;
163
+ /** True while the model has a response in flight; gates narration + queues the tool result. */
164
+ protected responseActive: boolean;
165
+ /** Set when a tool result is ready while a response is active; sent on the next response.done. */
166
+ protected pendingResultResponse: boolean;
167
+ /**
168
+ * Count of locally-initiated `response.create`s whose `response.created` echo has not arrived
169
+ * yet. While non-zero, a `response.done` belongs to an EARLIER (typically just-cancelled)
170
+ * response — it must not clear the busy flag, flush the queued trigger, or flip the state for
171
+ * the response we just started (usage is still emitted). Consumed by `response.created`.
172
+ */
173
+ protected pendingLocalResponseCreates: number;
174
+ /**
175
+ * True while a response the provider has CONFIRMED (`response.created` seen, `response.done` not
176
+ * yet) is in flight. Distinct from {@link responseActive}, which is set EAGERLY before a local
177
+ * `response.create` is even sent: if the provider REJECTS that create (an `error` frame with no
178
+ * `response.created`), `responseActive` would otherwise stay stuck true forever. This flag lets
179
+ * {@link onErrorFrame} tell "the eager flag is a phantom for a rejected create" (no confirmed
180
+ * response) from "a real response is genuinely active" (e.g. a concurrent VAD turn), so it clears
181
+ * the phantom without disturbing a live turn. Set on `response.created`, cleared on `response.done`.
182
+ */
183
+ protected confirmedResponseActive: boolean;
184
+ /**
185
+ * Set by {@link RequestSpokenUpdate} just before it sends its `response.create`, and
186
+ * CONSUMED by the very next `response.created` frame, which stamps
187
+ * {@link activeResponseKind} for that turn. Narration is only requested while the model is
188
+ * idle (hosts gate on {@link IsBusy}), so under normal ordering the next `response.created`
189
+ * is ours.
190
+ */
191
+ protected pendingNarrationKind: boolean;
192
+ /**
193
+ * The kind of the response currently in flight. Event ordering (confirmed against the live
194
+ * OpenAI API): `response.created` → transcript deltas → `*_audio_transcript.done` →
195
+ * `response.done`. The transcript-done frame therefore arrives while the kind is still set,
196
+ * letting {@link onAssistantDone} classify the turn; `response.done` then resets it.
197
+ */
198
+ protected activeResponseKind: 'normal' | 'narration';
199
+ /**
200
+ * The client's own view of the session state — mirrors what `emitStateChange` last
201
+ * reported, EXCEPT after a tool call is emitted: the host typically shows its own busy
202
+ * state then, so the client silently leaves `'speaking'` (no emission) to preserve the
203
+ * host's indicator until the result reply starts (see {@link onToolCallFrame}).
204
+ */
205
+ protected currentState: RealtimeClientState;
206
+ /** The mic stream owned by the current connection (used by the shared {@link SetMuted}). */
207
+ protected micStream: MediaStream | null;
208
+ /** Whether the transport can currently deliver client events (channel/socket open). */
209
+ protected abstract canSendEvents(): boolean;
210
+ /** Delivers one protocol client event over the transport (only called when {@link canSendEvents}). */
211
+ protected abstract sendProtocolEvent(event: OpenAIProtocolClientEvent): void;
212
+ /**
213
+ * Silences already-generated speech during a cancel: websocket transports flush their local
214
+ * playout queue; the WebRTC transport asks the provider to clear its managed output buffer.
215
+ */
216
+ protected abstract stopAudioOutput(): void;
217
+ /** Debug label used in the shared console diagnostics. */
218
+ protected get providerDebugLabel(): string;
219
+ /**
220
+ * Handles one base64 PCM16 audio delta. Default: no-op — on the WebRTC transport the agent's
221
+ * audio rides the peer connection's remote track, not data-channel frames. Websocket
222
+ * transports override to enqueue into their local playout engine.
223
+ */
224
+ protected handleAudioDeltaFrame(_deltaBase64: string): void;
225
+ /**
226
+ * Emits the user's spoken-input transcription. Default (OpenAI/HuggingFace): each
227
+ * `.completed` frame is one final caption. Providers that STREAM the completed event
228
+ * (Grok re-sends the full growing text each time) override to collapse the stream into a
229
+ * single in-place-updating bubble.
230
+ */
231
+ protected onUserTranscriptFrame(transcript: string): void;
232
+ /**
233
+ * The user started speaking. TRUE barge-in only when it cut off active model output (a
234
+ * response in flight or audio audibly playing) — a normal turn while the model is idle is
235
+ * NOT an interruption, so the emission is gated (base-contract rule). Transports that own
236
+ * their playback override to also flush the local playout queue.
237
+ */
238
+ protected onSpeechStartedFrame(): void;
239
+ /**
240
+ * Whether a completed tool call CLEARS {@link responseActive}. WebRTC keeps the flag (the
241
+ * provider reliably follows with `response.done`); websocket transports clear it as a
242
+ * deadlock guard so a queued {@link SendToolResult} can never wedge if the endpoint skips
243
+ * the trailing frame.
244
+ */
245
+ protected get releasesBusyFlagOnToolCall(): boolean;
246
+ /** Hook for transports that gate on the endpoint's `session.created` frame. Default: no-op. */
247
+ protected onSessionCreatedFrame(): void;
248
+ /** Diagnostic hook for each parsed inbound event. Default: silent. */
249
+ protected logInboundEvent(_event: OpenAIProtocolServerEvent): void;
250
+ /** Diagnostic hook for each non-JSON inbound frame. Default: silent. */
251
+ protected onNonJsonFrame(_raw: string): void;
252
+ /** Diagnostic hook for each outbound event. Default: silent. */
253
+ protected logOutboundEvent(_event: OpenAIProtocolClientEvent): void;
254
+ /**
255
+ * Injects typed text as a user-role `message` conversation item, then triggers a reply
256
+ * through the SAME collision-safe path tool results use ({@link requestResultResponse}).
257
+ * No-op when the transport isn't open.
258
+ *
259
+ * **SendText implies barge-in** (base-contract rule): an active spoken response is
260
+ * cancelled via {@link CancelActiveResponse} before the text is injected, so the typed
261
+ * turn takes the floor immediately instead of waiting behind stale speech. When nothing is
262
+ * active the cancel is a no-op and the reply triggers immediately.
263
+ */
264
+ SendText(text: string): void;
265
+ /**
266
+ * @inheritdoc
267
+ *
268
+ * Sends `response.cancel` (only when a response is actually in flight) and silences
269
+ * already-generated speech via the transport's {@link stopAudioOutput}. Resets the local
270
+ * response state machine (active flag, narration kind, accumulated transcript) but
271
+ * PRESERVES any queued tool-result trigger: delegated work is never affected by a
272
+ * floor-control cancel, and the queued trigger still fires on the cancelled response's
273
+ * trailing `response.done`. No-op when idle or when the transport is not open.
274
+ */
275
+ CancelActiveResponse(): void;
276
+ /**
277
+ * Injects a system-role context item the model can draw on the next time it speaks,
278
+ * WITHOUT forcing a reply. Item creation is always safe mid-response.
279
+ *
280
+ * NOTE: role must be 'system' — gpt-realtime (and the compatible endpoints) reject
281
+ * 'developer' items ("Developer messages are only supported for quicksilver sessions").
282
+ */
283
+ SendContextNote(text: string): void;
284
+ /**
285
+ * Triggers ONE short spoken update with the given instructions. Marks the upcoming
286
+ * response as `'narration'` (flag consumed by the next `response.created`) so its
287
+ * transcripts are emitted with `Kind: 'narration'` — ephemeral by contract. Sets
288
+ * {@link responseActive} eagerly so a tool result landing mid-narration queues instead of
289
+ * colliding.
290
+ *
291
+ * **Skips when busy** (base-contract collision rule — drivers MUST queue or skip): a
292
+ * `response.create` sent while a response is in flight would be rejected/garbled by the
293
+ * provider, and narration is disposable by contract, so the update is dropped with a debug
294
+ * log rather than queued to come out late and stale. Hosts SHOULD still gate on
295
+ * {@link IsBusy} / {@link IsAudioPlaying} for timing quality.
296
+ */
297
+ RequestSpokenUpdate(instructions: string): void;
298
+ /**
299
+ * Sends the tool result back as a `function_call_output` conversation item, then triggers
300
+ * a reply — immediately if the model is idle, otherwise queued until the current response
301
+ * (e.g. a progress narration) finishes. Without the queueing the result's `response.create`
302
+ * would collide with an in-flight narration and be dropped, leaving the model silent when
303
+ * delegated work comes back.
304
+ */
305
+ SendToolResult(callID: string, outputJson: string): void;
306
+ /**
307
+ * Mutes / unmutes by toggling the mic tracks' `enabled` flag: the transport stays up and
308
+ * streams SILENCE while muted (the provider's VAD sees a continuous stream and the un-mute
309
+ * is glitch-free — the same policy across the client driver family).
310
+ */
311
+ SetMuted(muted: boolean): void;
312
+ /** @inheritdoc */
313
+ get IsBusy(): boolean;
314
+ /**
315
+ * Parses one raw inbound payload and dispatches it. Non-JSON frames and non-object JSON
316
+ * values are ignored (with the {@link onNonJsonFrame} diagnostic hook for the former).
317
+ */
318
+ protected handleProtocolMessage(raw: string): void;
319
+ /** Dispatches a typed OpenAI-protocol server event to the appropriate behavior. */
320
+ protected handleEvent(event: OpenAIProtocolServerEvent): void;
321
+ /**
322
+ * Called when the model takes the floor (`response.created`), i.e. the user's turn is definitively
323
+ * over. Drivers that track per-user-turn transcription state override this to reset it. No-op here.
324
+ */
325
+ protected onResponseStarted(): void;
326
+ /** WebRTC-only playback-buffer hooks; websocket transports never receive these frames. */
327
+ protected onOutputAudioBufferStarted(): void;
328
+ protected onOutputAudioBufferStopped(): void;
329
+ /** Reflects `'speaking'` on the first audio delta, then hands the chunk to the transport. */
330
+ private onAudioDelta;
331
+ /** Appends an assistant transcript delta, reflects `'speaking'`, and emits the delta. */
332
+ private onAssistantDelta;
333
+ /**
334
+ * Finalizes the assistant turn: emits the final transcript tagged with the ACTIVE response
335
+ * kind (the transcript-done frame arrives BEFORE `response.done`, so
336
+ * {@link activeResponseKind} still reflects this turn), then returns to `'listening'`.
337
+ * Empty turns emit nothing.
338
+ */
339
+ private onAssistantDone;
340
+ /**
341
+ * Surfaces a completed tool call to the host. The client silently leaves the `'speaking'`
342
+ * state (NO emission) so a host-rendered busy indicator (e.g. "thinking") isn't clobbered
343
+ * by this turn's trailing `response.done` / playback-stopped frames. Websocket transports
344
+ * additionally clear the busy flag ({@link releasesBusyFlagOnToolCall}) as a deadlock guard.
345
+ */
346
+ private onToolCallFrame;
347
+ /**
348
+ * Emits the completed response's usage to the host as a DELTA (the `response.done` usage
349
+ * payload covers exactly this response, so it is already incremental — the `OnUsage`
350
+ * contract's preferred shape). Frames without a usage payload emit nothing.
351
+ */
352
+ private emitResponseUsage;
353
+ /**
354
+ * Surfaces a provider error frame (non-fatal; the session continues).
355
+ *
356
+ * SELF-HEAL for the stale-response counter (see {@link pendingLocalResponseCreates}): a
357
+ * `response.create` the provider REJECTS (overlap, invalid params) produces an `error` frame
358
+ * and **no** `response.created`, so the counter would otherwise never decrement and every
359
+ * future `response.done` would take the stale branch — wedging the client (`IsBusy` stuck true,
360
+ * narration + tool results silently dropped). Decrementing here (floored at 0) reverts to the
361
+ * pre-counter self-healing behavior for that turn rather than leaving the session dead. An
362
+ * error unrelated to a local create at worst under-protects one `done` (the old default), never
363
+ * wedges.
364
+ */
365
+ private onErrorFrame;
366
+ /**
367
+ * Asks the model to speak (a tool result or typed-text reply) — immediately if it's idle,
368
+ * otherwise queued until the current response finishes. An immediate trigger also
369
+ * CONSUMES any queued trigger debt: every payload item is already in the conversation, so
370
+ * one `response.create` voices everything (e.g. typed text barging in over a narration
371
+ * that had tool results queued behind it).
372
+ */
373
+ protected requestResultResponse(): void;
374
+ /** On a turn completing, fire any queued tool-result response so the answer is spoken. */
375
+ protected flushPendingResultResponse(): void;
376
+ /** Resets the per-session response state machine (used on Disconnect). */
377
+ protected resetResponseState(): void;
378
+ /** Updates the client's own state view and emits the change to the host. */
379
+ protected setState(state: RealtimeClientState): void;
380
+ /** Logs (diagnostic hook) and delivers one client event when the transport is open. */
381
+ protected sendEvent(event: OpenAIProtocolClientEvent): void;
382
+ }
383
+ /**
384
+ * The minimal websocket surface the websocket-transport drivers depend on: assignable lifecycle
385
+ * handlers plus `send`/`close`. Declaring the seam as an interface (rather than the platform
386
+ * `WebSocket`) lets unit tests inject a fully in-memory fake — no websocket, no network.
387
+ */
388
+ export interface IOpenAIProtocolClientSocket {
389
+ /** Invoked once the socket is open. */
390
+ onopen: (() => void) | null;
391
+ /** Invoked with each inbound frame's raw string payload. */
392
+ onmessage: ((data: string) => void) | null;
393
+ /** Invoked on a socket-level error (fatal). */
394
+ onerror: ((message: string) => void) | null;
395
+ /** Invoked when the socket closes (any reason). */
396
+ onclose: (() => void) | null;
397
+ /** Sends one JSON-serialized client frame. */
398
+ send(data: string): void;
399
+ /** Terminates the underlying connection. */
400
+ close(): void;
401
+ }
402
+ /**
403
+ * The shared **websocket + client-owned-PCM transport** for OpenAI-protocol client drivers
404
+ * (xAI Grok Voice, self-hosted HuggingFace). Extends the protocol brain with everything the
405
+ * websocket drivers previously each owned:
406
+ *
407
+ * - The socket lifecycle: wire-up, open/created gating (profile-driven via
408
+ * {@link waitsForSessionCreated}), fatal error / unexpected-close handling.
409
+ * - The PCM audio plane: shared mic-capture worklet streaming `input_audio_buffer.append`
410
+ * frames up, shared playout engine scheduling base64 deltas down, audio meters both ways.
411
+ * - The transport implementations of the brain's seams: {@link sendProtocolEvent} /
412
+ * {@link canSendEvents} over the socket, {@link stopAudioOutput} → local playout flush,
413
+ * {@link handleAudioDeltaFrame} → playout enqueue, `IsAudioPlaying` → the playout clock.
414
+ *
415
+ * Concrete drivers supply only: the socket target ({@link openProviderSocket}), the session
416
+ * object + sample rate resolution from the server pact ({@link resolveSessionObject} /
417
+ * {@link resolveSampleRate}), and any provider behavior overrides (streamed user transcripts,
418
+ * close semantics).
419
+ */
420
+ export declare abstract class OpenAIProtocolWebSocketRealtimeClient extends OpenAIProtocolRealtimeClient {
421
+ /** The live socket (null when disconnected). Protected so test subclasses can inspect. */
422
+ protected socket: IOpenAIProtocolClientSocket | null;
423
+ /** The local playout engine (client-owned audio plane). */
424
+ protected playback: IRealtimePcmPlayback | null;
425
+ /** The mic-capture pipeline streaming PCM16 up to the provider. */
426
+ protected micCapture: IPcmMicCapture | null;
427
+ /**
428
+ * The wire-shaped session object applied via `session.update` at the readiness boundary.
429
+ * Protected so test subclasses can seed it without a full Connect.
430
+ */
431
+ protected sessionObject: JSONObject;
432
+ /** True once Disconnect ran — an expected socket close must not surface as fatal. */
433
+ protected closedByConsumer: boolean;
434
+ /** True while the socket is OPEN — gates every send so a CONNECTING socket never throws. */
435
+ protected socketOpen: boolean;
436
+ /** Resolver for the in-flight Connect's `session.created` wait (deferring providers only). */
437
+ private sessionCreatedResolver;
438
+ /** Rejects the in-flight Connect (open OR created phase); null outside Connect. */
439
+ private failPendingConnect;
440
+ /** Opens the provider socket for this connection (drivers own URL/auth specifics). */
441
+ protected abstract openProviderSocket(config: ClientRealtimeSessionConfig): IOpenAIProtocolClientSocket;
442
+ /** Extracts the wire-shaped `session` object from the server pact. Default: the pact itself. */
443
+ protected resolveSessionObject(config: ClientRealtimeSessionConfig): JSONObject;
444
+ /** Resolves the PCM sample rate for the audio plane (both directions). */
445
+ protected abstract resolveSampleRate(config: ClientRealtimeSessionConfig): number;
446
+ /**
447
+ * Whether the readiness boundary waits for the endpoint's `session.created` frame before
448
+ * applying the session config (HuggingFace) or applies it on socket open (xAI — the
449
+ * protocol has no separate readiness ack there).
450
+ */
451
+ protected get waitsForSessionCreated(): boolean;
452
+ /**
453
+ * Connect-phase deadline in milliseconds, covering socket-open AND (when the provider
454
+ * defers) the `session.created` wait. On expiry `Connect` rejects with a fatal error
455
+ * instead of hanging forever against a silent endpoint. Override per driver/deployment.
456
+ */
457
+ protected get connectTimeoutMs(): number;
458
+ /**
459
+ * Opens the websocket, gates on open (and `session.created` when the provider defers),
460
+ * applies the server-authored session config as the FIRST frame (prompt + tool authority
461
+ * stay server-side), builds the PCM audio plane at the provider's rate, and reports
462
+ * `'listening'` only after all of that (obligation #7).
463
+ */
464
+ Connect(config: ClientRealtimeSessionConfig, micStream: MediaStream): Promise<void>;
465
+ /**
466
+ * Tears down the socket, mic capture, mic tracks, and playout engine, resets the response
467
+ * state machine, and emits a final `'closed'` (unless already `'error'`). Safe to call
468
+ * more than once.
469
+ */
470
+ Disconnect(): Promise<void>;
471
+ /** @inheritdoc — requires an OPEN socket (a CONNECTING raw WebSocket throws on send). */
472
+ protected canSendEvents(): boolean;
473
+ /** @inheritdoc */
474
+ protected sendProtocolEvent(event: OpenAIProtocolClientEvent): void;
475
+ /** @inheritdoc — the client OWNS the audio plane, so a cancel flushes the local queue. */
476
+ protected stopAudioOutput(): void;
477
+ /** @inheritdoc — enqueues one base64 PCM16 chunk into the local playout engine. */
478
+ protected handleAudioDeltaFrame(deltaBase64: string): void;
479
+ /**
480
+ * @inheritdoc
481
+ *
482
+ * Computed directly from the playout engine's playhead clock — this client OWNS the output
483
+ * buffer, so "audibly playing" is precisely "scheduled audio extends beyond the audio
484
+ * context's current time".
485
+ */
486
+ get IsAudioPlaying(): boolean;
487
+ /**
488
+ * @inheritdoc — websocket transports flush their local playout on TRUE barge-in
489
+ * (obligation #3); the provider cancels its own turn and emits a terminal `response.done`.
490
+ */
491
+ protected onSpeechStartedFrame(): void;
492
+ /** @inheritdoc — deadlock guard: compat endpoints may skip `response.done` after a tool call. */
493
+ protected get releasesBusyFlagOnToolCall(): boolean;
494
+ /** @inheritdoc — releases a deferring Connect's `session.created` gate. */
495
+ protected onSessionCreatedFrame(): void;
496
+ /**
497
+ * Sends the server-controlled session config (instructions + tools) as a `session.update`
498
+ * so the co-agent's identity and tool set apply. Skipped when the pact carried no config
499
+ * (e.g. the host failed to parse the server payload — it already logged that; sending an
500
+ * EMPTY `session.update` would be wrong).
501
+ */
502
+ protected applySessionConfig(): void;
503
+ /** Streams one base64 PCM16 mic chunk as an `input_audio_buffer.append` frame. */
504
+ protected sendMicChunk(base64Pcm16: string): void;
505
+ /** Formats a socket-level error message for the host. Providers brand this (see xAI). */
506
+ protected formatTransportError(message: string): string;
507
+ /** The fatal-error message surfaced when the socket closes unexpectedly. Providers brand this. */
508
+ protected get unexpectedCloseMessage(): string;
509
+ /** Surfaces a fatal socket error and marks the session unusable (obligation #6). */
510
+ protected handleSocketError(message: string): void;
511
+ /**
512
+ * A socket close the CONSUMER didn't ask for. Default: FATAL — providers hard-close at
513
+ * token expiry and when they end the session themselves, so an unexpected close is how
514
+ * credential / session death reaches the host (obligation #6). Providers with benign
515
+ * close semantics (a self-hosted proxy hop) override.
516
+ */
517
+ protected handleSocketClose(): void;
518
+ /**
519
+ * Creation seam for the mic-capture pipeline at the provider's rate. Production delegates
520
+ * to the shared {@link createPcmMicCapture}; unit tests override this with a no-op fake
521
+ * (and may capture `onPcmChunk` to simulate mic frames).
522
+ */
523
+ protected createMicCapture(micStream: MediaStream, sampleRate: number, onPcmChunk: (base64Pcm16: string) => void): Promise<IPcmMicCapture>;
524
+ /** Creation seam for the playout engine. Production returns the shared {@link RealtimePcmPlayback}. */
525
+ protected createPlayback(sampleRate: number): IRealtimePcmPlayback;
526
+ }
527
+ //# sourceMappingURL=openAIProtocolClient.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"openAIProtocolClient.d.ts","sourceRoot":"","sources":["../../src/generic/openAIProtocolClient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,2BAA2B,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC7E,OAAO,EAAE,kBAAkB,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAE/E,OAAO,EAAE,oBAAoB,EAAuB,MAAM,sBAAsB,CAAC;AAEjF,OAAO,EAAuB,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAO1E,yFAAyF;AACzF,MAAM,WAAW,0BAA0B;IACvC,IAAI,EAAE,wCAAwC,GAAG,iCAAiC,CAAC;IACnF,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,qEAAqE;AACrE,MAAM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