@memberjunction/ai-bridge-server 6.2.0-edge.2 → 6.2.0-edge.4
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.
- package/README.md +86 -12
- package/dist/ai-bridge-engine.d.ts +436 -38
- package/dist/ai-bridge-engine.d.ts.map +1 -1
- package/dist/ai-bridge-engine.js +878 -84
- package/dist/ai-bridge-engine.js.map +1 -1
- package/dist/bridge-prior-transcript.d.ts +39 -0
- package/dist/bridge-prior-transcript.d.ts.map +1 -0
- package/dist/bridge-prior-transcript.js +56 -0
- package/dist/bridge-prior-transcript.js.map +1 -0
- package/dist/calendar-watcher.d.ts.map +1 -1
- package/dist/calendar-watcher.js +1 -0
- package/dist/calendar-watcher.js.map +1 -1
- package/dist/dtmf-coalescer.d.ts +32 -0
- package/dist/dtmf-coalescer.d.ts.map +1 -0
- package/dist/dtmf-coalescer.js +60 -0
- package/dist/dtmf-coalescer.js.map +1 -0
- package/dist/full-duplex-turn-gate.d.ts +155 -0
- package/dist/full-duplex-turn-gate.d.ts.map +1 -0
- package/dist/full-duplex-turn-gate.js +229 -0
- package/dist/full-duplex-turn-gate.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/index.js.map +1 -1
- package/dist/loopback-bridge.d.ts +33 -1
- package/dist/loopback-bridge.d.ts.map +1 -1
- package/dist/loopback-bridge.js +39 -0
- package/dist/loopback-bridge.js.map +1 -1
- package/dist/multi-agent-room-coordinator.d.ts +226 -24
- package/dist/multi-agent-room-coordinator.d.ts.map +1 -1
- package/dist/multi-agent-room-coordinator.js +376 -39
- package/dist/multi-agent-room-coordinator.js.map +1 -1
- package/package.json +6 -6
|
@@ -23,9 +23,24 @@
|
|
|
23
23
|
* the overlap.
|
|
24
24
|
* 3. **Facilitator override** — an optional designated **facilitator** agent (one that runs the Meeting
|
|
25
25
|
* Controls channel) may be granted the floor even while another agent holds it, so it can arbitrate /
|
|
26
|
-
* call on a specific agent. See {@link
|
|
26
|
+
* call on a specific agent. See {@link RegisterRoomParticipant}'s `isFacilitator` and
|
|
27
27
|
* {@link CanTakeFloor}'s facilitator path.
|
|
28
28
|
*
|
|
29
|
+
* ## Full-duplex rules (the models listen while they speak)
|
|
30
|
+
* Turn-based models were gated by voice-activity detection; full-duplex models decide for themselves when
|
|
31
|
+
* to speak, so the coordinator is the **safety net** behind their own judgement. It adds, on top of 1–3:
|
|
32
|
+
*
|
|
33
|
+
* 4. **Humans win** — human speech ({@link NoteHumanSpeech}) preempts the floor holder immediately, cancels
|
|
34
|
+
* any pending hand-off, and denies every agent until the human has been quiet for the hold window. This
|
|
35
|
+
* outranks even the facilitator override.
|
|
36
|
+
* 5. **Backchannels** — a short acknowledgement ("mm-hm") does not need and never takes the floor, so it
|
|
37
|
+
* cannot interrupt another agent's turn ({@link CanTakeFloor}/{@link TakeFloor} with kind `Backchannel`;
|
|
38
|
+
* "short" is {@link import('@memberjunction/ai-bridge-base').IsBackchannel}). Anything longer is a turn.
|
|
39
|
+
* 6. **Explicit hand-off** — a speaking agent can {@link YieldFloor} to a named agent; the floor is reserved
|
|
40
|
+
* for that agent for a short TTL, so no third agent can start in the gap and two agents never start at once.
|
|
41
|
+
* 7. **Loop cap** — after {@link DEFAULT_MAX_CONSECUTIVE_AGENT_TURNS} consecutive agent turns with no human in
|
|
42
|
+
* between, every agent is denied (`LoopCapReached`) until a human speaks — the agent-to-agent runaway breaker.
|
|
43
|
+
*
|
|
29
44
|
* ## Echo / self-audio (documented, handled by the bridge, not here)
|
|
30
45
|
* A bot must not hear its OWN output, or it would react to itself and loop. Conferencing platforms
|
|
31
46
|
* (and the LiveKit SFU) **exclude a participant's own published audio from that participant's inbound
|
|
@@ -35,10 +50,19 @@
|
|
|
35
50
|
* purely on floor state.
|
|
36
51
|
*
|
|
37
52
|
* ## Purity & testability
|
|
38
|
-
* This class is **pure and synchronous** — no I/O, no entities, no clock
|
|
39
|
-
*
|
|
53
|
+
* This class is **pure and synchronous** — no I/O, no entities, no real clock (an injected clock stamps
|
|
54
|
+
* `since`, hand-off expiry and the human-speech hold). Every decision is a deterministic function of the
|
|
40
55
|
* in-memory room/floor state, so it is exhaustively unit-testable with no network, DB, or real session.
|
|
41
56
|
*/
|
|
57
|
+
import { IsBackchannel } from '@memberjunction/ai-bridge-base';
|
|
58
|
+
/** Default cap on consecutive agent turns (no human between) before agents are denied. See rule 7 above. */
|
|
59
|
+
export const DEFAULT_MAX_CONSECUTIVE_AGENT_TURNS = 8;
|
|
60
|
+
/** How long (ms) a yielded floor stays reserved for the agent it was handed to. */
|
|
61
|
+
export const DEFAULT_HANDOFF_TTL_MS = 5000;
|
|
62
|
+
/** How long (ms) after the last human speech activity the human is still considered to be speaking. */
|
|
63
|
+
export const DEFAULT_HUMAN_SPEECH_HOLD_MS = 800;
|
|
64
|
+
/** How many recent room events the coordinator keeps for observability (oldest dropped first). */
|
|
65
|
+
export const MAX_ROOM_EVENTS = 60;
|
|
42
66
|
/**
|
|
43
67
|
* Coordinates speaking discipline for multiple agents sharing one room. Construct one per process (the
|
|
44
68
|
* engine holds a single instance) and key everything on the **room id** — the shared external connection
|
|
@@ -49,13 +73,44 @@
|
|
|
49
73
|
*/
|
|
50
74
|
export class MultiAgentRoomCoordinator {
|
|
51
75
|
/**
|
|
52
|
-
* @param now Optional injected clock returning epoch-ms
|
|
53
|
-
*
|
|
76
|
+
* @param now Optional injected clock returning epoch-ms. Defaults to `Date.now`. Tests inject a
|
|
77
|
+
* controllable function for determinism.
|
|
78
|
+
* @param limits Optional tuning (loop cap, hand-off TTL, human-speech hold).
|
|
54
79
|
*/
|
|
55
|
-
constructor(now = Date.now) {
|
|
80
|
+
constructor(now = Date.now, limits = {}) {
|
|
56
81
|
/** Room id (lowercased) → room record. */
|
|
57
82
|
this.rooms = new Map();
|
|
83
|
+
this.maxConsecutiveAgentTurns = DEFAULT_MAX_CONSECUTIVE_AGENT_TURNS;
|
|
84
|
+
this.handoffTtlMs = DEFAULT_HANDOFF_TTL_MS;
|
|
85
|
+
this.humanSpeechHoldMs = DEFAULT_HUMAN_SPEECH_HOLD_MS;
|
|
58
86
|
this.now = now;
|
|
87
|
+
this.ConfigureLimits(limits);
|
|
88
|
+
}
|
|
89
|
+
/**
|
|
90
|
+
* Adjusts the coordinator-wide limits. Omitted fields keep their current value; non-positive or
|
|
91
|
+
* non-finite values are ignored (a cap of 0 would silence every agent forever, which is never intended).
|
|
92
|
+
*
|
|
93
|
+
* @param limits The limits to change.
|
|
94
|
+
*/
|
|
95
|
+
ConfigureLimits(limits) {
|
|
96
|
+
this.maxConsecutiveAgentTurns = positiveOr(limits.MaxConsecutiveAgentTurns, this.maxConsecutiveAgentTurns);
|
|
97
|
+
this.handoffTtlMs = positiveOr(limits.HandoffTtlMs, this.handoffTtlMs);
|
|
98
|
+
this.humanSpeechHoldMs = positiveOr(limits.HumanSpeechHoldMs, this.humanSpeechHoldMs);
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Overrides the loop cap for ONE room (e.g. a staged agent-to-agent conversation that should run longer).
|
|
102
|
+
*
|
|
103
|
+
* @param roomId The shared room id.
|
|
104
|
+
* @param max The cap for this room, or `null` to fall back to the coordinator-wide cap.
|
|
105
|
+
* @returns `true` when the room exists and the override was applied.
|
|
106
|
+
*/
|
|
107
|
+
SetRoomMaxConsecutiveAgentTurns(roomId, max) {
|
|
108
|
+
const room = this.rooms.get(this.key(roomId));
|
|
109
|
+
if (!room) {
|
|
110
|
+
return false;
|
|
111
|
+
}
|
|
112
|
+
room.maxConsecutiveAgentTurns = max !== null && Number.isFinite(max) && max > 0 ? Math.floor(max) : null;
|
|
113
|
+
return true;
|
|
59
114
|
}
|
|
60
115
|
// ──────────────────────────────────────────────────────────────────────────────
|
|
61
116
|
// Membership.
|
|
@@ -81,7 +136,8 @@ export class MultiAgentRoomCoordinator {
|
|
|
81
136
|
/**
|
|
82
137
|
* Unregisters an agent session from a room (the agent left / its bridge stopped). If the leaving
|
|
83
138
|
* agent held the floor, the floor is released. If it was the facilitator, the facilitator slot is
|
|
84
|
-
* cleared.
|
|
139
|
+
* cleared. A hand-off reserved for the leaving agent is dropped (nobody is left to take it). When the
|
|
140
|
+
* last member leaves, the room record is discarded.
|
|
85
141
|
*
|
|
86
142
|
* @param roomId The room the agent is leaving.
|
|
87
143
|
* @param agentSessionId The agent session leaving.
|
|
@@ -100,6 +156,9 @@ export class MultiAgentRoomCoordinator {
|
|
|
100
156
|
if (room.facilitatorAgentSessionId && this.key(room.facilitatorAgentSessionId) === memberKey) {
|
|
101
157
|
room.facilitatorAgentSessionId = null;
|
|
102
158
|
}
|
|
159
|
+
if (room.handoff && this.key(room.handoff.toAgentSessionId) === memberKey) {
|
|
160
|
+
room.handoff = null;
|
|
161
|
+
}
|
|
103
162
|
if (room.members.size === 0) {
|
|
104
163
|
this.rooms.delete(this.key(roomId));
|
|
105
164
|
}
|
|
@@ -120,25 +179,27 @@ export class MultiAgentRoomCoordinator {
|
|
|
120
179
|
// ──────────────────────────────────────────────────────────────────────────────
|
|
121
180
|
/**
|
|
122
181
|
* Asks whether an agent MAY take the floor (speak) now — the read-only arbitration check an agent
|
|
123
|
-
* runs before generating speech.
|
|
124
|
-
* facilitator exception:
|
|
182
|
+
* runs before generating speech. Checked in this order:
|
|
125
183
|
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
*
|
|
129
|
-
*
|
|
130
|
-
*
|
|
131
|
-
*
|
|
132
|
-
*
|
|
184
|
+
* 1. **Unknown room / not a member** → denied (`UnknownRoom` / `NotInRoom`).
|
|
185
|
+
* 2. **A backchannel** → granted (`Backchannel`) always: it never takes the floor, so it cannot
|
|
186
|
+
* interrupt anyone, and a listening acknowledgement is welcome even while a human talks.
|
|
187
|
+
* 3. **A human is speaking** → denied (`HumanSpeaking`) — humans win, over the facilitator too.
|
|
188
|
+
* 4. **The loop cap is reached** → denied (`LoopCapReached`) — agents stay passive until a human speaks.
|
|
189
|
+
* 5. **The floor is reserved by a hand-off** → granted to the named agent (`HandoffGranted`); denied to
|
|
190
|
+
* others (`ReservedForHandoff`) unless the requester is the facilitator.
|
|
191
|
+
* 6. **Otherwise** the floor rules: free → `FloorFree`; already the holder → `AlreadyHolder`; the
|
|
192
|
+
* facilitator → `FacilitatorOverride` even over a sitting holder; anyone else → `HeldByOtherAgent`.
|
|
133
193
|
*
|
|
134
|
-
*
|
|
135
|
-
*
|
|
194
|
+
* Purely advisory until {@link TakeFloor} actually claims the floor — keeping the check (read) and the
|
|
195
|
+
* claim (write) separate lets a caller test-then-act atomically within its own turn.
|
|
136
196
|
*
|
|
137
197
|
* @param roomId The shared room id.
|
|
138
198
|
* @param agentSessionId The agent asking to speak.
|
|
199
|
+
* @param kind `'Turn'` (default) to hold the floor, or `'Backchannel'` for a short acknowledgement.
|
|
139
200
|
* @returns The floor decision (granted + reason).
|
|
140
201
|
*/
|
|
141
|
-
CanTakeFloor(roomId, agentSessionId) {
|
|
202
|
+
CanTakeFloor(roomId, agentSessionId, kind = 'Turn') {
|
|
142
203
|
const room = this.rooms.get(this.key(roomId));
|
|
143
204
|
if (!room) {
|
|
144
205
|
return { Granted: false, Reason: 'UnknownRoom' };
|
|
@@ -146,17 +207,10 @@ export class MultiAgentRoomCoordinator {
|
|
|
146
207
|
if (!room.members.has(this.key(agentSessionId))) {
|
|
147
208
|
return { Granted: false, Reason: 'NotInRoom' };
|
|
148
209
|
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
return { Granted: true, Reason: 'FloorFree' };
|
|
152
|
-
}
|
|
153
|
-
if (this.key(holder) === this.key(agentSessionId)) {
|
|
154
|
-
return { Granted: true, Reason: 'AlreadyHolder' };
|
|
210
|
+
if (kind === 'Backchannel') {
|
|
211
|
+
return { Granted: true, Reason: 'Backchannel' };
|
|
155
212
|
}
|
|
156
|
-
|
|
157
|
-
return { Granted: true, Reason: 'FacilitatorOverride' };
|
|
158
|
-
}
|
|
159
|
-
return { Granted: false, Reason: 'HeldByOtherAgent' };
|
|
213
|
+
return this.decideTurn(room, agentSessionId);
|
|
160
214
|
}
|
|
161
215
|
/**
|
|
162
216
|
* Atomically attempts to claim the floor for an agent: runs {@link CanTakeFloor} and, when granted,
|
|
@@ -164,21 +218,29 @@ export class MultiAgentRoomCoordinator {
|
|
|
164
218
|
* **facilitator** overrides a sitting holder, the holder is replaced — the facilitator now holds the
|
|
165
219
|
* floor (the prior holder should observe this via {@link IsFloorHolder} on its next check and yield).
|
|
166
220
|
*
|
|
221
|
+
* A granted `Turn` that starts a NEW turn counts toward the loop cap. A granted `Backchannel` is recorded
|
|
222
|
+
* but changes no floor state. Every grant and denial lands in the room's event log.
|
|
223
|
+
*
|
|
167
224
|
* @param roomId The shared room id.
|
|
168
225
|
* @param agentSessionId The agent claiming the floor.
|
|
169
|
-
* @
|
|
226
|
+
* @param kind `'Turn'` (default) or `'Backchannel'`.
|
|
227
|
+
* @returns The decision; on a granted `Turn` the agent now holds the floor.
|
|
170
228
|
*/
|
|
171
|
-
TakeFloor(roomId, agentSessionId) {
|
|
172
|
-
const decision = this.CanTakeFloor(roomId, agentSessionId);
|
|
229
|
+
TakeFloor(roomId, agentSessionId, kind = 'Turn') {
|
|
230
|
+
const decision = this.CanTakeFloor(roomId, agentSessionId, kind);
|
|
231
|
+
const room = this.rooms.get(this.key(roomId));
|
|
232
|
+
if (!room) {
|
|
233
|
+
return decision;
|
|
234
|
+
}
|
|
173
235
|
if (!decision.Granted) {
|
|
236
|
+
this.record(room, 'FloorDenied', { AgentSessionId: agentSessionId, Reason: decision.Reason });
|
|
174
237
|
return decision;
|
|
175
238
|
}
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
room.floorHolderAgentSessionId = agentSessionId;
|
|
180
|
-
room.floorHeldSinceMs = this.now();
|
|
239
|
+
if (kind === 'Backchannel') {
|
|
240
|
+
this.recordBackchannel(room, agentSessionId);
|
|
241
|
+
return decision;
|
|
181
242
|
}
|
|
243
|
+
this.grantTurn(room, agentSessionId, decision.Reason);
|
|
182
244
|
return decision;
|
|
183
245
|
}
|
|
184
246
|
/**
|
|
@@ -199,11 +261,50 @@ export class MultiAgentRoomCoordinator {
|
|
|
199
261
|
}
|
|
200
262
|
room.floorHolderAgentSessionId = null;
|
|
201
263
|
room.floorHeldSinceMs = null;
|
|
264
|
+
this.record(room, 'FloorReleased', { AgentSessionId: agentSessionId });
|
|
202
265
|
return true;
|
|
203
266
|
}
|
|
267
|
+
/**
|
|
268
|
+
* Finishes an agent's turn with what it actually said, so a short acknowledgement that happened to start
|
|
269
|
+
* while the floor was free is not billed against the loop cap as a full turn. Releases the floor when the
|
|
270
|
+
* agent holds it. When the utterance is a backchannel (see
|
|
271
|
+
* {@link import('@memberjunction/ai-bridge-base').IsBackchannel}) the turn is un-counted and logged as a
|
|
272
|
+
* `Backchannel`.
|
|
273
|
+
*
|
|
274
|
+
* @param roomId The shared room id.
|
|
275
|
+
* @param agentSessionId The agent that finished speaking.
|
|
276
|
+
* @param utterance What it said (text and/or measured duration).
|
|
277
|
+
* @returns Whether the floor was released and whether the utterance was a backchannel.
|
|
278
|
+
*/
|
|
279
|
+
CompleteTurn(roomId, agentSessionId, utterance = {}) {
|
|
280
|
+
const room = this.rooms.get(this.key(roomId));
|
|
281
|
+
if (!room) {
|
|
282
|
+
return { Released: false, WasBackchannel: false };
|
|
283
|
+
}
|
|
284
|
+
const wasBackchannel = IsBackchannel(utterance);
|
|
285
|
+
const released = this.ReleaseFloor(roomId, agentSessionId);
|
|
286
|
+
if (wasBackchannel && released) {
|
|
287
|
+
room.consecutiveAgentTurns = Math.max(0, room.consecutiveAgentTurns - 1);
|
|
288
|
+
this.recordBackchannel(room, agentSessionId);
|
|
289
|
+
}
|
|
290
|
+
return { Released: released, WasBackchannel: wasBackchannel };
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Records a backchannel an agent voiced WITHOUT holding the floor (an overlay on someone else's turn, or
|
|
294
|
+
* on silence). Changes no floor state and never counts toward the loop cap.
|
|
295
|
+
*
|
|
296
|
+
* @param roomId The shared room id.
|
|
297
|
+
* @param agentSessionId The agent that acknowledged.
|
|
298
|
+
*/
|
|
299
|
+
RecordBackchannel(roomId, agentSessionId) {
|
|
300
|
+
const room = this.rooms.get(this.key(roomId));
|
|
301
|
+
if (room) {
|
|
302
|
+
this.recordBackchannel(room, agentSessionId);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
204
305
|
/**
|
|
205
306
|
* Whether a given agent currently holds the floor in a room. An agent that was bumped by a
|
|
206
|
-
* facilitator override checks this to learn it should yield.
|
|
307
|
+
* facilitator override or a human checks this to learn it should yield.
|
|
207
308
|
*
|
|
208
309
|
* @param roomId The shared room id.
|
|
209
310
|
* @param agentSessionId The agent to test.
|
|
@@ -235,6 +336,100 @@ export class MultiAgentRoomCoordinator {
|
|
|
235
336
|
return true;
|
|
236
337
|
}
|
|
237
338
|
// ──────────────────────────────────────────────────────────────────────────────
|
|
339
|
+
// Humans win.
|
|
340
|
+
// ──────────────────────────────────────────────────────────────────────────────
|
|
341
|
+
/**
|
|
342
|
+
* Reports human speech activity in the room (call it as audio from a human participant arrives; it is
|
|
343
|
+
* cheap and idempotent). The FIRST activity after quiet **preempts**: the floor holder loses the floor
|
|
344
|
+
* (the caller flushes its output through the barge-in path), any pending hand-off is cancelled, and the
|
|
345
|
+
* agent-to-agent loop counter resets. While activity continues — and for the hold window after it stops —
|
|
346
|
+
* every agent is denied.
|
|
347
|
+
*
|
|
348
|
+
* @param roomId The shared room id.
|
|
349
|
+
* @returns Which agent (if any) was preempted, so the caller can flush its queued output.
|
|
350
|
+
*/
|
|
351
|
+
NoteHumanSpeech(roomId) {
|
|
352
|
+
const room = this.rooms.get(this.key(roomId));
|
|
353
|
+
if (!room) {
|
|
354
|
+
return { PreemptedAgentSessionId: null };
|
|
355
|
+
}
|
|
356
|
+
const wasSpeaking = this.isHumanSpeaking(room);
|
|
357
|
+
room.humanSpeakingUntilMs = this.now() + this.humanSpeechHoldMs;
|
|
358
|
+
if (wasSpeaking) {
|
|
359
|
+
return { PreemptedAgentSessionId: null };
|
|
360
|
+
}
|
|
361
|
+
this.record(room, 'HumanSpeech', {});
|
|
362
|
+
room.handoff = null;
|
|
363
|
+
this.resetLoopCounter(room);
|
|
364
|
+
return { PreemptedAgentSessionId: this.preemptHolder(room) };
|
|
365
|
+
}
|
|
366
|
+
/**
|
|
367
|
+
* Reports that the human stopped speaking (an explicit end-of-speech signal). Agents are admitted again
|
|
368
|
+
* immediately instead of waiting out the hold window. Optional — the hold window expires on its own.
|
|
369
|
+
*
|
|
370
|
+
* @param roomId The shared room id.
|
|
371
|
+
*/
|
|
372
|
+
NoteHumanSpeechEnded(roomId) {
|
|
373
|
+
const room = this.rooms.get(this.key(roomId));
|
|
374
|
+
if (room) {
|
|
375
|
+
room.humanSpeakingUntilMs = 0;
|
|
376
|
+
}
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* Reports a completed human TURN (a final human transcript). Unlike {@link NoteHumanSpeech} this does NOT
|
|
380
|
+
* preempt — a final transcript routinely lands AFTER a quick agent has already started answering, and
|
|
381
|
+
* must not cut that answer — it only resets the agent-to-agent loop counter ("until a human speaks").
|
|
382
|
+
*
|
|
383
|
+
* @param roomId The shared room id.
|
|
384
|
+
*/
|
|
385
|
+
NoteHumanTurn(roomId) {
|
|
386
|
+
const room = this.rooms.get(this.key(roomId));
|
|
387
|
+
if (room) {
|
|
388
|
+
this.resetLoopCounter(room);
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
// ──────────────────────────────────────────────────────────────────────────────
|
|
392
|
+
// Explicit hand-off.
|
|
393
|
+
// ──────────────────────────────────────────────────────────────────────────────
|
|
394
|
+
/**
|
|
395
|
+
* An agent hands the floor over. Releases the floor if the agent holds it and, when `toAgentSessionId`
|
|
396
|
+
* names another member, reserves the floor for that agent for the hand-off TTL — so nobody else can start
|
|
397
|
+
* in the gap and the two never start at once. With no target the floor simply goes free.
|
|
398
|
+
*
|
|
399
|
+
* A yield from an agent that is not the holder, while another agent holds the floor, is a no-op
|
|
400
|
+
* (`NotHolder`). The hand-off is refused (the floor is still released if held) while a human is speaking
|
|
401
|
+
* or the loop cap is reached: reserving the floor for an agent that would then be denied would only
|
|
402
|
+
* stall the room.
|
|
403
|
+
*
|
|
404
|
+
* @param roomId The shared room id.
|
|
405
|
+
* @param fromAgentSessionId The agent yielding.
|
|
406
|
+
* @param toAgentSessionId The agent that should speak next, when named.
|
|
407
|
+
* @returns Whether the floor was released and who (if anyone) it is now reserved for.
|
|
408
|
+
*/
|
|
409
|
+
YieldFloor(roomId, fromAgentSessionId, toAgentSessionId) {
|
|
410
|
+
const room = this.rooms.get(this.key(roomId));
|
|
411
|
+
if (!room) {
|
|
412
|
+
return { Released: false, HandoffToAgentSessionId: null, Reason: 'UnknownRoom' };
|
|
413
|
+
}
|
|
414
|
+
if (!room.members.has(this.key(fromAgentSessionId))) {
|
|
415
|
+
return { Released: false, HandoffToAgentSessionId: null, Reason: 'NotInRoom' };
|
|
416
|
+
}
|
|
417
|
+
const released = this.ReleaseFloor(roomId, fromAgentSessionId);
|
|
418
|
+
if (!released && room.floorHolderAgentSessionId !== null) {
|
|
419
|
+
// Another agent holds the floor: a non-holder cannot hand it (or reserve it) for anyone.
|
|
420
|
+
return { Released: false, HandoffToAgentSessionId: null, Reason: 'NotHolder' };
|
|
421
|
+
}
|
|
422
|
+
const target = this.resolveHandoffTarget(room, fromAgentSessionId, toAgentSessionId);
|
|
423
|
+
const refusal = toAgentSessionId ? this.handoffRefusal(room, target) : null;
|
|
424
|
+
if (refusal) {
|
|
425
|
+
this.record(room, 'Yielded', { AgentSessionId: fromAgentSessionId, Reason: refusal });
|
|
426
|
+
return { Released: released, HandoffToAgentSessionId: null, Reason: refusal };
|
|
427
|
+
}
|
|
428
|
+
room.handoff = target ? { toAgentSessionId: target, fromAgentSessionId, expiresAtMs: this.now() + this.handoffTtlMs } : null;
|
|
429
|
+
this.record(room, 'Yielded', { AgentSessionId: fromAgentSessionId, ToAgentSessionId: target ?? undefined, Reason: 'Yielded' });
|
|
430
|
+
return { Released: released, HandoffToAgentSessionId: target, Reason: 'Yielded' };
|
|
431
|
+
}
|
|
432
|
+
// ──────────────────────────────────────────────────────────────────────────────
|
|
238
433
|
// Observability.
|
|
239
434
|
// ──────────────────────────────────────────────────────────────────────────────
|
|
240
435
|
/**
|
|
@@ -249,12 +444,20 @@ export class MultiAgentRoomCoordinator {
|
|
|
249
444
|
if (!room) {
|
|
250
445
|
return null;
|
|
251
446
|
}
|
|
447
|
+
const handoff = this.activeHandoff(room);
|
|
252
448
|
return {
|
|
253
449
|
RoomId: room.roomId,
|
|
254
450
|
AgentSessionIds: Array.from(room.members.values()).map(m => m.AgentSessionId),
|
|
255
451
|
FacilitatorAgentSessionId: room.facilitatorAgentSessionId,
|
|
256
452
|
FloorHolderAgentSessionId: room.floorHolderAgentSessionId,
|
|
257
453
|
FloorHeldSinceMs: room.floorHeldSinceMs,
|
|
454
|
+
HumanSpeaking: this.isHumanSpeaking(room),
|
|
455
|
+
PendingHandoffToAgentSessionId: handoff ? handoff.toAgentSessionId : null,
|
|
456
|
+
ConsecutiveAgentTurns: room.consecutiveAgentTurns,
|
|
457
|
+
MaxConsecutiveAgentTurns: this.capFor(room),
|
|
458
|
+
LoopCapReached: this.isLoopCapped(room),
|
|
459
|
+
BackchannelCount: room.backchannelCount,
|
|
460
|
+
RecentEvents: room.events.slice(),
|
|
258
461
|
};
|
|
259
462
|
}
|
|
260
463
|
/** The ids of all rooms the coordinator currently tracks (those with ≥1 agent member). */
|
|
@@ -262,8 +465,131 @@ export class MultiAgentRoomCoordinator {
|
|
|
262
465
|
return Array.from(this.rooms.values()).map(r => r.roomId);
|
|
263
466
|
}
|
|
264
467
|
// ──────────────────────────────────────────────────────────────────────────────
|
|
265
|
-
// Internals.
|
|
468
|
+
// Internals — decisions.
|
|
469
|
+
// ──────────────────────────────────────────────────────────────────────────────
|
|
470
|
+
/** The `Turn` decision, after membership and the backchannel short-circuit have been handled. */
|
|
471
|
+
decideTurn(room, agentSessionId) {
|
|
472
|
+
if (this.isHumanSpeaking(room)) {
|
|
473
|
+
return { Granted: false, Reason: 'HumanSpeaking' };
|
|
474
|
+
}
|
|
475
|
+
if (this.isLoopCapped(room)) {
|
|
476
|
+
return { Granted: false, Reason: 'LoopCapReached' };
|
|
477
|
+
}
|
|
478
|
+
const handoff = this.activeHandoff(room);
|
|
479
|
+
if (handoff) {
|
|
480
|
+
const reserved = this.decideUnderHandoff(room, handoff, agentSessionId);
|
|
481
|
+
if (reserved) {
|
|
482
|
+
return reserved;
|
|
483
|
+
}
|
|
484
|
+
}
|
|
485
|
+
return this.decideByFloor(room, agentSessionId);
|
|
486
|
+
}
|
|
487
|
+
/** While a hand-off is pending: the target gets the floor, everyone else is held back (the facilitator may still cut in). */
|
|
488
|
+
decideUnderHandoff(room, handoff, agentSessionId) {
|
|
489
|
+
if (this.key(handoff.toAgentSessionId) === this.key(agentSessionId)) {
|
|
490
|
+
return { Granted: true, Reason: 'HandoffGranted' };
|
|
491
|
+
}
|
|
492
|
+
if (this.isFacilitator(room, agentSessionId)) {
|
|
493
|
+
return null; // facilitator falls through to the ordinary floor rules
|
|
494
|
+
}
|
|
495
|
+
return { Granted: false, Reason: 'ReservedForHandoff' };
|
|
496
|
+
}
|
|
497
|
+
/** The plain floor rules: free / already holder / facilitator override / held by another. */
|
|
498
|
+
decideByFloor(room, agentSessionId) {
|
|
499
|
+
const holder = room.floorHolderAgentSessionId;
|
|
500
|
+
if (holder === null) {
|
|
501
|
+
return { Granted: true, Reason: 'FloorFree' };
|
|
502
|
+
}
|
|
503
|
+
if (this.key(holder) === this.key(agentSessionId)) {
|
|
504
|
+
return { Granted: true, Reason: 'AlreadyHolder' };
|
|
505
|
+
}
|
|
506
|
+
if (this.isFacilitator(room, agentSessionId)) {
|
|
507
|
+
return { Granted: true, Reason: 'FacilitatorOverride' };
|
|
508
|
+
}
|
|
509
|
+
return { Granted: false, Reason: 'HeldByOtherAgent' };
|
|
510
|
+
}
|
|
511
|
+
/** Resolves a yield's target to a member's id, or `null` when none was named or it is the yielder / not a member. */
|
|
512
|
+
resolveHandoffTarget(room, fromAgentSessionId, toAgentSessionId) {
|
|
513
|
+
if (!toAgentSessionId || this.key(toAgentSessionId) === this.key(fromAgentSessionId)) {
|
|
514
|
+
return null;
|
|
515
|
+
}
|
|
516
|
+
return room.members.get(this.key(toAgentSessionId))?.AgentSessionId ?? null;
|
|
517
|
+
}
|
|
518
|
+
/** Why a requested hand-off cannot be honoured right now, or `null` when it can. */
|
|
519
|
+
handoffRefusal(room, target) {
|
|
520
|
+
if (target === null) {
|
|
521
|
+
return 'UnknownTarget';
|
|
522
|
+
}
|
|
523
|
+
if (this.isHumanSpeaking(room)) {
|
|
524
|
+
return 'HumanSpeaking';
|
|
525
|
+
}
|
|
526
|
+
return this.isLoopCapped(room) ? 'LoopCapReached' : null;
|
|
527
|
+
}
|
|
528
|
+
// ──────────────────────────────────────────────────────────────────────────────
|
|
529
|
+
// Internals — state transitions.
|
|
266
530
|
// ──────────────────────────────────────────────────────────────────────────────
|
|
531
|
+
/** Makes an agent the floor holder for a granted `Turn`, counting it toward the loop cap when it starts a new turn. */
|
|
532
|
+
grantTurn(room, agentSessionId, reason) {
|
|
533
|
+
const isNewTurn = room.floorHolderAgentSessionId === null || this.key(room.floorHolderAgentSessionId) !== this.key(agentSessionId);
|
|
534
|
+
if (room.handoff && this.key(room.handoff.toAgentSessionId) === this.key(agentSessionId)) {
|
|
535
|
+
room.handoff = null; // consumed
|
|
536
|
+
}
|
|
537
|
+
if (!isNewTurn) {
|
|
538
|
+
return; // already-holder re-assert: keep the original since-stamp, don't double count
|
|
539
|
+
}
|
|
540
|
+
room.floorHolderAgentSessionId = agentSessionId;
|
|
541
|
+
room.floorHeldSinceMs = this.now();
|
|
542
|
+
room.consecutiveAgentTurns++;
|
|
543
|
+
this.record(room, 'FloorGranted', { AgentSessionId: agentSessionId, Reason: reason });
|
|
544
|
+
if (room.consecutiveAgentTurns === this.capFor(room)) {
|
|
545
|
+
this.record(room, 'LoopCapReached', { AgentSessionId: agentSessionId });
|
|
546
|
+
}
|
|
547
|
+
}
|
|
548
|
+
/** Takes the floor from its holder because a human started talking; returns the preempted agent, if any. */
|
|
549
|
+
preemptHolder(room) {
|
|
550
|
+
const holder = room.floorHolderAgentSessionId;
|
|
551
|
+
if (holder === null) {
|
|
552
|
+
return null;
|
|
553
|
+
}
|
|
554
|
+
room.floorHolderAgentSessionId = null;
|
|
555
|
+
room.floorHeldSinceMs = null;
|
|
556
|
+
this.record(room, 'HumanPreempted', { AgentSessionId: holder });
|
|
557
|
+
return holder;
|
|
558
|
+
}
|
|
559
|
+
/** A human spoke: agents may take turns again. */
|
|
560
|
+
resetLoopCounter(room) {
|
|
561
|
+
room.consecutiveAgentTurns = 0;
|
|
562
|
+
}
|
|
563
|
+
recordBackchannel(room, agentSessionId) {
|
|
564
|
+
room.backchannelCount++;
|
|
565
|
+
this.record(room, 'Backchannel', { AgentSessionId: agentSessionId });
|
|
566
|
+
}
|
|
567
|
+
// ──────────────────────────────────────────────────────────────────────────────
|
|
568
|
+
// Internals — derived state.
|
|
569
|
+
// ──────────────────────────────────────────────────────────────────────────────
|
|
570
|
+
isHumanSpeaking(room) {
|
|
571
|
+
return this.now() < room.humanSpeakingUntilMs;
|
|
572
|
+
}
|
|
573
|
+
capFor(room) {
|
|
574
|
+
return room.maxConsecutiveAgentTurns ?? this.maxConsecutiveAgentTurns;
|
|
575
|
+
}
|
|
576
|
+
isLoopCapped(room) {
|
|
577
|
+
return room.consecutiveAgentTurns >= this.capFor(room);
|
|
578
|
+
}
|
|
579
|
+
/** The pending hand-off, dropping it first when its TTL has lapsed. */
|
|
580
|
+
activeHandoff(room) {
|
|
581
|
+
if (room.handoff && this.now() >= room.handoff.expiresAtMs) {
|
|
582
|
+
room.handoff = null;
|
|
583
|
+
}
|
|
584
|
+
return room.handoff;
|
|
585
|
+
}
|
|
586
|
+
/** Appends to the room's bounded event log. */
|
|
587
|
+
record(room, type, detail) {
|
|
588
|
+
room.events.push({ Seq: room.nextSeq++, AtMs: this.now(), Type: type, ...detail });
|
|
589
|
+
while (room.events.length > MAX_ROOM_EVENTS) {
|
|
590
|
+
room.events.shift();
|
|
591
|
+
}
|
|
592
|
+
}
|
|
267
593
|
/** Gets the room record, creating an empty one (preserving the caller's casing) on first use. */
|
|
268
594
|
ensureRoom(roomId) {
|
|
269
595
|
const k = this.key(roomId);
|
|
@@ -275,6 +601,13 @@ export class MultiAgentRoomCoordinator {
|
|
|
275
601
|
facilitatorAgentSessionId: null,
|
|
276
602
|
floorHolderAgentSessionId: null,
|
|
277
603
|
floorHeldSinceMs: null,
|
|
604
|
+
humanSpeakingUntilMs: 0,
|
|
605
|
+
handoff: null,
|
|
606
|
+
consecutiveAgentTurns: 0,
|
|
607
|
+
maxConsecutiveAgentTurns: null,
|
|
608
|
+
backchannelCount: 0,
|
|
609
|
+
nextSeq: 1,
|
|
610
|
+
events: [],
|
|
278
611
|
};
|
|
279
612
|
this.rooms.set(k, room);
|
|
280
613
|
}
|
|
@@ -293,4 +626,8 @@ export class MultiAgentRoomCoordinator {
|
|
|
293
626
|
return id.trim().toLowerCase();
|
|
294
627
|
}
|
|
295
628
|
}
|
|
629
|
+
/** `value` when it is a positive finite number, otherwise `fallback`. */
|
|
630
|
+
function positiveOr(value, fallback) {
|
|
631
|
+
return value !== undefined && Number.isFinite(value) && value > 0 ? value : fallback;
|
|
632
|
+
}
|
|
296
633
|
//# sourceMappingURL=multi-agent-room-coordinator.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"multi-agent-room-coordinator.js","sourceRoot":"","sources":["../src/multi-agent-room-coordinator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAwCG;AA8DH;;;;;;;GAOG;AACH,MAAM,OAAO,yBAAyB;IAOlC;;;OAGG;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
|
{
|
|
2
2
|
"name": "@memberjunction/ai-bridge-server",
|
|
3
3
|
"type": "module",
|
|
4
|
-
"version": "6.2.0-edge.
|
|
4
|
+
"version": "6.2.0-edge.4",
|
|
5
5
|
"description": "MemberJunction: Server-tier coordination + execution for Realtime Bridges — completes the unified media-transport seam (the bridge ↔ IRealtimeSession pipe), bot-session lifecycle, host affinity + janitor, participant tracking, and turn-taking integration. Mirrors the AIEngineBase/AIEngine pair.",
|
|
6
6
|
"main": "dist/index.js",
|
|
7
7
|
"types": "dist/index.d.ts",
|
|
@@ -11,11 +11,11 @@
|
|
|
11
11
|
"author": "MemberJunction.com",
|
|
12
12
|
"license": "BUSL-1.1",
|
|
13
13
|
"dependencies": {
|
|
14
|
-
"@memberjunction/core": "6.2.0-edge.
|
|
15
|
-
"@memberjunction/global": "6.2.0-edge.
|
|
16
|
-
"@memberjunction/core-entities": "6.2.0-edge.
|
|
17
|
-
"@memberjunction/ai": "6.2.0-edge.
|
|
18
|
-
"@memberjunction/ai-bridge-base": "6.2.0-edge.
|
|
14
|
+
"@memberjunction/core": "6.2.0-edge.4",
|
|
15
|
+
"@memberjunction/global": "6.2.0-edge.4",
|
|
16
|
+
"@memberjunction/core-entities": "6.2.0-edge.4",
|
|
17
|
+
"@memberjunction/ai": "6.2.0-edge.4",
|
|
18
|
+
"@memberjunction/ai-bridge-base": "6.2.0-edge.4",
|
|
19
19
|
"rxjs": "^7.8.2"
|
|
20
20
|
},
|
|
21
21
|
"//optionalDependencies": "@microsoft/microsoft-graph-client and googleapis are OPTIONAL PEER SDKs (CLAUDE rule 8, category 2): this package never statically imports either. They back the calendar + identity-provisioner seams only. GraphCalendarSource/GraphAdmin provisioning wire IGraphCalendarLike/IGraphAdminLike over @microsoft/microsoft-graph-client (calendarView delta + POST /users); GoogleCalendarSource/Google Workspace provisioning wire IGoogleCalendarLike/IGoogleWorkspaceAdminLike over googleapis (calendar.events.list syncToken + admin.users.insert). The telephony-carrier number-order path is injected via ITelephonyCarrierLike (the carrier SDK is declared by each telephony provider package, not here). All surfaces are injected behind structural interfaces so the package builds + unit-tests with no install and no network, and are loaded only when a Graph/Google-backed identity is configured at deployment.",
|