@qwen-code/web-shell 0.25.1-preview.2 → 0.25.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/{agents-route-B3FonPY-.js → agents-route-CufkSNnD.js} +2 -2
- package/dist/daemon-react-sdk.js +1 -1
- package/dist/{index-BPRuZpl-.js → index-Deg_ZdBo.js} +44693 -44108
- package/dist/index.js +3 -3
- package/dist/sw.js +1 -1
- package/dist/{toolNames-CusX912Z.js → toolNames-Co4lBbW-.js} +281 -230
- package/dist/transcript.js +41 -1
- package/dist/types/components/QueuedPromptDisplay.d.ts +4 -1
- package/dist/types/components/managed/ManagedSessionCwdControl.d.ts +9 -0
- package/dist/types/components/managed/generated/managed-agent-api.d.ts +9 -2
- package/dist/types/components/managed/java-managed-agent-client.d.ts +2 -1
- package/dist/types/components/managed/managed-agent-provider.d.ts +18 -1
- package/dist/types/components/managed/managed-request-error.d.ts +6 -0
- package/dist/types/components/managed/use-managed-cwd-change.d.ts +21 -0
- package/dist/types/components/managed/use-managed-session.d.ts +15 -1
- package/dist/types/daemon/session/types.d.ts +9 -1
- package/dist/types/hooks/useQueuedPrompts.d.ts +2 -0
- package/package.json +1 -1
|
@@ -3,7 +3,7 @@ var cc = (e, t, o) => t in e ? lc(e, t, { enumerable: !0, configurable: !0, writ
|
|
|
3
3
|
var so = (e, t, o) => cc(e, typeof t != "symbol" ? t + "" : t, o);
|
|
4
4
|
import { createContext as It, useContext as Ot, useMemo as st, useRef as Y, useState as rt, useCallback as ue, useEffect as dt, useSyncExternalStore as hn } from "react";
|
|
5
5
|
import { jsx as Yt } from "react/jsx-runtime";
|
|
6
|
-
import { DaemonHttpError as fo, parseDaemonBackgroundTurn as qs, getSessionUpdatePayload as dc, isStaleBranchPointError as uc, DaemonStandaloneCreationOutcomeUnknownError as Ri, isDaemonTurnError as
|
|
6
|
+
import { DaemonHttpError as fo, parseDaemonBackgroundTurn as qs, getSessionUpdatePayload as dc, isStaleBranchPointError as uc, DaemonStandaloneCreationOutcomeUnknownError as Ri, isDaemonTurnError as Pr, DaemonTransportClosedError as pc, DaemonPendingPromptLimitError as mc, asKnownDaemonEvent as gc, EXTENSION_ARCHIVE_UPLOAD_TIMEOUT_MS as hc, DaemonClient as Ms, MID_TURN_MESSAGE_INJECTED_EVENT as fc, PENDING_PROMPT_ADDED_EVENT as $i, PENDING_PROMPT_STARTED_EVENT as Mi, PENDING_PROMPT_COMPLETED_EVENT as _i, isTaskExecutionMode as Di, parseQwenAgentMessageMeta as wc, QWEN_AGENT_MESSAGE_META_KEY as kc, estimateDaemonTranscriptBlockBytes as Ka, createDaemonTranscriptStore as zn, normalizeDaemonEvent as vc, extractServerTimestamp as bc, STANDALONE_SESSION_OPTIONS_CAPABILITY as yc, DaemonSessionClient as Ao, isUnrecognizedDiagnosticReason as Rr, DaemonCapabilityMissingError as ha, matchTurnEvent as Sc, isTrimmedToolBlockId as Tc, isTrimmedPermissionBlockId as Cc, UNRECOGNIZED_DIAGNOSTICS_LIMIT as Ic, DAEMON_APPROVAL_MODES as xc } from "@qwen-code/sdk/daemon";
|
|
7
7
|
/**
|
|
8
8
|
* @license
|
|
9
9
|
* Copyright 2025 Qwen Team
|
|
@@ -16,7 +16,7 @@ function qt(e) {
|
|
|
16
16
|
function Ec(e) {
|
|
17
17
|
return e instanceof fo && e.status === 400 && Ce(e.body) && e.body.code === "invalid_client_id";
|
|
18
18
|
}
|
|
19
|
-
function
|
|
19
|
+
function Qa(e) {
|
|
20
20
|
if (!(e instanceof fo) || !Ce(e.body))
|
|
21
21
|
return !1;
|
|
22
22
|
const t = e.body, o = Ce(t.data) ? t.data : void 0, s = Ce(t.capacity) ? t.capacity : void 0, n = Ce(o?.capacity) ? o.capacity : void 0;
|
|
@@ -32,7 +32,7 @@ function Ce(e) {
|
|
|
32
32
|
return typeof e == "object" && e !== null && !Array.isArray(e);
|
|
33
33
|
}
|
|
34
34
|
function Hp(e) {
|
|
35
|
-
if (!
|
|
35
|
+
if (!Qa(e) || !(e instanceof fo) || !Ce(e.body))
|
|
36
36
|
return !1;
|
|
37
37
|
const t = e.body, o = Ce(t.data) ? t.data : t, s = typeof t.code == "string" ? t.code : o.errorKind ?? o.code;
|
|
38
38
|
return s === "acp_child_capacity_exhausted" || s === "standalone_creation_rolled_back" && o.retryable === !0;
|
|
@@ -51,7 +51,7 @@ const Ac = [
|
|
|
51
51
|
"xhigh",
|
|
52
52
|
"max"
|
|
53
53
|
];
|
|
54
|
-
function
|
|
54
|
+
function $r(e) {
|
|
55
55
|
return Ac.find((t) => t === e);
|
|
56
56
|
}
|
|
57
57
|
function _s(e, t) {
|
|
@@ -71,7 +71,7 @@ function _s(e, t) {
|
|
|
71
71
|
].join("\0");
|
|
72
72
|
if (o.has(m)) continue;
|
|
73
73
|
o.add(m);
|
|
74
|
-
const g =
|
|
74
|
+
const g = Ya(l.configOptions);
|
|
75
75
|
s.push({
|
|
76
76
|
id: l.modelId,
|
|
77
77
|
baseModelId: l.baseModelId,
|
|
@@ -107,16 +107,16 @@ function Pc(e) {
|
|
|
107
107
|
if (!(!o && n.length === 0))
|
|
108
108
|
return { models: n, currentModel: o, contextWindow: a };
|
|
109
109
|
}
|
|
110
|
-
function
|
|
110
|
+
function Ya(e) {
|
|
111
111
|
if (!Array.isArray(e)) return;
|
|
112
112
|
const t = e.map(Oe).find((h) => xe(h, "id") === "reasoning_effort"), o = t?.options;
|
|
113
113
|
if (!t || !Array.isArray(o)) return;
|
|
114
114
|
const s = o.flatMap((h) => {
|
|
115
|
-
const y =
|
|
115
|
+
const y = $r(xe(Oe(h), "value"));
|
|
116
116
|
return y ? [y] : [];
|
|
117
117
|
}), n = Oe(t._meta), a = Oe(n?.["qwenCode/reasoning"]), r = a?.thinkingMandatory === !0;
|
|
118
118
|
if (!r && !s.includes("none")) return;
|
|
119
|
-
const i =
|
|
119
|
+
const i = $r(
|
|
120
120
|
xe(t, "currentValue")
|
|
121
121
|
);
|
|
122
122
|
if (!i || !s.includes(i) || r && i === "none") return;
|
|
@@ -145,10 +145,10 @@ function Qa(e) {
|
|
|
145
145
|
...r ? { canDisable: !1 } : {}
|
|
146
146
|
};
|
|
147
147
|
}
|
|
148
|
-
function Da(e) {
|
|
149
|
-
return Qa(e?.state?.configOptions);
|
|
150
|
-
}
|
|
151
148
|
function Oa(e) {
|
|
149
|
+
return Ya(e?.state?.configOptions);
|
|
150
|
+
}
|
|
151
|
+
function La(e) {
|
|
152
152
|
if (!e) return { commands: [], skills: [] };
|
|
153
153
|
const t = e.availableCommands.map((s) => ({
|
|
154
154
|
name: s.name,
|
|
@@ -221,7 +221,7 @@ function Rc(e, t) {
|
|
|
221
221
|
a && t((i) => ({
|
|
222
222
|
...i,
|
|
223
223
|
tokenUsage: a,
|
|
224
|
-
tokenCount:
|
|
224
|
+
tokenCount: Ja(a)
|
|
225
225
|
}));
|
|
226
226
|
const r = _c(o);
|
|
227
227
|
if (r && t((i) => ({
|
|
@@ -316,7 +316,7 @@ function Rc(e, t) {
|
|
|
316
316
|
}
|
|
317
317
|
}
|
|
318
318
|
}
|
|
319
|
-
function
|
|
319
|
+
function Fa(e, t, o) {
|
|
320
320
|
return t.goal === null && !t.clearedGoal && e?.goal && e.goal.goalId !== o ? e : Bs(e, t);
|
|
321
321
|
}
|
|
322
322
|
function Bs(e, t) {
|
|
@@ -336,12 +336,12 @@ function Bs(e, t) {
|
|
|
336
336
|
}
|
|
337
337
|
if (e?.goal === null && t.goal) {
|
|
338
338
|
const n = wa.get(e);
|
|
339
|
-
if (n?.goalId === t.goal.goalId &&
|
|
339
|
+
if (n?.goalId === t.goal.goalId && Mr(n, t.goal))
|
|
340
340
|
return e;
|
|
341
341
|
}
|
|
342
342
|
if (e && t.goal) {
|
|
343
343
|
const n = o?.get(t.goal.goalId);
|
|
344
|
-
if (n &&
|
|
344
|
+
if (n && Mr(n, t.goal))
|
|
345
345
|
return e;
|
|
346
346
|
}
|
|
347
347
|
return e?.goal && t.goal && e.goal.goalId === t.goal.goalId && (t.goal.revision < e.goal.revision || t.goal.revision === e.goal.revision && t.goal.updatedAt < e.goal.updatedAt) ? e : (e?.goal && t.goal && e.goal.goalId !== t.goal.goalId && (s = {
|
|
@@ -350,7 +350,7 @@ function Bs(e, t) {
|
|
|
350
350
|
updatedAt: e.goal.updatedAt
|
|
351
351
|
}), $c(t, o, s), t);
|
|
352
352
|
}
|
|
353
|
-
function
|
|
353
|
+
function Mr(e, t) {
|
|
354
354
|
return t.revision < e.revision || t.revision === e.revision && t.updatedAt <= e.updatedAt;
|
|
355
355
|
}
|
|
356
356
|
function $c(e, t, o) {
|
|
@@ -424,7 +424,7 @@ function Ui(e) {
|
|
|
424
424
|
const t = Oe(e?.state?.modes);
|
|
425
425
|
return xe(Oe(t?._meta), "planExecutionMode");
|
|
426
426
|
}
|
|
427
|
-
function
|
|
427
|
+
function Ja(e) {
|
|
428
428
|
const t = e?.inputTokens ?? e?.totalTokens;
|
|
429
429
|
if (t !== void 0 && t > 0) return t;
|
|
430
430
|
if (!e) return;
|
|
@@ -454,7 +454,7 @@ function Bi(e) {
|
|
|
454
454
|
...Bn(o, "thoughtTokens"),
|
|
455
455
|
...Bn(o, "cachedReadTokens")
|
|
456
456
|
};
|
|
457
|
-
return
|
|
457
|
+
return Ja(s) !== void 0 ? s : void 0;
|
|
458
458
|
}
|
|
459
459
|
function Bn(e, t) {
|
|
460
460
|
const o = Ct(e, t);
|
|
@@ -528,7 +528,7 @@ function Lc(e) {
|
|
|
528
528
|
* Copyright 2025 Qwen Team
|
|
529
529
|
* SPDX-License-Identifier: Apache-2.0
|
|
530
530
|
*/
|
|
531
|
-
function
|
|
531
|
+
function Ua(e) {
|
|
532
532
|
return `attachment:///${encodeURIComponent(e)}`;
|
|
533
533
|
}
|
|
534
534
|
function Wi(e, t) {
|
|
@@ -540,7 +540,7 @@ function Wi(e, t) {
|
|
|
540
540
|
|
|
541
541
|
${o}` : o;
|
|
542
542
|
}
|
|
543
|
-
function
|
|
543
|
+
function _r(e) {
|
|
544
544
|
const t = e.data.indexOf(","), o = e.data.startsWith("data:") && t >= 0 ? e.data.slice(t + 1) : e.data, s = atob(o), n = new Uint8Array(s.length);
|
|
545
545
|
for (let a = 0; a < s.length; a += 1) n[a] = s.charCodeAt(a);
|
|
546
546
|
return new Blob([n], {
|
|
@@ -550,7 +550,7 @@ function Mr(e) {
|
|
|
550
550
|
function bs(e, t = [], o = []) {
|
|
551
551
|
const n = [{ type: "text", text: Wi(
|
|
552
552
|
e,
|
|
553
|
-
o.map((a) =>
|
|
553
|
+
o.map((a) => Ua(a.name))
|
|
554
554
|
) }];
|
|
555
555
|
for (const a of t) {
|
|
556
556
|
const r = a.mimeType ?? a.mediaType ?? a.media_type;
|
|
@@ -572,7 +572,7 @@ function bs(e, t = [], o = []) {
|
|
|
572
572
|
n.push({
|
|
573
573
|
type: "resource",
|
|
574
574
|
resource: {
|
|
575
|
-
uri:
|
|
575
|
+
uri: Ua(a.name),
|
|
576
576
|
...r ? { mimeType: r } : {},
|
|
577
577
|
text: a.text
|
|
578
578
|
}
|
|
@@ -586,7 +586,7 @@ function bs(e, t = [], o = []) {
|
|
|
586
586
|
* SPDX-License-Identifier: Apache-2.0
|
|
587
587
|
*/
|
|
588
588
|
const Fc = 3e4;
|
|
589
|
-
function
|
|
589
|
+
function Dr(e, t, o) {
|
|
590
590
|
const s = Number.isFinite(t) && t > 0 ? t : 1e3, n = Number.isFinite(o) && o > 0 ? Math.max(s, o) : s, a = s * 2 ** Math.max(0, e - 1), r = Math.min(a, n), i = 0.8 + Math.random() * 0.4;
|
|
591
591
|
return Math.min(n, Math.max(1, Math.round(r * i)));
|
|
592
592
|
}
|
|
@@ -605,7 +605,7 @@ async function R(e, t, o = Fc) {
|
|
|
605
605
|
s !== void 0 && clearTimeout(s);
|
|
606
606
|
}
|
|
607
607
|
}
|
|
608
|
-
function
|
|
608
|
+
function Or(e, t) {
|
|
609
609
|
return e <= 0 || t.aborted ? Promise.resolve() : new Promise((o) => {
|
|
610
610
|
const s = setTimeout(n, e);
|
|
611
611
|
function n() {
|
|
@@ -638,23 +638,23 @@ function Nc(e) {
|
|
|
638
638
|
const Wc = "qwen-code-webui-client-id:session:";
|
|
639
639
|
function ys(e, t) {
|
|
640
640
|
if (e) return e;
|
|
641
|
-
if (typeof window > "u") return
|
|
641
|
+
if (typeof window > "u") return va();
|
|
642
642
|
try {
|
|
643
643
|
if (t) {
|
|
644
644
|
const o = window.sessionStorage.getItem(
|
|
645
|
-
|
|
645
|
+
Xa(t)
|
|
646
646
|
);
|
|
647
647
|
if (o) return o;
|
|
648
648
|
}
|
|
649
|
-
return
|
|
649
|
+
return va();
|
|
650
650
|
} catch {
|
|
651
|
-
return
|
|
651
|
+
return va();
|
|
652
652
|
}
|
|
653
653
|
}
|
|
654
|
-
function
|
|
654
|
+
function ka(e) {
|
|
655
655
|
if (!(typeof window > "u"))
|
|
656
656
|
try {
|
|
657
|
-
return window.sessionStorage.getItem(
|
|
657
|
+
return window.sessionStorage.getItem(Xa(e)) ?? void 0;
|
|
658
658
|
} catch {
|
|
659
659
|
return;
|
|
660
660
|
}
|
|
@@ -662,7 +662,7 @@ function Or(e) {
|
|
|
662
662
|
function Vn(e, t) {
|
|
663
663
|
if (!(!e || !t || typeof window > "u"))
|
|
664
664
|
try {
|
|
665
|
-
window.sessionStorage.setItem(
|
|
665
|
+
window.sessionStorage.setItem(Xa(t), e);
|
|
666
666
|
} catch {
|
|
667
667
|
}
|
|
668
668
|
}
|
|
@@ -678,10 +678,10 @@ async function Lr(e) {
|
|
|
678
678
|
if (!(s.status === 204 || s.status === 404))
|
|
679
679
|
throw new Error(`Detach client failed (${s.status})`);
|
|
680
680
|
}
|
|
681
|
-
function
|
|
681
|
+
function va() {
|
|
682
682
|
return `webui_${typeof crypto < "u" && typeof crypto.randomUUID == "function" ? crypto.randomUUID() : `${Date.now().toString(36)}-${Math.random().toString(36).slice(2)}`}`;
|
|
683
683
|
}
|
|
684
|
-
function
|
|
684
|
+
function Xa(e) {
|
|
685
685
|
return `${Wc}${encodeURIComponent(e)}`;
|
|
686
686
|
}
|
|
687
687
|
function jc(e) {
|
|
@@ -744,7 +744,7 @@ function qc(e) {
|
|
|
744
744
|
function _t(e) {
|
|
745
745
|
return e?.kind === "workspace" ? `workspace:${ts(e.cwd)}` : e?.kind ?? "legacy";
|
|
746
746
|
}
|
|
747
|
-
function
|
|
747
|
+
function ba(e, t) {
|
|
748
748
|
return e === void 0 ? t === void 0 || t.kind === "workspace" : _t(e) === _t(t);
|
|
749
749
|
}
|
|
750
750
|
function qi(e) {
|
|
@@ -788,11 +788,11 @@ function Ur(e) {
|
|
|
788
788
|
mimeType: t.mimeType || t.mediaType || t.media_type || "text/plain"
|
|
789
789
|
}));
|
|
790
790
|
}
|
|
791
|
-
function
|
|
791
|
+
function Ba(e) {
|
|
792
792
|
return e.split(";", 1)[0]?.trim().toLowerCase() || e;
|
|
793
793
|
}
|
|
794
794
|
function Br(e) {
|
|
795
|
-
const t =
|
|
795
|
+
const t = Ba(e).slice(6).split("+", 1)[0];
|
|
796
796
|
return `image.${t === "jpg" ? "jpeg" : t || "img"}`;
|
|
797
797
|
}
|
|
798
798
|
function un(e, t, o = !1) {
|
|
@@ -961,7 +961,7 @@ function Xc({
|
|
|
961
961
|
return (T ? Promise.race([C, td(T)]) : C).then((F) => {
|
|
962
962
|
if (t.current !== c)
|
|
963
963
|
throw new Error("Session changed before prompt submission");
|
|
964
|
-
const _ =
|
|
964
|
+
const _ = La(F);
|
|
965
965
|
v = _.commands, ve(
|
|
966
966
|
(K) => t.current === c ? { ...K, ..._, supportedCommands: F } : K
|
|
967
967
|
);
|
|
@@ -997,9 +997,9 @@ function Xc({
|
|
|
997
997
|
const D = await Promise.allSettled([
|
|
998
998
|
...w.map(
|
|
999
999
|
async (B) => await c.uploadAttachment(
|
|
1000
|
-
|
|
1000
|
+
_r(B),
|
|
1001
1001
|
Br(B.mimeType),
|
|
1002
|
-
|
|
1002
|
+
Ba(B.mimeType),
|
|
1003
1003
|
f
|
|
1004
1004
|
)
|
|
1005
1005
|
),
|
|
@@ -1023,7 +1023,7 @@ function Xc({
|
|
|
1023
1023
|
text: Wi(
|
|
1024
1024
|
d,
|
|
1025
1025
|
T.map(
|
|
1026
|
-
(se, ae) =>
|
|
1026
|
+
(se, ae) => Ua(
|
|
1027
1027
|
q[ae]?.attachmentId ?? se.name
|
|
1028
1028
|
)
|
|
1029
1029
|
)
|
|
@@ -1371,7 +1371,7 @@ function Xc({
|
|
|
1371
1371
|
} catch (f) {
|
|
1372
1372
|
if (mn(f))
|
|
1373
1373
|
return t.current?.sessionId === T && e.dispatch({ type: "assistant.done", reason: "cancelled" }), { stopReason: "cancelled" };
|
|
1374
|
-
throw
|
|
1374
|
+
throw Pr(f) ? f : (t.current?.sessionId === T && e.dispatch({ type: "assistant.done", reason: "error" }), Te(
|
|
1375
1375
|
M,
|
|
1376
1376
|
"Prompt failed",
|
|
1377
1377
|
f,
|
|
@@ -1440,7 +1440,7 @@ function Xc({
|
|
|
1440
1440
|
e.dispatch({ type: "assistant.done", reason: "cancelled" });
|
|
1441
1441
|
return;
|
|
1442
1442
|
}
|
|
1443
|
-
throw
|
|
1443
|
+
throw Pr(w) ? w : (ee(d, w), Te(
|
|
1444
1444
|
M,
|
|
1445
1445
|
"Continue failed",
|
|
1446
1446
|
w,
|
|
@@ -1615,7 +1615,7 @@ function Xc({
|
|
|
1615
1615
|
...v,
|
|
1616
1616
|
recovery: k.context ? k.context.recovery : v.recovery
|
|
1617
1617
|
} : k.context,
|
|
1618
|
-
reasoning: v ?
|
|
1618
|
+
reasoning: v ? Oa(v) : void 0
|
|
1619
1619
|
}), u;
|
|
1620
1620
|
} catch (p) {
|
|
1621
1621
|
throw Te(
|
|
@@ -1646,7 +1646,7 @@ function Xc({
|
|
|
1646
1646
|
p.setConfigOption("reasoning_effort", c, d)
|
|
1647
1647
|
),
|
|
1648
1648
|
"Set reasoning effort timed out"
|
|
1649
|
-
), C =
|
|
1649
|
+
), C = Ya(w.configOptions);
|
|
1650
1650
|
if (!(c === "none" ? C?.enabled === !1 : c === "default" ? C !== void 0 : C?.enabled === !0 && C.effort === c) || d?.persist && w.persisted !== !0)
|
|
1651
1651
|
throw new Error(
|
|
1652
1652
|
`Daemon did not confirm reasoning effort ${JSON.stringify(c)}`
|
|
@@ -2069,7 +2069,7 @@ function Xc({
|
|
|
2069
2069
|
"Refresh commands timed out"
|
|
2070
2070
|
);
|
|
2071
2071
|
if (t.current === c) {
|
|
2072
|
-
const { commands: p, skills: T } =
|
|
2072
|
+
const { commands: p, skills: T } = La(d);
|
|
2073
2073
|
ve((u) => ({
|
|
2074
2074
|
...u,
|
|
2075
2075
|
commands: p,
|
|
@@ -2111,7 +2111,7 @@ function Xc({
|
|
|
2111
2111
|
currentMode: u ?? T.currentMode,
|
|
2112
2112
|
planExecutionMode: u !== void 0 ? Ui(p) : T.planExecutionMode,
|
|
2113
2113
|
currentModel: ed(p) ?? T.currentModel,
|
|
2114
|
-
reasoning:
|
|
2114
|
+
reasoning: Oa(p)
|
|
2115
2115
|
};
|
|
2116
2116
|
}), p;
|
|
2117
2117
|
} catch (p) {
|
|
@@ -2149,7 +2149,7 @@ function Xc({
|
|
|
2149
2149
|
"load_context_usage",
|
|
2150
2150
|
c?.silent && k ? {
|
|
2151
2151
|
dispatchedNoticeKeys: Pe,
|
|
2152
|
-
noticeOnceKey:
|
|
2152
|
+
noticeOnceKey: ya(
|
|
2153
2153
|
"load_context_usage",
|
|
2154
2154
|
v
|
|
2155
2155
|
)
|
|
@@ -2286,9 +2286,9 @@ function Xc({
|
|
|
2286
2286
|
T,
|
|
2287
2287
|
d?.signal
|
|
2288
2288
|
) : await p.uploadAttachment(
|
|
2289
|
-
|
|
2289
|
+
_r(c),
|
|
2290
2290
|
Br(T),
|
|
2291
|
-
|
|
2291
|
+
Ba(T),
|
|
2292
2292
|
d?.signal
|
|
2293
2293
|
);
|
|
2294
2294
|
},
|
|
@@ -2316,7 +2316,7 @@ function Xc({
|
|
|
2316
2316
|
);
|
|
2317
2317
|
if (T === p?.sessionId)
|
|
2318
2318
|
return await p.removeAttachment(c);
|
|
2319
|
-
const f =
|
|
2319
|
+
const f = ka(T) ?? (Ro === T ? Xe : void 0);
|
|
2320
2320
|
try {
|
|
2321
2321
|
return f ? await u.removeSessionAttachment(T, c, {
|
|
2322
2322
|
clientId: f
|
|
@@ -2347,7 +2347,7 @@ function Xc({
|
|
|
2347
2347
|
const p = t.current;
|
|
2348
2348
|
if (!p) return { removed: !1 };
|
|
2349
2349
|
if (d?.sessionId && p.sessionId !== d.sessionId) {
|
|
2350
|
-
const T =
|
|
2350
|
+
const T = ka(d.sessionId) ?? p.clientId;
|
|
2351
2351
|
return await p.client.removeMidTurnMessage(
|
|
2352
2352
|
d.sessionId,
|
|
2353
2353
|
c,
|
|
@@ -2358,6 +2358,17 @@ function Xc({
|
|
|
2358
2358
|
}
|
|
2359
2359
|
return await p.removeMidTurnMessage(c);
|
|
2360
2360
|
},
|
|
2361
|
+
async sendMidTurnMessagesNow(c) {
|
|
2362
|
+
const d = t.current;
|
|
2363
|
+
if (!d) return { requested: !1 };
|
|
2364
|
+
if (c?.sessionId && d.sessionId !== c.sessionId) {
|
|
2365
|
+
const p = ka(c.sessionId) ?? d.clientId;
|
|
2366
|
+
return await d.client.sendMidTurnMessagesNow(c.sessionId, {
|
|
2367
|
+
...p ? { clientId: p } : {}
|
|
2368
|
+
});
|
|
2369
|
+
}
|
|
2370
|
+
return await d.sendMidTurnMessagesNow();
|
|
2371
|
+
},
|
|
2361
2372
|
async getMidTurnMessages(c) {
|
|
2362
2373
|
const d = t.current;
|
|
2363
2374
|
if (d)
|
|
@@ -2428,7 +2439,7 @@ function Xc({
|
|
|
2428
2439
|
"load_tasks",
|
|
2429
2440
|
c?.silent ? {
|
|
2430
2441
|
dispatchedNoticeKeys: Pe,
|
|
2431
|
-
noticeOnceKey:
|
|
2442
|
+
noticeOnceKey: ya("load_tasks", p)
|
|
2432
2443
|
} : void 0
|
|
2433
2444
|
);
|
|
2434
2445
|
}
|
|
@@ -2449,7 +2460,7 @@ function Xc({
|
|
|
2449
2460
|
"load_tasks",
|
|
2450
2461
|
c?.silent ? {
|
|
2451
2462
|
dispatchedNoticeKeys: Pe,
|
|
2452
|
-
noticeOnceKey:
|
|
2463
|
+
noticeOnceKey: ya("load_tasks", p)
|
|
2453
2464
|
} : void 0
|
|
2454
2465
|
);
|
|
2455
2466
|
}
|
|
@@ -2579,7 +2590,7 @@ function Xc({
|
|
|
2579
2590
|
);
|
|
2580
2591
|
return ve((T) => {
|
|
2581
2592
|
if (T.sessionId !== c.sessionId) return T;
|
|
2582
|
-
const u =
|
|
2593
|
+
const u = Fa(
|
|
2583
2594
|
T.goalState,
|
|
2584
2595
|
p.snapshot,
|
|
2585
2596
|
d
|
|
@@ -2851,7 +2862,7 @@ function Te(e, t, o, s, n) {
|
|
|
2851
2862
|
severity: "error",
|
|
2852
2863
|
category: "user_action",
|
|
2853
2864
|
operation: s,
|
|
2854
|
-
code:
|
|
2865
|
+
code: Qa(o) ? "acp_child_capacity_exhausted" : `daemon.${s}.failed`,
|
|
2855
2866
|
message: `${t}: ${a}`,
|
|
2856
2867
|
debugMessage: a,
|
|
2857
2868
|
recoverable: !0
|
|
@@ -2859,7 +2870,7 @@ function Te(e, t, o, s, n) {
|
|
|
2859
2870
|
o instanceof Error ? o : new Error(a)
|
|
2860
2871
|
);
|
|
2861
2872
|
}
|
|
2862
|
-
function
|
|
2873
|
+
function ya(e, t) {
|
|
2863
2874
|
return `${e}:${Vi(t)}`;
|
|
2864
2875
|
}
|
|
2865
2876
|
function Vi(e) {
|
|
@@ -2907,7 +2918,7 @@ function sd(e, t, o, s) {
|
|
|
2907
2918
|
if (s) return;
|
|
2908
2919
|
const n = t.find(rd);
|
|
2909
2920
|
if (!n) return;
|
|
2910
|
-
const a =
|
|
2921
|
+
const a = Na(n.promptId) ?? id(t);
|
|
2911
2922
|
if (!a) return;
|
|
2912
2923
|
const r = Ce(n.data) ? n.data.truncatedEvents : void 0;
|
|
2913
2924
|
return {
|
|
@@ -2933,8 +2944,8 @@ function ad(e, t) {
|
|
|
2933
2944
|
return { events: e.slice(o), terminal: s };
|
|
2934
2945
|
}
|
|
2935
2946
|
function Zo(e) {
|
|
2936
|
-
const t =
|
|
2937
|
-
return t || (Ce(e.data) ?
|
|
2947
|
+
const t = Na(e.promptId);
|
|
2948
|
+
return t || (Ce(e.data) ? Na(e.data.promptId) : void 0);
|
|
2938
2949
|
}
|
|
2939
2950
|
function Qi(e) {
|
|
2940
2951
|
return e.type === "history_truncated" && Ce(e.data) && e.data.scope === "live_journal";
|
|
@@ -2956,7 +2967,7 @@ function ld(e) {
|
|
|
2956
2967
|
const t = e.data.update;
|
|
2957
2968
|
return Ce(t) && t.sessionUpdate === "user_message_chunk";
|
|
2958
2969
|
}
|
|
2959
|
-
function
|
|
2970
|
+
function Na(e) {
|
|
2960
2971
|
return typeof e == "string" && e.length > 0 ? e : void 0;
|
|
2961
2972
|
}
|
|
2962
2973
|
const Gp = It(void 0), zp = It(
|
|
@@ -4022,7 +4033,7 @@ function Wo(e, t) {
|
|
|
4022
4033
|
const o = typeof e == "number" ? e : Number(e ?? 0), s = Number.isFinite(o) ? o : 0;
|
|
4023
4034
|
return `${s} ${t}${s === 1 ? "" : "s"}`;
|
|
4024
4035
|
}
|
|
4025
|
-
const
|
|
4036
|
+
const Za = {
|
|
4026
4037
|
"capacityChoice.persistenceUnconfirmed": "Saving the last interrupted turn could not be confirmed.",
|
|
4027
4038
|
"capacityChoice.title": "Choose a workspace to stop",
|
|
4028
4039
|
"capacityChoice.description": "No ACP capacity is available. Choose a workspace whose sessions you want to stop, or cancel and keep working.",
|
|
@@ -4137,6 +4148,23 @@ const Xa = {
|
|
|
4137
4148
|
"managed.workspaceLabel": "Workspace",
|
|
4138
4149
|
"managed.workspaceChoose": "Choose a Workspace",
|
|
4139
4150
|
"managed.workspaceDirectory": "Relative directory",
|
|
4151
|
+
"managed.cwd.change": "Change directory",
|
|
4152
|
+
"managed.cwd.path": "Directory relative to Workspace root",
|
|
4153
|
+
"managed.cwd.description": "Enter a path relative to the Workspace root. Use . for the root. Future tasks run in the new directory; conversation history is kept.",
|
|
4154
|
+
"managed.cwd.close": "Close",
|
|
4155
|
+
"managed.cwd.changing": "Changing directory…",
|
|
4156
|
+
"managed.cwd.confirm": "Continue confirming",
|
|
4157
|
+
"managed.cwd.unconfirmed": "The directory change is not confirmed yet. Continue confirming the original request.",
|
|
4158
|
+
"managed.cwd.unconfirmedForbidden": "Your account cannot confirm this change. Its result remains unconfirmed, and sending stays blocked until the server settles it or you open a new tab.",
|
|
4159
|
+
"managed.cwd.busy": "Finish the active task, approval or unconfirmed request before changing directory.",
|
|
4160
|
+
"managed.cwd.invalid": "The directory is invalid or cannot be accessed.",
|
|
4161
|
+
"managed.cwd.conflict": "The current directory has changed. Review it before submitting again.",
|
|
4162
|
+
"managed.cwd.unavailable": "The Workspace is currently unavailable for a directory change.",
|
|
4163
|
+
"managed.cwd.forbidden": "Your account does not have permission to change this directory.",
|
|
4164
|
+
"managed.cwd.storage": "Browser session storage is unavailable. The directory change cannot start safely.",
|
|
4165
|
+
"managed.cwd.failed": "The directory change failed. Review the current directory before trying again.",
|
|
4166
|
+
"managed.cwd.updated": (e) => `The current directory changed to ${e?.cwd ?? ""}. Confirm this context before submitting.`,
|
|
4167
|
+
"managed.cwd.useCurrent": "Use the current directory context",
|
|
4140
4168
|
"managed.workspaceCreate": "Create session",
|
|
4141
4169
|
"managed.workspaceBound": "Bound Workspace",
|
|
4142
4170
|
"managed.workspaceExecutionUnavailable": "Workspace is bound. You cannot send messages in this Session.",
|
|
@@ -5800,6 +5828,9 @@ const Xa = {
|
|
|
5800
5828
|
"queue.insertFailed": "Failed to insert queued message",
|
|
5801
5829
|
"queue.insertTip": "Insert into the current turn",
|
|
5802
5830
|
"queue.insertCommandDisabled": "Commands cannot be inserted mid-turn",
|
|
5831
|
+
"queue.sendNow": "Send now",
|
|
5832
|
+
"queue.sendNowTip": "Send queued messages now, cutting the model's current response short unless it has started a tool call; running tools finish first",
|
|
5833
|
+
"queue.sendNowFailed": "Failed to send queued messages now",
|
|
5803
5834
|
"queue.footer": "Press ↑ to edit the latest queued message · Esc to clear queue",
|
|
5804
5835
|
"queue.imageCount": (e) => `(+${e?.count ?? 0} images)`,
|
|
5805
5836
|
"queue.fileCount": (e) => `(+${e?.count ?? 0} files)`,
|
|
@@ -7581,7 +7612,7 @@ const Xa = {
|
|
|
7581
7612
|
...dd,
|
|
7582
7613
|
...pd
|
|
7583
7614
|
}, bd = {
|
|
7584
|
-
...
|
|
7615
|
+
...Za,
|
|
7585
7616
|
"capacityChoice.persistenceUnconfirmed": "无法确认最后一轮被中断内容是否已保存。",
|
|
7586
7617
|
"capacityChoice.title": "选择要停止的工作区",
|
|
7587
7618
|
"capacityChoice.description": "当前没有可用的 ACP 容量。选择一个工作区停止其会话,或取消并继续现有工作。",
|
|
@@ -7696,6 +7727,23 @@ const Xa = {
|
|
|
7696
7727
|
"managed.workspaceLabel": "工作区",
|
|
7697
7728
|
"managed.workspaceChoose": "选择工作区",
|
|
7698
7729
|
"managed.workspaceDirectory": "相对目录",
|
|
7730
|
+
"managed.cwd.change": "切换目录",
|
|
7731
|
+
"managed.cwd.path": "相对于 Workspace 根目录的路径",
|
|
7732
|
+
"managed.cwd.description": "输入相对于 Workspace 根目录的路径,. 表示根目录。后续任务在新目录执行,对话历史保留。",
|
|
7733
|
+
"managed.cwd.close": "关闭",
|
|
7734
|
+
"managed.cwd.changing": "正在切换目录…",
|
|
7735
|
+
"managed.cwd.confirm": "继续确认",
|
|
7736
|
+
"managed.cwd.unconfirmed": "目录切换结果尚未确认,请继续确认原请求。",
|
|
7737
|
+
"managed.cwd.unconfirmedForbidden": "当前账号无权确认此操作,切换结果仍待确认;在服务器给出最终结果或新开标签页之前,发送将保持禁用。",
|
|
7738
|
+
"managed.cwd.busy": "请先完成正在执行的任务、审批或未确认请求,再切换目录。",
|
|
7739
|
+
"managed.cwd.invalid": "目录无效或无法访问。",
|
|
7740
|
+
"managed.cwd.conflict": "当前目录已变化,请检查后重新提交。",
|
|
7741
|
+
"managed.cwd.unavailable": "Workspace 当前无法切换目录。",
|
|
7742
|
+
"managed.cwd.forbidden": "当前账号没有切换此目录的权限。",
|
|
7743
|
+
"managed.cwd.storage": "浏览器会话存储不可用,无法安全发起目录切换。",
|
|
7744
|
+
"managed.cwd.failed": "目录切换失败,请检查当前目录后重试。",
|
|
7745
|
+
"managed.cwd.updated": (e) => `当前目录已变为 ${e?.cwd ?? ""},请先确认此上下文再提交。`,
|
|
7746
|
+
"managed.cwd.useCurrent": "使用当前目录上下文",
|
|
7699
7747
|
"managed.workspaceCreate": "创建会话",
|
|
7700
7748
|
"managed.workspaceBound": "已绑定工作区",
|
|
7701
7749
|
"managed.workspaceExecutionUnavailable": "工作区已绑定;你不能在此会话中发送消息。",
|
|
@@ -9433,6 +9481,9 @@ const Xa = {
|
|
|
9433
9481
|
"queue.insertFailed": "插入排队消息失败",
|
|
9434
9482
|
"queue.insertTip": "插入当前回合",
|
|
9435
9483
|
"queue.insertCommandDisabled": "命令不能插入当前回合",
|
|
9484
|
+
"queue.sendNow": "立即发送",
|
|
9485
|
+
"queue.sendNowTip": "立即发送排队的消息,并截断模型当前的回复(回复已开始调用工具时不截断);正在运行的工具会先执行完",
|
|
9486
|
+
"queue.sendNowFailed": "立即发送排队消息失败",
|
|
9436
9487
|
"queue.footer": "按 ↑ 编辑最后一条排队消息 · Esc 清空队列",
|
|
9437
9488
|
"queue.imageCount": (e) => `(+${e?.count ?? 0} 张图片)`,
|
|
9438
9489
|
"queue.fileCount": (e) => `(+${e?.count ?? 0} 个文件)`,
|
|
@@ -11202,7 +11253,7 @@ const Xa = {
|
|
|
11202
11253
|
...ud,
|
|
11203
11254
|
...md
|
|
11204
11255
|
}, yd = {
|
|
11205
|
-
en:
|
|
11256
|
+
en: Za,
|
|
11206
11257
|
"zh-CN": bd
|
|
11207
11258
|
}, Sd = {
|
|
11208
11259
|
en: "English [en]",
|
|
@@ -11235,7 +11286,7 @@ function Qp(e) {
|
|
|
11235
11286
|
function Ji(e) {
|
|
11236
11287
|
const t = yd[e];
|
|
11237
11288
|
return (o, s) => {
|
|
11238
|
-
const n = t[o] ??
|
|
11289
|
+
const n = t[o] ?? Za[o] ?? o;
|
|
11239
11290
|
return typeof n == "function" ? n(s) : n;
|
|
11240
11291
|
};
|
|
11241
11292
|
}
|
|
@@ -12258,7 +12309,7 @@ function Ed(e, t, o, s) {
|
|
|
12258
12309
|
e.delete(n);
|
|
12259
12310
|
}
|
|
12260
12311
|
}
|
|
12261
|
-
const
|
|
12312
|
+
const er = It(void 0), Ad = typeof import.meta.url == "string" && import.meta.url ? import.meta.url : "web-shell/DaemonWorkspaceProvider", Xn = `${Ad}#${Math.random().toString(36).slice(2, 8)}`, Pd = "__qwenWebShellDaemonWorkspaceProviderCopies", Rd = 8;
|
|
12262
12313
|
function Zi() {
|
|
12263
12314
|
const e = globalThis;
|
|
12264
12315
|
return e[Pd] ??= /* @__PURE__ */ new Map();
|
|
@@ -12267,7 +12318,7 @@ function zr(e, t) {
|
|
|
12267
12318
|
const o = Zi(), s = t || o.get(e) === "provided" ? "provided" : "rendered";
|
|
12268
12319
|
Ed(o, e, s, Rd);
|
|
12269
12320
|
}
|
|
12270
|
-
const
|
|
12321
|
+
const Sa = /* @__PURE__ */ new Set(), $d = 2e3;
|
|
12271
12322
|
function Xp({
|
|
12272
12323
|
baseUrl: e,
|
|
12273
12324
|
token: t,
|
|
@@ -12319,7 +12370,7 @@ function Xp({
|
|
|
12319
12370
|
}, [r]);
|
|
12320
12371
|
dt(() => {
|
|
12321
12372
|
if (!r) return;
|
|
12322
|
-
H("connecting"), x(void 0), A(void 0),
|
|
12373
|
+
H("connecting"), x(void 0), A(void 0), Sa.delete(r);
|
|
12323
12374
|
let pe = !1;
|
|
12324
12375
|
const de = M(), Ye = g.current;
|
|
12325
12376
|
return de.then((Pe) => {
|
|
@@ -12327,8 +12378,8 @@ function Xp({
|
|
|
12327
12378
|
}).catch((Pe) => {
|
|
12328
12379
|
!pe && l.current === r && g.current === Ye && (x(Pe instanceof Error ? Pe : new Error(String(Pe))), H("error"));
|
|
12329
12380
|
}), () => {
|
|
12330
|
-
pe = !0,
|
|
12331
|
-
|
|
12381
|
+
pe = !0, Sa.add(r), queueMicrotask(() => {
|
|
12382
|
+
Sa.delete(r) && r.dispose();
|
|
12332
12383
|
});
|
|
12333
12384
|
};
|
|
12334
12385
|
}, [r, M]);
|
|
@@ -12413,10 +12464,10 @@ function Xp({
|
|
|
12413
12464
|
le,
|
|
12414
12465
|
oe
|
|
12415
12466
|
]);
|
|
12416
|
-
return /* @__PURE__ */ Yt(
|
|
12467
|
+
return /* @__PURE__ */ Yt(er.Provider, { value: ne, children: a });
|
|
12417
12468
|
}
|
|
12418
12469
|
function ss() {
|
|
12419
|
-
const e = Ot(
|
|
12470
|
+
const e = Ot(er);
|
|
12420
12471
|
if (!e) {
|
|
12421
12472
|
const t = Zi(), o = t.get(Xn), s = [...t.keys()].filter(
|
|
12422
12473
|
(a) => a !== Xn
|
|
@@ -12431,7 +12482,7 @@ function vo() {
|
|
|
12431
12482
|
return ss().actions;
|
|
12432
12483
|
}
|
|
12433
12484
|
function Md() {
|
|
12434
|
-
return Ot(
|
|
12485
|
+
return Ot(er);
|
|
12435
12486
|
}
|
|
12436
12487
|
/**
|
|
12437
12488
|
* @license
|
|
@@ -12491,20 +12542,20 @@ function Ud(e) {
|
|
|
12491
12542
|
return;
|
|
12492
12543
|
const n = tn(e.rawOutput), a = Xo(tn(n?.plan), "id") !== void 0, r = tn(e.rawInput), i = Qr(r);
|
|
12493
12544
|
if (i) {
|
|
12494
|
-
const h =
|
|
12545
|
+
const h = Ta(i);
|
|
12495
12546
|
return h.length > 0 || s ? h : void 0;
|
|
12496
12547
|
}
|
|
12497
12548
|
const l = Qr(n);
|
|
12498
12549
|
if (l) {
|
|
12499
|
-
const h =
|
|
12550
|
+
const h = Ta(l);
|
|
12500
12551
|
return h.length > 0 || s || a ? h : void 0;
|
|
12501
12552
|
}
|
|
12502
12553
|
const m = Array.isArray(n?.entries) ? n.entries : void 0;
|
|
12503
12554
|
if (!m) return;
|
|
12504
|
-
const g =
|
|
12555
|
+
const g = Ta(m);
|
|
12505
12556
|
return g.length > 0 || s || a ? g : void 0;
|
|
12506
12557
|
}
|
|
12507
|
-
function
|
|
12558
|
+
function Ta(e) {
|
|
12508
12559
|
return e.flatMap((o, s) => {
|
|
12509
12560
|
const n = tn(o), a = Xo(n, "content");
|
|
12510
12561
|
if (!a) return [];
|
|
@@ -12580,14 +12631,14 @@ function Hd(e, t) {
|
|
|
12580
12631
|
* Copyright 2025 Qwen Team
|
|
12581
12632
|
* SPDX-License-Identifier: Apache-2.0
|
|
12582
12633
|
*/
|
|
12583
|
-
const
|
|
12634
|
+
const Wa = /* @__PURE__ */ new Set();
|
|
12584
12635
|
let Ws;
|
|
12585
12636
|
function Yr() {
|
|
12586
12637
|
return Ws;
|
|
12587
12638
|
}
|
|
12588
12639
|
function Gd(e) {
|
|
12589
|
-
return
|
|
12590
|
-
|
|
12640
|
+
return Wa.add(e), () => {
|
|
12641
|
+
Wa.delete(e);
|
|
12591
12642
|
};
|
|
12592
12643
|
}
|
|
12593
12644
|
function Jr(e) {
|
|
@@ -12597,7 +12648,7 @@ function Ts() {
|
|
|
12597
12648
|
Ws !== void 0 && (Ws = void 0, el());
|
|
12598
12649
|
}
|
|
12599
12650
|
function el() {
|
|
12600
|
-
for (const e of
|
|
12651
|
+
for (const e of Wa)
|
|
12601
12652
|
e();
|
|
12602
12653
|
}
|
|
12603
12654
|
function Xr(e) {
|
|
@@ -12615,14 +12666,14 @@ function Xr(e) {
|
|
|
12615
12666
|
* Copyright 2025 Qwen Team
|
|
12616
12667
|
* SPDX-License-Identifier: Apache-2.0
|
|
12617
12668
|
*/
|
|
12618
|
-
const
|
|
12669
|
+
const ja = /* @__PURE__ */ new Set(), tl = Object.freeze([]), Ca = 64;
|
|
12619
12670
|
let en = tl;
|
|
12620
12671
|
function Zr() {
|
|
12621
12672
|
return en;
|
|
12622
12673
|
}
|
|
12623
12674
|
function zd(e) {
|
|
12624
|
-
return
|
|
12625
|
-
|
|
12675
|
+
return ja.add(e), () => {
|
|
12676
|
+
ja.delete(e);
|
|
12626
12677
|
};
|
|
12627
12678
|
}
|
|
12628
12679
|
function ei(e) {
|
|
@@ -12635,10 +12686,10 @@ function ei(e) {
|
|
|
12635
12686
|
...e.originatorClientId ? { originatorClientId: e.originatorClientId } : {}
|
|
12636
12687
|
}
|
|
12637
12688
|
];
|
|
12638
|
-
if (t.length >
|
|
12639
|
-
const o = t.length -
|
|
12689
|
+
if (t.length > Ca) {
|
|
12690
|
+
const o = t.length - Ca;
|
|
12640
12691
|
console.debug(
|
|
12641
|
-
`[mid-turn] sidechannel buffer over ${
|
|
12692
|
+
`[mid-turn] sidechannel buffer over ${Ca}; evicting ${o} oldest batch(es)`
|
|
12642
12693
|
), en = t.slice(o);
|
|
12643
12694
|
} else
|
|
12644
12695
|
en = t;
|
|
@@ -12650,7 +12701,7 @@ function Vd(e) {
|
|
|
12650
12701
|
o.length !== en.length && (en = o.length === 0 ? tl : o, ol());
|
|
12651
12702
|
}
|
|
12652
12703
|
function ol() {
|
|
12653
|
-
for (const e of
|
|
12704
|
+
for (const e of ja)
|
|
12654
12705
|
e();
|
|
12655
12706
|
}
|
|
12656
12707
|
function ti(e) {
|
|
@@ -12683,7 +12734,7 @@ function ti(e) {
|
|
|
12683
12734
|
* Copyright 2025 Qwen Team
|
|
12684
12735
|
* SPDX-License-Identifier: Apache-2.0
|
|
12685
12736
|
*/
|
|
12686
|
-
const
|
|
12737
|
+
const qa = /* @__PURE__ */ new Set(), Ha = /* @__PURE__ */ new Set();
|
|
12687
12738
|
let nl = 0, En = [];
|
|
12688
12739
|
function Zp() {
|
|
12689
12740
|
return nl;
|
|
@@ -12692,18 +12743,18 @@ function em() {
|
|
|
12692
12743
|
return En;
|
|
12693
12744
|
}
|
|
12694
12745
|
function tm(e) {
|
|
12695
|
-
return
|
|
12696
|
-
|
|
12746
|
+
return qa.add(e), () => {
|
|
12747
|
+
qa.delete(e);
|
|
12697
12748
|
};
|
|
12698
12749
|
}
|
|
12699
12750
|
function om(e) {
|
|
12700
|
-
return
|
|
12701
|
-
|
|
12751
|
+
return Ha.add(e), () => {
|
|
12752
|
+
Ha.delete(e);
|
|
12702
12753
|
};
|
|
12703
12754
|
}
|
|
12704
12755
|
function Kd() {
|
|
12705
12756
|
nl++;
|
|
12706
|
-
for (const e of
|
|
12757
|
+
for (const e of qa)
|
|
12707
12758
|
try {
|
|
12708
12759
|
e();
|
|
12709
12760
|
} catch (t) {
|
|
@@ -12711,7 +12762,7 @@ function Kd() {
|
|
|
12711
12762
|
}
|
|
12712
12763
|
}
|
|
12713
12764
|
function sl() {
|
|
12714
|
-
for (const e of
|
|
12765
|
+
for (const e of Ha)
|
|
12715
12766
|
try {
|
|
12716
12767
|
e();
|
|
12717
12768
|
} catch (t) {
|
|
@@ -12758,7 +12809,7 @@ function Qt(e, t) {
|
|
|
12758
12809
|
* SPDX-License-Identifier: Apache-2.0
|
|
12759
12810
|
*/
|
|
12760
12811
|
const il = 4096;
|
|
12761
|
-
function
|
|
12812
|
+
function tr(e) {
|
|
12762
12813
|
const t = [];
|
|
12763
12814
|
let o;
|
|
12764
12815
|
for (const s of e.slice(0, il).replace(/[\uD800-\uDBFF]$/, "").split(`
|
|
@@ -12784,7 +12835,7 @@ function er(e) {
|
|
|
12784
12835
|
return t;
|
|
12785
12836
|
}
|
|
12786
12837
|
function sm(e, t) {
|
|
12787
|
-
const o =
|
|
12838
|
+
const o = tr(e).join(" "), s = Array.from(o);
|
|
12788
12839
|
return s.length > t ? s.slice(0, t - 1).join("") + "…" : o;
|
|
12789
12840
|
}
|
|
12790
12841
|
function Yd(e) {
|
|
@@ -12924,7 +12975,7 @@ function cm(e) {
|
|
|
12924
12975
|
return "○";
|
|
12925
12976
|
}
|
|
12926
12977
|
}
|
|
12927
|
-
const
|
|
12978
|
+
const Ga = {
|
|
12928
12979
|
todos: [],
|
|
12929
12980
|
planId: null,
|
|
12930
12981
|
allCompleted: !1,
|
|
@@ -12947,15 +12998,15 @@ function ou(e) {
|
|
|
12947
12998
|
l && (t = l, o = ns(i), s = r.id, n = !1);
|
|
12948
12999
|
}
|
|
12949
13000
|
}
|
|
12950
|
-
if (t.length === 0) return
|
|
13001
|
+
if (t.length === 0) return Ga;
|
|
12951
13002
|
const a = !js(t);
|
|
12952
|
-
return n ?
|
|
13003
|
+
return n ? Ga : { todos: t, planId: o, allCompleted: a, sourceMessageId: s };
|
|
12953
13004
|
}
|
|
12954
13005
|
function dm(e) {
|
|
12955
13006
|
return ou(e);
|
|
12956
13007
|
}
|
|
12957
13008
|
function um(e) {
|
|
12958
|
-
let t =
|
|
13009
|
+
let t = Ga;
|
|
12959
13010
|
for (const o of e)
|
|
12960
13011
|
if (o.role === "tool_group")
|
|
12961
13012
|
for (const s of o.tools) {
|
|
@@ -13191,7 +13242,7 @@ function ns(e) {
|
|
|
13191
13242
|
function ai(e) {
|
|
13192
13243
|
if (!pl(e)) return;
|
|
13193
13244
|
if (e.phase === "notice") {
|
|
13194
|
-
const o =
|
|
13245
|
+
const o = za(e.instructionsLimit);
|
|
13195
13246
|
return o === void 0 ? void 0 : { phase: "notice", instructionsLimit: o };
|
|
13196
13247
|
}
|
|
13197
13248
|
if (e.phase === "progress") return { phase: "progress" };
|
|
@@ -13202,7 +13253,7 @@ function ai(e) {
|
|
|
13202
13253
|
}
|
|
13203
13254
|
function uu(e) {
|
|
13204
13255
|
if (!pl(e)) return;
|
|
13205
|
-
const t =
|
|
13256
|
+
const t = za(e.originalTokenCount), o = za(e.newTokenCount);
|
|
13206
13257
|
if (t === void 0 || o === void 0)
|
|
13207
13258
|
return;
|
|
13208
13259
|
const s = e.warning;
|
|
@@ -13217,7 +13268,7 @@ function uu(e) {
|
|
|
13217
13268
|
function km(e, t, o) {
|
|
13218
13269
|
return `${t ? "~" : ""}${e.toLocaleString(o)}`;
|
|
13219
13270
|
}
|
|
13220
|
-
function
|
|
13271
|
+
function za(e) {
|
|
13221
13272
|
return typeof e == "number" && Number.isFinite(e) && Number.isInteger(e) && e >= 0 ? e : void 0;
|
|
13222
13273
|
}
|
|
13223
13274
|
function pl(e) {
|
|
@@ -13614,7 +13665,7 @@ function vm(e, t = {}) {
|
|
|
13614
13665
|
ci(oe, b.text, x.id);
|
|
13615
13666
|
break;
|
|
13616
13667
|
}
|
|
13617
|
-
const ne = G.length > 0 ? null :
|
|
13668
|
+
const ne = G.length > 0 ? null : nr(b.text);
|
|
13618
13669
|
if (ne) {
|
|
13619
13670
|
let de = null, Ye = !1, Pe = 0, Ht = 0, fn = 0, Lt = null;
|
|
13620
13671
|
for (const Re of ne)
|
|
@@ -13741,7 +13792,7 @@ function vm(e, t = {}) {
|
|
|
13741
13792
|
Au(le, G), r.set(G.callId, G);
|
|
13742
13793
|
break;
|
|
13743
13794
|
}
|
|
13744
|
-
|
|
13795
|
+
Ia(o, x.id, G, X), r.set(G.callId, G), A = null, U = null, E = !0;
|
|
13745
13796
|
break;
|
|
13746
13797
|
}
|
|
13747
13798
|
case "shell": {
|
|
@@ -13821,16 +13872,16 @@ function vm(e, t = {}) {
|
|
|
13821
13872
|
const G = r.get(W.callId);
|
|
13822
13873
|
if (G) {
|
|
13823
13874
|
const le = G.status, oe = G.endTime;
|
|
13824
|
-
W.toolName = G.toolName, b.resolved && (
|
|
13875
|
+
W.toolName = G.toolName, b.resolved && (xa(b.resolved) ? W.status = N ? W.status : "in_progress" : (W.status = n && ui(b.resolved) ? "completed" : "failed", W.endTime = b.updatedAt)), di(G, W), (Ru(le) || b.resolved && N && xa(b.resolved)) && (G.status = le, G.endTime = oe);
|
|
13825
13876
|
break;
|
|
13826
13877
|
}
|
|
13827
13878
|
if (b.resolved) {
|
|
13828
|
-
|
|
13879
|
+
xa(b.resolved) ? (N || (W.status = "in_progress"), Ia(
|
|
13829
13880
|
o,
|
|
13830
13881
|
x.id,
|
|
13831
13882
|
W,
|
|
13832
13883
|
X
|
|
13833
|
-
), r.set(W.callId, W), E = !0) : (W.status = n && ui(b.resolved) ? "completed" : "failed", W.endTime = b.updatedAt,
|
|
13884
|
+
), r.set(W.callId, W), E = !0) : (W.status = n && ui(b.resolved) ? "completed" : "failed", W.endTime = b.updatedAt, Ia(
|
|
13834
13885
|
o,
|
|
13835
13886
|
x.id,
|
|
13836
13887
|
W,
|
|
@@ -13974,7 +14025,7 @@ function Ho(e, ...t) {
|
|
|
13974
14025
|
function ci(e, t, o) {
|
|
13975
14026
|
e.subContent = (e.subContent || "") + t, e.sourceBlockIds = Ho(e.sourceBlockIds, o);
|
|
13976
14027
|
}
|
|
13977
|
-
function
|
|
14028
|
+
function Ia(e, t, o, s) {
|
|
13978
14029
|
const n = (r) => os(r), a = e[e.length - 1];
|
|
13979
14030
|
if (a && a.role === "tool_group" && a.id.startsWith("tg-") && !n(o) && !a.tools.some(n)) {
|
|
13980
14031
|
a.tools.push(o), a.sourceBlockIds = Ho(a.sourceBlockIds, t);
|
|
@@ -14064,12 +14115,12 @@ function _u(e, t) {
|
|
|
14064
14115
|
const o = qe(e.rawInput);
|
|
14065
14116
|
return e.toolName === "tool_call" && ll(e.toolName, o) !== e.toolName ? qe(o?.arguments) : o;
|
|
14066
14117
|
}
|
|
14067
|
-
return
|
|
14118
|
+
return or(e.preview);
|
|
14068
14119
|
}
|
|
14069
14120
|
function Du(e, t) {
|
|
14070
14121
|
const o = qe(e.toolCall);
|
|
14071
14122
|
if (!t && !o) return;
|
|
14072
|
-
const s = t ?
|
|
14123
|
+
const s = t ? or(e.preview) : o ? fl(o) : void 0;
|
|
14073
14124
|
if (Array.isArray(s?.questions)) return;
|
|
14074
14125
|
const n = o ? qe(o._meta) : void 0, a = t ? e.toolKind : wt(o, "kind"), r = (t ? e.toolName : wt(n, "toolName") ?? wt(o, "toolName") ?? wt(o, "name")) ?? (s?.subagent_type ? "agent" : void 0) ?? (a === "fetch" ? "web_fetch" : a), i = t ? e.toolCallId : wt(o, "toolCallId") ?? wt(o, "id");
|
|
14075
14126
|
return !i || !r ? void 0 : {
|
|
@@ -14086,13 +14137,13 @@ function Du(e, t) {
|
|
|
14086
14137
|
function Ou(e, t, o) {
|
|
14087
14138
|
const s = qe(e.toolCall), n = o ? e.toolCallId : wt(s, "toolCallId") ?? wt(s, "id");
|
|
14088
14139
|
if (!n) return;
|
|
14089
|
-
const a = o ? e.title : wt(s, "title") ?? e.title, r = o ?
|
|
14140
|
+
const a = o ? e.title : wt(s, "title") ?? e.title, r = o ? or(e.preview) : s ? fl(s) : void 0;
|
|
14090
14141
|
Array.isArray(r?.questions) && t.set(n, {
|
|
14091
14142
|
...a ? { title: a } : {},
|
|
14092
14143
|
...r ? { args: r } : {}
|
|
14093
14144
|
});
|
|
14094
14145
|
}
|
|
14095
|
-
function
|
|
14146
|
+
function xa(e) {
|
|
14096
14147
|
const [t = "", o = ""] = e.toLowerCase().split(":", 2);
|
|
14097
14148
|
return pi(t) ? !0 : t !== "selected" ? !1 : pi(o.trim());
|
|
14098
14149
|
}
|
|
@@ -14149,7 +14200,7 @@ function kl(e) {
|
|
|
14149
14200
|
} : {}
|
|
14150
14201
|
};
|
|
14151
14202
|
}
|
|
14152
|
-
function
|
|
14203
|
+
function or(e) {
|
|
14153
14204
|
if (e)
|
|
14154
14205
|
switch (e.kind) {
|
|
14155
14206
|
case "ask_user_question":
|
|
@@ -14309,7 +14360,7 @@ function qu(e, t) {
|
|
|
14309
14360
|
}
|
|
14310
14361
|
return null;
|
|
14311
14362
|
}
|
|
14312
|
-
function
|
|
14363
|
+
function nr(e) {
|
|
14313
14364
|
const t = [];
|
|
14314
14365
|
let o = 0, s = 0, n = !1;
|
|
14315
14366
|
for (; s < e.length; ) {
|
|
@@ -14339,7 +14390,7 @@ function or(e) {
|
|
|
14339
14390
|
return a && t.push({ kind: "text", text: a }), t.length > 0 ? t : null;
|
|
14340
14391
|
}
|
|
14341
14392
|
function bm(e) {
|
|
14342
|
-
const t =
|
|
14393
|
+
const t = nr(e);
|
|
14343
14394
|
return t ? t.filter(
|
|
14344
14395
|
(o) => o.kind === "text"
|
|
14345
14396
|
).map((o) => o.text).join(" ") : e.trim();
|
|
@@ -14439,7 +14490,7 @@ function Gu(e, t) {
|
|
|
14439
14490
|
};
|
|
14440
14491
|
}, [r]), r;
|
|
14441
14492
|
}
|
|
14442
|
-
function
|
|
14493
|
+
function Va(e) {
|
|
14443
14494
|
const t = e.slice(0, il).trimEnd().split(`
|
|
14444
14495
|
`);
|
|
14445
14496
|
for (; t.at(-1)?.startsWith("@attachment:///"); ) t.pop();
|
|
@@ -14453,7 +14504,7 @@ function gi(e, t, o) {
|
|
|
14453
14504
|
const a = t.find(
|
|
14454
14505
|
(r) => r.kind === "user" && r.promptId === n && r.parentToolCallId === void 0 && r.text.trim()
|
|
14455
14506
|
);
|
|
14456
|
-
if (a?.kind === "user" && (s.promptText =
|
|
14507
|
+
if (a?.kind === "user" && (s.promptText = Va(a.text), o?.trim() || (s.sessionTitle = tr(s.promptText)[0])), e.type === "turn_error") return s;
|
|
14457
14508
|
for (let r = t.length - 1; r >= 0; r--) {
|
|
14458
14509
|
const i = t[r];
|
|
14459
14510
|
if (i?.kind === "assistant" && i.promptId === n && i.parentToolCallId === void 0 && // A notice rendered as a `role: 'system'` row is not the turn's response,
|
|
@@ -14461,7 +14512,7 @@ function gi(e, t, o) {
|
|
|
14461
14512
|
// compression notice carries `meta.source: 'slash_command'` and is
|
|
14462
14513
|
// recognised by its payload keys instead (#12141).
|
|
14463
14514
|
!Cu(i) && i.text.trim()) {
|
|
14464
|
-
const l =
|
|
14515
|
+
const l = nr(i.text), m = l ? l.filter((g) => g.kind === "text").map((g) => g.text).join(`
|
|
14465
14516
|
`).trim() : i.text;
|
|
14466
14517
|
m && !/\{\s*"insight_(?:progress|ready|error)"\s*:/.test(m) && (s.responseText = m);
|
|
14467
14518
|
break;
|
|
@@ -14469,11 +14520,11 @@ function gi(e, t, o) {
|
|
|
14469
14520
|
}
|
|
14470
14521
|
return s;
|
|
14471
14522
|
}
|
|
14472
|
-
const
|
|
14523
|
+
const Ea = 1024;
|
|
14473
14524
|
function Sm(e) {
|
|
14474
14525
|
const t = /* @__PURE__ */ new Map(), o = /* @__PURE__ */ new Set(), s = (a, r) => JSON.stringify([a, r]), n = (a, r) => {
|
|
14475
14526
|
const i = s(a, r);
|
|
14476
|
-
return t.get(a)?.pending.delete(r), o.has(i) ? !1 : (o.add(i), o.size >
|
|
14527
|
+
return t.get(a)?.pending.delete(r), o.has(i) ? !1 : (o.add(i), o.size > Ea && o.delete(o.values().next().value), !0);
|
|
14477
14528
|
};
|
|
14478
14529
|
return {
|
|
14479
14530
|
retain(a) {
|
|
@@ -14489,10 +14540,10 @@ function Sm(e) {
|
|
|
14489
14540
|
admit(a, r, i) {
|
|
14490
14541
|
r && !o.has(s(a, r)) && t.get(a)?.pending.set(
|
|
14491
14542
|
r,
|
|
14492
|
-
i === void 0 ? void 0 :
|
|
14543
|
+
i === void 0 ? void 0 : Va(i).trim()
|
|
14493
14544
|
);
|
|
14494
14545
|
const l = t.get(a)?.pending;
|
|
14495
|
-
l && l.size >
|
|
14546
|
+
l && l.size > Ea && l.delete(l.keys().next().value);
|
|
14496
14547
|
},
|
|
14497
14548
|
remove(a, r) {
|
|
14498
14549
|
t.has(a) && r && n(a, r);
|
|
@@ -14515,8 +14566,8 @@ function Sm(e) {
|
|
|
14515
14566
|
if (!l && (i.type === "pending_prompt_added" || i.type === "pending_prompt_started")) {
|
|
14516
14567
|
!o.has(s(a, A)) && !g.pending.has(A) && g.pending.set(
|
|
14517
14568
|
A,
|
|
14518
|
-
typeof y.text == "string" ?
|
|
14519
|
-
), g.pending.size >
|
|
14569
|
+
typeof y.text == "string" ? Va(y.text).trim() : void 0
|
|
14570
|
+
), g.pending.size > Ea && g.pending.delete(g.pending.keys().next().value);
|
|
14520
14571
|
return;
|
|
14521
14572
|
}
|
|
14522
14573
|
if (i.type === "pending_prompt_completed" && y.state === "removed") {
|
|
@@ -14528,7 +14579,7 @@ function Sm(e) {
|
|
|
14528
14579
|
const E = g.pending.get(A);
|
|
14529
14580
|
if (n(a, A))
|
|
14530
14581
|
try {
|
|
14531
|
-
const O = typeof m == "function" ? m() : m, P = O?.promptText || E, j = O?.sessionTitle || (P ?
|
|
14582
|
+
const O = typeof m == "function" ? m() : m, P = O?.promptText || E, j = O?.sessionTitle || (P ? tr(P)[0] : void 0);
|
|
14532
14583
|
e({
|
|
14533
14584
|
...O,
|
|
14534
14585
|
...j ? { sessionTitle: j } : {},
|
|
@@ -14654,7 +14705,7 @@ class Xu {
|
|
|
14654
14705
|
o,
|
|
14655
14706
|
s.events,
|
|
14656
14707
|
this.liveRecordIds
|
|
14657
|
-
), r =
|
|
14708
|
+
), r = Aa(
|
|
14658
14709
|
a.page.blocks,
|
|
14659
14710
|
this.liveRecordIds
|
|
14660
14711
|
);
|
|
@@ -14752,7 +14803,7 @@ class Xu {
|
|
|
14752
14803
|
i
|
|
14753
14804
|
), m = [...l.encounteredRecordIds].some(
|
|
14754
14805
|
(x) => this.liveRecordIds.has(x)
|
|
14755
|
-
), g =
|
|
14806
|
+
), g = Aa(
|
|
14756
14807
|
l.page.blocks,
|
|
14757
14808
|
i
|
|
14758
14809
|
), h = g.length === l.page.blocks.length ? l.page : this.pageFromBlocks(l.page.id, s, g), y = this.fitPageWithinBudget(
|
|
@@ -14920,7 +14971,7 @@ class Xu {
|
|
|
14920
14971
|
m.encounteredRecordIds,
|
|
14921
14972
|
t,
|
|
14922
14973
|
o
|
|
14923
|
-
), A =
|
|
14974
|
+
), A = Aa(g.blocks, l), U = A.length === g.blocks.length ? g : this.pageFromBlocks(g.id, s, A), E = ("beforeRecordId" in r || i.kind === "gap" && i.beforeAnchor === !0) && a?.fromAnchor === !0, O = (o === "older" || a && !a.fromAnchor) && U.lastRecordId ? {
|
|
14924
14975
|
kind: "gap",
|
|
14925
14976
|
...i.kind === "gap" && i.beforeAnchor ? { beforeAnchor: !0 } : {},
|
|
14926
14977
|
anchorRecordId: i.kind === "gap" ? i.anchorRecordId : "anchorTurnId" in r ? r.anchorTurnId : r.beforeRecordId,
|
|
@@ -15007,7 +15058,7 @@ class Xu {
|
|
|
15007
15058
|
const n = /* @__PURE__ */ new Set(), a = /* @__PURE__ */ new Map();
|
|
15008
15059
|
let r = 160 + t.length * 2 + o.length * 2;
|
|
15009
15060
|
for (const l of s) {
|
|
15010
|
-
r +=
|
|
15061
|
+
r += Ka(l);
|
|
15011
15062
|
for (const m of l.sourceRecordIds ?? [])
|
|
15012
15063
|
n.add(m), l.kind === "user" && a.set(m, l.id);
|
|
15013
15064
|
}
|
|
@@ -15257,7 +15308,7 @@ class Xu {
|
|
|
15257
15308
|
return { kind: "loadable", request: r };
|
|
15258
15309
|
}
|
|
15259
15310
|
}
|
|
15260
|
-
function
|
|
15311
|
+
function Aa(e, t) {
|
|
15261
15312
|
return e.filter(
|
|
15262
15313
|
(o) => !o.sourceRecordIds?.some((s) => t.has(s))
|
|
15263
15314
|
);
|
|
@@ -15659,7 +15710,7 @@ function ep(e = {}) {
|
|
|
15659
15710
|
limit: t,
|
|
15660
15711
|
...ce === void 0 ? {} : { snapshot: ce, start: to }
|
|
15661
15712
|
});
|
|
15662
|
-
return ae(),
|
|
15713
|
+
return ae(), Pa(Ke, C, ce, t), Ke;
|
|
15663
15714
|
};
|
|
15664
15715
|
let _e = await fe();
|
|
15665
15716
|
const io = _e.snapshot;
|
|
@@ -16201,7 +16252,7 @@ function ep(e = {}) {
|
|
|
16201
16252
|
}
|
|
16202
16253
|
}
|
|
16203
16254
|
function Jt(u) {
|
|
16204
|
-
if (
|
|
16255
|
+
if (Pa(u, r, void 0, t), u.start + u.turns.length !== u.totalTurns)
|
|
16205
16256
|
throw new Error("Turn-index head did not contain the newest page");
|
|
16206
16257
|
const f = gt(u), v = In(U), k = new Map(
|
|
16207
16258
|
[...v].map(([_, D]) => [D.turnId, _])
|
|
@@ -16224,7 +16275,7 @@ function ep(e = {}) {
|
|
|
16224
16275
|
});
|
|
16225
16276
|
}
|
|
16226
16277
|
function ge(u, f, v, k, w) {
|
|
16227
|
-
|
|
16278
|
+
Pa(u, r, f, t);
|
|
16228
16279
|
const C = In(U), F = new Map(
|
|
16229
16280
|
[...C].map(([D, K]) => [K.turnId, D])
|
|
16230
16281
|
);
|
|
@@ -16368,7 +16419,7 @@ function In(e) {
|
|
|
16368
16419
|
for (const s of o.turns) t.set(s.ordinal, s);
|
|
16369
16420
|
return t;
|
|
16370
16421
|
}
|
|
16371
|
-
function
|
|
16422
|
+
function Pa(e, t, o, s) {
|
|
16372
16423
|
if (!t || e.sessionId !== t || o !== void 0 && e.snapshot !== o || e.snapshot.length === 0 || !Number.isInteger(e.start) || e.start < 0 || !Number.isInteger(e.totalTurns) || e.totalTurns < 0 || e.start + e.turns.length > e.totalTurns || e.turns.length > s || new Set(e.turns.map((n) => n.turnId)).size !== e.turns.length || e.turns.some(
|
|
16373
16424
|
(n, a) => n.ordinal !== e.start + a || n.turnId.length === 0
|
|
16374
16425
|
))
|
|
@@ -16430,7 +16481,7 @@ function Sl(e) {
|
|
|
16430
16481
|
if (!(typeof t != "object" || t === null || !("code" in t)))
|
|
16431
16482
|
return typeof t.code == "string" ? t.code : void 0;
|
|
16432
16483
|
}
|
|
16433
|
-
const Hn = "session_transcript_pagination",
|
|
16484
|
+
const Hn = "session_transcript_pagination", Ra = "client_identity", sp = "workspace_acp_preheat", ap = "workspace_acp_status", rp = "workspace_skills_config_runtime";
|
|
16434
16485
|
function Ti(e) {
|
|
16435
16486
|
if (e !== void 0) {
|
|
16436
16487
|
if (xc.includes(e))
|
|
@@ -16453,7 +16504,7 @@ function ho(e, t) {
|
|
|
16453
16504
|
} : {}
|
|
16454
16505
|
};
|
|
16455
16506
|
}
|
|
16456
|
-
function
|
|
16507
|
+
function $a(e) {
|
|
16457
16508
|
if (e.type === "history_truncated")
|
|
16458
16509
|
try {
|
|
16459
16510
|
return Ce(e.data) ? Po(e.data, "recordId") : void 0;
|
|
@@ -16518,7 +16569,7 @@ function cp(e, t, o) {
|
|
|
16518
16569
|
e.blocks,
|
|
16519
16570
|
g
|
|
16520
16571
|
), y = h.reduce(
|
|
16521
|
-
(E, O) => E +
|
|
16572
|
+
(E, O) => E + Ka(O),
|
|
16522
16573
|
0
|
|
16523
16574
|
) - e.retainedBytes, A = h.length - e.blocks.length, U = A >= o || y >= e.maxRetainedBytes;
|
|
16524
16575
|
return A + e.blocks.length > o ? {
|
|
@@ -16591,7 +16642,7 @@ function Ii(e, t) {
|
|
|
16591
16642
|
...e,
|
|
16592
16643
|
blocks: a,
|
|
16593
16644
|
retainedBytes: a.reduce(
|
|
16594
|
-
(r, i) => r +
|
|
16645
|
+
(r, i) => r + Ka(i),
|
|
16595
16646
|
0
|
|
16596
16647
|
),
|
|
16597
16648
|
nextOrdinal: t.nextOrdinal,
|
|
@@ -16670,12 +16721,12 @@ function Es(e) {
|
|
|
16670
16721
|
}
|
|
16671
16722
|
const Il = It(
|
|
16672
16723
|
void 0
|
|
16673
|
-
), xl = It(void 0),
|
|
16724
|
+
), xl = It(void 0), sr = It(
|
|
16674
16725
|
void 0
|
|
16675
16726
|
), El = It(void 0), Al = It(void 0), Pl = It(
|
|
16676
16727
|
void 0
|
|
16677
|
-
), Rl = It(void 0), $l = It(void 0), Ml = It(void 0), _l = It(void 0),
|
|
16678
|
-
...
|
|
16728
|
+
), Rl = It(void 0), $l = It(void 0), Ml = It(void 0), _l = It(void 0), ar = /* @__PURE__ */ new Set([401, 403]), up = /* @__PURE__ */ new Set([
|
|
16729
|
+
...ar,
|
|
16679
16730
|
...rl
|
|
16680
16731
|
]), pp = 5e4, mp = 16, gp = {
|
|
16681
16732
|
memoryVersion: 0,
|
|
@@ -16899,8 +16950,8 @@ function Om(e) {
|
|
|
16899
16950
|
We
|
|
16900
16951
|
), Ee = Y(We);
|
|
16901
16952
|
Ee.current = We;
|
|
16902
|
-
const Ul = Y(r), Rn = b?.capabilities ?? pe.current ?? We.capabilities, $n = Rn && !Rn.features.includes(
|
|
16903
|
-
Rn && !Rn.features.includes(
|
|
16953
|
+
const Ul = Y(r), Rn = b?.capabilities ?? pe.current ?? We.capabilities, $n = Rn && !Rn.features.includes(Ra) ? r : Ul.current;
|
|
16954
|
+
Rn && !Rn.features.includes(Ra) && $n && ($t.current = ys($n));
|
|
16904
16955
|
const kn = ue(
|
|
16905
16956
|
($) => {
|
|
16906
16957
|
const I = typeof $ == "function" ? $(Ee.current) : $;
|
|
@@ -16913,7 +16964,7 @@ function Om(e) {
|
|
|
16913
16964
|
($) => $.capabilities === b.capabilities ? $ : { ...$, capabilities: b.capabilities }
|
|
16914
16965
|
);
|
|
16915
16966
|
}, [b?.capabilities]);
|
|
16916
|
-
const Bl = Y(0), [
|
|
16967
|
+
const Bl = Y(0), [rr, zs] = rt([]), Nt = ue(($) => {
|
|
16917
16968
|
const I = {
|
|
16918
16969
|
...$,
|
|
16919
16970
|
id: $.id ?? `daemon-notice-${Date.now()}-${++Bl.current}`,
|
|
@@ -16928,12 +16979,12 @@ function Om(e) {
|
|
|
16928
16979
|
zs([]);
|
|
16929
16980
|
}, []), Nl = st(
|
|
16930
16981
|
() => ({
|
|
16931
|
-
notices:
|
|
16982
|
+
notices: rr,
|
|
16932
16983
|
dismissNotice: Oo,
|
|
16933
16984
|
clearNotices: rs
|
|
16934
16985
|
}),
|
|
16935
|
-
[rs, Oo,
|
|
16936
|
-
), [Wl,
|
|
16986
|
+
[rs, Oo, rr]
|
|
16987
|
+
), [Wl, ir] = rt(gp);
|
|
16937
16988
|
dt(() => {
|
|
16938
16989
|
let $ = ge.getBlockChangeSummary?.();
|
|
16939
16990
|
const I = () => {
|
|
@@ -16946,7 +16997,7 @@ function Om(e) {
|
|
|
16946
16997
|
};
|
|
16947
16998
|
return gt.observeLiveBlocks(ge.getSnapshot().blocks), ge.subscribe(I);
|
|
16948
16999
|
}, [ge, gt]);
|
|
16949
|
-
const
|
|
17000
|
+
const lr = ue(
|
|
16950
17001
|
($, I, Q) => {
|
|
16951
17002
|
const re = ee.current;
|
|
16952
17003
|
if (!re)
|
|
@@ -17001,12 +17052,12 @@ function Om(e) {
|
|
|
17001
17052
|
};
|
|
17002
17053
|
},
|
|
17003
17054
|
[Nt, Oo]
|
|
17004
|
-
),
|
|
17055
|
+
), cr = Rn?.features.includes(zu) ?? !1;
|
|
17005
17056
|
dt(() => {
|
|
17006
17057
|
const $ = ee.current, I = We.status === "connected" && $?.sessionId === We.sessionId ? $ : void 0;
|
|
17007
17058
|
gt.configure({
|
|
17008
17059
|
sessionId: We.sessionId,
|
|
17009
|
-
supported:
|
|
17060
|
+
supported: cr,
|
|
17010
17061
|
...I ? {
|
|
17011
17062
|
client: {
|
|
17012
17063
|
owner: I,
|
|
@@ -17015,20 +17066,20 @@ function Om(e) {
|
|
|
17015
17066
|
...Q,
|
|
17016
17067
|
...Ze.current === "summary" ? { compactedReplayMode: "summary" } : {}
|
|
17017
17068
|
}),
|
|
17018
|
-
materializeTranscriptEvents:
|
|
17069
|
+
materializeTranscriptEvents: lr
|
|
17019
17070
|
}
|
|
17020
17071
|
} : {}
|
|
17021
17072
|
});
|
|
17022
17073
|
}, [
|
|
17023
17074
|
We.sessionId,
|
|
17024
17075
|
We.status,
|
|
17025
|
-
|
|
17076
|
+
lr,
|
|
17026
17077
|
gt,
|
|
17027
|
-
|
|
17078
|
+
cr
|
|
17028
17079
|
]);
|
|
17029
17080
|
const Lo = Y(() => !1), Vo = Y(
|
|
17030
17081
|
() => !1
|
|
17031
|
-
),
|
|
17082
|
+
), dr = Y(() => {
|
|
17032
17083
|
}), Vs = Y(!1);
|
|
17033
17084
|
dt(() => (Vs.current = !0, () => {
|
|
17034
17085
|
Vs.current = !1, w.current?.controller?.abort(), w.current = void 0, F.current = void 0;
|
|
@@ -17098,7 +17149,7 @@ function Om(e) {
|
|
|
17098
17149
|
}, ye = () => {
|
|
17099
17150
|
it(), Wt(!0);
|
|
17100
17151
|
};
|
|
17101
|
-
|
|
17152
|
+
dr.current = ye;
|
|
17102
17153
|
const lt = (me) => {
|
|
17103
17154
|
ye(), ge.dispatch(me);
|
|
17104
17155
|
}, yt = () => {
|
|
@@ -17131,16 +17182,16 @@ function Om(e) {
|
|
|
17131
17182
|
if (!Ie && (await Promise.resolve(), Q))
|
|
17132
17183
|
return;
|
|
17133
17184
|
const me = de.current ?? new Ms({ baseUrl: W, token: N });
|
|
17134
|
-
let Se, kt, Qe = ce, So = !B.current && !ce && wn > 0, oo = 0, Ko, an = !1, On = !1, Zs = !1,
|
|
17185
|
+
let Se, kt, Qe = ce, So = !B.current && !ce && wn > 0, oo = 0, Ko, an = !1, On = !1, Zs = !1, mr = () => !1;
|
|
17135
17186
|
const ea = (Qo) => {
|
|
17136
17187
|
const To = D.current;
|
|
17137
17188
|
return To?.sessionId !== void 0 && Qo !== void 0 && To?.workspaceCwd === Qo.workspaceCwd && To.sessionId === Qo.sessionId ? To.active : void 0;
|
|
17138
|
-
}, vn = (Qo = Se ?? ee.current ?? Ee.current) =>
|
|
17189
|
+
}, vn = (Qo = Se ?? ee.current ?? Ee.current) => mr() || Ee.current.backgroundTurn ? !1 : ea(Qo) === !0 ? (console.debug(
|
|
17139
17190
|
"[DaemonSessionProvider] settle skipped: daemon reports the prompt in flight"
|
|
17140
17191
|
), !1) : !0;
|
|
17141
17192
|
if (!ce && !Qe && !So && (Ee.current.standaloneSession?.creationRecovery || B.current && Ee.current.status === "error"))
|
|
17142
17193
|
return;
|
|
17143
|
-
let ta = !1,
|
|
17194
|
+
let ta = !1, gr = !1, hr = !1;
|
|
17144
17195
|
for (; !Q && !I.signal.aborted; ) {
|
|
17145
17196
|
const Qo = an;
|
|
17146
17197
|
an = !1;
|
|
@@ -17245,11 +17296,11 @@ function Om(e) {
|
|
|
17245
17296
|
cn.reason
|
|
17246
17297
|
);
|
|
17247
17298
|
const ws = Ve.status === "fulfilled" ? Ve.value : void 0, ks = _s(ws), {
|
|
17248
|
-
commands:
|
|
17299
|
+
commands: Er,
|
|
17249
17300
|
skills: ic
|
|
17250
17301
|
} = fa(
|
|
17251
17302
|
co.status === "fulfilled" ? co.value : void 0
|
|
17252
|
-
),
|
|
17303
|
+
), Ar = Ee.current.workspaceCwd === Ge && (co.status === "rejected" || B.current && Er.length === 0);
|
|
17253
17304
|
be((Tt) => ({
|
|
17254
17305
|
...Tt,
|
|
17255
17306
|
status: "connected",
|
|
@@ -17263,8 +17314,8 @@ function Om(e) {
|
|
|
17263
17314
|
contextWindow: ks.contextWindow,
|
|
17264
17315
|
providers: ws,
|
|
17265
17316
|
capabilities: we,
|
|
17266
|
-
commands:
|
|
17267
|
-
skills:
|
|
17317
|
+
commands: Ar ? Tt.commands : !P || co.status === "rejected" ? void 0 : Er,
|
|
17318
|
+
skills: Ar ? Tt.skills : !P || co.status === "rejected" ? void 0 : ic
|
|
17268
17319
|
})), P && lo ? (async () => {
|
|
17269
17320
|
try {
|
|
17270
17321
|
const Tt = await lo.ensureRuntime(), No = await _d(
|
|
@@ -17315,7 +17366,7 @@ function Om(e) {
|
|
|
17315
17366
|
missingSession: !1,
|
|
17316
17367
|
loadingTranscript: !0
|
|
17317
17368
|
}));
|
|
17318
|
-
const Kt = v.current, ze = Kt !== void 0 && Kt.sessionId === ke &&
|
|
17369
|
+
const Kt = v.current, ze = Kt !== void 0 && Kt.sessionId === ke && ba(
|
|
17319
17370
|
Kt.sessionContext,
|
|
17320
17371
|
ct
|
|
17321
17372
|
) ? Kt : void 0, Ae = {
|
|
@@ -17461,7 +17512,7 @@ function Om(e) {
|
|
|
17461
17512
|
...he.replaySnapshot.compactedReplay,
|
|
17462
17513
|
...he.replaySnapshot.liveJournal
|
|
17463
17514
|
];
|
|
17464
|
-
jt = Dc(rc), ft =
|
|
17515
|
+
jt = Dc(rc), ft = Ja(jt), Se = he, Qe = Se.sessionId, So = !1, Xt.current = Se.sessionId, ee.current = Se;
|
|
17465
17516
|
}
|
|
17466
17517
|
const L = Se, St = Ds(
|
|
17467
17518
|
L.session
|
|
@@ -17488,7 +17539,7 @@ function Om(e) {
|
|
|
17488
17539
|
at.current,
|
|
17489
17540
|
L.sessionId
|
|
17490
17541
|
);
|
|
17491
|
-
|
|
17542
|
+
mr = Io, Lo.current = Io, Vo.current = ls, Ue(
|
|
17492
17543
|
(S) => Io() ? "streaming" : (
|
|
17493
17544
|
// A Last-Event-ID resume on the same session is not a turn
|
|
17494
17545
|
// boundary. `hasSessionActivePrompt()` only knows about
|
|
@@ -17500,14 +17551,14 @@ function Om(e) {
|
|
|
17500
17551
|
je === !0 && S !== "idle" ? S : "idle"
|
|
17501
17552
|
)
|
|
17502
17553
|
);
|
|
17503
|
-
const aa = v.current, cs = aa?.sessionId === L.sessionId &&
|
|
17554
|
+
const aa = v.current, cs = aa?.sessionId === L.sessionId && ba(
|
|
17504
17555
|
aa.sessionContext,
|
|
17505
17556
|
Xe.current
|
|
17506
17557
|
) ? aa : void 0;
|
|
17507
17558
|
Xe.current = St;
|
|
17508
17559
|
const { compactedReplay: zl, liveJournal: ra } = L.replaySnapshot, yn = [...zl, ...ra], ds = Be?.markerBlockId !== void 0 && ge.getSnapshot().blocks.some(
|
|
17509
17560
|
(S) => S.id === Be?.markerBlockId
|
|
17510
|
-
), Ln = yn.filter((S) => S.type === "session_update").map(
|
|
17561
|
+
), Ln = yn.filter((S) => S.type === "session_update").map($a).find((S) => S !== void 0) ?? yn.filter((S) => S.type === "history_truncated").map($a).find((S) => S !== void 0) ?? L.historyAnchorRecordId, Vl = yn.some(
|
|
17511
17562
|
Tl
|
|
17512
17563
|
), us = Be ? Ne.current.hasMore : Array.isArray(kt?.features) && kt.features.includes(
|
|
17513
17564
|
Hn
|
|
@@ -17659,7 +17710,7 @@ function Om(e) {
|
|
|
17659
17710
|
);
|
|
17660
17711
|
if (lo.length > 0 && Ai(
|
|
17661
17712
|
lo,
|
|
17662
|
-
|
|
17713
|
+
ir,
|
|
17663
17714
|
Mt ? L.workspaceCwd : void 0,
|
|
17664
17715
|
!1
|
|
17665
17716
|
), xo) {
|
|
@@ -17675,7 +17726,7 @@ function Om(e) {
|
|
|
17675
17726
|
});
|
|
17676
17727
|
}
|
|
17677
17728
|
for (const ke of yn) {
|
|
17678
|
-
|
|
17729
|
+
Ma(
|
|
17679
17730
|
at.current,
|
|
17680
17731
|
Zt.current,
|
|
17681
17732
|
L.sessionId,
|
|
@@ -17724,13 +17775,13 @@ function Om(e) {
|
|
|
17724
17775
|
loadingTranscript: void 0,
|
|
17725
17776
|
catchingUp: Fn ? S.catchingUp : $e || L.lastEventId != null || void 0
|
|
17726
17777
|
})), cs && (Ys.current = L.sessionId, Js.current = St, Xs.current = void 0, v.current = void 0, cs.timeout !== void 0 && clearTimeout(cs.timeout), q.current === L && (q.current = void 0), cs.resolve());
|
|
17727
|
-
const ia = Qo || Co && Ee.current.commands !== void 0 && Ee.current.skills !== void 0 && Ee.current.supportedCommands !== void 0 && Ee.current.context !== void 0,
|
|
17778
|
+
const ia = Qo || Co && Ee.current.commands !== void 0 && Ee.current.skills !== void 0 && Ee.current.supportedCommands !== void 0 && Ee.current.context !== void 0, kr = $o.current.get(L) ?? 0, ps = Ee.current.sessionId === L.sessionId ? Ee.current.goalState : void 0, Kl = Qo ? Promise.resolve({ branch: Ee.current.gitBranch }) : Mt && O ? L.workspaceCwd ? me.workspaceByCwd(L.workspaceCwd).workspaceGit() : me.workspaceGit() : Promise.resolve(void 0), vr = !ia || !!Ee.current.context?.recovery, br = vr ? Jn(
|
|
17728
17779
|
Pt.current,
|
|
17729
17780
|
L
|
|
17730
17781
|
) : void 0, Ql = Promise.allSettled([
|
|
17731
17782
|
ia || !Mt ? Promise.resolve(void 0) : me.workspaceProviders(),
|
|
17732
17783
|
ia ? Promise.resolve(void 0) : L.supportedCommands(),
|
|
17733
|
-
|
|
17784
|
+
vr ? L.context() : Promise.resolve(void 0),
|
|
17734
17785
|
Kl
|
|
17735
17786
|
]), Yl = L.goal().then(
|
|
17736
17787
|
(S) => S.snapshot,
|
|
@@ -17738,7 +17789,7 @@ function Om(e) {
|
|
|
17738
17789
|
}
|
|
17739
17790
|
).then((S) => (Q || I.signal.aborted || ee.current !== L || be((we) => ee.current !== L || we.sessionId !== L.sessionId || !S && ps !== void 0 ? we : {
|
|
17740
17791
|
...we,
|
|
17741
|
-
goalState: S ?
|
|
17792
|
+
goalState: S ? Fa(
|
|
17742
17793
|
we.goalState,
|
|
17743
17794
|
S,
|
|
17744
17795
|
ps?.goal?.goalId
|
|
@@ -17753,17 +17804,17 @@ function Om(e) {
|
|
|
17753
17804
|
] = await Promise.all([Ql, Yl]);
|
|
17754
17805
|
if (Q || I.signal.aborted || ee.current !== L)
|
|
17755
17806
|
return;
|
|
17756
|
-
const
|
|
17807
|
+
const yr = la?.status === "fulfilled" ? la.value : void 0, ms = ca?.status === "fulfilled" ? ca.value : void 0, xt = da?.status === "fulfilled" ? da.value : void 0, Jl = ua?.status === "fulfilled" ? ua.value?.branch ?? void 0 : void 0, Xl = pa === void 0 && ps === void 0 ? { v: 2, goal: null, activity: "idle" } : void 0, Sr = [
|
|
17757
17808
|
la?.status === "rejected" ? bt.current?.models : void 0,
|
|
17758
17809
|
ca?.status === "rejected" ? bt.current?.commands : void 0,
|
|
17759
17810
|
da?.status === "rejected" ? bt.current?.context : void 0
|
|
17760
|
-
].filter((S) => !!S), Sn = _s(
|
|
17811
|
+
].filter((S) => !!S), Sn = _s(yr), Un = Pc(xt), ma = Un && Un.models.length > 0 ? Un.models : Sn.models, gs = Un?.currentModel ?? Sn.currentModel, Zl = gs === Sn.currentModel ? Sn.contextWindow : Sn.models.find(
|
|
17761
17812
|
(S) => S.id === gs
|
|
17762
|
-
)?.contextWindow, ec = Un?.contextWindow ?? ma.find((S) => S.id === gs)?.contextWindow ?? Zl, { commands: tc, skills: oc } =
|
|
17813
|
+
)?.contextWindow, ec = Un?.contextWindow ?? ma.find((S) => S.id === gs)?.contextWindow ?? Zl, { commands: tc, skills: oc } = La(ms), Tr = Fi(xt);
|
|
17763
17814
|
if (be((S) => {
|
|
17764
17815
|
if (I.signal.aborted || ee.current !== void 0 && ee.current !== L || S.sessionId !== L.sessionId)
|
|
17765
17816
|
return S;
|
|
17766
|
-
const we =
|
|
17817
|
+
const we = kr % 2 === 0 && ($o.current.get(L) ?? 0) === kr, tt = xt?.sessionId === L.sessionId && br !== void 0 && Pt.current.get(L) === br, ot = we && xt ? xt : S.context ?? (xt?.recovery ? {
|
|
17767
17818
|
v: xt.v,
|
|
17768
17819
|
sessionId: xt.sessionId,
|
|
17769
17820
|
workspaceCwd: xt.workspaceCwd,
|
|
@@ -17790,12 +17841,12 @@ function Om(e) {
|
|
|
17790
17841
|
skills: ms !== void 0 ? oc : S.skills,
|
|
17791
17842
|
models: ma.length > 0 ? ma : S.models,
|
|
17792
17843
|
currentModel: we ? gs ?? S.currentModel : S.currentModel,
|
|
17793
|
-
currentMode: we ?
|
|
17794
|
-
planExecutionMode: we &&
|
|
17795
|
-
reasoning: we && xt !== void 0 ?
|
|
17844
|
+
currentMode: we ? Tr ?? S.currentMode ?? Sn.currentMode : S.currentMode,
|
|
17845
|
+
planExecutionMode: we && Tr !== void 0 ? Ui(xt) : S.planExecutionMode,
|
|
17846
|
+
reasoning: we && xt !== void 0 ? Oa(xt) : S.reasoning,
|
|
17796
17847
|
displayName: vs(L.state) ?? S.displayName,
|
|
17797
17848
|
contextWindow: we ? ec ?? S.contextWindow : S.contextWindow,
|
|
17798
|
-
providers: Mt ? we ?
|
|
17849
|
+
providers: Mt ? we ? yr ?? S.providers : S.providers : void 0,
|
|
17799
17850
|
supportedCommands: ms ?? S.supportedCommands,
|
|
17800
17851
|
context: ot ? {
|
|
17801
17852
|
...ot,
|
|
@@ -17809,7 +17860,7 @@ function Om(e) {
|
|
|
17809
17860
|
// observed when it was issued (`goalStateAtLoadStart`) — a create
|
|
17810
17861
|
// that lands inside the load window must not be wiped, and
|
|
17811
17862
|
// tombstoned, by a bare-null answer that predates it.
|
|
17812
|
-
goalState: pa ?
|
|
17863
|
+
goalState: pa ? Fa(
|
|
17813
17864
|
S.goalState,
|
|
17814
17865
|
pa,
|
|
17815
17866
|
ps?.goal?.goalId
|
|
@@ -17824,12 +17875,12 @@ function Om(e) {
|
|
|
17824
17875
|
Fn ? S.catchingUp : $e || L.lastEventId != null || void 0
|
|
17825
17876
|
)
|
|
17826
17877
|
};
|
|
17827
|
-
}),
|
|
17878
|
+
}), Sr.length > 0) {
|
|
17828
17879
|
const S = Be ? new Set(
|
|
17829
17880
|
ge.getSnapshot().blocks.flatMap(
|
|
17830
17881
|
(ot) => ot.kind === "status" ? [ot.text] : []
|
|
17831
17882
|
)
|
|
17832
|
-
) : void 0, we =
|
|
17883
|
+
) : void 0, we = Sr.filter((ot) => !S?.has(ot)).map((ot) => ({
|
|
17833
17884
|
type: "status",
|
|
17834
17885
|
text: ot
|
|
17835
17886
|
}));
|
|
@@ -17843,7 +17894,7 @@ function Om(e) {
|
|
|
17843
17894
|
ot.dispatch(we), tt.checkpoint = ot.getSnapshot();
|
|
17844
17895
|
}
|
|
17845
17896
|
}
|
|
17846
|
-
let
|
|
17897
|
+
let Cr = !1, hs = !1;
|
|
17847
17898
|
const nc = () => {
|
|
17848
17899
|
const S = at.current.get(
|
|
17849
17900
|
L.sessionId
|
|
@@ -17863,21 +17914,21 @@ function Om(e) {
|
|
|
17863
17914
|
controller: fs,
|
|
17864
17915
|
restartRequested: !1
|
|
17865
17916
|
}, vt.current = Yo;
|
|
17866
|
-
const
|
|
17867
|
-
I.signal.addEventListener("abort",
|
|
17917
|
+
const Ir = () => fs.abort(I.signal.reason);
|
|
17918
|
+
I.signal.addEventListener("abort", Ir, {
|
|
17868
17919
|
once: !0
|
|
17869
|
-
}), oa = () => I.signal.removeEventListener("abort",
|
|
17870
|
-
const
|
|
17920
|
+
}), oa = () => I.signal.removeEventListener("abort", Ir);
|
|
17921
|
+
const xr = Ko;
|
|
17871
17922
|
Ko = void 0;
|
|
17872
17923
|
const sc = L.lastEventId ?? 0;
|
|
17873
17924
|
for await (const S of L.events({
|
|
17874
17925
|
signal: fs.signal,
|
|
17875
17926
|
maxQueued: m,
|
|
17876
|
-
...
|
|
17927
|
+
...xr ? { sseConnectReason: xr } : {}
|
|
17877
17928
|
})) {
|
|
17878
17929
|
if (ee.current !== L)
|
|
17879
17930
|
break;
|
|
17880
|
-
|
|
17931
|
+
Cr || (Cr = !0, oo = 0);
|
|
17881
17932
|
const we = w.current;
|
|
17882
17933
|
we?.sessionId === L.sessionId && S.id !== void 0 && (we.lastObservedEventId = Math.max(
|
|
17883
17934
|
we.lastObservedEventId,
|
|
@@ -17961,7 +18012,7 @@ function Om(e) {
|
|
|
17961
18012
|
}
|
|
17962
18013
|
if (Ai(
|
|
17963
18014
|
mt,
|
|
17964
|
-
|
|
18015
|
+
ir,
|
|
17965
18016
|
Mt ? St.cwd : void 0
|
|
17966
18017
|
), mt.length > 0) {
|
|
17967
18018
|
const ie = Rs(mt);
|
|
@@ -17971,7 +18022,7 @@ function Om(e) {
|
|
|
17971
18022
|
}
|
|
17972
18023
|
const Bo = w.current, lo = Bo?.sessionId === L.sessionId && (S.type === "turn_complete" || S.type === "turn_error") && Zo(S) === Bo.target.promptId;
|
|
17973
18024
|
(S.type === "turn_complete" || S.type === "turn_error") && ye();
|
|
17974
|
-
const ke = !ct && !no &&
|
|
18025
|
+
const ke = !ct && !no && Ma(
|
|
17975
18026
|
at.current,
|
|
17976
18027
|
Zt.current,
|
|
17977
18028
|
L.sessionId,
|
|
@@ -17992,11 +18043,11 @@ function Om(e) {
|
|
|
17992
18043
|
), Io() || Ue("idle");
|
|
17993
18044
|
}
|
|
17994
18045
|
const Et = mt.some(
|
|
17995
|
-
(ie) => ie.type === "debug" && !
|
|
18046
|
+
(ie) => ie.type === "debug" && !Rr(ie.debugReason)
|
|
17996
18047
|
);
|
|
17997
18048
|
!Io() && Et && ye();
|
|
17998
18049
|
const Kt = !Io() && ge.getSnapshot().activeAssistantBlockId != null ? Uo.filter(
|
|
17999
|
-
(ie) => ie.type !== "debug" ||
|
|
18050
|
+
(ie) => ie.type !== "debug" || Rr(ie.debugReason)
|
|
18000
18051
|
) : Uo;
|
|
18001
18052
|
He(Kt);
|
|
18002
18053
|
for (const ie of mt)
|
|
@@ -18071,7 +18122,7 @@ function Om(e) {
|
|
|
18071
18122
|
if (S.type === "session_closed" && S.data?.reason === "client_close") {
|
|
18072
18123
|
ta = !0;
|
|
18073
18124
|
const ie = S.data;
|
|
18074
|
-
|
|
18125
|
+
gr = ie.cause === "workspace_runtime_stop", hr = ie.persistenceUnconfirmed === !0;
|
|
18075
18126
|
const Ae = L.sessionId;
|
|
18076
18127
|
at.current.get(Ae)?.controller.abort(), at.current.delete(Ae), Se = void 0, ee.current = void 0;
|
|
18077
18128
|
break;
|
|
@@ -18099,7 +18150,7 @@ function Om(e) {
|
|
|
18099
18150
|
}
|
|
18100
18151
|
ye();
|
|
18101
18152
|
const ac = Yo.restartRequested;
|
|
18102
|
-
if (na(),
|
|
18153
|
+
if (na(), gr) {
|
|
18103
18154
|
Ks.current = $, lt({
|
|
18104
18155
|
type: "assistant.done",
|
|
18105
18156
|
reason: "cancelled"
|
|
@@ -18107,7 +18158,7 @@ function Om(e) {
|
|
|
18107
18158
|
...S,
|
|
18108
18159
|
status: "disconnected",
|
|
18109
18160
|
runtimeStopped: !0,
|
|
18110
|
-
runtimeStopPersistenceUnconfirmed:
|
|
18161
|
+
runtimeStopPersistenceUnconfirmed: hr,
|
|
18111
18162
|
loadingTranscript: !1,
|
|
18112
18163
|
catchingUp: !1,
|
|
18113
18164
|
backgroundTurn: void 0,
|
|
@@ -18170,7 +18221,7 @@ function Om(e) {
|
|
|
18170
18221
|
}
|
|
18171
18222
|
if (Q || I.signal.aborted) return;
|
|
18172
18223
|
ye();
|
|
18173
|
-
const Fo =
|
|
18224
|
+
const Fo = Qa($e), Co = Fo ? Ji("en")("daemon.capacity.exhausted") : $e instanceof Error ? $e.message : String($e), jt = qt($e);
|
|
18174
18225
|
if (Xe.current?.kind === "standalone" && !On && be((je) => ({
|
|
18175
18226
|
...je,
|
|
18176
18227
|
standaloneSession: {
|
|
@@ -18207,18 +18258,18 @@ function Om(e) {
|
|
|
18207
18258
|
}));
|
|
18208
18259
|
return;
|
|
18209
18260
|
}
|
|
18210
|
-
const ft = v.current, Be = ft === void 0 ||
|
|
18261
|
+
const ft = v.current, Be = ft === void 0 || ba(
|
|
18211
18262
|
ft.sessionContext,
|
|
18212
18263
|
Xe.current
|
|
18213
18264
|
), bn = Dp($e), L = Be && (ft === void 0 || ft.sessionId === ce);
|
|
18214
18265
|
if (!Fo && H && To && (bn !== void 0 && L || ft?.sessionId === ce && Be && _p(
|
|
18215
18266
|
$e,
|
|
18216
|
-
!kt?.features.includes(
|
|
18267
|
+
!kt?.features.includes(Ra)
|
|
18217
18268
|
))) {
|
|
18218
18269
|
oo += 1;
|
|
18219
18270
|
const je = io.current;
|
|
18220
|
-
if (await
|
|
18221
|
-
bn ??
|
|
18271
|
+
if (await Or(
|
|
18272
|
+
bn ?? Dr(
|
|
18222
18273
|
oo,
|
|
18223
18274
|
je.reconnectDelayMs,
|
|
18224
18275
|
je.maxReconnectDelayMs
|
|
@@ -18367,10 +18418,10 @@ function Om(e) {
|
|
|
18367
18418
|
return;
|
|
18368
18419
|
}
|
|
18369
18420
|
oo += 1;
|
|
18370
|
-
const
|
|
18421
|
+
const fr = io.current, Gl = Dr(
|
|
18371
18422
|
oo,
|
|
18372
|
-
|
|
18373
|
-
|
|
18423
|
+
fr.reconnectDelayMs,
|
|
18424
|
+
fr.maxReconnectDelayMs
|
|
18374
18425
|
);
|
|
18375
18426
|
be(($e) => ({
|
|
18376
18427
|
...$e,
|
|
@@ -18379,8 +18430,8 @@ function Om(e) {
|
|
|
18379
18430
|
})), Rt.current?.abort();
|
|
18380
18431
|
const sa = new AbortController();
|
|
18381
18432
|
Rt.current = sa;
|
|
18382
|
-
const
|
|
18383
|
-
I.signal.addEventListener("abort",
|
|
18433
|
+
const wr = () => sa.abort();
|
|
18434
|
+
I.signal.addEventListener("abort", wr, { once: !0 }), await Or(Gl, sa.signal), I.signal.removeEventListener("abort", wr);
|
|
18384
18435
|
}
|
|
18385
18436
|
})(), () => {
|
|
18386
18437
|
const me = Ie;
|
|
@@ -18464,7 +18515,7 @@ function Om(e) {
|
|
|
18464
18515
|
}
|
|
18465
18516
|
if (re.consecutiveFailures < M)
|
|
18466
18517
|
return;
|
|
18467
|
-
const et = re.lastHttpError?.status, Wt = re.lastHttpError?.message ?? Ie, it = et !== void 0 &&
|
|
18518
|
+
const et = re.lastHttpError?.status, Wt = re.lastHttpError?.message ?? Ie, it = et !== void 0 && ar.has(et), He = Zn(et);
|
|
18468
18519
|
if (it || He) {
|
|
18469
18520
|
const ye = Q.sessionId;
|
|
18470
18521
|
console.warn(
|
|
@@ -18513,7 +18564,7 @@ function Om(e) {
|
|
|
18513
18564
|
const Q = at.current.get($.sessionId);
|
|
18514
18565
|
if (Q?.promptId !== I) return;
|
|
18515
18566
|
const re = Q.replayedTurnEvents?.get(I);
|
|
18516
|
-
delete Q.replayedTurnEvents, re && (
|
|
18567
|
+
delete Q.replayedTurnEvents, re && (Ma(
|
|
18517
18568
|
at.current,
|
|
18518
18569
|
Zt.current,
|
|
18519
18570
|
$.sessionId,
|
|
@@ -18542,7 +18593,7 @@ function Om(e) {
|
|
|
18542
18593
|
daemonActivePromptRef: D,
|
|
18543
18594
|
hasSessionActivePrompt: () => Lo.current(),
|
|
18544
18595
|
settleRestoredActivePrompt: () => Vo.current(),
|
|
18545
|
-
flushTranscript: () =>
|
|
18596
|
+
flushTranscript: () => dr.current(),
|
|
18546
18597
|
getEventDetailMode: () => Ze.current,
|
|
18547
18598
|
resetCurrentSessionActivePrompt: () => {
|
|
18548
18599
|
Lo.current = () => !1, Vo.current = () => !1;
|
|
@@ -18652,7 +18703,7 @@ function Om(e) {
|
|
|
18652
18703
|
C.current = _n.reloadSession, dt(() => {
|
|
18653
18704
|
on === "idle" && queueMicrotask(() => F.current?.());
|
|
18654
18705
|
}, [on]);
|
|
18655
|
-
const
|
|
18706
|
+
const ur = ue(
|
|
18656
18707
|
async ($) => {
|
|
18657
18708
|
const I = Ne.current, Q = ee.current;
|
|
18658
18709
|
if (I.loading || !Q || Q.sessionId !== I.sessionId)
|
|
@@ -18696,7 +18747,7 @@ function Om(e) {
|
|
|
18696
18747
|
const Fe = {
|
|
18697
18748
|
..._e.current,
|
|
18698
18749
|
suppressOwnUserEcho: !1
|
|
18699
|
-
}, et = Ie.events.map(
|
|
18750
|
+
}, et = Ie.events.map($a).find((lt) => lt !== void 0), Wt = [];
|
|
18700
18751
|
for (const lt of Ie.events)
|
|
18701
18752
|
try {
|
|
18702
18753
|
const yt = Ps(
|
|
@@ -18807,9 +18858,9 @@ function Om(e) {
|
|
|
18807
18858
|
loading: $ && ro.loading,
|
|
18808
18859
|
capacityReached: $ && ro.capacityReached,
|
|
18809
18860
|
paginationError: $ && ro.paginationError,
|
|
18810
|
-
loadMore:
|
|
18861
|
+
loadMore: ur
|
|
18811
18862
|
};
|
|
18812
|
-
}, [We.sessionId,
|
|
18863
|
+
}, [We.sessionId, ur, ro]), Ys = Y(hp), Js = Y(void 0), Xs = Y(void 0);
|
|
18813
18864
|
dt(() => {
|
|
18814
18865
|
if (oe) return;
|
|
18815
18866
|
const $ = le ?? // A failed controlled load leaves the target's workspace on the
|
|
@@ -18849,8 +18900,8 @@ function Om(e) {
|
|
|
18849
18900
|
}
|
|
18850
18901
|
}),
|
|
18851
18902
|
[]
|
|
18852
|
-
),
|
|
18853
|
-
const $ =
|
|
18903
|
+
), pr = ee.current, Hl = st(() => {
|
|
18904
|
+
const $ = pr;
|
|
18854
18905
|
if (!(!$ || !$.clientId || $.sessionId !== We.sessionId))
|
|
18855
18906
|
return {
|
|
18856
18907
|
sessionId: $.sessionId,
|
|
@@ -18866,12 +18917,12 @@ function Om(e) {
|
|
|
18866
18917
|
) : Promise.reject(new Error("MCP App client is not attached"));
|
|
18867
18918
|
}
|
|
18868
18919
|
};
|
|
18869
|
-
}, [
|
|
18920
|
+
}, [pr, We.sessionId]);
|
|
18870
18921
|
return /* @__PURE__ */ Yt(cd.Provider, { value: Hl, children: /* @__PURE__ */ Yt(Il.Provider, { value: ge, children: /* @__PURE__ */ Yt(Al.Provider, { value: gt, children: /* @__PURE__ */ Yt(xl.Provider, { value: We, children: /* @__PURE__ */ Yt(Pl.Provider, { value: on, children: /* @__PURE__ */ Yt($l.Provider, { value: Nl, children: /* @__PURE__ */ Yt(
|
|
18871
18922
|
Ml.Provider,
|
|
18872
18923
|
{
|
|
18873
18924
|
value: Wl,
|
|
18874
|
-
children: /* @__PURE__ */ Yt(
|
|
18925
|
+
children: /* @__PURE__ */ Yt(sr.Provider, { value: _n, children: /* @__PURE__ */ Yt(
|
|
18875
18926
|
_l.Provider,
|
|
18876
18927
|
{
|
|
18877
18928
|
value: ql,
|
|
@@ -18926,7 +18977,7 @@ function Ei(e, t) {
|
|
|
18926
18977
|
stopReason: n
|
|
18927
18978
|
};
|
|
18928
18979
|
}
|
|
18929
|
-
function
|
|
18980
|
+
function Ma(e, t, o, s, n, a, r, i = {}) {
|
|
18930
18981
|
if (s.type !== "turn_complete" && s.type !== "turn_error")
|
|
18931
18982
|
return !1;
|
|
18932
18983
|
const l = s.data?.promptId;
|
|
@@ -19161,7 +19212,7 @@ function jm() {
|
|
|
19161
19212
|
);
|
|
19162
19213
|
}
|
|
19163
19214
|
function Ip() {
|
|
19164
|
-
const e = Ot(
|
|
19215
|
+
const e = Ot(sr);
|
|
19165
19216
|
if (!e)
|
|
19166
19217
|
throw new Error(
|
|
19167
19218
|
"useDaemonActions must be used within DaemonSessionProvider"
|
|
@@ -19169,7 +19220,7 @@ function Ip() {
|
|
|
19169
19220
|
return e;
|
|
19170
19221
|
}
|
|
19171
19222
|
function xp() {
|
|
19172
|
-
return Ot(
|
|
19223
|
+
return Ot(sr);
|
|
19173
19224
|
}
|
|
19174
19225
|
function qm() {
|
|
19175
19226
|
const e = Ot(_l);
|
|
@@ -19261,7 +19312,7 @@ function Rp(e) {
|
|
|
19261
19312
|
return null;
|
|
19262
19313
|
const o = Po(e, "condition");
|
|
19263
19314
|
if (!o) return null;
|
|
19264
|
-
const s =
|
|
19315
|
+
const s = _a(e, "iterations"), n = _a(e, "durationMs"), a = _a(e, "setAt"), r = Po(e, "lastReason");
|
|
19265
19316
|
return {
|
|
19266
19317
|
kind: t,
|
|
19267
19318
|
condition: o,
|
|
@@ -19275,7 +19326,7 @@ function Po(e, t) {
|
|
|
19275
19326
|
const o = e[t];
|
|
19276
19327
|
return typeof o == "string" ? o : void 0;
|
|
19277
19328
|
}
|
|
19278
|
-
function
|
|
19329
|
+
function _a(e, t) {
|
|
19279
19330
|
const o = e[t];
|
|
19280
19331
|
return typeof o == "number" && Number.isFinite(o) ? o : void 0;
|
|
19281
19332
|
}
|
|
@@ -19369,7 +19420,7 @@ function $p(e) {
|
|
|
19369
19420
|
}
|
|
19370
19421
|
function Mp(e) {
|
|
19371
19422
|
const t = qt(e);
|
|
19372
|
-
return t !== void 0 &&
|
|
19423
|
+
return t !== void 0 && ar.has(t);
|
|
19373
19424
|
}
|
|
19374
19425
|
function _p(e, t = !1) {
|
|
19375
19426
|
if (!(e instanceof fo) || e.status !== 404) return !1;
|
|
@@ -20113,7 +20164,7 @@ const Op = 300, Lp = 100, xn = Object.freeze({
|
|
|
20113
20164
|
isVisible: !1,
|
|
20114
20165
|
shownAt: 0
|
|
20115
20166
|
});
|
|
20116
|
-
function
|
|
20167
|
+
function Da(e) {
|
|
20117
20168
|
e.clearFollowupSuggestion?.();
|
|
20118
20169
|
}
|
|
20119
20170
|
function Fp(e) {
|
|
@@ -20214,14 +20265,14 @@ function ig(e = {}) {
|
|
|
20214
20265
|
J !== E.current && (E.current = J, U(y?.suggestion ?? null));
|
|
20215
20266
|
}, [y, U]);
|
|
20216
20267
|
const P = ue(() => {
|
|
20217
|
-
A.clear(),
|
|
20268
|
+
A.clear(), Da(n), Ts(), E.current = void 0;
|
|
20218
20269
|
}, [A, n]), j = ue(
|
|
20219
20270
|
(J, x) => {
|
|
20220
|
-
A.accept(J, x),
|
|
20271
|
+
A.accept(J, x), Da(n), Ts(), E.current = void 0;
|
|
20221
20272
|
},
|
|
20222
20273
|
[A, n]
|
|
20223
20274
|
), H = ue(() => {
|
|
20224
|
-
A.dismiss(),
|
|
20275
|
+
A.dismiss(), Da(n), Ts(), E.current = void 0;
|
|
20225
20276
|
}, [A, n]);
|
|
20226
20277
|
return st(
|
|
20227
20278
|
() => ({
|
|
@@ -20308,7 +20359,7 @@ export {
|
|
|
20308
20359
|
ll as aG,
|
|
20309
20360
|
Mu as aH,
|
|
20310
20361
|
Nc as aI,
|
|
20311
|
-
|
|
20362
|
+
Qa as aJ,
|
|
20312
20363
|
Vp as aK,
|
|
20313
20364
|
Qp as aL,
|
|
20314
20365
|
Kp as aM,
|