zen-code 4.4.0 → 4.4.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.
@@ -1,4 +1,4 @@
1
- import { a as v, R as se, B as S, b as In, p as En, n as An, c as Pn, F as Mn, j as d, T as p, d as Es, M as Pe, u as Pt, r as On } from "./MultiLineTextInput-e7hD79Wp.mjs";
1
+ import { a as v, R as se, B as C, b as In, p as En, n as An, c as Pn, F as Mn, j as d, T as p, d as Es, M as Pe, u as Pt, r as On } from "./MultiLineTextInput-e7hD79Wp.mjs";
2
2
  import Me from "chalk";
3
3
  import kn from "node:os";
4
4
  import { a as As } from "./_commonjsHelpers-DQNKXVTB.mjs";
@@ -30,7 +30,7 @@ function Os(e) {
30
30
  return se.createElement("ink-box", { internal_static: !0, style: l }, o);
31
31
  }
32
32
  function Mt() {
33
- return se.createElement(S, { flexGrow: 1 });
33
+ return se.createElement(C, { flexGrow: 1 });
34
34
  }
35
35
  const Fe = (e, t = {}) => {
36
36
  const { stdin: r, setRawMode: s, internal_exitOnCtrlC: a, internal_eventEmitter: n } = In();
@@ -292,13 +292,13 @@ const _a = v.createContext(null), ba = ({
292
292
  const w = y.tool;
293
293
  if (!w)
294
294
  return;
295
- const { status: b, editedArgs: C } = y;
295
+ const { status: b, editedArgs: S } = y;
296
296
  if (b === we.Approved)
297
297
  w.sendResumeData({ type: "approve" });
298
298
  else if (b === we.Edited) {
299
299
  const j = {
300
300
  name: w.message.name,
301
- args: C
301
+ args: S
302
302
  };
303
303
  w.sendResumeData({
304
304
  type: "edit",
@@ -316,16 +316,16 @@ const _a = v.createContext(null), ba = ({
316
316
  createdAt: /* @__PURE__ */ new Date()
317
317
  };
318
318
  return r((b) => {
319
- const C = [...b, w];
320
- return b.length === 0 && a(w.id), C;
319
+ const S = [...b, w];
320
+ return b.length === 0 && a(w.id), S;
321
321
  }), w.id;
322
322
  }, [i]), l = v.useCallback((y, w) => {
323
323
  r((b) => b.map(
324
- (C) => C.id === y ? { ...C, ...w } : C
324
+ (S) => S.id === y ? { ...S, ...w } : S
325
325
  ));
326
326
  }, []), c = v.useCallback((y) => {
327
327
  r((w) => {
328
- const b = w.filter((C) => C.id !== y);
328
+ const b = w.filter((S) => S.id !== y);
329
329
  return s === y && a(b.length > 0 ? b[0].id : null), b;
330
330
  });
331
331
  }, [s]), u = v.useCallback(() => {
@@ -465,7 +465,7 @@ const $s = v.createContext(null), Ot = () => {
465
465
  y();
466
466
  }, 100));
467
467
  }, [b, w, _, y]);
468
- const C = v.useMemo(
468
+ const S = v.useMemo(
469
469
  () => ({
470
470
  addInteraction: o,
471
471
  updateInteraction: l,
@@ -499,16 +499,16 @@ const $s = v.createContext(null), Ot = () => {
499
499
  b
500
500
  ]
501
501
  );
502
- return /* @__PURE__ */ d.jsx($s.Provider, { value: C, children: e });
502
+ return /* @__PURE__ */ d.jsx($s.Provider, { value: S, children: e });
503
503
  }, Us = ({ content: e, messageNumber: t }) => {
504
504
  const r = Ns(), s = () => typeof e == "string" ? /* @__PURE__ */ d.jsx(p, { color: "white", children: e }) : Array.isArray(e) ? e.filter((a) => a.type === "text").map((a, n) => /* @__PURE__ */ d.jsx(p, { color: "white", children: a.text })) : /* @__PURE__ */ d.jsx(p, { color: "white", children: JSON.stringify(e) });
505
- return /* @__PURE__ */ d.jsxs(S, { flexDirection: "column", children: [
506
- /* @__PURE__ */ d.jsx(S, { children: /* @__PURE__ */ d.jsxs(p, { color: Ce("amber"), children: [
505
+ return /* @__PURE__ */ d.jsxs(C, { flexDirection: "column", children: [
506
+ /* @__PURE__ */ d.jsx(C, { children: /* @__PURE__ */ d.jsxs(p, { color: Ce("amber"), children: [
507
507
  t,
508
508
  " ",
509
509
  r
510
510
  ] }) }),
511
- /* @__PURE__ */ d.jsx(S, { children: /* @__PURE__ */ d.jsxs(p, { color: "gray", children: [
511
+ /* @__PURE__ */ d.jsx(C, { children: /* @__PURE__ */ d.jsxs(p, { color: "gray", children: [
512
512
  "└─ ",
513
513
  s()
514
514
  ] }) })
@@ -555,7 +555,7 @@ function xa() {
555
555
  }, o.prototype.emit = function(c, u, h, f, m, g) {
556
556
  var _ = r ? r + c : c;
557
557
  if (!this._events[_]) return !1;
558
- var y = this._events[_], w = arguments.length, b, C;
558
+ var y = this._events[_], w = arguments.length, b, S;
559
559
  if (y.fn) {
560
560
  switch (y.once && this.removeListener(c, y.fn, void 0, !0), w) {
561
561
  case 1:
@@ -571,29 +571,29 @@ function xa() {
571
571
  case 6:
572
572
  return y.fn.call(y.context, u, h, f, m, g), !0;
573
573
  }
574
- for (C = 1, b = new Array(w - 1); C < w; C++)
575
- b[C - 1] = arguments[C];
574
+ for (S = 1, b = new Array(w - 1); S < w; S++)
575
+ b[S - 1] = arguments[S];
576
576
  y.fn.apply(y.context, b);
577
577
  } else {
578
578
  var j = y.length, x;
579
- for (C = 0; C < j; C++)
580
- switch (y[C].once && this.removeListener(c, y[C].fn, void 0, !0), w) {
579
+ for (S = 0; S < j; S++)
580
+ switch (y[S].once && this.removeListener(c, y[S].fn, void 0, !0), w) {
581
581
  case 1:
582
- y[C].fn.call(y[C].context);
582
+ y[S].fn.call(y[S].context);
583
583
  break;
584
584
  case 2:
585
- y[C].fn.call(y[C].context, u);
585
+ y[S].fn.call(y[S].context, u);
586
586
  break;
587
587
  case 3:
588
- y[C].fn.call(y[C].context, u, h);
588
+ y[S].fn.call(y[S].context, u, h);
589
589
  break;
590
590
  case 4:
591
- y[C].fn.call(y[C].context, u, h, f);
591
+ y[S].fn.call(y[S].context, u, h, f);
592
592
  break;
593
593
  default:
594
594
  if (!b) for (x = 1, b = new Array(w - 1); x < w; x++)
595
595
  b[x - 1] = arguments[x];
596
- y[C].fn.apply(y[C].context, b);
596
+ y[S].fn.apply(y[S].context, b);
597
597
  }
598
598
  }
599
599
  return !0;
@@ -1531,9 +1531,9 @@ function hi(e, t, r) {
1531
1531
  var w = i && n === void 0;
1532
1532
  if (n !== void 0 && clearTimeout(n), n = setTimeout(function() {
1533
1533
  if (n = void 0, c = Date.now(), !i) {
1534
- var C = e.apply(g, m);
1535
- o && o(C), u.forEach(function(j) {
1536
- return (0, j.resolve)(C);
1534
+ var S = e.apply(g, m);
1535
+ o && o(S), u.forEach(function(j) {
1536
+ return (0, j.resolve)(S);
1537
1537
  }), u = [];
1538
1538
  }
1539
1539
  }, h()), w) {
@@ -1595,7 +1595,7 @@ function fi() {
1595
1595
  throw new a(`${x} at position ${f}`);
1596
1596
  }, g = (x) => {
1597
1597
  throw new n(`${x} at position ${f}`);
1598
- }, _ = () => (j(), f >= h && m("Unexpected end of input"), c[f] === '"' ? y() : c[f] === "{" ? w() : c[f] === "[" ? b() : c.substring(f, f + 4) === "null" || s.Allow.NULL & u && h - f < 4 && "null".startsWith(c.substring(f)) ? (f += 4, null) : c.substring(f, f + 4) === "true" || s.Allow.BOOL & u && h - f < 4 && "true".startsWith(c.substring(f)) ? (f += 4, !0) : c.substring(f, f + 5) === "false" || s.Allow.BOOL & u && h - f < 5 && "false".startsWith(c.substring(f)) ? (f += 5, !1) : c.substring(f, f + 8) === "Infinity" || s.Allow.INFINITY & u && h - f < 8 && "Infinity".startsWith(c.substring(f)) ? (f += 8, 1 / 0) : c.substring(f, f + 9) === "-Infinity" || s.Allow._INFINITY & u && 1 < h - f && h - f < 9 && "-Infinity".startsWith(c.substring(f)) ? (f += 9, -1 / 0) : c.substring(f, f + 3) === "NaN" || s.Allow.NAN & u && h - f < 3 && "NaN".startsWith(c.substring(f)) ? (f += 3, NaN) : C()), y = () => {
1598
+ }, _ = () => (j(), f >= h && m("Unexpected end of input"), c[f] === '"' ? y() : c[f] === "{" ? w() : c[f] === "[" ? b() : c.substring(f, f + 4) === "null" || s.Allow.NULL & u && h - f < 4 && "null".startsWith(c.substring(f)) ? (f += 4, null) : c.substring(f, f + 4) === "true" || s.Allow.BOOL & u && h - f < 4 && "true".startsWith(c.substring(f)) ? (f += 4, !0) : c.substring(f, f + 5) === "false" || s.Allow.BOOL & u && h - f < 5 && "false".startsWith(c.substring(f)) ? (f += 5, !1) : c.substring(f, f + 8) === "Infinity" || s.Allow.INFINITY & u && h - f < 8 && "Infinity".startsWith(c.substring(f)) ? (f += 8, 1 / 0) : c.substring(f, f + 9) === "-Infinity" || s.Allow._INFINITY & u && 1 < h - f && h - f < 9 && "-Infinity".startsWith(c.substring(f)) ? (f += 9, -1 / 0) : c.substring(f, f + 3) === "NaN" || s.Allow.NAN & u && h - f < 3 && "NaN".startsWith(c.substring(f)) ? (f += 3, NaN) : S()), y = () => {
1599
1599
  const x = f;
1600
1600
  let I = !1;
1601
1601
  for (f++; f < h && (c[f] !== '"' || I && c[f - 1] === "\\"); )
@@ -1650,7 +1650,7 @@ function fi() {
1650
1650
  m("Expected ']' at end of array");
1651
1651
  }
1652
1652
  return f++, x;
1653
- }, C = () => {
1653
+ }, S = () => {
1654
1654
  if (f === 0) {
1655
1655
  c === "-" && g("Not sure what '-' is");
1656
1656
  try {
@@ -4096,7 +4096,7 @@ const Yr = (e) => {
4096
4096
  const t = (l) => l.toString().padStart(2, "0"), r = e.getFullYear(), s = t(e.getMonth() + 1), a = t(e.getDate()), n = t(e.getHours()), i = t(e.getMinutes()), o = t(e.getSeconds());
4097
4097
  return `${r}-${s}-${a} ${n}:${i}:${o}`;
4098
4098
  }, Ks = (e) => typeof e == "string" ? e : Array.isArray(e) ? e.map((t) => typeof t == "string" ? t : t.type === "text" ? t.text : t.type === "image_url" ? "[图片]" : t.type === "tool_use" ? "" : JSON.stringify(t)).join("") : JSON.stringify(e), so = (e, t, r = {}) => {
4099
- const s = /* @__PURE__ */ z(null), a = /* @__PURE__ */ z([]), n = /* @__PURE__ */ z(null), i = /* @__PURE__ */ z([]), o = /* @__PURE__ */ z([]), l = /* @__PURE__ */ z(""), c = /* @__PURE__ */ z(null), u = /* @__PURE__ */ z(e), h = /* @__PURE__ */ z(null), f = /* @__PURE__ */ z("__start__"), m = /* @__PURE__ */ z("idle"), g = /* @__PURE__ */ z(null), _ = /* @__PURE__ */ z(!1), y = /* @__PURE__ */ z([]), w = /* @__PURE__ */ z([]), b = /* @__PURE__ */ z(r.showHistory ?? !1), C = /* @__PURE__ */ z(r.showGraph ?? !1), j = /* @__PURE__ */ z(null), x = /* @__PURE__ */ z({
4099
+ const s = /* @__PURE__ */ z(null), a = /* @__PURE__ */ z([]), n = /* @__PURE__ */ z(null), i = /* @__PURE__ */ z([]), o = /* @__PURE__ */ z([]), l = /* @__PURE__ */ z(""), c = /* @__PURE__ */ z(null), u = /* @__PURE__ */ z(e), h = /* @__PURE__ */ z(null), f = /* @__PURE__ */ z("__start__"), m = /* @__PURE__ */ z("idle"), g = /* @__PURE__ */ z(null), _ = /* @__PURE__ */ z(!1), y = /* @__PURE__ */ z([]), w = /* @__PURE__ */ z([]), b = /* @__PURE__ */ z(r.showHistory ?? !1), S = /* @__PURE__ */ z(r.showGraph ?? !1), j = /* @__PURE__ */ z(null), x = /* @__PURE__ */ z({
4100
4100
  page: 1,
4101
4101
  pageSize: 10,
4102
4102
  total: 0
@@ -4119,7 +4119,7 @@ const Yr = (e) => {
4119
4119
  const A = n.get();
4120
4120
  A && (A.tools.clearTools(), A.tools.bindTools(y.get()));
4121
4121
  }, F = async () => {
4122
- C.get() && j.set(await n.get()?.graphVisualize() || null);
4122
+ S.get() && j.set(await n.get()?.graphVisualize() || null);
4123
4123
  };
4124
4124
  async function H() {
4125
4125
  const A = new ro({
@@ -4211,7 +4211,7 @@ const Yr = (e) => {
4211
4211
  const fe = J.renderMessage;
4212
4212
  o.set(fe);
4213
4213
  const je = fe[fe.length - 1];
4214
- f.set(je?.node_name || je?.name || "__start__"), O(), C.get() && F(), U();
4214
+ f.set(je?.node_name || je?.name || "__start__"), O(), S.get() && F(), U();
4215
4215
  const me = J.getCurrentThread();
4216
4216
  if (me && (me.status === "busy" || me.status === "pending") && await J.resetStream(), me?.status === "interrupted") {
4217
4217
  const Xe = J.interruptData;
@@ -4281,7 +4281,7 @@ const Yr = (e) => {
4281
4281
  // 工具和图表
4282
4282
  tools: y,
4283
4283
  collapsedTools: w,
4284
- showGraph: C,
4284
+ showGraph: S,
4285
4285
  graphVisualize: j,
4286
4286
  // 历史记录
4287
4287
  showHistory: b,
@@ -4322,7 +4322,7 @@ const Yr = (e) => {
4322
4322
  // UI 切换
4323
4323
  toggleHistoryVisible: Sn,
4324
4324
  toggleGraphVisible() {
4325
- C.set(!C.get()), C.get() && F();
4325
+ S.set(!S.get()), S.get() && F();
4326
4326
  },
4327
4327
  refreshGraph: F,
4328
4328
  // Agent 切换
@@ -4864,8 +4864,8 @@ const yo = (e, t) => e.some((r) => typeof r == "string" ? r === t : (r.lastIndex
4864
4864
  if (Ht.has(w))
4865
4865
  _ = Ht.get(w);
4866
4866
  else {
4867
- const b = _.match(/^[_$]*/)[0], C = go(_.slice(b.length), { pascalCase: n, locale: !1, preserveConsecutiveUppercase: l });
4868
- _ = b + C, _.length < 100 && Ht.set(w, _);
4867
+ const b = _.match(/^[_$]*/)[0], S = go(_.slice(b.length), { pascalCase: n, locale: !1, preserveConsecutiveUppercase: l });
4868
+ _ = b + S, _.length < 100 && Ht.set(w, _);
4869
4869
  }
4870
4870
  }
4871
4871
  return [_, y];
@@ -5684,7 +5684,7 @@ function Xs(e) {
5684
5684
  Promise.resolve(_).then(h).catch((w) => {
5685
5685
  if (n())
5686
5686
  return;
5687
- const b = e.retry ?? (Ne ? 0 : 3), C = e.retryDelay ?? Do, j = typeof C == "function" ? C(r, w) : C, x = b === !0 || typeof b == "number" && r < b || typeof b == "function" && b(r, w);
5687
+ const b = e.retry ?? (Ne ? 0 : 3), S = e.retryDelay ?? Do, j = typeof S == "function" ? S(r, w) : S, x = b === !0 || typeof b == "number" && r < b || typeof b == "function" && b(r, w);
5688
5688
  if (t || !x) {
5689
5689
  f(w);
5690
5690
  return;
@@ -6204,12 +6204,12 @@ var Lo = class extends Ve {
6204
6204
  this.#a = P;
6205
6205
  }
6206
6206
  this.#a && (m = this.#a, f = this.#f, g = Date.now(), _ = "error");
6207
- const w = u.fetchStatus === "fetching", b = _ === "pending", C = _ === "error", j = b && w, x = f !== void 0, E = {
6207
+ const w = u.fetchStatus === "fetching", b = _ === "pending", S = _ === "error", j = b && w, x = f !== void 0, E = {
6208
6208
  status: _,
6209
6209
  fetchStatus: u.fetchStatus,
6210
6210
  isPending: b,
6211
6211
  isSuccess: _ === "success",
6212
- isError: C,
6212
+ isError: S,
6213
6213
  isInitialLoading: j,
6214
6214
  isLoading: j,
6215
6215
  data: f,
@@ -6223,10 +6223,10 @@ var Lo = class extends Ve {
6223
6223
  isFetchedAfterMount: u.dataUpdateCount > l.dataUpdateCount || u.errorUpdateCount > l.errorUpdateCount,
6224
6224
  isFetching: w,
6225
6225
  isRefetching: w && !b,
6226
- isLoadingError: C && !x,
6226
+ isLoadingError: S && !x,
6227
6227
  isPaused: u.fetchStatus === "paused",
6228
6228
  isPlaceholderData: h,
6229
- isRefetchError: C && x,
6229
+ isRefetchError: S && x,
6230
6230
  isStale: Ir(e, t),
6231
6231
  refetch: this.refetch,
6232
6232
  promise: this.#i,
@@ -6344,9 +6344,9 @@ function hs(e) {
6344
6344
  meta: t.options.meta
6345
6345
  };
6346
6346
  return h(I), I;
6347
- })(), C = await f(b), { maxPages: j } = t.options, x = y ? Ao : Eo;
6347
+ })(), S = await f(b), { maxPages: j } = t.options, x = y ? Ao : Eo;
6348
6348
  return {
6349
- pages: x(g.pages, C, j),
6349
+ pages: x(g.pages, S, j),
6350
6350
  pageParams: x(g.pageParams, _, j)
6351
6351
  };
6352
6352
  };
@@ -7398,7 +7398,7 @@ function Er({
7398
7398
  suffix: n,
7399
7399
  suffixColor: i = "green"
7400
7400
  }) {
7401
- return /* @__PURE__ */ d.jsxs(S, { paddingX: 1, paddingY: 0, children: [
7401
+ return /* @__PURE__ */ d.jsxs(C, { paddingX: 1, paddingY: 0, children: [
7402
7402
  /* @__PURE__ */ d.jsx(p, { color: e ? "cyan" : "gray", children: e ? ">" : " " }),
7403
7403
  s && /* @__PURE__ */ d.jsx(p, { color: a || (e || t ? "cyan" : "gray"), children: s }),
7404
7404
  /* @__PURE__ */ d.jsx(p, { color: e ? "cyan" : "gray", children: " " }),
@@ -7413,7 +7413,7 @@ function Er({
7413
7413
  const hc = ({ option: e, isSelected: t, isHighlighted: r, isFocused: s, isComponentDisabled: a }) => {
7414
7414
  const n = !s || a;
7415
7415
  let i = "white";
7416
- return e.disabled ? i = "gray" : t ? i = s ? "green" : "gray" : r && s ? i = "cyan" : n && (i = "gray"), /* @__PURE__ */ d.jsx(S, { children: /* @__PURE__ */ d.jsxs(p, { color: i, children: [
7416
+ return e.disabled ? i = "gray" : t ? i = s ? "green" : "gray" : r && s ? i = "cyan" : n && (i = "gray"), /* @__PURE__ */ d.jsx(C, { children: /* @__PURE__ */ d.jsxs(p, { color: i, children: [
7417
7417
  t ? "◉ " : "○ ",
7418
7418
  e.label
7419
7419
  ] }) });
@@ -7458,14 +7458,14 @@ const hc = ({ option: e, isSelected: t, isHighlighted: r, isFocused: s, isCompon
7458
7458
  Fe((j, x) => {
7459
7459
  !f || n || (x.upArrow ? y((I) => Math.max(0, I - 1)) : x.downArrow ? y((I) => Math.min(e.length - 1, I + 1)) : x.return ? b() : j === " " && w(_));
7460
7460
  });
7461
- const C = i ? e.filter(
7461
+ const S = i ? e.filter(
7462
7462
  (j) => j.label.toLowerCase().includes(i.toLowerCase()) || j.value.toLowerCase().includes(i.toLowerCase())
7463
7463
  ) : e;
7464
- return /* @__PURE__ */ d.jsxs(S, { flexDirection: "column", children: [
7465
- /* @__PURE__ */ d.jsx(S, { marginBottom: 1, children: /* @__PURE__ */ d.jsx(c, { values: m }) }),
7466
- /* @__PURE__ */ d.jsx(S, { flexDirection: "column", children: C.map((j, x) => {
7464
+ return /* @__PURE__ */ d.jsxs(C, { flexDirection: "column", children: [
7465
+ /* @__PURE__ */ d.jsx(C, { marginBottom: 1, children: /* @__PURE__ */ d.jsx(c, { values: m }) }),
7466
+ /* @__PURE__ */ d.jsx(C, { flexDirection: "column", children: S.map((j, x) => {
7467
7467
  const I = m.includes(j.value), E = x === _;
7468
- return /* @__PURE__ */ d.jsx(S, { children: /* @__PURE__ */ d.jsx(
7468
+ return /* @__PURE__ */ d.jsx(C, { children: /* @__PURE__ */ d.jsx(
7469
7469
  o,
7470
7470
  {
7471
7471
  option: j,
@@ -7477,8 +7477,8 @@ const hc = ({ option: e, isSelected: t, isHighlighted: r, isFocused: s, isCompon
7477
7477
  ) }, j.value);
7478
7478
  }) })
7479
7479
  ] });
7480
- }, zt = ({ title: e, icon: t, count: r, children: s, statusInfo: a }) => /* @__PURE__ */ d.jsxs(S, { flexDirection: "column", paddingX: 1, paddingY: 0, flexGrow: 1, children: [
7481
- /* @__PURE__ */ d.jsx(S, { paddingBottom: 1, justifyContent: "space-between", children: /* @__PURE__ */ d.jsxs(p, { color: "yellow", bold: !0, children: [
7480
+ }, zt = ({ title: e, icon: t, count: r, children: s, statusInfo: a }) => /* @__PURE__ */ d.jsxs(C, { flexDirection: "column", paddingX: 1, paddingY: 0, flexGrow: 1, children: [
7481
+ /* @__PURE__ */ d.jsx(C, { paddingBottom: 1, justifyContent: "space-between", children: /* @__PURE__ */ d.jsxs(p, { color: "yellow", bold: !0, children: [
7482
7482
  t,
7483
7483
  " ",
7484
7484
  e,
@@ -7486,8 +7486,8 @@ const hc = ({ option: e, isSelected: t, isHighlighted: r, isFocused: s, isCompon
7486
7486
  r !== void 0 && `(${r})`
7487
7487
  ] }) }),
7488
7488
  s,
7489
- a && /* @__PURE__ */ d.jsx(S, { marginTop: 1, paddingX: 1, children: a })
7490
- ] }), gc = ({ searchTerm: e, onSearchTermChange: t, placeholder: r }) => /* @__PURE__ */ d.jsx(S, { flexDirection: "column", width: "100%", children: /* @__PURE__ */ d.jsxs(S, { gap: 1, paddingX: 1, width: "100%", children: [
7489
+ a && /* @__PURE__ */ d.jsx(C, { marginTop: 1, paddingX: 1, children: a })
7490
+ ] }), gc = ({ searchTerm: e, onSearchTermChange: t, placeholder: r }) => /* @__PURE__ */ d.jsx(C, { flexDirection: "column", width: "100%", children: /* @__PURE__ */ d.jsxs(C, { gap: 1, paddingX: 1, width: "100%", children: [
7491
7491
  /* @__PURE__ */ d.jsx(p, { color: "cyan", children: "/" }),
7492
7492
  /* @__PURE__ */ d.jsx(
7493
7493
  Pe,
@@ -7509,7 +7509,7 @@ function pc({
7509
7509
  renderItem: a
7510
7510
  }) {
7511
7511
  if (e.length === 0)
7512
- return /* @__PURE__ */ d.jsx(S, { paddingX: 1, paddingY: 1, children: /* @__PURE__ */ d.jsx(p, { color: "gray", children: "暂无数据" }) });
7512
+ return /* @__PURE__ */ d.jsx(C, { paddingX: 1, paddingY: 1, children: /* @__PURE__ */ d.jsx(p, { color: "gray", children: "暂无数据" }) });
7513
7513
  const n = s * r, i = e.length * r, o = v.useMemo(() => {
7514
7514
  const h = t * r, f = n / 2;
7515
7515
  if (h < f)
@@ -7517,7 +7517,7 @@ function pc({
7517
7517
  const m = Math.max(0, i - n);
7518
7518
  return Math.min(h - f, m);
7519
7519
  }, [t, r, n, i]), l = Math.floor(o / r), c = Math.min(l + s + 1, e.length), u = e.slice(l, c);
7520
- return /* @__PURE__ */ d.jsx(S, { flexDirection: "column", width: "100%", gap: 1, children: u.map((h, f) => a(h, l + f, l + f === t)) });
7520
+ return /* @__PURE__ */ d.jsx(C, { flexDirection: "column", width: "100%", gap: 1, children: u.map((h, f) => a(h, l + f, l + f === t)) });
7521
7521
  }
7522
7522
  function yc(e, t) {
7523
7523
  const r = e.toLowerCase(), s = t.toLowerCase();
@@ -7581,59 +7581,59 @@ function bc(e) {
7581
7581
  onClose: y.current || (() => {
7582
7582
  })
7583
7583
  }), [t, a, h]);
7584
- return Pt((b, C) => {
7584
+ return Pt((b, S) => {
7585
7585
  if (m) {
7586
- (C.escape || C.return) && g(!1);
7586
+ (S.escape || S.return) && g(!1);
7587
7587
  return;
7588
7588
  }
7589
7589
  if (b === "/") {
7590
7590
  l?.(), g(!0);
7591
7591
  return;
7592
7592
  }
7593
- if (C.tab) {
7593
+ if (S.tab) {
7594
7594
  c?.();
7595
7595
  return;
7596
7596
  }
7597
- if (C.escape) {
7597
+ if (S.escape) {
7598
7598
  o?.();
7599
7599
  return;
7600
7600
  }
7601
- if (C.upArrow && u.upArrow) {
7601
+ if (S.upArrow && u.upArrow) {
7602
7602
  const x = w();
7603
7603
  u.upArrow(x);
7604
7604
  return;
7605
7605
  }
7606
- if (C.downArrow && u.downArrow) {
7606
+ if (S.downArrow && u.downArrow) {
7607
7607
  const x = w();
7608
7608
  u.downArrow(x);
7609
7609
  return;
7610
7610
  }
7611
- if (C.leftArrow && u.leftArrow) {
7611
+ if (S.leftArrow && u.leftArrow) {
7612
7612
  const x = w();
7613
7613
  u.leftArrow(x);
7614
7614
  return;
7615
7615
  }
7616
- if (C.rightArrow && u.rightArrow) {
7616
+ if (S.rightArrow && u.rightArrow) {
7617
7617
  const x = w();
7618
7618
  u.rightArrow(x);
7619
7619
  return;
7620
7620
  }
7621
- if (C.pageUp && u.pageUp) {
7621
+ if (S.pageUp && u.pageUp) {
7622
7622
  const x = w();
7623
7623
  u.pageUp(x);
7624
7624
  return;
7625
7625
  }
7626
- if (C.pageDown && u.pageDown) {
7626
+ if (S.pageDown && u.pageDown) {
7627
7627
  const x = w();
7628
7628
  u.pageDown(x);
7629
7629
  return;
7630
7630
  }
7631
- if (C.home && u.home) {
7631
+ if (S.home && u.home) {
7632
7632
  const x = w();
7633
7633
  u.home(x);
7634
7634
  return;
7635
7635
  }
7636
- if (C.end && u.end) {
7636
+ if (S.end && u.end) {
7637
7637
  const x = w();
7638
7638
  u.end(x);
7639
7639
  return;
@@ -7644,8 +7644,8 @@ function bc(e) {
7644
7644
  j(x);
7645
7645
  return;
7646
7646
  }
7647
- if (C.ctrl || C.meta) {
7648
- const x = `${C.ctrl ? "Ctrl" : "Meta"}+${b}`, I = u[x];
7647
+ if (S.ctrl || S.meta) {
7648
+ const x = `${S.ctrl ? "Ctrl" : "Meta"}+${b}`, I = u[x];
7649
7649
  if (I) {
7650
7650
  const E = w();
7651
7651
  I(E);
@@ -7654,32 +7654,32 @@ function bc(e) {
7654
7654
  }
7655
7655
  if (a.length !== 0)
7656
7656
  switch (!0) {
7657
- case C.upArrow:
7657
+ case S.upArrow:
7658
7658
  f((x) => x > 0 ? x - 1 : a.length - 1);
7659
7659
  break;
7660
- case C.downArrow:
7660
+ case S.downArrow:
7661
7661
  f((x) => x < a.length - 1 ? x + 1 : 0);
7662
7662
  break;
7663
- case C.pageUp:
7663
+ case S.pageUp:
7664
7664
  f((x) => Math.max(0, x - s));
7665
7665
  break;
7666
- case C.pageDown:
7666
+ case S.pageDown:
7667
7667
  f((x) => Math.min(a.length - 1, x + s));
7668
7668
  break;
7669
- case C.home:
7669
+ case S.home:
7670
7670
  f(0);
7671
7671
  break;
7672
- case C.end:
7672
+ case S.end:
7673
7673
  f(a.length - 1);
7674
7674
  break;
7675
- case C.return:
7675
+ case S.return:
7676
7676
  if (n) {
7677
7677
  const x = a[h];
7678
7678
  x && n(x);
7679
7679
  }
7680
7680
  break;
7681
- case C.backspace:
7682
- case C.delete:
7681
+ case S.backspace:
7682
+ case S.delete:
7683
7683
  if (i) {
7684
7684
  const x = a[h];
7685
7685
  x && i(x);
@@ -7694,7 +7694,7 @@ function bc(e) {
7694
7694
  };
7695
7695
  }
7696
7696
  function ut({ config: e, onClose: t }) {
7697
- const [r, s] = v.useState([]), [a, n] = v.useState(!0), i = v.useMemo(() => e.dataSource, [e.dataSource]), o = v.useMemo(() => e.id, [e.id]), l = v.useMemo(() => e.searchFields, [e.searchFields]), c = v.useMemo(() => e.filters, [e.filters]), u = v.useMemo(() => e.defaultFilter, [e.defaultFilter]), h = v.useMemo(() => e.isSelected, [e.isSelected]), f = v.useMemo(() => e.visibleCount, [e.visibleCount]), m = v.useMemo(() => e.itemHeight, [e.itemHeight]), g = v.useMemo(() => e.renderItem, [e.renderItem]), _ = v.useMemo(() => e.onSelect, [e.onSelect]), y = v.useMemo(() => e.onDelete, [e.onDelete]), w = v.useMemo(() => e.showCount, [e.showCount]), b = v.useMemo(() => e.statusInfo, [e.statusInfo]), C = v.useMemo(() => e.searchable, [e.searchable]), j = v.useMemo(() => e.filterable, [e.filterable]), x = v.useMemo(() => e.searchPlaceholder, [e.searchPlaceholder]), I = v.useMemo(() => e.keyMap, [e.keyMap]);
7697
+ const [r, s] = v.useState([]), [a, n] = v.useState(!0), i = v.useMemo(() => e.dataSource, [e.dataSource]), o = v.useMemo(() => e.id, [e.id]), l = v.useMemo(() => e.searchFields, [e.searchFields]), c = v.useMemo(() => e.filters, [e.filters]), u = v.useMemo(() => e.defaultFilter, [e.defaultFilter]), h = v.useMemo(() => e.isSelected, [e.isSelected]), f = v.useMemo(() => e.visibleCount, [e.visibleCount]), m = v.useMemo(() => e.itemHeight, [e.itemHeight]), g = v.useMemo(() => e.renderItem, [e.renderItem]), _ = v.useMemo(() => e.onSelect, [e.onSelect]), y = v.useMemo(() => e.onDelete, [e.onDelete]), w = v.useMemo(() => e.showCount, [e.showCount]), b = v.useMemo(() => e.statusInfo, [e.statusInfo]), S = v.useMemo(() => e.searchable, [e.searchable]), j = v.useMemo(() => e.filterable, [e.filterable]), x = v.useMemo(() => e.searchPlaceholder, [e.searchPlaceholder]), I = v.useMemo(() => e.keyMap, [e.keyMap]);
7698
7698
  v.useEffect(() => {
7699
7699
  (async () => {
7700
7700
  try {
@@ -7748,7 +7748,7 @@ function ut({ config: e, onClose: t }) {
7748
7748
  count: w ? ie.length : void 0,
7749
7749
  statusInfo: b?.(ae),
7750
7750
  children: [
7751
- /* @__PURE__ */ d.jsx(S, { flexGrow: 1, children: /* @__PURE__ */ d.jsx(
7751
+ /* @__PURE__ */ d.jsx(C, { flexGrow: 1, children: /* @__PURE__ */ d.jsx(
7752
7752
  pc,
7753
7753
  {
7754
7754
  items: ae,
@@ -7758,7 +7758,7 @@ function ut({ config: e, onClose: t }) {
7758
7758
  renderItem: g
7759
7759
  }
7760
7760
  ) }),
7761
- (C || j) && /* @__PURE__ */ d.jsx(S, { marginTop: 1, width: "100%", children: /* @__PURE__ */ d.jsx(
7761
+ (S || j) && /* @__PURE__ */ d.jsx(C, { marginTop: 1, width: "100%", children: /* @__PURE__ */ d.jsx(
7762
7762
  gc,
7763
7763
  {
7764
7764
  searchTerm: E,
@@ -7771,7 +7771,7 @@ function ut({ config: e, onClose: t }) {
7771
7771
  totalCount: ie.length
7772
7772
  }
7773
7773
  ) }),
7774
- /* @__PURE__ */ d.jsx(S, { gap: 2, paddingY: 1, children: /* @__PURE__ */ d.jsxs(p, { color: "gray", children: [
7774
+ /* @__PURE__ */ d.jsx(C, { gap: 2, paddingY: 1, children: /* @__PURE__ */ d.jsxs(p, { color: "gray", children: [
7775
7775
  /* @__PURE__ */ d.jsx(p, { color: "cyan", bold: !0, children: "↑↓" }),
7776
7776
  ":导航",
7777
7777
  /* @__PURE__ */ d.jsx(p, { color: "cyan", bold: !0, children: "Enter" }),
@@ -7830,8 +7830,8 @@ const vc = (e, t, r) => {
7830
7830
  const l = e.split(`
7831
7831
  `), c = o || (l.length > 0 ? Math.max(...l.map((m) => m.length)) + 10 : 80), u = l.map((m) => m.slice(0, c - 10)), h = Math.max(0, u.length - t), f = u.slice(-t).join(`
7832
7832
  `);
7833
- return /* @__PURE__ */ d.jsx(S, { flexDirection: "column", width: c, children: /* @__PURE__ */ d.jsxs(
7834
- S,
7833
+ return /* @__PURE__ */ d.jsx(C, { flexDirection: "column", width: c, children: /* @__PURE__ */ d.jsxs(
7834
+ C,
7835
7835
  {
7836
7836
  borderStyle: s,
7837
7837
  borderColor: r,
@@ -7852,8 +7852,8 @@ const vc = (e, t, r) => {
7852
7852
  ) });
7853
7853
  }, un = ({ message: e, messageNumber: t }) => {
7854
7854
  const { extraParams: r } = be(), s = r.model_id || "AI", a = wo(e), n = Tr(e);
7855
- return n ? /* @__PURE__ */ d.jsxs(S, { flexDirection: "column", children: [
7856
- /* @__PURE__ */ d.jsx(S, { paddingBottom: 0, marginBottom: 1, children: /* @__PURE__ */ d.jsxs(p, { color: Ce("teal"), children: [
7855
+ return n ? /* @__PURE__ */ d.jsxs(C, { flexDirection: "column", children: [
7856
+ /* @__PURE__ */ d.jsx(C, { paddingBottom: 0, marginBottom: 1, children: /* @__PURE__ */ d.jsxs(p, { color: Ce("teal"), children: [
7857
7857
  t,
7858
7858
  " ",
7859
7859
  s
@@ -7864,8 +7864,8 @@ const vc = (e, t, r) => {
7864
7864
  }, xc = ({ thinking: e, visible: t }) => {
7865
7865
  const r = e.split(`
7866
7866
  `);
7867
- return /* @__PURE__ */ d.jsxs(S, { flexDirection: "column", marginBottom: 1, children: [
7868
- /* @__PURE__ */ d.jsx(S, { paddingBottom: 0, children: /* @__PURE__ */ d.jsxs(p, { color: "gray", bold: !0, children: [
7867
+ return /* @__PURE__ */ d.jsxs(C, { flexDirection: "column", marginBottom: 1, children: [
7868
+ /* @__PURE__ */ d.jsx(C, { paddingBottom: 0, children: /* @__PURE__ */ d.jsxs(p, { color: "gray", bold: !0, children: [
7869
7869
  "Think ",
7870
7870
  r.length,
7871
7871
  " rows"
@@ -7885,7 +7885,7 @@ class Tc extends v.Component {
7885
7885
  console.error("ErrorBoundary caught an error:", t, r);
7886
7886
  }
7887
7887
  render() {
7888
- return this.state.hasError ? /* @__PURE__ */ d.jsxs(S, { flexDirection: "column", children: [
7888
+ return this.state.hasError ? /* @__PURE__ */ d.jsxs(C, { flexDirection: "column", children: [
7889
7889
  /* @__PURE__ */ d.jsx(p, { color: "red", children: "✗ Render error" }),
7890
7890
  /* @__PURE__ */ d.jsx(p, { color: "gray", dimColor: !0, children: this.state.error?.message || "Unknown error" })
7891
7891
  ] }) : this.props.children;
@@ -8001,8 +8001,8 @@ const gs = ["yellow", "magenta", "blue"], Sc = (e) => {
8001
8001
  }, Ec = ({ message: e, messageNumber: t }) => {
8002
8002
  const { getToolUIRender: r, client: s } = ce(), a = new vr(e, s), n = a.getInputRepaired(), i = n?.title ? `: ${n.title}` : n?.description ? `: ${n.description}` : "", o = e.name ? r(e.name) : null;
8003
8003
  let l = Sc(e.name || "");
8004
- return l = e.status === "error" ? "red" : "yellow", /* @__PURE__ */ d.jsx(Tc, { children: /* @__PURE__ */ d.jsxs(S, { flexDirection: "column", children: [
8005
- /* @__PURE__ */ d.jsxs(S, { children: [
8004
+ return l = e.status === "error" ? "red" : "yellow", /* @__PURE__ */ d.jsx(Tc, { children: /* @__PURE__ */ d.jsxs(C, { flexDirection: "column", children: [
8005
+ /* @__PURE__ */ d.jsxs(C, { children: [
8006
8006
  /* @__PURE__ */ d.jsxs(p, { color: l, children: [
8007
8007
  t,
8008
8008
  " ",
@@ -8014,7 +8014,7 @@ const gs = ["yellow", "magenta", "blue"], Sc = (e) => {
8014
8014
  Cc(e?.status)
8015
8015
  ] })
8016
8016
  ] }),
8017
- e.sub_messages?.length ? /* @__PURE__ */ d.jsxs(S, { children: [
8017
+ e.sub_messages?.length ? /* @__PURE__ */ d.jsxs(C, { children: [
8018
8018
  /* @__PURE__ */ d.jsx(p, { color: "gray", children: "└─ " }),
8019
8019
  /* @__PURE__ */ d.jsxs(p, { color: l, dimColor: !0, children: [
8020
8020
  "(hidden ",
@@ -8022,15 +8022,15 @@ const gs = ["yellow", "magenta", "blue"], Sc = (e) => {
8022
8022
  " subagent messages)"
8023
8023
  ] })
8024
8024
  ] }) : null,
8025
- o ? /* @__PURE__ */ d.jsxs(S, { children: [
8025
+ o ? /* @__PURE__ */ d.jsxs(C, { children: [
8026
8026
  /* @__PURE__ */ d.jsx(p, { color: "gray", children: "└─ " }),
8027
- /* @__PURE__ */ d.jsx(S, { flexDirection: "column", children: o(e) })
8028
- ] }) : /* @__PURE__ */ d.jsxs(S, { flexDirection: "column", paddingTop: 0, children: [
8029
- /* @__PURE__ */ d.jsxs(S, { children: [
8027
+ /* @__PURE__ */ d.jsx(C, { flexDirection: "column", children: o(e) })
8028
+ ] }) : /* @__PURE__ */ d.jsxs(C, { flexDirection: "column", paddingTop: 0, children: [
8029
+ /* @__PURE__ */ d.jsxs(C, { children: [
8030
8030
  /* @__PURE__ */ d.jsx(p, { color: "gray", children: "└─ " }),
8031
8031
  /* @__PURE__ */ d.jsx(Ic, { content: a.getInputRepaired() })
8032
8032
  ] }),
8033
- /* @__PURE__ */ d.jsxs(S, { paddingTop: 0, paddingBottom: 0, children: [
8033
+ /* @__PURE__ */ d.jsxs(C, { paddingTop: 0, paddingBottom: 0, children: [
8034
8034
  /* @__PURE__ */ d.jsx(p, { color: "gray", children: "└─ " }),
8035
8035
  /* @__PURE__ */ d.jsx(p, { dimColor: !0, italic: !0, children: jc(Ks(e.content)) })
8036
8036
  ] })
@@ -8046,7 +8046,7 @@ const gs = ["yellow", "magenta", "blue"], Sc = (e) => {
8046
8046
  return () => clearTimeout(c);
8047
8047
  }, []);
8048
8048
  const n = (c, u, h) => /* @__PURE__ */ d.jsx(
8049
- S,
8049
+ C,
8050
8050
  {
8051
8051
  flexDirection: "column",
8052
8052
  borderStyle: h ? "double" : "single",
@@ -8064,7 +8064,7 @@ const gs = ["yellow", "magenta", "blue"], Sc = (e) => {
8064
8064
  let i = e.findIndex((c) => c.type === "tool" && !c.done && !["success", "error"].includes(c.status));
8065
8065
  i === -1 && (i = e.length - 1);
8066
8066
  const o = e.slice(0, i), l = e.slice(i);
8067
- return s ? /* @__PURE__ */ d.jsxs(S, { flexDirection: "column", children: [
8067
+ return s ? /* @__PURE__ */ d.jsxs(C, { flexDirection: "column", children: [
8068
8068
  /* @__PURE__ */ d.jsx(
8069
8069
  Os,
8070
8070
  {
@@ -8074,7 +8074,7 @@ const gs = ["yellow", "magenta", "blue"], Sc = (e) => {
8074
8074
  r
8075
8075
  ),
8076
8076
  l.map((c, u) => n(c, o.length + u, !0))
8077
- ] }) : /* @__PURE__ */ d.jsx(S, { flexDirection: "column", children: e.map((c, u) => n(c, u, u === i)) });
8077
+ ] }) : /* @__PURE__ */ d.jsx(C, { flexDirection: "column", children: e.map((c, u) => n(c, u, u === i)) });
8078
8078
  }, Pc = ({ toolMessages: e, messageNumber: t }) => {
8079
8079
  const r = e.reduce((o, l) => {
8080
8080
  const c = l.status || "unknown";
@@ -8083,8 +8083,8 @@ const gs = ["yellow", "magenta", "blue"], Sc = (e) => {
8083
8083
  const c = l.name || "unknown";
8084
8084
  return o[c] = (o[c] || 0) + 1, o;
8085
8085
  }, {}), i = Object.entries(n).sort((o, l) => l[1] - o[1]);
8086
- return /* @__PURE__ */ d.jsxs(S, { flexDirection: "column", paddingY: 1, children: [
8087
- /* @__PURE__ */ d.jsxs(S, { gap: 1, children: [
8086
+ return /* @__PURE__ */ d.jsxs(C, { flexDirection: "column", paddingY: 1, children: [
8087
+ /* @__PURE__ */ d.jsxs(C, { gap: 1, children: [
8088
8088
  /* @__PURE__ */ d.jsx(p, { color: Ce("indigo"), bold: !0, children: "⚙️" }),
8089
8089
  s > 0 && /* @__PURE__ */ d.jsxs(p, { color: "green", bold: !0, children: [
8090
8090
  " ",
@@ -8099,7 +8099,7 @@ const gs = ["yellow", "magenta", "blue"], Sc = (e) => {
8099
8099
  "tools"
8100
8100
  ] })
8101
8101
  ] }),
8102
- /* @__PURE__ */ d.jsx(S, { paddingLeft: 2, children: i.map(([o, l], c) => /* @__PURE__ */ d.jsxs(se.Fragment, { children: [
8102
+ /* @__PURE__ */ d.jsx(C, { paddingLeft: 2, children: i.map(([o, l], c) => /* @__PURE__ */ d.jsxs(se.Fragment, { children: [
8103
8103
  c > 0 && /* @__PURE__ */ d.jsx(p, { dimColor: !0, children: ", " }),
8104
8104
  /* @__PURE__ */ d.jsxs(p, { dimColor: !0, children: [
8105
8105
  o,
@@ -8145,7 +8145,7 @@ const gs = ["yellow", "magenta", "blue"], Sc = (e) => {
8145
8145
  }, []), [e]), c = (m, g, _) => {
8146
8146
  const y = m.id || `message-${g}`;
8147
8147
  return /* @__PURE__ */ d.jsxs(
8148
- S,
8148
+ C,
8149
8149
  {
8150
8150
  flexDirection: "column",
8151
8151
  borderStyle: _ ? "double" : "single",
@@ -8177,7 +8177,7 @@ const gs = ["yellow", "magenta", "blue"], Sc = (e) => {
8177
8177
  let u = l.length - 1;
8178
8178
  u === -1 && (u = l.length - 1);
8179
8179
  const h = l.slice(0, u), f = l.slice(u);
8180
- return a ? /* @__PURE__ */ d.jsxs(S, { flexDirection: "column", children: [
8180
+ return a ? /* @__PURE__ */ d.jsxs(C, { flexDirection: "column", children: [
8181
8181
  /* @__PURE__ */ d.jsx(
8182
8182
  Os,
8183
8183
  {
@@ -8187,7 +8187,7 @@ const gs = ["yellow", "magenta", "blue"], Sc = (e) => {
8187
8187
  r
8188
8188
  ),
8189
8189
  f.map((m, g) => c(m, h.length + g, !0))
8190
- ] }) : /* @__PURE__ */ d.jsx(S, { flexDirection: "column", children: l.map((m, g) => c(m, g, g === u)) });
8190
+ ] }) : /* @__PURE__ */ d.jsx(C, { flexDirection: "column", children: l.map((m, g) => c(m, g, g === u)) });
8191
8191
  };
8192
8192
  function Oc() {
8193
8193
  const { historyList: e, refreshHistoryList: t, historyFilter: r } = ce(), s = r ? JSON.stringify({
@@ -8229,18 +8229,18 @@ const ze = {
8229
8229
  return { emoji: "⚪", color: "gray", text: b };
8230
8230
  }
8231
8231
  }, h = v.useCallback(async () => o, [o]), f = v.useCallback(
8232
- (b, C, j) => {
8232
+ (b, S, j) => {
8233
8233
  const x = u(b.status);
8234
8234
  b.thread_id;
8235
8235
  const I = c(new Date(b.updated_at));
8236
- return /* @__PURE__ */ d.jsxs(S, { children: [
8236
+ return /* @__PURE__ */ d.jsxs(C, { children: [
8237
8237
  /* @__PURE__ */ d.jsxs(p, { bold: !0, color: j ? "cyan" : x.color, children: [
8238
- C + 1,
8238
+ S + 1,
8239
8239
  ". ",
8240
8240
  b.thread_id.substring(0, 8),
8241
8241
  "..."
8242
8242
  ] }),
8243
- /* @__PURE__ */ d.jsx(S, { flexGrow: 1 }),
8243
+ /* @__PURE__ */ d.jsx(C, { flexGrow: 1 }),
8244
8244
  /* @__PURE__ */ d.jsx(p, { dimColor: !0, children: I })
8245
8245
  ] }, b.thread_id);
8246
8246
  },
@@ -8255,10 +8255,10 @@ const ze = {
8255
8255
  [s, r, e]
8256
8256
  ), _ = v.useCallback(
8257
8257
  (b) => {
8258
- const C = b.find((j) => j.thread_id === t);
8259
- return C ? /* @__PURE__ */ d.jsxs(p, { color: "gray", dimColor: !0, children: [
8258
+ const S = b.find((j) => j.thread_id === t);
8259
+ return S ? /* @__PURE__ */ d.jsxs(p, { color: "gray", dimColor: !0, children: [
8260
8260
  "当前: ",
8261
- /* @__PURE__ */ d.jsx(p, { color: "green", children: C.thread_id.substring(0, 8) }),
8261
+ /* @__PURE__ */ d.jsx(p, { color: "green", children: S.thread_id.substring(0, 8) }),
8262
8262
  /* @__PURE__ */ d.jsx(p, { children: i.metadata?.path })
8263
8263
  ] }) : null;
8264
8264
  },
@@ -9210,7 +9210,7 @@ const ml = (e) => {
9210
9210
  switchToAgent: n,
9211
9211
  closePanel: i,
9212
9212
  switchToTask: o
9213
- } = e, { userInput: l, setUserInput: c, sendMessage: u, currentAgent: h, client: f, createNewChat: m, renderMessages: g } = ce(), { extraParams: _, updateConfig: y, AVAILABLE_MODELS: w } = be(), [b, C] = v.useState(null), [j, x] = v.useState(null), I = l.startsWith("/"), E = I ? ot.getSuggestions(l) : [], P = I, O = v.useCallback(
9213
+ } = e, { userInput: l, setUserInput: c, sendMessage: u, currentAgent: h, client: f, createNewChat: m, renderMessages: g } = ce(), { extraParams: _, updateConfig: y, AVAILABLE_MODELS: w } = be(), [b, S] = v.useState(null), [j, x] = v.useState(null), I = l.startsWith("/"), E = I ? ot.getSuggestions(l) : [], P = I, O = v.useCallback(
9214
9214
  async (H) => {
9215
9215
  const G = H || l;
9216
9216
  if (!ot.isCommand(G))
@@ -9242,7 +9242,7 @@ const ml = (e) => {
9242
9242
  closePanel: i,
9243
9243
  startRalphLoop: e.startRalphLoop
9244
9244
  }, ie = await ot.executeCommand(G, ae);
9245
- if (ie.success ? ie.message && (x(ie.message), setTimeout(() => x(null), 5e3)) : (C(ie.message || "命令执行失败"), setTimeout(() => C(null), 3e3)), ie.shouldClearInput && c(""), ie.shouldSendMessage && ie.messageContent) {
9245
+ if (ie.success ? ie.message && (x(ie.message), setTimeout(() => x(null), 5e3)) : (S(ie.message || "命令执行失败"), setTimeout(() => S(null), 3e3)), ie.shouldClearInput && c(""), ie.shouldSendMessage && ie.messageContent) {
9246
9246
  const X = [
9247
9247
  {
9248
9248
  type: "human",
@@ -9253,7 +9253,7 @@ const ml = (e) => {
9253
9253
  }
9254
9254
  return t?.(), !0;
9255
9255
  } catch (ae) {
9256
- return C(`命令执行错误: ${ae instanceof Error ? ae.message : String(ae)}`), setTimeout(() => C(null), 3e3), !0;
9256
+ return S(`命令执行错误: ${ae instanceof Error ? ae.message : String(ae)}`), setTimeout(() => S(null), 3e3), !0;
9257
9257
  }
9258
9258
  },
9259
9259
  [
@@ -9281,7 +9281,7 @@ const ml = (e) => {
9281
9281
  showCommandHint: P,
9282
9282
  commandError: b,
9283
9283
  executeCommand: O,
9284
- CommandHintUI: () => !P || E.length === 0 ? null : /* @__PURE__ */ d.jsxs(S, { marginBottom: 1, flexDirection: "column", children: [
9284
+ CommandHintUI: () => !P || E.length === 0 ? null : /* @__PURE__ */ d.jsxs(C, { marginBottom: 1, flexDirection: "column", children: [
9285
9285
  /* @__PURE__ */ d.jsx(p, { color: "yellow", bold: !0, children: "命令建议:" }),
9286
9286
  E.slice(0, 5).map((H, G) => /* @__PURE__ */ d.jsxs(p, { color: "cyan", children: [
9287
9287
  H.displayText,
@@ -9294,11 +9294,11 @@ const ml = (e) => {
9294
9294
  " 个命令"
9295
9295
  ] })
9296
9296
  ] }),
9297
- CommandErrorUI: () => b ? /* @__PURE__ */ d.jsx(S, { marginBottom: 1, children: /* @__PURE__ */ d.jsxs(p, { color: "red", children: [
9297
+ CommandErrorUI: () => b ? /* @__PURE__ */ d.jsx(C, { marginBottom: 1, children: /* @__PURE__ */ d.jsxs(p, { color: "red", children: [
9298
9298
  "❌ ",
9299
9299
  b
9300
9300
  ] }) }) : null,
9301
- CommandSuccessUI: () => j ? /* @__PURE__ */ d.jsx(S, { marginBottom: 1, children: /* @__PURE__ */ d.jsxs(p, { color: "green", children: [
9301
+ CommandSuccessUI: () => j ? /* @__PURE__ */ d.jsx(C, { marginBottom: 1, children: /* @__PURE__ */ d.jsxs(p, { color: "green", children: [
9302
9302
  "✅ ",
9303
9303
  j
9304
9304
  ] }) }) : null
@@ -9339,9 +9339,9 @@ async function bt(e) {
9339
9339
  langchain: s
9340
9340
  };
9341
9341
  let b = null;
9342
- const C = [y.join("/")];
9343
- y[0] === "langchain_community" && C.push(["langchain", ...y.slice(1)].join("/"));
9344
- const j = C.find((P) => P in t);
9342
+ const S = [y.join("/")];
9343
+ y[0] === "langchain_community" && S.push(["langchain", ...y.slice(1)].join("/"));
9344
+ const j = S.find((P) => P in t);
9345
9345
  if (gl.concat(r).includes(y.join("/")) || j) if (j !== void 0) b = await t[j];
9346
9346
  else throw new Error(`Missing key "${y.join("/")}" for ${c} in load(optionalImportsMap={})`);
9347
9347
  else {
@@ -9720,7 +9720,7 @@ var Ul = class extends Rl {
9720
9720
  if (s <= 0) break;
9721
9721
  s -= 1;
9722
9722
  }
9723
- const w = et(l, c, f), b = Object.values(this.writes[w] || {}), C = await Promise.all(b.map(async ([I, E, P]) => [
9723
+ const w = et(l, c, f), b = Object.values(this.writes[w] || {}), S = await Promise.all(b.map(async ([I, E, P]) => [
9724
9724
  I,
9725
9725
  E,
9726
9726
  await this.serde.loadsTyped("json", P)
@@ -9734,7 +9734,7 @@ var Ul = class extends Rl {
9734
9734
  } },
9735
9735
  checkpoint: j,
9736
9736
  metadata: y,
9737
- pendingWrites: C
9737
+ pendingWrites: S
9738
9738
  };
9739
9739
  _ !== void 0 && (x.parentConfig = { configurable: {
9740
9740
  thread_id: l,
@@ -10728,7 +10728,7 @@ const ru = async () => {
10728
10728
  if (process.env.REDIS_URL && process.env.CHECKPOINT_TYPE === "redis" || process.env.CHECKPOINT_TYPE === "shallow/redis") {
10729
10729
  if (process.env.CHECKPOINT_TYPE === "redis") {
10730
10730
  console.debug("LG | Using redis as checkpoint");
10731
- const { RedisSaver: e } = await import("./index-e2Fy3126.mjs");
10731
+ const { RedisSaver: e } = await import("./index-rmYfVmPA.mjs");
10732
10732
  return await e.fromUrl(process.env.REDIS_URL, {
10733
10733
  defaultTTL: 60,
10734
10734
  // TTL in minutes
@@ -10737,18 +10737,18 @@ const ru = async () => {
10737
10737
  }
10738
10738
  if (process.env.CHECKPOINT_TYPE === "shallow/redis") {
10739
10739
  console.debug("LG | Using shallow redis as checkpoint");
10740
- const { ShallowRedisSaver: e } = await import("./shallow-BKCaK1wH.mjs");
10740
+ const { ShallowRedisSaver: e } = await import("./shallow-DbDurfwF.mjs");
10741
10741
  return await e.fromUrl(process.env.REDIS_URL);
10742
10742
  }
10743
10743
  }
10744
10744
  if (process.env.DATABASE_URL && mn(process.env.DATABASE_URL) === "postgres") {
10745
10745
  console.debug("LG | Using postgres as checkpoint");
10746
- const { createPGCheckpoint: e } = await import("./checkpoint-DxiUsHMy-DGyqjfqu.mjs");
10746
+ const { createPGCheckpoint: e } = await import("./checkpoint-DxiUsHMy-BEADkhMT.mjs");
10747
10747
  return e();
10748
10748
  }
10749
10749
  if (process.env.SQLITE_DATABASE_URI) {
10750
10750
  console.debug("LG | Using sqlite as checkpoint");
10751
- const { SqliteSaver: e } = await import("./checkpoint-1sAx_j1E-CmiXKr4s.mjs");
10751
+ const { SqliteSaver: e } = await import("./checkpoint-1sAx_j1E-aBdfQABv.mjs");
10752
10752
  return await e.fromConnStringAsync(process.env.SQLITE_DATABASE_URI);
10753
10753
  }
10754
10754
  return console.log("LG | You are using memory as checkpoint!"), console.log(
@@ -10762,7 +10762,7 @@ const ru = async () => {
10762
10762
  let e;
10763
10763
  if (process.env.REDIS_URL) {
10764
10764
  console.debug("LG | Using redis as stream queue");
10765
- const { RedisStreamQueue: t } = await import("./queue-Bfg-8ehP-C5S3FsuT.mjs");
10765
+ const { RedisStreamQueue: t } = await import("./queue-Bfg-8ehP-tvdhXq7L.mjs");
10766
10766
  e = t;
10767
10767
  } else
10768
10768
  e = Pr;
@@ -12521,49 +12521,49 @@ const bd = (e, t = {}) => _d(new Request(e, t), {}), vd = () => {
12521
12521
  w((E) => (E + 1) % 92);
12522
12522
  }, 40);
12523
12523
  return () => clearInterval(I);
12524
- }, []), /* @__PURE__ */ d.jsxs(S, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 1, marginBottom: 1, children: [
12525
- /* @__PURE__ */ d.jsxs(S, { flexDirection: "row", justifyContent: "space-between", borderBottom: !1, children: [
12524
+ }, []), /* @__PURE__ */ d.jsxs(C, { flexDirection: "column", borderStyle: "round", borderColor: "cyan", paddingX: 1, marginBottom: 1, children: [
12525
+ /* @__PURE__ */ d.jsxs(C, { flexDirection: "row", justifyContent: "space-between", borderBottom: !1, children: [
12526
12526
  /* @__PURE__ */ d.jsx(p, { color: "cyan", bold: !0, children: "ZEN CODE" }),
12527
12527
  /* @__PURE__ */ d.jsx(p, { color: "gray", children: t })
12528
12528
  ] }),
12529
- /* @__PURE__ */ d.jsxs(S, { flexDirection: "row", marginTop: 1, gap: 2, children: [
12530
- /* @__PURE__ */ d.jsx(S, { flexDirection: "column", children: `███████╗███████╗███╗ ██╗
12529
+ /* @__PURE__ */ d.jsxs(C, { flexDirection: "row", marginTop: 1, gap: 2, children: [
12530
+ /* @__PURE__ */ d.jsx(C, { flexDirection: "column", children: `███████╗███████╗███╗ ██╗
12531
12531
  ╚══███╔╝██╔════╝████╗ ██║
12532
12532
  ███╔╝ █████╗ ██╔██╗ ██║
12533
12533
  ███╔╝ ██╔══╝ ██║╚██╗██║
12534
12534
  ███████╗███████╗██║ ╚████║
12535
12535
  ╚══════╝╚══════╝╚═╝ ╚═══╝`.split(`
12536
12536
  `).map((b) => /* @__PURE__ */ d.jsx(ln, { interval: 40, text: b, globalIndex: y }, b)) }),
12537
- /* @__PURE__ */ d.jsxs(S, { flexDirection: "column", justifyContent: "center", flexGrow: 1, children: [
12538
- /* @__PURE__ */ d.jsx(S, { marginBottom: 1, children: _ ? /* @__PURE__ */ d.jsxs(p, { color: "green", bold: !0, children: [
12537
+ /* @__PURE__ */ d.jsxs(C, { flexDirection: "column", justifyContent: "center", flexGrow: 1, children: [
12538
+ /* @__PURE__ */ d.jsx(C, { marginBottom: 1, children: _ ? /* @__PURE__ */ d.jsxs(p, { color: "green", bold: !0, children: [
12539
12539
  " ",
12540
12540
  "[ SYSTEM ONLINE ]"
12541
12541
  ] }) : /* @__PURE__ */ d.jsxs(p, { color: "red", bold: !0, children: [
12542
12542
  " ",
12543
12543
  "[ CONFIG REQUIRED ]"
12544
12544
  ] }) }),
12545
- /* @__PURE__ */ d.jsxs(S, { flexDirection: "column", gap: 0, children: [
12546
- /* @__PURE__ */ d.jsxs(S, { children: [
12545
+ /* @__PURE__ */ d.jsxs(C, { flexDirection: "column", gap: 0, children: [
12546
+ /* @__PURE__ */ d.jsxs(C, { children: [
12547
12547
  /* @__PURE__ */ d.jsx(p, { color: "blue", children: "USER::" }),
12548
12548
  /* @__PURE__ */ d.jsx(p, { color: "white", children: e })
12549
12549
  ] }),
12550
- /* @__PURE__ */ d.jsxs(S, { children: [
12550
+ /* @__PURE__ */ d.jsxs(C, { children: [
12551
12551
  /* @__PURE__ */ d.jsx(p, { color: "blue", children: "ARCH::" }),
12552
12552
  /* @__PURE__ */ d.jsx(p, { color: "white", children: process.arch })
12553
12553
  ] }),
12554
- /* @__PURE__ */ d.jsxs(S, { children: [
12554
+ /* @__PURE__ */ d.jsxs(C, { children: [
12555
12555
  /* @__PURE__ */ d.jsx(p, { color: "blue", children: "PLATFORM::" }),
12556
12556
  /* @__PURE__ */ d.jsx(p, { color: "white", children: c })
12557
12557
  ] }),
12558
- /* @__PURE__ */ d.jsxs(S, { children: [
12558
+ /* @__PURE__ */ d.jsxs(C, { children: [
12559
12559
  /* @__PURE__ */ d.jsx(p, { color: "blue", children: "NODE::" }),
12560
12560
  /* @__PURE__ */ d.jsx(p, { color: "white", children: process.version })
12561
12561
  ] }),
12562
- /* @__PURE__ */ d.jsxs(S, { children: [
12562
+ /* @__PURE__ */ d.jsxs(C, { children: [
12563
12563
  /* @__PURE__ */ d.jsx(p, { color: "blue", children: "TERM::" }),
12564
12564
  /* @__PURE__ */ d.jsx(p, { color: "white", children: o })
12565
12565
  ] }),
12566
- /* @__PURE__ */ d.jsxs(S, { children: [
12566
+ /* @__PURE__ */ d.jsxs(C, { children: [
12567
12567
  /* @__PURE__ */ d.jsxs(p, { color: "blue", children: [
12568
12568
  h?.toUpperCase(),
12569
12569
  "::"
@@ -12573,11 +12573,11 @@ const bd = (e, t = {}) => _d(new Request(e, t), {}), vd = () => {
12573
12573
  ] })
12574
12574
  ] })
12575
12575
  ] }),
12576
- /* @__PURE__ */ d.jsxs(S, { marginTop: 1, paddingX: 1, flexDirection: "column", gap: 0, children: [
12577
- /* @__PURE__ */ d.jsx(S, { children: /* @__PURE__ */ d.jsx(p, { color: "blue", children: "WORKING_DIR ::" }) }),
12578
- /* @__PURE__ */ d.jsx(S, { children: /* @__PURE__ */ d.jsx(p, { color: "gray", children: u }) })
12576
+ /* @__PURE__ */ d.jsxs(C, { marginTop: 1, paddingX: 1, flexDirection: "column", gap: 0, children: [
12577
+ /* @__PURE__ */ d.jsx(C, { children: /* @__PURE__ */ d.jsx(p, { color: "blue", children: "WORKING_DIR ::" }) }),
12578
+ /* @__PURE__ */ d.jsx(C, { children: /* @__PURE__ */ d.jsx(p, { color: "gray", children: u }) })
12579
12579
  ] }),
12580
- !_ && /* @__PURE__ */ d.jsxs(S, { marginTop: 1, paddingX: 1, flexDirection: "column", gap: 0, children: [
12580
+ !_ && /* @__PURE__ */ d.jsxs(C, { marginTop: 1, paddingX: 1, flexDirection: "column", gap: 0, children: [
12581
12581
  /* @__PURE__ */ d.jsxs(p, { color: "red", bold: !0, children: [
12582
12582
  "⚠️ 需要配置 ",
12583
12583
  h === "anthropic" ? "Anthropic" : "OpenAI",
@@ -12587,16 +12587,16 @@ const bd = (e, t = {}) => _d(new Request(e, t), {}), vd = () => {
12587
12587
  !g && /* @__PURE__ */ d.jsx(p, { color: "yellow", children: " • 请确保网络连接正常以获取模型列表" }),
12588
12588
  /* @__PURE__ */ d.jsx(p, { color: "gray", children: " • 配置后使用 /m 查看可用模型" })
12589
12589
  ] }),
12590
- /* @__PURE__ */ d.jsxs(S, { marginTop: 1, paddingTop: 1, borderTop: !1, flexDirection: "row", justifyContent: "space-between", children: [
12591
- /* @__PURE__ */ d.jsxs(S, { gap: 3, children: [
12592
- /* @__PURE__ */ d.jsxs(S, { children: [
12590
+ /* @__PURE__ */ d.jsxs(C, { marginTop: 1, paddingTop: 1, borderTop: !1, flexDirection: "row", justifyContent: "space-between", children: [
12591
+ /* @__PURE__ */ d.jsxs(C, { gap: 3, children: [
12592
+ /* @__PURE__ */ d.jsxs(C, { children: [
12593
12593
  /* @__PURE__ */ d.jsx(p, { color: "green", children: "●" }),
12594
12594
  /* @__PURE__ */ d.jsxs(p, { color: "white", dimColor: !0, children: [
12595
12595
  " ",
12596
12596
  "AGENTS"
12597
12597
  ] })
12598
12598
  ] }),
12599
- /* @__PURE__ */ d.jsxs(S, { children: [
12599
+ /* @__PURE__ */ d.jsxs(C, { children: [
12600
12600
  /* @__PURE__ */ d.jsx(p, { color: i > 0 ? "green" : "gray", children: "●" }),
12601
12601
  /* @__PURE__ */ d.jsxs(p, { color: "white", dimColor: !0, children: [
12602
12602
  " ",
@@ -12606,7 +12606,7 @@ const bd = (e, t = {}) => _d(new Request(e, t), {}), vd = () => {
12606
12606
  ] })
12607
12607
  ] })
12608
12608
  ] }),
12609
- /* @__PURE__ */ d.jsxs(S, { children: [
12609
+ /* @__PURE__ */ d.jsxs(C, { children: [
12610
12610
  _ ? /* @__PURE__ */ d.jsx(p, { color: "yellow", bold: !0, children: ">>> WAITING_FOR_INPUT" }) : /* @__PURE__ */ d.jsx(p, { color: "red", bold: !0, children: ">>> CONFIGURATION_NEEDED" }),
12611
12611
  /* @__PURE__ */ d.jsxs(p, { color: "yellow", dimColor: !0, children: [
12612
12612
  " ",
@@ -12687,8 +12687,8 @@ const it = new wd(), xd = {
12687
12687
  }));
12688
12688
  return l ? (() => {
12689
12689
  const j = Td(i), x = i === "edit";
12690
- return /* @__PURE__ */ d.jsxs(S, { flexDirection: "column", paddingX: 1, marginTop: 0, children: [
12691
- /* @__PURE__ */ d.jsxs(S, { flexDirection: "column", marginBottom: 1, children: [
12690
+ return /* @__PURE__ */ d.jsxs(C, { flexDirection: "column", paddingX: 1, marginTop: 0, children: [
12691
+ /* @__PURE__ */ d.jsxs(C, { flexDirection: "column", marginBottom: 1, children: [
12692
12692
  /* @__PURE__ */ d.jsxs(p, { color: j, bold: !0, children: [
12693
12693
  i.toUpperCase(),
12694
12694
  " MODE - ",
@@ -12703,9 +12703,9 @@ const it = new wd(), xd = {
12703
12703
  m
12704
12704
  ] })
12705
12705
  ] }),
12706
- x ? /* @__PURE__ */ d.jsxs(S, { flexDirection: "column", marginTop: 0, children: [
12706
+ x ? /* @__PURE__ */ d.jsxs(C, { flexDirection: "column", marginTop: 0, children: [
12707
12707
  /* @__PURE__ */ d.jsx(p, { color: "yellow", dimColor: !0, children: "Editing action arguments (JSON format):" }),
12708
- /* @__PURE__ */ d.jsx(S, { paddingX: 1, children: /* @__PURE__ */ d.jsx(
12708
+ /* @__PURE__ */ d.jsx(C, { paddingX: 1, children: /* @__PURE__ */ d.jsx(
12709
12709
  Pe,
12710
12710
  {
12711
12711
  value: u,
@@ -12715,9 +12715,9 @@ const it = new wd(), xd = {
12715
12715
  autoFocus: !0
12716
12716
  }
12717
12717
  ) })
12718
- ] }) : /* @__PURE__ */ d.jsxs(S, { flexDirection: "column", marginTop: 0, children: [
12718
+ ] }) : /* @__PURE__ */ d.jsxs(C, { flexDirection: "column", marginTop: 0, children: [
12719
12719
  /* @__PURE__ */ d.jsx(p, { color: "cyan", dimColor: !0, children: "Enter additional message for this action:" }),
12720
- /* @__PURE__ */ d.jsx(S, { padding: 1, children: /* @__PURE__ */ d.jsx(
12720
+ /* @__PURE__ */ d.jsx(C, { padding: 1, children: /* @__PURE__ */ d.jsx(
12721
12721
  Pe,
12722
12722
  {
12723
12723
  value: u,
@@ -12728,7 +12728,7 @@ const it = new wd(), xd = {
12728
12728
  }
12729
12729
  ) })
12730
12730
  ] }),
12731
- /* @__PURE__ */ d.jsx(S, { marginTop: 0, children: /* @__PURE__ */ d.jsxs(p, { color: "gray", children: [
12731
+ /* @__PURE__ */ d.jsx(C, { marginTop: 0, children: /* @__PURE__ */ d.jsxs(p, { color: "gray", children: [
12732
12732
  /* @__PURE__ */ d.jsx(p, { color: j, bold: !0, children: "↵" }),
12733
12733
  " ",
12734
12734
  "Submit |",
@@ -12740,8 +12740,8 @@ const it = new wd(), xd = {
12740
12740
  "Cancel"
12741
12741
  ] }) })
12742
12742
  ] });
12743
- })() : /* @__PURE__ */ d.jsxs(S, { flexDirection: "column", paddingX: 1, children: [
12744
- /* @__PURE__ */ d.jsxs(S, { flexDirection: "column", marginBottom: 1, children: [
12743
+ })() : /* @__PURE__ */ d.jsxs(C, { flexDirection: "column", paddingX: 1, children: [
12744
+ /* @__PURE__ */ d.jsxs(C, { flexDirection: "column", marginBottom: 1, children: [
12745
12745
  /* @__PURE__ */ d.jsx(p, { color: "cyan", bold: !0, children: e.toolCall.name }),
12746
12746
  f !== void 0 && /* @__PURE__ */ d.jsxs(p, { color: "gray", dimColor: !0, children: [
12747
12747
  "Message Index: ",
@@ -12752,7 +12752,7 @@ const it = new wd(), xd = {
12752
12752
  m
12753
12753
  ] })
12754
12754
  ] }),
12755
- /* @__PURE__ */ d.jsx(S, { children: /* @__PURE__ */ d.jsx(
12755
+ /* @__PURE__ */ d.jsx(C, { children: /* @__PURE__ */ d.jsx(
12756
12756
  Ar,
12757
12757
  {
12758
12758
  singleSelect: !0,
@@ -12872,9 +12872,9 @@ const it = new wd(), xd = {
12872
12872
  result: { selected: n, customInput: o }
12873
12873
  });
12874
12874
  }, g = s?.title ? Et(s.title, "title") : null, _ = s?.description ? Et(s.description, "description") : null;
12875
- return /* @__PURE__ */ d.jsxs(S, { flexDirection: "column", paddingX: 1, children: [
12876
- g && /* @__PURE__ */ d.jsx(S, { marginBottom: 1, children: /* @__PURE__ */ d.jsx(p, { color: "cyan", bold: !0, children: g }) }),
12877
- _ && /* @__PURE__ */ d.jsx(S, { marginBottom: 1, children: /* @__PURE__ */ d.jsx(p, { dimColor: !0, children: _ }) }),
12875
+ return /* @__PURE__ */ d.jsxs(C, { flexDirection: "column", paddingX: 1, children: [
12876
+ g && /* @__PURE__ */ d.jsx(C, { marginBottom: 1, children: /* @__PURE__ */ d.jsx(p, { color: "cyan", bold: !0, children: g }) }),
12877
+ _ && /* @__PURE__ */ d.jsx(C, { marginBottom: 1, children: /* @__PURE__ */ d.jsx(p, { dimColor: !0, children: _ }) }),
12878
12878
  /* @__PURE__ */ d.jsx(
12879
12879
  Ar,
12880
12880
  {
@@ -12886,7 +12886,7 @@ const it = new wd(), xd = {
12886
12886
  autoFocus: !0
12887
12887
  }
12888
12888
  ),
12889
- r.allowCustomInput && /* @__PURE__ */ d.jsx(S, { marginTop: 1, flexDirection: "column", children: /* @__PURE__ */ d.jsx(
12889
+ r.allowCustomInput && /* @__PURE__ */ d.jsx(C, { marginTop: 1, flexDirection: "column", children: /* @__PURE__ */ d.jsx(
12890
12890
  Pe,
12891
12891
  {
12892
12892
  value: o,
@@ -12952,11 +12952,11 @@ function xs({ value: e, placeholder: t = "", focus: r = !0, mask: s, highlightPa
12952
12952
  o && o(e);
12953
12953
  return;
12954
12954
  }
12955
- let b = u, C = e, j = 0;
12956
- w.leftArrow ? n && b-- : w.rightArrow ? n && b++ : w.backspace || w.delete ? u > 0 && (C = e.slice(0, u - 1) + e.slice(u, e.length), b--) : (C = e.slice(0, u) + y + e.slice(u, e.length), b += y.length, y.length > 1 && (j = y.length)), u < 0 && (b = 0), u > e.length && (b = e.length), c({
12955
+ let b = u, S = e, j = 0;
12956
+ w.leftArrow ? n && b-- : w.rightArrow ? n && b++ : w.backspace || w.delete ? u > 0 && (S = e.slice(0, u - 1) + e.slice(u, e.length), b--) : (S = e.slice(0, u) + y + e.slice(u, e.length), b += y.length, y.length > 1 && (j = y.length)), u < 0 && (b = 0), u > e.length && (b = e.length), c({
12957
12957
  cursorOffset: b,
12958
12958
  cursorWidth: j
12959
- }), C !== e && i(C);
12959
+ }), S !== e && i(S);
12960
12960
  }, { isActive: r }), se.createElement(p, null, t ? m.length > 0 ? g : _ : g);
12961
12961
  }
12962
12962
  const Pd = {
@@ -12971,10 +12971,10 @@ const Pd = {
12971
12971
  result: { value: a }
12972
12972
  });
12973
12973
  };
12974
- return r.multiline && Pe, /* @__PURE__ */ d.jsxs(S, { flexDirection: "column", paddingX: 1, children: [
12975
- s?.title && /* @__PURE__ */ d.jsx(S, { marginBottom: 1, children: /* @__PURE__ */ d.jsx(p, { color: "cyan", bold: !0, children: s.title }) }),
12976
- s?.description && /* @__PURE__ */ d.jsx(S, { marginBottom: 1, children: /* @__PURE__ */ d.jsx(p, { dimColor: !0, children: s.description }) }),
12977
- /* @__PURE__ */ d.jsx(S, { children: r.multiline ? /* @__PURE__ */ d.jsx(
12974
+ return r.multiline && Pe, /* @__PURE__ */ d.jsxs(C, { flexDirection: "column", paddingX: 1, children: [
12975
+ s?.title && /* @__PURE__ */ d.jsx(C, { marginBottom: 1, children: /* @__PURE__ */ d.jsx(p, { color: "cyan", bold: !0, children: s.title }) }),
12976
+ s?.description && /* @__PURE__ */ d.jsx(C, { marginBottom: 1, children: /* @__PURE__ */ d.jsx(p, { dimColor: !0, children: s.description }) }),
12977
+ /* @__PURE__ */ d.jsx(C, { children: r.multiline ? /* @__PURE__ */ d.jsx(
12978
12978
  Pe,
12979
12979
  {
12980
12980
  value: a,
@@ -12992,7 +12992,7 @@ const Pd = {
12992
12992
  placeholder: r.placeholder
12993
12993
  }
12994
12994
  ) }),
12995
- r.maxLength && /* @__PURE__ */ d.jsx(S, { marginTop: 1, children: /* @__PURE__ */ d.jsxs(p, { dimColor: !0, children: [
12995
+ r.maxLength && /* @__PURE__ */ d.jsx(C, { marginTop: 1, children: /* @__PURE__ */ d.jsxs(p, { dimColor: !0, children: [
12996
12996
  "Max length: ",
12997
12997
  r.maxLength
12998
12998
  ] }) })
@@ -13047,9 +13047,9 @@ const Pd = {
13047
13047
  ], o = ([l]) => {
13048
13048
  l === "confirm" ? a() : n();
13049
13049
  };
13050
- return /* @__PURE__ */ d.jsxs(S, { flexDirection: "column", paddingX: 1, children: [
13051
- s?.title && /* @__PURE__ */ d.jsx(S, { marginBottom: 1, children: /* @__PURE__ */ d.jsx(p, { color: r.danger ? "red" : "cyan", bold: !0, children: s.title }) }),
13052
- /* @__PURE__ */ d.jsx(S, { marginBottom: 1, children: /* @__PURE__ */ d.jsx(p, { children: r.message }) }),
13050
+ return /* @__PURE__ */ d.jsxs(C, { flexDirection: "column", paddingX: 1, children: [
13051
+ s?.title && /* @__PURE__ */ d.jsx(C, { marginBottom: 1, children: /* @__PURE__ */ d.jsx(p, { color: r.danger ? "red" : "cyan", bold: !0, children: s.title }) }),
13052
+ /* @__PURE__ */ d.jsx(C, { marginBottom: 1, children: /* @__PURE__ */ d.jsx(p, { children: r.message }) }),
13053
13053
  /* @__PURE__ */ d.jsx(Ar, { options: i, singleSelect: !0, onSubmit: o, autoFocus: !0 })
13054
13054
  ] });
13055
13055
  },
@@ -13090,7 +13090,7 @@ const Pd = {
13090
13090
  const g = m === o, _ = i && !s;
13091
13091
  let y;
13092
13092
  if (n === "line")
13093
- y = /* @__PURE__ */ d.jsxs(S, { marginRight: 1, children: [
13093
+ y = /* @__PURE__ */ d.jsxs(C, { marginRight: 1, children: [
13094
13094
  /* @__PURE__ */ d.jsx(
13095
13095
  p,
13096
13096
  {
@@ -13102,9 +13102,9 @@ const Pd = {
13102
13102
  g && /* @__PURE__ */ d.jsx(p, { color: _ ? "green" : "cyan", children: "_" })
13103
13103
  ] }, f.id);
13104
13104
  else if (n === "enclosed") {
13105
- const w = m === 0 || g ? "┌" : "─", b = m === e.length - 1 || g ? "┐" : "─", C = m === 0 || g ? "│" : " ", j = m === e.length - 1 || g ? "│" : " ", x = g ? "─" : " ", I = g ? " " : "", E = f.disabled ? "gray" : g ? _ ? "green" : "cyan" : "gray";
13106
- y = /* @__PURE__ */ d.jsx(S, { children: /* @__PURE__ */ d.jsxs(S, { flexDirection: "column", children: [
13107
- /* @__PURE__ */ d.jsxs(S, { children: [
13105
+ const w = m === 0 || g ? "┌" : "─", b = m === e.length - 1 || g ? "┐" : "─", S = m === 0 || g ? "│" : " ", j = m === e.length - 1 || g ? "│" : " ", x = g ? "─" : " ", I = g ? " " : "", E = f.disabled ? "gray" : g ? _ ? "green" : "cyan" : "gray";
13106
+ y = /* @__PURE__ */ d.jsx(C, { children: /* @__PURE__ */ d.jsxs(C, { flexDirection: "column", children: [
13107
+ /* @__PURE__ */ d.jsxs(C, { children: [
13108
13108
  /* @__PURE__ */ d.jsx(p, { color: E, children: w }),
13109
13109
  /* @__PURE__ */ d.jsxs(p, { color: E, bold: g && _, children: [
13110
13110
  I,
@@ -13113,15 +13113,15 @@ const Pd = {
13113
13113
  ] }),
13114
13114
  /* @__PURE__ */ d.jsx(p, { color: E, children: b })
13115
13115
  ] }),
13116
- g && /* @__PURE__ */ d.jsxs(S, { children: [
13117
- /* @__PURE__ */ d.jsx(p, { color: E, children: C }),
13116
+ g && /* @__PURE__ */ d.jsxs(C, { children: [
13117
+ /* @__PURE__ */ d.jsx(p, { color: E, children: S }),
13118
13118
  /* @__PURE__ */ d.jsx(p, { color: E, children: x.repeat(f.label.length + 2) }),
13119
13119
  /* @__PURE__ */ d.jsx(p, { color: E, children: j })
13120
13120
  ] })
13121
13121
  ] }) }, f.id);
13122
13122
  } else {
13123
13123
  const w = g ? "●" : "○";
13124
- y = /* @__PURE__ */ d.jsx(S, { marginRight: 2, children: /* @__PURE__ */ d.jsxs(
13124
+ y = /* @__PURE__ */ d.jsx(C, { marginRight: 2, children: /* @__PURE__ */ d.jsxs(
13125
13125
  p,
13126
13126
  {
13127
13127
  color: f.disabled ? "gray" : g ? _ ? "green" : "cyan" : "gray",
@@ -13138,7 +13138,7 @@ const Pd = {
13138
13138
  }), h = () => {
13139
13139
  const f = e[o];
13140
13140
  return f?.content ? /* @__PURE__ */ d.jsx(
13141
- S,
13141
+ C,
13142
13142
  {
13143
13143
  marginTop: 1,
13144
13144
  paddingX: 2,
@@ -13148,8 +13148,8 @@ const Pd = {
13148
13148
  }
13149
13149
  ) : null;
13150
13150
  };
13151
- return /* @__PURE__ */ d.jsxs(S, { flexDirection: "column", flexGrow: 1, children: [
13152
- /* @__PURE__ */ d.jsx(S, { children: u() }),
13151
+ return /* @__PURE__ */ d.jsxs(C, { flexDirection: "column", flexGrow: 1, children: [
13152
+ /* @__PURE__ */ d.jsx(C, { children: u() }),
13153
13153
  e.some((f) => f.content) && h()
13154
13154
  ] });
13155
13155
  }, kd = ({
@@ -13176,7 +13176,7 @@ const Pd = {
13176
13176
  ...e.config.style
13177
13177
  }
13178
13178
  }), [e.config, t.defaultConfig]), a = s.style.backgroundColor;
13179
- return /* @__PURE__ */ d.jsx(S, { backgroundColor: a, paddingX: s.layout.padding, marginBottom: 1, flexDirection: "column", children: t.render({ ...e, config: s }, r) });
13179
+ return /* @__PURE__ */ d.jsx(C, { backgroundColor: a, paddingX: s.layout.padding, marginBottom: 1, flexDirection: "column", children: t.render({ ...e, config: s }, r) });
13180
13180
  }, Rd = (e) => Et(e, "fullTitle"), Dd = () => {
13181
13181
  const e = Ot(), [t, r] = v.useState(null), { focusNext: s } = ks(), a = v.useMemo(() => e.getInteractions(), [e.getInteractions()]);
13182
13182
  v.useEffect(() => {
@@ -13228,18 +13228,18 @@ const Pd = {
13228
13228
  }
13229
13229
  },
13230
13230
  c.id
13231
- ) : /* @__PURE__ */ d.jsx(S, { paddingX: 1, children: /* @__PURE__ */ d.jsxs(p, { color: "red", children: [
13231
+ ) : /* @__PURE__ */ d.jsx(C, { paddingX: 1, children: /* @__PURE__ */ d.jsxs(p, { color: "red", children: [
13232
13232
  "Unknown renderer: ",
13233
13233
  c.content.type
13234
13234
  ] }) });
13235
13235
  };
13236
- return a.length === 0 ? null : /* @__PURE__ */ d.jsxs(S, { flexDirection: "column", borderColor: "cyan", borderStyle: "single", width: "100%", children: [
13237
- /* @__PURE__ */ d.jsx(S, { justifyContent: "space-between", paddingX: 1, marginBottom: 1, children: /* @__PURE__ */ d.jsxs(p, { color: "cyan", bold: !0, children: [
13236
+ return a.length === 0 ? null : /* @__PURE__ */ d.jsxs(C, { flexDirection: "column", borderColor: "cyan", borderStyle: "single", width: "100%", children: [
13237
+ /* @__PURE__ */ d.jsx(C, { justifyContent: "space-between", paddingX: 1, marginBottom: 1, children: /* @__PURE__ */ d.jsxs(p, { color: "cyan", bold: !0, children: [
13238
13238
  "Interactions (",
13239
13239
  a.length,
13240
13240
  ")"
13241
13241
  ] }) }),
13242
- /* @__PURE__ */ d.jsx(S, { paddingX: 1, marginBottom: 1, children: /* @__PURE__ */ d.jsx(
13242
+ /* @__PURE__ */ d.jsx(C, { paddingX: 1, marginBottom: 1, children: /* @__PURE__ */ d.jsx(
13243
13243
  Od,
13244
13244
  {
13245
13245
  items: n,
@@ -13307,7 +13307,7 @@ ${f.selected.join(`
13307
13307
  l();
13308
13308
  const c = setInterval(l, 100);
13309
13309
  return () => clearInterval(c);
13310
- }, [a, r, s, e]), e.state === "interrupted" && !e.output ? /* @__PURE__ */ d.jsx(S, { flexDirection: "column", children: /* @__PURE__ */ d.jsx(S, { paddingX: 1, children: /* @__PURE__ */ d.jsx(p, { color: "yellow", children: "⏳ 等待用户选择..." }) }) }) : e.output ? /* @__PURE__ */ d.jsx(p, { color: "yellow", children: e.output }) : null;
13310
+ }, [a, r, s, e]), e.state === "interrupted" && !e.output ? /* @__PURE__ */ d.jsx(C, { flexDirection: "column", children: /* @__PURE__ */ d.jsx(C, { paddingX: 1, children: /* @__PURE__ */ d.jsx(p, { color: "yellow", children: "⏳ 等待用户选择..." }) }) }) : e.output ? /* @__PURE__ */ d.jsx(p, { color: "yellow", children: e.output }) : null;
13311
13311
  }, Ud = ye({
13312
13312
  name: "ask_user_questions",
13313
13313
  description: "Ask the user a question with selectable options",
@@ -13329,8 +13329,8 @@ ${f.selected.join(`
13329
13329
  const { width: o } = ga(), l = e.split(`
13330
13330
  `).map((h) => h.slice(0, o - 10)), c = Math.max(0, l.length - t), u = l.slice(-t).join(`
13331
13331
  `);
13332
- return /* @__PURE__ */ d.jsx(S, { flexDirection: "column", width: o - 5, children: /* @__PURE__ */ d.jsxs(
13333
- S,
13332
+ return /* @__PURE__ */ d.jsx(C, { flexDirection: "column", width: o - 5, children: /* @__PURE__ */ d.jsxs(
13333
+ C,
13334
13334
  {
13335
13335
  borderStyle: s,
13336
13336
  borderColor: r,
@@ -13404,12 +13404,12 @@ ${f.selected.join(`
13404
13404
  const u = setInterval(c, 100);
13405
13405
  return () => clearInterval(u);
13406
13406
  }, [a, r, s, e]), o?.reviewConfig && a && !e.output)
13407
- return /* @__PURE__ */ d.jsx(S, { flexDirection: "column", children: /* @__PURE__ */ d.jsx(S, { paddingX: 1, paddingY: 1, children: /* @__PURE__ */ d.jsx(p, { color: "yellow", children: "⏳ Wait for Approval" }) }) });
13407
+ return /* @__PURE__ */ d.jsx(C, { flexDirection: "column", children: /* @__PURE__ */ d.jsx(C, { paddingX: 1, paddingY: 1, children: /* @__PURE__ */ d.jsx(p, { color: "yellow", children: "⏳ Wait for Approval" }) }) });
13408
13408
  const l = () => e.output ? /* @__PURE__ */ d.jsx(Rr, { content: e.output, maxLines: 5, borderColor: "cyan" }) : null;
13409
- return /* @__PURE__ */ d.jsx(S, { flexDirection: "column", children: l() });
13409
+ return /* @__PURE__ */ d.jsx(C, { flexDirection: "column", children: l() });
13410
13410
  }, Gd = ({ tool: e }) => {
13411
13411
  const r = e.getInputRepaired()?.command || "", s = r.length > 50 ? r.substring(0, 50) + "..." : r;
13412
- return /* @__PURE__ */ d.jsxs(S, { paddingX: 1, children: [
13412
+ return /* @__PURE__ */ d.jsxs(C, { paddingX: 1, children: [
13413
13413
  /* @__PURE__ */ d.jsx(p, { color: "magenta", children: "Run " }),
13414
13414
  /* @__PURE__ */ d.jsx(p, { dimColor: !0, children: "(" }),
13415
13415
  /* @__PURE__ */ d.jsx(p, { color: "magenta", children: s }),
@@ -13421,7 +13421,7 @@ ${f.selected.join(`
13421
13421
  parameters: {},
13422
13422
  handler: _e.waitForUIDone,
13423
13423
  render(e) {
13424
- return /* @__PURE__ */ d.jsxs(S, { flexDirection: "column", children: [
13424
+ return /* @__PURE__ */ d.jsxs(C, { flexDirection: "column", children: [
13425
13425
  /* @__PURE__ */ d.jsx(Gd, { tool: e }),
13426
13426
  /* @__PURE__ */ d.jsx(Bd, { tool: e })
13427
13427
  ] });
@@ -13472,8 +13472,8 @@ function Hd() {
13472
13472
  ];
13473
13473
  var m = this.diff_halfMatch_(n, i);
13474
13474
  if (m) {
13475
- var g = m[0], _ = m[1], y = m[2], w = m[3], b = m[4], C = this.diff_main(g, y, o, l), j = this.diff_main(_, w, o, l);
13476
- return C.concat(
13475
+ var g = m[0], _ = m[1], y = m[2], w = m[3], b = m[4], S = this.diff_main(g, y, o, l), j = this.diff_main(_, w, o, l);
13476
+ return S.concat(
13477
13477
  [new t.Diff(a, b)],
13478
13478
  j
13479
13479
  );
@@ -13512,14 +13512,14 @@ function Hd() {
13512
13512
  for (var l = n.length, c = i.length, u = Math.ceil((l + c) / 2), h = u, f = 2 * u, m = new Array(f), g = new Array(f), _ = 0; _ < f; _++)
13513
13513
  m[_] = -1, g[_] = -1;
13514
13514
  m[h + 1] = 0, g[h + 1] = 0;
13515
- for (var y = l - c, w = y % 2 != 0, b = 0, C = 0, j = 0, x = 0, I = 0; I < u && !((/* @__PURE__ */ new Date()).getTime() > o); I++) {
13516
- for (var E = -I + b; E <= I - C; E += 2) {
13515
+ for (var y = l - c, w = y % 2 != 0, b = 0, S = 0, j = 0, x = 0, I = 0; I < u && !((/* @__PURE__ */ new Date()).getTime() > o); I++) {
13516
+ for (var E = -I + b; E <= I - S; E += 2) {
13517
13517
  var P = h + E, O;
13518
13518
  E == -I || E != I && m[P - 1] < m[P + 1] ? O = m[P + 1] : O = m[P - 1] + 1;
13519
13519
  for (var $ = O - E; O < l && $ < c && n.charAt(O) == i.charAt($); )
13520
13520
  O++, $++;
13521
13521
  if (m[P] = O, O > l)
13522
- C += 2;
13522
+ S += 2;
13523
13523
  else if ($ > c)
13524
13524
  b += 2;
13525
13525
  else if (w) {
@@ -13612,18 +13612,18 @@ function Hd() {
13612
13612
  if (o.length < 4 || l.length * 2 < o.length)
13613
13613
  return null;
13614
13614
  var c = this;
13615
- function u(C, j, x) {
13616
- for (var I = C.substring(x, x + Math.floor(C.length / 4)), E = -1, P = "", O, $, U, F; (E = j.indexOf(I, E + 1)) != -1; ) {
13615
+ function u(S, j, x) {
13616
+ for (var I = S.substring(x, x + Math.floor(S.length / 4)), E = -1, P = "", O, $, U, F; (E = j.indexOf(I, E + 1)) != -1; ) {
13617
13617
  var H = c.diff_commonPrefix(
13618
- C.substring(x),
13618
+ S.substring(x),
13619
13619
  j.substring(E)
13620
13620
  ), G = c.diff_commonSuffix(
13621
- C.substring(0, x),
13621
+ S.substring(0, x),
13622
13622
  j.substring(0, E)
13623
13623
  );
13624
- P.length < G + H && (P = j.substring(E - G, E) + j.substring(E, E + H), O = C.substring(0, x - G), $ = C.substring(x + H), U = j.substring(0, E - G), F = j.substring(E + H));
13624
+ P.length < G + H && (P = j.substring(E - G, E) + j.substring(E, E + H), O = S.substring(0, x - G), $ = S.substring(x + H), U = j.substring(0, E - G), F = j.substring(E + H));
13625
13625
  }
13626
- return P.length * 2 >= C.length ? [
13626
+ return P.length * 2 >= S.length ? [
13627
13627
  O,
13628
13628
  $,
13629
13629
  U,
@@ -13671,10 +13671,10 @@ function Hd() {
13671
13671
  u++;
13672
13672
  }
13673
13673
  }, t.prototype.diff_cleanupSemanticLossless = function(n) {
13674
- function i(b, C) {
13675
- if (!b || !C)
13674
+ function i(b, S) {
13675
+ if (!b || !S)
13676
13676
  return 6;
13677
- var j = b.charAt(b.length - 1), x = C.charAt(0), I = j.match(t.nonAlphaNumericRegex_), E = x.match(t.nonAlphaNumericRegex_), P = I && j.match(t.whitespaceRegex_), O = E && x.match(t.whitespaceRegex_), $ = P && j.match(t.linebreakRegex_), U = O && x.match(t.linebreakRegex_), F = $ && b.match(t.blanklineEndRegex_), H = U && C.match(t.blanklineStartRegex_);
13677
+ var j = b.charAt(b.length - 1), x = S.charAt(0), I = j.match(t.nonAlphaNumericRegex_), E = x.match(t.nonAlphaNumericRegex_), P = I && j.match(t.whitespaceRegex_), O = E && x.match(t.whitespaceRegex_), $ = P && j.match(t.linebreakRegex_), U = O && x.match(t.linebreakRegex_), F = $ && b.match(t.blanklineEndRegex_), H = U && S.match(t.blanklineStartRegex_);
13678
13678
  return F || H ? 5 : $ || U ? 4 : I && !P && O ? 3 : P || O ? 2 : I || E ? 1 : 0;
13679
13679
  }
13680
13680
  for (var o = 1; o < n.length - 1; ) {
@@ -13838,15 +13838,15 @@ function Hd() {
13838
13838
  for (g = 0, _ = y; g < _; )
13839
13839
  u(b, o + _) <= h ? g = _ : y = _, _ = Math.floor((y - g) / 2 + g);
13840
13840
  y = _;
13841
- var C = Math.max(1, o - _ + 1), j = Math.min(o + _, n.length) + i.length, x = Array(j + 2);
13841
+ var S = Math.max(1, o - _ + 1), j = Math.min(o + _, n.length) + i.length, x = Array(j + 2);
13842
13842
  x[j + 1] = (1 << b) - 1;
13843
- for (var I = j; I >= C; I--) {
13843
+ for (var I = j; I >= S; I--) {
13844
13844
  var E = l[n.charAt(I - 1)];
13845
13845
  if (b === 0 ? x[I] = (x[I + 1] << 1 | 1) & E : x[I] = (x[I + 1] << 1 | 1) & E | ((w[I + 1] | w[I]) << 1 | 1) | w[I + 1], x[I] & m) {
13846
13846
  var P = u(b, I - 1);
13847
13847
  if (P <= h)
13848
13848
  if (h = P, f = I - 1, f > o)
13849
- C = Math.max(1, 2 * o - f);
13849
+ S = Math.max(1, 2 * o - f);
13850
13850
  else
13851
13851
  break;
13852
13852
  }
@@ -13906,19 +13906,19 @@ function Hd() {
13906
13906
  if (c.length === 0)
13907
13907
  return [];
13908
13908
  for (var u = [], h = new t.patch_obj(), f = 0, m = 0, g = 0, _ = l, y = l, w = 0; w < c.length; w++) {
13909
- var b = c[w][0], C = c[w][1];
13909
+ var b = c[w][0], S = c[w][1];
13910
13910
  switch (!f && b !== a && (h.start1 = m, h.start2 = g), b) {
13911
13911
  case s:
13912
- h.diffs[f++] = c[w], h.length2 += C.length, y = y.substring(0, g) + C + y.substring(g);
13912
+ h.diffs[f++] = c[w], h.length2 += S.length, y = y.substring(0, g) + S + y.substring(g);
13913
13913
  break;
13914
13914
  case r:
13915
- h.length1 += C.length, h.diffs[f++] = c[w], y = y.substring(0, g) + y.substring(g + C.length);
13915
+ h.length1 += S.length, h.diffs[f++] = c[w], y = y.substring(0, g) + y.substring(g + S.length);
13916
13916
  break;
13917
13917
  case a:
13918
- C.length <= 2 * this.Patch_Margin && f && c.length != w + 1 ? (h.diffs[f++] = c[w], h.length1 += C.length, h.length2 += C.length) : C.length >= 2 * this.Patch_Margin && f && (this.patch_addContext_(h, _), u.push(h), h = new t.patch_obj(), f = 0, _ = y, m = g);
13918
+ S.length <= 2 * this.Patch_Margin && f && c.length != w + 1 ? (h.diffs[f++] = c[w], h.length1 += S.length, h.length2 += S.length) : S.length >= 2 * this.Patch_Margin && f && (this.patch_addContext_(h, _), u.push(h), h = new t.patch_obj(), f = 0, _ = y, m = g);
13919
13919
  break;
13920
13920
  }
13921
- b !== s && (m += C.length), b !== r && (g += C.length);
13921
+ b !== s && (m += S.length), b !== r && (g += S.length);
13922
13922
  }
13923
13923
  return f && (this.patch_addContext_(h, _), u.push(h)), u;
13924
13924
  }, t.prototype.patch_deepCopy = function(n) {
@@ -13959,8 +13959,8 @@ function Hd() {
13959
13959
  c[u] = !1;
13960
13960
  else {
13961
13961
  this.diff_cleanupSemanticLossless(y);
13962
- for (var w = 0, b, C = 0; C < n[u].diffs.length; C++) {
13963
- var j = n[u].diffs[C];
13962
+ for (var w = 0, b, S = 0; S < n[u].diffs.length; S++) {
13963
+ var j = n[u].diffs[S];
13964
13964
  j[0] !== a && (b = this.diff_xIndex(y, w)), j[0] === s ? i = i.substring(0, m + b) + j[1] + i.substring(m + b) : j[0] === r && (i = i.substring(0, m + b) + i.substring(m + this.diff_xIndex(
13965
13965
  y,
13966
13966
  w + j[1].length
@@ -14083,9 +14083,9 @@ function zd(e, t, r) {
14083
14083
  const w = y.split(`
14084
14084
  `), b = y.endsWith(`
14085
14085
  `);
14086
- for (let C = 0; C < w.length; C++) {
14087
- const j = w[C];
14088
- if (j === "" && (C < w.length - 1 || !b))
14086
+ for (let S = 0; S < w.length; S++) {
14087
+ const j = w[S];
14088
+ if (j === "" && (S < w.length - 1 || !b))
14089
14089
  continue;
14090
14090
  const x = {
14091
14091
  type: _ === 0 ? "unchanged" : _ === -1 ? "added" : "removed",
@@ -14113,20 +14113,20 @@ function zd(e, t, r) {
14113
14113
  g.length > 0 && m.push(g);
14114
14114
  for (const _ of m) {
14115
14115
  if (f >= l) break;
14116
- const y = _[0], w = _[_.length - 1], b = Math.max(0, y - c), C = Math.min(o.length - 1, w + c), j = C - b + 1;
14116
+ const y = _[0], w = _[_.length - 1], b = Math.max(0, y - c), S = Math.min(o.length - 1, w + c), j = S - b + 1;
14117
14117
  if (f + j > l && f > 0) {
14118
14118
  h.push({ type: "unchanged", content: "..." });
14119
14119
  break;
14120
14120
  }
14121
- for (let x = b; x <= C; x++) {
14121
+ for (let x = b; x <= S; x++) {
14122
14122
  if (f >= l) {
14123
- x < C && h.push({ type: "unchanged", content: "..." });
14123
+ x < S && h.push({ type: "unchanged", content: "..." });
14124
14124
  break;
14125
14125
  }
14126
14126
  h.push(o[x]), f++;
14127
14127
  }
14128
14128
  if (_ === m[m.length - 1] && f < o.length) {
14129
- const x = o.length - C - 1;
14129
+ const x = o.length - S - 1;
14130
14130
  x > 0 && h.push({ type: "unchanged", content: `... (${x} more lines)` });
14131
14131
  }
14132
14132
  }
@@ -14159,8 +14159,8 @@ const Je = ({ path: e, color: t = "cyan", line: r }) => {
14159
14159
  for (const o of i)
14160
14160
  o.type === "removed" && a++, o.type === "added" && n++;
14161
14161
  }
14162
- return /* @__PURE__ */ d.jsxs(S, { flexDirection: "column", paddingX: 1, children: [
14163
- /* @__PURE__ */ d.jsxs(S, { children: [
14162
+ return /* @__PURE__ */ d.jsxs(C, { flexDirection: "column", paddingX: 1, children: [
14163
+ /* @__PURE__ */ d.jsxs(C, { children: [
14164
14164
  /* @__PURE__ */ d.jsx(p, { color: "yellow", children: "Edit " }),
14165
14165
  /* @__PURE__ */ d.jsx(p, { dimColor: !0, children: "(" }),
14166
14166
  /* @__PURE__ */ d.jsx(Je, { path: t.file_path, color: "yellow" }),
@@ -14179,8 +14179,8 @@ const Je = ({ path: e, color: t = "cyan", line: r }) => {
14179
14179
  /* @__PURE__ */ d.jsx(p, { color: "gray", children: ")" })
14180
14180
  ] })
14181
14181
  ] }),
14182
- r && r.startsWith("Error:") && /* @__PURE__ */ d.jsx(S, { marginTop: 0, marginLeft: 1, marginBottom: 1, children: /* @__PURE__ */ d.jsx(p, { color: "red", children: r }) }),
14183
- !r && /* @__PURE__ */ d.jsx(S, { marginTop: 0, children: /* @__PURE__ */ d.jsx(p, { color: "gray", children: "Press Enter to confirm, Ctrl+C to cancel" }) })
14182
+ r && r.startsWith("Error:") && /* @__PURE__ */ d.jsx(C, { marginTop: 0, marginLeft: 1, marginBottom: 1, children: /* @__PURE__ */ d.jsx(p, { color: "red", children: r }) }),
14183
+ !r && /* @__PURE__ */ d.jsx(C, { marginTop: 0, children: /* @__PURE__ */ d.jsx(p, { color: "gray", children: "Press Enter to confirm, Ctrl+C to cancel" }) })
14184
14184
  ] });
14185
14185
  }
14186
14186
  }), Wd = {
@@ -14199,8 +14199,8 @@ const Je = ({ path: e, color: t = "cyan", line: r }) => {
14199
14199
  render(e) {
14200
14200
  const t = e.getInputRepaired();
14201
14201
  if (!t || !t.todos || !Array.isArray(t.todos))
14202
- return /* @__PURE__ */ d.jsx(S, { flexDirection: "column", borderStyle: "round", borderColor: "red", children: /* @__PURE__ */ d.jsx(p, { color: "red", children: "Error: Invalid todo data structure" }) });
14203
- const r = t.todos, s = () => r.length === 0 ? /* @__PURE__ */ d.jsx(S, { paddingX: 1, children: /* @__PURE__ */ d.jsx(p, { color: "gray", children: "No tasks in todo list" }) }) : /* @__PURE__ */ d.jsx(S, { flexDirection: "column", marginTop: 0, children: r.map((a, n) => /* @__PURE__ */ d.jsxs(S, { paddingX: 1, paddingY: 0, children: [
14202
+ return /* @__PURE__ */ d.jsx(C, { flexDirection: "column", borderStyle: "round", borderColor: "red", children: /* @__PURE__ */ d.jsx(p, { color: "red", children: "Error: Invalid todo data structure" }) });
14203
+ const r = t.todos, s = () => r.length === 0 ? /* @__PURE__ */ d.jsx(C, { paddingX: 1, children: /* @__PURE__ */ d.jsx(p, { color: "gray", children: "No tasks in todo list" }) }) : /* @__PURE__ */ d.jsx(C, { flexDirection: "column", marginTop: 0, children: r.map((a, n) => /* @__PURE__ */ d.jsxs(C, { paddingX: 1, paddingY: 0, children: [
14204
14204
  /* @__PURE__ */ d.jsxs(p, { color: Wd[a.status], bold: !0, children: [
14205
14205
  Vd[a.status],
14206
14206
  " "
@@ -14211,7 +14211,7 @@ const Je = ({ path: e, color: t = "cyan", line: r }) => {
14211
14211
  a.content
14212
14212
  ] })
14213
14213
  ] }, a.id)) });
14214
- return /* @__PURE__ */ d.jsx(S, { flexDirection: "column", paddingX: 0, children: /* @__PURE__ */ d.jsx(S, { flexDirection: "column", marginTop: 0, children: s() }) });
14214
+ return /* @__PURE__ */ d.jsx(C, { flexDirection: "column", paddingX: 0, children: /* @__PURE__ */ d.jsx(C, { flexDirection: "column", marginTop: 0, children: s() }) });
14215
14215
  }
14216
14216
  }), Yd = ye({
14217
14217
  name: "read_file",
@@ -14223,7 +14223,7 @@ const Je = ({ path: e, color: t = "cyan", line: r }) => {
14223
14223
  if (!r) return /* @__PURE__ */ d.jsx(d.Fragment, {});
14224
14224
  const a = r.split(`
14225
14225
  `).length;
14226
- return /* @__PURE__ */ d.jsx(S, { flexDirection: "column", paddingX: 1, children: /* @__PURE__ */ d.jsxs(S, { children: [
14226
+ return /* @__PURE__ */ d.jsx(C, { flexDirection: "column", paddingX: 1, children: /* @__PURE__ */ d.jsxs(C, { children: [
14227
14227
  /* @__PURE__ */ d.jsx(p, { color: "blue", children: "Read " }),
14228
14228
  /* @__PURE__ */ d.jsx(p, { dimColor: !0, children: "(" }),
14229
14229
  /* @__PURE__ */ d.jsx(Je, { path: t.file_path, color: "blue" }),
@@ -14246,7 +14246,7 @@ const Je = ({ path: e, color: t = "cyan", line: r }) => {
14246
14246
  if (!r) return /* @__PURE__ */ d.jsx(d.Fragment, {});
14247
14247
  const a = r.split(`
14248
14248
  `).filter(Boolean).length;
14249
- return /* @__PURE__ */ d.jsx(S, { flexDirection: "column", paddingX: 1, children: /* @__PURE__ */ d.jsxs(p, { children: [
14249
+ return /* @__PURE__ */ d.jsx(C, { flexDirection: "column", paddingX: 1, children: /* @__PURE__ */ d.jsxs(p, { children: [
14250
14250
  /* @__PURE__ */ d.jsx(p, { color: "cyan", children: "Glob " }),
14251
14251
  /* @__PURE__ */ d.jsx(p, { dimColor: !0, children: "(" }),
14252
14252
  /* @__PURE__ */ d.jsx(Je, { path: t.pattern, color: "cyan" }),
@@ -14274,7 +14274,7 @@ const Je = ({ path: e, color: t = "cyan", line: r }) => {
14274
14274
  const l = (t.args || []).filter((c) => !c.startsWith("-"));
14275
14275
  l.length > 0 && (i = l[l.length - 1], l.length > 1 && (n = l[l.length - 2]));
14276
14276
  }
14277
- return /* @__PURE__ */ d.jsx(S, { flexDirection: "column", paddingX: 1, children: /* @__PURE__ */ d.jsxs(p, { children: [
14277
+ return /* @__PURE__ */ d.jsx(C, { flexDirection: "column", paddingX: 1, children: /* @__PURE__ */ d.jsxs(p, { children: [
14278
14278
  /* @__PURE__ */ d.jsx(p, { color: "magenta", children: "Ripgrep " }),
14279
14279
  n && /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
14280
14280
  /* @__PURE__ */ d.jsx(p, { dimColor: !0, children: "(" }),
@@ -14338,7 +14338,7 @@ const Je = ({ path: e, color: t = "cyan", line: r }) => {
14338
14338
  delete: "red"
14339
14339
  }[t?.operation] || "cyan";
14340
14340
  return r.split(`
14341
- `).map((i, o) => i.match(/\d+ \w+|[\d-]+ [\d:]+/) ? /* @__PURE__ */ d.jsx(p, { dimColor: !0, children: i }, o) : i.includes("✓") || i.includes("successfully") || i.includes("created") || i.includes("deleted") ? /* @__PURE__ */ d.jsx(p, { color: "green", children: i }, o) : i.includes("✗") || i.includes("Error") || i.includes("not found") || i.includes("failed") ? /* @__PURE__ */ d.jsx(p, { color: "red", children: i }, o) : i.startsWith("/") || i.includes("/:") ? /* @__PURE__ */ d.jsx(p, { color: "cyan", children: i }, o) : /* @__PURE__ */ d.jsx(p, { children: i }, o)), /* @__PURE__ */ d.jsx(S, { flexDirection: "column", paddingX: 1, children: /* @__PURE__ */ d.jsxs(S, { children: [
14341
+ `).map((i, o) => i.match(/\d+ \w+|[\d-]+ [\d:]+/) ? /* @__PURE__ */ d.jsx(p, { dimColor: !0, children: i }, o) : i.includes("✓") || i.includes("successfully") || i.includes("created") || i.includes("deleted") ? /* @__PURE__ */ d.jsx(p, { color: "green", children: i }, o) : i.includes("✗") || i.includes("Error") || i.includes("not found") || i.includes("failed") ? /* @__PURE__ */ d.jsx(p, { color: "red", children: i }, o) : i.startsWith("/") || i.includes("/:") ? /* @__PURE__ */ d.jsx(p, { color: "cyan", children: i }, o) : /* @__PURE__ */ d.jsx(p, { children: i }, o)), /* @__PURE__ */ d.jsx(C, { flexDirection: "column", paddingX: 1, children: /* @__PURE__ */ d.jsxs(C, { children: [
14342
14342
  /* @__PURE__ */ d.jsxs(p, { bold: !0, color: a, children: [
14343
14343
  t.operation,
14344
14344
  "Folder"
@@ -14371,26 +14371,26 @@ const Je = ({ path: e, color: t = "cyan", line: r }) => {
14371
14371
  r = JSON.parse(t);
14372
14372
  } catch {
14373
14373
  }
14374
- return /* @__PURE__ */ d.jsxs(S, { flexDirection: "column", children: [
14375
- /* @__PURE__ */ d.jsx(S, { children: /* @__PURE__ */ d.jsx(p, { color: "blue", bold: !0, children: "load_mcp_tools" }) }),
14376
- r?.status && /* @__PURE__ */ d.jsxs(S, { flexDirection: "column", marginTop: 1, children: [
14374
+ return /* @__PURE__ */ d.jsxs(C, { flexDirection: "column", children: [
14375
+ /* @__PURE__ */ d.jsx(C, { children: /* @__PURE__ */ d.jsx(p, { color: "blue", bold: !0, children: "load_mcp_tools" }) }),
14376
+ r?.status && /* @__PURE__ */ d.jsxs(C, { flexDirection: "column", marginTop: 1, children: [
14377
14377
  /* @__PURE__ */ d.jsx(p, { color: "green", children: "✓ MCP 已连接" }),
14378
- r.status.servers && r.status.servers.length > 0 && /* @__PURE__ */ d.jsx(S, { marginLeft: 2, children: /* @__PURE__ */ d.jsxs(p, { color: "gray", children: [
14378
+ r.status.servers && r.status.servers.length > 0 && /* @__PURE__ */ d.jsx(C, { marginLeft: 2, children: /* @__PURE__ */ d.jsxs(p, { color: "gray", children: [
14379
14379
  "服务器: ",
14380
14380
  r.status.servers.join(", ")
14381
14381
  ] }) }),
14382
- r.status.toolCount !== void 0 && /* @__PURE__ */ d.jsx(S, { marginLeft: 2, children: /* @__PURE__ */ d.jsxs(p, { color: "gray", children: [
14382
+ r.status.toolCount !== void 0 && /* @__PURE__ */ d.jsx(C, { marginLeft: 2, children: /* @__PURE__ */ d.jsxs(p, { color: "gray", children: [
14383
14383
  "工具数量: ",
14384
14384
  r.status.toolCount
14385
14385
  ] }) })
14386
14386
  ] }),
14387
- r?.tools && r.tools.length > 0 && /* @__PURE__ */ d.jsxs(S, { flexDirection: "column", marginTop: 1, children: [
14387
+ r?.tools && r.tools.length > 0 && /* @__PURE__ */ d.jsxs(C, { flexDirection: "column", marginTop: 1, children: [
14388
14388
  /* @__PURE__ */ d.jsxs(p, { color: "gray", dimColor: !0, children: [
14389
14389
  "可用工具 (",
14390
14390
  r.tools.length,
14391
14391
  "):"
14392
14392
  ] }),
14393
- r.tools.slice(0, 5).map((s, a) => /* @__PURE__ */ d.jsxs(S, { marginLeft: 2, children: [
14393
+ r.tools.slice(0, 5).map((s, a) => /* @__PURE__ */ d.jsxs(C, { marginLeft: 2, children: [
14394
14394
  /* @__PURE__ */ d.jsx(p, { color: "cyan", children: s.name }),
14395
14395
  s.description && /* @__PURE__ */ d.jsxs(p, { color: "gray", dimColor: !0, children: [
14396
14396
  " ",
@@ -14399,7 +14399,7 @@ const Je = ({ path: e, color: t = "cyan", line: r }) => {
14399
14399
  s.description.length > 50 ? "..." : ""
14400
14400
  ] })
14401
14401
  ] }, a)),
14402
- r.tools.length > 5 && /* @__PURE__ */ d.jsx(S, { marginLeft: 2, children: /* @__PURE__ */ d.jsxs(p, { color: "gray", dimColor: !0, children: [
14402
+ r.tools.length > 5 && /* @__PURE__ */ d.jsx(C, { marginLeft: 2, children: /* @__PURE__ */ d.jsxs(p, { color: "gray", dimColor: !0, children: [
14403
14403
  "... 还有 ",
14404
14404
  r.tools.length - 5,
14405
14405
  " 个工具"
@@ -14439,15 +14439,15 @@ const Je = ({ path: e, color: t = "cyan", line: r }) => {
14439
14439
  s = JSON.parse(r);
14440
14440
  } catch {
14441
14441
  }
14442
- return /* @__PURE__ */ d.jsxs(S, { flexDirection: "column", children: [
14443
- /* @__PURE__ */ d.jsx(S, { children: /* @__PURE__ */ d.jsx(p, { color: "blue", bold: !0, children: "execute_mcp_tool" }) }),
14444
- t?.commands && t.commands.length > 0 && /* @__PURE__ */ d.jsxs(S, { flexDirection: "column", marginTop: 1, children: [
14442
+ return /* @__PURE__ */ d.jsxs(C, { flexDirection: "column", children: [
14443
+ /* @__PURE__ */ d.jsx(C, { children: /* @__PURE__ */ d.jsx(p, { color: "blue", bold: !0, children: "execute_mcp_tool" }) }),
14444
+ t?.commands && t.commands.length > 0 && /* @__PURE__ */ d.jsxs(C, { flexDirection: "column", marginTop: 1, children: [
14445
14445
  /* @__PURE__ */ d.jsxs(p, { color: "gray", dimColor: !0, children: [
14446
14446
  "执行 ",
14447
14447
  t.commands.length,
14448
14448
  " 个 MCP 工具:"
14449
14449
  ] }),
14450
- t.commands.map((a, n) => /* @__PURE__ */ d.jsxs(S, { marginLeft: 2, children: [
14450
+ t.commands.map((a, n) => /* @__PURE__ */ d.jsxs(C, { marginLeft: 2, children: [
14451
14451
  /* @__PURE__ */ d.jsxs(p, { color: "yellow", children: [
14452
14452
  n + 1,
14453
14453
  "."
@@ -14455,7 +14455,7 @@ const Je = ({ path: e, color: t = "cyan", line: r }) => {
14455
14455
  /* @__PURE__ */ d.jsx(p, { color: "cyan", children: a.name })
14456
14456
  ] }, n))
14457
14457
  ] }),
14458
- s?.results && /* @__PURE__ */ d.jsx(S, { flexDirection: "column", marginTop: 1, children: s.results.map((a, n) => /* @__PURE__ */ d.jsx(S, { marginLeft: 2, children: a.error ? /* @__PURE__ */ d.jsxs(p, { color: "red", children: [
14458
+ s?.results && /* @__PURE__ */ d.jsx(C, { flexDirection: "column", marginTop: 1, children: s.results.map((a, n) => /* @__PURE__ */ d.jsx(C, { marginLeft: 2, children: a.error ? /* @__PURE__ */ d.jsxs(p, { color: "red", children: [
14459
14459
  "✗ ",
14460
14460
  a.tool
14461
14461
  ] }) : /* @__PURE__ */ d.jsxs(p, { color: "green", children: [
@@ -14504,17 +14504,17 @@ const Je = ({ path: e, color: t = "cyan", line: r }) => {
14504
14504
  }, _ = () => {
14505
14505
  if (!h || !n.commandSuggestions || n.commandSuggestions.length === 0)
14506
14506
  return !1;
14507
- const w = n.commandSuggestions[0], C = (w.displayText || w.command || "") + " ";
14508
- return f(C), !0;
14507
+ const w = n.commandSuggestions[0], S = (w.displayText || w.command || "") + " ";
14508
+ return f(S), !0;
14509
14509
  };
14510
- return /* @__PURE__ */ d.jsxs(S, { flexDirection: "column", children: [
14511
- i && /* @__PURE__ */ d.jsx(S, { padding: 1, children: /* @__PURE__ */ d.jsxs(p, { color: "yellow", children: [
14510
+ return /* @__PURE__ */ d.jsxs(C, { flexDirection: "column", children: [
14511
+ i && /* @__PURE__ */ d.jsx(C, { padding: 1, children: /* @__PURE__ */ d.jsxs(p, { color: "yellow", children: [
14512
14512
  "📝 缓冲区: ",
14513
14513
  i.slice(0, 50),
14514
14514
  i.length > 50 ? "..." : ""
14515
14515
  ] }) }),
14516
14516
  /* @__PURE__ */ d.jsx(n.CommandHintUI, {}),
14517
- /* @__PURE__ */ d.jsx(S, { paddingY: 1, children: /* @__PURE__ */ d.jsx(
14517
+ /* @__PURE__ */ d.jsx(C, { paddingY: 1, children: /* @__PURE__ */ d.jsx(
14518
14518
  Pe,
14519
14519
  {
14520
14520
  id: "global-input",
@@ -14560,14 +14560,14 @@ const dh = (e) => e.length > 80 ? e.slice(0, 80) + "..." : e, hh = ({ onClose: e
14560
14560
  }, [r]);
14561
14561
  const { data: a = [] } = Cs({ type: "memories", enabled: t === "memories" }), { data: n = [] } = Cs({ type: "skills", enabled: t === "skills" }), i = v.useCallback(async () => t === "memories" ? a : n, [t, a, n]), o = v.useCallback((f, m, g) => {
14562
14562
  const _ = dh(f.description);
14563
- return /* @__PURE__ */ d.jsxs(S, { flexDirection: "column", paddingY: 1, children: [
14564
- /* @__PURE__ */ d.jsx(S, { children: /* @__PURE__ */ d.jsxs(p, { bold: !0, color: g ? "cyan" : "gray", children: [
14563
+ return /* @__PURE__ */ d.jsxs(C, { flexDirection: "column", paddingY: 1, children: [
14564
+ /* @__PURE__ */ d.jsx(C, { children: /* @__PURE__ */ d.jsxs(p, { bold: !0, color: g ? "cyan" : "gray", children: [
14565
14565
  m + 1,
14566
14566
  ". ",
14567
14567
  f.name
14568
14568
  ] }) }),
14569
- /* @__PURE__ */ d.jsx(S, { paddingY: 1, children: /* @__PURE__ */ d.jsx(p, { color: g ? "white" : "gray", children: _ }) }),
14570
- /* @__PURE__ */ d.jsx(S, { children: /* @__PURE__ */ d.jsxs(p, { color: "cyan", dimColor: !g, children: [
14569
+ /* @__PURE__ */ d.jsx(C, { paddingY: 1, children: /* @__PURE__ */ d.jsx(p, { color: g ? "white" : "gray", children: _ }) }),
14570
+ /* @__PURE__ */ d.jsx(C, { children: /* @__PURE__ */ d.jsxs(p, { color: "cyan", dimColor: !g, children: [
14571
14571
  Ds(f.path),
14572
14572
  f.category && /* @__PURE__ */ d.jsxs(p, { color: "yellow", children: [
14573
14573
  " ",
@@ -14723,42 +14723,52 @@ const js = {
14723
14723
  default: "🔮"
14724
14724
  }, _h = ({ onClose: e }) => {
14725
14725
  const { extraParams: t, config: r, updateConfig: s } = be(), [a, n] = v.useState(""), i = v.useRef([]), o = v.useMemo(() => !r?.providers || r.providers.length === 0 ? [] : r.providers.map((b) => {
14726
- const C = b.type || "default";
14726
+ const S = b.type || "default";
14727
14727
  return {
14728
14728
  id: b.id,
14729
14729
  // 使用 id 比较清楚
14730
14730
  label: b.id,
14731
- icon: js[C] || js.default,
14731
+ icon: js[S] || js.default,
14732
14732
  config: b
14733
14733
  };
14734
14734
  }), [r?.providers]);
14735
14735
  v.useMemo(() => {
14736
14736
  if (o.length > 0 && !a) {
14737
- const b = o.find((C) => C.id === t.provider_id);
14737
+ const b = o.find((S) => S.id === t.provider_id);
14738
14738
  n(b?.id || o[0].id);
14739
14739
  }
14740
14740
  }, [o, t.provider_id, a]);
14741
- const l = o.find((b) => b.id === a), { data: c, isLoading: u, error: h } = yh({
14741
+ const l = o.find((b) => b.id === a), {
14742
+ data: c,
14743
+ isLoading: u,
14744
+ error: h
14745
+ } = yh({
14742
14746
  provider: l?.config || null,
14743
14747
  enabled: !!a
14744
14748
  });
14745
- Fe((b, C) => {
14749
+ v.useMemo(() => {
14750
+ const b = (c || []).map((S) => ({
14751
+ id: S.id,
14752
+ name: S.name
14753
+ }));
14754
+ return i.current = b, b;
14755
+ }, [c]), Fe((b, S) => {
14746
14756
  if (!(o.length <= 1)) {
14747
- if (C.leftArrow) {
14757
+ if (S.leftArrow) {
14748
14758
  const x = (o.findIndex((I) => I.id === a) - 1 + o.length) % o.length;
14749
14759
  n(o[x].id);
14750
- } else if (C.rightArrow) {
14760
+ } else if (S.rightArrow) {
14751
14761
  const x = (o.findIndex((I) => I.id === a) + 1) % o.length;
14752
14762
  n(o[x].id);
14753
14763
  }
14754
14764
  }
14755
14765
  });
14756
14766
  const f = v.useCallback(async () => i.current, []), m = v.useCallback(
14757
- (b, C, j) => {
14767
+ (b, S, j) => {
14758
14768
  const x = b.id === t.provider_id + "-" + b.id;
14759
14769
  return /* @__PURE__ */ d.jsxs(Er, { isSelected: j, isCurrent: x, children: [
14760
14770
  /* @__PURE__ */ d.jsxs(p, { bold: !0, children: [
14761
- C + 1,
14771
+ S + 1,
14762
14772
  ". ",
14763
14773
  b.id
14764
14774
  ] }),
@@ -14766,7 +14776,7 @@ const js = {
14766
14776
  " ",
14767
14777
  b.name !== b.id ? `(${b.name})` : ""
14768
14778
  ] })
14769
- ] }, C + b.id);
14779
+ ] }, S + b.id);
14770
14780
  },
14771
14781
  [t.provider_id]
14772
14782
  ), g = v.useCallback(
@@ -14800,23 +14810,23 @@ const js = {
14800
14810
  showCount: !0
14801
14811
  }), [a, l, f, m, g, _]);
14802
14812
  if (o.length === 0)
14803
- return /* @__PURE__ */ d.jsxs(S, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
14813
+ return /* @__PURE__ */ d.jsxs(C, { flexDirection: "column", paddingX: 2, paddingY: 1, children: [
14804
14814
  /* @__PURE__ */ d.jsx(p, { color: "yellow", children: "⚠️ 未配置任何 Provider" }),
14805
14815
  /* @__PURE__ */ d.jsx(p, { color: "gray", dimColor: !0, children: "请先配置 Provider 后再查看模型列表" })
14806
14816
  ] });
14807
14817
  const w = l?.config.apiKey;
14808
- return /* @__PURE__ */ d.jsxs(S, { flexDirection: "column", children: [
14809
- /* @__PURE__ */ d.jsx(S, { gap: 1, paddingX: 1, paddingY: 1, children: o.map((b) => /* @__PURE__ */ d.jsxs(p, { bold: b.id === a, color: b.id === a ? "cyan" : "gray", children: [
14818
+ return /* @__PURE__ */ d.jsxs(C, { flexDirection: "column", children: [
14819
+ /* @__PURE__ */ d.jsx(C, { gap: 1, paddingX: 1, paddingY: 1, children: o.map((b) => /* @__PURE__ */ d.jsxs(p, { bold: b.id === a, color: b.id === a ? "cyan" : "gray", children: [
14810
14820
  b.icon,
14811
14821
  " ",
14812
14822
  b.label,
14813
14823
  b.id === a && " [当前]",
14814
14824
  b.id === a && !w && " (未配置 API Key)"
14815
14825
  ] }, b.id)) }),
14816
- u ? /* @__PURE__ */ d.jsx(S, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ d.jsx(p, { color: "gray", children: "加载模型列表中..." }) }) : h ? /* @__PURE__ */ d.jsx(S, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ d.jsxs(p, { color: "red", children: [
14826
+ u ? /* @__PURE__ */ d.jsx(C, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ d.jsx(p, { color: "gray", children: "加载模型列表中..." }) }) : h ? /* @__PURE__ */ d.jsx(C, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ d.jsxs(p, { color: "red", children: [
14817
14827
  "加载失败: ",
14818
14828
  h.message
14819
- ] }) }) : w ? /* @__PURE__ */ d.jsx(ut, { config: y, onClose: e }) : /* @__PURE__ */ d.jsx(S, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ d.jsx(p, { color: "yellow", children: "请先配置 API Key" }) })
14829
+ ] }) }) : w ? /* @__PURE__ */ d.jsx(ut, { config: y, onClose: e }) : /* @__PURE__ */ d.jsx(C, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ d.jsx(p, { color: "yellow", children: "请先配置 API Key" }) })
14820
14830
  ] });
14821
14831
  }, Be = [
14822
14832
  { id: "openai", label: "OpenAI", defaultUrl: "https://api.openai.com/v1" },
@@ -14835,12 +14845,12 @@ const js = {
14835
14845
  apiKey: t?.apiKey || "",
14836
14846
  baseUrl: t?.baseUrl || Be[0].defaultUrl
14837
14847
  }), [o, l] = v.useState({}), [c, u] = v.useState(0), h = v.useMemo(() => Be.find((b) => b.id === n.type) || Be[0], [n.type]), f = v.useCallback(() => {
14838
- const b = {}, C = a?.providers || [];
14839
- return !n.id || n.id.length < 3 || n.id.length > 32 ? b.id = "ID 必须为 3-32 个字符" : /^[a-zA-Z0-9_]+$/.test(n.id) ? C.some((j) => j.id === n.id && j.id !== t?.id) && (b.id = "ID 已存在") : b.id = "ID 只能包含字母、数字和下划线", (!n.name || n.name.length < 2 || n.name.length > 50) && (b.name = "名称必须为 2-50 个字符"), n.apiKey || (b.apiKey = "API Key 不能为空"), n.baseUrl ? n.baseUrl.startsWith("https://") || (b.baseUrl = "Base URL 必须以 https:// 开头") : b.baseUrl = "Base URL 不能为空", l(b), Object.keys(b).length === 0;
14848
+ const b = {}, S = a?.providers || [];
14849
+ return !n.id || n.id.length < 3 || n.id.length > 32 ? b.id = "ID 必须为 3-32 个字符" : /^[a-zA-Z0-9_]+$/.test(n.id) ? S.some((j) => j.id === n.id && j.id !== t?.id) && (b.id = "ID 已存在") : b.id = "ID 只能包含字母、数字和下划线", (!n.name || n.name.length < 2 || n.name.length > 50) && (b.name = "名称必须为 2-50 个字符"), n.apiKey || (b.apiKey = "API Key 不能为空"), n.baseUrl ? n.baseUrl.startsWith("https://") || (b.baseUrl = "Base URL 必须以 https:// 开头") : b.baseUrl = "Base URL 不能为空", l(b), Object.keys(b).length === 0;
14840
14850
  }, [n, a?.providers, t?.id]), m = v.useCallback(() => {
14841
14851
  f() && s(n);
14842
14852
  }, [f, n, s]), g = v.useCallback(() => {
14843
- const C = (Be.findIndex((x) => x.id === n.type) + 1) % Be.length, j = Be[C];
14853
+ const S = (Be.findIndex((x) => x.id === n.type) + 1) % Be.length, j = Be[S];
14844
14854
  i((x) => ({
14845
14855
  ...x,
14846
14856
  type: j.id,
@@ -14848,49 +14858,49 @@ const js = {
14848
14858
  }));
14849
14859
  }, [n.type]), _ = v.useCallback(
14850
14860
  (b) => {
14851
- const C = b === "next" ? (c + 1) % tt.length : (c - 1 + tt.length) % tt.length;
14852
- u(C);
14861
+ const S = b === "next" ? (c + 1) % tt.length : (c - 1 + tt.length) % tt.length;
14862
+ u(S);
14853
14863
  },
14854
14864
  [c]
14855
14865
  ), y = (b) => {
14856
- const C = tt[b];
14857
- return C.key === "url" ? "baseUrl" : C.key;
14866
+ const S = tt[b];
14867
+ return S.key === "url" ? "baseUrl" : S.key;
14858
14868
  };
14859
14869
  Fe(
14860
- (b, C) => {
14861
- C.return ? m() : C.escape ? r() : C.tab ? _(C.shift ? "prev" : "next") : b === " " && g();
14870
+ (b, S) => {
14871
+ S.return ? m() : S.escape ? r() : S.tab ? _(S.shift ? "prev" : "next") : b === " " && g();
14862
14872
  },
14863
14873
  { isActive: !0 }
14864
14874
  );
14865
14875
  const w = (b) => {
14866
- const C = tt[b], j = y(b), x = o[j], I = c === b;
14867
- return /* @__PURE__ */ d.jsxs(S, { marginBottom: 0, children: [
14876
+ const S = tt[b], j = y(b), x = o[j], I = c === b;
14877
+ return /* @__PURE__ */ d.jsxs(C, { marginBottom: 0, children: [
14868
14878
  /* @__PURE__ */ d.jsxs(p, { color: I ? "cyan" : x ? "red" : "gray", children: [
14869
- C.label,
14879
+ S.label,
14870
14880
  ": "
14871
14881
  ] }),
14872
- I ? /* @__PURE__ */ d.jsx(S, { width: 50, children: /* @__PURE__ */ d.jsx(
14882
+ I ? /* @__PURE__ */ d.jsx(C, { width: 50, children: /* @__PURE__ */ d.jsx(
14873
14883
  Pe,
14874
14884
  {
14875
14885
  value: n[j],
14876
14886
  onChange: (E) => i((P) => ({ ...P, [j]: E })),
14877
14887
  onSubmit: m,
14878
- placeholder: C.placeholder,
14888
+ placeholder: S.placeholder,
14879
14889
  maxVisibleLines: 1,
14880
14890
  showCursor: !0
14881
14891
  }
14882
- ) }) : /* @__PURE__ */ d.jsx(p, { children: n[j] || C.placeholder }),
14892
+ ) }) : /* @__PURE__ */ d.jsx(p, { children: n[j] || S.placeholder }),
14883
14893
  x && /* @__PURE__ */ d.jsxs(p, { color: "red", children: [
14884
14894
  " ",
14885
14895
  x
14886
14896
  ] })
14887
- ] }, C.key);
14897
+ ] }, S.key);
14888
14898
  };
14889
- return /* @__PURE__ */ d.jsxs(S, { flexDirection: "column", paddingX: 2, children: [
14899
+ return /* @__PURE__ */ d.jsxs(C, { flexDirection: "column", paddingX: 2, children: [
14890
14900
  /* @__PURE__ */ d.jsx(p, { bold: !0, color: "cyan", children: e === "add" ? "新增 Provider" : "编辑 Provider" }),
14891
- /* @__PURE__ */ d.jsxs(S, { marginTop: 1, flexDirection: "column", gap: 1, children: [
14901
+ /* @__PURE__ */ d.jsxs(C, { marginTop: 1, flexDirection: "column", gap: 1, children: [
14892
14902
  w(0),
14893
- /* @__PURE__ */ d.jsxs(S, { marginBottom: 0, children: [
14903
+ /* @__PURE__ */ d.jsxs(C, { marginBottom: 0, children: [
14894
14904
  /* @__PURE__ */ d.jsx(p, { color: c === 0 ? "cyan" : "gray", children: "Type: " }),
14895
14905
  /* @__PURE__ */ d.jsx(p, { color: "cyan", bold: !0, children: h.label }),
14896
14906
  /* @__PURE__ */ d.jsx(p, { color: "gray", children: " [空格切换]" })
@@ -14899,7 +14909,7 @@ const js = {
14899
14909
  w(2),
14900
14910
  w(3)
14901
14911
  ] }),
14902
- /* @__PURE__ */ d.jsx(S, { marginTop: 1, children: /* @__PURE__ */ d.jsxs(p, { color: "gray", dimColor: !0, children: [
14912
+ /* @__PURE__ */ d.jsx(C, { marginTop: 1, children: /* @__PURE__ */ d.jsxs(p, { color: "gray", dimColor: !0, children: [
14903
14913
  /* @__PURE__ */ d.jsx(p, { color: "cyan", children: "Enter" }),
14904
14914
  " 保存 ",
14905
14915
  /* @__PURE__ */ d.jsx(p, { color: "cyan", children: "Tab" }),
@@ -14935,7 +14945,7 @@ const js = {
14935
14945
  w();
14936
14946
  },
14937
14947
  [n, m, r, w]
14938
- ), C = v.useCallback(async () => {
14948
+ ), S = v.useCallback(async () => {
14939
14949
  if (!g) return;
14940
14950
  if (m.length <= 1) {
14941
14951
  f("无法删除最后一个 Provider");
@@ -14954,14 +14964,14 @@ const js = {
14954
14964
  I.escape && w();
14955
14965
  return;
14956
14966
  }
14957
- I.upArrow ? u((E) => E > 0 ? E - 1 : m.length - 1) : I.downArrow ? u((E) => E < m.length - 1 ? E + 1 : 0) : x === "n" || x === "N" ? _() : (x === "e" || x === "E") && g ? y() : (x === "d" || x === "D") && g ? C() : I.escape && e();
14967
+ I.upArrow ? u((E) => E > 0 ? E - 1 : m.length - 1) : I.downArrow ? u((E) => E < m.length - 1 ? E + 1 : 0) : x === "n" || x === "N" ? _() : (x === "e" || x === "E") && g ? y() : (x === "d" || x === "D") && g ? S() : I.escape && e();
14958
14968
  },
14959
14969
  { isActive: !0 }
14960
14970
  );
14961
- const j = v.useMemo(() => m.length === 0 ? /* @__PURE__ */ d.jsx(S, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ d.jsx(p, { color: "yellow", children: "未配置任何 Provider" }) }) : /* @__PURE__ */ d.jsxs(S, { flexDirection: "column", paddingX: 2, gap: 1, children: [
14971
+ const j = v.useMemo(() => m.length === 0 ? /* @__PURE__ */ d.jsx(C, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ d.jsx(p, { color: "yellow", children: "未配置任何 Provider" }) }) : /* @__PURE__ */ d.jsxs(C, { flexDirection: "column", paddingX: 2, gap: 1, children: [
14962
14972
  m.map((x, I) => {
14963
14973
  const E = !!x.apiKey, P = E ? "green" : "yellow";
14964
- return /* @__PURE__ */ d.jsxs(S, { marginBottom: 0, gap: 1, children: [
14974
+ return /* @__PURE__ */ d.jsxs(C, { marginBottom: 0, gap: 1, children: [
14965
14975
  /* @__PURE__ */ d.jsx(p, { color: I === c ? "cyan" : "gray", bold: I === c, children: I === c ? ">" : " " }),
14966
14976
  /* @__PURE__ */ d.jsx(p, { bold: I === c, color: I === c ? "cyan" : void 0, children: x.id }),
14967
14977
  /* @__PURE__ */ d.jsx(Mt, {}),
@@ -14977,7 +14987,7 @@ const js = {
14977
14987
  ] })
14978
14988
  ] }, x.id);
14979
14989
  }),
14980
- /* @__PURE__ */ d.jsx(S, { marginTop: 1, children: /* @__PURE__ */ d.jsxs(p, { color: "gray", dimColor: !0, children: [
14990
+ /* @__PURE__ */ d.jsx(C, { marginTop: 1, children: /* @__PURE__ */ d.jsxs(p, { color: "gray", dimColor: !0, children: [
14981
14991
  /* @__PURE__ */ d.jsx(p, { color: "cyan", children: "↑↓" }),
14982
14992
  " 导航 ",
14983
14993
  /* @__PURE__ */ d.jsx(p, { color: "cyan", children: "n" }),
@@ -14991,8 +15001,8 @@ const js = {
14991
15001
  " 关闭"
14992
15002
  ] }) })
14993
15003
  ] }), [m, c]);
14994
- return /* @__PURE__ */ d.jsxs(S, { flexDirection: "column", children: [
14995
- /* @__PURE__ */ d.jsx(S, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ d.jsx(p, { bold: !0, color: "cyan", children: "Providers" }) }),
15004
+ return /* @__PURE__ */ d.jsxs(C, { flexDirection: "column", children: [
15005
+ /* @__PURE__ */ d.jsx(C, { paddingX: 2, paddingY: 1, children: /* @__PURE__ */ d.jsx(p, { bold: !0, color: "cyan", children: "Providers" }) }),
14996
15006
  s === "list" ? j : /* @__PURE__ */ d.jsx(
14997
15007
  bh,
14998
15008
  {
@@ -15002,7 +15012,7 @@ const js = {
15002
15012
  onSave: b
15003
15013
  }
15004
15014
  ),
15005
- h && /* @__PURE__ */ d.jsx(S, { paddingX: 2, paddingY: 0, children: /* @__PURE__ */ d.jsx(p, { color: "green", children: h }) })
15015
+ h && /* @__PURE__ */ d.jsx(C, { paddingX: 2, paddingY: 0, children: /* @__PURE__ */ d.jsx(p, { color: "green", children: h }) })
15006
15016
  ] });
15007
15017
  }, wh = ({ onClose: e, initialTab: t = "model" }) => {
15008
15018
  const [r, s] = v.useState(t), a = v.useCallback(() => {
@@ -15015,13 +15025,13 @@ const js = {
15015
15025
  i === "m" || i === "M" ? a() : i === "p" || i === "P" ? n() : o.escape && e();
15016
15026
  },
15017
15027
  { isActive: !0 }
15018
- ), /* @__PURE__ */ d.jsxs(S, { flexDirection: "column", width: "100%", borderStyle: "single", borderDimColor: !0, children: [
15019
- /* @__PURE__ */ d.jsxs(S, { flexDirection: "column", paddingX: 0, paddingY: 0, children: [
15028
+ ), /* @__PURE__ */ d.jsxs(C, { flexDirection: "column", width: "100%", borderStyle: "single", borderDimColor: !0, children: [
15029
+ /* @__PURE__ */ d.jsxs(C, { flexDirection: "column", paddingX: 0, paddingY: 0, children: [
15020
15030
  r === "model" && /* @__PURE__ */ d.jsx(_h, { onClose: e }),
15021
15031
  r === "provider" && /* @__PURE__ */ d.jsx(vh, { onClose: e })
15022
15032
  ] }),
15023
15033
  /* @__PURE__ */ d.jsxs(
15024
- S,
15034
+ C,
15025
15035
  {
15026
15036
  flexDirection: "row",
15027
15037
  gap: 2,
@@ -15285,7 +15295,7 @@ const cm = () => {
15285
15295
  const a = await ra.getInstance().getStatus();
15286
15296
  t(a);
15287
15297
  })();
15288
- }, [r]), /* @__PURE__ */ d.jsx(d.Fragment, { children: e.toolCount ? /* @__PURE__ */ d.jsxs(S, { paddingX: 1, children: [
15298
+ }, [r]), /* @__PURE__ */ d.jsx(d.Fragment, { children: e.toolCount ? /* @__PURE__ */ d.jsxs(C, { paddingX: 1, children: [
15289
15299
  /* @__PURE__ */ d.jsx(p, { color: "green", bold: !0, children: "MCP" }),
15290
15300
  /* @__PURE__ */ d.jsxs(p, { color: "cyan", children: [
15291
15301
  " ",
@@ -15294,8 +15304,8 @@ const cm = () => {
15294
15304
  ] }) : /* @__PURE__ */ d.jsx(d.Fragment, {}) });
15295
15305
  }, lm = ({}) => {
15296
15306
  const { extraParams: e, compactMode: t } = be(), { currentChatId: r, renderMessages: s } = ce(), { loading: a } = ce(), n = process.env.YOLO_MODE === "true", o = (s?.length || 0) > 100;
15297
- return /* @__PURE__ */ d.jsx(S, { flexDirection: "column", width: "100%", children: /* @__PURE__ */ d.jsxs(S, { paddingX: 1, paddingY: 0, justifyContent: "space-between", width: "100%", children: [
15298
- /* @__PURE__ */ d.jsxs(S, { gap: 1, children: [
15307
+ return /* @__PURE__ */ d.jsx(C, { flexDirection: "column", width: "100%", children: /* @__PURE__ */ d.jsxs(C, { paddingX: 1, paddingY: 0, justifyContent: "space-between", width: "100%", children: [
15308
+ /* @__PURE__ */ d.jsxs(C, { gap: 1, children: [
15299
15309
  a && /* @__PURE__ */ d.jsxs(p, { color: "yellow", bold: !0, children: [
15300
15310
  /* @__PURE__ */ d.jsx(om, {}),
15301
15311
  /* @__PURE__ */ d.jsx(ln, { text: "LOADING" })
@@ -15325,7 +15335,7 @@ const cm = () => {
15325
15335
  ] }),
15326
15336
  /* @__PURE__ */ d.jsx(p, { color: "green", bold: !0, children: s.length })
15327
15337
  ] }),
15328
- /* @__PURE__ */ d.jsx(S, { children: /* @__PURE__ */ d.jsx(p, { dimColor: !0, children: r?.slice(0, 6) || "N/A" }) })
15338
+ /* @__PURE__ */ d.jsx(C, { children: /* @__PURE__ */ d.jsx(p, { dimColor: !0, children: r?.slice(0, 6) || "N/A" }) })
15329
15339
  ] }) });
15330
15340
  };
15331
15341
  function um({ filter: e, enabled: t = !0 }) {
@@ -15368,13 +15378,13 @@ const pt = {
15368
15378
  l.escape ? t() : l.return && r ? (e.status === "pickup" || e.status === "error" || e.status === "feedback") && r(e) : (l.backspace || l.delete) && s && s(e);
15369
15379
  });
15370
15380
  const a = e.status ? pt[e.status] : pt.pickup, n = e.status === "pickup" || e.status === "error" || e.status === "feedback", i = e.complexity ? hm[e.complexity] : null;
15371
- return /* @__PURE__ */ d.jsxs(S, { flexDirection: "column", paddingX: 1, children: [
15372
- /* @__PURE__ */ d.jsxs(S, { borderStyle: "single", paddingX: 1, marginBottom: 1, children: [
15381
+ return /* @__PURE__ */ d.jsxs(C, { flexDirection: "column", paddingX: 1, children: [
15382
+ /* @__PURE__ */ d.jsxs(C, { borderStyle: "single", paddingX: 1, marginBottom: 1, children: [
15373
15383
  /* @__PURE__ */ d.jsxs(p, { bold: !0, color: "cyan", children: [
15374
15384
  a.emoji,
15375
15385
  " 任务预览"
15376
15386
  ] }),
15377
- /* @__PURE__ */ d.jsx(S, { flexGrow: 1 }),
15387
+ /* @__PURE__ */ d.jsx(C, { flexGrow: 1 }),
15378
15388
  n && r && /* @__PURE__ */ d.jsx(p, { color: "green", children: "Enter 执行" }),
15379
15389
  s && /* @__PURE__ */ d.jsxs(d.Fragment, { children: [
15380
15390
  n && r && /* @__PURE__ */ d.jsx(p, { dimColor: !0, children: " | " }),
@@ -15383,8 +15393,8 @@ const pt = {
15383
15393
  /* @__PURE__ */ d.jsx(p, { dimColor: !0, children: " | " }),
15384
15394
  /* @__PURE__ */ d.jsx(p, { dimColor: !0, children: "Esc 退出" })
15385
15395
  ] }),
15386
- /* @__PURE__ */ d.jsx(S, { marginBottom: 1, children: /* @__PURE__ */ d.jsx(p, { bold: !0, color: "white", children: e.title }) }),
15387
- /* @__PURE__ */ d.jsxs(S, { marginBottom: 1, children: [
15396
+ /* @__PURE__ */ d.jsx(C, { marginBottom: 1, children: /* @__PURE__ */ d.jsx(p, { bold: !0, color: "white", children: e.title }) }),
15397
+ /* @__PURE__ */ d.jsxs(C, { marginBottom: 1, children: [
15388
15398
  /* @__PURE__ */ d.jsxs(p, { color: a.color, children: [
15389
15399
  a.emoji,
15390
15400
  " ",
@@ -15406,31 +15416,31 @@ const pt = {
15406
15416
  ] })
15407
15417
  ] })
15408
15418
  ] }),
15409
- /* @__PURE__ */ d.jsxs(S, { marginBottom: 1, flexDirection: "column", children: [
15419
+ /* @__PURE__ */ d.jsxs(C, { marginBottom: 1, flexDirection: "column", children: [
15410
15420
  /* @__PURE__ */ d.jsx(p, { color: "gray", bold: !0, children: "描述:" }),
15411
15421
  /* @__PURE__ */ d.jsx(p, { children: e.description })
15412
15422
  ] }),
15413
- /* @__PURE__ */ d.jsxs(S, { marginBottom: 1, children: [
15423
+ /* @__PURE__ */ d.jsxs(C, { marginBottom: 1, children: [
15414
15424
  /* @__PURE__ */ d.jsx(p, { color: "gray", children: "ID: " }),
15415
15425
  /* @__PURE__ */ d.jsx(p, { dimColor: !0, children: e.id })
15416
15426
  ] }),
15417
- e.agentType && /* @__PURE__ */ d.jsxs(S, { marginBottom: 1, children: [
15427
+ e.agentType && /* @__PURE__ */ d.jsxs(C, { marginBottom: 1, children: [
15418
15428
  /* @__PURE__ */ d.jsx(p, { color: "gray", children: "建议 Agent: " }),
15419
15429
  /* @__PURE__ */ d.jsx(p, { color: "yellow", children: e.agentType })
15420
15430
  ] }),
15421
- e.assignedTo && /* @__PURE__ */ d.jsxs(S, { marginBottom: 1, children: [
15431
+ e.assignedTo && /* @__PURE__ */ d.jsxs(C, { marginBottom: 1, children: [
15422
15432
  /* @__PURE__ */ d.jsx(p, { color: "gray", children: "分配给: " }),
15423
15433
  /* @__PURE__ */ d.jsx(p, { color: "blue", children: e.assignedTo })
15424
15434
  ] }),
15425
- e.threadId && /* @__PURE__ */ d.jsxs(S, { marginBottom: 1, children: [
15435
+ e.threadId && /* @__PURE__ */ d.jsxs(C, { marginBottom: 1, children: [
15426
15436
  /* @__PURE__ */ d.jsx(p, { color: "gray", children: "Thread ID: " }),
15427
15437
  /* @__PURE__ */ d.jsx(p, { dimColor: !0, children: e.threadId })
15428
15438
  ] }),
15429
- e.dependencies && e.dependencies.length > 0 && /* @__PURE__ */ d.jsxs(S, { marginBottom: 1, flexDirection: "column", children: [
15439
+ e.dependencies && e.dependencies.length > 0 && /* @__PURE__ */ d.jsxs(C, { marginBottom: 1, flexDirection: "column", children: [
15430
15440
  /* @__PURE__ */ d.jsx(p, { color: "gray", bold: !0, children: "依赖任务:" }),
15431
15441
  /* @__PURE__ */ d.jsx(p, { dimColor: !0, children: e.dependencies.join(", ") })
15432
15442
  ] }),
15433
- e.acceptanceCriteria && e.acceptanceCriteria.length > 0 && /* @__PURE__ */ d.jsxs(S, { marginBottom: 1, flexDirection: "column", children: [
15443
+ e.acceptanceCriteria && e.acceptanceCriteria.length > 0 && /* @__PURE__ */ d.jsxs(C, { marginBottom: 1, flexDirection: "column", children: [
15434
15444
  /* @__PURE__ */ d.jsx(p, { color: "gray", bold: !0, children: "验收标准:" }),
15435
15445
  e.acceptanceCriteria.map((o, l) => /* @__PURE__ */ d.jsxs(p, { dimColor: !0, children: [
15436
15446
  l + 1,
@@ -15438,7 +15448,7 @@ const pt = {
15438
15448
  o
15439
15449
  ] }, l))
15440
15450
  ] }),
15441
- e.children && e.children.length > 0 && /* @__PURE__ */ d.jsxs(S, { flexDirection: "column", children: [
15451
+ e.children && e.children.length > 0 && /* @__PURE__ */ d.jsxs(C, { flexDirection: "column", children: [
15442
15452
  /* @__PURE__ */ d.jsxs(p, { color: "gray", bold: !0, children: [
15443
15453
  "子任务 (",
15444
15454
  e.children.length,
@@ -15446,7 +15456,7 @@ const pt = {
15446
15456
  ] }),
15447
15457
  e.children.map((o, l) => {
15448
15458
  const c = o.status ? pt[o.status] : pt.pickup;
15449
- return /* @__PURE__ */ d.jsx(S, { children: /* @__PURE__ */ d.jsxs(p, { color: c.color, children: [
15459
+ return /* @__PURE__ */ d.jsx(C, { children: /* @__PURE__ */ d.jsxs(p, { color: c.color, children: [
15450
15460
  c.emoji,
15451
15461
  " ",
15452
15462
  l + 1,
@@ -15455,7 +15465,7 @@ const pt = {
15455
15465
  ] }) }, o.id);
15456
15466
  })
15457
15467
  ] }),
15458
- e.status === "error" && e.error && /* @__PURE__ */ d.jsxs(S, { marginTop: 1, flexDirection: "column", borderStyle: "single", paddingX: 1, children: [
15468
+ e.status === "error" && e.error && /* @__PURE__ */ d.jsxs(C, { marginTop: 1, flexDirection: "column", borderStyle: "single", paddingX: 1, children: [
15459
15469
  /* @__PURE__ */ d.jsx(p, { color: "red", bold: !0, children: "错误:" }),
15460
15470
  /* @__PURE__ */ d.jsx(p, { color: "red", children: e.error.message })
15461
15471
  ] })
@@ -15487,7 +15497,7 @@ const pt = {
15487
15497
  [s]
15488
15498
  ), u = v.useCallback((g, _, y) => {
15489
15499
  const w = g.status ? tr[g.status] : tr.pickup, b = g.complexity ? mm[g.complexity] : null;
15490
- return /* @__PURE__ */ d.jsx(Er, { isSelected: y, children: /* @__PURE__ */ d.jsxs(S, { children: [
15500
+ return /* @__PURE__ */ d.jsx(Er, { isSelected: y, children: /* @__PURE__ */ d.jsxs(C, { children: [
15491
15501
  /* @__PURE__ */ d.jsxs(p, { color: "cyan", dimColor: w === tr.complete, children: [
15492
15502
  w.emoji,
15493
15503
  " ",
@@ -15504,8 +15514,8 @@ const pt = {
15504
15514
  ] })
15505
15515
  ] }) }, g.id);
15506
15516
  }, []), h = v.useCallback((g) => {
15507
- const _ = g.filter((C) => C.status === "running").length, y = g.filter((C) => C.status === "complete").length, w = g.filter((C) => C.status === "error").length, b = g.filter(
15508
- (C) => C.status === "pickup" || C.status === "error" || C.status === "feedback"
15517
+ const _ = g.filter((S) => S.status === "running").length, y = g.filter((S) => S.status === "complete").length, w = g.filter((S) => S.status === "error").length, b = g.filter(
15518
+ (S) => S.status === "pickup" || S.status === "error" || S.status === "feedback"
15509
15519
  ).length;
15510
15520
  return /* @__PURE__ */ d.jsxs(p, { color: "gray", children: [
15511
15521
  "运行: ",
@@ -15677,10 +15687,10 @@ const ym = async () => {
15677
15687
  bm().catch(() => [])
15678
15688
  ])).flat(), wm = () => {
15679
15689
  const { renderMessages: e, loading: t, inChatError: r, isFELocking: s } = ce(), { compactMode: a } = be(), n = e;
15680
- return /* @__PURE__ */ d.jsxs(S, { flexDirection: "column", flexGrow: 1, paddingX: 0, paddingY: 0, children: [
15690
+ return /* @__PURE__ */ d.jsxs(C, { flexDirection: "column", flexGrow: 1, paddingX: 0, paddingY: 0, children: [
15681
15691
  n.length === 0 && /* @__PURE__ */ d.jsx(vd, {}),
15682
15692
  a ? /* @__PURE__ */ d.jsx(Mc, { renderMessages: n, startIndex: 0 }) : /* @__PURE__ */ d.jsx(Ac, { renderMessages: n, startIndex: 0 }),
15683
- r && /* @__PURE__ */ d.jsx(S, { marginTop: 0, paddingLeft: 1, children: /* @__PURE__ */ d.jsxs(p, { color: "red", children: [
15693
+ r && /* @__PURE__ */ d.jsx(C, { marginTop: 0, paddingLeft: 1, children: /* @__PURE__ */ d.jsxs(p, { color: "red", children: [
15684
15694
  "❌ ",
15685
15695
  JSON.stringify(r)
15686
15696
  ] }) })
@@ -15720,7 +15730,7 @@ const ym = async () => {
15720
15730
  }
15721
15731
  };
15722
15732
  return /* @__PURE__ */ d.jsxs(
15723
- S,
15733
+ C,
15724
15734
  {
15725
15735
  flexDirection: "column",
15726
15736
  paddingX: 0,
@@ -15790,7 +15800,7 @@ const ym = async () => {
15790
15800
  f("task");
15791
15801
  }, []), b = v.useCallback(() => {
15792
15802
  console.clear(), f("chat"), u.focus("global-input");
15793
- }, [u]), C = (I) => {
15803
+ }, [u]), S = (I) => {
15794
15804
  let E = `# 任务:${I.title}
15795
15805
 
15796
15806
  `;
@@ -15827,7 +15837,7 @@ ${P.acceptanceCriteria.map(($) => `- ${$}`).join(`
15827
15837
  const P = [
15828
15838
  {
15829
15839
  type: "human",
15830
- content: `${C(I)}
15840
+ content: `${S(I)}
15831
15841
 
15832
15842
  请你先写一个 TODO LIST 然后开始这个任务,最后完成任务的时候,使用 commit_task`
15833
15843
  }
@@ -15846,11 +15856,11 @@ ${P.acceptanceCriteria.map(($) => `- ${$}`).join(`
15846
15856
  },
15847
15857
  [o, e, b]
15848
15858
  ), { hasPendingInteractions: x } = Ot();
15849
- return /* @__PURE__ */ d.jsxs(S, { flexDirection: "column", width: "100%", children: [
15850
- /* @__PURE__ */ d.jsxs(S, { flexGrow: 1, flexDirection: "row", children: [
15851
- h === "chat" && /* @__PURE__ */ d.jsxs(S, { flexDirection: "column", flexGrow: 1, children: [
15859
+ return /* @__PURE__ */ d.jsxs(C, { flexDirection: "column", width: "100%", children: [
15860
+ /* @__PURE__ */ d.jsxs(C, { flexGrow: 1, flexDirection: "row", children: [
15861
+ h === "chat" && /* @__PURE__ */ d.jsxs(C, { flexDirection: "column", flexGrow: 1, children: [
15852
15862
  /* @__PURE__ */ d.jsx(wm, {}, i),
15853
- x ? /* @__PURE__ */ d.jsx(S, { paddingX: 0, paddingY: 0, children: /* @__PURE__ */ d.jsx(Dd, {}) }) : /* @__PURE__ */ d.jsx(
15863
+ x ? /* @__PURE__ */ d.jsx(C, { paddingX: 0, paddingY: 0, children: /* @__PURE__ */ d.jsx(Dd, {}) }) : /* @__PURE__ */ d.jsx(
15854
15864
  xm,
15855
15865
  {
15856
15866
  switchToHistory: m,