@agno-hq/chat-react 0.1.1 → 0.3.0
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/README.md +324 -20
- package/dist/chat/index.cjs +314 -0
- package/dist/chat/index.cjs.map +1 -0
- package/dist/chat/index.d.cts +1225 -0
- package/dist/chat/index.d.ts +1225 -0
- package/dist/chat/index.js +5 -0
- package/dist/chat/index.js.map +1 -0
- package/dist/chunk-2WM3CCFE.cjs +106 -0
- package/dist/chunk-2WM3CCFE.cjs.map +1 -0
- package/dist/chunk-62IEW2HM.js +506 -0
- package/dist/chunk-62IEW2HM.js.map +1 -0
- package/dist/chunk-ERCKKOF4.cjs +3308 -0
- package/dist/chunk-ERCKKOF4.cjs.map +1 -0
- package/dist/chunk-MUOMZG4V.js +3226 -0
- package/dist/chunk-MUOMZG4V.js.map +1 -0
- package/dist/chunk-RE7ZT73K.js +102 -0
- package/dist/chunk-RE7ZT73K.js.map +1 -0
- package/dist/chunk-ROFIOWGX.cjs +530 -0
- package/dist/chunk-ROFIOWGX.cjs.map +1 -0
- package/dist/client-DUyVqxU9.d.cts +413 -0
- package/dist/client-DUyVqxU9.d.ts +413 -0
- package/dist/core/index.cjs +94 -0
- package/dist/core/index.cjs.map +1 -0
- package/dist/core/index.d.cts +108 -0
- package/dist/core/index.d.ts +108 -0
- package/dist/core/index.js +5 -0
- package/dist/core/index.js.map +1 -0
- package/dist/fonts.css +18 -0
- package/dist/index.cjs +395 -1954
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +12 -835
- package/dist/index.d.ts +12 -835
- package/dist/index.js +3 -1920
- package/dist/index.js.map +1 -1
- package/dist/styles.css +1898 -662
- package/dist/tokens.css +111 -0
- package/package.json +50 -7
package/dist/index.cjs
CHANGED
|
@@ -1,1962 +1,403 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
'use strict';
|
|
3
3
|
|
|
4
|
-
var
|
|
5
|
-
var
|
|
4
|
+
var chunkERCKKOF4_cjs = require('./chunk-ERCKKOF4.cjs');
|
|
5
|
+
var chunk2WM3CCFE_cjs = require('./chunk-2WM3CCFE.cjs');
|
|
6
|
+
var chunkROFIOWGX_cjs = require('./chunk-ROFIOWGX.cjs');
|
|
6
7
|
|
|
7
|
-
// src/useAgnoChat.ts
|
|
8
8
|
|
|
9
|
-
// src/stream.ts
|
|
10
|
-
function isEnvelope(data) {
|
|
11
|
-
return typeof data === "object" && data !== null && "event" in data && "data" in data && typeof data.event === "string";
|
|
12
|
-
}
|
|
13
|
-
function isFlatEvent(data) {
|
|
14
|
-
return typeof data === "object" && data !== null && "event" in data && !("data" in data) && typeof data.event === "string";
|
|
15
|
-
}
|
|
16
|
-
function normaliseEnvelope(env) {
|
|
17
|
-
let parsed = {};
|
|
18
|
-
if (typeof env.data === "string") {
|
|
19
|
-
try {
|
|
20
|
-
parsed = JSON.parse(env.data);
|
|
21
|
-
} catch {
|
|
22
|
-
parsed = {};
|
|
23
|
-
}
|
|
24
|
-
} else if (env.data && typeof env.data === "object") {
|
|
25
|
-
parsed = env.data;
|
|
26
|
-
}
|
|
27
|
-
return { event: env.event, ...parsed };
|
|
28
|
-
}
|
|
29
|
-
function drainBuffer(buffer, onEvent) {
|
|
30
|
-
let start = buffer.indexOf("{");
|
|
31
|
-
while (start !== -1 && start < buffer.length) {
|
|
32
|
-
let depth = 0;
|
|
33
|
-
let inString = false;
|
|
34
|
-
let escape = false;
|
|
35
|
-
let end = -1;
|
|
36
|
-
for (let i = start; i < buffer.length; i++) {
|
|
37
|
-
const ch = buffer[i];
|
|
38
|
-
if (inString) {
|
|
39
|
-
if (escape) escape = false;
|
|
40
|
-
else if (ch === "\\") escape = true;
|
|
41
|
-
else if (ch === '"') inString = false;
|
|
42
|
-
} else if (ch === '"') {
|
|
43
|
-
inString = true;
|
|
44
|
-
} else if (ch === "{") {
|
|
45
|
-
depth++;
|
|
46
|
-
} else if (ch === "}") {
|
|
47
|
-
depth--;
|
|
48
|
-
if (depth === 0) {
|
|
49
|
-
end = i;
|
|
50
|
-
break;
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
}
|
|
54
|
-
if (end === -1) break;
|
|
55
|
-
const slice = buffer.slice(start, end + 1);
|
|
56
|
-
try {
|
|
57
|
-
const parsed = JSON.parse(slice);
|
|
58
|
-
if (isEnvelope(parsed)) onEvent(normaliseEnvelope(parsed));
|
|
59
|
-
else if (isFlatEvent(parsed)) onEvent(parsed);
|
|
60
|
-
} catch {
|
|
61
|
-
start = buffer.indexOf("{", start + 1);
|
|
62
|
-
continue;
|
|
63
|
-
}
|
|
64
|
-
buffer = buffer.slice(end + 1).trim();
|
|
65
|
-
start = buffer.indexOf("{");
|
|
66
|
-
}
|
|
67
|
-
return buffer;
|
|
68
|
-
}
|
|
69
|
-
async function streamRun(options) {
|
|
70
|
-
const { url, body, headers = {}, signal, onEvent, onError, onComplete } = options;
|
|
71
|
-
let buffer = "";
|
|
72
|
-
try {
|
|
73
|
-
const response = await fetch(url, {
|
|
74
|
-
method: "POST",
|
|
75
|
-
headers: {
|
|
76
|
-
...!(body instanceof FormData) && { "Content-Type": "application/json" },
|
|
77
|
-
...headers
|
|
78
|
-
},
|
|
79
|
-
body: body instanceof FormData ? body : JSON.stringify(body),
|
|
80
|
-
signal
|
|
81
|
-
});
|
|
82
|
-
if (!response.ok) {
|
|
83
|
-
let detail;
|
|
84
|
-
try {
|
|
85
|
-
const err = await response.json();
|
|
86
|
-
detail = err?.detail ? String(err.detail) : `${response.status} ${response.statusText}`;
|
|
87
|
-
} catch {
|
|
88
|
-
detail = `${response.status} ${response.statusText}`;
|
|
89
|
-
}
|
|
90
|
-
throw new Error(detail);
|
|
91
|
-
}
|
|
92
|
-
if (!response.body) throw new Error("No response body");
|
|
93
|
-
const reader = response.body.getReader();
|
|
94
|
-
const decoder = new TextDecoder();
|
|
95
|
-
for (; ; ) {
|
|
96
|
-
const { done, value } = await reader.read();
|
|
97
|
-
if (done) {
|
|
98
|
-
buffer = drainBuffer(buffer, onEvent);
|
|
99
|
-
onComplete();
|
|
100
|
-
return;
|
|
101
|
-
}
|
|
102
|
-
buffer += decoder.decode(value, { stream: true });
|
|
103
|
-
buffer = drainBuffer(buffer, onEvent);
|
|
104
|
-
}
|
|
105
|
-
} catch (error) {
|
|
106
|
-
if (error instanceof DOMException && error.name === "AbortError") {
|
|
107
|
-
onComplete();
|
|
108
|
-
return;
|
|
109
|
-
}
|
|
110
|
-
onError(error instanceof Error ? error : new Error(String(error)));
|
|
111
|
-
}
|
|
112
|
-
}
|
|
113
9
|
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
}
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
}
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
}
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
}
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
function
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
}
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
function
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
function
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
}
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
var nextId = () => `m${Date.now().toString(36)}-${(messageCounter++).toString(36)}`;
|
|
507
|
-
var nowSeconds = () => Math.floor(Date.now() / 1e3);
|
|
508
|
-
function useAgnoChat(options) {
|
|
509
|
-
const { entity, userId, onEvent, onSessionId } = options;
|
|
510
|
-
const client = react.useMemo(() => {
|
|
511
|
-
if (options.client) return options.client;
|
|
512
|
-
return new AgnoClient({ baseUrl: options.baseUrl ?? "", headers: options.headers });
|
|
513
|
-
}, [options.client, options.baseUrl, JSON.stringify(options.headers)]);
|
|
514
|
-
const [messages, setMessages] = react.useState(options.initialMessages ?? []);
|
|
515
|
-
const [events, setEvents] = react.useState([]);
|
|
516
|
-
const [currentEvent, setCurrentEvent] = react.useState(null);
|
|
517
|
-
const [status, setStatus] = react.useState("idle");
|
|
518
|
-
const [activity, setActivity] = react.useState(null);
|
|
519
|
-
const [error, setError] = react.useState(null);
|
|
520
|
-
const [sessionId, setSessionId] = react.useState(options.sessionId);
|
|
521
|
-
const [sessions, setSessions] = react.useState([]);
|
|
522
|
-
const [sessionsLoading, setSessionsLoading] = react.useState(false);
|
|
523
|
-
const abortRef = react.useRef(null);
|
|
524
|
-
const activeMsgIdRef = react.useRef(null);
|
|
525
|
-
const runIdRef = react.useRef(void 0);
|
|
526
|
-
const entityRef = react.useRef(entity);
|
|
527
|
-
const sessionIdRef = react.useRef(options.sessionId);
|
|
528
|
-
react.useEffect(() => {
|
|
529
|
-
entityRef.current = entity;
|
|
530
|
-
}, [entity]);
|
|
531
|
-
react.useEffect(() => {
|
|
532
|
-
sessionIdRef.current = sessionId;
|
|
533
|
-
}, [sessionId]);
|
|
534
|
-
const patchActive = react.useCallback((patch) => {
|
|
535
|
-
const id2 = activeMsgIdRef.current;
|
|
536
|
-
if (!id2) return;
|
|
537
|
-
setMessages((prev) => prev.map((m) => m.id === id2 ? patch(m) : m));
|
|
538
|
-
}, []);
|
|
539
|
-
const applyEvent = react.useCallback(
|
|
540
|
-
(e) => {
|
|
541
|
-
setEvents((prev) => [...prev, e]);
|
|
542
|
-
setCurrentEvent(e);
|
|
543
|
-
onEvent?.(e);
|
|
544
|
-
const label2 = activityLabel(e);
|
|
545
|
-
if (label2) setActivity(label2);
|
|
546
|
-
if (e.session_id && e.session_id !== sessionIdRef.current) {
|
|
547
|
-
sessionIdRef.current = e.session_id;
|
|
548
|
-
setSessionId(e.session_id);
|
|
549
|
-
onSessionId?.(e.session_id);
|
|
550
|
-
}
|
|
551
|
-
if (e.run_id && !e.parent_run_id) runIdRef.current = e.run_id;
|
|
552
|
-
if (isSubRunEvent(e)) {
|
|
553
|
-
const kind = entityRef.current?.type === "workflow" ? "executor" : "member";
|
|
554
|
-
patchActive((m) => applySubRunEvent(m, e, kind));
|
|
555
|
-
return;
|
|
556
|
-
}
|
|
557
|
-
if (isStepEvent(e)) {
|
|
558
|
-
patchActive((m) => applyStepEvent(m, e));
|
|
559
|
-
return;
|
|
560
|
-
}
|
|
561
|
-
if (isStartedEvent(e)) {
|
|
562
|
-
patchActive((m) => ({ ...m, run_id: e.run_id ?? m.run_id, session_id: e.session_id ?? m.session_id, status: "streaming" }));
|
|
563
|
-
return;
|
|
564
|
-
}
|
|
565
|
-
if (isToolEvent(e)) {
|
|
566
|
-
const incoming = toolsFromEvent(e);
|
|
567
|
-
if (incoming.length) {
|
|
568
|
-
patchActive((m) => {
|
|
569
|
-
let tool_calls = m.tool_calls ?? [];
|
|
570
|
-
for (const t of incoming) tool_calls = mergeTool(tool_calls, t);
|
|
571
|
-
return { ...m, tool_calls };
|
|
572
|
-
});
|
|
573
|
-
}
|
|
574
|
-
return;
|
|
575
|
-
}
|
|
576
|
-
if (isContentEvent(e)) {
|
|
577
|
-
patchActive((m) => applyContentEvent(m, e));
|
|
578
|
-
return;
|
|
579
|
-
}
|
|
580
|
-
if (isReasoningStepEvent(e)) {
|
|
581
|
-
const incoming = e.reasoning_steps ?? e.extra_data?.reasoning_steps ?? [];
|
|
582
|
-
if (incoming.length) {
|
|
583
|
-
patchActive((m) => ({
|
|
584
|
-
...m,
|
|
585
|
-
reasoning_steps: [...m.reasoning_steps ?? [], ...incoming]
|
|
586
|
-
}));
|
|
587
|
-
}
|
|
588
|
-
return;
|
|
589
|
-
}
|
|
590
|
-
if (isReasoningCompletedEvent(e)) {
|
|
591
|
-
const steps = e.reasoning_steps ?? e.extra_data?.reasoning_steps;
|
|
592
|
-
if (steps?.length) patchActive((m) => ({ ...m, reasoning_steps: steps }));
|
|
593
|
-
return;
|
|
594
|
-
}
|
|
595
|
-
if (isPausedEvent(e)) {
|
|
596
|
-
const requirements = e.requirements ?? [];
|
|
597
|
-
const pausedTools2 = toolsFromEvent(e);
|
|
598
|
-
setStatus("paused");
|
|
599
|
-
setActivity("Waiting for input");
|
|
600
|
-
patchActive((m) => {
|
|
601
|
-
let tool_calls = m.tool_calls ?? [];
|
|
602
|
-
for (const t of pausedTools2) tool_calls = mergeTool(tool_calls, t);
|
|
603
|
-
return { ...m, status: "paused", streaming: false, requirements, tool_calls };
|
|
604
|
-
});
|
|
605
|
-
return;
|
|
606
|
-
}
|
|
607
|
-
if (isCompletedEvent(e)) {
|
|
608
|
-
patchActive((m) => {
|
|
609
|
-
const next = { ...m, streaming: false, status: "completed" };
|
|
610
|
-
if (typeof e.content === "string" && e.content) next.content = e.content;
|
|
611
|
-
const tools = toolsFromEvent(e);
|
|
612
|
-
if (tools.length) {
|
|
613
|
-
let tc = m.tool_calls ?? [];
|
|
614
|
-
for (const t of tools) tc = mergeTool(tc, t);
|
|
615
|
-
next.tool_calls = tc;
|
|
616
|
-
}
|
|
617
|
-
if (e.reasoning_steps?.length) next.reasoning_steps = e.reasoning_steps;
|
|
618
|
-
if (e.references?.length) next.references = e.references;
|
|
619
|
-
if (e.images?.length) next.images = e.images;
|
|
620
|
-
if (e.videos?.length) next.videos = e.videos;
|
|
621
|
-
if (e.audio?.length) next.audio = e.audio;
|
|
622
|
-
if (e.response_audio) next.response_audio = e.response_audio;
|
|
623
|
-
return next;
|
|
624
|
-
});
|
|
625
|
-
return;
|
|
626
|
-
}
|
|
627
|
-
if (isCancelledEvent(e)) {
|
|
628
|
-
patchActive((m) => ({ ...m, streaming: false, status: "cancelled" }));
|
|
629
|
-
setStatus("cancelled");
|
|
630
|
-
return;
|
|
631
|
-
}
|
|
632
|
-
if (isErrorEvent(e)) {
|
|
633
|
-
const msg = typeof e.content === "string" ? e.content : e.error || "Error during run";
|
|
634
|
-
patchActive((m) => ({ ...m, streaming: false, status: "error", error: msg }));
|
|
635
|
-
setError(msg);
|
|
636
|
-
setStatus("error");
|
|
637
|
-
return;
|
|
638
|
-
}
|
|
639
|
-
},
|
|
640
|
-
[onEvent, onSessionId, patchActive]
|
|
641
|
-
);
|
|
642
|
-
const drive = react.useCallback(
|
|
643
|
-
async (starter) => {
|
|
644
|
-
const controller = new AbortController();
|
|
645
|
-
abortRef.current = controller;
|
|
646
|
-
setError(null);
|
|
647
|
-
setStatus("streaming");
|
|
648
|
-
await starter({
|
|
649
|
-
signal: controller.signal,
|
|
650
|
-
onEvent: applyEvent,
|
|
651
|
-
onError: (err) => {
|
|
652
|
-
patchActive((m) => ({ ...m, streaming: false, status: "error", error: err.message }));
|
|
653
|
-
setError(err.message);
|
|
654
|
-
setStatus("error");
|
|
655
|
-
},
|
|
656
|
-
onComplete: () => {
|
|
657
|
-
setActivity(null);
|
|
658
|
-
patchActive((m) => m.streaming ? { ...m, streaming: false } : m);
|
|
659
|
-
setStatus((s) => s === "streaming" ? "completed" : s);
|
|
660
|
-
}
|
|
661
|
-
});
|
|
662
|
-
abortRef.current = null;
|
|
663
|
-
},
|
|
664
|
-
[applyEvent, patchActive]
|
|
665
|
-
);
|
|
666
|
-
const sendMessage = react.useCallback(
|
|
667
|
-
async (message, sendOptions) => {
|
|
668
|
-
const ent = entityRef.current;
|
|
669
|
-
if (!ent) {
|
|
670
|
-
setError("No agent, team or workflow selected.");
|
|
671
|
-
return;
|
|
672
|
-
}
|
|
673
|
-
const userMsg = {
|
|
674
|
-
id: nextId(),
|
|
675
|
-
role: "user",
|
|
676
|
-
content: message,
|
|
677
|
-
created_at: nowSeconds()
|
|
678
|
-
};
|
|
679
|
-
const agentMsg = {
|
|
680
|
-
id: nextId(),
|
|
681
|
-
role: "agent",
|
|
682
|
-
content: "",
|
|
683
|
-
created_at: nowSeconds() + 1,
|
|
684
|
-
streaming: true,
|
|
685
|
-
status: "streaming",
|
|
686
|
-
tool_calls: [],
|
|
687
|
-
events: []
|
|
688
|
-
};
|
|
689
|
-
activeMsgIdRef.current = agentMsg.id;
|
|
690
|
-
setEvents([]);
|
|
691
|
-
setCurrentEvent(null);
|
|
692
|
-
setMessages((prev) => [...prev, userMsg, agentMsg]);
|
|
693
|
-
await drive(
|
|
694
|
-
(cb) => client.run({
|
|
695
|
-
type: ent.type,
|
|
696
|
-
id: ent.id,
|
|
697
|
-
message,
|
|
698
|
-
sessionId: sessionIdRef.current,
|
|
699
|
-
userId,
|
|
700
|
-
files: sendOptions?.files,
|
|
701
|
-
...cb
|
|
702
|
-
})
|
|
703
|
-
);
|
|
704
|
-
},
|
|
705
|
-
[client, drive, userId]
|
|
706
|
-
);
|
|
707
|
-
const continueRun = react.useCallback(
|
|
708
|
-
async (resolution) => {
|
|
709
|
-
const ent = entityRef.current;
|
|
710
|
-
const runId = runIdRef.current;
|
|
711
|
-
if (!ent || !runId) {
|
|
712
|
-
setError("No paused run to continue.");
|
|
713
|
-
return;
|
|
714
|
-
}
|
|
715
|
-
patchActive((m) => ({ ...m, streaming: true, status: "streaming", requirements: void 0 }));
|
|
716
|
-
await drive(
|
|
717
|
-
(cb) => client.continueRun({
|
|
718
|
-
type: ent.type,
|
|
719
|
-
id: ent.id,
|
|
720
|
-
runId,
|
|
721
|
-
sessionId: sessionIdRef.current,
|
|
722
|
-
userId,
|
|
723
|
-
tools: resolution.tools,
|
|
724
|
-
stepRequirements: resolution.stepRequirements,
|
|
725
|
-
...cb
|
|
726
|
-
})
|
|
727
|
-
);
|
|
728
|
-
},
|
|
729
|
-
[client, drive, patchActive, userId]
|
|
730
|
-
);
|
|
731
|
-
const activeMessage = react.useMemo(
|
|
732
|
-
() => messages.find((m) => m.id === activeMsgIdRef.current) ?? null,
|
|
733
|
-
[messages]
|
|
734
|
-
);
|
|
735
|
-
const pausedTools = react.useMemo(
|
|
736
|
-
() => (activeMessage?.tool_calls ?? []).filter((t) => t.requires_confirmation || t.requires_user_input),
|
|
737
|
-
[activeMessage]
|
|
738
|
-
);
|
|
739
|
-
const respondToConfirmation = react.useCallback(
|
|
740
|
-
async (approve) => {
|
|
741
|
-
const ent = entityRef.current;
|
|
742
|
-
if (ent?.type === "workflow") {
|
|
743
|
-
const reqs = (activeMessage?.requirements ?? []).map((r) => ({ ...r, confirmation: approve }));
|
|
744
|
-
await continueRun({ stepRequirements: reqs });
|
|
745
|
-
return;
|
|
746
|
-
}
|
|
747
|
-
const resolved = pausedTools.map((t) => ({ ...t, confirmed: approve }));
|
|
748
|
-
await continueRun({ tools: resolved });
|
|
749
|
-
},
|
|
750
|
-
[activeMessage, continueRun, pausedTools]
|
|
751
|
-
);
|
|
752
|
-
const submitUserInput = react.useCallback(
|
|
753
|
-
async (values) => {
|
|
754
|
-
const ent = entityRef.current;
|
|
755
|
-
if (ent?.type === "workflow") {
|
|
756
|
-
const reqs = (activeMessage?.requirements ?? []).map((r) => ({
|
|
757
|
-
...r,
|
|
758
|
-
user_input_schema: (r.user_input_schema ?? []).map((f) => ({
|
|
759
|
-
...f,
|
|
760
|
-
value: f.name in values ? values[f.name] : f.value
|
|
761
|
-
}))
|
|
762
|
-
}));
|
|
763
|
-
await continueRun({ stepRequirements: reqs });
|
|
764
|
-
return;
|
|
765
|
-
}
|
|
766
|
-
const resolved = pausedTools.map((t) => ({
|
|
767
|
-
...t,
|
|
768
|
-
confirmed: true,
|
|
769
|
-
user_input_schema: (t.user_input_schema ?? []).map((f) => ({
|
|
770
|
-
...f,
|
|
771
|
-
value: f.name in values ? values[f.name] : f.value
|
|
772
|
-
}))
|
|
773
|
-
}));
|
|
774
|
-
await continueRun({ tools: resolved });
|
|
775
|
-
},
|
|
776
|
-
[activeMessage, continueRun, pausedTools]
|
|
777
|
-
);
|
|
778
|
-
const cancel = react.useCallback(async () => {
|
|
779
|
-
abortRef.current?.abort();
|
|
780
|
-
const ent = entityRef.current;
|
|
781
|
-
const runId = runIdRef.current;
|
|
782
|
-
setStatus("cancelled");
|
|
783
|
-
setActivity(null);
|
|
784
|
-
patchActive((m) => m.streaming ? { ...m, streaming: false, status: "cancelled" } : m);
|
|
785
|
-
if (ent && runId) await client.cancelRun(ent.type, ent.id, runId, sessionIdRef.current);
|
|
786
|
-
}, [client, patchActive]);
|
|
787
|
-
const refreshSessions = react.useCallback(async () => {
|
|
788
|
-
const ent = entityRef.current;
|
|
789
|
-
if (!ent) {
|
|
790
|
-
setSessions([]);
|
|
791
|
-
return;
|
|
792
|
-
}
|
|
793
|
-
setSessionsLoading(true);
|
|
794
|
-
try {
|
|
795
|
-
const res = await client.getSessions(ent.type, ent.id, ent.db_id);
|
|
796
|
-
setSessions(res.data ?? []);
|
|
797
|
-
} finally {
|
|
798
|
-
setSessionsLoading(false);
|
|
799
|
-
}
|
|
800
|
-
}, [client]);
|
|
801
|
-
const loadSession = react.useCallback(
|
|
802
|
-
async (id2) => {
|
|
803
|
-
const ent = entityRef.current;
|
|
804
|
-
if (!ent) return;
|
|
805
|
-
abortRef.current?.abort();
|
|
806
|
-
activeMsgIdRef.current = null;
|
|
807
|
-
runIdRef.current = void 0;
|
|
808
|
-
setEvents([]);
|
|
809
|
-
setCurrentEvent(null);
|
|
810
|
-
setStatus("idle");
|
|
811
|
-
setActivity(null);
|
|
812
|
-
setError(null);
|
|
813
|
-
sessionIdRef.current = id2;
|
|
814
|
-
setSessionId(id2);
|
|
815
|
-
onSessionId?.(id2);
|
|
816
|
-
try {
|
|
817
|
-
const runs = await client.getSessionRuns(ent.type, id2, ent.db_id);
|
|
818
|
-
setMessages(sessionRunsToMessages(runs));
|
|
819
|
-
} catch (err) {
|
|
820
|
-
setError(err instanceof Error ? err.message : String(err));
|
|
821
|
-
}
|
|
822
|
-
},
|
|
823
|
-
[client, onSessionId]
|
|
824
|
-
);
|
|
825
|
-
const deleteSession = react.useCallback(
|
|
826
|
-
async (id2) => {
|
|
827
|
-
const ent = entityRef.current;
|
|
828
|
-
const ok = await client.deleteSession(id2, ent?.db_id);
|
|
829
|
-
if (ok) {
|
|
830
|
-
setSessions((prev) => prev.filter((s) => s.session_id !== id2));
|
|
831
|
-
if (sessionIdRef.current === id2) {
|
|
832
|
-
sessionIdRef.current = void 0;
|
|
833
|
-
setSessionId(void 0);
|
|
834
|
-
setMessages([]);
|
|
835
|
-
}
|
|
836
|
-
}
|
|
837
|
-
},
|
|
838
|
-
[client]
|
|
839
|
-
);
|
|
840
|
-
const reset = react.useCallback(() => {
|
|
841
|
-
abortRef.current?.abort();
|
|
842
|
-
abortRef.current = null;
|
|
843
|
-
activeMsgIdRef.current = null;
|
|
844
|
-
runIdRef.current = void 0;
|
|
845
|
-
sessionIdRef.current = void 0;
|
|
846
|
-
setMessages([]);
|
|
847
|
-
setEvents([]);
|
|
848
|
-
setCurrentEvent(null);
|
|
849
|
-
setStatus("idle");
|
|
850
|
-
setActivity(null);
|
|
851
|
-
setError(null);
|
|
852
|
-
setSessionId(void 0);
|
|
853
|
-
}, []);
|
|
854
|
-
react.useEffect(() => () => abortRef.current?.abort(), []);
|
|
855
|
-
const streamingMessage = react.useMemo(
|
|
856
|
-
() => messages.find((m) => m.role === "agent" && m.streaming) ?? null,
|
|
857
|
-
[messages]
|
|
858
|
-
);
|
|
859
|
-
return {
|
|
860
|
-
messages,
|
|
861
|
-
streamingMessage,
|
|
862
|
-
events,
|
|
863
|
-
currentEvent,
|
|
864
|
-
status,
|
|
865
|
-
activity,
|
|
866
|
-
isStreaming: status === "streaming",
|
|
867
|
-
isPaused: status === "paused",
|
|
868
|
-
error,
|
|
869
|
-
sessionId,
|
|
870
|
-
entityType: entity?.type,
|
|
871
|
-
tools: activeMessage?.tool_calls ?? [],
|
|
872
|
-
reasoning: activeMessage?.reasoning_steps,
|
|
873
|
-
pendingRequirements: activeMessage?.requirements ?? [],
|
|
874
|
-
sessions,
|
|
875
|
-
sessionsLoading,
|
|
876
|
-
sendMessage,
|
|
877
|
-
cancel,
|
|
878
|
-
continueRun,
|
|
879
|
-
respondToConfirmation,
|
|
880
|
-
submitUserInput,
|
|
881
|
-
refreshSessions,
|
|
882
|
-
loadSession,
|
|
883
|
-
deleteSession,
|
|
884
|
-
reset,
|
|
885
|
-
setMessages,
|
|
886
|
-
client
|
|
887
|
-
};
|
|
888
|
-
}
|
|
889
|
-
function ChatInput({
|
|
890
|
-
onSend,
|
|
891
|
-
onStop,
|
|
892
|
-
disabled,
|
|
893
|
-
busy,
|
|
894
|
-
placeholder = "Ask anything",
|
|
895
|
-
allowFiles = false
|
|
896
|
-
}) {
|
|
897
|
-
const [value, setValue] = react.useState("");
|
|
898
|
-
const [files, setFiles] = react.useState([]);
|
|
899
|
-
const fileRef = react.useRef(null);
|
|
900
|
-
const submit = () => {
|
|
901
|
-
const text = value.trim();
|
|
902
|
-
if (!text && files.length === 0) return;
|
|
903
|
-
onSend(text, files.length ? files : void 0);
|
|
904
|
-
setValue("");
|
|
905
|
-
setFiles([]);
|
|
906
|
-
};
|
|
907
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "agno-input", children: [
|
|
908
|
-
files.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "agno-input__files", children: files.map((f, i) => /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "agno-input__file", children: [
|
|
909
|
-
f.name,
|
|
910
|
-
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", onClick: () => setFiles((prev) => prev.filter((_, j) => j !== i)), "aria-label": "Remove", children: "\xD7" })
|
|
911
|
-
] }, i)) }),
|
|
912
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "agno-input__row", children: [
|
|
913
|
-
allowFiles && /* @__PURE__ */ jsxRuntime.jsxs(jsxRuntime.Fragment, { children: [
|
|
914
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
915
|
-
"button",
|
|
916
|
-
{
|
|
917
|
-
type: "button",
|
|
918
|
-
className: "agno-input__attach",
|
|
919
|
-
onClick: () => fileRef.current?.click(),
|
|
920
|
-
disabled,
|
|
921
|
-
"aria-label": "Attach files",
|
|
922
|
-
children: "\u{1F4CE}"
|
|
923
|
-
}
|
|
924
|
-
),
|
|
925
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
926
|
-
"input",
|
|
927
|
-
{
|
|
928
|
-
ref: fileRef,
|
|
929
|
-
type: "file",
|
|
930
|
-
multiple: true,
|
|
931
|
-
hidden: true,
|
|
932
|
-
onChange: (e) => setFiles((prev) => [...prev, ...Array.from(e.target.files ?? [])])
|
|
933
|
-
}
|
|
934
|
-
)
|
|
935
|
-
] }),
|
|
936
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
937
|
-
"textarea",
|
|
938
|
-
{
|
|
939
|
-
className: "agno-input__textarea",
|
|
940
|
-
value,
|
|
941
|
-
placeholder,
|
|
942
|
-
disabled,
|
|
943
|
-
rows: 1,
|
|
944
|
-
onChange: (e) => setValue(e.target.value),
|
|
945
|
-
onKeyDown: (e) => {
|
|
946
|
-
if (e.key === "Enter" && !e.shiftKey) {
|
|
947
|
-
e.preventDefault();
|
|
948
|
-
submit();
|
|
949
|
-
}
|
|
950
|
-
}
|
|
951
|
-
}
|
|
952
|
-
),
|
|
953
|
-
busy && onStop ? /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "agno-input__send agno-input__send--stop", onClick: onStop, "aria-label": "Stop", children: /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, children: "\u25A0" }) }) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
954
|
-
"button",
|
|
955
|
-
{
|
|
956
|
-
type: "button",
|
|
957
|
-
className: "agno-input__send",
|
|
958
|
-
onClick: submit,
|
|
959
|
-
disabled: disabled || !value.trim() && files.length === 0,
|
|
960
|
-
"aria-label": "Send",
|
|
961
|
-
children: /* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, children: "\u27A4" })
|
|
962
|
-
}
|
|
963
|
-
)
|
|
964
|
-
] })
|
|
965
|
-
] });
|
|
966
|
-
}
|
|
967
|
-
var isBoolField = (f) => f.field_type === "bool" || f.field_type === "boolean";
|
|
968
|
-
function buildAsks(message, entityType) {
|
|
969
|
-
const fromTools = (message.tool_calls ?? []).filter((t) => t.requires_confirmation || t.requires_user_input).map((t) => ({
|
|
970
|
-
id: t.tool_call_id ?? `${t.tool_name}`,
|
|
971
|
-
name: t.tool_name,
|
|
972
|
-
args: t.tool_args,
|
|
973
|
-
needsConfirmation: Boolean(t.requires_confirmation) && t.confirmed == null,
|
|
974
|
-
fields: t.requires_user_input ? t.user_input_schema ?? [] : [],
|
|
975
|
-
tool: t
|
|
976
|
-
}));
|
|
977
|
-
const fromReqs = (message.requirements ?? []).map((r) => ({
|
|
978
|
-
id: r.id,
|
|
979
|
-
name: r.tool_execution?.tool_name,
|
|
980
|
-
args: r.tool_execution?.tool_args,
|
|
981
|
-
needsConfirmation: Boolean(r.tool_execution?.requires_confirmation) || r.confirmation == null,
|
|
982
|
-
fields: r.user_input_schema ?? r.tool_execution?.user_input_schema ?? [],
|
|
983
|
-
requirement: r
|
|
984
|
-
}));
|
|
985
|
-
if (entityType === "workflow") return fromReqs.length ? fromReqs : fromTools;
|
|
986
|
-
return fromTools.length ? fromTools : fromReqs;
|
|
987
|
-
}
|
|
988
|
-
function HumanInput({ message, entityType, busy, onResolve }) {
|
|
989
|
-
const asks = react.useMemo(() => buildAsks(message, entityType), [message, entityType]);
|
|
990
|
-
const [choices, setChoices] = react.useState({});
|
|
991
|
-
const [values, setValues] = react.useState({});
|
|
992
|
-
const [reasons, setReasons] = react.useState({});
|
|
993
|
-
const [openArgs, setOpenArgs] = react.useState({});
|
|
994
|
-
if (asks.length === 0) return null;
|
|
995
|
-
const setValue = (id2, name2, value) => setValues((v) => ({ ...v, [id2]: { ...v[id2] ?? {}, [name2]: value } }));
|
|
996
|
-
const valueFor = (ask, field) => values[ask.id]?.[field.name] ?? field.value ?? (isBoolField(field) ? false : "");
|
|
997
|
-
const fillFields = (ask) => ask.fields.map((f) => ({ ...f, value: valueFor(ask, f) }));
|
|
998
|
-
const ready = asks.every((a) => !a.needsConfirmation || choices[a.id]);
|
|
999
|
-
const submit = () => {
|
|
1000
|
-
if (entityType === "workflow") {
|
|
1001
|
-
const stepRequirements = asks.map((a) => {
|
|
1002
|
-
const approved = a.needsConfirmation ? choices[a.id] === "confirm" : true;
|
|
1003
|
-
return {
|
|
1004
|
-
id: a.id,
|
|
1005
|
-
confirmation: approved,
|
|
1006
|
-
...a.fields.length ? { user_input_schema: fillFields(a) } : {},
|
|
1007
|
-
tool_execution: a.requirement?.tool_execution,
|
|
1008
|
-
...reasons[a.id] ? { confirmation_note: reasons[a.id] } : {}
|
|
1009
|
-
};
|
|
1010
|
-
});
|
|
1011
|
-
onResolve({ stepRequirements });
|
|
1012
|
-
return;
|
|
1013
|
-
}
|
|
1014
|
-
const tools = asks.map((a) => {
|
|
1015
|
-
const base = a.tool ?? { tool_call_id: a.id, tool_name: a.name };
|
|
1016
|
-
const approved = a.needsConfirmation ? choices[a.id] === "confirm" : true;
|
|
1017
|
-
return {
|
|
1018
|
-
...base,
|
|
1019
|
-
...a.needsConfirmation ? { confirmed: approved } : {},
|
|
1020
|
-
...a.fields.length ? { answered: true, user_input_schema: fillFields(a) } : {},
|
|
1021
|
-
...reasons[a.id] ? { confirmation_note: reasons[a.id] } : {}
|
|
1022
|
-
};
|
|
1023
|
-
});
|
|
1024
|
-
onResolve({ tools });
|
|
1025
|
-
};
|
|
1026
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "agno-hitl", children: [
|
|
1027
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "agno-hitl__title", children: [
|
|
1028
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, children: "\u270B" }),
|
|
1029
|
-
" Your input is needed"
|
|
1030
|
-
] }),
|
|
1031
|
-
asks.map((ask) => {
|
|
1032
|
-
const choice = choices[ask.id];
|
|
1033
|
-
const hasArgs = ask.args && Object.keys(ask.args).length > 0;
|
|
1034
|
-
const argsOpen = openArgs[ask.id] ?? true;
|
|
1035
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "agno-hitl-card", children: [
|
|
1036
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "agno-hitl-card__head", children: [
|
|
1037
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "agno-hitl-card__tool", children: [
|
|
1038
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "agno-hitl-card__icon", "aria-hidden": true, children: "\u{1F527}" }),
|
|
1039
|
-
ask.name ?? "tool"
|
|
1040
|
-
] }),
|
|
1041
|
-
ask.needsConfirmation && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "agno-hitl-card__choices", children: [
|
|
1042
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1043
|
-
"button",
|
|
1044
|
-
{
|
|
1045
|
-
type: "button",
|
|
1046
|
-
className: `agno-hitl-card__choice ${choice === "reject" ? "is-active is-reject" : ""}`,
|
|
1047
|
-
"aria-label": "Reject",
|
|
1048
|
-
disabled: busy,
|
|
1049
|
-
onClick: () => setChoices((c) => ({ ...c, [ask.id]: "reject" })),
|
|
1050
|
-
children: "\u2715"
|
|
1051
|
-
}
|
|
1052
|
-
),
|
|
1053
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1054
|
-
"button",
|
|
1055
|
-
{
|
|
1056
|
-
type: "button",
|
|
1057
|
-
className: `agno-hitl-card__choice ${choice === "confirm" ? "is-active is-confirm" : ""}`,
|
|
1058
|
-
"aria-label": "Approve",
|
|
1059
|
-
disabled: busy,
|
|
1060
|
-
onClick: () => setChoices((c) => ({ ...c, [ask.id]: "confirm" })),
|
|
1061
|
-
children: "\u2713"
|
|
1062
|
-
}
|
|
1063
|
-
)
|
|
1064
|
-
] })
|
|
1065
|
-
] }),
|
|
1066
|
-
hasArgs && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "agno-hitl-card__args", children: [
|
|
1067
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1068
|
-
"button",
|
|
1069
|
-
{
|
|
1070
|
-
type: "button",
|
|
1071
|
-
className: "agno-hitl-card__args-head",
|
|
1072
|
-
onClick: () => setOpenArgs((o) => ({ ...o, [ask.id]: !argsOpen })),
|
|
1073
|
-
children: [
|
|
1074
|
-
"Arguments",
|
|
1075
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "agno-hitl-card__chev", children: argsOpen ? "\u25B2" : "\u25BC" })
|
|
1076
|
-
]
|
|
1077
|
-
}
|
|
1078
|
-
),
|
|
1079
|
-
argsOpen && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "agno-hitl-card__args-body", children: Object.entries(ask.args ?? {}).map(([k, v]) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "agno-hitl-card__arg", children: [
|
|
1080
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "agno-hitl-card__arg-key", children: k }),
|
|
1081
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "agno-hitl-card__arg-val", children: typeof v === "object" ? JSON.stringify(v) : String(v) })
|
|
1082
|
-
] }, k)) })
|
|
1083
|
-
] }),
|
|
1084
|
-
choice === "reject" && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1085
|
-
"textarea",
|
|
1086
|
-
{
|
|
1087
|
-
className: "agno-hitl-card__reason",
|
|
1088
|
-
placeholder: "Reason for rejection (optional)\u2026",
|
|
1089
|
-
rows: 2,
|
|
1090
|
-
value: reasons[ask.id] ?? "",
|
|
1091
|
-
disabled: busy,
|
|
1092
|
-
onChange: (e) => setReasons((r) => ({ ...r, [ask.id]: e.target.value }))
|
|
1093
|
-
}
|
|
1094
|
-
),
|
|
1095
|
-
ask.fields.length > 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "agno-hitl-card__fields", children: ask.fields.map((field) => /* @__PURE__ */ jsxRuntime.jsxs("label", { className: `agno-hitl-card__field ${isBoolField(field) ? "is-bool" : ""}`, children: [
|
|
1096
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "agno-hitl-card__field-name", children: field.description || field.name }),
|
|
1097
|
-
isBoolField(field) ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1098
|
-
"input",
|
|
1099
|
-
{
|
|
1100
|
-
type: "checkbox",
|
|
1101
|
-
checked: Boolean(valueFor(ask, field)),
|
|
1102
|
-
disabled: busy,
|
|
1103
|
-
onChange: (e) => setValue(ask.id, field.name, e.target.checked)
|
|
1104
|
-
}
|
|
1105
|
-
) : /* @__PURE__ */ jsxRuntime.jsx(
|
|
1106
|
-
"input",
|
|
1107
|
-
{
|
|
1108
|
-
className: "agno-hitl-card__input",
|
|
1109
|
-
value: String(valueFor(ask, field) ?? ""),
|
|
1110
|
-
placeholder: field.field_type ?? "text",
|
|
1111
|
-
disabled: busy,
|
|
1112
|
-
onChange: (e) => setValue(ask.id, field.name, e.target.value)
|
|
1113
|
-
}
|
|
1114
|
-
)
|
|
1115
|
-
] }, field.name)) })
|
|
1116
|
-
] }, ask.id);
|
|
1117
|
-
}),
|
|
1118
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "agno-hitl__actions", children: /* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "agno-btn agno-btn--primary", disabled: busy || !ready, onClick: submit, children: "Continue" }) })
|
|
1119
|
-
] });
|
|
1120
|
-
}
|
|
1121
|
-
function Citations({
|
|
1122
|
-
references,
|
|
1123
|
-
citations
|
|
1124
|
-
}) {
|
|
1125
|
-
const [open, setOpen] = react.useState(false);
|
|
1126
|
-
const refCount = references?.reduce((n, r) => n + (r.references?.length ?? 0), 0) ?? 0;
|
|
1127
|
-
const urls = citations?.urls ?? [];
|
|
1128
|
-
const total = refCount + urls.length;
|
|
1129
|
-
if (total === 0) return null;
|
|
1130
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "agno-citations", children: [
|
|
1131
|
-
/* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", className: "agno-citations__toggle", onClick: () => setOpen((v) => !v), children: [
|
|
1132
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, children: "\u{1F4DA}" }),
|
|
1133
|
-
" ",
|
|
1134
|
-
total,
|
|
1135
|
-
" source",
|
|
1136
|
-
total > 1 ? "s" : "",
|
|
1137
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "agno-citations__chev", children: open ? "\u25B2" : "\u25BC" })
|
|
1138
|
-
] }),
|
|
1139
|
-
open && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "agno-citations__body", children: [
|
|
1140
|
-
references?.map(
|
|
1141
|
-
(group, gi) => (group.references ?? []).map((ref, ri) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "agno-citations__item", children: [
|
|
1142
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "agno-citations__name", children: ref.name ?? "reference" }),
|
|
1143
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "agno-citations__snippet", children: ref.content })
|
|
1144
|
-
] }, `r-${gi}-${ri}`))
|
|
1145
|
-
),
|
|
1146
|
-
urls.map((u, i) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1147
|
-
"a",
|
|
1148
|
-
{
|
|
1149
|
-
className: "agno-citations__url",
|
|
1150
|
-
href: u.url,
|
|
1151
|
-
target: "_blank",
|
|
1152
|
-
rel: "noreferrer noopener",
|
|
1153
|
-
children: u.title ?? u.url
|
|
1154
|
-
},
|
|
1155
|
-
`u-${i}`
|
|
1156
|
-
))
|
|
1157
|
-
] })
|
|
1158
|
-
] });
|
|
1159
|
-
}
|
|
1160
|
-
function renderInline(text, keyPrefix) {
|
|
1161
|
-
const nodes = [];
|
|
1162
|
-
const regex = /(`[^`]+`)|(\*\*[^*]+\*\*)|(\*[^*]+\*)|(\[[^\]]+\]\([^)]+\))/g;
|
|
1163
|
-
let last = 0;
|
|
1164
|
-
let match;
|
|
1165
|
-
let i = 0;
|
|
1166
|
-
while ((match = regex.exec(text)) !== null) {
|
|
1167
|
-
if (match.index > last) nodes.push(text.slice(last, match.index));
|
|
1168
|
-
const token = match[0];
|
|
1169
|
-
const key = `${keyPrefix}-${i++}`;
|
|
1170
|
-
if (token.startsWith("`")) {
|
|
1171
|
-
nodes.push(/* @__PURE__ */ jsxRuntime.jsx("code", { className: "agno-md-code", children: token.slice(1, -1) }, key));
|
|
1172
|
-
} else if (token.startsWith("**")) {
|
|
1173
|
-
nodes.push(/* @__PURE__ */ jsxRuntime.jsx("strong", { children: token.slice(2, -2) }, key));
|
|
1174
|
-
} else if (token.startsWith("*")) {
|
|
1175
|
-
nodes.push(/* @__PURE__ */ jsxRuntime.jsx("em", { children: token.slice(1, -1) }, key));
|
|
1176
|
-
} else {
|
|
1177
|
-
const m = /\[([^\]]+)\]\(([^)]+)\)/.exec(token);
|
|
1178
|
-
if (m) {
|
|
1179
|
-
nodes.push(
|
|
1180
|
-
/* @__PURE__ */ jsxRuntime.jsx("a", { href: m[2], target: "_blank", rel: "noreferrer noopener", children: m[1] }, key)
|
|
1181
|
-
);
|
|
1182
|
-
} else {
|
|
1183
|
-
nodes.push(token);
|
|
1184
|
-
}
|
|
1185
|
-
}
|
|
1186
|
-
last = match.index + token.length;
|
|
1187
|
-
}
|
|
1188
|
-
if (last < text.length) nodes.push(text.slice(last));
|
|
1189
|
-
return nodes;
|
|
1190
|
-
}
|
|
1191
|
-
function Markdown({ content, className }) {
|
|
1192
|
-
const blocks = [];
|
|
1193
|
-
const segments = content.split(/(```[\s\S]*?```)/g);
|
|
1194
|
-
segments.forEach((segment, si) => {
|
|
1195
|
-
if (segment.startsWith("```")) {
|
|
1196
|
-
const body = segment.replace(/^```[^\n]*\n?/, "").replace(/```$/, "");
|
|
1197
|
-
blocks.push(
|
|
1198
|
-
/* @__PURE__ */ jsxRuntime.jsx("pre", { className: "agno-md-pre", children: /* @__PURE__ */ jsxRuntime.jsx("code", { children: body }) }, `pre-${si}`)
|
|
1199
|
-
);
|
|
1200
|
-
return;
|
|
1201
|
-
}
|
|
1202
|
-
const lines = segment.split("\n");
|
|
1203
|
-
let listBuffer = [];
|
|
1204
|
-
const flushList = (key) => {
|
|
1205
|
-
if (!listBuffer.length) return;
|
|
1206
|
-
blocks.push(
|
|
1207
|
-
/* @__PURE__ */ jsxRuntime.jsx("ul", { className: "agno-md-list", children: listBuffer.map((item, ii) => /* @__PURE__ */ jsxRuntime.jsx("li", { children: renderInline(item, `${key}-${ii}`) }, ii)) }, key)
|
|
1208
|
-
);
|
|
1209
|
-
listBuffer = [];
|
|
1210
|
-
};
|
|
1211
|
-
lines.forEach((line, li) => {
|
|
1212
|
-
const key = `${si}-${li}`;
|
|
1213
|
-
const heading = /^(#{1,4})\s+(.*)$/.exec(line);
|
|
1214
|
-
const listItem = /^\s*[-*]\s+(.*)$/.exec(line);
|
|
1215
|
-
if (listItem) {
|
|
1216
|
-
listBuffer.push(listItem[1]);
|
|
1217
|
-
return;
|
|
1218
|
-
}
|
|
1219
|
-
flushList(`ul-${key}`);
|
|
1220
|
-
if (heading) {
|
|
1221
|
-
const level = heading[1].length;
|
|
1222
|
-
const Tag = `h${Math.min(level + 1, 6)}`;
|
|
1223
|
-
blocks.push(
|
|
1224
|
-
/* @__PURE__ */ jsxRuntime.jsx(Tag, { className: "agno-md-heading", children: renderInline(heading[2], `h-${key}`) }, `h-${key}`)
|
|
1225
|
-
);
|
|
1226
|
-
} else if (line.trim() === "") ; else {
|
|
1227
|
-
blocks.push(
|
|
1228
|
-
/* @__PURE__ */ jsxRuntime.jsx("p", { className: "agno-md-p", children: renderInline(line, `p-${key}`) }, `p-${key}`)
|
|
1229
|
-
);
|
|
1230
|
-
}
|
|
1231
|
-
});
|
|
1232
|
-
flushList(`ul-end-${si}`);
|
|
1233
|
-
});
|
|
1234
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: ["agno-md", className].filter(Boolean).join(" "), children: blocks });
|
|
1235
|
-
}
|
|
1236
|
-
function statusOf(tool) {
|
|
1237
|
-
if (tool.tool_call_error) return { label: "error", cls: "error" };
|
|
1238
|
-
if (tool.requires_confirmation && tool.confirmed == null) return { label: "awaiting approval", cls: "paused" };
|
|
1239
|
-
if (tool.requires_user_input && !tool.answered) return { label: "awaiting input", cls: "paused" };
|
|
1240
|
-
if (tool.result != null) return { label: "done", cls: "done" };
|
|
1241
|
-
return { label: "running", cls: "running" };
|
|
1242
|
-
}
|
|
1243
|
-
function ToolCall({ tool }) {
|
|
1244
|
-
const [open, setOpen] = react.useState(false);
|
|
1245
|
-
const status = statusOf(tool);
|
|
1246
|
-
const hasDetail = Boolean(tool.tool_args && Object.keys(tool.tool_args).length) || tool.result != null;
|
|
1247
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `agno-tool agno-tool--${status.cls}`, children: [
|
|
1248
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1249
|
-
"button",
|
|
1250
|
-
{
|
|
1251
|
-
type: "button",
|
|
1252
|
-
className: "agno-tool__head",
|
|
1253
|
-
onClick: () => hasDetail && setOpen((v) => !v),
|
|
1254
|
-
"aria-expanded": open,
|
|
1255
|
-
children: [
|
|
1256
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "agno-tool__icon", "aria-hidden": true, children: "\u{1F527}" }),
|
|
1257
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "agno-tool__name", children: tool.tool_name ?? "tool" }),
|
|
1258
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: `agno-tool__status agno-tool__status--${status.cls}`, children: status.label }),
|
|
1259
|
-
hasDetail && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "agno-tool__chev", children: open ? "\u25B2" : "\u25BC" })
|
|
1260
|
-
]
|
|
1261
|
-
}
|
|
1262
|
-
),
|
|
1263
|
-
open && hasDetail && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "agno-tool__body", children: [
|
|
1264
|
-
tool.tool_args && Object.keys(tool.tool_args).length > 0 && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "agno-tool__section", children: [
|
|
1265
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "agno-tool__label", children: "Arguments" }),
|
|
1266
|
-
/* @__PURE__ */ jsxRuntime.jsx("pre", { className: "agno-tool__pre", children: JSON.stringify(tool.tool_args, null, 2) })
|
|
1267
|
-
] }),
|
|
1268
|
-
tool.result != null && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "agno-tool__section", children: [
|
|
1269
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "agno-tool__label", children: "Result" }),
|
|
1270
|
-
/* @__PURE__ */ jsxRuntime.jsx("pre", { className: "agno-tool__pre", children: String(tool.result) })
|
|
1271
|
-
] })
|
|
1272
|
-
] })
|
|
1273
|
-
] });
|
|
1274
|
-
}
|
|
1275
|
-
function ToolCalls({ tools }) {
|
|
1276
|
-
if (!tools || tools.length === 0) return null;
|
|
1277
|
-
return /* @__PURE__ */ jsxRuntime.jsx("div", { className: "agno-tools", children: tools.map((tool, i) => /* @__PURE__ */ jsxRuntime.jsx(ToolCall, { tool }, tool.tool_call_id ?? `${tool.tool_name}-${i}`)) });
|
|
1278
|
-
}
|
|
1279
|
-
function statusDot(status) {
|
|
1280
|
-
if (status === "error") return "error";
|
|
1281
|
-
if (status === "completed") return "done";
|
|
1282
|
-
return "running";
|
|
1283
|
-
}
|
|
1284
|
-
function MemberCard({ member, renderMarkdown }) {
|
|
1285
|
-
const [open, setOpen] = react.useState(true);
|
|
1286
|
-
const label2 = member.kind === "executor" ? "Step executor" : "Member";
|
|
1287
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "agno-member", children: [
|
|
1288
|
-
/* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", className: "agno-member__head", onClick: () => setOpen((v) => !v), "aria-expanded": open, children: [
|
|
1289
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: `agno-member__dot agno-member__dot--${statusDot(member.status)}`, "aria-hidden": true }),
|
|
1290
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "agno-member__name", children: member.name ?? member.agent_id ?? label2 }),
|
|
1291
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "agno-member__kind", children: label2 }),
|
|
1292
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "agno-member__chev", children: open ? "\u25B2" : "\u25BC" })
|
|
1293
|
-
] }),
|
|
1294
|
-
open && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "agno-member__body", children: [
|
|
1295
|
-
/* @__PURE__ */ jsxRuntime.jsx(ToolCalls, { tools: member.tool_calls }),
|
|
1296
|
-
member.content && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "agno-member__content", children: renderMarkdown ? renderMarkdown(member.content) : /* @__PURE__ */ jsxRuntime.jsx(Markdown, { content: member.content }) })
|
|
1297
|
-
] })
|
|
1298
|
-
] });
|
|
1299
|
-
}
|
|
1300
|
-
function MemberResponses({
|
|
1301
|
-
members,
|
|
1302
|
-
renderMarkdown,
|
|
1303
|
-
title = "Member responses"
|
|
1304
|
-
}) {
|
|
1305
|
-
if (!members || members.length === 0) return null;
|
|
1306
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "agno-members", children: [
|
|
1307
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "agno-members__title", children: [
|
|
1308
|
-
title,
|
|
1309
|
-
" (",
|
|
1310
|
-
members.length,
|
|
1311
|
-
")"
|
|
1312
|
-
] }),
|
|
1313
|
-
members.map((m) => /* @__PURE__ */ jsxRuntime.jsx(MemberCard, { member: m, renderMarkdown }, m.run_id))
|
|
1314
|
-
] });
|
|
1315
|
-
}
|
|
1316
|
-
function audioSrc(a) {
|
|
1317
|
-
if (a.url) return a.url;
|
|
1318
|
-
if (a.base64_audio) return `data:${a.mime_type ?? "audio/mpeg"};base64,${a.base64_audio}`;
|
|
1319
|
-
if (a.content) return `data:${a.mime_type ?? "audio/wav"};base64,${a.content}`;
|
|
1320
|
-
return void 0;
|
|
1321
|
-
}
|
|
1322
|
-
function Multimedia({
|
|
1323
|
-
images,
|
|
1324
|
-
videos,
|
|
1325
|
-
audio,
|
|
1326
|
-
responseAudio
|
|
1327
|
-
}) {
|
|
1328
|
-
const audios = [...audio ?? [], ...responseAudio ? [responseAudio] : []];
|
|
1329
|
-
if (!images?.length && !videos?.length && !audios.length) return null;
|
|
1330
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "agno-media", children: [
|
|
1331
|
-
images?.map(
|
|
1332
|
-
(img, i) => img.url ? /* @__PURE__ */ jsxRuntime.jsx("img", { className: "agno-media__img", src: img.url, alt: img.revised_prompt ?? "image" }, `img-${i}`) : null
|
|
1333
|
-
),
|
|
1334
|
-
videos?.map(
|
|
1335
|
-
(v, i) => v.url ? /* @__PURE__ */ jsxRuntime.jsx("video", { className: "agno-media__video", src: v.url, controls: true }, `vid-${i}`) : null
|
|
1336
|
-
),
|
|
1337
|
-
audios.map((a, i) => {
|
|
1338
|
-
const src = audioSrc(a);
|
|
1339
|
-
return src ? /* @__PURE__ */ jsxRuntime.jsx("audio", { className: "agno-media__audio", src, controls: true }, `aud-${i}`) : null;
|
|
1340
|
-
})
|
|
1341
|
-
] });
|
|
1342
|
-
}
|
|
1343
|
-
function Reasoning({
|
|
1344
|
-
steps,
|
|
1345
|
-
defaultOpen = false
|
|
1346
|
-
}) {
|
|
1347
|
-
const [open, setOpen] = react.useState(defaultOpen);
|
|
1348
|
-
if (!steps || steps.length === 0) return null;
|
|
1349
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "agno-reasoning", children: [
|
|
1350
|
-
/* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", className: "agno-reasoning__toggle", onClick: () => setOpen((v) => !v), children: [
|
|
1351
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, children: "\u{1F4AD}" }),
|
|
1352
|
-
" Reasoning (",
|
|
1353
|
-
steps.length,
|
|
1354
|
-
" step",
|
|
1355
|
-
steps.length > 1 ? "s" : "",
|
|
1356
|
-
")",
|
|
1357
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "agno-reasoning__chev", children: open ? "\u25B2" : "\u25BC" })
|
|
1358
|
-
] }),
|
|
1359
|
-
open && /* @__PURE__ */ jsxRuntime.jsx("ol", { className: "agno-reasoning__list", children: steps.map((step, i) => /* @__PURE__ */ jsxRuntime.jsxs("li", { className: "agno-reasoning__step", children: [
|
|
1360
|
-
step.title && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "agno-reasoning__title", children: step.title }),
|
|
1361
|
-
step.reasoning && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "agno-reasoning__text", children: step.reasoning }),
|
|
1362
|
-
step.action && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "agno-reasoning__meta", children: [
|
|
1363
|
-
"Action: ",
|
|
1364
|
-
step.action
|
|
1365
|
-
] }),
|
|
1366
|
-
step.result && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "agno-reasoning__meta", children: [
|
|
1367
|
-
"Result: ",
|
|
1368
|
-
step.result
|
|
1369
|
-
] }),
|
|
1370
|
-
typeof step.confidence === "number" && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "agno-reasoning__meta", children: [
|
|
1371
|
-
"Confidence: ",
|
|
1372
|
-
Math.round(step.confidence * 100),
|
|
1373
|
-
"%"
|
|
1374
|
-
] })
|
|
1375
|
-
] }, i)) })
|
|
1376
|
-
] });
|
|
1377
|
-
}
|
|
1378
|
-
function StepRow({ step, renderMarkdown }) {
|
|
1379
|
-
const [open, setOpen] = react.useState(false);
|
|
1380
|
-
const hasBody = Boolean(step.content || step.error);
|
|
1381
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `agno-step agno-step--${step.status}`, children: [
|
|
1382
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1383
|
-
"button",
|
|
1384
|
-
{
|
|
1385
|
-
type: "button",
|
|
1386
|
-
className: "agno-step__head",
|
|
1387
|
-
onClick: () => hasBody && setOpen((v) => !v),
|
|
1388
|
-
"aria-expanded": open,
|
|
1389
|
-
children: [
|
|
1390
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: `agno-step__icon agno-step__icon--${step.status}`, "aria-hidden": true, children: step.status === "completed" ? "\u2713" : step.status === "error" ? "!" : "\u25CF" }),
|
|
1391
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "agno-step__name", children: step.name ?? step.key }),
|
|
1392
|
-
hasBody && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "agno-step__chev", children: open ? "\u25B2" : "\u25BC" })
|
|
1393
|
-
]
|
|
1394
|
-
}
|
|
1395
|
-
),
|
|
1396
|
-
open && hasBody && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "agno-step__body", children: step.error ? /* @__PURE__ */ jsxRuntime.jsx("div", { className: "agno-step__error", children: step.error }) : step.content ? renderMarkdown ? renderMarkdown(step.content) : /* @__PURE__ */ jsxRuntime.jsx(Markdown, { content: step.content }) : null })
|
|
1397
|
-
] });
|
|
1398
|
-
}
|
|
1399
|
-
function WorkflowSteps({
|
|
1400
|
-
steps,
|
|
1401
|
-
renderMarkdown,
|
|
1402
|
-
title = "Steps"
|
|
1403
|
-
}) {
|
|
1404
|
-
if (!steps || steps.length === 0) return null;
|
|
1405
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "agno-steps", children: [
|
|
1406
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "agno-steps__title", children: [
|
|
1407
|
-
title,
|
|
1408
|
-
" (",
|
|
1409
|
-
steps.length,
|
|
1410
|
-
")"
|
|
1411
|
-
] }),
|
|
1412
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "agno-steps__list", children: steps.map((s) => /* @__PURE__ */ jsxRuntime.jsx(StepRow, { step: s, renderMarkdown }, s.key)) })
|
|
1413
|
-
] });
|
|
1414
|
-
}
|
|
1415
|
-
function Message({ message, renderMarkdown, activity, hideReasoning, hideTools }) {
|
|
1416
|
-
const isUser = message.role === "user";
|
|
1417
|
-
const isAgent = message.role === "agent";
|
|
1418
|
-
const hasActivity = !message.content && !message.tool_calls?.length && !message.steps?.length && !message.members?.length && !message.reasoning_steps?.length;
|
|
1419
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `agno-msg agno-msg--${message.role}`, "data-status": message.status, children: [
|
|
1420
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "agno-msg__avatar", "aria-hidden": true, children: isUser ? "\u{1F464}" : isAgent ? "A" : "\u2699" }),
|
|
1421
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "agno-msg__body", children: [
|
|
1422
|
-
isAgent && !hideReasoning && /* @__PURE__ */ jsxRuntime.jsx(Reasoning, { steps: message.reasoning_steps }),
|
|
1423
|
-
isAgent && /* @__PURE__ */ jsxRuntime.jsx(WorkflowSteps, { steps: message.steps, renderMarkdown }),
|
|
1424
|
-
isAgent && /* @__PURE__ */ jsxRuntime.jsx(MemberResponses, { members: message.members, renderMarkdown }),
|
|
1425
|
-
isAgent && !hideTools && /* @__PURE__ */ jsxRuntime.jsx(ToolCalls, { tools: message.tool_calls }),
|
|
1426
|
-
message.content ? /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "agno-msg__content", children: [
|
|
1427
|
-
renderMarkdown ? renderMarkdown(message.content) : /* @__PURE__ */ jsxRuntime.jsx(Markdown, { content: message.content }),
|
|
1428
|
-
message.streaming && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "agno-msg__caret", "aria-hidden": true })
|
|
1429
|
-
] }) : isAgent && message.streaming && hasActivity && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "agno-msg__activity", role: "status", "aria-live": "polite", children: [
|
|
1430
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "agno-status__dots", "aria-hidden": true, children: [
|
|
1431
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", {}),
|
|
1432
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", {}),
|
|
1433
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", {})
|
|
1434
|
-
] }),
|
|
1435
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "agno-msg__activity-label", children: activity ?? "Working" })
|
|
1436
|
-
] }),
|
|
1437
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1438
|
-
Multimedia,
|
|
1439
|
-
{
|
|
1440
|
-
images: message.images,
|
|
1441
|
-
videos: message.videos,
|
|
1442
|
-
audio: message.audio,
|
|
1443
|
-
responseAudio: message.response_audio
|
|
1444
|
-
}
|
|
1445
|
-
),
|
|
1446
|
-
isAgent && /* @__PURE__ */ jsxRuntime.jsx(Citations, { references: message.references, citations: message.citations }),
|
|
1447
|
-
message.error && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "agno-msg__error", children: message.error })
|
|
1448
|
-
] })
|
|
1449
|
-
] });
|
|
1450
|
-
}
|
|
1451
|
-
function MessageList({
|
|
1452
|
-
messages,
|
|
1453
|
-
status,
|
|
1454
|
-
activity,
|
|
1455
|
-
renderMarkdown,
|
|
1456
|
-
emptyState,
|
|
1457
|
-
footer
|
|
1458
|
-
}) {
|
|
1459
|
-
const endRef = react.useRef(null);
|
|
1460
|
-
const stick = react.useRef(true);
|
|
1461
|
-
const containerRef = react.useRef(null);
|
|
1462
|
-
const onScroll = () => {
|
|
1463
|
-
const el = containerRef.current;
|
|
1464
|
-
if (!el) return;
|
|
1465
|
-
stick.current = el.scrollHeight - el.scrollTop - el.clientHeight < 80;
|
|
1466
|
-
};
|
|
1467
|
-
react.useEffect(() => {
|
|
1468
|
-
if (stick.current) endRef.current?.scrollIntoView({ behavior: "smooth", block: "end" });
|
|
1469
|
-
}, [messages, activity, status]);
|
|
1470
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "agno-list", ref: containerRef, onScroll, children: [
|
|
1471
|
-
messages.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "agno-list__empty", children: emptyState ?? "Start the conversation." }),
|
|
1472
|
-
messages.map((m) => /* @__PURE__ */ jsxRuntime.jsx(
|
|
1473
|
-
Message,
|
|
1474
|
-
{
|
|
1475
|
-
message: m,
|
|
1476
|
-
renderMarkdown,
|
|
1477
|
-
activity: m.streaming && status === "streaming" ? activity : void 0
|
|
1478
|
-
},
|
|
1479
|
-
m.id
|
|
1480
|
-
)),
|
|
1481
|
-
footer,
|
|
1482
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { ref: endRef })
|
|
1483
|
-
] });
|
|
1484
|
-
}
|
|
1485
|
-
function ChatWindow({
|
|
1486
|
-
chat,
|
|
1487
|
-
placeholder,
|
|
1488
|
-
emptyState,
|
|
1489
|
-
allowFiles,
|
|
1490
|
-
disabled,
|
|
1491
|
-
renderMarkdown,
|
|
1492
|
-
className
|
|
1493
|
-
}) {
|
|
1494
|
-
const pausedMessage = chat.isPaused ? [...chat.messages].reverse().find((m) => m.status === "paused") : void 0;
|
|
1495
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: ["agno-chat", className].filter(Boolean).join(" "), children: [
|
|
1496
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1497
|
-
MessageList,
|
|
1498
|
-
{
|
|
1499
|
-
messages: chat.messages,
|
|
1500
|
-
status: chat.status,
|
|
1501
|
-
activity: chat.activity,
|
|
1502
|
-
renderMarkdown,
|
|
1503
|
-
emptyState,
|
|
1504
|
-
footer: pausedMessage ? /* @__PURE__ */ jsxRuntime.jsx(
|
|
1505
|
-
HumanInput,
|
|
1506
|
-
{
|
|
1507
|
-
message: pausedMessage,
|
|
1508
|
-
entityType: chat.entityType,
|
|
1509
|
-
busy: chat.isStreaming,
|
|
1510
|
-
onResolve: chat.continueRun
|
|
1511
|
-
}
|
|
1512
|
-
) : null
|
|
1513
|
-
}
|
|
1514
|
-
),
|
|
1515
|
-
chat.error && !chat.isPaused && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "agno-chat__error", children: chat.error }),
|
|
1516
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1517
|
-
ChatInput,
|
|
1518
|
-
{
|
|
1519
|
-
onSend: (message, files) => chat.sendMessage(message, files ? { files } : void 0),
|
|
1520
|
-
onStop: chat.cancel,
|
|
1521
|
-
busy: chat.isStreaming,
|
|
1522
|
-
disabled: disabled || chat.isPaused,
|
|
1523
|
-
placeholder,
|
|
1524
|
-
allowFiles
|
|
1525
|
-
}
|
|
1526
|
-
)
|
|
1527
|
-
] });
|
|
1528
|
-
}
|
|
1529
|
-
var TYPE_LABEL = {
|
|
1530
|
-
agent: "Agents",
|
|
1531
|
-
team: "Teams",
|
|
1532
|
-
workflow: "Workflows"
|
|
1533
|
-
};
|
|
1534
|
-
var ORDER = ["agent", "team", "workflow"];
|
|
1535
|
-
function EntitySelector({
|
|
1536
|
-
entities,
|
|
1537
|
-
value,
|
|
1538
|
-
onChange,
|
|
1539
|
-
disabled,
|
|
1540
|
-
placeholder = "Select an agent, team or workflow"
|
|
1541
|
-
}) {
|
|
1542
|
-
const [open, setOpen] = react.useState(false);
|
|
1543
|
-
const rootRef = react.useRef(null);
|
|
1544
|
-
const key = (e) => `${e.type}:${e.id}`;
|
|
1545
|
-
react.useEffect(() => {
|
|
1546
|
-
if (!open) return;
|
|
1547
|
-
const onDocClick = (e) => {
|
|
1548
|
-
if (rootRef.current && !rootRef.current.contains(e.target)) setOpen(false);
|
|
1549
|
-
};
|
|
1550
|
-
const onKey = (e) => {
|
|
1551
|
-
if (e.key === "Escape") setOpen(false);
|
|
1552
|
-
};
|
|
1553
|
-
document.addEventListener("mousedown", onDocClick);
|
|
1554
|
-
document.addEventListener("keydown", onKey);
|
|
1555
|
-
return () => {
|
|
1556
|
-
document.removeEventListener("mousedown", onDocClick);
|
|
1557
|
-
document.removeEventListener("keydown", onKey);
|
|
1558
|
-
};
|
|
1559
|
-
}, [open]);
|
|
1560
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "agno-select", ref: rootRef, children: [
|
|
1561
|
-
/* @__PURE__ */ jsxRuntime.jsxs(
|
|
1562
|
-
"button",
|
|
1563
|
-
{
|
|
1564
|
-
type: "button",
|
|
1565
|
-
className: "agno-select__trigger",
|
|
1566
|
-
disabled,
|
|
1567
|
-
"aria-haspopup": "listbox",
|
|
1568
|
-
"aria-expanded": open,
|
|
1569
|
-
onClick: () => setOpen((v) => !v),
|
|
1570
|
-
children: [
|
|
1571
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "agno-select__value", children: value ? value.name : placeholder }),
|
|
1572
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: `agno-select__chev ${open ? "is-open" : ""}`, "aria-hidden": true, children: "\u2304" })
|
|
1573
|
-
]
|
|
1574
|
-
}
|
|
1575
|
-
),
|
|
1576
|
-
open && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "agno-select__panel", role: "listbox", children: [
|
|
1577
|
-
entities.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "agno-select__empty", children: "Nothing available" }),
|
|
1578
|
-
ORDER.map((type) => {
|
|
1579
|
-
const items = entities.filter((e) => e.type === type);
|
|
1580
|
-
if (items.length === 0) return null;
|
|
1581
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "agno-select__group", children: [
|
|
1582
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "agno-select__group-label", children: TYPE_LABEL[type] }),
|
|
1583
|
-
items.map((ent) => {
|
|
1584
|
-
const selected = value ? key(value) === key(ent) : false;
|
|
1585
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1586
|
-
"button",
|
|
1587
|
-
{
|
|
1588
|
-
type: "button",
|
|
1589
|
-
role: "option",
|
|
1590
|
-
"aria-selected": selected,
|
|
1591
|
-
className: `agno-select__option ${selected ? "is-selected" : ""}`,
|
|
1592
|
-
onClick: () => {
|
|
1593
|
-
onChange(ent);
|
|
1594
|
-
setOpen(false);
|
|
1595
|
-
},
|
|
1596
|
-
children: [
|
|
1597
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "agno-select__check", "aria-hidden": true, children: selected ? "\u2713" : "" }),
|
|
1598
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "agno-select__label", children: ent.name }),
|
|
1599
|
-
ent.model?.model && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "agno-select__model", children: ent.model.model })
|
|
1600
|
-
]
|
|
1601
|
-
},
|
|
1602
|
-
key(ent)
|
|
1603
|
-
);
|
|
1604
|
-
})
|
|
1605
|
-
] }, type);
|
|
1606
|
-
})
|
|
1607
|
-
] })
|
|
1608
|
-
] });
|
|
1609
|
-
}
|
|
1610
|
-
function sourceOf(e) {
|
|
1611
|
-
return e.agent_name || e.team_name || e.workflow_name || e.agent_id || e.team_id || e.workflow_id || void 0;
|
|
1612
|
-
}
|
|
1613
|
-
function fold(events) {
|
|
1614
|
-
const rows = [];
|
|
1615
|
-
for (const e of events) {
|
|
1616
|
-
const name2 = String(e.event);
|
|
1617
|
-
const source = sourceOf(e);
|
|
1618
|
-
const last = rows[rows.length - 1];
|
|
1619
|
-
if (last && last.event === name2 && last.source === source) {
|
|
1620
|
-
last.count += 1;
|
|
1621
|
-
last.created_at = e.created_at ?? last.created_at;
|
|
1622
|
-
continue;
|
|
1623
|
-
}
|
|
1624
|
-
rows.push({ event: name2, source, count: 1, created_at: e.created_at, detail: activityLabel(e) });
|
|
1625
|
-
}
|
|
1626
|
-
return rows;
|
|
1627
|
-
}
|
|
1628
|
-
function EventLog({
|
|
1629
|
-
events,
|
|
1630
|
-
autoScroll = true,
|
|
1631
|
-
maxHeight = 240
|
|
1632
|
-
}) {
|
|
1633
|
-
const ref = react.useRef(null);
|
|
1634
|
-
const rows = react.useMemo(() => fold(events), [events]);
|
|
1635
|
-
react.useEffect(() => {
|
|
1636
|
-
if (autoScroll && ref.current) ref.current.scrollTop = ref.current.scrollHeight;
|
|
1637
|
-
}, [rows, autoScroll]);
|
|
1638
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "agno-eventlog", ref, style: { maxHeight }, children: [
|
|
1639
|
-
rows.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "agno-eventlog__empty", children: "No events yet." }),
|
|
1640
|
-
rows.map((row, i) => /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "agno-eventlog__row", children: [
|
|
1641
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "agno-eventlog__name", children: row.event }),
|
|
1642
|
-
row.count > 1 && /* @__PURE__ */ jsxRuntime.jsxs("span", { className: "agno-eventlog__count", children: [
|
|
1643
|
-
"\xD7",
|
|
1644
|
-
row.count
|
|
1645
|
-
] }),
|
|
1646
|
-
row.source && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "agno-eventlog__source", children: row.source }),
|
|
1647
|
-
row.created_at && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "agno-eventlog__time", children: new Date(row.created_at * 1e3).toLocaleTimeString() })
|
|
1648
|
-
] }, i))
|
|
1649
|
-
] });
|
|
1650
|
-
}
|
|
1651
|
-
function label(session) {
|
|
1652
|
-
return session.session_name?.trim() || session.session_id;
|
|
1653
|
-
}
|
|
1654
|
-
function formatDate(value) {
|
|
1655
|
-
if (value == null) return "";
|
|
1656
|
-
let date;
|
|
1657
|
-
if (typeof value === "number") {
|
|
1658
|
-
date = new Date(value < 1e12 ? value * 1e3 : value);
|
|
1659
|
-
} else {
|
|
1660
|
-
date = new Date(value);
|
|
1661
|
-
}
|
|
1662
|
-
if (Number.isNaN(date.getTime())) return "";
|
|
1663
|
-
return date.toLocaleDateString();
|
|
1664
|
-
}
|
|
1665
|
-
function SessionList({
|
|
1666
|
-
sessions,
|
|
1667
|
-
activeSessionId,
|
|
1668
|
-
loading,
|
|
1669
|
-
onSelect,
|
|
1670
|
-
onDelete,
|
|
1671
|
-
onNew,
|
|
1672
|
-
title = "Sessions"
|
|
1673
|
-
}) {
|
|
1674
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "agno-sessions", children: [
|
|
1675
|
-
onNew && /* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", className: "agno-sessions__new", onClick: onNew, "aria-label": "New chat", children: [
|
|
1676
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { "aria-hidden": true, children: "+" }),
|
|
1677
|
-
" New Chat"
|
|
1678
|
-
] }),
|
|
1679
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "agno-sessions__head", children: /* @__PURE__ */ jsxRuntime.jsx("span", { className: "agno-sessions__title", children: title }) }),
|
|
1680
|
-
loading && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "agno-sessions__empty", children: "Loading\u2026" }),
|
|
1681
|
-
!loading && sessions.length === 0 && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "agno-sessions__empty", children: "No past sessions." }),
|
|
1682
|
-
/* @__PURE__ */ jsxRuntime.jsx("ul", { className: "agno-sessions__list", children: sessions.map((session) => /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1683
|
-
"li",
|
|
1684
|
-
{
|
|
1685
|
-
className: `agno-sessions__item ${session.session_id === activeSessionId ? "is-active" : ""}`,
|
|
1686
|
-
children: [
|
|
1687
|
-
/* @__PURE__ */ jsxRuntime.jsxs("button", { type: "button", className: "agno-sessions__select", onClick: () => onSelect(session.session_id), children: [
|
|
1688
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "agno-sessions__name", children: label(session) }),
|
|
1689
|
-
formatDate(session.created_at) && /* @__PURE__ */ jsxRuntime.jsx("span", { className: "agno-sessions__date", children: formatDate(session.created_at) })
|
|
1690
|
-
] }),
|
|
1691
|
-
onDelete && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1692
|
-
"button",
|
|
1693
|
-
{
|
|
1694
|
-
type: "button",
|
|
1695
|
-
className: "agno-sessions__delete",
|
|
1696
|
-
"aria-label": "Delete session",
|
|
1697
|
-
onClick: () => onDelete(session.session_id),
|
|
1698
|
-
children: "\u{1F5D1}"
|
|
1699
|
-
}
|
|
1700
|
-
)
|
|
1701
|
-
]
|
|
1702
|
-
},
|
|
1703
|
-
session.session_id
|
|
1704
|
-
)) })
|
|
1705
|
-
] });
|
|
1706
|
-
}
|
|
1707
|
-
function AgnoChat(props) {
|
|
1708
|
-
const client = react.useMemo(
|
|
1709
|
-
() => props.client ?? new AgnoClient({ baseUrl: props.baseUrl ?? "", headers: props.headers }),
|
|
1710
|
-
[props.client, props.baseUrl, props.headers]
|
|
1711
|
-
);
|
|
1712
|
-
const [discovered, setDiscovered] = react.useState(props.entities ?? []);
|
|
1713
|
-
const [selected, setSelected] = react.useState(props.entity ?? null);
|
|
1714
|
-
const [showLog, setShowLog] = react.useState(false);
|
|
1715
|
-
const [discoveryDone, setDiscoveryDone] = react.useState(Boolean(props.entity || props.entities));
|
|
1716
|
-
react.useEffect(() => {
|
|
1717
|
-
if (props.entity || props.entities) return;
|
|
1718
|
-
let cancelled = false;
|
|
1719
|
-
setDiscoveryDone(false);
|
|
1720
|
-
client.getEntities().then((list) => {
|
|
1721
|
-
if (cancelled) return;
|
|
1722
|
-
setDiscovered(list);
|
|
1723
|
-
setSelected((cur) => cur ?? list[0] ?? null);
|
|
1724
|
-
setDiscoveryDone(true);
|
|
1725
|
-
});
|
|
1726
|
-
return () => {
|
|
1727
|
-
cancelled = true;
|
|
1728
|
-
};
|
|
1729
|
-
}, [client, props.entity, props.entities]);
|
|
1730
|
-
const entity = props.entity ?? selected;
|
|
1731
|
-
const chat = useAgnoChat({ client, entity, userId: props.userId });
|
|
1732
|
-
const { refreshSessions } = chat;
|
|
1733
|
-
react.useEffect(() => {
|
|
1734
|
-
if (props.showSessions && entity) refreshSessions();
|
|
1735
|
-
}, [props.showSessions, entity?.type, entity?.id, refreshSessions]);
|
|
1736
|
-
react.useEffect(() => {
|
|
1737
|
-
if (props.showSessions && entity && chat.status === "completed") refreshSessions();
|
|
1738
|
-
}, [chat.status]);
|
|
1739
|
-
const onSelect = (e) => {
|
|
1740
|
-
setSelected(e);
|
|
1741
|
-
chat.reset();
|
|
1742
|
-
};
|
|
1743
|
-
const showSelector = !props.entity;
|
|
1744
|
-
const entities = props.entities ?? discovered;
|
|
1745
|
-
const noEntities = showSelector && discoveryDone && entities.length === 0;
|
|
1746
|
-
return /* @__PURE__ */ jsxRuntime.jsxs(
|
|
1747
|
-
"div",
|
|
1748
|
-
{
|
|
1749
|
-
className: ["agno-root", props.className].filter(Boolean).join(" "),
|
|
1750
|
-
style: { height: props.height ?? 560 },
|
|
1751
|
-
children: [
|
|
1752
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "agno-header", children: [
|
|
1753
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "agno-header__brand", children: [
|
|
1754
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "agno-logo", "aria-hidden": true, children: "A" }),
|
|
1755
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "agno-header__title", children: props.title ?? entity?.name ?? "Agent UI" })
|
|
1756
|
-
] }),
|
|
1757
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "agno-header__controls", children: [
|
|
1758
|
-
showSelector && /* @__PURE__ */ jsxRuntime.jsx(EntitySelector, { entities, value: entity, onChange: onSelect, disabled: chat.isStreaming }),
|
|
1759
|
-
props.showEventLog && /* @__PURE__ */ jsxRuntime.jsx(
|
|
1760
|
-
"button",
|
|
1761
|
-
{
|
|
1762
|
-
type: "button",
|
|
1763
|
-
className: `agno-btn agno-btn--ghost ${showLog ? "is-active" : ""}`,
|
|
1764
|
-
onClick: () => setShowLog((v) => !v),
|
|
1765
|
-
children: "Events"
|
|
1766
|
-
}
|
|
1767
|
-
),
|
|
1768
|
-
/* @__PURE__ */ jsxRuntime.jsx("button", { type: "button", className: "agno-btn agno-btn--ghost", onClick: chat.reset, disabled: chat.isStreaming, children: "New chat" })
|
|
1769
|
-
] })
|
|
1770
|
-
] }),
|
|
1771
|
-
noEntities && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "agno-banner", children: [
|
|
1772
|
-
"No agents, teams or workflows found at ",
|
|
1773
|
-
/* @__PURE__ */ jsxRuntime.jsx("code", { children: client.baseUrl || "(no URL)" }),
|
|
1774
|
-
". Check the URL is correct, that AgentOS is running, and that this origin is in its CORS allowlist (",
|
|
1775
|
-
/* @__PURE__ */ jsxRuntime.jsx("code", { children: "cors_allowed_origins" }),
|
|
1776
|
-
")."
|
|
1777
|
-
] }),
|
|
1778
|
-
/* @__PURE__ */ jsxRuntime.jsxs("div", { className: "agno-main", children: [
|
|
1779
|
-
props.showSessions && /* @__PURE__ */ jsxRuntime.jsx("div", { className: "agno-sidebar agno-sidebar--left", children: /* @__PURE__ */ jsxRuntime.jsx(
|
|
1780
|
-
SessionList,
|
|
1781
|
-
{
|
|
1782
|
-
sessions: chat.sessions,
|
|
1783
|
-
activeSessionId: chat.sessionId,
|
|
1784
|
-
loading: chat.sessionsLoading,
|
|
1785
|
-
onSelect: chat.loadSession,
|
|
1786
|
-
onDelete: chat.deleteSession,
|
|
1787
|
-
onNew: chat.reset
|
|
1788
|
-
}
|
|
1789
|
-
) }),
|
|
1790
|
-
/* @__PURE__ */ jsxRuntime.jsx(
|
|
1791
|
-
ChatWindow,
|
|
1792
|
-
{
|
|
1793
|
-
chat,
|
|
1794
|
-
placeholder: props.placeholder,
|
|
1795
|
-
allowFiles: props.allowFiles,
|
|
1796
|
-
disabled: !entity,
|
|
1797
|
-
renderMarkdown: props.renderMarkdown,
|
|
1798
|
-
emptyState: entity ? `Chat with ${entity.name}.` : "Select an agent, team or workflow to begin."
|
|
1799
|
-
}
|
|
1800
|
-
),
|
|
1801
|
-
props.showEventLog && showLog && /* @__PURE__ */ jsxRuntime.jsxs("div", { className: "agno-sidebar", children: [
|
|
1802
|
-
/* @__PURE__ */ jsxRuntime.jsx("div", { className: "agno-sidebar__title", children: "Event stream" }),
|
|
1803
|
-
/* @__PURE__ */ jsxRuntime.jsx(EventLog, { events: chat.events })
|
|
1804
|
-
] })
|
|
1805
|
-
] })
|
|
1806
|
-
]
|
|
1807
|
-
}
|
|
1808
|
-
);
|
|
1809
|
-
}
|
|
1810
|
-
function StatusIndicator({
|
|
1811
|
-
status,
|
|
1812
|
-
activity
|
|
1813
|
-
}) {
|
|
1814
|
-
if (status !== "streaming" && status !== "paused") return null;
|
|
1815
|
-
const label2 = activity ?? (status === "paused" ? "Waiting for input" : "Working");
|
|
1816
|
-
return /* @__PURE__ */ jsxRuntime.jsxs("div", { className: `agno-status agno-status--${status}`, role: "status", "aria-live": "polite", children: [
|
|
1817
|
-
/* @__PURE__ */ jsxRuntime.jsxs("span", { className: "agno-status__dots", "aria-hidden": true, children: [
|
|
1818
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", {}),
|
|
1819
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", {}),
|
|
1820
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", {})
|
|
1821
|
-
] }),
|
|
1822
|
-
/* @__PURE__ */ jsxRuntime.jsx("span", { className: "agno-status__label", children: label2 })
|
|
1823
|
-
] });
|
|
1824
|
-
}
|
|
1825
|
-
|
|
1826
|
-
// src/types.ts
|
|
1827
|
-
var RunEvent = /* @__PURE__ */ ((RunEvent2) => {
|
|
1828
|
-
RunEvent2["RunStarted"] = "RunStarted";
|
|
1829
|
-
RunEvent2["RunContent"] = "RunContent";
|
|
1830
|
-
RunEvent2["RunContentCompleted"] = "RunContentCompleted";
|
|
1831
|
-
RunEvent2["RunIntermediateContent"] = "RunIntermediateContent";
|
|
1832
|
-
RunEvent2["RunCompleted"] = "RunCompleted";
|
|
1833
|
-
RunEvent2["RunError"] = "RunError";
|
|
1834
|
-
RunEvent2["RunCancelled"] = "RunCancelled";
|
|
1835
|
-
RunEvent2["RunPaused"] = "RunPaused";
|
|
1836
|
-
RunEvent2["RunContinued"] = "RunContinued";
|
|
1837
|
-
RunEvent2["PreHookStarted"] = "PreHookStarted";
|
|
1838
|
-
RunEvent2["PreHookCompleted"] = "PreHookCompleted";
|
|
1839
|
-
RunEvent2["PostHookStarted"] = "PostHookStarted";
|
|
1840
|
-
RunEvent2["PostHookCompleted"] = "PostHookCompleted";
|
|
1841
|
-
RunEvent2["ToolCallStarted"] = "ToolCallStarted";
|
|
1842
|
-
RunEvent2["ToolCallCompleted"] = "ToolCallCompleted";
|
|
1843
|
-
RunEvent2["ToolCallError"] = "ToolCallError";
|
|
1844
|
-
RunEvent2["ReasoningStarted"] = "ReasoningStarted";
|
|
1845
|
-
RunEvent2["ReasoningStep"] = "ReasoningStep";
|
|
1846
|
-
RunEvent2["ReasoningContentDelta"] = "ReasoningContentDelta";
|
|
1847
|
-
RunEvent2["ReasoningCompleted"] = "ReasoningCompleted";
|
|
1848
|
-
RunEvent2["MemoryUpdateStarted"] = "MemoryUpdateStarted";
|
|
1849
|
-
RunEvent2["MemoryUpdateCompleted"] = "MemoryUpdateCompleted";
|
|
1850
|
-
RunEvent2["SessionSummaryStarted"] = "SessionSummaryStarted";
|
|
1851
|
-
RunEvent2["SessionSummaryCompleted"] = "SessionSummaryCompleted";
|
|
1852
|
-
RunEvent2["ParserModelResponseStarted"] = "ParserModelResponseStarted";
|
|
1853
|
-
RunEvent2["ParserModelResponseCompleted"] = "ParserModelResponseCompleted";
|
|
1854
|
-
RunEvent2["OutputModelResponseStarted"] = "OutputModelResponseStarted";
|
|
1855
|
-
RunEvent2["OutputModelResponseCompleted"] = "OutputModelResponseCompleted";
|
|
1856
|
-
RunEvent2["ModelRequestStarted"] = "ModelRequestStarted";
|
|
1857
|
-
RunEvent2["ModelRequestCompleted"] = "ModelRequestCompleted";
|
|
1858
|
-
RunEvent2["CompressionStarted"] = "CompressionStarted";
|
|
1859
|
-
RunEvent2["CompressionCompleted"] = "CompressionCompleted";
|
|
1860
|
-
RunEvent2["FollowupsStarted"] = "FollowupsStarted";
|
|
1861
|
-
RunEvent2["FollowupsCompleted"] = "FollowupsCompleted";
|
|
1862
|
-
RunEvent2["CustomEvent"] = "CustomEvent";
|
|
1863
|
-
return RunEvent2;
|
|
1864
|
-
})(RunEvent || {});
|
|
1865
|
-
var TeamRunEvent = /* @__PURE__ */ ((TeamRunEvent2) => {
|
|
1866
|
-
TeamRunEvent2["TeamRunStarted"] = "TeamRunStarted";
|
|
1867
|
-
TeamRunEvent2["TeamRunContent"] = "TeamRunContent";
|
|
1868
|
-
TeamRunEvent2["TeamRunIntermediateContent"] = "TeamRunIntermediateContent";
|
|
1869
|
-
TeamRunEvent2["TeamRunContentCompleted"] = "TeamRunContentCompleted";
|
|
1870
|
-
TeamRunEvent2["TeamRunCompleted"] = "TeamRunCompleted";
|
|
1871
|
-
TeamRunEvent2["TeamRunError"] = "TeamRunError";
|
|
1872
|
-
TeamRunEvent2["TeamRunCancelled"] = "TeamRunCancelled";
|
|
1873
|
-
TeamRunEvent2["TeamRunPaused"] = "TeamRunPaused";
|
|
1874
|
-
TeamRunEvent2["TeamRunContinued"] = "TeamRunContinued";
|
|
1875
|
-
TeamRunEvent2["TeamToolCallStarted"] = "TeamToolCallStarted";
|
|
1876
|
-
TeamRunEvent2["TeamToolCallCompleted"] = "TeamToolCallCompleted";
|
|
1877
|
-
TeamRunEvent2["TeamToolCallError"] = "TeamToolCallError";
|
|
1878
|
-
TeamRunEvent2["TeamReasoningStarted"] = "TeamReasoningStarted";
|
|
1879
|
-
TeamRunEvent2["TeamReasoningStep"] = "TeamReasoningStep";
|
|
1880
|
-
TeamRunEvent2["TeamReasoningContentDelta"] = "TeamReasoningContentDelta";
|
|
1881
|
-
TeamRunEvent2["TeamReasoningCompleted"] = "TeamReasoningCompleted";
|
|
1882
|
-
TeamRunEvent2["TeamMemoryUpdateStarted"] = "TeamMemoryUpdateStarted";
|
|
1883
|
-
TeamRunEvent2["TeamMemoryUpdateCompleted"] = "TeamMemoryUpdateCompleted";
|
|
1884
|
-
TeamRunEvent2["TeamTaskIterationStarted"] = "TeamTaskIterationStarted";
|
|
1885
|
-
TeamRunEvent2["TeamTaskIterationCompleted"] = "TeamTaskIterationCompleted";
|
|
1886
|
-
TeamRunEvent2["TeamTaskStateUpdated"] = "TeamTaskStateUpdated";
|
|
1887
|
-
TeamRunEvent2["TeamTaskCreated"] = "TeamTaskCreated";
|
|
1888
|
-
TeamRunEvent2["TeamTaskUpdated"] = "TeamTaskUpdated";
|
|
1889
|
-
return TeamRunEvent2;
|
|
1890
|
-
})(TeamRunEvent || {});
|
|
1891
|
-
var WorkflowRunEvent = /* @__PURE__ */ ((WorkflowRunEvent2) => {
|
|
1892
|
-
WorkflowRunEvent2["WorkflowStarted"] = "WorkflowStarted";
|
|
1893
|
-
WorkflowRunEvent2["WorkflowCompleted"] = "WorkflowCompleted";
|
|
1894
|
-
WorkflowRunEvent2["WorkflowPaused"] = "WorkflowPaused";
|
|
1895
|
-
WorkflowRunEvent2["WorkflowCancelled"] = "WorkflowCancelled";
|
|
1896
|
-
WorkflowRunEvent2["WorkflowError"] = "WorkflowError";
|
|
1897
|
-
WorkflowRunEvent2["WorkflowAgentStarted"] = "WorkflowAgentStarted";
|
|
1898
|
-
WorkflowRunEvent2["WorkflowAgentCompleted"] = "WorkflowAgentCompleted";
|
|
1899
|
-
WorkflowRunEvent2["StepStarted"] = "StepStarted";
|
|
1900
|
-
WorkflowRunEvent2["StepCompleted"] = "StepCompleted";
|
|
1901
|
-
WorkflowRunEvent2["StepPaused"] = "StepPaused";
|
|
1902
|
-
WorkflowRunEvent2["StepContinued"] = "StepContinued";
|
|
1903
|
-
WorkflowRunEvent2["StepError"] = "StepError";
|
|
1904
|
-
WorkflowRunEvent2["StepOutput"] = "StepOutput";
|
|
1905
|
-
WorkflowRunEvent2["StepOutputReview"] = "StepOutputReview";
|
|
1906
|
-
WorkflowRunEvent2["LoopExecutionStarted"] = "LoopExecutionStarted";
|
|
1907
|
-
WorkflowRunEvent2["LoopIterationStarted"] = "LoopIterationStarted";
|
|
1908
|
-
WorkflowRunEvent2["LoopIterationCompleted"] = "LoopIterationCompleted";
|
|
1909
|
-
WorkflowRunEvent2["LoopExecutionCompleted"] = "LoopExecutionCompleted";
|
|
1910
|
-
WorkflowRunEvent2["ParallelExecutionStarted"] = "ParallelExecutionStarted";
|
|
1911
|
-
WorkflowRunEvent2["ParallelExecutionCompleted"] = "ParallelExecutionCompleted";
|
|
1912
|
-
WorkflowRunEvent2["ConditionExecutionStarted"] = "ConditionExecutionStarted";
|
|
1913
|
-
WorkflowRunEvent2["ConditionExecutionCompleted"] = "ConditionExecutionCompleted";
|
|
1914
|
-
WorkflowRunEvent2["ConditionPaused"] = "ConditionPaused";
|
|
1915
|
-
WorkflowRunEvent2["RouterExecutionStarted"] = "RouterExecutionStarted";
|
|
1916
|
-
WorkflowRunEvent2["RouterExecutionCompleted"] = "RouterExecutionCompleted";
|
|
1917
|
-
WorkflowRunEvent2["RouterPaused"] = "RouterPaused";
|
|
1918
|
-
WorkflowRunEvent2["StepsExecutionStarted"] = "StepsExecutionStarted";
|
|
1919
|
-
WorkflowRunEvent2["StepsExecutionCompleted"] = "StepsExecutionCompleted";
|
|
1920
|
-
return WorkflowRunEvent2;
|
|
1921
|
-
})(WorkflowRunEvent || {});
|
|
1922
|
-
|
|
1923
|
-
exports.AgnoChat = AgnoChat;
|
|
1924
|
-
exports.AgnoClient = AgnoClient;
|
|
1925
|
-
exports.ChatInput = ChatInput;
|
|
1926
|
-
exports.ChatWindow = ChatWindow;
|
|
1927
|
-
exports.Citations = Citations;
|
|
1928
|
-
exports.EntitySelector = EntitySelector;
|
|
1929
|
-
exports.EventLog = EventLog;
|
|
1930
|
-
exports.HumanInput = HumanInput;
|
|
1931
|
-
exports.Markdown = Markdown;
|
|
1932
|
-
exports.MemberResponses = MemberResponses;
|
|
1933
|
-
exports.Message = Message;
|
|
1934
|
-
exports.MessageList = MessageList;
|
|
1935
|
-
exports.Multimedia = Multimedia;
|
|
1936
|
-
exports.Reasoning = Reasoning;
|
|
1937
|
-
exports.RunEvent = RunEvent;
|
|
1938
|
-
exports.SessionList = SessionList;
|
|
1939
|
-
exports.StatusIndicator = StatusIndicator;
|
|
1940
|
-
exports.TeamRunEvent = TeamRunEvent;
|
|
1941
|
-
exports.ToolCalls = ToolCalls;
|
|
1942
|
-
exports.WorkflowRunEvent = WorkflowRunEvent;
|
|
1943
|
-
exports.WorkflowSteps = WorkflowSteps;
|
|
1944
|
-
exports.activityLabel = activityLabel;
|
|
1945
|
-
exports.applyStepEvent = applyStepEvent;
|
|
1946
|
-
exports.applySubRunEvent = applySubRunEvent;
|
|
1947
|
-
exports.isCompletedEvent = isCompletedEvent;
|
|
1948
|
-
exports.isContentEvent = isContentEvent;
|
|
1949
|
-
exports.isErrorEvent = isErrorEvent;
|
|
1950
|
-
exports.isPausedEvent = isPausedEvent;
|
|
1951
|
-
exports.isReasoningStepEvent = isReasoningStepEvent;
|
|
1952
|
-
exports.isStepEvent = isStepEvent;
|
|
1953
|
-
exports.isSubRunEvent = isSubRunEvent;
|
|
1954
|
-
exports.isToolEvent = isToolEvent;
|
|
1955
|
-
exports.mergeTool = mergeTool;
|
|
1956
|
-
exports.normaliseBaseUrl = normaliseBaseUrl;
|
|
1957
|
-
exports.sessionRunsToMessages = sessionRunsToMessages;
|
|
1958
|
-
exports.streamRun = streamRun;
|
|
1959
|
-
exports.toolsFromEvent = toolsFromEvent;
|
|
1960
|
-
exports.useAgnoChat = useAgnoChat;
|
|
10
|
+
Object.defineProperty(exports, "AgnoChat", {
|
|
11
|
+
enumerable: true,
|
|
12
|
+
get: function () { return chunkERCKKOF4_cjs.AgnoChat; }
|
|
13
|
+
});
|
|
14
|
+
Object.defineProperty(exports, "AgnoMark", {
|
|
15
|
+
enumerable: true,
|
|
16
|
+
get: function () { return chunkERCKKOF4_cjs.AgnoMark; }
|
|
17
|
+
});
|
|
18
|
+
Object.defineProperty(exports, "ArrowUp", {
|
|
19
|
+
enumerable: true,
|
|
20
|
+
get: function () { return chunkERCKKOF4_cjs.ArrowUp; }
|
|
21
|
+
});
|
|
22
|
+
Object.defineProperty(exports, "BehindTheScenes", {
|
|
23
|
+
enumerable: true,
|
|
24
|
+
get: function () { return chunkERCKKOF4_cjs.BehindTheScenes; }
|
|
25
|
+
});
|
|
26
|
+
Object.defineProperty(exports, "BookOpen", {
|
|
27
|
+
enumerable: true,
|
|
28
|
+
get: function () { return chunkERCKKOF4_cjs.BookOpen; }
|
|
29
|
+
});
|
|
30
|
+
Object.defineProperty(exports, "Box", {
|
|
31
|
+
enumerable: true,
|
|
32
|
+
get: function () { return chunkERCKKOF4_cjs.Box; }
|
|
33
|
+
});
|
|
34
|
+
Object.defineProperty(exports, "Brain", {
|
|
35
|
+
enumerable: true,
|
|
36
|
+
get: function () { return chunkERCKKOF4_cjs.Brain; }
|
|
37
|
+
});
|
|
38
|
+
Object.defineProperty(exports, "ChatBubble", {
|
|
39
|
+
enumerable: true,
|
|
40
|
+
get: function () { return chunkERCKKOF4_cjs.ChatBubble; }
|
|
41
|
+
});
|
|
42
|
+
Object.defineProperty(exports, "ChatInput", {
|
|
43
|
+
enumerable: true,
|
|
44
|
+
get: function () { return chunkERCKKOF4_cjs.ChatInput; }
|
|
45
|
+
});
|
|
46
|
+
Object.defineProperty(exports, "ChatLauncher", {
|
|
47
|
+
enumerable: true,
|
|
48
|
+
get: function () { return chunkERCKKOF4_cjs.ChatLauncher; }
|
|
49
|
+
});
|
|
50
|
+
Object.defineProperty(exports, "ChatProvider", {
|
|
51
|
+
enumerable: true,
|
|
52
|
+
get: function () { return chunkERCKKOF4_cjs.ChatProvider; }
|
|
53
|
+
});
|
|
54
|
+
Object.defineProperty(exports, "ChatWindow", {
|
|
55
|
+
enumerable: true,
|
|
56
|
+
get: function () { return chunkERCKKOF4_cjs.ChatWindow; }
|
|
57
|
+
});
|
|
58
|
+
Object.defineProperty(exports, "Check", {
|
|
59
|
+
enumerable: true,
|
|
60
|
+
get: function () { return chunkERCKKOF4_cjs.Check; }
|
|
61
|
+
});
|
|
62
|
+
Object.defineProperty(exports, "ChevronDown", {
|
|
63
|
+
enumerable: true,
|
|
64
|
+
get: function () { return chunkERCKKOF4_cjs.ChevronDown; }
|
|
65
|
+
});
|
|
66
|
+
Object.defineProperty(exports, "Citations", {
|
|
67
|
+
enumerable: true,
|
|
68
|
+
get: function () { return chunkERCKKOF4_cjs.Citations; }
|
|
69
|
+
});
|
|
70
|
+
Object.defineProperty(exports, "Close", {
|
|
71
|
+
enumerable: true,
|
|
72
|
+
get: function () { return chunkERCKKOF4_cjs.Close; }
|
|
73
|
+
});
|
|
74
|
+
Object.defineProperty(exports, "Copy", {
|
|
75
|
+
enumerable: true,
|
|
76
|
+
get: function () { return chunkERCKKOF4_cjs.Copy; }
|
|
77
|
+
});
|
|
78
|
+
Object.defineProperty(exports, "EntityBadge", {
|
|
79
|
+
enumerable: true,
|
|
80
|
+
get: function () { return chunkERCKKOF4_cjs.EntityBadge; }
|
|
81
|
+
});
|
|
82
|
+
Object.defineProperty(exports, "EntitySelector", {
|
|
83
|
+
enumerable: true,
|
|
84
|
+
get: function () { return chunkERCKKOF4_cjs.EntitySelector; }
|
|
85
|
+
});
|
|
86
|
+
Object.defineProperty(exports, "EventLog", {
|
|
87
|
+
enumerable: true,
|
|
88
|
+
get: function () { return chunkERCKKOF4_cjs.EventLog; }
|
|
89
|
+
});
|
|
90
|
+
Object.defineProperty(exports, "Favicon", {
|
|
91
|
+
enumerable: true,
|
|
92
|
+
get: function () { return chunkERCKKOF4_cjs.Favicon; }
|
|
93
|
+
});
|
|
94
|
+
Object.defineProperty(exports, "FileAudio", {
|
|
95
|
+
enumerable: true,
|
|
96
|
+
get: function () { return chunkERCKKOF4_cjs.FileAudio; }
|
|
97
|
+
});
|
|
98
|
+
Object.defineProperty(exports, "FileIcon", {
|
|
99
|
+
enumerable: true,
|
|
100
|
+
get: function () { return chunkERCKKOF4_cjs.FileIcon; }
|
|
101
|
+
});
|
|
102
|
+
Object.defineProperty(exports, "FilePreview", {
|
|
103
|
+
enumerable: true,
|
|
104
|
+
get: function () { return chunkERCKKOF4_cjs.FilePreview; }
|
|
105
|
+
});
|
|
106
|
+
Object.defineProperty(exports, "FileVideo", {
|
|
107
|
+
enumerable: true,
|
|
108
|
+
get: function () { return chunkERCKKOF4_cjs.FileVideo; }
|
|
109
|
+
});
|
|
110
|
+
Object.defineProperty(exports, "Followups", {
|
|
111
|
+
enumerable: true,
|
|
112
|
+
get: function () { return chunkERCKKOF4_cjs.Followups; }
|
|
113
|
+
});
|
|
114
|
+
Object.defineProperty(exports, "Globe", {
|
|
115
|
+
enumerable: true,
|
|
116
|
+
get: function () { return chunkERCKKOF4_cjs.Globe; }
|
|
117
|
+
});
|
|
118
|
+
Object.defineProperty(exports, "GridLoader", {
|
|
119
|
+
enumerable: true,
|
|
120
|
+
get: function () { return chunkERCKKOF4_cjs.GridLoader; }
|
|
121
|
+
});
|
|
122
|
+
Object.defineProperty(exports, "HoverPreview", {
|
|
123
|
+
enumerable: true,
|
|
124
|
+
get: function () { return chunkERCKKOF4_cjs.HoverPreview; }
|
|
125
|
+
});
|
|
126
|
+
Object.defineProperty(exports, "HumanInput", {
|
|
127
|
+
enumerable: true,
|
|
128
|
+
get: function () { return chunkERCKKOF4_cjs.HumanInput; }
|
|
129
|
+
});
|
|
130
|
+
Object.defineProperty(exports, "LinkPreviewCard", {
|
|
131
|
+
enumerable: true,
|
|
132
|
+
get: function () { return chunkERCKKOF4_cjs.LinkPreviewCard; }
|
|
133
|
+
});
|
|
134
|
+
Object.defineProperty(exports, "Markdown", {
|
|
135
|
+
enumerable: true,
|
|
136
|
+
get: function () { return chunkERCKKOF4_cjs.Markdown; }
|
|
137
|
+
});
|
|
138
|
+
Object.defineProperty(exports, "MemberResponses", {
|
|
139
|
+
enumerable: true,
|
|
140
|
+
get: function () { return chunkERCKKOF4_cjs.MemberResponses; }
|
|
141
|
+
});
|
|
142
|
+
Object.defineProperty(exports, "Memory", {
|
|
143
|
+
enumerable: true,
|
|
144
|
+
get: function () { return chunkERCKKOF4_cjs.Memory; }
|
|
145
|
+
});
|
|
146
|
+
Object.defineProperty(exports, "Message", {
|
|
147
|
+
enumerable: true,
|
|
148
|
+
get: function () { return chunkERCKKOF4_cjs.Message; }
|
|
149
|
+
});
|
|
150
|
+
Object.defineProperty(exports, "MessageList", {
|
|
151
|
+
enumerable: true,
|
|
152
|
+
get: function () { return chunkERCKKOF4_cjs.MessageList; }
|
|
153
|
+
});
|
|
154
|
+
Object.defineProperty(exports, "Multimedia", {
|
|
155
|
+
enumerable: true,
|
|
156
|
+
get: function () { return chunkERCKKOF4_cjs.Multimedia; }
|
|
157
|
+
});
|
|
158
|
+
Object.defineProperty(exports, "Paperclip", {
|
|
159
|
+
enumerable: true,
|
|
160
|
+
get: function () { return chunkERCKKOF4_cjs.Paperclip; }
|
|
161
|
+
});
|
|
162
|
+
Object.defineProperty(exports, "Plus", {
|
|
163
|
+
enumerable: true,
|
|
164
|
+
get: function () { return chunkERCKKOF4_cjs.Plus; }
|
|
165
|
+
});
|
|
166
|
+
Object.defineProperty(exports, "Pulse", {
|
|
167
|
+
enumerable: true,
|
|
168
|
+
get: function () { return chunkERCKKOF4_cjs.Pulse; }
|
|
169
|
+
});
|
|
170
|
+
Object.defineProperty(exports, "QuickPrompts", {
|
|
171
|
+
enumerable: true,
|
|
172
|
+
get: function () { return chunkERCKKOF4_cjs.QuickPrompts; }
|
|
173
|
+
});
|
|
174
|
+
Object.defineProperty(exports, "Reasoning", {
|
|
175
|
+
enumerable: true,
|
|
176
|
+
get: function () { return chunkERCKKOF4_cjs.Reasoning; }
|
|
177
|
+
});
|
|
178
|
+
Object.defineProperty(exports, "Rerun", {
|
|
179
|
+
enumerable: true,
|
|
180
|
+
get: function () { return chunkERCKKOF4_cjs.Rerun; }
|
|
181
|
+
});
|
|
182
|
+
Object.defineProperty(exports, "SessionList", {
|
|
183
|
+
enumerable: true,
|
|
184
|
+
get: function () { return chunkERCKKOF4_cjs.SessionList; }
|
|
185
|
+
});
|
|
186
|
+
Object.defineProperty(exports, "SourceCard", {
|
|
187
|
+
enumerable: true,
|
|
188
|
+
get: function () { return chunkERCKKOF4_cjs.SourceCard; }
|
|
189
|
+
});
|
|
190
|
+
Object.defineProperty(exports, "SourcesProvider", {
|
|
191
|
+
enumerable: true,
|
|
192
|
+
get: function () { return chunkERCKKOF4_cjs.SourcesProvider; }
|
|
193
|
+
});
|
|
194
|
+
Object.defineProperty(exports, "Spinner", {
|
|
195
|
+
enumerable: true,
|
|
196
|
+
get: function () { return chunkERCKKOF4_cjs.Spinner; }
|
|
197
|
+
});
|
|
198
|
+
Object.defineProperty(exports, "StatusIndicator", {
|
|
199
|
+
enumerable: true,
|
|
200
|
+
get: function () { return chunkERCKKOF4_cjs.StatusIndicator; }
|
|
201
|
+
});
|
|
202
|
+
Object.defineProperty(exports, "Stop", {
|
|
203
|
+
enumerable: true,
|
|
204
|
+
get: function () { return chunkERCKKOF4_cjs.Stop; }
|
|
205
|
+
});
|
|
206
|
+
Object.defineProperty(exports, "TeamGlyph", {
|
|
207
|
+
enumerable: true,
|
|
208
|
+
get: function () { return chunkERCKKOF4_cjs.TeamGlyph; }
|
|
209
|
+
});
|
|
210
|
+
Object.defineProperty(exports, "ToolCalls", {
|
|
211
|
+
enumerable: true,
|
|
212
|
+
get: function () { return chunkERCKKOF4_cjs.ToolCalls; }
|
|
213
|
+
});
|
|
214
|
+
Object.defineProperty(exports, "Trash", {
|
|
215
|
+
enumerable: true,
|
|
216
|
+
get: function () { return chunkERCKKOF4_cjs.Trash; }
|
|
217
|
+
});
|
|
218
|
+
Object.defineProperty(exports, "WorkflowSteps", {
|
|
219
|
+
enumerable: true,
|
|
220
|
+
get: function () { return chunkERCKKOF4_cjs.WorkflowSteps; }
|
|
221
|
+
});
|
|
222
|
+
Object.defineProperty(exports, "Wrench", {
|
|
223
|
+
enumerable: true,
|
|
224
|
+
get: function () { return chunkERCKKOF4_cjs.Wrench; }
|
|
225
|
+
});
|
|
226
|
+
Object.defineProperty(exports, "behindTheScenesItems", {
|
|
227
|
+
enumerable: true,
|
|
228
|
+
get: function () { return chunkERCKKOF4_cjs.behindTheScenesItems; }
|
|
229
|
+
});
|
|
230
|
+
Object.defineProperty(exports, "behindTheScenesLabel", {
|
|
231
|
+
enumerable: true,
|
|
232
|
+
get: function () { return chunkERCKKOF4_cjs.behindTheScenesLabel; }
|
|
233
|
+
});
|
|
234
|
+
Object.defineProperty(exports, "collectSources", {
|
|
235
|
+
enumerable: true,
|
|
236
|
+
get: function () { return chunkERCKKOF4_cjs.collectSources; }
|
|
237
|
+
});
|
|
238
|
+
Object.defineProperty(exports, "cx", {
|
|
239
|
+
enumerable: true,
|
|
240
|
+
get: function () { return chunkERCKKOF4_cjs.cx; }
|
|
241
|
+
});
|
|
242
|
+
Object.defineProperty(exports, "displayUrl", {
|
|
243
|
+
enumerable: true,
|
|
244
|
+
get: function () { return chunkERCKKOF4_cjs.displayUrl; }
|
|
245
|
+
});
|
|
246
|
+
Object.defineProperty(exports, "faviconUrl", {
|
|
247
|
+
enumerable: true,
|
|
248
|
+
get: function () { return chunkERCKKOF4_cjs.faviconUrl; }
|
|
249
|
+
});
|
|
250
|
+
Object.defineProperty(exports, "getProviderIcon", {
|
|
251
|
+
enumerable: true,
|
|
252
|
+
get: function () { return chunkERCKKOF4_cjs.getProviderIcon; }
|
|
253
|
+
});
|
|
254
|
+
Object.defineProperty(exports, "hasBehindTheScenes", {
|
|
255
|
+
enumerable: true,
|
|
256
|
+
get: function () { return chunkERCKKOF4_cjs.hasBehindTheScenes; }
|
|
257
|
+
});
|
|
258
|
+
Object.defineProperty(exports, "linkCitations", {
|
|
259
|
+
enumerable: true,
|
|
260
|
+
get: function () { return chunkERCKKOF4_cjs.linkCitations; }
|
|
261
|
+
});
|
|
262
|
+
Object.defineProperty(exports, "normalizeFollowups", {
|
|
263
|
+
enumerable: true,
|
|
264
|
+
get: function () { return chunkERCKKOF4_cjs.normalizeFollowups; }
|
|
265
|
+
});
|
|
266
|
+
Object.defineProperty(exports, "quickPromptLabel", {
|
|
267
|
+
enumerable: true,
|
|
268
|
+
get: function () { return chunkERCKKOF4_cjs.quickPromptLabel; }
|
|
269
|
+
});
|
|
270
|
+
Object.defineProperty(exports, "quickPromptText", {
|
|
271
|
+
enumerable: true,
|
|
272
|
+
get: function () { return chunkERCKKOF4_cjs.quickPromptText; }
|
|
273
|
+
});
|
|
274
|
+
Object.defineProperty(exports, "sourceHost", {
|
|
275
|
+
enumerable: true,
|
|
276
|
+
get: function () { return chunkERCKKOF4_cjs.sourceHost; }
|
|
277
|
+
});
|
|
278
|
+
Object.defineProperty(exports, "sourcesFromMarkdown", {
|
|
279
|
+
enumerable: true,
|
|
280
|
+
get: function () { return chunkERCKKOF4_cjs.sourcesFromMarkdown; }
|
|
281
|
+
});
|
|
282
|
+
Object.defineProperty(exports, "useAgnoChat", {
|
|
283
|
+
enumerable: true,
|
|
284
|
+
get: function () { return chunkERCKKOF4_cjs.useAgnoChat; }
|
|
285
|
+
});
|
|
286
|
+
Object.defineProperty(exports, "useChatContext", {
|
|
287
|
+
enumerable: true,
|
|
288
|
+
get: function () { return chunkERCKKOF4_cjs.useChatContext; }
|
|
289
|
+
});
|
|
290
|
+
Object.defineProperty(exports, "useLinkPreview", {
|
|
291
|
+
enumerable: true,
|
|
292
|
+
get: function () { return chunkERCKKOF4_cjs.useLinkPreview; }
|
|
293
|
+
});
|
|
294
|
+
Object.defineProperty(exports, "useOptionalChatContext", {
|
|
295
|
+
enumerable: true,
|
|
296
|
+
get: function () { return chunkERCKKOF4_cjs.useOptionalChatContext; }
|
|
297
|
+
});
|
|
298
|
+
Object.defineProperty(exports, "useResolvedChat", {
|
|
299
|
+
enumerable: true,
|
|
300
|
+
get: function () { return chunkERCKKOF4_cjs.useResolvedChat; }
|
|
301
|
+
});
|
|
302
|
+
Object.defineProperty(exports, "useResolvedClassNames", {
|
|
303
|
+
enumerable: true,
|
|
304
|
+
get: function () { return chunkERCKKOF4_cjs.useResolvedClassNames; }
|
|
305
|
+
});
|
|
306
|
+
Object.defineProperty(exports, "useSources", {
|
|
307
|
+
enumerable: true,
|
|
308
|
+
get: function () { return chunkERCKKOF4_cjs.useSources; }
|
|
309
|
+
});
|
|
310
|
+
Object.defineProperty(exports, "withoutSourcesLine", {
|
|
311
|
+
enumerable: true,
|
|
312
|
+
get: function () { return chunkERCKKOF4_cjs.withoutSourcesLine; }
|
|
313
|
+
});
|
|
314
|
+
Object.defineProperty(exports, "writeClipboard", {
|
|
315
|
+
enumerable: true,
|
|
316
|
+
get: function () { return chunkERCKKOF4_cjs.writeClipboard; }
|
|
317
|
+
});
|
|
318
|
+
Object.defineProperty(exports, "RunEvent", {
|
|
319
|
+
enumerable: true,
|
|
320
|
+
get: function () { return chunk2WM3CCFE_cjs.RunEvent; }
|
|
321
|
+
});
|
|
322
|
+
Object.defineProperty(exports, "TeamRunEvent", {
|
|
323
|
+
enumerable: true,
|
|
324
|
+
get: function () { return chunk2WM3CCFE_cjs.TeamRunEvent; }
|
|
325
|
+
});
|
|
326
|
+
Object.defineProperty(exports, "WorkflowRunEvent", {
|
|
327
|
+
enumerable: true,
|
|
328
|
+
get: function () { return chunk2WM3CCFE_cjs.WorkflowRunEvent; }
|
|
329
|
+
});
|
|
330
|
+
Object.defineProperty(exports, "AgnoClient", {
|
|
331
|
+
enumerable: true,
|
|
332
|
+
get: function () { return chunkROFIOWGX_cjs.AgnoClient; }
|
|
333
|
+
});
|
|
334
|
+
Object.defineProperty(exports, "activityLabel", {
|
|
335
|
+
enumerable: true,
|
|
336
|
+
get: function () { return chunkROFIOWGX_cjs.activityLabel; }
|
|
337
|
+
});
|
|
338
|
+
Object.defineProperty(exports, "applyStepEvent", {
|
|
339
|
+
enumerable: true,
|
|
340
|
+
get: function () { return chunkROFIOWGX_cjs.applyStepEvent; }
|
|
341
|
+
});
|
|
342
|
+
Object.defineProperty(exports, "applySubRunEvent", {
|
|
343
|
+
enumerable: true,
|
|
344
|
+
get: function () { return chunkROFIOWGX_cjs.applySubRunEvent; }
|
|
345
|
+
});
|
|
346
|
+
Object.defineProperty(exports, "isCompletedEvent", {
|
|
347
|
+
enumerable: true,
|
|
348
|
+
get: function () { return chunkROFIOWGX_cjs.isCompletedEvent; }
|
|
349
|
+
});
|
|
350
|
+
Object.defineProperty(exports, "isContentEvent", {
|
|
351
|
+
enumerable: true,
|
|
352
|
+
get: function () { return chunkROFIOWGX_cjs.isContentEvent; }
|
|
353
|
+
});
|
|
354
|
+
Object.defineProperty(exports, "isErrorEvent", {
|
|
355
|
+
enumerable: true,
|
|
356
|
+
get: function () { return chunkROFIOWGX_cjs.isErrorEvent; }
|
|
357
|
+
});
|
|
358
|
+
Object.defineProperty(exports, "isFollowupsCompletedEvent", {
|
|
359
|
+
enumerable: true,
|
|
360
|
+
get: function () { return chunkROFIOWGX_cjs.isFollowupsCompletedEvent; }
|
|
361
|
+
});
|
|
362
|
+
Object.defineProperty(exports, "isPausedEvent", {
|
|
363
|
+
enumerable: true,
|
|
364
|
+
get: function () { return chunkROFIOWGX_cjs.isPausedEvent; }
|
|
365
|
+
});
|
|
366
|
+
Object.defineProperty(exports, "isReasoningStepEvent", {
|
|
367
|
+
enumerable: true,
|
|
368
|
+
get: function () { return chunkROFIOWGX_cjs.isReasoningStepEvent; }
|
|
369
|
+
});
|
|
370
|
+
Object.defineProperty(exports, "isStepEvent", {
|
|
371
|
+
enumerable: true,
|
|
372
|
+
get: function () { return chunkROFIOWGX_cjs.isStepEvent; }
|
|
373
|
+
});
|
|
374
|
+
Object.defineProperty(exports, "isSubRunEvent", {
|
|
375
|
+
enumerable: true,
|
|
376
|
+
get: function () { return chunkROFIOWGX_cjs.isSubRunEvent; }
|
|
377
|
+
});
|
|
378
|
+
Object.defineProperty(exports, "isToolEvent", {
|
|
379
|
+
enumerable: true,
|
|
380
|
+
get: function () { return chunkROFIOWGX_cjs.isToolEvent; }
|
|
381
|
+
});
|
|
382
|
+
Object.defineProperty(exports, "mergeTool", {
|
|
383
|
+
enumerable: true,
|
|
384
|
+
get: function () { return chunkROFIOWGX_cjs.mergeTool; }
|
|
385
|
+
});
|
|
386
|
+
Object.defineProperty(exports, "normaliseBaseUrl", {
|
|
387
|
+
enumerable: true,
|
|
388
|
+
get: function () { return chunkROFIOWGX_cjs.normaliseBaseUrl; }
|
|
389
|
+
});
|
|
390
|
+
Object.defineProperty(exports, "sessionRunsToMessages", {
|
|
391
|
+
enumerable: true,
|
|
392
|
+
get: function () { return chunkROFIOWGX_cjs.sessionRunsToMessages; }
|
|
393
|
+
});
|
|
394
|
+
Object.defineProperty(exports, "streamRun", {
|
|
395
|
+
enumerable: true,
|
|
396
|
+
get: function () { return chunkROFIOWGX_cjs.streamRun; }
|
|
397
|
+
});
|
|
398
|
+
Object.defineProperty(exports, "toolsFromEvent", {
|
|
399
|
+
enumerable: true,
|
|
400
|
+
get: function () { return chunkROFIOWGX_cjs.toolsFromEvent; }
|
|
401
|
+
});
|
|
1961
402
|
//# sourceMappingURL=index.cjs.map
|
|
1962
403
|
//# sourceMappingURL=index.cjs.map
|