@arbor-education/agent-view-frontend 0.4.6-alpha.0 → 0.4.7

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