@burdenoff/fe-libs 2026.925.4 → 2026.925.6
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/index.d.ts +1 -0
- package/dist/shared/assistant/index.d.ts.map +1 -1
- package/dist/shared/assistant/prewarm.d.ts +139 -0
- package/dist/shared/assistant/prewarm.d.ts.map +1 -0
- package/dist/shared/assistant/prewarm.js +96 -0
- package/dist/shared/assistant/sandboxReadiness.d.ts +45 -6
- package/dist/shared/assistant/sandboxReadiness.d.ts.map +1 -1
- package/dist/shared/assistant/sandboxReadiness.js +25 -11
- package/dist/shared/assistant/transportErrors.d.ts +2 -0
- package/dist/shared/assistant/transportErrors.d.ts.map +1 -1
- package/dist/shared/assistant/transportErrors.js +5 -1
- package/dist/shared/assistant/turnTimeline.d.ts +12 -0
- package/dist/shared/assistant/turnTimeline.d.ts.map +1 -1
- package/dist/shared/assistant/turnTimeline.js +2 -2
- package/dist/shared/assistant/ui/AssistantChatArea.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantChatArea.js +587 -465
- package/dist/shared/assistant/ui/composer/AssistantComposer.d.ts +6 -0
- package/dist/shared/assistant/ui/composer/AssistantComposer.d.ts.map +1 -1
- package/dist/shared/assistant/ui/composer/AssistantComposer.js +110 -106
- package/dist/shared-assistant.js +67 -66
- package/package.json +1 -1
|
@@ -154,6 +154,7 @@ export * from './permissionError';
|
|
|
154
154
|
export * from './autoRouting';
|
|
155
155
|
export * from './turnOutcome';
|
|
156
156
|
export * from './turnTimeline';
|
|
157
|
+
export * from './prewarm';
|
|
157
158
|
export * from './turnOutcomeCopy';
|
|
158
159
|
export * from './aiCredits';
|
|
159
160
|
export * from './useWorkspaceWriteAccess';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;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,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"}
|
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { AssistantModeConfig, AssistantTurnStage } from './conversation';
|
|
2
|
+
import { AssistantMode } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* ★ BOFF-7801 — PRE-WARM ON THE FIRST KEYSTROKE (operator decision
|
|
5
|
+
* 2026-09-25: warm when a message is started, never on merely opening the
|
|
6
|
+
* panel).
|
|
7
|
+
*
|
|
8
|
+
* A warm is a GUESS about the next send, so it is held to a stricter rule than
|
|
9
|
+
* the send it anticipates: it may reuse or create a sandbox, and it may never
|
|
10
|
+
* take anything away. Concretely —
|
|
11
|
+
*
|
|
12
|
+
* - it never RELEASES. A send frees the person's other sandboxes before it
|
|
13
|
+
* creates, because a Free workspace holds one; a warm doing the same stopped
|
|
14
|
+
* a live Take-action sandbox to warm Ask for a message Auto then routed back
|
|
15
|
+
* to Take action (review of #268, reproduced against a one-slot model). A
|
|
16
|
+
* warm that finds the slot taken is refused by the quota, silently; the send
|
|
17
|
+
* does the committed release itself;
|
|
18
|
+
* - it yields to a send in ANOTHER mode (`settleWarmBeforeSend`): it is
|
|
19
|
+
* cancelled, and the send waits only for a create request already on the
|
|
20
|
+
* wire — the one thing that could still take the slot from under it;
|
|
21
|
+
* - one warm per workspace at a time, held here rather than in the panel,
|
|
22
|
+
* because the panel unmounts on minimise while its turns and warms run on.
|
|
23
|
+
*/
|
|
24
|
+
export declare const PREWARM_COOLDOWN_MS = 30000;
|
|
25
|
+
export interface PrewarmInput {
|
|
26
|
+
autoRouting: boolean;
|
|
27
|
+
autoOffered: boolean;
|
|
28
|
+
/** The active conversation, if any. */
|
|
29
|
+
active?: {
|
|
30
|
+
mode: AssistantMode;
|
|
31
|
+
routedBy?: "auto";
|
|
32
|
+
} | undefined;
|
|
33
|
+
selectedMode: AssistantMode;
|
|
34
|
+
autoReadMode: AssistantMode;
|
|
35
|
+
modes: readonly Pick<AssistantModeConfig, "id" | "writeCapable" | "requiresAdmin">[];
|
|
36
|
+
acknowledgedWriteModes: readonly AssistantMode[];
|
|
37
|
+
/** The role check that admin-only modes wait on (`adminModeAccessGate`). */
|
|
38
|
+
adminAccess: {
|
|
39
|
+
loading: boolean;
|
|
40
|
+
canUseAdminModes: boolean;
|
|
41
|
+
};
|
|
42
|
+
/** The message will be SPOKEN — a mic tap, not a keystroke. */
|
|
43
|
+
dictated: boolean;
|
|
44
|
+
/** Any turn in any conversation, read from the store (it outlives a remount). */
|
|
45
|
+
turnInFlight: boolean;
|
|
46
|
+
/** A warm is already running in this workspace. */
|
|
47
|
+
warming: boolean;
|
|
48
|
+
lastPrewarmAt: ReadonlyMap<AssistantMode, number>;
|
|
49
|
+
/** Modes whose last warm created a sandbox no send has used yet. */
|
|
50
|
+
unusedCreates: ReadonlySet<AssistantMode>;
|
|
51
|
+
now: number;
|
|
52
|
+
}
|
|
53
|
+
export interface PrewarmPlan {
|
|
54
|
+
mode: AssistantMode;
|
|
55
|
+
/**
|
|
56
|
+
* False: reuse only. A warm's creation nobody used yet is not repeated —
|
|
57
|
+
* without this, typing and clearing every 31s created a sandbox each time
|
|
58
|
+
* the last one expired, none of them ever used.
|
|
59
|
+
*/
|
|
60
|
+
mayCreate: boolean;
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Which sandbox a warm should prepare, or null. Pure, so the rules are tested
|
|
64
|
+
* rather than read. Every refusal mirrors a gate the SEND would apply — a warm
|
|
65
|
+
* must never provision what the send it anticipates would be refused.
|
|
66
|
+
*/
|
|
67
|
+
export declare function prewarmTarget(input: PrewarmInput): PrewarmPlan | null;
|
|
68
|
+
/** How a warm ended. It never rejects: a failed warm is the send's problem. */
|
|
69
|
+
export interface WarmOutcome {
|
|
70
|
+
ok: boolean;
|
|
71
|
+
/** The sandbox it left ready, when ok. */
|
|
72
|
+
sandboxId?: string;
|
|
73
|
+
/** It created, probed or adopted — not merely trusted a fresh proof. */
|
|
74
|
+
didWork: boolean;
|
|
75
|
+
/**
|
|
76
|
+
* What it proved dead. Carried to the send that joins, because the warm's
|
|
77
|
+
* own record of it lives in the panel that STARTED it — which may be gone
|
|
78
|
+
* (the panel unmounts on minimise; a reopened one joins the same warm).
|
|
79
|
+
*/
|
|
80
|
+
dead?: readonly string[];
|
|
81
|
+
}
|
|
82
|
+
/** Thrown inside a warm to stop it where it stands. Never surfaces. */
|
|
83
|
+
export declare class WarmCancelled extends Error {
|
|
84
|
+
constructor(reason: "cancelled" | "no-create");
|
|
85
|
+
}
|
|
86
|
+
export interface WarmHandle {
|
|
87
|
+
readonly workspaceId: string;
|
|
88
|
+
readonly mode: AssistantMode;
|
|
89
|
+
readonly mayCreate: boolean;
|
|
90
|
+
readonly signal: AbortSignal;
|
|
91
|
+
/** Sandboxes its probes proved dead — handed on in its outcome. */
|
|
92
|
+
readonly dead: string[];
|
|
93
|
+
/** The warm's latest progress step, so a send that joins can show it. */
|
|
94
|
+
step: AssistantTurnStage | null;
|
|
95
|
+
/** Progress forwarded to the send that joined, if one has. */
|
|
96
|
+
onStep: ((step: AssistantTurnStage) => void) | null;
|
|
97
|
+
/** Call immediately before the CreateSandbox request; call the result when it settles. */
|
|
98
|
+
beginCreate(): () => void;
|
|
99
|
+
/** Settle the warm. Idempotent. */
|
|
100
|
+
finish(outcome: WarmOutcome): void;
|
|
101
|
+
}
|
|
102
|
+
/** This workspace's warm state, shaped for `prewarmTarget`. */
|
|
103
|
+
export declare function warmState(workspaceId: string): Pick<PrewarmInput, "warming" | "lastPrewarmAt" | "unusedCreates">;
|
|
104
|
+
/** Register a warm. The caller must have checked `prewarmTarget` first. */
|
|
105
|
+
export declare function startWarm(workspaceId: string, plan: PrewarmPlan, now: number): WarmHandle;
|
|
106
|
+
/** What a send learned from settling a warm (see `settleWarmBeforeSend`). */
|
|
107
|
+
export interface WarmSettlement {
|
|
108
|
+
/**
|
|
109
|
+
* `joined` — it waited for a warm that did the work; `joinedFailed` — it
|
|
110
|
+
* waited for one that failed (the wait still cost it); null — neither.
|
|
111
|
+
*/
|
|
112
|
+
joined: "joined" | "joinedFailed" | null;
|
|
113
|
+
/** The sandbox the warm proved ready, for the send's own readiness record. */
|
|
114
|
+
verified?: string;
|
|
115
|
+
/** Sandboxes the warm proved dead, for the send's own quarantine. */
|
|
116
|
+
dead: readonly string[];
|
|
117
|
+
}
|
|
118
|
+
/**
|
|
119
|
+
* What a send does about a warm before acquiring its own sandbox.
|
|
120
|
+
*
|
|
121
|
+
* - Same mode, still live: JOIN — mirror its progress, wait for it, and take
|
|
122
|
+
* over what it learned (the panel that started it may be gone).
|
|
123
|
+
* - Another mode — or a warm some earlier send already CANCELLED: cancel it
|
|
124
|
+
* (again, harmlessly), take it out of the registry so it blocks no one, and
|
|
125
|
+
* wait only while its create request is on the wire. Once that lands the
|
|
126
|
+
* sandbox is listed, so the send's own release step sees it; before it
|
|
127
|
+
* lands, a one-slot workspace would refuse the send. A cancelled warm is
|
|
128
|
+
* never joined: it can only end in failure, after a probe nobody needs.
|
|
129
|
+
*/
|
|
130
|
+
export declare function settleWarmBeforeSend(workspaceId: string, mode: AssistantMode, onStep: (step: AssistantTurnStage) => void): Promise<WarmSettlement>;
|
|
131
|
+
/**
|
|
132
|
+
* A send was served by `sandboxId` in this workspace and mode: was that a
|
|
133
|
+
* warm's work? True at most once per warmed sandbox, so "hit" means the warm
|
|
134
|
+
* saved THIS turn time — not every later turn on the same sandbox.
|
|
135
|
+
*/
|
|
136
|
+
export declare function consumeWarm(workspaceId: string, mode: AssistantMode, sandboxId: string): boolean;
|
|
137
|
+
/** Tests only: forget every warm. */
|
|
138
|
+
export declare function resetWarmsForTest(): void;
|
|
139
|
+
//# sourceMappingURL=prewarm.d.ts.map
|
|
@@ -0,0 +1 @@
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EAA6E;AAC7E,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,MAAM,EAAE,QAAQ,GAAG,cAAc,GAAG,IAAI,CAAC;IACzC,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,qEAAqE;IACrE,IAAI,EAAE,SAAS,MAAM,EAAE,CAAC;CACzB;AAED;;;;;;;;;;;GAWG;AACH,wBAAsB,oBAAoB,CACxC,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,aAAa,EACnB,MAAM,EAAE,CAAC,IAAI,EAAE,kBAAkB,KAAK,IAAI,GACzC,OAAO,CAAC,cAAc,CAAC,CAgCzB;AAED;;;;GAIG;AACH,wBAAgB,WAAW,CACzB,WAAW,EAAE,MAAM,EACnB,IAAI,EAAE,aAAa,EACnB,SAAS,EAAE,MAAM,GAChB,OAAO,CAGT;AAED,qCAAqC;AACrC,wBAAgB,iBAAiB,IAAI,IAAI,CAMxC"}
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import { modeRequiresConfirmWrites as e } from "./api.js";
|
|
2
|
+
import { adminOnlyModeSendRefusal as t } from "./modeCapabilities.js";
|
|
3
|
+
//#region src/shared/assistant/prewarm.ts
|
|
4
|
+
var n = 3e4;
|
|
5
|
+
function r(n) {
|
|
6
|
+
if (n.turnInFlight || n.warming) return null;
|
|
7
|
+
let r = n.autoRouting && n.autoOffered ? n.active?.routedBy === "auto" ? n.active.mode : n.autoReadMode : n.selectedMode, i = n.modes.find((e) => e.id === r);
|
|
8
|
+
if (!i) return null;
|
|
9
|
+
let a = i.writeCapable === !0 || e(r);
|
|
10
|
+
if (a && !n.acknowledgedWriteModes.includes(r) || a && n.dictated || t(i, n.adminAccess)) return null;
|
|
11
|
+
let o = n.lastPrewarmAt.get(r);
|
|
12
|
+
return o !== void 0 && n.now - o < 3e4 ? null : {
|
|
13
|
+
mode: r,
|
|
14
|
+
mayCreate: !n.unusedCreates.has(r)
|
|
15
|
+
};
|
|
16
|
+
}
|
|
17
|
+
var i = class extends Error {
|
|
18
|
+
constructor(e) {
|
|
19
|
+
super(`pre-warm ${e}`), this.name = "WarmCancelled";
|
|
20
|
+
}
|
|
21
|
+
}, a = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Set(), c = /* @__PURE__ */ new Set(), l = (e, t) => `${e}\u0000${t}`;
|
|
22
|
+
function u(e) {
|
|
23
|
+
let t = `${e}\u0000`, n = /* @__PURE__ */ new Map();
|
|
24
|
+
for (let [e, r] of o) e.startsWith(t) && n.set(e.slice(t.length), r);
|
|
25
|
+
let r = /* @__PURE__ */ new Set();
|
|
26
|
+
for (let e of s) e.startsWith(t) && r.add(e.slice(t.length));
|
|
27
|
+
return {
|
|
28
|
+
warming: a.has(e),
|
|
29
|
+
lastPrewarmAt: n,
|
|
30
|
+
unusedCreates: r
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
function d(e, t, n) {
|
|
34
|
+
let r = new AbortController(), i = () => void 0, u = new Promise((e) => {
|
|
35
|
+
i = e;
|
|
36
|
+
}), d = !1, f = {
|
|
37
|
+
workspaceId: e,
|
|
38
|
+
mode: t.mode,
|
|
39
|
+
mayCreate: t.mayCreate,
|
|
40
|
+
signal: r.signal,
|
|
41
|
+
dead: [],
|
|
42
|
+
controller: r,
|
|
43
|
+
step: null,
|
|
44
|
+
onStep: null,
|
|
45
|
+
createLanded: Promise.resolve(),
|
|
46
|
+
done: u,
|
|
47
|
+
beginCreate() {
|
|
48
|
+
s.add(l(e, t.mode));
|
|
49
|
+
let n = () => void 0;
|
|
50
|
+
return f.createLanded = new Promise((e) => {
|
|
51
|
+
n = e;
|
|
52
|
+
}), n;
|
|
53
|
+
},
|
|
54
|
+
finish(t) {
|
|
55
|
+
d || (d = !0, t.ok && t.didWork && t.sandboxId && c.add(t.sandboxId), a.get(e) === f && a.delete(e), i(t));
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
return a.set(e, f), o.set(l(e, t.mode), n), f;
|
|
59
|
+
}
|
|
60
|
+
async function f(e, t, n) {
|
|
61
|
+
let r = a.get(e);
|
|
62
|
+
if (!r) return {
|
|
63
|
+
joined: null,
|
|
64
|
+
dead: []
|
|
65
|
+
};
|
|
66
|
+
if (r.mode === t && !r.signal.aborted) {
|
|
67
|
+
r.step && n(r.step), r.onStep = n;
|
|
68
|
+
let e = await r.done;
|
|
69
|
+
r.onStep = null;
|
|
70
|
+
let t = e.dead ?? [];
|
|
71
|
+
return e.ok ? {
|
|
72
|
+
joined: e.didWork ? "joined" : null,
|
|
73
|
+
...e.didWork && e.sandboxId ? { verified: e.sandboxId } : {},
|
|
74
|
+
dead: t
|
|
75
|
+
} : {
|
|
76
|
+
joined: "joinedFailed",
|
|
77
|
+
dead: t
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
return r.onStep === null ? (r.controller.abort(), a.get(e) === r && a.delete(e), await r.createLanded, {
|
|
81
|
+
joined: null,
|
|
82
|
+
dead: []
|
|
83
|
+
}) : (await r.createLanded, {
|
|
84
|
+
joined: null,
|
|
85
|
+
dead: []
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
function p(e, t, n) {
|
|
89
|
+
return s.delete(l(e, t)), c.delete(n);
|
|
90
|
+
}
|
|
91
|
+
function m() {
|
|
92
|
+
for (let e of a.values()) e.controller.abort();
|
|
93
|
+
a.clear(), o.clear(), s.clear(), c.clear();
|
|
94
|
+
}
|
|
95
|
+
//#endregion
|
|
96
|
+
export { n as PREWARM_COOLDOWN_MS, i as WarmCancelled, p as consumeWarm, r as prewarmTarget, m as resetWarmsForTest, f as settleWarmBeforeSend, d as startWarm, u as warmState };
|
|
@@ -12,12 +12,14 @@
|
|
|
12
12
|
* fails in ways that are worse to surface than a re-provision. So this does not
|
|
13
13
|
* remove the check — it stops repeating a check that just passed.
|
|
14
14
|
*
|
|
15
|
-
* ★ The TTL is deliberately far shorter than the sandbox's
|
|
16
|
-
*
|
|
17
|
-
*
|
|
18
|
-
*
|
|
19
|
-
*
|
|
20
|
-
*
|
|
15
|
+
* ★ The TTL is deliberately far shorter than the sandbox's usual lifetime —
|
|
16
|
+
* long turns extend it by 600s and the panel's heartbeat keeps it alive
|
|
17
|
+
* between turns — but it is NOT a guarantee: extensions clamp to the
|
|
18
|
+
* workspace/plan ceiling, so a sandbox can die at a fixed instant inside a
|
|
19
|
+
* window. The callers cover that: every failure invalidates, and a sandbox
|
|
20
|
+
* trusted from this cache that then fails at session setup is replaced or
|
|
21
|
+
* re-probed INSIDE the same attempt (`planTrustedSandboxFailure`, BOFF-7801).
|
|
22
|
+
* Such a death costs the failed setup request(s) — not the turn's retry.
|
|
21
23
|
*
|
|
22
24
|
* Correctness rests on the caller invalidating on failure. A cache that only
|
|
23
25
|
* ever gets written on success, and never cleared, would pin a dead sandbox and
|
|
@@ -42,4 +44,41 @@ export declare function createReadinessTracker(clock?: () => number): {
|
|
|
42
44
|
invalidate(sandboxId: string | null | undefined): void;
|
|
43
45
|
};
|
|
44
46
|
export type ReadinessTracker = ReturnType<typeof createReadinessTracker>;
|
|
47
|
+
/**
|
|
48
|
+
* ★ BOFF-7801: a sandbox trusted from this cache (no probe ran) failed at
|
|
49
|
+
* session setup. What now? Decided INSIDE the attempt, so the turn keeps its
|
|
50
|
+
* one retry for whatever comes after (final review of #266: routing a dead
|
|
51
|
+
* proof to attempt 2 spent that retry, and a replacement whose first start
|
|
52
|
+
* then failed lost a turn the always-probe code would have answered).
|
|
53
|
+
*
|
|
54
|
+
* - `rethrow` — the turn was cut off (a re-run could send a prompt they
|
|
55
|
+
* abandoned); a REFUSAL (rate limit, unauthorized, a permission or usage
|
|
56
|
+
* wall), which a probe or a new sandbox meets again and a probe would answer
|
|
57
|
+
* by quarantining a live sandbox; or the sandbox service could not reach the
|
|
58
|
+
* gateway to mint the sandbox's credentials ("proxy credentials not ready"):
|
|
59
|
+
* the sandbox is fine and a new one would fail the same way — the
|
|
60
|
+
* attempt-level retry handles it as before.
|
|
61
|
+
* - `check-network` — a TRANSPORT failure ("Failed to fetch"). It has two
|
|
62
|
+
* causes that read identically in the browser: the person's own network, or
|
|
63
|
+
* a dead sandbox's hop that hung until the load balancer answered without
|
|
64
|
+
* CORS headers. `planAfterTransportFailure` tells them apart.
|
|
65
|
+
* - `replace` — the error says the sandbox is GONE (not found, not running,
|
|
66
|
+
* unable to connect…). Quarantine it and provision now: no 90s probe of a
|
|
67
|
+
* dead container.
|
|
68
|
+
* - `reprobe` — anything else temporary: the gap the cache opened. Probe for
|
|
69
|
+
* real, as every turn did before the cache.
|
|
70
|
+
*/
|
|
71
|
+
export type TrustedSandboxFailurePlan = "rethrow" | "check-network" | "replace" | "reprobe";
|
|
72
|
+
export declare function planTrustedSandboxFailure(error: unknown, abandoned: boolean): TrustedSandboxFailurePlan;
|
|
73
|
+
/**
|
|
74
|
+
* A transport failure at session create: the person's network, or the
|
|
75
|
+
* sandbox's? Ask the GATEWAY something that never touches the sandbox.
|
|
76
|
+
*
|
|
77
|
+
* - offline, or the gateway is unreachable too → `rethrow`: the sandbox may be
|
|
78
|
+
* fine, and a probe over the same outage would quarantine it — and the next
|
|
79
|
+
* turn would stop it;
|
|
80
|
+
* - the gateway answers (even with an error of its own) → `reprobe`: the
|
|
81
|
+
* network is up, so the sandbox hop is what failed.
|
|
82
|
+
*/
|
|
83
|
+
export declare function planAfterTransportFailure(askGateway: () => Promise<unknown>): Promise<"rethrow" | "reprobe">;
|
|
45
84
|
//# sourceMappingURL=sandboxReadiness.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sandboxReadiness.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/sandboxReadiness.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"sandboxReadiness.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/sandboxReadiness.ts"],"names":[],"mappings":"AAIA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,+DAA+D;AAC/D,eAAO,MAAM,oBAAoB,QAAS,CAAC;AAE3C;;;GAGG;AACH,wBAAgB,kBAAkB,CAChC,cAAc,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACzC,GAAG,EAAE,MAAM,EACX,KAAK,GAAE,MAA6B,GACnC,OAAO,CAKT;AAaD,wBAAgB,sBAAsB,CAAC,KAAK,GAAE,MAAM,MAAiB;IAIjE,kEAAkE;uBAC/C,MAAM,GAAG,OAAO;IAGnC,iCAAiC;4BACT,MAAM,GAAG,IAAI;IAKrC;;;OAGG;0BACmB,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,IAAI;EAIzD;AAED,MAAM,MAAM,gBAAgB,GAAG,UAAU,CAAC,OAAO,sBAAsB,CAAC,CAAC;AAEzE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,MAAM,yBAAyB,GACjC,SAAS,GACT,eAAe,GACf,SAAS,GACT,SAAS,CAAC;AAEd,wBAAgB,yBAAyB,CACvC,KAAK,EAAE,OAAO,EACd,SAAS,EAAE,OAAO,GACjB,yBAAyB,CAU3B;AAED;;;;;;;;;GASG;AACH,wBAAsB,yBAAyB,CAC7C,UAAU,EAAE,MAAM,OAAO,CAAC,OAAO,CAAC,GACjC,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC,CAShC"}
|
|
@@ -1,22 +1,36 @@
|
|
|
1
|
+
import { isTransportError as e } from "../utils/backendErrors.js";
|
|
2
|
+
import { classifyTurnFailure as t } from "./turnOutcome.js";
|
|
3
|
+
import { isNeverRecoverableAssistantError as n, isRecoverableAssistantError as r } from "./transportErrors.js";
|
|
1
4
|
//#region src/shared/assistant/sandboxReadiness.ts
|
|
2
|
-
var
|
|
3
|
-
function
|
|
4
|
-
return
|
|
5
|
+
var i = 6e4;
|
|
6
|
+
function a(e, t, n = i) {
|
|
7
|
+
return e == null || e > t ? !1 : t - e < n;
|
|
5
8
|
}
|
|
6
|
-
var
|
|
7
|
-
function
|
|
8
|
-
let
|
|
9
|
+
var o = 32;
|
|
10
|
+
function s(e = Date.now) {
|
|
11
|
+
let t = /* @__PURE__ */ new Map();
|
|
9
12
|
return {
|
|
10
13
|
isFresh(n) {
|
|
11
|
-
return t
|
|
14
|
+
return a(t.get(n), e());
|
|
12
15
|
},
|
|
13
|
-
markVerified(
|
|
14
|
-
|
|
16
|
+
markVerified(n) {
|
|
17
|
+
t.size >= o && !t.has(n) && t.clear(), t.set(n, e());
|
|
15
18
|
},
|
|
16
19
|
invalidate(e) {
|
|
17
|
-
e &&
|
|
20
|
+
e && t.delete(e);
|
|
18
21
|
}
|
|
19
22
|
};
|
|
20
23
|
}
|
|
24
|
+
function c(i, a) {
|
|
25
|
+
return a || n(i) ? "rethrow" : e(i) ? "check-network" : (i instanceof Error ? i.message : String(i)).toLowerCase().includes("proxy credentials not ready") ? "rethrow" : r(i) ? "replace" : t(i).kind === "temporary" ? "reprobe" : "rethrow";
|
|
26
|
+
}
|
|
27
|
+
async function l(t) {
|
|
28
|
+
if (typeof navigator < "u" && navigator.onLine === !1) return "rethrow";
|
|
29
|
+
try {
|
|
30
|
+
return await t(), "reprobe";
|
|
31
|
+
} catch (t) {
|
|
32
|
+
return e(t) ? "rethrow" : "reprobe";
|
|
33
|
+
}
|
|
34
|
+
}
|
|
21
35
|
//#endregion
|
|
22
|
-
export {
|
|
36
|
+
export { i as SANDBOX_READY_TTL_MS, s as createReadinessTracker, a as isRecentlyVerified, l as planAfterTransportFailure, c as planTrustedSandboxFailure };
|
|
@@ -35,5 +35,7 @@
|
|
|
35
35
|
* the multimodal parts?
|
|
36
36
|
*/
|
|
37
37
|
export declare function isMultimodalBodyRejection(error: unknown): boolean;
|
|
38
|
+
/** A refusal (rate limit, unauthorized) — never cured by another sandbox or a probe. */
|
|
39
|
+
export declare function isNeverRecoverableAssistantError(error: unknown): boolean;
|
|
38
40
|
export declare function isRecoverableAssistantError(error: unknown): boolean;
|
|
39
41
|
//# sourceMappingURL=transportErrors.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transportErrors.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/transportErrors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAmCH;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CASjE;AA6CD,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CASnE"}
|
|
1
|
+
{"version":3,"file":"transportErrors.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/transportErrors.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AAmCH;;;GAGG;AACH,wBAAgB,yBAAyB,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CASjE;AA6CD,wFAAwF;AACxF,wBAAgB,gCAAgC,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAKxE;AAED,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CASnE"}
|
|
@@ -45,8 +45,12 @@ var r = [
|
|
|
45
45
|
"able to access the url"
|
|
46
46
|
];
|
|
47
47
|
function a(e) {
|
|
48
|
+
let t = (e instanceof Error ? e.message : String(e)).toLowerCase();
|
|
49
|
+
return r.some((e) => t.includes(e));
|
|
50
|
+
}
|
|
51
|
+
function o(e) {
|
|
48
52
|
let t = (e instanceof Error ? e.message : String(e)).toLowerCase();
|
|
49
53
|
return r.some((e) => t.includes(e)) ? !1 : i.some((e) => t.includes(e));
|
|
50
54
|
}
|
|
51
55
|
//#endregion
|
|
52
|
-
export { n as isMultimodalBodyRejection, a as isRecoverableAssistantError };
|
|
56
|
+
export { n as isMultimodalBodyRejection, a as isNeverRecoverableAssistantError, o as isRecoverableAssistantError };
|
|
@@ -101,6 +101,18 @@ export interface TurnAttemptFacts {
|
|
|
101
101
|
usedTools?: boolean;
|
|
102
102
|
/** A reuse probe failed — a dead sandbox cost time before a new one. */
|
|
103
103
|
deadSandboxProbe?: boolean;
|
|
104
|
+
/**
|
|
105
|
+
* A readiness proof vouched for the sandbox (no probe ran) and it then
|
|
106
|
+
* failed — how often the cache's window costs rather than saves.
|
|
107
|
+
*/
|
|
108
|
+
cacheProofFailed?: boolean;
|
|
109
|
+
/**
|
|
110
|
+
* A first-keystroke pre-warm and this attempt: `hit` — it had finished and
|
|
111
|
+
* served it, `joined` — the send waited for it and it served it,
|
|
112
|
+
* `joinedFailed` — the send waited for it and it FAILED (the wait is in the
|
|
113
|
+
* attempt's time with nothing else to explain it).
|
|
114
|
+
*/
|
|
115
|
+
prewarm?: "hit" | "joined" | "joinedFailed";
|
|
104
116
|
}
|
|
105
117
|
export interface TurnAttempt extends TurnAttemptFacts {
|
|
106
118
|
at: Partial<Record<TurnMilestone, number>>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"turnTimeline.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/turnTimeline.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAyDG;AAEH,eAAO,MAAM,eAAe,yTAqBlB,CAAC;AAEX,MAAM,MAAM,aAAa,GAAG,CAAC,OAAO,eAAe,CAAC,CAAC,MAAM,CAAC,CAAC;AAiB7D;;;;;;;;;;;;;GAaG;AACH,MAAM,MAAM,WAAW,GAAG,MAAM,GAAG,aAAa,GAAG,QAAQ,GAAG,SAAS,GAAG,MAAM,CAAC;AAEjF;;;;;;;;;GASG;AACH,MAAM,MAAM,mBAAmB,GAC3B,UAAU,GACV,UAAU,GACV,SAAS,GACT,QAAQ,GACR,SAAS,CAAC;AAEd,MAAM,WAAW,cAAc;IAC7B,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;IAChB,6CAA6C;IAC7C,QAAQ,EAAE,MAAM,CAAC;IACjB,MAAM,EAAE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AE,EAClC,OAAO,EAAE,CAAC,QAAQ,EAAE,YAAY,KAAK,MAAM,EAC3C,OAAO,GAAE,CAAC,QAAQ,EAAE,YAAY,KAAK,OAA0B,GAC9D,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC,CAAC,CA6BhE"}
|
|
@@ -91,7 +91,7 @@ function d(e, t) {
|
|
|
91
91
|
let n = i.get(e);
|
|
92
92
|
if (!n) return;
|
|
93
93
|
let r = !1;
|
|
94
|
-
t.runtime !== void 0 && n.runtime === void 0 && (n.runtime = t.runtime, r = !0), t.usedTools !== void 0 && n.usedTools === void 0 && (n.usedTools = t.usedTools, r = !0), t.deadSandboxProbe !== void 0 && n.deadSandboxProbe === void 0 && (n.deadSandboxProbe = t.deadSandboxProbe, r = !0), t.outcome !== void 0 && n.outcome === void 0 && (n.outcome = t.outcome, r = !0), r && c(n);
|
|
94
|
+
t.runtime !== void 0 && n.runtime === void 0 && (n.runtime = t.runtime, r = !0), t.usedTools !== void 0 && n.usedTools === void 0 && (n.usedTools = t.usedTools, r = !0), t.deadSandboxProbe !== void 0 && n.deadSandboxProbe === void 0 && (n.deadSandboxProbe = t.deadSandboxProbe, r = !0), t.cacheProofFailed !== void 0 && n.cacheProofFailed === void 0 && (n.cacheProofFailed = t.cacheProofFailed, r = !0), t.prewarm !== void 0 && n.prewarm === void 0 && (n.prewarm = t.prewarm, r = !0), t.outcome !== void 0 && n.outcome === void 0 && (n.outcome = t.outcome, r = !0), r && c(n);
|
|
95
95
|
}
|
|
96
96
|
function f(e, n = a()) {
|
|
97
97
|
let r = i.get(e);
|
|
@@ -104,7 +104,7 @@ function f(e, n = a()) {
|
|
|
104
104
|
let t = r.at[e];
|
|
105
105
|
t !== void 0 && (o.at[e] = t, delete r.at[e]);
|
|
106
106
|
}
|
|
107
|
-
r.runtime !== void 0 && (o.runtime = r.runtime), r.usedTools !== void 0 && (o.usedTools = r.usedTools), r.deadSandboxProbe !== void 0 && (o.deadSandboxProbe = r.deadSandboxProbe), delete r.runtime, delete r.usedTools, delete r.deadSandboxProbe, r.attempts = [...r.attempts ?? [], o], r.retried = !0, c(r);
|
|
107
|
+
r.runtime !== void 0 && (o.runtime = r.runtime), r.usedTools !== void 0 && (o.usedTools = r.usedTools), r.deadSandboxProbe !== void 0 && (o.deadSandboxProbe = r.deadSandboxProbe), r.cacheProofFailed !== void 0 && (o.cacheProofFailed = r.cacheProofFailed), r.prewarm !== void 0 && (o.prewarm = r.prewarm), delete r.runtime, delete r.usedTools, delete r.deadSandboxProbe, delete r.cacheProofFailed, delete r.prewarm, r.attempts = [...r.attempts ?? [], o], r.retried = !0, c(r);
|
|
108
108
|
}
|
|
109
109
|
function p(e) {
|
|
110
110
|
let t = i.get(e);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantChatArea.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/ui/AssistantChatArea.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,EAAE,EACR,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"AssistantChatArea.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/ui/AssistantChatArea.tsx"],"names":[],"mappings":"AAAA,OAAO,EAML,KAAK,EAAE,EACR,MAAM,OAAO,CAAC;AA6Hf,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AA6DvE;;;;;GAKG;AACH,MAAM,WAAW,sBAAsB;IACrC,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB;;;;;;;;;;;;OAYG;IACH,WAAW,CAAC,EAAE,oBAAoB,CAAC;CACpC;AAED,eAAO,MAAM,iBAAiB,EAAE,EAAE,CAAC,sBAAsB,CAygGxD,CAAC"}
|