@arbor-education/agent-view-frontend 0.4.11-alpha.2 → 0.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/dist/index.cjs +5 -5
- package/dist/index.d.ts +1 -1
- package/dist/index.js +683 -694
- package/dist/style.css +1 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
import { jsxs as l, jsx as a, Fragment as fe } from "react/jsx-runtime";
|
|
2
|
-
import { useRef as le, useState as
|
|
2
|
+
import { useRef as le, useState as h, useLayoutEffect as et, useEffect as H, useMemo as Y, useCallback as C } from "react";
|
|
3
3
|
import W from "classnames";
|
|
4
|
-
import { Heading as
|
|
5
|
-
import { CHAT_RESPONSE_TYPE_AGENT as
|
|
4
|
+
import { Heading as be, Icon as U, Dot as qt, SlideoverUtils as Ye, SlideoverManager as vn, Modal as ue, Button as te, Tabs as dt, SelectDropdown as wn, TextInput as yn, Combobox as Tt, Card as kn } from "@arbor-education/design-system.components";
|
|
5
|
+
import { CHAT_RESPONSE_TYPE_AGENT as Jt, CHAT_RESPONSE_TYPE_ERROR as Nn, ChatPanel as An, CHAT_RESPONSE_TYPE_USER as Sn, CHAT_RESPONSE_TYPE_INFO as bn } from "@arbor-education/ask-arbor-chat-panel";
|
|
6
6
|
const E = {
|
|
7
7
|
"generating-a-response": "generating-a-response",
|
|
8
8
|
hitl: "hitl",
|
|
9
9
|
complete: "complete",
|
|
10
10
|
failed: "failed"
|
|
11
|
-
},
|
|
11
|
+
}, M = {
|
|
12
12
|
"generating-a-response": "generating-a-response",
|
|
13
13
|
hitl: "hitl",
|
|
14
14
|
complete: "complete",
|
|
@@ -29,9 +29,9 @@ const E = {
|
|
|
29
29
|
file: "file",
|
|
30
30
|
user_file: "user_file",
|
|
31
31
|
link: "link"
|
|
32
|
-
},
|
|
32
|
+
}, Cn = {
|
|
33
33
|
user_file: "user_file"
|
|
34
|
-
},
|
|
34
|
+
}, Rt = {
|
|
35
35
|
cancelled: "cancelled",
|
|
36
36
|
archived: "archived"
|
|
37
37
|
}, gt = {
|
|
@@ -39,27 +39,27 @@ const E = {
|
|
|
39
39
|
requires_attention: "requires_attention",
|
|
40
40
|
available: "available"
|
|
41
41
|
}, ee = {
|
|
42
|
-
[
|
|
42
|
+
[M.complete]: {
|
|
43
43
|
label: "Complete",
|
|
44
44
|
icon: "circle-check",
|
|
45
45
|
color: "var(--color-semantic-success-600)"
|
|
46
46
|
},
|
|
47
|
-
[
|
|
47
|
+
[M.failed]: {
|
|
48
48
|
label: "Failed",
|
|
49
49
|
icon: "circle-x",
|
|
50
50
|
color: "var(--color-semantic-destructive-600)"
|
|
51
51
|
},
|
|
52
|
-
[
|
|
52
|
+
[M.hitl]: {
|
|
53
53
|
label: "Requires attention",
|
|
54
54
|
icon: "triangle-alert",
|
|
55
55
|
color: "var(--color-semantic-warning-600)"
|
|
56
56
|
},
|
|
57
|
-
[
|
|
57
|
+
[M["generating-a-response"]]: {
|
|
58
58
|
label: "Generating a response",
|
|
59
59
|
icon: "sparkles",
|
|
60
60
|
color: "var(--color-brand-600)"
|
|
61
61
|
}
|
|
62
|
-
},
|
|
62
|
+
}, Qe = {
|
|
63
63
|
[E["generating-a-response"]]: {
|
|
64
64
|
status: E["generating-a-response"],
|
|
65
65
|
title: "Active",
|
|
@@ -97,28 +97,28 @@ const E = {
|
|
|
97
97
|
color: ee.failed.color
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
|
-
},
|
|
100
|
+
}, En = [
|
|
101
101
|
E["generating-a-response"],
|
|
102
102
|
E.hitl
|
|
103
|
-
],
|
|
103
|
+
], Tn = [
|
|
104
104
|
E.complete,
|
|
105
105
|
E.failed
|
|
106
|
-
],
|
|
106
|
+
], Rn = "m4", In = "1", Kt = "msg-opening", Ze = "Unable to load agent tasks. Please try again.", On = "Unable to load the resources for this agent", Ln = "Unable to load this document. Please try again.", Wt = "Unable to load the timeline for this agent", Un = "Unable to stop the agent. Please try again.", Pn = "Something went wrong. Please try again.", jt = "Unable to load agents. Please try again.", Se = "Loading tasks…", It = "Loading agents…", xn = "Task", Dn = {
|
|
107
107
|
[B.briefing]: "Briefing",
|
|
108
108
|
[B.running]: "Working",
|
|
109
109
|
[B.stopped]: "Stopped",
|
|
110
110
|
[B.complete]: "Complete"
|
|
111
|
-
},
|
|
111
|
+
}, $n = [
|
|
112
112
|
E["generating-a-response"],
|
|
113
113
|
E.hitl,
|
|
114
114
|
E.complete,
|
|
115
115
|
E.failed
|
|
116
|
-
],
|
|
116
|
+
], Mn = {
|
|
117
117
|
[E["generating-a-response"]]: "Agents currently working on tasks for you.",
|
|
118
118
|
[E.hitl]: "Agents that need your input before they can continue.",
|
|
119
119
|
[E.complete]: "Agents that have finished their work.",
|
|
120
120
|
[E.failed]: "Agents that failed or were stopped."
|
|
121
|
-
},
|
|
121
|
+
}, Hn = () => /* @__PURE__ */ l(
|
|
122
122
|
"svg",
|
|
123
123
|
{
|
|
124
124
|
className: "agent-view__empty-illustration",
|
|
@@ -234,33 +234,33 @@ const E = {
|
|
|
234
234
|
/* @__PURE__ */ a("circle", { cx: "256", cy: "160", r: "4", fill: "var(--color-semantic-destructive-500)" })
|
|
235
235
|
]
|
|
236
236
|
}
|
|
237
|
-
),
|
|
238
|
-
const t =
|
|
237
|
+
), zn = ({ status: e }) => {
|
|
238
|
+
const t = Qe[e];
|
|
239
239
|
return t.statusIcon ? /* @__PURE__ */ a(
|
|
240
|
-
|
|
240
|
+
U,
|
|
241
241
|
{
|
|
242
242
|
name: t.statusIcon.name,
|
|
243
243
|
size: 16,
|
|
244
244
|
color: t.statusIcon.color,
|
|
245
245
|
screenReaderText: t.title
|
|
246
246
|
}
|
|
247
|
-
) : /* @__PURE__ */ a(
|
|
248
|
-
},
|
|
247
|
+
) : /* @__PURE__ */ a(qt, { colour: t.dotColour, label: t.title });
|
|
248
|
+
}, Gn = () => /* @__PURE__ */ l(
|
|
249
249
|
"section",
|
|
250
250
|
{
|
|
251
251
|
className: "agent-view__empty",
|
|
252
252
|
"aria-label": "About the agents board",
|
|
253
253
|
children: [
|
|
254
254
|
/* @__PURE__ */ l("div", { className: "agent-view__empty-content", children: [
|
|
255
|
-
/* @__PURE__ */ a(
|
|
255
|
+
/* @__PURE__ */ a(be, { level: 4, children: "Your agents board" }),
|
|
256
256
|
/* @__PURE__ */ a("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." }),
|
|
257
|
-
/* @__PURE__ */ a("ul", { className: "agent-view__empty-columns", children:
|
|
258
|
-
const t =
|
|
257
|
+
/* @__PURE__ */ a("ul", { className: "agent-view__empty-columns", children: $n.map((e) => {
|
|
258
|
+
const t = Qe[e];
|
|
259
259
|
return /* @__PURE__ */ l("li", { className: "agent-view__empty-column", children: [
|
|
260
|
-
/* @__PURE__ */ a("span", { className: "agent-view__empty-column-indicator", children: /* @__PURE__ */ a(
|
|
260
|
+
/* @__PURE__ */ a("span", { className: "agent-view__empty-column-indicator", children: /* @__PURE__ */ a(zn, { status: e }) }),
|
|
261
261
|
/* @__PURE__ */ l("span", { className: "agent-view__empty-column-text", children: [
|
|
262
262
|
/* @__PURE__ */ a("span", { className: "agent-view__empty-column-title", children: t.title }),
|
|
263
|
-
/* @__PURE__ */ a("span", { className: "agent-view__empty-column-description", children:
|
|
263
|
+
/* @__PURE__ */ a("span", { className: "agent-view__empty-column-description", children: Mn[e] })
|
|
264
264
|
] })
|
|
265
265
|
] }, e);
|
|
266
266
|
}) }),
|
|
@@ -270,40 +270,40 @@ const E = {
|
|
|
270
270
|
" above to begin."
|
|
271
271
|
] })
|
|
272
272
|
] }),
|
|
273
|
-
/* @__PURE__ */ a("div", { className: "agent-view__empty-visual", children: /* @__PURE__ */ a(
|
|
273
|
+
/* @__PURE__ */ a("div", { className: "agent-view__empty-visual", children: /* @__PURE__ */ a(Hn, {}) })
|
|
274
274
|
]
|
|
275
275
|
}
|
|
276
|
-
),
|
|
276
|
+
), Fn = () => ({
|
|
277
277
|
needsInput: [],
|
|
278
278
|
complete: [],
|
|
279
279
|
failed: [],
|
|
280
280
|
tasks: []
|
|
281
|
-
}),
|
|
281
|
+
}), Bn = (e, t) => ({
|
|
282
282
|
...e,
|
|
283
283
|
...t.length > 0 ? { children: t } : {}
|
|
284
|
-
}),
|
|
284
|
+
}), Vt = (e) => {
|
|
285
285
|
const t = [], n = [], s = [], r = [];
|
|
286
286
|
for (const o of e) {
|
|
287
|
-
const i = o.children ?
|
|
288
|
-
if (t.push(...i.needsInput), n.push(...i.complete), s.push(...i.failed), o.status ===
|
|
287
|
+
const i = o.children ? Vt(o.children) : Fn();
|
|
288
|
+
if (t.push(...i.needsInput), n.push(...i.complete), s.push(...i.failed), o.status === M.hitl) {
|
|
289
289
|
t.push({ ...o, children: void 0 });
|
|
290
290
|
continue;
|
|
291
291
|
}
|
|
292
|
-
if (o.status ===
|
|
292
|
+
if (o.status === M.complete) {
|
|
293
293
|
n.push({ ...o, children: void 0 });
|
|
294
294
|
continue;
|
|
295
295
|
}
|
|
296
|
-
if (o.status ===
|
|
296
|
+
if (o.status === M.failed) {
|
|
297
297
|
s.push({ ...o, children: void 0 });
|
|
298
298
|
continue;
|
|
299
299
|
}
|
|
300
|
-
r.push(
|
|
300
|
+
r.push(Bn(o, i.tasks));
|
|
301
301
|
}
|
|
302
302
|
return { needsInput: t, complete: n, failed: s, tasks: r };
|
|
303
|
-
},
|
|
304
|
-
const s =
|
|
303
|
+
}, Ot = (e) => e === M.hitl ? 0 : e === M.complete ? 1 : e === M.failed ? 2 : 3, qn = (e) => e.map((t, n) => ({ item: t, index: n })).sort((t, n) => {
|
|
304
|
+
const s = Ot(t.item.status) - Ot(n.item.status);
|
|
305
305
|
return s !== 0 ? s : t.index - n.index;
|
|
306
|
-
}).map(({ item: t }) => t), ht = 2,
|
|
306
|
+
}).map(({ item: t }) => t), ht = 2, Jn = (e) => {
|
|
307
307
|
if (!e)
|
|
308
308
|
return { canScrollUp: !1, canScrollDown: !1 };
|
|
309
309
|
const t = e.scrollHeight - e.clientHeight;
|
|
@@ -311,7 +311,7 @@ const E = {
|
|
|
311
311
|
canScrollUp: e.scrollTop > ht,
|
|
312
312
|
canScrollDown: e.scrollTop < t - ht
|
|
313
313
|
};
|
|
314
|
-
},
|
|
314
|
+
}, Kn = (e, t) => {
|
|
315
315
|
if (!e || !t)
|
|
316
316
|
return null;
|
|
317
317
|
const n = e.getBoundingClientRect(), s = t.getBoundingClientRect();
|
|
@@ -329,60 +329,60 @@ const E = {
|
|
|
329
329
|
style: r,
|
|
330
330
|
"aria-label": o
|
|
331
331
|
}) => {
|
|
332
|
-
const i = le(null),
|
|
333
|
-
var
|
|
334
|
-
return s ? ((
|
|
332
|
+
const i = le(null), p = le(null), [c, g] = h(!1), [m, N] = h(!1), [y, I] = h(null), O = () => {
|
|
333
|
+
var P;
|
|
334
|
+
return s ? ((P = i.current) == null ? void 0 : P.querySelector(s)) ?? null : p.current;
|
|
335
335
|
}, f = () => {
|
|
336
|
-
const
|
|
336
|
+
const P = O(), A = Jn(P);
|
|
337
337
|
if (g(
|
|
338
|
-
(
|
|
338
|
+
(_) => _ === A.canScrollUp ? _ : A.canScrollUp
|
|
339
339
|
), N(
|
|
340
|
-
(
|
|
340
|
+
(_) => _ === A.canScrollDown ? _ : A.canScrollDown
|
|
341
341
|
), s) {
|
|
342
|
-
const
|
|
343
|
-
I((
|
|
342
|
+
const _ = Kn(i.current, P);
|
|
343
|
+
I((S) => (S == null ? void 0 : S.top) === (_ == null ? void 0 : _.top) && (S == null ? void 0 : S.left) === (_ == null ? void 0 : _.left) && (S == null ? void 0 : S.width) === (_ == null ? void 0 : _.width) && (S == null ? void 0 : S.height) === (_ == null ? void 0 : _.height) ? S : _);
|
|
344
344
|
} else
|
|
345
|
-
I((
|
|
345
|
+
I((_) => _ === null ? _ : null);
|
|
346
346
|
};
|
|
347
|
-
|
|
347
|
+
et(() => {
|
|
348
348
|
f();
|
|
349
349
|
}), H(() => {
|
|
350
|
-
const
|
|
351
|
-
if (!
|
|
350
|
+
const P = i.current;
|
|
351
|
+
if (!P)
|
|
352
352
|
return;
|
|
353
|
-
let A = null,
|
|
354
|
-
const
|
|
355
|
-
A == null || A.removeEventListener("scroll", f),
|
|
353
|
+
let A = null, _ = null;
|
|
354
|
+
const S = () => {
|
|
355
|
+
A == null || A.removeEventListener("scroll", f), _ == null || _.disconnect(), _ = null, A = null;
|
|
356
356
|
}, v = (z) => {
|
|
357
357
|
if (z === A) {
|
|
358
358
|
f();
|
|
359
359
|
return;
|
|
360
360
|
}
|
|
361
|
-
if (
|
|
361
|
+
if (S(), A = z, !A) {
|
|
362
362
|
f();
|
|
363
363
|
return;
|
|
364
364
|
}
|
|
365
|
-
A.addEventListener("scroll", f, { passive: !0 }),
|
|
365
|
+
A.addEventListener("scroll", f, { passive: !0 }), _ = new ResizeObserver(() => f()), _.observe(A), A.firstElementChild instanceof HTMLElement && _.observe(A.firstElementChild), f();
|
|
366
366
|
};
|
|
367
|
-
v(
|
|
367
|
+
v(O());
|
|
368
368
|
const R = new MutationObserver(() => {
|
|
369
|
-
v(
|
|
369
|
+
v(O());
|
|
370
370
|
});
|
|
371
|
-
return R.observe(
|
|
371
|
+
return R.observe(P, {
|
|
372
372
|
childList: !0,
|
|
373
373
|
subtree: !0,
|
|
374
374
|
characterData: !0
|
|
375
375
|
}), window.addEventListener("resize", f), () => {
|
|
376
|
-
window.removeEventListener("resize", f), R.disconnect(),
|
|
376
|
+
window.removeEventListener("resize", f), R.disconnect(), S();
|
|
377
377
|
};
|
|
378
378
|
}, [s]);
|
|
379
|
-
const K = (
|
|
380
|
-
const A =
|
|
379
|
+
const K = (P) => {
|
|
380
|
+
const A = O();
|
|
381
381
|
if (!A)
|
|
382
382
|
return;
|
|
383
|
-
const
|
|
383
|
+
const _ = Math.max(A.clientHeight * 0.75, 120);
|
|
384
384
|
A.scrollBy({
|
|
385
|
-
top:
|
|
385
|
+
top: P === "up" ? -_ : _,
|
|
386
386
|
behavior: "smooth"
|
|
387
387
|
});
|
|
388
388
|
}, T = /* @__PURE__ */ l(fe, { children: [
|
|
@@ -395,11 +395,11 @@ const E = {
|
|
|
395
395
|
className: "scrollable-region__edge scrollable-region__edge--top",
|
|
396
396
|
"aria-label": "Scroll up",
|
|
397
397
|
onClick: () => K("up"),
|
|
398
|
-
children: /* @__PURE__ */ a(
|
|
398
|
+
children: /* @__PURE__ */ a(U, { name: "chevron-up", size: 16, color: "currentColor" })
|
|
399
399
|
}
|
|
400
400
|
)
|
|
401
401
|
] }),
|
|
402
|
-
|
|
402
|
+
m && /* @__PURE__ */ l(fe, { children: [
|
|
403
403
|
/* @__PURE__ */ a(
|
|
404
404
|
"div",
|
|
405
405
|
{
|
|
@@ -414,7 +414,7 @@ const E = {
|
|
|
414
414
|
className: "scrollable-region__edge scrollable-region__edge--bottom",
|
|
415
415
|
"aria-label": "Scroll down",
|
|
416
416
|
onClick: () => K("down"),
|
|
417
|
-
children: /* @__PURE__ */ a(
|
|
417
|
+
children: /* @__PURE__ */ a(U, { name: "chevron-down", size: 16, color: "currentColor" })
|
|
418
418
|
}
|
|
419
419
|
)
|
|
420
420
|
] })
|
|
@@ -428,7 +428,7 @@ const E = {
|
|
|
428
428
|
"aria-label": o,
|
|
429
429
|
children: s ? /* @__PURE__ */ l(fe, { children: [
|
|
430
430
|
e,
|
|
431
|
-
y && (c ||
|
|
431
|
+
y && (c || m) && /* @__PURE__ */ a(
|
|
432
432
|
"div",
|
|
433
433
|
{
|
|
434
434
|
className: "scrollable-region__overlay",
|
|
@@ -446,7 +446,7 @@ const E = {
|
|
|
446
446
|
/* @__PURE__ */ a(
|
|
447
447
|
"div",
|
|
448
448
|
{
|
|
449
|
-
ref:
|
|
449
|
+
ref: p,
|
|
450
450
|
className: W("scrollable-region__viewport", n),
|
|
451
451
|
children: e
|
|
452
452
|
}
|
|
@@ -454,16 +454,16 @@ const E = {
|
|
|
454
454
|
] })
|
|
455
455
|
}
|
|
456
456
|
);
|
|
457
|
-
},
|
|
457
|
+
}, Wn = 48, jn = ({
|
|
458
458
|
checklist: e
|
|
459
459
|
}) => {
|
|
460
460
|
const t = le(null), n = le(!1);
|
|
461
|
-
return
|
|
461
|
+
return et(() => {
|
|
462
462
|
const s = t.current;
|
|
463
463
|
if (!s)
|
|
464
464
|
return;
|
|
465
465
|
const r = s.scrollHeight - s.scrollTop - s.clientHeight;
|
|
466
|
-
(!n.current || r <=
|
|
466
|
+
(!n.current || r <= Wn) && (s.scrollTop = s.scrollHeight, n.current = !0);
|
|
467
467
|
}, [e]), e.length === 0 ? /* @__PURE__ */ a("p", { className: "agent-view__progress-empty", children: "No tasks to display." }) : /* @__PURE__ */ a(
|
|
468
468
|
tt,
|
|
469
469
|
{
|
|
@@ -475,7 +475,7 @@ const E = {
|
|
|
475
475
|
ref: t,
|
|
476
476
|
className: "agent-view__progress-list",
|
|
477
477
|
"aria-label": "Agent tasks",
|
|
478
|
-
children:
|
|
478
|
+
children: qn(e).map((s) => {
|
|
479
479
|
const r = ee[s.status];
|
|
480
480
|
return /* @__PURE__ */ l(
|
|
481
481
|
"li",
|
|
@@ -486,7 +486,7 @@ const E = {
|
|
|
486
486
|
),
|
|
487
487
|
children: [
|
|
488
488
|
/* @__PURE__ */ a(
|
|
489
|
-
|
|
489
|
+
U,
|
|
490
490
|
{
|
|
491
491
|
name: r.icon,
|
|
492
492
|
size: 16,
|
|
@@ -496,7 +496,7 @@ const E = {
|
|
|
496
496
|
),
|
|
497
497
|
/* @__PURE__ */ l("div", { className: "agent-view__progress-item-content", children: [
|
|
498
498
|
/* @__PURE__ */ a("span", { className: "agent-view__progress-label", children: s.task }),
|
|
499
|
-
s.status !==
|
|
499
|
+
s.status !== M.complete && /* @__PURE__ */ a(
|
|
500
500
|
"span",
|
|
501
501
|
{
|
|
502
502
|
className: "agent-view__progress-description",
|
|
@@ -513,7 +513,7 @@ const E = {
|
|
|
513
513
|
)
|
|
514
514
|
}
|
|
515
515
|
);
|
|
516
|
-
},
|
|
516
|
+
}, Vn = ({
|
|
517
517
|
prompts: e,
|
|
518
518
|
classNamePrefix: t = "agent-workspace",
|
|
519
519
|
onSelect: n
|
|
@@ -527,7 +527,7 @@ const E = {
|
|
|
527
527
|
},
|
|
528
528
|
s
|
|
529
529
|
)) });
|
|
530
|
-
class
|
|
530
|
+
class Yn {
|
|
531
531
|
constructor(t, n) {
|
|
532
532
|
this.connector = t, this.canSend = n.canSend, this.onTurn = n.onTurn, this.onAwaitingChange = n.onAwaitingChange;
|
|
533
533
|
}
|
|
@@ -559,14 +559,14 @@ class Kn {
|
|
|
559
559
|
return this.onTurn(r), {
|
|
560
560
|
id: r.message.id,
|
|
561
561
|
text: r.message.text,
|
|
562
|
-
type:
|
|
562
|
+
type: Jt,
|
|
563
563
|
...r.message.followUpPrompts ? { followUpPrompts: r.message.followUpPrompts } : {}
|
|
564
564
|
};
|
|
565
565
|
} catch {
|
|
566
566
|
return {
|
|
567
567
|
id: `error-${Date.now()}`,
|
|
568
|
-
text:
|
|
569
|
-
type:
|
|
568
|
+
text: Pn,
|
|
569
|
+
type: Nn
|
|
570
570
|
};
|
|
571
571
|
} finally {
|
|
572
572
|
(s = this.onAwaitingChange) == null || s.call(this, !1);
|
|
@@ -584,7 +584,7 @@ class Kn {
|
|
|
584
584
|
return !1;
|
|
585
585
|
}
|
|
586
586
|
}
|
|
587
|
-
const
|
|
587
|
+
const Xn = ({
|
|
588
588
|
connector: e,
|
|
589
589
|
phase: t,
|
|
590
590
|
chatHistory: n,
|
|
@@ -592,18 +592,18 @@ const Wn = ({
|
|
|
592
592
|
startQuery: r,
|
|
593
593
|
clarificationMessage: o,
|
|
594
594
|
enableUpload: i = !1,
|
|
595
|
-
onTurn:
|
|
595
|
+
onTurn: p,
|
|
596
596
|
onAwaitingChange: c,
|
|
597
597
|
onClarificationPrompt: g,
|
|
598
|
-
onDismissClarification:
|
|
598
|
+
onDismissClarification: m
|
|
599
599
|
}) => {
|
|
600
600
|
const N = Y(
|
|
601
|
-
() => new
|
|
601
|
+
() => new Yn(e, {
|
|
602
602
|
canSend: () => t === B.running,
|
|
603
|
-
onTurn:
|
|
603
|
+
onTurn: p,
|
|
604
604
|
onAwaitingChange: c
|
|
605
605
|
}),
|
|
606
|
-
[e, t,
|
|
606
|
+
[e, t, p, c]
|
|
607
607
|
), y = t !== B.running, I = t === B.running;
|
|
608
608
|
return /* @__PURE__ */ l("section", { className: "agent-workspace__chat-body", "aria-label": "Chat", children: [
|
|
609
609
|
o && /* @__PURE__ */ l(
|
|
@@ -615,7 +615,7 @@ const Wn = ({
|
|
|
615
615
|
children: [
|
|
616
616
|
/* @__PURE__ */ a("p", { className: "agent-workspace__clarification-text", children: o.text }),
|
|
617
617
|
o.followUpPrompts && /* @__PURE__ */ a(
|
|
618
|
-
|
|
618
|
+
Vn,
|
|
619
619
|
{
|
|
620
620
|
prompts: o.followUpPrompts,
|
|
621
621
|
onSelect: g
|
|
@@ -626,7 +626,7 @@ const Wn = ({
|
|
|
626
626
|
{
|
|
627
627
|
type: "button",
|
|
628
628
|
className: "agent-workspace__clarification-dismiss",
|
|
629
|
-
onClick:
|
|
629
|
+
onClick: m,
|
|
630
630
|
children: "Dismiss"
|
|
631
631
|
}
|
|
632
632
|
)
|
|
@@ -634,7 +634,7 @@ const Wn = ({
|
|
|
634
634
|
}
|
|
635
635
|
),
|
|
636
636
|
/* @__PURE__ */ a("div", { className: "agent-workspace__ask-arbor", children: /* @__PURE__ */ a(tt, { scrollSelector: ".chat-panel-message-list", children: /* @__PURE__ */ a(
|
|
637
|
-
|
|
637
|
+
An,
|
|
638
638
|
{
|
|
639
639
|
connector: N,
|
|
640
640
|
chatHistory: n,
|
|
@@ -653,23 +653,23 @@ const Wn = ({
|
|
|
653
653
|
s
|
|
654
654
|
) }) }),
|
|
655
655
|
t === B.stopped && /* @__PURE__ */ l("div", { className: "agent-workspace__notice", role: "status", children: [
|
|
656
|
-
/* @__PURE__ */ a(
|
|
656
|
+
/* @__PURE__ */ a(U, { name: "circle-alert", size: 16, color: "var(--color-semantic-warning-600)" }),
|
|
657
657
|
/* @__PURE__ */ a("span", { children: "You stopped the agent. Its progress is saved in the checklist." })
|
|
658
658
|
] }),
|
|
659
659
|
t === B.complete && /* @__PURE__ */ l("div", { className: "agent-workspace__notice", role: "status", children: [
|
|
660
|
-
/* @__PURE__ */ a(
|
|
660
|
+
/* @__PURE__ */ a(U, { name: "party-popper", size: 16, color: "var(--color-semantic-success-600)" }),
|
|
661
661
|
/* @__PURE__ */ a("span", { children: "The agent has finished." })
|
|
662
662
|
] })
|
|
663
663
|
] });
|
|
664
|
-
},
|
|
664
|
+
}, Yt = ({
|
|
665
665
|
item: e,
|
|
666
666
|
depth: t,
|
|
667
667
|
canRequestInput: n,
|
|
668
668
|
onAttentionItemClick: s
|
|
669
669
|
}) => {
|
|
670
|
-
const r = ee[e.status], o = e.status.replace(/_/g, "-"), i = e.status ===
|
|
670
|
+
const r = ee[e.status], o = e.status.replace(/_/g, "-"), i = e.status === M.hitl && n && s, p = /* @__PURE__ */ l("div", { className: "agent-workspace__task-row", children: [
|
|
671
671
|
/* @__PURE__ */ a(
|
|
672
|
-
|
|
672
|
+
U,
|
|
673
673
|
{
|
|
674
674
|
name: r.icon,
|
|
675
675
|
size: 16,
|
|
@@ -679,7 +679,7 @@ const Wn = ({
|
|
|
679
679
|
),
|
|
680
680
|
/* @__PURE__ */ l("div", { className: "agent-workspace__task-content", children: [
|
|
681
681
|
/* @__PURE__ */ a("span", { className: "agent-workspace__task-label", children: e.task }),
|
|
682
|
-
e.status !==
|
|
682
|
+
e.status !== M.complete && e.description && /* @__PURE__ */ a("span", { className: "agent-workspace__task-description", children: e.description })
|
|
683
683
|
] })
|
|
684
684
|
] });
|
|
685
685
|
return /* @__PURE__ */ l(
|
|
@@ -696,11 +696,11 @@ const Wn = ({
|
|
|
696
696
|
className: "agent-workspace__task-button",
|
|
697
697
|
"aria-label": `Provide input for ${e.task}`,
|
|
698
698
|
onClick: () => s(e),
|
|
699
|
-
children:
|
|
699
|
+
children: p
|
|
700
700
|
}
|
|
701
|
-
) :
|
|
701
|
+
) : p,
|
|
702
702
|
e.children && e.children.length > 0 && /* @__PURE__ */ a("ul", { className: "agent-workspace__task-children", children: e.children.map((c) => /* @__PURE__ */ a(
|
|
703
|
-
|
|
703
|
+
Yt,
|
|
704
704
|
{
|
|
705
705
|
item: c,
|
|
706
706
|
depth: t + 1,
|
|
@@ -712,13 +712,13 @@ const Wn = ({
|
|
|
712
712
|
]
|
|
713
713
|
}
|
|
714
714
|
);
|
|
715
|
-
},
|
|
715
|
+
}, Xe = ({
|
|
716
716
|
items: e,
|
|
717
717
|
ariaLabel: t,
|
|
718
718
|
canRequestInput: n,
|
|
719
719
|
onAttentionItemClick: s
|
|
720
720
|
}) => /* @__PURE__ */ a("ul", { className: "agent-workspace__task-list", "aria-label": t, children: e.map((r) => /* @__PURE__ */ a(
|
|
721
|
-
|
|
721
|
+
Yt,
|
|
722
722
|
{
|
|
723
723
|
item: r,
|
|
724
724
|
depth: 0,
|
|
@@ -726,7 +726,7 @@ const Wn = ({
|
|
|
726
726
|
onAttentionItemClick: s
|
|
727
727
|
},
|
|
728
728
|
r.task
|
|
729
|
-
)) }),
|
|
729
|
+
)) }), Zn = ({
|
|
730
730
|
checklist: e,
|
|
731
731
|
isLoading: t,
|
|
732
732
|
error: n,
|
|
@@ -735,7 +735,7 @@ const Wn = ({
|
|
|
735
735
|
onAttentionItemClick: o
|
|
736
736
|
}) => {
|
|
737
737
|
const i = Y(
|
|
738
|
-
() => e ?
|
|
738
|
+
() => e ? Vt(e) : null,
|
|
739
739
|
[e]
|
|
740
740
|
);
|
|
741
741
|
return /* @__PURE__ */ l(
|
|
@@ -744,27 +744,27 @@ const Wn = ({
|
|
|
744
744
|
className: "agent-workspace__panel agent-workspace__panel--checklist",
|
|
745
745
|
"aria-label": "Checklist",
|
|
746
746
|
children: [
|
|
747
|
-
/* @__PURE__ */ a("div", { className: "agent-workspace__panel-header", children: /* @__PURE__ */ a(
|
|
747
|
+
/* @__PURE__ */ a("div", { className: "agent-workspace__panel-header", children: /* @__PURE__ */ a(be, { level: 4, children: "Checklist" }) }),
|
|
748
748
|
/* @__PURE__ */ a("div", { className: "agent-workspace__panel-body", "aria-live": "polite", children: /* @__PURE__ */ l(tt, { children: [
|
|
749
749
|
t && /* @__PURE__ */ l("div", { className: "agent-workspace__loading", children: [
|
|
750
750
|
/* @__PURE__ */ a(
|
|
751
|
-
|
|
751
|
+
U,
|
|
752
752
|
{
|
|
753
753
|
name: "loader",
|
|
754
754
|
size: 16,
|
|
755
755
|
color: "var(--color-brand-600)",
|
|
756
756
|
className: "agent-workspace__task-icon--spinning",
|
|
757
|
-
screenReaderText:
|
|
757
|
+
screenReaderText: Se
|
|
758
758
|
}
|
|
759
759
|
),
|
|
760
|
-
/* @__PURE__ */ a("span", { children:
|
|
760
|
+
/* @__PURE__ */ a("span", { children: Se })
|
|
761
761
|
] }),
|
|
762
762
|
!t && n && /* @__PURE__ */ a("p", { className: "agent-workspace__error", role: "alert", children: n }),
|
|
763
763
|
!t && !n && i && /* @__PURE__ */ l(fe, { children: [
|
|
764
764
|
i.needsInput.length > 0 && /* @__PURE__ */ l("div", { className: "agent-workspace__task-group", children: [
|
|
765
765
|
/* @__PURE__ */ a("p", { className: "agent-workspace__task-group-label", children: "Needs your input" }),
|
|
766
766
|
/* @__PURE__ */ a(
|
|
767
|
-
|
|
767
|
+
Xe,
|
|
768
768
|
{
|
|
769
769
|
items: i.needsInput,
|
|
770
770
|
ariaLabel: "Tasks needing your input",
|
|
@@ -782,7 +782,7 @@ const Wn = ({
|
|
|
782
782
|
children: [
|
|
783
783
|
(i.needsInput.length > 0 || i.failed.length > 0 || i.tasks.length > 0) && /* @__PURE__ */ a("p", { className: "agent-workspace__task-group-label", children: "Completed" }),
|
|
784
784
|
/* @__PURE__ */ a(
|
|
785
|
-
|
|
785
|
+
Xe,
|
|
786
786
|
{
|
|
787
787
|
items: i.complete,
|
|
788
788
|
ariaLabel: "Completed tasks",
|
|
@@ -802,7 +802,7 @@ const Wn = ({
|
|
|
802
802
|
children: [
|
|
803
803
|
(i.needsInput.length > 0 || i.complete.length > 0 || i.tasks.length > 0) && /* @__PURE__ */ a("p", { className: "agent-workspace__task-group-label", children: "Failed" }),
|
|
804
804
|
/* @__PURE__ */ a(
|
|
805
|
-
|
|
805
|
+
Xe,
|
|
806
806
|
{
|
|
807
807
|
items: i.failed,
|
|
808
808
|
ariaLabel: "Failed tasks",
|
|
@@ -822,7 +822,7 @@ const Wn = ({
|
|
|
822
822
|
children: [
|
|
823
823
|
(i.needsInput.length > 0 || i.complete.length > 0 || i.failed.length > 0) && /* @__PURE__ */ a("p", { className: "agent-workspace__task-group-label", children: "Working on" }),
|
|
824
824
|
/* @__PURE__ */ a(
|
|
825
|
-
|
|
825
|
+
Xe,
|
|
826
826
|
{
|
|
827
827
|
items: i.tasks,
|
|
828
828
|
ariaLabel: "Agent tasks",
|
|
@@ -839,7 +839,7 @@ const Wn = ({
|
|
|
839
839
|
]
|
|
840
840
|
}
|
|
841
841
|
);
|
|
842
|
-
},
|
|
842
|
+
}, Qn = ({
|
|
843
843
|
resource: e,
|
|
844
844
|
html: t,
|
|
845
845
|
isLoading: n,
|
|
@@ -849,17 +849,17 @@ const Wn = ({
|
|
|
849
849
|
H(() => {
|
|
850
850
|
if (!e)
|
|
851
851
|
return;
|
|
852
|
-
const i =
|
|
853
|
-
return
|
|
852
|
+
const i = Ye.removeSlideover;
|
|
853
|
+
return Ye.removeSlideover = () => {
|
|
854
854
|
i(), r();
|
|
855
855
|
}, () => {
|
|
856
|
-
|
|
856
|
+
Ye.removeSlideover = i;
|
|
857
857
|
};
|
|
858
858
|
}, [e, r]), H(() => {
|
|
859
859
|
if (!e)
|
|
860
860
|
return;
|
|
861
|
-
const i = (
|
|
862
|
-
|
|
861
|
+
const i = (p) => {
|
|
862
|
+
p.key === "Escape" && Ye.removeSlideover();
|
|
863
863
|
};
|
|
864
864
|
return window.addEventListener("keydown", i), () => window.removeEventListener("keydown", i);
|
|
865
865
|
}, [e]);
|
|
@@ -869,7 +869,7 @@ const Wn = ({
|
|
|
869
869
|
children: /* @__PURE__ */ l("div", { className: "resource-preview-slideover__body", children: [
|
|
870
870
|
n && /* @__PURE__ */ l("div", { className: "resource-preview-slideover__status", children: [
|
|
871
871
|
/* @__PURE__ */ a(
|
|
872
|
-
|
|
872
|
+
U,
|
|
873
873
|
{
|
|
874
874
|
name: "loader",
|
|
875
875
|
size: 16,
|
|
@@ -893,8 +893,8 @@ const Wn = ({
|
|
|
893
893
|
] })
|
|
894
894
|
}
|
|
895
895
|
] : [], [e, t, n, s]);
|
|
896
|
-
return /* @__PURE__ */ a("div", { className: "resource-preview-slideover", children: /* @__PURE__ */ a(
|
|
897
|
-
},
|
|
896
|
+
return /* @__PURE__ */ a("div", { className: "resource-preview-slideover", children: /* @__PURE__ */ a(vn, { slideovers: o }) });
|
|
897
|
+
}, ea = {
|
|
898
898
|
[he.mis_record]: {
|
|
899
899
|
icon: "table",
|
|
900
900
|
label: "Arbor MIS",
|
|
@@ -925,7 +925,7 @@ const Wn = ({
|
|
|
925
925
|
label: "Link",
|
|
926
926
|
color: "var(--color-semantic-info-700)"
|
|
927
927
|
}
|
|
928
|
-
},
|
|
928
|
+
}, ta = ({
|
|
929
929
|
resources: e,
|
|
930
930
|
isLoading: t = !1,
|
|
931
931
|
error: n = null,
|
|
@@ -937,13 +937,13 @@ const Wn = ({
|
|
|
937
937
|
"aria-label": "Resources",
|
|
938
938
|
children: [
|
|
939
939
|
/* @__PURE__ */ l("div", { className: "agent-workspace__panel-header", children: [
|
|
940
|
-
/* @__PURE__ */ a(
|
|
940
|
+
/* @__PURE__ */ a(be, { level: 4, children: "Resources" }),
|
|
941
941
|
/* @__PURE__ */ a("span", { className: "agent-workspace__panel-count", children: e.length })
|
|
942
942
|
] }),
|
|
943
943
|
/* @__PURE__ */ a("div", { className: "agent-workspace__panel-body", "aria-live": "polite", children: /* @__PURE__ */ l(tt, { children: [
|
|
944
944
|
t && /* @__PURE__ */ l("div", { className: "agent-workspace__loading", children: [
|
|
945
945
|
/* @__PURE__ */ a(
|
|
946
|
-
|
|
946
|
+
U,
|
|
947
947
|
{
|
|
948
948
|
name: "loader",
|
|
949
949
|
size: 16,
|
|
@@ -956,7 +956,7 @@ const Wn = ({
|
|
|
956
956
|
] }),
|
|
957
957
|
!t && n && /* @__PURE__ */ a("p", { className: "agent-workspace__error", role: "alert", children: n }),
|
|
958
958
|
!t && !n && e.length > 0 && /* @__PURE__ */ a("ul", { className: "agent-workspace__resource-list", "aria-label": "Agent resources", children: e.map((r) => {
|
|
959
|
-
const o =
|
|
959
|
+
const o = ea[r.type], i = r.misRecordUrl;
|
|
960
960
|
return /* @__PURE__ */ a("li", { className: "agent-workspace__resource", children: i ? /* @__PURE__ */ a(
|
|
961
961
|
"a",
|
|
962
962
|
{
|
|
@@ -964,10 +964,10 @@ const Wn = ({
|
|
|
964
964
|
href: i,
|
|
965
965
|
target: "_blank",
|
|
966
966
|
rel: "noreferrer",
|
|
967
|
-
onClick: (
|
|
968
|
-
|
|
967
|
+
onClick: (p) => {
|
|
968
|
+
p.preventDefault(), s(r);
|
|
969
969
|
},
|
|
970
|
-
children: /* @__PURE__ */ a(
|
|
970
|
+
children: /* @__PURE__ */ a(Lt, { resource: r, config: o, external: !0 })
|
|
971
971
|
}
|
|
972
972
|
) : /* @__PURE__ */ a(
|
|
973
973
|
"button",
|
|
@@ -975,7 +975,7 @@ const Wn = ({
|
|
|
975
975
|
type: "button",
|
|
976
976
|
className: "agent-workspace__resource-card",
|
|
977
977
|
onClick: () => s(r),
|
|
978
|
-
children: /* @__PURE__ */ a(
|
|
978
|
+
children: /* @__PURE__ */ a(Lt, { resource: r, config: o })
|
|
979
979
|
}
|
|
980
980
|
) }, r.id);
|
|
981
981
|
}) }),
|
|
@@ -983,12 +983,12 @@ const Wn = ({
|
|
|
983
983
|
] }) })
|
|
984
984
|
]
|
|
985
985
|
}
|
|
986
|
-
),
|
|
986
|
+
), Lt = ({ resource: e, config: t, external: n = !1 }) => /* @__PURE__ */ l(fe, { children: [
|
|
987
987
|
/* @__PURE__ */ a(
|
|
988
988
|
"span",
|
|
989
989
|
{
|
|
990
990
|
className: `agent-workspace__resource-icon agent-workspace__resource-icon--${e.type}`,
|
|
991
|
-
children: /* @__PURE__ */ a(
|
|
991
|
+
children: /* @__PURE__ */ a(U, { name: t.icon, size: 16, color: t.color, screenReaderText: `${t.label}:` })
|
|
992
992
|
}
|
|
993
993
|
),
|
|
994
994
|
/* @__PURE__ */ a("span", { className: "agent-workspace__resource-content", children: /* @__PURE__ */ l("span", { className: "agent-workspace__resource-top", children: [
|
|
@@ -996,7 +996,7 @@ const Wn = ({
|
|
|
996
996
|
/* @__PURE__ */ a("span", { className: `agent-workspace__resource-badge agent-workspace__resource-badge--${e.type}`, children: t.label })
|
|
997
997
|
] }) }),
|
|
998
998
|
n && /* @__PURE__ */ a(
|
|
999
|
-
|
|
999
|
+
U,
|
|
1000
1000
|
{
|
|
1001
1001
|
name: "external-link",
|
|
1002
1002
|
size: 12,
|
|
@@ -1005,10 +1005,10 @@ const Wn = ({
|
|
|
1005
1005
|
className: "agent-workspace__resource-open"
|
|
1006
1006
|
}
|
|
1007
1007
|
)
|
|
1008
|
-
] }),
|
|
1008
|
+
] }), Ut = (e) => {
|
|
1009
1009
|
const t = Date.parse(e);
|
|
1010
1010
|
return Number.isFinite(t) ? t : 0;
|
|
1011
|
-
},
|
|
1011
|
+
}, na = new Intl.DateTimeFormat("en-GB", {
|
|
1012
1012
|
day: "numeric",
|
|
1013
1013
|
month: "long",
|
|
1014
1014
|
year: "numeric",
|
|
@@ -1016,46 +1016,46 @@ const Wn = ({
|
|
|
1016
1016
|
minute: "2-digit"
|
|
1017
1017
|
}), ut = (e) => {
|
|
1018
1018
|
const t = new Date(e);
|
|
1019
|
-
return Number.isFinite(t.getTime()) ?
|
|
1020
|
-
},
|
|
1019
|
+
return Number.isFinite(t.getTime()) ? na.format(t) : e;
|
|
1020
|
+
}, Pt = (e) => e.replace(
|
|
1021
1021
|
/[A-Za-z0-9]+(?:[_-][A-Za-z0-9]+)+/g,
|
|
1022
1022
|
(t) => t.split(/[_-]/).map((n) => n.charAt(0).toUpperCase() + n.slice(1).toLowerCase()).join(" ")
|
|
1023
|
-
),
|
|
1023
|
+
), xt = (e) => {
|
|
1024
1024
|
const n = e.replace(
|
|
1025
1025
|
/[A-Za-z0-9]+(?:[_-][A-Za-z0-9]+)+/g,
|
|
1026
1026
|
(s) => s.split(/[_-]/).map((r) => r.toLowerCase()).join(" ")
|
|
1027
1027
|
).toLowerCase();
|
|
1028
1028
|
return n && n.charAt(0).toUpperCase() + n.slice(1);
|
|
1029
|
-
},
|
|
1030
|
-
const n = e.filter(
|
|
1029
|
+
}, aa = 60 * 60 * 1e3, Xt = 60 * 60 * 1e3, Me = 24 * Xt, mt = 7 * Me, sa = (e) => e.type !== "message-sent", ra = (e, t) => {
|
|
1030
|
+
const n = e.filter(sa).map((r, o) => ({
|
|
1031
1031
|
kind: "action",
|
|
1032
1032
|
id: `action-${r.timestamp}-${o}`,
|
|
1033
|
-
timestampMs:
|
|
1033
|
+
timestampMs: Ut(r.timestamp),
|
|
1034
1034
|
item: r
|
|
1035
1035
|
})), s = t.map((r) => ({
|
|
1036
1036
|
kind: "chat",
|
|
1037
1037
|
id: r.sessionId,
|
|
1038
|
-
timestampMs:
|
|
1038
|
+
timestampMs: Ut(r.timestamp),
|
|
1039
1039
|
session: r
|
|
1040
1040
|
}));
|
|
1041
1041
|
return [...n, ...s].sort(
|
|
1042
1042
|
(r, o) => r.timestampMs - o.timestampMs || r.id.localeCompare(o.id)
|
|
1043
1043
|
);
|
|
1044
|
-
},
|
|
1045
|
-
if (e <
|
|
1046
|
-
const s = Math.max(1, Math.round(e /
|
|
1044
|
+
}, ia = (e) => e >= mt ? "weeks" : e >= Me ? "days" : "hours", oa = (e) => {
|
|
1045
|
+
if (e < Me) {
|
|
1046
|
+
const s = Math.max(1, Math.round(e / Xt));
|
|
1047
1047
|
return s === 1 ? "1 hour later" : `${s} hours later`;
|
|
1048
1048
|
}
|
|
1049
1049
|
if (e < mt) {
|
|
1050
|
-
const s = Math.max(1, Math.round(e /
|
|
1050
|
+
const s = Math.max(1, Math.round(e / Me));
|
|
1051
1051
|
return s === 1 ? "1 day later" : `${s} days later`;
|
|
1052
1052
|
}
|
|
1053
1053
|
const t = Math.max(1, Math.round(e / mt));
|
|
1054
1054
|
if (t < 5)
|
|
1055
1055
|
return t === 1 ? "1 week later" : `${t} weeks later`;
|
|
1056
|
-
const n = Math.max(1, Math.round(e / (30 *
|
|
1056
|
+
const n = Math.max(1, Math.round(e / (30 * Me)));
|
|
1057
1057
|
return n === 1 ? "1 month later" : `${n} months later`;
|
|
1058
|
-
},
|
|
1058
|
+
}, la = (e, t = aa) => {
|
|
1059
1059
|
if (e.length === 0)
|
|
1060
1060
|
return [];
|
|
1061
1061
|
const n = [e[0]];
|
|
@@ -1065,36 +1065,36 @@ const Wn = ({
|
|
|
1065
1065
|
kind: "gap",
|
|
1066
1066
|
id: `gap-${r.id}-${o.id}`,
|
|
1067
1067
|
durationMs: i,
|
|
1068
|
-
label:
|
|
1069
|
-
size:
|
|
1068
|
+
label: oa(i),
|
|
1069
|
+
size: ia(i)
|
|
1070
1070
|
}), n.push(o);
|
|
1071
1071
|
}
|
|
1072
1072
|
return n;
|
|
1073
|
-
},
|
|
1073
|
+
}, ca = (e) => e.type === "checklist-updated" ? "checklist" : e.type === "status-transition" ? "status" : "note", da = ({
|
|
1074
1074
|
timeline: e,
|
|
1075
1075
|
isLoading: t,
|
|
1076
1076
|
error: n,
|
|
1077
1077
|
onOpenChatSession: s
|
|
1078
1078
|
}) => {
|
|
1079
|
-
const r = (e == null ? void 0 : e.actionLog) ?? [], o = (e == null ? void 0 : e.chatSessions) ?? [], i =
|
|
1079
|
+
const r = (e == null ? void 0 : e.actionLog) ?? [], o = (e == null ? void 0 : e.chatSessions) ?? [], i = ra(r, o), p = la(i), c = !t && !n && i.length === 0;
|
|
1080
1080
|
return /* @__PURE__ */ l("section", { className: "agent-workspace__timeline", "aria-label": "Agent timeline", children: [
|
|
1081
1081
|
t && /* @__PURE__ */ a("p", { className: "agent-workspace__timeline-status", role: "status", children: "Loading timeline…" }),
|
|
1082
|
-
n && /* @__PURE__ */ a("p", { className: "agent-workspace__timeline-status", role: "alert", children: n ||
|
|
1082
|
+
n && /* @__PURE__ */ a("p", { className: "agent-workspace__timeline-status", role: "alert", children: n || Wt }),
|
|
1083
1083
|
c && /* @__PURE__ */ a("p", { className: "agent-workspace__timeline-status", role: "status", children: "No timeline activity yet." }),
|
|
1084
1084
|
!t && !n && !c && /* @__PURE__ */ l("div", { className: "agent-timeline", children: [
|
|
1085
1085
|
/* @__PURE__ */ a("div", { className: "agent-timeline__track", "aria-hidden": "true" }),
|
|
1086
1086
|
/* @__PURE__ */ l("div", { className: "agent-timeline__station agent-timeline__station--terminus", children: [
|
|
1087
|
-
/* @__PURE__ */ a(
|
|
1087
|
+
/* @__PURE__ */ a("span", { className: "agent-timeline__station-rail", children: /* @__PURE__ */ a(
|
|
1088
1088
|
"span",
|
|
1089
1089
|
{
|
|
1090
1090
|
className: "agent-timeline__station-node agent-timeline__station-node--terminus",
|
|
1091
1091
|
"aria-hidden": "true",
|
|
1092
|
-
children: /* @__PURE__ */ a(
|
|
1092
|
+
children: /* @__PURE__ */ a(U, { name: "arrow-right-from-line", size: 16, color: "currentColor" })
|
|
1093
1093
|
}
|
|
1094
|
-
),
|
|
1094
|
+
) }),
|
|
1095
1095
|
/* @__PURE__ */ a("div", { className: "agent-timeline__label", children: /* @__PURE__ */ a("strong", { className: "agent-timeline__label-type", children: "Start" }) })
|
|
1096
1096
|
] }),
|
|
1097
|
-
|
|
1097
|
+
p.map((g) => {
|
|
1098
1098
|
if (g.kind === "gap")
|
|
1099
1099
|
return /* @__PURE__ */ l(
|
|
1100
1100
|
"div",
|
|
@@ -1120,7 +1120,7 @@ const Wn = ({
|
|
|
1120
1120
|
g.session.timestamp
|
|
1121
1121
|
)}`,
|
|
1122
1122
|
onClick: () => s(g.session.sessionId),
|
|
1123
|
-
children: /* @__PURE__ */ a(
|
|
1123
|
+
children: /* @__PURE__ */ a(U, { name: "sparkles", size: 16, color: "currentColor" })
|
|
1124
1124
|
}
|
|
1125
1125
|
),
|
|
1126
1126
|
/* @__PURE__ */ l("div", { className: "agent-timeline__label", children: [
|
|
@@ -1128,28 +1128,28 @@ const Wn = ({
|
|
|
1128
1128
|
/* @__PURE__ */ a("span", { className: "agent-timeline__label-time", children: ut(g.session.timestamp) })
|
|
1129
1129
|
] })
|
|
1130
1130
|
] }, g.id);
|
|
1131
|
-
const { item:
|
|
1131
|
+
const { item: m } = g, N = ca(m), y = N === "checklist", I = N === "status";
|
|
1132
1132
|
return /* @__PURE__ */ l(
|
|
1133
1133
|
"div",
|
|
1134
1134
|
{
|
|
1135
1135
|
className: `agent-timeline__station agent-timeline__station--${N}`,
|
|
1136
1136
|
children: [
|
|
1137
|
-
/* @__PURE__ */ l(
|
|
1137
|
+
/* @__PURE__ */ a("span", { className: "agent-timeline__station-rail", children: /* @__PURE__ */ l(
|
|
1138
1138
|
"button",
|
|
1139
1139
|
{
|
|
1140
1140
|
type: "button",
|
|
1141
1141
|
className: `agent-timeline__station-node agent-timeline__station-node--${N}`,
|
|
1142
|
-
"aria-label": `${
|
|
1142
|
+
"aria-label": `${Pt(m.type)}: ${xt(m.entry)}`,
|
|
1143
1143
|
children: [
|
|
1144
|
-
y && /* @__PURE__ */ a(
|
|
1145
|
-
I && /* @__PURE__ */ a(
|
|
1144
|
+
y && /* @__PURE__ */ a(U, { name: "check-solid", size: 16, color: "currentColor" }),
|
|
1145
|
+
I && /* @__PURE__ */ a(U, { name: "iteration-ccw", size: 16, color: "currentColor" })
|
|
1146
1146
|
]
|
|
1147
1147
|
}
|
|
1148
|
-
),
|
|
1148
|
+
) }),
|
|
1149
1149
|
/* @__PURE__ */ l("div", { className: "agent-timeline__label", children: [
|
|
1150
|
-
/* @__PURE__ */ a("strong", { className: "agent-timeline__label-type", children:
|
|
1151
|
-
/* @__PURE__ */ a("span", { className: "agent-timeline__label-entry", children:
|
|
1152
|
-
/* @__PURE__ */ a("span", { className: "agent-timeline__label-time", children: ut(
|
|
1150
|
+
/* @__PURE__ */ a("strong", { className: "agent-timeline__label-type", children: Pt(m.type) }),
|
|
1151
|
+
/* @__PURE__ */ a("span", { className: "agent-timeline__label-entry", children: xt(m.entry) }),
|
|
1152
|
+
/* @__PURE__ */ a("span", { className: "agent-timeline__label-time", children: ut(m.timestamp) })
|
|
1153
1153
|
] })
|
|
1154
1154
|
]
|
|
1155
1155
|
},
|
|
@@ -1157,93 +1157,88 @@ const Wn = ({
|
|
|
1157
1157
|
);
|
|
1158
1158
|
}),
|
|
1159
1159
|
/* @__PURE__ */ l("div", { className: "agent-timeline__station agent-timeline__station--terminus", children: [
|
|
1160
|
-
/* @__PURE__ */ a(
|
|
1160
|
+
/* @__PURE__ */ a("span", { className: "agent-timeline__station-rail", children: /* @__PURE__ */ a(
|
|
1161
1161
|
"span",
|
|
1162
1162
|
{
|
|
1163
1163
|
className: "agent-timeline__station-node agent-timeline__station-node--terminus",
|
|
1164
1164
|
"aria-hidden": "true",
|
|
1165
|
-
children: /* @__PURE__ */ a(
|
|
1165
|
+
children: /* @__PURE__ */ a(U, { name: "flag", size: 16, color: "currentColor" })
|
|
1166
1166
|
}
|
|
1167
|
-
),
|
|
1167
|
+
) }),
|
|
1168
1168
|
/* @__PURE__ */ a("div", { className: "agent-timeline__label", children: /* @__PURE__ */ a("strong", { className: "agent-timeline__label-type", children: "Finish" }) })
|
|
1169
1169
|
] })
|
|
1170
1170
|
] })
|
|
1171
1171
|
] });
|
|
1172
|
-
},
|
|
1172
|
+
}, ga = [
|
|
1173
1173
|
"I'll get the details and come back to you",
|
|
1174
1174
|
"Skip this for now"
|
|
1175
|
-
],
|
|
1175
|
+
], ha = (e) => {
|
|
1176
1176
|
var n;
|
|
1177
1177
|
const t = (n = e.prompt) != null && n.trim() ? e.prompt.trim() : `I need a bit more from you on "${e.task}". ${e.description} What can you tell me?`;
|
|
1178
1178
|
return {
|
|
1179
1179
|
id: `clarification-${Date.now()}`,
|
|
1180
1180
|
author: ne.agent,
|
|
1181
1181
|
text: t,
|
|
1182
|
-
followUpPrompts: e.clarificationPrompts ??
|
|
1182
|
+
followUpPrompts: e.clarificationPrompts ?? ga
|
|
1183
1183
|
};
|
|
1184
1184
|
}, Ae = (e) => ({
|
|
1185
1185
|
id: e.id,
|
|
1186
1186
|
text: e.text,
|
|
1187
|
-
type: e.author === ne.user ?
|
|
1187
|
+
type: e.author === ne.user ? Sn : e.author === ne.system ? bn : Jt,
|
|
1188
1188
|
...e.followUpPrompts ? { followUpPrompts: e.followUpPrompts } : {}
|
|
1189
|
-
}),
|
|
1189
|
+
}), Dt = "MESSAGE_TYPE_REPOLL", ua = "agentUi:update", Zt = "arbor-agent-", ve = {
|
|
1190
1190
|
all: "ALL",
|
|
1191
1191
|
checklist: "CHECKLIST",
|
|
1192
1192
|
resources: "RESOURCES",
|
|
1193
1193
|
chat: "CHAT",
|
|
1194
1194
|
timeline: "TIMELINE"
|
|
1195
|
-
},
|
|
1195
|
+
}, pa = new Set(Object.values(ve)), ma = (e, t) => `${e.endsWith("-") ? e : `${e}-`}${t}`, _a = (e) => typeof e == "string" && pa.has(e) ? e : ve.all, fa = (e) => {
|
|
1196
1196
|
if (!e || typeof e != "object")
|
|
1197
1197
|
return null;
|
|
1198
1198
|
const t = e;
|
|
1199
|
-
return t.type !==
|
|
1200
|
-
type:
|
|
1201
|
-
target:
|
|
1199
|
+
return t.type !== Dt ? null : {
|
|
1200
|
+
type: Dt,
|
|
1201
|
+
target: _a(t.target)
|
|
1202
1202
|
};
|
|
1203
|
-
},
|
|
1203
|
+
}, va = (e) => {
|
|
1204
1204
|
const t = Array.isArray(e) ? e : [e], n = [];
|
|
1205
1205
|
for (const s of t) {
|
|
1206
|
-
const r =
|
|
1206
|
+
const r = fa(s);
|
|
1207
1207
|
r && n.push(r);
|
|
1208
1208
|
}
|
|
1209
1209
|
return n;
|
|
1210
|
-
},
|
|
1210
|
+
}, wa = ({
|
|
1211
1211
|
enabled: e,
|
|
1212
1212
|
channelPrefix: t,
|
|
1213
1213
|
agentId: n,
|
|
1214
1214
|
subscribeToPusher: s,
|
|
1215
1215
|
onRepoll: r
|
|
1216
1216
|
}) => {
|
|
1217
|
-
const o = le(r);
|
|
1218
|
-
H(() => {
|
|
1217
|
+
const o = le(r), i = t == null ? void 0 : t.trim(), p = !!(e && s && i && n.trim());
|
|
1218
|
+
return H(() => {
|
|
1219
1219
|
o.current = r;
|
|
1220
1220
|
}, [r]), H(() => {
|
|
1221
|
-
if (!
|
|
1221
|
+
if (!p || !s || !i)
|
|
1222
1222
|
return;
|
|
1223
|
-
const
|
|
1224
|
-
i,
|
|
1225
|
-
|
|
1226
|
-
(
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
event: Lt,
|
|
1230
|
-
payload: c
|
|
1231
|
-
});
|
|
1232
|
-
for (const g of ua(c))
|
|
1233
|
-
o.current(g.target);
|
|
1223
|
+
const c = s(
|
|
1224
|
+
ma(i, n),
|
|
1225
|
+
ua,
|
|
1226
|
+
(g) => {
|
|
1227
|
+
for (const m of va(g))
|
|
1228
|
+
o.current(m.target);
|
|
1234
1229
|
}
|
|
1235
1230
|
);
|
|
1236
1231
|
return () => {
|
|
1237
|
-
|
|
1232
|
+
c();
|
|
1238
1233
|
};
|
|
1239
|
-
}, [
|
|
1234
|
+
}, [p, i, n, s]), p;
|
|
1240
1235
|
};
|
|
1241
1236
|
class $e extends Error {
|
|
1242
1237
|
constructor(t, n, s) {
|
|
1243
1238
|
super(s ?? `Agent service request failed (${t})`), this.name = "AgentServiceError", this.status = t, this.detail = n;
|
|
1244
1239
|
}
|
|
1245
1240
|
}
|
|
1246
|
-
const
|
|
1241
|
+
const ya = "/api/v1", F = {
|
|
1247
1242
|
agentDefinitions: "/agent-definitions",
|
|
1248
1243
|
agents: "/agents",
|
|
1249
1244
|
conversations: "/conversations",
|
|
@@ -1252,9 +1247,9 @@ const ma = "/api/v1", F = {
|
|
|
1252
1247
|
}, J = {
|
|
1253
1248
|
GET: "GET",
|
|
1254
1249
|
POST: "POST"
|
|
1255
|
-
},
|
|
1250
|
+
}, ka = {
|
|
1256
1251
|
error: "error"
|
|
1257
|
-
},
|
|
1252
|
+
}, Na = {
|
|
1258
1253
|
user: "user"
|
|
1259
1254
|
}, we = {
|
|
1260
1255
|
acceptJson: "application/json",
|
|
@@ -1262,11 +1257,11 @@ const ma = "/api/v1", F = {
|
|
|
1262
1257
|
acceptEventStream: "text/event-stream",
|
|
1263
1258
|
contentTypeJson: "application/json",
|
|
1264
1259
|
arborApplicationUrl: "X-Arbor-Application-Url"
|
|
1265
|
-
},
|
|
1260
|
+
}, Aa = 100, Sa = (e) => {
|
|
1266
1261
|
switch (e) {
|
|
1267
|
-
case
|
|
1262
|
+
case Rt.cancelled:
|
|
1268
1263
|
return E.failed;
|
|
1269
|
-
case
|
|
1264
|
+
case Rt.archived:
|
|
1270
1265
|
return E.complete;
|
|
1271
1266
|
case E.hitl:
|
|
1272
1267
|
case E.complete:
|
|
@@ -1276,43 +1271,43 @@ const ma = "/api/v1", F = {
|
|
|
1276
1271
|
default:
|
|
1277
1272
|
return E["generating-a-response"];
|
|
1278
1273
|
}
|
|
1279
|
-
},
|
|
1274
|
+
}, ba = (e) => {
|
|
1280
1275
|
switch (e) {
|
|
1281
1276
|
case gt.requires_attention:
|
|
1282
|
-
return
|
|
1277
|
+
return M.hitl;
|
|
1283
1278
|
case gt.in_progress:
|
|
1284
1279
|
case gt.available:
|
|
1285
|
-
return
|
|
1286
|
-
case
|
|
1287
|
-
case
|
|
1288
|
-
case
|
|
1289
|
-
case
|
|
1280
|
+
return M["generating-a-response"];
|
|
1281
|
+
case M.failed:
|
|
1282
|
+
case M.complete:
|
|
1283
|
+
case M.hitl:
|
|
1284
|
+
case M["generating-a-response"]:
|
|
1290
1285
|
return e;
|
|
1291
1286
|
default:
|
|
1292
|
-
return
|
|
1287
|
+
return M["generating-a-response"];
|
|
1293
1288
|
}
|
|
1294
|
-
},
|
|
1289
|
+
}, Qt = (e) => ({
|
|
1295
1290
|
ref: e.name,
|
|
1296
1291
|
display_name: e.display_name,
|
|
1297
1292
|
agent_intent: e.agent_intent ?? "",
|
|
1298
1293
|
description: e.description
|
|
1299
|
-
}),
|
|
1294
|
+
}), _s = (e) => ({
|
|
1300
1295
|
id: e.id,
|
|
1301
1296
|
name: e.name,
|
|
1302
1297
|
...e.has_run_before ? { hasRunBefore: e.has_run_before } : {}
|
|
1303
|
-
}),
|
|
1298
|
+
}), Ca = new Set(Object.values(he)), Ea = (e) => Ca.has(e) ? e : he.document_html, Ta = (e) => ({
|
|
1304
1299
|
id: e.id,
|
|
1305
|
-
type:
|
|
1300
|
+
type: Ea(e.type),
|
|
1306
1301
|
title: e.title,
|
|
1307
1302
|
createdDatetime: e.created_datetime,
|
|
1308
1303
|
lastUpdatedDatetime: e.last_updated_datetime,
|
|
1309
1304
|
misRecordUrl: e.mis_record_url
|
|
1310
|
-
}),
|
|
1311
|
-
resources: e.resources.map(
|
|
1305
|
+
}), Ra = (e) => ({
|
|
1306
|
+
resources: e.resources.map(Ta),
|
|
1312
1307
|
pageNumber: e.page_number,
|
|
1313
1308
|
pageSize: e.page_size,
|
|
1314
1309
|
totalRecords: e.total_records
|
|
1315
|
-
}),
|
|
1310
|
+
}), Ia = (e) => ({
|
|
1316
1311
|
actionLog: (e.action_log ?? []).map((t) => ({
|
|
1317
1312
|
timestamp: t.timestamp,
|
|
1318
1313
|
type: t.type,
|
|
@@ -1323,7 +1318,7 @@ const ma = "/api/v1", F = {
|
|
|
1323
1318
|
sessionId: t.session_id,
|
|
1324
1319
|
timestamp: t.timestamp
|
|
1325
1320
|
}))
|
|
1326
|
-
}),
|
|
1321
|
+
}), $t = (e) => {
|
|
1327
1322
|
var n;
|
|
1328
1323
|
const t = e.invocation_id ?? e.id;
|
|
1329
1324
|
return {
|
|
@@ -1335,32 +1330,32 @@ const ma = "/api/v1", F = {
|
|
|
1335
1330
|
application_id: e.application_id,
|
|
1336
1331
|
...e.application_name ? { application_name: e.application_name } : {},
|
|
1337
1332
|
created_by: e.created_by,
|
|
1338
|
-
status:
|
|
1333
|
+
status: Sa(e.status),
|
|
1339
1334
|
context_ref: e.context_ref ?? null,
|
|
1340
1335
|
checklist_ref: e.checklist_ref ?? null
|
|
1341
1336
|
};
|
|
1342
|
-
},
|
|
1337
|
+
}, en = (e) => {
|
|
1343
1338
|
var t;
|
|
1344
1339
|
return {
|
|
1345
|
-
task: e.item ?? e.task ?? e.name ?? e.label ??
|
|
1346
|
-
status:
|
|
1340
|
+
task: e.item ?? e.task ?? e.name ?? e.label ?? xn,
|
|
1341
|
+
status: ba(e.status),
|
|
1347
1342
|
description: e.description ?? "",
|
|
1348
1343
|
...e.prompt ? { prompt: e.prompt } : {},
|
|
1349
1344
|
...(t = e.follow_up_prompts) != null && t.length ? { clarificationPrompts: e.follow_up_prompts } : {}
|
|
1350
1345
|
};
|
|
1351
|
-
},
|
|
1346
|
+
}, Oa = (e) => Array.isArray(e) ? e : e.checklist_items ?? e.checklist ?? e.items ?? [], tn = (e, t, n) => {
|
|
1352
1347
|
var o;
|
|
1353
1348
|
const s = !Array.isArray(t) && (t.opening_message || (o = t.opening_follow_up_prompts) != null && o.length) ? t : n, r = s ? nt(s) : void 0;
|
|
1354
1349
|
return {
|
|
1355
1350
|
invocation_id: e,
|
|
1356
|
-
checklist:
|
|
1351
|
+
checklist: Oa(t).map(en),
|
|
1357
1352
|
...r ? { openingMessage: r } : {}
|
|
1358
1353
|
};
|
|
1359
|
-
},
|
|
1354
|
+
}, La = (e, t) => {
|
|
1360
1355
|
const n = nt(t);
|
|
1361
1356
|
return {
|
|
1362
1357
|
invocation_id: t.invocation_id ?? e,
|
|
1363
|
-
checklist: (t.checklist_items ?? []).map(
|
|
1358
|
+
checklist: (t.checklist_items ?? []).map(en),
|
|
1364
1359
|
...n ? { openingMessage: n } : {}
|
|
1365
1360
|
};
|
|
1366
1361
|
}, nt = (e) => {
|
|
@@ -1368,12 +1363,12 @@ const ma = "/api/v1", F = {
|
|
|
1368
1363
|
const t = (n = e.opening_message) == null ? void 0 : n.trim();
|
|
1369
1364
|
if (t)
|
|
1370
1365
|
return {
|
|
1371
|
-
id:
|
|
1366
|
+
id: Kt,
|
|
1372
1367
|
author: ne.agent,
|
|
1373
1368
|
text: t,
|
|
1374
1369
|
...(s = e.opening_follow_up_prompts) != null && s.length ? { followUpPrompts: e.opening_follow_up_prompts } : {}
|
|
1375
1370
|
};
|
|
1376
|
-
},
|
|
1371
|
+
}, Ua = (e) => {
|
|
1377
1372
|
try {
|
|
1378
1373
|
const t = JSON.parse(e);
|
|
1379
1374
|
if (Array.isArray(t)) {
|
|
@@ -1387,19 +1382,19 @@ const ma = "/api/v1", F = {
|
|
|
1387
1382
|
} catch {
|
|
1388
1383
|
}
|
|
1389
1384
|
return e;
|
|
1390
|
-
},
|
|
1385
|
+
}, Pa = (e) => {
|
|
1391
1386
|
const t = e.trim();
|
|
1392
1387
|
return t.length > 0 ? `File upload
|
|
1393
1388
|
|
|
1394
1389
|
${t}` : "File upload";
|
|
1395
|
-
},
|
|
1390
|
+
}, xa = (e) => e.filter((t) => t.message_type === "user_file" && t.role === "user" ? !0 : (t.role === "user" || t.role === "assistant") && typeof t.content == "string" && t.content.length > 0 && t.message_type !== "tool_request").map((t) => {
|
|
1396
1391
|
if (t.message_type === "user_file") {
|
|
1397
|
-
const n = typeof t.content == "string" ? t.content : "", s =
|
|
1392
|
+
const n = typeof t.content == "string" ? t.content : "", s = Ua(n);
|
|
1398
1393
|
return {
|
|
1399
1394
|
id: t.message_id,
|
|
1400
1395
|
author: ne.user,
|
|
1401
|
-
kind:
|
|
1402
|
-
text:
|
|
1396
|
+
kind: Cn.user_file,
|
|
1397
|
+
text: Pa(s)
|
|
1403
1398
|
};
|
|
1404
1399
|
}
|
|
1405
1400
|
return {
|
|
@@ -1407,13 +1402,13 @@ ${t}` : "File upload";
|
|
|
1407
1402
|
author: t.role === "user" ? ne.user : ne.agent,
|
|
1408
1403
|
text: t.content
|
|
1409
1404
|
};
|
|
1410
|
-
}),
|
|
1405
|
+
}), Da = /:invocationId\b/g, $a = /:resourceId\b/g, Ma = (e) => e.trim().replace(/^Bearer\s+/i, ""), Ha = (e) => e.endsWith("/") ? e.slice(0, -1) : e;
|
|
1411
1406
|
class ft {
|
|
1412
1407
|
constructor(t) {
|
|
1413
1408
|
var s;
|
|
1414
|
-
this.baseUrl =
|
|
1409
|
+
this.baseUrl = Ha(t.baseUrl ?? "");
|
|
1415
1410
|
const n = (s = t.token) == null ? void 0 : s.trim();
|
|
1416
|
-
this.token = n ?
|
|
1411
|
+
this.token = n ? Ma(n) : void 0, this.customHeaders = t.headers, this.urls = t.urls ?? {}, this.fetchImpl = t.fetch ?? globalThis.fetch.bind(globalThis);
|
|
1417
1412
|
}
|
|
1418
1413
|
// Replaces the extra headers merged into every subsequent request,
|
|
1419
1414
|
// without recreating the client (e.g. an application-URL header that
|
|
@@ -1459,10 +1454,10 @@ class ft {
|
|
|
1459
1454
|
);
|
|
1460
1455
|
}
|
|
1461
1456
|
createAgent(t, n = {}) {
|
|
1462
|
-
var i,
|
|
1457
|
+
var i, p;
|
|
1463
1458
|
const s = {
|
|
1464
1459
|
agent_definition_ref: t
|
|
1465
|
-
}, r = (i = n.invocationName) == null ? void 0 : i.trim(), o = (
|
|
1460
|
+
}, r = (i = n.invocationName) == null ? void 0 : i.trim(), o = (p = n.agentIntent) == null ? void 0 : p.trim();
|
|
1466
1461
|
return r && (s.invocation_name = r), o && (s.agent_intent = o), this.request(
|
|
1467
1462
|
J.POST,
|
|
1468
1463
|
this.resolveUrl("agents", F.agents),
|
|
@@ -1499,12 +1494,12 @@ class ft {
|
|
|
1499
1494
|
);
|
|
1500
1495
|
}
|
|
1501
1496
|
async listAllAgentResources(t) {
|
|
1502
|
-
const n =
|
|
1497
|
+
const n = Aa;
|
|
1503
1498
|
let s = 1;
|
|
1504
1499
|
const r = [];
|
|
1505
1500
|
let o = Number.POSITIVE_INFINITY;
|
|
1506
1501
|
for (; r.length < o; ) {
|
|
1507
|
-
const i =
|
|
1502
|
+
const i = Ra(
|
|
1508
1503
|
await this.getAgentResources(t, { pageNumber: s, pageSize: n })
|
|
1509
1504
|
);
|
|
1510
1505
|
if (o = i.totalRecords, i.resources.length === 0 || (r.push(...i.resources), r.length >= o))
|
|
@@ -1576,7 +1571,7 @@ class ft {
|
|
|
1576
1571
|
// Let the browser set the multipart boundary when uploading.
|
|
1577
1572
|
...r ? {} : { "Content-Type": we.contentTypeJson }
|
|
1578
1573
|
},
|
|
1579
|
-
body: r ?
|
|
1574
|
+
body: r ? Ga(n, s.uploadFiles ?? []) : JSON.stringify(n),
|
|
1580
1575
|
signal: s.signal
|
|
1581
1576
|
}
|
|
1582
1577
|
);
|
|
@@ -1591,7 +1586,7 @@ class ft {
|
|
|
1591
1586
|
}
|
|
1592
1587
|
// Builds a URL from the base url + shared API prefix + route.
|
|
1593
1588
|
apiUrl(t) {
|
|
1594
|
-
return `${this.baseUrl}${
|
|
1589
|
+
return `${this.baseUrl}${ya}${t}`;
|
|
1595
1590
|
}
|
|
1596
1591
|
// Resolves the URL for an operation, preferring a per-operation override
|
|
1597
1592
|
// (with `:invocationId` substituted) and falling back to the base url.
|
|
@@ -1600,7 +1595,7 @@ class ft {
|
|
|
1600
1595
|
if (!o)
|
|
1601
1596
|
return this.apiUrl(n);
|
|
1602
1597
|
let i = o;
|
|
1603
|
-
return s && (i = i.replace(
|
|
1598
|
+
return s && (i = i.replace(Da, encodeURIComponent(s))), r && (i = i.replace($a, encodeURIComponent(r))), i;
|
|
1604
1599
|
}
|
|
1605
1600
|
resolveResourceHtmlUrl(t, n) {
|
|
1606
1601
|
return this.urls.agentResourceHtml ? this.resolveUrl(
|
|
@@ -1664,15 +1659,15 @@ class ft {
|
|
|
1664
1659
|
async consumeSse(t, n) {
|
|
1665
1660
|
const s = t.getReader(), r = new TextDecoder();
|
|
1666
1661
|
let o = "", i;
|
|
1667
|
-
const
|
|
1668
|
-
const { event: g, data:
|
|
1669
|
-
if (
|
|
1662
|
+
const p = (c) => {
|
|
1663
|
+
const { event: g, data: m } = za(c);
|
|
1664
|
+
if (m === null)
|
|
1670
1665
|
return;
|
|
1671
|
-
if (g ===
|
|
1672
|
-
const y =
|
|
1666
|
+
if (g === ka.error) {
|
|
1667
|
+
const y = Mt(m);
|
|
1673
1668
|
throw new $e(502, y, (y == null ? void 0 : y.message) ?? "Chat stream error");
|
|
1674
1669
|
}
|
|
1675
|
-
const N =
|
|
1670
|
+
const N = Mt(m);
|
|
1676
1671
|
N && (i = N, n == null || n(N));
|
|
1677
1672
|
};
|
|
1678
1673
|
for (; ; ) {
|
|
@@ -1680,19 +1675,19 @@ class ft {
|
|
|
1680
1675
|
if (c)
|
|
1681
1676
|
break;
|
|
1682
1677
|
o += r.decode(g, { stream: !0 });
|
|
1683
|
-
const
|
|
1678
|
+
const m = o.split(`
|
|
1684
1679
|
|
|
1685
1680
|
`);
|
|
1686
|
-
o =
|
|
1687
|
-
for (const N of
|
|
1688
|
-
|
|
1681
|
+
o = m.pop() ?? "";
|
|
1682
|
+
for (const N of m)
|
|
1683
|
+
p(N);
|
|
1689
1684
|
}
|
|
1690
|
-
if (o.trim() &&
|
|
1685
|
+
if (o.trim() && p(o), !i)
|
|
1691
1686
|
throw new $e(502, null, "Chat stream ended without any events");
|
|
1692
1687
|
return i;
|
|
1693
1688
|
}
|
|
1694
1689
|
}
|
|
1695
|
-
const
|
|
1690
|
+
const za = (e) => {
|
|
1696
1691
|
let t = null;
|
|
1697
1692
|
const n = [];
|
|
1698
1693
|
for (const s of e.split(`
|
|
@@ -1705,43 +1700,43 @@ const xa = (e) => {
|
|
|
1705
1700
|
data: n.length > 0 ? n.join(`
|
|
1706
1701
|
`) : null
|
|
1707
1702
|
};
|
|
1708
|
-
},
|
|
1703
|
+
}, Mt = (e) => {
|
|
1709
1704
|
try {
|
|
1710
1705
|
return JSON.parse(e);
|
|
1711
1706
|
} catch {
|
|
1712
1707
|
return;
|
|
1713
1708
|
}
|
|
1714
1709
|
};
|
|
1715
|
-
function
|
|
1710
|
+
function Ga(e, t) {
|
|
1716
1711
|
const n = new FormData();
|
|
1717
1712
|
n.append("body", JSON.stringify(e));
|
|
1718
1713
|
for (const s of t)
|
|
1719
1714
|
n.append("files", s, s.name);
|
|
1720
1715
|
return n;
|
|
1721
1716
|
}
|
|
1722
|
-
const
|
|
1723
|
-
id:
|
|
1717
|
+
const Fa = {
|
|
1718
|
+
id: Kt,
|
|
1724
1719
|
author: ne.agent,
|
|
1725
1720
|
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."
|
|
1726
1721
|
};
|
|
1727
|
-
let
|
|
1728
|
-
const
|
|
1722
|
+
let Ht = 0;
|
|
1723
|
+
const Ba = (e) => (Ht += 1, `${e}-${Date.now()}-${Ht}`), qa = (e) => {
|
|
1729
1724
|
const t = e.destination ? ` to ${e.destination}` : "";
|
|
1730
1725
|
return `Let's get started on ${e.tripName.trim() || e.destination.trim() || "this task"}${t}. What will you do first?`;
|
|
1731
1726
|
};
|
|
1732
|
-
class
|
|
1727
|
+
class Ja {
|
|
1733
1728
|
constructor(t, n, s = {}) {
|
|
1734
|
-
this.seededChecklist = [], this.client = t, this.agentId = n, this.chatId = s.chatId ?? n, this.opening = s.openingMessage ??
|
|
1729
|
+
this.seededChecklist = [], this.client = t, this.agentId = n, this.chatId = s.chatId ?? n, this.opening = s.openingMessage ?? Fa, this.model = s.model;
|
|
1735
1730
|
}
|
|
1736
1731
|
openingMessage() {
|
|
1737
1732
|
return this.opening;
|
|
1738
1733
|
}
|
|
1739
1734
|
async bootstrapConversation() {
|
|
1740
|
-
const t = await this.client.getConversation(this.chatId), n =
|
|
1735
|
+
const t = await this.client.getConversation(this.chatId), n = xa(t.messages);
|
|
1741
1736
|
return n.length === 0 ? [this.opening] : n;
|
|
1742
1737
|
}
|
|
1743
1738
|
async start(t) {
|
|
1744
|
-
return { ...await this.exchange(
|
|
1739
|
+
return { ...await this.exchange(qa(t)), phase: B.running };
|
|
1745
1740
|
}
|
|
1746
1741
|
sendMessage(t, n) {
|
|
1747
1742
|
return this.exchange(t, n);
|
|
@@ -1754,7 +1749,7 @@ class za {
|
|
|
1754
1749
|
}
|
|
1755
1750
|
async exchange(t, n) {
|
|
1756
1751
|
var i;
|
|
1757
|
-
const s = [{ role:
|
|
1752
|
+
const s = [{ role: Na.user, content: t }], r = await this.client.chat(
|
|
1758
1753
|
this.agentId,
|
|
1759
1754
|
{
|
|
1760
1755
|
messages: s,
|
|
@@ -1768,27 +1763,27 @@ class za {
|
|
|
1768
1763
|
},
|
|
1769
1764
|
...n && n.length > 0 ? [{ uploadFiles: n }] : []
|
|
1770
1765
|
), o = {
|
|
1771
|
-
id: r.event_id ||
|
|
1766
|
+
id: r.event_id || Ba("msg-agent"),
|
|
1772
1767
|
author: ne.agent,
|
|
1773
1768
|
text: r.message.content,
|
|
1774
1769
|
...(i = r.follow_up_prompts) != null && i.length ? { followUpPrompts: r.follow_up_prompts } : {}
|
|
1775
1770
|
};
|
|
1776
1771
|
try {
|
|
1777
|
-
const
|
|
1772
|
+
const p = await this.client.getAgent(this.agentId), { checklist: c } = La(this.agentId, p);
|
|
1778
1773
|
return this.seededChecklist = c, { message: o, checklist: c };
|
|
1779
1774
|
} catch {
|
|
1780
1775
|
return { message: o, ...this.seededChecklist.length ? { checklist: this.seededChecklist } : {} };
|
|
1781
1776
|
}
|
|
1782
1777
|
}
|
|
1783
1778
|
}
|
|
1784
|
-
const
|
|
1779
|
+
const nn = (e, t) => (n) => {
|
|
1785
1780
|
var s, r;
|
|
1786
|
-
return new
|
|
1781
|
+
return new Ja(e, n.invocation_id, {
|
|
1787
1782
|
model: t == null ? void 0 : t.model,
|
|
1788
1783
|
chatId: ((s = t == null ? void 0 : t.resolveChatId) == null ? void 0 : s.call(t, n)) ?? (t == null ? void 0 : t.chatId) ?? n.invocation_id,
|
|
1789
1784
|
openingMessage: ((r = t == null ? void 0 : t.resolveOpeningMessage) == null ? void 0 : r.call(t, n)) ?? (t == null ? void 0 : t.openingMessage)
|
|
1790
1785
|
});
|
|
1791
|
-
},
|
|
1786
|
+
}, an = (e) => e instanceof $e ? e.message : e instanceof TypeError ? "Network error while contacting the agent service." : e instanceof Error && e.message ? e.message : jt, Ka = (e) => {
|
|
1792
1787
|
const t = {};
|
|
1793
1788
|
for (const n of e) {
|
|
1794
1789
|
const s = nt(n);
|
|
@@ -1798,8 +1793,8 @@ const Zt = (e, t) => (n) => {
|
|
|
1798
1793
|
t[r] = s, t[n.id] = s;
|
|
1799
1794
|
}
|
|
1800
1795
|
return t;
|
|
1801
|
-
},
|
|
1802
|
-
const { jwt: t, headers: n, urls: s } = e, r = JSON.stringify(n ?? {}), o =
|
|
1796
|
+
}, Wa = (e) => JSON.stringify(e), pt = (e, t) => JSON.stringify(e) === JSON.stringify(t), ja = (e) => {
|
|
1797
|
+
const { jwt: t, headers: n, urls: s } = e, r = JSON.stringify(n ?? {}), o = Wa(s), i = Y(
|
|
1803
1798
|
() => new ft({
|
|
1804
1799
|
token: t,
|
|
1805
1800
|
headers: n,
|
|
@@ -1808,79 +1803,79 @@ const Zt = (e, t) => (n) => {
|
|
|
1808
1803
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- keyed on serialised config to keep a stable client.
|
|
1809
1804
|
[t, o]
|
|
1810
1805
|
);
|
|
1811
|
-
|
|
1806
|
+
et(() => {
|
|
1812
1807
|
i.setHeaders(n);
|
|
1813
1808
|
}, [i, r]);
|
|
1814
|
-
const [
|
|
1809
|
+
const [p, c] = h([]), [g, m] = h(
|
|
1815
1810
|
[]
|
|
1816
|
-
), [N, y] =
|
|
1817
|
-
(
|
|
1818
|
-
const q =
|
|
1811
|
+
), [N, y] = h({}), [I, O] = h("loading"), [f, K] = h(null), [T, P] = h(0), A = C(
|
|
1812
|
+
(L, G) => {
|
|
1813
|
+
const q = L.map($t), X = G.map(Qt), Z = Ka(L);
|
|
1819
1814
|
c(
|
|
1820
1815
|
(D) => pt(D, q) ? D : q
|
|
1821
|
-
),
|
|
1816
|
+
), m(
|
|
1822
1817
|
(D) => pt(D, X) ? D : X
|
|
1823
1818
|
), y(
|
|
1824
1819
|
(D) => pt(D, Z) ? D : Z
|
|
1825
|
-
),
|
|
1820
|
+
), O("idle"), K(null);
|
|
1826
1821
|
},
|
|
1827
1822
|
[]
|
|
1828
1823
|
);
|
|
1829
1824
|
H(() => {
|
|
1830
|
-
let
|
|
1831
|
-
return
|
|
1825
|
+
let L = !1;
|
|
1826
|
+
return O("loading"), K(null), (async () => {
|
|
1832
1827
|
try {
|
|
1833
1828
|
const [G, q] = await Promise.all([
|
|
1834
1829
|
i.listAgents(),
|
|
1835
1830
|
i.listAgentDefinitions()
|
|
1836
1831
|
]);
|
|
1837
|
-
if (
|
|
1832
|
+
if (L)
|
|
1838
1833
|
return;
|
|
1839
1834
|
A(G, q);
|
|
1840
1835
|
} catch (G) {
|
|
1841
|
-
if (
|
|
1836
|
+
if (L)
|
|
1842
1837
|
return;
|
|
1843
|
-
c([]),
|
|
1838
|
+
c([]), m([]), y({}), O("error"), K(an(G));
|
|
1844
1839
|
}
|
|
1845
1840
|
})(), () => {
|
|
1846
|
-
|
|
1841
|
+
L = !0;
|
|
1847
1842
|
};
|
|
1848
1843
|
}, [A, i, T]);
|
|
1849
|
-
const
|
|
1850
|
-
|
|
1851
|
-
}, []),
|
|
1844
|
+
const _ = C(() => {
|
|
1845
|
+
P((L) => L + 1);
|
|
1846
|
+
}, []), S = C(async () => {
|
|
1852
1847
|
try {
|
|
1853
|
-
const [
|
|
1848
|
+
const [L, G] = await Promise.all([
|
|
1854
1849
|
i.listAgents(),
|
|
1855
1850
|
i.listAgentDefinitions()
|
|
1856
1851
|
]);
|
|
1857
|
-
A(
|
|
1852
|
+
A(L, G);
|
|
1858
1853
|
} catch {
|
|
1859
1854
|
}
|
|
1860
1855
|
}, [A, i]), v = C(
|
|
1861
|
-
async (
|
|
1856
|
+
async (L) => {
|
|
1862
1857
|
const [G, q] = await Promise.all([
|
|
1863
|
-
i.getAgentChecklist(
|
|
1864
|
-
i.getAgent(
|
|
1858
|
+
i.getAgentChecklist(L),
|
|
1859
|
+
i.getAgent(L).catch(() => null)
|
|
1865
1860
|
]);
|
|
1866
|
-
return
|
|
1867
|
-
|
|
1861
|
+
return tn(
|
|
1862
|
+
L,
|
|
1868
1863
|
G,
|
|
1869
1864
|
q ?? void 0
|
|
1870
1865
|
);
|
|
1871
1866
|
},
|
|
1872
1867
|
[i]
|
|
1873
1868
|
), R = C(
|
|
1874
|
-
async (
|
|
1869
|
+
async (L) => i.listAllAgentResources(L),
|
|
1875
1870
|
[i]
|
|
1876
1871
|
), z = C(
|
|
1877
1872
|
async ({
|
|
1878
|
-
definition:
|
|
1873
|
+
definition: L,
|
|
1879
1874
|
invocationName: G
|
|
1880
1875
|
}) => {
|
|
1881
|
-
const q = await i.createAgent(
|
|
1876
|
+
const q = await i.createAgent(L.ref, {
|
|
1882
1877
|
invocationName: G
|
|
1883
|
-
}), X = await i.getAgent(q.id), Z =
|
|
1878
|
+
}), X = await i.getAgent(q.id), Z = $t(X), D = nt(X);
|
|
1884
1879
|
return c((x) => [Z, ...x]), D && y((x) => ({
|
|
1885
1880
|
...x,
|
|
1886
1881
|
[Z.invocation_id]: D,
|
|
@@ -1888,26 +1883,26 @@ const Zt = (e, t) => (n) => {
|
|
|
1888
1883
|
})), Z;
|
|
1889
1884
|
},
|
|
1890
1885
|
[i]
|
|
1891
|
-
),
|
|
1892
|
-
() =>
|
|
1893
|
-
resolveOpeningMessage: (
|
|
1886
|
+
), Ce = Y(
|
|
1887
|
+
() => nn(i, {
|
|
1888
|
+
resolveOpeningMessage: (L) => N[L.invocation_id] ?? N[L.id]
|
|
1894
1889
|
}),
|
|
1895
1890
|
[i, N]
|
|
1896
1891
|
);
|
|
1897
1892
|
return {
|
|
1898
|
-
agents:
|
|
1893
|
+
agents: p,
|
|
1899
1894
|
agentDefinitions: g,
|
|
1900
1895
|
loadState: I,
|
|
1901
1896
|
loadError: f,
|
|
1902
|
-
reload:
|
|
1903
|
-
refresh:
|
|
1897
|
+
reload: _,
|
|
1898
|
+
refresh: S,
|
|
1904
1899
|
fetchAgentChecklist: v,
|
|
1905
1900
|
fetchAgentResources: R,
|
|
1906
1901
|
createAgent: z,
|
|
1907
|
-
chatConnector:
|
|
1902
|
+
chatConnector: Ce
|
|
1908
1903
|
};
|
|
1909
|
-
},
|
|
1910
|
-
const { agent: t, jwt: n, headers: s, urls: r, chatId: o } = e, i = JSON.stringify(s ?? {}),
|
|
1904
|
+
}, Va = (e) => JSON.stringify(e), Ya = (e) => {
|
|
1905
|
+
const { agent: t, jwt: n, headers: s, urls: r, chatId: o } = e, i = JSON.stringify(s ?? {}), p = Va(r), c = Y(
|
|
1911
1906
|
() => new ft({
|
|
1912
1907
|
token: n,
|
|
1913
1908
|
headers: s,
|
|
@@ -1922,40 +1917,40 @@ const Zt = (e, t) => (n) => {
|
|
|
1922
1917
|
}
|
|
1923
1918
|
}),
|
|
1924
1919
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- keyed on serialised config to keep a stable client.
|
|
1925
|
-
[n,
|
|
1920
|
+
[n, p]
|
|
1926
1921
|
);
|
|
1927
|
-
|
|
1922
|
+
et(() => {
|
|
1928
1923
|
c.setHeaders(s);
|
|
1929
1924
|
}, [c, i]);
|
|
1930
1925
|
const g = C(
|
|
1931
|
-
async (
|
|
1926
|
+
async (O) => {
|
|
1932
1927
|
const [f, K] = await Promise.all([
|
|
1933
|
-
c.getAgentChecklist(
|
|
1934
|
-
c.getAgent(
|
|
1928
|
+
c.getAgentChecklist(O),
|
|
1929
|
+
c.getAgent(O).catch(() => null)
|
|
1935
1930
|
]);
|
|
1936
|
-
return
|
|
1937
|
-
|
|
1931
|
+
return tn(
|
|
1932
|
+
O,
|
|
1938
1933
|
f,
|
|
1939
1934
|
K ?? void 0
|
|
1940
1935
|
);
|
|
1941
1936
|
},
|
|
1942
1937
|
[c]
|
|
1943
|
-
),
|
|
1944
|
-
async (
|
|
1938
|
+
), m = C(
|
|
1939
|
+
async (O) => c.listAllAgentResources(O),
|
|
1945
1940
|
[c]
|
|
1946
1941
|
), N = C(
|
|
1947
|
-
async (
|
|
1942
|
+
async (O, f) => c.getAgentResourceHtml(O, f),
|
|
1948
1943
|
[c]
|
|
1949
1944
|
), y = C(
|
|
1950
|
-
async (
|
|
1951
|
-
const f = await c.getAgentTimeline(
|
|
1952
|
-
return
|
|
1945
|
+
async (O) => {
|
|
1946
|
+
const f = await c.getAgentTimeline(O);
|
|
1947
|
+
return Ia(f);
|
|
1953
1948
|
},
|
|
1954
1949
|
[c]
|
|
1955
1950
|
);
|
|
1956
1951
|
return {
|
|
1957
1952
|
connector: Y(
|
|
1958
|
-
() =>
|
|
1953
|
+
() => nn(c, {
|
|
1959
1954
|
chatId: o ?? t.invocation_id
|
|
1960
1955
|
})(t),
|
|
1961
1956
|
// Key on invocation/chat ids so a new Agent object reference does not rebuild the connector.
|
|
@@ -1963,17 +1958,14 @@ const Zt = (e, t) => (n) => {
|
|
|
1963
1958
|
[c, t.invocation_id, o]
|
|
1964
1959
|
),
|
|
1965
1960
|
fetchAgentChecklist: g,
|
|
1966
|
-
fetchAgentResources:
|
|
1961
|
+
fetchAgentResources: m,
|
|
1967
1962
|
fetchAgentResourceHtml: N,
|
|
1968
1963
|
fetchAgentTimeline: y
|
|
1969
1964
|
};
|
|
1970
|
-
},
|
|
1971
|
-
const t = document.querySelector(e);
|
|
1972
|
-
t instanceof HTMLElement && t.removeAttribute("aria-describedby");
|
|
1973
|
-
}, Ka = 3e4, Wa = (e, t) => {
|
|
1965
|
+
}, Xa = 3e4, Za = (e, t) => {
|
|
1974
1966
|
const n = e.hasRunBefore ? t || "This trip" : e.tripName.trim() || "A new trip", s = e.destination ? ` to ${e.destination}` : "", r = e.hasRunBefore ? " It has run before." : "";
|
|
1975
1967
|
return `${n}${s}.${r}`.trim();
|
|
1976
|
-
},
|
|
1968
|
+
}, Qa = (e) => {
|
|
1977
1969
|
switch (e) {
|
|
1978
1970
|
case E.failed:
|
|
1979
1971
|
return B.stopped;
|
|
@@ -1982,12 +1974,12 @@ const Zt = (e, t) => (n) => {
|
|
|
1982
1974
|
default:
|
|
1983
1975
|
return B.running;
|
|
1984
1976
|
}
|
|
1985
|
-
},
|
|
1977
|
+
}, zt = (e, t) => {
|
|
1986
1978
|
t([Ae(e)]);
|
|
1987
|
-
},
|
|
1979
|
+
}, es = (e, t) => e.length === t.length && e.every((n, s) => {
|
|
1988
1980
|
const r = t[s];
|
|
1989
1981
|
return r !== void 0 && n.id === r.id && n.text === r.text;
|
|
1990
|
-
}),
|
|
1982
|
+
}), ts = ({
|
|
1991
1983
|
agent: e,
|
|
1992
1984
|
invocationId: t,
|
|
1993
1985
|
open: n,
|
|
@@ -1995,87 +1987,85 @@ const Zt = (e, t) => (n) => {
|
|
|
1995
1987
|
jwt: r,
|
|
1996
1988
|
headers: o,
|
|
1997
1989
|
agentUrl: i,
|
|
1998
|
-
agentChecklistUrl:
|
|
1990
|
+
agentChecklistUrl: p,
|
|
1999
1991
|
agentResourcesUrl: c,
|
|
2000
1992
|
agentTimelineUrl: g,
|
|
2001
|
-
agentChatUrl:
|
|
1993
|
+
agentChatUrl: m,
|
|
2002
1994
|
agentConversationUrl: N,
|
|
2003
1995
|
stopAgentUrl: y,
|
|
2004
1996
|
chatId: I,
|
|
2005
|
-
enableUpload:
|
|
1997
|
+
enableUpload: O,
|
|
2006
1998
|
initialBrief: f,
|
|
2007
1999
|
initialPhase: K,
|
|
2008
2000
|
initialChecklist: T,
|
|
2009
|
-
usePusherToRepoll:
|
|
2010
|
-
pusherChannelPrefix: A =
|
|
2011
|
-
subscribeToPusher:
|
|
2001
|
+
usePusherToRepoll: P = !1,
|
|
2002
|
+
pusherChannelPrefix: A = Zt,
|
|
2003
|
+
subscribeToPusher: _
|
|
2012
2004
|
}) => {
|
|
2013
|
-
const [
|
|
2005
|
+
const [S, v] = h(I ?? t), [R, z] = h("chat"), [Ce, L] = h(!1), {
|
|
2014
2006
|
connector: G,
|
|
2015
2007
|
fetchAgentChecklist: q,
|
|
2016
2008
|
fetchAgentResources: X,
|
|
2017
2009
|
fetchAgentResourceHtml: Z,
|
|
2018
2010
|
fetchAgentTimeline: D
|
|
2019
|
-
} =
|
|
2011
|
+
} = Ya({
|
|
2020
2012
|
agent: { ...e, invocation_id: t },
|
|
2021
2013
|
jwt: r,
|
|
2022
2014
|
headers: o,
|
|
2023
|
-
chatId:
|
|
2015
|
+
chatId: S,
|
|
2024
2016
|
urls: {
|
|
2025
2017
|
agentUrl: i,
|
|
2026
|
-
agentChecklistUrl:
|
|
2018
|
+
agentChecklistUrl: p,
|
|
2027
2019
|
agentResourcesUrl: c,
|
|
2028
2020
|
agentTimelineUrl: g,
|
|
2029
|
-
agentChatUrl:
|
|
2021
|
+
agentChatUrl: m,
|
|
2030
2022
|
agentConversationUrl: N,
|
|
2031
2023
|
stopAgentUrl: y
|
|
2032
2024
|
}
|
|
2033
|
-
}), x = le(G), [ae,
|
|
2034
|
-
K ?? (f ? B.running :
|
|
2035
|
-
), [
|
|
2025
|
+
}), x = le(G), [ae, Ee] = h(
|
|
2026
|
+
K ?? (f ? B.running : Qa(e.status))
|
|
2027
|
+
), [He, j] = h([]), [ze, ye] = h(0), [Te, ke] = h(), [at, ce] = h(null), [st, Re] = h([]), [pe, Ie] = h(!1), [Ge, Ne] = h(null), [Fe, Be] = h(null), [qe, Oe] = h(null), [Je, Le] = h(!1), [rt, Ue] = h(null), [de, Pe] = h(null), [u, b] = h(!1), [k, V] = h(null), [se, re] = h(T ?? null), [me, xe] = h(!1), [rn, it] = h(null), [vt, wt] = h(!1), [yt, kt] = h(null), [Ke, ot] = h(!1), [We, on] = h(!1), [je, ln] = h(!1), Nt = le(Ke), At = le(0), St = le(0);
|
|
2036
2028
|
H(() => {
|
|
2037
2029
|
x.current = G;
|
|
2038
|
-
}, [G]),
|
|
2039
|
-
|
|
2040
|
-
}, [
|
|
2041
|
-
|
|
2042
|
-
}, [We]), H(() => {
|
|
2043
|
-
v(I ?? t), z("chat"), U(!1), j([]), ye((d) => d + 1);
|
|
2030
|
+
}, [G]), H(() => {
|
|
2031
|
+
Nt.current = Ke;
|
|
2032
|
+
}, [Ke]), H(() => {
|
|
2033
|
+
v(I ?? t), z("chat"), L(!1), j([]), ye((d) => d + 1);
|
|
2044
2034
|
}, [t, I]), H(() => {
|
|
2045
2035
|
if (!n || f)
|
|
2046
2036
|
return;
|
|
2047
2037
|
const d = x.current.bootstrapConversation;
|
|
2048
2038
|
if (!d) {
|
|
2049
|
-
|
|
2039
|
+
zt(x.current.openingMessage(), j);
|
|
2050
2040
|
return;
|
|
2051
2041
|
}
|
|
2052
2042
|
let w = !1;
|
|
2053
2043
|
return ot(!0), (async () => {
|
|
2054
2044
|
try {
|
|
2055
|
-
const
|
|
2045
|
+
const $ = await d.call(x.current);
|
|
2056
2046
|
if (w)
|
|
2057
2047
|
return;
|
|
2058
|
-
j(
|
|
2048
|
+
j($.map(Ae));
|
|
2059
2049
|
} catch {
|
|
2060
|
-
w ||
|
|
2050
|
+
w || zt(x.current.openingMessage(), j);
|
|
2061
2051
|
} finally {
|
|
2062
2052
|
w || ot(!1);
|
|
2063
2053
|
}
|
|
2064
2054
|
})(), () => {
|
|
2065
2055
|
w = !0;
|
|
2066
2056
|
};
|
|
2067
|
-
}, [n, f, t,
|
|
2057
|
+
}, [n, f, t, S]);
|
|
2068
2058
|
const ie = C(() => {
|
|
2069
|
-
const d = ++
|
|
2059
|
+
const d = ++At.current;
|
|
2070
2060
|
(async () => {
|
|
2071
|
-
var w,
|
|
2061
|
+
var w, $;
|
|
2072
2062
|
try {
|
|
2073
2063
|
const Q = await q(t);
|
|
2074
|
-
if (d !==
|
|
2064
|
+
if (d !== At.current)
|
|
2075
2065
|
return;
|
|
2076
2066
|
re(
|
|
2077
2067
|
(ge) => JSON.stringify(ge) === JSON.stringify(Q.checklist) ? ge : Q.checklist
|
|
2078
|
-
), it(null), (
|
|
2068
|
+
), it(null), ($ = (w = x.current).seedChecklist) == null || $.call(w, Q.checklist);
|
|
2079
2069
|
} catch {
|
|
2080
2070
|
}
|
|
2081
2071
|
})();
|
|
@@ -2083,42 +2073,42 @@ const Zt = (e, t) => (n) => {
|
|
|
2083
2073
|
c && (async () => {
|
|
2084
2074
|
try {
|
|
2085
2075
|
const d = await X(t);
|
|
2086
|
-
|
|
2076
|
+
Re(d), Ne(null);
|
|
2087
2077
|
} catch {
|
|
2088
2078
|
}
|
|
2089
2079
|
})();
|
|
2090
2080
|
}, [c, X, t]), oe = C(() => {
|
|
2091
2081
|
if (!g)
|
|
2092
2082
|
return;
|
|
2093
|
-
const d = ++
|
|
2083
|
+
const d = ++St.current;
|
|
2094
2084
|
(async () => {
|
|
2095
2085
|
try {
|
|
2096
2086
|
const w = await D(t);
|
|
2097
|
-
if (d !==
|
|
2087
|
+
if (d !== St.current)
|
|
2098
2088
|
return;
|
|
2099
|
-
|
|
2100
|
-
(
|
|
2089
|
+
Pe(
|
|
2090
|
+
($) => JSON.stringify($) === JSON.stringify(w) ? $ : w
|
|
2101
2091
|
), V(null);
|
|
2102
2092
|
} catch {
|
|
2103
2093
|
}
|
|
2104
2094
|
})();
|
|
2105
|
-
}, [g, D, t]),
|
|
2095
|
+
}, [g, D, t]), De = C(
|
|
2106
2096
|
(d) => {
|
|
2107
2097
|
const w = x.current.bootstrapConversation;
|
|
2108
2098
|
w && (async () => {
|
|
2109
2099
|
try {
|
|
2110
|
-
const
|
|
2111
|
-
if (
|
|
2100
|
+
const $ = await w.call(x.current);
|
|
2101
|
+
if (Nt.current)
|
|
2112
2102
|
return;
|
|
2113
|
-
const Q =
|
|
2103
|
+
const Q = $.map(Ae);
|
|
2114
2104
|
let ge = !1;
|
|
2115
|
-
j((
|
|
2105
|
+
j((Et) => es(Et, Q) ? Et : (ge = !0, Q)), ge && (d != null && d.refreshSidePanelsOnChange) && (ie(), oe());
|
|
2116
2106
|
} catch {
|
|
2117
2107
|
}
|
|
2118
2108
|
})();
|
|
2119
2109
|
},
|
|
2120
2110
|
[ie, oe]
|
|
2121
|
-
),
|
|
2111
|
+
), cn = C(
|
|
2122
2112
|
(d) => {
|
|
2123
2113
|
switch (d) {
|
|
2124
2114
|
case ve.checklist:
|
|
@@ -2128,45 +2118,38 @@ const Zt = (e, t) => (n) => {
|
|
|
2128
2118
|
_e();
|
|
2129
2119
|
return;
|
|
2130
2120
|
case ve.chat:
|
|
2131
|
-
|
|
2121
|
+
De();
|
|
2132
2122
|
return;
|
|
2133
2123
|
case ve.timeline:
|
|
2134
2124
|
oe();
|
|
2135
2125
|
return;
|
|
2136
2126
|
case ve.all:
|
|
2137
2127
|
default:
|
|
2138
|
-
ie(), _e(),
|
|
2128
|
+
ie(), _e(), De(), oe();
|
|
2139
2129
|
}
|
|
2140
2130
|
},
|
|
2141
|
-
[ie,
|
|
2142
|
-
)
|
|
2143
|
-
|
|
2144
|
-
enabled: n && O,
|
|
2131
|
+
[ie, De, _e, oe]
|
|
2132
|
+
), bt = wa({
|
|
2133
|
+
enabled: n && P,
|
|
2145
2134
|
channelPrefix: A,
|
|
2146
2135
|
agentId: e.id,
|
|
2147
|
-
subscribeToPusher:
|
|
2148
|
-
onRepoll:
|
|
2149
|
-
})
|
|
2150
|
-
|
|
2136
|
+
subscribeToPusher: _,
|
|
2137
|
+
onRepoll: cn
|
|
2138
|
+
});
|
|
2139
|
+
H(() => {
|
|
2140
|
+
if (!n || f || bt)
|
|
2151
2141
|
return;
|
|
2152
2142
|
const d = window.setInterval(() => {
|
|
2153
|
-
|
|
2154
|
-
},
|
|
2143
|
+
De({ refreshSidePanelsOnChange: !0 });
|
|
2144
|
+
}, Xa);
|
|
2155
2145
|
return () => {
|
|
2156
2146
|
window.clearInterval(d);
|
|
2157
2147
|
};
|
|
2158
|
-
}, [
|
|
2159
|
-
|
|
2160
|
-
f,
|
|
2161
|
-
O,
|
|
2162
|
-
t,
|
|
2163
|
-
b,
|
|
2164
|
-
Me
|
|
2165
|
-
]);
|
|
2166
|
-
const on = C(
|
|
2148
|
+
}, [n, f, bt, t, S, De]);
|
|
2149
|
+
const dn = C(
|
|
2167
2150
|
(d) => {
|
|
2168
|
-
var w,
|
|
2169
|
-
d.checklist ? (re(d.checklist), (
|
|
2151
|
+
var w, $;
|
|
2152
|
+
d.checklist ? (re(d.checklist), ($ = (w = x.current).seedChecklist) == null || $.call(w, d.checklist)) : ie(), d.phase && Ee(d.phase), _e(), oe();
|
|
2170
2153
|
},
|
|
2171
2154
|
[ie, _e, oe]
|
|
2172
2155
|
);
|
|
@@ -2177,17 +2160,17 @@ const Zt = (e, t) => (n) => {
|
|
|
2177
2160
|
if (!n || f)
|
|
2178
2161
|
return;
|
|
2179
2162
|
let d = !1;
|
|
2180
|
-
return
|
|
2181
|
-
var w,
|
|
2163
|
+
return xe((w) => T != null && T.length ? !1 : w || se === null || se.length === 0), it(null), (async () => {
|
|
2164
|
+
var w, $;
|
|
2182
2165
|
try {
|
|
2183
2166
|
const Q = await q(t);
|
|
2184
2167
|
if (d)
|
|
2185
2168
|
return;
|
|
2186
|
-
T != null && T.length || (re(Q.checklist), (
|
|
2169
|
+
T != null && T.length || (re(Q.checklist), ($ = (w = x.current).seedChecklist) == null || $.call(w, Q.checklist));
|
|
2187
2170
|
} catch {
|
|
2188
|
-
!d && !(T != null && T.length) && it(
|
|
2171
|
+
!d && !(T != null && T.length) && it(Ze);
|
|
2189
2172
|
} finally {
|
|
2190
|
-
d ||
|
|
2173
|
+
d || xe(!1);
|
|
2191
2174
|
}
|
|
2192
2175
|
})(), () => {
|
|
2193
2176
|
d = !0;
|
|
@@ -2196,35 +2179,35 @@ const Zt = (e, t) => (n) => {
|
|
|
2196
2179
|
if (!n || !c)
|
|
2197
2180
|
return;
|
|
2198
2181
|
let d = !1;
|
|
2199
|
-
return
|
|
2182
|
+
return Ie(!0), Ne(null), (async () => {
|
|
2200
2183
|
try {
|
|
2201
2184
|
const w = await X(t);
|
|
2202
|
-
d ||
|
|
2185
|
+
d || Re(w);
|
|
2203
2186
|
} catch {
|
|
2204
|
-
d || Ne(
|
|
2187
|
+
d || Ne(On);
|
|
2205
2188
|
} finally {
|
|
2206
|
-
d ||
|
|
2189
|
+
d || Ie(!1);
|
|
2207
2190
|
}
|
|
2208
2191
|
})(), () => {
|
|
2209
2192
|
d = !0;
|
|
2210
2193
|
};
|
|
2211
2194
|
}, [n, t, c, X]);
|
|
2212
|
-
const
|
|
2213
|
-
|
|
2214
|
-
}, []),
|
|
2195
|
+
const gn = C(() => {
|
|
2196
|
+
Be(null), Oe(null), Ue(null), Le(!1);
|
|
2197
|
+
}, []), hn = C(
|
|
2215
2198
|
(d) => {
|
|
2216
2199
|
if (d.misRecordUrl) {
|
|
2217
2200
|
window.open(d.misRecordUrl, "_blank", "noopener,noreferrer");
|
|
2218
2201
|
return;
|
|
2219
2202
|
}
|
|
2220
|
-
|
|
2203
|
+
Be(d), Oe(null), Ue(null), Le(!0), (async () => {
|
|
2221
2204
|
try {
|
|
2222
2205
|
const w = await Z(t, d.id);
|
|
2223
|
-
|
|
2206
|
+
Oe(w);
|
|
2224
2207
|
} catch {
|
|
2225
|
-
|
|
2208
|
+
Ue(Ln);
|
|
2226
2209
|
} finally {
|
|
2227
|
-
|
|
2210
|
+
Le(!1);
|
|
2228
2211
|
}
|
|
2229
2212
|
})();
|
|
2230
2213
|
},
|
|
@@ -2234,14 +2217,14 @@ const Zt = (e, t) => (n) => {
|
|
|
2234
2217
|
if (!n || !g)
|
|
2235
2218
|
return;
|
|
2236
2219
|
let d = !1;
|
|
2237
|
-
return
|
|
2220
|
+
return b((w) => w || de === null), V(null), (async () => {
|
|
2238
2221
|
try {
|
|
2239
2222
|
const w = await D(t);
|
|
2240
|
-
d ||
|
|
2223
|
+
d || Pe(w);
|
|
2241
2224
|
} catch {
|
|
2242
|
-
d || V(
|
|
2225
|
+
d || V(Wt);
|
|
2243
2226
|
} finally {
|
|
2244
|
-
d ||
|
|
2227
|
+
d || b(!1);
|
|
2245
2228
|
}
|
|
2246
2229
|
})(), () => {
|
|
2247
2230
|
d = !0;
|
|
@@ -2253,16 +2236,16 @@ const Zt = (e, t) => (n) => {
|
|
|
2253
2236
|
const w = {
|
|
2254
2237
|
id: `user-brief-${Date.now()}`,
|
|
2255
2238
|
author: ne.user,
|
|
2256
|
-
text:
|
|
2239
|
+
text: Za(f, e.invocation_name)
|
|
2257
2240
|
};
|
|
2258
2241
|
return (async () => {
|
|
2259
2242
|
var Q, ge;
|
|
2260
|
-
const
|
|
2243
|
+
const $ = await x.current.start(f);
|
|
2261
2244
|
d || (j([
|
|
2262
2245
|
Ae(x.current.openingMessage()),
|
|
2263
2246
|
Ae(w),
|
|
2264
|
-
Ae(
|
|
2265
|
-
]),
|
|
2247
|
+
Ae($.message)
|
|
2248
|
+
]), $.checklist ? (re($.checklist), (ge = (Q = x.current).seedChecklist) == null || ge.call(Q, $.checklist)) : ie(), Ee($.phase ?? B.running), _e(), oe());
|
|
2266
2249
|
})(), () => {
|
|
2267
2250
|
d = !0;
|
|
2268
2251
|
};
|
|
@@ -2275,36 +2258,43 @@ const Zt = (e, t) => (n) => {
|
|
|
2275
2258
|
_e,
|
|
2276
2259
|
oe
|
|
2277
2260
|
]);
|
|
2278
|
-
const
|
|
2279
|
-
ce(
|
|
2280
|
-
}, []), lt = I ?? t,
|
|
2261
|
+
const un = C((d) => {
|
|
2262
|
+
ce(ha(d));
|
|
2263
|
+
}, []), lt = I ?? t, Ve = de == null ? void 0 : de.chatSessions, Ct = Ve != null && Ve.length ? Ve.reduce(
|
|
2281
2264
|
(d, w) => Date.parse(w.timestamp) < Date.parse(d.timestamp) ? w : d
|
|
2282
2265
|
).sessionId : void 0, ct = C(() => {
|
|
2283
|
-
z("chat"),
|
|
2284
|
-
}, [
|
|
2266
|
+
z("chat"), L(!1), S !== lt && (v(lt), j([]), ye((d) => d + 1));
|
|
2267
|
+
}, [S, lt]), pn = C(
|
|
2285
2268
|
(d) => {
|
|
2286
|
-
if (d ===
|
|
2269
|
+
if (d === Ct) {
|
|
2287
2270
|
ct();
|
|
2288
2271
|
return;
|
|
2289
2272
|
}
|
|
2290
|
-
v(d),
|
|
2273
|
+
v(d), L(!0), z("chat"), j([]), ye((w) => w + 1);
|
|
2291
2274
|
},
|
|
2292
|
-
[
|
|
2293
|
-
),
|
|
2275
|
+
[Ct, ct]
|
|
2276
|
+
), mn = C((d) => {
|
|
2294
2277
|
ce(null), ke(d), ye((w) => w + 1);
|
|
2295
|
-
}, []),
|
|
2296
|
-
|
|
2297
|
-
|
|
2278
|
+
}, []), _n = C(async () => {
|
|
2279
|
+
kt(null), wt(!0);
|
|
2280
|
+
try {
|
|
2281
|
+
await x.current.stop(), Ee(B.stopped);
|
|
2282
|
+
} catch {
|
|
2283
|
+
kt(Un);
|
|
2284
|
+
} finally {
|
|
2285
|
+
wt(!1);
|
|
2286
|
+
}
|
|
2287
|
+
}, []), fn = se;
|
|
2298
2288
|
return /* @__PURE__ */ l(ue, { open: n, closeHandler: s, hideCloseButton: !0, className: "agent-workspace", children: [
|
|
2299
2289
|
/* @__PURE__ */ l(ue.Header, { className: "agent-workspace__header", children: [
|
|
2300
2290
|
/* @__PURE__ */ l("div", { className: "agent-workspace__header-title", children: [
|
|
2301
|
-
/* @__PURE__ */ a("span", { className: "agent-workspace__header-avatar", "aria-hidden": "true", children: /* @__PURE__ */ a(
|
|
2291
|
+
/* @__PURE__ */ a("span", { className: "agent-workspace__header-avatar", "aria-hidden": "true", children: /* @__PURE__ */ a(U, { name: "ask-arbor", size: 24 }) }),
|
|
2302
2292
|
/* @__PURE__ */ a(ue.Title, { children: e.invocation_name }),
|
|
2303
2293
|
/* @__PURE__ */ a(
|
|
2304
2294
|
"span",
|
|
2305
2295
|
{
|
|
2306
2296
|
className: W("agent-workspace__phase", `agent-workspace__phase--${ae}`),
|
|
2307
|
-
children:
|
|
2297
|
+
children: Dn[ae]
|
|
2308
2298
|
}
|
|
2309
2299
|
)
|
|
2310
2300
|
] }),
|
|
@@ -2312,24 +2302,24 @@ const Zt = (e, t) => (n) => {
|
|
|
2312
2302
|
/* @__PURE__ */ a(
|
|
2313
2303
|
te,
|
|
2314
2304
|
{
|
|
2315
|
-
variant:
|
|
2305
|
+
variant: We ? "secondary" : "primary",
|
|
2316
2306
|
size: "S",
|
|
2317
2307
|
iconLeftName: "clipboard-list",
|
|
2318
2308
|
iconLeftScreenReaderText: "Toggle checklist",
|
|
2319
|
-
"aria-pressed": !
|
|
2320
|
-
onClick: () =>
|
|
2309
|
+
"aria-pressed": !We,
|
|
2310
|
+
onClick: () => on((d) => !d),
|
|
2321
2311
|
children: "Checklist"
|
|
2322
2312
|
}
|
|
2323
2313
|
),
|
|
2324
2314
|
/* @__PURE__ */ a(
|
|
2325
2315
|
te,
|
|
2326
2316
|
{
|
|
2327
|
-
variant:
|
|
2317
|
+
variant: je ? "secondary" : "primary",
|
|
2328
2318
|
size: "S",
|
|
2329
2319
|
iconLeftName: "files",
|
|
2330
2320
|
iconLeftScreenReaderText: "Toggle resources",
|
|
2331
|
-
"aria-pressed": !
|
|
2332
|
-
onClick: () =>
|
|
2321
|
+
"aria-pressed": !je,
|
|
2322
|
+
onClick: () => ln((d) => !d),
|
|
2333
2323
|
children: "Resources"
|
|
2334
2324
|
}
|
|
2335
2325
|
),
|
|
@@ -2350,11 +2340,10 @@ const Zt = (e, t) => (n) => {
|
|
|
2350
2340
|
ue.Body,
|
|
2351
2341
|
{
|
|
2352
2342
|
className: W("agent-workspace__body", {
|
|
2353
|
-
"agent-workspace__body--no-checklist":
|
|
2354
|
-
"agent-workspace__body--no-resources":
|
|
2343
|
+
"agent-workspace__body--no-checklist": We,
|
|
2344
|
+
"agent-workspace__body--no-resources": je
|
|
2355
2345
|
}),
|
|
2356
2346
|
children: [
|
|
2357
|
-
" ",
|
|
2358
2347
|
/* @__PURE__ */ l(
|
|
2359
2348
|
"section",
|
|
2360
2349
|
{
|
|
@@ -2364,7 +2353,7 @@ const Zt = (e, t) => (n) => {
|
|
|
2364
2353
|
"aria-label": "Agent",
|
|
2365
2354
|
children: [
|
|
2366
2355
|
/* @__PURE__ */ l("div", { className: "agent-workspace__panel-header", children: [
|
|
2367
|
-
/* @__PURE__ */ a(
|
|
2356
|
+
/* @__PURE__ */ a(be, { level: 4, children: "Agent" }),
|
|
2368
2357
|
y && ae === B.running && /* @__PURE__ */ a(
|
|
2369
2358
|
te,
|
|
2370
2359
|
{
|
|
@@ -2373,11 +2362,13 @@ const Zt = (e, t) => (n) => {
|
|
|
2373
2362
|
size: "S",
|
|
2374
2363
|
iconLeftName: "circle-x",
|
|
2375
2364
|
iconLeftScreenReaderText: "Stop",
|
|
2376
|
-
|
|
2377
|
-
|
|
2365
|
+
disabled: vt,
|
|
2366
|
+
onClick: () => void _n(),
|
|
2367
|
+
children: vt ? "Stopping…" : "Stop agent"
|
|
2378
2368
|
}
|
|
2379
2369
|
)
|
|
2380
2370
|
] }),
|
|
2371
|
+
yt && /* @__PURE__ */ a("p", { className: "agent-workspace__error agent-workspace__stop-error", role: "alert", children: yt }),
|
|
2381
2372
|
g && /* @__PURE__ */ l(dt, { className: "agent-workspace__center-tabs", "aria-label": "Center panel", children: [
|
|
2382
2373
|
/* @__PURE__ */ a(
|
|
2383
2374
|
dt.Item,
|
|
@@ -2402,7 +2393,7 @@ const Zt = (e, t) => (n) => {
|
|
|
2402
2393
|
}
|
|
2403
2394
|
)
|
|
2404
2395
|
] }),
|
|
2405
|
-
g && R === "chat" &&
|
|
2396
|
+
g && R === "chat" && Ce && /* @__PURE__ */ a("div", { className: "agent-workspace__center-back", children: /* @__PURE__ */ a(
|
|
2406
2397
|
te,
|
|
2407
2398
|
{
|
|
2408
2399
|
variant: "tertiary",
|
|
@@ -2414,12 +2405,12 @@ const Zt = (e, t) => (n) => {
|
|
|
2414
2405
|
}
|
|
2415
2406
|
) }),
|
|
2416
2407
|
g && R === "timeline" && /* @__PURE__ */ a(
|
|
2417
|
-
|
|
2408
|
+
da,
|
|
2418
2409
|
{
|
|
2419
2410
|
timeline: de,
|
|
2420
|
-
isLoading:
|
|
2411
|
+
isLoading: u,
|
|
2421
2412
|
error: k,
|
|
2422
|
-
onOpenChatSession:
|
|
2413
|
+
onOpenChatSession: pn
|
|
2423
2414
|
}
|
|
2424
2415
|
),
|
|
2425
2416
|
/* @__PURE__ */ a(
|
|
@@ -2428,18 +2419,18 @@ const Zt = (e, t) => (n) => {
|
|
|
2428
2419
|
className: "agent-workspace__chat-keep-alive",
|
|
2429
2420
|
hidden: !!g && R !== "chat",
|
|
2430
2421
|
children: /* @__PURE__ */ a(
|
|
2431
|
-
|
|
2422
|
+
Xn,
|
|
2432
2423
|
{
|
|
2433
2424
|
connector: G,
|
|
2434
2425
|
phase: ae,
|
|
2435
|
-
chatHistory:
|
|
2436
|
-
chatSessionKey:
|
|
2437
|
-
startQuery:
|
|
2426
|
+
chatHistory: He,
|
|
2427
|
+
chatSessionKey: ze,
|
|
2428
|
+
startQuery: Te,
|
|
2438
2429
|
clarificationMessage: at,
|
|
2439
|
-
enableUpload:
|
|
2440
|
-
onTurn:
|
|
2430
|
+
enableUpload: O,
|
|
2431
|
+
onTurn: dn,
|
|
2441
2432
|
onAwaitingChange: ot,
|
|
2442
|
-
onClarificationPrompt:
|
|
2433
|
+
onClarificationPrompt: mn,
|
|
2443
2434
|
onDismissClarification: () => ce(null)
|
|
2444
2435
|
}
|
|
2445
2436
|
)
|
|
@@ -2448,41 +2439,41 @@ const Zt = (e, t) => (n) => {
|
|
|
2448
2439
|
]
|
|
2449
2440
|
}
|
|
2450
2441
|
),
|
|
2451
|
-
!
|
|
2452
|
-
|
|
2442
|
+
!We && /* @__PURE__ */ a(
|
|
2443
|
+
Zn,
|
|
2453
2444
|
{
|
|
2454
|
-
checklist:
|
|
2445
|
+
checklist: fn,
|
|
2455
2446
|
isLoading: me,
|
|
2456
|
-
error:
|
|
2447
|
+
error: rn,
|
|
2457
2448
|
phase: ae,
|
|
2458
|
-
canRequestInput: ae === B.running && !
|
|
2459
|
-
onAttentionItemClick:
|
|
2449
|
+
canRequestInput: ae === B.running && !Ke,
|
|
2450
|
+
onAttentionItemClick: un
|
|
2460
2451
|
}
|
|
2461
2452
|
),
|
|
2462
|
-
!
|
|
2463
|
-
|
|
2453
|
+
!je && /* @__PURE__ */ a(
|
|
2454
|
+
ta,
|
|
2464
2455
|
{
|
|
2465
2456
|
resources: st,
|
|
2466
2457
|
isLoading: pe,
|
|
2467
|
-
error:
|
|
2468
|
-
onOpenResource:
|
|
2458
|
+
error: Ge,
|
|
2459
|
+
onOpenResource: hn
|
|
2469
2460
|
}
|
|
2470
2461
|
),
|
|
2471
2462
|
/* @__PURE__ */ a(
|
|
2472
|
-
|
|
2463
|
+
Qn,
|
|
2473
2464
|
{
|
|
2474
|
-
resource:
|
|
2475
|
-
html:
|
|
2476
|
-
isLoading:
|
|
2465
|
+
resource: Fe,
|
|
2466
|
+
html: qe,
|
|
2467
|
+
isLoading: Je,
|
|
2477
2468
|
error: rt,
|
|
2478
|
-
onClose:
|
|
2469
|
+
onClose: gn
|
|
2479
2470
|
}
|
|
2480
2471
|
)
|
|
2481
2472
|
]
|
|
2482
2473
|
}
|
|
2483
2474
|
)
|
|
2484
2475
|
] });
|
|
2485
|
-
},
|
|
2476
|
+
}, ns = "Unable to load agent definitions. Please try again.", as = "Unable to start the agent.", Gt = "Loading agents…", sn = ({
|
|
2486
2477
|
open: e,
|
|
2487
2478
|
onClose: t,
|
|
2488
2479
|
onStart: n,
|
|
@@ -2490,18 +2481,16 @@ const Zt = (e, t) => (n) => {
|
|
|
2490
2481
|
definitionsState: r = "idle",
|
|
2491
2482
|
definitionsError: o = null,
|
|
2492
2483
|
onRetryDefinitions: i,
|
|
2493
|
-
embedded:
|
|
2484
|
+
embedded: p = !1
|
|
2494
2485
|
}) => {
|
|
2495
|
-
const [c, g] =
|
|
2486
|
+
const [c, g] = h(void 0), [m, N] = h(""), [y, I] = h(!1), [O, f] = h(null), K = [...s].sort((v, R) => v.display_name.localeCompare(R.display_name)).map((v) => ({
|
|
2496
2487
|
value: v.ref,
|
|
2497
2488
|
label: v.display_name
|
|
2498
2489
|
}));
|
|
2499
2490
|
H(() => {
|
|
2500
2491
|
e && (g(void 0), N(""), I(!1), f(null));
|
|
2501
|
-
}, [e])
|
|
2502
|
-
|
|
2503
|
-
}, [e, u]);
|
|
2504
|
-
const T = c !== void 0 && _.trim().length > 0, O = C(
|
|
2492
|
+
}, [e]);
|
|
2493
|
+
const T = c !== void 0 && m.trim().length > 0, P = C(
|
|
2505
2494
|
(v) => {
|
|
2506
2495
|
const R = s.find((z) => z.ref === v[0]);
|
|
2507
2496
|
R && g(R);
|
|
@@ -2511,38 +2500,38 @@ const Zt = (e, t) => (n) => {
|
|
|
2511
2500
|
if (!(!c || !T || y)) {
|
|
2512
2501
|
I(!0), f(null);
|
|
2513
2502
|
try {
|
|
2514
|
-
await n({ definition: c, invocationName:
|
|
2503
|
+
await n({ definition: c, invocationName: m.trim() });
|
|
2515
2504
|
} catch (v) {
|
|
2516
|
-
f(v instanceof Error ? v.message :
|
|
2505
|
+
f(v instanceof Error ? v.message : as);
|
|
2517
2506
|
} finally {
|
|
2518
2507
|
I(!1);
|
|
2519
2508
|
}
|
|
2520
2509
|
}
|
|
2521
|
-
}, [T, c,
|
|
2510
|
+
}, [T, c, m, y, n]);
|
|
2522
2511
|
if (r === "idle" && s.length === 0 || !e)
|
|
2523
2512
|
return null;
|
|
2524
|
-
const
|
|
2525
|
-
/* @__PURE__ */ a("span", { className: "new-agent__header-avatar", "aria-hidden": "true", children: /* @__PURE__ */ a(
|
|
2526
|
-
|
|
2513
|
+
const _ = /* @__PURE__ */ l("div", { className: "new-agent__header-title", children: [
|
|
2514
|
+
/* @__PURE__ */ a("span", { className: "new-agent__header-avatar", "aria-hidden": "true", children: /* @__PURE__ */ a(U, { name: "ask-arbor", size: 24 }) }),
|
|
2515
|
+
p ? /* @__PURE__ */ a("h2", { className: "new-agent__title", children: "Start an agent" }) : /* @__PURE__ */ a(ue.Title, { children: "Start an agent" })
|
|
2527
2516
|
] });
|
|
2528
|
-
let
|
|
2529
|
-
return r === "loading" ?
|
|
2517
|
+
let S;
|
|
2518
|
+
return r === "loading" ? S = /* @__PURE__ */ l("div", { className: "new-agent__state", "aria-live": "polite", children: [
|
|
2530
2519
|
/* @__PURE__ */ a(
|
|
2531
|
-
|
|
2520
|
+
U,
|
|
2532
2521
|
{
|
|
2533
2522
|
name: "loader",
|
|
2534
2523
|
size: 24,
|
|
2535
2524
|
color: "var(--color-brand-600)",
|
|
2536
2525
|
className: "new-agent__spinner",
|
|
2537
|
-
screenReaderText:
|
|
2526
|
+
screenReaderText: Gt
|
|
2538
2527
|
}
|
|
2539
2528
|
),
|
|
2540
|
-
/* @__PURE__ */ a("p", { className: "new-agent__state-message", children:
|
|
2541
|
-
] }) : r === "error" ?
|
|
2542
|
-
/* @__PURE__ */ a(
|
|
2543
|
-
/* @__PURE__ */ a("p", { className: "new-agent__state-message", children: o ??
|
|
2529
|
+
/* @__PURE__ */ a("p", { className: "new-agent__state-message", children: Gt })
|
|
2530
|
+
] }) : r === "error" ? S = /* @__PURE__ */ l("div", { className: "new-agent__state new-agent__state--error", role: "alert", children: [
|
|
2531
|
+
/* @__PURE__ */ a(U, { name: "triangle-alert", size: 24, color: "var(--color-semantic-destructive-600)" }),
|
|
2532
|
+
/* @__PURE__ */ a("p", { className: "new-agent__state-message", children: o ?? ns }),
|
|
2544
2533
|
i ? /* @__PURE__ */ a(te, { variant: "secondary", size: "S", onClick: i, children: "Try again" }) : null
|
|
2545
|
-
] }) :
|
|
2534
|
+
] }) : S = /* @__PURE__ */ l(
|
|
2546
2535
|
"form",
|
|
2547
2536
|
{
|
|
2548
2537
|
className: "new-agent__form",
|
|
@@ -2554,29 +2543,29 @@ const Zt = (e, t) => (n) => {
|
|
|
2554
2543
|
/* @__PURE__ */ l("div", { className: "new-agent__type-field", children: [
|
|
2555
2544
|
/* @__PURE__ */ a("label", { className: "new-agent__type-label", htmlFor: "new-agent-type", children: "What would you like your agent to do?" }),
|
|
2556
2545
|
/* @__PURE__ */ a(
|
|
2557
|
-
|
|
2546
|
+
wn,
|
|
2558
2547
|
{
|
|
2559
2548
|
id: "new-agent-type",
|
|
2560
2549
|
placeholder: "Which agent would you like to start?",
|
|
2561
2550
|
options: K,
|
|
2562
2551
|
selectedValues: c ? [c.ref] : [],
|
|
2563
|
-
onSelectionChange:
|
|
2552
|
+
onSelectionChange: P
|
|
2564
2553
|
}
|
|
2565
2554
|
)
|
|
2566
2555
|
] }),
|
|
2567
2556
|
/* @__PURE__ */ l("div", { className: "new-agent__type-field", children: [
|
|
2568
2557
|
/* @__PURE__ */ a("label", { className: "new-agent__type-label", htmlFor: "new-agent-invocation-name", children: "Name" }),
|
|
2569
2558
|
/* @__PURE__ */ a(
|
|
2570
|
-
|
|
2559
|
+
yn,
|
|
2571
2560
|
{
|
|
2572
2561
|
id: "new-agent-invocation-name",
|
|
2573
|
-
value:
|
|
2562
|
+
value: m,
|
|
2574
2563
|
placeholder: "What would you like to call your agent?",
|
|
2575
2564
|
onChange: (v) => N(v.target.value)
|
|
2576
2565
|
}
|
|
2577
2566
|
)
|
|
2578
2567
|
] }),
|
|
2579
|
-
|
|
2568
|
+
O ? /* @__PURE__ */ a("p", { className: "new-agent__error", role: "alert", children: O }) : null,
|
|
2580
2569
|
/* @__PURE__ */ a("div", { className: "new-agent__actions", children: /* @__PURE__ */ a(
|
|
2581
2570
|
te,
|
|
2582
2571
|
{
|
|
@@ -2593,16 +2582,16 @@ const Zt = (e, t) => (n) => {
|
|
|
2593
2582
|
) })
|
|
2594
2583
|
]
|
|
2595
2584
|
}
|
|
2596
|
-
),
|
|
2597
|
-
/* @__PURE__ */ a("div", { className: "new-agent__header", children:
|
|
2598
|
-
/* @__PURE__ */ a("div", { className: "new-agent__body", children:
|
|
2585
|
+
), p ? /* @__PURE__ */ l("div", { className: W("new-agent", "new-agent--embedded"), children: [
|
|
2586
|
+
/* @__PURE__ */ a("div", { className: "new-agent__header", children: _ }),
|
|
2587
|
+
/* @__PURE__ */ a("div", { className: "new-agent__body", children: S })
|
|
2599
2588
|
] }) : /* @__PURE__ */ l(ue, { open: e, closeHandler: t, className: "new-agent", children: [
|
|
2600
|
-
/* @__PURE__ */ a(ue.Header, { className: "new-agent__header", children:
|
|
2601
|
-
/* @__PURE__ */ a(ue.Body, { className: "new-agent__body", children:
|
|
2589
|
+
/* @__PURE__ */ a(ue.Header, { className: "new-agent__header", children: _ }),
|
|
2590
|
+
/* @__PURE__ */ a(ue.Body, { className: "new-agent__body", children: S })
|
|
2602
2591
|
] });
|
|
2603
|
-
},
|
|
2592
|
+
}, Ft = (e) => {
|
|
2604
2593
|
window.location.assign(e);
|
|
2605
|
-
},
|
|
2594
|
+
}, ss = ({
|
|
2606
2595
|
open: e,
|
|
2607
2596
|
authToken: t,
|
|
2608
2597
|
headers: n,
|
|
@@ -2610,11 +2599,11 @@ const Zt = (e, t) => (n) => {
|
|
|
2610
2599
|
agentsUrl: r,
|
|
2611
2600
|
closeUrl: o,
|
|
2612
2601
|
successUrl: i,
|
|
2613
|
-
onClose:
|
|
2602
|
+
onClose: p,
|
|
2614
2603
|
onStart: c,
|
|
2615
2604
|
embedded: g = !1
|
|
2616
2605
|
}) => {
|
|
2617
|
-
const
|
|
2606
|
+
const m = JSON.stringify(n ?? {}), N = Y(
|
|
2618
2607
|
() => new ft({
|
|
2619
2608
|
token: t,
|
|
2620
2609
|
headers: n,
|
|
@@ -2624,8 +2613,8 @@ const Zt = (e, t) => (n) => {
|
|
|
2624
2613
|
}
|
|
2625
2614
|
}),
|
|
2626
2615
|
// eslint-disable-next-line react-hooks/exhaustive-deps -- keyed on serialised config to keep a stable client.
|
|
2627
|
-
[t, s, r,
|
|
2628
|
-
), [y, I] =
|
|
2616
|
+
[t, s, r, m]
|
|
2617
|
+
), [y, I] = h([]), [O, f] = h("loading"), [K, T] = h(null), [P, A] = h(0);
|
|
2629
2618
|
H(() => {
|
|
2630
2619
|
if (!e)
|
|
2631
2620
|
return;
|
|
@@ -2635,43 +2624,43 @@ const Zt = (e, t) => (n) => {
|
|
|
2635
2624
|
const z = await N.listAgentDefinitions();
|
|
2636
2625
|
if (R)
|
|
2637
2626
|
return;
|
|
2638
|
-
I(z.map(
|
|
2627
|
+
I(z.map(Qt)), f("idle");
|
|
2639
2628
|
} catch (z) {
|
|
2640
2629
|
if (R)
|
|
2641
2630
|
return;
|
|
2642
|
-
I([]), T(
|
|
2631
|
+
I([]), T(an(z)), f("error");
|
|
2643
2632
|
}
|
|
2644
2633
|
})(), () => {
|
|
2645
2634
|
R = !0;
|
|
2646
2635
|
};
|
|
2647
|
-
}, [N, e,
|
|
2648
|
-
const
|
|
2649
|
-
|
|
2650
|
-
}, [o,
|
|
2636
|
+
}, [N, e, P]);
|
|
2637
|
+
const _ = C(() => {
|
|
2638
|
+
p == null || p(), o && Ft(o);
|
|
2639
|
+
}, [o, p]), S = C(
|
|
2651
2640
|
async (R) => {
|
|
2652
2641
|
await N.createAgent(R.definition.ref, {
|
|
2653
2642
|
invocationName: R.invocationName
|
|
2654
|
-
}), c == null || c(R), i &&
|
|
2643
|
+
}), c == null || c(R), i && Ft(i);
|
|
2655
2644
|
},
|
|
2656
2645
|
[N, c, i]
|
|
2657
2646
|
), v = C(() => {
|
|
2658
2647
|
A((R) => R + 1);
|
|
2659
2648
|
}, []);
|
|
2660
2649
|
return /* @__PURE__ */ a(
|
|
2661
|
-
|
|
2650
|
+
sn,
|
|
2662
2651
|
{
|
|
2663
2652
|
open: e,
|
|
2664
|
-
onClose:
|
|
2665
|
-
onStart:
|
|
2653
|
+
onClose: _,
|
|
2654
|
+
onStart: S,
|
|
2666
2655
|
agentDefinitions: y,
|
|
2667
|
-
definitionsState:
|
|
2656
|
+
definitionsState: O,
|
|
2668
2657
|
definitionsError: K,
|
|
2669
2658
|
onRetryDefinitions: v,
|
|
2670
2659
|
embedded: g
|
|
2671
2660
|
}
|
|
2672
2661
|
);
|
|
2673
|
-
},
|
|
2674
|
-
|
|
2662
|
+
}, rs = (e) => "agentDefinitionsUrl" in e, is = (e) => rs(e) ? /* @__PURE__ */ a(ss, { ...e }) : /* @__PURE__ */ a(sn, { ...e }), os = (e) => e !== void 0 && e.some((t) => t.status === M.hitl), ls = (e, t) => os(t) ? E.hitl : e.status, cs = ({ column: e, label: t }) => e.statusIcon ? /* @__PURE__ */ a("span", { className: "agent-view__status-indicator", children: /* @__PURE__ */ a(
|
|
2663
|
+
U,
|
|
2675
2664
|
{
|
|
2676
2665
|
name: e.statusIcon.name,
|
|
2677
2666
|
size: 16,
|
|
@@ -2687,9 +2676,9 @@ const Zt = (e, t) => (n) => {
|
|
|
2687
2676
|
className: W("agent-view__dot", {
|
|
2688
2677
|
[`agent-view__dot--${e.dotModifier}`]: e.dotModifier
|
|
2689
2678
|
}),
|
|
2690
|
-
children: /* @__PURE__ */ a(
|
|
2679
|
+
children: /* @__PURE__ */ a(qt, { colour: e.dotColour, label: t })
|
|
2691
2680
|
}
|
|
2692
|
-
),
|
|
2681
|
+
), ds = ({
|
|
2693
2682
|
agent: e,
|
|
2694
2683
|
agentName: t,
|
|
2695
2684
|
column: n,
|
|
@@ -2697,17 +2686,17 @@ const Zt = (e, t) => (n) => {
|
|
|
2697
2686
|
isLoading: r,
|
|
2698
2687
|
checklist: o,
|
|
2699
2688
|
error: i,
|
|
2700
|
-
onToggle:
|
|
2689
|
+
onToggle: p,
|
|
2701
2690
|
onViewAgent: c
|
|
2702
2691
|
}) => {
|
|
2703
|
-
const { id: g, invocation_name:
|
|
2692
|
+
const { id: g, invocation_name: m } = e, N = `agent-card-${g}-header`, y = `agent-card-${g}-progress`;
|
|
2704
2693
|
return /* @__PURE__ */ a(
|
|
2705
2694
|
"li",
|
|
2706
2695
|
{
|
|
2707
2696
|
className: W("agent-view__card", {
|
|
2708
2697
|
"agent-view__card--expanded": s
|
|
2709
2698
|
}),
|
|
2710
|
-
children: /* @__PURE__ */ l(
|
|
2699
|
+
children: /* @__PURE__ */ l(kn, { spacing: "dense", children: [
|
|
2711
2700
|
/* @__PURE__ */ a(
|
|
2712
2701
|
"button",
|
|
2713
2702
|
{
|
|
@@ -2715,15 +2704,15 @@ const Zt = (e, t) => (n) => {
|
|
|
2715
2704
|
className: "agent-view__card-toggle",
|
|
2716
2705
|
"aria-expanded": s,
|
|
2717
2706
|
"aria-controls": y,
|
|
2718
|
-
"aria-label":
|
|
2707
|
+
"aria-label": m,
|
|
2719
2708
|
id: N,
|
|
2720
|
-
onClick: () =>
|
|
2709
|
+
onClick: () => p(g),
|
|
2721
2710
|
children: /* @__PURE__ */ l("div", { className: "agent-view__card-content", children: [
|
|
2722
|
-
/* @__PURE__ */ a(
|
|
2723
|
-
/* @__PURE__ */ a("span", { className: "agent-view__card-invocation-name", children:
|
|
2711
|
+
/* @__PURE__ */ a(cs, { column: n }),
|
|
2712
|
+
/* @__PURE__ */ a("span", { className: "agent-view__card-invocation-name", children: m }),
|
|
2724
2713
|
/* @__PURE__ */ a("span", { className: "agent-view__card-agent-name", children: t }),
|
|
2725
2714
|
/* @__PURE__ */ a(
|
|
2726
|
-
|
|
2715
|
+
U,
|
|
2727
2716
|
{
|
|
2728
2717
|
name: s ? "chevron-up" : "chevron-down",
|
|
2729
2718
|
size: 16,
|
|
@@ -2736,38 +2725,38 @@ const Zt = (e, t) => (n) => {
|
|
|
2736
2725
|
s && /* @__PURE__ */ l("div", { id: y, "aria-labelledby": N, className: "agent-view__card-progress", children: [
|
|
2737
2726
|
r && /* @__PURE__ */ l("div", { className: "agent-view__progress-loading", "aria-live": "polite", children: [
|
|
2738
2727
|
/* @__PURE__ */ a(
|
|
2739
|
-
|
|
2728
|
+
U,
|
|
2740
2729
|
{
|
|
2741
2730
|
name: "loader",
|
|
2742
2731
|
size: 16,
|
|
2743
2732
|
color: "var(--color-brand-600)",
|
|
2744
2733
|
className: "agent-view__progress-icon--spinning",
|
|
2745
|
-
screenReaderText:
|
|
2734
|
+
screenReaderText: Se
|
|
2746
2735
|
}
|
|
2747
2736
|
),
|
|
2748
|
-
/* @__PURE__ */ a("span", { children:
|
|
2737
|
+
/* @__PURE__ */ a("span", { children: Se })
|
|
2749
2738
|
] }),
|
|
2750
2739
|
!r && i && /* @__PURE__ */ a("p", { className: "agent-view__progress-error", role: "alert", children: i }),
|
|
2751
|
-
!r && !i && o !== null && /* @__PURE__ */ a(
|
|
2740
|
+
!r && !i && o !== null && /* @__PURE__ */ a(jn, { checklist: o }),
|
|
2752
2741
|
!r && !i && o === null && /* @__PURE__ */ l("div", { className: "agent-view__progress-loading", "aria-live": "polite", children: [
|
|
2753
2742
|
/* @__PURE__ */ a(
|
|
2754
|
-
|
|
2743
|
+
U,
|
|
2755
2744
|
{
|
|
2756
2745
|
name: "loader",
|
|
2757
2746
|
size: 16,
|
|
2758
2747
|
color: "var(--color-brand-600)",
|
|
2759
2748
|
className: "agent-view__progress-icon--spinning",
|
|
2760
|
-
screenReaderText:
|
|
2749
|
+
screenReaderText: Se
|
|
2761
2750
|
}
|
|
2762
2751
|
),
|
|
2763
|
-
/* @__PURE__ */ a("span", { children:
|
|
2752
|
+
/* @__PURE__ */ a("span", { children: Se })
|
|
2764
2753
|
] }),
|
|
2765
2754
|
/* @__PURE__ */ a("div", { className: "agent-view__card-actions", children: /* @__PURE__ */ a(te, { variant: "secondary", size: "S", onClick: () => c == null ? void 0 : c(e), children: "View agent" }) })
|
|
2766
2755
|
] })
|
|
2767
2756
|
] })
|
|
2768
2757
|
}
|
|
2769
2758
|
);
|
|
2770
|
-
},
|
|
2759
|
+
}, Bt = ({
|
|
2771
2760
|
column: e,
|
|
2772
2761
|
agents: t,
|
|
2773
2762
|
expandedAgentId: n,
|
|
@@ -2775,7 +2764,7 @@ const Zt = (e, t) => (n) => {
|
|
|
2775
2764
|
checklistByInvocationId: r,
|
|
2776
2765
|
errorByAgentId: o,
|
|
2777
2766
|
definitionNameByRef: i,
|
|
2778
|
-
onToggleAgent:
|
|
2767
|
+
onToggleAgent: p,
|
|
2779
2768
|
onViewAgent: c,
|
|
2780
2769
|
isSplit: g = !1
|
|
2781
2770
|
}) => /* @__PURE__ */ l(
|
|
@@ -2787,27 +2776,27 @@ const Zt = (e, t) => (n) => {
|
|
|
2787
2776
|
"aria-label": e.title,
|
|
2788
2777
|
children: [
|
|
2789
2778
|
/* @__PURE__ */ l("div", { className: "agent-view__column-header", children: [
|
|
2790
|
-
/* @__PURE__ */ a(
|
|
2779
|
+
/* @__PURE__ */ a(be, { level: 4, children: e.title }),
|
|
2791
2780
|
/* @__PURE__ */ a("span", { className: "agent-view__column-count", children: t.length })
|
|
2792
2781
|
] }),
|
|
2793
|
-
/* @__PURE__ */ a("ul", { className: "agent-view__card-list", children: t.map((
|
|
2794
|
-
|
|
2782
|
+
/* @__PURE__ */ a("ul", { className: "agent-view__card-list", children: t.map((m) => /* @__PURE__ */ a(
|
|
2783
|
+
ds,
|
|
2795
2784
|
{
|
|
2796
|
-
agent:
|
|
2797
|
-
agentName: _t(
|
|
2785
|
+
agent: m,
|
|
2786
|
+
agentName: _t(m, i),
|
|
2798
2787
|
column: e,
|
|
2799
|
-
isExpanded: n ===
|
|
2800
|
-
isLoading: s ===
|
|
2801
|
-
checklist: r[
|
|
2802
|
-
error: o[
|
|
2803
|
-
onToggle:
|
|
2788
|
+
isExpanded: n === m.id,
|
|
2789
|
+
isLoading: s === m.id,
|
|
2790
|
+
checklist: r[m.invocation_id] ?? null,
|
|
2791
|
+
error: o[m.id] ?? null,
|
|
2792
|
+
onToggle: p,
|
|
2804
2793
|
onViewAgent: c
|
|
2805
2794
|
},
|
|
2806
|
-
|
|
2795
|
+
m.id
|
|
2807
2796
|
)) })
|
|
2808
2797
|
]
|
|
2809
2798
|
}
|
|
2810
|
-
), _t = (e, t) => t.get(e.agent_definition_ref) ?? e.agent_definition_ref.replace(/_/g, " "),
|
|
2799
|
+
), _t = (e, t) => t.get(e.agent_definition_ref) ?? e.agent_definition_ref.replace(/_/g, " "), fs = ({
|
|
2811
2800
|
jwt: e,
|
|
2812
2801
|
headers: t,
|
|
2813
2802
|
agentDefinitionsUrl: n,
|
|
@@ -2815,18 +2804,18 @@ const Zt = (e, t) => (n) => {
|
|
|
2815
2804
|
agentUrl: r,
|
|
2816
2805
|
agentChecklistUrl: o,
|
|
2817
2806
|
agentResourcesUrl: i,
|
|
2818
|
-
agentTimelineUrl:
|
|
2807
|
+
agentTimelineUrl: p,
|
|
2819
2808
|
agentChatUrl: c,
|
|
2820
2809
|
agentConversationUrl: g,
|
|
2821
|
-
stopAgentUrl:
|
|
2810
|
+
stopAgentUrl: m,
|
|
2822
2811
|
enableUpload: N,
|
|
2823
2812
|
showHeader: y = !1,
|
|
2824
2813
|
institutions: I,
|
|
2825
|
-
usePusherToRepoll:
|
|
2826
|
-
pusherChannelPrefix: f =
|
|
2814
|
+
usePusherToRepoll: O = !1,
|
|
2815
|
+
pusherChannelPrefix: f = Zt,
|
|
2827
2816
|
subscribeToPusher: K
|
|
2828
2817
|
}) => {
|
|
2829
|
-
var
|
|
2818
|
+
var Pe;
|
|
2830
2819
|
const T = Y(
|
|
2831
2820
|
() => ({
|
|
2832
2821
|
agentDefinitions: n,
|
|
@@ -2834,7 +2823,7 @@ const Zt = (e, t) => (n) => {
|
|
|
2834
2823
|
agent: r,
|
|
2835
2824
|
agentChecklist: o,
|
|
2836
2825
|
...i ? { agentResources: i } : {},
|
|
2837
|
-
...
|
|
2826
|
+
...p ? { agentTimeline: p } : {},
|
|
2838
2827
|
agentChat: c,
|
|
2839
2828
|
agentConversation: g
|
|
2840
2829
|
}),
|
|
@@ -2844,56 +2833,56 @@ const Zt = (e, t) => (n) => {
|
|
|
2844
2833
|
r,
|
|
2845
2834
|
o,
|
|
2846
2835
|
i,
|
|
2847
|
-
|
|
2836
|
+
p,
|
|
2848
2837
|
c,
|
|
2849
2838
|
g
|
|
2850
2839
|
]
|
|
2851
|
-
), [
|
|
2852
|
-
(
|
|
2853
|
-
)) == null ? void 0 :
|
|
2854
|
-
const
|
|
2855
|
-
return
|
|
2856
|
-
}, [t,
|
|
2840
|
+
), [P, A] = h(null), _ = P ? (Pe = I == null ? void 0 : I.find(
|
|
2841
|
+
(u) => u.applicationId === P.application_id
|
|
2842
|
+
)) == null ? void 0 : Pe.applicationUrl : void 0, S = Y(() => {
|
|
2843
|
+
const u = { ...t ?? {} };
|
|
2844
|
+
return _ ? u[we.arborApplicationUrl] = _ : delete u[we.arborApplicationUrl], u;
|
|
2845
|
+
}, [t, _]), {
|
|
2857
2846
|
agents: v,
|
|
2858
2847
|
agentDefinitions: R,
|
|
2859
2848
|
loadState: z,
|
|
2860
|
-
loadError:
|
|
2861
|
-
reload:
|
|
2849
|
+
loadError: Ce,
|
|
2850
|
+
reload: L,
|
|
2862
2851
|
refresh: G,
|
|
2863
2852
|
fetchAgentChecklist: q,
|
|
2864
2853
|
createAgent: X
|
|
2865
|
-
} =
|
|
2866
|
-
const
|
|
2854
|
+
} = ja({ jwt: e, headers: S, urls: T }), [Z, D] = h(!1), [x, ae] = h(null), [Ee, He] = h(null), [j, ze] = h({}), [ye, Te] = h({}), [ke, at] = h([]), [ce, st] = h([]), Re = Y(() => {
|
|
2855
|
+
const u = new Set(v.map((k) => k.application_id)), b = new Map(
|
|
2867
2856
|
(I ?? []).map((k) => [k.applicationId, k.name])
|
|
2868
2857
|
);
|
|
2869
|
-
return [...
|
|
2870
|
-
(k, V) => (
|
|
2858
|
+
return [...u].sort(
|
|
2859
|
+
(k, V) => (b.get(k) ?? k).localeCompare(b.get(V) ?? V)
|
|
2871
2860
|
).map((k) => ({
|
|
2872
2861
|
value: k,
|
|
2873
|
-
label:
|
|
2862
|
+
label: b.get(k) ?? k
|
|
2874
2863
|
}));
|
|
2875
2864
|
}, [v, I]), pe = Y(
|
|
2876
|
-
() => new Map(R.map((
|
|
2865
|
+
() => new Map(R.map((u) => [u.ref, u.display_name])),
|
|
2877
2866
|
[R]
|
|
2878
|
-
),
|
|
2879
|
-
v.map((
|
|
2880
|
-
)].sort((
|
|
2881
|
-
value:
|
|
2882
|
-
label:
|
|
2883
|
-
})), [v, pe]),
|
|
2867
|
+
), Ie = Y(() => [...new Set(
|
|
2868
|
+
v.map((b) => _t(b, pe))
|
|
2869
|
+
)].sort((b, k) => b.localeCompare(k)).map((b) => ({
|
|
2870
|
+
value: b,
|
|
2871
|
+
label: b
|
|
2872
|
+
})), [v, pe]), Ge = Y(() => v.filter((u) => !(ke.length > 0 && !ke.includes(u.application_id) || ce.length > 0 && !ce.includes(_t(u, pe)))), [v, pe, ce, ke]), Ne = Re.length > 1, Fe = Ie.length > 1, Be = Ne || Fe;
|
|
2884
2873
|
H(() => {
|
|
2885
|
-
const
|
|
2874
|
+
const u = window.setInterval(() => {
|
|
2886
2875
|
G();
|
|
2887
2876
|
}, 6e4);
|
|
2888
2877
|
return () => {
|
|
2889
|
-
window.clearInterval(
|
|
2878
|
+
window.clearInterval(u);
|
|
2890
2879
|
};
|
|
2891
2880
|
}, [G]), H(() => {
|
|
2892
2881
|
if (v.length === 0)
|
|
2893
2882
|
return;
|
|
2894
|
-
let
|
|
2883
|
+
let u = !1;
|
|
2895
2884
|
return (async () => {
|
|
2896
|
-
const
|
|
2885
|
+
const b = await Promise.allSettled(
|
|
2897
2886
|
v.map(async (k) => {
|
|
2898
2887
|
const V = await q(k.invocation_id);
|
|
2899
2888
|
return {
|
|
@@ -2903,93 +2892,93 @@ const Zt = (e, t) => (n) => {
|
|
|
2903
2892
|
};
|
|
2904
2893
|
})
|
|
2905
2894
|
);
|
|
2906
|
-
|
|
2895
|
+
u || (ze((k) => {
|
|
2907
2896
|
const V = { ...k };
|
|
2908
2897
|
let se = !1;
|
|
2909
|
-
for (const re of
|
|
2898
|
+
for (const re of b) {
|
|
2910
2899
|
if (re.status !== "fulfilled")
|
|
2911
2900
|
continue;
|
|
2912
|
-
const { invocationId: me, checklist:
|
|
2913
|
-
JSON.stringify(k[me]) !== JSON.stringify(
|
|
2901
|
+
const { invocationId: me, checklist: xe } = re.value;
|
|
2902
|
+
JSON.stringify(k[me]) !== JSON.stringify(xe) && (V[me] = xe, se = !0);
|
|
2914
2903
|
}
|
|
2915
2904
|
return se ? V : k;
|
|
2916
|
-
}),
|
|
2905
|
+
}), Te((k) => {
|
|
2917
2906
|
const V = { ...k };
|
|
2918
2907
|
let se = !1;
|
|
2919
|
-
return
|
|
2920
|
-
re.status === "rejected" && V[v[me].id] !==
|
|
2908
|
+
return b.forEach((re, me) => {
|
|
2909
|
+
re.status === "rejected" && V[v[me].id] !== Ze && (V[v[me].id] = Ze, se = !0);
|
|
2921
2910
|
}), se ? V : k;
|
|
2922
2911
|
}));
|
|
2923
2912
|
})(), () => {
|
|
2924
|
-
|
|
2913
|
+
u = !0;
|
|
2925
2914
|
};
|
|
2926
2915
|
}, [v, q]);
|
|
2927
|
-
const
|
|
2928
|
-
async (
|
|
2929
|
-
if (!j[
|
|
2930
|
-
|
|
2931
|
-
const k = { ...
|
|
2932
|
-
return delete k[
|
|
2916
|
+
const qe = C(
|
|
2917
|
+
async (u) => {
|
|
2918
|
+
if (!j[u.invocation_id]) {
|
|
2919
|
+
He(u.id), Te((b) => {
|
|
2920
|
+
const k = { ...b };
|
|
2921
|
+
return delete k[u.id], k;
|
|
2933
2922
|
});
|
|
2934
2923
|
try {
|
|
2935
|
-
const
|
|
2936
|
-
|
|
2924
|
+
const b = await q(u.invocation_id);
|
|
2925
|
+
ze((k) => ({
|
|
2937
2926
|
...k,
|
|
2938
|
-
[
|
|
2927
|
+
[u.invocation_id]: b.checklist
|
|
2939
2928
|
}));
|
|
2940
2929
|
} catch {
|
|
2941
|
-
|
|
2942
|
-
...
|
|
2943
|
-
[
|
|
2930
|
+
Te((b) => ({
|
|
2931
|
+
...b,
|
|
2932
|
+
[u.id]: Ze
|
|
2944
2933
|
}));
|
|
2945
2934
|
} finally {
|
|
2946
|
-
|
|
2935
|
+
He((b) => b === u.id ? null : b);
|
|
2947
2936
|
}
|
|
2948
2937
|
}
|
|
2949
2938
|
},
|
|
2950
2939
|
[q, j]
|
|
2951
|
-
),
|
|
2952
|
-
(
|
|
2953
|
-
if (x ===
|
|
2940
|
+
), Oe = C(
|
|
2941
|
+
(u) => {
|
|
2942
|
+
if (x === u) {
|
|
2954
2943
|
ae(null);
|
|
2955
2944
|
return;
|
|
2956
2945
|
}
|
|
2957
|
-
const
|
|
2958
|
-
|
|
2946
|
+
const b = v.find(({ id: k }) => k === u);
|
|
2947
|
+
b && (ae(u), qe(b));
|
|
2959
2948
|
},
|
|
2960
|
-
[v, x,
|
|
2961
|
-
),
|
|
2962
|
-
const
|
|
2963
|
-
for (const
|
|
2964
|
-
const k =
|
|
2965
|
-
|
|
2966
|
-
j[
|
|
2949
|
+
[v, x, qe]
|
|
2950
|
+
), Je = Y(() => {
|
|
2951
|
+
const u = {};
|
|
2952
|
+
for (const b of Ge) {
|
|
2953
|
+
const k = ls(
|
|
2954
|
+
b,
|
|
2955
|
+
j[b.invocation_id]
|
|
2967
2956
|
);
|
|
2968
|
-
(
|
|
2957
|
+
(u[k] ?? (u[k] = [])).push(b);
|
|
2969
2958
|
}
|
|
2970
|
-
return
|
|
2971
|
-
}, [
|
|
2972
|
-
A(
|
|
2959
|
+
return u;
|
|
2960
|
+
}, [Ge, j]), Le = C((u) => {
|
|
2961
|
+
A(u);
|
|
2973
2962
|
}, []), rt = C(
|
|
2974
|
-
async (
|
|
2975
|
-
const
|
|
2976
|
-
A(
|
|
2963
|
+
async (u) => {
|
|
2964
|
+
const b = await X(u);
|
|
2965
|
+
A(b), D(!1);
|
|
2977
2966
|
},
|
|
2978
2967
|
[X]
|
|
2979
|
-
),
|
|
2968
|
+
), Ue = C(() => {
|
|
2980
2969
|
A(null);
|
|
2981
2970
|
}, []), de = {
|
|
2982
2971
|
expandedAgentId: x,
|
|
2983
|
-
loadingAgentId:
|
|
2972
|
+
loadingAgentId: Ee,
|
|
2984
2973
|
checklistByInvocationId: j,
|
|
2985
2974
|
errorByAgentId: ye,
|
|
2986
2975
|
definitionNameByRef: pe,
|
|
2987
|
-
onToggleAgent:
|
|
2988
|
-
onViewAgent:
|
|
2976
|
+
onToggleAgent: Oe,
|
|
2977
|
+
onViewAgent: Le
|
|
2989
2978
|
};
|
|
2990
2979
|
return /* @__PURE__ */ l("div", { className: "agent-view-frontend agent-view", children: [
|
|
2991
2980
|
y && /* @__PURE__ */ l("div", { className: "agent-view__header", children: [
|
|
2992
|
-
/* @__PURE__ */ a(
|
|
2981
|
+
/* @__PURE__ */ a(be, { level: 1, children: "Agents" }),
|
|
2993
2982
|
/* @__PURE__ */ a(
|
|
2994
2983
|
te,
|
|
2995
2984
|
{
|
|
@@ -3002,7 +2991,7 @@ const Zt = (e, t) => (n) => {
|
|
|
3002
2991
|
}
|
|
3003
2992
|
)
|
|
3004
2993
|
] }),
|
|
3005
|
-
v.length > 0 &&
|
|
2994
|
+
v.length > 0 && Be && /* @__PURE__ */ l("div", { className: "agent-view__filters", children: [
|
|
3006
2995
|
Ne && /* @__PURE__ */ l("div", { className: "agent-view__filter", children: [
|
|
3007
2996
|
/* @__PURE__ */ a(
|
|
3008
2997
|
"label",
|
|
@@ -3013,14 +3002,14 @@ const Zt = (e, t) => (n) => {
|
|
|
3013
3002
|
}
|
|
3014
3003
|
),
|
|
3015
3004
|
/* @__PURE__ */ a(
|
|
3016
|
-
|
|
3005
|
+
Tt,
|
|
3017
3006
|
{
|
|
3018
3007
|
id: "agent-view-institution-filter",
|
|
3019
3008
|
triggerVariant: "button",
|
|
3020
3009
|
multiple: !0,
|
|
3021
3010
|
searchType: "substring",
|
|
3022
3011
|
placeholder: "All institutions",
|
|
3023
|
-
options:
|
|
3012
|
+
options: Re,
|
|
3024
3013
|
value: ke,
|
|
3025
3014
|
onValueChange: at,
|
|
3026
3015
|
showSelectionCountBadge: !0,
|
|
@@ -3029,17 +3018,17 @@ const Zt = (e, t) => (n) => {
|
|
|
3029
3018
|
}
|
|
3030
3019
|
)
|
|
3031
3020
|
] }),
|
|
3032
|
-
|
|
3021
|
+
Fe && /* @__PURE__ */ l("div", { className: "agent-view__filter", children: [
|
|
3033
3022
|
/* @__PURE__ */ a("label", { className: "agent-view__filter-label", htmlFor: "agent-view-agent-filter", children: "Agent" }),
|
|
3034
3023
|
/* @__PURE__ */ a(
|
|
3035
|
-
|
|
3024
|
+
Tt,
|
|
3036
3025
|
{
|
|
3037
3026
|
id: "agent-view-agent-filter",
|
|
3038
3027
|
triggerVariant: "button",
|
|
3039
3028
|
multiple: !0,
|
|
3040
3029
|
searchType: "substring",
|
|
3041
3030
|
placeholder: "All agents",
|
|
3042
|
-
options:
|
|
3031
|
+
options: Ie,
|
|
3043
3032
|
value: ce,
|
|
3044
3033
|
onValueChange: st,
|
|
3045
3034
|
showSelectionCountBadge: !0,
|
|
@@ -3050,68 +3039,68 @@ const Zt = (e, t) => (n) => {
|
|
|
3050
3039
|
] })
|
|
3051
3040
|
] }),
|
|
3052
3041
|
z === "error" ? /* @__PURE__ */ l("div", { className: "agent-view__state agent-view__state--error", role: "alert", children: [
|
|
3053
|
-
/* @__PURE__ */ a(
|
|
3054
|
-
/* @__PURE__ */ a("p", { className: "agent-view__state-message", children:
|
|
3055
|
-
/* @__PURE__ */ a(te, { variant: "secondary", size: "S", onClick:
|
|
3042
|
+
/* @__PURE__ */ a(U, { name: "triangle-alert", size: 24, color: "var(--color-semantic-destructive-600)" }),
|
|
3043
|
+
/* @__PURE__ */ a("p", { className: "agent-view__state-message", children: Ce ?? jt }),
|
|
3044
|
+
/* @__PURE__ */ a(te, { variant: "secondary", size: "S", onClick: L, children: "Try again" })
|
|
3056
3045
|
] }) : z === "loading" && v.length === 0 ? /* @__PURE__ */ l("div", { className: "agent-view__state", "aria-live": "polite", children: [
|
|
3057
3046
|
/* @__PURE__ */ a(
|
|
3058
|
-
|
|
3047
|
+
U,
|
|
3059
3048
|
{
|
|
3060
3049
|
name: "loader",
|
|
3061
3050
|
size: 24,
|
|
3062
3051
|
color: "var(--color-brand-600)",
|
|
3063
3052
|
className: "agent-view__progress-icon--spinning",
|
|
3064
|
-
screenReaderText:
|
|
3053
|
+
screenReaderText: It
|
|
3065
3054
|
}
|
|
3066
3055
|
),
|
|
3067
|
-
/* @__PURE__ */ a("p", { className: "agent-view__state-message", children:
|
|
3068
|
-
] }) : v.length === 0 ? /* @__PURE__ */ a(
|
|
3069
|
-
|
|
3070
|
-
|
|
3056
|
+
/* @__PURE__ */ a("p", { className: "agent-view__state-message", children: It })
|
|
3057
|
+
] }) : v.length === 0 ? /* @__PURE__ */ a(Gn, {}) : /* @__PURE__ */ l("div", { className: "agent-view__board", children: [
|
|
3058
|
+
En.map((u) => /* @__PURE__ */ a(
|
|
3059
|
+
Bt,
|
|
3071
3060
|
{
|
|
3072
|
-
column:
|
|
3073
|
-
agents:
|
|
3061
|
+
column: Qe[u],
|
|
3062
|
+
agents: Je[u] ?? [],
|
|
3074
3063
|
...de
|
|
3075
3064
|
},
|
|
3076
|
-
|
|
3065
|
+
u
|
|
3077
3066
|
)),
|
|
3078
|
-
/* @__PURE__ */ a("div", { className: "agent-view__split-column", children:
|
|
3079
|
-
|
|
3067
|
+
/* @__PURE__ */ a("div", { className: "agent-view__split-column", children: Tn.map((u) => /* @__PURE__ */ a(
|
|
3068
|
+
Bt,
|
|
3080
3069
|
{
|
|
3081
|
-
column:
|
|
3082
|
-
agents:
|
|
3070
|
+
column: Qe[u],
|
|
3071
|
+
agents: Je[u] ?? [],
|
|
3083
3072
|
isSplit: !0,
|
|
3084
3073
|
...de
|
|
3085
3074
|
},
|
|
3086
|
-
|
|
3075
|
+
u
|
|
3087
3076
|
)) })
|
|
3088
3077
|
] }),
|
|
3089
|
-
|
|
3090
|
-
|
|
3078
|
+
P && /* @__PURE__ */ a(
|
|
3079
|
+
ts,
|
|
3091
3080
|
{
|
|
3092
|
-
agent:
|
|
3093
|
-
invocationId:
|
|
3081
|
+
agent: P,
|
|
3082
|
+
invocationId: P.invocation_id,
|
|
3094
3083
|
open: !0,
|
|
3095
3084
|
jwt: e,
|
|
3096
|
-
headers:
|
|
3085
|
+
headers: S,
|
|
3097
3086
|
agentUrl: r,
|
|
3098
3087
|
agentChecklistUrl: o,
|
|
3099
3088
|
agentResourcesUrl: i,
|
|
3100
|
-
agentTimelineUrl:
|
|
3089
|
+
agentTimelineUrl: p,
|
|
3101
3090
|
agentChatUrl: c,
|
|
3102
3091
|
agentConversationUrl: g,
|
|
3103
|
-
stopAgentUrl:
|
|
3092
|
+
stopAgentUrl: m,
|
|
3104
3093
|
enableUpload: N,
|
|
3105
|
-
initialChecklist: j[
|
|
3106
|
-
usePusherToRepoll:
|
|
3094
|
+
initialChecklist: j[P.invocation_id] ?? null,
|
|
3095
|
+
usePusherToRepoll: O,
|
|
3107
3096
|
pusherChannelPrefix: f,
|
|
3108
3097
|
subscribeToPusher: K,
|
|
3109
|
-
onClose:
|
|
3098
|
+
onClose: Ue
|
|
3110
3099
|
},
|
|
3111
|
-
|
|
3100
|
+
P.id
|
|
3112
3101
|
),
|
|
3113
3102
|
/* @__PURE__ */ a(
|
|
3114
|
-
|
|
3103
|
+
is,
|
|
3115
3104
|
{
|
|
3116
3105
|
open: Z,
|
|
3117
3106
|
onClose: () => D(!1),
|
|
@@ -3120,7 +3109,7 @@ const Zt = (e, t) => (n) => {
|
|
|
3120
3109
|
}
|
|
3121
3110
|
)
|
|
3122
3111
|
] });
|
|
3123
|
-
},
|
|
3112
|
+
}, vs = (e, t) => {
|
|
3124
3113
|
const n = Date.now(), s = t.trim() || e.agent_intent;
|
|
3125
3114
|
return {
|
|
3126
3115
|
id: `agent-${n}`,
|
|
@@ -3128,43 +3117,43 @@ const Zt = (e, t) => (n) => {
|
|
|
3128
3117
|
agent_definition_ref: e.ref,
|
|
3129
3118
|
agent_intent: e.agent_intent,
|
|
3130
3119
|
invocation_name: s,
|
|
3131
|
-
application_id:
|
|
3132
|
-
created_by:
|
|
3120
|
+
application_id: Rn,
|
|
3121
|
+
created_by: In,
|
|
3133
3122
|
status: E["generating-a-response"],
|
|
3134
3123
|
context_ref: null,
|
|
3135
3124
|
checklist_ref: null
|
|
3136
3125
|
};
|
|
3137
3126
|
};
|
|
3138
3127
|
export {
|
|
3139
|
-
|
|
3128
|
+
fs as AgentMonitorKanban,
|
|
3140
3129
|
ft as AgentServiceClient,
|
|
3141
3130
|
$e as AgentServiceError,
|
|
3142
|
-
|
|
3143
|
-
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
|
|
3147
|
-
|
|
3131
|
+
ts as AgentView,
|
|
3132
|
+
Zt as DEFAULT_PUSHER_CHANNEL_PREFIX,
|
|
3133
|
+
Ja as HttpChatConnector,
|
|
3134
|
+
Dt as MESSAGE_TYPE_REPOLL,
|
|
3135
|
+
is as NewAgentModal,
|
|
3136
|
+
ua as PUSHER_AGENT_MESSAGE_EVENT,
|
|
3148
3137
|
ve as REPOLL_TARGET,
|
|
3149
|
-
|
|
3150
|
-
|
|
3151
|
-
|
|
3152
|
-
|
|
3153
|
-
|
|
3154
|
-
|
|
3155
|
-
|
|
3156
|
-
|
|
3157
|
-
|
|
3158
|
-
|
|
3159
|
-
|
|
3160
|
-
|
|
3161
|
-
|
|
3138
|
+
vs as buildAgentFromDefinition,
|
|
3139
|
+
ma as buildAgentPusherChannel,
|
|
3140
|
+
nn as createHttpChatConnectorFactory,
|
|
3141
|
+
Pa as formatUserFileChatCardText,
|
|
3142
|
+
$t as mapApiAgent,
|
|
3143
|
+
Qt as mapApiAgentDefinition,
|
|
3144
|
+
Sa as mapApiAgentStatus,
|
|
3145
|
+
Ia as mapApiAgentTimelineResponse,
|
|
3146
|
+
tn as mapApiChecklistEndpointResponse,
|
|
3147
|
+
en as mapApiChecklistItem,
|
|
3148
|
+
La as mapApiChecklistResponse,
|
|
3149
|
+
ba as mapApiChecklistStatus,
|
|
3150
|
+
xa as mapApiConversationMessages,
|
|
3162
3151
|
nt as mapApiOpeningMessage,
|
|
3163
|
-
|
|
3164
|
-
|
|
3165
|
-
|
|
3166
|
-
|
|
3167
|
-
|
|
3168
|
-
|
|
3169
|
-
|
|
3152
|
+
Ta as mapApiResource,
|
|
3153
|
+
Ra as mapApiResourcesEndpointResponse,
|
|
3154
|
+
_s as mapApiTripOption,
|
|
3155
|
+
Ua as parseConversationContentCaption,
|
|
3156
|
+
va as parseRepollMessages,
|
|
3157
|
+
ja as useAgentService,
|
|
3158
|
+
Ya as useAgentWorkspace
|
|
3170
3159
|
};
|