@burdenoff/fe-libs 2026.916.1 → 2026.917.1
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/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 +16 -16
- 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
|
@@ -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;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,CA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ACpB,uBAAuB,GACvB,qBAAqB,GACrB,kBAAkB,GAClB,YAAY,GACZ,UAAU,CAAC;AAEf,MAAM,WAAW,+BAA+B;IAC9C,MAAM,EAAE,2BAA2B,CAAC;IACpC,SAAS,EAAE,MAAM,GAAG,IAAI,CAAC;IACzB,KAAK,CAAC,EAAE,MAAM,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;
|
|
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,W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H,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;IACxC;;;;;;OAMG;IACH,QAAQ,CAAC,aAAa,EAAE,OAAO,CAAC;CACjC;AAED,2EAA2E;AAC3E,MAAM,MAAM,6BAA6B,GAAG,IAAI,CAC9C,mBAAmB,
|
|
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;IACxC;;;;;;;;;OASG;IAC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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,C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AAgB,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,oBAAoB,GAAG,SAAS,GAAG,WAAW,GAAG,cAAc,GAAG,WAAW,CAAC;AAE1F,OAAO,CAAC,MAAM,yBAAyB,EAAE,OAAO,MAAM,CAAC;AAEvD;;;;;;;;;;;;;;;;GAgBG;AACH,MAAM,MAAM,oBAAoB,GAAG,MAAM,GAAG;IAAE,QAAQ,CAAC,CAAC,yBAAyB,CAAC,EAAE,IAAI,CAAA;CAAE,CAAC;AAE3F,MAAM,MAAM,aAAa,GAAG,oBAAoB,GAAG,oBAAoB,CAAC;AAExE,gFAAgF;AAChF,MAAM,WAAW,WAAW;IAC1B,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,YAAY,CAAC,EAAE,MAAM,CAAC;IAC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AkF;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,CAylExD,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";
|
|
@@ -90,7 +90,7 @@ var nt = ({ visible: nt = !0, writeAccess: rt = "unknown" }) => {
|
|
|
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);
|
|
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) {
|
|
@@ -98,16 +98,16 @@ var nt = ({ visible: nt = !0, writeAccess: rt = "unknown" }) => {
|
|
|
98
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);
|
|
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,
|
|
@@ -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 = {
|
|
@@ -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._")}`
|
|
@@ -289,8 +289,8 @@ var nt = ({ visible: nt = !0, writeAccess: rt = "unknown" }) => {
|
|
|
289
289
|
Rt.current.add(v);
|
|
290
290
|
try {
|
|
291
291
|
if (!f) throw Error("Assistant backend is unavailable without an active workspace context.");
|
|
292
|
-
if (!
|
|
293
|
-
let e = await be(
|
|
292
|
+
if (!l.provisionable) throw Error("This assistant mode is not available here. Switch to another mode and send again.");
|
|
293
|
+
let e = await be(ee, H);
|
|
294
294
|
if (e) throw Error(e);
|
|
295
295
|
await _();
|
|
296
296
|
} catch (e) {
|
|
@@ -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
|
});
|