@ash-cloud/ash-ai 0.1.13 → 0.1.15

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,9 +1,9 @@
1
- var it = Object.defineProperty;
2
- var lt = (e, n, r) => n in e ? it(e, n, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[n] = r;
3
- var se = (e, n, r) => lt(e, typeof n != "symbol" ? n + "" : n, r);
4
- import { lazy as ot, createContext as Je, useState as N, useRef as G, useEffect as z, useCallback as P, useMemo as ae, useContext as Ue, Suspense as ct, Fragment as $e } from "react";
5
- import { jsxs as a, jsx as t, Fragment as S } from "react/jsx-runtime";
6
- function dt(e) {
1
+ var ot = Object.defineProperty;
2
+ var ct = (e, n, r) => n in e ? ot(e, n, { enumerable: !0, configurable: !0, writable: !0, value: r }) : e[n] = r;
3
+ var se = (e, n, r) => ct(e, typeof n != "symbol" ? n + "" : n, r);
4
+ import { lazy as dt, createContext as Je, useState as N, useCallback as F, useRef as V, useEffect as P, useMemo as ae, useContext as Ue, Suspense as ut, Fragment as $e } from "react";
5
+ import { jsxs as a, jsx as t, Fragment as _ } from "react/jsx-runtime";
6
+ function ht(e) {
7
7
  if (e.startsWith("mcp__")) {
8
8
  const n = e.split("__");
9
9
  if (n.length >= 3)
@@ -11,7 +11,7 @@ function dt(e) {
11
11
  }
12
12
  return e;
13
13
  }
14
- function ut(e) {
14
+ function mt(e) {
15
15
  if (e.startsWith("mcp__")) {
16
16
  const n = e.split("__");
17
17
  if (n.length >= 3 && n[1] !== void 0)
@@ -22,7 +22,7 @@ function ut(e) {
22
22
  }
23
23
  return null;
24
24
  }
25
- function ht(e, n) {
25
+ function pt(e, n) {
26
26
  const r = n || {};
27
27
  switch (e) {
28
28
  case "Bash":
@@ -114,7 +114,7 @@ function ht(e, n) {
114
114
  toolCallCount: 0
115
115
  };
116
116
  default: {
117
- const s = ut(e);
117
+ const s = mt(e);
118
118
  return s ? {
119
119
  action: "mcp_tool",
120
120
  serverName: s.serverName,
@@ -122,13 +122,13 @@ function ht(e, n) {
122
122
  arguments: n
123
123
  } : {
124
124
  action: "generic_tool",
125
- toolName: dt(e),
125
+ toolName: ht(e),
126
126
  arguments: n
127
127
  };
128
128
  }
129
129
  }
130
130
  }
131
- function mt(e, n, r) {
131
+ function ft(e, n, r) {
132
132
  switch (r.action) {
133
133
  case "command_run": {
134
134
  const s = r.command;
@@ -162,11 +162,11 @@ function mt(e, n, r) {
162
162
  return "Unknown tool";
163
163
  }
164
164
  }
165
- function pt(e) {
165
+ function xt(e) {
166
166
  return typeof e == "string" ? e : Array.isArray(e) ? e.filter((n) => typeof (n == null ? void 0 : n.text) == "string").map((n) => n.text).join(`
167
167
  `) : e && typeof e == "object" && "text" in e ? String(e.text) : JSON.stringify(e, null, 2);
168
168
  }
169
- function ft(e) {
169
+ function gt(e) {
170
170
  if (typeof e == "string")
171
171
  try {
172
172
  return { type: "json", value: JSON.parse(e) };
@@ -190,8 +190,8 @@ function ft(e) {
190
190
  }
191
191
  return { type: "json", value: e };
192
192
  }
193
- function xt(e) {
194
- const n = pt(e);
193
+ function wt(e) {
194
+ const n = xt(e);
195
195
  if (typeof e == "string")
196
196
  try {
197
197
  const r = JSON.parse(e);
@@ -209,7 +209,7 @@ function xt(e) {
209
209
  };
210
210
  }
211
211
  function rr(e) {
212
- const n = ht(e.name, e.input), r = mt(e.name, e.input, n);
212
+ const n = pt(e.name, e.input), r = ft(e.name, e.input, n);
213
213
  return {
214
214
  id: e.id,
215
215
  toolName: e.name,
@@ -223,9 +223,9 @@ function rr(e) {
223
223
  function sr(e, n, r) {
224
224
  const s = { ...e }, i = { ...e.actionType };
225
225
  if (s.status = r ? "failed" : "success", s.completedAt = (/* @__PURE__ */ new Date()).toISOString(), s.isError = r, s.output = n, i.action === "command_run") {
226
- const l = xt(n);
226
+ const l = wt(n);
227
227
  i.result = l, l.exitCode !== void 0 && l.exitCode !== 0 && (s.status = "failed", s.isError = !0);
228
- } else (i.action === "mcp_tool" || i.action === "generic_tool") && (i.result = ft(n));
228
+ } else (i.action === "mcp_tool" || i.action === "generic_tool") && (i.result = gt(n));
229
229
  return s.actionType = i, s;
230
230
  }
231
231
  function ar(e) {
@@ -303,7 +303,7 @@ function je(e) {
303
303
  return e;
304
304
  }
305
305
  }
306
- function He(e, n) {
306
+ function Ve(e, n) {
307
307
  const r = typeof e == "string" ? new Date(e) : e, i = (/* @__PURE__ */ new Date()).getTime() - r.getTime(), l = Math.floor(i / 1e3);
308
308
  if (l < 60)
309
309
  return `${l}s`;
@@ -313,10 +313,10 @@ function He(e, n) {
313
313
  function lr(e, n) {
314
314
  return e.length <= n ? e : e.substring(0, n - 3) + "...";
315
315
  }
316
- function m(...e) {
316
+ function p(...e) {
317
317
  return e.filter(Boolean).join(" ");
318
318
  }
319
- function gt(e, n) {
319
+ function vt(e, n) {
320
320
  const r = [];
321
321
  let s = [], i = 0;
322
322
  const l = () => {
@@ -330,12 +330,12 @@ function gt(e, n) {
330
330
  c.entryType.type === "tool_call" ? (s.push(c), n.breakEveryNToolCalls && n.breakEveryNToolCalls > 0 && s.length >= n.breakEveryNToolCalls && l()) : (l(), r.push({ type: "single", entry: c }));
331
331
  return l(), r;
332
332
  }
333
- function wt(e) {
333
+ function yt(e) {
334
334
  return e.filter(
335
335
  (n) => n.entryType.type === "tool_call"
336
336
  ).map((n) => n.entryType.toolCall);
337
337
  }
338
- function vt(e) {
338
+ function bt(e) {
339
339
  const n = /(?:\*\*)?Option\s+(\d+)(?:\*\*)?[:\-]\s*([^\n]+)(?:\n((?:(?!\n(?:\*\*)?Option\s+\d).)*?))?/gi, r = [];
340
340
  let s = -1, i;
341
341
  for (n.lastIndex = 0; (i = n.exec(e)) !== null; ) {
@@ -343,9 +343,9 @@ function vt(e) {
343
343
  const h = i[1] ?? "", o = i[2], f = o ? o.trim() : "", d = i[3];
344
344
  let x;
345
345
  if (d) {
346
- const p = d.split(`
347
- `).map((v) => v.trim()).filter((v) => v.length > 0).join(" ");
348
- p && (x = p);
346
+ const m = d.split(`
347
+ `).map((w) => w.trim()).filter((w) => w.length > 0).join(" ");
348
+ m && (x = m);
349
349
  }
350
350
  r.push({ id: h, label: f, description: x });
351
351
  }
@@ -356,10 +356,10 @@ function vt(e) {
356
356
  const h = c[1].trim(), o = c[2], f = /(\d+)\.\s+([^\n]+)/g;
357
357
  let d;
358
358
  for (; (d = f.exec(o)) !== null; ) {
359
- const x = d[1] ?? "", p = d[2], v = p ? p.trim() : "";
359
+ const x = d[1] ?? "", m = d[2], w = m ? m.trim() : "";
360
360
  r.push({
361
361
  id: x,
362
- label: v
362
+ label: w
363
363
  });
364
364
  }
365
365
  if (r.length >= 2)
@@ -386,7 +386,7 @@ function cr({ className: e }) {
386
386
  function We({ className: e }) {
387
387
  return /* @__PURE__ */ t("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ t("polyline", { points: "6 9 12 15 18 9" }) });
388
388
  }
389
- function ye({ className: e }) {
389
+ function be({ 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
392
  function dr({ className: e }) {
@@ -395,7 +395,7 @@ function dr({ className: e }) {
395
395
  function ur({ 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
- function Ee({ className: e }) {
398
+ function Ie({ className: e }) {
399
399
  return /* @__PURE__ */ a("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
400
400
  /* @__PURE__ */ t("polyline", { points: "4 17 10 11 4 5" }),
401
401
  /* @__PURE__ */ t("line", { x1: "12", y1: "19", x2: "20", y2: "19" })
@@ -415,7 +415,7 @@ function Oe({ className: e }) {
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" })
416
416
  ] });
417
417
  }
418
- function yt({ className: e }) {
418
+ function Nt({ className: e }) {
419
419
  return /* @__PURE__ */ a("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
420
420
  /* @__PURE__ */ t("path", { d: "M14 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V8z" }),
421
421
  /* @__PURE__ */ t("polyline", { points: "14 2 14 8 20 8" }),
@@ -423,30 +423,30 @@ function yt({ className: e }) {
423
423
  /* @__PURE__ */ t("line", { x1: "9", y1: "15", x2: "15", y2: "15" })
424
424
  ] });
425
425
  }
426
- function Te({ className: e }) {
426
+ function Se({ className: e }) {
427
427
  return /* @__PURE__ */ a("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
428
428
  /* @__PURE__ */ t("circle", { cx: "11", cy: "11", r: "8" }),
429
429
  /* @__PURE__ */ t("line", { x1: "21", y1: "21", x2: "16.65", y2: "16.65" })
430
430
  ] });
431
431
  }
432
- function bt({ className: e }) {
432
+ function kt({ className: e }) {
433
433
  return /* @__PURE__ */ a("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
434
434
  /* @__PURE__ */ t("circle", { cx: "12", cy: "12", r: "10" }),
435
435
  /* @__PURE__ */ t("line", { x1: "2", y1: "12", x2: "22", y2: "12" }),
436
436
  /* @__PURE__ */ t("path", { d: "M12 2a15.3 15.3 0 0 1 4 10 15.3 15.3 0 0 1-4 10 15.3 15.3 0 0 1-4-10 15.3 15.3 0 0 1 4-10z" })
437
437
  ] });
438
438
  }
439
- function Nt({ className: e }) {
439
+ function Ct({ className: e }) {
440
440
  return /* @__PURE__ */ a("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
441
441
  /* @__PURE__ */ t("path", { d: "M12 2v6" }),
442
442
  /* @__PURE__ */ t("path", { d: "M6 6v4a6 6 0 0 0 12 0V6" }),
443
443
  /* @__PURE__ */ t("path", { d: "M12 16v6" })
444
444
  ] });
445
445
  }
446
- function kt({ className: e }) {
446
+ function _t({ className: e }) {
447
447
  return /* @__PURE__ */ t("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: /* @__PURE__ */ t("path", { d: "M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z" }) });
448
448
  }
449
- function Ct({ className: e }) {
449
+ function Tt({ className: e }) {
450
450
  return /* @__PURE__ */ a("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
451
451
  /* @__PURE__ */ t("path", { d: "M22 19a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h5l2 3h9a2 2 0 0 1 2 2z" }),
452
452
  /* @__PURE__ */ t("circle", { cx: "11", cy: "13", r: "3" }),
@@ -459,22 +459,22 @@ function hr({ className: e }) {
459
459
  /* @__PURE__ */ t("polyline", { points: "8 6 2 12 8 18" })
460
460
  ] });
461
461
  }
462
- function mr({ className: e }) {
462
+ function St({ className: e }) {
463
463
  return /* @__PURE__ */ a("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" })
466
466
  ] });
467
467
  }
468
- function _t({ className: e }) {
468
+ function Ye({ 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 pr({ className: e }) {
471
+ function mr({ className: e }) {
472
472
  return /* @__PURE__ */ a("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" })
475
475
  ] });
476
476
  }
477
- function Tt({ className: e }) {
477
+ function Mt({ className: e }) {
478
478
  return /* @__PURE__ */ a("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
479
479
  /* @__PURE__ */ t("line", { x1: "12", y1: "2", x2: "12", y2: "6" }),
480
480
  /* @__PURE__ */ t("line", { x1: "12", y1: "18", x2: "12", y2: "22" }),
@@ -486,28 +486,28 @@ function Tt({ className: e }) {
486
486
  /* @__PURE__ */ t("line", { x1: "16.24", y1: "7.76", x2: "19.07", y2: "4.93" })
487
487
  ] });
488
488
  }
489
- function St({ className: e }) {
489
+ function Et({ className: e }) {
490
490
  return /* @__PURE__ */ a("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
491
491
  /* @__PURE__ */ t("circle", { cx: "12", cy: "12", r: "10" }),
492
492
  /* @__PURE__ */ t("line", { x1: "12", y1: "16", x2: "12", y2: "12" }),
493
493
  /* @__PURE__ */ t("line", { x1: "12", y1: "8", x2: "12.01", y2: "8" })
494
494
  ] });
495
495
  }
496
- function Ye({ className: e }) {
496
+ function Ze({ className: e }) {
497
497
  return /* @__PURE__ */ a("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
498
498
  /* @__PURE__ */ t("path", { d: "M10.29 3.86L1.82 18a2 2 0 0 0 1.71 3h16.94a2 2 0 0 0 1.71-3L13.71 3.86a2 2 0 0 0-3.42 0z" }),
499
499
  /* @__PURE__ */ t("line", { x1: "12", y1: "9", x2: "12", y2: "13" }),
500
500
  /* @__PURE__ */ t("line", { x1: "12", y1: "17", x2: "12.01", y2: "17" })
501
501
  ] });
502
502
  }
503
- function Mt({ className: e }) {
503
+ function It({ className: e }) {
504
504
  return /* @__PURE__ */ a("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
505
505
  /* @__PURE__ */ t("circle", { cx: "12", cy: "12", r: "10" }),
506
506
  /* @__PURE__ */ t("line", { x1: "12", y1: "8", x2: "12", y2: "12" }),
507
507
  /* @__PURE__ */ t("line", { x1: "12", y1: "16", x2: "12.01", y2: "16" })
508
508
  ] });
509
509
  }
510
- function Et({ className: e }) {
510
+ function Lt({ className: e }) {
511
511
  return /* @__PURE__ */ a("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
512
512
  /* @__PURE__ */ t("rect", { x: "8", y: "6", width: "8", height: "14", rx: "4" }),
513
513
  /* @__PURE__ */ t("path", { d: "M3 10h2" }),
@@ -518,51 +518,51 @@ function Et({ className: e }) {
518
518
  /* @__PURE__ */ t("path", { d: "M12 2v4" })
519
519
  ] });
520
520
  }
521
- function It({ className: e }) {
521
+ function $t({ className: e }) {
522
522
  return /* @__PURE__ */ a("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 Lt({ className: e }) {
527
+ function Rt({ className: e }) {
528
528
  return /* @__PURE__ */ a("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" }),
531
531
  /* @__PURE__ */ t("line", { x1: "9", y1: "9", x2: "15", y2: "15" })
532
532
  ] });
533
533
  }
534
- function fr({ className: e }) {
534
+ function pr({ className: e }) {
535
535
  return /* @__PURE__ */ a("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
536
536
  /* @__PURE__ */ t("line", { x1: "22", y1: "2", x2: "11", y2: "13" }),
537
537
  /* @__PURE__ */ t("polygon", { points: "22 2 15 22 11 13 2 9 22 2" })
538
538
  ] });
539
539
  }
540
- function $t({ className: e }) {
540
+ function At({ 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
- function xr({ className: e }) {
543
+ function fr({ className: e }) {
544
544
  return /* @__PURE__ */ a("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
545
545
  /* @__PURE__ */ t("circle", { cx: "12", cy: "12", r: "10" }),
546
546
  /* @__PURE__ */ t("rect", { x: "9", y: "9", width: "6", height: "6" })
547
547
  ] });
548
548
  }
549
- function gr({ className: e }) {
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 Rt({ className: e }) {
552
+ function Qe({ className: e }) {
553
553
  return /* @__PURE__ */ a("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" }),
556
556
  /* @__PURE__ */ t("path", { d: "M19 11l.5 1.5L21 13l-1.5.5L19 15l-.5-1.5L17 13l1.5-.5L19 11z" })
557
557
  ] });
558
558
  }
559
- function wr({ className: e }) {
559
+ function gr({ className: e }) {
560
560
  return /* @__PURE__ */ a("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
561
561
  /* @__PURE__ */ t("path", { d: "M9.5 2A2.5 2.5 0 0 1 12 4.5v15a2.5 2.5 0 0 1-4.96.44 2.5 2.5 0 0 1-2.96-3.08 3 3 0 0 1-.34-5.58 2.5 2.5 0 0 1 1.32-4.24 2.5 2.5 0 0 1 4.44-1.54" }),
562
562
  /* @__PURE__ */ t("path", { d: "M14.5 2A2.5 2.5 0 0 0 12 4.5v15a2.5 2.5 0 0 0 4.96.44 2.5 2.5 0 0 0 2.96-3.08 3 3 0 0 0 .34-5.58 2.5 2.5 0 0 0-1.32-4.24 2.5 2.5 0 0 0-4.44-1.54" })
563
563
  ] });
564
564
  }
565
- function me({ className: e }) {
565
+ function xe({ className: e }) {
566
566
  return /* @__PURE__ */ a("svg", { className: e, viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
567
567
  /* @__PURE__ */ t("path", { d: "M12 8V4H8" }),
568
568
  /* @__PURE__ */ t("rect", { x: "5", y: "8", width: "14", height: "12", rx: "2" }),
@@ -572,16 +572,16 @@ function me({ className: e }) {
572
572
  /* @__PURE__ */ t("path", { d: "M15 13v2" })
573
573
  ] });
574
574
  }
575
- function At({ className: e }) {
575
+ function Dt({ className: e }) {
576
576
  return /* @__PURE__ */ a("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 Dt({ className: e }) {
581
+ function jt({ 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 jt({ className: e }) {
584
+ function Wt({ className: e }) {
585
585
  return /* @__PURE__ */ a("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,16 +591,16 @@ function jt({ className: e }) {
591
591
  /* @__PURE__ */ t("path", { d: "M3 18l2 2 4-4" })
592
592
  ] });
593
593
  }
594
- function Wt({ className: e }) {
594
+ function Bt({ className: e }) {
595
595
  return /* @__PURE__ */ a("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" })
598
598
  ] });
599
599
  }
600
- function qe({ className: e }) {
600
+ function He({ 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 Bt({ status: e, size: n = "sm", className: r }) {
603
+ function Ot({ 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",
@@ -613,7 +613,7 @@ function Bt({ status: e, size: n = "sm", className: r }) {
613
613
  return /* @__PURE__ */ t(
614
614
  "div",
615
615
  {
616
- className: m(
616
+ className: p(
617
617
  "rounded-full flex-shrink-0",
618
618
  s[n],
619
619
  i[e],
@@ -622,61 +622,84 @@ function Bt({ status: e, size: n = "sm", className: r }) {
622
622
  }
623
623
  );
624
624
  }
625
- function Ze({ actionType: e, className: n = "w-4 h-4" }) {
625
+ function Xe({ actionType: e, className: n = "w-4 h-4" }) {
626
626
  switch (e.action) {
627
627
  case "command_run":
628
- return /* @__PURE__ */ t(Ee, { className: n });
628
+ return /* @__PURE__ */ t(Ie, { className: n });
629
629
  case "file_read":
630
630
  return /* @__PURE__ */ t(Be, { className: n });
631
631
  case "file_edit":
632
632
  return /* @__PURE__ */ t(Oe, { className: n });
633
633
  case "file_write":
634
- return /* @__PURE__ */ t(yt, { className: n });
634
+ return /* @__PURE__ */ t(Nt, { className: n });
635
635
  case "search":
636
- return /* @__PURE__ */ t(Te, { className: n });
636
+ return /* @__PURE__ */ t(Se, { className: n });
637
637
  case "glob":
638
- return /* @__PURE__ */ t(Ct, { className: n });
638
+ return /* @__PURE__ */ t(Tt, { className: n });
639
639
  case "web_fetch":
640
- return /* @__PURE__ */ t(bt, { className: n });
640
+ return /* @__PURE__ */ t(kt, { className: n });
641
641
  case "web_search":
642
- return /* @__PURE__ */ t(Te, { className: n });
642
+ return /* @__PURE__ */ t(Se, { className: n });
643
643
  case "mcp_tool":
644
- return /* @__PURE__ */ t(Nt, { className: n });
644
+ return /* @__PURE__ */ t(Ct, { className: n });
645
645
  case "todo_write":
646
- return /* @__PURE__ */ t(jt, { className: n });
646
+ return /* @__PURE__ */ t(Wt, { className: n });
647
647
  case "agent_tool":
648
- return /* @__PURE__ */ t(me, { className: n });
648
+ return /* @__PURE__ */ t(xe, { className: n });
649
649
  case "generic_tool":
650
650
  default:
651
- return /* @__PURE__ */ t(kt, { className: n });
651
+ return /* @__PURE__ */ t(_t, { className: n });
652
652
  }
653
653
  }
654
- function ce({
654
+ function oe({
655
655
  children: e,
656
656
  maxHeight: n = 200,
657
657
  language: r,
658
658
  showLineNumbers: s = !1,
659
659
  className: i
660
660
  }) {
661
- const [l, c] = N(!1), h = e.split(`
662
- `), o = h.length > 10 || e.length > 500;
663
- return /* @__PURE__ */ a("div", { className: m("relative", i), children: [
661
+ const [l, c] = N(!1), [h, o] = N(!1), f = e.split(`
662
+ `), d = f.length > 10 || e.length > 500, x = F(async () => {
663
+ try {
664
+ await navigator.clipboard.writeText(e), o(!0), setTimeout(() => o(!1), 2e3);
665
+ } catch (m) {
666
+ console.error("Failed to copy:", m);
667
+ }
668
+ }, [e]);
669
+ return /* @__PURE__ */ a("div", { className: p("relative rounded-lg overflow-hidden border border-white/10", i), children: [
670
+ /* @__PURE__ */ a("div", { className: "flex items-center justify-between px-4 py-2 bg-[var(--ash-code-header-bg)] border-b border-white/10", children: [
671
+ /* @__PURE__ */ t("span", { className: "text-xs text-white/60 font-medium", children: r || "code" }),
672
+ /* @__PURE__ */ t(
673
+ "button",
674
+ {
675
+ onClick: x,
676
+ className: "flex items-center gap-1.5 text-xs text-white/60 hover:text-white transition-colors",
677
+ children: h ? /* @__PURE__ */ a(_, { children: [
678
+ /* @__PURE__ */ t(Ye, { className: "w-3.5 h-3.5" }),
679
+ /* @__PURE__ */ t("span", { children: "Copied!" })
680
+ ] }) : /* @__PURE__ */ a(_, { children: [
681
+ /* @__PURE__ */ t(St, { className: "w-3.5 h-3.5" }),
682
+ /* @__PURE__ */ t("span", { children: "Copy" })
683
+ ] })
684
+ }
685
+ )
686
+ ] }),
664
687
  /* @__PURE__ */ t(
665
688
  "pre",
666
689
  {
667
- className: m(
668
- "ash-tool-code-block text-xs font-mono text-white/90 p-3 rounded-xl overflow-x-auto whitespace-pre-wrap break-words",
669
- !l && o && "overflow-y-hidden"
690
+ className: p(
691
+ "text-xs font-mono text-white/90 p-4 bg-black/30 overflow-x-auto whitespace-pre-wrap break-words",
692
+ !l && d && "overflow-y-hidden"
670
693
  ),
671
- style: !l && o ? { maxHeight: n } : void 0,
694
+ style: !l && d ? { maxHeight: n } : void 0,
672
695
  "data-language": r,
673
- children: s ? /* @__PURE__ */ t("code", { children: h.map((f, d) => /* @__PURE__ */ a("span", { className: "block", children: [
674
- /* @__PURE__ */ t("span", { className: "inline-block w-8 text-white/30 select-none text-right pr-2", children: d + 1 }),
675
- /* @__PURE__ */ t("span", { className: "text-white/80", children: f })
676
- ] }, d)) }) : /* @__PURE__ */ t("code", { className: "text-white/80", children: e })
696
+ children: s ? /* @__PURE__ */ t("code", { children: f.map((m, w) => /* @__PURE__ */ a("span", { className: "block", children: [
697
+ /* @__PURE__ */ t("span", { className: "inline-block w-8 text-white/30 select-none text-right pr-2", children: w + 1 }),
698
+ /* @__PURE__ */ t("span", { className: "text-white/80", children: m })
699
+ ] }, w)) }) : /* @__PURE__ */ t("code", { className: "text-white/80", children: e })
677
700
  }
678
701
  ),
679
- o && !l && /* @__PURE__ */ t("div", { className: "absolute bottom-0 left-0 right-0 h-12 ash-truncate-fade flex items-end justify-center pb-2", children: /* @__PURE__ */ t(
702
+ d && !l && /* @__PURE__ */ t("div", { className: "absolute bottom-0 left-0 right-0 h-12 ash-truncate-fade flex items-end justify-center pb-2", children: /* @__PURE__ */ t(
680
703
  "button",
681
704
  {
682
705
  onClick: () => c(!0),
@@ -684,7 +707,7 @@ function ce({
684
707
  children: "Show more"
685
708
  }
686
709
  ) }),
687
- o && l && /* @__PURE__ */ t(
710
+ d && l && /* @__PURE__ */ t(
688
711
  "button",
689
712
  {
690
713
  onClick: () => c(!1),
@@ -694,43 +717,43 @@ function ce({
694
717
  )
695
718
  ] });
696
719
  }
697
- function Se({ value: e, maxHeight: n, className: r }) {
720
+ function Me({ value: e, maxHeight: n, className: r }) {
698
721
  const s = JSON.stringify(e, null, 2);
699
- return /* @__PURE__ */ t(ce, { maxHeight: n, className: r, children: s });
722
+ return /* @__PURE__ */ t(oe, { maxHeight: n, className: r, children: s });
700
723
  }
701
- function Qe({
724
+ function et({
702
725
  toolCall: e,
703
726
  defaultExpanded: n = !1,
704
727
  className: r,
705
728
  depth: s = 0
706
729
  }) {
707
- const [i, l] = N(n), [c, h] = N(""), o = G(null), { actionType: f, status: d, summary: x, nestedToolCalls: p, nestedToolCallCount: v, startedAt: E } = e, D = ae(() => {
730
+ const [i, l] = N(n), [c, h] = N(""), o = V(null), { actionType: f, status: d, summary: x, nestedToolCalls: m, nestedToolCallCount: w, startedAt: E } = e, D = ae(() => {
708
731
  if (f.action !== "agent_tool")
709
732
  return null;
710
- const j = f;
733
+ const W = f;
711
734
  return {
712
- agentType: j.agentType,
713
- description: j.description,
714
- prompt: j.prompt
735
+ agentType: W.agentType,
736
+ description: W.description,
737
+ prompt: W.prompt
715
738
  };
716
- }, [f]), R = v ?? (p == null ? void 0 : p.length) ?? 0, _ = d === "pending";
717
- if (z(() => {
718
- if (_ && E)
719
- return h(He(E)), o.current = setInterval(() => {
720
- h(He(E));
739
+ }, [f]), R = w ?? (m == null ? void 0 : m.length) ?? 0, T = d === "pending";
740
+ if (P(() => {
741
+ if (T && E)
742
+ return h(Ve(E)), o.current = setInterval(() => {
743
+ h(Ve(E));
721
744
  }, 1e3), () => {
722
745
  o.current && (clearInterval(o.current), o.current = null);
723
746
  };
724
- _ || (o.current && (clearInterval(o.current), o.current = null), h(""));
725
- }, [_, E]), !D)
747
+ T || (o.current && (clearInterval(o.current), o.current = null), h(""));
748
+ }, [T, E]), !D)
726
749
  return null;
727
- const { agentType: Q, description: T, prompt: F } = D, A = s > 0 ? "ml-4" : "";
750
+ const { agentType: X, description: S, prompt: G } = D, A = s > 0 ? "ml-4" : "";
728
751
  return /* @__PURE__ */ a(
729
752
  "div",
730
753
  {
731
- className: m(
754
+ className: p(
732
755
  "rounded-xl border bg-[var(--ash-surface-dark,#0a0a0a)] overflow-hidden",
733
- _ ? "border-yellow-500/30" : d === "failed" ? "border-red-500/30" : "border-white/10",
756
+ T ? "border-yellow-500/30" : d === "failed" ? "border-red-500/30" : "border-white/10",
734
757
  A,
735
758
  r
736
759
  ),
@@ -742,9 +765,9 @@ function Qe({
742
765
  className: "w-full px-4 py-3 flex items-center gap-3 hover:bg-white/5 cursor-pointer transition-colors",
743
766
  children: [
744
767
  /* @__PURE__ */ t(
745
- ye,
768
+ be,
746
769
  {
747
- className: m(
770
+ className: p(
748
771
  "w-4 h-4 text-white/40 transition-transform duration-200 shrink-0",
749
772
  i && "rotate-90"
750
773
  )
@@ -753,19 +776,19 @@ function Qe({
753
776
  /* @__PURE__ */ t(
754
777
  "div",
755
778
  {
756
- className: m(
779
+ className: p(
757
780
  "w-6 h-6 rounded-lg flex items-center justify-center shrink-0",
758
- _ ? "bg-yellow-500/20" : d === "failed" ? "bg-red-500/20" : "bg-[var(--ash-accent)]/20"
781
+ T ? "bg-yellow-500/20" : d === "failed" ? "bg-red-500/20" : "bg-[var(--ash-accent)]/20"
759
782
  ),
760
- children: _ ? /* @__PURE__ */ t(
761
- qe,
783
+ children: T ? /* @__PURE__ */ t(
784
+ He,
762
785
  {
763
786
  className: "w-3.5 h-3.5 text-yellow-400 animate-spin"
764
787
  }
765
788
  ) : /* @__PURE__ */ t(
766
- me,
789
+ xe,
767
790
  {
768
- className: m(
791
+ className: p(
769
792
  "w-3.5 h-3.5",
770
793
  d === "failed" ? "text-red-400" : "text-[var(--ash-accent)]"
771
794
  )
@@ -776,21 +799,21 @@ function Qe({
776
799
  /* @__PURE__ */ t(
777
800
  "span",
778
801
  {
779
- className: m(
802
+ className: p(
780
803
  "px-2 py-0.5 rounded text-xs font-medium shrink-0",
781
- _ ? "bg-yellow-500/20 text-yellow-400" : d === "failed" ? "bg-red-500/20 text-red-400" : "bg-white/10 text-white/70"
804
+ T ? "bg-yellow-500/20 text-yellow-400" : d === "failed" ? "bg-red-500/20 text-red-400" : "bg-white/10 text-white/70"
782
805
  ),
783
- children: Q
806
+ children: X
784
807
  }
785
808
  ),
786
- /* @__PURE__ */ t("span", { className: "text-sm text-white/80 truncate flex-1 text-left", children: T || x }),
809
+ /* @__PURE__ */ t("span", { className: "text-sm text-white/80 truncate flex-1 text-left", children: S || x }),
787
810
  R > 0 && /* @__PURE__ */ a("span", { className: "text-xs text-white/50 shrink-0", children: [
788
811
  R,
789
812
  " tool call",
790
813
  R !== 1 ? "s" : ""
791
814
  ] }),
792
- _ && c && /* @__PURE__ */ a("div", { className: "flex items-center gap-1 text-xs text-white/40 shrink-0", children: [
793
- /* @__PURE__ */ t(Wt, { className: "w-3 h-3" }),
815
+ T && c && /* @__PURE__ */ a("div", { className: "flex items-center gap-1 text-xs text-white/40 shrink-0", children: [
816
+ /* @__PURE__ */ t(Bt, { className: "w-3 h-3" }),
794
817
  /* @__PURE__ */ t("span", { children: c })
795
818
  ] }),
796
819
  /* @__PURE__ */ t("span", { className: "text-white/30 shrink-0", children: "..." })
@@ -798,26 +821,26 @@ function Qe({
798
821
  }
799
822
  ),
800
823
  i && /* @__PURE__ */ a("div", { className: "border-t border-white/5 bg-black/20", children: [
801
- F && /* @__PURE__ */ t("div", { className: "px-4 py-3 border-b border-white/5", children: /* @__PURE__ */ t("p", { className: "text-sm text-white/70 whitespace-pre-wrap", children: F.length > 500 ? F.substring(0, 500) + "..." : F }) }),
802
- p && p.length > 0 && /* @__PURE__ */ t("div", { className: "p-3 space-y-2", children: p.map((j) => /* @__PURE__ */ t("div", { children: j.actionType.action === "agent_tool" ? /* @__PURE__ */ t(
803
- Qe,
824
+ G && /* @__PURE__ */ t("div", { className: "px-4 py-3 border-b border-white/5", children: /* @__PURE__ */ t("p", { className: "text-sm text-white/70 whitespace-pre-wrap", children: G.length > 500 ? G.substring(0, 500) + "..." : G }) }),
825
+ m && m.length > 0 && /* @__PURE__ */ t("div", { className: "p-3 space-y-2", children: m.map((W) => /* @__PURE__ */ t("div", { children: W.actionType.action === "agent_tool" ? /* @__PURE__ */ t(
826
+ et,
804
827
  {
805
- toolCall: j,
828
+ toolCall: W,
806
829
  defaultExpanded: !1,
807
830
  depth: s + 1
808
831
  }
809
832
  ) : /* @__PURE__ */ t(
810
833
  ze,
811
834
  {
812
- toolCall: j,
835
+ toolCall: W,
813
836
  defaultExpanded: !1
814
837
  }
815
- ) }, j.id)) }),
816
- (!p || p.length === 0) && _ && /* @__PURE__ */ t("div", { className: "px-4 py-6 flex items-center justify-center", children: /* @__PURE__ */ a("div", { className: "flex items-center gap-2 text-sm text-white/40", children: [
817
- /* @__PURE__ */ t(qe, { className: "w-4 h-4 animate-spin" }),
838
+ ) }, W.id)) }),
839
+ (!m || m.length === 0) && T && /* @__PURE__ */ t("div", { className: "px-4 py-6 flex items-center justify-center", children: /* @__PURE__ */ a("div", { className: "flex items-center gap-2 text-sm text-white/40", children: [
840
+ /* @__PURE__ */ t(He, { className: "w-4 h-4 animate-spin" }),
818
841
  /* @__PURE__ */ t("span", { children: "Agent is working..." })
819
842
  ] }) }),
820
- (!p || p.length === 0) && !_ && /* @__PURE__ */ t("div", { className: "px-4 py-4 text-sm text-white/40 text-center", children: "No tool calls recorded" })
843
+ (!m || m.length === 0) && !T && /* @__PURE__ */ t("div", { className: "px-4 py-4 text-sm text-white/40 text-center", children: "No tool calls recorded" })
821
844
  ] })
822
845
  ]
823
846
  }
@@ -829,17 +852,17 @@ function L({ children: e }) {
829
852
  function $({ children: e }) {
830
853
  return /* @__PURE__ */ t("div", { className: "px-3 py-1.5", children: e });
831
854
  }
832
- function Ot({ action: e }) {
855
+ function zt({ action: e }) {
833
856
  var n;
834
- return /* @__PURE__ */ a(S, { children: [
835
- e.command && /* @__PURE__ */ a(S, { children: [
857
+ return /* @__PURE__ */ a(_, { children: [
858
+ e.command && /* @__PURE__ */ a(_, { children: [
836
859
  /* @__PURE__ */ t(L, { children: "COMMAND" }),
837
- /* @__PURE__ */ t($, { children: /* @__PURE__ */ t(ce, { children: e.command }) })
860
+ /* @__PURE__ */ t($, { children: /* @__PURE__ */ t(oe, { children: e.command }) })
838
861
  ] }),
839
- ((n = e.result) == null ? void 0 : n.output) && /* @__PURE__ */ a(S, { children: [
862
+ ((n = e.result) == null ? void 0 : n.output) && /* @__PURE__ */ a(_, { children: [
840
863
  /* @__PURE__ */ t(L, { children: "OUTPUT" }),
841
864
  /* @__PURE__ */ a($, { children: [
842
- /* @__PURE__ */ t(ce, { maxHeight: 300, children: e.result.output }),
865
+ /* @__PURE__ */ t(oe, { maxHeight: 300, children: e.result.output }),
843
866
  e.result.exitCode !== void 0 && e.result.exitCode !== 0 && /* @__PURE__ */ a("div", { className: "mt-2 text-xs text-red-400", children: [
844
867
  "Exit code: ",
845
868
  e.result.exitCode
@@ -848,8 +871,8 @@ function Ot({ action: e }) {
848
871
  ] })
849
872
  ] });
850
873
  }
851
- function zt({ action: e }) {
852
- return /* @__PURE__ */ a(S, { children: [
874
+ function Ft({ action: e }) {
875
+ return /* @__PURE__ */ a(_, { children: [
853
876
  /* @__PURE__ */ t(L, { children: "PATH" }),
854
877
  /* @__PURE__ */ a($, { children: [
855
878
  /* @__PURE__ */ t("code", { className: "text-xs font-mono bg-white/10 text-white/90 px-1 py-0.5 rounded", children: e.path }),
@@ -867,32 +890,32 @@ function zt({ action: e }) {
867
890
  ] })
868
891
  ] });
869
892
  }
870
- function Ft({ action: e }) {
871
- return /* @__PURE__ */ a(S, { children: [
893
+ function Pt({ action: e }) {
894
+ return /* @__PURE__ */ a(_, { children: [
872
895
  /* @__PURE__ */ t(L, { children: "PATH" }),
873
896
  /* @__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 }) }),
874
- e.oldString && /* @__PURE__ */ a(S, { children: [
897
+ e.oldString && /* @__PURE__ */ a(_, { children: [
875
898
  /* @__PURE__ */ t(L, { children: "OLD" }),
876
- /* @__PURE__ */ t($, { children: /* @__PURE__ */ t(ce, { children: e.oldString }) })
899
+ /* @__PURE__ */ t($, { children: /* @__PURE__ */ t(oe, { children: e.oldString }) })
877
900
  ] }),
878
- e.newString && /* @__PURE__ */ a(S, { children: [
901
+ e.newString && /* @__PURE__ */ a(_, { children: [
879
902
  /* @__PURE__ */ t(L, { children: "NEW" }),
880
- /* @__PURE__ */ t($, { children: /* @__PURE__ */ t(ce, { children: e.newString }) })
903
+ /* @__PURE__ */ t($, { children: /* @__PURE__ */ t(oe, { children: e.newString }) })
881
904
  ] })
882
905
  ] });
883
906
  }
884
- function Pt({ action: e }) {
885
- return /* @__PURE__ */ a(S, { children: [
907
+ function Gt({ action: e }) {
908
+ return /* @__PURE__ */ a(_, { children: [
886
909
  /* @__PURE__ */ t(L, { children: "PATH" }),
887
910
  /* @__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 }) }),
888
- e.content && /* @__PURE__ */ a(S, { children: [
911
+ e.content && /* @__PURE__ */ a(_, { children: [
889
912
  /* @__PURE__ */ t(L, { children: "CONTENT" }),
890
- /* @__PURE__ */ t($, { children: /* @__PURE__ */ t(ce, { maxHeight: 300, children: e.content }) })
913
+ /* @__PURE__ */ t($, { children: /* @__PURE__ */ t(oe, { maxHeight: 300, children: e.content }) })
891
914
  ] })
892
915
  ] });
893
916
  }
894
- function Gt({ action: e }) {
895
- return /* @__PURE__ */ a(S, { children: [
917
+ function Vt({ action: e }) {
918
+ return /* @__PURE__ */ a(_, { children: [
896
919
  /* @__PURE__ */ t(L, { children: "PATTERN" }),
897
920
  /* @__PURE__ */ a($, { children: [
898
921
  /* @__PURE__ */ t("code", { className: "text-xs font-mono bg-white/10 text-white/90 px-1 py-0.5 rounded", children: e.pattern }),
@@ -914,7 +937,7 @@ function Gt({ action: e }) {
914
937
  ] });
915
938
  }
916
939
  function Ht({ action: e }) {
917
- return /* @__PURE__ */ a(S, { children: [
940
+ return /* @__PURE__ */ a(_, { children: [
918
941
  /* @__PURE__ */ t(L, { children: "PATTERN" }),
919
942
  /* @__PURE__ */ a($, { children: [
920
943
  /* @__PURE__ */ t("code", { className: "text-xs font-mono bg-white/10 text-white/90 px-1 py-0.5 rounded", children: e.pattern }),
@@ -926,7 +949,7 @@ function Ht({ action: e }) {
926
949
  ] });
927
950
  }
928
951
  function qt({ action: e }) {
929
- return /* @__PURE__ */ a(S, { children: [
952
+ return /* @__PURE__ */ a(_, { children: [
930
953
  /* @__PURE__ */ t(L, { children: "URL" }),
931
954
  /* @__PURE__ */ a($, { children: [
932
955
  /* @__PURE__ */ t(
@@ -943,46 +966,46 @@ function qt({ action: e }) {
943
966
  ] })
944
967
  ] });
945
968
  }
946
- function Vt({ action: e }) {
947
- return /* @__PURE__ */ a(S, { children: [
969
+ function Jt({ action: e }) {
970
+ return /* @__PURE__ */ a(_, { children: [
948
971
  /* @__PURE__ */ t(L, { children: "QUERY" }),
949
972
  /* @__PURE__ */ t($, { children: /* @__PURE__ */ t("span", { className: "text-sm text-white/90", children: e.query }) })
950
973
  ] });
951
974
  }
952
- function Jt({ action: e, isError: n }) {
953
- return /* @__PURE__ */ a(S, { children: [
975
+ function Ut({ action: e, isError: n }) {
976
+ return /* @__PURE__ */ a(_, { children: [
954
977
  /* @__PURE__ */ t(L, { children: "TOOL" }),
955
978
  /* @__PURE__ */ t($, { children: /* @__PURE__ */ a("code", { className: "text-xs font-mono bg-white/10 text-white/90 px-1 py-0.5 rounded", children: [
956
979
  e.serverName,
957
980
  ":",
958
981
  e.toolName
959
982
  ] }) }),
960
- e.arguments && /* @__PURE__ */ a(S, { children: [
983
+ e.arguments && /* @__PURE__ */ a(_, { children: [
961
984
  /* @__PURE__ */ t(L, { children: "ARGS" }),
962
- /* @__PURE__ */ t($, { children: /* @__PURE__ */ t(Se, { value: e.arguments }) })
985
+ /* @__PURE__ */ t($, { children: /* @__PURE__ */ t(Me, { value: e.arguments }) })
963
986
  ] }),
964
- e.result && /* @__PURE__ */ a(S, { children: [
987
+ e.result && /* @__PURE__ */ a(_, { children: [
965
988
  /* @__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(ce, { children: String(e.result.value) }) : /* @__PURE__ */ t(Se, { value: e.result.value }) }) })
989
+ /* @__PURE__ */ t($, { children: /* @__PURE__ */ t("div", { className: n ? "text-red-400" : "", children: e.result.type === "markdown" ? /* @__PURE__ */ t(oe, { children: String(e.result.value) }) : /* @__PURE__ */ t(Me, { value: e.result.value }) }) })
967
990
  ] })
968
991
  ] });
969
992
  }
970
- function Ut({ action: e, isError: n }) {
971
- return /* @__PURE__ */ a(S, { children: [
972
- e.arguments && /* @__PURE__ */ a(S, { children: [
993
+ function Kt({ action: e, isError: n }) {
994
+ return /* @__PURE__ */ a(_, { children: [
995
+ e.arguments && /* @__PURE__ */ a(_, { children: [
973
996
  /* @__PURE__ */ t(L, { children: "ARGS" }),
974
- /* @__PURE__ */ t($, { children: /* @__PURE__ */ t(Se, { value: e.arguments }) })
997
+ /* @__PURE__ */ t($, { children: /* @__PURE__ */ t(Me, { value: e.arguments }) })
975
998
  ] }),
976
- e.result && /* @__PURE__ */ a(S, { children: [
999
+ e.result && /* @__PURE__ */ a(_, { children: [
977
1000
  /* @__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(ce, { children: String(e.result.value) }) : /* @__PURE__ */ t(Se, { value: e.result.value }) }) })
1001
+ /* @__PURE__ */ t($, { children: /* @__PURE__ */ t("div", { className: n ? "text-red-400" : "", children: e.result.type === "markdown" ? /* @__PURE__ */ t(oe, { children: String(e.result.value) }) : /* @__PURE__ */ t(Me, { value: e.result.value }) }) })
979
1002
  ] })
980
1003
  ] });
981
1004
  }
982
- function Kt({ action: e }) {
1005
+ function Yt({ action: e }) {
983
1006
  const { todos: n, stats: r } = e;
984
- return /* @__PURE__ */ a(S, { children: [
985
- r && /* @__PURE__ */ a(S, { children: [
1007
+ return /* @__PURE__ */ a(_, { children: [
1008
+ r && /* @__PURE__ */ a(_, { children: [
986
1009
  /* @__PURE__ */ t(L, { children: "PROGRESS" }),
987
1010
  /* @__PURE__ */ a($, { children: [
988
1011
  /* @__PURE__ */ a("div", { className: "flex items-center gap-3", children: [
@@ -1017,17 +1040,17 @@ function Kt({ action: e }) {
1017
1040
  return /* @__PURE__ */ a(
1018
1041
  "div",
1019
1042
  {
1020
- className: m(
1043
+ className: p(
1021
1044
  "flex items-start gap-2 py-1 transition-all duration-200",
1022
1045
  s.status === "completed" && "opacity-50",
1023
1046
  s.status === "in_progress" && "bg-yellow-500/10 -mx-2 px-2 rounded"
1024
1047
  ),
1025
1048
  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(Tt, { className: "w-4 h-4 text-yellow-400 animate-spin shrink-0 mt-0.5" }) : /* @__PURE__ */ t(Dt, { className: "w-4 h-4 text-white/30 shrink-0 mt-0.5" }),
1049
+ s.status === "completed" ? /* @__PURE__ */ t($t, { className: "w-4 h-4 text-emerald-400 shrink-0 mt-0.5" }) : s.status === "in_progress" ? /* @__PURE__ */ t(Mt, { className: "w-4 h-4 text-yellow-400 animate-spin shrink-0 mt-0.5" }) : /* @__PURE__ */ t(jt, { className: "w-4 h-4 text-white/30 shrink-0 mt-0.5" }),
1027
1050
  /* @__PURE__ */ a(
1028
1051
  "span",
1029
1052
  {
1030
- className: m(
1053
+ className: p(
1031
1054
  "text-sm leading-relaxed",
1032
1055
  s.status === "completed" ? "text-white/50 line-through" : "text-white/80"
1033
1056
  ),
@@ -1047,35 +1070,35 @@ function Kt({ action: e }) {
1047
1070
  }) }) })
1048
1071
  ] });
1049
1072
  }
1050
- function Yt({ actionType: e, isError: n }) {
1073
+ function Zt({ actionType: e, isError: n }) {
1051
1074
  switch (e.action) {
1052
1075
  case "command_run":
1053
- return /* @__PURE__ */ t(Ot, { action: e });
1054
- case "file_read":
1055
1076
  return /* @__PURE__ */ t(zt, { action: e });
1056
- case "file_edit":
1077
+ case "file_read":
1057
1078
  return /* @__PURE__ */ t(Ft, { action: e });
1058
- case "file_write":
1079
+ case "file_edit":
1059
1080
  return /* @__PURE__ */ t(Pt, { action: e });
1060
- case "search":
1081
+ case "file_write":
1061
1082
  return /* @__PURE__ */ t(Gt, { action: e });
1083
+ case "search":
1084
+ return /* @__PURE__ */ t(Vt, { action: e });
1062
1085
  case "glob":
1063
1086
  return /* @__PURE__ */ t(Ht, { action: e });
1064
1087
  case "web_fetch":
1065
1088
  return /* @__PURE__ */ t(qt, { action: e });
1066
1089
  case "web_search":
1067
- return /* @__PURE__ */ t(Vt, { action: e });
1090
+ return /* @__PURE__ */ t(Jt, { action: e });
1068
1091
  case "mcp_tool":
1069
- return /* @__PURE__ */ t(Jt, { action: e, isError: n });
1070
- case "generic_tool":
1071
1092
  return /* @__PURE__ */ t(Ut, { action: e, isError: n });
1093
+ case "generic_tool":
1094
+ return /* @__PURE__ */ t(Kt, { action: e, isError: n });
1072
1095
  case "todo_write":
1073
- return /* @__PURE__ */ t(Kt, { action: e });
1096
+ return /* @__PURE__ */ t(Yt, { action: e });
1074
1097
  default:
1075
1098
  return null;
1076
1099
  }
1077
1100
  }
1078
- function Zt(e) {
1101
+ function Qt(e) {
1079
1102
  var n;
1080
1103
  switch (e.action) {
1081
1104
  case "command_run":
@@ -1111,18 +1134,18 @@ function ze({ toolCall: e, defaultExpanded: n = !1, className: r }) {
1111
1134
  const [s, i] = N(n), { actionType: l, status: c, summary: h } = e;
1112
1135
  if (l.action === "agent_tool")
1113
1136
  return /* @__PURE__ */ t(
1114
- Qe,
1137
+ et,
1115
1138
  {
1116
1139
  toolCall: e,
1117
1140
  defaultExpanded: n,
1118
1141
  className: r
1119
1142
  }
1120
1143
  );
1121
- const o = Zt(l);
1144
+ const o = Qt(l);
1122
1145
  return /* @__PURE__ */ a(
1123
1146
  "div",
1124
1147
  {
1125
- className: m(
1148
+ className: p(
1126
1149
  "rounded-lg border bg-[var(--ash-surface-dark,#0a0a0a)] overflow-hidden",
1127
1150
  {
1128
1151
  pending: "border-yellow-500/30 ash-tool-status-pending",
@@ -1136,21 +1159,21 @@ function ze({ toolCall: e, defaultExpanded: n = !1, className: r }) {
1136
1159
  "button",
1137
1160
  {
1138
1161
  onClick: () => o && i(!s),
1139
- className: m(
1162
+ className: p(
1140
1163
  "w-full px-3 py-2 flex items-center justify-between transition-colors",
1141
1164
  o ? "hover:bg-white/5 cursor-pointer" : "cursor-default"
1142
1165
  ),
1143
1166
  disabled: !o,
1144
1167
  children: [
1145
1168
  /* @__PURE__ */ a("div", { className: "flex items-center gap-2 min-w-0 flex-1", children: [
1146
- /* @__PURE__ */ t("div", { className: m(
1169
+ /* @__PURE__ */ t("div", { className: p(
1147
1170
  "w-5 h-5 rounded flex items-center justify-center shrink-0",
1148
1171
  c === "pending" ? "bg-yellow-500/20" : c === "failed" ? "bg-red-500/20" : "bg-[var(--ash-accent)]/20"
1149
1172
  ), children: /* @__PURE__ */ t(
1150
- Ze,
1173
+ Xe,
1151
1174
  {
1152
1175
  actionType: l,
1153
- className: m(
1176
+ className: p(
1154
1177
  "w-3 h-3",
1155
1178
  c === "pending" ? "text-yellow-400" : c === "failed" ? "text-red-400" : "text-[var(--ash-accent)]"
1156
1179
  )
@@ -1160,11 +1183,11 @@ function ze({ toolCall: e, defaultExpanded: n = !1, className: r }) {
1160
1183
  /* @__PURE__ */ t("span", { className: "font-mono text-[12px] truncate text-white/50 min-w-0", children: h })
1161
1184
  ] }),
1162
1185
  /* @__PURE__ */ a("div", { className: "flex items-center gap-1.5 shrink-0", children: [
1163
- /* @__PURE__ */ t(Bt, { status: c, size: "sm" }),
1186
+ /* @__PURE__ */ t(Ot, { status: c, size: "sm" }),
1164
1187
  o && /* @__PURE__ */ t(
1165
1188
  We,
1166
1189
  {
1167
- className: m(
1190
+ className: p(
1168
1191
  "w-3.5 h-3.5 text-white/30 transition-transform duration-200",
1169
1192
  s && "rotate-180"
1170
1193
  )
@@ -1175,13 +1198,13 @@ function ze({ toolCall: e, defaultExpanded: n = !1, className: r }) {
1175
1198
  }
1176
1199
  ),
1177
1200
  s && o && /* @__PURE__ */ a("div", { className: "border-t border-white/5 max-h-[350px] overflow-y-auto ash-scrollbar bg-black/20", children: [
1178
- /* @__PURE__ */ t(Yt, { actionType: l, isError: e.isError || c === "failed" }),
1201
+ /* @__PURE__ */ t(Zt, { actionType: l, isError: e.isError || c === "failed" }),
1179
1202
  c === "success" && /* @__PURE__ */ t("div", { className: "px-3 py-2 border-t border-white/5 bg-[var(--ash-accent)]/5", children: /* @__PURE__ */ a("div", { className: "flex items-center gap-1.5", children: [
1180
- /* @__PURE__ */ t(_t, { className: "w-3.5 h-3.5 text-[var(--ash-accent)]" }),
1203
+ /* @__PURE__ */ t(Ye, { className: "w-3.5 h-3.5 text-[var(--ash-accent)]" }),
1181
1204
  /* @__PURE__ */ t("span", { className: "text-[12px] text-[var(--ash-accent)] font-medium", children: "Completed" })
1182
1205
  ] }) }),
1183
1206
  c === "failed" && /* @__PURE__ */ t("div", { className: "px-3 py-2 border-t border-red-500/20 bg-red-500/10", children: /* @__PURE__ */ a("div", { className: "flex items-center gap-1.5", children: [
1184
- /* @__PURE__ */ t(Lt, { className: "w-3.5 h-3.5 text-red-400" }),
1207
+ /* @__PURE__ */ t(Rt, { className: "w-3.5 h-3.5 text-red-400" }),
1185
1208
  /* @__PURE__ */ t("span", { className: "text-[12px] text-red-400 font-medium", children: "Failed" })
1186
1209
  ] }) })
1187
1210
  ] })
@@ -1189,19 +1212,19 @@ function ze({ toolCall: e, defaultExpanded: n = !1, className: r }) {
1189
1212
  }
1190
1213
  );
1191
1214
  }
1192
- var Qt = ot(() => import("./index-DJwpy-R5.js"));
1215
+ var Xt = dt(() => import("./index-DJwpy-R5.js"));
1193
1216
  function Fe({ children: e, fallback: n, components: r, className: s }) {
1194
1217
  const [i, l] = N(!1);
1195
- z(() => {
1218
+ P(() => {
1196
1219
  l(!0);
1197
1220
  }, []);
1198
1221
  const c = ae(() => {
1199
1222
  if (r)
1200
1223
  return r;
1201
1224
  }, [r]);
1202
- return i ? /* @__PURE__ */ t(ct, { fallback: /* @__PURE__ */ t("span", { className: s, children: n ?? e }), children: /* @__PURE__ */ t(Qt, { components: c, children: e }) }) : /* @__PURE__ */ t("span", { className: s, children: n ?? e });
1225
+ return i ? /* @__PURE__ */ t(ut, { fallback: /* @__PURE__ */ t("span", { className: s, children: n ?? e }), children: /* @__PURE__ */ t(Xt, { components: c, children: e }) }) : /* @__PURE__ */ t("span", { className: s, children: n ?? e });
1203
1226
  }
1204
- function Xt({ segment: e }) {
1227
+ function en({ segment: e }) {
1205
1228
  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)";
1206
1229
  return /* @__PURE__ */ a(
1207
1230
  "span",
@@ -1220,18 +1243,18 @@ function Xt({ segment: e }) {
1220
1243
  }
1221
1244
  );
1222
1245
  }
1223
- function en({
1246
+ function tn({
1224
1247
  content: e,
1225
1248
  renderers: n,
1226
1249
  className: r
1227
1250
  }) {
1228
- return /* @__PURE__ */ t("div", { className: m("rich-content", r), children: e.map((s, i) => {
1251
+ return /* @__PURE__ */ t("div", { className: p("rich-content", r), children: e.map((s, i) => {
1229
1252
  const l = `segment-${i}`;
1230
1253
  switch (s.type) {
1231
1254
  case "text":
1232
1255
  return /* @__PURE__ */ t($e, { children: /* @__PURE__ */ t(Fe, { children: s.content }) }, l);
1233
1256
  case "mention":
1234
- return n != null && n.renderMention ? /* @__PURE__ */ t($e, { children: n.renderMention({ segment: s }) }, l) : /* @__PURE__ */ t(Xt, { segment: s }, l);
1257
+ return n != null && n.renderMention ? /* @__PURE__ */ t($e, { children: n.renderMention({ segment: s }) }, l) : /* @__PURE__ */ t(en, { segment: s }, l);
1235
1258
  case "component":
1236
1259
  return n != null && n.renderComponent ? /* @__PURE__ */ t($e, { children: n.renderComponent({ segment: s }) }, l) : /* @__PURE__ */ a("code", { className: "text-xs text-orange-400", children: [
1237
1260
  "[component: ",
@@ -1243,14 +1266,14 @@ function en({
1243
1266
  }
1244
1267
  }) });
1245
1268
  }
1246
- function tn({ options: e, onSelect: n, className: r }) {
1247
- return /* @__PURE__ */ t("div", { className: m("grid gap-2 mt-3", r), style: {
1269
+ function nn({ options: e, onSelect: n, className: r }) {
1270
+ return /* @__PURE__ */ t("div", { className: p("grid gap-2 mt-3", r), style: {
1248
1271
  gridTemplateColumns: "repeat(auto-fit, minmax(200px, 1fr))"
1249
1272
  }, children: e.map((s) => /* @__PURE__ */ a(
1250
1273
  "button",
1251
1274
  {
1252
1275
  onClick: () => n(s),
1253
- className: m(
1276
+ className: p(
1254
1277
  "flex items-start gap-3 p-3 rounded-xl text-left",
1255
1278
  "bg-white/5 border border-white/10",
1256
1279
  "hover:bg-[var(--ash-accent)]/10 hover:border-[var(--ash-accent)]/30",
@@ -1259,7 +1282,7 @@ function tn({ options: e, onSelect: n, className: r }) {
1259
1282
  "group"
1260
1283
  ),
1261
1284
  children: [
1262
- /* @__PURE__ */ t("span", { className: m(
1285
+ /* @__PURE__ */ t("span", { className: p(
1263
1286
  "flex-shrink-0 w-6 h-6 rounded-lg",
1264
1287
  "bg-[var(--ash-accent)]/20 text-[var(--ash-accent)]",
1265
1288
  "flex items-center justify-center",
@@ -1274,7 +1297,7 @@ function tn({ options: e, onSelect: n, className: r }) {
1274
1297
  /* @__PURE__ */ t(
1275
1298
  "svg",
1276
1299
  {
1277
- className: m(
1300
+ className: p(
1278
1301
  "w-4 h-4 text-white/30 flex-shrink-0 mt-0.5",
1279
1302
  "group-hover:text-[var(--ash-accent)] group-hover:translate-x-0.5",
1280
1303
  "transition-all duration-200"
@@ -1291,7 +1314,7 @@ function tn({ options: e, onSelect: n, className: r }) {
1291
1314
  s.id
1292
1315
  )) });
1293
1316
  }
1294
- var be = {
1317
+ var Ne = {
1295
1318
  dense: {
1296
1319
  text: "text-xs",
1297
1320
  padding: "px-2 py-1",
@@ -1321,7 +1344,7 @@ var be = {
1321
1344
  messageGap: "space-y-3"
1322
1345
  }
1323
1346
  };
1324
- function nn(e) {
1347
+ function rn(e) {
1325
1348
  const n = "[Uploaded files available at /uploads/]", r = e.indexOf(n);
1326
1349
  if (r === -1)
1327
1350
  return { text: e, files: [] };
@@ -1329,18 +1352,19 @@ function nn(e) {
1329
1352
  `).filter((c) => c.startsWith("- ")).map((c) => c.substring(2).trim());
1330
1353
  return { text: s, files: l };
1331
1354
  }
1332
- function rn({
1355
+ function sn({
1333
1356
  entry: e,
1334
1357
  variant: n = "bubble",
1335
1358
  scale: r = "compact",
1336
- showAvatar: s = !0,
1359
+ showAvatar: s = !1,
1360
+ // Hidden by default for ChatGPT style
1337
1361
  showTimestamp: i = !0,
1338
1362
  renderMetadata: l,
1339
1363
  metadata: c,
1340
1364
  className: h
1341
1365
  }) {
1342
- const { text: o, files: f } = nn(e.content), d = be[r], x = {
1343
- bubble: "rounded-lg bg-[var(--ash-user-bg)] text-[var(--ash-user-text)] border border-[var(--ash-user-border)]",
1366
+ const { text: o, files: f } = rn(e.content), d = Ne[r], x = {
1367
+ bubble: "rounded-[20px] bg-[var(--ash-user-bg)] text-[var(--ash-user-text)] border border-[var(--ash-user-border)]",
1344
1368
  plain: "bg-transparent text-[var(--ash-text-primary)]",
1345
1369
  minimal: "bg-transparent text-[var(--ash-text-secondary)]"
1346
1370
  };
@@ -1348,22 +1372,22 @@ function rn({
1348
1372
  "div",
1349
1373
  {
1350
1374
  "data-message-role": "user",
1351
- className: m("flex justify-end ash-animate-fade-in pr-1", d.gap, h),
1375
+ className: p("flex justify-end ash-animate-fade-in pr-1", d.gap, h),
1352
1376
  children: [
1353
- /* @__PURE__ */ a("div", { className: "max-w-[90%] flex flex-col items-end", children: [
1354
- /* @__PURE__ */ a("div", { className: m(x[n], n === "bubble" && d.padding), children: [
1355
- /* @__PURE__ */ t("p", { className: m(d.text, "leading-snug whitespace-pre-wrap"), children: o || "(files attached)" }),
1356
- f.length > 0 && n === "bubble" && /* @__PURE__ */ t("div", { className: "mt-1.5 pt-1.5 border-t border-[var(--ash-user-text)]/15 flex flex-wrap gap-1", children: f.map((p, v) => /* @__PURE__ */ a(
1377
+ /* @__PURE__ */ a("div", { className: "max-w-[85%] flex flex-col items-end", children: [
1378
+ /* @__PURE__ */ a("div", { className: p(x[n], n === "bubble" && "px-4 py-3"), children: [
1379
+ /* @__PURE__ */ t("p", { className: p(d.text, "leading-snug whitespace-pre-wrap"), children: o || "(files attached)" }),
1380
+ f.length > 0 && n === "bubble" && /* @__PURE__ */ t("div", { className: "mt-1.5 pt-1.5 border-t border-[var(--ash-user-text)]/15 flex flex-wrap gap-1", children: f.map((m, w) => /* @__PURE__ */ a(
1357
1381
  "span",
1358
1382
  {
1359
1383
  className: "inline-flex items-center gap-1 px-1.5 py-0.5 rounded bg-[var(--ash-user-text)]/10 text-[11px]",
1360
- title: p,
1384
+ title: m,
1361
1385
  children: [
1362
- /* @__PURE__ */ t($t, { className: "w-2.5 h-2.5 opacity-60" }),
1363
- p.split(" (")[0]
1386
+ /* @__PURE__ */ t(At, { className: "w-2.5 h-2.5 opacity-60" }),
1387
+ m.split(" (")[0]
1364
1388
  ]
1365
1389
  },
1366
- v
1390
+ w
1367
1391
  )) })
1368
1392
  ] }),
1369
1393
  l ? l({ entry: e, metadata: c }) : i && e.timestamp && /* @__PURE__ */ a("div", { className: "text-[10px] text-[var(--ash-text-faint)] mt-0.5 mr-1 tabular-nums flex items-center gap-1.5", children: [
@@ -1372,12 +1396,12 @@ function rn({
1372
1396
  je(e.timestamp)
1373
1397
  ] })
1374
1398
  ] }),
1375
- s && /* @__PURE__ */ t("div", { className: m(d.avatar, "rounded-md bg-[var(--ash-avatar-user-bg)] flex items-center justify-center shrink-0 mt-0.5"), children: /* @__PURE__ */ t(At, { className: "w-3 h-3 text-[var(--ash-text-muted)]" }) })
1399
+ s && /* @__PURE__ */ t("div", { className: p(d.avatar, "rounded-full bg-[var(--ash-avatar-user-bg)] flex items-center justify-center shrink-0 mt-0.5"), children: /* @__PURE__ */ t(Dt, { className: "w-3 h-3 text-[var(--ash-text-muted)]" }) })
1376
1400
  ]
1377
1401
  }
1378
1402
  );
1379
1403
  }
1380
- function sn({
1404
+ function an({
1381
1405
  entry: e,
1382
1406
  variant: n = "bubble",
1383
1407
  scale: r = "compact",
@@ -1390,14 +1414,14 @@ function sn({
1390
1414
  metadata: f,
1391
1415
  className: d
1392
1416
  }) {
1393
- const x = e.richContent ? null : vt(e.content), p = be[r], v = (R) => {
1417
+ const x = e.richContent ? null : bt(e.content), m = Ne[r], w = (R) => {
1394
1418
  l && l(`Option ${R.id}: ${R.label}`);
1395
1419
  }, E = {
1396
- bubble: "rounded-lg bg-[var(--ash-assistant-bg)] border border-[var(--ash-assistant-border)]",
1420
+ bubble: "rounded-[16px] bg-[var(--ash-assistant-bg)] border border-[var(--ash-assistant-border)]",
1397
1421
  plain: "bg-transparent",
1398
1422
  minimal: "bg-transparent"
1399
1423
  }, D = (R) => e.richContent && e.richContent.length > 0 ? /* @__PURE__ */ t(
1400
- en,
1424
+ tn,
1401
1425
  {
1402
1426
  content: e.richContent,
1403
1427
  renderers: c
@@ -1407,17 +1431,17 @@ function sn({
1407
1431
  "div",
1408
1432
  {
1409
1433
  "data-message-role": "assistant",
1410
- className: m("flex ash-animate-fade-in pl-1", p.gap, d),
1434
+ className: p("flex ash-animate-fade-in pl-1", m.gap, d),
1411
1435
  children: [
1412
- s && /* @__PURE__ */ t("div", { className: m(p.avatar, "rounded-md bg-[var(--ash-avatar-assistant-bg)] flex items-center justify-center shrink-0 mt-0.5"), children: /* @__PURE__ */ t(me, { className: "w-3 h-3 text-[var(--ash-accent)]" }) }),
1436
+ s && /* @__PURE__ */ t("div", { className: p(m.avatar, "rounded-full bg-[var(--ash-avatar-assistant-bg)] flex items-center justify-center shrink-0 mt-0.5"), children: /* @__PURE__ */ t(Qe, { className: "w-3 h-3 text-white" }) }),
1413
1437
  /* @__PURE__ */ a("div", { className: "flex-1 min-w-0", children: [
1414
- /* @__PURE__ */ t("div", { className: m(E[n], n === "bubble" && p.padding), children: /* @__PURE__ */ t("div", { className: m("ash-message-content prose prose-sm prose-invert max-w-none leading-relaxed text-[var(--ash-assistant-text)]", p.text), children: x ? /* @__PURE__ */ a(S, { children: [
1438
+ /* @__PURE__ */ t("div", { className: p(E[n], n === "bubble" && "px-4 py-3"), children: /* @__PURE__ */ t("div", { className: p("ash-message-content prose prose-sm prose-invert max-w-none leading-relaxed text-[var(--ash-assistant-text)]", m.text), children: x ? /* @__PURE__ */ a(_, { children: [
1415
1439
  x.preamble && D(x.preamble),
1416
1440
  /* @__PURE__ */ t(
1417
- tn,
1441
+ nn,
1418
1442
  {
1419
1443
  options: x.options,
1420
- onSelect: v
1444
+ onSelect: w
1421
1445
  }
1422
1446
  )
1423
1447
  ] }) : D() }) }),
@@ -1431,51 +1455,51 @@ function sn({
1431
1455
  }
1432
1456
  );
1433
1457
  }
1434
- function an({ entry: e, scale: n = "compact", showAvatar: r = !0, className: s }) {
1435
- const i = be[n];
1458
+ function ln({ entry: e, scale: n = "compact", showAvatar: r = !0, className: s }) {
1459
+ const i = Ne[n];
1436
1460
  return /* @__PURE__ */ a(
1437
1461
  "div",
1438
1462
  {
1439
1463
  "data-message-role": "thinking",
1440
- className: m("flex ash-animate-fade-in pl-1", i.gap, s),
1464
+ className: p("flex ash-animate-fade-in pl-1", i.gap, s),
1441
1465
  children: [
1442
- r && /* @__PURE__ */ t("div", { className: m(i.avatar, "rounded-md bg-[var(--ash-avatar-thinking-bg)] flex items-center justify-center shrink-0 mt-0.5"), children: /* @__PURE__ */ t(Rt, { className: "w-3 h-3 text-purple-400" }) }),
1443
- /* @__PURE__ */ t("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ a("div", { className: m("rounded-lg bg-[var(--ash-thinking-bg)] border border-[var(--ash-thinking-border)]", i.padding), children: [
1466
+ r && /* @__PURE__ */ t("div", { className: p(i.avatar, "rounded-md bg-[var(--ash-avatar-thinking-bg)] flex items-center justify-center shrink-0 mt-0.5"), children: /* @__PURE__ */ t(Qe, { className: "w-3 h-3 text-purple-400" }) }),
1467
+ /* @__PURE__ */ t("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ a("div", { className: p("rounded-lg bg-[var(--ash-thinking-bg)] border border-[var(--ash-thinking-border)]", i.padding), children: [
1444
1468
  /* @__PURE__ */ t("div", { className: "text-[10px] text-[var(--ash-thinking-text)] opacity-80 mb-1 font-medium uppercase tracking-wide", children: "Thinking" }),
1445
- /* @__PURE__ */ t("div", { className: m(i.text, "text-[var(--ash-thinking-text)] opacity-70 italic whitespace-pre-wrap leading-relaxed"), children: e.content })
1469
+ /* @__PURE__ */ t("div", { className: p(i.text, "text-[var(--ash-thinking-text)] opacity-70 italic whitespace-pre-wrap leading-relaxed"), children: e.content })
1446
1470
  ] }) })
1447
1471
  ]
1448
1472
  }
1449
1473
  );
1450
1474
  }
1451
- function ln({ entry: e, scale: n = "compact", showAvatar: r = !0, defaultExpanded: s = !1, className: i }) {
1475
+ function on({ entry: e, scale: n = "compact", showAvatar: r = !0, defaultExpanded: s = !1, className: i }) {
1452
1476
  if (e.entryType.type !== "tool_call") return null;
1453
- const l = be[n];
1477
+ const l = Ne[n];
1454
1478
  return /* @__PURE__ */ a(
1455
1479
  "div",
1456
1480
  {
1457
1481
  "data-message-role": "tool",
1458
- className: m("flex ash-animate-fade-in pl-1", l.gap, i),
1482
+ className: p("flex ash-animate-fade-in pl-1", l.gap, i),
1459
1483
  children: [
1460
- r && /* @__PURE__ */ t("div", { className: m(l.avatar, "rounded-md bg-[var(--ash-avatar-assistant-bg)] flex items-center justify-center shrink-0 mt-0.5"), children: /* @__PURE__ */ t(me, { className: "w-3 h-3 text-[var(--ash-accent)]" }) }),
1484
+ r && /* @__PURE__ */ t("div", { className: p(l.avatar, "rounded-md bg-[var(--ash-avatar-assistant-bg)] flex items-center justify-center shrink-0 mt-0.5"), children: /* @__PURE__ */ t(xe, { className: "w-3 h-3 text-[var(--ash-accent)]" }) }),
1461
1485
  /* @__PURE__ */ t("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ t(ze, { toolCall: e.entryType.toolCall, defaultExpanded: s }) })
1462
1486
  ]
1463
1487
  }
1464
1488
  );
1465
1489
  }
1466
- function on({ entry: e, scale: n = "compact", showAvatar: r = !0, className: s }) {
1490
+ function cn({ entry: e, scale: n = "compact", showAvatar: r = !0, className: s }) {
1467
1491
  if (e.entryType.type !== "error") return null;
1468
- const i = be[n];
1492
+ const i = Ne[n];
1469
1493
  return /* @__PURE__ */ a(
1470
1494
  "div",
1471
1495
  {
1472
1496
  "data-message-role": "error",
1473
- className: m("flex ash-animate-fade-in pl-1", i.gap, s),
1497
+ className: p("flex ash-animate-fade-in pl-1", i.gap, s),
1474
1498
  children: [
1475
- r && /* @__PURE__ */ t("div", { className: m(i.avatar, "rounded-md bg-[var(--ash-avatar-error-bg)] flex items-center justify-center shrink-0 mt-0.5"), children: /* @__PURE__ */ t(Ye, { className: "w-3 h-3 text-red-400" }) }),
1476
- /* @__PURE__ */ t("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ a("div", { className: m("rounded-lg bg-[var(--ash-error-bg)] border border-[var(--ash-error-border)]", i.padding), children: [
1499
+ r && /* @__PURE__ */ t("div", { className: p(i.avatar, "rounded-md bg-[var(--ash-avatar-error-bg)] flex items-center justify-center shrink-0 mt-0.5"), children: /* @__PURE__ */ t(Ze, { className: "w-3 h-3 text-red-400" }) }),
1500
+ /* @__PURE__ */ t("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ a("div", { className: p("rounded-lg bg-[var(--ash-error-bg)] border border-[var(--ash-error-border)]", i.padding), children: [
1477
1501
  /* @__PURE__ */ t("div", { className: "text-[10px] text-[var(--ash-error-text)] opacity-80 mb-1 font-medium uppercase tracking-wide", children: "Error" }),
1478
- /* @__PURE__ */ t("p", { className: m(i.text, "text-[var(--ash-error-text)] opacity-90"), children: e.entryType.message }),
1502
+ /* @__PURE__ */ t("p", { className: p(i.text, "text-[var(--ash-error-text)] opacity-90"), children: e.entryType.message }),
1479
1503
  e.entryType.code && /* @__PURE__ */ a("p", { className: "text-[11px] text-[var(--ash-error-text)] opacity-60 mt-1 font-mono", children: [
1480
1504
  "Code: ",
1481
1505
  e.entryType.code
@@ -1485,7 +1509,7 @@ function on({ entry: e, scale: n = "compact", showAvatar: r = !0, className: s }
1485
1509
  }
1486
1510
  );
1487
1511
  }
1488
- function cn({
1512
+ function dn({
1489
1513
  entry: e,
1490
1514
  onOptionSelect: n,
1491
1515
  defaultExpanded: r,
@@ -1498,12 +1522,12 @@ function cn({
1498
1522
  showTimestamp: f = !0,
1499
1523
  renderMetadata: d,
1500
1524
  metadata: x,
1501
- className: p
1525
+ className: m
1502
1526
  }) {
1503
1527
  switch (e.entryType.type) {
1504
1528
  case "user_message":
1505
1529
  return /* @__PURE__ */ t(
1506
- rn,
1530
+ sn,
1507
1531
  {
1508
1532
  entry: e,
1509
1533
  variant: l,
@@ -1512,12 +1536,12 @@ function cn({
1512
1536
  showTimestamp: f,
1513
1537
  renderMetadata: d,
1514
1538
  metadata: x,
1515
- className: p
1539
+ className: m
1516
1540
  }
1517
1541
  );
1518
1542
  case "assistant_message":
1519
1543
  return /* @__PURE__ */ t(
1520
- sn,
1544
+ an,
1521
1545
  {
1522
1546
  entry: e,
1523
1547
  variant: c,
@@ -1529,15 +1553,15 @@ function cn({
1529
1553
  markdownComponents: i,
1530
1554
  renderMetadata: d,
1531
1555
  metadata: x,
1532
- className: p
1556
+ className: m
1533
1557
  }
1534
1558
  );
1535
1559
  case "thinking":
1536
- return /* @__PURE__ */ t(an, { entry: e, scale: h, showAvatar: o, className: p });
1560
+ return /* @__PURE__ */ t(ln, { entry: e, scale: h, showAvatar: o, className: m });
1537
1561
  case "tool_call":
1538
- return /* @__PURE__ */ t(ln, { entry: e, scale: h, showAvatar: o, defaultExpanded: r, className: p });
1562
+ return /* @__PURE__ */ t(on, { entry: e, scale: h, showAvatar: o, defaultExpanded: r, className: m });
1539
1563
  case "error":
1540
- return /* @__PURE__ */ t(on, { entry: e, scale: h, showAvatar: o, className: p });
1564
+ return /* @__PURE__ */ t(cn, { entry: e, scale: h, showAvatar: o, className: m });
1541
1565
  default:
1542
1566
  return null;
1543
1567
  }
@@ -1549,10 +1573,10 @@ function Re({ variant: e = "dots", size: n = "md", className: r }) {
1549
1573
  md: "w-1.5 h-1.5",
1550
1574
  lg: "w-2 h-2"
1551
1575
  };
1552
- return /* @__PURE__ */ a("div", { className: m("flex items-center gap-1", r), children: [
1553
- /* @__PURE__ */ t("span", { className: m("rounded-full bg-[var(--ash-accent)] animate-pulse", i[n]) }),
1554
- /* @__PURE__ */ t("span", { className: m("rounded-full bg-[var(--ash-accent)] animate-pulse", i[n]), style: { animationDelay: "150ms" } }),
1555
- /* @__PURE__ */ t("span", { className: m("rounded-full bg-[var(--ash-accent)] animate-pulse", i[n]), style: { animationDelay: "300ms" } })
1576
+ return /* @__PURE__ */ a("div", { className: p("flex items-center gap-1", r), children: [
1577
+ /* @__PURE__ */ t("span", { className: p("rounded-full bg-[var(--ash-accent)] animate-pulse", i[n]) }),
1578
+ /* @__PURE__ */ t("span", { className: p("rounded-full bg-[var(--ash-accent)] animate-pulse", i[n]), style: { animationDelay: "150ms" } }),
1579
+ /* @__PURE__ */ t("span", { className: p("rounded-full bg-[var(--ash-accent)] animate-pulse", i[n]), style: { animationDelay: "300ms" } })
1556
1580
  ] });
1557
1581
  }
1558
1582
  if (e === "pulse") {
@@ -1561,12 +1585,12 @@ function Re({ variant: e = "dots", size: n = "md", className: r }) {
1561
1585
  md: "w-2 h-2",
1562
1586
  lg: "w-3 h-3"
1563
1587
  };
1564
- return /* @__PURE__ */ t("div", { className: m("flex items-center gap-1", r), children: /* @__PURE__ */ t("span", { className: m("bg-[var(--ash-accent)] rounded-full animate-pulse", i[n]) }) });
1588
+ return /* @__PURE__ */ t("div", { className: p("flex items-center gap-1", r), children: /* @__PURE__ */ t("span", { className: p("bg-[var(--ash-accent)] rounded-full animate-pulse", i[n]) }) });
1565
1589
  }
1566
1590
  return e === "cursor" ? /* @__PURE__ */ t(
1567
1591
  "span",
1568
1592
  {
1569
- className: m(
1593
+ className: p(
1570
1594
  "inline-block bg-[var(--ash-accent)]/50 ash-tool-status-pending",
1571
1595
  {
1572
1596
  sm: "w-1 h-3",
@@ -1576,7 +1600,7 @@ function Re({ variant: e = "dots", size: n = "md", className: r }) {
1576
1600
  r
1577
1601
  )
1578
1602
  }
1579
- ) : /* @__PURE__ */ t("div", { className: m("animate-spin text-[var(--ash-accent)]", {
1603
+ ) : /* @__PURE__ */ t("div", { className: p("animate-spin text-[var(--ash-accent)]", {
1580
1604
  sm: "w-4 h-4",
1581
1605
  md: "w-6 h-6",
1582
1606
  lg: "w-8 h-8"
@@ -1585,13 +1609,13 @@ function Re({ variant: e = "dots", size: n = "md", className: r }) {
1585
1609
  /* @__PURE__ */ t("path", { d: "M12 2a10 10 0 0 1 10 10", strokeLinecap: "round" })
1586
1610
  ] }) });
1587
1611
  }
1588
- function dn({
1612
+ function un({
1589
1613
  content: e,
1590
1614
  isStreaming: n = !1,
1591
1615
  renderMarkdown: r = !0,
1592
1616
  className: s
1593
1617
  }) {
1594
- return /* @__PURE__ */ t("div", { className: m("relative", s), children: r ? /* @__PURE__ */ a("div", { className: "ash-message-content prose prose-sm prose-invert max-w-none text-sm leading-relaxed", children: [
1618
+ return /* @__PURE__ */ t("div", { className: p("relative", s), children: r ? /* @__PURE__ */ a("div", { className: "ash-message-content prose prose-sm prose-invert max-w-none text-sm leading-relaxed", children: [
1595
1619
  /* @__PURE__ */ t(Fe, { children: e }),
1596
1620
  n && /* @__PURE__ */ t(Re, { variant: "cursor", size: "sm", className: "inline-block ml-0.5" })
1597
1621
  ] }) : /* @__PURE__ */ a("p", { className: "whitespace-pre-wrap text-sm leading-relaxed", children: [
@@ -1599,7 +1623,7 @@ function dn({
1599
1623
  n && /* @__PURE__ */ t(Re, { variant: "cursor", size: "sm", className: "inline-block ml-0.5" })
1600
1624
  ] }) });
1601
1625
  }
1602
- function un(e) {
1626
+ function hn(e) {
1603
1627
  switch (e.action) {
1604
1628
  case "file_read":
1605
1629
  case "file_edit":
@@ -1609,15 +1633,15 @@ function un(e) {
1609
1633
  return null;
1610
1634
  }
1611
1635
  }
1612
- function Xe(e) {
1636
+ function tt(e) {
1613
1637
  const n = e.split("/");
1614
1638
  return n[n.length - 1] || e;
1615
1639
  }
1616
- function hn(e) {
1617
- const n = Xe(e), r = n.lastIndexOf(".");
1640
+ function mn(e) {
1641
+ const n = tt(e), r = n.lastIndexOf(".");
1618
1642
  return r === -1 ? null : n.slice(r + 1).toLowerCase();
1619
1643
  }
1620
- function mn(e) {
1644
+ function pn(e) {
1621
1645
  switch (e.action) {
1622
1646
  case "file_edit": {
1623
1647
  const n = e;
@@ -1635,7 +1659,7 @@ function mn(e) {
1635
1659
  return null;
1636
1660
  }
1637
1661
  }
1638
- function pn(e) {
1662
+ function fn(e) {
1639
1663
  switch (e) {
1640
1664
  case "ts":
1641
1665
  case "tsx":
@@ -1658,33 +1682,33 @@ function pn(e) {
1658
1682
  return "text-white/70";
1659
1683
  }
1660
1684
  }
1661
- function et({ toolCall: e, showFullPath: n = !1, className: r }) {
1662
- const { actionType: s, status: i, summary: l } = e, c = Ke(s), h = un(s), o = mn(s), f = h ? n ? h : Xe(h) : null, d = h ? hn(h) : null, x = pn(d), p = !h && l;
1685
+ function nt({ toolCall: e, showFullPath: n = !1, className: r }) {
1686
+ const { actionType: s, status: i, summary: l } = e, c = Ke(s), h = hn(s), o = pn(s), f = h ? n ? h : tt(h) : null, d = h ? mn(h) : null, x = fn(d), m = !h && l;
1663
1687
  return /* @__PURE__ */ a(
1664
1688
  "div",
1665
1689
  {
1666
- className: m(
1690
+ className: p(
1667
1691
  "flex items-center gap-2 py-1.5 text-sm min-w-0",
1668
1692
  r
1669
1693
  ),
1670
1694
  children: [
1671
1695
  /* @__PURE__ */ a("div", { className: "flex items-center gap-1.5 shrink-0", children: [
1672
1696
  /* @__PURE__ */ t(
1673
- Ze,
1697
+ Xe,
1674
1698
  {
1675
1699
  actionType: s,
1676
- className: m(
1700
+ className: p(
1677
1701
  "w-3.5 h-3.5",
1678
1702
  i === "pending" ? "text-yellow-400" : i === "failed" ? "text-red-400" : "text-white/50"
1679
1703
  )
1680
1704
  }
1681
1705
  ),
1682
- /* @__PURE__ */ t("span", { className: m(
1706
+ /* @__PURE__ */ t("span", { className: p(
1683
1707
  "font-medium",
1684
1708
  i === "pending" ? "text-white/90" : i === "failed" ? "text-red-400" : "text-white/60"
1685
1709
  ), children: c })
1686
1710
  ] }),
1687
- f && /* @__PURE__ */ t("code", { className: m(
1711
+ f && /* @__PURE__ */ t("code", { className: p(
1688
1712
  "px-1.5 py-0.5 rounded bg-white/5 font-mono text-xs truncate max-w-[200px]",
1689
1713
  x
1690
1714
  ), children: f }),
@@ -1706,16 +1730,16 @@ function et({ toolCall: e, showFullPath: n = !1, className: r }) {
1706
1730
  o.written
1707
1731
  ] })
1708
1732
  ] }),
1709
- p && /* @__PURE__ */ t("span", { className: "text-white/40 truncate min-w-0 text-xs", children: l })
1733
+ m && /* @__PURE__ */ t("span", { className: "text-white/40 truncate min-w-0 text-xs", children: l })
1710
1734
  ]
1711
1735
  }
1712
1736
  );
1713
1737
  }
1714
- function fn(e) {
1738
+ function xn(e) {
1715
1739
  const n = e.split("/").pop() || e, r = n.lastIndexOf(".");
1716
1740
  return r === -1 ? null : n.slice(r + 1).toLowerCase();
1717
1741
  }
1718
- function xn(e) {
1742
+ function gn(e) {
1719
1743
  switch (e) {
1720
1744
  case "ts":
1721
1745
  case "tsx":
@@ -1738,7 +1762,7 @@ function xn(e) {
1738
1762
  return "";
1739
1763
  }
1740
1764
  }
1741
- function gn(e) {
1765
+ function wn(e) {
1742
1766
  switch (e) {
1743
1767
  case "ts":
1744
1768
  case "tsx":
@@ -1761,18 +1785,18 @@ function gn(e) {
1761
1785
  return "bg-white/10";
1762
1786
  }
1763
1787
  }
1764
- function tt({
1788
+ function rt({
1765
1789
  path: e,
1766
1790
  linesAdded: n,
1767
1791
  linesRemoved: r,
1768
1792
  showOnlyFilename: s = !0,
1769
1793
  className: i
1770
1794
  }) {
1771
- const l = s && e.split("/").pop() || e, c = fn(e), h = xn(c), o = gn(c), f = n !== void 0 && n > 0 || r !== void 0 && r > 0;
1795
+ const l = s && e.split("/").pop() || e, c = xn(e), h = gn(c), o = wn(c), f = n !== void 0 && n > 0 || r !== void 0 && r > 0;
1772
1796
  return /* @__PURE__ */ a(
1773
1797
  "span",
1774
1798
  {
1775
- className: m(
1799
+ className: p(
1776
1800
  "inline-flex items-center gap-1.5 px-2 py-0.5 rounded-md text-xs font-mono",
1777
1801
  o,
1778
1802
  i
@@ -1794,7 +1818,7 @@ function tt({
1794
1818
  }
1795
1819
  );
1796
1820
  }
1797
- function wn(e) {
1821
+ function vn(e) {
1798
1822
  const n = /* @__PURE__ */ new Map();
1799
1823
  for (const r of e) {
1800
1824
  const { actionType: s } = r;
@@ -1815,7 +1839,7 @@ function wn(e) {
1815
1839
  }
1816
1840
  return Array.from(n.values());
1817
1841
  }
1818
- function vn(e) {
1842
+ function yn(e) {
1819
1843
  const n = {};
1820
1844
  for (const r of e) {
1821
1845
  const s = r.actionType.action;
@@ -1823,7 +1847,7 @@ function vn(e) {
1823
1847
  }
1824
1848
  return n;
1825
1849
  }
1826
- function yn(e) {
1850
+ function bn(e) {
1827
1851
  switch (e) {
1828
1852
  case "file_read":
1829
1853
  return Be;
@@ -1831,21 +1855,21 @@ function yn(e) {
1831
1855
  case "file_write":
1832
1856
  return Oe;
1833
1857
  case "command_run":
1834
- return Ee;
1858
+ return Ie;
1835
1859
  case "search":
1836
1860
  case "glob":
1837
- return Te;
1861
+ return Se;
1838
1862
  default:
1839
1863
  return null;
1840
1864
  }
1841
1865
  }
1842
- function bn({
1866
+ function Nn({
1843
1867
  toolCalls: e,
1844
1868
  defaultExpanded: n = !1,
1845
1869
  className: r
1846
1870
  }) {
1847
- const [s, i] = N(n), [l, c] = N(null), h = ae(() => wn(e), [e]), o = ae(() => vn(e), [e]), f = ae(() => Object.entries(o).sort((x, p) => p[1] - x[1]).slice(0, 3).map(([x]) => x), [o]), d = e.length;
1848
- return e.length === 0 ? null : /* @__PURE__ */ a("div", { className: m("ash-animate-fade-in", r), children: [
1871
+ const [s, i] = N(n), [l, c] = N(null), h = ae(() => vn(e), [e]), o = ae(() => yn(e), [e]), f = ae(() => Object.entries(o).sort((x, m) => m[1] - x[1]).slice(0, 3).map(([x]) => x), [o]), d = e.length;
1872
+ return e.length === 0 ? null : /* @__PURE__ */ a("div", { className: p("ash-animate-fade-in", r), children: [
1849
1873
  /* @__PURE__ */ a(
1850
1874
  "button",
1851
1875
  {
@@ -1853,9 +1877,9 @@ function bn({
1853
1877
  className: "w-full flex items-center gap-2 py-1 text-left group",
1854
1878
  children: [
1855
1879
  /* @__PURE__ */ t(
1856
- ye,
1880
+ be,
1857
1881
  {
1858
- className: m(
1882
+ className: p(
1859
1883
  "w-3.5 h-3.5 text-white/40 transition-transform duration-200 shrink-0",
1860
1884
  s && "rotate-90"
1861
1885
  )
@@ -1867,9 +1891,9 @@ function bn({
1867
1891
  d !== 1 ? "s" : ""
1868
1892
  ] }),
1869
1893
  /* @__PURE__ */ t("div", { className: "flex items-center gap-1", children: f.map((x) => {
1870
- const p = yn(x);
1871
- return p ? /* @__PURE__ */ t(
1872
- p,
1894
+ const m = bn(x);
1895
+ return m ? /* @__PURE__ */ t(
1896
+ m,
1873
1897
  {
1874
1898
  className: "w-3.5 h-3.5 text-white/30"
1875
1899
  },
@@ -1879,7 +1903,7 @@ function bn({
1879
1903
  /* @__PURE__ */ t("div", { className: "flex-1" }),
1880
1904
  !s && h.length > 0 && /* @__PURE__ */ a("div", { className: "flex items-center gap-1.5 flex-wrap justify-end", children: [
1881
1905
  h.slice(0, 4).map((x) => /* @__PURE__ */ t(
1882
- tt,
1906
+ rt,
1883
1907
  {
1884
1908
  path: x.path,
1885
1909
  linesAdded: x.linesAdded,
@@ -1917,12 +1941,12 @@ function bn({
1917
1941
  {
1918
1942
  onClick: () => c(x.id),
1919
1943
  className: "w-full text-left hover:bg-white/5 rounded px-1 -mx-1 transition-colors",
1920
- children: /* @__PURE__ */ t(et, { toolCall: x })
1944
+ children: /* @__PURE__ */ t(nt, { toolCall: x })
1921
1945
  }
1922
1946
  ) }, x.id)) })
1923
1947
  ] });
1924
1948
  }
1925
- function Nn(e) {
1949
+ function kn(e) {
1926
1950
  const n = /* @__PURE__ */ new Map();
1927
1951
  for (const r of e) {
1928
1952
  const { actionType: s } = r;
@@ -1940,7 +1964,7 @@ function Nn(e) {
1940
1964
  }
1941
1965
  return Array.from(n.values());
1942
1966
  }
1943
- function kn(e) {
1967
+ function Cn(e) {
1944
1968
  const n = {};
1945
1969
  for (const r of e) {
1946
1970
  const s = r.actionType.action;
@@ -1948,7 +1972,7 @@ function kn(e) {
1948
1972
  }
1949
1973
  return n;
1950
1974
  }
1951
- function Cn(e) {
1975
+ function _n(e) {
1952
1976
  switch (e) {
1953
1977
  case "file_read":
1954
1978
  return Be;
@@ -1956,28 +1980,28 @@ function Cn(e) {
1956
1980
  case "file_write":
1957
1981
  return Oe;
1958
1982
  case "command_run":
1959
- return Ee;
1983
+ return Ie;
1960
1984
  case "search":
1961
1985
  case "glob":
1962
- return Te;
1986
+ return Se;
1963
1987
  default:
1964
1988
  return null;
1965
1989
  }
1966
1990
  }
1967
- function _n({
1991
+ function Tn({
1968
1992
  toolCalls: e,
1969
1993
  defaultExpanded: n = !1,
1970
1994
  isExpanded: r,
1971
1995
  onToggle: s,
1972
1996
  className: i
1973
1997
  }) {
1974
- const [l, c] = N(n), h = r !== void 0 ? r : l, o = P(() => {
1975
- s ? s() : c((v) => !v);
1976
- }, [s]), f = ae(() => Nn(e), [e]), d = ae(() => kn(e), [e]), x = ae(() => Object.entries(d).sort((v, E) => E[1] - v[1]).slice(0, 3).map(([v]) => v), [d]);
1998
+ const [l, c] = N(n), h = r !== void 0 ? r : l, o = F(() => {
1999
+ s ? s() : c((w) => !w);
2000
+ }, [s]), f = ae(() => kn(e), [e]), d = ae(() => Cn(e), [e]), x = ae(() => Object.entries(d).sort((w, E) => E[1] - w[1]).slice(0, 3).map(([w]) => w), [d]);
1977
2001
  if (e.length === 0)
1978
2002
  return null;
1979
- const p = e.length;
1980
- return /* @__PURE__ */ a("div", { className: m("ash-animate-fade-in", i), children: [
2003
+ const m = e.length;
2004
+ return /* @__PURE__ */ a("div", { className: p("ash-animate-fade-in", i), children: [
1981
2005
  /* @__PURE__ */ a(
1982
2006
  "button",
1983
2007
  {
@@ -1986,39 +2010,39 @@ function _n({
1986
2010
  className: "w-full flex items-center gap-2 py-1 text-left group",
1987
2011
  children: [
1988
2012
  /* @__PURE__ */ t(
1989
- ye,
2013
+ be,
1990
2014
  {
1991
- className: m(
2015
+ className: p(
1992
2016
  "w-3.5 h-3.5 text-white/40 transition-transform duration-200 shrink-0",
1993
2017
  h && "rotate-90"
1994
2018
  )
1995
2019
  }
1996
2020
  ),
1997
2021
  /* @__PURE__ */ a("span", { className: "text-sm text-white/60", children: [
1998
- p,
2022
+ m,
1999
2023
  " tool call",
2000
- p !== 1 ? "s" : ""
2024
+ m !== 1 ? "s" : ""
2001
2025
  ] }),
2002
- /* @__PURE__ */ t("div", { className: "flex items-center gap-1", children: x.map((v) => {
2003
- const E = Cn(v);
2026
+ /* @__PURE__ */ t("div", { className: "flex items-center gap-1", children: x.map((w) => {
2027
+ const E = _n(w);
2004
2028
  return E ? /* @__PURE__ */ t(
2005
2029
  E,
2006
2030
  {
2007
2031
  className: "w-3.5 h-3.5 text-white/30"
2008
2032
  },
2009
- v
2033
+ w
2010
2034
  ) : null;
2011
2035
  }) }),
2012
2036
  /* @__PURE__ */ t("div", { className: "flex-1" }),
2013
2037
  !h && f.length > 0 && /* @__PURE__ */ a("div", { className: "flex items-center gap-1.5 flex-wrap justify-end", children: [
2014
- f.slice(0, 4).map((v) => /* @__PURE__ */ t(
2015
- tt,
2038
+ f.slice(0, 4).map((w) => /* @__PURE__ */ t(
2039
+ rt,
2016
2040
  {
2017
- path: v.path,
2018
- linesAdded: v.linesAdded,
2019
- linesRemoved: v.linesRemoved
2041
+ path: w.path,
2042
+ linesAdded: w.linesAdded,
2043
+ linesRemoved: w.linesRemoved
2020
2044
  },
2021
- v.path
2045
+ w.path
2022
2046
  )),
2023
2047
  f.length > 4 && /* @__PURE__ */ a("span", { className: "text-xs text-white/40", children: [
2024
2048
  "+",
@@ -2029,55 +2053,55 @@ function _n({
2029
2053
  ]
2030
2054
  }
2031
2055
  ),
2032
- h && /* @__PURE__ */ t("div", { className: "pl-5 border-l border-white/10 ml-1.5 mt-1 space-y-0.5", children: e.map((v) => /* @__PURE__ */ t(et, { toolCall: v }, v.id)) })
2056
+ h && /* @__PURE__ */ t("div", { className: "pl-5 border-l border-white/10 ml-1.5 mt-1 space-y-0.5", children: e.map((w) => /* @__PURE__ */ t(nt, { toolCall: w }, w.id)) })
2033
2057
  ] });
2034
2058
  }
2035
- function vr(e) {
2059
+ function wr(e) {
2036
2060
  return e.action === "command_run";
2037
2061
  }
2038
- function yr(e) {
2062
+ function vr(e) {
2039
2063
  return e.action === "file_read";
2040
2064
  }
2041
- function br(e) {
2065
+ function yr(e) {
2042
2066
  return e.action === "file_edit";
2043
2067
  }
2044
- function Nr(e) {
2068
+ function br(e) {
2045
2069
  return e.action === "file_write";
2046
2070
  }
2047
- function kr(e) {
2071
+ function Nr(e) {
2048
2072
  return e.action === "search";
2049
2073
  }
2050
- function Cr(e) {
2074
+ function kr(e) {
2051
2075
  return e.action === "glob";
2052
2076
  }
2053
- function _r(e) {
2077
+ function Cr(e) {
2054
2078
  return e.action === "web_fetch";
2055
2079
  }
2056
- function Tr(e) {
2080
+ function _r(e) {
2057
2081
  return e.action === "web_search";
2058
2082
  }
2059
- function Sr(e) {
2083
+ function Tr(e) {
2060
2084
  return e.action === "mcp_tool";
2061
2085
  }
2062
- function Mr(e) {
2086
+ function Sr(e) {
2063
2087
  return e.action === "generic_tool";
2064
2088
  }
2065
- function Er(e) {
2089
+ function Mr(e) {
2066
2090
  return e.type === "tool_call";
2067
2091
  }
2068
- function Ir(e) {
2092
+ function Er(e) {
2069
2093
  return e.type === "error";
2070
2094
  }
2071
- var Tn = {
2095
+ var Sn = {
2072
2096
  mode: "inline",
2073
2097
  breakEveryNToolCalls: 0,
2074
2098
  defaultExpanded: !1,
2075
2099
  animationDuration: 300
2076
- }, Sn = Je(null);
2077
- function Mn() {
2078
- const e = Ue(Sn);
2100
+ }, Mn = Je(null);
2101
+ function En() {
2102
+ const e = Ue(Mn);
2079
2103
  return e || {
2080
- config: Tn,
2104
+ config: Sn,
2081
2105
  setMode: () => {
2082
2106
  },
2083
2107
  setConfig: () => {
@@ -2086,11 +2110,11 @@ function Mn() {
2086
2110
  }
2087
2111
  };
2088
2112
  }
2089
- function En() {
2090
- const { config: e } = Mn();
2113
+ function In() {
2114
+ const { config: e } = En();
2091
2115
  return e;
2092
2116
  }
2093
- function In({
2117
+ function Ln({
2094
2118
  entries: e,
2095
2119
  loading: n,
2096
2120
  streamingContent: r,
@@ -2103,110 +2127,110 @@ function In({
2103
2127
  userVariant: f,
2104
2128
  assistantVariant: d,
2105
2129
  scale: x,
2106
- showAvatars: p = !0,
2107
- showTimestamp: v = !0,
2130
+ showAvatars: m = !0,
2131
+ showTimestamp: w = !0,
2108
2132
  markdownComponents: E,
2109
2133
  renderMetadata: D,
2110
2134
  metadata: R,
2111
- className: _
2135
+ className: T
2112
2136
  }) {
2113
- const Q = En(), T = s || Q, F = G(null), A = G(null);
2114
- z(() => {
2115
- h && A.current && F.current && A.current.scrollIntoView({ behavior: "smooth", block: "end" });
2137
+ const X = In(), S = s || X, G = V(null), A = V(null);
2138
+ P(() => {
2139
+ h && A.current && G.current && A.current.scrollIntoView({ behavior: "smooth", block: "end" });
2116
2140
  }, [e, r, n, h]);
2117
- const j = P(
2118
- (W, H) => {
2141
+ const W = F(
2142
+ (B, H) => {
2119
2143
  if (c)
2120
- return (k) => {
2144
+ return (C) => {
2121
2145
  c({
2122
- ...k,
2123
- entryId: W,
2146
+ ...C,
2147
+ entryId: B,
2124
2148
  widgetType: H
2125
2149
  });
2126
2150
  };
2127
2151
  },
2128
2152
  [c]
2129
- ), ie = ae(() => T.mode === "inline" ? e.map((W) => ({
2153
+ ), ie = ae(() => S.mode === "inline" ? e.map((B) => ({
2130
2154
  type: "single",
2131
- entry: W,
2132
- id: W.id
2133
- })) : gt(e, T), [e, T]), X = x ? `ash-density-${x}` : void 0;
2134
- return /* @__PURE__ */ a("div", { ref: F, className: m("flex-1 overflow-y-auto px-3 py-2 space-y-1 ash-scrollbar", X, _), children: [
2135
- ie.map((W) => {
2136
- if (W.type === "single") {
2137
- const k = W.entry;
2138
- if (k.entryType.type === "widget" && l) {
2139
- const B = k.entryType, ee = l({
2140
- entry: k,
2141
- widgetType: B.widgetType,
2142
- widgetData: B.widgetData,
2143
- onAction: j(k.id, B.widgetType)
2155
+ entry: B,
2156
+ id: B.id
2157
+ })) : vt(e, S), [e, S]), ee = x ? `ash-density-${x}` : void 0;
2158
+ return /* @__PURE__ */ a("div", { ref: G, className: p("flex-1 overflow-y-auto px-3 py-2 space-y-1 ash-scrollbar", ee, T), children: [
2159
+ ie.map((B) => {
2160
+ if (B.type === "single") {
2161
+ const C = B.entry;
2162
+ if (C.entryType.type === "widget" && l) {
2163
+ const O = C.entryType, te = l({
2164
+ entry: C,
2165
+ widgetType: O.widgetType,
2166
+ widgetData: O.widgetData,
2167
+ onAction: W(C.id, O.widgetType)
2144
2168
  });
2145
- if (ee !== null)
2146
- return /* @__PURE__ */ t("div", { className: "ash-animate-fade-in", children: ee }, k.id);
2169
+ if (te !== null)
2170
+ return /* @__PURE__ */ t("div", { className: "ash-animate-fade-in", children: te }, C.id);
2147
2171
  }
2148
2172
  return /* @__PURE__ */ t(
2149
- cn,
2173
+ dn,
2150
2174
  {
2151
- entry: k,
2175
+ entry: C,
2152
2176
  onOptionSelect: i,
2153
- defaultExpanded: T.defaultExpanded,
2177
+ defaultExpanded: S.defaultExpanded,
2154
2178
  richContentRenderers: o,
2155
2179
  markdownComponents: E,
2156
2180
  userVariant: f,
2157
2181
  assistantVariant: d,
2158
2182
  scale: x,
2159
- showAvatars: p,
2160
- showTimestamp: v,
2183
+ showAvatars: m,
2184
+ showTimestamp: w,
2161
2185
  renderMetadata: D,
2162
2186
  metadata: R
2163
2187
  },
2164
- k.id
2188
+ C.id
2165
2189
  );
2166
2190
  }
2167
- const H = wt(W.entries);
2191
+ const H = yt(B.entries);
2168
2192
  return /* @__PURE__ */ a("div", { className: "ash-message-row flex ash-animate-fade-in pl-1", style: { gap: "var(--ash-message-gap, 0.5rem)" }, children: [
2169
- p && /* @__PURE__ */ t("div", { className: "ash-avatar rounded-md bg-[var(--ash-avatar-assistant-bg)] flex items-center justify-center shrink-0 mt-0.5", style: { width: "var(--ash-avatar-size, 1.25rem)", height: "var(--ash-avatar-size, 1.25rem)" }, children: /* @__PURE__ */ t(me, { className: "w-3 h-3 text-[var(--ash-accent)]" }) }),
2170
- /* @__PURE__ */ t("div", { className: "flex-1 min-w-0", children: T.mode === "accordion" ? /* @__PURE__ */ t(
2171
- _n,
2193
+ m && /* @__PURE__ */ t("div", { className: "ash-avatar rounded-md bg-[var(--ash-avatar-assistant-bg)] flex items-center justify-center shrink-0 mt-0.5", style: { width: "var(--ash-avatar-size, 1.25rem)", height: "var(--ash-avatar-size, 1.25rem)" }, children: /* @__PURE__ */ t(xe, { className: "w-3 h-3 text-[var(--ash-accent)]" }) }),
2194
+ /* @__PURE__ */ t("div", { className: "flex-1 min-w-0", children: S.mode === "accordion" ? /* @__PURE__ */ t(
2195
+ Tn,
2172
2196
  {
2173
2197
  toolCalls: H,
2174
- defaultExpanded: T.defaultExpanded
2198
+ defaultExpanded: S.defaultExpanded
2175
2199
  }
2176
2200
  ) : /* @__PURE__ */ t(
2177
- bn,
2201
+ Nn,
2178
2202
  {
2179
2203
  toolCalls: H,
2180
- defaultExpanded: T.defaultExpanded,
2181
- animationDuration: T.animationDuration
2204
+ defaultExpanded: S.defaultExpanded,
2205
+ animationDuration: S.animationDuration
2182
2206
  }
2183
2207
  ) })
2184
- ] }, W.id);
2208
+ ] }, B.id);
2185
2209
  }),
2186
2210
  r && /* @__PURE__ */ a("div", { className: "ash-message-row flex ash-animate-fade-in pl-1", style: { gap: "var(--ash-message-gap, 0.5rem)" }, children: [
2187
- p && /* @__PURE__ */ t("div", { className: "ash-avatar rounded-md bg-[var(--ash-avatar-assistant-bg)] flex items-center justify-center shrink-0 mt-0.5", style: { width: "var(--ash-avatar-size, 1.25rem)", height: "var(--ash-avatar-size, 1.25rem)" }, children: /* @__PURE__ */ t(me, { className: "w-3 h-3 text-[var(--ash-accent)]" }) }),
2188
- /* @__PURE__ */ t("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ t("div", { className: "ash-message-bubble rounded-lg bg-white/[0.03] text-white/80 leading-relaxed", style: { padding: "var(--ash-message-padding, 0.5rem 0.75rem)", fontSize: "var(--ash-font-size-base, 13px)" }, children: /* @__PURE__ */ t(dn, { content: r, isStreaming: !0 }) }) })
2211
+ m && /* @__PURE__ */ t("div", { className: "ash-avatar rounded-md bg-[var(--ash-avatar-assistant-bg)] flex items-center justify-center shrink-0 mt-0.5", style: { width: "var(--ash-avatar-size, 1.25rem)", height: "var(--ash-avatar-size, 1.25rem)" }, children: /* @__PURE__ */ t(xe, { className: "w-3 h-3 text-[var(--ash-accent)]" }) }),
2212
+ /* @__PURE__ */ t("div", { className: "flex-1 min-w-0", children: /* @__PURE__ */ t("div", { className: "ash-message-bubble rounded-lg bg-white/[0.03] text-white/80 leading-relaxed", style: { padding: "var(--ash-message-padding, 0.5rem 0.75rem)", fontSize: "var(--ash-font-size-base, 13px)" }, children: /* @__PURE__ */ t(un, { content: r, isStreaming: !0 }) }) })
2189
2213
  ] }),
2190
2214
  n && !r && /* @__PURE__ */ a("div", { className: "ash-message-row flex ash-animate-fade-in pl-1", style: { gap: "var(--ash-message-gap, 0.5rem)" }, children: [
2191
- p && /* @__PURE__ */ t("div", { className: "ash-avatar rounded-md bg-[var(--ash-avatar-assistant-bg)] flex items-center justify-center shrink-0 mt-0.5", style: { width: "var(--ash-avatar-size, 1.25rem)", height: "var(--ash-avatar-size, 1.25rem)" }, children: /* @__PURE__ */ t(me, { className: "w-3 h-3 text-[var(--ash-accent)]" }) }),
2215
+ m && /* @__PURE__ */ t("div", { className: "ash-avatar rounded-md bg-[var(--ash-avatar-assistant-bg)] flex items-center justify-center shrink-0 mt-0.5", style: { width: "var(--ash-avatar-size, 1.25rem)", height: "var(--ash-avatar-size, 1.25rem)" }, children: /* @__PURE__ */ t(xe, { className: "w-3 h-3 text-[var(--ash-accent)]" }) }),
2192
2216
  /* @__PURE__ */ t("div", { className: "rounded-lg px-3 py-1.5 bg-white/[0.03]", children: /* @__PURE__ */ t(Re, { variant: "dots" }) })
2193
2217
  ] }),
2194
2218
  /* @__PURE__ */ t("div", { ref: A })
2195
2219
  ] });
2196
2220
  }
2197
- function Ln(e) {
2221
+ function $n(e) {
2198
2222
  switch (e) {
2199
2223
  case "info":
2200
- return /* @__PURE__ */ t(St, { className: "w-3.5 h-3.5" });
2224
+ return /* @__PURE__ */ t(Et, { className: "w-3.5 h-3.5" });
2201
2225
  case "warn":
2202
- return /* @__PURE__ */ t(Ye, { className: "w-3.5 h-3.5" });
2226
+ return /* @__PURE__ */ t(Ze, { className: "w-3.5 h-3.5" });
2203
2227
  case "error":
2204
- return /* @__PURE__ */ t(Mt, { className: "w-3.5 h-3.5" });
2228
+ return /* @__PURE__ */ t(It, { className: "w-3.5 h-3.5" });
2205
2229
  case "debug":
2206
- return /* @__PURE__ */ t(Et, { className: "w-3.5 h-3.5" });
2230
+ return /* @__PURE__ */ t(Lt, { className: "w-3.5 h-3.5" });
2207
2231
  }
2208
2232
  }
2209
- function $n(e) {
2233
+ function Rn(e) {
2210
2234
  switch (e) {
2211
2235
  case "info":
2212
2236
  return "text-blue-400";
@@ -2218,7 +2242,7 @@ function $n(e) {
2218
2242
  return "text-white/50";
2219
2243
  }
2220
2244
  }
2221
- function Rn(e) {
2245
+ function An(e) {
2222
2246
  switch (e) {
2223
2247
  case "info":
2224
2248
  return "bg-blue-900/20";
@@ -2230,7 +2254,7 @@ function Rn(e) {
2230
2254
  return "bg-white/5";
2231
2255
  }
2232
2256
  }
2233
- function An(e) {
2257
+ function Dn(e) {
2234
2258
  switch (e) {
2235
2259
  case "setup":
2236
2260
  return "Setup";
@@ -2244,26 +2268,26 @@ function An(e) {
2244
2268
  return "Startup";
2245
2269
  }
2246
2270
  }
2247
- function Dn({ log: e }) {
2271
+ function jn({ log: e }) {
2248
2272
  const [n, r] = N(!1), s = e.data && Object.keys(e.data).length > 0;
2249
2273
  return /* @__PURE__ */ a(
2250
2274
  "div",
2251
2275
  {
2252
- className: m(
2276
+ className: p(
2253
2277
  "px-3 py-2 border-b border-white/10 last:border-b-0",
2254
- Rn(e.level)
2278
+ An(e.level)
2255
2279
  ),
2256
2280
  children: [
2257
2281
  /* @__PURE__ */ a(
2258
2282
  "div",
2259
2283
  {
2260
- className: m("flex items-start gap-2", s && "cursor-pointer"),
2284
+ className: p("flex items-start gap-2", s && "cursor-pointer"),
2261
2285
  onClick: () => s && r(!n),
2262
2286
  children: [
2263
- /* @__PURE__ */ t("div", { className: "w-4 flex-shrink-0 pt-0.5", children: s && (n ? /* @__PURE__ */ t(We, { className: "w-3 h-3 text-white/40" }) : /* @__PURE__ */ t(ye, { className: "w-3 h-3 text-white/40" })) }),
2264
- /* @__PURE__ */ t("div", { className: m("flex-shrink-0 pt-0.5", $n(e.level)), children: Ln(e.level) }),
2287
+ /* @__PURE__ */ t("div", { className: "w-4 flex-shrink-0 pt-0.5", children: s && (n ? /* @__PURE__ */ t(We, { className: "w-3 h-3 text-white/40" }) : /* @__PURE__ */ t(be, { className: "w-3 h-3 text-white/40" })) }),
2288
+ /* @__PURE__ */ t("div", { className: p("flex-shrink-0 pt-0.5", Rn(e.level)), children: $n(e.level) }),
2265
2289
  /* @__PURE__ */ t("span", { className: "text-xs text-white/40 font-mono flex-shrink-0 pt-0.5", children: je(e.timestamp) }),
2266
- /* @__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) }),
2290
+ /* @__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: Dn(e.category) }),
2267
2291
  /* @__PURE__ */ t("span", { className: "text-sm text-white/80 flex-1 break-words", children: e.message })
2268
2292
  ]
2269
2293
  }
@@ -2273,7 +2297,7 @@ function Dn({ log: e }) {
2273
2297
  }
2274
2298
  );
2275
2299
  }
2276
- function jn({
2300
+ function Wn({
2277
2301
  logs: e,
2278
2302
  title: n = "Logs",
2279
2303
  isLoading: r,
@@ -2285,7 +2309,7 @@ function jn({
2285
2309
  return e.length === 0 && !r ? null : /* @__PURE__ */ a(
2286
2310
  "div",
2287
2311
  {
2288
- className: m(
2312
+ className: p(
2289
2313
  "border-t border-white/10 bg-[var(--ash-surface-dark,#0a0a0a)]",
2290
2314
  l
2291
2315
  ),
@@ -2297,7 +2321,7 @@ function jn({
2297
2321
  className: "w-full flex items-center justify-between px-4 py-2 hover:bg-white/5 transition-colors",
2298
2322
  children: [
2299
2323
  /* @__PURE__ */ a("div", { className: "flex items-center gap-2", children: [
2300
- /* @__PURE__ */ t(Ee, { className: "w-4 h-4 text-white/50" }),
2324
+ /* @__PURE__ */ t(Ie, { className: "w-4 h-4 text-white/50" }),
2301
2325
  /* @__PURE__ */ t("span", { className: "text-sm font-medium text-white/80", children: n }),
2302
2326
  /* @__PURE__ */ a("span", { className: "text-xs text-white/40", children: [
2303
2327
  "(",
@@ -2316,7 +2340,7 @@ function jn({
2316
2340
  ] }),
2317
2341
  r && /* @__PURE__ */ t("span", { className: "text-xs text-white/40 animate-pulse", children: "Loading..." })
2318
2342
  ] }),
2319
- c ? /* @__PURE__ */ t(ye, { className: "w-4 h-4 text-white/40" }) : /* @__PURE__ */ t(We, { className: "w-4 h-4 text-white/40" })
2343
+ c ? /* @__PURE__ */ t(be, { className: "w-4 h-4 text-white/40" }) : /* @__PURE__ */ t(We, { className: "w-4 h-4 text-white/40" })
2320
2344
  ]
2321
2345
  }
2322
2346
  ),
@@ -2325,18 +2349,18 @@ function jn({
2325
2349
  {
2326
2350
  className: "overflow-y-auto border-t border-white/10",
2327
2351
  style: { maxHeight: i },
2328
- 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, x) => /* @__PURE__ */ t(Dn, { log: d }, `${d.timestamp}-${x}`))
2352
+ 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, x) => /* @__PURE__ */ t(jn, { log: d }, `${d.timestamp}-${x}`))
2329
2353
  }
2330
2354
  )
2331
2355
  ]
2332
2356
  }
2333
2357
  );
2334
2358
  }
2335
- var Ae = Je(void 0), Wn = "ash-ui-theme";
2336
- function Lr({
2359
+ var Ae = Je(void 0), Bn = "ash-ui-theme";
2360
+ function Ir({
2337
2361
  children: e,
2338
2362
  defaultTheme: n,
2339
- storageKey: r = Wn,
2363
+ storageKey: r = Bn,
2340
2364
  listenToSystemChanges: s = !0
2341
2365
  }) {
2342
2366
  const [i, l] = N(() => {
@@ -2349,33 +2373,33 @@ function Lr({
2349
2373
  }
2350
2374
  return n ?? "light";
2351
2375
  }), [c, h] = N(!1);
2352
- z(() => {
2376
+ P(() => {
2353
2377
  h(!0);
2354
- }, []), z(() => {
2378
+ }, []), P(() => {
2355
2379
  if (!c) return;
2356
2380
  const d = document.documentElement;
2357
2381
  i === "dark" ? d.classList.add("dark") : d.classList.remove("dark"), localStorage.setItem(r, i);
2358
- }, [i, c, r]), z(() => {
2382
+ }, [i, c, r]), P(() => {
2359
2383
  if (!s || typeof window > "u") return;
2360
- const d = window.matchMedia("(prefers-color-scheme: dark)"), x = (p) => {
2361
- localStorage.getItem(r) || l(p.matches ? "dark" : "light");
2384
+ const d = window.matchMedia("(prefers-color-scheme: dark)"), x = (m) => {
2385
+ localStorage.getItem(r) || l(m.matches ? "dark" : "light");
2362
2386
  };
2363
2387
  return d.addEventListener("change", x), () => d.removeEventListener("change", x);
2364
2388
  }, [r, s]);
2365
- const o = P(() => {
2389
+ const o = F(() => {
2366
2390
  l((d) => d === "light" ? "dark" : "light");
2367
- }, []), f = P((d) => {
2391
+ }, []), f = F((d) => {
2368
2392
  l(d);
2369
2393
  }, []);
2370
2394
  return c ? /* @__PURE__ */ t(Ae.Provider, { value: { theme: i, toggleTheme: o, setTheme: f }, children: e }) : /* @__PURE__ */ t(Ae.Provider, { value: { theme: n ?? "light", toggleTheme: o, setTheme: f }, children: e });
2371
2395
  }
2372
- function $r() {
2396
+ function Lr() {
2373
2397
  const e = Ue(Ae);
2374
2398
  if (e === void 0)
2375
2399
  throw new Error("useTheme must be used within a ThemeProvider");
2376
2400
  return e;
2377
2401
  }
2378
- var Bn = {
2402
+ var On = {
2379
2403
  slideUp: `
2380
2404
  @keyframes ash-slide-up {
2381
2405
  from { opacity: 0; transform: translateY(20px); }
@@ -2413,18 +2437,18 @@ var Bn = {
2413
2437
  }
2414
2438
  `
2415
2439
  };
2416
- Object.values(Bn).join(`
2440
+ Object.values(On).join(`
2417
2441
  `);
2418
- function On({
2442
+ function zn({
2419
2443
  messages: e,
2420
2444
  loading: n,
2421
2445
  streamingContent: r
2422
2446
  }) {
2423
- const s = G(null), i = G(null);
2424
- return z(() => {
2447
+ const s = V(null), i = V(null);
2448
+ return P(() => {
2425
2449
  i.current && i.current.scrollIntoView({ behavior: "smooth", block: "end" });
2426
2450
  }, [e, r, n]), /* @__PURE__ */ a("div", { ref: s, className: "flex-1 overflow-y-auto p-4 space-y-4", children: [
2427
- e.map((l) => /* @__PURE__ */ t(zn, { message: l }, l.id)),
2451
+ e.map((l) => /* @__PURE__ */ t(Fn, { message: l }, l.id)),
2428
2452
  r && /* @__PURE__ */ t("div", { className: "flex justify-start animate-fade-in", children: /* @__PURE__ */ a("div", { className: "max-w-[80%] card-glass rounded-2xl p-4", children: [
2429
2453
  /* @__PURE__ */ t("div", { className: "text-xs text-[#ccff00] mb-2 font-medium", children: "Assistant" }),
2430
2454
  /* @__PURE__ */ t("div", { className: "message-content prose prose-sm prose-invert max-w-none whitespace-pre-wrap", children: r })
@@ -2437,7 +2461,7 @@ function On({
2437
2461
  /* @__PURE__ */ t("div", { ref: i })
2438
2462
  ] });
2439
2463
  }
2440
- function zn({ message: e }) {
2464
+ function Fn({ message: e }) {
2441
2465
  const n = e.role === "user", r = e.role === "tool";
2442
2466
  return /* @__PURE__ */ t("div", { className: `flex ${n ? "justify-end" : "justify-start"} animate-fade-in`, children: /* @__PURE__ */ a(
2443
2467
  "div",
@@ -2451,13 +2475,13 @@ function zn({ message: e }) {
2451
2475
  children: e.role.charAt(0).toUpperCase() + e.role.slice(1)
2452
2476
  }
2453
2477
  ),
2454
- /* @__PURE__ */ t("div", { className: `message-content ${n ? "" : "prose prose-sm prose-invert max-w-none"}`, children: e.content.map((i, l) => /* @__PURE__ */ t(Fn, { block: i, isUser: n }, l)) }),
2478
+ /* @__PURE__ */ t("div", { className: `message-content ${n ? "" : "prose prose-sm prose-invert max-w-none"}`, children: e.content.map((i, l) => /* @__PURE__ */ t(Pn, { block: i, isUser: n }, l)) }),
2455
2479
  /* @__PURE__ */ t("div", { className: `text-xs mt-3 ${n ? "text-black/40" : "text-white/40"}`, children: new Date(e.createdAt).toLocaleTimeString() })
2456
2480
  ]
2457
2481
  }
2458
2482
  ) });
2459
2483
  }
2460
- function Fn({
2484
+ function Pn({
2461
2485
  block: e,
2462
2486
  isUser: n
2463
2487
  }) {
@@ -2476,11 +2500,11 @@ function Fn({
2476
2500
  /* @__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) })
2477
2501
  ] }) : null;
2478
2502
  }
2479
- const Pn = 5e3;
2480
- function Ve(e) {
2503
+ const Gn = 5e3;
2504
+ function qe(e) {
2481
2505
  return e < 1024 ? `${e} B` : e < 1024 * 1024 ? `${(e / 1024).toFixed(1)} KB` : `${(e / (1024 * 1024)).toFixed(1)} MB`;
2482
2506
  }
2483
- function Gn({
2507
+ function Vn({
2484
2508
  onSend: e,
2485
2509
  disabled: n,
2486
2510
  loading: r,
@@ -2494,130 +2518,132 @@ function Gn({
2494
2518
  enableFileUpload: d = !0,
2495
2519
  maxFileSize: x = 100 * 1024 * 1024,
2496
2520
  // 100MB
2497
- maxFiles: p = 10,
2498
- onStop: v,
2521
+ maxFiles: m = 10,
2522
+ onStop: w,
2499
2523
  canStop: E = !1,
2500
2524
  enableLongTextConversion: D = !0,
2501
- longTextThreshold: R = Pn
2525
+ longTextThreshold: R = Gn
2502
2526
  }) {
2503
- const [_, Q] = N(""), [T, F] = N(!1), [A, j] = N(!1), [ie, X] = N(""), [W, H] = N(""), [k, B] = N([]), [ee, de] = N(!1), [te, Z] = N(null), [pe, fe] = N(/* @__PURE__ */ new Map()), we = G(0), ue = G(null), Ne = G(null), xe = G(null), ve = P((u) => {
2527
+ const [T, X] = N(""), [S, G] = N(!1), [A, W] = N(!1), [ie, ee] = N(""), [B, H] = N(""), [C, O] = N([]), [te, ce] = N(!1), [ne, Q] = N(null), [he, me] = N(/* @__PURE__ */ new Map()), ge = V(0), de = V(null), ke = V(null), pe = V(null), we = F((u) => {
2504
2528
  const I = new TextEncoder().encode(u);
2505
- let g = "";
2506
- for (let C = 0; C < I.length; C++)
2507
- g += String.fromCharCode(I[C]);
2508
- return btoa(g);
2509
- }, []), V = P((u) => {
2529
+ let k = "";
2530
+ for (let y = 0; y < I.length; y++)
2531
+ k += String.fromCharCode(I[y]);
2532
+ return btoa(k);
2533
+ }, []), K = F((u) => {
2510
2534
  if (!D || !d) return;
2511
2535
  const b = u.clipboardData.getData("text/plain");
2512
2536
  if (b.length > R) {
2513
- if (u.preventDefault(), k.length >= p) {
2514
- console.warn(`Cannot convert text to attachment: maximum ${p} files reached`);
2537
+ if (u.preventDefault(), C.length >= m) {
2538
+ console.warn(`Cannot convert text to attachment: maximum ${m} files reached`);
2515
2539
  return;
2516
2540
  }
2517
2541
  const I = b.split(`
2518
2542
  `).length;
2519
- we.current += 1;
2520
- const g = we.current, C = `pasted-text-${g}-${Date.now()}.txt`, re = ve(b), st = new TextEncoder().encode(b).length, at = {
2521
- filename: C,
2522
- content: re,
2543
+ ge.current += 1;
2544
+ const k = ge.current, y = `pasted-text-${k}-${Date.now()}.txt`, j = we(b), it = new TextEncoder().encode(b).length, lt = {
2545
+ filename: y,
2546
+ content: j,
2523
2547
  mimeType: "text/plain",
2524
- size: st
2548
+ size: it
2525
2549
  };
2526
- fe((Le) => {
2550
+ me((Le) => {
2527
2551
  const Ge = new Map(Le);
2528
- return Ge.set(C, { number: g, lineCount: I }), Ge;
2529
- }), B((Le) => [...Le, at]), Z({
2552
+ return Ge.set(y, { number: k, lineCount: I }), Ge;
2553
+ }), O((Le) => [...Le, lt]), Q({
2530
2554
  originalLength: b.length,
2531
- filename: C,
2555
+ filename: y,
2532
2556
  preview: b.slice(0, 100) + (b.length > 100 ? "..." : ""),
2533
2557
  lineCount: I
2534
2558
  }), setTimeout(() => {
2535
- Z(null);
2559
+ Q(null);
2536
2560
  }, 5e3);
2537
2561
  }
2538
- }, [D, d, R, k.length, p, ve]), w = () => {
2539
- const u = _.trim();
2540
- (u || k.length > 0) && !n && (e(u || "(files attached)", k.length > 0 ? k : void 0), Q(""), B([]), fe(/* @__PURE__ */ new Map()), ue.current && (ue.current.style.height = "auto"));
2541
- }, y = (u) => {
2542
- u.key === "Enter" && !u.shiftKey && (u.preventDefault(), w());
2562
+ }, [D, d, R, C.length, m, we]), g = () => {
2563
+ const u = T.trim();
2564
+ (u || C.length > 0) && !n && (e(u || "(files attached)", C.length > 0 ? C : void 0), X(""), O([]), me(/* @__PURE__ */ new Map()), de.current && (de.current.style.height = "auto"));
2565
+ }, v = (u) => {
2566
+ u.key === "Enter" && !u.shiftKey && (u.preventDefault(), g());
2543
2567
  }, M = () => {
2544
- const u = ue.current;
2568
+ const u = de.current;
2545
2569
  u && (u.style.height = "auto", u.style.height = `${Math.min(u.scrollHeight, 200)}px`);
2546
- }, O = async (u) => {
2570
+ }, z = async (u) => {
2547
2571
  if (!u) return;
2548
- const b = [], I = k.length;
2549
- for (let g = 0; g < u.length && I + b.length < p; g++) {
2550
- const C = u[g];
2551
- if (C.size > x) {
2552
- console.warn(`File ${C.name} exceeds maximum size of ${Ve(x)}`);
2572
+ const b = [], I = C.length;
2573
+ for (let k = 0; k < u.length && I + b.length < m; k++) {
2574
+ const y = u[k];
2575
+ if (y.size > x) {
2576
+ console.warn(`File ${y.name} exceeds maximum size of ${qe(x)}`);
2553
2577
  continue;
2554
2578
  }
2555
2579
  try {
2556
- const re = await ne(C);
2580
+ const j = await re(y);
2557
2581
  b.push({
2558
- filename: C.name,
2559
- content: re,
2560
- mimeType: C.type || "application/octet-stream",
2561
- size: C.size
2582
+ filename: y.name,
2583
+ content: j,
2584
+ mimeType: y.type || "application/octet-stream",
2585
+ size: y.size
2562
2586
  });
2563
- } catch (re) {
2564
- console.error(`Failed to read file ${C.name}:`, re);
2587
+ } catch (j) {
2588
+ console.error(`Failed to read file ${y.name}:`, j);
2565
2589
  }
2566
2590
  }
2567
- b.length > 0 && B((g) => [...g, ...b]);
2568
- }, ne = (u) => new Promise((b, I) => {
2569
- const g = new FileReader();
2570
- g.onload = () => {
2571
- const re = g.result.split(",")[1];
2572
- b(re || "");
2573
- }, g.onerror = () => I(g.error), g.readAsDataURL(u);
2591
+ b.length > 0 && O((k) => [...k, ...b]);
2592
+ }, re = (u) => new Promise((b, I) => {
2593
+ const k = new FileReader();
2594
+ k.onload = () => {
2595
+ const j = k.result.split(",")[1];
2596
+ b(j || "");
2597
+ }, k.onerror = () => I(k.error), k.readAsDataURL(u);
2574
2598
  }), le = (u) => {
2575
- O(u.target.files), xe.current && (xe.current.value = "");
2576
- }, he = (u) => {
2577
- u.preventDefault(), d && !n && de(!0);
2578
- }, J = (u) => {
2579
- u.preventDefault(), de(!1);
2580
- }, q = (u) => {
2581
- u.preventDefault(), de(!1), d && !n && O(u.dataTransfer.files);
2582
- }, U = (u) => {
2583
- const b = k[u];
2584
- b && pe.has(b.filename) && fe((I) => {
2585
- const g = new Map(I);
2586
- return g.delete(b.filename), g;
2587
- }), B((I) => I.filter((g, C) => C !== u));
2588
- }, K = i.length > 0, ke = r ? "Sending..." : K ? `Queue (${i.length})` : "Send", Ce = c.trim().length > 0, _e = Object.keys(o).length > 0, Ie = !n && (_.trim() || k.length > 0), ge = () => {
2589
- const u = ie.trim(), b = W.trim();
2590
- u && f && (f({ ...o, [u]: b }), X(""), H(""));
2599
+ z(u.target.files), pe.current && (pe.current.value = "");
2600
+ }, ue = (u) => {
2601
+ u.preventDefault(), d && !n && ce(!0);
2591
2602
  }, Y = (u) => {
2603
+ u.preventDefault(), ce(!1);
2604
+ }, q = (u) => {
2605
+ u.preventDefault(), ce(!1), d && !n && z(u.dataTransfer.files);
2606
+ }, Z = (u) => {
2607
+ const b = C[u];
2608
+ b && he.has(b.filename) && me((I) => {
2609
+ const k = new Map(I);
2610
+ return k.delete(b.filename), k;
2611
+ }), O((I) => I.filter((k, y) => y !== u));
2612
+ }, J = i.length > 0;
2613
+ r || J && `${i.length}`;
2614
+ const Ce = c.trim().length > 0, _e = Object.keys(o).length > 0, ve = !n && (T.trim() || C.length > 0), Te = () => {
2615
+ const u = ie.trim(), b = B.trim();
2616
+ u && f && (f({ ...o, [u]: b }), ee(""), H(""));
2617
+ }, ye = (u) => {
2592
2618
  if (f) {
2593
2619
  const b = { ...o };
2594
2620
  delete b[u], f(b);
2595
2621
  }
2596
- }, oe = (u) => {
2597
- u.key === "Enter" && (u.preventDefault(), ge());
2622
+ }, U = (u) => {
2623
+ u.key === "Enter" && (u.preventDefault(), Te());
2598
2624
  };
2599
2625
  return /* @__PURE__ */ a(
2600
2626
  "div",
2601
2627
  {
2602
- className: `border-t border-white/10 p-3 sm:p-4 glass-panel relative ${ee ? "bg-[#ccff00]/5" : ""}`,
2603
- onDragOver: he,
2604
- onDragLeave: J,
2628
+ className: `border-t border-white/10 p-3 sm:p-4 glass-panel relative ${te ? "bg-[#ccff00]/5" : ""}`,
2629
+ onDragOver: ue,
2630
+ onDragLeave: Y,
2605
2631
  onDrop: q,
2606
2632
  children: [
2607
- ee && d && /* @__PURE__ */ t("div", { className: "absolute inset-0 bg-[#ccff00]/10 border-2 border-dashed border-[#ccff00]/50 rounded-xl flex items-center justify-center z-10 pointer-events-none", children: /* @__PURE__ */ t("div", { className: "text-[#ccff00] font-medium", children: "Drop files here" }) }),
2633
+ te && d && /* @__PURE__ */ t("div", { className: "absolute inset-0 bg-[#ccff00]/10 border-2 border-dashed border-[#ccff00]/50 rounded-xl flex items-center justify-center z-10 pointer-events-none", children: /* @__PURE__ */ t("div", { className: "text-[#ccff00] font-medium", children: "Drop files here" }) }),
2608
2634
  h && /* @__PURE__ */ a("div", { className: "mb-3", children: [
2609
2635
  /* @__PURE__ */ a(
2610
2636
  "button",
2611
2637
  {
2612
2638
  type: "button",
2613
- onClick: () => F(!T),
2639
+ onClick: () => G(!S),
2614
2640
  className: "flex items-center gap-2 text-xs font-medium text-white/50 hover:text-white/80 transition-colors",
2615
2641
  children: [
2616
2642
  /* @__PURE__ */ t(
2617
2643
  "svg",
2618
2644
  {
2619
2645
  xmlns: "http://www.w3.org/2000/svg",
2620
- className: `h-3 w-3 transition-transform ${T ? "rotate-90" : ""}`,
2646
+ className: `h-3 w-3 transition-transform ${S ? "rotate-90" : ""}`,
2621
2647
  viewBox: "0 0 20 20",
2622
2648
  fill: "currentColor",
2623
2649
  children: /* @__PURE__ */ t(
@@ -2631,19 +2657,19 @@ function Gn({
2631
2657
  }
2632
2658
  ),
2633
2659
  /* @__PURE__ */ t("span", { className: "uppercase tracking-wide", children: "Session Context" }),
2634
- Ce && !T && /* @__PURE__ */ t("span", { className: "badge badge-accent", children: "Active" })
2660
+ Ce && !S && /* @__PURE__ */ t("span", { className: "badge badge-accent", children: "Active" })
2635
2661
  ]
2636
2662
  }
2637
2663
  ),
2638
- T && /* @__PURE__ */ a("div", { className: "mt-2", children: [
2664
+ S && /* @__PURE__ */ a("div", { className: "mt-2", children: [
2639
2665
  /* @__PURE__ */ t(
2640
2666
  "textarea",
2641
2667
  {
2642
- ref: Ne,
2668
+ ref: ke,
2643
2669
  value: c,
2644
2670
  onChange: (u) => h(u.target.value),
2645
2671
  onInput: () => {
2646
- const u = Ne.current;
2672
+ const u = ke.current;
2647
2673
  u && (u.style.height = "auto", u.style.height = `${Math.min(u.scrollHeight, 150)}px`);
2648
2674
  },
2649
2675
  placeholder: "Add context that will be injected into every request (e.g., current page, user selection, etc.)",
@@ -2659,7 +2685,7 @@ function Gn({
2659
2685
  "button",
2660
2686
  {
2661
2687
  type: "button",
2662
- onClick: () => j(!A),
2688
+ onClick: () => W(!A),
2663
2689
  className: "flex items-center gap-2 text-xs font-medium text-white/50 hover:text-white/80 transition-colors",
2664
2690
  children: [
2665
2691
  /* @__PURE__ */ t(
@@ -2696,7 +2722,7 @@ function Gn({
2696
2722
  /* @__PURE__ */ t(
2697
2723
  "button",
2698
2724
  {
2699
- onClick: () => Y(u),
2725
+ onClick: () => ye(u),
2700
2726
  className: "text-white/40 hover:text-red-400 transition-colors",
2701
2727
  title: "Remove variable",
2702
2728
  children: /* @__PURE__ */ t(
@@ -2728,8 +2754,8 @@ function Gn({
2728
2754
  {
2729
2755
  type: "text",
2730
2756
  value: ie,
2731
- onChange: (u) => X(u.target.value.toUpperCase().replace(/[^A-Z0-9_]/g, "")),
2732
- onKeyDown: oe,
2757
+ onChange: (u) => ee(u.target.value.toUpperCase().replace(/[^A-Z0-9_]/g, "")),
2758
+ onKeyDown: U,
2733
2759
  placeholder: "KEY",
2734
2760
  className: "input-glass text-sm font-mono flex-1 min-w-0 py-2"
2735
2761
  }
@@ -2739,9 +2765,9 @@ function Gn({
2739
2765
  "input",
2740
2766
  {
2741
2767
  type: "text",
2742
- value: W,
2768
+ value: B,
2743
2769
  onChange: (u) => H(u.target.value),
2744
- onKeyDown: oe,
2770
+ onKeyDown: U,
2745
2771
  placeholder: "value",
2746
2772
  className: "input-glass text-sm font-mono flex-[2] min-w-0 py-2"
2747
2773
  }
@@ -2749,7 +2775,7 @@ function Gn({
2749
2775
  /* @__PURE__ */ t(
2750
2776
  "button",
2751
2777
  {
2752
- onClick: ge,
2778
+ onClick: Te,
2753
2779
  disabled: !ie.trim(),
2754
2780
  className: "px-3 py-2 text-sm bg-[#ccff00]/20 hover:bg-[#ccff00]/30 text-[#ccff00] rounded-xl transition-all duration-300 disabled:opacity-30 disabled:cursor-not-allowed",
2755
2781
  children: "Add"
@@ -2759,7 +2785,7 @@ function Gn({
2759
2785
  /* @__PURE__ */ t("p", { className: "text-xs text-white/40", children: "These environment variables will be available in the sandbox for new sessions." })
2760
2786
  ] })
2761
2787
  ] }),
2762
- te && /* @__PURE__ */ t("div", { className: "mb-3 p-3 bg-blue-500/10 border border-blue-500/30 rounded-xl", children: /* @__PURE__ */ a("div", { className: "flex items-start justify-between gap-3", children: [
2788
+ ne && /* @__PURE__ */ t("div", { className: "mb-3 p-3 bg-blue-500/10 border border-blue-500/30 rounded-xl", children: /* @__PURE__ */ a("div", { className: "flex items-start justify-between gap-3", children: [
2763
2789
  /* @__PURE__ */ a("div", { className: "flex items-start gap-2 min-w-0", children: [
2764
2790
  /* @__PURE__ */ t(
2765
2791
  "svg",
@@ -2783,18 +2809,18 @@ function Gn({
2783
2809
  /* @__PURE__ */ a("div", { className: "min-w-0", children: [
2784
2810
  /* @__PURE__ */ t("p", { className: "text-sm text-blue-200 font-medium", children: "Long text converted to attachment" }),
2785
2811
  /* @__PURE__ */ a("p", { className: "text-xs text-blue-300/70 mt-1", children: [
2786
- te.originalLength.toLocaleString(),
2812
+ ne.originalLength.toLocaleString(),
2787
2813
  " characters (",
2788
- te.lineCount,
2814
+ ne.lineCount,
2789
2815
  " lines) saved as text attachment"
2790
2816
  ] }),
2791
- /* @__PURE__ */ t("p", { className: "text-xs text-white/50 mt-1 truncate font-mono", children: te.preview })
2817
+ /* @__PURE__ */ t("p", { className: "text-xs text-white/50 mt-1 truncate font-mono", children: ne.preview })
2792
2818
  ] })
2793
2819
  ] }),
2794
2820
  /* @__PURE__ */ t(
2795
2821
  "button",
2796
2822
  {
2797
- onClick: () => Z(null),
2823
+ onClick: () => Q(null),
2798
2824
  className: "text-blue-400/70 hover:text-blue-300 transition-colors shrink-0",
2799
2825
  title: "Dismiss",
2800
2826
  children: /* @__PURE__ */ t(
@@ -2817,20 +2843,20 @@ function Gn({
2817
2843
  }
2818
2844
  )
2819
2845
  ] }) }),
2820
- k.length > 0 && /* @__PURE__ */ a("div", { className: "mb-3 space-y-2", children: [
2846
+ C.length > 0 && /* @__PURE__ */ a("div", { className: "mb-3 space-y-2", children: [
2821
2847
  /* @__PURE__ */ a("div", { className: "text-xs font-medium text-white/50 uppercase tracking-wide", children: [
2822
2848
  "Attached Files (",
2823
- k.length,
2849
+ C.length,
2824
2850
  ")"
2825
2851
  ] }),
2826
- /* @__PURE__ */ t("div", { className: "flex flex-wrap gap-2", children: k.map((u, b) => {
2827
- const I = pe.get(u.filename), g = !!I;
2852
+ /* @__PURE__ */ t("div", { className: "flex flex-wrap gap-2", children: C.map((u, b) => {
2853
+ const I = he.get(u.filename), k = !!I;
2828
2854
  return /* @__PURE__ */ a(
2829
2855
  "div",
2830
2856
  {
2831
- className: `flex items-center gap-2 rounded-xl px-3 py-1.5 text-sm ${g ? "bg-purple-500/10 border border-purple-500/30" : "bg-white/5 border border-white/10"}`,
2857
+ className: `flex items-center gap-2 rounded-xl px-3 py-1.5 text-sm ${k ? "bg-purple-500/10 border border-purple-500/30" : "bg-white/5 border border-white/10"}`,
2832
2858
  children: [
2833
- g ? (
2859
+ k ? (
2834
2860
  // Pasted text icon (document with lines)
2835
2861
  /* @__PURE__ */ t(
2836
2862
  "svg",
@@ -2873,21 +2899,21 @@ function Gn({
2873
2899
  }
2874
2900
  )
2875
2901
  ),
2876
- g ? /* @__PURE__ */ a("span", { className: "text-purple-200 font-mono", title: u.filename, children: [
2902
+ k ? /* @__PURE__ */ a("span", { className: "text-purple-200 font-mono", title: u.filename, children: [
2877
2903
  "[Pasted text #",
2878
2904
  I.number,
2879
2905
  " +",
2880
2906
  I.lineCount,
2881
2907
  " lines]"
2882
- ] }) : /* @__PURE__ */ a(S, { children: [
2908
+ ] }) : /* @__PURE__ */ a(_, { children: [
2883
2909
  /* @__PURE__ */ t("span", { className: "text-white/80 truncate max-w-[150px]", title: u.filename, children: u.filename }),
2884
- /* @__PURE__ */ t("span", { className: "text-white/40 text-xs", children: Ve(u.size) })
2910
+ /* @__PURE__ */ t("span", { className: "text-white/40 text-xs", children: qe(u.size) })
2885
2911
  ] }),
2886
2912
  /* @__PURE__ */ t(
2887
2913
  "button",
2888
2914
  {
2889
- onClick: () => U(b),
2890
- className: `hover:text-red-400 transition-colors ${g ? "text-purple-400/70" : "text-white/40"}`,
2915
+ onClick: () => Z(b),
2916
+ className: `hover:text-red-400 transition-colors ${k ? "text-purple-400/70" : "text-white/40"}`,
2891
2917
  title: "Remove file",
2892
2918
  children: /* @__PURE__ */ t(
2893
2919
  "svg",
@@ -2914,7 +2940,7 @@ function Gn({
2914
2940
  );
2915
2941
  }) })
2916
2942
  ] }),
2917
- K && /* @__PURE__ */ a("div", { className: "mb-3 space-y-2", children: [
2943
+ J && /* @__PURE__ */ a("div", { className: "mb-3 space-y-2", children: [
2918
2944
  /* @__PURE__ */ a("div", { className: "text-xs font-medium text-white/50 uppercase tracking-wide", children: [
2919
2945
  "Queued Messages (",
2920
2946
  i.length,
@@ -2962,30 +2988,75 @@ function Gn({
2962
2988
  u.id
2963
2989
  )) })
2964
2990
  ] }),
2965
- /* @__PURE__ */ a("div", { className: "flex gap-2 items-end", children: [
2966
- d && /* @__PURE__ */ a(S, { children: [
2991
+ /* @__PURE__ */ a("div", { className: "flex gap-3 items-end", children: [
2992
+ /* @__PURE__ */ a("div", { className: "flex-1 flex items-end bg-[#2f2f2f] rounded-2xl border border-white/10 overflow-hidden", children: [
2993
+ d && /* @__PURE__ */ a(_, { children: [
2994
+ /* @__PURE__ */ t(
2995
+ "input",
2996
+ {
2997
+ ref: pe,
2998
+ type: "file",
2999
+ multiple: !0,
3000
+ onChange: le,
3001
+ className: "hidden",
3002
+ disabled: n || C.length >= m
3003
+ }
3004
+ ),
3005
+ /* @__PURE__ */ t(
3006
+ "button",
3007
+ {
3008
+ type: "button",
3009
+ onClick: () => {
3010
+ var u;
3011
+ return (u = pe.current) == null ? void 0 : u.click();
3012
+ },
3013
+ disabled: n || C.length >= m,
3014
+ className: "shrink-0 p-3 text-white/50 hover:text-white transition-colors disabled:opacity-50 disabled:cursor-not-allowed",
3015
+ title: C.length >= m ? `Maximum ${m} files` : "Attach files",
3016
+ children: /* @__PURE__ */ t(
3017
+ "svg",
3018
+ {
3019
+ xmlns: "http://www.w3.org/2000/svg",
3020
+ className: "h-5 w-5",
3021
+ fill: "none",
3022
+ viewBox: "0 0 24 24",
3023
+ stroke: "currentColor",
3024
+ children: /* @__PURE__ */ t(
3025
+ "path",
3026
+ {
3027
+ strokeLinecap: "round",
3028
+ strokeLinejoin: "round",
3029
+ strokeWidth: 2,
3030
+ d: "M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13"
3031
+ }
3032
+ )
3033
+ }
3034
+ )
3035
+ }
3036
+ )
3037
+ ] }),
2967
3038
  /* @__PURE__ */ t(
2968
- "input",
3039
+ "textarea",
2969
3040
  {
2970
- ref: xe,
2971
- type: "file",
2972
- multiple: !0,
2973
- onChange: le,
2974
- className: "hidden",
2975
- disabled: n || k.length >= p
3041
+ ref: de,
3042
+ value: T,
3043
+ onChange: (u) => X(u.target.value),
3044
+ onKeyDown: v,
3045
+ onInput: M,
3046
+ onPaste: K,
3047
+ placeholder: s,
3048
+ disabled: n,
3049
+ className: "flex-1 min-w-0 resize-none py-3 px-2 bg-transparent text-white placeholder-white/40 focus:outline-none disabled:opacity-50 disabled:cursor-not-allowed",
3050
+ rows: 1
2976
3051
  }
2977
3052
  ),
2978
3053
  /* @__PURE__ */ t(
2979
3054
  "button",
2980
3055
  {
2981
3056
  type: "button",
2982
- onClick: () => {
2983
- var u;
2984
- return (u = xe.current) == null ? void 0 : u.click();
2985
- },
2986
- disabled: n || k.length >= p,
2987
- className: "shrink-0 p-2 sm:px-3 sm:py-2 text-white/50 hover:text-[#ccff00] hover:bg-white/5 rounded-xl transition-all duration-300 disabled:opacity-50 disabled:cursor-not-allowed",
2988
- title: k.length >= p ? `Maximum ${p} files` : "Attach files",
3057
+ className: "shrink-0 p-3 text-white/50 hover:text-white transition-colors disabled:opacity-50",
3058
+ disabled: n,
3059
+ title: "Voice input (not available)",
2989
3060
  children: /* @__PURE__ */ t(
2990
3061
  "svg",
2991
3062
  {
@@ -3000,34 +3071,43 @@ function Gn({
3000
3071
  strokeLinecap: "round",
3001
3072
  strokeLinejoin: "round",
3002
3073
  strokeWidth: 2,
3003
- d: "M15.172 7l-6.586 6.586a2 2 0 102.828 2.828l6.414-6.586a4 4 0 00-5.656-5.656l-6.415 6.585a6 6 0 108.486 8.486L20.5 13"
3074
+ d: "M12 1a3 3 0 00-3 3v8a3 3 0 006 0V4a3 3 0 00-3-3zM19 10v2a7 7 0 01-14 0v-2M12 19v4M8 23h8"
3004
3075
  }
3005
3076
  )
3006
3077
  }
3007
3078
  )
3008
3079
  }
3080
+ ),
3081
+ /* @__PURE__ */ t(
3082
+ "button",
3083
+ {
3084
+ type: "button",
3085
+ onClick: g,
3086
+ disabled: !ve,
3087
+ className: "shrink-0 p-3 text-white/50 hover:text-white transition-colors disabled:opacity-30 disabled:cursor-not-allowed",
3088
+ title: "Send message",
3089
+ children: /* @__PURE__ */ a(
3090
+ "svg",
3091
+ {
3092
+ xmlns: "http://www.w3.org/2000/svg",
3093
+ className: "h-5 w-5",
3094
+ fill: "none",
3095
+ viewBox: "0 0 24 24",
3096
+ stroke: "currentColor",
3097
+ children: [
3098
+ /* @__PURE__ */ t("line", { x1: "12", y1: "19", x2: "12", y2: "5", strokeWidth: 2, strokeLinecap: "round" }),
3099
+ /* @__PURE__ */ t("polyline", { points: "5 12 12 5 19 12", strokeWidth: 2, strokeLinecap: "round", strokeLinejoin: "round" })
3100
+ ]
3101
+ }
3102
+ )
3103
+ }
3009
3104
  )
3010
3105
  ] }),
3011
- /* @__PURE__ */ t(
3012
- "textarea",
3013
- {
3014
- ref: ue,
3015
- value: _,
3016
- onChange: (u) => Q(u.target.value),
3017
- onKeyDown: y,
3018
- onInput: M,
3019
- onPaste: V,
3020
- placeholder: s,
3021
- disabled: n,
3022
- className: "input-glass flex-1 min-w-0 resize-none py-2.5 disabled:opacity-50 disabled:cursor-not-allowed",
3023
- rows: 1
3024
- }
3025
- ),
3026
- r && E && v ? /* @__PURE__ */ a(
3106
+ r && E && w ? /* @__PURE__ */ a(
3027
3107
  "button",
3028
3108
  {
3029
- onClick: v,
3030
- className: "shrink-0 px-3 sm:px-4 py-2.5 bg-red-500/80 hover:bg-red-500 text-white rounded-xl transition-all duration-300 flex items-center gap-1 sm:gap-2 border border-red-400/30",
3109
+ onClick: w,
3110
+ className: "shrink-0 px-4 py-3 bg-red-500/80 hover:bg-red-500 text-white rounded-2xl transition-all duration-300 flex items-center gap-2 border border-red-400/30 font-medium",
3031
3111
  title: "Stop generation",
3032
3112
  children: [
3033
3113
  /* @__PURE__ */ t("svg", { xmlns: "http://www.w3.org/2000/svg", className: "h-4 w-4", viewBox: "0 0 20 20", fill: "currentColor", children: /* @__PURE__ */ t("path", { fillRule: "evenodd", d: "M10 18a8 8 0 100-16 8 8 0 000 16zM8 7a1 1 0 00-1 1v4a1 1 0 001 1h4a1 1 0 001-1V8a1 1 0 00-1-1H8z", clipRule: "evenodd" }) }),
@@ -3037,19 +3117,19 @@ function Gn({
3037
3117
  ) : /* @__PURE__ */ a(
3038
3118
  "button",
3039
3119
  {
3040
- onClick: w,
3041
- disabled: !Ie,
3042
- 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 ${K ? "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)]"}`,
3120
+ onClick: g,
3121
+ disabled: !ve,
3122
+ className: `shrink-0 px-4 py-3 rounded-2xl 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-[#10a37f] hover:bg-[#0d8c6d] text-white"}`,
3043
3123
  children: [
3044
- /* @__PURE__ */ t("span", { className: "hidden sm:inline", children: ke }),
3045
- /* @__PURE__ */ t("span", { className: "sm:hidden", children: r ? "..." : K ? `+${i.length}` : "→" })
3124
+ /* @__PURE__ */ t("span", { className: "hidden sm:inline", children: J ? `Queue (${i.length})` : "Execute" }),
3125
+ /* @__PURE__ */ t("span", { className: "sm:hidden", children: r ? "..." : J ? `+${i.length}` : "→" })
3046
3126
  ]
3047
3127
  }
3048
3128
  )
3049
3129
  ] }),
3050
3130
  /* @__PURE__ */ a("div", { className: "text-xs text-white/40 mt-2 hidden sm:block", children: [
3051
3131
  "Press Enter to ",
3052
- r || K ? "queue" : "send",
3132
+ r || J ? "queue" : "send",
3053
3133
  ", Shift+Enter for new line",
3054
3134
  d && " • Drag & drop files or click the attach button",
3055
3135
  D && d && ` • Long text (>${R.toLocaleString()} chars) auto-converts to attachment`
@@ -3058,7 +3138,7 @@ function Gn({
3058
3138
  }
3059
3139
  );
3060
3140
  }
3061
- function Rr({
3141
+ function $r({
3062
3142
  apiBasePath: e,
3063
3143
  initialAgent: n,
3064
3144
  initialSessionId: r,
@@ -3066,204 +3146,204 @@ function Rr({
3066
3146
  className: i = "",
3067
3147
  useBackendQueue: l = !1
3068
3148
  }) {
3069
- const [c, h] = N([]), [o, f] = N(n || null), [d, x] = N(r || null), [p, v] = N([]), [E, D] = N(!1), [R, _] = N(""), [Q, T] = N(null), [F, A] = N([]), [j, ie] = N([]), [X, W] = N(""), [H, k] = N({}), B = G(!1), ee = G(X), de = G(H), te = G(null);
3070
- z(() => {
3071
- ee.current = X;
3072
- }, [X]), z(() => {
3073
- de.current = H;
3074
- }, [H]), z(() => {
3075
- fetch(`${e}/agents`).then((w) => w.json()).then((w) => {
3076
- const y = w.agents || [];
3077
- h(y), !o && y.length > 0 && f(y[0].slug || y[0].name);
3078
- }).catch((w) => {
3079
- console.error("Failed to fetch agents:", w), T("Failed to load agents");
3149
+ const [c, h] = N([]), [o, f] = N(n || null), [d, x] = N(r || null), [m, w] = N([]), [E, D] = N(!1), [R, T] = N(""), [X, S] = N(null), [G, A] = N([]), [W, ie] = N([]), [ee, B] = N(""), [H, C] = N({}), O = V(!1), te = V(ee), ce = V(H), ne = V(null);
3150
+ P(() => {
3151
+ te.current = ee;
3152
+ }, [ee]), P(() => {
3153
+ ce.current = H;
3154
+ }, [H]), P(() => {
3155
+ fetch(`${e}/agents`).then((g) => g.json()).then((g) => {
3156
+ const v = g.agents || [];
3157
+ h(v), !o && v.length > 0 && f(v[0].slug || v[0].name);
3158
+ }).catch((g) => {
3159
+ console.error("Failed to fetch agents:", g), S("Failed to load agents");
3080
3160
  });
3081
- }, [e]), z(() => {
3082
- d && pe(d);
3161
+ }, [e]), P(() => {
3162
+ d && he(d);
3083
3163
  }, [d]);
3084
- const Z = P(async () => {
3164
+ const Q = F(async () => {
3085
3165
  if (!(!l || !o))
3086
3166
  try {
3087
- const w = await fetch(
3167
+ const g = await fetch(
3088
3168
  `${e}/queue/status/${o}?sessionId=${d || ""}`
3089
3169
  );
3090
- if (!w.ok) return;
3091
- const y = await w.json();
3092
- D(y.isProcessing), ie(y.nextItems || []), !y.isProcessing && E && (d && await pe(d), _(""));
3093
- } catch (w) {
3094
- console.error("Failed to fetch queue status:", w);
3170
+ if (!g.ok) return;
3171
+ const v = await g.json();
3172
+ D(v.isProcessing), ie(v.nextItems || []), !v.isProcessing && E && (d && await he(d), T(""));
3173
+ } catch (g) {
3174
+ console.error("Failed to fetch queue status:", g);
3095
3175
  }
3096
3176
  }, [l, o, d, e, E]);
3097
- z(() => {
3177
+ P(() => {
3098
3178
  if (l)
3099
- return te.current = setInterval(Z, 1e3), () => {
3100
- te.current && (clearInterval(te.current), te.current = null);
3179
+ return ne.current = setInterval(Q, 1e3), () => {
3180
+ ne.current && (clearInterval(ne.current), ne.current = null);
3101
3181
  };
3102
- }, [l, Z]), z(() => {
3182
+ }, [l, Q]), P(() => {
3103
3183
  s == null || s(d);
3104
3184
  }, [d, s]);
3105
- const pe = async (w) => {
3185
+ const he = async (g) => {
3106
3186
  try {
3107
- const y = await fetch(`${e}/sessions/${w}/messages`);
3108
- if (!y.ok) throw new Error("Failed to fetch messages");
3109
- const M = await y.json();
3110
- v(M.items || M.messages || []);
3111
- } catch (y) {
3112
- T(y instanceof Error ? y.message : "Failed to fetch messages");
3113
- }
3114
- }, fe = P(async (w, y, M) => {
3115
- var le, he;
3116
- if (!o) return y;
3117
- D(!0), T(null), _("");
3118
- const O = {
3187
+ const v = await fetch(`${e}/sessions/${g}/messages`);
3188
+ if (!v.ok) throw new Error("Failed to fetch messages");
3189
+ const M = await v.json();
3190
+ w(M.items || M.messages || []);
3191
+ } catch (v) {
3192
+ S(v instanceof Error ? v.message : "Failed to fetch messages");
3193
+ }
3194
+ }, me = F(async (g, v, M) => {
3195
+ var le, ue;
3196
+ if (!o) return v;
3197
+ D(!0), S(null), T("");
3198
+ const z = {
3119
3199
  id: `temp-${Date.now()}`,
3120
3200
  role: "user",
3121
- content: [{ type: "text", text: w }],
3201
+ content: [{ type: "text", text: g }],
3122
3202
  createdAt: (/* @__PURE__ */ new Date()).toISOString()
3123
3203
  };
3124
- v((J) => [...J, O]);
3125
- let ne = y;
3204
+ w((Y) => [...Y, z]);
3205
+ let re = v;
3126
3206
  try {
3127
- const J = y ? `${e}/sessions/${y}/send` : `${e}/agents/${o}/run`, q = M == null ? void 0 : M.map((oe) => ({
3128
- filename: oe.filename,
3129
- content: oe.content,
3130
- mimeType: oe.mimeType
3131
- })), U = { prompt: w }, K = ee.current.trim();
3132
- K && (U.sessionContext = K);
3133
- const ke = de.current;
3134
- !y && Object.keys(ke).length > 0 && (U.envVars = ke), q && q.length > 0 && (U.files = q);
3135
- const Ce = await fetch(J, {
3207
+ const Y = v ? `${e}/sessions/${v}/send` : `${e}/agents/${o}/run`, q = M == null ? void 0 : M.map((fe) => ({
3208
+ filename: fe.filename,
3209
+ content: fe.content,
3210
+ mimeType: fe.mimeType
3211
+ })), Z = { prompt: g }, J = te.current.trim();
3212
+ J && (Z.sessionContext = J);
3213
+ const Ce = ce.current;
3214
+ !v && Object.keys(Ce).length > 0 && (Z.envVars = Ce), q && q.length > 0 && (Z.files = q);
3215
+ const _e = await fetch(Y, {
3136
3216
  method: "POST",
3137
3217
  headers: { "Content-Type": "application/json" },
3138
- body: JSON.stringify(U)
3218
+ body: JSON.stringify(Z)
3139
3219
  });
3140
- if (!Ce.ok) throw new Error("Failed to send message");
3141
- const _e = (le = Ce.body) == null ? void 0 : le.getReader(), Ie = new TextDecoder();
3142
- let ge = "", Y = "";
3143
- for (; _e; ) {
3144
- const { done: oe, value: Pe } = await _e.read();
3145
- if (oe) break;
3146
- ge += Ie.decode(Pe, { stream: !0 });
3147
- const u = ge.split(`
3220
+ if (!_e.ok) throw new Error("Failed to send message");
3221
+ const ve = (le = _e.body) == null ? void 0 : le.getReader(), Te = new TextDecoder();
3222
+ let ye = "", U = "";
3223
+ for (; ve; ) {
3224
+ const { done: fe, value: u } = await ve.read();
3225
+ if (fe) break;
3226
+ ye += Te.decode(u, { stream: !0 });
3227
+ const b = ye.split(`
3148
3228
  `);
3149
- ge = u.pop() || "";
3150
- for (const b of u)
3151
- if (b.startsWith("data:")) {
3152
- const I = b.slice(5).trim();
3153
- if (!I) continue;
3229
+ ye = b.pop() || "";
3230
+ for (const I of b)
3231
+ if (I.startsWith("data:")) {
3232
+ const k = I.slice(5).trim();
3233
+ if (!k) continue;
3154
3234
  try {
3155
- const g = JSON.parse(I);
3156
- if (g.type === "session_start" && g.sessionId)
3157
- ne = g.sessionId, x(g.sessionId);
3158
- else if (g.type === "text_delta" && g.delta)
3159
- Y += g.delta, _(Y);
3160
- else if (g.type === "thinking_delta" && g.delta)
3161
- Y += g.delta, _(Y);
3162
- else if (g.type === "message" && g.message) {
3163
- const C = (he = g.message.content) == null ? void 0 : he.find(
3164
- (re) => re.type === "text"
3235
+ const y = JSON.parse(k);
3236
+ if (y.type === "session_start" && y.sessionId)
3237
+ re = y.sessionId, x(y.sessionId);
3238
+ else if (y.type === "text_delta" && y.delta)
3239
+ U += y.delta, T(U);
3240
+ else if (y.type === "thinking_delta" && y.delta)
3241
+ U += y.delta, T(U);
3242
+ else if (y.type === "message" && y.message) {
3243
+ const j = (ue = y.message.content) == null ? void 0 : ue.find(
3244
+ (Pe) => Pe.type === "text"
3165
3245
  );
3166
- C != null && C.text && (Y || (Y = C.text, _(Y)));
3167
- } else if (g.type === "tool_use")
3168
- Y += `
3246
+ j != null && j.text && (U || (U = j.text, T(U)));
3247
+ } else if (y.type === "tool_use")
3248
+ U += `
3169
3249
 
3170
- 🔧 Using tool: ${g.name}
3171
- `, _(Y);
3172
- else if (g.type === "session_end") {
3173
- const C = y || g.sessionId;
3174
- C && await pe(C), _("");
3175
- } else g.type === "error" && T(g.error || "Unknown error");
3250
+ 🔧 Using tool: ${y.name}
3251
+ `, T(U);
3252
+ else if (y.type === "session_end") {
3253
+ const j = v || y.sessionId;
3254
+ j && await he(j), T("");
3255
+ } else y.type === "error" && S(y.error || "Unknown error");
3176
3256
  } catch {
3177
3257
  }
3178
3258
  }
3179
3259
  }
3180
- } catch (J) {
3181
- T(J instanceof Error ? J.message : "Unknown error"), v((q) => q.filter((U) => U.id !== O.id));
3260
+ } catch (Y) {
3261
+ S(Y instanceof Error ? Y.message : "Unknown error"), w((q) => q.filter((Z) => Z.id !== z.id));
3182
3262
  } finally {
3183
3263
  D(!1);
3184
3264
  }
3185
- return ne;
3186
- }, [e, o]), we = P(async () => {
3187
- if (B.current) return;
3188
- B.current = !0;
3189
- let w = d;
3265
+ return re;
3266
+ }, [e, o]), ge = F(async () => {
3267
+ if (O.current) return;
3268
+ O.current = !0;
3269
+ let g = d;
3190
3270
  for (; ; ) {
3191
- let y;
3192
- if (A((M) => M.length === 0 ? M : (y = M[0], M.slice(1))), await new Promise((M) => setTimeout(M, 0)), !y) break;
3193
- w = await fe(y.text, w, y.files);
3194
- }
3195
- B.current = !1;
3196
- }, [d, fe]);
3197
- z(() => {
3198
- F.length > 0 && !B.current && we();
3199
- }, [F, we]);
3200
- const ue = P(async (w, y) => {
3271
+ let v;
3272
+ if (A((M) => M.length === 0 ? M : (v = M[0], M.slice(1))), await new Promise((M) => setTimeout(M, 0)), !v) break;
3273
+ g = await me(v.text, g, v.files);
3274
+ }
3275
+ O.current = !1;
3276
+ }, [d, me]);
3277
+ P(() => {
3278
+ G.length > 0 && !O.current && ge();
3279
+ }, [G, ge]);
3280
+ const de = F(async (g, v) => {
3201
3281
  if (!o) return;
3202
3282
  const M = {
3203
3283
  id: `temp-${Date.now()}`,
3204
3284
  role: "user",
3205
- content: [{ type: "text", text: w }],
3285
+ content: [{ type: "text", text: g }],
3206
3286
  createdAt: (/* @__PURE__ */ new Date()).toISOString()
3207
3287
  };
3208
- v((O) => [...O, M]);
3288
+ w((z) => [...z, M]);
3209
3289
  try {
3210
- const O = y == null ? void 0 : y.map((q) => ({
3290
+ const z = v == null ? void 0 : v.map((q) => ({
3211
3291
  filename: q.filename,
3212
3292
  content: q.content,
3213
3293
  mimeType: q.mimeType
3214
- })), ne = de.current, le = !d && Object.keys(ne).length > 0 ? ne : void 0, he = await fetch(`${e}/queue`, {
3294
+ })), re = ce.current, le = !d && Object.keys(re).length > 0 ? re : void 0, ue = await fetch(`${e}/queue`, {
3215
3295
  method: "POST",
3216
3296
  headers: { "Content-Type": "application/json" },
3217
3297
  body: JSON.stringify({
3218
3298
  agentName: o,
3219
3299
  sessionId: d,
3220
- prompt: w,
3221
- files: O,
3222
- sessionContext: ee.current.trim() || void 0,
3300
+ prompt: g,
3301
+ files: z,
3302
+ sessionContext: te.current.trim() || void 0,
3223
3303
  envVars: le
3224
3304
  })
3225
3305
  });
3226
- if (!he.ok)
3306
+ if (!ue.ok)
3227
3307
  throw new Error("Failed to queue message");
3228
- const J = await he.json();
3229
- !d && J.id && setTimeout(async () => {
3230
- const U = await fetch(`${e}/queue/${J.id}`);
3231
- if (U.ok) {
3232
- const K = await U.json();
3233
- K.sessionId && x(K.sessionId);
3308
+ const Y = await ue.json();
3309
+ !d && Y.id && setTimeout(async () => {
3310
+ const Z = await fetch(`${e}/queue/${Y.id}`);
3311
+ if (Z.ok) {
3312
+ const J = await Z.json();
3313
+ J.sessionId && x(J.sessionId);
3234
3314
  }
3235
- }, 500), await Z();
3236
- } catch (O) {
3237
- T(O instanceof Error ? O.message : "Failed to queue message"), v((ne) => ne.filter((le) => le.id !== M.id));
3315
+ }, 500), await Q();
3316
+ } catch (z) {
3317
+ S(z instanceof Error ? z.message : "Failed to queue message"), w((re) => re.filter((le) => le.id !== M.id));
3238
3318
  }
3239
- }, [o, d, e, Z]), Ne = P((w, y) => {
3319
+ }, [o, d, e, Q]), ke = F((g, v) => {
3240
3320
  if (!o) return;
3241
3321
  if (l) {
3242
- ue(w, y);
3322
+ de(g, v);
3243
3323
  return;
3244
3324
  }
3245
3325
  const M = {
3246
3326
  id: `queue-${Date.now()}-${Math.random().toString(36).slice(2)}`,
3247
- text: w,
3248
- files: y
3327
+ text: g,
3328
+ files: v
3249
3329
  };
3250
- E || B.current ? A((O) => [...O, M]) : A([M]);
3251
- }, [o, E, l, ue]), xe = P(async (w) => {
3330
+ E || O.current ? A((z) => [...z, M]) : A([M]);
3331
+ }, [o, E, l, de]), pe = F(async (g) => {
3252
3332
  if (l) {
3253
3333
  try {
3254
- await fetch(`${e}/queue/${w}/cancel`, {
3334
+ await fetch(`${e}/queue/${g}/cancel`, {
3255
3335
  method: "POST"
3256
- }), await Z();
3257
- } catch (y) {
3258
- console.error("Failed to cancel queue item:", y);
3336
+ }), await Q();
3337
+ } catch (v) {
3338
+ console.error("Failed to cancel queue item:", v);
3259
3339
  }
3260
3340
  return;
3261
3341
  }
3262
- A((y) => y.filter((M) => M.id !== w));
3263
- }, [l, e, Z]), ve = P(() => {
3264
- x(null), v([]), _(""), T(null), ie([]), A([]);
3265
- }, []), V = c.find(
3266
- (w) => w.slug === o || w.name === o
3342
+ A((v) => v.filter((M) => M.id !== g));
3343
+ }, [l, e, Q]), we = F(() => {
3344
+ x(null), w([]), T(""), S(null), ie([]), A([]);
3345
+ }, []), K = c.find(
3346
+ (g) => g.slug === o || g.name === o
3267
3347
  );
3268
3348
  return /* @__PURE__ */ a("div", { className: `harness-playground flex flex-col h-full bg-[#0a0a0a] relative overflow-hidden ${i}`, children: [
3269
3349
  /* @__PURE__ */ t("div", { className: "ambient-glow ambient-glow-accent w-[40vw] h-[40vw] -top-[20%] -right-[10%] animate-pulse-slow" }),
@@ -3273,69 +3353,69 @@ function Rr({
3273
3353
  /* @__PURE__ */ a("div", { className: "sticky top-0 flex items-center justify-between p-4 border-b border-white/10 glass-panel relative z-10", children: [
3274
3354
  /* @__PURE__ */ a("div", { children: [
3275
3355
  /* @__PURE__ */ t("h1", { className: "text-xl font-semibold text-white", children: "Playground" }),
3276
- V && /* @__PURE__ */ t("p", { className: "text-sm text-white/50 mt-0.5", children: V.description || `Chat with ${V.name}` })
3356
+ K && /* @__PURE__ */ t("p", { className: "text-sm text-white/50 mt-0.5", children: K.description || `Chat with ${K.name}` })
3277
3357
  ] }),
3278
3358
  /* @__PURE__ */ a("div", { className: "flex items-center gap-3", children: [
3279
3359
  /* @__PURE__ */ a(
3280
3360
  "select",
3281
3361
  {
3282
3362
  value: o || "",
3283
- onChange: (w) => {
3284
- f(w.target.value), ve();
3363
+ onChange: (g) => {
3364
+ f(g.target.value), we();
3285
3365
  },
3286
3366
  className: "px-4 py-2.5 rounded-xl text-sm bg-white/5 border border-white/10 text-white focus:outline-none focus:border-[#ccff00]/50 transition-all duration-300",
3287
3367
  children: [
3288
3368
  c.length === 0 && /* @__PURE__ */ t("option", { value: "", children: "No agents" }),
3289
- c.map((w) => /* @__PURE__ */ t("option", { value: w.slug || w.name, className: "bg-[#0a0a0a]", children: w.name }, w.slug || w.name))
3369
+ c.map((g) => /* @__PURE__ */ t("option", { value: g.slug || g.name, className: "bg-[#0a0a0a]", children: g.name }, g.slug || g.name))
3290
3370
  ]
3291
3371
  }
3292
3372
  ),
3293
3373
  /* @__PURE__ */ t(
3294
3374
  "button",
3295
3375
  {
3296
- onClick: ve,
3376
+ onClick: we,
3297
3377
  className: "px-4 py-2.5 text-sm text-white/70 hover:text-white border border-white/10 rounded-xl hover:bg-white/10 hover:border-white/20 transition-all duration-300",
3298
3378
  children: "New Chat"
3299
3379
  }
3300
3380
  )
3301
3381
  ] })
3302
3382
  ] }),
3303
- Q && /* @__PURE__ */ a("div", { className: "bg-red-500/10 border-b border-red-500/20 px-4 py-3 text-red-400 text-sm flex items-center justify-between relative z-10", children: [
3304
- /* @__PURE__ */ t("span", { children: Q }),
3383
+ X && /* @__PURE__ */ a("div", { className: "bg-red-500/10 border-b border-red-500/20 px-4 py-3 text-red-400 text-sm flex items-center justify-between relative z-10", children: [
3384
+ /* @__PURE__ */ t("span", { children: X }),
3305
3385
  /* @__PURE__ */ t(
3306
3386
  "button",
3307
3387
  {
3308
- onClick: () => T(null),
3388
+ onClick: () => S(null),
3309
3389
  className: "text-red-400/70 hover:text-red-400 transition-colors",
3310
3390
  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" }) })
3311
3391
  }
3312
3392
  )
3313
3393
  ] }),
3314
- /* @__PURE__ */ t("div", { className: "flex-1 overflow-hidden relative z-10", children: p.length === 0 && !R ? /* @__PURE__ */ t("div", { className: "h-full flex items-center justify-center", children: /* @__PURE__ */ a("div", { className: "text-center animate-fade-in", children: [
3394
+ /* @__PURE__ */ t("div", { className: "flex-1 overflow-hidden relative z-10", children: m.length === 0 && !R ? /* @__PURE__ */ t("div", { className: "h-full flex items-center justify-center", children: /* @__PURE__ */ a("div", { className: "text-center animate-fade-in", children: [
3315
3395
  /* @__PURE__ */ t("div", { className: "w-16 h-16 mx-auto mb-4 rounded-2xl bg-[#ccff00]/10 border border-[#ccff00]/20 flex items-center justify-center", children: /* @__PURE__ */ t("svg", { className: "w-8 h-8 text-[#ccff00]", viewBox: "0 0 24 24", fill: "none", stroke: "currentColor", strokeWidth: "1.5", children: /* @__PURE__ */ t("path", { strokeLinecap: "round", strokeLinejoin: "round", d: "M8.625 12a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0H8.25m4.125 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0H12m4.125 0a.375.375 0 1 1-.75 0 .375.375 0 0 1 .75 0Zm0 0h-.375M21 12c0 4.556-4.03 8.25-9 8.25a9.764 9.764 0 0 1-2.555-.337A5.972 5.972 0 0 1 5.41 20.97a5.969 5.969 0 0 1-.474-.065 4.48 4.48 0 0 0 .978-2.025c.09-.457-.133-.901-.467-1.226C3.93 16.178 3 14.189 3 12c0-4.556 4.03-8.25 9-8.25s9 3.694 9 8.25Z" }) }) }),
3316
3396
  /* @__PURE__ */ t("p", { className: "text-lg text-white/80", children: "Start a conversation" }),
3317
- /* @__PURE__ */ t("p", { className: "text-sm mt-1 text-white/40", children: o ? `Chat with ${(V == null ? void 0 : V.name) || o}` : "Select an agent to begin" })
3397
+ /* @__PURE__ */ t("p", { className: "text-sm mt-1 text-white/40", children: o ? `Chat with ${(K == null ? void 0 : K.name) || o}` : "Select an agent to begin" })
3318
3398
  ] }) }) : /* @__PURE__ */ t(
3319
- On,
3399
+ zn,
3320
3400
  {
3321
- messages: p,
3401
+ messages: m,
3322
3402
  loading: E,
3323
3403
  streamingContent: R
3324
3404
  }
3325
3405
  ) }),
3326
3406
  /* @__PURE__ */ t("div", { className: "relative z-10", children: /* @__PURE__ */ t(
3327
- Gn,
3407
+ Vn,
3328
3408
  {
3329
- onSend: Ne,
3409
+ onSend: ke,
3330
3410
  disabled: !o,
3331
3411
  loading: E,
3332
- queue: l ? j.map((w) => ({ id: w.id, text: w.prompt })) : F,
3333
- onCancelQueued: xe,
3334
- sessionContext: X,
3335
- onSessionContextChange: W,
3412
+ queue: l ? W.map((g) => ({ id: g.id, text: g.prompt })) : G,
3413
+ onCancelQueued: pe,
3414
+ sessionContext: ee,
3415
+ onSessionContextChange: B,
3336
3416
  envVars: H,
3337
- onEnvVarsChange: k,
3338
- placeholder: o ? `Message ${(V == null ? void 0 : V.name) || o}...` : "Select an agent to start chatting"
3417
+ onEnvVarsChange: C,
3418
+ placeholder: o ? `Message ${(K == null ? void 0 : K.name) || o}...` : "Select an agent to start chatting"
3339
3419
  }
3340
3420
  ) }),
3341
3421
  d && /* @__PURE__ */ a("div", { className: "px-4 py-2 border-t border-white/10 text-xs text-white/40 glass-panel relative z-10 flex items-center gap-2", children: [
@@ -3348,7 +3428,7 @@ function Rr({
3348
3428
  ] })
3349
3429
  ] });
3350
3430
  }
3351
- function Ar({
3431
+ function Rr({
3352
3432
  entries: e,
3353
3433
  loading: n,
3354
3434
  streamingContent: r,
@@ -3356,7 +3436,7 @@ function Ar({
3356
3436
  onOptionSelect: i
3357
3437
  }) {
3358
3438
  return /* @__PURE__ */ t(
3359
- In,
3439
+ Ln,
3360
3440
  {
3361
3441
  entries: e,
3362
3442
  loading: n,
@@ -3366,9 +3446,9 @@ function Ar({
3366
3446
  }
3367
3447
  );
3368
3448
  }
3369
- function Dr({ logs: e, isLoading: n, className: r }) {
3449
+ function Ar({ logs: e, isLoading: n, className: r }) {
3370
3450
  return /* @__PURE__ */ t(
3371
- jn,
3451
+ Wn,
3372
3452
  {
3373
3453
  logs: e,
3374
3454
  title: "Sandbox Logs",
@@ -3396,7 +3476,7 @@ function qn(e) {
3396
3476
  }
3397
3477
  return null;
3398
3478
  }
3399
- function Vn(e, n) {
3479
+ function Jn(e, n) {
3400
3480
  const r = n || {};
3401
3481
  switch (e) {
3402
3482
  case "Bash":
@@ -3479,7 +3559,7 @@ function Vn(e, n) {
3479
3559
  }
3480
3560
  }
3481
3561
  }
3482
- function Jn(e, n, r) {
3562
+ function Un(e, n, r) {
3483
3563
  switch (r.action) {
3484
3564
  case "command_run":
3485
3565
  const s = r.command;
@@ -3510,11 +3590,11 @@ function Jn(e, n, r) {
3510
3590
  return "Unknown tool";
3511
3591
  }
3512
3592
  }
3513
- function Un(e) {
3593
+ function Kn(e) {
3514
3594
  return typeof e == "string" ? e : Array.isArray(e) ? e.filter((n) => typeof (n == null ? void 0 : n.text) == "string").map((n) => n.text).join(`
3515
3595
  `) : e && typeof e == "object" && "text" in e ? String(e.text) : JSON.stringify(e, null, 2);
3516
3596
  }
3517
- function Kn(e) {
3597
+ function Yn(e) {
3518
3598
  if (typeof e == "string")
3519
3599
  try {
3520
3600
  return { type: "json", value: JSON.parse(e) };
@@ -3538,8 +3618,8 @@ function Kn(e) {
3538
3618
  }
3539
3619
  return { type: "json", value: e };
3540
3620
  }
3541
- function Yn(e) {
3542
- const n = Un(e);
3621
+ function Zn(e) {
3622
+ const n = Kn(e);
3543
3623
  if (typeof e == "string")
3544
3624
  try {
3545
3625
  const r = JSON.parse(e);
@@ -3557,8 +3637,8 @@ function Yn(e) {
3557
3637
  // Assume success if no exit code
3558
3638
  };
3559
3639
  }
3560
- function nt(e) {
3561
- const n = Vn(e.name, e.input), r = Jn(e.name, e.input, n);
3640
+ function st(e) {
3641
+ const n = Jn(e.name, e.input), r = Un(e.name, e.input, n);
3562
3642
  return {
3563
3643
  id: e.id,
3564
3644
  toolName: e.name,
@@ -3568,21 +3648,21 @@ function nt(e) {
3568
3648
  startedAt: (/* @__PURE__ */ new Date()).toISOString()
3569
3649
  };
3570
3650
  }
3571
- function rt(e, n, r) {
3651
+ function at(e, n, r) {
3572
3652
  const s = { ...e }, i = { ...e.actionType };
3573
3653
  if (s.status = r ? "failed" : "success", s.completedAt = (/* @__PURE__ */ new Date()).toISOString(), s.isError = r, i.action === "command_run") {
3574
- const l = Yn(n);
3654
+ const l = Zn(n);
3575
3655
  i.result = l, l.exitCode !== void 0 && l.exitCode !== 0 && (s.status = "failed", s.isError = !0);
3576
- } else (i.action === "mcp_tool" || i.action === "generic_tool") && (i.result = Kn(n));
3656
+ } else (i.action === "mcp_tool" || i.action === "generic_tool") && (i.result = Yn(n));
3577
3657
  return s.actionType = i, s;
3578
3658
  }
3579
- function Zn(e) {
3659
+ function Qn(e) {
3580
3660
  return e.type === "tool_use";
3581
3661
  }
3582
- function Qn(e) {
3662
+ function Xn(e) {
3583
3663
  return e.type === "tool_result";
3584
3664
  }
3585
- function jr(e) {
3665
+ function Dr(e) {
3586
3666
  const n = [], r = /* @__PURE__ */ new Map(), s = /* @__PURE__ */ new Map();
3587
3667
  for (const i of e) {
3588
3668
  const l = i.createdAt instanceof Date ? i.createdAt.toISOString() : i.createdAt;
@@ -3596,8 +3676,8 @@ function jr(e) {
3596
3676
  },
3597
3677
  content: c.text
3598
3678
  });
3599
- else if (Zn(c)) {
3600
- const h = nt(c);
3679
+ else if (Qn(c)) {
3680
+ const h = st(c);
3601
3681
  r.set(c.id, h);
3602
3682
  const o = {
3603
3683
  id: c.id,
@@ -3609,10 +3689,10 @@ function jr(e) {
3609
3689
  content: h.summary
3610
3690
  };
3611
3691
  n.push(o), s.set(c.id, o);
3612
- } else if (Qn(c)) {
3692
+ } else if (Xn(c)) {
3613
3693
  const h = c.toolUseId, o = r.get(h);
3614
3694
  if (o) {
3615
- const f = rt(
3695
+ const f = at(
3616
3696
  o,
3617
3697
  c.content,
3618
3698
  c.isError
@@ -3623,7 +3703,7 @@ function jr(e) {
3623
3703
  }
3624
3704
  return n;
3625
3705
  }
3626
- const Me = class Me {
3706
+ const Ee = class Ee {
3627
3707
  constructor() {
3628
3708
  se(this, "entries", []);
3629
3709
  se(this, "pendingToolCalls", /* @__PURE__ */ new Map());
@@ -3719,7 +3799,7 @@ const Me = class Me {
3719
3799
  console.warn("[ToolCallProcessor] Skipping potential duplicate delta");
3720
3800
  return;
3721
3801
  }
3722
- this.recentDeltas.push(s), this.recentDeltas.length > Me.MAX_RECENT_DELTAS && this.recentDeltas.shift();
3802
+ this.recentDeltas.push(s), this.recentDeltas.length > Ee.MAX_RECENT_DELTAS && this.recentDeltas.shift();
3723
3803
  }
3724
3804
  if (this.hadToolCallSinceText && this.currentTextEntryId && (this.currentTextContent = "", this.currentTextEntryId = null, this.hadToolCallSinceText = !1), this.currentTextContent += n, !this.currentTextEntryId)
3725
3805
  this.currentTextEntryId = `text-${Date.now()}-${Math.random().toString(36).slice(2)}`, this.entries.push({
@@ -3753,7 +3833,7 @@ const Me = class Me {
3753
3833
  */
3754
3834
  handleToolUse(n) {
3755
3835
  this.finalizeCurrentText(), this.hadToolCallSinceText = !0;
3756
- const r = nt({
3836
+ const r = st({
3757
3837
  id: n.id,
3758
3838
  name: n.name,
3759
3839
  input: n.input
@@ -3774,7 +3854,7 @@ const Me = class Me {
3774
3854
  handleToolResult(n) {
3775
3855
  const r = this.pendingToolCalls.get(n.toolUseId);
3776
3856
  if (r) {
3777
- const s = rt(
3857
+ const s = at(
3778
3858
  r.toolCall,
3779
3859
  n.content,
3780
3860
  n.isError
@@ -3813,94 +3893,94 @@ const Me = class Me {
3813
3893
  this.listeners.forEach((r) => r(n));
3814
3894
  }
3815
3895
  };
3816
- se(Me, "MAX_RECENT_DELTAS", 10);
3817
- let De = Me;
3818
- function Wr() {
3896
+ se(Ee, "MAX_RECENT_DELTAS", 10);
3897
+ let De = Ee;
3898
+ function jr() {
3819
3899
  return new De();
3820
3900
  }
3821
3901
  export {
3822
- Ze as ActionIcon,
3823
- Mt as AlertCircleIcon,
3824
- Ye as AlertTriangleIcon,
3825
- sn as AssistantMessage,
3826
- wr as BrainIcon,
3827
- Et as BugIcon,
3828
- Gn as ChatInput,
3829
- It as CheckCircleIcon,
3830
- _t as CheckIcon,
3902
+ Xe as ActionIcon,
3903
+ It as AlertCircleIcon,
3904
+ Ze as AlertTriangleIcon,
3905
+ an as AssistantMessage,
3906
+ gr as BrainIcon,
3907
+ Lt as BugIcon,
3908
+ Vn as ChatInput,
3909
+ $t as CheckCircleIcon,
3910
+ Ye as CheckIcon,
3831
3911
  We as ChevronDownIcon,
3832
3912
  dr as ChevronLeftIcon,
3833
- ye as ChevronRightIcon,
3913
+ be as ChevronRightIcon,
3834
3914
  ur as ChevronUpIcon,
3835
- ce as CodeBlock,
3915
+ oe as CodeBlock,
3836
3916
  hr as CodeIcon,
3837
- mr as CopyIcon,
3917
+ St as CopyIcon,
3838
3918
  Oe as EditIcon,
3839
- on as ErrorMessage,
3919
+ cn as ErrorMessage,
3840
3920
  Be as FileIcon,
3841
- yt as FilePlusIcon,
3842
- Ct as FolderSearchIcon,
3843
- bt as GlobeIcon,
3844
- St as InfoIcon,
3845
- Se as JsonDisplay,
3846
- On as LegacyMessageList,
3847
- Tt as LoaderIcon,
3921
+ Nt as FilePlusIcon,
3922
+ Tt as FolderSearchIcon,
3923
+ kt as GlobeIcon,
3924
+ Et as InfoIcon,
3925
+ Me as JsonDisplay,
3926
+ zn as LegacyMessageList,
3927
+ Mt as LoaderIcon,
3848
3928
  Re as LoadingIndicator,
3849
- jn as LogsPanel,
3850
- cn as MessageEntry,
3851
- In as MessageList,
3852
- gr as MessageSquareIcon,
3929
+ Wn as LogsPanel,
3930
+ dn as MessageEntry,
3931
+ Ln as MessageList,
3932
+ xr as MessageSquareIcon,
3853
3933
  cr as MoonIcon,
3854
- Ar as NormalizedMessageList,
3855
- $t as PaperclipIcon,
3856
- Rr as Playground,
3857
- Nt as PlugIcon,
3858
- Dr as SandboxLogsPanel,
3859
- Te as SearchIcon,
3860
- fr as SendIcon,
3861
- Rt as SparklesIcon,
3862
- Bt as StatusIndicator,
3863
- xr as StopCircleIcon,
3864
- dn as StreamingText,
3934
+ Rr as NormalizedMessageList,
3935
+ At as PaperclipIcon,
3936
+ $r as Playground,
3937
+ Ct as PlugIcon,
3938
+ Ar as SandboxLogsPanel,
3939
+ Se as SearchIcon,
3940
+ pr as SendIcon,
3941
+ Qe as SparklesIcon,
3942
+ Ot as StatusIndicator,
3943
+ fr as StopCircleIcon,
3944
+ un as StreamingText,
3865
3945
  or as SunIcon,
3866
- Ee as TerminalIcon,
3867
- Lr as ThemeProvider,
3868
- an as ThinkingMessage,
3946
+ Ie as TerminalIcon,
3947
+ Ir as ThemeProvider,
3948
+ ln as ThinkingMessage,
3869
3949
  ze as ToolCallCard,
3870
- ln as ToolCallMessage,
3950
+ on as ToolCallMessage,
3871
3951
  De as ToolCallProcessor,
3872
- kt as ToolIcon,
3873
- rn as UserMessage,
3874
- Lt as XCircleIcon,
3875
- pr as XIcon,
3876
- m as cn,
3952
+ _t as ToolIcon,
3953
+ sn as UserMessage,
3954
+ Rt as XCircleIcon,
3955
+ mr as XIcon,
3956
+ p as cn,
3877
3957
  rr as createToolCall,
3878
- Wr as createToolCallProcessor,
3879
- pt as extractTextContent,
3958
+ jr as createToolCallProcessor,
3959
+ xt as extractTextContent,
3880
3960
  ir as formatFileSize,
3881
3961
  je as formatTimestamp,
3882
- dt as formatToolName,
3883
- mt as generateToolSummary,
3962
+ ht as formatToolName,
3963
+ ft as generateToolSummary,
3884
3964
  ar as getActionIcon,
3885
3965
  Ke as getActionLabel,
3886
- vr as isCommandRunAction,
3887
- Ir as isErrorEntry,
3888
- br as isFileEditAction,
3889
- yr as isFileReadAction,
3890
- Nr as isFileWriteAction,
3891
- Mr as isGenericToolAction,
3892
- Cr as isGlobAction,
3893
- Sr as isMcpToolAction,
3894
- kr as isSearchAction,
3895
- Er as isToolCallEntry,
3896
- _r as isWebFetchAction,
3897
- Tr as isWebSearchAction,
3898
- ht as mapToolToActionType,
3899
- jr as normalizeMessages,
3900
- ft as normalizeToolResult,
3901
- xt as parseCommandResult,
3902
- ut as parseMcpToolName,
3966
+ wr as isCommandRunAction,
3967
+ Er as isErrorEntry,
3968
+ yr as isFileEditAction,
3969
+ vr as isFileReadAction,
3970
+ br as isFileWriteAction,
3971
+ Sr as isGenericToolAction,
3972
+ kr as isGlobAction,
3973
+ Tr as isMcpToolAction,
3974
+ Nr as isSearchAction,
3975
+ Mr as isToolCallEntry,
3976
+ Cr as isWebFetchAction,
3977
+ _r as isWebSearchAction,
3978
+ pt as mapToolToActionType,
3979
+ Dr as normalizeMessages,
3980
+ gt as normalizeToolResult,
3981
+ wt as parseCommandResult,
3982
+ mt as parseMcpToolName,
3903
3983
  lr as truncate,
3904
3984
  sr as updateToolCallWithResult,
3905
- $r as useTheme
3985
+ Lr as useTheme
3906
3986
  };