@fencyai/react 0.1.112 → 0.1.114
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/StreamingChatCompletionResponse.d.ts +8 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +552 -494
- package/dist/provider/FencyProvider.d.ts +1 -1
- package/dist/types/AgentTaskEventData.d.ts +12 -0
- package/dist/types/CreateAgentTaskParams.d.ts +10 -4
- package/dist/types/CreateAgentTaskResponse.d.ts +10 -0
- package/dist/types/FencyContext.d.ts +1 -4
- package/dist/types/FencyProviderProps.d.ts +3 -0
- package/dist/types/UseAgentTasksProps.d.ts +1 -5
- package/dist/types/UseStreamProps.d.ts +0 -4
- package/package.json +4 -4
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { createAgentTask as q, createFileDownloadLink as V, createStream as X } from "@fencyai/js";
|
|
2
|
-
import { createContext as J, useContext as Y, useState as
|
|
3
|
-
import { jsx as
|
|
4
|
-
import { useInView as Q, motion as
|
|
5
|
-
import
|
|
6
|
-
import { Prism as
|
|
7
|
-
import
|
|
2
|
+
import { createContext as J, useContext as Y, useState as T, useRef as A, useEffect as w, useCallback as U, useMemo as L } from "react";
|
|
3
|
+
import { jsx as m, jsxs as P } from "react/jsx-runtime";
|
|
4
|
+
import { useInView as Q, motion as I, AnimatePresence as W } from "motion/react";
|
|
5
|
+
import D from "react-markdown";
|
|
6
|
+
import { Prism as M } from "react-syntax-highlighter";
|
|
7
|
+
import B from "remark-gfm";
|
|
8
8
|
import './assets/index.css';const j = J(
|
|
9
9
|
void 0
|
|
10
10
|
);
|
|
11
|
-
function
|
|
11
|
+
function F() {
|
|
12
12
|
const e = Y(j);
|
|
13
13
|
if (e === void 0)
|
|
14
14
|
throw new Error("useFencyContext must be used within a FencyProvider");
|
|
@@ -50,51 +50,51 @@ const Z = (e) => {
|
|
|
50
50
|
createdAt: e.createdAt,
|
|
51
51
|
data: JSON.parse(e.data)
|
|
52
52
|
}), re = (e) => {
|
|
53
|
-
const t =
|
|
54
|
-
return
|
|
53
|
+
const t = F(), [r, n] = T(null), a = A(`subscriber-${Math.random().toString(36).substr(2, 9)}`);
|
|
54
|
+
return w(() => {
|
|
55
55
|
if (!t.eventManager) return;
|
|
56
56
|
const s = {
|
|
57
|
-
onMessage: (
|
|
58
|
-
var
|
|
59
|
-
const
|
|
60
|
-
if (
|
|
61
|
-
switch (
|
|
57
|
+
onMessage: (g, o) => {
|
|
58
|
+
var d, c, f, y, k, b, h, S, x, C;
|
|
59
|
+
const i = Z(g);
|
|
60
|
+
if (i)
|
|
61
|
+
switch (i.type) {
|
|
62
62
|
case "NewChatCompletionStreamChunk":
|
|
63
|
-
(
|
|
63
|
+
(d = e == null ? void 0 : e.onNewChatCompletionStreamChunk) == null || d.call(e, i);
|
|
64
64
|
break;
|
|
65
65
|
case "ChatCompletionStreamCompleted":
|
|
66
|
-
(
|
|
66
|
+
(c = e == null ? void 0 : e.onChatCompletionStreamCompleted) == null || c.call(e, i);
|
|
67
67
|
break;
|
|
68
68
|
case "StreamTimeout":
|
|
69
|
-
(
|
|
69
|
+
(f = e == null ? void 0 : e.onStreamTimeout) == null || f.call(e, i);
|
|
70
70
|
break;
|
|
71
71
|
case "StreamNotFound":
|
|
72
|
-
(
|
|
72
|
+
(y = e == null ? void 0 : e.onStreamNotFound) == null || y.call(e, i);
|
|
73
73
|
break;
|
|
74
74
|
case "FileUploadCompleted":
|
|
75
|
-
(
|
|
75
|
+
(k = e == null ? void 0 : e.onFileUploadCompleted) == null || k.call(e, i);
|
|
76
76
|
break;
|
|
77
77
|
case "FileTextContentReady":
|
|
78
|
-
(
|
|
78
|
+
(b = e == null ? void 0 : e.onFileTextContentReady) == null || b.call(e, i);
|
|
79
79
|
break;
|
|
80
80
|
case "WebsiteHtmlContentReady":
|
|
81
|
-
(
|
|
81
|
+
(h = e == null ? void 0 : e.onWebsiteHtmlContentReady) == null || h.call(e, i);
|
|
82
82
|
break;
|
|
83
83
|
case "WebsiteTextContentReady":
|
|
84
|
-
(
|
|
84
|
+
(S = e == null ? void 0 : e.onWebsiteTextContentReady) == null || S.call(e, i);
|
|
85
85
|
break;
|
|
86
86
|
case "FileSearchIndexReady":
|
|
87
|
-
(
|
|
87
|
+
(x = e == null ? void 0 : e.onFileSearchIndexReady) == null || x.call(e, i);
|
|
88
88
|
break;
|
|
89
89
|
case "AgentTaskProgressItemUpdated":
|
|
90
|
-
(
|
|
90
|
+
(C = e == null ? void 0 : e.onAgentTaskProgressItemUpdated) == null || C.call(e, i);
|
|
91
91
|
break;
|
|
92
92
|
}
|
|
93
93
|
},
|
|
94
|
-
onError: (
|
|
95
|
-
var
|
|
96
|
-
(
|
|
97
|
-
streamId:
|
|
94
|
+
onError: (g) => {
|
|
95
|
+
var o;
|
|
96
|
+
(o = e == null ? void 0 : e.onStreamError) == null || o.call(e, {
|
|
97
|
+
streamId: g,
|
|
98
98
|
error: {
|
|
99
99
|
code: "UnknownError",
|
|
100
100
|
message: "Unknown error in useStream"
|
|
@@ -109,8 +109,8 @@ const Z = (e) => {
|
|
|
109
109
|
}, [t.eventManager, e]), {
|
|
110
110
|
createStream: async () => {
|
|
111
111
|
try {
|
|
112
|
-
const s = await t.getOrCreateStream(
|
|
113
|
-
return
|
|
112
|
+
const s = await t.getOrCreateStream(3e4);
|
|
113
|
+
return n(s), {
|
|
114
114
|
type: "success",
|
|
115
115
|
stream: s
|
|
116
116
|
};
|
|
@@ -124,71 +124,61 @@ const Z = (e) => {
|
|
|
124
124
|
};
|
|
125
125
|
}
|
|
126
126
|
},
|
|
127
|
-
stream:
|
|
127
|
+
stream: r
|
|
128
128
|
};
|
|
129
|
-
},
|
|
130
|
-
const t =
|
|
131
|
-
fetchTokens: e.fetchCreateStreamTokens,
|
|
129
|
+
}, Re = (e) => {
|
|
130
|
+
const t = F(), [r, n] = T([]), a = A(/* @__PURE__ */ new Set()), u = A(/* @__PURE__ */ new Map()), { createStream: s } = re({
|
|
132
131
|
onAgentTaskProgressItemUpdated: (o) => {
|
|
133
132
|
var c;
|
|
134
|
-
a.current.has(o.agentTaskId)
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
);
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
...
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
{
|
|
153
|
-
...i,
|
|
154
|
-
progressItems: [
|
|
155
|
-
...i.progressItems,
|
|
156
|
-
o
|
|
157
|
-
]
|
|
158
|
-
}
|
|
159
|
-
] : l;
|
|
160
|
-
}));
|
|
133
|
+
if (!a.current.has(o.agentTaskId)) return;
|
|
134
|
+
const i = o.data;
|
|
135
|
+
if (i.type === "GenericAgentTaskCompleted" || i.type === "StreamingChatCompletionCompleted") {
|
|
136
|
+
const f = u.current.get(o.agentTaskId);
|
|
137
|
+
f && (u.current.delete(o.agentTaskId), f(i));
|
|
138
|
+
return;
|
|
139
|
+
}
|
|
140
|
+
(c = e.onAgentTaskProgressItemUpdated) == null || c.call(e, o), n(
|
|
141
|
+
(f) => f.map((y) => {
|
|
142
|
+
if (y.streamId !== o.streamId) return y;
|
|
143
|
+
const b = y.progressItems.some(
|
|
144
|
+
(h) => h.progressItemId === o.progressItemId
|
|
145
|
+
) ? y.progressItems.map(
|
|
146
|
+
(h) => h.progressItemId === o.progressItemId ? o : h
|
|
147
|
+
) : [...y.progressItems, o];
|
|
148
|
+
return { ...y, progressItems: b };
|
|
149
|
+
})
|
|
150
|
+
);
|
|
161
151
|
},
|
|
162
152
|
onStreamError: (o) => {
|
|
163
|
-
var
|
|
164
|
-
(
|
|
165
|
-
const
|
|
166
|
-
return
|
|
167
|
-
...
|
|
153
|
+
var i;
|
|
154
|
+
(i = e == null ? void 0 : e.onStreamError) == null || i.call(e, o), n((d) => {
|
|
155
|
+
const c = d.find((f) => f.streamId === o.streamId);
|
|
156
|
+
return c ? [
|
|
157
|
+
...d.filter((f) => f.streamId !== o.streamId),
|
|
168
158
|
{
|
|
169
|
-
...
|
|
159
|
+
...c,
|
|
170
160
|
loading: !1,
|
|
171
161
|
error: o.error
|
|
172
162
|
}
|
|
173
|
-
] :
|
|
163
|
+
] : d;
|
|
174
164
|
});
|
|
175
165
|
},
|
|
176
166
|
onStreamNotFound: (o) => {
|
|
177
|
-
var
|
|
178
|
-
(
|
|
167
|
+
var i;
|
|
168
|
+
(i = e == null ? void 0 : e.onStreamNotFound) == null || i.call(e, o);
|
|
179
169
|
},
|
|
180
170
|
onStreamTimeout: (o) => {
|
|
181
|
-
var
|
|
182
|
-
(
|
|
171
|
+
var i;
|
|
172
|
+
(i = e == null ? void 0 : e.onStreamTimeout) == null || i.call(e, o);
|
|
183
173
|
}
|
|
184
|
-
}),
|
|
174
|
+
}), l = U(
|
|
185
175
|
async (o) => {
|
|
186
|
-
const
|
|
187
|
-
if (
|
|
188
|
-
|
|
189
|
-
...
|
|
176
|
+
const i = await s();
|
|
177
|
+
if (i.type === "success") {
|
|
178
|
+
n([
|
|
179
|
+
...r,
|
|
190
180
|
{
|
|
191
|
-
streamId:
|
|
181
|
+
streamId: i.stream.id,
|
|
192
182
|
triggeredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
193
183
|
confirmedData: null,
|
|
194
184
|
error: null,
|
|
@@ -198,164 +188,179 @@ const Z = (e) => {
|
|
|
198
188
|
doneStreaming: !1
|
|
199
189
|
}
|
|
200
190
|
]);
|
|
201
|
-
const { clientToken:
|
|
191
|
+
const { clientToken: d } = await e.fetchCreateAgentTaskClientToken(o.type), c = await q({
|
|
202
192
|
pk: t.fency.publishableKey,
|
|
203
193
|
baseUrl: t.fency.baseUrl,
|
|
204
|
-
clientToken:
|
|
205
|
-
streamToken:
|
|
194
|
+
clientToken: d,
|
|
195
|
+
streamToken: i.stream.token,
|
|
206
196
|
request: {
|
|
207
|
-
genericTask: {
|
|
208
|
-
|
|
209
|
-
jsonSchema: o.jsonSchema
|
|
210
|
-
}
|
|
197
|
+
genericTask: o.type === "genericAgentTask" ? { query: o.query, jsonSchema: o.jsonSchema } : void 0,
|
|
198
|
+
streamingChatCompletionTask: o.type === "streamingChatCompletion" ? { messages: o.messages } : void 0
|
|
211
199
|
}
|
|
212
200
|
});
|
|
213
|
-
if (
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
201
|
+
if (c.type === "success" && c.agentTask) {
|
|
202
|
+
a.current.add(
|
|
203
|
+
c.agentTask.id
|
|
204
|
+
), n((y) => [
|
|
205
|
+
...y.filter(
|
|
206
|
+
(k) => k.streamId !== i.stream.id
|
|
217
207
|
),
|
|
218
208
|
{
|
|
219
|
-
streamId:
|
|
209
|
+
streamId: i.stream.id,
|
|
220
210
|
triggeredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
221
|
-
taskId:
|
|
222
|
-
createdAt:
|
|
211
|
+
taskId: c.agentTask.id,
|
|
212
|
+
createdAt: c.agentTask.createdAt,
|
|
223
213
|
error: null,
|
|
224
214
|
params: o,
|
|
225
215
|
progressItems: [],
|
|
226
216
|
doneStreaming: !1,
|
|
227
217
|
loading: !0,
|
|
228
218
|
confirmedData: {
|
|
229
|
-
taskId:
|
|
230
|
-
createdAt:
|
|
219
|
+
taskId: c.agentTask.id,
|
|
220
|
+
createdAt: c.agentTask.createdAt
|
|
231
221
|
}
|
|
232
222
|
}
|
|
233
|
-
])
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
...u.filter(
|
|
241
|
-
(m) => m.streamId !== c.stream.id
|
|
242
|
-
),
|
|
243
|
-
{
|
|
244
|
-
triggeredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
245
|
-
streamId: c.stream.id,
|
|
246
|
-
params: o,
|
|
247
|
-
error: i.error,
|
|
248
|
-
progressItems: [],
|
|
249
|
-
loading: !1,
|
|
250
|
-
doneStreaming: !1,
|
|
251
|
-
confirmedData: null
|
|
223
|
+
]);
|
|
224
|
+
const f = await new Promise(
|
|
225
|
+
(y) => {
|
|
226
|
+
u.current.set(
|
|
227
|
+
c.agentTask.id,
|
|
228
|
+
y
|
|
229
|
+
);
|
|
252
230
|
}
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
message: "No response received",
|
|
260
|
-
code: "UnknownError"
|
|
261
|
-
};
|
|
262
|
-
return r((m) => [
|
|
263
|
-
...m.filter(
|
|
264
|
-
(b) => b.streamId !== c.stream.id
|
|
265
|
-
),
|
|
266
|
-
{
|
|
267
|
-
triggeredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
268
|
-
streamId: c.stream.id,
|
|
269
|
-
error: u,
|
|
270
|
-
params: o,
|
|
271
|
-
progressItems: [],
|
|
272
|
-
loading: !1,
|
|
273
|
-
doneStreaming: !1,
|
|
274
|
-
confirmedData: null
|
|
275
|
-
}
|
|
276
|
-
]), {
|
|
277
|
-
type: "error",
|
|
278
|
-
error: u
|
|
231
|
+
);
|
|
232
|
+
return {
|
|
233
|
+
type: "success",
|
|
234
|
+
streamId: i.stream.id,
|
|
235
|
+
agentTaskId: c.agentTask.id,
|
|
236
|
+
response: f
|
|
279
237
|
};
|
|
238
|
+
} else {
|
|
239
|
+
if (c.type === "error")
|
|
240
|
+
return n((f) => [
|
|
241
|
+
...f.filter(
|
|
242
|
+
(y) => y.streamId !== i.stream.id
|
|
243
|
+
),
|
|
244
|
+
{
|
|
245
|
+
triggeredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
246
|
+
streamId: i.stream.id,
|
|
247
|
+
params: o,
|
|
248
|
+
error: c.error,
|
|
249
|
+
progressItems: [],
|
|
250
|
+
loading: !1,
|
|
251
|
+
doneStreaming: !1,
|
|
252
|
+
confirmedData: null
|
|
253
|
+
}
|
|
254
|
+
]), {
|
|
255
|
+
type: "error",
|
|
256
|
+
error: c.error
|
|
257
|
+
};
|
|
258
|
+
{
|
|
259
|
+
const f = {
|
|
260
|
+
message: "No response received",
|
|
261
|
+
code: "UnknownError"
|
|
262
|
+
};
|
|
263
|
+
return n((y) => [
|
|
264
|
+
...y.filter(
|
|
265
|
+
(k) => k.streamId !== i.stream.id
|
|
266
|
+
),
|
|
267
|
+
{
|
|
268
|
+
triggeredAt: (/* @__PURE__ */ new Date()).toISOString(),
|
|
269
|
+
streamId: i.stream.id,
|
|
270
|
+
error: f,
|
|
271
|
+
params: o,
|
|
272
|
+
progressItems: [],
|
|
273
|
+
loading: !1,
|
|
274
|
+
doneStreaming: !1,
|
|
275
|
+
confirmedData: null
|
|
276
|
+
}
|
|
277
|
+
]), {
|
|
278
|
+
type: "error",
|
|
279
|
+
error: f
|
|
280
|
+
};
|
|
281
|
+
}
|
|
280
282
|
}
|
|
281
283
|
} else
|
|
282
|
-
return console.error(
|
|
284
|
+
return console.error(i.error), i;
|
|
283
285
|
},
|
|
284
|
-
[t,
|
|
285
|
-
),
|
|
286
|
-
|
|
287
|
-
|
|
286
|
+
[t, r, s]
|
|
287
|
+
), g = L(() => {
|
|
288
|
+
if (r.length !== 0)
|
|
289
|
+
return [...r].sort((o, i) => new Date(i.triggeredAt).getTime() - new Date(o.triggeredAt).getTime())[0];
|
|
290
|
+
}, [r]);
|
|
291
|
+
return w(() => () => {
|
|
292
|
+
a.current.clear(), u.current.clear();
|
|
288
293
|
}, []), {
|
|
289
|
-
agentTasks:
|
|
290
|
-
createAgentTask:
|
|
291
|
-
latest:
|
|
294
|
+
agentTasks: r,
|
|
295
|
+
createAgentTask: l,
|
|
296
|
+
latest: g
|
|
292
297
|
};
|
|
293
298
|
};
|
|
294
299
|
async function ae(e, t) {
|
|
295
|
-
const
|
|
296
|
-
let
|
|
297
|
-
for (; !(
|
|
298
|
-
t(
|
|
300
|
+
const r = e.getReader();
|
|
301
|
+
let n;
|
|
302
|
+
for (; !(n = await r.read()).done; )
|
|
303
|
+
t(n.value);
|
|
299
304
|
}
|
|
300
305
|
function oe(e) {
|
|
301
|
-
let t,
|
|
306
|
+
let t, r, n, a = !1;
|
|
302
307
|
return function(s) {
|
|
303
|
-
t === void 0 ? (t = s,
|
|
304
|
-
const
|
|
305
|
-
let
|
|
306
|
-
for (;
|
|
307
|
-
a && (t[
|
|
308
|
-
let
|
|
309
|
-
for (;
|
|
310
|
-
switch (t[
|
|
308
|
+
t === void 0 ? (t = s, r = 0, n = -1) : t = se(t, s);
|
|
309
|
+
const l = t.length;
|
|
310
|
+
let g = 0;
|
|
311
|
+
for (; r < l; ) {
|
|
312
|
+
a && (t[r] === 10 && (g = ++r), a = !1);
|
|
313
|
+
let o = -1;
|
|
314
|
+
for (; r < l && o === -1; ++r)
|
|
315
|
+
switch (t[r]) {
|
|
311
316
|
case 58:
|
|
312
|
-
|
|
317
|
+
n === -1 && (n = r - g);
|
|
313
318
|
break;
|
|
314
319
|
case 13:
|
|
315
320
|
a = !0;
|
|
316
321
|
case 10:
|
|
317
|
-
|
|
322
|
+
o = r;
|
|
318
323
|
break;
|
|
319
324
|
}
|
|
320
|
-
if (
|
|
325
|
+
if (o === -1)
|
|
321
326
|
break;
|
|
322
|
-
e(t.subarray(
|
|
327
|
+
e(t.subarray(g, o), n), g = r, n = -1;
|
|
323
328
|
}
|
|
324
|
-
|
|
329
|
+
g === l ? t = void 0 : g !== 0 && (t = t.subarray(g), r -= g);
|
|
325
330
|
};
|
|
326
331
|
}
|
|
327
|
-
function ie(e, t,
|
|
328
|
-
let
|
|
332
|
+
function ie(e, t, r) {
|
|
333
|
+
let n = z();
|
|
329
334
|
const a = new TextDecoder();
|
|
330
|
-
return function(s,
|
|
335
|
+
return function(s, l) {
|
|
331
336
|
if (s.length === 0)
|
|
332
|
-
|
|
333
|
-
else if (
|
|
334
|
-
const
|
|
335
|
-
switch (
|
|
337
|
+
r == null || r(n), n = z();
|
|
338
|
+
else if (l > 0) {
|
|
339
|
+
const g = a.decode(s.subarray(0, l)), o = l + (s[l + 1] === 32 ? 2 : 1), i = a.decode(s.subarray(o));
|
|
340
|
+
switch (g) {
|
|
336
341
|
case "data":
|
|
337
|
-
|
|
338
|
-
` +
|
|
342
|
+
n.data = n.data ? n.data + `
|
|
343
|
+
` + i : i;
|
|
339
344
|
break;
|
|
340
345
|
case "event":
|
|
341
|
-
|
|
346
|
+
n.event = i;
|
|
342
347
|
break;
|
|
343
348
|
case "id":
|
|
344
|
-
e(
|
|
349
|
+
e(n.id = i);
|
|
345
350
|
break;
|
|
346
351
|
case "retry":
|
|
347
|
-
const
|
|
348
|
-
isNaN(
|
|
352
|
+
const d = parseInt(i, 10);
|
|
353
|
+
isNaN(d) || t(n.retry = d);
|
|
349
354
|
break;
|
|
350
355
|
}
|
|
351
356
|
}
|
|
352
357
|
};
|
|
353
358
|
}
|
|
354
359
|
function se(e, t) {
|
|
355
|
-
const
|
|
356
|
-
return
|
|
360
|
+
const r = new Uint8Array(e.length + t.length);
|
|
361
|
+
return r.set(e), r.set(t, e.length), r;
|
|
357
362
|
}
|
|
358
|
-
function
|
|
363
|
+
function z() {
|
|
359
364
|
return {
|
|
360
365
|
data: "",
|
|
361
366
|
event: "",
|
|
@@ -364,53 +369,53 @@ function D() {
|
|
|
364
369
|
};
|
|
365
370
|
}
|
|
366
371
|
var ce = function(e, t) {
|
|
367
|
-
var
|
|
368
|
-
for (var
|
|
372
|
+
var r = {};
|
|
373
|
+
for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (r[n] = e[n]);
|
|
369
374
|
if (e != null && typeof Object.getOwnPropertySymbols == "function")
|
|
370
|
-
for (var a = 0,
|
|
371
|
-
t.indexOf(
|
|
372
|
-
return
|
|
375
|
+
for (var a = 0, n = Object.getOwnPropertySymbols(e); a < n.length; a++)
|
|
376
|
+
t.indexOf(n[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[a]) && (r[n[a]] = e[n[a]]);
|
|
377
|
+
return r;
|
|
373
378
|
};
|
|
374
|
-
const O = "text/event-stream", le = 1e3,
|
|
375
|
-
function
|
|
376
|
-
var { signal:
|
|
377
|
-
return new Promise((
|
|
378
|
-
const
|
|
379
|
-
|
|
380
|
-
let
|
|
381
|
-
function h() {
|
|
382
|
-
b.abort(), document.hidden || x();
|
|
383
|
-
}
|
|
384
|
-
o || document.addEventListener("visibilitychange", h);
|
|
385
|
-
let w = le, y = 0;
|
|
379
|
+
const O = "text/event-stream", le = 1e3, H = "last-event-id";
|
|
380
|
+
function $(e, t) {
|
|
381
|
+
var { signal: r, headers: n, onopen: a, onmessage: u, onclose: s, onerror: l, openWhenHidden: g, fetch: o } = t, i = ce(t, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
|
|
382
|
+
return new Promise((d, c) => {
|
|
383
|
+
const f = Object.assign({}, n);
|
|
384
|
+
f.accept || (f.accept = O);
|
|
385
|
+
let y;
|
|
386
386
|
function k() {
|
|
387
|
-
|
|
387
|
+
y.abort(), document.hidden || E();
|
|
388
388
|
}
|
|
389
|
-
|
|
390
|
-
|
|
389
|
+
g || document.addEventListener("visibilitychange", k);
|
|
390
|
+
let b = le, h = 0;
|
|
391
|
+
function S() {
|
|
392
|
+
document.removeEventListener("visibilitychange", k), window.clearTimeout(h), y.abort();
|
|
393
|
+
}
|
|
394
|
+
r == null || r.addEventListener("abort", () => {
|
|
395
|
+
S(), d();
|
|
391
396
|
});
|
|
392
|
-
const
|
|
393
|
-
async function
|
|
397
|
+
const x = o ?? window.fetch, C = a ?? de;
|
|
398
|
+
async function E() {
|
|
394
399
|
var N;
|
|
395
|
-
|
|
400
|
+
y = new AbortController();
|
|
396
401
|
try {
|
|
397
|
-
const
|
|
398
|
-
await
|
|
399
|
-
|
|
400
|
-
}, (
|
|
401
|
-
|
|
402
|
-
},
|
|
403
|
-
} catch (
|
|
404
|
-
if (!
|
|
402
|
+
const R = await x(e, Object.assign(Object.assign({}, i), { headers: f, signal: y.signal }));
|
|
403
|
+
await C(R), await ae(R.body, oe(ie((v) => {
|
|
404
|
+
v ? f[H] = v : delete f[H];
|
|
405
|
+
}, (v) => {
|
|
406
|
+
b = v;
|
|
407
|
+
}, u))), s == null || s(), S(), d();
|
|
408
|
+
} catch (R) {
|
|
409
|
+
if (!y.signal.aborted)
|
|
405
410
|
try {
|
|
406
|
-
const
|
|
407
|
-
window.clearTimeout(
|
|
408
|
-
} catch (
|
|
409
|
-
|
|
411
|
+
const v = (N = l == null ? void 0 : l(R)) !== null && N !== void 0 ? N : b;
|
|
412
|
+
window.clearTimeout(h), h = window.setTimeout(E, v);
|
|
413
|
+
} catch (v) {
|
|
414
|
+
S(), c(v);
|
|
410
415
|
}
|
|
411
416
|
}
|
|
412
417
|
}
|
|
413
|
-
|
|
418
|
+
E();
|
|
414
419
|
});
|
|
415
420
|
}
|
|
416
421
|
function de(e) {
|
|
@@ -418,15 +423,15 @@ function de(e) {
|
|
|
418
423
|
if (!(t != null && t.startsWith(O)))
|
|
419
424
|
throw new Error(`Expected content-type to be ${O}, Actual: ${t}`);
|
|
420
425
|
}
|
|
421
|
-
function
|
|
422
|
-
const [t,
|
|
423
|
-
return
|
|
426
|
+
function Ne(e) {
|
|
427
|
+
const [t, r] = T(null);
|
|
428
|
+
return w(() => {
|
|
424
429
|
if (!t)
|
|
425
430
|
return;
|
|
426
|
-
const
|
|
427
|
-
return
|
|
431
|
+
const n = new AbortController();
|
|
432
|
+
return $(t, {
|
|
428
433
|
headers: e == null ? void 0 : e.headers,
|
|
429
|
-
signal:
|
|
434
|
+
signal: n.signal,
|
|
430
435
|
async onopen(a) {
|
|
431
436
|
if (!a.ok && a.status >= 400 && a.status < 500 && a.status !== 429)
|
|
432
437
|
throw new Error(`Client error ${a.status}`);
|
|
@@ -434,74 +439,74 @@ function Fe(e) {
|
|
|
434
439
|
onmessage(a) {
|
|
435
440
|
a.data && (e == null || e.onMessage({
|
|
436
441
|
url: t,
|
|
437
|
-
data:
|
|
442
|
+
data: K(a.data)
|
|
438
443
|
}));
|
|
439
444
|
},
|
|
440
445
|
onerror(a) {
|
|
441
|
-
throw console.error("EventSource error:", a), e == null || e.onError(t),
|
|
446
|
+
throw console.error("EventSource error:", a), e == null || e.onError(t), r(null), a;
|
|
442
447
|
},
|
|
443
448
|
onclose() {
|
|
444
449
|
}
|
|
445
450
|
}), () => {
|
|
446
|
-
|
|
451
|
+
n.abort();
|
|
447
452
|
};
|
|
448
453
|
}, [t, e == null ? void 0 : e.headers]), {
|
|
449
|
-
setSourceUrl:
|
|
454
|
+
setSourceUrl: r,
|
|
450
455
|
sourceUrl: t
|
|
451
456
|
};
|
|
452
457
|
}
|
|
453
|
-
function
|
|
454
|
-
const t = atob(e),
|
|
455
|
-
for (let
|
|
456
|
-
n
|
|
457
|
-
return new TextDecoder("utf-8").decode(
|
|
458
|
+
function K(e) {
|
|
459
|
+
const t = atob(e), r = new Uint8Array(t.length);
|
|
460
|
+
for (let n = 0; n < t.length; n++)
|
|
461
|
+
r[n] = t.charCodeAt(n);
|
|
462
|
+
return new TextDecoder("utf-8").decode(r);
|
|
458
463
|
}
|
|
459
|
-
function
|
|
460
|
-
const [
|
|
464
|
+
function Fe(e, t) {
|
|
465
|
+
const [r, n] = T(
|
|
461
466
|
null
|
|
462
|
-
), [a,
|
|
467
|
+
), [a, u] = T(
|
|
463
468
|
null
|
|
464
|
-
), s =
|
|
465
|
-
const
|
|
469
|
+
), s = F(), l = async (d) => {
|
|
470
|
+
const c = await d.fetchTokens(), { fetchTokens: f, nextPageToken: y, previousPageToken: k, ...b } = d, h = await e({
|
|
466
471
|
pk: s.fency.publishableKey,
|
|
467
|
-
clientToken:
|
|
468
|
-
streamToken:
|
|
472
|
+
clientToken: c.clientToken,
|
|
473
|
+
streamToken: c.streamToken,
|
|
469
474
|
request: {
|
|
470
|
-
...
|
|
475
|
+
...b,
|
|
471
476
|
limit: (t == null ? void 0 : t.pageSize) ?? 50,
|
|
472
477
|
pagination: {
|
|
473
|
-
nextPageToken:
|
|
474
|
-
previousPageToken:
|
|
478
|
+
nextPageToken: y,
|
|
479
|
+
previousPageToken: k
|
|
475
480
|
}
|
|
476
481
|
},
|
|
477
482
|
baseUrl: s.fency.baseUrl
|
|
478
483
|
});
|
|
479
|
-
return
|
|
484
|
+
return h.type === "success" && h.items && h.pagination ? {
|
|
480
485
|
type: "success",
|
|
481
486
|
page: {
|
|
482
|
-
items:
|
|
483
|
-
hasNextPage:
|
|
484
|
-
hasPreviousPage:
|
|
485
|
-
pagination:
|
|
487
|
+
items: h.items,
|
|
488
|
+
hasNextPage: h.pagination.nextPageToken != null,
|
|
489
|
+
hasPreviousPage: h.pagination.previousPageToken != null,
|
|
490
|
+
pagination: h.pagination
|
|
486
491
|
}
|
|
487
492
|
} : {
|
|
488
493
|
type: "error",
|
|
489
|
-
error:
|
|
494
|
+
error: h.error ?? {
|
|
490
495
|
code: "UNKNOWN_ERROR",
|
|
491
496
|
message: "An unknown error occurred"
|
|
492
497
|
}
|
|
493
498
|
};
|
|
494
499
|
};
|
|
495
500
|
return {
|
|
496
|
-
fetchFirstPage: async (
|
|
497
|
-
const
|
|
498
|
-
...
|
|
501
|
+
fetchFirstPage: async (d) => {
|
|
502
|
+
const c = await l({
|
|
503
|
+
...d,
|
|
499
504
|
nextPageToken: void 0,
|
|
500
505
|
previousPageToken: void 0
|
|
501
506
|
});
|
|
502
|
-
return
|
|
507
|
+
return c.type === "success" && (u(c.page), n(d)), c;
|
|
503
508
|
},
|
|
504
|
-
fetchNextPage: async (
|
|
509
|
+
fetchNextPage: async (d) => {
|
|
505
510
|
if (a == null)
|
|
506
511
|
return {
|
|
507
512
|
type: "error",
|
|
@@ -518,14 +523,14 @@ function Ne(e, t) {
|
|
|
518
523
|
message: "No next page"
|
|
519
524
|
}
|
|
520
525
|
};
|
|
521
|
-
const
|
|
522
|
-
...
|
|
526
|
+
const c = await l({
|
|
527
|
+
...d,
|
|
523
528
|
nextPageToken: a.pagination.nextPageToken,
|
|
524
529
|
previousPageToken: void 0
|
|
525
530
|
});
|
|
526
|
-
return
|
|
531
|
+
return c.type === "success" && (u(c.page), n(d)), c;
|
|
527
532
|
},
|
|
528
|
-
fetchPreviousPage: async (
|
|
533
|
+
fetchPreviousPage: async (d) => {
|
|
529
534
|
if (a == null)
|
|
530
535
|
return {
|
|
531
536
|
type: "error",
|
|
@@ -542,60 +547,60 @@ function Ne(e, t) {
|
|
|
542
547
|
message: "No previous page"
|
|
543
548
|
}
|
|
544
549
|
};
|
|
545
|
-
const
|
|
546
|
-
...
|
|
550
|
+
const c = await l({
|
|
551
|
+
...d,
|
|
547
552
|
nextPageToken: void 0,
|
|
548
553
|
previousPageToken: a.pagination.previousPageToken
|
|
549
554
|
});
|
|
550
|
-
return
|
|
555
|
+
return c.type === "success" && (u(c.page), n(d)), c;
|
|
551
556
|
},
|
|
552
|
-
refetchCurrentPage: async () =>
|
|
557
|
+
refetchCurrentPage: async () => r == null ? {
|
|
553
558
|
type: "error",
|
|
554
559
|
error: {
|
|
555
560
|
code: "NO_CURRENT_PAGE",
|
|
556
561
|
message: "No current page, please call fetchFirstPage first."
|
|
557
562
|
}
|
|
558
|
-
} :
|
|
563
|
+
} : l(r),
|
|
559
564
|
currentPage: a
|
|
560
565
|
};
|
|
561
566
|
}
|
|
562
567
|
function ue(e) {
|
|
563
|
-
return e.progressItems.map((t,
|
|
564
|
-
const
|
|
565
|
-
let
|
|
566
|
-
if (
|
|
567
|
-
const s = new Date(t.createdAt).getTime(),
|
|
568
|
-
|
|
568
|
+
return e.progressItems.map((t, r) => {
|
|
569
|
+
const n = e.progressItems[r + 1], a = n != null;
|
|
570
|
+
let u;
|
|
571
|
+
if (n != null && n.createdAt) {
|
|
572
|
+
const s = new Date(t.createdAt).getTime(), l = new Date(n.createdAt).getTime();
|
|
573
|
+
u = Math.round((l - s) / 1e3);
|
|
569
574
|
}
|
|
570
575
|
return {
|
|
571
576
|
item: t,
|
|
572
577
|
completed: a,
|
|
573
|
-
isLatest:
|
|
574
|
-
durationSeconds:
|
|
578
|
+
isLatest: r === e.progressItems.length - 1,
|
|
579
|
+
durationSeconds: u
|
|
575
580
|
};
|
|
576
581
|
});
|
|
577
582
|
}
|
|
578
|
-
function
|
|
583
|
+
function _({
|
|
579
584
|
text: e,
|
|
580
585
|
duration: t = 2,
|
|
581
|
-
delay:
|
|
582
|
-
repeat:
|
|
586
|
+
delay: r = 0,
|
|
587
|
+
repeat: n = !0,
|
|
583
588
|
repeatDelay: a = 0.5,
|
|
584
|
-
className:
|
|
589
|
+
className: u,
|
|
585
590
|
startOnView: s = !1,
|
|
586
|
-
once:
|
|
587
|
-
inViewMargin:
|
|
588
|
-
spread:
|
|
589
|
-
color:
|
|
590
|
-
shimmerColor:
|
|
591
|
-
direction:
|
|
591
|
+
once: l = !1,
|
|
592
|
+
inViewMargin: g,
|
|
593
|
+
spread: o = 2,
|
|
594
|
+
color: i = "#999",
|
|
595
|
+
shimmerColor: d = "#000",
|
|
596
|
+
direction: c = "fromBottom"
|
|
592
597
|
}) {
|
|
593
|
-
const
|
|
594
|
-
return /* @__PURE__ */
|
|
595
|
-
|
|
598
|
+
const f = A(null), y = Q(f, { once: l, margin: g }), k = L(() => e.length * o, [e, o]), b = !s || y, h = c === "fromBottom" ? "100% center" : "-100% center", S = c === "fromBottom" ? "0% center" : "200% center";
|
|
599
|
+
return /* @__PURE__ */ m(
|
|
600
|
+
I.span,
|
|
596
601
|
{
|
|
597
|
-
ref:
|
|
598
|
-
className:
|
|
602
|
+
ref: f,
|
|
603
|
+
className: u,
|
|
599
604
|
style: {
|
|
600
605
|
position: "relative",
|
|
601
606
|
display: "inline-block",
|
|
@@ -605,31 +610,31 @@ function M({
|
|
|
605
610
|
color: "transparent",
|
|
606
611
|
WebkitTextFillColor: "transparent",
|
|
607
612
|
backgroundRepeat: "no-repeat, padding-box",
|
|
608
|
-
"--spread": `${
|
|
609
|
-
"--base-color":
|
|
610
|
-
"--shimmer-color":
|
|
613
|
+
"--spread": `${k}px`,
|
|
614
|
+
"--base-color": i,
|
|
615
|
+
"--shimmer-color": d,
|
|
611
616
|
"--shimmer-bg": "linear-gradient(90deg, transparent calc(50% - var(--spread)), var(--shimmer-color), transparent calc(50% + var(--spread)))",
|
|
612
617
|
backgroundImage: "var(--shimmer-bg), linear-gradient(var(--base-color), var(--base-color))"
|
|
613
618
|
},
|
|
614
619
|
initial: {
|
|
615
|
-
backgroundPosition:
|
|
620
|
+
backgroundPosition: h,
|
|
616
621
|
opacity: 0
|
|
617
622
|
},
|
|
618
|
-
animate:
|
|
619
|
-
backgroundPosition:
|
|
623
|
+
animate: b ? {
|
|
624
|
+
backgroundPosition: S,
|
|
620
625
|
opacity: 1
|
|
621
626
|
} : {},
|
|
622
627
|
transition: {
|
|
623
628
|
backgroundPosition: {
|
|
624
|
-
repeat:
|
|
629
|
+
repeat: n ? 1 / 0 : 0,
|
|
625
630
|
duration: t,
|
|
626
|
-
delay:
|
|
631
|
+
delay: r,
|
|
627
632
|
repeatDelay: a,
|
|
628
633
|
ease: "linear"
|
|
629
634
|
},
|
|
630
635
|
opacity: {
|
|
631
636
|
duration: 0.3,
|
|
632
|
-
delay:
|
|
637
|
+
delay: r
|
|
633
638
|
}
|
|
634
639
|
},
|
|
635
640
|
children: e
|
|
@@ -638,25 +643,38 @@ function M({
|
|
|
638
643
|
}
|
|
639
644
|
function me(e) {
|
|
640
645
|
const t = e.item.data;
|
|
641
|
-
|
|
646
|
+
switch (t.type) {
|
|
647
|
+
case "GenericAgentTaskExecution":
|
|
648
|
+
return t.title;
|
|
649
|
+
case "GenericAgentTaskReasoning":
|
|
650
|
+
return t.title;
|
|
651
|
+
case "GenericAgentTaskFinalResponse":
|
|
652
|
+
return "Generating answer...";
|
|
653
|
+
case "StreamingChatCompletionResponse":
|
|
654
|
+
return "Streaming...";
|
|
655
|
+
case "StreamingChatCompletionCompleted":
|
|
656
|
+
return "Completed";
|
|
657
|
+
case "GenericAgentTaskCompleted":
|
|
658
|
+
return "Completed";
|
|
659
|
+
}
|
|
642
660
|
}
|
|
643
661
|
const ge = ({
|
|
644
662
|
progressViewItems: e
|
|
645
663
|
}) => {
|
|
646
664
|
const t = e[e.length - 1];
|
|
647
665
|
if (!t) return null;
|
|
648
|
-
const
|
|
649
|
-
return /* @__PURE__ */
|
|
650
|
-
|
|
666
|
+
const r = me(t);
|
|
667
|
+
return /* @__PURE__ */ m("div", { className: "simple-mode-container", children: /* @__PURE__ */ m(W, { mode: "wait", children: /* @__PURE__ */ m(
|
|
668
|
+
I.div,
|
|
651
669
|
{
|
|
652
670
|
initial: { opacity: 0, y: 10 },
|
|
653
671
|
animate: { opacity: 1, y: 0 },
|
|
654
672
|
exit: { opacity: 0, y: -10 },
|
|
655
673
|
transition: { duration: 0.3 },
|
|
656
|
-
children: t.completed ? /* @__PURE__ */
|
|
657
|
-
|
|
674
|
+
children: t.completed ? /* @__PURE__ */ m("div", { className: "simple-mode-title", style: { color: "#666" }, children: r }) : /* @__PURE__ */ m(
|
|
675
|
+
_,
|
|
658
676
|
{
|
|
659
|
-
text:
|
|
677
|
+
text: r,
|
|
660
678
|
className: "simple-mode-title",
|
|
661
679
|
duration: 2.5,
|
|
662
680
|
repeat: !0,
|
|
@@ -670,10 +688,10 @@ const ge = ({
|
|
|
670
688
|
}, fe = ({
|
|
671
689
|
data: e,
|
|
672
690
|
isLatest: t = !1,
|
|
673
|
-
durationSeconds:
|
|
674
|
-
}) => /* @__PURE__ */
|
|
675
|
-
/* @__PURE__ */
|
|
676
|
-
|
|
691
|
+
durationSeconds: r
|
|
692
|
+
}) => /* @__PURE__ */ P("div", { style: { padding: "16px" }, children: [
|
|
693
|
+
/* @__PURE__ */ m(
|
|
694
|
+
I.div,
|
|
677
695
|
{
|
|
678
696
|
style: {
|
|
679
697
|
display: "flex",
|
|
@@ -684,8 +702,8 @@ const ge = ({
|
|
|
684
702
|
initial: { opacity: 0, y: -10 },
|
|
685
703
|
animate: { opacity: 1, y: 0 },
|
|
686
704
|
transition: { duration: 0.3, delay: 0 },
|
|
687
|
-
children: t && !
|
|
688
|
-
|
|
705
|
+
children: t && !r ? /* @__PURE__ */ m(
|
|
706
|
+
_,
|
|
689
707
|
{
|
|
690
708
|
text: e.title,
|
|
691
709
|
duration: 2.5,
|
|
@@ -693,10 +711,10 @@ const ge = ({
|
|
|
693
711
|
color: "#999",
|
|
694
712
|
shimmerColor: "#000"
|
|
695
713
|
}
|
|
696
|
-
) : /* @__PURE__ */
|
|
714
|
+
) : /* @__PURE__ */ m("span", { style: { color: "#666" }, children: e.title })
|
|
697
715
|
}
|
|
698
716
|
),
|
|
699
|
-
|
|
717
|
+
r !== void 0 && /* @__PURE__ */ P(
|
|
700
718
|
"div",
|
|
701
719
|
{
|
|
702
720
|
style: {
|
|
@@ -707,12 +725,12 @@ const ge = ({
|
|
|
707
725
|
},
|
|
708
726
|
children: [
|
|
709
727
|
"Took ",
|
|
710
|
-
|
|
728
|
+
r,
|
|
711
729
|
" seconds"
|
|
712
730
|
]
|
|
713
731
|
}
|
|
714
732
|
)
|
|
715
|
-
] }),
|
|
733
|
+
] }), G = {
|
|
716
734
|
'code[class*="language-"]': {
|
|
717
735
|
color: "#f8f8f2",
|
|
718
736
|
background: "none",
|
|
@@ -866,67 +884,67 @@ const ge = ({
|
|
|
866
884
|
}, ye = ({
|
|
867
885
|
data: e,
|
|
868
886
|
streamToken: t,
|
|
869
|
-
fetchClientToken:
|
|
870
|
-
durationSeconds:
|
|
887
|
+
fetchClientToken: r,
|
|
888
|
+
durationSeconds: n
|
|
871
889
|
}) => {
|
|
872
|
-
const { fency: a } =
|
|
890
|
+
const { fency: a } = F(), u = U(
|
|
873
891
|
async (s) => {
|
|
874
892
|
try {
|
|
875
|
-
const { clientToken:
|
|
893
|
+
const { clientToken: l } = await r(), g = await V({
|
|
876
894
|
pk: a.publishableKey,
|
|
877
895
|
baseUrl: a.baseUrl,
|
|
878
|
-
clientToken:
|
|
896
|
+
clientToken: l,
|
|
879
897
|
streamToken: t,
|
|
880
898
|
request: { fileId: s }
|
|
881
899
|
});
|
|
882
|
-
|
|
883
|
-
} catch (
|
|
884
|
-
console.error("Failed to download file:",
|
|
900
|
+
g.type === "success" && window.open(g.downloadLink, "_blank");
|
|
901
|
+
} catch (l) {
|
|
902
|
+
console.error("Failed to download file:", l);
|
|
885
903
|
}
|
|
886
904
|
},
|
|
887
|
-
[a, t,
|
|
905
|
+
[a, t, r]
|
|
888
906
|
);
|
|
889
|
-
return /* @__PURE__ */
|
|
890
|
-
/* @__PURE__ */
|
|
891
|
-
|
|
907
|
+
return /* @__PURE__ */ P("div", { style: { padding: "16px" }, children: [
|
|
908
|
+
/* @__PURE__ */ m(
|
|
909
|
+
I.div,
|
|
892
910
|
{
|
|
893
911
|
className: "fency-markdown-body-raw",
|
|
894
912
|
initial: { opacity: 0, y: -10 },
|
|
895
913
|
animate: { opacity: 1, y: 0 },
|
|
896
914
|
transition: { duration: 0.3, delay: 0 },
|
|
897
|
-
children: /* @__PURE__ */
|
|
898
|
-
|
|
915
|
+
children: /* @__PURE__ */ m(
|
|
916
|
+
D,
|
|
899
917
|
{
|
|
900
|
-
remarkPlugins: [
|
|
918
|
+
remarkPlugins: [B],
|
|
901
919
|
components: {
|
|
902
920
|
code(s) {
|
|
903
|
-
const { children:
|
|
904
|
-
return
|
|
905
|
-
|
|
921
|
+
const { children: l, className: g, node: o, ref: i, ...d } = s, c = /language-(\w+)/.exec(g || "");
|
|
922
|
+
return c ? /* @__PURE__ */ m(
|
|
923
|
+
M,
|
|
906
924
|
{
|
|
907
|
-
...
|
|
925
|
+
...d,
|
|
908
926
|
PreTag: "div",
|
|
909
|
-
children: String(
|
|
910
|
-
language:
|
|
911
|
-
style:
|
|
927
|
+
children: String(l).replace(/\n$/, ""),
|
|
928
|
+
language: c[1],
|
|
929
|
+
style: G
|
|
912
930
|
}
|
|
913
|
-
) : /* @__PURE__ */
|
|
931
|
+
) : /* @__PURE__ */ m("code", { ...d, className: g, children: String(l) });
|
|
914
932
|
},
|
|
915
933
|
a(s) {
|
|
916
|
-
const { children:
|
|
917
|
-
return /* @__PURE__ */
|
|
934
|
+
const { children: l, href: g, ...o } = s;
|
|
935
|
+
return /* @__PURE__ */ m(
|
|
918
936
|
"a",
|
|
919
937
|
{
|
|
920
|
-
...
|
|
921
|
-
href:
|
|
922
|
-
onClick: (
|
|
923
|
-
if (!
|
|
924
|
-
const
|
|
938
|
+
...o,
|
|
939
|
+
href: g,
|
|
940
|
+
onClick: (i) => {
|
|
941
|
+
if (!g) return;
|
|
942
|
+
const d = g.match(
|
|
925
943
|
/\/files\/(fil_[a-zA-Z0-9]+)\/download/
|
|
926
944
|
);
|
|
927
|
-
|
|
945
|
+
d && (i.preventDefault(), u(d[1]));
|
|
928
946
|
},
|
|
929
|
-
children:
|
|
947
|
+
children: l
|
|
930
948
|
}
|
|
931
949
|
);
|
|
932
950
|
}
|
|
@@ -936,7 +954,7 @@ const ge = ({
|
|
|
936
954
|
)
|
|
937
955
|
}
|
|
938
956
|
),
|
|
939
|
-
|
|
957
|
+
n !== void 0 && /* @__PURE__ */ P(
|
|
940
958
|
"div",
|
|
941
959
|
{
|
|
942
960
|
style: {
|
|
@@ -947,7 +965,7 @@ const ge = ({
|
|
|
947
965
|
},
|
|
948
966
|
children: [
|
|
949
967
|
"Thought for ",
|
|
950
|
-
|
|
968
|
+
n,
|
|
951
969
|
" seconds"
|
|
952
970
|
]
|
|
953
971
|
}
|
|
@@ -956,22 +974,22 @@ const ge = ({
|
|
|
956
974
|
}, he = ({
|
|
957
975
|
data: e,
|
|
958
976
|
completed: t,
|
|
959
|
-
isLatest:
|
|
960
|
-
durationSeconds:
|
|
977
|
+
isLatest: r = !1,
|
|
978
|
+
durationSeconds: n
|
|
961
979
|
}) => {
|
|
962
|
-
const a =
|
|
963
|
-
return
|
|
980
|
+
const a = A(null);
|
|
981
|
+
return w(() => {
|
|
964
982
|
a.current && !t && (a.current.scrollTop = a.current.scrollHeight);
|
|
965
|
-
}, [e.reasoning, t]), /* @__PURE__ */
|
|
966
|
-
/* @__PURE__ */
|
|
967
|
-
|
|
983
|
+
}, [e.reasoning, t]), /* @__PURE__ */ P("div", { style: { padding: "16px" }, children: [
|
|
984
|
+
/* @__PURE__ */ m(
|
|
985
|
+
I.h3,
|
|
968
986
|
{
|
|
969
987
|
style: { marginBottom: "10px", color: "#666" },
|
|
970
988
|
initial: { opacity: 0, y: -10 },
|
|
971
989
|
animate: { opacity: 1, y: 0 },
|
|
972
990
|
transition: { duration: 0.3, delay: 0 },
|
|
973
|
-
children:
|
|
974
|
-
|
|
991
|
+
children: r && !n ? /* @__PURE__ */ m(
|
|
992
|
+
_,
|
|
975
993
|
{
|
|
976
994
|
text: e.title,
|
|
977
995
|
duration: 2.5,
|
|
@@ -982,8 +1000,8 @@ const ge = ({
|
|
|
982
1000
|
) : e.title
|
|
983
1001
|
}
|
|
984
1002
|
),
|
|
985
|
-
/* @__PURE__ */
|
|
986
|
-
|
|
1003
|
+
/* @__PURE__ */ m(
|
|
1004
|
+
I.div,
|
|
987
1005
|
{
|
|
988
1006
|
ref: a,
|
|
989
1007
|
style: {
|
|
@@ -998,23 +1016,23 @@ const ge = ({
|
|
|
998
1016
|
initial: { opacity: 0, y: -10 },
|
|
999
1017
|
animate: { opacity: 0.5, y: 0 },
|
|
1000
1018
|
transition: { duration: 0.3, delay: 0.1 },
|
|
1001
|
-
children: /* @__PURE__ */
|
|
1002
|
-
|
|
1019
|
+
children: /* @__PURE__ */ m("div", { className: "fency-markdown-body-raw", children: /* @__PURE__ */ m(
|
|
1020
|
+
D,
|
|
1003
1021
|
{
|
|
1004
|
-
remarkPlugins: [
|
|
1022
|
+
remarkPlugins: [B],
|
|
1005
1023
|
components: {
|
|
1006
|
-
code(
|
|
1007
|
-
const { children: s, className:
|
|
1008
|
-
return
|
|
1009
|
-
|
|
1024
|
+
code(u) {
|
|
1025
|
+
const { children: s, className: l, node: g, ref: o, ...i } = u, d = /language-(\w+)/.exec(l || "");
|
|
1026
|
+
return d ? /* @__PURE__ */ m(
|
|
1027
|
+
M,
|
|
1010
1028
|
{
|
|
1011
|
-
...
|
|
1029
|
+
...i,
|
|
1012
1030
|
PreTag: "div",
|
|
1013
1031
|
children: String(s).replace(/\n$/, ""),
|
|
1014
|
-
language:
|
|
1015
|
-
style:
|
|
1032
|
+
language: d[1],
|
|
1033
|
+
style: G
|
|
1016
1034
|
}
|
|
1017
|
-
) : /* @__PURE__ */
|
|
1035
|
+
) : /* @__PURE__ */ m("code", { ...i, className: l, children: String(s) });
|
|
1018
1036
|
}
|
|
1019
1037
|
},
|
|
1020
1038
|
children: e.reasoning
|
|
@@ -1022,7 +1040,7 @@ const ge = ({
|
|
|
1022
1040
|
) })
|
|
1023
1041
|
}
|
|
1024
1042
|
),
|
|
1025
|
-
|
|
1043
|
+
n !== void 0 && /* @__PURE__ */ P(
|
|
1026
1044
|
"div",
|
|
1027
1045
|
{
|
|
1028
1046
|
style: {
|
|
@@ -1033,90 +1051,129 @@ const ge = ({
|
|
|
1033
1051
|
},
|
|
1034
1052
|
children: [
|
|
1035
1053
|
"Thought for ",
|
|
1036
|
-
|
|
1054
|
+
n,
|
|
1037
1055
|
" seconds"
|
|
1038
1056
|
]
|
|
1039
1057
|
}
|
|
1040
1058
|
)
|
|
1041
1059
|
] });
|
|
1042
1060
|
}, be = ({
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1061
|
+
data: e
|
|
1062
|
+
}) => /* @__PURE__ */ m("div", { style: { padding: "16px" }, children: /* @__PURE__ */ m(
|
|
1063
|
+
I.div,
|
|
1064
|
+
{
|
|
1065
|
+
className: "fency-markdown-body-raw",
|
|
1066
|
+
initial: { opacity: 0, y: -10 },
|
|
1067
|
+
animate: { opacity: 1, y: 0 },
|
|
1068
|
+
transition: { duration: 0.3, delay: 0 },
|
|
1069
|
+
children: /* @__PURE__ */ m(
|
|
1070
|
+
D,
|
|
1071
|
+
{
|
|
1072
|
+
remarkPlugins: [B],
|
|
1073
|
+
components: {
|
|
1074
|
+
code(t) {
|
|
1075
|
+
const { children: r, className: n, node: a, ref: u, ...s } = t, l = /language-(\w+)/.exec(n || "");
|
|
1076
|
+
return l ? /* @__PURE__ */ m(
|
|
1077
|
+
M,
|
|
1078
|
+
{
|
|
1079
|
+
...s,
|
|
1080
|
+
PreTag: "div",
|
|
1081
|
+
children: String(r).replace(/\n$/, ""),
|
|
1082
|
+
language: l[1],
|
|
1083
|
+
style: G
|
|
1084
|
+
}
|
|
1085
|
+
) : /* @__PURE__ */ m("code", { ...s, className: n, children: String(r) });
|
|
1086
|
+
}
|
|
1087
|
+
},
|
|
1088
|
+
children: e.response
|
|
1089
|
+
}
|
|
1090
|
+
)
|
|
1091
|
+
}
|
|
1092
|
+
) }), ke = ({ progressViewItems: e, streamToken: t, fetchClientToken: r }) => {
|
|
1093
|
+
const n = A(null);
|
|
1094
|
+
w(() => {
|
|
1095
|
+
n.current && (n.current.scrollTop = n.current.scrollHeight);
|
|
1096
|
+
}, [e.length]);
|
|
1097
|
+
const a = (u) => {
|
|
1098
|
+
switch (u.item.data.type) {
|
|
1099
|
+
case "GenericAgentTaskExecution":
|
|
1100
|
+
return /* @__PURE__ */ m(
|
|
1101
|
+
fe,
|
|
1102
|
+
{
|
|
1103
|
+
data: u.item.data,
|
|
1104
|
+
completed: u.completed,
|
|
1105
|
+
isLatest: u.isLatest,
|
|
1106
|
+
durationSeconds: u.durationSeconds
|
|
1107
|
+
}
|
|
1108
|
+
);
|
|
1109
|
+
case "GenericAgentTaskReasoning":
|
|
1110
|
+
return /* @__PURE__ */ m(
|
|
1111
|
+
he,
|
|
1112
|
+
{
|
|
1113
|
+
data: u.item.data,
|
|
1114
|
+
completed: u.completed,
|
|
1115
|
+
isLatest: u.isLatest,
|
|
1116
|
+
durationSeconds: u.durationSeconds
|
|
1117
|
+
}
|
|
1118
|
+
);
|
|
1119
|
+
case "GenericAgentTaskFinalResponse":
|
|
1120
|
+
return /* @__PURE__ */ m(
|
|
1121
|
+
ye,
|
|
1122
|
+
{
|
|
1123
|
+
data: u.item.data,
|
|
1124
|
+
streamToken: t,
|
|
1125
|
+
fetchClientToken: r,
|
|
1126
|
+
durationSeconds: u.durationSeconds
|
|
1127
|
+
}
|
|
1128
|
+
);
|
|
1129
|
+
case "StreamingChatCompletionResponse":
|
|
1130
|
+
return /* @__PURE__ */ m(be, { data: u.item.data });
|
|
1131
|
+
default:
|
|
1132
|
+
return null;
|
|
1133
|
+
}
|
|
1134
|
+
};
|
|
1135
|
+
return /* @__PURE__ */ m(
|
|
1051
1136
|
"div",
|
|
1052
1137
|
{
|
|
1053
|
-
ref:
|
|
1138
|
+
ref: n,
|
|
1054
1139
|
style: {
|
|
1055
1140
|
flex: 1,
|
|
1056
1141
|
overflowY: "auto",
|
|
1057
1142
|
minHeight: 0
|
|
1058
1143
|
},
|
|
1059
|
-
children: /* @__PURE__ */
|
|
1060
|
-
|
|
1144
|
+
children: /* @__PURE__ */ m(W, { children: e.map((u, s) => /* @__PURE__ */ m(
|
|
1145
|
+
I.div,
|
|
1061
1146
|
{
|
|
1062
1147
|
initial: { opacity: 0, y: -20 },
|
|
1063
1148
|
animate: { opacity: 1, y: 0 },
|
|
1064
1149
|
transition: {
|
|
1065
1150
|
duration: 0.4,
|
|
1066
|
-
delay:
|
|
1151
|
+
delay: s * 0.1,
|
|
1067
1152
|
ease: "easeOut"
|
|
1068
1153
|
},
|
|
1069
|
-
children:
|
|
1070
|
-
a.data.type === "GenericAgentTaskExecution" && /* @__PURE__ */ g(
|
|
1071
|
-
fe,
|
|
1072
|
-
{
|
|
1073
|
-
data: a.data,
|
|
1074
|
-
completed: f,
|
|
1075
|
-
isLatest: s,
|
|
1076
|
-
durationSeconds: d
|
|
1077
|
-
}
|
|
1078
|
-
),
|
|
1079
|
-
a.data.type === "GenericAgentTaskReasoning" && /* @__PURE__ */ g(
|
|
1080
|
-
he,
|
|
1081
|
-
{
|
|
1082
|
-
data: a.data,
|
|
1083
|
-
completed: f,
|
|
1084
|
-
isLatest: s,
|
|
1085
|
-
durationSeconds: d
|
|
1086
|
-
}
|
|
1087
|
-
),
|
|
1088
|
-
a.data.type === "GenericAgentTaskFinalResponse" && /* @__PURE__ */ g(
|
|
1089
|
-
ye,
|
|
1090
|
-
{
|
|
1091
|
-
data: a.data,
|
|
1092
|
-
streamToken: t,
|
|
1093
|
-
fetchClientToken: n,
|
|
1094
|
-
durationSeconds: d
|
|
1095
|
-
}
|
|
1096
|
-
)
|
|
1097
|
-
]
|
|
1154
|
+
children: a(u)
|
|
1098
1155
|
},
|
|
1099
|
-
|
|
1156
|
+
u.item.progressItemId
|
|
1100
1157
|
)) })
|
|
1101
1158
|
}
|
|
1102
1159
|
);
|
|
1103
|
-
},
|
|
1160
|
+
}, Oe = ({
|
|
1104
1161
|
agentTask: e,
|
|
1105
1162
|
mode: t = "verbose",
|
|
1106
|
-
streamToken:
|
|
1107
|
-
fetchClientToken:
|
|
1163
|
+
streamToken: r,
|
|
1164
|
+
fetchClientToken: n
|
|
1108
1165
|
}) => {
|
|
1109
1166
|
const a = ue(e);
|
|
1110
|
-
return t === "simple" ? /* @__PURE__ */
|
|
1111
|
-
|
|
1167
|
+
return t === "simple" ? /* @__PURE__ */ m(ge, { progressViewItems: a }) : /* @__PURE__ */ m(
|
|
1168
|
+
ke,
|
|
1112
1169
|
{
|
|
1113
1170
|
progressViewItems: a,
|
|
1114
|
-
streamToken:
|
|
1115
|
-
fetchClientToken:
|
|
1171
|
+
streamToken: r,
|
|
1172
|
+
fetchClientToken: n
|
|
1116
1173
|
}
|
|
1117
1174
|
);
|
|
1118
1175
|
};
|
|
1119
|
-
class
|
|
1176
|
+
class Se {
|
|
1120
1177
|
constructor(t) {
|
|
1121
1178
|
this.eventSources = /* @__PURE__ */ new Map(), this.subscribers = /* @__PURE__ */ new Map(), this.fency = t;
|
|
1122
1179
|
}
|
|
@@ -1125,37 +1182,37 @@ class ke {
|
|
|
1125
1182
|
* Creates new connections and removes old ones.
|
|
1126
1183
|
*/
|
|
1127
1184
|
updateStreams(t) {
|
|
1128
|
-
t.forEach((
|
|
1129
|
-
const a =
|
|
1130
|
-
this.eventSources.has(a) || this.connectStream(
|
|
1185
|
+
t.forEach((n) => {
|
|
1186
|
+
const a = n.stream.id;
|
|
1187
|
+
this.eventSources.has(a) || this.connectStream(n);
|
|
1131
1188
|
});
|
|
1132
|
-
const
|
|
1133
|
-
this.eventSources.forEach((
|
|
1134
|
-
|
|
1189
|
+
const r = new Set(t.map((n) => n.stream.id));
|
|
1190
|
+
this.eventSources.forEach((n, a) => {
|
|
1191
|
+
r.has(a) || (n.abort(), this.eventSources.delete(a));
|
|
1135
1192
|
});
|
|
1136
1193
|
}
|
|
1137
1194
|
connectStream(t) {
|
|
1138
|
-
const
|
|
1139
|
-
this.eventSources.set(
|
|
1140
|
-
const a = `${this.fency.baseUrl}/sse/streams/${
|
|
1195
|
+
const r = t.stream.id, n = new AbortController();
|
|
1196
|
+
this.eventSources.set(r, n);
|
|
1197
|
+
const a = `${this.fency.baseUrl}/sse/streams/${r}`, u = {
|
|
1141
1198
|
"X-Fency-Publishable-Key": this.fency.publishableKey,
|
|
1142
1199
|
"X-Fency-Stream-Token": t.stream.token
|
|
1143
1200
|
};
|
|
1144
|
-
|
|
1145
|
-
headers:
|
|
1146
|
-
signal:
|
|
1201
|
+
$(a, {
|
|
1202
|
+
headers: u,
|
|
1203
|
+
signal: n.signal,
|
|
1147
1204
|
async onopen(s) {
|
|
1148
1205
|
if (!s.ok && s.status >= 400 && s.status < 500 && s.status !== 429)
|
|
1149
1206
|
throw new Error(`Client error ${s.status}`);
|
|
1150
1207
|
},
|
|
1151
1208
|
onmessage: (s) => {
|
|
1152
1209
|
if (s.data) {
|
|
1153
|
-
const
|
|
1154
|
-
this.broadcast(
|
|
1210
|
+
const l = K(s.data);
|
|
1211
|
+
this.broadcast(l, r);
|
|
1155
1212
|
}
|
|
1156
1213
|
},
|
|
1157
1214
|
onerror: (s) => {
|
|
1158
|
-
throw console.error("EventSource error for stream",
|
|
1215
|
+
throw console.error("EventSource error for stream", r, ":", s), this.broadcastError(r), s;
|
|
1159
1216
|
},
|
|
1160
1217
|
onclose() {
|
|
1161
1218
|
}
|
|
@@ -1165,19 +1222,19 @@ class ke {
|
|
|
1165
1222
|
* Subscribe to events from all active streams.
|
|
1166
1223
|
* Returns an unsubscribe function.
|
|
1167
1224
|
*/
|
|
1168
|
-
subscribe(t,
|
|
1169
|
-
return this.subscribers.set(t,
|
|
1225
|
+
subscribe(t, r) {
|
|
1226
|
+
return this.subscribers.set(t, r), () => {
|
|
1170
1227
|
this.subscribers.delete(t);
|
|
1171
1228
|
};
|
|
1172
1229
|
}
|
|
1173
|
-
broadcast(t,
|
|
1174
|
-
this.subscribers.forEach((
|
|
1175
|
-
|
|
1230
|
+
broadcast(t, r) {
|
|
1231
|
+
this.subscribers.forEach((n) => {
|
|
1232
|
+
n.onMessage(t, r);
|
|
1176
1233
|
});
|
|
1177
1234
|
}
|
|
1178
1235
|
broadcastError(t) {
|
|
1179
|
-
this.subscribers.forEach((
|
|
1180
|
-
|
|
1236
|
+
this.subscribers.forEach((r) => {
|
|
1237
|
+
r.onError(t);
|
|
1181
1238
|
});
|
|
1182
1239
|
}
|
|
1183
1240
|
/**
|
|
@@ -1187,89 +1244,90 @@ class ke {
|
|
|
1187
1244
|
this.eventSources.forEach((t) => t.abort()), this.eventSources.clear(), this.subscribers.clear();
|
|
1188
1245
|
}
|
|
1189
1246
|
}
|
|
1190
|
-
const
|
|
1247
|
+
const ve = 12e4, Te = (e) => {
|
|
1191
1248
|
const t = Date.now();
|
|
1192
|
-
return e.filter((
|
|
1249
|
+
return e.filter((r) => t - r.createdAt < ve);
|
|
1193
1250
|
};
|
|
1194
|
-
function
|
|
1195
|
-
const [n,
|
|
1251
|
+
function Ue({ fency: e, fetchCreateStreamClientToken: t, children: r }) {
|
|
1252
|
+
const [n, a] = T(
|
|
1196
1253
|
null
|
|
1197
|
-
), [
|
|
1198
|
-
|
|
1199
|
-
e.then((
|
|
1200
|
-
|
|
1201
|
-
}).catch((
|
|
1202
|
-
|
|
1254
|
+
), [u, s] = T(!0), [l, g] = T(null), [o, i] = T([]), d = A(null), c = A(null);
|
|
1255
|
+
w(() => {
|
|
1256
|
+
e.then((b) => {
|
|
1257
|
+
a(b), s(!1);
|
|
1258
|
+
}).catch((b) => {
|
|
1259
|
+
g(b), s(!1);
|
|
1203
1260
|
});
|
|
1204
|
-
}, [e]),
|
|
1205
|
-
n && !
|
|
1206
|
-
}, [n]),
|
|
1207
|
-
|
|
1208
|
-
}, [o]),
|
|
1209
|
-
var
|
|
1210
|
-
(
|
|
1261
|
+
}, [e]), w(() => {
|
|
1262
|
+
n && !c.current && (c.current = new Se(n));
|
|
1263
|
+
}, [n]), w(() => {
|
|
1264
|
+
c.current && c.current.updateStreams(o);
|
|
1265
|
+
}, [o]), w(() => () => {
|
|
1266
|
+
var b;
|
|
1267
|
+
(b = c.current) == null || b.cleanup();
|
|
1211
1268
|
}, []);
|
|
1212
|
-
const
|
|
1213
|
-
async (
|
|
1214
|
-
if (
|
|
1215
|
-
return
|
|
1216
|
-
const
|
|
1217
|
-
if (
|
|
1218
|
-
return
|
|
1219
|
-
const
|
|
1269
|
+
const f = U(
|
|
1270
|
+
async (b = 3e4) => {
|
|
1271
|
+
if (d.current)
|
|
1272
|
+
return d.current;
|
|
1273
|
+
const h = Date.now(), S = o.length > 0 ? o[o.length - 1] : null;
|
|
1274
|
+
if (S && h - S.createdAt < b)
|
|
1275
|
+
return S.stream;
|
|
1276
|
+
const x = (async () => {
|
|
1220
1277
|
if (!n)
|
|
1221
1278
|
throw new Error("Fency instance not initialized");
|
|
1222
|
-
const
|
|
1279
|
+
const C = await t(), E = await X({
|
|
1223
1280
|
pk: n.publishableKey,
|
|
1224
1281
|
baseUrl: n.baseUrl,
|
|
1225
|
-
clientToken: (
|
|
1282
|
+
clientToken: (C == null ? void 0 : C.clientToken) ?? ""
|
|
1226
1283
|
});
|
|
1227
|
-
if (
|
|
1284
|
+
if (E.type === "success") {
|
|
1228
1285
|
const N = {
|
|
1229
|
-
stream:
|
|
1286
|
+
stream: E.stream,
|
|
1230
1287
|
createdAt: Date.now()
|
|
1231
1288
|
};
|
|
1232
|
-
return
|
|
1233
|
-
const
|
|
1234
|
-
return Te(
|
|
1235
|
-
}),
|
|
1289
|
+
return i((R) => {
|
|
1290
|
+
const v = [...R, N];
|
|
1291
|
+
return Te(v);
|
|
1292
|
+
}), d.current = null, E.stream;
|
|
1236
1293
|
} else
|
|
1237
|
-
throw
|
|
1294
|
+
throw d.current = null, new Error("Failed to create stream");
|
|
1238
1295
|
})();
|
|
1239
|
-
return
|
|
1296
|
+
return d.current = x, x;
|
|
1240
1297
|
},
|
|
1241
1298
|
[n, o]
|
|
1242
1299
|
);
|
|
1243
|
-
if (
|
|
1244
|
-
return /* @__PURE__ */
|
|
1300
|
+
if (l)
|
|
1301
|
+
return /* @__PURE__ */ P("div", { children: [
|
|
1245
1302
|
"Fency error: ",
|
|
1246
|
-
|
|
1303
|
+
l.message
|
|
1247
1304
|
] });
|
|
1248
1305
|
if (!n)
|
|
1249
1306
|
return null;
|
|
1250
|
-
const
|
|
1307
|
+
const y = o.length > 0 ? o[o.length - 1] : null, k = {
|
|
1251
1308
|
fency: n,
|
|
1252
|
-
loading:
|
|
1253
|
-
error:
|
|
1309
|
+
loading: u,
|
|
1310
|
+
error: l,
|
|
1254
1311
|
activeStreams: o,
|
|
1255
|
-
latestStream:
|
|
1256
|
-
eventManager:
|
|
1257
|
-
getOrCreateStream:
|
|
1312
|
+
latestStream: y,
|
|
1313
|
+
eventManager: c.current,
|
|
1314
|
+
getOrCreateStream: f
|
|
1258
1315
|
};
|
|
1259
|
-
return /* @__PURE__ */
|
|
1316
|
+
return /* @__PURE__ */ m(j.Provider, { value: k, children: r });
|
|
1260
1317
|
}
|
|
1261
1318
|
export {
|
|
1262
|
-
|
|
1319
|
+
Oe as AgentTaskProgress,
|
|
1263
1320
|
ge as AgentTaskProgressSimple,
|
|
1264
|
-
|
|
1265
|
-
|
|
1321
|
+
ke as AgentTaskProgressVerbose,
|
|
1322
|
+
Ue as FencyProvider,
|
|
1266
1323
|
fe as GenericAgentTaskExecution,
|
|
1267
1324
|
ye as GenericAgentTaskFinalResponse,
|
|
1268
1325
|
he as GenericAgentTaskReasoning,
|
|
1269
|
-
|
|
1270
|
-
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
Ne as
|
|
1326
|
+
_ as ShimmeringText,
|
|
1327
|
+
be as StreamingChatCompletionResponse,
|
|
1328
|
+
Re as useAgentTasks,
|
|
1329
|
+
F as useFencyContext,
|
|
1330
|
+
Ne as useFencyEventSource,
|
|
1331
|
+
Fe as usePaginatedQuery,
|
|
1274
1332
|
re as useStream
|
|
1275
1333
|
};
|