@voxevolv/client 0.3.16 → 0.3.17

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.
@@ -16249,6 +16249,7 @@ class WebSocketStream {
16249
16249
  reason = _ref3.reason;
16250
16250
  resolve({
16251
16251
  closeCode: code,
16252
+ wasClean: _ref3.wasClean,
16252
16253
  reason
16253
16254
  });
16254
16255
  ws.removeEventListener('error', rejectHandler);
@@ -16428,6 +16429,13 @@ class SignalClient {
16428
16429
  try {
16429
16430
  this.ws.closed.then(closeInfo => {
16430
16431
  var _a;
16432
+ if (this.state === SignalConnectionState.CONNECTED) {
16433
+ try { this.voxevolvObserveConnection?.({
16434
+ reason: "websocket_closed",
16435
+ ws_close_code: closeInfo.closeCode ?? closeInfo.code,
16436
+ ws_close_clean: closeInfo.wasClean
16437
+ }); } catch {}
16438
+ }
16431
16439
  if (this.isEstablishingConnection) {
16432
16440
  reject(ConnectionError.internal("Websocket got closed during a (re)connection attempt: ".concat(closeInfo.reason)));
16433
16441
  }
@@ -16444,6 +16452,7 @@ class SignalClient {
16444
16452
  }
16445
16453
  return;
16446
16454
  }).catch(reason => {
16455
+ try { this.voxevolvObserveConnection?.({ reason: "websocket_error" }); } catch {}
16447
16456
  if (this.isEstablishingConnection) {
16448
16457
  reject(ConnectionError.internal("Websocket error during a (re)connection attempt: ".concat(reason)));
16449
16458
  }
@@ -16918,6 +16927,11 @@ class SignalClient {
16918
16927
  handleOnClose(reason) {
16919
16928
  return __awaiter(this, void 0, void 0, function* () {
16920
16929
  if (this.state === SignalConnectionState.DISCONNECTED) return;
16930
+ try { this.voxevolvObserveConnection?.({
16931
+ reason: reason === "ping timeout" ? "signal_ping_timeout" : "signal_closed",
16932
+ signal_timeout_ms: this.pingTimeoutDuration * 1000,
16933
+ signal_idle_ms: this.voxevolvLastSignalAt === undefined ? undefined : performance.now() - this.voxevolvLastSignalAt
16934
+ }); } catch {}
16921
16935
  const onCloseCallback = this.onClose;
16922
16936
  yield this.close(undefined, reason);
16923
16937
  this.log.info("websocket connection closed: ".concat(reason), {
@@ -16938,6 +16952,7 @@ class SignalClient {
16938
16952
  * Call this after receiving a pong message
16939
16953
  */
16940
16954
  resetPingTimeout() {
16955
+ this.voxevolvLastSignalAt = performance.now();
16941
16956
  this.clearPingTimeout();
16942
16957
  if (!this.pingTimeoutDuration) {
16943
16958
  this.log.warn('ping timeout duration not set');
@@ -21262,6 +21277,9 @@ class RTCEngine extends eventsExports.EventEmitter {
21262
21277
  if (this._isClosed) {
21263
21278
  return;
21264
21279
  }
21280
+ try { this.voxevolvObserveConnection?.({
21281
+ reason: "livekit_reconnect_requested", reconnect_reason: disconnectReason ?? 0
21282
+ }); } catch {}
21265
21283
  this.log.warn("".concat(connection, " disconnected"));
21266
21284
  if (this.reconnectAttempts === 0) {
21267
21285
  // only reset start time on the first try
@@ -30817,6 +30835,7 @@ class Room extends eventsExports.EventEmitter {
30817
30835
  }
30818
30836
  this.engine = new RTCEngine(this.options);
30819
30837
  this.engine.e2eeManager = this.e2eeManager;
30838
+ try { this.voxevolvObserveEngine?.(); } catch {}
30820
30839
  this.engine.on(EngineEvent.ParticipantUpdate, this.handleParticipantUpdates).on(EngineEvent.RoomUpdate, this.handleRoomUpdate).on(EngineEvent.SpeakersChanged, this.handleSpeakersChanged).on(EngineEvent.StreamStateChanged, this.handleStreamStateUpdate).on(EngineEvent.ConnectionQualityUpdate, this.handleConnectionQualityUpdate).on(EngineEvent.SubscriptionError, this.handleSubscriptionError).on(EngineEvent.SubscriptionPermissionUpdate, this.handleSubscriptionPermissionUpdate).on(EngineEvent.MediaTrackAdded, (mediaTrack, stream, receiver) => {
30821
30840
  this.onTrackAdded(mediaTrack, stream, receiver);
30822
30841
  }).on(EngineEvent.Disconnected, reason => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@voxevolv/client",
3
- "version": "0.3.16",
3
+ "version": "0.3.17",
4
4
  "description": "Browser SDK for VoxEvolv multimodal realtime sessions",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -42,14 +42,14 @@
42
42
  "scripts": {
43
43
  "build": "tsc -p tsconfig.json && node scripts/build-browser.mjs",
44
44
  "typecheck": "tsc -p tsconfig.json --noEmit",
45
- "test": "npm run build && node scripts/protocol-smoke.mjs && node --test scripts/context-delivery.test.mjs scripts/context-cancellation.test.mjs scripts/diagnostic-delivery.test.mjs scripts/presentations.test.mjs scripts/startup-recovery.test.mjs scripts/connection-lifecycle.test.mjs scripts/audio-recovery.test.mjs scripts/recovery-progress.test.mjs scripts/reliable-sequence.test.mjs && node scripts/transcript-smoke.mjs",
45
+ "test": "npm run build && node scripts/protocol-smoke.mjs && node --test scripts/context-delivery.test.mjs scripts/context-cancellation.test.mjs scripts/diagnostic-delivery.test.mjs scripts/connection-diagnostics.test.mjs scripts/presentations.test.mjs scripts/startup-recovery.test.mjs scripts/connection-lifecycle.test.mjs scripts/audio-recovery.test.mjs scripts/recovery-progress.test.mjs scripts/reliable-sequence.test.mjs && node scripts/transcript-smoke.mjs",
46
46
  "pack:check": "npm run build && npm pack --dry-run"
47
47
  },
48
48
  "dependencies": {
49
49
  "livekit-client": "2.20.0"
50
50
  },
51
51
  "devDependencies": {
52
- "esbuild": "0.27.0",
52
+ "esbuild": "0.28.2",
53
53
  "typescript": "7.0.2"
54
54
  }
55
55
  }