@memberjunction/ai-realtime-client 5.47.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.
@@ -6,7 +6,8 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
6
6
  };
7
7
  import { RegisterClass } from '@memberjunction/global';
8
8
  import { RealtimeAudioMeter } from '../audio/audioMeter.js';
9
- import { BaseRealtimeClient, } from '../generic/baseRealtimeClient.js';
9
+ import { BaseRealtimeClient } from '../generic/baseRealtimeClient.js';
10
+ import { OpenAIProtocolRealtimeClient, } from '../generic/openAIProtocolClient.js';
10
11
  /**
11
12
  * OpenAI implementation of {@link BaseRealtimeClient}: a **browser-direct** WebRTC
12
13
  * connection to OpenAI's Realtime API, authenticated with the server-minted ephemeral
@@ -16,19 +17,17 @@ import { BaseRealtimeClient, } from '../generic/baseRealtimeClient.js';
16
17
  * server's `OpenAIRealtime` driver stamps on its `ClientRealtimeSessionConfig` — so hosts
17
18
  * resolve it without referencing this class directly.
18
19
  *
19
- * Owns ALL OpenAI wire concerns extracted from the original voice-session orchestration:
20
- * - WebRTC connect: mic tracks → peer connection, remote audio → hidden `<audio>` sink,
21
- * the `'oai-events'` data channel, and the GA SDP handshake (see {@link performSdpHandshake}).
22
- * - Event translation: GA + beta transcript event names, input transcription, tool calls,
23
- * barge-in, playback-buffer events, and provider error frames.
24
- * - The response state machine: `responseActive` set on `response.created` / cleared on
25
- * `response.done`; tool-result `response.create`s queued while a response is in flight
26
- * and flushed on `response.done` so the model ALWAYS voices delegated results.
27
- * - Narration-kind tagging: {@link RequestSpokenUpdate} marks the NEXT response as
28
- * `'narration'` so its transcripts are emitted with `Kind: 'narration'` (ephemeral).
29
- * - Audible-playback tracking ({@link IsAudioPlaying}) from `output_audio_buffer.*` events.
20
+ * The OpenAI-protocol brain (event translation, response state machine, narration-kind
21
+ * tagging, tool-result queueing, the outbound actions) lives in the shared
22
+ * {@link OpenAIProtocolRealtimeClient}; this class owns only the WebRTC transport:
23
+ * - Connect: mic tracks → peer connection, remote audio → hidden `<audio>` sink, the
24
+ * `'oai-events'` data channel, and the GA SDP handshake (see {@link performSdpHandshake}).
25
+ * - Audible-playback tracking ({@link IsAudioPlaying}) from the provider-managed
26
+ * `output_audio_buffer.*` events (this transport does NOT own playback — the peer
27
+ * connection plays the remote track).
28
+ * - The remote-stream APIs a host uses to mix the agent's voice into a recording.
30
29
  */
31
- let OpenAIRealtimeClient = class OpenAIRealtimeClient extends BaseRealtimeClient {
30
+ let OpenAIRealtimeClient = class OpenAIRealtimeClient extends OpenAIProtocolRealtimeClient {
32
31
  constructor() {
33
32
  super(...arguments);
34
33
  // ── Transport ──────────────────────────────────────────────────────────────
@@ -36,7 +35,6 @@ let OpenAIRealtimeClient = class OpenAIRealtimeClient extends BaseRealtimeClient
36
35
  /** Protected so test subclasses can inspect/inject; production code treats it as private. */
37
36
  this.dataChannel = null;
38
37
  this.remoteAudioEl = null;
39
- this.micStream = null;
40
38
  /**
41
39
  * The AGENT's remote-audio stream, captured from the peer connection's `ontrack` event
42
40
  * (see {@link attachRemoteAudio}). Exposed via {@link GetRemoteMediaStream} so a host can
@@ -50,42 +48,12 @@ let OpenAIRealtimeClient = class OpenAIRealtimeClient extends BaseRealtimeClient
50
48
  * channel opens. Protected so test subclasses can seed it without a full Connect.
51
49
  */
52
50
  this.sessionConfig = null;
53
- // ── Response state machine ─────────────────────────────────────────────────
54
- /** Accumulates the in-flight assistant transcript across delta frames. */
55
- this.pendingAssistantText = '';
56
- /** True while the model has a response in flight; gates narration + queues the tool result. */
57
- this.responseActive = false;
58
- /** Set when a tool result is ready while a response is active; sent on the next response.done. */
59
- this.pendingResultResponse = false;
60
- /**
61
- * Set by {@link RequestSpokenUpdate} just before it sends its `response.create`, and
62
- * CONSUMED by the very next `response.created` frame, which stamps
63
- * {@link activeResponseKind} for that turn. Narration is only requested while the model
64
- * is idle (hosts gate on {@link IsBusy}), so under normal ordering the next
65
- * `response.created` is ours.
66
- */
67
- this.pendingNarrationKind = false;
68
- /**
69
- * The kind of the response currently in flight. Event ordering (confirmed against the
70
- * live API): `response.created` → transcript deltas → `*_audio_transcript.done` →
71
- * `response.done`. The transcript-done frame therefore arrives while the kind is still
72
- * set, letting {@link onAssistantDone} classify the turn; `response.done` then resets
73
- * the kind to `'normal'`.
74
- */
75
- this.activeResponseKind = 'normal';
76
51
  /**
77
52
  * True while the model's audio is audibly PLAYING in the browser (WebRTC
78
- * `output_audio_buffer` started/stopped). Distinct from {@link responseActive} —
53
+ * `output_audio_buffer` started/stopped). Distinct from `responseActive` —
79
54
  * generation finishes ahead of playback.
80
55
  */
81
56
  this.audioPlaying = false;
82
- /**
83
- * The client's own view of the session state — mirrors what {@link emitStateChange}
84
- * last reported, EXCEPT after a tool call is emitted: the host typically shows its own
85
- * busy state then, so the client silently leaves `'speaking'` (no emission) to preserve
86
- * the host's indicator until the result reply starts (see {@link handleEvent}).
87
- */
88
- this.currentState = 'closed';
89
57
  }
90
58
  // ── BaseRealtimeClient: connection lifecycle ───────────────────────────────
91
59
  /**
@@ -138,157 +106,49 @@ let OpenAIRealtimeClient = class OpenAIRealtimeClient extends BaseRealtimeClient
138
106
  this.remoteAudioEl = null;
139
107
  }
140
108
  this.remoteStream = null;
109
+ // Session-scoped host handlers must not survive into a later Connect on a reused instance.
110
+ this.remoteStreamHandlers = [];
141
111
  this.sessionConfig = null;
142
112
  this.resetResponseState();
113
+ this.audioPlaying = false;
143
114
  if (this.currentState !== 'error') {
144
115
  this.setState('closed');
145
116
  }
146
117
  }
147
- // ── BaseRealtimeClient: outbound actions ──────────────────────────────────
148
- /**
149
- * Injects typed text as a user-role `message` conversation item, then triggers a reply
150
- * through the SAME collision-safe path tool results use ({@link requestResultResponse}).
151
- * No-op when the data channel isn't open.
152
- *
153
- * **SendText implies barge-in** (base-contract rule): an active spoken response is
154
- * cancelled via {@link CancelActiveResponse} before the text is injected, so the typed
155
- * turn takes the floor immediately instead of waiting behind stale speech. When nothing
156
- * is active the cancel is a no-op and the reply triggers immediately.
157
- */
158
- SendText(text) {
159
- const channel = this.dataChannel;
160
- if (!channel || channel.readyState !== 'open') {
161
- return;
162
- }
163
- this.CancelActiveResponse();
164
- this.sendEvent(channel, {
165
- type: 'conversation.item.create',
166
- item: {
167
- type: 'message',
168
- role: 'user',
169
- content: [{ type: 'input_text', text }],
170
- },
171
- });
172
- this.requestResultResponse();
118
+ // ── Brain seam implementations (WebRTC transport) ──────────────────────────
119
+ /** @inheritdoc — events flow over the `'oai-events'` data channel once it is open. */
120
+ canSendEvents() {
121
+ return this.dataChannel !== null && this.dataChannel.readyState === 'open';
122
+ }
123
+ /** @inheritdoc */
124
+ sendProtocolEvent(event) {
125
+ this.dataChannel?.send(JSON.stringify(event));
173
126
  }
174
127
  /**
175
128
  * @inheritdoc
176
129
  *
177
- * Sends `response.cancel` (only when a response is actually in flight) and — when audio
178
- * is audibly playing — the WebRTC-only `output_audio_buffer.clear` client event so
179
- * already-generated speech stops coming out of the speaker immediately. Resets the local
180
- * response state machine (active flag, narration kind, accumulated transcript) but
181
- * PRESERVES any queued tool-result trigger: delegated work is never affected by a
182
- * floor-control cancel, and the queued trigger still fires on the cancelled response's
183
- * trailing `response.done`. No-op when idle or when the channel is not open.
130
+ * This transport does NOT own playback (the peer connection plays the remote track), so a
131
+ * cancel asks the provider to stop + clear its managed output buffer via the WebRTC-only
132
+ * `output_audio_buffer.clear` client event — sent only when audio is audibly playing.
184
133
  */
185
- CancelActiveResponse() {
186
- const channel = this.dataChannel;
187
- if (!channel || channel.readyState !== 'open') {
188
- return;
189
- }
190
- if (!this.responseActive && !this.audioPlaying) {
191
- return; // nothing active — no-op by contract
192
- }
193
- if (this.responseActive) {
194
- this.sendEvent(channel, { type: 'response.cancel' });
195
- this.responseActive = false;
196
- this.pendingNarrationKind = false;
197
- this.activeResponseKind = 'normal';
198
- this.pendingAssistantText = '';
199
- }
134
+ stopAudioOutput() {
200
135
  if (this.audioPlaying) {
201
- this.sendEvent(channel, { type: 'output_audio_buffer.clear' });
136
+ this.sendEvent({ type: 'output_audio_buffer.clear' });
202
137
  this.audioPlaying = false;
203
138
  }
204
- if (this.currentState === 'speaking') {
205
- this.setState('listening');
206
- }
207
139
  }
208
- /**
209
- * Injects a system-role context item the model can draw on the next time it speaks,
210
- * WITHOUT forcing a reply.
211
- *
212
- * NOTE: role must be 'system' — gpt-realtime rejects 'developer' items
213
- * ("Developer messages are only supported for quicksilver sessions").
214
- */
215
- SendContextNote(text) {
216
- const channel = this.dataChannel;
217
- if (!channel) {
218
- return;
219
- }
220
- this.sendEvent(channel, {
221
- type: 'conversation.item.create',
222
- item: {
223
- type: 'message',
224
- role: 'system',
225
- content: [{ type: 'input_text', text }],
226
- },
227
- });
228
- }
229
- /**
230
- * Triggers ONE short spoken update with the given instructions. Marks the upcoming
231
- * response as `'narration'` (flag consumed by the next `response.created`) so its
232
- * transcripts are emitted with `Kind: 'narration'` — ephemeral by contract. Sets
233
- * {@link responseActive} eagerly so a tool result landing mid-narration queues
234
- * instead of colliding.
235
- *
236
- * **Skips when busy** (base-contract collision rule — drivers MUST queue or skip):
237
- * a `response.create` sent while a response is in flight would be rejected/garbled by
238
- * the provider, and narration is disposable by contract, so the update is dropped with
239
- * a debug log rather than queued to come out late and stale. Hosts SHOULD still gate
240
- * on {@link IsBusy} / {@link IsAudioPlaying} for timing quality.
241
- */
242
- RequestSpokenUpdate(instructions) {
243
- const channel = this.dataChannel;
244
- if (!channel) {
245
- return;
246
- }
247
- if (this.responseActive) {
248
- console.debug('[OpenAIRealtimeClient] RequestSpokenUpdate skipped — a response is already in flight (narration is disposable).');
249
- return;
250
- }
251
- this.responseActive = true;
252
- this.pendingNarrationKind = true;
253
- this.sendEvent(channel, {
254
- type: 'response.create',
255
- response: { instructions },
256
- });
257
- }
258
- /**
259
- * Sends the tool result back as a `function_call_output` conversation item, then
260
- * triggers a reply — immediately if the model is idle, otherwise queued until the
261
- * current response (e.g. a progress narration) finishes. Without the queueing the
262
- * result's `response.create` would collide with an in-flight narration and be dropped,
263
- * leaving the model silent when delegated work comes back.
264
- */
265
- SendToolResult(callID, outputJson) {
266
- const channel = this.dataChannel;
267
- if (!channel) {
268
- return;
269
- }
270
- this.sendEvent(channel, {
271
- type: 'conversation.item.create',
272
- item: {
273
- type: 'function_call_output',
274
- call_id: callID,
275
- output: outputJson,
276
- },
277
- });
278
- this.requestResultResponse();
140
+ /** @inheritdoc — provider-managed playback started. */
141
+ onOutputAudioBufferStarted() {
142
+ this.audioPlaying = true;
279
143
  }
280
- /** Mute / unmute by toggling the mic tracks' `enabled` flag (transport stays up). */
281
- SetMuted(muted) {
282
- const tracks = this.micStream?.getAudioTracks() ?? [];
283
- for (const t of tracks) {
284
- t.enabled = !muted;
144
+ /** @inheritdoc — provider-managed playback stopped/cleared. */
145
+ onOutputAudioBufferStopped() {
146
+ this.audioPlaying = false;
147
+ if (this.currentState === 'speaking' && !this.responseActive) {
148
+ this.setState('listening');
285
149
  }
286
150
  }
287
151
  /** @inheritdoc */
288
- get IsBusy() {
289
- return this.responseActive;
290
- }
291
- /** @inheritdoc */
292
152
  get IsAudioPlaying() {
293
153
  return this.audioPlaying;
294
154
  }
@@ -394,8 +254,9 @@ let OpenAIRealtimeClient = class OpenAIRealtimeClient extends BaseRealtimeClient
394
254
  }
395
255
  /**
396
256
  * Adopts + wires the events data channel: applies the session config and reports
397
- * `'listening'` on open; translates inbound frames; reports transport errors / closure.
398
- * Protected so test subclasses can inject a fake channel directly.
257
+ * `'listening'` on open; translates inbound frames through the shared protocol brain;
258
+ * reports transport errors / closure. Protected so test subclasses can inject a fake
259
+ * channel directly.
399
260
  */
400
261
  adoptDataChannel(channel) {
401
262
  this.dataChannel = channel;
@@ -404,7 +265,7 @@ let OpenAIRealtimeClient = class OpenAIRealtimeClient extends BaseRealtimeClient
404
265
  this.setState('listening');
405
266
  };
406
267
  channel.onmessage = (e) => {
407
- this.handleChannelMessage(e);
268
+ this.handleProtocolMessage(String(e.data));
408
269
  };
409
270
  channel.onerror = (e) => {
410
271
  this.emitError({ Message: `Data channel error: ${String(e)}`, Fatal: true });
@@ -433,206 +294,8 @@ let OpenAIRealtimeClient = class OpenAIRealtimeClient extends BaseRealtimeClient
433
294
  if (!this.sessionConfig || Object.keys(this.sessionConfig).length === 0) {
434
295
  return;
435
296
  }
436
- this.sendEvent(channel, { type: 'session.update', session: this.sessionConfig });
437
- }
438
- // ── Inbound event translation ──────────────────────────────────────────────
439
- /** Parses an inbound channel message and dispatches it to the typed handler. */
440
- handleChannelMessage(e) {
441
- let event;
442
- try {
443
- event = JSON.parse(e.data);
444
- }
445
- catch {
446
- return; // non-JSON frame — ignore
447
- }
448
- if (event === null || typeof event !== 'object') {
449
- return; // valid JSON but not an event object (e.g. "null", a number) — ignore
450
- }
451
- this.handleEvent(event);
452
- }
453
- /** Dispatches a typed OpenAI realtime server event to the appropriate behavior. */
454
- handleEvent(event) {
455
- switch (event.type) {
456
- case 'response.output_audio_transcript.delta':
457
- case 'response.audio_transcript.delta':
458
- this.onAssistantDelta(event.delta);
459
- break;
460
- case 'response.output_audio_transcript.done':
461
- case 'response.audio_transcript.done':
462
- this.onAssistantDone(event.transcript);
463
- break;
464
- case 'conversation.item.input_audio_transcription.completed':
465
- this.onUserTranscript(event.transcript);
466
- break;
467
- case 'response.function_call_arguments.done':
468
- this.onToolCallFrame(event);
469
- break;
470
- case 'input_audio_buffer.speech_started':
471
- // The user started speaking. This is a TRUE barge-in only when it cut off
472
- // active model output (a response in flight or audio audibly playing) —
473
- // a normal turn while the model is idle is NOT an interruption, so the
474
- // emission is gated (base-contract rule). The provider handles cancelling
475
- // its own turn; we reflect that the user has the floor again. NOTE: the
476
- // trailing `output_audio_buffer.cleared` frame deliberately does NOT emit —
477
- // it also follows our own CancelActiveResponse, and a self-initiated cancel
478
- // must never look like a user barge-in (hosts abort delegated work on it).
479
- if (this.responseActive || this.audioPlaying) {
480
- this.emitInterruption();
481
- }
482
- this.setState('listening');
483
- break;
484
- case 'response.created':
485
- this.responseActive = true;
486
- // Stamp the kind of THIS response: 'narration' only when the flag was set by
487
- // RequestSpokenUpdate immediately before its response.create (consumed here).
488
- this.activeResponseKind = this.pendingNarrationKind ? 'narration' : 'normal';
489
- this.pendingNarrationKind = false;
490
- break;
491
- case 'output_audio_buffer.started':
492
- this.audioPlaying = true;
493
- break;
494
- case 'output_audio_buffer.stopped':
495
- case 'output_audio_buffer.cleared':
496
- this.audioPlaying = false;
497
- if (this.currentState === 'speaking' && !this.responseActive) {
498
- this.setState('listening');
499
- }
500
- break;
501
- case 'response.done':
502
- // A turn finished — release the lock and speak any queued tool result so the
503
- // model always voices the answer when delegated work comes back.
504
- // The transcript-done frame for this turn has already arrived (it precedes
505
- // response.done), so it's safe to reset the response kind here.
506
- this.responseActive = false;
507
- this.activeResponseKind = 'normal';
508
- this.emitResponseUsage(event);
509
- this.flushPendingResultResponse();
510
- if (this.currentState === 'speaking') {
511
- this.setState('listening');
512
- }
513
- break;
514
- case 'error':
515
- this.onErrorFrame(event);
516
- break;
517
- default:
518
- // Unhandled event types are expected (the provider emits many); no-op.
519
- break;
520
- }
521
- }
522
- /** Appends an assistant transcript delta, reflects `'speaking'`, and emits the delta. */
523
- onAssistantDelta(delta) {
524
- if (this.currentState !== 'speaking') {
525
- this.setState('speaking');
526
- }
527
- this.pendingAssistantText += delta;
528
- this.emitTranscript({ Role: 'Assistant', Text: delta, IsFinal: false, Kind: this.activeResponseKind });
529
- }
530
- /**
531
- * Finalizes the assistant turn: emits the final transcript tagged with the ACTIVE
532
- * response kind (the transcript-done frame arrives BEFORE `response.done`, so
533
- * {@link activeResponseKind} still reflects this turn), then returns to `'listening'`.
534
- * Empty turns emit nothing.
535
- */
536
- onAssistantDone(transcript) {
537
- const finalText = transcript || this.pendingAssistantText;
538
- this.pendingAssistantText = '';
539
- if (finalText.trim().length > 0) {
540
- this.emitTranscript({ Role: 'Assistant', Text: finalText, IsFinal: true, Kind: this.activeResponseKind });
541
- }
542
- if (this.currentState === 'speaking') {
543
- this.setState('listening');
544
- }
545
- }
546
- /** Emits the final transcription of the user's spoken input (always `Kind: 'normal'`). */
547
- onUserTranscript(transcript) {
548
- this.emitTranscript({ Role: 'User', Text: transcript, IsFinal: true, Kind: 'normal' });
549
- }
550
- /**
551
- * Surfaces a completed tool call to the host. The client silently leaves the
552
- * `'speaking'` state (NO emission) so a host-rendered busy indicator (e.g. "thinking")
553
- * isn't clobbered by this turn's trailing `response.done` / playback-stopped frames —
554
- * those only transition when the client still considers itself `'speaking'`.
555
- */
556
- onToolCallFrame(call) {
557
- if (this.currentState === 'speaking') {
558
- this.currentState = 'connected';
559
- }
560
- this.emitToolCall({ CallID: call.call_id, ToolName: call.name, ArgumentsJson: call.arguments });
561
- }
562
- /**
563
- * Emits the completed response's usage to the host as a DELTA (the GA `response.done`
564
- * usage payload covers exactly this response, so it is already incremental — the
565
- * `OnUsage` contract's preferred shape). Frames without a usage payload emit nothing.
566
- */
567
- emitResponseUsage(event) {
568
- const usage = event.response?.usage;
569
- if (!usage) {
570
- return;
571
- }
572
- this.emitUsage({
573
- InputTokens: typeof usage.input_tokens === 'number' ? usage.input_tokens : undefined,
574
- OutputTokens: typeof usage.output_tokens === 'number' ? usage.output_tokens : undefined,
575
- Raw: usage,
576
- });
577
- }
578
- /** Surfaces a provider error frame (non-fatal; the session continues). */
579
- onErrorFrame(event) {
580
- this.emitError({
581
- Message: event.error?.message ?? 'Unknown provider error',
582
- Code: event.error?.code,
583
- Fatal: false,
584
- });
585
- }
586
- // ── Response state machine ─────────────────────────────────────────────────
587
- /**
588
- * Asks the model to speak (a tool result or typed-text reply) — immediately if it's
589
- * idle, otherwise queued until the current response finishes. An immediate trigger
590
- * also CONSUMES any queued trigger debt: every payload item is already in the
591
- * conversation, so one `response.create` voices everything (e.g. typed text barging
592
- * in over a narration that had tool results queued behind it).
593
- */
594
- requestResultResponse() {
595
- if (!this.dataChannel) {
596
- return;
597
- }
598
- if (this.responseActive) {
599
- this.pendingResultResponse = true;
600
- return;
601
- }
602
- this.pendingResultResponse = false;
603
- this.responseActive = true;
604
- this.sendEvent(this.dataChannel, { type: 'response.create' });
605
- this.setState('speaking');
606
- }
607
- /** On a turn completing, fire any queued tool-result response so the answer is spoken. */
608
- flushPendingResultResponse() {
609
- if (!this.pendingResultResponse || !this.dataChannel) {
610
- return;
611
- }
612
- this.pendingResultResponse = false;
613
- this.responseActive = true;
614
- this.sendEvent(this.dataChannel, { type: 'response.create' });
615
- this.setState('speaking');
616
- }
617
- /** Resets the per-session response state machine (used on Disconnect). */
618
- resetResponseState() {
619
- this.pendingAssistantText = '';
620
- this.responseActive = false;
621
- this.pendingResultResponse = false;
622
- this.pendingNarrationKind = false;
623
- this.activeResponseKind = 'normal';
624
- this.audioPlaying = false;
625
- }
626
- // ── Helpers ────────────────────────────────────────────────────────────────
627
- /** Updates the client's own state view and emits the change to the host. */
628
- setState(state) {
629
- this.currentState = state;
630
- this.emitStateChange(state);
631
- }
632
- /** Serializes + sends a client event over the data channel (only when open). */
633
- sendEvent(channel, event) {
634
297
  if (channel.readyState === 'open') {
635
- channel.send(JSON.stringify(event));
298
+ channel.send(JSON.stringify({ type: 'session.update', session: this.sessionConfig }));
636
299
  }
637
300
  }
638
301
  };
@@ -1 +1 @@
1
- {"version":3,"file":"openAIRealtimeClient.js","sourceRoot":"","sources":["../../src/drivers/openAIRealtimeClient.ts"],"names":[],"mappings":";;;;;;AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AACzD,OAAO,EACH,kBAAkB,GAErB,MAAM,+BAA+B,CAAC;AA4LvC;;;;;;;;;;;;;;;;;;;;GAoBG;AAEI,IAAM,oBAAoB,GAA1B,MAAM,oBAAqB,SAAQ,kBAAkB;IAArD;;QACH,8EAA8E;QACtE,mBAAc,GAAmC,IAAI,CAAC;QAC9D,6FAA6F;QACnF,gBAAW,GAAgC,IAAI,CAAC;QA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