spacecode 2.6.1 → 2.6.2
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.js +2 -2
- package/dist/index.js.map +1 -1
- package/dist/repl.mjs +10 -2
- package/package.json +1 -1
package/dist/repl.mjs
CHANGED
|
@@ -102186,6 +102186,7 @@ function classifyError(message) {
|
|
|
102186
102186
|
}
|
|
102187
102187
|
if (/^No API key found/.test(message)) return { kind: "missing-key" };
|
|
102188
102188
|
if (/^Not approved\b/.test(message)) return { kind: "policy" };
|
|
102189
|
+
if (TIMEOUT.test(message)) return { kind: "timeout" };
|
|
102189
102190
|
if (NETWORK.test(message)) return { kind: "network" };
|
|
102190
102191
|
return { kind: "unknown" };
|
|
102191
102192
|
}
|
|
@@ -102247,6 +102248,12 @@ function describeError(kind, cause, ctx = {}) {
|
|
|
102247
102248
|
cause: `${shown}${retained ? " Your prompt is saved." : ""}`,
|
|
102248
102249
|
action: retained ? "Check your connection, then press enter to retry." : "Check your connection, then send your prompt again."
|
|
102249
102250
|
};
|
|
102251
|
+
case "timeout":
|
|
102252
|
+
return {
|
|
102253
|
+
title: "The model stopped responding",
|
|
102254
|
+
cause: `${shown}${retained ? " Your prompt is saved." : ""}`,
|
|
102255
|
+
action: retained ? "Press enter to retry." : "Send your prompt again."
|
|
102256
|
+
};
|
|
102250
102257
|
case "session-save":
|
|
102251
102258
|
return {
|
|
102252
102259
|
title: "Session not saved",
|
|
@@ -102269,9 +102276,9 @@ function describeEventError(message, ctx = {}) {
|
|
|
102269
102276
|
}
|
|
102270
102277
|
function isRetryable(message) {
|
|
102271
102278
|
const { kind } = classifyError(message);
|
|
102272
|
-
return kind === "gateway" || kind === "rate-limit" || kind === "network" || kind === "missing-key" || kind === "auth";
|
|
102279
|
+
return kind === "gateway" || kind === "rate-limit" || kind === "network" || kind === "timeout" || kind === "missing-key" || kind === "auth";
|
|
102273
102280
|
}
|
|
102274
|
-
var BILLING_URL, MAX_CAUSE_LINES, MAX_CAUSE_CHARS, NETWORK;
|
|
102281
|
+
var BILLING_URL, MAX_CAUSE_LINES, MAX_CAUSE_CHARS, TIMEOUT, NETWORK;
|
|
102275
102282
|
var init_describe_error = __esm({
|
|
102276
102283
|
"src/render/describe-error.ts"() {
|
|
102277
102284
|
"use strict";
|
|
@@ -102279,6 +102286,7 @@ var init_describe_error = __esm({
|
|
|
102279
102286
|
BILLING_URL = "https://spacecode.g-a-l-a-c-t-i-c.com";
|
|
102280
102287
|
MAX_CAUSE_LINES = 3;
|
|
102281
102288
|
MAX_CAUSE_CHARS = 300;
|
|
102289
|
+
TIMEOUT = /Stream stalled|Stream exceeded|No event within/i;
|
|
102282
102290
|
NETWORK = /fetch failed|ENOTFOUND|ECONNREFUSED|ECONNRESET|ETIMEDOUT|EAI_AGAIN|network (error|request failed|is unreachable)|socket hang up/i;
|
|
102283
102291
|
}
|
|
102284
102292
|
});
|