@arbor-education/agent-view-frontend 0.4.5 → 0.4.6-alpha.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 +0 -30
- package/dist/index.cjs +4 -4
- package/dist/index.d.ts +5 -2
- package/dist/index.js +1286 -1498
- package/dist/style.css +1 -1
- package/package.json +2 -3
package/dist/index.js
CHANGED
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import {
|
|
3
|
-
import
|
|
4
|
-
import { Heading as
|
|
5
|
-
import { CHAT_RESPONSE_TYPE_AGENT as
|
|
6
|
-
const
|
|
1
|
+
import { jsxs as c, jsx as n, Fragment as Tt } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo as q, useLayoutEffect as it, useState as _, useCallback as T, useEffect as J, useRef as Et } from "react";
|
|
3
|
+
import V from "classnames";
|
|
4
|
+
import { Heading as ye, Icon as E, Dot as ot, Button as Q, Modal as se, Tabs as ze, SelectDropdown as It, TextInput as Rt, Combobox as je, Card as Ot } from "@arbor-education/design-system.components";
|
|
5
|
+
import { CHAT_RESPONSE_TYPE_AGENT as ct, CHAT_RESPONSE_TYPE_ERROR as Lt, ChatPanel as Pt, CHAT_RESPONSE_TYPE_USER as xt, CHAT_RESPONSE_TYPE_INFO as Dt } from "@arbor-education/ask-arbor-chat-panel";
|
|
6
|
+
const S = {
|
|
7
7
|
"generating-a-response": "generating-a-response",
|
|
8
8
|
hitl: "hitl",
|
|
9
9
|
complete: "complete",
|
|
10
10
|
failed: "failed"
|
|
11
|
-
},
|
|
11
|
+
}, D = {
|
|
12
12
|
"generating-a-response": "generating-a-response",
|
|
13
13
|
hitl: "hitl",
|
|
14
14
|
complete: "complete",
|
|
15
15
|
failed: "failed"
|
|
16
|
-
},
|
|
16
|
+
}, L = {
|
|
17
17
|
briefing: "briefing",
|
|
18
18
|
running: "running",
|
|
19
19
|
stopped: "stopped",
|
|
@@ -22,99 +22,99 @@ const T = {
|
|
|
22
22
|
agent: "agent",
|
|
23
23
|
user: "user",
|
|
24
24
|
system: "system"
|
|
25
|
-
},
|
|
25
|
+
}, le = {
|
|
26
26
|
MIS_RECORD: "MIS_RECORD",
|
|
27
27
|
FILE: "FILE",
|
|
28
28
|
WORKFLOW: "WORKFLOW",
|
|
29
29
|
LINK: "LINK"
|
|
30
|
-
},
|
|
30
|
+
}, Ye = {
|
|
31
31
|
cancelled: "cancelled",
|
|
32
32
|
archived: "archived"
|
|
33
|
-
},
|
|
33
|
+
}, Ge = {
|
|
34
34
|
in_progress: "in_progress",
|
|
35
35
|
requires_attention: "requires_attention",
|
|
36
36
|
available: "available"
|
|
37
|
-
},
|
|
38
|
-
[
|
|
37
|
+
}, X = {
|
|
38
|
+
[D.complete]: {
|
|
39
39
|
label: "Complete",
|
|
40
40
|
icon: "circle-check",
|
|
41
41
|
color: "var(--color-semantic-success-600)"
|
|
42
42
|
},
|
|
43
|
-
[
|
|
43
|
+
[D.failed]: {
|
|
44
44
|
label: "Failed",
|
|
45
45
|
icon: "circle-x",
|
|
46
46
|
color: "var(--color-semantic-destructive-600)"
|
|
47
47
|
},
|
|
48
|
-
[
|
|
48
|
+
[D.hitl]: {
|
|
49
49
|
label: "Requires attention",
|
|
50
50
|
icon: "triangle-alert",
|
|
51
51
|
color: "var(--color-semantic-warning-600)"
|
|
52
52
|
},
|
|
53
|
-
[
|
|
53
|
+
[D["generating-a-response"]]: {
|
|
54
54
|
label: "Generating a response",
|
|
55
55
|
icon: "sparkles",
|
|
56
56
|
color: "var(--color-brand-600)"
|
|
57
57
|
}
|
|
58
|
-
},
|
|
59
|
-
[
|
|
60
|
-
status:
|
|
58
|
+
}, De = {
|
|
59
|
+
[S["generating-a-response"]]: {
|
|
60
|
+
status: S["generating-a-response"],
|
|
61
61
|
title: "Active",
|
|
62
62
|
dotColour: "green",
|
|
63
63
|
statusIcon: {
|
|
64
|
-
name:
|
|
65
|
-
color:
|
|
64
|
+
name: X["generating-a-response"].icon,
|
|
65
|
+
color: X["generating-a-response"].color
|
|
66
66
|
}
|
|
67
67
|
},
|
|
68
|
-
[
|
|
69
|
-
status:
|
|
68
|
+
[S.hitl]: {
|
|
69
|
+
status: S.hitl,
|
|
70
70
|
title: "Requires attention",
|
|
71
71
|
dotColour: "orange",
|
|
72
72
|
statusIcon: {
|
|
73
|
-
name:
|
|
74
|
-
color:
|
|
73
|
+
name: X.hitl.icon,
|
|
74
|
+
color: X.hitl.color
|
|
75
75
|
}
|
|
76
76
|
},
|
|
77
|
-
[
|
|
78
|
-
status:
|
|
77
|
+
[S.complete]: {
|
|
78
|
+
status: S.complete,
|
|
79
79
|
title: "Complete",
|
|
80
80
|
dotColour: "green",
|
|
81
81
|
dotModifier: "grey-dark",
|
|
82
82
|
statusIcon: {
|
|
83
|
-
name:
|
|
84
|
-
color:
|
|
83
|
+
name: X.complete.icon,
|
|
84
|
+
color: X.complete.color
|
|
85
85
|
}
|
|
86
86
|
},
|
|
87
|
-
[
|
|
88
|
-
status:
|
|
87
|
+
[S.failed]: {
|
|
88
|
+
status: S.failed,
|
|
89
89
|
title: "Failed",
|
|
90
90
|
dotColour: "salmon",
|
|
91
91
|
statusIcon: {
|
|
92
|
-
name:
|
|
93
|
-
color:
|
|
92
|
+
name: X.failed.icon,
|
|
93
|
+
color: X.failed.color
|
|
94
94
|
}
|
|
95
95
|
}
|
|
96
|
-
},
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
],
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
],
|
|
103
|
-
[
|
|
104
|
-
[
|
|
105
|
-
[
|
|
106
|
-
[
|
|
107
|
-
},
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
],
|
|
113
|
-
[
|
|
114
|
-
[
|
|
115
|
-
[
|
|
116
|
-
[
|
|
117
|
-
},
|
|
96
|
+
}, Mt = [
|
|
97
|
+
S["generating-a-response"],
|
|
98
|
+
S.hitl
|
|
99
|
+
], $t = [
|
|
100
|
+
S.complete,
|
|
101
|
+
S.failed
|
|
102
|
+
], Ut = "m4", Ft = "1", lt = "msg-opening", xe = "Unable to load agent tasks. Please try again.", Ht = "Unable to load the resources for this agent", dt = "Unable to load the timeline for this agent", Bt = "Something went wrong. Please try again.", gt = "Unable to load agents. Please try again.", de = "Loading tasks…", Xe = "Loading agents…", zt = "Task", Gt = {
|
|
103
|
+
[L.briefing]: "Briefing",
|
|
104
|
+
[L.running]: "Working",
|
|
105
|
+
[L.stopped]: "Stopped",
|
|
106
|
+
[L.complete]: "Complete"
|
|
107
|
+
}, qt = [
|
|
108
|
+
S["generating-a-response"],
|
|
109
|
+
S.hitl,
|
|
110
|
+
S.complete,
|
|
111
|
+
S.failed
|
|
112
|
+
], Kt = {
|
|
113
|
+
[S["generating-a-response"]]: "Agents currently working on tasks for you.",
|
|
114
|
+
[S.hitl]: "Agents that need your input before they can continue.",
|
|
115
|
+
[S.complete]: "Agents that have finished their work.",
|
|
116
|
+
[S.failed]: "Agents that failed or were stopped."
|
|
117
|
+
}, Jt = () => /* @__PURE__ */ c(
|
|
118
118
|
"svg",
|
|
119
119
|
{
|
|
120
120
|
className: "agent-view__empty-illustration",
|
|
@@ -230,289 +230,121 @@ const T = {
|
|
|
230
230
|
/* @__PURE__ */ n("circle", { cx: "256", cy: "160", r: "4", fill: "var(--color-semantic-destructive-500)" })
|
|
231
231
|
]
|
|
232
232
|
}
|
|
233
|
-
),
|
|
234
|
-
const
|
|
235
|
-
return
|
|
236
|
-
|
|
233
|
+
), Wt = ({ status: e }) => {
|
|
234
|
+
const t = De[e];
|
|
235
|
+
return t.statusIcon ? /* @__PURE__ */ n(
|
|
236
|
+
E,
|
|
237
237
|
{
|
|
238
|
-
name:
|
|
238
|
+
name: t.statusIcon.name,
|
|
239
239
|
size: 16,
|
|
240
|
-
color:
|
|
241
|
-
screenReaderText:
|
|
240
|
+
color: t.statusIcon.color,
|
|
241
|
+
screenReaderText: t.title
|
|
242
242
|
}
|
|
243
|
-
) : /* @__PURE__ */ n(
|
|
244
|
-
},
|
|
243
|
+
) : /* @__PURE__ */ n(ot, { colour: t.dotColour, label: t.title });
|
|
244
|
+
}, Vt = () => /* @__PURE__ */ c(
|
|
245
245
|
"section",
|
|
246
246
|
{
|
|
247
247
|
className: "agent-view__empty",
|
|
248
248
|
"aria-label": "About the agents board",
|
|
249
249
|
children: [
|
|
250
|
-
/* @__PURE__ */
|
|
251
|
-
/* @__PURE__ */ n(
|
|
250
|
+
/* @__PURE__ */ c("div", { className: "agent-view__empty-content", children: [
|
|
251
|
+
/* @__PURE__ */ n(ye, { level: 4, children: "Your agents board" }),
|
|
252
252
|
/* @__PURE__ */ n("p", { className: "agent-view__empty-lead", children: "When you start an agent, it appears here so you can track progress at a glance. Agents move between columns as their status changes." }),
|
|
253
|
-
/* @__PURE__ */ n("ul", { className: "agent-view__empty-columns", children:
|
|
254
|
-
const
|
|
255
|
-
return /* @__PURE__ */
|
|
256
|
-
/* @__PURE__ */ n("span", { className: "agent-view__empty-column-indicator", children: /* @__PURE__ */ n(
|
|
257
|
-
/* @__PURE__ */
|
|
258
|
-
/* @__PURE__ */ n("span", { className: "agent-view__empty-column-title", children:
|
|
259
|
-
/* @__PURE__ */ n("span", { className: "agent-view__empty-column-description", children:
|
|
253
|
+
/* @__PURE__ */ n("ul", { className: "agent-view__empty-columns", children: qt.map((e) => {
|
|
254
|
+
const t = De[e];
|
|
255
|
+
return /* @__PURE__ */ c("li", { className: "agent-view__empty-column", children: [
|
|
256
|
+
/* @__PURE__ */ n("span", { className: "agent-view__empty-column-indicator", children: /* @__PURE__ */ n(Wt, { status: e }) }),
|
|
257
|
+
/* @__PURE__ */ c("span", { className: "agent-view__empty-column-text", children: [
|
|
258
|
+
/* @__PURE__ */ n("span", { className: "agent-view__empty-column-title", children: t.title }),
|
|
259
|
+
/* @__PURE__ */ n("span", { className: "agent-view__empty-column-description", children: Kt[e] })
|
|
260
260
|
] })
|
|
261
|
-
] },
|
|
261
|
+
] }, e);
|
|
262
262
|
}) }),
|
|
263
|
-
/* @__PURE__ */
|
|
263
|
+
/* @__PURE__ */ c("p", { className: "agent-view__empty-hint", children: [
|
|
264
264
|
"Use ",
|
|
265
265
|
/* @__PURE__ */ n("strong", { children: "Start an agent" }),
|
|
266
266
|
" above to begin."
|
|
267
267
|
] })
|
|
268
268
|
] }),
|
|
269
|
-
/* @__PURE__ */ n("div", { className: "agent-view__empty-visual", children: /* @__PURE__ */ n(
|
|
269
|
+
/* @__PURE__ */ n("div", { className: "agent-view__empty-visual", children: /* @__PURE__ */ n(Jt, {}) })
|
|
270
270
|
]
|
|
271
271
|
}
|
|
272
|
-
),
|
|
273
|
-
...
|
|
274
|
-
...
|
|
275
|
-
}),
|
|
276
|
-
const
|
|
277
|
-
for (const s of
|
|
278
|
-
const r = s.children ?
|
|
279
|
-
if (
|
|
280
|
-
|
|
272
|
+
), jt = (e, t) => ({
|
|
273
|
+
...e,
|
|
274
|
+
...t.length > 0 ? { children: t } : {}
|
|
275
|
+
}), ht = (e) => {
|
|
276
|
+
const t = [], a = [];
|
|
277
|
+
for (const s of e) {
|
|
278
|
+
const r = s.children ? ht(s.children) : { needsInput: [], tasks: [] };
|
|
279
|
+
if (t.push(...r.needsInput), s.status === D.hitl) {
|
|
280
|
+
t.push({ ...s, children: void 0 });
|
|
281
281
|
continue;
|
|
282
282
|
}
|
|
283
|
-
a.push(
|
|
283
|
+
a.push(jt(s, r.tasks));
|
|
284
284
|
}
|
|
285
|
-
return { needsInput:
|
|
286
|
-
},
|
|
287
|
-
const s =
|
|
288
|
-
return s !== r ? s ? -1 : 1 :
|
|
289
|
-
}).map(({ item:
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
const a = t.getBoundingClientRect(), s = e.getBoundingClientRect();
|
|
301
|
-
return {
|
|
302
|
-
top: s.top - a.top,
|
|
303
|
-
left: s.left - a.left,
|
|
304
|
-
width: s.width,
|
|
305
|
-
height: s.height
|
|
306
|
-
};
|
|
307
|
-
}, He = ({
|
|
308
|
-
children: t,
|
|
309
|
-
className: e,
|
|
310
|
-
contentClassName: a,
|
|
311
|
-
scrollSelector: s,
|
|
312
|
-
style: r,
|
|
313
|
-
"aria-label": l
|
|
314
|
-
}) => {
|
|
315
|
-
const i = me(null), d = me(null), [c, p] = f(!1), [m, g] = f(!1), [_, b] = f(null), v = () => {
|
|
316
|
-
var y;
|
|
317
|
-
return s ? ((y = i.current) == null ? void 0 : y.querySelector(s)) ?? null : d.current;
|
|
318
|
-
}, R = () => {
|
|
319
|
-
const y = v(), N = nn(y);
|
|
320
|
-
if (p(
|
|
321
|
-
(u) => u === N.canScrollUp ? u : N.canScrollUp
|
|
322
|
-
), g(
|
|
323
|
-
(u) => u === N.canScrollDown ? u : N.canScrollDown
|
|
324
|
-
), s) {
|
|
325
|
-
const u = an(i.current, y);
|
|
326
|
-
b((I) => (I == null ? void 0 : I.top) === (u == null ? void 0 : u.top) && (I == null ? void 0 : I.left) === (u == null ? void 0 : u.left) && (I == null ? void 0 : I.width) === (u == null ? void 0 : u.width) && (I == null ? void 0 : I.height) === (u == null ? void 0 : u.height) ? I : u);
|
|
327
|
-
} else
|
|
328
|
-
b((u) => u === null ? u : null);
|
|
329
|
-
};
|
|
330
|
-
$e(() => {
|
|
331
|
-
R();
|
|
332
|
-
}), K(() => {
|
|
333
|
-
const y = i.current;
|
|
334
|
-
if (!y)
|
|
335
|
-
return;
|
|
336
|
-
let N = null, u = null;
|
|
337
|
-
const I = () => {
|
|
338
|
-
N == null || N.removeEventListener("scroll", R), u == null || u.disconnect(), u = null, N = null;
|
|
339
|
-
}, $ = (M) => {
|
|
340
|
-
if (M === N) {
|
|
341
|
-
R();
|
|
342
|
-
return;
|
|
343
|
-
}
|
|
344
|
-
if (I(), N = M, !N) {
|
|
345
|
-
R();
|
|
346
|
-
return;
|
|
347
|
-
}
|
|
348
|
-
N.addEventListener("scroll", R, { passive: !0 }), u = new ResizeObserver(() => R()), u.observe(N), N.firstElementChild instanceof HTMLElement && u.observe(N.firstElementChild), R();
|
|
349
|
-
};
|
|
350
|
-
$(v());
|
|
351
|
-
const A = new MutationObserver(() => {
|
|
352
|
-
$(v());
|
|
353
|
-
});
|
|
354
|
-
return A.observe(y, {
|
|
355
|
-
childList: !0,
|
|
356
|
-
subtree: !0,
|
|
357
|
-
characterData: !0
|
|
358
|
-
}), window.addEventListener("resize", R), () => {
|
|
359
|
-
window.removeEventListener("resize", R), A.disconnect(), I();
|
|
360
|
-
};
|
|
361
|
-
}, [s]);
|
|
362
|
-
const C = (y) => {
|
|
363
|
-
const N = v();
|
|
364
|
-
if (!N)
|
|
365
|
-
return;
|
|
366
|
-
const u = Math.max(N.clientHeight * 0.75, 120);
|
|
367
|
-
N.scrollBy({
|
|
368
|
-
top: y === "up" ? -u : u,
|
|
369
|
-
behavior: "smooth"
|
|
370
|
-
});
|
|
371
|
-
}, U = /* @__PURE__ */ o(de, { children: [
|
|
372
|
-
c && /* @__PURE__ */ o(de, { children: [
|
|
373
|
-
/* @__PURE__ */ n("div", { className: "scrollable-region__fade scrollable-region__fade--top", "aria-hidden": "true" }),
|
|
374
|
-
/* @__PURE__ */ n(
|
|
375
|
-
"button",
|
|
376
|
-
{
|
|
377
|
-
type: "button",
|
|
378
|
-
className: "scrollable-region__edge scrollable-region__edge--top",
|
|
379
|
-
"aria-label": "Scroll up",
|
|
380
|
-
onClick: () => C("up"),
|
|
381
|
-
children: /* @__PURE__ */ n(L, { name: "chevron-up", size: 16, color: "currentColor" })
|
|
382
|
-
}
|
|
383
|
-
)
|
|
384
|
-
] }),
|
|
385
|
-
m && /* @__PURE__ */ o(de, { children: [
|
|
386
|
-
/* @__PURE__ */ n(
|
|
387
|
-
"div",
|
|
388
|
-
{
|
|
389
|
-
className: "scrollable-region__fade scrollable-region__fade--bottom",
|
|
390
|
-
"aria-hidden": "true"
|
|
391
|
-
}
|
|
392
|
-
),
|
|
393
|
-
/* @__PURE__ */ n(
|
|
394
|
-
"button",
|
|
395
|
-
{
|
|
396
|
-
type: "button",
|
|
397
|
-
className: "scrollable-region__edge scrollable-region__edge--bottom",
|
|
398
|
-
"aria-label": "Scroll down",
|
|
399
|
-
onClick: () => C("down"),
|
|
400
|
-
children: /* @__PURE__ */ n(L, { name: "chevron-down", size: 16, color: "currentColor" })
|
|
401
|
-
}
|
|
402
|
-
)
|
|
403
|
-
] })
|
|
404
|
-
] });
|
|
405
|
-
return /* @__PURE__ */ n(
|
|
406
|
-
"div",
|
|
407
|
-
{
|
|
408
|
-
ref: i,
|
|
409
|
-
className: J("scrollable-region", e),
|
|
410
|
-
style: r,
|
|
411
|
-
"aria-label": l,
|
|
412
|
-
children: s ? /* @__PURE__ */ o(de, { children: [
|
|
413
|
-
t,
|
|
414
|
-
_ && (c || m) && /* @__PURE__ */ n(
|
|
415
|
-
"div",
|
|
416
|
-
{
|
|
417
|
-
className: "scrollable-region__overlay",
|
|
418
|
-
style: {
|
|
419
|
-
top: _.top,
|
|
420
|
-
left: _.left,
|
|
421
|
-
width: _.width,
|
|
422
|
-
height: _.height
|
|
423
|
-
},
|
|
424
|
-
children: U
|
|
425
|
-
}
|
|
426
|
-
)
|
|
427
|
-
] }) : /* @__PURE__ */ o(de, { children: [
|
|
428
|
-
U,
|
|
429
|
-
/* @__PURE__ */ n(
|
|
430
|
-
"div",
|
|
431
|
-
{
|
|
432
|
-
ref: d,
|
|
433
|
-
className: J("scrollable-region__viewport", a),
|
|
434
|
-
children: t
|
|
435
|
-
}
|
|
436
|
-
)
|
|
437
|
-
] })
|
|
438
|
-
}
|
|
439
|
-
);
|
|
440
|
-
}, sn = 48, rn = ({
|
|
441
|
-
checklist: t
|
|
442
|
-
}) => {
|
|
443
|
-
const e = me(null), a = me(!1);
|
|
444
|
-
return $e(() => {
|
|
445
|
-
const s = e.current;
|
|
446
|
-
if (!s)
|
|
447
|
-
return;
|
|
448
|
-
const r = s.scrollHeight - s.scrollTop - s.clientHeight;
|
|
449
|
-
(!a.current || r <= sn) && (s.scrollTop = s.scrollHeight, a.current = !0);
|
|
450
|
-
}, [t]), t.length === 0 ? /* @__PURE__ */ n("p", { className: "agent-view__progress-empty", children: "No tasks to display." }) : /* @__PURE__ */ n(
|
|
451
|
-
He,
|
|
452
|
-
{
|
|
453
|
-
className: "agent-view__progress-scroll",
|
|
454
|
-
scrollSelector: ".agent-view__progress-list",
|
|
455
|
-
children: /* @__PURE__ */ n(
|
|
456
|
-
"ul",
|
|
285
|
+
return { needsInput: t, tasks: a };
|
|
286
|
+
}, Yt = (e) => e.map((t, a) => ({ item: t, index: a })).sort((t, a) => {
|
|
287
|
+
const s = t.item.status === D.hitl, r = a.item.status === D.hitl;
|
|
288
|
+
return s !== r ? s ? -1 : 1 : t.index - a.index;
|
|
289
|
+
}).map(({ item: t }) => t), Xt = ({
|
|
290
|
+
checklist: e
|
|
291
|
+
}) => e.length === 0 ? /* @__PURE__ */ n("p", { className: "agent-view__progress-empty", children: "No tasks to display." }) : /* @__PURE__ */ n(
|
|
292
|
+
"ul",
|
|
293
|
+
{
|
|
294
|
+
className: "agent-view__progress-list",
|
|
295
|
+
"aria-label": "Agent tasks",
|
|
296
|
+
children: Yt(e).map((t) => {
|
|
297
|
+
const a = X[t.status];
|
|
298
|
+
return /* @__PURE__ */ c(
|
|
299
|
+
"li",
|
|
457
300
|
{
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
301
|
+
className: V(
|
|
302
|
+
"agent-view__progress-item",
|
|
303
|
+
`agent-view__progress-item--${t.status.replace(/_/g, "-")}`
|
|
304
|
+
),
|
|
305
|
+
children: [
|
|
306
|
+
/* @__PURE__ */ n(
|
|
307
|
+
E,
|
|
465
308
|
{
|
|
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
|
-
s.task
|
|
493
|
-
);
|
|
494
|
-
})
|
|
495
|
-
}
|
|
496
|
-
)
|
|
497
|
-
}
|
|
498
|
-
);
|
|
499
|
-
}, on = ({
|
|
500
|
-
prompts: t,
|
|
501
|
-
classNamePrefix: e = "agent-workspace",
|
|
309
|
+
name: a.icon,
|
|
310
|
+
size: 16,
|
|
311
|
+
color: a.color,
|
|
312
|
+
screenReaderText: `${a.label}:`
|
|
313
|
+
}
|
|
314
|
+
),
|
|
315
|
+
/* @__PURE__ */ c("div", { className: "agent-view__progress-item-content", children: [
|
|
316
|
+
/* @__PURE__ */ n("span", { className: "agent-view__progress-label", children: t.task }),
|
|
317
|
+
t.status !== D.complete && /* @__PURE__ */ n(
|
|
318
|
+
"span",
|
|
319
|
+
{
|
|
320
|
+
className: "agent-view__progress-description",
|
|
321
|
+
children: t.description
|
|
322
|
+
}
|
|
323
|
+
)
|
|
324
|
+
] })
|
|
325
|
+
]
|
|
326
|
+
},
|
|
327
|
+
t.task
|
|
328
|
+
);
|
|
329
|
+
})
|
|
330
|
+
}
|
|
331
|
+
), Qt = ({
|
|
332
|
+
prompts: e,
|
|
333
|
+
classNamePrefix: t = "agent-workspace",
|
|
502
334
|
onSelect: a
|
|
503
|
-
}) =>
|
|
335
|
+
}) => e.length === 0 ? null : /* @__PURE__ */ n("div", { className: `${t}__chips`, children: e.map((s) => /* @__PURE__ */ n(
|
|
504
336
|
"button",
|
|
505
337
|
{
|
|
506
338
|
type: "button",
|
|
507
|
-
className: `${
|
|
339
|
+
className: `${t}__chip`,
|
|
508
340
|
onClick: () => a(s),
|
|
509
341
|
children: s
|
|
510
342
|
},
|
|
511
343
|
s
|
|
512
344
|
)) });
|
|
513
|
-
class
|
|
514
|
-
constructor(
|
|
515
|
-
this.connector =
|
|
345
|
+
class Zt {
|
|
346
|
+
constructor(t, a) {
|
|
347
|
+
this.connector = t, this.canSend = a.canSend, this.onTurn = a.onTurn, this.onAwaitingChange = a.onAwaitingChange;
|
|
516
348
|
}
|
|
517
349
|
get canRate() {
|
|
518
350
|
return !1;
|
|
@@ -529,67 +361,67 @@ class ln {
|
|
|
529
361
|
get ratingPopupUrls() {
|
|
530
362
|
return {};
|
|
531
363
|
}
|
|
532
|
-
async sendMessage(
|
|
364
|
+
async sendMessage(t) {
|
|
533
365
|
var a, s;
|
|
534
366
|
if (!this.canSend())
|
|
535
367
|
return null;
|
|
536
368
|
(a = this.onAwaitingChange) == null || a.call(this, !0);
|
|
537
369
|
try {
|
|
538
370
|
const r = await this.connector.sendMessage(
|
|
539
|
-
|
|
540
|
-
|
|
371
|
+
t.userMessage,
|
|
372
|
+
t.uploadFiles
|
|
541
373
|
);
|
|
542
374
|
return this.onTurn(r), {
|
|
543
375
|
id: r.message.id,
|
|
544
376
|
text: r.message.text,
|
|
545
|
-
type:
|
|
377
|
+
type: ct,
|
|
546
378
|
...r.message.followUpPrompts ? { followUpPrompts: r.message.followUpPrompts } : {}
|
|
547
379
|
};
|
|
548
380
|
} catch {
|
|
549
381
|
return {
|
|
550
382
|
id: `error-${Date.now()}`,
|
|
551
|
-
text:
|
|
552
|
-
type:
|
|
383
|
+
text: Bt,
|
|
384
|
+
type: Lt
|
|
553
385
|
};
|
|
554
386
|
} finally {
|
|
555
387
|
(s = this.onAwaitingChange) == null || s.call(this, !1);
|
|
556
388
|
}
|
|
557
389
|
}
|
|
558
|
-
async loadHistory(
|
|
390
|
+
async loadHistory(t) {
|
|
559
391
|
return null;
|
|
560
392
|
}
|
|
561
393
|
async listInteractions() {
|
|
562
394
|
return null;
|
|
563
395
|
}
|
|
564
|
-
async rateMessage(
|
|
396
|
+
async rateMessage(t) {
|
|
565
397
|
}
|
|
566
|
-
async sendNotification(
|
|
398
|
+
async sendNotification(t) {
|
|
567
399
|
return !1;
|
|
568
400
|
}
|
|
569
401
|
}
|
|
570
|
-
const
|
|
571
|
-
connector:
|
|
572
|
-
phase:
|
|
402
|
+
const en = ({
|
|
403
|
+
connector: e,
|
|
404
|
+
phase: t,
|
|
573
405
|
chatHistory: a,
|
|
574
406
|
chatSessionKey: s,
|
|
575
407
|
startQuery: r,
|
|
576
408
|
clarificationMessage: l,
|
|
577
409
|
enableUpload: i = !1,
|
|
578
|
-
onTurn:
|
|
579
|
-
onAwaitingChange:
|
|
580
|
-
onClarificationPrompt:
|
|
581
|
-
onDismissClarification:
|
|
410
|
+
onTurn: o,
|
|
411
|
+
onAwaitingChange: d,
|
|
412
|
+
onClarificationPrompt: f,
|
|
413
|
+
onDismissClarification: p
|
|
582
414
|
}) => {
|
|
583
|
-
const g =
|
|
584
|
-
() => new
|
|
585
|
-
canSend: () =>
|
|
586
|
-
onTurn:
|
|
587
|
-
onAwaitingChange:
|
|
415
|
+
const g = q(
|
|
416
|
+
() => new Zt(e, {
|
|
417
|
+
canSend: () => t === L.running,
|
|
418
|
+
onTurn: o,
|
|
419
|
+
onAwaitingChange: d
|
|
588
420
|
}),
|
|
589
|
-
[t,
|
|
590
|
-
),
|
|
591
|
-
return /* @__PURE__ */
|
|
592
|
-
l && /* @__PURE__ */
|
|
421
|
+
[e, t, o, d]
|
|
422
|
+
), w = t !== L.running, u = t === L.running;
|
|
423
|
+
return /* @__PURE__ */ c("section", { className: "agent-workspace__chat-body", "aria-label": "Chat", children: [
|
|
424
|
+
l && /* @__PURE__ */ c(
|
|
593
425
|
"div",
|
|
594
426
|
{
|
|
595
427
|
className: "agent-workspace__clarification",
|
|
@@ -598,10 +430,10 @@ const cn = ({
|
|
|
598
430
|
children: [
|
|
599
431
|
/* @__PURE__ */ n("p", { className: "agent-workspace__clarification-text", children: l.text }),
|
|
600
432
|
l.followUpPrompts && /* @__PURE__ */ n(
|
|
601
|
-
|
|
433
|
+
Qt,
|
|
602
434
|
{
|
|
603
435
|
prompts: l.followUpPrompts,
|
|
604
|
-
onSelect:
|
|
436
|
+
onSelect: f
|
|
605
437
|
}
|
|
606
438
|
),
|
|
607
439
|
/* @__PURE__ */ n(
|
|
@@ -609,50 +441,50 @@ const cn = ({
|
|
|
609
441
|
{
|
|
610
442
|
type: "button",
|
|
611
443
|
className: "agent-workspace__clarification-dismiss",
|
|
612
|
-
onClick:
|
|
444
|
+
onClick: p,
|
|
613
445
|
children: "Dismiss"
|
|
614
446
|
}
|
|
615
447
|
)
|
|
616
448
|
]
|
|
617
449
|
}
|
|
618
450
|
),
|
|
619
|
-
/* @__PURE__ */ n("div", { className: "agent-workspace__ask-arbor", children: /* @__PURE__ */ n(
|
|
620
|
-
|
|
451
|
+
/* @__PURE__ */ n("div", { className: "agent-workspace__ask-arbor", children: /* @__PURE__ */ n(
|
|
452
|
+
Pt,
|
|
621
453
|
{
|
|
622
454
|
connector: g,
|
|
623
455
|
chatHistory: a,
|
|
624
456
|
startQuery: r,
|
|
625
|
-
lockConversation:
|
|
457
|
+
lockConversation: w,
|
|
626
458
|
enableUpload: i,
|
|
627
|
-
speechEnabled:
|
|
459
|
+
speechEnabled: u,
|
|
628
460
|
speechLanguage: "en-GB",
|
|
629
461
|
speechSubmissionDelay: 1e3,
|
|
630
462
|
slashMenuItems: [],
|
|
631
463
|
menuContent: [],
|
|
632
464
|
introHeading: "Message your agent",
|
|
633
465
|
introBody: "Ask questions, share trip details, or paste a link. The agent will update the checklist as it works.",
|
|
634
|
-
placeholder:
|
|
466
|
+
placeholder: u ? "Message the agent, paste a link, or attach a file…" : "The agent is not accepting messages."
|
|
635
467
|
},
|
|
636
468
|
s
|
|
637
|
-
) })
|
|
638
|
-
|
|
639
|
-
/* @__PURE__ */ n(
|
|
469
|
+
) }),
|
|
470
|
+
t === L.stopped && /* @__PURE__ */ c("div", { className: "agent-workspace__notice", role: "status", children: [
|
|
471
|
+
/* @__PURE__ */ n(E, { name: "circle-alert", size: 16, color: "var(--color-semantic-warning-600)" }),
|
|
640
472
|
/* @__PURE__ */ n("span", { children: "You stopped the agent. Its progress is saved in the checklist on the left." })
|
|
641
473
|
] }),
|
|
642
|
-
|
|
643
|
-
/* @__PURE__ */ n(
|
|
474
|
+
t === L.complete && /* @__PURE__ */ c("div", { className: "agent-workspace__notice", role: "status", children: [
|
|
475
|
+
/* @__PURE__ */ n(E, { name: "party-popper", size: 16, color: "var(--color-semantic-success-600)" }),
|
|
644
476
|
/* @__PURE__ */ n("span", { children: "The agent has finished." })
|
|
645
477
|
] })
|
|
646
478
|
] });
|
|
647
|
-
},
|
|
648
|
-
item:
|
|
649
|
-
depth:
|
|
479
|
+
}, pt = ({
|
|
480
|
+
item: e,
|
|
481
|
+
depth: t,
|
|
650
482
|
canRequestInput: a,
|
|
651
483
|
onAttentionItemClick: s
|
|
652
484
|
}) => {
|
|
653
|
-
const r =
|
|
485
|
+
const r = X[e.status], l = e.status.replace(/_/g, "-"), i = e.status === D.hitl && a && s, o = /* @__PURE__ */ c("div", { className: "agent-workspace__task-row", children: [
|
|
654
486
|
/* @__PURE__ */ n(
|
|
655
|
-
|
|
487
|
+
E,
|
|
656
488
|
{
|
|
657
489
|
name: r.icon,
|
|
658
490
|
size: 16,
|
|
@@ -660,16 +492,16 @@ const cn = ({
|
|
|
660
492
|
screenReaderText: `${r.label}:`
|
|
661
493
|
}
|
|
662
494
|
),
|
|
663
|
-
/* @__PURE__ */
|
|
664
|
-
/* @__PURE__ */ n("span", { className: "agent-workspace__task-label", children:
|
|
665
|
-
|
|
495
|
+
/* @__PURE__ */ c("div", { className: "agent-workspace__task-content", children: [
|
|
496
|
+
/* @__PURE__ */ n("span", { className: "agent-workspace__task-label", children: e.task }),
|
|
497
|
+
e.status !== D.complete && e.description && /* @__PURE__ */ n("span", { className: "agent-workspace__task-description", children: e.description })
|
|
666
498
|
] })
|
|
667
499
|
] });
|
|
668
|
-
return /* @__PURE__ */
|
|
500
|
+
return /* @__PURE__ */ c(
|
|
669
501
|
"li",
|
|
670
502
|
{
|
|
671
|
-
className:
|
|
672
|
-
"agent-workspace__task--child":
|
|
503
|
+
className: V("agent-workspace__task", `agent-workspace__task--${l}`, {
|
|
504
|
+
"agent-workspace__task--child": t > 0
|
|
673
505
|
}),
|
|
674
506
|
children: [
|
|
675
507
|
i ? /* @__PURE__ */ n(
|
|
@@ -677,31 +509,31 @@ const cn = ({
|
|
|
677
509
|
{
|
|
678
510
|
type: "button",
|
|
679
511
|
className: "agent-workspace__task-button",
|
|
680
|
-
"aria-label": `Provide input for ${
|
|
681
|
-
onClick: () => s(
|
|
682
|
-
children:
|
|
512
|
+
"aria-label": `Provide input for ${e.task}`,
|
|
513
|
+
onClick: () => s(e),
|
|
514
|
+
children: o
|
|
683
515
|
}
|
|
684
|
-
) :
|
|
685
|
-
|
|
686
|
-
|
|
516
|
+
) : o,
|
|
517
|
+
e.children && e.children.length > 0 && /* @__PURE__ */ n("ul", { className: "agent-workspace__task-children", children: e.children.map((d) => /* @__PURE__ */ n(
|
|
518
|
+
pt,
|
|
687
519
|
{
|
|
688
|
-
item:
|
|
689
|
-
depth:
|
|
520
|
+
item: d,
|
|
521
|
+
depth: t + 1,
|
|
690
522
|
canRequestInput: a,
|
|
691
523
|
onAttentionItemClick: s
|
|
692
524
|
},
|
|
693
|
-
|
|
525
|
+
d.task
|
|
694
526
|
)) })
|
|
695
527
|
]
|
|
696
528
|
}
|
|
697
529
|
);
|
|
698
|
-
},
|
|
699
|
-
items:
|
|
700
|
-
ariaLabel:
|
|
530
|
+
}, Qe = ({
|
|
531
|
+
items: e,
|
|
532
|
+
ariaLabel: t,
|
|
701
533
|
canRequestInput: a,
|
|
702
534
|
onAttentionItemClick: s
|
|
703
|
-
}) => /* @__PURE__ */ n("ul", { className: "agent-workspace__task-list", "aria-label":
|
|
704
|
-
|
|
535
|
+
}) => /* @__PURE__ */ n("ul", { className: "agent-workspace__task-list", "aria-label": t, children: e.map((r) => /* @__PURE__ */ n(
|
|
536
|
+
pt,
|
|
705
537
|
{
|
|
706
538
|
item: r,
|
|
707
539
|
depth: 0,
|
|
@@ -709,118 +541,132 @@ const cn = ({
|
|
|
709
541
|
onAttentionItemClick: s
|
|
710
542
|
},
|
|
711
543
|
r.task
|
|
712
|
-
)) }),
|
|
713
|
-
checklist:
|
|
714
|
-
isLoading:
|
|
544
|
+
)) }), tn = ({
|
|
545
|
+
checklist: e,
|
|
546
|
+
isLoading: t,
|
|
715
547
|
error: a,
|
|
716
548
|
phase: s,
|
|
717
549
|
canRequestInput: r,
|
|
718
|
-
|
|
550
|
+
onStop: l,
|
|
551
|
+
onAttentionItemClick: i
|
|
719
552
|
}) => {
|
|
720
|
-
const
|
|
721
|
-
() =>
|
|
722
|
-
[
|
|
553
|
+
const o = q(
|
|
554
|
+
() => e ? ht(e) : null,
|
|
555
|
+
[e]
|
|
723
556
|
);
|
|
724
|
-
return /* @__PURE__ */
|
|
557
|
+
return /* @__PURE__ */ c(
|
|
725
558
|
"section",
|
|
726
559
|
{
|
|
727
560
|
className: "agent-workspace__panel agent-workspace__panel--checklist",
|
|
728
561
|
"aria-label": "Checklist",
|
|
729
562
|
children: [
|
|
730
|
-
/* @__PURE__ */
|
|
731
|
-
|
|
732
|
-
|
|
563
|
+
/* @__PURE__ */ c("div", { className: "agent-workspace__panel-header", children: [
|
|
564
|
+
/* @__PURE__ */ n(ye, { level: 4, children: "Checklist" }),
|
|
565
|
+
s === L.running && /* @__PURE__ */ n(
|
|
566
|
+
Q,
|
|
567
|
+
{
|
|
568
|
+
variant: "secondary-destructive",
|
|
569
|
+
size: "S",
|
|
570
|
+
iconLeftName: "circle-x",
|
|
571
|
+
iconLeftScreenReaderText: "Stop",
|
|
572
|
+
onClick: l,
|
|
573
|
+
children: "Stop agent"
|
|
574
|
+
}
|
|
575
|
+
)
|
|
576
|
+
] }),
|
|
577
|
+
/* @__PURE__ */ c("div", { className: "agent-workspace__panel-body", "aria-live": "polite", children: [
|
|
578
|
+
t && /* @__PURE__ */ c("div", { className: "agent-workspace__loading", children: [
|
|
733
579
|
/* @__PURE__ */ n(
|
|
734
|
-
|
|
580
|
+
E,
|
|
735
581
|
{
|
|
736
582
|
name: "loader",
|
|
737
583
|
size: 16,
|
|
738
584
|
color: "var(--color-brand-600)",
|
|
739
585
|
className: "agent-workspace__task-icon--spinning",
|
|
740
|
-
screenReaderText:
|
|
586
|
+
screenReaderText: de
|
|
741
587
|
}
|
|
742
588
|
),
|
|
743
|
-
/* @__PURE__ */ n("span", { children:
|
|
589
|
+
/* @__PURE__ */ n("span", { children: de })
|
|
744
590
|
] }),
|
|
745
|
-
!
|
|
746
|
-
!
|
|
747
|
-
|
|
591
|
+
!t && a && /* @__PURE__ */ n("p", { className: "agent-workspace__error", role: "alert", children: a }),
|
|
592
|
+
!t && !a && o && /* @__PURE__ */ c(Tt, { children: [
|
|
593
|
+
o.needsInput.length > 0 && /* @__PURE__ */ c("div", { className: "agent-workspace__task-group", children: [
|
|
748
594
|
/* @__PURE__ */ n("p", { className: "agent-workspace__task-group-label", children: "Needs your input" }),
|
|
749
595
|
/* @__PURE__ */ n(
|
|
750
|
-
|
|
596
|
+
Qe,
|
|
751
597
|
{
|
|
752
|
-
items:
|
|
598
|
+
items: o.needsInput,
|
|
753
599
|
ariaLabel: "Tasks needing your input",
|
|
754
600
|
canRequestInput: r,
|
|
755
|
-
onAttentionItemClick:
|
|
601
|
+
onAttentionItemClick: i
|
|
756
602
|
}
|
|
757
603
|
)
|
|
758
604
|
] }),
|
|
759
|
-
|
|
605
|
+
o.tasks.length > 0 && /* @__PURE__ */ c(
|
|
760
606
|
"div",
|
|
761
607
|
{
|
|
762
|
-
className:
|
|
763
|
-
"agent-workspace__task-group--following":
|
|
608
|
+
className: V("agent-workspace__task-group", {
|
|
609
|
+
"agent-workspace__task-group--following": o.needsInput.length > 0
|
|
764
610
|
}),
|
|
765
611
|
children: [
|
|
766
|
-
|
|
612
|
+
o.needsInput.length > 0 && /* @__PURE__ */ n("p", { className: "agent-workspace__task-group-label", children: "Other tasks" }),
|
|
767
613
|
/* @__PURE__ */ n(
|
|
768
|
-
|
|
614
|
+
Qe,
|
|
769
615
|
{
|
|
770
|
-
items:
|
|
616
|
+
items: o.tasks,
|
|
771
617
|
ariaLabel: "Agent tasks",
|
|
772
618
|
canRequestInput: r,
|
|
773
|
-
onAttentionItemClick:
|
|
619
|
+
onAttentionItemClick: i
|
|
774
620
|
}
|
|
775
621
|
)
|
|
776
622
|
]
|
|
777
623
|
}
|
|
778
624
|
)
|
|
779
625
|
] }),
|
|
780
|
-
!
|
|
781
|
-
] })
|
|
626
|
+
!t && !a && (!o || o.needsInput.length === 0 && o.tasks.length === 0) && /* @__PURE__ */ n("p", { className: "agent-workspace__empty", children: s === L.briefing ? "Tasks will appear here once the agent starts." : "No tasks to display." })
|
|
627
|
+
] })
|
|
782
628
|
]
|
|
783
629
|
}
|
|
784
630
|
);
|
|
785
|
-
},
|
|
786
|
-
[
|
|
631
|
+
}, nn = {
|
|
632
|
+
[le.MIS_RECORD]: {
|
|
787
633
|
icon: "table",
|
|
788
634
|
label: "Arbor MIS",
|
|
789
635
|
color: "var(--color-brand-600)"
|
|
790
636
|
},
|
|
791
|
-
[
|
|
637
|
+
[le.FILE]: {
|
|
792
638
|
icon: "file",
|
|
793
639
|
label: "File",
|
|
794
640
|
color: "var(--color-semantic-caution-800)"
|
|
795
641
|
},
|
|
796
|
-
[
|
|
642
|
+
[le.WORKFLOW]: {
|
|
797
643
|
icon: "list-tree",
|
|
798
644
|
label: "Workflow",
|
|
799
645
|
color: "var(--color-semantic-warning-700)"
|
|
800
646
|
},
|
|
801
|
-
[
|
|
647
|
+
[le.LINK]: {
|
|
802
648
|
icon: "link",
|
|
803
649
|
label: "Link",
|
|
804
650
|
color: "var(--color-semantic-info-700)"
|
|
805
651
|
}
|
|
806
|
-
},
|
|
807
|
-
resources:
|
|
808
|
-
isLoading:
|
|
652
|
+
}, an = ({
|
|
653
|
+
resources: e,
|
|
654
|
+
isLoading: t = !1,
|
|
809
655
|
error: a = null
|
|
810
|
-
}) => /* @__PURE__ */
|
|
656
|
+
}) => /* @__PURE__ */ c(
|
|
811
657
|
"section",
|
|
812
658
|
{
|
|
813
659
|
className: "agent-workspace__panel agent-workspace__panel--documents",
|
|
814
660
|
"aria-label": "Resources",
|
|
815
661
|
children: [
|
|
816
|
-
/* @__PURE__ */
|
|
817
|
-
/* @__PURE__ */ n(
|
|
818
|
-
/* @__PURE__ */ n("span", { className: "agent-workspace__panel-count", children:
|
|
662
|
+
/* @__PURE__ */ c("div", { className: "agent-workspace__panel-header", children: [
|
|
663
|
+
/* @__PURE__ */ n(ye, { level: 4, children: "Resources" }),
|
|
664
|
+
/* @__PURE__ */ n("span", { className: "agent-workspace__panel-count", children: e.length })
|
|
819
665
|
] }),
|
|
820
|
-
/* @__PURE__ */
|
|
821
|
-
|
|
666
|
+
/* @__PURE__ */ c("div", { className: "agent-workspace__panel-body", "aria-live": "polite", children: [
|
|
667
|
+
t && /* @__PURE__ */ c("div", { className: "agent-workspace__loading", children: [
|
|
822
668
|
/* @__PURE__ */ n(
|
|
823
|
-
|
|
669
|
+
E,
|
|
824
670
|
{
|
|
825
671
|
name: "loader",
|
|
826
672
|
size: 16,
|
|
@@ -831,220 +677,213 @@ const cn = ({
|
|
|
831
677
|
),
|
|
832
678
|
/* @__PURE__ */ n("span", { children: "Loading resources…" })
|
|
833
679
|
] }),
|
|
834
|
-
!
|
|
835
|
-
!
|
|
836
|
-
const r =
|
|
837
|
-
return /* @__PURE__ */ n(
|
|
838
|
-
"
|
|
680
|
+
!t && a && /* @__PURE__ */ n("p", { className: "agent-workspace__error", role: "alert", children: a }),
|
|
681
|
+
!t && !a && e.length > 0 && /* @__PURE__ */ n("ul", { className: "agent-workspace__resource-list", "aria-label": "Agent resources", children: e.map((s) => {
|
|
682
|
+
const r = nn[s.type];
|
|
683
|
+
return /* @__PURE__ */ n("li", { className: "agent-workspace__resource", children: /* @__PURE__ */ c(
|
|
684
|
+
"a",
|
|
839
685
|
{
|
|
840
|
-
className: "agent-workspace__resource",
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
/* @__PURE__ */ n(
|
|
850
|
-
|
|
686
|
+
className: "agent-workspace__resource-card",
|
|
687
|
+
href: s.uri,
|
|
688
|
+
target: "_blank",
|
|
689
|
+
rel: "noreferrer",
|
|
690
|
+
children: [
|
|
691
|
+
/* @__PURE__ */ n(
|
|
692
|
+
"span",
|
|
693
|
+
{
|
|
694
|
+
className: `agent-workspace__resource-icon agent-workspace__resource-icon--${s.type.toLowerCase()}`,
|
|
695
|
+
children: /* @__PURE__ */ n(
|
|
696
|
+
E,
|
|
851
697
|
{
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
name: r.icon,
|
|
857
|
-
size: 16,
|
|
858
|
-
color: r.color,
|
|
859
|
-
screenReaderText: `${r.label}:`
|
|
860
|
-
}
|
|
861
|
-
)
|
|
698
|
+
name: r.icon,
|
|
699
|
+
size: 16,
|
|
700
|
+
color: r.color,
|
|
701
|
+
screenReaderText: `${r.label}:`
|
|
862
702
|
}
|
|
863
|
-
)
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
{
|
|
870
|
-
className: `agent-workspace__resource-badge agent-workspace__resource-badge--${s.type.toLowerCase()}`,
|
|
871
|
-
children: r.label
|
|
872
|
-
}
|
|
873
|
-
)
|
|
874
|
-
] }),
|
|
875
|
-
s.description && /* @__PURE__ */ n("span", { className: "agent-workspace__resource-description", children: s.description })
|
|
876
|
-
] }),
|
|
703
|
+
)
|
|
704
|
+
}
|
|
705
|
+
),
|
|
706
|
+
/* @__PURE__ */ c("span", { className: "agent-workspace__resource-content", children: [
|
|
707
|
+
/* @__PURE__ */ c("span", { className: "agent-workspace__resource-top", children: [
|
|
708
|
+
/* @__PURE__ */ n("span", { className: "agent-workspace__resource-name", children: s.name }),
|
|
877
709
|
/* @__PURE__ */ n(
|
|
878
|
-
|
|
710
|
+
"span",
|
|
879
711
|
{
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
color: "var(--color-grey-500)",
|
|
883
|
-
screenReaderText: "Opens in a new tab",
|
|
884
|
-
className: "agent-workspace__resource-open"
|
|
712
|
+
className: `agent-workspace__resource-badge agent-workspace__resource-badge--${s.type.toLowerCase()}`,
|
|
713
|
+
children: r.label
|
|
885
714
|
}
|
|
886
715
|
)
|
|
887
|
-
]
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
716
|
+
] }),
|
|
717
|
+
s.description && /* @__PURE__ */ n("span", { className: "agent-workspace__resource-description", children: s.description })
|
|
718
|
+
] }),
|
|
719
|
+
/* @__PURE__ */ n(
|
|
720
|
+
E,
|
|
721
|
+
{
|
|
722
|
+
name: "external-link",
|
|
723
|
+
size: 12,
|
|
724
|
+
color: "var(--color-grey-500)",
|
|
725
|
+
screenReaderText: "Opens in a new tab",
|
|
726
|
+
className: "agent-workspace__resource-open"
|
|
727
|
+
}
|
|
728
|
+
)
|
|
729
|
+
]
|
|
730
|
+
}
|
|
731
|
+
) }, `${s.type}-${s.uri}`);
|
|
893
732
|
}) }),
|
|
894
|
-
!
|
|
895
|
-
] })
|
|
733
|
+
!t && !a && e.length === 0 && /* @__PURE__ */ n("p", { className: "agent-workspace__empty", children: "No resources yet." })
|
|
734
|
+
] })
|
|
896
735
|
]
|
|
897
736
|
}
|
|
898
|
-
),
|
|
899
|
-
const
|
|
900
|
-
return Number.isFinite(
|
|
901
|
-
},
|
|
737
|
+
), Me = (e) => {
|
|
738
|
+
const t = Date.parse(e);
|
|
739
|
+
return Number.isFinite(t) ? t : 0;
|
|
740
|
+
}, sn = new Intl.DateTimeFormat("en-GB", {
|
|
902
741
|
day: "numeric",
|
|
903
742
|
month: "long",
|
|
904
743
|
year: "numeric",
|
|
905
744
|
hour: "numeric",
|
|
906
745
|
minute: "2-digit"
|
|
907
|
-
}),
|
|
908
|
-
const
|
|
909
|
-
return Number.isFinite(
|
|
910
|
-
},
|
|
746
|
+
}), qe = (e) => {
|
|
747
|
+
const t = new Date(e);
|
|
748
|
+
return Number.isFinite(t.getTime()) ? sn.format(t) : e;
|
|
749
|
+
}, Le = (e) => e.replace(
|
|
911
750
|
/[A-Za-z0-9]+(?:[_-][A-Za-z0-9]+)+/g,
|
|
912
|
-
(
|
|
913
|
-
),
|
|
914
|
-
if (
|
|
751
|
+
(t) => t.split(/[_-]/).map((a) => a.charAt(0).toUpperCase() + a.slice(1).toLowerCase()).join(" ")
|
|
752
|
+
), we = (e, t) => t <= 1 ? 0 : e / (t - 1) * 100, ut = (e) => Math.max(e, 0) + 2, rn = (e) => e + 1, on = (e, t) => {
|
|
753
|
+
if (t.length === 0)
|
|
915
754
|
return 50;
|
|
916
|
-
const a =
|
|
917
|
-
if (
|
|
755
|
+
const a = ut(t.length), s = we(1, a), r = we(t.length, a), l = t.map((p) => Me(p.timestamp)), i = Math.min(...l), o = Math.max(...l);
|
|
756
|
+
if (o <= i)
|
|
918
757
|
return s;
|
|
919
|
-
const
|
|
920
|
-
return s +
|
|
921
|
-
},
|
|
758
|
+
const d = (Me(e.timestamp) - i) / (o - i), f = Math.min(1, Math.max(0, d));
|
|
759
|
+
return s + f * (r - s);
|
|
760
|
+
}, cn = 8, ln = 20, dn = (e, t = cn, a = ln) => {
|
|
922
761
|
const s = /* @__PURE__ */ new Map();
|
|
923
|
-
if (
|
|
762
|
+
if (e.length === 0)
|
|
924
763
|
return s;
|
|
925
|
-
const r = [...
|
|
926
|
-
(i,
|
|
764
|
+
const r = [...e].sort(
|
|
765
|
+
(i, o) => i.leftPercent - o.leftPercent || i.timestampMs - o.timestampMs || i.id.localeCompare(o.id)
|
|
927
766
|
), l = [];
|
|
928
767
|
for (const i of r) {
|
|
929
|
-
const
|
|
930
|
-
|
|
768
|
+
const o = l[l.length - 1];
|
|
769
|
+
o && i.leftPercent - o[o.length - 1].leftPercent < t ? o.push(i) : l.push([i]);
|
|
931
770
|
}
|
|
932
771
|
for (const i of l) {
|
|
933
|
-
const
|
|
934
|
-
(
|
|
935
|
-
),
|
|
936
|
-
|
|
937
|
-
s.set(
|
|
772
|
+
const o = [...i].sort(
|
|
773
|
+
(f, p) => f.timestampMs - p.timestampMs || f.id.localeCompare(p.id)
|
|
774
|
+
), d = (o.length - 1) / 2;
|
|
775
|
+
o.forEach((f, p) => {
|
|
776
|
+
s.set(f.id, (p - d) * a);
|
|
938
777
|
});
|
|
939
778
|
}
|
|
940
779
|
return s;
|
|
941
|
-
},
|
|
942
|
-
left: `calc(${
|
|
780
|
+
}, Pe = (e, t = 0) => ({
|
|
781
|
+
left: `calc(${e / 100} * (100% - var(--agent-timeline-node-size)) + (var(--agent-timeline-node-size) / 2) + ${t}px)`,
|
|
943
782
|
transform: "translateX(-50%)"
|
|
944
|
-
}),
|
|
945
|
-
timeline:
|
|
946
|
-
isLoading:
|
|
783
|
+
}), gn = (e) => e.type !== "message-sent", hn = ({
|
|
784
|
+
timeline: e,
|
|
785
|
+
isLoading: t,
|
|
947
786
|
error: a,
|
|
948
787
|
onOpenChatSession: s
|
|
949
788
|
}) => {
|
|
950
|
-
const r = ((
|
|
951
|
-
id: `action-${g.timestamp}-${
|
|
952
|
-
leftPercent:
|
|
953
|
-
timestampMs:
|
|
954
|
-
})),
|
|
789
|
+
const r = ((e == null ? void 0 : e.actionLog) ?? []).filter(gn), l = (e == null ? void 0 : e.chatSessions) ?? [], i = !t && !a && r.length === 0 && l.length === 0, o = ut(r.length), d = r.map((g, w) => ({
|
|
790
|
+
id: `action-${g.timestamp}-${w}`,
|
|
791
|
+
leftPercent: we(rn(w), o),
|
|
792
|
+
timestampMs: Me(g.timestamp)
|
|
793
|
+
})), f = l.map((g) => ({
|
|
955
794
|
id: g.sessionId,
|
|
956
|
-
leftPercent:
|
|
957
|
-
timestampMs:
|
|
958
|
-
})),
|
|
959
|
-
...
|
|
960
|
-
...
|
|
795
|
+
leftPercent: on(g, r),
|
|
796
|
+
timestampMs: Me(g.timestamp)
|
|
797
|
+
})), p = dn([
|
|
798
|
+
...d,
|
|
799
|
+
...f
|
|
961
800
|
]);
|
|
962
|
-
return /* @__PURE__ */
|
|
801
|
+
return /* @__PURE__ */ c(
|
|
963
802
|
"section",
|
|
964
803
|
{
|
|
965
804
|
className: "agent-workspace__timeline",
|
|
966
805
|
"aria-label": "Agent timeline",
|
|
967
806
|
children: [
|
|
968
|
-
|
|
969
|
-
a && /* @__PURE__ */ n("p", { className: "agent-workspace__timeline-status", role: "alert", children: a ||
|
|
807
|
+
t && /* @__PURE__ */ n("p", { className: "agent-workspace__timeline-status", role: "status", children: "Loading timeline…" }),
|
|
808
|
+
a && /* @__PURE__ */ n("p", { className: "agent-workspace__timeline-status", role: "alert", children: a || dt }),
|
|
970
809
|
i && /* @__PURE__ */ n("p", { className: "agent-workspace__timeline-status", role: "status", children: "No timeline activity yet." }),
|
|
971
|
-
!
|
|
810
|
+
!t && !a && !i && /* @__PURE__ */ c("div", { className: "agent-timeline", children: [
|
|
972
811
|
/* @__PURE__ */ n("div", { className: "agent-timeline__track", "aria-hidden": "true" }),
|
|
973
|
-
/* @__PURE__ */
|
|
812
|
+
/* @__PURE__ */ c(
|
|
974
813
|
"div",
|
|
975
814
|
{
|
|
976
815
|
className: "agent-timeline__station agent-timeline__station--terminus",
|
|
977
|
-
style:
|
|
816
|
+
style: Pe(we(0, o)),
|
|
978
817
|
children: [
|
|
979
818
|
/* @__PURE__ */ n(
|
|
980
819
|
"span",
|
|
981
820
|
{
|
|
982
821
|
className: "agent-timeline__station-node agent-timeline__station-node--terminus",
|
|
983
822
|
"aria-hidden": "true",
|
|
984
|
-
children: /* @__PURE__ */ n(
|
|
823
|
+
children: /* @__PURE__ */ n(E, { name: "arrow-right-from-line", size: 16, color: "currentColor" })
|
|
985
824
|
}
|
|
986
825
|
),
|
|
987
826
|
/* @__PURE__ */ n("span", { className: "agent-timeline__terminus-label", children: "Start" })
|
|
988
827
|
]
|
|
989
828
|
}
|
|
990
829
|
),
|
|
991
|
-
r.map((g,
|
|
992
|
-
const
|
|
993
|
-
return /* @__PURE__ */
|
|
830
|
+
r.map((g, w) => {
|
|
831
|
+
const u = `action-${g.timestamp}-${w}`, b = d[w].leftPercent, k = g.type === "checklist-updated", O = g.type === "status-transition", F = k ? "checklist" : O ? "status" : "note";
|
|
832
|
+
return /* @__PURE__ */ c(
|
|
994
833
|
"div",
|
|
995
834
|
{
|
|
996
|
-
className: `agent-timeline__station agent-timeline__station--${
|
|
997
|
-
style:
|
|
835
|
+
className: `agent-timeline__station agent-timeline__station--${F}`,
|
|
836
|
+
style: Pe(b, p.get(u) ?? 0),
|
|
998
837
|
children: [
|
|
999
|
-
/* @__PURE__ */
|
|
838
|
+
/* @__PURE__ */ c(
|
|
1000
839
|
"button",
|
|
1001
840
|
{
|
|
1002
841
|
type: "button",
|
|
1003
|
-
className: `agent-timeline__station-node agent-timeline__station-node--${
|
|
1004
|
-
"aria-label": `${
|
|
842
|
+
className: `agent-timeline__station-node agent-timeline__station-node--${F}`,
|
|
843
|
+
"aria-label": `${Le(g.type)}: ${Le(g.entry)}`,
|
|
1005
844
|
children: [
|
|
1006
|
-
|
|
1007
|
-
|
|
845
|
+
k && /* @__PURE__ */ n(E, { name: "check-solid", size: 16, color: "currentColor" }),
|
|
846
|
+
O && /* @__PURE__ */ n(E, { name: "iteration-ccw", size: 16, color: "currentColor" })
|
|
1008
847
|
]
|
|
1009
848
|
}
|
|
1010
849
|
),
|
|
1011
|
-
/* @__PURE__ */
|
|
1012
|
-
/* @__PURE__ */ n("strong", { className: "agent-timeline__pill-type", children:
|
|
1013
|
-
/* @__PURE__ */ n("span", { className: "agent-timeline__pill-entry", children:
|
|
1014
|
-
/* @__PURE__ */ n("span", { className: "agent-timeline__pill-entry", children:
|
|
850
|
+
/* @__PURE__ */ c("div", { className: "agent-timeline__pill", role: "tooltip", children: [
|
|
851
|
+
/* @__PURE__ */ n("strong", { className: "agent-timeline__pill-type", children: Le(g.type) }),
|
|
852
|
+
/* @__PURE__ */ n("span", { className: "agent-timeline__pill-entry", children: Le(g.entry) }),
|
|
853
|
+
/* @__PURE__ */ n("span", { className: "agent-timeline__pill-entry", children: qe(g.timestamp) })
|
|
1015
854
|
] })
|
|
1016
855
|
]
|
|
1017
856
|
},
|
|
1018
|
-
|
|
857
|
+
u
|
|
1019
858
|
);
|
|
1020
859
|
}),
|
|
1021
|
-
/* @__PURE__ */
|
|
860
|
+
/* @__PURE__ */ c(
|
|
1022
861
|
"div",
|
|
1023
862
|
{
|
|
1024
863
|
className: "agent-timeline__station agent-timeline__station--terminus",
|
|
1025
|
-
style:
|
|
864
|
+
style: Pe(we(o - 1, o)),
|
|
1026
865
|
children: [
|
|
1027
866
|
/* @__PURE__ */ n(
|
|
1028
867
|
"span",
|
|
1029
868
|
{
|
|
1030
869
|
className: "agent-timeline__station-node agent-timeline__station-node--terminus",
|
|
1031
870
|
"aria-hidden": "true",
|
|
1032
|
-
children: /* @__PURE__ */ n(
|
|
871
|
+
children: /* @__PURE__ */ n(E, { name: "flag", size: 16, color: "currentColor" })
|
|
1033
872
|
}
|
|
1034
873
|
),
|
|
1035
874
|
/* @__PURE__ */ n("span", { className: "agent-timeline__terminus-label", children: "Finish" })
|
|
1036
875
|
]
|
|
1037
876
|
}
|
|
1038
877
|
),
|
|
1039
|
-
l.map((g,
|
|
1040
|
-
const
|
|
1041
|
-
return /* @__PURE__ */
|
|
878
|
+
l.map((g, w) => {
|
|
879
|
+
const u = f[w].leftPercent;
|
|
880
|
+
return /* @__PURE__ */ c(
|
|
1042
881
|
"div",
|
|
1043
882
|
{
|
|
1044
883
|
className: "agent-timeline__chat-station",
|
|
1045
|
-
style:
|
|
1046
|
-
|
|
1047
|
-
|
|
884
|
+
style: Pe(
|
|
885
|
+
u,
|
|
886
|
+
p.get(g.sessionId) ?? 0
|
|
1048
887
|
),
|
|
1049
888
|
children: [
|
|
1050
889
|
/* @__PURE__ */ n(
|
|
@@ -1052,14 +891,14 @@ const cn = ({
|
|
|
1052
891
|
{
|
|
1053
892
|
type: "button",
|
|
1054
893
|
className: "agent-timeline__chat-node",
|
|
1055
|
-
"aria-label": `Open chat session from ${
|
|
894
|
+
"aria-label": `Open chat session from ${qe(g.timestamp)}`,
|
|
1056
895
|
onClick: () => s(g.sessionId),
|
|
1057
|
-
children: /* @__PURE__ */ n(
|
|
896
|
+
children: /* @__PURE__ */ n(E, { name: "sparkles", size: 16, color: "currentColor" })
|
|
1058
897
|
}
|
|
1059
898
|
),
|
|
1060
|
-
/* @__PURE__ */
|
|
899
|
+
/* @__PURE__ */ c("div", { className: "agent-timeline__pill", role: "tooltip", children: [
|
|
1061
900
|
/* @__PURE__ */ n("strong", { className: "agent-timeline__pill-type", children: "Chat session" }),
|
|
1062
|
-
/* @__PURE__ */ n("span", { className: "agent-timeline__pill-entry", children:
|
|
901
|
+
/* @__PURE__ */ n("span", { className: "agent-timeline__pill-entry", children: qe(g.timestamp) })
|
|
1063
902
|
] })
|
|
1064
903
|
]
|
|
1065
904
|
},
|
|
@@ -1070,214 +909,214 @@ const cn = ({
|
|
|
1070
909
|
]
|
|
1071
910
|
}
|
|
1072
911
|
);
|
|
1073
|
-
},
|
|
912
|
+
}, pn = [
|
|
1074
913
|
"I'll get the details and come back to you",
|
|
1075
914
|
"Skip this for now"
|
|
1076
|
-
],
|
|
915
|
+
], un = (e) => {
|
|
1077
916
|
var a;
|
|
1078
|
-
const
|
|
917
|
+
const t = (a = e.prompt) != null && a.trim() ? e.prompt.trim() : `I need a bit more from you on "${e.task}". ${e.description} What can you tell me?`;
|
|
1079
918
|
return {
|
|
1080
919
|
id: `clarification-${Date.now()}`,
|
|
1081
920
|
author: ne.agent,
|
|
1082
|
-
text:
|
|
1083
|
-
followUpPrompts:
|
|
921
|
+
text: t,
|
|
922
|
+
followUpPrompts: e.clarificationPrompts ?? pn
|
|
1084
923
|
};
|
|
1085
|
-
},
|
|
1086
|
-
id:
|
|
1087
|
-
text:
|
|
1088
|
-
type:
|
|
1089
|
-
...
|
|
924
|
+
}, fe = (e) => ({
|
|
925
|
+
id: e.id,
|
|
926
|
+
text: e.text,
|
|
927
|
+
type: e.author === ne.user ? xt : e.author === ne.system ? Dt : ct,
|
|
928
|
+
...e.followUpPrompts ? { followUpPrompts: e.followUpPrompts } : {}
|
|
1090
929
|
});
|
|
1091
|
-
class
|
|
1092
|
-
constructor(
|
|
1093
|
-
super(s ?? `Agent service request failed (${
|
|
930
|
+
class ve extends Error {
|
|
931
|
+
constructor(t, a, s) {
|
|
932
|
+
super(s ?? `Agent service request failed (${t})`), this.name = "AgentServiceError", this.status = t, this.detail = a;
|
|
1094
933
|
}
|
|
1095
934
|
}
|
|
1096
|
-
const
|
|
935
|
+
const mn = "/api/v1", B = {
|
|
1097
936
|
agentDefinitions: "/agent-definitions",
|
|
1098
937
|
agents: "/agents",
|
|
1099
938
|
conversations: "/conversations",
|
|
1100
939
|
tripOptions: "/trip-options",
|
|
1101
940
|
demoDataset: "/demo/dataset"
|
|
1102
|
-
},
|
|
941
|
+
}, z = {
|
|
1103
942
|
GET: "GET",
|
|
1104
943
|
POST: "POST"
|
|
1105
|
-
},
|
|
944
|
+
}, _n = {
|
|
1106
945
|
error: "error"
|
|
1107
|
-
},
|
|
946
|
+
}, fn = {
|
|
1108
947
|
user: "user"
|
|
1109
|
-
},
|
|
948
|
+
}, ge = {
|
|
1110
949
|
acceptJson: "application/json",
|
|
1111
950
|
acceptEventStream: "text/event-stream",
|
|
1112
951
|
contentTypeJson: "application/json",
|
|
1113
952
|
arborApplicationUrl: "X-Arbor-Application-Url"
|
|
1114
|
-
},
|
|
1115
|
-
class
|
|
1116
|
-
constructor(
|
|
953
|
+
}, vn = /:invocationId\b/g, wn = (e) => e.trim().replace(/^Bearer\s+/i, ""), yn = (e) => e.endsWith("/") ? e.slice(0, -1) : e;
|
|
954
|
+
class We {
|
|
955
|
+
constructor(t) {
|
|
1117
956
|
var s;
|
|
1118
|
-
this.baseUrl =
|
|
1119
|
-
const a = (s =
|
|
1120
|
-
this.token = a ?
|
|
957
|
+
this.baseUrl = yn(t.baseUrl ?? "");
|
|
958
|
+
const a = (s = t.token) == null ? void 0 : s.trim();
|
|
959
|
+
this.token = a ? wn(a) : void 0, this.customHeaders = t.headers, this.urls = t.urls ?? {}, this.fetchImpl = t.fetch ?? globalThis.fetch.bind(globalThis);
|
|
1121
960
|
}
|
|
1122
961
|
// Replaces the extra headers merged into every subsequent request,
|
|
1123
962
|
// without recreating the client (e.g. an application-URL header that
|
|
1124
963
|
// changes as the user switches institutions).
|
|
1125
|
-
setHeaders(
|
|
1126
|
-
this.customHeaders =
|
|
964
|
+
setHeaders(t) {
|
|
965
|
+
this.customHeaders = t;
|
|
1127
966
|
}
|
|
1128
967
|
async listAgentDefinitions() {
|
|
1129
968
|
return (await this.request(
|
|
1130
|
-
|
|
1131
|
-
this.resolveUrl("agentDefinitions",
|
|
969
|
+
z.GET,
|
|
970
|
+
this.resolveUrl("agentDefinitions", B.agentDefinitions)
|
|
1132
971
|
)).agent_definitions ?? [];
|
|
1133
972
|
}
|
|
1134
|
-
getAgentDefinition(
|
|
973
|
+
getAgentDefinition(t) {
|
|
1135
974
|
return this.request(
|
|
1136
|
-
|
|
975
|
+
z.GET,
|
|
1137
976
|
this.apiUrl(
|
|
1138
|
-
`${
|
|
977
|
+
`${B.agentDefinitions}/${encodeURIComponent(t)}`
|
|
1139
978
|
)
|
|
1140
979
|
);
|
|
1141
980
|
}
|
|
1142
981
|
listTripOptions() {
|
|
1143
982
|
return this.request(
|
|
1144
|
-
|
|
1145
|
-
this.apiUrl(
|
|
983
|
+
z.GET,
|
|
984
|
+
this.apiUrl(B.tripOptions)
|
|
1146
985
|
);
|
|
1147
986
|
}
|
|
1148
987
|
getDataset() {
|
|
1149
988
|
return this.request(
|
|
1150
|
-
|
|
1151
|
-
this.apiUrl(
|
|
989
|
+
z.GET,
|
|
990
|
+
this.apiUrl(B.demoDataset)
|
|
1152
991
|
);
|
|
1153
992
|
}
|
|
1154
|
-
setDataset(
|
|
993
|
+
setDataset(t) {
|
|
1155
994
|
return this.request(
|
|
1156
|
-
|
|
1157
|
-
this.apiUrl(
|
|
1158
|
-
{ dataset:
|
|
995
|
+
z.POST,
|
|
996
|
+
this.apiUrl(B.demoDataset),
|
|
997
|
+
{ dataset: t }
|
|
1159
998
|
);
|
|
1160
999
|
}
|
|
1161
|
-
listAgents(
|
|
1000
|
+
listAgents(t = {}) {
|
|
1162
1001
|
const a = new URLSearchParams();
|
|
1163
|
-
|
|
1002
|
+
t.status && a.set("status", t.status), t.agentDefinitionRef && a.set("agent_definition_ref", t.agentDefinitionRef);
|
|
1164
1003
|
const s = a.toString() ? `?${a.toString()}` : "";
|
|
1165
1004
|
return this.request(
|
|
1166
|
-
|
|
1167
|
-
`${this.resolveUrl("agents",
|
|
1005
|
+
z.GET,
|
|
1006
|
+
`${this.resolveUrl("agents", B.agents)}${s}`
|
|
1168
1007
|
);
|
|
1169
1008
|
}
|
|
1170
|
-
createAgent(
|
|
1171
|
-
var i,
|
|
1009
|
+
createAgent(t, a = {}) {
|
|
1010
|
+
var i, o;
|
|
1172
1011
|
const s = {
|
|
1173
|
-
agent_definition_ref:
|
|
1174
|
-
}, r = (i = a.invocationName) == null ? void 0 : i.trim(), l = (
|
|
1012
|
+
agent_definition_ref: t
|
|
1013
|
+
}, r = (i = a.invocationName) == null ? void 0 : i.trim(), l = (o = a.agentIntent) == null ? void 0 : o.trim();
|
|
1175
1014
|
return r && (s.invocation_name = r), l && (s.agent_intent = l), this.request(
|
|
1176
|
-
|
|
1177
|
-
this.resolveUrl("agents",
|
|
1015
|
+
z.POST,
|
|
1016
|
+
this.resolveUrl("agents", B.agents),
|
|
1178
1017
|
s
|
|
1179
1018
|
);
|
|
1180
1019
|
}
|
|
1181
|
-
getAgent(
|
|
1020
|
+
getAgent(t) {
|
|
1182
1021
|
return this.request(
|
|
1183
|
-
|
|
1022
|
+
z.GET,
|
|
1184
1023
|
this.resolveUrl(
|
|
1185
1024
|
"agent",
|
|
1186
|
-
`${
|
|
1187
|
-
|
|
1025
|
+
`${B.agents}/${encodeURIComponent(t)}`,
|
|
1026
|
+
t
|
|
1188
1027
|
)
|
|
1189
1028
|
);
|
|
1190
1029
|
}
|
|
1191
|
-
getAgentChecklist(
|
|
1030
|
+
getAgentChecklist(t) {
|
|
1192
1031
|
return this.request(
|
|
1193
|
-
|
|
1032
|
+
z.GET,
|
|
1194
1033
|
this.resolveUrl(
|
|
1195
1034
|
"agentChecklist",
|
|
1196
|
-
`${
|
|
1197
|
-
|
|
1035
|
+
`${B.agents}/${encodeURIComponent(t)}/checklist`,
|
|
1036
|
+
t
|
|
1198
1037
|
)
|
|
1199
1038
|
);
|
|
1200
1039
|
}
|
|
1201
|
-
getAgentResources(
|
|
1040
|
+
getAgentResources(t) {
|
|
1202
1041
|
return this.request(
|
|
1203
|
-
|
|
1042
|
+
z.GET,
|
|
1204
1043
|
this.resolveUrl(
|
|
1205
1044
|
"agentResources",
|
|
1206
|
-
`${
|
|
1207
|
-
|
|
1045
|
+
`${B.agents}/${encodeURIComponent(t)}/resources`,
|
|
1046
|
+
t
|
|
1208
1047
|
)
|
|
1209
1048
|
);
|
|
1210
1049
|
}
|
|
1211
|
-
getAgentTimeline(
|
|
1050
|
+
getAgentTimeline(t) {
|
|
1212
1051
|
return this.request(
|
|
1213
|
-
|
|
1052
|
+
z.GET,
|
|
1214
1053
|
this.resolveUrl(
|
|
1215
1054
|
"agentTimeline",
|
|
1216
|
-
`${
|
|
1217
|
-
|
|
1055
|
+
`${B.agents}/${encodeURIComponent(t)}/agent-timeline`,
|
|
1056
|
+
t
|
|
1218
1057
|
)
|
|
1219
1058
|
);
|
|
1220
1059
|
}
|
|
1221
|
-
getAgentContext(
|
|
1060
|
+
getAgentContext(t) {
|
|
1222
1061
|
return this.request(
|
|
1223
|
-
|
|
1062
|
+
z.GET,
|
|
1224
1063
|
this.apiUrl(
|
|
1225
|
-
`${
|
|
1064
|
+
`${B.agents}/${encodeURIComponent(t)}/context`
|
|
1226
1065
|
)
|
|
1227
1066
|
);
|
|
1228
1067
|
}
|
|
1229
|
-
cancelAgent(
|
|
1068
|
+
cancelAgent(t) {
|
|
1230
1069
|
return this.request(
|
|
1231
|
-
|
|
1070
|
+
z.POST,
|
|
1232
1071
|
this.apiUrl(
|
|
1233
|
-
`${
|
|
1072
|
+
`${B.agents}/${encodeURIComponent(t)}/cancel`
|
|
1234
1073
|
)
|
|
1235
1074
|
);
|
|
1236
1075
|
}
|
|
1237
|
-
archiveAgent(
|
|
1076
|
+
archiveAgent(t) {
|
|
1238
1077
|
return this.request(
|
|
1239
|
-
|
|
1078
|
+
z.POST,
|
|
1240
1079
|
this.apiUrl(
|
|
1241
|
-
`${
|
|
1080
|
+
`${B.agents}/${encodeURIComponent(t)}/archive`
|
|
1242
1081
|
)
|
|
1243
1082
|
);
|
|
1244
1083
|
}
|
|
1245
|
-
getConversation(
|
|
1084
|
+
getConversation(t) {
|
|
1246
1085
|
return this.request(
|
|
1247
|
-
|
|
1086
|
+
z.GET,
|
|
1248
1087
|
this.resolveUrl(
|
|
1249
1088
|
"agentConversation",
|
|
1250
|
-
`${
|
|
1251
|
-
|
|
1089
|
+
`${B.conversations}/${encodeURIComponent(t)}`,
|
|
1090
|
+
t
|
|
1252
1091
|
)
|
|
1253
1092
|
);
|
|
1254
1093
|
}
|
|
1255
1094
|
// Streams a chat turn. Resolves with the final SSE event; `onEvent` fires
|
|
1256
1095
|
// for every event as it arrives.
|
|
1257
|
-
async chat(
|
|
1096
|
+
async chat(t, a, s = {}) {
|
|
1258
1097
|
const r = !!(s.uploadFiles && s.uploadFiles.length > 0), l = await this.fetchImpl(
|
|
1259
1098
|
this.resolveUrl(
|
|
1260
1099
|
"agentChat",
|
|
1261
|
-
`${
|
|
1262
|
-
|
|
1100
|
+
`${B.agents}/${encodeURIComponent(t)}/chat`,
|
|
1101
|
+
t
|
|
1263
1102
|
),
|
|
1264
1103
|
{
|
|
1265
|
-
method:
|
|
1104
|
+
method: z.POST,
|
|
1266
1105
|
headers: {
|
|
1267
1106
|
...this.customHeaders,
|
|
1268
1107
|
...this.authHeaders(),
|
|
1269
|
-
Accept:
|
|
1108
|
+
Accept: ge.acceptEventStream,
|
|
1270
1109
|
// Let the browser set the multipart boundary when uploading.
|
|
1271
|
-
...r ? {} : { "Content-Type":
|
|
1110
|
+
...r ? {} : { "Content-Type": ge.contentTypeJson }
|
|
1272
1111
|
},
|
|
1273
|
-
body: r ?
|
|
1112
|
+
body: r ? kn(a, s.uploadFiles ?? []) : JSON.stringify(a),
|
|
1274
1113
|
signal: s.signal
|
|
1275
1114
|
}
|
|
1276
1115
|
);
|
|
1277
1116
|
if (!l.ok)
|
|
1278
1117
|
throw await this.toError(l);
|
|
1279
1118
|
if (!l.body)
|
|
1280
|
-
throw new
|
|
1119
|
+
throw new ve(
|
|
1281
1120
|
l.status,
|
|
1282
1121
|
null,
|
|
1283
1122
|
"Chat response contained no stream body"
|
|
@@ -1288,28 +1127,28 @@ class Ze {
|
|
|
1288
1127
|
return this.token ? { Authorization: `Bearer ${this.token}` } : {};
|
|
1289
1128
|
}
|
|
1290
1129
|
// Builds a URL from the base url + shared API prefix + route.
|
|
1291
|
-
apiUrl(
|
|
1292
|
-
return `${this.baseUrl}${
|
|
1130
|
+
apiUrl(t) {
|
|
1131
|
+
return `${this.baseUrl}${mn}${t}`;
|
|
1293
1132
|
}
|
|
1294
1133
|
// Resolves the URL for an operation, preferring a per-operation override
|
|
1295
1134
|
// (with `:invocationId` substituted) and falling back to the base url.
|
|
1296
|
-
resolveUrl(
|
|
1297
|
-
const r = this.urls[
|
|
1135
|
+
resolveUrl(t, a, s) {
|
|
1136
|
+
const r = this.urls[t];
|
|
1298
1137
|
return r ? s ? r.replace(
|
|
1299
|
-
|
|
1138
|
+
vn,
|
|
1300
1139
|
encodeURIComponent(s)
|
|
1301
1140
|
) : r : this.apiUrl(a);
|
|
1302
1141
|
}
|
|
1303
|
-
async request(
|
|
1142
|
+
async request(t, a, s) {
|
|
1304
1143
|
const r = await this.fetchImpl(
|
|
1305
1144
|
a,
|
|
1306
1145
|
{
|
|
1307
|
-
method:
|
|
1146
|
+
method: t,
|
|
1308
1147
|
headers: {
|
|
1309
1148
|
...this.customHeaders,
|
|
1310
1149
|
...this.authHeaders(),
|
|
1311
|
-
Accept:
|
|
1312
|
-
...s === void 0 ? {} : { "Content-Type":
|
|
1150
|
+
Accept: ge.acceptJson,
|
|
1151
|
+
...s === void 0 ? {} : { "Content-Type": ge.contentTypeJson }
|
|
1313
1152
|
},
|
|
1314
1153
|
...s === void 0 ? {} : { body: JSON.stringify(s) }
|
|
1315
1154
|
}
|
|
@@ -1319,50 +1158,50 @@ class Ze {
|
|
|
1319
1158
|
if (r.status !== 204)
|
|
1320
1159
|
return await r.json();
|
|
1321
1160
|
}
|
|
1322
|
-
async toError(
|
|
1161
|
+
async toError(t) {
|
|
1323
1162
|
let a = null;
|
|
1324
1163
|
try {
|
|
1325
|
-
a = await
|
|
1164
|
+
a = await t.json();
|
|
1326
1165
|
} catch {
|
|
1327
1166
|
}
|
|
1328
|
-
return new
|
|
1329
|
-
|
|
1167
|
+
return new ve(
|
|
1168
|
+
t.status,
|
|
1330
1169
|
a,
|
|
1331
|
-
`Agent service request failed (${
|
|
1170
|
+
`Agent service request failed (${t.status} ${t.statusText})`
|
|
1332
1171
|
);
|
|
1333
1172
|
}
|
|
1334
|
-
async consumeSse(
|
|
1335
|
-
const s =
|
|
1173
|
+
async consumeSse(t, a) {
|
|
1174
|
+
const s = t.getReader(), r = new TextDecoder();
|
|
1336
1175
|
let l = "", i;
|
|
1337
|
-
const
|
|
1338
|
-
const { event:
|
|
1339
|
-
if (
|
|
1176
|
+
const o = (d) => {
|
|
1177
|
+
const { event: f, data: p } = Nn(d);
|
|
1178
|
+
if (p === null)
|
|
1340
1179
|
return;
|
|
1341
|
-
if (
|
|
1342
|
-
const
|
|
1343
|
-
throw new
|
|
1180
|
+
if (f === _n.error) {
|
|
1181
|
+
const w = Ze(p);
|
|
1182
|
+
throw new ve(
|
|
1344
1183
|
502,
|
|
1345
|
-
|
|
1346
|
-
(
|
|
1184
|
+
w,
|
|
1185
|
+
(w == null ? void 0 : w.message) ?? "Chat stream error"
|
|
1347
1186
|
);
|
|
1348
1187
|
}
|
|
1349
|
-
const g =
|
|
1188
|
+
const g = Ze(p);
|
|
1350
1189
|
g && (i = g, a == null || a(g));
|
|
1351
1190
|
};
|
|
1352
1191
|
for (; ; ) {
|
|
1353
|
-
const { done:
|
|
1354
|
-
if (
|
|
1192
|
+
const { done: d, value: f } = await s.read();
|
|
1193
|
+
if (d)
|
|
1355
1194
|
break;
|
|
1356
|
-
l += r.decode(
|
|
1357
|
-
const
|
|
1195
|
+
l += r.decode(f, { stream: !0 });
|
|
1196
|
+
const p = l.split(`
|
|
1358
1197
|
|
|
1359
1198
|
`);
|
|
1360
|
-
l =
|
|
1361
|
-
for (const g of
|
|
1362
|
-
|
|
1199
|
+
l = p.pop() ?? "";
|
|
1200
|
+
for (const g of p)
|
|
1201
|
+
o(g);
|
|
1363
1202
|
}
|
|
1364
|
-
if (l.trim() &&
|
|
1365
|
-
throw new
|
|
1203
|
+
if (l.trim() && o(l), !i)
|
|
1204
|
+
throw new ve(
|
|
1366
1205
|
502,
|
|
1367
1206
|
null,
|
|
1368
1207
|
"Chat stream ended without any events"
|
|
@@ -1370,178 +1209,178 @@ class Ze {
|
|
|
1370
1209
|
return i;
|
|
1371
1210
|
}
|
|
1372
1211
|
}
|
|
1373
|
-
const
|
|
1374
|
-
let
|
|
1212
|
+
const Nn = (e) => {
|
|
1213
|
+
let t = null;
|
|
1375
1214
|
const a = [];
|
|
1376
|
-
for (const s of
|
|
1215
|
+
for (const s of e.split(`
|
|
1377
1216
|
`)) {
|
|
1378
1217
|
const r = s.trimEnd();
|
|
1379
|
-
r.startsWith("event:") ?
|
|
1218
|
+
r.startsWith("event:") ? t = r.slice(6).trim() : r.startsWith("data:") && a.push(r.slice(5).trim());
|
|
1380
1219
|
}
|
|
1381
1220
|
return {
|
|
1382
|
-
event:
|
|
1221
|
+
event: t,
|
|
1383
1222
|
data: a.length > 0 ? a.join(`
|
|
1384
1223
|
`) : null
|
|
1385
1224
|
};
|
|
1386
|
-
},
|
|
1225
|
+
}, Ze = (e) => {
|
|
1387
1226
|
try {
|
|
1388
|
-
return JSON.parse(
|
|
1227
|
+
return JSON.parse(e);
|
|
1389
1228
|
} catch {
|
|
1390
1229
|
return;
|
|
1391
1230
|
}
|
|
1392
1231
|
};
|
|
1393
|
-
function
|
|
1232
|
+
function kn(e, t) {
|
|
1394
1233
|
const a = new FormData();
|
|
1395
|
-
a.append("body", JSON.stringify(
|
|
1396
|
-
for (const s of
|
|
1234
|
+
a.append("body", JSON.stringify(e));
|
|
1235
|
+
for (const s of t)
|
|
1397
1236
|
a.append("files", s, s.name);
|
|
1398
1237
|
return a;
|
|
1399
1238
|
}
|
|
1400
|
-
const
|
|
1401
|
-
switch (
|
|
1402
|
-
case
|
|
1403
|
-
return
|
|
1404
|
-
case
|
|
1405
|
-
return
|
|
1406
|
-
case
|
|
1407
|
-
case
|
|
1408
|
-
case
|
|
1409
|
-
case
|
|
1410
|
-
return
|
|
1239
|
+
const An = (e) => {
|
|
1240
|
+
switch (e) {
|
|
1241
|
+
case Ye.cancelled:
|
|
1242
|
+
return S.failed;
|
|
1243
|
+
case Ye.archived:
|
|
1244
|
+
return S.complete;
|
|
1245
|
+
case S.hitl:
|
|
1246
|
+
case S.complete:
|
|
1247
|
+
case S.failed:
|
|
1248
|
+
case S["generating-a-response"]:
|
|
1249
|
+
return e;
|
|
1411
1250
|
default:
|
|
1412
|
-
return
|
|
1251
|
+
return S["generating-a-response"];
|
|
1413
1252
|
}
|
|
1414
|
-
},
|
|
1415
|
-
switch (
|
|
1416
|
-
case
|
|
1417
|
-
return
|
|
1418
|
-
case
|
|
1419
|
-
case
|
|
1420
|
-
return
|
|
1421
|
-
case
|
|
1422
|
-
case
|
|
1423
|
-
case
|
|
1424
|
-
case
|
|
1425
|
-
return
|
|
1253
|
+
}, Cn = (e) => {
|
|
1254
|
+
switch (e) {
|
|
1255
|
+
case Ge.requires_attention:
|
|
1256
|
+
return D.hitl;
|
|
1257
|
+
case Ge.in_progress:
|
|
1258
|
+
case Ge.available:
|
|
1259
|
+
return D["generating-a-response"];
|
|
1260
|
+
case D.failed:
|
|
1261
|
+
case D.complete:
|
|
1262
|
+
case D.hitl:
|
|
1263
|
+
case D["generating-a-response"]:
|
|
1264
|
+
return e;
|
|
1426
1265
|
default:
|
|
1427
|
-
return
|
|
1266
|
+
return D["generating-a-response"];
|
|
1428
1267
|
}
|
|
1429
|
-
},
|
|
1430
|
-
ref:
|
|
1431
|
-
display_name:
|
|
1432
|
-
agent_intent:
|
|
1433
|
-
description:
|
|
1434
|
-
}),
|
|
1435
|
-
id:
|
|
1436
|
-
name:
|
|
1437
|
-
...
|
|
1438
|
-
}),
|
|
1439
|
-
uri:
|
|
1440
|
-
type:
|
|
1441
|
-
name:
|
|
1442
|
-
description:
|
|
1443
|
-
}),
|
|
1444
|
-
actionLog: (
|
|
1445
|
-
timestamp:
|
|
1446
|
-
type:
|
|
1447
|
-
entry:
|
|
1448
|
-
origin:
|
|
1268
|
+
}, mt = (e) => ({
|
|
1269
|
+
ref: e.name,
|
|
1270
|
+
display_name: e.display_name,
|
|
1271
|
+
agent_intent: e.agent_intent ?? e.display_name,
|
|
1272
|
+
description: e.description
|
|
1273
|
+
}), sa = (e) => ({
|
|
1274
|
+
id: e.id,
|
|
1275
|
+
name: e.name,
|
|
1276
|
+
...e.has_run_before ? { hasRunBefore: e.has_run_before } : {}
|
|
1277
|
+
}), Sn = new Set(Object.values(le)), bn = (e) => e && Sn.has(e) ? e : le.LINK, Tn = (e) => ({
|
|
1278
|
+
uri: e.uri ?? "",
|
|
1279
|
+
type: bn(e.type),
|
|
1280
|
+
name: e.name ?? "",
|
|
1281
|
+
description: e.description ?? ""
|
|
1282
|
+
}), _t = (e) => (Array.isArray(e) ? e : e.resources ?? []).map(Tn), En = (e) => ({
|
|
1283
|
+
actionLog: (e.action_log ?? []).map((t) => ({
|
|
1284
|
+
timestamp: t.timestamp,
|
|
1285
|
+
type: t.type,
|
|
1286
|
+
entry: t.entry,
|
|
1287
|
+
origin: t.origin
|
|
1449
1288
|
})),
|
|
1450
|
-
chatSessions: (
|
|
1451
|
-
sessionId:
|
|
1452
|
-
timestamp:
|
|
1289
|
+
chatSessions: (e.chat_sessions ?? []).map((t) => ({
|
|
1290
|
+
sessionId: t.session_id,
|
|
1291
|
+
timestamp: t.timestamp
|
|
1453
1292
|
}))
|
|
1454
|
-
}),
|
|
1293
|
+
}), et = (e) => {
|
|
1455
1294
|
var a;
|
|
1456
|
-
const
|
|
1295
|
+
const t = e.invocation_id ?? e.id;
|
|
1457
1296
|
return {
|
|
1458
|
-
id:
|
|
1459
|
-
invocation_id:
|
|
1460
|
-
agent_definition_ref:
|
|
1461
|
-
...
|
|
1462
|
-
invocation_name: ((a =
|
|
1463
|
-
application_id:
|
|
1464
|
-
...
|
|
1465
|
-
created_by:
|
|
1466
|
-
status:
|
|
1467
|
-
context_ref:
|
|
1468
|
-
checklist_ref:
|
|
1297
|
+
id: e.id,
|
|
1298
|
+
invocation_id: t,
|
|
1299
|
+
agent_definition_ref: e.agent_definition_ref,
|
|
1300
|
+
...e.agent_intent ? { agent_intent: e.agent_intent } : {},
|
|
1301
|
+
invocation_name: ((a = e.invocation_name) == null ? void 0 : a.trim()) || e.agent_definition_ref,
|
|
1302
|
+
application_id: e.application_id,
|
|
1303
|
+
...e.application_name ? { application_name: e.application_name } : {},
|
|
1304
|
+
created_by: e.created_by,
|
|
1305
|
+
status: An(e.status),
|
|
1306
|
+
context_ref: e.context_ref ?? null,
|
|
1307
|
+
checklist_ref: e.checklist_ref ?? null
|
|
1469
1308
|
};
|
|
1470
|
-
},
|
|
1471
|
-
var
|
|
1309
|
+
}, ft = (e) => {
|
|
1310
|
+
var t;
|
|
1472
1311
|
return {
|
|
1473
|
-
task:
|
|
1474
|
-
status:
|
|
1475
|
-
description:
|
|
1476
|
-
...
|
|
1477
|
-
...(
|
|
1312
|
+
task: e.task ?? e.name ?? e.label ?? zt,
|
|
1313
|
+
status: Cn(e.status),
|
|
1314
|
+
description: e.description ?? "",
|
|
1315
|
+
...e.prompt ? { prompt: e.prompt } : {},
|
|
1316
|
+
...(t = e.follow_up_prompts) != null && t.length ? { clarificationPrompts: e.follow_up_prompts } : {}
|
|
1478
1317
|
};
|
|
1479
|
-
},
|
|
1318
|
+
}, In = (e) => Array.isArray(e) ? e : e.checklist_items ?? e.checklist ?? e.items ?? [], vt = (e, t, a) => {
|
|
1480
1319
|
var l;
|
|
1481
|
-
const s = !Array.isArray(
|
|
1320
|
+
const s = !Array.isArray(t) && (t.opening_message || (l = t.opening_follow_up_prompts) != null && l.length) ? t : a, r = s ? $e(s) : void 0;
|
|
1482
1321
|
return {
|
|
1483
|
-
invocation_id:
|
|
1484
|
-
checklist:
|
|
1322
|
+
invocation_id: e,
|
|
1323
|
+
checklist: In(t).map(ft),
|
|
1485
1324
|
...r ? { openingMessage: r } : {}
|
|
1486
1325
|
};
|
|
1487
|
-
},
|
|
1488
|
-
const a =
|
|
1326
|
+
}, Rn = (e, t) => {
|
|
1327
|
+
const a = $e(t);
|
|
1489
1328
|
return {
|
|
1490
|
-
invocation_id:
|
|
1491
|
-
checklist: (
|
|
1329
|
+
invocation_id: t.invocation_id ?? e,
|
|
1330
|
+
checklist: (t.checklist_items ?? []).map(ft),
|
|
1492
1331
|
...a ? { openingMessage: a } : {}
|
|
1493
1332
|
};
|
|
1494
|
-
},
|
|
1333
|
+
}, $e = (e) => {
|
|
1495
1334
|
var a, s;
|
|
1496
|
-
const
|
|
1497
|
-
if (
|
|
1335
|
+
const t = (a = e.opening_message) == null ? void 0 : a.trim();
|
|
1336
|
+
if (t)
|
|
1498
1337
|
return {
|
|
1499
|
-
id:
|
|
1338
|
+
id: lt,
|
|
1500
1339
|
author: ne.agent,
|
|
1501
|
-
text:
|
|
1502
|
-
...(s =
|
|
1340
|
+
text: t,
|
|
1341
|
+
...(s = e.opening_follow_up_prompts) != null && s.length ? { followUpPrompts: e.opening_follow_up_prompts } : {}
|
|
1503
1342
|
};
|
|
1504
|
-
},
|
|
1505
|
-
(
|
|
1506
|
-
).map((
|
|
1507
|
-
id:
|
|
1508
|
-
author:
|
|
1509
|
-
text:
|
|
1510
|
-
})),
|
|
1511
|
-
id:
|
|
1343
|
+
}, On = (e) => e.filter(
|
|
1344
|
+
(t) => (t.role === "user" || t.role === "assistant") && typeof t.content == "string" && t.content.length > 0 && t.message_type !== "tool_request"
|
|
1345
|
+
).map((t) => ({
|
|
1346
|
+
id: t.message_id,
|
|
1347
|
+
author: t.role === "user" ? ne.user : ne.agent,
|
|
1348
|
+
text: t.content
|
|
1349
|
+
})), Ln = {
|
|
1350
|
+
id: lt,
|
|
1512
1351
|
author: ne.agent,
|
|
1513
1352
|
text: "Type a question or upload a file. You can ask it how it's progressing, or send an instruction and it'll act on it."
|
|
1514
1353
|
};
|
|
1515
|
-
let
|
|
1516
|
-
const
|
|
1517
|
-
const
|
|
1518
|
-
return `Let's get started on ${
|
|
1354
|
+
let tt = 0;
|
|
1355
|
+
const Pn = (e) => (tt += 1, `${e}-${Date.now()}-${tt}`), xn = (e) => {
|
|
1356
|
+
const t = e.destination ? ` to ${e.destination}` : "";
|
|
1357
|
+
return `Let's get started on ${e.tripName.trim() || e.destination.trim() || "this task"}${t}. What will you do first?`;
|
|
1519
1358
|
};
|
|
1520
|
-
class
|
|
1521
|
-
constructor(
|
|
1522
|
-
this.seededChecklist = [], this.client =
|
|
1359
|
+
class Dn {
|
|
1360
|
+
constructor(t, a, s = {}) {
|
|
1361
|
+
this.seededChecklist = [], this.client = t, this.agentId = a, this.chatId = s.chatId ?? a, this.opening = s.openingMessage ?? Ln, this.model = s.model;
|
|
1523
1362
|
}
|
|
1524
1363
|
openingMessage() {
|
|
1525
1364
|
return this.opening;
|
|
1526
1365
|
}
|
|
1527
1366
|
async bootstrapConversation() {
|
|
1528
|
-
const
|
|
1367
|
+
const t = await this.client.getConversation(this.chatId), a = On(t.messages);
|
|
1529
1368
|
return a.length === 0 ? [this.opening] : a;
|
|
1530
1369
|
}
|
|
1531
|
-
async start(
|
|
1532
|
-
return { ...await this.exchange(
|
|
1370
|
+
async start(t) {
|
|
1371
|
+
return { ...await this.exchange(xn(t)), phase: L.running };
|
|
1533
1372
|
}
|
|
1534
|
-
sendMessage(
|
|
1535
|
-
return this.exchange(
|
|
1373
|
+
sendMessage(t, a) {
|
|
1374
|
+
return this.exchange(t, a);
|
|
1536
1375
|
}
|
|
1537
1376
|
async stop() {
|
|
1538
1377
|
}
|
|
1539
|
-
seedChecklist(
|
|
1540
|
-
this.seededChecklist =
|
|
1378
|
+
seedChecklist(t) {
|
|
1379
|
+
this.seededChecklist = t;
|
|
1541
1380
|
}
|
|
1542
|
-
async exchange(
|
|
1381
|
+
async exchange(t, a) {
|
|
1543
1382
|
var i;
|
|
1544
|
-
const s = [{ role:
|
|
1383
|
+
const s = [{ role: fn.user, content: t }], r = await this.client.chat(
|
|
1545
1384
|
this.agentId,
|
|
1546
1385
|
{
|
|
1547
1386
|
messages: s,
|
|
@@ -1555,150 +1394,150 @@ class Gn {
|
|
|
1555
1394
|
},
|
|
1556
1395
|
...a && a.length > 0 ? [{ uploadFiles: a }] : []
|
|
1557
1396
|
), l = {
|
|
1558
|
-
id: r.event_id ||
|
|
1397
|
+
id: r.event_id || Pn("msg-agent"),
|
|
1559
1398
|
author: ne.agent,
|
|
1560
1399
|
text: r.message.content,
|
|
1561
1400
|
...(i = r.follow_up_prompts) != null && i.length ? { followUpPrompts: r.follow_up_prompts } : {}
|
|
1562
1401
|
};
|
|
1563
1402
|
try {
|
|
1564
|
-
const
|
|
1565
|
-
return this.seededChecklist =
|
|
1403
|
+
const o = await this.client.getAgent(this.agentId), { checklist: d } = Rn(this.agentId, o);
|
|
1404
|
+
return this.seededChecklist = d, { message: l, checklist: d };
|
|
1566
1405
|
} catch {
|
|
1567
1406
|
return { message: l, ...this.seededChecklist.length ? { checklist: this.seededChecklist } : {} };
|
|
1568
1407
|
}
|
|
1569
1408
|
}
|
|
1570
1409
|
}
|
|
1571
|
-
const
|
|
1410
|
+
const wt = (e, t) => (a) => {
|
|
1572
1411
|
var s, r;
|
|
1573
|
-
return new
|
|
1574
|
-
model:
|
|
1575
|
-
chatId: ((s =
|
|
1576
|
-
openingMessage: ((r =
|
|
1412
|
+
return new Dn(e, a.invocation_id, {
|
|
1413
|
+
model: t == null ? void 0 : t.model,
|
|
1414
|
+
chatId: ((s = t == null ? void 0 : t.resolveChatId) == null ? void 0 : s.call(t, a)) ?? (t == null ? void 0 : t.chatId) ?? a.invocation_id,
|
|
1415
|
+
openingMessage: ((r = t == null ? void 0 : t.resolveOpeningMessage) == null ? void 0 : r.call(t, a)) ?? (t == null ? void 0 : t.openingMessage)
|
|
1577
1416
|
});
|
|
1578
|
-
},
|
|
1579
|
-
const
|
|
1580
|
-
for (const a of
|
|
1581
|
-
const s =
|
|
1417
|
+
}, yt = (e) => e instanceof ve ? e.message : e instanceof TypeError ? "Network error while contacting the agent service." : e instanceof Error && e.message ? e.message : gt, Mn = (e) => {
|
|
1418
|
+
const t = {};
|
|
1419
|
+
for (const a of e) {
|
|
1420
|
+
const s = $e(a);
|
|
1582
1421
|
if (!s)
|
|
1583
1422
|
continue;
|
|
1584
1423
|
const r = a.invocation_id ?? a.id;
|
|
1585
|
-
|
|
1424
|
+
t[r] = s, t[a.id] = s;
|
|
1586
1425
|
}
|
|
1587
|
-
return
|
|
1588
|
-
},
|
|
1589
|
-
const { jwt:
|
|
1590
|
-
() => new
|
|
1591
|
-
token:
|
|
1426
|
+
return t;
|
|
1427
|
+
}, $n = (e) => JSON.stringify(e), Ke = (e, t) => JSON.stringify(e) === JSON.stringify(t), Un = (e) => {
|
|
1428
|
+
const { jwt: t, headers: a, urls: s } = e, r = JSON.stringify(a ?? {}), l = $n(s), i = q(
|
|
1429
|
+
() => new We({
|
|
1430
|
+
token: t,
|
|
1592
1431
|
headers: a,
|
|
1593
1432
|
urls: s
|
|
1594
1433
|
}),
|
|
1595
1434
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- keyed on serialised config to keep a stable client.
|
|
1596
|
-
[
|
|
1435
|
+
[t, l]
|
|
1597
1436
|
);
|
|
1598
|
-
|
|
1437
|
+
it(() => {
|
|
1599
1438
|
i.setHeaders(a);
|
|
1600
1439
|
}, [i, r]);
|
|
1601
|
-
const [
|
|
1440
|
+
const [o, d] = _([]), [f, p] = _(
|
|
1602
1441
|
[]
|
|
1603
|
-
), [g,
|
|
1604
|
-
(
|
|
1605
|
-
const H =
|
|
1606
|
-
|
|
1607
|
-
(
|
|
1608
|
-
),
|
|
1609
|
-
(
|
|
1610
|
-
),
|
|
1611
|
-
(
|
|
1612
|
-
),
|
|
1442
|
+
), [g, w] = _({}), [u, b] = _("loading"), [k, O] = _(null), [F, A] = _(0), P = T(
|
|
1443
|
+
(N, I) => {
|
|
1444
|
+
const H = N.map(et), Y = I.map(mt), $ = Mn(N);
|
|
1445
|
+
d(
|
|
1446
|
+
(U) => Ke(U, H) ? U : H
|
|
1447
|
+
), p(
|
|
1448
|
+
(U) => Ke(U, Y) ? U : Y
|
|
1449
|
+
), w(
|
|
1450
|
+
(U) => Ke(U, $) ? U : $
|
|
1451
|
+
), b("idle"), O(null);
|
|
1613
1452
|
},
|
|
1614
1453
|
[]
|
|
1615
1454
|
);
|
|
1616
|
-
|
|
1617
|
-
let
|
|
1618
|
-
return
|
|
1455
|
+
J(() => {
|
|
1456
|
+
let N = !1;
|
|
1457
|
+
return b("loading"), O(null), (async () => {
|
|
1619
1458
|
try {
|
|
1620
|
-
const [
|
|
1459
|
+
const [I, H] = await Promise.all([
|
|
1621
1460
|
i.listAgents(),
|
|
1622
1461
|
i.listAgentDefinitions()
|
|
1623
1462
|
]);
|
|
1624
|
-
if (
|
|
1463
|
+
if (N)
|
|
1625
1464
|
return;
|
|
1626
|
-
|
|
1627
|
-
} catch (
|
|
1628
|
-
if (
|
|
1465
|
+
P(I, H);
|
|
1466
|
+
} catch (I) {
|
|
1467
|
+
if (N)
|
|
1629
1468
|
return;
|
|
1630
|
-
|
|
1469
|
+
d([]), p([]), w({}), b("error"), O(yt(I));
|
|
1631
1470
|
}
|
|
1632
1471
|
})(), () => {
|
|
1633
|
-
|
|
1472
|
+
N = !0;
|
|
1634
1473
|
};
|
|
1635
|
-
}, [
|
|
1636
|
-
const
|
|
1637
|
-
|
|
1638
|
-
}, []),
|
|
1474
|
+
}, [P, i, F]);
|
|
1475
|
+
const j = T(() => {
|
|
1476
|
+
A((N) => N + 1);
|
|
1477
|
+
}, []), W = T(async () => {
|
|
1639
1478
|
try {
|
|
1640
|
-
const [
|
|
1479
|
+
const [N, I] = await Promise.all([
|
|
1641
1480
|
i.listAgents(),
|
|
1642
1481
|
i.listAgentDefinitions()
|
|
1643
1482
|
]);
|
|
1644
|
-
N
|
|
1483
|
+
P(N, I);
|
|
1645
1484
|
} catch {
|
|
1646
1485
|
}
|
|
1647
|
-
}, [
|
|
1648
|
-
async (
|
|
1649
|
-
const [
|
|
1650
|
-
i.getAgentChecklist(
|
|
1651
|
-
i.getAgent(
|
|
1486
|
+
}, [P, i]), M = T(
|
|
1487
|
+
async (N) => {
|
|
1488
|
+
const [I, H] = await Promise.all([
|
|
1489
|
+
i.getAgentChecklist(N),
|
|
1490
|
+
i.getAgent(N).catch(() => null)
|
|
1652
1491
|
]);
|
|
1653
|
-
return
|
|
1654
|
-
|
|
1655
|
-
|
|
1492
|
+
return vt(
|
|
1493
|
+
N,
|
|
1494
|
+
I,
|
|
1656
1495
|
H ?? void 0
|
|
1657
1496
|
);
|
|
1658
1497
|
},
|
|
1659
1498
|
[i]
|
|
1660
|
-
),
|
|
1661
|
-
async (
|
|
1662
|
-
const
|
|
1663
|
-
return
|
|
1499
|
+
), C = T(
|
|
1500
|
+
async (N) => {
|
|
1501
|
+
const I = await i.getAgentResources(N);
|
|
1502
|
+
return _t(I);
|
|
1664
1503
|
},
|
|
1665
1504
|
[i]
|
|
1666
|
-
),
|
|
1505
|
+
), x = T(
|
|
1667
1506
|
async ({
|
|
1668
|
-
definition:
|
|
1669
|
-
invocationName:
|
|
1507
|
+
definition: N,
|
|
1508
|
+
invocationName: I
|
|
1670
1509
|
}) => {
|
|
1671
|
-
const H = await i.createAgent(
|
|
1672
|
-
invocationName:
|
|
1673
|
-
}),
|
|
1674
|
-
return
|
|
1675
|
-
...
|
|
1676
|
-
[
|
|
1677
|
-
[
|
|
1678
|
-
})),
|
|
1510
|
+
const H = await i.createAgent(N.ref, {
|
|
1511
|
+
invocationName: I
|
|
1512
|
+
}), Y = await i.getAgent(H.id), $ = et(Y), U = $e(Y);
|
|
1513
|
+
return d((G) => [$, ...G]), U && w((G) => ({
|
|
1514
|
+
...G,
|
|
1515
|
+
[$.invocation_id]: U,
|
|
1516
|
+
[$.id]: U
|
|
1517
|
+
})), $;
|
|
1679
1518
|
},
|
|
1680
1519
|
[i]
|
|
1681
|
-
),
|
|
1682
|
-
() =>
|
|
1683
|
-
resolveOpeningMessage: (
|
|
1520
|
+
), Z = q(
|
|
1521
|
+
() => wt(i, {
|
|
1522
|
+
resolveOpeningMessage: (N) => g[N.invocation_id] ?? g[N.id]
|
|
1684
1523
|
}),
|
|
1685
1524
|
[i, g]
|
|
1686
1525
|
);
|
|
1687
1526
|
return {
|
|
1688
|
-
agents:
|
|
1689
|
-
agentDefinitions:
|
|
1690
|
-
loadState:
|
|
1691
|
-
loadError:
|
|
1692
|
-
reload:
|
|
1693
|
-
refresh:
|
|
1694
|
-
fetchAgentChecklist:
|
|
1695
|
-
fetchAgentResources:
|
|
1696
|
-
createAgent:
|
|
1697
|
-
chatConnector:
|
|
1527
|
+
agents: o,
|
|
1528
|
+
agentDefinitions: f,
|
|
1529
|
+
loadState: u,
|
|
1530
|
+
loadError: k,
|
|
1531
|
+
reload: j,
|
|
1532
|
+
refresh: W,
|
|
1533
|
+
fetchAgentChecklist: M,
|
|
1534
|
+
fetchAgentResources: C,
|
|
1535
|
+
createAgent: x,
|
|
1536
|
+
chatConnector: Z
|
|
1698
1537
|
};
|
|
1699
|
-
},
|
|
1700
|
-
const { agent:
|
|
1701
|
-
() => new
|
|
1538
|
+
}, Fn = (e) => JSON.stringify(e), Hn = (e) => {
|
|
1539
|
+
const { agent: t, jwt: a, headers: s, urls: r, chatId: l } = e, i = JSON.stringify(s ?? {}), o = Fn(r), d = q(
|
|
1540
|
+
() => new We({
|
|
1702
1541
|
token: a,
|
|
1703
1542
|
headers: s,
|
|
1704
1543
|
urls: {
|
|
@@ -1711,548 +1550,498 @@ const St = (t, e) => (a) => {
|
|
|
1711
1550
|
}
|
|
1712
1551
|
}),
|
|
1713
1552
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- keyed on serialised config to keep a stable client.
|
|
1714
|
-
[a,
|
|
1553
|
+
[a, o]
|
|
1715
1554
|
);
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
}, [
|
|
1719
|
-
const
|
|
1720
|
-
async (
|
|
1721
|
-
const [
|
|
1722
|
-
|
|
1723
|
-
|
|
1555
|
+
it(() => {
|
|
1556
|
+
d.setHeaders(s);
|
|
1557
|
+
}, [d, i]);
|
|
1558
|
+
const f = T(
|
|
1559
|
+
async (u) => {
|
|
1560
|
+
const [b, k] = await Promise.all([
|
|
1561
|
+
d.getAgentChecklist(u),
|
|
1562
|
+
d.getAgent(u).catch(() => null)
|
|
1724
1563
|
]);
|
|
1725
|
-
return
|
|
1564
|
+
return vt(
|
|
1565
|
+
u,
|
|
1726
1566
|
b,
|
|
1727
|
-
|
|
1728
|
-
R ?? void 0
|
|
1567
|
+
k ?? void 0
|
|
1729
1568
|
);
|
|
1730
1569
|
},
|
|
1731
|
-
[
|
|
1732
|
-
),
|
|
1733
|
-
async (
|
|
1734
|
-
const
|
|
1735
|
-
return
|
|
1570
|
+
[d]
|
|
1571
|
+
), p = T(
|
|
1572
|
+
async (u) => {
|
|
1573
|
+
const b = await d.getAgentResources(u);
|
|
1574
|
+
return _t(b);
|
|
1736
1575
|
},
|
|
1737
|
-
[
|
|
1738
|
-
), g =
|
|
1739
|
-
async (
|
|
1740
|
-
const
|
|
1741
|
-
return
|
|
1576
|
+
[d]
|
|
1577
|
+
), g = T(
|
|
1578
|
+
async (u) => {
|
|
1579
|
+
const b = await d.getAgentTimeline(u);
|
|
1580
|
+
return En(b);
|
|
1742
1581
|
},
|
|
1743
|
-
[
|
|
1582
|
+
[d]
|
|
1744
1583
|
);
|
|
1745
1584
|
return {
|
|
1746
|
-
connector:
|
|
1747
|
-
() =>
|
|
1748
|
-
chatId: l ??
|
|
1749
|
-
})(
|
|
1585
|
+
connector: q(
|
|
1586
|
+
() => wt(d, {
|
|
1587
|
+
chatId: l ?? t.invocation_id
|
|
1588
|
+
})(t),
|
|
1750
1589
|
// Key on invocation/chat ids so a new Agent object reference does not rebuild the connector.
|
|
1751
1590
|
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
1752
|
-
[
|
|
1591
|
+
[d, t.invocation_id, l]
|
|
1753
1592
|
),
|
|
1754
|
-
fetchAgentChecklist:
|
|
1755
|
-
fetchAgentResources:
|
|
1593
|
+
fetchAgentChecklist: f,
|
|
1594
|
+
fetchAgentResources: p,
|
|
1756
1595
|
fetchAgentTimeline: g
|
|
1757
1596
|
};
|
|
1758
|
-
},
|
|
1759
|
-
const a =
|
|
1597
|
+
}, Bn = (e, t) => {
|
|
1598
|
+
const a = e.hasRunBefore ? t || "This trip" : e.tripName.trim() || "A new trip", s = e.destination ? ` to ${e.destination}` : "", r = e.hasRunBefore ? " It has run before." : "";
|
|
1760
1599
|
return `${a}${s}.${r}`.trim();
|
|
1761
|
-
},
|
|
1762
|
-
switch (
|
|
1763
|
-
case
|
|
1764
|
-
return
|
|
1765
|
-
case
|
|
1766
|
-
return
|
|
1600
|
+
}, zn = (e) => {
|
|
1601
|
+
switch (e) {
|
|
1602
|
+
case S.failed:
|
|
1603
|
+
return L.stopped;
|
|
1604
|
+
case S.complete:
|
|
1605
|
+
return L.complete;
|
|
1767
1606
|
default:
|
|
1768
|
-
return
|
|
1607
|
+
return L.running;
|
|
1769
1608
|
}
|
|
1770
|
-
},
|
|
1771
|
-
|
|
1772
|
-
},
|
|
1773
|
-
|
|
1774
|
-
|
|
1775
|
-
|
|
1776
|
-
|
|
1777
|
-
|
|
1778
|
-
|
|
1779
|
-
|
|
1780
|
-
|
|
1781
|
-
|
|
1782
|
-
|
|
1783
|
-
|
|
1784
|
-
|
|
1785
|
-
|
|
1786
|
-
|
|
1787
|
-
|
|
1788
|
-
|
|
1789
|
-
enableUpload: b,
|
|
1790
|
-
initialBrief: v,
|
|
1791
|
-
initialPhase: R,
|
|
1792
|
-
initialChecklist: C
|
|
1609
|
+
}, nt = (e, t) => {
|
|
1610
|
+
t([fe(e)]);
|
|
1611
|
+
}, Gn = ({
|
|
1612
|
+
agent: e,
|
|
1613
|
+
open: t,
|
|
1614
|
+
onClose: a,
|
|
1615
|
+
jwt: s,
|
|
1616
|
+
headers: r,
|
|
1617
|
+
agentUrl: l,
|
|
1618
|
+
agentChecklistUrl: i,
|
|
1619
|
+
agentResourcesUrl: o,
|
|
1620
|
+
agentTimelineUrl: d,
|
|
1621
|
+
agentChatUrl: f,
|
|
1622
|
+
agentConversationUrl: p,
|
|
1623
|
+
chatId: g,
|
|
1624
|
+
enableUpload: w,
|
|
1625
|
+
initialBrief: u,
|
|
1626
|
+
initialPhase: b,
|
|
1627
|
+
initialChecklist: k
|
|
1793
1628
|
}) => {
|
|
1794
|
-
const [
|
|
1795
|
-
agent:
|
|
1796
|
-
jwt:
|
|
1797
|
-
headers:
|
|
1798
|
-
chatId:
|
|
1629
|
+
const [O, F] = _(g ?? e.invocation_id), [A, P] = _("chat"), [j, W] = _(!1), { connector: M, fetchAgentChecklist: C, fetchAgentResources: x, fetchAgentTimeline: Z } = Hn({
|
|
1630
|
+
agent: e,
|
|
1631
|
+
jwt: s,
|
|
1632
|
+
headers: r,
|
|
1633
|
+
chatId: O,
|
|
1799
1634
|
urls: {
|
|
1800
|
-
agentUrl:
|
|
1801
|
-
agentChecklistUrl:
|
|
1802
|
-
agentResourcesUrl:
|
|
1803
|
-
agentTimelineUrl:
|
|
1804
|
-
agentChatUrl:
|
|
1805
|
-
agentConversationUrl:
|
|
1635
|
+
agentUrl: l,
|
|
1636
|
+
agentChecklistUrl: i,
|
|
1637
|
+
agentResourcesUrl: o,
|
|
1638
|
+
agentTimelineUrl: d,
|
|
1639
|
+
agentChatUrl: f,
|
|
1640
|
+
agentConversationUrl: p
|
|
1806
1641
|
}
|
|
1807
|
-
}),
|
|
1808
|
-
|
|
1809
|
-
), [Y,
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
}, [
|
|
1813
|
-
|
|
1814
|
-
}, [
|
|
1815
|
-
|
|
1816
|
-
}, [e, _]), K(() => {
|
|
1817
|
-
if (!a || v)
|
|
1642
|
+
}), N = Et(M), [I, H] = _(
|
|
1643
|
+
b ?? (u ? L.running : zn(e.status))
|
|
1644
|
+
), [Y, $] = _([]), [U, G] = _(0), [Ne, Ue] = _(), [he, ae] = _(null), [Fe, oe] = _([]), [He, pe] = _(!1), [re, ue] = _(null), [ke, Ae] = _(null), [Ce, Se] = _(!1), [be, Te] = _(null), [Ee, me] = _(k ?? null), [Be, Ie] = _(!1), [Re, _e] = _(null), [h, y] = _(!1), [v, K] = _(!1), [ee, ce] = _(!1);
|
|
1645
|
+
J(() => {
|
|
1646
|
+
N.current = M;
|
|
1647
|
+
}, [M]), J(() => {
|
|
1648
|
+
F(g ?? e.invocation_id), P("chat"), W(!1), $([]), G((m) => m + 1);
|
|
1649
|
+
}, [e.invocation_id, g]), J(() => {
|
|
1650
|
+
if (!t || u)
|
|
1818
1651
|
return;
|
|
1819
|
-
const
|
|
1820
|
-
if (!
|
|
1821
|
-
|
|
1652
|
+
const m = N.current.bootstrapConversation;
|
|
1653
|
+
if (!m) {
|
|
1654
|
+
nt(N.current.openingMessage(), $);
|
|
1822
1655
|
return;
|
|
1823
1656
|
}
|
|
1824
|
-
let
|
|
1825
|
-
return
|
|
1657
|
+
let R = !1;
|
|
1658
|
+
return y(!0), (async () => {
|
|
1826
1659
|
try {
|
|
1827
|
-
const
|
|
1828
|
-
if (
|
|
1660
|
+
const te = await m.call(N.current);
|
|
1661
|
+
if (R)
|
|
1829
1662
|
return;
|
|
1830
|
-
|
|
1663
|
+
$(te.map(fe));
|
|
1831
1664
|
} catch {
|
|
1832
|
-
|
|
1665
|
+
R || nt(N.current.openingMessage(), $);
|
|
1833
1666
|
} finally {
|
|
1834
|
-
|
|
1667
|
+
R || y(!1);
|
|
1835
1668
|
}
|
|
1836
1669
|
})(), () => {
|
|
1837
|
-
|
|
1670
|
+
R = !0;
|
|
1838
1671
|
};
|
|
1839
|
-
}, [
|
|
1840
|
-
|
|
1841
|
-
|
|
1842
|
-
const w = window.setInterval(() => {
|
|
1843
|
-
const D = E.current.bootstrapConversation;
|
|
1844
|
-
D && (async () => {
|
|
1845
|
-
try {
|
|
1846
|
-
const X = await D.call(E.current);
|
|
1847
|
-
if (Se.current)
|
|
1848
|
-
return;
|
|
1849
|
-
const be = X.map(ge);
|
|
1850
|
-
x(
|
|
1851
|
-
(et) => Qn(et, be) ? et : be
|
|
1852
|
-
);
|
|
1853
|
-
} catch {
|
|
1854
|
-
}
|
|
1855
|
-
})();
|
|
1856
|
-
}, jn);
|
|
1857
|
-
return () => {
|
|
1858
|
-
window.clearInterval(w);
|
|
1859
|
-
};
|
|
1860
|
-
}, [a, v, e, U]);
|
|
1861
|
-
const Tt = P((w) => {
|
|
1862
|
-
w.checklist && ke(w.checklist), w.phase && V(w.phase);
|
|
1672
|
+
}, [t, u, e.invocation_id, O]);
|
|
1673
|
+
const ie = T((m) => {
|
|
1674
|
+
m.checklist && me(m.checklist), m.phase && H(m.phase);
|
|
1863
1675
|
}, []);
|
|
1864
|
-
|
|
1865
|
-
var
|
|
1866
|
-
!
|
|
1867
|
-
}, [
|
|
1868
|
-
if (!
|
|
1676
|
+
J(() => {
|
|
1677
|
+
var m, R;
|
|
1678
|
+
!t || u || k && k.length > 0 && ((R = (m = N.current).seedChecklist) == null || R.call(m, k));
|
|
1679
|
+
}, [t, u, k]), J(() => {
|
|
1680
|
+
if (!t || u)
|
|
1869
1681
|
return;
|
|
1870
|
-
let
|
|
1871
|
-
return
|
|
1872
|
-
var
|
|
1682
|
+
let m = !1;
|
|
1683
|
+
return Ie(!(k != null && k.length)), _e(null), (async () => {
|
|
1684
|
+
var R, te;
|
|
1873
1685
|
try {
|
|
1874
|
-
const
|
|
1875
|
-
if (
|
|
1686
|
+
const Ve = await C(e.invocation_id);
|
|
1687
|
+
if (m)
|
|
1876
1688
|
return;
|
|
1877
|
-
|
|
1689
|
+
k != null && k.length || (me(Ve.checklist), (te = (R = N.current).seedChecklist) == null || te.call(R, Ve.checklist));
|
|
1878
1690
|
} catch {
|
|
1879
|
-
!
|
|
1691
|
+
!m && !(k != null && k.length) && _e(xe);
|
|
1880
1692
|
} finally {
|
|
1881
|
-
|
|
1693
|
+
m || Ie(!1);
|
|
1882
1694
|
}
|
|
1883
1695
|
})(), () => {
|
|
1884
|
-
|
|
1696
|
+
m = !0;
|
|
1885
1697
|
};
|
|
1886
|
-
}, [
|
|
1887
|
-
if (!
|
|
1698
|
+
}, [t, e.invocation_id, u, k, C]), J(() => {
|
|
1699
|
+
if (!t || !o)
|
|
1888
1700
|
return;
|
|
1889
|
-
let
|
|
1890
|
-
return
|
|
1701
|
+
let m = !1;
|
|
1702
|
+
return pe(!0), ue(null), (async () => {
|
|
1891
1703
|
try {
|
|
1892
|
-
const
|
|
1893
|
-
|
|
1704
|
+
const R = await x(e.invocation_id);
|
|
1705
|
+
m || oe(R);
|
|
1894
1706
|
} catch {
|
|
1895
|
-
|
|
1707
|
+
m || ue(Ht);
|
|
1896
1708
|
} finally {
|
|
1897
|
-
|
|
1709
|
+
m || pe(!1);
|
|
1898
1710
|
}
|
|
1899
1711
|
})(), () => {
|
|
1900
|
-
|
|
1712
|
+
m = !0;
|
|
1901
1713
|
};
|
|
1902
|
-
}, [
|
|
1903
|
-
if (!
|
|
1714
|
+
}, [t, e.invocation_id, o, x]), J(() => {
|
|
1715
|
+
if (!t || !d)
|
|
1904
1716
|
return;
|
|
1905
|
-
let
|
|
1906
|
-
return
|
|
1717
|
+
let m = !1;
|
|
1718
|
+
return Se(!0), Te(null), (async () => {
|
|
1907
1719
|
try {
|
|
1908
|
-
const
|
|
1909
|
-
|
|
1720
|
+
const R = await Z(e.invocation_id);
|
|
1721
|
+
m || Ae(R);
|
|
1910
1722
|
} catch {
|
|
1911
|
-
|
|
1723
|
+
m || Te(dt);
|
|
1912
1724
|
} finally {
|
|
1913
|
-
|
|
1725
|
+
m || Se(!1);
|
|
1914
1726
|
}
|
|
1915
1727
|
})(), () => {
|
|
1916
|
-
|
|
1728
|
+
m = !0;
|
|
1917
1729
|
};
|
|
1918
|
-
}, [
|
|
1919
|
-
if (!
|
|
1730
|
+
}, [t, e.invocation_id, d, Z]), J(() => {
|
|
1731
|
+
if (!t || !u)
|
|
1920
1732
|
return;
|
|
1921
|
-
let
|
|
1922
|
-
const
|
|
1733
|
+
let m = !1;
|
|
1734
|
+
const R = {
|
|
1923
1735
|
id: `user-brief-${Date.now()}`,
|
|
1924
1736
|
author: ne.user,
|
|
1925
|
-
text:
|
|
1737
|
+
text: Bn(u, e.invocation_name)
|
|
1926
1738
|
};
|
|
1927
1739
|
return (async () => {
|
|
1928
|
-
const
|
|
1929
|
-
|
|
1930
|
-
|
|
1931
|
-
|
|
1932
|
-
|
|
1933
|
-
]),
|
|
1740
|
+
const te = await N.current.start(u);
|
|
1741
|
+
m || ($([
|
|
1742
|
+
fe(N.current.openingMessage()),
|
|
1743
|
+
fe(R),
|
|
1744
|
+
fe(te.message)
|
|
1745
|
+
]), te.checklist && me(te.checklist), H(te.phase ?? L.running));
|
|
1934
1746
|
})(), () => {
|
|
1935
|
-
|
|
1747
|
+
m = !0;
|
|
1936
1748
|
};
|
|
1937
|
-
}, [
|
|
1938
|
-
const
|
|
1939
|
-
|
|
1940
|
-
}, []),
|
|
1941
|
-
|
|
1942
|
-
}, []),
|
|
1943
|
-
|
|
1944
|
-
}, [e,
|
|
1945
|
-
|
|
1946
|
-
}, []),
|
|
1947
|
-
await
|
|
1948
|
-
}, []),
|
|
1949
|
-
return /* @__PURE__ */
|
|
1950
|
-
/* @__PURE__ */
|
|
1951
|
-
/* @__PURE__ */
|
|
1952
|
-
/* @__PURE__ */ n("span", { className: "agent-workspace__header-avatar", "aria-hidden": "true", children: /* @__PURE__ */ n(
|
|
1953
|
-
/* @__PURE__ */ n(se.Title, { children:
|
|
1749
|
+
}, [t, u, e.invocation_name, e.invocation_id]);
|
|
1750
|
+
const Oe = T((m) => {
|
|
1751
|
+
ae(un(m));
|
|
1752
|
+
}, []), kt = T((m) => {
|
|
1753
|
+
F(m), W(!0), P("chat"), $([]), G((R) => R + 1);
|
|
1754
|
+
}, []), At = T(() => {
|
|
1755
|
+
P("timeline"), W(!1), F(g ?? e.invocation_id), $([]), G((m) => m + 1);
|
|
1756
|
+
}, [e.invocation_id, g]), Ct = T((m) => {
|
|
1757
|
+
ae(null), Ue(m), G((R) => R + 1);
|
|
1758
|
+
}, []), St = T(async () => {
|
|
1759
|
+
await N.current.stop(), H(L.stopped);
|
|
1760
|
+
}, []), bt = Ee;
|
|
1761
|
+
return /* @__PURE__ */ c(se, { open: t, closeHandler: a, hideCloseButton: !0, className: "agent-workspace", children: [
|
|
1762
|
+
/* @__PURE__ */ c(se.Header, { className: "agent-workspace__header", children: [
|
|
1763
|
+
/* @__PURE__ */ c("div", { className: "agent-workspace__header-title", children: [
|
|
1764
|
+
/* @__PURE__ */ n("span", { className: "agent-workspace__header-avatar", "aria-hidden": "true", children: /* @__PURE__ */ n(E, { name: "ask-arbor", size: 24 }) }),
|
|
1765
|
+
/* @__PURE__ */ n(se.Title, { children: e.invocation_name }),
|
|
1954
1766
|
/* @__PURE__ */ n(
|
|
1955
1767
|
"span",
|
|
1956
1768
|
{
|
|
1957
|
-
className:
|
|
1958
|
-
children:
|
|
1769
|
+
className: V("agent-workspace__phase", `agent-workspace__phase--${I}`),
|
|
1770
|
+
children: Gt[I]
|
|
1959
1771
|
}
|
|
1960
1772
|
)
|
|
1961
1773
|
] }),
|
|
1962
|
-
/* @__PURE__ */
|
|
1774
|
+
/* @__PURE__ */ c("div", { className: "agent-workspace__header-actions", children: [
|
|
1963
1775
|
/* @__PURE__ */ n(
|
|
1964
|
-
|
|
1776
|
+
Q,
|
|
1965
1777
|
{
|
|
1966
|
-
variant:
|
|
1778
|
+
variant: "tertiary",
|
|
1967
1779
|
size: "S",
|
|
1968
1780
|
iconLeftName: "clipboard-list",
|
|
1969
1781
|
iconLeftScreenReaderText: "Toggle checklist",
|
|
1970
|
-
"aria-pressed": !
|
|
1971
|
-
onClick: () =>
|
|
1782
|
+
"aria-pressed": !ee,
|
|
1783
|
+
onClick: () => ce((m) => !m),
|
|
1972
1784
|
children: "Checklist"
|
|
1973
1785
|
}
|
|
1974
1786
|
),
|
|
1975
1787
|
/* @__PURE__ */ n(
|
|
1976
|
-
|
|
1788
|
+
Q,
|
|
1977
1789
|
{
|
|
1978
|
-
variant:
|
|
1790
|
+
variant: "tertiary",
|
|
1979
1791
|
size: "S",
|
|
1980
1792
|
iconLeftName: "files",
|
|
1981
1793
|
iconLeftScreenReaderText: "Toggle resources",
|
|
1982
|
-
"aria-pressed": !
|
|
1983
|
-
onClick: () =>
|
|
1794
|
+
"aria-pressed": !v,
|
|
1795
|
+
onClick: () => K((m) => !m),
|
|
1984
1796
|
children: "Resources"
|
|
1985
1797
|
}
|
|
1986
1798
|
),
|
|
1987
1799
|
/* @__PURE__ */ n(
|
|
1988
|
-
|
|
1800
|
+
Q,
|
|
1989
1801
|
{
|
|
1990
1802
|
variant: "secondary",
|
|
1991
1803
|
size: "S",
|
|
1992
1804
|
iconLeftName: "x",
|
|
1993
1805
|
iconLeftScreenReaderText: "Close",
|
|
1994
|
-
onClick:
|
|
1806
|
+
onClick: a,
|
|
1995
1807
|
children: "Close"
|
|
1996
1808
|
}
|
|
1997
1809
|
)
|
|
1998
1810
|
] })
|
|
1999
1811
|
] }),
|
|
2000
|
-
/* @__PURE__ */
|
|
1812
|
+
/* @__PURE__ */ c(
|
|
2001
1813
|
se.Body,
|
|
2002
1814
|
{
|
|
2003
|
-
className:
|
|
2004
|
-
"agent-workspace__body--no-
|
|
2005
|
-
"agent-workspace__body--no-
|
|
1815
|
+
className: V("agent-workspace__body", {
|
|
1816
|
+
"agent-workspace__body--no-left": ee,
|
|
1817
|
+
"agent-workspace__body--no-right": v
|
|
2006
1818
|
}),
|
|
2007
1819
|
children: [
|
|
2008
|
-
|
|
2009
|
-
|
|
1820
|
+
!ee && /* @__PURE__ */ n(
|
|
1821
|
+
tn,
|
|
1822
|
+
{
|
|
1823
|
+
checklist: bt,
|
|
1824
|
+
isLoading: Be,
|
|
1825
|
+
error: Re,
|
|
1826
|
+
phase: I,
|
|
1827
|
+
canRequestInput: I === L.running && !h,
|
|
1828
|
+
onStop: () => void St(),
|
|
1829
|
+
onAttentionItemClick: Oe
|
|
1830
|
+
}
|
|
1831
|
+
),
|
|
1832
|
+
/* @__PURE__ */ c(
|
|
2010
1833
|
"section",
|
|
2011
1834
|
{
|
|
2012
|
-
className:
|
|
2013
|
-
"agent-workspace__panel--timeline": !!
|
|
1835
|
+
className: V("agent-workspace__panel", "agent-workspace__panel--chat", {
|
|
1836
|
+
"agent-workspace__panel--timeline": !!d && A === "timeline"
|
|
2014
1837
|
}),
|
|
2015
|
-
"aria-label": "Agent",
|
|
1838
|
+
"aria-label": "Agent conversation",
|
|
2016
1839
|
children: [
|
|
2017
|
-
/* @__PURE__ */
|
|
2018
|
-
/* @__PURE__ */ n(_e, { level: 4, children: "Agent" }),
|
|
2019
|
-
H === B.running && /* @__PURE__ */ n(
|
|
2020
|
-
Z,
|
|
2021
|
-
{
|
|
2022
|
-
className: "agent-workspace__panel-header-action",
|
|
2023
|
-
variant: "secondary-destructive",
|
|
2024
|
-
size: "S",
|
|
2025
|
-
iconLeftName: "circle-x",
|
|
2026
|
-
iconLeftScreenReaderText: "Stop",
|
|
2027
|
-
onClick: () => void Lt(),
|
|
2028
|
-
children: "Stop agent"
|
|
2029
|
-
}
|
|
2030
|
-
)
|
|
2031
|
-
] }),
|
|
2032
|
-
p && /* @__PURE__ */ o(Je, { className: "agent-workspace__center-tabs", "aria-label": "Center panel", children: [
|
|
1840
|
+
d && /* @__PURE__ */ c(ze, { className: "agent-workspace__center-tabs", "aria-label": "Center panel", children: [
|
|
2033
1841
|
/* @__PURE__ */ n(
|
|
2034
|
-
|
|
1842
|
+
ze.Item,
|
|
2035
1843
|
{
|
|
2036
|
-
active:
|
|
1844
|
+
active: A === "chat",
|
|
2037
1845
|
tabElementProps: {
|
|
2038
1846
|
id: "agent-center-tab-chat",
|
|
2039
|
-
onClick: () =>
|
|
1847
|
+
onClick: () => P("chat")
|
|
2040
1848
|
},
|
|
2041
1849
|
children: "Chat"
|
|
2042
1850
|
}
|
|
2043
1851
|
),
|
|
2044
1852
|
/* @__PURE__ */ n(
|
|
2045
|
-
|
|
1853
|
+
ze.Item,
|
|
2046
1854
|
{
|
|
2047
|
-
active:
|
|
1855
|
+
active: A === "timeline",
|
|
2048
1856
|
tabElementProps: {
|
|
2049
1857
|
id: "agent-center-tab-timeline",
|
|
2050
|
-
onClick: () =>
|
|
1858
|
+
onClick: () => P("timeline")
|
|
2051
1859
|
},
|
|
2052
1860
|
children: "Timeline"
|
|
2053
1861
|
}
|
|
2054
1862
|
)
|
|
2055
1863
|
] }),
|
|
2056
|
-
|
|
2057
|
-
|
|
1864
|
+
d && A === "chat" && j && /* @__PURE__ */ n("div", { className: "agent-workspace__center-back", children: /* @__PURE__ */ n(
|
|
1865
|
+
Q,
|
|
2058
1866
|
{
|
|
2059
1867
|
variant: "tertiary",
|
|
2060
1868
|
size: "S",
|
|
2061
1869
|
iconLeftName: "arrow-left",
|
|
2062
|
-
iconLeftScreenReaderText: "Back to
|
|
2063
|
-
onClick:
|
|
2064
|
-
children: "Back to
|
|
1870
|
+
iconLeftScreenReaderText: "Back to timeline",
|
|
1871
|
+
onClick: At,
|
|
1872
|
+
children: "Back to timeline"
|
|
2065
1873
|
}
|
|
2066
1874
|
) }),
|
|
2067
|
-
|
|
2068
|
-
|
|
1875
|
+
!d || A === "chat" ? /* @__PURE__ */ n(
|
|
1876
|
+
en,
|
|
2069
1877
|
{
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
1878
|
+
connector: M,
|
|
1879
|
+
phase: I,
|
|
1880
|
+
chatHistory: Y,
|
|
1881
|
+
chatSessionKey: U,
|
|
1882
|
+
startQuery: Ne,
|
|
1883
|
+
clarificationMessage: he,
|
|
1884
|
+
enableUpload: w,
|
|
1885
|
+
onTurn: ie,
|
|
1886
|
+
onAwaitingChange: y,
|
|
1887
|
+
onClarificationPrompt: Ct,
|
|
1888
|
+
onDismissClarification: () => ae(null)
|
|
2074
1889
|
}
|
|
2075
|
-
)
|
|
2076
|
-
|
|
2077
|
-
"div",
|
|
1890
|
+
) : /* @__PURE__ */ n(
|
|
1891
|
+
hn,
|
|
2078
1892
|
{
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
{
|
|
2084
|
-
connector: A,
|
|
2085
|
-
phase: H,
|
|
2086
|
-
chatHistory: Y,
|
|
2087
|
-
chatSessionKey: j,
|
|
2088
|
-
startQuery: Fe,
|
|
2089
|
-
clarificationMessage: le,
|
|
2090
|
-
enableUpload: b,
|
|
2091
|
-
onTurn: Tt,
|
|
2092
|
-
onAwaitingChange: k,
|
|
2093
|
-
onClarificationPrompt: Ot,
|
|
2094
|
-
onDismissClarification: () => ve(null)
|
|
2095
|
-
}
|
|
2096
|
-
)
|
|
1893
|
+
timeline: ke,
|
|
1894
|
+
isLoading: Ce,
|
|
1895
|
+
error: be,
|
|
1896
|
+
onOpenChatSession: kt
|
|
2097
1897
|
}
|
|
2098
1898
|
)
|
|
2099
1899
|
]
|
|
2100
1900
|
}
|
|
2101
1901
|
),
|
|
2102
|
-
!
|
|
2103
|
-
|
|
1902
|
+
!v && /* @__PURE__ */ n(
|
|
1903
|
+
an,
|
|
2104
1904
|
{
|
|
2105
|
-
|
|
2106
|
-
isLoading:
|
|
2107
|
-
error:
|
|
2108
|
-
phase: H,
|
|
2109
|
-
canRequestInput: H === B.running && !S,
|
|
2110
|
-
onAttentionItemClick: Et
|
|
2111
|
-
}
|
|
2112
|
-
),
|
|
2113
|
-
!te && /* @__PURE__ */ n(
|
|
2114
|
-
hn,
|
|
2115
|
-
{
|
|
2116
|
-
resources: ce,
|
|
2117
|
-
isLoading: Ee,
|
|
2118
|
-
error: Re
|
|
1905
|
+
resources: Fe,
|
|
1906
|
+
isLoading: He,
|
|
1907
|
+
error: re
|
|
2119
1908
|
}
|
|
2120
1909
|
)
|
|
2121
1910
|
]
|
|
2122
1911
|
}
|
|
2123
1912
|
)
|
|
2124
1913
|
] });
|
|
2125
|
-
},
|
|
2126
|
-
open:
|
|
2127
|
-
onClose:
|
|
1914
|
+
}, qn = "Unable to load agent definitions. Please try again.", Kn = "Unable to start the agent.", at = "Loading agents…", Nt = ({
|
|
1915
|
+
open: e,
|
|
1916
|
+
onClose: t,
|
|
2128
1917
|
onStart: a,
|
|
2129
1918
|
agentDefinitions: s,
|
|
2130
1919
|
definitionsState: r = "idle",
|
|
2131
1920
|
definitionsError: l = null,
|
|
2132
1921
|
onRetryDefinitions: i,
|
|
2133
|
-
embedded:
|
|
1922
|
+
embedded: o = !1
|
|
2134
1923
|
}) => {
|
|
2135
|
-
const
|
|
2136
|
-
value:
|
|
2137
|
-
label:
|
|
1924
|
+
const d = s[0], [f, p] = _(d), [g, w] = _(""), [u, b] = _(!1), [k, O] = _(null), F = [...s].sort((C, x) => C.agent_intent.localeCompare(x.agent_intent)).map((C) => ({
|
|
1925
|
+
value: C.ref,
|
|
1926
|
+
label: C.agent_intent
|
|
2138
1927
|
}));
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
}, [
|
|
2142
|
-
const
|
|
2143
|
-
(
|
|
2144
|
-
const
|
|
2145
|
-
|
|
1928
|
+
J(() => {
|
|
1929
|
+
e && (p(d), w(""), b(!1), O(null));
|
|
1930
|
+
}, [e, d]);
|
|
1931
|
+
const A = f !== void 0 && g.trim().length > 0, P = T(
|
|
1932
|
+
(C) => {
|
|
1933
|
+
const x = s.find((Z) => Z.ref === C[0]);
|
|
1934
|
+
x && p(x);
|
|
2146
1935
|
},
|
|
2147
1936
|
[s]
|
|
2148
|
-
),
|
|
2149
|
-
if (!(!
|
|
2150
|
-
|
|
1937
|
+
), j = T(async () => {
|
|
1938
|
+
if (!(!f || !A || u)) {
|
|
1939
|
+
b(!0), O(null);
|
|
2151
1940
|
try {
|
|
2152
|
-
await a({ definition:
|
|
2153
|
-
} catch (
|
|
2154
|
-
C
|
|
1941
|
+
await a({ definition: f, invocationName: g.trim() });
|
|
1942
|
+
} catch (C) {
|
|
1943
|
+
O(C instanceof Error ? C.message : Kn);
|
|
2155
1944
|
} finally {
|
|
2156
|
-
|
|
1945
|
+
b(!1);
|
|
2157
1946
|
}
|
|
2158
1947
|
}
|
|
2159
|
-
}, [
|
|
2160
|
-
if (r === "idle" && s.length === 0 || !
|
|
1948
|
+
}, [A, f, g, u, a]);
|
|
1949
|
+
if (r === "idle" && s.length === 0 || !e)
|
|
2161
1950
|
return null;
|
|
2162
|
-
const
|
|
2163
|
-
/* @__PURE__ */ n("span", { className: "new-agent__header-avatar", "aria-hidden": "true", children: /* @__PURE__ */ n(
|
|
2164
|
-
|
|
1951
|
+
const W = /* @__PURE__ */ c("div", { className: "new-agent__header-title", children: [
|
|
1952
|
+
/* @__PURE__ */ n("span", { className: "new-agent__header-avatar", "aria-hidden": "true", children: /* @__PURE__ */ n(E, { name: "ask-arbor", size: 24 }) }),
|
|
1953
|
+
o ? /* @__PURE__ */ n("h2", { className: "new-agent__title", children: "Start an agent" }) : /* @__PURE__ */ n(se.Title, { children: "Start an agent" })
|
|
2165
1954
|
] });
|
|
2166
|
-
let
|
|
2167
|
-
return r === "loading" ?
|
|
1955
|
+
let M;
|
|
1956
|
+
return r === "loading" ? M = /* @__PURE__ */ c("div", { className: "new-agent__state", "aria-live": "polite", children: [
|
|
2168
1957
|
/* @__PURE__ */ n(
|
|
2169
|
-
|
|
1958
|
+
E,
|
|
2170
1959
|
{
|
|
2171
1960
|
name: "loader",
|
|
2172
1961
|
size: 24,
|
|
2173
1962
|
color: "var(--color-brand-600)",
|
|
2174
1963
|
className: "new-agent__spinner",
|
|
2175
|
-
screenReaderText:
|
|
1964
|
+
screenReaderText: at
|
|
2176
1965
|
}
|
|
2177
1966
|
),
|
|
2178
|
-
/* @__PURE__ */ n("p", { className: "new-agent__state-message", children:
|
|
2179
|
-
] }) : r === "error" ?
|
|
2180
|
-
/* @__PURE__ */ n(
|
|
2181
|
-
/* @__PURE__ */ n("p", { className: "new-agent__state-message", children: l ??
|
|
2182
|
-
i ? /* @__PURE__ */ n(
|
|
2183
|
-
] }) :
|
|
1967
|
+
/* @__PURE__ */ n("p", { className: "new-agent__state-message", children: at })
|
|
1968
|
+
] }) : r === "error" ? M = /* @__PURE__ */ c("div", { className: "new-agent__state new-agent__state--error", role: "alert", children: [
|
|
1969
|
+
/* @__PURE__ */ n(E, { name: "triangle-alert", size: 24, color: "var(--color-semantic-destructive-600)" }),
|
|
1970
|
+
/* @__PURE__ */ n("p", { className: "new-agent__state-message", children: l ?? qn }),
|
|
1971
|
+
i ? /* @__PURE__ */ n(Q, { variant: "secondary", size: "S", onClick: i, children: "Try again" }) : null
|
|
1972
|
+
] }) : f ? M = /* @__PURE__ */ c(
|
|
2184
1973
|
"form",
|
|
2185
1974
|
{
|
|
2186
1975
|
className: "new-agent__form",
|
|
2187
1976
|
"aria-label": "Start an agent",
|
|
2188
|
-
onSubmit: (
|
|
2189
|
-
|
|
1977
|
+
onSubmit: (C) => {
|
|
1978
|
+
C.preventDefault(), A && !u && j();
|
|
2190
1979
|
},
|
|
2191
1980
|
children: [
|
|
2192
|
-
/* @__PURE__ */
|
|
1981
|
+
/* @__PURE__ */ c("div", { className: "new-agent__type-field", children: [
|
|
2193
1982
|
/* @__PURE__ */ n("label", { className: "new-agent__type-label", htmlFor: "new-agent-type", children: "What would you like your agent to do?" }),
|
|
2194
1983
|
/* @__PURE__ */ n(
|
|
2195
|
-
|
|
1984
|
+
It,
|
|
2196
1985
|
{
|
|
2197
1986
|
id: "new-agent-type",
|
|
2198
1987
|
placeholder: "Choose an intent",
|
|
2199
|
-
options:
|
|
2200
|
-
selectedValues: [
|
|
2201
|
-
onSelectionChange:
|
|
1988
|
+
options: F,
|
|
1989
|
+
selectedValues: [f.ref],
|
|
1990
|
+
onSelectionChange: P
|
|
2202
1991
|
}
|
|
2203
1992
|
),
|
|
2204
|
-
/* @__PURE__ */ n("p", { className: "new-agent__type-description", children:
|
|
1993
|
+
/* @__PURE__ */ n("p", { className: "new-agent__type-description", children: f.description })
|
|
2205
1994
|
] }),
|
|
2206
|
-
/* @__PURE__ */
|
|
1995
|
+
/* @__PURE__ */ c("div", { className: "new-agent__type-field", children: [
|
|
2207
1996
|
/* @__PURE__ */ n("label", { className: "new-agent__type-label", htmlFor: "new-agent-invocation-name", children: "Name" }),
|
|
2208
1997
|
/* @__PURE__ */ n(
|
|
2209
|
-
|
|
1998
|
+
Rt,
|
|
2210
1999
|
{
|
|
2211
2000
|
id: "new-agent-invocation-name",
|
|
2212
2001
|
value: g,
|
|
2213
|
-
placeholder: "
|
|
2214
|
-
onChange: (
|
|
2002
|
+
placeholder: "e.g. Test with memory3",
|
|
2003
|
+
onChange: (C) => w(C.target.value)
|
|
2215
2004
|
}
|
|
2216
2005
|
)
|
|
2217
2006
|
] }),
|
|
2218
|
-
|
|
2007
|
+
k ? /* @__PURE__ */ n("p", { className: "new-agent__error", role: "alert", children: k }) : null,
|
|
2219
2008
|
/* @__PURE__ */ n("div", { className: "new-agent__actions", children: /* @__PURE__ */ n(
|
|
2220
|
-
|
|
2009
|
+
Q,
|
|
2221
2010
|
{
|
|
2222
2011
|
type: "submit",
|
|
2223
2012
|
variant: "primary",
|
|
2224
|
-
disabled: !
|
|
2225
|
-
iconLeftName:
|
|
2226
|
-
iconLeftScreenReaderText:
|
|
2227
|
-
children:
|
|
2013
|
+
disabled: !A || u,
|
|
2014
|
+
iconLeftName: u ? "loader" : "sparkles",
|
|
2015
|
+
iconLeftScreenReaderText: u ? "Starting" : void 0,
|
|
2016
|
+
children: u ? "Starting…" : "Start"
|
|
2228
2017
|
}
|
|
2229
2018
|
) })
|
|
2230
2019
|
]
|
|
2231
2020
|
}
|
|
2232
|
-
) :
|
|
2233
|
-
/* @__PURE__ */ n("div", { className: "new-agent__header", children:
|
|
2234
|
-
/* @__PURE__ */ n("div", { className: "new-agent__body", children:
|
|
2235
|
-
] }) : /* @__PURE__ */
|
|
2236
|
-
/* @__PURE__ */ n(se.Header, { className: "new-agent__header", children:
|
|
2237
|
-
/* @__PURE__ */ n(se.Body, { className: "new-agent__body", children:
|
|
2021
|
+
) : M = null, o ? /* @__PURE__ */ c("div", { className: V("new-agent", "new-agent--embedded"), children: [
|
|
2022
|
+
/* @__PURE__ */ n("div", { className: "new-agent__header", children: W }),
|
|
2023
|
+
/* @__PURE__ */ n("div", { className: "new-agent__body", children: M })
|
|
2024
|
+
] }) : /* @__PURE__ */ c(se, { open: e, closeHandler: t, className: "new-agent", children: [
|
|
2025
|
+
/* @__PURE__ */ n(se.Header, { className: "new-agent__header", children: W }),
|
|
2026
|
+
/* @__PURE__ */ n(se.Body, { className: "new-agent__body", children: M })
|
|
2238
2027
|
] });
|
|
2239
|
-
},
|
|
2240
|
-
window.location.assign(
|
|
2241
|
-
},
|
|
2242
|
-
open:
|
|
2243
|
-
authToken:
|
|
2028
|
+
}, st = (e) => {
|
|
2029
|
+
window.location.assign(e);
|
|
2030
|
+
}, Jn = ({
|
|
2031
|
+
open: e,
|
|
2032
|
+
authToken: t,
|
|
2244
2033
|
headers: a,
|
|
2245
2034
|
agentDefinitionsUrl: s,
|
|
2246
2035
|
agentsUrl: r,
|
|
2247
2036
|
closeUrl: l,
|
|
2248
2037
|
successUrl: i,
|
|
2249
|
-
onClose:
|
|
2250
|
-
onStart:
|
|
2251
|
-
embedded:
|
|
2038
|
+
onClose: o,
|
|
2039
|
+
onStart: d,
|
|
2040
|
+
embedded: f = !1
|
|
2252
2041
|
}) => {
|
|
2253
|
-
const
|
|
2254
|
-
() => new
|
|
2255
|
-
token:
|
|
2042
|
+
const p = JSON.stringify(a ?? {}), g = q(
|
|
2043
|
+
() => new We({
|
|
2044
|
+
token: t,
|
|
2256
2045
|
headers: a,
|
|
2257
2046
|
urls: {
|
|
2258
2047
|
agentDefinitions: s,
|
|
@@ -2260,106 +2049,106 @@ const St = (t, e) => (a) => {
|
|
|
2260
2049
|
}
|
|
2261
2050
|
}),
|
|
2262
2051
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- keyed on serialised config to keep a stable client.
|
|
2263
|
-
[
|
|
2264
|
-
), [
|
|
2265
|
-
|
|
2266
|
-
if (!
|
|
2052
|
+
[t, s, r, p]
|
|
2053
|
+
), [w, u] = _([]), [b, k] = _("loading"), [O, F] = _(null), [A, P] = _(0);
|
|
2054
|
+
J(() => {
|
|
2055
|
+
if (!e)
|
|
2267
2056
|
return;
|
|
2268
|
-
let
|
|
2269
|
-
return
|
|
2057
|
+
let C = !1;
|
|
2058
|
+
return k("loading"), F(null), (async () => {
|
|
2270
2059
|
try {
|
|
2271
|
-
const
|
|
2272
|
-
if (
|
|
2060
|
+
const x = await g.listAgentDefinitions();
|
|
2061
|
+
if (C)
|
|
2273
2062
|
return;
|
|
2274
|
-
|
|
2275
|
-
} catch (
|
|
2276
|
-
if (
|
|
2063
|
+
u(x.map(mt)), k("idle");
|
|
2064
|
+
} catch (x) {
|
|
2065
|
+
if (C)
|
|
2277
2066
|
return;
|
|
2278
|
-
|
|
2067
|
+
u([]), F(yt(x)), k("error");
|
|
2279
2068
|
}
|
|
2280
2069
|
})(), () => {
|
|
2281
|
-
|
|
2070
|
+
C = !0;
|
|
2282
2071
|
};
|
|
2283
|
-
}, [g,
|
|
2284
|
-
const
|
|
2285
|
-
|
|
2286
|
-
}, [l,
|
|
2287
|
-
async (
|
|
2288
|
-
await g.createAgent(
|
|
2289
|
-
invocationName:
|
|
2290
|
-
}),
|
|
2072
|
+
}, [g, e, A]);
|
|
2073
|
+
const j = T(() => {
|
|
2074
|
+
o == null || o(), l && st(l);
|
|
2075
|
+
}, [l, o]), W = T(
|
|
2076
|
+
async (C) => {
|
|
2077
|
+
await g.createAgent(C.definition.ref, {
|
|
2078
|
+
invocationName: C.invocationName
|
|
2079
|
+
}), d == null || d(C), i && st(i);
|
|
2291
2080
|
},
|
|
2292
|
-
[g,
|
|
2293
|
-
),
|
|
2294
|
-
|
|
2081
|
+
[g, d, i]
|
|
2082
|
+
), M = T(() => {
|
|
2083
|
+
P((C) => C + 1);
|
|
2295
2084
|
}, []);
|
|
2296
2085
|
return /* @__PURE__ */ n(
|
|
2297
|
-
|
|
2086
|
+
Nt,
|
|
2298
2087
|
{
|
|
2299
|
-
open:
|
|
2300
|
-
onClose:
|
|
2301
|
-
onStart:
|
|
2302
|
-
agentDefinitions:
|
|
2303
|
-
definitionsState:
|
|
2304
|
-
definitionsError:
|
|
2305
|
-
onRetryDefinitions:
|
|
2306
|
-
embedded:
|
|
2088
|
+
open: e,
|
|
2089
|
+
onClose: j,
|
|
2090
|
+
onStart: W,
|
|
2091
|
+
agentDefinitions: w,
|
|
2092
|
+
definitionsState: b,
|
|
2093
|
+
definitionsError: O,
|
|
2094
|
+
onRetryDefinitions: M,
|
|
2095
|
+
embedded: f
|
|
2307
2096
|
}
|
|
2308
2097
|
);
|
|
2309
|
-
},
|
|
2310
|
-
|
|
2098
|
+
}, Wn = (e) => "agentDefinitionsUrl" in e, Vn = (e) => Wn(e) ? /* @__PURE__ */ n(Jn, { ...e }) : /* @__PURE__ */ n(Nt, { ...e }), jn = (e) => e !== void 0 && e.some((t) => t.status === D.hitl), Yn = (e, t) => jn(t) ? S.hitl : e.status, Xn = ({ column: e, label: t }) => e.statusIcon ? /* @__PURE__ */ n("span", { className: "agent-view__status-indicator", children: /* @__PURE__ */ n(
|
|
2099
|
+
E,
|
|
2311
2100
|
{
|
|
2312
|
-
name:
|
|
2101
|
+
name: e.statusIcon.name,
|
|
2313
2102
|
size: 16,
|
|
2314
|
-
color:
|
|
2315
|
-
className:
|
|
2316
|
-
"agent-view__progress-icon--spinning":
|
|
2103
|
+
color: e.statusIcon.color,
|
|
2104
|
+
className: V({
|
|
2105
|
+
"agent-view__progress-icon--spinning": e.statusIcon.spin
|
|
2317
2106
|
}),
|
|
2318
|
-
screenReaderText:
|
|
2107
|
+
screenReaderText: t
|
|
2319
2108
|
}
|
|
2320
2109
|
) }) : /* @__PURE__ */ n(
|
|
2321
2110
|
"span",
|
|
2322
2111
|
{
|
|
2323
|
-
className:
|
|
2324
|
-
[`agent-view__dot--${
|
|
2112
|
+
className: V("agent-view__dot", {
|
|
2113
|
+
[`agent-view__dot--${e.dotModifier}`]: e.dotModifier
|
|
2325
2114
|
}),
|
|
2326
|
-
children: /* @__PURE__ */ n(
|
|
2115
|
+
children: /* @__PURE__ */ n(ot, { colour: e.dotColour, label: t })
|
|
2327
2116
|
}
|
|
2328
|
-
),
|
|
2329
|
-
agent:
|
|
2330
|
-
agentName:
|
|
2117
|
+
), Qn = ({
|
|
2118
|
+
agent: e,
|
|
2119
|
+
agentName: t,
|
|
2331
2120
|
column: a,
|
|
2332
2121
|
isExpanded: s,
|
|
2333
2122
|
isLoading: r,
|
|
2334
2123
|
checklist: l,
|
|
2335
2124
|
error: i,
|
|
2336
|
-
onToggle:
|
|
2337
|
-
onViewAgent:
|
|
2125
|
+
onToggle: o,
|
|
2126
|
+
onViewAgent: d
|
|
2338
2127
|
}) => {
|
|
2339
|
-
const { id:
|
|
2128
|
+
const { id: f, invocation_name: p } = e, g = `agent-card-${f}-header`, w = `agent-card-${f}-progress`;
|
|
2340
2129
|
return /* @__PURE__ */ n(
|
|
2341
2130
|
"li",
|
|
2342
2131
|
{
|
|
2343
|
-
className:
|
|
2132
|
+
className: V("agent-view__card", {
|
|
2344
2133
|
"agent-view__card--expanded": s
|
|
2345
2134
|
}),
|
|
2346
|
-
children: /* @__PURE__ */
|
|
2135
|
+
children: /* @__PURE__ */ c(Ot, { spacing: "dense", children: [
|
|
2347
2136
|
/* @__PURE__ */ n(
|
|
2348
2137
|
"button",
|
|
2349
2138
|
{
|
|
2350
2139
|
type: "button",
|
|
2351
2140
|
className: "agent-view__card-toggle",
|
|
2352
2141
|
"aria-expanded": s,
|
|
2353
|
-
"aria-controls":
|
|
2354
|
-
"aria-label":
|
|
2142
|
+
"aria-controls": w,
|
|
2143
|
+
"aria-label": p,
|
|
2355
2144
|
id: g,
|
|
2356
|
-
onClick: () =>
|
|
2357
|
-
children: /* @__PURE__ */
|
|
2358
|
-
/* @__PURE__ */ n(
|
|
2359
|
-
/* @__PURE__ */ n("span", { className: "agent-view__card-invocation-name", children:
|
|
2360
|
-
/* @__PURE__ */ n("span", { className: "agent-view__card-agent-name", children:
|
|
2145
|
+
onClick: () => o(f),
|
|
2146
|
+
children: /* @__PURE__ */ c("div", { className: "agent-view__card-content", children: [
|
|
2147
|
+
/* @__PURE__ */ n(Xn, { column: a }),
|
|
2148
|
+
/* @__PURE__ */ n("span", { className: "agent-view__card-invocation-name", children: p }),
|
|
2149
|
+
/* @__PURE__ */ n("span", { className: "agent-view__card-agent-name", children: t }),
|
|
2361
2150
|
/* @__PURE__ */ n(
|
|
2362
|
-
|
|
2151
|
+
E,
|
|
2363
2152
|
{
|
|
2364
2153
|
name: s ? "chevron-up" : "chevron-down",
|
|
2365
2154
|
size: 16,
|
|
@@ -2369,47 +2158,47 @@ const St = (t, e) => (a) => {
|
|
|
2369
2158
|
] })
|
|
2370
2159
|
}
|
|
2371
2160
|
),
|
|
2372
|
-
s && /* @__PURE__ */
|
|
2161
|
+
s && /* @__PURE__ */ c(
|
|
2373
2162
|
"div",
|
|
2374
2163
|
{
|
|
2375
|
-
id:
|
|
2164
|
+
id: w,
|
|
2376
2165
|
"aria-labelledby": g,
|
|
2377
2166
|
className: "agent-view__card-progress",
|
|
2378
2167
|
children: [
|
|
2379
|
-
r && /* @__PURE__ */
|
|
2168
|
+
r && /* @__PURE__ */ c("div", { className: "agent-view__progress-loading", "aria-live": "polite", children: [
|
|
2380
2169
|
/* @__PURE__ */ n(
|
|
2381
|
-
|
|
2170
|
+
E,
|
|
2382
2171
|
{
|
|
2383
2172
|
name: "loader",
|
|
2384
2173
|
size: 16,
|
|
2385
2174
|
color: "var(--color-brand-600)",
|
|
2386
2175
|
className: "agent-view__progress-icon--spinning",
|
|
2387
|
-
screenReaderText:
|
|
2176
|
+
screenReaderText: de
|
|
2388
2177
|
}
|
|
2389
2178
|
),
|
|
2390
|
-
/* @__PURE__ */ n("span", { children:
|
|
2179
|
+
/* @__PURE__ */ n("span", { children: de })
|
|
2391
2180
|
] }),
|
|
2392
2181
|
!r && i && /* @__PURE__ */ n("p", { className: "agent-view__progress-error", role: "alert", children: i }),
|
|
2393
|
-
!r && !i && l !== null && /* @__PURE__ */ n(
|
|
2394
|
-
!r && !i && l === null && /* @__PURE__ */
|
|
2182
|
+
!r && !i && l !== null && /* @__PURE__ */ n(Xt, { checklist: l }),
|
|
2183
|
+
!r && !i && l === null && /* @__PURE__ */ c("div", { className: "agent-view__progress-loading", "aria-live": "polite", children: [
|
|
2395
2184
|
/* @__PURE__ */ n(
|
|
2396
|
-
|
|
2185
|
+
E,
|
|
2397
2186
|
{
|
|
2398
2187
|
name: "loader",
|
|
2399
2188
|
size: 16,
|
|
2400
2189
|
color: "var(--color-brand-600)",
|
|
2401
2190
|
className: "agent-view__progress-icon--spinning",
|
|
2402
|
-
screenReaderText:
|
|
2191
|
+
screenReaderText: de
|
|
2403
2192
|
}
|
|
2404
2193
|
),
|
|
2405
|
-
/* @__PURE__ */ n("span", { children:
|
|
2194
|
+
/* @__PURE__ */ n("span", { children: de })
|
|
2406
2195
|
] }),
|
|
2407
2196
|
/* @__PURE__ */ n("div", { className: "agent-view__card-actions", children: /* @__PURE__ */ n(
|
|
2408
|
-
|
|
2197
|
+
Q,
|
|
2409
2198
|
{
|
|
2410
2199
|
variant: "secondary",
|
|
2411
2200
|
size: "S",
|
|
2412
|
-
onClick: () =>
|
|
2201
|
+
onClick: () => d == null ? void 0 : d(e),
|
|
2413
2202
|
children: "View agent"
|
|
2414
2203
|
}
|
|
2415
2204
|
) })
|
|
@@ -2419,72 +2208,72 @@ const St = (t, e) => (a) => {
|
|
|
2419
2208
|
] })
|
|
2420
2209
|
}
|
|
2421
2210
|
);
|
|
2422
|
-
},
|
|
2423
|
-
column:
|
|
2424
|
-
agents:
|
|
2211
|
+
}, rt = ({
|
|
2212
|
+
column: e,
|
|
2213
|
+
agents: t,
|
|
2425
2214
|
expandedAgentId: a,
|
|
2426
2215
|
loadingAgentId: s,
|
|
2427
2216
|
checklistByInvocationId: r,
|
|
2428
2217
|
errorByAgentId: l,
|
|
2429
2218
|
definitionNameByRef: i,
|
|
2430
|
-
onToggleAgent:
|
|
2431
|
-
onViewAgent:
|
|
2432
|
-
isSplit:
|
|
2433
|
-
}) => /* @__PURE__ */
|
|
2219
|
+
onToggleAgent: o,
|
|
2220
|
+
onViewAgent: d,
|
|
2221
|
+
isSplit: f = !1
|
|
2222
|
+
}) => /* @__PURE__ */ c(
|
|
2434
2223
|
"section",
|
|
2435
2224
|
{
|
|
2436
|
-
className:
|
|
2437
|
-
"agent-view__column--split":
|
|
2225
|
+
className: V("agent-view__column", {
|
|
2226
|
+
"agent-view__column--split": f
|
|
2438
2227
|
}),
|
|
2439
|
-
"aria-label":
|
|
2228
|
+
"aria-label": e.title,
|
|
2440
2229
|
children: [
|
|
2441
|
-
/* @__PURE__ */
|
|
2442
|
-
/* @__PURE__ */ n(
|
|
2443
|
-
/* @__PURE__ */ n("span", { className: "agent-view__column-count", children:
|
|
2230
|
+
/* @__PURE__ */ c("div", { className: "agent-view__column-header", children: [
|
|
2231
|
+
/* @__PURE__ */ n(ye, { level: 4, children: e.title }),
|
|
2232
|
+
/* @__PURE__ */ n("span", { className: "agent-view__column-count", children: t.length })
|
|
2444
2233
|
] }),
|
|
2445
|
-
/* @__PURE__ */ n("ul", { className: "agent-view__card-list", children:
|
|
2446
|
-
|
|
2234
|
+
/* @__PURE__ */ n("ul", { className: "agent-view__card-list", children: t.map((p) => /* @__PURE__ */ n(
|
|
2235
|
+
Qn,
|
|
2447
2236
|
{
|
|
2448
|
-
agent:
|
|
2449
|
-
agentName:
|
|
2450
|
-
column:
|
|
2451
|
-
isExpanded: a ===
|
|
2452
|
-
isLoading: s ===
|
|
2453
|
-
checklist: r[
|
|
2454
|
-
error: l[
|
|
2455
|
-
onToggle:
|
|
2456
|
-
onViewAgent:
|
|
2237
|
+
agent: p,
|
|
2238
|
+
agentName: Je(p, i),
|
|
2239
|
+
column: e,
|
|
2240
|
+
isExpanded: a === p.id,
|
|
2241
|
+
isLoading: s === p.id,
|
|
2242
|
+
checklist: r[p.invocation_id] ?? null,
|
|
2243
|
+
error: l[p.id] ?? null,
|
|
2244
|
+
onToggle: o,
|
|
2245
|
+
onViewAgent: d
|
|
2457
2246
|
},
|
|
2458
|
-
|
|
2247
|
+
p.id
|
|
2459
2248
|
)) })
|
|
2460
2249
|
]
|
|
2461
2250
|
}
|
|
2462
|
-
),
|
|
2463
|
-
jwt:
|
|
2464
|
-
headers:
|
|
2251
|
+
), Je = (e, t) => t.get(e.agent_definition_ref) ?? e.agent_definition_ref.replace(/_/g, " "), ra = ({
|
|
2252
|
+
jwt: e,
|
|
2253
|
+
headers: t,
|
|
2465
2254
|
agentDefinitionsUrl: a,
|
|
2466
2255
|
agentsUrl: s,
|
|
2467
2256
|
agentUrl: r,
|
|
2468
2257
|
agentChecklistUrl: l,
|
|
2469
2258
|
agentResourcesUrl: i,
|
|
2470
|
-
agentTimelineUrl:
|
|
2471
|
-
agentChatUrl:
|
|
2472
|
-
agentConversationUrl:
|
|
2473
|
-
enableUpload:
|
|
2259
|
+
agentTimelineUrl: o,
|
|
2260
|
+
agentChatUrl: d,
|
|
2261
|
+
agentConversationUrl: f,
|
|
2262
|
+
enableUpload: p,
|
|
2474
2263
|
showHeader: g = !1,
|
|
2475
|
-
institutions:
|
|
2264
|
+
institutions: w
|
|
2476
2265
|
}) => {
|
|
2477
|
-
var
|
|
2478
|
-
const
|
|
2266
|
+
var _e;
|
|
2267
|
+
const u = q(
|
|
2479
2268
|
() => ({
|
|
2480
2269
|
agentDefinitions: a,
|
|
2481
2270
|
agents: s,
|
|
2482
2271
|
agent: r,
|
|
2483
2272
|
agentChecklist: l,
|
|
2484
2273
|
...i ? { agentResources: i } : {},
|
|
2485
|
-
...
|
|
2486
|
-
agentChat:
|
|
2487
|
-
agentConversation:
|
|
2274
|
+
...o ? { agentTimeline: o } : {},
|
|
2275
|
+
agentChat: d,
|
|
2276
|
+
agentConversation: f
|
|
2488
2277
|
}),
|
|
2489
2278
|
[
|
|
2490
2279
|
a,
|
|
@@ -2492,166 +2281,166 @@ const St = (t, e) => (a) => {
|
|
|
2492
2281
|
r,
|
|
2493
2282
|
l,
|
|
2494
2283
|
i,
|
|
2284
|
+
o,
|
|
2495
2285
|
d,
|
|
2496
|
-
|
|
2497
|
-
p
|
|
2286
|
+
f
|
|
2498
2287
|
]
|
|
2499
|
-
), [
|
|
2500
|
-
(h) => h.applicationId ===
|
|
2501
|
-
)) == null ? void 0 :
|
|
2502
|
-
const h = { ...
|
|
2503
|
-
return
|
|
2504
|
-
}, [
|
|
2505
|
-
agents:
|
|
2506
|
-
agentDefinitions:
|
|
2507
|
-
loadState:
|
|
2508
|
-
loadError:
|
|
2509
|
-
reload:
|
|
2510
|
-
refresh:
|
|
2511
|
-
fetchAgentChecklist:
|
|
2512
|
-
createAgent:
|
|
2513
|
-
} =
|
|
2514
|
-
const h = new Set(
|
|
2515
|
-
(
|
|
2288
|
+
), [b, k] = _(null), O = b ? (_e = w == null ? void 0 : w.find(
|
|
2289
|
+
(h) => h.applicationId === b.application_id
|
|
2290
|
+
)) == null ? void 0 : _e.applicationUrl : void 0, F = q(() => {
|
|
2291
|
+
const h = { ...t ?? {} };
|
|
2292
|
+
return O ? h[ge.arborApplicationUrl] = O : delete h[ge.arborApplicationUrl], h;
|
|
2293
|
+
}, [t, O]), {
|
|
2294
|
+
agents: A,
|
|
2295
|
+
agentDefinitions: P,
|
|
2296
|
+
loadState: j,
|
|
2297
|
+
loadError: W,
|
|
2298
|
+
reload: M,
|
|
2299
|
+
refresh: C,
|
|
2300
|
+
fetchAgentChecklist: x,
|
|
2301
|
+
createAgent: Z
|
|
2302
|
+
} = Un({ jwt: e, headers: F, urls: u }), [N, I] = _(!1), [H, Y] = _(null), [$, U] = _(null), [G, Ne] = _({}), [Ue, he] = _({}), [ae, Fe] = _([]), [oe, He] = _([]), pe = q(() => {
|
|
2303
|
+
const h = new Set(A.map((v) => v.application_id)), y = new Map(
|
|
2304
|
+
(w ?? []).map((v) => [v.applicationId, v.name])
|
|
2516
2305
|
);
|
|
2517
2306
|
return [...h].sort(
|
|
2518
|
-
(
|
|
2519
|
-
).map((
|
|
2520
|
-
value:
|
|
2521
|
-
label:
|
|
2307
|
+
(v, K) => (y.get(v) ?? v).localeCompare(y.get(K) ?? K)
|
|
2308
|
+
).map((v) => ({
|
|
2309
|
+
value: v,
|
|
2310
|
+
label: y.get(v) ?? v
|
|
2522
2311
|
}));
|
|
2523
|
-
}, [
|
|
2524
|
-
() => new Map(
|
|
2525
|
-
[
|
|
2526
|
-
),
|
|
2527
|
-
|
|
2528
|
-
)].sort((
|
|
2529
|
-
value:
|
|
2530
|
-
label:
|
|
2531
|
-
})), [
|
|
2532
|
-
|
|
2312
|
+
}, [A, w]), re = q(
|
|
2313
|
+
() => new Map(P.map((h) => [h.ref, h.display_name])),
|
|
2314
|
+
[P]
|
|
2315
|
+
), ue = q(() => [...new Set(
|
|
2316
|
+
A.map((y) => Je(y, re))
|
|
2317
|
+
)].sort((y, v) => y.localeCompare(v)).map((y) => ({
|
|
2318
|
+
value: y,
|
|
2319
|
+
label: y
|
|
2320
|
+
})), [A, re]), ke = q(() => A.filter((h) => !(ae.length > 0 && !ae.includes(h.application_id) || oe.length > 0 && !oe.includes(Je(h, re)))), [A, re, oe, ae]), Ae = pe.length > 1, Ce = ue.length > 1, Se = Ae || Ce;
|
|
2321
|
+
J(() => {
|
|
2533
2322
|
const h = window.setInterval(() => {
|
|
2534
|
-
|
|
2323
|
+
C();
|
|
2535
2324
|
}, 6e4);
|
|
2536
2325
|
return () => {
|
|
2537
2326
|
window.clearInterval(h);
|
|
2538
2327
|
};
|
|
2539
|
-
}, [
|
|
2540
|
-
if (
|
|
2328
|
+
}, [C]), J(() => {
|
|
2329
|
+
if (A.length === 0)
|
|
2541
2330
|
return;
|
|
2542
2331
|
let h = !1;
|
|
2543
2332
|
return (async () => {
|
|
2544
|
-
const
|
|
2545
|
-
|
|
2546
|
-
const
|
|
2333
|
+
const y = await Promise.allSettled(
|
|
2334
|
+
A.map(async (v) => {
|
|
2335
|
+
const K = await x(v.invocation_id);
|
|
2547
2336
|
return {
|
|
2548
|
-
agentId:
|
|
2549
|
-
invocationId:
|
|
2550
|
-
checklist:
|
|
2337
|
+
agentId: v.id,
|
|
2338
|
+
invocationId: v.invocation_id,
|
|
2339
|
+
checklist: K.checklist
|
|
2551
2340
|
};
|
|
2552
2341
|
})
|
|
2553
2342
|
);
|
|
2554
|
-
h || (
|
|
2555
|
-
const
|
|
2556
|
-
let
|
|
2557
|
-
for (const
|
|
2558
|
-
if (
|
|
2343
|
+
h || (Ne((v) => {
|
|
2344
|
+
const K = { ...v };
|
|
2345
|
+
let ee = !1;
|
|
2346
|
+
for (const ce of y) {
|
|
2347
|
+
if (ce.status !== "fulfilled")
|
|
2559
2348
|
continue;
|
|
2560
|
-
const { invocationId:
|
|
2561
|
-
JSON.stringify(
|
|
2349
|
+
const { invocationId: ie, checklist: Oe } = ce.value;
|
|
2350
|
+
JSON.stringify(v[ie]) !== JSON.stringify(Oe) && (K[ie] = Oe, ee = !0);
|
|
2562
2351
|
}
|
|
2563
|
-
return
|
|
2564
|
-
}),
|
|
2565
|
-
const
|
|
2566
|
-
let
|
|
2567
|
-
return
|
|
2568
|
-
|
|
2569
|
-
}),
|
|
2352
|
+
return ee ? K : v;
|
|
2353
|
+
}), he((v) => {
|
|
2354
|
+
const K = { ...v };
|
|
2355
|
+
let ee = !1;
|
|
2356
|
+
return y.forEach((ce, ie) => {
|
|
2357
|
+
ce.status === "rejected" && K[A[ie].id] !== xe && (K[A[ie].id] = xe, ee = !0);
|
|
2358
|
+
}), ee ? K : v;
|
|
2570
2359
|
}));
|
|
2571
2360
|
})(), () => {
|
|
2572
2361
|
h = !0;
|
|
2573
2362
|
};
|
|
2574
|
-
}, [
|
|
2575
|
-
const
|
|
2363
|
+
}, [A, x]);
|
|
2364
|
+
const be = T(
|
|
2576
2365
|
async (h) => {
|
|
2577
|
-
if (!
|
|
2578
|
-
|
|
2579
|
-
const
|
|
2580
|
-
return delete
|
|
2366
|
+
if (!G[h.invocation_id]) {
|
|
2367
|
+
U(h.id), he((y) => {
|
|
2368
|
+
const v = { ...y };
|
|
2369
|
+
return delete v[h.id], v;
|
|
2581
2370
|
});
|
|
2582
2371
|
try {
|
|
2583
|
-
const
|
|
2584
|
-
|
|
2585
|
-
...
|
|
2586
|
-
[h.invocation_id]:
|
|
2372
|
+
const y = await x(h.invocation_id);
|
|
2373
|
+
Ne((v) => ({
|
|
2374
|
+
...v,
|
|
2375
|
+
[h.invocation_id]: y.checklist
|
|
2587
2376
|
}));
|
|
2588
2377
|
} catch {
|
|
2589
|
-
|
|
2590
|
-
...
|
|
2591
|
-
[h.id]:
|
|
2378
|
+
he((y) => ({
|
|
2379
|
+
...y,
|
|
2380
|
+
[h.id]: xe
|
|
2592
2381
|
}));
|
|
2593
2382
|
} finally {
|
|
2594
|
-
|
|
2383
|
+
U((y) => y === h.id ? null : y);
|
|
2595
2384
|
}
|
|
2596
2385
|
}
|
|
2597
2386
|
},
|
|
2598
|
-
[
|
|
2599
|
-
),
|
|
2387
|
+
[x, G]
|
|
2388
|
+
), Te = T(
|
|
2600
2389
|
(h) => {
|
|
2601
2390
|
if (H === h) {
|
|
2602
|
-
|
|
2391
|
+
Y(null);
|
|
2603
2392
|
return;
|
|
2604
2393
|
}
|
|
2605
|
-
const
|
|
2606
|
-
|
|
2394
|
+
const y = A.find(({ id: v }) => v === h);
|
|
2395
|
+
y && (Y(h), be(y));
|
|
2607
2396
|
},
|
|
2608
|
-
[
|
|
2609
|
-
),
|
|
2397
|
+
[A, H, be]
|
|
2398
|
+
), Ee = q(() => {
|
|
2610
2399
|
const h = {};
|
|
2611
|
-
for (const
|
|
2612
|
-
const
|
|
2613
|
-
|
|
2614
|
-
|
|
2400
|
+
for (const y of ke) {
|
|
2401
|
+
const v = Yn(
|
|
2402
|
+
y,
|
|
2403
|
+
G[y.invocation_id]
|
|
2615
2404
|
);
|
|
2616
|
-
(h[
|
|
2405
|
+
(h[v] ?? (h[v] = [])).push(y);
|
|
2617
2406
|
}
|
|
2618
2407
|
return h;
|
|
2619
|
-
}, [
|
|
2620
|
-
|
|
2621
|
-
}, []),
|
|
2408
|
+
}, [ke, G]), me = T((h) => {
|
|
2409
|
+
k(h);
|
|
2410
|
+
}, []), Be = T(
|
|
2622
2411
|
async (h) => {
|
|
2623
|
-
const
|
|
2624
|
-
|
|
2412
|
+
const y = await Z(h);
|
|
2413
|
+
k(y), I(!1);
|
|
2625
2414
|
},
|
|
2626
|
-
[
|
|
2627
|
-
),
|
|
2628
|
-
|
|
2629
|
-
}, []),
|
|
2415
|
+
[Z]
|
|
2416
|
+
), Ie = T(() => {
|
|
2417
|
+
k(null);
|
|
2418
|
+
}, []), Re = {
|
|
2630
2419
|
expandedAgentId: H,
|
|
2631
|
-
loadingAgentId:
|
|
2632
|
-
checklistByInvocationId:
|
|
2633
|
-
errorByAgentId:
|
|
2634
|
-
definitionNameByRef:
|
|
2635
|
-
onToggleAgent:
|
|
2636
|
-
onViewAgent:
|
|
2420
|
+
loadingAgentId: $,
|
|
2421
|
+
checklistByInvocationId: G,
|
|
2422
|
+
errorByAgentId: Ue,
|
|
2423
|
+
definitionNameByRef: re,
|
|
2424
|
+
onToggleAgent: Te,
|
|
2425
|
+
onViewAgent: me
|
|
2637
2426
|
};
|
|
2638
|
-
return /* @__PURE__ */
|
|
2639
|
-
g && /* @__PURE__ */
|
|
2640
|
-
/* @__PURE__ */ n(
|
|
2427
|
+
return /* @__PURE__ */ c("div", { className: "agent-view-frontend agent-view", children: [
|
|
2428
|
+
g && /* @__PURE__ */ c("div", { className: "agent-view__header", children: [
|
|
2429
|
+
/* @__PURE__ */ n(ye, { level: 1, children: "Agents" }),
|
|
2641
2430
|
/* @__PURE__ */ n(
|
|
2642
|
-
|
|
2431
|
+
Q,
|
|
2643
2432
|
{
|
|
2644
2433
|
variant: "primary",
|
|
2645
2434
|
size: "S",
|
|
2646
2435
|
iconLeftName: "sparkles",
|
|
2647
2436
|
iconLeftScreenReaderText: "Start an agent",
|
|
2648
|
-
onClick: () =>
|
|
2437
|
+
onClick: () => I(!0),
|
|
2649
2438
|
children: "Start an agent"
|
|
2650
2439
|
}
|
|
2651
2440
|
)
|
|
2652
2441
|
] }),
|
|
2653
|
-
|
|
2654
|
-
|
|
2442
|
+
A.length > 0 && Se && /* @__PURE__ */ c("div", { className: "agent-view__filters", children: [
|
|
2443
|
+
Ae && /* @__PURE__ */ c("div", { className: "agent-view__filter", children: [
|
|
2655
2444
|
/* @__PURE__ */ n(
|
|
2656
2445
|
"label",
|
|
2657
2446
|
{
|
|
@@ -2661,23 +2450,23 @@ const St = (t, e) => (a) => {
|
|
|
2661
2450
|
}
|
|
2662
2451
|
),
|
|
2663
2452
|
/* @__PURE__ */ n(
|
|
2664
|
-
|
|
2453
|
+
je,
|
|
2665
2454
|
{
|
|
2666
2455
|
id: "agent-view-institution-filter",
|
|
2667
2456
|
triggerVariant: "button",
|
|
2668
2457
|
multiple: !0,
|
|
2669
2458
|
searchType: "substring",
|
|
2670
2459
|
placeholder: "All institutions",
|
|
2671
|
-
options:
|
|
2672
|
-
value:
|
|
2673
|
-
onValueChange:
|
|
2460
|
+
options: pe,
|
|
2461
|
+
value: ae,
|
|
2462
|
+
onValueChange: Fe,
|
|
2674
2463
|
showSelectionCountBadge: !0,
|
|
2675
2464
|
showClearAll: !0,
|
|
2676
2465
|
clearAllLabel: "Clear institutions"
|
|
2677
2466
|
}
|
|
2678
2467
|
)
|
|
2679
2468
|
] }),
|
|
2680
|
-
|
|
2469
|
+
Ce && /* @__PURE__ */ c("div", { className: "agent-view__filter", children: [
|
|
2681
2470
|
/* @__PURE__ */ n(
|
|
2682
2471
|
"label",
|
|
2683
2472
|
{
|
|
@@ -2687,16 +2476,16 @@ const St = (t, e) => (a) => {
|
|
|
2687
2476
|
}
|
|
2688
2477
|
),
|
|
2689
2478
|
/* @__PURE__ */ n(
|
|
2690
|
-
|
|
2479
|
+
je,
|
|
2691
2480
|
{
|
|
2692
2481
|
id: "agent-view-agent-filter",
|
|
2693
2482
|
triggerVariant: "button",
|
|
2694
2483
|
multiple: !0,
|
|
2695
2484
|
searchType: "substring",
|
|
2696
2485
|
placeholder: "All agents",
|
|
2697
|
-
options:
|
|
2698
|
-
value:
|
|
2699
|
-
onValueChange:
|
|
2486
|
+
options: ue,
|
|
2487
|
+
value: oe,
|
|
2488
|
+
onValueChange: He,
|
|
2700
2489
|
showSelectionCountBadge: !0,
|
|
2701
2490
|
showClearAll: !0,
|
|
2702
2491
|
clearAllLabel: "Clear agents"
|
|
@@ -2704,117 +2493,116 @@ const St = (t, e) => (a) => {
|
|
|
2704
2493
|
)
|
|
2705
2494
|
] })
|
|
2706
2495
|
] }),
|
|
2707
|
-
|
|
2496
|
+
j === "error" ? /* @__PURE__ */ c("div", { className: "agent-view__state agent-view__state--error", role: "alert", children: [
|
|
2708
2497
|
/* @__PURE__ */ n(
|
|
2709
|
-
|
|
2498
|
+
E,
|
|
2710
2499
|
{
|
|
2711
2500
|
name: "triangle-alert",
|
|
2712
2501
|
size: 24,
|
|
2713
2502
|
color: "var(--color-semantic-destructive-600)"
|
|
2714
2503
|
}
|
|
2715
2504
|
),
|
|
2716
|
-
/* @__PURE__ */ n("p", { className: "agent-view__state-message", children:
|
|
2717
|
-
/* @__PURE__ */ n(
|
|
2718
|
-
] }) :
|
|
2505
|
+
/* @__PURE__ */ n("p", { className: "agent-view__state-message", children: W ?? gt }),
|
|
2506
|
+
/* @__PURE__ */ n(Q, { variant: "secondary", size: "S", onClick: M, children: "Try again" })
|
|
2507
|
+
] }) : j === "loading" && A.length === 0 ? /* @__PURE__ */ c("div", { className: "agent-view__state", "aria-live": "polite", children: [
|
|
2719
2508
|
/* @__PURE__ */ n(
|
|
2720
|
-
|
|
2509
|
+
E,
|
|
2721
2510
|
{
|
|
2722
2511
|
name: "loader",
|
|
2723
2512
|
size: 24,
|
|
2724
2513
|
color: "var(--color-brand-600)",
|
|
2725
2514
|
className: "agent-view__progress-icon--spinning",
|
|
2726
|
-
screenReaderText:
|
|
2515
|
+
screenReaderText: Xe
|
|
2727
2516
|
}
|
|
2728
2517
|
),
|
|
2729
|
-
/* @__PURE__ */ n("p", { className: "agent-view__state-message", children:
|
|
2730
|
-
] }) :
|
|
2731
|
-
|
|
2732
|
-
|
|
2518
|
+
/* @__PURE__ */ n("p", { className: "agent-view__state-message", children: Xe })
|
|
2519
|
+
] }) : A.length === 0 ? /* @__PURE__ */ n(Vt, {}) : /* @__PURE__ */ c("div", { className: "agent-view__board", children: [
|
|
2520
|
+
Mt.map((h) => /* @__PURE__ */ n(
|
|
2521
|
+
rt,
|
|
2733
2522
|
{
|
|
2734
|
-
column:
|
|
2735
|
-
agents:
|
|
2736
|
-
...
|
|
2523
|
+
column: De[h],
|
|
2524
|
+
agents: Ee[h] ?? [],
|
|
2525
|
+
...Re
|
|
2737
2526
|
},
|
|
2738
2527
|
h
|
|
2739
2528
|
)),
|
|
2740
|
-
/* @__PURE__ */ n("div", { className: "agent-view__split-column", children:
|
|
2741
|
-
|
|
2529
|
+
/* @__PURE__ */ n("div", { className: "agent-view__split-column", children: $t.map((h) => /* @__PURE__ */ n(
|
|
2530
|
+
rt,
|
|
2742
2531
|
{
|
|
2743
|
-
column:
|
|
2744
|
-
agents:
|
|
2532
|
+
column: De[h],
|
|
2533
|
+
agents: Ee[h] ?? [],
|
|
2745
2534
|
isSplit: !0,
|
|
2746
|
-
...
|
|
2535
|
+
...Re
|
|
2747
2536
|
},
|
|
2748
2537
|
h
|
|
2749
2538
|
)) })
|
|
2750
2539
|
] }),
|
|
2751
|
-
|
|
2752
|
-
|
|
2540
|
+
b && /* @__PURE__ */ n(
|
|
2541
|
+
Gn,
|
|
2753
2542
|
{
|
|
2754
|
-
agent:
|
|
2755
|
-
invocationId: v.invocation_id,
|
|
2543
|
+
agent: b,
|
|
2756
2544
|
open: !0,
|
|
2757
|
-
jwt:
|
|
2758
|
-
headers:
|
|
2545
|
+
jwt: e,
|
|
2546
|
+
headers: F,
|
|
2759
2547
|
agentUrl: r,
|
|
2760
2548
|
agentChecklistUrl: l,
|
|
2761
2549
|
agentResourcesUrl: i,
|
|
2762
|
-
agentTimelineUrl:
|
|
2763
|
-
agentChatUrl:
|
|
2764
|
-
agentConversationUrl:
|
|
2765
|
-
enableUpload:
|
|
2766
|
-
initialChecklist:
|
|
2767
|
-
onClose:
|
|
2550
|
+
agentTimelineUrl: o,
|
|
2551
|
+
agentChatUrl: d,
|
|
2552
|
+
agentConversationUrl: f,
|
|
2553
|
+
enableUpload: p,
|
|
2554
|
+
initialChecklist: G[b.invocation_id] ?? null,
|
|
2555
|
+
onClose: Ie
|
|
2768
2556
|
},
|
|
2769
|
-
|
|
2557
|
+
b.id
|
|
2770
2558
|
),
|
|
2771
2559
|
/* @__PURE__ */ n(
|
|
2772
|
-
|
|
2560
|
+
Vn,
|
|
2773
2561
|
{
|
|
2774
|
-
open:
|
|
2775
|
-
onClose: () =>
|
|
2776
|
-
onStart:
|
|
2777
|
-
agentDefinitions:
|
|
2562
|
+
open: N,
|
|
2563
|
+
onClose: () => I(!1),
|
|
2564
|
+
onStart: Be,
|
|
2565
|
+
agentDefinitions: P
|
|
2778
2566
|
}
|
|
2779
2567
|
)
|
|
2780
2568
|
] });
|
|
2781
|
-
},
|
|
2782
|
-
const a = Date.now(), s =
|
|
2569
|
+
}, ia = (e, t) => {
|
|
2570
|
+
const a = Date.now(), s = t.trim() || e.agent_intent;
|
|
2783
2571
|
return {
|
|
2784
2572
|
id: `agent-${a}`,
|
|
2785
2573
|
invocation_id: `inv-${a}`,
|
|
2786
|
-
agent_definition_ref:
|
|
2787
|
-
agent_intent:
|
|
2574
|
+
agent_definition_ref: e.ref,
|
|
2575
|
+
agent_intent: e.agent_intent,
|
|
2788
2576
|
invocation_name: s,
|
|
2789
|
-
application_id:
|
|
2790
|
-
created_by:
|
|
2791
|
-
status:
|
|
2577
|
+
application_id: Ut,
|
|
2578
|
+
created_by: Ft,
|
|
2579
|
+
status: S["generating-a-response"],
|
|
2792
2580
|
context_ref: null,
|
|
2793
2581
|
checklist_ref: null
|
|
2794
2582
|
};
|
|
2795
2583
|
};
|
|
2796
2584
|
export {
|
|
2797
|
-
|
|
2798
|
-
|
|
2799
|
-
|
|
2800
|
-
|
|
2801
|
-
|
|
2802
|
-
|
|
2803
|
-
|
|
2804
|
-
|
|
2805
|
-
|
|
2806
|
-
|
|
2807
|
-
|
|
2808
|
-
|
|
2809
|
-
|
|
2810
|
-
|
|
2811
|
-
|
|
2812
|
-
|
|
2813
|
-
|
|
2814
|
-
|
|
2815
|
-
|
|
2816
|
-
|
|
2817
|
-
|
|
2818
|
-
|
|
2819
|
-
|
|
2585
|
+
ra as AgentMonitorKanban,
|
|
2586
|
+
We as AgentServiceClient,
|
|
2587
|
+
ve as AgentServiceError,
|
|
2588
|
+
Gn as AgentView,
|
|
2589
|
+
Dn as HttpChatConnector,
|
|
2590
|
+
Vn as NewAgentModal,
|
|
2591
|
+
ia as buildAgentFromDefinition,
|
|
2592
|
+
wt as createHttpChatConnectorFactory,
|
|
2593
|
+
et as mapApiAgent,
|
|
2594
|
+
mt as mapApiAgentDefinition,
|
|
2595
|
+
An as mapApiAgentStatus,
|
|
2596
|
+
En as mapApiAgentTimelineResponse,
|
|
2597
|
+
vt as mapApiChecklistEndpointResponse,
|
|
2598
|
+
ft as mapApiChecklistItem,
|
|
2599
|
+
Rn as mapApiChecklistResponse,
|
|
2600
|
+
Cn as mapApiChecklistStatus,
|
|
2601
|
+
On as mapApiConversationMessages,
|
|
2602
|
+
$e as mapApiOpeningMessage,
|
|
2603
|
+
Tn as mapApiResource,
|
|
2604
|
+
_t as mapApiResourcesEndpointResponse,
|
|
2605
|
+
sa as mapApiTripOption,
|
|
2606
|
+
Un as useAgentService,
|
|
2607
|
+
Hn as useAgentWorkspace
|
|
2820
2608
|
};
|