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