@fencyai/react 0.1.158 → 0.1.160
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/agent-task/AgentTaskMemoryClickPayload.d.ts +6 -3
- package/dist/agent-task/AgentTaskMemoryClickPayload.d.ts.map +1 -1
- package/dist/agent-task/data-types/{MemoryChatCompletionChunkResult.d.ts → MemoryChatChunkResult.d.ts} +4 -4
- package/dist/agent-task/data-types/MemoryChatChunkResult.d.ts.map +1 -0
- package/dist/agent-task/data-types/{MemoryChatCompletionExploreMemories.d.ts → MemoryChatExploreMemories.d.ts} +4 -4
- package/dist/agent-task/data-types/MemoryChatExploreMemories.d.ts.map +1 -0
- package/dist/agent-task/data-types/{MemoryChatCompletionFindMemories.d.ts → MemoryChatFindMemories.d.ts} +4 -4
- package/dist/agent-task/data-types/MemoryChatFindMemories.d.ts.map +1 -0
- package/dist/agent-task/data-types/MemoryChatFindMemoriesResult.d.ts +12 -0
- package/dist/agent-task/data-types/MemoryChatFindMemoriesResult.d.ts.map +1 -0
- package/dist/agent-task/data-types/{MemoryChatCompletionFindSources.d.ts → MemoryChatFindSources.d.ts} +4 -4
- package/dist/agent-task/data-types/MemoryChatFindSources.d.ts.map +1 -0
- package/dist/agent-task/data-types/{MemoryChatCompletionSearch.d.ts → MemoryChatSearch.d.ts} +4 -4
- package/dist/agent-task/data-types/MemoryChatSearch.d.ts.map +1 -0
- package/dist/agent-task/data-types/{MemoryChatCompletionSourcesResult.d.ts → MemoryChatSourcesResult.d.ts} +4 -4
- package/dist/agent-task/data-types/MemoryChatSourcesResult.d.ts.map +1 -0
- package/dist/agent-task/data-types/MemorySearchCompletedResults.d.ts.map +1 -1
- package/dist/assets/index.css +1 -1
- package/dist/index.js +152 -139
- package/dist/types/CreateAgentTaskParams.d.ts +1 -1
- package/dist/types/CreateAgentTaskParams.d.ts.map +1 -1
- package/dist/types/CreateAgentTaskResponse.d.ts +1 -1
- package/dist/types/CreateAgentTaskResponse.d.ts.map +1 -1
- package/dist/types/UseAgentTasksProps.d.ts +1 -1
- package/dist/types/UseAgentTasksProps.d.ts.map +1 -1
- package/package.json +4 -4
- package/dist/agent-task/data-types/MemoryChatCompletionChunkResult.d.ts.map +0 -1
- package/dist/agent-task/data-types/MemoryChatCompletionExploreMemories.d.ts.map +0 -1
- package/dist/agent-task/data-types/MemoryChatCompletionFindMemories.d.ts.map +0 -1
- package/dist/agent-task/data-types/MemoryChatCompletionFindMemoriesResult.d.ts +0 -12
- package/dist/agent-task/data-types/MemoryChatCompletionFindMemoriesResult.d.ts.map +0 -1
- package/dist/agent-task/data-types/MemoryChatCompletionFindSources.d.ts.map +0 -1
- package/dist/agent-task/data-types/MemoryChatCompletionSearch.d.ts.map +0 -1
- package/dist/agent-task/data-types/MemoryChatCompletionSourcesResult.d.ts.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as p, jsx as i, Fragment as E } from "react/jsx-runtime";
|
|
2
2
|
import { createStream as ie, isStreamTimeoutEvent as ae, isStreamNotFoundEvent as se, isAgentTaskProgressItemUpdatedEvent as le, createAgentTask as ce } from "@fencyai/js";
|
|
3
3
|
import { createContext as de, useState as b, useRef as A, useEffect as M, useCallback as G, useContext as me, useMemo as D } from "react";
|
|
4
4
|
import { useInView as ue, motion as T, AnimatePresence as X } from "motion/react";
|
|
5
|
-
import
|
|
5
|
+
import ye from "react-markdown";
|
|
6
6
|
import { Prism as J } from "react-syntax-highlighter";
|
|
7
|
-
import
|
|
7
|
+
import pe from "remark-gfm";
|
|
8
8
|
import './assets/index.css';const Y = de(
|
|
9
9
|
void 0
|
|
10
10
|
);
|
|
@@ -94,14 +94,14 @@ function ke(e, r) {
|
|
|
94
94
|
return new Promise((u, g) => {
|
|
95
95
|
const f = Object.assign({}, t);
|
|
96
96
|
f.accept || (f.accept = _);
|
|
97
|
-
let
|
|
97
|
+
let y;
|
|
98
98
|
function S() {
|
|
99
|
-
|
|
99
|
+
y.abort(), document.hidden || R();
|
|
100
100
|
}
|
|
101
101
|
m || document.addEventListener("visibilitychange", S);
|
|
102
102
|
let h = Te, k = 0;
|
|
103
103
|
function v() {
|
|
104
|
-
document.removeEventListener("visibilitychange", S), window.clearTimeout(k),
|
|
104
|
+
document.removeEventListener("visibilitychange", S), window.clearTimeout(k), y.abort();
|
|
105
105
|
}
|
|
106
106
|
n == null || n.addEventListener("abort", () => {
|
|
107
107
|
v(), u();
|
|
@@ -109,16 +109,16 @@ function ke(e, r) {
|
|
|
109
109
|
const F = o ?? window.fetch, w = l ?? be;
|
|
110
110
|
async function R() {
|
|
111
111
|
var L;
|
|
112
|
-
|
|
112
|
+
y = new AbortController();
|
|
113
113
|
try {
|
|
114
|
-
const P = await F(e, Object.assign(Object.assign({}, a), { headers: f, signal:
|
|
114
|
+
const P = await F(e, Object.assign(Object.assign({}, a), { headers: f, signal: y.signal }));
|
|
115
115
|
await w(P), await ge(P.body, he(fe((I) => {
|
|
116
116
|
I ? f[U] = I : delete f[U];
|
|
117
117
|
}, (I) => {
|
|
118
118
|
h = I;
|
|
119
119
|
}, c))), s == null || s(), v(), u();
|
|
120
120
|
} catch (P) {
|
|
121
|
-
if (!
|
|
121
|
+
if (!y.signal.aborted)
|
|
122
122
|
try {
|
|
123
123
|
const I = (L = d == null ? void 0 : d(P)) !== null && L !== void 0 ? L : h;
|
|
124
124
|
window.clearTimeout(k), k = window.setTimeout(R, I);
|
|
@@ -266,18 +266,18 @@ function Ir({ fency: e, fetchCreateStreamClientToken: r, children: n }) {
|
|
|
266
266
|
[t, o]
|
|
267
267
|
);
|
|
268
268
|
if (d)
|
|
269
|
-
return /* @__PURE__ */
|
|
269
|
+
return /* @__PURE__ */ p("div", { children: [
|
|
270
270
|
"Fency error: ",
|
|
271
271
|
d.message
|
|
272
272
|
] });
|
|
273
273
|
if (!t)
|
|
274
274
|
return null;
|
|
275
|
-
const
|
|
275
|
+
const y = o.length > 0 ? o[o.length - 1] : null, S = {
|
|
276
276
|
fency: t,
|
|
277
277
|
loading: c,
|
|
278
278
|
error: d,
|
|
279
279
|
activeStreams: o,
|
|
280
|
-
latestStream:
|
|
280
|
+
latestStream: y,
|
|
281
281
|
eventManager: g.current,
|
|
282
282
|
getOrCreateStream: f
|
|
283
283
|
};
|
|
@@ -374,7 +374,7 @@ const Ie = (e) => {
|
|
|
374
374
|
var g;
|
|
375
375
|
if (!l.current.has(o.agentTaskId)) return;
|
|
376
376
|
const a = o.data;
|
|
377
|
-
if (a.taskType === "StreamingChatCompletion" && a.eventType === "Completed" || a.taskType === "StructuredChatCompletion" && a.eventType === "Completed" || a.taskType === "
|
|
377
|
+
if (a.taskType === "StreamingChatCompletion" && a.eventType === "Completed" || a.taskType === "StructuredChatCompletion" && a.eventType === "Completed" || a.taskType === "MemoryChat" && a.eventType === "Completed" || a.taskType === "MemorySearch" && a.eventType === "Completed") {
|
|
378
378
|
const f = a.taskType === "MemorySearch" && a.eventType === "Completed" || a.taskType === "StructuredChatCompletion" && a.eventType === "Completed";
|
|
379
379
|
t(
|
|
380
380
|
f ? (S) => S.map((h) => {
|
|
@@ -398,23 +398,23 @@ const Ie = (e) => {
|
|
|
398
398
|
}
|
|
399
399
|
)
|
|
400
400
|
);
|
|
401
|
-
const
|
|
401
|
+
const y = c.current.get(
|
|
402
402
|
o.agentTaskId
|
|
403
403
|
);
|
|
404
|
-
|
|
404
|
+
y && (c.current.delete(o.agentTaskId), y(a));
|
|
405
405
|
return;
|
|
406
406
|
}
|
|
407
407
|
(g = e.onAgentTaskProgressItemUpdated) == null || g.call(e, o), t(
|
|
408
|
-
(f) => f.map((
|
|
408
|
+
(f) => f.map((y) => {
|
|
409
409
|
var k;
|
|
410
|
-
if (((k =
|
|
411
|
-
return
|
|
412
|
-
const h =
|
|
410
|
+
if (((k = y.confirmedData) == null ? void 0 : k.taskId) !== o.agentTaskId)
|
|
411
|
+
return y;
|
|
412
|
+
const h = y.progressItems.some(
|
|
413
413
|
(v) => v.progressItemId === o.progressItemId
|
|
414
|
-
) ?
|
|
414
|
+
) ? y.progressItems.map(
|
|
415
415
|
(v) => v.progressItemId === o.progressItemId ? o : v
|
|
416
|
-
) : [...
|
|
417
|
-
return { ...
|
|
416
|
+
) : [...y.progressItems, o];
|
|
417
|
+
return { ...y, progressItems: h };
|
|
418
418
|
})
|
|
419
419
|
);
|
|
420
420
|
},
|
|
@@ -458,7 +458,7 @@ const Ie = (e) => {
|
|
|
458
458
|
loadingText: a == null ? void 0 : a.loadingText
|
|
459
459
|
}
|
|
460
460
|
]);
|
|
461
|
-
const { clientToken: f } = await e.fetchCreateAgentTaskClientToken(o.type),
|
|
461
|
+
const { clientToken: f } = await e.fetchCreateAgentTaskClientToken(o.type), y = await ce({
|
|
462
462
|
pk: r.fency.publishableKey,
|
|
463
463
|
baseUrl: r.fency.baseUrl,
|
|
464
464
|
clientToken: f,
|
|
@@ -473,7 +473,7 @@ const Ie = (e) => {
|
|
|
473
473
|
jsonSchema: o.jsonSchema,
|
|
474
474
|
model: o.model
|
|
475
475
|
} : void 0,
|
|
476
|
-
|
|
476
|
+
memoryChatTask: o.type === "MemoryChat" ? {
|
|
477
477
|
messages: o.messages,
|
|
478
478
|
model: o.model,
|
|
479
479
|
language: o.language ?? "en",
|
|
@@ -492,42 +492,42 @@ const Ie = (e) => {
|
|
|
492
492
|
} : void 0
|
|
493
493
|
}
|
|
494
494
|
});
|
|
495
|
-
if (
|
|
495
|
+
if (y.type === "success" && y.agentTask) {
|
|
496
496
|
l.current.add(
|
|
497
|
-
|
|
497
|
+
y.agentTask.id
|
|
498
498
|
), t((h) => [
|
|
499
499
|
...h.filter((k) => k.taskKey !== u),
|
|
500
500
|
{
|
|
501
501
|
taskKey: u,
|
|
502
502
|
streamId: g.stream.id,
|
|
503
503
|
triggeredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
504
|
-
taskId:
|
|
505
|
-
createdAt:
|
|
504
|
+
taskId: y.agentTask.id,
|
|
505
|
+
createdAt: y.agentTask.createdAt,
|
|
506
506
|
error: null,
|
|
507
507
|
params: o,
|
|
508
508
|
progressItems: [],
|
|
509
509
|
loading: !0,
|
|
510
510
|
loadingText: a == null ? void 0 : a.loadingText,
|
|
511
511
|
confirmedData: {
|
|
512
|
-
taskId:
|
|
513
|
-
createdAt:
|
|
512
|
+
taskId: y.agentTask.id,
|
|
513
|
+
createdAt: y.agentTask.createdAt
|
|
514
514
|
}
|
|
515
515
|
}
|
|
516
516
|
]);
|
|
517
517
|
const S = await new Promise((h) => {
|
|
518
518
|
c.current.set(
|
|
519
|
-
|
|
519
|
+
y.agentTask.id,
|
|
520
520
|
h
|
|
521
521
|
);
|
|
522
522
|
});
|
|
523
523
|
return {
|
|
524
524
|
type: "success",
|
|
525
525
|
streamId: g.stream.id,
|
|
526
|
-
agentTaskId:
|
|
526
|
+
agentTaskId: y.agentTask.id,
|
|
527
527
|
response: S
|
|
528
528
|
};
|
|
529
529
|
} else {
|
|
530
|
-
if (
|
|
530
|
+
if (y.type === "error")
|
|
531
531
|
return t((S) => [
|
|
532
532
|
...S.filter((h) => h.taskKey !== u),
|
|
533
533
|
{
|
|
@@ -535,7 +535,7 @@ const Ie = (e) => {
|
|
|
535
535
|
triggeredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
536
536
|
streamId: g.stream.id,
|
|
537
537
|
params: o,
|
|
538
|
-
error:
|
|
538
|
+
error: y.error,
|
|
539
539
|
progressItems: [],
|
|
540
540
|
loading: !1,
|
|
541
541
|
loadingText: a == null ? void 0 : a.loadingText,
|
|
@@ -543,7 +543,7 @@ const Ie = (e) => {
|
|
|
543
543
|
}
|
|
544
544
|
]), {
|
|
545
545
|
type: "error",
|
|
546
|
-
error:
|
|
546
|
+
error: y.error
|
|
547
547
|
};
|
|
548
548
|
{
|
|
549
549
|
const S = {
|
|
@@ -616,7 +616,7 @@ function C({
|
|
|
616
616
|
shimmerColor: u = "#000",
|
|
617
617
|
direction: g = "fromBottom"
|
|
618
618
|
}) {
|
|
619
|
-
const f = A(null),
|
|
619
|
+
const f = A(null), y = ue(f, { once: d, margin: m }), S = D(() => e.length * o, [e, o]), h = !s || y, k = g === "fromBottom" ? "100% center" : "-100% center", v = g === "fromBottom" ? "0% center" : "200% center";
|
|
620
620
|
return /* @__PURE__ */ i(
|
|
621
621
|
T.span,
|
|
622
622
|
{
|
|
@@ -683,7 +683,7 @@ function Le(e, r) {
|
|
|
683
683
|
case "Completed":
|
|
684
684
|
return r.completed;
|
|
685
685
|
}
|
|
686
|
-
if (n.taskType === "
|
|
686
|
+
if (n.taskType === "MemoryChat")
|
|
687
687
|
switch (n.eventType) {
|
|
688
688
|
case "Text":
|
|
689
689
|
return r.streaming;
|
|
@@ -899,9 +899,9 @@ const ze = ({ progressViewItems: e, t: r }) => {
|
|
|
899
899
|
animate: { opacity: 1, y: 0 },
|
|
900
900
|
transition: { duration: 0.3, delay: 0 },
|
|
901
901
|
children: /* @__PURE__ */ i(
|
|
902
|
-
|
|
902
|
+
ye,
|
|
903
903
|
{
|
|
904
|
-
remarkPlugins: [
|
|
904
|
+
remarkPlugins: [pe],
|
|
905
905
|
components: {
|
|
906
906
|
code(r) {
|
|
907
907
|
const { children: n, className: t, node: l, ref: c, ...s } = r, d = /language-(\w+)/.exec(t || "");
|
|
@@ -939,7 +939,7 @@ const ze = ({ progressViewItems: e, t: r }) => {
|
|
|
939
939
|
children: /* @__PURE__ */ i(J, { language: "json", style: ee, PreTag: "div", children: r })
|
|
940
940
|
}
|
|
941
941
|
) });
|
|
942
|
-
},
|
|
942
|
+
}, Ne = {
|
|
943
943
|
en: {
|
|
944
944
|
error: "Error",
|
|
945
945
|
streaming: "Streaming...",
|
|
@@ -1059,8 +1059,8 @@ const ze = ({ progressViewItems: e, t: r }) => {
|
|
|
1059
1059
|
memorySearchExploreNoResults: "Ingen resultater funnet"
|
|
1060
1060
|
}
|
|
1061
1061
|
};
|
|
1062
|
-
function
|
|
1063
|
-
return
|
|
1062
|
+
function Be(e) {
|
|
1063
|
+
return Ne[e];
|
|
1064
1064
|
}
|
|
1065
1065
|
function x(e, r) {
|
|
1066
1066
|
return Object.entries(r).reduce(
|
|
@@ -1077,11 +1077,11 @@ function Q(e, r) {
|
|
|
1077
1077
|
return n.join(", ");
|
|
1078
1078
|
}
|
|
1079
1079
|
const W = 5, We = ({ data: e, isLatest: r = !1, durationSeconds: n, t }) => {
|
|
1080
|
-
const [l, c] = b(!1), d = (e.memories ?? []).map((h) => h.memoryTitle), m = d.length > 0, o = m && d.length > W, a = o && !l ? d.slice(0, W) : d, u = d.length - W, g = !o || l, f = `${t.searchingFor}'${e.queryDescription}'`,
|
|
1080
|
+
const [l, c] = b(!1), d = (e.memories ?? []).map((h) => h.memoryTitle), m = d.length > 0, o = m && d.length > W, a = o && !l ? d.slice(0, W) : d, u = d.length - W, g = !o || l, f = `${t.searchingFor}'${e.queryDescription}'`, y = m ? `${t.searchingIn}${Q(
|
|
1081
1081
|
a,
|
|
1082
1082
|
g ? t.and : void 0
|
|
1083
|
-
)}` : "", S = m ? `${f}${
|
|
1084
|
-
return /* @__PURE__ */
|
|
1083
|
+
)}` : "", S = m ? `${f}${y}` : `${t.searchingPrefix}${e.queryDescription}`;
|
|
1084
|
+
return /* @__PURE__ */ p("div", { style: { padding: "16px" }, children: [
|
|
1085
1085
|
/* @__PURE__ */ i(
|
|
1086
1086
|
T.div,
|
|
1087
1087
|
{
|
|
@@ -1098,17 +1098,17 @@ const W = 5, We = ({ data: e, isLatest: r = !1, durationSeconds: n, t }) => {
|
|
|
1098
1098
|
color: "#999",
|
|
1099
1099
|
shimmerColor: "#000"
|
|
1100
1100
|
}
|
|
1101
|
-
) : /* @__PURE__ */
|
|
1102
|
-
/* @__PURE__ */ i("span", { style: { color: "#666" }, children: m ? /* @__PURE__ */
|
|
1101
|
+
) : /* @__PURE__ */ p(E, { children: [
|
|
1102
|
+
/* @__PURE__ */ i("span", { style: { color: "#666" }, children: m ? /* @__PURE__ */ p(E, { children: [
|
|
1103
1103
|
t.searchingFor,
|
|
1104
|
-
/* @__PURE__ */
|
|
1104
|
+
/* @__PURE__ */ p("span", { style: { fontWeight: 600 }, children: [
|
|
1105
1105
|
"'",
|
|
1106
1106
|
e.queryDescription,
|
|
1107
1107
|
"'"
|
|
1108
1108
|
] }),
|
|
1109
|
-
|
|
1109
|
+
y
|
|
1110
1110
|
] }) : `${t.searchingPrefix}${e.queryDescription}` }),
|
|
1111
|
-
o && !l && /* @__PURE__ */
|
|
1111
|
+
o && !l && /* @__PURE__ */ p(E, { children: [
|
|
1112
1112
|
" ",
|
|
1113
1113
|
/* @__PURE__ */ i(
|
|
1114
1114
|
"button",
|
|
@@ -1132,7 +1132,7 @@ const W = 5, We = ({ data: e, isLatest: r = !1, durationSeconds: n, t }) => {
|
|
|
1132
1132
|
}
|
|
1133
1133
|
)
|
|
1134
1134
|
] }),
|
|
1135
|
-
o && l && /* @__PURE__ */
|
|
1135
|
+
o && l && /* @__PURE__ */ p(E, { children: [
|
|
1136
1136
|
" ",
|
|
1137
1137
|
/* @__PURE__ */ i(
|
|
1138
1138
|
"button",
|
|
@@ -1175,7 +1175,7 @@ const W = 5, We = ({ data: e, isLatest: r = !1, durationSeconds: n, t }) => {
|
|
|
1175
1175
|
o,
|
|
1176
1176
|
u ? t.and : void 0
|
|
1177
1177
|
)}` : t.findingMemories;
|
|
1178
|
-
return /* @__PURE__ */
|
|
1178
|
+
return /* @__PURE__ */ p("div", { style: { padding: "16px" }, children: [
|
|
1179
1179
|
/* @__PURE__ */ i(
|
|
1180
1180
|
T.div,
|
|
1181
1181
|
{
|
|
@@ -1194,9 +1194,9 @@ const W = 5, We = ({ data: e, isLatest: r = !1, durationSeconds: n, t }) => {
|
|
|
1194
1194
|
color: "#999",
|
|
1195
1195
|
shimmerColor: "#000"
|
|
1196
1196
|
}
|
|
1197
|
-
) : /* @__PURE__ */
|
|
1197
|
+
) : /* @__PURE__ */ p(E, { children: [
|
|
1198
1198
|
/* @__PURE__ */ i("span", { style: { color: "#666" }, children: g }),
|
|
1199
|
-
m && !l && /* @__PURE__ */
|
|
1199
|
+
m && !l && /* @__PURE__ */ p(E, { children: [
|
|
1200
1200
|
" ",
|
|
1201
1201
|
/* @__PURE__ */ i(
|
|
1202
1202
|
"button",
|
|
@@ -1220,7 +1220,7 @@ const W = 5, We = ({ data: e, isLatest: r = !1, durationSeconds: n, t }) => {
|
|
|
1220
1220
|
}
|
|
1221
1221
|
)
|
|
1222
1222
|
] }),
|
|
1223
|
-
m && l && /* @__PURE__ */
|
|
1223
|
+
m && l && /* @__PURE__ */ p(E, { children: [
|
|
1224
1224
|
" ",
|
|
1225
1225
|
/* @__PURE__ */ i(
|
|
1226
1226
|
"button",
|
|
@@ -1270,9 +1270,9 @@ const W = 5, We = ({ data: e, isLatest: r = !1, durationSeconds: n, t }) => {
|
|
|
1270
1270
|
initial: { opacity: 0, y: -10 },
|
|
1271
1271
|
animate: { opacity: 1, y: 0 },
|
|
1272
1272
|
transition: { duration: 0.3, delay: 0 },
|
|
1273
|
-
children: /* @__PURE__ */
|
|
1273
|
+
children: /* @__PURE__ */ p(E, { children: [
|
|
1274
1274
|
/* @__PURE__ */ i("span", { style: { color: "#666" }, children: g }),
|
|
1275
|
-
d && !n && /* @__PURE__ */
|
|
1275
|
+
d && !n && /* @__PURE__ */ p(E, { children: [
|
|
1276
1276
|
" ",
|
|
1277
1277
|
/* @__PURE__ */ i(
|
|
1278
1278
|
"button",
|
|
@@ -1296,7 +1296,7 @@ const W = 5, We = ({ data: e, isLatest: r = !1, durationSeconds: n, t }) => {
|
|
|
1296
1296
|
}
|
|
1297
1297
|
)
|
|
1298
1298
|
] }),
|
|
1299
|
-
d && n && /* @__PURE__ */
|
|
1299
|
+
d && n && /* @__PURE__ */ p(E, { children: [
|
|
1300
1300
|
" ",
|
|
1301
1301
|
/* @__PURE__ */ i(
|
|
1302
1302
|
"button",
|
|
@@ -1323,7 +1323,7 @@ const W = 5, We = ({ data: e, isLatest: r = !1, durationSeconds: n, t }) => {
|
|
|
1323
1323
|
) });
|
|
1324
1324
|
}, _e = ({ isLatest: e = !1, durationSeconds: r, t: n }) => {
|
|
1325
1325
|
const t = n.addingSources;
|
|
1326
|
-
return /* @__PURE__ */
|
|
1326
|
+
return /* @__PURE__ */ p("div", { style: { padding: "16px" }, children: [
|
|
1327
1327
|
/* @__PURE__ */ i(
|
|
1328
1328
|
T.div,
|
|
1329
1329
|
{
|
|
@@ -1376,7 +1376,7 @@ function Ge(e, r) {
|
|
|
1376
1376
|
}
|
|
1377
1377
|
const Qe = ({ data: e, onSourceClick: r, t: n }) => {
|
|
1378
1378
|
const [t, l] = b(null);
|
|
1379
|
-
return /* @__PURE__ */
|
|
1379
|
+
return /* @__PURE__ */ p("div", { style: { padding: "16px" }, children: [
|
|
1380
1380
|
/* @__PURE__ */ i(
|
|
1381
1381
|
T.div,
|
|
1382
1382
|
{
|
|
@@ -1416,7 +1416,7 @@ const Qe = ({ data: e, onSourceClick: r, t: n }) => {
|
|
|
1416
1416
|
t: c
|
|
1417
1417
|
}) => {
|
|
1418
1418
|
const [s, d] = b(!1), m = !!l, o = n === e.memoryId, a = e.pageNumbers ?? [], u = Ge(a, c);
|
|
1419
|
-
return /* @__PURE__ */
|
|
1419
|
+
return /* @__PURE__ */ p(
|
|
1420
1420
|
T.div,
|
|
1421
1421
|
{
|
|
1422
1422
|
"aria-busy": o,
|
|
@@ -1428,6 +1428,9 @@ const Qe = ({ data: e, onSourceClick: r, t: n }) => {
|
|
|
1428
1428
|
try {
|
|
1429
1429
|
await l({
|
|
1430
1430
|
memoryId: e.memoryId,
|
|
1431
|
+
memoryTitle: e.memoryTitle,
|
|
1432
|
+
memoryTypeId: e.memoryTypeId,
|
|
1433
|
+
memoryTypeName: e.memoryTypeName,
|
|
1431
1434
|
pageNumbers: [...a]
|
|
1432
1435
|
});
|
|
1433
1436
|
} finally {
|
|
@@ -1450,7 +1453,7 @@ const Qe = ({ data: e, onSourceClick: r, t: n }) => {
|
|
|
1450
1453
|
pointerEvents: o ? "none" : void 0
|
|
1451
1454
|
},
|
|
1452
1455
|
children: [
|
|
1453
|
-
/* @__PURE__ */
|
|
1456
|
+
/* @__PURE__ */ p(
|
|
1454
1457
|
"span",
|
|
1455
1458
|
{
|
|
1456
1459
|
style: {
|
|
@@ -1462,7 +1465,13 @@ const Qe = ({ data: e, onSourceClick: r, t: n }) => {
|
|
|
1462
1465
|
gap: 8
|
|
1463
1466
|
},
|
|
1464
1467
|
children: [
|
|
1465
|
-
o && /* @__PURE__ */ i(
|
|
1468
|
+
o && /* @__PURE__ */ i(
|
|
1469
|
+
"span",
|
|
1470
|
+
{
|
|
1471
|
+
className: "explore-memory-loader explore-memory-loader--callback",
|
|
1472
|
+
"aria-hidden": !0
|
|
1473
|
+
}
|
|
1474
|
+
),
|
|
1466
1475
|
e.memoryTitle
|
|
1467
1476
|
]
|
|
1468
1477
|
}
|
|
@@ -1503,7 +1512,7 @@ const Qe = ({ data: e, onSourceClick: r, t: n }) => {
|
|
|
1503
1512
|
height: t,
|
|
1504
1513
|
backgroundColor: e
|
|
1505
1514
|
};
|
|
1506
|
-
return /* @__PURE__ */
|
|
1515
|
+
return /* @__PURE__ */ p(
|
|
1507
1516
|
"span",
|
|
1508
1517
|
{
|
|
1509
1518
|
style: {
|
|
@@ -1548,7 +1557,7 @@ function Ue({
|
|
|
1548
1557
|
t: n
|
|
1549
1558
|
}) {
|
|
1550
1559
|
const [t, l] = b(!1), c = e.result ?? e.error, s = c != null && c.length > V, d = c != null ? t || !s ? c : `${c.slice(0, V)}...` : void 0, m = s, o = e.error != null;
|
|
1551
|
-
return /* @__PURE__ */
|
|
1560
|
+
return /* @__PURE__ */ p(
|
|
1552
1561
|
T.div,
|
|
1553
1562
|
{
|
|
1554
1563
|
initial: { opacity: 0 },
|
|
@@ -1580,7 +1589,7 @@ function Ue({
|
|
|
1580
1589
|
children: /* @__PURE__ */ i(qe, { memory: e, completed: r })
|
|
1581
1590
|
}
|
|
1582
1591
|
),
|
|
1583
|
-
/* @__PURE__ */
|
|
1592
|
+
/* @__PURE__ */ p(
|
|
1584
1593
|
"div",
|
|
1585
1594
|
{
|
|
1586
1595
|
style: {
|
|
@@ -1653,8 +1662,8 @@ function Xe(e, r) {
|
|
|
1653
1662
|
}
|
|
1654
1663
|
const Je = ({ data: e, t: r }) => {
|
|
1655
1664
|
const [n, t] = b(!1), l = e.chunks.length, c = l > 0;
|
|
1656
|
-
return /* @__PURE__ */
|
|
1657
|
-
/* @__PURE__ */
|
|
1665
|
+
return /* @__PURE__ */ p("div", { style: { padding: "10px" }, children: [
|
|
1666
|
+
/* @__PURE__ */ p(
|
|
1658
1667
|
T.div,
|
|
1659
1668
|
{
|
|
1660
1669
|
initial: { opacity: 0 },
|
|
@@ -1703,7 +1712,7 @@ const Je = ({ data: e, t: r }) => {
|
|
|
1703
1712
|
},
|
|
1704
1713
|
children: e.chunks.map((s, d) => {
|
|
1705
1714
|
const m = s.pageNumbers ?? [], o = Ve(m, r);
|
|
1706
|
-
return /* @__PURE__ */
|
|
1715
|
+
return /* @__PURE__ */ p(
|
|
1707
1716
|
"div",
|
|
1708
1717
|
{
|
|
1709
1718
|
style: {
|
|
@@ -1726,7 +1735,7 @@ const Je = ({ data: e, t: r }) => {
|
|
|
1726
1735
|
children: s.content
|
|
1727
1736
|
}
|
|
1728
1737
|
),
|
|
1729
|
-
/* @__PURE__ */
|
|
1738
|
+
/* @__PURE__ */ p(
|
|
1730
1739
|
"div",
|
|
1731
1740
|
{
|
|
1732
1741
|
style: {
|
|
@@ -1766,7 +1775,7 @@ function er({
|
|
|
1766
1775
|
showShimmerForPrimary: n
|
|
1767
1776
|
}) {
|
|
1768
1777
|
const t = e.result != null, l = e.error != null, c = Ze(e, r);
|
|
1769
|
-
return /* @__PURE__ */
|
|
1778
|
+
return /* @__PURE__ */ p(
|
|
1770
1779
|
T.div,
|
|
1771
1780
|
{
|
|
1772
1781
|
initial: { opacity: 0 },
|
|
@@ -1796,7 +1805,7 @@ function er({
|
|
|
1796
1805
|
children: /* @__PURE__ */ i(Ye, { item: e })
|
|
1797
1806
|
}
|
|
1798
1807
|
),
|
|
1799
|
-
/* @__PURE__ */
|
|
1808
|
+
/* @__PURE__ */ p(
|
|
1800
1809
|
"div",
|
|
1801
1810
|
{
|
|
1802
1811
|
style: {
|
|
@@ -1848,7 +1857,7 @@ const rr = ({ data: e, isLatest: r = !1, durationSeconds: n, t }) => {
|
|
|
1848
1857
|
s.result == null && s.error == null && (c = d);
|
|
1849
1858
|
}), c;
|
|
1850
1859
|
}, [e.memoryTypes]);
|
|
1851
|
-
return /* @__PURE__ */
|
|
1860
|
+
return /* @__PURE__ */ p("div", { style: { padding: "10px" }, children: [
|
|
1852
1861
|
r && !n && e.memoryTypes.length === 0 ? /* @__PURE__ */ i(
|
|
1853
1862
|
C,
|
|
1854
1863
|
{
|
|
@@ -1880,10 +1889,10 @@ const rr = ({ data: e, isLatest: r = !1, durationSeconds: n, t }) => {
|
|
|
1880
1889
|
}
|
|
1881
1890
|
)
|
|
1882
1891
|
] });
|
|
1883
|
-
},
|
|
1884
|
-
|
|
1892
|
+
}, N = 12, B = 1.45, nr = Math.ceil(
|
|
1893
|
+
N * B
|
|
1885
1894
|
), tr = Math.ceil(
|
|
1886
|
-
5 *
|
|
1895
|
+
5 * N * B
|
|
1887
1896
|
);
|
|
1888
1897
|
function O(e) {
|
|
1889
1898
|
return e.queries != null && e.queries.length > 0;
|
|
@@ -1907,13 +1916,13 @@ function sr({
|
|
|
1907
1916
|
}) {
|
|
1908
1917
|
const t = or(e), l = ir(e), c = e.reasoning, s = c != null && c.length > 0, d = A(null), [m, o] = b(!1), a = t && n, u = l === 2 && n && !O(e);
|
|
1909
1918
|
M(() => {
|
|
1910
|
-
const
|
|
1911
|
-
|
|
1919
|
+
const y = d.current;
|
|
1920
|
+
y != null && l === 1 && s && (y.scrollTop = y.scrollHeight);
|
|
1912
1921
|
}, [c, l, s]);
|
|
1913
1922
|
const g = x(r.searchingInMemoriesOfType, {
|
|
1914
1923
|
name: e.memoryTypeName
|
|
1915
1924
|
}), f = !t && l === 3;
|
|
1916
|
-
return /* @__PURE__ */
|
|
1925
|
+
return /* @__PURE__ */ p(
|
|
1917
1926
|
T.div,
|
|
1918
1927
|
{
|
|
1919
1928
|
initial: { opacity: 0 },
|
|
@@ -1944,7 +1953,7 @@ function sr({
|
|
|
1944
1953
|
children: /* @__PURE__ */ i(ar, { phase: t ? 1 : l })
|
|
1945
1954
|
}
|
|
1946
1955
|
),
|
|
1947
|
-
/* @__PURE__ */
|
|
1956
|
+
/* @__PURE__ */ p(
|
|
1948
1957
|
"div",
|
|
1949
1958
|
{
|
|
1950
1959
|
style: {
|
|
@@ -1965,7 +1974,7 @@ function sr({
|
|
|
1965
1974
|
shimmerColor: "#000"
|
|
1966
1975
|
}
|
|
1967
1976
|
) : e.memoryTypeName }),
|
|
1968
|
-
l === 1 && s && !O(e) && /* @__PURE__ */
|
|
1977
|
+
l === 1 && s && !O(e) && /* @__PURE__ */ p("div", { style: { minWidth: 0 }, children: [
|
|
1969
1978
|
/* @__PURE__ */ i(
|
|
1970
1979
|
"span",
|
|
1971
1980
|
{
|
|
@@ -1999,8 +2008,8 @@ function sr({
|
|
|
1999
2008
|
height: "auto",
|
|
2000
2009
|
overflowY: "auto",
|
|
2001
2010
|
overflowX: "hidden",
|
|
2002
|
-
fontSize:
|
|
2003
|
-
lineHeight:
|
|
2011
|
+
fontSize: N,
|
|
2012
|
+
lineHeight: B,
|
|
2004
2013
|
whiteSpace: "pre-wrap",
|
|
2005
2014
|
wordBreak: "break-word",
|
|
2006
2015
|
color: "#888"
|
|
@@ -2021,8 +2030,8 @@ function sr({
|
|
|
2021
2030
|
shimmerColor: "#000"
|
|
2022
2031
|
}
|
|
2023
2032
|
) }),
|
|
2024
|
-
l === 3 && /* @__PURE__ */
|
|
2025
|
-
/* @__PURE__ */
|
|
2033
|
+
l === 3 && /* @__PURE__ */ p(E, { children: [
|
|
2034
|
+
/* @__PURE__ */ p("div", { style: { minWidth: 0 }, children: [
|
|
2026
2035
|
/* @__PURE__ */ i(
|
|
2027
2036
|
"span",
|
|
2028
2037
|
{
|
|
@@ -2044,7 +2053,7 @@ function sr({
|
|
|
2044
2053
|
flexDirection: "column",
|
|
2045
2054
|
gap: 6
|
|
2046
2055
|
},
|
|
2047
|
-
children: e.queries.map((
|
|
2056
|
+
children: e.queries.map((y, S) => /* @__PURE__ */ i(
|
|
2048
2057
|
"div",
|
|
2049
2058
|
{
|
|
2050
2059
|
style: {
|
|
@@ -2053,19 +2062,19 @@ function sr({
|
|
|
2053
2062
|
lineHeight: 1.5,
|
|
2054
2063
|
wordBreak: "break-word"
|
|
2055
2064
|
},
|
|
2056
|
-
children:
|
|
2065
|
+
children: y.query
|
|
2057
2066
|
},
|
|
2058
2067
|
S
|
|
2059
2068
|
))
|
|
2060
2069
|
}
|
|
2061
2070
|
)
|
|
2062
2071
|
] }),
|
|
2063
|
-
s && /* @__PURE__ */
|
|
2072
|
+
s && /* @__PURE__ */ p(E, { children: [
|
|
2064
2073
|
/* @__PURE__ */ i(
|
|
2065
2074
|
"button",
|
|
2066
2075
|
{
|
|
2067
2076
|
type: "button",
|
|
2068
|
-
onClick: () => o((
|
|
2077
|
+
onClick: () => o((y) => !y),
|
|
2069
2078
|
style: {
|
|
2070
2079
|
alignSelf: "flex-start",
|
|
2071
2080
|
border: "none",
|
|
@@ -2083,8 +2092,8 @@ function sr({
|
|
|
2083
2092
|
"div",
|
|
2084
2093
|
{
|
|
2085
2094
|
style: {
|
|
2086
|
-
fontSize:
|
|
2087
|
-
lineHeight:
|
|
2095
|
+
fontSize: N,
|
|
2096
|
+
lineHeight: B,
|
|
2088
2097
|
whiteSpace: "pre-wrap",
|
|
2089
2098
|
wordBreak: "break-word",
|
|
2090
2099
|
color: "#888",
|
|
@@ -2111,7 +2120,7 @@ const lr = ({ data: e, isLatest: r = !1, durationSeconds: n, t }) => {
|
|
|
2111
2120
|
O(s) || (c = d);
|
|
2112
2121
|
}), c;
|
|
2113
2122
|
}, [e.memoryTypes]);
|
|
2114
|
-
return /* @__PURE__ */
|
|
2123
|
+
return /* @__PURE__ */ p("div", { style: { padding: "10px" }, children: [
|
|
2115
2124
|
r && !n && e.memoryTypes.length === 0 ? /* @__PURE__ */ i(
|
|
2116
2125
|
C,
|
|
2117
2126
|
{
|
|
@@ -2217,13 +2226,13 @@ function ur(e, r) {
|
|
|
2217
2226
|
const n = e.result, t = n.numberOfChunks === 1 ? r.chunkFound : x(r.chunksFound, { n: n.numberOfChunks }), l = x(r.scoreLabel, {
|
|
2218
2227
|
n: n.highestChunkScore.toFixed(2)
|
|
2219
2228
|
});
|
|
2220
|
-
return /* @__PURE__ */
|
|
2229
|
+
return /* @__PURE__ */ p("span", { style: { fontSize: 12, color: "#666", whiteSpace: "nowrap" }, children: [
|
|
2221
2230
|
t,
|
|
2222
2231
|
" · ",
|
|
2223
2232
|
l
|
|
2224
2233
|
] });
|
|
2225
2234
|
}
|
|
2226
|
-
function
|
|
2235
|
+
function yr({
|
|
2227
2236
|
items: e,
|
|
2228
2237
|
queryRow: r,
|
|
2229
2238
|
onExploreQueryResultClick: n,
|
|
@@ -2255,24 +2264,25 @@ function pr({
|
|
|
2255
2264
|
borderTop: "1px solid #f0f0f0"
|
|
2256
2265
|
},
|
|
2257
2266
|
children: e.map((d, m) => {
|
|
2258
|
-
const o = d.
|
|
2267
|
+
const o = d.memoryTitle !== "" ? d.memoryTitle : d.memoryId, a = te(
|
|
2259
2268
|
d.chunks
|
|
2260
2269
|
), u = [
|
|
2261
|
-
oe(d
|
|
2270
|
+
oe(d),
|
|
2262
2271
|
x(t.scoreLabel, {
|
|
2263
|
-
n: d.
|
|
2272
|
+
n: d.matchingChunkScore.toFixed(2)
|
|
2264
2273
|
}),
|
|
2265
2274
|
a.length > 0 ? ne(a, t) : t.pagesNotAvailable
|
|
2266
2275
|
].filter(
|
|
2267
2276
|
(S) => S != null && S !== ""
|
|
2268
2277
|
), g = {
|
|
2269
|
-
memoryId: d.
|
|
2278
|
+
memoryId: d.memoryId,
|
|
2279
|
+
memoryTitle: d.memoryTitle,
|
|
2270
2280
|
pageNumbers: a,
|
|
2271
2281
|
memoryTypeId: r.memoryTypeId,
|
|
2272
2282
|
memoryTypeName: r.memoryTypeName,
|
|
2273
2283
|
query: r.query
|
|
2274
|
-
}, f = `${r.query}::${d.
|
|
2275
|
-
return /* @__PURE__ */
|
|
2284
|
+
}, f = `${r.query}::${d.memoryId}::${m}`, y = l === f;
|
|
2285
|
+
return /* @__PURE__ */ p(
|
|
2276
2286
|
"div",
|
|
2277
2287
|
{
|
|
2278
2288
|
style: {
|
|
@@ -2286,7 +2296,7 @@ function pr({
|
|
|
2286
2296
|
minWidth: 0
|
|
2287
2297
|
},
|
|
2288
2298
|
children: [
|
|
2289
|
-
/* @__PURE__ */
|
|
2299
|
+
/* @__PURE__ */ p(
|
|
2290
2300
|
"div",
|
|
2291
2301
|
{
|
|
2292
2302
|
style: {
|
|
@@ -2338,12 +2348,12 @@ function pr({
|
|
|
2338
2348
|
]
|
|
2339
2349
|
}
|
|
2340
2350
|
),
|
|
2341
|
-
s && /* @__PURE__ */
|
|
2351
|
+
s && /* @__PURE__ */ p(
|
|
2342
2352
|
"button",
|
|
2343
2353
|
{
|
|
2344
2354
|
type: "button",
|
|
2345
|
-
"aria-busy":
|
|
2346
|
-
disabled:
|
|
2355
|
+
"aria-busy": y,
|
|
2356
|
+
disabled: y,
|
|
2347
2357
|
onClick: async () => {
|
|
2348
2358
|
c(f);
|
|
2349
2359
|
try {
|
|
@@ -2364,17 +2374,17 @@ function pr({
|
|
|
2364
2374
|
background: "#eff6ff",
|
|
2365
2375
|
border: "1px solid #bfdbfe",
|
|
2366
2376
|
borderRadius: 6,
|
|
2367
|
-
cursor:
|
|
2377
|
+
cursor: y ? "wait" : "pointer",
|
|
2368
2378
|
fontFamily: "inherit",
|
|
2369
2379
|
display: "inline-flex",
|
|
2370
2380
|
alignItems: "center",
|
|
2371
2381
|
gap: 8
|
|
2372
2382
|
},
|
|
2373
2383
|
children: [
|
|
2374
|
-
|
|
2384
|
+
y && /* @__PURE__ */ i(
|
|
2375
2385
|
"span",
|
|
2376
2386
|
{
|
|
2377
|
-
className: "explore-memory-loader",
|
|
2387
|
+
className: "explore-memory-loader explore-memory-loader--callback",
|
|
2378
2388
|
"aria-hidden": !0
|
|
2379
2389
|
}
|
|
2380
2390
|
),
|
|
@@ -2384,13 +2394,13 @@ function pr({
|
|
|
2384
2394
|
)
|
|
2385
2395
|
]
|
|
2386
2396
|
},
|
|
2387
|
-
`${d.
|
|
2397
|
+
`${d.memoryId}-${m}`
|
|
2388
2398
|
);
|
|
2389
2399
|
})
|
|
2390
2400
|
}
|
|
2391
2401
|
);
|
|
2392
2402
|
}
|
|
2393
|
-
function
|
|
2403
|
+
function pr(e) {
|
|
2394
2404
|
const r = [], n = /* @__PURE__ */ new Map();
|
|
2395
2405
|
return e.forEach((t, l) => {
|
|
2396
2406
|
let c = n.get(t.memoryTypeId);
|
|
@@ -2413,7 +2423,7 @@ function gr({
|
|
|
2413
2423
|
const d = e.items.map((o) => o.item), m = d.some(
|
|
2414
2424
|
(o) => o.result == null && o.error == null
|
|
2415
2425
|
);
|
|
2416
|
-
return /* @__PURE__ */
|
|
2426
|
+
return /* @__PURE__ */ p(
|
|
2417
2427
|
T.div,
|
|
2418
2428
|
{
|
|
2419
2429
|
initial: { opacity: 0 },
|
|
@@ -2444,7 +2454,7 @@ function gr({
|
|
|
2444
2454
|
children: mr(d)
|
|
2445
2455
|
}
|
|
2446
2456
|
),
|
|
2447
|
-
/* @__PURE__ */
|
|
2457
|
+
/* @__PURE__ */ p(
|
|
2448
2458
|
"div",
|
|
2449
2459
|
{
|
|
2450
2460
|
style: {
|
|
@@ -2469,8 +2479,8 @@ function gr({
|
|
|
2469
2479
|
),
|
|
2470
2480
|
e.items.map(({ item: o, flatIndex: a }) => {
|
|
2471
2481
|
var h;
|
|
2472
|
-
const u = o.result != null, g = o.error != null, f = a === n && t && !u && !g,
|
|
2473
|
-
return /* @__PURE__ */
|
|
2482
|
+
const u = o.result != null, g = o.error != null, f = a === n && t && !u && !g, y = l[a] === !0, S = ((h = o.result) == null ? void 0 : h.items) ?? [];
|
|
2483
|
+
return /* @__PURE__ */ p(
|
|
2474
2484
|
"div",
|
|
2475
2485
|
{
|
|
2476
2486
|
style: {
|
|
@@ -2480,7 +2490,7 @@ function gr({
|
|
|
2480
2490
|
minWidth: 0
|
|
2481
2491
|
},
|
|
2482
2492
|
children: [
|
|
2483
|
-
/* @__PURE__ */
|
|
2493
|
+
/* @__PURE__ */ p(
|
|
2484
2494
|
"div",
|
|
2485
2495
|
{
|
|
2486
2496
|
style: {
|
|
@@ -2515,7 +2525,7 @@ function gr({
|
|
|
2515
2525
|
) : o.query
|
|
2516
2526
|
}
|
|
2517
2527
|
),
|
|
2518
|
-
/* @__PURE__ */
|
|
2528
|
+
/* @__PURE__ */ p(
|
|
2519
2529
|
"div",
|
|
2520
2530
|
{
|
|
2521
2531
|
style: {
|
|
@@ -2542,7 +2552,7 @@ function gr({
|
|
|
2542
2552
|
textDecoration: "underline",
|
|
2543
2553
|
fontFamily: "inherit"
|
|
2544
2554
|
},
|
|
2545
|
-
children:
|
|
2555
|
+
children: y ? r.memorySearchHideExploreResults : r.memorySearchViewExploreResults
|
|
2546
2556
|
}
|
|
2547
2557
|
)
|
|
2548
2558
|
]
|
|
@@ -2551,8 +2561,8 @@ function gr({
|
|
|
2551
2561
|
]
|
|
2552
2562
|
}
|
|
2553
2563
|
),
|
|
2554
|
-
u &&
|
|
2555
|
-
|
|
2564
|
+
u && y && /* @__PURE__ */ i(
|
|
2565
|
+
yr,
|
|
2556
2566
|
{
|
|
2557
2567
|
items: S,
|
|
2558
2568
|
queryRow: o,
|
|
@@ -2592,10 +2602,10 @@ const hr = ({
|
|
|
2592
2602
|
u.result == null && u.error == null && (a = g);
|
|
2593
2603
|
}), a;
|
|
2594
2604
|
}, [e.queries]), o = D(
|
|
2595
|
-
() =>
|
|
2605
|
+
() => pr(e.queries),
|
|
2596
2606
|
[e.queries]
|
|
2597
2607
|
);
|
|
2598
|
-
return /* @__PURE__ */
|
|
2608
|
+
return /* @__PURE__ */ p("div", { style: { padding: "10px" }, children: [
|
|
2599
2609
|
r && !n && e.queries.length === 0 ? /* @__PURE__ */ i(
|
|
2600
2610
|
C,
|
|
2601
2611
|
{
|
|
@@ -2633,7 +2643,7 @@ const hr = ({
|
|
|
2633
2643
|
] });
|
|
2634
2644
|
}, fr = ({ data: e, onSearchResultClick: r, t: n }) => {
|
|
2635
2645
|
const t = e.response.items, l = !!r, [c, s] = b(null);
|
|
2636
|
-
return /* @__PURE__ */
|
|
2646
|
+
return /* @__PURE__ */ p("div", { style: { padding: "16px" }, children: [
|
|
2637
2647
|
/* @__PURE__ */ i(
|
|
2638
2648
|
T.div,
|
|
2639
2649
|
{
|
|
@@ -2658,21 +2668,24 @@ const hr = ({
|
|
|
2658
2668
|
gap: 0
|
|
2659
2669
|
},
|
|
2660
2670
|
children: t.map((d, m) => {
|
|
2661
|
-
const o = d.
|
|
2671
|
+
const o = d.memoryTitle !== "" ? d.memoryTitle : d.memoryId, a = te(
|
|
2662
2672
|
d.chunks
|
|
2663
2673
|
), u = [
|
|
2664
|
-
oe(d
|
|
2674
|
+
oe(d),
|
|
2665
2675
|
x(n.scoreLabel, {
|
|
2666
|
-
n: d.
|
|
2676
|
+
n: d.matchingChunkScore.toFixed(2)
|
|
2667
2677
|
}),
|
|
2668
2678
|
a.length > 0 ? ne(a, n) : n.pagesNotAvailable
|
|
2669
2679
|
].filter(
|
|
2670
2680
|
(S) => S != null && S !== ""
|
|
2671
2681
|
), g = {
|
|
2672
|
-
memoryId: d.
|
|
2682
|
+
memoryId: d.memoryId,
|
|
2683
|
+
memoryTitle: d.memoryTitle,
|
|
2684
|
+
memoryTypeId: d.memoryTypeId,
|
|
2685
|
+
memoryTypeName: d.memoryTypeName,
|
|
2673
2686
|
pageNumbers: a
|
|
2674
|
-
}, f = `${d.
|
|
2675
|
-
return /* @__PURE__ */
|
|
2687
|
+
}, f = `${d.memoryId}-${m}`, y = c === f;
|
|
2688
|
+
return /* @__PURE__ */ p(
|
|
2676
2689
|
T.div,
|
|
2677
2690
|
{
|
|
2678
2691
|
initial: { opacity: 0 },
|
|
@@ -2689,7 +2702,7 @@ const hr = ({
|
|
|
2689
2702
|
minWidth: 0
|
|
2690
2703
|
},
|
|
2691
2704
|
children: [
|
|
2692
|
-
/* @__PURE__ */
|
|
2705
|
+
/* @__PURE__ */ p(
|
|
2693
2706
|
"div",
|
|
2694
2707
|
{
|
|
2695
2708
|
style: {
|
|
@@ -2739,12 +2752,12 @@ const hr = ({
|
|
|
2739
2752
|
]
|
|
2740
2753
|
}
|
|
2741
2754
|
),
|
|
2742
|
-
l && /* @__PURE__ */
|
|
2755
|
+
l && /* @__PURE__ */ p(
|
|
2743
2756
|
"button",
|
|
2744
2757
|
{
|
|
2745
2758
|
type: "button",
|
|
2746
|
-
"aria-busy":
|
|
2747
|
-
disabled:
|
|
2759
|
+
"aria-busy": y,
|
|
2760
|
+
disabled: y,
|
|
2748
2761
|
onClick: async () => {
|
|
2749
2762
|
s(f);
|
|
2750
2763
|
try {
|
|
@@ -2763,17 +2776,17 @@ const hr = ({
|
|
|
2763
2776
|
background: "#eff6ff",
|
|
2764
2777
|
border: "1px solid #bfdbfe",
|
|
2765
2778
|
borderRadius: 6,
|
|
2766
|
-
cursor:
|
|
2779
|
+
cursor: y ? "wait" : "pointer",
|
|
2767
2780
|
fontFamily: "inherit",
|
|
2768
2781
|
display: "inline-flex",
|
|
2769
2782
|
alignItems: "center",
|
|
2770
2783
|
gap: 8
|
|
2771
2784
|
},
|
|
2772
2785
|
children: [
|
|
2773
|
-
|
|
2786
|
+
y && /* @__PURE__ */ i(
|
|
2774
2787
|
"span",
|
|
2775
2788
|
{
|
|
2776
|
-
className: "explore-memory-loader",
|
|
2789
|
+
className: "explore-memory-loader explore-memory-loader--callback",
|
|
2777
2790
|
"aria-hidden": !0
|
|
2778
2791
|
}
|
|
2779
2792
|
),
|
|
@@ -2783,7 +2796,7 @@ const hr = ({
|
|
|
2783
2796
|
)
|
|
2784
2797
|
]
|
|
2785
2798
|
},
|
|
2786
|
-
`${d.
|
|
2799
|
+
`${d.memoryId}-${m}`
|
|
2787
2800
|
);
|
|
2788
2801
|
})
|
|
2789
2802
|
}
|
|
@@ -2830,7 +2843,7 @@ const hr = ({
|
|
|
2830
2843
|
return /* @__PURE__ */ i(K, { text: a.text });
|
|
2831
2844
|
if (a.taskType === "StructuredChatCompletion" && a.eventType === "Completed")
|
|
2832
2845
|
return /* @__PURE__ */ i(Oe, { data: a });
|
|
2833
|
-
if (a.taskType === "
|
|
2846
|
+
if (a.taskType === "MemoryChat")
|
|
2834
2847
|
switch (a.eventType) {
|
|
2835
2848
|
case "Text":
|
|
2836
2849
|
return /* @__PURE__ */ i(K, { text: a.text });
|
|
@@ -2955,8 +2968,8 @@ const hr = ({
|
|
|
2955
2968
|
) });
|
|
2956
2969
|
const m = e.filter((o, a) => {
|
|
2957
2970
|
const u = o.item.data;
|
|
2958
|
-
return u.taskType === "
|
|
2959
|
-
(h) => h.item.data.taskType === "
|
|
2971
|
+
return u.taskType === "MemoryChat" && u.eventType === "ExploreMemories" ? !e.slice(a + 1).some(
|
|
2972
|
+
(h) => h.item.data.taskType === "MemoryChat" && h.item.data.eventType === "ExploreMemories"
|
|
2960
2973
|
) : u.taskType === "MemorySearch" && u.eventType === "GeneratingQueries" ? !e.slice(a + 1).some(
|
|
2961
2974
|
(h) => h.item.data.taskType === "MemorySearch" && h.item.data.eventType === "GeneratingQueries"
|
|
2962
2975
|
) : u.taskType === "MemorySearch" && u.eventType === "ExploreQueries" ? !e.slice(a + 1).some(
|
|
@@ -2986,7 +2999,7 @@ const hr = ({
|
|
|
2986
2999
|
onSearchResultClick: l,
|
|
2987
3000
|
onExploreQueryResultClick: c
|
|
2988
3001
|
}) => {
|
|
2989
|
-
const s = De(e), d = (e.params.type === "
|
|
3002
|
+
const s = De(e), d = (e.params.type === "MemoryChat" || e.params.type === "MemorySearch") && "language" in e.params ? e.params.language ?? "en" : n ?? "en", m = Be(d);
|
|
2990
3003
|
return r === "simple" ? /* @__PURE__ */ i(
|
|
2991
3004
|
ze,
|
|
2992
3005
|
{
|