@pstdio/ui 0.2.1 → 0.2.2

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