openmates 0.14.8-alpha.10 → 0.14.8-alpha.11
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/{chunk-WEU7CSZD.js → chunk-6URDLYLM.js} +16 -1
- package/dist/cli.js +1 -1
- package/dist/index.js +1 -1
- package/package.json +1 -1
|
@@ -1239,6 +1239,17 @@ function errorFrameBelongsToAiResponse(envelope, userMessageId, chatId, recovery
|
|
|
1239
1239
|
}
|
|
1240
1240
|
return !scoped || Boolean(errorChatId || errorMessageId || errorTurnId);
|
|
1241
1241
|
}
|
|
1242
|
+
function scopedErrorMissesPredicate(envelope, predicate) {
|
|
1243
|
+
if (envelope.type !== "error" || !predicate) return false;
|
|
1244
|
+
const payload = envelope.payload && typeof envelope.payload === "object" ? envelope.payload : {};
|
|
1245
|
+
const hasScope = typeof payload.turn_id === "string" || typeof payload.chat_id === "string" || typeof payload.message_id === "string" || typeof payload.user_message_id === "string" || typeof payload.userMessageId === "string" || typeof payload.job_id === "string";
|
|
1246
|
+
if (!hasScope) return false;
|
|
1247
|
+
try {
|
|
1248
|
+
return !predicate(payload);
|
|
1249
|
+
} catch {
|
|
1250
|
+
return false;
|
|
1251
|
+
}
|
|
1252
|
+
}
|
|
1242
1253
|
function parseTaskProposals(value) {
|
|
1243
1254
|
if (!Array.isArray(value)) return [];
|
|
1244
1255
|
return value.flatMap((item) => {
|
|
@@ -1418,6 +1429,7 @@ var OpenMatesWsClient = class {
|
|
|
1418
1429
|
if (typeof parsed.type === "string") seenTypes.add(parsed.type);
|
|
1419
1430
|
const protocolError = websocketProtocolError(parsed);
|
|
1420
1431
|
if (protocolError) {
|
|
1432
|
+
if (scopedErrorMissesPredicate(parsed, predicate)) return;
|
|
1421
1433
|
cleanup();
|
|
1422
1434
|
reject(protocolError);
|
|
1423
1435
|
return;
|
|
@@ -5109,7 +5121,10 @@ var OpenMatesClient = class _OpenMatesClient {
|
|
|
5109
5121
|
updated_at: createdAt
|
|
5110
5122
|
};
|
|
5111
5123
|
}
|
|
5112
|
-
const preflightAck = ws.waitForMessage(
|
|
5124
|
+
const preflightAck = ws.waitForMessage(
|
|
5125
|
+
"chat_turn_preflight_ack",
|
|
5126
|
+
(payload) => payload.turn_id === turnId
|
|
5127
|
+
);
|
|
5113
5128
|
let ackPayload;
|
|
5114
5129
|
try {
|
|
5115
5130
|
await ws.sendAsync("chat_turn_preflight", preflightPayload);
|
package/dist/cli.js
CHANGED
package/dist/index.js
CHANGED