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