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