@memberjunction/ai 5.42.0 → 5.44.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -42,15 +42,101 @@ export declare abstract class BaseEmbeddings extends BaseModel {
42
42
  * or when switching between different configurations.
43
43
  */
44
44
  ClearAdditionalSettings(): void;
45
+ /**
46
+ * Embeds a SINGLE text into one vector.
47
+ *
48
+ * ERROR CONVENTION — note the deliberate asymmetry with {@link EmbedTexts}: on failure a provider
49
+ * returns an empty `vector: []` here (a single-item soft failure the caller inspects directly).
50
+ * The batch {@link EmbedTexts} is stricter and ALL-OR-NOTHING — one failed item collapses the whole
51
+ * result to `vectors: []` rather than returning a partially-filled array — because its consumers pair
52
+ * `vectors[i] ↔ records[i]` by index and a stray empty slot is silent corruption. The one case that
53
+ * THROWS instead of degrading is a structural collapse (vector count ≠ text count); see {@link EmbedTexts}.
54
+ */
45
55
  abstract EmbedText(params: EmbedTextParams): Promise<EmbedTextResult>;
46
- abstract EmbedTexts(params: EmbedTextsParams): Promise<EmbedTextsResult>;
47
56
  abstract GetEmbeddingModels(): Promise<any>;
57
+ /**
58
+ * Whether this provider's embedding model has a NATIVE batch endpoint that returns one vector
59
+ * per input in a single request. Defaults to `false`. Providers that pass an array of texts
60
+ * straight to their API (e.g. OpenAI, Azure, Cohere, Mistral) override this to return `true`
61
+ * and implement {@link embedBatch}. Providers without one inherit the safe per-text default below.
62
+ */
63
+ get SupportsBatchEmbeddings(): boolean;
64
+ /**
65
+ * Max in-flight `EmbedText` calls for the default (non-batch) path. Override to tune.
66
+ *
67
+ * Only the per-text fallback is throttled this way — the native {@link embedBatch} path sends all
68
+ * texts in ONE request, so there is nothing to bound. That asymmetry is intentional: N small calls
69
+ * need a concurrency ceiling; a single batched call does not.
70
+ */
71
+ protected get maxEmbedTextsConcurrency(): number;
72
+ /**
73
+ * Extra retry attempts per text on the default (non-batch) path, on top of the initial attempt.
74
+ * `0` disables retry. Retrying each text a few times before giving up stops one transient 429/500
75
+ * from failing the whole batch (whose failure rate otherwise scales with the text count N).
76
+ */
77
+ protected get maxEmbedTextsRetries(): number;
78
+ /** Base delay (ms) for exponential backoff between per-text retries: delay = base * 2^(n-1). */
79
+ protected get embedRetryBaseDelayMs(): number;
80
+ /**
81
+ * Embeds an array of texts, returning exactly ONE vector per input text, in input order.
82
+ *
83
+ * DISPATCHES on {@link SupportsBatchEmbeddings}: providers with a native batch endpoint set it to
84
+ * `true` and implement {@link embedBatch}; everyone else gets the safe per-text fallback in
85
+ * {@link embedPerText}. (A provider may still override this method directly for fully custom
86
+ * behavior.)
87
+ *
88
+ * Whichever path runs, the result is hard-asserted to be 1:1 with the inputs (an intentional
89
+ * empty result — the per-text graceful-degrade — is allowed): a native `embedBatch` that drops
90
+ * or reorders vectors, or any other collapse, throws here rather than letting a misaligned array
91
+ * reach index-based consumers (e.g. EntityVectorSyncer).
92
+ */
93
+ EmbedTexts(params: EmbedTextsParams): Promise<EmbedTextsResult>;
94
+ /**
95
+ * Native batch path. A provider that returns `SupportsBatchEmbeddings = true` MUST override this
96
+ * with a single batched API call returning one vector per input. The default throws so the flag
97
+ * and the implementation can't drift apart (claim batch ⇒ must implement it).
98
+ */
99
+ protected embedBatch(_params: EmbedTextsParams): Promise<EmbedTextsResult>;
100
+ /**
101
+ * Default (non-batch) path: fans out one {@link EmbedText} call per text with bounded concurrency,
102
+ * preserving order. The 1:1 vector/text count is enforced by the dispatcher ({@link EmbedTexts}).
103
+ *
104
+ * Each text is first retried with bounded exponential backoff ({@link retryEmbedText}) so a lone
105
+ * transient failure doesn't sink the batch; only a text that STILL fails after its retries counts
106
+ * as failed.
107
+ *
108
+ * ERROR CONTRACT (deliberate — change here if a different policy is wanted): mirrors the
109
+ * per-provider Gemini fix. On ANY per-text failure that survives retry (EmbedText throws OR yields
110
+ * an empty vector) we return an EMPTY result rather than throwing, so batch pipelines that don't
111
+ * wrap EmbedTexts (e.g. EntityVectorSyncer) degrade gracefully instead of aborting. To make it
112
+ * fully fail-loud instead, replace the two `emptyEmbedTextsResult(...)` returns below with `throw`.
113
+ */
114
+ protected embedPerText(params: EmbedTextsParams): Promise<EmbedTextsResult>;
115
+ /** Empty `EmbedTextsResult` returned by the default `EmbedTexts` when an item fails (graceful degrade). */
116
+ private emptyEmbedTextsResult;
117
+ /**
118
+ * Runs `fn` over `items` with at most `maxConcurrency` in flight at once, preserving order.
119
+ * The per-item `await` inside each worker is what bounds concurrency; parallelism comes from
120
+ * running up to `maxConcurrency` workers at the same time.
121
+ */
122
+ protected runWithConcurrency<T>(items: string[], fn: (item: string, index: number) => Promise<T>, maxConcurrency: number): Promise<T[]>;
123
+ /**
124
+ * Runs a single-text embed `attempt` with bounded exponential-backoff retry. A transient failure —
125
+ * `attempt` throws, or returns an empty/missing vector — is retried up to {@link maxEmbedTextsRetries}
126
+ * times, sleeping {@link embedRetryBaseDelayMs} * 2^(n-1) between tries. Returns the first successful
127
+ * result; after the final attempt returns whatever it produced (or rethrows its error) so the caller's
128
+ * existing empty-vector / throw handling still applies. This is what keeps one transient 429/500 from
129
+ * failing the whole batch.
130
+ */
131
+ protected retryEmbedText(attempt: () => Promise<EmbedTextResult>): Promise<EmbedTextResult>;
132
+ /** Sleep helper for retry backoff, isolated so tests can override `embedRetryBaseDelayMs` to avoid real delays. */
133
+ protected sleep(ms: number): Promise<void>;
48
134
  /**
49
135
  * Embeds text and/or interleaved media content into a single fused vector.
50
136
  *
51
137
  * Default behavior: text-only content is delegated to EmbedText;
52
138
  * if any non-text block is present, throws — because the base provider can't embed media.
53
- * Multimodal providers (e.g. GeminiEmbedding2) should override this method.
139
+ * Multimodal providers (e.g. GeminiEmbedding) should override this method.
54
140
  */
55
141
  EmbedContent(params: EmbedContentParams): Promise<EmbedContentResult>;
56
142
  }
@@ -1 +1 @@
1
- {"version":3,"file":"baseEmbeddings.d.ts","sourceRoot":"","sources":["../../src/generic/baseEmbeddings.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB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;;;;;;;;OAYG;IACU,UAAU,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAY5E;;;;OAIG;IACH,SAAS,CAAC,UAAU,CAAC,OAAO,EAAE,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAO1E;;;;;;;;;;;;;OAaG;cACa,YAAY,CAAC,MAAM,EAAE,gBAAgB,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAiCjF,2GAA2G;IAC3G,OAAO,CAAC,qBAAqB;IAI7B;;;;OAIG;cACa,kBAAkB,CAAC,CAAC,EAChC,KAAK,EAAE,MAAM,EAAE,EACf,EAAE,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,KAAK,OAAO,CAAC,CAAC,CAAC,EAC/C,cAAc,EAAE,MAAM,GACvB,OAAO,CAAC,CAAC,EAAE,CAAC;IAuBf;;;;;;;OAOG;cACa,cAAc,CAAC,OAAO,EAAE,MAAM,OAAO,CAAC,eAAe,CAAC,GAAG,OAAO,CAAC,eAAe,CAAC;IAwBjG,mHAAmH;IACnH,SAAS,CAAC,KAAK,CAAC,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;IAI1C;;;;;;OAMG;IACU,YAAY,CAAC,MAAM,EAAE,kBAAkB,GAAG,OAAO,CAAC,kBAAkB,CAAC;CAQrF;AAED;;GAEG;AACH,8BAAsB,UAAW,SAAQ,cAAc;CAAG"}
@@ -1,4 +1,4 @@
1
- import { BaseModel } from './baseModel.js';
1
+ import { BaseModel, ModelUsage } from './baseModel.js';
2
2
  /**
3
3
  * Base class for all embedding model implementations
4
4
  */
@@ -82,12 +82,182 @@ export class BaseEmbeddings extends BaseModel {
82
82
  ClearAdditionalSettings() {
83
83
  this._additionalSettings = {};
84
84
  }
85
+ /**
86
+ * Whether this provider's embedding model has a NATIVE batch endpoint that returns one vector
87
+ * per input in a single request. Defaults to `false`. Providers that pass an array of texts
88
+ * straight to their API (e.g. OpenAI, Azure, Cohere, Mistral) override this to return `true`
89
+ * and implement {@link embedBatch}. Providers without one inherit the safe per-text default below.
90
+ */
91
+ get SupportsBatchEmbeddings() {
92
+ return false;
93
+ }
94
+ /**
95
+ * Max in-flight `EmbedText` calls for the default (non-batch) path. Override to tune.
96
+ *
97
+ * Only the per-text fallback is throttled this way — the native {@link embedBatch} path sends all
98
+ * texts in ONE request, so there is nothing to bound. That asymmetry is intentional: N small calls
99
+ * need a concurrency ceiling; a single batched call does not.
100
+ */
101
+ get maxEmbedTextsConcurrency() {
102
+ return 4;
103
+ }
104
+ /**
105
+ * Extra retry attempts per text on the default (non-batch) path, on top of the initial attempt.
106
+ * `0` disables retry. Retrying each text a few times before giving up stops one transient 429/500
107
+ * from failing the whole batch (whose failure rate otherwise scales with the text count N).
108
+ */
109
+ get maxEmbedTextsRetries() {
110
+ return 2;
111
+ }
112
+ /** Base delay (ms) for exponential backoff between per-text retries: delay = base * 2^(n-1). */
113
+ get embedRetryBaseDelayMs() {
114
+ return 250;
115
+ }
116
+ /**
117
+ * Embeds an array of texts, returning exactly ONE vector per input text, in input order.
118
+ *
119
+ * DISPATCHES on {@link SupportsBatchEmbeddings}: providers with a native batch endpoint set it to
120
+ * `true` and implement {@link embedBatch}; everyone else gets the safe per-text fallback in
121
+ * {@link embedPerText}. (A provider may still override this method directly for fully custom
122
+ * behavior.)
123
+ *
124
+ * Whichever path runs, the result is hard-asserted to be 1:1 with the inputs (an intentional
125
+ * empty result — the per-text graceful-degrade — is allowed): a native `embedBatch` that drops
126
+ * or reorders vectors, or any other collapse, throws here rather than letting a misaligned array
127
+ * reach index-based consumers (e.g. EntityVectorSyncer).
128
+ */
129
+ async EmbedTexts(params) {
130
+ const result = this.SupportsBatchEmbeddings ? await this.embedBatch(params) : await this.embedPerText(params);
131
+ const expected = (params.texts ?? []).length;
132
+ if (expected > 0 && result.vectors.length !== 0 && result.vectors.length !== expected) {
133
+ throw new Error(`${this.constructor.name}.EmbedTexts produced ${result.vectors.length} vector(s) for ${expected} ` +
134
+ `input text(s); expected a 1:1 match. Refusing to return a misaligned embedding batch.`);
135
+ }
136
+ return result;
137
+ }
138
+ /**
139
+ * Native batch path. A provider that returns `SupportsBatchEmbeddings = true` MUST override this
140
+ * with a single batched API call returning one vector per input. The default throws so the flag
141
+ * and the implementation can't drift apart (claim batch ⇒ must implement it).
142
+ */
143
+ embedBatch(_params) {
144
+ throw new Error(`${this.constructor.name} returns SupportsBatchEmbeddings = true but does not implement embedBatch(). ` +
145
+ `Override embedBatch() with the provider's native batch call, or return false to use the per-text default.`);
146
+ }
147
+ /**
148
+ * Default (non-batch) path: fans out one {@link EmbedText} call per text with bounded concurrency,
149
+ * preserving order. The 1:1 vector/text count is enforced by the dispatcher ({@link EmbedTexts}).
150
+ *
151
+ * Each text is first retried with bounded exponential backoff ({@link retryEmbedText}) so a lone
152
+ * transient failure doesn't sink the batch; only a text that STILL fails after its retries counts
153
+ * as failed.
154
+ *
155
+ * ERROR CONTRACT (deliberate — change here if a different policy is wanted): mirrors the
156
+ * per-provider Gemini fix. On ANY per-text failure that survives retry (EmbedText throws OR yields
157
+ * an empty vector) we return an EMPTY result rather than throwing, so batch pipelines that don't
158
+ * wrap EmbedTexts (e.g. EntityVectorSyncer) degrade gracefully instead of aborting. To make it
159
+ * fully fail-loud instead, replace the two `emptyEmbedTextsResult(...)` returns below with `throw`.
160
+ */
161
+ async embedPerText(params) {
162
+ const { texts, ...rest } = params;
163
+ const items = texts ?? [];
164
+ let results;
165
+ try {
166
+ results = await this.runWithConcurrency(items, (text) => this.retryEmbedText(() => this.EmbedText({ ...rest, text })), this.maxEmbedTextsConcurrency);
167
+ }
168
+ catch (error) {
169
+ // Graceful degrade (see error contract above) — but never silently: log why it failed.
170
+ console.error(`${this.constructor.name}.EmbedTexts: per-text embedding failed:`, error);
171
+ return this.emptyEmbedTextsResult(params.model);
172
+ }
173
+ // An empty/missing vector means that text failed; refuse to return a partially-corrupt batch
174
+ // (downstream pairs vectors to records by index, so a stray empty vector is silent corruption).
175
+ if (items.length > 0 && results.some((r) => !r.vector || r.vector.length === 0)) {
176
+ return this.emptyEmbedTextsResult(params.model);
177
+ }
178
+ const promptTokens = results.reduce((sum, r) => sum + (r.ModelUsage?.promptTokens ?? 0), 0);
179
+ const completionTokens = results.reduce((sum, r) => sum + (r.ModelUsage?.completionTokens ?? 0), 0);
180
+ return {
181
+ object: 'list',
182
+ model: results[0]?.model ?? params.model ?? '',
183
+ ModelUsage: new ModelUsage(promptTokens, completionTokens),
184
+ vectors: results.map((r) => r.vector),
185
+ };
186
+ }
187
+ /** Empty `EmbedTextsResult` returned by the default `EmbedTexts` when an item fails (graceful degrade). */
188
+ emptyEmbedTextsResult(model) {
189
+ return { object: 'list', model: model ?? '', ModelUsage: new ModelUsage(0, 0), vectors: [] };
190
+ }
191
+ /**
192
+ * Runs `fn` over `items` with at most `maxConcurrency` in flight at once, preserving order.
193
+ * The per-item `await` inside each worker is what bounds concurrency; parallelism comes from
194
+ * running up to `maxConcurrency` workers at the same time.
195
+ */
196
+ async runWithConcurrency(items, fn, maxConcurrency) {
197
+ const out = new Array(items.length);
198
+ let nextIndex = 0;
199
+ let failed = false;
200
+ const worker = async () => {
201
+ // Stop claiming new items once any worker has thrown, so we don't keep issuing
202
+ // (paid) calls after the operation is already doomed to reject.
203
+ for (let index = nextIndex++; !failed && index < items.length; index = nextIndex++) {
204
+ try {
205
+ out[index] = await fn(items[index], index);
206
+ }
207
+ catch (error) {
208
+ failed = true;
209
+ throw error;
210
+ }
211
+ }
212
+ };
213
+ // Always run at least one worker when there's work, so a non-positive cap can't leave
214
+ // items unprocessed (which would yield a sparse, guard-bypassing result array).
215
+ const workerCount = items.length === 0 ? 0 : Math.max(1, Math.min(maxConcurrency, items.length));
216
+ await Promise.all(Array.from({ length: workerCount }, () => worker()));
217
+ return out;
218
+ }
219
+ /**
220
+ * Runs a single-text embed `attempt` with bounded exponential-backoff retry. A transient failure —
221
+ * `attempt` throws, or returns an empty/missing vector — is retried up to {@link maxEmbedTextsRetries}
222
+ * times, sleeping {@link embedRetryBaseDelayMs} * 2^(n-1) between tries. Returns the first successful
223
+ * result; after the final attempt returns whatever it produced (or rethrows its error) so the caller's
224
+ * existing empty-vector / throw handling still applies. This is what keeps one transient 429/500 from
225
+ * failing the whole batch.
226
+ */
227
+ async retryEmbedText(attempt) {
228
+ let lastError;
229
+ for (let n = 0; n <= this.maxEmbedTextsRetries; n++) {
230
+ if (n > 0) {
231
+ await this.sleep(this.embedRetryBaseDelayMs * 2 ** (n - 1));
232
+ }
233
+ try {
234
+ const result = await attempt();
235
+ const failed = !result.vector || result.vector.length === 0;
236
+ if (failed && n < this.maxEmbedTextsRetries) {
237
+ continue; // transient empty vector — back off and retry
238
+ }
239
+ return result; // success, or the final empty result after exhausting retries
240
+ }
241
+ catch (error) {
242
+ lastError = error;
243
+ if (n >= this.maxEmbedTextsRetries) {
244
+ throw error; // out of retries — let the caller's catch degrade the batch
245
+ }
246
+ }
247
+ }
248
+ // Unreachable: the loop always returns or throws. Present to satisfy the type checker.
249
+ throw lastError instanceof Error ? lastError : new Error('retryEmbedText exhausted without a result');
250
+ }
251
+ /** Sleep helper for retry backoff, isolated so tests can override `embedRetryBaseDelayMs` to avoid real delays. */
252
+ sleep(ms) {
253
+ return new Promise((resolve) => setTimeout(resolve, ms));
254
+ }
85
255
  /**
86
256
  * Embeds text and/or interleaved media content into a single fused vector.
87
257
  *
88
258
  * Default behavior: text-only content is delegated to EmbedText;
89
259
  * if any non-text block is present, throws — because the base provider can't embed media.
90
- * Multimodal providers (e.g. GeminiEmbedding2) should override this method.
260
+ * Multimodal providers (e.g. GeminiEmbedding) should override this method.
91
261
  */
92
262
  async EmbedContent(params) {
93
263
  // Base (text-only) behavior: reject unsupported media via ValidateContentSupported — caps are
@@ -1 +1 @@
1
- {"version":3,"file":"baseEmbeddings.js","sourceRoot":"","sources":["../../src/generic/baseEmbeddings.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,SAAS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;QACvF,MAAM,SAAS,YAAY,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,2CAA2C,CAAC,CAAC;IAC1G,CAAC;IAED,mHAAmH;IACzG,KAAK,CAAC,EAAU;QACtB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC,CAAC;IAC7D,CAAC;IAED;;;;;;OAMG;IACI,KAAK,CAAC,YAAY,CAAC,MAA0B;QAChD,8FAA8F;QAC9F,gGAAgG;QAChG,IAAI,CAAC,wBAAwB,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;QAC9C,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC;QAC/B,MAAM,IAAI,GAAG,OAAO,OAAO,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAA8B,EAAE,EAAE,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;QAC/H,OAAO,IAAI,CAAC,SAAS,CAAC,EAAE,GAAG,MAAM,EAAE,IAAI,EAAE,CAAC,CAAC;IAC/C,CAAC;CACJ;AAED;;GAEG;AACH,MAAM,OAAgB,UAAW,SAAQ,cAAc;CAAG"}
@@ -75,6 +75,18 @@ export type JSONObject = {
75
75
  *
76
76
  * @abstract
77
77
  */
78
+ /**
79
+ * Emits a realtime-driver diagnostic line, but ONLY when verbose logging is enabled
80
+ * (`MJ_VERBOSE=true|1|yes`). These traces — turn boundaries, activity windows, response gating,
81
+ * barge-in — are invaluable when debugging a live session but far too chatty for normal operation,
82
+ * so they stay dark unless verbose mode is explicitly turned on. Shared here so every realtime driver
83
+ * and its session twin (OpenAI, Gemini, …) gate diagnostics through one consistent switch. The truthy
84
+ * set matches `@memberjunction/core`'s `IsVerboseLoggingEnabled` so a single `MJ_VERBOSE` flag governs
85
+ * verbose output across the whole stack.
86
+ *
87
+ * @param message The diagnostic message, already prefixed by the caller (e.g. `[GeminiRealtime][diag] …`).
88
+ */
89
+ export declare function RealtimeDiagLog(message: string): void;
78
90
  export declare abstract class BaseRealtimeModel extends BaseModel {
79
91
  /**
80
92
  * Opens a stateful duplex session with the provider.
@@ -205,6 +217,24 @@ export interface ClientRealtimeSessionConfig {
205
217
  */
206
218
  SessionConfig: JSONObject;
207
219
  }
220
+ /**
221
+ * Static capability flags of a live {@link IRealtimeSession}, for container introspection (the realtime-
222
+ * session analogue of `IBridgeProviderFeatures`). Grow this as providers gain runtime abilities — each new
223
+ * flag defaults to "unsupported" for any driver that hasn't declared it, so the container stays safe.
224
+ */
225
+ export interface RealtimeSessionCapabilities {
226
+ /**
227
+ * Whether the session can change its turn-taking / auto-response mode on a **live** socket (no
228
+ * reconnect) via {@link IRealtimeSession.Reconfigure}. `true` for providers with a runtime-mutable
229
+ * session config (OpenAI `session.update`); `false` where it's fixed at connect (Gemini Live).
230
+ */
231
+ CanReconfigureTurnMode: boolean;
232
+ }
233
+ /** Parameters for {@link IRealtimeSession.Reconfigure} — a live turn-taking change. */
234
+ export interface RealtimeReconfigureParams {
235
+ /** Switch the model's blind auto-response OFF (meeting mode) or ON (1:1). */
236
+ DisableAutoResponse?: boolean;
237
+ }
208
238
  /**
209
239
  * A long-lived, full-duplex session handle returned by {@link BaseRealtimeModel.StartSession}.
210
240
  *
@@ -347,8 +377,32 @@ export interface IRealtimeSession {
347
377
  * mid-session omit the member, and callers must feature-detect before invoking.
348
378
  *
349
379
  * @param instructions Instructions for the single spoken update (tone, brevity, content).
380
+ * @returns `true` when a response was actually triggered, `false` when it was skipped (e.g. a response
381
+ * is already in flight). A bridge that claimed the speaking floor for this turn uses this to release the
382
+ * floor immediately on a skip — otherwise a skipped trigger would wedge the room until the safety timer.
383
+ * `void`/`undefined` from legacy drivers is treated as "triggered" for backward compatibility.
384
+ */
385
+ RequestSpokenUpdate?(instructions: string): boolean | void;
386
+ /**
387
+ * **Capability introspection.** A small, static description of what THIS live session can do, so the
388
+ * container can ask "is it safe to call X?" instead of invoking optional methods that silently no-op (or
389
+ * can't be supported) on some providers — the same role `IBridgeProviderFeatures` plays for bridges and
390
+ * {@link BaseRealtimeModel.SupportsClientDirect} plays for minting. Optional: a driver that hasn't
391
+ * declared its capabilities is treated **conservatively** (everything unsupported). As models gain
392
+ * abilities, drivers just flip a flag — no container changes.
393
+ */
394
+ Capabilities?: RealtimeSessionCapabilities;
395
+ /**
396
+ * **Optional capability** (gate on {@link RealtimeSessionCapabilities.CanReconfigureTurnMode}) —
397
+ * reconfigures a **live** session's turn-taking without reconnecting: e.g. switch a 1:1 agent to
398
+ * meeting mode (auto-response off) when its room becomes multi-agent. Providers whose runtime config is
399
+ * mutable mid-socket (OpenAI: `session.update`) implement this and report the capability `true`;
400
+ * providers whose turn config is fixed at connect (Gemini Live's activity detection) report `false` and
401
+ * omit the method. The container **must** check the capability before calling — never blind-invoke.
402
+ *
403
+ * @param params The reconfiguration to apply (e.g. `DisableAutoResponse`).
350
404
  */
351
- RequestSpokenUpdate?(instructions: string): void;
405
+ Reconfigure?(params: RealtimeReconfigureParams): void;
352
406
  /**
353
407
  * Registers a handler for provider-detected interruptions (barge-in).
354
408
  *
@@ -1 +1 @@
1
- {"version":3,"file":"baseRealtime.d.ts","sourceRoot":"","sources":["../../src/generic/baseRealtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAExC;;;GAGG;AACH,MAAM,MAAM,SAAS,GACf,MAAM,GACN,MAAM,GACN,OAAO,GACP,IAAI,GACJ,SAAS,EAAE,GACX;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AAEnC;;;GAGG;AACH,MAAM,MAAM,UAAU,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,SAAS,CAAA;CAAE,CAAC;AAEtD;;;;;;;;;;;;;;;;;;;;;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,CAAC;CACvB;AAED;;;GAGG;AACH,MAAM,WAAW,kBAAkB;IAC/B;;OAEG;IACH,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAE3B;;;;OAIG;IACH,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,OAAO,EAAE,OAAO,CAAC;CACpB;AAED;;;;;;GAMG;AACH,MAAM,WAAW,oBAAoB;IACjC,oCAAoC;IACpC,OAAO,EAAE,MAAM,CAAC;IAEhB,6CAA6C;IAC7C,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,gDAAgD;IAChD,KAAK,EAAE,OAAO,CAAC;CAClB;AAED;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC7B;;OAEG;IACH,MAAM,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;OAGG;IACH,SAAS,EAAE,MAAM,CAAC;CACrB;AAED;;;;;;;GAOG;AACH,MAAM,WAAW,aAAa;IAC1B;;OAEG;IACH,WAAW,EAAE,MAAM,CAAC;IAEpB;;OAEG;IACH,YAAY,EAAE,MAAM,CAAC;CACxB;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"}
@@ -61,6 +61,24 @@ import { BaseModel } from "./baseModel.js";
61
61
  *
62
62
  * @abstract
63
63
  */
64
+ /**
65
+ * Emits a realtime-driver diagnostic line, but ONLY when verbose logging is enabled
66
+ * (`MJ_VERBOSE=true|1|yes`). These traces — turn boundaries, activity windows, response gating,
67
+ * barge-in — are invaluable when debugging a live session but far too chatty for normal operation,
68
+ * so they stay dark unless verbose mode is explicitly turned on. Shared here so every realtime driver
69
+ * and its session twin (OpenAI, Gemini, …) gate diagnostics through one consistent switch. The truthy
70
+ * set matches `@memberjunction/core`'s `IsVerboseLoggingEnabled` so a single `MJ_VERBOSE` flag governs
71
+ * verbose output across the whole stack.
72
+ *
73
+ * @param message The diagnostic message, already prefixed by the caller (e.g. `[GeminiRealtime][diag] …`).
74
+ */
75
+ export function RealtimeDiagLog(message) {
76
+ const v = (process.env.MJ_VERBOSE ?? '').toLowerCase();
77
+ if (v === 'true' || v === '1' || v === 'yes') {
78
+ // eslint-disable-next-line no-console
79
+ console.log(message);
80
+ }
81
+ }
64
82
  export class BaseRealtimeModel extends BaseModel {
65
83
  /**
66
84
  * Whether this driver can mint an ephemeral, server-scoped client credential for a
@@ -1 +1 @@
1
- {"version":3,"file":"baseRealtime.js","sourceRoot":"","sources":["../../src/generic/baseRealtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAoBxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA6DG;AACH,MAAM,OAAgB,iBAAkB,SAAQ,SAAS;IAcrD;;;;;;;;;;;OAWG;IACH,IAAW,oBAAoB;QAC3B,OAAO,KAAK,CAAC;IACjB,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACI,KAAK,CAAC,mBAAmB,CAAC,OAA8B;QAC3D,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,mDAAmD,CAAC,CAAC;IACjG,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,IAAW,aAAa;QACpB,OAAO,KAAK,CAAC;IACjB,CAAC;IAED;;;;;;;;;;OAUG;IACH,IAAW,eAAe;QACtB,OAAO,EAAE,CAAC;IACd,CAAC;CACJ"}
1
+ {"version":3,"file":"baseRealtime.js","sourceRoot":"","sources":["../../src/generic/baseRealtime.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAoBxC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,sCAAsC;QACtC,OAAO,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;IACzB,CAAC;AACL,CAAC;AAED,MAAM,OAAgB,iBAAkB,SAAQ,SAAS;IAcrD;;;;;;;;;;;OAWG;IACH,IAAW,oBAAoB;QAC3B,OAAO,KAAK,CAAC;IACjB,CAAC;IAED;;;;;;;;;;;;;;;;;;OAkBG;IACI,KAAK,CAAC,mBAAmB,CAAC,OAA8B;QAC3D,MAAM,IAAI,KAAK,CAAC,GAAG,IAAI,CAAC,WAAW,CAAC,IAAI,mDAAmD,CAAC,CAAC;IACjG,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,IAAW,aAAa;QACpB,OAAO,KAAK,CAAC;IACjB,CAAC;IAED;;;;;;;;;;OAUG;IACH,IAAW,eAAe;QACtB,OAAO,EAAE,CAAC;IACd,CAAC;CACJ"}
@@ -36,6 +36,19 @@ export interface RealtimeChannelServerContext {
36
36
  UserID: string;
37
37
  /** The conversation the session is attached to, or `null` when the session carries none. */
38
38
  ConversationID: string | null;
39
+ /**
40
+ * **Optional raw per-session config blob** — the verbatim `AIAgentSession.Config_` string the
41
+ * session was created with (the host passes it through; it stays opaque to the contract). A
42
+ * data-aware channel parses out only the keys it owns — e.g. the Media channel reads a per-session
43
+ * `mediaCollectionID` override here. Kept as a plain string (not a typed bag) so the base contract
44
+ * stays free of `@memberjunction/core` and channel-agnostic; `null`/absent when the session carries
45
+ * no config. Channels MUST treat it as untrusted input (validate ids before use).
46
+ *
47
+ * NOTE: deliberately named `AgentSessionConfig` (not `SessionConfig`) to avoid confusion with the
48
+ * unrelated {@link import('./baseRealtime.js').ClientRealtimeSessionConfig.SessionConfig} — the
49
+ * provider-driver "private pact" config bag. This field is the persisted `AIAgentSession.Config_`.
50
+ */
51
+ AgentSessionConfig?: string | null;
39
52
  /**
40
53
  * **Optional perception sink** — feeds a background context note into the live realtime model
41
54
  * (the server-side counterpart of the client channel's `RealtimeChannelContext.SendContextNote`).
@@ -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,OAAO,CAAC;AAEvF;;;;;GAKG;AACH,MAAM,WAAW,4BAA4B;IACzC,mFAAmF;IACnF,cAAc,EAAE,MAAM,CAAC;IAEvB,mGAAmG;IACnG,OAAO,EAAE,MAAM,CAAC;IAEhB,uGAAuG;IACvG,MAAM,EAAE,MAAM,CAAC;IAEf,4FAA4F;IAC5F,cAAc,EAAE,MAAM,GAAG,IAAI,CAAC;IAE9B;;;;;;;;;;;;OAYG;IACH,eAAe,CAAC,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAC;CACxC;AAED;;;;;;;;GAQG;AACH,MAAM,WAAW,uBAAuB;IACpC,8CAA8C;IAC9C,OAAO,EAAE,OAAO,CAAC;IAEjB;;;OAGG;IACH,MAAM,EAAE,MAAM,CAAC;CAClB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AACH,8BAAsB,yBAAyB;IAC3C;;;OAGG;IACH,SAAS,CAAC,OAAO,EAAE,4BAA4B,GAAG,IAAI,CAAQ;IAE9D;;;;OAIG;IACH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@@
1
- {"version":3,"file":"baseRealtimeChannelServer.js","sourceRoot":"","sources":["../../src/generic/baseRealtimeChannelServer.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAoEH;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;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"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@memberjunction/ai",
3
3
  "type": "module",
4
- "version": "5.42.0",
4
+ "version": "5.44.0",
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",
@@ -17,7 +17,7 @@
17
17
  "author": "MemberJunction.com",
18
18
  "license": "ISC",
19
19
  "dependencies": {
20
- "@memberjunction/global": "5.42.0",
20
+ "@memberjunction/global": "5.44.0",
21
21
  "dotenv": "^17.2.4",
22
22
  "rxjs": "^7.8.2"
23
23
  },