@arbor-education/agent-view-frontend 0.5.0 → 0.5.1

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