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