@fencyai/react 0.1.124 → 0.1.125
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/data-types/MemoryChatCompletionExploreMemory.d.ts +14 -0
- package/dist/agent-task/data-types/MemoryChatCompletionExploreMemory.d.ts.map +1 -0
- package/dist/agent-task/data-types/MemoryChatCompletionFindSources.d.ts +12 -0
- package/dist/agent-task/data-types/MemoryChatCompletionFindSources.d.ts.map +1 -0
- package/dist/agent-task/data-types/MemoryChatCompletionSearch.d.ts +12 -0
- package/dist/agent-task/data-types/MemoryChatCompletionSearch.d.ts.map +1 -0
- package/dist/agent-task/data-types/MemoryChatCompletionSourcesResult.d.ts +11 -0
- package/dist/agent-task/data-types/MemoryChatCompletionSourcesResult.d.ts.map +1 -0
- package/dist/hooks/useStream/index.d.ts.map +1 -1
- package/dist/index.js +456 -477
- package/dist/types/CreateAgentTaskParams.d.ts +3 -3
- package/dist/types/CreateAgentTaskParams.d.ts.map +1 -1
- package/dist/types/CreateAgentTaskResponse.d.ts +1 -1
- package/dist/types/CreateAgentTaskResponse.d.ts.map +1 -1
- package/dist/types/StreamData.d.ts +1 -48
- package/dist/types/StreamData.d.ts.map +1 -1
- package/dist/types/UseAgentTasksProps.d.ts +1 -1
- package/dist/types/UseAgentTasksProps.d.ts.map +1 -1
- package/dist/types/UseStreamProps.d.ts +2 -9
- package/dist/types/UseStreamProps.d.ts.map +1 -1
- package/dist/types/index.d.ts +0 -1
- package/dist/types/index.d.ts.map +1 -1
- package/package.json +4 -4
- package/dist/agent-task/data-types/StreamingMemoryTypeChatCompletionExploreMemory.d.ts +0 -14
- package/dist/agent-task/data-types/StreamingMemoryTypeChatCompletionExploreMemory.d.ts.map +0 -1
- package/dist/agent-task/data-types/StreamingMemoryTypeChatCompletionFindSources.d.ts +0 -12
- package/dist/agent-task/data-types/StreamingMemoryTypeChatCompletionFindSources.d.ts.map +0 -1
- package/dist/agent-task/data-types/StreamingMemoryTypeChatCompletionSearch.d.ts +0 -12
- package/dist/agent-task/data-types/StreamingMemoryTypeChatCompletionSearch.d.ts.map +0 -1
- package/dist/agent-task/data-types/StreamingMemoryTypeChatCompletionSourcesResult.d.ts +0 -11
- package/dist/agent-task/data-types/StreamingMemoryTypeChatCompletionSourcesResult.d.ts.map +0 -1
- package/dist/types/AgentTaskData.d.ts +0 -6
- package/dist/types/AgentTaskData.d.ts.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as C, jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import { createStream as K, isStreamTimeoutEvent as _, isStreamNotFoundEvent as J, isAgentTaskProgressItemUpdatedEvent as V, createAgentTask as q } from "@fencyai/js";
|
|
3
|
-
import { createContext as G, useState as
|
|
4
|
-
import { useInView as Q, motion as
|
|
3
|
+
import { createContext as G, useState as k, useRef as E, useEffect as w, useCallback as L, useContext as X, useMemo as U } from "react";
|
|
4
|
+
import { useInView as Q, motion as T, AnimatePresence as W } from "motion/react";
|
|
5
5
|
import Y from "react-markdown";
|
|
6
6
|
import { Prism as $ } from "react-syntax-highlighter";
|
|
7
7
|
import Z from "remark-gfm";
|
|
@@ -9,70 +9,70 @@ import './assets/index.css';const N = G(
|
|
|
9
9
|
void 0
|
|
10
10
|
);
|
|
11
11
|
async function ee(e, t) {
|
|
12
|
-
const
|
|
13
|
-
let
|
|
14
|
-
for (; !(
|
|
15
|
-
t(
|
|
12
|
+
const n = e.getReader();
|
|
13
|
+
let r;
|
|
14
|
+
for (; !(r = await n.read()).done; )
|
|
15
|
+
t(r.value);
|
|
16
16
|
}
|
|
17
17
|
function te(e) {
|
|
18
|
-
let t,
|
|
19
|
-
return function(
|
|
20
|
-
t === void 0 ? (t =
|
|
21
|
-
const
|
|
18
|
+
let t, n, r, c = !1;
|
|
19
|
+
return function(i) {
|
|
20
|
+
t === void 0 ? (t = i, n = 0, r = -1) : t = ne(t, i);
|
|
21
|
+
const l = t.length;
|
|
22
22
|
let d = 0;
|
|
23
|
-
for (;
|
|
24
|
-
|
|
25
|
-
let
|
|
26
|
-
for (;
|
|
27
|
-
switch (t[
|
|
23
|
+
for (; n < l; ) {
|
|
24
|
+
c && (t[n] === 10 && (d = ++n), c = !1);
|
|
25
|
+
let o = -1;
|
|
26
|
+
for (; n < l && o === -1; ++n)
|
|
27
|
+
switch (t[n]) {
|
|
28
28
|
case 58:
|
|
29
|
-
|
|
29
|
+
r === -1 && (r = n - d);
|
|
30
30
|
break;
|
|
31
31
|
case 13:
|
|
32
|
-
|
|
32
|
+
c = !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(d,
|
|
39
|
+
e(t.subarray(d, o), r), d = n, r = -1;
|
|
40
40
|
}
|
|
41
|
-
d ===
|
|
41
|
+
d === l ? t = void 0 : d !== 0 && (t = t.subarray(d), n -= d);
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
|
-
function
|
|
45
|
-
let
|
|
46
|
-
const
|
|
47
|
-
return function(
|
|
48
|
-
if (
|
|
49
|
-
|
|
50
|
-
else if (
|
|
51
|
-
const d =
|
|
44
|
+
function re(e, t, n) {
|
|
45
|
+
let r = F();
|
|
46
|
+
const c = new TextDecoder();
|
|
47
|
+
return function(i, l) {
|
|
48
|
+
if (i.length === 0)
|
|
49
|
+
n == null || n(r), r = F();
|
|
50
|
+
else if (l > 0) {
|
|
51
|
+
const d = c.decode(i.subarray(0, l)), o = l + (i[l + 1] === 32 ? 2 : 1), a = c.decode(i.subarray(o));
|
|
52
52
|
switch (d) {
|
|
53
53
|
case "data":
|
|
54
|
-
|
|
55
|
-
` +
|
|
54
|
+
r.data = r.data ? r.data + `
|
|
55
|
+
` + a : a;
|
|
56
56
|
break;
|
|
57
57
|
case "event":
|
|
58
|
-
|
|
58
|
+
r.event = a;
|
|
59
59
|
break;
|
|
60
60
|
case "id":
|
|
61
|
-
e(
|
|
61
|
+
e(r.id = a);
|
|
62
62
|
break;
|
|
63
63
|
case "retry":
|
|
64
|
-
const
|
|
65
|
-
isNaN(
|
|
64
|
+
const g = parseInt(a, 10);
|
|
65
|
+
isNaN(g) || t(r.retry = g);
|
|
66
66
|
break;
|
|
67
67
|
}
|
|
68
68
|
}
|
|
69
69
|
};
|
|
70
70
|
}
|
|
71
|
-
function
|
|
72
|
-
const
|
|
73
|
-
return
|
|
71
|
+
function ne(e, t) {
|
|
72
|
+
const n = new Uint8Array(e.length + t.length);
|
|
73
|
+
return n.set(e), n.set(t, e.length), n;
|
|
74
74
|
}
|
|
75
|
-
function
|
|
75
|
+
function F() {
|
|
76
76
|
return {
|
|
77
77
|
data: "",
|
|
78
78
|
event: "",
|
|
@@ -80,68 +80,68 @@ function P() {
|
|
|
80
80
|
retry: void 0
|
|
81
81
|
};
|
|
82
82
|
}
|
|
83
|
-
var
|
|
84
|
-
var
|
|
85
|
-
for (var
|
|
83
|
+
var oe = function(e, t) {
|
|
84
|
+
var n = {};
|
|
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(
|
|
89
|
-
return
|
|
87
|
+
for (var c = 0, r = Object.getOwnPropertySymbols(e); c < r.length; c++)
|
|
88
|
+
t.indexOf(r[c]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[c]) && (n[r[c]] = e[r[c]]);
|
|
89
|
+
return n;
|
|
90
90
|
};
|
|
91
|
-
const
|
|
92
|
-
function
|
|
93
|
-
var { signal:
|
|
94
|
-
return new Promise((
|
|
95
|
-
const
|
|
96
|
-
|
|
97
|
-
let
|
|
98
|
-
function
|
|
99
|
-
|
|
91
|
+
const O = "text/event-stream", ae = 1e3, R = "last-event-id";
|
|
92
|
+
function se(e, t) {
|
|
93
|
+
var { signal: n, headers: r, onopen: c, onmessage: u, onclose: i, onerror: l, openWhenHidden: d, fetch: o } = t, a = oe(t, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
|
|
94
|
+
return new Promise((g, m) => {
|
|
95
|
+
const f = Object.assign({}, r);
|
|
96
|
+
f.accept || (f.accept = O);
|
|
97
|
+
let y;
|
|
98
|
+
function p() {
|
|
99
|
+
y.abort(), document.hidden || x();
|
|
100
100
|
}
|
|
101
|
-
d || document.addEventListener("visibilitychange",
|
|
102
|
-
let
|
|
103
|
-
function
|
|
104
|
-
document.removeEventListener("visibilitychange",
|
|
101
|
+
d || document.addEventListener("visibilitychange", p);
|
|
102
|
+
let h = ae, S = 0;
|
|
103
|
+
function b() {
|
|
104
|
+
document.removeEventListener("visibilitychange", p), window.clearTimeout(S), y.abort();
|
|
105
105
|
}
|
|
106
|
-
|
|
107
|
-
|
|
106
|
+
n == null || n.addEventListener("abort", () => {
|
|
107
|
+
b(), g();
|
|
108
108
|
});
|
|
109
|
-
const
|
|
110
|
-
async function
|
|
111
|
-
var
|
|
112
|
-
|
|
109
|
+
const P = o ?? window.fetch, A = c ?? ie;
|
|
110
|
+
async function x() {
|
|
111
|
+
var M;
|
|
112
|
+
y = new AbortController();
|
|
113
113
|
try {
|
|
114
|
-
const
|
|
115
|
-
await
|
|
116
|
-
|
|
117
|
-
}, (
|
|
118
|
-
|
|
119
|
-
}, u))),
|
|
120
|
-
} catch (
|
|
121
|
-
if (!
|
|
114
|
+
const I = await P(e, Object.assign(Object.assign({}, a), { headers: f, signal: y.signal }));
|
|
115
|
+
await A(I), await ee(I.body, te(re((v) => {
|
|
116
|
+
v ? f[R] = v : delete f[R];
|
|
117
|
+
}, (v) => {
|
|
118
|
+
h = v;
|
|
119
|
+
}, u))), i == null || i(), b(), g();
|
|
120
|
+
} catch (I) {
|
|
121
|
+
if (!y.signal.aborted)
|
|
122
122
|
try {
|
|
123
|
-
const
|
|
124
|
-
window.clearTimeout(
|
|
125
|
-
} catch (
|
|
126
|
-
|
|
123
|
+
const v = (M = l == null ? void 0 : l(I)) !== null && M !== void 0 ? M : h;
|
|
124
|
+
window.clearTimeout(S), S = window.setTimeout(x, v);
|
|
125
|
+
} catch (v) {
|
|
126
|
+
b(), m(v);
|
|
127
127
|
}
|
|
128
128
|
}
|
|
129
129
|
}
|
|
130
|
-
|
|
130
|
+
x();
|
|
131
131
|
});
|
|
132
132
|
}
|
|
133
|
-
function
|
|
133
|
+
function ie(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(O)))
|
|
136
|
+
throw new Error(`Expected content-type to be ${O}, Actual: ${t}`);
|
|
137
137
|
}
|
|
138
|
-
function
|
|
139
|
-
const t = atob(e),
|
|
140
|
-
for (let
|
|
141
|
-
r
|
|
142
|
-
return new TextDecoder("utf-8").decode(
|
|
138
|
+
function ce(e) {
|
|
139
|
+
const t = atob(e), n = new Uint8Array(t.length);
|
|
140
|
+
for (let r = 0; r < t.length; r++)
|
|
141
|
+
n[r] = t.charCodeAt(r);
|
|
142
|
+
return new TextDecoder("utf-8").decode(n);
|
|
143
143
|
}
|
|
144
|
-
class
|
|
144
|
+
class le {
|
|
145
145
|
constructor(t) {
|
|
146
146
|
this.eventSources = /* @__PURE__ */ new Map(), this.subscribers = /* @__PURE__ */ new Map(), this.fency = t;
|
|
147
147
|
}
|
|
@@ -150,37 +150,37 @@ class ce {
|
|
|
150
150
|
* Creates new connections and removes old ones.
|
|
151
151
|
*/
|
|
152
152
|
updateStreams(t) {
|
|
153
|
-
t.forEach((
|
|
154
|
-
const
|
|
155
|
-
this.eventSources.has(
|
|
153
|
+
t.forEach((r) => {
|
|
154
|
+
const c = r.stream.id;
|
|
155
|
+
this.eventSources.has(c) || this.connectStream(r);
|
|
156
156
|
});
|
|
157
|
-
const
|
|
158
|
-
this.eventSources.forEach((
|
|
159
|
-
|
|
157
|
+
const n = new Set(t.map((r) => r.stream.id));
|
|
158
|
+
this.eventSources.forEach((r, c) => {
|
|
159
|
+
n.has(c) || (r.abort(), this.eventSources.delete(c));
|
|
160
160
|
});
|
|
161
161
|
}
|
|
162
162
|
connectStream(t) {
|
|
163
|
-
const
|
|
164
|
-
this.eventSources.set(
|
|
165
|
-
const
|
|
163
|
+
const n = t.stream.id, r = new AbortController();
|
|
164
|
+
this.eventSources.set(n, r);
|
|
165
|
+
const c = `${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
|
-
|
|
169
|
+
se(c, {
|
|
170
170
|
headers: u,
|
|
171
|
-
signal:
|
|
172
|
-
async onopen(
|
|
173
|
-
if (!
|
|
174
|
-
throw new Error(`Client error ${
|
|
171
|
+
signal: r.signal,
|
|
172
|
+
async onopen(i) {
|
|
173
|
+
if (!i.ok && i.status >= 400 && i.status < 500 && i.status !== 429)
|
|
174
|
+
throw new Error(`Client error ${i.status}`);
|
|
175
175
|
},
|
|
176
|
-
onmessage: (
|
|
177
|
-
if (
|
|
178
|
-
const
|
|
179
|
-
this.broadcast(
|
|
176
|
+
onmessage: (i) => {
|
|
177
|
+
if (i.data) {
|
|
178
|
+
const l = ce(i.data);
|
|
179
|
+
this.broadcast(l, n);
|
|
180
180
|
}
|
|
181
181
|
},
|
|
182
|
-
onerror: (
|
|
183
|
-
throw console.error("EventSource error for stream",
|
|
182
|
+
onerror: (i) => {
|
|
183
|
+
throw console.error("EventSource error for stream", n, ":", i), this.broadcastError(n), i;
|
|
184
184
|
},
|
|
185
185
|
onclose() {
|
|
186
186
|
}
|
|
@@ -190,19 +190,19 @@ class ce {
|
|
|
190
190
|
* Subscribe to events from all active streams.
|
|
191
191
|
* Returns an unsubscribe function.
|
|
192
192
|
*/
|
|
193
|
-
subscribe(t,
|
|
194
|
-
return this.subscribers.set(t,
|
|
193
|
+
subscribe(t, n) {
|
|
194
|
+
return this.subscribers.set(t, n), () => {
|
|
195
195
|
this.subscribers.delete(t);
|
|
196
196
|
};
|
|
197
197
|
}
|
|
198
|
-
broadcast(t,
|
|
199
|
-
this.subscribers.forEach((
|
|
200
|
-
|
|
198
|
+
broadcast(t, n) {
|
|
199
|
+
this.subscribers.forEach((r) => {
|
|
200
|
+
r.onMessage(t, n);
|
|
201
201
|
});
|
|
202
202
|
}
|
|
203
203
|
broadcastError(t) {
|
|
204
|
-
this.subscribers.forEach((
|
|
205
|
-
|
|
204
|
+
this.subscribers.forEach((n) => {
|
|
205
|
+
n.onError(t);
|
|
206
206
|
});
|
|
207
207
|
}
|
|
208
208
|
/**
|
|
@@ -214,76 +214,76 @@ class ce {
|
|
|
214
214
|
}
|
|
215
215
|
const de = 12e4, ue = (e) => {
|
|
216
216
|
const t = Date.now();
|
|
217
|
-
return e.filter((
|
|
217
|
+
return e.filter((n) => t - n.createdAt < de);
|
|
218
218
|
};
|
|
219
|
-
function
|
|
220
|
-
const [
|
|
219
|
+
function Le({ fency: e, fetchCreateStreamClientToken: t, children: n }) {
|
|
220
|
+
const [r, c] = k(
|
|
221
221
|
null
|
|
222
|
-
), [u,
|
|
223
|
-
|
|
224
|
-
e.then((
|
|
225
|
-
|
|
226
|
-
}).catch((
|
|
227
|
-
d(
|
|
222
|
+
), [u, i] = k(!0), [l, d] = k(null), [o, a] = k([]), g = E(null), m = E(null);
|
|
223
|
+
w(() => {
|
|
224
|
+
e.then((h) => {
|
|
225
|
+
c(h), i(!1);
|
|
226
|
+
}).catch((h) => {
|
|
227
|
+
d(h), i(!1);
|
|
228
228
|
});
|
|
229
|
-
}, [e]),
|
|
230
|
-
|
|
231
|
-
}, [
|
|
232
|
-
|
|
233
|
-
}, [
|
|
234
|
-
var
|
|
235
|
-
(
|
|
229
|
+
}, [e]), w(() => {
|
|
230
|
+
r && !m.current && (m.current = new le(r));
|
|
231
|
+
}, [r]), w(() => {
|
|
232
|
+
m.current && m.current.updateStreams(o);
|
|
233
|
+
}, [o]), w(() => () => {
|
|
234
|
+
var h;
|
|
235
|
+
(h = m.current) == null || h.cleanup();
|
|
236
236
|
}, []);
|
|
237
|
-
const
|
|
238
|
-
async (
|
|
239
|
-
if (
|
|
240
|
-
return
|
|
241
|
-
const
|
|
242
|
-
if (
|
|
243
|
-
return
|
|
244
|
-
const
|
|
245
|
-
if (!
|
|
237
|
+
const f = L(
|
|
238
|
+
async (h = 3e4) => {
|
|
239
|
+
if (g.current)
|
|
240
|
+
return g.current;
|
|
241
|
+
const S = Date.now(), b = o.length > 0 ? o[o.length - 1] : null;
|
|
242
|
+
if (b && S - b.createdAt < h)
|
|
243
|
+
return b.stream;
|
|
244
|
+
const P = (async () => {
|
|
245
|
+
if (!r)
|
|
246
246
|
throw new Error("Fency instance not initialized");
|
|
247
|
-
const
|
|
248
|
-
pk:
|
|
249
|
-
baseUrl:
|
|
250
|
-
clientToken: (
|
|
247
|
+
const A = await t(), x = await K({
|
|
248
|
+
pk: r.publishableKey,
|
|
249
|
+
baseUrl: r.baseUrl,
|
|
250
|
+
clientToken: (A == null ? void 0 : A.clientToken) ?? ""
|
|
251
251
|
});
|
|
252
|
-
if (
|
|
253
|
-
const
|
|
254
|
-
stream:
|
|
252
|
+
if (x.type === "success") {
|
|
253
|
+
const M = {
|
|
254
|
+
stream: x.stream,
|
|
255
255
|
createdAt: Date.now()
|
|
256
256
|
};
|
|
257
|
-
return
|
|
258
|
-
const
|
|
259
|
-
return ue(
|
|
260
|
-
}),
|
|
257
|
+
return a((I) => {
|
|
258
|
+
const v = [...I, M];
|
|
259
|
+
return ue(v);
|
|
260
|
+
}), g.current = null, x.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 = P, P;
|
|
265
265
|
},
|
|
266
|
-
[
|
|
266
|
+
[r, o]
|
|
267
267
|
);
|
|
268
|
-
if (
|
|
269
|
-
return /* @__PURE__ */
|
|
268
|
+
if (l)
|
|
269
|
+
return /* @__PURE__ */ C("div", { children: [
|
|
270
270
|
"Fency error: ",
|
|
271
|
-
|
|
271
|
+
l.message
|
|
272
272
|
] });
|
|
273
|
-
if (!
|
|
273
|
+
if (!r)
|
|
274
274
|
return null;
|
|
275
|
-
const
|
|
276
|
-
fency:
|
|
275
|
+
const y = o.length > 0 ? o[o.length - 1] : null, p = {
|
|
276
|
+
fency: r,
|
|
277
277
|
loading: u,
|
|
278
|
-
error:
|
|
279
|
-
activeStreams:
|
|
280
|
-
latestStream:
|
|
281
|
-
eventManager:
|
|
282
|
-
getOrCreateStream:
|
|
278
|
+
error: l,
|
|
279
|
+
activeStreams: o,
|
|
280
|
+
latestStream: y,
|
|
281
|
+
eventManager: m.current,
|
|
282
|
+
getOrCreateStream: f
|
|
283
283
|
};
|
|
284
|
-
return /* @__PURE__ */
|
|
284
|
+
return /* @__PURE__ */ s(N.Provider, { value: p, children: n });
|
|
285
285
|
}
|
|
286
|
-
function
|
|
286
|
+
function j() {
|
|
287
287
|
const e = X(N);
|
|
288
288
|
if (e === void 0)
|
|
289
289
|
throw new Error("useFencyContext must be used within a FencyProvider");
|
|
@@ -312,51 +312,30 @@ const me = (e) => {
|
|
|
312
312
|
timestamp: e.timestamp,
|
|
313
313
|
createdAt: e.createdAt,
|
|
314
314
|
data: JSON.parse(e.data)
|
|
315
|
-
}),
|
|
316
|
-
const t =
|
|
317
|
-
return
|
|
315
|
+
}), pe = (e) => {
|
|
316
|
+
const t = j(), [n, r] = k(null), c = E(`subscriber-${Math.random().toString(36).substr(2, 9)}`);
|
|
317
|
+
return w(() => {
|
|
318
318
|
if (!t.eventManager) return;
|
|
319
|
-
const
|
|
320
|
-
onMessage: (d,
|
|
321
|
-
var
|
|
322
|
-
const
|
|
323
|
-
if (
|
|
324
|
-
switch (
|
|
325
|
-
case "NewChatCompletionStreamChunk":
|
|
326
|
-
(y = e == null ? void 0 : e.onNewChatCompletionStreamChunk) == null || y.call(e, o);
|
|
327
|
-
break;
|
|
328
|
-
case "ChatCompletionStreamCompleted":
|
|
329
|
-
(g = e == null ? void 0 : e.onChatCompletionStreamCompleted) == null || g.call(e, o);
|
|
330
|
-
break;
|
|
319
|
+
const i = {
|
|
320
|
+
onMessage: (d, o) => {
|
|
321
|
+
var g, m, f;
|
|
322
|
+
const a = me(d);
|
|
323
|
+
if (a)
|
|
324
|
+
switch (a.type) {
|
|
331
325
|
case "StreamTimeout":
|
|
332
|
-
(
|
|
326
|
+
(g = e == null ? void 0 : e.onStreamTimeout) == null || g.call(e, a);
|
|
333
327
|
break;
|
|
334
328
|
case "StreamNotFound":
|
|
335
|
-
(m = e == null ? void 0 : e.onStreamNotFound) == null || m.call(e,
|
|
336
|
-
break;
|
|
337
|
-
case "FileUploadCompleted":
|
|
338
|
-
(S = e == null ? void 0 : e.onFileUploadCompleted) == null || S.call(e, o);
|
|
339
|
-
break;
|
|
340
|
-
case "FileTextContentReady":
|
|
341
|
-
(f = e == null ? void 0 : e.onFileTextContentReady) == null || f.call(e, o);
|
|
342
|
-
break;
|
|
343
|
-
case "WebsiteHtmlContentReady":
|
|
344
|
-
(b = e == null ? void 0 : e.onWebsiteHtmlContentReady) == null || b.call(e, o);
|
|
345
|
-
break;
|
|
346
|
-
case "WebsiteTextContentReady":
|
|
347
|
-
(C = e == null ? void 0 : e.onWebsiteTextContentReady) == null || C.call(e, o);
|
|
348
|
-
break;
|
|
349
|
-
case "FileSearchIndexReady":
|
|
350
|
-
(p = e == null ? void 0 : e.onFileSearchIndexReady) == null || p.call(e, o);
|
|
329
|
+
(m = e == null ? void 0 : e.onStreamNotFound) == null || m.call(e, a);
|
|
351
330
|
break;
|
|
352
331
|
case "AgentTaskProgressItemUpdated":
|
|
353
|
-
(
|
|
332
|
+
(f = e == null ? void 0 : e.onAgentTaskProgressItemUpdated) == null || f.call(e, a);
|
|
354
333
|
break;
|
|
355
334
|
}
|
|
356
335
|
},
|
|
357
336
|
onError: (d) => {
|
|
358
|
-
var
|
|
359
|
-
(
|
|
337
|
+
var o;
|
|
338
|
+
(o = e == null ? void 0 : e.onStreamError) == null || o.call(e, {
|
|
360
339
|
streamId: d,
|
|
361
340
|
error: {
|
|
362
341
|
code: "UnknownError",
|
|
@@ -366,250 +345,250 @@ const me = (e) => {
|
|
|
366
345
|
}
|
|
367
346
|
};
|
|
368
347
|
return t.eventManager.subscribe(
|
|
369
|
-
|
|
370
|
-
|
|
348
|
+
c.current,
|
|
349
|
+
i
|
|
371
350
|
);
|
|
372
351
|
}, [t.eventManager, e]), {
|
|
373
352
|
createStream: async () => {
|
|
374
353
|
try {
|
|
375
|
-
const
|
|
376
|
-
return
|
|
354
|
+
const i = await t.getOrCreateStream(3e4);
|
|
355
|
+
return r(i), {
|
|
377
356
|
type: "success",
|
|
378
|
-
stream:
|
|
357
|
+
stream: i
|
|
379
358
|
};
|
|
380
|
-
} catch (
|
|
359
|
+
} catch (i) {
|
|
381
360
|
return {
|
|
382
361
|
type: "error",
|
|
383
362
|
error: {
|
|
384
363
|
code: "UnknownError",
|
|
385
|
-
message:
|
|
364
|
+
message: i instanceof Error ? i.message : "Failed to create stream"
|
|
386
365
|
}
|
|
387
366
|
};
|
|
388
367
|
}
|
|
389
368
|
},
|
|
390
|
-
stream:
|
|
369
|
+
stream: n
|
|
391
370
|
};
|
|
392
371
|
}, Ue = (e) => {
|
|
393
|
-
const t =
|
|
394
|
-
onAgentTaskProgressItemUpdated: (
|
|
395
|
-
var
|
|
396
|
-
if (!
|
|
397
|
-
const
|
|
398
|
-
if (
|
|
399
|
-
const
|
|
400
|
-
|
|
372
|
+
const t = j(), [n, r] = k([]), c = E(/* @__PURE__ */ new Set()), u = E(/* @__PURE__ */ new Map()), { createStream: i } = pe({
|
|
373
|
+
onAgentTaskProgressItemUpdated: (o) => {
|
|
374
|
+
var m;
|
|
375
|
+
if (!c.current.has(o.agentTaskId)) return;
|
|
376
|
+
const a = o.data;
|
|
377
|
+
if (a.taskType === "StreamingChatCompletion" && a.eventType === "Completed" || a.taskType === "StructuredChatCompletion" && a.eventType === "Completed" || a.taskType === "MemoryChatCompletion" && a.eventType === "Completed") {
|
|
378
|
+
const f = u.current.get(
|
|
379
|
+
o.agentTaskId
|
|
401
380
|
);
|
|
402
|
-
|
|
381
|
+
f && (u.current.delete(o.agentTaskId), f(a));
|
|
403
382
|
return;
|
|
404
383
|
}
|
|
405
|
-
(
|
|
406
|
-
(
|
|
407
|
-
var
|
|
408
|
-
if (((
|
|
409
|
-
return
|
|
410
|
-
const
|
|
411
|
-
(
|
|
412
|
-
) ?
|
|
413
|
-
(
|
|
414
|
-
) : [...
|
|
415
|
-
return { ...
|
|
384
|
+
(m = e.onAgentTaskProgressItemUpdated) == null || m.call(e, o), r(
|
|
385
|
+
(f) => f.map((y) => {
|
|
386
|
+
var S;
|
|
387
|
+
if (((S = y.confirmedData) == null ? void 0 : S.taskId) !== o.agentTaskId)
|
|
388
|
+
return y;
|
|
389
|
+
const h = y.progressItems.some(
|
|
390
|
+
(b) => b.progressItemId === o.progressItemId
|
|
391
|
+
) ? y.progressItems.map(
|
|
392
|
+
(b) => b.progressItemId === o.progressItemId ? o : b
|
|
393
|
+
) : [...y.progressItems, o];
|
|
394
|
+
return { ...y, progressItems: h };
|
|
416
395
|
})
|
|
417
396
|
);
|
|
418
397
|
},
|
|
419
|
-
onStreamError: (
|
|
420
|
-
var
|
|
421
|
-
(
|
|
422
|
-
const
|
|
423
|
-
return
|
|
424
|
-
...
|
|
398
|
+
onStreamError: (o) => {
|
|
399
|
+
var a;
|
|
400
|
+
(a = e == null ? void 0 : e.onStreamError) == null || a.call(e, o), r((g) => {
|
|
401
|
+
const m = g.find((f) => f.streamId === o.streamId);
|
|
402
|
+
return m ? [
|
|
403
|
+
...g.filter((f) => f.streamId !== o.streamId),
|
|
425
404
|
{
|
|
426
|
-
...
|
|
405
|
+
...m,
|
|
427
406
|
loading: !1,
|
|
428
|
-
error:
|
|
407
|
+
error: o.error
|
|
429
408
|
}
|
|
430
|
-
] :
|
|
409
|
+
] : g;
|
|
431
410
|
});
|
|
432
411
|
},
|
|
433
|
-
onStreamNotFound: (
|
|
434
|
-
var
|
|
435
|
-
(
|
|
412
|
+
onStreamNotFound: (o) => {
|
|
413
|
+
var a;
|
|
414
|
+
(a = e == null ? void 0 : e.onStreamNotFound) == null || a.call(e, o);
|
|
436
415
|
},
|
|
437
|
-
onStreamTimeout: (
|
|
438
|
-
var
|
|
439
|
-
(
|
|
416
|
+
onStreamTimeout: (o) => {
|
|
417
|
+
var a;
|
|
418
|
+
(a = e == null ? void 0 : e.onStreamTimeout) == null || a.call(e, o);
|
|
440
419
|
}
|
|
441
|
-
}),
|
|
442
|
-
async (
|
|
443
|
-
const
|
|
444
|
-
if (
|
|
445
|
-
|
|
446
|
-
...
|
|
420
|
+
}), l = L(
|
|
421
|
+
async (o, a) => {
|
|
422
|
+
const g = `task-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`, m = await i();
|
|
423
|
+
if (m.type === "success") {
|
|
424
|
+
r([
|
|
425
|
+
...n,
|
|
447
426
|
{
|
|
448
|
-
taskKey:
|
|
449
|
-
streamId:
|
|
427
|
+
taskKey: g,
|
|
428
|
+
streamId: m.stream.id,
|
|
450
429
|
triggeredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
451
430
|
confirmedData: null,
|
|
452
431
|
error: null,
|
|
453
|
-
params:
|
|
432
|
+
params: o,
|
|
454
433
|
progressItems: [],
|
|
455
434
|
loading: !0,
|
|
456
435
|
doneStreaming: !1,
|
|
457
|
-
loadingText:
|
|
436
|
+
loadingText: a == null ? void 0 : a.loadingText
|
|
458
437
|
}
|
|
459
438
|
]);
|
|
460
|
-
const { clientToken:
|
|
439
|
+
const { clientToken: f } = await e.fetchCreateAgentTaskClientToken(o.type), y = await q({
|
|
461
440
|
pk: t.fency.publishableKey,
|
|
462
441
|
baseUrl: t.fency.baseUrl,
|
|
463
|
-
clientToken:
|
|
464
|
-
streamToken:
|
|
442
|
+
clientToken: f,
|
|
443
|
+
streamToken: m.stream.token,
|
|
465
444
|
request: {
|
|
466
|
-
streamingChatCompletionTask:
|
|
467
|
-
messages:
|
|
468
|
-
model:
|
|
445
|
+
streamingChatCompletionTask: o.type === "StreamingChatCompletion" ? {
|
|
446
|
+
messages: o.messages,
|
|
447
|
+
model: o.model
|
|
469
448
|
} : void 0,
|
|
470
|
-
structuredChatCompletionTask:
|
|
471
|
-
messages:
|
|
472
|
-
jsonSchema:
|
|
473
|
-
model:
|
|
449
|
+
structuredChatCompletionTask: o.type === "StructuredChatCompletion" ? {
|
|
450
|
+
messages: o.messages,
|
|
451
|
+
jsonSchema: o.jsonSchema,
|
|
452
|
+
model: o.model
|
|
474
453
|
} : void 0,
|
|
475
|
-
|
|
476
|
-
messages:
|
|
477
|
-
model:
|
|
454
|
+
memoryChatCompletionTask: o.type === "MemoryChatCompletion" ? {
|
|
455
|
+
messages: o.messages,
|
|
456
|
+
model: o.model
|
|
478
457
|
} : void 0
|
|
479
458
|
}
|
|
480
459
|
});
|
|
481
|
-
if (
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
),
|
|
485
|
-
...
|
|
460
|
+
if (y.type === "success" && y.agentTask) {
|
|
461
|
+
c.current.add(
|
|
462
|
+
y.agentTask.id
|
|
463
|
+
), r((h) => [
|
|
464
|
+
...h.filter((S) => S.taskKey !== g),
|
|
486
465
|
{
|
|
487
|
-
taskKey:
|
|
488
|
-
streamId:
|
|
466
|
+
taskKey: g,
|
|
467
|
+
streamId: m.stream.id,
|
|
489
468
|
triggeredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
490
|
-
taskId:
|
|
491
|
-
createdAt:
|
|
469
|
+
taskId: y.agentTask.id,
|
|
470
|
+
createdAt: y.agentTask.createdAt,
|
|
492
471
|
error: null,
|
|
493
|
-
params:
|
|
472
|
+
params: o,
|
|
494
473
|
progressItems: [],
|
|
495
474
|
doneStreaming: !1,
|
|
496
475
|
loading: !0,
|
|
497
|
-
loadingText:
|
|
476
|
+
loadingText: a == null ? void 0 : a.loadingText,
|
|
498
477
|
confirmedData: {
|
|
499
|
-
taskId:
|
|
500
|
-
createdAt:
|
|
478
|
+
taskId: y.agentTask.id,
|
|
479
|
+
createdAt: y.agentTask.createdAt
|
|
501
480
|
}
|
|
502
481
|
}
|
|
503
482
|
]);
|
|
504
|
-
const
|
|
483
|
+
const p = await new Promise((h) => {
|
|
505
484
|
u.current.set(
|
|
506
|
-
|
|
507
|
-
|
|
485
|
+
y.agentTask.id,
|
|
486
|
+
h
|
|
508
487
|
);
|
|
509
488
|
});
|
|
510
489
|
return {
|
|
511
490
|
type: "success",
|
|
512
|
-
streamId:
|
|
513
|
-
agentTaskId:
|
|
514
|
-
response:
|
|
491
|
+
streamId: m.stream.id,
|
|
492
|
+
agentTaskId: y.agentTask.id,
|
|
493
|
+
response: p
|
|
515
494
|
};
|
|
516
495
|
} else {
|
|
517
|
-
if (
|
|
518
|
-
return
|
|
519
|
-
...
|
|
496
|
+
if (y.type === "error")
|
|
497
|
+
return r((p) => [
|
|
498
|
+
...p.filter((h) => h.taskKey !== g),
|
|
520
499
|
{
|
|
521
|
-
taskKey:
|
|
500
|
+
taskKey: g,
|
|
522
501
|
triggeredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
523
|
-
streamId:
|
|
524
|
-
params:
|
|
525
|
-
error:
|
|
502
|
+
streamId: m.stream.id,
|
|
503
|
+
params: o,
|
|
504
|
+
error: y.error,
|
|
526
505
|
progressItems: [],
|
|
527
506
|
loading: !1,
|
|
528
507
|
doneStreaming: !1,
|
|
529
|
-
loadingText:
|
|
508
|
+
loadingText: a == null ? void 0 : a.loadingText,
|
|
530
509
|
confirmedData: null
|
|
531
510
|
}
|
|
532
511
|
]), {
|
|
533
512
|
type: "error",
|
|
534
|
-
error:
|
|
513
|
+
error: y.error
|
|
535
514
|
};
|
|
536
515
|
{
|
|
537
|
-
const
|
|
516
|
+
const p = {
|
|
538
517
|
message: "No response received",
|
|
539
518
|
code: "UnknownError"
|
|
540
519
|
};
|
|
541
|
-
return
|
|
542
|
-
...
|
|
520
|
+
return r((h) => [
|
|
521
|
+
...h.filter((S) => S.taskKey !== g),
|
|
543
522
|
{
|
|
544
|
-
taskKey:
|
|
523
|
+
taskKey: g,
|
|
545
524
|
triggeredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
546
|
-
streamId:
|
|
547
|
-
error:
|
|
548
|
-
params:
|
|
525
|
+
streamId: m.stream.id,
|
|
526
|
+
error: p,
|
|
527
|
+
params: o,
|
|
549
528
|
progressItems: [],
|
|
550
529
|
loading: !1,
|
|
551
530
|
doneStreaming: !1,
|
|
552
|
-
loadingText:
|
|
531
|
+
loadingText: a == null ? void 0 : a.loadingText,
|
|
553
532
|
confirmedData: null
|
|
554
533
|
}
|
|
555
534
|
]), {
|
|
556
535
|
type: "error",
|
|
557
|
-
error:
|
|
536
|
+
error: p
|
|
558
537
|
};
|
|
559
538
|
}
|
|
560
539
|
}
|
|
561
540
|
} else
|
|
562
|
-
return console.error(
|
|
541
|
+
return console.error(m.error), m;
|
|
563
542
|
},
|
|
564
|
-
[t,
|
|
543
|
+
[t, n, i]
|
|
565
544
|
), d = U(() => {
|
|
566
|
-
if (
|
|
567
|
-
return [...
|
|
568
|
-
}, [
|
|
569
|
-
return
|
|
570
|
-
|
|
545
|
+
if (n.length !== 0)
|
|
546
|
+
return [...n].sort((o, a) => new Date(a.triggeredAt).getTime() - new Date(o.triggeredAt).getTime())[0];
|
|
547
|
+
}, [n]);
|
|
548
|
+
return w(() => () => {
|
|
549
|
+
c.current.clear(), u.current.clear();
|
|
571
550
|
}, []), {
|
|
572
|
-
agentTasks:
|
|
573
|
-
createAgentTask:
|
|
551
|
+
agentTasks: n,
|
|
552
|
+
createAgentTask: l,
|
|
574
553
|
latest: d
|
|
575
554
|
};
|
|
576
555
|
};
|
|
577
|
-
function
|
|
578
|
-
return e.progressItems.map((t,
|
|
579
|
-
const
|
|
556
|
+
function Se(e) {
|
|
557
|
+
return e.progressItems.map((t, n) => {
|
|
558
|
+
const r = e.progressItems[n + 1], c = r != null;
|
|
580
559
|
let u;
|
|
581
|
-
if (
|
|
582
|
-
const
|
|
583
|
-
u = Math.round((
|
|
560
|
+
if (r != null && r.createdAt) {
|
|
561
|
+
const i = new Date(t.createdAt).getTime(), l = new Date(r.createdAt).getTime();
|
|
562
|
+
u = Math.round((l - i) / 1e3);
|
|
584
563
|
}
|
|
585
564
|
return {
|
|
586
565
|
item: t,
|
|
587
|
-
completed:
|
|
588
|
-
isLatest:
|
|
566
|
+
completed: c,
|
|
567
|
+
isLatest: n === e.progressItems.length - 1,
|
|
589
568
|
durationSeconds: u
|
|
590
569
|
};
|
|
591
570
|
});
|
|
592
571
|
}
|
|
593
|
-
function
|
|
572
|
+
function D({
|
|
594
573
|
text: e,
|
|
595
574
|
duration: t = 2,
|
|
596
|
-
delay:
|
|
597
|
-
repeat:
|
|
598
|
-
repeatDelay:
|
|
575
|
+
delay: n = 0,
|
|
576
|
+
repeat: r = !0,
|
|
577
|
+
repeatDelay: c = 0.5,
|
|
599
578
|
className: u,
|
|
600
|
-
startOnView:
|
|
601
|
-
once:
|
|
579
|
+
startOnView: i = !1,
|
|
580
|
+
once: l = !1,
|
|
602
581
|
inViewMargin: d,
|
|
603
|
-
spread:
|
|
604
|
-
color:
|
|
605
|
-
shimmerColor:
|
|
606
|
-
direction:
|
|
582
|
+
spread: o = 2,
|
|
583
|
+
color: a = "#999",
|
|
584
|
+
shimmerColor: g = "#000",
|
|
585
|
+
direction: m = "fromBottom"
|
|
607
586
|
}) {
|
|
608
|
-
const
|
|
609
|
-
return /* @__PURE__ */
|
|
610
|
-
|
|
587
|
+
const f = E(null), y = Q(f, { once: l, margin: d }), p = U(() => e.length * o, [e, o]), h = !i || y, S = m === "fromBottom" ? "100% center" : "-100% center", b = m === "fromBottom" ? "0% center" : "200% center";
|
|
588
|
+
return /* @__PURE__ */ s(
|
|
589
|
+
T.span,
|
|
611
590
|
{
|
|
612
|
-
ref:
|
|
591
|
+
ref: f,
|
|
613
592
|
className: u,
|
|
614
593
|
style: {
|
|
615
594
|
position: "relative",
|
|
@@ -620,38 +599,38 @@ function F({
|
|
|
620
599
|
color: "transparent",
|
|
621
600
|
WebkitTextFillColor: "transparent",
|
|
622
601
|
backgroundRepeat: "no-repeat, padding-box",
|
|
623
|
-
"--spread": `${
|
|
624
|
-
"--base-color":
|
|
625
|
-
"--shimmer-color":
|
|
602
|
+
"--spread": `${p}px`,
|
|
603
|
+
"--base-color": a,
|
|
604
|
+
"--shimmer-color": g,
|
|
626
605
|
"--shimmer-bg": "linear-gradient(90deg, transparent calc(50% - var(--spread)), var(--shimmer-color), transparent calc(50% + var(--spread)))",
|
|
627
606
|
backgroundImage: "var(--shimmer-bg), linear-gradient(var(--base-color), var(--base-color))"
|
|
628
607
|
},
|
|
629
608
|
initial: {
|
|
630
|
-
backgroundPosition:
|
|
609
|
+
backgroundPosition: S,
|
|
631
610
|
opacity: 0
|
|
632
611
|
},
|
|
633
|
-
animate:
|
|
634
|
-
backgroundPosition:
|
|
612
|
+
animate: h ? {
|
|
613
|
+
backgroundPosition: b,
|
|
635
614
|
opacity: 1
|
|
636
615
|
} : {},
|
|
637
616
|
transition: {
|
|
638
617
|
backgroundPosition: {
|
|
639
|
-
repeat:
|
|
618
|
+
repeat: r ? 1 / 0 : 0,
|
|
640
619
|
duration: t,
|
|
641
|
-
delay:
|
|
642
|
-
repeatDelay:
|
|
620
|
+
delay: n,
|
|
621
|
+
repeatDelay: c,
|
|
643
622
|
ease: "linear"
|
|
644
623
|
},
|
|
645
624
|
opacity: {
|
|
646
625
|
duration: 0.3,
|
|
647
|
-
delay:
|
|
626
|
+
delay: n
|
|
648
627
|
}
|
|
649
628
|
},
|
|
650
629
|
children: e
|
|
651
630
|
}
|
|
652
631
|
);
|
|
653
632
|
}
|
|
654
|
-
function
|
|
633
|
+
function be(e) {
|
|
655
634
|
const t = e.item.data;
|
|
656
635
|
if (t.taskType === "StreamingChatCompletion") {
|
|
657
636
|
if (t.eventType === "Text") return "Streaming...";
|
|
@@ -661,7 +640,7 @@ function Ce(e) {
|
|
|
661
640
|
if (t.eventType === "Json") return "Generating...";
|
|
662
641
|
if (t.eventType === "Completed") return "Completed";
|
|
663
642
|
}
|
|
664
|
-
if (t.taskType === "
|
|
643
|
+
if (t.taskType === "MemoryChatCompletion")
|
|
665
644
|
switch (t.eventType) {
|
|
666
645
|
case "Text":
|
|
667
646
|
return "Streaming...";
|
|
@@ -682,28 +661,28 @@ function Ce(e) {
|
|
|
682
661
|
}
|
|
683
662
|
return "Processing...";
|
|
684
663
|
}
|
|
685
|
-
const
|
|
664
|
+
const ve = ({ progressViewItems: e }) => {
|
|
686
665
|
const t = e[e.length - 1];
|
|
687
666
|
if (!t) return null;
|
|
688
|
-
const
|
|
689
|
-
return /* @__PURE__ */
|
|
690
|
-
|
|
667
|
+
const n = be(t);
|
|
668
|
+
return /* @__PURE__ */ s("div", { className: "simple-mode-container", children: /* @__PURE__ */ s(W, { mode: "wait", children: /* @__PURE__ */ s(
|
|
669
|
+
T.div,
|
|
691
670
|
{
|
|
692
671
|
initial: { opacity: 0, y: 10 },
|
|
693
672
|
animate: { opacity: 1, y: 0 },
|
|
694
673
|
exit: { opacity: 0, y: -10 },
|
|
695
674
|
transition: { duration: 0.3 },
|
|
696
|
-
children: t.completed ? /* @__PURE__ */
|
|
675
|
+
children: t.completed ? /* @__PURE__ */ s(
|
|
697
676
|
"div",
|
|
698
677
|
{
|
|
699
678
|
className: "simple-mode-title",
|
|
700
679
|
style: { color: "#666" },
|
|
701
|
-
children:
|
|
680
|
+
children: n
|
|
702
681
|
}
|
|
703
|
-
) : /* @__PURE__ */
|
|
704
|
-
|
|
682
|
+
) : /* @__PURE__ */ s(
|
|
683
|
+
D,
|
|
705
684
|
{
|
|
706
|
-
text:
|
|
685
|
+
text: n,
|
|
707
686
|
className: "simple-mode-title",
|
|
708
687
|
duration: 2.5,
|
|
709
688
|
repeat: !0,
|
|
@@ -714,7 +693,7 @@ const Te = ({ progressViewItems: e }) => {
|
|
|
714
693
|
},
|
|
715
694
|
t.item.progressItemId
|
|
716
695
|
) }) });
|
|
717
|
-
},
|
|
696
|
+
}, H = {
|
|
718
697
|
'code[class*="language-"]': {
|
|
719
698
|
color: "#f8f8f2",
|
|
720
699
|
background: "none",
|
|
@@ -867,52 +846,52 @@ const Te = ({ progressViewItems: e }) => {
|
|
|
867
846
|
}
|
|
868
847
|
}, z = ({
|
|
869
848
|
text: e
|
|
870
|
-
}) => /* @__PURE__ */
|
|
871
|
-
|
|
849
|
+
}) => /* @__PURE__ */ s("div", { style: { padding: "16px" }, children: /* @__PURE__ */ s(
|
|
850
|
+
T.div,
|
|
872
851
|
{
|
|
873
852
|
className: "fency-markdown-body-raw",
|
|
874
853
|
initial: { opacity: 0, y: -10 },
|
|
875
854
|
animate: { opacity: 1, y: 0 },
|
|
876
855
|
transition: { duration: 0.3, delay: 0 },
|
|
877
|
-
children: /* @__PURE__ */
|
|
856
|
+
children: /* @__PURE__ */ s(
|
|
878
857
|
Y,
|
|
879
858
|
{
|
|
880
859
|
remarkPlugins: [Z],
|
|
881
860
|
components: {
|
|
882
861
|
code(t) {
|
|
883
|
-
const { children:
|
|
884
|
-
return
|
|
862
|
+
const { children: n, className: r, node: c, ref: u, ...i } = t, l = /language-(\w+)/.exec(r || "");
|
|
863
|
+
return l ? /* @__PURE__ */ s(
|
|
885
864
|
$,
|
|
886
865
|
{
|
|
887
|
-
...
|
|
866
|
+
...i,
|
|
888
867
|
PreTag: "div",
|
|
889
|
-
children: String(
|
|
890
|
-
language:
|
|
891
|
-
style:
|
|
868
|
+
children: String(n).replace(/\n$/, ""),
|
|
869
|
+
language: l[1],
|
|
870
|
+
style: H
|
|
892
871
|
}
|
|
893
|
-
) : /* @__PURE__ */
|
|
872
|
+
) : /* @__PURE__ */ s("code", { ...i, className: r, children: String(n) });
|
|
894
873
|
}
|
|
895
874
|
},
|
|
896
875
|
children: e
|
|
897
876
|
}
|
|
898
877
|
)
|
|
899
878
|
}
|
|
900
|
-
) }),
|
|
879
|
+
) }), Te = ({ data: e }) => {
|
|
901
880
|
const t = JSON.stringify(e.json, null, 2);
|
|
902
|
-
return /* @__PURE__ */
|
|
903
|
-
|
|
881
|
+
return /* @__PURE__ */ s("div", { id: "structured-chat-completion-response", children: /* @__PURE__ */ s(
|
|
882
|
+
T.div,
|
|
904
883
|
{
|
|
905
884
|
initial: { opacity: 0, y: -10 },
|
|
906
885
|
animate: { opacity: 1, y: 0 },
|
|
907
886
|
transition: { duration: 0.3, delay: 0 },
|
|
908
|
-
children: /* @__PURE__ */
|
|
887
|
+
children: /* @__PURE__ */ s($, { language: "json", style: H, PreTag: "div", children: t })
|
|
909
888
|
}
|
|
910
889
|
) });
|
|
911
|
-
},
|
|
912
|
-
const
|
|
913
|
-
return /* @__PURE__ */
|
|
914
|
-
/* @__PURE__ */
|
|
915
|
-
|
|
890
|
+
}, Ce = ({ data: e, isLatest: t = !1, durationSeconds: n }) => {
|
|
891
|
+
const r = `Searching: ${e.queryDescription}`;
|
|
892
|
+
return /* @__PURE__ */ C("div", { style: { padding: "16px" }, children: [
|
|
893
|
+
/* @__PURE__ */ s(
|
|
894
|
+
T.div,
|
|
916
895
|
{
|
|
917
896
|
style: {
|
|
918
897
|
display: "flex",
|
|
@@ -923,19 +902,19 @@ const Te = ({ progressViewItems: e }) => {
|
|
|
923
902
|
initial: { opacity: 0, y: -10 },
|
|
924
903
|
animate: { opacity: 1, y: 0 },
|
|
925
904
|
transition: { duration: 0.3, delay: 0 },
|
|
926
|
-
children: t && !
|
|
927
|
-
|
|
905
|
+
children: t && !n ? /* @__PURE__ */ s(
|
|
906
|
+
D,
|
|
928
907
|
{
|
|
929
|
-
text:
|
|
908
|
+
text: r,
|
|
930
909
|
duration: 2.5,
|
|
931
910
|
repeat: !0,
|
|
932
911
|
color: "#999",
|
|
933
912
|
shimmerColor: "#000"
|
|
934
913
|
}
|
|
935
|
-
) : /* @__PURE__ */
|
|
914
|
+
) : /* @__PURE__ */ s("span", { style: { color: "#666" }, children: r })
|
|
936
915
|
}
|
|
937
916
|
),
|
|
938
|
-
|
|
917
|
+
n !== void 0 && /* @__PURE__ */ C(
|
|
939
918
|
"div",
|
|
940
919
|
{
|
|
941
920
|
style: {
|
|
@@ -946,17 +925,17 @@ const Te = ({ progressViewItems: e }) => {
|
|
|
946
925
|
},
|
|
947
926
|
children: [
|
|
948
927
|
"Took ",
|
|
949
|
-
|
|
928
|
+
n,
|
|
950
929
|
" seconds"
|
|
951
930
|
]
|
|
952
931
|
}
|
|
953
932
|
)
|
|
954
933
|
] });
|
|
955
|
-
},
|
|
956
|
-
const
|
|
957
|
-
return /* @__PURE__ */
|
|
958
|
-
/* @__PURE__ */
|
|
959
|
-
|
|
934
|
+
}, ke = ({ isLatest: e = !1, durationSeconds: t }) => {
|
|
935
|
+
const n = "Adding sources...";
|
|
936
|
+
return /* @__PURE__ */ C("div", { style: { padding: "16px" }, children: [
|
|
937
|
+
/* @__PURE__ */ s(
|
|
938
|
+
T.div,
|
|
960
939
|
{
|
|
961
940
|
style: {
|
|
962
941
|
display: "flex",
|
|
@@ -967,19 +946,19 @@ const Te = ({ progressViewItems: e }) => {
|
|
|
967
946
|
initial: { opacity: 0, y: -10 },
|
|
968
947
|
animate: { opacity: 1, y: 0 },
|
|
969
948
|
transition: { duration: 0.3, delay: 0 },
|
|
970
|
-
children: e && !t ? /* @__PURE__ */
|
|
971
|
-
|
|
949
|
+
children: e && !t ? /* @__PURE__ */ s(
|
|
950
|
+
D,
|
|
972
951
|
{
|
|
973
|
-
text:
|
|
952
|
+
text: n,
|
|
974
953
|
duration: 2.5,
|
|
975
954
|
repeat: !0,
|
|
976
955
|
color: "#999",
|
|
977
956
|
shimmerColor: "#000"
|
|
978
957
|
}
|
|
979
|
-
) : /* @__PURE__ */
|
|
958
|
+
) : /* @__PURE__ */ s("span", { style: { color: "#666" }, children: n })
|
|
980
959
|
}
|
|
981
960
|
),
|
|
982
|
-
t !== void 0 && /* @__PURE__ */
|
|
961
|
+
t !== void 0 && /* @__PURE__ */ C(
|
|
983
962
|
"div",
|
|
984
963
|
{
|
|
985
964
|
style: {
|
|
@@ -996,9 +975,9 @@ const Te = ({ progressViewItems: e }) => {
|
|
|
996
975
|
}
|
|
997
976
|
)
|
|
998
977
|
] });
|
|
999
|
-
},
|
|
1000
|
-
/* @__PURE__ */
|
|
1001
|
-
|
|
978
|
+
}, xe = ({ data: e, onSourceClick: t }) => /* @__PURE__ */ C("div", { style: { padding: "16px" }, children: [
|
|
979
|
+
/* @__PURE__ */ s(
|
|
980
|
+
T.div,
|
|
1002
981
|
{
|
|
1003
982
|
style: {
|
|
1004
983
|
marginBottom: "10px",
|
|
@@ -1014,17 +993,17 @@ const Te = ({ progressViewItems: e }) => {
|
|
|
1014
993
|
children: "Sources"
|
|
1015
994
|
}
|
|
1016
995
|
),
|
|
1017
|
-
/* @__PURE__ */
|
|
1018
|
-
|
|
996
|
+
/* @__PURE__ */ s("div", { style: { display: "flex", flexWrap: "wrap", gap: "8px" }, children: e.sources.length === 0 ? /* @__PURE__ */ s("span", { style: { fontSize: "13px", color: "#888" }, children: "No sources" }) : e.sources.map((n, r) => /* @__PURE__ */ s(
|
|
997
|
+
Ee,
|
|
1019
998
|
{
|
|
1020
|
-
source:
|
|
1021
|
-
index:
|
|
999
|
+
source: n,
|
|
1000
|
+
index: r,
|
|
1022
1001
|
onSourceClick: t
|
|
1023
1002
|
},
|
|
1024
|
-
|
|
1003
|
+
n.memoryId
|
|
1025
1004
|
)) })
|
|
1026
1005
|
] });
|
|
1027
|
-
function
|
|
1006
|
+
function we(e) {
|
|
1028
1007
|
if (e.length === 0) return "";
|
|
1029
1008
|
if (e.length === 1) return `page ${e[0]}`;
|
|
1030
1009
|
if (e.length === 2)
|
|
@@ -1032,17 +1011,17 @@ function pe(e) {
|
|
|
1032
1011
|
const t = e[e.length - 1];
|
|
1033
1012
|
return `pages ${e.slice(0, -1).join(", ")} and ${t}`;
|
|
1034
1013
|
}
|
|
1035
|
-
const
|
|
1036
|
-
const [
|
|
1037
|
-
return /* @__PURE__ */
|
|
1038
|
-
|
|
1014
|
+
const Ee = ({ source: e, index: t, onSourceClick: n }) => {
|
|
1015
|
+
const [r, c] = k(!1), u = !!n, i = e.pageNumbers ?? [], l = we(i);
|
|
1016
|
+
return /* @__PURE__ */ C(
|
|
1017
|
+
T.div,
|
|
1039
1018
|
{
|
|
1040
1019
|
initial: { opacity: 0, scale: 0.9 },
|
|
1041
1020
|
animate: { opacity: 1, scale: 1 },
|
|
1042
1021
|
transition: { duration: 0.25, delay: t * 0.05 },
|
|
1043
|
-
onClick: u ? () =>
|
|
1044
|
-
onMouseEnter: u ? () =>
|
|
1045
|
-
onMouseLeave: u ? () =>
|
|
1022
|
+
onClick: u ? () => n(e.memoryId) : void 0,
|
|
1023
|
+
onMouseEnter: u ? () => c(!0) : void 0,
|
|
1024
|
+
onMouseLeave: u ? () => c(!1) : void 0,
|
|
1046
1025
|
style: {
|
|
1047
1026
|
display: "inline-flex",
|
|
1048
1027
|
flexDirection: "column",
|
|
@@ -1050,29 +1029,29 @@ const Ie = ({ source: e, index: t, onSourceClick: r }) => {
|
|
|
1050
1029
|
padding: "8px 12px",
|
|
1051
1030
|
borderRadius: "6px",
|
|
1052
1031
|
border: "1px solid #e0e0e0",
|
|
1053
|
-
backgroundColor:
|
|
1032
|
+
backgroundColor: r ? "#f5f5f5" : "transparent",
|
|
1054
1033
|
cursor: u ? "pointer" : "default",
|
|
1055
1034
|
transition: "background-color 0.15s ease",
|
|
1056
1035
|
userSelect: "none"
|
|
1057
1036
|
},
|
|
1058
1037
|
children: [
|
|
1059
|
-
/* @__PURE__ */
|
|
1060
|
-
|
|
1038
|
+
/* @__PURE__ */ s("span", { style: { fontSize: "13px", fontWeight: 500, color: "#333" }, children: e.memoryTitle }),
|
|
1039
|
+
l && /* @__PURE__ */ s("span", { style: { fontSize: "12px", color: "#666" }, children: l })
|
|
1061
1040
|
]
|
|
1062
1041
|
}
|
|
1063
1042
|
);
|
|
1064
1043
|
};
|
|
1065
|
-
function
|
|
1044
|
+
function Ie({
|
|
1066
1045
|
eventType: e,
|
|
1067
1046
|
completed: t
|
|
1068
1047
|
}) {
|
|
1069
|
-
return e === "ExploreMemoryError" ? /* @__PURE__ */
|
|
1048
|
+
return e === "ExploreMemoryError" ? /* @__PURE__ */ s("span", { style: { color: "#c62828", fontSize: 14, fontWeight: 600 }, children: "✗" }) : e === "ExploreMemoryResult" ? /* @__PURE__ */ s("span", { style: { color: "#999", fontSize: 14, fontWeight: 600 }, children: "✓" }) : e === "ExploreMemoryStart" && t ? /* @__PURE__ */ s("span", { style: { color: "#999", fontSize: 14, fontWeight: 600 }, children: "✓" }) : null;
|
|
1070
1049
|
}
|
|
1071
|
-
const B = 80, Ae = ({ data: e, completed: t, isLatest:
|
|
1072
|
-
const [
|
|
1050
|
+
const B = 80, Ae = ({ data: e, completed: t, isLatest: n = !1 }) => {
|
|
1051
|
+
const [r, c] = k(!1), u = e.eventType === "ExploreMemoryResult" ? e.result : void 0, i = u != null && u.length > B, l = u != null ? r || !i ? u : `${u.slice(0, B)}...` : void 0, d = i;
|
|
1073
1052
|
if (e.eventType === "ExploreMemoryStart" && !t) {
|
|
1074
|
-
const
|
|
1075
|
-
return /* @__PURE__ */
|
|
1053
|
+
const a = `Exploring ${e.memoryTitle}...`;
|
|
1054
|
+
return /* @__PURE__ */ s(
|
|
1076
1055
|
"div",
|
|
1077
1056
|
{
|
|
1078
1057
|
style: {
|
|
@@ -1080,26 +1059,26 @@ const B = 80, Ae = ({ data: e, completed: t, isLatest: r = !1 }) => {
|
|
|
1080
1059
|
display: "flex",
|
|
1081
1060
|
alignItems: "center"
|
|
1082
1061
|
},
|
|
1083
|
-
children:
|
|
1084
|
-
|
|
1062
|
+
children: n ? /* @__PURE__ */ s(
|
|
1063
|
+
D,
|
|
1085
1064
|
{
|
|
1086
|
-
text:
|
|
1065
|
+
text: a,
|
|
1087
1066
|
duration: 2.5,
|
|
1088
1067
|
repeat: !0,
|
|
1089
1068
|
color: "#999",
|
|
1090
1069
|
shimmerColor: "#000"
|
|
1091
1070
|
}
|
|
1092
|
-
) : /* @__PURE__ */
|
|
1071
|
+
) : /* @__PURE__ */ s("span", { style: { fontSize: 13, color: "#999" }, children: a })
|
|
1093
1072
|
}
|
|
1094
1073
|
);
|
|
1095
1074
|
}
|
|
1096
|
-
return /* @__PURE__ */
|
|
1097
|
-
|
|
1075
|
+
return /* @__PURE__ */ s("div", { style: { padding: "16px" }, children: /* @__PURE__ */ C(
|
|
1076
|
+
T.div,
|
|
1098
1077
|
{
|
|
1099
1078
|
initial: { opacity: 0 },
|
|
1100
1079
|
animate: { opacity: 1 },
|
|
1101
1080
|
transition: { duration: 0.25 },
|
|
1102
|
-
onClick: d ? () =>
|
|
1081
|
+
onClick: d ? () => c((a) => !a) : void 0,
|
|
1103
1082
|
style: {
|
|
1104
1083
|
paddingBottom: "12px",
|
|
1105
1084
|
borderBottom: "1px solid #eee",
|
|
@@ -1111,7 +1090,7 @@ const B = 80, Ae = ({ data: e, completed: t, isLatest: r = !1 }) => {
|
|
|
1111
1090
|
cursor: d ? "pointer" : "default"
|
|
1112
1091
|
},
|
|
1113
1092
|
children: [
|
|
1114
|
-
/* @__PURE__ */
|
|
1093
|
+
/* @__PURE__ */ s(
|
|
1115
1094
|
"div",
|
|
1116
1095
|
{
|
|
1117
1096
|
style: {
|
|
@@ -1121,10 +1100,10 @@ const B = 80, Ae = ({ data: e, completed: t, isLatest: r = !1 }) => {
|
|
|
1121
1100
|
flexShrink: 0,
|
|
1122
1101
|
width: 20
|
|
1123
1102
|
},
|
|
1124
|
-
children: /* @__PURE__ */
|
|
1103
|
+
children: /* @__PURE__ */ s(Ie, { eventType: e.eventType, completed: t })
|
|
1125
1104
|
}
|
|
1126
1105
|
),
|
|
1127
|
-
/* @__PURE__ */
|
|
1106
|
+
/* @__PURE__ */ C(
|
|
1128
1107
|
"div",
|
|
1129
1108
|
{
|
|
1130
1109
|
style: {
|
|
@@ -1134,20 +1113,20 @@ const B = 80, Ae = ({ data: e, completed: t, isLatest: r = !1 }) => {
|
|
|
1134
1113
|
minWidth: 0
|
|
1135
1114
|
},
|
|
1136
1115
|
children: [
|
|
1137
|
-
/* @__PURE__ */
|
|
1138
|
-
|
|
1116
|
+
/* @__PURE__ */ s("span", { style: { fontSize: 13, fontWeight: 500, color: "#333" }, children: e.memoryTitle }),
|
|
1117
|
+
l != null && /* @__PURE__ */ s(
|
|
1139
1118
|
"span",
|
|
1140
1119
|
{
|
|
1141
1120
|
style: {
|
|
1142
1121
|
fontSize: 12,
|
|
1143
1122
|
color: "#666",
|
|
1144
1123
|
lineHeight: 1.4,
|
|
1145
|
-
whiteSpace:
|
|
1124
|
+
whiteSpace: r ? "pre-wrap" : void 0
|
|
1146
1125
|
},
|
|
1147
|
-
children:
|
|
1126
|
+
children: l
|
|
1148
1127
|
}
|
|
1149
1128
|
),
|
|
1150
|
-
d && /* @__PURE__ */
|
|
1129
|
+
d && /* @__PURE__ */ s(
|
|
1151
1130
|
"span",
|
|
1152
1131
|
{
|
|
1153
1132
|
style: {
|
|
@@ -1155,7 +1134,7 @@ const B = 80, Ae = ({ data: e, completed: t, isLatest: r = !1 }) => {
|
|
|
1155
1134
|
color: "#999",
|
|
1156
1135
|
marginTop: 2
|
|
1157
1136
|
},
|
|
1158
|
-
children:
|
|
1137
|
+
children: r ? "Click to collapse" : "Click to expand"
|
|
1159
1138
|
}
|
|
1160
1139
|
)
|
|
1161
1140
|
]
|
|
@@ -1167,59 +1146,59 @@ const B = 80, Ae = ({ data: e, completed: t, isLatest: r = !1 }) => {
|
|
|
1167
1146
|
}, Me = ({
|
|
1168
1147
|
progressViewItems: e,
|
|
1169
1148
|
streamToken: t,
|
|
1170
|
-
fetchClientToken:
|
|
1171
|
-
loadingText:
|
|
1172
|
-
onSourceClick:
|
|
1149
|
+
fetchClientToken: n,
|
|
1150
|
+
loadingText: r,
|
|
1151
|
+
onSourceClick: c
|
|
1173
1152
|
}) => {
|
|
1174
|
-
const u =
|
|
1175
|
-
|
|
1153
|
+
const u = E(null);
|
|
1154
|
+
w(() => {
|
|
1176
1155
|
u.current && (u.current.scrollTop = u.current.scrollHeight);
|
|
1177
1156
|
}, [e.length]);
|
|
1178
|
-
const
|
|
1179
|
-
const d =
|
|
1157
|
+
const i = (l) => {
|
|
1158
|
+
const d = l.item.data;
|
|
1180
1159
|
if (d.taskType === "StreamingChatCompletion" && d.eventType === "Text")
|
|
1181
|
-
return /* @__PURE__ */
|
|
1160
|
+
return /* @__PURE__ */ s(z, { text: d.text });
|
|
1182
1161
|
if (d.taskType === "StructuredChatCompletion" && d.eventType === "Json")
|
|
1183
|
-
return /* @__PURE__ */
|
|
1184
|
-
if (d.taskType === "
|
|
1162
|
+
return /* @__PURE__ */ s(Te, { data: d });
|
|
1163
|
+
if (d.taskType === "MemoryChatCompletion")
|
|
1185
1164
|
switch (d.eventType) {
|
|
1186
1165
|
case "Text":
|
|
1187
|
-
return /* @__PURE__ */
|
|
1166
|
+
return /* @__PURE__ */ s(z, { text: d.text });
|
|
1188
1167
|
case "Search":
|
|
1189
|
-
return /* @__PURE__ */
|
|
1190
|
-
|
|
1168
|
+
return /* @__PURE__ */ s(
|
|
1169
|
+
Ce,
|
|
1191
1170
|
{
|
|
1192
1171
|
data: d,
|
|
1193
|
-
isLatest:
|
|
1194
|
-
durationSeconds:
|
|
1172
|
+
isLatest: l.isLatest,
|
|
1173
|
+
durationSeconds: l.durationSeconds
|
|
1195
1174
|
}
|
|
1196
1175
|
);
|
|
1197
1176
|
case "FindSources":
|
|
1198
|
-
return /* @__PURE__ */
|
|
1199
|
-
|
|
1177
|
+
return /* @__PURE__ */ s(
|
|
1178
|
+
ke,
|
|
1200
1179
|
{
|
|
1201
1180
|
data: d,
|
|
1202
|
-
isLatest:
|
|
1203
|
-
durationSeconds:
|
|
1181
|
+
isLatest: l.isLatest,
|
|
1182
|
+
durationSeconds: l.durationSeconds
|
|
1204
1183
|
}
|
|
1205
1184
|
);
|
|
1206
1185
|
case "SourcesResult":
|
|
1207
|
-
return /* @__PURE__ */
|
|
1208
|
-
|
|
1186
|
+
return /* @__PURE__ */ s(
|
|
1187
|
+
xe,
|
|
1209
1188
|
{
|
|
1210
1189
|
data: d,
|
|
1211
|
-
onSourceClick:
|
|
1190
|
+
onSourceClick: c
|
|
1212
1191
|
}
|
|
1213
1192
|
);
|
|
1214
1193
|
case "ExploreMemoryStart":
|
|
1215
1194
|
case "ExploreMemoryResult":
|
|
1216
1195
|
case "ExploreMemoryError":
|
|
1217
|
-
return /* @__PURE__ */
|
|
1196
|
+
return /* @__PURE__ */ s(
|
|
1218
1197
|
Ae,
|
|
1219
1198
|
{
|
|
1220
1199
|
data: d,
|
|
1221
|
-
completed:
|
|
1222
|
-
isLatest:
|
|
1200
|
+
completed: l.completed,
|
|
1201
|
+
isLatest: l.isLatest
|
|
1223
1202
|
}
|
|
1224
1203
|
);
|
|
1225
1204
|
case "Completed":
|
|
@@ -1227,20 +1206,20 @@ const B = 80, Ae = ({ data: e, completed: t, isLatest: r = !1 }) => {
|
|
|
1227
1206
|
}
|
|
1228
1207
|
return d.taskType === "StreamingChatCompletion" && d.eventType === "Completed" || d.taskType === "StructuredChatCompletion" && d.eventType === "Completed", null;
|
|
1229
1208
|
};
|
|
1230
|
-
return e.length === 0 ? /* @__PURE__ */
|
|
1231
|
-
|
|
1209
|
+
return e.length === 0 ? /* @__PURE__ */ s("div", { style: { width: "fit-content" }, children: /* @__PURE__ */ s(
|
|
1210
|
+
D,
|
|
1232
1211
|
{
|
|
1233
|
-
text:
|
|
1212
|
+
text: r ?? "Processing your task...",
|
|
1234
1213
|
duration: 1.5,
|
|
1235
1214
|
repeat: !0,
|
|
1236
1215
|
repeatDelay: 0,
|
|
1237
1216
|
color: "#999",
|
|
1238
1217
|
shimmerColor: "#000"
|
|
1239
1218
|
}
|
|
1240
|
-
) }) : /* @__PURE__ */
|
|
1241
|
-
|
|
1219
|
+
) }) : /* @__PURE__ */ s("div", { id: "agent-task-progress-verbose", ref: u, children: /* @__PURE__ */ s(W, { children: e.map((l, d) => /* @__PURE__ */ s(
|
|
1220
|
+
T.div,
|
|
1242
1221
|
{
|
|
1243
|
-
id: `agent-task-progress-item-${
|
|
1222
|
+
id: `agent-task-progress-item-${l.item.progressItemId}`,
|
|
1244
1223
|
initial: { opacity: 0, y: -20 },
|
|
1245
1224
|
animate: { opacity: 1, y: 0 },
|
|
1246
1225
|
transition: {
|
|
@@ -1248,31 +1227,31 @@ const B = 80, Ae = ({ data: e, completed: t, isLatest: r = !1 }) => {
|
|
|
1248
1227
|
delay: d * 0.1,
|
|
1249
1228
|
ease: "easeOut"
|
|
1250
1229
|
},
|
|
1251
|
-
children:
|
|
1230
|
+
children: i(l)
|
|
1252
1231
|
},
|
|
1253
|
-
|
|
1232
|
+
l.item.progressItemId
|
|
1254
1233
|
)) }) });
|
|
1255
|
-
},
|
|
1234
|
+
}, We = ({
|
|
1256
1235
|
agentTask: e,
|
|
1257
1236
|
mode: t = "verbose",
|
|
1258
|
-
streamToken:
|
|
1259
|
-
fetchClientToken:
|
|
1260
|
-
onSourceClick:
|
|
1237
|
+
streamToken: n,
|
|
1238
|
+
fetchClientToken: r,
|
|
1239
|
+
onSourceClick: c
|
|
1261
1240
|
}) => {
|
|
1262
|
-
const u =
|
|
1263
|
-
return t === "simple" ? /* @__PURE__ */
|
|
1241
|
+
const u = Se(e);
|
|
1242
|
+
return t === "simple" ? /* @__PURE__ */ s(ve, { progressViewItems: u }) : /* @__PURE__ */ s(
|
|
1264
1243
|
Me,
|
|
1265
1244
|
{
|
|
1266
1245
|
progressViewItems: u,
|
|
1267
|
-
streamToken:
|
|
1268
|
-
fetchClientToken:
|
|
1246
|
+
streamToken: n,
|
|
1247
|
+
fetchClientToken: r,
|
|
1269
1248
|
loadingText: e.loadingText,
|
|
1270
|
-
onSourceClick:
|
|
1249
|
+
onSourceClick: c
|
|
1271
1250
|
}
|
|
1272
1251
|
);
|
|
1273
1252
|
};
|
|
1274
1253
|
export {
|
|
1275
|
-
|
|
1276
|
-
|
|
1254
|
+
We as AgentTaskProgress,
|
|
1255
|
+
Le as FencyProvider,
|
|
1277
1256
|
Ue as useAgentTasks
|
|
1278
1257
|
};
|