@pstdio/ui 0.3.1 → 0.5.0

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