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