@burdenoff/fe-libs 2026.925.5 → 2026.925.7
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/chrome/MobileTabBar.js +6 -6
- package/dist/chrome/ProductSideNav.js +9 -9
- package/dist/chrome/sideNavigation/useSideNavigationState.js +3 -3
- package/dist/chrome.js +8 -8
- package/dist/shared/assistant/autoRouting.d.ts +3 -0
- package/dist/shared/assistant/autoRouting.d.ts.map +1 -1
- package/dist/shared/assistant/autoRouting.js +1 -1
- package/dist/shared/assistant/conversation.d.ts +20 -0
- package/dist/shared/assistant/conversation.d.ts.map +1 -1
- package/dist/shared/assistant/i18nManifest.d.ts +11 -0
- package/dist/shared/assistant/i18nManifest.d.ts.map +1 -1
- package/dist/shared/assistant/i18nManifest.js +11 -0
- package/dist/shared/assistant/index.d.ts +3 -0
- package/dist/shared/assistant/index.d.ts.map +1 -1
- package/dist/shared/assistant/localUiCommandCopy.d.ts +26 -0
- package/dist/shared/assistant/localUiCommandCopy.d.ts.map +1 -0
- package/dist/shared/assistant/localUiCommandCopy.js +37 -0
- package/dist/shared/assistant/localUiCommands.d.ts +124 -0
- package/dist/shared/assistant/localUiCommands.d.ts.map +1 -0
- package/dist/shared/assistant/localUiCommands.js +173 -0
- 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/product.d.ts +13 -1
- package/dist/shared/assistant/product.d.ts.map +1 -1
- package/dist/shared/assistant/product.js +8 -6
- package/dist/shared/assistant/turnTimeline.d.ts +7 -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 +663 -482
- package/dist/shared/assistant/ui/AssistantMessageItem.d.ts +6 -0
- package/dist/shared/assistant/ui/AssistantMessageItem.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantMessageItem.js +3 -3
- package/dist/shared/assistant/ui/AssistantMessageList.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantMessageList.js +14 -7
- package/dist/shared/assistant/ui/AssistantSpeechProvider.d.ts +9 -0
- package/dist/shared/assistant/ui/AssistantSpeechProvider.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantSpeechProvider.js +243 -196
- 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/ui/useVoiceSession.d.ts.map +1 -1
- package/dist/shared/assistant/ui/useVoiceSession.js +44 -43
- package/dist/shared/assistant/voice/captionText.d.ts.map +1 -1
- package/dist/shared/assistant/voice/captionText.js +1 -1
- package/dist/shared/assistant/voice/speakableText.d.ts.map +1 -1
- package/dist/shared/assistant/voice/speakableText.js +63 -62
- package/dist/shared/hooks/shell/index.d.ts +1 -1
- package/dist/shared/hooks/shell/index.d.ts.map +1 -1
- package/dist/shared/providers/shell/ThemeProvider.d.ts +6 -0
- package/dist/shared/providers/shell/ThemeProvider.d.ts.map +1 -1
- package/dist/shared/providers/shell/ThemeProvider.js +28 -25
- package/dist/shared-assistant.js +17 -14
- package/dist/shared-hooks-shell.js +12 -12
- package/package.json +1 -1
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
//#region src/shared/assistant/localUiCommands.ts
|
|
2
|
+
var e = /^(?:(?:hey|hi|so|now|and|then|you know|just|actually|basically)\b ?|(?:please|pls|kindly)\b ?|(?:can|could|would|will) (?:you|u)\b(?: please)? ?|i (?:want|would like|d like)(?: you)?(?: to)?\b ?|let s\b ?)/, t = /^(?:(?:hey|hi|so|ok|okay)\W+)*(?:please\W+)?(?:can|could|would|will) (?:you|u)\b/i, n = / (?:please|pls|for me|now|thanks|thank you|right now)$/;
|
|
3
|
+
function r(e) {
|
|
4
|
+
return e.normalize("NFKC").toLowerCase().replace(/&/g, " and ").replace(/[^\p{L}\p{N}\s]/gu, " ").replace(/\s+/g, " ").trim();
|
|
5
|
+
}
|
|
6
|
+
function i(t, i = {}) {
|
|
7
|
+
let a = r(t).replace(/\b(?:um+|uh+|erm|er|hmm+)\b/g, " ").replace(/\s+/g, " ").replace(/\b(\w+)(?: \1\b)+/g, "$1").trim();
|
|
8
|
+
for (;;) {
|
|
9
|
+
let t = a.replace(e, "");
|
|
10
|
+
if (i.keepEnding || (t = t.replace(n, "")), t = t.trim(), t === a) return a;
|
|
11
|
+
a = t;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
var a = {
|
|
15
|
+
light: {
|
|
16
|
+
kind: "family",
|
|
17
|
+
family: "light"
|
|
18
|
+
},
|
|
19
|
+
dark: {
|
|
20
|
+
kind: "family",
|
|
21
|
+
family: "dark"
|
|
22
|
+
},
|
|
23
|
+
forest: {
|
|
24
|
+
kind: "named",
|
|
25
|
+
theme: "forest"
|
|
26
|
+
},
|
|
27
|
+
ocean: {
|
|
28
|
+
kind: "named",
|
|
29
|
+
theme: "ocean"
|
|
30
|
+
},
|
|
31
|
+
sunset: {
|
|
32
|
+
kind: "named",
|
|
33
|
+
theme: "sunset"
|
|
34
|
+
},
|
|
35
|
+
"high contrast": {
|
|
36
|
+
kind: "named",
|
|
37
|
+
theme: "high-contrast"
|
|
38
|
+
},
|
|
39
|
+
highcontrast: {
|
|
40
|
+
kind: "named",
|
|
41
|
+
theme: "high-contrast"
|
|
42
|
+
},
|
|
43
|
+
system: {
|
|
44
|
+
kind: "named",
|
|
45
|
+
theme: "system"
|
|
46
|
+
},
|
|
47
|
+
device: {
|
|
48
|
+
kind: "named",
|
|
49
|
+
theme: "system"
|
|
50
|
+
},
|
|
51
|
+
os: {
|
|
52
|
+
kind: "named",
|
|
53
|
+
theme: "system"
|
|
54
|
+
}
|
|
55
|
+
}, o = "(light|dark|forest|ocean|sunset|high contrast|highcontrast|system|device)", s = "(?:(?:the|my) )?(?:(?:app|ui|screen|display|interface|site) )?(?:theme|colou?r scheme|colou?r mode|appearance)", c = "(mode|theme|colou?r scheme|colou?r mode|appearance)", l = "(?:switch|change|set|turn|put|make|flip)", u = [
|
|
56
|
+
{ pattern: RegExp(`^(?:${l}(?: (?:over|back))? (?:to|into) |go (?:back )?to |(?:turn|switch) on |(?:use|enable|activate|apply|try|turn|switch|set) )?(?:(?:the|a) )?${o} ${c}(?: on)?$`) },
|
|
57
|
+
{ pattern: RegExp(`^${l} ${s} (?:to|into|back to) (?:(?:the|a) )?${o}(?: ${c})?$`) },
|
|
58
|
+
{ pattern: /^(?:switch|change|go)(?: back)? to (light|dark)()$/ },
|
|
59
|
+
{
|
|
60
|
+
pattern: RegExp(`^(?:(?:turn|switch) off|disable|deactivate|exit|leave) (?:the )?(light|dark) ${c}$`),
|
|
61
|
+
invert: !0
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
pattern: RegExp(`^(?:(?:turn|switch|set) )?(?:the )?(light|dark) ${c} off$`),
|
|
65
|
+
invert: !0
|
|
66
|
+
},
|
|
67
|
+
{ pattern: /^(?:set|make|change) (?:the |my )?(?:theme|appearance) (?:to )?(?:follow|match|use) (?:my|the) (device|system|os)()(?: (?:theme|appearance))?$/ },
|
|
68
|
+
{ pattern: /^(?:follow|match|use) (?:my|the) (device|system|os)() (?:theme|appearance)$/ },
|
|
69
|
+
{ pattern: /^(?:turn on|switch on|enable|use|activate|switch to) (?:the )?(high contrast|highcontrast)()$/ }
|
|
70
|
+
];
|
|
71
|
+
function d(e) {
|
|
72
|
+
for (let { pattern: t, invert: n } of u) {
|
|
73
|
+
let r = t.exec(e);
|
|
74
|
+
if (!r) continue;
|
|
75
|
+
let i = a[r[1] ?? ""];
|
|
76
|
+
if (i) return i.kind === "named" && i.theme === "system" && r[2] === "mode" ? null : n ? i.kind === "family" ? {
|
|
77
|
+
kind: "family",
|
|
78
|
+
family: i.family === "dark" ? "light" : "dark"
|
|
79
|
+
} : null : i;
|
|
80
|
+
}
|
|
81
|
+
return null;
|
|
82
|
+
}
|
|
83
|
+
var f = /^(?:(?:(?:go|navigate|take me|bring me|jump|head|get me|move|switch)(?: back| over)?|back) (?:to|too)|open(?: up)?|(?:pull|bring) up|visit|show me)\s+(.+)$/, p = /^(?:the )?(.+) (?:page|screen)$/, m = /(?:^| )(?:tasks?|issues?|tickets?|orders?|invoices?|alerts?|requests?|jobs?|incidents?|bugs?|cases?|deals?|items?|questions?|sessions?|positions?|pull requests?|prs?|work orders?|approvals?|actions?|applications?)$/, h = /^(?:ai|a i|api|a p i|id|data|source|access|banking|graph|search|telemetry|stack|house|field|fields|space|market|mic)$/, g = / (?:page|screen|section|tab)$/;
|
|
84
|
+
function _(e) {
|
|
85
|
+
let t = /* @__PURE__ */ new Map(), n = (e, n) => {
|
|
86
|
+
if (!e) return;
|
|
87
|
+
let r = t.get(e) ?? [];
|
|
88
|
+
r.some((e) => e.path === n.path) || r.push(n), t.set(e, r);
|
|
89
|
+
};
|
|
90
|
+
for (let t of e) {
|
|
91
|
+
let e = r(t.label);
|
|
92
|
+
n(e, t), t.context && n(`${r(t.context)} ${e}`, t), t.group && n(`${r(t.group)} ${e}`, t);
|
|
93
|
+
}
|
|
94
|
+
for (let [e, r] of [...t]) for (let t of r) n(`\u0000${e.replace(/ /g, "")}`, t);
|
|
95
|
+
return t;
|
|
96
|
+
}
|
|
97
|
+
function v(e, t) {
|
|
98
|
+
let n = f.exec(e) ?? p.exec(e);
|
|
99
|
+
if (!n) return null;
|
|
100
|
+
let r = n[1] ?? "", i = e.startsWith("show me "), a = /^open /.test(e), o = r.replace(/^(?:the|my|our) /, ""), s = o.replace(g, ""), c = s !== o || p.test(e);
|
|
101
|
+
if (i && !c || a && o === r && !c && (m.test(o) || h.test(o) || /^\w{1,3}$/.test(o))) return null;
|
|
102
|
+
let l = _(t), u = (e) => l.get(e) ?? l.get(`\u0000${e.replace(/ /g, "")}`), d = u(o) ?? (s === o ? void 0 : u(s));
|
|
103
|
+
return !d || d.length === 0 ? null : d.length === 1 ? {
|
|
104
|
+
kind: "navigate",
|
|
105
|
+
destination: d[0]
|
|
106
|
+
} : {
|
|
107
|
+
kind: "choose-destination",
|
|
108
|
+
query: s,
|
|
109
|
+
candidates: d
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
function y(e, n, r = {}) {
|
|
113
|
+
let a = e.normalize("NFKC").trim();
|
|
114
|
+
if (/[\p{Extended_Pictographic}\p{So}]/u.test(a) || /(?:^|\s)>?[:;=][-'^]?[()[\]/\\|pPdDoO3*@$]+(?=\s|$)/.test(a) || /(?:^|\s)(?:xD|XD|-_-|T_T|<\/?3)(?=\s|$)/.test(a) || /[?¿؟][^\p{L}\p{N}]*$/u.test(a) && !t.test(a)) return null;
|
|
115
|
+
let o = i(e);
|
|
116
|
+
if (!o || o.length > 80) return null;
|
|
117
|
+
let s = d(o);
|
|
118
|
+
return s ? r.themeWords === "mode-only" && /\b(?:theme|appearance|colou?r scheme)\b/.test(o) && !/\b(?:app|ui|interface)\b/.test(o) ? null : {
|
|
119
|
+
kind: "theme",
|
|
120
|
+
request: s
|
|
121
|
+
} : v(i(e, { keepEnding: !0 }), n) ?? v(o, n);
|
|
122
|
+
}
|
|
123
|
+
var b = /^__nav_more__:/;
|
|
124
|
+
function x(e, t) {
|
|
125
|
+
let n = [];
|
|
126
|
+
for (let r of e) {
|
|
127
|
+
let e = b.test(r.id);
|
|
128
|
+
!e && r.path.startsWith("/") && !r.path.startsWith("//") && r.label.trim() && n.push({
|
|
129
|
+
id: r.id,
|
|
130
|
+
label: r.label,
|
|
131
|
+
path: r.path,
|
|
132
|
+
...t ? { context: t } : {},
|
|
133
|
+
...r.group ? { group: r.group } : {}
|
|
134
|
+
}), r.children?.length && n.push(...x(r.children, e ? t : r.label));
|
|
135
|
+
}
|
|
136
|
+
return n;
|
|
137
|
+
}
|
|
138
|
+
function S(e, t) {
|
|
139
|
+
return e.kind === "family" ? {
|
|
140
|
+
alreadyApplied: t.resolvedTheme === e.family,
|
|
141
|
+
mode: e.family
|
|
142
|
+
} : {
|
|
143
|
+
alreadyApplied: t.mode === e.theme,
|
|
144
|
+
mode: e.theme
|
|
145
|
+
};
|
|
146
|
+
}
|
|
147
|
+
function C(e, t) {
|
|
148
|
+
let n = (e) => {
|
|
149
|
+
let [t = ""] = e.split("#"), [n = "", r = ""] = t.split("?"), i = n.length > 1 ? n.replace(/\/+$/, "") : n, a = new URLSearchParams(r);
|
|
150
|
+
return a.sort(), {
|
|
151
|
+
pathname: i,
|
|
152
|
+
query: a.toString()
|
|
153
|
+
};
|
|
154
|
+
}, r = n(e), i = n(t);
|
|
155
|
+
return r.pathname === i.pathname ? r.query === "" || r.query === i.query : !1;
|
|
156
|
+
}
|
|
157
|
+
function w(e, t, n) {
|
|
158
|
+
return C(e.path, t) ? e.path.includes("?") ? !0 : !n.some((n) => n.path !== e.path && n.path.includes("?") && T(n.path, t)) : !1;
|
|
159
|
+
}
|
|
160
|
+
function T(e, t) {
|
|
161
|
+
let n = (e) => {
|
|
162
|
+
let [t = ""] = e.split("#"), [n = "", r = ""] = t.split("?");
|
|
163
|
+
return {
|
|
164
|
+
pathname: n.length > 1 ? n.replace(/\/+$/, "") : n,
|
|
165
|
+
params: new URLSearchParams(r)
|
|
166
|
+
};
|
|
167
|
+
}, r = n(e), i = n(t);
|
|
168
|
+
if (r.pathname !== i.pathname) return !1;
|
|
169
|
+
for (let [e, t] of r.params) if (!i.params.getAll(e).includes(t)) return !1;
|
|
170
|
+
return !0;
|
|
171
|
+
}
|
|
172
|
+
//#endregion
|
|
173
|
+
export { w as isAlreadyThere, C as isCurrentPath, y as matchLocalUiCommand, x as navDestinations, i as normaliseUtterance, S as planThemeChange };
|
|
@@ -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 @@
|
|
|
1
|
+
{"version":3,"file":"prewarm.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/prewarm.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAE9E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,eAAO,MAAM,mBAAmB,QAAS,CAAC;AAE1C,MAAM,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a,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 };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { LocalUiCommandOptions } from './localUiCommands';
|
|
1
2
|
import { ReactNode } from 'react';
|
|
2
3
|
import { AssistantModeConfig } from './conversation';
|
|
3
4
|
import { AssistantMode, PageContext } from './types';
|
|
@@ -96,6 +97,17 @@ export interface AssistantProductCapabilities {
|
|
|
96
97
|
attachments: string;
|
|
97
98
|
artifacts: string;
|
|
98
99
|
};
|
|
100
|
+
/**
|
|
101
|
+
* How the panel reads a UI command it carries out itself (BOFF-7802).
|
|
102
|
+
*
|
|
103
|
+
* ★ Irreducible: only the product knows whether its CONTENT has themes of
|
|
104
|
+
* its own. Where it does — a dashboard builder, a document designer — "use
|
|
105
|
+
* the dark theme" is about the content, and must reach the model rather than
|
|
106
|
+
* change the app. Shared code cannot tell, and the default (`any`) is right
|
|
107
|
+
* for every product whose content has none. `{ themeWords: "mode-only" }`
|
|
108
|
+
* keeps "<name> mode" and the app's own theme ("change the app theme").
|
|
109
|
+
*/
|
|
110
|
+
localUiCommands?: LocalUiCommandOptions;
|
|
99
111
|
}
|
|
100
112
|
export interface AssistantProductValue extends AssistantProductCapabilities {
|
|
101
113
|
/**
|
|
@@ -113,7 +125,7 @@ export interface AssistantProductProviderProps extends AssistantProductCapabilit
|
|
|
113
125
|
* Mount once, above the assistant. Everything below can ask what product it is
|
|
114
126
|
* running inside and what that product offers.
|
|
115
127
|
*/
|
|
116
|
-
export declare function AssistantProductProvider({ product, modes, describeCurrentPage, gatherPageContext, buildPrompt, reportTokenUsage, storageFolders, children, }: AssistantProductProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
128
|
+
export declare function AssistantProductProvider({ product, modes, describeCurrentPage, gatherPageContext, buildPrompt, reportTokenUsage, storageFolders, localUiCommands, children, }: AssistantProductProviderProps): import("react/jsx-runtime").JSX.Element;
|
|
117
129
|
/** The product in force, or null when no provider is mounted. */
|
|
118
130
|
export declare function useAssistantProductOrNull(): AssistantProductValue | null;
|
|
119
131
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"product.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/product.tsx"],"names":[],"mappings":"AAAA,OAAO,EAA2D,KAAK,SAAS,EAAE,MAAM,OAAO,CAAC;AAEhG,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAC1D,OAAO,KAAK,EAAE,aAAa,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAE1D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAM,WAAW,4BAA4B;IAC3C;;;;;;OAMG;IACH,KAAK,EAAE,SAAS,mBAAmB,EAAE,CAAC;IACtC;;;;;;;;OAQG;IACH,mBAAmB,CAAC,EAAE,MAAM,MAAM,GAAG,IAAI,CAAC;IAC1C;;;;;;;OAOG;IACH,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QG;AACH,wBAAgB,mBAAmB,IAAI,qBAAqB,CAE3D;AAED;;;;;;;GAOG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,SAAS,mBAAmB,EAAE,EACrC,IAAI,EAAE,MAAM,GAAG,SAAS,GACvB,mBAAmB,GAAG,SAAS,CAEjC;AAED;;;;;;;GAOG;AACH,wBAAgB,0BAA0B,IAAI;IAC5C,WAAW,EAAE,MAAM,CAAC;IACpB,SAAS,EAAE,MAAM,CAAC;CACnB,CAYA;AAWD;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,GAAE,OAAc,GAAG,MAAM,GAAG,IAAI,CAqB3E"}
|
|
@@ -2,15 +2,16 @@ import { createContext as e, useContext as t, useEffect as n, useMemo as r, useS
|
|
|
2
2
|
import { jsx as a } from "react/jsx-runtime";
|
|
3
3
|
//#region src/shared/assistant/product.tsx
|
|
4
4
|
var o = e(null);
|
|
5
|
-
function s({ product: e, modes: t, describeCurrentPage: n, gatherPageContext: i, buildPrompt: s, reportTokenUsage: c, storageFolders: l,
|
|
6
|
-
let
|
|
5
|
+
function s({ product: e, modes: t, describeCurrentPage: n, gatherPageContext: i, buildPrompt: s, reportTokenUsage: c, storageFolders: l, localUiCommands: u, children: d }) {
|
|
6
|
+
let f = r(() => ({
|
|
7
7
|
product: e,
|
|
8
8
|
modes: t,
|
|
9
9
|
describeCurrentPage: n,
|
|
10
10
|
gatherPageContext: i,
|
|
11
11
|
buildPrompt: s,
|
|
12
12
|
reportTokenUsage: c,
|
|
13
|
-
storageFolders: l
|
|
13
|
+
storageFolders: l,
|
|
14
|
+
localUiCommands: u
|
|
14
15
|
}), [
|
|
15
16
|
e,
|
|
16
17
|
t,
|
|
@@ -18,11 +19,12 @@ function s({ product: e, modes: t, describeCurrentPage: n, gatherPageContext: i,
|
|
|
18
19
|
i,
|
|
19
20
|
s,
|
|
20
21
|
c,
|
|
21
|
-
l
|
|
22
|
+
l,
|
|
23
|
+
u
|
|
22
24
|
]);
|
|
23
25
|
return /* @__PURE__ */ a(o.Provider, {
|
|
24
|
-
value:
|
|
25
|
-
children:
|
|
26
|
+
value: f,
|
|
27
|
+
children: d
|
|
26
28
|
});
|
|
27
29
|
}
|
|
28
30
|
function c() {
|
|
@@ -106,6 +106,13 @@ export interface TurnAttemptFacts {
|
|
|
106
106
|
* failed — how often the cache's window costs rather than saves.
|
|
107
107
|
*/
|
|
108
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";
|
|
109
116
|
}
|
|
110
117
|
export interface TurnAttempt extends TurnAttemptFacts {
|
|
111
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,CA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AG,YAAY,GAAG,SAAS,CAYvE;AAED;;;;;;;GAOG;AACH,wBAAgB,gBAAgB,CAAC,QAAQ,EAAE,YAAY,GAAG,OAAO,CAEhE;AAED;;;GAGG;AACH,wBAAgB,sBAAsB,CACpC,SAAS,EAAE,SAAS,YAAY,EAAE,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.cacheProofFailed !== void 0 && n.cacheProofFailed === void 0 && (n.cacheProofFailed = t.cacheProofFailed, 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), r.cacheProofFailed !== void 0 && (o.cacheProofFailed = r.cacheProofFailed), delete r.runtime, delete r.usedTools, delete r.deadSandboxProbe, delete r.cacheProofFailed, 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;AAmIf,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AA+EvE;;;;;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,CA6qGxD,CAAC"}
|