@autoscriber/core 0.1.2 → 0.1.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/dist/core/assistant-client.d.ts +2 -0
- package/dist/core/assistant-client.d.ts.map +1 -1
- package/dist/core/websocket-client.d.ts.map +1 -1
- package/dist/index.cjs +62 -31
- package/dist/index.js +62 -31
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/utils/i18n.d.ts.map +1 -1
- package/package.json +1 -1
|
@@ -16,6 +16,8 @@ export declare class AssistantClient {
|
|
|
16
16
|
private manualDisconnect;
|
|
17
17
|
private pendingRequests;
|
|
18
18
|
private reconnectTimer;
|
|
19
|
+
private reconnectAttempts;
|
|
20
|
+
private consecutiveFailures;
|
|
19
21
|
private lastTokenRefreshAttempt;
|
|
20
22
|
private tokenRefreshInFlight;
|
|
21
23
|
private hasConnected;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"assistant-client.d.ts","sourceRoot":"","sources":["../../src/core/assistant-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAEhB,cAAc,EAEd,iBAAiB,EAClB,MAAM,UAAU,CAAC;AAwBlB,qBAAa,eAAe;IAC1B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAmC;IAEvD,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAkB;IAEzC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAmB;IAE3C,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAsB;IAEnD,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAwC;IAErE,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAkB;IAE5C,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAsB;IAEnD,OAAO,CAAC,QAAQ,CAAC,eAAe,CAAyB;IAEzD,OAAO,CAAC,KAAK,CAAS;IAEtB,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AuElB,OAAO,CAAC,iBAAiB;IAiBzB,IAAI,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAO3B,KAAK,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI;IAM3C,IAAI,UAAU,IAAI,MAAM,CAEvB;CACF"}
|
package/dist/index.cjs
CHANGED
|
@@ -111,7 +111,9 @@ var TRANSLATIONS = {
|
|
|
111
111
|
transcriptionBufferingOffline: "Transcription buffering - will resume when connection returns",
|
|
112
112
|
voiceCommandCancelledOffline: "Voice command cancelled - Network offline",
|
|
113
113
|
connectionRestored: "Connection restored",
|
|
114
|
-
offlineBuffering: "Message buffered - will resend once connected"
|
|
114
|
+
offlineBuffering: "Message buffered - will resend once connected",
|
|
115
|
+
connectionLost: "\u26A0\uFE0F Connection lost - reconnecting...",
|
|
116
|
+
serviceUnavailable: "\u26A0\uFE0F Service unavailable - reconnecting..."
|
|
115
117
|
},
|
|
116
118
|
nl: {
|
|
117
119
|
askAnything: "Stel je vraag...",
|
|
@@ -141,7 +143,9 @@ var TRANSLATIONS = {
|
|
|
141
143
|
transcriptionBufferingOffline: "Transcriptie wordt gebufferd - gaat verder zodra we weer online zijn",
|
|
142
144
|
voiceCommandCancelledOffline: "Spraakopdracht geannuleerd - Netwerk offline",
|
|
143
145
|
connectionRestored: "Verbinding hersteld",
|
|
144
|
-
offlineBuffering: "Bericht gebufferd - wordt verzonden zodra we weer online zijn"
|
|
146
|
+
offlineBuffering: "Bericht gebufferd - wordt verzonden zodra we weer online zijn",
|
|
147
|
+
connectionLost: "\u26A0\uFE0F Verbinding verbroken - opnieuw verbinden...",
|
|
148
|
+
serviceUnavailable: "\u26A0\uFE0F Service niet beschikbaar - opnieuw verbinden..."
|
|
145
149
|
},
|
|
146
150
|
de: {
|
|
147
151
|
askAnything: "Stellen Sie eine Frage...",
|
|
@@ -171,7 +175,9 @@ var TRANSLATIONS = {
|
|
|
171
175
|
transcriptionBufferingOffline: "Transkription wird gepuffert \u2013 l\xE4uft weiter, sobald die Verbindung zur\xFCck ist",
|
|
172
176
|
voiceCommandCancelledOffline: "Sprachbefehl abgebrochen \u2013 Netzwerk offline",
|
|
173
177
|
connectionRestored: "Verbindung wiederhergestellt",
|
|
174
|
-
offlineBuffering: "Nachricht gepuffert \u2013 wird gesendet, sobald wir wieder online sind"
|
|
178
|
+
offlineBuffering: "Nachricht gepuffert \u2013 wird gesendet, sobald wir wieder online sind",
|
|
179
|
+
connectionLost: "\u26A0\uFE0F Verbindung verloren \u2013 erneut verbinden...",
|
|
180
|
+
serviceUnavailable: "\u26A0\uFE0F Service nicht verf\xFCgbar \u2013 erneut verbinden..."
|
|
175
181
|
}
|
|
176
182
|
};
|
|
177
183
|
var DEFAULT_LANGUAGE = "en";
|
|
@@ -395,12 +401,14 @@ var WebSocketClient = class {
|
|
|
395
401
|
}
|
|
396
402
|
this.logger.error("[Autoscriber] websocket error", errorInfo);
|
|
397
403
|
this.bus.emit("error", event);
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
+
if (socket.readyState === WebSocket.CLOSED || socket.readyState === WebSocket.CLOSING) {
|
|
405
|
+
const errorMessage = event instanceof ErrorEvent && event.message ? event.message : `WebSocket error (readyState: ${socket.readyState}, url: ${socket.url})`;
|
|
406
|
+
const enhancedError = new Error(errorMessage);
|
|
407
|
+
enhancedError.originalEvent = event;
|
|
408
|
+
enhancedError.readyState = socket.readyState;
|
|
409
|
+
enhancedError.url = socket.url;
|
|
410
|
+
reject(enhancedError);
|
|
411
|
+
}
|
|
404
412
|
};
|
|
405
413
|
socket.onmessage = (event) => {
|
|
406
414
|
this.bus.emit("message", event);
|
|
@@ -933,6 +941,8 @@ var AssistantClient = class {
|
|
|
933
941
|
this.manualDisconnect = false;
|
|
934
942
|
this.pendingRequests = /* @__PURE__ */ new Map();
|
|
935
943
|
this.reconnectTimer = null;
|
|
944
|
+
this.reconnectAttempts = 0;
|
|
945
|
+
this.consecutiveFailures = 0;
|
|
936
946
|
this.lastTokenRefreshAttempt = null;
|
|
937
947
|
this.tokenRefreshInFlight = false;
|
|
938
948
|
this.hasConnected = false;
|
|
@@ -1386,24 +1396,17 @@ var AssistantClient = class {
|
|
|
1386
1396
|
/** Internal plumbing */
|
|
1387
1397
|
registerWebsocketEvents() {
|
|
1388
1398
|
this.websocket.on("open", () => {
|
|
1389
|
-
const wasOffline = this.hasConnected && (this.snapshot.connection.reason === "offline" || this.snapshot.connection.reason === "reconnecting");
|
|
1390
1399
|
if (this.reconnectTimer) {
|
|
1391
1400
|
clearTimeout(this.reconnectTimer);
|
|
1392
1401
|
this.reconnectTimer = null;
|
|
1393
1402
|
}
|
|
1403
|
+
this.reconnectAttempts = 0;
|
|
1404
|
+
this.consecutiveFailures = 0;
|
|
1394
1405
|
this.snapshot.connection.websocketStatus = "open";
|
|
1395
1406
|
this.snapshot.connection.reason = void 0;
|
|
1396
1407
|
this.snapshot.connection.lastError = void 0;
|
|
1397
1408
|
this.snapshot.connection.buffering = this.offlineQueue.size > 0;
|
|
1398
1409
|
this.emitConnection();
|
|
1399
|
-
if (wasOffline) {
|
|
1400
|
-
this.pushInteraction({
|
|
1401
|
-
id: generateMessageId(),
|
|
1402
|
-
label: translate(this.snapshot.language, "connectionRestored"),
|
|
1403
|
-
status: "success",
|
|
1404
|
-
type: "info"
|
|
1405
|
-
});
|
|
1406
|
-
}
|
|
1407
1410
|
this.flushOfflineQueue();
|
|
1408
1411
|
this.hasConnected = true;
|
|
1409
1412
|
});
|
|
@@ -1413,8 +1416,11 @@ var AssistantClient = class {
|
|
|
1413
1416
|
if (!preserveOffline) {
|
|
1414
1417
|
this.snapshot.connection.reason = this.manualDisconnect ? "manual" : "closed";
|
|
1415
1418
|
}
|
|
1419
|
+
if (this.offlineQueue.size > 0) {
|
|
1420
|
+
this.snapshot.connection.buffering = true;
|
|
1421
|
+
}
|
|
1416
1422
|
this.emitConnection();
|
|
1417
|
-
this.scheduleReconnectAttempt();
|
|
1423
|
+
this.scheduleReconnectAttempt(true);
|
|
1418
1424
|
});
|
|
1419
1425
|
this.websocket.on("error", (event) => {
|
|
1420
1426
|
this.snapshot.connection.websocketStatus = "closed";
|
|
@@ -1448,6 +1454,9 @@ var AssistantClient = class {
|
|
|
1448
1454
|
};
|
|
1449
1455
|
}
|
|
1450
1456
|
this.snapshot.connection.lastError = errorMessage;
|
|
1457
|
+
if (this.offlineQueue.size > 0) {
|
|
1458
|
+
this.snapshot.connection.buffering = true;
|
|
1459
|
+
}
|
|
1451
1460
|
this.emitConnection();
|
|
1452
1461
|
const sessionId = getSessionIdFromToken(this.token);
|
|
1453
1462
|
const wsUrl = this.buildWebsocketUrl();
|
|
@@ -1456,9 +1465,10 @@ var AssistantClient = class {
|
|
|
1456
1465
|
...errorDetails,
|
|
1457
1466
|
websocketUrl: wsUrl,
|
|
1458
1467
|
sessionId: sessionId ?? "unknown",
|
|
1459
|
-
readyState: this.websocket.readyState
|
|
1468
|
+
readyState: this.websocket.readyState,
|
|
1469
|
+
consecutiveFailures: this.consecutiveFailures
|
|
1460
1470
|
});
|
|
1461
|
-
this.scheduleReconnectAttempt();
|
|
1471
|
+
this.scheduleReconnectAttempt(true);
|
|
1462
1472
|
});
|
|
1463
1473
|
this.websocket.on("reconnecting", () => {
|
|
1464
1474
|
if (this.snapshot.connection.reason === "offline")
|
|
@@ -1480,23 +1490,35 @@ var AssistantClient = class {
|
|
|
1480
1490
|
this.handleBrowserOffline();
|
|
1481
1491
|
}
|
|
1482
1492
|
}
|
|
1483
|
-
scheduleReconnectAttempt() {
|
|
1493
|
+
scheduleReconnectAttempt(clearExisting = false) {
|
|
1484
1494
|
if (this.manualDisconnect) {
|
|
1485
1495
|
return;
|
|
1486
1496
|
}
|
|
1487
1497
|
if (!this.snapshot.connection.online) {
|
|
1488
1498
|
return;
|
|
1489
1499
|
}
|
|
1490
|
-
if (this.reconnectTimer) {
|
|
1500
|
+
if (clearExisting && this.reconnectTimer) {
|
|
1501
|
+
clearTimeout(this.reconnectTimer);
|
|
1502
|
+
this.reconnectTimer = null;
|
|
1503
|
+
}
|
|
1504
|
+
if (this.reconnectTimer && !clearExisting) {
|
|
1491
1505
|
return;
|
|
1492
1506
|
}
|
|
1493
|
-
const
|
|
1507
|
+
const baseDelay = this.options.websocketReconnectDelay ?? 3e3;
|
|
1508
|
+
const maxDelay = this.options.websocketMaxReconnectDelay ?? 3e4;
|
|
1509
|
+
const backoffMultiplier = this.options.websocketReconnectBackoffMultiplier ?? 1.5;
|
|
1510
|
+
const exponentialDelay = Math.min(baseDelay * Math.pow(backoffMultiplier, this.reconnectAttempts), maxDelay);
|
|
1511
|
+
const delay = Math.round(exponentialDelay);
|
|
1512
|
+
this.reconnectAttempts += 1;
|
|
1494
1513
|
if (this.hasConnected && this.snapshot.connection.reason !== "offline") {
|
|
1495
1514
|
this.snapshot.connection.reason = "reconnecting";
|
|
1496
1515
|
}
|
|
1497
1516
|
if (this.snapshot.connection.websocketStatus !== "open") {
|
|
1498
1517
|
this.snapshot.connection.websocketStatus = "connecting";
|
|
1499
1518
|
}
|
|
1519
|
+
if (this.offlineQueue.size > 0) {
|
|
1520
|
+
this.snapshot.connection.buffering = true;
|
|
1521
|
+
}
|
|
1500
1522
|
this.emitConnection();
|
|
1501
1523
|
this.reconnectTimer = setTimeout(() => {
|
|
1502
1524
|
this.reconnectTimer = null;
|
|
@@ -1522,13 +1544,15 @@ var AssistantClient = class {
|
|
|
1522
1544
|
}
|
|
1523
1545
|
async connectWebsocket() {
|
|
1524
1546
|
try {
|
|
1547
|
+
const failureThreshold = this.options.websocketReconnectFailureThreshold ?? 3;
|
|
1548
|
+
const shouldCheckTokenAfterFailures = this.consecutiveFailures >= failureThreshold;
|
|
1525
1549
|
if (this.options.refreshToken && !this.tokenRefreshInFlight) {
|
|
1526
1550
|
const isExpired = isTokenExpiredOrExpiring(this.token, 0);
|
|
1527
1551
|
const isExpiringSoon = isTokenExpiredOrExpiring(this.token);
|
|
1528
|
-
if (isExpired || isExpiringSoon) {
|
|
1552
|
+
if (isExpired || isExpiringSoon || shouldCheckTokenAfterFailures) {
|
|
1529
1553
|
const now = Date.now();
|
|
1530
1554
|
const throttleElapsed = !this.lastTokenRefreshAttempt || now - this.lastTokenRefreshAttempt >= TOKEN_REFRESH_THROTTLE_MS;
|
|
1531
|
-
if (isExpired || throttleElapsed) {
|
|
1555
|
+
if (isExpired || throttleElapsed || shouldCheckTokenAfterFailures) {
|
|
1532
1556
|
this.lastTokenRefreshAttempt = now;
|
|
1533
1557
|
const sessionId = getSessionIdFromToken(this.token);
|
|
1534
1558
|
if (sessionId) {
|
|
@@ -1538,9 +1562,12 @@ var AssistantClient = class {
|
|
|
1538
1562
|
if (newToken) {
|
|
1539
1563
|
this.token = newToken;
|
|
1540
1564
|
this.lastTokenRefreshAttempt = null;
|
|
1565
|
+
this.consecutiveFailures = 0;
|
|
1541
1566
|
this.logStructured("info", "Token refresh succeeded", {
|
|
1542
1567
|
sessionId,
|
|
1543
|
-
wasExpired: isExpired
|
|
1568
|
+
wasExpired: isExpired,
|
|
1569
|
+
triggeredByFailures: shouldCheckTokenAfterFailures,
|
|
1570
|
+
consecutiveFailures: this.consecutiveFailures
|
|
1544
1571
|
});
|
|
1545
1572
|
} else if (isExpired) {
|
|
1546
1573
|
this.logger.warn("[Autoscriber] refresh returned no token while current token expired");
|
|
@@ -1555,6 +1582,7 @@ var AssistantClient = class {
|
|
|
1555
1582
|
this.logStructured("error", "Token refresh failed", {
|
|
1556
1583
|
sessionId,
|
|
1557
1584
|
wasExpired: isExpired,
|
|
1585
|
+
triggeredByFailures: shouldCheckTokenAfterFailures,
|
|
1558
1586
|
error: refreshError instanceof Error ? refreshError.message : String(refreshError)
|
|
1559
1587
|
});
|
|
1560
1588
|
if (isExpired) {
|
|
@@ -1577,6 +1605,7 @@ var AssistantClient = class {
|
|
|
1577
1605
|
}
|
|
1578
1606
|
this.emitConnection();
|
|
1579
1607
|
await this.websocket.connect(wsUrl);
|
|
1608
|
+
this.consecutiveFailures = 0;
|
|
1580
1609
|
} catch (error) {
|
|
1581
1610
|
this.logger.error("[Autoscriber] failed to connect websocket", error);
|
|
1582
1611
|
let errorMessage;
|
|
@@ -1623,9 +1652,12 @@ var AssistantClient = class {
|
|
|
1623
1652
|
error: errorMessage,
|
|
1624
1653
|
...errorDetails,
|
|
1625
1654
|
websocketUrl: wsUrl,
|
|
1626
|
-
sessionId: sessionId ?? "unknown"
|
|
1655
|
+
sessionId: sessionId ?? "unknown",
|
|
1656
|
+
consecutiveFailures: this.consecutiveFailures + 1,
|
|
1657
|
+
reconnectAttempts: this.reconnectAttempts
|
|
1627
1658
|
});
|
|
1628
|
-
this.
|
|
1659
|
+
this.consecutiveFailures += 1;
|
|
1660
|
+
this.scheduleReconnectAttempt(true);
|
|
1629
1661
|
}
|
|
1630
1662
|
}
|
|
1631
1663
|
buildWebsocketUrl() {
|
|
@@ -1892,8 +1924,7 @@ var AssistantClient = class {
|
|
|
1892
1924
|
}
|
|
1893
1925
|
handleResultResponse(payload) {
|
|
1894
1926
|
this.logStructured("info", "Result response received", {
|
|
1895
|
-
messageId: payload.id
|
|
1896
|
-
result: payload.result
|
|
1927
|
+
messageId: payload.id
|
|
1897
1928
|
});
|
|
1898
1929
|
const id = payload.id;
|
|
1899
1930
|
const result = payload.result;
|
package/dist/index.js
CHANGED
|
@@ -84,7 +84,9 @@ var TRANSLATIONS = {
|
|
|
84
84
|
transcriptionBufferingOffline: "Transcription buffering - will resume when connection returns",
|
|
85
85
|
voiceCommandCancelledOffline: "Voice command cancelled - Network offline",
|
|
86
86
|
connectionRestored: "Connection restored",
|
|
87
|
-
offlineBuffering: "Message buffered - will resend once connected"
|
|
87
|
+
offlineBuffering: "Message buffered - will resend once connected",
|
|
88
|
+
connectionLost: "\u26A0\uFE0F Connection lost - reconnecting...",
|
|
89
|
+
serviceUnavailable: "\u26A0\uFE0F Service unavailable - reconnecting..."
|
|
88
90
|
},
|
|
89
91
|
nl: {
|
|
90
92
|
askAnything: "Stel je vraag...",
|
|
@@ -114,7 +116,9 @@ var TRANSLATIONS = {
|
|
|
114
116
|
transcriptionBufferingOffline: "Transcriptie wordt gebufferd - gaat verder zodra we weer online zijn",
|
|
115
117
|
voiceCommandCancelledOffline: "Spraakopdracht geannuleerd - Netwerk offline",
|
|
116
118
|
connectionRestored: "Verbinding hersteld",
|
|
117
|
-
offlineBuffering: "Bericht gebufferd - wordt verzonden zodra we weer online zijn"
|
|
119
|
+
offlineBuffering: "Bericht gebufferd - wordt verzonden zodra we weer online zijn",
|
|
120
|
+
connectionLost: "\u26A0\uFE0F Verbinding verbroken - opnieuw verbinden...",
|
|
121
|
+
serviceUnavailable: "\u26A0\uFE0F Service niet beschikbaar - opnieuw verbinden..."
|
|
118
122
|
},
|
|
119
123
|
de: {
|
|
120
124
|
askAnything: "Stellen Sie eine Frage...",
|
|
@@ -144,7 +148,9 @@ var TRANSLATIONS = {
|
|
|
144
148
|
transcriptionBufferingOffline: "Transkription wird gepuffert \u2013 l\xE4uft weiter, sobald die Verbindung zur\xFCck ist",
|
|
145
149
|
voiceCommandCancelledOffline: "Sprachbefehl abgebrochen \u2013 Netzwerk offline",
|
|
146
150
|
connectionRestored: "Verbindung wiederhergestellt",
|
|
147
|
-
offlineBuffering: "Nachricht gepuffert \u2013 wird gesendet, sobald wir wieder online sind"
|
|
151
|
+
offlineBuffering: "Nachricht gepuffert \u2013 wird gesendet, sobald wir wieder online sind",
|
|
152
|
+
connectionLost: "\u26A0\uFE0F Verbindung verloren \u2013 erneut verbinden...",
|
|
153
|
+
serviceUnavailable: "\u26A0\uFE0F Service nicht verf\xFCgbar \u2013 erneut verbinden..."
|
|
148
154
|
}
|
|
149
155
|
};
|
|
150
156
|
var DEFAULT_LANGUAGE = "en";
|
|
@@ -368,12 +374,14 @@ var WebSocketClient = class {
|
|
|
368
374
|
}
|
|
369
375
|
this.logger.error("[Autoscriber] websocket error", errorInfo);
|
|
370
376
|
this.bus.emit("error", event);
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
+
if (socket.readyState === WebSocket.CLOSED || socket.readyState === WebSocket.CLOSING) {
|
|
378
|
+
const errorMessage = event instanceof ErrorEvent && event.message ? event.message : `WebSocket error (readyState: ${socket.readyState}, url: ${socket.url})`;
|
|
379
|
+
const enhancedError = new Error(errorMessage);
|
|
380
|
+
enhancedError.originalEvent = event;
|
|
381
|
+
enhancedError.readyState = socket.readyState;
|
|
382
|
+
enhancedError.url = socket.url;
|
|
383
|
+
reject(enhancedError);
|
|
384
|
+
}
|
|
377
385
|
};
|
|
378
386
|
socket.onmessage = (event) => {
|
|
379
387
|
this.bus.emit("message", event);
|
|
@@ -906,6 +914,8 @@ var AssistantClient = class {
|
|
|
906
914
|
this.manualDisconnect = false;
|
|
907
915
|
this.pendingRequests = /* @__PURE__ */ new Map();
|
|
908
916
|
this.reconnectTimer = null;
|
|
917
|
+
this.reconnectAttempts = 0;
|
|
918
|
+
this.consecutiveFailures = 0;
|
|
909
919
|
this.lastTokenRefreshAttempt = null;
|
|
910
920
|
this.tokenRefreshInFlight = false;
|
|
911
921
|
this.hasConnected = false;
|
|
@@ -1359,24 +1369,17 @@ var AssistantClient = class {
|
|
|
1359
1369
|
/** Internal plumbing */
|
|
1360
1370
|
registerWebsocketEvents() {
|
|
1361
1371
|
this.websocket.on("open", () => {
|
|
1362
|
-
const wasOffline = this.hasConnected && (this.snapshot.connection.reason === "offline" || this.snapshot.connection.reason === "reconnecting");
|
|
1363
1372
|
if (this.reconnectTimer) {
|
|
1364
1373
|
clearTimeout(this.reconnectTimer);
|
|
1365
1374
|
this.reconnectTimer = null;
|
|
1366
1375
|
}
|
|
1376
|
+
this.reconnectAttempts = 0;
|
|
1377
|
+
this.consecutiveFailures = 0;
|
|
1367
1378
|
this.snapshot.connection.websocketStatus = "open";
|
|
1368
1379
|
this.snapshot.connection.reason = void 0;
|
|
1369
1380
|
this.snapshot.connection.lastError = void 0;
|
|
1370
1381
|
this.snapshot.connection.buffering = this.offlineQueue.size > 0;
|
|
1371
1382
|
this.emitConnection();
|
|
1372
|
-
if (wasOffline) {
|
|
1373
|
-
this.pushInteraction({
|
|
1374
|
-
id: generateMessageId(),
|
|
1375
|
-
label: translate(this.snapshot.language, "connectionRestored"),
|
|
1376
|
-
status: "success",
|
|
1377
|
-
type: "info"
|
|
1378
|
-
});
|
|
1379
|
-
}
|
|
1380
1383
|
this.flushOfflineQueue();
|
|
1381
1384
|
this.hasConnected = true;
|
|
1382
1385
|
});
|
|
@@ -1386,8 +1389,11 @@ var AssistantClient = class {
|
|
|
1386
1389
|
if (!preserveOffline) {
|
|
1387
1390
|
this.snapshot.connection.reason = this.manualDisconnect ? "manual" : "closed";
|
|
1388
1391
|
}
|
|
1392
|
+
if (this.offlineQueue.size > 0) {
|
|
1393
|
+
this.snapshot.connection.buffering = true;
|
|
1394
|
+
}
|
|
1389
1395
|
this.emitConnection();
|
|
1390
|
-
this.scheduleReconnectAttempt();
|
|
1396
|
+
this.scheduleReconnectAttempt(true);
|
|
1391
1397
|
});
|
|
1392
1398
|
this.websocket.on("error", (event) => {
|
|
1393
1399
|
this.snapshot.connection.websocketStatus = "closed";
|
|
@@ -1421,6 +1427,9 @@ var AssistantClient = class {
|
|
|
1421
1427
|
};
|
|
1422
1428
|
}
|
|
1423
1429
|
this.snapshot.connection.lastError = errorMessage;
|
|
1430
|
+
if (this.offlineQueue.size > 0) {
|
|
1431
|
+
this.snapshot.connection.buffering = true;
|
|
1432
|
+
}
|
|
1424
1433
|
this.emitConnection();
|
|
1425
1434
|
const sessionId = getSessionIdFromToken(this.token);
|
|
1426
1435
|
const wsUrl = this.buildWebsocketUrl();
|
|
@@ -1429,9 +1438,10 @@ var AssistantClient = class {
|
|
|
1429
1438
|
...errorDetails,
|
|
1430
1439
|
websocketUrl: wsUrl,
|
|
1431
1440
|
sessionId: sessionId ?? "unknown",
|
|
1432
|
-
readyState: this.websocket.readyState
|
|
1441
|
+
readyState: this.websocket.readyState,
|
|
1442
|
+
consecutiveFailures: this.consecutiveFailures
|
|
1433
1443
|
});
|
|
1434
|
-
this.scheduleReconnectAttempt();
|
|
1444
|
+
this.scheduleReconnectAttempt(true);
|
|
1435
1445
|
});
|
|
1436
1446
|
this.websocket.on("reconnecting", () => {
|
|
1437
1447
|
if (this.snapshot.connection.reason === "offline")
|
|
@@ -1453,23 +1463,35 @@ var AssistantClient = class {
|
|
|
1453
1463
|
this.handleBrowserOffline();
|
|
1454
1464
|
}
|
|
1455
1465
|
}
|
|
1456
|
-
scheduleReconnectAttempt() {
|
|
1466
|
+
scheduleReconnectAttempt(clearExisting = false) {
|
|
1457
1467
|
if (this.manualDisconnect) {
|
|
1458
1468
|
return;
|
|
1459
1469
|
}
|
|
1460
1470
|
if (!this.snapshot.connection.online) {
|
|
1461
1471
|
return;
|
|
1462
1472
|
}
|
|
1463
|
-
if (this.reconnectTimer) {
|
|
1473
|
+
if (clearExisting && this.reconnectTimer) {
|
|
1474
|
+
clearTimeout(this.reconnectTimer);
|
|
1475
|
+
this.reconnectTimer = null;
|
|
1476
|
+
}
|
|
1477
|
+
if (this.reconnectTimer && !clearExisting) {
|
|
1464
1478
|
return;
|
|
1465
1479
|
}
|
|
1466
|
-
const
|
|
1480
|
+
const baseDelay = this.options.websocketReconnectDelay ?? 3e3;
|
|
1481
|
+
const maxDelay = this.options.websocketMaxReconnectDelay ?? 3e4;
|
|
1482
|
+
const backoffMultiplier = this.options.websocketReconnectBackoffMultiplier ?? 1.5;
|
|
1483
|
+
const exponentialDelay = Math.min(baseDelay * Math.pow(backoffMultiplier, this.reconnectAttempts), maxDelay);
|
|
1484
|
+
const delay = Math.round(exponentialDelay);
|
|
1485
|
+
this.reconnectAttempts += 1;
|
|
1467
1486
|
if (this.hasConnected && this.snapshot.connection.reason !== "offline") {
|
|
1468
1487
|
this.snapshot.connection.reason = "reconnecting";
|
|
1469
1488
|
}
|
|
1470
1489
|
if (this.snapshot.connection.websocketStatus !== "open") {
|
|
1471
1490
|
this.snapshot.connection.websocketStatus = "connecting";
|
|
1472
1491
|
}
|
|
1492
|
+
if (this.offlineQueue.size > 0) {
|
|
1493
|
+
this.snapshot.connection.buffering = true;
|
|
1494
|
+
}
|
|
1473
1495
|
this.emitConnection();
|
|
1474
1496
|
this.reconnectTimer = setTimeout(() => {
|
|
1475
1497
|
this.reconnectTimer = null;
|
|
@@ -1495,13 +1517,15 @@ var AssistantClient = class {
|
|
|
1495
1517
|
}
|
|
1496
1518
|
async connectWebsocket() {
|
|
1497
1519
|
try {
|
|
1520
|
+
const failureThreshold = this.options.websocketReconnectFailureThreshold ?? 3;
|
|
1521
|
+
const shouldCheckTokenAfterFailures = this.consecutiveFailures >= failureThreshold;
|
|
1498
1522
|
if (this.options.refreshToken && !this.tokenRefreshInFlight) {
|
|
1499
1523
|
const isExpired = isTokenExpiredOrExpiring(this.token, 0);
|
|
1500
1524
|
const isExpiringSoon = isTokenExpiredOrExpiring(this.token);
|
|
1501
|
-
if (isExpired || isExpiringSoon) {
|
|
1525
|
+
if (isExpired || isExpiringSoon || shouldCheckTokenAfterFailures) {
|
|
1502
1526
|
const now = Date.now();
|
|
1503
1527
|
const throttleElapsed = !this.lastTokenRefreshAttempt || now - this.lastTokenRefreshAttempt >= TOKEN_REFRESH_THROTTLE_MS;
|
|
1504
|
-
if (isExpired || throttleElapsed) {
|
|
1528
|
+
if (isExpired || throttleElapsed || shouldCheckTokenAfterFailures) {
|
|
1505
1529
|
this.lastTokenRefreshAttempt = now;
|
|
1506
1530
|
const sessionId = getSessionIdFromToken(this.token);
|
|
1507
1531
|
if (sessionId) {
|
|
@@ -1511,9 +1535,12 @@ var AssistantClient = class {
|
|
|
1511
1535
|
if (newToken) {
|
|
1512
1536
|
this.token = newToken;
|
|
1513
1537
|
this.lastTokenRefreshAttempt = null;
|
|
1538
|
+
this.consecutiveFailures = 0;
|
|
1514
1539
|
this.logStructured("info", "Token refresh succeeded", {
|
|
1515
1540
|
sessionId,
|
|
1516
|
-
wasExpired: isExpired
|
|
1541
|
+
wasExpired: isExpired,
|
|
1542
|
+
triggeredByFailures: shouldCheckTokenAfterFailures,
|
|
1543
|
+
consecutiveFailures: this.consecutiveFailures
|
|
1517
1544
|
});
|
|
1518
1545
|
} else if (isExpired) {
|
|
1519
1546
|
this.logger.warn("[Autoscriber] refresh returned no token while current token expired");
|
|
@@ -1528,6 +1555,7 @@ var AssistantClient = class {
|
|
|
1528
1555
|
this.logStructured("error", "Token refresh failed", {
|
|
1529
1556
|
sessionId,
|
|
1530
1557
|
wasExpired: isExpired,
|
|
1558
|
+
triggeredByFailures: shouldCheckTokenAfterFailures,
|
|
1531
1559
|
error: refreshError instanceof Error ? refreshError.message : String(refreshError)
|
|
1532
1560
|
});
|
|
1533
1561
|
if (isExpired) {
|
|
@@ -1550,6 +1578,7 @@ var AssistantClient = class {
|
|
|
1550
1578
|
}
|
|
1551
1579
|
this.emitConnection();
|
|
1552
1580
|
await this.websocket.connect(wsUrl);
|
|
1581
|
+
this.consecutiveFailures = 0;
|
|
1553
1582
|
} catch (error) {
|
|
1554
1583
|
this.logger.error("[Autoscriber] failed to connect websocket", error);
|
|
1555
1584
|
let errorMessage;
|
|
@@ -1596,9 +1625,12 @@ var AssistantClient = class {
|
|
|
1596
1625
|
error: errorMessage,
|
|
1597
1626
|
...errorDetails,
|
|
1598
1627
|
websocketUrl: wsUrl,
|
|
1599
|
-
sessionId: sessionId ?? "unknown"
|
|
1628
|
+
sessionId: sessionId ?? "unknown",
|
|
1629
|
+
consecutiveFailures: this.consecutiveFailures + 1,
|
|
1630
|
+
reconnectAttempts: this.reconnectAttempts
|
|
1600
1631
|
});
|
|
1601
|
-
this.
|
|
1632
|
+
this.consecutiveFailures += 1;
|
|
1633
|
+
this.scheduleReconnectAttempt(true);
|
|
1602
1634
|
}
|
|
1603
1635
|
}
|
|
1604
1636
|
buildWebsocketUrl() {
|
|
@@ -1865,8 +1897,7 @@ var AssistantClient = class {
|
|
|
1865
1897
|
}
|
|
1866
1898
|
handleResultResponse(payload) {
|
|
1867
1899
|
this.logStructured("info", "Result response received", {
|
|
1868
|
-
messageId: payload.id
|
|
1869
|
-
result: payload.result
|
|
1900
|
+
messageId: payload.id
|
|
1870
1901
|
});
|
|
1871
1902
|
const id = payload.id;
|
|
1872
1903
|
const result = payload.result;
|
package/dist/types/index.d.ts
CHANGED
|
@@ -69,6 +69,10 @@ export interface AssistantOptions {
|
|
|
69
69
|
logger?: Partial<Console>;
|
|
70
70
|
websocketUrl?: string;
|
|
71
71
|
websocketReconnectDelay?: number;
|
|
72
|
+
websocketMaxReconnectDelay?: number;
|
|
73
|
+
websocketReconnectBackoffMultiplier?: number;
|
|
74
|
+
websocketReconnectFailureThreshold?: number;
|
|
75
|
+
websocketConnectionTimeout?: number;
|
|
72
76
|
targetSampleRate?: number;
|
|
73
77
|
onLog?: (level: "info" | "warn" | "error", message: string, metadata?: Record<string, unknown>) => void;
|
|
74
78
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/types/index.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,iBAAiB,GAAG,IAAI,GAAG,IAAI,GAAG,IAAI,CAAC;AAEnD,MAAM,MAAM,aAAa,GAAG,MAAM,GAAG,eAAe,GAAG,eAAe,CAAC;AAEvE,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,OAAO,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,cAAc,EAAE,MAAM,EAAE,CAAC;IACzB,MAAM,EAAE,aAAa,GAAG,IAAI,CAAC;IAC7B,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACnC,IAAI,EAAE,MAAM,GAAG,eAAe,GAAG,OAAO,GAAG,MAAM,GAAG,eAAe,CAA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EAAE,QAAQ,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,KAAK,IAAI,CAAC;CACzG;AAED,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,IAAI,EAAE,OAAO,CAAC;IACd,OAAO,CAAC,EAAE,OAAO,CAAC;CACnB;AAED,MAAM,WAAW,kBAAkB;IACjC,eAAe,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,aAAa,CAAC,MAAM;IACnC,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,CAAC;CACvB;AAED,MAAM,WAAW,eAAe;IAC9B,QAAQ,EAAE,iBAAiB,CAAC;IAC5B,kBAAkB,EAAE,gBAAgB,EAAE,CAAC;IACvC,sBAAsB,EAAE,eAAe,EAAE,CAAC;IAC1C,oBAAoB,EAAE,eAAe,CAAC;IACtC,mBAAmB,EAAE,cAAc,CAAC;IACpC,qBAAqB,EAAE,eAAe,CAAC;IACvC,qBAAqB,EAAE,kBAAkB,CAAC;IAC1C,WAAW,EAAE,OAAO,CAAC;IACrB,kBAAkB,EAAE,iBAAiB,CAAC;IACtC,KAAK,EAAE;QAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,CAAC;IACnD,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAAC;CAC1B"}
|
package/dist/utils/i18n.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../src/utils/i18n.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../src/utils/i18n.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAoHlD,wBAAgB,SAAS,CACvB,QAAQ,EAAE,iBAAiB,EAC3B,GAAG,EAAE,MAAM,EACX,MAAM,GAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,CAAM,GAC3C,MAAM,CASR;AAED,wBAAgB,gBAAgB,CAAC,IAAI,CAAC,EAAE,MAAM,GAAG,iBAAiB,CASjE;AAED,wBAAgB,eAAe,CAAC,QAAQ,EAAE,iBAAiB,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAEnF"}
|