@arbidocs/blocks 0.4.2 → 0.4.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +42 -0
- package/dist/agents/definitions/AgentCreator.d.ts +11 -2
- package/dist/agents/definitions/index.d.ts +1 -0
- package/dist/agents/definitions/persona.d.ts +16 -0
- package/dist/agents/index.cjs +199 -146
- package/dist/agents/index.js +3 -2
- package/dist/agents/tasks/TaskRunsDialog.d.ts +15 -3
- package/dist/agents/tasks/index.d.ts +1 -0
- package/dist/agents/tasks/taskRequest.d.ts +61 -0
- package/dist/chat/AssistantDock.d.ts +39 -0
- package/dist/chat/ChatDocuments.d.ts +17 -0
- package/dist/chat/ChatPage.d.ts +16 -0
- package/dist/chat/ChatThreads.d.ts +28 -0
- package/dist/chat/chat-page-types.d.ts +121 -0
- package/dist/chat/chat-surface.d.ts +9 -0
- package/dist/chat/index.cjs +247 -205
- package/dist/chat/index.d.ts +6 -0
- package/dist/chat/index.js +4 -2
- package/dist/{chunk-OBLSURHV.js → chunk-2NNTQLBY.js} +3 -3
- package/dist/{chunk-OBLSURHV.js.map → chunk-2NNTQLBY.js.map} +1 -1
- package/dist/chunk-2VBJ763Y.js +296 -0
- package/dist/chunk-2VBJ763Y.js.map +1 -0
- package/dist/{chunk-2ORA62OF.js → chunk-67MKU5U7.js} +3 -3
- package/dist/{chunk-2ORA62OF.js.map → chunk-67MKU5U7.js.map} +1 -1
- package/dist/{chunk-AE5FHFZ5.cjs → chunk-6CHMNKXC.cjs} +6 -6
- package/dist/{chunk-AE5FHFZ5.cjs.map → chunk-6CHMNKXC.cjs.map} +1 -1
- package/dist/{chunk-TYZUCAT7.js → chunk-7YADKWZT.js} +43 -6
- package/dist/chunk-7YADKWZT.js.map +1 -0
- package/dist/chunk-ATXPAD6S.cjs +1952 -0
- package/dist/chunk-ATXPAD6S.cjs.map +1 -0
- package/dist/{chunk-YBXCZEWS.js → chunk-B673CCW5.js} +29 -6
- package/dist/chunk-B673CCW5.js.map +1 -0
- package/dist/{chunk-ITGHMJOM.js → chunk-BBEMPS6C.js} +169 -26
- package/dist/chunk-BBEMPS6C.js.map +1 -0
- package/dist/{chunk-XNBAXRY7.cjs → chunk-DGVKBOY5.cjs} +188 -32
- package/dist/chunk-DGVKBOY5.cjs.map +1 -0
- package/dist/{chunk-2K33YGM6.cjs → chunk-DN3NFNIA.cjs} +63 -294
- package/dist/chunk-DN3NFNIA.cjs.map +1 -0
- package/dist/{chunk-XQ7PKKDY.cjs → chunk-G4YOH5DU.cjs} +3 -3
- package/dist/{chunk-XQ7PKKDY.cjs.map → chunk-G4YOH5DU.cjs.map} +1 -1
- package/dist/{chunk-AXIZ2MDV.js → chunk-HER7MTRR.js} +3 -3
- package/dist/{chunk-AXIZ2MDV.js.map → chunk-HER7MTRR.js.map} +1 -1
- package/dist/{chunk-SYDHKKRZ.cjs → chunk-IZHWP6WQ.cjs} +47 -5
- package/dist/chunk-IZHWP6WQ.cjs.map +1 -0
- package/dist/chunk-JPO3F4J7.js +1899 -0
- package/dist/chunk-JPO3F4J7.js.map +1 -0
- package/dist/{chunk-WJMEXTVD.cjs → chunk-KDG6FER6.cjs} +28 -2
- package/dist/chunk-KDG6FER6.cjs.map +1 -0
- package/dist/chunk-KHX2BX3S.cjs +307 -0
- package/dist/chunk-KHX2BX3S.cjs.map +1 -0
- package/dist/{chunk-WTNMWEBC.js → chunk-NJL4LIXX.js} +4 -3
- package/dist/chunk-NJL4LIXX.js.map +1 -0
- package/dist/{chunk-J2BGSWXM.cjs → chunk-O637DUKS.cjs} +27 -27
- package/dist/{chunk-J2BGSWXM.cjs.map → chunk-O637DUKS.cjs.map} +1 -1
- package/dist/{chunk-WW6EOVZA.js → chunk-OXF2IFXG.js} +26 -3
- package/dist/chunk-OXF2IFXG.js.map +1 -0
- package/dist/{chunk-6HIPFEID.cjs → chunk-PBS5MFIY.cjs} +4 -4
- package/dist/{chunk-6HIPFEID.cjs.map → chunk-PBS5MFIY.cjs.map} +1 -1
- package/dist/{chunk-AZQDNYH4.js → chunk-RCP6THBS.js} +9 -1249
- package/dist/chunk-RCP6THBS.js.map +1 -0
- package/dist/{chunk-GDFWJ73C.cjs → chunk-RIL7G7AS.cjs} +4 -1286
- package/dist/chunk-RIL7G7AS.cjs.map +1 -0
- package/dist/{chunk-DREI7EQ2.cjs → chunk-SS23F63U.cjs} +9 -9
- package/dist/{chunk-DREI7EQ2.cjs.map → chunk-SS23F63U.cjs.map} +1 -1
- package/dist/{chunk-7PEELPMA.js → chunk-TI4UTYRL.js} +62 -285
- package/dist/chunk-TI4UTYRL.js.map +1 -0
- package/dist/{chunk-6P6AEQJB.js → chunk-WJZBJUPX.js} +4 -4
- package/dist/{chunk-6P6AEQJB.js.map → chunk-WJZBJUPX.js.map} +1 -1
- package/dist/{chunk-UFHMLHIR.cjs → chunk-XAJIKT6Y.cjs} +32 -11
- package/dist/chunk-XAJIKT6Y.cjs.map +1 -0
- package/dist/{chunk-G3G7LZPM.cjs → chunk-XKKGGUU2.cjs} +29 -3
- package/dist/chunk-XKKGGUU2.cjs.map +1 -0
- package/dist/{chunk-UWGIB3VQ.js → chunk-XNOASBGW.js} +33 -12
- package/dist/chunk-XNOASBGW.js.map +1 -0
- package/dist/{chunk-CTZ5745I.js → chunk-XQKGYGCJ.js} +3 -3
- package/dist/{chunk-CTZ5745I.js.map → chunk-XQKGYGCJ.js.map} +1 -1
- package/dist/{chunk-54Q3RNJU.cjs → chunk-ZVPTFTGV.cjs} +4 -3
- package/dist/chunk-ZVPTFTGV.cjs.map +1 -0
- package/dist/citations/index.cjs +11 -11
- package/dist/citations/index.js +2 -2
- package/dist/collaboration/contacts/AddContactsParts.d.ts +9 -4
- package/dist/collaboration/contacts/index.d.ts +1 -0
- package/dist/collaboration/contacts/parseEmails.d.ts +26 -0
- package/dist/collaboration/index.cjs +51 -31
- package/dist/collaboration/index.js +1 -1
- package/dist/components/MemberAvatarStack.d.ts +7 -2
- package/dist/connect/index.cjs +41 -12
- package/dist/connect/index.cjs.map +1 -1
- package/dist/connect/index.d.ts +3 -2
- package/dist/connect/index.js +20 -4
- package/dist/connect/index.js.map +1 -1
- package/dist/connection/ConnectionProvider.d.ts +2 -0
- package/dist/connection/ai.d.ts +13 -1
- package/dist/connection/useConnectedShellWorkspaces.d.ts +15 -0
- package/dist/facts/index.cjs +3 -3
- package/dist/facts/index.cjs.map +1 -1
- package/dist/facts/index.js +2 -2
- package/dist/facts/index.js.map +1 -1
- package/dist/files/index.cjs +4 -3
- package/dist/files/index.cjs.map +1 -1
- package/dist/files/index.js +4 -3
- package/dist/files/index.js.map +1 -1
- package/dist/home/index.cjs +18 -17
- package/dist/home/index.cjs.map +1 -1
- package/dist/home/index.js +3 -2
- package/dist/home/index.js.map +1 -1
- package/dist/index.cjs +824 -695
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +16 -15
- package/dist/index.js.map +1 -1
- package/dist/lib/format.d.ts +31 -0
- package/dist/retrieval/index.cjs +36 -36
- package/dist/retrieval/index.js +1 -1
- package/dist/settings/index.cjs +13 -11
- package/dist/settings/index.cjs.map +1 -1
- package/dist/settings/index.js +13 -11
- package/dist/settings/index.js.map +1 -1
- package/dist/shell/SplitLayout.d.ts +32 -0
- package/dist/shell/index.cjs +72 -68
- package/dist/shell/index.d.ts +1 -0
- package/dist/shell/index.js +2 -2
- package/dist/site/index.cjs +71 -71
- package/dist/site/index.js +3 -3
- package/dist/studio/index.cjs +79 -76
- package/dist/studio/index.cjs.map +1 -1
- package/dist/studio/index.js +9 -6
- package/dist/studio/index.js.map +1 -1
- package/dist/workspaces/WorkspaceGallery.d.ts +42 -0
- package/dist/workspaces/index.cjs +74 -7
- package/dist/workspaces/index.cjs.map +1 -1
- package/dist/workspaces/index.d.ts +2 -0
- package/dist/workspaces/index.js +73 -7
- package/dist/workspaces/index.js.map +1 -1
- package/package.json +3 -3
- package/src/blocks.css +10 -13
- package/dist/chunk-2K33YGM6.cjs.map +0 -1
- package/dist/chunk-54Q3RNJU.cjs.map +0 -1
- package/dist/chunk-7PEELPMA.js.map +0 -1
- package/dist/chunk-AZQDNYH4.js.map +0 -1
- package/dist/chunk-G3G7LZPM.cjs.map +0 -1
- package/dist/chunk-GDFWJ73C.cjs.map +0 -1
- package/dist/chunk-ITGHMJOM.js.map +0 -1
- package/dist/chunk-SCFYPAG6.cjs +0 -18
- package/dist/chunk-SCFYPAG6.cjs.map +0 -1
- package/dist/chunk-SYDHKKRZ.cjs.map +0 -1
- package/dist/chunk-TYZUCAT7.js.map +0 -1
- package/dist/chunk-UFHMLHIR.cjs.map +0 -1
- package/dist/chunk-UWGIB3VQ.js.map +0 -1
- package/dist/chunk-WJMEXTVD.cjs.map +0 -1
- package/dist/chunk-WTNMWEBC.js.map +0 -1
- package/dist/chunk-WW6EOVZA.js.map +0 -1
- package/dist/chunk-XNBAXRY7.cjs.map +0 -1
- package/dist/chunk-YBXCZEWS.js.map +0 -1
- package/dist/chunk-YDHO4AVL.js +0 -16
- package/dist/chunk-YDHO4AVL.js.map +0 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use client";
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
4
|
+
var chunkKHX2BX3S_cjs = require('./chunk-KHX2BX3S.cjs');
|
|
5
5
|
var chunkMHVNT4J3_cjs = require('./chunk-MHVNT4J3.cjs');
|
|
6
6
|
var react = require('react');
|
|
7
7
|
var lucideReact = require('lucide-react');
|
|
@@ -13,1045 +13,6 @@ function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }
|
|
|
13
13
|
|
|
14
14
|
var DOMPurify__default = /*#__PURE__*/_interopDefault(DOMPurify);
|
|
15
15
|
|
|
16
|
-
var DEFAULT_MESSAGE_LABELS = {
|
|
17
|
-
subagentBadge: "sub-agent",
|
|
18
|
-
hideSteps: "Hide steps",
|
|
19
|
-
showSteps: "Show steps",
|
|
20
|
-
stepCount: (count) => `${count} step${count !== 1 ? "s" : ""}`,
|
|
21
|
-
openSource: (num, title) => `Open source ${num}: ${title}`,
|
|
22
|
-
openSourceAria: (num, title, page) => `Open source ${num}: ${title}${page != null ? `, page ${page}` : ""}`,
|
|
23
|
-
page: (page) => `p. ${page}`,
|
|
24
|
-
pages: (pages) => `pp. ${pages.join(", ")}`,
|
|
25
|
-
moreActionsTitle: "More actions",
|
|
26
|
-
moreActionsAria: "More message actions"
|
|
27
|
-
};
|
|
28
|
-
function MessageRoot({
|
|
29
|
-
role,
|
|
30
|
-
messageId,
|
|
31
|
-
tone = "default",
|
|
32
|
-
testId = `message-${messageId}`,
|
|
33
|
-
className,
|
|
34
|
-
children,
|
|
35
|
-
...rest
|
|
36
|
-
}) {
|
|
37
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
38
|
-
"div",
|
|
39
|
-
{
|
|
40
|
-
"data-slot": "message",
|
|
41
|
-
"data-testid": testId,
|
|
42
|
-
"data-message-role": role,
|
|
43
|
-
className: ui.cn(
|
|
44
|
-
"group mx-auto mb-1 flex w-full max-w-[46rem] justify-center",
|
|
45
|
-
tone === "error" ? "rounded-lg bg-red-bg" : tone === "subagent" ? "rounded-lg bg-muted/40" : "bg-background",
|
|
46
|
-
className
|
|
47
|
-
),
|
|
48
|
-
...rest,
|
|
49
|
-
children
|
|
50
|
-
}
|
|
51
|
-
);
|
|
52
|
-
}
|
|
53
|
-
function MessageContent({
|
|
54
|
-
role,
|
|
55
|
-
messageId,
|
|
56
|
-
testId = `message-content-${messageId}`,
|
|
57
|
-
className,
|
|
58
|
-
children,
|
|
59
|
-
...rest
|
|
60
|
-
}) {
|
|
61
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
62
|
-
"div",
|
|
63
|
-
{
|
|
64
|
-
"data-slot": "message-content",
|
|
65
|
-
"data-testid": testId,
|
|
66
|
-
className: ui.cn(
|
|
67
|
-
"w-full max-w-full overflow-hidden text-chat",
|
|
68
|
-
role === "user" && "flex flex-col items-end",
|
|
69
|
-
className
|
|
70
|
-
),
|
|
71
|
-
...rest,
|
|
72
|
-
children
|
|
73
|
-
}
|
|
74
|
-
);
|
|
75
|
-
}
|
|
76
|
-
var MessageBubble = react.forwardRef(function MessageBubble2({ role, messageId, isEditing, isQueued, testId, className, children, ...rest }, ref) {
|
|
77
|
-
const isUser = role === "user";
|
|
78
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
79
|
-
"div",
|
|
80
|
-
{
|
|
81
|
-
ref,
|
|
82
|
-
"data-slot": "message-bubble",
|
|
83
|
-
"data-testid": testId ?? (isUser ? `user-message-${messageId}` : `assistant-message-${messageId}`),
|
|
84
|
-
className: ui.cn(
|
|
85
|
-
"overflow-hidden transition-colors",
|
|
86
|
-
isUser && "max-w-[80%] rounded-lg bg-muted",
|
|
87
|
-
isEditing && "ring-2 ring-inset ring-primary/30",
|
|
88
|
-
className
|
|
89
|
-
),
|
|
90
|
-
...rest,
|
|
91
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
92
|
-
"div",
|
|
93
|
-
{
|
|
94
|
-
className: ui.cn(
|
|
95
|
-
isUser ? "px-4 py-2.5" : "px-4 py-3 sm:pl-9 sm:pr-0",
|
|
96
|
-
isQueued && "opacity-70"
|
|
97
|
-
),
|
|
98
|
-
children
|
|
99
|
-
}
|
|
100
|
-
)
|
|
101
|
-
}
|
|
102
|
-
);
|
|
103
|
-
});
|
|
104
|
-
function MessageByline({
|
|
105
|
-
messageId,
|
|
106
|
-
identity,
|
|
107
|
-
timeLabel,
|
|
108
|
-
isSettled,
|
|
109
|
-
isFailed,
|
|
110
|
-
statusLabel,
|
|
111
|
-
className,
|
|
112
|
-
testId = `assistant-byline-${messageId}`,
|
|
113
|
-
statusTestId
|
|
114
|
-
}) {
|
|
115
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
116
|
-
"div",
|
|
117
|
-
{
|
|
118
|
-
"data-slot": "message-byline",
|
|
119
|
-
"data-testid": testId,
|
|
120
|
-
className: ui.cn("mb-2 flex min-w-0 items-center gap-2 text-sm sm:-ml-9", className),
|
|
121
|
-
children: [
|
|
122
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
123
|
-
"span",
|
|
124
|
-
{
|
|
125
|
-
className: "flex h-7 w-7 shrink-0 items-center justify-center rounded-full bg-ai-soft text-ai-ink",
|
|
126
|
-
"aria-hidden": "true",
|
|
127
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Sparkles, { size: 14 })
|
|
128
|
-
}
|
|
129
|
-
),
|
|
130
|
-
identity,
|
|
131
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "truncate text-xs text-muted-foreground", children: timeLabel }),
|
|
132
|
-
isSettled && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "text-xs text-muted-foreground", "aria-hidden": "true", children: "\xB7" }),
|
|
133
|
-
isSettled && /* @__PURE__ */ jsxRuntime.jsx(
|
|
134
|
-
"span",
|
|
135
|
-
{
|
|
136
|
-
className: ui.cn(
|
|
137
|
-
"shrink-0 text-xs",
|
|
138
|
-
isFailed ? "font-medium text-red-text" : "text-muted-foreground"
|
|
139
|
-
),
|
|
140
|
-
"data-testid": chunkMHVNT4J3_cjs.testIdOr(statusTestId, { testId: "assistant-status" }),
|
|
141
|
-
children: statusLabel
|
|
142
|
-
}
|
|
143
|
-
)
|
|
144
|
-
]
|
|
145
|
-
}
|
|
146
|
-
);
|
|
147
|
-
}
|
|
148
|
-
function MessageSubagentBadge({
|
|
149
|
-
messageId,
|
|
150
|
-
children,
|
|
151
|
-
labels,
|
|
152
|
-
className,
|
|
153
|
-
testId = `subagent-task-badge-${messageId}`
|
|
154
|
-
}) {
|
|
155
|
-
const l = { ...DEFAULT_MESSAGE_LABELS, ...labels };
|
|
156
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
157
|
-
"span",
|
|
158
|
-
{
|
|
159
|
-
"data-slot": "message-subagent-badge",
|
|
160
|
-
className: ui.cn(
|
|
161
|
-
"mb-2 inline-block rounded bg-muted px-1 py-0.5 text-xs font-semibold uppercase leading-none tracking-wide text-muted-foreground",
|
|
162
|
-
className
|
|
163
|
-
),
|
|
164
|
-
"data-testid": testId,
|
|
165
|
-
children: children ?? l.subagentBadge
|
|
166
|
-
}
|
|
167
|
-
);
|
|
168
|
-
}
|
|
169
|
-
function MessageBody({
|
|
170
|
-
messageId,
|
|
171
|
-
className,
|
|
172
|
-
children,
|
|
173
|
-
testId = `message-body-${messageId}`
|
|
174
|
-
}) {
|
|
175
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
176
|
-
"div",
|
|
177
|
-
{
|
|
178
|
-
"data-slot": "message-body",
|
|
179
|
-
className: ui.cn("markdown-content m-0 p-0 text-base leading-relaxed", className),
|
|
180
|
-
"data-testid": testId,
|
|
181
|
-
children
|
|
182
|
-
}
|
|
183
|
-
);
|
|
184
|
-
}
|
|
185
|
-
function MessageNarration({
|
|
186
|
-
messageId,
|
|
187
|
-
children,
|
|
188
|
-
className,
|
|
189
|
-
testId = `message-narration-${messageId}`
|
|
190
|
-
}) {
|
|
191
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
192
|
-
"div",
|
|
193
|
-
{
|
|
194
|
-
"data-slot": "message-narration",
|
|
195
|
-
className: ui.cn("opacity-50 transition-opacity duration-300", className),
|
|
196
|
-
"data-provisional": "true",
|
|
197
|
-
"data-testid": testId,
|
|
198
|
-
children
|
|
199
|
-
}
|
|
200
|
-
);
|
|
201
|
-
}
|
|
202
|
-
function SourceChip({
|
|
203
|
-
num,
|
|
204
|
-
title,
|
|
205
|
-
page,
|
|
206
|
-
pages,
|
|
207
|
-
onOpen,
|
|
208
|
-
className,
|
|
209
|
-
labels,
|
|
210
|
-
testId = `source-chip-${num}`
|
|
211
|
-
}) {
|
|
212
|
-
const l = { ...DEFAULT_MESSAGE_LABELS, ...labels };
|
|
213
|
-
const pageText = pages && pages.length > 1 ? l.pages(pages) : page != null ? l.page(page) : null;
|
|
214
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
215
|
-
"button",
|
|
216
|
-
{
|
|
217
|
-
type: "button",
|
|
218
|
-
"data-slot": "source-chip",
|
|
219
|
-
onClick: onOpen,
|
|
220
|
-
className: ui.cn(
|
|
221
|
-
"inline-flex min-h-8 max-w-full items-center gap-2 rounded-md bg-muted px-2 py-1 text-sm text-foreground transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:min-h-11",
|
|
222
|
-
className
|
|
223
|
-
),
|
|
224
|
-
title: l.openSource(num, title),
|
|
225
|
-
"aria-label": l.openSourceAria(num, title, page),
|
|
226
|
-
"data-testid": testId,
|
|
227
|
-
children: [
|
|
228
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "inline-flex h-5 min-w-5 items-center justify-center rounded-sm bg-ai-soft px-1 text-xs font-semibold text-ai-ink", children: num }),
|
|
229
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "min-w-0 truncate", children: title }),
|
|
230
|
-
pageText && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "shrink-0 text-xs text-muted-foreground", children: pageText })
|
|
231
|
-
]
|
|
232
|
-
}
|
|
233
|
-
);
|
|
234
|
-
}
|
|
235
|
-
function mergeSourcesByFile(sources) {
|
|
236
|
-
const byTitle = /* @__PURE__ */ new Map();
|
|
237
|
-
for (const s of sources) {
|
|
238
|
-
const group = byTitle.get(s.title) ?? { nums: [], title: s.title, pages: [] };
|
|
239
|
-
group.nums.push(s.num);
|
|
240
|
-
if (s.page != null && !group.pages.includes(s.page)) group.pages.push(s.page);
|
|
241
|
-
byTitle.set(s.title, group);
|
|
242
|
-
}
|
|
243
|
-
return [...byTitle.values()];
|
|
244
|
-
}
|
|
245
|
-
function MessageSources({
|
|
246
|
-
messageId,
|
|
247
|
-
sources,
|
|
248
|
-
onOpenSource,
|
|
249
|
-
className,
|
|
250
|
-
labels,
|
|
251
|
-
testId = `source-chips-${messageId}`
|
|
252
|
-
}) {
|
|
253
|
-
if (sources.length === 0) return null;
|
|
254
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
255
|
-
"div",
|
|
256
|
-
{
|
|
257
|
-
"data-slot": "message-sources",
|
|
258
|
-
className: ui.cn("mt-3 flex flex-wrap gap-2", className),
|
|
259
|
-
"data-testid": testId,
|
|
260
|
-
children: mergeSourcesByFile(sources).map((g) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
261
|
-
SourceChip,
|
|
262
|
-
{
|
|
263
|
-
num: g.nums.join(", "),
|
|
264
|
-
testId: `source-chip-${g.nums[0]}`,
|
|
265
|
-
title: g.title,
|
|
266
|
-
page: g.pages[0],
|
|
267
|
-
pages: g.pages,
|
|
268
|
-
onOpen: () => onOpenSource(g.nums[0]),
|
|
269
|
-
labels
|
|
270
|
-
},
|
|
271
|
-
g.nums[0]
|
|
272
|
-
))
|
|
273
|
-
}
|
|
274
|
-
);
|
|
275
|
-
}
|
|
276
|
-
function MessageFooter({
|
|
277
|
-
role,
|
|
278
|
-
leading,
|
|
279
|
-
actions,
|
|
280
|
-
steps,
|
|
281
|
-
className,
|
|
282
|
-
labels,
|
|
283
|
-
stepsToggleTestId
|
|
284
|
-
}) {
|
|
285
|
-
const l = { ...DEFAULT_MESSAGE_LABELS, ...labels };
|
|
286
|
-
const isUser = role === "user";
|
|
287
|
-
const showSteps = !isUser && !!steps && steps.count > 0;
|
|
288
|
-
const row = /* @__PURE__ */ jsxRuntime.jsxs(
|
|
289
|
-
"div",
|
|
290
|
-
{
|
|
291
|
-
className: ui.cn(
|
|
292
|
-
"flex items-center text-sm",
|
|
293
|
-
isUser ? "justify-end gap-2 text-xs" : "justify-between"
|
|
294
|
-
),
|
|
295
|
-
children: [
|
|
296
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-center gap-2", children: [
|
|
297
|
-
leading,
|
|
298
|
-
showSteps && /* @__PURE__ */ jsxRuntime.jsx(ui.PopoverTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
299
|
-
"button",
|
|
300
|
-
{
|
|
301
|
-
type: "button",
|
|
302
|
-
className: "flex items-center gap-1 text-muted-foreground transition-colors hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:min-h-11",
|
|
303
|
-
"aria-expanded": steps.open,
|
|
304
|
-
"aria-label": steps.open ? l.hideSteps : l.showSteps,
|
|
305
|
-
"data-testid": chunkMHVNT4J3_cjs.testIdOr(stepsToggleTestId, { testId: "steps-toggle" }),
|
|
306
|
-
children: [
|
|
307
|
-
steps.open ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { size: 14 }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronUp, { size: 14 }),
|
|
308
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "tabular-nums", children: l.stepCount(steps.count) })
|
|
309
|
-
]
|
|
310
|
-
}
|
|
311
|
-
) })
|
|
312
|
-
] }),
|
|
313
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex items-center gap-1", children: actions })
|
|
314
|
-
]
|
|
315
|
-
}
|
|
316
|
-
);
|
|
317
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
318
|
-
"div",
|
|
319
|
-
{
|
|
320
|
-
"data-slot": "message-footer",
|
|
321
|
-
className: ui.cn(
|
|
322
|
-
"text-muted-foreground",
|
|
323
|
-
isUser ? "mt-1 max-w-full self-end" : "mt-3",
|
|
324
|
-
className
|
|
325
|
-
),
|
|
326
|
-
children: steps ? /* @__PURE__ */ jsxRuntime.jsxs(ui.Popover, { open: steps.open, onOpenChange: steps.onOpenChange, children: [
|
|
327
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.PopoverAnchor, { asChild: true, children: row }),
|
|
328
|
-
!isUser && steps.count > 0 && /* @__PURE__ */ jsxRuntime.jsx(
|
|
329
|
-
ui.PopoverContent,
|
|
330
|
-
{
|
|
331
|
-
side: "top",
|
|
332
|
-
align: "start",
|
|
333
|
-
sideOffset: 8,
|
|
334
|
-
className: "max-h-[min(60vh,32rem)] w-[var(--radix-popover-trigger-width)] overflow-y-auto rounded-lg border border-border bg-popover p-0 shadow-lg",
|
|
335
|
-
children: steps.panel
|
|
336
|
-
}
|
|
337
|
-
)
|
|
338
|
-
] }) : row
|
|
339
|
-
}
|
|
340
|
-
);
|
|
341
|
-
}
|
|
342
|
-
var MessageActionButton = react.forwardRef(
|
|
343
|
-
function MessageActionButton2({ isDone, className, type = "button", ...rest }, ref) {
|
|
344
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
345
|
-
"button",
|
|
346
|
-
{
|
|
347
|
-
ref,
|
|
348
|
-
type,
|
|
349
|
-
"data-slot": "message-action",
|
|
350
|
-
className: ui.cn(
|
|
351
|
-
"inline-flex h-8 w-8 items-center justify-center rounded-md text-muted-foreground transition-colors hover:bg-muted hover:text-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring disabled:opacity-50 pointer-coarse:h-11 pointer-coarse:w-11",
|
|
352
|
-
isDone && "text-green-text",
|
|
353
|
-
className
|
|
354
|
-
),
|
|
355
|
-
...rest
|
|
356
|
-
}
|
|
357
|
-
);
|
|
358
|
-
}
|
|
359
|
-
);
|
|
360
|
-
function MessageActionMenu({
|
|
361
|
-
items,
|
|
362
|
-
testId,
|
|
363
|
-
label,
|
|
364
|
-
labels,
|
|
365
|
-
className
|
|
366
|
-
}) {
|
|
367
|
-
const l = { ...DEFAULT_MESSAGE_LABELS, ...labels };
|
|
368
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(ui.DropdownMenu, { children: [
|
|
369
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.DropdownMenuTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
370
|
-
MessageActionButton,
|
|
371
|
-
{
|
|
372
|
-
onClick: (e) => e.stopPropagation(),
|
|
373
|
-
className,
|
|
374
|
-
title: l.moreActionsTitle,
|
|
375
|
-
"aria-label": label ?? l.moreActionsAria,
|
|
376
|
-
"data-testid": testId,
|
|
377
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.MoreHorizontal, { size: 16 })
|
|
378
|
-
}
|
|
379
|
-
) }),
|
|
380
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.DropdownMenuContent, { align: "end", children: items.map((item) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
381
|
-
ui.DropdownMenuItem,
|
|
382
|
-
{
|
|
383
|
-
onClick: (e) => {
|
|
384
|
-
e.stopPropagation();
|
|
385
|
-
item.onSelect();
|
|
386
|
-
},
|
|
387
|
-
className: item.tone === "danger" ? "text-red-text focus:text-red-text" : void 0,
|
|
388
|
-
"data-testid": item.testId,
|
|
389
|
-
children: [
|
|
390
|
-
item.icon,
|
|
391
|
-
item.label
|
|
392
|
-
]
|
|
393
|
-
},
|
|
394
|
-
item.id
|
|
395
|
-
)) })
|
|
396
|
-
] });
|
|
397
|
-
}
|
|
398
|
-
var Message = {
|
|
399
|
-
Root: MessageRoot,
|
|
400
|
-
Content: MessageContent,
|
|
401
|
-
Bubble: MessageBubble,
|
|
402
|
-
Byline: MessageByline,
|
|
403
|
-
SubagentBadge: MessageSubagentBadge,
|
|
404
|
-
Body: MessageBody,
|
|
405
|
-
Narration: MessageNarration,
|
|
406
|
-
Sources: MessageSources,
|
|
407
|
-
Footer: MessageFooter,
|
|
408
|
-
ActionButton: MessageActionButton,
|
|
409
|
-
ActionMenu: MessageActionMenu
|
|
410
|
-
};
|
|
411
|
-
var DEFAULT_MESSAGE_ALERT_LABELS = {
|
|
412
|
-
retrying: "Retrying...",
|
|
413
|
-
retry: "Retry"
|
|
414
|
-
};
|
|
415
|
-
function MessageAlert({
|
|
416
|
-
title,
|
|
417
|
-
description,
|
|
418
|
-
isBusy = false,
|
|
419
|
-
busyTitle,
|
|
420
|
-
labels,
|
|
421
|
-
onActivate,
|
|
422
|
-
actions,
|
|
423
|
-
className,
|
|
424
|
-
testId = "message-alert"
|
|
425
|
-
}) {
|
|
426
|
-
const l = { ...DEFAULT_MESSAGE_ALERT_LABELS, ...labels };
|
|
427
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
428
|
-
"div",
|
|
429
|
-
{
|
|
430
|
-
"data-slot": "message-alert",
|
|
431
|
-
role: isBusy ? "status" : "alert",
|
|
432
|
-
"aria-busy": isBusy,
|
|
433
|
-
className: ui.cn(
|
|
434
|
-
"mb-3 rounded-lg border border-red-border bg-red-bg px-4 py-2 transition-colors",
|
|
435
|
-
className
|
|
436
|
-
),
|
|
437
|
-
"data-testid": testId,
|
|
438
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "flex items-start gap-3", children: [
|
|
439
|
-
isBusy ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
440
|
-
lucideReact.RotateCw,
|
|
441
|
-
{
|
|
442
|
-
"aria-hidden": "true",
|
|
443
|
-
className: "mt-0.5 h-5 w-5 shrink-0 animate-spin text-red-text motion-reduce:animate-none"
|
|
444
|
-
}
|
|
445
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.AlertCircle, { "aria-hidden": "true", className: "mt-0.5 h-5 w-5 shrink-0 text-red-text" }),
|
|
446
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "min-w-0 flex-1", children: [
|
|
447
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "mb-1 text-base font-medium text-red-text", children: isBusy ? busyTitle ?? l.retrying : title }),
|
|
448
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "mb-1 text-sm text-muted-foreground", children: description }),
|
|
449
|
-
(actions || onActivate) && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mt-2 flex flex-wrap gap-2", children: [
|
|
450
|
-
actions,
|
|
451
|
-
onActivate && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
452
|
-
ui.Button,
|
|
453
|
-
{
|
|
454
|
-
type: "button",
|
|
455
|
-
size: "sm",
|
|
456
|
-
variant: "outline",
|
|
457
|
-
className: "pointer-coarse:min-h-11",
|
|
458
|
-
disabled: isBusy,
|
|
459
|
-
onClick: onActivate,
|
|
460
|
-
"data-testid": `${testId}-retry`,
|
|
461
|
-
children: [
|
|
462
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.RotateCw, { "aria-hidden": "true", className: "mr-2 h-4 w-4" }),
|
|
463
|
-
l.retry
|
|
464
|
-
]
|
|
465
|
-
}
|
|
466
|
-
)
|
|
467
|
-
] })
|
|
468
|
-
] })
|
|
469
|
-
] })
|
|
470
|
-
}
|
|
471
|
-
);
|
|
472
|
-
}
|
|
473
|
-
var DEFAULT_MESSAGE_LIST_LABELS = {
|
|
474
|
-
messageList: "Message list",
|
|
475
|
-
startConversation: "Start a new conversation",
|
|
476
|
-
backToConversation: "Back to conversation \u2014 this is a sub-agent's delegated thread",
|
|
477
|
-
conversationMessages: "Conversation messages",
|
|
478
|
-
responding: "Assistant is responding",
|
|
479
|
-
responseComplete: (text) => text ? `Response complete: ${text}` : "Response complete"
|
|
480
|
-
};
|
|
481
|
-
function MessageListRoot({
|
|
482
|
-
className,
|
|
483
|
-
children,
|
|
484
|
-
isBusy = false,
|
|
485
|
-
labels,
|
|
486
|
-
testId = "message-list",
|
|
487
|
-
...rest
|
|
488
|
-
}) {
|
|
489
|
-
const l = { ...DEFAULT_MESSAGE_LIST_LABELS, ...labels };
|
|
490
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
491
|
-
"div",
|
|
492
|
-
{
|
|
493
|
-
"data-slot": "message-list",
|
|
494
|
-
style: { containerType: "inline-size" },
|
|
495
|
-
"data-testid": testId,
|
|
496
|
-
role: "log",
|
|
497
|
-
"aria-live": "off",
|
|
498
|
-
"aria-busy": isBusy,
|
|
499
|
-
"aria-label": l.messageList,
|
|
500
|
-
className,
|
|
501
|
-
...rest,
|
|
502
|
-
children
|
|
503
|
-
}
|
|
504
|
-
);
|
|
505
|
-
}
|
|
506
|
-
function MessageListStatus({
|
|
507
|
-
message,
|
|
508
|
-
testId = "message-list-status"
|
|
509
|
-
}) {
|
|
510
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
511
|
-
"div",
|
|
512
|
-
{
|
|
513
|
-
"data-slot": "message-list-status",
|
|
514
|
-
role: "status",
|
|
515
|
-
"aria-live": "polite",
|
|
516
|
-
"aria-atomic": "true",
|
|
517
|
-
className: "sr-only",
|
|
518
|
-
"data-testid": testId,
|
|
519
|
-
children: message
|
|
520
|
-
}
|
|
521
|
-
);
|
|
522
|
-
}
|
|
523
|
-
function MessageListEmpty({
|
|
524
|
-
children,
|
|
525
|
-
labels,
|
|
526
|
-
className,
|
|
527
|
-
testId = "message-list-empty"
|
|
528
|
-
}) {
|
|
529
|
-
const l = { ...DEFAULT_MESSAGE_LIST_LABELS, ...labels };
|
|
530
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: ui.cn("flex h-64 items-center justify-center", className), "data-testid": testId, children: /* @__PURE__ */ jsxRuntime.jsx("p", { className: "text-muted-foreground", children: children ?? l.startConversation }) });
|
|
531
|
-
}
|
|
532
|
-
function MessageListBanner({
|
|
533
|
-
onBack,
|
|
534
|
-
children,
|
|
535
|
-
labels,
|
|
536
|
-
className,
|
|
537
|
-
testId = "back-to-conversation-button"
|
|
538
|
-
}) {
|
|
539
|
-
const l = { ...DEFAULT_MESSAGE_LIST_LABELS, ...labels };
|
|
540
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
541
|
-
"div",
|
|
542
|
-
{
|
|
543
|
-
"data-slot": "message-list-banner",
|
|
544
|
-
className: ui.cn(
|
|
545
|
-
"sticky top-0 z-10 border-b border-border/40 bg-background px-3 py-2 sm:px-6",
|
|
546
|
-
className
|
|
547
|
-
),
|
|
548
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs(
|
|
549
|
-
"button",
|
|
550
|
-
{
|
|
551
|
-
type: "button",
|
|
552
|
-
onClick: onBack,
|
|
553
|
-
className: "flex items-center gap-1.5 rounded-md px-2 py-1 text-sm font-medium text-primary transition-colors hover:bg-muted/60 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:min-h-11",
|
|
554
|
-
"data-testid": testId,
|
|
555
|
-
children: [
|
|
556
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowLeft, { size: 14 }),
|
|
557
|
-
children ?? l.backToConversation
|
|
558
|
-
]
|
|
559
|
-
}
|
|
560
|
-
)
|
|
561
|
-
}
|
|
562
|
-
);
|
|
563
|
-
}
|
|
564
|
-
function MessageListRows({
|
|
565
|
-
totalSize,
|
|
566
|
-
className,
|
|
567
|
-
children,
|
|
568
|
-
labels,
|
|
569
|
-
...rest
|
|
570
|
-
}) {
|
|
571
|
-
const l = { ...DEFAULT_MESSAGE_LIST_LABELS, ...labels };
|
|
572
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
573
|
-
"div",
|
|
574
|
-
{
|
|
575
|
-
"data-slot": "message-list-rows",
|
|
576
|
-
style: { height: totalSize, position: "relative" },
|
|
577
|
-
role: "list",
|
|
578
|
-
"aria-label": l.conversationMessages,
|
|
579
|
-
className,
|
|
580
|
-
...rest,
|
|
581
|
-
children
|
|
582
|
-
}
|
|
583
|
-
);
|
|
584
|
-
}
|
|
585
|
-
var MessageListRow = react.forwardRef(
|
|
586
|
-
function MessageListRow2({ index, start, messageId, setSize, className, children, ...rest }, ref) {
|
|
587
|
-
const style = {
|
|
588
|
-
position: "absolute",
|
|
589
|
-
top: 0,
|
|
590
|
-
left: 0,
|
|
591
|
-
width: "100%",
|
|
592
|
-
transform: `translateY(${start}px)`
|
|
593
|
-
};
|
|
594
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
595
|
-
"div",
|
|
596
|
-
{
|
|
597
|
-
ref,
|
|
598
|
-
"data-slot": "message-list-row",
|
|
599
|
-
"data-index": index,
|
|
600
|
-
"data-message-id": messageId,
|
|
601
|
-
role: "listitem",
|
|
602
|
-
"aria-posinset": setSize === void 0 ? void 0 : index + 1,
|
|
603
|
-
"aria-setsize": setSize,
|
|
604
|
-
style,
|
|
605
|
-
className,
|
|
606
|
-
...rest,
|
|
607
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: ui.cn("w-full px-3 sm:px-6"), children })
|
|
608
|
-
}
|
|
609
|
-
);
|
|
610
|
-
}
|
|
611
|
-
);
|
|
612
|
-
function MessageListTail() {
|
|
613
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "h-12 sm:h-32", "aria-hidden": "true", children: /* @__PURE__ */ jsxRuntime.jsx("div", { className: "pointer-events-none h-8 bg-gradient-to-b from-background to-transparent sm:h-20" }) });
|
|
614
|
-
}
|
|
615
|
-
var MessageList = {
|
|
616
|
-
Root: MessageListRoot,
|
|
617
|
-
Empty: MessageListEmpty,
|
|
618
|
-
Banner: MessageListBanner,
|
|
619
|
-
Status: MessageListStatus,
|
|
620
|
-
Rows: MessageListRows,
|
|
621
|
-
Row: MessageListRow,
|
|
622
|
-
Tail: MessageListTail
|
|
623
|
-
};
|
|
624
|
-
function toSpeakableText(markdown, maxLength = 600) {
|
|
625
|
-
const flat = markdown.replace(/```[\s\S]*?```/g, " ").replace(/<[^>]+>/g, " ").replace(/!?\[([^\]]*)\]\([^)]*\)/g, "$1").replace(/[*_`#>~|]/g, "").replace(/\s+/g, " ").trim();
|
|
626
|
-
if (flat.length <= maxLength) return flat;
|
|
627
|
-
const cut = flat.slice(0, maxLength);
|
|
628
|
-
const lastSpace = cut.lastIndexOf(" ");
|
|
629
|
-
return `${(lastSpace > maxLength / 2 ? cut.slice(0, lastSpace) : cut).trimEnd()}\u2026`;
|
|
630
|
-
}
|
|
631
|
-
function useStreamAnnouncement({
|
|
632
|
-
isStreaming,
|
|
633
|
-
text,
|
|
634
|
-
resetKey,
|
|
635
|
-
maxLength,
|
|
636
|
-
labels
|
|
637
|
-
}) {
|
|
638
|
-
const l = { ...DEFAULT_MESSAGE_LIST_LABELS, ...labels };
|
|
639
|
-
const [message, setMessage] = react.useState("");
|
|
640
|
-
const wasStreaming = react.useRef(isStreaming);
|
|
641
|
-
const textRef = react.useRef(text);
|
|
642
|
-
textRef.current = text;
|
|
643
|
-
const lastKey = react.useRef(resetKey);
|
|
644
|
-
react.useEffect(() => {
|
|
645
|
-
if (lastKey.current !== resetKey) {
|
|
646
|
-
lastKey.current = resetKey;
|
|
647
|
-
wasStreaming.current = isStreaming;
|
|
648
|
-
setMessage("");
|
|
649
|
-
return;
|
|
650
|
-
}
|
|
651
|
-
if (isStreaming === wasStreaming.current) return;
|
|
652
|
-
wasStreaming.current = isStreaming;
|
|
653
|
-
setMessage(
|
|
654
|
-
isStreaming ? l.responding : l.responseComplete(toSpeakableText(textRef.current, maxLength))
|
|
655
|
-
);
|
|
656
|
-
}, [isStreaming, resetKey]);
|
|
657
|
-
return message;
|
|
658
|
-
}
|
|
659
|
-
var DEFAULT_COMPOSER_LABELS = {
|
|
660
|
-
branchingNotice: "Editing message. Submit to send, or cancel to go back.",
|
|
661
|
-
cancel: "Cancel",
|
|
662
|
-
inputAriaLabel: "Write your prompt here",
|
|
663
|
-
pastedText: "Pasted text",
|
|
664
|
-
pasteSummary: (lines, characters) => `${lines} lines \xB7 ${characters} characters`,
|
|
665
|
-
expand: "Expand",
|
|
666
|
-
retryMessage: "Retry message",
|
|
667
|
-
sendMessage: "Send message",
|
|
668
|
-
voiceButton: "Press and hold to speak",
|
|
669
|
-
jumpToBottom: "Jump to bottom"
|
|
670
|
-
};
|
|
671
|
-
function ComposerRoot({
|
|
672
|
-
onSubmit,
|
|
673
|
-
notice,
|
|
674
|
-
isBranching,
|
|
675
|
-
formRef,
|
|
676
|
-
testId = "message-input",
|
|
677
|
-
formTestId,
|
|
678
|
-
className,
|
|
679
|
-
children,
|
|
680
|
-
...rest
|
|
681
|
-
}) {
|
|
682
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
683
|
-
"div",
|
|
684
|
-
{
|
|
685
|
-
"data-slot": "composer",
|
|
686
|
-
className: ui.cn("relative z-[20] shrink-0", isBranching && "bg-muted/30"),
|
|
687
|
-
"data-testid": testId,
|
|
688
|
-
children: [
|
|
689
|
-
notice,
|
|
690
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
691
|
-
"form",
|
|
692
|
-
{
|
|
693
|
-
ref: formRef,
|
|
694
|
-
onSubmit,
|
|
695
|
-
...rest,
|
|
696
|
-
className: ui.cn("relative w-full", className),
|
|
697
|
-
"data-testid": chunkMHVNT4J3_cjs.testIdOr(formTestId, { testId: "message-input-form" }),
|
|
698
|
-
children
|
|
699
|
-
}
|
|
700
|
-
)
|
|
701
|
-
]
|
|
702
|
-
}
|
|
703
|
-
);
|
|
704
|
-
}
|
|
705
|
-
function ComposerBranchingNotice({
|
|
706
|
-
onCancel,
|
|
707
|
-
children,
|
|
708
|
-
labels,
|
|
709
|
-
testId = "message-input-branching-indicator",
|
|
710
|
-
cancelTestId,
|
|
711
|
-
className,
|
|
712
|
-
...rest
|
|
713
|
-
}) {
|
|
714
|
-
const l = { ...DEFAULT_COMPOSER_LABELS, ...labels };
|
|
715
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
716
|
-
"div",
|
|
717
|
-
{
|
|
718
|
-
...rest,
|
|
719
|
-
"data-slot": "composer-notice",
|
|
720
|
-
className: ui.cn("mb-2 flex items-center rounded-md bg-muted px-3 py-1.5 text-sm", className),
|
|
721
|
-
"data-testid": testId,
|
|
722
|
-
children: [
|
|
723
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.Edit3, { size: 16, className: "mr-2 text-muted-foreground" }),
|
|
724
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-1 text-muted-foreground", children: children ?? l.branchingNotice }),
|
|
725
|
-
onCancel && /* @__PURE__ */ jsxRuntime.jsx(
|
|
726
|
-
ui.Button,
|
|
727
|
-
{
|
|
728
|
-
type: "button",
|
|
729
|
-
variant: "outline",
|
|
730
|
-
size: "sm",
|
|
731
|
-
className: "ml-2",
|
|
732
|
-
onClick: onCancel,
|
|
733
|
-
"data-testid": chunkMHVNT4J3_cjs.testIdOr(cancelTestId, { testId: "cancel-branching-button" }),
|
|
734
|
-
children: l.cancel
|
|
735
|
-
}
|
|
736
|
-
)
|
|
737
|
-
]
|
|
738
|
-
}
|
|
739
|
-
);
|
|
740
|
-
}
|
|
741
|
-
var INTERACTIVE = 'button, a, input, textarea, select, [role="button"], [contenteditable="true"]';
|
|
742
|
-
function ComposerFrame({ className, children, ...rest }) {
|
|
743
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
744
|
-
"div",
|
|
745
|
-
{
|
|
746
|
-
"data-slot": "composer-frame",
|
|
747
|
-
className: ui.cn(
|
|
748
|
-
"relative flex w-full flex-col rounded-lg border border-border bg-background px-4 py-3 shadow-lg transition-shadow focus-within:shadow-xl",
|
|
749
|
-
className
|
|
750
|
-
),
|
|
751
|
-
onMouseDown: (e) => {
|
|
752
|
-
const target = e.target;
|
|
753
|
-
if (target.closest(INTERACTIVE)) return;
|
|
754
|
-
e.preventDefault();
|
|
755
|
-
e.currentTarget.querySelector("textarea")?.focus();
|
|
756
|
-
},
|
|
757
|
-
...rest,
|
|
758
|
-
children
|
|
759
|
-
}
|
|
760
|
-
);
|
|
761
|
-
}
|
|
762
|
-
function scrollToLastContentLine(textarea) {
|
|
763
|
-
if (!textarea) return;
|
|
764
|
-
const text = textarea.value;
|
|
765
|
-
const lines = text.split("\n");
|
|
766
|
-
const trimmedLines = text.trimEnd().split("\n");
|
|
767
|
-
if (lines.length - trimmedLines.length > 0 && trimmedLines.length > 0) {
|
|
768
|
-
const lineHeight = parseFloat(getComputedStyle(textarea).lineHeight) || 24;
|
|
769
|
-
textarea.scrollTop = (trimmedLines.length - 1) * lineHeight;
|
|
770
|
-
} else {
|
|
771
|
-
textarea.scrollTop = textarea.scrollHeight;
|
|
772
|
-
}
|
|
773
|
-
}
|
|
774
|
-
var ComposerInput = react.forwardRef(
|
|
775
|
-
function ComposerInput2({
|
|
776
|
-
value,
|
|
777
|
-
onValueChange,
|
|
778
|
-
onKeyDown,
|
|
779
|
-
submitOnEnter = true,
|
|
780
|
-
onPaste,
|
|
781
|
-
placeholder,
|
|
782
|
-
textareaRef,
|
|
783
|
-
isSuggestion,
|
|
784
|
-
isRoomy,
|
|
785
|
-
isPasteCollapsed,
|
|
786
|
-
onExpandPaste,
|
|
787
|
-
ariaLabel,
|
|
788
|
-
textareaProps,
|
|
789
|
-
className,
|
|
790
|
-
labels,
|
|
791
|
-
testId = "message-input-textarea",
|
|
792
|
-
pasteChipTestId
|
|
793
|
-
}, forwardedRef) {
|
|
794
|
-
const l = { ...DEFAULT_COMPOSER_LABELS, ...labels };
|
|
795
|
-
const [isFocused, setIsFocused] = react.useState(false);
|
|
796
|
-
const [isHovered, setIsHovered] = react.useState(false);
|
|
797
|
-
const innerRef = react.useRef(null);
|
|
798
|
-
const setRefs = (node) => {
|
|
799
|
-
innerRef.current = node;
|
|
800
|
-
for (const ref of [forwardedRef, textareaRef]) {
|
|
801
|
-
if (typeof ref === "function") ref(node);
|
|
802
|
-
else if (ref) ref.current = node;
|
|
803
|
-
}
|
|
804
|
-
};
|
|
805
|
-
const handleKeyDown = (event) => {
|
|
806
|
-
onKeyDown?.(event);
|
|
807
|
-
if (event.defaultPrevented || !submitOnEnter) return;
|
|
808
|
-
if (event.key !== "Enter" || event.shiftKey || event.altKey) return;
|
|
809
|
-
if (event.nativeEvent.isComposing || event.keyCode === 229) return;
|
|
810
|
-
event.preventDefault();
|
|
811
|
-
event.currentTarget.form?.requestSubmit();
|
|
812
|
-
};
|
|
813
|
-
if (isPasteCollapsed) {
|
|
814
|
-
const lineCount = value.split("\n").length;
|
|
815
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
816
|
-
"button",
|
|
817
|
-
{
|
|
818
|
-
type: "button",
|
|
819
|
-
"data-slot": "composer-paste-chip",
|
|
820
|
-
onClick: onExpandPaste,
|
|
821
|
-
className: "flex w-full items-center gap-2 rounded-md bg-muted/50 px-3 py-2 text-left transition-colors hover:bg-muted focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring/40",
|
|
822
|
-
"data-testid": chunkMHVNT4J3_cjs.testIdOr(pasteChipTestId, { testId: "long-paste-placeholder" }),
|
|
823
|
-
"data-full-length": value.length,
|
|
824
|
-
children: [
|
|
825
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.FileText, { className: "h-4 w-4 shrink-0 text-muted-foreground", "aria-hidden": "true" }),
|
|
826
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "min-w-0 flex-1", children: [
|
|
827
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "block text-sm font-medium text-foreground", children: l.pastedText }),
|
|
828
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "block text-xs text-muted-foreground", children: l.pasteSummary(lineCount, value.length.toLocaleString()) })
|
|
829
|
-
] }),
|
|
830
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "flex shrink-0 items-center gap-1 text-xs font-medium text-muted-foreground", children: [
|
|
831
|
-
l.expand,
|
|
832
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ChevronDown, { className: "h-3.5 w-3.5", "aria-hidden": "true" })
|
|
833
|
-
] })
|
|
834
|
-
]
|
|
835
|
-
}
|
|
836
|
-
);
|
|
837
|
-
}
|
|
838
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
839
|
-
ui.Textarea,
|
|
840
|
-
{
|
|
841
|
-
...textareaProps,
|
|
842
|
-
"aria-label": ariaLabel ?? l.inputAriaLabel,
|
|
843
|
-
placeholder,
|
|
844
|
-
"data-suggested-query": isSuggestion ? "true" : void 0,
|
|
845
|
-
rows: 1,
|
|
846
|
-
ref: setRefs,
|
|
847
|
-
value,
|
|
848
|
-
onChange: (event) => onValueChange(event.target.value),
|
|
849
|
-
onPaste,
|
|
850
|
-
onKeyDown: handleKeyDown,
|
|
851
|
-
disabled: false,
|
|
852
|
-
className: ui.cn(
|
|
853
|
-
"scrollbar-subtle !min-h-0 pointer-coarse:!min-h-11 pointer-coarse:py-2.5 w-full resize-none border-0 bg-transparent p-0 !text-base leading-relaxed text-foreground shadow-none placeholder:text-muted-foreground/50 focus-visible:ring-0 focus-visible:ring-offset-0 md:!text-base",
|
|
854
|
-
className
|
|
855
|
-
),
|
|
856
|
-
style: {
|
|
857
|
-
fieldSizing: "content",
|
|
858
|
-
maxHeight: isFocused || isHovered ? "40vh" : value ? "6.5em" : isRoomy ? "4em" : "1.7em",
|
|
859
|
-
overflowY: value ? "auto" : "hidden",
|
|
860
|
-
scrollbarGutter: "stable"
|
|
861
|
-
},
|
|
862
|
-
onFocus: () => {
|
|
863
|
-
setIsFocused(true);
|
|
864
|
-
requestAnimationFrame(() => {
|
|
865
|
-
const ta = innerRef.current;
|
|
866
|
-
if (ta) {
|
|
867
|
-
ta.setSelectionRange(ta.value.length, ta.value.length);
|
|
868
|
-
ta.scrollTop = ta.scrollHeight;
|
|
869
|
-
}
|
|
870
|
-
});
|
|
871
|
-
},
|
|
872
|
-
onBlur: () => {
|
|
873
|
-
setIsFocused(false);
|
|
874
|
-
if (!isHovered) requestAnimationFrame(() => scrollToLastContentLine(innerRef.current));
|
|
875
|
-
},
|
|
876
|
-
onMouseEnter: () => setIsHovered(true),
|
|
877
|
-
onMouseLeave: () => {
|
|
878
|
-
setIsHovered(false);
|
|
879
|
-
if (!isFocused) requestAnimationFrame(() => scrollToLastContentLine(innerRef.current));
|
|
880
|
-
},
|
|
881
|
-
"data-testid": testId
|
|
882
|
-
}
|
|
883
|
-
);
|
|
884
|
-
}
|
|
885
|
-
);
|
|
886
|
-
function ComposerToolbar({ leading, trailing, className }) {
|
|
887
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
888
|
-
"div",
|
|
889
|
-
{
|
|
890
|
-
"data-slot": "composer-toolbar",
|
|
891
|
-
className: ui.cn(
|
|
892
|
-
"mt-2 flex flex-wrap items-center justify-between gap-x-1 gap-y-0.5",
|
|
893
|
-
className
|
|
894
|
-
),
|
|
895
|
-
children: [
|
|
896
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex shrink-0 items-center gap-1", children: leading }),
|
|
897
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "ml-auto flex min-w-0 items-center justify-end gap-1", children: trailing })
|
|
898
|
-
]
|
|
899
|
-
}
|
|
900
|
-
);
|
|
901
|
-
}
|
|
902
|
-
function ComposerSend({
|
|
903
|
-
onSend,
|
|
904
|
-
disabled,
|
|
905
|
-
isRetry,
|
|
906
|
-
labels,
|
|
907
|
-
className,
|
|
908
|
-
testIds
|
|
909
|
-
}) {
|
|
910
|
-
const l = { ...DEFAULT_COMPOSER_LABELS, ...labels };
|
|
911
|
-
const sendTestId = chunkMHVNT4J3_cjs.testIdOr(testIds?.send, { testId: "send-message-button" });
|
|
912
|
-
const retryTestId = chunkMHVNT4J3_cjs.testIdOr(testIds?.retry, { testId: "retry-button" });
|
|
913
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
914
|
-
ui.Button,
|
|
915
|
-
{
|
|
916
|
-
type: "button",
|
|
917
|
-
size: "icon",
|
|
918
|
-
className: ui.cn(
|
|
919
|
-
"h-9 w-9 shrink-0 pointer-coarse:h-11 pointer-coarse:w-11",
|
|
920
|
-
// A faded primary is unreadable; a flat muted chip reads as "not available yet" at 4.5:1.
|
|
921
|
-
"disabled:bg-muted disabled:text-muted-foreground disabled:opacity-100",
|
|
922
|
-
className
|
|
923
|
-
),
|
|
924
|
-
"aria-label": isRetry ? l.retryMessage : l.sendMessage,
|
|
925
|
-
disabled,
|
|
926
|
-
onClick: onSend,
|
|
927
|
-
"data-testid": isRetry ? retryTestId : sendTestId,
|
|
928
|
-
children: isRetry ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.RotateCw, { className: "h-3.5 w-3.5" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Send, { className: "h-3.5 w-3.5" })
|
|
929
|
-
}
|
|
930
|
-
);
|
|
931
|
-
}
|
|
932
|
-
function ComposerVoiceButton({
|
|
933
|
-
isRecording,
|
|
934
|
-
isBusy,
|
|
935
|
-
onPressStart,
|
|
936
|
-
onPressEnd,
|
|
937
|
-
label,
|
|
938
|
-
labels,
|
|
939
|
-
className,
|
|
940
|
-
testIds
|
|
941
|
-
}) {
|
|
942
|
-
const text = label ?? { ...DEFAULT_COMPOSER_LABELS, ...labels }.voiceButton;
|
|
943
|
-
const startTestId = chunkMHVNT4J3_cjs.testIdOr(testIds?.start, { testId: "start-recording-button" });
|
|
944
|
-
const recordingTestId = chunkMHVNT4J3_cjs.testIdOr(testIds?.recording, { testId: "recording-mic-button" });
|
|
945
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(ui.Tooltip, { children: [
|
|
946
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
947
|
-
ui.Button,
|
|
948
|
-
{
|
|
949
|
-
type: "button",
|
|
950
|
-
variant: "ghost",
|
|
951
|
-
size: "sm",
|
|
952
|
-
"aria-label": text,
|
|
953
|
-
onPointerDown: (e) => {
|
|
954
|
-
e.preventDefault();
|
|
955
|
-
onPressStart();
|
|
956
|
-
},
|
|
957
|
-
onPointerUp: onPressEnd,
|
|
958
|
-
onPointerLeave: onPressEnd,
|
|
959
|
-
onPointerCancel: onPressEnd,
|
|
960
|
-
disabled: isBusy,
|
|
961
|
-
className: ui.cn(
|
|
962
|
-
"h-8 w-8 shrink-0 p-0 hover:bg-muted pointer-coarse:h-11 pointer-coarse:w-11",
|
|
963
|
-
isRecording && "bg-red-bg",
|
|
964
|
-
className
|
|
965
|
-
),
|
|
966
|
-
"data-testid": isRecording ? recordingTestId : startTestId,
|
|
967
|
-
children: isBusy ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Loader2, { className: "h-3.5 w-3.5 animate-spin text-muted-foreground" }) : isRecording ? /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Square, { className: "h-3 w-3 fill-red-text text-red-text" }) : /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Mic, { className: "h-4 w-4 text-muted-foreground" })
|
|
968
|
-
}
|
|
969
|
-
) }),
|
|
970
|
-
/* @__PURE__ */ jsxRuntime.jsx(ui.TooltipContent, { side: "top", children: text })
|
|
971
|
-
] });
|
|
972
|
-
}
|
|
973
|
-
function ComposerContainer({
|
|
974
|
-
className,
|
|
975
|
-
children,
|
|
976
|
-
testId = "message-input-container",
|
|
977
|
-
...rest
|
|
978
|
-
}) {
|
|
979
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
980
|
-
"div",
|
|
981
|
-
{
|
|
982
|
-
...rest,
|
|
983
|
-
"data-slot": "composer-container",
|
|
984
|
-
className: ui.cn("w-full bg-background py-1", className),
|
|
985
|
-
"data-testid": testId,
|
|
986
|
-
children
|
|
987
|
-
}
|
|
988
|
-
);
|
|
989
|
-
}
|
|
990
|
-
function ComposerDock({ children, floating }) {
|
|
991
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
992
|
-
"div",
|
|
993
|
-
{
|
|
994
|
-
"data-slot": "composer-dock",
|
|
995
|
-
className: "sticky bottom-0 z-40 w-full pb-4 sm:pb-[max(1rem,env(safe-area-inset-bottom))]",
|
|
996
|
-
children: [
|
|
997
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
998
|
-
"div",
|
|
999
|
-
{
|
|
1000
|
-
className: "pointer-events-none absolute bottom-full left-0 right-0 h-16 bg-gradient-to-b from-transparent to-background/70",
|
|
1001
|
-
"aria-hidden": "true"
|
|
1002
|
-
}
|
|
1003
|
-
),
|
|
1004
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1005
|
-
"div",
|
|
1006
|
-
{
|
|
1007
|
-
className: "pointer-events-none absolute bottom-0 left-0 right-0 h-4 bg-gradient-to-b from-transparent to-background/60 backdrop-blur-sm",
|
|
1008
|
-
"aria-hidden": "true"
|
|
1009
|
-
}
|
|
1010
|
-
),
|
|
1011
|
-
floating,
|
|
1012
|
-
children
|
|
1013
|
-
]
|
|
1014
|
-
}
|
|
1015
|
-
);
|
|
1016
|
-
}
|
|
1017
|
-
function ScrollToBottom({
|
|
1018
|
-
show,
|
|
1019
|
-
onClick,
|
|
1020
|
-
label,
|
|
1021
|
-
labels,
|
|
1022
|
-
className,
|
|
1023
|
-
testId = "scroll-to-bottom-button"
|
|
1024
|
-
}) {
|
|
1025
|
-
if (!show) return null;
|
|
1026
|
-
const text = label ?? { ...DEFAULT_COMPOSER_LABELS, ...labels }.jumpToBottom;
|
|
1027
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1028
|
-
ui.Button,
|
|
1029
|
-
{
|
|
1030
|
-
onClick,
|
|
1031
|
-
variant: "outline",
|
|
1032
|
-
size: "icon",
|
|
1033
|
-
className: ui.cn(
|
|
1034
|
-
"absolute -top-12 left-1/2 z-[15] h-10 w-10 -translate-x-1/2 shadow-lg pointer-coarse:h-11 pointer-coarse:w-11",
|
|
1035
|
-
className
|
|
1036
|
-
),
|
|
1037
|
-
title: text,
|
|
1038
|
-
"aria-label": text,
|
|
1039
|
-
"data-testid": testId,
|
|
1040
|
-
children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowDown, { size: 20 })
|
|
1041
|
-
}
|
|
1042
|
-
);
|
|
1043
|
-
}
|
|
1044
|
-
var Composer = {
|
|
1045
|
-
Root: ComposerRoot,
|
|
1046
|
-
Notice: ComposerBranchingNotice,
|
|
1047
|
-
Frame: ComposerFrame,
|
|
1048
|
-
Input: ComposerInput,
|
|
1049
|
-
Toolbar: ComposerToolbar,
|
|
1050
|
-
Send: ComposerSend,
|
|
1051
|
-
VoiceButton: ComposerVoiceButton,
|
|
1052
|
-
Container: ComposerContainer,
|
|
1053
|
-
Dock: ComposerDock
|
|
1054
|
-
};
|
|
1055
16
|
function listOptionId(listboxId, index) {
|
|
1056
17
|
return `${listboxId}-option-${index}`;
|
|
1057
18
|
}
|
|
@@ -1307,141 +268,6 @@ function PinnedDocChip({
|
|
|
1307
268
|
}
|
|
1308
269
|
);
|
|
1309
270
|
}
|
|
1310
|
-
var DEFAULT_CONVERSATION_EMPTY_LABELS = {
|
|
1311
|
-
title: "Ask ARBI about your documents",
|
|
1312
|
-
description: "Ask a question and verify every answer against the source.",
|
|
1313
|
-
dropDocuments: "Drop documents here to add them"
|
|
1314
|
-
};
|
|
1315
|
-
function AddDocumentsArea({
|
|
1316
|
-
onAddDocuments,
|
|
1317
|
-
label,
|
|
1318
|
-
testId
|
|
1319
|
-
}) {
|
|
1320
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1321
|
-
"button",
|
|
1322
|
-
{
|
|
1323
|
-
type: "button",
|
|
1324
|
-
onClick: () => onAddDocuments(),
|
|
1325
|
-
onDragOver: (e) => {
|
|
1326
|
-
if (e.dataTransfer.types.includes("Files")) {
|
|
1327
|
-
e.preventDefault();
|
|
1328
|
-
e.dataTransfer.dropEffect = "copy";
|
|
1329
|
-
}
|
|
1330
|
-
},
|
|
1331
|
-
onDrop: (e) => {
|
|
1332
|
-
const files = Array.from(e.dataTransfer.files ?? []);
|
|
1333
|
-
if (files.length > 0) {
|
|
1334
|
-
e.preventDefault();
|
|
1335
|
-
onAddDocuments(files);
|
|
1336
|
-
}
|
|
1337
|
-
},
|
|
1338
|
-
"data-testid": testId,
|
|
1339
|
-
className: "mx-auto flex w-full max-w-sm items-center justify-center gap-2 rounded-lg bg-muted px-3 py-2.5 text-sm text-muted-foreground transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:min-h-11",
|
|
1340
|
-
children: [
|
|
1341
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.FileUp, { className: "h-4 w-4 shrink-0" }),
|
|
1342
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: label })
|
|
1343
|
-
]
|
|
1344
|
-
}
|
|
1345
|
-
);
|
|
1346
|
-
}
|
|
1347
|
-
var BELOW = "mx-auto w-full max-w-4xl text-left";
|
|
1348
|
-
var CHIP = "group inline-flex items-center rounded-full bg-muted px-3.5 py-2 text-left text-sm text-foreground transition-colors hover:bg-accent focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring pointer-coarse:min-h-11";
|
|
1349
|
-
function ConversationEmpty({
|
|
1350
|
-
hasDocuments,
|
|
1351
|
-
prompts,
|
|
1352
|
-
shortcut,
|
|
1353
|
-
onUsePrompt,
|
|
1354
|
-
onAddDocuments,
|
|
1355
|
-
noDocuments,
|
|
1356
|
-
below,
|
|
1357
|
-
title,
|
|
1358
|
-
description,
|
|
1359
|
-
className,
|
|
1360
|
-
labels,
|
|
1361
|
-
testIds
|
|
1362
|
-
}) {
|
|
1363
|
-
const l = { ...DEFAULT_CONVERSATION_EMPTY_LABELS, ...labels };
|
|
1364
|
-
const rootTestId = chunkMHVNT4J3_cjs.testIdOr(testIds?.root, { testId: "conversation-empty-state" });
|
|
1365
|
-
const uploadTestId = chunkMHVNT4J3_cjs.testIdOr(testIds?.upload, { testId: "conversation-empty-upload" });
|
|
1366
|
-
const shortcutTestId = chunkMHVNT4J3_cjs.testIdOr(testIds?.shortcut, {
|
|
1367
|
-
testId: "conversation-shortcut-main-events"
|
|
1368
|
-
});
|
|
1369
|
-
const promptTestId = chunkMHVNT4J3_cjs.testIdOr(testIds?.prompt, { testId: "conversation-example-prompt" });
|
|
1370
|
-
if (!hasDocuments) {
|
|
1371
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1372
|
-
"div",
|
|
1373
|
-
{
|
|
1374
|
-
"data-slot": "conversation-empty",
|
|
1375
|
-
className: ui.cn(
|
|
1376
|
-
"absolute inset-0 flex flex-col items-center overflow-y-auto px-6 py-8 pb-28",
|
|
1377
|
-
className
|
|
1378
|
-
),
|
|
1379
|
-
"data-testid": rootTestId,
|
|
1380
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "my-auto flex w-full flex-col items-center gap-8", children: [
|
|
1381
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "flex w-full max-w-xl flex-col items-center gap-3", children: noDocuments }),
|
|
1382
|
-
below && /* @__PURE__ */ jsxRuntime.jsx("div", { className: BELOW, children: below })
|
|
1383
|
-
] })
|
|
1384
|
-
}
|
|
1385
|
-
);
|
|
1386
|
-
}
|
|
1387
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
1388
|
-
"div",
|
|
1389
|
-
{
|
|
1390
|
-
"data-slot": "conversation-empty",
|
|
1391
|
-
className: ui.cn("absolute inset-0 flex overflow-y-auto p-6 pb-28", className),
|
|
1392
|
-
"data-testid": rootTestId,
|
|
1393
|
-
children: /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "m-auto flex w-full flex-col", children: [
|
|
1394
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mx-auto w-full max-w-xl text-center", children: [
|
|
1395
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mx-auto mb-4 flex h-12 w-12 items-center justify-center rounded-lg bg-ai-soft text-ai-ink", children: /* @__PURE__ */ jsxRuntime.jsx(lucideReact.Sparkles, { className: "h-6 w-6" }) }),
|
|
1396
|
-
/* @__PURE__ */ jsxRuntime.jsx("h2", { className: "text-lg font-semibold text-foreground", children: title ?? l.title }),
|
|
1397
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "mt-1.5 text-sm text-muted-foreground", children: description ?? l.description })
|
|
1398
|
-
] }),
|
|
1399
|
-
below && /* @__PURE__ */ jsxRuntime.jsx("div", { className: ui.cn(BELOW, "mt-6"), children: below }),
|
|
1400
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "mx-auto w-full max-w-xl text-center", children: [
|
|
1401
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: ui.cn("flex flex-wrap justify-center gap-2", below ? "mt-8" : "mt-5"), children: [
|
|
1402
|
-
shortcut && /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1403
|
-
"button",
|
|
1404
|
-
{
|
|
1405
|
-
type: "button",
|
|
1406
|
-
onClick: () => onUsePrompt(shortcut.prompt),
|
|
1407
|
-
title: shortcut.prompt,
|
|
1408
|
-
className: ui.cn(CHIP, "gap-2 font-medium"),
|
|
1409
|
-
"data-testid": shortcutTestId,
|
|
1410
|
-
children: [
|
|
1411
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.GanttChartSquare, { className: "h-4 w-4 shrink-0 text-ai-ink" }),
|
|
1412
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { children: shortcut.label }),
|
|
1413
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowUpRight, { className: "h-3.5 w-3.5 shrink-0 text-muted-foreground" })
|
|
1414
|
-
]
|
|
1415
|
-
}
|
|
1416
|
-
),
|
|
1417
|
-
prompts.map((prompt) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1418
|
-
"button",
|
|
1419
|
-
{
|
|
1420
|
-
type: "button",
|
|
1421
|
-
onClick: () => onUsePrompt(prompt),
|
|
1422
|
-
className: ui.cn(CHIP, "gap-1.5"),
|
|
1423
|
-
"data-testid": promptTestId,
|
|
1424
|
-
children: [
|
|
1425
|
-
prompt,
|
|
1426
|
-
/* @__PURE__ */ jsxRuntime.jsx(lucideReact.ArrowUpRight, { className: "h-3.5 w-3.5 text-muted-foreground" })
|
|
1427
|
-
]
|
|
1428
|
-
},
|
|
1429
|
-
prompt
|
|
1430
|
-
))
|
|
1431
|
-
] }),
|
|
1432
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "mt-5", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1433
|
-
AddDocumentsArea,
|
|
1434
|
-
{
|
|
1435
|
-
onAddDocuments,
|
|
1436
|
-
label: l.dropDocuments,
|
|
1437
|
-
testId: uploadTestId
|
|
1438
|
-
}
|
|
1439
|
-
) })
|
|
1440
|
-
] })
|
|
1441
|
-
] })
|
|
1442
|
-
}
|
|
1443
|
-
);
|
|
1444
|
-
}
|
|
1445
271
|
var DEFAULT_CONVERSATION_LAYOUT_LABELS = {
|
|
1446
272
|
loadingMessages: "Loading messages..."
|
|
1447
273
|
};
|
|
@@ -1694,7 +520,7 @@ function ModelPickerPopover({
|
|
|
1694
520
|
title = "Select AI Model",
|
|
1695
521
|
children
|
|
1696
522
|
}) {
|
|
1697
|
-
return /* @__PURE__ */ jsxRuntime.jsx(
|
|
523
|
+
return /* @__PURE__ */ jsxRuntime.jsx(chunkKHX2BX3S_cjs.BlocksTooltipProvider, { children: /* @__PURE__ */ jsxRuntime.jsxs(ui.Popover, { open, onOpenChange, children: [
|
|
1698
524
|
/* @__PURE__ */ jsxRuntime.jsxs(ui.Tooltip, { children: [
|
|
1699
525
|
/* @__PURE__ */ jsxRuntime.jsx(ui.TooltipTrigger, { asChild: true, children: /* @__PURE__ */ jsxRuntime.jsx(ui.PopoverTrigger, { asChild: true, children: trigger }) }),
|
|
1700
526
|
tooltip && !open && /* @__PURE__ */ jsxRuntime.jsx(ui.TooltipContent, { side: "top", children: tooltip })
|
|
@@ -2706,72 +1532,6 @@ function ContextPanelTabs({
|
|
|
2706
1532
|
tabs.map((t) => /* @__PURE__ */ jsxRuntime.jsx(ui.TabsContent, { value: t.value, className: "mt-3", children: t.content }, t.value))
|
|
2707
1533
|
] });
|
|
2708
1534
|
}
|
|
2709
|
-
function canHover() {
|
|
2710
|
-
return typeof window !== "undefined" && !!window.matchMedia?.("(hover: hover)").matches;
|
|
2711
|
-
}
|
|
2712
|
-
function isFocusVisible(el) {
|
|
2713
|
-
try {
|
|
2714
|
-
return el.matches(":focus-visible");
|
|
2715
|
-
} catch {
|
|
2716
|
-
return true;
|
|
2717
|
-
}
|
|
2718
|
-
}
|
|
2719
|
-
var ContextChip = react.forwardRef(function ContextChip2({
|
|
2720
|
-
count,
|
|
2721
|
-
label,
|
|
2722
|
-
isOpen = false,
|
|
2723
|
-
children,
|
|
2724
|
-
className,
|
|
2725
|
-
onMouseEnter,
|
|
2726
|
-
onMouseLeave,
|
|
2727
|
-
onFocus,
|
|
2728
|
-
onBlur,
|
|
2729
|
-
...props
|
|
2730
|
-
}, ref) {
|
|
2731
|
-
const [isHovered, setIsHovered] = react.useState(false);
|
|
2732
|
-
const [isFocused, setIsFocused] = react.useState(false);
|
|
2733
|
-
const isEditing = isHovered || isFocused || isOpen;
|
|
2734
|
-
const Icon = isEditing ? lucideReact.Pencil : lucideReact.FileText;
|
|
2735
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
2736
|
-
ui.Button,
|
|
2737
|
-
{
|
|
2738
|
-
ref,
|
|
2739
|
-
type: "button",
|
|
2740
|
-
variant: "outline",
|
|
2741
|
-
"aria-label": label,
|
|
2742
|
-
"aria-haspopup": "dialog",
|
|
2743
|
-
"aria-expanded": isOpen,
|
|
2744
|
-
"data-slot": "context-chip",
|
|
2745
|
-
"data-icon": isEditing ? "edit" : "document",
|
|
2746
|
-
className: ui.cn(
|
|
2747
|
-
"flex h-8 min-w-0 max-w-[280px] flex-shrink-0 items-center gap-1.5 rounded-md px-2.5",
|
|
2748
|
-
className
|
|
2749
|
-
),
|
|
2750
|
-
...props,
|
|
2751
|
-
onMouseEnter: (e) => {
|
|
2752
|
-
onMouseEnter?.(e);
|
|
2753
|
-
if (canHover()) setIsHovered(true);
|
|
2754
|
-
},
|
|
2755
|
-
onMouseLeave: (e) => {
|
|
2756
|
-
onMouseLeave?.(e);
|
|
2757
|
-
setIsHovered(false);
|
|
2758
|
-
},
|
|
2759
|
-
onFocus: (e) => {
|
|
2760
|
-
onFocus?.(e);
|
|
2761
|
-
setIsFocused(isFocusVisible(e.currentTarget));
|
|
2762
|
-
},
|
|
2763
|
-
onBlur: (e) => {
|
|
2764
|
-
onBlur?.(e);
|
|
2765
|
-
setIsFocused(false);
|
|
2766
|
-
},
|
|
2767
|
-
children: [
|
|
2768
|
-
/* @__PURE__ */ jsxRuntime.jsx(Icon, { className: "h-3.5 w-3.5 flex-shrink-0", "aria-hidden": "true" }),
|
|
2769
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "flex-shrink-0 text-sm font-medium", "data-testid": "context-chip-count", children: count >= 1e3 ? "999+" : count }),
|
|
2770
|
-
children
|
|
2771
|
-
]
|
|
2772
|
-
}
|
|
2773
|
-
);
|
|
2774
|
-
});
|
|
2775
1535
|
function useDismissibleCard({
|
|
2776
1536
|
isOpen,
|
|
2777
1537
|
onClose,
|
|
@@ -2867,21 +1627,10 @@ function LabelPinRow({
|
|
|
2867
1627
|
}
|
|
2868
1628
|
|
|
2869
1629
|
exports.BranchControls = BranchControls;
|
|
2870
|
-
exports.Composer = Composer;
|
|
2871
1630
|
exports.ComposerAccessories = ComposerAccessories;
|
|
2872
|
-
exports.ComposerBranchingNotice = ComposerBranchingNotice;
|
|
2873
|
-
exports.ComposerContainer = ComposerContainer;
|
|
2874
|
-
exports.ComposerDock = ComposerDock;
|
|
2875
|
-
exports.ComposerFrame = ComposerFrame;
|
|
2876
|
-
exports.ComposerInput = ComposerInput;
|
|
2877
|
-
exports.ComposerRoot = ComposerRoot;
|
|
2878
|
-
exports.ComposerSend = ComposerSend;
|
|
2879
|
-
exports.ComposerToolbar = ComposerToolbar;
|
|
2880
1631
|
exports.ComposerTools = ComposerTools;
|
|
2881
|
-
exports.ComposerVoiceButton = ComposerVoiceButton;
|
|
2882
1632
|
exports.ContextActionButton = ContextActionButton;
|
|
2883
1633
|
exports.ContextCheckRow = ContextCheckRow;
|
|
2884
|
-
exports.ContextChip = ContextChip;
|
|
2885
1634
|
exports.ContextPanelContent = ContextPanelContent;
|
|
2886
1635
|
exports.ContextPanelFooter = ContextPanelFooter;
|
|
2887
1636
|
exports.ContextPanelTabs = ContextPanelTabs;
|
|
@@ -2892,7 +1641,6 @@ exports.ContextSelectList = ContextSelectList;
|
|
|
2892
1641
|
exports.ContextSelectRow = ContextSelectRow;
|
|
2893
1642
|
exports.Conversation = Conversation;
|
|
2894
1643
|
exports.ConversationBody = ConversationBody;
|
|
2895
|
-
exports.ConversationEmpty = ConversationEmpty;
|
|
2896
1644
|
exports.ConversationHeader = ConversationHeader;
|
|
2897
1645
|
exports.ConversationHeaderActions = ConversationHeaderActions;
|
|
2898
1646
|
exports.ConversationHistoryPane = ConversationHistoryPane;
|
|
@@ -2902,42 +1650,16 @@ exports.ConversationRoot = ConversationRoot;
|
|
|
2902
1650
|
exports.ConversationSearchView = ConversationSearchView;
|
|
2903
1651
|
exports.ConversationSettingsButton = ConversationSettingsButton;
|
|
2904
1652
|
exports.DEFAULT_BRANCH_CONTROLS_LABELS = DEFAULT_BRANCH_CONTROLS_LABELS;
|
|
2905
|
-
exports.DEFAULT_COMPOSER_LABELS = DEFAULT_COMPOSER_LABELS;
|
|
2906
|
-
exports.DEFAULT_CONVERSATION_EMPTY_LABELS = DEFAULT_CONVERSATION_EMPTY_LABELS;
|
|
2907
1653
|
exports.DEFAULT_CONVERSATION_LAYOUT_LABELS = DEFAULT_CONVERSATION_LAYOUT_LABELS;
|
|
2908
1654
|
exports.DEFAULT_CONVERSATION_PARTS_LABELS = DEFAULT_CONVERSATION_PARTS_LABELS;
|
|
2909
1655
|
exports.DEFAULT_CONVERSATION_SEARCH_LABELS = DEFAULT_CONVERSATION_SEARCH_LABELS;
|
|
2910
1656
|
exports.DEFAULT_LABEL_PIN_ROW_LABELS = DEFAULT_LABEL_PIN_ROW_LABELS;
|
|
2911
|
-
exports.DEFAULT_MESSAGE_ALERT_LABELS = DEFAULT_MESSAGE_ALERT_LABELS;
|
|
2912
|
-
exports.DEFAULT_MESSAGE_LABELS = DEFAULT_MESSAGE_LABELS;
|
|
2913
|
-
exports.DEFAULT_MESSAGE_LIST_LABELS = DEFAULT_MESSAGE_LIST_LABELS;
|
|
2914
1657
|
exports.DEFAULT_MODEL_PRICING_TIP_LABELS = DEFAULT_MODEL_PRICING_TIP_LABELS;
|
|
2915
1658
|
exports.DEFAULT_PENDING_ANSWER_BAR_LABELS = DEFAULT_PENDING_ANSWER_BAR_LABELS;
|
|
2916
1659
|
exports.DEFAULT_PINNED_DOC_CHIP_LABELS = DEFAULT_PINNED_DOC_CHIP_LABELS;
|
|
2917
1660
|
exports.DEFAULT_SLASH_MENU_LABELS = DEFAULT_SLASH_MENU_LABELS;
|
|
2918
1661
|
exports.DEFAULT_THREAD_MAP_LABELS = DEFAULT_THREAD_MAP_LABELS;
|
|
2919
1662
|
exports.LabelPinRow = LabelPinRow;
|
|
2920
|
-
exports.Message = Message;
|
|
2921
|
-
exports.MessageActionButton = MessageActionButton;
|
|
2922
|
-
exports.MessageActionMenu = MessageActionMenu;
|
|
2923
|
-
exports.MessageAlert = MessageAlert;
|
|
2924
|
-
exports.MessageBody = MessageBody;
|
|
2925
|
-
exports.MessageBubble = MessageBubble;
|
|
2926
|
-
exports.MessageByline = MessageByline;
|
|
2927
|
-
exports.MessageContent = MessageContent;
|
|
2928
|
-
exports.MessageFooter = MessageFooter;
|
|
2929
|
-
exports.MessageList = MessageList;
|
|
2930
|
-
exports.MessageListBanner = MessageListBanner;
|
|
2931
|
-
exports.MessageListEmpty = MessageListEmpty;
|
|
2932
|
-
exports.MessageListRoot = MessageListRoot;
|
|
2933
|
-
exports.MessageListRow = MessageListRow;
|
|
2934
|
-
exports.MessageListRows = MessageListRows;
|
|
2935
|
-
exports.MessageListStatus = MessageListStatus;
|
|
2936
|
-
exports.MessageListTail = MessageListTail;
|
|
2937
|
-
exports.MessageNarration = MessageNarration;
|
|
2938
|
-
exports.MessageRoot = MessageRoot;
|
|
2939
|
-
exports.MessageSources = MessageSources;
|
|
2940
|
-
exports.MessageSubagentBadge = MessageSubagentBadge;
|
|
2941
1663
|
exports.ModelAutoIcon = ModelAutoIcon;
|
|
2942
1664
|
exports.ModelConfigureButton = ModelConfigureButton;
|
|
2943
1665
|
exports.ModelDot = ModelDot;
|
|
@@ -2956,18 +1678,14 @@ exports.NewPaChatButton = NewPaChatButton;
|
|
|
2956
1678
|
exports.PaModeBadge = PaModeBadge;
|
|
2957
1679
|
exports.PendingAnswerBar = PendingAnswerBar;
|
|
2958
1680
|
exports.PinnedDocChip = PinnedDocChip;
|
|
2959
|
-
exports.ScrollToBottom = ScrollToBottom;
|
|
2960
1681
|
exports.SlashMenu = SlashMenu;
|
|
2961
|
-
exports.SourceChip = SourceChip;
|
|
2962
1682
|
exports.ThreadMap = ThreadMap;
|
|
2963
1683
|
exports.ThreadMapDiagram = ThreadMapDiagram;
|
|
2964
1684
|
exports.ThreadMapError = ThreadMapError;
|
|
2965
1685
|
exports.ThreadMapLoading = ThreadMapLoading;
|
|
2966
1686
|
exports.isLongPastedText = isLongPastedText;
|
|
2967
|
-
exports.toSpeakableText = toSpeakableText;
|
|
2968
1687
|
exports.useDismissibleCard = useDismissibleCard;
|
|
2969
1688
|
exports.useListKeyNav = useListKeyNav;
|
|
2970
1689
|
exports.useLongPaste = useLongPaste;
|
|
2971
|
-
|
|
2972
|
-
//# sourceMappingURL=chunk-
|
|
2973
|
-
//# sourceMappingURL=chunk-GDFWJ73C.cjs.map
|
|
1690
|
+
//# sourceMappingURL=chunk-RIL7G7AS.cjs.map
|
|
1691
|
+
//# sourceMappingURL=chunk-RIL7G7AS.cjs.map
|