@fencyai/react 0.1.179 → 0.1.180
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 +267 -262
- package/dist/provider/StreamEventManager.d.ts.map +1 -1
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -19,12 +19,12 @@ function Be(e) {
|
|
|
19
19
|
let t, n, r, a = !1;
|
|
20
20
|
return function(s) {
|
|
21
21
|
t === void 0 ? (t = s, n = 0, r = -1) : t = Ne(t, s);
|
|
22
|
-
const
|
|
22
|
+
const m = t.length;
|
|
23
23
|
let d = 0;
|
|
24
|
-
for (; n <
|
|
24
|
+
for (; n < m; ) {
|
|
25
25
|
a && (t[n] === 10 && (d = ++n), a = !1);
|
|
26
|
-
let
|
|
27
|
-
for (; n <
|
|
26
|
+
let u = -1;
|
|
27
|
+
for (; n < m && u === -1; ++n)
|
|
28
28
|
switch (t[n]) {
|
|
29
29
|
case 58:
|
|
30
30
|
r === -1 && (r = n - d);
|
|
@@ -32,24 +32,24 @@ function Be(e) {
|
|
|
32
32
|
case 13:
|
|
33
33
|
a = !0;
|
|
34
34
|
case 10:
|
|
35
|
-
|
|
35
|
+
u = n;
|
|
36
36
|
break;
|
|
37
37
|
}
|
|
38
|
-
if (
|
|
38
|
+
if (u === -1)
|
|
39
39
|
break;
|
|
40
|
-
e(t.subarray(d,
|
|
40
|
+
e(t.subarray(d, u), r), d = n, r = -1;
|
|
41
41
|
}
|
|
42
|
-
d ===
|
|
42
|
+
d === m ? t = void 0 : d !== 0 && (t = t.subarray(d), n -= d);
|
|
43
43
|
};
|
|
44
44
|
}
|
|
45
45
|
function We(e, t, n) {
|
|
46
46
|
let r = te();
|
|
47
47
|
const a = new TextDecoder();
|
|
48
|
-
return function(s,
|
|
48
|
+
return function(s, m) {
|
|
49
49
|
if (s.length === 0)
|
|
50
50
|
n == null || n(r), r = te();
|
|
51
|
-
else if (
|
|
52
|
-
const d = a.decode(s.subarray(0,
|
|
51
|
+
else if (m > 0) {
|
|
52
|
+
const d = a.decode(s.subarray(0, m)), u = m + (s[m + 1] === 32 ? 2 : 1), l = a.decode(s.subarray(u));
|
|
53
53
|
switch (d) {
|
|
54
54
|
case "data":
|
|
55
55
|
r.data = r.data ? r.data + `
|
|
@@ -91,8 +91,8 @@ var Oe = function(e, t) {
|
|
|
91
91
|
};
|
|
92
92
|
const H = "text/event-stream", je = 1e3, ne = "last-event-id";
|
|
93
93
|
function $e(e, t) {
|
|
94
|
-
var { signal: n, headers: r, onopen: a, onmessage: c, onclose: s, onerror:
|
|
95
|
-
return new Promise((h,
|
|
94
|
+
var { signal: n, headers: r, onopen: a, onmessage: c, onclose: s, onerror: m, openWhenHidden: d, fetch: u } = t, l = Oe(t, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
|
|
95
|
+
return new Promise((h, k) => {
|
|
96
96
|
const y = Object.assign({}, r);
|
|
97
97
|
y.accept || (y.accept = H);
|
|
98
98
|
let p;
|
|
@@ -100,14 +100,14 @@ function $e(e, t) {
|
|
|
100
100
|
p.abort(), document.hidden || I();
|
|
101
101
|
}
|
|
102
102
|
d || document.addEventListener("visibilitychange", g);
|
|
103
|
-
let
|
|
103
|
+
let b = je, x = 0;
|
|
104
104
|
function w() {
|
|
105
105
|
document.removeEventListener("visibilitychange", g), window.clearTimeout(x), p.abort();
|
|
106
106
|
}
|
|
107
107
|
n == null || n.addEventListener("abort", () => {
|
|
108
108
|
w(), h();
|
|
109
109
|
});
|
|
110
|
-
const C =
|
|
110
|
+
const C = u ?? window.fetch, E = a ?? He;
|
|
111
111
|
async function I() {
|
|
112
112
|
var W;
|
|
113
113
|
p = new AbortController();
|
|
@@ -116,15 +116,15 @@ function $e(e, t) {
|
|
|
116
116
|
await E(P), await Le(P.body, Be(We((v) => {
|
|
117
117
|
v ? y[ne] = v : delete y[ne];
|
|
118
118
|
}, (v) => {
|
|
119
|
-
|
|
119
|
+
b = v;
|
|
120
120
|
}, c))), s == null || s(), w(), h();
|
|
121
121
|
} catch (P) {
|
|
122
122
|
if (!p.signal.aborted)
|
|
123
123
|
try {
|
|
124
|
-
const v = (W =
|
|
124
|
+
const v = (W = m == null ? void 0 : m(P)) !== null && W !== void 0 ? W : b;
|
|
125
125
|
window.clearTimeout(x), x = window.setTimeout(I, v);
|
|
126
126
|
} catch (v) {
|
|
127
|
-
w(),
|
|
127
|
+
w(), k(v);
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
130
|
}
|
|
@@ -352,41 +352,46 @@ class _e {
|
|
|
352
352
|
var s;
|
|
353
353
|
a.abort(), (s = this.worker) == null || s.postMessage({ command: "disconnect", streamId: n });
|
|
354
354
|
}
|
|
355
|
-
}), this.startWorkerStream(n, r, c, a);
|
|
355
|
+
}), this.startWorkerStream(n, r, c, a, t);
|
|
356
356
|
}
|
|
357
|
-
async startWorkerStream(t, n, r, a) {
|
|
358
|
-
const
|
|
359
|
-
if (!
|
|
360
|
-
const
|
|
361
|
-
a.signal.aborted || (this.activeConnections.delete(t), this.broadcastError(t,
|
|
357
|
+
async startWorkerStream(t, n, r, a, c) {
|
|
358
|
+
const s = this.worker;
|
|
359
|
+
if (!s) return;
|
|
360
|
+
const m = (d) => {
|
|
361
|
+
a.signal.aborted || (this.activeConnections.delete(t), this.broadcastError(t, d));
|
|
362
362
|
};
|
|
363
363
|
try {
|
|
364
|
-
const
|
|
364
|
+
const d = await fetch(n, {
|
|
365
365
|
method: "GET",
|
|
366
366
|
headers: r,
|
|
367
367
|
signal: a.signal
|
|
368
368
|
});
|
|
369
|
-
if (!
|
|
370
|
-
|
|
369
|
+
if (!d.ok) {
|
|
370
|
+
d.status >= 400 && d.status < 500 && d.status !== 429 ? m(`Client error ${d.status}`) : m(`HTTP ${d.status}`);
|
|
371
371
|
return;
|
|
372
372
|
}
|
|
373
|
-
const
|
|
374
|
-
if (!
|
|
375
|
-
|
|
373
|
+
const u = d.body;
|
|
374
|
+
if (!u) {
|
|
375
|
+
m("No response body");
|
|
376
376
|
return;
|
|
377
377
|
}
|
|
378
378
|
if (!this.activeConnections.has(t)) {
|
|
379
|
-
await
|
|
379
|
+
await u.cancel().catch(() => {
|
|
380
380
|
});
|
|
381
381
|
return;
|
|
382
382
|
}
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
383
|
+
try {
|
|
384
|
+
s.postMessage(
|
|
385
|
+
{ command: "start", streamId: t, readableStream: u },
|
|
386
|
+
[u]
|
|
387
|
+
);
|
|
388
|
+
} catch {
|
|
389
|
+
this.workerSupported = !1, u.cancel().catch(() => {
|
|
390
|
+
}), this.activeConnections.delete(t), this.connectStreamOnMainThread(c);
|
|
391
|
+
}
|
|
392
|
+
} catch (d) {
|
|
388
393
|
if (a.signal.aborted) return;
|
|
389
|
-
|
|
394
|
+
m(ae(d));
|
|
390
395
|
}
|
|
391
396
|
}
|
|
392
397
|
connectStreamOnMainThread(t) {
|
|
@@ -408,8 +413,8 @@ class _e {
|
|
|
408
413
|
},
|
|
409
414
|
onmessage: (s) => {
|
|
410
415
|
if (s.data) {
|
|
411
|
-
const
|
|
412
|
-
this.broadcast(
|
|
416
|
+
const m = oe(s.data);
|
|
417
|
+
this.broadcast(m, n);
|
|
413
418
|
}
|
|
414
419
|
},
|
|
415
420
|
onerror: (s) => {
|
|
@@ -459,35 +464,35 @@ const Ge = 48e4, qe = 3e5, ie = (e) => {
|
|
|
459
464
|
function $t({ fency: e, fetchCreateStreamClientToken: t, children: n }) {
|
|
460
465
|
const [r, a] = R(
|
|
461
466
|
null
|
|
462
|
-
), [c, s] = R(!0), [
|
|
467
|
+
), [c, s] = R(!0), [m, d] = R(null), [u, l] = R([]), h = D(null), k = D(null);
|
|
463
468
|
z(() => {
|
|
464
|
-
e.then((
|
|
465
|
-
a(
|
|
466
|
-
}).catch((
|
|
467
|
-
d(
|
|
469
|
+
e.then((b) => {
|
|
470
|
+
a(b), s(!1);
|
|
471
|
+
}).catch((b) => {
|
|
472
|
+
d(b), s(!1);
|
|
468
473
|
});
|
|
469
474
|
}, [e]), z(() => {
|
|
470
|
-
r && !
|
|
475
|
+
r && !k.current && (k.current = new _e(r));
|
|
471
476
|
}, [r]), z(() => {
|
|
472
|
-
|
|
473
|
-
}, [
|
|
474
|
-
var
|
|
475
|
-
(
|
|
477
|
+
k.current && k.current.updateStreams(u);
|
|
478
|
+
}, [u]), z(() => () => {
|
|
479
|
+
var b;
|
|
480
|
+
(b = k.current) == null || b.cleanup();
|
|
476
481
|
}, []), z(() => {
|
|
477
|
-
const
|
|
482
|
+
const b = setInterval(() => {
|
|
478
483
|
l((x) => {
|
|
479
484
|
const w = ie(x);
|
|
480
485
|
return w.length !== x.length ? w : x;
|
|
481
486
|
});
|
|
482
487
|
}, 6e4);
|
|
483
|
-
return () => clearInterval(
|
|
488
|
+
return () => clearInterval(b);
|
|
484
489
|
}, []);
|
|
485
490
|
const y = O(
|
|
486
|
-
async (
|
|
491
|
+
async (b = qe) => {
|
|
487
492
|
if (h.current)
|
|
488
493
|
return h.current;
|
|
489
|
-
const x = Date.now(), w =
|
|
490
|
-
if (w && x - w.createdAt <
|
|
494
|
+
const x = Date.now(), w = u.length > 0 ? u[u.length - 1] : null;
|
|
495
|
+
if (w && x - w.createdAt < b)
|
|
491
496
|
return w.stream;
|
|
492
497
|
const C = (async () => {
|
|
493
498
|
if (!r)
|
|
@@ -511,22 +516,22 @@ function $t({ fency: e, fetchCreateStreamClientToken: t, children: n }) {
|
|
|
511
516
|
})();
|
|
512
517
|
return h.current = C, C;
|
|
513
518
|
},
|
|
514
|
-
[r,
|
|
519
|
+
[r, u]
|
|
515
520
|
);
|
|
516
|
-
if (
|
|
521
|
+
if (m)
|
|
517
522
|
return /* @__PURE__ */ f("div", { children: [
|
|
518
523
|
"Fency error: ",
|
|
519
|
-
|
|
524
|
+
m.message
|
|
520
525
|
] });
|
|
521
526
|
if (!r)
|
|
522
527
|
return null;
|
|
523
|
-
const p =
|
|
528
|
+
const p = u.length > 0 ? u[u.length - 1] : null, g = {
|
|
524
529
|
fency: r,
|
|
525
530
|
loading: c,
|
|
526
|
-
error:
|
|
527
|
-
activeStreams:
|
|
531
|
+
error: m,
|
|
532
|
+
activeStreams: u,
|
|
528
533
|
latestStream: p,
|
|
529
|
-
eventManager:
|
|
534
|
+
eventManager: k.current,
|
|
530
535
|
getOrCreateStream: y
|
|
531
536
|
};
|
|
532
537
|
return /* @__PURE__ */ o(ge.Provider, { value: g, children: n });
|
|
@@ -563,7 +568,7 @@ const fe = i.object({
|
|
|
563
568
|
])
|
|
564
569
|
}).passthrough()
|
|
565
570
|
)
|
|
566
|
-
}).passthrough(),
|
|
571
|
+
}).passthrough(), ke = i.object({
|
|
567
572
|
memoryId: i.string(),
|
|
568
573
|
memoryTitle: i.string()
|
|
569
574
|
}).passthrough(), Qe = i.object({
|
|
@@ -603,7 +608,7 @@ const fe = i.object({
|
|
|
603
608
|
taskType: i.literal("MemoryChat"),
|
|
604
609
|
eventType: i.literal("Search"),
|
|
605
610
|
queryDescription: i.string(),
|
|
606
|
-
memories: i.array(
|
|
611
|
+
memories: i.array(ke).optional()
|
|
607
612
|
}).passthrough(), rr = i.object({
|
|
608
613
|
taskType: i.literal("MemoryChat"),
|
|
609
614
|
eventType: i.literal("FindMemories"),
|
|
@@ -611,7 +616,7 @@ const fe = i.object({
|
|
|
611
616
|
}).passthrough(), tr = i.object({
|
|
612
617
|
taskType: i.literal("MemoryChat"),
|
|
613
618
|
eventType: i.literal("FindMemoriesResult"),
|
|
614
|
-
memories: i.array(
|
|
619
|
+
memories: i.array(ke)
|
|
615
620
|
}).passthrough(), nr = i.enum([
|
|
616
621
|
"downloading",
|
|
617
622
|
"downloaded",
|
|
@@ -774,7 +779,7 @@ const fe = i.object({
|
|
|
774
779
|
gr,
|
|
775
780
|
yr
|
|
776
781
|
]);
|
|
777
|
-
function
|
|
782
|
+
function kr(e) {
|
|
778
783
|
const t = fr.safeParse(e);
|
|
779
784
|
return t.success ? t.data : (console.warn(
|
|
780
785
|
"[fency] Dropping unrecognized or malformed agent task event:",
|
|
@@ -782,7 +787,7 @@ function br(e) {
|
|
|
782
787
|
e
|
|
783
788
|
), null);
|
|
784
789
|
}
|
|
785
|
-
const
|
|
790
|
+
const br = (e) => {
|
|
786
791
|
try {
|
|
787
792
|
const t = JSON.parse(e);
|
|
788
793
|
return Sr(t);
|
|
@@ -807,7 +812,7 @@ const kr = (e) => {
|
|
|
807
812
|
r
|
|
808
813
|
), null;
|
|
809
814
|
}
|
|
810
|
-
const n =
|
|
815
|
+
const n = kr(t);
|
|
811
816
|
return n === null ? null : {
|
|
812
817
|
type: "AGENT_TASK_PROGRESS_ITEM_UPDATED",
|
|
813
818
|
streamId: e.streamId,
|
|
@@ -822,29 +827,29 @@ const kr = (e) => {
|
|
|
822
827
|
return z(() => {
|
|
823
828
|
if (!t.eventManager) return;
|
|
824
829
|
const s = {
|
|
825
|
-
onMessage: (d,
|
|
826
|
-
var h,
|
|
827
|
-
const l =
|
|
830
|
+
onMessage: (d, u) => {
|
|
831
|
+
var h, k, y;
|
|
832
|
+
const l = br(d);
|
|
828
833
|
if (l)
|
|
829
834
|
switch (l.type) {
|
|
830
835
|
case "STREAM_TIMEOUT":
|
|
831
836
|
(h = e == null ? void 0 : e.onStreamTimeout) == null || h.call(e, l);
|
|
832
837
|
break;
|
|
833
838
|
case "STREAM_NOT_FOUND":
|
|
834
|
-
(
|
|
839
|
+
(k = e == null ? void 0 : e.onStreamNotFound) == null || k.call(e, l);
|
|
835
840
|
break;
|
|
836
841
|
case "AGENT_TASK_PROGRESS_ITEM_UPDATED":
|
|
837
842
|
(y = e == null ? void 0 : e.onAgentTaskProgressItemUpdated) == null || y.call(e, l);
|
|
838
843
|
break;
|
|
839
844
|
}
|
|
840
845
|
},
|
|
841
|
-
onError: (d,
|
|
846
|
+
onError: (d, u) => {
|
|
842
847
|
var l;
|
|
843
848
|
(l = e == null ? void 0 : e.onStreamError) == null || l.call(e, {
|
|
844
849
|
streamId: d,
|
|
845
850
|
error: {
|
|
846
851
|
code: "UnknownError",
|
|
847
|
-
message:
|
|
852
|
+
message: u ?? "Unknown error in useStream"
|
|
848
853
|
}
|
|
849
854
|
});
|
|
850
855
|
}
|
|
@@ -876,23 +881,23 @@ const kr = (e) => {
|
|
|
876
881
|
}, Ht = (e) => {
|
|
877
882
|
const t = ye(), [n, r] = R([]), a = D(/* @__PURE__ */ new Set()), c = D(/* @__PURE__ */ new Map()), s = O(
|
|
878
883
|
(l, h) => {
|
|
879
|
-
r((
|
|
880
|
-
const y = [], p =
|
|
884
|
+
r((k) => {
|
|
885
|
+
const y = [], p = k.map((g) => {
|
|
881
886
|
var x;
|
|
882
887
|
if (g.streamId !== l || !g.loading) return g;
|
|
883
|
-
const
|
|
884
|
-
return
|
|
888
|
+
const b = (x = g.confirmedData) == null ? void 0 : x.taskId;
|
|
889
|
+
return b && y.push(b), { ...g, loading: !1, error: h };
|
|
885
890
|
});
|
|
886
891
|
for (const g of y) {
|
|
887
892
|
a.current.delete(g);
|
|
888
|
-
const
|
|
889
|
-
|
|
893
|
+
const b = c.current.get(g);
|
|
894
|
+
b && (c.current.delete(g), b({ type: "error", error: h }));
|
|
890
895
|
}
|
|
891
896
|
return p;
|
|
892
897
|
});
|
|
893
898
|
},
|
|
894
899
|
[]
|
|
895
|
-
), { createStream:
|
|
900
|
+
), { createStream: m } = Cr({
|
|
896
901
|
onAgentTaskProgressItemUpdated: (l) => {
|
|
897
902
|
var y;
|
|
898
903
|
if (!a.current.has(l.agentTaskId)) return;
|
|
@@ -900,7 +905,7 @@ const kr = (e) => {
|
|
|
900
905
|
if (h.taskType === "StreamingChatCompletion" && h.eventType === "Completed" || h.taskType === "StructuredChatCompletion" && h.eventType === "Completed" || h.taskType === "MemoryChat" && h.eventType === "Completed" || h.taskType === "MemorySearch" && h.eventType === "Completed") {
|
|
901
906
|
const p = h.taskType === "MemorySearch" && h.eventType === "Completed" || h.taskType === "StructuredChatCompletion" && h.eventType === "Completed";
|
|
902
907
|
r(
|
|
903
|
-
p ? (
|
|
908
|
+
p ? (b) => b.map((x) => {
|
|
904
909
|
var E;
|
|
905
910
|
if (((E = x.confirmedData) == null ? void 0 : E.taskId) !== l.agentTaskId)
|
|
906
911
|
return x;
|
|
@@ -914,7 +919,7 @@ const kr = (e) => {
|
|
|
914
919
|
progressItems: C,
|
|
915
920
|
loading: !1
|
|
916
921
|
};
|
|
917
|
-
}) : (
|
|
922
|
+
}) : (b) => b.map(
|
|
918
923
|
(x) => {
|
|
919
924
|
var w;
|
|
920
925
|
return ((w = x.confirmedData) == null ? void 0 : w.taskId) === l.agentTaskId ? { ...x, loading: !1 } : x;
|
|
@@ -967,17 +972,17 @@ const kr = (e) => {
|
|
|
967
972
|
}), d = O(
|
|
968
973
|
async (l, h) => {
|
|
969
974
|
var g;
|
|
970
|
-
const
|
|
975
|
+
const k = `task-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`, y = (h == null ? void 0 : h.fetchCreateAgentTaskClientToken) ?? e.fetchCreateAgentTaskClientToken;
|
|
971
976
|
if (y === void 0)
|
|
972
977
|
throw new Error(
|
|
973
978
|
"fetchCreateAgentTaskClientToken must be provided either in useAgentTasks props or in createAgentTask options"
|
|
974
979
|
);
|
|
975
|
-
const p = await
|
|
980
|
+
const p = await m();
|
|
976
981
|
if (p.type === "success") {
|
|
977
|
-
const
|
|
978
|
-
taskKey:
|
|
982
|
+
const b = (/* @__PURE__ */ new Date()).toISOString(), x = {
|
|
983
|
+
taskKey: k,
|
|
979
984
|
streamId: p.stream.id,
|
|
980
|
-
triggeredAt:
|
|
985
|
+
triggeredAt: b,
|
|
981
986
|
confirmedData: null,
|
|
982
987
|
error: null,
|
|
983
988
|
params: l,
|
|
@@ -1033,9 +1038,9 @@ const kr = (e) => {
|
|
|
1033
1038
|
return a.current.add(
|
|
1034
1039
|
C.agentTask.id
|
|
1035
1040
|
), r((E) => [
|
|
1036
|
-
...E.filter((I) => I.taskKey !==
|
|
1041
|
+
...E.filter((I) => I.taskKey !== k),
|
|
1037
1042
|
{
|
|
1038
|
-
taskKey:
|
|
1043
|
+
taskKey: k,
|
|
1039
1044
|
streamId: p.stream.id,
|
|
1040
1045
|
triggeredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1041
1046
|
taskId: C.agentTask.id,
|
|
@@ -1060,9 +1065,9 @@ const kr = (e) => {
|
|
|
1060
1065
|
);
|
|
1061
1066
|
if (C.type === "error")
|
|
1062
1067
|
return r((E) => [
|
|
1063
|
-
...E.filter((I) => I.taskKey !==
|
|
1068
|
+
...E.filter((I) => I.taskKey !== k),
|
|
1064
1069
|
{
|
|
1065
|
-
taskKey:
|
|
1070
|
+
taskKey: k,
|
|
1066
1071
|
triggeredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1067
1072
|
streamId: p.stream.id,
|
|
1068
1073
|
params: l,
|
|
@@ -1082,9 +1087,9 @@ const kr = (e) => {
|
|
|
1082
1087
|
code: "UnknownError"
|
|
1083
1088
|
};
|
|
1084
1089
|
return r((I) => [
|
|
1085
|
-
...I.filter((W) => W.taskKey !==
|
|
1090
|
+
...I.filter((W) => W.taskKey !== k),
|
|
1086
1091
|
{
|
|
1087
|
-
taskKey:
|
|
1092
|
+
taskKey: k,
|
|
1088
1093
|
triggeredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1089
1094
|
streamId: p.stream.id,
|
|
1090
1095
|
error: E,
|
|
@@ -1105,9 +1110,9 @@ const kr = (e) => {
|
|
|
1105
1110
|
message: w instanceof Error ? w.message : "Unknown error during agent task creation"
|
|
1106
1111
|
};
|
|
1107
1112
|
return r((E) => [
|
|
1108
|
-
...E.filter((I) => I.taskKey !==
|
|
1113
|
+
...E.filter((I) => I.taskKey !== k),
|
|
1109
1114
|
{
|
|
1110
|
-
taskKey:
|
|
1115
|
+
taskKey: k,
|
|
1111
1116
|
triggeredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
1112
1117
|
streamId: p.stream.id,
|
|
1113
1118
|
params: l,
|
|
@@ -1127,11 +1132,11 @@ const kr = (e) => {
|
|
|
1127
1132
|
},
|
|
1128
1133
|
[
|
|
1129
1134
|
t,
|
|
1130
|
-
|
|
1135
|
+
m,
|
|
1131
1136
|
e.fetchCreateAgentTaskClientToken,
|
|
1132
1137
|
s
|
|
1133
1138
|
]
|
|
1134
|
-
),
|
|
1139
|
+
), u = B(() => {
|
|
1135
1140
|
if (n.length !== 0)
|
|
1136
1141
|
return [...n].sort((l, h) => new Date(h.triggeredAt).getTime() - new Date(l.triggeredAt).getTime())[0];
|
|
1137
1142
|
}, [n]);
|
|
@@ -1140,7 +1145,7 @@ const kr = (e) => {
|
|
|
1140
1145
|
}, []), {
|
|
1141
1146
|
agentTasks: n,
|
|
1142
1147
|
createAgentTask: d,
|
|
1143
|
-
latest:
|
|
1148
|
+
latest: u
|
|
1144
1149
|
};
|
|
1145
1150
|
};
|
|
1146
1151
|
function wr(e) {
|
|
@@ -1148,8 +1153,8 @@ function wr(e) {
|
|
|
1148
1153
|
const r = e.progressItems[n + 1], a = r != null;
|
|
1149
1154
|
let c;
|
|
1150
1155
|
if (r != null && r.createdAt) {
|
|
1151
|
-
const s = new Date(t.createdAt).getTime(),
|
|
1152
|
-
c = Math.round((
|
|
1156
|
+
const s = new Date(t.createdAt).getTime(), m = new Date(r.createdAt).getTime();
|
|
1157
|
+
c = Math.round((m - s) / 1e3);
|
|
1153
1158
|
}
|
|
1154
1159
|
return {
|
|
1155
1160
|
item: t,
|
|
@@ -1798,7 +1803,7 @@ const Mr = {
|
|
|
1798
1803
|
".prism-previewer-easing.prism-previewer-easing line": {
|
|
1799
1804
|
stroke: "hsl(230, 8%, 24%)"
|
|
1800
1805
|
}
|
|
1801
|
-
},
|
|
1806
|
+
}, be = {
|
|
1802
1807
|
textPrimary: "#1f2937",
|
|
1803
1808
|
textSecondary: "#666",
|
|
1804
1809
|
textMuted: "#94a3b8",
|
|
@@ -1848,7 +1853,7 @@ const Mr = {
|
|
|
1848
1853
|
reasoningLine: "#a1a8b0"
|
|
1849
1854
|
}, Se = me({
|
|
1850
1855
|
theme: "light",
|
|
1851
|
-
colors:
|
|
1856
|
+
colors: be
|
|
1852
1857
|
});
|
|
1853
1858
|
function Rr({
|
|
1854
1859
|
theme: e,
|
|
@@ -1857,7 +1862,7 @@ function Rr({
|
|
|
1857
1862
|
const n = B(
|
|
1858
1863
|
() => ({
|
|
1859
1864
|
theme: e,
|
|
1860
|
-
colors: e === "dark" ? Er :
|
|
1865
|
+
colors: e === "dark" ? Er : be
|
|
1861
1866
|
}),
|
|
1862
1867
|
[e]
|
|
1863
1868
|
);
|
|
@@ -1886,8 +1891,8 @@ const se = ({
|
|
|
1886
1891
|
remarkPlugins: [De],
|
|
1887
1892
|
components: {
|
|
1888
1893
|
code(r) {
|
|
1889
|
-
const { children: a, className: c, node: s, ref:
|
|
1890
|
-
return
|
|
1894
|
+
const { children: a, className: c, node: s, ref: m, ...d } = r, u = /language-(\w+)/.exec(c || "");
|
|
1895
|
+
return u ? (
|
|
1891
1896
|
// @ts-expect-error react-syntax-highlighter types incompatible with @types/react 18
|
|
1892
1897
|
/* @__PURE__ */ o(
|
|
1893
1898
|
pe,
|
|
@@ -1895,7 +1900,7 @@ const se = ({
|
|
|
1895
1900
|
...d,
|
|
1896
1901
|
PreTag: "div",
|
|
1897
1902
|
children: String(a).replace(/\n$/, ""),
|
|
1898
|
-
language:
|
|
1903
|
+
language: u[1],
|
|
1899
1904
|
style: n
|
|
1900
1905
|
}
|
|
1901
1906
|
)
|
|
@@ -2107,18 +2112,18 @@ function F({
|
|
|
2107
2112
|
repeatDelay: a = 0.5,
|
|
2108
2113
|
className: c,
|
|
2109
2114
|
startOnView: s = !1,
|
|
2110
|
-
once:
|
|
2115
|
+
once: m = !1,
|
|
2111
2116
|
inViewMargin: d,
|
|
2112
|
-
spread:
|
|
2117
|
+
spread: u = 2,
|
|
2113
2118
|
color: l,
|
|
2114
2119
|
shimmerColor: h,
|
|
2115
|
-
direction:
|
|
2120
|
+
direction: k = "fromBottom"
|
|
2116
2121
|
}) {
|
|
2117
|
-
const { colors: y } = T(), p = l ?? y.shimmerBase, g = h ?? y.shimmerHighlight,
|
|
2122
|
+
const { colors: y } = T(), p = l ?? y.shimmerBase, g = h ?? y.shimmerHighlight, b = D(null), x = Ae(b, { once: m, margin: d }), w = B(() => e.length * u, [e, u]), C = !s || x, E = k === "fromBottom" ? "100% center" : "-100% center", I = k === "fromBottom" ? "0% center" : "200% center";
|
|
2118
2123
|
return /* @__PURE__ */ o(
|
|
2119
2124
|
M.span,
|
|
2120
2125
|
{
|
|
2121
|
-
ref:
|
|
2126
|
+
ref: b,
|
|
2122
2127
|
className: c,
|
|
2123
2128
|
style: {
|
|
2124
2129
|
position: "relative",
|
|
@@ -2161,10 +2166,10 @@ function F({
|
|
|
2161
2166
|
);
|
|
2162
2167
|
}
|
|
2163
2168
|
const G = 5, zr = ({ data: e, isLatest: t = !1, durationSeconds: n, t: r }) => {
|
|
2164
|
-
const { colors: a } = T(), [c, s] = R(!1), d = (e.memories ?? []).map((x) => x.memoryTitle),
|
|
2169
|
+
const { colors: a } = T(), [c, s] = R(!1), d = (e.memories ?? []).map((x) => x.memoryTitle), u = d.length > 0, l = u && d.length > G, h = l && !c ? d.slice(0, G) : d, k = d.length - G, y = !l || c, p = `${r.searchingFor}'${e.queryDescription}'`, g = u ? `${r.searchingIn}${X(
|
|
2165
2170
|
h,
|
|
2166
2171
|
y ? r.and : void 0
|
|
2167
|
-
)}` : "",
|
|
2172
|
+
)}` : "", b = u ? `${p}${g}` : `${r.searchingPrefix}${e.queryDescription}`;
|
|
2168
2173
|
return /* @__PURE__ */ f("div", { style: { padding: "16px" }, children: [
|
|
2169
2174
|
/* @__PURE__ */ o(
|
|
2170
2175
|
M.div,
|
|
@@ -2173,8 +2178,8 @@ const G = 5, zr = ({ data: e, isLatest: t = !1, durationSeconds: n, t: r }) => {
|
|
|
2173
2178
|
initial: { opacity: 0, y: -10 },
|
|
2174
2179
|
animate: { opacity: 1, y: 0 },
|
|
2175
2180
|
transition: { duration: 0.3, delay: 0 },
|
|
2176
|
-
children: t && !n && !l ? /* @__PURE__ */ o(F, { text:
|
|
2177
|
-
/* @__PURE__ */ o("span", { style: { color: a.textSecondary }, children:
|
|
2181
|
+
children: t && !n && !l ? /* @__PURE__ */ o(F, { text: b, duration: 2.5, repeat: !0 }) : /* @__PURE__ */ f(A, { children: [
|
|
2182
|
+
/* @__PURE__ */ o("span", { style: { color: a.textSecondary }, children: u ? /* @__PURE__ */ f(A, { children: [
|
|
2178
2183
|
r.searchingFor,
|
|
2179
2184
|
/* @__PURE__ */ f("span", { style: { fontWeight: 600 }, children: [
|
|
2180
2185
|
"'",
|
|
@@ -2202,7 +2207,7 @@ const G = 5, zr = ({ data: e, isLatest: t = !1, durationSeconds: n, t: r }) => {
|
|
|
2202
2207
|
fontFamily: "inherit"
|
|
2203
2208
|
},
|
|
2204
2209
|
children: S(r.moreMemories, {
|
|
2205
|
-
n:
|
|
2210
|
+
n: k
|
|
2206
2211
|
})
|
|
2207
2212
|
}
|
|
2208
2213
|
)
|
|
@@ -2246,9 +2251,9 @@ const G = 5, zr = ({ data: e, isLatest: t = !1, durationSeconds: n, t: r }) => {
|
|
|
2246
2251
|
)
|
|
2247
2252
|
] });
|
|
2248
2253
|
}, q = 5, Dr = ({ data: e, isLatest: t = !1, durationSeconds: n, t: r }) => {
|
|
2249
|
-
const { colors: a } = T(), [c, s] = R(!1),
|
|
2254
|
+
const { colors: a } = T(), [c, s] = R(!1), m = e.titles, d = m.length > 0, u = d && m.length > q, l = u && !c ? m.slice(0, q) : m, h = m.length - q, k = !u || c, y = d ? `${r.findingMemoriesIn}${X(
|
|
2250
2255
|
l,
|
|
2251
|
-
|
|
2256
|
+
k ? r.and : void 0
|
|
2252
2257
|
)}` : r.findingMemories;
|
|
2253
2258
|
return /* @__PURE__ */ f("div", { style: { padding: "16px" }, children: [
|
|
2254
2259
|
/* @__PURE__ */ o(
|
|
@@ -2260,9 +2265,9 @@ const G = 5, zr = ({ data: e, isLatest: t = !1, durationSeconds: n, t: r }) => {
|
|
|
2260
2265
|
initial: { opacity: 0, y: -10 },
|
|
2261
2266
|
animate: { opacity: 1, y: 0 },
|
|
2262
2267
|
transition: { duration: 0.3, delay: 0 },
|
|
2263
|
-
children: t && !n && !
|
|
2268
|
+
children: t && !n && !u ? /* @__PURE__ */ o(F, { text: y, duration: 2.5, repeat: !0 }) : /* @__PURE__ */ f(A, { children: [
|
|
2264
2269
|
/* @__PURE__ */ o("span", { style: { color: a.textSecondary }, children: y }),
|
|
2265
|
-
|
|
2270
|
+
u && !c && /* @__PURE__ */ f(A, { children: [
|
|
2266
2271
|
" ",
|
|
2267
2272
|
/* @__PURE__ */ o(
|
|
2268
2273
|
"button",
|
|
@@ -2286,7 +2291,7 @@ const G = 5, zr = ({ data: e, isLatest: t = !1, durationSeconds: n, t: r }) => {
|
|
|
2286
2291
|
}
|
|
2287
2292
|
)
|
|
2288
2293
|
] }),
|
|
2289
|
-
|
|
2294
|
+
u && c && /* @__PURE__ */ f(A, { children: [
|
|
2290
2295
|
" ",
|
|
2291
2296
|
/* @__PURE__ */ o(
|
|
2292
2297
|
"button",
|
|
@@ -2325,8 +2330,8 @@ const G = 5, zr = ({ data: e, isLatest: t = !1, durationSeconds: n, t: r }) => {
|
|
|
2325
2330
|
)
|
|
2326
2331
|
] });
|
|
2327
2332
|
}, Q = 5, Lr = ({ data: e, t }) => {
|
|
2328
|
-
const { colors: n } = T(), [r, a] = R(!1), s = e.memories.map((p) => p.memoryTitle),
|
|
2329
|
-
|
|
2333
|
+
const { colors: n } = T(), [r, a] = R(!1), s = e.memories.map((p) => p.memoryTitle), m = s.length > 0, d = m && s.length > Q, u = d && !r ? s.slice(0, Q) : s, l = s.length - Q, h = !d || r, k = s.length === 1 ? t.memoryFound : t.memoriesFoundPrefix, y = m ? `${k}${X(
|
|
2334
|
+
u,
|
|
2330
2335
|
h ? t.and : void 0
|
|
2331
2336
|
)}` : t.memoriesFound;
|
|
2332
2337
|
return /* @__PURE__ */ o("div", { style: { padding: "16px" }, children: /* @__PURE__ */ o(
|
|
@@ -2451,11 +2456,11 @@ const Nr = ({ data: e, onSourceClick: t, t: n }) => {
|
|
|
2451
2456
|
children: n.sources
|
|
2452
2457
|
}
|
|
2453
2458
|
),
|
|
2454
|
-
/* @__PURE__ */ o("div", { style: { display: "flex", flexWrap: "wrap", gap: "8px" }, children: e.sources.length === 0 ? /* @__PURE__ */ o("span", { style: { fontSize: "13px", color: r.textTertiary }, children: n.noSources }) : e.sources.map((s,
|
|
2459
|
+
/* @__PURE__ */ o("div", { style: { display: "flex", flexWrap: "wrap", gap: "8px" }, children: e.sources.length === 0 ? /* @__PURE__ */ o("span", { style: { fontSize: "13px", color: r.textTertiary }, children: n.noSources }) : e.sources.map((s, m) => /* @__PURE__ */ o(
|
|
2455
2460
|
Or,
|
|
2456
2461
|
{
|
|
2457
2462
|
source: s,
|
|
2458
|
-
index:
|
|
2463
|
+
index: m,
|
|
2459
2464
|
loadingMemoryId: a,
|
|
2460
2465
|
setLoadingMemoryId: c,
|
|
2461
2466
|
onSourceClick: t,
|
|
@@ -2472,7 +2477,7 @@ const Nr = ({ data: e, onSourceClick: t, t: n }) => {
|
|
|
2472
2477
|
onSourceClick: a,
|
|
2473
2478
|
t: c
|
|
2474
2479
|
}) => {
|
|
2475
|
-
const { colors: s } = T(), [
|
|
2480
|
+
const { colors: s } = T(), [m, d] = R(!1), u = !!a, l = n === e.memoryId, h = e.pageNumbers ?? [], k = Wr(h, c);
|
|
2476
2481
|
return /* @__PURE__ */ f(
|
|
2477
2482
|
M.div,
|
|
2478
2483
|
{
|
|
@@ -2480,7 +2485,7 @@ const Nr = ({ data: e, onSourceClick: t, t: n }) => {
|
|
|
2480
2485
|
initial: { opacity: 0, scale: 0.9 },
|
|
2481
2486
|
animate: { opacity: 1, scale: 1 },
|
|
2482
2487
|
transition: { duration: 0.25, delay: t * 0.05 },
|
|
2483
|
-
onClick:
|
|
2488
|
+
onClick: u && !l ? async () => {
|
|
2484
2489
|
r(e.memoryId);
|
|
2485
2490
|
try {
|
|
2486
2491
|
await a({
|
|
@@ -2494,8 +2499,8 @@ const Nr = ({ data: e, onSourceClick: t, t: n }) => {
|
|
|
2494
2499
|
r(null);
|
|
2495
2500
|
}
|
|
2496
2501
|
} : void 0,
|
|
2497
|
-
onMouseEnter:
|
|
2498
|
-
onMouseLeave:
|
|
2502
|
+
onMouseEnter: u && !l ? () => d(!0) : void 0,
|
|
2503
|
+
onMouseLeave: u && !l ? () => d(!1) : void 0,
|
|
2499
2504
|
style: {
|
|
2500
2505
|
display: "inline-flex",
|
|
2501
2506
|
flexDirection: "column",
|
|
@@ -2503,8 +2508,8 @@ const Nr = ({ data: e, onSourceClick: t, t: n }) => {
|
|
|
2503
2508
|
padding: "8px 12px",
|
|
2504
2509
|
borderRadius: "6px",
|
|
2505
2510
|
border: `1px solid ${s.borderStrong}`,
|
|
2506
|
-
backgroundColor:
|
|
2507
|
-
cursor:
|
|
2511
|
+
backgroundColor: m ? s.sourcesBadgeBg : s.transparent,
|
|
2512
|
+
cursor: u && !l ? "pointer" : l ? "wait" : "default",
|
|
2508
2513
|
transition: "background-color 0.15s ease",
|
|
2509
2514
|
userSelect: "none",
|
|
2510
2515
|
pointerEvents: l ? "none" : void 0
|
|
@@ -2533,7 +2538,7 @@ const Nr = ({ data: e, onSourceClick: t, t: n }) => {
|
|
|
2533
2538
|
]
|
|
2534
2539
|
}
|
|
2535
2540
|
),
|
|
2536
|
-
|
|
2541
|
+
k && /* @__PURE__ */ o("span", { style: { fontSize: "12px", color: s.textSecondary }, children: k })
|
|
2537
2542
|
]
|
|
2538
2543
|
}
|
|
2539
2544
|
);
|
|
@@ -2561,10 +2566,10 @@ const Nr = ({ data: e, onSourceClick: t, t: n }) => {
|
|
|
2561
2566
|
size: t = 32,
|
|
2562
2567
|
lineWidth: n = 2
|
|
2563
2568
|
}) => {
|
|
2564
|
-
const { colors: r } = T(), a = e ?? r.xmarkColor, c = t + 1, s = (t - n) / 2,
|
|
2569
|
+
const { colors: r } = T(), a = e ?? r.xmarkColor, c = t + 1, s = (t - n) / 2, m = (t - c) / 2, d = {
|
|
2565
2570
|
position: "absolute",
|
|
2566
2571
|
left: s,
|
|
2567
|
-
top:
|
|
2572
|
+
top: m,
|
|
2568
2573
|
width: n,
|
|
2569
2574
|
height: c,
|
|
2570
2575
|
backgroundColor: a
|
|
@@ -2613,14 +2618,14 @@ function $r({
|
|
|
2613
2618
|
completed: t,
|
|
2614
2619
|
t: n
|
|
2615
2620
|
}) {
|
|
2616
|
-
const { colors: r } = T(), [a, c] = R(!1), s = e.result ?? e.error,
|
|
2621
|
+
const { colors: r } = T(), [a, c] = R(!1), s = e.result ?? e.error, m = s != null && s.length > le, d = s != null ? a || !m ? s : `${s.slice(0, le)}...` : void 0, u = m, l = e.error != null;
|
|
2617
2622
|
return /* @__PURE__ */ f(
|
|
2618
2623
|
M.div,
|
|
2619
2624
|
{
|
|
2620
2625
|
initial: { opacity: 0 },
|
|
2621
2626
|
animate: { opacity: 1 },
|
|
2622
2627
|
transition: { duration: 0.25 },
|
|
2623
|
-
onClick:
|
|
2628
|
+
onClick: u ? () => c((h) => !h) : void 0,
|
|
2624
2629
|
style: {
|
|
2625
2630
|
paddingTop: "12px",
|
|
2626
2631
|
paddingBottom: "12px",
|
|
@@ -2630,7 +2635,7 @@ function $r({
|
|
|
2630
2635
|
alignItems: "center",
|
|
2631
2636
|
gap: "10px",
|
|
2632
2637
|
minWidth: 0,
|
|
2633
|
-
cursor:
|
|
2638
|
+
cursor: u ? "pointer" : "default"
|
|
2634
2639
|
},
|
|
2635
2640
|
children: [
|
|
2636
2641
|
/* @__PURE__ */ o(
|
|
@@ -2675,7 +2680,7 @@ function $r({
|
|
|
2675
2680
|
children: d
|
|
2676
2681
|
}
|
|
2677
2682
|
),
|
|
2678
|
-
|
|
2683
|
+
u && /* @__PURE__ */ o(
|
|
2679
2684
|
"span",
|
|
2680
2685
|
{
|
|
2681
2686
|
style: {
|
|
@@ -2800,24 +2805,24 @@ function Qr({
|
|
|
2800
2805
|
paddingTop: 8,
|
|
2801
2806
|
borderTop: `1px solid ${r.borderDivider}`
|
|
2802
2807
|
},
|
|
2803
|
-
children: e.map((
|
|
2804
|
-
const
|
|
2805
|
-
|
|
2808
|
+
children: e.map((m, d) => {
|
|
2809
|
+
const u = J(
|
|
2810
|
+
m.chunks
|
|
2806
2811
|
), l = [
|
|
2807
|
-
Z(
|
|
2812
|
+
Z(m),
|
|
2808
2813
|
S(n.scoreLabel, {
|
|
2809
|
-
n:
|
|
2814
|
+
n: m.matchingChunkScore.toFixed(2)
|
|
2810
2815
|
}),
|
|
2811
|
-
|
|
2816
|
+
u.length > 0 ? Y(u, n) : n.pagesNotAvailable
|
|
2812
2817
|
].filter(
|
|
2813
2818
|
(p) => p != null && p !== ""
|
|
2814
2819
|
), h = {
|
|
2815
|
-
memoryId:
|
|
2816
|
-
memoryTitle:
|
|
2817
|
-
memoryTypeId:
|
|
2818
|
-
memoryTypeName:
|
|
2819
|
-
pageNumbers:
|
|
2820
|
-
},
|
|
2820
|
+
memoryId: m.memoryId,
|
|
2821
|
+
memoryTitle: m.memoryTitle,
|
|
2822
|
+
memoryTypeId: m.memoryTypeId,
|
|
2823
|
+
memoryTypeName: m.memoryTypeName,
|
|
2824
|
+
pageNumbers: u
|
|
2825
|
+
}, k = `${m.memoryId}-${d}`, y = a === k;
|
|
2821
2826
|
return /* @__PURE__ */ f(
|
|
2822
2827
|
"div",
|
|
2823
2828
|
{
|
|
@@ -2853,7 +2858,7 @@ function Qr({
|
|
|
2853
2858
|
whiteSpace: "pre-wrap",
|
|
2854
2859
|
wordBreak: "break-word"
|
|
2855
2860
|
},
|
|
2856
|
-
children: V(
|
|
2861
|
+
children: V(m.chunks)
|
|
2857
2862
|
}
|
|
2858
2863
|
),
|
|
2859
2864
|
/* @__PURE__ */ o(
|
|
@@ -2878,7 +2883,7 @@ function Qr({
|
|
|
2878
2883
|
"aria-busy": y,
|
|
2879
2884
|
disabled: y,
|
|
2880
2885
|
onClick: async () => {
|
|
2881
|
-
c(
|
|
2886
|
+
c(k);
|
|
2882
2887
|
try {
|
|
2883
2888
|
await t(
|
|
2884
2889
|
h
|
|
@@ -2917,7 +2922,7 @@ function Qr({
|
|
|
2917
2922
|
)
|
|
2918
2923
|
]
|
|
2919
2924
|
},
|
|
2920
|
-
|
|
2925
|
+
k
|
|
2921
2926
|
);
|
|
2922
2927
|
})
|
|
2923
2928
|
}
|
|
@@ -2930,7 +2935,7 @@ function Kr({
|
|
|
2930
2935
|
onToggle: r,
|
|
2931
2936
|
onSearchResultClick: a
|
|
2932
2937
|
}) {
|
|
2933
|
-
const { colors: c } = T(), s = e.items.map((d) => d.item),
|
|
2938
|
+
const { colors: c } = T(), s = e.items.map((d) => d.item), m = s.some((d) => d.chunks.length > 0);
|
|
2934
2939
|
return /* @__PURE__ */ f(
|
|
2935
2940
|
M.div,
|
|
2936
2941
|
{
|
|
@@ -3008,7 +3013,7 @@ function Kr({
|
|
|
3008
3013
|
children: Gr(s, t)
|
|
3009
3014
|
}
|
|
3010
3015
|
),
|
|
3011
|
-
|
|
3016
|
+
m && /* @__PURE__ */ o(
|
|
3012
3017
|
"button",
|
|
3013
3018
|
{
|
|
3014
3019
|
type: "button",
|
|
@@ -3029,7 +3034,7 @@ function Kr({
|
|
|
3029
3034
|
]
|
|
3030
3035
|
}
|
|
3031
3036
|
),
|
|
3032
|
-
n &&
|
|
3037
|
+
n && m && /* @__PURE__ */ o(
|
|
3033
3038
|
Qr,
|
|
3034
3039
|
{
|
|
3035
3040
|
items: s,
|
|
@@ -3055,14 +3060,14 @@ const Vr = ({
|
|
|
3055
3060
|
const { colors: r } = T(), a = e.items, c = a.reduce(
|
|
3056
3061
|
(y, p) => y + Te(p),
|
|
3057
3062
|
0
|
|
3058
|
-
), s = new Set(a.map((y) => y.memoryId)).size, [
|
|
3063
|
+
), s = new Set(a.map((y) => y.memoryId)).size, [m, d] = R({}), u = O((y) => {
|
|
3059
3064
|
d((p) => ({
|
|
3060
3065
|
...p,
|
|
3061
3066
|
[y]: !p[y]
|
|
3062
3067
|
}));
|
|
3063
3068
|
}, []), l = B(() => qr(a), [a]), h = s === 1 ? n.memoryChatChunkResultsInOneMemory : S(n.memoryChatChunkResultsInMemories, {
|
|
3064
3069
|
n: s
|
|
3065
|
-
}),
|
|
3070
|
+
}), k = `${Xr(c, n)} ${h}`;
|
|
3066
3071
|
return a.length === 0 ? /* @__PURE__ */ o("div", { style: { padding: "10px" }, children: /* @__PURE__ */ o(
|
|
3067
3072
|
"div",
|
|
3068
3073
|
{
|
|
@@ -3079,8 +3084,8 @@ const Vr = ({
|
|
|
3079
3084
|
{
|
|
3080
3085
|
group: y,
|
|
3081
3086
|
t: n,
|
|
3082
|
-
expanded:
|
|
3083
|
-
onToggle: () =>
|
|
3087
|
+
expanded: m[y.memoryId] === !0,
|
|
3088
|
+
onToggle: () => u(y.memoryId),
|
|
3084
3089
|
onSearchResultClick: t
|
|
3085
3090
|
},
|
|
3086
3091
|
y.memoryId
|
|
@@ -3094,7 +3099,7 @@ const Vr = ({
|
|
|
3094
3099
|
marginTop: "4px",
|
|
3095
3100
|
fontStyle: "italic"
|
|
3096
3101
|
},
|
|
3097
|
-
children:
|
|
3102
|
+
children: k
|
|
3098
3103
|
}
|
|
3099
3104
|
)
|
|
3100
3105
|
] });
|
|
@@ -3110,7 +3115,7 @@ function Jr({
|
|
|
3110
3115
|
item: e,
|
|
3111
3116
|
t
|
|
3112
3117
|
}) {
|
|
3113
|
-
const { colors: n } = T(), [r, a] = R(!1), c = e.description ?? "", s = c.length > ce,
|
|
3118
|
+
const { colors: n } = T(), [r, a] = R(!1), c = e.description ?? "", s = c.length > ce, m = c.length === 0 ? void 0 : r || !s ? c : `${c.slice(0, ce)}...`;
|
|
3114
3119
|
return /* @__PURE__ */ f(
|
|
3115
3120
|
"div",
|
|
3116
3121
|
{
|
|
@@ -3158,7 +3163,7 @@ function Jr({
|
|
|
3158
3163
|
]
|
|
3159
3164
|
}
|
|
3160
3165
|
),
|
|
3161
|
-
|
|
3166
|
+
m != null && /* @__PURE__ */ f(A, { children: [
|
|
3162
3167
|
/* @__PURE__ */ o(
|
|
3163
3168
|
"span",
|
|
3164
3169
|
{
|
|
@@ -3171,7 +3176,7 @@ function Jr({
|
|
|
3171
3176
|
wordBreak: "break-word",
|
|
3172
3177
|
cursor: s ? "pointer" : "default"
|
|
3173
3178
|
},
|
|
3174
|
-
children:
|
|
3179
|
+
children: m
|
|
3175
3180
|
}
|
|
3176
3181
|
),
|
|
3177
3182
|
s && /* @__PURE__ */ o(
|
|
@@ -3196,7 +3201,7 @@ function Zr({
|
|
|
3196
3201
|
durationSeconds: n,
|
|
3197
3202
|
t: r
|
|
3198
3203
|
}) {
|
|
3199
|
-
const { colors: a } = T(), c = e.input.countryCode, s = e.input.query,
|
|
3204
|
+
const { colors: a } = T(), c = e.input.countryCode, s = e.input.query, m = c != null && c !== "" ? S(r.googleSearchingForWithCountry, {
|
|
3200
3205
|
query: s,
|
|
3201
3206
|
country: c
|
|
3202
3207
|
}) : S(r.googleSearchingFor, {
|
|
@@ -3210,7 +3215,7 @@ function Zr({
|
|
|
3210
3215
|
initial: { opacity: 0, y: -10 },
|
|
3211
3216
|
animate: { opacity: 1, y: 0 },
|
|
3212
3217
|
transition: { duration: 0.3, delay: 0 },
|
|
3213
|
-
children: t && !n ? /* @__PURE__ */ o(F, { text:
|
|
3218
|
+
children: t && !n ? /* @__PURE__ */ o(F, { text: m, duration: 2.5, repeat: !0 }) : /* @__PURE__ */ o("span", { style: { color: a.textSecondary }, children: m })
|
|
3214
3219
|
}
|
|
3215
3220
|
),
|
|
3216
3221
|
n !== void 0 && /* @__PURE__ */ o(
|
|
@@ -3231,7 +3236,7 @@ function et({
|
|
|
3231
3236
|
data: e,
|
|
3232
3237
|
t
|
|
3233
3238
|
}) {
|
|
3234
|
-
const { colors: n } = T(), [r, a] = R(!1), c = B(() => [...e.results ?? []].sort((
|
|
3239
|
+
const { colors: n } = T(), [r, a] = R(!1), c = B(() => [...e.results ?? []].sort((u, l) => u.rank - l.rank), [e.results]), s = c.length, m = s === 1 ? t.googleResultFound : S(t.googleResultsFound, { n: s });
|
|
3235
3240
|
return s === 0 ? /* @__PURE__ */ o("div", { style: { padding: "10px" }, children: /* @__PURE__ */ o(
|
|
3236
3241
|
"div",
|
|
3237
3242
|
{
|
|
@@ -3266,7 +3271,7 @@ function et({
|
|
|
3266
3271
|
color: n.textSecondary,
|
|
3267
3272
|
whiteSpace: "nowrap"
|
|
3268
3273
|
},
|
|
3269
|
-
children:
|
|
3274
|
+
children: m
|
|
3270
3275
|
}
|
|
3271
3276
|
),
|
|
3272
3277
|
/* @__PURE__ */ o(
|
|
@@ -3301,18 +3306,18 @@ function et({
|
|
|
3301
3306
|
paddingTop: 8,
|
|
3302
3307
|
borderTop: `1px solid ${n.borderDivider}`
|
|
3303
3308
|
},
|
|
3304
|
-
children: c.map((d,
|
|
3309
|
+
children: c.map((d, u) => /* @__PURE__ */ o(
|
|
3305
3310
|
"div",
|
|
3306
3311
|
{
|
|
3307
3312
|
style: {
|
|
3308
|
-
paddingTop:
|
|
3309
|
-
paddingBottom:
|
|
3310
|
-
borderBottom:
|
|
3313
|
+
paddingTop: u > 0 ? 12 : 0,
|
|
3314
|
+
paddingBottom: u < c.length - 1 ? 12 : 0,
|
|
3315
|
+
borderBottom: u < c.length - 1 ? `1px solid ${n.border}` : void 0,
|
|
3311
3316
|
minWidth: 0
|
|
3312
3317
|
},
|
|
3313
3318
|
children: /* @__PURE__ */ o(Jr, { item: d, t })
|
|
3314
3319
|
},
|
|
3315
|
-
`${d.link}-${d.rank}-${
|
|
3320
|
+
`${d.link}-${d.rank}-${u}`
|
|
3316
3321
|
))
|
|
3317
3322
|
}
|
|
3318
3323
|
)
|
|
@@ -3376,10 +3381,10 @@ function st({
|
|
|
3376
3381
|
t,
|
|
3377
3382
|
isLatest: n = !1
|
|
3378
3383
|
}) {
|
|
3379
|
-
const { colors: r } = T(), a = e.error ?? e.summary ?? "", c = a.length > 0, s = e.error != null,
|
|
3384
|
+
const { colors: r } = T(), a = e.error ?? e.summary ?? "", c = a.length > 0, s = e.error != null, m = D(null), d = e.summary != null && e.summary !== "", u = ve(e, t), l = s || d || !c && u != null, h = e.error == null && (e.summary == null || e.summary === "");
|
|
3380
3385
|
return z(() => {
|
|
3381
|
-
const
|
|
3382
|
-
|
|
3386
|
+
const k = m.current;
|
|
3387
|
+
k != null && c && (k.scrollTop = k.scrollHeight);
|
|
3383
3388
|
}, [a, c]), /* @__PURE__ */ f(
|
|
3384
3389
|
M.div,
|
|
3385
3390
|
{
|
|
@@ -3432,16 +3437,16 @@ function st({
|
|
|
3432
3437
|
textDecoration: "none",
|
|
3433
3438
|
wordBreak: "break-all"
|
|
3434
3439
|
},
|
|
3435
|
-
onMouseEnter: (
|
|
3436
|
-
|
|
3440
|
+
onMouseEnter: (k) => {
|
|
3441
|
+
k.currentTarget.style.textDecoration = "underline";
|
|
3437
3442
|
},
|
|
3438
|
-
onMouseLeave: (
|
|
3439
|
-
|
|
3443
|
+
onMouseLeave: (k) => {
|
|
3444
|
+
k.currentTarget.style.textDecoration = "none";
|
|
3440
3445
|
},
|
|
3441
3446
|
children: Ce(e.url)
|
|
3442
3447
|
}
|
|
3443
3448
|
),
|
|
3444
|
-
!c &&
|
|
3449
|
+
!c && u != null && /* @__PURE__ */ o("div", { style: { fontSize: 12, color: r.textTertiary, minHeight: 18 }, children: n ? /* @__PURE__ */ o(F, { text: u, duration: 2.5, repeat: !0 }) : /* @__PURE__ */ o("span", { style: { color: r.textTertiary }, children: u }) }),
|
|
3445
3450
|
c && /* @__PURE__ */ o(
|
|
3446
3451
|
"div",
|
|
3447
3452
|
{
|
|
@@ -3454,7 +3459,7 @@ function st({
|
|
|
3454
3459
|
children: /* @__PURE__ */ o(
|
|
3455
3460
|
"div",
|
|
3456
3461
|
{
|
|
3457
|
-
ref:
|
|
3462
|
+
ref: m,
|
|
3458
3463
|
style: {
|
|
3459
3464
|
minHeight: nt,
|
|
3460
3465
|
maxHeight: ot,
|
|
@@ -3483,7 +3488,7 @@ function lt({
|
|
|
3483
3488
|
item: e,
|
|
3484
3489
|
t
|
|
3485
3490
|
}) {
|
|
3486
|
-
const { colors: n } = T(), [r, a] = R(!1), c = e.error ?? e.summary ?? "", s = e.error != null,
|
|
3491
|
+
const { colors: n } = T(), [r, a] = R(!1), c = e.error ?? e.summary ?? "", s = e.error != null, m = c.length > de, d = c.length === 0 ? void 0 : r || !m ? c : `${c.slice(0, de)}...`, u = ve(e, t), l = e.error == null && (e.summary == null || e.summary === "") && e.status != null;
|
|
3487
3492
|
return /* @__PURE__ */ f(
|
|
3488
3493
|
M.div,
|
|
3489
3494
|
{
|
|
@@ -3545,7 +3550,7 @@ function lt({
|
|
|
3545
3550
|
children: Ce(e.url)
|
|
3546
3551
|
}
|
|
3547
3552
|
),
|
|
3548
|
-
d == null &&
|
|
3553
|
+
d == null && u != null && /* @__PURE__ */ o(
|
|
3549
3554
|
"span",
|
|
3550
3555
|
{
|
|
3551
3556
|
style: {
|
|
@@ -3553,26 +3558,26 @@ function lt({
|
|
|
3553
3558
|
color: n.textTertiary,
|
|
3554
3559
|
lineHeight: 1.4
|
|
3555
3560
|
},
|
|
3556
|
-
children:
|
|
3561
|
+
children: u
|
|
3557
3562
|
}
|
|
3558
3563
|
),
|
|
3559
3564
|
d != null && /* @__PURE__ */ f(A, { children: [
|
|
3560
3565
|
/* @__PURE__ */ o(
|
|
3561
3566
|
"span",
|
|
3562
3567
|
{
|
|
3563
|
-
onClick:
|
|
3568
|
+
onClick: m ? () => a((h) => !h) : void 0,
|
|
3564
3569
|
style: {
|
|
3565
3570
|
fontSize: 12,
|
|
3566
3571
|
color: s ? n.textError : n.textSecondary,
|
|
3567
3572
|
lineHeight: 1.4,
|
|
3568
3573
|
whiteSpace: r ? "pre-wrap" : void 0,
|
|
3569
3574
|
wordBreak: "break-word",
|
|
3570
|
-
cursor:
|
|
3575
|
+
cursor: m ? "pointer" : "default"
|
|
3571
3576
|
},
|
|
3572
3577
|
children: d
|
|
3573
3578
|
}
|
|
3574
3579
|
),
|
|
3575
|
-
|
|
3580
|
+
m && /* @__PURE__ */ o(
|
|
3576
3581
|
"span",
|
|
3577
3582
|
{
|
|
3578
3583
|
style: {
|
|
@@ -3625,7 +3630,7 @@ function ct({
|
|
|
3625
3630
|
durationSeconds: n,
|
|
3626
3631
|
t: r
|
|
3627
3632
|
}) {
|
|
3628
|
-
const { colors: a } = T(), c = e.input.urls, s = e.input.query,
|
|
3633
|
+
const { colors: a } = T(), c = e.input.urls, s = e.input.query, m = c.length, d = m === 1 ? S(r.scrapingPage, { query: s }) : S(r.scrapingPages, { n: m, query: s });
|
|
3629
3634
|
return /* @__PURE__ */ f("div", { style: { padding: "16px" }, children: [
|
|
3630
3635
|
/* @__PURE__ */ o(
|
|
3631
3636
|
M.div,
|
|
@@ -3656,13 +3661,13 @@ function dt({
|
|
|
3656
3661
|
isLatest: t = !1,
|
|
3657
3662
|
t: n
|
|
3658
3663
|
}) {
|
|
3659
|
-
const { colors: r } = T(), [a, c] = R(!1), s = e.results ?? [], { successCount:
|
|
3660
|
-
let g = 0,
|
|
3664
|
+
const { colors: r } = T(), [a, c] = R(!1), s = e.results ?? [], { successCount: m, errorCount: d } = B(() => {
|
|
3665
|
+
let g = 0, b = 0;
|
|
3661
3666
|
for (const x of s)
|
|
3662
|
-
x.error != null ?
|
|
3663
|
-
return { successCount: g, errorCount:
|
|
3664
|
-
}, [s]),
|
|
3665
|
-
return
|
|
3667
|
+
x.error != null ? b += 1 : g += 1;
|
|
3668
|
+
return { successCount: g, errorCount: b };
|
|
3669
|
+
}, [s]), u = s.length, l = e.input.query, h = s.length > 0 && s.every((g) => tt(g)), k = t && !h ? u === 1 ? S(n.scrapingPage, { query: l }) : S(n.scrapingPages, { n: u, query: l }) : u === 1 ? n.scrapedPage : S(n.scrapedPages, { n: u }), y = S(n.scrapeOkCount, { n: m }), p = d > 0 ? `${k} - ${y}, ${S(n.scrapeFailedCount, { n: d })}` : `${k} - ${y}`;
|
|
3670
|
+
return u === 0 ? /* @__PURE__ */ o("div", { style: { padding: "10px" }, children: /* @__PURE__ */ o(
|
|
3666
3671
|
"div",
|
|
3667
3672
|
{
|
|
3668
3673
|
style: {
|
|
@@ -3887,17 +3892,17 @@ function gt({
|
|
|
3887
3892
|
const yt = ({ data: e, isLatest: t = !1, durationSeconds: n, t: r }) => {
|
|
3888
3893
|
const { colors: a } = T(), c = B(() => {
|
|
3889
3894
|
let s = -1;
|
|
3890
|
-
return e.memoryTypes.forEach((
|
|
3891
|
-
|
|
3895
|
+
return e.memoryTypes.forEach((m, d) => {
|
|
3896
|
+
m.result == null && m.error == null && (s = d);
|
|
3892
3897
|
}), s;
|
|
3893
3898
|
}, [e.memoryTypes]);
|
|
3894
3899
|
return /* @__PURE__ */ f("div", { style: { padding: "10px" }, children: [
|
|
3895
|
-
t && !n && e.memoryTypes.length === 0 ? /* @__PURE__ */ o(F, { text: r.searchingMemoryTypes, duration: 2.5, repeat: !0 }) : e.memoryTypes.map((s,
|
|
3900
|
+
t && !n && e.memoryTypes.length === 0 ? /* @__PURE__ */ o(F, { text: r.searchingMemoryTypes, duration: 2.5, repeat: !0 }) : e.memoryTypes.map((s, m) => /* @__PURE__ */ o(
|
|
3896
3901
|
gt,
|
|
3897
3902
|
{
|
|
3898
3903
|
item: s,
|
|
3899
3904
|
t: r,
|
|
3900
|
-
showShimmerForPrimary:
|
|
3905
|
+
showShimmerForPrimary: m === c && t
|
|
3901
3906
|
},
|
|
3902
3907
|
s.memoryTypeId
|
|
3903
3908
|
)),
|
|
@@ -3916,13 +3921,13 @@ const yt = ({ data: e, isLatest: t = !1, durationSeconds: n, t: r }) => {
|
|
|
3916
3921
|
] });
|
|
3917
3922
|
}, U = 12, _ = 1.45, ft = Math.ceil(
|
|
3918
3923
|
U * _
|
|
3919
|
-
),
|
|
3924
|
+
), kt = Math.ceil(
|
|
3920
3925
|
5 * U * _
|
|
3921
3926
|
);
|
|
3922
3927
|
function j(e) {
|
|
3923
3928
|
return e.queries != null && e.queries.length > 0;
|
|
3924
3929
|
}
|
|
3925
|
-
function
|
|
3930
|
+
function bt(e) {
|
|
3926
3931
|
const t = e.reasoning;
|
|
3927
3932
|
return (t == null || t === "") && !j(e);
|
|
3928
3933
|
}
|
|
@@ -3939,11 +3944,11 @@ function Tt({
|
|
|
3939
3944
|
t,
|
|
3940
3945
|
isActiveRow: n
|
|
3941
3946
|
}) {
|
|
3942
|
-
const { colors: r } = T(), a =
|
|
3947
|
+
const { colors: r } = T(), a = bt(e), c = St(e), s = e.reasoning, m = s != null && s.length > 0, d = D(null), [u, l] = R(!1), h = a && n, k = c === 2 && n && !j(e);
|
|
3943
3948
|
z(() => {
|
|
3944
3949
|
const g = d.current;
|
|
3945
|
-
g != null && c === 1 &&
|
|
3946
|
-
}, [s, c,
|
|
3950
|
+
g != null && c === 1 && m && (g.scrollTop = g.scrollHeight);
|
|
3951
|
+
}, [s, c, m]);
|
|
3947
3952
|
const y = S(t.searchingInMemoriesOfType, {
|
|
3948
3953
|
name: e.memoryTypeName
|
|
3949
3954
|
}), p = !a && c === 3;
|
|
@@ -3990,7 +3995,7 @@ function Tt({
|
|
|
3990
3995
|
},
|
|
3991
3996
|
children: [
|
|
3992
3997
|
/* @__PURE__ */ o("span", { style: { fontSize: 13, fontWeight: 500, color: r.textPrimary }, children: h ? /* @__PURE__ */ o(F, { text: y, duration: 2.5, repeat: !0 }) : e.memoryTypeName }),
|
|
3993
|
-
c === 1 &&
|
|
3998
|
+
c === 1 && m && !j(e) && /* @__PURE__ */ f("div", { style: { minWidth: 0 }, children: [
|
|
3994
3999
|
/* @__PURE__ */ o(
|
|
3995
4000
|
"span",
|
|
3996
4001
|
{
|
|
@@ -4020,7 +4025,7 @@ function Tt({
|
|
|
4020
4025
|
className: "memory-search-generating-reasoning-viewport",
|
|
4021
4026
|
style: {
|
|
4022
4027
|
minHeight: ft,
|
|
4023
|
-
maxHeight:
|
|
4028
|
+
maxHeight: kt,
|
|
4024
4029
|
height: "auto",
|
|
4025
4030
|
overflowY: "auto",
|
|
4026
4031
|
overflowX: "hidden",
|
|
@@ -4036,7 +4041,7 @@ function Tt({
|
|
|
4036
4041
|
}
|
|
4037
4042
|
)
|
|
4038
4043
|
] }),
|
|
4039
|
-
c === 2 &&
|
|
4044
|
+
c === 2 && k && /* @__PURE__ */ o("div", { style: { fontSize: 12 }, children: /* @__PURE__ */ o(
|
|
4040
4045
|
F,
|
|
4041
4046
|
{
|
|
4042
4047
|
text: t.memorySearchGeneratingQueriesPending,
|
|
@@ -4067,7 +4072,7 @@ function Tt({
|
|
|
4067
4072
|
flexDirection: "column",
|
|
4068
4073
|
gap: 6
|
|
4069
4074
|
},
|
|
4070
|
-
children: e.queries.map((g,
|
|
4075
|
+
children: e.queries.map((g, b) => /* @__PURE__ */ o(
|
|
4071
4076
|
"div",
|
|
4072
4077
|
{
|
|
4073
4078
|
style: {
|
|
@@ -4078,12 +4083,12 @@ function Tt({
|
|
|
4078
4083
|
},
|
|
4079
4084
|
children: g.query
|
|
4080
4085
|
},
|
|
4081
|
-
|
|
4086
|
+
b
|
|
4082
4087
|
))
|
|
4083
4088
|
}
|
|
4084
4089
|
)
|
|
4085
4090
|
] }),
|
|
4086
|
-
|
|
4091
|
+
m && /* @__PURE__ */ f(A, { children: [
|
|
4087
4092
|
/* @__PURE__ */ o(
|
|
4088
4093
|
"button",
|
|
4089
4094
|
{
|
|
@@ -4099,10 +4104,10 @@ function Tt({
|
|
|
4099
4104
|
color: r.textSecondary,
|
|
4100
4105
|
textDecoration: "underline"
|
|
4101
4106
|
},
|
|
4102
|
-
children:
|
|
4107
|
+
children: u ? t.memorySearchHideReasoning : t.memorySearchViewReasoning
|
|
4103
4108
|
}
|
|
4104
4109
|
),
|
|
4105
|
-
|
|
4110
|
+
u && /* @__PURE__ */ o(
|
|
4106
4111
|
"div",
|
|
4107
4112
|
{
|
|
4108
4113
|
style: {
|
|
@@ -4130,17 +4135,17 @@ function Tt({
|
|
|
4130
4135
|
const vt = ({ data: e, isLatest: t = !1, durationSeconds: n, t: r }) => {
|
|
4131
4136
|
const { colors: a } = T(), c = B(() => {
|
|
4132
4137
|
let s = -1;
|
|
4133
|
-
return e.memoryTypes.forEach((
|
|
4134
|
-
j(
|
|
4138
|
+
return e.memoryTypes.forEach((m, d) => {
|
|
4139
|
+
j(m) || (s = d);
|
|
4135
4140
|
}), s;
|
|
4136
4141
|
}, [e.memoryTypes]);
|
|
4137
4142
|
return /* @__PURE__ */ f("div", { style: { padding: "10px" }, children: [
|
|
4138
|
-
t && !n && e.memoryTypes.length === 0 ? /* @__PURE__ */ o(F, { text: r.memorySearchGeneratingQueries, duration: 2.5, repeat: !0 }) : e.memoryTypes.map((s,
|
|
4143
|
+
t && !n && e.memoryTypes.length === 0 ? /* @__PURE__ */ o(F, { text: r.memorySearchGeneratingQueries, duration: 2.5, repeat: !0 }) : e.memoryTypes.map((s, m) => /* @__PURE__ */ o(
|
|
4139
4144
|
Tt,
|
|
4140
4145
|
{
|
|
4141
4146
|
item: s,
|
|
4142
4147
|
t: r,
|
|
4143
|
-
isActiveRow:
|
|
4148
|
+
isActiveRow: m === c && t
|
|
4144
4149
|
},
|
|
4145
4150
|
s.memoryTypeId
|
|
4146
4151
|
)),
|
|
@@ -4198,7 +4203,7 @@ function Mt({
|
|
|
4198
4203
|
children: r.memorySearchExploreNoResults
|
|
4199
4204
|
}
|
|
4200
4205
|
);
|
|
4201
|
-
const
|
|
4206
|
+
const m = !!n;
|
|
4202
4207
|
return /* @__PURE__ */ o(
|
|
4203
4208
|
"div",
|
|
4204
4209
|
{
|
|
@@ -4210,17 +4215,17 @@ function Mt({
|
|
|
4210
4215
|
paddingTop: 8,
|
|
4211
4216
|
borderTop: `1px solid ${a.borderDivider}`
|
|
4212
4217
|
},
|
|
4213
|
-
children: e.map((d,
|
|
4218
|
+
children: e.map((d, u) => {
|
|
4214
4219
|
const l = d.memoryTitle !== "" ? d.memoryTitle : d.memoryId, h = J(
|
|
4215
4220
|
d.chunks
|
|
4216
|
-
),
|
|
4221
|
+
), k = [
|
|
4217
4222
|
Z(d),
|
|
4218
4223
|
S(r.scoreLabel, {
|
|
4219
4224
|
n: d.matchingChunkScore.toFixed(2)
|
|
4220
4225
|
}),
|
|
4221
4226
|
h.length > 0 ? Y(h, r) : r.pagesNotAvailable
|
|
4222
4227
|
].filter(
|
|
4223
|
-
(
|
|
4228
|
+
(b) => b != null && b !== ""
|
|
4224
4229
|
), y = {
|
|
4225
4230
|
memoryId: d.memoryId,
|
|
4226
4231
|
memoryTitle: d.memoryTitle,
|
|
@@ -4228,7 +4233,7 @@ function Mt({
|
|
|
4228
4233
|
memoryTypeId: t.memoryTypeId,
|
|
4229
4234
|
memoryTypeName: t.memoryTypeName,
|
|
4230
4235
|
query: t.query
|
|
4231
|
-
}, p = `${t.query}::${d.memoryId}::${
|
|
4236
|
+
}, p = `${t.query}::${d.memoryId}::${u}`, g = c === p;
|
|
4232
4237
|
return /* @__PURE__ */ f(
|
|
4233
4238
|
"div",
|
|
4234
4239
|
{
|
|
@@ -4237,9 +4242,9 @@ function Mt({
|
|
|
4237
4242
|
flexDirection: "row",
|
|
4238
4243
|
alignItems: "flex-start",
|
|
4239
4244
|
gap: "12px",
|
|
4240
|
-
paddingTop:
|
|
4241
|
-
paddingBottom:
|
|
4242
|
-
borderBottom:
|
|
4245
|
+
paddingTop: u > 0 ? 12 : 0,
|
|
4246
|
+
paddingBottom: u < e.length - 1 ? 12 : 0,
|
|
4247
|
+
borderBottom: u < e.length - 1 ? `1px solid ${a.border}` : void 0,
|
|
4243
4248
|
minWidth: 0
|
|
4244
4249
|
},
|
|
4245
4250
|
children: [
|
|
@@ -4289,13 +4294,13 @@ function Mt({
|
|
|
4289
4294
|
color: a.textMuted,
|
|
4290
4295
|
lineHeight: 1.35
|
|
4291
4296
|
},
|
|
4292
|
-
children:
|
|
4297
|
+
children: k.join(" · ")
|
|
4293
4298
|
}
|
|
4294
4299
|
)
|
|
4295
4300
|
]
|
|
4296
4301
|
}
|
|
4297
4302
|
),
|
|
4298
|
-
|
|
4303
|
+
m && /* @__PURE__ */ f(
|
|
4299
4304
|
"button",
|
|
4300
4305
|
{
|
|
4301
4306
|
type: "button",
|
|
@@ -4341,7 +4346,7 @@ function Mt({
|
|
|
4341
4346
|
)
|
|
4342
4347
|
]
|
|
4343
4348
|
},
|
|
4344
|
-
`${d.memoryId}-${
|
|
4349
|
+
`${d.memoryId}-${u}`
|
|
4345
4350
|
);
|
|
4346
4351
|
})
|
|
4347
4352
|
}
|
|
@@ -4366,8 +4371,8 @@ function Et({
|
|
|
4366
4371
|
toggleExpanded: a,
|
|
4367
4372
|
onExploreQueryResultClick: c
|
|
4368
4373
|
}) {
|
|
4369
|
-
const { colors: s } = T(),
|
|
4370
|
-
(
|
|
4374
|
+
const { colors: s } = T(), m = e.items.map((u) => u.item), d = m.some(
|
|
4375
|
+
(u) => u.result == null && u.error == null
|
|
4371
4376
|
);
|
|
4372
4377
|
return /* @__PURE__ */ f(
|
|
4373
4378
|
M.div,
|
|
@@ -4397,7 +4402,7 @@ function Et({
|
|
|
4397
4402
|
width: 32,
|
|
4398
4403
|
...d ? {} : { paddingTop: 2 }
|
|
4399
4404
|
},
|
|
4400
|
-
children: Ct(
|
|
4405
|
+
children: Ct(m)
|
|
4401
4406
|
}
|
|
4402
4407
|
),
|
|
4403
4408
|
/* @__PURE__ */ f(
|
|
@@ -4423,9 +4428,9 @@ function Et({
|
|
|
4423
4428
|
})
|
|
4424
4429
|
}
|
|
4425
4430
|
),
|
|
4426
|
-
e.items.map(({ item:
|
|
4427
|
-
var
|
|
4428
|
-
const h =
|
|
4431
|
+
e.items.map(({ item: u, flatIndex: l }) => {
|
|
4432
|
+
var b;
|
|
4433
|
+
const h = u.result != null, k = u.error != null, y = n && !h && !k, p = r[l] === !0, g = ((b = u.result) == null ? void 0 : b.items) ?? [];
|
|
4429
4434
|
return /* @__PURE__ */ f(
|
|
4430
4435
|
"div",
|
|
4431
4436
|
{
|
|
@@ -4462,11 +4467,11 @@ function Et({
|
|
|
4462
4467
|
children: y ? /* @__PURE__ */ o(
|
|
4463
4468
|
F,
|
|
4464
4469
|
{
|
|
4465
|
-
text:
|
|
4470
|
+
text: u.query,
|
|
4466
4471
|
duration: 2.5,
|
|
4467
4472
|
repeat: !0
|
|
4468
4473
|
}
|
|
4469
|
-
) :
|
|
4474
|
+
) : u.query
|
|
4470
4475
|
}
|
|
4471
4476
|
),
|
|
4472
4477
|
/* @__PURE__ */ f(
|
|
@@ -4480,7 +4485,7 @@ function Et({
|
|
|
4480
4485
|
flexShrink: 0
|
|
4481
4486
|
},
|
|
4482
4487
|
children: [
|
|
4483
|
-
/* @__PURE__ */ o(wt, { item:
|
|
4488
|
+
/* @__PURE__ */ o(wt, { item: u, t }),
|
|
4484
4489
|
h && /* @__PURE__ */ o(
|
|
4485
4490
|
"button",
|
|
4486
4491
|
{
|
|
@@ -4509,14 +4514,14 @@ function Et({
|
|
|
4509
4514
|
Mt,
|
|
4510
4515
|
{
|
|
4511
4516
|
items: g,
|
|
4512
|
-
queryRow:
|
|
4517
|
+
queryRow: u,
|
|
4513
4518
|
onExploreQueryResultClick: c,
|
|
4514
4519
|
t
|
|
4515
4520
|
}
|
|
4516
4521
|
)
|
|
4517
4522
|
]
|
|
4518
4523
|
},
|
|
4519
|
-
`${e.memoryTypeId}-${l}-${
|
|
4524
|
+
`${e.memoryTypeId}-${l}-${u.query}`
|
|
4520
4525
|
);
|
|
4521
4526
|
})
|
|
4522
4527
|
]
|
|
@@ -4533,14 +4538,14 @@ const Rt = ({
|
|
|
4533
4538
|
onExploreQueryResultClick: r,
|
|
4534
4539
|
t: a
|
|
4535
4540
|
}) => {
|
|
4536
|
-
const { colors: c } = T(), [s,
|
|
4541
|
+
const { colors: c } = T(), [s, m] = R(
|
|
4537
4542
|
{}
|
|
4538
4543
|
), d = O((l) => {
|
|
4539
|
-
|
|
4544
|
+
m((h) => ({
|
|
4540
4545
|
...h,
|
|
4541
4546
|
[l]: !h[l]
|
|
4542
4547
|
}));
|
|
4543
|
-
}, []),
|
|
4548
|
+
}, []), u = B(
|
|
4544
4549
|
() => It(e.queries),
|
|
4545
4550
|
[e.queries]
|
|
4546
4551
|
);
|
|
@@ -4552,7 +4557,7 @@ const Rt = ({
|
|
|
4552
4557
|
duration: 2.5,
|
|
4553
4558
|
repeat: !0
|
|
4554
4559
|
}
|
|
4555
|
-
) :
|
|
4560
|
+
) : u.map((l) => /* @__PURE__ */ o(
|
|
4556
4561
|
Et,
|
|
4557
4562
|
{
|
|
4558
4563
|
group: l,
|
|
@@ -4578,7 +4583,7 @@ const Rt = ({
|
|
|
4578
4583
|
)
|
|
4579
4584
|
] });
|
|
4580
4585
|
}, Ft = ({ data: e, onSearchResultClick: t, t: n }) => {
|
|
4581
|
-
const { colors: r } = T(), a = e.response.items, c = !!t, [s,
|
|
4586
|
+
const { colors: r } = T(), a = e.response.items, c = !!t, [s, m] = R(null);
|
|
4582
4587
|
return /* @__PURE__ */ f("div", { style: { padding: "16px" }, children: [
|
|
4583
4588
|
/* @__PURE__ */ o(
|
|
4584
4589
|
M.div,
|
|
@@ -4603,30 +4608,30 @@ const Rt = ({
|
|
|
4603
4608
|
flexDirection: "column",
|
|
4604
4609
|
gap: 0
|
|
4605
4610
|
},
|
|
4606
|
-
children: a.map((d,
|
|
4611
|
+
children: a.map((d, u) => {
|
|
4607
4612
|
const l = d.memoryTitle !== "" ? d.memoryTitle : d.memoryId, h = J(
|
|
4608
4613
|
d.chunks
|
|
4609
|
-
),
|
|
4614
|
+
), k = [
|
|
4610
4615
|
Z(d),
|
|
4611
4616
|
S(n.scoreLabel, {
|
|
4612
4617
|
n: d.matchingChunkScore.toFixed(2)
|
|
4613
4618
|
}),
|
|
4614
4619
|
h.length > 0 ? Y(h, n) : n.pagesNotAvailable
|
|
4615
4620
|
].filter(
|
|
4616
|
-
(
|
|
4621
|
+
(b) => b != null && b !== ""
|
|
4617
4622
|
), y = {
|
|
4618
4623
|
memoryId: d.memoryId,
|
|
4619
4624
|
memoryTitle: d.memoryTitle,
|
|
4620
4625
|
memoryTypeId: d.memoryTypeId,
|
|
4621
4626
|
memoryTypeName: d.memoryTypeName,
|
|
4622
4627
|
pageNumbers: h
|
|
4623
|
-
}, p = `${d.memoryId}-${
|
|
4628
|
+
}, p = `${d.memoryId}-${u}`, g = s === p;
|
|
4624
4629
|
return /* @__PURE__ */ f(
|
|
4625
4630
|
M.div,
|
|
4626
4631
|
{
|
|
4627
4632
|
initial: { opacity: 0 },
|
|
4628
4633
|
animate: { opacity: 1 },
|
|
4629
|
-
transition: { duration: 0.2, delay:
|
|
4634
|
+
transition: { duration: 0.2, delay: u * 0.04 },
|
|
4630
4635
|
style: {
|
|
4631
4636
|
display: "flex",
|
|
4632
4637
|
flexDirection: "row",
|
|
@@ -4634,7 +4639,7 @@ const Rt = ({
|
|
|
4634
4639
|
gap: "12px",
|
|
4635
4640
|
paddingTop: "12px",
|
|
4636
4641
|
paddingBottom: "12px",
|
|
4637
|
-
borderBottom:
|
|
4642
|
+
borderBottom: u < a.length - 1 ? `1px solid ${r.border}` : void 0,
|
|
4638
4643
|
minWidth: 0
|
|
4639
4644
|
},
|
|
4640
4645
|
children: [
|
|
@@ -4682,7 +4687,7 @@ const Rt = ({
|
|
|
4682
4687
|
color: r.textMuted,
|
|
4683
4688
|
lineHeight: 1.35
|
|
4684
4689
|
},
|
|
4685
|
-
children:
|
|
4690
|
+
children: k.join(" · ")
|
|
4686
4691
|
}
|
|
4687
4692
|
)
|
|
4688
4693
|
]
|
|
@@ -4695,11 +4700,11 @@ const Rt = ({
|
|
|
4695
4700
|
"aria-busy": g,
|
|
4696
4701
|
disabled: g,
|
|
4697
4702
|
onClick: async () => {
|
|
4698
|
-
|
|
4703
|
+
m(p);
|
|
4699
4704
|
try {
|
|
4700
4705
|
await t(y);
|
|
4701
4706
|
} finally {
|
|
4702
|
-
|
|
4707
|
+
m(null);
|
|
4703
4708
|
}
|
|
4704
4709
|
},
|
|
4705
4710
|
style: {
|
|
@@ -4732,7 +4737,7 @@ const Rt = ({
|
|
|
4732
4737
|
)
|
|
4733
4738
|
]
|
|
4734
4739
|
},
|
|
4735
|
-
`${d.memoryId}-${
|
|
4740
|
+
`${d.memoryId}-${u}`
|
|
4736
4741
|
);
|
|
4737
4742
|
})
|
|
4738
4743
|
}
|
|
@@ -4792,9 +4797,9 @@ const Pt = ({
|
|
|
4792
4797
|
t: a,
|
|
4793
4798
|
onSourceClick: c,
|
|
4794
4799
|
onSearchResultClick: s,
|
|
4795
|
-
onExploreQueryResultClick:
|
|
4800
|
+
onExploreQueryResultClick: m
|
|
4796
4801
|
}) => {
|
|
4797
|
-
const { theme: d, colors:
|
|
4802
|
+
const { theme: d, colors: u } = T(), l = D(null);
|
|
4798
4803
|
z(() => {
|
|
4799
4804
|
l.current && (l.current.scrollTop = l.current.scrollHeight);
|
|
4800
4805
|
}, [e.length]);
|
|
@@ -4934,7 +4939,7 @@ const Pt = ({
|
|
|
4934
4939
|
data: p,
|
|
4935
4940
|
isLatest: y.isLatest,
|
|
4936
4941
|
durationSeconds: y.durationSeconds,
|
|
4937
|
-
onExploreQueryResultClick:
|
|
4942
|
+
onExploreQueryResultClick: m,
|
|
4938
4943
|
t: a
|
|
4939
4944
|
}
|
|
4940
4945
|
);
|
|
@@ -4976,11 +4981,11 @@ const Pt = ({
|
|
|
4976
4981
|
duration: 1.5,
|
|
4977
4982
|
repeat: !0,
|
|
4978
4983
|
repeatDelay: 0,
|
|
4979
|
-
color:
|
|
4980
|
-
shimmerColor:
|
|
4984
|
+
color: u.shimmerBase,
|
|
4985
|
+
shimmerColor: u.shimmerHighlight
|
|
4981
4986
|
}
|
|
4982
4987
|
) }) : null;
|
|
4983
|
-
const
|
|
4988
|
+
const k = e.filter((y, p) => {
|
|
4984
4989
|
const g = y.item.data;
|
|
4985
4990
|
return g.taskType === "MemoryChat" && g.eventType === "ExploreMemories" ? !e.slice(p + 1).some(
|
|
4986
4991
|
(v) => v.item.data.taskType === "MemoryChat" && v.item.data.eventType === "ExploreMemories"
|
|
@@ -5005,7 +5010,7 @@ const Pt = ({
|
|
|
5005
5010
|
ref: l,
|
|
5006
5011
|
"data-theme": d,
|
|
5007
5012
|
children: [
|
|
5008
|
-
/* @__PURE__ */ o(Pe, { children:
|
|
5013
|
+
/* @__PURE__ */ o(Pe, { children: k.map((y, p) => /* @__PURE__ */ o(
|
|
5009
5014
|
M.div,
|
|
5010
5015
|
{
|
|
5011
5016
|
id: `agent-task-progress-item-${y.item.progressItemId}`,
|
|
@@ -5038,7 +5043,7 @@ const Pt = ({
|
|
|
5038
5043
|
onSearchResultClick: a,
|
|
5039
5044
|
onExploreQueryResultClick: c
|
|
5040
5045
|
}) => {
|
|
5041
|
-
const s = wr(e),
|
|
5046
|
+
const s = wr(e), m = (e.params.type === "MemoryChat" || e.params.type === "MemorySearch") && "language" in e.params ? e.params.language ?? "en" : n ?? "en", d = Pr(m);
|
|
5042
5047
|
return /* @__PURE__ */ o(Rr, { theme: t, children: /* @__PURE__ */ o(
|
|
5043
5048
|
Pt,
|
|
5044
5049
|
{
|
|
@@ -5063,7 +5068,7 @@ export {
|
|
|
5063
5068
|
$ as XMark,
|
|
5064
5069
|
Er as darkAgentTaskThemeColors,
|
|
5065
5070
|
xe as getAgentTaskPrismStyle,
|
|
5066
|
-
|
|
5071
|
+
be as lightAgentTaskThemeColors,
|
|
5067
5072
|
T as useAgentTaskTheme,
|
|
5068
5073
|
Ht as useAgentTasks
|
|
5069
5074
|
};
|