@whereby.com/assistant-sdk 0.0.0-canary-20250923130059 → 0.0.0-canary-20251002113535
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.cjs +8 -6
- package/dist/index.d.cts +3 -1
- package/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.mjs +8 -6
- package/dist/legacy-esm.js +8 -6
- package/package.json +2 -2
package/dist/index.cjs
CHANGED
|
@@ -586,11 +586,13 @@ class Assistant extends EventEmitter {
|
|
|
586
586
|
this.combinedStream = null;
|
|
587
587
|
this.remoteMediaTracks = {};
|
|
588
588
|
this.roomUrl = null;
|
|
589
|
+
this.stateSubscriptions = [];
|
|
589
590
|
this.handleConnectionStatusChange = (status) => {
|
|
590
591
|
if (status === "connected") {
|
|
591
592
|
this.emit(ASSISTANT_JOINED_ROOM, { roomUrl: this.roomUrl || "" });
|
|
592
593
|
}
|
|
593
594
|
if (["left", "kicked"].includes(status)) {
|
|
595
|
+
this.stateSubscriptions.forEach((unsubscribe) => unsubscribe());
|
|
594
596
|
this.emit(ASSISTANT_LEFT_ROOM, { roomUrl: this.roomUrl || "" });
|
|
595
597
|
}
|
|
596
598
|
};
|
|
@@ -652,10 +654,10 @@ class Assistant extends EventEmitter {
|
|
|
652
654
|
};
|
|
653
655
|
const audioMixer = new AudioMixer(handleStreamReady);
|
|
654
656
|
this.combinedStream = audioMixer.getCombinedAudioStream();
|
|
655
|
-
this.roomConnection.subscribeToRemoteParticipants(audioMixer.handleRemoteParticipants.bind(audioMixer));
|
|
657
|
+
this.stateSubscriptions.push(this.roomConnection.subscribeToRemoteParticipants(audioMixer.handleRemoteParticipants.bind(audioMixer)));
|
|
656
658
|
}
|
|
657
|
-
this.roomConnection.subscribeToConnectionStatus(this.handleConnectionStatusChange);
|
|
658
|
-
this.roomConnection.subscribeToRemoteParticipants(this.handleRemoteParticipantsTracksChange);
|
|
659
|
+
this.stateSubscriptions.push(this.roomConnection.subscribeToConnectionStatus(this.handleConnectionStatusChange));
|
|
660
|
+
this.stateSubscriptions.push(this.roomConnection.subscribeToRemoteParticipants(this.handleRemoteParticipantsTracksChange));
|
|
659
661
|
}
|
|
660
662
|
joinRoom(roomUrl) {
|
|
661
663
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -672,7 +674,7 @@ class Assistant extends EventEmitter {
|
|
|
672
674
|
isNodeSdk: true,
|
|
673
675
|
assistantKey: this.assistantKey,
|
|
674
676
|
});
|
|
675
|
-
this.roomConnection.joinRoom();
|
|
677
|
+
return this.roomConnection.joinRoom();
|
|
676
678
|
});
|
|
677
679
|
}
|
|
678
680
|
startLocalMedia() {
|
|
@@ -814,8 +816,8 @@ class Trigger extends EventEmitter.EventEmitter {
|
|
|
814
816
|
const app = express();
|
|
815
817
|
const router = webhookRouter(this.webhookTriggers, this);
|
|
816
818
|
app.use(router);
|
|
817
|
-
app.listen(this.port, () => {
|
|
818
|
-
|
|
819
|
+
app.listen(this.port).on("error", (error) => {
|
|
820
|
+
console.error("Could not start Trigger web server", error);
|
|
819
821
|
});
|
|
820
822
|
}
|
|
821
823
|
}
|
package/dist/index.d.cts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as wrtc from '@roamhq/wrtc';
|
|
2
2
|
import wrtc__default from '@roamhq/wrtc';
|
|
3
|
+
import * as _whereby_com_core from '@whereby.com/core';
|
|
3
4
|
import { RoomConnectionClient, RemoteParticipantState, ChatMessage } from '@whereby.com/core';
|
|
4
5
|
export { RemoteParticipantState } from '@whereby.com/core';
|
|
5
6
|
import EventEmitter, { EventEmitter as EventEmitter$1 } from 'events';
|
|
@@ -146,10 +147,11 @@ declare class Assistant extends EventEmitter<AssistantEvents> {
|
|
|
146
147
|
private combinedStream;
|
|
147
148
|
private remoteMediaTracks;
|
|
148
149
|
private roomUrl;
|
|
150
|
+
private stateSubscriptions;
|
|
149
151
|
constructor({ assistantKey, startCombinedAudioStream, startLocalMedia }: AssistantOptions);
|
|
150
152
|
private handleConnectionStatusChange;
|
|
151
153
|
private handleRemoteParticipantsTracksChange;
|
|
152
|
-
joinRoom(roomUrl: string): Promise<
|
|
154
|
+
joinRoom(roomUrl: string): Promise<_whereby_com_core.RoomJoinedSuccess>;
|
|
153
155
|
startLocalMedia(): void;
|
|
154
156
|
getLocalMediaStream(): MediaStream | null;
|
|
155
157
|
getLocalAudioSource(): wrtc__default.nonstandard.RTCAudioSource | null;
|
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as wrtc from '@roamhq/wrtc';
|
|
2
2
|
import wrtc__default from '@roamhq/wrtc';
|
|
3
|
+
import * as _whereby_com_core from '@whereby.com/core';
|
|
3
4
|
import { RoomConnectionClient, RemoteParticipantState, ChatMessage } from '@whereby.com/core';
|
|
4
5
|
export { RemoteParticipantState } from '@whereby.com/core';
|
|
5
6
|
import EventEmitter, { EventEmitter as EventEmitter$1 } from 'events';
|
|
@@ -146,10 +147,11 @@ declare class Assistant extends EventEmitter<AssistantEvents> {
|
|
|
146
147
|
private combinedStream;
|
|
147
148
|
private remoteMediaTracks;
|
|
148
149
|
private roomUrl;
|
|
150
|
+
private stateSubscriptions;
|
|
149
151
|
constructor({ assistantKey, startCombinedAudioStream, startLocalMedia }: AssistantOptions);
|
|
150
152
|
private handleConnectionStatusChange;
|
|
151
153
|
private handleRemoteParticipantsTracksChange;
|
|
152
|
-
joinRoom(roomUrl: string): Promise<
|
|
154
|
+
joinRoom(roomUrl: string): Promise<_whereby_com_core.RoomJoinedSuccess>;
|
|
153
155
|
startLocalMedia(): void;
|
|
154
156
|
getLocalMediaStream(): MediaStream | null;
|
|
155
157
|
getLocalAudioSource(): wrtc__default.nonstandard.RTCAudioSource | null;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import * as wrtc from '@roamhq/wrtc';
|
|
2
2
|
import wrtc__default from '@roamhq/wrtc';
|
|
3
|
+
import * as _whereby_com_core from '@whereby.com/core';
|
|
3
4
|
import { RoomConnectionClient, RemoteParticipantState, ChatMessage } from '@whereby.com/core';
|
|
4
5
|
export { RemoteParticipantState } from '@whereby.com/core';
|
|
5
6
|
import EventEmitter, { EventEmitter as EventEmitter$1 } from 'events';
|
|
@@ -146,10 +147,11 @@ declare class Assistant extends EventEmitter<AssistantEvents> {
|
|
|
146
147
|
private combinedStream;
|
|
147
148
|
private remoteMediaTracks;
|
|
148
149
|
private roomUrl;
|
|
150
|
+
private stateSubscriptions;
|
|
149
151
|
constructor({ assistantKey, startCombinedAudioStream, startLocalMedia }: AssistantOptions);
|
|
150
152
|
private handleConnectionStatusChange;
|
|
151
153
|
private handleRemoteParticipantsTracksChange;
|
|
152
|
-
joinRoom(roomUrl: string): Promise<
|
|
154
|
+
joinRoom(roomUrl: string): Promise<_whereby_com_core.RoomJoinedSuccess>;
|
|
153
155
|
startLocalMedia(): void;
|
|
154
156
|
getLocalMediaStream(): MediaStream | null;
|
|
155
157
|
getLocalAudioSource(): wrtc__default.nonstandard.RTCAudioSource | null;
|
package/dist/index.mjs
CHANGED
|
@@ -565,11 +565,13 @@ class Assistant extends EventEmitter$1 {
|
|
|
565
565
|
this.combinedStream = null;
|
|
566
566
|
this.remoteMediaTracks = {};
|
|
567
567
|
this.roomUrl = null;
|
|
568
|
+
this.stateSubscriptions = [];
|
|
568
569
|
this.handleConnectionStatusChange = (status) => {
|
|
569
570
|
if (status === "connected") {
|
|
570
571
|
this.emit(ASSISTANT_JOINED_ROOM, { roomUrl: this.roomUrl || "" });
|
|
571
572
|
}
|
|
572
573
|
if (["left", "kicked"].includes(status)) {
|
|
574
|
+
this.stateSubscriptions.forEach((unsubscribe) => unsubscribe());
|
|
573
575
|
this.emit(ASSISTANT_LEFT_ROOM, { roomUrl: this.roomUrl || "" });
|
|
574
576
|
}
|
|
575
577
|
};
|
|
@@ -631,10 +633,10 @@ class Assistant extends EventEmitter$1 {
|
|
|
631
633
|
};
|
|
632
634
|
const audioMixer = new AudioMixer(handleStreamReady);
|
|
633
635
|
this.combinedStream = audioMixer.getCombinedAudioStream();
|
|
634
|
-
this.roomConnection.subscribeToRemoteParticipants(audioMixer.handleRemoteParticipants.bind(audioMixer));
|
|
636
|
+
this.stateSubscriptions.push(this.roomConnection.subscribeToRemoteParticipants(audioMixer.handleRemoteParticipants.bind(audioMixer)));
|
|
635
637
|
}
|
|
636
|
-
this.roomConnection.subscribeToConnectionStatus(this.handleConnectionStatusChange);
|
|
637
|
-
this.roomConnection.subscribeToRemoteParticipants(this.handleRemoteParticipantsTracksChange);
|
|
638
|
+
this.stateSubscriptions.push(this.roomConnection.subscribeToConnectionStatus(this.handleConnectionStatusChange));
|
|
639
|
+
this.stateSubscriptions.push(this.roomConnection.subscribeToRemoteParticipants(this.handleRemoteParticipantsTracksChange));
|
|
638
640
|
}
|
|
639
641
|
joinRoom(roomUrl) {
|
|
640
642
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -651,7 +653,7 @@ class Assistant extends EventEmitter$1 {
|
|
|
651
653
|
isNodeSdk: true,
|
|
652
654
|
assistantKey: this.assistantKey,
|
|
653
655
|
});
|
|
654
|
-
this.roomConnection.joinRoom();
|
|
656
|
+
return this.roomConnection.joinRoom();
|
|
655
657
|
});
|
|
656
658
|
}
|
|
657
659
|
startLocalMedia() {
|
|
@@ -793,8 +795,8 @@ class Trigger extends EventEmitter {
|
|
|
793
795
|
const app = express();
|
|
794
796
|
const router = webhookRouter(this.webhookTriggers, this);
|
|
795
797
|
app.use(router);
|
|
796
|
-
app.listen(this.port, () => {
|
|
797
|
-
|
|
798
|
+
app.listen(this.port).on("error", (error) => {
|
|
799
|
+
console.error("Could not start Trigger web server", error);
|
|
798
800
|
});
|
|
799
801
|
}
|
|
800
802
|
}
|
package/dist/legacy-esm.js
CHANGED
|
@@ -565,11 +565,13 @@ class Assistant extends EventEmitter$1 {
|
|
|
565
565
|
this.combinedStream = null;
|
|
566
566
|
this.remoteMediaTracks = {};
|
|
567
567
|
this.roomUrl = null;
|
|
568
|
+
this.stateSubscriptions = [];
|
|
568
569
|
this.handleConnectionStatusChange = (status) => {
|
|
569
570
|
if (status === "connected") {
|
|
570
571
|
this.emit(ASSISTANT_JOINED_ROOM, { roomUrl: this.roomUrl || "" });
|
|
571
572
|
}
|
|
572
573
|
if (["left", "kicked"].includes(status)) {
|
|
574
|
+
this.stateSubscriptions.forEach((unsubscribe) => unsubscribe());
|
|
573
575
|
this.emit(ASSISTANT_LEFT_ROOM, { roomUrl: this.roomUrl || "" });
|
|
574
576
|
}
|
|
575
577
|
};
|
|
@@ -631,10 +633,10 @@ class Assistant extends EventEmitter$1 {
|
|
|
631
633
|
};
|
|
632
634
|
const audioMixer = new AudioMixer(handleStreamReady);
|
|
633
635
|
this.combinedStream = audioMixer.getCombinedAudioStream();
|
|
634
|
-
this.roomConnection.subscribeToRemoteParticipants(audioMixer.handleRemoteParticipants.bind(audioMixer));
|
|
636
|
+
this.stateSubscriptions.push(this.roomConnection.subscribeToRemoteParticipants(audioMixer.handleRemoteParticipants.bind(audioMixer)));
|
|
635
637
|
}
|
|
636
|
-
this.roomConnection.subscribeToConnectionStatus(this.handleConnectionStatusChange);
|
|
637
|
-
this.roomConnection.subscribeToRemoteParticipants(this.handleRemoteParticipantsTracksChange);
|
|
638
|
+
this.stateSubscriptions.push(this.roomConnection.subscribeToConnectionStatus(this.handleConnectionStatusChange));
|
|
639
|
+
this.stateSubscriptions.push(this.roomConnection.subscribeToRemoteParticipants(this.handleRemoteParticipantsTracksChange));
|
|
638
640
|
}
|
|
639
641
|
joinRoom(roomUrl) {
|
|
640
642
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -651,7 +653,7 @@ class Assistant extends EventEmitter$1 {
|
|
|
651
653
|
isNodeSdk: true,
|
|
652
654
|
assistantKey: this.assistantKey,
|
|
653
655
|
});
|
|
654
|
-
this.roomConnection.joinRoom();
|
|
656
|
+
return this.roomConnection.joinRoom();
|
|
655
657
|
});
|
|
656
658
|
}
|
|
657
659
|
startLocalMedia() {
|
|
@@ -793,8 +795,8 @@ class Trigger extends EventEmitter {
|
|
|
793
795
|
const app = express();
|
|
794
796
|
const router = webhookRouter(this.webhookTriggers, this);
|
|
795
797
|
app.use(router);
|
|
796
|
-
app.listen(this.port, () => {
|
|
797
|
-
|
|
798
|
+
app.listen(this.port).on("error", (error) => {
|
|
799
|
+
console.error("Could not start Trigger web server", error);
|
|
798
800
|
});
|
|
799
801
|
}
|
|
800
802
|
}
|
package/package.json
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"name": "@whereby.com/assistant-sdk",
|
|
3
3
|
"description": "Assistant SDK for whereby.com",
|
|
4
4
|
"author": "Whereby AS",
|
|
5
|
-
"version": "0.0.0-canary-
|
|
5
|
+
"version": "0.0.0-canary-20251002113535",
|
|
6
6
|
"license": "MIT",
|
|
7
7
|
"files": [
|
|
8
8
|
"dist",
|
|
@@ -64,7 +64,7 @@
|
|
|
64
64
|
"express": "5.1.0",
|
|
65
65
|
"uuid": "^11.0.3",
|
|
66
66
|
"ws": "^8.18.0",
|
|
67
|
-
"@whereby.com/core": "0.0.0-canary-
|
|
67
|
+
"@whereby.com/core": "0.0.0-canary-20251002113535"
|
|
68
68
|
},
|
|
69
69
|
"prettier": "@whereby.com/prettier-config",
|
|
70
70
|
"scripts": {
|