@arbor-education/agent-view-frontend 0.4.11-alpha.2 → 0.5.0

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