@burdenoff/fe-libs 2026.1001.4 → 2026.1001.5
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/shared/assistant/api.d.ts +12 -0
- package/dist/shared/assistant/api.d.ts.map +1 -1
- package/dist/shared/assistant/api.js +159 -154
- package/dist/shared/assistant/createSandboxAssistantTransport.d.ts.map +1 -1
- package/dist/shared/assistant/createSandboxAssistantTransport.js +4 -1
- package/dist/shared/assistant/index.d.ts +1 -0
- package/dist/shared/assistant/index.d.ts.map +1 -1
- package/dist/shared/assistant/permissionError.d.ts +15 -2
- package/dist/shared/assistant/permissionError.d.ts.map +1 -1
- package/dist/shared/assistant/permissionError.js +24 -14
- package/dist/shared/assistant/progress.d.ts +9 -1
- package/dist/shared/assistant/progress.d.ts.map +1 -1
- package/dist/shared/assistant/progress.js +49 -46
- package/dist/shared/assistant/quota.d.ts +18 -2
- package/dist/shared/assistant/quota.d.ts.map +1 -1
- package/dist/shared/assistant/quota.js +46 -42
- package/dist/shared/assistant/sandboxProxyError.d.ts +91 -0
- package/dist/shared/assistant/sandboxProxyError.d.ts.map +1 -0
- package/dist/shared/assistant/sandboxProxyError.js +43 -0
- package/dist/shared/assistant/transportErrors.d.ts +14 -1
- package/dist/shared/assistant/transportErrors.d.ts.map +1 -1
- package/dist/shared/assistant/transportErrors.js +20 -14
- package/dist/shared/assistant/turnOutcome.d.ts +27 -3
- package/dist/shared/assistant/turnOutcome.d.ts.map +1 -1
- package/dist/shared/assistant/turnOutcome.js +82 -31
- package/dist/shared/assistant/turnOutcomeCopy.d.ts +24 -0
- package/dist/shared/assistant/turnOutcomeCopy.d.ts.map +1 -1
- package/dist/shared/assistant/turnOutcomeCopy.js +24 -0
- package/dist/shared/assistant/ui/AssistantChatArea.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantChatArea.js +3 -2
- package/dist/shared-assistant.js +180 -179
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
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B,CAAC;AACpC,cAAc,mBAAmB,CAAC;AAClC,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,gBAAgB,CAAC;AAC/B,cAAc,oBAAoB,CAAC;AACnC,cAAc,sBAAsB,CAAC;AACrC,cAAc,WAAW,CAAC;AAC1B,cAAc,mBAAmB,CAAC;AAClC,cAAc,sBAAsB,CAAC;AACrC,cAAc,mBAAmB,CAAC;AAClC,cAAc,aAAa,CAAC;AAE5B,cAAc,kBAAkB,CAAC;AAGjC,cAAc,kBAAkB,CAAC;AAGjC,cAAc,oBAAoB,CAAC;AAEnC,cAAc,0BAA0B,CAAC;AACzC,cAAc,0BAA0B,CAAC;AAGzC,cAAc,kBAAkB,CAAC;AACjC,cAAc,sBAAsB,CAAC;AAGrC,cAAc,sBAAsB,CAAC;AACrC,cAAc,2BAA2B,CAAC;AAE1C,cAAc,mBAAmB,CAAC;AAClC,cAAc,2BAA2B,CAAC;AAE1C,cAAc,iCAAiC,CAAC;AAGhD,cAAc,OAAO,CAAC;AACtB,cAAc,yBAAyB,CAAC;AACxC,cAAc,iCAAiC,CAAC;AAChD,cAAc,qCAAqC,CAAC;AACpD,cAAc,wBAAwB,CAAC;AACvC,cAAc,uBAAuB,CAAC;AAGtC,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC"}
|
|
@@ -1,5 +1,16 @@
|
|
|
1
|
-
/**
|
|
2
|
-
|
|
1
|
+
/**
|
|
2
|
+
* A denial the person can act on, a session fault they can recover from, or
|
|
3
|
+
* the §2.8 provisioning gate (BOFF-8124): the service will not START an
|
|
4
|
+
* assistant session for this role yet — a platform decision, not an access a
|
|
5
|
+
* workspace admin can grant, so its copy asks no one for anything.
|
|
6
|
+
*/
|
|
7
|
+
export type PermissionRefusal = "denied" | "session" | "provisioning-gated";
|
|
8
|
+
/**
|
|
9
|
+
* The i18n key wspace-sandbox-svc refuses `provisionAssistantSandbox` with
|
|
10
|
+
* while the §2.8 gate is on (FORBIDDEN, for a caller without
|
|
11
|
+
* `sandbox:create`).
|
|
12
|
+
*/
|
|
13
|
+
export declare const PROVISIONING_NOT_PERMITTED_I18N_KEY = "assistant.errors.assistantProvisioningNotPermitted";
|
|
3
14
|
export interface PermissionRefusalDetail {
|
|
4
15
|
readonly refusal: PermissionRefusal;
|
|
5
16
|
/** The gateway's `authFailure` class, when it sent one. */
|
|
@@ -21,4 +32,6 @@ export declare function describePermissionError(error: unknown): PermissionRefus
|
|
|
21
32
|
* stamps `lang: "en"` on failure copy so it never inherits the turn's language.
|
|
22
33
|
*/
|
|
23
34
|
export declare function permissionRefusalMessage(detail: PermissionRefusalDetail): string;
|
|
35
|
+
/** Which outcome copy a permission refusal gets — one table, read by both the message and the outcome. */
|
|
36
|
+
export declare function permissionRefusalCopyId(refusal: PermissionRefusal): "sessionUnverified" | "provisioningNotPermitted" | "permissionDenied";
|
|
24
37
|
//# sourceMappingURL=permissionError.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissionError.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/permissionError.ts"],"names":[],"mappings":"AAoCA
|
|
1
|
+
{"version":3,"file":"permissionError.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/permissionError.ts"],"names":[],"mappings":"AAoCA;;;;;GAKG;AACH,MAAM,MAAM,iBAAiB,GAAG,QAAQ,GAAG,SAAS,GAAG,oBAAoB,CAAC;AAE5E;;;;GAIG;AACH,eAAO,MAAM,mCAAmC,uDACM,CAAC;AAEvD,MAAM,WAAW,uBAAuB;IACtC,QAAQ,CAAC,OAAO,EAAE,iBAAiB,CAAC;IACpC,2DAA2D;IAC3D,QAAQ,CAAC,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;CACrC;AASD;;;;;GAKG;AACH,wBAAgB,uBAAuB,CACrC,KAAK,EAAE,OAAO,GACb,uBAAuB,GAAG,IAAI,CA8BhC;AAED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,uBAAuB,GAC9B,MAAM,CAER;AAED,0GAA0G;AAC1G,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,iBAAiB,GACzB,mBAAmB,GAAG,0BAA0B,GAAG,kBAAkB,CASvE"}
|
|
@@ -1,26 +1,36 @@
|
|
|
1
1
|
import { extensionObjectsIn as e } from "./quota.js";
|
|
2
2
|
import { TURN_OUTCOME_COPY as t } from "./turnOutcomeCopy.js";
|
|
3
3
|
//#region src/shared/assistant/permissionError.ts
|
|
4
|
-
var n = new Set([
|
|
4
|
+
var n = "assistant.errors.assistantProvisioningNotPermitted", r = new Set([
|
|
5
5
|
"UNAUTHENTICATED_ACTOR",
|
|
6
6
|
"WORKSPACE_SESSION_UNRESOLVED",
|
|
7
7
|
"WORKSPACE_CONTEXT_MISSING"
|
|
8
8
|
]);
|
|
9
|
-
function
|
|
10
|
-
let
|
|
11
|
-
for (let
|
|
12
|
-
let e =
|
|
13
|
-
(e === "FORBIDDEN" || e === "PERMISSION_DENIED") && (r = !0);
|
|
14
|
-
let t =
|
|
15
|
-
typeof t == "string" && t.length > 0 && !
|
|
9
|
+
function i(t) {
|
|
10
|
+
let n = !1, i = !1, a = null;
|
|
11
|
+
for (let r of e(t)) {
|
|
12
|
+
let e = r.code;
|
|
13
|
+
(e === "FORBIDDEN" || e === "PERMISSION_DENIED") && (n = !0), r.i18nKey === "assistant.errors.assistantProvisioningNotPermitted" && (i = !0);
|
|
14
|
+
let t = r.authFailure;
|
|
15
|
+
typeof t == "string" && t.length > 0 && !a && (a = t);
|
|
16
16
|
}
|
|
17
|
-
return !
|
|
18
|
-
refusal:
|
|
19
|
-
authFailure:
|
|
17
|
+
return !n && !i && !a ? null : a && r.has(a) ? {
|
|
18
|
+
refusal: "session",
|
|
19
|
+
authFailure: a
|
|
20
|
+
} : {
|
|
21
|
+
refusal: i ? "provisioning-gated" : "denied",
|
|
22
|
+
authFailure: a
|
|
20
23
|
};
|
|
21
24
|
}
|
|
22
|
-
function
|
|
23
|
-
return e.refusal
|
|
25
|
+
function a(e) {
|
|
26
|
+
return t[o(e.refusal)].fallback;
|
|
27
|
+
}
|
|
28
|
+
function o(e) {
|
|
29
|
+
switch (e) {
|
|
30
|
+
case "session": return "sessionUnverified";
|
|
31
|
+
case "provisioning-gated": return "provisioningNotPermitted";
|
|
32
|
+
case "denied": return "permissionDenied";
|
|
33
|
+
}
|
|
24
34
|
}
|
|
25
35
|
//#endregion
|
|
26
|
-
export {
|
|
36
|
+
export { n as PROVISIONING_NOT_PERMITTED_I18N_KEY, i as describePermissionError, o as permissionRefusalCopyId, a as permissionRefusalMessage };
|
|
@@ -71,7 +71,15 @@ export declare function sanitize(response: string): string;
|
|
|
71
71
|
* a prompt whose first attempt actually reached the model.
|
|
72
72
|
*/
|
|
73
73
|
export declare function isReapedSandboxConnectionError(error: unknown): boolean;
|
|
74
|
-
/**
|
|
74
|
+
/**
|
|
75
|
+
* Whether an error is worth one retry from a clean runtime (union of fleet fragments).
|
|
76
|
+
*
|
|
77
|
+
* ★★ BOFF-8124: an assistant LLM refusal (`SandboxProxyError` with a terminal
|
|
78
|
+
* code) is decided by its code, before any fragment: only a revoked session
|
|
79
|
+
* retries — a fresh sandbox gets a fresh capability. A daily limit, a busy or
|
|
80
|
+
* unavailable proxy, or a conversation too long would fail the same way in any
|
|
81
|
+
* sandbox.
|
|
82
|
+
*/
|
|
75
83
|
export declare function isRecoverable(error: unknown): boolean;
|
|
76
84
|
/**
|
|
77
85
|
* Upsert delta messages into an accumulator keyed by message id. Correct against
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/progress.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/progress.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EAAE,mBAAmB,EAA2B,sBAAsB,EAAE,MAAM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@
|
|
|
1
|
+
import { terminalCodeRecoverability as e } from "./sandboxProxyError.js";
|
|
1
2
|
//#region src/shared/assistant/progress.ts
|
|
2
|
-
function
|
|
3
|
+
function t(e) {
|
|
3
4
|
return e.info?.time?.created ?? 0;
|
|
4
5
|
}
|
|
5
|
-
function
|
|
6
|
+
function n(e) {
|
|
6
7
|
return (e ?? []).filter((e) => e.type === "text" && typeof e.text == "string").map((e) => e.text?.trim() ?? "").filter(Boolean).join("\n");
|
|
7
8
|
}
|
|
8
|
-
function
|
|
9
|
+
function r(e) {
|
|
9
10
|
return e.replace(/[\\[\]]/g, "\\$&").replace(/[\r\n]+/g, " ").trim();
|
|
10
11
|
}
|
|
11
|
-
var
|
|
12
|
-
function
|
|
12
|
+
var i = /^(?:png|jpe?g|gif|webp|avif|bmp|x-icon|vnd\.microsoft\.icon)$/i;
|
|
13
|
+
function a(e, t) {
|
|
13
14
|
let n = e.trim();
|
|
14
15
|
if (/^https?:\/\//i.test(n)) return n.replace(/[()\s<>]/g, (e) => `%${e.charCodeAt(0).toString(16).toUpperCase().padStart(2, "0")}`);
|
|
15
16
|
if (t) {
|
|
16
17
|
let e = /^data:image\/([a-z0-9.+-]+);base64,[a-z0-9+/=]*$/i.exec(n);
|
|
17
|
-
if (e &&
|
|
18
|
+
if (e && i.test(e[1])) return n;
|
|
18
19
|
}
|
|
19
20
|
return null;
|
|
20
21
|
}
|
|
21
|
-
function
|
|
22
|
+
function o(e) {
|
|
22
23
|
let t = [];
|
|
23
|
-
for (let
|
|
24
|
-
let e =
|
|
25
|
-
if (!e &&
|
|
26
|
-
let
|
|
27
|
-
if (!
|
|
28
|
-
let o = i
|
|
24
|
+
for (let n of e ?? []) {
|
|
25
|
+
let e = n.type === "image";
|
|
26
|
+
if (!e && n.type !== "file") continue;
|
|
27
|
+
let i = n.url ?? (n.data && n.mimeType ? `data:${n.mimeType};base64,${n.data}` : void 0);
|
|
28
|
+
if (!i) continue;
|
|
29
|
+
let o = a(i, e);
|
|
29
30
|
if (!o) continue;
|
|
30
|
-
let s = n
|
|
31
|
+
let s = r(n.filename ?? (e ? "image" : "file")) || "file";
|
|
31
32
|
t.push(e ? `` : `[${s}](${o})`);
|
|
32
33
|
}
|
|
33
34
|
return t;
|
|
34
35
|
}
|
|
35
|
-
function
|
|
36
|
+
function s(e) {
|
|
36
37
|
return typeof e == "object" && e ? e : void 0;
|
|
37
38
|
}
|
|
38
|
-
function
|
|
39
|
-
let t =
|
|
39
|
+
function c(e) {
|
|
40
|
+
let t = s(e.state?.input);
|
|
40
41
|
if (!t) return;
|
|
41
42
|
let n = t.description;
|
|
42
43
|
if (typeof n == "string" && n.trim()) return n.trim();
|
|
43
44
|
let r = t.todos;
|
|
44
45
|
if (Array.isArray(r)) {
|
|
45
|
-
let e =
|
|
46
|
+
let e = s(r.find((e) => s(e)?.status === "in_progress") ?? r[0])?.content;
|
|
46
47
|
if (typeof e == "string" && e.trim()) return e.trim();
|
|
47
48
|
}
|
|
48
49
|
}
|
|
49
|
-
function
|
|
50
|
+
function l(e) {
|
|
50
51
|
return (e ?? []).filter((e) => e.type === "tool" && e.tool).map((e) => {
|
|
51
|
-
let t = e.state?.status ?? "running", n = e.tool ?? "tool", r =
|
|
52
|
+
let t = e.state?.status ?? "running", n = e.tool ?? "tool", r = c(e), i = r ? `${n} · ${r}` : n;
|
|
52
53
|
return t === "completed" ? `Completed: ${i}` : t === "failed" ? `Failed: ${i}` : `Running: ${i}`;
|
|
53
54
|
});
|
|
54
55
|
}
|
|
55
|
-
function
|
|
56
|
-
let
|
|
57
|
-
if (
|
|
56
|
+
function u(e, r, i) {
|
|
57
|
+
let a = e.filter((e) => e.info?.role === "assistant" && t(e) >= r).sort((e, n) => t(e) - t(n));
|
|
58
|
+
if (a.length === 0) return {
|
|
58
59
|
content: "Thinking…",
|
|
59
60
|
done: !1
|
|
60
61
|
};
|
|
61
|
-
let s =
|
|
62
|
+
let s = a[a.length - 1], c = i?.accumulateNarration ? a.map((e) => n(e.parts)).filter(Boolean).join("\n\n") : n(s.parts), u = o(s.parts), d = l(s.parts);
|
|
62
63
|
return {
|
|
63
64
|
content: [
|
|
64
|
-
|
|
65
|
+
c,
|
|
65
66
|
...u,
|
|
66
67
|
...d
|
|
67
68
|
].filter(Boolean).join("\n\n") || "Thinking…",
|
|
68
|
-
done: !!s.info?.time?.completed && (!!
|
|
69
|
+
done: !!s.info?.time?.completed && (!!c || u.length > 0 || d.length > 0)
|
|
69
70
|
};
|
|
70
71
|
}
|
|
71
|
-
function
|
|
72
|
+
function d(e) {
|
|
72
73
|
return e.replace(/(Authorization\s*:\s*Bearer\s+)[^\s\n]+/gi, "$1[REDACTED]").replace(/(X-Workspace-Authorization\s*:\s*Bearer\s+)[^\s\n]+/gi, "$1[REDACTED]").replace(/\beyJ[A-Za-z0-9_-]+\.[A-Za-z0-9._-]+\.[A-Za-z0-9._-]+\b/g, "[REDACTED_JWT]").replace(/\bsk-ant-[A-Za-z0-9-]+\b/g, "[REDACTED_API_KEY]");
|
|
73
74
|
}
|
|
74
|
-
function
|
|
75
|
+
function f(e) {
|
|
75
76
|
let t = e instanceof Error ? e.message.toLowerCase() : String(e).toLowerCase();
|
|
76
77
|
return t.includes("unable to connect") && t.includes("able to access the url");
|
|
77
78
|
}
|
|
78
|
-
function
|
|
79
|
-
let
|
|
80
|
-
|
|
79
|
+
function p(t) {
|
|
80
|
+
let n = e(t);
|
|
81
|
+
if (n !== null) return n;
|
|
82
|
+
let r = t instanceof Error ? t.message.toLowerCase() : String(t).toLowerCase();
|
|
83
|
+
return r.includes("rate limit exceeded") || r.includes("unauthorized") || r.includes("k8s api error 401") ? !1 : f(t) ? !0 : [
|
|
81
84
|
"sandbox not found",
|
|
82
85
|
"sandbox is not running",
|
|
83
86
|
"sandbox service not available yet",
|
|
@@ -91,33 +94,33 @@ function f(e) {
|
|
|
91
94
|
"proxy error: 404",
|
|
92
95
|
"proxy error: 502",
|
|
93
96
|
"proxy error: 503"
|
|
94
|
-
].some((e) =>
|
|
97
|
+
].some((e) => r.includes(e));
|
|
95
98
|
}
|
|
96
|
-
function
|
|
99
|
+
function m(e, n) {
|
|
97
100
|
let r = /* @__PURE__ */ new Map();
|
|
98
|
-
for (let
|
|
99
|
-
let
|
|
100
|
-
|
|
101
|
+
for (let t of e) {
|
|
102
|
+
let e = t.info?.id;
|
|
103
|
+
e && r.set(e, t);
|
|
101
104
|
}
|
|
102
105
|
for (let e of n) {
|
|
103
106
|
let t = e.info?.id;
|
|
104
107
|
t && r.set(t, e);
|
|
105
108
|
}
|
|
106
|
-
return Array.from(r.values()).sort((
|
|
109
|
+
return Array.from(r.values()).sort((e, n) => t(e) - t(n));
|
|
107
110
|
}
|
|
108
|
-
function
|
|
111
|
+
function h(e) {
|
|
109
112
|
let r = [];
|
|
110
|
-
for (let i of
|
|
111
|
-
let
|
|
112
|
-
if (
|
|
113
|
-
let
|
|
114
|
-
c && (
|
|
115
|
-
id: i.info?.id ?? `${
|
|
116
|
-
role:
|
|
113
|
+
for (let i of e) {
|
|
114
|
+
let e = i.info?.role;
|
|
115
|
+
if (e !== "user" && e !== "assistant") continue;
|
|
116
|
+
let a = i.parts, s = n(a), c = [s, ...o(a)].filter(Boolean).join("\n\n");
|
|
117
|
+
c && (e === "user" && (s.startsWith("[Context file:") || s.startsWith("User's current context:")) || r.push({
|
|
118
|
+
id: i.info?.id ?? `${e}-${t(i)}`,
|
|
119
|
+
role: e,
|
|
117
120
|
content: c
|
|
118
121
|
}));
|
|
119
122
|
}
|
|
120
123
|
return r;
|
|
121
124
|
}
|
|
122
125
|
//#endregion
|
|
123
|
-
export {
|
|
126
|
+
export { u as buildProgress, o as getAssistantMedia, n as getAssistantText, t as getRawMessageCreatedAt, l as getToolProgress, f as isReapedSandboxConnectionError, p as isRecoverable, h as mapSessionToHistory, m as mergeMessagesById, d as sanitize };
|
|
@@ -30,17 +30,28 @@ export declare function isQuotaExhaustedError(error: unknown): boolean;
|
|
|
30
30
|
* never granted. Measured in prod 2026-08-13, this is why `createHealthyBowlFarm` returns
|
|
31
31
|
* `429 QUOTA_NOT_PROVISIONED` on several workspaces — the core create path is simply dead there.
|
|
32
32
|
*
|
|
33
|
+
* - `daily-limit` — the assistant's DAILY LLM allowance (per actor, workspace or environment) is
|
|
34
|
+
* spent (BOFF-8124). It resets on its own at `resetsAt`; no plan buys more of it, so it NEVER
|
|
35
|
+
* offers an upgrade. `quotaName` says whose allowance it was
|
|
36
|
+
* (`assistant.llm.{actor,workspace,env}_daily`).
|
|
37
|
+
*
|
|
33
38
|
* ★ Keyed on `extensions.code`, never on the HTTP status or the message text. Both refusals are
|
|
34
39
|
* `429`, so status alone cannot tell them apart — which is exactly how "no active subscription
|
|
35
|
-
* covers this" would otherwise be reported to a farmer as "you have reached your limit".
|
|
40
|
+
* covers this" would otherwise be reported to a farmer as "you have reached your limit". The
|
|
41
|
+
* daily limit is a 429 too (the svc's prompt-async refusal), and a 402 or 429 `turnTerminal`.
|
|
36
42
|
*/
|
|
37
|
-
export type QuotaRefusal = "exhausted" | "not-provisioned";
|
|
43
|
+
export type QuotaRefusal = "exhausted" | "not-provisioned" | "daily-limit";
|
|
38
44
|
/**
|
|
39
45
|
* Which refusal this is, or null when the error is not a quota wall at all.
|
|
40
46
|
*
|
|
41
47
|
* `not-provisioned` wins when both appear: it is the more specific and the more serious of the two,
|
|
42
48
|
* and telling someone to upgrade when their plan was never granted sends them to buy something that
|
|
43
49
|
* would not help.
|
|
50
|
+
*
|
|
51
|
+
* ★★★ `daily-limit` is checked FIRST, and every assistant LLM code is checked before the bare-429
|
|
52
|
+
* rule (BOFF-8124 §4.8(c)). The svc answers a send at the daily limit with a 429, and the proxy's
|
|
53
|
+
* busy refusal reaches the panel as a 429 `turnTerminal`: read by status alone, both would become
|
|
54
|
+
* `exhausted` — "upgrade your plan" for an allowance that resets tonight, or for a busy proxy.
|
|
44
55
|
*/
|
|
45
56
|
export declare function classifyQuotaError(error: unknown): QuotaRefusal | null;
|
|
46
57
|
/**
|
|
@@ -62,6 +73,11 @@ export interface QuotaRefusalDetail {
|
|
|
62
73
|
quotaName: string | null;
|
|
63
74
|
/** The refusing service's trace id, so support can find the request. */
|
|
64
75
|
traceId: string | null;
|
|
76
|
+
/**
|
|
77
|
+
* When a `daily-limit` allowance resets (ISO-8601), as the refusal named it; null when it named
|
|
78
|
+
* none. Unvalidated here — `classifyTurnFailure` decides whether it can be shown.
|
|
79
|
+
*/
|
|
80
|
+
resetsAt: string | null;
|
|
65
81
|
}
|
|
66
82
|
/** Every `extensions` object reachable on an error — the hosts `codesIn` walks. */
|
|
67
83
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"quota.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/quota.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;
|
|
1
|
+
{"version":3,"file":"quota.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/quota.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAqBH;;;;;;;GAOG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAsB7D;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,MAAM,MAAM,YAAY,GAAG,WAAW,GAAG,iBAAiB,GAAG,aAAa,CAAC;AA0C3E;;;;;;;;;;;GAWG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,YAAY,GAAG,IAAI,CAatE;AAED;;;;;;;;;;;;GAYG;AACH,MAAM,WAAW,kBAAkB;IACjC,OAAO,EAAE,YAAY,CAAC;IACtB,6DAA6D;IAC7D,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,wEAAwE;IACxE,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACvB;;;OAGG;IACH,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;CACzB;AAED,mFAAmF;AACnF;;;;;;;;;;GAUG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAmB5E;AAED;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,OAAO,GAAG,kBAAkB,GAAG,IAAI,CAoB5E;AAED,MAAM,MAAM,SAAS,GAAG,SAAS,GAAG,YAAY,GAAG,SAAS,CAAC;AAE7D;;;;;;;;;;;GAWG;AACH,wBAAgB,uBAAuB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAE/D;AAED,MAAM,WAAW,yBAAyB;IACxC,IAAI,EAAE,SAAS,CAAC;IAChB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,aAAa,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CAC/B"}
|
|
@@ -1,76 +1,80 @@
|
|
|
1
|
+
import { isAssistantLlmTerminalCode as e } from "./sandboxProxyError.js";
|
|
1
2
|
//#region src/shared/assistant/quota.ts
|
|
2
|
-
function
|
|
3
|
+
function t(e, t) {
|
|
3
4
|
if (!e || typeof e != "object") return;
|
|
4
5
|
let n = e[t];
|
|
5
6
|
return Array.isArray(n) ? n : void 0;
|
|
6
7
|
}
|
|
7
|
-
function t
|
|
8
|
-
let
|
|
9
|
-
if (
|
|
10
|
-
if (
|
|
11
|
-
let
|
|
12
|
-
return
|
|
8
|
+
function n(t) {
|
|
9
|
+
let n = a(t);
|
|
10
|
+
if (n) return n === "exhausted";
|
|
11
|
+
if (i(t).some(e) || !(t instanceof Error)) return !1;
|
|
12
|
+
let r = t.message.toLowerCase();
|
|
13
|
+
return r.includes("quota") && (r.includes("exhaust") || r.includes("exceeded"));
|
|
13
14
|
}
|
|
14
|
-
var
|
|
15
|
+
var r = {
|
|
15
16
|
QUOTA_EXHAUSTED: "exhausted",
|
|
16
17
|
QUOTA_NOT_PROVISIONED: "not-provisioned"
|
|
17
18
|
};
|
|
18
|
-
function
|
|
19
|
-
if (!
|
|
20
|
-
let
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
19
|
+
function i(e) {
|
|
20
|
+
if (!e || typeof e != "object") return [];
|
|
21
|
+
let n = [
|
|
22
|
+
e,
|
|
23
|
+
e.result,
|
|
24
|
+
e.networkError
|
|
24
25
|
], i = [];
|
|
25
|
-
for (let
|
|
26
|
-
let n =
|
|
26
|
+
for (let e of n) {
|
|
27
|
+
let n = e?.extensions;
|
|
27
28
|
n?.code && i.push(n.code), n?.errorCode && i.push(n.errorCode);
|
|
28
|
-
for (let n of e
|
|
29
|
+
for (let n of t(e, "errors") ?? []) n.extensions?.code && i.push(n.extensions.code), n.extensions?.errorCode && i.push(n.extensions.errorCode);
|
|
29
30
|
}
|
|
30
|
-
let a =
|
|
31
|
-
for (let e of [a, o]) if (typeof e == "string") for (let t of Object.keys(
|
|
31
|
+
let a = e.bodyText, o = e instanceof Error ? e.message : void 0;
|
|
32
|
+
for (let e of [a, o]) if (typeof e == "string") for (let t of Object.keys(r)) e.includes(t) && i.push(t);
|
|
32
33
|
return i;
|
|
33
34
|
}
|
|
34
|
-
function i(e) {
|
|
35
|
-
let t = r(e);
|
|
36
|
-
if (t.includes("QUOTA_NOT_PROVISIONED")) return "not-provisioned";
|
|
37
|
-
if (t.includes("QUOTA_EXHAUSTED")) return "exhausted";
|
|
38
|
-
let n = e?.statusCode;
|
|
39
|
-
return typeof n == "number" && n === 429 ? "exhausted" : null;
|
|
40
|
-
}
|
|
41
35
|
function a(t) {
|
|
42
|
-
|
|
36
|
+
let n = i(t);
|
|
37
|
+
if (n.includes("ASSISTANT_DAILY_LIMIT")) return "daily-limit";
|
|
38
|
+
if (n.includes("QUOTA_NOT_PROVISIONED")) return "not-provisioned";
|
|
39
|
+
if (n.includes("QUOTA_EXHAUSTED")) return "exhausted";
|
|
40
|
+
if (n.some(e)) return null;
|
|
41
|
+
let r = t?.statusCode;
|
|
42
|
+
return typeof r == "number" && r === 429 ? "exhausted" : null;
|
|
43
|
+
}
|
|
44
|
+
function o(e) {
|
|
45
|
+
if (!e || typeof e != "object") return [];
|
|
43
46
|
let n = [
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
+
e,
|
|
48
|
+
e.result,
|
|
49
|
+
e.networkError
|
|
47
50
|
], r = [];
|
|
48
|
-
for (let
|
|
49
|
-
if (!
|
|
50
|
-
let n =
|
|
51
|
+
for (let e of n) {
|
|
52
|
+
if (!e || typeof e != "object") continue;
|
|
53
|
+
let n = e.extensions;
|
|
51
54
|
n && typeof n == "object" && r.push(n);
|
|
52
|
-
for (let n of e
|
|
55
|
+
for (let n of t(e, "errors") ?? []) n.extensions && typeof n.extensions == "object" && r.push(n.extensions);
|
|
53
56
|
}
|
|
54
57
|
return r;
|
|
55
58
|
}
|
|
56
|
-
function
|
|
57
|
-
let
|
|
58
|
-
if (!
|
|
59
|
+
function s(e) {
|
|
60
|
+
let t = a(e) ?? (n(e) ? "exhausted" : null);
|
|
61
|
+
if (!t) return null;
|
|
59
62
|
let r = (t) => {
|
|
60
|
-
for (let n of
|
|
63
|
+
for (let n of o(e)) {
|
|
61
64
|
let e = n[t];
|
|
62
65
|
if (typeof e == "string" && e.length > 0) return e;
|
|
63
66
|
}
|
|
64
67
|
return null;
|
|
65
68
|
};
|
|
66
69
|
return {
|
|
67
|
-
refusal:
|
|
70
|
+
refusal: t,
|
|
68
71
|
quotaName: r("quotaName"),
|
|
69
|
-
traceId: r("traceId")
|
|
72
|
+
traceId: r("traceId"),
|
|
73
|
+
resetsAt: r("resetsAt")
|
|
70
74
|
};
|
|
71
75
|
}
|
|
72
|
-
function
|
|
76
|
+
function c(e) {
|
|
73
77
|
return `${e}:quota-exhausted`;
|
|
74
78
|
}
|
|
75
79
|
//#endregion
|
|
76
|
-
export {
|
|
80
|
+
export { a as classifyQuotaError, s as describeQuotaError, o as extensionObjectsIn, n as isQuotaExhaustedError, c as quotaExhaustedEventName };
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A refusal a sandbox request came back with, kept typed (BOFF-8124 §4.8(c)).
|
|
3
|
+
*
|
|
4
|
+
* ★★ WHY THIS EXISTS. A turn is sent with `prompt-async`: the image answers
|
|
5
|
+
* 202 and runs the turn in a detached watcher. Once platform keys leave the
|
|
6
|
+
* session, the model is reached through a scoped LLM proxy that can refuse a
|
|
7
|
+
* call — a daily limit, a revoked capability, a body too large. Two paths
|
|
8
|
+
* bring that refusal back:
|
|
9
|
+
*
|
|
10
|
+
* - wspace-sandbox-svc refuses the SEND itself when a daily limit is already
|
|
11
|
+
* reached: 429 `{error, code: "ASSISTANT_DAILY_LIMIT", quotaName, resetsAt}`;
|
|
12
|
+
* - the image records a mid-turn refusal and returns it on
|
|
13
|
+
* `/sessions/:id/messages` as `turnTerminal`
|
|
14
|
+
* (`{code, error, status, at, quotaName?, resetsAt?}`).
|
|
15
|
+
*
|
|
16
|
+
* Before this, `proxyToSandbox` threw `new Error(errBody.error)` and dropped the
|
|
17
|
+
* code and the status, and nothing read `turnTerminal` at all: a daily limit
|
|
18
|
+
* either became a bare 429 — which `classifyQuotaError` calls `exhausted`, the
|
|
19
|
+
* one outcome that offers an UPGRADE — or a turn that polled until the client
|
|
20
|
+
* budget ran out and closed as "incomplete".
|
|
21
|
+
*
|
|
22
|
+
* ★ The message stays the body's `error` text, so every substring rule in
|
|
23
|
+
* `transportErrors.ts` and `progress.ts` keeps reading what it read before.
|
|
24
|
+
* The code rides in `extensions`, the shape `extensionObjectsIn` already walks.
|
|
25
|
+
*
|
|
26
|
+
* ★ A LEAF MODULE: no imports. `quota.ts`, `progress.ts` and
|
|
27
|
+
* `transportErrors.ts` read it, and none of them may pull `api.ts` (which
|
|
28
|
+
* imports the store) just to recognise an error.
|
|
29
|
+
*/
|
|
30
|
+
/** What rides in `extensions`: only these four, and only as non-empty strings. */
|
|
31
|
+
export interface SandboxProxyErrorExtensions {
|
|
32
|
+
code: string;
|
|
33
|
+
quotaName?: string;
|
|
34
|
+
resetsAt?: string;
|
|
35
|
+
i18nKey?: string;
|
|
36
|
+
}
|
|
37
|
+
export declare class SandboxProxyError extends Error {
|
|
38
|
+
/**
|
|
39
|
+
* The HTTP status the refusal carried: the proxied response's for a refused
|
|
40
|
+
* request, the LLM proxy's for a `turnTerminal`. Null when the source named
|
|
41
|
+
* none — never invented.
|
|
42
|
+
*/
|
|
43
|
+
readonly status: number | null;
|
|
44
|
+
readonly extensions: SandboxProxyErrorExtensions;
|
|
45
|
+
constructor(message: string, status: number | null, extensions: SandboxProxyErrorExtensions);
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* The codes the image reports when a turn ends on a terminal refusal from the
|
|
49
|
+
* assistant LLM proxy (design §4.7; `imageCode` in the mirrored
|
|
50
|
+
* `contract/llm-refusal-contract.json`). The svc's synchronous prompt-async
|
|
51
|
+
* refusal uses `ASSISTANT_DAILY_LIMIT` too.
|
|
52
|
+
*/
|
|
53
|
+
export declare const ASSISTANT_LLM_TERMINAL_CODES: readonly ["ASSISTANT_SESSION_REVOKED", "ASSISTANT_LLM_UNAVAILABLE", "ASSISTANT_CONVERSATION_TOO_LONG", "ASSISTANT_DAILY_LIMIT", "ASSISTANT_LLM_BUSY"];
|
|
54
|
+
export type AssistantLlmTerminalCode = (typeof ASSISTANT_LLM_TERMINAL_CODES)[number];
|
|
55
|
+
export declare function isAssistantLlmTerminalCode(code: unknown): code is AssistantLlmTerminalCode;
|
|
56
|
+
/**
|
|
57
|
+
* The terminal LLM code a refusal carries, or null.
|
|
58
|
+
*
|
|
59
|
+
* ★ Read from the error's OWN `extensions` (where `SandboxProxyError` puts
|
|
60
|
+
* it), duck-typed rather than `instanceof`: a second copy of this module in a
|
|
61
|
+
* consumer's bundle must not turn a daily limit back into a retry.
|
|
62
|
+
*/
|
|
63
|
+
export declare function assistantLlmTerminalCodeOf(error: unknown): AssistantLlmTerminalCode | null;
|
|
64
|
+
/**
|
|
65
|
+
* Is this worth one retry with a fresh sandbox, as far as a terminal LLM code
|
|
66
|
+
* says? `true`/`false` when the error carries one, `null` when it does not
|
|
67
|
+
* (the caller's own rules decide).
|
|
68
|
+
*
|
|
69
|
+
* ★ Only `ASSISTANT_SESSION_REVOKED` retries: the sandbox's capability no
|
|
70
|
+
* longer verifies, and a fresh sandbox gets a fresh one. A daily limit, a busy
|
|
71
|
+
* or unavailable proxy, or a conversation too long for the model is the same
|
|
72
|
+
* in any sandbox — a replay only spends another provision and another prompt.
|
|
73
|
+
*/
|
|
74
|
+
export declare function terminalCodeRecoverability(error: unknown): boolean | null;
|
|
75
|
+
/**
|
|
76
|
+
* The typed error for a refusal body, or null when the body carries no string
|
|
77
|
+
* `code` (the caller then throws exactly what it threw before).
|
|
78
|
+
*
|
|
79
|
+
* `message` is the caller's, unchanged: the body's `error` text or its
|
|
80
|
+
* `Proxy error: <status>` fallback.
|
|
81
|
+
*/
|
|
82
|
+
export declare function sandboxProxyErrorFromBody(message: string, status: number | null, body: unknown): SandboxProxyError | null;
|
|
83
|
+
/**
|
|
84
|
+
* The typed error for a `/messages` body's `turnTerminal`, or null when there
|
|
85
|
+
* is none (or it names no code, so it cannot be classified).
|
|
86
|
+
*
|
|
87
|
+
* ★ Its `status` is the LLM proxy's (402 for a daily limit, 429 for busy),
|
|
88
|
+
* never the 200 of the `/messages` read that carried it.
|
|
89
|
+
*/
|
|
90
|
+
export declare function sandboxProxyErrorFromTurnTerminal(turnTerminal: unknown): SandboxProxyError | null;
|
|
91
|
+
//# sourceMappingURL=sandboxProxyError.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sandboxProxyError.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/sandboxProxyError.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AAEH,kFAAkF;AAClF,MAAM,WAAW,2BAA2B;IAC1C,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,qBAAa,iBAAkB,SAAQ,KAAK;IAC1C;;;;OAIG;IACH,QAAQ,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,CAAC;IAC/B,QAAQ,CAAC,UAAU,EAAE,2BAA2B,CAAC;gBAG/C,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,GAAG,IAAI,EACrB,UAAU,EAAE,2BAA2B;CAO1C;AAED;;;;;GAKG;AACH,eAAO,MAAM,4BAA4B,uJAM/B,CAAC;AAEX,MAAM,MAAM,wBAAwB,GAClC,CAAC,OAAO,4BAA4B,CAAC,CAAC,MAAM,CAAC,CAAC;AAEhD,wBAAgB,0BAA0B,CACxC,IAAI,EAAE,OAAO,GACZ,IAAI,IAAI,wBAAwB,CAKlC;AAED;;;;;;GAMG;AACH,wBAAgB,0BAA0B,CACxC,KAAK,EAAE,OAAO,GACb,wBAAwB,GAAG,IAAI,CAMjC;AAED;;;;;;;;;GASG;AACH,wBAAgB,0BAA0B,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,GAAG,IAAI,CAIzE;AAKD;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CACvC,OAAO,EAAE,MAAM,EACf,MAAM,EAAE,MAAM,GAAG,IAAI,EACrB,IAAI,EAAE,OAAO,GACZ,iBAAiB,GAAG,IAAI,CAS1B;AAED;;;;;;GAMG;AACH,wBAAgB,iCAAiC,CAC/C,YAAY,EAAE,OAAO,GACpB,iBAAiB,GAAG,IAAI,CAW1B"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
//#region src/shared/assistant/sandboxProxyError.ts
|
|
2
|
+
var e = class extends Error {
|
|
3
|
+
status;
|
|
4
|
+
extensions;
|
|
5
|
+
constructor(e, t, n) {
|
|
6
|
+
super(e), this.name = "SandboxProxyError", this.status = t, this.extensions = n;
|
|
7
|
+
}
|
|
8
|
+
}, t = [
|
|
9
|
+
"ASSISTANT_SESSION_REVOKED",
|
|
10
|
+
"ASSISTANT_LLM_UNAVAILABLE",
|
|
11
|
+
"ASSISTANT_CONVERSATION_TOO_LONG",
|
|
12
|
+
"ASSISTANT_DAILY_LIMIT",
|
|
13
|
+
"ASSISTANT_LLM_BUSY"
|
|
14
|
+
];
|
|
15
|
+
function n(e) {
|
|
16
|
+
return typeof e == "string" && t.includes(e);
|
|
17
|
+
}
|
|
18
|
+
function r(e) {
|
|
19
|
+
if (!e || typeof e != "object") return null;
|
|
20
|
+
let t = e.extensions;
|
|
21
|
+
if (!t || typeof t != "object") return null;
|
|
22
|
+
let r = t.code;
|
|
23
|
+
return n(r) ? r : null;
|
|
24
|
+
}
|
|
25
|
+
function i(e) {
|
|
26
|
+
let t = r(e);
|
|
27
|
+
return t === null ? null : t === "ASSISTANT_SESSION_REVOKED";
|
|
28
|
+
}
|
|
29
|
+
var a = (e) => typeof e == "string" && e.length > 0;
|
|
30
|
+
function o(t, n, r) {
|
|
31
|
+
if (!r || typeof r != "object") return null;
|
|
32
|
+
let i = r;
|
|
33
|
+
if (!a(i.code)) return null;
|
|
34
|
+
let o = { code: i.code };
|
|
35
|
+
return a(i.quotaName) && (o.quotaName = i.quotaName), a(i.resetsAt) && (o.resetsAt = i.resetsAt), a(i.i18nKey) && (o.i18nKey = i.i18nKey), new e(t, n, o);
|
|
36
|
+
}
|
|
37
|
+
function s(e) {
|
|
38
|
+
if (!e || typeof e != "object") return null;
|
|
39
|
+
let t = e, n = typeof t.status == "number" && Number.isInteger(t.status) ? t.status : null;
|
|
40
|
+
return o(a(t.error) ? t.error : `Proxy error: ${n ?? "unknown"}`, n, t);
|
|
41
|
+
}
|
|
42
|
+
//#endregion
|
|
43
|
+
export { t as ASSISTANT_LLM_TERMINAL_CODES, e as SandboxProxyError, r as assistantLlmTerminalCodeOf, n as isAssistantLlmTerminalCode, o as sandboxProxyErrorFromBody, s as sandboxProxyErrorFromTurnTerminal, i as terminalCodeRecoverability };
|
|
@@ -35,7 +35,20 @@
|
|
|
35
35
|
* the multimodal parts?
|
|
36
36
|
*/
|
|
37
37
|
export declare function isMultimodalBodyRejection(error: unknown): boolean;
|
|
38
|
-
/**
|
|
38
|
+
/**
|
|
39
|
+
* A refusal (rate limit, unauthorized) — never cured by another sandbox or a probe.
|
|
40
|
+
*
|
|
41
|
+
* ★ BOFF-8124: so is every assistant LLM refusal but a revoked session (see
|
|
42
|
+
* `terminalCodeRecoverability`).
|
|
43
|
+
*/
|
|
39
44
|
export declare function isNeverRecoverableAssistantError(error: unknown): boolean;
|
|
45
|
+
/**
|
|
46
|
+
* Worth one replay against a fresh sandbox and session?
|
|
47
|
+
*
|
|
48
|
+
* ★★ BOFF-8124 §4.8(c): an assistant LLM refusal is decided by its CODE
|
|
49
|
+
* before any fragment is read — only `ASSISTANT_SESSION_REVOKED` keeps the
|
|
50
|
+
* single retry with a fresh sandbox. A daily limit replayed would provision
|
|
51
|
+
* again only to be refused again.
|
|
52
|
+
*/
|
|
40
53
|
export declare function isRecoverableAssistantError(error: unknown): boolean;
|
|
41
54
|
//# sourceMappingURL=transportErrors.d.ts.map
|