@fencyai/react 0.1.117 → 0.1.118

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,15 +1,15 @@
1
- import { createAgentTask as q, createFileDownloadLink as V, createStream as X } from "@fencyai/js";
2
- import { createContext as J, useContext as Q, useState as v, useRef as x, useEffect as C, useCallback as B, useMemo as H } from "react";
3
- import { jsx as u, jsxs as E } from "react/jsx-runtime";
4
- import { useInView as Y, motion as w, AnimatePresence as L } from "motion/react";
5
- import _ from "react-markdown";
6
- import { Prism as F } from "react-syntax-highlighter";
7
- import G from "remark-gfm";
8
- import './assets/index.css';const W = J(
1
+ import { createAgentTask as q, createFileDownloadLink as J, createStream as V } from "@fencyai/js";
2
+ import { createContext as X, useContext as Q, useState as x, useRef as I, useEffect as w, useCallback as U, useMemo as j } from "react";
3
+ import { jsx as l, jsxs as C } from "react/jsx-runtime";
4
+ import { useInView as Y, motion as T, AnimatePresence as W } from "motion/react";
5
+ import B from "react-markdown";
6
+ import { Prism as R } from "react-syntax-highlighter";
7
+ import z from "remark-gfm";
8
+ import './assets/index.css';const $ = X(
9
9
  void 0
10
10
  );
11
- function O() {
12
- const e = Q(W);
11
+ function M() {
12
+ const e = Q($);
13
13
  if (e === void 0)
14
14
  throw new Error("useFencyContext must be used within a FencyProvider");
15
15
  return e;
@@ -17,31 +17,31 @@ function O() {
17
17
  const Z = (e) => {
18
18
  try {
19
19
  const t = JSON.parse(e);
20
- return p(t);
20
+ return ee(t);
21
21
  } catch (t) {
22
22
  return console.error("Error parsing message:", t), null;
23
23
  }
24
- }, p = (e) => {
24
+ }, ee = (e) => {
25
25
  if (!(typeof e == "object" && e !== null && "type" in e && "streamId" in e && "timestamp" in e))
26
26
  return null;
27
27
  switch (e.type) {
28
28
  case "StreamTimeout":
29
- return ee(e);
30
- case "StreamNotFound":
31
29
  return te(e);
32
- case "AgentTaskProgressItemUpdated":
30
+ case "StreamNotFound":
33
31
  return ne(e);
32
+ case "AgentTaskProgressItemUpdated":
33
+ return re(e);
34
34
  }
35
35
  return null;
36
- }, ee = (e) => ({
36
+ }, te = (e) => ({
37
37
  type: "StreamTimeout",
38
38
  streamId: e.streamId,
39
39
  timestamp: e.timestamp
40
- }), te = (e) => ({
40
+ }), ne = (e) => ({
41
41
  type: "StreamNotFound",
42
42
  streamId: e.streamId,
43
43
  timestamp: e.timestamp
44
- }), ne = (e) => ({
44
+ }), re = (e) => ({
45
45
  type: "AgentTaskProgressItemUpdated",
46
46
  streamId: e.streamId,
47
47
  agentTaskId: e.agentTaskId,
@@ -49,42 +49,42 @@ const Z = (e) => {
49
49
  timestamp: e.timestamp,
50
50
  createdAt: e.createdAt,
51
51
  data: JSON.parse(e.data)
52
- }), re = (e) => {
53
- const t = O(), [r, n] = v(null), a = x(`subscriber-${Math.random().toString(36).substr(2, 9)}`);
54
- return C(() => {
52
+ }), ae = (e) => {
53
+ const t = M(), [n, r] = x(null), a = I(`subscriber-${Math.random().toString(36).substr(2, 9)}`);
54
+ return w(() => {
55
55
  if (!t.eventManager) return;
56
- const o = {
56
+ const c = {
57
57
  onMessage: (g, i) => {
58
- var c, l, b, m, k, y, h, S, I, A;
58
+ var d, u, b, y, S, f, h, k, P, A;
59
59
  const s = Z(g);
60
60
  if (s)
61
61
  switch (s.type) {
62
62
  case "NewChatCompletionStreamChunk":
63
- (c = e == null ? void 0 : e.onNewChatCompletionStreamChunk) == null || c.call(e, s);
63
+ (d = e == null ? void 0 : e.onNewChatCompletionStreamChunk) == null || d.call(e, s);
64
64
  break;
65
65
  case "ChatCompletionStreamCompleted":
66
- (l = e == null ? void 0 : e.onChatCompletionStreamCompleted) == null || l.call(e, s);
66
+ (u = e == null ? void 0 : e.onChatCompletionStreamCompleted) == null || u.call(e, s);
67
67
  break;
68
68
  case "StreamTimeout":
69
69
  (b = e == null ? void 0 : e.onStreamTimeout) == null || b.call(e, s);
70
70
  break;
71
71
  case "StreamNotFound":
72
- (m = e == null ? void 0 : e.onStreamNotFound) == null || m.call(e, s);
72
+ (y = e == null ? void 0 : e.onStreamNotFound) == null || y.call(e, s);
73
73
  break;
74
74
  case "FileUploadCompleted":
75
- (k = e == null ? void 0 : e.onFileUploadCompleted) == null || k.call(e, s);
75
+ (S = e == null ? void 0 : e.onFileUploadCompleted) == null || S.call(e, s);
76
76
  break;
77
77
  case "FileTextContentReady":
78
- (y = e == null ? void 0 : e.onFileTextContentReady) == null || y.call(e, s);
78
+ (f = e == null ? void 0 : e.onFileTextContentReady) == null || f.call(e, s);
79
79
  break;
80
80
  case "WebsiteHtmlContentReady":
81
81
  (h = e == null ? void 0 : e.onWebsiteHtmlContentReady) == null || h.call(e, s);
82
82
  break;
83
83
  case "WebsiteTextContentReady":
84
- (S = e == null ? void 0 : e.onWebsiteTextContentReady) == null || S.call(e, s);
84
+ (k = e == null ? void 0 : e.onWebsiteTextContentReady) == null || k.call(e, s);
85
85
  break;
86
86
  case "FileSearchIndexReady":
87
- (I = e == null ? void 0 : e.onFileSearchIndexReady) == null || I.call(e, s);
87
+ (P = e == null ? void 0 : e.onFileSearchIndexReady) == null || P.call(e, s);
88
88
  break;
89
89
  case "AgentTaskProgressItemUpdated":
90
90
  (A = e == null ? void 0 : e.onAgentTaskProgressItemUpdated) == null || A.call(e, s);
@@ -104,64 +104,64 @@ const Z = (e) => {
104
104
  };
105
105
  return t.eventManager.subscribe(
106
106
  a.current,
107
- o
107
+ c
108
108
  );
109
109
  }, [t.eventManager, e]), {
110
110
  createStream: async () => {
111
111
  try {
112
- const o = await t.getOrCreateStream(3e4);
113
- return n(o), {
112
+ const c = await t.getOrCreateStream(3e4);
113
+ return r(c), {
114
114
  type: "success",
115
- stream: o
115
+ stream: c
116
116
  };
117
- } catch (o) {
117
+ } catch (c) {
118
118
  return {
119
119
  type: "error",
120
120
  error: {
121
121
  code: "UnknownError",
122
- message: o instanceof Error ? o.message : "Failed to create stream"
122
+ message: c instanceof Error ? c.message : "Failed to create stream"
123
123
  }
124
124
  };
125
125
  }
126
126
  },
127
- stream: r
127
+ stream: n
128
128
  };
129
- }, Ne = (e) => {
130
- const t = O(), [r, n] = v([]), a = x(/* @__PURE__ */ new Set()), f = x(/* @__PURE__ */ new Map()), { createStream: o } = re({
129
+ }, Oe = (e) => {
130
+ const t = M(), [n, r] = x([]), a = I(/* @__PURE__ */ new Set()), m = I(/* @__PURE__ */ new Map()), { createStream: c } = ae({
131
131
  onAgentTaskProgressItemUpdated: (i) => {
132
- var l;
132
+ var u;
133
133
  if (!a.current.has(i.agentTaskId)) return;
134
134
  const s = i.data;
135
135
  if (s.type === "GenericAgentTaskCompleted" || s.type === "StreamingChatCompletionCompleted" || s.type === "StructuredChatCompletionCompleted") {
136
- const b = f.current.get(i.agentTaskId);
137
- b && (f.current.delete(i.agentTaskId), b(s));
136
+ const b = m.current.get(i.agentTaskId);
137
+ b && (m.current.delete(i.agentTaskId), b(s));
138
138
  return;
139
139
  }
140
- (l = e.onAgentTaskProgressItemUpdated) == null || l.call(e, i), n(
141
- (b) => b.map((m) => {
140
+ (u = e.onAgentTaskProgressItemUpdated) == null || u.call(e, i), r(
141
+ (b) => b.map((y) => {
142
142
  var h;
143
- if (((h = m.confirmedData) == null ? void 0 : h.taskId) !== i.agentTaskId) return m;
144
- const y = m.progressItems.some(
145
- (S) => S.progressItemId === i.progressItemId
146
- ) ? m.progressItems.map(
147
- (S) => S.progressItemId === i.progressItemId ? i : S
148
- ) : [...m.progressItems, i];
149
- return { ...m, progressItems: y };
143
+ if (((h = y.confirmedData) == null ? void 0 : h.taskId) !== i.agentTaskId) return y;
144
+ const f = y.progressItems.some(
145
+ (k) => k.progressItemId === i.progressItemId
146
+ ) ? y.progressItems.map(
147
+ (k) => k.progressItemId === i.progressItemId ? i : k
148
+ ) : [...y.progressItems, i];
149
+ return { ...y, progressItems: f };
150
150
  })
151
151
  );
152
152
  },
153
153
  onStreamError: (i) => {
154
154
  var s;
155
- (s = e == null ? void 0 : e.onStreamError) == null || s.call(e, i), n((c) => {
156
- const l = c.find((b) => b.streamId === i.streamId);
157
- return l ? [
158
- ...c.filter((b) => b.streamId !== i.streamId),
155
+ (s = e == null ? void 0 : e.onStreamError) == null || s.call(e, i), r((d) => {
156
+ const u = d.find((b) => b.streamId === i.streamId);
157
+ return u ? [
158
+ ...d.filter((b) => b.streamId !== i.streamId),
159
159
  {
160
- ...l,
160
+ ...u,
161
161
  loading: !1,
162
162
  error: i.error
163
163
  }
164
- ] : c;
164
+ ] : d;
165
165
  });
166
166
  },
167
167
  onStreamNotFound: (i) => {
@@ -172,15 +172,15 @@ const Z = (e) => {
172
172
  var s;
173
173
  (s = e == null ? void 0 : e.onStreamTimeout) == null || s.call(e, i);
174
174
  }
175
- }), d = B(
175
+ }), o = U(
176
176
  async (i, s) => {
177
- const c = `task-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`, l = await o();
178
- if (l.type === "success") {
179
- n([
180
- ...r,
177
+ const d = `task-${Date.now()}-${Math.random().toString(36).slice(2, 9)}`, u = await c();
178
+ if (u.type === "success") {
179
+ r([
180
+ ...n,
181
181
  {
182
- taskKey: c,
183
- streamId: l.stream.id,
182
+ taskKey: d,
183
+ streamId: u.stream.id,
184
184
  triggeredAt: (/* @__PURE__ */ new Date()).toISOString(),
185
185
  confirmedData: null,
186
186
  error: null,
@@ -191,30 +191,30 @@ const Z = (e) => {
191
191
  loadingText: s == null ? void 0 : s.loadingText
192
192
  }
193
193
  ]);
194
- const { clientToken: b } = await e.fetchCreateAgentTaskClientToken(i.type), m = await q({
194
+ const { clientToken: b } = await e.fetchCreateAgentTaskClientToken(i.type), y = await q({
195
195
  pk: t.fency.publishableKey,
196
196
  baseUrl: t.fency.baseUrl,
197
197
  clientToken: b,
198
- streamToken: l.stream.token,
198
+ streamToken: u.stream.token,
199
199
  request: {
200
200
  genericTask: i.type === "genericAgentTask" ? { query: i.query, jsonSchema: i.jsonSchema } : void 0,
201
201
  streamingChatCompletionTask: i.type === "streamingChatCompletion" ? { messages: i.messages, model: i.model } : void 0,
202
202
  structuredChatCompletionTask: i.type === "structuredChatCompletion" ? { messages: i.messages, jsonSchema: i.jsonSchema, model: i.model } : void 0
203
203
  }
204
204
  });
205
- if (m.type === "success" && m.agentTask) {
205
+ if (y.type === "success" && y.agentTask) {
206
206
  a.current.add(
207
- m.agentTask.id
208
- ), n((y) => [
209
- ...y.filter(
210
- (h) => h.taskKey !== c
207
+ y.agentTask.id
208
+ ), r((f) => [
209
+ ...f.filter(
210
+ (h) => h.taskKey !== d
211
211
  ),
212
212
  {
213
- taskKey: c,
214
- streamId: l.stream.id,
213
+ taskKey: d,
214
+ streamId: u.stream.id,
215
215
  triggeredAt: (/* @__PURE__ */ new Date()).toISOString(),
216
- taskId: m.agentTask.id,
217
- createdAt: m.agentTask.createdAt,
216
+ taskId: y.agentTask.id,
217
+ createdAt: y.agentTask.createdAt,
218
218
  error: null,
219
219
  params: i,
220
220
  progressItems: [],
@@ -222,37 +222,37 @@ const Z = (e) => {
222
222
  loading: !0,
223
223
  loadingText: s == null ? void 0 : s.loadingText,
224
224
  confirmedData: {
225
- taskId: m.agentTask.id,
226
- createdAt: m.agentTask.createdAt
225
+ taskId: y.agentTask.id,
226
+ createdAt: y.agentTask.createdAt
227
227
  }
228
228
  }
229
229
  ]);
230
- const k = await new Promise(
231
- (y) => {
232
- f.current.set(
233
- m.agentTask.id,
234
- y
230
+ const S = await new Promise(
231
+ (f) => {
232
+ m.current.set(
233
+ y.agentTask.id,
234
+ f
235
235
  );
236
236
  }
237
237
  );
238
238
  return {
239
239
  type: "success",
240
- streamId: l.stream.id,
241
- agentTaskId: m.agentTask.id,
242
- response: k
240
+ streamId: u.stream.id,
241
+ agentTaskId: y.agentTask.id,
242
+ response: S
243
243
  };
244
244
  } else {
245
- if (m.type === "error")
246
- return n((k) => [
247
- ...k.filter(
248
- (y) => y.taskKey !== c
245
+ if (y.type === "error")
246
+ return r((S) => [
247
+ ...S.filter(
248
+ (f) => f.taskKey !== d
249
249
  ),
250
250
  {
251
- taskKey: c,
251
+ taskKey: d,
252
252
  triggeredAt: (/* @__PURE__ */ new Date()).toISOString(),
253
- streamId: l.stream.id,
253
+ streamId: u.stream.id,
254
254
  params: i,
255
- error: m.error,
255
+ error: y.error,
256
256
  progressItems: [],
257
257
  loading: !1,
258
258
  doneStreaming: !1,
@@ -261,22 +261,22 @@ const Z = (e) => {
261
261
  }
262
262
  ]), {
263
263
  type: "error",
264
- error: m.error
264
+ error: y.error
265
265
  };
266
266
  {
267
- const k = {
267
+ const S = {
268
268
  message: "No response received",
269
269
  code: "UnknownError"
270
270
  };
271
- return n((y) => [
272
- ...y.filter(
273
- (h) => h.taskKey !== c
271
+ return r((f) => [
272
+ ...f.filter(
273
+ (h) => h.taskKey !== d
274
274
  ),
275
275
  {
276
- taskKey: c,
276
+ taskKey: d,
277
277
  triggeredAt: (/* @__PURE__ */ new Date()).toISOString(),
278
- streamId: l.stream.id,
279
- error: k,
278
+ streamId: u.stream.id,
279
+ error: S,
280
280
  params: i,
281
281
  progressItems: [],
282
282
  loading: !1,
@@ -286,91 +286,91 @@ const Z = (e) => {
286
286
  }
287
287
  ]), {
288
288
  type: "error",
289
- error: k
289
+ error: S
290
290
  };
291
291
  }
292
292
  }
293
293
  } else
294
- return console.error(l.error), l;
294
+ return console.error(u.error), u;
295
295
  },
296
- [t, r, o]
297
- ), g = H(() => {
298
- if (r.length !== 0)
299
- return [...r].sort((i, s) => new Date(s.triggeredAt).getTime() - new Date(i.triggeredAt).getTime())[0];
300
- }, [r]);
301
- return C(() => () => {
302
- a.current.clear(), f.current.clear();
296
+ [t, n, c]
297
+ ), g = j(() => {
298
+ if (n.length !== 0)
299
+ return [...n].sort((i, s) => new Date(s.triggeredAt).getTime() - new Date(i.triggeredAt).getTime())[0];
300
+ }, [n]);
301
+ return w(() => () => {
302
+ a.current.clear(), m.current.clear();
303
303
  }, []), {
304
- agentTasks: r,
305
- createAgentTask: d,
304
+ agentTasks: n,
305
+ createAgentTask: o,
306
306
  latest: g
307
307
  };
308
308
  };
309
- async function ae(e, t) {
310
- const r = e.getReader();
311
- let n;
312
- for (; !(n = await r.read()).done; )
313
- t(n.value);
309
+ async function oe(e, t) {
310
+ const n = e.getReader();
311
+ let r;
312
+ for (; !(r = await n.read()).done; )
313
+ t(r.value);
314
314
  }
315
- function oe(e) {
316
- let t, r, n, a = !1;
317
- return function(o) {
318
- t === void 0 ? (t = o, r = 0, n = -1) : t = se(t, o);
319
- const d = t.length;
315
+ function ie(e) {
316
+ let t, n, r, a = !1;
317
+ return function(c) {
318
+ t === void 0 ? (t = c, n = 0, r = -1) : t = ce(t, c);
319
+ const o = t.length;
320
320
  let g = 0;
321
- for (; r < d; ) {
322
- a && (t[r] === 10 && (g = ++r), a = !1);
321
+ for (; n < o; ) {
322
+ a && (t[n] === 10 && (g = ++n), a = !1);
323
323
  let i = -1;
324
- for (; r < d && i === -1; ++r)
325
- switch (t[r]) {
324
+ for (; n < o && i === -1; ++n)
325
+ switch (t[n]) {
326
326
  case 58:
327
- n === -1 && (n = r - g);
327
+ r === -1 && (r = n - g);
328
328
  break;
329
329
  case 13:
330
330
  a = !0;
331
331
  case 10:
332
- i = r;
332
+ i = n;
333
333
  break;
334
334
  }
335
335
  if (i === -1)
336
336
  break;
337
- e(t.subarray(g, i), n), g = r, n = -1;
337
+ e(t.subarray(g, i), r), g = n, r = -1;
338
338
  }
339
- g === d ? t = void 0 : g !== 0 && (t = t.subarray(g), r -= g);
339
+ g === o ? t = void 0 : g !== 0 && (t = t.subarray(g), n -= g);
340
340
  };
341
341
  }
342
- function ie(e, t, r) {
343
- let n = z();
342
+ function se(e, t, n) {
343
+ let r = L();
344
344
  const a = new TextDecoder();
345
- return function(o, d) {
346
- if (o.length === 0)
347
- r == null || r(n), n = z();
348
- else if (d > 0) {
349
- const g = a.decode(o.subarray(0, d)), i = d + (o[d + 1] === 32 ? 2 : 1), s = a.decode(o.subarray(i));
345
+ return function(c, o) {
346
+ if (c.length === 0)
347
+ n == null || n(r), r = L();
348
+ else if (o > 0) {
349
+ const g = a.decode(c.subarray(0, o)), i = o + (c[o + 1] === 32 ? 2 : 1), s = a.decode(c.subarray(i));
350
350
  switch (g) {
351
351
  case "data":
352
- n.data = n.data ? n.data + `
352
+ r.data = r.data ? r.data + `
353
353
  ` + s : s;
354
354
  break;
355
355
  case "event":
356
- n.event = s;
356
+ r.event = s;
357
357
  break;
358
358
  case "id":
359
- e(n.id = s);
359
+ e(r.id = s);
360
360
  break;
361
361
  case "retry":
362
- const c = parseInt(s, 10);
363
- isNaN(c) || t(n.retry = c);
362
+ const d = parseInt(s, 10);
363
+ isNaN(d) || t(r.retry = d);
364
364
  break;
365
365
  }
366
366
  }
367
367
  };
368
368
  }
369
- function se(e, t) {
370
- const r = new Uint8Array(e.length + t.length);
371
- return r.set(e), r.set(t, e.length), r;
369
+ function ce(e, t) {
370
+ const n = new Uint8Array(e.length + t.length);
371
+ return n.set(e), n.set(t, e.length), n;
372
372
  }
373
- function z() {
373
+ function L() {
374
374
  return {
375
375
  data: "",
376
376
  event: "",
@@ -378,70 +378,70 @@ function z() {
378
378
  retry: void 0
379
379
  };
380
380
  }
381
- var ce = function(e, t) {
382
- var r = {};
383
- for (var n in e) Object.prototype.hasOwnProperty.call(e, n) && t.indexOf(n) < 0 && (r[n] = e[n]);
381
+ var le = function(e, t) {
382
+ var n = {};
383
+ for (var r in e) Object.prototype.hasOwnProperty.call(e, r) && t.indexOf(r) < 0 && (n[r] = e[r]);
384
384
  if (e != null && typeof Object.getOwnPropertySymbols == "function")
385
- for (var a = 0, n = Object.getOwnPropertySymbols(e); a < n.length; a++)
386
- t.indexOf(n[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, n[a]) && (r[n[a]] = e[n[a]]);
387
- return r;
385
+ for (var a = 0, r = Object.getOwnPropertySymbols(e); a < r.length; a++)
386
+ t.indexOf(r[a]) < 0 && Object.prototype.propertyIsEnumerable.call(e, r[a]) && (n[r[a]] = e[r[a]]);
387
+ return n;
388
388
  };
389
- const M = "text/event-stream", le = 1e3, j = "last-event-id";
390
- function $(e, t) {
391
- var { signal: r, headers: n, onopen: a, onmessage: f, onclose: o, onerror: d, openWhenHidden: g, fetch: i } = t, s = ce(t, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
392
- return new Promise((c, l) => {
393
- const b = Object.assign({}, n);
394
- b.accept || (b.accept = M);
395
- let m;
396
- function k() {
397
- m.abort(), document.hidden || P();
398
- }
399
- g || document.addEventListener("visibilitychange", k);
400
- let y = le, h = 0;
389
+ const D = "text/event-stream", de = 1e3, _ = "last-event-id";
390
+ function H(e, t) {
391
+ var { signal: n, headers: r, onopen: a, onmessage: m, onclose: c, onerror: o, openWhenHidden: g, fetch: i } = t, s = le(t, ["signal", "headers", "onopen", "onmessage", "onclose", "onerror", "openWhenHidden", "fetch"]);
392
+ return new Promise((d, u) => {
393
+ const b = Object.assign({}, r);
394
+ b.accept || (b.accept = D);
395
+ let y;
401
396
  function S() {
402
- document.removeEventListener("visibilitychange", k), window.clearTimeout(h), m.abort();
397
+ y.abort(), document.hidden || E();
398
+ }
399
+ g || document.addEventListener("visibilitychange", S);
400
+ let f = de, h = 0;
401
+ function k() {
402
+ document.removeEventListener("visibilitychange", S), window.clearTimeout(h), y.abort();
403
403
  }
404
- r == null || r.addEventListener("abort", () => {
405
- S(), c();
404
+ n == null || n.addEventListener("abort", () => {
405
+ k(), d();
406
406
  });
407
- const I = i ?? window.fetch, A = a ?? de;
408
- async function P() {
409
- var N;
410
- m = new AbortController();
407
+ const P = i ?? window.fetch, A = a ?? ue;
408
+ async function E() {
409
+ var F;
410
+ y = new AbortController();
411
411
  try {
412
- const R = await I(e, Object.assign(Object.assign({}, s), { headers: b, signal: m.signal }));
413
- await A(R), await ae(R.body, oe(ie((T) => {
414
- T ? b[j] = T : delete b[j];
415
- }, (T) => {
416
- y = T;
417
- }, f))), o == null || o(), S(), c();
418
- } catch (R) {
419
- if (!m.signal.aborted)
412
+ const p = await P(e, Object.assign(Object.assign({}, s), { headers: b, signal: y.signal }));
413
+ await A(p), await oe(p.body, ie(se((v) => {
414
+ v ? b[_] = v : delete b[_];
415
+ }, (v) => {
416
+ f = v;
417
+ }, m))), c == null || c(), k(), d();
418
+ } catch (p) {
419
+ if (!y.signal.aborted)
420
420
  try {
421
- const T = (N = d == null ? void 0 : d(R)) !== null && N !== void 0 ? N : y;
422
- window.clearTimeout(h), h = window.setTimeout(P, T);
423
- } catch (T) {
424
- S(), l(T);
421
+ const v = (F = o == null ? void 0 : o(p)) !== null && F !== void 0 ? F : f;
422
+ window.clearTimeout(h), h = window.setTimeout(E, v);
423
+ } catch (v) {
424
+ k(), u(v);
425
425
  }
426
426
  }
427
427
  }
428
- P();
428
+ E();
429
429
  });
430
430
  }
431
- function de(e) {
431
+ function ue(e) {
432
432
  const t = e.headers.get("content-type");
433
- if (!(t != null && t.startsWith(M)))
434
- throw new Error(`Expected content-type to be ${M}, Actual: ${t}`);
433
+ if (!(t != null && t.startsWith(D)))
434
+ throw new Error(`Expected content-type to be ${D}, Actual: ${t}`);
435
435
  }
436
- function Fe(e) {
437
- const [t, r] = v(null);
438
- return C(() => {
436
+ function De(e) {
437
+ const [t, n] = x(null);
438
+ return w(() => {
439
439
  if (!t)
440
440
  return;
441
- const n = new AbortController();
442
- return $(t, {
441
+ const r = new AbortController();
442
+ return H(t, {
443
443
  headers: e == null ? void 0 : e.headers,
444
- signal: n.signal,
444
+ signal: r.signal,
445
445
  async onopen(a) {
446
446
  if (!a.ok && a.status >= 400 && a.status < 500 && a.status !== 429)
447
447
  throw new Error(`Client error ${a.status}`);
@@ -453,43 +453,43 @@ function Fe(e) {
453
453
  }));
454
454
  },
455
455
  onerror(a) {
456
- throw console.error("EventSource error:", a), e == null || e.onError(t), r(null), a;
456
+ throw console.error("EventSource error:", a), e == null || e.onError(t), n(null), a;
457
457
  },
458
458
  onclose() {
459
459
  }
460
460
  }), () => {
461
- n.abort();
461
+ r.abort();
462
462
  };
463
463
  }, [t, e == null ? void 0 : e.headers]), {
464
- setSourceUrl: r,
464
+ setSourceUrl: n,
465
465
  sourceUrl: t
466
466
  };
467
467
  }
468
468
  function K(e) {
469
- const t = atob(e), r = new Uint8Array(t.length);
470
- for (let n = 0; n < t.length; n++)
471
- r[n] = t.charCodeAt(n);
472
- return new TextDecoder("utf-8").decode(r);
469
+ const t = atob(e), n = new Uint8Array(t.length);
470
+ for (let r = 0; r < t.length; r++)
471
+ n[r] = t.charCodeAt(r);
472
+ return new TextDecoder("utf-8").decode(n);
473
473
  }
474
- function Oe(e, t) {
475
- const [r, n] = v(
474
+ function Ue(e, t) {
475
+ const [n, r] = x(
476
476
  null
477
- ), [a, f] = v(
477
+ ), [a, m] = x(
478
478
  null
479
- ), o = O(), d = async (c) => {
480
- const l = await c.fetchTokens(), { fetchTokens: b, nextPageToken: m, previousPageToken: k, ...y } = c, h = await e({
481
- pk: o.fency.publishableKey,
482
- clientToken: l.clientToken,
483
- streamToken: l.streamToken,
479
+ ), c = M(), o = async (d) => {
480
+ const u = await d.fetchTokens(), { fetchTokens: b, nextPageToken: y, previousPageToken: S, ...f } = d, h = await e({
481
+ pk: c.fency.publishableKey,
482
+ clientToken: u.clientToken,
483
+ streamToken: u.streamToken,
484
484
  request: {
485
- ...y,
485
+ ...f,
486
486
  limit: (t == null ? void 0 : t.pageSize) ?? 50,
487
487
  pagination: {
488
- nextPageToken: m,
489
- previousPageToken: k
488
+ nextPageToken: y,
489
+ previousPageToken: S
490
490
  }
491
491
  },
492
- baseUrl: o.fency.baseUrl
492
+ baseUrl: c.fency.baseUrl
493
493
  });
494
494
  return h.type === "success" && h.items && h.pagination ? {
495
495
  type: "success",
@@ -508,15 +508,15 @@ function Oe(e, t) {
508
508
  };
509
509
  };
510
510
  return {
511
- fetchFirstPage: async (c) => {
512
- const l = await d({
513
- ...c,
511
+ fetchFirstPage: async (d) => {
512
+ const u = await o({
513
+ ...d,
514
514
  nextPageToken: void 0,
515
515
  previousPageToken: void 0
516
516
  });
517
- return l.type === "success" && (f(l.page), n(c)), l;
517
+ return u.type === "success" && (m(u.page), r(d)), u;
518
518
  },
519
- fetchNextPage: async (c) => {
519
+ fetchNextPage: async (d) => {
520
520
  if (a == null)
521
521
  return {
522
522
  type: "error",
@@ -533,14 +533,14 @@ function Oe(e, t) {
533
533
  message: "No next page"
534
534
  }
535
535
  };
536
- const l = await d({
537
- ...c,
536
+ const u = await o({
537
+ ...d,
538
538
  nextPageToken: a.pagination.nextPageToken,
539
539
  previousPageToken: void 0
540
540
  });
541
- return l.type === "success" && (f(l.page), n(c)), l;
541
+ return u.type === "success" && (m(u.page), r(d)), u;
542
542
  },
543
- fetchPreviousPage: async (c) => {
543
+ fetchPreviousPage: async (d) => {
544
544
  if (a == null)
545
545
  return {
546
546
  type: "error",
@@ -557,60 +557,60 @@ function Oe(e, t) {
557
557
  message: "No previous page"
558
558
  }
559
559
  };
560
- const l = await d({
561
- ...c,
560
+ const u = await o({
561
+ ...d,
562
562
  nextPageToken: void 0,
563
563
  previousPageToken: a.pagination.previousPageToken
564
564
  });
565
- return l.type === "success" && (f(l.page), n(c)), l;
565
+ return u.type === "success" && (m(u.page), r(d)), u;
566
566
  },
567
- refetchCurrentPage: async () => r == null ? {
567
+ refetchCurrentPage: async () => n == null ? {
568
568
  type: "error",
569
569
  error: {
570
570
  code: "NO_CURRENT_PAGE",
571
571
  message: "No current page, please call fetchFirstPage first."
572
572
  }
573
- } : d(r),
573
+ } : o(n),
574
574
  currentPage: a
575
575
  };
576
576
  }
577
- function ue(e) {
578
- return e.progressItems.map((t, r) => {
579
- const n = e.progressItems[r + 1], a = n != null;
580
- let f;
581
- if (n != null && n.createdAt) {
582
- const o = new Date(t.createdAt).getTime(), d = new Date(n.createdAt).getTime();
583
- f = Math.round((d - o) / 1e3);
577
+ function me(e) {
578
+ return e.progressItems.map((t, n) => {
579
+ const r = e.progressItems[n + 1], a = r != null;
580
+ let m;
581
+ if (r != null && r.createdAt) {
582
+ const c = new Date(t.createdAt).getTime(), o = new Date(r.createdAt).getTime();
583
+ m = Math.round((o - c) / 1e3);
584
584
  }
585
585
  return {
586
586
  item: t,
587
587
  completed: a,
588
- isLatest: r === e.progressItems.length - 1,
589
- durationSeconds: f
588
+ isLatest: n === e.progressItems.length - 1,
589
+ durationSeconds: m
590
590
  };
591
591
  });
592
592
  }
593
- function D({
593
+ function N({
594
594
  text: e,
595
595
  duration: t = 2,
596
- delay: r = 0,
597
- repeat: n = !0,
596
+ delay: n = 0,
597
+ repeat: r = !0,
598
598
  repeatDelay: a = 0.5,
599
- className: f,
600
- startOnView: o = !1,
601
- once: d = !1,
599
+ className: m,
600
+ startOnView: c = !1,
601
+ once: o = !1,
602
602
  inViewMargin: g,
603
603
  spread: i = 2,
604
604
  color: s = "#999",
605
- shimmerColor: c = "#000",
606
- direction: l = "fromBottom"
605
+ shimmerColor: d = "#000",
606
+ direction: u = "fromBottom"
607
607
  }) {
608
- const b = x(null), m = Y(b, { once: d, margin: g }), k = H(() => e.length * i, [e, i]), y = !o || m, h = l === "fromBottom" ? "100% center" : "-100% center", S = l === "fromBottom" ? "0% center" : "200% center";
609
- return /* @__PURE__ */ u(
610
- w.span,
608
+ const b = I(null), y = Y(b, { once: o, margin: g }), S = j(() => e.length * i, [e, i]), f = !c || y, h = u === "fromBottom" ? "100% center" : "-100% center", k = u === "fromBottom" ? "0% center" : "200% center";
609
+ return /* @__PURE__ */ l(
610
+ T.span,
611
611
  {
612
612
  ref: b,
613
- className: f,
613
+ className: m,
614
614
  style: {
615
615
  position: "relative",
616
616
  display: "inline-block",
@@ -620,9 +620,9 @@ function D({
620
620
  color: "transparent",
621
621
  WebkitTextFillColor: "transparent",
622
622
  backgroundRepeat: "no-repeat, padding-box",
623
- "--spread": `${k}px`,
623
+ "--spread": `${S}px`,
624
624
  "--base-color": s,
625
- "--shimmer-color": c,
625
+ "--shimmer-color": d,
626
626
  "--shimmer-bg": "linear-gradient(90deg, transparent calc(50% - var(--spread)), var(--shimmer-color), transparent calc(50% + var(--spread)))",
627
627
  backgroundImage: "var(--shimmer-bg), linear-gradient(var(--base-color), var(--base-color))"
628
628
  },
@@ -630,21 +630,21 @@ function D({
630
630
  backgroundPosition: h,
631
631
  opacity: 0
632
632
  },
633
- animate: y ? {
634
- backgroundPosition: S,
633
+ animate: f ? {
634
+ backgroundPosition: k,
635
635
  opacity: 1
636
636
  } : {},
637
637
  transition: {
638
638
  backgroundPosition: {
639
- repeat: n ? 1 / 0 : 0,
639
+ repeat: r ? 1 / 0 : 0,
640
640
  duration: t,
641
- delay: r,
641
+ delay: n,
642
642
  repeatDelay: a,
643
643
  ease: "linear"
644
644
  },
645
645
  opacity: {
646
646
  duration: 0.3,
647
- delay: r
647
+ delay: n
648
648
  }
649
649
  },
650
650
  children: e
@@ -660,35 +660,50 @@ function ge(e) {
660
660
  return t.title;
661
661
  case "GenericAgentTaskFinalResponse":
662
662
  return "Generating answer...";
663
- case "StreamingChatCompletionResponse":
663
+ case "GenericAgentTaskCompleted":
664
+ return "Completed";
665
+ case "StreamingChatCompletionText":
664
666
  return "Streaming...";
665
- case "StructuredChatCompletionResponse":
667
+ case "StructuredChatCompletionJson":
666
668
  return "Generating...";
669
+ case "StreamingMemoryTypeChatCompletionText":
670
+ return "Streaming...";
671
+ case "StreamingMemoryTypeChatCompletionSearch":
672
+ return "Searching...";
673
+ case "StreamingMemoryTypeChatCompletionFindSources":
674
+ return "Finding sources...";
675
+ case "StreamingMemoryTypeChatCompletionSourcesResult":
676
+ return "Sources found...";
677
+ case "StreamingMemoryTypeChatCompletionCompleted":
678
+ return "Completed";
667
679
  case "StreamingChatCompletionCompleted":
668
680
  return "Completed";
669
681
  case "StructuredChatCompletionCompleted":
670
682
  return "Completed";
671
- case "GenericAgentTaskCompleted":
672
- return "Completed";
673
683
  }
674
684
  }
675
- const me = ({
676
- progressViewItems: e
677
- }) => {
685
+ const ye = ({ progressViewItems: e }) => {
678
686
  const t = e[e.length - 1];
679
687
  if (!t) return null;
680
- const r = ge(t);
681
- return /* @__PURE__ */ u("div", { className: "simple-mode-container", children: /* @__PURE__ */ u(L, { mode: "wait", children: /* @__PURE__ */ u(
682
- w.div,
688
+ const n = ge(t);
689
+ return /* @__PURE__ */ l("div", { className: "simple-mode-container", children: /* @__PURE__ */ l(W, { mode: "wait", children: /* @__PURE__ */ l(
690
+ T.div,
683
691
  {
684
692
  initial: { opacity: 0, y: 10 },
685
693
  animate: { opacity: 1, y: 0 },
686
694
  exit: { opacity: 0, y: -10 },
687
695
  transition: { duration: 0.3 },
688
- children: t.completed ? /* @__PURE__ */ u("div", { className: "simple-mode-title", style: { color: "#666" }, children: r }) : /* @__PURE__ */ u(
689
- D,
696
+ children: t.completed ? /* @__PURE__ */ l(
697
+ "div",
690
698
  {
691
- text: r,
699
+ className: "simple-mode-title",
700
+ style: { color: "#666" },
701
+ children: n
702
+ }
703
+ ) : /* @__PURE__ */ l(
704
+ N,
705
+ {
706
+ text: n,
692
707
  className: "simple-mode-title",
693
708
  duration: 2.5,
694
709
  repeat: !0,
@@ -702,10 +717,10 @@ const me = ({
702
717
  }, fe = ({
703
718
  data: e,
704
719
  isLatest: t = !1,
705
- durationSeconds: r
706
- }) => /* @__PURE__ */ E("div", { style: { padding: "16px" }, children: [
707
- /* @__PURE__ */ u(
708
- w.div,
720
+ durationSeconds: n
721
+ }) => /* @__PURE__ */ C("div", { style: { padding: "16px" }, children: [
722
+ /* @__PURE__ */ l(
723
+ T.div,
709
724
  {
710
725
  style: {
711
726
  display: "flex",
@@ -716,8 +731,8 @@ const me = ({
716
731
  initial: { opacity: 0, y: -10 },
717
732
  animate: { opacity: 1, y: 0 },
718
733
  transition: { duration: 0.3, delay: 0 },
719
- children: t && !r ? /* @__PURE__ */ u(
720
- D,
734
+ children: t && !n ? /* @__PURE__ */ l(
735
+ N,
721
736
  {
722
737
  text: e.title,
723
738
  duration: 2.5,
@@ -725,10 +740,10 @@ const me = ({
725
740
  color: "#999",
726
741
  shimmerColor: "#000"
727
742
  }
728
- ) : /* @__PURE__ */ u("span", { style: { color: "#666" }, children: e.title })
743
+ ) : /* @__PURE__ */ l("span", { style: { color: "#666" }, children: e.title })
729
744
  }
730
745
  ),
731
- r !== void 0 && /* @__PURE__ */ E(
746
+ n !== void 0 && /* @__PURE__ */ C(
732
747
  "div",
733
748
  {
734
749
  style: {
@@ -739,12 +754,12 @@ const me = ({
739
754
  },
740
755
  children: [
741
756
  "Took ",
742
- r,
757
+ n,
743
758
  " seconds"
744
759
  ]
745
760
  }
746
761
  )
747
- ] }), U = {
762
+ ] }), O = {
748
763
  'code[class*="language-"]': {
749
764
  color: "#f8f8f2",
750
765
  background: "none",
@@ -895,70 +910,70 @@ const me = ({
895
910
  italic: {
896
911
  fontStyle: "italic"
897
912
  }
898
- }, ye = ({
913
+ }, he = ({
899
914
  data: e,
900
915
  streamToken: t,
901
- fetchClientToken: r,
902
- durationSeconds: n
916
+ fetchClientToken: n,
917
+ durationSeconds: r
903
918
  }) => {
904
- const { fency: a } = O(), f = B(
905
- async (o) => {
919
+ const { fency: a } = M(), m = U(
920
+ async (c) => {
906
921
  try {
907
- const { clientToken: d } = await r(), g = await V({
922
+ const { clientToken: o } = await n(), g = await J({
908
923
  pk: a.publishableKey,
909
924
  baseUrl: a.baseUrl,
910
- clientToken: d,
925
+ clientToken: o,
911
926
  streamToken: t,
912
- request: { fileId: o }
927
+ request: { fileId: c }
913
928
  });
914
929
  g.type === "success" && window.open(g.downloadLink, "_blank");
915
- } catch (d) {
916
- console.error("Failed to download file:", d);
930
+ } catch (o) {
931
+ console.error("Failed to download file:", o);
917
932
  }
918
933
  },
919
- [a, t, r]
934
+ [a, t, n]
920
935
  );
921
- return /* @__PURE__ */ E("div", { style: { padding: "16px" }, children: [
922
- /* @__PURE__ */ u(
923
- w.div,
936
+ return /* @__PURE__ */ C("div", { style: { padding: "16px" }, children: [
937
+ /* @__PURE__ */ l(
938
+ T.div,
924
939
  {
925
940
  className: "fency-markdown-body-raw",
926
941
  initial: { opacity: 0, y: -10 },
927
942
  animate: { opacity: 1, y: 0 },
928
943
  transition: { duration: 0.3, delay: 0 },
929
- children: /* @__PURE__ */ u(
930
- _,
944
+ children: /* @__PURE__ */ l(
945
+ B,
931
946
  {
932
- remarkPlugins: [G],
947
+ remarkPlugins: [z],
933
948
  components: {
934
- code(o) {
935
- const { children: d, className: g, node: i, ref: s, ...c } = o, l = /language-(\w+)/.exec(g || "");
936
- return l ? /* @__PURE__ */ u(
937
- F,
949
+ code(c) {
950
+ const { children: o, className: g, node: i, ref: s, ...d } = c, u = /language-(\w+)/.exec(g || "");
951
+ return u ? /* @__PURE__ */ l(
952
+ R,
938
953
  {
939
- ...c,
954
+ ...d,
940
955
  PreTag: "div",
941
- children: String(d).replace(/\n$/, ""),
942
- language: l[1],
943
- style: U
956
+ children: String(o).replace(/\n$/, ""),
957
+ language: u[1],
958
+ style: O
944
959
  }
945
- ) : /* @__PURE__ */ u("code", { ...c, className: g, children: String(d) });
960
+ ) : /* @__PURE__ */ l("code", { ...d, className: g, children: String(o) });
946
961
  },
947
- a(o) {
948
- const { children: d, href: g, ...i } = o;
949
- return /* @__PURE__ */ u(
962
+ a(c) {
963
+ const { children: o, href: g, ...i } = c;
964
+ return /* @__PURE__ */ l(
950
965
  "a",
951
966
  {
952
967
  ...i,
953
968
  href: g,
954
969
  onClick: (s) => {
955
970
  if (!g) return;
956
- const c = g.match(
971
+ const d = g.match(
957
972
  /\/files\/(fil_[a-zA-Z0-9]+)\/download/
958
973
  );
959
- c && (s.preventDefault(), f(c[1]));
974
+ d && (s.preventDefault(), m(d[1]));
960
975
  },
961
- children: d
976
+ children: o
962
977
  }
963
978
  );
964
979
  }
@@ -968,7 +983,7 @@ const me = ({
968
983
  )
969
984
  }
970
985
  ),
971
- n !== void 0 && /* @__PURE__ */ E(
986
+ r !== void 0 && /* @__PURE__ */ C(
972
987
  "div",
973
988
  {
974
989
  style: {
@@ -979,31 +994,31 @@ const me = ({
979
994
  },
980
995
  children: [
981
996
  "Thought for ",
982
- n,
997
+ r,
983
998
  " seconds"
984
999
  ]
985
1000
  }
986
1001
  )
987
1002
  ] });
988
- }, he = ({
1003
+ }, be = ({
989
1004
  data: e,
990
1005
  completed: t,
991
- isLatest: r = !1,
992
- durationSeconds: n
1006
+ isLatest: n = !1,
1007
+ durationSeconds: r
993
1008
  }) => {
994
- const a = x(null);
995
- return C(() => {
1009
+ const a = I(null);
1010
+ return w(() => {
996
1011
  a.current && !t && (a.current.scrollTop = a.current.scrollHeight);
997
- }, [e.reasoning, t]), /* @__PURE__ */ E("div", { style: { padding: "16px" }, children: [
998
- /* @__PURE__ */ u(
999
- w.h3,
1012
+ }, [e.reasoning, t]), /* @__PURE__ */ C("div", { style: { padding: "16px" }, children: [
1013
+ /* @__PURE__ */ l(
1014
+ T.h3,
1000
1015
  {
1001
1016
  style: { marginBottom: "10px", color: "#666" },
1002
1017
  initial: { opacity: 0, y: -10 },
1003
1018
  animate: { opacity: 1, y: 0 },
1004
1019
  transition: { duration: 0.3, delay: 0 },
1005
- children: r && !n ? /* @__PURE__ */ u(
1006
- D,
1020
+ children: n && !r ? /* @__PURE__ */ l(
1021
+ N,
1007
1022
  {
1008
1023
  text: e.title,
1009
1024
  duration: 2.5,
@@ -1014,8 +1029,8 @@ const me = ({
1014
1029
  ) : e.title
1015
1030
  }
1016
1031
  ),
1017
- /* @__PURE__ */ u(
1018
- w.div,
1032
+ /* @__PURE__ */ l(
1033
+ T.div,
1019
1034
  {
1020
1035
  ref: a,
1021
1036
  style: {
@@ -1030,23 +1045,23 @@ const me = ({
1030
1045
  initial: { opacity: 0, y: -10 },
1031
1046
  animate: { opacity: 0.5, y: 0 },
1032
1047
  transition: { duration: 0.3, delay: 0.1 },
1033
- children: /* @__PURE__ */ u("div", { className: "fency-markdown-body-raw", children: /* @__PURE__ */ u(
1034
- _,
1048
+ children: /* @__PURE__ */ l("div", { className: "fency-markdown-body-raw", children: /* @__PURE__ */ l(
1049
+ B,
1035
1050
  {
1036
- remarkPlugins: [G],
1051
+ remarkPlugins: [z],
1037
1052
  components: {
1038
- code(f) {
1039
- const { children: o, className: d, node: g, ref: i, ...s } = f, c = /language-(\w+)/.exec(d || "");
1040
- return c ? /* @__PURE__ */ u(
1041
- F,
1053
+ code(m) {
1054
+ const { children: c, className: o, node: g, ref: i, ...s } = m, d = /language-(\w+)/.exec(o || "");
1055
+ return d ? /* @__PURE__ */ l(
1056
+ R,
1042
1057
  {
1043
1058
  ...s,
1044
1059
  PreTag: "div",
1045
- children: String(o).replace(/\n$/, ""),
1046
- language: c[1],
1047
- style: U
1060
+ children: String(c).replace(/\n$/, ""),
1061
+ language: d[1],
1062
+ style: O
1048
1063
  }
1049
- ) : /* @__PURE__ */ u("code", { ...s, className: d, children: String(o) });
1064
+ ) : /* @__PURE__ */ l("code", { ...s, className: o, children: String(c) });
1050
1065
  }
1051
1066
  },
1052
1067
  children: e.reasoning
@@ -1054,7 +1069,7 @@ const me = ({
1054
1069
  ) })
1055
1070
  }
1056
1071
  ),
1057
- n !== void 0 && /* @__PURE__ */ E(
1072
+ r !== void 0 && /* @__PURE__ */ C(
1058
1073
  "div",
1059
1074
  {
1060
1075
  style: {
@@ -1065,64 +1080,201 @@ const me = ({
1065
1080
  },
1066
1081
  children: [
1067
1082
  "Thought for ",
1068
- n,
1083
+ r,
1069
1084
  " seconds"
1070
1085
  ]
1071
1086
  }
1072
1087
  )
1073
1088
  ] });
1074
- }, be = ({
1075
- data: e
1076
- }) => /* @__PURE__ */ u("div", { style: { padding: "16px" }, children: /* @__PURE__ */ u(
1077
- w.div,
1089
+ }, G = ({
1090
+ text: e
1091
+ }) => /* @__PURE__ */ l("div", { style: { padding: "16px" }, children: /* @__PURE__ */ l(
1092
+ T.div,
1078
1093
  {
1079
1094
  className: "fency-markdown-body-raw",
1080
1095
  initial: { opacity: 0, y: -10 },
1081
1096
  animate: { opacity: 1, y: 0 },
1082
1097
  transition: { duration: 0.3, delay: 0 },
1083
- children: /* @__PURE__ */ u(
1084
- _,
1098
+ children: /* @__PURE__ */ l(
1099
+ B,
1085
1100
  {
1086
- remarkPlugins: [G],
1101
+ remarkPlugins: [z],
1087
1102
  components: {
1088
1103
  code(t) {
1089
- const { children: r, className: n, node: a, ref: f, ...o } = t, d = /language-(\w+)/.exec(n || "");
1090
- return d ? /* @__PURE__ */ u(
1091
- F,
1104
+ const { children: n, className: r, node: a, ref: m, ...c } = t, o = /language-(\w+)/.exec(r || "");
1105
+ return o ? /* @__PURE__ */ l(
1106
+ R,
1092
1107
  {
1093
- ...o,
1108
+ ...c,
1094
1109
  PreTag: "div",
1095
- children: String(r).replace(/\n$/, ""),
1096
- language: d[1],
1097
- style: U
1110
+ children: String(n).replace(/\n$/, ""),
1111
+ language: o[1],
1112
+ style: O
1098
1113
  }
1099
- ) : /* @__PURE__ */ u("code", { ...o, className: n, children: String(r) });
1114
+ ) : /* @__PURE__ */ l("code", { ...c, className: r, children: String(n) });
1100
1115
  }
1101
1116
  },
1102
- children: e.response
1117
+ children: e
1103
1118
  }
1104
1119
  )
1105
1120
  }
1106
- ) }), ke = ({ data: e }) => {
1107
- const t = typeof e.response == "string" ? e.response : JSON.stringify(e.response, null, 2);
1108
- return /* @__PURE__ */ u("div", { id: "structured-chat-completion-response", children: /* @__PURE__ */ u(
1109
- w.div,
1121
+ ) }), Se = ({ data: e }) => {
1122
+ const t = JSON.stringify(e.json, null, 2);
1123
+ return /* @__PURE__ */ l("div", { id: "structured-chat-completion-response", children: /* @__PURE__ */ l(
1124
+ T.div,
1110
1125
  {
1111
1126
  initial: { opacity: 0, y: -10 },
1112
1127
  animate: { opacity: 1, y: 0 },
1113
1128
  transition: { duration: 0.3, delay: 0 },
1114
- children: /* @__PURE__ */ u(F, { language: "json", style: U, PreTag: "div", children: t })
1129
+ children: /* @__PURE__ */ l(R, { language: "json", style: O, PreTag: "div", children: t })
1115
1130
  }
1116
1131
  ) });
1117
- }, Se = ({ progressViewItems: e, streamToken: t, fetchClientToken: r, loadingText: n }) => {
1118
- const a = x(null);
1119
- C(() => {
1120
- a.current && (a.current.scrollTop = a.current.scrollHeight);
1132
+ }, ke = ({ data: e, isLatest: t = !1, durationSeconds: n }) => {
1133
+ const r = `Searching: ${e.queryDescription}`;
1134
+ return /* @__PURE__ */ C("div", { style: { padding: "16px" }, children: [
1135
+ /* @__PURE__ */ l(
1136
+ T.div,
1137
+ {
1138
+ style: {
1139
+ display: "flex",
1140
+ alignItems: "center",
1141
+ gap: "10px",
1142
+ color: "#666"
1143
+ },
1144
+ initial: { opacity: 0, y: -10 },
1145
+ animate: { opacity: 1, y: 0 },
1146
+ transition: { duration: 0.3, delay: 0 },
1147
+ children: t && !n ? /* @__PURE__ */ l(
1148
+ N,
1149
+ {
1150
+ text: r,
1151
+ duration: 2.5,
1152
+ repeat: !0,
1153
+ color: "#999",
1154
+ shimmerColor: "#000"
1155
+ }
1156
+ ) : /* @__PURE__ */ l("span", { style: { color: "#666" }, children: r })
1157
+ }
1158
+ ),
1159
+ n !== void 0 && /* @__PURE__ */ C(
1160
+ "div",
1161
+ {
1162
+ style: {
1163
+ fontSize: "12px",
1164
+ color: "#999",
1165
+ marginTop: "4px",
1166
+ fontStyle: "italic"
1167
+ },
1168
+ children: [
1169
+ "Took ",
1170
+ n,
1171
+ " seconds"
1172
+ ]
1173
+ }
1174
+ )
1175
+ ] });
1176
+ }, Ce = ({ isLatest: e = !1, durationSeconds: t }) => {
1177
+ const n = "Finding sources...";
1178
+ return /* @__PURE__ */ C("div", { style: { padding: "16px" }, children: [
1179
+ /* @__PURE__ */ l(
1180
+ T.div,
1181
+ {
1182
+ style: {
1183
+ display: "flex",
1184
+ alignItems: "center",
1185
+ gap: "10px",
1186
+ color: "#666"
1187
+ },
1188
+ initial: { opacity: 0, y: -10 },
1189
+ animate: { opacity: 1, y: 0 },
1190
+ transition: { duration: 0.3, delay: 0 },
1191
+ children: e && !t ? /* @__PURE__ */ l(
1192
+ N,
1193
+ {
1194
+ text: n,
1195
+ duration: 2.5,
1196
+ repeat: !0,
1197
+ color: "#999",
1198
+ shimmerColor: "#000"
1199
+ }
1200
+ ) : /* @__PURE__ */ l("span", { style: { color: "#666" }, children: n })
1201
+ }
1202
+ ),
1203
+ t !== void 0 && /* @__PURE__ */ C(
1204
+ "div",
1205
+ {
1206
+ style: {
1207
+ fontSize: "12px",
1208
+ color: "#999",
1209
+ marginTop: "4px",
1210
+ fontStyle: "italic"
1211
+ },
1212
+ children: [
1213
+ "Took ",
1214
+ t,
1215
+ " seconds"
1216
+ ]
1217
+ }
1218
+ )
1219
+ ] });
1220
+ }, Te = ({ data: e, onSourceClick: t }) => /* @__PURE__ */ C("div", { style: { padding: "16px" }, children: [
1221
+ /* @__PURE__ */ l(
1222
+ T.div,
1223
+ {
1224
+ style: { color: "#666", marginBottom: "10px", fontSize: "14px" },
1225
+ initial: { opacity: 0, y: -10 },
1226
+ animate: { opacity: 1, y: 0 },
1227
+ transition: { duration: 0.3, delay: 0 },
1228
+ children: "Sources"
1229
+ }
1230
+ ),
1231
+ /* @__PURE__ */ l("div", { style: { display: "flex", flexWrap: "wrap", gap: "8px" }, children: e.sources.map((n, r) => /* @__PURE__ */ l(
1232
+ ve,
1233
+ {
1234
+ source: n,
1235
+ index: r,
1236
+ onSourceClick: t
1237
+ },
1238
+ n.memoryId
1239
+ )) })
1240
+ ] }), ve = ({ source: e, index: t, onSourceClick: n }) => {
1241
+ const [r, a] = x(!1), m = !!n;
1242
+ return /* @__PURE__ */ C(
1243
+ T.div,
1244
+ {
1245
+ initial: { opacity: 0, scale: 0.9 },
1246
+ animate: { opacity: 1, scale: 1 },
1247
+ transition: { duration: 0.25, delay: t * 0.05 },
1248
+ onClick: m ? () => n(e.memoryId) : void 0,
1249
+ onMouseEnter: m ? () => a(!0) : void 0,
1250
+ onMouseLeave: m ? () => a(!1) : void 0,
1251
+ style: {
1252
+ display: "inline-flex",
1253
+ flexDirection: "column",
1254
+ gap: "4px",
1255
+ padding: "8px 12px",
1256
+ borderRadius: "8px",
1257
+ border: "1px solid #e0e0e0",
1258
+ backgroundColor: r ? "#f0f0f0" : "#f9f9f9",
1259
+ cursor: m ? "pointer" : "default",
1260
+ transition: "background-color 0.15s ease",
1261
+ userSelect: "none"
1262
+ },
1263
+ children: [
1264
+ /* @__PURE__ */ l("span", { style: { fontSize: "13px", fontWeight: 500, color: "#333" }, children: e.memoryId }),
1265
+ e.pageNumbers.length > 0 && /* @__PURE__ */ l("span", { style: { fontSize: "11px", color: "#888" }, children: e.pageNumbers.length === 1 ? `p. ${e.pageNumbers[0]}` : `pp. ${e.pageNumbers.join(", ")}` })
1266
+ ]
1267
+ }
1268
+ );
1269
+ }, xe = ({ progressViewItems: e, streamToken: t, fetchClientToken: n, loadingText: r, onSourceClick: a }) => {
1270
+ const m = I(null);
1271
+ w(() => {
1272
+ m.current && (m.current.scrollTop = m.current.scrollHeight);
1121
1273
  }, [e.length]);
1122
- const f = (o) => {
1274
+ const c = (o) => {
1123
1275
  switch (o.item.data.type) {
1124
1276
  case "GenericAgentTaskExecution":
1125
- return /* @__PURE__ */ u(
1277
+ return /* @__PURE__ */ l(
1126
1278
  fe,
1127
1279
  {
1128
1280
  data: o.item.data,
@@ -1132,8 +1284,8 @@ const me = ({
1132
1284
  }
1133
1285
  );
1134
1286
  case "GenericAgentTaskReasoning":
1135
- return /* @__PURE__ */ u(
1136
- he,
1287
+ return /* @__PURE__ */ l(
1288
+ be,
1137
1289
  {
1138
1290
  data: o.item.data,
1139
1291
  completed: o.completed,
@@ -1142,73 +1294,94 @@ const me = ({
1142
1294
  }
1143
1295
  );
1144
1296
  case "GenericAgentTaskFinalResponse":
1145
- return /* @__PURE__ */ u(
1146
- ye,
1297
+ return /* @__PURE__ */ l(
1298
+ he,
1147
1299
  {
1148
1300
  data: o.item.data,
1149
1301
  streamToken: t,
1150
- fetchClientToken: r,
1302
+ fetchClientToken: n,
1303
+ durationSeconds: o.durationSeconds
1304
+ }
1305
+ );
1306
+ case "StreamingChatCompletionText":
1307
+ return /* @__PURE__ */ l(G, { text: o.item.data.text });
1308
+ case "StructuredChatCompletionJson":
1309
+ return /* @__PURE__ */ l(Se, { data: o.item.data });
1310
+ case "StreamingMemoryTypeChatCompletionText":
1311
+ return /* @__PURE__ */ l(G, { text: o.item.data.text });
1312
+ case "StreamingMemoryTypeChatCompletionSearch":
1313
+ return /* @__PURE__ */ l(
1314
+ ke,
1315
+ {
1316
+ data: o.item.data,
1317
+ isLatest: o.isLatest,
1318
+ durationSeconds: o.durationSeconds
1319
+ }
1320
+ );
1321
+ case "StreamingMemoryTypeChatCompletionFindSources":
1322
+ return /* @__PURE__ */ l(
1323
+ Ce,
1324
+ {
1325
+ data: o.item.data,
1326
+ isLatest: o.isLatest,
1151
1327
  durationSeconds: o.durationSeconds
1152
1328
  }
1153
1329
  );
1154
- case "StreamingChatCompletionResponse":
1155
- return /* @__PURE__ */ u(be, { data: o.item.data });
1156
- case "StructuredChatCompletionResponse":
1157
- return /* @__PURE__ */ u(ke, { data: o.item.data });
1330
+ case "StreamingMemoryTypeChatCompletionSourcesResult":
1331
+ return /* @__PURE__ */ l(
1332
+ Te,
1333
+ {
1334
+ data: o.item.data,
1335
+ onSourceClick: a
1336
+ }
1337
+ );
1158
1338
  default:
1159
1339
  return null;
1160
1340
  }
1161
1341
  };
1162
- return e.length === 0 ? /* @__PURE__ */ u("div", { style: { width: "fit-content" }, children: /* @__PURE__ */ u(
1163
- D,
1342
+ return e.length === 0 ? /* @__PURE__ */ l("div", { style: { width: "fit-content" }, children: /* @__PURE__ */ l(
1343
+ N,
1164
1344
  {
1165
- text: n ?? "Processing your task...",
1345
+ text: r ?? "Processing your task...",
1166
1346
  duration: 1.5,
1167
1347
  repeat: !0,
1168
1348
  repeatDelay: 0,
1169
1349
  color: "#999",
1170
1350
  shimmerColor: "#000"
1171
1351
  }
1172
- ) }) : /* @__PURE__ */ u(
1173
- "div",
1352
+ ) }) : /* @__PURE__ */ l("div", { id: "agent-task-progress-verbose", ref: m, children: /* @__PURE__ */ l(W, { children: e.map((o, g) => /* @__PURE__ */ l(
1353
+ T.div,
1174
1354
  {
1175
- id: "agent-task-progress-verbose",
1176
- ref: a,
1177
- children: /* @__PURE__ */ u(L, { children: e.map((o, d) => /* @__PURE__ */ u(
1178
- w.div,
1179
- {
1180
- id: `agent-task-progress-item-${o.item.progressItemId}`,
1181
- initial: { opacity: 0, y: -20 },
1182
- animate: { opacity: 1, y: 0 },
1183
- transition: {
1184
- duration: 0.4,
1185
- delay: d * 0.1,
1186
- ease: "easeOut"
1187
- },
1188
- children: f(o)
1189
- },
1190
- o.item.progressItemId
1191
- )) })
1192
- }
1193
- );
1194
- }, De = ({
1355
+ id: `agent-task-progress-item-${o.item.progressItemId}`,
1356
+ initial: { opacity: 0, y: -20 },
1357
+ animate: { opacity: 1, y: 0 },
1358
+ transition: {
1359
+ duration: 0.4,
1360
+ delay: g * 0.1,
1361
+ ease: "easeOut"
1362
+ },
1363
+ children: c(o)
1364
+ },
1365
+ o.item.progressItemId
1366
+ )) }) });
1367
+ }, Be = ({
1195
1368
  agentTask: e,
1196
1369
  mode: t = "verbose",
1197
- streamToken: r,
1198
- fetchClientToken: n
1370
+ streamToken: n,
1371
+ fetchClientToken: r
1199
1372
  }) => {
1200
- const a = ue(e);
1201
- return t === "simple" ? /* @__PURE__ */ u(me, { progressViewItems: a }) : /* @__PURE__ */ u(
1202
- Se,
1373
+ const a = me(e);
1374
+ return t === "simple" ? /* @__PURE__ */ l(ye, { progressViewItems: a }) : /* @__PURE__ */ l(
1375
+ xe,
1203
1376
  {
1204
1377
  progressViewItems: a,
1205
- streamToken: r,
1206
- fetchClientToken: n,
1378
+ streamToken: n,
1379
+ fetchClientToken: r,
1207
1380
  loadingText: e.loadingText
1208
1381
  }
1209
1382
  );
1210
1383
  };
1211
- class Te {
1384
+ class we {
1212
1385
  constructor(t) {
1213
1386
  this.eventSources = /* @__PURE__ */ new Map(), this.subscribers = /* @__PURE__ */ new Map(), this.fency = t;
1214
1387
  }
@@ -1217,37 +1390,37 @@ class Te {
1217
1390
  * Creates new connections and removes old ones.
1218
1391
  */
1219
1392
  updateStreams(t) {
1220
- t.forEach((n) => {
1221
- const a = n.stream.id;
1222
- this.eventSources.has(a) || this.connectStream(n);
1393
+ t.forEach((r) => {
1394
+ const a = r.stream.id;
1395
+ this.eventSources.has(a) || this.connectStream(r);
1223
1396
  });
1224
- const r = new Set(t.map((n) => n.stream.id));
1225
- this.eventSources.forEach((n, a) => {
1226
- r.has(a) || (n.abort(), this.eventSources.delete(a));
1397
+ const n = new Set(t.map((r) => r.stream.id));
1398
+ this.eventSources.forEach((r, a) => {
1399
+ n.has(a) || (r.abort(), this.eventSources.delete(a));
1227
1400
  });
1228
1401
  }
1229
1402
  connectStream(t) {
1230
- const r = t.stream.id, n = new AbortController();
1231
- this.eventSources.set(r, n);
1232
- const a = `${this.fency.baseUrl}/sse/streams/${r}`, f = {
1403
+ const n = t.stream.id, r = new AbortController();
1404
+ this.eventSources.set(n, r);
1405
+ const a = `${this.fency.baseUrl}/sse/streams/${n}`, m = {
1233
1406
  "X-Fency-Publishable-Key": this.fency.publishableKey,
1234
1407
  "X-Fency-Stream-Token": t.stream.token
1235
1408
  };
1236
- $(a, {
1237
- headers: f,
1238
- signal: n.signal,
1239
- async onopen(o) {
1240
- if (!o.ok && o.status >= 400 && o.status < 500 && o.status !== 429)
1241
- throw new Error(`Client error ${o.status}`);
1409
+ H(a, {
1410
+ headers: m,
1411
+ signal: r.signal,
1412
+ async onopen(c) {
1413
+ if (!c.ok && c.status >= 400 && c.status < 500 && c.status !== 429)
1414
+ throw new Error(`Client error ${c.status}`);
1242
1415
  },
1243
- onmessage: (o) => {
1244
- if (o.data) {
1245
- const d = K(o.data);
1246
- this.broadcast(d, r);
1416
+ onmessage: (c) => {
1417
+ if (c.data) {
1418
+ const o = K(c.data);
1419
+ this.broadcast(o, n);
1247
1420
  }
1248
1421
  },
1249
- onerror: (o) => {
1250
- throw console.error("EventSource error for stream", r, ":", o), this.broadcastError(r), o;
1422
+ onerror: (c) => {
1423
+ throw console.error("EventSource error for stream", n, ":", c), this.broadcastError(n), c;
1251
1424
  },
1252
1425
  onclose() {
1253
1426
  }
@@ -1257,19 +1430,19 @@ class Te {
1257
1430
  * Subscribe to events from all active streams.
1258
1431
  * Returns an unsubscribe function.
1259
1432
  */
1260
- subscribe(t, r) {
1261
- return this.subscribers.set(t, r), () => {
1433
+ subscribe(t, n) {
1434
+ return this.subscribers.set(t, n), () => {
1262
1435
  this.subscribers.delete(t);
1263
1436
  };
1264
1437
  }
1265
- broadcast(t, r) {
1266
- this.subscribers.forEach((n) => {
1267
- n.onMessage(t, r);
1438
+ broadcast(t, n) {
1439
+ this.subscribers.forEach((r) => {
1440
+ r.onMessage(t, n);
1268
1441
  });
1269
1442
  }
1270
1443
  broadcastError(t) {
1271
- this.subscribers.forEach((r) => {
1272
- r.onError(t);
1444
+ this.subscribers.forEach((n) => {
1445
+ n.onError(t);
1273
1446
  });
1274
1447
  }
1275
1448
  /**
@@ -1279,90 +1452,94 @@ class Te {
1279
1452
  this.eventSources.forEach((t) => t.abort()), this.eventSources.clear(), this.subscribers.clear();
1280
1453
  }
1281
1454
  }
1282
- const ve = 12e4, Ce = (e) => {
1455
+ const Ae = 12e4, Ie = (e) => {
1283
1456
  const t = Date.now();
1284
- return e.filter((r) => t - r.createdAt < ve);
1457
+ return e.filter((n) => t - n.createdAt < Ae);
1285
1458
  };
1286
- function Ue({ fency: e, fetchCreateStreamClientToken: t, children: r }) {
1287
- const [n, a] = v(
1459
+ function ze({ fency: e, fetchCreateStreamClientToken: t, children: n }) {
1460
+ const [r, a] = x(
1288
1461
  null
1289
- ), [f, o] = v(!0), [d, g] = v(null), [i, s] = v([]), c = x(null), l = x(null);
1290
- C(() => {
1291
- e.then((y) => {
1292
- a(y), o(!1);
1293
- }).catch((y) => {
1294
- g(y), o(!1);
1462
+ ), [m, c] = x(!0), [o, g] = x(null), [i, s] = x([]), d = I(null), u = I(null);
1463
+ w(() => {
1464
+ e.then((f) => {
1465
+ a(f), c(!1);
1466
+ }).catch((f) => {
1467
+ g(f), c(!1);
1295
1468
  });
1296
- }, [e]), C(() => {
1297
- n && !l.current && (l.current = new Te(n));
1298
- }, [n]), C(() => {
1299
- l.current && l.current.updateStreams(i);
1300
- }, [i]), C(() => () => {
1301
- var y;
1302
- (y = l.current) == null || y.cleanup();
1469
+ }, [e]), w(() => {
1470
+ r && !u.current && (u.current = new we(r));
1471
+ }, [r]), w(() => {
1472
+ u.current && u.current.updateStreams(i);
1473
+ }, [i]), w(() => () => {
1474
+ var f;
1475
+ (f = u.current) == null || f.cleanup();
1303
1476
  }, []);
1304
- const b = B(
1305
- async (y = 3e4) => {
1306
- if (c.current)
1307
- return c.current;
1308
- const h = Date.now(), S = i.length > 0 ? i[i.length - 1] : null;
1309
- if (S && h - S.createdAt < y)
1310
- return S.stream;
1311
- const I = (async () => {
1312
- if (!n)
1477
+ const b = U(
1478
+ async (f = 3e4) => {
1479
+ if (d.current)
1480
+ return d.current;
1481
+ const h = Date.now(), k = i.length > 0 ? i[i.length - 1] : null;
1482
+ if (k && h - k.createdAt < f)
1483
+ return k.stream;
1484
+ const P = (async () => {
1485
+ if (!r)
1313
1486
  throw new Error("Fency instance not initialized");
1314
- const A = await t(), P = await X({
1315
- pk: n.publishableKey,
1316
- baseUrl: n.baseUrl,
1487
+ const A = await t(), E = await V({
1488
+ pk: r.publishableKey,
1489
+ baseUrl: r.baseUrl,
1317
1490
  clientToken: (A == null ? void 0 : A.clientToken) ?? ""
1318
1491
  });
1319
- if (P.type === "success") {
1320
- const N = {
1321
- stream: P.stream,
1492
+ if (E.type === "success") {
1493
+ const F = {
1494
+ stream: E.stream,
1322
1495
  createdAt: Date.now()
1323
1496
  };
1324
- return s((R) => {
1325
- const T = [...R, N];
1326
- return Ce(T);
1327
- }), c.current = null, P.stream;
1497
+ return s((p) => {
1498
+ const v = [...p, F];
1499
+ return Ie(v);
1500
+ }), d.current = null, E.stream;
1328
1501
  } else
1329
- throw c.current = null, new Error("Failed to create stream");
1502
+ throw d.current = null, new Error("Failed to create stream");
1330
1503
  })();
1331
- return c.current = I, I;
1504
+ return d.current = P, P;
1332
1505
  },
1333
- [n, i]
1506
+ [r, i]
1334
1507
  );
1335
- if (d)
1336
- return /* @__PURE__ */ E("div", { children: [
1508
+ if (o)
1509
+ return /* @__PURE__ */ C("div", { children: [
1337
1510
  "Fency error: ",
1338
- d.message
1511
+ o.message
1339
1512
  ] });
1340
- if (!n)
1513
+ if (!r)
1341
1514
  return null;
1342
- const m = i.length > 0 ? i[i.length - 1] : null, k = {
1343
- fency: n,
1344
- loading: f,
1345
- error: d,
1515
+ const y = i.length > 0 ? i[i.length - 1] : null, S = {
1516
+ fency: r,
1517
+ loading: m,
1518
+ error: o,
1346
1519
  activeStreams: i,
1347
- latestStream: m,
1348
- eventManager: l.current,
1520
+ latestStream: y,
1521
+ eventManager: u.current,
1349
1522
  getOrCreateStream: b
1350
1523
  };
1351
- return /* @__PURE__ */ u(W.Provider, { value: k, children: r });
1524
+ return /* @__PURE__ */ l($.Provider, { value: S, children: n });
1352
1525
  }
1353
1526
  export {
1354
- De as AgentTaskProgress,
1355
- me as AgentTaskProgressSimple,
1356
- Se as AgentTaskProgressVerbose,
1357
- Ue as FencyProvider,
1527
+ Be as AgentTaskProgress,
1528
+ ye as AgentTaskProgressSimple,
1529
+ xe as AgentTaskProgressVerbose,
1530
+ ze as FencyProvider,
1358
1531
  fe as GenericAgentTaskExecution,
1359
- ye as GenericAgentTaskFinalResponse,
1360
- he as GenericAgentTaskReasoning,
1361
- D as ShimmeringText,
1362
- be as StreamingChatCompletionResponse,
1363
- Ne as useAgentTasks,
1364
- O as useFencyContext,
1365
- Fe as useFencyEventSource,
1366
- Oe as usePaginatedQuery,
1367
- re as useStream
1532
+ he as GenericAgentTaskFinalResponse,
1533
+ be as GenericAgentTaskReasoning,
1534
+ N as ShimmeringText,
1535
+ G as StreamingChatCompletionText,
1536
+ Ce as StreamingMemoryTypeChatCompletionFindSources,
1537
+ ke as StreamingMemoryTypeChatCompletionSearch,
1538
+ Te as StreamingMemoryTypeChatCompletionSourcesResult,
1539
+ Se as StructuredChatCompletionJson,
1540
+ Oe as useAgentTasks,
1541
+ M as useFencyContext,
1542
+ De as useFencyEventSource,
1543
+ Ue as usePaginatedQuery,
1544
+ ae as useStream
1368
1545
  };