zen-code 3.0.3 → 3.0.5
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/{app-C_9FvKl4.mjs → app-p0LqnAgS.mjs} +139 -134
- package/dist/{checkpoint-1sAx_j1E-BLIK-E27.mjs → checkpoint-1sAx_j1E-CQSUsimO.mjs} +2 -2
- package/dist/{checkpoint-DxiUsHMy-BPZoPfpz.mjs → checkpoint-DxiUsHMy-noED47AT.mjs} +2 -2
- package/dist/client-D-FCM8pg.mjs +3862 -0
- package/dist/{get_allowed_models-tD7oPVgc.mjs → get_allowed_models-BIpXaphz.mjs} +1 -1
- package/dist/{graphBuilder-BIhxVliV.mjs → graphBuilder-DGVR99NP.mjs} +10422 -8548
- package/dist/{id-DSgIWJsu.mjs → id-Cu1daf1j.mjs} +1 -1
- package/dist/{index-AcwTkc8n.mjs → index-TZW9juZS.mjs} +3 -3
- package/dist/nonInteractive.mjs +4 -5
- package/dist/{queue-D6tEGCGs-Bd7Wf-wo.mjs → queue-D6tEGCGs-C_utZwzP.mjs} +1 -1
- package/dist/{shallow-DOOvPlWi.mjs → shallow-DBKZP8qx.mjs} +3 -3
- package/dist/{tasks-D9VxaG3A.mjs → tasks-DdsMQRlx.mjs} +5 -4
- package/dist/zen-code.mjs +1 -1
- package/dist/zen-init.mjs +2 -2
- package/package.json +5 -4
- package/dist/index-P-c4tqBO.mjs +0 -194
|
@@ -1,22 +1,23 @@
|
|
|
1
|
-
import { a as x, R as xe, B as _, F as
|
|
1
|
+
import { a as x, R as xe, B as _, F as hn, j as d, T as w, u as Ft, r as fn } from "./use-input-1eSjZocJ.mjs";
|
|
2
2
|
import ye from "chalk";
|
|
3
|
-
import
|
|
4
|
-
import { g as
|
|
3
|
+
import mn from "node:os";
|
|
4
|
+
import { g as gn } from "./_commonjsHelpers-ByX85dGu.mjs";
|
|
5
5
|
import T, { z as D } from "zod";
|
|
6
|
-
import { Z as O, s as Z, a as Er, b as
|
|
7
|
-
import { parse as
|
|
8
|
-
import
|
|
9
|
-
import { a as Se, S as
|
|
10
|
-
import { c as kt } from "./
|
|
6
|
+
import { Z as O, s as Z, a as Er, b as pn, i as yn, c as wn, d as bn, e as _n, f as vn, m as xn, k as Sn, A as Tn, h as Cn, j as jn, g as In, l as En, n as An, t as kn, o as Mn, q as Pn, v as Ar, w as Dn, x as Rn, y as On, M as Nn } from "./graphBuilder-DGVR99NP.mjs";
|
|
7
|
+
import { parse as Ln } from "marked";
|
|
8
|
+
import $n from "marked-terminal";
|
|
9
|
+
import { a as Se, S as kr, u as Ut, M as Bt, c as Fn, b as Un, g as Bn } from "./get_allowed_models-BIpXaphz.mjs";
|
|
10
|
+
import { c as kt } from "./client-D-FCM8pg.mjs";
|
|
11
11
|
import { readdirSync as zn, readFileSync as Hn } from "node:fs";
|
|
12
12
|
import Yt, { join as ke } from "node:path";
|
|
13
|
+
import "micromatch";
|
|
13
14
|
import { Low as Gn } from "lowdb";
|
|
14
15
|
import { JSONFile as Wn } from "lowdb/node";
|
|
15
16
|
import "yaml";
|
|
16
17
|
import { Command as Zn, Send as Jn } from "@langchain/langgraph";
|
|
17
18
|
import "langchain";
|
|
18
19
|
import qt from "node-notifier";
|
|
19
|
-
function
|
|
20
|
+
function Mr(t) {
|
|
20
21
|
const { items: e, children: r, style: n } = t, [i, s] = x.useState(0), a = x.useMemo(() => e.slice(i), [e, i]);
|
|
21
22
|
x.useLayoutEffect(() => {
|
|
22
23
|
s(e.length);
|
|
@@ -32,7 +33,7 @@ function at() {
|
|
|
32
33
|
return xe.createElement(_, { flexGrow: 1 });
|
|
33
34
|
}
|
|
34
35
|
const zt = () => {
|
|
35
|
-
const t = x.useContext(
|
|
36
|
+
const t = x.useContext(hn);
|
|
36
37
|
return {
|
|
37
38
|
enableFocus: t.enableFocus,
|
|
38
39
|
disableFocus: t.disableFocus,
|
|
@@ -58,8 +59,8 @@ function Qn() {
|
|
|
58
59
|
};
|
|
59
60
|
}, []), t;
|
|
60
61
|
}
|
|
61
|
-
var
|
|
62
|
-
function
|
|
62
|
+
var Pr = /* @__PURE__ */ ((t) => (t.PANEL = "panel", t.INLINE = "inline", t.MODAL = "modal", t))(Pr || {});
|
|
63
|
+
function Dr(t) {
|
|
63
64
|
return t?.replace(process.cwd(), ".") || t || "";
|
|
64
65
|
}
|
|
65
66
|
const Vn = () => process.env.TERM?.includes("256color") || process.env.TERM === "xterm-256color" || process.env.WT_SESSION !== void 0 || // Windows Terminal
|
|
@@ -234,9 +235,9 @@ process.env.TERM_PROGRAM === "iTerm.app", Yn = () => process.env.TERM_PROGRAM ==
|
|
|
234
235
|
/* BLUE */
|
|
235
236
|
}
|
|
236
237
|
}, le = (t) => (t in gt || (t = "sky"), Vn() ? gt[t].hex : gt[t].fallback);
|
|
237
|
-
function
|
|
238
|
+
function Rr() {
|
|
238
239
|
try {
|
|
239
|
-
return
|
|
240
|
+
return mn.userInfo().username;
|
|
240
241
|
} catch {
|
|
241
242
|
return process.env.USER || process.env.USERNAME || "User";
|
|
242
243
|
}
|
|
@@ -330,7 +331,7 @@ const qn = x.createContext(null), Kn = ({
|
|
|
330
331
|
[e, o, l, c, u, f, h, m, g]
|
|
331
332
|
);
|
|
332
333
|
return /* @__PURE__ */ d.jsx(qn.Provider, { value: p, children: t });
|
|
333
|
-
},
|
|
334
|
+
}, Or = x.createContext(null), Xn = ({ children: t }) => {
|
|
334
335
|
const [e, r] = x.useState(""), n = x.useCallback(() => {
|
|
335
336
|
r("");
|
|
336
337
|
}, []), i = {
|
|
@@ -338,13 +339,13 @@ const qn = x.createContext(null), Kn = ({
|
|
|
338
339
|
setBufferedMessage: r,
|
|
339
340
|
clearBuffer: n
|
|
340
341
|
};
|
|
341
|
-
return /* @__PURE__ */ d.jsx(
|
|
342
|
-
},
|
|
343
|
-
const t = x.useContext(
|
|
342
|
+
return /* @__PURE__ */ d.jsx(Or.Provider, { value: i, children: t });
|
|
343
|
+
}, Nr = () => {
|
|
344
|
+
const t = x.useContext(Or);
|
|
344
345
|
if (!t)
|
|
345
346
|
throw new Error("useChatInputBuffer must be used within ChatInputBufferProvider");
|
|
346
347
|
return t;
|
|
347
|
-
},
|
|
348
|
+
}, Lr = x.createContext(void 0), es = ({ manager: t, get_allowed_models: e, children: r }) => {
|
|
348
349
|
const [n, i] = x.useState(null), [s, a] = x.useState(!0), [o, l] = x.useState([]), c = x.useMemo(() => ({
|
|
349
350
|
main_model: n?.main_model || o[0]?.id,
|
|
350
351
|
mcp_config: n?.mcp_config,
|
|
@@ -372,14 +373,14 @@ const qn = x.createContext(null), Kn = ({
|
|
|
372
373
|
const p = await t.getConfig();
|
|
373
374
|
i(p);
|
|
374
375
|
};
|
|
375
|
-
return s ? null : /* @__PURE__ */ d.jsx(
|
|
376
|
+
return s ? null : /* @__PURE__ */ d.jsx(Lr.Provider, { value: { config: n, updateConfig: m, extraParams: c, AVAILABLE_MODELS: o, manager: t, compactMode: u, toggleCompactMode: h }, children: r });
|
|
376
377
|
}, he = () => {
|
|
377
|
-
const t = x.useContext(
|
|
378
|
+
const t = x.useContext(Lr);
|
|
378
379
|
if (t === void 0)
|
|
379
380
|
throw new Error("useSettings must be used within a SettingsProvider");
|
|
380
381
|
return t;
|
|
381
|
-
},
|
|
382
|
-
const t = x.useContext(
|
|
382
|
+
}, $r = x.createContext(null), ot = () => {
|
|
383
|
+
const t = x.useContext($r);
|
|
383
384
|
if (!t)
|
|
384
385
|
throw new Error("useInteractionContext must be used within InteractionProvider");
|
|
385
386
|
return t;
|
|
@@ -390,7 +391,7 @@ const qn = x.createContext(null), Kn = ({
|
|
|
390
391
|
const [r, n] = x.useState([]), [i, s] = x.useState(0), a = x.useCallback(() => `interaction_${Date.now()}_${Math.random().toString(36).substring(2, 9)}`, []), o = x.useCallback((C, j) => {
|
|
391
392
|
const A = /* @__PURE__ */ new Date(), I = {
|
|
392
393
|
id: a(),
|
|
393
|
-
category:
|
|
394
|
+
category: Pr.PANEL,
|
|
394
395
|
state: "idle",
|
|
395
396
|
metadata: {
|
|
396
397
|
title: j?.metadata?.title,
|
|
@@ -488,9 +489,9 @@ const qn = x.createContext(null), Kn = ({
|
|
|
488
489
|
v
|
|
489
490
|
]
|
|
490
491
|
);
|
|
491
|
-
return /* @__PURE__ */ d.jsx(
|
|
492
|
-
},
|
|
493
|
-
const r =
|
|
492
|
+
return /* @__PURE__ */ d.jsx($r.Provider, { value: S, children: t });
|
|
493
|
+
}, Fr = ({ content: t, messageNumber: e }) => {
|
|
494
|
+
const r = Rr(), n = () => typeof t == "string" ? /* @__PURE__ */ d.jsx(w, { color: "white", children: t }) : Array.isArray(t) ? t.filter((i) => i.type === "text").map((i, s) => /* @__PURE__ */ d.jsx(w, { color: "white", children: i.text })) : /* @__PURE__ */ d.jsx(w, { color: "white", children: JSON.stringify(t) });
|
|
494
495
|
return /* @__PURE__ */ d.jsxs(_, { flexDirection: "column", children: [
|
|
495
496
|
/* @__PURE__ */ d.jsx(_, { children: /* @__PURE__ */ d.jsxs(w, { color: le("amber"), children: [
|
|
496
497
|
e,
|
|
@@ -611,7 +612,7 @@ function rs() {
|
|
|
611
612
|
})(pt)), pt.exports;
|
|
612
613
|
}
|
|
613
614
|
var ns = rs();
|
|
614
|
-
const Ht = /* @__PURE__ */
|
|
615
|
+
const Ht = /* @__PURE__ */ gn(ns), ss = /* @__PURE__ */ Symbol("Let zodToJsonSchema decide on which parser to use"), is = {
|
|
615
616
|
name: void 0,
|
|
616
617
|
$refStrategy: "root",
|
|
617
618
|
basePath: ["#"],
|
|
@@ -654,7 +655,7 @@ const Ht = /* @__PURE__ */ mn(ns), ss = /* @__PURE__ */ Symbol("Let zodToJsonSch
|
|
|
654
655
|
}
|
|
655
656
|
]))
|
|
656
657
|
};
|
|
657
|
-
},
|
|
658
|
+
}, Ur = (t, e) => {
|
|
658
659
|
let r = 0;
|
|
659
660
|
for (; r < t.length && r < e.length && t[r] === e[r]; r++)
|
|
660
661
|
;
|
|
@@ -669,7 +670,7 @@ function X(t) {
|
|
|
669
670
|
t.openAiAnyTypeName
|
|
670
671
|
];
|
|
671
672
|
return t.flags.hasReferencedOpenAiAnyType = !0, {
|
|
672
|
-
$ref: t.$refStrategy === "relative" ?
|
|
673
|
+
$ref: t.$refStrategy === "relative" ? Ur(e, t.currentPath) : e.join("/")
|
|
673
674
|
};
|
|
674
675
|
}
|
|
675
676
|
function cs(t, e) {
|
|
@@ -707,15 +708,15 @@ function us() {
|
|
|
707
708
|
type: "boolean"
|
|
708
709
|
};
|
|
709
710
|
}
|
|
710
|
-
function
|
|
711
|
+
function Br(t, e) {
|
|
711
712
|
return U(t.type._def, e);
|
|
712
713
|
}
|
|
713
714
|
const ds = (t, e) => U(t.innerType._def, e);
|
|
714
|
-
function
|
|
715
|
+
function zr(t, e, r) {
|
|
715
716
|
const n = r ?? e.dateStrategy;
|
|
716
717
|
if (Array.isArray(n))
|
|
717
718
|
return {
|
|
718
|
-
anyOf: n.map((i, s) =>
|
|
719
|
+
anyOf: n.map((i, s) => zr(t, e, i))
|
|
719
720
|
};
|
|
720
721
|
switch (n) {
|
|
721
722
|
case "string":
|
|
@@ -823,7 +824,7 @@ function ws(t, e) {
|
|
|
823
824
|
const: t.value
|
|
824
825
|
};
|
|
825
826
|
}
|
|
826
|
-
function
|
|
827
|
+
function Hr(t, e) {
|
|
827
828
|
if (e.target === "openAi" && console.warn("Warning: OpenAI may not support records in schemas! Try an array of key-value pairs instead."), e.target === "openApi3" && t.keyType?._def.typeName === O.ZodEnum)
|
|
828
829
|
return {
|
|
829
830
|
type: "object",
|
|
@@ -861,7 +862,7 @@ function zr(t, e) {
|
|
|
861
862
|
}
|
|
862
863
|
};
|
|
863
864
|
if (t.keyType?._def.typeName === O.ZodBranded && t.keyType._def.type._def.typeName === O.ZodString && t.keyType._def.type._def.checks?.length) {
|
|
864
|
-
const { type: n, ...i } =
|
|
865
|
+
const { type: n, ...i } = Br(t.keyType._def, e);
|
|
865
866
|
return {
|
|
866
867
|
...r,
|
|
867
868
|
propertyNames: i
|
|
@@ -872,7 +873,7 @@ function zr(t, e) {
|
|
|
872
873
|
}
|
|
873
874
|
function bs(t, e) {
|
|
874
875
|
if (e.mapStrategy === "record")
|
|
875
|
-
return
|
|
876
|
+
return Hr(t, e);
|
|
876
877
|
const r = U(t.keyType._def, {
|
|
877
878
|
...e,
|
|
878
879
|
currentPath: [...e.currentPath, "items", "items", "0"]
|
|
@@ -1007,7 +1008,7 @@ function Cs(t, e) {
|
|
|
1007
1008
|
for (const n of t.checks)
|
|
1008
1009
|
switch (n.kind) {
|
|
1009
1010
|
case "int":
|
|
1010
|
-
r.type = "integer",
|
|
1011
|
+
r.type = "integer", pn(r, "type", n.message, e);
|
|
1011
1012
|
break;
|
|
1012
1013
|
case "min":
|
|
1013
1014
|
e.target === "jsonSchema7" ? n.inclusive ? Z(r, "minimum", n.value, n.message, e) : Z(r, "exclusiveMinimum", n.value, n.message, e) : (n.inclusive || (r.exclusiveMinimum = !0), Z(r, "minimum", n.value, n.message, e));
|
|
@@ -1153,7 +1154,7 @@ const Ns = (t, e) => U(t.innerType._def, e), Ls = (t, e, r) => {
|
|
|
1153
1154
|
case O.ZodBoolean:
|
|
1154
1155
|
return us();
|
|
1155
1156
|
case O.ZodDate:
|
|
1156
|
-
return
|
|
1157
|
+
return zr(t, r);
|
|
1157
1158
|
case O.ZodUndefined:
|
|
1158
1159
|
return Rs(r);
|
|
1159
1160
|
case O.ZodNull:
|
|
@@ -1168,7 +1169,7 @@ const Ns = (t, e) => U(t.innerType._def, e), Ls = (t, e, r) => {
|
|
|
1168
1169
|
case O.ZodTuple:
|
|
1169
1170
|
return Ds(t, r);
|
|
1170
1171
|
case O.ZodRecord:
|
|
1171
|
-
return
|
|
1172
|
+
return Hr(t, r);
|
|
1172
1173
|
case O.ZodLiteral:
|
|
1173
1174
|
return ws(t, r);
|
|
1174
1175
|
case O.ZodEnum:
|
|
@@ -1199,7 +1200,7 @@ const Ns = (t, e) => U(t.innerType._def, e), Ls = (t, e, r) => {
|
|
|
1199
1200
|
case O.ZodDefault:
|
|
1200
1201
|
return fs(t, r);
|
|
1201
1202
|
case O.ZodBranded:
|
|
1202
|
-
return
|
|
1203
|
+
return Br(t, r);
|
|
1203
1204
|
case O.ZodReadonly:
|
|
1204
1205
|
return Ns(t, r);
|
|
1205
1206
|
case O.ZodCatch:
|
|
@@ -1241,7 +1242,7 @@ const $s = (t, e) => {
|
|
|
1241
1242
|
case "root":
|
|
1242
1243
|
return { $ref: t.path.join("/") };
|
|
1243
1244
|
case "relative":
|
|
1244
|
-
return { $ref:
|
|
1245
|
+
return { $ref: Ur(e.currentPath, t.path) };
|
|
1245
1246
|
case "none":
|
|
1246
1247
|
case "seen":
|
|
1247
1248
|
return t.path.length < e.currentPath.length && t.path.every((r, n) => e.currentPath[n] === r) ? (console.warn(`Recursive reference detected at ${e.currentPath.join("/")}! Defaulting to any`), X(e)) : e.$refStrategy === "seen" ? X(e) : void 0;
|
|
@@ -1391,7 +1392,7 @@ class me {
|
|
|
1391
1392
|
return r.client.tools.waitForDone(r.message.id);
|
|
1392
1393
|
}
|
|
1393
1394
|
}
|
|
1394
|
-
const
|
|
1395
|
+
const Gr = (t) => t.name + JSON.stringify(t.args);
|
|
1395
1396
|
class zs {
|
|
1396
1397
|
timeCounter = /* @__PURE__ */ new Map();
|
|
1397
1398
|
/**
|
|
@@ -1543,7 +1544,7 @@ class Ee extends Error {
|
|
|
1543
1544
|
super(`${e} at position ${r}`), this.position = r;
|
|
1544
1545
|
}
|
|
1545
1546
|
}
|
|
1546
|
-
const
|
|
1547
|
+
const Wr = 32, Js = 10, Zr = 9, Jr = 13, Qs = 160, Vs = 8192, Ys = 8202, qs = 8239, Ks = 8287, Xs = 12288;
|
|
1547
1548
|
function ei(t) {
|
|
1548
1549
|
return /^[0-9A-Fa-f]$/.test(t);
|
|
1549
1550
|
}
|
|
@@ -1578,20 +1579,20 @@ function ni(t) {
|
|
|
1578
1579
|
}
|
|
1579
1580
|
function _e(t, e) {
|
|
1580
1581
|
const r = t.charCodeAt(e);
|
|
1581
|
-
return r ===
|
|
1582
|
+
return r === Wr || r === Js || r === Zr || r === Jr;
|
|
1582
1583
|
}
|
|
1583
1584
|
function si(t, e) {
|
|
1584
1585
|
const r = t.charCodeAt(e);
|
|
1585
|
-
return r ===
|
|
1586
|
+
return r === Wr || r === Zr || r === Jr;
|
|
1586
1587
|
}
|
|
1587
1588
|
function ii(t, e) {
|
|
1588
1589
|
const r = t.charCodeAt(e);
|
|
1589
1590
|
return r === Qs || r >= Vs && r <= Ys || r === qs || r === Ks || r === Xs;
|
|
1590
1591
|
}
|
|
1591
1592
|
function Xe(t) {
|
|
1592
|
-
return
|
|
1593
|
+
return Qr(t) || Mt(t);
|
|
1593
1594
|
}
|
|
1594
|
-
function
|
|
1595
|
+
function Qr(t) {
|
|
1595
1596
|
return t === '"' || t === "“" || t === "”";
|
|
1596
1597
|
}
|
|
1597
1598
|
function ar(t) {
|
|
@@ -1761,7 +1762,7 @@ ${r}
|
|
|
1761
1762
|
function v() {
|
|
1762
1763
|
let P = arguments.length > 0 && arguments[0] !== void 0 ? arguments[0] : !1, L = arguments.length > 1 && arguments[1] !== void 0 ? arguments[1] : -1, F = t[e] === "\\";
|
|
1763
1764
|
if (F && (e++, F = !0), Xe(t[e])) {
|
|
1764
|
-
const Ce = ar(t[e]) ? ar : or(t[e]) ? or : Mt(t[e]) ? Mt :
|
|
1765
|
+
const Ce = ar(t[e]) ? ar : or(t[e]) ? or : Mt(t[e]) ? Mt : Qr, oe = e, E = r.length;
|
|
1765
1766
|
let M = '"';
|
|
1766
1767
|
for (e++; ; ) {
|
|
1767
1768
|
if (e >= t.length) {
|
|
@@ -1928,7 +1929,7 @@ class Gt {
|
|
|
1928
1929
|
this.message = e, this.client = r;
|
|
1929
1930
|
}
|
|
1930
1931
|
getToolActionRequestID() {
|
|
1931
|
-
return
|
|
1932
|
+
return Gr({
|
|
1932
1933
|
name: this.message.name,
|
|
1933
1934
|
args: this.getInputRepaired()
|
|
1934
1935
|
});
|
|
@@ -1972,7 +1973,7 @@ class Gt {
|
|
|
1972
1973
|
}
|
|
1973
1974
|
}
|
|
1974
1975
|
get output() {
|
|
1975
|
-
return
|
|
1976
|
+
return Yr(this.message.content);
|
|
1976
1977
|
}
|
|
1977
1978
|
getJSONOutput() {
|
|
1978
1979
|
return JSON.parse(this.output);
|
|
@@ -2864,15 +2865,15 @@ function et(t) {
|
|
|
2864
2865
|
function hr(t, e) {
|
|
2865
2866
|
return JSON.parse(t.decode(et(e)));
|
|
2866
2867
|
}
|
|
2867
|
-
const
|
|
2868
|
+
const Vr = (t) => {
|
|
2868
2869
|
if ("isError" in Error && typeof Error.isError == "function") return Error.isError(t);
|
|
2869
2870
|
const e = Object.prototype.toString.call(t);
|
|
2870
2871
|
return e === "[object Error]" || e === "[object DOMException]" || e === "[object DOMError]" || e === "[object Exception]";
|
|
2871
2872
|
}, Li = (t) => {
|
|
2872
2873
|
const { cause: e } = t;
|
|
2873
|
-
return typeof e != "object" || e == null || !
|
|
2874
|
+
return typeof e != "object" || e == null || !Vr(e) ? null : e;
|
|
2874
2875
|
}, $i = (t) => {
|
|
2875
|
-
if (!
|
|
2876
|
+
if (!Vr(t) || t.name !== "TypeError" || typeof t.message != "string") return !1;
|
|
2876
2877
|
const e = t.message.toLowerCase(), r = Li(t)?.message?.toLowerCase() ?? "";
|
|
2877
2878
|
return e.includes("fetch") || e.includes("network") || e.includes("connection") || e.includes("error sending request") || e.includes("load failed") || e.includes("terminated") || r.includes("other side closed") || r.includes("socket");
|
|
2878
2879
|
};
|
|
@@ -4302,7 +4303,7 @@ class ea {
|
|
|
4302
4303
|
const mr = (t) => {
|
|
4303
4304
|
const e = (l) => l.toString().padStart(2, "0"), r = t.getFullYear(), n = e(t.getMonth() + 1), i = e(t.getDate()), s = e(t.getHours()), a = e(t.getMinutes()), o = e(t.getSeconds());
|
|
4304
4305
|
return `${r}-${n}-${i} ${s}:${a}:${o}`;
|
|
4305
|
-
},
|
|
4306
|
+
}, Yr = (t) => typeof t == "string" ? t : Array.isArray(t) ? t.map((e) => typeof e == "string" ? e : e.type === "text" ? e.text : e.type === "image_url" ? "[图片]" : e.type === "tool_use" ? "" : JSON.stringify(e)).join("") : JSON.stringify(t), ta = (t, e, r = {}) => {
|
|
4306
4307
|
const n = /* @__PURE__ */ W(null), i = /* @__PURE__ */ W([]), s = /* @__PURE__ */ W(null), a = /* @__PURE__ */ W([]), o = /* @__PURE__ */ W([]), l = /* @__PURE__ */ W(""), c = /* @__PURE__ */ W(null), u = /* @__PURE__ */ W(t), h = /* @__PURE__ */ W(null), f = /* @__PURE__ */ W("__start__"), m = /* @__PURE__ */ W("idle"), g = /* @__PURE__ */ W(null), p = /* @__PURE__ */ W(!1), y = /* @__PURE__ */ W([]), b = /* @__PURE__ */ W([]), v = /* @__PURE__ */ W(r.showHistory ?? !1), S = /* @__PURE__ */ W(r.showGraph ?? !1), C = /* @__PURE__ */ W(null);
|
|
4307
4308
|
let j = null;
|
|
4308
4309
|
const A = /* @__PURE__ */ W(!1), I = () => {
|
|
@@ -4748,7 +4749,7 @@ async function na(t, e, r, n) {
|
|
|
4748
4749
|
checkpoint: u
|
|
4749
4750
|
};
|
|
4750
4751
|
}
|
|
4751
|
-
const
|
|
4752
|
+
const qr = (t) => typeof t == "object" && t !== null, gr = (t) => qr(t) && !(t instanceof RegExp) && !(t instanceof Error) && !(t instanceof Date) && !(globalThis.Blob && t instanceof globalThis.Blob), sa = /* @__PURE__ */ Symbol("mapObjectSkip"), Rt = (t, e, r, n = /* @__PURE__ */ new WeakMap()) => {
|
|
4752
4753
|
if (r = {
|
|
4753
4754
|
deep: !1,
|
|
4754
4755
|
target: {},
|
|
@@ -4771,13 +4772,13 @@ const Yr = (t) => typeof t == "object" && t !== null, gr = (t) => Yr(t) && !(t i
|
|
|
4771
4772
|
return i;
|
|
4772
4773
|
};
|
|
4773
4774
|
function ia(t, e, r) {
|
|
4774
|
-
if (!
|
|
4775
|
+
if (!qr(t))
|
|
4775
4776
|
throw new TypeError(`Expected an object, got \`${t}\` (${typeof t})`);
|
|
4776
4777
|
if (Array.isArray(t))
|
|
4777
4778
|
throw new TypeError("Expected an object, got an array");
|
|
4778
4779
|
return Rt(t, e, r);
|
|
4779
4780
|
}
|
|
4780
|
-
const aa = /[\p{Lu}]/u, oa = /[\p{Ll}]/u, pr = /^[\p{Lu}](?![\p{Lu}])/gu,
|
|
4781
|
+
const aa = /[\p{Lu}]/u, oa = /[\p{Ll}]/u, pr = /^[\p{Lu}](?![\p{Lu}])/gu, Kr = /([\p{Alpha}\p{N}_]|$)/u, Zt = /[_.\- ]+/, ca = new RegExp("^" + Zt.source), yr = new RegExp(Zt.source + Kr.source, "gu"), wr = new RegExp("\\d+" + Kr.source, "gu"), la = (t, e, r, n) => {
|
|
4781
4782
|
let i = !1, s = !1, a = !1, o = !1;
|
|
4782
4783
|
for (let l = 0; l < t.length; l++) {
|
|
4783
4784
|
const c = t[l];
|
|
@@ -5326,7 +5327,7 @@ class br extends Ht {
|
|
|
5326
5327
|
}
|
|
5327
5328
|
} : i);
|
|
5328
5329
|
return n.forEach((i) => (i.value.actionRequests.forEach((s) => {
|
|
5329
|
-
s.id = s.id ||
|
|
5330
|
+
s.id = s.id || Gr(s);
|
|
5330
5331
|
}), i)), {
|
|
5331
5332
|
interruptData: n,
|
|
5332
5333
|
result: {}
|
|
@@ -5412,8 +5413,8 @@ function ba(t, { keys: e, deps: r = [t, e] } = {}) {
|
|
|
5412
5413
|
let i = x.useCallback((a) => (vt(n, a)(t.value), e?.length > 0 ? Ws(t, e, vt(n, a)) : t.listen(vt(n, a))), r), s = () => n.current;
|
|
5413
5414
|
return x.useSyncExternalStore(i, s, s);
|
|
5414
5415
|
}
|
|
5415
|
-
const
|
|
5416
|
-
const t = x.useContext(
|
|
5416
|
+
const Xr = x.createContext(void 0), re = () => {
|
|
5417
|
+
const t = x.useContext(Xr);
|
|
5417
5418
|
if (!t)
|
|
5418
5419
|
throw new Error("useChat must be used within a ChatProvider");
|
|
5419
5420
|
return t;
|
|
@@ -5443,8 +5444,8 @@ const Kr = x.createContext(void 0), re = () => {
|
|
|
5443
5444
|
b.current || (b.current = !0, y.initClient().catch((v) => {
|
|
5444
5445
|
console.error(v), g.current && g.current(v, y.currentAgent);
|
|
5445
5446
|
}));
|
|
5446
|
-
}, [y]), x.createElement(
|
|
5447
|
-
}, va = new
|
|
5447
|
+
}, [y]), x.createElement(Xr.Provider, { value: y }, t);
|
|
5448
|
+
}, va = new $n({}, {}), xa = (t, e = !1) => {
|
|
5448
5449
|
if (e || !t)
|
|
5449
5450
|
return t;
|
|
5450
5451
|
const r = 5, n = t.split(`
|
|
@@ -5456,9 +5457,9 @@ const Kr = x.createContext(void 0), re = () => {
|
|
|
5456
5457
|
${s.join(`
|
|
5457
5458
|
`)}`;
|
|
5458
5459
|
}, Sa = x.memo(({ children: t }) => {
|
|
5459
|
-
const e = x.useMemo(() =>
|
|
5460
|
+
const e = x.useMemo(() => Ln(t || "", { renderer: va }), [t]), { loading: r } = re(), n = x.useMemo(() => xa(e.trim(), !r), [e, r]);
|
|
5460
5461
|
return /* @__PURE__ */ d.jsx(w, { children: n });
|
|
5461
|
-
}),
|
|
5462
|
+
}), en = ({ message: t, messageNumber: e }) => {
|
|
5462
5463
|
const { extraParams: r } = he(), n = r.main_model || "AI", i = wa(t), s = Jt(t);
|
|
5463
5464
|
return s ? /* @__PURE__ */ d.jsxs(_, { flexDirection: "column", children: [
|
|
5464
5465
|
/* @__PURE__ */ d.jsx(_, { paddingBottom: 0, marginBottom: 1, children: /* @__PURE__ */ d.jsxs(w, { color: le("teal"), children: [
|
|
@@ -5627,7 +5628,7 @@ ${s.join(`
|
|
|
5627
5628
|
] }),
|
|
5628
5629
|
/* @__PURE__ */ d.jsxs(_, { paddingTop: 0, paddingBottom: 0, children: [
|
|
5629
5630
|
/* @__PURE__ */ d.jsx(w, { color: "gray", children: "└─ " }),
|
|
5630
|
-
/* @__PURE__ */ d.jsx(w, { dimColor: !0, italic: !0, children: Ia(
|
|
5631
|
+
/* @__PURE__ */ d.jsx(w, { dimColor: !0, italic: !0, children: Ia(Yr(t.content)) })
|
|
5631
5632
|
] })
|
|
5632
5633
|
] })
|
|
5633
5634
|
] });
|
|
@@ -5652,7 +5653,7 @@ ${s.join(`
|
|
|
5652
5653
|
borderTop: !1,
|
|
5653
5654
|
borderRight: !1,
|
|
5654
5655
|
borderLeftColor: c.type === "ai" ? le("teal") : c.type === "human" ? le("amber") : "yellow",
|
|
5655
|
-
children: c.type === "human" ? /* @__PURE__ */ d.jsx(
|
|
5656
|
+
children: c.type === "human" ? /* @__PURE__ */ d.jsx(Fr, { content: c.content, messageNumber: u + 1 + e }) : c.type === "tool" ? /* @__PURE__ */ d.jsx(Aa, { message: c, messageNumber: u + 1 + e }) : /* @__PURE__ */ d.jsx(en, { message: c, messageNumber: u + 1 + e })
|
|
5656
5657
|
},
|
|
5657
5658
|
c.id || u
|
|
5658
5659
|
);
|
|
@@ -5661,7 +5662,7 @@ ${s.join(`
|
|
|
5661
5662
|
const o = t.slice(0, a), l = t.slice(a);
|
|
5662
5663
|
return n ? /* @__PURE__ */ d.jsxs(_, { flexDirection: "column", children: [
|
|
5663
5664
|
/* @__PURE__ */ d.jsx(
|
|
5664
|
-
|
|
5665
|
+
Mr,
|
|
5665
5666
|
{
|
|
5666
5667
|
items: o,
|
|
5667
5668
|
children: (c, u) => s(c, u, !1)
|
|
@@ -5763,8 +5764,8 @@ ${s.join(`
|
|
|
5763
5764
|
borderRight: !1,
|
|
5764
5765
|
borderLeftColor: m.type === "ai" ? le("teal") : m.type === "human" ? le("amber") : "yellow",
|
|
5765
5766
|
children: [
|
|
5766
|
-
m.type === "human" ? /* @__PURE__ */ d.jsx(
|
|
5767
|
-
m.type === "ai" ? /* @__PURE__ */ d.jsx(
|
|
5767
|
+
m.type === "human" ? /* @__PURE__ */ d.jsx(Fr, { content: m.content, messageNumber: g + 1 + e }) : null,
|
|
5768
|
+
m.type === "ai" ? /* @__PURE__ */ d.jsx(en, { message: m, messageNumber: g + 1 + e }) : null,
|
|
5768
5769
|
m.type === "group" && /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
|
|
5769
5770
|
/* @__PURE__ */ d.jsx(
|
|
5770
5771
|
Ma,
|
|
@@ -5785,7 +5786,7 @@ ${s.join(`
|
|
|
5785
5786
|
const h = l.slice(0, u), f = l.slice(u);
|
|
5786
5787
|
return i ? /* @__PURE__ */ d.jsxs(_, { flexDirection: "column", children: [
|
|
5787
5788
|
/* @__PURE__ */ d.jsx(
|
|
5788
|
-
|
|
5789
|
+
Mr,
|
|
5789
5790
|
{
|
|
5790
5791
|
items: h,
|
|
5791
5792
|
children: (m, g) => c(m, g, !1)
|
|
@@ -6337,7 +6338,7 @@ const Ze = new Fa(), Ua = {
|
|
|
6337
6338
|
shouldClearInput: !0
|
|
6338
6339
|
})
|
|
6339
6340
|
}, Ha = [Ua, Ba, za];
|
|
6340
|
-
class
|
|
6341
|
+
class tn {
|
|
6341
6342
|
db;
|
|
6342
6343
|
dbPath;
|
|
6343
6344
|
constructor(e) {
|
|
@@ -6445,14 +6446,14 @@ function Ga(t) {
|
|
|
6445
6446
|
`).trim();
|
|
6446
6447
|
return { metadata: i, content: s };
|
|
6447
6448
|
}
|
|
6448
|
-
function
|
|
6449
|
+
function rn(t, e) {
|
|
6449
6450
|
const r = /* @__PURE__ */ new Map();
|
|
6450
6451
|
try {
|
|
6451
6452
|
const n = zn(t, { withFileTypes: !0 });
|
|
6452
6453
|
for (const i of n) {
|
|
6453
6454
|
const s = ke(t, i.name);
|
|
6454
6455
|
if (i.isDirectory())
|
|
6455
|
-
|
|
6456
|
+
rn(s, e).forEach((o) => r.set(o.name, o));
|
|
6456
6457
|
else if (i.name.endsWith(".md"))
|
|
6457
6458
|
try {
|
|
6458
6459
|
const a = Hn(s, "utf-8"), { metadata: o, content: l } = Ga(a), c = o.name || i.name.replace(/\.md$/, "");
|
|
@@ -6478,7 +6479,7 @@ function Za(t = "./.claude/templates") {
|
|
|
6478
6479
|
if (He)
|
|
6479
6480
|
return Array.from(He.values());
|
|
6480
6481
|
const e = t.startsWith("/") ? t : ke(process.cwd(), t);
|
|
6481
|
-
return He =
|
|
6482
|
+
return He = rn(e, e), Array.from(He.values());
|
|
6482
6483
|
}
|
|
6483
6484
|
const Ja = {
|
|
6484
6485
|
name: "status",
|
|
@@ -7034,7 +7035,7 @@ const yo = {
|
|
|
7034
7035
|
用法: /spark <text> [#tag1 #tag2]`
|
|
7035
7036
|
};
|
|
7036
7037
|
try {
|
|
7037
|
-
const n = mo(r), i = go(r), s = po(i), a = i, o = new
|
|
7038
|
+
const n = mo(r), i = go(r), s = po(i), a = i, o = new tn(fo());
|
|
7038
7039
|
return await o.initialize(), {
|
|
7039
7040
|
success: !0,
|
|
7040
7041
|
message: `✨ Spark added!
|
|
@@ -7140,7 +7141,7 @@ For each selected spark, create a plan using the writing-plans skill template:
|
|
|
7140
7141
|
requiresArgs: !1,
|
|
7141
7142
|
execute: async (t, e) => {
|
|
7142
7143
|
try {
|
|
7143
|
-
const r = new
|
|
7144
|
+
const r = new tn(bo());
|
|
7144
7145
|
await r.initialize();
|
|
7145
7146
|
const n = await r.getSparksByStatus("pending");
|
|
7146
7147
|
if (n.length === 0)
|
|
@@ -7194,7 +7195,7 @@ For each selected spark, create a plan using the writing-plans skill template:
|
|
|
7194
7195
|
success: !1,
|
|
7195
7196
|
message: "配置更新功能不可用"
|
|
7196
7197
|
};
|
|
7197
|
-
const { configStore: n } = await import("./
|
|
7198
|
+
const { configStore: n } = await import("./client-D-FCM8pg.mjs").then((o) => o.a), s = (await n.getConfig()).compact_mode ?? !1;
|
|
7198
7199
|
return await r({ compact_mode: !s }), {
|
|
7199
7200
|
success: !0,
|
|
7200
7201
|
message: !s ? "紧凑模式已启用" : "紧凑模式已关闭",
|
|
@@ -7304,12 +7305,12 @@ async function tt(t) {
|
|
|
7304
7305
|
depth: o + 1
|
|
7305
7306
|
}, f)));
|
|
7306
7307
|
const u = t;
|
|
7307
|
-
if (
|
|
7308
|
+
if (yn(u)) return wn(u);
|
|
7308
7309
|
if ("lc" in u && "type" in u && "id" in u && u.lc === 1 && u.type === "secret") {
|
|
7309
7310
|
const f = u, [m] = f.id;
|
|
7310
7311
|
if (m in i) return i[m];
|
|
7311
7312
|
if (s) {
|
|
7312
|
-
const g =
|
|
7313
|
+
const g = bn(m);
|
|
7313
7314
|
if (g) return g;
|
|
7314
7315
|
}
|
|
7315
7316
|
throw new Error(`Missing secret "${m}" at ${c}`);
|
|
@@ -7320,7 +7321,7 @@ async function tt(t) {
|
|
|
7320
7321
|
}
|
|
7321
7322
|
if ("lc" in u && "type" in u && "id" in u && "kwargs" in u && u.lc === 1 && u.type === "constructor") {
|
|
7322
7323
|
const f = u, m = JSON.stringify(f), [g, ...p] = f.id.slice().reverse(), y = p.reverse(), b = {
|
|
7323
|
-
langchain_core:
|
|
7324
|
+
langchain_core: _n,
|
|
7324
7325
|
langchain: n
|
|
7325
7326
|
};
|
|
7326
7327
|
let v = null;
|
|
@@ -7343,13 +7344,13 @@ async function tt(t) {
|
|
|
7343
7344
|
R in k && (v = k[R]);
|
|
7344
7345
|
}
|
|
7345
7346
|
if (typeof v != "object" || v === null) throw new Error(`Invalid namespace: ${c} -> ${m}`);
|
|
7346
|
-
const j = v[g] ?? Object.values(v).find((k) => typeof k == "function" &&
|
|
7347
|
+
const j = v[g] ?? Object.values(v).find((k) => typeof k == "function" && vn(k) === g);
|
|
7347
7348
|
if (typeof j != "function") throw new Error(`Invalid identifer: ${c} -> ${m}`);
|
|
7348
7349
|
const A = await tt.call({
|
|
7349
7350
|
...this,
|
|
7350
7351
|
path: [...a, "kwargs"],
|
|
7351
7352
|
depth: o + 1
|
|
7352
|
-
}, f.kwargs), I = new j(
|
|
7353
|
+
}, f.kwargs), I = new j(xn(A, Sn, Eo(j)));
|
|
7353
7354
|
return Object.defineProperty(I.constructor, "name", { value: g }), I;
|
|
7354
7355
|
}
|
|
7355
7356
|
const h = {};
|
|
@@ -7360,7 +7361,7 @@ async function tt(t) {
|
|
|
7360
7361
|
}, m);
|
|
7361
7362
|
return h;
|
|
7362
7363
|
}
|
|
7363
|
-
async function
|
|
7364
|
+
async function nn(t, e) {
|
|
7364
7365
|
const r = JSON.parse(t), n = {
|
|
7365
7366
|
optionalImportsMap: {},
|
|
7366
7367
|
optionalImportEntrypoints: [],
|
|
@@ -7488,7 +7489,7 @@ async function Nt(t) {
|
|
|
7488
7489
|
} catch {
|
|
7489
7490
|
return e;
|
|
7490
7491
|
}
|
|
7491
|
-
else if (Lo(e)) return
|
|
7492
|
+
else if (Lo(e)) return nn(JSON.stringify(e));
|
|
7492
7493
|
return e;
|
|
7493
7494
|
}
|
|
7494
7495
|
}
|
|
@@ -7530,10 +7531,10 @@ var Fo = class {
|
|
|
7530
7531
|
throw new Error(`Unknown serialization type: ${e}`);
|
|
7531
7532
|
}
|
|
7532
7533
|
};
|
|
7533
|
-
function
|
|
7534
|
+
function sn(t) {
|
|
7534
7535
|
if (typeof t != "object" || t === null) return t;
|
|
7535
7536
|
const e = Array.isArray(t) ? [] : {};
|
|
7536
|
-
for (const r in t) Object.prototype.hasOwnProperty.call(t, r) && (e[r] =
|
|
7537
|
+
for (const r in t) Object.prototype.hasOwnProperty.call(t, r) && (e[r] = sn(t[r]));
|
|
7537
7538
|
return e;
|
|
7538
7539
|
}
|
|
7539
7540
|
function Uo(t) {
|
|
@@ -7543,7 +7544,7 @@ function Uo(t) {
|
|
|
7543
7544
|
ts: t.ts,
|
|
7544
7545
|
channel_values: { ...t.channel_values },
|
|
7545
7546
|
channel_versions: { ...t.channel_versions },
|
|
7546
|
-
versions_seen:
|
|
7547
|
+
versions_seen: sn(t.versions_seen)
|
|
7547
7548
|
};
|
|
7548
7549
|
}
|
|
7549
7550
|
var Bo = class {
|
|
@@ -7848,7 +7849,7 @@ async function $t(t) {
|
|
|
7848
7849
|
return e;
|
|
7849
7850
|
}
|
|
7850
7851
|
else if (Xo(e))
|
|
7851
|
-
return
|
|
7852
|
+
return nn(JSON.stringify(e));
|
|
7852
7853
|
return e;
|
|
7853
7854
|
}
|
|
7854
7855
|
}
|
|
@@ -8390,7 +8391,7 @@ const lc = async () => {
|
|
|
8390
8391
|
if (process.env.REDIS_URL && process.env.CHECKPOINT_TYPE === "redis" || process.env.CHECKPOINT_TYPE === "shallow/redis") {
|
|
8391
8392
|
if (process.env.CHECKPOINT_TYPE === "redis") {
|
|
8392
8393
|
console.debug("LG | Using redis as checkpoint");
|
|
8393
|
-
const { RedisSaver: t } = await import("./index-
|
|
8394
|
+
const { RedisSaver: t } = await import("./index-TZW9juZS.mjs");
|
|
8394
8395
|
return await t.fromUrl(process.env.REDIS_URL, {
|
|
8395
8396
|
defaultTTL: 60,
|
|
8396
8397
|
// TTL in minutes
|
|
@@ -8399,18 +8400,18 @@ const lc = async () => {
|
|
|
8399
8400
|
}
|
|
8400
8401
|
if (process.env.CHECKPOINT_TYPE === "shallow/redis") {
|
|
8401
8402
|
console.debug("LG | Using shallow redis as checkpoint");
|
|
8402
|
-
const { ShallowRedisSaver: t } = await import("./shallow-
|
|
8403
|
+
const { ShallowRedisSaver: t } = await import("./shallow-DBKZP8qx.mjs");
|
|
8403
8404
|
return await t.fromUrl(process.env.REDIS_URL);
|
|
8404
8405
|
}
|
|
8405
8406
|
}
|
|
8406
8407
|
if (process.env.DATABASE_URL) {
|
|
8407
8408
|
console.debug("LG | Using postgres as checkpoint");
|
|
8408
|
-
const { createPGCheckpoint: t } = await import("./checkpoint-DxiUsHMy-
|
|
8409
|
+
const { createPGCheckpoint: t } = await import("./checkpoint-DxiUsHMy-noED47AT.mjs");
|
|
8409
8410
|
return t();
|
|
8410
8411
|
}
|
|
8411
8412
|
if (process.env.SQLITE_DATABASE_URI) {
|
|
8412
8413
|
console.debug("LG | Using sqlite as checkpoint");
|
|
8413
|
-
const { SqliteSaver: t } = await import("./checkpoint-1sAx_j1E-
|
|
8414
|
+
const { SqliteSaver: t } = await import("./checkpoint-1sAx_j1E-CQSUsimO.mjs");
|
|
8414
8415
|
return await t.fromConnStringAsync(process.env.SQLITE_DATABASE_URI);
|
|
8415
8416
|
}
|
|
8416
8417
|
return console.log("LG | You are using memory as checkpoint!"), console.log(
|
|
@@ -8424,7 +8425,7 @@ const lc = async () => {
|
|
|
8424
8425
|
let t;
|
|
8425
8426
|
if (process.env.REDIS_URL) {
|
|
8426
8427
|
console.debug("LG | Using redis as stream queue");
|
|
8427
|
-
const { RedisStreamQueue: e } = await import("./queue-D6tEGCGs-
|
|
8428
|
+
const { RedisStreamQueue: e } = await import("./queue-D6tEGCGs-C_utZwzP.mjs");
|
|
8428
8429
|
t = e;
|
|
8429
8430
|
} else
|
|
8430
8431
|
t = Qt;
|
|
@@ -8516,11 +8517,11 @@ async function hc(t, e, r, n, i) {
|
|
|
8516
8517
|
new ue("messages/metadata", {
|
|
8517
8518
|
[b.id]: v
|
|
8518
8519
|
})
|
|
8519
|
-
), f.add(b.id)),
|
|
8520
|
+
), f.add(b.id)), Tn.isInstance(b) && b.id ? (m.set(b.id, [
|
|
8520
8521
|
...m.get(b.id) ?? [],
|
|
8521
8522
|
b
|
|
8522
8523
|
]), await r.push(
|
|
8523
|
-
new ue("messages/partial", [m.get(b.id).reduce(
|
|
8524
|
+
new ue("messages/partial", [m.get(b.id).reduce(Cn)])
|
|
8524
8525
|
)) : await r.push(new ue("messages/partial", [b]));
|
|
8525
8526
|
} else if (g[0] === "updates") {
|
|
8526
8527
|
const b = g[1];
|
|
@@ -8695,7 +8696,7 @@ D.object({
|
|
|
8695
8696
|
const ae = gc(), pc = T.object({
|
|
8696
8697
|
thread_id: T.string().optional(),
|
|
8697
8698
|
thread_ts: T.string().optional()
|
|
8698
|
-
}).catchall(T.unknown()),
|
|
8699
|
+
}).catchall(T.unknown()), an = T.object({
|
|
8699
8700
|
tags: T.array(T.string()).optional(),
|
|
8700
8701
|
recursion_limit: T.number().int().optional(),
|
|
8701
8702
|
configurable: pc.optional()
|
|
@@ -8703,7 +8704,7 @@ const ae = gc(), pc = T.object({
|
|
|
8703
8704
|
T.object({
|
|
8704
8705
|
assistant_id: T.string().uuid(),
|
|
8705
8706
|
graph_id: T.string(),
|
|
8706
|
-
config:
|
|
8707
|
+
config: an,
|
|
8707
8708
|
created_at: T.string(),
|
|
8708
8709
|
updated_at: T.string(),
|
|
8709
8710
|
metadata: T.object({}).catchall(T.any())
|
|
@@ -8727,7 +8728,7 @@ T.object({
|
|
|
8727
8728
|
});
|
|
8728
8729
|
const dt = T.object({
|
|
8729
8730
|
thread_id: T.string().uuid()
|
|
8730
|
-
}),
|
|
8731
|
+
}), on = T.object({
|
|
8731
8732
|
thread_id: T.string().uuid(),
|
|
8732
8733
|
run_id: T.string().uuid()
|
|
8733
8734
|
}), wc = T.object({
|
|
@@ -8743,7 +8744,7 @@ const dt = T.object({
|
|
|
8743
8744
|
input: T.any().optional(),
|
|
8744
8745
|
command: yc.optional(),
|
|
8745
8746
|
metadata: ut.optional(),
|
|
8746
|
-
config:
|
|
8747
|
+
config: an.optional(),
|
|
8747
8748
|
webhook: T.string().optional(),
|
|
8748
8749
|
interrupt_before: T.union([T.literal("*"), T.array(T.string())]).optional(),
|
|
8749
8750
|
interrupt_after: T.union([T.literal("*"), T.array(T.string())]).optional(),
|
|
@@ -8805,10 +8806,10 @@ function ht(t) {
|
|
|
8805
8806
|
function Y(t, e) {
|
|
8806
8807
|
const r = t.safeParse(e);
|
|
8807
8808
|
if (!r.success)
|
|
8808
|
-
throw new
|
|
8809
|
+
throw new cn(r.error.issues);
|
|
8809
8810
|
return r.data;
|
|
8810
8811
|
}
|
|
8811
|
-
class
|
|
8812
|
+
class cn extends Error {
|
|
8812
8813
|
errors;
|
|
8813
8814
|
constructor(e) {
|
|
8814
8815
|
super("Validation failed"), this.name = "ValidationError", this.errors = e;
|
|
@@ -8824,7 +8825,7 @@ function de(t, e = 200, r) {
|
|
|
8824
8825
|
});
|
|
8825
8826
|
}
|
|
8826
8827
|
function ne(t, e = 500) {
|
|
8827
|
-
return t instanceof
|
|
8828
|
+
return t instanceof cn ? de(
|
|
8828
8829
|
{
|
|
8829
8830
|
error: "Validation Error",
|
|
8830
8831
|
details: t.errors
|
|
@@ -8837,7 +8838,7 @@ function ne(t, e = 500) {
|
|
|
8837
8838
|
e
|
|
8838
8839
|
);
|
|
8839
8840
|
}
|
|
8840
|
-
function
|
|
8841
|
+
function ln(t) {
|
|
8841
8842
|
let e, r = !1;
|
|
8842
8843
|
const n = new ReadableStream({
|
|
8843
8844
|
async start(i) {
|
|
@@ -8893,7 +8894,7 @@ function cn(t) {
|
|
|
8893
8894
|
}
|
|
8894
8895
|
});
|
|
8895
8896
|
}
|
|
8896
|
-
function
|
|
8897
|
+
function un(t, e = process.env.HEARTBEAT_INTERVAL ? parseInt(process.env.HEARTBEAT_INTERVAL) : 1500) {
|
|
8897
8898
|
return async (r) => {
|
|
8898
8899
|
let n = null;
|
|
8899
8900
|
const i = () => {
|
|
@@ -8979,8 +8980,8 @@ async function Pc(t, e) {
|
|
|
8979
8980
|
async function Dc(t, e) {
|
|
8980
8981
|
try {
|
|
8981
8982
|
const r = Te(t.url, "/threads/:thread_id/runs/stream"), { thread_id: n } = Y(dt, r), i = await t.json(), s = Y(_c, i);
|
|
8982
|
-
return
|
|
8983
|
-
|
|
8983
|
+
return ln(
|
|
8984
|
+
un(async (a) => {
|
|
8984
8985
|
s.config = s.config || {}, s.config.configurable = s.config.configurable || {};
|
|
8985
8986
|
const o = e?.langgraph_context;
|
|
8986
8987
|
o && Object.assign(s.config.configurable, o);
|
|
@@ -8998,9 +8999,9 @@ async function Dc(t, e) {
|
|
|
8998
8999
|
}
|
|
8999
9000
|
async function Rc(t, e) {
|
|
9000
9001
|
try {
|
|
9001
|
-
const r = Te(t.url, "/threads/:thread_id/runs/:run_id/stream"), { thread_id: n, run_id: i } = Y(
|
|
9002
|
-
return
|
|
9003
|
-
|
|
9002
|
+
const r = Te(t.url, "/threads/:thread_id/runs/:run_id/stream"), { thread_id: n, run_id: i } = Y(on, r), s = ht(t.url), { cancel_on_disconnect: a, last_event_id: o, stream_mode: l } = Y(Sc, s);
|
|
9003
|
+
return ln(
|
|
9004
|
+
un(async (c) => {
|
|
9004
9005
|
const u = new AbortController();
|
|
9005
9006
|
if (a) {
|
|
9006
9007
|
const h = () => {
|
|
@@ -9044,7 +9045,7 @@ async function Oc(t, e) {
|
|
|
9044
9045
|
}
|
|
9045
9046
|
async function Nc(t, e) {
|
|
9046
9047
|
try {
|
|
9047
|
-
const r = Te(t.url, "/threads/:thread_id/runs/:run_id/cancel"), { thread_id: n, run_id: i } = Y(
|
|
9048
|
+
const r = Te(t.url, "/threads/:thread_id/runs/:run_id/cancel"), { thread_id: n, run_id: i } = Y(on, r), s = ht(t.url), { wait: a, action: o } = Y(xc, s), l = ae.runs.cancel(n, i, a, o);
|
|
9048
9049
|
return a && await l, new Response(null, { status: a ? 204 : 202 });
|
|
9049
9050
|
} catch (r) {
|
|
9050
9051
|
return ne(r);
|
|
@@ -9140,10 +9141,10 @@ async function Uc(t, e = {}) {
|
|
|
9140
9141
|
return console.error("Request error:", r), ne(r);
|
|
9141
9142
|
}
|
|
9142
9143
|
}
|
|
9143
|
-
await
|
|
9144
|
-
sc("code",
|
|
9144
|
+
await jn();
|
|
9145
|
+
sc("code", In);
|
|
9145
9146
|
const Bc = (t, e = {}) => Uc(new Request(t, e), {}), zc = () => {
|
|
9146
|
-
const t =
|
|
9147
|
+
const t = Rr(), e = (/* @__PURE__ */ new Date()).toLocaleDateString(), { extraParams: r, AVAILABLE_MODELS: n, config: i } = he(), s = r.mcp_config || {}, a = Object.keys(s).length, o = Yn(), l = process.platform, c = l === "darwin" ? "macOS" : l === "win32" ? "Windows" : "Linux", u = process.cwd(), h = i?.model_provider || process.env.MODEL_PROVIDER || "openai", f = !!i?.openai_api_key, m = !!i?.openai_base_url, g = !!i?.anthropic_api_key, p = n.length > 0, y = h === "anthropic" ? g && p : f && m && p, [b, v] = x.useState(0);
|
|
9147
9148
|
return x.useEffect(() => {
|
|
9148
9149
|
const I = setInterval(() => {
|
|
9149
9150
|
v((k) => (k + 1) % 92);
|
|
@@ -9161,7 +9162,7 @@ const Bc = (t, e = {}) => Uc(new Request(t, e), {}), zc = () => {
|
|
|
9161
9162
|
███╔╝ ██╔══╝ ██║╚██╗██║
|
|
9162
9163
|
███████╗███████╗██║ ╚████║
|
|
9163
9164
|
╚══════╝╚══════╝╚═╝ ╚═══╝`.split(`
|
|
9164
|
-
`).map((S) => /* @__PURE__ */ d.jsx(
|
|
9165
|
+
`).map((S) => /* @__PURE__ */ d.jsx(kr, { interval: 40, text: S, globalIndex: b }, S)) }),
|
|
9165
9166
|
/* @__PURE__ */ d.jsxs(_, { flexDirection: "column", justifyContent: "center", flexGrow: 1, children: [
|
|
9166
9167
|
/* @__PURE__ */ d.jsx(_, { marginBottom: 1, children: y ? /* @__PURE__ */ d.jsxs(w, { color: "green", bold: !0, children: [
|
|
9167
9168
|
" ",
|
|
@@ -9930,12 +9931,12 @@ const tl = ({ tool: t }) => {
|
|
|
9930
9931
|
}, rl = fe({
|
|
9931
9932
|
name: "ask_user_with_options",
|
|
9932
9933
|
description: "Ask the user for a selection from a list of options",
|
|
9933
|
-
parameters:
|
|
9934
|
+
parameters: En.schema.shape,
|
|
9934
9935
|
handler: me.waitForUIDone,
|
|
9935
9936
|
render(t) {
|
|
9936
9937
|
return /* @__PURE__ */ d.jsx(tl, { tool: t });
|
|
9937
9938
|
}
|
|
9938
|
-
}),
|
|
9939
|
+
}), dn = ({
|
|
9939
9940
|
content: t,
|
|
9940
9941
|
maxLines: e = 10,
|
|
9941
9942
|
borderColor: r = "cyan",
|
|
@@ -10024,7 +10025,7 @@ const tl = ({ tool: t }) => {
|
|
|
10024
10025
|
return () => clearInterval(u);
|
|
10025
10026
|
}, [i, r, n, t]), o?.reviewConfig && i && !t.output)
|
|
10026
10027
|
return /* @__PURE__ */ d.jsx(_, { flexDirection: "column", children: /* @__PURE__ */ d.jsx(_, { paddingX: 1, paddingY: 1, children: /* @__PURE__ */ d.jsx(w, { color: "yellow", children: "⏳ Wait for Approval" }) }) });
|
|
10027
|
-
const l = () => t.output ? /* @__PURE__ */ d.jsx(
|
|
10028
|
+
const l = () => t.output ? /* @__PURE__ */ d.jsx(dn, { content: t.output, maxLines: 5, borderColor: "cyan" }) : null;
|
|
10028
10029
|
return /* @__PURE__ */ d.jsx(_, { flexDirection: "column", children: l() });
|
|
10029
10030
|
}, sl = fe({
|
|
10030
10031
|
name: "terminal",
|
|
@@ -10749,7 +10750,7 @@ function cl(t, e, r) {
|
|
|
10749
10750
|
return ol(t, e, { maxLines: s, contextLines: a });
|
|
10750
10751
|
}
|
|
10751
10752
|
const ft = ({ path: t, color: e = "cyan", line: r }) => {
|
|
10752
|
-
const n =
|
|
10753
|
+
const n = Dr(t), i = r !== void 0 ? `:${r}` : "";
|
|
10753
10754
|
return /* @__PURE__ */ d.jsxs(w, { color: le(e), children: [
|
|
10754
10755
|
n,
|
|
10755
10756
|
i
|
|
@@ -10757,7 +10758,7 @@ const ft = ({ path: t, color: e = "cyan", line: r }) => {
|
|
|
10757
10758
|
}, ll = fe({
|
|
10758
10759
|
name: "edit_file",
|
|
10759
10760
|
description: "Performs exact string replacements in files with diff visualization",
|
|
10760
|
-
parameters:
|
|
10761
|
+
parameters: An.shape,
|
|
10761
10762
|
handler: me.waitForUIDone,
|
|
10762
10763
|
render(t) {
|
|
10763
10764
|
const e = t.getInputRepaired(), r = t.output, n = e.old_string && e.new_string && e.old_string !== e.new_string;
|
|
@@ -10799,7 +10800,7 @@ const ft = ({ path: t, color: e = "cyan", line: r }) => {
|
|
|
10799
10800
|
}, hl = fe({
|
|
10800
10801
|
name: "TodoWrite",
|
|
10801
10802
|
description: "Use this tool to create and manage a structured task list",
|
|
10802
|
-
parameters:
|
|
10803
|
+
parameters: kn.shape,
|
|
10803
10804
|
handler: me.waitForUIDone,
|
|
10804
10805
|
render(t) {
|
|
10805
10806
|
const e = t.getInputRepaired();
|
|
@@ -10821,7 +10822,7 @@ const ft = ({ path: t, color: e = "cyan", line: r }) => {
|
|
|
10821
10822
|
}), fl = fe({
|
|
10822
10823
|
name: "read_file",
|
|
10823
10824
|
description: "Reads a file from the local filesystem",
|
|
10824
|
-
parameters:
|
|
10825
|
+
parameters: Mn.shape,
|
|
10825
10826
|
handler: me.waitForUIDone,
|
|
10826
10827
|
render(t) {
|
|
10827
10828
|
const e = t.getInputRepaired(), r = t.output;
|
|
@@ -10841,7 +10842,7 @@ const ft = ({ path: t, color: e = "cyan", line: r }) => {
|
|
|
10841
10842
|
}), ml = fe({
|
|
10842
10843
|
name: "glob_files",
|
|
10843
10844
|
description: "Find files by name patterns",
|
|
10844
|
-
parameters:
|
|
10845
|
+
parameters: Pn.shape,
|
|
10845
10846
|
handler: me.waitForUIDone,
|
|
10846
10847
|
render(t) {
|
|
10847
10848
|
const e = t.getInputRepaired(), r = t.output;
|
|
@@ -10944,7 +10945,7 @@ const ft = ({ path: t, color: e = "cyan", line: r }) => {
|
|
|
10944
10945
|
] }),
|
|
10945
10946
|
/* @__PURE__ */ d.jsx(w, { color: "blue", children: n.name })
|
|
10946
10947
|
] }, i)) }),
|
|
10947
|
-
r && /* @__PURE__ */ d.jsx(
|
|
10948
|
+
r && /* @__PURE__ */ d.jsx(dn, { content: r, maxLines: 5, borderColor: "gray" })
|
|
10948
10949
|
] });
|
|
10949
10950
|
}
|
|
10950
10951
|
}), vl = [sl, rl, ll, hl, fl, ml, pl, wl, _l], xl = ({
|
|
@@ -10955,7 +10956,7 @@ const ft = ({ path: t, color: e = "cyan", line: r }) => {
|
|
|
10955
10956
|
placeholder: i = "输入消息...",
|
|
10956
10957
|
commandHandler: s
|
|
10957
10958
|
}) => {
|
|
10958
|
-
const { bufferedMessage: a, setBufferedMessage: o, clearBuffer: l } =
|
|
10959
|
+
const { bufferedMessage: a, setBufferedMessage: o, clearBuffer: l } = Nr(), [c, u] = x.useState(t);
|
|
10959
10960
|
x.useEffect(() => {
|
|
10960
10961
|
u(t);
|
|
10961
10962
|
}, [t]);
|
|
@@ -11010,7 +11011,7 @@ const Sl = ({ onClose: t }) => {
|
|
|
11010
11011
|
dataSource: async () => {
|
|
11011
11012
|
const s = ke(process.cwd(), ".claude/memories"), a = ke(process.env.HOME || "", ".deepagents/code/memories"), o = ke(process.cwd(), ".claude/skills"), l = ke(process.env.HOME || "", ".deepagents/code/skills");
|
|
11012
11013
|
try {
|
|
11013
|
-
const c =
|
|
11014
|
+
const c = Dn(a, s), u = Rn(l, o);
|
|
11014
11015
|
return e === "memories" ? c.map((f) => ({ ...f, type: "memory" })) : u.map((f) => ({ ...f, type: "skill" }));
|
|
11015
11016
|
} catch (c) {
|
|
11016
11017
|
return console.warn("Failed to load knowledge:", c), [];
|
|
@@ -11049,7 +11050,7 @@ const Sl = ({ onClose: t }) => {
|
|
|
11049
11050
|
] }) }),
|
|
11050
11051
|
/* @__PURE__ */ d.jsx(_, { paddingY: 1, children: /* @__PURE__ */ d.jsx(w, { color: o ? "white" : "gray", children: l }) }),
|
|
11051
11052
|
/* @__PURE__ */ d.jsx(_, { children: /* @__PURE__ */ d.jsxs(w, { color: "cyan", dimColor: !o, children: [
|
|
11052
|
-
|
|
11053
|
+
Dr(s.path),
|
|
11053
11054
|
s.category && /* @__PURE__ */ d.jsxs(w, { color: "yellow", children: [
|
|
11054
11055
|
" ",
|
|
11055
11056
|
s.category
|
|
@@ -11141,7 +11142,7 @@ const Sl = ({ onClose: t }) => {
|
|
|
11141
11142
|
icon: "🤖",
|
|
11142
11143
|
// 数据源
|
|
11143
11144
|
dataSource: async () => {
|
|
11144
|
-
const s = await
|
|
11145
|
+
const s = await On();
|
|
11145
11146
|
return Object.values(s);
|
|
11146
11147
|
},
|
|
11147
11148
|
// 搜索配置
|
|
@@ -11204,7 +11205,7 @@ const Sl = ({ onClose: t }) => {
|
|
|
11204
11205
|
}), { loading: r } = re();
|
|
11205
11206
|
return x.useEffect(() => {
|
|
11206
11207
|
(async () => {
|
|
11207
|
-
const i = await
|
|
11208
|
+
const i = await Nn.getInstance().getStatus();
|
|
11208
11209
|
e(i);
|
|
11209
11210
|
})();
|
|
11210
11211
|
}, [r]), /* @__PURE__ */ d.jsx(d.Fragment, { children: t.toolCount ? /* @__PURE__ */ d.jsxs(_, { paddingX: 1, children: [
|
|
@@ -11220,8 +11221,12 @@ const Sl = ({ onClose: t }) => {
|
|
|
11220
11221
|
/* @__PURE__ */ d.jsxs(_, { gap: 1, children: [
|
|
11221
11222
|
i && /* @__PURE__ */ d.jsxs(w, { color: "yellow", bold: !0, children: [
|
|
11222
11223
|
/* @__PURE__ */ d.jsx(Un, {}),
|
|
11223
|
-
|
|
11224
|
-
|
|
11224
|
+
/* @__PURE__ */ d.jsx(
|
|
11225
|
+
kr,
|
|
11226
|
+
{
|
|
11227
|
+
text: "LOADING"
|
|
11228
|
+
}
|
|
11229
|
+
)
|
|
11225
11230
|
] }),
|
|
11226
11231
|
!i && /* @__PURE__ */ d.jsx(w, { color: "magenta", bold: !0, children: "Zen Code" }),
|
|
11227
11232
|
/* @__PURE__ */ d.jsxs(w, { color: "cyan", bold: !0, children: [
|
|
@@ -11372,7 +11377,7 @@ const Sl = ({ onClose: t }) => {
|
|
|
11372
11377
|
}, Ml = ({ onClose: t, onExecuteTask: e }) => {
|
|
11373
11378
|
const [r, n] = x.useState(null), [i, s] = x.useState(0), a = x.useCallback(async () => {
|
|
11374
11379
|
try {
|
|
11375
|
-
const { getTasksStore: u } = await import("./tasks-
|
|
11380
|
+
const { getTasksStore: u } = await import("./tasks-DdsMQRlx.mjs"), h = u(process.cwd());
|
|
11376
11381
|
return await h.initialize(), await h.getAllTasks();
|
|
11377
11382
|
} catch (u) {
|
|
11378
11383
|
return console.error("Failed to load tasks:", u), [];
|
|
@@ -11381,7 +11386,7 @@ const Sl = ({ onClose: t }) => {
|
|
|
11381
11386
|
n(null);
|
|
11382
11387
|
}, []), l = x.useCallback(async (u) => {
|
|
11383
11388
|
try {
|
|
11384
|
-
const { getTasksStore: h } = await import("./tasks-
|
|
11389
|
+
const { getTasksStore: h } = await import("./tasks-DdsMQRlx.mjs"), f = h(process.cwd());
|
|
11385
11390
|
await f.initialize(), await f.deleteTask(u.id) ? s((g) => g + 1) : console.error(`Failed to delete task: ${u.id}`);
|
|
11386
11391
|
} catch (h) {
|
|
11387
11392
|
console.error("Error deleting task:", h);
|
|
@@ -11604,7 +11609,7 @@ const Dl = () => {
|
|
|
11604
11609
|
}
|
|
11605
11610
|
);
|
|
11606
11611
|
}, Ol = () => {
|
|
11607
|
-
const { extraParams: t, toggleCompactMode: e } = he(), { setTools: r, createNewChat: n, loading: i, stopGeneration: s, currentChatId: a, sendMessage: o, renderMessages: l } = re(), { bufferedMessage: c, clearBuffer: u } =
|
|
11612
|
+
const { extraParams: t, toggleCompactMode: e } = he(), { setTools: r, createNewChat: n, loading: i, stopGeneration: s, currentChatId: a, sendMessage: o, renderMessages: l } = re(), { bufferedMessage: c, clearBuffer: u } = Nr();
|
|
11608
11613
|
x.useEffect(() => {
|
|
11609
11614
|
console.clear(), r(vl);
|
|
11610
11615
|
}, []), x.useEffect(() => {
|
|
@@ -11736,7 +11741,7 @@ ${R.acceptanceCriteria.map((z) => `- ${z}`).join(`
|
|
|
11736
11741
|
children: /* @__PURE__ */ d.jsx(Xn, { children: /* @__PURE__ */ d.jsx(es, { get_allowed_models: Bn, manager: kt, children: /* @__PURE__ */ d.jsx(Kn, { children: /* @__PURE__ */ d.jsx(ts, { children: /* @__PURE__ */ d.jsx(Ol, {}) }) }) }) })
|
|
11737
11742
|
}
|
|
11738
11743
|
), Ll = () => /* @__PURE__ */ d.jsx(Nl, {});
|
|
11739
|
-
|
|
11744
|
+
fn(/* @__PURE__ */ d.jsx(Ll, {}));
|
|
11740
11745
|
export {
|
|
11741
11746
|
Bo as B,
|
|
11742
11747
|
ic as C,
|