@pstdio/ui 0.1.0 → 0.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/chat-ui.js CHANGED
@@ -1,10 +1,10 @@
1
- import { jsx as l, jsxs as x, Fragment as Ie } from "react/jsx-runtime";
1
+ import { jsx as l, jsxs as x, Fragment as De } from "react/jsx-runtime";
2
2
  import { c as y } from "react/compiler-runtime";
3
- import { chakra as Ee, AbsoluteCenter as ct, IconButton as He, defineSlotRecipe as at, createSlotRecipeContext as dt, Text as J, Code as $e, Button as Re, HStack as Ne, Box as T, Flex as fe, Tooltip as ue, Portal as ut, Kbd as ft, Spacer as pt, Timeline as mt, Span as ie, Avatar as X, Card as L, Link as je, Stack as Ue, Spinner as ht } from "@chakra-ui/react";
4
- import { ArrowDownIcon as gt, ShieldX as bt, ShieldCheck as xt, Square as yt, ArrowUp as St, Move as kt, FileDown as Tt, FileUp as wt, FileDiff as Ct, Trash2 as Pt, FilePen as _t, FileText as Bt, ListTree as Rt, Terminal as qe, File as It, Globe as vt, Search as At, AlertTriangle as Dt, DotIcon as $t, ChevronUpIcon as Ft, MessageCircleIcon as Mt } from "lucide-react";
5
- import { StickToBottom as Ve, useStickToBottomContext as Ge } from "use-stick-to-bottom";
6
- import { useRef as Ke, useEffect as Ye, useState as oe } from "react";
7
- import { f as Pe, P as zt, g as Lt, R as Je, h as Ot } from "./rich-message-CNDoACE7.js";
3
+ import { chakra as je, AbsoluteCenter as ft, IconButton as Ue, defineSlotRecipe as pt, createSlotRecipeContext as mt, Text as Q, Code as Me, Button as Ae, HStack as qe, Box as T, Flex as pe, Tooltip as fe, Portal as ht, Kbd as gt, Spacer as bt, Timeline as xt, Span as se, Avatar as Z, Card as M, Link as Ve, Stack as Ke, Spinner as yt } from "@chakra-ui/react";
4
+ import { ArrowDownIcon as St, ShieldX as kt, ShieldCheck as Tt, Square as wt, ArrowUp as Ct, Move as Pt, FileDown as _t, FileUp as Rt, FileDiff as It, Trash2 as Bt, FilePen as At, FileText as Dt, ListTree as vt, Terminal as Ge, File as Ft, Globe as $t, Search as zt, AlertTriangle as Mt, DotIcon as Ot, ChevronUpIcon as Lt, MessageCircleIcon as Et } from "lucide-react";
5
+ import { StickToBottom as Ye, useStickToBottomContext as Je } from "use-stick-to-bottom";
6
+ import { useRef as Xe, useEffect as Qe, useState as oe } from "react";
7
+ import { f as Re, P as Wt, g as Nt, R as Ze, h as Ht } from "./rich-message-CNDoACE7.js";
8
8
  import "@lexical/react/LexicalCollaborationContext";
9
9
  import "@lexical/react/LexicalCollaborationPlugin";
10
10
  import "@lexical/react/LexicalComposer";
@@ -29,14 +29,13 @@ import "@lexical/react/LexicalAutoFocusPlugin";
29
29
  import "@lexical/react/LexicalHistoryPlugin";
30
30
  import "@lexical/react/LexicalOnChangePlugin";
31
31
  import "@lexical/react/LexicalTreeView";
32
- import { D as Wt, E as Et } from "./empty-state-Bu1ocnPz.js";
33
- import { DiffEditor as Ht } from "@monaco-editor/react";
34
- const Nt = {
32
+ import { D as jt, a as Ut, E as qt } from "./empty-state-B8mbv7ZH.js";
33
+ const Vt = {
35
34
  "aria-roledescription": "conversation",
36
35
  initial: "instant",
37
36
  resize: "instant",
38
37
  role: "log"
39
- }, jt = Ee(Ve, {
38
+ }, Kt = je(Ye, {
40
39
  base: {
41
40
  position: "relative",
42
41
  flex: 1,
@@ -45,8 +44,8 @@ const Nt = {
45
44
  }
46
45
  }, {
47
46
  forwardProps: ["resize"],
48
- defaultProps: Nt
49
- }), Ut = Ee(Ve.Content, {
47
+ defaultProps: Vt
48
+ }), Gt = je(Ye.Content, {
50
49
  base: {
51
50
  p: "0"
52
51
  }
@@ -55,18 +54,18 @@ const Nt = {
55
54
  "aria-live": "polite",
56
55
  role: "list"
57
56
  }
58
- }), qt = (t) => {
57
+ }), Yt = (t) => {
59
58
  const e = y(4), {
60
59
  isAtBottom: n,
61
- scrollToBottom: i
62
- } = Ge();
60
+ scrollToBottom: s
61
+ } = Je();
63
62
  let r;
64
- return e[0] !== n || e[1] !== t || e[2] !== i ? (r = !n && /* @__PURE__ */ l(ct, { axis: "horizontal", bottom: "md", children: /* @__PURE__ */ l(He, { rounded: "full", onClick: () => i(), variant: "outline", size: "xs", ...t, children: /* @__PURE__ */ l(gt, { size: 16 }) }) }), e[0] = n, e[1] = t, e[2] = i, e[3] = r) : r = e[3], r;
65
- }, _e = {
66
- Root: jt,
67
- Viewport: Ut,
68
- ScrollToBottom: qt
69
- }, Vt = at({
63
+ return e[0] !== n || e[1] !== t || e[2] !== s ? (r = !n && /* @__PURE__ */ l(ft, { axis: "horizontal", bottom: "md", children: /* @__PURE__ */ l(Ue, { rounded: "full", onClick: () => s(), variant: "outline", size: "xs", ...t, children: /* @__PURE__ */ l(St, { size: 16 }) }) }), e[0] = n, e[1] = t, e[2] = s, e[3] = r) : r = e[3], r;
64
+ }, Ie = {
65
+ Root: Kt,
66
+ Viewport: Gt,
67
+ ScrollToBottom: Yt
68
+ }, Jt = pt({
70
69
  className: "ai-message",
71
70
  slots: ["root", "content"],
72
71
  base: {
@@ -172,157 +171,164 @@ const Nt = {
172
171
  shape: "rounded"
173
172
  }
174
173
  }), {
175
- withProvider: Gt,
176
- withContext: Kt
177
- } = dt({
178
- recipe: Vt
179
- }), Yt = Gt("div", "root"), Jt = Kt("div", "content"), Fe = {
180
- Root: Yt,
181
- Content: Jt
182
- }, Xt = (t) => {
174
+ withProvider: Xt,
175
+ withContext: Qt
176
+ } = mt({
177
+ recipe: Jt
178
+ }), Zt = Xt("div", "root"), en = Qt("div", "content"), Oe = {
179
+ Root: Zt,
180
+ Content: en
181
+ }, tn = (t) => {
183
182
  if (t == null) return null;
184
183
  const e = typeof t == "string" ? t : JSON.stringify(t, null, 2);
185
184
  return e.length === 0 ? null : e.length > 200 ? `${e.slice(0, 200)}...` : e;
186
- }, co = (t) => {
185
+ }, lo = (t) => {
187
186
  const e = y(19), {
188
187
  toolName: n,
189
- toolInput: i,
188
+ toolInput: s,
190
189
  onApprove: r,
191
190
  onDeny: o
192
191
  } = t;
193
- let s;
194
- e[0] !== i ? (s = Xt(i), e[0] = i, e[1] = s) : s = e[1];
195
- const c = s;
192
+ let i;
193
+ e[0] !== s ? (i = tn(s), e[0] = s, e[1] = i) : i = e[1];
194
+ const c = i;
196
195
  let d;
197
- e[2] !== n ? (d = /* @__PURE__ */ x(J, { textStyle: "label/S/medium", color: "fg", children: [
196
+ e[2] !== n ? (d = /* @__PURE__ */ x(Q, { textStyle: "label/S/medium", color: "fg", children: [
198
197
  "Allow ",
199
- /* @__PURE__ */ l($e, { size: "sm", children: n }),
198
+ /* @__PURE__ */ l(Me, { size: "sm", children: n }),
200
199
  "?"
201
200
  ] }), e[2] = n, e[3] = d) : d = e[3];
202
201
  let a;
203
- e[4] !== c ? (a = c ? /* @__PURE__ */ l($e, { size: "sm", whiteSpace: "pre-wrap", maxH: "6rem", overflowY: "auto", children: c }) : null, e[4] = c, e[5] = a) : a = e[5];
204
- let f;
205
- e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (f = /* @__PURE__ */ l(bt, { size: 14 }), e[6] = f) : f = e[6];
202
+ e[4] !== c ? (a = c ? /* @__PURE__ */ l(Me, { size: "sm", whiteSpace: "pre-wrap", maxH: "6rem", overflowY: "auto", children: c }) : null, e[4] = c, e[5] = a) : a = e[5];
206
203
  let u;
207
- e[7] !== o ? (u = /* @__PURE__ */ x(Re, { size: "xs", variant: "outline", onClick: o, children: [
208
- f,
204
+ e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ l(kt, { size: 14 }), e[6] = u) : u = e[6];
205
+ let f;
206
+ e[7] !== o ? (f = /* @__PURE__ */ x(Ae, { size: "xs", variant: "outline", onClick: o, children: [
207
+ u,
209
208
  "Deny"
210
- ] }), e[7] = o, e[8] = u) : u = e[8];
209
+ ] }), e[7] = o, e[8] = f) : f = e[8];
211
210
  let p;
212
- e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ l(xt, { size: 14 }), e[9] = p) : p = e[9];
211
+ e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ l(Tt, { size: 14 }), e[9] = p) : p = e[9];
213
212
  let m;
214
- e[10] !== r ? (m = /* @__PURE__ */ x(Re, { size: "xs", colorPalette: "green", onClick: r, children: [
213
+ e[10] !== r ? (m = /* @__PURE__ */ x(Ae, { size: "xs", colorPalette: "green", onClick: r, children: [
215
214
  p,
216
215
  "Allow"
217
216
  ] }), e[10] = r, e[11] = m) : m = e[11];
218
217
  let h;
219
- e[12] !== u || e[13] !== m ? (h = /* @__PURE__ */ x(Ne, { gap: "xs", justifyContent: "flex-end", children: [
220
- u,
218
+ e[12] !== f || e[13] !== m ? (h = /* @__PURE__ */ x(qe, { gap: "xs", justifyContent: "flex-end", children: [
219
+ f,
221
220
  m
222
- ] }), e[12] = u, e[13] = m, e[14] = h) : h = e[14];
221
+ ] }), e[12] = f, e[13] = m, e[14] = h) : h = e[14];
223
222
  let g;
224
- return e[15] !== d || e[16] !== a || e[17] !== h ? (g = /* @__PURE__ */ l(T, { px: "sm", py: "xs", mx: "sm", borderWidth: "1px", borderColor: "border.warning", borderRadius: "lg", bg: "bg.warning", children: /* @__PURE__ */ x(fe, { direction: "column", gap: "xs", children: [
223
+ return e[15] !== d || e[16] !== a || e[17] !== h ? (g = /* @__PURE__ */ l(T, { px: "sm", py: "xs", mx: "sm", borderWidth: "1px", borderColor: "border.warning", borderRadius: "lg", bg: "bg.warning", children: /* @__PURE__ */ x(pe, { direction: "column", gap: "xs", children: [
225
224
  d,
226
225
  a,
227
226
  h
228
227
  ] }) }), e[15] = d, e[16] = a, e[17] = h, e[18] = g) : g = e[18], g;
229
- }, Qt = (t) => {
228
+ }, nn = (t) => {
230
229
  const {
231
230
  previousUserMessageCount: e,
232
231
  userMessageCount: n
233
232
  } = t;
234
233
  return e === 0 ? !1 : n > e;
235
234
  };
236
- function Zt(t) {
235
+ function rn(t) {
237
236
  const e = y(4), {
238
237
  userMessageCount: n
239
238
  } = t, {
240
- scrollToBottom: i
241
- } = Ge(), r = Ke(n);
242
- let o, s;
243
- return e[0] !== i || e[1] !== n ? (o = () => {
244
- Qt({
239
+ scrollToBottom: s
240
+ } = Je(), r = Xe(n);
241
+ let o, i;
242
+ return e[0] !== s || e[1] !== n ? (o = () => {
243
+ nn({
245
244
  previousUserMessageCount: r.current,
246
245
  userMessageCount: n
247
- }) && i(), r.current = n;
248
- }, s = [n, i], e[0] = i, e[1] = n, e[2] = o, e[3] = s) : (o = e[2], s = e[3]), Ye(o, s), null;
246
+ }) && s(), r.current = n;
247
+ }, i = [n, s], e[0] = s, e[1] = n, e[2] = o, e[3] = i) : (o = e[2], i = e[3]), Qe(o, i), null;
249
248
  }
250
- const en = (t) => {
249
+ const on = (t) => {
251
250
  const e = y(22);
252
- let n, i, r, o;
251
+ let n, s, r, o;
253
252
  e[0] !== t ? ({
254
253
  title: o,
255
254
  shortcut: r,
256
255
  canInterrupt: n,
257
- ...i
258
- } = t, e[0] = t, e[1] = n, e[2] = i, e[3] = r, e[4] = o) : (n = e[1], i = e[2], r = e[3], o = e[4]);
259
- const s = i["aria-label"] ?? o;
256
+ ...s
257
+ } = t, e[0] = t, e[1] = n, e[2] = s, e[3] = r, e[4] = o) : (n = e[1], s = e[2], r = e[3], o = e[4]);
258
+ const i = s["aria-label"] ?? o;
260
259
  let c;
261
- e[5] !== n ? (c = n ? /* @__PURE__ */ l(yt, { size: 16, strokeWidth: 2, fill: "currentColor" }) : /* @__PURE__ */ l(St, { size: 16, strokeWidth: 2 }), e[5] = n, e[6] = c) : c = e[6];
260
+ e[5] !== n ? (c = n ? /* @__PURE__ */ l(wt, { size: 16, strokeWidth: 2, fill: "currentColor" }) : /* @__PURE__ */ l(Ct, { size: 16, strokeWidth: 2 }), e[5] = n, e[6] = c) : c = e[6];
262
261
  const d = c;
263
262
  let a;
264
- e[7] !== s || e[8] !== d || e[9] !== i || e[10] !== o ? (a = /* @__PURE__ */ l(He, { size: "sm", variant: "solid", borderRadius: "full", colorPalette: "primary", "aria-label": s, title: o, ...i, children: d }), e[7] = s, e[8] = d, e[9] = i, e[10] = o, e[11] = a) : a = e[11];
265
- const f = a;
263
+ e[7] !== i || e[8] !== d || e[9] !== s || e[10] !== o ? (a = /* @__PURE__ */ l(Ue, { size: "sm", variant: "solid", borderRadius: "full", colorPalette: "primary", "aria-label": i, title: o, ...s, children: d }), e[7] = i, e[8] = d, e[9] = s, e[10] = o, e[11] = a) : a = e[11];
264
+ const u = a;
266
265
  if (o) {
267
- let u;
268
- e[12] !== r || e[13] !== o ? (u = r ? /* @__PURE__ */ x(Ie, { children: [
266
+ let f;
267
+ e[12] !== r || e[13] !== o ? (f = r ? /* @__PURE__ */ x(De, { children: [
269
268
  o,
270
269
  " ",
271
- /* @__PURE__ */ l(ft, { fontSize: "xs", children: r })
272
- ] }) : o, e[12] = r, e[13] = o, e[14] = u) : u = e[14];
273
- const p = u;
270
+ /* @__PURE__ */ l(gt, { fontSize: "xs", children: r })
271
+ ] }) : o, e[12] = r, e[13] = o, e[14] = f) : f = e[14];
272
+ const p = f;
274
273
  let m;
275
- e[15] !== f ? (m = /* @__PURE__ */ l(ue.Trigger, { asChild: !0, children: f }), e[15] = f, e[16] = m) : m = e[16];
274
+ e[15] !== u ? (m = /* @__PURE__ */ l(fe.Trigger, { asChild: !0, children: u }), e[15] = u, e[16] = m) : m = e[16];
276
275
  let h;
277
- e[17] !== p ? (h = /* @__PURE__ */ l(ut, { children: /* @__PURE__ */ l(ue.Positioner, { children: /* @__PURE__ */ l(ue.Content, { children: p }) }) }), e[17] = p, e[18] = h) : h = e[18];
276
+ e[17] !== p ? (h = /* @__PURE__ */ l(ht, { children: /* @__PURE__ */ l(fe.Positioner, { children: /* @__PURE__ */ l(fe.Content, { children: p }) }) }), e[17] = p, e[18] = h) : h = e[18];
278
277
  let g;
279
- return e[19] !== m || e[20] !== h ? (g = /* @__PURE__ */ x(ue.Root, { closeDelay: 50, openDelay: 100, children: [
278
+ return e[19] !== m || e[20] !== h ? (g = /* @__PURE__ */ x(fe.Root, { closeDelay: 50, openDelay: 100, children: [
280
279
  m,
281
280
  h
282
281
  ] }), e[19] = m, e[20] = h, e[21] = g) : g = e[21], g;
283
282
  }
284
- return f;
285
- }, tn = (t) => {
286
- const e = y(60), {
283
+ return u;
284
+ }, sn = (t) => {
285
+ const e = y(61), {
287
286
  defaultState: n,
288
- onSubmit: i,
287
+ onSubmit: s,
289
288
  onInterrupt: r,
290
289
  streaming: o,
291
- attachedResources: s,
290
+ attachedResources: i,
292
291
  onClearAttachments: c,
293
292
  isDisabled: d,
294
293
  onChange: a,
295
- placeholder: f,
296
- attachmentList: u,
294
+ placeholder: u,
295
+ attachmentList: f,
297
296
  actions: p
298
- } = t, m = i === void 0 ? nn : i, h = o === void 0 ? !1 : o;
297
+ } = t, m = s === void 0 ? ln : s, h = o === void 0 ? !1 : o;
299
298
  let g;
300
- e[0] !== s ? (g = s === void 0 ? [] : s, e[0] = s, e[1] = g) : g = e[1];
301
- const S = g, k = d === void 0 ? !1 : d, [P, A] = oe(!1), [I, D] = oe(n), [v, $] = oe(0);
299
+ e[0] !== i ? (g = i === void 0 ? [] : i, e[0] = i, e[1] = g) : g = e[1];
300
+ const S = g, k = d === void 0 ? !1 : d, [P, D] = oe(!1), [B, v] = oe(n), [A, F] = oe(0);
302
301
  let _;
303
- e[2] !== n ? (_ = () => Pe(n), e[2] = n, e[3] = _) : _ = e[3];
304
- const [C, O] = oe(_), F = Ke(null);
305
- let B, R;
306
- e[4] !== n || e[5] !== a ? (B = () => {
307
- const w = Pe(n);
308
- D(n), $(rn), O(w), a?.(w);
309
- }, R = [n, a], e[4] = n, e[5] = a, e[6] = B, e[7] = R) : (B = e[6], R = e[7]), Ye(B, R);
310
- let M;
311
- e[8] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (M = () => {
312
- A(!0);
313
- const w = F.current?.querySelector('[contenteditable="true"]');
302
+ e[2] !== n ? (_ = () => Re(n), e[2] = n, e[3] = _) : _ = e[3];
303
+ const [C, O] = oe(_), $ = Xe(null);
304
+ let R, I;
305
+ e[4] !== n || e[5] !== a ? (R = () => {
306
+ const w = Re(n);
307
+ v(n), F(cn), O(w), a?.(w);
308
+ }, I = [n, a], e[4] = n, e[5] = a, e[6] = R, e[7] = I) : (R = e[6], I = e[7]), Qe(R, I);
309
+ let z;
310
+ e[8] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (z = () => {
311
+ const w = $.current?.querySelector('[contenteditable="true"]');
314
312
  w instanceof HTMLElement && w.focus();
315
- }, e[8] = M) : M = e[8];
316
- const ne = M;
317
- let N;
318
- e[9] !== n || e[10] !== a ? (N = () => {
319
- D(n), $(on);
320
- const w = Pe(n);
321
- O(w), a?.(w);
322
- }, e[9] = n, e[10] = a, e[11] = N) : N = e[11];
323
- const re = N;
324
- let W;
325
- e[12] !== S || e[13] !== k || e[14] !== c || e[15] !== r || e[16] !== m || e[17] !== re || e[18] !== h || e[19] !== C ? (W = () => {
313
+ }, e[8] = z) : z = e[8];
314
+ const N = z;
315
+ let H;
316
+ e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (H = () => {
317
+ D(!0), N();
318
+ }, e[9] = H) : H = e[9];
319
+ const ye = H;
320
+ let L;
321
+ e[10] !== n || e[11] !== a ? (L = (w) => {
322
+ const ut = w === void 0 ? !1 : w;
323
+ v(n), F(an);
324
+ const ze = Re(n);
325
+ O(ze), a?.(ze), ut && requestAnimationFrame(() => {
326
+ N();
327
+ });
328
+ }, e[10] = n, e[11] = a, e[12] = L) : L = e[12];
329
+ const j = L;
330
+ let ie;
331
+ e[13] !== S || e[14] !== k || e[15] !== c || e[16] !== r || e[17] !== m || e[18] !== j || e[19] !== h || e[20] !== C ? (ie = () => {
326
332
  if (k)
327
333
  return;
328
334
  if (h) {
@@ -330,94 +336,94 @@ const en = (t) => {
330
336
  return;
331
337
  }
332
338
  const w = C.trim();
333
- w && (m(w, S), re(), c?.());
334
- }, e[12] = S, e[13] = k, e[14] = c, e[15] = r, e[16] = m, e[17] = re, e[18] = h, e[19] = C, e[20] = W) : W = e[20];
335
- const z = W, H = h && !!r;
336
- let se;
337
- e[21] !== f ? (se = f ? /* @__PURE__ */ l(J, { textStyle: "label/M/regular", color: "fg.subtle", pointerEvents: "none", position: "absolute", top: "0", children: f }) : void 0, e[21] = f, e[22] = se) : se = e[22];
338
- const xe = se, ye = P ? "blue.border" : "border.muted", Se = P ? "mid" : "low", ke = P ? "blue.border" : "border";
339
- let j;
340
- e[23] !== ke ? (j = {
341
- borderColor: ke,
342
- boxShadow: "mid"
343
- }, e[23] = ke, e[24] = j) : j = e[24];
339
+ w && (m(w, S), j(!0), c?.());
340
+ }, e[13] = S, e[14] = k, e[15] = c, e[16] = r, e[17] = m, e[18] = j, e[19] = h, e[20] = C, e[21] = ie) : ie = e[21];
341
+ const U = ie, W = h && !!r;
344
342
  let le;
345
- e[25] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (le = {
346
- borderColor: "blue.border",
343
+ e[22] !== u ? (le = u ? /* @__PURE__ */ l(Q, { textStyle: "label/M/regular", color: "fg.subtle", pointerEvents: "none", position: "absolute", top: "0", children: u }) : void 0, e[22] = u, e[23] = le) : le = e[23];
344
+ const Se = le, ke = P ? "blue.border" : "border.muted", Te = P ? "mid" : "low", we = P ? "blue.border" : "border";
345
+ let q;
346
+ e[24] !== we ? (q = {
347
+ borderColor: we,
347
348
  boxShadow: "mid"
348
- }, e[25] = le) : le = e[25];
349
+ }, e[24] = we, e[25] = q) : q = e[25];
349
350
  let ce;
350
- e[26] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ce = () => A(!1), e[26] = ce) : ce = e[26];
351
- const Te = !k;
352
- let U;
353
- e[27] !== a ? (U = (w) => {
354
- O(w), a?.(w);
355
- }, e[27] = a, e[28] = U) : U = e[28];
356
- let q;
357
- e[29] !== v || e[30] !== I || e[31] !== z || e[32] !== xe || e[33] !== Te || e[34] !== U ? (q = /* @__PURE__ */ l(zt, { defaultState: I, isEditable: Te, placeholder: xe, onChange: U, onSubmit: z }, v), e[29] = v, e[30] = I, e[31] = z, e[32] = xe, e[33] = Te, e[34] = U, e[35] = q) : q = e[35];
351
+ e[26] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ce = {
352
+ borderColor: "blue.border",
353
+ boxShadow: "mid"
354
+ }, e[26] = ce) : ce = e[26];
358
355
  let ae;
359
- e[36] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ae = /* @__PURE__ */ l(pt, {}), e[36] = ae) : ae = e[36];
360
- const we = H ? "Stop Response" : "Message Sending", Ce = h ? void 0 : "Enter";
356
+ e[27] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ae = () => D(!1), e[27] = ae) : ae = e[27];
357
+ const Ce = !k;
361
358
  let V;
362
- e[37] !== H || e[38] !== k || e[39] !== h || e[40] !== C ? (V = h && !H || !h && !C.trim() || k, e[37] = H, e[38] = k, e[39] = h, e[40] = C, e[41] = V) : V = e[41];
363
- let G;
364
- e[42] !== H || e[43] !== z || e[44] !== we || e[45] !== Ce || e[46] !== V ? (G = /* @__PURE__ */ l(en, { canInterrupt: H, title: we, shortcut: Ce, onClick: z, disabled: V }), e[42] = H, e[43] = z, e[44] = we, e[45] = Ce, e[46] = V, e[47] = G) : G = e[47];
359
+ e[28] !== a ? (V = (w) => {
360
+ O(w), a?.(w);
361
+ }, e[28] = a, e[29] = V) : V = e[29];
365
362
  let K;
366
- e[48] !== p || e[49] !== G ? (K = /* @__PURE__ */ x(Ne, { gap: "1", mt: "md", children: [
367
- p,
368
- ae,
369
- G
370
- ] }), e[48] = p, e[49] = G, e[50] = K) : K = e[50];
371
- let Y;
372
- e[51] !== u || e[52] !== q || e[53] !== K ? (Y = /* @__PURE__ */ x(fe, { direction: "column", color: "fg", children: [
373
- u,
374
- q,
375
- K
376
- ] }), e[51] = u, e[52] = q, e[53] = K, e[54] = Y) : Y = e[54];
363
+ e[30] !== A || e[31] !== B || e[32] !== U || e[33] !== Se || e[34] !== Ce || e[35] !== V ? (K = /* @__PURE__ */ l(Wt, { defaultState: B, isEditable: Ce, placeholder: Se, onChange: V, onSubmit: U }, A), e[30] = A, e[31] = B, e[32] = U, e[33] = Se, e[34] = Ce, e[35] = V, e[36] = K) : K = e[36];
377
364
  let de;
378
- return e[55] !== ye || e[56] !== Se || e[57] !== j || e[58] !== Y ? (de = /* @__PURE__ */ l(T, { ref: F, width: "100%", paddingX: "lg", paddingY: "md", bg: "bg", borderRadius: "md", borderWidth: "1px", borderStyle: "solid", borderColor: ye, boxShadow: Se, transition: "box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out", _hover: j, _focusWithin: le, onClick: ne, onBlur: ce, children: Y }), e[55] = ye, e[56] = Se, e[57] = j, e[58] = Y, e[59] = de) : de = e[59], de;
365
+ e[37] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (de = /* @__PURE__ */ l(bt, {}), e[37] = de) : de = e[37];
366
+ const Pe = W ? "Stop Response" : "Message Sending", _e = h ? void 0 : "Enter";
367
+ let G;
368
+ e[38] !== W || e[39] !== k || e[40] !== h || e[41] !== C ? (G = h && !W || !h && !C.trim() || k, e[38] = W, e[39] = k, e[40] = h, e[41] = C, e[42] = G) : G = e[42];
369
+ let Y;
370
+ e[43] !== W || e[44] !== U || e[45] !== Pe || e[46] !== _e || e[47] !== G ? (Y = /* @__PURE__ */ l(on, { canInterrupt: W, title: Pe, shortcut: _e, onClick: U, disabled: G }), e[43] = W, e[44] = U, e[45] = Pe, e[46] = _e, e[47] = G, e[48] = Y) : Y = e[48];
371
+ let J;
372
+ e[49] !== p || e[50] !== Y ? (J = /* @__PURE__ */ x(qe, { gap: "1", mt: "md", children: [
373
+ p,
374
+ de,
375
+ Y
376
+ ] }), e[49] = p, e[50] = Y, e[51] = J) : J = e[51];
377
+ let X;
378
+ e[52] !== f || e[53] !== K || e[54] !== J ? (X = /* @__PURE__ */ x(pe, { direction: "column", color: "fg", children: [
379
+ f,
380
+ K,
381
+ J
382
+ ] }), e[52] = f, e[53] = K, e[54] = J, e[55] = X) : X = e[55];
383
+ let ue;
384
+ return e[56] !== ke || e[57] !== Te || e[58] !== q || e[59] !== X ? (ue = /* @__PURE__ */ l(T, { ref: $, width: "100%", paddingX: "lg", paddingY: "md", bg: "bg", borderRadius: "md", borderWidth: "1px", borderStyle: "solid", borderColor: ke, boxShadow: Te, transition: "box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out", _hover: q, _focusWithin: ce, onClick: ye, onBlur: ae, children: X }), e[56] = ke, e[57] = Te, e[58] = q, e[59] = X, e[60] = ue) : ue = e[60], ue;
379
385
  };
380
- function nn() {
386
+ function ln() {
381
387
  }
382
- function rn(t) {
388
+ function cn(t) {
383
389
  return t + 1;
384
390
  }
385
- function on(t) {
391
+ function an(t) {
386
392
  return t + 1;
387
393
  }
388
- const sn = (t = "") => JSON.stringify(Lt(t)), ln = (t) => {
394
+ const dn = (t = "") => JSON.stringify(Nt(t)), un = (t) => {
389
395
  const e = y(8);
390
- let n, i;
396
+ let n, s;
391
397
  e[0] !== t ? ({
392
398
  children: n,
393
- ...i
394
- } = t, e[0] = t, e[1] = n, e[2] = i) : (n = e[1], i = e[2]);
399
+ ...s
400
+ } = t, e[0] = t, e[1] = n, e[2] = s) : (n = e[1], s = e[2]);
395
401
  let r;
396
- e[3] !== n ? (r = /* @__PURE__ */ l(Je, { defaultState: n }), e[3] = n, e[4] = r) : r = e[4];
402
+ e[3] !== n ? (r = /* @__PURE__ */ l(Ze, { defaultState: n }), e[3] = n, e[4] = r) : r = e[4];
397
403
  let o;
398
- return e[5] !== i || e[6] !== r ? (o = /* @__PURE__ */ l(T, { ...i, children: r }), e[5] = i, e[6] = r, e[7] = o) : o = e[7], o;
399
- }, cn = ln, Xe = {
400
- shell: qe,
401
- ls: Rt,
402
- read_file: Bt,
403
- write_file: _t,
404
- delete_file: Pt,
405
- patch: Ct,
406
- upload_files: wt,
407
- download_file: Tt,
408
- move_file: kt
409
- }, an = {
410
- dot: $t,
411
- danger: Dt,
412
- search: At,
413
- browser: vt,
414
- file: It,
415
- terminal: qe,
416
- ...Xe
417
- }, Me = "dot", dn = (t) => Object.hasOwn(Xe, t), un = (t) => an[t], Qe = (t) => {
418
- if (!t) return Me;
404
+ return e[5] !== s || e[6] !== r ? (o = /* @__PURE__ */ l(T, { ...s, children: r }), e[5] = s, e[6] = r, e[7] = o) : o = e[7], o;
405
+ }, fn = un, et = {
406
+ shell: Ge,
407
+ ls: vt,
408
+ read_file: Dt,
409
+ write_file: At,
410
+ delete_file: Bt,
411
+ patch: It,
412
+ upload_files: Rt,
413
+ download_file: _t,
414
+ move_file: Pt
415
+ }, pn = {
416
+ dot: Ot,
417
+ danger: Mt,
418
+ search: zt,
419
+ browser: $t,
420
+ file: Ft,
421
+ terminal: Ge,
422
+ ...et
423
+ }, Le = "dot", mn = (t) => Object.hasOwn(et, t), hn = (t) => pn[t], tt = (t) => {
424
+ if (!t) return Le;
419
425
  const e = t.replace(/^tool-/, "");
420
- if (dn(e)) return e;
426
+ if (mn(e)) return e;
421
427
  switch (e) {
422
428
  case "read":
423
429
  return "file";
@@ -437,52 +443,52 @@ const sn = (t = "") => JSON.stringify(Lt(t)), ln = (t) => {
437
443
  case "file":
438
444
  return "file";
439
445
  default:
440
- return Me;
446
+ return Le;
441
447
  }
442
448
  };
443
449
  function ve(t) {
444
450
  const e = t.lastIndexOf("/");
445
451
  return e >= 0 ? t.slice(e + 1) : t;
446
452
  }
447
- function pe(t) {
453
+ function me(t) {
448
454
  if (!t) return null;
449
455
  const e = t.split(" ")[0].trim();
450
456
  if (e === "/dev/null") return null;
451
457
  let n = e;
452
458
  return (n.startsWith("a/") || n.startsWith("b/")) && (n = n.slice(2)), n.replace(/^\/+/, "").replace(/\\/g, "/");
453
459
  }
454
- const he = (t) => t.startsWith("--- "), Ae = (t) => t.startsWith("+++ "), De = (t) => t.startsWith("@@"), fn = (t) => t.startsWith("+") && !(Ae(t) || t === "+++"), pn = (t) => t.startsWith("-") && !(he(t) || t === "---"), mn = (t, e) => {
460
+ const ge = (t) => t.startsWith("--- "), Fe = (t) => t.startsWith("+++ "), $e = (t) => t.startsWith("@@"), gn = (t) => t.startsWith("+") && !(Fe(t) || t === "+++"), bn = (t) => t.startsWith("-") && !(ge(t) || t === "---"), xn = (t, e) => {
455
461
  t.has(e) || t.set(e, {
456
462
  additions: 0,
457
463
  deletions: 0
458
464
  });
459
- }, hn = (t, e) => {
465
+ }, yn = (t, e) => {
460
466
  const n = t.get(e);
461
467
  n && (n.additions += 1);
462
- }, gn = (t, e) => {
468
+ }, Sn = (t, e) => {
463
469
  const n = t.get(e);
464
470
  n && (n.deletions += 1);
465
- }, bn = (t, e, n) => {
466
- if (he(t))
471
+ }, kn = (t, e, n) => {
472
+ if (ge(t))
467
473
  return {
468
474
  ...e,
469
- lastMinusHeader: pe(t.slice(4)),
475
+ lastMinusHeader: me(t.slice(4)),
470
476
  inHunk: !1
471
477
  };
472
- if (Ae(t)) {
473
- const r = pe(t.slice(4)) ?? e.lastMinusHeader;
474
- return r && mn(n, r), {
478
+ if (Fe(t)) {
479
+ const r = me(t.slice(4)) ?? e.lastMinusHeader;
480
+ return r && xn(n, r), {
475
481
  ...e,
476
482
  currentPath: r,
477
483
  inHunk: !1
478
484
  };
479
485
  }
480
- return e.currentPath ? De(t) ? {
486
+ return e.currentPath ? $e(t) ? {
481
487
  ...e,
482
488
  inHunk: !0
483
- } : e.inHunk ? fn(t) ? (hn(n, e.currentPath), e) : (pn(t) && gn(n, e.currentPath), e) : e : e;
489
+ } : e.inHunk ? gn(t) ? (yn(n, e.currentPath), e) : (bn(t) && Sn(n, e.currentPath), e) : e : e;
484
490
  };
485
- function Ze(t) {
491
+ function nt(t) {
486
492
  if (!t || typeof t != "string") return [];
487
493
  const e = /* @__PURE__ */ new Map();
488
494
  let n = {
@@ -490,20 +496,20 @@ function Ze(t) {
490
496
  lastMinusHeader: null,
491
497
  inHunk: !1
492
498
  };
493
- const i = t.split(/\r?\n/);
494
- for (const r of i)
495
- n = bn(r, n, e);
499
+ const s = t.split(/\r?\n/);
500
+ for (const r of s)
501
+ n = kn(r, n, e);
496
502
  return Array.from(e.entries()).map(([r, {
497
503
  additions: o,
498
- deletions: s
504
+ deletions: i
499
505
  }]) => ({
500
506
  filePath: r,
501
507
  additions: o,
502
- deletions: s
508
+ deletions: i
503
509
  }));
504
510
  }
505
- function xn(t) {
506
- return Ze(t).map((e) => ({
511
+ function Tn(t) {
512
+ return nt(t).map((e) => ({
507
513
  kind: "diff",
508
514
  fileName: ve(e.filePath),
509
515
  filePath: e.filePath,
@@ -511,13 +517,13 @@ function xn(t) {
511
517
  deletions: e.deletions
512
518
  }));
513
519
  }
514
- function yn(t) {
515
- return Ze(t).map((e) => e.filePath);
520
+ function wn(t) {
521
+ return nt(t).map((e) => e.filePath);
516
522
  }
517
- const et = (t) => he(t) || t.startsWith("diff --git "), Sn = (t) => t.startsWith(" ") || t.startsWith("+") || t.startsWith("-") ? !1 : t.trim() !== "", kn = (t, e, n) => {
523
+ const rt = (t) => ge(t) || t.startsWith("diff --git "), Cn = (t) => t.startsWith(" ") || t.startsWith("+") || t.startsWith("-") ? !1 : t.trim() !== "", Pn = (t, e, n) => {
518
524
  if (t.startsWith(" ")) {
519
- const i = t.slice(1);
520
- e.push(i), n.push(i);
525
+ const s = t.slice(1);
526
+ e.push(s), n.push(s);
521
527
  return;
522
528
  }
523
529
  if (t.startsWith("-")) {
@@ -525,86 +531,86 @@ const et = (t) => he(t) || t.startsWith("diff --git "), Sn = (t) => t.startsWith
525
531
  return;
526
532
  }
527
533
  t.startsWith("+") && n.push(t.slice(1));
528
- }, Tn = (t, e, n, i) => {
534
+ }, _n = (t, e, n, s) => {
529
535
  let r = e;
530
536
  for (; r < t.length; ) {
531
537
  const o = t[r] || "";
532
- if (et(o) || De(o) || Sn(o))
538
+ if (rt(o) || $e(o) || Cn(o))
533
539
  break;
534
- kn(o, n, i), r += 1;
540
+ Pn(o, n, s), r += 1;
535
541
  }
536
- return (n.length > 0 || i.length > 0) && (n.push(""), i.push("")), r;
537
- }, wn = (t, e) => {
538
- const n = pe((t[e] || "").slice(4)), i = t[e + 1] || "";
539
- if (!Ae(i)) return {
542
+ return (n.length > 0 || s.length > 0) && (n.push(""), s.push("")), r;
543
+ }, Rn = (t, e) => {
544
+ const n = me((t[e] || "").slice(4)), s = t[e + 1] || "";
545
+ if (!Fe(s)) return {
540
546
  nextIndex: e + 1
541
547
  };
542
- const o = pe(i.slice(4)) ?? n ?? "", s = [], c = [];
548
+ const o = me(s.slice(4)) ?? n ?? "", i = [], c = [];
543
549
  let d = e + 2;
544
550
  for (; d < t.length; ) {
545
551
  const a = t[d] || "";
546
- if (et(a)) break;
547
- if (!De(a)) {
552
+ if (rt(a)) break;
553
+ if (!$e(a)) {
548
554
  d += 1;
549
555
  continue;
550
556
  }
551
- d = Tn(t, d + 1, s, c);
557
+ d = _n(t, d + 1, i, c);
552
558
  }
553
559
  return {
554
560
  nextIndex: d,
555
561
  preview: {
556
562
  filePath: o,
557
- original: s.join(`
563
+ original: i.join(`
558
564
  `),
559
565
  modified: c.join(`
560
566
  `)
561
567
  }
562
568
  };
563
569
  };
564
- function Cn(t) {
570
+ function In(t) {
565
571
  if (!t || typeof t != "string") return [];
566
572
  const e = t.split(/\r?\n/), n = [];
567
- let i = 0;
568
- for (; i < e.length; ) {
569
- const r = e[i] || "";
570
- if (!he(r)) {
571
- i += 1;
573
+ let s = 0;
574
+ for (; s < e.length; ) {
575
+ const r = e[s] || "";
576
+ if (!ge(r)) {
577
+ s += 1;
572
578
  continue;
573
579
  }
574
580
  const {
575
581
  nextIndex: o,
576
- preview: s
577
- } = wn(e, i);
578
- s && n.push(s), i = Math.max(o, i + 1);
582
+ preview: i
583
+ } = Rn(e, s);
584
+ i && n.push(i), s = Math.max(o, s + 1);
579
585
  }
580
586
  return n;
581
587
  }
582
- const Pn = {
588
+ const Bn = {
583
589
  apply_patch: "Apply patch",
584
590
  read: "Read file",
585
591
  bash: "Run",
586
592
  grep: "Search files",
587
593
  glob: "Find files",
588
594
  skill: "Load skill"
589
- }, ze = {
595
+ }, Ee = {
590
596
  pending: "queued",
591
597
  error: "failed",
592
598
  "output-error": "failed",
593
599
  "input-streaming": "running",
594
600
  "input-available": "queued"
595
- }, tt = (t) => t.replace(/^tool-/, ""), _n = (t) => t.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), Bn = (t) => tt(t.tool ?? "tool"), Rn = (t) => {
596
- const e = tt(t);
597
- return Pn[e] ?? _n(e.replace(/_/g, " "));
598
- }, In = (t) => !t || typeof t != "string" ? null : ze[t] ? ze[t] : t.includes("stream") ? "running" : null, nt = (t) => t === "error" || t === "output-error", Q = (t) => nt(t.state?.status) ? {
601
+ }, ot = (t) => t.replace(/^tool-/, ""), An = (t) => t.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), Dn = (t) => ot(t.tool ?? "tool"), vn = (t) => {
602
+ const e = ot(t);
603
+ return Bn[e] ?? An(e.replace(/_/g, " "));
604
+ }, Fn = (t) => !t || typeof t != "string" ? null : Ee[t] ? Ee[t] : t.includes("stream") ? "running" : null, st = (t) => t === "error" || t === "output-error", ee = (t) => st(t.state?.status) ? {
599
605
  type: "icon",
600
606
  icon: "danger"
601
607
  } : {
602
608
  type: "icon",
603
- icon: Qe(Bn(t))
604
- }, Z = (t, e, n) => {
609
+ icon: tt(Dn(t))
610
+ }, te = (t, e, n) => {
605
611
  const r = [{
606
612
  kind: "text",
607
- text: n ?? Rn(t.tool ?? "tool"),
613
+ text: n ?? vn(t.tool ?? "tool"),
608
614
  bold: !0
609
615
  }];
610
616
  e && r.push({
@@ -612,93 +618,93 @@ const Pn = {
612
618
  text: e,
613
619
  muted: !0
614
620
  });
615
- const o = In(t.state?.status);
621
+ const o = Fn(t.state?.status);
616
622
  return o && r.push({
617
623
  kind: "text",
618
624
  text: o,
619
625
  muted: !0
620
626
  }), r;
621
- }, ee = (t) => {
627
+ }, ne = (t) => {
622
628
  const e = t.state?.input;
623
629
  return !e || typeof e != "object" || Array.isArray(e) ? null : e;
624
- }, ge = (t) => {
630
+ }, be = (t) => {
625
631
  const e = t.state?.output;
626
632
  return !e || typeof e != "object" || Array.isArray(e) ? null : e;
627
- }, b = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, me = (t) => !t || typeof t != "object" || Array.isArray(t) ? null : t, vn = (t, e) => {
628
- const n = me(t.state);
629
- return n ? me(n[e]) : null;
630
- }, An = (t) => t.replace(/\\/g, "/").replace(/^\/+/, ""), Dn = (t) => t.includes("--- ") && t.includes("+++ ") && t.includes("@@"), rt = (t) => {
631
- const e = ge(t);
632
- return [vn(t, "metadata"), me(e?.metadata)].filter(Boolean);
633
- }, $n = (t) => {
634
- const e = me(t);
633
+ }, b = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, he = (t) => !t || typeof t != "object" || Array.isArray(t) ? null : t, $n = (t, e) => {
634
+ const n = he(t.state);
635
+ return n ? he(n[e]) : null;
636
+ }, zn = (t) => t.replace(/\\/g, "/").replace(/^\/+/, ""), Mn = (t) => t.includes("--- ") && t.includes("+++ ") && t.includes("@@"), it = (t) => {
637
+ const e = be(t);
638
+ return [$n(t, "metadata"), he(e?.metadata)].filter(Boolean);
639
+ }, On = (t) => {
640
+ const e = he(t);
635
641
  if (!e) return null;
636
642
  const n = b(e.filePath) ?? b(e.relativePath) ?? b(e.path);
637
643
  return n ? {
638
- filePath: An(n),
644
+ filePath: zn(n),
639
645
  additions: typeof e.additions == "number" ? e.additions : 0,
640
646
  deletions: typeof e.deletions == "number" ? e.deletions : 0,
641
647
  diff: b(e.diff) ?? void 0,
642
648
  before: b(e.before) ?? void 0,
643
649
  after: b(e.after) ?? void 0
644
650
  } : null;
645
- }, ot = (t) => {
651
+ }, lt = (t) => {
646
652
  const e = [];
647
- for (const n of rt(t)) {
648
- const i = Array.isArray(n.files) ? n.files : [];
649
- for (const r of i) {
650
- const o = $n(r);
653
+ for (const n of it(t)) {
654
+ const s = Array.isArray(n.files) ? n.files : [];
655
+ for (const r of s) {
656
+ const o = On(r);
651
657
  o && e.push(o);
652
658
  }
653
659
  }
654
660
  return e;
655
- }, Fn = (t) => {
656
- const e = ee(t), n = b(e?.diff);
661
+ }, Ln = (t) => {
662
+ const e = ne(t), n = b(e?.diff);
657
663
  if (n) return n;
658
- for (const o of rt(t)) {
659
- const s = b(o.diff);
660
- if (s) return s;
664
+ for (const o of it(t)) {
665
+ const i = b(o.diff);
666
+ if (i) return i;
661
667
  }
662
- const i = ot(t).map((o) => o.diff).filter((o) => !!o);
663
- if (i.length > 0) return i.join(`
668
+ const s = lt(t).map((o) => o.diff).filter((o) => !!o);
669
+ if (s.length > 0) return s.join(`
664
670
  `);
665
671
  const r = b(e?.patchText);
666
- return r && Dn(r) ? r : null;
667
- }, Mn = (t) => {
672
+ return r && Mn(r) ? r : null;
673
+ }, En = (t) => {
668
674
  const e = /* @__PURE__ */ new Set(), n = [];
669
- for (const i of t)
670
- e.has(i.filePath) || (e.add(i.filePath), n.push({
675
+ for (const s of t)
676
+ e.has(s.filePath) || (e.add(s.filePath), n.push({
671
677
  kind: "diff",
672
- fileName: ve(i.filePath),
673
- filePath: i.filePath,
674
- additions: i.additions,
675
- deletions: i.deletions
678
+ fileName: ve(s.filePath),
679
+ filePath: s.filePath,
680
+ additions: s.additions,
681
+ deletions: s.deletions
676
682
  }));
677
683
  return n;
678
- }, zn = (t) => Array.from(new Set(t.map((e) => e.filePath))), be = (t) => {
679
- const e = ge(t);
684
+ }, Wn = (t) => Array.from(new Set(t.map((e) => e.filePath))), xe = (t) => {
685
+ const e = be(t);
680
686
  return b(t.state?.output) ?? b(e?.returnDisplay) ?? b(e?.preview) ?? b(e?.stdout);
681
- }, Ln = (t) => {
687
+ }, Nn = (t) => {
682
688
  const e = t.match(/<skill_content(?:\s+name="([^"]+)")?>([\s\S]*?)<\/skill_content>/);
683
689
  return e ? {
684
690
  skillName: b(e[1]) ?? void 0,
685
691
  content: b(e[2]) ?? ""
686
692
  } : null;
687
- }, On = (t) => {
688
- const e = ee(t);
693
+ }, Hn = (t) => {
694
+ const e = ne(t);
689
695
  return b(e?.name) ?? b(e?.skillName) ?? b(e?.skill) ?? b(e?.skill_name) ?? void 0;
690
- }, Wn = (t) => ({
696
+ }, jn = (t) => ({
691
697
  kind: "link",
692
698
  text: ve(t),
693
699
  filePath: t
694
- }), te = (t, e) => !nt(t.state?.status) || !t.state?.errorText ? e : [{
700
+ }), re = (t, e) => !st(t.state?.status) || !t.state?.errorText ? e : [{
695
701
  type: "comment",
696
702
  text: t.state.errorText
697
- }, ...e], En = (t) => {
698
- const e = Fn(t), n = ot(t), i = Z(t, void 0, "Apply patch"), r = xn(e ?? void 0);
699
- r.length > 0 ? i.push(...r) : i.push(...Mn(n));
700
- const o = [], s = Cn(e ?? void 0);
701
- for (const c of s)
703
+ }, ...e], Un = (t) => {
704
+ const e = Ln(t), n = lt(t), s = te(t, void 0, "Apply patch"), r = Tn(e ?? void 0);
705
+ r.length > 0 ? s.push(...r) : s.push(...En(n));
706
+ const o = [], i = In(e ?? void 0);
707
+ for (const c of i)
702
708
  o.push({
703
709
  type: "diff",
704
710
  language: "diff",
@@ -716,33 +722,33 @@ const Pn = {
716
722
  sideBySide: !1
717
723
  });
718
724
  if (o.length === 0) {
719
- const c = yn(e ?? void 0);
720
- c.length === 0 && c.push(...zn(n)), c.length > 0 && o.push({
725
+ const c = wn(e ?? void 0);
726
+ c.length === 0 && c.push(...Wn(n)), c.length > 0 && o.push({
721
727
  type: "references",
722
728
  references: c
723
729
  });
724
730
  }
725
731
  return {
726
- indicator: Q(t),
727
- title: i,
728
- blocks: te(t, o)
732
+ indicator: ee(t),
733
+ title: s,
734
+ blocks: re(t, o)
729
735
  };
730
- }, Hn = (t) => {
731
- const e = ee(t), n = ge(t), i = b(e?.filePath) ?? b(e?.file) ?? b(n?.filePath) ?? b(n?.file) ?? b(n?.path) ?? void 0, r = Z(t, void 0, "Read file");
732
- return i && r.push(Wn(i)), {
733
- indicator: Q(t),
736
+ }, qn = (t) => {
737
+ const e = ne(t), n = be(t), s = b(e?.filePath) ?? b(e?.file) ?? b(n?.filePath) ?? b(n?.file) ?? b(n?.path) ?? void 0, r = te(t, void 0, "Read file");
738
+ return s && r.push(jn(s)), {
739
+ indicator: ee(t),
734
740
  title: r,
735
- blocks: te(t, [])
741
+ blocks: re(t, [])
736
742
  };
737
- }, Nn = (t) => {
738
- const e = ee(t), n = ge(t), i = b(e?.command) ?? void 0, r = Z(t, i, "Run command"), o = [], s = be(t);
739
- s && o.push({
743
+ }, Vn = (t) => {
744
+ const e = ne(t), n = be(t), s = b(e?.command) ?? void 0, r = te(t, s, "Run command"), o = [], i = xe(t);
745
+ i && o.push({
740
746
  type: "code",
741
747
  language: "text",
742
- code: s
748
+ code: i
743
749
  });
744
750
  const c = b(n?.stderr);
745
- return c && c !== s && o.push({
751
+ return c && c !== i && o.push({
746
752
  type: "code",
747
753
  language: "text",
748
754
  code: c
@@ -750,69 +756,69 @@ const Pn = {
750
756
  type: "text",
751
757
  text: `Exit code: ${n.exitCode}`
752
758
  }), {
753
- indicator: Q(t),
759
+ indicator: ee(t),
754
760
  title: r,
755
- blocks: te(t, o)
761
+ blocks: re(t, o)
756
762
  };
757
- }, jn = (t) => {
758
- const e = ee(t), n = be(t), i = b(e?.pattern) ?? void 0, r = Z(t, i, "Search files"), o = n ? [{
763
+ }, Kn = (t) => {
764
+ const e = ne(t), n = xe(t), s = b(e?.pattern) ?? void 0, r = te(t, s, "Search files"), o = n ? [{
759
765
  type: "code",
760
766
  language: "text",
761
767
  code: n
762
768
  }] : [];
763
769
  return {
764
- indicator: Q(t),
770
+ indicator: ee(t),
765
771
  title: r,
766
- blocks: te(t, o)
772
+ blocks: re(t, o)
767
773
  };
768
- }, Un = (t) => {
769
- const e = ee(t), n = be(t), i = b(e?.pattern) ?? void 0, r = Z(t, i, "Find files"), o = [];
774
+ }, Gn = (t) => {
775
+ const e = ne(t), n = xe(t), s = b(e?.pattern) ?? void 0, r = te(t, s, "Find files"), o = [];
770
776
  if (n) {
771
- const s = n.split(/\r?\n/).map((c) => c.trim()).filter((c) => c.length > 0);
772
- s.length > 0 && o.push({
777
+ const i = n.split(/\r?\n/).map((c) => c.trim()).filter((c) => c.length > 0);
778
+ i.length > 0 && o.push({
773
779
  type: "references",
774
- references: s
780
+ references: i
775
781
  });
776
782
  }
777
783
  return {
778
- indicator: Q(t),
784
+ indicator: ee(t),
779
785
  title: r,
780
- blocks: te(t, o)
786
+ blocks: re(t, o)
781
787
  };
782
- }, qn = (t) => {
783
- const e = be(t), n = e ? Ln(e) : null, i = On(t) ?? n?.skillName, r = Z(t, i, "Load skill"), o = n?.content ?? e, s = o ? [{
788
+ }, Yn = (t) => {
789
+ const e = xe(t), n = e ? Nn(e) : null, s = Hn(t) ?? n?.skillName, r = te(t, s, "Load skill"), o = n?.content ?? e, i = o ? [{
784
790
  type: "code",
785
791
  language: "markdown",
786
792
  code: o
787
793
  }] : [];
788
794
  return {
789
- indicator: Q(t),
795
+ indicator: ee(t),
790
796
  title: r,
791
- blocks: te(t, s)
797
+ blocks: re(t, i)
792
798
  };
793
- }, Le = () => ({
794
- apply_patch: En,
795
- read: Hn,
796
- bash: Nn,
797
- grep: jn,
798
- glob: Un,
799
- skill: qn
800
- }), Oe = {
799
+ }, We = () => ({
800
+ apply_patch: Un,
801
+ read: qn,
802
+ bash: Vn,
803
+ grep: Kn,
804
+ glob: Gn,
805
+ skill: Yn
806
+ }), Ne = {
801
807
  pending: "queued",
802
808
  error: "failed",
803
809
  "output-error": "failed",
804
810
  "input-streaming": "running",
805
811
  "input-available": "queued"
806
- }, it = (t) => t.replace(/^tool-/, ""), Vn = (t) => t.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), Gn = (t) => {
807
- const e = it(t ?? "tool").replace(/_/g, " ");
808
- return Vn(e);
809
- }, st = (t) => t === "error" || t === "output-error", Kn = (t) => st(t.state?.status) ? {
812
+ }, ct = (t) => t.replace(/^tool-/, ""), Jn = (t) => t.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), Xn = (t) => {
813
+ const e = ct(t ?? "tool").replace(/_/g, " ");
814
+ return Jn(e);
815
+ }, at = (t) => t === "error" || t === "output-error", Qn = (t) => at(t.state?.status) ? {
810
816
  type: "icon",
811
817
  icon: "danger"
812
818
  } : {
813
819
  type: "icon",
814
- icon: Qe(t.tool ?? "tool")
815
- }, Yn = (t) => !t || typeof t != "string" ? null : Oe[t] ? Oe[t] : t.includes("stream") ? "running" : null, We = (t) => {
820
+ icon: tt(t.tool ?? "tool")
821
+ }, Zn = (t) => !t || typeof t != "string" ? null : Ne[t] ? Ne[t] : t.includes("stream") ? "running" : null, He = (t) => {
816
822
  if (typeof t == "string") return t;
817
823
  if (t == null) return null;
818
824
  try {
@@ -820,197 +826,141 @@ const Pn = {
820
826
  } catch {
821
827
  return null;
822
828
  }
823
- }, Jn = (t) => {
829
+ }, er = (t) => {
824
830
  const e = [];
825
- st(t.state?.status) && t.state?.errorText && e.push({
831
+ at(t.state?.status) && t.state?.errorText && e.push({
826
832
  type: "comment",
827
833
  text: t.state.errorText
828
834
  });
829
- const n = We(t.state?.input);
835
+ const n = He(t.state?.input);
830
836
  n && e.push({
831
837
  type: "code",
832
838
  language: "json",
833
839
  code: n
834
840
  });
835
- const i = We(t.state?.output);
836
- return i && e.push({
841
+ const s = He(t.state?.output);
842
+ return s && e.push({
837
843
  type: "code",
838
844
  language: "json",
839
- code: i
845
+ code: s
840
846
  }), e;
841
- }, Xn = (t) => {
847
+ }, tr = (t) => {
842
848
  const e = [{
843
849
  kind: "text",
844
- text: Gn(t.tool),
850
+ text: Xn(t.tool),
845
851
  bold: !0
846
- }], n = Yn(t.state?.status);
852
+ }], n = Zn(t.state?.status);
847
853
  return n && e.push({
848
854
  kind: "text",
849
855
  text: n,
850
856
  muted: !0
851
857
  }), {
852
- indicator: Kn(t),
858
+ indicator: Qn(t),
853
859
  title: e,
854
- blocks: Jn(t)
860
+ blocks: er(t)
855
861
  };
856
- }, Qn = (t) => t ? {
857
- ...Le(),
862
+ }, nr = (t) => t ? {
863
+ ...We(),
858
864
  ...t
859
- } : Le(), Zn = (t, e) => {
865
+ } : We(), rr = (t, e) => {
860
866
  const n = t.tool ?? "tool";
861
- return e[n] ?? e[it(n)];
862
- }, er = (t, e, n) => {
863
- const i = Zn(t, e);
864
- if (i) {
865
- const r = i(t, n);
867
+ return e[n] ?? e[ct(n)];
868
+ }, or = (t, e, n) => {
869
+ const s = rr(t, e);
870
+ if (s) {
871
+ const r = s(t, n);
866
872
  if (r) return r;
867
873
  }
868
- return Xn(t);
869
- }, tr = (t, e) => {
870
- const n = Qn(e?.toolRenderers);
874
+ return tr(t);
875
+ }, sr = (t, e) => {
876
+ const n = nr(e?.toolRenderers);
871
877
  return {
872
- items: t.map((r) => er(r, n, e))
878
+ items: t.map((r) => or(r, n, e))
873
879
  };
874
- }, nr = {
875
- base: "vs-dark",
876
- inherit: !0,
877
- rules: [],
878
- colors: {
879
- "editor.background": "#0a0d15",
880
- "editor.foreground": "#f5f5f5",
881
- "editor.lineHighlightBackground": "#22252C",
882
- "editorCursor.foreground": "#A7A7A7",
883
- "editorWhitespace.foreground": "#3B3B3B",
884
- "editorIndentGuide.background": "#404040",
885
- "editorIndentGuide.activeBackground": "#707070"
886
- }
880
+ }, E = xt, dt = (t, e, n, s = !1) => {
881
+ s && t.stopPropagation(), e.href || t.preventDefault(), e.filePath && n?.(e.filePath);
887
882
  };
888
- function rr(t) {
889
- const e = y(11), {
890
- original: n,
891
- modified: i,
892
- language: r,
893
- sideBySide: o,
894
- disableScroll: s
895
- } = t, c = r === void 0 ? "plaintext" : r, d = o === void 0 ? !1 : o, a = s === void 0 ? !0 : s;
896
- let f;
897
- e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (f = {
898
- enabled: !1
899
- }, e[0] = f) : f = e[0];
900
- let u;
901
- e[1] !== a ? (u = a ? {
902
- scrollbar: {
903
- vertical: "hidden",
904
- horizontal: "hidden",
905
- useShadows: !1,
906
- alwaysConsumeMouseWheel: !1
907
- },
908
- overviewRulerLanes: 0
909
- } : {}, e[1] = a, e[2] = u) : u = e[2];
910
- let p;
911
- e[3] !== d || e[4] !== u ? (p = {
912
- renderSideBySide: d,
913
- readOnly: !0,
914
- fontSize: 11,
915
- minimap: f,
916
- wordWrap: "on",
917
- scrollBeyondLastLine: !1,
918
- ...u
919
- }, e[3] = d, e[4] = u, e[5] = p) : p = e[5];
920
- const m = p;
921
- let h;
922
- return e[6] !== c || e[7] !== i || e[8] !== m || e[9] !== n ? (h = /* @__PURE__ */ l(Ht, { width: "100%", height: "100%", original: n, modified: i, language: c, theme: "ps-theme", options: m, beforeMount: ir, onMount: or }), e[6] = c, e[7] = i, e[8] = m, e[9] = n, e[10] = h) : h = e[10], h;
923
- }
924
- function or(t, e) {
925
- e.editor.setTheme("ps-theme");
926
- }
927
883
  function ir(t) {
928
- t.editor.defineTheme("ps-theme", nr);
929
- }
930
- const E = mt, lt = (t, e, n, i = !1) => {
931
- i && t.stopPropagation(), e.href || t.preventDefault(), e.filePath && n?.(e.filePath);
932
- };
933
- function sr(t) {
934
884
  const e = y(6), {
935
885
  seg: n
936
886
  } = t;
937
- let i;
938
- e[0] !== n.alt || e[1] !== n.src ? (i = /* @__PURE__ */ l(X.Image, { src: n.src, alt: n.alt }), e[0] = n.alt, e[1] = n.src, e[2] = i) : i = e[2];
887
+ let s;
888
+ e[0] !== n.alt || e[1] !== n.src ? (s = /* @__PURE__ */ l(Z.Image, { src: n.src, alt: n.alt }), e[0] = n.alt, e[1] = n.src, e[2] = s) : s = e[2];
939
889
  let r;
940
- e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ l(X.Fallback, {}), e[3] = r) : r = e[3];
890
+ e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ l(Z.Fallback, {}), e[3] = r) : r = e[3];
941
891
  let o;
942
- return e[4] !== i ? (o = /* @__PURE__ */ x(X.Root, { width: "1.5rem", height: "1.5rem", children: [
943
- i,
892
+ return e[4] !== s ? (o = /* @__PURE__ */ x(Z.Root, { width: "1.5rem", height: "1.5rem", children: [
893
+ s,
944
894
  r
945
- ] }), e[4] = i, e[5] = o) : o = e[5], o;
895
+ ] }), e[4] = s, e[5] = o) : o = e[5], o;
946
896
  }
947
897
  function lr(t) {
948
898
  const e = y(9), {
949
899
  seg: n,
950
- onOpenFile: i
900
+ onOpenFile: s
951
901
  } = t, r = n.additions ?? 0, o = n.deletions ?? 0;
952
- let s;
953
- e[0] !== i || e[1] !== n.fileName || e[2] !== n.filePath ? (s = () => {
902
+ let i;
903
+ e[0] !== s || e[1] !== n.fileName || e[2] !== n.filePath ? (i = () => {
954
904
  const d = n.filePath ?? n.fileName;
955
- i?.(d);
956
- }, e[0] = i, e[1] = n.fileName, e[2] = n.filePath, e[3] = s) : s = e[3];
905
+ s?.(d);
906
+ }, e[0] = s, e[1] = n.fileName, e[2] = n.filePath, e[3] = i) : i = e[3];
957
907
  let c;
958
- return e[4] !== n.fileName || e[5] !== r || e[6] !== o || e[7] !== s ? (c = /* @__PURE__ */ l(Wt, { fileName: n.fileName, additions: r, deletions: o, onClickFileLink: s }), e[4] = n.fileName, e[5] = r, e[6] = o, e[7] = s, e[8] = c) : c = e[8], c;
908
+ return e[4] !== n.fileName || e[5] !== r || e[6] !== o || e[7] !== i ? (c = /* @__PURE__ */ l(Ut, { fileName: n.fileName, additions: r, deletions: o, onClickFileLink: i }), e[4] = n.fileName, e[5] = r, e[6] = o, e[7] = i, e[8] = c) : c = e[8], c;
959
909
  }
960
910
  function cr(t) {
961
911
  const e = y(13), {
962
912
  seg: n,
963
- onOpenFile: i
964
- } = t, r = n.bold ? "medium" : void 0, o = !!(n.href || n.filePath), s = n.href ?? "#", c = (n.muted, "fg.muted"), d = o ? "pointer" : "default";
913
+ onOpenFile: s
914
+ } = t, r = n.bold ? "medium" : void 0, o = !!(n.href || n.filePath), i = n.href ?? "#", c = (n.muted, "fg.muted"), d = o ? "pointer" : "default";
965
915
  let a;
966
- e[0] !== i || e[1] !== n ? (a = (m) => lt(m, n, i, !0), e[0] = i, e[1] = n, e[2] = a) : a = e[2];
967
- const f = n.muted ? "fg.muted" : "fg.blue-dark";
968
- let u;
969
- e[3] !== f ? (u = {
916
+ e[0] !== s || e[1] !== n ? (a = (m) => dt(m, n, s, !0), e[0] = s, e[1] = n, e[2] = a) : a = e[2];
917
+ const u = n.muted ? "fg.muted" : "fg.blue-dark";
918
+ let f;
919
+ e[3] !== u ? (f = {
970
920
  textDecoration: "underline",
971
- color: f
972
- }, e[3] = f, e[4] = u) : u = e[4];
921
+ color: u
922
+ }, e[3] = u, e[4] = f) : f = e[4];
973
923
  let p;
974
- return e[5] !== r || e[6] !== n.text || e[7] !== s || e[8] !== c || e[9] !== d || e[10] !== a || e[11] !== u ? (p = /* @__PURE__ */ l(je, { href: s, fontWeight: r, color: c, textDecoration: "none", cursor: d, onClick: a, _hover: u, children: n.text }), e[5] = r, e[6] = n.text, e[7] = s, e[8] = c, e[9] = d, e[10] = a, e[11] = u, e[12] = p) : p = e[12], p;
924
+ return e[5] !== r || e[6] !== n.text || e[7] !== i || e[8] !== c || e[9] !== d || e[10] !== a || e[11] !== f ? (p = /* @__PURE__ */ l(Ve, { href: i, fontWeight: r, color: c, textDecoration: "none", cursor: d, onClick: a, _hover: f, children: n.text }), e[5] = r, e[6] = n.text, e[7] = i, e[8] = c, e[9] = d, e[10] = a, e[11] = f, e[12] = p) : p = e[12], p;
975
925
  }
976
926
  function ar(t) {
977
927
  const e = y(12), {
978
928
  seg: n,
979
- onOpenFile: i
980
- } = t, r = n.bold ? "medium" : void 0, o = n.href ?? "#", s = n.muted ? "fg.muted" : "accent.primary";
929
+ onOpenFile: s
930
+ } = t, r = n.bold ? "medium" : void 0, o = n.href ?? "#", i = n.muted ? "fg.muted" : "accent.primary";
981
931
  let c;
982
- e[0] !== i || e[1] !== n ? (c = (u) => lt(u, n, i), e[0] = i, e[1] = n, e[2] = c) : c = e[2];
932
+ e[0] !== s || e[1] !== n ? (c = (f) => dt(f, n, s), e[0] = s, e[1] = n, e[2] = c) : c = e[2];
983
933
  const d = n.muted ? "fg.muted" : "accent.primary";
984
934
  let a;
985
935
  e[3] !== d ? (a = {
986
936
  color: d,
987
937
  textDecoration: "underline"
988
938
  }, e[3] = d, e[4] = a) : a = e[4];
989
- let f;
990
- return e[5] !== r || e[6] !== n.text || e[7] !== o || e[8] !== s || e[9] !== c || e[10] !== a ? (f = /* @__PURE__ */ l(je, { href: o, fontWeight: r, color: s, textDecoration: "underline", onClick: c, _hover: a, children: n.text }), e[5] = r, e[6] = n.text, e[7] = o, e[8] = s, e[9] = c, e[10] = a, e[11] = f) : f = e[11], f;
939
+ let u;
940
+ return e[5] !== r || e[6] !== n.text || e[7] !== o || e[8] !== i || e[9] !== c || e[10] !== a ? (u = /* @__PURE__ */ l(Ve, { href: o, fontWeight: r, color: i, textDecoration: "underline", onClick: c, _hover: a, children: n.text }), e[5] = r, e[6] = n.text, e[7] = o, e[8] = i, e[9] = c, e[10] = a, e[11] = u) : u = e[11], u;
991
941
  }
992
942
  function dr(t) {
993
943
  const e = y(6), {
994
944
  seg: n,
995
- isClickable: i
996
- } = t, r = n.bold ? "medium" : void 0, o = i && !n.muted ? "fg" : "fg.muted";
997
- let s;
998
- e[0] !== o ? (s = {
945
+ isClickable: s
946
+ } = t, r = n.bold ? "medium" : void 0, o = s && !n.muted ? "fg" : "fg.muted";
947
+ let i;
948
+ e[0] !== o ? (i = {
999
949
  color: o
1000
- }, e[0] = o, e[1] = s) : s = e[1];
950
+ }, e[0] = o, e[1] = i) : i = e[1];
1001
951
  let c;
1002
- return e[2] !== n.text || e[3] !== r || e[4] !== s ? (c = /* @__PURE__ */ l(ie, { fontWeight: r, color: "fg.muted", _groupHover: s, children: n.text }), e[2] = n.text, e[3] = r, e[4] = s, e[5] = c) : c = e[5], c;
952
+ return e[2] !== n.text || e[3] !== r || e[4] !== i ? (c = /* @__PURE__ */ l(se, { fontWeight: r, color: "fg.muted", _groupHover: i, children: n.text }), e[2] = n.text, e[3] = r, e[4] = i, e[5] = c) : c = e[5], c;
1003
953
  }
1004
954
  function ur(t) {
1005
955
  const e = y(11), {
1006
956
  seg: n,
1007
- isClickable: i,
957
+ isClickable: s,
1008
958
  onOpenFile: r
1009
959
  } = t;
1010
960
  switch (n.kind) {
1011
961
  case "avatar": {
1012
962
  let o;
1013
- return e[0] !== n ? (o = /* @__PURE__ */ l(sr, { seg: n }), e[0] = n, e[1] = o) : o = e[1], o;
963
+ return e[0] !== n ? (o = /* @__PURE__ */ l(ir, { seg: n }), e[0] = n, e[1] = o) : o = e[1], o;
1014
964
  }
1015
965
  case "diff": {
1016
966
  let o;
@@ -1022,7 +972,7 @@ function ur(t) {
1022
972
  }
1023
973
  case "text": {
1024
974
  let o;
1025
- return e[8] !== i || e[9] !== n ? (o = /* @__PURE__ */ l(dr, { seg: n, isClickable: i }), e[8] = i, e[9] = n, e[10] = o) : o = e[10], o;
975
+ return e[8] !== s || e[9] !== n ? (o = /* @__PURE__ */ l(dr, { seg: n, isClickable: s }), e[8] = s, e[9] = n, e[10] = o) : o = e[10], o;
1026
976
  }
1027
977
  default:
1028
978
  return null;
@@ -1035,148 +985,148 @@ function fr(t) {
1035
985
  if (!n || n.type === "none")
1036
986
  return null;
1037
987
  if (n.type === "icon") {
1038
- let s;
1039
- e[0] !== n.icon ? (s = un(n.icon), e[0] = n.icon, e[1] = s) : s = e[1];
1040
- const c = s;
988
+ let i;
989
+ e[0] !== n.icon ? (i = hn(n.icon), e[0] = n.icon, e[1] = i) : i = e[1];
990
+ const c = i;
1041
991
  let d;
1042
- return e[2] !== c ? (d = /* @__PURE__ */ l(E.Indicator, { outline: "none", shadow: "none", border: "none", background: "bg", color: "fg", children: /* @__PURE__ */ l(ie, { display: "inline-flex", alignItems: "center", children: /* @__PURE__ */ l(c, { size: 14, strokeWidth: 1 }) }) }), e[2] = c, e[3] = d) : d = e[3], d;
992
+ return e[2] !== c ? (d = /* @__PURE__ */ l(E.Indicator, { outline: "none", shadow: "none", border: "none", background: "bg", color: "fg", children: /* @__PURE__ */ l(se, { display: "inline-flex", alignItems: "center", children: /* @__PURE__ */ l(c, { size: 14, strokeWidth: 1 }) }) }), e[2] = c, e[3] = d) : d = e[3], d;
1043
993
  }
1044
- let i;
1045
- e[4] !== n.alt || e[5] !== n.src ? (i = /* @__PURE__ */ l(X.Image, { src: n.src, alt: n.alt }), e[4] = n.alt, e[5] = n.src, e[6] = i) : i = e[6];
994
+ let s;
995
+ e[4] !== n.alt || e[5] !== n.src ? (s = /* @__PURE__ */ l(Z.Image, { src: n.src, alt: n.alt }), e[4] = n.alt, e[5] = n.src, e[6] = s) : s = e[6];
1046
996
  let r;
1047
- e[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ l(X.Fallback, {}), e[7] = r) : r = e[7];
997
+ e[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (r = /* @__PURE__ */ l(Z.Fallback, {}), e[7] = r) : r = e[7];
1048
998
  let o;
1049
- return e[8] !== i ? (o = /* @__PURE__ */ l(E.Indicator, { children: /* @__PURE__ */ x(X.Root, { boxSize: "full", children: [
1050
- i,
999
+ return e[8] !== s ? (o = /* @__PURE__ */ l(E.Indicator, { children: /* @__PURE__ */ x(Z.Root, { boxSize: "full", children: [
1000
+ s,
1051
1001
  r
1052
- ] }) }), e[8] = i, e[9] = o) : o = e[9], o;
1002
+ ] }) }), e[8] = s, e[9] = o) : o = e[9], o;
1053
1003
  }
1054
1004
  function pr(t) {
1055
1005
  const e = y(5), {
1056
1006
  code: n,
1057
- language: i
1058
- } = t, r = i ? `${i} code block` : "code block";
1007
+ language: s
1008
+ } = t, r = s ? `${s} code block` : "code block";
1059
1009
  let o;
1060
1010
  e[0] !== n ? (o = /* @__PURE__ */ l(T, { as: "code", children: n }), e[0] = n, e[1] = o) : o = e[1];
1061
- let s;
1062
- return e[2] !== r || e[3] !== o ? (s = /* @__PURE__ */ l(T, { as: "pre", background: "bg.muted", color: "fg", borderRadius: "md", padding: "sm", fontFamily: "mono", fontSize: "xs", lineHeight: "shorter", overflowX: "auto", whiteSpace: "pre", "aria-label": r, children: o }), e[2] = r, e[3] = o, e[4] = s) : s = e[4], s;
1011
+ let i;
1012
+ return e[2] !== r || e[3] !== o ? (i = /* @__PURE__ */ l(T, { as: "pre", background: "bg.muted", color: "fg", borderRadius: "md", padding: "sm", fontFamily: "mono", fontSize: "xs", lineHeight: "shorter", overflowX: "auto", whiteSpace: "pre", "aria-label": r, children: o }), e[2] = r, e[3] = o, e[4] = i) : i = e[4], i;
1063
1013
  }
1064
1014
  function mr(t) {
1065
1015
  const e = y(26), {
1066
1016
  b: n,
1067
- onOpenFile: i
1017
+ onOpenFile: s
1068
1018
  } = t;
1069
1019
  switch (n.type) {
1070
1020
  case "comment": {
1071
1021
  let r;
1072
- e[0] !== n.text ? (r = /* @__PURE__ */ l(L.Body, { children: n.text }), e[0] = n.text, e[1] = r) : r = e[1];
1022
+ e[0] !== n.text ? (r = /* @__PURE__ */ l(M.Body, { children: n.text }), e[0] = n.text, e[1] = r) : r = e[1];
1073
1023
  let o;
1074
- e[2] !== n.reactions ? (o = n.reactions?.clap ? /* @__PURE__ */ l(L.Footer, { children: /* @__PURE__ */ x(Re, { children: [
1024
+ e[2] !== n.reactions ? (o = n.reactions?.clap ? /* @__PURE__ */ l(M.Footer, { children: /* @__PURE__ */ x(Ae, { children: [
1075
1025
  "👏 ",
1076
1026
  n.reactions.clap
1077
1027
  ] }) }) : null, e[2] = n.reactions, e[3] = o) : o = e[3];
1078
- let s;
1079
- return e[4] !== r || e[5] !== o ? (s = /* @__PURE__ */ x(L.Root, { children: [
1028
+ let i;
1029
+ return e[4] !== r || e[5] !== o ? (i = /* @__PURE__ */ x(M.Root, { children: [
1080
1030
  r,
1081
1031
  o
1082
- ] }), e[4] = r, e[5] = o, e[6] = s) : s = e[6], s;
1032
+ ] }), e[4] = r, e[5] = o, e[6] = i) : i = e[6], i;
1083
1033
  }
1084
1034
  case "code": {
1085
1035
  let r;
1086
- return e[7] !== n.code || e[8] !== n.language ? (r = /* @__PURE__ */ l(L.Root, { border: "0", padding: "0", children: /* @__PURE__ */ l(L.Body, { padding: "0", children: /* @__PURE__ */ l(pr, { language: n.language, code: n.code }) }) }), e[7] = n.code, e[8] = n.language, e[9] = r) : r = e[9], r;
1036
+ return e[7] !== n.code || e[8] !== n.language ? (r = /* @__PURE__ */ l(M.Root, { border: "0", padding: "0", children: /* @__PURE__ */ l(M.Body, { padding: "0", children: /* @__PURE__ */ l(pr, { language: n.language, code: n.code }) }) }), e[7] = n.code, e[8] = n.language, e[9] = r) : r = e[9], r;
1087
1037
  }
1088
1038
  case "diff": {
1089
1039
  const r = n.sideBySide ?? !1;
1090
1040
  let o;
1091
- return e[10] !== n.language || e[11] !== n.modified || e[12] !== n.original || e[13] !== r ? (o = /* @__PURE__ */ l(L.Root, { border: "0", padding: "0", children: /* @__PURE__ */ l(L.Body, { padding: "0", children: /* @__PURE__ */ l(T, { height: "240px", minW: "320px", overflow: "hidden", children: /* @__PURE__ */ l(rr, { original: n.original, modified: n.modified, language: n.language, sideBySide: r, disableScroll: !0 }) }) }) }), e[10] = n.language, e[11] = n.modified, e[12] = n.original, e[13] = r, e[14] = o) : o = e[14], o;
1041
+ return e[10] !== n.language || e[11] !== n.modified || e[12] !== n.original || e[13] !== r ? (o = /* @__PURE__ */ l(M.Root, { border: "0", padding: "0", children: /* @__PURE__ */ l(M.Body, { padding: "0", children: /* @__PURE__ */ l(T, { height: "240px", minW: "320px", overflow: "hidden", children: /* @__PURE__ */ l(jt, { original: n.original, modified: n.modified, language: n.language, sideBySide: r, disableScroll: !0 }) }) }) }), e[10] = n.language, e[11] = n.modified, e[12] = n.original, e[13] = r, e[14] = o) : o = e[14], o;
1092
1042
  }
1093
1043
  case "text": {
1094
1044
  let r;
1095
- return e[15] !== n.text ? (r = /* @__PURE__ */ l(L.Root, { background: "transparent", children: /* @__PURE__ */ l(L.Body, { padding: "sm", children: /* @__PURE__ */ l(J, { textStyle: "label/S/regular", children: n.text }) }) }), e[15] = n.text, e[16] = r) : r = e[16], r;
1045
+ return e[15] !== n.text ? (r = /* @__PURE__ */ l(M.Root, { background: "transparent", children: /* @__PURE__ */ l(M.Body, { padding: "sm", children: /* @__PURE__ */ l(Q, { textStyle: "label/S/regular", children: n.text }) }) }), e[15] = n.text, e[16] = r) : r = e[16], r;
1096
1046
  }
1097
1047
  case "references": {
1098
1048
  let r;
1099
1049
  e[17] !== n.references ? (r = n.references.map(hr), e[17] = n.references, e[18] = r) : r = e[18];
1100
1050
  let o;
1101
- return e[19] !== r ? (o = /* @__PURE__ */ l(Ue, { mt: "xs", gap: "xs", flexDir: "row", flexWrap: "wrap", children: r }), e[19] = r, e[20] = o) : o = e[20], o;
1051
+ return e[19] !== r ? (o = /* @__PURE__ */ l(Ke, { mt: "xs", gap: "xs", flexDir: "row", flexWrap: "wrap", children: r }), e[19] = r, e[20] = o) : o = e[20], o;
1102
1052
  }
1103
1053
  case "component": {
1104
1054
  let r;
1105
- e[21] !== n || e[22] !== i ? (r = n.render({
1106
- onOpenFile: i
1107
- }), e[21] = n, e[22] = i, e[23] = r) : r = e[23];
1055
+ e[21] !== n || e[22] !== s ? (r = n.render({
1056
+ onOpenFile: s
1057
+ }), e[21] = n, e[22] = s, e[23] = r) : r = e[23];
1108
1058
  let o;
1109
- return e[24] !== r ? (o = /* @__PURE__ */ l(Ie, { children: r }), e[24] = r, e[25] = o) : o = e[25], o;
1059
+ return e[24] !== r ? (o = /* @__PURE__ */ l(De, { children: r }), e[24] = r, e[25] = o) : o = e[25], o;
1110
1060
  }
1111
1061
  }
1112
1062
  }
1113
1063
  function hr(t) {
1114
- return /* @__PURE__ */ l(Ot, { fileName: t }, t);
1064
+ return /* @__PURE__ */ l(Ht, { fileName: t }, t);
1115
1065
  }
1116
1066
  function gr(t) {
1117
1067
  const e = y(22), {
1118
1068
  item: n,
1119
- itemKey: i,
1069
+ itemKey: s,
1120
1070
  isOpen: r,
1121
1071
  canExpand: o,
1122
- hasBlocks: s,
1072
+ hasBlocks: i,
1123
1073
  onToggle: c,
1124
1074
  onOpenFile: d
1125
1075
  } = t;
1126
1076
  let a;
1127
1077
  e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (a = /* @__PURE__ */ l(E.Separator, {}), e[0] = a) : a = e[0];
1128
- let f;
1129
- e[1] !== n.indicator ? (f = /* @__PURE__ */ x(E.Connector, { children: [
1078
+ let u;
1079
+ e[1] !== n.indicator ? (u = /* @__PURE__ */ x(E.Connector, { children: [
1130
1080
  a,
1131
1081
  /* @__PURE__ */ l(fr, { ind: n.indicator })
1132
- ] }), e[1] = n.indicator, e[2] = f) : f = e[2];
1133
- let u;
1134
- e[3] !== o || e[4] !== r || e[5] !== n.title || e[6] !== i || e[7] !== d || e[8] !== c ? (u = n.title.length > 0 && /* @__PURE__ */ l(E.Title, { className: "group", fontWeight: "normal", display: "flex", alignItems: "center", justifyContent: "space-between", cursor: o ? "pointer" : "default", onClick: o ? () => c(i) : void 0, children: /* @__PURE__ */ x(ie, { display: "inline-flex", alignItems: "center", gap: "sm", flexWrap: "wrap", children: [
1135
- /* @__PURE__ */ l(ie, { display: "inline-flex", alignItems: "center", gap: "xs", flexWrap: "wrap", children: n.title.map((g, S) => /* @__PURE__ */ l(ur, { seg: g, isClickable: o, onOpenFile: d }, S)) }),
1136
- o ? /* @__PURE__ */ l(ie, { display: "inline-flex", alignItems: "center", transition: "transform 200ms ease, color 200ms ease", transform: r ? "rotate(0deg)" : "rotate(-180deg)", color: "transparent", _groupHover: {
1082
+ ] }), e[1] = n.indicator, e[2] = u) : u = e[2];
1083
+ let f;
1084
+ e[3] !== o || e[4] !== r || e[5] !== n.title || e[6] !== s || e[7] !== d || e[8] !== c ? (f = n.title.length > 0 && /* @__PURE__ */ l(E.Title, { className: "group", fontWeight: "normal", display: "flex", alignItems: "center", justifyContent: "space-between", cursor: o ? "pointer" : "default", onClick: o ? () => c(s) : void 0, children: /* @__PURE__ */ x(se, { display: "inline-flex", alignItems: "center", gap: "sm", flexWrap: "wrap", children: [
1085
+ /* @__PURE__ */ l(se, { display: "inline-flex", alignItems: "center", gap: "xs", flexWrap: "wrap", children: n.title.map((g, S) => /* @__PURE__ */ l(ur, { seg: g, isClickable: o, onOpenFile: d }, S)) }),
1086
+ o ? /* @__PURE__ */ l(se, { display: "inline-flex", alignItems: "center", transition: "transform 200ms ease, color 200ms ease", transform: r ? "rotate(0deg)" : "rotate(-180deg)", color: "transparent", _groupHover: {
1137
1087
  color: "fg"
1138
- }, children: /* @__PURE__ */ l(Ft, { size: 12 }) }) : null
1139
- ] }) }), e[3] = o, e[4] = r, e[5] = n.title, e[6] = i, e[7] = d, e[8] = c, e[9] = u) : u = e[9];
1088
+ }, children: /* @__PURE__ */ l(Lt, { size: 12 }) }) : null
1089
+ ] }) }), e[3] = o, e[4] = r, e[5] = n.title, e[6] = s, e[7] = d, e[8] = c, e[9] = f) : f = e[9];
1140
1090
  let p;
1141
- e[10] !== s || e[11] !== r || e[12] !== n.blocks || e[13] !== d ? (p = s ? /* @__PURE__ */ l(T, { display: "grid", gridTemplateRows: r ? "1fr" : "0fr", transition: "grid-template-rows 220ms ease", children: r ? /* @__PURE__ */ l(T, { overflow: "hidden", opacity: 1, transform: "translateY(0)", transition: "opacity 200ms ease, transform 200ms ease", children: n.blocks.map((g, S) => /* @__PURE__ */ l(T, { children: /* @__PURE__ */ l(mr, { b: g, onOpenFile: d }) }, S)) }) : null }) : null, e[10] = s, e[11] = r, e[12] = n.blocks, e[13] = d, e[14] = p) : p = e[14];
1091
+ e[10] !== i || e[11] !== r || e[12] !== n.blocks || e[13] !== d ? (p = i ? /* @__PURE__ */ l(T, { display: "grid", gridTemplateRows: r ? "1fr" : "0fr", transition: "grid-template-rows 220ms ease", children: r ? /* @__PURE__ */ l(T, { overflow: "hidden", opacity: 1, transform: "translateY(0)", transition: "opacity 200ms ease, transform 200ms ease", children: n.blocks.map((g, S) => /* @__PURE__ */ l(T, { children: /* @__PURE__ */ l(mr, { b: g, onOpenFile: d }) }, S)) }) : null }) : null, e[10] = i, e[11] = r, e[12] = n.blocks, e[13] = d, e[14] = p) : p = e[14];
1142
1092
  let m;
1143
- e[15] !== u || e[16] !== p ? (m = /* @__PURE__ */ x(E.Content, { pb: "xs", children: [
1144
- u,
1093
+ e[15] !== f || e[16] !== p ? (m = /* @__PURE__ */ x(E.Content, { pb: "xs", children: [
1094
+ f,
1145
1095
  p
1146
- ] }), e[15] = u, e[16] = p, e[17] = m) : m = e[17];
1096
+ ] }), e[15] = f, e[16] = p, e[17] = m) : m = e[17];
1147
1097
  let h;
1148
- return e[18] !== i || e[19] !== f || e[20] !== m ? (h = /* @__PURE__ */ x(E.Item, { gap: "xs", children: [
1149
- f,
1098
+ return e[18] !== s || e[19] !== u || e[20] !== m ? (h = /* @__PURE__ */ x(E.Item, { gap: "xs", children: [
1099
+ u,
1150
1100
  m
1151
- ] }, i), e[18] = i, e[19] = f, e[20] = m, e[21] = h) : h = e[21], h;
1101
+ ] }, s), e[18] = s, e[19] = u, e[20] = m, e[21] = h) : h = e[21], h;
1152
1102
  }
1153
1103
  function br(t) {
1154
1104
  const e = y(11), {
1155
1105
  data: n,
1156
- onOpenFile: i
1106
+ onOpenFile: s
1157
1107
  } = t;
1158
1108
  let r;
1159
1109
  e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (r = {}, e[0] = r) : r = e[0];
1160
- const [o, s] = oe(r), c = xr;
1110
+ const [o, i] = oe(r), c = xr;
1161
1111
  let d;
1162
1112
  e[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = (p) => {
1163
- s((m) => ({
1113
+ i((m) => ({
1164
1114
  ...m,
1165
1115
  [p]: !m[p]
1166
1116
  }));
1167
1117
  }, e[1] = d) : d = e[1];
1168
1118
  const a = d;
1169
- let f;
1170
- if (e[2] !== n.items || e[3] !== o || e[4] !== i) {
1119
+ let u;
1120
+ if (e[2] !== n.items || e[3] !== o || e[4] !== s) {
1171
1121
  let p;
1172
- e[6] !== o || e[7] !== i ? (p = (m, h) => {
1122
+ e[6] !== o || e[7] !== s ? (p = (m, h) => {
1173
1123
  const g = c(m, h), S = (m.blocks?.length ?? 0) > 0, k = (m.expandable ?? !0) && S, P = k ? o[g] ?? !1 : S;
1174
- return /* @__PURE__ */ l(gr, { item: m, itemKey: g, isOpen: P, canExpand: k, hasBlocks: S, onToggle: a, onOpenFile: i }, g);
1175
- }, e[6] = o, e[7] = i, e[8] = p) : p = e[8], f = n.items.map(p), e[2] = n.items, e[3] = o, e[4] = i, e[5] = f;
1124
+ return /* @__PURE__ */ l(gr, { item: m, itemKey: g, isOpen: P, canExpand: k, hasBlocks: S, onToggle: a, onOpenFile: s }, g);
1125
+ }, e[6] = o, e[7] = s, e[8] = p) : p = e[8], u = n.items.map(p), e[2] = n.items, e[3] = o, e[4] = s, e[5] = u;
1176
1126
  } else
1177
- f = e[5];
1178
- let u;
1179
- return e[9] !== f ? (u = /* @__PURE__ */ l(E.Root, { children: f }), e[9] = f, e[10] = u) : u = e[10], u;
1127
+ u = e[5];
1128
+ let f;
1129
+ return e[9] !== u ? (f = /* @__PURE__ */ l(E.Root, { children: u }), e[9] = u, e[10] = f) : f = e[10], f;
1180
1130
  }
1181
1131
  function xr(t, e) {
1182
1132
  return t.id ? `id:${t.id}` : `idx:${e}`;
@@ -1184,16 +1134,16 @@ function xr(t, e) {
1184
1134
  function yr(t) {
1185
1135
  const e = y(6), {
1186
1136
  invocations: n,
1187
- labeledBlocks: i,
1137
+ labeledBlocks: s,
1188
1138
  onOpenFile: r
1189
1139
  } = t;
1190
1140
  let o;
1191
- e[0] !== n || e[1] !== i ? (o = tr(n, {
1192
- labeledBlocks: i
1193
- }), e[0] = n, e[1] = i, e[2] = o) : o = e[2];
1194
- const s = o;
1141
+ e[0] !== n || e[1] !== s ? (o = sr(n, {
1142
+ labeledBlocks: s
1143
+ }), e[0] = n, e[1] = s, e[2] = o) : o = e[2];
1144
+ const i = o;
1195
1145
  let c;
1196
- return e[3] !== s || e[4] !== r ? (c = /* @__PURE__ */ l(br, { data: s, onOpenFile: r }), e[3] = s, e[4] = r, e[5] = c) : c = e[5], c;
1146
+ return e[3] !== i || e[4] !== r ? (c = /* @__PURE__ */ l(br, { data: i, onOpenFile: r }), e[3] = i, e[4] = r, e[5] = c) : c = e[5], c;
1197
1147
  }
1198
1148
  const Sr = (t) => t.type === "tool", Be = (t) => t >= 1e3 ? `${(t / 1e3).toFixed(1)}k` : String(t), kr = (t) => {
1199
1149
  switch (t) {
@@ -1208,34 +1158,34 @@ const Sr = (t) => t.type === "tool", Be = (t) => t >= 1e3 ? `${(t / 1e3).toFixed
1208
1158
  }
1209
1159
  }, Tr = (t, e) => {
1210
1160
  const n = [];
1211
- let i = e;
1212
- for (; i < t.length; ) {
1213
- const r = t[i];
1161
+ let s = e;
1162
+ for (; s < t.length; ) {
1163
+ const r = t[s];
1214
1164
  if (!Sr(r)) break;
1215
- n.push(r), i += 1;
1165
+ n.push(r), s += 1;
1216
1166
  }
1217
1167
  return {
1218
1168
  invocations: n,
1219
- nextIndex: i - 1
1169
+ nextIndex: s - 1
1220
1170
  };
1221
1171
  };
1222
1172
  function wr(t) {
1223
1173
  const e = y(7), {
1224
1174
  message: n,
1225
- onOpenFile: i,
1175
+ onOpenFile: s,
1226
1176
  toolInvocationTimeline: r
1227
1177
  } = t, o = r ?? yr;
1228
- let s;
1229
- e[0] !== n.parts ? (s = n.parts ?? [], e[0] = n.parts, e[1] = s) : s = e[1];
1230
- const c = s;
1178
+ let i;
1179
+ e[0] !== n.parts ? (i = n.parts ?? [], e[0] = n.parts, e[1] = i) : i = e[1];
1180
+ const c = i;
1231
1181
  let d;
1232
- if (e[2] !== o || e[3] !== n.id || e[4] !== i || e[5] !== c) {
1182
+ if (e[2] !== o || e[3] !== n.id || e[4] !== s || e[5] !== c) {
1233
1183
  const a = [];
1234
- for (let f = 0; f < c.length; f = f + 1, f) {
1235
- const u = c[f], p = `${n.id}-${f}`;
1236
- e: switch (u.type) {
1184
+ for (let u = 0; u < c.length; u = u + 1, u) {
1185
+ const f = c[u], p = `${n.id}-${u}`;
1186
+ e: switch (f.type) {
1237
1187
  case "text": {
1238
- a.push(/* @__PURE__ */ l("div", { children: /* @__PURE__ */ l(cn, { children: u.text }) }, p));
1188
+ a.push(/* @__PURE__ */ l("div", { children: /* @__PURE__ */ l(fn, { children: f.text }) }, p));
1239
1189
  break e;
1240
1190
  }
1241
1191
  case "reasoning": {
@@ -1245,36 +1195,36 @@ function wr(t) {
1245
1195
  fontSize: ".75rem !important",
1246
1196
  fontWeight: "normal !important"
1247
1197
  }
1248
- }, children: /* @__PURE__ */ l(Je, { defaultState: u.text }) }, p));
1198
+ }, children: /* @__PURE__ */ l(Ze, { defaultState: f.text }) }, p));
1249
1199
  break e;
1250
1200
  }
1251
1201
  case "tool": {
1252
1202
  const {
1253
1203
  invocations: m,
1254
1204
  nextIndex: h
1255
- } = Tr(c, f);
1256
- f = h, a.push(/* @__PURE__ */ l(T, { width: "full", children: /* @__PURE__ */ l(o, { invocations: m, labeledBlocks: !0, onOpenFile: i }) }, p));
1205
+ } = Tr(c, u);
1206
+ u = h, a.push(/* @__PURE__ */ l(T, { width: "full", children: /* @__PURE__ */ l(o, { invocations: m, labeledBlocks: !0, onOpenFile: s }) }, p));
1257
1207
  break e;
1258
1208
  }
1259
1209
  case "loading": {
1260
1210
  a.push(/* @__PURE__ */ x(T, { display: "flex", alignItems: "center", gap: "2", py: "2", children: [
1261
- /* @__PURE__ */ l(ht, { size: "sm" }),
1262
- /* @__PURE__ */ l(J, { fontSize: "sm", color: "fg.muted", children: "Thinking..." })
1211
+ /* @__PURE__ */ l(yt, { size: "sm" }),
1212
+ /* @__PURE__ */ l(Q, { fontSize: "sm", color: "fg.muted", children: "Thinking..." })
1263
1213
  ] }, p));
1264
1214
  break e;
1265
1215
  }
1266
1216
  case "error": {
1267
- a.push(/* @__PURE__ */ l(T, { py: "2", children: /* @__PURE__ */ l(J, { fontSize: "sm", color: "fg.error", children: kr(u.errorType) }) }, p));
1217
+ a.push(/* @__PURE__ */ l(T, { py: "2", children: /* @__PURE__ */ l(Q, { fontSize: "sm", color: "fg.error", children: kr(f.errorType) }) }, p));
1268
1218
  break e;
1269
1219
  }
1270
1220
  case "token_usage": {
1271
- a.push(/* @__PURE__ */ l(T, { py: "1", children: /* @__PURE__ */ x(J, { fontSize: "xs", color: "fg.subtle", children: [
1221
+ a.push(/* @__PURE__ */ l(T, { py: "1", children: /* @__PURE__ */ x(Q, { fontSize: "xs", color: "fg.subtle", children: [
1272
1222
  "Tokens: ",
1273
- Be(u.inputTokens),
1223
+ Be(f.inputTokens),
1274
1224
  " in / ",
1275
- Be(u.outputTokens),
1225
+ Be(f.outputTokens),
1276
1226
  " out",
1277
- u.cacheReadTokens ? ` / ${Be(u.cacheReadTokens)} cache read` : ""
1227
+ f.cacheReadTokens ? ` / ${Be(f.cacheReadTokens)} cache read` : ""
1278
1228
  ] }) }, p));
1279
1229
  break e;
1280
1230
  }
@@ -1282,20 +1232,20 @@ function wr(t) {
1282
1232
  a.push(null);
1283
1233
  }
1284
1234
  }
1285
- d = /* @__PURE__ */ l(Ie, { children: a }), e[2] = o, e[3] = n.id, e[4] = i, e[5] = c, e[6] = d;
1235
+ d = /* @__PURE__ */ l(De, { children: a }), e[2] = o, e[3] = n.id, e[4] = s, e[5] = c, e[6] = d;
1286
1236
  } else
1287
1237
  d = e[6];
1288
1238
  return d;
1289
1239
  }
1290
1240
  const Cr = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "assistant", Pr = (t) => {
1291
1241
  const e = t.parts ?? [];
1292
- return e.length === 0 || e.some((i) => i.type === "text" && "text" in i) ? !1 : e.some((i) => i.type === "reasoning" || i.type === "tool");
1242
+ return e.length === 0 || e.some((s) => s.type === "text" && "text" in s) ? !1 : e.some((s) => s.type === "reasoning" || s.type === "tool");
1293
1243
  }, _r = (t) => {
1294
1244
  const e = [];
1295
1245
  for (const n of t) {
1296
- const i = e[e.length - 1];
1297
- if (i && i.role === n.role && Pr(n)) {
1298
- i.parts = [...i.parts ?? [], ...n.parts ?? []];
1246
+ const s = e[e.length - 1];
1247
+ if (s && s.role === n.role && Pr(n)) {
1248
+ s.parts = [...s.parts ?? [], ...n.parts ?? []];
1299
1249
  continue;
1300
1250
  }
1301
1251
  e.push({
@@ -1304,63 +1254,63 @@ const Cr = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "
1304
1254
  });
1305
1255
  }
1306
1256
  return e;
1307
- }, Br = sn(), ao = (t) => {
1257
+ }, Rr = dn(), co = (t) => {
1308
1258
  const e = y(43), {
1309
1259
  messages: n,
1310
- streaming: i,
1260
+ streaming: s,
1311
1261
  emptyStateTitle: r,
1312
1262
  emptyStateDescription: o,
1313
- chatInputPlaceholder: s,
1263
+ chatInputPlaceholder: i,
1314
1264
  onSubmitMessage: c,
1315
1265
  actions: d,
1316
1266
  repoMenu: a,
1317
- attachedResources: f,
1318
- onClearAttachments: u,
1267
+ attachedResources: u,
1268
+ onClearAttachments: f,
1319
1269
  attachmentList: p,
1320
1270
  approvalPrompt: m
1321
- } = t, h = i === void 0 ? !1 : i;
1322
- let g, S, k, P, A, I, D, v, $, _;
1271
+ } = t, h = s === void 0 ? !1 : s;
1272
+ let g, S, k, P, D, B, v, A, F, _;
1323
1273
  if (e[0] !== o || e[1] !== r || e[2] !== n || e[3] !== h) {
1324
- const ne = _r(n), N = ne.length > 0, re = ne.reduce(Rr, 0);
1325
- k = fe, I = "relative", D = "column", v = "full", $ = "full", _ = "hidden", S = _e.Root, A = /* @__PURE__ */ l(Zt, { userMessageCount: re }), g = _e.Viewport, P = N ? /* @__PURE__ */ l(Ue, { gap: "sm", children: ne.map((W) => {
1326
- const z = Cr(W.role);
1327
- return /* @__PURE__ */ l(Fe.Root, { from: z, children: /* @__PURE__ */ l(Fe.Content, { from: z, children: /* @__PURE__ */ l(wr, { message: W, streaming: h }) }) }, W.id);
1328
- }) }) : /* @__PURE__ */ l(Et, { icon: /* @__PURE__ */ l(Mt, { size: 48, strokeWidth: 1.5 }), title: r, description: o }), e[0] = o, e[1] = r, e[2] = n, e[3] = h, e[4] = g, e[5] = S, e[6] = k, e[7] = P, e[8] = A, e[9] = I, e[10] = D, e[11] = v, e[12] = $, e[13] = _;
1274
+ const N = _r(n), H = N.length > 0, ye = N.reduce(Ir, 0);
1275
+ k = pe, B = "relative", v = "column", A = "full", F = "full", _ = "hidden", S = Ie.Root, D = /* @__PURE__ */ l(rn, { userMessageCount: ye }), g = Ie.Viewport, P = H ? /* @__PURE__ */ l(Ke, { gap: "sm", children: N.map((L) => {
1276
+ const j = Cr(L.role);
1277
+ return /* @__PURE__ */ l(Oe.Root, { from: j, children: /* @__PURE__ */ l(Oe.Content, { from: j, children: /* @__PURE__ */ l(wr, { message: L, streaming: h }) }) }, L.id);
1278
+ }) }) : /* @__PURE__ */ l(qt, { icon: /* @__PURE__ */ l(Et, { size: 48, strokeWidth: 1.5 }), title: r, description: o }), e[0] = o, e[1] = r, e[2] = n, e[3] = h, e[4] = g, e[5] = S, e[6] = k, e[7] = P, e[8] = D, e[9] = B, e[10] = v, e[11] = A, e[12] = F, e[13] = _;
1329
1279
  } else
1330
- g = e[4], S = e[5], k = e[6], P = e[7], A = e[8], I = e[9], D = e[10], v = e[11], $ = e[12], _ = e[13];
1280
+ g = e[4], S = e[5], k = e[6], P = e[7], D = e[8], B = e[9], v = e[10], A = e[11], F = e[12], _ = e[13];
1331
1281
  let C;
1332
1282
  e[14] !== g || e[15] !== P ? (C = /* @__PURE__ */ l(g, { children: P }), e[14] = g, e[15] = P, e[16] = C) : C = e[16];
1333
1283
  let O;
1334
- e[17] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (O = /* @__PURE__ */ l(_e.ScrollToBottom, { "aria-label": "Scroll to latest message" }), e[17] = O) : O = e[17];
1335
- let F;
1336
- e[18] !== S || e[19] !== A || e[20] !== C ? (F = /* @__PURE__ */ x(S, { children: [
1337
- A,
1284
+ e[17] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (O = /* @__PURE__ */ l(Ie.ScrollToBottom, { "aria-label": "Scroll to latest message" }), e[17] = O) : O = e[17];
1285
+ let $;
1286
+ e[18] !== S || e[19] !== D || e[20] !== C ? ($ = /* @__PURE__ */ x(S, { children: [
1287
+ D,
1338
1288
  C,
1339
1289
  O
1340
- ] }), e[18] = S, e[19] = A, e[20] = C, e[21] = F) : F = e[21];
1341
- let B;
1342
- e[22] !== d || e[23] !== f || e[24] !== p || e[25] !== s || e[26] !== u || e[27] !== c || e[28] !== h ? (B = /* @__PURE__ */ l(T, { px: "sm", children: /* @__PURE__ */ l(tn, { placeholder: s, defaultState: Br, streaming: h, onSubmit: c, actions: d, attachedResources: f, onClearAttachments: u, attachmentList: p }) }), e[22] = d, e[23] = f, e[24] = p, e[25] = s, e[26] = u, e[27] = c, e[28] = h, e[29] = B) : B = e[29];
1290
+ ] }), e[18] = S, e[19] = D, e[20] = C, e[21] = $) : $ = e[21];
1343
1291
  let R;
1344
- e[30] !== a ? (R = /* @__PURE__ */ l(fe, { p: "2xs", justifyContent: "flex-end", children: a }), e[30] = a, e[31] = R) : R = e[31];
1345
- let M;
1346
- return e[32] !== k || e[33] !== m || e[34] !== F || e[35] !== B || e[36] !== R || e[37] !== I || e[38] !== D || e[39] !== v || e[40] !== $ || e[41] !== _ ? (M = /* @__PURE__ */ x(k, { position: I, direction: D, w: v, h: $, overflow: _, children: [
1347
- F,
1292
+ e[22] !== d || e[23] !== u || e[24] !== p || e[25] !== i || e[26] !== f || e[27] !== c || e[28] !== h ? (R = /* @__PURE__ */ l(T, { px: "sm", children: /* @__PURE__ */ l(sn, { placeholder: i, defaultState: Rr, streaming: h, onSubmit: c, actions: d, attachedResources: u, onClearAttachments: f, attachmentList: p }) }), e[22] = d, e[23] = u, e[24] = p, e[25] = i, e[26] = f, e[27] = c, e[28] = h, e[29] = R) : R = e[29];
1293
+ let I;
1294
+ e[30] !== a ? (I = /* @__PURE__ */ l(pe, { p: "2xs", justifyContent: "flex-end", children: a }), e[30] = a, e[31] = I) : I = e[31];
1295
+ let z;
1296
+ return e[32] !== k || e[33] !== m || e[34] !== $ || e[35] !== R || e[36] !== I || e[37] !== B || e[38] !== v || e[39] !== A || e[40] !== F || e[41] !== _ ? (z = /* @__PURE__ */ x(k, { position: B, direction: v, w: A, h: F, overflow: _, children: [
1297
+ $,
1348
1298
  m,
1349
- B,
1350
- R
1351
- ] }), e[32] = k, e[33] = m, e[34] = F, e[35] = B, e[36] = R, e[37] = I, e[38] = D, e[39] = v, e[40] = $, e[41] = _, e[42] = M) : M = e[42], M;
1299
+ R,
1300
+ I
1301
+ ] }), e[32] = k, e[33] = m, e[34] = $, e[35] = R, e[36] = I, e[37] = B, e[38] = v, e[39] = A, e[40] = F, e[41] = _, e[42] = z) : z = e[42], z;
1352
1302
  };
1353
- function Rr(t, e) {
1303
+ function Ir(t, e) {
1354
1304
  return t + (e.role === "user" ? 1 : 0);
1355
1305
  }
1356
1306
  export {
1357
- co as ApprovalPrompt,
1358
- Zt as AutoScroll,
1359
- tn as ChatInput,
1360
- Fe as ChatMessage,
1361
- ao as ChatPanel,
1362
- _e as ChatPrimitives,
1363
- en as SendButton,
1364
- sn as createSerializedPromptState
1307
+ lo as ApprovalPrompt,
1308
+ rn as AutoScroll,
1309
+ sn as ChatInput,
1310
+ Oe as ChatMessage,
1311
+ co as ChatPanel,
1312
+ Ie as ChatPrimitives,
1313
+ on as SendButton,
1314
+ dn as createSerializedPromptState
1365
1315
  };
1366
1316
  //# sourceMappingURL=chat-ui.js.map