@fencyai/react 0.1.142 → 0.1.144
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/AgentTaskProgressVerbose.d.ts.map +1 -1
- package/dist/agent-task/data-types/MemoryChatCompletionExploreMemories.d.ts +16 -0
- package/dist/agent-task/data-types/MemoryChatCompletionExploreMemories.d.ts.map +1 -0
- package/dist/agent-task/data-types/MemoryChatCompletionFindMemories.d.ts +14 -0
- package/dist/agent-task/data-types/MemoryChatCompletionFindMemories.d.ts.map +1 -0
- package/dist/agent-task/data-types/MemoryChatCompletionFindMemoriesResult.d.ts +12 -0
- package/dist/agent-task/data-types/MemoryChatCompletionFindMemoriesResult.d.ts.map +1 -0
- package/dist/agent-task/data-types/MemoryChatCompletionSearch.d.ts.map +1 -1
- package/dist/agent-task/translations.d.ts +12 -0
- package/dist/agent-task/translations.d.ts.map +1 -1
- package/dist/index.js +749 -487
- package/package.json +4 -4
- package/dist/agent-task/data-types/MemoryChatCompletionExploreMemory.d.ts +0 -16
- package/dist/agent-task/data-types/MemoryChatCompletionExploreMemory.d.ts.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,78 +1,78 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { createStream as
|
|
3
|
-
import { createContext as
|
|
4
|
-
import { useInView as
|
|
5
|
-
import
|
|
6
|
-
import { Prism as
|
|
7
|
-
import
|
|
8
|
-
import './assets/index.css';const
|
|
1
|
+
import { jsxs as y, jsx as i, Fragment as E } from "react/jsx-runtime";
|
|
2
|
+
import { createStream as V, isStreamTimeoutEvent as Q, isStreamNotFoundEvent as Z, isAgentTaskProgressItemUpdatedEvent as ee, createAgentTask as te } from "@fencyai/js";
|
|
3
|
+
import { createContext as ne, useState as x, useRef as I, useEffect as w, useCallback as H, useContext as re, useMemo as K } from "react";
|
|
4
|
+
import { useInView as oe, motion as S, AnimatePresence as q } from "motion/react";
|
|
5
|
+
import ie from "react-markdown";
|
|
6
|
+
import { Prism as G } from "react-syntax-highlighter";
|
|
7
|
+
import ae from "remark-gfm";
|
|
8
|
+
import './assets/index.css';const X = ne(
|
|
9
9
|
void 0
|
|
10
10
|
);
|
|
11
|
-
async function
|
|
11
|
+
async function se(e, t) {
|
|
12
12
|
const n = e.getReader();
|
|
13
13
|
let r;
|
|
14
14
|
for (; !(r = await n.read()).done; )
|
|
15
15
|
t(r.value);
|
|
16
16
|
}
|
|
17
|
-
function
|
|
18
|
-
let t, n, r,
|
|
19
|
-
return function(
|
|
20
|
-
t === void 0 ? (t =
|
|
21
|
-
const
|
|
22
|
-
let
|
|
23
|
-
for (; n <
|
|
24
|
-
|
|
25
|
-
let
|
|
26
|
-
for (; n <
|
|
17
|
+
function le(e) {
|
|
18
|
+
let t, n, r, l = !1;
|
|
19
|
+
return function(a) {
|
|
20
|
+
t === void 0 ? (t = a, n = 0, r = -1) : t = de(t, a);
|
|
21
|
+
const c = t.length;
|
|
22
|
+
let s = 0;
|
|
23
|
+
for (; n < c; ) {
|
|
24
|
+
l && (t[n] === 10 && (s = ++n), l = !1);
|
|
25
|
+
let o = -1;
|
|
26
|
+
for (; n < c && o === -1; ++n)
|
|
27
27
|
switch (t[n]) {
|
|
28
28
|
case 58:
|
|
29
|
-
r === -1 && (r = n -
|
|
29
|
+
r === -1 && (r = n - s);
|
|
30
30
|
break;
|
|
31
31
|
case 13:
|
|
32
|
-
|
|
32
|
+
l = !0;
|
|
33
33
|
case 10:
|
|
34
|
-
|
|
34
|
+
o = n;
|
|
35
35
|
break;
|
|
36
36
|
}
|
|
37
|
-
if (
|
|
37
|
+
if (o === -1)
|
|
38
38
|
break;
|
|
39
|
-
e(t.subarray(
|
|
39
|
+
e(t.subarray(s, o), r), s = n, r = -1;
|
|
40
40
|
}
|
|
41
|
-
|
|
41
|
+
s === c ? t = void 0 : s !== 0 && (t = t.subarray(s), n -= s);
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
|
-
function
|
|
45
|
-
let r =
|
|
46
|
-
const
|
|
47
|
-
return function(
|
|
48
|
-
if (
|
|
49
|
-
n == null || n(r), r =
|
|
50
|
-
else if (
|
|
51
|
-
const
|
|
52
|
-
switch (
|
|
44
|
+
function ce(e, t, n) {
|
|
45
|
+
let r = U();
|
|
46
|
+
const l = new TextDecoder();
|
|
47
|
+
return function(a, c) {
|
|
48
|
+
if (a.length === 0)
|
|
49
|
+
n == null || n(r), r = U();
|
|
50
|
+
else if (c > 0) {
|
|
51
|
+
const s = l.decode(a.subarray(0, c)), o = c + (a[c + 1] === 32 ? 2 : 1), d = l.decode(a.subarray(o));
|
|
52
|
+
switch (s) {
|
|
53
53
|
case "data":
|
|
54
54
|
r.data = r.data ? r.data + `
|
|
55
|
-
` +
|
|
55
|
+
` + d : d;
|
|
56
56
|
break;
|
|
57
57
|
case "event":
|
|
58
|
-
r.event =
|
|
58
|
+
r.event = d;
|
|
59
59
|
break;
|
|
60
60
|
case "id":
|
|
61
|
-
e(r.id =
|
|
61
|
+
e(r.id = d);
|
|
62
62
|
break;
|
|
63
63
|
case "retry":
|
|
64
|
-
const
|
|
65
|
-
isNaN(
|
|
64
|
+
const g = parseInt(d, 10);
|
|
65
|
+
isNaN(g) || t(r.retry = g);
|
|
66
66
|
break;
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
|
-
function
|
|
71
|
+
function de(e, t) {
|
|
72
72
|
const n = new Uint8Array(e.length + t.length);
|
|
73
73
|
return n.set(e), n.set(t, e.length), n;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function U() {
|
|
76
76
|
return {
|
|
77
77
|
data: "",
|
|
78
78
|
event: "",
|
|
@@ -80,68 +80,68 @@ function O() {
|
|
|
80
80
|
retry: void 0
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
|
-
var
|
|
83
|
+
var ue = function(e, t) {
|
|
84
84
|
var n = {};
|
|
85
85
|
for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
|
|
86
86
|
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
87
|
-
for (var
|
|
88
|
-
t.indexOf(r[
|
|
87
|
+
for (var l = 0, r = Object.getOwnPropertySymbols(e); l < r.length; l++)
|
|
88
|
+
t.indexOf(r[l]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[l]) && (n[r[l]] = e[r[l]]);
|
|
89
89
|
return n;
|
|
90
90
|
};
|
|
91
|
-
const
|
|
92
|
-
function
|
|
93
|
-
var { signal: n, headers: r, onopen:
|
|
94
|
-
return new Promise((
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
let
|
|
98
|
-
function p() {
|
|
99
|
-
u.abort(), document.hidden || E();
|
|
100
|
-
}
|
|
101
|
-
m || document.addEventListener("visibilitychange", p);
|
|
102
|
-
let f = se, S = 0;
|
|
91
|
+
const z = "text/event-stream", me = 1e3, _ = "last-event-id";
|
|
92
|
+
function ge(e, t) {
|
|
93
|
+
var { signal: n, headers: r, onopen: l, onmessage: u, onclose: a, onerror: c, openWhenHidden: s, fetch: o } = t, d = ue(t, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
|
|
94
|
+
return new Promise((g, m) => {
|
|
95
|
+
const p = Object.assign({}, r);
|
|
96
|
+
p.accept || (p.accept = z);
|
|
97
|
+
let h;
|
|
103
98
|
function k() {
|
|
104
|
-
|
|
99
|
+
h.abort(), document.hidden || M();
|
|
100
|
+
}
|
|
101
|
+
s || document.addEventListener("visibilitychange", k);
|
|
102
|
+
let f = me, b = 0;
|
|
103
|
+
function T() {
|
|
104
|
+
document.removeEventListener("visibilitychange", k), window.clearTimeout(b), h.abort();
|
|
105
105
|
}
|
|
106
106
|
n == null || n.addEventListener("abort", () => {
|
|
107
|
-
|
|
107
|
+
T(), g();
|
|
108
108
|
});
|
|
109
|
-
const
|
|
110
|
-
async function
|
|
109
|
+
const R = o ?? window.fetch, F = l ?? he;
|
|
110
|
+
async function M() {
|
|
111
111
|
var D;
|
|
112
|
-
|
|
112
|
+
h = new AbortController();
|
|
113
113
|
try {
|
|
114
|
-
const
|
|
115
|
-
await
|
|
116
|
-
|
|
117
|
-
}, (
|
|
118
|
-
f =
|
|
119
|
-
},
|
|
120
|
-
} catch (
|
|
121
|
-
if (!
|
|
114
|
+
const A = await R(e, Object.assign(Object.assign({}, d), { headers: p, signal: h.signal }));
|
|
115
|
+
await F(A), await se(A.body, le(ce((C) => {
|
|
116
|
+
C ? p[_] = C : delete p[_];
|
|
117
|
+
}, (C) => {
|
|
118
|
+
f = C;
|
|
119
|
+
}, u))), a == null || a(), T(), g();
|
|
120
|
+
} catch (A) {
|
|
121
|
+
if (!h.signal.aborted)
|
|
122
122
|
try {
|
|
123
|
-
const
|
|
124
|
-
window.clearTimeout(
|
|
125
|
-
} catch (
|
|
126
|
-
|
|
123
|
+
const C = (D = c == null ? void 0 : c(A)) !== null && D !== void 0 ? D : f;
|
|
124
|
+
window.clearTimeout(b), b = window.setTimeout(M, C);
|
|
125
|
+
} catch (C) {
|
|
126
|
+
T(), m(C);
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
|
|
130
|
+
M();
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function he(e) {
|
|
134
134
|
const t = e.headers.get("content-type");
|
|
135
|
-
if (!(t != null && t.startsWith(
|
|
136
|
-
throw new Error(`Expected content-type to be ${
|
|
135
|
+
if (!(t != null && t.startsWith(z)))
|
|
136
|
+
throw new Error(`Expected content-type to be ${z}, Actual: ${t}`);
|
|
137
137
|
}
|
|
138
|
-
function
|
|
138
|
+
function pe(e) {
|
|
139
139
|
const t = atob(e), n = new Uint8Array(t.length);
|
|
140
140
|
for (let r = 0; r < t.length; r++)
|
|
141
141
|
n[r] = t.charCodeAt(r);
|
|
142
142
|
return new TextDecoder("utf-8").decode(n);
|
|
143
143
|
}
|
|
144
|
-
class
|
|
144
|
+
class fe {
|
|
145
145
|
constructor(t) {
|
|
146
146
|
this.eventSources = /* @__PURE__ */ new Map(), this.subscribers = /* @__PURE__ */ new Map(), this.fency = t;
|
|
147
147
|
}
|
|
@@ -151,36 +151,36 @@ class ue {
|
|
|
151
151
|
*/
|
|
152
152
|
updateStreams(t) {
|
|
153
153
|
t.forEach((r) => {
|
|
154
|
-
const
|
|
155
|
-
this.eventSources.has(
|
|
154
|
+
const l = r.stream.id;
|
|
155
|
+
this.eventSources.has(l) || this.connectStream(r);
|
|
156
156
|
});
|
|
157
157
|
const n = new Set(t.map((r) => r.stream.id));
|
|
158
|
-
this.eventSources.forEach((r,
|
|
159
|
-
n.has(
|
|
158
|
+
this.eventSources.forEach((r, l) => {
|
|
159
|
+
n.has(l) || (r.abort(), this.eventSources.delete(l));
|
|
160
160
|
});
|
|
161
161
|
}
|
|
162
162
|
connectStream(t) {
|
|
163
163
|
const n = t.stream.id, r = new AbortController();
|
|
164
164
|
this.eventSources.set(n, r);
|
|
165
|
-
const
|
|
165
|
+
const l = `${this.fency.baseUrl}/sse/streams/${n}`, u = {
|
|
166
166
|
"X-Fency-Publishable-Key": this.fency.publishableKey,
|
|
167
167
|
"X-Fency-Stream-Token": t.stream.token
|
|
168
168
|
};
|
|
169
|
-
|
|
170
|
-
headers:
|
|
169
|
+
ge(l, {
|
|
170
|
+
headers: u,
|
|
171
171
|
signal: r.signal,
|
|
172
|
-
async onopen(
|
|
173
|
-
if (!
|
|
174
|
-
throw new Error(`Client error ${
|
|
172
|
+
async onopen(a) {
|
|
173
|
+
if (!a.ok && a.status >= 400 && a.status < 500 && a.status !== 429)
|
|
174
|
+
throw new Error(`Client error ${a.status}`);
|
|
175
175
|
},
|
|
176
|
-
onmessage: (
|
|
177
|
-
if (
|
|
178
|
-
const
|
|
179
|
-
this.broadcast(
|
|
176
|
+
onmessage: (a) => {
|
|
177
|
+
if (a.data) {
|
|
178
|
+
const c = pe(a.data);
|
|
179
|
+
this.broadcast(c, n);
|
|
180
180
|
}
|
|
181
181
|
},
|
|
182
|
-
onerror: (
|
|
183
|
-
throw console.error("EventSource error for stream", n, ":",
|
|
182
|
+
onerror: (a) => {
|
|
183
|
+
throw console.error("EventSource error for stream", n, ":", a), this.broadcastError(n), a;
|
|
184
184
|
},
|
|
185
185
|
onclose() {
|
|
186
186
|
}
|
|
@@ -212,99 +212,99 @@ class ue {
|
|
|
212
212
|
this.eventSources.forEach((t) => t.abort()), this.eventSources.clear(), this.subscribers.clear();
|
|
213
213
|
}
|
|
214
214
|
}
|
|
215
|
-
const
|
|
215
|
+
const ye = 12e4, ke = (e) => {
|
|
216
216
|
const t = Date.now();
|
|
217
|
-
return e.filter((n) => t - n.createdAt <
|
|
217
|
+
return e.filter((n) => t - n.createdAt < ye);
|
|
218
218
|
};
|
|
219
|
-
function
|
|
220
|
-
const [r,
|
|
219
|
+
function et({ fency: e, fetchCreateStreamClientToken: t, children: n }) {
|
|
220
|
+
const [r, l] = x(
|
|
221
221
|
null
|
|
222
|
-
), [
|
|
222
|
+
), [u, a] = x(!0), [c, s] = x(null), [o, d] = x([]), g = I(null), m = I(null);
|
|
223
223
|
w(() => {
|
|
224
224
|
e.then((f) => {
|
|
225
|
-
|
|
225
|
+
l(f), a(!1);
|
|
226
226
|
}).catch((f) => {
|
|
227
|
-
|
|
227
|
+
s(f), a(!1);
|
|
228
228
|
});
|
|
229
229
|
}, [e]), w(() => {
|
|
230
|
-
r && !
|
|
230
|
+
r && !m.current && (m.current = new fe(r));
|
|
231
231
|
}, [r]), w(() => {
|
|
232
|
-
|
|
233
|
-
}, [
|
|
232
|
+
m.current && m.current.updateStreams(o);
|
|
233
|
+
}, [o]), w(() => () => {
|
|
234
234
|
var f;
|
|
235
|
-
(f =
|
|
235
|
+
(f = m.current) == null || f.cleanup();
|
|
236
236
|
}, []);
|
|
237
|
-
const
|
|
237
|
+
const p = H(
|
|
238
238
|
async (f = 3e4) => {
|
|
239
|
-
if (
|
|
240
|
-
return
|
|
241
|
-
const
|
|
242
|
-
if (
|
|
243
|
-
return
|
|
244
|
-
const
|
|
239
|
+
if (g.current)
|
|
240
|
+
return g.current;
|
|
241
|
+
const b = Date.now(), T = o.length > 0 ? o[o.length - 1] : null;
|
|
242
|
+
if (T && b - T.createdAt < f)
|
|
243
|
+
return T.stream;
|
|
244
|
+
const R = (async () => {
|
|
245
245
|
if (!r)
|
|
246
246
|
throw new Error("Fency instance not initialized");
|
|
247
|
-
const
|
|
247
|
+
const F = await t(), M = await V({
|
|
248
248
|
pk: r.publishableKey,
|
|
249
249
|
baseUrl: r.baseUrl,
|
|
250
|
-
clientToken: (
|
|
250
|
+
clientToken: (F == null ? void 0 : F.clientToken) ?? ""
|
|
251
251
|
});
|
|
252
|
-
if (
|
|
252
|
+
if (M.type === "success") {
|
|
253
253
|
const D = {
|
|
254
|
-
stream:
|
|
254
|
+
stream: M.stream,
|
|
255
255
|
createdAt: Date.now()
|
|
256
256
|
};
|
|
257
|
-
return
|
|
258
|
-
const
|
|
259
|
-
return
|
|
260
|
-
}),
|
|
257
|
+
return d((A) => {
|
|
258
|
+
const C = [...A, D];
|
|
259
|
+
return ke(C);
|
|
260
|
+
}), g.current = null, M.stream;
|
|
261
261
|
} else
|
|
262
|
-
throw
|
|
262
|
+
throw g.current = null, new Error("Failed to create stream");
|
|
263
263
|
})();
|
|
264
|
-
return
|
|
264
|
+
return g.current = R, R;
|
|
265
265
|
},
|
|
266
|
-
[r,
|
|
266
|
+
[r, o]
|
|
267
267
|
);
|
|
268
|
-
if (
|
|
269
|
-
return /* @__PURE__ */
|
|
268
|
+
if (c)
|
|
269
|
+
return /* @__PURE__ */ y("div", { children: [
|
|
270
270
|
"Fency error: ",
|
|
271
|
-
|
|
271
|
+
c.message
|
|
272
272
|
] });
|
|
273
273
|
if (!r)
|
|
274
274
|
return null;
|
|
275
|
-
const
|
|
275
|
+
const h = o.length > 0 ? o[o.length - 1] : null, k = {
|
|
276
276
|
fency: r,
|
|
277
|
-
loading:
|
|
278
|
-
error:
|
|
279
|
-
activeStreams:
|
|
280
|
-
latestStream:
|
|
281
|
-
eventManager:
|
|
282
|
-
getOrCreateStream:
|
|
277
|
+
loading: u,
|
|
278
|
+
error: c,
|
|
279
|
+
activeStreams: o,
|
|
280
|
+
latestStream: h,
|
|
281
|
+
eventManager: m.current,
|
|
282
|
+
getOrCreateStream: p
|
|
283
283
|
};
|
|
284
|
-
return /* @__PURE__ */ i(
|
|
284
|
+
return /* @__PURE__ */ i(X.Provider, { value: k, children: n });
|
|
285
285
|
}
|
|
286
|
-
function
|
|
287
|
-
const e =
|
|
286
|
+
function J() {
|
|
287
|
+
const e = re(X);
|
|
288
288
|
if (e === void 0)
|
|
289
289
|
throw new Error("useFencyContext must be used within a FencyProvider");
|
|
290
290
|
return e;
|
|
291
291
|
}
|
|
292
|
-
const
|
|
292
|
+
const Se = (e) => {
|
|
293
293
|
try {
|
|
294
294
|
const t = JSON.parse(e);
|
|
295
|
-
return
|
|
295
|
+
return be(t);
|
|
296
296
|
} catch (t) {
|
|
297
297
|
return console.error("Error parsing message:", t), null;
|
|
298
298
|
}
|
|
299
|
-
},
|
|
299
|
+
}, be = (e) => Q(e) ? Te(e) : Z(e) ? ve(e) : ee(e) ? xe(e) : null, Te = (e) => ({
|
|
300
300
|
type: "STREAM_TIMEOUT",
|
|
301
301
|
streamId: e.streamId,
|
|
302
302
|
timestamp: e.timestamp
|
|
303
|
-
}),
|
|
303
|
+
}), ve = (e) => ({
|
|
304
304
|
type: "STREAM_NOT_FOUND",
|
|
305
305
|
streamId: e.streamId,
|
|
306
306
|
timestamp: e.timestamp
|
|
307
|
-
}),
|
|
307
|
+
}), xe = (e) => ({
|
|
308
308
|
type: "AGENT_TASK_PROGRESS_ITEM_UPDATED",
|
|
309
309
|
streamId: e.streamId,
|
|
310
310
|
agentTaskId: e.agentTaskId,
|
|
@@ -312,31 +312,31 @@ const ye = (e) => {
|
|
|
312
312
|
timestamp: e.timestamp,
|
|
313
313
|
createdAt: e.createdAt,
|
|
314
314
|
data: JSON.parse(e.data)
|
|
315
|
-
}),
|
|
316
|
-
const t =
|
|
315
|
+
}), Ce = (e) => {
|
|
316
|
+
const t = J(), [n, r] = x(null), l = I(`subscriber-${Math.random().toString(36).substr(2, 9)}`);
|
|
317
317
|
return w(() => {
|
|
318
318
|
if (!t.eventManager) return;
|
|
319
|
-
const
|
|
320
|
-
onMessage: (
|
|
321
|
-
var
|
|
322
|
-
const
|
|
323
|
-
if (
|
|
324
|
-
switch (
|
|
319
|
+
const a = {
|
|
320
|
+
onMessage: (s, o) => {
|
|
321
|
+
var g, m, p;
|
|
322
|
+
const d = Se(s);
|
|
323
|
+
if (d)
|
|
324
|
+
switch (d.type) {
|
|
325
325
|
case "STREAM_TIMEOUT":
|
|
326
|
-
(
|
|
326
|
+
(g = e == null ? void 0 : e.onStreamTimeout) == null || g.call(e, d);
|
|
327
327
|
break;
|
|
328
328
|
case "STREAM_NOT_FOUND":
|
|
329
|
-
(
|
|
329
|
+
(m = e == null ? void 0 : e.onStreamNotFound) == null || m.call(e, d);
|
|
330
330
|
break;
|
|
331
331
|
case "AGENT_TASK_PROGRESS_ITEM_UPDATED":
|
|
332
|
-
(
|
|
332
|
+
(p = e == null ? void 0 : e.onAgentTaskProgressItemUpdated) == null || p.call(e, d);
|
|
333
333
|
break;
|
|
334
334
|
}
|
|
335
335
|
},
|
|
336
|
-
onError: (
|
|
337
|
-
var
|
|
338
|
-
(
|
|
339
|
-
streamId:
|
|
336
|
+
onError: (s) => {
|
|
337
|
+
var o;
|
|
338
|
+
(o = e == null ? void 0 : e.onStreamError) == null || o.call(e, {
|
|
339
|
+
streamId: s,
|
|
340
340
|
error: {
|
|
341
341
|
code: "UnknownError",
|
|
342
342
|
message: "Unknown error in useStream"
|
|
@@ -345,258 +345,258 @@ const ye = (e) => {
|
|
|
345
345
|
}
|
|
346
346
|
};
|
|
347
347
|
return t.eventManager.subscribe(
|
|
348
|
-
|
|
349
|
-
|
|
348
|
+
l.current,
|
|
349
|
+
a
|
|
350
350
|
);
|
|
351
351
|
}, [t.eventManager, e]), {
|
|
352
352
|
createStream: async () => {
|
|
353
353
|
try {
|
|
354
|
-
const
|
|
355
|
-
return r(
|
|
354
|
+
const a = await t.getOrCreateStream(3e4);
|
|
355
|
+
return r(a), {
|
|
356
356
|
type: "success",
|
|
357
|
-
stream:
|
|
357
|
+
stream: a
|
|
358
358
|
};
|
|
359
|
-
} catch (
|
|
359
|
+
} catch (a) {
|
|
360
360
|
return {
|
|
361
361
|
type: "error",
|
|
362
362
|
error: {
|
|
363
363
|
code: "UnknownError",
|
|
364
|
-
message:
|
|
364
|
+
message: a instanceof Error ? a.message : "Failed to create stream"
|
|
365
365
|
}
|
|
366
366
|
};
|
|
367
367
|
}
|
|
368
368
|
},
|
|
369
369
|
stream: n
|
|
370
370
|
};
|
|
371
|
-
},
|
|
372
|
-
const t =
|
|
373
|
-
onAgentTaskProgressItemUpdated: (
|
|
374
|
-
var
|
|
375
|
-
if (!
|
|
376
|
-
const
|
|
377
|
-
if (
|
|
371
|
+
}, tt = (e) => {
|
|
372
|
+
const t = J(), [n, r] = x([]), l = I(/* @__PURE__ */ new Set()), u = I(/* @__PURE__ */ new Map()), { createStream: a } = Ce({
|
|
373
|
+
onAgentTaskProgressItemUpdated: (o) => {
|
|
374
|
+
var m;
|
|
375
|
+
if (!l.current.has(o.agentTaskId)) return;
|
|
376
|
+
const d = o.data;
|
|
377
|
+
if (d.taskType === "StreamingChatCompletion" && d.eventType === "Completed" || d.taskType === "StructuredChatCompletion" && d.eventType === "Completed" || d.taskType === "MemoryChatCompletion" && d.eventType === "Completed") {
|
|
378
378
|
r(
|
|
379
|
-
(
|
|
380
|
-
(
|
|
379
|
+
(h) => h.map(
|
|
380
|
+
(k) => {
|
|
381
381
|
var f;
|
|
382
|
-
return ((f =
|
|
382
|
+
return ((f = k.confirmedData) == null ? void 0 : f.taskId) === o.agentTaskId ? { ...k, loading: !1 } : k;
|
|
383
383
|
}
|
|
384
384
|
)
|
|
385
385
|
);
|
|
386
|
-
const
|
|
387
|
-
|
|
386
|
+
const p = u.current.get(
|
|
387
|
+
o.agentTaskId
|
|
388
388
|
);
|
|
389
|
-
|
|
389
|
+
p && (u.current.delete(o.agentTaskId), p(d));
|
|
390
390
|
return;
|
|
391
391
|
}
|
|
392
|
-
(
|
|
393
|
-
(
|
|
394
|
-
var
|
|
395
|
-
if (((
|
|
396
|
-
return
|
|
397
|
-
const f =
|
|
398
|
-
(
|
|
399
|
-
) ?
|
|
400
|
-
(
|
|
401
|
-
) : [...
|
|
402
|
-
return { ...
|
|
392
|
+
(m = e.onAgentTaskProgressItemUpdated) == null || m.call(e, o), r(
|
|
393
|
+
(p) => p.map((h) => {
|
|
394
|
+
var b;
|
|
395
|
+
if (((b = h.confirmedData) == null ? void 0 : b.taskId) !== o.agentTaskId)
|
|
396
|
+
return h;
|
|
397
|
+
const f = h.progressItems.some(
|
|
398
|
+
(T) => T.progressItemId === o.progressItemId
|
|
399
|
+
) ? h.progressItems.map(
|
|
400
|
+
(T) => T.progressItemId === o.progressItemId ? o : T
|
|
401
|
+
) : [...h.progressItems, o];
|
|
402
|
+
return { ...h, progressItems: f };
|
|
403
403
|
})
|
|
404
404
|
);
|
|
405
405
|
},
|
|
406
|
-
onStreamError: (
|
|
407
|
-
var
|
|
408
|
-
(
|
|
409
|
-
const
|
|
410
|
-
return
|
|
411
|
-
...
|
|
406
|
+
onStreamError: (o) => {
|
|
407
|
+
var d;
|
|
408
|
+
(d = e == null ? void 0 : e.onStreamError) == null || d.call(e, o), r((g) => {
|
|
409
|
+
const m = g.find((p) => p.streamId === o.streamId);
|
|
410
|
+
return m ? [
|
|
411
|
+
...g.filter((p) => p.streamId !== o.streamId),
|
|
412
412
|
{
|
|
413
|
-
...
|
|
413
|
+
...m,
|
|
414
414
|
loading: !1,
|
|
415
|
-
error:
|
|
415
|
+
error: o.error
|
|
416
416
|
}
|
|
417
|
-
] :
|
|
417
|
+
] : g;
|
|
418
418
|
});
|
|
419
419
|
},
|
|
420
|
-
onStreamNotFound: (
|
|
421
|
-
var
|
|
422
|
-
(
|
|
420
|
+
onStreamNotFound: (o) => {
|
|
421
|
+
var d;
|
|
422
|
+
(d = e == null ? void 0 : e.onStreamNotFound) == null || d.call(e, o);
|
|
423
423
|
},
|
|
424
|
-
onStreamTimeout: (
|
|
425
|
-
var
|
|
426
|
-
(
|
|
424
|
+
onStreamTimeout: (o) => {
|
|
425
|
+
var d;
|
|
426
|
+
(d = e == null ? void 0 : e.onStreamTimeout) == null || d.call(e, o);
|
|
427
427
|
}
|
|
428
|
-
}),
|
|
429
|
-
async (
|
|
430
|
-
const
|
|
431
|
-
if (
|
|
428
|
+
}), c = H(
|
|
429
|
+
async (o, d) => {
|
|
430
|
+
const g = `task-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`, m = await a();
|
|
431
|
+
if (m.type === "success") {
|
|
432
432
|
r([
|
|
433
433
|
...n,
|
|
434
434
|
{
|
|
435
|
-
taskKey:
|
|
436
|
-
streamId:
|
|
435
|
+
taskKey: g,
|
|
436
|
+
streamId: m.stream.id,
|
|
437
437
|
triggeredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
438
438
|
confirmedData: null,
|
|
439
439
|
error: null,
|
|
440
|
-
params:
|
|
440
|
+
params: o,
|
|
441
441
|
progressItems: [],
|
|
442
442
|
loading: !0,
|
|
443
|
-
loadingText:
|
|
443
|
+
loadingText: d == null ? void 0 : d.loadingText
|
|
444
444
|
}
|
|
445
445
|
]);
|
|
446
|
-
const { clientToken:
|
|
446
|
+
const { clientToken: p } = await e.fetchCreateAgentTaskClientToken(o.type), h = await te({
|
|
447
447
|
pk: t.fency.publishableKey,
|
|
448
448
|
baseUrl: t.fency.baseUrl,
|
|
449
|
-
clientToken:
|
|
450
|
-
streamToken:
|
|
449
|
+
clientToken: p,
|
|
450
|
+
streamToken: m.stream.token,
|
|
451
451
|
request: {
|
|
452
|
-
streamingChatCompletionTask:
|
|
453
|
-
messages:
|
|
454
|
-
model:
|
|
452
|
+
streamingChatCompletionTask: o.type === "StreamingChatCompletion" ? {
|
|
453
|
+
messages: o.messages,
|
|
454
|
+
model: o.model
|
|
455
455
|
} : void 0,
|
|
456
|
-
structuredChatCompletionTask:
|
|
457
|
-
messages:
|
|
458
|
-
jsonSchema:
|
|
459
|
-
model:
|
|
456
|
+
structuredChatCompletionTask: o.type === "StructuredChatCompletion" ? {
|
|
457
|
+
messages: o.messages,
|
|
458
|
+
jsonSchema: o.jsonSchema,
|
|
459
|
+
model: o.model
|
|
460
460
|
} : void 0,
|
|
461
|
-
memoryChatCompletionTask:
|
|
462
|
-
messages:
|
|
463
|
-
model:
|
|
464
|
-
language:
|
|
465
|
-
chunkLimit:
|
|
466
|
-
memoryScanLimit:
|
|
461
|
+
memoryChatCompletionTask: o.type === "MemoryChatCompletion" ? {
|
|
462
|
+
messages: o.messages,
|
|
463
|
+
model: o.model,
|
|
464
|
+
language: o.language ?? "en",
|
|
465
|
+
chunkLimit: o.chunkLimit ?? 10,
|
|
466
|
+
memoryScanLimit: o.memoryScanLimit ?? 3
|
|
467
467
|
} : void 0
|
|
468
468
|
}
|
|
469
469
|
});
|
|
470
|
-
if (
|
|
471
|
-
|
|
472
|
-
|
|
470
|
+
if (h.type === "success" && h.agentTask) {
|
|
471
|
+
l.current.add(
|
|
472
|
+
h.agentTask.id
|
|
473
473
|
), r((f) => [
|
|
474
|
-
...f.filter((
|
|
474
|
+
...f.filter((b) => b.taskKey !== g),
|
|
475
475
|
{
|
|
476
|
-
taskKey:
|
|
477
|
-
streamId:
|
|
476
|
+
taskKey: g,
|
|
477
|
+
streamId: m.stream.id,
|
|
478
478
|
triggeredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
479
|
-
taskId:
|
|
480
|
-
createdAt:
|
|
479
|
+
taskId: h.agentTask.id,
|
|
480
|
+
createdAt: h.agentTask.createdAt,
|
|
481
481
|
error: null,
|
|
482
|
-
params:
|
|
482
|
+
params: o,
|
|
483
483
|
progressItems: [],
|
|
484
484
|
loading: !0,
|
|
485
|
-
loadingText:
|
|
485
|
+
loadingText: d == null ? void 0 : d.loadingText,
|
|
486
486
|
confirmedData: {
|
|
487
|
-
taskId:
|
|
488
|
-
createdAt:
|
|
487
|
+
taskId: h.agentTask.id,
|
|
488
|
+
createdAt: h.agentTask.createdAt
|
|
489
489
|
}
|
|
490
490
|
}
|
|
491
491
|
]);
|
|
492
|
-
const
|
|
493
|
-
|
|
494
|
-
|
|
492
|
+
const k = await new Promise((f) => {
|
|
493
|
+
u.current.set(
|
|
494
|
+
h.agentTask.id,
|
|
495
495
|
f
|
|
496
496
|
);
|
|
497
497
|
});
|
|
498
498
|
return {
|
|
499
499
|
type: "success",
|
|
500
|
-
streamId:
|
|
501
|
-
agentTaskId:
|
|
502
|
-
response:
|
|
500
|
+
streamId: m.stream.id,
|
|
501
|
+
agentTaskId: h.agentTask.id,
|
|
502
|
+
response: k
|
|
503
503
|
};
|
|
504
504
|
} else {
|
|
505
|
-
if (
|
|
506
|
-
return r((
|
|
507
|
-
...
|
|
505
|
+
if (h.type === "error")
|
|
506
|
+
return r((k) => [
|
|
507
|
+
...k.filter((f) => f.taskKey !== g),
|
|
508
508
|
{
|
|
509
|
-
taskKey:
|
|
509
|
+
taskKey: g,
|
|
510
510
|
triggeredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
511
|
-
streamId:
|
|
512
|
-
params:
|
|
513
|
-
error:
|
|
511
|
+
streamId: m.stream.id,
|
|
512
|
+
params: o,
|
|
513
|
+
error: h.error,
|
|
514
514
|
progressItems: [],
|
|
515
515
|
loading: !1,
|
|
516
|
-
loadingText:
|
|
516
|
+
loadingText: d == null ? void 0 : d.loadingText,
|
|
517
517
|
confirmedData: null
|
|
518
518
|
}
|
|
519
519
|
]), {
|
|
520
520
|
type: "error",
|
|
521
|
-
error:
|
|
521
|
+
error: h.error
|
|
522
522
|
};
|
|
523
523
|
{
|
|
524
|
-
const
|
|
524
|
+
const k = {
|
|
525
525
|
message: "No response received",
|
|
526
526
|
code: "UnknownError"
|
|
527
527
|
};
|
|
528
528
|
return r((f) => [
|
|
529
|
-
...f.filter((
|
|
529
|
+
...f.filter((b) => b.taskKey !== g),
|
|
530
530
|
{
|
|
531
|
-
taskKey:
|
|
531
|
+
taskKey: g,
|
|
532
532
|
triggeredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
533
|
-
streamId:
|
|
534
|
-
error:
|
|
535
|
-
params:
|
|
533
|
+
streamId: m.stream.id,
|
|
534
|
+
error: k,
|
|
535
|
+
params: o,
|
|
536
536
|
progressItems: [],
|
|
537
537
|
loading: !1,
|
|
538
|
-
loadingText:
|
|
538
|
+
loadingText: d == null ? void 0 : d.loadingText,
|
|
539
539
|
confirmedData: null
|
|
540
540
|
}
|
|
541
541
|
]), {
|
|
542
542
|
type: "error",
|
|
543
|
-
error:
|
|
543
|
+
error: k
|
|
544
544
|
};
|
|
545
545
|
}
|
|
546
546
|
}
|
|
547
547
|
} else
|
|
548
|
-
return console.error(
|
|
548
|
+
return console.error(m.error), m;
|
|
549
549
|
},
|
|
550
|
-
[t, n,
|
|
551
|
-
),
|
|
550
|
+
[t, n, a]
|
|
551
|
+
), s = K(() => {
|
|
552
552
|
if (n.length !== 0)
|
|
553
|
-
return [...n].sort((
|
|
553
|
+
return [...n].sort((o, d) => new Date(d.triggeredAt).getTime() - new Date(o.triggeredAt).getTime())[0];
|
|
554
554
|
}, [n]);
|
|
555
555
|
return w(() => () => {
|
|
556
|
-
|
|
556
|
+
l.current.clear(), u.current.clear();
|
|
557
557
|
}, []), {
|
|
558
558
|
agentTasks: n,
|
|
559
|
-
createAgentTask:
|
|
560
|
-
latest:
|
|
559
|
+
createAgentTask: c,
|
|
560
|
+
latest: s
|
|
561
561
|
};
|
|
562
562
|
};
|
|
563
|
-
function
|
|
563
|
+
function Ee(e) {
|
|
564
564
|
return e.progressItems.map((t, n) => {
|
|
565
|
-
const r = e.progressItems[n + 1],
|
|
566
|
-
let
|
|
565
|
+
const r = e.progressItems[n + 1], l = r != null;
|
|
566
|
+
let u;
|
|
567
567
|
if (r != null && r.createdAt) {
|
|
568
|
-
const
|
|
569
|
-
|
|
568
|
+
const a = new Date(t.createdAt).getTime(), c = new Date(r.createdAt).getTime();
|
|
569
|
+
u = Math.round((c - a) / 1e3);
|
|
570
570
|
}
|
|
571
571
|
return {
|
|
572
572
|
item: t,
|
|
573
|
-
completed:
|
|
573
|
+
completed: l,
|
|
574
574
|
isLatest: n === e.progressItems.length - 1,
|
|
575
|
-
durationSeconds:
|
|
575
|
+
durationSeconds: u
|
|
576
576
|
};
|
|
577
577
|
});
|
|
578
578
|
}
|
|
579
|
-
function
|
|
579
|
+
function P({
|
|
580
580
|
text: e,
|
|
581
581
|
duration: t = 2,
|
|
582
582
|
delay: n = 0,
|
|
583
583
|
repeat: r = !0,
|
|
584
|
-
repeatDelay:
|
|
585
|
-
className:
|
|
586
|
-
startOnView:
|
|
587
|
-
once:
|
|
588
|
-
inViewMargin:
|
|
589
|
-
spread:
|
|
590
|
-
color:
|
|
591
|
-
shimmerColor:
|
|
592
|
-
direction:
|
|
584
|
+
repeatDelay: l = 0.5,
|
|
585
|
+
className: u,
|
|
586
|
+
startOnView: a = !1,
|
|
587
|
+
once: c = !1,
|
|
588
|
+
inViewMargin: s,
|
|
589
|
+
spread: o = 2,
|
|
590
|
+
color: d = "#999",
|
|
591
|
+
shimmerColor: g = "#000",
|
|
592
|
+
direction: m = "fromBottom"
|
|
593
593
|
}) {
|
|
594
|
-
const
|
|
594
|
+
const p = I(null), h = oe(p, { once: c, margin: s }), k = K(() => e.length * o, [e, o]), f = !a || h, b = m === "fromBottom" ? "100% center" : "-100% center", T = m === "fromBottom" ? "0% center" : "200% center";
|
|
595
595
|
return /* @__PURE__ */ i(
|
|
596
|
-
|
|
596
|
+
S.span,
|
|
597
597
|
{
|
|
598
|
-
ref:
|
|
599
|
-
className:
|
|
598
|
+
ref: p,
|
|
599
|
+
className: u,
|
|
600
600
|
style: {
|
|
601
601
|
position: "relative",
|
|
602
602
|
display: "inline-block",
|
|
@@ -606,18 +606,18 @@ function R({
|
|
|
606
606
|
color: "transparent",
|
|
607
607
|
WebkitTextFillColor: "transparent",
|
|
608
608
|
backgroundRepeat: "no-repeat, padding-box",
|
|
609
|
-
"--spread": `${
|
|
610
|
-
"--base-color":
|
|
611
|
-
"--shimmer-color":
|
|
609
|
+
"--spread": `${k}px`,
|
|
610
|
+
"--base-color": d,
|
|
611
|
+
"--shimmer-color": g,
|
|
612
612
|
"--shimmer-bg": "linear-gradient(90deg, transparent calc(50% - var(--spread)), var(--shimmer-color), transparent calc(50% + var(--spread)))",
|
|
613
613
|
backgroundImage: "var(--shimmer-bg), linear-gradient(var(--base-color), var(--base-color))"
|
|
614
614
|
},
|
|
615
615
|
initial: {
|
|
616
|
-
backgroundPosition:
|
|
616
|
+
backgroundPosition: b,
|
|
617
617
|
opacity: 0
|
|
618
618
|
},
|
|
619
619
|
animate: f ? {
|
|
620
|
-
backgroundPosition:
|
|
620
|
+
backgroundPosition: T,
|
|
621
621
|
opacity: 1
|
|
622
622
|
} : {},
|
|
623
623
|
transition: {
|
|
@@ -625,7 +625,7 @@ function R({
|
|
|
625
625
|
repeat: r ? 1 / 0 : 0,
|
|
626
626
|
duration: t,
|
|
627
627
|
delay: n,
|
|
628
|
-
repeatDelay:
|
|
628
|
+
repeatDelay: l,
|
|
629
629
|
ease: "linear"
|
|
630
630
|
},
|
|
631
631
|
opacity: {
|
|
@@ -637,7 +637,7 @@ function R({
|
|
|
637
637
|
}
|
|
638
638
|
);
|
|
639
639
|
}
|
|
640
|
-
function
|
|
640
|
+
function Me(e, t) {
|
|
641
641
|
const n = e.item.data;
|
|
642
642
|
if (n.eventType === "Error" && "message" in n)
|
|
643
643
|
return t.error;
|
|
@@ -655,16 +655,16 @@ function ve(e, t) {
|
|
|
655
655
|
return t.streaming;
|
|
656
656
|
case "Search":
|
|
657
657
|
return t.searching;
|
|
658
|
+
case "FindMemories":
|
|
659
|
+
return e.completed ? t.memoriesFound : t.findingMemories;
|
|
660
|
+
case "FindMemoriesResult":
|
|
661
|
+
return t.memoriesFound;
|
|
658
662
|
case "FindSources":
|
|
659
663
|
return t.addingSources;
|
|
660
664
|
case "SourcesResult":
|
|
661
665
|
return t.sourcesAdded;
|
|
662
|
-
case "
|
|
663
|
-
return t.
|
|
664
|
-
case "ExploreMemoryResult":
|
|
665
|
-
return t.memoryExplored;
|
|
666
|
-
case "ExploreMemoryError":
|
|
667
|
-
return t.memoryExplorationFailed;
|
|
666
|
+
case "ExploreMemories":
|
|
667
|
+
return e.completed ? t.memoriesExplored : t.exploringMemories;
|
|
668
668
|
case "ChunkResult":
|
|
669
669
|
return t.chunksRetrieved;
|
|
670
670
|
case "Completed":
|
|
@@ -672,12 +672,12 @@ function ve(e, t) {
|
|
|
672
672
|
}
|
|
673
673
|
return t.processing;
|
|
674
674
|
}
|
|
675
|
-
const
|
|
675
|
+
const we = ({ progressViewItems: e, t }) => {
|
|
676
676
|
const n = e[e.length - 1];
|
|
677
677
|
if (!n) return null;
|
|
678
|
-
const r =
|
|
679
|
-
return /* @__PURE__ */ i("div", { className: "simple-mode-container", children: /* @__PURE__ */ i(
|
|
680
|
-
|
|
678
|
+
const r = Me(n, t);
|
|
679
|
+
return /* @__PURE__ */ i("div", { className: "simple-mode-container", children: /* @__PURE__ */ i(q, { mode: "wait", children: /* @__PURE__ */ i(
|
|
680
|
+
S.div,
|
|
681
681
|
{
|
|
682
682
|
initial: { opacity: 0, y: 10 },
|
|
683
683
|
animate: { opacity: 1, y: 0 },
|
|
@@ -691,7 +691,7 @@ const be = ({ progressViewItems: e, t }) => {
|
|
|
691
691
|
children: r
|
|
692
692
|
}
|
|
693
693
|
) : /* @__PURE__ */ i(
|
|
694
|
-
|
|
694
|
+
P,
|
|
695
695
|
{
|
|
696
696
|
text: r,
|
|
697
697
|
className: "simple-mode-title",
|
|
@@ -704,7 +704,7 @@ const be = ({ progressViewItems: e, t }) => {
|
|
|
704
704
|
},
|
|
705
705
|
n.item.progressItemId
|
|
706
706
|
) }) });
|
|
707
|
-
},
|
|
707
|
+
}, Y = {
|
|
708
708
|
'code[class*="language-"]': {
|
|
709
709
|
color: "#f8f8f2",
|
|
710
710
|
background: "none",
|
|
@@ -855,53 +855,53 @@ const be = ({ progressViewItems: e, t }) => {
|
|
|
855
855
|
italic: {
|
|
856
856
|
fontStyle: "italic"
|
|
857
857
|
}
|
|
858
|
-
},
|
|
858
|
+
}, N = ({
|
|
859
859
|
text: e
|
|
860
860
|
}) => /* @__PURE__ */ i("div", { style: { padding: "16px" }, children: /* @__PURE__ */ i(
|
|
861
|
-
|
|
861
|
+
S.div,
|
|
862
862
|
{
|
|
863
863
|
className: "fency-markdown-body-raw",
|
|
864
864
|
initial: { opacity: 0, y: -10 },
|
|
865
865
|
animate: { opacity: 1, y: 0 },
|
|
866
866
|
transition: { duration: 0.3, delay: 0 },
|
|
867
867
|
children: /* @__PURE__ */ i(
|
|
868
|
-
|
|
868
|
+
ie,
|
|
869
869
|
{
|
|
870
|
-
remarkPlugins: [
|
|
870
|
+
remarkPlugins: [ae],
|
|
871
871
|
components: {
|
|
872
872
|
code(t) {
|
|
873
|
-
const { children: n, className: r, node:
|
|
874
|
-
return
|
|
873
|
+
const { children: n, className: r, node: l, ref: u, ...a } = t, c = /language-(\w+)/.exec(r || "");
|
|
874
|
+
return c ? (
|
|
875
875
|
// @ts-expect-error react-syntax-highlighter types incompatible with @types/react 18
|
|
876
876
|
/* @__PURE__ */ i(
|
|
877
|
-
|
|
877
|
+
G,
|
|
878
878
|
{
|
|
879
|
-
...
|
|
879
|
+
...a,
|
|
880
880
|
PreTag: "div",
|
|
881
881
|
children: String(n).replace(/\n$/, ""),
|
|
882
|
-
language:
|
|
883
|
-
style:
|
|
882
|
+
language: c[1],
|
|
883
|
+
style: Y
|
|
884
884
|
}
|
|
885
885
|
)
|
|
886
|
-
) : /* @__PURE__ */ i("code", { ...
|
|
886
|
+
) : /* @__PURE__ */ i("code", { ...a, className: r, children: String(n) });
|
|
887
887
|
}
|
|
888
888
|
},
|
|
889
889
|
children: e
|
|
890
890
|
}
|
|
891
891
|
)
|
|
892
892
|
}
|
|
893
|
-
) }),
|
|
893
|
+
) }), Ie = ({ data: e }) => {
|
|
894
894
|
const t = JSON.stringify(e.json, null, 2);
|
|
895
895
|
return /* @__PURE__ */ i("div", { id: "structured-chat-completion-response", children: /* @__PURE__ */ i(
|
|
896
|
-
|
|
896
|
+
S.div,
|
|
897
897
|
{
|
|
898
898
|
initial: { opacity: 0, y: -10 },
|
|
899
899
|
animate: { opacity: 1, y: 0 },
|
|
900
900
|
transition: { duration: 0.3, delay: 0 },
|
|
901
|
-
children: /* @__PURE__ */ i(
|
|
901
|
+
children: /* @__PURE__ */ i(G, { language: "json", style: Y, PreTag: "div", children: t })
|
|
902
902
|
}
|
|
903
903
|
) });
|
|
904
|
-
},
|
|
904
|
+
}, Ae = {
|
|
905
905
|
en: {
|
|
906
906
|
error: "Error",
|
|
907
907
|
streaming: "Streaming...",
|
|
@@ -912,6 +912,16 @@ const be = ({ progressViewItems: e, t }) => {
|
|
|
912
912
|
sourcesAdded: "Sources added...",
|
|
913
913
|
exploringMemory: "Exploring memory...",
|
|
914
914
|
memoryExplored: "Memory explored",
|
|
915
|
+
exploringMemories: "Exploring memories...",
|
|
916
|
+
memoriesExplored: "Memories explored",
|
|
917
|
+
findingMemories: "Finding relevant memories...",
|
|
918
|
+
findingMemoriesIn: "Finding relevant memories in ",
|
|
919
|
+
moreMemories: "+{n} more",
|
|
920
|
+
memoryFound: "Found memory ",
|
|
921
|
+
memoriesFoundPrefix: "Found memories ",
|
|
922
|
+
memoriesFound: "Memories found",
|
|
923
|
+
searchingFor: "Searching for ",
|
|
924
|
+
searchingIn: " in ",
|
|
915
925
|
memoryExplorationFailed: "Memory exploration failed",
|
|
916
926
|
processing: "Processing...",
|
|
917
927
|
processingYourTask: "Processing your task...",
|
|
@@ -927,7 +937,8 @@ const be = ({ progressViewItems: e, t }) => {
|
|
|
927
937
|
chunkFound: "1 chunk found",
|
|
928
938
|
chunksFound: "{n} chunks found",
|
|
929
939
|
chunksRetrieved: "Chunks retrieved",
|
|
930
|
-
scoreLabel: "score: {n}"
|
|
940
|
+
scoreLabel: "score: {n}",
|
|
941
|
+
and: "and"
|
|
931
942
|
},
|
|
932
943
|
no: {
|
|
933
944
|
error: "Feil",
|
|
@@ -939,6 +950,16 @@ const be = ({ progressViewItems: e, t }) => {
|
|
|
939
950
|
sourcesAdded: "Kilder lagt til...",
|
|
940
951
|
exploringMemory: "Utforsker minne...",
|
|
941
952
|
memoryExplored: "Minne utforsket",
|
|
953
|
+
exploringMemories: "Utforsker minner...",
|
|
954
|
+
memoriesExplored: "Minner utforsket",
|
|
955
|
+
findingMemories: "Finner relevante minner...",
|
|
956
|
+
findingMemoriesIn: "Finner relevante minner i ",
|
|
957
|
+
moreMemories: "+{n} flere",
|
|
958
|
+
memoryFound: "Fant minne ",
|
|
959
|
+
memoriesFoundPrefix: "Fant minner ",
|
|
960
|
+
memoriesFound: "Minner funnet",
|
|
961
|
+
searchingFor: "Søker etter ",
|
|
962
|
+
searchingIn: " i ",
|
|
942
963
|
memoryExplorationFailed: "Minneutforskning feilet",
|
|
943
964
|
processing: "Behandler...",
|
|
944
965
|
processingYourTask: "Behandler oppgaven din...",
|
|
@@ -954,43 +975,194 @@ const be = ({ progressViewItems: e, t }) => {
|
|
|
954
975
|
chunkFound: "1 del funnet",
|
|
955
976
|
chunksFound: "{n} deler funnet",
|
|
956
977
|
chunksRetrieved: "Deler hentet",
|
|
957
|
-
scoreLabel: "poeng: {n}"
|
|
978
|
+
scoreLabel: "poeng: {n}",
|
|
979
|
+
and: "og"
|
|
958
980
|
}
|
|
959
981
|
};
|
|
960
|
-
function
|
|
961
|
-
return
|
|
982
|
+
function Fe(e) {
|
|
983
|
+
return Ae[e];
|
|
962
984
|
}
|
|
963
|
-
function
|
|
985
|
+
function v(e, t) {
|
|
964
986
|
return Object.entries(t).reduce(
|
|
965
|
-
(n, [r,
|
|
987
|
+
(n, [r, l]) => n.replace(`{${r}}`, String(l)),
|
|
966
988
|
e
|
|
967
989
|
);
|
|
968
990
|
}
|
|
969
|
-
|
|
970
|
-
const
|
|
971
|
-
|
|
991
|
+
function B(e, t) {
|
|
992
|
+
const n = e.map((r) => `'${r}'`);
|
|
993
|
+
if (t != null && n.length >= 2) {
|
|
994
|
+
const r = n.pop();
|
|
995
|
+
return n.length > 0 ? `${n.join(", ")} ${t} ${r}` : r;
|
|
996
|
+
}
|
|
997
|
+
return n.join(", ");
|
|
998
|
+
}
|
|
999
|
+
const L = 5, De = ({ data: e, isLatest: t = !1, durationSeconds: n, t: r }) => {
|
|
1000
|
+
const [l, u] = x(!1), c = (e.memories ?? []).map((f) => f.memoryTitle), s = c.length > 0, o = s && c.length > L, d = o && !l ? c.slice(0, L) : c, g = c.length - L, m = !o || l, p = `${r.searchingFor}'${e.queryDescription}'`, h = s ? `${r.searchingIn}${B(
|
|
1001
|
+
d,
|
|
1002
|
+
m ? r.and : void 0
|
|
1003
|
+
)}` : "", k = s ? `${p}${h}` : `${r.searchingPrefix}${e.queryDescription}`;
|
|
1004
|
+
return /* @__PURE__ */ y("div", { style: { padding: "16px" }, children: [
|
|
1005
|
+
/* @__PURE__ */ i(
|
|
1006
|
+
S.div,
|
|
1007
|
+
{
|
|
1008
|
+
style: { color: "#666" },
|
|
1009
|
+
initial: { opacity: 0, y: -10 },
|
|
1010
|
+
animate: { opacity: 1, y: 0 },
|
|
1011
|
+
transition: { duration: 0.3, delay: 0 },
|
|
1012
|
+
children: t && !n && !o ? /* @__PURE__ */ i(
|
|
1013
|
+
P,
|
|
1014
|
+
{
|
|
1015
|
+
text: k,
|
|
1016
|
+
duration: 2.5,
|
|
1017
|
+
repeat: !0,
|
|
1018
|
+
color: "#999",
|
|
1019
|
+
shimmerColor: "#000"
|
|
1020
|
+
}
|
|
1021
|
+
) : /* @__PURE__ */ y(E, { children: [
|
|
1022
|
+
/* @__PURE__ */ i("span", { style: { color: "#666" }, children: s ? /* @__PURE__ */ y(E, { children: [
|
|
1023
|
+
r.searchingFor,
|
|
1024
|
+
/* @__PURE__ */ y("span", { style: { fontWeight: 600 }, children: [
|
|
1025
|
+
"'",
|
|
1026
|
+
e.queryDescription,
|
|
1027
|
+
"'"
|
|
1028
|
+
] }),
|
|
1029
|
+
h
|
|
1030
|
+
] }) : `${r.searchingPrefix}${e.queryDescription}` }),
|
|
1031
|
+
o && !l && /* @__PURE__ */ y(E, { children: [
|
|
1032
|
+
" ",
|
|
1033
|
+
/* @__PURE__ */ i(
|
|
1034
|
+
"button",
|
|
1035
|
+
{
|
|
1036
|
+
type: "button",
|
|
1037
|
+
onClick: () => u(!0),
|
|
1038
|
+
style: {
|
|
1039
|
+
background: "none",
|
|
1040
|
+
border: "none",
|
|
1041
|
+
padding: 0,
|
|
1042
|
+
margin: 0,
|
|
1043
|
+
fontSize: "inherit",
|
|
1044
|
+
color: "inherit",
|
|
1045
|
+
cursor: "pointer",
|
|
1046
|
+
textDecoration: "underline",
|
|
1047
|
+
fontFamily: "inherit"
|
|
1048
|
+
},
|
|
1049
|
+
children: v(r.moreMemories, {
|
|
1050
|
+
n: g
|
|
1051
|
+
})
|
|
1052
|
+
}
|
|
1053
|
+
)
|
|
1054
|
+
] }),
|
|
1055
|
+
o && l && /* @__PURE__ */ y(E, { children: [
|
|
1056
|
+
" ",
|
|
1057
|
+
/* @__PURE__ */ i(
|
|
1058
|
+
"button",
|
|
1059
|
+
{
|
|
1060
|
+
type: "button",
|
|
1061
|
+
onClick: () => u(!1),
|
|
1062
|
+
style: {
|
|
1063
|
+
background: "none",
|
|
1064
|
+
border: "none",
|
|
1065
|
+
padding: 0,
|
|
1066
|
+
margin: 0,
|
|
1067
|
+
fontSize: "inherit",
|
|
1068
|
+
color: "inherit",
|
|
1069
|
+
cursor: "pointer",
|
|
1070
|
+
textDecoration: "underline",
|
|
1071
|
+
fontFamily: "inherit"
|
|
1072
|
+
},
|
|
1073
|
+
children: r.clickToCollapse
|
|
1074
|
+
}
|
|
1075
|
+
)
|
|
1076
|
+
] })
|
|
1077
|
+
] })
|
|
1078
|
+
}
|
|
1079
|
+
),
|
|
1080
|
+
n !== void 0 && /* @__PURE__ */ i(
|
|
1081
|
+
"div",
|
|
1082
|
+
{
|
|
1083
|
+
style: {
|
|
1084
|
+
fontSize: "12px",
|
|
1085
|
+
color: "#999",
|
|
1086
|
+
marginTop: "4px",
|
|
1087
|
+
fontStyle: "italic"
|
|
1088
|
+
},
|
|
1089
|
+
children: v(r.tookSeconds, { n })
|
|
1090
|
+
}
|
|
1091
|
+
)
|
|
1092
|
+
] });
|
|
1093
|
+
}, O = 5, Pe = ({ data: e, isLatest: t = !1, durationSeconds: n, t: r }) => {
|
|
1094
|
+
const [l, u] = x(!1), a = e.titles, c = a.length > 0, s = c && a.length > O, o = s && !l ? a.slice(0, O) : a, d = a.length - O, g = !s || l, m = c ? `${r.findingMemoriesIn}${B(
|
|
1095
|
+
o,
|
|
1096
|
+
g ? r.and : void 0
|
|
1097
|
+
)}` : r.findingMemories;
|
|
1098
|
+
return /* @__PURE__ */ y("div", { style: { padding: "16px" }, children: [
|
|
972
1099
|
/* @__PURE__ */ i(
|
|
973
|
-
|
|
1100
|
+
S.div,
|
|
974
1101
|
{
|
|
975
1102
|
style: {
|
|
976
|
-
display: "flex",
|
|
977
|
-
alignItems: "center",
|
|
978
|
-
gap: "10px",
|
|
979
1103
|
color: "#666"
|
|
980
1104
|
},
|
|
981
1105
|
initial: { opacity: 0, y: -10 },
|
|
982
1106
|
animate: { opacity: 1, y: 0 },
|
|
983
1107
|
transition: { duration: 0.3, delay: 0 },
|
|
984
|
-
children: t && !n ? /* @__PURE__ */ i(
|
|
985
|
-
|
|
1108
|
+
children: t && !n && !s ? /* @__PURE__ */ i(
|
|
1109
|
+
P,
|
|
986
1110
|
{
|
|
987
|
-
text:
|
|
1111
|
+
text: m,
|
|
988
1112
|
duration: 2.5,
|
|
989
1113
|
repeat: !0,
|
|
990
1114
|
color: "#999",
|
|
991
1115
|
shimmerColor: "#000"
|
|
992
1116
|
}
|
|
993
|
-
) : /* @__PURE__ */
|
|
1117
|
+
) : /* @__PURE__ */ y(E, { children: [
|
|
1118
|
+
/* @__PURE__ */ i("span", { style: { color: "#666" }, children: m }),
|
|
1119
|
+
s && !l && /* @__PURE__ */ y(E, { children: [
|
|
1120
|
+
" ",
|
|
1121
|
+
/* @__PURE__ */ i(
|
|
1122
|
+
"button",
|
|
1123
|
+
{
|
|
1124
|
+
type: "button",
|
|
1125
|
+
onClick: () => u(!0),
|
|
1126
|
+
style: {
|
|
1127
|
+
background: "none",
|
|
1128
|
+
border: "none",
|
|
1129
|
+
padding: 0,
|
|
1130
|
+
margin: 0,
|
|
1131
|
+
fontSize: "inherit",
|
|
1132
|
+
color: "inherit",
|
|
1133
|
+
cursor: "pointer",
|
|
1134
|
+
textDecoration: "underline",
|
|
1135
|
+
fontFamily: "inherit"
|
|
1136
|
+
},
|
|
1137
|
+
children: v(r.moreMemories, {
|
|
1138
|
+
n: d
|
|
1139
|
+
})
|
|
1140
|
+
}
|
|
1141
|
+
)
|
|
1142
|
+
] }),
|
|
1143
|
+
s && l && /* @__PURE__ */ y(E, { children: [
|
|
1144
|
+
" ",
|
|
1145
|
+
/* @__PURE__ */ i(
|
|
1146
|
+
"button",
|
|
1147
|
+
{
|
|
1148
|
+
type: "button",
|
|
1149
|
+
onClick: () => u(!1),
|
|
1150
|
+
style: {
|
|
1151
|
+
background: "none",
|
|
1152
|
+
border: "none",
|
|
1153
|
+
padding: 0,
|
|
1154
|
+
margin: 0,
|
|
1155
|
+
fontSize: "inherit",
|
|
1156
|
+
color: "inherit",
|
|
1157
|
+
cursor: "pointer",
|
|
1158
|
+
textDecoration: "underline",
|
|
1159
|
+
fontFamily: "inherit"
|
|
1160
|
+
},
|
|
1161
|
+
children: r.clickToCollapse
|
|
1162
|
+
}
|
|
1163
|
+
)
|
|
1164
|
+
] })
|
|
1165
|
+
] })
|
|
994
1166
|
}
|
|
995
1167
|
),
|
|
996
1168
|
n !== void 0 && /* @__PURE__ */ i(
|
|
@@ -1002,15 +1174,78 @@ const we = ({ data: e, isLatest: t = !1, durationSeconds: n, t: r }) => {
|
|
|
1002
1174
|
marginTop: "4px",
|
|
1003
1175
|
fontStyle: "italic"
|
|
1004
1176
|
},
|
|
1005
|
-
children:
|
|
1177
|
+
children: v(r.tookSeconds, { n })
|
|
1006
1178
|
}
|
|
1007
1179
|
)
|
|
1008
1180
|
] });
|
|
1009
|
-
},
|
|
1181
|
+
}, $ = 5, Re = ({ data: e, t }) => {
|
|
1182
|
+
const [n, r] = x(!1), u = e.memories.map((p) => p.memoryTitle), a = u.length > 0, c = a && u.length > $, s = c && !n ? u.slice(0, $) : u, o = u.length - $, d = !c || n, g = u.length === 1 ? t.memoryFound : t.memoriesFoundPrefix, m = a ? `${g}${B(
|
|
1183
|
+
s,
|
|
1184
|
+
d ? t.and : void 0
|
|
1185
|
+
)}` : t.memoriesFound;
|
|
1186
|
+
return /* @__PURE__ */ i("div", { style: { padding: "16px" }, children: /* @__PURE__ */ i(
|
|
1187
|
+
S.div,
|
|
1188
|
+
{
|
|
1189
|
+
style: { color: "#666" },
|
|
1190
|
+
initial: { opacity: 0, y: -10 },
|
|
1191
|
+
animate: { opacity: 1, y: 0 },
|
|
1192
|
+
transition: { duration: 0.3, delay: 0 },
|
|
1193
|
+
children: /* @__PURE__ */ y(E, { children: [
|
|
1194
|
+
/* @__PURE__ */ i("span", { style: { color: "#666" }, children: m }),
|
|
1195
|
+
c && !n && /* @__PURE__ */ y(E, { children: [
|
|
1196
|
+
" ",
|
|
1197
|
+
/* @__PURE__ */ i(
|
|
1198
|
+
"button",
|
|
1199
|
+
{
|
|
1200
|
+
type: "button",
|
|
1201
|
+
onClick: () => r(!0),
|
|
1202
|
+
style: {
|
|
1203
|
+
background: "none",
|
|
1204
|
+
border: "none",
|
|
1205
|
+
padding: 0,
|
|
1206
|
+
margin: 0,
|
|
1207
|
+
fontSize: "inherit",
|
|
1208
|
+
color: "inherit",
|
|
1209
|
+
cursor: "pointer",
|
|
1210
|
+
textDecoration: "underline",
|
|
1211
|
+
fontFamily: "inherit"
|
|
1212
|
+
},
|
|
1213
|
+
children: v(t.moreMemories, {
|
|
1214
|
+
n: o
|
|
1215
|
+
})
|
|
1216
|
+
}
|
|
1217
|
+
)
|
|
1218
|
+
] }),
|
|
1219
|
+
c && n && /* @__PURE__ */ y(E, { children: [
|
|
1220
|
+
" ",
|
|
1221
|
+
/* @__PURE__ */ i(
|
|
1222
|
+
"button",
|
|
1223
|
+
{
|
|
1224
|
+
type: "button",
|
|
1225
|
+
onClick: () => r(!1),
|
|
1226
|
+
style: {
|
|
1227
|
+
background: "none",
|
|
1228
|
+
border: "none",
|
|
1229
|
+
padding: 0,
|
|
1230
|
+
margin: 0,
|
|
1231
|
+
fontSize: "inherit",
|
|
1232
|
+
color: "inherit",
|
|
1233
|
+
cursor: "pointer",
|
|
1234
|
+
textDecoration: "underline",
|
|
1235
|
+
fontFamily: "inherit"
|
|
1236
|
+
},
|
|
1237
|
+
children: t.clickToCollapse
|
|
1238
|
+
}
|
|
1239
|
+
)
|
|
1240
|
+
] })
|
|
1241
|
+
] })
|
|
1242
|
+
}
|
|
1243
|
+
) });
|
|
1244
|
+
}, Le = ({ isLatest: e = !1, durationSeconds: t, t: n }) => {
|
|
1010
1245
|
const r = n.addingSources;
|
|
1011
|
-
return /* @__PURE__ */
|
|
1246
|
+
return /* @__PURE__ */ y("div", { style: { padding: "16px" }, children: [
|
|
1012
1247
|
/* @__PURE__ */ i(
|
|
1013
|
-
|
|
1248
|
+
S.div,
|
|
1014
1249
|
{
|
|
1015
1250
|
style: {
|
|
1016
1251
|
display: "flex",
|
|
@@ -1022,7 +1257,7 @@ const we = ({ data: e, isLatest: t = !1, durationSeconds: n, t: r }) => {
|
|
|
1022
1257
|
animate: { opacity: 1, y: 0 },
|
|
1023
1258
|
transition: { duration: 0.3, delay: 0 },
|
|
1024
1259
|
children: e && !t ? /* @__PURE__ */ i(
|
|
1025
|
-
|
|
1260
|
+
P,
|
|
1026
1261
|
{
|
|
1027
1262
|
text: r,
|
|
1028
1263
|
duration: 2.5,
|
|
@@ -1042,26 +1277,26 @@ const we = ({ data: e, isLatest: t = !1, durationSeconds: n, t: r }) => {
|
|
|
1042
1277
|
marginTop: "4px",
|
|
1043
1278
|
fontStyle: "italic"
|
|
1044
1279
|
},
|
|
1045
|
-
children:
|
|
1280
|
+
children: v(n.tookSeconds, { n: t })
|
|
1046
1281
|
}
|
|
1047
1282
|
)
|
|
1048
1283
|
] });
|
|
1049
1284
|
};
|
|
1050
|
-
function
|
|
1285
|
+
function Oe(e, t) {
|
|
1051
1286
|
if (e.length === 0) return "";
|
|
1052
1287
|
if (e.length === 1)
|
|
1053
|
-
return
|
|
1288
|
+
return v(t.pageSingle, { n: e[0] });
|
|
1054
1289
|
if (e.length === 2)
|
|
1055
|
-
return
|
|
1290
|
+
return v(t.pageTwo, {
|
|
1056
1291
|
a: e[0],
|
|
1057
1292
|
b: e[1]
|
|
1058
1293
|
});
|
|
1059
1294
|
const n = e[e.length - 1], r = e.slice(0, -1).join(", ");
|
|
1060
|
-
return
|
|
1295
|
+
return v(t.pageMultiple, { list: r, n });
|
|
1061
1296
|
}
|
|
1062
|
-
const
|
|
1297
|
+
const $e = ({ data: e, onSourceClick: t, t: n }) => /* @__PURE__ */ y("div", { style: { padding: "16px" }, children: [
|
|
1063
1298
|
/* @__PURE__ */ i(
|
|
1064
|
-
|
|
1299
|
+
S.div,
|
|
1065
1300
|
{
|
|
1066
1301
|
style: {
|
|
1067
1302
|
marginBottom: "10px",
|
|
@@ -1077,32 +1312,32 @@ const Me = ({ data: e, onSourceClick: t, t: n }) => /* @__PURE__ */ v("div", { s
|
|
|
1077
1312
|
children: n.sources
|
|
1078
1313
|
}
|
|
1079
1314
|
),
|
|
1080
|
-
/* @__PURE__ */ i("div", { style: { display: "flex", flexWrap: "wrap", gap: "8px" }, children: e.sources.length === 0 ? /* @__PURE__ */ i("span", { style: { fontSize: "13px", color: "#888" }, children: n.noSources }) : e.sources.map((r,
|
|
1081
|
-
|
|
1315
|
+
/* @__PURE__ */ i("div", { style: { display: "flex", flexWrap: "wrap", gap: "8px" }, children: e.sources.length === 0 ? /* @__PURE__ */ i("span", { style: { fontSize: "13px", color: "#888" }, children: n.noSources }) : e.sources.map((r, l) => /* @__PURE__ */ i(
|
|
1316
|
+
ze,
|
|
1082
1317
|
{
|
|
1083
1318
|
source: r,
|
|
1084
|
-
index:
|
|
1319
|
+
index: l,
|
|
1085
1320
|
onSourceClick: t,
|
|
1086
1321
|
t: n
|
|
1087
1322
|
},
|
|
1088
1323
|
r.memoryId
|
|
1089
1324
|
)) })
|
|
1090
|
-
] }),
|
|
1325
|
+
] }), ze = ({
|
|
1091
1326
|
source: e,
|
|
1092
1327
|
index: t,
|
|
1093
1328
|
onSourceClick: n,
|
|
1094
1329
|
t: r
|
|
1095
1330
|
}) => {
|
|
1096
|
-
const [
|
|
1097
|
-
return /* @__PURE__ */
|
|
1098
|
-
|
|
1331
|
+
const [l, u] = x(!1), a = !!n, c = e.pageNumbers ?? [], s = Oe(c, r);
|
|
1332
|
+
return /* @__PURE__ */ y(
|
|
1333
|
+
S.div,
|
|
1099
1334
|
{
|
|
1100
1335
|
initial: { opacity: 0, scale: 0.9 },
|
|
1101
1336
|
animate: { opacity: 1, scale: 1 },
|
|
1102
1337
|
transition: { duration: 0.25, delay: t * 0.05 },
|
|
1103
|
-
onClick:
|
|
1104
|
-
onMouseEnter:
|
|
1105
|
-
onMouseLeave:
|
|
1338
|
+
onClick: a ? () => n(e.memoryId) : void 0,
|
|
1339
|
+
onMouseEnter: a ? () => u(!0) : void 0,
|
|
1340
|
+
onMouseLeave: a ? () => u(!1) : void 0,
|
|
1106
1341
|
style: {
|
|
1107
1342
|
display: "inline-flex",
|
|
1108
1343
|
flexDirection: "column",
|
|
@@ -1110,18 +1345,18 @@ const Me = ({ data: e, onSourceClick: t, t: n }) => /* @__PURE__ */ v("div", { s
|
|
|
1110
1345
|
padding: "8px 12px",
|
|
1111
1346
|
borderRadius: "6px",
|
|
1112
1347
|
border: "1px solid #e0e0e0",
|
|
1113
|
-
backgroundColor:
|
|
1114
|
-
cursor:
|
|
1348
|
+
backgroundColor: l ? "#f5f5f5" : "transparent",
|
|
1349
|
+
cursor: a ? "pointer" : "default",
|
|
1115
1350
|
transition: "background-color 0.15s ease",
|
|
1116
1351
|
userSelect: "none"
|
|
1117
1352
|
},
|
|
1118
1353
|
children: [
|
|
1119
1354
|
/* @__PURE__ */ i("span", { style: { fontSize: "13px", fontWeight: 500, color: "#333" }, children: e.memoryTitle }),
|
|
1120
|
-
|
|
1355
|
+
s && /* @__PURE__ */ i("span", { style: { fontSize: "12px", color: "#666" }, children: s })
|
|
1121
1356
|
]
|
|
1122
1357
|
}
|
|
1123
1358
|
);
|
|
1124
|
-
},
|
|
1359
|
+
}, j = ({
|
|
1125
1360
|
color: e = "#78b13f",
|
|
1126
1361
|
size: t = 24,
|
|
1127
1362
|
borderWidth: n = 7
|
|
@@ -1140,20 +1375,20 @@ const Me = ({ data: e, onSourceClick: t, t: n }) => /* @__PURE__ */ v("div", { s
|
|
|
1140
1375
|
}
|
|
1141
1376
|
}
|
|
1142
1377
|
);
|
|
1143
|
-
},
|
|
1378
|
+
}, Be = ({
|
|
1144
1379
|
color: e = "#333",
|
|
1145
1380
|
size: t = 32,
|
|
1146
1381
|
lineWidth: n = 2
|
|
1147
1382
|
}) => {
|
|
1148
|
-
const r = t + 1,
|
|
1383
|
+
const r = t + 1, l = (t - n) / 2, u = (t - r) / 2, a = {
|
|
1149
1384
|
position: "absolute",
|
|
1150
|
-
left:
|
|
1151
|
-
top:
|
|
1385
|
+
left: l,
|
|
1386
|
+
top: u,
|
|
1152
1387
|
width: n,
|
|
1153
1388
|
height: r,
|
|
1154
1389
|
backgroundColor: e
|
|
1155
1390
|
};
|
|
1156
|
-
return /* @__PURE__ */
|
|
1391
|
+
return /* @__PURE__ */ y(
|
|
1157
1392
|
"span",
|
|
1158
1393
|
{
|
|
1159
1394
|
style: {
|
|
@@ -1167,7 +1402,7 @@ const Me = ({ data: e, onSourceClick: t, t: n }) => /* @__PURE__ */ v("div", { s
|
|
|
1167
1402
|
"span",
|
|
1168
1403
|
{
|
|
1169
1404
|
style: {
|
|
1170
|
-
...
|
|
1405
|
+
...a,
|
|
1171
1406
|
transform: "rotate(45deg)"
|
|
1172
1407
|
}
|
|
1173
1408
|
}
|
|
@@ -1176,7 +1411,7 @@ const Me = ({ data: e, onSourceClick: t, t: n }) => /* @__PURE__ */ v("div", { s
|
|
|
1176
1411
|
"span",
|
|
1177
1412
|
{
|
|
1178
1413
|
style: {
|
|
1179
|
-
...
|
|
1414
|
+
...a,
|
|
1180
1415
|
transform: "rotate(-45deg)"
|
|
1181
1416
|
}
|
|
1182
1417
|
}
|
|
@@ -1185,22 +1420,28 @@ const Me = ({ data: e, onSourceClick: t, t: n }) => /* @__PURE__ */ v("div", { s
|
|
|
1185
1420
|
}
|
|
1186
1421
|
);
|
|
1187
1422
|
};
|
|
1188
|
-
function
|
|
1189
|
-
|
|
1423
|
+
function Ue({
|
|
1424
|
+
memory: e,
|
|
1190
1425
|
completed: t
|
|
1191
1426
|
}) {
|
|
1192
|
-
return e
|
|
1427
|
+
return e.error != null ? /* @__PURE__ */ i(Be, { color: "#c62828", size: 15, lineWidth: 2 }) : e.result != null ? /* @__PURE__ */ i(j, { color: "#999", size: 15, borderWidth: 2 }) : t ? /* @__PURE__ */ i(j, { color: "#999", size: 15, borderWidth: 2 }) : /* @__PURE__ */ i("span", { className: "explore-memory-loader" });
|
|
1193
1428
|
}
|
|
1194
|
-
const
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1429
|
+
const W = 80;
|
|
1430
|
+
function _e({
|
|
1431
|
+
memory: e,
|
|
1432
|
+
completed: t,
|
|
1433
|
+
t: n
|
|
1434
|
+
}) {
|
|
1435
|
+
const [r, l] = x(!1), u = e.result ?? e.error, a = u != null && u.length > W, c = u != null ? r || !a ? u : `${u.slice(0, W)}...` : void 0, s = a, o = e.error != null;
|
|
1436
|
+
return /* @__PURE__ */ y(
|
|
1437
|
+
S.div,
|
|
1198
1438
|
{
|
|
1199
1439
|
initial: { opacity: 0 },
|
|
1200
1440
|
animate: { opacity: 1 },
|
|
1201
1441
|
transition: { duration: 0.25 },
|
|
1202
|
-
onClick:
|
|
1442
|
+
onClick: s ? () => l((d) => !d) : void 0,
|
|
1203
1443
|
style: {
|
|
1444
|
+
paddingTop: "12px",
|
|
1204
1445
|
paddingBottom: "12px",
|
|
1205
1446
|
borderBottom: "1px solid #eee",
|
|
1206
1447
|
display: "flex",
|
|
@@ -1208,7 +1449,7 @@ const z = 80, Fe = ({ data: e, completed: t, isLatest: n = !1, t: r }) => {
|
|
|
1208
1449
|
alignItems: "center",
|
|
1209
1450
|
gap: "10px",
|
|
1210
1451
|
minWidth: 0,
|
|
1211
|
-
cursor:
|
|
1452
|
+
cursor: s ? "pointer" : "default"
|
|
1212
1453
|
},
|
|
1213
1454
|
children: [
|
|
1214
1455
|
/* @__PURE__ */ i(
|
|
@@ -1221,16 +1462,10 @@ const z = 80, Fe = ({ data: e, completed: t, isLatest: n = !1, t: r }) => {
|
|
|
1221
1462
|
flexShrink: 0,
|
|
1222
1463
|
width: 32
|
|
1223
1464
|
},
|
|
1224
|
-
children: /* @__PURE__ */ i(
|
|
1225
|
-
Re,
|
|
1226
|
-
{
|
|
1227
|
-
eventType: e.eventType,
|
|
1228
|
-
completed: t
|
|
1229
|
-
}
|
|
1230
|
-
)
|
|
1465
|
+
children: /* @__PURE__ */ i(Ue, { memory: e, completed: t })
|
|
1231
1466
|
}
|
|
1232
1467
|
),
|
|
1233
|
-
/* @__PURE__ */
|
|
1468
|
+
/* @__PURE__ */ y(
|
|
1234
1469
|
"div",
|
|
1235
1470
|
{
|
|
1236
1471
|
style: {
|
|
@@ -1247,19 +1482,19 @@ const z = 80, Fe = ({ data: e, completed: t, isLatest: n = !1, t: r }) => {
|
|
|
1247
1482
|
children: e.memoryTitle
|
|
1248
1483
|
}
|
|
1249
1484
|
),
|
|
1250
|
-
|
|
1485
|
+
c != null && /* @__PURE__ */ i(
|
|
1251
1486
|
"span",
|
|
1252
1487
|
{
|
|
1253
1488
|
style: {
|
|
1254
1489
|
fontSize: 12,
|
|
1255
|
-
color: "#666",
|
|
1490
|
+
color: o ? "#c62828" : "#666",
|
|
1256
1491
|
lineHeight: 1.4,
|
|
1257
|
-
whiteSpace:
|
|
1492
|
+
whiteSpace: r ? "pre-wrap" : void 0
|
|
1258
1493
|
},
|
|
1259
|
-
children:
|
|
1494
|
+
children: c
|
|
1260
1495
|
}
|
|
1261
1496
|
),
|
|
1262
|
-
|
|
1497
|
+
s && /* @__PURE__ */ i(
|
|
1263
1498
|
"span",
|
|
1264
1499
|
{
|
|
1265
1500
|
style: {
|
|
@@ -1267,7 +1502,7 @@ const z = 80, Fe = ({ data: e, completed: t, isLatest: n = !1, t: r }) => {
|
|
|
1267
1502
|
color: "#999",
|
|
1268
1503
|
marginTop: 2
|
|
1269
1504
|
},
|
|
1270
|
-
children:
|
|
1505
|
+
children: r ? n.clickToCollapse : n.clickToExpand
|
|
1271
1506
|
}
|
|
1272
1507
|
)
|
|
1273
1508
|
]
|
|
@@ -1275,33 +1510,42 @@ const z = 80, Fe = ({ data: e, completed: t, isLatest: n = !1, t: r }) => {
|
|
|
1275
1510
|
)
|
|
1276
1511
|
]
|
|
1277
1512
|
}
|
|
1278
|
-
)
|
|
1279
|
-
}
|
|
1280
|
-
|
|
1513
|
+
);
|
|
1514
|
+
}
|
|
1515
|
+
const Ne = ({ data: e, completed: t, t: n }) => /* @__PURE__ */ i("div", { style: { padding: "10px" }, children: e.memories.map((r) => /* @__PURE__ */ i(
|
|
1516
|
+
_e,
|
|
1517
|
+
{
|
|
1518
|
+
memory: r,
|
|
1519
|
+
completed: t,
|
|
1520
|
+
t: n
|
|
1521
|
+
},
|
|
1522
|
+
r.memoryId
|
|
1523
|
+
)) });
|
|
1524
|
+
function je(e, t) {
|
|
1281
1525
|
if (e.length === 0) return "";
|
|
1282
1526
|
if (e.length === 1)
|
|
1283
|
-
return
|
|
1527
|
+
return v(t.pageSingle, { n: e[0] });
|
|
1284
1528
|
if (e.length === 2)
|
|
1285
|
-
return
|
|
1529
|
+
return v(t.pageTwo, {
|
|
1286
1530
|
a: e[0],
|
|
1287
1531
|
b: e[1]
|
|
1288
1532
|
});
|
|
1289
1533
|
const n = e[e.length - 1], r = e.slice(0, -1).join(", ");
|
|
1290
|
-
return
|
|
1534
|
+
return v(t.pageMultiple, { list: r, n });
|
|
1291
1535
|
}
|
|
1292
|
-
function
|
|
1293
|
-
return e === 1 ? t.chunkFound :
|
|
1536
|
+
function We(e, t) {
|
|
1537
|
+
return e === 1 ? t.chunkFound : v(t.chunksFound, { n: e });
|
|
1294
1538
|
}
|
|
1295
|
-
const
|
|
1296
|
-
const [n, r] =
|
|
1297
|
-
return /* @__PURE__ */
|
|
1298
|
-
/* @__PURE__ */
|
|
1299
|
-
|
|
1539
|
+
const He = ({ data: e, t }) => {
|
|
1540
|
+
const [n, r] = x(!1), l = e.chunks.length, u = l > 0;
|
|
1541
|
+
return /* @__PURE__ */ y("div", { style: { padding: "10px" }, children: [
|
|
1542
|
+
/* @__PURE__ */ y(
|
|
1543
|
+
S.div,
|
|
1300
1544
|
{
|
|
1301
1545
|
initial: { opacity: 0 },
|
|
1302
1546
|
animate: { opacity: 1 },
|
|
1303
1547
|
transition: { duration: 0.25 },
|
|
1304
|
-
onClick:
|
|
1548
|
+
onClick: u ? () => r((a) => !a) : void 0,
|
|
1305
1549
|
style: {
|
|
1306
1550
|
paddingBottom: n ? "12px" : 0,
|
|
1307
1551
|
borderBottom: n ? "1px solid #eee" : void 0,
|
|
@@ -1309,12 +1553,12 @@ const Be = ({ data: e, t }) => {
|
|
|
1309
1553
|
flexDirection: "column",
|
|
1310
1554
|
gap: "4px",
|
|
1311
1555
|
minWidth: 0,
|
|
1312
|
-
cursor:
|
|
1556
|
+
cursor: u ? "pointer" : "default"
|
|
1313
1557
|
},
|
|
1314
1558
|
children: [
|
|
1315
1559
|
/* @__PURE__ */ i("span", { style: { fontSize: 13, fontWeight: 500, color: "#333" }, children: e.memoryTitle }),
|
|
1316
|
-
/* @__PURE__ */ i("span", { style: { fontSize: 12, color: "#666" }, children:
|
|
1317
|
-
|
|
1560
|
+
/* @__PURE__ */ i("span", { style: { fontSize: 12, color: "#666" }, children: We(l, t) }),
|
|
1561
|
+
u && /* @__PURE__ */ i(
|
|
1318
1562
|
"span",
|
|
1319
1563
|
{
|
|
1320
1564
|
style: {
|
|
@@ -1328,8 +1572,8 @@ const Be = ({ data: e, t }) => {
|
|
|
1328
1572
|
]
|
|
1329
1573
|
}
|
|
1330
1574
|
),
|
|
1331
|
-
n &&
|
|
1332
|
-
|
|
1575
|
+
n && u && /* @__PURE__ */ i(
|
|
1576
|
+
S.div,
|
|
1333
1577
|
{
|
|
1334
1578
|
initial: { opacity: 0, height: 0 },
|
|
1335
1579
|
animate: { opacity: 1, height: "auto" },
|
|
@@ -1342,9 +1586,9 @@ const Be = ({ data: e, t }) => {
|
|
|
1342
1586
|
flexDirection: "column",
|
|
1343
1587
|
gap: 8
|
|
1344
1588
|
},
|
|
1345
|
-
children: e.chunks.map((
|
|
1346
|
-
const
|
|
1347
|
-
return /* @__PURE__ */
|
|
1589
|
+
children: e.chunks.map((a, c) => {
|
|
1590
|
+
const s = a.pageNumbers ?? [], o = je(s, t);
|
|
1591
|
+
return /* @__PURE__ */ y(
|
|
1348
1592
|
"div",
|
|
1349
1593
|
{
|
|
1350
1594
|
style: {
|
|
@@ -1364,10 +1608,10 @@ const Be = ({ data: e, t }) => {
|
|
|
1364
1608
|
display: "block",
|
|
1365
1609
|
marginBottom: 4
|
|
1366
1610
|
},
|
|
1367
|
-
children:
|
|
1611
|
+
children: a.content
|
|
1368
1612
|
}
|
|
1369
1613
|
),
|
|
1370
|
-
/* @__PURE__ */
|
|
1614
|
+
/* @__PURE__ */ y(
|
|
1371
1615
|
"div",
|
|
1372
1616
|
{
|
|
1373
1617
|
style: {
|
|
@@ -1377,23 +1621,23 @@ const Be = ({ data: e, t }) => {
|
|
|
1377
1621
|
color: "#666"
|
|
1378
1622
|
},
|
|
1379
1623
|
children: [
|
|
1380
|
-
|
|
1381
|
-
/* @__PURE__ */ i("span", { children:
|
|
1382
|
-
n:
|
|
1624
|
+
o && /* @__PURE__ */ i("span", { children: o }),
|
|
1625
|
+
/* @__PURE__ */ i("span", { children: v(t.scoreLabel, {
|
|
1626
|
+
n: a.score
|
|
1383
1627
|
}) })
|
|
1384
1628
|
]
|
|
1385
1629
|
}
|
|
1386
1630
|
)
|
|
1387
1631
|
]
|
|
1388
1632
|
},
|
|
1389
|
-
|
|
1633
|
+
c
|
|
1390
1634
|
);
|
|
1391
1635
|
})
|
|
1392
1636
|
}
|
|
1393
1637
|
)
|
|
1394
1638
|
] });
|
|
1395
|
-
},
|
|
1396
|
-
|
|
1639
|
+
}, Ke = ({ message: e }) => /* @__PURE__ */ i("div", { style: { padding: "16px" }, children: /* @__PURE__ */ i(
|
|
1640
|
+
S.div,
|
|
1397
1641
|
{
|
|
1398
1642
|
initial: { opacity: 0, y: -10 },
|
|
1399
1643
|
animate: { opacity: 1, y: 0 },
|
|
@@ -1415,126 +1659,144 @@ const Be = ({ data: e, t }) => {
|
|
|
1415
1659
|
}
|
|
1416
1660
|
)
|
|
1417
1661
|
}
|
|
1418
|
-
) }),
|
|
1662
|
+
) }), qe = ({
|
|
1419
1663
|
progressViewItems: e,
|
|
1420
1664
|
loadingText: t,
|
|
1421
1665
|
t: n,
|
|
1422
1666
|
onSourceClick: r
|
|
1423
1667
|
}) => {
|
|
1424
|
-
const
|
|
1668
|
+
const l = I(null);
|
|
1425
1669
|
w(() => {
|
|
1426
|
-
|
|
1670
|
+
l.current && (l.current.scrollTop = l.current.scrollHeight);
|
|
1427
1671
|
}, [e.length]);
|
|
1428
|
-
const
|
|
1429
|
-
const
|
|
1430
|
-
if (
|
|
1431
|
-
return /* @__PURE__ */ i(
|
|
1432
|
-
if (
|
|
1433
|
-
return /* @__PURE__ */ i(
|
|
1434
|
-
if (
|
|
1435
|
-
switch (
|
|
1672
|
+
const u = (c) => {
|
|
1673
|
+
const s = c.item.data;
|
|
1674
|
+
if (s.taskType === "StreamingChatCompletion" && s.eventType === "Text")
|
|
1675
|
+
return /* @__PURE__ */ i(N, { text: s.text });
|
|
1676
|
+
if (s.taskType === "StructuredChatCompletion" && s.eventType === "Json")
|
|
1677
|
+
return /* @__PURE__ */ i(Ie, { data: s });
|
|
1678
|
+
if (s.taskType === "MemoryChatCompletion")
|
|
1679
|
+
switch (s.eventType) {
|
|
1436
1680
|
case "Text":
|
|
1437
|
-
return /* @__PURE__ */ i(
|
|
1681
|
+
return /* @__PURE__ */ i(N, { text: s.text });
|
|
1682
|
+
case "FindMemories":
|
|
1683
|
+
return /* @__PURE__ */ i(
|
|
1684
|
+
Pe,
|
|
1685
|
+
{
|
|
1686
|
+
data: s,
|
|
1687
|
+
isLatest: c.isLatest,
|
|
1688
|
+
durationSeconds: c.durationSeconds,
|
|
1689
|
+
t: n
|
|
1690
|
+
}
|
|
1691
|
+
);
|
|
1692
|
+
case "FindMemoriesResult":
|
|
1693
|
+
return /* @__PURE__ */ i(Re, { data: s, t: n });
|
|
1438
1694
|
case "Search":
|
|
1439
1695
|
return /* @__PURE__ */ i(
|
|
1440
|
-
|
|
1696
|
+
De,
|
|
1441
1697
|
{
|
|
1442
|
-
data:
|
|
1443
|
-
isLatest:
|
|
1444
|
-
durationSeconds:
|
|
1698
|
+
data: s,
|
|
1699
|
+
isLatest: c.isLatest,
|
|
1700
|
+
durationSeconds: c.durationSeconds,
|
|
1445
1701
|
t: n
|
|
1446
1702
|
}
|
|
1447
1703
|
);
|
|
1448
1704
|
case "FindSources":
|
|
1449
1705
|
return /* @__PURE__ */ i(
|
|
1450
|
-
|
|
1706
|
+
Le,
|
|
1451
1707
|
{
|
|
1452
|
-
data:
|
|
1453
|
-
isLatest:
|
|
1454
|
-
durationSeconds:
|
|
1708
|
+
data: s,
|
|
1709
|
+
isLatest: c.isLatest,
|
|
1710
|
+
durationSeconds: c.durationSeconds,
|
|
1455
1711
|
t: n
|
|
1456
1712
|
}
|
|
1457
1713
|
);
|
|
1458
1714
|
case "SourcesResult":
|
|
1459
1715
|
return /* @__PURE__ */ i(
|
|
1460
|
-
|
|
1716
|
+
$e,
|
|
1461
1717
|
{
|
|
1462
|
-
data:
|
|
1718
|
+
data: s,
|
|
1463
1719
|
onSourceClick: r,
|
|
1464
1720
|
t: n
|
|
1465
1721
|
}
|
|
1466
1722
|
);
|
|
1467
|
-
case "
|
|
1468
|
-
case "ExploreMemoryResult":
|
|
1469
|
-
case "ExploreMemoryError":
|
|
1723
|
+
case "ExploreMemories":
|
|
1470
1724
|
return /* @__PURE__ */ i(
|
|
1471
|
-
|
|
1725
|
+
Ne,
|
|
1472
1726
|
{
|
|
1473
|
-
data:
|
|
1474
|
-
completed:
|
|
1475
|
-
isLatest:
|
|
1727
|
+
data: s,
|
|
1728
|
+
completed: c.completed,
|
|
1729
|
+
isLatest: c.isLatest,
|
|
1476
1730
|
t: n
|
|
1477
1731
|
}
|
|
1478
1732
|
);
|
|
1479
1733
|
case "ChunkResult":
|
|
1480
|
-
return /* @__PURE__ */ i(
|
|
1734
|
+
return /* @__PURE__ */ i(He, { data: s, t: n });
|
|
1481
1735
|
case "Completed":
|
|
1482
1736
|
return null;
|
|
1483
1737
|
}
|
|
1484
|
-
return
|
|
1738
|
+
return s.taskType === "StreamingChatCompletion" && s.eventType === "Completed" || s.taskType === "StructuredChatCompletion" && s.eventType === "Completed" ? null : s.eventType === "Error" && "message" in s ? /* @__PURE__ */ i(Ke, { message: s.message }) : null;
|
|
1485
1739
|
};
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1496
|
-
|
|
1497
|
-
|
|
1740
|
+
if (e.length === 0)
|
|
1741
|
+
return /* @__PURE__ */ i("div", { style: { width: "fit-content" }, children: /* @__PURE__ */ i(
|
|
1742
|
+
P,
|
|
1743
|
+
{
|
|
1744
|
+
text: t ?? n.processingYourTask,
|
|
1745
|
+
duration: 1.5,
|
|
1746
|
+
repeat: !0,
|
|
1747
|
+
repeatDelay: 0,
|
|
1748
|
+
color: "#999",
|
|
1749
|
+
shimmerColor: "#000"
|
|
1750
|
+
}
|
|
1751
|
+
) });
|
|
1752
|
+
const a = e.filter((c, s) => {
|
|
1753
|
+
const o = c.item.data;
|
|
1754
|
+
return o.taskType === "MemoryChatCompletion" && o.eventType === "ExploreMemories" ? !e.slice(s + 1).some(
|
|
1755
|
+
(m) => m.item.data.taskType === "MemoryChatCompletion" && m.item.data.eventType === "ExploreMemories"
|
|
1756
|
+
) : !0;
|
|
1757
|
+
});
|
|
1758
|
+
return /* @__PURE__ */ i("div", { id: "agent-task-progress-verbose", ref: l, children: /* @__PURE__ */ i(q, { children: a.map((c, s) => /* @__PURE__ */ i(
|
|
1759
|
+
S.div,
|
|
1498
1760
|
{
|
|
1499
|
-
id: `agent-task-progress-item-${
|
|
1761
|
+
id: `agent-task-progress-item-${c.item.progressItemId}`,
|
|
1500
1762
|
initial: { opacity: 0, y: -20 },
|
|
1501
1763
|
animate: { opacity: 1, y: 0 },
|
|
1502
1764
|
transition: {
|
|
1503
1765
|
duration: 0.4,
|
|
1504
|
-
delay:
|
|
1766
|
+
delay: s * 0.1,
|
|
1505
1767
|
ease: "easeOut"
|
|
1506
1768
|
},
|
|
1507
|
-
children:
|
|
1769
|
+
children: u(c)
|
|
1508
1770
|
},
|
|
1509
|
-
|
|
1771
|
+
c.item.progressItemId
|
|
1510
1772
|
)) }) });
|
|
1511
|
-
},
|
|
1773
|
+
}, nt = ({
|
|
1512
1774
|
agentTask: e,
|
|
1513
1775
|
mode: t = "verbose",
|
|
1514
1776
|
language: n,
|
|
1515
1777
|
onSourceClick: r
|
|
1516
1778
|
}) => {
|
|
1517
|
-
const
|
|
1779
|
+
const l = Ee(e), u = e.params.type === "MemoryChatCompletion" && "language" in e.params ? e.params.language ?? "en" : n ?? "en", a = Fe(u);
|
|
1518
1780
|
return t === "simple" ? /* @__PURE__ */ i(
|
|
1519
|
-
|
|
1781
|
+
we,
|
|
1520
1782
|
{
|
|
1521
|
-
progressViewItems:
|
|
1522
|
-
t:
|
|
1783
|
+
progressViewItems: l,
|
|
1784
|
+
t: a
|
|
1523
1785
|
}
|
|
1524
1786
|
) : /* @__PURE__ */ i(
|
|
1525
|
-
|
|
1787
|
+
qe,
|
|
1526
1788
|
{
|
|
1527
|
-
progressViewItems:
|
|
1789
|
+
progressViewItems: l,
|
|
1528
1790
|
loadingText: e.loadingText,
|
|
1529
|
-
t:
|
|
1791
|
+
t: a,
|
|
1530
1792
|
onSourceClick: r
|
|
1531
1793
|
}
|
|
1532
1794
|
);
|
|
1533
1795
|
};
|
|
1534
1796
|
export {
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1797
|
+
nt as AgentTaskProgress,
|
|
1798
|
+
j as Checkmark,
|
|
1799
|
+
et as FencyProvider,
|
|
1800
|
+
Be as XMark,
|
|
1801
|
+
tt as useAgentTasks
|
|
1540
1802
|
};
|