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