@burdenoff/fe-libs 2026.916.1 → 2026.917.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/shared/assistant/api.d.ts +13 -3
- package/dist/shared/assistant/api.d.ts.map +1 -1
- package/dist/shared/assistant/api.js +8 -9
- package/dist/shared/assistant/conversation.d.ts +17 -0
- package/dist/shared/assistant/conversation.d.ts.map +1 -1
- package/dist/shared/assistant/createSandboxAssistantTransport.d.ts.map +1 -1
- package/dist/shared/assistant/createSandboxAssistantTransport.js +27 -27
- package/dist/shared/assistant/modeCapabilities.d.ts +12 -1
- package/dist/shared/assistant/modeCapabilities.d.ts.map +1 -1
- package/dist/shared/assistant/modeCapabilities.js +4 -0
- package/dist/shared/assistant/preview/AssistantPreviewOverlay.d.ts.map +1 -1
- package/dist/shared/assistant/progress.d.ts +38 -1
- package/dist/shared/assistant/progress.d.ts.map +1 -1
- package/dist/shared/assistant/progress.js +31 -17
- package/dist/shared/assistant/turnProgress.d.ts +2 -1
- package/dist/shared/assistant/turnProgress.d.ts.map +1 -1
- package/dist/shared/assistant/turnProgress.js +15 -15
- package/dist/shared/assistant/types.d.ts +12 -0
- package/dist/shared/assistant/types.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantChatArea.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantChatArea.js +111 -108
- package/dist/shared/assistant/ui/AssistantToolActivity.d.ts.map +1 -1
- package/dist/shared/assistant/ui/AssistantToolActivity.js +3 -3
- package/package.json +1 -1
|
@@ -32,7 +32,7 @@ export interface ExistingAssistantSandbox {
|
|
|
32
32
|
createdBy: string;
|
|
33
33
|
}
|
|
34
34
|
/** Pure reuse selector, kept separate so quarantine behavior is regression-testable. */
|
|
35
|
-
export declare function selectExistingAssistantSandbox(sandboxes: ExistingAssistantSandbox[], product: string, mode: AssistantMode,
|
|
35
|
+
export declare function selectExistingAssistantSandbox(sandboxes: ExistingAssistantSandbox[], product: string, mode: AssistantMode, _isProd: boolean, authContext: Pick<AssistantSandboxAuthContext, "userId">, excludedSandboxIds?: ReadonlySet<string>): string | null;
|
|
36
36
|
/**
|
|
37
37
|
* Does this mode write through the gateway, and therefore need the
|
|
38
38
|
* confirm-before-write gate?
|
|
@@ -88,7 +88,15 @@ export declare function approvePendingWrite(sandboxId: string, workspaceId: stri
|
|
|
88
88
|
* ★★ Pure and exported so the ownership rules below are testable without a
|
|
89
89
|
* network. Getting these wrong stops somebody else's container.
|
|
90
90
|
*/
|
|
91
|
-
export declare function selectSupersededAssistantSandboxes(sandboxes: readonly ExistingAssistantSandbox[], product: string, mode: AssistantMode,
|
|
91
|
+
export declare function selectSupersededAssistantSandboxes(sandboxes: readonly ExistingAssistantSandbox[], product: string, mode: AssistantMode, _isProd: boolean, authContext: AssistantSandboxAuthContext,
|
|
92
|
+
/**
|
|
93
|
+
* Sandboxes proven dead this session.
|
|
94
|
+
*
|
|
95
|
+
* ★ Same parameter, same position and same default as the reuse selector, so
|
|
96
|
+
* the two keep identical shapes — which is what makes "superseded is the
|
|
97
|
+
* complement of reusable" checkable by reading them side by side.
|
|
98
|
+
*/
|
|
99
|
+
excludedSandboxIds?: ReadonlySet<string>): string[];
|
|
92
100
|
/**
|
|
93
101
|
* Free the workspace's sandbox slot before provisioning a different mode.
|
|
94
102
|
*
|
|
@@ -115,7 +123,9 @@ export declare function selectSupersededAssistantSandboxes(sandboxes: readonly E
|
|
|
115
123
|
* the alternative is that the second mode never works at all — and the tab
|
|
116
124
|
* recovers by provisioning again on its next turn.
|
|
117
125
|
*/
|
|
118
|
-
export declare function releaseSupersededAssistantSandboxes(workspaceId: string, product: string, mode: AssistantMode, isProd: boolean, authContext: AssistantSandboxAuthContext
|
|
126
|
+
export declare function releaseSupersededAssistantSandboxes(workspaceId: string, product: string, mode: AssistantMode, isProd: boolean, authContext: AssistantSandboxAuthContext,
|
|
127
|
+
/** Sandboxes proven dead this session — released even if they still match. */
|
|
128
|
+
excludedSandboxIds?: ReadonlySet<string>): Promise<string[]>;
|
|
119
129
|
/**
|
|
120
130
|
* Terminalize a sandbox whose Cloudflare data plane was reaped while its DB
|
|
121
131
|
* record remained RUNNING. Invoked only for Cloudflare's exact connection-
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/api.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AA8BH,OAAO,KAAK,EACV,aAAa,EACb,mBAAmB,EACnB,mBAAmB,EACnB,2BAA2B,EAC3B,iBAAiB,EACjB,oBAAoB,EACpB,2BAA2B,EAC3B,YAAY,EACb,MAAM,SAAS,CAAC;AAMjB;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,wBAAgB,2BAA2B,CACzC,IAAI,EAAE,aAAa,GAAG,IAAI,GAAG,SAAS,GACrC,OAAO,CAET;AA2DD,wBAAsB,mBAAmB,CACvC,WAAW,EAAE,MAAM,EACnB,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,aAAa,EACnB,MAAM,EAAE,OAAO,EACf,WAAW,EAAE,2BAA2B,EACxC,kBAAkB,GAAE,WAAW,CAAC,MAAM,CAAa,GAClD,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAkBxB;AAED,MAAM,WAAW,wBAAwB;IACvC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IACzC,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,wFAAwF;AACxF,wBAAgB,8BAA8B,CAC5C,SAAS,EAAE,wBAAwB,EAAE,EACrC,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,aAAa,
|
|
1
|
+
{"version":3,"file":"api.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/api.ts"],"names":[],"mappings":"A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I,EAAE,aAAa,EACnB,WAAW,EAAE,2BAA2B,GACvC,OAAO,CAAC,iBAAiB,EAAE,CAAC,CAa9B;AAED,wBAAsB,mBAAmB,CACvC,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,IAAI,EAAE,aAAa,EACnB,WAAW,EAAE,2BAA2B,GACvC,OAAO,CAAC,oBAAoB,CAAC,CAe/B;AAED,wBAAsB,yBAAyB,CAC7C,SAAS,EAAE,MAAM,EACjB,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,YAAY,EAAE,MAAM;AACpB;;;;;;GAMG;AACH,IAAI,EAAE,aAAa,GAAG,SAAS,EAC/B,WAAW,EAAE,2BAA2B,GACvC,OAAO,CAAC,2BAA2B,CAAC,CAmBtC;AAED,wBAAsB,uBAAuB,CAC3C,WAAW,EAAE,MAAM,EACnB,WAAW,EAAE,2BAA2B,GACvC,OAAO,CAAC,OAAO,CAAC,CASlB;AAED,wBAAsB,2BAA2B,CAC/C,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EACjB,KAAK,EAAE,MAAM,GAAG,SAAS,EACzB,MAAM,EAAE;IAAE,KAAK,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAA;CAAE,EACzC,WAAW,EAAE,2BAA2B,GACvC,OAAO,CAAC,IAAI,CAAC,CAaf"}
|
|
@@ -40,7 +40,7 @@ async function S(n, r, i, o, s, c = /* @__PURE__ */ new Set()) {
|
|
|
40
40
|
})).getActiveSandboxes ?? [], r, i, o, s, c);
|
|
41
41
|
}
|
|
42
42
|
function C(e, t, n, r, i, a = /* @__PURE__ */ new Set()) {
|
|
43
|
-
return e.find((e) => !a.has(e.id) && (e.status === "RUNNING" || e.status === "PROVISIONING" || e.status === "PENDING") && e.template === "AI_BUILDER" && h(e, [n]) === n && (!i.userId || e.createdBy === i.userId) && e.metadata?.authStrategy === "sandbox-app-client-headers-v1" && e.metadata?.assistantProduct === t &&
|
|
43
|
+
return e.find((e) => !a.has(e.id) && (e.status === "RUNNING" || e.status === "PROVISIONING" || e.status === "PENDING") && e.template === "AI_BUILDER" && h(e, [n]) === n && (!i.userId || e.createdBy === i.userId) && e.metadata?.authStrategy === "sandbox-app-client-headers-v1" && e.metadata?.assistantProduct === t && (!w(n) || e.metadata?.confirmWrites === !0))?.id ?? null;
|
|
44
44
|
}
|
|
45
45
|
function w(e) {
|
|
46
46
|
return e === "api-calls";
|
|
@@ -190,24 +190,23 @@ async function M(e, t, n, r, i) {
|
|
|
190
190
|
let a = await x(e, t, `/write-confirmations/${encodeURIComponent(n)}/approve`, "POST", {}, r, i);
|
|
191
191
|
if (a?.approved !== !0) throw Error(typeof a?.error == "string" ? a.error : "The change could not be approved. It may have expired — ask the assistant to try again.");
|
|
192
192
|
}
|
|
193
|
-
function N(e, t, n, r, i) {
|
|
194
|
-
|
|
195
|
-
return e.filter((e) => e.metadata?.authStrategy === "sandbox-app-client-headers-v1" && e.metadata?.assistantProduct === t && (!i.userId || e.createdBy === i.userId) && !(h(e, [n]) === n && e.metadata?.imageTag === a)).map((e) => e.id);
|
|
193
|
+
function N(e, t, n, r, i, a = /* @__PURE__ */ new Set()) {
|
|
194
|
+
return i.userId ? e.filter((e) => e.metadata?.authStrategy === "sandbox-app-client-headers-v1" && e.createdBy === i.userId && !(!a.has(e.id) && e.metadata?.assistantProduct === t && h(e, [n]) === n)).map((e) => e.id) : [];
|
|
196
195
|
}
|
|
197
|
-
async function P(n, r, i, o, s) {
|
|
198
|
-
let
|
|
196
|
+
async function P(n, r, i, o, s, c = /* @__PURE__ */ new Set()) {
|
|
197
|
+
let l;
|
|
199
198
|
try {
|
|
200
|
-
|
|
199
|
+
l = N((await t({
|
|
201
200
|
query: a,
|
|
202
201
|
operationName: "GetActiveSandboxes",
|
|
203
202
|
variables: { context: e(n, s) },
|
|
204
203
|
workspaceId: n,
|
|
205
204
|
authContext: s
|
|
206
|
-
})).getActiveSandboxes ?? [], r, i, o, s);
|
|
205
|
+
})).getActiveSandboxes ?? [], r, i, o, s, c);
|
|
207
206
|
} catch {
|
|
208
207
|
return [];
|
|
209
208
|
}
|
|
210
|
-
return (await Promise.all(
|
|
209
|
+
return (await Promise.all(l.map(async (e) => {
|
|
211
210
|
try {
|
|
212
211
|
return await F(e, n, s), e;
|
|
213
212
|
} catch {
|
|
@@ -217,5 +217,22 @@ export interface AssistantModeConfig {
|
|
|
217
217
|
* only for the built-in `vibe-plugins`.
|
|
218
218
|
*/
|
|
219
219
|
continuesInBackground?: boolean;
|
|
220
|
+
/**
|
|
221
|
+
* Show this mode's narration for the WHOLE run, joined oldest first, rather
|
|
222
|
+
* than only the newest sandbox message (BC1, BOFF-7334).
|
|
223
|
+
*
|
|
224
|
+
* The agent grows text parts inside one message, so the answer grows while it
|
|
225
|
+
* stays in that message — and the instant it opens the next one, everything it
|
|
226
|
+
* narrated before vanishes from the bubble on the following poll. A mode whose
|
|
227
|
+
* turns build things (and whose narration carries the links to what it built)
|
|
228
|
+
* needs the whole account; a conversational mode does not.
|
|
229
|
+
*
|
|
230
|
+
* ★★ This changes what is STORED, not merely what is displayed: the completed
|
|
231
|
+
* turn persists this content as its answer, so Copy, Export and read-aloud all
|
|
232
|
+
* carry the running account too. Set it only where the build log IS the answer.
|
|
233
|
+
*
|
|
234
|
+
* Default: `false` for every mode, built-in or product-declared.
|
|
235
|
+
*/
|
|
236
|
+
accumulatesNarration?: boolean;
|
|
220
237
|
}
|
|
221
238
|
//# sourceMappingURL=conversation.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/conversation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AA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OAAO,CAAC;IACvB;;;;;;OAMG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;;;;;OAOG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;;;;OAQG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"conversation.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/conversation.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AAIH,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,KAAK,EAAE,0BAA0B,EAAE,MAAM,eAAe,CAAC;AAIhE,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,SAAS,CAAC;AAE7C,MAAM,MAAM,sBAAsB,GAC9B,MAAM,GACN,cAAc,GACd,SAAS,GACT,UAAU,GACV,OAAO,CAAC;AAEZ,MAAM,MAAM,2BAA2B,GACnC,MAAM,GACN,cAAc,GACd,YAAY,GACZ,WAAW,GACX,UAAU,GACV,OAAO,CAAC;AAEZ;;;;;;;;;GASG;AACH,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,GAAG,WAAW,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED,MAAM,WAAW,wBAAwB;IACvC,SAAS,CAAC,EAAE,sBAAsB,EAAE,CAAC;IACrC,IAAI,CAAC,EAAE,aAAa,CAAC;IACrB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB;;;;OAIG;IACH,WAAW,CAAC,EAAE,0BAA0B,EAAE,CAAC;IAC3C;;;;;;;;;OASG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IACd;;;;;;;;;;OAUG;IACH,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B;;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GAAG,IAAI,CAAC;IACtB,SAAS,EAAE,MAAM,CAAC;IAClB;;;;OAIG;IACH,KAAK,CAAC,EAAE,kBAAkB,CAAC;IAC3B;;;;;;OAMG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,aAAa,CAAC;IAClB,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,SAAS,MAAM,EAAE,CAAC;IAC/B,wEAAwE;IACxE,aAAa,CAAC,EAAE,OAAO,CAAC;IACxB,kFAAkF;IAClF,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB;;;;;;OAMG;IACH,iBAAiB,CAAC,EAAE,OAAO,CAAC;IAC5B;;;;;;;OAOG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB;;;;;;;;OAQG;IACH,qBAAqB,CAAC,EAAE,OAAO,CAAC;IAChC;;;;;;;;;;;;;;;OAeG;IACH,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createSandboxAssistantTransport.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/createSandboxAssistantTransport.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAmBH,OAAO,KAAK,EAGV,2BAA2B,EAE3B,sBAAsB,EACtB,yBAAyB,EAC1B,MAAM,SAAS,CAAC;AAOjB,MAAM,WAAW,aAAa;IAC5B,cAAc,EAAE,MAAM,2BAA2B,CAAC;IAClD,cAAc,EAAE,MAAM,MAAM,CAAC;CAC9B;AAYD,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,sBAAsB,EAC9B,IAAI,EAAE,aAAa,GAClB,yBAAyB,
|
|
1
|
+
{"version":3,"file":"createSandboxAssistantTransport.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/createSandboxAssistantTransport.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAmBH,OAAO,KAAK,EAGV,2BAA2B,EAE3B,sBAAsB,EACtB,yBAAyB,EAC1B,MAAM,SAAS,CAAC;AAOjB,MAAM,WAAW,aAAa;IAC5B,cAAc,EAAE,MAAM,2BAA2B,CAAC;IAClD,cAAc,EAAE,MAAM,MAAM,CAAC;CAC9B;AAYD,wBAAgB,+BAA+B,CAC7C,MAAM,EAAE,sBAAsB,EAC9B,IAAI,EAAE,aAAa,GAClB,yBAAyB,CAoM3B"}
|
|
@@ -13,20 +13,20 @@ function _() {
|
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
15
|
function v(v, y) {
|
|
16
|
-
let b = v.mode ?? "assistant", x = v.streamBudgetMs ?? p, S = v.ttlSeconds ?? 3600,
|
|
16
|
+
let b = v.mode ?? "assistant", x = v.streamBudgetMs ?? p, S = { accumulateNarration: v.accumulateNarration === !0 }, C = v.ttlSeconds ?? 3600, w = v.isProdRuntime ?? (() => !1), T = v.enableCredits ?? !1, E = new s({
|
|
17
17
|
product: v.product,
|
|
18
18
|
mode: b,
|
|
19
|
-
ttlSeconds:
|
|
20
|
-
isProd:
|
|
19
|
+
ttlSeconds: C,
|
|
20
|
+
isProd: w,
|
|
21
21
|
getWorkspaceId: y.getWorkspaceId,
|
|
22
22
|
getAuthContext: y.getAuthContext
|
|
23
|
-
}),
|
|
24
|
-
async function
|
|
23
|
+
}), D = () => v.gatherPageContext ? { ...v.gatherPageContext() } : _();
|
|
24
|
+
async function O(e, t, s, p) {
|
|
25
25
|
try {
|
|
26
|
-
let { sandboxId: o, sessionId: l } = await
|
|
27
|
-
|
|
26
|
+
let { sandboxId: o, sessionId: l } = await E.ensureRuntime();
|
|
27
|
+
E.startKeepWarm();
|
|
28
28
|
let u = Date.now();
|
|
29
|
-
await a(o, t, l, e.prompt, b,
|
|
29
|
+
await a(o, t, l, e.prompt, b, D(), s, e.parts?.length ? { parts: e.parts } : void 0);
|
|
30
30
|
let p = null, _ = null, y = await r(o, t, l, b, s).catch(() => null);
|
|
31
31
|
if (y && typeof EventSource < "u") try {
|
|
32
32
|
_ = new EventSource(y.url);
|
|
@@ -42,7 +42,7 @@ function v(v, y) {
|
|
|
42
42
|
} catch {
|
|
43
43
|
_ = null;
|
|
44
44
|
}
|
|
45
|
-
let
|
|
45
|
+
let C = (t) => new Promise((n) => {
|
|
46
46
|
if (e.signal.aborted) return n();
|
|
47
47
|
let r = setTimeout(() => {
|
|
48
48
|
p = null, n();
|
|
@@ -50,34 +50,34 @@ function v(v, y) {
|
|
|
50
50
|
p = () => {
|
|
51
51
|
clearTimeout(r), n();
|
|
52
52
|
};
|
|
53
|
-
}),
|
|
54
|
-
for (; Date.now() <
|
|
53
|
+
}), w = u + x, O = [], k = c([], u, S), A = u;
|
|
54
|
+
for (; Date.now() < w;) {
|
|
55
55
|
if (e.signal.aborted) throw Error("Cancelled");
|
|
56
|
-
let r = await n(o, t, l, b, s, { sinceMs:
|
|
57
|
-
|
|
56
|
+
let r = await n(o, t, l, b, s, { sinceMs: A });
|
|
57
|
+
O = d(O, r);
|
|
58
58
|
for (let e of r) {
|
|
59
59
|
let t = e.info?.time?.created;
|
|
60
|
-
typeof t == "number" && t >
|
|
60
|
+
typeof t == "number" && t > A && (A = t);
|
|
61
61
|
}
|
|
62
|
-
if (
|
|
62
|
+
if (k = c(O, u, S), e.onProgress(f(k.content)), k.done) break;
|
|
63
63
|
let i = Date.now() - u < g ? m : h;
|
|
64
|
-
await (_ ?
|
|
64
|
+
await (_ ? C(i) : new Promise((e) => setTimeout(e, i)));
|
|
65
65
|
}
|
|
66
|
-
if (_?.close(), !
|
|
67
|
-
let
|
|
68
|
-
if (
|
|
69
|
-
let e =
|
|
66
|
+
if (_?.close(), !k.done) throw Error("The assistant timed out while responding. Please try again.");
|
|
67
|
+
let j = await n(o, t, l, b, s, { limit: 50 }).catch(() => O), M = c(d(O, j), u, S);
|
|
68
|
+
if (T) {
|
|
69
|
+
let e = j.filter((e) => e.info?.role === "assistant").sort((e, t) => (t.info?.time?.created ?? 0) - (e.info?.time?.created ?? 0))[0], n = e?.info?.tokens, r = e?.info?.providerID && e?.info?.modelID ? `${e.info.providerID}/${e.info.modelID}` : void 0;
|
|
70
70
|
e?.info?.id && n && i(t, l, e.info.id, r, n, s).then(() => v.onCreditsUpdated?.()).catch(() => void 0);
|
|
71
71
|
}
|
|
72
|
-
return { text: f(
|
|
72
|
+
return { text: f(M.content) };
|
|
73
73
|
} catch (n) {
|
|
74
74
|
if (p === 1 && u(n)) {
|
|
75
75
|
let r = l(n);
|
|
76
76
|
if (r) {
|
|
77
|
-
let e =
|
|
77
|
+
let e = E.getSandboxId();
|
|
78
78
|
e && await o(e, t, s).catch(() => void 0);
|
|
79
79
|
}
|
|
80
|
-
return
|
|
80
|
+
return E.reset({ quarantineCurrentSandbox: r }), O(e, t, s, 2);
|
|
81
81
|
}
|
|
82
82
|
throw n;
|
|
83
83
|
}
|
|
@@ -87,12 +87,12 @@ function v(v, y) {
|
|
|
87
87
|
let r = y.getWorkspaceId();
|
|
88
88
|
if (!r) throw Error("The assistant needs an active workspace. Open a workspace and try again.");
|
|
89
89
|
let i = y.getAuthContext();
|
|
90
|
-
return
|
|
90
|
+
return T && t(r, i).catch((t) => {
|
|
91
91
|
e(t) && v.onQuotaExhausted?.(t);
|
|
92
|
-
}),
|
|
92
|
+
}), O(n, r, i, 1);
|
|
93
93
|
},
|
|
94
|
-
prewarm: (e) =>
|
|
95
|
-
suspend: () =>
|
|
94
|
+
prewarm: (e) => E.prewarm(e),
|
|
95
|
+
suspend: () => E.stopKeepWarm()
|
|
96
96
|
};
|
|
97
97
|
}
|
|
98
98
|
//#endregion
|
|
@@ -23,6 +23,17 @@ export interface AssistantModeCapabilities {
|
|
|
23
23
|
readonly streamBudgetMs: number;
|
|
24
24
|
/** An unfinished turn keeps building server-side — selects the "still building" note. */
|
|
25
25
|
readonly continuesInBackground: boolean;
|
|
26
|
+
/**
|
|
27
|
+
* Report this run's narration for the WHOLE run, joined oldest first, instead
|
|
28
|
+
* of only its newest message (BC1, BOFF-7334).
|
|
29
|
+
*
|
|
30
|
+
* ★★ Off for every mode by default, and deliberately so. Latest-only is what
|
|
31
|
+
* both host panels and every product wrapping the shared transport render
|
|
32
|
+
* today, so this cannot be switched on globally. It also changes what is
|
|
33
|
+
* STORED — the completed turn persists this content as its answer — so only a
|
|
34
|
+
* mode whose answer IS the account of what it built should ask for it.
|
|
35
|
+
*/
|
|
36
|
+
readonly accumulatesNarration: boolean;
|
|
26
37
|
/**
|
|
27
38
|
* May the panel provision a sandbox for this mode at all.
|
|
28
39
|
*
|
|
@@ -33,7 +44,7 @@ export interface AssistantModeCapabilities {
|
|
|
33
44
|
readonly provisionable: boolean;
|
|
34
45
|
}
|
|
35
46
|
/** The capability fields a product may set, plus the id they belong to. */
|
|
36
|
-
export type AssistantModeCapabilityConfig = Pick<AssistantModeConfig, "id" | "producesArtifacts" | "streamBudgetMs" | "continuesInBackground">;
|
|
47
|
+
export type AssistantModeCapabilityConfig = Pick<AssistantModeConfig, "id" | "producesArtifacts" | "streamBudgetMs" | "continuesInBackground" | "accumulatesNarration">;
|
|
37
48
|
/**
|
|
38
49
|
* The largest `streamBudgetMs` a product may configure: one hour.
|
|
39
50
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"modeCapabilities.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/modeCapabilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,gBAAgB,CAAC;AAE1D,OAAO,KAAK,EAAE,aAAa,EAAE,oBAAoB,EAAE,MAAM,SAAS,CAAC;AAEnE;;;;;;;;;;;;;;;GAeG;AACH,MAAM,WAAW,yBAAyB;IACxC,sEAAsE;IACtE,QAAQ,CAAC,iBAAiB,EAAE,OAAO,CAAC;IACpC,0EAA0E;IAC1E,QAAQ,CAAC,cAAc,EAAE,MAAM,CAAC;IAChC,yFAAyF;IACzF,QAAQ,CAAC,qBAAqB,EAAE,OAAO,CAAC;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AC,EAAE,6BAA6B,GAAG,IAAI,GAC5C,yBAAyB,CAyB3B;AAED;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,wBAAgB,wBAAwB,CACtC,MAAM,EAAE;IAAE,QAAQ,CAAC,aAAa,CAAC,EAAE,OAAO,CAAA;CAAE,GAAG,IAAI,GAAG,SAAS,EAC/D,MAAM,EAAE;IAAE,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;IAAC,QAAQ,CAAC,gBAAgB,EAAE,OAAO,CAAA;CAAE,GACxE,MAAM,GAAG,IAAI,CASf;AAED;;;;;;GAMG;AACH,wBAAgB,uBAAuB,CAAC,CAAC,SAAS;IAAE,EAAE,EAAE,aAAa,CAAA;CAAE,EACrE,KAAK,EAAE,SAAS,CAAC,EAAE,GAAG,IAAI,GAAG,SAAS,EACtC,IAAI,EAAE,aAAa,GAAG,IAAI,GAAG,SAAS,GACrC,CAAC,GAAG,SAAS,CAGf"}
|
|
@@ -5,6 +5,7 @@ var n = 18e4, r = 6e5, i = 36e5, a = Object.freeze({
|
|
|
5
5
|
producesArtifacts: !1,
|
|
6
6
|
streamBudgetMs: n,
|
|
7
7
|
continuesInBackground: !1,
|
|
8
|
+
accumulatesNarration: !1,
|
|
8
9
|
provisionable: !0
|
|
9
10
|
}), o = Object.freeze({
|
|
10
11
|
general: a,
|
|
@@ -14,12 +15,14 @@ var n = 18e4, r = 6e5, i = 36e5, a = Object.freeze({
|
|
|
14
15
|
producesArtifacts: !0,
|
|
15
16
|
streamBudgetMs: r,
|
|
16
17
|
continuesInBackground: !0,
|
|
18
|
+
accumulatesNarration: !1,
|
|
17
19
|
provisionable: !0
|
|
18
20
|
})
|
|
19
21
|
}), s = Object.freeze({
|
|
20
22
|
producesArtifacts: !1,
|
|
21
23
|
streamBudgetMs: n,
|
|
22
24
|
continuesInBackground: !1,
|
|
25
|
+
accumulatesNarration: !1,
|
|
23
26
|
provisionable: !1
|
|
24
27
|
}), c = (e) => typeof e == "boolean" ? e : void 0, l = (e) => typeof e == "number" && Number.isFinite(e) && e > 0 && e <= 36e5 ? e : void 0;
|
|
25
28
|
function u(n, r) {
|
|
@@ -33,6 +36,7 @@ function u(n, r) {
|
|
|
33
36
|
producesArtifacts: d ?? u.producesArtifacts,
|
|
34
37
|
streamBudgetMs: l(i.streamBudgetMs) ?? u.streamBudgetMs,
|
|
35
38
|
continuesInBackground: c(i.continuesInBackground) ?? d ?? u.continuesInBackground,
|
|
39
|
+
accumulatesNarration: c(i.accumulatesNarration) ?? u.accumulatesNarration,
|
|
36
40
|
provisionable: !0
|
|
37
41
|
};
|
|
38
42
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantPreviewOverlay.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/preview/AssistantPreviewOverlay.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAA6B,KAAK,EAAE,EAAkB,MAAM,OAAO,CAAC;AA2E3E,eAAO,MAAM,uBAAuB,EAAE,EAAE,CAAC;IAAE,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,
|
|
1
|
+
{"version":3,"file":"AssistantPreviewOverlay.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/preview/AssistantPreviewOverlay.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAA6B,KAAK,EAAE,EAAkB,MAAM,OAAO,CAAC;AA2E3E,eAAO,MAAM,uBAAuB,EAAE,EAAE,CAAC;IAAE,OAAO,EAAE,MAAM,IAAI,CAAA;CAAE,CA4F/D,CAAC"}
|
|
@@ -15,13 +15,50 @@ export declare function getAssistantText(parts: AssistantRawMessage['parts']): s
|
|
|
15
15
|
* the source is protocol-checked. A part we cannot render safely is DROPPED.
|
|
16
16
|
*/
|
|
17
17
|
export declare function getAssistantMedia(parts: AssistantRawMessage['parts']): string[];
|
|
18
|
+
/**
|
|
19
|
+
* One line per tool part: `"<Verb>: <tool>"`, with `" · <description>"` appended
|
|
20
|
+
* when the agent said what it was doing.
|
|
21
|
+
*
|
|
22
|
+
* ★★ APPENDED, not substituted. `parseToolActivity` puts the text after the verb
|
|
23
|
+
* into `step.tool` — which is what the collapsed "Details" row renders and what
|
|
24
|
+
* `step.id` is keyed on — so replacing the tool name with the description would
|
|
25
|
+
* blank the only place the raw tool is visible, and churn the React key (and the
|
|
26
|
+
* preview rail's follow-the-run logic, which tracks steps by id) on every poll
|
|
27
|
+
* where the wording changed.
|
|
28
|
+
*/
|
|
18
29
|
export declare function getToolProgress(parts: AssistantRawMessage['parts']): string[];
|
|
19
30
|
/**
|
|
20
31
|
* Reduce the assistant messages created at/after `sinceMs` into display content +
|
|
21
32
|
* a done flag. Done ⇔ the newest assistant message has `info.time.completed` and
|
|
22
33
|
* carries either text or tool progress.
|
|
23
34
|
*/
|
|
24
|
-
|
|
35
|
+
/**
|
|
36
|
+
* Per-reduction behaviour a MODE may ask for. Every field is optional and every
|
|
37
|
+
* default reproduces today's output byte for byte — this reducer is what every
|
|
38
|
+
* product wrapping the shared transport renders through, so a behaviour change
|
|
39
|
+
* here is a behaviour change for all of them at once.
|
|
40
|
+
*/
|
|
41
|
+
export interface AssistantProgressOptions {
|
|
42
|
+
/**
|
|
43
|
+
* Join this run's narration across ALL of its messages, oldest first, instead
|
|
44
|
+
* of reporting only the newest one (BC1, BOFF-7334).
|
|
45
|
+
*
|
|
46
|
+
* ★★ Why it is opt-in. The agent grows text parts INSIDE one message, so
|
|
47
|
+
* content grows while it stays in message N — and the instant it opens message
|
|
48
|
+
* N+1, everything narrated in messages 1..N disappears on the next poll. A
|
|
49
|
+
* consumer that harvests entity links out of that prose loses every link
|
|
50
|
+
* printed before the current message. But latest-only is what every existing
|
|
51
|
+
* product renders today, so only a mode that asks for accumulation gets it.
|
|
52
|
+
*
|
|
53
|
+
* ★★ It changes what is STORED, not just what is shown: the orchestrator
|
|
54
|
+
* persists this content as the turn's answer, so an accumulating mode keeps a
|
|
55
|
+
* running account of the build rather than a final reply — and that is what
|
|
56
|
+
* Copy, Export and read-aloud will carry. Correct for a mode whose answer IS
|
|
57
|
+
* the build; wrong for a conversational one. Hence per mode, never global.
|
|
58
|
+
*/
|
|
59
|
+
readonly accumulateNarration?: boolean;
|
|
60
|
+
}
|
|
61
|
+
export declare function buildProgress(messages: AssistantRawMessage[], sinceMs: number, options?: AssistantProgressOptions): {
|
|
25
62
|
content: string;
|
|
26
63
|
done: boolean;
|
|
27
64
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/progress.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAA2B,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEpG,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,mBAAmB,GAAG,MAAM,CAE3E;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,mBAAmB,CAAC,OAAO,CAAC,GAAG,MAAM,CAM5E;AA8CD;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,mBAAmB,CAAC,OAAO,CAAC,GAAG,MAAM,EAAE,CAkB/E;
|
|
1
|
+
{"version":3,"file":"progress.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/progress.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,mBAAmB,EAA2B,sBAAsB,EAAE,MAAM,SAAS,CAAC;AAEpG,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,mBAAmB,GAAG,MAAM,CAE3E;AAED,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,mBAAmB,CAAC,OAAO,CAAC,GAAG,MAAM,CAM5E;AA8CD;;;;;;;;;;;;GAYG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,mBAAmB,CAAC,OAAO,CAAC,GAAG,MAAM,EAAE,CAkB/E;AA0CD;;;;;;;;;;GAUG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,mBAAmB,CAAC,OAAO,CAAC,GAAG,MAAM,EAAE,CAY7E;AAED;;;;GAIG;AACH;;;;;GAKG;AACH,MAAM,WAAW,wBAAwB;IACvC;;;;;;;;;;;;;;;;OAgBG;IACH,QAAQ,CAAC,mBAAmB,CAAC,EAAE,OAAO,CAAC;CACxC;AAED,wBAAgB,aAAa,CAC3B,QAAQ,EAAE,mBAAmB,EAAE,EAC/B,OAAO,EAAE,MAAM,EACf,OAAO,CAAC,EAAE,wBAAwB,GACjC;IAAE,OAAO,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,OAAO,CAAA;CAAE,CA6BpC;AAED,iEAAiE;AACjE,wBAAgB,QAAQ,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAMjD;AAED;;;;;GAKG;AACH,wBAAgB,8BAA8B,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAItE;AAED,2FAA2F;AAC3F,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CA0BrD;AAED;;;;GAIG;AACH,wBAAgB,iBAAiB,CAC/B,WAAW,EAAE,mBAAmB,EAAE,EAClC,QAAQ,EAAE,mBAAmB,EAAE,GAC9B,mBAAmB,EAAE,CAavB;AAED,2FAA2F;AAC3F,wBAAgB,mBAAmB,CAAC,QAAQ,EAAE,mBAAmB,EAAE,GAAG,sBAAsB,EAAE,CAyB7F"}
|
|
@@ -33,37 +33,51 @@ function a(e) {
|
|
|
33
33
|
return t;
|
|
34
34
|
}
|
|
35
35
|
function o(e) {
|
|
36
|
+
return typeof e == "object" && e ? e : void 0;
|
|
37
|
+
}
|
|
38
|
+
function s(e) {
|
|
39
|
+
let t = o(e.state?.input);
|
|
40
|
+
if (!t) return;
|
|
41
|
+
let n = t.description;
|
|
42
|
+
if (typeof n == "string" && n.trim()) return n.trim();
|
|
43
|
+
let r = t.todos;
|
|
44
|
+
if (Array.isArray(r)) {
|
|
45
|
+
let e = o(r.find((e) => o(e)?.status === "in_progress") ?? r[0])?.content;
|
|
46
|
+
if (typeof e == "string" && e.trim()) return e.trim();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function c(e) {
|
|
36
50
|
return (e ?? []).filter((e) => e.type === "tool" && e.tool).map((e) => {
|
|
37
|
-
let t = e.state?.status ?? "running", n = e.tool ?? "tool";
|
|
38
|
-
return t === "completed" ? `Completed: ${
|
|
51
|
+
let t = e.state?.status ?? "running", n = e.tool ?? "tool", r = s(e), i = r ? `${n} · ${r}` : n;
|
|
52
|
+
return t === "completed" ? `Completed: ${i}` : t === "failed" ? `Failed: ${i}` : `Running: ${i}`;
|
|
39
53
|
});
|
|
40
54
|
}
|
|
41
|
-
function
|
|
42
|
-
let
|
|
43
|
-
if (
|
|
55
|
+
function l(n, r, i) {
|
|
56
|
+
let o = n.filter((t) => t.info?.role === "assistant" && e(t) >= r).sort((t, n) => e(t) - e(n));
|
|
57
|
+
if (o.length === 0) return {
|
|
44
58
|
content: "Thinking…",
|
|
45
59
|
done: !1
|
|
46
60
|
};
|
|
47
|
-
let s =
|
|
61
|
+
let s = o[o.length - 1], l = i?.accumulateNarration ? o.map((e) => t(e.parts)).filter(Boolean).join("\n\n") : t(s.parts), u = a(s.parts), d = c(s.parts);
|
|
48
62
|
return {
|
|
49
63
|
content: [
|
|
50
|
-
|
|
51
|
-
...
|
|
52
|
-
...
|
|
64
|
+
l,
|
|
65
|
+
...u,
|
|
66
|
+
...d
|
|
53
67
|
].filter(Boolean).join("\n\n") || "Thinking…",
|
|
54
|
-
done: !!s.info?.time?.completed && (!!
|
|
68
|
+
done: !!s.info?.time?.completed && (!!l || u.length > 0 || d.length > 0)
|
|
55
69
|
};
|
|
56
70
|
}
|
|
57
|
-
function
|
|
71
|
+
function u(e) {
|
|
58
72
|
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]");
|
|
59
73
|
}
|
|
60
|
-
function
|
|
74
|
+
function d(e) {
|
|
61
75
|
let t = e instanceof Error ? e.message.toLowerCase() : String(e).toLowerCase();
|
|
62
76
|
return t.includes("unable to connect") && t.includes("able to access the url");
|
|
63
77
|
}
|
|
64
|
-
function
|
|
78
|
+
function f(e) {
|
|
65
79
|
let t = e instanceof Error ? e.message.toLowerCase() : String(e).toLowerCase();
|
|
66
|
-
return t.includes("rate limit exceeded") || t.includes("unauthorized") || t.includes("k8s api error 401") ? !1 :
|
|
80
|
+
return t.includes("rate limit exceeded") || t.includes("unauthorized") || t.includes("k8s api error 401") ? !1 : d(e) ? !0 : [
|
|
67
81
|
"sandbox not found",
|
|
68
82
|
"sandbox is not running",
|
|
69
83
|
"sandbox service not available yet",
|
|
@@ -79,7 +93,7 @@ function u(e) {
|
|
|
79
93
|
"proxy error: 503"
|
|
80
94
|
].some((e) => t.includes(e));
|
|
81
95
|
}
|
|
82
|
-
function
|
|
96
|
+
function p(t, n) {
|
|
83
97
|
let r = /* @__PURE__ */ new Map();
|
|
84
98
|
for (let e of t) {
|
|
85
99
|
let t = e.info?.id;
|
|
@@ -91,7 +105,7 @@ function d(t, n) {
|
|
|
91
105
|
}
|
|
92
106
|
return Array.from(r.values()).sort((t, n) => e(t) - e(n));
|
|
93
107
|
}
|
|
94
|
-
function
|
|
108
|
+
function m(n) {
|
|
95
109
|
let r = [];
|
|
96
110
|
for (let i of n) {
|
|
97
111
|
let n = i.info?.role;
|
|
@@ -106,4 +120,4 @@ function f(n) {
|
|
|
106
120
|
return r;
|
|
107
121
|
}
|
|
108
122
|
//#endregion
|
|
109
|
-
export {
|
|
123
|
+
export { l as buildProgress, a as getAssistantMedia, t as getAssistantText, e as getRawMessageCreatedAt, c as getToolProgress, d as isReapedSandboxConnectionError, f as isRecoverable, m as mapSessionToHistory, p as mergeMessagesById, u as sanitize };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { PendingWrite } from './pendingWrite';
|
|
2
|
+
import { AssistantProgressOptions } from './progress';
|
|
2
3
|
import { AssistantRawMessage } from './types';
|
|
3
4
|
/** What one poll of the sandbox says this turn has produced so far. */
|
|
4
5
|
export interface AssistantTurnProgress {
|
|
@@ -47,5 +48,5 @@ export interface AssistantTurnProgress {
|
|
|
47
48
|
* sandbox-domain floor is immune to clock skew and correct for both fresh and
|
|
48
49
|
* reused (per-conversation) sessions, with no message-window gap.
|
|
49
50
|
*/
|
|
50
|
-
export declare function buildAssistantProgress(messages: AssistantRawMessage[], priorNewestCreatedMs: number): AssistantTurnProgress;
|
|
51
|
+
export declare function buildAssistantProgress(messages: AssistantRawMessage[], priorNewestCreatedMs: number, options?: AssistantProgressOptions): AssistantTurnProgress;
|
|
51
52
|
//# sourceMappingURL=turnProgress.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"turnProgress.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/turnProgress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"turnProgress.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/turnProgress.ts"],"names":[],"mappings":"AAAA,OAAO,EAAoB,KAAK,YAAY,EAAE,MAAM,gBAAgB,CAAC;AACrE,OAAO,EACL,KAAK,wBAAwB,EAK9B,MAAM,YAAY,CAAC;AACpB,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,SAAS,CAAC;AAEnD,uEAAuE;AACvE,MAAM,WAAW,qBAAqB;IACpC;;;OAGG;IACH,OAAO,EAAE,MAAM,CAAC;IAChB;;;;;;;;OAQG;IACH,mBAAmB,EAAE,OAAO,CAAC;IAC7B,IAAI,EAAE,OAAO,CAAC;IACd,MAAM,CAAC,EAAE;QAAE,KAAK,EAAE,MAAM,CAAC;QAAC,MAAM,EAAE,MAAM,CAAA;KAAE,CAAC;IAC3C;;;;;;OAMG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,+EAA+E;IAC/E,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,sBAAsB,CACpC,QAAQ,EAAE,mBAAmB,EAAE,EAC/B,oBAAoB,EAAE,MAAM,EAC5B,OAAO,CAAC,EAAE,wBAAwB,GACjC,qBAAqB,CA4DvB"}
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import { getAssistantMedia as e, getAssistantText as t, getRawMessageCreatedAt as n, getToolProgress as r } from "./progress.js";
|
|
2
2
|
import { findPendingWrite as i } from "./pendingWrite.js";
|
|
3
3
|
//#region src/shared/assistant/turnProgress.ts
|
|
4
|
-
function a(a, o) {
|
|
5
|
-
let
|
|
6
|
-
if (
|
|
4
|
+
function a(a, o, s) {
|
|
5
|
+
let c = a.filter((e) => e.info?.role === "assistant" && n(e) > o).sort((e, t) => n(e) - n(t));
|
|
6
|
+
if (c.length === 0) return {
|
|
7
7
|
content: "",
|
|
8
8
|
hasRenderableOutput: !1,
|
|
9
9
|
done: !1
|
|
10
10
|
};
|
|
11
|
-
let
|
|
12
|
-
|
|
13
|
-
...
|
|
14
|
-
...
|
|
15
|
-
].filter(Boolean).join("\n\n"),
|
|
11
|
+
let l = c[c.length - 1], u = s?.accumulateNarration ? c.map((e) => t(e.parts)).filter(Boolean).join("\n\n") : t(l.parts), d = e(l.parts), f = r(l.parts), p = i(l.parts), m = !!u || d.length > 0 || f.length > 0, h = [
|
|
12
|
+
u,
|
|
13
|
+
...d,
|
|
14
|
+
...f
|
|
15
|
+
].filter(Boolean).join("\n\n"), g = l.info?.providerID, _ = l.info?.modelID;
|
|
16
16
|
return {
|
|
17
|
-
content:
|
|
18
|
-
hasRenderableOutput:
|
|
19
|
-
done: !!
|
|
20
|
-
tokens:
|
|
21
|
-
messageId:
|
|
22
|
-
...
|
|
23
|
-
...
|
|
17
|
+
content: h,
|
|
18
|
+
hasRenderableOutput: m,
|
|
19
|
+
done: !!l.info?.time?.completed && m,
|
|
20
|
+
tokens: l.info?.tokens,
|
|
21
|
+
messageId: l.info?.id,
|
|
22
|
+
...g && _ ? { model: `${g}/${_}` } : {},
|
|
23
|
+
...p ? { pendingWrite: p } : {}
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
26
|
//#endregion
|
|
@@ -148,6 +148,18 @@ export interface SandboxAssistantConfig {
|
|
|
148
148
|
enableCredits?: boolean;
|
|
149
149
|
/** Overall per-turn deadline. Default 420_000ms. */
|
|
150
150
|
streamBudgetMs?: number;
|
|
151
|
+
/**
|
|
152
|
+
* Report the whole run's narration, joined oldest first, instead of only its
|
|
153
|
+
* newest message (BC1, BOFF-7334). Default false.
|
|
154
|
+
*
|
|
155
|
+
* ★★ The widget's counterpart to `AssistantModeConfig.accumulatesNarration`,
|
|
156
|
+
* declared here for the same reason `streamBudgetMs` is: this transport takes
|
|
157
|
+
* its per-mode behaviour from the product's config rather than resolving
|
|
158
|
+
* capabilities itself. Off by default because latest-only is what every
|
|
159
|
+
* product wrapping this transport renders today — and because it changes what
|
|
160
|
+
* is STORED as the turn's answer, not merely what is shown.
|
|
161
|
+
*/
|
|
162
|
+
accumulateNarration?: boolean;
|
|
151
163
|
/** Sandbox TTL at create (retries at 600 on validation error). Default 3600. */
|
|
152
164
|
ttlSeconds?: number;
|
|
153
165
|
/** Optional prod-runtime detector for image-tag pinning (hostname-based). */
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../src/shared/assistant/types.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH;;;;;;GAMG;AACH,MAAM,MAAM,oBA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C,EAAE,MAAM,OAAO,CAAC;IAC9B,wEAAwE;IACxE,gBAAgB,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;IAC5C,yDAAyD;IACzD,gBAAgB,CAAC,EAAE,MAAM,IAAI,CAAC;CAC/B;AAED,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,MAAM,EAAE,MAAM,CAAC;IACf;;;;OAIG;IACH,KAAK,CAAC,EAAE,mBAAmB,EAAE,CAAC;IAC9B,UAAU,EAAE,CAAC,WAAW,EAAE,MAAM,KAAK,IAAI,CAAC;IAC1C,MAAM,EAAE,WAAW,CAAC;CACrB;AAED,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,MAAM,CAAC;AAE5C,sEAAsE;AACtE,MAAM,WAAW,yBAAyB;IACxC,UAAU,EAAE,CAAC,IAAI,EAAE,iBAAiB,KAAK,OAAO,CAAC;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,CAAC,CAAC;IACnE,kFAAkF;IAClF,OAAO,EAAE,CAAC,KAAK,CAAC,EAAE,YAAY,KAAK,IAAI,CAAC;IACxC,iEAAiE;IACjE,OAAO,EAAE,MAAM,IAAI,CAAC;CACrB;AAED,MAAM,WAAW,YAAY;IAC3B,GAAG,EAAE,MAAM,CAAC;IACZ,SAAS,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,2BAA2B;IAC1C,QAAQ,EAAE,MAAM,CAAC;IACjB,QAAQ,EAAE,MAAM,CAAC;IACjB,aAAa,EAAE,MAAM,CAAC;CACvB"}
|
|
@@ -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;AAuEf,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAwDvE;;;;;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,
|
|
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;AAuEf,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,4BAA4B,CAAC;AAwDvE;;;;;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,CAwoExD,CAAC"}
|
|
@@ -4,7 +4,7 @@ import "../../../shared-providers-shell.js";
|
|
|
4
4
|
import { useAssistantProduct as n } from "../product.js";
|
|
5
5
|
import { useAssistantTr as r } from "../i18n.js";
|
|
6
6
|
import { describeQuotaError as i } from "../quota.js";
|
|
7
|
-
import { abortAssistantTurn as a, approvePendingWrite as o, createAssistantSandbox as s, createAssistantSession as
|
|
7
|
+
import { abortAssistantTurn as a, approvePendingWrite as o, createAssistantSandbox as s, createAssistantSession as ee, extendAssistantSandboxTTL as c, findExistingSandbox as l, getAssistantArtifacts as te, getAssistantMessages as ne, getAssistantSession as u, releaseSupersededAssistantSandboxes as d, sendAssistantPromptAsync as re, waitForAssistantServiceReady as f, waitForSandboxRunning as p } from "../api.js";
|
|
8
8
|
import { getRawMessageCreatedAt as ie, sanitize as ae } from "../progress.js";
|
|
9
9
|
import { findAssistantModeConfig as oe, resolveAssistantModeCapabilities as m } from "../modeCapabilities.js";
|
|
10
10
|
import { withIncompleteTurnNotice as se } from "../streamBudget.js";
|
|
@@ -67,47 +67,47 @@ var nt = ({ visible: nt = !0, writeAccess: rt = "unknown" }) => {
|
|
|
67
67
|
]), x(() => () => {
|
|
68
68
|
H.abandon();
|
|
69
69
|
}, [H]);
|
|
70
|
-
let jt = S(() => D.filter((e) => !e.requiresAdmin || B), [D, B]), [Mt, Nt] = Ze(null), [Pt, Ft] = Ze(!1), It = C({}),
|
|
70
|
+
let jt = S(() => D.filter((e) => !e.requiresAdmin || B), [D, B]), [Mt, Nt] = Ze(null), [Pt, Ft] = Ze(!1), It = C({}), U = C(Pe()), Lt = C(/* @__PURE__ */ new Set()), Rt = C(/* @__PURE__ */ new Set()), zt = S(() => D.find((e) => e.id === M), [D, M]);
|
|
71
71
|
x(() => {
|
|
72
|
-
V || (!
|
|
72
|
+
V || (!zt || zt.requiresAdmin && !B) && M !== "assistant" && gt("assistant");
|
|
73
73
|
}, [
|
|
74
74
|
M,
|
|
75
|
-
|
|
75
|
+
zt,
|
|
76
76
|
B,
|
|
77
77
|
V,
|
|
78
78
|
gt
|
|
79
79
|
]);
|
|
80
80
|
let W = b((e, t, n, r) => {
|
|
81
81
|
I(e, n, t, null, r);
|
|
82
|
-
}, [I]),
|
|
82
|
+
}, [I]), Bt = b(async (e, t, n, r, i) => {
|
|
83
83
|
let a = y.getState().sandboxesByMode[n]?.sandboxId ?? null, o = async (e) => {
|
|
84
|
-
if (
|
|
84
|
+
if (U.current.isFresh(e)) return !0;
|
|
85
85
|
try {
|
|
86
|
-
return await p(e, r, i, 3e5), await f(e, r, n, i, 9e4),
|
|
86
|
+
return await p(e, r, i, 3e5), await f(e, r, n, i, 9e4), U.current.markVerified(e), !0;
|
|
87
87
|
} catch {
|
|
88
|
-
return
|
|
88
|
+
return U.current.invalidate(e), Lt.current.add(e), !1;
|
|
89
89
|
}
|
|
90
90
|
};
|
|
91
91
|
if (a && (L(n, a, "provisioning"), W(e, t, "provisioning", "reusingEnvironment"), await o(a) || (L(n, null, "provisioning"), a = null)), !a) {
|
|
92
92
|
W(e, t, "provisioning", "lookingForEnvironment");
|
|
93
|
-
let s = await
|
|
93
|
+
let s = await l(r, E, n, Ye(), i, Lt.current);
|
|
94
94
|
s && (L(n, s, "provisioning"), W(e, t, "provisioning", "reusingEnvironment"), await o(s) ? a = s : L(n, null, "provisioning"));
|
|
95
95
|
}
|
|
96
96
|
if (!a) {
|
|
97
97
|
if (n === "api-calls" && !O()) throw Error("API Calls mode requires an authenticated session. Please sign in again.");
|
|
98
|
-
W(e, t, "provisioning", "startingEnvironment"), L(n, null, "provisioning"), await d(r, E, n, Ye(), i), a = await s(E, n, r, Ye(), $e, i), L(n, a, "provisioning"), await p(a, r, i, 3e5), await f(a, r, n, i, 9e4);
|
|
98
|
+
W(e, t, "provisioning", "startingEnvironment"), L(n, null, "provisioning"), await d(r, E, n, Ye(), i, Lt.current), a = await s(E, n, r, Ye(), $e, i), L(n, a, "provisioning"), await p(a, r, i, 3e5), await f(a, r, n, i, 9e4);
|
|
99
99
|
}
|
|
100
100
|
L(n, a, "running");
|
|
101
|
-
let
|
|
102
|
-
if (
|
|
103
|
-
let e = await u(a, r,
|
|
101
|
+
let c = y.getState().conversations.find((t) => t.id === e)?.backendSessionId ?? null;
|
|
102
|
+
if (c) try {
|
|
103
|
+
let e = await u(a, r, c, n, i);
|
|
104
104
|
if (e.mode !== n) throw Error(`Session mode mismatch: expected ${n}, received ${e.mode}`);
|
|
105
105
|
} catch {
|
|
106
|
-
Ct(e),
|
|
106
|
+
Ct(e), c = null;
|
|
107
107
|
}
|
|
108
|
-
return
|
|
108
|
+
return c || (W(e, t, "connecting", "preparingSession"), c = (await ee(a, r, n, i)).sessionId, St(e, c)), {
|
|
109
109
|
sandboxId: a,
|
|
110
|
-
sessionId:
|
|
110
|
+
sessionId: c
|
|
111
111
|
};
|
|
112
112
|
}, [
|
|
113
113
|
Ct,
|
|
@@ -116,7 +116,7 @@ var nt = ({ visible: nt = !0, writeAccess: rt = "unknown" }) => {
|
|
|
116
116
|
St,
|
|
117
117
|
L,
|
|
118
118
|
W
|
|
119
|
-
]), [
|
|
119
|
+
]), [Vt, Ht] = Ze(null), G = C(/* @__PURE__ */ new Set()), K = C(null), Ut = b(() => {
|
|
120
120
|
let e = y.getState(), t = e.activeConversationId;
|
|
121
121
|
if (!t) return;
|
|
122
122
|
let n = e.processingByConversationId[t], r = Ce(n?.status) ? n?.messageId ?? null : null;
|
|
@@ -140,7 +140,7 @@ var nt = ({ visible: nt = !0, writeAccess: rt = "unknown" }) => {
|
|
|
140
140
|
]), Wt = b(async (e) => {
|
|
141
141
|
let t = y.getState(), n = Se(t), r = Ne(), i = t.activeConversationId;
|
|
142
142
|
if (!(!n || !r || !i)) {
|
|
143
|
-
|
|
143
|
+
Ht(e);
|
|
144
144
|
try {
|
|
145
145
|
await o(n.sandboxId, r, e, n.mode, {
|
|
146
146
|
accessToken: O(),
|
|
@@ -149,7 +149,7 @@ var nt = ({ visible: nt = !0, writeAccess: rt = "unknown" }) => {
|
|
|
149
149
|
organizationId: Me()
|
|
150
150
|
});
|
|
151
151
|
} catch (e) {
|
|
152
|
-
|
|
152
|
+
Ht(null), P(i, {
|
|
153
153
|
id: tt(),
|
|
154
154
|
role: "system",
|
|
155
155
|
content: e instanceof Error ? e.message : "The change could not be approved.",
|
|
@@ -157,18 +157,18 @@ var nt = ({ visible: nt = !0, writeAccess: rt = "unknown" }) => {
|
|
|
157
157
|
});
|
|
158
158
|
return;
|
|
159
159
|
}
|
|
160
|
-
|
|
160
|
+
Ht(null), J.current(T("pendingWrite.approvedPrompt", "I approved that change — go ahead."));
|
|
161
161
|
}
|
|
162
162
|
}, [
|
|
163
163
|
A,
|
|
164
164
|
P,
|
|
165
165
|
T
|
|
166
|
-
]),
|
|
166
|
+
]), q = b(async (e, t = [], n = {}) => {
|
|
167
167
|
let r = n.voiceSessionId !== void 0, a = y.getState(), o = a.activeConversationId ?? j;
|
|
168
168
|
if (o) {
|
|
169
169
|
if (Ce(a.processingByConversationId[o]?.status)) {
|
|
170
170
|
let r = a.processingByConversationId[o]?.messageId ?? null;
|
|
171
|
-
r && G.current.has(r) && (
|
|
171
|
+
r && G.current.has(r) && (K.current = {
|
|
172
172
|
conversationId: o,
|
|
173
173
|
content: e,
|
|
174
174
|
attachments: t,
|
|
@@ -178,7 +178,7 @@ var nt = ({ visible: nt = !0, writeAccess: rt = "unknown" }) => {
|
|
|
178
178
|
}
|
|
179
179
|
if (Rt.current.has(o)) return;
|
|
180
180
|
}
|
|
181
|
-
let s = a.mode,
|
|
181
|
+
let s = a.mode, ee = oe(D, s), l = m(s, ee), u = j, d = u ? y.getState().conversations.find((e) => e.id === u) : void 0;
|
|
182
182
|
if (u ? d && d.mode !== s && (d.messages.length > 0 || d.backendSessionId) ? u = N(void 0, s) : d && d.mode !== s && _t(u, s) : u = N(void 0, s), !u) return;
|
|
183
183
|
It.current[u] = t;
|
|
184
184
|
let f = Ne(), p = {
|
|
@@ -220,7 +220,7 @@ var nt = ({ visible: nt = !0, writeAccess: rt = "unknown" }) => {
|
|
|
220
220
|
}, _ = async (n = 1) => {
|
|
221
221
|
let i = !1;
|
|
222
222
|
try {
|
|
223
|
-
let { sandboxId: n, sessionId: a } = await
|
|
223
|
+
let { sandboxId: n, sessionId: a } = await Bt(u, g, s, f, p), o = (await ne(n, f, a, s, p, { limit: 50 }).catch(() => [])).reduce((e, t) => Math.max(e, ie(t)), 0);
|
|
224
224
|
W(u, g, "streaming", "thinking");
|
|
225
225
|
let d = he(e, t), oe = at?.(s, d, dt, ft, r) ?? d, m = me(oe, t), ce = _e(m), h = ce > 0, _ = it?.();
|
|
226
226
|
i = ge(t) > ce;
|
|
@@ -230,7 +230,7 @@ var nt = ({ visible: nt = !0, writeAccess: rt = "unknown" }) => {
|
|
|
230
230
|
if (!m || !Ue(e)) throw e;
|
|
231
231
|
await re(n, f, a, oe, s, _, p, void 0), i ||= h;
|
|
232
232
|
}
|
|
233
|
-
let v = De([], o), de = Date.now() +
|
|
233
|
+
let v = De([], o), de = Date.now() + l.streamBudgetMs, fe = Date.now(), pe = Date.now(), ve = () => we({
|
|
234
234
|
turnId: g,
|
|
235
235
|
abortRequested: G.current.has(g),
|
|
236
236
|
activeTurnId: y.getState().processingByConversationId[u]?.messageId ?? null
|
|
@@ -244,13 +244,13 @@ var nt = ({ visible: nt = !0, writeAccess: rt = "unknown" }) => {
|
|
|
244
244
|
if (v = De(await ne(n, f, a, s, p, {
|
|
245
245
|
limit: 50,
|
|
246
246
|
sinceMs: o
|
|
247
|
-
}), o), F(u, g, { content: ae(v.content) }), v.pendingWrite && bt(u, g, { pendingWrite: v.pendingWrite }), v.done) break;
|
|
248
|
-
Date.now() - fe > 3e4 && (await
|
|
247
|
+
}), o, { accumulateNarration: l.accumulatesNarration }), F(u, g, { content: ae(v.content) }), v.pendingWrite && bt(u, g, { pendingWrite: v.pendingWrite }), v.done) break;
|
|
248
|
+
Date.now() - fe > 3e4 && (await c(n, f, 600, p).catch(() => void 0), fe = Date.now()), await new Promise((e) => setTimeout(e, ue(Date.now() - pe)));
|
|
249
249
|
}
|
|
250
|
-
let ye =
|
|
250
|
+
let ye = l.producesArtifacts ? await te(n, f, a, s, p).then((e) => e).catch(() => []) : void 0;
|
|
251
251
|
if (v.done || (v = {
|
|
252
252
|
...v,
|
|
253
|
-
content: se(v.content, s, T,
|
|
253
|
+
content: se(v.content, s, T, ee)
|
|
254
254
|
}), i && (v = {
|
|
255
255
|
...v,
|
|
256
256
|
content: `${v.content}\n\n${T("attachments.imagesNotSent", "_Your photo was too large to include with this message, so the answer above is from the text and the file link only. Try a smaller or more tightly cropped photo._")}`
|
|
@@ -282,19 +282,22 @@ var nt = ({ visible: nt = !0, writeAccess: rt = "unknown" }) => {
|
|
|
282
282
|
t.clearProcessing && xt(u);
|
|
283
283
|
return;
|
|
284
284
|
}
|
|
285
|
-
if (n === 1 && We(e))
|
|
285
|
+
if (n === 1 && We(e)) {
|
|
286
|
+
let e = y.getState().sandboxesByMode[s]?.sandboxId ?? null;
|
|
287
|
+
return e && (Lt.current.add(e), U.current.invalidate(e)), Ct(u), wt(s), yt(u, g, ""), bt(u, g, { pendingWrite: void 0 }), _(2);
|
|
288
|
+
}
|
|
286
289
|
throw e;
|
|
287
290
|
}
|
|
288
291
|
}, v = u;
|
|
289
292
|
Rt.current.add(v);
|
|
290
293
|
try {
|
|
291
294
|
if (!f) throw Error("Assistant backend is unavailable without an active workspace context.");
|
|
292
|
-
if (!
|
|
293
|
-
let e = await be(
|
|
295
|
+
if (!l.provisionable) throw Error("This assistant mode is not available here. Switch to another mode and send again.");
|
|
296
|
+
let e = await be(ee, H);
|
|
294
297
|
if (e) throw Error(e);
|
|
295
298
|
await _();
|
|
296
299
|
} catch (e) {
|
|
297
|
-
|
|
300
|
+
U.current.invalidate(y.getState().sandboxesByMode[s]?.sandboxId ?? null);
|
|
298
301
|
let t = i(e);
|
|
299
302
|
if (t) {
|
|
300
303
|
t.refusal === "exhausted" && Ge(E, "sandbox");
|
|
@@ -309,8 +312,8 @@ var nt = ({ visible: nt = !0, writeAccess: rt = "unknown" }) => {
|
|
|
309
312
|
});
|
|
310
313
|
} finally {
|
|
311
314
|
Rt.current.delete(v);
|
|
312
|
-
let e =
|
|
313
|
-
|
|
315
|
+
let e = K.current;
|
|
316
|
+
K.current = null, e && e.conversationId === v && J.current(e.content, e.attachments, e.options);
|
|
314
317
|
}
|
|
315
318
|
}, [
|
|
316
319
|
j,
|
|
@@ -320,7 +323,7 @@ var nt = ({ visible: nt = !0, writeAccess: rt = "unknown" }) => {
|
|
|
320
323
|
wt,
|
|
321
324
|
mt,
|
|
322
325
|
N,
|
|
323
|
-
|
|
326
|
+
Bt,
|
|
324
327
|
it,
|
|
325
328
|
O,
|
|
326
329
|
k,
|
|
@@ -341,18 +344,18 @@ var nt = ({ visible: nt = !0, writeAccess: rt = "unknown" }) => {
|
|
|
341
344
|
yt,
|
|
342
345
|
A
|
|
343
346
|
]), Gt = b((e) => {
|
|
344
|
-
|
|
345
|
-
}, [
|
|
347
|
+
q(e);
|
|
348
|
+
}, [q]), Kt = b(() => {
|
|
346
349
|
let e = [...R.chat].reverse().find((e) => e.role === "user"), t = j ? It.current[j] ?? [] : [];
|
|
347
|
-
e &&
|
|
350
|
+
e && q(e.content, t);
|
|
348
351
|
}, [
|
|
349
352
|
Dt,
|
|
350
|
-
|
|
353
|
+
q,
|
|
351
354
|
j
|
|
352
|
-
]),
|
|
355
|
+
]), J = C(q);
|
|
353
356
|
x(() => {
|
|
354
|
-
|
|
355
|
-
}, [
|
|
357
|
+
J.current = q;
|
|
358
|
+
}, [q]);
|
|
356
359
|
let qt = S(() => {
|
|
357
360
|
if (Ot) return null;
|
|
358
361
|
for (let e = Dt.length - 1; e >= 0; --e) {
|
|
@@ -372,7 +375,7 @@ var nt = ({ visible: nt = !0, writeAccess: rt = "unknown" }) => {
|
|
|
372
375
|
Ot,
|
|
373
376
|
z,
|
|
374
377
|
T
|
|
375
|
-
]), Jt = S(() => qt ? de(qt.text) : null, [qt]), Yt = R.chat,
|
|
378
|
+
]), Jt = S(() => qt ? de(qt.text) : null, [qt]), Yt = R.chat, Y = S(() => R.voice.filter((e) => e.role === "user" || e.role === "assistant").map((e) => ({
|
|
376
379
|
id: e.id,
|
|
377
380
|
role: e.role,
|
|
378
381
|
text: Ae(e, z, T),
|
|
@@ -383,9 +386,9 @@ var nt = ({ visible: nt = !0, writeAccess: rt = "unknown" }) => {
|
|
|
383
386
|
z,
|
|
384
387
|
T
|
|
385
388
|
]), Xt = b(() => {
|
|
386
|
-
if (
|
|
389
|
+
if (Y.length === 0) return;
|
|
387
390
|
let e = /* @__PURE__ */ new Date();
|
|
388
|
-
Le(_(
|
|
391
|
+
Le(_(Y, {
|
|
389
392
|
title: T("voiceSession.transcript", "Voice conversation"),
|
|
390
393
|
savedAt: T("voiceSession.savedAt", "Saved"),
|
|
391
394
|
session: T("voiceSession.sessionLabel", "Session"),
|
|
@@ -395,68 +398,68 @@ var nt = ({ visible: nt = !0, writeAccess: rt = "unknown" }) => {
|
|
|
395
398
|
}, e), v(E, e), "text/markdown");
|
|
396
399
|
}, [
|
|
397
400
|
E,
|
|
398
|
-
|
|
401
|
+
Y,
|
|
399
402
|
T
|
|
400
|
-
]),
|
|
401
|
-
|
|
402
|
-
let
|
|
403
|
+
]), X = qe(), Z = C(X);
|
|
404
|
+
Z.current = X;
|
|
405
|
+
let Q = je({
|
|
403
406
|
onSubmit: b((e, t) => {
|
|
404
407
|
let n = () => {
|
|
405
|
-
let n =
|
|
406
|
-
|
|
408
|
+
let n = Z.current, r = ve(n.attachments);
|
|
409
|
+
J.current(e, r, { voiceSessionId: t }), n.clear();
|
|
407
410
|
};
|
|
408
|
-
if (!
|
|
411
|
+
if (!Z.current.isBusy) {
|
|
409
412
|
n();
|
|
410
413
|
return;
|
|
411
414
|
}
|
|
412
415
|
let r = Date.now(), i = window.setInterval(() => {
|
|
413
|
-
|
|
416
|
+
Z.current.isBusy && Date.now() - r < et || (window.clearInterval(i), n());
|
|
414
417
|
}, 200);
|
|
415
418
|
}, []),
|
|
416
419
|
latestReply: qt,
|
|
417
420
|
language: fe(ct, st).tag
|
|
418
|
-
}), Zt = S(() => (Et?.messages ?? []).reduce((e, t) => Math.max(e, t.metadata?.continuedVoiceTurns ?? 0), 0), [Et?.messages]),
|
|
421
|
+
}), Zt = S(() => (Et?.messages ?? []).reduce((e, t) => Math.max(e, t.metadata?.continuedVoiceTurns ?? 0), 0), [Et?.messages]), $ = ke(R.voice, z, T), Qt = $ > Zt, $t = b(() => {
|
|
419
422
|
let e = y.getState().activeConversationId;
|
|
420
|
-
!e ||
|
|
423
|
+
!e || Y.length === 0 || (P(e, {
|
|
421
424
|
id: tt(),
|
|
422
425
|
role: "system",
|
|
423
|
-
content: le(
|
|
426
|
+
content: le(Y.slice(Zt), {
|
|
424
427
|
intro: T("voiceSession.continuedIntro", "Continued from a voice conversation. You asked about:"),
|
|
425
428
|
nothing: T("voiceSession.continuedNothing", "Continued from a voice conversation."),
|
|
426
429
|
more: (e) => T("voiceSession.continuedMore", "…and {{count}} more", { count: e })
|
|
427
430
|
}),
|
|
428
431
|
timestamp: (/* @__PURE__ */ new Date()).toISOString(),
|
|
429
|
-
metadata: { continuedVoiceTurns:
|
|
430
|
-
}), Ft(!1),
|
|
432
|
+
metadata: { continuedVoiceTurns: $ }
|
|
433
|
+
}), Ft(!1), Q.end());
|
|
431
434
|
}, [
|
|
432
|
-
|
|
433
|
-
|
|
435
|
+
Y,
|
|
436
|
+
$,
|
|
434
437
|
Zt,
|
|
435
438
|
P,
|
|
436
439
|
T,
|
|
437
|
-
|
|
440
|
+
Q
|
|
438
441
|
]), en = C(0);
|
|
439
442
|
x(() => {
|
|
440
|
-
|
|
441
|
-
}, [
|
|
443
|
+
Q.active && (en.current = $);
|
|
444
|
+
}, [Q.active]);
|
|
442
445
|
let tn = b(() => {
|
|
443
|
-
let e =
|
|
444
|
-
|
|
445
|
-
}, [Q
|
|
446
|
+
let e = $ > en.current;
|
|
447
|
+
Q.end(), e && Ft(!0);
|
|
448
|
+
}, [$, Q]);
|
|
446
449
|
x(() => {
|
|
447
|
-
!nt &&
|
|
448
|
-
}, [nt,
|
|
449
|
-
|
|
450
|
-
}, [
|
|
450
|
+
!nt && Q.active && Q.end();
|
|
451
|
+
}, [nt, Q]), x(() => {
|
|
452
|
+
Q.active || (Z.current.clear(), K.current = null);
|
|
453
|
+
}, [Q.active]), x(() => {
|
|
451
454
|
let e = y.getState().consumePendingPrompt();
|
|
452
|
-
return e &&
|
|
455
|
+
return e && J.current(e), y.subscribe((e, t) => {
|
|
453
456
|
if (e.pendingPrompt && e.pendingPrompt !== t.pendingPrompt) {
|
|
454
457
|
let e = y.getState().consumePendingPrompt();
|
|
455
|
-
e &&
|
|
458
|
+
e && J.current(e);
|
|
456
459
|
}
|
|
457
460
|
});
|
|
458
461
|
}, []);
|
|
459
|
-
let
|
|
462
|
+
let nn = b((e) => {
|
|
460
463
|
let t = j ? y.getState().conversations.find((e) => e.id === j) : void 0;
|
|
461
464
|
if (t && (t.messages.length > 0 || t.backendSessionId)) {
|
|
462
465
|
if (t.mode !== e) {
|
|
@@ -471,20 +474,20 @@ var nt = ({ visible: nt = !0, writeAccess: rt = "unknown" }) => {
|
|
|
471
474
|
vt,
|
|
472
475
|
_t,
|
|
473
476
|
gt
|
|
474
|
-
]),
|
|
477
|
+
]), rn = b((e) => {
|
|
475
478
|
if (D.find((t) => t.id === e)?.writeCapable && !y.getState().apiCallsAcknowledged) {
|
|
476
479
|
Nt(e);
|
|
477
480
|
return;
|
|
478
481
|
}
|
|
479
|
-
|
|
480
|
-
}, [
|
|
482
|
+
nn(e);
|
|
483
|
+
}, [nn, D]), an = b(() => {
|
|
481
484
|
let e = Mt;
|
|
482
|
-
Nt(null), Tt(), e &&
|
|
485
|
+
Nt(null), Tt(), e && nn(e);
|
|
483
486
|
}, [
|
|
484
487
|
Mt,
|
|
485
488
|
Tt,
|
|
486
|
-
|
|
487
|
-
]),
|
|
489
|
+
nn
|
|
490
|
+
]), on = b(() => {
|
|
488
491
|
Nt(null);
|
|
489
492
|
}, []);
|
|
490
493
|
return /* @__PURE__ */ Qe("div", {
|
|
@@ -492,10 +495,10 @@ var nt = ({ visible: nt = !0, writeAccess: rt = "unknown" }) => {
|
|
|
492
495
|
children: [
|
|
493
496
|
/* @__PURE__ */ Qe("div", {
|
|
494
497
|
className: "contents",
|
|
495
|
-
inert:
|
|
498
|
+
inert: Q.active || void 0,
|
|
496
499
|
children: [
|
|
497
|
-
|
|
498
|
-
count:
|
|
500
|
+
Y.length > 0 && !Q.active ? /* @__PURE__ */ w(Fe, {
|
|
501
|
+
count: Y.length,
|
|
499
502
|
onOpenTranscript: () => Ft(!0)
|
|
500
503
|
}) : null,
|
|
501
504
|
Yt.length === 0 ? /* @__PURE__ */ w(Re, {
|
|
@@ -505,7 +508,7 @@ var nt = ({ visible: nt = !0, writeAccess: rt = "unknown" }) => {
|
|
|
505
508
|
className: "flex min-h-0 flex-1 flex-col",
|
|
506
509
|
children: /* @__PURE__ */ w(ze, {
|
|
507
510
|
onApprovePendingWrite: Wt,
|
|
508
|
-
approvingWriteRef:
|
|
511
|
+
approvingWriteRef: Vt,
|
|
509
512
|
messages: Yt,
|
|
510
513
|
processing: z ?? null,
|
|
511
514
|
streamingMessageId: kt,
|
|
@@ -514,51 +517,51 @@ var nt = ({ visible: nt = !0, writeAccess: rt = "unknown" }) => {
|
|
|
514
517
|
})
|
|
515
518
|
}),
|
|
516
519
|
/* @__PURE__ */ w(Je, {
|
|
517
|
-
onStartVoiceSession:
|
|
518
|
-
onSend: (e, t) => void
|
|
520
|
+
onStartVoiceSession: Q.available && M !== "api-calls" ? Q.start : void 0,
|
|
521
|
+
onSend: (e, t) => void q(e, t),
|
|
519
522
|
disabled: Ot,
|
|
520
523
|
placeholder: M === "api-calls" ? T("chatArea.placeholderActions", "What would you like me to do?") : T("chatArea.placeholderGeneral", "Ask me anything…"),
|
|
521
524
|
mode: M,
|
|
522
|
-
writeAccessDenied: rt === "denied" && !!
|
|
525
|
+
writeAccessDenied: rt === "denied" && !!zt?.writeCapable,
|
|
523
526
|
availableModes: jt,
|
|
524
|
-
onModeChange:
|
|
527
|
+
onModeChange: rn
|
|
525
528
|
})
|
|
526
529
|
]
|
|
527
530
|
}),
|
|
528
|
-
Pt && !
|
|
529
|
-
turns:
|
|
531
|
+
Pt && !Q.active ? /* @__PURE__ */ w(Ie, {
|
|
532
|
+
turns: Y,
|
|
530
533
|
onClose: () => Ft(!1),
|
|
531
534
|
onSave: Xt,
|
|
532
535
|
onContinueInChat: Qt ? $t : void 0,
|
|
533
536
|
closeOnEscape: !0
|
|
534
537
|
}) : null,
|
|
535
|
-
|
|
536
|
-
session:
|
|
537
|
-
notice:
|
|
538
|
-
capturing:
|
|
539
|
-
interrupting:
|
|
540
|
-
awaitingEndpoint:
|
|
541
|
-
turns:
|
|
542
|
-
spokenChunks:
|
|
543
|
-
attachments:
|
|
544
|
-
onAttachFiles:
|
|
545
|
-
onRemoveAttachment:
|
|
546
|
-
onRetryAttachment:
|
|
547
|
-
canAttachMore:
|
|
548
|
-
preparingAttachments:
|
|
538
|
+
Q.active && /* @__PURE__ */ w(Be, {
|
|
539
|
+
session: Q.session,
|
|
540
|
+
notice: Q.notice,
|
|
541
|
+
capturing: Q.capturing,
|
|
542
|
+
interrupting: Q.interrupting,
|
|
543
|
+
awaitingEndpoint: Q.awaitingEndpoint,
|
|
544
|
+
turns: Y,
|
|
545
|
+
spokenChunks: Q.spokenChunks,
|
|
546
|
+
attachments: X.attachments,
|
|
547
|
+
onAttachFiles: X.addFiles,
|
|
548
|
+
onRemoveAttachment: X.remove,
|
|
549
|
+
onRetryAttachment: X.retry,
|
|
550
|
+
canAttachMore: X.canAddMore,
|
|
551
|
+
preparingAttachments: X.preparingCount,
|
|
549
552
|
onSaveTranscript: Xt,
|
|
550
553
|
onContinueInChat: $t,
|
|
551
554
|
onInterrupt: () => {
|
|
552
|
-
|
|
555
|
+
Q.interrupt(), Ut();
|
|
553
556
|
},
|
|
554
557
|
spoken: Jt,
|
|
555
|
-
onToggleMute:
|
|
558
|
+
onToggleMute: Q.toggleMute,
|
|
556
559
|
onEnd: tn
|
|
557
560
|
}),
|
|
558
561
|
/* @__PURE__ */ w(Xe, {
|
|
559
562
|
open: Mt !== null,
|
|
560
|
-
onConfirm:
|
|
561
|
-
onCancel:
|
|
563
|
+
onConfirm: an,
|
|
564
|
+
onCancel: on
|
|
562
565
|
})
|
|
563
566
|
]
|
|
564
567
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AssistantToolActivity.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/ui/AssistantToolActivity.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAIhC,MAAM,MAAM,uBAAuB,GAC/B,QAAQ,GACR,SAAS,GACT,WAAW,GACX,QAAQ,CAAC;AAEb,MAAM,WAAW,iBAAiB;IAChC,qCAAqC;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,2DAA2D;IAC3D,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,uBAAuB,CAAC;CACjC;
|
|
1
|
+
{"version":3,"file":"AssistantToolActivity.d.ts","sourceRoot":"","sources":["../../../../src/shared/assistant/ui/AssistantToolActivity.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,EAAE,EAAE,MAAM,OAAO,CAAC;AAIhC,MAAM,MAAM,uBAAuB,GAC/B,QAAQ,GACR,SAAS,GACT,WAAW,GACX,QAAQ,CAAC;AAEb,MAAM,WAAW,iBAAiB;IAChC,qCAAqC;IACrC,EAAE,EAAE,MAAM,CAAC;IACX,6CAA6C;IAC7C,KAAK,EAAE,MAAM,CAAC;IACd,2DAA2D;IAC3D,IAAI,EAAE,MAAM,CAAC;IACb,MAAM,EAAE,uBAAuB,CAAC;CACjC;AAiCD;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,MAAM,GAAG;IAClD,KAAK,EAAE,iBAAiB,EAAE,CAAC;IAC3B,IAAI,EAAE,MAAM,CAAC;CACd,CAyBA;AA2BD;;;;;GAKG;AACH,eAAO,MAAM,qBAAqB,EAAE,EAAE,CAAC;IAAE,KAAK,EAAE,iBAAiB,EAAE,CAAA;CAAE,CAiEpE,CAAC"}
|
|
@@ -2,7 +2,7 @@ import { useAssistantTr as e } from "../i18n.js";
|
|
|
2
2
|
import { Check as t, Circle as n, Loader2 as r, Wrench as i, X as a } from "lucide-react";
|
|
3
3
|
import { jsx as o, jsxs as s } from "react/jsx-runtime";
|
|
4
4
|
//#region src/shared/assistant/ui/AssistantToolActivity.tsx
|
|
5
|
-
var c = /^(Running|Completed|Failed):\s*(.+)
|
|
5
|
+
var c = /^(Running|Completed|Failed):\s*([^·]+?)(?:\s+·\s+(.+))?$/, l = {
|
|
6
6
|
Running: "running",
|
|
7
7
|
Completed: "completed",
|
|
8
8
|
Failed: "failed"
|
|
@@ -20,10 +20,10 @@ function d(e) {
|
|
|
20
20
|
return e.split("\n").forEach((e, r) => {
|
|
21
21
|
let i = e.match(c);
|
|
22
22
|
if (i) {
|
|
23
|
-
let e = i[2].trim();
|
|
23
|
+
let e = i[2].trim(), n = i[3]?.trim();
|
|
24
24
|
t.push({
|
|
25
25
|
id: `${r}-${e}`,
|
|
26
|
-
label: u(e),
|
|
26
|
+
label: n || u(e),
|
|
27
27
|
tool: e,
|
|
28
28
|
status: l[i[1]] ?? "running"
|
|
29
29
|
});
|