@memberjunction/ai-bridge-server 5.41.0 → 5.43.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.
|
@@ -2,8 +2,101 @@ import { IMetadataProvider, IStartupSink, UserInfo } from '@memberjunction/core'
|
|
|
2
2
|
import { BaseSingleton } from '@memberjunction/global';
|
|
3
3
|
import { IRealtimeSession } from '@memberjunction/ai';
|
|
4
4
|
import { MJAIBridgeProviderEntity, MJAIBridgeAgentIdentityEntity, MJAIBridgeProviderChannelEntity } from '@memberjunction/core-entities';
|
|
5
|
-
import { AIBridgeEngineBase, BaseRealtimeBridge, BridgeDisconnectReason, TurnTakingPolicy, TurnTakingPolicyConfig, BridgeTurnMode, IAddressedMatcher, IWorthSayingScorer, IBridgeChannelHost, BridgeChannelToolDefinition, BridgeChannelToolResult } from '@memberjunction/ai-bridge-base';
|
|
5
|
+
import { AIBridgeEngineBase, BaseRealtimeBridge, BridgeDisconnectReason, TurnTakingPolicy, TurnTakingPolicyConfig, BridgeTurnMode, IAddressedMatcher, IWorthSayingScorer, IBridgeChannelHost, BridgeChannelToolDefinition, BridgeChannelToolResult, BridgeNativeSdkBinding } from '@memberjunction/ai-bridge-base';
|
|
6
6
|
import { MultiAgentRoomCoordinator } from './multi-agent-room-coordinator.js';
|
|
7
|
+
/**
|
|
8
|
+
* Finalizes the co-agent observability run(s) for an agent session when a bridge is torn down WITHOUT a
|
|
9
|
+
* live in-memory session — a prior-boot orphan or a cross-host reap, where the agent layer's `Close()`-wrapped
|
|
10
|
+
* finalizer can't run, so the co-agent `AIAgentRun` would otherwise dangle in `Running` forever. The agent
|
|
11
|
+
* layer registers it via {@link AIBridgeEngine.SetSessionRunFinalizer} at startup (it lives in
|
|
12
|
+
* `@memberjunction/ai-agents`, not reachable from this package). **Idempotent**: for a clean same-process
|
|
13
|
+
* teardown the run is already `Completed`, so this is a harmless no-op.
|
|
14
|
+
*/
|
|
15
|
+
export type BridgeSessionRunFinalizer = (agentSessionID: string, success: boolean, contextUser?: UserInfo, provider?: IMetadataProvider) => Promise<void>;
|
|
16
|
+
/**
|
|
17
|
+
* One final transcript line from a room's **scribe** session (the single elected per-room writer). The
|
|
18
|
+
* engine knows the room topology + owns the transcript tap; the SINK owns *where* it persists (e.g. an
|
|
19
|
+
* `MJ: Conversations` "Meeting Room" + `MJ: Conversation Details`). Keeping the Conversations/app specifics
|
|
20
|
+
* out of the engine — the engine only emits these neutral lines. See `plans/realtime/...followups.md` §5.
|
|
21
|
+
*/
|
|
22
|
+
export interface BridgeTranscriptLine {
|
|
23
|
+
/** The room grouping (driver `ExternalConnectionId`) — one room = one unified transcript. */
|
|
24
|
+
RoomKey: string;
|
|
25
|
+
/** The scribe's agent-session id (stamped on the scribe's OWN speech lines). */
|
|
26
|
+
AgentSessionID: string;
|
|
27
|
+
/** The scribe's agent id, when known (attribution for its own speech). */
|
|
28
|
+
AgentID?: string;
|
|
29
|
+
/** `true` for the scribe's OWN speech (`assistant`), `false` for anything it heard (`user`). */
|
|
30
|
+
IsAgentSpeech: boolean;
|
|
31
|
+
/** The speaker's participant id — the scribe's own bot id for its speech; absent for heard speech. */
|
|
32
|
+
SpeakerParticipantID?: string;
|
|
33
|
+
/** The final transcript text for the turn. */
|
|
34
|
+
Text: string;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Registered by the app layer to persist the unified room transcript. The engine calls it for each FINAL
|
|
38
|
+
* transcript line from a room's scribe, passing the scribe session's `contextUser` + `provider` so the sink
|
|
39
|
+
* can write entities under the right identity. Bound once at startup (see `AIBridgeEngine.SetTranscriptSink`).
|
|
40
|
+
*/
|
|
41
|
+
export type BridgeTranscriptSink = (line: BridgeTranscriptLine, contextUser?: UserInfo, provider?: IMetadataProvider) => void | Promise<void>;
|
|
42
|
+
/** One diarized turn in the moderator's lookback window (oldest→newest). */
|
|
43
|
+
export interface ModeratorLookbackTurn {
|
|
44
|
+
/** Display name of who spoke (agent name or participant label). */
|
|
45
|
+
Speaker: string;
|
|
46
|
+
/** Whether the speaker was an agent (vs a human participant). */
|
|
47
|
+
IsAgent: boolean;
|
|
48
|
+
/** The agent's id when {@link ModeratorLookbackTurn.IsAgent}. */
|
|
49
|
+
AgentID?: string;
|
|
50
|
+
/** What was said (engine stores a memory-bounded copy; the moderator clips further per its config). */
|
|
51
|
+
Text: string;
|
|
52
|
+
}
|
|
53
|
+
/** One agent eligible to speak in a room, as the turn moderator sees it. */
|
|
54
|
+
export interface ModeratorRosterAgent {
|
|
55
|
+
/** The bridge's `AIAgentSession` id — the stable identifier the moderator returns to route a turn. */
|
|
56
|
+
AgentSessionID: string;
|
|
57
|
+
/** The co-agent's `MJ: AI Agents` id (the generic Realtime voice agent). */
|
|
58
|
+
AgentID?: string;
|
|
59
|
+
/** The TARGET agent this co-agent voices (the role/identity the user hears), when distinct from {@link ModeratorRosterAgent.AgentID}. */
|
|
60
|
+
TargetAgentID?: string;
|
|
61
|
+
/** Names/aliases the agent answers to. */
|
|
62
|
+
Names: string[];
|
|
63
|
+
/** Short role/description for relevance judgement (the moderator plugin resolves the live value from the agent). */
|
|
64
|
+
Role?: string;
|
|
65
|
+
/** Participation style — `'addressed-only'` agents are routed only on a direct address (resolved live by the plugin). */
|
|
66
|
+
Mode: 'proactive' | 'addressed-only';
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* The context handed to the room {@link TurnModerator} for ONE decision: the roster, the recent diarized
|
|
70
|
+
* lookback (incl. the triggering turn), and the bookkeeping the moderator needs to honor progress/observability.
|
|
71
|
+
*/
|
|
72
|
+
export interface TurnModeratorContext {
|
|
73
|
+
/** The external room key. */
|
|
74
|
+
RoomKey: string;
|
|
75
|
+
/** Every agent currently in the room. */
|
|
76
|
+
Roster: ModeratorRosterAgent[];
|
|
77
|
+
/** Recent diarized turns oldest→newest (the engine's bounded buffer; the moderator narrows per its config). */
|
|
78
|
+
Lookback: ModeratorLookbackTurn[];
|
|
79
|
+
/** The turn that triggered this decision (also the last element of {@link TurnModeratorContext.Lookback}). */
|
|
80
|
+
LatestTurn: ModeratorLookbackTurn;
|
|
81
|
+
/** Consecutive agent-only turns since the last human turn (for the optional ping-pong backstop). */
|
|
82
|
+
ConsecutiveAgentOnlyTurns: number;
|
|
83
|
+
/** A representative co-agent run id to tie the moderator prompt run to (observability). */
|
|
84
|
+
AgentRunID?: string;
|
|
85
|
+
/** The representative (scribe) bridge's `AIAgentSession` id — the plugin uses it to resolve the co-agent run id for observability when {@link TurnModeratorContext.AgentRunID} is absent. */
|
|
86
|
+
RepAgentSessionID?: string;
|
|
87
|
+
/** The context user + provider for the moderator's own metadata/prompt operations. */
|
|
88
|
+
ContextUser?: UserInfo;
|
|
89
|
+
Provider?: IMetadataProvider;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* The room turn **moderator** — injected (like the transcript sink / run finalizer) so the engine stays
|
|
93
|
+
* framework-agnostic. Given one turn's context, it returns the **ordered** `AgentSessionID`s that should
|
|
94
|
+
* speak next (empty = nobody; the room goes quiet / hands back to the human). The engine triggers them
|
|
95
|
+
* **serially** via the floor. The agent-layer implementation is a fast LLM prompt run; see
|
|
96
|
+
* `@memberjunction/ai-agents` `RealtimeTurnModerator`. When no moderator is set the engine falls back to the
|
|
97
|
+
* per-agent addressed matchers.
|
|
98
|
+
*/
|
|
99
|
+
export type TurnModerator = (ctx: TurnModeratorContext) => Promise<string[]>;
|
|
7
100
|
/**
|
|
8
101
|
* The host-instance identity provider the engine uses to stamp `HostInstanceID` for node affinity
|
|
9
102
|
* and orphan reconciliation. Mirrors `@memberjunction/server`'s `HostInstance` helper but is
|
|
@@ -43,6 +136,8 @@ export declare class DefaultHostInstanceIdentity implements IHostInstanceIdentit
|
|
|
43
136
|
export interface StartBridgeSessionParams {
|
|
44
137
|
/** The `MJ: AI Agent Sessions` row this bridge attaches to (the session IS the existing session). */
|
|
45
138
|
AgentSessionID: string;
|
|
139
|
+
/** The voicing agent's `MJ: AI Agents` id — used only to attribute this agent's transcript lines. */
|
|
140
|
+
AgentID?: string;
|
|
46
141
|
/** The bridge provider to transport through (resolved to its `DriverClass` for ClassFactory). */
|
|
47
142
|
Provider: MJAIBridgeProviderEntity;
|
|
48
143
|
/**
|
|
@@ -74,6 +169,14 @@ export interface StartBridgeSessionParams {
|
|
|
74
169
|
TurnScorer?: IWorthSayingScorer;
|
|
75
170
|
/** Optional extra turn-taking tuning (silence window, throttle, score threshold, clock). */
|
|
76
171
|
TurnTuning?: Partial<Omit<TurnTakingPolicyConfig, 'Mode' | 'Matcher' | 'Scorer'>>;
|
|
172
|
+
/**
|
|
173
|
+
* **Multi-agent meeting mode.** When `true`, the realtime model's blind auto-response was disabled at
|
|
174
|
+
* session start (the agent layer set `disableAutoResponse` on the model session), so the BRIDGE is the
|
|
175
|
+
* sole speech trigger: on a `Speak` turn decision the engine issues exactly one `RequestSpokenUpdate`.
|
|
176
|
+
* When `false`/absent the model auto-responds and the engine must NOT also trigger (it would double-fire).
|
|
177
|
+
* Must agree with what the session was opened with. See `plans/realtime/multi-agent-meeting-turn-taking.md`.
|
|
178
|
+
*/
|
|
179
|
+
DisableAutoResponse?: boolean;
|
|
77
180
|
/** Per-session bridge configuration (resolved credential refs, region, …) passed to the driver. */
|
|
78
181
|
Configuration?: Record<string, unknown>;
|
|
79
182
|
/**
|
|
@@ -95,6 +198,32 @@ export interface StartBridgeSessionParams {
|
|
|
95
198
|
ContextUser?: UserInfo;
|
|
96
199
|
/** The request-scoped metadata provider for all entity operations (multi-provider safe). */
|
|
97
200
|
MetadataProvider?: IMetadataProvider;
|
|
201
|
+
/**
|
|
202
|
+
* Optional per-session override for binding the driver's SDK factory, applied to the resolved driver
|
|
203
|
+
* just before `Connect`. When supplied it takes precedence over the {@link BridgeNativeSdkRegistry}
|
|
204
|
+
* default — use it to choose a non-default binding for a provider that has more than one (e.g. Zoom's
|
|
205
|
+
* RTMS receive-only binding instead of the native two-way default) or to inject a fake in a test.
|
|
206
|
+
* When omitted, the engine applies the provider's registered native binding (if any).
|
|
207
|
+
*/
|
|
208
|
+
BindSdk?: BridgeNativeSdkBinding;
|
|
209
|
+
/**
|
|
210
|
+
* This agent's participation style in a MULTI-agent room, surfaced to the room turn moderator:
|
|
211
|
+
* `'proactive'` (default) may jump in unaddressed when judged relevant; `'addressed-only'` speaks only
|
|
212
|
+
* when directly addressed. Ignored in single-agent rooms.
|
|
213
|
+
*/
|
|
214
|
+
ParticipationMode?: 'proactive' | 'addressed-only';
|
|
215
|
+
/** The names/aliases this agent answers to — the moderator's roster entry + the addressed-only fallback. */
|
|
216
|
+
AgentNames?: string[];
|
|
217
|
+
/** A short role/description of the voiced agent — context the moderator uses to judge relevance. */
|
|
218
|
+
AgentRole?: string;
|
|
219
|
+
/** The voiced agent's `MJ: AI Agent Runs` id — tied to each moderator prompt run for observability. */
|
|
220
|
+
AgentRunID?: string;
|
|
221
|
+
/**
|
|
222
|
+
* The TARGET agent this co-agent voices (the role/identity the user hears — e.g. Sage), when distinct from
|
|
223
|
+
* {@link StartBridgeSessionParams.AgentID} (the generic co-agent). The moderator resolves the agent's role
|
|
224
|
+
* + per-agent `turnTaking.mode` from this agent's config.
|
|
225
|
+
*/
|
|
226
|
+
TargetAgentID?: string;
|
|
98
227
|
}
|
|
99
228
|
/**
|
|
100
229
|
* The live, in-memory handle for one running bridged session held by the engine. Carries the driver,
|
|
@@ -106,12 +235,74 @@ export interface ActiveBridgeSession {
|
|
|
106
235
|
SessionBridgeID: string;
|
|
107
236
|
/** The `MJ: AI Agent Sessions` row id the bridge is attached to. */
|
|
108
237
|
AgentSessionID: string;
|
|
238
|
+
/** The voicing agent's `MJ: AI Agents` id — stamped on this agent's transcript lines for attribution. */
|
|
239
|
+
AgentID?: string;
|
|
109
240
|
/** The concrete driver instance transporting media. */
|
|
110
241
|
Bridge: BaseRealtimeBridge;
|
|
111
242
|
/** The realtime session the driver's media plane is wired to. */
|
|
112
243
|
RealtimeSession: IRealtimeSession;
|
|
113
244
|
/** The per-session turn-taking policy gating generation. */
|
|
114
245
|
TurnPolicy: TurnTakingPolicy;
|
|
246
|
+
/**
|
|
247
|
+
* Whether the model's blind auto-response is OFF for this session (multi-agent meeting). When `true`
|
|
248
|
+
* the bridge is the sole speech trigger — a `Speak` decision issues one `RequestSpokenUpdate`. When
|
|
249
|
+
* `false` the model auto-responds and the engine stays hands-off (forcing would double-fire).
|
|
250
|
+
*/
|
|
251
|
+
DisableAutoResponse: boolean;
|
|
252
|
+
/**
|
|
253
|
+
* Whether at least one HUMAN participant has been seen in the room. Auto-leave only fires after a human
|
|
254
|
+
* was present and then all humans left — so a bot that joins ahead of anyone (or a momentarily bot-only
|
|
255
|
+
* roster at startup) is never reaped prematurely. Set by the occupancy check off the driver roster.
|
|
256
|
+
*/
|
|
257
|
+
HasSeenHuman: boolean;
|
|
258
|
+
/**
|
|
259
|
+
* Pending grace timer started when the last human leaves. If a human rejoins within the grace window
|
|
260
|
+
* (e.g. a page refresh) it is cleared; otherwise it fires {@link AIBridgeEngine.StopBridgeSession} so the
|
|
261
|
+
* bot leaves the empty room and its co-agent run finalizes. Cleared on any teardown.
|
|
262
|
+
*/
|
|
263
|
+
LeaveGraceTimer?: ReturnType<typeof setTimeout>;
|
|
264
|
+
/** The room key (driver `ExternalConnectionId`) this session is in — the unified-transcript room grouping. */
|
|
265
|
+
RoomKey?: string;
|
|
266
|
+
/** This session's own bot participant id on the endpoint — the speaker label on its own transcript lines. */
|
|
267
|
+
BotParticipantID?: string;
|
|
268
|
+
/**
|
|
269
|
+
* Whether THIS session is the room's transcript **scribe**. Exactly one session per room writes the
|
|
270
|
+
* unified meeting transcript (its own speech + everything it hears), so a multi-agent room records one
|
|
271
|
+
* copy, not N. Elected at connect (first session in the room); re-elected if the scribe leaves.
|
|
272
|
+
*/
|
|
273
|
+
IsTranscriptScribe: boolean;
|
|
274
|
+
/**
|
|
275
|
+
* Whether this session currently holds the room's speaking floor (multi-agent floor control). Set when
|
|
276
|
+
* the engine claims the floor before triggering speech in meeting mode, cleared when the agent's own
|
|
277
|
+
* final transcript lands (it finished) or on teardown. Single-agent rooms always hold trivially.
|
|
278
|
+
*/
|
|
279
|
+
HoldsFloor: boolean;
|
|
280
|
+
/**
|
|
281
|
+
* Safety timer that force-releases a held floor after {@link FLOOR_MAX_HOLD_MS} in case the agent's
|
|
282
|
+
* final transcript never arrives — so one agent can't wedge the room's floor closed. Cleared on a
|
|
283
|
+
* normal release.
|
|
284
|
+
*/
|
|
285
|
+
FloorReleaseTimer?: ReturnType<typeof setTimeout>;
|
|
286
|
+
/** Epoch-ms when this session connected — drives the max-session-duration cap of the stale sweep. */
|
|
287
|
+
ConnectedAtMs: number;
|
|
288
|
+
/** Epoch-ms of the last inbound activity (transcript) — drives the idle cap of the stale sweep. */
|
|
289
|
+
LastActivityMs: number;
|
|
290
|
+
/**
|
|
291
|
+
* The participant identity of the most-recent inbound AUDIO frame (when the provider diarizes). Used to
|
|
292
|
+
* attribute a 'user' transcript to the speaker who produced it — since the model transcript itself has
|
|
293
|
+
* no speaker label. Approximate (single-speaker-at-a-time); `undefined` until the first diarized frame.
|
|
294
|
+
*/
|
|
295
|
+
LastInboundSpeaker?: string;
|
|
296
|
+
/** This agent's participation style for the room moderator (`'proactive'` | `'addressed-only'`). */
|
|
297
|
+
ParticipationMode: 'proactive' | 'addressed-only';
|
|
298
|
+
/** The names/aliases this agent answers to (moderator roster + addressed-only fallback). */
|
|
299
|
+
AgentNames: string[];
|
|
300
|
+
/** A short role/description of the voiced agent (moderator relevance context). */
|
|
301
|
+
AgentRole?: string;
|
|
302
|
+
/** The voiced agent's `MJ: AI Agent Runs` id — tied to each moderator prompt run for observability. */
|
|
303
|
+
AgentRunID?: string;
|
|
304
|
+
/** The TARGET agent this co-agent voices (role/identity source for the moderator), when distinct from {@link ActiveBridgeSession.AgentID}. */
|
|
305
|
+
TargetAgentID?: string;
|
|
115
306
|
/** The provider row backing this session. */
|
|
116
307
|
Provider: MJAIBridgeProviderEntity;
|
|
117
308
|
/** The context user the session runs as (for participant upserts / teardown writes). */
|
|
@@ -169,8 +360,37 @@ export interface ActiveBridgeSession {
|
|
|
169
360
|
* @see `/plans/realtime/realtime-bridges-architecture.md` §2 (layer cake), §7 (lifecycle), §10 (security/janitor).
|
|
170
361
|
*/
|
|
171
362
|
export declare class AIBridgeEngine extends BaseSingleton<AIBridgeEngine> implements IStartupSink {
|
|
363
|
+
/** Registered by the agent layer; finalizes dangling co-agent runs on orphan/cross-host teardown. */
|
|
364
|
+
private runFinalizer?;
|
|
365
|
+
/** Interval handle for the self-scheduled stale-session sweep (started via {@link StartStaleSessionSweep}). */
|
|
366
|
+
private staleSweepTimer?;
|
|
367
|
+
private idleTtlMs;
|
|
368
|
+
private maxDurationMs;
|
|
369
|
+
private emptyGraceMs;
|
|
370
|
+
private floorMaxHoldMs;
|
|
371
|
+
/** Registered by the app layer; persists the unified per-room transcript from the elected scribe. */
|
|
372
|
+
private transcriptSink?;
|
|
373
|
+
/** roomKey (lowercased) → the bridge id of that room's current transcript scribe. Election dedup. */
|
|
374
|
+
private readonly roomScribes;
|
|
375
|
+
/** Diagnostic: session ids that have already logged their first inbound / outbound media frame. */
|
|
376
|
+
private diagInbound;
|
|
377
|
+
private diagOutbound;
|
|
172
378
|
/** In-memory registry of bridged sessions this process currently hosts, keyed by bridge id (lowercased). */
|
|
173
379
|
private activeSessions;
|
|
380
|
+
/** Per-room, per-utterance-text last-dispatch timestamps — collapses duplicate transcriptions (see {@link ROOM_TURN_DEDUP_MS}). */
|
|
381
|
+
private recentRoomTurnDispatch;
|
|
382
|
+
/** Optional injected room turn moderator (LLM router). When set, multi-agent rooms use it instead of per-agent matchers. */
|
|
383
|
+
private turnModerator?;
|
|
384
|
+
/** Per-room rolling diarized lookback the moderator reads. Bounded to {@link ROOM_LOOKBACK_MAX_TURNS}. */
|
|
385
|
+
private roomLookback;
|
|
386
|
+
/** Per-room ordered queue of `AgentSessionID`s the moderator decided should speak, drained serially via the floor. */
|
|
387
|
+
private roomSpeakerQueue;
|
|
388
|
+
/** Per-room count of consecutive agent-only turns since the last human turn (optional ping-pong backstop). */
|
|
389
|
+
private roomConsecutiveAgentTurns;
|
|
390
|
+
/** Rooms with a moderator decision in flight — prevents overlapping moderator calls for one room. */
|
|
391
|
+
private roomModeratorBusy;
|
|
392
|
+
/** Per-room latest turn that arrived while the moderator was busy — run once the in-flight call finishes (no turn lost). */
|
|
393
|
+
private roomPendingTurn;
|
|
174
394
|
/** Host-instance identity provider; injected by the host application or defaulted for standalone use. */
|
|
175
395
|
private hostIdentity;
|
|
176
396
|
/**
|
|
@@ -225,6 +445,44 @@ export declare class AIBridgeEngine extends BaseSingleton<AIBridgeEngine> implem
|
|
|
225
445
|
ProviderByDriverClass(driverClass: string): MJAIBridgeProviderEntity | undefined;
|
|
226
446
|
/** Resolves an agent identity by its address value. @see AIBridgeEngineBase.IdentityByValue */
|
|
227
447
|
IdentityByValue(identityValue: string, providerId?: string): MJAIBridgeAgentIdentityEntity | undefined;
|
|
448
|
+
/**
|
|
449
|
+
* Registers the {@link BridgeSessionRunFinalizer} this engine calls when a bridge is marked disconnected
|
|
450
|
+
* without a live in-memory session (orphan/cross-host reap) — so the co-agent run finalizes there too,
|
|
451
|
+
* not only on the same-process `Close()` path. Bound once at startup by the agent layer. Idempotent.
|
|
452
|
+
*
|
|
453
|
+
* @param finalizer The finalizer (from `@memberjunction/ai-agents`).
|
|
454
|
+
*/
|
|
455
|
+
SetSessionRunFinalizer(finalizer: BridgeSessionRunFinalizer): void;
|
|
456
|
+
/**
|
|
457
|
+
* Overrides the session timing thresholds (the idle/max-duration sweep caps, the empty-room auto-leave
|
|
458
|
+
* grace, and the floor max-hold). Any omitted value keeps its default. Call once at startup to tune for a
|
|
459
|
+
* deployment (e.g. shorter idle TTL for a high-churn telephony host).
|
|
460
|
+
*
|
|
461
|
+
* @param timings The thresholds to override (ms).
|
|
462
|
+
*/
|
|
463
|
+
ConfigureSessionTimings(timings: {
|
|
464
|
+
IdleTtlMs?: number;
|
|
465
|
+
MaxDurationMs?: number;
|
|
466
|
+
EmptyGraceMs?: number;
|
|
467
|
+
FloorMaxHoldMs?: number;
|
|
468
|
+
}): void;
|
|
469
|
+
/**
|
|
470
|
+
* Registers the {@link BridgeTranscriptSink} that persists the unified per-room transcript. The engine
|
|
471
|
+
* elects one scribe per room and feeds its final transcript lines here; the sink owns *where* they land
|
|
472
|
+
* (e.g. an `MJ: Conversations` "Meeting Room"). Bound once at startup by the app layer. Without it, no
|
|
473
|
+
* transcript is persisted (the engine still elects a scribe but emits nothing).
|
|
474
|
+
*
|
|
475
|
+
* @param sink The transcript sink (from the app layer).
|
|
476
|
+
*/
|
|
477
|
+
SetTranscriptSink(sink: BridgeTranscriptSink): void;
|
|
478
|
+
/**
|
|
479
|
+
* Injects the room turn {@link TurnModerator} (the LLM router). When set, a MULTI-agent room routes each
|
|
480
|
+
* turn through it (who speaks next, serialized via the floor) instead of evaluating per-agent matchers.
|
|
481
|
+
* Single-agent rooms and the no-moderator case are unaffected (they keep using the matcher path).
|
|
482
|
+
*
|
|
483
|
+
* @param moderator The moderator function, or `undefined` to clear it.
|
|
484
|
+
*/
|
|
485
|
+
SetTurnModerator(moderator: TurnModerator | undefined): void;
|
|
228
486
|
/** Returns the active identities for an agent. @see AIBridgeEngineBase.IdentitiesForAgent */
|
|
229
487
|
IdentitiesForAgent(agentId: string, providerId?: string): MJAIBridgeAgentIdentityEntity[];
|
|
230
488
|
/** Returns a provider's channels ordered by sequence. @see AIBridgeEngineBase.ChannelsForProvider */
|
|
@@ -361,6 +619,19 @@ export declare class AIBridgeEngine extends BaseSingleton<AIBridgeEngine> implem
|
|
|
361
619
|
* @param active The live bridged session to track participants for.
|
|
362
620
|
*/
|
|
363
621
|
private wireParticipantTracking;
|
|
622
|
+
/**
|
|
623
|
+
* Decides whether an emptied room should auto-leave. Marks {@link ActiveBridgeSession.HasSeenHuman}
|
|
624
|
+
* once any human is present; when a human WAS present and the roster drops to agents-only, it arms a
|
|
625
|
+
* grace timer ({@link ROOM_EMPTY_GRACE_MS}) that stops the session (so a page-refresh re-join cancels
|
|
626
|
+
* it). The stop routes through {@link StopBridgeSession} → driver disconnect → realtime `Close()`, which
|
|
627
|
+
* finalizes the co-agent run — so a closed tab no longer leaves a `Connected` bridge + `Running` run.
|
|
628
|
+
*
|
|
629
|
+
* Only providers with a roster (diarization) reach here; rosterless transports rely on the host janitor.
|
|
630
|
+
*
|
|
631
|
+
* @param active The live bridged session.
|
|
632
|
+
* @param participants The current roster from the driver.
|
|
633
|
+
*/
|
|
634
|
+
private evaluateRoomOccupancy;
|
|
364
635
|
/**
|
|
365
636
|
* Upserts the supplied participants onto the bridge as `AIAgentSessionBridgeParticipant` rows,
|
|
366
637
|
* matching existing rows by `ExternalParticipantID`. Best-effort: a failed write is logged and
|
|
@@ -387,6 +658,71 @@ export declare class AIBridgeEngine extends BaseSingleton<AIBridgeEngine> implem
|
|
|
387
658
|
* @param active The live bridged session.
|
|
388
659
|
*/
|
|
389
660
|
private wireTurnTaking;
|
|
661
|
+
/**
|
|
662
|
+
* Routes a completed human turn to the addressing gate(s). In a **single-agent** room (or 1:1) only the
|
|
663
|
+
* source agent evaluates. In a **multi-agent** room the user's utterance is the SAME for everyone, so we
|
|
664
|
+
* broadcast it to EVERY agent's `TurnPolicy` — each independently decides "was I addressed?". This is the
|
|
665
|
+
* fix for agents whose own model can't transcribe in meeting mode (e.g. Gemini with automatic activity
|
|
666
|
+
* detection disabled): whichever agent CAN transcribe the room (e.g. the GPT agent, or the scribe) drives
|
|
667
|
+
* the addressing decision for all of them. The audio plane is untouched — every agent already hears the
|
|
668
|
+
* raw audio; this only decides WHEN each is triggered to commit + speak.
|
|
669
|
+
*
|
|
670
|
+
* Dedup: the same utterance may be transcribed by several agents (slightly apart). A per-room, per-text
|
|
671
|
+
* time window collapses those re-transcriptions so each real utterance dispatches to the room once.
|
|
672
|
+
*
|
|
673
|
+
* @param source The bridge whose session produced the transcript.
|
|
674
|
+
* @param text The final user-turn text.
|
|
675
|
+
*/
|
|
676
|
+
private dispatchUserTurn;
|
|
677
|
+
/** Marks a human as present on a session: remembers it + cancels any pending empty-room auto-leave. */
|
|
678
|
+
private noteHumanPresence;
|
|
679
|
+
/** Evaluates ONE agent's addressed-matcher against a user utterance and acts on the decision (fallback path). */
|
|
680
|
+
private evaluateUserTurnForAgent;
|
|
681
|
+
/** All active bridged sessions sharing a room (by external room key), case-insensitive. */
|
|
682
|
+
private roomAgents;
|
|
683
|
+
/** A diarized speaker label for a session (the agent's first name, or a generic human label). */
|
|
684
|
+
private speakerLabel;
|
|
685
|
+
/**
|
|
686
|
+
* Appends one final turn to the room's bounded, clipped diarized lookback (oldest→newest). Sourcing rules
|
|
687
|
+
* keep the thread clean in a multi-agent room (where EVERY agent's session independently transcribes what
|
|
688
|
+
* it hears):
|
|
689
|
+
* - **Agent (assistant) turns** are recorded from the speaking agent's OWN bridge (correct, no duplication).
|
|
690
|
+
* - **Human (user) turns** are recorded ONLY by the room **scribe** (one canonical hearer → no N-fold
|
|
691
|
+
* duplication), and ONLY when the diarized inbound speaker is a human — a `user` transcript whose speaker
|
|
692
|
+
* is another AGENT (the scribe overhearing a peer agent) is dropped here, since that agent's own bridge
|
|
693
|
+
* already recorded it as its assistant turn.
|
|
694
|
+
*/
|
|
695
|
+
private recordRoomTurn;
|
|
696
|
+
/**
|
|
697
|
+
* Called when an agent finishes a turn. Advances a multi-agent room: increments the consecutive-agent-only
|
|
698
|
+
* counter and — if a moderator is wired and the room's speaker queue is empty — runs the moderator to decide
|
|
699
|
+
* whether (and who) continues the discussion. Because this fires on the agent's FINAL TEXT (its audio is
|
|
700
|
+
* still playing out), the moderator's latency is hidden behind playback. No-op for single-agent rooms.
|
|
701
|
+
*/
|
|
702
|
+
private onAgentTurnCompleted;
|
|
703
|
+
/**
|
|
704
|
+
* Runs the room turn moderator for one decision: builds the context, calls the injected moderator, sets the
|
|
705
|
+
* room's ordered speaker queue to its result, and drains it (serialized via the floor). Guards against
|
|
706
|
+
* overlapping calls per room and against an unproductive agent-only loop via the optional consecutive cap.
|
|
707
|
+
*
|
|
708
|
+
* @param roomKey The external room key.
|
|
709
|
+
* @param latest The turn that triggered this decision.
|
|
710
|
+
* @param isContinuation True when triggered by an agent turn (vs a fresh human turn).
|
|
711
|
+
*/
|
|
712
|
+
private runRoomModerator;
|
|
713
|
+
/** Builds the {@link TurnModeratorContext} for a room from the live roster + diarized lookback. */
|
|
714
|
+
private buildModeratorContext;
|
|
715
|
+
/** Triggers the next queued speaker for a room (serialized — only when the floor is free). */
|
|
716
|
+
private drainSpeakerQueue;
|
|
717
|
+
/**
|
|
718
|
+
* Claims the room floor and triggers the model to speak exactly one turn (meeting mode). Returns `false`
|
|
719
|
+
* (stays silent) when another agent holds the floor. Shared by the matcher path and the moderator drainer.
|
|
720
|
+
*/
|
|
721
|
+
private triggerMeetingSpeak;
|
|
722
|
+
/** A short label for an `AgentSessionID` (the agent's first name) for diagnostics. */
|
|
723
|
+
private agentSessionLabel;
|
|
724
|
+
/** Clears a room's moderator state (lookback, queue, counter) — on barge-in (queue only) or teardown (all). */
|
|
725
|
+
private clearRoomModeratorState;
|
|
390
726
|
/**
|
|
391
727
|
* Acts on a turn-taking decision. Kept behind the injected {@link IRealtimeSession} interface so
|
|
392
728
|
* the actual model trigger stays the session's concern and the engine remains testable.
|
|
@@ -402,6 +738,59 @@ export declare class AIBridgeEngine extends BaseSingleton<AIBridgeEngine> implem
|
|
|
402
738
|
* @returns The configured turn-taking policy.
|
|
403
739
|
*/
|
|
404
740
|
private buildTurnPolicy;
|
|
741
|
+
/**
|
|
742
|
+
* Retroactively switches an already-running session into **meeting mode** (auto-response off +
|
|
743
|
+
* addressed-only) — used when a room becomes multi-agent and the first (1:1) agent must stop
|
|
744
|
+
* auto-responding. **Capability-gated**: only sessions whose provider reports
|
|
745
|
+
* {@link RealtimeSessionCapabilities.CanReconfigureTurnMode} can change turn mode on a live socket;
|
|
746
|
+
* others (e.g. Gemini, fixed at connect) are left in their start mode — no dead-method call. Idempotent.
|
|
747
|
+
*
|
|
748
|
+
* @param sessionBridgeID The bridge to re-gate.
|
|
749
|
+
* @param matcher The addressed-matcher (the agent's names) the re-gated session should speak on.
|
|
750
|
+
* @returns `true` if now in meeting mode (or already was); `false` if the session is unknown or the
|
|
751
|
+
* provider can't reconfigure mid-session.
|
|
752
|
+
*/
|
|
753
|
+
ReconfigureSessionToMeeting(sessionBridgeID: string, matcher: IAddressedMatcher): boolean;
|
|
754
|
+
/**
|
|
755
|
+
* Marks the session as holding the room floor and arms the safety release timer (so a missed
|
|
756
|
+
* end-of-speech can't wedge the floor closed). Called right after a granted {@link TakeFloor}.
|
|
757
|
+
*
|
|
758
|
+
* @param active The session that just claimed the floor.
|
|
759
|
+
*/
|
|
760
|
+
private armFloorHold;
|
|
761
|
+
/**
|
|
762
|
+
* Releases the room floor this session holds (if any) and clears the safety timer. Idempotent and safe
|
|
763
|
+
* for non-room / single-agent sessions (a no-op when the session never held the floor). Called on the
|
|
764
|
+
* agent's own final transcript, the safety timeout, and teardown.
|
|
765
|
+
*
|
|
766
|
+
* @param active The session to release the floor for.
|
|
767
|
+
*/
|
|
768
|
+
private releaseRoomFloor;
|
|
769
|
+
/**
|
|
770
|
+
* Elects this session as its room's transcript **scribe** iff a transcript sink is registered, the
|
|
771
|
+
* session has a room key, and no scribe exists for that room yet. Exactly one scribe per room writes the
|
|
772
|
+
* unified transcript, so a multi-agent room records one copy (the scribe hears everyone), not N.
|
|
773
|
+
*
|
|
774
|
+
* @param active The freshly connected session.
|
|
775
|
+
*/
|
|
776
|
+
private electTranscriptScribe;
|
|
777
|
+
/**
|
|
778
|
+
* Releases this session's scribe role on teardown and HANDS OFF to another live session in the same
|
|
779
|
+
* room (so the transcript continues when the original scribe leaves a still-occupied room). No-op when
|
|
780
|
+
* the session wasn't the scribe. Called during disconnect while the session is still in the active map.
|
|
781
|
+
*
|
|
782
|
+
* @param active The session being torn down.
|
|
783
|
+
*/
|
|
784
|
+
private releaseTranscriptScribe;
|
|
785
|
+
/**
|
|
786
|
+
* Emits one FINAL transcript line to the registered sink — only from the room's scribe, so the room
|
|
787
|
+
* gets a single unified transcript. The scribe's OWN speech (`assistant`) is attributed to it; everything
|
|
788
|
+
* it hears (`user`) is recorded as heard. Best-effort: a sink failure is logged, never fatal to media.
|
|
789
|
+
*
|
|
790
|
+
* @param active The scribe session.
|
|
791
|
+
* @param t The final transcript line.
|
|
792
|
+
*/
|
|
793
|
+
private emitTranscriptLine;
|
|
405
794
|
/**
|
|
406
795
|
* Wires the session's server-side channel plane (Phase 2's `RealtimeChannelServerHost` +
|
|
407
796
|
* `MeetingControlsChannelServer`) to this bridged session — the generic, platform-agnostic
|
|
@@ -433,6 +822,27 @@ export declare class AIBridgeEngine extends BaseSingleton<AIBridgeEngine> implem
|
|
|
433
822
|
* @param active The live bridged session whose channels to close.
|
|
434
823
|
*/
|
|
435
824
|
private closeChannelPlane;
|
|
825
|
+
/**
|
|
826
|
+
* Reaps **live, same-process** sessions that have gone stale — idle past {@link SESSION_IDLE_TTL_MS}
|
|
827
|
+
* (no inbound transcript) or running past {@link SESSION_MAX_DURATION_MS}. This is the same-process
|
|
828
|
+
* complement to {@link ReconcileOrphans} (prior-boot orphans): it covers a missed leave event, a
|
|
829
|
+
* rosterless transport with no occupancy signal, and "the bot joined but nobody came." Each reap routes
|
|
830
|
+
* through {@link StopBridgeSession} using the session's own user/provider, so the co-agent run finalizes.
|
|
831
|
+
*
|
|
832
|
+
* Tolerant: a single failed stop is logged and the sweep continues. Safe to call on any cadence.
|
|
833
|
+
*
|
|
834
|
+
* @param nowMs Current epoch-ms (injectable for tests; defaults to `Date.now()`).
|
|
835
|
+
* @returns The number of stale sessions reaped.
|
|
836
|
+
*/
|
|
837
|
+
SweepStaleSessions(nowMs?: number): Promise<number>;
|
|
838
|
+
/**
|
|
839
|
+
* Starts the self-scheduled stale-session sweep ({@link SweepStaleSessions} every
|
|
840
|
+
* {@link STALE_SWEEP_INTERVAL_MS}). Idempotent — calling again is a no-op while a sweep is scheduled.
|
|
841
|
+
* The host opts in once at startup; {@link StopStaleSessionSweep} cancels it (e.g. for tests/shutdown).
|
|
842
|
+
*/
|
|
843
|
+
StartStaleSessionSweep(intervalMs?: number): void;
|
|
844
|
+
/** Cancels the self-scheduled stale-session sweep, if running. */
|
|
845
|
+
StopStaleSessionSweep(): void;
|
|
436
846
|
/**
|
|
437
847
|
* Force-closes `Connected`/`Connecting` bridges left behind by a **previous boot of this host**
|
|
438
848
|
* (matching hostname prefix, differing instance id), stamping `CloseReason = 'Janitor'`. Mirrors
|
|
@@ -450,6 +860,17 @@ export declare class AIBridgeEngine extends BaseSingleton<AIBridgeEngine> implem
|
|
|
450
860
|
ReconcileOrphans(contextUser: UserInfo, provider: IMetadataProvider): Promise<number>;
|
|
451
861
|
/** Loads the orphaned bridge rows matching the janitor filter. */
|
|
452
862
|
private loadOrphanRows;
|
|
863
|
+
/**
|
|
864
|
+
* Binds the SDK factory onto a resolved driver before `Connect`. Precedence: a per-session
|
|
865
|
+
* {@link StartBridgeSessionParams.BindSdk} override wins; otherwise the provider's registered native
|
|
866
|
+
* binding from the {@link BridgeNativeSdkRegistry} is applied. When neither exists the driver keeps its
|
|
867
|
+
* default factory (which fails loudly at connect if it actually needs an SDK — e.g. LoopbackBridge has
|
|
868
|
+
* no SDK and needs no binding, so this is a harmless no-op for it).
|
|
869
|
+
*
|
|
870
|
+
* @param params The start params (its `BindSdk` is the override).
|
|
871
|
+
* @param driver The resolved driver to bind onto.
|
|
872
|
+
*/
|
|
873
|
+
private bindDriverSdk;
|
|
453
874
|
/**
|
|
454
875
|
* Resolves the concrete bridge driver for a provider via the MJ `ClassFactory`, keyed by the
|
|
455
876
|
* provider's `DriverClass`.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ai-bridge-engine.d.ts","sourceRoot":"","sources":["../src/ai-bridge-engine.ts"],"names":[],"mappings":"AAAA,OAAO,EACH,iBAAiB,EACjB,YAAY,EACZ,QAAQ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