@ash-cloud/ash-ai 0.1.8 → 0.1.10

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,7 +1,7 @@
1
1
  var it = Object.defineProperty;
2
2
  var at = (e, n, r) => n in e ? it(e, n, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[n] = r;
3
3
  var ee = (e, n, r) => at(e, typeof n != "symbol" ? n + "" : n, r);
4
- import { lazy as lt, createContext as Ge, useState as N, useRef as O, useEffect as j, useCallback as B, useMemo as re, useContext as Je, Suspense as ot, Fragment as Le } from "react";
4
+ import { lazy as lt, createContext as Ge, useState as N, useRef as B, useEffect as j, useCallback as O, useMemo as re, useContext as Je, Suspense as ot, Fragment as Le } from "react";
5
5
  import { jsxs as i, jsx as t, Fragment as _ } from "react/jsx-runtime";
6
6
  function ct(e) {
7
7
  if (e.startsWith("mcp__")) {
@@ -208,7 +208,7 @@ function ft(e) {
208
208
  success: !0
209
209
  };
210
210
  }
211
- function tr(e) {
211
+ function nr(e) {
212
212
  const n = ut(e.name, e.input), r = ht(e.name, e.input, n);
213
213
  return {
214
214
  id: e.id,
@@ -220,7 +220,7 @@ function tr(e) {
220
220
  startedAt: (/* @__PURE__ */ new Date()).toISOString()
221
221
  };
222
222
  }
223
- function nr(e, n, r) {
223
+ function rr(e, n, r) {
224
224
  const s = { ...e }, a = { ...e.actionType };
225
225
  if (s.status = r ? "failed" : "success", s.completedAt = (/* @__PURE__ */ new Date()).toISOString(), s.isError = r, s.output = n, a.action === "command_run") {
226
226
  const l = ft(n);
@@ -228,7 +228,7 @@ function nr(e, n, r) {
228
228
  } else (a.action === "mcp_tool" || a.action === "generic_tool") && (a.result = pt(n));
229
229
  return s.actionType = a, s;
230
230
  }
231
- function rr(e) {
231
+ function sr(e) {
232
232
  switch (e.action) {
233
233
  case "command_run":
234
234
  return "terminal";
@@ -288,7 +288,7 @@ function Ue(e) {
288
288
  return "Tool";
289
289
  }
290
290
  }
291
- function sr(e) {
291
+ function ir(e) {
292
292
  return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
293
293
  }
294
294
  function De(e) {
@@ -310,7 +310,7 @@ function He(e, n) {
310
310
  const c = Math.floor(l / 60), h = l % 60;
311
311
  return h === 0 ? `${c}m` : `${c}m ${h}s`;
312
312
  }
313
- function ir(e, n) {
313
+ function ar(e, n) {
314
314
  return e.length <= n ? e : e.substring(0, n - 3) + "...";
315
315
  }
316
316
  function p(...e) {
@@ -367,7 +367,7 @@ function wt(e) {
367
367
  }
368
368
  return null;
369
369
  }
370
- function ar({ className: e }) {
370
+ function lr({ className: e }) {
371
371
  return /* @__PURE__ */ i("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
372
372
  /* @__PURE__ */ t("circle", { cx: "12", cy: "12", r: "5" }),
373
373
  /* @__PURE__ */ t("line", { x1: "12", y1: "1", x2: "12", y2: "3" }),
@@ -380,7 +380,7 @@ function ar({ className: e }) {
380
380
  /* @__PURE__ */ t("line", { x1: "18.36", y1: "5.64", x2: "19.78", y2: "4.22" })
381
381
  ] });
382
382
  }
383
- function lr({ className: e }) {
383
+ function or({ className: e }) {
384
384
  return /* @__PURE__ */ t("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ t("path", { d: "M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z" }) });
385
385
  }
386
386
  function je({ className: e }) {
@@ -389,10 +389,10 @@ function je({ className: e }) {
389
389
  function ve({ className: e }) {
390
390
  return /* @__PURE__ */ t("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ t("polyline", { points: "9 18 15 12 9 6" }) });
391
391
  }
392
- function or({ className: e }) {
392
+ function cr({ className: e }) {
393
393
  return /* @__PURE__ */ t("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ t("polyline", { points: "15 18 9 12 15 6" }) });
394
394
  }
395
- function cr({ className: e }) {
395
+ function dr({ className: e }) {
396
396
  return /* @__PURE__ */ t("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ t("polyline", { points: "18 15 12 9 6 15" }) });
397
397
  }
398
398
  function Me({ className: e }) {
@@ -409,7 +409,7 @@ function We({ className: e }) {
409
409
  /* @__PURE__ */ t("line", { x1: "16", y1: "17", x2: "8", y2: "17" })
410
410
  ] });
411
411
  }
412
- function Be({ className: e }) {
412
+ function Oe({ className: e }) {
413
413
  return /* @__PURE__ */ i("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
414
414
  /* @__PURE__ */ t("path", { d: "M11 4H4a2 2 0 0 0-2 2v14a2 2 0 0 0 2 2h14a2 2 0 0 0 2-2v-7" }),
415
415
  /* @__PURE__ */ t("path", { d: "M18.5 2.5a2.121 2.121 0 0 1 3 3L12 15l-4 1 1-4 9.5-9.5z" })
@@ -453,13 +453,13 @@ function kt({ className: e }) {
453
453
  /* @__PURE__ */ t("line", { x1: "15", y1: "16", x2: "17", y2: "18" })
454
454
  ] });
455
455
  }
456
- function dr({ className: e }) {
456
+ function ur({ className: e }) {
457
457
  return /* @__PURE__ */ i("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
458
458
  /* @__PURE__ */ t("polyline", { points: "16 18 22 12 16 6" }),
459
459
  /* @__PURE__ */ t("polyline", { points: "8 6 2 12 8 18" })
460
460
  ] });
461
461
  }
462
- function ur({ className: e }) {
462
+ function hr({ className: e }) {
463
463
  return /* @__PURE__ */ i("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
464
464
  /* @__PURE__ */ t("rect", { x: "9", y: "9", width: "13", height: "13", rx: "2", ry: "2" }),
465
465
  /* @__PURE__ */ t("path", { d: "M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1" })
@@ -468,7 +468,7 @@ function ur({ className: e }) {
468
468
  function Ct({ className: e }) {
469
469
  return /* @__PURE__ */ t("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ t("polyline", { points: "20 6 9 17 4 12" }) });
470
470
  }
471
- function hr({ className: e }) {
471
+ function mr({ className: e }) {
472
472
  return /* @__PURE__ */ i("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
473
473
  /* @__PURE__ */ t("line", { x1: "18", y1: "6", x2: "6", y2: "18" }),
474
474
  /* @__PURE__ */ t("line", { x1: "6", y1: "6", x2: "18", y2: "18" })
@@ -518,13 +518,13 @@ function Mt({ className: e }) {
518
518
  /* @__PURE__ */ t("path", { d: "M12 2v4" })
519
519
  ] });
520
520
  }
521
- function It({ className: e }) {
521
+ function Et({ className: e }) {
522
522
  return /* @__PURE__ */ i("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
523
523
  /* @__PURE__ */ t("circle", { cx: "12", cy: "12", r: "10" }),
524
524
  /* @__PURE__ */ t("path", { d: "M9 12l2 2 4-4" })
525
525
  ] });
526
526
  }
527
- function mr({ className: e }) {
527
+ function It({ className: e }) {
528
528
  return /* @__PURE__ */ i("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
529
529
  /* @__PURE__ */ t("circle", { cx: "12", cy: "12", r: "10" }),
530
530
  /* @__PURE__ */ t("line", { x1: "15", y1: "9", x2: "9", y2: "15" }),
@@ -537,7 +537,7 @@ function pr({ className: e }) {
537
537
  /* @__PURE__ */ t("polygon", { points: "22 2 15 22 11 13 2 9 22 2" })
538
538
  ] });
539
539
  }
540
- function Et({ className: e }) {
540
+ function Lt({ className: e }) {
541
541
  return /* @__PURE__ */ t("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ t("path", { d: "M21.44 11.05l-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.83-2.83l8.49-8.48" }) });
542
542
  }
543
543
  function fr({ className: e }) {
@@ -549,7 +549,7 @@ function fr({ className: e }) {
549
549
  function xr({ className: e }) {
550
550
  return /* @__PURE__ */ t("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ t("path", { d: "M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z" }) });
551
551
  }
552
- function Lt({ className: e }) {
552
+ function $t({ className: e }) {
553
553
  return /* @__PURE__ */ i("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
554
554
  /* @__PURE__ */ t("path", { d: "M12 3l1.5 4.5L18 9l-4.5 1.5L12 15l-1.5-4.5L6 9l4.5-1.5L12 3z" }),
555
555
  /* @__PURE__ */ t("path", { d: "M5 19l.5 1.5L7 21l-1.5.5L5 23l-.5-1.5L3 21l1.5-.5L5 19z" }),
@@ -572,16 +572,16 @@ function de({ className: e }) {
572
572
  /* @__PURE__ */ t("path", { d: "M15 13v2" })
573
573
  ] });
574
574
  }
575
- function $t({ className: e }) {
575
+ function At({ className: e }) {
576
576
  return /* @__PURE__ */ i("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
577
577
  /* @__PURE__ */ t("path", { d: "M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2" }),
578
578
  /* @__PURE__ */ t("circle", { cx: "12", cy: "7", r: "4" })
579
579
  ] });
580
580
  }
581
- function At({ className: e }) {
581
+ function Rt({ className: e }) {
582
582
  return /* @__PURE__ */ t("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ t("circle", { cx: "12", cy: "12", r: "10" }) });
583
583
  }
584
- function Rt({ className: e }) {
584
+ function Dt({ className: e }) {
585
585
  return /* @__PURE__ */ i("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
586
586
  /* @__PURE__ */ t("path", { d: "M10 6h11" }),
587
587
  /* @__PURE__ */ t("path", { d: "M10 12h11" }),
@@ -591,7 +591,7 @@ function Rt({ className: e }) {
591
591
  /* @__PURE__ */ t("path", { d: "M3 18l2 2 4-4" })
592
592
  ] });
593
593
  }
594
- function Dt({ className: e }) {
594
+ function jt({ className: e }) {
595
595
  return /* @__PURE__ */ i("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
596
596
  /* @__PURE__ */ t("circle", { cx: "12", cy: "12", r: "10" }),
597
597
  /* @__PURE__ */ t("polyline", { points: "12 6 12 12 16 14" })
@@ -600,7 +600,7 @@ function Dt({ className: e }) {
600
600
  function qe({ className: e }) {
601
601
  return /* @__PURE__ */ t("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ t("path", { d: "M21 12a9 9 0 1 1-6.219-8.56" }) });
602
602
  }
603
- function jt({ status: e, size: n = "sm", className: r }) {
603
+ function Wt({ status: e, size: n = "sm", className: r }) {
604
604
  const s = {
605
605
  sm: "w-2 h-2",
606
606
  md: "w-3 h-3",
@@ -629,7 +629,7 @@ function Ye({ actionType: e, className: n = "w-4 h-4" }) {
629
629
  case "file_read":
630
630
  return /* @__PURE__ */ t(We, { className: n });
631
631
  case "file_edit":
632
- return /* @__PURE__ */ t(Be, { className: n });
632
+ return /* @__PURE__ */ t(Oe, { className: n });
633
633
  case "file_write":
634
634
  return /* @__PURE__ */ t(vt, { className: n });
635
635
  case "search":
@@ -643,7 +643,7 @@ function Ye({ actionType: e, className: n = "w-4 h-4" }) {
643
643
  case "mcp_tool":
644
644
  return /* @__PURE__ */ t(bt, { className: n });
645
645
  case "todo_write":
646
- return /* @__PURE__ */ t(Rt, { className: n });
646
+ return /* @__PURE__ */ t(Dt, { className: n });
647
647
  case "agent_tool":
648
648
  return /* @__PURE__ */ t(de, { className: n });
649
649
  case "generic_tool":
@@ -704,7 +704,7 @@ function Ze({
704
704
  className: r,
705
705
  depth: s = 0
706
706
  }) {
707
- const [a, l] = N(n), [c, h] = N(""), o = O(null), { actionType: w, status: d, summary: m, nestedToolCalls: g, nestedToolCallCount: v, startedAt: S } = e, z = re(() => {
707
+ const [a, l] = N(n), [c, h] = N(""), o = B(null), { actionType: w, status: d, summary: m, nestedToolCalls: g, nestedToolCallCount: v, startedAt: S } = e, z = re(() => {
708
708
  if (w.action !== "agent_tool")
709
709
  return null;
710
710
  const P = w;
@@ -724,7 +724,7 @@ function Ze({
724
724
  k || (o.current && (clearInterval(o.current), o.current = null), h(""));
725
725
  }, [k, S]), !z)
726
726
  return null;
727
- const { agentType: A, description: E, prompt: W } = z, F = s > 0 ? "ml-4" : "";
727
+ const { agentType: A, description: I, prompt: W } = z, F = s > 0 ? "ml-4" : "";
728
728
  return /* @__PURE__ */ i(
729
729
  "div",
730
730
  {
@@ -783,14 +783,14 @@ function Ze({
783
783
  children: A
784
784
  }
785
785
  ),
786
- /* @__PURE__ */ t("span", { className: "text-sm text-white/80 truncate flex-1 text-left", children: E || m }),
786
+ /* @__PURE__ */ t("span", { className: "text-sm text-white/80 truncate flex-1 text-left", children: I || m }),
787
787
  M > 0 && /* @__PURE__ */ i("span", { className: "text-xs text-white/50 shrink-0", children: [
788
788
  M,
789
789
  " tool call",
790
790
  M !== 1 ? "s" : ""
791
791
  ] }),
792
792
  k && c && /* @__PURE__ */ i("div", { className: "flex items-center gap-1 text-xs text-white/40 shrink-0", children: [
793
- /* @__PURE__ */ t(Dt, { className: "w-3 h-3" }),
793
+ /* @__PURE__ */ t(jt, { className: "w-3 h-3" }),
794
794
  /* @__PURE__ */ t("span", { children: c })
795
795
  ] }),
796
796
  /* @__PURE__ */ t("span", { className: "text-white/30 shrink-0", children: "..." })
@@ -807,7 +807,7 @@ function Ze({
807
807
  depth: s + 1
808
808
  }
809
809
  ) : /* @__PURE__ */ t(
810
- Oe,
810
+ Be,
811
811
  {
812
812
  toolCall: P,
813
813
  defaultExpanded: !1
@@ -829,7 +829,7 @@ function L({ children: e }) {
829
829
  function $({ children: e }) {
830
830
  return /* @__PURE__ */ t("div", { className: "px-3 py-2", children: e });
831
831
  }
832
- function Wt({ action: e }) {
832
+ function Ot({ action: e }) {
833
833
  var n;
834
834
  return /* @__PURE__ */ i(_, { children: [
835
835
  e.command && /* @__PURE__ */ i(_, { children: [
@@ -867,7 +867,7 @@ function Bt({ action: e }) {
867
867
  ] })
868
868
  ] });
869
869
  }
870
- function Ot({ action: e }) {
870
+ function zt({ action: e }) {
871
871
  return /* @__PURE__ */ i(_, { children: [
872
872
  /* @__PURE__ */ t(L, { children: "PATH" }),
873
873
  /* @__PURE__ */ t($, { children: /* @__PURE__ */ t("code", { className: "text-xs font-mono bg-white/10 text-white/90 px-1 py-0.5 rounded", children: e.path }) }),
@@ -881,7 +881,7 @@ function Ot({ action: e }) {
881
881
  ] })
882
882
  ] });
883
883
  }
884
- function zt({ action: e }) {
884
+ function Ft({ action: e }) {
885
885
  return /* @__PURE__ */ i(_, { children: [
886
886
  /* @__PURE__ */ t(L, { children: "PATH" }),
887
887
  /* @__PURE__ */ t($, { children: /* @__PURE__ */ t("code", { className: "text-xs font-mono bg-white/10 text-white/90 px-1 py-0.5 rounded", children: e.path }) }),
@@ -891,7 +891,7 @@ function zt({ action: e }) {
891
891
  ] })
892
892
  ] });
893
893
  }
894
- function Ft({ action: e }) {
894
+ function Pt({ action: e }) {
895
895
  return /* @__PURE__ */ i(_, { children: [
896
896
  /* @__PURE__ */ t(L, { children: "PATTERN" }),
897
897
  /* @__PURE__ */ i($, { children: [
@@ -913,7 +913,7 @@ function Ft({ action: e }) {
913
913
  ] })
914
914
  ] });
915
915
  }
916
- function Pt({ action: e }) {
916
+ function Ht({ action: e }) {
917
917
  return /* @__PURE__ */ i(_, { children: [
918
918
  /* @__PURE__ */ t(L, { children: "PATTERN" }),
919
919
  /* @__PURE__ */ i($, { children: [
@@ -925,7 +925,7 @@ function Pt({ action: e }) {
925
925
  ] })
926
926
  ] });
927
927
  }
928
- function Ht({ action: e }) {
928
+ function qt({ action: e }) {
929
929
  return /* @__PURE__ */ i(_, { children: [
930
930
  /* @__PURE__ */ t(L, { children: "URL" }),
931
931
  /* @__PURE__ */ i($, { children: [
@@ -943,13 +943,13 @@ function Ht({ action: e }) {
943
943
  ] })
944
944
  ] });
945
945
  }
946
- function qt({ action: e }) {
946
+ function Vt({ action: e }) {
947
947
  return /* @__PURE__ */ i(_, { children: [
948
948
  /* @__PURE__ */ t(L, { children: "QUERY" }),
949
949
  /* @__PURE__ */ t($, { children: /* @__PURE__ */ t("span", { className: "text-sm text-white/90", children: e.query }) })
950
950
  ] });
951
951
  }
952
- function Vt({ action: e }) {
952
+ function Gt({ action: e, isError: n }) {
953
953
  return /* @__PURE__ */ i(_, { children: [
954
954
  /* @__PURE__ */ t(L, { children: "TOOL" }),
955
955
  /* @__PURE__ */ t($, { children: /* @__PURE__ */ i("code", { className: "text-xs font-mono bg-white/10 text-white/90 px-1 py-0.5 rounded", children: [
@@ -962,24 +962,24 @@ function Vt({ action: e }) {
962
962
  /* @__PURE__ */ t($, { children: /* @__PURE__ */ t(Te, { value: e.arguments }) })
963
963
  ] }),
964
964
  e.result && /* @__PURE__ */ i(_, { children: [
965
- /* @__PURE__ */ t(L, { children: "RESULT" }),
966
- /* @__PURE__ */ t($, { children: e.result.type === "markdown" ? /* @__PURE__ */ t(se, { children: String(e.result.value) }) : /* @__PURE__ */ t(Te, { value: e.result.value }) })
965
+ /* @__PURE__ */ t(L, { children: n ? "ERROR" : "RESULT" }),
966
+ /* @__PURE__ */ t($, { children: /* @__PURE__ */ t("div", { className: n ? "text-red-400" : "", children: e.result.type === "markdown" ? /* @__PURE__ */ t(se, { children: String(e.result.value) }) : /* @__PURE__ */ t(Te, { value: e.result.value }) }) })
967
967
  ] })
968
968
  ] });
969
969
  }
970
- function Gt({ action: e }) {
970
+ function Jt({ action: e, isError: n }) {
971
971
  return /* @__PURE__ */ i(_, { children: [
972
972
  e.arguments && /* @__PURE__ */ i(_, { children: [
973
973
  /* @__PURE__ */ t(L, { children: "ARGS" }),
974
974
  /* @__PURE__ */ t($, { children: /* @__PURE__ */ t(Te, { value: e.arguments }) })
975
975
  ] }),
976
976
  e.result && /* @__PURE__ */ i(_, { children: [
977
- /* @__PURE__ */ t(L, { children: "RESULT" }),
978
- /* @__PURE__ */ t($, { children: e.result.type === "markdown" ? /* @__PURE__ */ t(se, { children: String(e.result.value) }) : /* @__PURE__ */ t(Te, { value: e.result.value }) })
977
+ /* @__PURE__ */ t(L, { children: n ? "ERROR" : "RESULT" }),
978
+ /* @__PURE__ */ t($, { children: /* @__PURE__ */ t("div", { className: n ? "text-red-400" : "", children: e.result.type === "markdown" ? /* @__PURE__ */ t(se, { children: String(e.result.value) }) : /* @__PURE__ */ t(Te, { value: e.result.value }) }) })
979
979
  ] })
980
980
  ] });
981
981
  }
982
- function Jt({ action: e }) {
982
+ function Ut({ action: e }) {
983
983
  const { todos: n, stats: r } = e;
984
984
  return /* @__PURE__ */ i(_, { children: [
985
985
  r && /* @__PURE__ */ i(_, { children: [
@@ -1023,7 +1023,7 @@ function Jt({ action: e }) {
1023
1023
  s.status === "in_progress" && "bg-yellow-500/10 -mx-2 px-2 rounded"
1024
1024
  ),
1025
1025
  children: [
1026
- s.status === "completed" ? /* @__PURE__ */ t(It, { className: "w-4 h-4 text-emerald-400 shrink-0 mt-0.5" }) : s.status === "in_progress" ? /* @__PURE__ */ t(_t, { className: "w-4 h-4 text-yellow-400 animate-spin shrink-0 mt-0.5" }) : /* @__PURE__ */ t(At, { className: "w-4 h-4 text-white/30 shrink-0 mt-0.5" }),
1026
+ s.status === "completed" ? /* @__PURE__ */ t(Et, { className: "w-4 h-4 text-emerald-400 shrink-0 mt-0.5" }) : s.status === "in_progress" ? /* @__PURE__ */ t(_t, { className: "w-4 h-4 text-yellow-400 animate-spin shrink-0 mt-0.5" }) : /* @__PURE__ */ t(Rt, { className: "w-4 h-4 text-white/30 shrink-0 mt-0.5" }),
1027
1027
  /* @__PURE__ */ i(
1028
1028
  "span",
1029
1029
  {
@@ -1047,35 +1047,35 @@ function Jt({ action: e }) {
1047
1047
  }) }) })
1048
1048
  ] });
1049
1049
  }
1050
- function Ut({ actionType: e }) {
1050
+ function Kt({ actionType: e, isError: n }) {
1051
1051
  switch (e.action) {
1052
1052
  case "command_run":
1053
- return /* @__PURE__ */ t(Wt, { action: e });
1053
+ return /* @__PURE__ */ t(Ot, { action: e });
1054
1054
  case "file_read":
1055
1055
  return /* @__PURE__ */ t(Bt, { action: e });
1056
1056
  case "file_edit":
1057
- return /* @__PURE__ */ t(Ot, { action: e });
1058
- case "file_write":
1059
1057
  return /* @__PURE__ */ t(zt, { action: e });
1060
- case "search":
1058
+ case "file_write":
1061
1059
  return /* @__PURE__ */ t(Ft, { action: e });
1062
- case "glob":
1060
+ case "search":
1063
1061
  return /* @__PURE__ */ t(Pt, { action: e });
1064
- case "web_fetch":
1062
+ case "glob":
1065
1063
  return /* @__PURE__ */ t(Ht, { action: e });
1066
- case "web_search":
1064
+ case "web_fetch":
1067
1065
  return /* @__PURE__ */ t(qt, { action: e });
1068
- case "mcp_tool":
1066
+ case "web_search":
1069
1067
  return /* @__PURE__ */ t(Vt, { action: e });
1068
+ case "mcp_tool":
1069
+ return /* @__PURE__ */ t(Gt, { action: e, isError: n });
1070
1070
  case "generic_tool":
1071
- return /* @__PURE__ */ t(Gt, { action: e });
1071
+ return /* @__PURE__ */ t(Jt, { action: e, isError: n });
1072
1072
  case "todo_write":
1073
- return /* @__PURE__ */ t(Jt, { action: e });
1073
+ return /* @__PURE__ */ t(Ut, { action: e });
1074
1074
  default:
1075
1075
  return null;
1076
1076
  }
1077
1077
  }
1078
- function Kt(e) {
1078
+ function Yt(e) {
1079
1079
  var n;
1080
1080
  switch (e.action) {
1081
1081
  case "command_run":
@@ -1107,7 +1107,7 @@ function Kt(e) {
1107
1107
  return !1;
1108
1108
  }
1109
1109
  }
1110
- function Oe({ toolCall: e, defaultExpanded: n = !1, className: r }) {
1110
+ function Be({ toolCall: e, defaultExpanded: n = !1, className: r }) {
1111
1111
  const [s, a] = N(n), { actionType: l, status: c, summary: h } = e;
1112
1112
  if (l.action === "agent_tool")
1113
1113
  return /* @__PURE__ */ t(
@@ -1118,7 +1118,7 @@ function Oe({ toolCall: e, defaultExpanded: n = !1, className: r }) {
1118
1118
  className: r
1119
1119
  }
1120
1120
  );
1121
- const o = Kt(l);
1121
+ const o = Yt(l);
1122
1122
  return /* @__PURE__ */ i(
1123
1123
  "div",
1124
1124
  {
@@ -1160,7 +1160,7 @@ function Oe({ toolCall: e, defaultExpanded: n = !1, className: r }) {
1160
1160
  /* @__PURE__ */ t("span", { className: "font-mono text-sm truncate text-white/60 min-w-0", children: h })
1161
1161
  ] }),
1162
1162
  /* @__PURE__ */ i("div", { className: "flex items-center gap-2 shrink-0", children: [
1163
- /* @__PURE__ */ t(jt, { status: c, size: "sm" }),
1163
+ /* @__PURE__ */ t(Wt, { status: c, size: "sm" }),
1164
1164
  o && /* @__PURE__ */ t(
1165
1165
  je,
1166
1166
  {
@@ -1175,24 +1175,28 @@ function Oe({ toolCall: e, defaultExpanded: n = !1, className: r }) {
1175
1175
  }
1176
1176
  ),
1177
1177
  s && o && /* @__PURE__ */ i("div", { className: "border-t border-white/5 max-h-[400px] overflow-y-auto ash-scrollbar bg-black/20", children: [
1178
- /* @__PURE__ */ t(Ut, { actionType: l }),
1178
+ /* @__PURE__ */ t(Kt, { actionType: l, isError: e.isError || c === "failed" }),
1179
1179
  c === "success" && /* @__PURE__ */ t("div", { className: "px-4 py-3 border-t border-white/5 bg-[var(--ash-accent)]/5", children: /* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
1180
1180
  /* @__PURE__ */ t(Ct, { className: "w-4 h-4 text-[var(--ash-accent)]" }),
1181
1181
  /* @__PURE__ */ t("span", { className: "text-sm text-[var(--ash-accent)] font-medium", children: "Completed successfully" })
1182
+ ] }) }),
1183
+ c === "failed" && /* @__PURE__ */ t("div", { className: "px-4 py-3 border-t border-red-500/20 bg-red-500/10", children: /* @__PURE__ */ i("div", { className: "flex items-center gap-2", children: [
1184
+ /* @__PURE__ */ t(It, { className: "w-4 h-4 text-red-400" }),
1185
+ /* @__PURE__ */ t("span", { className: "text-sm text-red-400 font-medium", children: "Tool call failed" })
1182
1186
  ] }) })
1183
1187
  ] })
1184
1188
  ]
1185
1189
  }
1186
1190
  );
1187
1191
  }
1188
- var Yt = lt(() => import("./index-DJwpy-R5.js"));
1192
+ var Zt = lt(() => import("./index-DJwpy-R5.js"));
1189
1193
  function ze({ children: e, fallback: n, className: r }) {
1190
1194
  const [s, a] = N(!1);
1191
1195
  return j(() => {
1192
1196
  a(!0);
1193
- }, []), s ? /* @__PURE__ */ t(ot, { fallback: /* @__PURE__ */ t("span", { className: r, children: n ?? e }), children: /* @__PURE__ */ t(Yt, { children: e }) }) : /* @__PURE__ */ t("span", { className: r, children: n ?? e });
1197
+ }, []), s ? /* @__PURE__ */ t(ot, { fallback: /* @__PURE__ */ t("span", { className: r, children: n ?? e }), children: /* @__PURE__ */ t(Zt, { children: e }) }) : /* @__PURE__ */ t("span", { className: r, children: n ?? e });
1194
1198
  }
1195
- function Zt({ segment: e }) {
1199
+ function Qt({ segment: e }) {
1196
1200
  const n = e.color ? `${e.color}20` : "rgba(34, 197, 94, 0.2)", r = e.color || "#22c55e", s = e.color ? `${e.color}40` : "rgba(34, 197, 94, 0.4)";
1197
1201
  return /* @__PURE__ */ i(
1198
1202
  "span",
@@ -1211,7 +1215,7 @@ function Zt({ segment: e }) {
1211
1215
  }
1212
1216
  );
1213
1217
  }
1214
- function Qt({
1218
+ function Xt({
1215
1219
  content: e,
1216
1220
  renderers: n,
1217
1221
  className: r
@@ -1222,7 +1226,7 @@ function Qt({
1222
1226
  case "text":
1223
1227
  return /* @__PURE__ */ t(Le, { children: /* @__PURE__ */ t(ze, { children: s.content }) }, l);
1224
1228
  case "mention":
1225
- return n != null && n.renderMention ? /* @__PURE__ */ t(Le, { children: n.renderMention({ segment: s }) }, l) : /* @__PURE__ */ t(Zt, { segment: s }, l);
1229
+ return n != null && n.renderMention ? /* @__PURE__ */ t(Le, { children: n.renderMention({ segment: s }) }, l) : /* @__PURE__ */ t(Qt, { segment: s }, l);
1226
1230
  case "component":
1227
1231
  return n != null && n.renderComponent ? /* @__PURE__ */ t(Le, { children: n.renderComponent({ segment: s }) }, l) : /* @__PURE__ */ i("code", { className: "text-xs text-orange-400", children: [
1228
1232
  "[component: ",
@@ -1234,7 +1238,7 @@ function Qt({
1234
1238
  }
1235
1239
  }) });
1236
1240
  }
1237
- function Xt({ options: e, onSelect: n, className: r }) {
1241
+ function en({ options: e, onSelect: n, className: r }) {
1238
1242
  return /* @__PURE__ */ t("div", { className: p("grid gap-2 mt-3", r), style: {
1239
1243
  gridTemplateColumns: "repeat(auto-fit, minmax(200px, 1fr))"
1240
1244
  }, children: e.map((s) => /* @__PURE__ */ i(
@@ -1282,7 +1286,7 @@ function Xt({ options: e, onSelect: n, className: r }) {
1282
1286
  s.id
1283
1287
  )) });
1284
1288
  }
1285
- function en(e) {
1289
+ function tn(e) {
1286
1290
  const n = "[Uploaded files available at /uploads/]", r = e.indexOf(n);
1287
1291
  if (r === -1)
1288
1292
  return { text: e, files: [] };
@@ -1290,14 +1294,14 @@ function en(e) {
1290
1294
  `).filter((c) => c.startsWith("- ")).map((c) => c.substring(2).trim());
1291
1295
  return { text: s, files: l };
1292
1296
  }
1293
- function tn({ entry: e, className: n }) {
1294
- const { text: r, files: s } = en(e.content);
1297
+ function nn({ entry: e, className: n }) {
1298
+ const { text: r, files: s } = tn(e.content);
1295
1299
  return /* @__PURE__ */ i("div", { className: p("flex gap-3 justify-end ash-animate-fade-in", n), children: [
1296
1300
  /* @__PURE__ */ i("div", { className: "max-w-[85%]", children: [
1297
1301
  /* @__PURE__ */ t("div", { className: "rounded-2xl p-4 bg-[var(--ash-accent)] text-[var(--ash-accent-foreground)]", children: /* @__PURE__ */ t("p", { className: "text-sm leading-relaxed whitespace-pre-wrap", children: r || "(files attached)" }) }),
1298
1302
  s.length > 0 && /* @__PURE__ */ i("div", { className: "mt-2 pt-2 border-t border-[var(--ash-accent-foreground)]/20", children: [
1299
1303
  /* @__PURE__ */ i("div", { className: "text-xs text-[var(--ash-accent-foreground)]/60 mb-1 flex items-center gap-1", children: [
1300
- /* @__PURE__ */ t(Et, { className: "w-3 h-3" }),
1304
+ /* @__PURE__ */ t(Lt, { className: "w-3 h-3" }),
1301
1305
  "Attached Files"
1302
1306
  ] }),
1303
1307
  /* @__PURE__ */ t("div", { className: "flex flex-wrap gap-1", children: s.map((a, l) => /* @__PURE__ */ t(
@@ -1312,10 +1316,10 @@ function tn({ entry: e, className: n }) {
1312
1316
  ] }),
1313
1317
  e.timestamp && /* @__PURE__ */ t("div", { className: "text-xs text-white/40 mt-2", children: De(e.timestamp) })
1314
1318
  ] }),
1315
- /* @__PURE__ */ t("div", { className: "w-7 h-7 rounded-full bg-white/10 flex items-center justify-center shrink-0", children: /* @__PURE__ */ t($t, { className: "w-4 h-4 text-white/50" }) })
1319
+ /* @__PURE__ */ t("div", { className: "w-7 h-7 rounded-full bg-white/10 flex items-center justify-center shrink-0", children: /* @__PURE__ */ t(At, { className: "w-4 h-4 text-white/50" }) })
1316
1320
  ] });
1317
1321
  }
1318
- function nn({
1322
+ function rn({
1319
1323
  entry: e,
1320
1324
  onOptionSelect: n,
1321
1325
  richContentRenderers: r,
@@ -1324,7 +1328,7 @@ function nn({
1324
1328
  const a = e.richContent ? null : wt(e.content), l = (h) => {
1325
1329
  n && n(`Option ${h.id}: ${h.label}`);
1326
1330
  }, c = (h) => e.richContent && e.richContent.length > 0 ? /* @__PURE__ */ t(
1327
- Qt,
1331
+ Xt,
1328
1332
  {
1329
1333
  content: e.richContent,
1330
1334
  renderers: r
@@ -1336,7 +1340,7 @@ function nn({
1336
1340
  /* @__PURE__ */ t("div", { className: "ash-card-glass rounded-2xl p-4", children: /* @__PURE__ */ t("div", { className: "ash-message-content prose prose-sm prose-invert max-w-none text-sm leading-relaxed", children: a ? /* @__PURE__ */ i(_, { children: [
1337
1341
  a.preamble && c(a.preamble),
1338
1342
  /* @__PURE__ */ t(
1339
- Xt,
1343
+ en,
1340
1344
  {
1341
1345
  options: a.options,
1342
1346
  onSelect: l
@@ -1347,22 +1351,22 @@ function nn({
1347
1351
  ] })
1348
1352
  ] });
1349
1353
  }
1350
- function rn({ entry: e, className: n }) {
1354
+ function sn({ entry: e, className: n }) {
1351
1355
  return /* @__PURE__ */ i("div", { className: p("flex gap-3 ash-animate-fade-in", n), children: [
1352
- /* @__PURE__ */ t("div", { className: "w-7 h-7 rounded-full bg-purple-500/20 flex items-center justify-center shrink-0", children: /* @__PURE__ */ t(Lt, { className: "w-4 h-4 text-purple-400" }) }),
1356
+ /* @__PURE__ */ t("div", { className: "w-7 h-7 rounded-full bg-purple-500/20 flex items-center justify-center shrink-0", children: /* @__PURE__ */ t($t, { className: "w-4 h-4 text-purple-400" }) }),
1353
1357
  /* @__PURE__ */ t("div", { className: "flex-1 max-w-[85%]", children: /* @__PURE__ */ i("div", { className: "rounded-2xl p-4 bg-purple-500/10 border border-purple-500/30", children: [
1354
1358
  /* @__PURE__ */ t("div", { className: "text-xs text-purple-400 mb-2 font-medium", children: "Thinking" }),
1355
1359
  /* @__PURE__ */ t("div", { className: "text-sm text-purple-300 italic opacity-80 whitespace-pre-wrap leading-relaxed", children: e.content })
1356
1360
  ] }) })
1357
1361
  ] });
1358
1362
  }
1359
- function sn({ entry: e, defaultExpanded: n = !1, className: r }) {
1363
+ function an({ entry: e, defaultExpanded: n = !1, className: r }) {
1360
1364
  return e.entryType.type !== "tool_call" ? null : /* @__PURE__ */ i("div", { className: p("flex gap-3 ash-animate-fade-in", r), children: [
1361
1365
  /* @__PURE__ */ t("div", { className: "w-7 h-7 rounded-full bg-[var(--ash-accent)]/20 flex items-center justify-center shrink-0", children: /* @__PURE__ */ t(de, { className: "w-4 h-4 text-[var(--ash-accent)]" }) }),
1362
- /* @__PURE__ */ t("div", { className: "flex-1", children: /* @__PURE__ */ t(Oe, { toolCall: e.entryType.toolCall, defaultExpanded: n }) })
1366
+ /* @__PURE__ */ t("div", { className: "flex-1", children: /* @__PURE__ */ t(Be, { toolCall: e.entryType.toolCall, defaultExpanded: n }) })
1363
1367
  ] });
1364
1368
  }
1365
- function an({ entry: e, className: n }) {
1369
+ function ln({ entry: e, className: n }) {
1366
1370
  return e.entryType.type !== "error" ? null : /* @__PURE__ */ i("div", { className: p("flex gap-3 ash-animate-fade-in", n), children: [
1367
1371
  /* @__PURE__ */ t("div", { className: "w-7 h-7 rounded-full bg-red-500/20 flex items-center justify-center shrink-0", children: /* @__PURE__ */ t(Ke, { className: "w-4 h-4 text-red-400" }) }),
1368
1372
  /* @__PURE__ */ t("div", { className: "flex-1 max-w-[85%]", children: /* @__PURE__ */ i("div", { className: "rounded-2xl p-4 bg-red-500/10 border border-red-500/30", children: [
@@ -1375,7 +1379,7 @@ function an({ entry: e, className: n }) {
1375
1379
  ] }) })
1376
1380
  ] });
1377
1381
  }
1378
- function ln({
1382
+ function on({
1379
1383
  entry: e,
1380
1384
  onOptionSelect: n,
1381
1385
  defaultExpanded: r,
@@ -1384,10 +1388,10 @@ function ln({
1384
1388
  }) {
1385
1389
  switch (e.entryType.type) {
1386
1390
  case "user_message":
1387
- return /* @__PURE__ */ t(tn, { entry: e, className: a });
1391
+ return /* @__PURE__ */ t(nn, { entry: e, className: a });
1388
1392
  case "assistant_message":
1389
1393
  return /* @__PURE__ */ t(
1390
- nn,
1394
+ rn,
1391
1395
  {
1392
1396
  entry: e,
1393
1397
  onOptionSelect: n,
@@ -1396,11 +1400,11 @@ function ln({
1396
1400
  }
1397
1401
  );
1398
1402
  case "thinking":
1399
- return /* @__PURE__ */ t(rn, { entry: e, className: a });
1403
+ return /* @__PURE__ */ t(sn, { entry: e, className: a });
1400
1404
  case "tool_call":
1401
- return /* @__PURE__ */ t(sn, { entry: e, defaultExpanded: r, className: a });
1405
+ return /* @__PURE__ */ t(an, { entry: e, defaultExpanded: r, className: a });
1402
1406
  case "error":
1403
- return /* @__PURE__ */ t(an, { entry: e, className: a });
1407
+ return /* @__PURE__ */ t(ln, { entry: e, className: a });
1404
1408
  default:
1405
1409
  return null;
1406
1410
  }
@@ -1448,7 +1452,7 @@ function $e({ variant: e = "dots", size: n = "md", className: r }) {
1448
1452
  /* @__PURE__ */ t("path", { d: "M12 2a10 10 0 0 1 10 10", strokeLinecap: "round" })
1449
1453
  ] }) });
1450
1454
  }
1451
- function on({
1455
+ function cn({
1452
1456
  content: e,
1453
1457
  isStreaming: n = !1,
1454
1458
  renderMarkdown: r = !0,
@@ -1462,7 +1466,7 @@ function on({
1462
1466
  n && /* @__PURE__ */ t($e, { variant: "cursor", size: "sm", className: "inline-block ml-0.5" })
1463
1467
  ] }) });
1464
1468
  }
1465
- function cn(e) {
1469
+ function dn(e) {
1466
1470
  switch (e.action) {
1467
1471
  case "file_read":
1468
1472
  case "file_edit":
@@ -1476,11 +1480,11 @@ function Qe(e) {
1476
1480
  const n = e.split("/");
1477
1481
  return n[n.length - 1] || e;
1478
1482
  }
1479
- function dn(e) {
1483
+ function un(e) {
1480
1484
  const n = Qe(e), r = n.lastIndexOf(".");
1481
1485
  return r === -1 ? null : n.slice(r + 1).toLowerCase();
1482
1486
  }
1483
- function un(e) {
1487
+ function hn(e) {
1484
1488
  switch (e.action) {
1485
1489
  case "file_edit": {
1486
1490
  const n = e;
@@ -1498,7 +1502,7 @@ function un(e) {
1498
1502
  return null;
1499
1503
  }
1500
1504
  }
1501
- function hn(e) {
1505
+ function mn(e) {
1502
1506
  switch (e) {
1503
1507
  case "ts":
1504
1508
  case "tsx":
@@ -1522,7 +1526,7 @@ function hn(e) {
1522
1526
  }
1523
1527
  }
1524
1528
  function Xe({ toolCall: e, showFullPath: n = !1, className: r }) {
1525
- const { actionType: s, status: a, summary: l } = e, c = Ue(s), h = cn(s), o = un(s), w = h ? n ? h : Qe(h) : null, d = h ? dn(h) : null, m = hn(d), g = !h && l;
1529
+ const { actionType: s, status: a, summary: l } = e, c = Ue(s), h = dn(s), o = hn(s), w = h ? n ? h : Qe(h) : null, d = h ? un(h) : null, m = mn(d), g = !h && l;
1526
1530
  return /* @__PURE__ */ i(
1527
1531
  "div",
1528
1532
  {
@@ -1574,11 +1578,11 @@ function Xe({ toolCall: e, showFullPath: n = !1, className: r }) {
1574
1578
  }
1575
1579
  );
1576
1580
  }
1577
- function mn(e) {
1581
+ function pn(e) {
1578
1582
  const n = e.split("/").pop() || e, r = n.lastIndexOf(".");
1579
1583
  return r === -1 ? null : n.slice(r + 1).toLowerCase();
1580
1584
  }
1581
- function pn(e) {
1585
+ function fn(e) {
1582
1586
  switch (e) {
1583
1587
  case "ts":
1584
1588
  case "tsx":
@@ -1601,7 +1605,7 @@ function pn(e) {
1601
1605
  return "";
1602
1606
  }
1603
1607
  }
1604
- function fn(e) {
1608
+ function xn(e) {
1605
1609
  switch (e) {
1606
1610
  case "ts":
1607
1611
  case "tsx":
@@ -1631,7 +1635,7 @@ function et({
1631
1635
  showOnlyFilename: s = !0,
1632
1636
  className: a
1633
1637
  }) {
1634
- const l = s && e.split("/").pop() || e, c = mn(e), h = pn(c), o = fn(c), w = n !== void 0 && n > 0 || r !== void 0 && r > 0;
1638
+ const l = s && e.split("/").pop() || e, c = pn(e), h = fn(c), o = xn(c), w = n !== void 0 && n > 0 || r !== void 0 && r > 0;
1635
1639
  return /* @__PURE__ */ i(
1636
1640
  "span",
1637
1641
  {
@@ -1657,7 +1661,7 @@ function et({
1657
1661
  }
1658
1662
  );
1659
1663
  }
1660
- function xn(e) {
1664
+ function gn(e) {
1661
1665
  const n = /* @__PURE__ */ new Map();
1662
1666
  for (const r of e) {
1663
1667
  const { actionType: s } = r;
@@ -1678,7 +1682,7 @@ function xn(e) {
1678
1682
  }
1679
1683
  return Array.from(n.values());
1680
1684
  }
1681
- function gn(e) {
1685
+ function wn(e) {
1682
1686
  const n = {};
1683
1687
  for (const r of e) {
1684
1688
  const s = r.actionType.action;
@@ -1686,13 +1690,13 @@ function gn(e) {
1686
1690
  }
1687
1691
  return n;
1688
1692
  }
1689
- function wn(e) {
1693
+ function vn(e) {
1690
1694
  switch (e) {
1691
1695
  case "file_read":
1692
1696
  return We;
1693
1697
  case "file_edit":
1694
1698
  case "file_write":
1695
- return Be;
1699
+ return Oe;
1696
1700
  case "command_run":
1697
1701
  return Me;
1698
1702
  case "search":
@@ -1702,12 +1706,12 @@ function wn(e) {
1702
1706
  return null;
1703
1707
  }
1704
1708
  }
1705
- function vn({
1709
+ function yn({
1706
1710
  toolCalls: e,
1707
1711
  defaultExpanded: n = !1,
1708
1712
  className: r
1709
1713
  }) {
1710
- const [s, a] = N(n), [l, c] = N(null), h = re(() => xn(e), [e]), o = re(() => gn(e), [e]), w = re(() => Object.entries(o).sort((m, g) => g[1] - m[1]).slice(0, 3).map(([m]) => m), [o]), d = e.length;
1714
+ const [s, a] = N(n), [l, c] = N(null), h = re(() => gn(e), [e]), o = re(() => wn(e), [e]), w = re(() => Object.entries(o).sort((m, g) => g[1] - m[1]).slice(0, 3).map(([m]) => m), [o]), d = e.length;
1711
1715
  return e.length === 0 ? null : /* @__PURE__ */ i("div", { className: p("ash-animate-fade-in", r), children: [
1712
1716
  /* @__PURE__ */ i(
1713
1717
  "button",
@@ -1730,7 +1734,7 @@ function vn({
1730
1734
  d !== 1 ? "s" : ""
1731
1735
  ] }),
1732
1736
  /* @__PURE__ */ t("div", { className: "flex items-center gap-1", children: w.map((m) => {
1733
- const g = wn(m);
1737
+ const g = vn(m);
1734
1738
  return g ? /* @__PURE__ */ t(
1735
1739
  g,
1736
1740
  {
@@ -1761,7 +1765,7 @@ function vn({
1761
1765
  ),
1762
1766
  s && /* @__PURE__ */ t("div", { className: "pl-5 border-l border-white/10 ml-1.5 mt-1 space-y-0.5", children: e.map((m) => /* @__PURE__ */ t("div", { children: l === m.id ? /* @__PURE__ */ i("div", { className: "py-1", children: [
1763
1767
  /* @__PURE__ */ t(
1764
- Oe,
1768
+ Be,
1765
1769
  {
1766
1770
  toolCall: m,
1767
1771
  defaultExpanded: !0
@@ -1785,7 +1789,7 @@ function vn({
1785
1789
  ) }, m.id)) })
1786
1790
  ] });
1787
1791
  }
1788
- function yn(e) {
1792
+ function bn(e) {
1789
1793
  const n = /* @__PURE__ */ new Map();
1790
1794
  for (const r of e) {
1791
1795
  const { actionType: s } = r;
@@ -1803,7 +1807,7 @@ function yn(e) {
1803
1807
  }
1804
1808
  return Array.from(n.values());
1805
1809
  }
1806
- function bn(e) {
1810
+ function Nn(e) {
1807
1811
  const n = {};
1808
1812
  for (const r of e) {
1809
1813
  const s = r.actionType.action;
@@ -1811,13 +1815,13 @@ function bn(e) {
1811
1815
  }
1812
1816
  return n;
1813
1817
  }
1814
- function Nn(e) {
1818
+ function kn(e) {
1815
1819
  switch (e) {
1816
1820
  case "file_read":
1817
1821
  return We;
1818
1822
  case "file_edit":
1819
1823
  case "file_write":
1820
- return Be;
1824
+ return Oe;
1821
1825
  case "command_run":
1822
1826
  return Me;
1823
1827
  case "search":
@@ -1827,16 +1831,16 @@ function Nn(e) {
1827
1831
  return null;
1828
1832
  }
1829
1833
  }
1830
- function kn({
1834
+ function Cn({
1831
1835
  toolCalls: e,
1832
1836
  defaultExpanded: n = !1,
1833
1837
  isExpanded: r,
1834
1838
  onToggle: s,
1835
1839
  className: a
1836
1840
  }) {
1837
- const [l, c] = N(n), h = r !== void 0 ? r : l, o = B(() => {
1841
+ const [l, c] = N(n), h = r !== void 0 ? r : l, o = O(() => {
1838
1842
  s ? s() : c((v) => !v);
1839
- }, [s]), w = re(() => yn(e), [e]), d = re(() => bn(e), [e]), m = re(() => Object.entries(d).sort((v, S) => S[1] - v[1]).slice(0, 3).map(([v]) => v), [d]);
1843
+ }, [s]), w = re(() => bn(e), [e]), d = re(() => Nn(e), [e]), m = re(() => Object.entries(d).sort((v, S) => S[1] - v[1]).slice(0, 3).map(([v]) => v), [d]);
1840
1844
  if (e.length === 0)
1841
1845
  return null;
1842
1846
  const g = e.length;
@@ -1863,7 +1867,7 @@ function kn({
1863
1867
  g !== 1 ? "s" : ""
1864
1868
  ] }),
1865
1869
  /* @__PURE__ */ t("div", { className: "flex items-center gap-1", children: m.map((v) => {
1866
- const S = Nn(v);
1870
+ const S = kn(v);
1867
1871
  return S ? /* @__PURE__ */ t(
1868
1872
  S,
1869
1873
  {
@@ -1928,19 +1932,19 @@ function Sr(e) {
1928
1932
  function Mr(e) {
1929
1933
  return e.type === "tool_call";
1930
1934
  }
1931
- function Ir(e) {
1935
+ function Er(e) {
1932
1936
  return e.type === "error";
1933
1937
  }
1934
- var Cn = {
1938
+ var _n = {
1935
1939
  mode: "inline",
1936
1940
  breakEveryNToolCalls: 0,
1937
1941
  defaultExpanded: !1,
1938
1942
  animationDuration: 300
1939
- }, _n = Ge(null);
1940
- function Tn() {
1941
- const e = Je(_n);
1943
+ }, Tn = Ge(null);
1944
+ function Sn() {
1945
+ const e = Je(Tn);
1942
1946
  return e || {
1943
- config: Cn,
1947
+ config: _n,
1944
1948
  setMode: () => {
1945
1949
  },
1946
1950
  setConfig: () => {
@@ -1949,11 +1953,11 @@ function Tn() {
1949
1953
  }
1950
1954
  };
1951
1955
  }
1952
- function Sn() {
1953
- const { config: e } = Tn();
1956
+ function Mn() {
1957
+ const { config: e } = Sn();
1954
1958
  return e;
1955
1959
  }
1956
- function Mn({
1960
+ function En({
1957
1961
  entries: e,
1958
1962
  loading: n,
1959
1963
  streamingContent: r,
@@ -1965,11 +1969,11 @@ function Mn({
1965
1969
  richContentRenderers: o,
1966
1970
  className: w
1967
1971
  }) {
1968
- const d = Sn(), m = s || d, g = O(null), v = O(null);
1972
+ const d = Mn(), m = s || d, g = B(null), v = B(null);
1969
1973
  j(() => {
1970
1974
  h && v.current && g.current && v.current.scrollIntoView({ behavior: "smooth", block: "end" });
1971
1975
  }, [e, r, n, h]);
1972
- const S = B(
1976
+ const S = O(
1973
1977
  (M, k) => {
1974
1978
  if (c)
1975
1979
  return (A) => {
@@ -1991,17 +1995,17 @@ function Mn({
1991
1995
  if (M.type === "single") {
1992
1996
  const A = M.entry;
1993
1997
  if (A.entryType.type === "widget" && l) {
1994
- const E = A.entryType, W = l({
1998
+ const I = A.entryType, W = l({
1995
1999
  entry: A,
1996
- widgetType: E.widgetType,
1997
- widgetData: E.widgetData,
1998
- onAction: S(A.id, E.widgetType)
2000
+ widgetType: I.widgetType,
2001
+ widgetData: I.widgetData,
2002
+ onAction: S(A.id, I.widgetType)
1999
2003
  });
2000
2004
  if (W !== null)
2001
2005
  return /* @__PURE__ */ t("div", { className: "ash-animate-fade-in", children: W }, A.id);
2002
2006
  }
2003
2007
  return /* @__PURE__ */ t(
2004
- ln,
2008
+ on,
2005
2009
  {
2006
2010
  entry: A,
2007
2011
  onOptionSelect: a,
@@ -2015,13 +2019,13 @@ function Mn({
2015
2019
  return /* @__PURE__ */ i("div", { className: "flex gap-3 ash-animate-fade-in", children: [
2016
2020
  /* @__PURE__ */ t("div", { className: "w-7 h-7 rounded-full bg-[var(--ash-accent)]/20 flex items-center justify-center shrink-0", children: /* @__PURE__ */ t(de, { className: "w-4 h-4 text-[var(--ash-accent)]" }) }),
2017
2021
  /* @__PURE__ */ t("div", { className: "flex-1", children: m.mode === "accordion" ? /* @__PURE__ */ t(
2018
- kn,
2022
+ Cn,
2019
2023
  {
2020
2024
  toolCalls: k,
2021
2025
  defaultExpanded: m.defaultExpanded
2022
2026
  }
2023
2027
  ) : /* @__PURE__ */ t(
2024
- vn,
2028
+ yn,
2025
2029
  {
2026
2030
  toolCalls: k,
2027
2031
  defaultExpanded: m.defaultExpanded,
@@ -2032,7 +2036,7 @@ function Mn({
2032
2036
  }),
2033
2037
  r && /* @__PURE__ */ i("div", { className: "flex gap-3 ash-animate-fade-in", children: [
2034
2038
  /* @__PURE__ */ t("div", { className: "w-7 h-7 rounded-full bg-[var(--ash-accent)]/20 flex items-center justify-center shrink-0", children: /* @__PURE__ */ t(de, { className: "w-4 h-4 text-[var(--ash-accent)]" }) }),
2035
- /* @__PURE__ */ t("div", { className: "flex-1 max-w-[85%]", children: /* @__PURE__ */ t("div", { className: "rounded-xl p-3 bg-white/5 text-white/80", children: /* @__PURE__ */ t(on, { content: r, isStreaming: !0 }) }) })
2039
+ /* @__PURE__ */ t("div", { className: "flex-1 max-w-[85%]", children: /* @__PURE__ */ t("div", { className: "rounded-xl p-3 bg-white/5 text-white/80", children: /* @__PURE__ */ t(cn, { content: r, isStreaming: !0 }) }) })
2036
2040
  ] }),
2037
2041
  n && !r && /* @__PURE__ */ i("div", { className: "flex gap-3 ash-animate-fade-in", children: [
2038
2042
  /* @__PURE__ */ t("div", { className: "w-7 h-7 rounded-full bg-[var(--ash-accent)]/20 flex items-center justify-center shrink-0", children: /* @__PURE__ */ t(de, { className: "w-4 h-4 text-[var(--ash-accent)]" }) }),
@@ -2053,7 +2057,7 @@ function In(e) {
2053
2057
  return /* @__PURE__ */ t(Mt, { className: "w-3.5 h-3.5" });
2054
2058
  }
2055
2059
  }
2056
- function En(e) {
2060
+ function Ln(e) {
2057
2061
  switch (e) {
2058
2062
  case "info":
2059
2063
  return "text-blue-400";
@@ -2065,7 +2069,7 @@ function En(e) {
2065
2069
  return "text-white/50";
2066
2070
  }
2067
2071
  }
2068
- function Ln(e) {
2072
+ function $n(e) {
2069
2073
  switch (e) {
2070
2074
  case "info":
2071
2075
  return "bg-blue-900/20";
@@ -2077,7 +2081,7 @@ function Ln(e) {
2077
2081
  return "bg-white/5";
2078
2082
  }
2079
2083
  }
2080
- function $n(e) {
2084
+ function An(e) {
2081
2085
  switch (e) {
2082
2086
  case "setup":
2083
2087
  return "Setup";
@@ -2091,14 +2095,14 @@ function $n(e) {
2091
2095
  return "Startup";
2092
2096
  }
2093
2097
  }
2094
- function An({ log: e }) {
2098
+ function Rn({ log: e }) {
2095
2099
  const [n, r] = N(!1), s = e.data && Object.keys(e.data).length > 0;
2096
2100
  return /* @__PURE__ */ i(
2097
2101
  "div",
2098
2102
  {
2099
2103
  className: p(
2100
2104
  "px-3 py-2 border-b border-white/10 last:border-b-0",
2101
- Ln(e.level)
2105
+ $n(e.level)
2102
2106
  ),
2103
2107
  children: [
2104
2108
  /* @__PURE__ */ i(
@@ -2108,9 +2112,9 @@ function An({ log: e }) {
2108
2112
  onClick: () => s && r(!n),
2109
2113
  children: [
2110
2114
  /* @__PURE__ */ t("div", { className: "w-4 flex-shrink-0 pt-0.5", children: s && (n ? /* @__PURE__ */ t(je, { className: "w-3 h-3 text-white/40" }) : /* @__PURE__ */ t(ve, { className: "w-3 h-3 text-white/40" })) }),
2111
- /* @__PURE__ */ t("div", { className: p("flex-shrink-0 pt-0.5", En(e.level)), children: In(e.level) }),
2115
+ /* @__PURE__ */ t("div", { className: p("flex-shrink-0 pt-0.5", Ln(e.level)), children: In(e.level) }),
2112
2116
  /* @__PURE__ */ t("span", { className: "text-xs text-white/40 font-mono flex-shrink-0 pt-0.5", children: De(e.timestamp) }),
2113
- /* @__PURE__ */ t("span", { className: "text-xs px-1.5 py-0.5 rounded bg-white/10 text-white/70 font-medium flex-shrink-0", children: $n(e.category) }),
2117
+ /* @__PURE__ */ t("span", { className: "text-xs px-1.5 py-0.5 rounded bg-white/10 text-white/70 font-medium flex-shrink-0", children: An(e.category) }),
2114
2118
  /* @__PURE__ */ t("span", { className: "text-sm text-white/80 flex-1 break-words", children: e.message })
2115
2119
  ]
2116
2120
  }
@@ -2120,7 +2124,7 @@ function An({ log: e }) {
2120
2124
  }
2121
2125
  );
2122
2126
  }
2123
- function Rn({
2127
+ function Dn({
2124
2128
  logs: e,
2125
2129
  title: n = "Logs",
2126
2130
  isLoading: r,
@@ -2172,18 +2176,18 @@ function Rn({
2172
2176
  {
2173
2177
  className: "overflow-y-auto border-t border-white/10",
2174
2178
  style: { maxHeight: a },
2175
- children: e.length === 0 ? /* @__PURE__ */ t("div", { className: "px-4 py-6 text-center text-sm text-white/50", children: "No logs yet" }) : e.map((d, m) => /* @__PURE__ */ t(An, { log: d }, `${d.timestamp}-${m}`))
2179
+ children: e.length === 0 ? /* @__PURE__ */ t("div", { className: "px-4 py-6 text-center text-sm text-white/50", children: "No logs yet" }) : e.map((d, m) => /* @__PURE__ */ t(Rn, { log: d }, `${d.timestamp}-${m}`))
2176
2180
  }
2177
2181
  )
2178
2182
  ]
2179
2183
  }
2180
2184
  );
2181
2185
  }
2182
- var Ae = Ge(void 0), Dn = "ash-ui-theme";
2183
- function Er({
2186
+ var Ae = Ge(void 0), jn = "ash-ui-theme";
2187
+ function Ir({
2184
2188
  children: e,
2185
2189
  defaultTheme: n,
2186
- storageKey: r = Dn,
2190
+ storageKey: r = jn,
2187
2191
  listenToSystemChanges: s = !0
2188
2192
  }) {
2189
2193
  const [a, l] = N(() => {
@@ -2209,9 +2213,9 @@ function Er({
2209
2213
  };
2210
2214
  return d.addEventListener("change", m), () => d.removeEventListener("change", m);
2211
2215
  }, [r, s]);
2212
- const o = B(() => {
2216
+ const o = O(() => {
2213
2217
  l((d) => d === "light" ? "dark" : "light");
2214
- }, []), w = B((d) => {
2218
+ }, []), w = O((d) => {
2215
2219
  l(d);
2216
2220
  }, []);
2217
2221
  return c ? /* @__PURE__ */ t(Ae.Provider, { value: { theme: a, toggleTheme: o, setTheme: w }, children: e }) : /* @__PURE__ */ t(Ae.Provider, { value: { theme: n ?? "light", toggleTheme: o, setTheme: w }, children: e });
@@ -2222,7 +2226,7 @@ function Lr() {
2222
2226
  throw new Error("useTheme must be used within a ThemeProvider");
2223
2227
  return e;
2224
2228
  }
2225
- var jn = {
2229
+ var Wn = {
2226
2230
  slideUp: `
2227
2231
  @keyframes ash-slide-up {
2228
2232
  from { opacity: 0; transform: translateY(20px); }
@@ -2260,14 +2264,14 @@ var jn = {
2260
2264
  }
2261
2265
  `
2262
2266
  };
2263
- Object.values(jn).join(`
2267
+ Object.values(Wn).join(`
2264
2268
  `);
2265
- function Wn({
2269
+ function On({
2266
2270
  messages: e,
2267
2271
  loading: n,
2268
2272
  streamingContent: r
2269
2273
  }) {
2270
- const s = O(null), a = O(null);
2274
+ const s = B(null), a = B(null);
2271
2275
  return j(() => {
2272
2276
  a.current && a.current.scrollIntoView({ behavior: "smooth", block: "end" });
2273
2277
  }, [e, r, n]), /* @__PURE__ */ i("div", { ref: s, className: "flex-1 overflow-y-auto p-4 space-y-4", children: [
@@ -2298,13 +2302,13 @@ function Bn({ message: e }) {
2298
2302
  children: e.role.charAt(0).toUpperCase() + e.role.slice(1)
2299
2303
  }
2300
2304
  ),
2301
- /* @__PURE__ */ t("div", { className: `message-content ${n ? "" : "prose prose-sm prose-invert max-w-none"}`, children: e.content.map((a, l) => /* @__PURE__ */ t(On, { block: a, isUser: n }, l)) }),
2305
+ /* @__PURE__ */ t("div", { className: `message-content ${n ? "" : "prose prose-sm prose-invert max-w-none"}`, children: e.content.map((a, l) => /* @__PURE__ */ t(zn, { block: a, isUser: n }, l)) }),
2302
2306
  /* @__PURE__ */ t("div", { className: `text-xs mt-3 ${n ? "text-black/40" : "text-white/40"}`, children: new Date(e.createdAt).toLocaleTimeString() })
2303
2307
  ]
2304
2308
  }
2305
2309
  ) });
2306
2310
  }
2307
- function On({
2311
+ function zn({
2308
2312
  block: e,
2309
2313
  isUser: n
2310
2314
  }) {
@@ -2323,11 +2327,11 @@ function On({
2323
2327
  /* @__PURE__ */ t("pre", { className: "text-sm overflow-x-auto text-emerald-300/80 font-mono", children: typeof e.content == "string" ? e.content : JSON.stringify(e.content, null, 2) })
2324
2328
  ] }) : null;
2325
2329
  }
2326
- const zn = 5e3;
2330
+ const Fn = 5e3;
2327
2331
  function Ve(e) {
2328
2332
  return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
2329
2333
  }
2330
- function Fn({
2334
+ function Pn({
2331
2335
  onSend: e,
2332
2336
  disabled: n,
2333
2337
  loading: r,
@@ -2345,15 +2349,15 @@ function Fn({
2345
2349
  onStop: v,
2346
2350
  canStop: S = !1,
2347
2351
  enableLongTextConversion: z = !0,
2348
- longTextThreshold: M = zn
2352
+ longTextThreshold: M = Fn
2349
2353
  }) {
2350
- const [k, A] = N(""), [E, W] = N(!1), [F, P] = N(!1), [ue, ie] = N(""), [ye, ae] = N(""), [R, K] = N([]), [he, le] = N(!1), [Z, Y] = N(null), [me, pe] = N(/* @__PURE__ */ new Map()), ge = O(0), oe = O(null), be = O(null), fe = O(null), we = B((u) => {
2351
- const I = new TextEncoder().encode(u);
2354
+ const [k, A] = N(""), [I, W] = N(!1), [F, P] = N(!1), [ue, ie] = N(""), [ye, ae] = N(""), [R, K] = N([]), [he, le] = N(!1), [Z, Y] = N(null), [me, pe] = N(/* @__PURE__ */ new Map()), ge = B(0), oe = B(null), be = B(null), fe = B(null), we = O((u) => {
2355
+ const E = new TextEncoder().encode(u);
2352
2356
  let f = "";
2353
- for (let C = 0; C < I.length; C++)
2354
- f += String.fromCharCode(I[C]);
2357
+ for (let C = 0; C < E.length; C++)
2358
+ f += String.fromCharCode(E[C]);
2355
2359
  return btoa(f);
2356
- }, []), q = B((u) => {
2360
+ }, []), q = O((u) => {
2357
2361
  if (!z || !d) return;
2358
2362
  const b = u.clipboardData.getData("text/plain");
2359
2363
  if (b.length > M) {
@@ -2361,7 +2365,7 @@ function Fn({
2361
2365
  console.warn(`Cannot convert text to attachment: maximum ${g} files reached`);
2362
2366
  return;
2363
2367
  }
2364
- const I = b.split(`
2368
+ const E = b.split(`
2365
2369
  `).length;
2366
2370
  ge.current += 1;
2367
2371
  const f = ge.current, C = `pasted-text-${f}-${Date.now()}.txt`, X = we(b), rt = new TextEncoder().encode(b).length, st = {
@@ -2370,14 +2374,14 @@ function Fn({
2370
2374
  mimeType: "text/plain",
2371
2375
  size: rt
2372
2376
  };
2373
- pe((Ee) => {
2374
- const Pe = new Map(Ee);
2375
- return Pe.set(C, { number: f, lineCount: I }), Pe;
2376
- }), K((Ee) => [...Ee, st]), Y({
2377
+ pe((Ie) => {
2378
+ const Pe = new Map(Ie);
2379
+ return Pe.set(C, { number: f, lineCount: E }), Pe;
2380
+ }), K((Ie) => [...Ie, st]), Y({
2377
2381
  originalLength: b.length,
2378
2382
  filename: C,
2379
2383
  preview: b.slice(0, 100) + (b.length > 100 ? "..." : ""),
2380
- lineCount: I
2384
+ lineCount: E
2381
2385
  }), setTimeout(() => {
2382
2386
  Y(null);
2383
2387
  }, 5e3);
@@ -2392,8 +2396,8 @@ function Fn({
2392
2396
  u && (u.style.height = "auto", u.style.height = `${Math.min(u.scrollHeight, 200)}px`);
2393
2397
  }, D = async (u) => {
2394
2398
  if (!u) return;
2395
- const b = [], I = R.length;
2396
- for (let f = 0; f < u.length && I + b.length < g; f++) {
2399
+ const b = [], E = R.length;
2400
+ for (let f = 0; f < u.length && E + b.length < g; f++) {
2397
2401
  const C = u[f];
2398
2402
  if (C.size > m) {
2399
2403
  console.warn(`File ${C.name} exceeds maximum size of ${Ve(m)}`);
@@ -2412,12 +2416,12 @@ function Fn({
2412
2416
  }
2413
2417
  }
2414
2418
  b.length > 0 && K((f) => [...f, ...b]);
2415
- }, Q = (u) => new Promise((b, I) => {
2419
+ }, Q = (u) => new Promise((b, E) => {
2416
2420
  const f = new FileReader();
2417
2421
  f.onload = () => {
2418
2422
  const X = f.result.split(",")[1];
2419
2423
  b(X || "");
2420
- }, f.onerror = () => I(f.error), f.readAsDataURL(u);
2424
+ }, f.onerror = () => E(f.error), f.readAsDataURL(u);
2421
2425
  }), te = (u) => {
2422
2426
  D(u.target.files), fe.current && (fe.current.value = "");
2423
2427
  }, ce = (u) => {
@@ -2428,11 +2432,11 @@ function Fn({
2428
2432
  u.preventDefault(), le(!1), d && !n && D(u.dataTransfer.files);
2429
2433
  }, G = (u) => {
2430
2434
  const b = R[u];
2431
- b && me.has(b.filename) && pe((I) => {
2432
- const f = new Map(I);
2435
+ b && me.has(b.filename) && pe((E) => {
2436
+ const f = new Map(E);
2433
2437
  return f.delete(b.filename), f;
2434
- }), K((I) => I.filter((f, C) => C !== u));
2435
- }, J = a.length > 0, Ne = r ? "Sending..." : J ? `Queue (${a.length})` : "Send", ke = c.trim().length > 0, Ce = Object.keys(o).length > 0, Ie = !n && (k.trim() || R.length > 0), xe = () => {
2438
+ }), K((E) => E.filter((f, C) => C !== u));
2439
+ }, J = a.length > 0, Ne = r ? "Sending..." : J ? `Queue (${a.length})` : "Send", ke = c.trim().length > 0, Ce = Object.keys(o).length > 0, Ee = !n && (k.trim() || R.length > 0), xe = () => {
2436
2440
  const u = ue.trim(), b = ye.trim();
2437
2441
  u && w && (w({ ...o, [u]: b }), ie(""), ae(""));
2438
2442
  }, U = (u) => {
@@ -2457,14 +2461,14 @@ function Fn({
2457
2461
  "button",
2458
2462
  {
2459
2463
  type: "button",
2460
- onClick: () => W(!E),
2464
+ onClick: () => W(!I),
2461
2465
  className: "flex items-center gap-2 text-xs font-medium text-white/50 hover:text-white/80 transition-colors",
2462
2466
  children: [
2463
2467
  /* @__PURE__ */ t(
2464
2468
  "svg",
2465
2469
  {
2466
2470
  xmlns: "http://www.w3.org/2000/svg",
2467
- className: `h-3 w-3 transition-transform ${E ? "rotate-90" : ""}`,
2471
+ className: `h-3 w-3 transition-transform ${I ? "rotate-90" : ""}`,
2468
2472
  viewBox: "0 0 20 20",
2469
2473
  fill: "currentColor",
2470
2474
  children: /* @__PURE__ */ t(
@@ -2478,11 +2482,11 @@ function Fn({
2478
2482
  }
2479
2483
  ),
2480
2484
  /* @__PURE__ */ t("span", { className: "uppercase tracking-wide", children: "Session Context" }),
2481
- ke && !E && /* @__PURE__ */ t("span", { className: "badge badge-accent", children: "Active" })
2485
+ ke && !I && /* @__PURE__ */ t("span", { className: "badge badge-accent", children: "Active" })
2482
2486
  ]
2483
2487
  }
2484
2488
  ),
2485
- E && /* @__PURE__ */ i("div", { className: "mt-2", children: [
2489
+ I && /* @__PURE__ */ i("div", { className: "mt-2", children: [
2486
2490
  /* @__PURE__ */ t(
2487
2491
  "textarea",
2488
2492
  {
@@ -2671,7 +2675,7 @@ function Fn({
2671
2675
  ")"
2672
2676
  ] }),
2673
2677
  /* @__PURE__ */ t("div", { className: "flex flex-wrap gap-2", children: R.map((u, b) => {
2674
- const I = me.get(u.filename), f = !!I;
2678
+ const E = me.get(u.filename), f = !!E;
2675
2679
  return /* @__PURE__ */ i(
2676
2680
  "div",
2677
2681
  {
@@ -2722,9 +2726,9 @@ function Fn({
2722
2726
  ),
2723
2727
  f ? /* @__PURE__ */ i("span", { className: "text-purple-200 font-mono", title: u.filename, children: [
2724
2728
  "[Pasted text #",
2725
- I.number,
2729
+ E.number,
2726
2730
  " +",
2727
- I.lineCount,
2731
+ E.lineCount,
2728
2732
  " lines]"
2729
2733
  ] }) : /* @__PURE__ */ i(_, { children: [
2730
2734
  /* @__PURE__ */ t("span", { className: "text-white/80 truncate max-w-[150px]", title: u.filename, children: u.filename }),
@@ -2885,7 +2889,7 @@ function Fn({
2885
2889
  "button",
2886
2890
  {
2887
2891
  onClick: x,
2888
- disabled: !Ie,
2892
+ disabled: !Ee,
2889
2893
  className: `shrink-0 px-3 sm:px-5 py-2.5 rounded-xl font-medium transition-all duration-300 disabled:opacity-30 disabled:cursor-not-allowed ${J ? "bg-yellow-500/80 hover:bg-yellow-500 text-black border border-yellow-400/30" : "bg-[#ccff00] hover:bg-[#b8e600] text-black shadow-[0_0_20px_rgba(204,255,0,0.3)] hover:shadow-[0_0_30px_rgba(204,255,0,0.5)]"}`,
2890
2894
  children: [
2891
2895
  /* @__PURE__ */ t("span", { className: "hidden sm:inline", children: Ne }),
@@ -2913,7 +2917,7 @@ function $r({
2913
2917
  className: a = "",
2914
2918
  useBackendQueue: l = !1
2915
2919
  }) {
2916
- const [c, h] = N([]), [o, w] = N(n || null), [d, m] = N(r || null), [g, v] = N([]), [S, z] = N(!1), [M, k] = N(""), [A, E] = N(null), [W, F] = N([]), [P, ue] = N([]), [ie, ye] = N(""), [ae, R] = N({}), K = O(!1), he = O(ie), le = O(ae), Z = O(null);
2920
+ const [c, h] = N([]), [o, w] = N(n || null), [d, m] = N(r || null), [g, v] = N([]), [S, z] = N(!1), [M, k] = N(""), [A, I] = N(null), [W, F] = N([]), [P, ue] = N([]), [ie, ye] = N(""), [ae, R] = N({}), K = B(!1), he = B(ie), le = B(ae), Z = B(null);
2917
2921
  j(() => {
2918
2922
  he.current = ie;
2919
2923
  }, [ie]), j(() => {
@@ -2923,12 +2927,12 @@ function $r({
2923
2927
  const y = x.agents || [];
2924
2928
  h(y), !o && y.length > 0 && w(y[0].slug || y[0].name);
2925
2929
  }).catch((x) => {
2926
- console.error("Failed to fetch agents:", x), E("Failed to load agents");
2930
+ console.error("Failed to fetch agents:", x), I("Failed to load agents");
2927
2931
  });
2928
2932
  }, [e]), j(() => {
2929
2933
  d && me(d);
2930
2934
  }, [d]);
2931
- const Y = B(async () => {
2935
+ const Y = O(async () => {
2932
2936
  if (!(!l || !o))
2933
2937
  try {
2934
2938
  const x = await fetch(
@@ -2956,12 +2960,12 @@ function $r({
2956
2960
  const T = await y.json();
2957
2961
  v(T.items || T.messages || []);
2958
2962
  } catch (y) {
2959
- E(y instanceof Error ? y.message : "Failed to fetch messages");
2963
+ I(y instanceof Error ? y.message : "Failed to fetch messages");
2960
2964
  }
2961
- }, pe = B(async (x, y, T) => {
2965
+ }, pe = O(async (x, y, T) => {
2962
2966
  var te, ce;
2963
2967
  if (!o) return y;
2964
- z(!0), E(null), k("");
2968
+ z(!0), I(null), k("");
2965
2969
  const D = {
2966
2970
  id: `temp-${Date.now()}`,
2967
2971
  role: "user",
@@ -2985,21 +2989,21 @@ function $r({
2985
2989
  body: JSON.stringify(G)
2986
2990
  });
2987
2991
  if (!ke.ok) throw new Error("Failed to send message");
2988
- const Ce = (te = ke.body) == null ? void 0 : te.getReader(), Ie = new TextDecoder();
2992
+ const Ce = (te = ke.body) == null ? void 0 : te.getReader(), Ee = new TextDecoder();
2989
2993
  let xe = "", U = "";
2990
2994
  for (; Ce; ) {
2991
2995
  const { done: ne, value: Fe } = await Ce.read();
2992
2996
  if (ne) break;
2993
- xe += Ie.decode(Fe, { stream: !0 });
2997
+ xe += Ee.decode(Fe, { stream: !0 });
2994
2998
  const u = xe.split(`
2995
2999
  `);
2996
3000
  xe = u.pop() || "";
2997
3001
  for (const b of u)
2998
3002
  if (b.startsWith("data:")) {
2999
- const I = b.slice(5).trim();
3000
- if (!I) continue;
3003
+ const E = b.slice(5).trim();
3004
+ if (!E) continue;
3001
3005
  try {
3002
- const f = JSON.parse(I);
3006
+ const f = JSON.parse(E);
3003
3007
  if (f.type === "session_start" && f.sessionId)
3004
3008
  Q = f.sessionId, m(f.sessionId);
3005
3009
  else if (f.type === "text_delta" && f.delta)
@@ -3019,18 +3023,18 @@ function $r({
3019
3023
  else if (f.type === "session_end") {
3020
3024
  const C = y || f.sessionId;
3021
3025
  C && await me(C), k("");
3022
- } else f.type === "error" && E(f.error || "Unknown error");
3026
+ } else f.type === "error" && I(f.error || "Unknown error");
3023
3027
  } catch {
3024
3028
  }
3025
3029
  }
3026
3030
  }
3027
3031
  } catch (V) {
3028
- E(V instanceof Error ? V.message : "Unknown error"), v((H) => H.filter((G) => G.id !== D.id));
3032
+ I(V instanceof Error ? V.message : "Unknown error"), v((H) => H.filter((G) => G.id !== D.id));
3029
3033
  } finally {
3030
3034
  z(!1);
3031
3035
  }
3032
3036
  return Q;
3033
- }, [e, o]), ge = B(async () => {
3037
+ }, [e, o]), ge = O(async () => {
3034
3038
  if (K.current) return;
3035
3039
  K.current = !0;
3036
3040
  let x = d;
@@ -3044,7 +3048,7 @@ function $r({
3044
3048
  j(() => {
3045
3049
  W.length > 0 && !K.current && ge();
3046
3050
  }, [W, ge]);
3047
- const oe = B(async (x, y) => {
3051
+ const oe = O(async (x, y) => {
3048
3052
  if (!o) return;
3049
3053
  const T = {
3050
3054
  id: `temp-${Date.now()}`,
@@ -3081,9 +3085,9 @@ function $r({
3081
3085
  }
3082
3086
  }, 500), await Y();
3083
3087
  } catch (D) {
3084
- E(D instanceof Error ? D.message : "Failed to queue message"), v((Q) => Q.filter((te) => te.id !== T.id));
3088
+ I(D instanceof Error ? D.message : "Failed to queue message"), v((Q) => Q.filter((te) => te.id !== T.id));
3085
3089
  }
3086
- }, [o, d, e, Y]), be = B((x, y) => {
3090
+ }, [o, d, e, Y]), be = O((x, y) => {
3087
3091
  if (!o) return;
3088
3092
  if (l) {
3089
3093
  oe(x, y);
@@ -3095,7 +3099,7 @@ function $r({
3095
3099
  files: y
3096
3100
  };
3097
3101
  S || K.current ? F((D) => [...D, T]) : F([T]);
3098
- }, [o, S, l, oe]), fe = B(async (x) => {
3102
+ }, [o, S, l, oe]), fe = O(async (x) => {
3099
3103
  if (l) {
3100
3104
  try {
3101
3105
  await fetch(`${e}/queue/${x}/cancel`, {
@@ -3107,8 +3111,8 @@ function $r({
3107
3111
  return;
3108
3112
  }
3109
3113
  F((y) => y.filter((T) => T.id !== x));
3110
- }, [l, e, Y]), we = B(() => {
3111
- m(null), v([]), k(""), E(null), ue([]), F([]);
3114
+ }, [l, e, Y]), we = O(() => {
3115
+ m(null), v([]), k(""), I(null), ue([]), F([]);
3112
3116
  }, []), q = c.find(
3113
3117
  (x) => x.slug === o || x.name === o
3114
3118
  );
@@ -3152,7 +3156,7 @@ function $r({
3152
3156
  /* @__PURE__ */ t(
3153
3157
  "button",
3154
3158
  {
3155
- onClick: () => E(null),
3159
+ onClick: () => I(null),
3156
3160
  className: "text-red-400/70 hover:text-red-400 transition-colors",
3157
3161
  children: /* @__PURE__ */ t("svg", { className: "w-4 h-4", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M6 18L18 6M6 6l12 12" }) })
3158
3162
  }
@@ -3163,7 +3167,7 @@ function $r({
3163
3167
  /* @__PURE__ */ t("p", { className: "text-lg text-white/80", children: "Start a conversation" }),
3164
3168
  /* @__PURE__ */ t("p", { className: "text-sm mt-1 text-white/40", children: o ? `Chat with ${(q == null ? void 0 : q.name) || o}` : "Select an agent to begin" })
3165
3169
  ] }) }) : /* @__PURE__ */ t(
3166
- Wn,
3170
+ On,
3167
3171
  {
3168
3172
  messages: g,
3169
3173
  loading: S,
@@ -3171,7 +3175,7 @@ function $r({
3171
3175
  }
3172
3176
  ) }),
3173
3177
  /* @__PURE__ */ t("div", { className: "relative z-10", children: /* @__PURE__ */ t(
3174
- Fn,
3178
+ Pn,
3175
3179
  {
3176
3180
  onSend: be,
3177
3181
  disabled: !o,
@@ -3203,7 +3207,7 @@ function Ar({
3203
3207
  onOptionSelect: a
3204
3208
  }) {
3205
3209
  return /* @__PURE__ */ t(
3206
- Mn,
3210
+ En,
3207
3211
  {
3208
3212
  entries: e,
3209
3213
  loading: n,
@@ -3215,7 +3219,7 @@ function Ar({
3215
3219
  }
3216
3220
  function Rr({ logs: e, isLoading: n, className: r }) {
3217
3221
  return /* @__PURE__ */ t(
3218
- Rn,
3222
+ Dn,
3219
3223
  {
3220
3224
  logs: e,
3221
3225
  title: "Sandbox Logs",
@@ -3224,7 +3228,7 @@ function Rr({ logs: e, isLoading: n, className: r }) {
3224
3228
  }
3225
3229
  );
3226
3230
  }
3227
- function Pn(e) {
3231
+ function Hn(e) {
3228
3232
  if (e.startsWith("mcp__")) {
3229
3233
  const n = e.split("__");
3230
3234
  if (n.length >= 3)
@@ -3232,7 +3236,7 @@ function Pn(e) {
3232
3236
  }
3233
3237
  return e;
3234
3238
  }
3235
- function Hn(e) {
3239
+ function qn(e) {
3236
3240
  if (e.startsWith("mcp__")) {
3237
3241
  const n = e.split("__");
3238
3242
  if (n.length >= 3 && n[1] !== void 0)
@@ -3243,7 +3247,7 @@ function Hn(e) {
3243
3247
  }
3244
3248
  return null;
3245
3249
  }
3246
- function qn(e, n) {
3250
+ function Vn(e, n) {
3247
3251
  const r = n || {};
3248
3252
  switch (e) {
3249
3253
  case "Bash":
@@ -3312,7 +3316,7 @@ function qn(e, n) {
3312
3316
  };
3313
3317
  }
3314
3318
  default: {
3315
- const s = Hn(e);
3319
+ const s = qn(e);
3316
3320
  return s ? {
3317
3321
  action: "mcp_tool",
3318
3322
  serverName: s.serverName,
@@ -3320,13 +3324,13 @@ function qn(e, n) {
3320
3324
  arguments: n
3321
3325
  } : {
3322
3326
  action: "generic_tool",
3323
- toolName: Pn(e),
3327
+ toolName: Hn(e),
3324
3328
  arguments: n
3325
3329
  };
3326
3330
  }
3327
3331
  }
3328
3332
  }
3329
- function Vn(e, n, r) {
3333
+ function Gn(e, n, r) {
3330
3334
  switch (r.action) {
3331
3335
  case "command_run":
3332
3336
  const s = r.command;
@@ -3357,11 +3361,11 @@ function Vn(e, n, r) {
3357
3361
  return "Unknown tool";
3358
3362
  }
3359
3363
  }
3360
- function Gn(e) {
3364
+ function Jn(e) {
3361
3365
  return typeof e == "string" ? e : Array.isArray(e) ? e.filter((n) => typeof (n == null ? void 0 : n.text) == "string").map((n) => n.text).join(`
3362
3366
  `) : e && typeof e == "object" && "text" in e ? String(e.text) : JSON.stringify(e, null, 2);
3363
3367
  }
3364
- function Jn(e) {
3368
+ function Un(e) {
3365
3369
  if (typeof e == "string")
3366
3370
  try {
3367
3371
  return { type: "json", value: JSON.parse(e) };
@@ -3385,8 +3389,8 @@ function Jn(e) {
3385
3389
  }
3386
3390
  return { type: "json", value: e };
3387
3391
  }
3388
- function Un(e) {
3389
- const n = Gn(e);
3392
+ function Kn(e) {
3393
+ const n = Jn(e);
3390
3394
  if (typeof e == "string")
3391
3395
  try {
3392
3396
  const r = JSON.parse(e);
@@ -3405,7 +3409,7 @@ function Un(e) {
3405
3409
  };
3406
3410
  }
3407
3411
  function tt(e) {
3408
- const n = qn(e.name, e.input), r = Vn(e.name, e.input, n);
3412
+ const n = Vn(e.name, e.input), r = Gn(e.name, e.input, n);
3409
3413
  return {
3410
3414
  id: e.id,
3411
3415
  toolName: e.name,
@@ -3418,15 +3422,15 @@ function tt(e) {
3418
3422
  function nt(e, n, r) {
3419
3423
  const s = { ...e }, a = { ...e.actionType };
3420
3424
  if (s.status = r ? "failed" : "success", s.completedAt = (/* @__PURE__ */ new Date()).toISOString(), s.isError = r, a.action === "command_run") {
3421
- const l = Un(n);
3425
+ const l = Kn(n);
3422
3426
  a.result = l, l.exitCode !== void 0 && l.exitCode !== 0 && (s.status = "failed", s.isError = !0);
3423
- } else (a.action === "mcp_tool" || a.action === "generic_tool") && (a.result = Jn(n));
3427
+ } else (a.action === "mcp_tool" || a.action === "generic_tool") && (a.result = Un(n));
3424
3428
  return s.actionType = a, s;
3425
3429
  }
3426
- function Kn(e) {
3430
+ function Yn(e) {
3427
3431
  return e.type === "tool_use";
3428
3432
  }
3429
- function Yn(e) {
3433
+ function Zn(e) {
3430
3434
  return e.type === "tool_result";
3431
3435
  }
3432
3436
  function Dr(e) {
@@ -3443,7 +3447,7 @@ function Dr(e) {
3443
3447
  },
3444
3448
  content: c.text
3445
3449
  });
3446
- else if (Kn(c)) {
3450
+ else if (Yn(c)) {
3447
3451
  const h = tt(c);
3448
3452
  r.set(c.id, h);
3449
3453
  const o = {
@@ -3456,7 +3460,7 @@ function Dr(e) {
3456
3460
  content: h.summary
3457
3461
  };
3458
3462
  n.push(o), s.set(c.id, o);
3459
- } else if (Yn(c)) {
3463
+ } else if (Zn(c)) {
3460
3464
  const h = c.toolUseId, o = r.get(h);
3461
3465
  if (o) {
3462
3466
  const w = nt(
@@ -3669,69 +3673,69 @@ export {
3669
3673
  Ye as ActionIcon,
3670
3674
  St as AlertCircleIcon,
3671
3675
  Ke as AlertTriangleIcon,
3672
- nn as AssistantMessage,
3676
+ rn as AssistantMessage,
3673
3677
  gr as BrainIcon,
3674
3678
  Mt as BugIcon,
3675
- Fn as ChatInput,
3676
- It as CheckCircleIcon,
3679
+ Pn as ChatInput,
3680
+ Et as CheckCircleIcon,
3677
3681
  Ct as CheckIcon,
3678
3682
  je as ChevronDownIcon,
3679
- or as ChevronLeftIcon,
3683
+ cr as ChevronLeftIcon,
3680
3684
  ve as ChevronRightIcon,
3681
- cr as ChevronUpIcon,
3685
+ dr as ChevronUpIcon,
3682
3686
  se as CodeBlock,
3683
- dr as CodeIcon,
3684
- ur as CopyIcon,
3685
- Be as EditIcon,
3686
- an as ErrorMessage,
3687
+ ur as CodeIcon,
3688
+ hr as CopyIcon,
3689
+ Oe as EditIcon,
3690
+ ln as ErrorMessage,
3687
3691
  We as FileIcon,
3688
3692
  vt as FilePlusIcon,
3689
3693
  kt as FolderSearchIcon,
3690
3694
  yt as GlobeIcon,
3691
3695
  Tt as InfoIcon,
3692
3696
  Te as JsonDisplay,
3693
- Wn as LegacyMessageList,
3697
+ On as LegacyMessageList,
3694
3698
  _t as LoaderIcon,
3695
3699
  $e as LoadingIndicator,
3696
- Rn as LogsPanel,
3697
- ln as MessageEntry,
3698
- Mn as MessageList,
3700
+ Dn as LogsPanel,
3701
+ on as MessageEntry,
3702
+ En as MessageList,
3699
3703
  xr as MessageSquareIcon,
3700
- lr as MoonIcon,
3704
+ or as MoonIcon,
3701
3705
  Ar as NormalizedMessageList,
3702
- Et as PaperclipIcon,
3706
+ Lt as PaperclipIcon,
3703
3707
  $r as Playground,
3704
3708
  bt as PlugIcon,
3705
3709
  Rr as SandboxLogsPanel,
3706
3710
  _e as SearchIcon,
3707
3711
  pr as SendIcon,
3708
- Lt as SparklesIcon,
3709
- jt as StatusIndicator,
3712
+ $t as SparklesIcon,
3713
+ Wt as StatusIndicator,
3710
3714
  fr as StopCircleIcon,
3711
- on as StreamingText,
3712
- ar as SunIcon,
3715
+ cn as StreamingText,
3716
+ lr as SunIcon,
3713
3717
  Me as TerminalIcon,
3714
- Er as ThemeProvider,
3715
- rn as ThinkingMessage,
3716
- Oe as ToolCallCard,
3717
- sn as ToolCallMessage,
3718
+ Ir as ThemeProvider,
3719
+ sn as ThinkingMessage,
3720
+ Be as ToolCallCard,
3721
+ an as ToolCallMessage,
3718
3722
  Re as ToolCallProcessor,
3719
3723
  Nt as ToolIcon,
3720
- tn as UserMessage,
3721
- mr as XCircleIcon,
3722
- hr as XIcon,
3724
+ nn as UserMessage,
3725
+ It as XCircleIcon,
3726
+ mr as XIcon,
3723
3727
  p as cn,
3724
- tr as createToolCall,
3728
+ nr as createToolCall,
3725
3729
  jr as createToolCallProcessor,
3726
3730
  mt as extractTextContent,
3727
- sr as formatFileSize,
3731
+ ir as formatFileSize,
3728
3732
  De as formatTimestamp,
3729
3733
  ct as formatToolName,
3730
3734
  ht as generateToolSummary,
3731
- rr as getActionIcon,
3735
+ sr as getActionIcon,
3732
3736
  Ue as getActionLabel,
3733
3737
  wr as isCommandRunAction,
3734
- Ir as isErrorEntry,
3738
+ Er as isErrorEntry,
3735
3739
  yr as isFileEditAction,
3736
3740
  vr as isFileReadAction,
3737
3741
  br as isFileWriteAction,
@@ -3747,7 +3751,7 @@ export {
3747
3751
  pt as normalizeToolResult,
3748
3752
  ft as parseCommandResult,
3749
3753
  dt as parseMcpToolName,
3750
- ir as truncate,
3751
- nr as updateToolCallWithResult,
3754
+ ar as truncate,
3755
+ rr as updateToolCallWithResult,
3752
3756
  Lr as useTheme
3753
3757
  };