@memberjunction/livekit-room-server 6.2.0-edge.3 → 6.2.0-edge.5
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/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/livekit-agent-room-coordinator.d.ts +120 -10
- package/dist/livekit-agent-room-coordinator.d.ts.map +1 -1
- package/dist/livekit-agent-room-coordinator.js +312 -68
- package/dist/livekit-agent-room-coordinator.js.map +1 -1
- package/dist/livekit-native-module.d.ts.map +1 -1
- package/dist/livekit-native-module.js +7 -0
- package/dist/livekit-native-module.js.map +1 -1
- package/dist/livekit-participant-service.d.ts +47 -0
- package/dist/livekit-participant-service.d.ts.map +1 -0
- package/dist/livekit-participant-service.js +64 -0
- package/dist/livekit-participant-service.js.map +1 -0
- package/dist/livekit-token-service.d.ts +20 -5
- package/dist/livekit-token-service.d.ts.map +1 -1
- package/dist/livekit-token-service.js +14 -7
- package/dist/livekit-token-service.js.map +1 -1
- package/dist/meeting-dial-in-service.d.ts +32 -1
- package/dist/meeting-dial-in-service.d.ts.map +1 -1
- package/dist/meeting-dial-in-service.js +83 -11
- package/dist/meeting-dial-in-service.js.map +1 -1
- package/dist/room-handoff/handoff-offer-registry.d.ts +10 -0
- package/dist/room-handoff/handoff-offer-registry.d.ts.map +1 -1
- package/dist/room-handoff/handoff-offer-registry.js +40 -13
- package/dist/room-handoff/handoff-offer-registry.js.map +1 -1
- package/dist/room-handoff/handoff-types.d.ts +11 -9
- package/dist/room-handoff/handoff-types.d.ts.map +1 -1
- package/dist/room-handoff/room-handoff-engine.d.ts +9 -1
- package/dist/room-handoff/room-handoff-engine.d.ts.map +1 -1
- package/dist/room-handoff/room-handoff-engine.js +40 -7
- package/dist/room-handoff/room-handoff-engine.js.map +1 -1
- package/package.json +13 -12
package/dist/index.d.ts
CHANGED
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
export { LiveKitTokenService, LiveKitUserIdentity, type LiveKitServerConfig, type LiveKitTokenRole, type MintTokenParams, type MintedToken } from './livekit-token-service.js';
|
|
10
10
|
export { LiveKitAgentRoomCoordinator, LIVEKIT_BRIDGE_DRIVER_CLASS, type BridgeOps, type RealtimeSessionFactory, type RealtimeSessionStartContext, type AgentRoomHostOptions, type StartAgentRoomSessionParams, type AgentRoomSession, } from './livekit-agent-room-coordinator.js';
|
|
11
11
|
export { LiveKitEgressService, WsToHttpUrl, wsToHttpUrl, type EgressClientLike, type StartRecordingParams, type RecordingInfo } from './livekit-egress-service.js';
|
|
12
|
+
export { LiveKitParticipantService, type ParticipantUpdateClientLike, type ParticipantUpdateResult } from './livekit-participant-service.js';
|
|
12
13
|
export { LiveKitSipService, LIVEKIT_PARTICIPANT_KIND_SIP, LIVEKIT_SIP_ATTRIBUTES, SIP_DIAL_REQUEST_TIMEOUT_SECONDS, SIP_DIAL_MAX_DURATION_SECONDS, type SipClientLike, type RoomServiceClientLike, type RoomParticipantSummary, type SipTrunkSummary, type DialSipParticipantParams, type EnsureInboundRoutingParams, type InboundRoutingResult, } from './livekit-sip-service.js';
|
|
13
14
|
export { LiveKitWebhookParser, type LiveKitRoomWebhookEvent, type WebhookReceiverLike } from './livekit-webhook.js';
|
|
14
15
|
export * from './room-handoff/handoff-types.js';
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAWH,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAAE,KAAK,mBAAmB,EAAE,KAAK,gBAAgB,EAAE,KAAK,eAAe,EAAE,KAAK,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAE5K,OAAO,EACL,2BAA2B,EAC3B,2BAA2B,EAC3B,KAAK,SAAS,EACd,KAAK,sBAAsB,EAC3B,KAAK,2BAA2B,EAChC,KAAK,oBA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} from './livekit-token-service.js';
|
|
17
17
|
export { LiveKitAgentRoomCoordinator, LIVEKIT_BRIDGE_DRIVER_CLASS, } from './livekit-agent-room-coordinator.js';
|
|
18
18
|
export { LiveKitEgressService, WsToHttpUrl, wsToHttpUrl } from './livekit-egress-service.js';
|
|
19
|
+
export { LiveKitParticipantService } from './livekit-participant-service.js';
|
|
19
20
|
export { LiveKitSipService, LIVEKIT_PARTICIPANT_KIND_SIP, LIVEKIT_SIP_ATTRIBUTES, SIP_DIAL_REQUEST_TIMEOUT_SECONDS, SIP_DIAL_MAX_DURATION_SECONDS, } from './livekit-sip-service.js';
|
|
20
21
|
export { LiveKitWebhookParser } from './livekit-webhook.js';
|
|
21
22
|
export * from './room-handoff/handoff-types.js';
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAC;AAEtE,+FAA+F;AAC/F,sGAAsG;AACtG,wGAAwG;AACxG,yGAAyG;AACzG,4EAA4E;AAC5E,iBAAiB,EAAE,CAAC;AAEpB,OAAO,EAAE,mBAAmB,EAAE,mBAAmB,EAA2F,MAAM,yBAAyB,CAAC;AAE5K,OAAO,EACL,2BAA2B,EAC3B,2BAA2B,GAO5B,MAAM,kCAAkC,CAAC;AAE1C,OAAO,EAAE,oBAAoB,EAAE,WAAW,EAAE,WAAW,EAAwE,MAAM,0BAA0B,CAAC;AAEhK,OAAO,EACL,iBAAiB,EACjB,4BAA4B,EAC5B,sBAAsB,EACtB,gCAAgC,EAChC,6BAA6B,GAQ9B,MAAM,uBAAuB,CAAC;AAE/B,OAAO,EAAE,oBAAoB,EAA0D,MAAM,mBAAmB,CAAC;AAEjH,cAAc,8BAA8B,CAAC;AAC7C,cAAc,uCAAuC,CAAC;AACtD,cAAc,oCAAoC,CAAC;AACnD,cAAc,sB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4BAA4B,CAAC;AAC3C,cAAc,2BAA2B,CAAC;AAC1C,cAAc,6BAA6B,CAAC;AAC5C,cAAc,sCAAsC,CAAC;AACrD,cAAc,iCAAiC,CAAC;AAChD,cAAc,sCAAsC,CAAC;AACrD,cAAc,gCAAgC,CAAC"}
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @fileoverview {@link LiveKitAgentRoomCoordinator} — the server-side **session-start harness** for the
|
|
3
3
|
* MJ-native LiveKit room (§1 of the realtime-bridge buildout plan). Given an agent + a room, it:
|
|
4
|
-
* 1.
|
|
5
|
-
* 2.
|
|
4
|
+
* 1. opens the realtime model session via an injectable {@link RealtimeSessionFactory} seam,
|
|
5
|
+
* 2. mints the agent bot's scoped LiveKit token ({@link LiveKitTokenService}), whose attributes depend on the session, and
|
|
6
6
|
* 3. bridges that session into the room through {@link AIBridgeEngine.StartBridgeSession} (which wires
|
|
7
7
|
* the transport seam + turn-taking automatically).
|
|
8
|
+
* A start that fails after step 1 closes the model session before the error propagates, recording the failure on the
|
|
9
|
+
* agent's co-agent run first ({@link FailedStartRecorder}).
|
|
8
10
|
*
|
|
9
11
|
* The realtime-session factory is a seam (mirroring `LiveKitBridge.SetSdkFactory`): production binds it to
|
|
10
12
|
* the real model-resolution path (`@memberjunction/ai-agents`), and tests/de-risk inject a stub session.
|
|
@@ -14,7 +16,8 @@
|
|
|
14
16
|
*/
|
|
15
17
|
import { BaseSingleton } from '@memberjunction/global';
|
|
16
18
|
import { type IMetadataProvider, type UserInfo } from '@memberjunction/core';
|
|
17
|
-
import type
|
|
19
|
+
import { type IRealtimeSession, type RealtimeToolDefinition } from '@memberjunction/ai';
|
|
20
|
+
import { type NativeAvatarVideoSupport } from '@memberjunction/ai-bridge-livekit';
|
|
18
21
|
import { type BridgeDisconnectReason, type BridgeTurnMode, type TurnAddressingMode } from '@memberjunction/ai-bridge-base';
|
|
19
22
|
import { AIBridgeEngine, type BridgeTranscriptSink, type BridgeTurnTakingToolHandler, type RoomTurnSnapshot } from '@memberjunction/ai-bridge-server';
|
|
20
23
|
import { LiveKitTokenService } from './livekit-token-service.js';
|
|
@@ -51,17 +54,38 @@ export interface RealtimeSessionStartContext {
|
|
|
51
54
|
SelfNames?: string[];
|
|
52
55
|
/** Tools the host declares and executes itself (call control, handoff). Added to the model's tool set. */
|
|
53
56
|
HostTools?: RealtimeToolDefinition[];
|
|
57
|
+
/**
|
|
58
|
+
* Optional callback allowing the coordinator to resolve host tools dynamically based on
|
|
59
|
+
* the model and driver class context actually resolved for the session, before session opening.
|
|
60
|
+
*/
|
|
61
|
+
ResolveHostTools?: (resolved: {
|
|
62
|
+
ModelID?: string;
|
|
63
|
+
ModelVendorID?: string;
|
|
64
|
+
DriverClass?: string;
|
|
65
|
+
}) => RealtimeToolDefinition[] | undefined;
|
|
54
66
|
/** Host-authored instructions appended to the system prompt (for example the phone framing). */
|
|
55
67
|
HostFraming?: string;
|
|
56
68
|
/** Role-tagged transcript so far, framed into the prompt when a lost model session is re-opened mid-call. */
|
|
57
69
|
PriorTranscript?: string;
|
|
58
70
|
/** The `MJ: Conversations` row the session writes to — stamped on the co-agent observability run. */
|
|
59
71
|
ConversationID?: string;
|
|
72
|
+
/**
|
|
73
|
+
* `'room'` when this host's bot can publish the agent's avatar into the room (the native module answered
|
|
74
|
+
* `describeAvatarVideo` with support): the session may then ask the model to render it. Absent: audio only, as before.
|
|
75
|
+
*/
|
|
76
|
+
AvatarDelivery?: 'room';
|
|
77
|
+
/**
|
|
78
|
+
* `true` when the agent is answering a phone call in the room ({@link AgentRoomHostOptions.Channel} `'phone'`): the
|
|
79
|
+
* caller sees no video, so the session asks the model for no avatar and reports `phone`. Never set with
|
|
80
|
+
* {@link AvatarDelivery}.
|
|
81
|
+
*/
|
|
82
|
+
PhoneCall?: boolean;
|
|
60
83
|
}
|
|
61
84
|
/**
|
|
62
85
|
* What a HOST that owns the call (a phone call arriving in a room, a web room with handoff tools) adds to an agent's
|
|
63
86
|
* room session beyond the plain "join the room" the coordinator does for the Meet UI. All optional: a session started
|
|
64
|
-
* without it behaves exactly as before.
|
|
87
|
+
* without it behaves exactly as before. A start that created the agent session for this agent alone (a Meet room, a
|
|
88
|
+
* scheduled meeting) passes only {@link AgentRoomHostOptions.OnSessionEnded}, to close that session when the agent leaves.
|
|
65
89
|
*/
|
|
66
90
|
export interface AgentRoomHostOptions {
|
|
67
91
|
/** Tools the host executes itself. */
|
|
@@ -81,12 +105,22 @@ export interface AgentRoomHostOptions {
|
|
|
81
105
|
OnBargeIn?: () => void;
|
|
82
106
|
/** Re-open the model session once, with the conversation so far, if it drops mid-call. */
|
|
83
107
|
RecoverModelSession?: boolean;
|
|
84
|
-
/**
|
|
108
|
+
/**
|
|
109
|
+
* Called once when the session has fully ended, for whatever reason (a stop, an emptied room, a lost model session),
|
|
110
|
+
* for the host's own bookkeeping: closing the agent session it created, freeing a capacity slot.
|
|
111
|
+
*/
|
|
85
112
|
OnSessionEnded?: (reason: BridgeDisconnectReason) => void | Promise<void>;
|
|
86
113
|
/** How the agent got into the room. Default `'OnDemand'`. */
|
|
87
114
|
JoinMethod?: 'InboundRoute' | 'OnDemand' | 'Invite';
|
|
88
115
|
/** Whether the agent was called into the room or placed the call. Default: not stated. */
|
|
89
116
|
Direction?: 'Inbound' | 'Outbound';
|
|
117
|
+
/**
|
|
118
|
+
* How the person the agent serves reached the room: `'phone'`, a phone call through SIP (they hear the agent and see
|
|
119
|
+
* nothing), or `'web'`, a browser. On a phone call the coordinator never asks for the avatar: no room delivery, and the
|
|
120
|
+
* session asks the model for none (`phone`), even when people in the room could see it. Default: not stated, which
|
|
121
|
+
* is treated like `'web'`.
|
|
122
|
+
*/
|
|
123
|
+
Channel?: 'phone' | 'web';
|
|
90
124
|
}
|
|
91
125
|
/**
|
|
92
126
|
* Installs the engine's turn-taking tool handler on a model session — the seam that lets this package stay free
|
|
@@ -94,6 +128,19 @@ export interface AgentRoomHostOptions {
|
|
|
94
128
|
* (`@memberjunction/ai-agents`); a test binds a spy.
|
|
95
129
|
*/
|
|
96
130
|
export type TurnToolBinder = (session: IRealtimeSession, handler: BridgeTurnTakingToolHandler) => void;
|
|
131
|
+
/**
|
|
132
|
+
* Says whether the agent behind a model session watches meetings (its `realtime.video.watchMeetings` setting) — the
|
|
133
|
+
* seam that keeps this package free of the agent runtime, like {@link TurnToolBinder}. Production binds it to the
|
|
134
|
+
* session's bridged runtime (`@memberjunction/ai-agents`); unbound, no agent watches.
|
|
135
|
+
*/
|
|
136
|
+
export type AgentVisionResolver = (session: IRealtimeSession) => boolean;
|
|
137
|
+
/**
|
|
138
|
+
* Records a failed start on the co-agent run of the model session the start opened, with the start's error — the seam
|
|
139
|
+
* that keeps this package free of the agent runtime, like {@link TurnToolBinder}. Production binds it to the session's
|
|
140
|
+
* bridged runtime (`Finalize(false, error)`, `@memberjunction/ai-agents`). The coordinator calls it before it closes that
|
|
141
|
+
* session, because the close alone finalizes the run as completed, which is what happens when nothing is bound.
|
|
142
|
+
*/
|
|
143
|
+
export type FailedStartRecorder = (session: IRealtimeSession, error: string) => Promise<void>;
|
|
97
144
|
/**
|
|
98
145
|
* Opens a realtime model session for the agent. Production binds this to the real model-resolution path;
|
|
99
146
|
* tests inject a stub. Defaults to a clear "not bound" error so misconfiguration fails loudly.
|
|
@@ -118,6 +165,8 @@ export interface StartAgentRoomSessionParams {
|
|
|
118
165
|
RealtimeModelID?: string;
|
|
119
166
|
/** Optional per-session VOICE override (provider-native voice id) — gives this agent a distinct voice. */
|
|
120
167
|
RealtimeVoice?: string;
|
|
168
|
+
/** Explicit override for whether the model is full-duplex. When omitted, resolved from model metadata or driver capabilities. */
|
|
169
|
+
FullDuplex?: boolean;
|
|
121
170
|
/** Extra aliases the agent answers to (for Passive turn-taking). */
|
|
122
171
|
AgentAliases?: string[];
|
|
123
172
|
/** Turn-taking mode. Default: `'Passive'` (speak only when addressed). */
|
|
@@ -132,7 +181,10 @@ export interface StartAgentRoomSessionParams {
|
|
|
132
181
|
ContextUser?: UserInfo;
|
|
133
182
|
/** The metadata provider for the session. */
|
|
134
183
|
MetadataProvider?: IMetadataProvider;
|
|
135
|
-
/**
|
|
184
|
+
/**
|
|
185
|
+
* What a host that owns the call adds (tools, framing, transcript, recovery). A plain Meet room passes at most its
|
|
186
|
+
* end-of-session hook, to close the agent session it created.
|
|
187
|
+
*/
|
|
136
188
|
Host?: AgentRoomHostOptions;
|
|
137
189
|
}
|
|
138
190
|
/** One agent's membership in a room's roster (for multi-agent meeting detection). */
|
|
@@ -171,6 +223,8 @@ export declare class LiveKitAgentRoomCoordinator extends BaseSingleton<LiveKitAg
|
|
|
171
223
|
private roomRosters;
|
|
172
224
|
private bridgeOps;
|
|
173
225
|
private turnToolBinder?;
|
|
226
|
+
private agentVisionResolver?;
|
|
227
|
+
private failedStartRecorder?;
|
|
174
228
|
private turnStateSource;
|
|
175
229
|
private sessionFactory;
|
|
176
230
|
/** BaseSingleton requires a protected constructor. */
|
|
@@ -191,6 +245,20 @@ export declare class LiveKitAgentRoomCoordinator extends BaseSingleton<LiveKitAg
|
|
|
191
245
|
* @param binder The binder, or `undefined` to clear it.
|
|
192
246
|
*/
|
|
193
247
|
SetTurnToolBinder(binder: TurnToolBinder | undefined): void;
|
|
248
|
+
/**
|
|
249
|
+
* Binds the seam that says whether the agent behind a model session watches meetings. Without it no agent watches:
|
|
250
|
+
* the bot reads nobody's camera or screen and the room never offers people the choice.
|
|
251
|
+
*
|
|
252
|
+
* @param resolver The resolver, or `undefined` to clear it.
|
|
253
|
+
*/
|
|
254
|
+
SetAgentVisionResolver(resolver: AgentVisionResolver | undefined): void;
|
|
255
|
+
/**
|
|
256
|
+
* Binds the seam that records a failed start on the agent's co-agent run. Without it, the run of an agent whose start
|
|
257
|
+
* failed reads as completed: closing its model session finalizes the run that way.
|
|
258
|
+
*
|
|
259
|
+
* @param recorder The recorder, or `undefined` to clear it.
|
|
260
|
+
*/
|
|
261
|
+
SetFailedStartRecorder(recorder: FailedStartRecorder | undefined): void;
|
|
194
262
|
/**
|
|
195
263
|
* Overrides where a room's turn-taking snapshot comes from (an injectable seam for unit testing; production
|
|
196
264
|
* reads the process-wide {@link AIBridgeEngine}).
|
|
@@ -220,16 +288,58 @@ export declare class LiveKitAgentRoomCoordinator extends BaseSingleton<LiveKitAg
|
|
|
220
288
|
*/
|
|
221
289
|
SetBridgeOps(ops: BridgeOps): void;
|
|
222
290
|
/**
|
|
223
|
-
* Starts the agent's presence in a LiveKit room:
|
|
224
|
-
* bridges
|
|
291
|
+
* Starts the agent's presence in a LiveKit room: opens the realtime session, mints the bot token, and
|
|
292
|
+
* bridges the session into the room.
|
|
293
|
+
*
|
|
294
|
+
* A start that fails once the model session is open (the bot token can't be minted, the bridge doesn't start) closes
|
|
295
|
+
* that session before the error propagates, after recording the failure, with the start's error, on the session's
|
|
296
|
+
* co-agent run ({@link SetFailedStartRecorder}), which would otherwise read as completed. The agent session it runs under
|
|
297
|
+
* (`AgentSessionID`) is the caller's: a caller that created one for this start closes it.
|
|
225
298
|
*
|
|
226
299
|
* @param params The session parameters.
|
|
227
300
|
* @returns The active session handles.
|
|
228
|
-
* @throws {Error} when the LiveKit provider is not configured/registered
|
|
301
|
+
* @throws {Error} when the LiveKit provider is not configured/registered, the session factory is unbound or fails,
|
|
302
|
+
* the bot token can't be minted, or the bridge doesn't start.
|
|
229
303
|
*/
|
|
230
304
|
StartAgentRoomSession(params: StartAgentRoomSessionParams): Promise<AgentRoomSession>;
|
|
231
|
-
/**
|
|
305
|
+
/**
|
|
306
|
+
* Whether the agent behind this model session watches the meeting: its setting is on (through the bound
|
|
307
|
+
* {@link AgentVisionResolver}) AND its session takes inbound video. Watching on an audio-only model would offer people
|
|
308
|
+
* a choice no frame could honour, so it is logged and treated as off.
|
|
309
|
+
*/
|
|
310
|
+
private agentWatches;
|
|
311
|
+
/**
|
|
312
|
+
* Whether this host's bots can publish an agent's avatar, from the native room module the bots join with (`ffmpeg`
|
|
313
|
+
* with the H.264 and AAC decoders, and a room SDK that publishes video). Asked before every agent's model session
|
|
314
|
+
* opens; the module probes once and remembers. A module that cannot be loaded, or that predates avatars, means no.
|
|
315
|
+
*/
|
|
316
|
+
DescribeAvatarVideo(): Promise<NativeAvatarVideoSupport>;
|
|
317
|
+
/**
|
|
318
|
+
* What became of the agent's avatar request: the session's own status, except that a session which asked for an
|
|
319
|
+
* avatar and stayed audio only because this host could not publish it carries the host's reason (`decoder-missing`
|
|
320
|
+
* when there is no usable ffmpeg, `phone` on a phone call whose session factory still asked). Logged once per join when
|
|
321
|
+
* an avatar was asked for.
|
|
322
|
+
*/
|
|
323
|
+
private avatarStatusFor;
|
|
324
|
+
/**
|
|
325
|
+
* Mints the bot's join token with its attributes: `mj.agentWatches` when the agent watches, so the room offers people
|
|
326
|
+
* the choice from the moment the bot joins, and `mj.agentAvatar` when the agent asked for an avatar. Minted once the
|
|
327
|
+
* model session is open; when it fails, the start closes that session (see {@link StartAgentRoomSession}).
|
|
328
|
+
*/
|
|
329
|
+
private mintBotToken;
|
|
330
|
+
/**
|
|
331
|
+
* Closes the model session of a start that failed before the bridge engine took it: the bot's token could not be minted,
|
|
332
|
+
* or the bridge did not start (its row could not be saved, the driver could not connect). The failure is recorded on the
|
|
333
|
+
* session's co-agent run first ({@link FailedStartRecorder}), since the close alone would finalize that run as completed.
|
|
334
|
+
* Neither step throws: a failure is logged, so the caller sees why the start failed and the session is still closed.
|
|
335
|
+
*/
|
|
336
|
+
private closeModelSessionOfFailedStart;
|
|
337
|
+
/** Installs the engine's turn-taking tool handler on the model session, when the session has one (a turn-based model in a room). */
|
|
232
338
|
private bindTurnTools;
|
|
339
|
+
/**
|
|
340
|
+
* Resolves whether the model with the given ID is full duplex from model metadata and static driver capabilities.
|
|
341
|
+
*/
|
|
342
|
+
private resolveIsModelFullDuplexFromId;
|
|
233
343
|
/** Appends an agent to a room's roster (creating the room's list on first join). */
|
|
234
344
|
private addToRoster;
|
|
235
345
|
/** Removes an agent from whatever room roster holds its bridge id; prunes the room when it empties. */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"livekit-agent-room-coordinator.d.ts","sourceRoot":"","sources":["../src/livekit-agent-room-coordinator.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"livekit-agent-room-coordinator.d.ts","sourceRoot":"","sources":["../src/livekit-agent-room-coordinator.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAEH,OAAO,EAAE,aAAa,EAA6B,MAAM,wBAAwB,CAAC;AAClF,OAAO,EAAuB,KAAK,iBAAiB,EAAE,KAAK,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAClG,OAAO,EAML,KAAK,gBAAgB,EAErB,KAAK,sBAAsB,EAC5B,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAuB,KAAK,wBAAwB,EAAE,MAAM,mCAAmC,CAAC;AAEvG,OAAO,EAIL,KAAK,sBAAsB,EAC3B,KAAK,cAAc,EACnB,KAAK,kBAAkB,EACxB,MAAM,gCAAgC,CAAC;AACxC,OAAO,EACL,cAAc,EAEd,KAAK,oBAAoB,EACzB,KAAK,2BAA2B,EAChC,KAAK,gBAAgB,EACtB,MAAM,kCAAkC,CAAC;AAC1C,OAAO,EAAE,mBAAmB,EAAoB,MAAM,yBAAyB,CAAC;AAwBhF,yGAAyG;AACzG,MAAM,MAAM,SAAS,GAAG,IAAI,CAAC,cAAc,EAAE,QAAQ,GAAG,uBAAuB,GAAG,oBAAoB,GAAG,mBAAmB,GAAG,6BAA6B,CAAC,CAAC;AAE9J,2GAA2G;AAC3G,eAAO,MAAM,2BAA2B,kBAAkB,CAAC;AAW3D,0FAA0F;AAC1F,MAAM,WAAW,2BAA2B;IAC1C,kDAAkD;IAClD,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,8EAA8E;IAC9E,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,+FAA+F;IAC/F,aAAa,CAAC,EAAE,MAAM,CAAC;IACvB,iEAAiE;IACjE,eAAe,C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