@pstdio/ui 0.5.0 → 0.5.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{MermaidComponent-DwEDwpo2.js → MermaidComponent-DDCxR-Gs.js} +2 -2
- package/dist/{MermaidComponent-DwEDwpo2.js.map → MermaidComponent-DDCxR-Gs.js.map} +1 -1
- package/dist/chat-ui.js +1358 -877
- package/dist/chat-ui.js.map +1 -1
- package/dist/components/app-shell/app-shell.d.ts +1 -0
- package/dist/components/app-shell/command-palette.d.ts +16 -0
- package/dist/components/app-shell/file-tree.d.ts +7 -0
- package/dist/components/app-shell/mock-chat.d.ts +2 -0
- package/dist/components/app-shell/mock-data.d.ts +37 -0
- package/dist/components/app-shell/pages/project-list-page.d.ts +7 -0
- package/dist/components/app-shell/pages/sessions-page.d.ts +6 -0
- package/dist/components/app-shell/pages/settings-page.d.ts +5 -0
- package/dist/components/app-shell/pages/ticket-details-page.d.ts +7 -0
- package/dist/components/app-shell/pages/tickets-page.d.ts +7 -0
- package/dist/components/app-shell/pages/workspace-page.d.ts +1 -0
- package/dist/components/app-shell/resizable-panel.d.ts +13 -0
- package/dist/components/chat-ui/agent-types.d.ts +4 -0
- package/dist/components/chat-ui/components/ai-message.d.ts +7 -5
- package/dist/components/chat-ui/components/chat-input-question-prompt.d.ts +33 -0
- package/dist/components/chat-ui/components/chat-input.d.ts +4 -1
- package/dist/components/chat-ui/components/chat-panel-sticky-user-message.d.ts +9 -0
- package/dist/components/chat-ui/components/chat-panel.d.ts +4 -1
- package/dist/components/chat-ui/components/message-parts-renderer.d.ts +1 -0
- package/dist/components/chat-ui/components/timeline-tool-blocks.d.ts +14 -0
- package/dist/components/chat-ui/components/timeline.d.ts +22 -0
- package/dist/components/chat-ui/components/tool-invocation-timeline.d.ts +2 -1
- package/dist/components/chat-ui/index.d.ts +1 -0
- package/dist/components/chat-ui/mocks/library/index.d.ts +10 -0
- package/dist/components/chat-ui/tool-rendering/build-timeline.d.ts +2 -2
- package/dist/components/chat-ui/tool-rendering/default-renderers.d.ts +2 -0
- package/dist/components/chat-ui/tool-rendering/question-renderer.d.ts +10 -0
- package/dist/components/chat-ui/tool-rendering/shared.d.ts +1 -1
- package/dist/components/chat-ui/tool-rendering/todowrite-renderer.d.ts +10 -0
- package/dist/components/chat-ui/utils/get-icon.d.ts +2 -0
- package/dist/components/chat-ui/utils/tool-name.d.ts +2 -0
- package/dist/components/content-placeholder.d.ts +1 -0
- package/dist/components/header.d.ts +7 -0
- package/dist/components/list-row/list-row-actions.d.ts +10 -0
- package/dist/components/list-row/list-row.d.ts +2 -0
- package/dist/components/list-row/list-row.types.d.ts +85 -0
- package/dist/components/{sidebar-tree → list-row}/searchable-action-menu.d.ts +2 -2
- package/dist/components/panel-header.constants.d.ts +1 -1
- package/dist/components/radio.d.ts +8 -0
- package/dist/components/resource-context-menu.d.ts +1 -2
- package/dist/components/sidebar/sidebar-project-menu.d.ts +0 -3
- package/dist/components/sidebar/sidebar.store.d.ts +2 -0
- package/dist/components/sidebar/sidebar.types.d.ts +10 -4
- package/dist/components/tickets/ticket-board.d.ts +6 -2
- package/dist/components/tickets/ticket-list.d.ts +3 -0
- package/dist/components/tickets/tickets-workspace.d.ts +3 -0
- package/dist/components/tickets/workspace-helpers.d.ts +6 -1
- package/dist/components/tree-list/tree-list.d.ts +18 -0
- package/dist/components/tree-list/tree-list.types.d.ts +29 -0
- package/dist/index.d.ts +10 -5
- package/dist/index.js +2621 -2459
- package/dist/index.js.map +1 -1
- package/dist/radio-C42qncrD.js +236 -0
- package/dist/radio-C42qncrD.js.map +1 -0
- package/dist/{rich-message-BVRk9BSD.js → rich-message-DeJwzVeV.js} +364 -355
- package/dist/rich-message-DeJwzVeV.js.map +1 -0
- package/dist/rich-text.js +2 -2
- package/dist/style.css +1 -1
- package/dist/theme/custom/index.d.ts +3 -0
- package/dist/theme/custom/monokai.json.d.ts +80 -0
- package/dist/theme/index.d.ts +1 -0
- package/dist/theme/primitives/colors.d.ts +6 -0
- package/dist/theme/recipes/button.d.ts +34 -0
- package/dist/theme/recipes/kbd.d.ts +41 -0
- package/dist/theme/tokens/colors.d.ts +18 -6
- package/dist/{theme-D0VvFB1Y.js → theme-Dq4r3aRE.js} +247 -135
- package/dist/theme-Dq4r3aRE.js.map +1 -0
- package/dist/theme.js +4 -2
- package/dist/utils/apply-theme-preference.d.ts +20 -2
- package/dist/utils/theme-preference.d.ts +4 -2
- package/package.json +1 -2
- package/dist/components/chat-ui/tool-rendering/todo-write-renderer.d.ts +0 -2
- package/dist/components/drawer-inline.d.ts +0 -24
- package/dist/components/file-selector.d.ts +0 -12
- package/dist/components/menu-item.d.ts +0 -42
- package/dist/components/pstdio-logo.d.ts +0 -2
- package/dist/components/sidebar-tree/sidebar-node-content.d.ts +0 -9
- package/dist/components/sidebar-tree/sidebar-tree.d.ts +0 -13
- package/dist/components/sidebar-tree/sidebar-tree.types.d.ts +0 -68
- package/dist/empty-state-yGspgiPl.js +0 -185
- package/dist/empty-state-yGspgiPl.js.map +0 -1
- package/dist/rich-message-BVRk9BSD.js.map +0 -1
- package/dist/theme-D0VvFB1Y.js.map +0 -1
package/dist/chat-ui.js
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { c as
|
|
3
|
-
import { chakra as
|
|
4
|
-
import { ArrowDownIcon as
|
|
5
|
-
import { StickToBottom as
|
|
6
|
-
import { S as
|
|
7
|
-
import { useRef as
|
|
8
|
-
import { h as
|
|
1
|
+
import { jsx as l, jsxs as w, Fragment as It } from "react/jsx-runtime";
|
|
2
|
+
import { c as S } from "react/compiler-runtime";
|
|
3
|
+
import { chakra as _n, AbsoluteCenter as An, IconButton as Ut, defineSlotRecipe as Rn, createSlotRecipeContext as Bn, Text as F, Code as qt, Button as qe, HStack as Me, Box as M, Flex as fe, Stack as z, Textarea as In, Tooltip as tt, Portal as Pn, Kbd as Mn, Spacer as $n, Timeline as On, Span as Le, Avatar as Ie, Card as J, Link as Gt, Spinner as Pt, Skeleton as En } from "@chakra-ui/react";
|
|
4
|
+
import { ArrowDownIcon as Dn, ShieldX as Ln, ShieldCheck as qn, Check as vn, Square as Qn, ArrowUp as Fn, Move as zn, FileDown as Wn, FileUp as Hn, FileDiff as jn, Trash2 as Nn, FilePen as Vn, FileText as Un, ListTree as Gn, Terminal as Kt, ListTodo as Kn, CircleQuestionMark as Xn, File as Yn, Globe as Jn, Search as Zn, AlertTriangle as Xt, DotIcon as eo, ChevronUpIcon as to, MessageCircleIcon as no } from "lucide-react";
|
|
5
|
+
import { StickToBottom as oo, useStickToBottomContext as Mt } from "use-stick-to-bottom";
|
|
6
|
+
import { S as Yt, T as so } from "./get-file-type-icon-Bwqf1WXA.js";
|
|
7
|
+
import { useRef as nt, useEffect as De, useState as Z } from "react";
|
|
8
|
+
import { h as Tt, P as ro, g as io, R as Jt, i as lo } from "./rich-message-DeJwzVeV.js";
|
|
9
9
|
import "@lexical/react/LexicalCollaborationContext";
|
|
10
10
|
import "@lexical/react/LexicalCollaborationPlugin";
|
|
11
11
|
import "@lexical/react/LexicalComposer";
|
|
@@ -31,13 +31,13 @@ import "@lexical/react/LexicalCheckListPlugin";
|
|
|
31
31
|
import "@lexical/react/LexicalHistoryPlugin";
|
|
32
32
|
import "@lexical/react/LexicalOnChangePlugin";
|
|
33
33
|
import "@lexical/react/LexicalTreeView";
|
|
34
|
-
import {
|
|
35
|
-
const
|
|
34
|
+
import { C as Zt, R as co, a as ao, D as uo, b as en, A as vt, E as fo } from "./radio-C42qncrD.js";
|
|
35
|
+
const po = {
|
|
36
36
|
"aria-roledescription": "conversation",
|
|
37
37
|
initial: "instant",
|
|
38
38
|
resize: "instant",
|
|
39
39
|
role: "log"
|
|
40
|
-
},
|
|
40
|
+
}, mo = _n(oo, {
|
|
41
41
|
base: {
|
|
42
42
|
position: "relative",
|
|
43
43
|
flex: 1,
|
|
@@ -46,42 +46,42 @@ const kn = {
|
|
|
46
46
|
}
|
|
47
47
|
}, {
|
|
48
48
|
forwardProps: ["resize"],
|
|
49
|
-
defaultProps:
|
|
50
|
-
}),
|
|
51
|
-
const e =
|
|
52
|
-
let n,
|
|
49
|
+
defaultProps: po
|
|
50
|
+
}), ho = (t) => {
|
|
51
|
+
const e = S(9);
|
|
52
|
+
let n, s;
|
|
53
53
|
e[0] !== t ? ({
|
|
54
54
|
children: n,
|
|
55
|
-
...
|
|
56
|
-
} = t, e[0] = t, e[1] = n, e[2] =
|
|
55
|
+
...s
|
|
56
|
+
} = t, e[0] = t, e[1] = n, e[2] = s) : (n = e[1], s = e[2]);
|
|
57
57
|
const {
|
|
58
58
|
contentRef: o,
|
|
59
|
-
scrollRef:
|
|
60
|
-
} =
|
|
61
|
-
let
|
|
62
|
-
e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
63
|
-
|
|
59
|
+
scrollRef: r
|
|
60
|
+
} = Mt(), i = r, c = o;
|
|
61
|
+
let a;
|
|
62
|
+
e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (a = {
|
|
63
|
+
py: "sm",
|
|
64
64
|
"aria-live": "polite",
|
|
65
65
|
role: "list"
|
|
66
|
-
}, e[3] =
|
|
67
|
-
let
|
|
68
|
-
return e[4] !== n || e[5] !==
|
|
69
|
-
},
|
|
66
|
+
}, e[3] = a) : a = e[3];
|
|
67
|
+
let u;
|
|
68
|
+
return e[4] !== n || e[5] !== s || e[6] !== i || e[7] !== c ? (u = /* @__PURE__ */ l(Yt, { ...s, height: "full", width: "full", showHorizontalScrollbar: !1, viewportRef: i, contentRef: c, contentProps: a, children: n }), e[4] = n, e[5] = s, e[6] = i, e[7] = c, e[8] = u) : u = e[8], u;
|
|
69
|
+
}, go = {
|
|
70
70
|
axis: "horizontal",
|
|
71
71
|
bottom: "md",
|
|
72
72
|
zIndex: 2
|
|
73
|
-
},
|
|
74
|
-
const e =
|
|
73
|
+
}, bo = (t) => {
|
|
74
|
+
const e = S(4), {
|
|
75
75
|
isAtBottom: n,
|
|
76
|
-
scrollToBottom:
|
|
77
|
-
} =
|
|
76
|
+
scrollToBottom: s
|
|
77
|
+
} = Mt();
|
|
78
78
|
let o;
|
|
79
|
-
return e[0] !== n || e[1] !== t || e[2] !==
|
|
80
|
-
},
|
|
81
|
-
Root:
|
|
82
|
-
Viewport:
|
|
83
|
-
ScrollToBottom:
|
|
84
|
-
},
|
|
79
|
+
return e[0] !== n || e[1] !== t || e[2] !== s ? (o = !n && /* @__PURE__ */ l(An, { ...go, children: /* @__PURE__ */ l(Ut, { rounded: "full", onClick: () => s(), variant: "outline", size: "xs", ...t, children: /* @__PURE__ */ l(Dn, { size: 16 }) }) }), e[0] = n, e[1] = t, e[2] = s, e[3] = o) : o = e[3], o;
|
|
80
|
+
}, Ct = {
|
|
81
|
+
Root: mo,
|
|
82
|
+
Viewport: ho,
|
|
83
|
+
ScrollToBottom: bo
|
|
84
|
+
}, xo = Rn({
|
|
85
85
|
className: "ai-message",
|
|
86
86
|
slots: ["root", "content"],
|
|
87
87
|
base: {
|
|
@@ -103,7 +103,8 @@ const kn = {
|
|
|
103
103
|
flexDirection: "column",
|
|
104
104
|
gap: "sm",
|
|
105
105
|
textStyle: "sm",
|
|
106
|
-
overflow: "hidden"
|
|
106
|
+
overflow: "hidden",
|
|
107
|
+
borderRadius: "0"
|
|
107
108
|
}
|
|
108
109
|
},
|
|
109
110
|
variants: {
|
|
@@ -114,13 +115,14 @@ const kn = {
|
|
|
114
115
|
flexDirection: "row"
|
|
115
116
|
},
|
|
116
117
|
content: {
|
|
117
|
-
|
|
118
|
+
borderTopWidth: "1px",
|
|
119
|
+
borderBottomWidth: "1px",
|
|
118
120
|
borderColor: "border.muted",
|
|
119
121
|
bg: "bg.subtle",
|
|
120
122
|
px: "xs",
|
|
121
123
|
py: "xs",
|
|
122
124
|
width: "full",
|
|
123
|
-
|
|
125
|
+
borderRadius: "0"
|
|
124
126
|
}
|
|
125
127
|
},
|
|
126
128
|
assistant: {
|
|
@@ -130,7 +132,8 @@ const kn = {
|
|
|
130
132
|
justifyContent: "start"
|
|
131
133
|
},
|
|
132
134
|
content: {
|
|
133
|
-
width: "full"
|
|
135
|
+
width: "full",
|
|
136
|
+
px: "xs"
|
|
134
137
|
}
|
|
135
138
|
},
|
|
136
139
|
developer: {
|
|
@@ -165,17 +168,17 @@ const kn = {
|
|
|
165
168
|
shape: {
|
|
166
169
|
rounded: {
|
|
167
170
|
content: {
|
|
168
|
-
rounded: "
|
|
171
|
+
rounded: "0"
|
|
169
172
|
}
|
|
170
173
|
},
|
|
171
174
|
pill: {
|
|
172
175
|
content: {
|
|
173
|
-
rounded: "
|
|
176
|
+
rounded: "0"
|
|
174
177
|
}
|
|
175
178
|
},
|
|
176
179
|
square: {
|
|
177
180
|
content: {
|
|
178
|
-
rounded: "
|
|
181
|
+
rounded: "0"
|
|
179
182
|
}
|
|
180
183
|
}
|
|
181
184
|
}
|
|
@@ -186,304 +189,605 @@ const kn = {
|
|
|
186
189
|
shape: "rounded"
|
|
187
190
|
}
|
|
188
191
|
}), {
|
|
189
|
-
withProvider:
|
|
190
|
-
withContext:
|
|
191
|
-
} =
|
|
192
|
-
recipe:
|
|
193
|
-
}),
|
|
194
|
-
Root:
|
|
195
|
-
Content:
|
|
196
|
-
},
|
|
192
|
+
withProvider: yo,
|
|
193
|
+
withContext: So
|
|
194
|
+
} = Bn({
|
|
195
|
+
recipe: xo
|
|
196
|
+
}), ko = yo("div", "root"), wo = So("div", "content"), de = {
|
|
197
|
+
Root: ko,
|
|
198
|
+
Content: wo
|
|
199
|
+
}, To = (t) => {
|
|
197
200
|
if (t == null) return null;
|
|
198
201
|
const e = typeof t == "string" ? t : JSON.stringify(t, null, 2);
|
|
199
202
|
return e.length === 0 ? null : e.length > 200 ? `${e.slice(0, 200)}...` : e;
|
|
200
|
-
},
|
|
201
|
-
const e =
|
|
203
|
+
}, ki = (t) => {
|
|
204
|
+
const e = S(19), {
|
|
202
205
|
toolName: n,
|
|
203
|
-
toolInput:
|
|
206
|
+
toolInput: s,
|
|
204
207
|
onApprove: o,
|
|
205
|
-
onDeny:
|
|
208
|
+
onDeny: r
|
|
206
209
|
} = t;
|
|
207
|
-
let
|
|
208
|
-
e[0] !==
|
|
209
|
-
const
|
|
210
|
-
let
|
|
211
|
-
e[2] !== n ? (
|
|
210
|
+
let i;
|
|
211
|
+
e[0] !== s ? (i = To(s), e[0] = s, e[1] = i) : i = e[1];
|
|
212
|
+
const c = i;
|
|
213
|
+
let a;
|
|
214
|
+
e[2] !== n ? (a = /* @__PURE__ */ w(F, { textStyle: "label/S/medium", color: "fg", children: [
|
|
212
215
|
"Allow ",
|
|
213
|
-
/* @__PURE__ */
|
|
216
|
+
/* @__PURE__ */ l(qt, { size: "sm", children: n }),
|
|
214
217
|
"?"
|
|
215
|
-
] }), e[2] = n, e[3] =
|
|
218
|
+
] }), e[2] = n, e[3] = a) : a = e[3];
|
|
219
|
+
let u;
|
|
220
|
+
e[4] !== c ? (u = c ? /* @__PURE__ */ l(qt, { size: "sm", whiteSpace: "pre-wrap", maxH: "6rem", overflowY: "auto", children: c }) : null, e[4] = c, e[5] = u) : u = e[5];
|
|
216
221
|
let d;
|
|
217
|
-
e[
|
|
222
|
+
e[6] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ l(Ln, { size: 14 }), e[6] = d) : d = e[6];
|
|
218
223
|
let f;
|
|
219
|
-
e[
|
|
220
|
-
|
|
221
|
-
e[7] !== s ? (u = /* @__PURE__ */ b(Ce, { size: "xs", variant: "outline", onClick: s, children: [
|
|
222
|
-
f,
|
|
224
|
+
e[7] !== r ? (f = /* @__PURE__ */ w(qe, { size: "xs", variant: "outline", onClick: r, children: [
|
|
225
|
+
d,
|
|
223
226
|
"Deny"
|
|
224
|
-
] }), e[7] =
|
|
225
|
-
let p;
|
|
226
|
-
e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (p = /* @__PURE__ */ i(Jt, { size: 14 }), e[9] = p) : p = e[9];
|
|
227
|
+
] }), e[7] = r, e[8] = f) : f = e[8];
|
|
227
228
|
let m;
|
|
228
|
-
e[
|
|
229
|
-
|
|
229
|
+
e[9] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (m = /* @__PURE__ */ l(qn, { size: 14 }), e[9] = m) : m = e[9];
|
|
230
|
+
let p;
|
|
231
|
+
e[10] !== o ? (p = /* @__PURE__ */ w(qe, { size: "xs", colorPalette: "green", onClick: o, children: [
|
|
232
|
+
m,
|
|
230
233
|
"Allow"
|
|
231
|
-
] }), e[10] = o, e[11] =
|
|
234
|
+
] }), e[10] = o, e[11] = p) : p = e[11];
|
|
235
|
+
let h;
|
|
236
|
+
e[12] !== f || e[13] !== p ? (h = /* @__PURE__ */ w(Me, { gap: "xs", justifyContent: "flex-end", children: [
|
|
237
|
+
f,
|
|
238
|
+
p
|
|
239
|
+
] }), e[12] = f, e[13] = p, e[14] = h) : h = e[14];
|
|
232
240
|
let g;
|
|
233
|
-
e[
|
|
241
|
+
return e[15] !== a || e[16] !== u || e[17] !== h ? (g = /* @__PURE__ */ l(M, { px: "sm", py: "xs", mx: "sm", borderWidth: "1px", borderColor: "border.warning", borderRadius: "lg", bg: "bg.warning", children: /* @__PURE__ */ w(fe, { direction: "column", gap: "xs", children: [
|
|
242
|
+
a,
|
|
234
243
|
u,
|
|
235
|
-
|
|
236
|
-
] }), e[
|
|
237
|
-
|
|
238
|
-
return e[15] !== c || e[16] !== d || e[17] !== g ? (x = /* @__PURE__ */ i(k, { px: "sm", py: "xs", mx: "sm", borderWidth: "1px", borderColor: "border.warning", borderRadius: "lg", bg: "bg.warning", children: /* @__PURE__ */ b($, { direction: "column", gap: "xs", children: [
|
|
239
|
-
c,
|
|
240
|
-
d,
|
|
241
|
-
g
|
|
242
|
-
] }) }), e[15] = c, e[16] = d, e[17] = g, e[18] = x) : x = e[18], x;
|
|
243
|
-
}, Dn = (t) => {
|
|
244
|
+
h
|
|
245
|
+
] }) }), e[15] = a, e[16] = u, e[17] = h, e[18] = g) : g = e[18], g;
|
|
246
|
+
}, Co = (t) => {
|
|
244
247
|
const {
|
|
245
248
|
previousUserMessageCount: e,
|
|
246
249
|
userMessageCount: n
|
|
247
250
|
} = t;
|
|
248
251
|
return e === 0 ? !1 : n > e;
|
|
249
252
|
};
|
|
250
|
-
function
|
|
251
|
-
const e =
|
|
253
|
+
function _o(t) {
|
|
254
|
+
const e = S(4), {
|
|
252
255
|
userMessageCount: n
|
|
253
256
|
} = t, {
|
|
254
|
-
scrollToBottom:
|
|
255
|
-
} =
|
|
256
|
-
let
|
|
257
|
-
return e[0] !==
|
|
258
|
-
|
|
257
|
+
scrollToBottom: s
|
|
258
|
+
} = Mt(), o = nt(n);
|
|
259
|
+
let r, i;
|
|
260
|
+
return e[0] !== s || e[1] !== n ? (r = () => {
|
|
261
|
+
Co({
|
|
259
262
|
previousUserMessageCount: o.current,
|
|
260
263
|
userMessageCount: n
|
|
261
|
-
}) &&
|
|
262
|
-
},
|
|
264
|
+
}) && s(), o.current = n;
|
|
265
|
+
}, i = [n, s], e[0] = s, e[1] = n, e[2] = r, e[3] = i) : (r = e[2], i = e[3]), De(r, i), null;
|
|
263
266
|
}
|
|
264
|
-
const
|
|
267
|
+
const tn = (t) => t.trim().length > 0, Ao = (t) => {
|
|
265
268
|
const {
|
|
266
269
|
isDisabled: e,
|
|
267
270
|
streaming: n,
|
|
268
|
-
text:
|
|
271
|
+
text: s
|
|
269
272
|
} = t;
|
|
270
|
-
return e || n || !
|
|
271
|
-
},
|
|
273
|
+
return e || n || !tn(s) ? "none" : "submit";
|
|
274
|
+
}, Ro = (t) => {
|
|
272
275
|
const {
|
|
273
276
|
canInterrupt: e,
|
|
274
277
|
isDisabled: n,
|
|
275
|
-
streaming:
|
|
278
|
+
streaming: s,
|
|
276
279
|
text: o
|
|
277
280
|
} = t;
|
|
278
|
-
return n ? "none" :
|
|
279
|
-
},
|
|
280
|
-
|
|
281
|
-
|
|
281
|
+
return n ? "none" : s ? e ? "interrupt" : "none" : tn(o) ? "submit" : "none";
|
|
282
|
+
}, Bo = (t) => {
|
|
283
|
+
t.preventDefault();
|
|
284
|
+
}, nn = (t) => {
|
|
285
|
+
const e = S(7), {
|
|
286
|
+
option: n
|
|
287
|
+
} = t;
|
|
288
|
+
let s;
|
|
289
|
+
e[0] !== n.label ? (s = /* @__PURE__ */ l(F, { textStyle: "label/S/regular", color: "fg", children: n.label }), e[0] = n.label, e[1] = s) : s = e[1];
|
|
290
|
+
let o;
|
|
291
|
+
e[2] !== n.description ? (o = n.description ? /* @__PURE__ */ l(F, { textStyle: "label/XS/regular", color: "fg.muted", children: n.description }) : null, e[2] = n.description, e[3] = o) : o = e[3];
|
|
292
|
+
let r;
|
|
293
|
+
return e[4] !== s || e[5] !== o ? (r = /* @__PURE__ */ w(z, { gap: "0", minWidth: "0", children: [
|
|
294
|
+
s,
|
|
295
|
+
o
|
|
296
|
+
] }), e[4] = s, e[5] = o, e[6] = r) : r = e[6], r;
|
|
297
|
+
}, Io = (t) => {
|
|
298
|
+
const e = S(12), {
|
|
299
|
+
option: n,
|
|
300
|
+
name: s,
|
|
301
|
+
checked: o,
|
|
302
|
+
editable: r,
|
|
303
|
+
onToggle: i
|
|
304
|
+
} = t, c = !r, a = r ? void 0 : "true";
|
|
305
|
+
let u;
|
|
306
|
+
e[0] !== r ? (u = r ? void 0 : {
|
|
307
|
+
tabIndex: -1
|
|
308
|
+
}, e[0] = r, e[1] = u) : u = e[1];
|
|
309
|
+
const d = r ? i : void 0;
|
|
310
|
+
let f;
|
|
311
|
+
e[2] !== n ? (f = /* @__PURE__ */ l(nn, { option: n }), e[2] = n, e[3] = f) : f = e[3];
|
|
312
|
+
let m;
|
|
313
|
+
return e[4] !== o || e[5] !== s || e[6] !== c || e[7] !== a || e[8] !== u || e[9] !== d || e[10] !== f ? (m = /* @__PURE__ */ l(Zt, { name: s, checked: o, readOnly: c, "aria-readonly": a, inputProps: u, alignItems: "flex-start", onCheckedChange: d, children: f }), e[4] = o, e[5] = s, e[6] = c, e[7] = a, e[8] = u, e[9] = d, e[10] = f, e[11] = m) : m = e[11], m;
|
|
314
|
+
}, Po = (t) => {
|
|
315
|
+
const e = S(17), {
|
|
316
|
+
question: n,
|
|
317
|
+
questionIndex: s,
|
|
318
|
+
name: o,
|
|
319
|
+
selectedOption: r,
|
|
320
|
+
editable: i,
|
|
321
|
+
onToggleOption: c
|
|
322
|
+
} = t, a = r ?? null, u = !i, d = i ? void 0 : "true";
|
|
323
|
+
let f;
|
|
324
|
+
e[0] !== i || e[1] !== c || e[2] !== n || e[3] !== s ? (f = i ? (h) => {
|
|
325
|
+
h.value && c?.(n, s, h.value);
|
|
326
|
+
} : void 0, e[0] = i, e[1] = c, e[2] = n, e[3] = s, e[4] = f) : f = e[4];
|
|
327
|
+
let m;
|
|
328
|
+
if (e[5] !== i || e[6] !== n.options) {
|
|
329
|
+
let h;
|
|
330
|
+
e[8] !== i ? (h = (g) => /* @__PURE__ */ l(co, { value: g.label, inputProps: i ? void 0 : {
|
|
331
|
+
tabIndex: -1
|
|
332
|
+
}, alignItems: "flex-start", children: /* @__PURE__ */ l(nn, { option: g }) }, g.label), e[8] = i, e[9] = h) : h = e[9], m = n.options.map(h), e[5] = i, e[6] = n.options, e[7] = m;
|
|
333
|
+
} else
|
|
334
|
+
m = e[7];
|
|
335
|
+
let p;
|
|
336
|
+
return e[10] !== o || e[11] !== a || e[12] !== u || e[13] !== d || e[14] !== f || e[15] !== m ? (p = /* @__PURE__ */ l(ao, { name: o, value: a, readOnly: u, "aria-readonly": d, display: "flex", flexDirection: "column", gap: "xs", onValueChange: f, children: m }), e[10] = o, e[11] = a, e[12] = u, e[13] = d, e[14] = f, e[15] = m, e[16] = p) : p = e[16], p;
|
|
337
|
+
}, Mo = (t) => {
|
|
338
|
+
const e = S(4), {
|
|
339
|
+
items: n
|
|
340
|
+
} = t;
|
|
341
|
+
let s;
|
|
342
|
+
e[0] !== n ? (s = n.map($o), e[0] = n, e[1] = s) : s = e[1];
|
|
343
|
+
let o;
|
|
344
|
+
return e[2] !== s ? (o = /* @__PURE__ */ l(z, { as: "ul", gap: "2xs", listStyleType: "none", margin: "0", padding: "0", children: s }), e[2] = s, e[3] = o) : o = e[3], o;
|
|
345
|
+
}, on = (t) => {
|
|
346
|
+
const e = S(19), {
|
|
347
|
+
questions: n,
|
|
348
|
+
editable: s,
|
|
349
|
+
selectedOptionsByQuestion: o,
|
|
350
|
+
customAnswersByQuestion: r,
|
|
351
|
+
onToggleOption: i,
|
|
352
|
+
onCustomAnswerChange: c
|
|
353
|
+
} = t, a = s === void 0 ? !1 : s;
|
|
354
|
+
let u;
|
|
355
|
+
e[0] !== o ? (u = o === void 0 ? {} : o, e[0] = o, e[1] = u) : u = e[1];
|
|
356
|
+
const d = u;
|
|
357
|
+
let f;
|
|
358
|
+
e[2] !== r ? (f = r === void 0 ? {} : r, e[2] = r, e[3] = f) : f = e[3];
|
|
359
|
+
const m = f;
|
|
360
|
+
let p;
|
|
361
|
+
if (e[4] !== m || e[5] !== a || e[6] !== c || e[7] !== i || e[8] !== n || e[9] !== d) {
|
|
362
|
+
let g;
|
|
363
|
+
e[11] !== m || e[12] !== a || e[13] !== c || e[14] !== i || e[15] !== d ? (g = (b, x) => {
|
|
364
|
+
const k = b.id ?? `question-${x}`, T = b.multiple ? "checkbox" : "radio", A = d[k] ?? [];
|
|
365
|
+
return /* @__PURE__ */ w(z, { as: "fieldset", gap: "xs", borderWidth: "1px", borderColor: "border.muted", borderRadius: "sm", padding: "sm", minWidth: "0", children: [
|
|
366
|
+
/* @__PURE__ */ l(F, { as: "legend", textStyle: "label/S/medium", color: "fg", paddingX: "2xs", children: b.question }),
|
|
367
|
+
T === "radio" ? /* @__PURE__ */ l(Po, { question: b, questionIndex: x, name: k, selectedOption: A[0], editable: a, onToggleOption: i }) : b.options.map((R) => /* @__PURE__ */ l(Io, { option: R, name: k, checked: A.includes(R.label), editable: a, onToggle: () => i?.(b, x, R.label) }, R.label)),
|
|
368
|
+
b.allowCustomAnswer ? /* @__PURE__ */ l(In, { readOnly: !a, "aria-readonly": a ? void 0 : "true", value: m[k] ?? "", placeholder: a ? "Answer..." : "Custom answer", "aria-label": b.question, rows: 2, borderWidth: "1px", borderColor: "border.muted", borderRadius: "sm", padding: "xs", resize: a ? "vertical" : "none", color: "fg", onChange: (R) => c?.(b, x, R.currentTarget.value) }) : null
|
|
369
|
+
] }, k);
|
|
370
|
+
}, e[11] = m, e[12] = a, e[13] = c, e[14] = i, e[15] = d, e[16] = g) : g = e[16], p = n.map(g), e[4] = m, e[5] = a, e[6] = c, e[7] = i, e[8] = n, e[9] = d, e[10] = p;
|
|
371
|
+
} else
|
|
372
|
+
p = e[10];
|
|
373
|
+
let h;
|
|
374
|
+
return e[17] !== p ? (h = /* @__PURE__ */ l(z, { as: "form", gap: "sm", onSubmit: Bo, "aria-label": "Question form", children: p }), e[17] = p, e[18] = h) : h = e[18], h;
|
|
375
|
+
};
|
|
376
|
+
function $o(t, e) {
|
|
377
|
+
return /* @__PURE__ */ l(M, { as: "li", children: /* @__PURE__ */ l(Zt, { checked: t.checked, readOnly: !0, "aria-readonly": "true", inputProps: {
|
|
378
|
+
tabIndex: -1
|
|
379
|
+
}, children: /* @__PURE__ */ l(F, { textStyle: "label/S/regular", color: "fg", children: t.label }) }) }, `${t.label}-${e}`);
|
|
380
|
+
}
|
|
381
|
+
const ee = (t, e) => t.id ?? `question-${e}`, Bt = (t) => t ? JSON.stringify(t.questions.map((e, n) => ({
|
|
382
|
+
id: ee(e, n),
|
|
383
|
+
question: e.question,
|
|
384
|
+
multiple: !!e.multiple,
|
|
385
|
+
required: !!e.required,
|
|
386
|
+
allowCustomAnswer: !!e.allowCustomAnswer,
|
|
387
|
+
options: e.options.map((s) => ({
|
|
388
|
+
label: s.label,
|
|
389
|
+
description: s.description ?? ""
|
|
390
|
+
}))
|
|
391
|
+
}))) : "", Oo = (t, e, n) => {
|
|
392
|
+
const s = [];
|
|
393
|
+
for (let o = 0; o < t.questions.length; o += 1) {
|
|
394
|
+
const r = t.questions[o], i = ee(r, o), c = e[i] ?? [], a = n[i]?.trim(), u = a ? [...c, a] : c;
|
|
395
|
+
u.length !== 0 && s.push(`${r.question}: ${u.join(", ")}`);
|
|
396
|
+
}
|
|
397
|
+
return s;
|
|
398
|
+
}, Eo = (t) => typeof t != "string", $t = (t, e) => {
|
|
399
|
+
if (Eo(e)) return e;
|
|
400
|
+
const n = e.trim();
|
|
401
|
+
if (n.length === 0) return {};
|
|
402
|
+
const s = {};
|
|
403
|
+
for (let o = 0; o < t.questions.length; o += 1) {
|
|
404
|
+
const r = t.questions[o];
|
|
405
|
+
r.allowCustomAnswer && (s[ee(r, o)] = n);
|
|
406
|
+
}
|
|
407
|
+
return s;
|
|
408
|
+
}, Do = (t, e, n) => {
|
|
409
|
+
if (!t) return typeof n == "string" ? n.trim() : "";
|
|
410
|
+
const s = $t(t, n), o = Oo(t, e, s), r = typeof n == "string" ? n.trim() : "", i = t.questions.some((c) => c.allowCustomAnswer);
|
|
411
|
+
return r.length > 0 && !i && o.push(`Additional response: ${r}`), o.join(`
|
|
412
|
+
`);
|
|
413
|
+
}, Lo = (t, e, n) => {
|
|
414
|
+
const s = $t(t, n);
|
|
415
|
+
return t.questions.map((o, r) => {
|
|
416
|
+
const i = ee(o, r), c = e[i] ?? [], a = s[i]?.trim();
|
|
417
|
+
return a ? [...c, a] : c;
|
|
418
|
+
});
|
|
419
|
+
}, qo = (t, e, n) => {
|
|
420
|
+
if (!t) return !1;
|
|
421
|
+
const s = $t(t, n);
|
|
422
|
+
for (let o = 0; o < t.questions.length; o += 1) {
|
|
423
|
+
const r = t.questions[o];
|
|
424
|
+
if (!r.required) continue;
|
|
425
|
+
const i = ee(r, o);
|
|
426
|
+
if (!((e[i] ?? []).length > 0) && !(r.allowCustomAnswer && s[i]?.trim()))
|
|
427
|
+
return !0;
|
|
428
|
+
}
|
|
429
|
+
return !1;
|
|
430
|
+
}, vo = (t) => t.questions.map((e, n) => ({
|
|
431
|
+
id: ee(e, n),
|
|
432
|
+
question: e.question,
|
|
433
|
+
options: e.options,
|
|
434
|
+
multiple: !!e.multiple,
|
|
435
|
+
required: !!e.required,
|
|
436
|
+
allowCustomAnswer: !!e.allowCustomAnswer
|
|
437
|
+
})), Qo = (t, e, n, s) => {
|
|
438
|
+
const o = ee(t, e);
|
|
439
|
+
return (n[o] ?? []).length > 0 || !!s[o]?.trim();
|
|
440
|
+
}, Fo = (t) => {
|
|
441
|
+
const e = S(22), {
|
|
442
|
+
question: n,
|
|
443
|
+
sourceQuestion: s,
|
|
444
|
+
questionIndex: o,
|
|
445
|
+
isActive: r,
|
|
446
|
+
selectedOptionsByQuestion: i,
|
|
447
|
+
customAnswersByQuestion: c,
|
|
448
|
+
onSelectStep: a
|
|
449
|
+
} = t;
|
|
450
|
+
let u;
|
|
451
|
+
e[0] !== c || e[1] !== o || e[2] !== i || e[3] !== s ? (u = Qo(s, o, i, c), e[0] = c, e[1] = o, e[2] = i, e[3] = s, e[4] = u) : u = e[4];
|
|
452
|
+
const d = u, f = d ? "answered" : "not answered", m = r ? "outline" : "ghost", p = `question-step-tab-${n.id}`, h = `${n.question} (${f})`, g = `question-step-panel-${n.id}`;
|
|
453
|
+
let b;
|
|
454
|
+
e[5] !== a || e[6] !== o ? (b = () => a(o), e[5] = a, e[6] = o, e[7] = b) : b = e[7];
|
|
455
|
+
let x;
|
|
456
|
+
e[8] !== d || e[9] !== o ? (x = d ? /* @__PURE__ */ l(vn, { "aria-hidden": "true" }) : o + 1, e[8] = d, e[9] = o, e[10] = x) : x = e[10];
|
|
457
|
+
let k;
|
|
458
|
+
e[11] !== r || e[12] !== p || e[13] !== h || e[14] !== g || e[15] !== b || e[16] !== x || e[17] !== m ? (k = /* @__PURE__ */ l(qe, { id: p, role: "tab", "aria-label": h, "aria-selected": r, "aria-controls": g, size: "xs", variant: m, minW: "8", onClick: b, children: x }), e[11] = r, e[12] = p, e[13] = h, e[14] = g, e[15] = b, e[16] = x, e[17] = m, e[18] = k) : k = e[18];
|
|
459
|
+
let T;
|
|
460
|
+
return e[19] !== n.question || e[20] !== k ? (T = /* @__PURE__ */ l(so, { content: n.question, showArrow: !0, children: k }), e[19] = n.question, e[20] = k, e[21] = T) : T = e[21], T;
|
|
461
|
+
}, zo = (t) => {
|
|
462
|
+
const e = S(31), {
|
|
463
|
+
questionPrompt: n,
|
|
464
|
+
selectedOptionsByQuestion: s,
|
|
465
|
+
customAnswersByQuestion: o,
|
|
466
|
+
onToggleOption: r,
|
|
467
|
+
onCustomAnswerChange: i
|
|
468
|
+
} = t, {
|
|
469
|
+
questions: c
|
|
470
|
+
} = t, [a, u] = Z(0), d = Math.min(a, c.length - 1), f = c[d], m = c.length > 1;
|
|
471
|
+
let p;
|
|
472
|
+
e[0] !== o || e[1] !== m || e[2] !== n.questions || e[3] !== c || e[4] !== d || e[5] !== s ? (p = m ? /* @__PURE__ */ l(Me, { role: "tablist", "aria-label": "Question steps", gap: "1", minWidth: "0", children: c.map((I, _) => /* @__PURE__ */ l(Fo, { question: I, sourceQuestion: n.questions[_], questionIndex: _, isActive: _ === d, selectedOptionsByQuestion: s, customAnswersByQuestion: o, onSelectStep: u }, I.id)) }) : null, e[0] = o, e[1] = m, e[2] = n.questions, e[3] = c, e[4] = d, e[5] = s, e[6] = p) : p = e[6];
|
|
473
|
+
const h = `question-step-panel-${f.id}`, g = m ? "tabpanel" : void 0, b = m ? `question-step-tab-${f.id}` : void 0;
|
|
474
|
+
let x;
|
|
475
|
+
e[7] !== f ? (x = [f], e[7] = f, e[8] = x) : x = e[8];
|
|
476
|
+
let k;
|
|
477
|
+
e[9] !== r || e[10] !== n.questions || e[11] !== d ? (k = (I, _, P) => {
|
|
478
|
+
r(n.questions[d], d, P);
|
|
479
|
+
}, e[9] = r, e[10] = n.questions, e[11] = d, e[12] = k) : k = e[12];
|
|
480
|
+
let T;
|
|
481
|
+
e[13] !== i || e[14] !== n.questions || e[15] !== d ? (T = (I, _, P) => {
|
|
482
|
+
i(n.questions[d], d, P);
|
|
483
|
+
}, e[13] = i, e[14] = n.questions, e[15] = d, e[16] = T) : T = e[16];
|
|
484
|
+
let A;
|
|
485
|
+
e[17] !== o || e[18] !== s || e[19] !== x || e[20] !== k || e[21] !== T ? (A = /* @__PURE__ */ l(on, { questions: x, editable: !0, selectedOptionsByQuestion: s, customAnswersByQuestion: o, onToggleOption: k, onCustomAnswerChange: T }), e[17] = o, e[18] = s, e[19] = x, e[20] = k, e[21] = T, e[22] = A) : A = e[22];
|
|
486
|
+
let R;
|
|
487
|
+
e[23] !== h || e[24] !== g || e[25] !== b || e[26] !== A ? (R = /* @__PURE__ */ l(z, { id: h, role: g, "aria-labelledby": b, gap: "0", children: A }), e[23] = h, e[24] = g, e[25] = b, e[26] = A, e[27] = R) : R = e[27];
|
|
488
|
+
let B;
|
|
489
|
+
return e[28] !== p || e[29] !== R ? (B = /* @__PURE__ */ w(z, { gap: "xs", pb: "sm", children: [
|
|
490
|
+
p,
|
|
491
|
+
R
|
|
492
|
+
] }), e[28] = p, e[29] = R, e[30] = B) : B = e[30], B;
|
|
493
|
+
}, Wo = (t) => {
|
|
494
|
+
const e = S(8), {
|
|
495
|
+
questionPrompt: n
|
|
496
|
+
} = t;
|
|
497
|
+
let s;
|
|
498
|
+
e[0] !== n ? (s = vo(n), e[0] = n, e[1] = s) : s = e[1];
|
|
499
|
+
const o = s;
|
|
500
|
+
let r;
|
|
501
|
+
e[2] !== n ? (r = Bt(n), e[2] = n, e[3] = r) : r = e[3];
|
|
502
|
+
const i = r;
|
|
503
|
+
let c;
|
|
504
|
+
return e[4] !== t || e[5] !== i || e[6] !== o ? (c = /* @__PURE__ */ l(zo, { ...t, questions: o }, i), e[4] = t, e[5] = i, e[6] = o, e[7] = c) : c = e[7], c;
|
|
505
|
+
}, Ho = (t) => {
|
|
506
|
+
const e = S(22);
|
|
507
|
+
let n, s, o, r;
|
|
282
508
|
e[0] !== t ? ({
|
|
283
|
-
title:
|
|
509
|
+
title: r,
|
|
284
510
|
shortcut: o,
|
|
285
511
|
canInterrupt: n,
|
|
286
|
-
...
|
|
287
|
-
} = t, e[0] = t, e[1] = n, e[2] =
|
|
288
|
-
const
|
|
289
|
-
let
|
|
290
|
-
e[5] !== n ? (
|
|
291
|
-
const
|
|
292
|
-
let
|
|
293
|
-
e[7] !==
|
|
294
|
-
const
|
|
295
|
-
if (
|
|
296
|
-
let
|
|
297
|
-
e[12] !== o || e[13] !==
|
|
298
|
-
|
|
512
|
+
...s
|
|
513
|
+
} = t, e[0] = t, e[1] = n, e[2] = s, e[3] = o, e[4] = r) : (n = e[1], s = e[2], o = e[3], r = e[4]);
|
|
514
|
+
const i = s["aria-label"] ?? r;
|
|
515
|
+
let c;
|
|
516
|
+
e[5] !== n ? (c = n ? /* @__PURE__ */ l(Qn, { size: 16, strokeWidth: 2, fill: "currentColor" }) : /* @__PURE__ */ l(Fn, { size: 16, strokeWidth: 2 }), e[5] = n, e[6] = c) : c = e[6];
|
|
517
|
+
const a = c;
|
|
518
|
+
let u;
|
|
519
|
+
e[7] !== i || e[8] !== a || e[9] !== s || e[10] !== r ? (u = /* @__PURE__ */ l(Ut, { "data-testid": "send-message-button", size: "sm", variant: "solid", borderRadius: "full", colorPalette: "primary", "aria-label": i, title: r, ...s, children: a }), e[7] = i, e[8] = a, e[9] = s, e[10] = r, e[11] = u) : u = e[11];
|
|
520
|
+
const d = u;
|
|
521
|
+
if (r) {
|
|
522
|
+
let f;
|
|
523
|
+
e[12] !== o || e[13] !== r ? (f = o ? /* @__PURE__ */ w(It, { children: [
|
|
524
|
+
r,
|
|
299
525
|
" ",
|
|
300
|
-
/* @__PURE__ */
|
|
301
|
-
] }) :
|
|
302
|
-
const
|
|
303
|
-
let
|
|
304
|
-
e[15] !==
|
|
526
|
+
/* @__PURE__ */ l(Mn, { fontSize: "xs", children: o })
|
|
527
|
+
] }) : r, e[12] = o, e[13] = r, e[14] = f) : f = e[14];
|
|
528
|
+
const m = f;
|
|
529
|
+
let p;
|
|
530
|
+
e[15] !== d ? (p = /* @__PURE__ */ l(tt.Trigger, { asChild: !0, children: d }), e[15] = d, e[16] = p) : p = e[16];
|
|
531
|
+
let h;
|
|
532
|
+
e[17] !== m ? (h = /* @__PURE__ */ l(Pn, { children: /* @__PURE__ */ l(tt.Positioner, { children: /* @__PURE__ */ l(tt.Content, { children: m }) }) }), e[17] = m, e[18] = h) : h = e[18];
|
|
305
533
|
let g;
|
|
306
|
-
e[
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
g
|
|
311
|
-
] }), e[19] = m, e[20] = g, e[21] = x) : x = e[21], x;
|
|
534
|
+
return e[19] !== p || e[20] !== h ? (g = /* @__PURE__ */ w(tt.Root, { closeDelay: 50, openDelay: 100, children: [
|
|
535
|
+
p,
|
|
536
|
+
h
|
|
537
|
+
] }), e[19] = p, e[20] = h, e[21] = g) : g = e[21], g;
|
|
312
538
|
}
|
|
313
|
-
return
|
|
314
|
-
},
|
|
315
|
-
const e =
|
|
539
|
+
return d;
|
|
540
|
+
}, jo = (t) => {
|
|
541
|
+
const e = S(94), {
|
|
316
542
|
defaultState: n,
|
|
317
|
-
onSubmit:
|
|
543
|
+
onSubmit: s,
|
|
318
544
|
onInterrupt: o,
|
|
319
|
-
streaming:
|
|
320
|
-
attachedResources:
|
|
321
|
-
onClearAttachments:
|
|
322
|
-
isDisabled:
|
|
323
|
-
onChange:
|
|
324
|
-
placeholder:
|
|
325
|
-
attachmentList:
|
|
326
|
-
actions:
|
|
327
|
-
attachedToTop:
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
const [D, Se] = me(F), _e = Ze(null), ke = Ze(d);
|
|
335
|
-
let oe, se;
|
|
336
|
-
e[4] !== d ? (oe = () => {
|
|
337
|
-
ke.current = d;
|
|
338
|
-
}, se = [d], e[4] = d, e[5] = oe, e[6] = se) : (oe = e[5], se = e[6]), et(oe, se);
|
|
339
|
-
let ie, M;
|
|
340
|
-
e[7] !== n ? (M = () => {
|
|
341
|
-
const T = Ye(n);
|
|
342
|
-
ne(n), re(Wn), Se(T), ke.current?.(T);
|
|
343
|
-
}, ie = [n], e[7] = n, e[8] = ie, e[9] = M) : (ie = e[8], M = e[9]), et(M, ie);
|
|
545
|
+
streaming: r,
|
|
546
|
+
attachedResources: i,
|
|
547
|
+
onClearAttachments: c,
|
|
548
|
+
isDisabled: a,
|
|
549
|
+
onChange: u,
|
|
550
|
+
placeholder: d,
|
|
551
|
+
attachmentList: f,
|
|
552
|
+
actions: m,
|
|
553
|
+
attachedToTop: p,
|
|
554
|
+
questionPrompt: h,
|
|
555
|
+
autoFocus: g
|
|
556
|
+
} = t, b = s === void 0 ? No : s, x = r === void 0 ? !1 : r;
|
|
557
|
+
let k;
|
|
558
|
+
e[0] !== i ? (k = i === void 0 ? [] : i, e[0] = i, e[1] = k) : k = e[1];
|
|
559
|
+
const T = k, A = a === void 0 ? !1 : a, R = p === void 0 ? !1 : p, B = g === void 0 ? !1 : g, [I, _] = Z(!1), [P, L] = Z(n), [O, q] = Z(0);
|
|
344
560
|
let W;
|
|
345
|
-
e[
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
}, e[
|
|
349
|
-
const
|
|
350
|
-
let
|
|
351
|
-
e[
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
561
|
+
e[2] !== n ? (W = () => Tt(n), e[2] = n, e[3] = W) : W = e[3];
|
|
562
|
+
const [ye, $e] = Z(W);
|
|
563
|
+
let se;
|
|
564
|
+
e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (se = {}, e[4] = se) : se = e[4];
|
|
565
|
+
const [E, Se] = Z(se);
|
|
566
|
+
let ke;
|
|
567
|
+
e[5] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (ke = {}, e[5] = ke) : ke = e[5];
|
|
568
|
+
const [D, H] = Z(ke), we = nt(null), pe = nt(u);
|
|
569
|
+
let j;
|
|
570
|
+
e[6] !== h ? (j = Bt(h), e[6] = h, e[7] = j) : j = e[7];
|
|
571
|
+
const Fe = nt(j);
|
|
572
|
+
let re, ie;
|
|
573
|
+
e[8] !== u ? (re = () => {
|
|
574
|
+
pe.current = u;
|
|
575
|
+
}, ie = [u], e[8] = u, e[9] = re, e[10] = ie) : (re = e[9], ie = e[10]), De(re, ie);
|
|
576
|
+
let N, V;
|
|
577
|
+
e[11] !== n ? (N = () => {
|
|
578
|
+
const C = Tt(n);
|
|
579
|
+
L(n), q(Vo), $e(C), Se({}), H({}), pe.current?.(C);
|
|
580
|
+
}, V = [n], e[11] = n, e[12] = N, e[13] = V) : (N = e[12], V = e[13]), De(N, V);
|
|
581
|
+
let U;
|
|
582
|
+
e[14] !== h ? (U = Bt(h), e[14] = h, e[15] = U) : U = e[15];
|
|
583
|
+
const G = U;
|
|
584
|
+
let v, Q;
|
|
585
|
+
e[16] !== G ? (v = () => {
|
|
586
|
+
Fe.current !== G && (Fe.current = G, Se({}), H({}));
|
|
587
|
+
}, Q = [G], e[16] = G, e[17] = v, e[18] = Q) : (v = e[17], Q = e[18]), De(v, Q);
|
|
588
|
+
let K;
|
|
589
|
+
e[19] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (K = () => {
|
|
590
|
+
const C = we.current?.querySelector('[contenteditable="true"]');
|
|
591
|
+
C instanceof HTMLElement && C.focus();
|
|
592
|
+
}, e[19] = K) : K = e[19];
|
|
593
|
+
const me = K;
|
|
594
|
+
let $, le;
|
|
595
|
+
e[20] !== B ? ($ = () => {
|
|
596
|
+
if (!B)
|
|
597
|
+
return;
|
|
598
|
+
const C = requestAnimationFrame(() => {
|
|
599
|
+
const ae = we.current?.querySelector('[contenteditable="true"]');
|
|
600
|
+
ae instanceof HTMLElement && ae.focus(), _(!0);
|
|
362
601
|
});
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
let
|
|
366
|
-
e[
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
602
|
+
return () => cancelAnimationFrame(C);
|
|
603
|
+
}, le = [B], e[20] = B, e[21] = $, e[22] = le) : ($ = e[21], le = e[22]), De($, le);
|
|
604
|
+
let X;
|
|
605
|
+
e[23] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (X = () => {
|
|
606
|
+
_(!0), me();
|
|
607
|
+
}, e[23] = X) : X = e[23];
|
|
608
|
+
const kn = X;
|
|
609
|
+
let ze;
|
|
610
|
+
e[24] !== n ? (ze = (C) => {
|
|
611
|
+
const ae = C === void 0 ? !1 : C;
|
|
612
|
+
L(n), q(Uo);
|
|
613
|
+
const Y = Tt(n);
|
|
614
|
+
$e(Y), Se({}), H({}), pe.current?.(Y), ae && requestAnimationFrame(() => {
|
|
615
|
+
me();
|
|
616
|
+
});
|
|
617
|
+
}, e[24] = n, e[25] = ze) : ze = e[25];
|
|
618
|
+
const ct = ze, he = x && !!o;
|
|
619
|
+
let ge, ce, We;
|
|
620
|
+
if (e[26] !== he || e[27] !== D || e[28] !== A || e[29] !== h || e[30] !== E || e[31] !== x || e[32] !== ye) {
|
|
621
|
+
ce = h ? Do(h, E, D) : ye.trim();
|
|
622
|
+
const C = qo(h, E, D);
|
|
623
|
+
ge = {
|
|
624
|
+
canInterrupt: he,
|
|
625
|
+
isDisabled: A || C,
|
|
626
|
+
streaming: x,
|
|
627
|
+
text: ce
|
|
628
|
+
}, We = Ro(ge), e[26] = he, e[27] = D, e[28] = A, e[29] = h, e[30] = E, e[31] = x, e[32] = ye, e[33] = ge, e[34] = ce, e[35] = We;
|
|
629
|
+
} else
|
|
630
|
+
ge = e[33], ce = e[34], We = e[35];
|
|
631
|
+
const He = We;
|
|
632
|
+
let je;
|
|
633
|
+
e[36] !== T || e[37] !== D || e[38] !== c || e[39] !== b || e[40] !== h || e[41] !== ct || e[42] !== ce || e[43] !== E ? (je = () => {
|
|
634
|
+
if (!ce)
|
|
635
|
+
return;
|
|
636
|
+
const C = h ? {
|
|
637
|
+
answers: Lo(h, E, D)
|
|
638
|
+
} : void 0;
|
|
639
|
+
b(ce, T, C), ct(!0), c?.();
|
|
640
|
+
}, e[36] = T, e[37] = D, e[38] = c, e[39] = b, e[40] = h, e[41] = ct, e[42] = ce, e[43] = E, e[44] = je) : je = e[44];
|
|
641
|
+
const at = je;
|
|
642
|
+
let Ne;
|
|
643
|
+
e[45] !== o || e[46] !== at ? (Ne = (C) => {
|
|
644
|
+
if (C === "interrupt") {
|
|
382
645
|
o?.();
|
|
383
646
|
return;
|
|
384
647
|
}
|
|
385
|
-
|
|
386
|
-
}, e[
|
|
387
|
-
const
|
|
388
|
-
let
|
|
389
|
-
e[
|
|
390
|
-
|
|
391
|
-
}, e[
|
|
392
|
-
const
|
|
393
|
-
let
|
|
394
|
-
e[
|
|
395
|
-
|
|
396
|
-
}, e[
|
|
397
|
-
const
|
|
398
|
-
let
|
|
399
|
-
e[
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
648
|
+
C === "submit" && at();
|
|
649
|
+
}, e[45] = o, e[46] = at, e[47] = Ne) : Ne = e[47];
|
|
650
|
+
const Te = Ne;
|
|
651
|
+
let Ve;
|
|
652
|
+
e[48] !== ge || e[49] !== Te ? (Ve = () => {
|
|
653
|
+
Te(Ao(ge));
|
|
654
|
+
}, e[48] = ge, e[49] = Te, e[50] = Ve) : Ve = e[50];
|
|
655
|
+
const ut = Ve;
|
|
656
|
+
let Ue;
|
|
657
|
+
e[51] !== He || e[52] !== Te ? (Ue = () => {
|
|
658
|
+
Te(He);
|
|
659
|
+
}, e[51] = He, e[52] = Te, e[53] = Ue) : Ue = e[53];
|
|
660
|
+
const dt = Ue;
|
|
661
|
+
let Ge;
|
|
662
|
+
e[54] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Ge = (C, ae, Y) => {
|
|
663
|
+
const Oe = ee(C, ae);
|
|
664
|
+
Se((Ee) => {
|
|
665
|
+
const wt = Ee[Oe] ?? [], Lt = wt.includes(Y);
|
|
666
|
+
return C.multiple ? {
|
|
667
|
+
...Ee,
|
|
668
|
+
[Oe]: Lt ? wt.filter((Cn) => Cn !== Y) : [...wt, Y]
|
|
669
|
+
} : {
|
|
670
|
+
...Ee,
|
|
671
|
+
[Oe]: Lt ? [] : [Y]
|
|
672
|
+
};
|
|
673
|
+
});
|
|
674
|
+
}, e[54] = Ge) : Ge = e[54];
|
|
675
|
+
const wn = Ge;
|
|
676
|
+
let Ke;
|
|
677
|
+
e[55] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Ke = (C, ae, Y) => {
|
|
678
|
+
const Oe = ee(C, ae);
|
|
679
|
+
H((Ee) => ({
|
|
680
|
+
...Ee,
|
|
681
|
+
[Oe]: Y
|
|
682
|
+
}));
|
|
683
|
+
}, e[55] = Ke) : Ke = e[55];
|
|
684
|
+
const Tn = Ke;
|
|
685
|
+
let Xe;
|
|
686
|
+
e[56] !== d ? (Xe = d ? /* @__PURE__ */ l(F, { textStyle: "label/M/regular", color: "fg.subtle", pointerEvents: "none", position: "absolute", top: "0", children: d }) : void 0, e[56] = d, e[57] = Xe) : Xe = e[57];
|
|
687
|
+
const ft = Xe, pt = R ? "-1px" : void 0, mt = R ? "0" : void 0, ht = I ? "blue.border" : "border.muted", gt = I ? "mid" : "low", bt = I ? 1 : 0, xt = I ? "blue.border" : "border";
|
|
688
|
+
let Ce;
|
|
689
|
+
e[58] !== xt ? (Ce = {
|
|
690
|
+
borderColor: xt,
|
|
404
691
|
boxShadow: "mid",
|
|
405
692
|
zIndex: 1
|
|
406
|
-
}, e[
|
|
407
|
-
let
|
|
408
|
-
e[
|
|
693
|
+
}, e[58] = xt, e[59] = Ce) : Ce = e[59];
|
|
694
|
+
let Ye;
|
|
695
|
+
e[60] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Ye = {
|
|
409
696
|
borderColor: "blue.border",
|
|
410
697
|
boxShadow: "mid",
|
|
411
698
|
zIndex: 1
|
|
412
|
-
}, e[
|
|
413
|
-
let
|
|
414
|
-
e[
|
|
415
|
-
let
|
|
416
|
-
e[
|
|
699
|
+
}, e[60] = Ye) : Ye = e[60];
|
|
700
|
+
let Je;
|
|
701
|
+
e[61] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Je = () => _(!1), e[61] = Je) : Je = e[61];
|
|
702
|
+
let _e;
|
|
703
|
+
e[62] !== D || e[63] !== O || e[64] !== P || e[65] !== ut || e[66] !== A || e[67] !== u || e[68] !== ft || e[69] !== h || e[70] !== E ? (_e = h ? /* @__PURE__ */ l(Wo, { questionPrompt: h, selectedOptionsByQuestion: E, customAnswersByQuestion: D, onToggleOption: wn, onCustomAnswerChange: Tn }) : /* @__PURE__ */ l(Yt, { maxH: "10rem", showHorizontalScrollbar: !1, contentProps: {
|
|
417
704
|
pr: "2xs"
|
|
418
|
-
},
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
let
|
|
425
|
-
e[
|
|
426
|
-
let
|
|
427
|
-
e[
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
e[58] !== p || e[59] !== ue ? (fe = /* @__PURE__ */ b(ge, { gap: "1", mt: "md", children: [
|
|
433
|
-
p,
|
|
434
|
-
ve,
|
|
435
|
-
ue
|
|
436
|
-
] }), e[58] = p, e[59] = ue, e[60] = fe) : fe = e[60];
|
|
437
|
-
let pe;
|
|
438
|
-
e[61] !== u || e[62] !== de || e[63] !== fe ? (pe = /* @__PURE__ */ b($, { direction: "column", color: "fg", children: [
|
|
439
|
-
u,
|
|
440
|
-
de,
|
|
441
|
-
fe
|
|
442
|
-
] }), e[61] = u, e[62] = de, e[63] = fe, e[64] = pe) : pe = e[64];
|
|
705
|
+
}, children: /* @__PURE__ */ l(ro, { defaultState: P, isEditable: !A, placeholder: ft, onChange: (C) => {
|
|
706
|
+
$e(C), u?.(C);
|
|
707
|
+
}, onSubmit: ut }, O) }), e[62] = D, e[63] = O, e[64] = P, e[65] = ut, e[66] = A, e[67] = u, e[68] = ft, e[69] = h, e[70] = E, e[71] = _e) : _e = e[71];
|
|
708
|
+
let Ze;
|
|
709
|
+
e[72] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (Ze = /* @__PURE__ */ l($n, {}), e[72] = Ze) : Ze = e[72];
|
|
710
|
+
const yt = he ? "Stop Response" : "Message Sending", St = x ? void 0 : "Enter", kt = He === "none";
|
|
711
|
+
let Ae;
|
|
712
|
+
e[73] !== he || e[74] !== dt || e[75] !== yt || e[76] !== St || e[77] !== kt ? (Ae = /* @__PURE__ */ l(Ho, { canInterrupt: he, title: yt, shortcut: St, onClick: dt, disabled: kt }), e[73] = he, e[74] = dt, e[75] = yt, e[76] = St, e[77] = kt, e[78] = Ae) : Ae = e[78];
|
|
713
|
+
let Re;
|
|
714
|
+
e[79] !== m || e[80] !== Ae ? (Re = /* @__PURE__ */ w(Me, { gap: "1", mt: "md", children: [
|
|
715
|
+
m,
|
|
716
|
+
Ze,
|
|
717
|
+
Ae
|
|
718
|
+
] }), e[79] = m, e[80] = Ae, e[81] = Re) : Re = e[81];
|
|
443
719
|
let Be;
|
|
444
|
-
|
|
720
|
+
e[82] !== f || e[83] !== _e || e[84] !== Re ? (Be = /* @__PURE__ */ w(fe, { direction: "column", color: "fg", children: [
|
|
721
|
+
f,
|
|
722
|
+
_e,
|
|
723
|
+
Re
|
|
724
|
+
] }), e[82] = f, e[83] = _e, e[84] = Re, e[85] = Be) : Be = e[85];
|
|
725
|
+
let et;
|
|
726
|
+
return e[86] !== pt || e[87] !== mt || e[88] !== ht || e[89] !== gt || e[90] !== bt || e[91] !== Ce || e[92] !== Be ? (et = /* @__PURE__ */ l(M, { ref: we, position: "relative", width: "100%", paddingX: "lg", paddingY: "md", mt: pt, bg: "bg", borderRadius: "md", borderTopRadius: mt, borderWidth: "1px", borderStyle: "solid", borderColor: ht, boxShadow: gt, zIndex: bt, transition: "box-shadow 0.2s ease-in-out, border-color 0.2s ease-in-out", _hover: Ce, _focusWithin: Ye, onClick: kn, onBlur: Je, children: Be }), e[86] = pt, e[87] = mt, e[88] = ht, e[89] = gt, e[90] = bt, e[91] = Ce, e[92] = Be, e[93] = et) : et = e[93], et;
|
|
445
727
|
};
|
|
446
|
-
function
|
|
728
|
+
function No() {
|
|
447
729
|
}
|
|
448
|
-
function
|
|
730
|
+
function Vo(t) {
|
|
449
731
|
return t + 1;
|
|
450
732
|
}
|
|
451
|
-
function
|
|
733
|
+
function Uo(t) {
|
|
452
734
|
return t + 1;
|
|
453
735
|
}
|
|
454
|
-
const
|
|
455
|
-
|
|
456
|
-
|
|
736
|
+
const Go = (t = "") => JSON.stringify(io(t)), Ko = 360, Xo = 4, Yo = "min(10vh, 4rem)", sn = "min(70dvh, calc(100dvh - 12rem), 22rem)", _t = 1, Jo = (t) => t.parts.reduce((e, n) => n.type !== "text" ? e : {
|
|
737
|
+
lineCount: e.lineCount + n.text.split(/\r\n|\r|\n/).length,
|
|
738
|
+
textLength: e.textLength + n.text.length
|
|
739
|
+
}, {
|
|
740
|
+
lineCount: 0,
|
|
741
|
+
textLength: 0
|
|
742
|
+
}), Zo = (t) => {
|
|
743
|
+
if (t.role !== "user") return !1;
|
|
744
|
+
const {
|
|
745
|
+
lineCount: e,
|
|
746
|
+
textLength: n
|
|
747
|
+
} = Jo(t);
|
|
748
|
+
return n > Ko || e > Xo;
|
|
749
|
+
}, es = (t, e) => {
|
|
750
|
+
const n = Math.max(0, t.scrollHeight - t.clientHeight);
|
|
751
|
+
return e === 0 || n <= _t ? !1 : e < 0 ? t.scrollTop > _t : t.scrollTop < n - _t;
|
|
752
|
+
}, ts = (t) => {
|
|
753
|
+
const e = S(8);
|
|
754
|
+
let n, s;
|
|
457
755
|
e[0] !== t ? ({
|
|
458
756
|
children: n,
|
|
459
|
-
...
|
|
460
|
-
} = t, e[0] = t, e[1] = n, e[2] =
|
|
757
|
+
...s
|
|
758
|
+
} = t, e[0] = t, e[1] = n, e[2] = s) : (n = e[1], s = e[2]);
|
|
461
759
|
let o;
|
|
462
|
-
e[3] !== n ? (o = /* @__PURE__ */
|
|
463
|
-
let
|
|
464
|
-
return e[5] !==
|
|
465
|
-
},
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
760
|
+
e[3] !== n ? (o = /* @__PURE__ */ l(Jt, { defaultState: n, fullWidth: !0 }), e[3] = n, e[4] = o) : o = e[4];
|
|
761
|
+
let r;
|
|
762
|
+
return e[5] !== s || e[6] !== o ? (r = /* @__PURE__ */ l(M, { ...s, children: o }), e[5] = s, e[6] = o, e[7] = r) : r = e[7], r;
|
|
763
|
+
}, ns = ts, rt = (t) => t.replace(/^tool-/i, "").replace(/([a-z0-9])([A-Z])/g, "$1_$2").replace(/[\s-]+/g, "_").toLowerCase(), os = (t) => {
|
|
764
|
+
const e = rt(t), n = e.replace(/_/g, "");
|
|
765
|
+
return [.../* @__PURE__ */ new Set([t, e, n])];
|
|
766
|
+
}, rn = {
|
|
767
|
+
shell: Kt,
|
|
768
|
+
ls: Gn,
|
|
769
|
+
read_file: Un,
|
|
770
|
+
write_file: Vn,
|
|
771
|
+
delete_file: Nn,
|
|
772
|
+
patch: jn,
|
|
773
|
+
upload_files: Hn,
|
|
774
|
+
download_file: Wn,
|
|
775
|
+
move_file: zn
|
|
776
|
+
}, ss = {
|
|
777
|
+
dot: eo,
|
|
778
|
+
danger: Xt,
|
|
779
|
+
search: Zn,
|
|
780
|
+
browser: Jn,
|
|
781
|
+
file: Yn,
|
|
782
|
+
question: Xn,
|
|
783
|
+
todo: Kn,
|
|
784
|
+
terminal: Kt,
|
|
785
|
+
...rn
|
|
786
|
+
}, Qt = "dot", rs = (t) => Object.hasOwn(rn, t), is = (t) => ss[t], ln = (t) => {
|
|
787
|
+
if (!t) return Qt;
|
|
788
|
+
const e = rt(t);
|
|
789
|
+
if (rs(e)) return e;
|
|
790
|
+
const n = e.replace(/_/g, "");
|
|
487
791
|
switch (e) {
|
|
488
792
|
case "read":
|
|
489
793
|
return "file";
|
|
@@ -498,61 +802,63 @@ const Hn = (t = "") => JSON.stringify(bn(t)), jn = 360, Nn = "min(10vh, 4rem)",
|
|
|
498
802
|
case "glob":
|
|
499
803
|
return "file";
|
|
500
804
|
case "todowrite":
|
|
501
|
-
return "
|
|
805
|
+
return "todo";
|
|
502
806
|
case "search":
|
|
503
807
|
return "search";
|
|
504
808
|
case "browser":
|
|
505
809
|
return "browser";
|
|
810
|
+
case "question":
|
|
811
|
+
return "question";
|
|
506
812
|
case "fs":
|
|
507
813
|
case "file":
|
|
508
814
|
return "file";
|
|
509
815
|
default:
|
|
510
|
-
return
|
|
816
|
+
return n === "todowrite" || n === "todo" ? "todo" : Qt;
|
|
511
817
|
}
|
|
512
818
|
};
|
|
513
|
-
function
|
|
819
|
+
function Ot(t) {
|
|
514
820
|
const e = t.lastIndexOf("/");
|
|
515
821
|
return e >= 0 ? t.slice(e + 1) : t;
|
|
516
822
|
}
|
|
517
|
-
function
|
|
823
|
+
function ot(t) {
|
|
518
824
|
if (!t) return null;
|
|
519
825
|
const e = t.split(" ")[0].trim();
|
|
520
826
|
if (e === "/dev/null") return null;
|
|
521
827
|
let n = e;
|
|
522
828
|
return (n.startsWith("a/") || n.startsWith("b/")) && (n = n.slice(2)), n.replace(/^\/+/, "").replace(/\\/g, "/");
|
|
523
829
|
}
|
|
524
|
-
const
|
|
830
|
+
const it = (t) => t.startsWith("--- "), Et = (t) => t.startsWith("+++ "), Dt = (t) => t.startsWith("@@"), ls = (t) => t.startsWith("+") && !(Et(t) || t === "+++"), cs = (t) => t.startsWith("-") && !(it(t) || t === "---"), as = (t, e) => {
|
|
525
831
|
t.has(e) || t.set(e, {
|
|
526
832
|
additions: 0,
|
|
527
833
|
deletions: 0
|
|
528
834
|
});
|
|
529
|
-
},
|
|
835
|
+
}, us = (t, e) => {
|
|
530
836
|
const n = t.get(e);
|
|
531
837
|
n && (n.additions += 1);
|
|
532
|
-
},
|
|
838
|
+
}, ds = (t, e) => {
|
|
533
839
|
const n = t.get(e);
|
|
534
840
|
n && (n.deletions += 1);
|
|
535
|
-
},
|
|
536
|
-
if (
|
|
841
|
+
}, fs = (t, e, n) => {
|
|
842
|
+
if (it(t))
|
|
537
843
|
return {
|
|
538
844
|
...e,
|
|
539
|
-
lastMinusHeader:
|
|
845
|
+
lastMinusHeader: ot(t.slice(4)),
|
|
540
846
|
inHunk: !1
|
|
541
847
|
};
|
|
542
|
-
if (
|
|
543
|
-
const o =
|
|
544
|
-
return o &&
|
|
848
|
+
if (Et(t)) {
|
|
849
|
+
const o = ot(t.slice(4)) ?? e.lastMinusHeader;
|
|
850
|
+
return o && as(n, o), {
|
|
545
851
|
...e,
|
|
546
852
|
currentPath: o,
|
|
547
853
|
inHunk: !1
|
|
548
854
|
};
|
|
549
855
|
}
|
|
550
|
-
return e.currentPath ?
|
|
856
|
+
return e.currentPath ? Dt(t) ? {
|
|
551
857
|
...e,
|
|
552
858
|
inHunk: !0
|
|
553
|
-
} : e.inHunk ?
|
|
859
|
+
} : e.inHunk ? ls(t) ? (us(n, e.currentPath), e) : (cs(t) && ds(n, e.currentPath), e) : e : e;
|
|
554
860
|
};
|
|
555
|
-
function
|
|
861
|
+
function cn(t) {
|
|
556
862
|
if (!t || typeof t != "string") return [];
|
|
557
863
|
const e = /* @__PURE__ */ new Map();
|
|
558
864
|
let n = {
|
|
@@ -560,34 +866,34 @@ function At(t) {
|
|
|
560
866
|
lastMinusHeader: null,
|
|
561
867
|
inHunk: !1
|
|
562
868
|
};
|
|
563
|
-
const
|
|
564
|
-
for (const o of
|
|
565
|
-
n =
|
|
869
|
+
const s = t.split(/\r?\n/);
|
|
870
|
+
for (const o of s)
|
|
871
|
+
n = fs(o, n, e);
|
|
566
872
|
return Array.from(e.entries()).map(([o, {
|
|
567
|
-
additions:
|
|
568
|
-
deletions:
|
|
873
|
+
additions: r,
|
|
874
|
+
deletions: i
|
|
569
875
|
}]) => ({
|
|
570
876
|
filePath: o,
|
|
571
|
-
additions:
|
|
572
|
-
deletions:
|
|
877
|
+
additions: r,
|
|
878
|
+
deletions: i
|
|
573
879
|
}));
|
|
574
880
|
}
|
|
575
|
-
function
|
|
576
|
-
return
|
|
881
|
+
function ps(t) {
|
|
882
|
+
return cn(t).map((e) => ({
|
|
577
883
|
kind: "diff",
|
|
578
|
-
fileName:
|
|
884
|
+
fileName: Ot(e.filePath),
|
|
579
885
|
filePath: e.filePath,
|
|
580
886
|
additions: e.additions,
|
|
581
887
|
deletions: e.deletions
|
|
582
888
|
}));
|
|
583
889
|
}
|
|
584
|
-
function
|
|
585
|
-
return
|
|
890
|
+
function ms(t) {
|
|
891
|
+
return cn(t).map((e) => e.filePath);
|
|
586
892
|
}
|
|
587
|
-
const
|
|
893
|
+
const an = (t) => it(t) || t.startsWith("diff --git "), hs = (t) => t.startsWith(" ") || t.startsWith("+") || t.startsWith("-") ? !1 : t.trim() !== "", gs = (t, e, n) => {
|
|
588
894
|
if (t.startsWith(" ")) {
|
|
589
|
-
const
|
|
590
|
-
e.push(
|
|
895
|
+
const s = t.slice(1);
|
|
896
|
+
e.push(s), n.push(s);
|
|
591
897
|
return;
|
|
592
898
|
}
|
|
593
899
|
if (t.startsWith("-")) {
|
|
@@ -595,61 +901,61 @@ const vt = (t) => Ee(t) || t.startsWith("diff --git "), sr = (t) => t.startsWith
|
|
|
595
901
|
return;
|
|
596
902
|
}
|
|
597
903
|
t.startsWith("+") && n.push(t.slice(1));
|
|
598
|
-
},
|
|
904
|
+
}, bs = (t, e, n, s) => {
|
|
599
905
|
let o = e;
|
|
600
906
|
for (; o < t.length; ) {
|
|
601
|
-
const
|
|
602
|
-
if (
|
|
907
|
+
const r = t[o] || "";
|
|
908
|
+
if (an(r) || Dt(r) || hs(r))
|
|
603
909
|
break;
|
|
604
|
-
|
|
910
|
+
gs(r, n, s), o += 1;
|
|
605
911
|
}
|
|
606
|
-
return (n.length > 0 ||
|
|
607
|
-
},
|
|
608
|
-
const n =
|
|
609
|
-
if (!
|
|
912
|
+
return (n.length > 0 || s.length > 0) && (n.push(""), s.push("")), o;
|
|
913
|
+
}, xs = (t, e) => {
|
|
914
|
+
const n = ot((t[e] || "").slice(4)), s = t[e + 1] || "";
|
|
915
|
+
if (!Et(s)) return {
|
|
610
916
|
nextIndex: e + 1
|
|
611
917
|
};
|
|
612
|
-
const
|
|
613
|
-
let
|
|
614
|
-
for (;
|
|
615
|
-
const
|
|
616
|
-
if (
|
|
617
|
-
if (!
|
|
618
|
-
|
|
918
|
+
const r = ot(s.slice(4)) ?? n ?? "", i = [], c = [];
|
|
919
|
+
let a = e + 2;
|
|
920
|
+
for (; a < t.length; ) {
|
|
921
|
+
const u = t[a] || "";
|
|
922
|
+
if (an(u)) break;
|
|
923
|
+
if (!Dt(u)) {
|
|
924
|
+
a += 1;
|
|
619
925
|
continue;
|
|
620
926
|
}
|
|
621
|
-
|
|
927
|
+
a = bs(t, a + 1, i, c);
|
|
622
928
|
}
|
|
623
929
|
return {
|
|
624
|
-
nextIndex:
|
|
930
|
+
nextIndex: a,
|
|
625
931
|
preview: {
|
|
626
|
-
filePath:
|
|
627
|
-
original:
|
|
932
|
+
filePath: r,
|
|
933
|
+
original: i.join(`
|
|
628
934
|
`),
|
|
629
|
-
modified:
|
|
935
|
+
modified: c.join(`
|
|
630
936
|
`)
|
|
631
937
|
}
|
|
632
938
|
};
|
|
633
939
|
};
|
|
634
|
-
function
|
|
940
|
+
function ys(t) {
|
|
635
941
|
if (!t || typeof t != "string") return [];
|
|
636
942
|
const e = t.split(/\r?\n/), n = [];
|
|
637
|
-
let
|
|
638
|
-
for (;
|
|
639
|
-
const o = e[
|
|
640
|
-
if (!
|
|
641
|
-
|
|
943
|
+
let s = 0;
|
|
944
|
+
for (; s < e.length; ) {
|
|
945
|
+
const o = e[s] || "";
|
|
946
|
+
if (!it(o)) {
|
|
947
|
+
s += 1;
|
|
642
948
|
continue;
|
|
643
949
|
}
|
|
644
950
|
const {
|
|
645
|
-
nextIndex:
|
|
646
|
-
preview:
|
|
647
|
-
} =
|
|
648
|
-
|
|
951
|
+
nextIndex: r,
|
|
952
|
+
preview: i
|
|
953
|
+
} = xs(e, s);
|
|
954
|
+
i && n.push(i), s = Math.max(r, s + 1);
|
|
649
955
|
}
|
|
650
956
|
return n;
|
|
651
957
|
}
|
|
652
|
-
const
|
|
958
|
+
const Ss = {
|
|
653
959
|
apply_patch: "Apply patch",
|
|
654
960
|
bash: "Run command",
|
|
655
961
|
edit: "Edit file",
|
|
@@ -658,7 +964,7 @@ const dr = {
|
|
|
658
964
|
read: "Read file",
|
|
659
965
|
skill: "Load skill",
|
|
660
966
|
todowrite: "Update todos"
|
|
661
|
-
},
|
|
967
|
+
}, Ft = {
|
|
662
968
|
pending: "queued",
|
|
663
969
|
error: "failed",
|
|
664
970
|
"output-error": "failed",
|
|
@@ -667,27 +973,27 @@ const dr = {
|
|
|
667
973
|
running: "running",
|
|
668
974
|
completed: "completed",
|
|
669
975
|
failed: "failed"
|
|
670
|
-
},
|
|
671
|
-
const e =
|
|
672
|
-
return
|
|
673
|
-
},
|
|
976
|
+
}, un = (t) => t.replace(/^tool-/, "").toLowerCase(), ks = (t) => t.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), ws = (t) => un(t.tool ?? "tool"), Ts = (t) => {
|
|
977
|
+
const e = un(t);
|
|
978
|
+
return Ss[e] ?? ks(e.replace(/_/g, " "));
|
|
979
|
+
}, Cs = (t) => {
|
|
674
980
|
const e = t.state?.status ?? t.status;
|
|
675
981
|
if (!e || typeof e != "string") return null;
|
|
676
982
|
const n = e.replace(/-/g, "_");
|
|
677
|
-
return
|
|
678
|
-
},
|
|
983
|
+
return Ft[n] ? Ft[n] : n.includes("stream") ? "running" : null;
|
|
984
|
+
}, dn = (t) => {
|
|
679
985
|
const e = t.state?.status ?? t.status;
|
|
680
986
|
return e === "error" || e === "output-error" || e === "failed";
|
|
681
|
-
},
|
|
987
|
+
}, te = (t) => dn(t) ? {
|
|
682
988
|
type: "icon",
|
|
683
989
|
icon: "danger"
|
|
684
990
|
} : {
|
|
685
991
|
type: "icon",
|
|
686
|
-
icon:
|
|
687
|
-
},
|
|
992
|
+
icon: ln(ws(t))
|
|
993
|
+
}, ne = (t, e, n) => {
|
|
688
994
|
const o = [{
|
|
689
995
|
kind: "text",
|
|
690
|
-
text: n ??
|
|
996
|
+
text: n ?? Ts(t.tool ?? "tool"),
|
|
691
997
|
bold: !0
|
|
692
998
|
}];
|
|
693
999
|
e && o.push({
|
|
@@ -695,258 +1001,354 @@ const dr = {
|
|
|
695
1001
|
text: e,
|
|
696
1002
|
muted: !0
|
|
697
1003
|
});
|
|
698
|
-
const
|
|
699
|
-
return
|
|
1004
|
+
const r = Cs(t);
|
|
1005
|
+
return r && r !== "completed" && o.push({
|
|
700
1006
|
kind: "text",
|
|
701
|
-
text:
|
|
1007
|
+
text: r,
|
|
702
1008
|
muted: !0
|
|
703
1009
|
}), o;
|
|
704
|
-
},
|
|
1010
|
+
}, xe = (t) => {
|
|
705
1011
|
const e = t.state?.input;
|
|
706
1012
|
return !e || typeof e != "object" || Array.isArray(e) ? null : e;
|
|
707
|
-
},
|
|
1013
|
+
}, ve = (t) => {
|
|
708
1014
|
const e = t.state?.output;
|
|
709
1015
|
return !e || typeof e != "object" || Array.isArray(e) ? null : e;
|
|
710
|
-
},
|
|
711
|
-
const n =
|
|
712
|
-
return n ?
|
|
713
|
-
},
|
|
714
|
-
const e =
|
|
715
|
-
return [
|
|
716
|
-
},
|
|
717
|
-
const e =
|
|
1016
|
+
}, y = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, st = (t) => !t || typeof t != "object" || Array.isArray(t) ? null : t, _s = (t, e) => {
|
|
1017
|
+
const n = st(t.state);
|
|
1018
|
+
return n ? st(n[e]) : null;
|
|
1019
|
+
}, As = (t) => t.replace(/\\/g, "/").replace(/^\/+/, ""), Rs = (t) => t.includes("--- ") && t.includes("+++ ") && t.includes("@@"), fn = (t) => {
|
|
1020
|
+
const e = ve(t);
|
|
1021
|
+
return [_s(t, "metadata"), st(e?.metadata)].filter(Boolean);
|
|
1022
|
+
}, Bs = (t) => {
|
|
1023
|
+
const e = st(t);
|
|
718
1024
|
if (!e) return null;
|
|
719
|
-
const n =
|
|
1025
|
+
const n = y(e.filePath) ?? y(e.relativePath) ?? y(e.path);
|
|
720
1026
|
return n ? {
|
|
721
|
-
filePath:
|
|
1027
|
+
filePath: As(n),
|
|
722
1028
|
additions: typeof e.additions == "number" ? e.additions : 0,
|
|
723
1029
|
deletions: typeof e.deletions == "number" ? e.deletions : 0,
|
|
724
|
-
diff:
|
|
725
|
-
before:
|
|
726
|
-
after:
|
|
1030
|
+
diff: y(e.diff) ?? void 0,
|
|
1031
|
+
before: y(e.before) ?? void 0,
|
|
1032
|
+
after: y(e.after) ?? void 0
|
|
727
1033
|
} : null;
|
|
728
|
-
},
|
|
1034
|
+
}, pn = (t) => {
|
|
729
1035
|
const e = [];
|
|
730
|
-
for (const n of
|
|
731
|
-
const
|
|
732
|
-
for (const o of
|
|
733
|
-
const
|
|
734
|
-
|
|
1036
|
+
for (const n of fn(t)) {
|
|
1037
|
+
const s = Array.isArray(n.files) ? n.files : [];
|
|
1038
|
+
for (const o of s) {
|
|
1039
|
+
const r = Bs(o);
|
|
1040
|
+
r && e.push(r);
|
|
735
1041
|
}
|
|
736
1042
|
}
|
|
737
1043
|
return e;
|
|
738
|
-
},
|
|
739
|
-
const e =
|
|
1044
|
+
}, Is = (t) => {
|
|
1045
|
+
const e = xe(t), n = y(e?.diff);
|
|
740
1046
|
if (n) return n;
|
|
741
|
-
for (const
|
|
742
|
-
const
|
|
743
|
-
if (
|
|
1047
|
+
for (const r of fn(t)) {
|
|
1048
|
+
const i = y(r.diff);
|
|
1049
|
+
if (i) return i;
|
|
744
1050
|
}
|
|
745
|
-
const
|
|
746
|
-
if (
|
|
1051
|
+
const s = pn(t).map((r) => r.diff).filter((r) => !!r);
|
|
1052
|
+
if (s.length > 0) return s.join(`
|
|
747
1053
|
`);
|
|
748
|
-
const o =
|
|
749
|
-
return o &&
|
|
750
|
-
},
|
|
1054
|
+
const o = y(e?.patchText);
|
|
1055
|
+
return o && Rs(o) ? o : null;
|
|
1056
|
+
}, Ps = (t) => {
|
|
751
1057
|
const e = /* @__PURE__ */ new Set(), n = [];
|
|
752
|
-
for (const
|
|
753
|
-
e.has(
|
|
1058
|
+
for (const s of t)
|
|
1059
|
+
e.has(s.filePath) || (e.add(s.filePath), n.push({
|
|
754
1060
|
kind: "diff",
|
|
755
|
-
fileName:
|
|
756
|
-
filePath:
|
|
757
|
-
additions:
|
|
758
|
-
deletions:
|
|
1061
|
+
fileName: Ot(s.filePath),
|
|
1062
|
+
filePath: s.filePath,
|
|
1063
|
+
additions: s.additions,
|
|
1064
|
+
deletions: s.deletions
|
|
759
1065
|
}));
|
|
760
1066
|
return n;
|
|
761
|
-
},
|
|
762
|
-
const e =
|
|
763
|
-
return
|
|
764
|
-
},
|
|
1067
|
+
}, Ms = (t) => Array.from(new Set(t.map((e) => e.filePath))), lt = (t) => {
|
|
1068
|
+
const e = ve(t);
|
|
1069
|
+
return y(t.state?.output) ?? y(e?.returnDisplay) ?? y(e?.preview) ?? y(e?.stdout) ?? y(e?.content);
|
|
1070
|
+
}, $s = (t) => {
|
|
765
1071
|
const e = t.match(/<skill_content(?:\s+name="([^"]+)")?>([\s\S]*?)<\/skill_content>/);
|
|
766
1072
|
return e ? {
|
|
767
|
-
skillName:
|
|
768
|
-
content:
|
|
1073
|
+
skillName: y(e[1]) ?? void 0,
|
|
1074
|
+
content: y(e[2]) ?? ""
|
|
769
1075
|
} : null;
|
|
770
|
-
},
|
|
771
|
-
const e =
|
|
772
|
-
return
|
|
773
|
-
},
|
|
1076
|
+
}, Os = (t) => {
|
|
1077
|
+
const e = xe(t);
|
|
1078
|
+
return y(e?.name) ?? y(e?.skillName) ?? y(e?.skill) ?? y(e?.skill_name) ?? void 0;
|
|
1079
|
+
}, mn = (t) => ({
|
|
774
1080
|
kind: "link",
|
|
775
|
-
text:
|
|
1081
|
+
text: Ot(t),
|
|
776
1082
|
filePath: t
|
|
777
|
-
}),
|
|
1083
|
+
}), oe = (t, e) => !dn(t) || !t.state?.errorText ? e : [{
|
|
778
1084
|
type: "comment",
|
|
779
1085
|
text: t.state.errorText
|
|
780
|
-
}, ...e],
|
|
1086
|
+
}, ...e], hn = (t) => ys(t ?? void 0).map((e) => ({
|
|
781
1087
|
type: "diff",
|
|
782
1088
|
language: "diff",
|
|
783
1089
|
original: e.original,
|
|
784
1090
|
modified: e.modified,
|
|
785
1091
|
sideBySide: !1
|
|
786
|
-
})),
|
|
787
|
-
const e =
|
|
788
|
-
o.length > 0 ?
|
|
789
|
-
const
|
|
790
|
-
if (
|
|
791
|
-
for (const
|
|
792
|
-
!
|
|
1092
|
+
})), Es = (t) => ps(t ?? void 0), Ds = (t) => ms(t ?? void 0), Ls = (t) => {
|
|
1093
|
+
const e = Is(t), n = pn(t), s = ne(t, void 0, "Apply patch"), o = Es(e);
|
|
1094
|
+
o.length > 0 ? s.push(...o) : s.push(...Ps(n));
|
|
1095
|
+
const r = [...hn(e)];
|
|
1096
|
+
if (r.length === 0)
|
|
1097
|
+
for (const i of n)
|
|
1098
|
+
!i.before && !i.after || r.push({
|
|
793
1099
|
type: "diff",
|
|
794
1100
|
language: "diff",
|
|
795
|
-
original:
|
|
796
|
-
modified:
|
|
1101
|
+
original: i.before ?? "",
|
|
1102
|
+
modified: i.after ?? "",
|
|
797
1103
|
sideBySide: !1
|
|
798
1104
|
});
|
|
799
|
-
if (
|
|
800
|
-
const
|
|
801
|
-
|
|
1105
|
+
if (r.length === 0) {
|
|
1106
|
+
const i = Ds(e);
|
|
1107
|
+
i.length === 0 && i.push(...Ms(n)), i.length > 0 && r.push({
|
|
802
1108
|
type: "references",
|
|
803
|
-
references:
|
|
1109
|
+
references: i
|
|
804
1110
|
});
|
|
805
1111
|
}
|
|
806
1112
|
return {
|
|
807
|
-
indicator:
|
|
808
|
-
title:
|
|
809
|
-
blocks:
|
|
1113
|
+
indicator: te(t),
|
|
1114
|
+
title: s,
|
|
1115
|
+
blocks: oe(t, r)
|
|
810
1116
|
};
|
|
811
|
-
},
|
|
1117
|
+
}, qs = (t, e) => [{
|
|
812
1118
|
type: "diff",
|
|
813
1119
|
language: "text",
|
|
814
1120
|
original: t,
|
|
815
1121
|
modified: e,
|
|
816
1122
|
sideBySide: !1
|
|
817
|
-
}],
|
|
818
|
-
const e =
|
|
819
|
-
|
|
820
|
-
const
|
|
1123
|
+
}], vs = (t) => {
|
|
1124
|
+
const e = xe(t), n = ve(t), s = y(e?.filePath) ?? y(e?.file_path) ?? y(n?.filePath) ?? void 0, o = y(n?.oldString) ?? y(e?.old_string) ?? void 0, r = y(n?.newString) ?? y(e?.new_string) ?? void 0, i = ne(t, void 0, "Edit file");
|
|
1125
|
+
s && i.push(mn(s));
|
|
1126
|
+
const c = o !== void 0 && r !== void 0 ? qs(o, r) : hn(y(n?.diff));
|
|
821
1127
|
return {
|
|
822
|
-
indicator:
|
|
823
|
-
title:
|
|
824
|
-
blocks:
|
|
1128
|
+
indicator: te(t),
|
|
1129
|
+
title: i,
|
|
1130
|
+
blocks: oe(t, c)
|
|
1131
|
+
};
|
|
1132
|
+
}, Qe = (t) => typeof t == "object" && t !== null && !Array.isArray(t), Qs = (t) => {
|
|
1133
|
+
try {
|
|
1134
|
+
const e = JSON.parse(t);
|
|
1135
|
+
return Qe(e) ? e : null;
|
|
1136
|
+
} catch {
|
|
1137
|
+
return null;
|
|
1138
|
+
}
|
|
1139
|
+
}, Fs = (t) => Qe(t) ? t : typeof t == "string" && t.trim().length > 0 ? Qs(t) : null, Pe = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, be = (t) => {
|
|
1140
|
+
const e = Pe(t);
|
|
1141
|
+
if (e) return e;
|
|
1142
|
+
if (Array.isArray(t)) {
|
|
1143
|
+
const n = t.map(be).filter((s) => s !== null);
|
|
1144
|
+
return n.length > 0 ? n.join(`
|
|
1145
|
+
`) : null;
|
|
1146
|
+
}
|
|
1147
|
+
return Qe(t) ? be(t.response) ?? be(t.answer) ?? be(t.text) ?? be(t.answers) : null;
|
|
1148
|
+
}, zs = (t) => {
|
|
1149
|
+
if (typeof t == "string" && t.trim().length > 0)
|
|
1150
|
+
return {
|
|
1151
|
+
label: t,
|
|
1152
|
+
description: void 0
|
|
1153
|
+
};
|
|
1154
|
+
if (!Qe(t)) return null;
|
|
1155
|
+
const e = Pe(t.label);
|
|
1156
|
+
return e ? {
|
|
1157
|
+
label: e,
|
|
1158
|
+
description: Pe(t.description) ?? void 0
|
|
1159
|
+
} : null;
|
|
1160
|
+
}, Ws = (t, e) => {
|
|
1161
|
+
if (!Qe(t)) return null;
|
|
1162
|
+
const n = Pe(t.question);
|
|
1163
|
+
if (!n) return null;
|
|
1164
|
+
const s = Array.isArray(t.options) ? t.options.map(zs).filter((i) => i !== null) : [], o = Pe(t.type), r = typeof t.custom == "boolean" ? t.custom : typeof t.allowCustomAnswer == "boolean" ? t.allowCustomAnswer : o === "freeform" || o === "text";
|
|
1165
|
+
return s.length === 0 && !r ? null : {
|
|
1166
|
+
id: Pe(t.id) ?? `question-${e}`,
|
|
1167
|
+
question: n,
|
|
1168
|
+
options: s,
|
|
1169
|
+
multiple: typeof t.multiple == "boolean" ? t.multiple : o === "multi_choice" || o === "multiple_choice",
|
|
1170
|
+
required: typeof t.required == "boolean" ? t.required : !1,
|
|
1171
|
+
allowCustomAnswer: r
|
|
1172
|
+
};
|
|
1173
|
+
}, Hs = (t) => {
|
|
1174
|
+
const e = Fs(t);
|
|
1175
|
+
if (!e || !Array.isArray(e.questions)) return null;
|
|
1176
|
+
const n = e.questions.map(Ws).filter((s) => s !== null);
|
|
1177
|
+
return n.length === 0 ? null : {
|
|
1178
|
+
type: "question-form",
|
|
1179
|
+
questions: n
|
|
825
1180
|
};
|
|
826
|
-
},
|
|
827
|
-
const
|
|
828
|
-
|
|
829
|
-
|
|
1181
|
+
}, js = (t) => {
|
|
1182
|
+
const {
|
|
1183
|
+
buildBaseTitle: e,
|
|
1184
|
+
buildIndicator: n,
|
|
1185
|
+
prependErrorBlock: s
|
|
1186
|
+
} = t;
|
|
1187
|
+
return (o) => {
|
|
1188
|
+
const r = be(o.state?.output) ?? be(o.state?.metadata), i = Hs(o.state?.input);
|
|
1189
|
+
if (!r && !i) return null;
|
|
1190
|
+
const c = i ? `${i.questions.length} field${i.questions.length === 1 ? "" : "s"}` : void 0, a = r ? [] : [i];
|
|
1191
|
+
return {
|
|
1192
|
+
indicator: n(o),
|
|
1193
|
+
title: e(o, c, "Question"),
|
|
1194
|
+
blocks: s(o, a),
|
|
1195
|
+
expandable: !1
|
|
1196
|
+
};
|
|
1197
|
+
};
|
|
1198
|
+
}, Ns = (t) => {
|
|
1199
|
+
const e = xe(t), n = ve(t), s = y(e?.filePath) ?? y(e?.file_path) ?? y(e?.file) ?? y(n?.filePath) ?? y(n?.file) ?? y(n?.path) ?? void 0, o = ne(t, void 0, "Read file");
|
|
1200
|
+
return s && o.push(mn(s)), {
|
|
1201
|
+
indicator: te(t),
|
|
830
1202
|
title: o,
|
|
831
|
-
blocks:
|
|
1203
|
+
blocks: oe(t, [])
|
|
832
1204
|
};
|
|
833
|
-
},
|
|
834
|
-
const e =
|
|
835
|
-
|
|
1205
|
+
}, Vs = (t) => {
|
|
1206
|
+
const e = xe(t), n = ve(t), s = y(e?.command) ?? void 0, o = ne(t, s, "Run command"), r = [], i = lt(t);
|
|
1207
|
+
i && r.push({
|
|
836
1208
|
type: "code",
|
|
837
1209
|
language: "text",
|
|
838
|
-
code:
|
|
1210
|
+
code: i
|
|
839
1211
|
});
|
|
840
|
-
const
|
|
841
|
-
return
|
|
1212
|
+
const c = y(n?.stderr);
|
|
1213
|
+
return c && c !== i && r.push({
|
|
842
1214
|
type: "code",
|
|
843
1215
|
language: "text",
|
|
844
|
-
code:
|
|
845
|
-
}), typeof n?.exitCode == "number" &&
|
|
1216
|
+
code: c
|
|
1217
|
+
}), typeof n?.exitCode == "number" && r.push({
|
|
846
1218
|
type: "text",
|
|
847
1219
|
text: `Exit code: ${n.exitCode}`
|
|
848
1220
|
}), {
|
|
849
|
-
indicator:
|
|
1221
|
+
indicator: te(t),
|
|
850
1222
|
title: o,
|
|
851
|
-
blocks:
|
|
1223
|
+
blocks: oe(t, r)
|
|
852
1224
|
};
|
|
853
|
-
},
|
|
854
|
-
const e =
|
|
1225
|
+
}, Us = (t) => {
|
|
1226
|
+
const e = xe(t), n = lt(t), s = y(e?.pattern) ?? void 0, o = ne(t, s, "Search files"), r = n ? [{
|
|
855
1227
|
type: "code",
|
|
856
1228
|
language: "text",
|
|
857
1229
|
code: n
|
|
858
1230
|
}] : [];
|
|
859
1231
|
return {
|
|
860
|
-
indicator:
|
|
1232
|
+
indicator: te(t),
|
|
861
1233
|
title: o,
|
|
862
|
-
blocks:
|
|
1234
|
+
blocks: oe(t, r)
|
|
863
1235
|
};
|
|
864
|
-
},
|
|
865
|
-
const e =
|
|
1236
|
+
}, Gs = (t) => {
|
|
1237
|
+
const e = xe(t), n = lt(t), s = y(e?.pattern) ?? void 0, o = ne(t, s, "Find files"), r = [];
|
|
866
1238
|
if (n) {
|
|
867
|
-
const
|
|
868
|
-
|
|
1239
|
+
const i = n.split(/\r?\n/).map((c) => c.trim()).filter((c) => c.length > 0);
|
|
1240
|
+
i.length > 0 && r.push({
|
|
869
1241
|
type: "references",
|
|
870
|
-
references:
|
|
1242
|
+
references: i
|
|
871
1243
|
});
|
|
872
1244
|
}
|
|
873
1245
|
return {
|
|
874
|
-
indicator:
|
|
1246
|
+
indicator: te(t),
|
|
875
1247
|
title: o,
|
|
876
|
-
blocks:
|
|
1248
|
+
blocks: oe(t, r)
|
|
877
1249
|
};
|
|
878
|
-
},
|
|
879
|
-
const e =
|
|
1250
|
+
}, Ks = (t) => {
|
|
1251
|
+
const e = lt(t), n = e ? $s(e) : null, s = Os(t) ?? n?.skillName, o = ne(t, s, "Load skill"), r = n?.content ?? e, i = r ? [{
|
|
880
1252
|
type: "code",
|
|
881
1253
|
language: "markdown",
|
|
882
|
-
code:
|
|
1254
|
+
code: r
|
|
883
1255
|
}] : [];
|
|
884
1256
|
return {
|
|
885
|
-
indicator:
|
|
1257
|
+
indicator: te(t),
|
|
886
1258
|
title: o,
|
|
887
|
-
blocks:
|
|
1259
|
+
blocks: oe(t, i)
|
|
888
1260
|
};
|
|
889
|
-
},
|
|
890
|
-
const e =
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
if (!l || typeof l != "object" || Array.isArray(l)) continue;
|
|
896
|
-
const a = l;
|
|
897
|
-
typeof a.content != "string" || a.content.trim().length === 0 || s.push({
|
|
898
|
-
content: a.content,
|
|
899
|
-
status: typeof a.status == "string" ? a.status : void 0,
|
|
900
|
-
priority: typeof a.priority == "string" ? a.priority : void 0
|
|
901
|
-
});
|
|
902
|
-
}
|
|
903
|
-
if (s.length > 0) return s;
|
|
904
|
-
}
|
|
905
|
-
return [];
|
|
906
|
-
}, pt = (t) => t?.replace(/_/g, " ") ?? null, Er = (t) => {
|
|
907
|
-
const e = zr(t);
|
|
1261
|
+
}, At = (t) => typeof t == "string" && t.trim().length > 0 ? t : null, gn = (t) => !t || typeof t != "object" || Array.isArray(t) ? null : t, Xs = (t) => {
|
|
1262
|
+
const e = gn(t);
|
|
1263
|
+
if (!e) return null;
|
|
1264
|
+
const n = At(e.content) ?? At(e.title);
|
|
1265
|
+
if (!n) return null;
|
|
1266
|
+
const s = At(e.status);
|
|
908
1267
|
return {
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
1268
|
+
label: n,
|
|
1269
|
+
checked: s === "completed"
|
|
1270
|
+
};
|
|
1271
|
+
}, zt = (t) => {
|
|
1272
|
+
if (!t) return {
|
|
1273
|
+
items: [],
|
|
1274
|
+
explicit: !1
|
|
1275
|
+
};
|
|
1276
|
+
const e = (() => {
|
|
1277
|
+
if (Array.isArray(t)) return t;
|
|
1278
|
+
const n = gn(t);
|
|
1279
|
+
return !n || !Array.isArray(n.todos) ? null : n.todos;
|
|
1280
|
+
})();
|
|
1281
|
+
return e ? {
|
|
1282
|
+
items: e.map(Xs).filter((n) => n !== null),
|
|
1283
|
+
explicit: !0
|
|
1284
|
+
} : {
|
|
1285
|
+
items: [],
|
|
1286
|
+
explicit: !1
|
|
1287
|
+
};
|
|
1288
|
+
}, Ys = (t) => {
|
|
1289
|
+
const {
|
|
1290
|
+
buildBaseTitle: e,
|
|
1291
|
+
buildIndicator: n,
|
|
1292
|
+
prependErrorBlock: s
|
|
1293
|
+
} = t;
|
|
1294
|
+
return (o) => {
|
|
1295
|
+
const r = zt(o.state?.input), i = zt(o.state?.output), c = i.explicit ? i : r;
|
|
1296
|
+
if (!c.explicit) return null;
|
|
1297
|
+
const a = c.items, u = `${a.length} item${a.length === 1 ? "" : "s"}`, d = e(o, u, "Update todos");
|
|
1298
|
+
if (a.length === 0)
|
|
1299
|
+
return {
|
|
1300
|
+
indicator: n(o),
|
|
1301
|
+
title: d,
|
|
1302
|
+
blocks: s(o, [{
|
|
1303
|
+
type: "comment",
|
|
1304
|
+
text: "No todos"
|
|
1305
|
+
}])
|
|
1306
|
+
};
|
|
1307
|
+
const f = [{
|
|
1308
|
+
type: "todo-list",
|
|
1309
|
+
items: a
|
|
1310
|
+
}];
|
|
1311
|
+
return {
|
|
1312
|
+
indicator: n(o),
|
|
1313
|
+
title: d,
|
|
1314
|
+
blocks: s(o, f)
|
|
1315
|
+
};
|
|
924
1316
|
};
|
|
925
|
-
},
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
1317
|
+
}, Js = js({
|
|
1318
|
+
buildBaseTitle: ne,
|
|
1319
|
+
buildIndicator: te,
|
|
1320
|
+
prependErrorBlock: oe
|
|
1321
|
+
}), Wt = Ys({
|
|
1322
|
+
buildBaseTitle: ne,
|
|
1323
|
+
buildIndicator: te,
|
|
1324
|
+
prependErrorBlock: oe
|
|
1325
|
+
}), Ht = () => ({
|
|
1326
|
+
apply_patch: Ls,
|
|
1327
|
+
bash: Vs,
|
|
1328
|
+
edit: vs,
|
|
1329
|
+
glob: Gs,
|
|
1330
|
+
grep: Us,
|
|
1331
|
+
question: Js,
|
|
1332
|
+
read: Ns,
|
|
1333
|
+
skill: Ks,
|
|
1334
|
+
todo_write: Wt,
|
|
1335
|
+
todowrite: Wt
|
|
1336
|
+
}), jt = {
|
|
935
1337
|
pending: "queued",
|
|
936
1338
|
error: "failed",
|
|
937
1339
|
"output-error": "failed",
|
|
938
1340
|
"input-streaming": "running",
|
|
939
1341
|
"input-available": "queued"
|
|
940
|
-
},
|
|
941
|
-
const e =
|
|
942
|
-
return
|
|
943
|
-
},
|
|
1342
|
+
}, Zs = (t) => t.split(" ").filter((e) => e.length > 0).map((e) => e[0].toUpperCase() + e.slice(1)).join(" "), er = (t) => {
|
|
1343
|
+
const e = rt(t ?? "tool").replace(/_/g, " ");
|
|
1344
|
+
return Zs(e);
|
|
1345
|
+
}, bn = (t) => t === "error" || t === "output-error", tr = (t) => bn(t.state?.status) ? {
|
|
944
1346
|
type: "icon",
|
|
945
1347
|
icon: "danger"
|
|
946
1348
|
} : {
|
|
947
1349
|
type: "icon",
|
|
948
|
-
icon:
|
|
949
|
-
},
|
|
1350
|
+
icon: ln(t.tool ?? "tool")
|
|
1351
|
+
}, nr = (t) => !t || typeof t != "string" ? null : jt[t] ? jt[t] : t.includes("stream") ? "running" : null, Nt = (t) => {
|
|
950
1352
|
if (typeof t == "string") return t;
|
|
951
1353
|
if (t == null) return null;
|
|
952
1354
|
try {
|
|
@@ -954,326 +1356,360 @@ const dr = {
|
|
|
954
1356
|
} catch {
|
|
955
1357
|
return null;
|
|
956
1358
|
}
|
|
957
|
-
},
|
|
1359
|
+
}, or = (t) => {
|
|
958
1360
|
const e = [];
|
|
959
|
-
|
|
1361
|
+
bn(t.state?.status) && t.state?.errorText && e.push({
|
|
960
1362
|
type: "comment",
|
|
961
1363
|
text: t.state.errorText
|
|
962
1364
|
});
|
|
963
|
-
const n =
|
|
1365
|
+
const n = Nt(t.state?.input);
|
|
964
1366
|
n && e.push({
|
|
965
1367
|
type: "code",
|
|
966
1368
|
language: "json",
|
|
967
1369
|
code: n
|
|
968
1370
|
});
|
|
969
|
-
const
|
|
970
|
-
return
|
|
1371
|
+
const s = Nt(t.state?.output);
|
|
1372
|
+
return s && e.push({
|
|
971
1373
|
type: "code",
|
|
972
1374
|
language: "json",
|
|
973
|
-
code:
|
|
1375
|
+
code: s
|
|
974
1376
|
}), e;
|
|
975
|
-
},
|
|
1377
|
+
}, sr = (t) => {
|
|
976
1378
|
const e = [{
|
|
977
1379
|
kind: "text",
|
|
978
|
-
text:
|
|
1380
|
+
text: er(t.tool),
|
|
979
1381
|
bold: !0
|
|
980
|
-
}], n =
|
|
1382
|
+
}], n = nr(t.state?.status);
|
|
981
1383
|
return n && e.push({
|
|
982
1384
|
kind: "text",
|
|
983
1385
|
text: n,
|
|
984
1386
|
muted: !0
|
|
985
1387
|
}), {
|
|
986
|
-
indicator:
|
|
1388
|
+
indicator: tr(t),
|
|
987
1389
|
title: e,
|
|
988
|
-
blocks:
|
|
1390
|
+
blocks: or(t)
|
|
989
1391
|
};
|
|
990
|
-
},
|
|
991
|
-
...
|
|
1392
|
+
}, rr = (t) => t ? {
|
|
1393
|
+
...Ht(),
|
|
992
1394
|
...t
|
|
993
|
-
} :
|
|
1395
|
+
} : Ht(), ir = (t, e) => {
|
|
994
1396
|
const n = t.tool ?? "tool";
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1397
|
+
for (const s of os(n)) {
|
|
1398
|
+
const o = e[s];
|
|
1399
|
+
if (o) return o;
|
|
1400
|
+
}
|
|
1401
|
+
}, lr = (t, e, n) => {
|
|
1402
|
+
const s = ir(t, e);
|
|
1403
|
+
if (s) {
|
|
1404
|
+
const o = s(t, n);
|
|
1000
1405
|
if (o) return o;
|
|
1001
1406
|
}
|
|
1002
|
-
return
|
|
1003
|
-
},
|
|
1004
|
-
const n =
|
|
1407
|
+
return sr(t);
|
|
1408
|
+
}, cr = (t, e) => {
|
|
1409
|
+
const n = rr(e?.toolRenderers);
|
|
1005
1410
|
return {
|
|
1006
|
-
items: t.map((o) =>
|
|
1411
|
+
items: t.map((o) => lr(o, n, e))
|
|
1007
1412
|
};
|
|
1008
|
-
},
|
|
1009
|
-
|
|
1413
|
+
}, ue = On, xn = (t, e, n, s = !1) => {
|
|
1414
|
+
s && t.stopPropagation(), e.href || t.preventDefault(), e.filePath && n?.(e.filePath);
|
|
1010
1415
|
};
|
|
1011
|
-
function
|
|
1012
|
-
const e =
|
|
1416
|
+
function ar(t) {
|
|
1417
|
+
const e = S(6), {
|
|
1013
1418
|
seg: n
|
|
1014
1419
|
} = t;
|
|
1015
|
-
let r;
|
|
1016
|
-
e[0] !== n.alt || e[1] !== n.src ? (r = /* @__PURE__ */ i(he.Image, { src: n.src, alt: n.alt }), e[0] = n.alt, e[1] = n.src, e[2] = r) : r = e[2];
|
|
1017
|
-
let o;
|
|
1018
|
-
e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ i(he.Fallback, {}), e[3] = o) : o = e[3];
|
|
1019
1420
|
let s;
|
|
1020
|
-
|
|
1021
|
-
|
|
1421
|
+
e[0] !== n.alt || e[1] !== n.src ? (s = /* @__PURE__ */ l(Ie.Image, { src: n.src, alt: n.alt }), e[0] = n.alt, e[1] = n.src, e[2] = s) : s = e[2];
|
|
1422
|
+
let o;
|
|
1423
|
+
e[3] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ l(Ie.Fallback, {}), e[3] = o) : o = e[3];
|
|
1424
|
+
let r;
|
|
1425
|
+
return e[4] !== s ? (r = /* @__PURE__ */ w(Ie.Root, { width: "1.5rem", height: "1.5rem", children: [
|
|
1426
|
+
s,
|
|
1022
1427
|
o
|
|
1023
|
-
] }), e[4] =
|
|
1428
|
+
] }), e[4] = s, e[5] = r) : r = e[5], r;
|
|
1024
1429
|
}
|
|
1025
|
-
function
|
|
1026
|
-
const e =
|
|
1430
|
+
function ur(t) {
|
|
1431
|
+
const e = S(9), {
|
|
1027
1432
|
seg: n,
|
|
1028
|
-
onOpenFile:
|
|
1029
|
-
} = t, o = n.additions ?? 0,
|
|
1030
|
-
let
|
|
1031
|
-
e[0] !==
|
|
1032
|
-
const
|
|
1033
|
-
|
|
1034
|
-
}, e[0] =
|
|
1035
|
-
let
|
|
1036
|
-
return e[4] !== n.fileName || e[5] !== o || e[6] !==
|
|
1433
|
+
onOpenFile: s
|
|
1434
|
+
} = t, o = n.additions ?? 0, r = n.deletions ?? 0;
|
|
1435
|
+
let i;
|
|
1436
|
+
e[0] !== s || e[1] !== n.fileName || e[2] !== n.filePath ? (i = () => {
|
|
1437
|
+
const a = n.filePath ?? n.fileName;
|
|
1438
|
+
s?.(a);
|
|
1439
|
+
}, e[0] = s, e[1] = n.fileName, e[2] = n.filePath, e[3] = i) : i = e[3];
|
|
1440
|
+
let c;
|
|
1441
|
+
return e[4] !== n.fileName || e[5] !== o || e[6] !== r || e[7] !== i ? (c = /* @__PURE__ */ l(en, { fileName: n.fileName, additions: o, deletions: r, onClickFileLink: i }), e[4] = n.fileName, e[5] = o, e[6] = r, e[7] = i, e[8] = c) : c = e[8], c;
|
|
1037
1442
|
}
|
|
1038
|
-
function
|
|
1039
|
-
const e =
|
|
1443
|
+
function dr(t) {
|
|
1444
|
+
const e = S(13), {
|
|
1040
1445
|
seg: n,
|
|
1041
|
-
onOpenFile:
|
|
1042
|
-
} = t, o = n.bold ? "medium" : void 0,
|
|
1043
|
-
let d;
|
|
1044
|
-
e[0] !== r || e[1] !== n ? (d = (m) => Lt(m, n, r, !0), e[0] = r, e[1] = n, e[2] = d) : d = e[2];
|
|
1045
|
-
const f = n.muted ? "fg.muted" : "fg.blue-dark";
|
|
1446
|
+
onOpenFile: s
|
|
1447
|
+
} = t, o = n.bold ? "medium" : void 0, r = !!(n.href || n.filePath), i = n.href ?? "#", c = (n.muted, "fg.muted"), a = r ? "pointer" : "default";
|
|
1046
1448
|
let u;
|
|
1047
|
-
e[
|
|
1449
|
+
e[0] !== s || e[1] !== n ? (u = (p) => xn(p, n, s, !0), e[0] = s, e[1] = n, e[2] = u) : u = e[2];
|
|
1450
|
+
const d = n.muted ? "fg.muted" : "fg.blue-dark";
|
|
1451
|
+
let f;
|
|
1452
|
+
e[3] !== d ? (f = {
|
|
1048
1453
|
textDecoration: "underline",
|
|
1049
|
-
color:
|
|
1050
|
-
}, e[3] =
|
|
1051
|
-
let
|
|
1052
|
-
return e[5] !== o || e[6] !== n.text || e[7] !==
|
|
1454
|
+
color: d
|
|
1455
|
+
}, e[3] = d, e[4] = f) : f = e[4];
|
|
1456
|
+
let m;
|
|
1457
|
+
return e[5] !== o || e[6] !== n.text || e[7] !== i || e[8] !== c || e[9] !== a || e[10] !== u || e[11] !== f ? (m = /* @__PURE__ */ l(Gt, { href: i, fontWeight: o, color: c, textDecoration: "none", cursor: a, onClick: u, _hover: f, children: n.text }), e[5] = o, e[6] = n.text, e[7] = i, e[8] = c, e[9] = a, e[10] = u, e[11] = f, e[12] = m) : m = e[12], m;
|
|
1053
1458
|
}
|
|
1054
|
-
function
|
|
1055
|
-
const e =
|
|
1459
|
+
function fr(t) {
|
|
1460
|
+
const e = S(12), {
|
|
1056
1461
|
seg: n,
|
|
1057
|
-
onOpenFile:
|
|
1058
|
-
} = t, o = n.bold ? "medium" : void 0,
|
|
1059
|
-
let
|
|
1060
|
-
e[0] !==
|
|
1061
|
-
const
|
|
1062
|
-
let
|
|
1063
|
-
e[3] !==
|
|
1064
|
-
color:
|
|
1462
|
+
onOpenFile: s
|
|
1463
|
+
} = t, o = n.bold ? "medium" : void 0, r = n.href ?? "#", i = n.muted ? "fg.muted" : "accent.primary";
|
|
1464
|
+
let c;
|
|
1465
|
+
e[0] !== s || e[1] !== n ? (c = (f) => xn(f, n, s), e[0] = s, e[1] = n, e[2] = c) : c = e[2];
|
|
1466
|
+
const a = n.muted ? "fg.muted" : "accent.primary";
|
|
1467
|
+
let u;
|
|
1468
|
+
e[3] !== a ? (u = {
|
|
1469
|
+
color: a,
|
|
1065
1470
|
textDecoration: "underline"
|
|
1066
|
-
}, e[3] =
|
|
1067
|
-
let
|
|
1068
|
-
return e[5] !== o || e[6] !== n.text || e[7] !==
|
|
1471
|
+
}, e[3] = a, e[4] = u) : u = e[4];
|
|
1472
|
+
let d;
|
|
1473
|
+
return e[5] !== o || e[6] !== n.text || e[7] !== r || e[8] !== i || e[9] !== c || e[10] !== u ? (d = /* @__PURE__ */ l(Gt, { href: r, fontWeight: o, color: i, textDecoration: "underline", onClick: c, _hover: u, children: n.text }), e[5] = o, e[6] = n.text, e[7] = r, e[8] = i, e[9] = c, e[10] = u, e[11] = d) : d = e[11], d;
|
|
1069
1474
|
}
|
|
1070
|
-
function
|
|
1071
|
-
const e =
|
|
1475
|
+
function pr(t) {
|
|
1476
|
+
const e = S(6), {
|
|
1072
1477
|
seg: n,
|
|
1073
|
-
isClickable:
|
|
1074
|
-
} = t, o = n.bold ? "medium" : void 0,
|
|
1075
|
-
let
|
|
1076
|
-
e[0] !==
|
|
1077
|
-
color:
|
|
1078
|
-
}, e[0] =
|
|
1079
|
-
let
|
|
1080
|
-
return e[2] !== n.text || e[3] !== o || e[4] !==
|
|
1478
|
+
isClickable: s
|
|
1479
|
+
} = t, o = n.bold ? "medium" : void 0, r = s && !n.muted ? "fg" : "fg.muted";
|
|
1480
|
+
let i;
|
|
1481
|
+
e[0] !== r ? (i = {
|
|
1482
|
+
color: r
|
|
1483
|
+
}, e[0] = r, e[1] = i) : i = e[1];
|
|
1484
|
+
let c;
|
|
1485
|
+
return e[2] !== n.text || e[3] !== o || e[4] !== i ? (c = /* @__PURE__ */ l(Le, { fontWeight: o, color: "fg.muted", _groupHover: i, children: n.text }), e[2] = n.text, e[3] = o, e[4] = i, e[5] = c) : c = e[5], c;
|
|
1081
1486
|
}
|
|
1082
|
-
function
|
|
1083
|
-
const e =
|
|
1487
|
+
function mr(t) {
|
|
1488
|
+
const e = S(11), {
|
|
1084
1489
|
seg: n,
|
|
1085
|
-
isClickable:
|
|
1490
|
+
isClickable: s,
|
|
1086
1491
|
onOpenFile: o
|
|
1087
1492
|
} = t;
|
|
1088
1493
|
switch (n.kind) {
|
|
1089
1494
|
case "avatar": {
|
|
1090
|
-
let
|
|
1091
|
-
return e[0] !== n ? (
|
|
1495
|
+
let r;
|
|
1496
|
+
return e[0] !== n ? (r = /* @__PURE__ */ l(ar, { seg: n }), e[0] = n, e[1] = r) : r = e[1], r;
|
|
1092
1497
|
}
|
|
1093
1498
|
case "diff": {
|
|
1094
|
-
let
|
|
1095
|
-
return e[2] !== o || e[3] !== n ? (
|
|
1499
|
+
let r;
|
|
1500
|
+
return e[2] !== o || e[3] !== n ? (r = /* @__PURE__ */ l(ur, { seg: n, onOpenFile: o }), e[2] = o, e[3] = n, e[4] = r) : r = e[4], r;
|
|
1096
1501
|
}
|
|
1097
1502
|
case "link": {
|
|
1098
|
-
let
|
|
1099
|
-
return e[5] !== o || e[6] !== n ? (
|
|
1503
|
+
let r;
|
|
1504
|
+
return e[5] !== o || e[6] !== n ? (r = n.variant === "bubble" ? /* @__PURE__ */ l(dr, { seg: n, onOpenFile: o }) : /* @__PURE__ */ l(fr, { seg: n, onOpenFile: o }), e[5] = o, e[6] = n, e[7] = r) : r = e[7], r;
|
|
1100
1505
|
}
|
|
1101
1506
|
case "text": {
|
|
1102
|
-
let
|
|
1103
|
-
return e[8] !==
|
|
1507
|
+
let r;
|
|
1508
|
+
return e[8] !== s || e[9] !== n ? (r = /* @__PURE__ */ l(pr, { seg: n, isClickable: s }), e[8] = s, e[9] = n, e[10] = r) : r = e[10], r;
|
|
1104
1509
|
}
|
|
1105
1510
|
default:
|
|
1106
1511
|
return null;
|
|
1107
1512
|
}
|
|
1108
1513
|
}
|
|
1109
|
-
function
|
|
1110
|
-
const e =
|
|
1514
|
+
function hr(t) {
|
|
1515
|
+
const e = S(10), {
|
|
1111
1516
|
ind: n
|
|
1112
1517
|
} = t;
|
|
1113
1518
|
if (!n || n.type === "none")
|
|
1114
1519
|
return null;
|
|
1115
1520
|
if (n.type === "icon") {
|
|
1116
|
-
let
|
|
1117
|
-
e[0] !== n.icon ? (
|
|
1118
|
-
const
|
|
1119
|
-
let
|
|
1120
|
-
return e[2] !==
|
|
1521
|
+
let i;
|
|
1522
|
+
e[0] !== n.icon ? (i = is(n.icon), e[0] = n.icon, e[1] = i) : i = e[1];
|
|
1523
|
+
const c = i;
|
|
1524
|
+
let a;
|
|
1525
|
+
return e[2] !== c ? (a = /* @__PURE__ */ l(ue.Indicator, { outline: "none", shadow: "none", border: "none", background: "bg", color: "fg", children: /* @__PURE__ */ l(Le, { display: "inline-flex", alignItems: "center", children: /* @__PURE__ */ l(c, { size: 14, strokeWidth: 1 }) }) }), e[2] = c, e[3] = a) : a = e[3], a;
|
|
1121
1526
|
}
|
|
1122
|
-
let r;
|
|
1123
|
-
e[4] !== n.alt || e[5] !== n.src ? (r = /* @__PURE__ */ i(he.Image, { src: n.src, alt: n.alt }), e[4] = n.alt, e[5] = n.src, e[6] = r) : r = e[6];
|
|
1124
|
-
let o;
|
|
1125
|
-
e[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ i(he.Fallback, {}), e[7] = o) : o = e[7];
|
|
1126
1527
|
let s;
|
|
1127
|
-
|
|
1128
|
-
|
|
1528
|
+
e[4] !== n.alt || e[5] !== n.src ? (s = /* @__PURE__ */ l(Ie.Image, { src: n.src, alt: n.alt }), e[4] = n.alt, e[5] = n.src, e[6] = s) : s = e[6];
|
|
1529
|
+
let o;
|
|
1530
|
+
e[7] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = /* @__PURE__ */ l(Ie.Fallback, {}), e[7] = o) : o = e[7];
|
|
1531
|
+
let r;
|
|
1532
|
+
return e[8] !== s ? (r = /* @__PURE__ */ l(ue.Indicator, { children: /* @__PURE__ */ w(Ie.Root, { boxSize: "full", children: [
|
|
1533
|
+
s,
|
|
1129
1534
|
o
|
|
1130
|
-
] }) }), e[8] =
|
|
1535
|
+
] }) }), e[8] = s, e[9] = r) : r = e[9], r;
|
|
1131
1536
|
}
|
|
1132
|
-
function
|
|
1133
|
-
const e =
|
|
1537
|
+
function gr(t) {
|
|
1538
|
+
const e = S(5), {
|
|
1134
1539
|
code: n,
|
|
1135
|
-
language:
|
|
1136
|
-
} = t, o =
|
|
1137
|
-
let
|
|
1138
|
-
e[0] !== n ? (
|
|
1139
|
-
let
|
|
1140
|
-
return e[2] !== o || e[3] !==
|
|
1540
|
+
language: s
|
|
1541
|
+
} = t, o = s ? `${s} code block` : "code block";
|
|
1542
|
+
let r;
|
|
1543
|
+
e[0] !== n ? (r = /* @__PURE__ */ l(M, { as: "code", children: n }), e[0] = n, e[1] = r) : r = e[1];
|
|
1544
|
+
let i;
|
|
1545
|
+
return e[2] !== o || e[3] !== r ? (i = /* @__PURE__ */ l(M, { as: "pre", background: "bg.code", color: "fg", borderRadius: "md", padding: "sm", fontFamily: "mono", fontSize: "xs", lineHeight: "shorter", overflowX: "auto", whiteSpace: "pre", "aria-label": o, children: r }), e[2] = o, e[3] = r, e[4] = i) : i = e[4], i;
|
|
1141
1546
|
}
|
|
1142
|
-
function
|
|
1143
|
-
const e =
|
|
1547
|
+
function br(t) {
|
|
1548
|
+
const e = S(30), {
|
|
1144
1549
|
b: n,
|
|
1145
|
-
onOpenFile:
|
|
1550
|
+
onOpenFile: s
|
|
1146
1551
|
} = t;
|
|
1147
1552
|
switch (n.type) {
|
|
1148
1553
|
case "comment": {
|
|
1149
1554
|
let o;
|
|
1150
|
-
e[0] !== n.text ? (o = /* @__PURE__ */
|
|
1151
|
-
let
|
|
1152
|
-
e[2] !== n.reactions ? (
|
|
1555
|
+
e[0] !== n.text ? (o = /* @__PURE__ */ l(J.Body, { children: n.text }), e[0] = n.text, e[1] = o) : o = e[1];
|
|
1556
|
+
let r;
|
|
1557
|
+
e[2] !== n.reactions ? (r = n.reactions?.clap ? /* @__PURE__ */ l(J.Footer, { children: /* @__PURE__ */ w(qe, { children: [
|
|
1153
1558
|
"👏 ",
|
|
1154
1559
|
n.reactions.clap
|
|
1155
|
-
] }) }) : null, e[2] = n.reactions, e[3] =
|
|
1156
|
-
let
|
|
1157
|
-
return e[4] !== o || e[5] !==
|
|
1560
|
+
] }) }) : null, e[2] = n.reactions, e[3] = r) : r = e[3];
|
|
1561
|
+
let i;
|
|
1562
|
+
return e[4] !== o || e[5] !== r ? (i = /* @__PURE__ */ w(J.Root, { children: [
|
|
1158
1563
|
o,
|
|
1159
|
-
|
|
1160
|
-
] }), e[4] = o, e[5] =
|
|
1564
|
+
r
|
|
1565
|
+
] }), e[4] = o, e[5] = r, e[6] = i) : i = e[6], i;
|
|
1161
1566
|
}
|
|
1162
1567
|
case "code": {
|
|
1163
1568
|
let o;
|
|
1164
|
-
return e[7] !== n.code || e[8] !== n.language ? (o = /* @__PURE__ */
|
|
1569
|
+
return e[7] !== n.code || e[8] !== n.language ? (o = /* @__PURE__ */ l(J.Root, { border: "0", padding: "0", children: /* @__PURE__ */ l(J.Body, { padding: "0", children: /* @__PURE__ */ l(gr, { language: n.language, code: n.code }) }) }), e[7] = n.code, e[8] = n.language, e[9] = o) : o = e[9], o;
|
|
1165
1570
|
}
|
|
1166
1571
|
case "diff": {
|
|
1167
1572
|
const o = n.sideBySide ?? !1;
|
|
1168
|
-
let
|
|
1169
|
-
return e[10] !== n.language || e[11] !== n.modified || e[12] !== n.original || e[13] !== o ? (
|
|
1573
|
+
let r;
|
|
1574
|
+
return e[10] !== n.language || e[11] !== n.modified || e[12] !== n.original || e[13] !== o ? (r = /* @__PURE__ */ l(J.Root, { border: "0", padding: "0", children: /* @__PURE__ */ l(J.Body, { padding: "0", children: /* @__PURE__ */ l(M, { height: "240px", minW: "320px", overflow: "hidden", children: /* @__PURE__ */ l(uo, { 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] = r) : r = e[14], r;
|
|
1170
1575
|
}
|
|
1171
1576
|
case "text": {
|
|
1172
1577
|
let o;
|
|
1173
|
-
return e[15] !== n.text ? (o = /* @__PURE__ */
|
|
1578
|
+
return e[15] !== n.text ? (o = /* @__PURE__ */ l(J.Root, { background: "transparent", children: /* @__PURE__ */ l(J.Body, { padding: "sm", children: /* @__PURE__ */ l(F, { textStyle: "label/S/regular", children: n.text }) }) }), e[15] = n.text, e[16] = o) : o = e[16], o;
|
|
1579
|
+
}
|
|
1580
|
+
case "todo-list": {
|
|
1581
|
+
let o;
|
|
1582
|
+
return e[17] !== n.items ? (o = /* @__PURE__ */ l(Mo, { items: n.items }), e[17] = n.items, e[18] = o) : o = e[18], o;
|
|
1583
|
+
}
|
|
1584
|
+
case "question-form": {
|
|
1585
|
+
let o;
|
|
1586
|
+
return e[19] !== n.questions ? (o = /* @__PURE__ */ l(on, { questions: n.questions }), e[19] = n.questions, e[20] = o) : o = e[20], o;
|
|
1174
1587
|
}
|
|
1175
1588
|
case "references": {
|
|
1176
1589
|
let o;
|
|
1177
|
-
e[
|
|
1178
|
-
let
|
|
1179
|
-
return e[
|
|
1590
|
+
e[21] !== n.references ? (o = n.references.map(xr), e[21] = n.references, e[22] = o) : o = e[22];
|
|
1591
|
+
let r;
|
|
1592
|
+
return e[23] !== o ? (r = /* @__PURE__ */ l(z, { mt: "xs", gap: "xs", flexDir: "row", flexWrap: "wrap", children: o }), e[23] = o, e[24] = r) : r = e[24], r;
|
|
1180
1593
|
}
|
|
1181
1594
|
case "component": {
|
|
1182
1595
|
let o;
|
|
1183
|
-
e[
|
|
1184
|
-
onOpenFile:
|
|
1185
|
-
}), e[
|
|
1186
|
-
let
|
|
1187
|
-
return e[
|
|
1596
|
+
e[25] !== n || e[26] !== s ? (o = n.render({
|
|
1597
|
+
onOpenFile: s
|
|
1598
|
+
}), e[25] = n, e[26] = s, e[27] = o) : o = e[27];
|
|
1599
|
+
let r;
|
|
1600
|
+
return e[28] !== o ? (r = /* @__PURE__ */ l(It, { children: o }), e[28] = o, e[29] = r) : r = e[29], r;
|
|
1188
1601
|
}
|
|
1189
1602
|
}
|
|
1190
1603
|
}
|
|
1191
|
-
function
|
|
1192
|
-
return /* @__PURE__ */
|
|
1604
|
+
function xr(t) {
|
|
1605
|
+
return /* @__PURE__ */ l(lo, { fileName: t }, t);
|
|
1193
1606
|
}
|
|
1194
|
-
function
|
|
1195
|
-
const e =
|
|
1607
|
+
function yr(t) {
|
|
1608
|
+
const e = S(23), {
|
|
1196
1609
|
item: n,
|
|
1197
|
-
itemKey:
|
|
1610
|
+
itemKey: s,
|
|
1198
1611
|
isOpen: o,
|
|
1199
|
-
canExpand:
|
|
1200
|
-
hasBlocks:
|
|
1201
|
-
onToggle:
|
|
1202
|
-
onOpenFile:
|
|
1612
|
+
canExpand: r,
|
|
1613
|
+
hasBlocks: i,
|
|
1614
|
+
onToggle: c,
|
|
1615
|
+
onOpenFile: a
|
|
1203
1616
|
} = t;
|
|
1204
|
-
let d;
|
|
1205
|
-
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (d = /* @__PURE__ */ i(U.Separator, {}), e[0] = d) : d = e[0];
|
|
1206
|
-
let f;
|
|
1207
|
-
e[1] !== n.indicator ? (f = /* @__PURE__ */ b(U.Connector, { children: [
|
|
1208
|
-
d,
|
|
1209
|
-
/* @__PURE__ */ i(Qr, { ind: n.indicator })
|
|
1210
|
-
] }), e[1] = n.indicator, e[2] = f) : f = e[2];
|
|
1211
1617
|
let u;
|
|
1212
|
-
e[
|
|
1213
|
-
|
|
1214
|
-
|
|
1618
|
+
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (u = /* @__PURE__ */ l(ue.Separator, {}), e[0] = u) : u = e[0];
|
|
1619
|
+
let d;
|
|
1620
|
+
e[1] !== n.indicator ? (d = /* @__PURE__ */ w(ue.Connector, { children: [
|
|
1621
|
+
u,
|
|
1622
|
+
/* @__PURE__ */ l(hr, { ind: n.indicator })
|
|
1623
|
+
] }), e[1] = n.indicator, e[2] = d) : d = e[2];
|
|
1624
|
+
const f = o ? "auto" : "20px";
|
|
1625
|
+
let m;
|
|
1626
|
+
e[3] !== r || e[4] !== o || e[5] !== n.title || e[6] !== s || e[7] !== a || e[8] !== c ? (m = n.title.length > 0 && /* @__PURE__ */ l(ue.Title, { className: "group", fontWeight: "normal", display: "flex", alignItems: "center", justifyContent: "space-between", cursor: r ? "pointer" : "default", onClick: r ? () => c(s) : void 0, children: /* @__PURE__ */ w(Le, { display: "inline-flex", alignItems: "center", gap: "sm", flexWrap: "wrap", children: [
|
|
1627
|
+
/* @__PURE__ */ l(Le, { display: "inline-flex", alignItems: "center", gap: "xs", flexWrap: "wrap", children: n.title.map((b, x) => /* @__PURE__ */ l(mr, { seg: b, isClickable: r, onOpenFile: a }, x)) }),
|
|
1628
|
+
r ? /* @__PURE__ */ l(Le, { display: "inline-flex", alignItems: "center", transition: "transform 200ms ease, color 200ms ease", transform: o ? "rotate(0deg)" : "rotate(-180deg)", color: "transparent", _groupHover: {
|
|
1215
1629
|
color: "fg"
|
|
1216
|
-
}, children: /* @__PURE__ */
|
|
1217
|
-
] }) }), e[3] =
|
|
1630
|
+
}, children: /* @__PURE__ */ l(to, { size: 12 }) }) : null
|
|
1631
|
+
] }) }), e[3] = r, e[4] = o, e[5] = n.title, e[6] = s, e[7] = a, e[8] = c, e[9] = m) : m = e[9];
|
|
1218
1632
|
let p;
|
|
1219
|
-
e[10] !==
|
|
1220
|
-
let
|
|
1221
|
-
e[15] !==
|
|
1222
|
-
|
|
1633
|
+
e[10] !== i || e[11] !== o || e[12] !== n.blocks || e[13] !== a ? (p = i ? /* @__PURE__ */ l(M, { display: "grid", gridTemplateRows: o ? "1fr" : "0fr", transition: "grid-template-rows 220ms ease", children: o ? /* @__PURE__ */ l(M, { overflow: "hidden", opacity: 1, transform: "translateY(0)", transition: "opacity 200ms ease, transform 200ms ease", children: n.blocks.map((b, x) => /* @__PURE__ */ l(M, { children: /* @__PURE__ */ l(br, { b, onOpenFile: a }) }, x)) }) : null }) : null, e[10] = i, e[11] = o, e[12] = n.blocks, e[13] = a, e[14] = p) : p = e[14];
|
|
1634
|
+
let h;
|
|
1635
|
+
e[15] !== f || e[16] !== m || e[17] !== p ? (h = /* @__PURE__ */ w(ue.Content, { pb: "xs", h: f, overflow: "hidden", children: [
|
|
1636
|
+
m,
|
|
1223
1637
|
p
|
|
1224
|
-
] }), e[15] =
|
|
1638
|
+
] }), e[15] = f, e[16] = m, e[17] = p, e[18] = h) : h = e[18];
|
|
1225
1639
|
let g;
|
|
1226
|
-
return e[
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
] },
|
|
1640
|
+
return e[19] !== s || e[20] !== d || e[21] !== h ? (g = /* @__PURE__ */ w(ue.Item, { gap: "xs", children: [
|
|
1641
|
+
d,
|
|
1642
|
+
h
|
|
1643
|
+
] }, s), e[19] = s, e[20] = d, e[21] = h, e[22] = g) : g = e[22], g;
|
|
1230
1644
|
}
|
|
1231
|
-
function
|
|
1232
|
-
const e =
|
|
1645
|
+
function Sr(t) {
|
|
1646
|
+
const e = S(11), {
|
|
1233
1647
|
data: n,
|
|
1234
|
-
onOpenFile:
|
|
1648
|
+
onOpenFile: s
|
|
1235
1649
|
} = t;
|
|
1236
1650
|
let o;
|
|
1237
1651
|
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (o = {}, e[0] = o) : o = e[0];
|
|
1238
|
-
const [
|
|
1239
|
-
let
|
|
1240
|
-
e[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (
|
|
1241
|
-
|
|
1242
|
-
...
|
|
1243
|
-
[
|
|
1652
|
+
const [r, i] = Z(o), c = kr;
|
|
1653
|
+
let a;
|
|
1654
|
+
e[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (a = (m) => {
|
|
1655
|
+
i((p) => ({
|
|
1656
|
+
...p,
|
|
1657
|
+
[m]: !p[m]
|
|
1244
1658
|
}));
|
|
1245
|
-
}, e[1] =
|
|
1246
|
-
const
|
|
1247
|
-
let
|
|
1248
|
-
if (e[2] !== n.items || e[3] !==
|
|
1249
|
-
let
|
|
1250
|
-
e[6] !==
|
|
1251
|
-
const
|
|
1252
|
-
return /* @__PURE__ */
|
|
1253
|
-
}, e[6] =
|
|
1659
|
+
}, e[1] = a) : a = e[1];
|
|
1660
|
+
const u = a;
|
|
1661
|
+
let d;
|
|
1662
|
+
if (e[2] !== n.items || e[3] !== r || e[4] !== s) {
|
|
1663
|
+
let m;
|
|
1664
|
+
e[6] !== r || e[7] !== s ? (m = (p, h) => {
|
|
1665
|
+
const g = c(p, h), b = (p.blocks?.length ?? 0) > 0, x = (p.expandable ?? !0) && b, k = x ? r[g] ?? !1 : b;
|
|
1666
|
+
return /* @__PURE__ */ l(yr, { item: p, itemKey: g, isOpen: k, canExpand: x, hasBlocks: b, onToggle: u, onOpenFile: s }, g);
|
|
1667
|
+
}, e[6] = r, e[7] = s, e[8] = m) : m = e[8], d = n.items.map(m), e[2] = n.items, e[3] = r, e[4] = s, e[5] = d;
|
|
1254
1668
|
} else
|
|
1255
|
-
|
|
1256
|
-
let
|
|
1257
|
-
return e[9] !==
|
|
1669
|
+
d = e[5];
|
|
1670
|
+
let f;
|
|
1671
|
+
return e[9] !== d ? (f = /* @__PURE__ */ l(ue.Root, { children: d }), e[9] = d, e[10] = f) : f = e[10], f;
|
|
1258
1672
|
}
|
|
1259
|
-
function
|
|
1673
|
+
function kr(t, e) {
|
|
1260
1674
|
return t.id ? `id:${t.id}` : `idx:${e}`;
|
|
1261
1675
|
}
|
|
1262
|
-
|
|
1263
|
-
const e =
|
|
1676
|
+
const wr = (t) => rt(t.tool ?? "").replace(/_/g, "") === "question", Tr = (t) => {
|
|
1677
|
+
const e = t.state?.output;
|
|
1678
|
+
return typeof e == "string" ? e.trim().length > 0 : Array.isArray(e) ? e.length > 0 : e && typeof e == "object" ? Object.keys(e).length > 0 : e != null;
|
|
1679
|
+
};
|
|
1680
|
+
function Cr(t) {
|
|
1681
|
+
const e = S(8), {
|
|
1264
1682
|
invocations: n,
|
|
1265
|
-
labeledBlocks:
|
|
1266
|
-
|
|
1267
|
-
|
|
1268
|
-
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1274
|
-
|
|
1683
|
+
labeledBlocks: s,
|
|
1684
|
+
hideQuestionForms: o,
|
|
1685
|
+
onOpenFile: r
|
|
1686
|
+
} = t, i = o === void 0 ? !1 : o;
|
|
1687
|
+
let c, a;
|
|
1688
|
+
if (e[0] !== i || e[1] !== n || e[2] !== s) {
|
|
1689
|
+
a = /* @__PURE__ */ Symbol.for("react.early_return_sentinel");
|
|
1690
|
+
e: {
|
|
1691
|
+
const f = i ? n.filter(_r) : n;
|
|
1692
|
+
if (f.length === 0) {
|
|
1693
|
+
a = null;
|
|
1694
|
+
break e;
|
|
1695
|
+
}
|
|
1696
|
+
c = cr(f, {
|
|
1697
|
+
labeledBlocks: s
|
|
1698
|
+
});
|
|
1699
|
+
}
|
|
1700
|
+
e[0] = i, e[1] = n, e[2] = s, e[3] = c, e[4] = a;
|
|
1701
|
+
} else
|
|
1702
|
+
c = e[3], a = e[4];
|
|
1703
|
+
if (a !== /* @__PURE__ */ Symbol.for("react.early_return_sentinel"))
|
|
1704
|
+
return a;
|
|
1705
|
+
const u = c;
|
|
1706
|
+
let d;
|
|
1707
|
+
return e[5] !== u || e[6] !== r ? (d = /* @__PURE__ */ l(Sr, { data: u, onOpenFile: r }), e[5] = u, e[6] = r, e[7] = d) : d = e[7], d;
|
|
1275
1708
|
}
|
|
1276
|
-
|
|
1709
|
+
function _r(t) {
|
|
1710
|
+
return !wr(t) || Tr(t);
|
|
1711
|
+
}
|
|
1712
|
+
const Ar = (t) => t.type === "tool", Rt = (t) => t >= 1e3 ? `${(t / 1e3).toFixed(1)}k` : String(t), Rr = (t) => {
|
|
1277
1713
|
if (t.message && t.message.trim().length > 0)
|
|
1278
1714
|
return t.message;
|
|
1279
1715
|
const {
|
|
@@ -1289,99 +1725,100 @@ const io = (t) => t.type === "tool", Qe = (t) => t >= 1e3 ? `${(t / 1e3).toFixed
|
|
|
1289
1725
|
default:
|
|
1290
1726
|
return "An error occurred.";
|
|
1291
1727
|
}
|
|
1292
|
-
},
|
|
1728
|
+
}, Br = {
|
|
1293
1729
|
info: "blue",
|
|
1294
1730
|
warning: "orange",
|
|
1295
1731
|
error: "red",
|
|
1296
1732
|
success: "green",
|
|
1297
1733
|
loading: "blue"
|
|
1298
|
-
},
|
|
1734
|
+
}, Ir = (t, e) => {
|
|
1299
1735
|
const n = [];
|
|
1300
|
-
let
|
|
1301
|
-
for (;
|
|
1302
|
-
const o = t[
|
|
1303
|
-
if (!
|
|
1304
|
-
n.push(o),
|
|
1736
|
+
let s = e;
|
|
1737
|
+
for (; s < t.length; ) {
|
|
1738
|
+
const o = t[s];
|
|
1739
|
+
if (!Ar(o)) break;
|
|
1740
|
+
n.push(o), s += 1;
|
|
1305
1741
|
}
|
|
1306
1742
|
return {
|
|
1307
1743
|
invocations: n,
|
|
1308
|
-
nextIndex:
|
|
1744
|
+
nextIndex: s - 1
|
|
1309
1745
|
};
|
|
1310
1746
|
};
|
|
1311
|
-
function
|
|
1312
|
-
const e =
|
|
1747
|
+
function yn(t) {
|
|
1748
|
+
const e = S(8), {
|
|
1313
1749
|
message: n,
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1750
|
+
hideQuestionForms: s,
|
|
1751
|
+
onOpenFile: o,
|
|
1752
|
+
toolInvocationTimeline: r
|
|
1753
|
+
} = t, i = s === void 0 ? !1 : s, c = r ?? Cr;
|
|
1754
|
+
let a;
|
|
1755
|
+
e[0] !== n.parts ? (a = n.parts ?? [], e[0] = n.parts, e[1] = a) : a = e[1];
|
|
1756
|
+
const u = a;
|
|
1757
|
+
let d;
|
|
1758
|
+
if (e[2] !== c || e[3] !== i || e[4] !== n.id || e[5] !== o || e[6] !== u) {
|
|
1759
|
+
const f = [];
|
|
1760
|
+
for (let m = 0; m < u.length; m = m + 1, m) {
|
|
1761
|
+
const p = u[m], h = `${n.id}-${m}`;
|
|
1762
|
+
e: switch (p.type) {
|
|
1326
1763
|
case "text": {
|
|
1327
|
-
|
|
1764
|
+
f.push(/* @__PURE__ */ l("div", { children: /* @__PURE__ */ l(ns, { children: p.text }) }, h));
|
|
1328
1765
|
break e;
|
|
1329
1766
|
}
|
|
1330
1767
|
case "reasoning": {
|
|
1331
|
-
|
|
1768
|
+
f.push(/* @__PURE__ */ l(M, { padding: "0", css: {
|
|
1332
1769
|
"& .rich-text, & .rich-text *": {
|
|
1333
1770
|
color: "fg.subtle !important",
|
|
1334
1771
|
fontSize: ".75rem !important",
|
|
1335
1772
|
fontWeight: "normal !important"
|
|
1336
1773
|
}
|
|
1337
|
-
}, children: /* @__PURE__ */
|
|
1774
|
+
}, children: /* @__PURE__ */ l(Jt, { defaultState: p.text, fullWidth: !0 }) }, h));
|
|
1338
1775
|
break e;
|
|
1339
1776
|
}
|
|
1340
1777
|
case "tool": {
|
|
1341
1778
|
const {
|
|
1342
|
-
invocations:
|
|
1343
|
-
nextIndex:
|
|
1344
|
-
} =
|
|
1345
|
-
|
|
1779
|
+
invocations: g,
|
|
1780
|
+
nextIndex: b
|
|
1781
|
+
} = Ir(u, m);
|
|
1782
|
+
m = b, f.push(/* @__PURE__ */ l(M, { width: "full", children: /* @__PURE__ */ l(c, { invocations: g, labeledBlocks: !0, hideQuestionForms: i, onOpenFile: o }) }, h));
|
|
1346
1783
|
break e;
|
|
1347
1784
|
}
|
|
1348
1785
|
case "error": {
|
|
1349
|
-
|
|
1786
|
+
f.push(/* @__PURE__ */ l(M, { py: "2", width: "full", children: /* @__PURE__ */ l(vt, { borderRadius: "xs", status: "error", colorPalette: "red", title: Rr(p), size: "sm" }) }, h));
|
|
1350
1787
|
break e;
|
|
1351
1788
|
}
|
|
1352
1789
|
case "token_usage": {
|
|
1353
|
-
|
|
1790
|
+
f.push(/* @__PURE__ */ l(M, { children: /* @__PURE__ */ w(F, { fontSize: "xs", color: "fg.subtle", children: [
|
|
1354
1791
|
"Tokens: ",
|
|
1355
|
-
|
|
1792
|
+
Rt(p.inputTokens),
|
|
1356
1793
|
" in / ",
|
|
1357
|
-
|
|
1794
|
+
Rt(p.outputTokens),
|
|
1358
1795
|
" out",
|
|
1359
|
-
|
|
1360
|
-
] }) },
|
|
1796
|
+
p.cacheReadTokens ? ` / ${Rt(p.cacheReadTokens)} cache read` : ""
|
|
1797
|
+
] }) }, h));
|
|
1361
1798
|
break e;
|
|
1362
1799
|
}
|
|
1363
1800
|
case "alert": {
|
|
1364
|
-
|
|
1801
|
+
f.push(/* @__PURE__ */ l(M, { width: "full", children: /* @__PURE__ */ l(vt, { borderRadius: "xs", status: p.status === "loading" ? "info" : p.status, colorPalette: Br[p.status], title: p.title, icon: p.status === "loading" ? /* @__PURE__ */ l(Pt, { size: "sm" }) : void 0, size: "sm", children: p.message }) }, h));
|
|
1365
1802
|
break e;
|
|
1366
1803
|
}
|
|
1367
1804
|
default:
|
|
1368
|
-
|
|
1805
|
+
f.push(null);
|
|
1369
1806
|
}
|
|
1370
1807
|
}
|
|
1371
|
-
|
|
1808
|
+
d = /* @__PURE__ */ l(It, { children: f }), e[2] = c, e[3] = i, e[4] = n.id, e[5] = o, e[6] = u, e[7] = d;
|
|
1372
1809
|
} else
|
|
1373
|
-
|
|
1374
|
-
return
|
|
1810
|
+
d = e[7];
|
|
1811
|
+
return d;
|
|
1375
1812
|
}
|
|
1376
|
-
const
|
|
1813
|
+
const Pr = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "assistant", Mr = (t) => {
|
|
1377
1814
|
const e = t.parts ?? [];
|
|
1378
|
-
return e.length === 0 || e.some((
|
|
1379
|
-
},
|
|
1815
|
+
return e.length === 0 || e.some((s) => s.type === "text" && "text" in s) ? !1 : e.some((s) => s.type === "reasoning" || s.type === "tool");
|
|
1816
|
+
}, $r = (t) => {
|
|
1380
1817
|
const e = [];
|
|
1381
1818
|
for (const n of t) {
|
|
1382
|
-
const
|
|
1383
|
-
if (
|
|
1384
|
-
|
|
1819
|
+
const s = e[e.length - 1];
|
|
1820
|
+
if (s && s.role === n.role && Mr(n)) {
|
|
1821
|
+
s.parts = [...s.parts ?? [], ...n.parts ?? []];
|
|
1385
1822
|
continue;
|
|
1386
1823
|
}
|
|
1387
1824
|
e.push({
|
|
@@ -1390,153 +1827,197 @@ const uo = (t) => t === "user" || t === "assistant" || t === "developer" ? t : "
|
|
|
1390
1827
|
});
|
|
1391
1828
|
}
|
|
1392
1829
|
return e;
|
|
1393
|
-
},
|
|
1830
|
+
}, Or = (t) => {
|
|
1394
1831
|
const e = [], n = [];
|
|
1395
|
-
for (const
|
|
1396
|
-
|
|
1397
|
-
userMessage:
|
|
1832
|
+
for (const s of t)
|
|
1833
|
+
s.role === "user" ? e.push({
|
|
1834
|
+
userMessage: s,
|
|
1398
1835
|
responses: []
|
|
1399
|
-
}) : e.length > 0 ? e[e.length - 1].responses.push(
|
|
1836
|
+
}) : e.length > 0 ? e[e.length - 1].responses.push(s) : n.push(s);
|
|
1400
1837
|
return {
|
|
1401
1838
|
groups: e,
|
|
1402
1839
|
leadingResponses: n
|
|
1403
1840
|
};
|
|
1404
|
-
},
|
|
1405
|
-
const
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1841
|
+
}, Er = (t) => {
|
|
1842
|
+
const e = S(3), {
|
|
1843
|
+
label: n,
|
|
1844
|
+
onClick: s
|
|
1845
|
+
} = t;
|
|
1846
|
+
let o;
|
|
1847
|
+
return e[0] !== n || e[1] !== s ? (o = /* @__PURE__ */ l(fe, { 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", pointerEvents: "none", children: /* @__PURE__ */ l(qe, { size: "2xs", variant: "solid", pointerEvents: "auto", onClick: s, children: n }) }), e[0] = n, e[1] = s, e[2] = o) : o = e[2], o;
|
|
1848
|
+
}, Sn = (t, e, n = !1) => {
|
|
1849
|
+
const s = Pr(t.role);
|
|
1850
|
+
return /* @__PURE__ */ l(de.Root, { from: s, children: /* @__PURE__ */ l(de.Content, { from: s, children: /* @__PURE__ */ l(yn, { message: t, streaming: e, hideQuestionForms: n }) }) }, t.id);
|
|
1851
|
+
}, Dr = (t) => {
|
|
1852
|
+
es(t.currentTarget, t.deltaY) && t.stopPropagation();
|
|
1853
|
+
}, Lr = (t, e) => {
|
|
1854
|
+
if (t)
|
|
1855
|
+
return e ? sn : Yo;
|
|
1856
|
+
}, qr = (t) => {
|
|
1857
|
+
if (t)
|
|
1858
|
+
return sn;
|
|
1859
|
+
}, vr = (t) => {
|
|
1860
|
+
const e = S(42), {
|
|
1861
|
+
group: n,
|
|
1862
|
+
streaming: s,
|
|
1863
|
+
hideQuestionForms: o,
|
|
1864
|
+
isExpanded: r,
|
|
1865
|
+
onToggleStickyMessage: i
|
|
1866
|
+
} = t;
|
|
1867
|
+
let c, a, u;
|
|
1868
|
+
e[0] !== n.userMessage || e[1] !== r ? (c = Zo(n.userMessage), a = c && r, u = Lr(c, r), e[0] = n.userMessage, e[1] = r, e[2] = c, e[3] = a, e[4] = u) : (c = e[2], a = e[3], u = e[4]);
|
|
1869
|
+
const d = u;
|
|
1870
|
+
let f;
|
|
1871
|
+
e[5] !== n.userMessage.id || e[6] !== i ? (f = () => i(n.userMessage.id), e[5] = n.userMessage.id, e[6] = i, e[7] = f) : f = e[7];
|
|
1872
|
+
const m = f, p = c ? "0" : void 0, h = c ? "relative" : void 0, g = c ? r ? "expanded" : "collapsed" : void 0;
|
|
1873
|
+
let b;
|
|
1874
|
+
e[8] !== a ? (b = qr(a), e[8] = a, e[9] = b) : b = e[9];
|
|
1875
|
+
const x = a ? "auto" : "visible", k = c ? "xs" : void 0, T = c ? "xs" : void 0, A = a ? "3rem" : void 0, R = a ? Dr : void 0;
|
|
1876
|
+
let B;
|
|
1877
|
+
e[10] !== n.userMessage || e[11] !== s ? (B = /* @__PURE__ */ l(yn, { message: n.userMessage, streaming: s }), e[10] = n.userMessage, e[11] = s, e[12] = B) : B = e[12];
|
|
1878
|
+
let I;
|
|
1879
|
+
e[13] !== R || e[14] !== B || e[15] !== g || e[16] !== b || e[17] !== x || e[18] !== k || e[19] !== T || e[20] !== A ? (I = /* @__PURE__ */ l(M, { "data-sticky-user-message-content": g, display: "flex", flexDirection: "column", gap: "sm", maxH: b, minH: "0", overflowY: x, px: k, py: T, pb: A, onWheel: R, children: B }), e[13] = R, e[14] = B, e[15] = g, e[16] = b, e[17] = x, e[18] = k, e[19] = T, e[20] = A, e[21] = I) : I = e[21];
|
|
1880
|
+
let _;
|
|
1881
|
+
e[22] !== c || e[23] !== r || e[24] !== m ? (_ = c && /* @__PURE__ */ l(Er, { label: r ? "Show less" : "Show more", onClick: m }), e[22] = c, e[23] = r, e[24] = m, e[25] = _) : _ = e[25];
|
|
1882
|
+
let P;
|
|
1883
|
+
e[26] !== d || e[27] !== I || e[28] !== _ || e[29] !== p || e[30] !== h ? (P = /* @__PURE__ */ l(M, { position: "sticky", top: "0", zIndex: 1, children: /* @__PURE__ */ l(de.Root, { from: "user", children: /* @__PURE__ */ w(de.Content, { from: "user", maxH: d, overflow: "hidden", p, position: h, children: [
|
|
1884
|
+
I,
|
|
1885
|
+
_
|
|
1886
|
+
] }) }) }), e[26] = d, e[27] = I, e[28] = _, e[29] = p, e[30] = h, e[31] = P) : P = e[31];
|
|
1887
|
+
let L;
|
|
1888
|
+
if (e[32] !== n.responses || e[33] !== o || e[34] !== s) {
|
|
1889
|
+
let q;
|
|
1890
|
+
e[36] !== o || e[37] !== s ? (q = (W) => Sn(W, s, o), e[36] = o, e[37] = s, e[38] = q) : q = e[38], L = n.responses.map(q), e[32] = n.responses, e[33] = o, e[34] = s, e[35] = L;
|
|
1891
|
+
} else
|
|
1892
|
+
L = e[35];
|
|
1893
|
+
let O;
|
|
1894
|
+
return e[39] !== P || e[40] !== L ? (O = /* @__PURE__ */ w(M, { children: [
|
|
1895
|
+
P,
|
|
1896
|
+
L
|
|
1897
|
+
] }), e[39] = P, e[40] = L, e[41] = O) : O = e[41], O;
|
|
1898
|
+
}, wi = (t) => {
|
|
1899
|
+
const e = S(30), {
|
|
1409
1900
|
messages: n,
|
|
1410
|
-
streaming:
|
|
1901
|
+
streaming: s,
|
|
1411
1902
|
emptyStateTitle: o,
|
|
1412
|
-
emptyStateDescription:
|
|
1413
|
-
emptyStateContent:
|
|
1414
|
-
loadingContent:
|
|
1415
|
-
chatInputPlaceholder:
|
|
1416
|
-
chatInputDefaultValue:
|
|
1417
|
-
onSubmitMessage:
|
|
1418
|
-
onInterrupt:
|
|
1419
|
-
onChatInputChange:
|
|
1420
|
-
actions:
|
|
1421
|
-
repoMenu:
|
|
1422
|
-
attachedResources:
|
|
1423
|
-
onClearAttachments:
|
|
1424
|
-
attachmentList:
|
|
1425
|
-
approvalPrompt:
|
|
1426
|
-
workspaceHub:
|
|
1427
|
-
workspaceInitializing:
|
|
1428
|
-
inputDisabled:
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1903
|
+
emptyStateDescription: r,
|
|
1904
|
+
emptyStateContent: i,
|
|
1905
|
+
loadingContent: c,
|
|
1906
|
+
chatInputPlaceholder: a,
|
|
1907
|
+
chatInputDefaultValue: u,
|
|
1908
|
+
onSubmitMessage: d,
|
|
1909
|
+
onInterrupt: f,
|
|
1910
|
+
onChatInputChange: m,
|
|
1911
|
+
actions: p,
|
|
1912
|
+
repoMenu: h,
|
|
1913
|
+
attachedResources: g,
|
|
1914
|
+
onClearAttachments: b,
|
|
1915
|
+
attachmentList: x,
|
|
1916
|
+
approvalPrompt: k,
|
|
1917
|
+
workspaceHub: T,
|
|
1918
|
+
workspaceInitializing: A,
|
|
1919
|
+
inputDisabled: R,
|
|
1920
|
+
chatInputQuestionPrompt: B,
|
|
1921
|
+
chatInputAutoFocus: I
|
|
1922
|
+
} = t, _ = s === void 0 ? !1 : s, P = u === void 0 ? "" : u, L = A === void 0 ? !1 : A, O = R === void 0 ? !1 : R, q = I === void 0 ? !1 : I, W = $r(n), ye = W.length > 0, $e = W.reduce(Qr, 0), {
|
|
1923
|
+
groups: se,
|
|
1924
|
+
leadingResponses: E
|
|
1925
|
+
} = Or(W), [Se, ke] = Z(Fr), D = _ ? c ?? i : i, H = !!T, we = !!B, pe = _ && ye && !L;
|
|
1926
|
+
let j;
|
|
1927
|
+
e[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (j = ($) => {
|
|
1928
|
+
ke((le) => {
|
|
1929
|
+
const X = new Set(le);
|
|
1930
|
+
return X.has($) ? X.delete($) : X.add($), X;
|
|
1438
1931
|
});
|
|
1439
|
-
}, e[0] =
|
|
1440
|
-
const
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
return /* @__PURE__ */ b(k, { children: [
|
|
1445
|
-
/* @__PURE__ */ b(k, { position: "sticky", top: "0", zIndex: 1, children: [
|
|
1446
|
-
/* @__PURE__ */ b(k, { position: "relative", children: [
|
|
1447
|
-
/* @__PURE__ */ i(V.Root, { from: "user", children: /* @__PURE__ */ i(V.Content, { from: "user", maxH: B && !R ? Nn : void 0, overflowY: "hidden", children: /* @__PURE__ */ i(Ft, { message: S.userMessage, streaming: C }) }) }),
|
|
1448
|
-
B && !R && /* @__PURE__ */ i($, { position: "absolute", bottom: "0", left: "0", right: "0", justifyContent: "flex-end", alignItems: "flex-end", px: "xs", pb: "xs", pt: "lg", bgGradient: "to-t", gradientFrom: "bg.subtle", gradientTo: "transparent", borderBottomRadius: "xs", children: /* @__PURE__ */ i(Ce, { size: "2xs", variant: "solid", onClick: () => ee(S.userMessage.id), children: "Show more" }) })
|
|
1449
|
-
] }),
|
|
1450
|
-
B && R && /* @__PURE__ */ i($, { justifyContent: "flex-end", mt: "2xs", mb: "sm", children: /* @__PURE__ */ i(Ce, { size: "2xs", variant: "ghost", onClick: () => ee(S.userMessage.id), children: "Show less" }) })
|
|
1451
|
-
] }),
|
|
1452
|
-
S.responses.map((le) => bt(le, C))
|
|
1453
|
-
] }, S.userMessage.id);
|
|
1454
|
-
})
|
|
1455
|
-
] }) : ie ?? /* @__PURE__ */ i(Sn, { icon: /* @__PURE__ */ i(mn, { size: 48, strokeWidth: 1.5 }), title: o, description: s });
|
|
1456
|
-
let H;
|
|
1457
|
-
e[1] !== Te.Viewport || e[2] !== O ? (H = /* @__PURE__ */ i(Te.Viewport, { children: O }), e[1] = Te.Viewport, e[2] = O, e[3] = H) : H = e[3];
|
|
1458
|
-
let _;
|
|
1459
|
-
e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (_ = /* @__PURE__ */ i(Je.ScrollToBottom, { "aria-label": "Scroll to latest message" }), e[4] = _) : _ = e[4];
|
|
1460
|
-
let P;
|
|
1461
|
-
e[5] !== W ? (P = W ? /* @__PURE__ */ b(ge, { gap: "xs", px: "sm", py: "2xs", children: [
|
|
1462
|
-
/* @__PURE__ */ i(nt, { size: "xs", color: "fg.muted" }),
|
|
1463
|
-
/* @__PURE__ */ i(K, { textStyle: "label/XS/regular", color: "fg.muted", children: "Working..." })
|
|
1464
|
-
] }) : null, e[5] = W, e[6] = P) : P = e[6];
|
|
1465
|
-
const j = M ? "0" : "xs";
|
|
1466
|
-
let I;
|
|
1467
|
-
e[7] !== ne ? (I = Hn(ne), e[7] = ne, e[8] = I) : I = e[8];
|
|
1468
|
-
let A;
|
|
1469
|
-
e[9] !== m || e[10] !== x || e[11] !== v || e[12] !== c || e[13] !== M || e[14] !== re || e[15] !== p || e[16] !== w || e[17] !== u || e[18] !== f || e[19] !== C || e[20] !== I ? (A = /* @__PURE__ */ i(Ln, { placeholder: c, defaultState: I, streaming: C, onSubmit: f, onInterrupt: u, onChange: p, actions: m, attachedResources: x, onClearAttachments: w, attachmentList: v, isDisabled: re, attachedToTop: M }), e[9] = m, e[10] = x, e[11] = v, e[12] = c, e[13] = M, e[14] = re, e[15] = p, e[16] = w, e[17] = u, e[18] = f, e[19] = C, e[20] = I, e[21] = A) : A = e[21];
|
|
1932
|
+
}, e[0] = j) : j = e[0];
|
|
1933
|
+
const Fe = j, re = Ct, ie = ye ? /* @__PURE__ */ w(z, { gap: "sm", children: [
|
|
1934
|
+
E.map(($) => Sn($, _, se.length > 0 || we)),
|
|
1935
|
+
se.map(($, le) => /* @__PURE__ */ l(vr, { group: $, streaming: _, hideQuestionForms: le < se.length - 1 || we, isExpanded: Se.has($.userMessage.id), onToggleStickyMessage: Fe }, $.userMessage.id))
|
|
1936
|
+
] }) : D ?? /* @__PURE__ */ l(fo, { icon: /* @__PURE__ */ l(no, { size: 48, strokeWidth: 1.5 }), title: o, description: r });
|
|
1470
1937
|
let N;
|
|
1471
|
-
e[
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
/* @__PURE__ */
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1938
|
+
e[1] !== re.Viewport || e[2] !== ie ? (N = /* @__PURE__ */ l(re.Viewport, { children: ie }), e[1] = re.Viewport, e[2] = ie, e[3] = N) : N = e[3];
|
|
1939
|
+
let V;
|
|
1940
|
+
e[4] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (V = /* @__PURE__ */ l(Ct.ScrollToBottom, { "aria-label": "Scroll to latest message" }), e[4] = V) : V = e[4];
|
|
1941
|
+
let U;
|
|
1942
|
+
e[5] !== pe ? (U = pe ? /* @__PURE__ */ w(Me, { gap: "xs", px: "sm", py: "2xs", children: [
|
|
1943
|
+
/* @__PURE__ */ l(Pt, { size: "xs", color: "fg.muted" }),
|
|
1944
|
+
/* @__PURE__ */ l(F, { textStyle: "label/XS/regular", color: "fg.muted", children: "Working..." })
|
|
1945
|
+
] }) : null, e[5] = pe, e[6] = U) : U = e[6];
|
|
1946
|
+
const G = H ? "0" : "xs";
|
|
1947
|
+
let v;
|
|
1948
|
+
e[7] !== P ? (v = Go(P), e[7] = P, e[8] = v) : v = e[8];
|
|
1949
|
+
let Q;
|
|
1950
|
+
e[9] !== p || e[10] !== g || e[11] !== x || e[12] !== q || e[13] !== a || e[14] !== B || e[15] !== H || e[16] !== O || e[17] !== m || e[18] !== b || e[19] !== f || e[20] !== d || e[21] !== _ || e[22] !== v ? (Q = /* @__PURE__ */ l(jo, { placeholder: a, defaultState: v, streaming: _, onSubmit: d, onInterrupt: f, onChange: m, actions: p, attachedResources: g, onClearAttachments: b, attachmentList: x, isDisabled: O, attachedToTop: H, questionPrompt: B, autoFocus: q }), e[9] = p, e[10] = g, e[11] = x, e[12] = q, e[13] = a, e[14] = B, e[15] = H, e[16] = O, e[17] = m, e[18] = b, e[19] = f, e[20] = d, e[21] = _, e[22] = v, e[23] = Q) : Q = e[23];
|
|
1951
|
+
let K;
|
|
1952
|
+
e[24] !== G || e[25] !== Q || e[26] !== T ? (K = /* @__PURE__ */ w(z, { px: "sm", gap: G, children: [
|
|
1953
|
+
T,
|
|
1954
|
+
Q
|
|
1955
|
+
] }), e[24] = G, e[25] = Q, e[26] = T, e[27] = K) : K = e[27];
|
|
1956
|
+
let me;
|
|
1957
|
+
return e[28] !== h ? (me = /* @__PURE__ */ l(fe, { p: "2xs", justifyContent: "flex-end", children: h }), e[28] = h, e[29] = me) : me = e[29], /* @__PURE__ */ w(fe, { position: "relative", direction: "column", w: "full", h: "full", overflow: "hidden", children: [
|
|
1958
|
+
/* @__PURE__ */ w(Ct.Root, { children: [
|
|
1959
|
+
/* @__PURE__ */ l(_o, { userMessageCount: $e }),
|
|
1960
|
+
N,
|
|
1961
|
+
V
|
|
1481
1962
|
] }),
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1963
|
+
k,
|
|
1964
|
+
U,
|
|
1965
|
+
K,
|
|
1966
|
+
me
|
|
1486
1967
|
] });
|
|
1487
1968
|
};
|
|
1488
|
-
function
|
|
1969
|
+
function Qr(t, e) {
|
|
1489
1970
|
return t + (e.role === "user" ? 1 : 0);
|
|
1490
1971
|
}
|
|
1491
|
-
function
|
|
1972
|
+
function Fr() {
|
|
1492
1973
|
return /* @__PURE__ */ new Set();
|
|
1493
1974
|
}
|
|
1494
|
-
const
|
|
1495
|
-
const t =
|
|
1975
|
+
const Vt = (t) => /* @__PURE__ */ l(z, { gap: "xs", w: "full", children: t.map((e, n) => /* @__PURE__ */ l(En, { height: "3", width: e, borderRadius: "xs" }, `${e}-${n}`)) }), Ti = () => {
|
|
1976
|
+
const t = S(2);
|
|
1496
1977
|
let e;
|
|
1497
|
-
t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */
|
|
1978
|
+
t[0] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (e = /* @__PURE__ */ l(de.Root, { from: "user", children: /* @__PURE__ */ l(de.Content, { from: "user", children: Vt(["72%", "46%"]) }) }), t[0] = e) : e = t[0];
|
|
1498
1979
|
let n;
|
|
1499
|
-
return t[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */
|
|
1980
|
+
return t[1] === /* @__PURE__ */ Symbol.for("react.memo_cache_sentinel") ? (n = /* @__PURE__ */ w(z, { minH: "full", py: "xs", gap: "0", children: [
|
|
1500
1981
|
e,
|
|
1501
|
-
/* @__PURE__ */
|
|
1982
|
+
/* @__PURE__ */ l(de.Root, { from: "assistant", children: /* @__PURE__ */ l(de.Content, { from: "assistant", children: Vt(["76%", "62%", "40%"]) }) })
|
|
1502
1983
|
] }), t[1] = n) : n = t[1], n;
|
|
1503
|
-
},
|
|
1504
|
-
const e =
|
|
1984
|
+
}, Ci = (t) => {
|
|
1985
|
+
const e = S(14), {
|
|
1505
1986
|
changesLabel: n,
|
|
1506
|
-
additions:
|
|
1987
|
+
additions: s,
|
|
1507
1988
|
deletions: o,
|
|
1508
|
-
action:
|
|
1509
|
-
status:
|
|
1510
|
-
statusLabel:
|
|
1511
|
-
} = t,
|
|
1512
|
-
let p;
|
|
1513
|
-
e[0] !== r || e[1] !== n || e[2] !== o || e[3] !== d || e[4] !== c || e[5] !== a ? (p = c === "loading" ? /* @__PURE__ */ b(ge, { gap: "xs", minW: "0", children: [
|
|
1514
|
-
/* @__PURE__ */ i(nt, { size: "xs", color: "fg.muted" }),
|
|
1515
|
-
/* @__PURE__ */ i(K, { textStyle: "label/S/regular", color: "fg.muted", truncate: !0, children: a ?? "Setting up workspace..." })
|
|
1516
|
-
] }) : c === "error" ? /* @__PURE__ */ b(ge, { gap: "xs", minW: "0", children: [
|
|
1517
|
-
/* @__PURE__ */ i(Tt, { size: 14, color: "var(--chakra-colors-fg-error)" }),
|
|
1518
|
-
/* @__PURE__ */ i(K, { textStyle: "label/S/regular", color: "fg.error", truncate: !0, children: a ?? "Workspace setup failed" })
|
|
1519
|
-
] }) : d ? /* @__PURE__ */ i(_t, { label: n, additions: r, deletions: o, variant: "ghost", size: "small", _hover: {
|
|
1520
|
-
background: "transparent"
|
|
1521
|
-
} }) : /* @__PURE__ */ i($, { flex: "1" }), e[0] = r, e[1] = n, e[2] = o, e[3] = d, e[4] = c, e[5] = a, e[6] = p) : p = e[6];
|
|
1989
|
+
action: r,
|
|
1990
|
+
status: i,
|
|
1991
|
+
statusLabel: c
|
|
1992
|
+
} = t, a = i === void 0 ? "ready" : i, u = s > 0 || o > 0, d = a === "error" ? "border.error" : "border.muted", f = a === "error" ? "bg.error" : "bg.subtle";
|
|
1522
1993
|
let m;
|
|
1523
|
-
e[
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1994
|
+
e[0] !== s || e[1] !== n || e[2] !== o || e[3] !== u || e[4] !== a || e[5] !== c ? (m = a === "loading" ? /* @__PURE__ */ w(Me, { gap: "xs", minW: "0", children: [
|
|
1995
|
+
/* @__PURE__ */ l(Pt, { size: "xs", color: "fg.muted" }),
|
|
1996
|
+
/* @__PURE__ */ l(F, { textStyle: "label/S/regular", color: "fg.muted", truncate: !0, children: c ?? "Setting up workspace..." })
|
|
1997
|
+
] }) : a === "error" ? /* @__PURE__ */ w(Me, { gap: "xs", minW: "0", children: [
|
|
1998
|
+
/* @__PURE__ */ l(Xt, { size: 14, color: "var(--chakra-colors-fg-error)" }),
|
|
1999
|
+
/* @__PURE__ */ l(F, { textStyle: "label/S/regular", color: "fg.error", truncate: !0, children: c ?? "Workspace setup failed" })
|
|
2000
|
+
] }) : u ? /* @__PURE__ */ l(en, { label: n, additions: s, deletions: o, variant: "ghost", size: "small", _hover: {
|
|
2001
|
+
background: "transparent"
|
|
2002
|
+
} }) : /* @__PURE__ */ l(fe, { flex: "1" }), e[0] = s, e[1] = n, e[2] = o, e[3] = u, e[4] = a, e[5] = c, e[6] = m) : m = e[6];
|
|
2003
|
+
let p;
|
|
2004
|
+
e[7] !== r ? (p = r ? /* @__PURE__ */ l(fe, { flexShrink: 0, ml: "auto", children: r }) : null, e[7] = r, e[8] = p) : p = e[8];
|
|
2005
|
+
let h;
|
|
2006
|
+
return e[9] !== d || e[10] !== f || e[11] !== m || e[12] !== p ? (h = /* @__PURE__ */ w(fe, { align: "center", justify: "space-between", gap: "sm", minW: "0", px: "sm", py: "xs", borderWidth: "1px", borderColor: d, borderRadius: "xs", borderBottomRadius: "0", bg: f, children: [
|
|
2007
|
+
m,
|
|
2008
|
+
p
|
|
2009
|
+
] }), e[9] = d, e[10] = f, e[11] = m, e[12] = p, e[13] = h) : h = e[13], h;
|
|
1529
2010
|
};
|
|
1530
2011
|
export {
|
|
1531
|
-
|
|
1532
|
-
|
|
1533
|
-
|
|
1534
|
-
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
2012
|
+
ki as ApprovalPrompt,
|
|
2013
|
+
_o as AutoScroll,
|
|
2014
|
+
jo as ChatInput,
|
|
2015
|
+
de as ChatMessage,
|
|
2016
|
+
wi as ChatPanel,
|
|
2017
|
+
Ct as ChatPrimitives,
|
|
2018
|
+
Ti as ChatSkeleton,
|
|
2019
|
+
Ci as ChatWorkspaceHub,
|
|
2020
|
+
Ho as SendButton,
|
|
2021
|
+
Go as createSerializedPromptState
|
|
1541
2022
|
};
|
|
1542
2023
|
//# sourceMappingURL=chat-ui.js.map
|