@pagelines/sdk 1.0.886 → 1.0.887
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.
|
@@ -16,7 +16,7 @@ export interface VoiceRoom {
|
|
|
16
16
|
on: (event: string, handler: (...args: any[]) => void) => unknown;
|
|
17
17
|
off: (event: string, handler: (...args: any[]) => void) => unknown;
|
|
18
18
|
remoteParticipants: ReadonlyMap<string, {
|
|
19
|
-
|
|
19
|
+
isAgent: boolean;
|
|
20
20
|
attributes: Readonly<Record<string, string>>;
|
|
21
21
|
}>;
|
|
22
22
|
localParticipant: {
|
package/dist/provider2.js
CHANGED
|
@@ -18331,7 +18331,7 @@ var JWSSignatureVerificationFailed = class extends JOSEError {
|
|
|
18331
18331
|
_defineProperty(JWSSignatureVerificationFailed, "code", "ERR_JWS_SIGNATURE_VERIFICATION_FAILED");
|
|
18332
18332
|
//#endregion
|
|
18333
18333
|
//#region bot/voice/providers/livekit/provider.ts
|
|
18334
|
-
var $a = 1e4, eo = "lk.
|
|
18334
|
+
var $a = 1e4, eo = "lk.agent.state", LiveKitVoiceProvider = class {
|
|
18335
18335
|
constructor(t, n = {}) {
|
|
18336
18336
|
e(this, "mint", void 0), e(this, "room", void 0), e(this, "createAnalyser", void 0), e(this, "handlers", void 0), e(this, "cancelReadyWait", void 0), e(this, "analysers", []), e(this, "levelSources", []), e(this, "attachedElements", []), e(this, "closing", !1), e(this, "userSpeaking", !1), e(this, "botActiveSpeaker", !1), e(this, "botStateSpeaking", !1), e(this, "lastSpeaking", void 0), this.mint = t, this.room = n.createRoom?.() ?? new Za(), this.createAnalyser = n.createAnalyser;
|
|
18337
18337
|
}
|
|
@@ -18339,11 +18339,11 @@ var $a = 1e4, eo = "lk.bot.state", LiveKitVoiceProvider = class {
|
|
|
18339
18339
|
this.handlers = e, this.room.on(P.TrackSubscribed, (e) => {
|
|
18340
18340
|
e.kind === z.Kind.Audio && this.attachRemoteAudio(e);
|
|
18341
18341
|
}), this.room.on(P.ParticipantAttributesChanged, (e, t) => {
|
|
18342
|
-
if (!t.
|
|
18342
|
+
if (!t.isAgent) return;
|
|
18343
18343
|
let n = t.attributes[eo];
|
|
18344
18344
|
this.handlers?.onThinkingChange?.(n === "thinking"), this.botStateSpeaking = n === "speaking", this.publishSpeaking();
|
|
18345
18345
|
}), this.room.on(P.ActiveSpeakersChanged, (e) => {
|
|
18346
|
-
this.userSpeaking = e.some((e) => e.isLocal), this.botActiveSpeaker = e.some((e) => e.
|
|
18346
|
+
this.userSpeaking = e.some((e) => e.isLocal), this.botActiveSpeaker = e.some((e) => e.isAgent), this.publishSpeaking();
|
|
18347
18347
|
}), this.room.on(P.Disconnected, (e) => {
|
|
18348
18348
|
this.closing || this.handlers?.onDisconnected(disconnectCause(e));
|
|
18349
18349
|
});
|
|
@@ -18400,7 +18400,7 @@ var $a = 1e4, eo = "lk.bot.state", LiveKitVoiceProvider = class {
|
|
|
18400
18400
|
async waitForBotReady() {
|
|
18401
18401
|
let ready = (e) => {
|
|
18402
18402
|
let t = e.attributes[eo];
|
|
18403
|
-
return e.
|
|
18403
|
+
return e.isAgent && (t === "listening" || t === "thinking" || t === "speaking");
|
|
18404
18404
|
};
|
|
18405
18405
|
[...this.room.remoteParticipants.values()].some(ready) || await new Promise((e, t) => {
|
|
18406
18406
|
let n = !1, finish = (i) => {
|