@memberjunction/ng-conversations 6.1.1 → 6.1.2

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.
Files changed (29) hide show
  1. package/dist/lib/components/realtime/channels/base-realtime-channel-client.d.ts +36 -1
  2. package/dist/lib/components/realtime/channels/base-realtime-channel-client.d.ts.map +1 -1
  3. package/dist/lib/components/realtime/channels/base-realtime-channel-client.js +23 -0
  4. package/dist/lib/components/realtime/channels/base-realtime-channel-client.js.map +1 -1
  5. package/dist/lib/components/realtime/realtime-activity-rail.component.d.ts +1 -1
  6. package/dist/lib/components/realtime/realtime-activity-rail.component.d.ts.map +1 -1
  7. package/dist/lib/components/realtime/realtime-activity-rail.component.js +2 -2
  8. package/dist/lib/components/realtime/realtime-activity-rail.component.js.map +1 -1
  9. package/dist/lib/components/realtime/realtime-delegation-card.component.d.ts +2 -2
  10. package/dist/lib/components/realtime/realtime-delegation-card.component.d.ts.map +1 -1
  11. package/dist/lib/components/realtime/realtime-delegation-card.component.js +104 -72
  12. package/dist/lib/components/realtime/realtime-delegation-card.component.js.map +1 -1
  13. package/dist/lib/components/realtime/realtime-session-state.d.ts +11 -4
  14. package/dist/lib/components/realtime/realtime-session-state.d.ts.map +1 -1
  15. package/dist/lib/components/realtime/realtime-session-state.js +43 -1
  16. package/dist/lib/components/realtime/realtime-session-state.js.map +1 -1
  17. package/dist/lib/components/realtime/remote-browser/remote-browser-channel.d.ts +58 -2
  18. package/dist/lib/components/realtime/remote-browser/remote-browser-channel.d.ts.map +1 -1
  19. package/dist/lib/components/realtime/remote-browser/remote-browser-channel.js +154 -4
  20. package/dist/lib/components/realtime/remote-browser/remote-browser-channel.js.map +1 -1
  21. package/dist/lib/components/realtime/whiteboard/whiteboard-channel.d.ts +51 -2
  22. package/dist/lib/components/realtime/whiteboard/whiteboard-channel.d.ts.map +1 -1
  23. package/dist/lib/components/realtime/whiteboard/whiteboard-channel.js +285 -5
  24. package/dist/lib/components/realtime/whiteboard/whiteboard-channel.js.map +1 -1
  25. package/dist/lib/services/realtime-session.service.d.ts +39 -4
  26. package/dist/lib/services/realtime-session.service.d.ts.map +1 -1
  27. package/dist/lib/services/realtime-session.service.js +128 -8
  28. package/dist/lib/services/realtime-session.service.js.map +1 -1
  29. package/package.json +31 -31
@@ -4,9 +4,102 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key,
4
4
  else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
5
5
  return c > 3 && r && Object.defineProperty(target, key, r), r;
6
6
  };
7
+ var RealtimeWhiteboardChannel_1;
7
8
  import { RegisterClass } from '@memberjunction/global';
9
+ import { CHANNEL_INBOUND_VIDEO_TRACK } from '@memberjunction/ai';
10
+ import { ChannelInboundVideoBridge } from '@memberjunction/ai-realtime-client';
8
11
  import { BaseRealtimeChannelClient } from '../channels/base-realtime-channel-client';
9
- import { ApplyWhiteboardAgentTool, RealtimeWhiteboardHostComponent, WHITEBOARD_TOOL_DEFINITIONS, WHITEBOARD_TOOL_PREFIX, WhiteboardState } from '@memberjunction/ng-whiteboard';
12
+ import { ApplyWhiteboardAgentTool, BuildWhiteboardExportSvg, RealtimeWhiteboardHostComponent, WHITEBOARD_TOOL_DEFINITIONS, WHITEBOARD_TOOL_PREFIX, WhiteboardState } from '@memberjunction/ng-whiteboard';
13
+ /**
14
+ * Whether a whiteboard tool result reports success.
15
+ *
16
+ * `ApplyWhiteboardAgentTool` returns a JSON `WhiteboardToolResult` string — `{ success: true, … }`
17
+ * or `{ success: false, error }` — for every tool and every failure path. Anything that does not
18
+ * parse as an object with `success === true` is treated as NOT a successful mutation, which is the
19
+ * safe direction: the cost of missing a confirmation frame is one stale picture until the next
20
+ * change, while the cost of a false one is telling the model an edit landed when it did not.
21
+ */
22
+ function toolSucceeded(result) {
23
+ try {
24
+ const parsed = JSON.parse(result);
25
+ return parsed !== null && typeof parsed === 'object' && parsed.success === true;
26
+ }
27
+ catch {
28
+ // A non-JSON result cannot be confirmed as a mutation — the host returned something this
29
+ // channel does not understand, so it does not get a "your change is on screen" note.
30
+ return false;
31
+ }
32
+ }
33
+ /**
34
+ * Asynchronously rasterizes an SVG string to a JPEG base64 string (without the `data:image/jpeg;base64,` prefix)
35
+ * using an offscreen canvas. Returns null in non-DOM environments or when rendering fails.
36
+ */
37
+ export async function rasterizeSvgToJpegBase64(svg, width = 1280, height = 720) {
38
+ if (typeof document === 'undefined' || typeof Image === 'undefined') {
39
+ return null;
40
+ }
41
+ return new Promise((resolve) => {
42
+ let url = null;
43
+ let timer = null;
44
+ const cleanup = () => {
45
+ if (timer != null) {
46
+ clearTimeout(timer);
47
+ timer = null;
48
+ }
49
+ if (url) {
50
+ URL.revokeObjectURL(url);
51
+ url = null;
52
+ }
53
+ };
54
+ try {
55
+ const img = new Image();
56
+ const svgBlob = new Blob([svg], { type: 'image/svg+xml;charset=utf-8' });
57
+ url = URL.createObjectURL(svgBlob);
58
+ // Capped wait: resolve null and revoke URL if the Image never fires onload or onerror (item 61)
59
+ timer = setTimeout(() => {
60
+ console.error('[RealtimeWhiteboardChannel] SVG rasterization timed out after 5000ms');
61
+ cleanup();
62
+ resolve(null);
63
+ }, 5000);
64
+ img.onload = () => {
65
+ try {
66
+ const canvas = document.createElement('canvas');
67
+ canvas.width = width;
68
+ canvas.height = height;
69
+ const ctx = canvas.getContext('2d');
70
+ if (!ctx) {
71
+ cleanup();
72
+ resolve(null);
73
+ return;
74
+ }
75
+ ctx.fillStyle = '#ffffff';
76
+ ctx.fillRect(0, 0, width, height);
77
+ ctx.drawImage(img, 0, 0, width, height);
78
+ cleanup();
79
+ const dataUrl = canvas.toDataURL('image/jpeg', 0.85);
80
+ const comma = dataUrl.indexOf(',');
81
+ resolve(comma >= 0 ? dataUrl.slice(comma + 1) : dataUrl);
82
+ }
83
+ catch (err) {
84
+ console.error('[RealtimeWhiteboardChannel] Failed to rasterize SVG canvas to JPEG:', err);
85
+ cleanup();
86
+ resolve(null);
87
+ }
88
+ };
89
+ img.onerror = (err) => {
90
+ console.error('[RealtimeWhiteboardChannel] Failed to load SVG image for rasterization:', err);
91
+ cleanup();
92
+ resolve(null);
93
+ };
94
+ img.src = url;
95
+ }
96
+ catch (err) {
97
+ console.error('[RealtimeWhiteboardChannel] Failed to initialize SVG rasterization:', err);
98
+ cleanup();
99
+ resolve(null);
100
+ }
101
+ });
102
+ }
10
103
  /**
11
104
  * Per-widget throttle window for AMBIENT interaction context notes: at most one note per
12
105
  * widget per this many ms — within the window the LATEST summary wins (chatty widgets
@@ -44,6 +137,7 @@ export const WHITEBOARD_INTERACTION_NOTE_THROTTLE_MS = 4000;
44
137
  * incompatible payloads are tolerated — the board simply starts fresh.
45
138
  */
46
139
  let RealtimeWhiteboardChannel = class RealtimeWhiteboardChannel extends BaseRealtimeChannelClient {
140
+ static { RealtimeWhiteboardChannel_1 = this; }
47
141
  /** The board's state of record — created fresh with the plugin (one per session). */
48
142
  State = new WhiteboardState();
49
143
  /** The live bound surface, when the channel tab's pane is instantiated. */
@@ -54,9 +148,157 @@ let RealtimeWhiteboardChannel = class RealtimeWhiteboardChannel extends BaseReal
54
148
  stateChangedSub = null;
55
149
  /** Per-widget ambient-interaction note throttles (ItemID → window state). */
56
150
  interactionThrottles = new Map();
151
+ /** Shared video bridge streaming board frames to the model when the model supports inbound video. */
152
+ videoBridge = null;
153
+ /** Pacing timestamp for event-driven visual scene pushes (enforces max 1 fps). */
154
+ lastPushTimestamp = 0;
57
155
  get ChannelName() {
58
156
  return 'Whiteboard';
59
157
  }
158
+ /**
159
+ * Sourced tracks: Whiteboard can source inbound video to the model when the model supports it.
160
+ */
161
+ GetSourcedTracks() {
162
+ return [CHANNEL_INBOUND_VIDEO_TRACK];
163
+ }
164
+ /**
165
+ * Produces the latest visual scene as a base64-encoded frame for the video bridge.
166
+ * Renders the whiteboard SVG into an offscreen canvas and returns base64 JPEG.
167
+ */
168
+ async GetLatestFrame() {
169
+ if (!this.State) {
170
+ return null;
171
+ }
172
+ try {
173
+ const svg = BuildWhiteboardExportSvg(this.State);
174
+ return await rasterizeSvgToJpegBase64(svg);
175
+ }
176
+ catch (err) {
177
+ console.error('[RealtimeWhiteboardChannel] Failed to export whiteboard frame:', err);
178
+ return null;
179
+ }
180
+ }
181
+ static WHITEBOARD_DEFAULT_CADENCE_MS = 1000;
182
+ static WHITEBOARD_MIN_CADENCE_MS = 250;
183
+ // NO liveness heartbeat here, deliberately. This channel is 100% CHANGE-DRIVEN: the only thing
184
+ // that pushes a frame is a board mutation. A periodic keep-alive would have to be driven by its
185
+ // own always-on interval — this channel does no work at all while the board is idle, and
186
+ // resurrecting it every 15 seconds to re-send an unchanged picture is a cost with no shown
187
+ // benefit. (It also cannot be smuggled in via the mutation path: a 15s elapsed-check inside
188
+ // onUserMutation only runs when a mutation arrives, so on an idle board it is never evaluated —
189
+ // which is exactly what the constant this replaced did.) If the inbound video track ever needs
190
+ // keep-alive frames, that belongs on the track or the bridge, once, not per channel.
191
+ /** Trailing timer to deliver the settled resting frame after rapid user drawing/edits. */
192
+ whiteboardTrailingTimer = null;
193
+ /** Last base64 JPEG frame pushed to the bridge, used for deduplication. */
194
+ lastPushedWhiteboardFrame = null;
195
+ /** Cancels any active trailing-edge settle timer and clears the handle. */
196
+ clearWhiteboardTrailingTimer() {
197
+ if (this.whiteboardTrailingTimer != null) {
198
+ clearTimeout(this.whiteboardTrailingTimer);
199
+ this.whiteboardTrailingTimer = null;
200
+ }
201
+ }
202
+ /**
203
+ * Resolves the effective push cadence in milliseconds based on the negotiated inbound video track.
204
+ * Defaults to 1000ms (1 fps ceiling for Gemini Live), but clamps down to a minimum of 250ms (4 fps)
205
+ * if the negotiated track specifies a higher `Rate`.
206
+ */
207
+ getNegotiatedVideoCadenceMs() {
208
+ const client = this.Context?.Client;
209
+ if (!client) {
210
+ return RealtimeWhiteboardChannel_1.WHITEBOARD_DEFAULT_CADENCE_MS;
211
+ }
212
+ const tracks = client.EstablishedTracks;
213
+ const videoTrack = tracks?.find((t) => t.Descriptor.Modality === 'video' &&
214
+ t.Descriptor.Direction === 'inbound');
215
+ const rate = videoTrack?.Descriptor.Rate;
216
+ if (typeof rate === 'number' && rate > 0) {
217
+ return Math.max(RealtimeWhiteboardChannel_1.WHITEBOARD_MIN_CADENCE_MS, Math.floor(1000 / rate));
218
+ }
219
+ return RealtimeWhiteboardChannel_1.WHITEBOARD_DEFAULT_CADENCE_MS;
220
+ }
221
+ /**
222
+ * Pushes a frame to the video bridge, updating timestamp and deduplication cache.
223
+ */
224
+ pushWhiteboardFrame(frame) {
225
+ this.lastPushTimestamp = Date.now();
226
+ this.lastPushedWhiteboardFrame = frame;
227
+ this.ensureVideoBridge()?.PushFrame(frame);
228
+ }
229
+ /**
230
+ * Pushes the latest board visual scene when user mutations occur, with dynamic pacing,
231
+ * deduplication, and a trailing-edge settle timer so the model sees the final resting state.
232
+ */
233
+ async onUserMutation() {
234
+ try {
235
+ const bridge = this.ensureVideoBridge();
236
+ if (!bridge || !this.Context?.Client?.IsTrackEstablished('video', 'inbound')) {
237
+ return;
238
+ }
239
+ const now = Date.now();
240
+ const cadenceMs = this.getNegotiatedVideoCadenceMs();
241
+ const elapsed = now - this.lastPushTimestamp;
242
+ if (elapsed >= cadenceMs) {
243
+ this.clearWhiteboardTrailingTimer();
244
+ const frame = await this.GetLatestFrame();
245
+ if (!frame) {
246
+ return;
247
+ }
248
+ if (frame !== this.lastPushedWhiteboardFrame) {
249
+ this.pushWhiteboardFrame(frame);
250
+ }
251
+ }
252
+ else {
253
+ // Within cooldown window: schedule trailing settle timer if not already armed.
254
+ if (!this.whiteboardTrailingTimer) {
255
+ const delay = Math.max(0, cadenceMs - elapsed);
256
+ this.whiteboardTrailingTimer = setTimeout(async () => {
257
+ this.whiteboardTrailingTimer = null;
258
+ try {
259
+ if (!this.Context?.Client?.IsTrackEstablished('video', 'inbound')) {
260
+ return;
261
+ }
262
+ const frame = await this.GetLatestFrame();
263
+ if (!frame) {
264
+ return;
265
+ }
266
+ if (frame !== this.lastPushedWhiteboardFrame) {
267
+ this.pushWhiteboardFrame(frame);
268
+ }
269
+ }
270
+ catch (err) {
271
+ console.error('[RealtimeWhiteboardChannel] Error in whiteboard trailing settle timer:', err);
272
+ }
273
+ }, delay);
274
+ }
275
+ }
276
+ }
277
+ catch (err) {
278
+ console.error('[RealtimeWhiteboardChannel] Error in onUserMutation:', err);
279
+ }
280
+ }
281
+ /**
282
+ * Pushes exactly ONE confirmation frame after an agent tool mutates the board, and
283
+ * informs the model context so it does not loop narrating its own change.
284
+ */
285
+ async pushAgentConfirmationFrame() {
286
+ try {
287
+ const bridge = this.ensureVideoBridge();
288
+ if (!bridge || !this.Context?.Client?.IsTrackEstablished('video', 'inbound')) {
289
+ return;
290
+ }
291
+ this.clearWhiteboardTrailingTimer();
292
+ const frame = await this.GetLatestFrame();
293
+ if (frame) {
294
+ this.pushWhiteboardFrame(frame);
295
+ this.Context?.SendContextNote('[whiteboard] visual confirmation of your action (background — do NOT narrate or announce your own change; continue naturally)');
296
+ }
297
+ }
298
+ catch (err) {
299
+ console.error('[RealtimeWhiteboardChannel] Error in pushAgentConfirmationFrame:', err);
300
+ }
301
+ }
60
302
  get ToolNamePrefix() {
61
303
  return WHITEBOARD_TOOL_PREFIX;
62
304
  }
@@ -88,9 +330,29 @@ let RealtimeWhiteboardChannel = class RealtimeWhiteboardChannel extends BaseReal
88
330
  }
89
331
  /** Persist the board (host-debounced) on EVERY board mutation — user edits AND agent tools. */
90
332
  OnInitialize() {
91
- this.stateChangedSub = this.State.Changed$.subscribe(() => {
333
+ this.stateChangedSub?.unsubscribe();
334
+ this.clearWhiteboardTrailingTimer();
335
+ this.stateChangedSub = this.State.Changed$.subscribe((change) => {
92
336
  this.Context?.RequestSave(this.State.ToJSON());
337
+ // Only user edits (and scene replacements like undo) drive the user settle-debounce pipeline.
338
+ // Agent edits are confirmed with a single frame in ApplyAgentTool.
339
+ if (change.Author === 'user' || change.Op === 'replace') {
340
+ void this.onUserMutation();
341
+ }
93
342
  });
343
+ this.ensureVideoBridge();
344
+ }
345
+ OnSessionStarted() {
346
+ this.ensureVideoBridge();
347
+ }
348
+ ensureVideoBridge() {
349
+ if (!this.videoBridge && this.Context) {
350
+ this.videoBridge = new ChannelInboundVideoBridge(() => this.Context?.Client, this);
351
+ }
352
+ if (this.videoBridge && !this.videoBridge.IsActive && this.Context?.Client?.IsTrackEstablished('video', 'inbound')) {
353
+ this.videoBridge.Start?.();
354
+ }
355
+ return this.videoBridge;
94
356
  }
95
357
  /**
96
358
  * Wires the dynamically-created board host: inputs (shared state engine + agent name)
@@ -98,6 +360,7 @@ let RealtimeWhiteboardChannel = class RealtimeWhiteboardChannel extends BaseReal
98
360
  * outputs are subscribed back into the host context — the overlay never sees any of it.
99
361
  */
100
362
  BindSurface(instance) {
363
+ this.ensureVideoBridge();
101
364
  this.releaseSurface();
102
365
  this.host = instance;
103
366
  instance.State = this.State;
@@ -215,10 +478,23 @@ let RealtimeWhiteboardChannel = class RealtimeWhiteboardChannel extends BaseReal
215
478
  * bound so the channel keeps working with the pane collapsed.
216
479
  */
217
480
  ApplyAgentTool(toolName, argsJson) {
481
+ let result;
218
482
  if (this.host) {
219
- return this.host.ApplyAgentTool(toolName, argsJson);
483
+ result = this.host.ApplyAgentTool(toolName, argsJson);
484
+ }
485
+ else {
486
+ result = ApplyWhiteboardAgentTool(this.State, toolName, argsJson);
487
+ }
488
+ // A SUCCESSFUL agent tool triggers exactly ONE immediate visual confirmation frame and a note
489
+ // telling the model not to narrate its own change. A FAILED one must trigger neither: every
490
+ // failure path returns `{ success: false, error }` (bad JSON args, unknown tool, per-tool
491
+ // validation), and confirming it would tell the model its edit landed AND instruct it to stay
492
+ // quiet about it — so the failure would vanish from the user's view while the model carried on.
493
+ // It would also push a frame identical to the last one, since a failed tool changes nothing.
494
+ if (toolSucceeded(result)) {
495
+ void this.pushAgentConfirmationFrame();
220
496
  }
221
- return ApplyWhiteboardAgentTool(this.State, toolName, argsJson);
497
+ return result;
222
498
  }
223
499
  /** The board's serialized state of record (persisted under {@link ChannelName}). */
224
500
  SerializeState() {
@@ -244,8 +520,12 @@ let RealtimeWhiteboardChannel = class RealtimeWhiteboardChannel extends BaseReal
244
520
  }
245
521
  }
246
522
  Dispose() {
523
+ this.clearWhiteboardTrailingTimer();
524
+ this.videoBridge?.Stop();
525
+ this.videoBridge = null;
247
526
  this.stateChangedSub?.unsubscribe();
248
527
  this.stateChangedSub = null;
528
+ this.lastPushedWhiteboardFrame = null;
249
529
  super.Dispose(); // releases the surface binding + context
250
530
  }
251
531
  /** Unsubscribes surface outputs, cancels pending ambient notes and drops the host reference. */
@@ -258,7 +538,7 @@ let RealtimeWhiteboardChannel = class RealtimeWhiteboardChannel extends BaseReal
258
538
  this.host = null;
259
539
  }
260
540
  };
261
- RealtimeWhiteboardChannel = __decorate([
541
+ RealtimeWhiteboardChannel = RealtimeWhiteboardChannel_1 = __decorate([
262
542
  RegisterClass(BaseRealtimeChannelClient, 'RealtimeWhiteboardChannel')
263
543
  ], RealtimeWhiteboardChannel);
264
544
  export { RealtimeWhiteboardChannel };
@@ -1 +1 @@
1
- {"version":3,"file":"whiteboard-channel.js","sourceRoot":"","sources":["../../../../../src/lib/components/realtime/whiteboard/whiteboard-channel.ts"],"names":[],"mappings":";;;;;;AAEA,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD,OAAO,EAAE,yBAAyB,EAA4B,MAAM,0CAA0C,CAAC;AAC/G,OAAO,EACL,wBAAwB,EAAE,+BAA+B,EAAE,2BAA2B,EACtF,sBAAsB,EAAE,eAAe,EACxC,MAAM,+BAA+B,CAAC;AAEvC;;;;GAIG;AACH,MAAM,CAAC,MAAM,uCAAuC,GAAG,IAAI,CAAC;AAY5D;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6BG;AAEI,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,yBAA0D;IACvG,qFAAqF;IAC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IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF,CAAA;AAjPY,yBAAyB;IADrC,aAAa,CAAC,yBAAyB,EAAE,2BAA2B,CAAC;GACzD,yBAAyB,CAiPrC;;AAED;;;;;GAKG;AACH,MAAM,UAAU,6BAA6B;IAC3C,uEAAuE;AACzE,CAAC","sourcesContent":["import type { Type } from '@angular/core';\nimport { Subscription } from 'rxjs';\nimport { RegisterClass } from '@memberjunction/global';\nimport { RealtimeToolDefinition } from '@memberjunction/ai';\nimport { BaseRealtimeChannelClient, ChannelOnboardingDetails } from '../channels/base-realtime-channel-client';\nimport {\n ApplyWhiteboardAgentTool, RealtimeWhiteboardHostComponent, WHITEBOARD_TOOL_DEFINITIONS,\n WHITEBOARD_TOOL_PREFIX, WhiteboardState, WhiteboardWidgetInteractionEvent, WhiteboardWidgetSubmitEvent\n} from '@memberjunction/ng-whiteboard';\n\n/**\n * Per-widget throttle window for AMBIENT interaction context notes: at most one note per\n * widget per this many ms — within the window the LATEST summary wins (chatty widgets\n * collapse to one trailing-edge note instead of flooding the model's context).\n */\nexport const WHITEBOARD_INTERACTION_NOTE_THROTTLE_MS = 4000;\n\n/** Per-widget ambient-note throttle bookkeeping. */\ninterface InteractionThrottleEntry {\n /** When this widget's last ambient note was sent (epoch ms). */\n LastSentAt: number;\n /** Trailing-edge timer for a deferred note, or null when the window is idle. */\n Timer: ReturnType<typeof setTimeout> | null;\n /** The latest event received within the open window (sent when the timer fires). */\n Pending: WhiteboardWidgetInteractionEvent | null;\n}\n\n/**\n * The LIVE WHITEBOARD as a pluggable interactive channel — the canonical\n * {@link BaseRealtimeChannelClient} implementation, resolved from the `MJ: AI Agent\n * Channels` registry row whose `ClientPluginClass` is `'RealtimeWhiteboardChannel'`.\n *\n * One instance per session (created via ClassFactory at session start). It owns the\n * board's {@link WhiteboardState} engine and contributes the channel's full contract:\n *\n * - **Action**: the `Whiteboard_*` client-executed tool set\n * ({@link WHITEBOARD_TOOL_DEFINITIONS}); {@link ApplyAgentTool} prefers the BOUND host\n * component (board mutation + violet pop-in / toast / presence-cursor garnish) and\n * falls back to the pure {@link ApplyWhiteboardAgentTool} engine call when no surface\n * is bound (e.g. the surface panel is collapsed) — the channel keeps working, just\n * without the garnish.\n * - **Perception**: {@link BindSurface} subscribes the host's coalesced (750 ms)\n * `SceneDelta` stream and pipes each delta into the live model's context as a\n * `[whiteboard]` background note; the agent-undo toast click flows the same way.\n * - **Surface**: {@link RealtimeWhiteboardHostComponent}, created dynamically by the\n * overlay's channel tab; the host's Focus toggle rides `Context.SetFocusMode` so the\n * shell can collapse/restore the main call column.\n * - **State of record**: every board mutation (user edits AND agent tool calls) requests\n * a save of {@link WhiteboardState.ToJSON} under channel name `'Whiteboard'` — the\n * host debounces and flushes at teardown.\n *\n * A PRIOR session's persisted board is restored through {@link RestoreState} (invoked by\n * the session host after Initialize, before any surface binding): the saved JSON is\n * rehydrated IN PLACE into the same {@link WhiteboardState} instance, so the save\n * subscription and any later surface binding keep pointing at one engine. Malformed or\n * incompatible payloads are tolerated — the board simply starts fresh.\n */\n@RegisterClass(BaseRealtimeChannelClient, 'RealtimeWhiteboardChannel')\nexport class RealtimeWhiteboardChannel extends BaseRealtimeChannelClient<RealtimeWhiteboardHostComponent> {\n /** The board's state of record — created fresh with the plugin (one per session). */\n public readonly State = new WhiteboardState();\n\n /** The live bound surface, when the channel tab's pane is instantiated. */\n private host: RealtimeWhiteboardHostComponent | null = null;\n /** Output subscriptions on the bound surface (SceneDelta / AgentUndo / FocusModeChange). */\n private surfaceSubs: Subscription[] = [];\n /** Board-mutation subscription driving the debounced state-of-record save. */\n private stateChangedSub: Subscription | null = null;\n /** Per-widget ambient-interaction note throttles (ItemID → window state). */\n private interactionThrottles = new Map<string, InteractionThrottleEntry>();\n\n public get ChannelName(): string {\n return 'Whiteboard';\n }\n\n public get ToolNamePrefix(): string {\n return WHITEBOARD_TOOL_PREFIX;\n }\n\n public get TabTitle(): string {\n return 'Whiteboard';\n }\n\n public get TabIcon(): string {\n return 'fa-solid fa-chalkboard';\n }\n\n public GetToolDefinitions(): RealtimeToolDefinition[] {\n return WHITEBOARD_TOOL_DEFINITIONS;\n }\n\n public override GetSurfaceComponent(): Type<RealtimeWhiteboardHostComponent> {\n return RealtimeWhiteboardHostComponent;\n }\n\n /** First-run intro shown the first time the user opens the Whiteboard tab (once per user). */\n public override GetOnboardingDetails(): ChannelOnboardingDetails {\n return {\n Heading: 'Whiteboard',\n Description:\n 'A shared canvas the agent can sketch, write and annotate on live during the call — ' +\n 'whatever it draws appears here instantly, and anything you add is something it can see too.',\n Tips: [\n 'Watch the board fill in as you talk — the agent updates it in real time.',\n 'Add your own notes or shapes; the agent perceives your edits and can build on them.',\n 'Use Focus to give the board the whole screen, and save it to artifacts to keep it.'\n ],\n IconClass: 'fa-solid fa-chalkboard'\n };\n }\n\n /** Persist the board (host-debounced) on EVERY board mutation — user edits AND agent tools. */\n protected override OnInitialize(): void {\n this.stateChangedSub = this.State.Changed$.subscribe(() => {\n this.Context?.RequestSave(this.State.ToJSON());\n });\n }\n\n /**\n * Wires the dynamically-created board host: inputs (shared state engine + agent name)\n * are set BEFORE the component's first change detection, and the perception/garnish\n * outputs are subscribed back into the host context — the overlay never sees any of it.\n */\n public BindSurface(instance: RealtimeWhiteboardHostComponent): void {\n this.releaseSurface();\n this.host = instance;\n instance.State = this.State;\n instance.AgentName = this.Context?.AgentName ?? 'Agent';\n this.surfaceSubs.push(\n // The board's coalesced scene delta — the perception feed the agent \"sees\".\n instance.SceneDelta.subscribe((deltaJson: string) => {\n // Background PERCEPTION, not conversation: the model sees every user edit without\n // being told, but must not narrate minor changes — only react when something is\n // significant (or when asked). The etiquette rides in the note itself so any\n // realtime model gets it regardless of system-prompt sync state.\n this.Context?.SendContextNote(\n '[whiteboard] board update (background context — do NOT comment on minor edits; ' +\n 'only mention it if the change is significant to the discussion): ' + deltaJson);\n }),\n // The user clicked Undo on the agent-action toast (the undo already applied locally).\n instance.AgentUndo.subscribe(() => {\n this.Context?.SendContextNote('[whiteboard] user undid your last change');\n }),\n // A sandboxed HTML widget submitted user input (MJWhiteboard.submit) — already\n // validated, size-capped and not canceled (the host's cancelable WidgetSubmitting\n // event ran first). Surface it to the agent so it can react to quiz answers /\n // micro-form input it asked for.\n instance.WidgetSubmitted.subscribe((submit: WhiteboardWidgetSubmitEvent) => {\n // Durable awareness first (the note persists in the model's context)…\n this.Context?.SendContextNote(\n `[whiteboard] the user submitted input in widget \"${submit.Title || submit.ItemID}\": ${submit.DataJson}`);\n // …then make the model REACT — a submission is explicit user input the user is\n // waiting on; without this trigger, SendContextNote alone produces dead silence\n // (\"I clicked Submit and nothing happened\").\n this.Context?.RequestSpokenResponse?.(\n `The user just submitted input in the whiteboard widget \"${submit.Title || submit.ItemID}\": ${submit.DataJson}. ` +\n `React to it now in your own voice — acknowledge their choice and continue naturally.`);\n }),\n // AMBIENT widget telemetry (the injected recorder, NOT widget-authored script):\n // clicks / changes / typing summarized by the board. Pure background perception —\n // throttled per widget so chatty widgets don't flood the model's context, and framed\n // with do-not-respond etiquette (explicit MJWhiteboard.submit input arrives above).\n instance.WidgetInteraction.subscribe((interaction: WhiteboardWidgetInteractionEvent) => {\n this.onWidgetInteraction(interaction);\n }),\n // The board's Focus toggle — ask the shell to collapse/restore the main call column.\n instance.FocusModeChange.subscribe((focused: boolean) => {\n this.Context?.SetFocusMode(focused);\n }),\n // \"Save to artifacts\": snapshot the board as a first-class versioned artifact.\n instance.SaveToArtifactsRequested.subscribe(() => {\n void this.saveBoardAsArtifact();\n })\n );\n }\n\n public override UnbindSurface(): void {\n this.releaseSurface();\n }\n\n /**\n * Routes one ambient widget-interaction batch to the agent as a throttled background\n * context note: outside an open window the note goes out immediately and opens a\n * {@link WHITEBOARD_INTERACTION_NOTE_THROTTLE_MS} window; within the window the LATEST\n * event is stashed and a trailing-edge timer sends it when the window closes (one note\n * per widget per window, latest summary wins).\n */\n private onWidgetInteraction(interaction: WhiteboardWidgetInteractionEvent): void {\n const now = Date.now();\n const entry = this.interactionThrottles.get(interaction.ItemID);\n if (!entry || (entry.Timer === null && now - entry.LastSentAt >= WHITEBOARD_INTERACTION_NOTE_THROTTLE_MS)) {\n this.sendInteractionNote(interaction);\n this.interactionThrottles.set(interaction.ItemID, { LastSentAt: now, Timer: null, Pending: null });\n return;\n }\n entry.Pending = interaction; // latest wins within the window\n if (entry.Timer === null) {\n const wait = Math.max(0, entry.LastSentAt + WHITEBOARD_INTERACTION_NOTE_THROTTLE_MS - now);\n entry.Timer = setTimeout(() => {\n entry.Timer = null;\n const pending = entry.Pending;\n entry.Pending = null;\n if (pending) {\n entry.LastSentAt = Date.now();\n this.sendInteractionNote(pending);\n }\n }, wait);\n }\n }\n\n /** The ambient-note framing: background etiquette rides in the note itself (like scene deltas). */\n private sendInteractionNote(interaction: WhiteboardWidgetInteractionEvent): void {\n this.Context?.SendContextNote(\n `[whiteboard] ambient activity in widget \"${interaction.Title || interaction.ItemID}\" ` +\n '(background — do NOT respond unless it is significant or you are asked; ' +\n `explicit submissions arrive separately): ${interaction.Summary}`);\n }\n\n /** Cancels all pending ambient-note timers and resets the per-widget throttle windows. */\n private clearInteractionThrottles(): void {\n for (const entry of this.interactionThrottles.values()) {\n if (entry.Timer !== null) {\n clearTimeout(entry.Timer);\n }\n }\n this.interactionThrottles.clear();\n }\n\n /**\n * Persists the current board as a `MJ: Artifacts` snapshot via the host context\n * (best-effort; the host logs failures). On success the agent is told via a context\n * note so it can reference the saved artifact naturally.\n */\n private async saveBoardAsArtifact(): Promise<void> {\n const ctx = this.Context;\n if (!ctx) {\n return;\n }\n const now = new Date();\n const name = `Whiteboard — ${now.toLocaleDateString()} ${now.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })}`;\n const artifactId = await ctx.SaveAsArtifact(name, this.State.ToJSON());\n if (artifactId) {\n ctx.SendContextNote(`[whiteboard] the user saved the current board as the artifact \"${name}\"`);\n }\n }\n\n /**\n * Executes one `Whiteboard_*` tool call LOCALLY. Prefers the live bound host (board\n * mutation + UI garnish); falls back to the pure engine function when no surface is\n * bound so the channel keeps working with the pane collapsed.\n */\n public ApplyAgentTool(toolName: string, argsJson: string): string {\n if (this.host) {\n return this.host.ApplyAgentTool(toolName, argsJson);\n }\n return ApplyWhiteboardAgentTool(this.State, toolName, argsJson);\n }\n\n /** The board's serialized state of record (persisted under {@link ChannelName}). */\n public override SerializeState(): string | null {\n return this.State.ToJSON();\n }\n\n /**\n * Rehydrates a prior session's saved board into THIS session's state engine (in place —\n * the {@link State} instance and its subscriptions are preserved). Returns `true` on\n * success; malformed / incompatible JSON returns `false` and the board stays fresh\n * (never throws — {@link WhiteboardState.LoadFromJSON} is tolerant by contract).\n */\n public override RestoreState(stateJson: string): boolean {\n return this.State.LoadFromJSON(stateJson);\n }\n\n /**\n * Exit focus mode THROUGH the bound host (its own Focus button state stays in sync; it\n * re-emits `FocusModeChange(false)` → `Context.SetFocusMode(false)`). When no surface is\n * bound the overlay's defensive flag clear covers it.\n */\n public override RequestFocusExit(): void {\n if (this.host?.FocusMode) {\n this.host.ToggleFocus();\n }\n }\n\n public override Dispose(): void {\n this.stateChangedSub?.unsubscribe();\n this.stateChangedSub = null;\n super.Dispose(); // releases the surface binding + context\n }\n\n /** Unsubscribes surface outputs, cancels pending ambient notes and drops the host reference. */\n private releaseSurface(): void {\n for (const sub of this.surfaceSubs) {\n sub.unsubscribe();\n }\n this.surfaceSubs = [];\n this.clearInteractionThrottles();\n this.host = null;\n }\n}\n\n/**\n * Tree-shaking prevention: the whiteboard channel is resolved dynamically through the\n * ClassFactory (by the registry row's `ClientPluginClass` key), so this static call is\n * what keeps its `@RegisterClass` side effect from being eliminated by the bundler.\n * Called by `RealtimeSessionService` alongside the realtime-client driver Load calls.\n */\nexport function LoadRealtimeWhiteboardChannel(): void {\n // intentional no-op — the import side effect performs the registration\n}\n"]}
1
+ {"version":3,"file":"whiteboard-channel.js","sourceRoot":"","sources":["../../../../../src/lib/components/realtime/whiteboard/whitebo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AAI,CAAC,KAAK,CAAC,YAAY,CAAC,SAAS,CAAC,CAAC;IAC5C,CAAC;IAED;;;;OAIG;IACa,gBAAgB;QAC9B,IAAI,IAAI,CAAC,IAAI,EAAE,SAAS,EAAE,CAAC;YACzB,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;QAC1B,CAAC;IACH,CAAC;IAEe,OAAO;QACrB,IAAI,CAAC,4BAA4B,EAAE,CAAC;QACpC,IAAI,CAAC,WAAW,EAAE,IAAI,EAAE,CAAC;QACzB,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;QACxB,IAAI,CAAC,eAAe,EAAE,WAAW,EAAE,CAAC;QACpC,IAAI,CAAC,eAAe,GAAG,IAAI,CAAC;QAC5B,IAAI,CAAC,yBAAyB,GAAG,IAAI,CAAC;QACtC,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC,yCAAyC;IAC5D,CAAC;IAED,gGAAgG;IACxF,cAAc;QACpB,KAAK,MAAM,GAAG,IAAI,IAAI,CAAC,WAAW,EAAE,CAAC;YACnC,GAAG,CAAC,WAAW,EAAE,CAAC;QACpB,CAAC;QACD,IAAI,CAAC,WAAW,GAAG,EAAE,CAAC;QACtB,IAAI,CAAC,yBAAyB,EAAE,CAAC;QACjC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;;AA1bU,yBAAyB;IADrC,aAAa,CAAC,yBAAyB,EAAE,2BAA2B,CAAC;GACzD,yBAAyB,CA2brC;;AAED;;;;;GAKG;AACH,MAAM,UAAU,6BAA6B;IAC3C,uEAAuE;AACzE,CAAC","sourcesContent":["import type { Type } from '@angular/core';\nimport { Subscription } from 'rxjs';\nimport { RegisterClass } from '@memberjunction/global';\nimport { CHANNEL_INBOUND_VIDEO_TRACK, RealtimeToolDefinition, RealtimeTrack, RealtimeTrackDescriptor } from '@memberjunction/ai';\nimport { ChannelInboundVideoBridge, IChannelFrameProvider } from '@memberjunction/ai-realtime-client';\nimport { BaseRealtimeChannelClient, ChannelOnboardingDetails } from '../channels/base-realtime-channel-client';\nimport {\n ApplyWhiteboardAgentTool, BuildWhiteboardExportSvg, RealtimeWhiteboardHostComponent, WHITEBOARD_TOOL_DEFINITIONS,\n WHITEBOARD_TOOL_PREFIX, WhiteboardState, WhiteboardWidgetInteractionEvent, WhiteboardWidgetSubmitEvent\n} from '@memberjunction/ng-whiteboard';\n\n/**\n * Whether a whiteboard tool result reports success.\n *\n * `ApplyWhiteboardAgentTool` returns a JSON `WhiteboardToolResult` string — `{ success: true, … }`\n * or `{ success: false, error }` — for every tool and every failure path. Anything that does not\n * parse as an object with `success === true` is treated as NOT a successful mutation, which is the\n * safe direction: the cost of missing a confirmation frame is one stale picture until the next\n * change, while the cost of a false one is telling the model an edit landed when it did not.\n */\nfunction toolSucceeded(result: string): boolean {\n try {\n const parsed: unknown = JSON.parse(result);\n return parsed !== null && typeof parsed === 'object' && (parsed as { success?: unknown }).success === true;\n } catch {\n // A non-JSON result cannot be confirmed as a mutation — the host returned something this\n // channel does not understand, so it does not get a \"your change is on screen\" note.\n return false;\n }\n}\n\n/**\n * Asynchronously rasterizes an SVG string to a JPEG base64 string (without the `data:image/jpeg;base64,` prefix)\n * using an offscreen canvas. Returns null in non-DOM environments or when rendering fails.\n */\nexport async function rasterizeSvgToJpegBase64(svg: string, width = 1280, height = 720): Promise<string | null> {\n if (typeof document === 'undefined' || typeof Image === 'undefined') {\n return null;\n }\n return new Promise<string | null>((resolve) => {\n let url: string | null = null;\n let timer: ReturnType<typeof setTimeout> | null = null;\n\n const cleanup = () => {\n if (timer != null) {\n clearTimeout(timer);\n timer = null;\n }\n if (url) {\n URL.revokeObjectURL(url);\n url = null;\n }\n };\n\n try {\n const img = new Image();\n const svgBlob = new Blob([svg], { type: 'image/svg+xml;charset=utf-8' });\n url = URL.createObjectURL(svgBlob);\n\n // Capped wait: resolve null and revoke URL if the Image never fires onload or onerror (item 61)\n timer = setTimeout(() => {\n console.error('[RealtimeWhiteboardChannel] SVG rasterization timed out after 5000ms');\n cleanup();\n resolve(null);\n }, 5000);\n\n img.onload = () => {\n try {\n const canvas = document.createElement('canvas');\n canvas.width = width;\n canvas.height = height;\n const ctx = canvas.getContext('2d');\n if (!ctx) {\n cleanup();\n resolve(null);\n return;\n }\n ctx.fillStyle = '#ffffff';\n ctx.fillRect(0, 0, width, height);\n ctx.drawImage(img, 0, 0, width, height);\n cleanup();\n const dataUrl = canvas.toDataURL('image/jpeg', 0.85);\n const comma = dataUrl.indexOf(',');\n resolve(comma >= 0 ? dataUrl.slice(comma + 1) : dataUrl);\n } catch (err) {\n console.error('[RealtimeWhiteboardChannel] Failed to rasterize SVG canvas to JPEG:', err);\n cleanup();\n resolve(null);\n }\n };\n img.onerror = (err) => {\n console.error('[RealtimeWhiteboardChannel] Failed to load SVG image for rasterization:', err);\n cleanup();\n resolve(null);\n };\n img.src = url;\n } catch (err) {\n console.error('[RealtimeWhiteboardChannel] Failed to initialize SVG rasterization:', err);\n cleanup();\n resolve(null);\n }\n });\n}\n\n/**\n * Per-widget throttle window for AMBIENT interaction context notes: at most one note per\n * widget per this many ms — within the window the LATEST summary wins (chatty widgets\n * collapse to one trailing-edge note instead of flooding the model's context).\n */\nexport const WHITEBOARD_INTERACTION_NOTE_THROTTLE_MS = 4000;\n\n/** Per-widget ambient-note throttle bookkeeping. */\ninterface InteractionThrottleEntry {\n /** When this widget's last ambient note was sent (epoch ms). */\n LastSentAt: number;\n /** Trailing-edge timer for a deferred note, or null when the window is idle. */\n Timer: ReturnType<typeof setTimeout> | null;\n /** The latest event received within the open window (sent when the timer fires). */\n Pending: WhiteboardWidgetInteractionEvent | null;\n}\n\n/**\n * The LIVE WHITEBOARD as a pluggable interactive channel — the canonical\n * {@link BaseRealtimeChannelClient} implementation, resolved from the `MJ: AI Agent\n * Channels` registry row whose `ClientPluginClass` is `'RealtimeWhiteboardChannel'`.\n *\n * One instance per session (created via ClassFactory at session start). It owns the\n * board's {@link WhiteboardState} engine and contributes the channel's full contract:\n *\n * - **Action**: the `Whiteboard_*` client-executed tool set\n * ({@link WHITEBOARD_TOOL_DEFINITIONS}); {@link ApplyAgentTool} prefers the BOUND host\n * component (board mutation + violet pop-in / toast / presence-cursor garnish) and\n * falls back to the pure {@link ApplyWhiteboardAgentTool} engine call when no surface\n * is bound (e.g. the surface panel is collapsed) — the channel keeps working, just\n * without the garnish.\n * - **Perception**: {@link BindSurface} subscribes the host's coalesced (750 ms)\n * `SceneDelta` stream and pipes each delta into the live model's context as a\n * `[whiteboard]` background note; the agent-undo toast click flows the same way.\n * - **Surface**: {@link RealtimeWhiteboardHostComponent}, created dynamically by the\n * overlay's channel tab; the host's Focus toggle rides `Context.SetFocusMode` so the\n * shell can collapse/restore the main call column.\n * - **State of record**: every board mutation (user edits AND agent tool calls) requests\n * a save of {@link WhiteboardState.ToJSON} under channel name `'Whiteboard'` — the\n * host debounces and flushes at teardown.\n *\n * A PRIOR session's persisted board is restored through {@link RestoreState} (invoked by\n * the session host after Initialize, before any surface binding): the saved JSON is\n * rehydrated IN PLACE into the same {@link WhiteboardState} instance, so the save\n * subscription and any later surface binding keep pointing at one engine. Malformed or\n * incompatible payloads are tolerated — the board simply starts fresh.\n */\n@RegisterClass(BaseRealtimeChannelClient, 'RealtimeWhiteboardChannel')\nexport class RealtimeWhiteboardChannel extends BaseRealtimeChannelClient<RealtimeWhiteboardHostComponent> implements IChannelFrameProvider {\n /** The board's state of record — created fresh with the plugin (one per session). */\n public readonly State = new WhiteboardState();\n\n /** The live bound surface, when the channel tab's pane is instantiated. */\n private host: RealtimeWhiteboardHostComponent | null = null;\n /** Output subscriptions on the bound surface (SceneDelta / AgentUndo / FocusModeChange). */\n private surfaceSubs: Subscription[] = [];\n /** Board-mutation subscription driving the debounced state-of-record save. */\n private stateChangedSub: Subscription | null = null;\n /** Per-widget ambient-interaction note throttles (ItemID → window state). */\n private interactionThrottles = new Map<string, InteractionThrottleEntry>();\n /** Shared video bridge streaming board frames to the model when the model supports inbound video. */\n private videoBridge: ChannelInboundVideoBridge | null = null;\n /** Pacing timestamp for event-driven visual scene pushes (enforces max 1 fps). */\n private lastPushTimestamp = 0;\n\n public get ChannelName(): string {\n return 'Whiteboard';\n }\n\n /**\n * Sourced tracks: Whiteboard can source inbound video to the model when the model supports it.\n */\n public override GetSourcedTracks(): readonly RealtimeTrackDescriptor[] {\n return [CHANNEL_INBOUND_VIDEO_TRACK];\n }\n\n /**\n * Produces the latest visual scene as a base64-encoded frame for the video bridge.\n * Renders the whiteboard SVG into an offscreen canvas and returns base64 JPEG.\n */\n public async GetLatestFrame(): Promise<string | null> {\n if (!this.State) {\n return null;\n }\n try {\n const svg = BuildWhiteboardExportSvg(this.State);\n return await rasterizeSvgToJpegBase64(svg);\n } catch (err) {\n console.error('[RealtimeWhiteboardChannel] Failed to export whiteboard frame:', err);\n return null;\n }\n }\n\n private static readonly WHITEBOARD_DEFAULT_CADENCE_MS = 1000;\n private static readonly WHITEBOARD_MIN_CADENCE_MS = 250;\n\n // NO liveness heartbeat here, deliberately. This channel is 100% CHANGE-DRIVEN: the only thing\n // that pushes a frame is a board mutation. A periodic keep-alive would have to be driven by its\n // own always-on interval — this channel does no work at all while the board is idle, and\n // resurrecting it every 15 seconds to re-send an unchanged picture is a cost with no shown\n // benefit. (It also cannot be smuggled in via the mutation path: a 15s elapsed-check inside\n // onUserMutation only runs when a mutation arrives, so on an idle board it is never evaluated —\n // which is exactly what the constant this replaced did.) If the inbound video track ever needs\n // keep-alive frames, that belongs on the track or the bridge, once, not per channel.\n\n /** Trailing timer to deliver the settled resting frame after rapid user drawing/edits. */\n private whiteboardTrailingTimer: ReturnType<typeof setTimeout> | null = null;\n /** Last base64 JPEG frame pushed to the bridge, used for deduplication. */\n private lastPushedWhiteboardFrame: string | null = null;\n\n /** Cancels any active trailing-edge settle timer and clears the handle. */\n private clearWhiteboardTrailingTimer(): void {\n if (this.whiteboardTrailingTimer != null) {\n clearTimeout(this.whiteboardTrailingTimer);\n this.whiteboardTrailingTimer = null;\n }\n }\n\n /**\n * Resolves the effective push cadence in milliseconds based on the negotiated inbound video track.\n * Defaults to 1000ms (1 fps ceiling for Gemini Live), but clamps down to a minimum of 250ms (4 fps)\n * if the negotiated track specifies a higher `Rate`.\n */\n private getNegotiatedVideoCadenceMs(): number {\n const client = this.Context?.Client;\n if (!client) {\n return RealtimeWhiteboardChannel.WHITEBOARD_DEFAULT_CADENCE_MS;\n }\n const tracks: readonly RealtimeTrack[] = client.EstablishedTracks;\n const videoTrack = tracks?.find(\n (t: RealtimeTrack) =>\n t.Descriptor.Modality === 'video' &&\n t.Descriptor.Direction === 'inbound'\n );\n const rate = videoTrack?.Descriptor.Rate;\n if (typeof rate === 'number' && rate > 0) {\n return Math.max(\n RealtimeWhiteboardChannel.WHITEBOARD_MIN_CADENCE_MS,\n Math.floor(1000 / rate)\n );\n }\n return RealtimeWhiteboardChannel.WHITEBOARD_DEFAULT_CADENCE_MS;\n }\n\n /**\n * Pushes a frame to the video bridge, updating timestamp and deduplication cache.\n */\n private pushWhiteboardFrame(frame: string): void {\n this.lastPushTimestamp = Date.now();\n this.lastPushedWhiteboardFrame = frame;\n this.ensureVideoBridge()?.PushFrame(frame);\n }\n\n /**\n * Pushes the latest board visual scene when user mutations occur, with dynamic pacing,\n * deduplication, and a trailing-edge settle timer so the model sees the final resting state.\n */\n private async onUserMutation(): Promise<void> {\n try {\n const bridge = this.ensureVideoBridge();\n if (!bridge || !this.Context?.Client?.IsTrackEstablished('video', 'inbound')) {\n return;\n }\n\n const now = Date.now();\n const cadenceMs = this.getNegotiatedVideoCadenceMs();\n const elapsed = now - this.lastPushTimestamp;\n\n if (elapsed >= cadenceMs) {\n this.clearWhiteboardTrailingTimer();\n const frame = await this.GetLatestFrame();\n if (!frame) {\n return;\n }\n if (frame !== this.lastPushedWhiteboardFrame) {\n this.pushWhiteboardFrame(frame);\n }\n } else {\n // Within cooldown window: schedule trailing settle timer if not already armed.\n if (!this.whiteboardTrailingTimer) {\n const delay = Math.max(0, cadenceMs - elapsed);\n this.whiteboardTrailingTimer = setTimeout(async () => {\n this.whiteboardTrailingTimer = null;\n try {\n if (!this.Context?.Client?.IsTrackEstablished('video', 'inbound')) {\n return;\n }\n const frame = await this.GetLatestFrame();\n if (!frame) {\n return;\n }\n if (frame !== this.lastPushedWhiteboardFrame) {\n this.pushWhiteboardFrame(frame);\n }\n } catch (err) {\n console.error('[RealtimeWhiteboardChannel] Error in whiteboard trailing settle timer:', err);\n }\n }, delay);\n }\n }\n } catch (err) {\n console.error('[RealtimeWhiteboardChannel] Error in onUserMutation:', err);\n }\n }\n\n /**\n * Pushes exactly ONE confirmation frame after an agent tool mutates the board, and\n * informs the model context so it does not loop narrating its own change.\n */\n private async pushAgentConfirmationFrame(): Promise<void> {\n try {\n const bridge = this.ensureVideoBridge();\n if (!bridge || !this.Context?.Client?.IsTrackEstablished('video', 'inbound')) {\n return;\n }\n this.clearWhiteboardTrailingTimer();\n const frame = await this.GetLatestFrame();\n if (frame) {\n this.pushWhiteboardFrame(frame);\n this.Context?.SendContextNote(\n '[whiteboard] visual confirmation of your action (background — do NOT narrate or announce your own change; continue naturally)'\n );\n }\n } catch (err) {\n console.error('[RealtimeWhiteboardChannel] Error in pushAgentConfirmationFrame:', err);\n }\n }\n\n public get ToolNamePrefix(): string {\n return WHITEBOARD_TOOL_PREFIX;\n }\n\n public get TabTitle(): string {\n return 'Whiteboard';\n }\n\n public get TabIcon(): string {\n return 'fa-solid fa-chalkboard';\n }\n\n public GetToolDefinitions(): RealtimeToolDefinition[] {\n return WHITEBOARD_TOOL_DEFINITIONS;\n }\n\n public override GetSurfaceComponent(): Type<RealtimeWhiteboardHostComponent> {\n return RealtimeWhiteboardHostComponent;\n }\n\n /** First-run intro shown the first time the user opens the Whiteboard tab (once per user). */\n public override GetOnboardingDetails(): ChannelOnboardingDetails {\n return {\n Heading: 'Whiteboard',\n Description:\n 'A shared canvas the agent can sketch, write and annotate on live during the call — ' +\n 'whatever it draws appears here instantly, and anything you add is something it can see too.',\n Tips: [\n 'Watch the board fill in as you talk — the agent updates it in real time.',\n 'Add your own notes or shapes; the agent perceives your edits and can build on them.',\n 'Use Focus to give the board the whole screen, and save it to artifacts to keep it.'\n ],\n IconClass: 'fa-solid fa-chalkboard'\n };\n }\n\n /** Persist the board (host-debounced) on EVERY board mutation — user edits AND agent tools. */\n protected override OnInitialize(): void {\n this.stateChangedSub?.unsubscribe();\n this.clearWhiteboardTrailingTimer();\n this.stateChangedSub = this.State.Changed$.subscribe((change) => {\n this.Context?.RequestSave(this.State.ToJSON());\n // Only user edits (and scene replacements like undo) drive the user settle-debounce pipeline.\n // Agent edits are confirmed with a single frame in ApplyAgentTool.\n if (change.Author === 'user' || change.Op === 'replace') {\n void this.onUserMutation();\n }\n });\n this.ensureVideoBridge();\n }\n\n public override OnSessionStarted(): void {\n this.ensureVideoBridge();\n }\n\n private ensureVideoBridge(): ChannelInboundVideoBridge | null {\n if (!this.videoBridge && this.Context) {\n this.videoBridge = new ChannelInboundVideoBridge(() => this.Context?.Client, this);\n }\n if (this.videoBridge && !this.videoBridge.IsActive && this.Context?.Client?.IsTrackEstablished('video', 'inbound')) {\n this.videoBridge.Start?.();\n }\n return this.videoBridge;\n }\n\n /**\n * Wires the dynamically-created board host: inputs (shared state engine + agent name)\n * are set BEFORE the component's first change detection, and the perception/garnish\n * outputs are subscribed back into the host context — the overlay never sees any of it.\n */\n public BindSurface(instance: RealtimeWhiteboardHostComponent): void {\n this.ensureVideoBridge();\n this.releaseSurface();\n this.host = instance;\n instance.State = this.State;\n instance.AgentName = this.Context?.AgentName ?? 'Agent';\n this.surfaceSubs.push(\n // The board's coalesced scene delta — the perception feed the agent \"sees\".\n instance.SceneDelta.subscribe((deltaJson: string) => {\n // Background PERCEPTION, not conversation: the model sees every user edit without\n // being told, but must not narrate minor changes — only react when something is\n // significant (or when asked). The etiquette rides in the note itself so any\n // realtime model gets it regardless of system-prompt sync state.\n this.Context?.SendContextNote(\n '[whiteboard] board update (background context — do NOT comment on minor edits; ' +\n 'only mention it if the change is significant to the discussion): ' + deltaJson);\n }),\n // The user clicked Undo on the agent-action toast (the undo already applied locally).\n instance.AgentUndo.subscribe(() => {\n this.Context?.SendContextNote('[whiteboard] user undid your last change');\n }),\n // A sandboxed HTML widget submitted user input (MJWhiteboard.submit) — already\n // validated, size-capped and not canceled (the host's cancelable WidgetSubmitting\n // event ran first). Surface it to the agent so it can react to quiz answers /\n // micro-form input it asked for.\n instance.WidgetSubmitted.subscribe((submit: WhiteboardWidgetSubmitEvent) => {\n // Durable awareness first (the note persists in the model's context)…\n this.Context?.SendContextNote(\n `[whiteboard] the user submitted input in widget \"${submit.Title || submit.ItemID}\": ${submit.DataJson}`);\n // …then make the model REACT — a submission is explicit user input the user is\n // waiting on; without this trigger, SendContextNote alone produces dead silence\n // (\"I clicked Submit and nothing happened\").\n this.Context?.RequestSpokenResponse?.(\n `The user just submitted input in the whiteboard widget \"${submit.Title || submit.ItemID}\": ${submit.DataJson}. ` +\n `React to it now in your own voice — acknowledge their choice and continue naturally.`);\n }),\n // AMBIENT widget telemetry (the injected recorder, NOT widget-authored script):\n // clicks / changes / typing summarized by the board. Pure background perception —\n // throttled per widget so chatty widgets don't flood the model's context, and framed\n // with do-not-respond etiquette (explicit MJWhiteboard.submit input arrives above).\n instance.WidgetInteraction.subscribe((interaction: WhiteboardWidgetInteractionEvent) => {\n this.onWidgetInteraction(interaction);\n }),\n // The board's Focus toggle — ask the shell to collapse/restore the main call column.\n instance.FocusModeChange.subscribe((focused: boolean) => {\n this.Context?.SetFocusMode(focused);\n }),\n // \"Save to artifacts\": snapshot the board as a first-class versioned artifact.\n instance.SaveToArtifactsRequested.subscribe(() => {\n void this.saveBoardAsArtifact();\n })\n );\n }\n\n public override UnbindSurface(): void {\n this.releaseSurface();\n }\n\n /**\n * Routes one ambient widget-interaction batch to the agent as a throttled background\n * context note: outside an open window the note goes out immediately and opens a\n * {@link WHITEBOARD_INTERACTION_NOTE_THROTTLE_MS} window; within the window the LATEST\n * event is stashed and a trailing-edge timer sends it when the window closes (one note\n * per widget per window, latest summary wins).\n */\n private onWidgetInteraction(interaction: WhiteboardWidgetInteractionEvent): void {\n const now = Date.now();\n const entry = this.interactionThrottles.get(interaction.ItemID);\n if (!entry || (entry.Timer === null && now - entry.LastSentAt >= WHITEBOARD_INTERACTION_NOTE_THROTTLE_MS)) {\n this.sendInteractionNote(interaction);\n this.interactionThrottles.set(interaction.ItemID, { LastSentAt: now, Timer: null, Pending: null });\n return;\n }\n entry.Pending = interaction; // latest wins within the window\n if (entry.Timer === null) {\n const wait = Math.max(0, entry.LastSentAt + WHITEBOARD_INTERACTION_NOTE_THROTTLE_MS - now);\n entry.Timer = setTimeout(() => {\n entry.Timer = null;\n const pending = entry.Pending;\n entry.Pending = null;\n if (pending) {\n entry.LastSentAt = Date.now();\n this.sendInteractionNote(pending);\n }\n }, wait);\n }\n }\n\n /** The ambient-note framing: background etiquette rides in the note itself (like scene deltas). */\n private sendInteractionNote(interaction: WhiteboardWidgetInteractionEvent): void {\n this.Context?.SendContextNote(\n `[whiteboard] ambient activity in widget \"${interaction.Title || interaction.ItemID}\" ` +\n '(background — do NOT respond unless it is significant or you are asked; ' +\n `explicit submissions arrive separately): ${interaction.Summary}`);\n }\n\n /** Cancels all pending ambient-note timers and resets the per-widget throttle windows. */\n private clearInteractionThrottles(): void {\n for (const entry of this.interactionThrottles.values()) {\n if (entry.Timer !== null) {\n clearTimeout(entry.Timer);\n }\n }\n this.interactionThrottles.clear();\n }\n\n /**\n * Persists the current board as a `MJ: Artifacts` snapshot via the host context\n * (best-effort; the host logs failures). On success the agent is told via a context\n * note so it can reference the saved artifact naturally.\n */\n private async saveBoardAsArtifact(): Promise<void> {\n const ctx = this.Context;\n if (!ctx) {\n return;\n }\n const now = new Date();\n const name = `Whiteboard — ${now.toLocaleDateString()} ${now.toLocaleTimeString([], { hour: '2-digit', minute: '2-digit' })}`;\n const artifactId = await ctx.SaveAsArtifact(name, this.State.ToJSON());\n if (artifactId) {\n ctx.SendContextNote(`[whiteboard] the user saved the current board as the artifact \"${name}\"`);\n }\n }\n\n /**\n * Executes one `Whiteboard_*` tool call LOCALLY. Prefers the live bound host (board\n * mutation + UI garnish); falls back to the pure engine function when no surface is\n * bound so the channel keeps working with the pane collapsed.\n */\n public ApplyAgentTool(toolName: string, argsJson: string): string {\n let result: string;\n if (this.host) {\n result = this.host.ApplyAgentTool(toolName, argsJson);\n } else {\n result = ApplyWhiteboardAgentTool(this.State, toolName, argsJson);\n }\n // A SUCCESSFUL agent tool triggers exactly ONE immediate visual confirmation frame and a note\n // telling the model not to narrate its own change. A FAILED one must trigger neither: every\n // failure path returns `{ success: false, error }` (bad JSON args, unknown tool, per-tool\n // validation), and confirming it would tell the model its edit landed AND instruct it to stay\n // quiet about it — so the failure would vanish from the user's view while the model carried on.\n // It would also push a frame identical to the last one, since a failed tool changes nothing.\n if (toolSucceeded(result)) {\n void this.pushAgentConfirmationFrame();\n }\n return result;\n }\n\n /** The board's serialized state of record (persisted under {@link ChannelName}). */\n public override SerializeState(): string | null {\n return this.State.ToJSON();\n }\n\n /**\n * Rehydrates a prior session's saved board into THIS session's state engine (in place —\n * the {@link State} instance and its subscriptions are preserved). Returns `true` on\n * success; malformed / incompatible JSON returns `false` and the board stays fresh\n * (never throws — {@link WhiteboardState.LoadFromJSON} is tolerant by contract).\n */\n public override RestoreState(stateJson: string): boolean {\n return this.State.LoadFromJSON(stateJson);\n }\n\n /**\n * Exit focus mode THROUGH the bound host (its own Focus button state stays in sync; it\n * re-emits `FocusModeChange(false)` → `Context.SetFocusMode(false)`). When no surface is\n * bound the overlay's defensive flag clear covers it.\n */\n public override RequestFocusExit(): void {\n if (this.host?.FocusMode) {\n this.host.ToggleFocus();\n }\n }\n\n public override Dispose(): void {\n this.clearWhiteboardTrailingTimer();\n this.videoBridge?.Stop();\n this.videoBridge = null;\n this.stateChangedSub?.unsubscribe();\n this.stateChangedSub = null;\n this.lastPushedWhiteboardFrame = null;\n super.Dispose(); // releases the surface binding + context\n }\n\n /** Unsubscribes surface outputs, cancels pending ambient notes and drops the host reference. */\n private releaseSurface(): void {\n for (const sub of this.surfaceSubs) {\n sub.unsubscribe();\n }\n this.surfaceSubs = [];\n this.clearInteractionThrottles();\n this.host = null;\n }\n}\n\n/**\n * Tree-shaking prevention: the whiteboard channel is resolved dynamically through the\n * ClassFactory (by the registry row's `ClientPluginClass` key), so this static call is\n * what keeps its `@RegisterClass` side effect from being eliminated by the bundler.\n * Called by `RealtimeSessionService` alongside the realtime-client driver Load calls.\n */\nexport function LoadRealtimeWhiteboardChannel(): void {\n // intentional no-op — the import side effect performs the registration\n}\n"]}
@@ -1,8 +1,8 @@
1
1
  import { Observable } from 'rxjs';
2
2
  import { IMetadataProvider } from '@memberjunction/core';
3
- import { RealtimeToolDefinition } from '@memberjunction/ai';
3
+ import { ClientRealtimeSessionConfig, RealtimeToolDefinition, RealtimeTrackDirection } from '@memberjunction/ai';
4
4
  import { AppContextSnapshot } from '@memberjunction/ai-core-plus';
5
- import { RealtimeAudioActivity } from '@memberjunction/ai-realtime-client';
5
+ import { BaseRealtimeClient, RealtimeAudioActivity } from '@memberjunction/ai-realtime-client';
6
6
  import { ParsedDelegationArtifact } from './delegation-result-parser';
7
7
  import { BaseRealtimeChannelClient } from '../components/realtime/channels/base-realtime-channel-client';
8
8
  import * as i0 from "@angular/core";
@@ -103,6 +103,19 @@ export interface RealtimeDelegationNarration {
103
103
  /** The narration transcript text. */
104
104
  Text: string;
105
105
  }
106
+ /**
107
+ * One thought/reasoning narration emitted on {@link RealtimeSessionService.ThoughtNarration$}.
108
+ * Distinct from spoken progress narrations: thought summaries are authored by reasoning models
109
+ * (e.g. Gemini 3.8 Live Extended Thinking) and are NOT spoken aloud.
110
+ */
111
+ export interface RealtimeThoughtNarration {
112
+ /** Correlating call ID if associated with a delegation/turn; otherwise generated or empty. */
113
+ CallID?: string;
114
+ /** The model's thought / reasoning text. */
115
+ Text: string;
116
+ /** Whether this emission represents the complete finalized thought turn. */
117
+ IsFinal?: boolean;
118
+ }
106
119
  /**
107
120
  * Result shape returned by the `StartRealtimeClientSession` server mutation.
108
121
  * The browser uses these values to open a client-direct realtime session.
@@ -205,6 +218,7 @@ export declare class RealtimeSessionService {
205
218
  private _delegationProgress$;
206
219
  private _delegationResult$;
207
220
  private _delegationNarration$;
221
+ private _thoughtNarration$;
208
222
  private _agentName$;
209
223
  private _modelName$;
210
224
  private _minimized$;
@@ -232,6 +246,11 @@ export declare class RealtimeSessionService {
232
246
  * renders them as a transient "live note" near the active working card.
233
247
  */
234
248
  readonly DelegationNarration$: Observable<RealtimeDelegationNarration>;
249
+ /**
250
+ * Model-authored thought / reasoning narrations (see {@link RealtimeThoughtNarration}). These are
251
+ * reasoning summaries author-emitted during extended thinking, separate from spoken progress updates.
252
+ */
253
+ readonly ThoughtNarration$: Observable<RealtimeThoughtNarration>;
235
254
  /** Display name of the agent the active session fronts (set at session start). */
236
255
  readonly AgentName$: Observable<string>;
237
256
  /**
@@ -646,6 +665,18 @@ export declare class RealtimeSessionService {
646
665
  * a cheap analyser read, never provider traffic.
647
666
  */
648
667
  GetAudioActivity(): RealtimeAudioActivity | null;
668
+ /**
669
+ * The active {@link BaseRealtimeClient} driving the media plane, or null when not connected.
670
+ */
671
+ get Client(): BaseRealtimeClient | null;
672
+ /**
673
+ * Relays a video frame to the underlying realtime client if active.
674
+ */
675
+ SendVideoFrame(base64Image: string, mimeType?: string): void;
676
+ /**
677
+ * Checks whether a media track is established on the active realtime client.
678
+ */
679
+ IsTrackEstablished(modality: string, direction: RealtimeTrackDirection): boolean;
649
680
  /**
650
681
  * Reads the per-user recording-consent preference from `MJ: User Settings` (via
651
682
  * {@link UserInfoEngine}'s synchronous cache). Defensive: any failure resolves to `false`
@@ -832,8 +863,12 @@ export declare class RealtimeSessionService {
832
863
  * provider (e.g. its Load function was never called).
833
864
  */
834
865
  private createRealtimeClient;
835
- /** Builds the client-direct session config the realtime client connects with. */
836
- private buildClientConfig;
866
+ /**
867
+ * Builds the client-direct session config the realtime client connects with.
868
+ * Aggregates tracks sourced by active channels into `requestedTracks` so the driver
869
+ * can negotiate them (e.g., establishing inbound video streaming for Whiteboard / RemoteBrowser).
870
+ */
871
+ buildClientConfig(session: StartRealtimeClientSessionResult): ClientRealtimeSessionConfig;
837
872
  /**
838
873
  * Parses the server-built session config JSON. On failure, logs and returns an empty
839
874
  * object — the client treats an empty config as "nothing to apply", so the session
@@ -1 +1 @@
1
- {"version":3,"file":"realtime-session.service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/realtime-session.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAmB,UAAU,EAAyB,MAAM,MAAM,CAAC;AAC1E,OAAO,EAAY,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAKnE,OAAO,EAAsD,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAChH,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EAQL,qBAAqB,EAMtB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAA6B,wBAAwB,EAAkB,MAAM,4BAA4B,CAAC;AACjH,OAAO,EAAE,yBAAyB,EAA0B,MAAM,8DAA8D,CAAC;;AAGjI;;;;;GAKG;AACH,eAAO,MAAM,8BAA8B,yCAAyC,CAAC;AAgBrF;;;;;;;;GAQG;AACH,MAAM,MAAM,uBAAuB,GAC/B,YAAY,GACZ,WAAW,GACX,UAAU,GACV,UAAU,GACV,OAAO,GACP,QAAQ,CAAC;AAEb,4FAA4F;AAC5F,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;CACd;AAED;;;;GAIG;AACH,MAAM,WAAW,0BAA0B;IACzC,oDAAoD;IACpD,MAAM,EAAE,MAAM,CAAC;IACf,0GAA0G;IAC1G,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,sIAAsI;IACtI,IAAI,EAAE,MAAM,CAAC;IACb,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IG;IACH,OAAO,CAAC,eAAe;IAevB,uFAAuF;IACvF,OAAO,CAAC,eAAe;IAMvB;;;OAGG;IACH,OAAO,CAAC,aAAa;IAsBrB,kFAAkF;IAClF,OAAO,CAAC,gBAAgB;IAUxB;;;;OAIG;IACH,OAAO,CAAC,eAAe;IAevB,oFAAoF;IACpF,OAAO,CAAC,sBAAsB;IAU9B;;;;;OAKG;IACH,OAAO,CAAC,oBAAoB;IAW5B;;;;OAIG;IACH,OAAO,CAAC,qBAAqB;IAmB7B,uFAAuF;IACvF,OAAO,CAAC,sBAAsB;IAQ9B;;;;;;;;OAQG;IACH,OAAO,CAAC,0BAA0B;IAOlC,yFAAyF;IACzF,OAAO,CAAC,0BAA0B;IAiBlC;;;OAGG;YACW,QAAQ;IAiEtB,mEAAmE;YACrD,kBAAkB;IAehC,mFAAmF;IACnF,OAAO,CAAC,aAAa;IAIrB,kEAAkE;IAClE,OAAO,CAAC,UAAU;IAclB,qDAAqD;IACrD,OAAO,CAAC,GAAG;yCAp5EA,sBAAsB;6CAAtB,sBAAsB;CAu5ElC"}
1
+ {"version":3,"file":"realtime-session.service.d.ts","sourceRoot":"","sources":["../../../src/lib/services/realtime-session.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAmB,UAAU,EAAyB,MAAM,MAAM,CAAC;AAC1E,OAAO,EAAY,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAKnE,OAAO,EAAE,2BAA2B,EAAwD,sBAAsB,EAA2B,sBAAsB,EAAE,MAAM,oBAAoB,CAAC;AAChM,OAAO,EAAE,kBAAkB,EAAE,MAAM,8BAA8B,CAAC;AAClE,OAAO,EACL,kBAAkB,EAOlB,qBAAqB,EAMtB,MAAM,oCAAoC,CAAC;AAE5C,OAAO,EAA6B,wBAAwB,EAAkB,MAAM,4BAA4B,CAAC;AACjH,OAAO,EAAE,yBAAyB,EAA0B,MAAM,8DAA8D,CAAC;;AAGjI;;;;;GAKG;AACH,eAAO,MAAM,8BAA8B,yCAAyC,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