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