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