@deepagents/react-genai 7.1.4 → 7.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +266 -279
- package/dist/index.js.map +1 -1
- package/dist/lib/chat/agent-context.d.ts +2 -2
- package/dist/lib/chat/agent-context.d.ts.map +1 -1
- package/dist/lib/chat/chat-manager.d.ts +8 -13
- package/dist/lib/chat/chat-manager.d.ts.map +1 -1
- package/dist/lib/chat/chat.d.ts +2 -11
- package/dist/lib/chat/chat.d.ts.map +1 -1
- package/package.json +7 -7
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { c as e } from "react/compiler-runtime";
|
|
2
|
-
import {
|
|
3
|
-
import * as
|
|
4
|
-
import
|
|
2
|
+
import { useChat as t } from "@ai-sdk/react";
|
|
3
|
+
import * as n from "react";
|
|
4
|
+
import r, { Activity as i, Children as a, Fragment as o, createContext as s, forwardRef as c, isValidElement as l, memo as u, startTransition as d, use as f, useCallback as p, useContext as m, useEffect as h, useEffectEvent as g, useImperativeHandle as _, useMemo as v, useRef as y, useState as b, useSyncExternalStore as x } from "react";
|
|
5
5
|
import { DefaultChatTransport as S, SerialJobExecutor as C, getToolName as w, isReasoningUIPart as T, isStaticToolUIPart as E, isTextUIPart as D, isToolUIPart as O, lastAssistantMessageIsCompleteWithApprovalResponses as k, lastAssistantMessageIsCompleteWithToolCalls as ee } from "ai";
|
|
6
6
|
import { cn as A } from "cn";
|
|
7
7
|
import { AnimatePresence as j, motion as M, useAnimation as te, useReducedMotion as ne } from "motion/react";
|
|
@@ -47,12 +47,8 @@ function $t() {
|
|
|
47
47
|
}
|
|
48
48
|
//#endregion
|
|
49
49
|
//#region src/lib/chat/chat-manager.ts
|
|
50
|
-
|
|
51
|
-
return e === "streaming" || e === "submitted";
|
|
52
|
-
}
|
|
53
|
-
var tn = class {
|
|
50
|
+
var en = class {
|
|
54
51
|
chat = null;
|
|
55
|
-
prevStatus = "ready";
|
|
56
52
|
listeners = /* @__PURE__ */ new Set();
|
|
57
53
|
_queue = [];
|
|
58
54
|
_queueEnabled;
|
|
@@ -65,15 +61,12 @@ var tn = class {
|
|
|
65
61
|
bind(e) {
|
|
66
62
|
this.chat = e;
|
|
67
63
|
}
|
|
68
|
-
syncStatus(e) {
|
|
69
|
-
let t = this.prevStatus;
|
|
70
|
-
this.prevStatus = e, en(t) && e === "ready" && this.processQueue();
|
|
71
|
-
}
|
|
72
64
|
initialize(e) {
|
|
73
65
|
this.chat && e && this.consumePrefill(e);
|
|
74
66
|
}
|
|
75
67
|
submit(e) {
|
|
76
68
|
if (!this.chat) return Promise.resolve();
|
|
69
|
+
this.chat.clearError();
|
|
77
70
|
let { files: t = [], ...n } = e, r = this.chat.id;
|
|
78
71
|
return this.submissions.run(async () => {
|
|
79
72
|
if (t.length === 0) {
|
|
@@ -95,7 +88,7 @@ var tn = class {
|
|
|
95
88
|
}
|
|
96
89
|
dispatch(e) {
|
|
97
90
|
if (this.chat) {
|
|
98
|
-
if (this._queueEnabled
|
|
91
|
+
if (this._queueEnabled) {
|
|
99
92
|
this._queue = [...this._queue, {
|
|
100
93
|
id: crypto.randomUUID(),
|
|
101
94
|
...e
|
|
@@ -105,9 +98,6 @@ var tn = class {
|
|
|
105
98
|
this.directSubmit(e);
|
|
106
99
|
}
|
|
107
100
|
}
|
|
108
|
-
isChatBusy() {
|
|
109
|
-
return this.chat !== null && en(this.chat.status);
|
|
110
|
-
}
|
|
111
101
|
directSubmit(e) {
|
|
112
102
|
this.chat && (this.chat.sendMessage({
|
|
113
103
|
role: "user",
|
|
@@ -121,10 +111,10 @@ var tn = class {
|
|
|
121
111
|
} : e.metadata
|
|
122
112
|
}), this.notify());
|
|
123
113
|
}
|
|
124
|
-
processQueue() {
|
|
125
|
-
if (!this._queueEnabled ||
|
|
126
|
-
let [
|
|
127
|
-
this._queue =
|
|
114
|
+
processQueue(e) {
|
|
115
|
+
if (e !== this._queue || this.chat?.status !== "ready" || !this._queueEnabled || e.length === 0) return;
|
|
116
|
+
let [t, ...n] = e;
|
|
117
|
+
this._queue = n, this.directSubmit(t);
|
|
128
118
|
}
|
|
129
119
|
removeFromQueue(e) {
|
|
130
120
|
let t = this._queue.filter((t) => t.id !== e);
|
|
@@ -140,10 +130,10 @@ var tn = class {
|
|
|
140
130
|
return this._queueEnabled;
|
|
141
131
|
}
|
|
142
132
|
clearChat() {
|
|
143
|
-
this.chat && (this.chat.
|
|
133
|
+
this.chat && (this.chat.setMessages([]), this.clearQueue(), this.notify());
|
|
144
134
|
}
|
|
145
135
|
setChat(e) {
|
|
146
|
-
this.chat && (this.chat.
|
|
136
|
+
this.chat && (this.chat.setMessages(e), this.notify());
|
|
147
137
|
}
|
|
148
138
|
stop() {
|
|
149
139
|
this.chat && this.chat.stop();
|
|
@@ -193,7 +183,7 @@ var tn = class {
|
|
|
193
183
|
};
|
|
194
184
|
//#endregion
|
|
195
185
|
//#region src/lib/chat/client-tool-output.ts
|
|
196
|
-
async function
|
|
186
|
+
async function tn(e, t, n) {
|
|
197
187
|
let r = t?.[n.toolName];
|
|
198
188
|
n.toolName.startsWith("render") && r?.static === !1 && r.requiresUserInput !== !0 && await e.addToolOutput({
|
|
199
189
|
toolCallId: n.toolCallId,
|
|
@@ -204,35 +194,25 @@ async function nn(e, t, n) {
|
|
|
204
194
|
}
|
|
205
195
|
//#endregion
|
|
206
196
|
//#region src/lib/chat/chat.tsx
|
|
207
|
-
function
|
|
208
|
-
let
|
|
209
|
-
r.useEffect(() => {
|
|
210
|
-
i.current = e;
|
|
211
|
-
});
|
|
212
|
-
let a = r.useMemo(() => new t({
|
|
197
|
+
function nn(e) {
|
|
198
|
+
let n = t({
|
|
213
199
|
id: e.chatId,
|
|
214
200
|
messages: e.initialMessages,
|
|
215
|
-
transport:
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
})
|
|
226
|
-
return
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
helpers: n({
|
|
231
|
-
chat: a,
|
|
232
|
-
experimental_throttle: 50,
|
|
233
|
-
resume: e.resume
|
|
234
|
-
})
|
|
235
|
-
};
|
|
201
|
+
transport: e.transport,
|
|
202
|
+
throttle: 50,
|
|
203
|
+
resume: e.resume,
|
|
204
|
+
onData: e.onData,
|
|
205
|
+
onFinish: e.onFinish,
|
|
206
|
+
sendAutomaticallyWhen: rn,
|
|
207
|
+
onToolCall(t) {
|
|
208
|
+
let { toolCall: r } = t;
|
|
209
|
+
tn(n, e.registry, r);
|
|
210
|
+
}
|
|
211
|
+
});
|
|
212
|
+
return n;
|
|
213
|
+
}
|
|
214
|
+
function rn(e) {
|
|
215
|
+
return ee(e) || k(e);
|
|
236
216
|
}
|
|
237
217
|
function an(t) {
|
|
238
218
|
let n = e(2), r;
|
|
@@ -335,9 +315,9 @@ var dn = {
|
|
|
335
315
|
Hero: cn,
|
|
336
316
|
Title: ln,
|
|
337
317
|
Description: un
|
|
338
|
-
}, fn =
|
|
318
|
+
}, fn = s(void 0), pn = s("ready"), mn = s(void 0), hn = s(null), gn = s(void 0);
|
|
339
319
|
function _n({ chatId: e, children: t, skipInitialView: n, debugMode: r, registry: i, initialMessages: a, transport: o, resume: s, onData: c, onFinish: l, onResetChat: u, queueEnabled: d = !0 }) {
|
|
340
|
-
let
|
|
320
|
+
let f = nn({
|
|
341
321
|
chatId: e,
|
|
342
322
|
transport: o,
|
|
343
323
|
registry: i,
|
|
@@ -345,23 +325,29 @@ function _n({ chatId: e, children: t, skipInitialView: n, debugMode: r, registry
|
|
|
345
325
|
resume: s,
|
|
346
326
|
onData: c,
|
|
347
327
|
onFinish: l
|
|
348
|
-
}), [
|
|
349
|
-
|
|
328
|
+
}), [m, g] = b(r), _ = p(() => g((e) => !e), []), S = y(u);
|
|
329
|
+
h(() => {
|
|
350
330
|
S.current = u;
|
|
351
331
|
}, [u]);
|
|
352
|
-
let C =
|
|
332
|
+
let C = p((e) => {
|
|
353
333
|
S.current(e);
|
|
354
|
-
}, []), [w] =
|
|
334
|
+
}, []), [w] = b(() => new en({
|
|
355
335
|
queueEnabled: d,
|
|
356
336
|
uploadFile: o.uploadFile.bind(o),
|
|
357
337
|
onResetChat: C
|
|
358
338
|
}));
|
|
359
|
-
w.bind(f)
|
|
339
|
+
w.bind(f);
|
|
340
|
+
let T = x(w.subscribe, () => w.queue, () => w.queue);
|
|
341
|
+
h(() => {
|
|
360
342
|
w.initialize(e);
|
|
361
|
-
}, [w, e]),
|
|
362
|
-
w.
|
|
363
|
-
}, [
|
|
364
|
-
|
|
343
|
+
}, [w, e]), h(() => {
|
|
344
|
+
w.processQueue(T);
|
|
345
|
+
}, [
|
|
346
|
+
w,
|
|
347
|
+
f.status,
|
|
348
|
+
T
|
|
349
|
+
]);
|
|
350
|
+
let E = v(() => ({
|
|
365
351
|
clearChat: () => w.clearChat(),
|
|
366
352
|
resetChat: (e) => w.resetChat(e),
|
|
367
353
|
submit: (e) => w.submit(e),
|
|
@@ -369,33 +355,34 @@ function _n({ chatId: e, children: t, skipInitialView: n, debugMode: r, registry
|
|
|
369
355
|
getTriggeringUserMessage: (e) => w.getTriggeringUserMessage(e),
|
|
370
356
|
getLastUserMessageId: () => w.getLastUserMessageId(),
|
|
371
357
|
stop: () => w.stop()
|
|
372
|
-
}), [w]),
|
|
358
|
+
}), [w]), D = v(() => ({
|
|
373
359
|
chatId: e,
|
|
374
360
|
registry: i,
|
|
375
|
-
debugMode:
|
|
376
|
-
toggleDebugMode:
|
|
377
|
-
...
|
|
361
|
+
debugMode: m,
|
|
362
|
+
toggleDebugMode: _,
|
|
363
|
+
...E
|
|
378
364
|
}), [
|
|
379
365
|
e,
|
|
380
366
|
i,
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
]),
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
367
|
+
m,
|
|
368
|
+
_,
|
|
369
|
+
E
|
|
370
|
+
]), O = v(() => f, [
|
|
371
|
+
f.id,
|
|
372
|
+
f.messages,
|
|
373
|
+
f.status,
|
|
374
|
+
f.error
|
|
375
|
+
]), k = !!n || f.messages.length > 0, ee = v(() => ({ hasSubmitted: k }), [k]);
|
|
389
376
|
return /* @__PURE__ */ P(hn, {
|
|
390
377
|
value: w,
|
|
391
378
|
children: /* @__PURE__ */ P(fn.Provider, {
|
|
392
|
-
value:
|
|
379
|
+
value: D,
|
|
393
380
|
children: /* @__PURE__ */ P(pn.Provider, {
|
|
394
|
-
value:
|
|
381
|
+
value: f.status,
|
|
395
382
|
children: /* @__PURE__ */ P(mn.Provider, {
|
|
396
|
-
value:
|
|
383
|
+
value: O,
|
|
397
384
|
children: /* @__PURE__ */ P(gn.Provider, {
|
|
398
|
-
value:
|
|
385
|
+
value: ee,
|
|
399
386
|
children: t
|
|
400
387
|
})
|
|
401
388
|
})
|
|
@@ -404,26 +391,26 @@ function _n({ chatId: e, children: t, skipInitialView: n, debugMode: r, registry
|
|
|
404
391
|
});
|
|
405
392
|
}
|
|
406
393
|
function H() {
|
|
407
|
-
let e =
|
|
394
|
+
let e = m(fn);
|
|
408
395
|
if (e === void 0) throw Error("useAgent must be used within an AgentProvider");
|
|
409
396
|
return e;
|
|
410
397
|
}
|
|
411
398
|
function vn() {
|
|
412
|
-
let t = e(2), n =
|
|
399
|
+
let t = e(2), n = m(pn), r;
|
|
413
400
|
return t[0] === n ? r = t[1] : (r = { status: n }, t[0] = n, t[1] = r), r;
|
|
414
401
|
}
|
|
415
402
|
function U() {
|
|
416
|
-
let e =
|
|
403
|
+
let e = m(gn);
|
|
417
404
|
if (e === void 0) throw Error("useAgentMeta must be used within an AgentProvider");
|
|
418
405
|
return e;
|
|
419
406
|
}
|
|
420
407
|
function W() {
|
|
421
|
-
let e =
|
|
408
|
+
let e = m(mn);
|
|
422
409
|
if (e === void 0) throw Error("useAgentMessages must be used within an AgentProvider");
|
|
423
410
|
return e;
|
|
424
411
|
}
|
|
425
412
|
function yn() {
|
|
426
|
-
let e =
|
|
413
|
+
let e = m(hn);
|
|
427
414
|
if (!e) throw Error("useChatManager must be used within an AgentProvider");
|
|
428
415
|
return e;
|
|
429
416
|
}
|
|
@@ -581,7 +568,7 @@ function Pn(t) {
|
|
|
581
568
|
return n[0] === t ? r = n[1] : (r = Nn(t), n[0] = t, n[1] = r), r;
|
|
582
569
|
}
|
|
583
570
|
function Fn(t) {
|
|
584
|
-
let n = e(7), { status: r, resetKey: i, controlledOpen: a, onOpenChange: o } = t, s = `${i}:${r}`, [c, l] =
|
|
571
|
+
let n = e(7), { status: r, resetKey: i, controlledOpen: a, onOpenChange: o } = t, s = `${i}:${r}`, [c, l] = b(null), u = a ?? (c?.key === s ? c.open : r === "running"), d;
|
|
585
572
|
n[0] !== a || n[1] !== s || n[2] !== o ? (d = (e) => {
|
|
586
573
|
a === void 0 && l({
|
|
587
574
|
key: s,
|
|
@@ -650,9 +637,9 @@ function Bn(e) {
|
|
|
650
637
|
function Vn(e) {
|
|
651
638
|
return ["Failed", e.errorMessage ?? "unknown error"];
|
|
652
639
|
}
|
|
653
|
-
var Hn =
|
|
640
|
+
var Hn = s(null);
|
|
654
641
|
function Un(e) {
|
|
655
|
-
let t =
|
|
642
|
+
let t = m(Hn);
|
|
656
643
|
if (!t) throw Error(`<IndexProgress.${e}> must be used inside <IndexProgress.Root>`);
|
|
657
644
|
return t;
|
|
658
645
|
}
|
|
@@ -736,12 +723,12 @@ function qn(t) {
|
|
|
736
723
|
}), n[5] = i, n[6] = o, n[7] = s) : s = n[7], s;
|
|
737
724
|
}
|
|
738
725
|
function Jn(t) {
|
|
739
|
-
let n = e(11), { segment: r, index: i, isLast: a } = t,
|
|
740
|
-
n[0] === i ?
|
|
726
|
+
let n = e(11), { segment: r, index: i, isLast: a } = t, s;
|
|
727
|
+
n[0] === i ? s = n[1] : (s = i > 0 && /* @__PURE__ */ P("span", {
|
|
741
728
|
"aria-hidden": !0,
|
|
742
729
|
className: "text-muted-foreground/40 mx-1.5",
|
|
743
730
|
children: "›"
|
|
744
|
-
}), n[0] = i, n[1] =
|
|
731
|
+
}), n[0] = i, n[1] = s);
|
|
745
732
|
let c = a ? "text-foreground/90" : "text-muted-foreground/70", l = i === 0 && "lowercase", u;
|
|
746
733
|
n[2] !== c || n[3] !== l ? (u = A(c, l), n[2] = c, n[3] = l, n[4] = u) : u = n[4];
|
|
747
734
|
let d;
|
|
@@ -750,7 +737,7 @@ function Jn(t) {
|
|
|
750
737
|
children: r
|
|
751
738
|
}), n[5] = r, n[6] = u, n[7] = d) : d = n[7];
|
|
752
739
|
let f;
|
|
753
|
-
return n[8] !==
|
|
740
|
+
return n[8] !== s || n[9] !== d ? (f = /* @__PURE__ */ F(o, { children: [s, d] }), n[8] = s, n[9] = d, n[10] = f) : f = n[10], f;
|
|
754
741
|
}
|
|
755
742
|
function Yn() {
|
|
756
743
|
let t = e(1), n;
|
|
@@ -1047,18 +1034,18 @@ var pr = {
|
|
|
1047
1034
|
Content: Xn,
|
|
1048
1035
|
EventLog: $n,
|
|
1049
1036
|
PerAdapter: cr
|
|
1050
|
-
}, mr =
|
|
1037
|
+
}, mr = s(void 0), hr = s(void 0);
|
|
1051
1038
|
function K() {
|
|
1052
|
-
let e =
|
|
1039
|
+
let e = f(mr);
|
|
1053
1040
|
if (!e) throw Error("useMessagesContext must be used within <Messages>");
|
|
1054
1041
|
return e;
|
|
1055
1042
|
}
|
|
1056
1043
|
function q() {
|
|
1057
|
-
let e =
|
|
1044
|
+
let e = f(mr), { status: t } = vn();
|
|
1058
1045
|
return e?.status ?? t;
|
|
1059
1046
|
}
|
|
1060
1047
|
function J() {
|
|
1061
|
-
let e =
|
|
1048
|
+
let e = f(hr);
|
|
1062
1049
|
if (!e) throw Error("useMessageItem must be used within <Messages.Item>");
|
|
1063
1050
|
return e;
|
|
1064
1051
|
}
|
|
@@ -1080,7 +1067,7 @@ function gr(t) {
|
|
|
1080
1067
|
}
|
|
1081
1068
|
//#endregion
|
|
1082
1069
|
//#region src/lib/ui/TablePanel.tsx
|
|
1083
|
-
var _r =
|
|
1070
|
+
var _r = n.forwardRef(function(t, n) {
|
|
1084
1071
|
let r = e(9), i, a;
|
|
1085
1072
|
r[0] === t ? (i = r[1], a = r[2]) : ({className: i, ...a} = t, r[0] = t, r[1] = i, r[2] = a);
|
|
1086
1073
|
let o;
|
|
@@ -1356,7 +1343,7 @@ var Kr = [
|
|
|
1356
1343
|
...Object.values(At),
|
|
1357
1344
|
Ct,
|
|
1358
1345
|
Gr
|
|
1359
|
-
], qr =
|
|
1346
|
+
], qr = n.createContext({
|
|
1360
1347
|
actions: null,
|
|
1361
1348
|
controls: !0
|
|
1362
1349
|
});
|
|
@@ -1373,16 +1360,16 @@ function Yr(e) {
|
|
|
1373
1360
|
};
|
|
1374
1361
|
}
|
|
1375
1362
|
function Xr(t) {
|
|
1376
|
-
let
|
|
1377
|
-
|
|
1363
|
+
let r = e(21), { children: i, className: a, title: o, description: s } = t, { actions: c, controls: l } = n.useContext(qr), u;
|
|
1364
|
+
r[0] === l ? u = r[1] : (u = Jr(l, "copy"), r[0] = l, r[1] = u);
|
|
1378
1365
|
let d = u, f;
|
|
1379
|
-
|
|
1366
|
+
r[2] === l ? f = r[3] : (f = Jr(l, "download"), r[2] = l, r[3] = f);
|
|
1380
1367
|
let p = f, m = !!(o || s), h = !!(d || p || c);
|
|
1381
1368
|
if (!i) return null;
|
|
1382
1369
|
let g;
|
|
1383
|
-
|
|
1370
|
+
r[4] === a ? g = r[5] : (g = A("my-4", a), r[4] = a, r[5] = g);
|
|
1384
1371
|
let _;
|
|
1385
|
-
|
|
1372
|
+
r[6] !== c || r[7] !== s || r[8] !== h || r[9] !== m || r[10] !== d || r[11] !== p || r[12] !== o ? (_ = (m || h) && /* @__PURE__ */ F(Y.Header, {
|
|
1386
1373
|
className: A(!m && "justify-end"),
|
|
1387
1374
|
children: [m && /* @__PURE__ */ F(Y.Heading, { children: [o && /* @__PURE__ */ P(Y.Title, { children: o }), s && /* @__PURE__ */ P(Y.Description, {
|
|
1388
1375
|
className: A(o && "mt-1"),
|
|
@@ -1395,20 +1382,20 @@ function Xr(t) {
|
|
|
1395
1382
|
c
|
|
1396
1383
|
]
|
|
1397
1384
|
})]
|
|
1398
|
-
}),
|
|
1385
|
+
}), r[6] = c, r[7] = s, r[8] = h, r[9] = m, r[10] = d, r[11] = p, r[12] = o, r[13] = _) : _ = r[13];
|
|
1399
1386
|
let v;
|
|
1400
|
-
|
|
1387
|
+
r[14] === Symbol.for("react.memo_cache_sentinel") ? (v = A("overflow-hidden", "[&>[data-streamdown=table-wrapper]]:m-0 [&>[data-streamdown=table-wrapper]]:gap-0 [&>[data-streamdown=table-wrapper]]:rounded-none [&>[data-streamdown=table-wrapper]]:border-0 [&>[data-streamdown=table-wrapper]]:bg-transparent [&>[data-streamdown=table-wrapper]]:p-0", "[&>[data-streamdown=table-wrapper]>div:last-child]:rounded-none [&>[data-streamdown=table-wrapper]>div:last-child]:border-0", "[&_[data-streamdown=table]]:tabular-nums", "[&_[data-streamdown=table-header]]:bg-muted/30", "[&_[data-streamdown=table-header-cell]]:text-muted-foreground [&_[data-streamdown=table-header-cell]]:text-xs [&_[data-streamdown=table-header-cell]]:font-medium", "[&_[data-streamdown=table-cell]]:py-2", "[&_[data-streamdown=table-row]]:hover:bg-muted/30"), r[14] = v) : v = r[14];
|
|
1401
1388
|
let y;
|
|
1402
|
-
|
|
1389
|
+
r[15] === i ? y = r[16] : (y = /* @__PURE__ */ P(Y.Content, {
|
|
1403
1390
|
className: v,
|
|
1404
1391
|
children: i
|
|
1405
|
-
}),
|
|
1392
|
+
}), r[15] = i, r[16] = y);
|
|
1406
1393
|
let b;
|
|
1407
|
-
return
|
|
1394
|
+
return r[17] !== g || r[18] !== _ || r[19] !== y ? (b = /* @__PURE__ */ F(Y, {
|
|
1408
1395
|
"data-streamdown": "table-wrapper",
|
|
1409
1396
|
className: g,
|
|
1410
1397
|
children: [_, y]
|
|
1411
|
-
}),
|
|
1398
|
+
}), r[17] = g, r[18] = _, r[19] = y, r[20] = b) : b = r[20], b;
|
|
1412
1399
|
}
|
|
1413
1400
|
function Zr(t) {
|
|
1414
1401
|
let n = e(43), r, i, a, o, s, c, l, u, d, f;
|
|
@@ -1484,7 +1471,7 @@ function Zr(t) {
|
|
|
1484
1471
|
}
|
|
1485
1472
|
//#endregion
|
|
1486
1473
|
//#region src/lib/elements/Response.tsx
|
|
1487
|
-
var Qr = class extends
|
|
1474
|
+
var Qr = class extends n.Component {
|
|
1488
1475
|
state = {
|
|
1489
1476
|
hasError: !1,
|
|
1490
1477
|
error: null
|
|
@@ -1501,7 +1488,7 @@ var Qr = class extends r.Component {
|
|
|
1501
1488
|
children: ["Failed to render content: ", this.state.error?.message]
|
|
1502
1489
|
}) : this.props.children;
|
|
1503
1490
|
}
|
|
1504
|
-
}, X =
|
|
1491
|
+
}, X = u((t) => {
|
|
1505
1492
|
let n = e(8), r, i;
|
|
1506
1493
|
n[0] === t ? (r = n[1], i = n[2]) : ({className: r, ...i} = t, n[0] = t, n[1] = r, n[2] = i);
|
|
1507
1494
|
let a;
|
|
@@ -1516,10 +1503,10 @@ X.displayName = "Response";
|
|
|
1516
1503
|
//#endregion
|
|
1517
1504
|
//#region src/lib/ui/use-copy-feedback.ts
|
|
1518
1505
|
function $r(t) {
|
|
1519
|
-
let n = e(7), r = t === void 0 ? 2e3 : t, [i, a] =
|
|
1506
|
+
let n = e(7), r = t === void 0 ? 2e3 : t, [i, a] = b(!1), o = y(null), s, c;
|
|
1520
1507
|
n[0] === Symbol.for("react.memo_cache_sentinel") ? (s = () => () => {
|
|
1521
1508
|
o.current && clearTimeout(o.current);
|
|
1522
|
-
}, c = [], n[0] = s, n[1] = c) : (s = n[0], c = n[1]),
|
|
1509
|
+
}, c = [], n[0] = s, n[1] = c) : (s = n[0], c = n[1]), h(s, c);
|
|
1523
1510
|
let l;
|
|
1524
1511
|
n[2] === r ? l = n[3] : (l = async (e) => {
|
|
1525
1512
|
await navigator.clipboard.writeText(e), a(!0), o.current && clearTimeout(o.current), o.current = setTimeout(() => a(!1), r);
|
|
@@ -1529,7 +1516,7 @@ function $r(t) {
|
|
|
1529
1516
|
}
|
|
1530
1517
|
//#endregion
|
|
1531
1518
|
//#region src/lib/elements/CodeBlock.tsx
|
|
1532
|
-
var ei =
|
|
1519
|
+
var ei = s({ code: "" }), ti = (t) => {
|
|
1533
1520
|
let n = e(41), r, i, a, o, s, c, l;
|
|
1534
1521
|
n[0] === t ? (r = n[1], i = n[2], a = n[3], o = n[4], s = n[5], c = n[6], l = n[7]) : ({code: a, language: o, showLineNumbers: c, wrap: l, className: i, children: r, ...s} = t, n[0] = t, n[1] = r, n[2] = i, n[3] = a, n[4] = o, n[5] = s, n[6] = c, n[7] = l);
|
|
1535
1522
|
let u = c !== void 0 && c, d = l !== void 0 && l, f;
|
|
@@ -1614,7 +1601,7 @@ var ei = c({ code: "" }), ti = (t) => {
|
|
|
1614
1601
|
children: w
|
|
1615
1602
|
}), n[38] = w, n[39] = f, n[40] = T) : T = n[40], T;
|
|
1616
1603
|
}, ni = ({ onCopy: e, onError: t, timeout: n = 2e3, children: r, className: i, ...a }) => {
|
|
1617
|
-
let [o, s] = $r(n), { code: c } =
|
|
1604
|
+
let [o, s] = $r(n), { code: c } = m(ei), l = async () => {
|
|
1618
1605
|
if (typeof window > "u" || !navigator.clipboard.writeText) {
|
|
1619
1606
|
t?.(/* @__PURE__ */ Error("Clipboard API not available"));
|
|
1620
1607
|
return;
|
|
@@ -1764,7 +1751,7 @@ function li(e) {
|
|
|
1764
1751
|
return typeof e == "string" ? /* @__PURE__ */ P(ti, {
|
|
1765
1752
|
code: e,
|
|
1766
1753
|
language: "json"
|
|
1767
|
-
}) :
|
|
1754
|
+
}) : l(e) ? /* @__PURE__ */ P("div", { children: e }) : typeof e == "object" ? /* @__PURE__ */ P(ti, {
|
|
1768
1755
|
code: JSON.stringify(e, null, 2),
|
|
1769
1756
|
language: "json"
|
|
1770
1757
|
}) : typeof e == "number" || typeof e == "bigint" ? /* @__PURE__ */ P("div", { children: e }) : /* @__PURE__ */ P("div", {});
|
|
@@ -1853,7 +1840,7 @@ function _i({ clipboard: e, ClipboardItem: t }) {
|
|
|
1853
1840
|
}
|
|
1854
1841
|
//#endregion
|
|
1855
1842
|
//#region src/lib/copy/snapshot-context.ts
|
|
1856
|
-
var vi =
|
|
1843
|
+
var vi = s(!1);
|
|
1857
1844
|
//#endregion
|
|
1858
1845
|
//#region src/lib/copy/snapshot-render.tsx
|
|
1859
1846
|
function yi() {
|
|
@@ -1902,20 +1889,20 @@ function xi(e) {
|
|
|
1902
1889
|
return n === "rgba(0, 0, 0, 0)" ? void 0 : n;
|
|
1903
1890
|
}
|
|
1904
1891
|
function Si({ elementRef: e, excludeMode: t, fallbackText: n }) {
|
|
1905
|
-
let [r, i] =
|
|
1892
|
+
let [r, i] = b(!1), [a, o] = b(null), s = y(null), c = p(() => {
|
|
1906
1893
|
s.current !== null && (window.clearTimeout(s.current), s.current = null);
|
|
1907
|
-
}, []), l =
|
|
1894
|
+
}, []), l = p((e) => {
|
|
1908
1895
|
c(), o(e), s.current = window.setTimeout(() => {
|
|
1909
1896
|
o(null), s.current = null;
|
|
1910
1897
|
}, 3e3);
|
|
1911
1898
|
}, [c]);
|
|
1912
|
-
|
|
1899
|
+
h(() => () => {
|
|
1913
1900
|
c();
|
|
1914
1901
|
}, [c]);
|
|
1915
|
-
let u =
|
|
1902
|
+
let u = p(async () => typeof navigator > "u" || typeof navigator.clipboard?.writeText != "function" || !n || n.trim().length === 0 ? !1 : (await navigator.clipboard.writeText(n), l({
|
|
1916
1903
|
kind: "success",
|
|
1917
1904
|
mode: "text"
|
|
1918
|
-
}), !0), [n, l]), d =
|
|
1905
|
+
}), !0), [n, l]), d = p(async () => {
|
|
1919
1906
|
if (!e.current) throw Error("Nothing is ready to copy yet.");
|
|
1920
1907
|
let { toBlob: n } = await import("html-to-image"), r = await n(e.current, {
|
|
1921
1908
|
backgroundColor: xi(e.current),
|
|
@@ -1933,7 +1920,7 @@ function Si({ elementRef: e, excludeMode: t, fallbackText: n }) {
|
|
|
1933
1920
|
l
|
|
1934
1921
|
]);
|
|
1935
1922
|
return {
|
|
1936
|
-
copy:
|
|
1923
|
+
copy: p(async () => {
|
|
1937
1924
|
i(!0), o(null);
|
|
1938
1925
|
try {
|
|
1939
1926
|
let e = _i({
|
|
@@ -1975,10 +1962,10 @@ function Ci(e) {
|
|
|
1975
1962
|
return e.parts.filter(D).map((e) => e.text).join("\n");
|
|
1976
1963
|
}
|
|
1977
1964
|
function Z() {
|
|
1978
|
-
return
|
|
1965
|
+
return m(vi);
|
|
1979
1966
|
}
|
|
1980
1967
|
function wi(t) {
|
|
1981
|
-
let n = e(30), { message: r, renderContent: i, className: a } = t, o =
|
|
1968
|
+
let n = e(30), { message: r, renderContent: i, className: a } = t, o = y(null), [s, c] = b(!1), l;
|
|
1982
1969
|
n[0] === r ? l = n[1] : (l = Ci(r), n[0] = r, n[1] = l);
|
|
1983
1970
|
let u = l, d;
|
|
1984
1971
|
n[2] === u ? d = n[3] : (d = {
|
|
@@ -1997,8 +1984,8 @@ function wi(t) {
|
|
|
1997
1984
|
contentRef: o,
|
|
1998
1985
|
children: i()
|
|
1999
1986
|
}), n[7] = i, n[8] = s, n[9] = v) : v = n[9];
|
|
2000
|
-
let
|
|
2001
|
-
n[10] === a ?
|
|
1987
|
+
let x;
|
|
1988
|
+
n[10] === a ? x = n[11] : (x = A("flex items-center gap-2", a), n[10] = a, n[11] = x);
|
|
2002
1989
|
let S;
|
|
2003
1990
|
n[12] === p ? S = n[13] : (S = p?.kind === "error" && /* @__PURE__ */ P("span", {
|
|
2004
1991
|
className: "text-destructive text-xs",
|
|
@@ -2019,11 +2006,11 @@ function wi(t) {
|
|
|
2019
2006
|
icon: w
|
|
2020
2007
|
}), n[18] = m, n[19] = _, n[20] = C, n[21] = w, n[22] = T) : T = n[22];
|
|
2021
2008
|
let E;
|
|
2022
|
-
n[23] !==
|
|
2009
|
+
n[23] !== x || n[24] !== S || n[25] !== T ? (E = /* @__PURE__ */ F("div", {
|
|
2023
2010
|
"data-copy-exclude": "assistant-snapshot",
|
|
2024
|
-
className:
|
|
2011
|
+
className: x,
|
|
2025
2012
|
children: [S, T]
|
|
2026
|
-
}), n[23] =
|
|
2013
|
+
}), n[23] = x, n[24] = S, n[25] = T, n[26] = E) : E = n[26];
|
|
2027
2014
|
let D;
|
|
2028
2015
|
return n[27] !== E || n[28] !== v ? (D = /* @__PURE__ */ F(N, { children: [v, E] }), n[27] = E, n[28] = v, n[29] = D) : D = n[29], D;
|
|
2029
2016
|
}
|
|
@@ -2049,20 +2036,20 @@ function Oi(e, t) {
|
|
|
2049
2036
|
//#endregion
|
|
2050
2037
|
//#region src/lib/chat/markdown-paragraph.tsx
|
|
2051
2038
|
function ki(t) {
|
|
2052
|
-
let n = e(4), { children:
|
|
2039
|
+
let n = e(4), { children: i } = t, a = r.Children.toArray(i);
|
|
2053
2040
|
if (!a.some(ji)) {
|
|
2054
2041
|
let e;
|
|
2055
|
-
return n[0] ===
|
|
2042
|
+
return n[0] === i ? e = n[1] : (e = /* @__PURE__ */ P("p", { children: i }), n[0] = i, n[1] = e), e;
|
|
2056
2043
|
}
|
|
2057
|
-
if (a.length > 0 && a.every(Ai)) return
|
|
2044
|
+
if (a.length > 0 && a.every(Ai)) return i;
|
|
2058
2045
|
let o;
|
|
2059
|
-
return n[2] ===
|
|
2046
|
+
return n[2] === i ? o = n[3] : (o = /* @__PURE__ */ P("div", { children: i }), n[2] = i, n[3] = o), o;
|
|
2060
2047
|
}
|
|
2061
2048
|
function Ai(e) {
|
|
2062
|
-
return
|
|
2049
|
+
return r.isValidElement(e) && typeof e.type != "string";
|
|
2063
2050
|
}
|
|
2064
2051
|
function ji(e) {
|
|
2065
|
-
return
|
|
2052
|
+
return r.isValidElement(e) && typeof e.type != "string";
|
|
2066
2053
|
}
|
|
2067
2054
|
//#endregion
|
|
2068
2055
|
//#region src/lib/components/InteractiveResponse.tsx
|
|
@@ -2443,9 +2430,9 @@ function ea(t) {
|
|
|
2443
2430
|
let a;
|
|
2444
2431
|
return n[0] === i ? a = n[1] : (a = /* @__PURE__ */ P(di, { part: i }), n[0] = i, n[1] = a), a;
|
|
2445
2432
|
}
|
|
2446
|
-
var ta =
|
|
2433
|
+
var ta = s(null), na = s(null);
|
|
2447
2434
|
function ra() {
|
|
2448
|
-
let e =
|
|
2435
|
+
let e = f(ta);
|
|
2449
2436
|
if (!e) throw Error("Segment.Tool* parts must be rendered within Segment.Tool");
|
|
2450
2437
|
return e;
|
|
2451
2438
|
}
|
|
@@ -2615,7 +2602,7 @@ function da(e, t) {
|
|
|
2615
2602
|
function fa(e, t, n) {
|
|
2616
2603
|
return e.kind === "file" || e.kind === "source" ? !0 : e.kind === "tool" || e.kind === "dynamic-tool" ? O(e.part) ? e.part.state === "output-error" || e.part.state === "output-available" && e.part.preliminary !== !0 : !1 : t < n - 1;
|
|
2617
2604
|
}
|
|
2618
|
-
var pa =
|
|
2605
|
+
var pa = u(function(t) {
|
|
2619
2606
|
let n = e(8), { segment: r } = t;
|
|
2620
2607
|
if (r.kind === "tool") {
|
|
2621
2608
|
let e;
|
|
@@ -2694,15 +2681,15 @@ function _a() {
|
|
|
2694
2681
|
}
|
|
2695
2682
|
function va(t) {
|
|
2696
2683
|
let n = e(5), { className: r, children: i } = t;
|
|
2697
|
-
if (!_a() ||
|
|
2698
|
-
let
|
|
2699
|
-
n[0] === r ?
|
|
2684
|
+
if (!_a() || a.toArray(i).length === 0) return null;
|
|
2685
|
+
let o;
|
|
2686
|
+
n[0] === r ? o = n[1] : (o = A("mt-1 flex items-center gap-0.5", r), n[0] = r, n[1] = o);
|
|
2700
2687
|
let s;
|
|
2701
|
-
return n[2] !== i || n[3] !==
|
|
2688
|
+
return n[2] !== i || n[3] !== o ? (s = /* @__PURE__ */ P("div", {
|
|
2702
2689
|
"data-copy-exclude": "assistant-snapshot",
|
|
2703
|
-
className:
|
|
2690
|
+
className: o,
|
|
2704
2691
|
children: i
|
|
2705
|
-
}), n[2] = i, n[3] =
|
|
2692
|
+
}), n[2] = i, n[3] = o, n[4] = s) : s = n[4], s;
|
|
2706
2693
|
}
|
|
2707
2694
|
function ya(t) {
|
|
2708
2695
|
let n = e(12), { className: r } = t, { message: i } = J(), [a, o] = $r(), s = a ? "Copied" : "Copy message", c;
|
|
@@ -2843,7 +2830,7 @@ function Ea(t) {
|
|
|
2843
2830
|
//#region src/lib/components/PendingToolInput.tsx
|
|
2844
2831
|
function Da() {
|
|
2845
2832
|
let { registry: e } = H(), t = W().messages;
|
|
2846
|
-
return
|
|
2833
|
+
return v(() => {
|
|
2847
2834
|
if (!e) return null;
|
|
2848
2835
|
for (let n = t.length - 1; n >= 0; n--) {
|
|
2849
2836
|
let r = t[n];
|
|
@@ -2863,16 +2850,16 @@ function Da() {
|
|
|
2863
2850
|
}, [t, e]);
|
|
2864
2851
|
}
|
|
2865
2852
|
function Oa(t) {
|
|
2866
|
-
let n = e(10), { children: r, className:
|
|
2867
|
-
n[0] !== r || n[1] !== c ? (l = /* @__PURE__ */ P(
|
|
2853
|
+
let n = e(10), { children: r, className: a } = t, o = Da(), s = o?.entry.component, c = o ? "hidden" : "visible", l;
|
|
2854
|
+
n[0] !== r || n[1] !== c ? (l = /* @__PURE__ */ P(i, {
|
|
2868
2855
|
mode: c,
|
|
2869
2856
|
children: r
|
|
2870
2857
|
}), n[0] = r, n[1] = c, n[2] = l) : l = n[2];
|
|
2871
2858
|
let u;
|
|
2872
|
-
n[3] !== s || n[4] !== o || n[5] !==
|
|
2873
|
-
className: A("sticky bottom-0 mt-auto",
|
|
2859
|
+
n[3] !== s || n[4] !== o || n[5] !== a ? (u = o && s ? /* @__PURE__ */ P("div", {
|
|
2860
|
+
className: A("sticky bottom-0 mt-auto", a),
|
|
2874
2861
|
children: /* @__PURE__ */ P(s, { part: o.part }, o.part.toolCallId)
|
|
2875
|
-
}) : null, n[3] = s, n[4] = o, n[5] =
|
|
2862
|
+
}) : null, n[3] = s, n[4] = o, n[5] = a, n[6] = u) : u = n[6];
|
|
2876
2863
|
let d;
|
|
2877
2864
|
return n[7] !== l || n[8] !== u ? (d = /* @__PURE__ */ F(N, { children: [l, u] }), n[7] = l, n[8] = u, n[9] = d) : d = n[9], d;
|
|
2878
2865
|
}
|
|
@@ -3251,7 +3238,7 @@ function no(e) {
|
|
|
3251
3238
|
}) : [];
|
|
3252
3239
|
}
|
|
3253
3240
|
function ro(t) {
|
|
3254
|
-
let n = e(7), { text: r } = t, [i, a] =
|
|
3241
|
+
let n = e(7), { text: r } = t, [i, a] = b(!1), o;
|
|
3255
3242
|
n[0] === Symbol.for("react.memo_cache_sentinel") ? (o = () => a(io), n[0] = o) : o = n[0];
|
|
3256
3243
|
let s = !i && "line-clamp-3", c;
|
|
3257
3244
|
n[1] === s ? c = n[2] : (c = A("hover:text-foreground w-full cursor-pointer text-left whitespace-pre-wrap", s), n[1] = s, n[2] = c);
|
|
@@ -3268,7 +3255,7 @@ function io(e) {
|
|
|
3268
3255
|
return !e;
|
|
3269
3256
|
}
|
|
3270
3257
|
function ao(t) {
|
|
3271
|
-
let n = e(8), { reminders: r } = t, [i, a] =
|
|
3258
|
+
let n = e(8), { reminders: r } = t, [i, a] = b(!1);
|
|
3272
3259
|
if (r.length === 0) return null;
|
|
3273
3260
|
let o = `${r.length} reminder${r.length === 1 ? "" : "s"} attached`, s;
|
|
3274
3261
|
n[0] === r ? s = n[1] : (s = r.map(oo), n[0] = r, n[1] = s);
|
|
@@ -3409,7 +3396,7 @@ function uo(t) {
|
|
|
3409
3396
|
}), n[6] = o, n[7] = s, n[8] = c, n[9] = l) : l = n[9], l;
|
|
3410
3397
|
}
|
|
3411
3398
|
function fo({ message: e }) {
|
|
3412
|
-
let { message: t, reminders: n } =
|
|
3399
|
+
let { message: t, reminders: n } = v(() => ({
|
|
3413
3400
|
message: Ht(e),
|
|
3414
3401
|
reminders: to(e)
|
|
3415
3402
|
}), [e, eo(e, "reminders")]), r = eo(e, "alias"), i = typeof r == "string" && r.trim().length > 0 ? r : void 0;
|
|
@@ -3431,7 +3418,7 @@ function fo({ message: e }) {
|
|
|
3431
3418
|
})]
|
|
3432
3419
|
});
|
|
3433
3420
|
}
|
|
3434
|
-
var po =
|
|
3421
|
+
var po = u(function(t) {
|
|
3435
3422
|
let n = e(7), { className: r } = t, { message: i } = J(), a;
|
|
3436
3423
|
n[0] === r ? a = n[1] : (a = A("flex justify-end", r), n[0] = r, n[1] = a);
|
|
3437
3424
|
let o;
|
|
@@ -3675,14 +3662,14 @@ function Vo() {
|
|
|
3675
3662
|
} else o = t[5];
|
|
3676
3663
|
return o;
|
|
3677
3664
|
}
|
|
3678
|
-
var Ho =
|
|
3665
|
+
var Ho = s(null);
|
|
3679
3666
|
function Uo() {
|
|
3680
|
-
let e =
|
|
3667
|
+
let e = f(Ho);
|
|
3681
3668
|
if (!e) throw Error("CompactTrajectory group parts must be rendered within CompactTrajectory.Group");
|
|
3682
3669
|
return e;
|
|
3683
3670
|
}
|
|
3684
3671
|
function Wo(t) {
|
|
3685
|
-
let n = e(21), { group: r, children: i } = t, { registry: a } = H(), { message: o } = J(), s = q(), [c, l] =
|
|
3672
|
+
let n = e(21), { group: r, children: i } = t, { registry: a } = H(), { message: o } = J(), s = q(), [c, l] = b(!r.hasLaterText), u, d, f;
|
|
3686
3673
|
if (n[0] !== r.hasLaterText || n[1] !== r.items || n[2] !== a || n[3] !== s) {
|
|
3687
3674
|
let e;
|
|
3688
3675
|
n[7] === a ? e = n[8] : (e = (e) => {
|
|
@@ -3870,7 +3857,7 @@ var ts = {
|
|
|
3870
3857
|
List: Ta,
|
|
3871
3858
|
Item: Ea,
|
|
3872
3859
|
UserBubble: po,
|
|
3873
|
-
AssistantContent:
|
|
3860
|
+
AssistantContent: u(function(t) {
|
|
3874
3861
|
let n = e(5), { className: r } = t, i = Vo(), a;
|
|
3875
3862
|
n[0] === i ? a = n[1] : (a = i.map(ns), n[0] = i, n[1] = a);
|
|
3876
3863
|
let o;
|
|
@@ -3962,7 +3949,7 @@ function is(t) {
|
|
|
3962
3949
|
] }), n[11] = c, n[12] = l, n[13] = u, n[14] = d) : d = n[14], d;
|
|
3963
3950
|
}
|
|
3964
3951
|
function as(t) {
|
|
3965
|
-
let n = e(5), { part: r } = t, [i, a] =
|
|
3952
|
+
let n = e(5), { part: r } = t, [i, a] = b(!1), o;
|
|
3966
3953
|
n[0] === r.text ? o = n[1] : (o = /* @__PURE__ */ P(X, {
|
|
3967
3954
|
mode: "static",
|
|
3968
3955
|
children: r.text
|
|
@@ -4014,7 +4001,7 @@ function os(t) {
|
|
|
4014
4001
|
}
|
|
4015
4002
|
return null;
|
|
4016
4003
|
}
|
|
4017
|
-
var ss =
|
|
4004
|
+
var ss = u(function(t) {
|
|
4018
4005
|
let n = e(10), { className: r } = t, { message: i } = J(), a;
|
|
4019
4006
|
n[0] === r ? a = n[1] : (a = A("flex-1 space-y-3", r), n[0] = r, n[1] = a);
|
|
4020
4007
|
let o;
|
|
@@ -4141,14 +4128,14 @@ var ds = {
|
|
|
4141
4128
|
function ps(t) {
|
|
4142
4129
|
let n = e(14), r, i, a;
|
|
4143
4130
|
n[0] === t ? (r = n[1], i = n[2], a = n[3]) : ({className: r, variant: a, ...i} = t, n[0] = t, n[1] = r, n[2] = i, n[3] = a);
|
|
4144
|
-
let { frames: o, interval: s } = fs[a === void 0 ? "braille" : a], [c, l] =
|
|
4131
|
+
let { frames: o, interval: s } = fs[a === void 0 ? "braille" : a], [c, l] = b(0), u, d;
|
|
4145
4132
|
n[4] !== o.length || n[5] !== s ? (u = () => {
|
|
4146
4133
|
if (window.matchMedia("(prefers-reduced-motion: reduce)").matches) return;
|
|
4147
4134
|
let e = setInterval(() => {
|
|
4148
4135
|
l((e) => (e + 1) % o.length);
|
|
4149
4136
|
}, s);
|
|
4150
4137
|
return () => clearInterval(e);
|
|
4151
|
-
}, d = [o.length, s], n[4] = o.length, n[5] = s, n[6] = u, n[7] = d) : (u = n[6], d = n[7]),
|
|
4138
|
+
}, d = [o.length, s], n[4] = o.length, n[5] = s, n[6] = u, n[7] = d) : (u = n[6], d = n[7]), h(u, d);
|
|
4152
4139
|
let f;
|
|
4153
4140
|
n[8] === r ? f = n[9] : (f = A("inline-block", r), n[8] = r, n[9] = f);
|
|
4154
4141
|
let p = o[c], m;
|
|
@@ -4174,15 +4161,15 @@ function ms(t) {
|
|
|
4174
4161
|
}), n[8] = l, n[9] = u, n[10] = d) : d = n[10], d;
|
|
4175
4162
|
}
|
|
4176
4163
|
function hs(t) {
|
|
4177
|
-
let n = e(15), { isLast: r, label: i, state: a, aborted: o, children: s } = t, c =
|
|
4178
|
-
n[0] !==
|
|
4179
|
-
Icon:
|
|
4164
|
+
let n = e(15), { isLast: r, label: i, state: a, aborted: o, children: s } = t, c = f(na), l = i ?? c?.label, u = a ?? c?.state, d = o ?? c?.aborted ?? !1, p = l?.icon, m = !!u && !d && u !== "output-available" && u !== "output-error", h;
|
|
4165
|
+
n[0] !== p || n[1] !== d || n[2] !== l?.isError || n[3] !== u || n[4] !== r || n[5] !== m ? (h = p ? /* @__PURE__ */ P(ms, {
|
|
4166
|
+
Icon: p,
|
|
4180
4167
|
isLast: r,
|
|
4181
4168
|
isLoading: m,
|
|
4182
4169
|
aborted: d,
|
|
4183
4170
|
state: u,
|
|
4184
4171
|
isError: l?.isError ?? !1
|
|
4185
|
-
}) : /* @__PURE__ */ P(Aa, { isLast: r }), n[0] =
|
|
4172
|
+
}) : /* @__PURE__ */ P(Aa, { isLast: r }), n[0] = p, n[1] = d, n[2] = l?.isError, n[3] = u, n[4] = r, n[5] = m, n[6] = h) : h = n[6];
|
|
4186
4173
|
let g = h, _ = r ? "" : "pb-3.5", v;
|
|
4187
4174
|
n[7] === _ ? v = n[8] : (v = A("min-w-0 flex-1", _), n[7] = _, n[8] = v);
|
|
4188
4175
|
let y;
|
|
@@ -4223,7 +4210,7 @@ var _s = {
|
|
|
4223
4210
|
List: Ta,
|
|
4224
4211
|
Item: Ea,
|
|
4225
4212
|
UserBubble: po,
|
|
4226
|
-
AssistantContent:
|
|
4213
|
+
AssistantContent: u(function(t) {
|
|
4227
4214
|
let n = e(12), { className: r } = t, { message: i } = J(), { elements: a } = K(), { debugMode: o } = H(), s = Hi(), c = Z(), l;
|
|
4228
4215
|
n[0] === i.parts ? l = n[1] : (l = ua(i.parts), n[0] = i.parts, n[1] = l);
|
|
4229
4216
|
let u = l, d;
|
|
@@ -4490,14 +4477,14 @@ var Ps = {
|
|
|
4490
4477
|
],
|
|
4491
4478
|
transition: { duration: .4 }
|
|
4492
4479
|
}
|
|
4493
|
-
}, Ls =
|
|
4480
|
+
}, Ls = c((t, n) => {
|
|
4494
4481
|
let r = e(29), i, a, o, s, c;
|
|
4495
4482
|
r[0] === t ? (i = r[1], a = r[2], o = r[3], s = r[4], c = r[5]) : ({onMouseEnter: a, onMouseLeave: o, className: i, size: c, ...s} = t, r[0] = t, r[1] = i, r[2] = a, r[3] = o, r[4] = s, r[5] = c);
|
|
4496
|
-
let l = c === void 0 ? 20 : c, u = te(), d =
|
|
4483
|
+
let l = c === void 0 ? 20 : c, u = te(), d = y(!1), f;
|
|
4497
4484
|
r[6] === u ? f = r[7] : (f = () => (d.current = !0, {
|
|
4498
4485
|
startAnimation: () => u.start("animate"),
|
|
4499
4486
|
stopAnimation: () => u.start("normal")
|
|
4500
|
-
}), r[6] = u, r[7] = f),
|
|
4487
|
+
}), r[6] = u, r[7] = f), _(n, f);
|
|
4501
4488
|
let p;
|
|
4502
4489
|
r[8] !== u || r[9] !== a ? (p = (e) => {
|
|
4503
4490
|
d.current ? a?.(e) : u.start("animate");
|
|
@@ -4506,10 +4493,10 @@ var Ps = {
|
|
|
4506
4493
|
r[11] !== u || r[12] !== o ? (h = (e) => {
|
|
4507
4494
|
d.current ? o?.(e) : u.start("normal");
|
|
4508
4495
|
}, r[11] = u, r[12] = o, r[13] = h) : h = r[13];
|
|
4509
|
-
let g = h,
|
|
4510
|
-
r[14] === i ?
|
|
4511
|
-
let
|
|
4512
|
-
r[16] === u ? (
|
|
4496
|
+
let g = h, v;
|
|
4497
|
+
r[14] === i ? v = r[15] : (v = A(i), r[14] = i, r[15] = v);
|
|
4498
|
+
let b, x;
|
|
4499
|
+
r[16] === u ? (b = r[17], x = r[18]) : (b = /* @__PURE__ */ P(M.path, {
|
|
4513
4500
|
animate: u,
|
|
4514
4501
|
d: "m5 12 7-7 7 7",
|
|
4515
4502
|
variants: Fs
|
|
@@ -4517,9 +4504,9 @@ var Ps = {
|
|
|
4517
4504
|
animate: u,
|
|
4518
4505
|
d: "M12 19V5",
|
|
4519
4506
|
variants: Is
|
|
4520
|
-
}), r[16] = u, r[17] =
|
|
4507
|
+
}), r[16] = u, r[17] = b, r[18] = x);
|
|
4521
4508
|
let S;
|
|
4522
|
-
r[19] !== l || r[20] !==
|
|
4509
|
+
r[19] !== l || r[20] !== b || r[21] !== x ? (S = /* @__PURE__ */ F("svg", {
|
|
4523
4510
|
fill: "none",
|
|
4524
4511
|
height: l,
|
|
4525
4512
|
stroke: "currentColor",
|
|
@@ -4529,16 +4516,16 @@ var Ps = {
|
|
|
4529
4516
|
viewBox: "0 0 24 24",
|
|
4530
4517
|
width: l,
|
|
4531
4518
|
xmlns: "http://www.w3.org/2000/svg",
|
|
4532
|
-
children: [
|
|
4533
|
-
}), r[19] = l, r[20] =
|
|
4519
|
+
children: [b, x]
|
|
4520
|
+
}), r[19] = l, r[20] = b, r[21] = x, r[22] = S) : S = r[22];
|
|
4534
4521
|
let C;
|
|
4535
|
-
return r[23] !== m || r[24] !== g || r[25] !== s || r[26] !==
|
|
4536
|
-
className:
|
|
4522
|
+
return r[23] !== m || r[24] !== g || r[25] !== s || r[26] !== v || r[27] !== S ? (C = /* @__PURE__ */ P("div", {
|
|
4523
|
+
className: v,
|
|
4537
4524
|
onMouseEnter: m,
|
|
4538
4525
|
onMouseLeave: g,
|
|
4539
4526
|
...s,
|
|
4540
4527
|
children: S
|
|
4541
|
-
}), r[23] = m, r[24] = g, r[25] = s, r[26] =
|
|
4528
|
+
}), r[23] = m, r[24] = g, r[25] = s, r[26] = v, r[27] = S, r[28] = C) : C = r[28], C;
|
|
4542
4529
|
});
|
|
4543
4530
|
Ls.displayName = "ArrowUpIcon";
|
|
4544
4531
|
//#endregion
|
|
@@ -4730,9 +4717,9 @@ function Gs(e) {
|
|
|
4730
4717
|
}
|
|
4731
4718
|
//#endregion
|
|
4732
4719
|
//#region src/lib/components/Tip/TipProvider.tsx
|
|
4733
|
-
var Ks =
|
|
4720
|
+
var Ks = s("");
|
|
4734
4721
|
function qs() {
|
|
4735
|
-
return
|
|
4722
|
+
return f(Ks);
|
|
4736
4723
|
}
|
|
4737
4724
|
var Js = "tips:history", Ys = "tips:session";
|
|
4738
4725
|
function Xs() {
|
|
@@ -4777,7 +4764,7 @@ async function ec(e, t, n) {
|
|
|
4777
4764
|
function tc(t) {
|
|
4778
4765
|
let n = e(17), { tips: r, streaming: i, chatId: a, context: o, children: s } = t, c;
|
|
4779
4766
|
n[0] === a ? c = n[1] : (c = () => Qs(a), n[0] = a, n[1] = c);
|
|
4780
|
-
let [l] =
|
|
4767
|
+
let [l] = b(c), [u, d] = b(""), f = y(!1), p = y(!1), m;
|
|
4781
4768
|
n[2] !== o || n[3] !== l || n[4] !== r ? (m = () => {
|
|
4782
4769
|
p.current || (p.current = !0, ec(r, o, l).then((e) => {
|
|
4783
4770
|
e && (d(e.text), Zs(e.id, l));
|
|
@@ -4785,19 +4772,19 @@ function tc(t) {
|
|
|
4785
4772
|
p.current = !1;
|
|
4786
4773
|
}));
|
|
4787
4774
|
}, n[2] = o, n[3] = l, n[4] = r, n[5] = m) : m = n[5];
|
|
4788
|
-
let
|
|
4789
|
-
n[6] ===
|
|
4790
|
-
|
|
4791
|
-
}, n[6] =
|
|
4792
|
-
let
|
|
4793
|
-
n[8] === Symbol.for("react.memo_cache_sentinel") ? (
|
|
4775
|
+
let _ = g(m), v;
|
|
4776
|
+
n[6] === _ ? v = n[7] : (v = () => {
|
|
4777
|
+
_();
|
|
4778
|
+
}, n[6] = _, n[7] = v);
|
|
4779
|
+
let x;
|
|
4780
|
+
n[8] === Symbol.for("react.memo_cache_sentinel") ? (x = [], n[8] = x) : x = n[8], h(v, x);
|
|
4794
4781
|
let S;
|
|
4795
|
-
n[9] !==
|
|
4782
|
+
n[9] !== _ || n[10] !== i ? (S = () => {
|
|
4796
4783
|
let e = i && !f.current;
|
|
4797
|
-
f.current = i, e &&
|
|
4798
|
-
}, n[9] =
|
|
4784
|
+
f.current = i, e && _();
|
|
4785
|
+
}, n[9] = _, n[10] = i, n[11] = S) : S = n[11];
|
|
4799
4786
|
let C;
|
|
4800
|
-
n[12] === i ? C = n[13] : (C = [i], n[12] = i, n[13] = C),
|
|
4787
|
+
n[12] === i ? C = n[13] : (C = [i], n[12] = i, n[13] = C), h(S, C);
|
|
4801
4788
|
let w;
|
|
4802
4789
|
return n[14] !== s || n[15] !== u ? (w = /* @__PURE__ */ P(Ks, {
|
|
4803
4790
|
value: u,
|
|
@@ -4818,14 +4805,14 @@ function nc(t) {
|
|
|
4818
4805
|
//#region src/lib/components/Tip/TipLine.tsx
|
|
4819
4806
|
var rc = 1.5;
|
|
4820
4807
|
function ic(t) {
|
|
4821
|
-
let n = e(12), { className: r } = t, i = qs(), [a, o] =
|
|
4808
|
+
let n = e(12), { className: r } = t, i = qs(), [a, o] = b(i), [s, c] = b(!1);
|
|
4822
4809
|
i !== a && (o(i), i && c(!0));
|
|
4823
4810
|
let l, u;
|
|
4824
4811
|
n[0] === s ? (l = n[1], u = n[2]) : (l = () => {
|
|
4825
4812
|
if (!s) return;
|
|
4826
4813
|
let e = setTimeout(() => c(!1), rc * 1e3);
|
|
4827
4814
|
return () => clearTimeout(e);
|
|
4828
|
-
}, u = [s], n[0] = s, n[1] = l, n[2] = u),
|
|
4815
|
+
}, u = [s], n[0] = s, n[1] = l, n[2] = u), h(l, u);
|
|
4829
4816
|
let d;
|
|
4830
4817
|
n[3] === r ? d = n[4] : (d = A("flex items-center justify-center gap-1.5 px-3 text-xs", r), n[3] = r, n[4] = d);
|
|
4831
4818
|
let f;
|
|
@@ -4845,7 +4832,7 @@ function ic(t) {
|
|
|
4845
4832
|
}
|
|
4846
4833
|
//#endregion
|
|
4847
4834
|
//#region src/lib/dynamic-ui/error-boundary.tsx
|
|
4848
|
-
var ac = class extends
|
|
4835
|
+
var ac = class extends n.Component {
|
|
4849
4836
|
constructor(e) {
|
|
4850
4837
|
super(e), this.state = {
|
|
4851
4838
|
hasError: !1,
|
|
@@ -4928,15 +4915,15 @@ function oc(t) {
|
|
|
4928
4915
|
//#endregion
|
|
4929
4916
|
//#region src/lib/dynamic-ui/safe-scope.ts
|
|
4930
4917
|
var sc = {
|
|
4931
|
-
useState:
|
|
4932
|
-
useEffect:
|
|
4933
|
-
useMemo:
|
|
4934
|
-
useCallback:
|
|
4935
|
-
useReducer:
|
|
4936
|
-
useId:
|
|
4918
|
+
useState: n.useState,
|
|
4919
|
+
useEffect: n.useEffect,
|
|
4920
|
+
useMemo: n.useMemo,
|
|
4921
|
+
useCallback: n.useCallback,
|
|
4922
|
+
useReducer: n.useReducer,
|
|
4923
|
+
useId: n.useId
|
|
4937
4924
|
}, cc = {
|
|
4938
|
-
Fragment:
|
|
4939
|
-
createElement:
|
|
4925
|
+
Fragment: n.Fragment,
|
|
4926
|
+
createElement: n.createElement
|
|
4940
4927
|
};
|
|
4941
4928
|
function lc() {
|
|
4942
4929
|
return {
|
|
@@ -5065,17 +5052,17 @@ function _c(t) {
|
|
|
5065
5052
|
}
|
|
5066
5053
|
//#endregion
|
|
5067
5054
|
//#region src/lib/elements/PromptInput.tsx
|
|
5068
|
-
var vc =
|
|
5069
|
-
let e =
|
|
5055
|
+
var vc = s(null), yc = s(null), bc = () => {
|
|
5056
|
+
let e = m(vc);
|
|
5070
5057
|
if (!e) throw Error("Wrap your component inside <PromptInputProvider> to use usePromptInputController().");
|
|
5071
5058
|
return e;
|
|
5072
|
-
}, xc = () =>
|
|
5073
|
-
let e =
|
|
5059
|
+
}, xc = () => m(vc), Sc = () => {
|
|
5060
|
+
let e = m(yc);
|
|
5074
5061
|
if (!e) throw Error("Wrap your component inside <PromptInputProvider> to use useProviderAttachments().");
|
|
5075
5062
|
return e;
|
|
5076
|
-
}, Cc = () =>
|
|
5063
|
+
}, Cc = () => m(yc);
|
|
5077
5064
|
function wc({ initialInput: e = "", children: t }) {
|
|
5078
|
-
let [n, r] =
|
|
5065
|
+
let [n, r] = b(e), i = p(() => r(""), []), [a, o] = b([]), s = y(null), c = y(() => {}), l = p((e) => {
|
|
5079
5066
|
let t = Array.from(e);
|
|
5080
5067
|
t.length !== 0 && o((e) => e.concat(t.map((e) => ({
|
|
5081
5068
|
id: Yt(),
|
|
@@ -5084,61 +5071,61 @@ function wc({ initialInput: e = "", children: t }) {
|
|
|
5084
5071
|
mediaType: e.type,
|
|
5085
5072
|
filename: e.name
|
|
5086
5073
|
}))));
|
|
5087
|
-
}, []), u =
|
|
5074
|
+
}, []), u = p((e) => {
|
|
5088
5075
|
o((t) => {
|
|
5089
5076
|
let n = t.find((t) => t.id === e);
|
|
5090
5077
|
return n?.url && URL.revokeObjectURL(n.url), t.filter((t) => t.id !== e);
|
|
5091
5078
|
});
|
|
5092
|
-
}, []), d =
|
|
5079
|
+
}, []), d = p(() => {
|
|
5093
5080
|
o((e) => {
|
|
5094
5081
|
for (let t of e) t.url && URL.revokeObjectURL(t.url);
|
|
5095
5082
|
return [];
|
|
5096
5083
|
});
|
|
5097
|
-
}, []), f =
|
|
5098
|
-
f.current = a,
|
|
5084
|
+
}, []), f = y(a);
|
|
5085
|
+
f.current = a, h(() => () => {
|
|
5099
5086
|
for (let e of f.current) e.url && URL.revokeObjectURL(e.url);
|
|
5100
5087
|
}, []);
|
|
5101
|
-
let
|
|
5088
|
+
let m = p(() => {
|
|
5102
5089
|
c.current?.();
|
|
5103
|
-
}, []),
|
|
5090
|
+
}, []), g = v(() => ({
|
|
5104
5091
|
files: a,
|
|
5105
5092
|
add: l,
|
|
5106
5093
|
remove: u,
|
|
5107
5094
|
clear: d,
|
|
5108
|
-
openFileDialog:
|
|
5095
|
+
openFileDialog: m,
|
|
5109
5096
|
fileInputRef: s
|
|
5110
5097
|
}), [
|
|
5111
5098
|
a,
|
|
5112
5099
|
l,
|
|
5113
5100
|
u,
|
|
5114
5101
|
d,
|
|
5115
|
-
|
|
5116
|
-
]), _ =
|
|
5102
|
+
m
|
|
5103
|
+
]), _ = p((e, t) => {
|
|
5117
5104
|
s.current = e.current, c.current = t;
|
|
5118
|
-
}, []),
|
|
5105
|
+
}, []), x = v(() => ({
|
|
5119
5106
|
textInput: {
|
|
5120
5107
|
value: n,
|
|
5121
5108
|
setInput: r,
|
|
5122
5109
|
clear: i
|
|
5123
5110
|
},
|
|
5124
|
-
attachments:
|
|
5111
|
+
attachments: g,
|
|
5125
5112
|
__registerFileInput: _
|
|
5126
5113
|
}), [
|
|
5127
5114
|
n,
|
|
5128
5115
|
i,
|
|
5129
|
-
|
|
5116
|
+
g,
|
|
5130
5117
|
_
|
|
5131
5118
|
]);
|
|
5132
5119
|
return /* @__PURE__ */ P(vc.Provider, {
|
|
5133
|
-
value:
|
|
5120
|
+
value: x,
|
|
5134
5121
|
children: /* @__PURE__ */ P(yc.Provider, {
|
|
5135
|
-
value:
|
|
5122
|
+
value: g,
|
|
5136
5123
|
children: t
|
|
5137
5124
|
})
|
|
5138
5125
|
});
|
|
5139
5126
|
}
|
|
5140
|
-
var Tc =
|
|
5141
|
-
let e = Cc(), t =
|
|
5127
|
+
var Tc = s(null), Ec = () => {
|
|
5128
|
+
let e = Cc(), t = m(Tc), n = e ?? t;
|
|
5142
5129
|
if (!n) throw Error("usePromptInputAttachments must be used within a PromptInput or PromptInputProvider");
|
|
5143
5130
|
return n;
|
|
5144
5131
|
};
|
|
@@ -5244,14 +5231,14 @@ function Dc(t) {
|
|
|
5244
5231
|
function Oc(t) {
|
|
5245
5232
|
let n = e(15), r, i, a;
|
|
5246
5233
|
n[0] === t ? (r = n[1], i = n[2], a = n[3]) : ({children: r, className: i, ...a} = t, n[0] = t, n[1] = r, n[2] = i, n[3] = a);
|
|
5247
|
-
let
|
|
5248
|
-
if (!
|
|
5234
|
+
let s = Ec();
|
|
5235
|
+
if (!s.files.length) return null;
|
|
5249
5236
|
let c;
|
|
5250
5237
|
n[4] === i ? c = n[5] : (c = A("flex w-full flex-wrap items-center gap-2 p-3", i), n[4] = i, n[5] = c);
|
|
5251
5238
|
let l;
|
|
5252
|
-
if (n[6] !==
|
|
5239
|
+
if (n[6] !== s.files || n[7] !== r) {
|
|
5253
5240
|
let e;
|
|
5254
|
-
n[9] === r ? e = n[10] : (e = (e) => /* @__PURE__ */ P(
|
|
5241
|
+
n[9] === r ? e = n[10] : (e = (e) => /* @__PURE__ */ P(o, { children: r(e) }, e.id), n[9] = r, n[10] = e), l = s.files.map(e), n[6] = s.files, n[7] = r, n[8] = l;
|
|
5255
5242
|
} else l = n[8];
|
|
5256
5243
|
let u;
|
|
5257
5244
|
return n[11] !== a || n[12] !== c || n[13] !== l ? (u = /* @__PURE__ */ P("div", {
|
|
@@ -5278,17 +5265,17 @@ var kc = (t) => {
|
|
|
5278
5265
|
]
|
|
5279
5266
|
}), n[6] = a, n[7] = r, n[8] = s, n[9] = l) : l = n[9], l;
|
|
5280
5267
|
}, Ac = ({ className: e, accept: t, multiple: n, globalDrop: r, syncHiddenInput: i, maxFiles: a, maxFileSize: o, onError: s, onSubmit: c, children: l, ...u }) => {
|
|
5281
|
-
let d = xc(), f = !!d,
|
|
5268
|
+
let d = xc(), f = !!d, m = y(null), g = y(null), [_, x] = b([]), S = f ? d.attachments.files : _, C = y(S);
|
|
5282
5269
|
C.current = S;
|
|
5283
|
-
let w =
|
|
5284
|
-
|
|
5285
|
-
}, []), T =
|
|
5270
|
+
let w = p(() => {
|
|
5271
|
+
m.current?.click();
|
|
5272
|
+
}, []), T = p((e) => !t || t.trim() === "" || t.split(",").map((e) => e.trim()).filter(Boolean).some((t) => {
|
|
5286
5273
|
if (t.endsWith("/*")) {
|
|
5287
5274
|
let n = t.slice(0, -1);
|
|
5288
5275
|
return e.type.startsWith(n);
|
|
5289
5276
|
}
|
|
5290
5277
|
return e.type === t;
|
|
5291
|
-
}), [t]), E =
|
|
5278
|
+
}), [t]), E = p((e) => {
|
|
5292
5279
|
let t = Array.from(e), n = t.filter((e) => T(e));
|
|
5293
5280
|
if (t.length && n.length === 0) {
|
|
5294
5281
|
s?.({
|
|
@@ -5305,7 +5292,7 @@ var kc = (t) => {
|
|
|
5305
5292
|
});
|
|
5306
5293
|
return;
|
|
5307
5294
|
}
|
|
5308
|
-
|
|
5295
|
+
x((e) => {
|
|
5309
5296
|
let t = typeof a == "number" ? Math.max(0, a - e.length) : void 0, n = typeof t == "number" ? r.slice(0, t) : r;
|
|
5310
5297
|
typeof t == "number" && r.length > t && s?.({
|
|
5311
5298
|
code: "max_files",
|
|
@@ -5326,19 +5313,19 @@ var kc = (t) => {
|
|
|
5326
5313
|
a,
|
|
5327
5314
|
o,
|
|
5328
5315
|
s
|
|
5329
|
-
]), D =
|
|
5316
|
+
]), D = p((e) => x((t) => {
|
|
5330
5317
|
let n = t.find((t) => t.id === e);
|
|
5331
5318
|
return n?.url && URL.revokeObjectURL(n.url), t.filter((t) => t.id !== e);
|
|
5332
|
-
}), []), O =
|
|
5319
|
+
}), []), O = p(() => x((e) => {
|
|
5333
5320
|
for (let t of e) t.url && URL.revokeObjectURL(t.url);
|
|
5334
5321
|
return [];
|
|
5335
5322
|
}), []), k = f ? d.attachments.add : E, ee = f ? d.attachments.remove : D, j = f ? d.attachments.clear : O, M = f ? d.attachments.openFileDialog : w;
|
|
5336
|
-
|
|
5337
|
-
f && d.__registerFileInput(
|
|
5338
|
-
}, [f, d]),
|
|
5339
|
-
i &&
|
|
5340
|
-
}, [S, i]),
|
|
5341
|
-
let e =
|
|
5323
|
+
h(() => {
|
|
5324
|
+
f && d.__registerFileInput(m, () => m.current?.click());
|
|
5325
|
+
}, [f, d]), h(() => {
|
|
5326
|
+
i && m.current && S.length === 0 && (m.current.value = "");
|
|
5327
|
+
}, [S, i]), h(() => {
|
|
5328
|
+
let e = g.current;
|
|
5342
5329
|
if (!e || r) return;
|
|
5343
5330
|
let t = (e) => {
|
|
5344
5331
|
e.dataTransfer?.types?.includes("Files") && e.preventDefault();
|
|
@@ -5348,7 +5335,7 @@ var kc = (t) => {
|
|
|
5348
5335
|
return e.addEventListener("dragover", t), e.addEventListener("drop", n), () => {
|
|
5349
5336
|
e.removeEventListener("dragover", t), e.removeEventListener("drop", n);
|
|
5350
5337
|
};
|
|
5351
|
-
}, [k, r]),
|
|
5338
|
+
}, [k, r]), h(() => {
|
|
5352
5339
|
if (!r) return;
|
|
5353
5340
|
let e = (e) => {
|
|
5354
5341
|
e.dataTransfer?.types?.includes("Files") && e.preventDefault();
|
|
@@ -5358,7 +5345,7 @@ var kc = (t) => {
|
|
|
5358
5345
|
return document.addEventListener("dragover", e), document.addEventListener("drop", t), () => {
|
|
5359
5346
|
document.removeEventListener("dragover", e), document.removeEventListener("drop", t);
|
|
5360
5347
|
};
|
|
5361
|
-
}, [k, r]),
|
|
5348
|
+
}, [k, r]), h(() => () => {
|
|
5362
5349
|
if (!f) for (let e of C.current) e.url && URL.revokeObjectURL(e.url);
|
|
5363
5350
|
}, [f]);
|
|
5364
5351
|
let te = (e) => {
|
|
@@ -5373,7 +5360,7 @@ var kc = (t) => {
|
|
|
5373
5360
|
} catch {
|
|
5374
5361
|
return null;
|
|
5375
5362
|
}
|
|
5376
|
-
}, re =
|
|
5363
|
+
}, re = v(() => ({
|
|
5377
5364
|
files: S.map((e) => ({
|
|
5378
5365
|
...e,
|
|
5379
5366
|
id: e.id
|
|
@@ -5382,7 +5369,7 @@ var kc = (t) => {
|
|
|
5382
5369
|
remove: ee,
|
|
5383
5370
|
clear: j,
|
|
5384
5371
|
openFileDialog: M,
|
|
5385
|
-
fileInputRef:
|
|
5372
|
+
fileInputRef: m
|
|
5386
5373
|
}), [
|
|
5387
5374
|
S,
|
|
5388
5375
|
k,
|
|
@@ -5395,7 +5382,7 @@ var kc = (t) => {
|
|
|
5395
5382
|
className: "hidden",
|
|
5396
5383
|
multiple: n,
|
|
5397
5384
|
onChange: te,
|
|
5398
|
-
ref:
|
|
5385
|
+
ref: m,
|
|
5399
5386
|
title: "Upload files",
|
|
5400
5387
|
type: "file"
|
|
5401
5388
|
}), /* @__PURE__ */ P("form", {
|
|
@@ -5427,7 +5414,7 @@ var kc = (t) => {
|
|
|
5427
5414
|
} catch {}
|
|
5428
5415
|
}).catch(() => {});
|
|
5429
5416
|
},
|
|
5430
|
-
ref:
|
|
5417
|
+
ref: g,
|
|
5431
5418
|
...u,
|
|
5432
5419
|
children: /* @__PURE__ */ P(Ie, {
|
|
5433
5420
|
className: "overflow-hidden",
|
|
@@ -5451,7 +5438,7 @@ var kc = (t) => {
|
|
|
5451
5438
|
}, Mc = (t) => {
|
|
5452
5439
|
let n = e(24), r, i, a, o;
|
|
5453
5440
|
n[0] === t ? (r = n[1], i = n[2], a = n[3], o = n[4]) : ({onChange: i, className: r, placeholder: o, ...a} = t, n[0] = t, n[1] = r, n[2] = i, n[3] = a, n[4] = o);
|
|
5454
|
-
let s = o === void 0 ? "What would you like to know?" : o, c = xc(), l = Ec(), [u, d] =
|
|
5441
|
+
let s = o === void 0 ? "What would you like to know?" : o, c = xc(), l = Ec(), [u, d] = b(!1), f;
|
|
5455
5442
|
n[5] !== l || n[6] !== u ? (f = (e) => {
|
|
5456
5443
|
if (e.key === "Enter") {
|
|
5457
5444
|
if (u || e.nativeEvent.isComposing || e.shiftKey) return;
|
|
@@ -5486,14 +5473,14 @@ var kc = (t) => {
|
|
|
5486
5473
|
} : { onChange: i }, n[10] = c, n[11] = i, n[12] = g) : g = n[12];
|
|
5487
5474
|
let _ = g, v;
|
|
5488
5475
|
n[13] === r ? v = n[14] : (v = A("field-sizing-content max-h-48 min-h-16", r), n[13] = r, n[14] = v);
|
|
5489
|
-
let y,
|
|
5490
|
-
n[15] === Symbol.for("react.memo_cache_sentinel") ? (y = () => d(!1),
|
|
5476
|
+
let y, x;
|
|
5477
|
+
n[15] === Symbol.for("react.memo_cache_sentinel") ? (y = () => d(!1), x = () => d(!0), n[15] = y, n[16] = x) : (y = n[15], x = n[16]);
|
|
5491
5478
|
let S;
|
|
5492
5479
|
return n[17] !== _ || n[18] !== p || n[19] !== h || n[20] !== s || n[21] !== a || n[22] !== v ? (S = /* @__PURE__ */ P(ze, {
|
|
5493
5480
|
className: v,
|
|
5494
5481
|
name: "message",
|
|
5495
5482
|
onCompositionEnd: y,
|
|
5496
|
-
onCompositionStart:
|
|
5483
|
+
onCompositionStart: x,
|
|
5497
5484
|
onKeyDown: p,
|
|
5498
5485
|
onPaste: h,
|
|
5499
5486
|
placeholder: s,
|
|
@@ -5533,12 +5520,12 @@ var kc = (t) => {
|
|
|
5533
5520
|
...i
|
|
5534
5521
|
}), n[5] = i, n[6] = a, n[7] = o) : o = n[7], o;
|
|
5535
5522
|
}, Ic = (t) => {
|
|
5536
|
-
let n = e(12), r, i,
|
|
5523
|
+
let n = e(12), r, i, o, s;
|
|
5537
5524
|
if (n[0] !== t) {
|
|
5538
5525
|
let { variant: e, className: c, size: l, ...u } = t;
|
|
5539
|
-
r = c, i = u, s = e === void 0 ? "ghost" : e,
|
|
5540
|
-
} else r = n[1], i = n[2],
|
|
5541
|
-
let c =
|
|
5526
|
+
r = c, i = u, s = e === void 0 ? "ghost" : e, o = l ?? (a.count(i.children) > 1 ? "sm" : "icon-sm"), n[0] = t, n[1] = r, n[2] = i, n[3] = o, n[4] = s;
|
|
5527
|
+
} else r = n[1], i = n[2], o = n[3], s = n[4];
|
|
5528
|
+
let c = o, l;
|
|
5542
5529
|
n[5] === r ? l = n[6] : (l = A(r), n[5] = r, n[6] = l);
|
|
5543
5530
|
let u;
|
|
5544
5531
|
return n[7] !== c || n[8] !== i || n[9] !== l || n[10] !== s ? (u = /* @__PURE__ */ P(Re, {
|
|
@@ -5618,7 +5605,7 @@ var kc = (t) => {
|
|
|
5618
5605
|
}, Hc = (t) => {
|
|
5619
5606
|
let n = e(21), r, i, a, o;
|
|
5620
5607
|
n[0] === t ? (r = n[1], i = n[2], a = n[3], o = n[4]) : ({className: r, textareaRef: o, onTranscriptionChange: i, ...a} = t, n[0] = t, n[1] = r, n[2] = i, n[3] = a, n[4] = o);
|
|
5621
|
-
let [s, c] =
|
|
5608
|
+
let [s, c] = b(!1), [l, u] = b(null), f = y(null), p, m;
|
|
5622
5609
|
n[5] !== i || n[6] !== o ? (p = () => {
|
|
5623
5610
|
if (typeof window < "u" && ("SpeechRecognition" in window || "webkitSpeechRecognition" in window)) {
|
|
5624
5611
|
let e = new (window.SpeechRecognition || window.webkitSpeechRecognition)();
|
|
@@ -5638,28 +5625,28 @@ var kc = (t) => {
|
|
|
5638
5625
|
}
|
|
5639
5626
|
}, e.onerror = (e) => {
|
|
5640
5627
|
console.error("Speech recognition error:", e.error), c(!1);
|
|
5641
|
-
},
|
|
5628
|
+
}, f.current = e, d(() => u(e));
|
|
5642
5629
|
}
|
|
5643
5630
|
return () => {
|
|
5644
|
-
|
|
5631
|
+
f.current && f.current.stop();
|
|
5645
5632
|
};
|
|
5646
|
-
}, m = [o, i], n[5] = i, n[6] = o, n[7] = p, n[8] = m) : (p = n[7], m = n[8]),
|
|
5647
|
-
let
|
|
5648
|
-
n[9] !== s || n[10] !== l ? (
|
|
5633
|
+
}, m = [o, i], n[5] = i, n[6] = o, n[7] = p, n[8] = m) : (p = n[7], m = n[8]), h(p, m);
|
|
5634
|
+
let g;
|
|
5635
|
+
n[9] !== s || n[10] !== l ? (g = () => {
|
|
5649
5636
|
l && (s ? l.stop() : l.start());
|
|
5650
|
-
}, n[9] = s, n[10] = l, n[11] =
|
|
5651
|
-
let _ =
|
|
5652
|
-
n[12] !== r || n[13] !== v ? (
|
|
5637
|
+
}, n[9] = s, n[10] = l, n[11] = g) : g = n[11];
|
|
5638
|
+
let _ = g, v = s && "bg-accent text-accent-foreground animate-pulse", x;
|
|
5639
|
+
n[12] !== r || n[13] !== v ? (x = A("relative transition-all duration-200", v, r), n[12] = r, n[13] = v, n[14] = x) : x = n[14];
|
|
5653
5640
|
let S = !l, C;
|
|
5654
5641
|
n[15] === Symbol.for("react.memo_cache_sentinel") ? (C = /* @__PURE__ */ P(dt, { className: "size-4" }), n[15] = C) : C = n[15];
|
|
5655
5642
|
let w;
|
|
5656
|
-
return n[16] !== a || n[17] !==
|
|
5657
|
-
className:
|
|
5643
|
+
return n[16] !== a || n[17] !== x || n[18] !== S || n[19] !== _ ? (w = /* @__PURE__ */ P(Ic, {
|
|
5644
|
+
className: x,
|
|
5658
5645
|
disabled: S,
|
|
5659
5646
|
onClick: _,
|
|
5660
5647
|
...a,
|
|
5661
5648
|
children: C
|
|
5662
|
-
}), n[16] = a, n[17] =
|
|
5649
|
+
}), n[16] = a, n[17] = x, n[18] = S, n[19] = _, n[20] = w) : w = n[20], w;
|
|
5663
5650
|
}, Uc = (t) => {
|
|
5664
5651
|
let n = e(2), r;
|
|
5665
5652
|
return n[0] === t ? r = n[1] : (r = /* @__PURE__ */ P(Be, { ...t }), n[0] = t, n[1] = r), r;
|
|
@@ -5848,7 +5835,7 @@ var kc = (t) => {
|
|
|
5848
5835
|
//#endregion
|
|
5849
5836
|
//#region src/lib/hooks/use-async-generator.ts
|
|
5850
5837
|
function ll() {
|
|
5851
|
-
let [e, t] =
|
|
5838
|
+
let [e, t] = b({
|
|
5852
5839
|
loading: !1,
|
|
5853
5840
|
error: null
|
|
5854
5841
|
}), n = async (e) => {
|
|
@@ -5878,7 +5865,7 @@ function ll() {
|
|
|
5878
5865
|
//#endregion
|
|
5879
5866
|
//#region src/lib/hooks/use-auto-resize-textarea.ts
|
|
5880
5867
|
function ul(t) {
|
|
5881
|
-
let n = e(16), { minHeight: r, maxHeight: i, value: a } = t, o =
|
|
5868
|
+
let n = e(16), { minHeight: r, maxHeight: i, value: a } = t, o = y(null), s;
|
|
5882
5869
|
n[0] !== i || n[1] !== r ? (s = (e) => {
|
|
5883
5870
|
let t = o.current;
|
|
5884
5871
|
if (!t) return;
|
|
@@ -5894,23 +5881,23 @@ function ul(t) {
|
|
|
5894
5881
|
n[3] === r ? (l = n[4], u = n[5]) : (l = () => {
|
|
5895
5882
|
let e = o.current;
|
|
5896
5883
|
e && (e.style.height = `${r}px`);
|
|
5897
|
-
}, u = [r], n[3] = r, n[4] = l, n[5] = u),
|
|
5884
|
+
}, u = [r], n[3] = r, n[4] = l, n[5] = u), h(l, u);
|
|
5898
5885
|
let d;
|
|
5899
5886
|
n[6] === c ? d = n[7] : (d = () => {
|
|
5900
5887
|
c();
|
|
5901
5888
|
}, n[6] = c, n[7] = d);
|
|
5902
5889
|
let f;
|
|
5903
|
-
n[8] !== c || n[9] !== a ? (f = [a, c], n[8] = c, n[9] = a, n[10] = f) : f = n[10],
|
|
5890
|
+
n[8] !== c || n[9] !== a ? (f = [a, c], n[8] = c, n[9] = a, n[10] = f) : f = n[10], h(d, f);
|
|
5904
5891
|
let p, m;
|
|
5905
5892
|
n[11] === c ? (p = n[12], m = n[13]) : (p = () => {
|
|
5906
5893
|
let e = () => c();
|
|
5907
5894
|
return window.addEventListener("resize", e), () => window.removeEventListener("resize", e);
|
|
5908
|
-
}, m = [c], n[11] = c, n[12] = p, n[13] = m),
|
|
5909
|
-
let
|
|
5910
|
-
return n[14] === c ?
|
|
5895
|
+
}, m = [c], n[11] = c, n[12] = p, n[13] = m), h(p, m);
|
|
5896
|
+
let g;
|
|
5897
|
+
return n[14] === c ? g = n[15] : (g = {
|
|
5911
5898
|
textareaRef: o,
|
|
5912
5899
|
adjustHeight: c
|
|
5913
|
-
}, n[14] = c, n[15] =
|
|
5900
|
+
}, n[14] = c, n[15] = g), g;
|
|
5914
5901
|
}
|
|
5915
5902
|
//#endregion
|
|
5916
5903
|
//#region src/lib/hooks/use-keyboard.ts
|
|
@@ -5927,9 +5914,9 @@ function fl(t) {
|
|
|
5927
5914
|
n ||= i[e.key], n && (e.preventDefault(), e.stopPropagation(), n(e));
|
|
5928
5915
|
};
|
|
5929
5916
|
return document.addEventListener("keydown", e, !0), () => document.removeEventListener("keydown", e, !0);
|
|
5930
|
-
}, s = [a, i], n[0] = a, n[1] = i, n[2] = o, n[3] = s) : (o = n[2], s = n[3]),
|
|
5917
|
+
}, s = [a, i], n[0] = a, n[1] = i, n[2] = o, n[3] = s) : (o = n[2], s = n[3]), h(o, s);
|
|
5931
5918
|
}
|
|
5932
5919
|
//#endregion
|
|
5933
|
-
export { dn as AgentHeader, _n as AgentProvider, on as AgentScrollArea, wi as AssistantSnapshot, fi as COPY_EXCLUSION_ATTRIBUTE, pi as COPY_EXCLUSION_MODES, ga as ChatActionButton, an as ChatBot, Ds as ChatComposer,
|
|
5920
|
+
export { dn as AgentHeader, _n as AgentProvider, on as AgentScrollArea, wi as AssistantSnapshot, fi as COPY_EXCLUSION_ATTRIBUTE, pi as COPY_EXCLUSION_MODES, ga as ChatActionButton, an as ChatBot, Ds as ChatComposer, en as ChatManager, Os as ChatTextarea, gr as CitationPill, ti as CodeBlock, ni as CodeBlockCopyButton, ts as CompactMessages, $o as CompactTrajectory, ya as CopyAction, xa as CopyDebugJsonAction, _c as DynamicRenderer, oc as DynamicUIError, ac as DynamicUIErrorBoundary, pr as IndexProgress, Ni as InteractiveResponse, hr as MessageItemCtx, $a as MessageMetadata, Ps as MessageQueue, ds as Messages, va as MessagesActions, mr as MessagesCtx, Ca as MessagesError, Ea as MessagesItem, Ta as MessagesList, wa as MessagesRoot, po as MessagesUserBubble, ha as NestedTrajectory, Oa as PendingToolInput, Ac as PromptInput, kc as PromptInputActionAddAttachments, Lc as PromptInputActionMenu, zc as PromptInputActionMenuContent, Bc as PromptInputActionMenuItem, Rc as PromptInputActionMenuTrigger, Dc as PromptInputAttachment, Oc as PromptInputAttachments, jc as PromptInputBody, Ic as PromptInputButton, nl as PromptInputCommand, al as PromptInputCommandEmpty, ol as PromptInputCommandGroup, rl as PromptInputCommandInput, sl as PromptInputCommandItem, il as PromptInputCommandList, cl as PromptInputCommandSeparator, Pc as PromptInputFooter, Nc as PromptInputHeader, Jc as PromptInputHoverCard, Xc as PromptInputHoverCardContent, Yc as PromptInputHoverCardTrigger, wc as PromptInputProvider, Uc as PromptInputSelect, Gc as PromptInputSelectContent, Kc as PromptInputSelectItem, Wc as PromptInputSelectTrigger, qc as PromptInputSelectValue, Hc as PromptInputSpeechButton, Vc as PromptInputSubmit, Qc as PromptInputTab, el as PromptInputTabBody, tl as PromptInputTabItem, $c as PromptInputTabLabel, Zc as PromptInputTabsList, Mc as PromptInputTextarea, Fc as PromptInputTools, Sn as ReadOnlyChatTransport, ba as RegenerateAction, X as Response, Q as Segment, bi as SnapshotRenderPortal, Bs as SubmitButton, G as TextShimmer, vs as TimelinedMessages, ic as TipLine, tc as TipProvider, Ks as TipValueContext, nc as Tips, Ki as ToolArg, Ws as ToolError, fo as UserMessageContent, Ka as ZukhrufChatTransport, xn as citationIndexOf, $t as clearPrefill, lc as createSafeScope, ae as defineElements, Ci as extractAssistantRawText, bn as extractSourcesFromMessages, Ua as formatUsageBreakdown, Ha as formatUsageValue, Mn as getIndexProgressEvents, uc as getScopeKeys, dc as getScopeValues, $ as getSegmentKey, hi as hasCopyExclusion, Oi as isActiveClientInputTool, Yi as isCommentaryTextPart, Ti as isSubagentPart, wn as isToolAborted, Cn as isToolStateAborted, La as parseMetadataUsage, Ia as parseUsage, Zt as readPrefill, _i as resolveCopyToClipboardStrategy, Di as resolveToolEntry, En as serializeToolsRegistry, gi as shouldIncludeInCopyImage, Ei as subagentDisplayName, pc as transpileJSX, Da as useActivePendingToolInput, H as useAgent, nn as useAgentChatSetup, W as useAgentMessages, U as useAgentMeta, vn as useAgentStatus, ll as useAsyncGenerator, ul as useAutoResizeTextarea, yn as useChatManager, Uo as useCompactGroup, Si as useCopyElementAsImage, Z as useIsAssistantSnapshotRender, Tn as useIsToolAborted, fl as useKeyboard, J as useMessageItem, K as useMessagesContext, q as useMessagesStatus, Va as useNormalizedUsageTracking, Ec as usePromptInputAttachments, bc as usePromptInputController, Sc as useProviderAttachments, qs as useTipValue, ra as useToolSegment, Vo as useTrajectoryItems, yi as waitForNextPaint, hc as wrapAsComponent, Qt as writePrefill };
|
|
5934
5921
|
|
|
5935
5922
|
//# sourceMappingURL=index.js.map
|