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