@fencyai/react 0.1.180 → 0.1.182
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 +73 -73
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
import { jsxs as f, jsx as o, Fragment as A } from "react/jsx-runtime";
|
|
2
2
|
import { createStream as we, isStreamTimeoutEvent as Me, isStreamNotFoundEvent as Ie, isAgentTaskProgressItemUpdatedEvent as Ee, createAgentTask as Re } from "@fencyai/js";
|
|
3
|
-
import Fe, { createContext as me, useState as R, useRef as
|
|
3
|
+
import Fe, { createContext as me, useState as R, useRef as z, useEffect as B, useCallback as O, useContext as he, useMemo as L } from "react";
|
|
4
4
|
import { z as i } from "zod";
|
|
5
5
|
import { motion as M, useInView as Ae, AnimatePresence as Pe } from "motion/react";
|
|
6
|
-
import
|
|
6
|
+
import Be from "react-markdown";
|
|
7
7
|
import { Prism as pe } from "react-syntax-highlighter";
|
|
8
|
-
import
|
|
8
|
+
import ze from "remark-gfm";
|
|
9
9
|
import './assets/index.css';const ge = me(
|
|
10
10
|
void 0
|
|
11
11
|
);
|
|
12
|
-
async function
|
|
12
|
+
async function De(e, t) {
|
|
13
13
|
const n = e.getReader();
|
|
14
14
|
let r;
|
|
15
15
|
for (; !(r = await n.read()).done; )
|
|
16
16
|
t(r.value);
|
|
17
17
|
}
|
|
18
|
-
function
|
|
18
|
+
function Le(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);
|
|
@@ -113,7 +113,7 @@ function $e(e, t) {
|
|
|
113
113
|
p = new AbortController();
|
|
114
114
|
try {
|
|
115
115
|
const P = await C(e, Object.assign(Object.assign({}, l), { headers: y, signal: p.signal }));
|
|
116
|
-
await E(P), await
|
|
116
|
+
await E(P), await De(P.body, Le(We((v) => {
|
|
117
117
|
v ? y[ne] = v : delete y[ne];
|
|
118
118
|
}, (v) => {
|
|
119
119
|
b = v;
|
|
@@ -464,21 +464,21 @@ const Ge = 48e4, qe = 3e5, ie = (e) => {
|
|
|
464
464
|
function $t({ fency: e, fetchCreateStreamClientToken: t, children: n }) {
|
|
465
465
|
const [r, a] = R(
|
|
466
466
|
null
|
|
467
|
-
), [c, s] = R(!0), [m, d] = R(null), [u, l] = R([]), h =
|
|
468
|
-
|
|
467
|
+
), [c, s] = R(!0), [m, d] = R(null), [u, l] = R([]), h = z(null), k = z(null);
|
|
468
|
+
B(() => {
|
|
469
469
|
e.then((b) => {
|
|
470
470
|
a(b), s(!1);
|
|
471
471
|
}).catch((b) => {
|
|
472
472
|
d(b), s(!1);
|
|
473
473
|
});
|
|
474
|
-
}, [e]),
|
|
474
|
+
}, [e]), B(() => {
|
|
475
475
|
r && !k.current && (k.current = new _e(r));
|
|
476
|
-
}, [r]),
|
|
476
|
+
}, [r]), B(() => {
|
|
477
477
|
k.current && k.current.updateStreams(u);
|
|
478
|
-
}, [u]),
|
|
478
|
+
}, [u]), B(() => () => {
|
|
479
479
|
var b;
|
|
480
480
|
(b = k.current) == null || b.cleanup();
|
|
481
|
-
}, []),
|
|
481
|
+
}, []), B(() => {
|
|
482
482
|
const b = setInterval(() => {
|
|
483
483
|
l((x) => {
|
|
484
484
|
const w = ie(x);
|
|
@@ -823,8 +823,8 @@ const br = (e) => {
|
|
|
823
823
|
data: n
|
|
824
824
|
};
|
|
825
825
|
}, Cr = (e) => {
|
|
826
|
-
const t = ye(), [n, r] = R(null), a =
|
|
827
|
-
return
|
|
826
|
+
const t = ye(), [n, r] = R(null), a = z(`subscriber-${Math.random().toString(36).substr(2, 9)}`);
|
|
827
|
+
return B(() => {
|
|
828
828
|
if (!t.eventManager) return;
|
|
829
829
|
const s = {
|
|
830
830
|
onMessage: (d, u) => {
|
|
@@ -879,7 +879,7 @@ const br = (e) => {
|
|
|
879
879
|
stream: n
|
|
880
880
|
};
|
|
881
881
|
}, Ht = (e) => {
|
|
882
|
-
const t = ye(), [n, r] = R([]), a =
|
|
882
|
+
const t = ye(), [n, r] = R([]), a = z(/* @__PURE__ */ new Set()), c = z(/* @__PURE__ */ new Map()), s = O(
|
|
883
883
|
(l, h) => {
|
|
884
884
|
r((k) => {
|
|
885
885
|
const y = [], p = k.map((g) => {
|
|
@@ -1136,11 +1136,11 @@ const br = (e) => {
|
|
|
1136
1136
|
e.fetchCreateAgentTaskClientToken,
|
|
1137
1137
|
s
|
|
1138
1138
|
]
|
|
1139
|
-
), u =
|
|
1139
|
+
), u = L(() => {
|
|
1140
1140
|
if (n.length !== 0)
|
|
1141
1141
|
return [...n].sort((l, h) => new Date(h.triggeredAt).getTime() - new Date(l.triggeredAt).getTime())[0];
|
|
1142
1142
|
}, [n]);
|
|
1143
|
-
return
|
|
1143
|
+
return B(() => () => {
|
|
1144
1144
|
a.current.clear(), c.current.clear();
|
|
1145
1145
|
}, []), {
|
|
1146
1146
|
agentTasks: n,
|
|
@@ -1859,7 +1859,7 @@ function Rr({
|
|
|
1859
1859
|
theme: e,
|
|
1860
1860
|
children: t
|
|
1861
1861
|
}) {
|
|
1862
|
-
const n =
|
|
1862
|
+
const n = L(
|
|
1863
1863
|
() => ({
|
|
1864
1864
|
theme: e,
|
|
1865
1865
|
colors: e === "dark" ? Er : be
|
|
@@ -1878,7 +1878,7 @@ const se = ({
|
|
|
1878
1878
|
text: e
|
|
1879
1879
|
}) => {
|
|
1880
1880
|
const { theme: t } = T(), n = xe(t);
|
|
1881
|
-
return /* @__PURE__ */ o("div", { style: {
|
|
1881
|
+
return /* @__PURE__ */ o("div", { style: { paddingBlock: "16px" }, children: /* @__PURE__ */ o(
|
|
1882
1882
|
M.div,
|
|
1883
1883
|
{
|
|
1884
1884
|
className: "fency-markdown-body-raw",
|
|
@@ -1886,9 +1886,9 @@ const se = ({
|
|
|
1886
1886
|
animate: { opacity: 1, y: 0 },
|
|
1887
1887
|
transition: { duration: 0.3, delay: 0 },
|
|
1888
1888
|
children: /* @__PURE__ */ o(
|
|
1889
|
-
|
|
1889
|
+
Be,
|
|
1890
1890
|
{
|
|
1891
|
-
remarkPlugins: [
|
|
1891
|
+
remarkPlugins: [ze],
|
|
1892
1892
|
components: {
|
|
1893
1893
|
code(r) {
|
|
1894
1894
|
const { children: a, className: c, node: s, ref: m, ...d } = r, u = /language-(\w+)/.exec(c || "");
|
|
@@ -2119,7 +2119,7 @@ function F({
|
|
|
2119
2119
|
shimmerColor: h,
|
|
2120
2120
|
direction: k = "fromBottom"
|
|
2121
2121
|
}) {
|
|
2122
|
-
const { colors: y } = T(), p = l ?? y.shimmerBase, g = h ?? y.shimmerHighlight, b =
|
|
2122
|
+
const { colors: y } = T(), p = l ?? y.shimmerBase, g = h ?? y.shimmerHighlight, b = z(null), x = Ae(b, { once: m, margin: d }), w = L(() => e.length * u, [e, u]), C = !s || x, E = k === "fromBottom" ? "100% center" : "-100% center", I = k === "fromBottom" ? "0% center" : "200% center";
|
|
2123
2123
|
return /* @__PURE__ */ o(
|
|
2124
2124
|
M.span,
|
|
2125
2125
|
{
|
|
@@ -2165,12 +2165,12 @@ function F({
|
|
|
2165
2165
|
}
|
|
2166
2166
|
);
|
|
2167
2167
|
}
|
|
2168
|
-
const G = 5,
|
|
2168
|
+
const G = 5, Br = ({ data: e, isLatest: t = !1, durationSeconds: n, t: r }) => {
|
|
2169
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(
|
|
2170
2170
|
h,
|
|
2171
2171
|
y ? r.and : void 0
|
|
2172
2172
|
)}` : "", b = u ? `${p}${g}` : `${r.searchingPrefix}${e.queryDescription}`;
|
|
2173
|
-
return /* @__PURE__ */ f("div", { style: {
|
|
2173
|
+
return /* @__PURE__ */ f("div", { style: { paddingBlock: "16px" }, children: [
|
|
2174
2174
|
/* @__PURE__ */ o(
|
|
2175
2175
|
M.div,
|
|
2176
2176
|
{
|
|
@@ -2250,12 +2250,12 @@ const G = 5, zr = ({ data: e, isLatest: t = !1, durationSeconds: n, t: r }) => {
|
|
|
2250
2250
|
}
|
|
2251
2251
|
)
|
|
2252
2252
|
] });
|
|
2253
|
-
}, q = 5,
|
|
2253
|
+
}, q = 5, zr = ({ data: e, isLatest: t = !1, durationSeconds: n, t: r }) => {
|
|
2254
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(
|
|
2255
2255
|
l,
|
|
2256
2256
|
k ? r.and : void 0
|
|
2257
2257
|
)}` : r.findingMemories;
|
|
2258
|
-
return /* @__PURE__ */ f("div", { style: {
|
|
2258
|
+
return /* @__PURE__ */ f("div", { style: { paddingBlock: "16px" }, children: [
|
|
2259
2259
|
/* @__PURE__ */ o(
|
|
2260
2260
|
M.div,
|
|
2261
2261
|
{
|
|
@@ -2329,12 +2329,12 @@ const G = 5, zr = ({ data: e, isLatest: t = !1, durationSeconds: n, t: r }) => {
|
|
|
2329
2329
|
}
|
|
2330
2330
|
)
|
|
2331
2331
|
] });
|
|
2332
|
-
}, Q = 5,
|
|
2332
|
+
}, Q = 5, Dr = ({ data: e, t }) => {
|
|
2333
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
2334
|
u,
|
|
2335
2335
|
h ? t.and : void 0
|
|
2336
2336
|
)}` : t.memoriesFound;
|
|
2337
|
-
return /* @__PURE__ */ o("div", { style: {
|
|
2337
|
+
return /* @__PURE__ */ o("div", { style: { paddingBlock: "16px" }, children: /* @__PURE__ */ o(
|
|
2338
2338
|
M.div,
|
|
2339
2339
|
{
|
|
2340
2340
|
style: { color: n.textSecondary },
|
|
@@ -2392,9 +2392,9 @@ const G = 5, zr = ({ data: e, isLatest: t = !1, durationSeconds: n, t: r }) => {
|
|
|
2392
2392
|
] })
|
|
2393
2393
|
}
|
|
2394
2394
|
) });
|
|
2395
|
-
},
|
|
2395
|
+
}, Lr = ({ isLatest: e = !1, durationSeconds: t, t: n }) => {
|
|
2396
2396
|
const { colors: r } = T(), a = n.addingSources;
|
|
2397
|
-
return /* @__PURE__ */ f("div", { style: {
|
|
2397
|
+
return /* @__PURE__ */ f("div", { style: { paddingBlock: "16px" }, children: [
|
|
2398
2398
|
/* @__PURE__ */ o(
|
|
2399
2399
|
M.div,
|
|
2400
2400
|
{
|
|
@@ -2438,7 +2438,7 @@ function Wr(e, t) {
|
|
|
2438
2438
|
}
|
|
2439
2439
|
const Nr = ({ data: e, onSourceClick: t, t: n }) => {
|
|
2440
2440
|
const { colors: r } = T(), [a, c] = R(null);
|
|
2441
|
-
return /* @__PURE__ */ f("div", { style: {
|
|
2441
|
+
return /* @__PURE__ */ f("div", { style: { paddingBlock: "16px" }, children: [
|
|
2442
2442
|
/* @__PURE__ */ o(
|
|
2443
2443
|
M.div,
|
|
2444
2444
|
{
|
|
@@ -2542,7 +2542,7 @@ const Nr = ({ data: e, onSourceClick: t, t: n }) => {
|
|
|
2542
2542
|
]
|
|
2543
2543
|
}
|
|
2544
2544
|
);
|
|
2545
|
-
},
|
|
2545
|
+
}, D = ({
|
|
2546
2546
|
color: e,
|
|
2547
2547
|
size: t = 24,
|
|
2548
2548
|
borderWidth: n = 7
|
|
@@ -2610,7 +2610,7 @@ function jr({
|
|
|
2610
2610
|
memory: e,
|
|
2611
2611
|
completed: t
|
|
2612
2612
|
}) {
|
|
2613
|
-
return e.error != null ? /* @__PURE__ */ o($, { size: 15, lineWidth: 2 }) : e.result != null ? /* @__PURE__ */ o(
|
|
2613
|
+
return e.error != null ? /* @__PURE__ */ o($, { size: 15, lineWidth: 2 }) : e.result != null ? /* @__PURE__ */ o(D, { size: 15, borderWidth: 2 }) : t ? /* @__PURE__ */ o(D, { size: 15, borderWidth: 2 }) : /* @__PURE__ */ o("span", { className: "explore-memory-loader" });
|
|
2614
2614
|
}
|
|
2615
2615
|
const le = 80;
|
|
2616
2616
|
function $r({
|
|
@@ -2698,7 +2698,7 @@ function $r({
|
|
|
2698
2698
|
}
|
|
2699
2699
|
);
|
|
2700
2700
|
}
|
|
2701
|
-
const Hr = ({ data: e, completed: t, t: n }) => /* @__PURE__ */ o("div", { style: {
|
|
2701
|
+
const Hr = ({ data: e, completed: t, t: n }) => /* @__PURE__ */ o("div", { style: { paddingBlock: "10px" }, children: e.memories.map((r) => /* @__PURE__ */ o(
|
|
2702
2702
|
$r,
|
|
2703
2703
|
{
|
|
2704
2704
|
memory: r,
|
|
@@ -2964,7 +2964,7 @@ function Kr({
|
|
|
2964
2964
|
width: 32,
|
|
2965
2965
|
paddingTop: 2
|
|
2966
2966
|
},
|
|
2967
|
-
children: /* @__PURE__ */ o(
|
|
2967
|
+
children: /* @__PURE__ */ o(D, { size: 15, borderWidth: 2 })
|
|
2968
2968
|
}
|
|
2969
2969
|
),
|
|
2970
2970
|
/* @__PURE__ */ f(
|
|
@@ -3065,10 +3065,10 @@ const Vr = ({
|
|
|
3065
3065
|
...p,
|
|
3066
3066
|
[y]: !p[y]
|
|
3067
3067
|
}));
|
|
3068
|
-
}, []), l =
|
|
3068
|
+
}, []), l = L(() => qr(a), [a]), h = s === 1 ? n.memoryChatChunkResultsInOneMemory : S(n.memoryChatChunkResultsInMemories, {
|
|
3069
3069
|
n: s
|
|
3070
3070
|
}), k = `${Xr(c, n)} ${h}`;
|
|
3071
|
-
return a.length === 0 ? /* @__PURE__ */ o("div", { style: {
|
|
3071
|
+
return a.length === 0 ? /* @__PURE__ */ o("div", { style: { paddingBlock: "10px" }, children: /* @__PURE__ */ o(
|
|
3072
3072
|
"div",
|
|
3073
3073
|
{
|
|
3074
3074
|
style: {
|
|
@@ -3078,7 +3078,7 @@ const Vr = ({
|
|
|
3078
3078
|
},
|
|
3079
3079
|
children: n.memorySearchExploreNoResults
|
|
3080
3080
|
}
|
|
3081
|
-
) }) : /* @__PURE__ */ f("div", { style: {
|
|
3081
|
+
) }) : /* @__PURE__ */ f("div", { style: { paddingBlock: "10px" }, children: [
|
|
3082
3082
|
l.map((y) => /* @__PURE__ */ o(
|
|
3083
3083
|
Kr,
|
|
3084
3084
|
{
|
|
@@ -3207,7 +3207,7 @@ function Zr({
|
|
|
3207
3207
|
}) : S(r.googleSearchingFor, {
|
|
3208
3208
|
query: s
|
|
3209
3209
|
});
|
|
3210
|
-
return /* @__PURE__ */ f("div", { style: {
|
|
3210
|
+
return /* @__PURE__ */ f("div", { style: { paddingBlock: "16px" }, children: [
|
|
3211
3211
|
/* @__PURE__ */ o(
|
|
3212
3212
|
M.div,
|
|
3213
3213
|
{
|
|
@@ -3236,8 +3236,8 @@ function et({
|
|
|
3236
3236
|
data: e,
|
|
3237
3237
|
t
|
|
3238
3238
|
}) {
|
|
3239
|
-
const { colors: n } = T(), [r, a] = R(!1), c =
|
|
3240
|
-
return s === 0 ? /* @__PURE__ */ o("div", { style: {
|
|
3239
|
+
const { colors: n } = T(), [r, a] = R(!1), c = L(() => [...e.results ?? []].sort((u, l) => u.rank - l.rank), [e.results]), s = c.length, m = s === 1 ? t.googleResultFound : S(t.googleResultsFound, { n: s });
|
|
3240
|
+
return s === 0 ? /* @__PURE__ */ o("div", { style: { paddingBlock: "10px" }, children: /* @__PURE__ */ o(
|
|
3241
3241
|
"div",
|
|
3242
3242
|
{
|
|
3243
3243
|
style: {
|
|
@@ -3247,7 +3247,7 @@ function et({
|
|
|
3247
3247
|
},
|
|
3248
3248
|
children: t.memorySearchExploreNoResults
|
|
3249
3249
|
}
|
|
3250
|
-
) }) : /* @__PURE__ */ f("div", { style: {
|
|
3250
|
+
) }) : /* @__PURE__ */ f("div", { style: { paddingBlock: "10px" }, children: [
|
|
3251
3251
|
/* @__PURE__ */ f(
|
|
3252
3252
|
M.div,
|
|
3253
3253
|
{
|
|
@@ -3371,18 +3371,18 @@ function Ce(e, t = 48) {
|
|
|
3371
3371
|
}
|
|
3372
3372
|
}
|
|
3373
3373
|
function at({ item: e }) {
|
|
3374
|
-
return e.error != null ? /* @__PURE__ */ o($, { size: 15, lineWidth: 2 }) : e.summary != null && e.summary !== "" ? /* @__PURE__ */ o(
|
|
3374
|
+
return e.error != null ? /* @__PURE__ */ o($, { size: 15, lineWidth: 2 }) : e.summary != null && e.summary !== "" ? /* @__PURE__ */ o(D, { size: 15, borderWidth: 2 }) : e.status != null ? /* @__PURE__ */ o("span", { className: "explore-memory-loader" }) : /* @__PURE__ */ o(D, { size: 15, borderWidth: 2 });
|
|
3375
3375
|
}
|
|
3376
3376
|
function it({ item: e }) {
|
|
3377
|
-
return e.error != null ? /* @__PURE__ */ o($, { size: 15, lineWidth: 2 }) : e.summary != null && e.summary !== "" ? /* @__PURE__ */ o(
|
|
3377
|
+
return e.error != null ? /* @__PURE__ */ o($, { size: 15, lineWidth: 2 }) : e.summary != null && e.summary !== "" ? /* @__PURE__ */ o(D, { size: 15, borderWidth: 2 }) : e.status != null ? /* @__PURE__ */ o("span", { className: "explore-memory-loader" }) : /* @__PURE__ */ o("span", { className: "explore-memory-loader" });
|
|
3378
3378
|
}
|
|
3379
3379
|
function st({
|
|
3380
3380
|
item: e,
|
|
3381
3381
|
t,
|
|
3382
3382
|
isLatest: n = !1
|
|
3383
3383
|
}) {
|
|
3384
|
-
const { colors: r } = T(), a = e.error ?? e.summary ?? "", c = a.length > 0, s = e.error != null, m =
|
|
3385
|
-
return
|
|
3384
|
+
const { colors: r } = T(), a = e.error ?? e.summary ?? "", c = a.length > 0, s = e.error != null, m = z(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 === "");
|
|
3385
|
+
return B(() => {
|
|
3386
3386
|
const k = m.current;
|
|
3387
3387
|
k != null && c && (k.scrollTop = k.scrollHeight);
|
|
3388
3388
|
}, [a, c]), /* @__PURE__ */ f(
|
|
@@ -3631,7 +3631,7 @@ function ct({
|
|
|
3631
3631
|
t: r
|
|
3632
3632
|
}) {
|
|
3633
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 });
|
|
3634
|
-
return /* @__PURE__ */ f("div", { style: {
|
|
3634
|
+
return /* @__PURE__ */ f("div", { style: { paddingBlock: "16px" }, children: [
|
|
3635
3635
|
/* @__PURE__ */ o(
|
|
3636
3636
|
M.div,
|
|
3637
3637
|
{
|
|
@@ -3661,13 +3661,13 @@ function dt({
|
|
|
3661
3661
|
isLatest: t = !1,
|
|
3662
3662
|
t: n
|
|
3663
3663
|
}) {
|
|
3664
|
-
const { colors: r } = T(), [a, c] = R(!1), s = e.results ?? [], { successCount: m, errorCount: d } =
|
|
3664
|
+
const { colors: r } = T(), [a, c] = R(!1), s = e.results ?? [], { successCount: m, errorCount: d } = L(() => {
|
|
3665
3665
|
let g = 0, b = 0;
|
|
3666
3666
|
for (const x of s)
|
|
3667
3667
|
x.error != null ? b += 1 : g += 1;
|
|
3668
3668
|
return { successCount: g, errorCount: b };
|
|
3669
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: {
|
|
3670
|
+
return u === 0 ? /* @__PURE__ */ o("div", { style: { paddingBlock: "10px" }, children: /* @__PURE__ */ o(
|
|
3671
3671
|
"div",
|
|
3672
3672
|
{
|
|
3673
3673
|
style: {
|
|
@@ -3677,7 +3677,7 @@ function dt({
|
|
|
3677
3677
|
},
|
|
3678
3678
|
children: n.memorySearchExploreNoResults
|
|
3679
3679
|
}
|
|
3680
|
-
) }) : t ? /* @__PURE__ */ f("div", { style: {
|
|
3680
|
+
) }) : t ? /* @__PURE__ */ f("div", { style: { paddingBlock: "10px" }, children: [
|
|
3681
3681
|
/* @__PURE__ */ o(
|
|
3682
3682
|
M.div,
|
|
3683
3683
|
{
|
|
@@ -3712,7 +3712,7 @@ function dt({
|
|
|
3712
3712
|
isLatest: t
|
|
3713
3713
|
}
|
|
3714
3714
|
))
|
|
3715
|
-
] }) : /* @__PURE__ */ f("div", { style: {
|
|
3715
|
+
] }) : /* @__PURE__ */ f("div", { style: { paddingBlock: "10px" }, children: [
|
|
3716
3716
|
/* @__PURE__ */ f(
|
|
3717
3717
|
M.div,
|
|
3718
3718
|
{
|
|
@@ -3779,7 +3779,7 @@ const ut = ({ data: e, isLatest: t = !1, durationSeconds: n, t: r }) => e.result
|
|
|
3779
3779
|
}
|
|
3780
3780
|
), mt = (e) => {
|
|
3781
3781
|
const { colors: t } = T(), { isLatest: n = !1, durationSeconds: r, t: a } = e, c = a.memoryChatThinking;
|
|
3782
|
-
return /* @__PURE__ */ f("div", { style: {
|
|
3782
|
+
return /* @__PURE__ */ f("div", { style: { paddingBlock: "16px" }, children: [
|
|
3783
3783
|
/* @__PURE__ */ o(
|
|
3784
3784
|
M.div,
|
|
3785
3785
|
{
|
|
@@ -3810,7 +3810,7 @@ const ut = ({ data: e, isLatest: t = !1, durationSeconds: n, t: r }) => e.result
|
|
|
3810
3810
|
] });
|
|
3811
3811
|
};
|
|
3812
3812
|
function ht({ item: e }) {
|
|
3813
|
-
return e.error != null ? /* @__PURE__ */ o($, { size: 15, lineWidth: 2 }) : e.result != null ? /* @__PURE__ */ o(
|
|
3813
|
+
return e.error != null ? /* @__PURE__ */ o($, { size: 15, lineWidth: 2 }) : e.result != null ? /* @__PURE__ */ o(D, { size: 15, borderWidth: 2 }) : /* @__PURE__ */ o("span", { className: "explore-memory-loader" });
|
|
3814
3814
|
}
|
|
3815
3815
|
function pt(e, t) {
|
|
3816
3816
|
return S(t.searchingInMemoriesOfType, {
|
|
@@ -3890,13 +3890,13 @@ function gt({
|
|
|
3890
3890
|
);
|
|
3891
3891
|
}
|
|
3892
3892
|
const yt = ({ data: e, isLatest: t = !1, durationSeconds: n, t: r }) => {
|
|
3893
|
-
const { colors: a } = T(), c =
|
|
3893
|
+
const { colors: a } = T(), c = L(() => {
|
|
3894
3894
|
let s = -1;
|
|
3895
3895
|
return e.memoryTypes.forEach((m, d) => {
|
|
3896
3896
|
m.result == null && m.error == null && (s = d);
|
|
3897
3897
|
}), s;
|
|
3898
3898
|
}, [e.memoryTypes]);
|
|
3899
|
-
return /* @__PURE__ */ f("div", { style: {
|
|
3899
|
+
return /* @__PURE__ */ f("div", { style: { paddingBlock: "10px" }, children: [
|
|
3900
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(
|
|
3901
3901
|
gt,
|
|
3902
3902
|
{
|
|
@@ -3937,15 +3937,15 @@ function St(e) {
|
|
|
3937
3937
|
return t == null || t === "" ? 1 : e.reasoningCompleted === !0 ? 2 : 1;
|
|
3938
3938
|
}
|
|
3939
3939
|
function xt({ phase: e }) {
|
|
3940
|
-
return e === 3 ? /* @__PURE__ */ o(
|
|
3940
|
+
return e === 3 ? /* @__PURE__ */ o(D, { size: 15, borderWidth: 2 }) : /* @__PURE__ */ o("span", { className: "explore-memory-loader" });
|
|
3941
3941
|
}
|
|
3942
3942
|
function Tt({
|
|
3943
3943
|
item: e,
|
|
3944
3944
|
t,
|
|
3945
3945
|
isActiveRow: n
|
|
3946
3946
|
}) {
|
|
3947
|
-
const { colors: r } = T(), a = bt(e), c = St(e), s = e.reasoning, m = s != null && s.length > 0, d =
|
|
3948
|
-
|
|
3947
|
+
const { colors: r } = T(), a = bt(e), c = St(e), s = e.reasoning, m = s != null && s.length > 0, d = z(null), [u, l] = R(!1), h = a && n, k = c === 2 && n && !j(e);
|
|
3948
|
+
B(() => {
|
|
3949
3949
|
const g = d.current;
|
|
3950
3950
|
g != null && c === 1 && m && (g.scrollTop = g.scrollHeight);
|
|
3951
3951
|
}, [s, c, m]);
|
|
@@ -4133,13 +4133,13 @@ function Tt({
|
|
|
4133
4133
|
);
|
|
4134
4134
|
}
|
|
4135
4135
|
const vt = ({ data: e, isLatest: t = !1, durationSeconds: n, t: r }) => {
|
|
4136
|
-
const { colors: a } = T(), c =
|
|
4136
|
+
const { colors: a } = T(), c = L(() => {
|
|
4137
4137
|
let s = -1;
|
|
4138
4138
|
return e.memoryTypes.forEach((m, d) => {
|
|
4139
4139
|
j(m) || (s = d);
|
|
4140
4140
|
}), s;
|
|
4141
4141
|
}, [e.memoryTypes]);
|
|
4142
|
-
return /* @__PURE__ */ f("div", { style: {
|
|
4142
|
+
return /* @__PURE__ */ f("div", { style: { paddingBlock: "10px" }, children: [
|
|
4143
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(
|
|
4144
4144
|
Tt,
|
|
4145
4145
|
{
|
|
@@ -4164,7 +4164,7 @@ const vt = ({ data: e, isLatest: t = !1, durationSeconds: n, t: r }) => {
|
|
|
4164
4164
|
] });
|
|
4165
4165
|
};
|
|
4166
4166
|
function Ct(e) {
|
|
4167
|
-
return e.some((r) => r.result == null && r.error == null) ? /* @__PURE__ */ o("span", { className: "explore-memory-loader" }) : e.some((r) => r.error != null) ? /* @__PURE__ */ o($, { size: 15, lineWidth: 2 }) : /* @__PURE__ */ o(
|
|
4167
|
+
return e.some((r) => r.result == null && r.error == null) ? /* @__PURE__ */ o("span", { className: "explore-memory-loader" }) : e.some((r) => r.error != null) ? /* @__PURE__ */ o($, { size: 15, lineWidth: 2 }) : /* @__PURE__ */ o(D, { size: 15, borderWidth: 2 });
|
|
4168
4168
|
}
|
|
4169
4169
|
function wt({
|
|
4170
4170
|
item: e,
|
|
@@ -4545,11 +4545,11 @@ const Rt = ({
|
|
|
4545
4545
|
...h,
|
|
4546
4546
|
[l]: !h[l]
|
|
4547
4547
|
}));
|
|
4548
|
-
}, []), u =
|
|
4548
|
+
}, []), u = L(
|
|
4549
4549
|
() => It(e.queries),
|
|
4550
4550
|
[e.queries]
|
|
4551
4551
|
);
|
|
4552
|
-
return /* @__PURE__ */ f("div", { style: {
|
|
4552
|
+
return /* @__PURE__ */ f("div", { style: { paddingBlock: "10px" }, children: [
|
|
4553
4553
|
t && !n && e.queries.length === 0 ? /* @__PURE__ */ o(
|
|
4554
4554
|
F,
|
|
4555
4555
|
{
|
|
@@ -4584,7 +4584,7 @@ const Rt = ({
|
|
|
4584
4584
|
] });
|
|
4585
4585
|
}, Ft = ({ data: e, onSearchResultClick: t, t: n }) => {
|
|
4586
4586
|
const { colors: r } = T(), a = e.response.items, c = !!t, [s, m] = R(null);
|
|
4587
|
-
return /* @__PURE__ */ f("div", { style: {
|
|
4587
|
+
return /* @__PURE__ */ f("div", { style: { paddingBlock: "16px" }, children: [
|
|
4588
4588
|
/* @__PURE__ */ o(
|
|
4589
4589
|
M.div,
|
|
4590
4590
|
{
|
|
@@ -4745,7 +4745,7 @@ const Rt = ({
|
|
|
4745
4745
|
] });
|
|
4746
4746
|
}, N = ({ message: e }) => {
|
|
4747
4747
|
const { colors: t } = T();
|
|
4748
|
-
return /* @__PURE__ */ o("div", { style: {
|
|
4748
|
+
return /* @__PURE__ */ o("div", { style: { paddingBlock: "16px" }, children: /* @__PURE__ */ o(
|
|
4749
4749
|
M.div,
|
|
4750
4750
|
{
|
|
4751
4751
|
initial: { opacity: 0, y: -10 },
|
|
@@ -4799,8 +4799,8 @@ const Pt = ({
|
|
|
4799
4799
|
onSearchResultClick: s,
|
|
4800
4800
|
onExploreQueryResultClick: m
|
|
4801
4801
|
}) => {
|
|
4802
|
-
const { theme: d, colors: u } = T(), l =
|
|
4803
|
-
|
|
4802
|
+
const { theme: d, colors: u } = T(), l = z(null);
|
|
4803
|
+
B(() => {
|
|
4804
4804
|
l.current && (l.current.scrollTop = l.current.scrollHeight);
|
|
4805
4805
|
}, [e.length]);
|
|
4806
4806
|
const h = (y) => {
|
|
@@ -4825,7 +4825,7 @@ const Pt = ({
|
|
|
4825
4825
|
);
|
|
4826
4826
|
case "FindMemories":
|
|
4827
4827
|
return /* @__PURE__ */ o(
|
|
4828
|
-
|
|
4828
|
+
zr,
|
|
4829
4829
|
{
|
|
4830
4830
|
data: p,
|
|
4831
4831
|
isLatest: y.isLatest,
|
|
@@ -4835,7 +4835,7 @@ const Pt = ({
|
|
|
4835
4835
|
);
|
|
4836
4836
|
case "FindMemoriesResult":
|
|
4837
4837
|
return /* @__PURE__ */ o(
|
|
4838
|
-
|
|
4838
|
+
Dr,
|
|
4839
4839
|
{
|
|
4840
4840
|
data: p,
|
|
4841
4841
|
t: a
|
|
@@ -4843,7 +4843,7 @@ const Pt = ({
|
|
|
4843
4843
|
);
|
|
4844
4844
|
case "Search":
|
|
4845
4845
|
return /* @__PURE__ */ o(
|
|
4846
|
-
|
|
4846
|
+
Br,
|
|
4847
4847
|
{
|
|
4848
4848
|
data: p,
|
|
4849
4849
|
isLatest: y.isLatest,
|
|
@@ -4853,7 +4853,7 @@ const Pt = ({
|
|
|
4853
4853
|
);
|
|
4854
4854
|
case "FindSources":
|
|
4855
4855
|
return /* @__PURE__ */ o(
|
|
4856
|
-
|
|
4856
|
+
Lr,
|
|
4857
4857
|
{
|
|
4858
4858
|
data: p,
|
|
4859
4859
|
isLatest: y.isLatest,
|
|
@@ -4974,7 +4974,7 @@ const Pt = ({
|
|
|
4974
4974
|
return p.taskType === "StreamingChatCompletion" && p.eventType === "Completed" ? null : p.eventType === "Error" && "message" in p ? /* @__PURE__ */ o(N, { message: p.message }) : null;
|
|
4975
4975
|
};
|
|
4976
4976
|
if (e.length === 0)
|
|
4977
|
-
return n ? /* @__PURE__ */ o("div", { style: { width: "fit-content" }, children: /* @__PURE__ */ o(N, { message: n.message }) }) : t ? /* @__PURE__ */ o("div", { style: { width: "fit-content",
|
|
4977
|
+
return n ? /* @__PURE__ */ o("div", { style: { width: "fit-content" }, children: /* @__PURE__ */ o(N, { message: n.message }) }) : t ? /* @__PURE__ */ o("div", { style: { width: "fit-content", paddingBlock: "16px" }, children: /* @__PURE__ */ o(
|
|
4978
4978
|
F,
|
|
4979
4979
|
{
|
|
4980
4980
|
text: r ?? a.processingYourTask,
|
|
@@ -5061,7 +5061,7 @@ const Pt = ({
|
|
|
5061
5061
|
export {
|
|
5062
5062
|
Ut as AgentTaskProgress,
|
|
5063
5063
|
Rr as AgentTaskThemeProvider,
|
|
5064
|
-
|
|
5064
|
+
D as Checkmark,
|
|
5065
5065
|
$t as FencyProvider,
|
|
5066
5066
|
Ft as MemorySearchCompletedResults,
|
|
5067
5067
|
_e as StreamEventManager,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fencyai/react",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.182",
|
|
4
4
|
"description": "React components and hooks for the Fency AI platform",
|
|
5
5
|
"author": "staklau <steinaageklaussen@gmail.com>",
|
|
6
6
|
"homepage": "",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"@microsoft/fetch-event-source": "^2.0.1"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@fencyai/js": "^0.1.
|
|
41
|
+
"@fencyai/js": "^0.1.182",
|
|
42
42
|
"@microsoft/api-documenter": "^7.30.0",
|
|
43
43
|
"@testing-library/react": "^16.3.2",
|
|
44
44
|
"@types/jest": "^30.0.0",
|
|
@@ -55,7 +55,7 @@
|
|
|
55
55
|
"vite-plugin-lib-inject-css": "^2.1.1"
|
|
56
56
|
},
|
|
57
57
|
"peerDependencies": {
|
|
58
|
-
"@fencyai/js": "^0.1.
|
|
58
|
+
"@fencyai/js": "^0.1.182",
|
|
59
59
|
"motion": "^11.15.0 || ^12.0.0",
|
|
60
60
|
"react": ">=16.8.0",
|
|
61
61
|
"react-markdown": "^10.1.0",
|
|
@@ -68,5 +68,5 @@
|
|
|
68
68
|
"optional": false
|
|
69
69
|
}
|
|
70
70
|
},
|
|
71
|
-
"gitHead": "
|
|
71
|
+
"gitHead": "f21ae6e78170dc43e5148d78223767891da82460"
|
|
72
72
|
}
|