@burdenoff/fe-libs 2026.1112.4 → 2026.1112.6
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/shared/assistant/api.d.ts +7 -0
- package/dist/shared/assistant/api.js +47 -45
- package/dist/shared/assistant/createSandboxAssistantTransport.js +2 -1
- package/dist/shared/assistant/gatewayClient.js +1 -0
- package/dist/shared/assistant/index.d.ts +4 -0
- package/dist/shared/assistant/keepAlive.d.ts +74 -0
- package/dist/shared/assistant/keepAlive.js +77 -0
- package/dist/shared/assistant/prewarm.d.ts +20 -0
- package/dist/shared/assistant/prewarm.js +25 -4
- package/dist/shared/assistant/runtime.d.ts +7 -2
- package/dist/shared/assistant/runtime.js +23 -22
- package/dist/shared/assistant/signInWarm.d.ts +60 -0
- package/dist/shared/assistant/signInWarm.js +111 -0
- package/dist/shared/assistant/snapshotPoller.d.ts +16 -0
- package/dist/shared/assistant/snapshotPoller.js +29 -22
- package/dist/shared/assistant/staleSession.d.ts +27 -0
- package/dist/shared/assistant/staleSession.js +15 -0
- package/dist/shared/assistant/turnProgress.d.ts +16 -0
- package/dist/shared/assistant/turnProgress.js +30 -4
- package/dist/shared/assistant/ui/AssistantChatArea.js +1286 -1271
- package/dist/shared/assistant/ui/AssistantOverlay.d.ts +7 -0
- package/dist/shared/assistant/ui/AssistantOverlay.js +256 -248
- package/dist/shared/assistant/usageReporting.d.ts +18 -0
- package/dist/shared/assistant/usageReporting.js +17 -5
- package/dist/shared/assistant/useAssistantHeartbeat.d.ts +24 -4
- package/dist/shared/assistant/useAssistantHeartbeat.js +43 -24
- package/dist/shared/assistant/useAssistantSignInWarm.d.ts +19 -0
- package/dist/shared/assistant/useAssistantSignInWarm.js +55 -0
- package/dist/shared/assistant/writeProposals.d.ts +9 -0
- package/dist/shared/components/assistantWidget/AssistantWidget.d.ts +7 -0
- package/dist/shared/components/assistantWidget/AssistantWidget.js +289 -285
- package/dist/shared/graphql/fetch.d.ts +2 -1
- package/dist/shared/graphql/fetch.js +14 -11
- package/dist/shared/providers/shell/AuthTokenProvider.d.ts +6 -0
- package/dist/shared/providers/shell/AuthTokenProvider.js +4 -1
- package/dist/shared/providers/shell/index.d.ts +1 -1
- package/dist/shared/utils/gatewayFetchRewrite.js +1 -1
- package/dist/shared-assistant.js +374 -370
- package/dist/shared-providers-shell.js +12 -12
- package/package.json +1 -1
|
@@ -3,45 +3,45 @@ import { isAssistantQuotaRefusal as t } from "../../assistant/quota.js";
|
|
|
3
3
|
import { AssistantAiDisclaimer as n } from "../../assistant/ui/AssistantAiDisclaimer.js";
|
|
4
4
|
import { useVoiceInput as r } from "./useVoiceInput.js";
|
|
5
5
|
import { MessageContent as i } from "./MessageContent.js";
|
|
6
|
-
import { ASSISTANT_WIDGET_LAUNCHER_BOTTOM_CLASS as
|
|
7
|
-
import { useCallback as
|
|
8
|
-
import { Download as
|
|
9
|
-
import { Fragment as
|
|
6
|
+
import { ASSISTANT_WIDGET_LAUNCHER_BOTTOM_CLASS as a, ASSISTANT_WIDGET_WINDOW_BOTTOM_CLASS as ee, ASSISTANT_WIDGET_WINDOW_MAX_HEIGHT_CLASS as te } from "./assistantWidgetPosition.js";
|
|
7
|
+
import { useCallback as o, useEffect as s, useMemo as ne, useRef as c, useState as l } from "react";
|
|
8
|
+
import { Download as re, FileArchive as ie, History as ae, Link2 as oe, Loader2 as u, MessageCircle as se, Mic as ce, PanelLeftClose as le, PanelLeftOpen as ue, Paperclip as de, Plus as fe, Send as pe, Sparkles as me, Trash2 as he, X as d } from "lucide-react";
|
|
9
|
+
import { Fragment as ge, jsx as f, jsxs as p } from "react/jsx-runtime";
|
|
10
10
|
// src/shared/components/assistantWidget/AssistantWidget.tsx
|
|
11
|
-
function
|
|
11
|
+
function _e(e) {
|
|
12
12
|
return e instanceof Error && e.message && (t(e) || e.name === "AssistantSendRefusal") ? e.message : `Sorry, I couldn't complete that: ${e instanceof Error ? e.message : "Something went wrong. Please try again."}`;
|
|
13
13
|
}
|
|
14
|
-
var
|
|
15
|
-
function
|
|
14
|
+
var m = "bf:toggle-assistant-widget", h = "bf:assistant-widget:isOpen", g = "bf:assistant-widget:railOpen";
|
|
15
|
+
function ve() {
|
|
16
16
|
if (typeof window > "u") return !0;
|
|
17
17
|
try {
|
|
18
|
-
return window.sessionStorage.getItem(
|
|
18
|
+
return window.sessionStorage.getItem(g) !== "0";
|
|
19
19
|
} catch {
|
|
20
20
|
return !0;
|
|
21
21
|
}
|
|
22
22
|
}
|
|
23
|
-
function
|
|
23
|
+
function ye(e) {
|
|
24
24
|
if (typeof window < "u") try {
|
|
25
|
-
window.sessionStorage.setItem(
|
|
25
|
+
window.sessionStorage.setItem(g, e ? "1" : "0");
|
|
26
26
|
} catch {}
|
|
27
27
|
}
|
|
28
|
-
function
|
|
28
|
+
function be() {
|
|
29
29
|
if (typeof window > "u") return !1;
|
|
30
30
|
try {
|
|
31
|
-
return window.sessionStorage.getItem(
|
|
31
|
+
return window.sessionStorage.getItem(h) === "1";
|
|
32
32
|
} catch {
|
|
33
33
|
return !1;
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
function
|
|
36
|
+
function _(e) {
|
|
37
37
|
if (typeof window < "u") try {
|
|
38
|
-
window.sessionStorage.setItem(
|
|
38
|
+
window.sessionStorage.setItem(h, e ? "1" : "0");
|
|
39
39
|
} catch {}
|
|
40
40
|
}
|
|
41
|
-
function
|
|
41
|
+
function xe() {
|
|
42
42
|
return `${Date.now()}-${Math.random().toString(36).slice(2, 9)}`;
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function Se(e) {
|
|
45
45
|
if (!Number.isFinite(e) || e <= 0) return "";
|
|
46
46
|
let t = [
|
|
47
47
|
"B",
|
|
@@ -52,168 +52,172 @@ function Ce(e) {
|
|
|
52
52
|
for (; n >= 1024 && r < t.length - 1;) n /= 1024, r += 1;
|
|
53
53
|
return `${n >= 10 || r === 0 ? Math.round(n) : n.toFixed(1)} ${t[r]}`;
|
|
54
54
|
}
|
|
55
|
-
var
|
|
56
|
-
let
|
|
55
|
+
var v = ({ transport: t, modes: h, defaultModeId: g, title: v = "AI Assistant", subtitle: Ce = "Ask me to do things on this screen — I can run them for you.", placeholder: we = "Ask anything, or describe what to create…", launcherClassName: Te, voiceLang: Ee = "en-US", layout: De = "floating", showSessionPanel: Oe = !1, warmOnSignIn: ke = !0, onNavigate: Ae, topOffsetPx: je = 0, enableAttachments: y = !1, attachmentAccept: Me = ".json,.csv,.xlsx,.xls,.pdf,application/json,text/csv,application/vnd.openxmlformats-officedocument.spreadsheetml.sheet,application/pdf", enableConnectSource: Ne = !1, connectSourceHref: Pe = "/integrations/connections" }) => {
|
|
56
|
+
let b = ne(() => h && h.length > 0 ? h : [{
|
|
57
57
|
id: "__default__",
|
|
58
|
-
label:
|
|
58
|
+
label: v,
|
|
59
59
|
transport: t,
|
|
60
|
-
title:
|
|
61
|
-
subtitle:
|
|
62
|
-
placeholder:
|
|
60
|
+
title: v,
|
|
61
|
+
subtitle: Ce,
|
|
62
|
+
placeholder: we
|
|
63
63
|
}], [
|
|
64
|
-
|
|
64
|
+
h,
|
|
65
65
|
t,
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
]), [
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
}, [
|
|
73
|
-
let
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
}, [
|
|
77
|
-
let [
|
|
78
|
-
|
|
79
|
-
if (
|
|
80
|
-
if (
|
|
81
|
-
|
|
82
|
-
let e =
|
|
83
|
-
(e && !e.disabled ? e :
|
|
84
|
-
} else !
|
|
85
|
-
|
|
66
|
+
v,
|
|
67
|
+
Ce,
|
|
68
|
+
we
|
|
69
|
+
]), [x, Fe] = l(() => g ?? b[0]?.id ?? "__default__"), S = b.find((e) => e.id === x) ?? b[0], C = S.transport, Ie = S.title ?? v, Le = S.subtitle ?? Ce, Re = S.placeholder ?? we;
|
|
70
|
+
s(() => {
|
|
71
|
+
b.some((e) => e.id === x) || Fe(b[0]?.id ?? "__default__");
|
|
72
|
+
}, [b, x]);
|
|
73
|
+
let w = !!C;
|
|
74
|
+
s(() => {
|
|
75
|
+
w || console.error("[AssistantWidget] No transport available — supply `transport`, or a non-empty `modes` where each entry has a transport.");
|
|
76
|
+
}, [w]);
|
|
77
|
+
let [T, E] = l(() => be()), [D, O] = l([]), [k, A] = l(""), [j, M] = l([]), [N, P] = l(!1), [ze, F] = l(!1), [I, L] = l([]), [R, z] = l(!1), [Be, Ve] = l(!1), [He, Ue] = l(() => ve()), [We, B] = l([]), [V, Ge] = l(null), [Ke, qe] = l(!1), H = c(null), Je = c(null), Ye = c(null), Xe = c(null), Ze = c(!1), U = c(null), W = c(null), G = c(!1), Qe = c(null);
|
|
78
|
+
s(() => {
|
|
79
|
+
if (w) {
|
|
80
|
+
if (T && !Ze.current) {
|
|
81
|
+
Xe.current = document.activeElement instanceof HTMLElement && document.activeElement !== document.body ? document.activeElement : Je.current;
|
|
82
|
+
let e = H.current;
|
|
83
|
+
(e && !e.disabled ? e : Ye.current)?.focus();
|
|
84
|
+
} else !T && Ze.current && (Xe.current?.isConnected ? Xe.current : Je.current)?.focus();
|
|
85
|
+
Ze.current = T;
|
|
86
86
|
}
|
|
87
|
-
}, [
|
|
88
|
-
let
|
|
89
|
-
|
|
87
|
+
}, [w, T]);
|
|
88
|
+
let K = De === "sidebar", $e = Oe && !!C?.newSession, et = o(() => {
|
|
89
|
+
Ue((e) => {
|
|
90
90
|
let t = !e;
|
|
91
|
-
return
|
|
91
|
+
return ye(t), t;
|
|
92
92
|
});
|
|
93
|
-
}, [])
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
93
|
+
}, []);
|
|
94
|
+
s(() => {
|
|
95
|
+
ke && C?.prewarm?.("full");
|
|
96
|
+
}, [C, ke]);
|
|
97
|
+
let q = r(Ee), tt = o(() => {
|
|
98
|
+
_(!0), E(!0), C.prewarm?.("full");
|
|
99
|
+
}, [C]), J = o(() => {
|
|
100
|
+
_(!1), E(!1), C.suspend?.();
|
|
101
|
+
}, [C]), Y = o(() => {
|
|
102
|
+
E((e) => {
|
|
99
103
|
let t = !e;
|
|
100
|
-
return
|
|
104
|
+
return _(t), t ? C.prewarm?.("full") : C.suspend?.(), t;
|
|
101
105
|
});
|
|
102
|
-
}, [
|
|
103
|
-
|
|
106
|
+
}, [C]);
|
|
107
|
+
s(() => {
|
|
104
108
|
let e = (e) => {
|
|
105
109
|
let t = e.detail;
|
|
106
|
-
t?.open === !0 ?
|
|
110
|
+
t?.open === !0 ? tt() : t?.open === !1 ? J() : Y();
|
|
107
111
|
};
|
|
108
|
-
return window.addEventListener(
|
|
112
|
+
return window.addEventListener(m, e), () => window.removeEventListener(m, e);
|
|
109
113
|
}, [
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
]),
|
|
114
|
-
|
|
115
|
-
}, [
|
|
116
|
-
let
|
|
117
|
-
if (
|
|
118
|
-
|
|
114
|
+
tt,
|
|
115
|
+
J,
|
|
116
|
+
Y
|
|
117
|
+
]), s(() => {
|
|
118
|
+
q.isListening && q.transcript && A(q.transcript);
|
|
119
|
+
}, [q.transcript, q.isListening]);
|
|
120
|
+
let X = o(async () => {
|
|
121
|
+
if (C.listArtifacts) try {
|
|
122
|
+
B(await C.listArtifacts());
|
|
119
123
|
} catch {
|
|
120
|
-
|
|
124
|
+
B([]);
|
|
121
125
|
}
|
|
122
|
-
}, [
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}, [
|
|
126
|
-
if (!
|
|
127
|
-
let e =
|
|
126
|
+
}, [C]), nt = c(x);
|
|
127
|
+
s(() => {
|
|
128
|
+
nt.current !== x && (nt.current = x, W.current?.abort(), W.current = null, P(!1), O([]), A(""), L([]), z(!1), F(!1), B([]), G.current = !1);
|
|
129
|
+
}, [x]), s(() => {
|
|
130
|
+
if (!T || G.current) return;
|
|
131
|
+
let e = C.loadHistory;
|
|
128
132
|
if (!e) {
|
|
129
|
-
|
|
133
|
+
G.current = !0;
|
|
130
134
|
return;
|
|
131
135
|
}
|
|
132
|
-
|
|
136
|
+
G.current = !0;
|
|
133
137
|
let t = !1;
|
|
134
|
-
return
|
|
138
|
+
return F(!0), (async () => {
|
|
135
139
|
try {
|
|
136
140
|
let n = await e();
|
|
137
|
-
!t && n.length > 0 && (
|
|
141
|
+
!t && n.length > 0 && (O((e) => e.length === 0 ? n : e), X());
|
|
138
142
|
} catch {} finally {
|
|
139
|
-
t ||
|
|
143
|
+
t || F(!1);
|
|
140
144
|
}
|
|
141
145
|
})(), () => {
|
|
142
146
|
t = !0;
|
|
143
147
|
};
|
|
144
148
|
}, [
|
|
149
|
+
T,
|
|
145
150
|
C,
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
E((n) => n.map((n) => n.id === e ? {
|
|
151
|
+
X
|
|
152
|
+
]), s(() => {
|
|
153
|
+
T && U.current && (U.current.scrollTop = U.current.scrollHeight);
|
|
154
|
+
}, [D, T]);
|
|
155
|
+
let Z = o((e, t) => {
|
|
156
|
+
O((n) => n.map((n) => n.id === e ? {
|
|
153
157
|
...n,
|
|
154
158
|
...t
|
|
155
159
|
} : n));
|
|
156
|
-
}, []),
|
|
157
|
-
if (
|
|
158
|
-
|
|
160
|
+
}, []), Q = o(async () => {
|
|
161
|
+
if (C.listSessions) {
|
|
162
|
+
Ve(!0);
|
|
159
163
|
try {
|
|
160
|
-
|
|
164
|
+
L(await C.listSessions());
|
|
161
165
|
} catch {
|
|
162
|
-
|
|
166
|
+
L([]);
|
|
163
167
|
} finally {
|
|
164
|
-
|
|
168
|
+
Ve(!1);
|
|
165
169
|
}
|
|
166
170
|
}
|
|
167
|
-
}, [
|
|
168
|
-
if (
|
|
169
|
-
|
|
171
|
+
}, [C]), rt = o(async (e) => {
|
|
172
|
+
if (C.downloadArtifact && !V) {
|
|
173
|
+
Ge(e.path);
|
|
170
174
|
try {
|
|
171
|
-
await
|
|
175
|
+
await C.downloadArtifact(e);
|
|
172
176
|
} catch {} finally {
|
|
173
|
-
|
|
177
|
+
Ge(null);
|
|
174
178
|
}
|
|
175
179
|
}
|
|
176
|
-
}, [
|
|
177
|
-
|
|
178
|
-
}, [
|
|
179
|
-
if (
|
|
180
|
-
|
|
180
|
+
}, [C, V]), it = o(async () => {
|
|
181
|
+
C.newSession && !N && (O([]), A(""), z(!1), B([]), await C.newSession());
|
|
182
|
+
}, [C, N]), at = o(async (e, t) => {
|
|
183
|
+
if (C.deleteSession && !N) {
|
|
184
|
+
L((t) => t.filter((t) => t.id !== e)), t && (O([]), A(""));
|
|
181
185
|
try {
|
|
182
|
-
await
|
|
186
|
+
await C.deleteSession(e);
|
|
183
187
|
} finally {
|
|
184
|
-
|
|
188
|
+
Q();
|
|
185
189
|
}
|
|
186
190
|
}
|
|
187
191
|
}, [
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
]),
|
|
192
|
-
|
|
193
|
-
}, [
|
|
194
|
-
if (
|
|
195
|
-
|
|
192
|
+
C,
|
|
193
|
+
N,
|
|
194
|
+
Q
|
|
195
|
+
]), ot = o(() => {
|
|
196
|
+
z((e) => (e || Q(), !e));
|
|
197
|
+
}, [Q]), st = o(async (e) => {
|
|
198
|
+
if (C.selectSession && !N) {
|
|
199
|
+
F(!0);
|
|
196
200
|
try {
|
|
197
|
-
|
|
201
|
+
O(await C.selectSession(e)), z(!1), Q(), X();
|
|
198
202
|
} catch {} finally {
|
|
199
|
-
|
|
203
|
+
F(!1);
|
|
200
204
|
}
|
|
201
205
|
}
|
|
202
206
|
}, [
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
]),
|
|
208
|
-
let e =
|
|
209
|
-
if (!e && t.length === 0 ||
|
|
210
|
-
|
|
207
|
+
C,
|
|
208
|
+
N,
|
|
209
|
+
Q,
|
|
210
|
+
X
|
|
211
|
+
]), $ = o(async () => {
|
|
212
|
+
let e = k.trim(), t = j;
|
|
213
|
+
if (!e && t.length === 0 || N) return;
|
|
214
|
+
Ye.current?.contains(document.activeElement) && H.current?.focus(), q.isListening && q.stop(), q.reset(), A(""), M([]), H.current && (H.current.style.height = "auto");
|
|
211
215
|
let n = t.length > 0 ? `📎 ${t.map((e) => e.name).join(", ")}` : "", r = {
|
|
212
|
-
id:
|
|
216
|
+
id: xe(),
|
|
213
217
|
role: "user",
|
|
214
218
|
content: [e, n].filter(Boolean).join("\n")
|
|
215
|
-
}, i =
|
|
216
|
-
|
|
219
|
+
}, i = xe();
|
|
220
|
+
O((e) => [
|
|
217
221
|
...e,
|
|
218
222
|
r,
|
|
219
223
|
{
|
|
@@ -222,365 +226,365 @@ var _ = ({ transport: t, modes: m, defaultModeId: h, title: _ = "AI Assistant",
|
|
|
222
226
|
content: "",
|
|
223
227
|
pending: !0
|
|
224
228
|
}
|
|
225
|
-
]),
|
|
226
|
-
let
|
|
227
|
-
|
|
229
|
+
]), P(!0);
|
|
230
|
+
let a = new AbortController();
|
|
231
|
+
W.current = a;
|
|
228
232
|
try {
|
|
229
|
-
let { text: n } = await
|
|
233
|
+
let { text: n } = await C.sendPrompt({
|
|
230
234
|
prompt: e,
|
|
231
235
|
attachments: t.length > 0 ? t : void 0,
|
|
232
|
-
signal:
|
|
233
|
-
onProgress: (e) =>
|
|
236
|
+
signal: a.signal,
|
|
237
|
+
onProgress: (e) => Z(i, { content: e })
|
|
234
238
|
});
|
|
235
|
-
|
|
239
|
+
Z(i, {
|
|
236
240
|
content: n,
|
|
237
241
|
pending: !1
|
|
238
|
-
}),
|
|
242
|
+
}), X();
|
|
239
243
|
} catch (e) {
|
|
240
|
-
|
|
241
|
-
content:
|
|
244
|
+
Z(i, {
|
|
245
|
+
content: _e(e),
|
|
242
246
|
pending: !1,
|
|
243
247
|
error: !0
|
|
244
248
|
});
|
|
245
249
|
} finally {
|
|
246
|
-
|
|
250
|
+
P(!1), W.current = null, R && Q();
|
|
247
251
|
}
|
|
248
252
|
}, [
|
|
249
|
-
D,
|
|
250
253
|
k,
|
|
251
254
|
j,
|
|
255
|
+
N,
|
|
256
|
+
Z,
|
|
257
|
+
C,
|
|
258
|
+
q,
|
|
259
|
+
R,
|
|
252
260
|
Q,
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
]), st = a((e) => {
|
|
259
|
-
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), ot());
|
|
260
|
-
}, [ot]), ct = a(() => {
|
|
261
|
-
let e = z.current;
|
|
261
|
+
X
|
|
262
|
+
]), ct = o((e) => {
|
|
263
|
+
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), $());
|
|
264
|
+
}, [$]), lt = o(() => {
|
|
265
|
+
let e = H.current;
|
|
262
266
|
e && (e.style.height = "auto", e.style.height = `${Math.min(e.scrollHeight, 120)}px`);
|
|
263
|
-
}, []),
|
|
264
|
-
|
|
265
|
-
}, [
|
|
266
|
-
ref:
|
|
267
|
+
}, []), ut = o(() => {
|
|
268
|
+
q.isListening ? q.stop() : q.start();
|
|
269
|
+
}, [q]), dt = ne(() => /* @__PURE__ */ f("button", {
|
|
270
|
+
ref: Je,
|
|
267
271
|
type: "button",
|
|
268
|
-
onClick:
|
|
269
|
-
onMouseEnter: () => !
|
|
270
|
-
onFocus: () => !
|
|
271
|
-
"aria-label":
|
|
272
|
-
"aria-expanded":
|
|
272
|
+
onClick: Y,
|
|
273
|
+
onMouseEnter: () => !T && C.prewarm?.("probe"),
|
|
274
|
+
onFocus: () => !T && C.prewarm?.("probe"),
|
|
275
|
+
"aria-label": T ? "Close AI assistant" : "Open AI assistant",
|
|
276
|
+
"aria-expanded": T,
|
|
273
277
|
"data-testid": "assistant-widget-launcher",
|
|
274
|
-
className: e("fixed end-6 z-[100] inline-flex size-14 items-center justify-center rounded-full",
|
|
275
|
-
children:
|
|
278
|
+
className: e("fixed end-6 z-[100] inline-flex size-14 items-center justify-center rounded-full", a, "bg-action-primary-bg text-action-primary-text shadow-xl transition-transform duration-200", "hover:scale-105 hover:bg-action-primary-bg-hover focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong cursor-pointer", Te),
|
|
279
|
+
children: f(T ? d : me, { className: "size-6" })
|
|
276
280
|
}), [
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
+
T,
|
|
282
|
+
Y,
|
|
283
|
+
Te,
|
|
284
|
+
C
|
|
281
285
|
]);
|
|
282
|
-
return
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
ref:
|
|
286
|
+
return w ? /* @__PURE__ */ p(ge, { children: [
|
|
287
|
+
dt,
|
|
288
|
+
T ? /* @__PURE__ */ p("div", {
|
|
289
|
+
ref: Ye,
|
|
286
290
|
role: "dialog",
|
|
287
291
|
tabIndex: -1,
|
|
288
|
-
"aria-label":
|
|
292
|
+
"aria-label": Ie,
|
|
289
293
|
"data-testid": "assistant-widget-window",
|
|
290
|
-
"data-layout":
|
|
294
|
+
"data-layout": De,
|
|
291
295
|
onKeyDown: (e) => {
|
|
292
|
-
e.key === "Escape" && !e.defaultPrevented && !
|
|
296
|
+
e.key === "Escape" && !e.defaultPrevented && !Ke && (e.preventDefault(), e.stopPropagation(), J());
|
|
293
297
|
},
|
|
294
|
-
style:
|
|
298
|
+
style: K ? {
|
|
295
299
|
top: je,
|
|
296
300
|
height: `calc(100vh - ${String(je)}px)`
|
|
297
301
|
} : void 0,
|
|
298
|
-
className: e("fixed z-[100] flex overflow-hidden border-border-default bg-bg-surface shadow-2xl",
|
|
299
|
-
children: [
|
|
302
|
+
className: e("fixed z-[100] flex overflow-hidden border-border-default bg-bg-surface shadow-2xl", K ? "bottom-0 end-0 w-full border-s sm:w-[480px] lg:w-[560px] animate-in slide-in-from-right duration-200" : e("flex-col rounded-xl border end-6 h-[560px] w-[calc(100vw-3rem)] sm:w-[400px] animate-in slide-in-from-bottom-2 fade-in duration-200", ee, te)),
|
|
303
|
+
children: [K && $e && He ? /* @__PURE__ */ p("aside", {
|
|
300
304
|
"data-testid": "assistant-session-panel",
|
|
301
305
|
className: "flex w-[168px] shrink-0 flex-col gap-1 border-e border-border-subtle bg-bg-sunken p-2",
|
|
302
306
|
children: [
|
|
303
|
-
/* @__PURE__ */
|
|
307
|
+
/* @__PURE__ */ p("button", {
|
|
304
308
|
type: "button",
|
|
305
|
-
onClick:
|
|
309
|
+
onClick: et,
|
|
306
310
|
"aria-label": "Hide chats",
|
|
307
311
|
"aria-expanded": !0,
|
|
308
312
|
title: "Hide chats",
|
|
309
313
|
"data-testid": "assistant-rail-toggle",
|
|
310
314
|
className: "mb-1 flex items-center gap-2 rounded-md px-2 py-2 text-xs font-medium text-text-secondary transition-colors hover:bg-bg-surface hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong cursor-pointer",
|
|
311
|
-
children: [/* @__PURE__ */
|
|
315
|
+
children: [/* @__PURE__ */ f(le, { className: "size-4 shrink-0" }), "Hide chats"]
|
|
312
316
|
}),
|
|
313
|
-
/* @__PURE__ */
|
|
317
|
+
/* @__PURE__ */ p("button", {
|
|
314
318
|
type: "button",
|
|
315
|
-
onClick: () => void
|
|
316
|
-
disabled:
|
|
319
|
+
onClick: () => void it(),
|
|
320
|
+
disabled: N,
|
|
317
321
|
"data-testid": "assistant-new-chat",
|
|
318
322
|
className: "flex items-center gap-2 rounded-md px-2 py-2 text-xs font-medium text-text-primary transition-colors hover:bg-bg-surface disabled:opacity-50 cursor-pointer",
|
|
319
|
-
children: [/* @__PURE__ */
|
|
323
|
+
children: [/* @__PURE__ */ f(fe, { className: "size-4 shrink-0" }), "New chat"]
|
|
320
324
|
}),
|
|
321
|
-
/* @__PURE__ */
|
|
325
|
+
/* @__PURE__ */ p("button", {
|
|
322
326
|
type: "button",
|
|
323
|
-
onClick:
|
|
324
|
-
"aria-expanded":
|
|
327
|
+
onClick: ot,
|
|
328
|
+
"aria-expanded": R,
|
|
325
329
|
"data-testid": "assistant-history-toggle",
|
|
326
330
|
className: "flex items-center gap-2 rounded-md px-2 py-2 text-xs font-medium text-text-primary transition-colors hover:bg-bg-surface cursor-pointer",
|
|
327
|
-
children: [/* @__PURE__ */
|
|
331
|
+
children: [/* @__PURE__ */ f(ae, { className: "size-4 shrink-0" }), "History"]
|
|
328
332
|
}),
|
|
329
|
-
|
|
333
|
+
R ? /* @__PURE__ */ f("div", {
|
|
330
334
|
"data-testid": "assistant-history-list",
|
|
331
335
|
className: "mt-1 flex-1 space-y-0.5 overflow-y-auto border-t border-border-subtle pt-2",
|
|
332
|
-
children:
|
|
336
|
+
children: Be && I.length === 0 ? /* @__PURE__ */ p("p", {
|
|
333
337
|
className: "flex items-center gap-1.5 px-2 py-1 text-[11px] text-text-muted",
|
|
334
|
-
children: [/* @__PURE__ */
|
|
335
|
-
}) :
|
|
338
|
+
children: [/* @__PURE__ */ f(u, { className: "size-3 animate-spin" }), "Loading…"]
|
|
339
|
+
}) : I.length === 0 ? /* @__PURE__ */ f("p", {
|
|
336
340
|
className: "px-2 py-1 text-[11px] leading-relaxed text-text-muted",
|
|
337
341
|
children: "No past chats yet."
|
|
338
|
-
}) :
|
|
342
|
+
}) : I.map((t) => /* @__PURE__ */ p("div", {
|
|
339
343
|
"data-testid": "assistant-history-row",
|
|
340
344
|
className: e("group flex items-center gap-1 rounded pe-1 transition-colors", t.active ? "bg-bg-surface" : "hover:bg-bg-surface"),
|
|
341
|
-
children: [/* @__PURE__ */
|
|
345
|
+
children: [/* @__PURE__ */ f("button", {
|
|
342
346
|
type: "button",
|
|
343
|
-
onClick: () => void
|
|
347
|
+
onClick: () => void st(t.id),
|
|
344
348
|
title: t.title,
|
|
345
349
|
"data-testid": "assistant-history-item",
|
|
346
350
|
className: e("min-w-0 flex-1 truncate rounded px-2 py-1.5 text-start text-[11px] leading-relaxed cursor-pointer", t.active ? "font-medium text-text-primary" : "text-text-secondary group-hover:text-text-primary"),
|
|
347
351
|
children: t.title
|
|
348
|
-
}),
|
|
352
|
+
}), C.deleteSession ? /* @__PURE__ */ f("button", {
|
|
349
353
|
type: "button",
|
|
350
|
-
onClick: () => void
|
|
351
|
-
disabled:
|
|
354
|
+
onClick: () => void at(t.id, !!t.active),
|
|
355
|
+
disabled: N,
|
|
352
356
|
"aria-label": `Delete chat: ${t.title}`,
|
|
353
357
|
title: "Delete this chat",
|
|
354
358
|
"data-testid": "assistant-delete-chat",
|
|
355
359
|
className: "inline-flex size-6 shrink-0 items-center justify-center rounded text-text-muted opacity-0 transition-opacity hover:text-status-error-bg focus-visible:opacity-100 group-hover:opacity-100 disabled:opacity-30 cursor-pointer",
|
|
356
|
-
children: /* @__PURE__ */
|
|
360
|
+
children: /* @__PURE__ */ f(he, { className: "size-3.5" })
|
|
357
361
|
}) : null]
|
|
358
362
|
}, t.id))
|
|
359
363
|
}) : null
|
|
360
364
|
]
|
|
361
|
-
}) : null, /* @__PURE__ */
|
|
365
|
+
}) : null, /* @__PURE__ */ p("div", {
|
|
362
366
|
className: "flex min-h-0 min-w-0 flex-1 flex-col",
|
|
363
367
|
children: [
|
|
364
|
-
/* @__PURE__ */
|
|
368
|
+
/* @__PURE__ */ p("div", {
|
|
365
369
|
className: "flex shrink-0 items-center justify-between gap-2 border-b border-border-subtle bg-bg-surface px-4 py-3",
|
|
366
|
-
children: [/* @__PURE__ */
|
|
370
|
+
children: [/* @__PURE__ */ p("div", {
|
|
367
371
|
className: "flex min-w-0 items-center gap-2",
|
|
368
|
-
children: [
|
|
372
|
+
children: [K && $e && !He ? /* @__PURE__ */ p("button", {
|
|
369
373
|
type: "button",
|
|
370
|
-
onClick:
|
|
374
|
+
onClick: et,
|
|
371
375
|
"aria-label": "Show chats",
|
|
372
376
|
"aria-expanded": !1,
|
|
373
377
|
title: "Show chats",
|
|
374
378
|
"data-testid": "assistant-rail-toggle",
|
|
375
379
|
className: "inline-flex shrink-0 items-center gap-1.5 rounded-md border border-border-subtle px-2 py-1.5 text-xs font-medium text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong cursor-pointer",
|
|
376
|
-
children: [/* @__PURE__ */
|
|
377
|
-
}) : /* @__PURE__ */
|
|
380
|
+
children: [/* @__PURE__ */ f(ue, { className: "size-4" }), "Chats"]
|
|
381
|
+
}) : /* @__PURE__ */ f("span", {
|
|
378
382
|
className: "inline-flex size-7 shrink-0 items-center justify-center rounded-full bg-action-primary-bg/10 text-action-primary-bg",
|
|
379
|
-
children: /* @__PURE__ */
|
|
380
|
-
}), /* @__PURE__ */
|
|
383
|
+
children: /* @__PURE__ */ f(me, { className: "size-4" })
|
|
384
|
+
}), /* @__PURE__ */ f("h2", {
|
|
381
385
|
className: "truncate text-sm font-semibold text-text-primary",
|
|
382
|
-
children:
|
|
386
|
+
children: Ie
|
|
383
387
|
})]
|
|
384
|
-
}), /* @__PURE__ */
|
|
388
|
+
}), /* @__PURE__ */ f("button", {
|
|
385
389
|
type: "button",
|
|
386
|
-
onClick:
|
|
390
|
+
onClick: J,
|
|
387
391
|
"aria-label": "Close AI assistant",
|
|
388
392
|
"data-testid": "assistant-widget-close",
|
|
389
393
|
className: "inline-flex size-8 shrink-0 items-center justify-center rounded-md text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong cursor-pointer",
|
|
390
|
-
children: /* @__PURE__ */ d
|
|
394
|
+
children: /* @__PURE__ */ f(d, { className: "size-4" })
|
|
391
395
|
})]
|
|
392
396
|
}),
|
|
393
|
-
|
|
397
|
+
b.length > 1 ? /* @__PURE__ */ f("div", {
|
|
394
398
|
role: "tablist",
|
|
395
399
|
"aria-label": "Assistant mode",
|
|
396
400
|
"data-testid": "assistant-mode-switcher",
|
|
397
401
|
className: "flex shrink-0 items-center gap-1 border-b border-border-subtle bg-bg-surface px-3 py-2",
|
|
398
|
-
children:
|
|
399
|
-
let n = t.id ===
|
|
400
|
-
return /* @__PURE__ */
|
|
402
|
+
children: b.map((t) => {
|
|
403
|
+
let n = t.id === x;
|
|
404
|
+
return /* @__PURE__ */ f("button", {
|
|
401
405
|
type: "button",
|
|
402
406
|
role: "tab",
|
|
403
407
|
"aria-selected": n,
|
|
404
408
|
tabIndex: n ? 0 : -1,
|
|
405
|
-
onClick: () =>
|
|
406
|
-
disabled:
|
|
407
|
-
title:
|
|
409
|
+
onClick: () => Fe(t.id),
|
|
410
|
+
disabled: N,
|
|
411
|
+
title: N ? "Finish the current turn before switching" : t.label,
|
|
408
412
|
"data-testid": `assistant-mode-${t.id}`,
|
|
409
413
|
className: e("rounded-md px-2.5 py-1 text-xs font-medium transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong disabled:cursor-not-allowed disabled:opacity-50 cursor-pointer", n ? "bg-action-primary-bg text-action-primary-text" : "text-text-secondary hover:bg-bg-sunken hover:text-text-primary"),
|
|
410
414
|
children: t.label
|
|
411
415
|
}, t.id);
|
|
412
416
|
})
|
|
413
417
|
}) : null,
|
|
414
|
-
/* @__PURE__ */
|
|
415
|
-
ref:
|
|
418
|
+
/* @__PURE__ */ f("div", {
|
|
419
|
+
ref: U,
|
|
416
420
|
className: "min-h-0 flex-1 space-y-3 overflow-y-auto px-4 py-4",
|
|
417
421
|
"data-testid": "assistant-widget-messages",
|
|
418
|
-
children:
|
|
422
|
+
children: D.length === 0 && ze ? /* @__PURE__ */ p("div", {
|
|
419
423
|
"data-testid": "assistant-widget-restoring",
|
|
420
424
|
className: "flex h-full flex-col items-center justify-center gap-3 text-center",
|
|
421
|
-
children: [/* @__PURE__ */
|
|
425
|
+
children: [/* @__PURE__ */ f(u, { className: "size-5 animate-spin text-text-secondary" }), /* @__PURE__ */ f("p", {
|
|
422
426
|
className: "text-xs leading-relaxed text-text-secondary",
|
|
423
427
|
children: "Restoring your conversation…"
|
|
424
428
|
})]
|
|
425
|
-
}) :
|
|
429
|
+
}) : D.length === 0 ? /* @__PURE__ */ p("div", {
|
|
426
430
|
className: "flex h-full flex-col items-center justify-center gap-3 text-center",
|
|
427
|
-
children: [/* @__PURE__ */
|
|
431
|
+
children: [/* @__PURE__ */ f("span", {
|
|
428
432
|
className: "inline-flex size-12 items-center justify-center rounded-full bg-bg-sunken text-action-primary-bg",
|
|
429
|
-
children: /* @__PURE__ */
|
|
430
|
-
}), /* @__PURE__ */
|
|
433
|
+
children: /* @__PURE__ */ f(se, { className: "size-6" })
|
|
434
|
+
}), /* @__PURE__ */ f("p", {
|
|
431
435
|
className: "max-w-[16rem] text-xs leading-relaxed text-text-secondary",
|
|
432
|
-
children:
|
|
436
|
+
children: Le
|
|
433
437
|
})]
|
|
434
|
-
}) :
|
|
438
|
+
}) : D.map((t) => /* @__PURE__ */ f("div", {
|
|
435
439
|
className: e("flex", t.role === "user" ? "justify-end" : "justify-start"),
|
|
436
|
-
children: /* @__PURE__ */
|
|
440
|
+
children: /* @__PURE__ */ p("div", {
|
|
437
441
|
"data-testid": `assistant-widget-message-${t.role}`,
|
|
438
|
-
className: e("whitespace-pre-wrap break-words rounded-lg px-3 py-2 text-xs leading-relaxed",
|
|
439
|
-
children: [t.content ? /* @__PURE__ */
|
|
442
|
+
className: e("whitespace-pre-wrap break-words rounded-lg px-3 py-2 text-xs leading-relaxed", K ? "max-w-[92%]" : "max-w-[85%]", t.role === "user" ? "bg-action-primary-bg text-action-primary-text" : t.error ? "bg-status-error-bg/10 text-status-error-bg" : "bg-bg-sunken text-text-primary"),
|
|
443
|
+
children: [t.content ? /* @__PURE__ */ f(i, {
|
|
440
444
|
content: t.content,
|
|
441
445
|
onNavigate: Ae,
|
|
442
446
|
allowBlocks: t.role === "assistant" && !t.error,
|
|
443
447
|
streaming: t.pending === !0
|
|
444
|
-
}) : null, t.pending ? /* @__PURE__ */
|
|
448
|
+
}) : null, t.pending ? /* @__PURE__ */ p("span", {
|
|
445
449
|
"data-testid": "assistant-widget-working",
|
|
446
450
|
className: e("inline-flex items-center gap-1 text-text-secondary", t.content ? "mt-1" : ""),
|
|
447
|
-
children: [/* @__PURE__ */
|
|
451
|
+
children: [/* @__PURE__ */ f(u, { className: "size-3 animate-spin" }), t.content ? null : /* @__PURE__ */ f("span", { children: "Working on it…" })]
|
|
448
452
|
}) : null]
|
|
449
453
|
})
|
|
450
454
|
}, t.id))
|
|
451
455
|
}),
|
|
452
|
-
|
|
456
|
+
C.downloadArtifact && We.length > 0 ? /* @__PURE__ */ f("div", {
|
|
453
457
|
"data-testid": "assistant-widget-artifacts",
|
|
454
458
|
className: "flex shrink-0 flex-wrap gap-1.5 border-t border-border-subtle bg-bg-sunken px-3 py-2",
|
|
455
|
-
children:
|
|
456
|
-
let t =
|
|
457
|
-
return /* @__PURE__ */
|
|
459
|
+
children: We.map((e) => {
|
|
460
|
+
let t = V === e.path;
|
|
461
|
+
return /* @__PURE__ */ p("button", {
|
|
458
462
|
type: "button",
|
|
459
|
-
onClick: () => void
|
|
460
|
-
disabled: !!
|
|
461
|
-
title: `Download ${e.name}${e.size ? ` (${
|
|
463
|
+
onClick: () => void rt(e),
|
|
464
|
+
disabled: !!V,
|
|
465
|
+
title: `Download ${e.name}${e.size ? ` (${Se(e.size)})` : ""}`,
|
|
462
466
|
"data-testid": "assistant-widget-artifact",
|
|
463
467
|
className: "inline-flex max-w-full items-center gap-1.5 rounded-md border border-border-default bg-bg-surface px-2 py-1 text-[11px] font-medium text-text-primary transition-colors hover:bg-bg-sunken focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong disabled:opacity-50 cursor-pointer",
|
|
464
|
-
children: [t ? /* @__PURE__ */
|
|
468
|
+
children: [t ? /* @__PURE__ */ f(u, { className: "size-3.5 shrink-0 animate-spin" }) : e.type === "directory" ? /* @__PURE__ */ f(ie, { className: "size-3.5 shrink-0 text-action-primary-bg" }) : /* @__PURE__ */ f(re, { className: "size-3.5 shrink-0 text-action-primary-bg" }), /* @__PURE__ */ f("span", {
|
|
465
469
|
className: "truncate",
|
|
466
470
|
children: e.name
|
|
467
471
|
})]
|
|
468
472
|
}, e.path);
|
|
469
473
|
})
|
|
470
474
|
}) : null,
|
|
471
|
-
|
|
475
|
+
y && j.length > 0 ? /* @__PURE__ */ f("div", {
|
|
472
476
|
className: "flex flex-wrap gap-1.5 border-t border-border-default bg-bg-surface px-3 pt-2",
|
|
473
|
-
children:
|
|
477
|
+
children: j.map((e, t) => /* @__PURE__ */ p("span", {
|
|
474
478
|
"data-testid": "assistant-widget-attachment",
|
|
475
479
|
className: "flex items-center gap-1 rounded-md bg-bg-sunken px-2 py-1 text-[11px] text-text-secondary",
|
|
476
480
|
children: [
|
|
477
|
-
/* @__PURE__ */
|
|
478
|
-
/* @__PURE__ */
|
|
481
|
+
/* @__PURE__ */ f(de, { className: "size-3" }),
|
|
482
|
+
/* @__PURE__ */ f("span", {
|
|
479
483
|
className: "max-w-[140px] truncate",
|
|
480
484
|
children: e.name
|
|
481
485
|
}),
|
|
482
|
-
/* @__PURE__ */
|
|
486
|
+
/* @__PURE__ */ f("button", {
|
|
483
487
|
type: "button",
|
|
484
|
-
onClick: () =>
|
|
488
|
+
onClick: () => M((e) => e.filter((e, n) => n !== t)),
|
|
485
489
|
"aria-label": `Remove ${e.name}`,
|
|
486
490
|
className: "text-text-muted hover:text-text-primary cursor-pointer",
|
|
487
|
-
children: /* @__PURE__ */ d
|
|
491
|
+
children: /* @__PURE__ */ f(d, { className: "size-3" })
|
|
488
492
|
})
|
|
489
493
|
]
|
|
490
494
|
}, `${e.name}-${t}`))
|
|
491
495
|
}) : null,
|
|
492
|
-
/* @__PURE__ */
|
|
493
|
-
className: e("flex shrink-0 items-end gap-2 bg-bg-surface px-3 py-2.5",
|
|
496
|
+
/* @__PURE__ */ p("div", {
|
|
497
|
+
className: e("flex shrink-0 items-end gap-2 bg-bg-surface px-3 py-2.5", y && j.length > 0 ? "" : "border-t border-border-default"),
|
|
494
498
|
children: [
|
|
495
|
-
|
|
496
|
-
ref:
|
|
499
|
+
y ? /* @__PURE__ */ p(ge, { children: [/* @__PURE__ */ f("input", {
|
|
500
|
+
ref: Qe,
|
|
497
501
|
type: "file",
|
|
498
|
-
accept:
|
|
502
|
+
accept: Me,
|
|
499
503
|
multiple: !0,
|
|
500
504
|
className: "hidden",
|
|
501
505
|
onChange: (e) => {
|
|
502
506
|
let t = Array.from(e.target.files ?? []);
|
|
503
|
-
t.length > 0 &&
|
|
507
|
+
t.length > 0 && M((e) => [...e, ...t]), e.target.value = "";
|
|
504
508
|
}
|
|
505
|
-
}), /* @__PURE__ */
|
|
509
|
+
}), /* @__PURE__ */ f("button", {
|
|
506
510
|
type: "button",
|
|
507
|
-
onClick: () =>
|
|
511
|
+
onClick: () => Qe.current?.click(),
|
|
508
512
|
"aria-label": "Attach a data file",
|
|
509
513
|
"data-testid": "assistant-widget-upload",
|
|
510
514
|
className: "flex size-9 shrink-0 items-center justify-center rounded-lg bg-bg-sunken text-text-secondary transition-colors hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong cursor-pointer",
|
|
511
|
-
children: /* @__PURE__ */
|
|
515
|
+
children: /* @__PURE__ */ f(de, { className: "size-4" })
|
|
512
516
|
})] }) : null,
|
|
513
|
-
|
|
517
|
+
Ne ? /* @__PURE__ */ f("button", {
|
|
514
518
|
type: "button",
|
|
515
|
-
onClick: () =>
|
|
519
|
+
onClick: () => qe(!0),
|
|
516
520
|
"aria-label": "Connect a data source",
|
|
517
521
|
title: "Connect a source (REST API / connection)",
|
|
518
522
|
"data-testid": "assistant-widget-connect-source",
|
|
519
523
|
className: "flex size-9 shrink-0 items-center justify-center rounded-lg bg-bg-sunken text-text-secondary transition-colors hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong cursor-pointer",
|
|
520
|
-
children: /* @__PURE__ */
|
|
524
|
+
children: /* @__PURE__ */ f(oe, { className: "size-4" })
|
|
521
525
|
}) : null,
|
|
522
|
-
|
|
526
|
+
q.isSupported ? /* @__PURE__ */ f("button", {
|
|
523
527
|
type: "button",
|
|
524
|
-
onClick:
|
|
525
|
-
"aria-label":
|
|
526
|
-
"aria-pressed":
|
|
528
|
+
onClick: ut,
|
|
529
|
+
"aria-label": q.isListening ? "Stop voice input" : "Start voice input",
|
|
530
|
+
"aria-pressed": q.isListening,
|
|
527
531
|
"data-testid": "assistant-widget-mic",
|
|
528
|
-
className: e("flex size-9 shrink-0 items-center justify-center rounded-lg transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong cursor-pointer",
|
|
529
|
-
children: /* @__PURE__ */
|
|
532
|
+
className: e("flex size-9 shrink-0 items-center justify-center rounded-lg transition-colors focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong cursor-pointer", q.isListening ? "animate-pulse bg-status-error-bg text-action-primary-text" : "bg-bg-sunken text-text-secondary hover:text-text-primary"),
|
|
533
|
+
children: /* @__PURE__ */ f(ce, { className: "size-4" })
|
|
530
534
|
}) : null,
|
|
531
|
-
/* @__PURE__ */
|
|
532
|
-
ref:
|
|
533
|
-
value:
|
|
534
|
-
onChange: (e) =>
|
|
535
|
-
onKeyDown:
|
|
536
|
-
onInput:
|
|
535
|
+
/* @__PURE__ */ f("textarea", {
|
|
536
|
+
ref: H,
|
|
537
|
+
value: k,
|
|
538
|
+
onChange: (e) => A(e.target.value),
|
|
539
|
+
onKeyDown: ct,
|
|
540
|
+
onInput: lt,
|
|
537
541
|
rows: 1,
|
|
538
|
-
placeholder:
|
|
542
|
+
placeholder: Re,
|
|
539
543
|
"aria-label": "Message the assistant",
|
|
540
544
|
"data-testid": "assistant-widget-input",
|
|
541
545
|
className: "flex-1 resize-none rounded-lg border border-border-default bg-bg-sunken px-3 py-2 text-xs leading-relaxed text-text-primary placeholder:text-text-muted focus:border-action-primary-bg focus:outline-none"
|
|
542
546
|
}),
|
|
543
|
-
/* @__PURE__ */
|
|
547
|
+
/* @__PURE__ */ f("button", {
|
|
544
548
|
type: "button",
|
|
545
|
-
onClick: () => void
|
|
546
|
-
disabled:
|
|
549
|
+
onClick: () => void $(),
|
|
550
|
+
disabled: N || k.trim().length === 0 && j.length === 0,
|
|
547
551
|
"aria-label": "Send message",
|
|
548
552
|
"data-testid": "assistant-widget-send",
|
|
549
553
|
className: "flex size-9 shrink-0 items-center justify-center rounded-lg bg-action-primary-bg text-action-primary-text transition-colors hover:bg-action-primary-bg-hover focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong disabled:opacity-50 cursor-pointer",
|
|
550
|
-
children:
|
|
554
|
+
children: N ? /* @__PURE__ */ f(u, { className: "size-4 animate-spin" }) : /* @__PURE__ */ f(pe, { className: "size-4" })
|
|
551
555
|
})
|
|
552
556
|
]
|
|
553
557
|
}),
|
|
554
|
-
/* @__PURE__ */
|
|
558
|
+
/* @__PURE__ */ f(n, { className: "shrink-0 bg-bg-surface px-3 pb-2 pt-1" })
|
|
555
559
|
]
|
|
556
560
|
})]
|
|
557
561
|
}) : null,
|
|
558
|
-
|
|
562
|
+
Ke ? /* @__PURE__ */ f("div", {
|
|
559
563
|
role: "dialog",
|
|
560
564
|
"aria-modal": "true",
|
|
561
565
|
"aria-label": "Connect a source",
|
|
562
566
|
"data-testid": "assistant-connect-source-modal",
|
|
563
567
|
className: "fixed inset-0 z-[110] flex items-center justify-center bg-black/50 p-4 animate-in fade-in duration-150",
|
|
564
|
-
onClick: () =>
|
|
565
|
-
children: /* @__PURE__ */
|
|
568
|
+
onClick: () => qe(!1),
|
|
569
|
+
children: /* @__PURE__ */ p("div", {
|
|
566
570
|
className: "flex h-[80vh] max-h-[720px] w-full max-w-4xl flex-col overflow-hidden rounded-xl border border-border-default bg-bg-surface shadow-2xl animate-in zoom-in-95 duration-150",
|
|
567
571
|
onClick: (e) => e.stopPropagation(),
|
|
568
|
-
children: [/* @__PURE__ */
|
|
572
|
+
children: [/* @__PURE__ */ p("div", {
|
|
569
573
|
className: "flex shrink-0 items-center justify-between border-b border-border-subtle px-4 py-3",
|
|
570
|
-
children: [/* @__PURE__ */
|
|
574
|
+
children: [/* @__PURE__ */ p("div", {
|
|
571
575
|
className: "flex items-center gap-2 text-sm font-medium text-text-primary",
|
|
572
|
-
children: [/* @__PURE__ */
|
|
573
|
-
}), /* @__PURE__ */
|
|
576
|
+
children: [/* @__PURE__ */ f(oe, { className: "size-4 shrink-0" }), "Connect a source"]
|
|
577
|
+
}), /* @__PURE__ */ f("button", {
|
|
574
578
|
type: "button",
|
|
575
|
-
onClick: () =>
|
|
579
|
+
onClick: () => qe(!1),
|
|
576
580
|
"aria-label": "Close",
|
|
577
581
|
title: "Close",
|
|
578
582
|
"data-testid": "assistant-connect-source-close",
|
|
579
583
|
className: "flex size-8 items-center justify-center rounded-lg text-text-secondary transition-colors hover:bg-bg-sunken hover:text-text-primary focus:outline-none focus-visible:ring-2 focus-visible:ring-border-strong cursor-pointer",
|
|
580
|
-
children: /* @__PURE__ */ d
|
|
584
|
+
children: /* @__PURE__ */ f(d, { className: "size-4" })
|
|
581
585
|
})]
|
|
582
|
-
}), /* @__PURE__ */
|
|
583
|
-
src:
|
|
586
|
+
}), /* @__PURE__ */ f("iframe", {
|
|
587
|
+
src: Pe,
|
|
584
588
|
title: "Connected Systems",
|
|
585
589
|
"data-testid": "assistant-connect-source-frame",
|
|
586
590
|
className: "min-h-0 w-full flex-1 border-0 bg-bg-surface"
|
|
@@ -589,4 +593,4 @@ var _ = ({ transport: t, modes: m, defaultModeId: h, title: _ = "AI Assistant",
|
|
|
589
593
|
}) : null
|
|
590
594
|
] }) : null;
|
|
591
595
|
};
|
|
592
|
-
export {
|
|
596
|
+
export { m as ASSISTANT_WIDGET_TOGGLE_EVENT, v as AssistantWidget, _e as assistantWidgetFailureText };
|