@memberjunction/ai 6.1.1 → 6.1.3

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,5 +1,6 @@
1
1
  import { BaseModel } from "./baseModel.js";
2
2
  import type { RealtimeReasoningPlane } from "./modelConfiguration.js";
3
+ import type { RealtimeTrackDescriptor, RealtimeTrackUsageBasis } from "./realtimeTracks.js";
3
4
  /**
4
5
  * A JSON-serializable value. Used to type open configuration bags and JSON-schema
5
6
  * objects at the Core layer without resorting to `any`.
@@ -287,9 +288,15 @@ export interface RealtimeSessionCapabilities {
287
288
  */
288
289
  EmitsResponseComplete?: boolean;
289
290
  /**
290
- * The units this provider uses to measure and bill usage: tokens, seconds, or both.
291
+ * The units this provider uses to measure and bill usage.
292
+ *
293
+ * A LIST rather than an enum because a provider can meter in more than one basis at once —
294
+ * GPT-Live reports voice seconds and delegated reasoning tokens from different places, so an
295
+ * exclusive enum would force us to drop one. Shares
296
+ * {@link import('./realtimeTracks.js').RealtimeTrackUsageBasis} with the media plane so cost has one
297
+ * vocabulary; `'frames'` and `'bytes'` exist for non-audio tracks.
291
298
  */
292
- UsageBases?: readonly ('tokens' | 'seconds')[];
299
+ UsageBases?: readonly RealtimeTrackUsageBasis[];
293
300
  /**
294
301
  * Whether this driver provides speech-to-text transcript events for user audio input.
295
302
  */
@@ -298,6 +305,28 @@ export interface RealtimeSessionCapabilities {
298
305
  * Whether this driver provides text transcript events for model audio output.
299
306
  */
300
307
  ProvidesOutputTranscription?: boolean;
308
+ /**
309
+ * Whether this driver surfaces model-authored summaries of the model's own reasoning
310
+ * (Gemini `thinkingConfig.includeThoughts`).
311
+ *
312
+ * Sibling of {@link ProvidesInputTranscription} / {@link ProvidesOutputTranscription}: it
313
+ * declares a transcript STREAM the driver can produce. Thought summaries are narration, not
314
+ * spoken response — a host rendering them as assistant speech would attribute the model's
315
+ * scratch reasoning to it as an answer.
316
+ */
317
+ ProvidesThoughtSummaries?: boolean;
318
+ /**
319
+ * Whether this driver correctly handles a session whose reasoning outlives its turn — i.e.
320
+ * where a turn-terminal frame does NOT mean the server is idle, and further tool calls or
321
+ * audio may still arrive.
322
+ *
323
+ * This is a statement about the DRIVER, not the model: a driver that keys "work finished" off
324
+ * the turn-terminal frame must declare `false`, because on such a model it would flush deferred
325
+ * work early and report itself not-busy while the server is still going. Which signal a given
326
+ * model actually uses is model metadata
327
+ * (`ModelConfiguration.Realtime.IdleSignal`), not a driver capability.
328
+ */
329
+ SupportsAsynchronousReasoning?: boolean;
301
330
  /**
302
331
  * Whether the provider supports receiving multiple parallel tool calls and batched results (gpt-live-1.md §4.2).
303
332
  */
@@ -314,6 +343,26 @@ export interface RealtimeSessionCapabilities {
314
343
  * Maximum number of concurrent delegations supported by the provider, or undefined if unbounded.
315
344
  */
316
345
  MaxConcurrentDelegations?: number;
346
+ /**
347
+ * Media tracks this model can RECEIVE (user -> model).
348
+ *
349
+ * Absent or empty is read as "inbound audio only", which is every model MJ spoke to before
350
+ * Gemini 3.8 Live — so an existing driver that declares nothing keeps working unchanged.
351
+ *
352
+ * This is the supply side of track negotiation: the caller requests
353
+ * (`ModelConfiguration.Realtime.RequestedTracks`), this declares, and
354
+ * {@link import('./realtimeTracks.js').ResolveRequestedTracks} intersects them. A requested track
355
+ * absent here resolves to `'unsupported'` rather than being dropped, so a host can fall back
356
+ * deliberately instead of wondering why no samples arrive.
357
+ */
358
+ SupportedInboundTracks?: readonly RealtimeTrackDescriptor[];
359
+ /**
360
+ * Media tracks this model can EMIT (model -> user). Absent or empty is read as "outbound audio
361
+ * only". Non-audio outbound tracks (avatar video, haptics) are admitted by the contract because
362
+ * direction is a property of a track rather than part of its type; no provider in play emits one
363
+ * yet.
364
+ */
365
+ SupportedOutboundTracks?: readonly RealtimeTrackDescriptor[];
317
366
  }
318
367
  /** Parameters for {@link IRealtimeSession.Reconfigure} — a live turn-taking change. */
319
368
  export interface RealtimeReconfigureParams {
@@ -619,6 +668,13 @@ export interface RealtimeSessionParams {
619
668
  * Used for auditing, rate limiting, and proxy ticket attribution.
620
669
  */
621
670
  UserID?: string;
671
+ /**
672
+ * Optional boolean indicating that the SystemPrompt already provides its own tool framing
673
+ * (e.g. from BuildRealtimeAgentFraming in co-agent sessions). When true, drivers MUST NOT
674
+ * append their own standalone delegation policy. When false or omitted, drivers may fall back
675
+ * to heuristic substring sniffing or default policy compilation.
676
+ */
677
+ HasToolFraming?: boolean;
622
678
  }
623
679
  /**
624
680
  * A transcript event emitted by the model for either the user's speech or the assistant's
@@ -646,6 +702,16 @@ export interface RealtimeTranscript {
646
702
  * instead of a stack of growing duplicates. Absent/false: a normal, append-worthy final.
647
703
  */
648
704
  ReplacesPrevious?: boolean;
705
+ /**
706
+ * `'normal'` for a regular conversation turn; `'narration'` for an ephemeral
707
+ * spoken-progress update or model-authored reasoning thought. Absent/undefined defaults to `'normal'`.
708
+ */
709
+ Kind?: 'normal' | 'narration';
710
+ /**
711
+ * `true` when this transcript represents model-authored reasoning / thoughts rather than
712
+ * spoken audio.
713
+ */
714
+ IsThought?: boolean;
649
715
  }
650
716
  /**
651
717
  * An error surfaced by a realtime session via {@link IRealtimeSession.OnError}.
@@ -727,10 +793,26 @@ export interface RealtimeUsageModalityDetail {
727
793
  TextTokens?: number;
728
794
  /** Audio-modality tokens. */
729
795
  AudioTokens?: number;
730
- /** Image-modality tokens (input only on current providers). */
796
+ /**
797
+ * Image-modality tokens (input only on current providers).
798
+ * Authoritative financial billing basis reported by inference providers (e.g. Gemini Live reports
799
+ * inbound video frames under promptTokensDetails.IMAGE).
800
+ */
731
801
  ImageTokens?: number;
732
802
  /** Tokens served from the provider's prompt cache (billed at the cached rate). */
733
803
  CachedTokens?: number;
804
+ /**
805
+ * Cumulative inbound video frames processed on video tracks (usage basis 'frames').
806
+ * Client-side telemetry signal providing fine-grained frame counting and rate attribution.
807
+ * Comparing VideoFrames against ImageTokens enables operational drift detection for dropped frames.
808
+ */
809
+ VideoFrames?: number;
810
+ /**
811
+ * Cumulative inbound or outbound video duration in seconds (usage basis 'seconds').
812
+ * Represents the wall-clock span between first and last sent frames (span-not-sum) for stream telemetry.
813
+ * Provider-reported ImageTokens remains the authoritative financial billing basis.
814
+ */
815
+ VideoSeconds?: number;
734
816
  }
735
817
  /**
736
818
  * Minimal, Core-level definition of a tool exposed to a realtime model.
@@ -757,4 +839,31 @@ export interface RealtimeToolDefinition {
757
839
  */
758
840
  ParametersSchema: JSONObject;
759
841
  }
842
+ /**
843
+ * Normalized representation of a realtime tool execution scheduling hint.
844
+ *
845
+ * Directs how the model should schedule its generation following a tool result:
846
+ * - `'silent'`: Execute without model speaking response.
847
+ * - `'whenIdle'`: Deliver tool output to model when conversational turn goes idle.
848
+ * - `'interrupt'`: Immediately interrupt active generation to deliver tool output.
849
+ */
850
+ export type RealtimeToolSchedulingHint = 'silent' | 'whenIdle' | 'interrupt';
851
+ /**
852
+ * Extracts and normalizes scheduling hints (`__mj_scheduling` or legacy `scheduling`)
853
+ * from a tool's parsed return dictionary.
854
+ *
855
+ * Strips both keys from `parsed` in-place so neither key leaks into the model's response payload.
856
+ * Validates the value case-insensitively, accepting:
857
+ * - 'SILENT' -> 'silent'
858
+ * - 'WHEN_IDLE' -> 'whenIdle'
859
+ * - 'INTERRUPT' | 'INTERRUPTED' -> 'interrupt'
860
+ *
861
+ * Warns on unrecognized values with `loggerTag` and returns `undefined`.
862
+ *
863
+ * @param parsed The tool output dictionary (mutated in-place to strip scheduling keys).
864
+ * @param toolName The name of the tool being executed, for logging context.
865
+ * @param loggerTag Optional logging tag prefix (defaults to 'Realtime').
866
+ * @returns The normalized scheduling hint, or `undefined` if absent or unrecognized.
867
+ */
868
+ export declare function ExtractToolSchedulingHint(parsed: Record<string, unknown>, toolName: string, loggerTag?: string): RealtimeToolSchedulingHint | undefined;
760
869
  //# sourceMappingURL=baseRealtime.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"baseRealtime.d.ts","sourceRoot":"","sources":["../../src/generic/baseRealtime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,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB;;;;OAIG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;CACzB;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,sBAAsB;IACnC;;OAEG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;;OAGG;IACH,gBAAgB,EAAE,UAAU,CAAC;CAChC;AAED;;;;;;;GAOG;AACH,MAAM,MAAM,0BAA0B,GAAG,QAAQ,GAAG,UAAU,GAAG,WAAW,CAAC;AAE7E;;;;;;;;;;;;;;;;GAgBG;AACH,wBAAgB,yBAAyB,CACrC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC/B,QAAQ,EAAE,MAAM,EAChB,SAAS,GAAE,MAAmB,GAC/B,0BAA0B,GAAG,SAAS,CA4BxC"}
@@ -185,8 +185,57 @@ export const REALTIME_SHARED_CONFIG_KEYS = [
185
185
  'firstMessage',
186
186
  'disableAutoResponse',
187
187
  'turnDetection',
188
+ 'reasoning',
188
189
  'endpoint',
189
190
  'sampleRate',
190
191
  'proxyBaseUrl',
192
+ 'tooling',
193
+ 'toolBehavior',
191
194
  ];
195
+ /**
196
+ * Extracts and normalizes scheduling hints (`__mj_scheduling` or legacy `scheduling`)
197
+ * from a tool's parsed return dictionary.
198
+ *
199
+ * Strips both keys from `parsed` in-place so neither key leaks into the model's response payload.
200
+ * Validates the value case-insensitively, accepting:
201
+ * - 'SILENT' -> 'silent'
202
+ * - 'WHEN_IDLE' -> 'whenIdle'
203
+ * - 'INTERRUPT' | 'INTERRUPTED' -> 'interrupt'
204
+ *
205
+ * Warns on unrecognized values with `loggerTag` and returns `undefined`.
206
+ *
207
+ * @param parsed The tool output dictionary (mutated in-place to strip scheduling keys).
208
+ * @param toolName The name of the tool being executed, for logging context.
209
+ * @param loggerTag Optional logging tag prefix (defaults to 'Realtime').
210
+ * @returns The normalized scheduling hint, or `undefined` if absent or unrecognized.
211
+ */
212
+ export function ExtractToolSchedulingHint(parsed, toolName, loggerTag = 'Realtime') {
213
+ const raw = parsed['__mj_scheduling'] ?? parsed['scheduling'];
214
+ if ('__mj_scheduling' in parsed) {
215
+ delete parsed['__mj_scheduling'];
216
+ }
217
+ if ('scheduling' in parsed) {
218
+ delete parsed['scheduling'];
219
+ }
220
+ if (typeof raw !== 'string') {
221
+ return undefined;
222
+ }
223
+ const schedStr = raw.trim().toUpperCase();
224
+ if (schedStr.length === 0) {
225
+ return undefined;
226
+ }
227
+ if (schedStr === 'SILENT') {
228
+ return 'silent';
229
+ }
230
+ else if (schedStr === 'WHEN_IDLE') {
231
+ return 'whenIdle';
232
+ }
233
+ else if (schedStr === 'INTERRUPT' || schedStr === 'INTERRUPTED') {
234
+ return 'interrupt';
235
+ }
236
+ else {
237
+ console.warn(`[${loggerTag}] Unrecognized function scheduling value "${raw}" for tool "${toolName}".`);
238
+ return undefined;
239
+ }
240
+ }
192
241
  //# sourceMappingURL=baseRealtime.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"baseRealtime.js","sourceRoot":"","sources":["../../src/generic/baseRealtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAqBxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AAEH;;;;;;;;;;GAUG;AACH,MAAM,UAAU,eAAe,CAAC,OAAe;IAC3C,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,WAAW,EAAE,CAAC;IACvD,IAAI,CAAC,KAAK,MAAM,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,KAAK,EAAE,CAAC;QAC3C,+EAA+E;QAC/E,iEAAiE;QACjE,MAAM,SAAS,GAAG,OAAO,CAAC,OAAO,CAAC,wBAAwB,EAAE,GAAG,CAAC,CAAC;QACjE,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AAO,MAAM,CAAC,iBAAiB,CAAC,CAAC;IACrC,CAAC;IACD,IAAI,YAAY,IAAI,MAAM,EAAE,CAAC;QACzB,OAAO,MAAM,CAAC,YAAY,CAAC,CAAC;IAChC,CAAC;IAED,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;QAC1B,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,MAAM,QAAQ,GAAG,GAAG,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;IAC1C,IAAI,QAAQ,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACxB,OAAO,SAAS,CAAC;IACrB,CAAC;IAED,IAAI,QAAQ,KAAK,QAAQ,EAAE,CAAC;QACxB,OAAO,QAAQ,CAAC;IACpB,CAAC;SAAM,IAAI,QAAQ,KAAK,WAAW,EAAE,CAAC;QAClC,OAAO,UAAU,CAAC;IACtB,CAAC;SAAM,IAAI,QAAQ,KAAK,WAAW,IAAI,QAAQ,KAAK,aAAa,EAAE,CAAC;QAChE,OAAO,WAAW,CAAC;IACvB,CAAC;SAAM,CAAC;QACJ,OAAO,CAAC,IAAI,CAAC,IAAI,SAAS,6CAA6C,GAAG,eAAe,QAAQ,IAAI,CAAC,CAAC;QACvG,OAAO,SAAS,CAAC;IACrB,CAAC;AACL,CAAC"}
@@ -13,6 +13,7 @@
13
13
  * @author MemberJunction.com
14
14
  */
15
15
  import { RealtimeToolDefinition } from './baseRealtime.js';
16
+ import type { RealtimeTrackDescriptor } from './realtimeTracks.js';
16
17
  /**
17
18
  * Why an agent session was closed — the server-side channel plugin's view of the session-close
18
19
  * provenance. Mirrors the `MJ: AI Agent Sessions.CloseReason` value list (`SessionCloseReason` in
@@ -183,6 +184,38 @@ export declare abstract class BaseRealtimeChannelServer {
183
184
  * @returns The channel's server-executed tool definitions (possibly empty).
184
185
  */
185
186
  GetServerToolDefinitions(): RealtimeToolDefinition[];
187
+ /**
188
+ * Media tracks this channel can SOURCE — samples flowing from the channel's surface INTO the
189
+ * model. Default `[]`: a channel contributes no media unless it says so.
190
+ *
191
+ * **This is where the media plane and the semantic plane meet.** A channel remains a tool
192
+ * surface; declaring a sourced track additionally lets the model *watch* that surface live. The
193
+ * whiteboard sourcing inbound video is what lets an agent see what it draws and correct itself
194
+ * mid-stroke, and see what the user draws directly rather than through a described diff. The
195
+ * remote browser sourcing inbound video is what lets the model watch the page continuously while
196
+ * the agent still acts through tools — a different quality of control, not a faster version of
197
+ * polling screenshots.
198
+ *
199
+ * Declared in CODE rather than metadata for the same reason {@link GetServerToolDefinitions} is:
200
+ * whether a surface can produce frames is a property of the implementation, not a deployment
201
+ * choice. Whether it *should* on a given session is negotiation
202
+ * (`ModelConfiguration.Realtime.RequestedTracks` intersected with the model's support), and a
203
+ * model with no video track simply falls back to the channel's tool-only behaviour.
204
+ *
205
+ * @returns Track descriptors this channel can produce (possibly empty).
206
+ */
207
+ GetSourcedTracks(): readonly RealtimeTrackDescriptor[];
208
+ /**
209
+ * Media tracks this channel can SINK — samples flowing from the model OUT to the channel's
210
+ * surface. Default `[]`.
211
+ *
212
+ * Nothing in play emits non-audio outbound media yet; the contract admits it because direction is
213
+ * a property of a track rather than part of its type. An avatar is the obvious first case: a
214
+ * channel owning a render surface that sinks outbound video.
215
+ *
216
+ * @returns Track descriptors this channel can consume (possibly empty).
217
+ */
218
+ GetSunkTracks(): readonly RealtimeTrackDescriptor[];
186
219
  /**
187
220
  * Executes ONE of this channel's server-side tools (a tool whose name starts with
188
221
  * {@link ToolNamePrefix}) and returns the result fed back to the model as the `tool_response`.
@@ -1 +1 @@
1
- {"version":3,"file":"baseRealtimeChannelServer.d.ts","sourceRoot":"","sources":["../../src/generic/baseRealtimeChannelServer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,EAAE,sBAAsB,EAAE,MAAM,gBAAgB,CAAC;AAExD;;;;;;GAMG;AACH,MAAM,MAAM,0BAA0B,GAAG,UAAU,GAAG,SAAS,GAAG,UAAU,GAAG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AC3C;;;OAGG;IACH,SAAS,CAAC,OAAO,EAAE,4BAA4B,GAAG,IAAI,CAAQ;IAE9D;;;;OAIG;IACH,aAAoB,WAAW,IAAI,MAAM,CAAC;IAE1C;;;;;;;;OAQG;IACH,IAAW,cAAc,IAAI,MAAM,CAElC;IAED;;;;;;;;;;;;OAYG;IACI,wBAAwB,IAAI,sBAAsB,EAAE;IAI3D;;;;;;;;;;;;;;;;;;;OAmBG;IACI,gBAAgB,IAAI,SAAS,uBAAuB,EAAE;IAI7D;;;;;;;;;OASG;IACI,aAAa,IAAI,SAAS,uBAAuB,EAAE;IAI1D;;;;;;;;;;;;;OAaG;IACI,iBAAiB,CAAC,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,GAAG,uBAAuB,GAAG,OAAO,CAAC,uBAAuB,CAAC;IAIxH;;;OAGG;IACI,UAAU,CAAC,GAAG,EAAE,4BAA4B,GAAG,IAAI;IAK1D;;;OAGG;IACH,SAAS,CAAC,YAAY,IAAI,IAAI;IAI9B;;;;OAIG;IACU,gBAAgB,IAAI,OAAO,CAAC,IAAI,CAAC;IAI9C;;;;;;;;;;;;OAYG;IACU,kBAAkB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC;IAI1E;;;;;;;;OAQG;IACU,eAAe,CAAC,WAAW,EAAE,0BAA0B,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAI3F;;;;OAIG;IACI,OAAO,IAAI,IAAI;CAGzB"}
@@ -113,6 +113,42 @@ export class BaseRealtimeChannelServer {
113
113
  GetServerToolDefinitions() {
114
114
  return [];
115
115
  }
116
+ /**
117
+ * Media tracks this channel can SOURCE — samples flowing from the channel's surface INTO the
118
+ * model. Default `[]`: a channel contributes no media unless it says so.
119
+ *
120
+ * **This is where the media plane and the semantic plane meet.** A channel remains a tool
121
+ * surface; declaring a sourced track additionally lets the model *watch* that surface live. The
122
+ * whiteboard sourcing inbound video is what lets an agent see what it draws and correct itself
123
+ * mid-stroke, and see what the user draws directly rather than through a described diff. The
124
+ * remote browser sourcing inbound video is what lets the model watch the page continuously while
125
+ * the agent still acts through tools — a different quality of control, not a faster version of
126
+ * polling screenshots.
127
+ *
128
+ * Declared in CODE rather than metadata for the same reason {@link GetServerToolDefinitions} is:
129
+ * whether a surface can produce frames is a property of the implementation, not a deployment
130
+ * choice. Whether it *should* on a given session is negotiation
131
+ * (`ModelConfiguration.Realtime.RequestedTracks` intersected with the model's support), and a
132
+ * model with no video track simply falls back to the channel's tool-only behaviour.
133
+ *
134
+ * @returns Track descriptors this channel can produce (possibly empty).
135
+ */
136
+ GetSourcedTracks() {
137
+ return [];
138
+ }
139
+ /**
140
+ * Media tracks this channel can SINK — samples flowing from the model OUT to the channel's
141
+ * surface. Default `[]`.
142
+ *
143
+ * Nothing in play emits non-audio outbound media yet; the contract admits it because direction is
144
+ * a property of a track rather than part of its type. An avatar is the obvious first case: a
145
+ * channel owning a render surface that sinks outbound video.
146
+ *
147
+ * @returns Track descriptors this channel can consume (possibly empty).
148
+ */
149
+ GetSunkTracks() {
150
+ return [];
151
+ }
116
152
  /**
117
153
  * Executes ONE of this channel's server-side tools (a tool whose name starts with
118
154
  * {@link ToolNamePrefix}) and returns the result fed back to the model as the `tool_response`.
@@ -1 +1 @@
1
- {"version":3,"file":"baseRealtimeChannelServer.js","sourceRoot":"","sources":["../../src/generic/baseRealtimeChannelServer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAkFH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AACH,MAAM,OAAgB,yBAAyB;IAA/C;QACI;;;WAGG;QACO,YAAO,GAAwC,IAAI,CAAC;IAyHlE,CAAC;IAhHG;;;;;;;;OAQG;IACH,IAAW,cAAc;QACrB,OAAO,EAAE,CAAC;IACd,CAAC;IAED;;;;;;;;;;;;OAYG;IACI,wBAAwB;QAC3B,OAAO,EAAE,CAAC;IACd,CAAC;IAED;;;;;;;;;;;;;OAaG;IACI,iBAAiB,CAAC,QAAgB,EAAE,QAAgB;QACvD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,gBAAgB,QAAQ,6BAA6B,IAAI,CAAC,WAAW,wCAAwC,EAAE,CAAC;IACrJ,CAAC;IAED;;;OAGG;IACI,UAAU,CAAC,GAAiC;QAC/C,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC;QACnB,IAAI,CAAC,YAAY,EAAE,CAAC;IACxB,CAAC;IAED;;;OAGG;IACO,YAAY;QAClB,iCAAiC;IACrC,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,gBAAgB;QACzB,0CAA0C;IAC9C,CAAC;IAED;;;;;;;;;;;;OAYG;IACI,KAAK,CAAC,kBAAkB,CAAC,SAAiB;QAC7C,OAAO,IAAI,CAAC,CAAC,kDAAkD;IACnE,CAAC;IAED;;;;;;;;OAQG;IACI,KAAK,CAAC,eAAe,CAAC,WAA8C;QACvE,0CAA0C;IAC9C,CAAC;IAED;;;;OAIG;IACI,OAAO;QACV,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACxB,CAAC;CACJ"}
1
+ {"version":3,"file":"baseRealtimeChannelServer.js","sourceRoot":"","sources":["../../src/generic/baseRealtimeChannelServer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAmFH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AACH,MAAM,OAAgB,yBAAyB;IAA/C;QACI;;;WAGG;QACO,YAAO,GAAwC,IAAI,CAAC;IA+JlE,CAAC;IAtJG;;;;;;;;OAQG;IACH,IAAW,cAAc;QACrB,OAAO,EAAE,CAAC;IACd,CAAC;IAED;;;;;;;;;;;;OAYG;IACI,wBAAwB;QAC3B,OAAO,EAAE,CAAC;IACd,CAAC;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACI,gBAAgB;QACnB,OAAO,EAAE,CAAC;IACd,CAAC;IAED;;;;;;;;;OASG;IACI,aAAa;QAChB,OAAO,EAAE,CAAC;IACd,CAAC;IAED;;;;;;;;;;;;;OAaG;IACI,iBAAiB,CAAC,QAAgB,EAAE,QAAgB;QACvD,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,gBAAgB,QAAQ,6BAA6B,IAAI,CAAC,WAAW,wCAAwC,EAAE,CAAC;IACrJ,CAAC;IAED;;;OAGG;IACI,UAAU,CAAC,GAAiC;QAC/C,IAAI,CAAC,OAAO,GAAG,GAAG,CAAC;QACnB,IAAI,CAAC,YAAY,EAAE,CAAC;IACxB,CAAC;IAED;;;OAGG;IACO,YAAY;QAClB,iCAAiC;IACrC,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,gBAAgB;QACzB,0CAA0C;IAC9C,CAAC;IAED;;;;;;;;;;;;OAYG;IACI,KAAK,CAAC,kBAAkB,CAAC,SAAiB;QAC7C,OAAO,IAAI,CAAC,CAAC,kDAAkD;IACnE,CAAC;IAED;;;;;;;;OAQG;IACI,KAAK,CAAC,eAAe,CAAC,WAA8C;QACvE,0CAA0C;IAC9C,CAAC;IAED;;;;OAIG;IACI,OAAO;QACV,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;IACxB,CAAC;CACJ"}
@@ -33,6 +33,7 @@
33
33
  * New capability knobs go in the bag — do not add a capability column per knob. A knob graduates to
34
34
  * a real column when it needs a foreign key or becomes a first-class platform concept.
35
35
  */
36
+ import type { RealtimeTrackDescriptor } from './realtimeTracks.js';
36
37
  /**
37
38
  * MJ-normalized turn-detection mode vocabulary — provider-neutral by design so a shared model
38
39
  * catalog is safe on every provider:
@@ -62,7 +63,24 @@ export interface RealtimeTurnDetectionSettings {
62
63
  Threshold?: number;
63
64
  /** Server-VAD trailing-silence duration in ms; ignored by profiles without a mapping. */
64
65
  SilenceDurationMs?: number;
66
+ /**
67
+ * What a turn's input is allowed to include. Distinct from DETECTION (when a turn ends):
68
+ * coverage is WHAT rides in it.
69
+ *
70
+ * Gemini 3.8 Live defaults to `audioActivityAndAllVideo`, which ships every video frame to the
71
+ * model by default — billed and consuming context. Declaring coverage explicitly keeps that a
72
+ * decision rather than an inherited default. Profiles without a mapping ignore it.
73
+ */
74
+ Coverage?: RealtimeTurnCoverage;
65
75
  }
76
+ /**
77
+ * What a turn carries as input.
78
+ *
79
+ * - `'audioActivityOnly'` — audio activity only; video frames are sent deliberately, not by default.
80
+ * - `'audioActivityAndAllVideo'` — audio activity plus every video frame (Gemini 3.8 Live's own
81
+ * default, `TURN_INCLUDES_AUDIO_ACTIVITY_AND_ALL_VIDEO`).
82
+ */
83
+ export type RealtimeTurnCoverage = 'audioActivityOnly' | 'audioActivityAndAllVideo';
66
84
  /**
67
85
  * Which plane handles reasoning during a realtime session:
68
86
  * - `'local'` — the application/agent loop handles reasoning, Actions, and tool results (MJ default).
@@ -90,6 +108,15 @@ export interface RealtimeReasoningSettings {
90
108
  Plane?: RealtimeReasoningPlane;
91
109
  /** Remote reasoning target when Plane is 'remote'. */
92
110
  Remote?: RealtimeRemoteReasoning;
111
+ /**
112
+ * Ask the model to emit human-readable summaries of its own reasoning as it works
113
+ * (Gemini `thinkingConfig.includeThoughts`).
114
+ *
115
+ * These are NOT assistant speech — they are progress narration authored by the model, and
116
+ * belong on the narration transcript path rather than the spoken-response path. Absent =
117
+ * off; a profile with no mapping ignores it.
118
+ */
119
+ IncludeThoughtSummaries?: boolean;
93
120
  }
94
121
  /** The `Realtime` section — knobs the realtime drivers consume. */
95
122
  export interface RealtimeConfigurationSettings {
@@ -104,6 +131,65 @@ export interface RealtimeConfigurationSettings {
104
131
  * Absent defaults to 'local'.
105
132
  */
106
133
  Reasoning?: RealtimeReasoningSettings;
134
+ /** Tool-execution semantics this model permits. Absent = the profile's own defaults. */
135
+ Tooling?: RealtimeToolingSettings;
136
+ /**
137
+ * Media tracks this session asks the model to establish, beyond audio.
138
+ *
139
+ * **The request side of negotiation, and the reason "video off by default" is structural rather
140
+ * than a default value someone can forget.** Absent or empty establishes audio only; a video
141
+ * track exists only because something asked for it. That matters concretely: Gemini 3.8 Live's
142
+ * own turn coverage defaults to including every video frame, billed, so a design where omission
143
+ * means "inherit the provider" would ship a silent cost.
144
+ *
145
+ * Requests are intersected with the model's `SupportedInboundTracks` /
146
+ * `SupportedOutboundTracks`; anything unsupported resolves to `'unsupported'` so the caller
147
+ * falls back deliberately.
148
+ */
149
+ RequestedTracks?: readonly RealtimeTrackDescriptor[];
150
+ /**
151
+ * Which server signal means "the session has gone idle and deferred work may be flushed".
152
+ *
153
+ * Absent = `'turnComplete'`, which is every model MJ spoke to before Gemini 3.8 Live
154
+ * Extended Thinking. On a model with asynchronous reasoning, `turnComplete` arrives while the
155
+ * server is STILL reasoning and still issuing tool calls, so treating it as idle drains queued
156
+ * work at the wrong moment; those models report `'interactionStatus'` instead.
157
+ */
158
+ IdleSignal?: RealtimeIdleSignal;
159
+ }
160
+ /**
161
+ * Which server signal a driver should treat as "idle".
162
+ *
163
+ * - `'turnComplete'` — the turn-terminal frame also means the server is done (the classic case).
164
+ * - `'interactionStatus'` — a separate status field carries idleness because `turnComplete` does
165
+ * NOT imply it (Gemini `interaction_status`: `IN_PROGRESS` vs `IDLE`).
166
+ */
167
+ export type RealtimeIdleSignal = 'turnComplete' | 'interactionStatus';
168
+ /**
169
+ * Tool-execution semantics, declared per model because the same Live API permits different
170
+ * combinations per model rather than per provider.
171
+ *
172
+ * Both flags are capability DECLARATIONS, not requests: they say what the model will accept, so a
173
+ * driver can refuse locally with a clear message instead of emitting a frame the server rejects.
174
+ */
175
+ export interface RealtimeToolingSettings {
176
+ /**
177
+ * Whether synchronous blocking tool execution is legal.
178
+ *
179
+ * `false` on models that only accept asynchronous execution — Gemini 3.8 Live Extended
180
+ * Thinking returns a HARD ERROR for blocking mode, so this must be caught before the frame is
181
+ * sent. Absent = permitted (the historical default).
182
+ */
183
+ SupportsBlockingExecution?: boolean;
184
+ /**
185
+ * Whether per-function scheduling hints are legal (Gemini `SILENT` / `WHEN_IDLE` /
186
+ * `INTERRUPTED`). Absent = not supported; only declare `true` where the model documents it.
187
+ */
188
+ SupportsScheduling?: boolean;
189
+ /**
190
+ * Preferred function calling behavior ('BLOCKING' | 'NON_BLOCKING').
191
+ */
192
+ Behavior?: 'BLOCKING' | 'NON_BLOCKING';
107
193
  }
108
194
  /**
109
195
  * The `LLM` section — knobs the LLM drivers and the prompt runner consume at call time.
@@ -1 +1 @@
1
- {"version":3,"file":"modelConfiguration.d.ts","sourceRoot":"","sources":["../../src/generic/modelConfiguration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAMH;;;;;;;;;;;;;;GAcG;AACH,MAAM,MAAM,yBAAyB,GAAG,SAAS,GAAG,WAAW,GAAG,aAAa,GAAG,QAAQ,CAAC;AAE3F;;;GAGG;AACH,MAAM,WAAW,6BAA6B;IAC1C,iDAAiD;IACjD,IAAI,CAAC,EAAE,yBAAyB,CAAC;IACjC,+FAA+F;IAC/F,SAAS,CAAC,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;IACpC,oFAAoF;IACpF,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,yFAAyF;IACzF,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC9B;AAED;;;;GAIG;AACH,MAAM,MAAM,sBAAsB,GAAG,OAAO,GAAG,QAAQ,CAAC;AAExD;;GAEG;AACH,MAAM,WAAW,uBAAuB;IACpC,6FAA6F;IAC7F,IAAI,CAAC,EAAE,OAAO,GAAG,aAAa,CAAC;IAC/B,gFAAgF;IAChF,GAAG,CAAC,EAAE,MAAM,CAAC;IACb,mDAAmD;IACnD,MAAM,CAAC,EAAE,MAAM,GAAG,SAAS,GAAG,KAAK,GAAG,QAAQ,GAAG,MAAM,GAAG,OAAO,CAAC;IAClE,2DAA2D;IAC3D,eAAe,CAAC,EAAE,MAAM,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,MAAM,iCAAiC,GAAG,6BAA6B,CAAC;AAE9E,4FAA4F;AAC5F,MAAM,MAAM,4BAA4B,GAAG,wBAAwB,CAAC;AACpE;;;;;;;GAOG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,oBAAoB,GAAG,IAAI,CAepG;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,kCAAkC,CAC9C,GAAG,MAAM,EAAE,KAAK,CAAC,oBAAoB,GAAG,IAAI,GAAG,SAAS,CAAC,GAC1D,oBAAoB,GAAG,IAAI,CAS7B"}
@@ -48,9 +48,14 @@ export function ParseModelConfiguration(json) {
48
48
  }
49
49
  try {
50
50
  const parsed = JSON.parse(json);
51
- return IsPlainObject(parsed) ? parsed : null;
51
+ if (IsPlainObject(parsed)) {
52
+ return parsed;
53
+ }
54
+ console.warn('[ParseModelConfiguration] Model configuration JSON is not a plain object; skipping layer.');
55
+ return null;
52
56
  }
53
- catch {
57
+ catch (err) {
58
+ console.warn('[ParseModelConfiguration] Failed to parse ModelConfiguration JSON; skipping malformed layer:', err);
54
59
  return null;
55
60
  }
56
61
  }
@@ -1 +1 @@
1
- {"version":3,"file":"modelConfiguration.js","sourceRoot":"","sources":["../../src/generic/modelConfiguration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAkCG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAgMvD;;;;;;;GAOG;AACH,MAAM,UAAU,uBAAuB,CAAC,IAA+B;IACnE,IAAI,OAAO,IAAI,KAAK,QAAQ,IAAI,IAAI,CAAC,IAAI,EAAE,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvD,OAAO,IAAI,CAAC;IAChB,CAAC;IACD,IAAI,CAAC;QACD,MAAM,MAAM,GAAY,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;QACzC,OAAO,aAAa,CAAC,MAAM,CA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;QACb,CAAC;QACD,SAAS,CAAC,MAAM,EAAE,KAA8B,CAAC,CAAC;IACtD,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAE,MAA+B,CAAC,CAAC,CAAC,IAAI,CAAC;AACpF,CAAC;AAED,uGAAuG;AACvG,SAAS,SAAS,CAAC,MAAkB,EAAE,MAAkB;IACrD,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,EAAE,CAAC;QACpC,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QAC7B,IAAI,QAAQ,KAAK,SAAS,EAAE,CAAC;YACzB,SAAS;QACb,CAAC;QACD,MAAM,QAAQ,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;QAC7B,IAAI,aAAa,CAAC,QAAQ,CAAC,IAAI,aAAa,CAAC,QAAQ,CAAC,EAAE,CAAC;YACrD,SAAS,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;QAClC,CAAC;aAAM,IAAI,aAAa,CAAC,QAAQ,CAAC,EAAE,CAAC;YACjC,MAAM,IAAI,GAAe,EAAE,CAAC;YAC5B,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;YAC1B,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;QACvB,CAAC;aAAM,IAAI,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE,CAAC;YACjC,MAAM,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC,KAAK,EAAiB,CAAC;QAClD,CAAC;aAAM,CAAC;YACJ,MAAM,CAAC,GAAG,CAAC,GAAG,QAAQ,CAAC;QAC3B,CAAC;IACL,CAAC;AACL,CAAC"}
@@ -0,0 +1,213 @@
1
+ /**
2
+ * @fileoverview The realtime MEDIA PLANE — tracks and an open modality vocabulary.
3
+ *
4
+ * MJ's realtime architecture has three planes, and until now only two were named:
5
+ *
6
+ * - **Semantic** — discrete request/response against a surface. Modelled: interactive channels
7
+ * (`BaseRealtimeChannelServer`), whose entire surface is tool definitions plus session state.
8
+ * - **Reasoning** — who thinks and how hard. Modelled: {@link import('./modelConfiguration.js').RealtimeReasoningPlane}.
9
+ * - **Media** — continuous, time-sequenced samples bound to a model session. This file.
10
+ *
11
+ * The media plane was previously implicit: every driver hardcoded audio in and audio out, and
12
+ * nothing named the concept. That is why a model able to accept live video had nowhere to put it,
13
+ * and why a model that generates video (an avatar) would have had nowhere either.
14
+ *
15
+ * **Tracks and channels compose rather than compete.** A track transports samples; a channel is a
16
+ * surface that may SOURCE or SINK one. The whiteboard stays a pure tool surface; a screen-share
17
+ * channel sources an inbound video track; an avatar channel sinks an outbound one; a remote-browser
18
+ * channel can source inbound video so the model watches the page continuously while the agent still
19
+ * acts through tools.
20
+ *
21
+ * Design rationale, including the cases this was checked against: `plans/realtime/media-tracks-and-modalities.md`.
22
+ *
23
+ * @module @memberjunction/ai
24
+ * @author MemberJunction.com
25
+ */
26
+ import { BaseSingleton } from '@memberjunction/global';
27
+ /**
28
+ * Which way samples flow on a track, relative to the model.
29
+ *
30
+ * Direction is a PROPERTY rather than part of the type because modalities are not one-directional:
31
+ * audio is already both, and video is becoming both. Separate `InboundVideo` / `OutboundVideo` types
32
+ * would double every future modality and encode a distinction that does not hold.
33
+ */
34
+ export type RealtimeTrackDirection = 'inbound' | 'outbound';
35
+ /**
36
+ * The modalities MJ itself reasons about — cost, consent, and whether a transcript means anything.
37
+ *
38
+ * Deliberately small. Everything outside this set is still transportable (see
39
+ * {@link RealtimeModalityKey}); it simply gets no special handling.
40
+ */
41
+ export type RealtimeWellKnownModality = 'audio' | 'video' | 'image' | 'text';
42
+ /**
43
+ * A modality key: one of the well-known values, or any registered string.
44
+ *
45
+ * **Deliberately open.** A closed union would make every future modality a `@memberjunction/ai`
46
+ * release plus a coordinated upgrade — pose and hand tracking for AR and accessibility, telemetry
47
+ * for robotics, realtime music, biosignals, haptics, depth. This is the same shape as
48
+ * `RealtimeTurnDetectionMode`'s `'native'`: a known core with a deliberate open door.
49
+ *
50
+ * The `string & {}` intersection is the TypeScript idiom for "any string, but keep autocomplete for
51
+ * the known ones" — it is not a widening to `string` and it is not `any`.
52
+ */
53
+ export type RealtimeModalityKey = RealtimeWellKnownModality | (string & {});
54
+ /**
55
+ * How a track's usage is metered, so cost is a declared property and never a surprise.
56
+ *
57
+ * A LIST rather than an enum for the same reason `RealtimeSessionCapabilities.UsageBases` is one:
58
+ * a provider can meter a single stream in more than one basis at once.
59
+ */
60
+ export type RealtimeTrackUsageBasis = 'tokens' | 'seconds' | 'frames' | 'bytes';
61
+ /**
62
+ * What a track IS — the negotiable description of one directional stream of one modality.
63
+ *
64
+ * Used in three roles, which is why every field past the first two is optional: a model DECLARES
65
+ * what it supports, a session REQUESTS what it wants, and the driver REPORTS what it established.
66
+ */
67
+ export interface RealtimeTrackDescriptor {
68
+ /** The modality this track carries. */
69
+ Modality: RealtimeModalityKey;
70
+ /** Which way samples flow, relative to the model. */
71
+ Direction: RealtimeTrackDirection;
72
+ /**
73
+ * Wire encoding, where it is negotiable or worth pinning — `'audio/pcm;rate=16000'`,
74
+ * `'image/jpeg'`, `'video/vp8'`. Absent on a request means "the profile's default".
75
+ */
76
+ Encoding?: string;
77
+ /** Sample or frame cadence where meaningful — fps for video, Hz for audio. */
78
+ Rate?: number;
79
+ /** How this track is metered. Absent means the session's own basis applies. */
80
+ UsageBasis?: readonly RealtimeTrackUsageBasis[];
81
+ /**
82
+ * Whether establishing this track needs an explicit human grant — camera, screen capture,
83
+ * microphone, biosignals.
84
+ *
85
+ * A track property rather than per-modality special-casing in the UI, so a host can prompt
86
+ * generically and the audit trail is uniform across modalities we have not invented yet.
87
+ */
88
+ RequiresConsent?: boolean;
89
+ /**
90
+ * Whether this track is required for the session to proceed (`true`) or optional/best-effort (`false`).
91
+ * When optional, failure to establish the track does not terminate the session.
92
+ */
93
+ Required?: boolean;
94
+ }
95
+ /**
96
+ * Canonical track descriptor for channel-sourced inbound video (e.g. Whiteboard, Remote Browser).
97
+ * Encoded as JPEG, 1 fps rate ceiling, billed on tokens + frames, and requires no human OS consent grant.
98
+ */
99
+ export declare const CHANNEL_INBOUND_VIDEO_TRACK: RealtimeTrackDescriptor;
100
+ /**
101
+ * Baseline audio tracks for realtime voice sessions: inbound user audio and outbound model speech.
102
+ * Represents the fundamental floor of every realtime voice session.
103
+ */
104
+ export declare const DEFAULT_REALTIME_AUDIO_TRACKS: readonly RealtimeTrackDescriptor[];
105
+ /**
106
+ * Where a track is in its lifecycle.
107
+ *
108
+ * `'denied'` and `'unsupported'` are distinct on purpose: the first is a human refusing consent
109
+ * (recoverable, re-askable, and a UX event), the second is the model not supporting the modality
110
+ * (permanent for this session, and the trigger for falling back to a non-track path). Collapsing
111
+ * them would make "ask again" indistinguishable from "never ask".
112
+ */
113
+ export type RealtimeTrackState = 'requested' | 'establishing' | 'live' | 'ended' | 'denied' | 'unsupported';
114
+ /** A track as it exists on a live session: what was asked for, and where it actually got to. */
115
+ export interface RealtimeTrack {
116
+ /** Stable id for this track within the session, so state changes can be correlated. */
117
+ TrackID: string;
118
+ /**
119
+ * What was requested, refined with what was actually negotiated once `'live'`.
120
+ *
121
+ * **Refinement currently covers `Rate` only** — `ResolveRequestedTracks` carries the more
122
+ * restrictive of the requested and supported rates. Every other field (`Encoding`,
123
+ * `UsageBasis`, `RequiresConsent`, …) is the REQUESTED value passed through untouched, so do
124
+ * not read one of those off a live track expecting the model's answer. Widen the refinement
125
+ * in `ResolveRequestedTracks` before relying on another field here.
126
+ */
127
+ Descriptor: RealtimeTrackDescriptor;
128
+ /** Current lifecycle state. */
129
+ State: RealtimeTrackState;
130
+ /**
131
+ * Why the track is in a terminal state it did not ask for (`'denied'`, `'unsupported'`, an
132
+ * error-driven `'ended'`). Never swallowed — a track that fails silently looks to the host
133
+ * exactly like a track nobody asked for.
134
+ */
135
+ Reason?: string;
136
+ }
137
+ /**
138
+ * Descriptor for a registered modality — what MJ knows about a modality beyond its key.
139
+ *
140
+ * Registration is how a modality becomes more than an opaque string: it gains a default encoding,
141
+ * a consent requirement, and a metering basis that hosts and cost accounting can rely on without
142
+ * hardcoding a modality list of their own.
143
+ */
144
+ export interface RealtimeModalityDescriptor {
145
+ /** The key this descriptor describes. */
146
+ Key: RealtimeModalityKey;
147
+ /** Human-readable name for UI and logs. */
148
+ DisplayName: string;
149
+ /** Directions this modality is meaningful in. */
150
+ Directions: readonly RealtimeTrackDirection[];
151
+ /** Default wire encoding when a request does not pin one. */
152
+ DefaultEncoding?: string;
153
+ /** Whether tracks of this modality require an explicit human grant by default. */
154
+ RequiresConsent?: boolean;
155
+ /** Default metering basis for tracks of this modality. */
156
+ DefaultUsageBasis?: readonly RealtimeTrackUsageBasis[];
157
+ }
158
+ /**
159
+ * The modality registry — an open vocabulary with a known core.
160
+ *
161
+ * A **code** registry rather than a database table, deliberately: the well-known keys plus every
162
+ * modality we can currently name are covered without one, and an unregistered key still transports.
163
+ * A table earns itself the day a customer must add a modality without shipping a release; at that
164
+ * point it is purely additive (see `plans/realtime/gemini-3-8-live.md` §9.1).
165
+ *
166
+ * `BaseSingleton` rather than a `static _instance` so a bundler that loads this module twice does
167
+ * not produce two registries with divergent contents.
168
+ */
169
+ export declare class RealtimeModalityRegistry extends BaseSingleton<RealtimeModalityRegistry> {
170
+ private _modalities;
171
+ protected constructor();
172
+ static get Instance(): RealtimeModalityRegistry;
173
+ /**
174
+ * Registers (or replaces) a modality descriptor.
175
+ *
176
+ * Last registration wins, matching `MJGlobal.ClassFactory`'s own convention, so a deployment can
177
+ * refine a well-known modality — raising `RequiresConsent` on `video` for a stricter
178
+ * jurisdiction, say — without a code change here.
179
+ */
180
+ Register(descriptor: RealtimeModalityDescriptor): void;
181
+ /**
182
+ * Looks a modality up by key, case- and whitespace-insensitively.
183
+ *
184
+ * Returns `undefined` for an unregistered key rather than throwing: an unknown modality is
185
+ * transportable-but-unreasoned-about by design, so callers fall back to the descriptor on the
186
+ * track itself.
187
+ */
188
+ Get(key: RealtimeModalityKey): RealtimeModalityDescriptor | undefined;
189
+ /** Whether a key has a registered descriptor. */
190
+ IsRegistered(key: RealtimeModalityKey): boolean;
191
+ /** Every registered descriptor, for UI and diagnostics. */
192
+ get All(): readonly RealtimeModalityDescriptor[];
193
+ /** Seeds the modalities MJ reasons about. */
194
+ private registerWellKnown;
195
+ }
196
+ /**
197
+ * Resolves the set of tracks to establish: what the caller asked for, intersected with what the
198
+ * model supports.
199
+ *
200
+ * **This function is why "video off by default" is structural rather than a default value.** An
201
+ * unrequested track is never established, so omitting configuration cannot silently inherit a
202
+ * provider default — which matters concretely because Gemini 3.8 Live's own turn coverage defaults
203
+ * to including every video frame, billed.
204
+ *
205
+ * A requested track the model does not support resolves to `'unsupported'` rather than being
206
+ * dropped, so the caller can fall back deliberately instead of wondering why no frames arrive.
207
+ *
208
+ * @param requested Tracks the session asked for. Empty or absent yields an empty result.
209
+ * @param supported Tracks the model declares, from `RealtimeSessionCapabilities`.
210
+ * @param makeTrackID Id factory, injected so callers control id shape and tests stay deterministic.
211
+ */
212
+ export declare function ResolveRequestedTracks(requested: readonly RealtimeTrackDescriptor[] | undefined, supported: readonly RealtimeTrackDescriptor[] | undefined, makeTrackID: (descriptor: RealtimeTrackDescriptor, index: number) => string): RealtimeTrack[];
213
+ //# sourceMappingURL=realtimeTracks.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"realtimeTracks.d.ts","sourceRoot":"","sources":["../../src/generic/realtimeTracks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAEvD;;;;;;GAMG;AACH,MAAM,MAAM,sBAAsB,GAAG,SAAS,GAAG,UAAU,CAAC;AAE5D;;;;;GAKG;AACH,MAAM,MAAM,yBAAyB,GAAG,OAAO,GAAG,OAAO,GAAG,OAAO,GAAG,MAAM,CAAC;AAE7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C,WAAW,EAAE,MAAM,CAAC;IAEpB,iDAAiD;IACjD,UAAU,EAAE,SAAS,sBAAsB,EAAE,CAAC;IAE9C,6DAA6D;IAC7D,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB,kFAAkF;IAClF,eAAe,CAAC,EAAE,OAAO,CAAC;IAE1B,0DAA0D;IAC1D,iBAAiB,CAAC,EAAE,SAAS,uBAAuB,EAAE,CAAC;CAC1D;AAED;;;;;;;;;;GAUG;AACH,qBAAa,wBAAyB,SAAQ,aAAa,CAAC,wBAAwB,CAAC;IACjF,OAAO,CAAC,WAAW,CAAiD;IAEpE,SAAS;IAKT,WAAkB,QAAQ,IAAI,wBAAwB,CAErD;IAED;;;;;;OAMG;IACI,QAAQ,CAAC,UAAU,EAAE,0BAA0B,GAAG,IAAI;IAO7D;;;;;;OAMG;IACI,GAAG,CAAC,GAAG,EAAE,mBAAmB,GAAG,0BAA0B,GAAG,SAAS;IAI5E,iDAAiD;IAC1C,YAAY,CAAC,GAAG,EAAE,mBAAmB,GAAG,OAAO;IAItD,2DAA2D;IAC3D,IAAW,GAAG,IAAI,SAAS,0BAA0B,EAAE,CAEtD;IAED,6CAA6C;IAC7C,OAAO,CAAC,iBAAiB;CA8B5B;AAED;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,sBAAsB,CAClC,SAAS,EAAE,SAAS,uBAAuB,EAAE,GAAG,SAAS,EACzD,SAAS,EAAE,SAAS,uBAAuB,EAAE,GAAG,SAAS,EACzD,WAAW,EAAE,CAAC,UAAU,EAAE,uBAAuB,EAAE,KAAK,EAAE,MAAM,KAAK,MAAM,GAC5E,aAAa,EAAE,CAkCjB"}
@@ -0,0 +1,178 @@
1
+ /**
2
+ * @fileoverview The realtime MEDIA PLANE — tracks and an open modality vocabulary.
3
+ *
4
+ * MJ's realtime architecture has three planes, and until now only two were named:
5
+ *
6
+ * - **Semantic** — discrete request/response against a surface. Modelled: interactive channels
7
+ * (`BaseRealtimeChannelServer`), whose entire surface is tool definitions plus session state.
8
+ * - **Reasoning** — who thinks and how hard. Modelled: {@link import('./modelConfiguration.js').RealtimeReasoningPlane}.
9
+ * - **Media** — continuous, time-sequenced samples bound to a model session. This file.
10
+ *
11
+ * The media plane was previously implicit: every driver hardcoded audio in and audio out, and
12
+ * nothing named the concept. That is why a model able to accept live video had nowhere to put it,
13
+ * and why a model that generates video (an avatar) would have had nowhere either.
14
+ *
15
+ * **Tracks and channels compose rather than compete.** A track transports samples; a channel is a
16
+ * surface that may SOURCE or SINK one. The whiteboard stays a pure tool surface; a screen-share
17
+ * channel sources an inbound video track; an avatar channel sinks an outbound one; a remote-browser
18
+ * channel can source inbound video so the model watches the page continuously while the agent still
19
+ * acts through tools.
20
+ *
21
+ * Design rationale, including the cases this was checked against: `plans/realtime/media-tracks-and-modalities.md`.
22
+ *
23
+ * @module @memberjunction/ai
24
+ * @author MemberJunction.com
25
+ */
26
+ import { BaseSingleton } from '@memberjunction/global';
27
+ /**
28
+ * Canonical track descriptor for channel-sourced inbound video (e.g. Whiteboard, Remote Browser).
29
+ * Encoded as JPEG, 1 fps rate ceiling, billed on tokens + frames, and requires no human OS consent grant.
30
+ */
31
+ export const CHANNEL_INBOUND_VIDEO_TRACK = Object.freeze({
32
+ Modality: 'video',
33
+ Direction: 'inbound',
34
+ Encoding: 'image/jpeg',
35
+ Rate: 1,
36
+ UsageBasis: ['tokens', 'frames'],
37
+ RequiresConsent: false,
38
+ });
39
+ /**
40
+ * Baseline audio tracks for realtime voice sessions: inbound user audio and outbound model speech.
41
+ * Represents the fundamental floor of every realtime voice session.
42
+ */
43
+ export const DEFAULT_REALTIME_AUDIO_TRACKS = Object.freeze([
44
+ Object.freeze({ Modality: 'audio', Direction: 'inbound' }),
45
+ Object.freeze({ Modality: 'audio', Direction: 'outbound' }),
46
+ ]);
47
+ /**
48
+ * The modality registry — an open vocabulary with a known core.
49
+ *
50
+ * A **code** registry rather than a database table, deliberately: the well-known keys plus every
51
+ * modality we can currently name are covered without one, and an unregistered key still transports.
52
+ * A table earns itself the day a customer must add a modality without shipping a release; at that
53
+ * point it is purely additive (see `plans/realtime/gemini-3-8-live.md` §9.1).
54
+ *
55
+ * `BaseSingleton` rather than a `static _instance` so a bundler that loads this module twice does
56
+ * not produce two registries with divergent contents.
57
+ */
58
+ export class RealtimeModalityRegistry extends BaseSingleton {
59
+ constructor() {
60
+ super();
61
+ this._modalities = new Map();
62
+ this.registerWellKnown();
63
+ }
64
+ static get Instance() {
65
+ return super.getInstance();
66
+ }
67
+ /**
68
+ * Registers (or replaces) a modality descriptor.
69
+ *
70
+ * Last registration wins, matching `MJGlobal.ClassFactory`'s own convention, so a deployment can
71
+ * refine a well-known modality — raising `RequiresConsent` on `video` for a stricter
72
+ * jurisdiction, say — without a code change here.
73
+ */
74
+ Register(descriptor) {
75
+ if (!descriptor?.Key) {
76
+ throw new Error('RealtimeModalityRegistry.Register requires a descriptor with a Key.');
77
+ }
78
+ this._modalities.set(descriptor.Key.trim().toLowerCase(), descriptor);
79
+ }
80
+ /**
81
+ * Looks a modality up by key, case- and whitespace-insensitively.
82
+ *
83
+ * Returns `undefined` for an unregistered key rather than throwing: an unknown modality is
84
+ * transportable-but-unreasoned-about by design, so callers fall back to the descriptor on the
85
+ * track itself.
86
+ */
87
+ Get(key) {
88
+ return this._modalities.get(String(key ?? '').trim().toLowerCase());
89
+ }
90
+ /** Whether a key has a registered descriptor. */
91
+ IsRegistered(key) {
92
+ return this.Get(key) !== undefined;
93
+ }
94
+ /** Every registered descriptor, for UI and diagnostics. */
95
+ get All() {
96
+ return [...this._modalities.values()];
97
+ }
98
+ /** Seeds the modalities MJ reasons about. */
99
+ registerWellKnown() {
100
+ this.Register({
101
+ Key: 'audio',
102
+ DisplayName: 'Audio',
103
+ Directions: ['inbound', 'outbound'],
104
+ RequiresConsent: true,
105
+ DefaultUsageBasis: ['tokens', 'seconds'],
106
+ });
107
+ this.Register({
108
+ Key: 'video',
109
+ DisplayName: 'Video',
110
+ Directions: ['inbound', 'outbound'],
111
+ RequiresConsent: true,
112
+ DefaultEncoding: 'image/jpeg',
113
+ DefaultUsageBasis: ['tokens', 'frames'],
114
+ });
115
+ this.Register({
116
+ Key: 'image',
117
+ DisplayName: 'Image',
118
+ Directions: ['inbound'],
119
+ DefaultEncoding: 'image/jpeg',
120
+ DefaultUsageBasis: ['tokens'],
121
+ });
122
+ this.Register({
123
+ Key: 'text',
124
+ DisplayName: 'Text',
125
+ Directions: ['inbound', 'outbound'],
126
+ DefaultUsageBasis: ['tokens'],
127
+ });
128
+ }
129
+ }
130
+ /**
131
+ * Resolves the set of tracks to establish: what the caller asked for, intersected with what the
132
+ * model supports.
133
+ *
134
+ * **This function is why "video off by default" is structural rather than a default value.** An
135
+ * unrequested track is never established, so omitting configuration cannot silently inherit a
136
+ * provider default — which matters concretely because Gemini 3.8 Live's own turn coverage defaults
137
+ * to including every video frame, billed.
138
+ *
139
+ * A requested track the model does not support resolves to `'unsupported'` rather than being
140
+ * dropped, so the caller can fall back deliberately instead of wondering why no frames arrive.
141
+ *
142
+ * @param requested Tracks the session asked for. Empty or absent yields an empty result.
143
+ * @param supported Tracks the model declares, from `RealtimeSessionCapabilities`.
144
+ * @param makeTrackID Id factory, injected so callers control id shape and tests stay deterministic.
145
+ */
146
+ export function ResolveRequestedTracks(requested, supported, makeTrackID) {
147
+ if (!requested || requested.length === 0) {
148
+ return [];
149
+ }
150
+ const supportedList = supported ?? [];
151
+ return requested.map((descriptor, index) => {
152
+ const supportedTrack = supportedList.find((s) => String(s.Modality).trim().toLowerCase() === String(descriptor.Modality).trim().toLowerCase() &&
153
+ s.Direction === descriptor.Direction);
154
+ const isSupported = Boolean(supportedTrack);
155
+ let refinedDescriptor = descriptor;
156
+ if (supportedTrack) {
157
+ let effectiveRate = descriptor.Rate;
158
+ if (typeof supportedTrack.Rate === 'number' && supportedTrack.Rate > 0) {
159
+ effectiveRate = typeof descriptor.Rate === 'number' && descriptor.Rate > 0
160
+ ? Math.min(descriptor.Rate, supportedTrack.Rate)
161
+ : supportedTrack.Rate;
162
+ }
163
+ refinedDescriptor = {
164
+ ...descriptor,
165
+ Rate: effectiveRate,
166
+ };
167
+ }
168
+ return {
169
+ TrackID: makeTrackID(refinedDescriptor, index),
170
+ Descriptor: refinedDescriptor,
171
+ State: isSupported ? 'requested' : 'unsupported',
172
+ Reason: isSupported
173
+ ? undefined
174
+ : `Model does not support ${descriptor.Direction} ${String(descriptor.Modality)} tracks.`,
175
+ };
176
+ });
177
+ }
178
+ //# sourceMappingURL=realtimeTracks.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"realtimeTracks.js","sourceRoot":"","sources":["../../src/generic/realtimeTracks.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AAEH,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAC;AAiFvD;;;GAGG;AACH,MAAM,CAAC,MAAM,2BAA2B,GAA4B,MAAM,CAAC,MAAM,CAAC;IAC9E,QAAQ,EAAE,OAAO;IACjB,SAAS,EAAE,SAAS;IACpB,QAAQ,EAAE,YAAY;IACtB,IAAI,EAAE,CAAC;IACP,UAAU,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAU;IACzC,eAAe,EAAE,KAAK;CACzB,CAAC,CAAC;AAEH;;;GAGG;AACH,MAAM,CAAC,MAAM,6BAA6B,GAAuC,MAAM,CAAC,MAAM,CAAC;IAC3F,MAAM,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,OAAgB,EAAE,SAAS,EAAE,SAAkB,EAAE,CAAC;IAC5E,MAAM,CAAC,MAAM,CAAC,EAAE,QAAQ,EAAE,OAAgB,EAAE,SAAS,EAAE,UAAmB,EAAE,CAAC;CAChF,CAAC,CAAC;AAkEH;;;;;;;;;;GAUG;AACH,MAAM,OAAO,wBAAyB,SAAQ,aAAuC;IAGjF;QACI,KAAK,EAAE,CAAC;QAHJ,gBAAW,GAAG,IAAI,GAAG,EAAsC,CAAC;QAIhE,IAAI,CAAC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a,GAAG,UAAU,CAAC,IAAI,CAAC;YACpC,IAAI,OAAO,cAAc,CAAC,IAAI,KAAK,QAAQ,IAAI,cAAc,CAAC,IAAI,GAAG,CAAC,EAAE,CAAC;gBACrE,aAAa,GAAG,OAAO,UAAU,CAAC,IAAI,KAAK,QAAQ,IAAI,UAAU,CAAC,IAAI,GAAG,CAAC;oBACtE,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,IAAI,EAAE,cAAc,CAAC,IAAI,CAAC;oBAChD,CAAC,CAAC,cAAc,CAAC,IAAI,CAAC;YAC9B,CAAC;YACD,iBAAiB,GAAG;gBAChB,GAAG,UAAU;gBACb,IAAI,EAAE,aAAa;aACtB,CAAC;QACN,CAAC;QACD,OAAO;YACH,OAAO,EAAE,WAAW,CAAC,iBAAiB,EAAE,KAAK,CAAC;YAC9C,UAAU,EAAE,iBAAiB;YAC7B,KAAK,EAAE,WAAW,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,aAAa;YAChD,MAAM,EAAE,WAAW;gBACf,CAAC,CAAC,SAAS;gBACX,CAAC,CAAC,0BAA0B,UAAU,CAAC,SAAS,IAAI,MAAM,CAAC,UAAU,CAAC,QAAQ,CAAC,UAAU;SACxE,CAAC;IAC9B,CAAC,CAAC,CAAC;AACP,CAAC"}
package/dist/index.d.ts CHANGED
@@ -22,4 +22,5 @@ export * from './generic/baseRealtimeChannelServer.js';
22
22
  export * from './generic/errorTypes.js';
23
23
  export * from './generic/errorAnalyzer.js';
24
24
  export * from './generic/realtimeToolBatchBarrier.js';
25
+ export * from './generic/realtimeTracks.js';
25
26
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB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c,0BAA0B,CAAC"}
package/dist/index.js CHANGED
@@ -22,4 +22,5 @@ export * from './generic/baseRealtimeChannelServer.js';
22
22
  export * from './generic/errorTypes.js';
23
23
  export * from './generic/errorAnalyzer.js';
24
24
  export * from './generic/realtimeToolBatchBarrier.js';
25
+ export * from './generic/realtimeTracks.js';
25
26
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC;AACpD,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oCAAoC,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,mBAAmB,CAAC;AAClC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,sBAAsB,CAAC;AACrC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iCAAiC,CAAC;AAChD,cAAc,0BAA0B,CAAC;AACzC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,0BAA0B,CAAC;AACzC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,0BAA0B,CAAC;AACzC,cAAc,qBAAqB,CAAC;AACpC,cAAc,qBAAqB,CAAC;AACpC,cAAc,wBAAwB,CAAC;AACvC,cAAc,yBAAyB,CAAC;AACxC,cAAc,8BAA8B,CAAC;AAC7C,cAAc,kCAAkC,CAAC;AACjD,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC;AACpD,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,oCAAoC,CAAC;AACnD,cAAc,0BAA0B,CAAC"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@memberjunction/ai",
3
3
  "type": "module",
4
- "version": "6.1.1",
4
+ "version": "6.1.3",
5
5
  "description": "MemberJunction: AI - core components for abstracting LLMs and other AI model types that are usable anywhere without ANY other MJ dependencies past @memberjunction/global which itself has zero additional dependencies.",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",
@@ -11,7 +11,7 @@
11
11
  "author": "MemberJunction.com",
12
12
  "license": "BUSL-1.1",
13
13
  "dependencies": {
14
- "@memberjunction/global": "6.1.1",
14
+ "@memberjunction/global": "6.1.3",
15
15
  "dotenv": "^17.2.4",
16
16
  "rxjs": "^7.8.2"
17
17
  },