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

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,134 +1,134 @@
1
- import { jsxs as c, jsx as n, Fragment as de } from "react/jsx-runtime";
2
- import { useRef as te, useState as g, useLayoutEffect as gn, useEffect as L, useId as Pe, useMemo as Q, useCallback as f } from "react";
3
- import ne from "classnames";
4
- import { Heading as Xe, Icon as $, Dot as da, Modal as F, Button as G, Tabs as _t, SlideoverUtils as on, SlideoverManager as Za, EditableText as Qa, SelectDropdown as es, TextInput as ts, Combobox as Vn, Card as ns, Skeleton as as } from "@arbor-education/design-system.components";
5
- import { CHAT_RESPONSE_TYPE_AGENT as ua, CHAT_RESPONSE_TYPE_ERROR as ss, ChatPanel as rs, CHAT_RESPONSE_TYPE_USER as is, CHAT_RESPONSE_TYPE_INFO as ls, thinkingPhrasesFromToolCalls as os } from "@arbor-education/ask-arbor-chat-panel";
1
+ import { jsxs as d, jsx as n, Fragment as he } from "react/jsx-runtime";
2
+ import { useRef as Q, useState as g, useLayoutEffect as un, useEffect as L, useId as Le, useMemo as Z, useCallback as f } from "react";
3
+ import ee from "classnames";
4
+ import { Heading as We, Icon as $, Dot as ua, Modal as F, Button as z, Tabs as _t, SlideoverUtils as rn, SlideoverManager as Qa, EditableText as es, SelectDropdown as ts, TextInput as ns, Combobox as Vn, Card as as, Skeleton as ss } from "@arbor-education/design-system.components";
5
+ import { CHAT_RESPONSE_TYPE_ERROR as Yn, CHAT_RESPONSE_TYPE_AGENT as ha, ChatPanel as rs, CHAT_RESPONSE_TYPE_USER as is, CHAT_RESPONSE_TYPE_INFO as ls, thinkingPhrasesFromToolCalls as os } from "@arbor-education/ask-arbor-chat-panel";
6
6
  import cs from "pusher-js";
7
- const E = {
7
+ const b = {
8
8
  "generating-a-response": "generating-a-response",
9
9
  hitl: "hitl",
10
10
  paused: "paused",
11
11
  complete: "complete"
12
- }, H = {
12
+ }, B = {
13
13
  "generating-a-response": "generating-a-response",
14
14
  to_do: "to_do",
15
15
  hitl: "hitl",
16
16
  complete: "complete",
17
17
  failed: "failed"
18
- }, Y = {
18
+ }, V = {
19
19
  briefing: "briefing",
20
20
  running: "running",
21
21
  paused: "paused",
22
22
  complete: "complete"
23
- }, ve = {
23
+ }, ye = {
24
24
  agent: "agent",
25
25
  user: "user",
26
26
  system: "system"
27
- }, Ie = {
27
+ }, Oe = {
28
28
  document_html: "document_html",
29
29
  mis_record: "mis_record",
30
30
  workflow: "workflow",
31
31
  file: "file",
32
32
  user_file: "user_file",
33
33
  link: "link"
34
- }, ha = {
34
+ }, ga = {
35
35
  user_file: "user_file"
36
36
  }, Cn = {
37
37
  active: "active",
38
38
  complete: "complete",
39
39
  paused: "paused"
40
- }, Ut = {
40
+ }, Bt = {
41
41
  in_progress: "in_progress",
42
42
  to_do: "to_do",
43
43
  requires_attention: "requires_attention",
44
44
  waiting_on_human: "waiting_on_human",
45
45
  available: "available"
46
- }, Le = {
47
- [H.complete]: {
46
+ }, Ie = {
47
+ [B.complete]: {
48
48
  label: "Complete",
49
49
  icon: "circle-check",
50
50
  color: "var(--color-semantic-success-600)"
51
51
  },
52
- [H.failed]: {
52
+ [B.failed]: {
53
53
  label: "Failed",
54
54
  icon: "circle-x",
55
55
  color: "var(--color-semantic-destructive-600)"
56
56
  },
57
- [H.hitl]: {
57
+ [B.hitl]: {
58
58
  label: "Requires attention",
59
59
  icon: "triangle-alert",
60
60
  color: "var(--color-semantic-warning-600)"
61
61
  },
62
- [H["generating-a-response"]]: {
62
+ [B["generating-a-response"]]: {
63
63
  label: "In progress",
64
64
  icon: "loader",
65
65
  color: "var(--color-brand-600)",
66
66
  spin: !0
67
67
  },
68
- [H.to_do]: {
68
+ [B.to_do]: {
69
69
  label: "To do",
70
70
  color: "var(--color-brand-600)"
71
71
  }
72
- }, ga = "var(--color-grey-600)", pt = {
73
- [E["generating-a-response"]]: {
74
- status: E["generating-a-response"],
72
+ }, ma = "var(--color-grey-600)", pt = {
73
+ [b["generating-a-response"]]: {
74
+ status: b["generating-a-response"],
75
75
  title: "Active",
76
76
  dotColour: "green",
77
77
  statusIcon: {
78
78
  name: "sparkles",
79
- color: Le["generating-a-response"].color
79
+ color: Ie["generating-a-response"].color
80
80
  }
81
81
  },
82
- [E.hitl]: {
83
- status: E.hitl,
82
+ [b.hitl]: {
83
+ status: b.hitl,
84
84
  title: "Requires attention",
85
85
  dotColour: "orange",
86
86
  statusIcon: {
87
- name: Le.hitl.icon,
88
- color: Le.hitl.color
87
+ name: Ie.hitl.icon,
88
+ color: Ie.hitl.color
89
89
  }
90
90
  },
91
- [E.paused]: {
92
- status: E.paused,
91
+ [b.paused]: {
92
+ status: b.paused,
93
93
  title: "Paused",
94
94
  dotColour: "green",
95
95
  statusIcon: {
96
96
  name: "circle-x",
97
- color: ga
97
+ color: ma
98
98
  }
99
99
  },
100
- [E.complete]: {
101
- status: E.complete,
100
+ [b.complete]: {
101
+ status: b.complete,
102
102
  title: "Complete",
103
103
  dotColour: "green",
104
104
  dotModifier: "grey-dark",
105
105
  statusIcon: {
106
- name: Le.complete.icon,
107
- color: Le.complete.color
106
+ name: Ie.complete.icon,
107
+ color: Ie.complete.color
108
108
  }
109
109
  }
110
110
  }, ds = {
111
111
  name: "archive",
112
- color: ga
113
- }, Yn = [
114
- E["generating-a-response"],
115
- E.hitl,
116
- E.complete
117
- ], us = "m4", hs = "1", ma = "msg-opening", dn = "Unable to load agent tasks. Please try again.", gs = "Unable to load context.", ms = "Unable to load the resources for this agent", _s = "Unable to load this document. Please try again.", _a = "Unable to load the timeline for this agent", ps = "Unable to pause the agent. Please try again.", Ln = "Unable to archive the agent. Please try again.", fs = "Archive this agent?", vs = "Archiving files this agent away and stops its work. You can restore it later as paused; it will not run until you resume it. Chat is not available while it is archived. You can still open it from Archived to view the timeline and resources.", ws = "This agent is still in progress.", Pn = "Unable to unarchive the agent. Please try again.", Ns = "Restore this agent?", ys = "Restoring returns this agent to the board as paused. It will not run chats or scheduled work until you resume it.", As = "Unable to delete the agent. Please try again.", ks = "You do not have permission to delete this agent.", bs = "This agent must be paused or archived before it can be deleted.", Es = "This agent could not be found. It may have already been deleted.", Cs = "Delete this agent?", Ts = "Deleting cannot be undone. This permanently removes the agent and its related data. It will not appear in Archived and cannot be restored.", Rs = "Unable to resume the agent. Please try again.", Ss = "The agent was resumed but could not be woken. Send a message to continue.", Jn = "You have been resumed after being paused. Reassess your current progress and continue your work from where you left off.", Os = "Unable to rename the agent. Please try again.", Is = "Something went wrong. Please try again.", pa = "Unable to load agents. Please try again.", Ls = "Agent not found", Ps = "Agent not found", gt = "Loading tasks…", Us = "Task", Ds = {
118
- [Y.briefing]: "Briefing",
119
- [Y.running]: "Working",
120
- [Y.paused]: "Paused",
121
- [Y.complete]: "Complete"
122
- }, fa = "all", xs = [
123
- E["generating-a-response"],
124
- E.hitl,
125
- E.complete
126
- ], Ms = {
127
- [E["generating-a-response"]]: "Agents currently working on tasks for you.",
128
- [E.hitl]: "Agents that need your input before they can continue.",
129
- [E.paused]: "Agents that are paused until you resume them.",
130
- [E.complete]: "Agents that have finished their work."
131
- }, $s = () => /* @__PURE__ */ c(
112
+ color: ma
113
+ }, Jn = [
114
+ b["generating-a-response"],
115
+ b.hitl,
116
+ b.complete
117
+ ], us = "m4", hs = "1", _a = "msg-opening", on = "Unable to load agent tasks. Please try again.", gs = "Unable to load context.", ms = "Unable to load the resources for this agent", _s = "Unable to load this document. Please try again.", pa = "Unable to load the timeline for this agent", ps = "Unable to pause the agent. Please try again.", Ln = "Unable to archive the agent. Please try again.", fs = "Archive this agent?", vs = "Archiving files this agent away and stops its work. You can restore it later as paused; it will not run until you resume it. Chat is not available while it is archived. You can still open it from Archived to view the timeline and resources.", ws = "This agent is still in progress.", Pn = "Unable to unarchive the agent. Please try again.", Ns = "Restore this agent?", ys = "Restoring returns this agent to the board as paused. It will not run chats or scheduled work until you resume it.", As = "Unable to delete the agent. Please try again.", ks = "You do not have permission to delete this agent.", Es = "This agent must be paused or archived before it can be deleted.", bs = "This agent could not be found. It may have already been deleted.", Cs = "Delete this agent?", Ts = "Deleting cannot be undone. This permanently removes the agent and its related data. It will not appear in Archived and cannot be restored.", Rs = "Unable to resume the agent. Please try again.", Ss = "The agent was resumed but could not be woken. Send a message to continue.", Wn = "You have been resumed after being paused. Reassess your current progress and continue your work from where you left off.", Os = "Unable to rename the agent. Please try again.", Is = "Something went wrong. Please try again.", Ls = "Unable to send the message. Please try again.", fa = "Unable to load agents. Please try again.", Ps = "Agent not found", Us = "Agent not found", gt = "Loading tasks…", Ds = "Task", xs = {
118
+ [V.briefing]: "Briefing",
119
+ [V.running]: "Working",
120
+ [V.paused]: "Paused",
121
+ [V.complete]: "Complete"
122
+ }, va = "all", Ms = [
123
+ b["generating-a-response"],
124
+ b.hitl,
125
+ b.complete
126
+ ], $s = {
127
+ [b["generating-a-response"]]: "Agents currently working on tasks for you.",
128
+ [b.hitl]: "Agents that need your input before they can continue.",
129
+ [b.paused]: "Agents that are paused until you resume them.",
130
+ [b.complete]: "Agents that have finished their work."
131
+ }, Hs = () => /* @__PURE__ */ d(
132
132
  "svg",
133
133
  {
134
134
  className: "agent-view__empty-illustration",
@@ -242,7 +242,7 @@ const E = {
242
242
  /* @__PURE__ */ n("circle", { cx: "256", cy: "70", r: "4", fill: "var(--color-grey-400)" })
243
243
  ]
244
244
  }
245
- ), Hs = ({ status: e }) => {
245
+ ), Bs = ({ status: e }) => {
246
246
  const t = pt[e];
247
247
  return t.statusIcon ? /* @__PURE__ */ n(
248
248
  $,
@@ -252,73 +252,73 @@ const E = {
252
252
  color: t.statusIcon.color,
253
253
  screenReaderText: t.title
254
254
  }
255
- ) : /* @__PURE__ */ n(da, { colour: t.dotColour, label: t.title });
256
- }, Bs = () => /* @__PURE__ */ c(
255
+ ) : /* @__PURE__ */ n(ua, { colour: t.dotColour, label: t.title });
256
+ }, Gs = () => /* @__PURE__ */ d(
257
257
  "section",
258
258
  {
259
259
  className: "agent-view__empty",
260
260
  "aria-label": "About the agents board",
261
261
  children: [
262
- /* @__PURE__ */ c("div", { className: "agent-view__empty-content", children: [
263
- /* @__PURE__ */ n(Xe, { level: 4, children: "Your agents board" }),
262
+ /* @__PURE__ */ d("div", { className: "agent-view__empty-content", children: [
263
+ /* @__PURE__ */ n(We, { level: 4, children: "Your agents board" }),
264
264
  /* @__PURE__ */ n("p", { className: "agent-view__empty-lead", children: "When you start an agent, it appears here so you can track progress at a glance. Agents move between columns as their status changes." }),
265
- /* @__PURE__ */ n("ul", { className: "agent-view__empty-columns", children: xs.map((e) => {
265
+ /* @__PURE__ */ n("ul", { className: "agent-view__empty-columns", children: Ms.map((e) => {
266
266
  const t = pt[e];
267
- return /* @__PURE__ */ c("li", { className: "agent-view__empty-column", children: [
268
- /* @__PURE__ */ n("span", { className: "agent-view__empty-column-indicator", children: /* @__PURE__ */ n(Hs, { status: e }) }),
269
- /* @__PURE__ */ c("span", { className: "agent-view__empty-column-text", children: [
267
+ return /* @__PURE__ */ d("li", { className: "agent-view__empty-column", children: [
268
+ /* @__PURE__ */ n("span", { className: "agent-view__empty-column-indicator", children: /* @__PURE__ */ n(Bs, { status: e }) }),
269
+ /* @__PURE__ */ d("span", { className: "agent-view__empty-column-text", children: [
270
270
  /* @__PURE__ */ n("span", { className: "agent-view__empty-column-title", children: t.title }),
271
- /* @__PURE__ */ n("span", { className: "agent-view__empty-column-description", children: Ms[e] })
271
+ /* @__PURE__ */ n("span", { className: "agent-view__empty-column-description", children: $s[e] })
272
272
  ] })
273
273
  ] }, e);
274
274
  }) }),
275
- /* @__PURE__ */ c("p", { className: "agent-view__empty-hint", children: [
275
+ /* @__PURE__ */ d("p", { className: "agent-view__empty-hint", children: [
276
276
  "Use ",
277
277
  /* @__PURE__ */ n("strong", { children: "Start an agent" }),
278
278
  " above to begin."
279
279
  ] })
280
280
  ] }),
281
- /* @__PURE__ */ n("div", { className: "agent-view__empty-visual", children: /* @__PURE__ */ n($s, {}) })
281
+ /* @__PURE__ */ n("div", { className: "agent-view__empty-visual", children: /* @__PURE__ */ n(Hs, {}) })
282
282
  ]
283
283
  }
284
- ), Gs = () => ({
284
+ ), zs = () => ({
285
285
  inProgress: [],
286
286
  needsInput: [],
287
287
  complete: [],
288
288
  failed: [],
289
289
  tasks: []
290
- }), zs = (e, t) => ({
290
+ }), Fs = (e, t) => ({
291
291
  ...e,
292
292
  children: t.length > 0 ? t : void 0
293
- }), va = (e) => {
293
+ }), wa = (e) => {
294
294
  const t = [], a = [], s = [], r = [], u = [];
295
295
  for (const i of e) {
296
- const m = i.children ? va(i.children) : Gs();
297
- if (t.push(...m.inProgress), a.push(...m.needsInput), s.push(...m.complete), r.push(...m.failed), i.status === H.hitl) {
296
+ const m = i.children ? wa(i.children) : zs();
297
+ if (t.push(...m.inProgress), a.push(...m.needsInput), s.push(...m.complete), r.push(...m.failed), i.status === B.hitl) {
298
298
  a.push({ ...i, children: void 0 });
299
299
  continue;
300
300
  }
301
- if (i.status === H.complete) {
301
+ if (i.status === B.complete) {
302
302
  s.push({ ...i, children: void 0 });
303
303
  continue;
304
304
  }
305
- if (i.status === H.failed) {
305
+ if (i.status === B.failed) {
306
306
  r.push({ ...i, children: void 0 });
307
307
  continue;
308
308
  }
309
- if (i.status === H["generating-a-response"]) {
309
+ if (i.status === B["generating-a-response"]) {
310
310
  t.push({ ...i, children: void 0 }), u.push(...m.tasks);
311
311
  continue;
312
312
  }
313
- u.push(zs(i, m.tasks));
313
+ u.push(Fs(i, m.tasks));
314
314
  }
315
315
  return { inProgress: t, needsInput: a, complete: s, failed: r, tasks: u };
316
- }, jn = (e) => e === H.hitl ? 0 : e === H.complete ? 1 : e === H.failed ? 2 : 3, Fs = (e) => e.map((t, a) => ({ item: t, index: a })).sort((t, a) => {
316
+ }, jn = (e) => e === B.hitl ? 0 : e === B.complete ? 1 : e === B.failed ? 2 : 3, qs = (e) => e.map((t, a) => ({ item: t, index: a })).sort((t, a) => {
317
317
  const s = jn(t.item.status) - jn(a.item.status);
318
318
  return s !== 0 ? s : t.index - a.index;
319
- }).map(({ item: t }) => t), wa = ({ status: e, className: t }) => {
320
- const a = Le[e];
321
- return e === H.to_do || !a.icon ? /* @__PURE__ */ c(de, { children: [
319
+ }).map(({ item: t }) => t), Na = ({ status: e, className: t }) => {
320
+ const a = Ie[e];
321
+ return e === B.to_do || !a.icon ? /* @__PURE__ */ d(he, { children: [
322
322
  /* @__PURE__ */ n(
323
323
  "svg",
324
324
  {
@@ -331,7 +331,7 @@ const E = {
331
331
  strokeWidth: 2,
332
332
  strokeLinecap: "round",
333
333
  strokeLinejoin: "round",
334
- className: ne("ds-icon", "ds-icon-circle", t),
334
+ className: ee("ds-icon", "ds-icon-circle", t),
335
335
  role: "img",
336
336
  "aria-hidden": !0,
337
337
  children: /* @__PURE__ */ n("circle", { cx: 12, cy: 12, r: 10 })
@@ -348,7 +348,7 @@ const E = {
348
348
  screenReaderText: `${a.label}:`
349
349
  }
350
350
  );
351
- }, Tn = 2, qs = (e) => {
351
+ }, Tn = 2, Ks = (e) => {
352
352
  if (!e)
353
353
  return { canScrollUp: !1, canScrollDown: !1 };
354
354
  const t = e.scrollHeight - e.clientHeight;
@@ -356,7 +356,7 @@ const E = {
356
356
  canScrollUp: e.scrollTop > Tn,
357
357
  canScrollDown: e.scrollTop < t - Tn
358
358
  };
359
- }, Ks = (e, t) => {
359
+ }, Vs = (e, t) => {
360
360
  if (!e || !t)
361
361
  return null;
362
362
  const a = e.getBoundingClientRect(), s = t.getBoundingClientRect();
@@ -366,7 +366,7 @@ const E = {
366
366
  width: s.width,
367
367
  height: s.height
368
368
  };
369
- }, mn = ({
369
+ }, hn = ({
370
370
  children: e,
371
371
  className: t,
372
372
  contentClassName: a,
@@ -374,22 +374,22 @@ const E = {
374
374
  style: r,
375
375
  "aria-label": u
376
376
  }) => {
377
- const i = te(null), m = te(null), [o, y] = g(!1), [p, k] = g(!1), [l, N] = g(null), S = () => {
377
+ const i = Q(null), m = Q(null), [o, y] = g(!1), [p, k] = g(!1), [l, N] = g(null), S = () => {
378
378
  var I;
379
379
  return s ? ((I = i.current) == null ? void 0 : I.querySelector(s)) ?? null : m.current;
380
380
  }, R = () => {
381
- const I = S(), A = qs(I);
381
+ const I = S(), A = Ks(I);
382
382
  if (y(
383
383
  (_) => _ === A.canScrollUp ? _ : A.canScrollUp
384
384
  ), k(
385
385
  (_) => _ === A.canScrollDown ? _ : A.canScrollDown
386
386
  ), s) {
387
- const _ = Ks(i.current, I);
387
+ const _ = Vs(i.current, I);
388
388
  N((v) => (v == null ? void 0 : v.top) === (_ == null ? void 0 : _.top) && (v == null ? void 0 : v.left) === (_ == null ? void 0 : _.left) && (v == null ? void 0 : v.width) === (_ == null ? void 0 : _.width) && (v == null ? void 0 : v.height) === (_ == null ? void 0 : _.height) ? v : _);
389
389
  } else
390
390
  N((_) => _ === null ? _ : null);
391
391
  };
392
- gn(() => {
392
+ un(() => {
393
393
  R();
394
394
  }), L(() => {
395
395
  const I = i.current;
@@ -398,27 +398,27 @@ const E = {
398
398
  let A = null, _ = null;
399
399
  const v = () => {
400
400
  A == null || A.removeEventListener("scroll", R), _ == null || _.disconnect(), _ = null, A = null;
401
- }, P = (ae) => {
402
- if (ae === A) {
401
+ }, P = (se) => {
402
+ if (se === A) {
403
403
  R();
404
404
  return;
405
405
  }
406
- if (v(), A = ae, !A) {
406
+ if (v(), A = se, !A) {
407
407
  R();
408
408
  return;
409
409
  }
410
410
  A.addEventListener("scroll", R, { passive: !0 }), _ = new ResizeObserver(() => R()), _.observe(A), A.firstElementChild instanceof HTMLElement && _.observe(A.firstElementChild), R();
411
411
  };
412
412
  P(S());
413
- const q = new MutationObserver(() => {
413
+ const G = new MutationObserver(() => {
414
414
  P(S());
415
415
  });
416
- return q.observe(I, {
416
+ return G.observe(I, {
417
417
  childList: !0,
418
418
  subtree: !0,
419
419
  characterData: !0
420
420
  }), window.addEventListener("resize", R), () => {
421
- window.removeEventListener("resize", R), q.disconnect(), v();
421
+ window.removeEventListener("resize", R), G.disconnect(), v();
422
422
  };
423
423
  }, [s]);
424
424
  const D = (I) => {
@@ -430,8 +430,8 @@ const E = {
430
430
  top: I === "up" ? -_ : _,
431
431
  behavior: "smooth"
432
432
  });
433
- }, x = /* @__PURE__ */ c(de, { children: [
434
- o && /* @__PURE__ */ c(de, { children: [
433
+ }, x = /* @__PURE__ */ d(he, { children: [
434
+ o && /* @__PURE__ */ d(he, { children: [
435
435
  /* @__PURE__ */ n("div", { className: "scrollable-region__fade scrollable-region__fade--top", "aria-hidden": "true" }),
436
436
  /* @__PURE__ */ n(
437
437
  "button",
@@ -444,7 +444,7 @@ const E = {
444
444
  }
445
445
  )
446
446
  ] }),
447
- p && /* @__PURE__ */ c(de, { children: [
447
+ p && /* @__PURE__ */ d(he, { children: [
448
448
  /* @__PURE__ */ n(
449
449
  "div",
450
450
  {
@@ -468,10 +468,10 @@ const E = {
468
468
  "div",
469
469
  {
470
470
  ref: i,
471
- className: ne("scrollable-region", t),
471
+ className: ee("scrollable-region", t),
472
472
  style: r,
473
473
  "aria-label": u,
474
- children: s ? /* @__PURE__ */ c(de, { children: [
474
+ children: s ? /* @__PURE__ */ d(he, { children: [
475
475
  e,
476
476
  l && (o || p) && /* @__PURE__ */ n(
477
477
  "div",
@@ -486,31 +486,31 @@ const E = {
486
486
  children: x
487
487
  }
488
488
  )
489
- ] }) : /* @__PURE__ */ c(de, { children: [
489
+ ] }) : /* @__PURE__ */ d(he, { children: [
490
490
  x,
491
491
  /* @__PURE__ */ n(
492
492
  "div",
493
493
  {
494
494
  ref: m,
495
- className: ne("scrollable-region__viewport", a),
495
+ className: ee("scrollable-region__viewport", a),
496
496
  children: e
497
497
  }
498
498
  )
499
499
  ] })
500
500
  }
501
501
  );
502
- }, Vs = 48, Ys = ({
502
+ }, Ys = 48, Js = ({
503
503
  checklist: e
504
504
  }) => {
505
- const t = te(null), a = te(!1);
506
- return gn(() => {
505
+ const t = Q(null), a = Q(!1);
506
+ return un(() => {
507
507
  const s = t.current;
508
508
  if (!s)
509
509
  return;
510
510
  const r = s.scrollHeight - s.scrollTop - s.clientHeight;
511
- (!a.current || r <= Vs) && (s.scrollTop = s.scrollHeight, a.current = !0);
511
+ (!a.current || r <= Ys) && (s.scrollTop = s.scrollHeight, a.current = !0);
512
512
  }, [e]), e.length === 0 ? /* @__PURE__ */ n("p", { className: "agent-view__progress-empty", children: "No tasks to display." }) : /* @__PURE__ */ n(
513
- mn,
513
+ hn,
514
514
  {
515
515
  className: "agent-view__progress-scroll",
516
516
  scrollSelector: ".agent-view__progress-list",
@@ -520,26 +520,26 @@ const E = {
520
520
  ref: t,
521
521
  className: "agent-view__progress-list",
522
522
  "aria-label": "Agent tasks",
523
- children: Fs(e).map((s) => {
524
- const r = Le[s.status];
525
- return /* @__PURE__ */ c(
523
+ children: qs(e).map((s) => {
524
+ const r = Ie[s.status];
525
+ return /* @__PURE__ */ d(
526
526
  "li",
527
527
  {
528
- className: ne(
528
+ className: ee(
529
529
  "agent-view__progress-item",
530
530
  `agent-view__progress-item--${s.status.replace(/_/g, "-")}`
531
531
  ),
532
532
  children: [
533
533
  /* @__PURE__ */ n(
534
- wa,
534
+ Na,
535
535
  {
536
536
  status: s.status,
537
537
  className: r.spin ? "agent-view__progress-icon--spinning" : void 0
538
538
  }
539
539
  ),
540
- /* @__PURE__ */ c("div", { className: "agent-view__progress-item-content", children: [
540
+ /* @__PURE__ */ d("div", { className: "agent-view__progress-item-content", children: [
541
541
  /* @__PURE__ */ n("span", { className: "agent-view__progress-label", children: s.task }),
542
- s.status !== H.complete && /* @__PURE__ */ n(
542
+ s.status !== B.complete && /* @__PURE__ */ n(
543
543
  "span",
544
544
  {
545
545
  className: "agent-view__progress-description",
@@ -556,7 +556,7 @@ const E = {
556
556
  )
557
557
  }
558
558
  );
559
- }, Na = ({
559
+ }, ya = ({
560
560
  open: e,
561
561
  isInProgress: t,
562
562
  isArchiving: a,
@@ -564,8 +564,8 @@ const E = {
564
564
  onCancel: r,
565
565
  onConfirm: u
566
566
  }) => {
567
- const i = Pe(), m = Pe();
568
- return /* @__PURE__ */ c(
567
+ const i = Le(), m = Le();
568
+ return /* @__PURE__ */ d(
569
569
  F,
570
570
  {
571
571
  open: e,
@@ -573,8 +573,8 @@ const E = {
573
573
  className: "archive-agent-confirm",
574
574
  children: [
575
575
  /* @__PURE__ */ n(F.Header, { className: "archive-agent-confirm__header", children: /* @__PURE__ */ n(F.Title, { id: i, children: fs }) }),
576
- /* @__PURE__ */ c(F.Body, { className: "archive-agent-confirm__body", children: [
577
- /* @__PURE__ */ c(
576
+ /* @__PURE__ */ d(F.Body, { className: "archive-agent-confirm__body", children: [
577
+ /* @__PURE__ */ d(
578
578
  "div",
579
579
  {
580
580
  role: "alertdialog",
@@ -587,9 +587,9 @@ const E = {
587
587
  ]
588
588
  }
589
589
  ),
590
- /* @__PURE__ */ c("div", { className: "archive-agent-confirm__actions", children: [
590
+ /* @__PURE__ */ d("div", { className: "archive-agent-confirm__actions", children: [
591
591
  /* @__PURE__ */ n(
592
- G,
592
+ z,
593
593
  {
594
594
  variant: "secondary",
595
595
  size: "S",
@@ -599,7 +599,7 @@ const E = {
599
599
  }
600
600
  ),
601
601
  /* @__PURE__ */ n(
602
- G,
602
+ z,
603
603
  {
604
604
  variant: "secondary-destructive",
605
605
  size: "S",
@@ -613,15 +613,15 @@ const E = {
613
613
  ]
614
614
  }
615
615
  );
616
- }, ya = ({
616
+ }, Aa = ({
617
617
  open: e,
618
618
  isDeleting: t,
619
619
  error: a,
620
620
  onCancel: s,
621
621
  onConfirm: r
622
622
  }) => {
623
- const u = Pe(), i = Pe();
624
- return /* @__PURE__ */ c(
623
+ const u = Le(), i = Le();
624
+ return /* @__PURE__ */ d(
625
625
  F,
626
626
  {
627
627
  open: e,
@@ -629,8 +629,8 @@ const E = {
629
629
  className: "archive-agent-confirm",
630
630
  children: [
631
631
  /* @__PURE__ */ n(F.Header, { className: "archive-agent-confirm__header", children: /* @__PURE__ */ n(F.Title, { id: u, children: Cs }) }),
632
- /* @__PURE__ */ c(F.Body, { className: "archive-agent-confirm__body", children: [
633
- /* @__PURE__ */ c(
632
+ /* @__PURE__ */ d(F.Body, { className: "archive-agent-confirm__body", children: [
633
+ /* @__PURE__ */ d(
634
634
  "div",
635
635
  {
636
636
  role: "alertdialog",
@@ -642,9 +642,9 @@ const E = {
642
642
  ]
643
643
  }
644
644
  ),
645
- /* @__PURE__ */ c("div", { className: "archive-agent-confirm__actions", children: [
645
+ /* @__PURE__ */ d("div", { className: "archive-agent-confirm__actions", children: [
646
646
  /* @__PURE__ */ n(
647
- G,
647
+ z,
648
648
  {
649
649
  variant: "secondary",
650
650
  size: "S",
@@ -654,7 +654,7 @@ const E = {
654
654
  }
655
655
  ),
656
656
  /* @__PURE__ */ n(
657
- G,
657
+ z,
658
658
  {
659
659
  variant: "secondary-destructive",
660
660
  size: "S",
@@ -668,15 +668,15 @@ const E = {
668
668
  ]
669
669
  }
670
670
  );
671
- }, Aa = ({
671
+ }, ka = ({
672
672
  open: e,
673
673
  isUnarchiving: t,
674
674
  error: a,
675
675
  onCancel: s,
676
676
  onConfirm: r
677
677
  }) => {
678
- const u = Pe(), i = Pe();
679
- return /* @__PURE__ */ c(
678
+ const u = Le(), i = Le();
679
+ return /* @__PURE__ */ d(
680
680
  F,
681
681
  {
682
682
  open: e,
@@ -684,8 +684,8 @@ const E = {
684
684
  className: "archive-agent-confirm",
685
685
  children: [
686
686
  /* @__PURE__ */ n(F.Header, { className: "archive-agent-confirm__header", children: /* @__PURE__ */ n(F.Title, { id: u, children: Ns }) }),
687
- /* @__PURE__ */ c(F.Body, { className: "archive-agent-confirm__body", children: [
688
- /* @__PURE__ */ c(
687
+ /* @__PURE__ */ d(F.Body, { className: "archive-agent-confirm__body", children: [
688
+ /* @__PURE__ */ d(
689
689
  "div",
690
690
  {
691
691
  role: "alertdialog",
@@ -697,9 +697,9 @@ const E = {
697
697
  ]
698
698
  }
699
699
  ),
700
- /* @__PURE__ */ c("div", { className: "archive-agent-confirm__actions", children: [
700
+ /* @__PURE__ */ d("div", { className: "archive-agent-confirm__actions", children: [
701
701
  /* @__PURE__ */ n(
702
- G,
702
+ z,
703
703
  {
704
704
  variant: "secondary",
705
705
  size: "S",
@@ -709,7 +709,7 @@ const E = {
709
709
  }
710
710
  ),
711
711
  /* @__PURE__ */ n(
712
- G,
712
+ z,
713
713
  {
714
714
  variant: "secondary",
715
715
  size: "S",
@@ -723,7 +723,7 @@ const E = {
723
723
  ]
724
724
  }
725
725
  );
726
- }, Js = (e) => e !== void 0 && e.some((t) => t.status === H.hitl), ka = (e) => e !== void 0 && e.length > 0 && e.every((t) => t.status === H.complete), Rn = (e, t) => e.status === E.paused ? ka(t) ? E.complete : E["generating-a-response"] : Js(t) ? E.hitl : e.status === E.complete ? E.complete : e.status === E.hitl ? E.hitl : E["generating-a-response"];
726
+ }, Ws = (e) => e !== void 0 && e.some((t) => t.status === B.hitl), Ea = (e) => e !== void 0 && e.length > 0 && e.every((t) => t.status === B.complete), Rn = (e, t) => e.status === b.paused ? Ea(t) ? b.complete : b["generating-a-response"] : Ws(t) ? b.hitl : e.status === b.complete ? b.complete : e.status === b.hitl ? b.hitl : b["generating-a-response"];
727
727
  class js {
728
728
  constructor(t, a) {
729
729
  this.connector = t, this.canSend = a.canSend, this.onTurn = a.onTurn, this.onAwaitingChange = a.onAwaitingChange;
@@ -746,7 +746,11 @@ class js {
746
746
  async sendMessage(t) {
747
747
  var a, s;
748
748
  if (!this.canSend())
749
- return null;
749
+ return {
750
+ id: `error-${Date.now()}`,
751
+ text: Ls,
752
+ type: Yn
753
+ };
750
754
  (a = this.onAwaitingChange) == null || a.call(this, !0);
751
755
  try {
752
756
  const r = await this.connector.sendMessage(
@@ -757,14 +761,14 @@ class js {
757
761
  return this.onTurn(r), {
758
762
  id: r.message.id,
759
763
  text: r.message.text,
760
- type: ua,
764
+ type: ha,
761
765
  ...r.message.followUpPrompts ? { followUpPrompts: r.message.followUpPrompts } : {}
762
766
  };
763
767
  } catch {
764
768
  return {
765
769
  id: `error-${Date.now()}`,
766
770
  text: Is,
767
- type: ss
771
+ type: Yn
768
772
  };
769
773
  } finally {
770
774
  (s = this.onAwaitingChange) == null || s.call(this, !1);
@@ -782,7 +786,7 @@ class js {
782
786
  return !1;
783
787
  }
784
788
  }
785
- const Ws = ({
789
+ const Xs = ({
786
790
  connector: e,
787
791
  phase: t,
788
792
  chatHistory: a,
@@ -792,17 +796,17 @@ const Ws = ({
792
796
  onTurn: i,
793
797
  onAwaitingChange: m
794
798
  }) => {
795
- const o = Q(
799
+ const o = Z(
796
800
  () => new js(e, {
797
- canSend: () => !r && t === Y.running,
801
+ canSend: () => !r && t === V.running,
798
802
  onTurn: i,
799
803
  onAwaitingChange: m
800
804
  }),
801
805
  [e, t, r, i, m]
802
- ), y = r || t !== Y.running, p = !r && t === Y.running;
806
+ ), y = r || t !== V.running, p = !r && t === V.running;
803
807
  let k = "The agent is not accepting messages.";
804
- return p && (k = "Message the agent, paste a link, or attach a file…"), r && (k = "You can view this conversation but cannot send messages."), /* @__PURE__ */ c("section", { className: "agent-workspace__chat-body", "aria-label": "Chat", children: [
805
- /* @__PURE__ */ n("div", { className: "agent-workspace__ask-arbor", children: /* @__PURE__ */ n(mn, { scrollSelector: ".chat-panel-message-list", children: /* @__PURE__ */ n(
808
+ return p && (k = "Message the agent, paste a link, or attach a file…"), r && (k = "You can view this conversation but cannot send messages."), /* @__PURE__ */ d("section", { className: "agent-workspace__chat-body", "aria-label": "Chat", children: [
809
+ /* @__PURE__ */ n("div", { className: "agent-workspace__ask-arbor", children: /* @__PURE__ */ n(hn, { scrollSelector: ".chat-panel-message-list", children: /* @__PURE__ */ n(
806
810
  rs,
807
811
  {
808
812
  connector: o,
@@ -820,15 +824,15 @@ const Ws = ({
820
824
  },
821
825
  s
822
826
  ) }) }),
823
- r && /* @__PURE__ */ c("div", { className: "agent-workspace__notice", role: "status", children: [
827
+ r && /* @__PURE__ */ d("div", { className: "agent-workspace__notice", role: "status", children: [
824
828
  /* @__PURE__ */ n($, { name: "eye", size: 16, color: "var(--color-grey-700)" }),
825
829
  /* @__PURE__ */ n("span", { children: "View only — you cannot interact with this agent." })
826
830
  ] }),
827
- t === Y.paused && /* @__PURE__ */ c("div", { className: "agent-workspace__notice", role: "status", children: [
831
+ t === V.paused && /* @__PURE__ */ d("div", { className: "agent-workspace__notice", role: "status", children: [
828
832
  /* @__PURE__ */ n($, { name: "circle-alert", size: 16, color: "var(--color-semantic-warning-600)" }),
829
833
  /* @__PURE__ */ n("span", { children: "The agent is paused. Its progress is saved in the checklist." })
830
834
  ] }),
831
- t === Y.complete && /* @__PURE__ */ c("div", { className: "agent-workspace__notice", role: "status", children: [
835
+ t === V.complete && /* @__PURE__ */ d("div", { className: "agent-workspace__notice", role: "status", children: [
832
836
  /* @__PURE__ */ n($, { name: "party-popper", size: 16, color: "var(--color-semantic-success-600)" }),
833
837
  /* @__PURE__ */ n("span", { children: "The agent has finished." })
834
838
  ] })
@@ -837,35 +841,35 @@ const Ws = ({
837
841
  item: e,
838
842
  depth: t
839
843
  }) => {
840
- const a = Le[e.status], s = e.status.replace(/_/g, "-");
841
- return /* @__PURE__ */ c(
844
+ const a = Ie[e.status], s = e.status.replace(/_/g, "-");
845
+ return /* @__PURE__ */ d(
842
846
  "li",
843
847
  {
844
- className: ne("agent-workspace__task", `agent-workspace__task--${s}`, {
848
+ className: ee("agent-workspace__task", `agent-workspace__task--${s}`, {
845
849
  "agent-workspace__task--child": t > 0
846
850
  }),
847
851
  children: [
848
- /* @__PURE__ */ c("div", { className: "agent-workspace__task-row", children: [
852
+ /* @__PURE__ */ d("div", { className: "agent-workspace__task-row", children: [
849
853
  /* @__PURE__ */ n(
850
- wa,
854
+ Na,
851
855
  {
852
856
  status: e.status,
853
857
  className: a.spin ? "agent-workspace__task-icon--spinning" : void 0
854
858
  }
855
859
  ),
856
- /* @__PURE__ */ c("div", { className: "agent-workspace__task-content", children: [
860
+ /* @__PURE__ */ d("div", { className: "agent-workspace__task-content", children: [
857
861
  /* @__PURE__ */ n("span", { className: "agent-workspace__task-label", children: e.task }),
858
- e.status !== H.complete && e.description && /* @__PURE__ */ n("span", { className: "agent-workspace__task-description", children: e.description })
862
+ e.status !== B.complete && e.description && /* @__PURE__ */ n("span", { className: "agent-workspace__task-description", children: e.description })
859
863
  ] })
860
864
  ] }),
861
865
  e.children && e.children.length > 0 && /* @__PURE__ */ n("ul", { className: "agent-workspace__task-children", children: e.children.map((r) => /* @__PURE__ */ n(ba, { item: r, depth: t + 1 }, r.task)) })
862
866
  ]
863
867
  }
864
868
  );
865
- }, Dt = ({
869
+ }, Gt = ({
866
870
  items: e,
867
871
  ariaLabel: t
868
- }) => /* @__PURE__ */ n("ul", { className: "agent-workspace__task-list", "aria-label": t, children: e.map((a) => /* @__PURE__ */ n(ba, { item: a, depth: 0 }, a.task)) }), Xs = ({
872
+ }) => /* @__PURE__ */ n("ul", { className: "agent-workspace__task-list", "aria-label": t, children: e.map((a) => /* @__PURE__ */ n(ba, { item: a, depth: 0 }, a.task)) }), Zs = ({
869
873
  checklist: e,
870
874
  isLoading: t,
871
875
  error: a,
@@ -877,19 +881,19 @@ const Ws = ({
877
881
  contextError: o = null,
878
882
  onContextSelect: y
879
883
  }) => {
880
- const [p, k] = g("checklist"), l = Q(
881
- () => e ? va(e) : null,
884
+ const [p, k] = g("checklist"), l = Z(
885
+ () => e ? wa(e) : null,
882
886
  [e]
883
887
  ), N = () => {
884
888
  k("context"), y == null || y();
885
889
  };
886
- return /* @__PURE__ */ c(
890
+ return /* @__PURE__ */ d(
887
891
  "section",
888
892
  {
889
893
  className: "agent-workspace__panel agent-workspace__panel--checklist",
890
894
  "aria-label": "Checklist",
891
895
  children: [
892
- /* @__PURE__ */ n("div", { className: "agent-workspace__panel-header", children: r ? /* @__PURE__ */ c(_t, { className: "agent-workspace__checklist-tabs", "aria-label": "Checklist panel", children: [
896
+ /* @__PURE__ */ n("div", { className: "agent-workspace__panel-header", children: r ? /* @__PURE__ */ d(_t, { className: "agent-workspace__checklist-tabs", "aria-label": "Checklist panel", children: [
893
897
  /* @__PURE__ */ n(
894
898
  _t.Item,
895
899
  {
@@ -912,9 +916,9 @@ const Ws = ({
912
916
  children: "Context"
913
917
  }
914
918
  )
915
- ] }) : /* @__PURE__ */ n(Xe, { level: 4, children: "Checklist" }) }),
916
- /* @__PURE__ */ n("div", { className: "agent-workspace__panel-body", "aria-live": "polite", children: /* @__PURE__ */ n(mn, { children: p === "context" ? /* @__PURE__ */ c(de, { children: [
917
- m && /* @__PURE__ */ c("div", { className: "agent-workspace__loading", children: [
919
+ ] }) : /* @__PURE__ */ n(We, { level: 4, children: "Checklist" }) }),
920
+ /* @__PURE__ */ n("div", { className: "agent-workspace__panel-body", "aria-live": "polite", children: /* @__PURE__ */ n(hn, { children: p === "context" ? /* @__PURE__ */ d(he, { children: [
921
+ m && /* @__PURE__ */ d("div", { className: "agent-workspace__loading", children: [
918
922
  /* @__PURE__ */ n(
919
923
  $,
920
924
  {
@@ -930,8 +934,8 @@ const Ws = ({
930
934
  !m && o && /* @__PURE__ */ n("p", { className: "agent-workspace__error", role: "alert", children: o }),
931
935
  !m && !o && i && u == null && /* @__PURE__ */ n("p", { className: "agent-workspace__empty", children: "No context available." }),
932
936
  !m && !o && i && u !== null && u !== void 0 && /* @__PURE__ */ n("pre", { className: "agent-workspace__context-json", children: JSON.stringify(u, null, 2) })
933
- ] }) : /* @__PURE__ */ c(de, { children: [
934
- t && /* @__PURE__ */ c("div", { className: "agent-workspace__loading", children: [
937
+ ] }) : /* @__PURE__ */ d(he, { children: [
938
+ t && /* @__PURE__ */ d("div", { className: "agent-workspace__loading", children: [
935
939
  /* @__PURE__ */ n(
936
940
  $,
937
941
  {
@@ -945,27 +949,27 @@ const Ws = ({
945
949
  /* @__PURE__ */ n("span", { children: gt })
946
950
  ] }),
947
951
  !t && a && /* @__PURE__ */ n("p", { className: "agent-workspace__error", role: "alert", children: a }),
948
- !t && !a && l && /* @__PURE__ */ c(de, { children: [
949
- l.inProgress.length > 0 && /* @__PURE__ */ c("div", { className: "agent-workspace__task-group", children: [
952
+ !t && !a && l && /* @__PURE__ */ d(he, { children: [
953
+ l.inProgress.length > 0 && /* @__PURE__ */ d("div", { className: "agent-workspace__task-group", children: [
950
954
  (l.needsInput.length > 0 || l.tasks.length > 0 || l.failed.length > 0 || l.complete.length > 0) && /* @__PURE__ */ n("p", { className: "agent-workspace__task-group-label", children: "In progress" }),
951
955
  /* @__PURE__ */ n(
952
- Dt,
956
+ Gt,
953
957
  {
954
958
  items: l.inProgress,
955
959
  ariaLabel: "In progress"
956
960
  }
957
961
  )
958
962
  ] }),
959
- l.needsInput.length > 0 && /* @__PURE__ */ c(
963
+ l.needsInput.length > 0 && /* @__PURE__ */ d(
960
964
  "div",
961
965
  {
962
- className: ne("agent-workspace__task-group", {
966
+ className: ee("agent-workspace__task-group", {
963
967
  "agent-workspace__task-group--following": l.inProgress.length > 0
964
968
  }),
965
969
  children: [
966
970
  /* @__PURE__ */ n("p", { className: "agent-workspace__task-group-label", children: "Needs your input" }),
967
971
  /* @__PURE__ */ n(
968
- Dt,
972
+ Gt,
969
973
  {
970
974
  items: l.needsInput,
971
975
  ariaLabel: "Tasks needing your input"
@@ -974,16 +978,16 @@ const Ws = ({
974
978
  ]
975
979
  }
976
980
  ),
977
- l.failed.length > 0 && /* @__PURE__ */ c(
981
+ l.failed.length > 0 && /* @__PURE__ */ d(
978
982
  "div",
979
983
  {
980
- className: ne("agent-workspace__task-group", {
984
+ className: ee("agent-workspace__task-group", {
981
985
  "agent-workspace__task-group--following": l.inProgress.length > 0 || l.needsInput.length > 0
982
986
  }),
983
987
  children: [
984
988
  (l.inProgress.length > 0 || l.needsInput.length > 0 || l.tasks.length > 0 || l.complete.length > 0) && /* @__PURE__ */ n("p", { className: "agent-workspace__task-group-label", children: "Failed" }),
985
989
  /* @__PURE__ */ n(
986
- Dt,
990
+ Gt,
987
991
  {
988
992
  items: l.failed,
989
993
  ariaLabel: "Failed tasks"
@@ -992,16 +996,16 @@ const Ws = ({
992
996
  ]
993
997
  }
994
998
  ),
995
- l.tasks.length > 0 && /* @__PURE__ */ c(
999
+ l.tasks.length > 0 && /* @__PURE__ */ d(
996
1000
  "div",
997
1001
  {
998
- className: ne("agent-workspace__task-group", {
1002
+ className: ee("agent-workspace__task-group", {
999
1003
  "agent-workspace__task-group--following": l.inProgress.length > 0 || l.needsInput.length > 0 || l.failed.length > 0
1000
1004
  }),
1001
1005
  children: [
1002
1006
  (l.inProgress.length > 0 || l.needsInput.length > 0 || l.failed.length > 0 || l.complete.length > 0) && /* @__PURE__ */ n("p", { className: "agent-workspace__task-group-label", children: "To Do" }),
1003
1007
  /* @__PURE__ */ n(
1004
- Dt,
1008
+ Gt,
1005
1009
  {
1006
1010
  items: l.tasks,
1007
1011
  ariaLabel: "Upcoming tasks"
@@ -1010,16 +1014,16 @@ const Ws = ({
1010
1014
  ]
1011
1015
  }
1012
1016
  ),
1013
- l.complete.length > 0 && /* @__PURE__ */ c(
1017
+ l.complete.length > 0 && /* @__PURE__ */ d(
1014
1018
  "div",
1015
1019
  {
1016
- className: ne("agent-workspace__task-group", {
1020
+ className: ee("agent-workspace__task-group", {
1017
1021
  "agent-workspace__task-group--following": l.inProgress.length > 0 || l.needsInput.length > 0 || l.tasks.length > 0 || l.failed.length > 0
1018
1022
  }),
1019
1023
  children: [
1020
1024
  (l.inProgress.length > 0 || l.needsInput.length > 0 || l.tasks.length > 0 || l.failed.length > 0) && /* @__PURE__ */ n("p", { className: "agent-workspace__task-group-label", children: "Completed" }),
1021
1025
  /* @__PURE__ */ n(
1022
- Dt,
1026
+ Gt,
1023
1027
  {
1024
1028
  items: l.complete,
1025
1029
  ariaLabel: "Completed tasks"
@@ -1029,12 +1033,12 @@ const Ws = ({
1029
1033
  }
1030
1034
  )
1031
1035
  ] }),
1032
- !t && !a && (!l || l.inProgress.length === 0 && l.needsInput.length === 0 && l.complete.length === 0 && l.failed.length === 0 && l.tasks.length === 0) && /* @__PURE__ */ n("p", { className: "agent-workspace__empty", children: s === Y.briefing ? "Tasks will appear here once the agent starts." : "No tasks to display." })
1036
+ !t && !a && (!l || l.inProgress.length === 0 && l.needsInput.length === 0 && l.complete.length === 0 && l.failed.length === 0 && l.tasks.length === 0) && /* @__PURE__ */ n("p", { className: "agent-workspace__empty", children: s === V.briefing ? "Tasks will appear here once the agent starts." : "No tasks to display." })
1033
1037
  ] }) }) })
1034
1038
  ]
1035
1039
  }
1036
1040
  );
1037
- }, Zs = ({
1041
+ }, Qs = ({
1038
1042
  resource: e,
1039
1043
  html: t,
1040
1044
  isLoading: a,
@@ -1044,25 +1048,25 @@ const Ws = ({
1044
1048
  L(() => {
1045
1049
  if (!e)
1046
1050
  return;
1047
- const i = on.removeSlideover;
1048
- return on.removeSlideover = () => {
1051
+ const i = rn.removeSlideover;
1052
+ return rn.removeSlideover = () => {
1049
1053
  i(), r();
1050
1054
  }, () => {
1051
- on.removeSlideover = i;
1055
+ rn.removeSlideover = i;
1052
1056
  };
1053
1057
  }, [e, r]), L(() => {
1054
1058
  if (!e)
1055
1059
  return;
1056
1060
  const i = (m) => {
1057
- m.key === "Escape" && on.removeSlideover();
1061
+ m.key === "Escape" && rn.removeSlideover();
1058
1062
  };
1059
1063
  return window.addEventListener("keydown", i), () => window.removeEventListener("keydown", i);
1060
1064
  }, [e]);
1061
- const u = Q(() => e ? [
1065
+ const u = Z(() => e ? [
1062
1066
  {
1063
1067
  centerHeaderText: !1,
1064
- children: /* @__PURE__ */ c("div", { className: "resource-preview-slideover__body", children: [
1065
- a && /* @__PURE__ */ c("div", { className: "resource-preview-slideover__status", children: [
1068
+ children: /* @__PURE__ */ d("div", { className: "resource-preview-slideover__body", children: [
1069
+ a && /* @__PURE__ */ d("div", { className: "resource-preview-slideover__status", children: [
1066
1070
  /* @__PURE__ */ n(
1067
1071
  $,
1068
1072
  {
@@ -1088,55 +1092,55 @@ const Ws = ({
1088
1092
  ] })
1089
1093
  }
1090
1094
  ] : [], [e, t, a, s]);
1091
- return /* @__PURE__ */ n("div", { className: "resource-preview-slideover", children: /* @__PURE__ */ n(Za, { slideovers: u }) });
1092
- }, Qs = {
1093
- [Ie.mis_record]: {
1095
+ return /* @__PURE__ */ n("div", { className: "resource-preview-slideover", children: /* @__PURE__ */ n(Qa, { slideovers: u }) });
1096
+ }, er = {
1097
+ [Oe.mis_record]: {
1094
1098
  icon: "table",
1095
1099
  label: "Arbor MIS",
1096
1100
  color: "var(--color-brand-600)"
1097
1101
  },
1098
- [Ie.document_html]: {
1102
+ [Oe.document_html]: {
1099
1103
  icon: "file",
1100
1104
  label: "Document",
1101
1105
  color: "var(--color-semantic-caution-800)"
1102
1106
  },
1103
- [Ie.file]: {
1107
+ [Oe.file]: {
1104
1108
  icon: "file",
1105
1109
  label: "File",
1106
1110
  color: "var(--color-semantic-caution-800)"
1107
1111
  },
1108
- [Ie.user_file]: {
1112
+ [Oe.user_file]: {
1109
1113
  icon: "upload",
1110
1114
  label: "File upload",
1111
1115
  color: "var(--color-semantic-caution-800)"
1112
1116
  },
1113
- [Ie.workflow]: {
1117
+ [Oe.workflow]: {
1114
1118
  icon: "list-tree",
1115
1119
  label: "Workflow",
1116
1120
  color: "var(--color-semantic-warning-700)"
1117
1121
  },
1118
- [Ie.link]: {
1122
+ [Oe.link]: {
1119
1123
  icon: "link",
1120
1124
  label: "Link",
1121
1125
  color: "var(--color-semantic-info-700)"
1122
1126
  }
1123
- }, er = ({
1127
+ }, tr = ({
1124
1128
  resources: e,
1125
1129
  isLoading: t = !1,
1126
1130
  error: a = null,
1127
1131
  onOpenResource: s
1128
- }) => /* @__PURE__ */ c(
1132
+ }) => /* @__PURE__ */ d(
1129
1133
  "section",
1130
1134
  {
1131
1135
  className: "agent-workspace__panel agent-workspace__panel--documents",
1132
1136
  "aria-label": "Resources",
1133
1137
  children: [
1134
- /* @__PURE__ */ c("div", { className: "agent-workspace__panel-header", children: [
1135
- /* @__PURE__ */ n(Xe, { level: 4, children: "Resources" }),
1138
+ /* @__PURE__ */ d("div", { className: "agent-workspace__panel-header", children: [
1139
+ /* @__PURE__ */ n(We, { level: 4, children: "Resources" }),
1136
1140
  /* @__PURE__ */ n("span", { className: "agent-workspace__panel-count", children: e.length })
1137
1141
  ] }),
1138
- /* @__PURE__ */ n("div", { className: "agent-workspace__panel-body", "aria-live": "polite", children: /* @__PURE__ */ c(mn, { children: [
1139
- t && /* @__PURE__ */ c("div", { className: "agent-workspace__loading", children: [
1142
+ /* @__PURE__ */ n("div", { className: "agent-workspace__panel-body", "aria-live": "polite", children: /* @__PURE__ */ d(hn, { children: [
1143
+ t && /* @__PURE__ */ d("div", { className: "agent-workspace__loading", children: [
1140
1144
  /* @__PURE__ */ n(
1141
1145
  $,
1142
1146
  {
@@ -1151,7 +1155,7 @@ const Ws = ({
1151
1155
  ] }),
1152
1156
  !t && a && /* @__PURE__ */ n("p", { className: "agent-workspace__error", role: "alert", children: a }),
1153
1157
  !t && !a && e.length > 0 && /* @__PURE__ */ n("ul", { className: "agent-workspace__resource-list", "aria-label": "Agent resources", children: e.map((r) => {
1154
- const u = Qs[r.type], i = r.misRecordUrl;
1158
+ const u = er[r.type], i = r.misRecordUrl;
1155
1159
  return /* @__PURE__ */ n("li", { className: "agent-workspace__resource", children: i ? /* @__PURE__ */ n(
1156
1160
  "a",
1157
1161
  {
@@ -1162,7 +1166,7 @@ const Ws = ({
1162
1166
  onClick: (m) => {
1163
1167
  m.preventDefault(), s(r);
1164
1168
  },
1165
- children: /* @__PURE__ */ n(Wn, { resource: r, config: u, external: !0 })
1169
+ children: /* @__PURE__ */ n(Xn, { resource: r, config: u, external: !0 })
1166
1170
  }
1167
1171
  ) : /* @__PURE__ */ n(
1168
1172
  "button",
@@ -1170,7 +1174,7 @@ const Ws = ({
1170
1174
  type: "button",
1171
1175
  className: "agent-workspace__resource-card",
1172
1176
  onClick: () => s(r),
1173
- children: /* @__PURE__ */ n(Wn, { resource: r, config: u })
1177
+ children: /* @__PURE__ */ n(Xn, { resource: r, config: u })
1174
1178
  }
1175
1179
  ) }, r.id);
1176
1180
  }) }),
@@ -1178,7 +1182,7 @@ const Ws = ({
1178
1182
  ] }) })
1179
1183
  ]
1180
1184
  }
1181
- ), Wn = ({ resource: e, config: t, external: a = !1 }) => /* @__PURE__ */ c(de, { children: [
1185
+ ), Xn = ({ resource: e, config: t, external: a = !1 }) => /* @__PURE__ */ d(he, { children: [
1182
1186
  /* @__PURE__ */ n(
1183
1187
  "span",
1184
1188
  {
@@ -1186,7 +1190,7 @@ const Ws = ({
1186
1190
  children: /* @__PURE__ */ n($, { name: t.icon, size: 16, color: t.color, screenReaderText: `${t.label}:` })
1187
1191
  }
1188
1192
  ),
1189
- /* @__PURE__ */ n("span", { className: "agent-workspace__resource-content", children: /* @__PURE__ */ c("span", { className: "agent-workspace__resource-top", children: [
1193
+ /* @__PURE__ */ n("span", { className: "agent-workspace__resource-content", children: /* @__PURE__ */ d("span", { className: "agent-workspace__resource-top", children: [
1190
1194
  /* @__PURE__ */ n("span", { className: "agent-workspace__resource-name", children: e.title }),
1191
1195
  /* @__PURE__ */ n("span", { className: `agent-workspace__resource-badge agent-workspace__resource-badge--${e.type}`, children: t.label })
1192
1196
  ] }) }),
@@ -1203,7 +1207,7 @@ const Ws = ({
1203
1207
  ] }), Sn = (e) => {
1204
1208
  const t = Date.parse(e);
1205
1209
  return Number.isFinite(t) ? t : 0;
1206
- }, tr = new Intl.DateTimeFormat("en-GB", {
1210
+ }, nr = new Intl.DateTimeFormat("en-GB", {
1207
1211
  day: "numeric",
1208
1212
  month: "long",
1209
1213
  year: "numeric",
@@ -1211,17 +1215,17 @@ const Ws = ({
1211
1215
  minute: "2-digit"
1212
1216
  }), On = (e) => {
1213
1217
  const t = new Date(e);
1214
- return Number.isFinite(t.getTime()) ? tr.format(t) : e;
1215
- }, Xn = (e) => e.replace(
1218
+ return Number.isFinite(t.getTime()) ? nr.format(t) : e;
1219
+ }, Zn = (e) => e.replace(
1216
1220
  /[A-Za-z0-9]+(?:[_-][A-Za-z0-9]+)+/g,
1217
1221
  (t) => t.split(/[_-]/).map((a) => a.charAt(0).toUpperCase() + a.slice(1).toLowerCase()).join(" ")
1218
- ), Zn = (e) => {
1222
+ ), Qn = (e) => {
1219
1223
  const a = e.replace(
1220
1224
  /[A-Za-z0-9]+(?:[_-][A-Za-z0-9]+)+/g,
1221
1225
  (s) => s.split(/[_-]/).map((r) => r.toLowerCase()).join(" ")
1222
1226
  ).toLowerCase();
1223
1227
  return a && a.charAt(0).toUpperCase() + a.slice(1);
1224
- }, nr = 60 * 60 * 1e3, Ea = 60 * 60 * 1e3, xt = 24 * Ea, Un = 7 * xt, ar = (e) => e.type !== "message-sent", sr = (e) => {
1228
+ }, ar = 60 * 60 * 1e3, Ca = 60 * 60 * 1e3, zt = 24 * Ca, Un = 7 * zt, sr = (e) => e.type !== "message-sent", rr = (e) => {
1225
1229
  if (e == null || e <= 0)
1226
1230
  return null;
1227
1231
  if (e % 86400 === 0) {
@@ -1238,13 +1242,13 @@ const Ws = ({
1238
1242
  }
1239
1243
  const t = Math.max(1, Math.round(e / 60));
1240
1244
  return t === 1 ? "every minute" : `every ${t} minutes`;
1241
- }, rr = (e) => {
1245
+ }, ir = (e) => {
1242
1246
  if (e.recurrence === "one_off")
1243
1247
  return "Scheduled to run once";
1244
- const t = sr(e.repeatIntervalSeconds);
1248
+ const t = rr(e.repeatIntervalSeconds);
1245
1249
  return t ? `Repeating ${t}` : "Repeating run scheduled";
1246
- }, ir = (e) => e.recurrence === "one_off" ? "scheduled-one-off" : "scheduled-repeating", lr = (e, t, a = []) => {
1247
- const s = e.filter(ar).map((i, m) => ({
1250
+ }, lr = (e) => e.recurrence === "one_off" ? "scheduled-one-off" : "scheduled-repeating", or = (e, t, a = []) => {
1251
+ const s = e.filter(sr).map((i, m) => ({
1248
1252
  kind: "action",
1249
1253
  id: `action-${i.timestamp}-${m}`,
1250
1254
  timestampMs: Sn(i.timestamp),
@@ -1263,21 +1267,21 @@ const Ws = ({
1263
1267
  return [...s, ...r, ...u].sort(
1264
1268
  (i, m) => i.timestampMs - m.timestampMs || i.id.localeCompare(m.id)
1265
1269
  );
1266
- }, or = (e) => e >= Un ? "weeks" : e >= xt ? "days" : "hours", cr = (e) => {
1267
- if (e < xt) {
1268
- const s = Math.max(1, Math.round(e / Ea));
1270
+ }, cr = (e) => e >= Un ? "weeks" : e >= zt ? "days" : "hours", dr = (e) => {
1271
+ if (e < zt) {
1272
+ const s = Math.max(1, Math.round(e / Ca));
1269
1273
  return s === 1 ? "1 hour later" : `${s} hours later`;
1270
1274
  }
1271
1275
  if (e < Un) {
1272
- const s = Math.max(1, Math.round(e / xt));
1276
+ const s = Math.max(1, Math.round(e / zt));
1273
1277
  return s === 1 ? "1 day later" : `${s} days later`;
1274
1278
  }
1275
1279
  const t = Math.max(1, Math.round(e / Un));
1276
1280
  if (t < 5)
1277
1281
  return t === 1 ? "1 week later" : `${t} weeks later`;
1278
- const a = Math.max(1, Math.round(e / (30 * xt)));
1282
+ const a = Math.max(1, Math.round(e / (30 * zt)));
1279
1283
  return a === 1 ? "1 month later" : `${a} months later`;
1280
- }, dr = (e, t = nr) => {
1284
+ }, ur = (e, t = ar) => {
1281
1285
  if (e.length === 0)
1282
1286
  return [];
1283
1287
  const a = [e[0]];
@@ -1287,29 +1291,29 @@ const Ws = ({
1287
1291
  kind: "gap",
1288
1292
  id: `gap-${r.id}-${u.id}`,
1289
1293
  durationMs: i,
1290
- label: cr(i),
1291
- size: or(i)
1294
+ label: dr(i),
1295
+ size: cr(i)
1292
1296
  }), a.push(u);
1293
1297
  }
1294
1298
  return a;
1295
- }, ur = (e) => e.type === "checklist-updated" ? "checklist" : e.type === "status-transition" ? "status" : "note", hr = ({
1299
+ }, hr = (e) => e.type === "checklist-updated" ? "checklist" : e.type === "status-transition" ? "status" : "note", gr = ({
1296
1300
  timeline: e,
1297
1301
  isLoading: t,
1298
1302
  error: a,
1299
1303
  onOpenChatSession: s
1300
1304
  }) => {
1301
- const r = (e == null ? void 0 : e.actionLog) ?? [], u = (e == null ? void 0 : e.chatSessions) ?? [], i = (e == null ? void 0 : e.scheduledRuns) ?? [], m = lr(
1305
+ const r = (e == null ? void 0 : e.actionLog) ?? [], u = (e == null ? void 0 : e.chatSessions) ?? [], i = (e == null ? void 0 : e.scheduledRuns) ?? [], m = or(
1302
1306
  r,
1303
1307
  u,
1304
1308
  i
1305
- ), o = dr(m), y = !t && !a && m.length === 0;
1306
- return /* @__PURE__ */ c("section", { className: "agent-workspace__timeline", "aria-label": "Agent timeline", children: [
1309
+ ), o = ur(m), y = !t && !a && m.length === 0;
1310
+ return /* @__PURE__ */ d("section", { className: "agent-workspace__timeline", "aria-label": "Agent timeline", children: [
1307
1311
  t && /* @__PURE__ */ n("p", { className: "agent-workspace__timeline-status", role: "status", children: "Loading timeline…" }),
1308
- a && /* @__PURE__ */ n("p", { className: "agent-workspace__timeline-status", role: "alert", children: a || _a }),
1312
+ a && /* @__PURE__ */ n("p", { className: "agent-workspace__timeline-status", role: "alert", children: a || pa }),
1309
1313
  y && /* @__PURE__ */ n("p", { className: "agent-workspace__timeline-status", role: "status", children: "No timeline activity yet." }),
1310
- !t && !a && !y && /* @__PURE__ */ c("div", { className: "agent-timeline", children: [
1314
+ !t && !a && !y && /* @__PURE__ */ d("div", { className: "agent-timeline", children: [
1311
1315
  /* @__PURE__ */ n("div", { className: "agent-timeline__track", "aria-hidden": "true" }),
1312
- /* @__PURE__ */ c("div", { className: "agent-timeline__station agent-timeline__station--terminus", children: [
1316
+ /* @__PURE__ */ d("div", { className: "agent-timeline__station agent-timeline__station--terminus", children: [
1313
1317
  /* @__PURE__ */ n("span", { className: "agent-timeline__station-rail", children: /* @__PURE__ */ n(
1314
1318
  "span",
1315
1319
  {
@@ -1322,7 +1326,7 @@ const Ws = ({
1322
1326
  ] }),
1323
1327
  o.map((p) => {
1324
1328
  if (p.kind === "gap")
1325
- return /* @__PURE__ */ c(
1329
+ return /* @__PURE__ */ d(
1326
1330
  "div",
1327
1331
  {
1328
1332
  className: `agent-timeline__gap agent-timeline__gap--${p.size}`,
@@ -1337,7 +1341,7 @@ const Ws = ({
1337
1341
  );
1338
1342
  if (p.kind === "chat") {
1339
1343
  const R = On(p.session.timestamp), D = /* @__PURE__ */ n($, { name: "sparkles", size: 16, color: "currentColor" });
1340
- return /* @__PURE__ */ c("div", { className: "agent-timeline__chat-station", children: [
1344
+ return /* @__PURE__ */ d("div", { className: "agent-timeline__chat-station", children: [
1341
1345
  s ? /* @__PURE__ */ n(
1342
1346
  "button",
1343
1347
  {
@@ -1355,15 +1359,15 @@ const Ws = ({
1355
1359
  children: D
1356
1360
  }
1357
1361
  ),
1358
- /* @__PURE__ */ c("div", { className: "agent-timeline__label", children: [
1362
+ /* @__PURE__ */ d("div", { className: "agent-timeline__label", children: [
1359
1363
  /* @__PURE__ */ n("strong", { className: "agent-timeline__label-type", children: "Chat session" }),
1360
1364
  /* @__PURE__ */ n("span", { className: "agent-timeline__label-time", children: R })
1361
1365
  ] })
1362
1366
  ] }, p.id);
1363
1367
  }
1364
1368
  if (p.kind === "scheduled") {
1365
- const R = ir(p.run), D = p.run.recurrence === "one_off" ? "One-off run" : "Repeating run";
1366
- return /* @__PURE__ */ c(
1369
+ const R = lr(p.run), D = p.run.recurrence === "one_off" ? "One-off run" : "Repeating run";
1370
+ return /* @__PURE__ */ d(
1367
1371
  "div",
1368
1372
  {
1369
1373
  className: `agent-timeline__station agent-timeline__station--${R}`,
@@ -1376,9 +1380,9 @@ const Ws = ({
1376
1380
  children: /* @__PURE__ */ n($, { name: "date", size: 16, color: "currentColor" })
1377
1381
  }
1378
1382
  ) }),
1379
- /* @__PURE__ */ c("div", { className: "agent-timeline__label", children: [
1383
+ /* @__PURE__ */ d("div", { className: "agent-timeline__label", children: [
1380
1384
  /* @__PURE__ */ n("strong", { className: "agent-timeline__label-type", children: D }),
1381
- /* @__PURE__ */ n("span", { className: "agent-timeline__label-entry", children: rr(p.run) }),
1385
+ /* @__PURE__ */ n("span", { className: "agent-timeline__label-entry", children: ir(p.run) }),
1382
1386
  /* @__PURE__ */ n("span", { className: "agent-timeline__label-time", children: On(p.run.dueAt) })
1383
1387
  ] })
1384
1388
  ]
@@ -1386,27 +1390,27 @@ const Ws = ({
1386
1390
  p.id
1387
1391
  );
1388
1392
  }
1389
- const { item: k } = p, l = ur(k), N = l === "checklist", S = l === "status";
1390
- return /* @__PURE__ */ c(
1393
+ const { item: k } = p, l = hr(k), N = l === "checklist", S = l === "status";
1394
+ return /* @__PURE__ */ d(
1391
1395
  "div",
1392
1396
  {
1393
1397
  className: `agent-timeline__station agent-timeline__station--${l}`,
1394
1398
  children: [
1395
- /* @__PURE__ */ n("span", { className: "agent-timeline__station-rail", children: /* @__PURE__ */ c(
1399
+ /* @__PURE__ */ n("span", { className: "agent-timeline__station-rail", children: /* @__PURE__ */ d(
1396
1400
  "button",
1397
1401
  {
1398
1402
  type: "button",
1399
1403
  className: `agent-timeline__station-node agent-timeline__station-node--${l}`,
1400
- "aria-label": `${Xn(k.type)}: ${Zn(k.entry)}`,
1404
+ "aria-label": `${Zn(k.type)}: ${Qn(k.entry)}`,
1401
1405
  children: [
1402
1406
  N && /* @__PURE__ */ n($, { name: "check-solid", size: 16, color: "currentColor" }),
1403
1407
  S && /* @__PURE__ */ n($, { name: "iteration-ccw", size: 16, color: "currentColor" })
1404
1408
  ]
1405
1409
  }
1406
1410
  ) }),
1407
- /* @__PURE__ */ c("div", { className: "agent-timeline__label", children: [
1408
- /* @__PURE__ */ n("strong", { className: "agent-timeline__label-type", children: Xn(k.type) }),
1409
- /* @__PURE__ */ n("span", { className: "agent-timeline__label-entry", children: Zn(k.entry) }),
1411
+ /* @__PURE__ */ d("div", { className: "agent-timeline__label", children: [
1412
+ /* @__PURE__ */ n("strong", { className: "agent-timeline__label-type", children: Zn(k.type) }),
1413
+ /* @__PURE__ */ n("span", { className: "agent-timeline__label-entry", children: Qn(k.entry) }),
1410
1414
  /* @__PURE__ */ n("span", { className: "agent-timeline__label-time", children: On(k.timestamp) })
1411
1415
  ] })
1412
1416
  ]
@@ -1414,7 +1418,7 @@ const Ws = ({
1414
1418
  p.id
1415
1419
  );
1416
1420
  }),
1417
- /* @__PURE__ */ c("div", { className: "agent-timeline__station agent-timeline__station--terminus", children: [
1421
+ /* @__PURE__ */ d("div", { className: "agent-timeline__station agent-timeline__station--terminus", children: [
1418
1422
  /* @__PURE__ */ n("span", { className: "agent-timeline__station-rail", children: /* @__PURE__ */ n(
1419
1423
  "span",
1420
1424
  {
@@ -1427,23 +1431,41 @@ const Ws = ({
1427
1431
  ] })
1428
1432
  ] })
1429
1433
  ] });
1430
- }, gr = (e) => e.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;"), mr = (e) => e.kind === ha.user_file ? `<strong>${gr(e.text)}</strong>` : e.text, Oe = (e) => ({
1431
- id: e.id,
1432
- text: mr(e),
1433
- type: e.author === ve.user ? is : e.author === ve.system ? ls : ua,
1434
- ...e.followUpPrompts ? { followUpPrompts: e.followUpPrompts } : {}
1435
- }), Qn = "MESSAGE_TYPE_REPOLL", _r = "agentUi:update", Ca = "arbor-agent-", Je = {
1434
+ }, mr = (e, t) => ({
1435
+ id: t,
1436
+ contentType: "WIDGET",
1437
+ editedOrCreatedByUser: !0,
1438
+ visible: !0,
1439
+ content: {
1440
+ type: "FILE",
1441
+ header: e
1442
+ }
1443
+ }), Se = (e) => {
1444
+ const t = e.kind === ga.user_file;
1445
+ return {
1446
+ id: e.id,
1447
+ text: t ? "" : e.text,
1448
+ type: e.author === ye.user ? is : e.author === ye.system ? ls : ha,
1449
+ ...t ? {
1450
+ element: mr(
1451
+ e.text,
1452
+ `${e.id}-file`
1453
+ )
1454
+ } : {},
1455
+ ...e.followUpPrompts ? { followUpPrompts: e.followUpPrompts } : {}
1456
+ };
1457
+ }, ea = "MESSAGE_TYPE_REPOLL", _r = "agentUi:update", Ta = "arbor-agent-", Ve = {
1436
1458
  all: "ALL",
1437
1459
  checklist: "CHECKLIST",
1438
1460
  resources: "RESOURCES",
1439
1461
  chat: "CHAT",
1440
1462
  timeline: "TIMELINE"
1441
- }, pr = new Set(Object.values(Je)), fr = (e, t) => `${e.endsWith("-") ? e : `${e}-`}${t}`, vr = (e) => typeof e == "string" && pr.has(e) ? e : Je.all, wr = (e) => {
1463
+ }, pr = new Set(Object.values(Ve)), fr = (e, t) => `${e.endsWith("-") ? e : `${e}-`}${t}`, vr = (e) => typeof e == "string" && pr.has(e) ? e : Ve.all, wr = (e) => {
1442
1464
  if (!e || typeof e != "object")
1443
1465
  return null;
1444
1466
  const t = e;
1445
- return t.type !== Qn ? null : {
1446
- type: Qn,
1467
+ return t.type !== ea ? null : {
1468
+ type: ea,
1447
1469
  target: vr(t.target)
1448
1470
  };
1449
1471
  }, Nr = (e) => {
@@ -1460,7 +1482,7 @@ const Ws = ({
1460
1482
  subscribeToPusher: s,
1461
1483
  onRepoll: r
1462
1484
  }) => {
1463
- const u = te(r), i = t == null ? void 0 : t.trim(), m = !!(e && s && i && (a != null && a.trim()));
1485
+ const u = Q(r), i = t == null ? void 0 : t.trim(), m = !!(e && s && i && (a != null && a.trim()));
1464
1486
  return L(() => {
1465
1487
  u.current = r;
1466
1488
  }, [r]), L(() => {
@@ -1479,20 +1501,20 @@ const Ws = ({
1479
1501
  };
1480
1502
  }, [m, i, a, s]), m;
1481
1503
  };
1482
- let fe = null, Dn = "", xn = "", hn = 0;
1504
+ let Ne = null, Dn = "", xn = "", dn = 0;
1483
1505
  const Ar = () => {
1484
1506
  window.setTimeout(() => {
1485
- hn > 0 || !fe || (fe.disconnect(), fe = null, Dn = "", xn = "");
1507
+ dn > 0 || !Ne || (Ne.disconnect(), Ne = null, Dn = "", xn = "");
1486
1508
  }, 0);
1487
- }, kr = (e, t) => (fe && (Dn !== e || xn !== t) && (fe.disconnect(), fe = null), fe || (fe = new cs(e, { cluster: t }), Dn = e, xn = t), hn += 1, fe), br = () => {
1488
- hn = Math.max(0, hn - 1), Ar();
1489
- }, Er = ({
1509
+ }, kr = (e, t) => (Ne && (Dn !== e || xn !== t) && (Ne.disconnect(), Ne = null), Ne || (Ne = new cs(e, { cluster: t }), Dn = e, xn = t), dn += 1, Ne), Er = () => {
1510
+ dn = Math.max(0, dn - 1), Ar();
1511
+ }, br = ({
1490
1512
  enabled: e,
1491
1513
  key: t,
1492
1514
  cluster: a,
1493
1515
  isAdmin: s = !1
1494
1516
  }) => {
1495
- const r = te(null), u = t.trim(), i = a.trim(), m = e && !!u && !!i;
1517
+ const r = Q(null), u = t.trim(), i = a.trim(), m = e && !!u && !!i;
1496
1518
  return L(() => {
1497
1519
  if (!m) {
1498
1520
  r.current = null;
@@ -1500,12 +1522,12 @@ const Ar = () => {
1500
1522
  }
1501
1523
  const o = kr(u, i);
1502
1524
  return r.current = o, () => {
1503
- r.current = null, br();
1525
+ r.current = null, Er();
1504
1526
  };
1505
- }, [m, u, i]), Q(() => {
1527
+ }, [m, u, i]), Z(() => {
1506
1528
  if (m)
1507
1529
  return (o, y, p) => {
1508
- const k = r.current ?? fe;
1530
+ const k = r.current ?? Ne;
1509
1531
  if (!k)
1510
1532
  return s && console.log(`[pusher] subscribe skipped — client not ready for "${o}"`), () => {
1511
1533
  };
@@ -1521,7 +1543,7 @@ class mt extends Error {
1521
1543
  super(s ?? `Agent service request failed (${t})`), this.name = "AgentServiceError", this.status = t, this.detail = a;
1522
1544
  }
1523
1545
  }
1524
- const Cr = "/api/v1", V = {
1546
+ const Cr = "/api/v1", K = {
1525
1547
  agentDefinitions: "/agent-definitions",
1526
1548
  agents: "/agents",
1527
1549
  conversations: "/conversations",
@@ -1536,7 +1558,7 @@ const Cr = "/api/v1", V = {
1536
1558
  error: "error"
1537
1559
  }, Rr = {
1538
1560
  user: "user"
1539
- }, je = {
1561
+ }, Ye = {
1540
1562
  acceptJson: "application/json",
1541
1563
  acceptHtml: "text/html",
1542
1564
  acceptEventStream: "text/event-stream",
@@ -1545,46 +1567,46 @@ const Cr = "/api/v1", V = {
1545
1567
  }, Sr = 100, Or = (e) => {
1546
1568
  switch (e) {
1547
1569
  case Cn.paused:
1548
- return E.paused;
1570
+ return b.paused;
1549
1571
  case Cn.complete:
1550
- return E.complete;
1551
- case E.hitl:
1552
- return E.hitl;
1572
+ return b.complete;
1573
+ case b.hitl:
1574
+ return b.hitl;
1553
1575
  case Cn.active:
1554
- case E["generating-a-response"]:
1555
- return E["generating-a-response"];
1576
+ case b["generating-a-response"]:
1577
+ return b["generating-a-response"];
1556
1578
  default:
1557
- return E["generating-a-response"];
1579
+ return b["generating-a-response"];
1558
1580
  }
1559
1581
  }, Ir = (e) => {
1560
1582
  switch (e) {
1561
- case Ut.requires_attention:
1562
- case Ut.waiting_on_human:
1563
- case H.hitl:
1564
- return H.hitl;
1565
- case Ut.in_progress:
1566
- case H["generating-a-response"]:
1567
- return H["generating-a-response"];
1568
- case Ut.to_do:
1569
- case Ut.available:
1570
- case H.to_do:
1571
- return H.to_do;
1572
- case H.failed:
1573
- case H.complete:
1583
+ case Bt.requires_attention:
1584
+ case Bt.waiting_on_human:
1585
+ case B.hitl:
1586
+ return B.hitl;
1587
+ case Bt.in_progress:
1588
+ case B["generating-a-response"]:
1589
+ return B["generating-a-response"];
1590
+ case Bt.to_do:
1591
+ case Bt.available:
1592
+ case B.to_do:
1593
+ return B.to_do;
1594
+ case B.failed:
1595
+ case B.complete:
1574
1596
  return e;
1575
1597
  default:
1576
- return H.to_do;
1598
+ return B.to_do;
1577
1599
  }
1578
- }, Ta = (e) => ({
1600
+ }, Ra = (e) => ({
1579
1601
  ref: e.name,
1580
1602
  display_name: e.display_name,
1581
1603
  agent_intent: e.agent_intent ?? "",
1582
1604
  description: e.description
1583
- }), Ci = (e) => ({
1605
+ }), Ti = (e) => ({
1584
1606
  id: e.id,
1585
1607
  name: e.name,
1586
1608
  ...e.has_run_before ? { hasRunBefore: e.has_run_before } : {}
1587
- }), Lr = new Set(Object.values(Ie)), Pr = (e) => Lr.has(e) ? e : Ie.document_html, Ur = (e) => ({
1609
+ }), Lr = new Set(Object.values(Oe)), Pr = (e) => Lr.has(e) ? e : Oe.document_html, Ur = (e) => ({
1588
1610
  id: e.id,
1589
1611
  type: Pr(e.type),
1590
1612
  title: e.title,
@@ -1614,7 +1636,7 @@ const Cr = "/api/v1", V = {
1614
1636
  repeatIntervalSeconds: t.repeat_interval_seconds,
1615
1637
  wakePrompt: t.wake_prompt
1616
1638
  }))
1617
- }), We = (e) => {
1639
+ }), Je = (e) => {
1618
1640
  var a;
1619
1641
  const t = e.invocation_id ?? e.id;
1620
1642
  return {
@@ -1632,36 +1654,36 @@ const Cr = "/api/v1", V = {
1632
1654
  context_ref: e.context_ref ?? null,
1633
1655
  checklist_ref: e.checklist_ref ?? null
1634
1656
  };
1635
- }, Ra = (e) => ({
1636
- task: e.item ?? e.task ?? e.name ?? e.label ?? Us,
1657
+ }, Sa = (e) => ({
1658
+ task: e.item ?? e.task ?? e.name ?? e.label ?? Ds,
1637
1659
  status: Ir(e.status),
1638
1660
  description: e.description ?? ""
1639
1661
  }), Mr = (e) => Array.isArray(e) ? e : e.checklist_items ?? e.checklist ?? e.items ?? [], Mn = (e, t, a) => {
1640
1662
  var u;
1641
- const s = !Array.isArray(t) && (t.opening_message || (u = t.opening_follow_up_prompts) != null && u.length) ? t : a, r = s ? _n(s) : void 0;
1663
+ const s = !Array.isArray(t) && (t.opening_message || (u = t.opening_follow_up_prompts) != null && u.length) ? t : a, r = s ? gn(s) : void 0;
1642
1664
  return {
1643
1665
  invocation_id: e,
1644
- checklist: Mr(t).map(Ra),
1666
+ checklist: Mr(t).map(Sa),
1645
1667
  ...r ? { openingMessage: r } : {}
1646
1668
  };
1647
- }, Ti = (e, t) => {
1648
- const a = _n(t);
1669
+ }, Ri = (e, t) => {
1670
+ const a = gn(t);
1649
1671
  return {
1650
1672
  invocation_id: t.invocation_id ?? e,
1651
- checklist: (t.checklist_items ?? []).map(Ra),
1673
+ checklist: (t.checklist_items ?? []).map(Sa),
1652
1674
  ...a ? { openingMessage: a } : {}
1653
1675
  };
1654
- }, _n = (e) => {
1676
+ }, gn = (e) => {
1655
1677
  var a, s;
1656
1678
  const t = (a = e.opening_message) == null ? void 0 : a.trim();
1657
1679
  if (t)
1658
1680
  return {
1659
- id: ma,
1660
- author: ve.agent,
1681
+ id: _a,
1682
+ author: ye.agent,
1661
1683
  text: t,
1662
1684
  ...(s = e.opening_follow_up_prompts) != null && s.length ? { followUpPrompts: e.opening_follow_up_prompts } : {}
1663
1685
  };
1664
- }, Ri = (e) => {
1686
+ }, Si = (e) => {
1665
1687
  try {
1666
1688
  const t = JSON.parse(e);
1667
1689
  if (Array.isArray(t)) {
@@ -1675,34 +1697,41 @@ const Cr = "/api/v1", V = {
1675
1697
  } catch {
1676
1698
  }
1677
1699
  return e;
1678
- }, Si = (e) => {
1700
+ }, Oi = (e) => {
1679
1701
  const t = e.trim();
1680
1702
  return t.length > 0 ? `File upload
1681
1703
 
1682
1704
  ${t}` : "File upload";
1683
- }, ea = (e) => {
1684
- var a;
1705
+ }, $r = (e) => !e.includes(`
1706
+ `) && e.length > 0 && e.length <= 240 && /\.[A-Za-z0-9]{2,5}$/.test(e), ta = (e) => {
1707
+ var a, s;
1685
1708
  const t = (a = e.filename) == null ? void 0 : a.trim();
1686
- return t || null;
1687
- }, $r = (e) => e.filter((t) => ea(t) && 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) => {
1688
- const a = ea(t);
1709
+ if (t)
1710
+ return t;
1711
+ if (e.message_type === "user_file" && e.role === "user") {
1712
+ const r = (s = e.content) == null ? void 0 : s.trim();
1713
+ return r && $r(r) ? r : r ? "File upload" : null;
1714
+ }
1715
+ return null;
1716
+ }, Hr = (e) => e.filter((t) => ta(t) && t.role === "user" ? !0 : (t.role === "user" || t.role === "assistant") && typeof t.content == "string" && t.content.length > 0 && t.message_type !== "tool_request" && t.message_type !== "user_file").map((t) => {
1717
+ const a = ta(t);
1689
1718
  return a && t.role === "user" ? {
1690
1719
  id: t.message_id,
1691
- author: ve.user,
1692
- kind: ha.user_file,
1720
+ author: ye.user,
1721
+ kind: ga.user_file,
1693
1722
  text: a
1694
1723
  } : {
1695
1724
  id: t.message_id,
1696
- author: t.role === "user" ? ve.user : ve.agent,
1725
+ author: t.role === "user" ? ye.user : ye.agent,
1697
1726
  text: t.content
1698
1727
  };
1699
- }), Hr = /:invocationId\b/g, Br = /:resourceId\b/g, Gr = (e) => e.trim().replace(/^Bearer\s+/i, ""), ta = (e) => e.endsWith("/") ? e.slice(0, -1) : e;
1728
+ }), Br = /:invocationId\b/g, Gr = /:resourceId\b/g, zr = (e) => e.trim().replace(/^Bearer\s+/i, ""), na = (e) => e.endsWith("/") ? e.slice(0, -1) : e;
1700
1729
  class $n {
1701
1730
  constructor(t) {
1702
1731
  var s;
1703
- this.baseUrl = ta(t.baseUrl ?? "");
1732
+ this.baseUrl = na(t.baseUrl ?? "");
1704
1733
  const a = (s = t.token) == null ? void 0 : s.trim();
1705
- this.token = a ? Gr(a) : void 0, this.customHeaders = t.headers, this.urls = t.urls ?? {}, this.fetchImpl = t.fetch ?? globalThis.fetch.bind(globalThis);
1734
+ this.token = a ? zr(a) : void 0, this.customHeaders = t.headers, this.urls = t.urls ?? {}, this.fetchImpl = t.fetch ?? globalThis.fetch.bind(globalThis);
1706
1735
  }
1707
1736
  // Replaces the extra headers merged into every subsequent request,
1708
1737
  // without recreating the client (e.g. an application-URL header that
@@ -1713,28 +1742,28 @@ class $n {
1713
1742
  async listAgentDefinitions() {
1714
1743
  return (await this.request(
1715
1744
  W.GET,
1716
- this.resolveUrl("agentDefinitions", V.agentDefinitions)
1745
+ this.resolveUrl("agentDefinitions", K.agentDefinitions)
1717
1746
  )).agent_definitions ?? [];
1718
1747
  }
1719
1748
  getAgentDefinition(t) {
1720
1749
  return this.request(
1721
1750
  W.GET,
1722
- this.apiUrl(`${V.agentDefinitions}/${encodeURIComponent(t)}`)
1751
+ this.apiUrl(`${K.agentDefinitions}/${encodeURIComponent(t)}`)
1723
1752
  );
1724
1753
  }
1725
1754
  listTripOptions() {
1726
- return this.request(W.GET, this.apiUrl(V.tripOptions));
1755
+ return this.request(W.GET, this.apiUrl(K.tripOptions));
1727
1756
  }
1728
1757
  getDataset() {
1729
1758
  return this.request(
1730
1759
  W.GET,
1731
- this.apiUrl(V.demoDataset)
1760
+ this.apiUrl(K.demoDataset)
1732
1761
  );
1733
1762
  }
1734
1763
  setDataset(t) {
1735
1764
  return this.request(
1736
1765
  W.POST,
1737
- this.apiUrl(V.demoDataset),
1766
+ this.apiUrl(K.demoDataset),
1738
1767
  { dataset: t }
1739
1768
  );
1740
1769
  }
@@ -1744,7 +1773,7 @@ class $n {
1744
1773
  const s = a.toString() ? `?${a.toString()}` : "";
1745
1774
  return this.request(
1746
1775
  W.GET,
1747
- `${this.resolveUrl("agents", V.agents)}${s}`
1776
+ `${this.resolveUrl("agents", K.agents)}${s}`
1748
1777
  );
1749
1778
  }
1750
1779
  createAgent(t, a = {}) {
@@ -1754,14 +1783,14 @@ class $n {
1754
1783
  }, r = (i = a.invocationName) == null ? void 0 : i.trim(), u = (m = a.agentIntent) == null ? void 0 : m.trim();
1755
1784
  return r && (s.invocation_name = r), u && (s.agent_intent = u), this.request(
1756
1785
  W.POST,
1757
- this.resolveUrl("agents", V.agents),
1786
+ this.resolveUrl("agents", K.agents),
1758
1787
  s
1759
1788
  );
1760
1789
  }
1761
1790
  getAgent(t) {
1762
1791
  return this.request(
1763
1792
  W.GET,
1764
- this.resolveUrl("agent", `${V.agents}/${encodeURIComponent(t)}`, t)
1793
+ this.resolveUrl("agent", `${K.agents}/${encodeURIComponent(t)}`, t)
1765
1794
  );
1766
1795
  }
1767
1796
  updateAgent(t, a) {
@@ -1772,7 +1801,7 @@ class $n {
1772
1801
  W.PATCH,
1773
1802
  this.resolveUrl(
1774
1803
  "agent",
1775
- `${V.agents}/${encodeURIComponent(t)}`,
1804
+ `${K.agents}/${encodeURIComponent(t)}`,
1776
1805
  t
1777
1806
  ),
1778
1807
  r
@@ -1783,7 +1812,7 @@ class $n {
1783
1812
  W.GET,
1784
1813
  this.resolveUrl(
1785
1814
  "agentChecklist",
1786
- `${V.agents}/${encodeURIComponent(t)}/checklist`,
1815
+ `${K.agents}/${encodeURIComponent(t)}/checklist`,
1787
1816
  t
1788
1817
  )
1789
1818
  );
@@ -1793,7 +1822,7 @@ class $n {
1793
1822
  a.pageNumber !== void 0 && s.set("page_number", String(a.pageNumber)), a.pageSize !== void 0 && s.set("page_size", String(a.pageSize)), a.type && s.set("type", a.type);
1794
1823
  const r = s.toString(), u = this.resolveUrl(
1795
1824
  "agentResources",
1796
- `${V.agents}/${encodeURIComponent(t)}/resources`,
1825
+ `${K.agents}/${encodeURIComponent(t)}/resources`,
1797
1826
  t
1798
1827
  );
1799
1828
  return this.request(
@@ -1824,7 +1853,7 @@ class $n {
1824
1853
  W.GET,
1825
1854
  this.resolveUrl(
1826
1855
  "agentTimeline",
1827
- `${V.agents}/${encodeURIComponent(t)}/agent-timeline`,
1856
+ `${K.agents}/${encodeURIComponent(t)}/agent-timeline`,
1828
1857
  t
1829
1858
  )
1830
1859
  );
@@ -1832,12 +1861,12 @@ class $n {
1832
1861
  getAgentContext(t) {
1833
1862
  const a = this.resolveUrl(
1834
1863
  "agent",
1835
- `${V.agents}/${encodeURIComponent(t)}`,
1864
+ `${K.agents}/${encodeURIComponent(t)}`,
1836
1865
  t
1837
1866
  );
1838
1867
  return this.request(
1839
1868
  W.GET,
1840
- `${ta(a)}/context`
1869
+ `${na(a)}/context`
1841
1870
  );
1842
1871
  }
1843
1872
  pauseAgent(t) {
@@ -1845,7 +1874,7 @@ class $n {
1845
1874
  W.POST,
1846
1875
  this.resolveUrl(
1847
1876
  "pauseAgent",
1848
- `${V.agents}/${encodeURIComponent(t)}/pause`,
1877
+ `${K.agents}/${encodeURIComponent(t)}/pause`,
1849
1878
  t
1850
1879
  )
1851
1880
  );
@@ -1855,7 +1884,7 @@ class $n {
1855
1884
  W.POST,
1856
1885
  this.resolveUrl(
1857
1886
  "resumeAgent",
1858
- `${V.agents}/${encodeURIComponent(t)}/resume`,
1887
+ `${K.agents}/${encodeURIComponent(t)}/resume`,
1859
1888
  t
1860
1889
  )
1861
1890
  );
@@ -1865,7 +1894,7 @@ class $n {
1865
1894
  W.POST,
1866
1895
  this.resolveUrl(
1867
1896
  "archiveAgent",
1868
- `${V.agents}/${encodeURIComponent(t)}/archive`,
1897
+ `${K.agents}/${encodeURIComponent(t)}/archive`,
1869
1898
  t
1870
1899
  )
1871
1900
  );
@@ -1875,7 +1904,7 @@ class $n {
1875
1904
  W.POST,
1876
1905
  this.resolveUrl(
1877
1906
  "unarchiveAgent",
1878
- `${V.agents}/${encodeURIComponent(t)}/unarchive`,
1907
+ `${K.agents}/${encodeURIComponent(t)}/unarchive`,
1879
1908
  t
1880
1909
  )
1881
1910
  );
@@ -1885,7 +1914,7 @@ class $n {
1885
1914
  W.DELETE,
1886
1915
  this.resolveUrl(
1887
1916
  "agent",
1888
- `${V.agents}/${encodeURIComponent(t)}`,
1917
+ `${K.agents}/${encodeURIComponent(t)}`,
1889
1918
  t
1890
1919
  )
1891
1920
  );
@@ -1895,7 +1924,7 @@ class $n {
1895
1924
  W.GET,
1896
1925
  this.resolveUrl(
1897
1926
  "agentConversation",
1898
- `${V.conversations}/${encodeURIComponent(t)}`,
1927
+ `${K.conversations}/${encodeURIComponent(t)}`,
1899
1928
  t
1900
1929
  )
1901
1930
  );
@@ -1906,7 +1935,7 @@ class $n {
1906
1935
  const r = !!(s.uploadFiles && s.uploadFiles.length > 0), u = await this.fetchImpl(
1907
1936
  this.resolveUrl(
1908
1937
  "agentChat",
1909
- `${V.agents}/${encodeURIComponent(t)}/chat`,
1938
+ `${K.agents}/${encodeURIComponent(t)}/chat`,
1910
1939
  t
1911
1940
  ),
1912
1941
  {
@@ -1914,11 +1943,11 @@ class $n {
1914
1943
  headers: {
1915
1944
  ...this.customHeaders,
1916
1945
  ...this.authHeaders(),
1917
- Accept: je.acceptEventStream,
1946
+ Accept: Ye.acceptEventStream,
1918
1947
  // Let the browser set the multipart boundary when uploading.
1919
- ...r ? {} : { "Content-Type": je.contentTypeJson }
1948
+ ...r ? {} : { "Content-Type": Ye.contentTypeJson }
1920
1949
  },
1921
- body: r ? Fr(a, s.uploadFiles ?? []) : JSON.stringify(a),
1950
+ body: r ? qr(a, s.uploadFiles ?? []) : JSON.stringify(a),
1922
1951
  signal: s.signal
1923
1952
  }
1924
1953
  );
@@ -1942,22 +1971,22 @@ class $n {
1942
1971
  if (!u)
1943
1972
  return this.apiUrl(a);
1944
1973
  let i = u;
1945
- return s && (i = i.replace(Hr, encodeURIComponent(s))), r && (i = i.replace(Br, encodeURIComponent(r))), i;
1974
+ return s && (i = i.replace(Br, encodeURIComponent(s))), r && (i = i.replace(Gr, encodeURIComponent(r))), i;
1946
1975
  }
1947
1976
  resolveResourceHtmlUrl(t, a) {
1948
1977
  return this.urls.agentResourceHtml ? this.resolveUrl(
1949
1978
  "agentResourceHtml",
1950
- `${V.agents}/${encodeURIComponent(t)}/resources/${encodeURIComponent(
1979
+ `${K.agents}/${encodeURIComponent(t)}/resources/${encodeURIComponent(
1951
1980
  a
1952
1981
  )}`,
1953
1982
  t,
1954
1983
  a
1955
1984
  ) : this.urls.agentResources ? `${this.resolveUrl(
1956
1985
  "agentResources",
1957
- `${V.agents}/${encodeURIComponent(t)}/resources`,
1986
+ `${K.agents}/${encodeURIComponent(t)}/resources`,
1958
1987
  t
1959
1988
  ).replace(/\/$/, "")}/${encodeURIComponent(a)}` : this.apiUrl(
1960
- `${V.agents}/${encodeURIComponent(t)}/resources/${encodeURIComponent(
1989
+ `${K.agents}/${encodeURIComponent(t)}/resources/${encodeURIComponent(
1961
1990
  a
1962
1991
  )}`
1963
1992
  );
@@ -1968,8 +1997,8 @@ class $n {
1968
1997
  headers: {
1969
1998
  ...this.customHeaders,
1970
1999
  ...this.authHeaders(),
1971
- Accept: je.acceptJson,
1972
- ...s === void 0 ? {} : { "Content-Type": je.contentTypeJson }
2000
+ Accept: Ye.acceptJson,
2001
+ ...s === void 0 ? {} : { "Content-Type": Ye.contentTypeJson }
1973
2002
  },
1974
2003
  ...s === void 0 ? {} : { body: JSON.stringify(s) }
1975
2004
  });
@@ -1984,7 +2013,7 @@ class $n {
1984
2013
  headers: {
1985
2014
  ...this.customHeaders,
1986
2015
  ...this.authHeaders(),
1987
- Accept: je.acceptHtml
2016
+ Accept: Ye.acceptHtml
1988
2017
  }
1989
2018
  });
1990
2019
  if (!s.ok)
@@ -2007,14 +2036,14 @@ class $n {
2007
2036
  const s = t.getReader(), r = new TextDecoder();
2008
2037
  let u = "", i, m;
2009
2038
  const o = (p) => {
2010
- const { event: k, data: l } = zr(p);
2039
+ const { event: k, data: l } = Fr(p);
2011
2040
  if (l === null)
2012
2041
  return;
2013
2042
  if (k === Tr.error) {
2014
- const S = na(l);
2043
+ const S = aa(l);
2015
2044
  throw new mt(502, S, (S == null ? void 0 : S.message) ?? "Chat stream error");
2016
2045
  }
2017
- const N = na(l);
2046
+ const N = aa(l);
2018
2047
  N && (i = N, a == null || a(N), N.is_final && (m = N));
2019
2048
  };
2020
2049
  try {
@@ -2048,7 +2077,7 @@ class $n {
2048
2077
  return y;
2049
2078
  }
2050
2079
  }
2051
- const zr = (e) => {
2080
+ const Fr = (e) => {
2052
2081
  let t = null;
2053
2082
  const a = [];
2054
2083
  for (const s of e.split(`
@@ -2061,43 +2090,43 @@ const zr = (e) => {
2061
2090
  data: a.length > 0 ? a.join(`
2062
2091
  `) : null
2063
2092
  };
2064
- }, na = (e) => {
2093
+ }, aa = (e) => {
2065
2094
  try {
2066
2095
  return JSON.parse(e);
2067
2096
  } catch {
2068
2097
  return;
2069
2098
  }
2070
2099
  };
2071
- function Fr(e, t) {
2100
+ function qr(e, t) {
2072
2101
  const a = new FormData();
2073
2102
  a.append("body", JSON.stringify(e));
2074
2103
  for (const s of t)
2075
2104
  a.append("files", s, s.name);
2076
2105
  return a;
2077
2106
  }
2078
- const qr = {
2079
- id: ma,
2080
- author: ve.agent,
2107
+ const Kr = {
2108
+ id: _a,
2109
+ author: ye.agent,
2081
2110
  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."
2082
2111
  };
2083
- let aa = 0;
2084
- const Kr = (e) => (aa += 1, `${e}-${Date.now()}-${aa}`), Vr = (e) => {
2112
+ let sa = 0;
2113
+ const Vr = (e) => (sa += 1, `${e}-${Date.now()}-${sa}`), Yr = (e) => {
2085
2114
  const t = e.destination ? ` to ${e.destination}` : "";
2086
2115
  return `Let's get started on ${e.tripName.trim() || e.destination.trim() || "this task"}${t}. What will you do first?`;
2087
2116
  };
2088
- class Yr {
2117
+ class Jr {
2089
2118
  constructor(t, a, s = {}) {
2090
- this.seededChecklist = [], this.client = t, this.agentId = a, this.chatId = s.chatId ?? a, this.opening = s.openingMessage ?? qr, this.model = s.model;
2119
+ this.seededChecklist = [], this.client = t, this.agentId = a, this.chatId = s.chatId ?? a, this.opening = s.openingMessage ?? Kr, this.model = s.model;
2091
2120
  }
2092
2121
  openingMessage() {
2093
2122
  return this.opening;
2094
2123
  }
2095
2124
  async bootstrapConversation() {
2096
- const t = await this.client.getConversation(this.chatId), a = $r(t.messages);
2125
+ const t = await this.client.getConversation(this.chatId), a = Hr(t.messages);
2097
2126
  return a.length === 0 ? [this.opening] : a;
2098
2127
  }
2099
2128
  async start(t) {
2100
- return { ...await this.exchange(Vr(t)), phase: Y.running };
2129
+ return { ...await this.exchange(Yr(t)), phase: V.running };
2101
2130
  }
2102
2131
  sendMessage(t, a, s) {
2103
2132
  return this.exchange(t, a, s);
@@ -2142,8 +2171,8 @@ class Yr {
2142
2171
  }
2143
2172
  }
2144
2173
  ), y = m ?? o, p = {
2145
- id: y.event_id || Kr("msg-agent"),
2146
- author: ve.agent,
2174
+ id: y.event_id || Vr("msg-agent"),
2175
+ author: ye.agent,
2147
2176
  text: u || y.message.content || "",
2148
2177
  ...(k = y.follow_up_prompts) != null && k.length ? { followUpPrompts: y.follow_up_prompts } : {}
2149
2178
  };
@@ -2158,35 +2187,35 @@ class Yr {
2158
2187
  }
2159
2188
  }
2160
2189
  }
2161
- const Sa = (e, t) => (a) => {
2190
+ const Oa = (e, t) => (a) => {
2162
2191
  var s, r;
2163
- return new Yr(e, a.invocation_id, {
2192
+ return new Jr(e, a.invocation_id, {
2164
2193
  model: t == null ? void 0 : t.model,
2165
2194
  chatId: ((s = t == null ? void 0 : t.resolveChatId) == null ? void 0 : s.call(t, a)) ?? (t == null ? void 0 : t.chatId) ?? a.invocation_id,
2166
2195
  openingMessage: ((r = t == null ? void 0 : t.resolveOpeningMessage) == null ? void 0 : r.call(t, a)) ?? (t == null ? void 0 : t.openingMessage)
2167
2196
  });
2168
- }, Oa = (e) => e instanceof mt ? e.message : e instanceof TypeError ? "Network error while contacting the agent service." : e instanceof Error && e.message ? e.message : pa, Ia = (e) => {
2197
+ }, Ia = (e) => e instanceof mt ? e.message : e instanceof TypeError ? "Network error while contacting the agent service." : e instanceof Error && e.message ? e.message : fa, La = (e) => {
2169
2198
  if (e instanceof mt) {
2170
2199
  if (e.status === 403)
2171
2200
  return ks;
2172
2201
  if (e.status === 409)
2173
- return bs;
2174
- if (e.status === 404)
2175
2202
  return Es;
2203
+ if (e.status === 404)
2204
+ return bs;
2176
2205
  }
2177
2206
  return As;
2178
- }, Jr = (e) => {
2207
+ }, Wr = (e) => {
2179
2208
  const t = {};
2180
2209
  for (const a of e) {
2181
- const s = _n(a);
2210
+ const s = gn(a);
2182
2211
  if (!s)
2183
2212
  continue;
2184
2213
  const r = a.invocation_id ?? a.id;
2185
2214
  t[r] = s, t[a.id] = s;
2186
2215
  }
2187
2216
  return t;
2188
- }, jr = (e) => JSON.stringify(e), cn = (e, t) => JSON.stringify(e) === JSON.stringify(t), Wr = (e) => {
2189
- const { jwt: t, headers: a, urls: s, scope: r = fa } = e, u = JSON.stringify(a ?? {}), i = jr(s), m = Q(() => ({ scope: r }), [r]), o = Q(
2217
+ }, jr = (e) => JSON.stringify(e), ln = (e, t) => JSON.stringify(e) === JSON.stringify(t), Xr = (e) => {
2218
+ const { jwt: t, headers: a, urls: s, scope: r = va } = e, u = JSON.stringify(a ?? {}), i = jr(s), m = Z(() => ({ scope: r }), [r]), o = Z(
2190
2219
  () => new $n({
2191
2220
  token: t,
2192
2221
  headers: a,
@@ -2195,128 +2224,128 @@ const Sa = (e, t) => (a) => {
2195
2224
  // eslint-disable-next-line react-hooks/exhaustive-deps -- keyed on serialised config to keep a stable client.
2196
2225
  [t, i]
2197
2226
  );
2198
- gn(() => {
2227
+ un(() => {
2199
2228
  o.setHeaders(a);
2200
2229
  }, [o, u]);
2201
2230
  const [y, p] = g([]), [k, l] = g(
2202
2231
  []
2203
- ), [N, S] = g({}), [R, D] = g("loading"), [x, I] = g(null), [A, _] = g(0), v = te(0), P = f(
2204
- (b, B) => {
2205
- const O = b.map(We), z = B.map(Ta), K = Jr(b);
2232
+ ), [N, S] = g({}), [R, D] = g("loading"), [x, I] = g(null), [A, _] = g(0), v = Q(0), P = f(
2233
+ (E, M) => {
2234
+ const O = E.map(Je), Y = M.map(Ra), q = Wr(E);
2206
2235
  p(
2207
- (X) => cn(X, O) ? X : O
2236
+ (j) => ln(j, O) ? j : O
2208
2237
  ), l(
2209
- (X) => cn(X, z) ? X : z
2238
+ (j) => ln(j, Y) ? j : Y
2210
2239
  ), S(
2211
- (X) => cn(X, K) ? X : K
2240
+ (j) => ln(j, q) ? j : q
2212
2241
  ), D("idle"), I(null);
2213
2242
  },
2214
2243
  []
2215
2244
  );
2216
2245
  L(() => {
2217
- const b = ++v.current;
2246
+ const E = ++v.current;
2218
2247
  D("loading"), I(null), (async () => {
2219
2248
  try {
2220
- const [B, O] = await Promise.all([
2249
+ const [M, O] = await Promise.all([
2221
2250
  o.listAgents(m),
2222
2251
  o.listAgentDefinitions()
2223
2252
  ]);
2224
- if (b !== v.current)
2253
+ if (E !== v.current)
2225
2254
  return;
2226
- P(B, O);
2227
- } catch (B) {
2228
- if (b !== v.current)
2255
+ P(M, O);
2256
+ } catch (M) {
2257
+ if (E !== v.current)
2229
2258
  return;
2230
- p([]), l([]), S({}), D("error"), I(Oa(B));
2259
+ p([]), l([]), S({}), D("error"), I(Ia(M));
2231
2260
  }
2232
2261
  })();
2233
2262
  }, [P, o, m, A]);
2234
- const q = f(() => {
2235
- _((b) => b + 1);
2236
- }, []), ae = f(async () => {
2237
- const b = ++v.current;
2263
+ const G = f(() => {
2264
+ _((E) => E + 1);
2265
+ }, []), se = f(async () => {
2266
+ const E = ++v.current;
2238
2267
  try {
2239
- const [B, O] = await Promise.all([
2268
+ const [M, O] = await Promise.all([
2240
2269
  o.listAgents(m),
2241
2270
  o.listAgentDefinitions()
2242
2271
  ]);
2243
- if (b !== v.current)
2272
+ if (E !== v.current)
2244
2273
  return;
2245
- P(B, O);
2274
+ P(M, O);
2246
2275
  } catch {
2247
2276
  }
2248
2277
  }, [P, o, m]), ft = f(
2249
- async (b) => {
2250
- const [B, O] = await Promise.all([
2251
- o.getAgentChecklist(b),
2252
- o.getAgent(b).catch(() => null)
2278
+ async (E) => {
2279
+ const [M, O] = await Promise.all([
2280
+ o.getAgentChecklist(E),
2281
+ o.getAgent(E).catch(() => null)
2253
2282
  ]);
2254
2283
  return Mn(
2255
- b,
2256
- B,
2284
+ E,
2285
+ M,
2257
2286
  O ?? void 0
2258
2287
  );
2259
2288
  },
2260
2289
  [o]
2261
- ), Ze = f(
2262
- async (b) => o.listAllAgentResources(b),
2290
+ ), ne = f(
2291
+ async (E) => o.listAllAgentResources(E),
2263
2292
  [o]
2264
- ), ee = f(
2293
+ ), re = f(
2265
2294
  async ({
2266
- definition: b,
2267
- invocationName: B
2295
+ definition: E,
2296
+ invocationName: M
2268
2297
  }) => {
2269
- const O = await o.createAgent(b.ref, {
2270
- invocationName: B
2271
- }), z = await o.getAgent(O.id), K = We(z), X = _n(z);
2272
- return p((ye) => [K, ...ye]), X && S((ye) => ({
2273
- ...ye,
2274
- [K.invocation_id]: X,
2275
- [K.id]: X
2276
- })), K;
2298
+ const O = await o.createAgent(E.ref, {
2299
+ invocationName: M
2300
+ }), Y = await o.getAgent(O.id), q = Je(Y), j = gn(Y);
2301
+ return p((ke) => [q, ...ke]), j && S((ke) => ({
2302
+ ...ke,
2303
+ [q.invocation_id]: j,
2304
+ [q.id]: j
2305
+ })), q;
2277
2306
  },
2278
2307
  [o]
2279
- ), oe = f(
2280
- async (b) => {
2281
- const B = await o.archiveAgent(b), O = We(B);
2308
+ ), pe = f(
2309
+ async (E) => {
2310
+ const M = await o.archiveAgent(E), O = Je(M);
2282
2311
  return p(
2283
- (z) => z.map(
2284
- (K) => K.id === O.id || K.id === b || K.invocation_id === b ? O : K
2312
+ (Y) => Y.map(
2313
+ (q) => q.id === O.id || q.id === E || q.invocation_id === E ? O : q
2285
2314
  )
2286
2315
  ), O;
2287
2316
  },
2288
2317
  [o]
2289
- ), ge = f(
2290
- async (b) => {
2291
- const B = await o.unarchiveAgent(b), O = We(B);
2318
+ ), Ae = f(
2319
+ async (E) => {
2320
+ const M = await o.unarchiveAgent(E), O = Je(M);
2292
2321
  return p(
2293
- (z) => z.map(
2294
- (K) => K.id === O.id || K.id === b || K.invocation_id === b ? O : K
2322
+ (Y) => Y.map(
2323
+ (q) => q.id === O.id || q.id === E || q.invocation_id === E ? O : q
2295
2324
  )
2296
2325
  ), O;
2297
2326
  },
2298
2327
  [o]
2299
- ), we = f((b) => {
2328
+ ), H = f((E) => {
2300
2329
  p(
2301
- (B) => B.filter(
2302
- (O) => O.id !== b && O.invocation_id !== b
2330
+ (M) => M.filter(
2331
+ (O) => O.id !== E && O.invocation_id !== E
2303
2332
  )
2304
2333
  );
2305
- }, []), M = f((b) => {
2306
- p((B) => {
2307
- const O = B.map(
2308
- (z) => z.id === b.id || z.invocation_id === b.invocation_id ? { ...z, ...b } : z
2334
+ }, []), ge = f((E) => {
2335
+ p((M) => {
2336
+ const O = M.map(
2337
+ (Y) => Y.id === E.id || Y.invocation_id === E.invocation_id ? { ...Y, ...E } : Y
2309
2338
  );
2310
- return cn(B, O) ? B : O;
2339
+ return ln(M, O) ? M : O;
2311
2340
  });
2312
- }, []), Ne = f(
2313
- async (b) => {
2314
- await o.deleteAgent(b), we(b);
2341
+ }, []), de = f(
2342
+ async (E) => {
2343
+ await o.deleteAgent(E), H(E);
2315
2344
  },
2316
- [o, we]
2317
- ), ie = Q(
2318
- () => Sa(o, {
2319
- resolveOpeningMessage: (b) => N[b.invocation_id] ?? N[b.id]
2345
+ [o, H]
2346
+ ), fe = Z(
2347
+ () => Oa(o, {
2348
+ resolveOpeningMessage: (E) => N[E.invocation_id] ?? N[E.id]
2320
2349
  }),
2321
2350
  [o, N]
2322
2351
  );
@@ -2325,20 +2354,20 @@ const Sa = (e, t) => (a) => {
2325
2354
  agentDefinitions: k,
2326
2355
  loadState: R,
2327
2356
  loadError: x,
2328
- reload: q,
2329
- refresh: ae,
2357
+ reload: G,
2358
+ refresh: se,
2330
2359
  fetchAgentChecklist: ft,
2331
- fetchAgentResources: Ze,
2332
- createAgent: ee,
2333
- archiveAgent: oe,
2334
- unarchiveAgent: ge,
2335
- deleteAgent: Ne,
2336
- removeAgent: we,
2337
- replaceAgent: M,
2338
- chatConnector: ie
2360
+ fetchAgentResources: ne,
2361
+ createAgent: re,
2362
+ archiveAgent: pe,
2363
+ unarchiveAgent: Ae,
2364
+ deleteAgent: de,
2365
+ removeAgent: H,
2366
+ replaceAgent: ge,
2367
+ chatConnector: fe
2339
2368
  };
2340
- }, Xr = (e) => JSON.stringify(e), Zr = (e) => {
2341
- const { agent: t, jwt: a, headers: s, urls: r, chatId: u } = e, i = JSON.stringify(s ?? {}), m = Xr(r), o = Q(
2369
+ }, Zr = (e) => JSON.stringify(e), Qr = (e) => {
2370
+ const { agent: t, jwt: a, headers: s, urls: r, chatId: u } = e, i = JSON.stringify(s ?? {}), m = Zr(r), o = Z(
2342
2371
  () => new $n({
2343
2372
  token: a,
2344
2373
  headers: s,
@@ -2358,11 +2387,11 @@ const Sa = (e, t) => (a) => {
2358
2387
  // eslint-disable-next-line react-hooks/exhaustive-deps -- keyed on serialised config to keep a stable client.
2359
2388
  [a, m]
2360
2389
  );
2361
- gn(() => {
2390
+ un(() => {
2362
2391
  o.setHeaders(s);
2363
2392
  }, [o, i]);
2364
2393
  const y = f(
2365
- async (_) => We(await o.getAgent(_)),
2394
+ async (_) => Je(await o.getAgent(_)),
2366
2395
  [o]
2367
2396
  ), p = f(
2368
2397
  async (_) => {
@@ -2398,10 +2427,10 @@ const Sa = (e, t) => (a) => {
2398
2427
  },
2399
2428
  [o]
2400
2429
  ), D = f(
2401
- async (_) => We(await o.archiveAgent(_)),
2430
+ async (_) => Je(await o.archiveAgent(_)),
2402
2431
  [o]
2403
2432
  ), x = f(
2404
- async (_) => We(await o.unarchiveAgent(_)),
2433
+ async (_) => Je(await o.unarchiveAgent(_)),
2405
2434
  [o]
2406
2435
  ), I = f(
2407
2436
  async (_) => {
@@ -2410,8 +2439,8 @@ const Sa = (e, t) => (a) => {
2410
2439
  [o]
2411
2440
  );
2412
2441
  return {
2413
- connector: Q(
2414
- () => Sa(o, {
2442
+ connector: Z(
2443
+ () => Oa(o, {
2415
2444
  chatId: u ?? t.invocation_id
2416
2445
  })(t),
2417
2446
  // Key on invocation/chat ids so a new Agent object reference does not rebuild the connector.
@@ -2429,24 +2458,24 @@ const Sa = (e, t) => (a) => {
2429
2458
  unarchiveAgent: x,
2430
2459
  deleteAgent: I
2431
2460
  };
2432
- }, Qr = 3e4, ei = (e, t) => {
2461
+ }, ei = 3e4, ti = (e, t) => {
2433
2462
  const a = e.hasRunBefore ? t || "This trip" : e.tripName.trim() || "A new trip", s = e.destination ? ` to ${e.destination}` : "", r = e.hasRunBefore ? " It has run before." : "";
2434
2463
  return `${a}${s}.${r}`.trim();
2435
- }, sa = (e) => {
2464
+ }, ra = (e) => {
2436
2465
  switch (e) {
2437
- case E.paused:
2438
- return Y.paused;
2439
- case E.complete:
2440
- return Y.complete;
2466
+ case b.paused:
2467
+ return V.paused;
2468
+ case b.complete:
2469
+ return V.complete;
2441
2470
  default:
2442
- return Y.running;
2471
+ return V.running;
2443
2472
  }
2444
- }, In = (e) => e === E.paused, ra = (e, t) => {
2445
- t([Oe(e)]);
2446
- }, ti = (e, t) => e.length === t.length && e.every((a, s) => {
2473
+ }, In = (e) => e === b.paused, ia = (e, t) => {
2474
+ t([Se(e)]);
2475
+ }, ni = (e, t) => e.length === t.length && e.every((a, s) => {
2447
2476
  const r = t[s];
2448
2477
  return r !== void 0 && a.id === r.id && a.text === r.text;
2449
- }), ni = ({
2478
+ }), ai = ({
2450
2479
  agent: e,
2451
2480
  invocationId: t,
2452
2481
  open: a,
@@ -2470,32 +2499,32 @@ const Sa = (e, t) => (a) => {
2470
2499
  initialPhase: _,
2471
2500
  initialChecklist: v,
2472
2501
  usePusherToRepoll: P = !1,
2473
- pusherChannelPrefix: q = Ca,
2474
- pusherKey: ae = "",
2502
+ pusherChannelPrefix: G = Ta,
2503
+ pusherKey: se = "",
2475
2504
  pusherCluster: ft = "",
2476
- subscribeToPusher: Ze,
2477
- onArchived: ee,
2478
- onUnarchived: oe,
2479
- onDeleted: ge,
2480
- onAgentUpdated: we
2505
+ subscribeToPusher: ne,
2506
+ onArchived: re,
2507
+ onUnarchived: pe,
2508
+ onDeleted: Ae,
2509
+ onAgentUpdated: H
2481
2510
  }) => {
2482
- const [M, Ne] = g(D ?? t), [ie, b] = g("chat"), [B, O] = g(!1), {
2483
- connector: z,
2484
- fetchAgent: K,
2485
- fetchAgentChecklist: X,
2486
- fetchAgentContext: ye,
2487
- fetchAgentResources: Ue,
2488
- fetchAgentResourceHtml: Mt,
2489
- fetchAgentTimeline: Qe,
2490
- updateAgentInvocationName: $t,
2491
- archiveAgent: et,
2492
- unarchiveAgent: De,
2493
- deleteAgent: xe
2494
- } = Zr({
2511
+ const [ge, de] = g(D ?? t), [fe, E] = g("chat"), [M, O] = g(!1), {
2512
+ connector: Y,
2513
+ fetchAgent: q,
2514
+ fetchAgentChecklist: j,
2515
+ fetchAgentContext: ke,
2516
+ fetchAgentResources: je,
2517
+ fetchAgentResourceHtml: Ft,
2518
+ fetchAgentTimeline: Xe,
2519
+ updateAgentInvocationName: Ze,
2520
+ archiveAgent: Pe,
2521
+ unarchiveAgent: Ue,
2522
+ deleteAgent: vt
2523
+ } = Qr({
2495
2524
  agent: { ...e, invocation_id: t },
2496
2525
  jwt: r,
2497
2526
  headers: u,
2498
- chatId: M,
2527
+ chatId: ge,
2499
2528
  urls: {
2500
2529
  agentUrl: i,
2501
2530
  agentChecklistUrl: m,
@@ -2508,159 +2537,159 @@ const Sa = (e, t) => (a) => {
2508
2537
  archiveAgentUrl: S,
2509
2538
  unarchiveAgentUrl: R
2510
2539
  }
2511
- }), Z = te(z), [Me, ce] = g(e.invocation_name), [Ht, $e] = g(0), [He, Ee] = g(null), [me, ue] = g(
2512
- _ ?? (A ? Y.running : sa(e.status))
2513
- ), [pn, j] = g([]), [vt, Be] = g(0), [Bt, Gt] = g([]), [tt, zt] = g(!1), [wt, Ce] = g(null), [Nt, nt] = g(null), [Ft, yt] = g(null), [at, Ae] = g(!1), [At, Ge] = g(null), [Te, qt] = g(null), [st, Kt] = g(!1), [Vt, rt] = g(null), [ze, _e] = g(v ?? null), [Yt, Fe] = g(!1), [Jt, it] = g(null), [fn, kt] = g(void 0), [lt, ot] = g(!1), [Re, bt] = g(!1), [vn, Et] = g(null), [jt, Ct] = g(!1), [Wt, Xt] = g(!1), [Zt, Qt] = g(!1), [wn, Tt] = g(!1), [Nn, ct] = g(null), [en, tn] = g(!1), [yn, Rt] = g(!1), [nn, qe] = g(null), [d, C] = g(!1), [T, le] = g(!1), [Ke, ke] = g(null), [Se, se] = g(null), [Ua, St] = g(() => In(e.status)), [Da, Hn] = g(e.archivedAt ?? null), J = !!Da, Ot = !e.usable, [An, It] = g(!1), [an, xa] = g(!1), [sn, Ma] = g(!1), Bn = te(An), Gn = te(e.invocation_name), dt = te(e), pe = te(we), zn = te(0), Fn = te(0), ut = te(0), Lt = te(0);
2514
- pe.current = we, L(() => {
2540
+ }), X = Q(Y), [ae, Qe] = g(e.invocation_name), [wt, Ce] = g(0), [De, Nt] = g(null), [le, Te] = g(
2541
+ _ ?? (A ? V.running : ra(e.status))
2542
+ ), [ue, ie] = g([]), [yt, et] = g(0), [mn, xe] = g([]), [_n, tt] = g(!1), [nt, Me] = g(null), [At, kt] = g(null), [pn, Re] = g(null), [$e, He] = g(!1), [Et, at] = g(null), [Be, Ge] = g(null), [fn, bt] = g(!1), [qt, st] = g(null), [me, rt] = g(v ?? null), [it, Ct] = g(!1), [Kt, Tt] = g(null), [Vt, Rt] = g(void 0), [ze, Fe] = g(!1), [St, Ot] = g(!1), [vn, It] = g(null), [Lt, Yt] = g(!1), [Jt, Wt] = g(!1), [jt, Xt] = g(!1), [wn, Pt] = g(!1), [Nn, lt] = g(null), [Zt, Qt] = g(!1), [yn, ot] = g(!1), [en, c] = g(null), [C, T] = g(!1), [oe, Ee] = g(!1), [ct, ve] = g(null), [Ut, ce] = g(null), [Da, Dt] = g(() => In(e.status)), [xa, Hn] = g(e.archivedAt ?? null), J = !!xa, xt = !e.usable, [An, Mt] = g(!1), [tn, Ma] = g(!1), [nn, $a] = g(!1), Bn = Q(An), Gn = Q(e.invocation_name), dt = Q(e), we = Q(H), zn = Q(0), Fn = Q(0), ut = Q(0), $t = Q(0);
2543
+ we.current = H, L(() => {
2515
2544
  Hn(e.archivedAt ?? null);
2516
2545
  }, [e.archivedAt]), L(() => {
2517
- Z.current = z;
2518
- }, [z]), L(() => {
2546
+ X.current = Y;
2547
+ }, [Y]), L(() => {
2519
2548
  Gn.current = e.invocation_name;
2520
2549
  }, [e.invocation_name]), L(() => {
2521
2550
  dt.current = e;
2522
2551
  }, [e]), L(() => {
2523
2552
  Bn.current = An;
2524
2553
  }, [An]), L(() => {
2525
- Ne(D ?? t), b("chat"), O(!1), j([]), Be((h) => h + 1), Ee(null);
2526
- }, [t, D]), L(() => (ut.current += 1, kt(void 0), ot(!1), bt(!1), Et(null), () => {
2554
+ de(D ?? t), E("chat"), O(!1), ie([]), et((h) => h + 1), Nt(null);
2555
+ }, [t, D]), L(() => (ut.current += 1, Rt(void 0), Fe(!1), Ot(!1), It(null), () => {
2527
2556
  ut.current += 1;
2528
2557
  }), [t]), L(() => {
2529
- St(In(e.status));
2558
+ Dt(In(e.status));
2530
2559
  }, [e.status, t]), L(() => {
2531
2560
  if (!a || A || J)
2532
2561
  return;
2533
- const h = ++Lt.current;
2562
+ const h = ++$t.current;
2534
2563
  return (async () => {
2535
2564
  var w;
2536
2565
  try {
2537
- const U = await K(t);
2538
- if (h !== Lt.current)
2566
+ const U = await q(t);
2567
+ if (h !== $t.current)
2539
2568
  return;
2540
- ue(sa(U.status)), St(In(U.status)), dt.current = U, (w = pe.current) == null || w.call(pe, U);
2569
+ Te(ra(U.status)), Dt(In(U.status)), dt.current = U, (w = we.current) == null || w.call(we, U);
2541
2570
  } catch {
2542
2571
  }
2543
2572
  })(), () => {
2544
- Lt.current += 1;
2573
+ $t.current += 1;
2545
2574
  };
2546
- }, [a, t, A, J, K]), L(() => {
2547
- ce(e.invocation_name), $e((h) => h + 1);
2575
+ }, [a, t, A, J, q]), L(() => {
2576
+ Qe(e.invocation_name), Ce((h) => h + 1);
2548
2577
  }, [e.invocation_name]), L(() => {
2549
- J && b("timeline");
2578
+ J && E("timeline");
2550
2579
  }, [J]), L(() => {
2551
2580
  if (!a || A || J)
2552
2581
  return;
2553
- const h = Z.current.bootstrapConversation;
2582
+ const h = X.current.bootstrapConversation;
2554
2583
  if (!h) {
2555
- ra(Z.current.openingMessage(), j);
2584
+ ia(X.current.openingMessage(), ie);
2556
2585
  return;
2557
2586
  }
2558
2587
  let w = !1;
2559
- return It(!0), (async () => {
2588
+ return Mt(!0), (async () => {
2560
2589
  try {
2561
- const U = await h.call(Z.current);
2590
+ const U = await h.call(X.current);
2562
2591
  if (w)
2563
2592
  return;
2564
- j(U.map(Oe));
2593
+ ie(U.map(Se));
2565
2594
  } catch {
2566
- w || ra(Z.current.openingMessage(), j);
2595
+ w || ia(X.current.openingMessage(), ie);
2567
2596
  } finally {
2568
- w || It(!1);
2597
+ w || Mt(!1);
2569
2598
  }
2570
2599
  })(), () => {
2571
2600
  w = !0;
2572
2601
  };
2573
- }, [a, A, J, t, M]);
2574
- const Ve = f(() => {
2602
+ }, [a, A, J, t, ge]);
2603
+ const qe = f(() => {
2575
2604
  const h = ++zn.current;
2576
2605
  (async () => {
2577
2606
  var w, U;
2578
2607
  try {
2579
- const re = await X(t);
2608
+ const te = await j(t);
2580
2609
  if (h !== zn.current)
2581
2610
  return;
2582
- _e((he) => re.checklist.length === 0 && Array.isArray(he) && he.length > 0 || JSON.stringify(he) === JSON.stringify(re.checklist) ? he : re.checklist), it(null), (U = (w = Z.current).seedChecklist) == null || U.call(w, re.checklist);
2611
+ rt((_e) => te.checklist.length === 0 && Array.isArray(_e) && _e.length > 0 || JSON.stringify(_e) === JSON.stringify(te.checklist) ? _e : te.checklist), Tt(null), (U = (w = X.current).seedChecklist) == null || U.call(w, te.checklist);
2583
2612
  } catch {
2584
2613
  }
2585
2614
  })();
2586
- }, [X, t]), Ye = f(() => {
2615
+ }, [j, t]), Ke = f(() => {
2587
2616
  o && (async () => {
2588
2617
  try {
2589
- const h = await Ue(t);
2590
- Gt(h), Ce(null);
2618
+ const h = await je(t);
2619
+ xe(h), Me(null);
2591
2620
  } catch {
2592
2621
  }
2593
2622
  })();
2594
- }, [o, Ue, t]), be = f(() => {
2623
+ }, [o, je, t]), be = f(() => {
2595
2624
  if (!y)
2596
2625
  return;
2597
2626
  const h = ++Fn.current;
2598
2627
  (async () => {
2599
2628
  try {
2600
- const w = await Qe(t);
2629
+ const w = await Xe(t);
2601
2630
  if (h !== Fn.current)
2602
2631
  return;
2603
- qt(
2632
+ Ge(
2604
2633
  (U) => JSON.stringify(U) === JSON.stringify(w) ? U : w
2605
- ), rt(null);
2634
+ ), st(null);
2606
2635
  } catch {
2607
2636
  }
2608
2637
  })();
2609
- }, [y, Qe, t]), Pt = f(
2638
+ }, [y, Xe, t]), Ht = f(
2610
2639
  (h) => {
2611
- const w = Z.current.bootstrapConversation;
2640
+ const w = X.current.bootstrapConversation;
2612
2641
  w && (async () => {
2613
2642
  try {
2614
- const U = await w.call(Z.current);
2643
+ const U = await w.call(X.current);
2615
2644
  if (Bn.current)
2616
2645
  return;
2617
- const re = U.map(Oe);
2618
- let he = !1;
2619
- j((ht) => ti(ht, re) ? ht : (he = !0, re)), he && (h != null && h.refreshSidePanelsOnChange) && (Ve(), be());
2646
+ const te = U.map(Se);
2647
+ let _e = !1;
2648
+ ie((ht) => ni(ht, te) ? ht : (_e = !0, te)), _e && (h != null && h.refreshSidePanelsOnChange) && (qe(), be());
2620
2649
  } catch {
2621
2650
  }
2622
2651
  })();
2623
2652
  },
2624
- [Ve, be]
2625
- ), $a = f(
2653
+ [qe, be]
2654
+ ), Ha = f(
2626
2655
  (h) => {
2627
2656
  switch (h) {
2628
- case Je.checklist:
2629
- Ve();
2657
+ case Ve.checklist:
2658
+ qe();
2630
2659
  return;
2631
- case Je.resources:
2632
- Ye();
2660
+ case Ve.resources:
2661
+ Ke();
2633
2662
  return;
2634
- case Je.chat:
2635
- Pt();
2663
+ case Ve.chat:
2664
+ Ht();
2636
2665
  return;
2637
- case Je.timeline:
2666
+ case Ve.timeline:
2638
2667
  be();
2639
2668
  return;
2640
- case Je.all:
2669
+ case Ve.all:
2641
2670
  default:
2642
- Ve(), Ye(), Pt(), be();
2671
+ qe(), Ke(), Ht(), be();
2643
2672
  }
2644
2673
  },
2645
- [Ve, Pt, Ye, be]
2646
- ), Ha = Er({
2647
- enabled: !!(a && P && !Ze),
2648
- key: ae,
2674
+ [qe, Ht, Ke, be]
2675
+ ), Ba = br({
2676
+ enabled: !!(a && P && !ne),
2677
+ key: se,
2649
2678
  cluster: ft,
2650
2679
  isAdmin: I
2651
- }), Ba = Ze ?? Ha, qn = yr({
2680
+ }), Ga = ne ?? Ba, qn = yr({
2652
2681
  enabled: a && P,
2653
- channelPrefix: q,
2682
+ channelPrefix: G,
2654
2683
  agentId: e.id || t,
2655
- subscribeToPusher: Ba,
2656
- onRepoll: $a
2684
+ subscribeToPusher: Ga,
2685
+ onRepoll: Ha
2657
2686
  });
2658
2687
  L(() => {
2659
2688
  if (!a || A || J || qn)
2660
2689
  return;
2661
2690
  const h = window.setInterval(() => {
2662
- Pt({ refreshSidePanelsOnChange: !0 });
2663
- }, Qr);
2691
+ Ht({ refreshSidePanelsOnChange: !0 });
2692
+ }, ei);
2664
2693
  return () => {
2665
2694
  window.clearInterval(h);
2666
2695
  };
@@ -2670,285 +2699,285 @@ const Sa = (e, t) => (a) => {
2670
2699
  J,
2671
2700
  qn,
2672
2701
  t,
2673
- M,
2674
- Pt
2702
+ ge,
2703
+ Ht
2675
2704
  ]);
2676
- const rn = f(
2705
+ const an = f(
2677
2706
  (h) => {
2678
2707
  var w, U;
2679
2708
  if (h && h.length > 0) {
2680
- _e(h), (U = (w = Z.current).seedChecklist) == null || U.call(w, h);
2709
+ rt(h), (U = (w = X.current).seedChecklist) == null || U.call(w, h);
2681
2710
  return;
2682
2711
  }
2683
- Ve();
2712
+ qe();
2684
2713
  },
2685
- [Ve]
2714
+ [qe]
2686
2715
  ), kn = f(
2687
2716
  (h) => {
2688
- rn(h.checklist), h.phase && ue(h.phase), Ye(), be();
2717
+ an(h.checklist), h.phase && Te(h.phase), Ke(), be();
2689
2718
  },
2690
- [rn, Ye, be]
2719
+ [an, Ke, be]
2691
2720
  );
2692
2721
  L(() => {
2693
2722
  var h, w;
2694
- !a || A || v && v.length > 0 && ((w = (h = Z.current).seedChecklist) == null || w.call(h, v));
2723
+ !a || A || v && v.length > 0 && ((w = (h = X.current).seedChecklist) == null || w.call(h, v));
2695
2724
  }, [a, A, v]), L(() => {
2696
2725
  if (!a || A)
2697
2726
  return;
2698
2727
  let h = !1;
2699
- return Fe((w) => v != null && v.length ? !1 : w || ze === null || ze.length === 0), it(null), (async () => {
2728
+ return Ct((w) => v != null && v.length ? !1 : w || me === null || me.length === 0), Tt(null), (async () => {
2700
2729
  var w, U;
2701
2730
  try {
2702
- const re = await X(t);
2731
+ const te = await j(t);
2703
2732
  if (h)
2704
2733
  return;
2705
- v != null && v.length || (_e(re.checklist), (U = (w = Z.current).seedChecklist) == null || U.call(w, re.checklist));
2734
+ v != null && v.length || (rt(te.checklist), (U = (w = X.current).seedChecklist) == null || U.call(w, te.checklist));
2706
2735
  } catch {
2707
- !h && !(v != null && v.length) && it(dn);
2736
+ !h && !(v != null && v.length) && Tt(on);
2708
2737
  } finally {
2709
- h || Fe(!1);
2738
+ h || Ct(!1);
2710
2739
  }
2711
2740
  })(), () => {
2712
2741
  h = !0;
2713
2742
  };
2714
- }, [a, t, A, v, X]), L(() => {
2743
+ }, [a, t, A, v, j]), L(() => {
2715
2744
  if (!a || !o)
2716
2745
  return;
2717
2746
  let h = !1;
2718
- return zt(!0), Ce(null), (async () => {
2747
+ return tt(!0), Me(null), (async () => {
2719
2748
  try {
2720
- const w = await Ue(t);
2721
- h || Gt(w);
2749
+ const w = await je(t);
2750
+ h || xe(w);
2722
2751
  } catch {
2723
- h || Ce(ms);
2752
+ h || Me(ms);
2724
2753
  } finally {
2725
- h || zt(!1);
2754
+ h || tt(!1);
2726
2755
  }
2727
2756
  })(), () => {
2728
2757
  h = !0;
2729
2758
  };
2730
- }, [a, t, o, Ue]);
2731
- const Ga = f(() => {
2732
- nt(null), yt(null), Ge(null), Ae(!1);
2733
- }, []), za = f(
2759
+ }, [a, t, o, je]);
2760
+ const za = f(() => {
2761
+ kt(null), Re(null), at(null), He(!1);
2762
+ }, []), Fa = f(
2734
2763
  (h) => {
2735
2764
  if (h.misRecordUrl) {
2736
2765
  window.open(h.misRecordUrl, "_blank", "noopener,noreferrer");
2737
2766
  return;
2738
2767
  }
2739
- nt(h), yt(null), Ge(null), Ae(!0), (async () => {
2768
+ kt(h), Re(null), at(null), He(!0), (async () => {
2740
2769
  try {
2741
- const w = await Mt(t, h.id);
2742
- yt(w);
2770
+ const w = await Ft(t, h.id);
2771
+ Re(w);
2743
2772
  } catch {
2744
- Ge(_s);
2773
+ at(_s);
2745
2774
  } finally {
2746
- Ae(!1);
2775
+ He(!1);
2747
2776
  }
2748
2777
  })();
2749
2778
  },
2750
- [Mt, t]
2779
+ [Ft, t]
2751
2780
  );
2752
2781
  L(() => {
2753
2782
  if (!a || !y)
2754
2783
  return;
2755
2784
  let h = !1;
2756
- return Kt((w) => w || Te === null), rt(null), (async () => {
2785
+ return bt((w) => w || Be === null), st(null), (async () => {
2757
2786
  try {
2758
- const w = await Qe(t);
2759
- h || qt(w);
2787
+ const w = await Xe(t);
2788
+ h || Ge(w);
2760
2789
  } catch {
2761
- h || rt(_a);
2790
+ h || st(pa);
2762
2791
  } finally {
2763
- h || Kt(!1);
2792
+ h || bt(!1);
2764
2793
  }
2765
2794
  })(), () => {
2766
2795
  h = !0;
2767
2796
  };
2768
- }, [a, t, y, Qe]), L(() => {
2797
+ }, [a, t, y, Xe]), L(() => {
2769
2798
  if (!a || !A)
2770
2799
  return;
2771
2800
  let h = !1;
2772
2801
  const w = {
2773
2802
  id: `user-brief-${Date.now()}`,
2774
- author: ve.user,
2803
+ author: ye.user,
2775
2804
  // Read through a ref so a rename cannot re-trigger the agent run.
2776
- text: ei(A, Gn.current)
2805
+ text: ti(A, Gn.current)
2777
2806
  };
2778
2807
  return (async () => {
2779
- const U = await Z.current.start(A);
2780
- h || (j([
2781
- Oe(Z.current.openingMessage()),
2782
- Oe(w),
2783
- Oe(U.message)
2784
- ]), rn(U.checklist), ue(U.phase ?? Y.running), Ye(), be());
2808
+ const U = await X.current.start(A);
2809
+ h || (ie([
2810
+ Se(X.current.openingMessage()),
2811
+ Se(w),
2812
+ Se(U.message)
2813
+ ]), an(U.checklist), Te(U.phase ?? V.running), Ke(), be());
2785
2814
  })(), () => {
2786
2815
  h = !0;
2787
2816
  };
2788
- }, [a, A, t, rn, Ye, be]);
2789
- const bn = D ?? t, ln = Te == null ? void 0 : Te.chatSessions, Kn = ln != null && ln.length ? ln.reduce(
2817
+ }, [a, A, t, an, Ke, be]);
2818
+ const En = D ?? t, sn = Be == null ? void 0 : Be.chatSessions, Kn = sn != null && sn.length ? sn.reduce(
2790
2819
  (h, w) => Date.parse(w.timestamp) < Date.parse(h.timestamp) ? w : h
2791
- ).sessionId : void 0, En = f(() => {
2792
- b("chat"), O(!1), M !== bn && (Ne(bn), j([]), Be((h) => h + 1));
2793
- }, [M, bn]), Fa = f(
2820
+ ).sessionId : void 0, bn = f(() => {
2821
+ E("chat"), O(!1), ge !== En && (de(En), ie([]), et((h) => h + 1));
2822
+ }, [ge, En]), qa = f(
2794
2823
  (h) => {
2795
2824
  if (h === Kn) {
2796
- En();
2825
+ bn();
2797
2826
  return;
2798
2827
  }
2799
- Ne(h), O(!0), b("chat"), j([]), Be((w) => w + 1);
2828
+ de(h), O(!0), E("chat"), ie([]), et((w) => w + 1);
2800
2829
  },
2801
- [Kn, En]
2802
- ), qa = f(async () => {
2830
+ [Kn, bn]
2831
+ ), Ka = f(async () => {
2803
2832
  var h;
2804
- se(null), Ct(!0);
2833
+ ce(null), Yt(!0);
2805
2834
  try {
2806
- await Z.current.pause(), Lt.current += 1, ue(Y.paused), St(!0);
2835
+ await X.current.pause(), $t.current += 1, Te(V.paused), Dt(!0);
2807
2836
  const w = {
2808
2837
  ...dt.current,
2809
- status: E.paused
2838
+ status: b.paused
2810
2839
  };
2811
- dt.current = w, (h = pe.current) == null || h.call(pe, w);
2840
+ dt.current = w, (h = we.current) == null || h.call(we, w);
2812
2841
  } catch {
2813
- se(ps);
2842
+ ce(ps);
2814
2843
  } finally {
2815
- Ct(!1);
2844
+ Yt(!1);
2816
2845
  }
2817
- }, []), Ka = f(async () => {
2846
+ }, []), Va = f(async () => {
2818
2847
  var w;
2819
- se(null), Xt(!0);
2848
+ ce(null), Wt(!0);
2820
2849
  let h = !1;
2821
2850
  try {
2822
- await Z.current.resume(), h = !0, Lt.current += 1, ue(Y.running), St(!1);
2851
+ await X.current.resume(), h = !0, $t.current += 1, Te(V.running), Dt(!1);
2823
2852
  const U = {
2824
2853
  ...dt.current,
2825
- status: E["generating-a-response"]
2854
+ status: b["generating-a-response"]
2826
2855
  };
2827
- dt.current = U, (w = pe.current) == null || w.call(pe, U), It(!0);
2828
- const re = {
2856
+ dt.current = U, (w = we.current) == null || w.call(we, U), Mt(!0);
2857
+ const te = {
2829
2858
  id: `wake-${Date.now()}`,
2830
- author: ve.user,
2831
- text: Jn
2859
+ author: ye.user,
2860
+ text: Wn
2832
2861
  };
2833
- j((ht) => [...ht, Oe(re)]);
2834
- const he = await Z.current.sendMessage(Jn);
2835
- j((ht) => [...ht, Oe(he.message)]), kn(he);
2862
+ ie((ht) => [...ht, Se(te)]);
2863
+ const _e = await X.current.sendMessage(Wn);
2864
+ ie((ht) => [...ht, Se(_e.message)]), kn(_e);
2836
2865
  } catch {
2837
- se(h ? Ss : Rs);
2866
+ ce(h ? Ss : Rs);
2838
2867
  } finally {
2839
- Xt(!1), It(!1);
2868
+ Wt(!1), Mt(!1);
2840
2869
  }
2841
- }, [kn]), Va = f(async () => {
2842
- se(null), ct(null), Qt(!0);
2870
+ }, [kn]), Ya = f(async () => {
2871
+ ce(null), lt(null), Xt(!0);
2843
2872
  try {
2844
- await et(t), Tt(!1), ee == null || ee(), s();
2873
+ await Pe(t), Pt(!1), re == null || re(), s();
2845
2874
  } catch {
2846
- ct(Ln), se(Ln);
2875
+ lt(Ln), ce(Ln);
2847
2876
  } finally {
2848
- Qt(!1);
2877
+ Xt(!1);
2849
2878
  }
2850
- }, [t, et, ee, s]), Ya = f(async () => {
2851
- se(null), qe(null), tn(!0);
2879
+ }, [t, Pe, re, s]), Ja = f(async () => {
2880
+ ce(null), c(null), Qt(!0);
2852
2881
  try {
2853
- await De(t), Hn(null), ue(Y.paused), St(!0), b("chat"), Rt(!1), oe == null || oe();
2882
+ await Ue(t), Hn(null), Te(V.paused), Dt(!0), E("chat"), ot(!1), pe == null || pe();
2854
2883
  } catch {
2855
- qe(Pn), se(Pn);
2884
+ c(Pn), ce(Pn);
2856
2885
  } finally {
2857
- tn(!1);
2886
+ Qt(!1);
2858
2887
  }
2859
- }, [t, De, oe]), Ja = f(async () => {
2860
- se(null), ke(null), C(!0);
2888
+ }, [t, Ue, pe]), Wa = f(async () => {
2889
+ ce(null), ve(null), T(!0);
2861
2890
  try {
2862
- await xe(t), le(!1), ge == null || ge(), s();
2891
+ await vt(t), Ee(!1), Ae == null || Ae(), s();
2863
2892
  } catch (h) {
2864
- ke(Ia(h));
2893
+ ve(La(h));
2865
2894
  } finally {
2866
- C(!1);
2895
+ T(!1);
2867
2896
  }
2868
- }, [t, xe, ge, s]), ja = f(
2897
+ }, [t, vt, Ae, s]), ja = f(
2869
2898
  (h) => {
2870
- const w = h.trim(), U = Me;
2871
- if (Ee(null), !w) {
2872
- $e((re) => re + 1);
2899
+ const w = h.trim(), U = ae;
2900
+ if (Nt(null), !w) {
2901
+ Ce((te) => te + 1);
2873
2902
  return;
2874
2903
  }
2875
- w !== U && (ce(w), (async () => {
2904
+ w !== U && (Qe(w), (async () => {
2876
2905
  try {
2877
- await $t(t, w);
2906
+ await Ze(t, w);
2878
2907
  } catch {
2879
- ce(U), $e((re) => re + 1), Ee(Os);
2908
+ Qe(U), Ce((te) => te + 1), Nt(Os);
2880
2909
  }
2881
2910
  })());
2882
2911
  },
2883
- [Me, t, $t]
2884
- ), Wa = f(() => {
2885
- if (!I || lt || Re)
2912
+ [ae, t, Ze]
2913
+ ), Xa = f(() => {
2914
+ if (!I || ze || St)
2886
2915
  return;
2887
2916
  const h = ++ut.current;
2888
- bt(!0), Et(null), (async () => {
2917
+ Ot(!0), It(null), (async () => {
2889
2918
  try {
2890
- const w = await ye(t);
2919
+ const w = await ke(t);
2891
2920
  if (ut.current !== h)
2892
2921
  return;
2893
- kt(w), ot(!0);
2922
+ Rt(w), Fe(!0);
2894
2923
  } catch {
2895
- ut.current === h && Et(gs);
2924
+ ut.current === h && It(gs);
2896
2925
  } finally {
2897
- ut.current === h && bt(!1);
2926
+ ut.current === h && Ot(!1);
2898
2927
  }
2899
2928
  })();
2900
- }, [I, lt, Re, ye, t]), Xa = ze;
2901
- return /* @__PURE__ */ c(de, { children: [
2902
- /* @__PURE__ */ c(F, { open: a, closeHandler: s, hideCloseButton: !0, className: "agent-workspace", children: [
2903
- /* @__PURE__ */ c(F.Header, { className: "agent-workspace__header", children: [
2904
- /* @__PURE__ */ c("div", { className: "agent-workspace__header-title", children: [
2929
+ }, [I, ze, St, ke, t]), Za = me;
2930
+ return /* @__PURE__ */ d(he, { children: [
2931
+ /* @__PURE__ */ d(F, { open: a, closeHandler: s, hideCloseButton: !0, className: "agent-workspace", children: [
2932
+ /* @__PURE__ */ d(F.Header, { className: "agent-workspace__header", children: [
2933
+ /* @__PURE__ */ d("div", { className: "agent-workspace__header-title", children: [
2905
2934
  /* @__PURE__ */ n("span", { className: "agent-workspace__header-avatar", "aria-hidden": "true", children: /* @__PURE__ */ n($, { name: "ask-arbor", size: 24 }) }),
2906
- /* @__PURE__ */ n(F.Title, { children: J ? /* @__PURE__ */ n("span", { className: "agent-workspace__header-name", children: Me }) : /* @__PURE__ */ n(
2907
- Qa,
2935
+ /* @__PURE__ */ n(F.Title, { children: J ? /* @__PURE__ */ n("span", { className: "agent-workspace__header-name", children: ae }) : /* @__PURE__ */ n(
2936
+ es,
2908
2937
  {
2909
2938
  className: "agent-workspace__header-name",
2910
- text: Me,
2939
+ text: ae,
2911
2940
  onEditSave: ja
2912
2941
  },
2913
- Ht
2942
+ wt
2914
2943
  ) }),
2915
2944
  /* @__PURE__ */ n(
2916
2945
  "span",
2917
2946
  {
2918
- className: ne("agent-workspace__phase", `agent-workspace__phase--${me}`),
2919
- children: Ds[me]
2947
+ className: ee("agent-workspace__phase", `agent-workspace__phase--${le}`),
2948
+ children: xs[le]
2920
2949
  }
2921
2950
  ),
2922
2951
  J ? /* @__PURE__ */ n("span", { className: "agent-workspace__phase agent-workspace__phase--archived", children: "Archived" }) : null,
2923
- He && /* @__PURE__ */ n("p", { className: "agent-workspace__error agent-workspace__name-error", role: "alert", children: He })
2952
+ De && /* @__PURE__ */ n("p", { className: "agent-workspace__error agent-workspace__name-error", role: "alert", children: De })
2924
2953
  ] }),
2925
- /* @__PURE__ */ c("div", { className: "agent-workspace__header-actions", children: [
2954
+ /* @__PURE__ */ d("div", { className: "agent-workspace__header-actions", children: [
2926
2955
  /* @__PURE__ */ n(
2927
- G,
2956
+ z,
2928
2957
  {
2929
- variant: an ? "secondary" : "primary",
2958
+ variant: tn ? "secondary" : "primary",
2930
2959
  size: "S",
2931
2960
  iconLeftName: "clipboard-list",
2932
2961
  iconLeftScreenReaderText: "Toggle checklist",
2933
- "aria-pressed": !an,
2934
- onClick: () => xa((h) => !h),
2962
+ "aria-pressed": !tn,
2963
+ onClick: () => Ma((h) => !h),
2935
2964
  children: "Checklist"
2936
2965
  }
2937
2966
  ),
2938
2967
  /* @__PURE__ */ n(
2939
- G,
2968
+ z,
2940
2969
  {
2941
- variant: sn ? "secondary" : "primary",
2970
+ variant: nn ? "secondary" : "primary",
2942
2971
  size: "S",
2943
2972
  iconLeftName: "files",
2944
2973
  iconLeftScreenReaderText: "Toggle resources",
2945
- "aria-pressed": !sn,
2946
- onClick: () => Ma((h) => !h),
2974
+ "aria-pressed": !nn,
2975
+ onClick: () => $a((h) => !h),
2947
2976
  children: "Resources"
2948
2977
  }
2949
2978
  ),
2950
2979
  /* @__PURE__ */ n(
2951
- G,
2980
+ z,
2952
2981
  {
2953
2982
  variant: "secondary",
2954
2983
  size: "S",
@@ -2960,52 +2989,52 @@ const Sa = (e, t) => (a) => {
2960
2989
  )
2961
2990
  ] })
2962
2991
  ] }),
2963
- /* @__PURE__ */ c(
2992
+ /* @__PURE__ */ d(
2964
2993
  F.Body,
2965
2994
  {
2966
- className: ne("agent-workspace__body", {
2967
- "agent-workspace__body--no-checklist": an,
2968
- "agent-workspace__body--no-resources": sn
2995
+ className: ee("agent-workspace__body", {
2996
+ "agent-workspace__body--no-checklist": tn,
2997
+ "agent-workspace__body--no-resources": nn
2969
2998
  }),
2970
2999
  children: [
2971
- /* @__PURE__ */ c(
3000
+ /* @__PURE__ */ d(
2972
3001
  "section",
2973
3002
  {
2974
- className: ne("agent-workspace__panel", "agent-workspace__panel--chat", {
2975
- "agent-workspace__panel--timeline": !!y && (J || ie === "timeline")
3003
+ className: ee("agent-workspace__panel", "agent-workspace__panel--chat", {
3004
+ "agent-workspace__panel--timeline": !!y && (J || fe === "timeline")
2976
3005
  }),
2977
3006
  "aria-label": "Agent",
2978
3007
  children: [
2979
- /* @__PURE__ */ c("div", { className: "agent-workspace__panel-header", children: [
2980
- /* @__PURE__ */ n(Xe, { level: 4, children: "Agent" }),
2981
- l && !Ot && !J && me === Y.running && /* @__PURE__ */ n(
2982
- G,
3008
+ /* @__PURE__ */ d("div", { className: "agent-workspace__panel-header", children: [
3009
+ /* @__PURE__ */ n(We, { level: 4, children: "Agent" }),
3010
+ l && !xt && !J && le === V.running && /* @__PURE__ */ n(
3011
+ z,
2983
3012
  {
2984
3013
  className: "agent-workspace__panel-header-action",
2985
3014
  variant: "secondary-destructive",
2986
3015
  size: "S",
2987
3016
  iconLeftName: "circle-x",
2988
3017
  iconLeftScreenReaderText: "Pause",
2989
- disabled: jt,
2990
- onClick: () => void qa(),
2991
- children: jt ? "Pausing…" : "Pause agent"
3018
+ disabled: Lt,
3019
+ onClick: () => void Ka(),
3020
+ children: Lt ? "Pausing…" : "Pause agent"
2992
3021
  }
2993
3022
  ),
2994
- N && !Ot && !J && me === Y.paused && Ua && /* @__PURE__ */ n(
2995
- G,
3023
+ N && !xt && !J && le === V.paused && Da && /* @__PURE__ */ n(
3024
+ z,
2996
3025
  {
2997
3026
  className: "agent-workspace__panel-header-action",
2998
3027
  variant: "secondary",
2999
3028
  size: "S",
3000
3029
  iconLeftName: "iteration-ccw",
3001
3030
  iconLeftScreenReaderText: "Resume",
3002
- disabled: Wt,
3003
- onClick: () => void Ka(),
3004
- children: Wt ? "Resuming…" : "Resume agent"
3031
+ disabled: Jt,
3032
+ onClick: () => void Va(),
3033
+ children: Jt ? "Resuming…" : "Resume agent"
3005
3034
  }
3006
3035
  ),
3007
- S && !Ot && !J && /* @__PURE__ */ n(
3008
- G,
3036
+ S && !xt && !J && /* @__PURE__ */ n(
3037
+ z,
3009
3038
  {
3010
3039
  className: "agent-workspace__panel-header-action",
3011
3040
  variant: "secondary",
@@ -3013,52 +3042,52 @@ const Sa = (e, t) => (a) => {
3013
3042
  iconLeftName: "archive",
3014
3043
  iconLeftScreenReaderText: "Archive",
3015
3044
  onClick: () => {
3016
- ct(null), se(null), Tt(!0);
3045
+ lt(null), ce(null), Pt(!0);
3017
3046
  },
3018
3047
  children: "Archive agent"
3019
3048
  }
3020
3049
  ),
3021
- R && !Ot && J && /* @__PURE__ */ n(
3022
- G,
3050
+ R && !xt && J && /* @__PURE__ */ n(
3051
+ z,
3023
3052
  {
3024
3053
  className: "agent-workspace__panel-header-action",
3025
3054
  variant: "secondary",
3026
3055
  size: "S",
3027
3056
  onClick: () => {
3028
- qe(null), se(null), Rt(!0);
3057
+ c(null), ce(null), ot(!0);
3029
3058
  },
3030
3059
  children: "Unarchive agent"
3031
3060
  }
3032
3061
  ),
3033
3062
  I && J && /* @__PURE__ */ n(
3034
- G,
3063
+ z,
3035
3064
  {
3036
3065
  className: "agent-workspace__panel-header-action",
3037
3066
  variant: "secondary-destructive",
3038
3067
  size: "S",
3039
3068
  onClick: () => {
3040
- ke(null), se(null), le(!0);
3069
+ ve(null), ce(null), Ee(!0);
3041
3070
  },
3042
3071
  children: "Delete agent"
3043
3072
  }
3044
3073
  )
3045
3074
  ] }),
3046
- Se && /* @__PURE__ */ n(
3075
+ Ut && /* @__PURE__ */ n(
3047
3076
  "p",
3048
3077
  {
3049
3078
  className: "agent-workspace__error agent-workspace__lifecycle-error",
3050
3079
  role: "alert",
3051
- children: Se
3080
+ children: Ut
3052
3081
  }
3053
3082
  ),
3054
- y && !J && /* @__PURE__ */ c(_t, { className: "agent-workspace__center-tabs", "aria-label": "Center panel", children: [
3083
+ y && !J && /* @__PURE__ */ d(_t, { className: "agent-workspace__center-tabs", "aria-label": "Center panel", children: [
3055
3084
  /* @__PURE__ */ n(
3056
3085
  _t.Item,
3057
3086
  {
3058
- active: ie === "chat",
3087
+ active: fe === "chat",
3059
3088
  tabElementProps: {
3060
3089
  id: "agent-center-tab-chat",
3061
- onClick: () => b("chat")
3090
+ onClick: () => E("chat")
3062
3091
  },
3063
3092
  children: "Chat"
3064
3093
  }
@@ -3066,51 +3095,51 @@ const Sa = (e, t) => (a) => {
3066
3095
  /* @__PURE__ */ n(
3067
3096
  _t.Item,
3068
3097
  {
3069
- active: ie === "timeline",
3098
+ active: fe === "timeline",
3070
3099
  tabElementProps: {
3071
3100
  id: "agent-center-tab-timeline",
3072
- onClick: () => b("timeline")
3101
+ onClick: () => E("timeline")
3073
3102
  },
3074
3103
  children: "Timeline"
3075
3104
  }
3076
3105
  )
3077
3106
  ] }),
3078
- y && !J && ie === "chat" && B && /* @__PURE__ */ n("div", { className: "agent-workspace__center-back", children: /* @__PURE__ */ n(
3079
- G,
3107
+ y && !J && fe === "chat" && M && /* @__PURE__ */ n("div", { className: "agent-workspace__center-back", children: /* @__PURE__ */ n(
3108
+ z,
3080
3109
  {
3081
3110
  variant: "tertiary",
3082
3111
  size: "S",
3083
3112
  iconLeftName: "arrow-left",
3084
3113
  iconLeftScreenReaderText: "Back to main chat",
3085
- onClick: En,
3114
+ onClick: bn,
3086
3115
  children: "Back to main chat"
3087
3116
  }
3088
3117
  ) }),
3089
- y && (J || ie === "timeline") && /* @__PURE__ */ n(
3090
- hr,
3118
+ y && (J || fe === "timeline") && /* @__PURE__ */ n(
3119
+ gr,
3091
3120
  {
3092
- timeline: Te,
3093
- isLoading: st,
3094
- error: Vt,
3095
- onOpenChatSession: J ? void 0 : Fa
3121
+ timeline: Be,
3122
+ isLoading: fn,
3123
+ error: qt,
3124
+ onOpenChatSession: J ? void 0 : qa
3096
3125
  }
3097
3126
  ),
3098
3127
  !J && /* @__PURE__ */ n(
3099
3128
  "div",
3100
3129
  {
3101
3130
  className: "agent-workspace__chat-keep-alive",
3102
- hidden: !!y && ie !== "chat",
3131
+ hidden: !!y && fe !== "chat",
3103
3132
  children: /* @__PURE__ */ n(
3104
- Ws,
3133
+ Xs,
3105
3134
  {
3106
- connector: z,
3107
- phase: me,
3108
- chatHistory: pn,
3109
- chatSessionKey: vt,
3110
- readOnly: Ot,
3135
+ connector: Y,
3136
+ phase: le,
3137
+ chatHistory: ue,
3138
+ chatSessionKey: yt,
3139
+ readOnly: xt,
3111
3140
  enableUpload: x,
3112
3141
  onTurn: kn,
3113
- onAwaitingChange: It
3142
+ onAwaitingChange: Mt
3114
3143
  }
3115
3144
  )
3116
3145
  }
@@ -3119,39 +3148,39 @@ const Sa = (e, t) => (a) => {
3119
3148
  ]
3120
3149
  }
3121
3150
  ),
3122
- !an && /* @__PURE__ */ n(
3123
- Xs,
3151
+ !tn && /* @__PURE__ */ n(
3152
+ Zs,
3124
3153
  {
3125
- checklist: Xa,
3126
- isLoading: Yt,
3127
- error: Jt,
3128
- phase: me,
3154
+ checklist: Za,
3155
+ isLoading: it,
3156
+ error: Kt,
3157
+ phase: le,
3129
3158
  adminMode: I,
3130
- context: fn,
3131
- contextLoaded: lt,
3132
- contextLoading: Re,
3159
+ context: Vt,
3160
+ contextLoaded: ze,
3161
+ contextLoading: St,
3133
3162
  contextError: vn,
3134
- onContextSelect: Wa
3163
+ onContextSelect: Xa
3135
3164
  },
3136
3165
  t
3137
3166
  ),
3138
- !sn && /* @__PURE__ */ n(
3139
- er,
3167
+ !nn && /* @__PURE__ */ n(
3168
+ tr,
3140
3169
  {
3141
- resources: Bt,
3142
- isLoading: tt,
3143
- error: wt,
3144
- onOpenResource: za
3170
+ resources: mn,
3171
+ isLoading: _n,
3172
+ error: nt,
3173
+ onOpenResource: Fa
3145
3174
  }
3146
3175
  ),
3147
3176
  /* @__PURE__ */ n(
3148
- Zs,
3177
+ Qs,
3149
3178
  {
3150
- resource: Nt,
3151
- html: Ft,
3152
- isLoading: at,
3153
- error: At,
3154
- onClose: Ga
3179
+ resource: At,
3180
+ html: pn,
3181
+ isLoading: $e,
3182
+ error: Et,
3183
+ onClose: za
3155
3184
  }
3156
3185
  )
3157
3186
  ]
@@ -3159,50 +3188,50 @@ const Sa = (e, t) => (a) => {
3159
3188
  )
3160
3189
  ] }),
3161
3190
  /* @__PURE__ */ n(
3162
- Na,
3191
+ ya,
3163
3192
  {
3164
3193
  open: wn,
3165
- isInProgress: me === Y.running || me === Y.paused && !ka(ze ?? void 0),
3166
- isArchiving: Zt,
3194
+ isInProgress: le === V.running || le === V.paused && !Ea(me ?? void 0),
3195
+ isArchiving: jt,
3167
3196
  error: Nn,
3168
3197
  onCancel: () => {
3169
- Zt || (ct(null), Tt(!1));
3198
+ jt || (lt(null), Pt(!1));
3170
3199
  },
3171
3200
  onConfirm: () => {
3172
- Va();
3201
+ Ya();
3173
3202
  }
3174
3203
  }
3175
3204
  ),
3176
3205
  /* @__PURE__ */ n(
3177
- Aa,
3206
+ ka,
3178
3207
  {
3179
3208
  open: yn,
3180
- isUnarchiving: en,
3181
- error: nn,
3209
+ isUnarchiving: Zt,
3210
+ error: en,
3182
3211
  onCancel: () => {
3183
- en || (qe(null), Rt(!1));
3212
+ Zt || (c(null), ot(!1));
3184
3213
  },
3185
3214
  onConfirm: () => {
3186
- Ya();
3215
+ Ja();
3187
3216
  }
3188
3217
  }
3189
3218
  ),
3190
3219
  /* @__PURE__ */ n(
3191
- ya,
3220
+ Aa,
3192
3221
  {
3193
- open: T,
3194
- isDeleting: d,
3195
- error: Ke,
3222
+ open: oe,
3223
+ isDeleting: C,
3224
+ error: ct,
3196
3225
  onCancel: () => {
3197
- d || (ke(null), le(!1));
3226
+ C || (ve(null), Ee(!1));
3198
3227
  },
3199
3228
  onConfirm: () => {
3200
- Ja();
3229
+ Wa();
3201
3230
  }
3202
3231
  }
3203
3232
  )
3204
3233
  ] });
3205
- }, ai = "Unable to load agent definitions. Please try again.", si = "Unable to start the agent.", ia = "Loading agents…", ri = "Which agent?", ii = "Select an agent", li = "Name for this run", oi = "e.g. Year 6 Science Museum trip", ci = "Shown on the board and in the workspace", la = "new-agent-invocation-name-hint", La = ({
3234
+ }, si = "Unable to load agent definitions. Please try again.", ri = "Unable to start the agent.", la = "Loading agents…", ii = "Which agent?", li = "Select an agent", oi = "Name for this run", ci = "e.g. Year 6 Science Museum trip", di = "Shown on the board and in the workspace", oa = "new-agent-invocation-name-hint", Pa = ({
3206
3235
  open: e,
3207
3236
  onClose: t,
3208
3237
  onStart: a,
@@ -3212,7 +3241,7 @@ const Sa = (e, t) => (a) => {
3212
3241
  onRetryDefinitions: i,
3213
3242
  embedded: m = !1
3214
3243
  }) => {
3215
- const [o, y] = g(void 0), [p, k] = g(""), [l, N] = g(!1), [S, R] = g(null), D = [...s].sort((P, q) => P.display_name.localeCompare(q.display_name)).map((P) => ({
3244
+ const [o, y] = g(void 0), [p, k] = g(""), [l, N] = g(!1), [S, R] = g(null), D = [...s].sort((P, G) => P.display_name.localeCompare(G.display_name)).map((P) => ({
3216
3245
  value: P.ref,
3217
3246
  label: P.display_name
3218
3247
  }));
@@ -3221,8 +3250,8 @@ const Sa = (e, t) => (a) => {
3221
3250
  }, [e]);
3222
3251
  const x = o !== void 0 && p.trim().length > 0, I = f(
3223
3252
  (P) => {
3224
- const q = s.find((ae) => ae.ref === P[0]);
3225
- q && y(q);
3253
+ const G = s.find((se) => se.ref === P[0]);
3254
+ G && y(G);
3226
3255
  },
3227
3256
  [s]
3228
3257
  ), A = f(async () => {
@@ -3231,7 +3260,7 @@ const Sa = (e, t) => (a) => {
3231
3260
  try {
3232
3261
  await a({ definition: o, invocationName: p.trim() });
3233
3262
  } catch (P) {
3234
- R(P instanceof Error ? P.message : si);
3263
+ R(P instanceof Error ? P.message : ri);
3235
3264
  } finally {
3236
3265
  N(!1);
3237
3266
  }
@@ -3239,12 +3268,12 @@ const Sa = (e, t) => (a) => {
3239
3268
  }, [x, o, p, l, a]);
3240
3269
  if (r === "idle" && s.length === 0 || !e)
3241
3270
  return null;
3242
- const _ = /* @__PURE__ */ c("div", { className: "new-agent__header-title", children: [
3271
+ const _ = /* @__PURE__ */ d("div", { className: "new-agent__header-title", children: [
3243
3272
  /* @__PURE__ */ n("span", { className: "new-agent__header-avatar", "aria-hidden": "true", children: /* @__PURE__ */ n($, { name: "ask-arbor", size: 24 }) }),
3244
3273
  m ? /* @__PURE__ */ n("h2", { className: "new-agent__title", children: "Start an agent" }) : /* @__PURE__ */ n(F.Title, { children: "Start an agent" })
3245
3274
  ] });
3246
3275
  let v;
3247
- return r === "loading" ? v = /* @__PURE__ */ c("div", { className: "new-agent__state", "aria-live": "polite", children: [
3276
+ return r === "loading" ? v = /* @__PURE__ */ d("div", { className: "new-agent__state", "aria-live": "polite", children: [
3248
3277
  /* @__PURE__ */ n(
3249
3278
  $,
3250
3279
  {
@@ -3252,15 +3281,15 @@ const Sa = (e, t) => (a) => {
3252
3281
  size: 24,
3253
3282
  color: "var(--color-brand-600)",
3254
3283
  className: "new-agent__spinner",
3255
- screenReaderText: ia
3284
+ screenReaderText: la
3256
3285
  }
3257
3286
  ),
3258
- /* @__PURE__ */ n("p", { className: "new-agent__state-message", children: ia })
3259
- ] }) : r === "error" ? v = /* @__PURE__ */ c("div", { className: "new-agent__state new-agent__state--error", role: "alert", children: [
3287
+ /* @__PURE__ */ n("p", { className: "new-agent__state-message", children: la })
3288
+ ] }) : r === "error" ? v = /* @__PURE__ */ d("div", { className: "new-agent__state new-agent__state--error", role: "alert", children: [
3260
3289
  /* @__PURE__ */ n($, { name: "triangle-alert", size: 24, color: "var(--color-semantic-destructive-600)" }),
3261
- /* @__PURE__ */ n("p", { className: "new-agent__state-message", children: u ?? ai }),
3262
- i ? /* @__PURE__ */ n(G, { variant: "secondary", size: "S", onClick: i, children: "Try again" }) : null
3263
- ] }) : v = /* @__PURE__ */ c(
3290
+ /* @__PURE__ */ n("p", { className: "new-agent__state-message", children: u ?? si }),
3291
+ i ? /* @__PURE__ */ n(z, { variant: "secondary", size: "S", onClick: i, children: "Try again" }) : null
3292
+ ] }) : v = /* @__PURE__ */ d(
3264
3293
  "form",
3265
3294
  {
3266
3295
  className: "new-agent__form",
@@ -3269,40 +3298,40 @@ const Sa = (e, t) => (a) => {
3269
3298
  P.preventDefault(), x && !l && A();
3270
3299
  },
3271
3300
  children: [
3272
- /* @__PURE__ */ c("div", { className: "new-agent__type-field", children: [
3273
- /* @__PURE__ */ n("label", { className: "new-agent__type-label", htmlFor: "new-agent-type", children: ri }),
3301
+ /* @__PURE__ */ d("div", { className: "new-agent__type-field", children: [
3302
+ /* @__PURE__ */ n("label", { className: "new-agent__type-label", htmlFor: "new-agent-type", children: ii }),
3274
3303
  /* @__PURE__ */ n(
3275
- es,
3304
+ ts,
3276
3305
  {
3277
3306
  id: "new-agent-type",
3278
- placeholder: ii,
3307
+ placeholder: li,
3279
3308
  options: D,
3280
3309
  selectedValues: o ? [o.ref] : [],
3281
3310
  onSelectionChange: I
3282
3311
  }
3283
3312
  )
3284
3313
  ] }),
3285
- /* @__PURE__ */ c("div", { className: "new-agent__type-field", children: [
3286
- /* @__PURE__ */ n("label", { className: "new-agent__type-label", htmlFor: "new-agent-invocation-name", children: li }),
3314
+ /* @__PURE__ */ d("div", { className: "new-agent__type-field", children: [
3315
+ /* @__PURE__ */ n("label", { className: "new-agent__type-label", htmlFor: "new-agent-invocation-name", children: oi }),
3287
3316
  /* @__PURE__ */ n(
3288
- ts,
3317
+ ns,
3289
3318
  {
3290
3319
  id: "new-agent-invocation-name",
3291
3320
  value: p,
3292
- placeholder: oi,
3293
- "aria-describedby": la,
3321
+ placeholder: ci,
3322
+ "aria-describedby": oa,
3294
3323
  onChange: (P) => k(P.target.value)
3295
3324
  }
3296
3325
  ),
3297
- /* @__PURE__ */ n("p", { className: "new-agent__field-hint", id: la, children: ci })
3326
+ /* @__PURE__ */ n("p", { className: "new-agent__field-hint", id: oa, children: di })
3298
3327
  ] }),
3299
3328
  S ? /* @__PURE__ */ n("p", { className: "new-agent__error", role: "alert", children: S }) : null,
3300
3329
  /* @__PURE__ */ n("div", { className: "new-agent__actions", children: /* @__PURE__ */ n(
3301
- G,
3330
+ z,
3302
3331
  {
3303
3332
  type: "submit",
3304
3333
  variant: "primary",
3305
- className: ne("new-agent__start-button", {
3334
+ className: ee("new-agent__start-button", {
3306
3335
  "new-agent__start-button--starting": l
3307
3336
  }),
3308
3337
  disabled: !x || l,
@@ -3313,16 +3342,16 @@ const Sa = (e, t) => (a) => {
3313
3342
  ) })
3314
3343
  ]
3315
3344
  }
3316
- ), m ? /* @__PURE__ */ c("div", { className: ne("new-agent", "new-agent--embedded"), children: [
3345
+ ), m ? /* @__PURE__ */ d("div", { className: ee("new-agent", "new-agent--embedded"), children: [
3317
3346
  /* @__PURE__ */ n("div", { className: "new-agent__header", children: _ }),
3318
3347
  /* @__PURE__ */ n("div", { className: "new-agent__body", children: v })
3319
- ] }) : /* @__PURE__ */ c(F, { open: e, closeHandler: t, className: "new-agent", children: [
3348
+ ] }) : /* @__PURE__ */ d(F, { open: e, closeHandler: t, className: "new-agent", children: [
3320
3349
  /* @__PURE__ */ n(F.Header, { className: "new-agent__header", children: _ }),
3321
3350
  /* @__PURE__ */ n(F.Body, { className: "new-agent__body", children: v })
3322
3351
  ] });
3323
- }, oa = (e) => {
3352
+ }, ca = (e) => {
3324
3353
  window.location.assign(e);
3325
- }, di = ({
3354
+ }, ui = ({
3326
3355
  open: e,
3327
3356
  authToken: t,
3328
3357
  headers: a,
@@ -3334,7 +3363,7 @@ const Sa = (e, t) => (a) => {
3334
3363
  onStart: o,
3335
3364
  embedded: y = !1
3336
3365
  }) => {
3337
- const p = JSON.stringify(a ?? {}), k = Q(
3366
+ const p = JSON.stringify(a ?? {}), k = Z(
3338
3367
  () => new $n({
3339
3368
  token: t,
3340
3369
  headers: a,
@@ -3349,36 +3378,36 @@ const Sa = (e, t) => (a) => {
3349
3378
  L(() => {
3350
3379
  if (!e)
3351
3380
  return;
3352
- let q = !1;
3381
+ let G = !1;
3353
3382
  return R("loading"), x(null), (async () => {
3354
3383
  try {
3355
- const ae = await k.listAgentDefinitions();
3356
- if (q)
3384
+ const se = await k.listAgentDefinitions();
3385
+ if (G)
3357
3386
  return;
3358
- N(ae.map(Ta)), R("idle");
3359
- } catch (ae) {
3360
- if (q)
3387
+ N(se.map(Ra)), R("idle");
3388
+ } catch (se) {
3389
+ if (G)
3361
3390
  return;
3362
- N([]), x(Oa(ae)), R("error");
3391
+ N([]), x(Ia(se)), R("error");
3363
3392
  }
3364
3393
  })(), () => {
3365
- q = !0;
3394
+ G = !0;
3366
3395
  };
3367
3396
  }, [k, e, I]);
3368
3397
  const _ = f(() => {
3369
- m == null || m(), u && oa(u);
3398
+ m == null || m(), u && ca(u);
3370
3399
  }, [u, m]), v = f(
3371
- async (q) => {
3372
- await k.createAgent(q.definition.ref, {
3373
- invocationName: q.invocationName
3374
- }), o == null || o(q), i && oa(i);
3400
+ async (G) => {
3401
+ await k.createAgent(G.definition.ref, {
3402
+ invocationName: G.invocationName
3403
+ }), o == null || o(G), i && ca(i);
3375
3404
  },
3376
3405
  [k, o, i]
3377
3406
  ), P = f(() => {
3378
- A((q) => q + 1);
3407
+ A((G) => G + 1);
3379
3408
  }, []);
3380
3409
  return /* @__PURE__ */ n(
3381
- La,
3410
+ Pa,
3382
3411
  {
3383
3412
  open: e,
3384
3413
  onClose: _,
@@ -3390,37 +3419,37 @@ const Sa = (e, t) => (a) => {
3390
3419
  embedded: y
3391
3420
  }
3392
3421
  );
3393
- }, ui = (e) => "agentDefinitionsUrl" in e, hi = (e) => ui(e) ? /* @__PURE__ */ n(di, { ...e }) : /* @__PURE__ */ n(La, { ...e }), gi = ({ open: e, onClose: t }) => {
3394
- const a = Pe(), s = Pe();
3395
- return /* @__PURE__ */ c(
3422
+ }, hi = (e) => "agentDefinitionsUrl" in e, gi = (e) => hi(e) ? /* @__PURE__ */ n(ui, { ...e }) : /* @__PURE__ */ n(Pa, { ...e }), mi = ({ open: e, onClose: t }) => {
3423
+ const a = Le(), s = Le();
3424
+ return /* @__PURE__ */ d(
3396
3425
  F,
3397
3426
  {
3398
3427
  open: e,
3399
3428
  closeHandler: t,
3400
3429
  className: "archive-agent-confirm",
3401
3430
  children: [
3402
- /* @__PURE__ */ n(F.Header, { className: "archive-agent-confirm__header", children: /* @__PURE__ */ n(F.Title, { id: a, children: Ls }) }),
3403
- /* @__PURE__ */ c(F.Body, { className: "archive-agent-confirm__body", children: [
3431
+ /* @__PURE__ */ n(F.Header, { className: "archive-agent-confirm__header", children: /* @__PURE__ */ n(F.Title, { id: a, children: Ps }) }),
3432
+ /* @__PURE__ */ d(F.Body, { className: "archive-agent-confirm__body", children: [
3404
3433
  /* @__PURE__ */ n(
3405
3434
  "div",
3406
3435
  {
3407
3436
  role: "alertdialog",
3408
3437
  "aria-labelledby": a,
3409
3438
  "aria-describedby": s,
3410
- children: /* @__PURE__ */ n("p", { id: s, className: "archive-agent-confirm__lead", children: Ps })
3439
+ children: /* @__PURE__ */ n("p", { id: s, className: "archive-agent-confirm__lead", children: Us })
3411
3440
  }
3412
3441
  ),
3413
- /* @__PURE__ */ n("div", { className: "archive-agent-confirm__actions", children: /* @__PURE__ */ n(G, { variant: "secondary", size: "S", onClick: t, children: "Close" }) })
3442
+ /* @__PURE__ */ n("div", { className: "archive-agent-confirm__actions", children: /* @__PURE__ */ n(z, { variant: "secondary", size: "S", onClick: t, children: "Close" }) })
3414
3443
  ] })
3415
3444
  ]
3416
3445
  }
3417
3446
  );
3418
- }, mi = 3, _i = 56, pi = (e) => e.archivedAt ? "archived" : e.status === E.paused ? "paused" : null, fi = (e) => {
3447
+ }, _i = 3, pi = 56, fi = (e) => e.archivedAt ? "archived" : e.status === b.paused ? "paused" : null, vi = (e) => {
3419
3448
  if (e === "archived")
3420
3449
  return ds;
3421
3450
  if (e === "paused")
3422
- return pt[E.paused].statusIcon;
3423
- }, vi = ({
3451
+ return pt[b.paused].statusIcon;
3452
+ }, wi = ({
3424
3453
  column: e,
3425
3454
  overlayIcon: t,
3426
3455
  label: a
@@ -3432,7 +3461,7 @@ const Sa = (e, t) => (a) => {
3432
3461
  name: s.name,
3433
3462
  size: 16,
3434
3463
  color: s.color,
3435
- className: ne({
3464
+ className: ee({
3436
3465
  "agent-view__progress-icon--spinning": s.spin
3437
3466
  }),
3438
3467
  screenReaderText: a
@@ -3440,13 +3469,13 @@ const Sa = (e, t) => (a) => {
3440
3469
  ) }) : /* @__PURE__ */ n(
3441
3470
  "span",
3442
3471
  {
3443
- className: ne("agent-view__dot", {
3472
+ className: ee("agent-view__dot", {
3444
3473
  [`agent-view__dot--${e.dotModifier}`]: e.dotModifier
3445
3474
  }),
3446
- children: /* @__PURE__ */ n(da, { colour: e.dotColour, label: a })
3475
+ children: /* @__PURE__ */ n(ua, { colour: e.dotColour, label: a })
3447
3476
  }
3448
3477
  );
3449
- }, Pa = ({
3478
+ }, Ua = ({
3450
3479
  agent: e,
3451
3480
  agentName: t,
3452
3481
  column: a,
@@ -3463,17 +3492,17 @@ const Sa = (e, t) => (a) => {
3463
3492
  onUnarchive: N,
3464
3493
  onDelete: S
3465
3494
  }) => {
3466
- const { id: R, invocation_name: D } = e, x = `agent-card-${R}-header`, I = `agent-card-${R}-progress`, A = pi(e), _ = fi(A);
3495
+ const { id: R, invocation_name: D } = e, x = `agent-card-${R}-header`, I = `agent-card-${R}-progress`, A = fi(e), _ = vi(A);
3467
3496
  return /* @__PURE__ */ n(
3468
3497
  "li",
3469
3498
  {
3470
- className: ne("agent-view__card", {
3499
+ className: ee("agent-view__card", {
3471
3500
  "agent-view__card--expanded": s,
3472
3501
  "agent-view__card--paused": A === "paused",
3473
3502
  "agent-view__card--archived": A === "archived",
3474
3503
  "agent-view__card--view-only": !e.usable
3475
3504
  }),
3476
- children: /* @__PURE__ */ c(ns, { spacing: "dense", children: [
3505
+ children: /* @__PURE__ */ d(as, { spacing: "dense", children: [
3477
3506
  /* @__PURE__ */ n(
3478
3507
  "button",
3479
3508
  {
@@ -3484,8 +3513,8 @@ const Sa = (e, t) => (a) => {
3484
3513
  "aria-label": D,
3485
3514
  id: x,
3486
3515
  onClick: () => p(R),
3487
- children: /* @__PURE__ */ c("div", { className: "agent-view__card-content", children: [
3488
- /* @__PURE__ */ n(vi, { column: a, overlayIcon: _ }),
3516
+ children: /* @__PURE__ */ d("div", { className: "agent-view__card-content", children: [
3517
+ /* @__PURE__ */ n(wi, { column: a, overlayIcon: _ }),
3489
3518
  /* @__PURE__ */ n("span", { className: "agent-view__card-invocation-name", children: D }),
3490
3519
  /* @__PURE__ */ n("span", { className: "agent-view__card-agent-name", children: t }),
3491
3520
  A === "paused" ? /* @__PURE__ */ n("span", { className: "agent-view__card-state-pill", children: "Paused" }) : null,
@@ -3502,8 +3531,8 @@ const Sa = (e, t) => (a) => {
3502
3531
  ] })
3503
3532
  }
3504
3533
  ),
3505
- s && /* @__PURE__ */ c("div", { id: I, "aria-labelledby": x, className: "agent-view__card-progress", children: [
3506
- r && /* @__PURE__ */ c("div", { className: "agent-view__progress-loading", "aria-live": "polite", children: [
3534
+ s && /* @__PURE__ */ d("div", { id: I, "aria-labelledby": x, className: "agent-view__card-progress", children: [
3535
+ r && /* @__PURE__ */ d("div", { className: "agent-view__progress-loading", "aria-live": "polite", children: [
3507
3536
  /* @__PURE__ */ n(
3508
3537
  $,
3509
3538
  {
@@ -3517,8 +3546,8 @@ const Sa = (e, t) => (a) => {
3517
3546
  /* @__PURE__ */ n("span", { children: gt })
3518
3547
  ] }),
3519
3548
  !r && i && /* @__PURE__ */ n("p", { className: "agent-view__progress-error", role: "alert", children: i }),
3520
- !r && !i && u !== null && /* @__PURE__ */ n(Ys, { checklist: u }),
3521
- !r && !i && u === null && /* @__PURE__ */ c("div", { className: "agent-view__progress-loading", "aria-live": "polite", children: [
3549
+ !r && !i && u !== null && /* @__PURE__ */ n(Js, { checklist: u }),
3550
+ !r && !i && u === null && /* @__PURE__ */ d("div", { className: "agent-view__progress-loading", "aria-live": "polite", children: [
3522
3551
  /* @__PURE__ */ n(
3523
3552
  $,
3524
3553
  {
@@ -3531,9 +3560,9 @@ const Sa = (e, t) => (a) => {
3531
3560
  ),
3532
3561
  /* @__PURE__ */ n("span", { children: gt })
3533
3562
  ] }),
3534
- /* @__PURE__ */ c("div", { className: "agent-view__card-actions", children: [
3563
+ /* @__PURE__ */ d("div", { className: "agent-view__card-actions", children: [
3535
3564
  m ? /* @__PURE__ */ n(
3536
- G,
3565
+ z,
3537
3566
  {
3538
3567
  variant: "secondary",
3539
3568
  size: "S",
@@ -3542,8 +3571,8 @@ const Sa = (e, t) => (a) => {
3542
3571
  onClick: () => l == null ? void 0 : l(e),
3543
3572
  children: "Archive"
3544
3573
  }
3545
- ) : o ? /* @__PURE__ */ n(G, { variant: "secondary", size: "S", onClick: () => N == null ? void 0 : N(e), children: "Unarchive" }) : y ? /* @__PURE__ */ n(
3546
- G,
3574
+ ) : o ? /* @__PURE__ */ n(z, { variant: "secondary", size: "S", onClick: () => N == null ? void 0 : N(e), children: "Unarchive" }) : y ? /* @__PURE__ */ n(
3575
+ z,
3547
3576
  {
3548
3577
  variant: "secondary-destructive",
3549
3578
  size: "S",
@@ -3552,7 +3581,7 @@ const Sa = (e, t) => (a) => {
3552
3581
  }
3553
3582
  ) : /* @__PURE__ */ n("span", {}),
3554
3583
  o && y ? /* @__PURE__ */ n(
3555
- G,
3584
+ z,
3556
3585
  {
3557
3586
  variant: "secondary-destructive",
3558
3587
  size: "S",
@@ -3560,20 +3589,20 @@ const Sa = (e, t) => (a) => {
3560
3589
  children: "Delete"
3561
3590
  }
3562
3591
  ) : null,
3563
- /* @__PURE__ */ n(G, { variant: "secondary", size: "S", onClick: () => k == null ? void 0 : k(e), children: "View agent" })
3592
+ /* @__PURE__ */ n(z, { variant: "secondary", size: "S", onClick: () => k == null ? void 0 : k(e), children: "View agent" })
3564
3593
  ] })
3565
3594
  ] })
3566
3595
  ] })
3567
3596
  }
3568
3597
  );
3569
- }, wi = () => /* @__PURE__ */ n("ul", { className: "agent-view__card-list", "aria-hidden": "true", children: Array.from({ length: mi }, (e, t) => /* @__PURE__ */ n("li", { className: "agent-view__card agent-view__card--skeleton", children: /* @__PURE__ */ n(
3570
- as,
3598
+ }, Ni = () => /* @__PURE__ */ n("ul", { className: "agent-view__card-list", "aria-hidden": "true", children: Array.from({ length: _i }, (e, t) => /* @__PURE__ */ n("li", { className: "agent-view__card agent-view__card--skeleton", children: /* @__PURE__ */ n(
3599
+ ss,
3571
3600
  {
3572
3601
  className: "agent-view__card-skeleton",
3573
3602
  width: "100%",
3574
- height: _i
3603
+ height: pi
3575
3604
  }
3576
- ) }, t)) }), ca = ({
3605
+ ) }, t)) }), da = ({
3577
3606
  column: e,
3578
3607
  agents: t,
3579
3608
  expandedAgentId: a,
@@ -3586,16 +3615,16 @@ const Sa = (e, t) => (a) => {
3586
3615
  onArchiveAgent: y,
3587
3616
  canArchive: p,
3588
3617
  isLoading: k = !1
3589
- }) => /* @__PURE__ */ c("section", { className: "agent-view__column", "aria-label": e.title, children: [
3590
- /* @__PURE__ */ c("div", { className: "agent-view__column-header", children: [
3591
- /* @__PURE__ */ n(Xe, { level: 4, children: e.title }),
3618
+ }) => /* @__PURE__ */ d("section", { className: "agent-view__column", "aria-label": e.title, children: [
3619
+ /* @__PURE__ */ d("div", { className: "agent-view__column-header", children: [
3620
+ /* @__PURE__ */ n(We, { level: 4, children: e.title }),
3592
3621
  /* @__PURE__ */ n("span", { className: "agent-view__column-count", children: k ? 0 : t.length })
3593
3622
  ] }),
3594
- k ? /* @__PURE__ */ n(wi, {}) : /* @__PURE__ */ n("ul", { className: "agent-view__card-list", children: t.map((l) => /* @__PURE__ */ n(
3595
- Pa,
3623
+ k ? /* @__PURE__ */ n(Ni, {}) : /* @__PURE__ */ n("ul", { className: "agent-view__card-list", children: t.map((l) => /* @__PURE__ */ n(
3624
+ Ua,
3596
3625
  {
3597
3626
  agent: l,
3598
- agentName: un(l, i),
3627
+ agentName: cn(l, i),
3599
3628
  column: e,
3600
3629
  isExpanded: a === l.id,
3601
3630
  isLoading: s === l.id,
@@ -3608,7 +3637,7 @@ const Sa = (e, t) => (a) => {
3608
3637
  },
3609
3638
  l.id
3610
3639
  )) })
3611
- ] }), un = (e, t) => t.get(e.agent_definition_ref) ?? e.agent_definition_ref.replace(/_/g, " "), Oi = ({
3640
+ ] }), cn = (e, t) => t.get(e.agent_definition_ref) ?? e.agent_definition_ref.replace(/_/g, " "), Ii = ({
3612
3641
  jwt: e,
3613
3642
  headers: t,
3614
3643
  agentDefinitionsUrl: a,
@@ -3628,16 +3657,15 @@ const Sa = (e, t) => (a) => {
3628
3657
  showHeader: D = !1,
3629
3658
  institutions: x,
3630
3659
  usePusherToRepoll: I = !1,
3631
- pusherChannelPrefix: A = Ca,
3660
+ pusherChannelPrefix: A = Ta,
3632
3661
  pusherKey: _,
3633
3662
  pusherCluster: v,
3634
3663
  subscribeToPusher: P,
3635
- selectedAgent: q = null,
3636
- agentIdToOpenOnMount: ae,
3637
- scope: ft = fa
3664
+ selectedAgent: G,
3665
+ scope: se = va
3638
3666
  }) => {
3639
- var qe;
3640
- const Ze = Q(
3667
+ var en;
3668
+ const ft = Z(
3641
3669
  () => ({
3642
3670
  agentDefinitions: a,
3643
3671
  agents: s,
@@ -3662,249 +3690,249 @@ const Sa = (e, t) => (a) => {
3662
3690
  l,
3663
3691
  N
3664
3692
  ]
3665
- ), [ee, oe] = g(q), ge = ee ? (qe = x == null ? void 0 : x.find(
3666
- (d) => d.applicationId === ee.application_id
3667
- )) == null ? void 0 : qe.applicationUrl : void 0, we = Q(() => {
3668
- const d = { ...t ?? {} };
3669
- return ge ? d[je.arborApplicationUrl] = ge : delete d[je.arborApplicationUrl], d;
3670
- }, [t, ge]), {
3671
- agents: M,
3672
- agentDefinitions: Ne,
3673
- loadState: ie,
3674
- loadError: b,
3675
- reload: B,
3676
- refresh: O,
3677
- fetchAgentChecklist: z,
3678
- createAgent: K,
3679
- archiveAgent: X,
3680
- unarchiveAgent: ye,
3681
- deleteAgent: Ue,
3682
- removeAgent: Mt,
3683
- replaceAgent: Qe
3684
- } = Wr({ jwt: e, headers: we, urls: Ze, scope: ft }), [$t, et] = g(!1), [De, xe] = g(null), [Z, Me] = g(null), [ce, Ht] = g({}), [$e, He] = g({}), [Ee, me] = g([]), [ue, pn] = g([]), [j, vt] = g(null), [Be, Bt] = g(!1), [Gt, tt] = g(null), [zt, wt] = g(!1), [Ce, Nt] = g(null), [nt, Ft] = g(!1), [yt, at] = g(null), [Ae, At] = g(null), [Ge, Te] = g(!1), [qt, st] = g(null), [Kt, Vt] = g(!1), rt = te(!1);
3693
+ ), [ne, re] = g(null), pe = ne ? (en = x == null ? void 0 : x.find(
3694
+ (c) => c.applicationId === ne.application_id
3695
+ )) == null ? void 0 : en.applicationUrl : void 0, Ae = Z(() => {
3696
+ const c = { ...t ?? {} };
3697
+ return pe ? c[Ye.arborApplicationUrl] = pe : delete c[Ye.arborApplicationUrl], c;
3698
+ }, [t, pe]), {
3699
+ agents: H,
3700
+ agentDefinitions: ge,
3701
+ loadState: de,
3702
+ loadError: fe,
3703
+ reload: E,
3704
+ refresh: M,
3705
+ fetchAgentChecklist: O,
3706
+ createAgent: Y,
3707
+ archiveAgent: q,
3708
+ unarchiveAgent: j,
3709
+ deleteAgent: ke,
3710
+ removeAgent: je,
3711
+ replaceAgent: Ft
3712
+ } = Xr({ jwt: e, headers: Ae, urls: ft, scope: se }), [Xe, Ze] = g(!1), [Pe, Ue] = g(null), [vt, X] = g(null), [ae, Qe] = g({}), [wt, Ce] = g({}), [De, Nt] = g([]), [le, Te] = g([]), [ue, ie] = g(null), [yt, et] = g(!1), [mn, xe] = g(null), [_n, tt] = g(!1), [nt, Me] = g(null), [At, kt] = g(!1), [pn, Re] = g(null), [$e, He] = g(null), [Et, at] = g(!1), [Be, Ge] = g(null), [fn, bt] = g(!1), qt = Q(!1);
3685
3713
  L(() => {
3686
- oe((d) => {
3687
- if (!d)
3714
+ re((c) => {
3715
+ if (!c)
3688
3716
  return null;
3689
- const C = M.find(
3690
- (T) => T.id === d.id || T.invocation_id === d.invocation_id || T.invocation_id === d.id
3717
+ const C = H.find(
3718
+ (T) => T.id === c.id || T.invocation_id === c.invocation_id || T.invocation_id === c.id
3691
3719
  );
3692
- return C || (ie === "loading" ? d : null);
3720
+ return C || (de === "loading" ? c : null);
3693
3721
  });
3694
- }, [M, ie]), L(() => {
3695
- if (!ae || rt.current || ie === "loading")
3722
+ }, [H, de]), L(() => {
3723
+ if (!G || qt.current || de === "loading")
3696
3724
  return;
3697
- rt.current = !0;
3698
- const d = M.find(({ id: C }) => C === ae);
3699
- if (d) {
3700
- oe(d);
3725
+ qt.current = !0;
3726
+ const c = H.find(({ id: C }) => C === G);
3727
+ if (c) {
3728
+ re(c);
3701
3729
  return;
3702
3730
  }
3703
- Vt(!0);
3704
- }, [ae, M, ie]);
3705
- const ze = Q(() => {
3706
- const d = new Set(M.map((T) => T.application_id)), C = new Map(
3731
+ bt(!0);
3732
+ }, [G, H, de]);
3733
+ const st = Z(() => {
3734
+ const c = new Set(H.map((T) => T.application_id)), C = new Map(
3707
3735
  (x ?? []).map((T) => [T.applicationId, T.name])
3708
3736
  );
3709
- return [...d].sort(
3710
- (T, le) => (C.get(T) ?? T).localeCompare(C.get(le) ?? le)
3737
+ return [...c].sort(
3738
+ (T, oe) => (C.get(T) ?? T).localeCompare(C.get(oe) ?? oe)
3711
3739
  ).map((T) => ({
3712
3740
  value: T,
3713
3741
  label: C.get(T) ?? T
3714
3742
  }));
3715
- }, [M, x]), _e = Q(
3716
- () => new Map(Ne.map((d) => [d.ref, d.display_name])),
3717
- [Ne]
3718
- ), Yt = Q(() => [...new Set(
3719
- M.map((C) => un(C, _e))
3743
+ }, [H, x]), me = Z(
3744
+ () => new Map(ge.map((c) => [c.ref, c.display_name])),
3745
+ [ge]
3746
+ ), rt = Z(() => [...new Set(
3747
+ H.map((C) => cn(C, me))
3720
3748
  )].sort((C, T) => C.localeCompare(T)).map((C) => ({
3721
3749
  value: C,
3722
3750
  label: C
3723
- })), [M, _e]), Fe = Q(() => M.filter((d) => !(Ee.length > 0 && !Ee.includes(d.application_id) || ue.length > 0 && !ue.includes(un(d, _e)))), [M, _e, ue, Ee]), Jt = ze.length > 1, it = Yt.length > 1, fn = Jt || it;
3751
+ })), [H, me]), it = Z(() => H.filter((c) => !(De.length > 0 && !De.includes(c.application_id) || le.length > 0 && !le.includes(cn(c, me)))), [H, me, le, De]), Ct = st.length > 1, Kt = rt.length > 1, Tt = Ct || Kt;
3724
3752
  L(() => {
3725
- const d = window.setInterval(() => {
3726
- O();
3753
+ const c = window.setInterval(() => {
3754
+ M();
3727
3755
  }, 6e4);
3728
3756
  return () => {
3729
- window.clearInterval(d);
3757
+ window.clearInterval(c);
3730
3758
  };
3731
- }, [O]), L(() => {
3732
- if (M.length === 0)
3759
+ }, [M]), L(() => {
3760
+ if (H.length === 0)
3733
3761
  return;
3734
- let d = !1;
3762
+ let c = !1;
3735
3763
  return (async () => {
3736
3764
  const C = await Promise.allSettled(
3737
- M.map(async (T) => {
3738
- const le = await z(T.invocation_id);
3765
+ H.map(async (T) => {
3766
+ const oe = await O(T.invocation_id);
3739
3767
  return {
3740
3768
  agentId: T.id,
3741
3769
  invocationId: T.invocation_id,
3742
- checklist: le.checklist
3770
+ checklist: oe.checklist
3743
3771
  };
3744
3772
  })
3745
3773
  );
3746
- d || (Ht((T) => {
3747
- const le = { ...T };
3748
- let Ke = !1;
3749
- for (const ke of C) {
3750
- if (ke.status !== "fulfilled")
3774
+ c || (Qe((T) => {
3775
+ const oe = { ...T };
3776
+ let Ee = !1;
3777
+ for (const ct of C) {
3778
+ if (ct.status !== "fulfilled")
3751
3779
  continue;
3752
- const { invocationId: Se, checklist: se } = ke.value;
3753
- JSON.stringify(T[Se]) !== JSON.stringify(se) && (le[Se] = se, Ke = !0);
3780
+ const { invocationId: ve, checklist: Ut } = ct.value;
3781
+ JSON.stringify(T[ve]) !== JSON.stringify(Ut) && (oe[ve] = Ut, Ee = !0);
3754
3782
  }
3755
- return Ke ? le : T;
3756
- }), He((T) => {
3757
- const le = { ...T };
3758
- let Ke = !1;
3759
- return C.forEach((ke, Se) => {
3760
- ke.status === "rejected" && le[M[Se].id] !== dn && (le[M[Se].id] = dn, Ke = !0);
3761
- }), Ke ? le : T;
3783
+ return Ee ? oe : T;
3784
+ }), Ce((T) => {
3785
+ const oe = { ...T };
3786
+ let Ee = !1;
3787
+ return C.forEach((ct, ve) => {
3788
+ ct.status === "rejected" && oe[H[ve].id] !== on && (oe[H[ve].id] = on, Ee = !0);
3789
+ }), Ee ? oe : T;
3762
3790
  }));
3763
3791
  })(), () => {
3764
- d = !0;
3792
+ c = !0;
3765
3793
  };
3766
- }, [M, z]);
3767
- const kt = f(
3768
- async (d) => {
3769
- if (!ce[d.invocation_id]) {
3770
- Me(d.id), He((C) => {
3794
+ }, [H, O]);
3795
+ const Vt = f(
3796
+ async (c) => {
3797
+ if (!ae[c.invocation_id]) {
3798
+ X(c.id), Ce((C) => {
3771
3799
  const T = { ...C };
3772
- return delete T[d.id], T;
3800
+ return delete T[c.id], T;
3773
3801
  });
3774
3802
  try {
3775
- const C = await z(d.invocation_id);
3776
- Ht((T) => ({
3803
+ const C = await O(c.invocation_id);
3804
+ Qe((T) => ({
3777
3805
  ...T,
3778
- [d.invocation_id]: C.checklist
3806
+ [c.invocation_id]: C.checklist
3779
3807
  }));
3780
3808
  } catch {
3781
- He((C) => ({
3809
+ Ce((C) => ({
3782
3810
  ...C,
3783
- [d.id]: dn
3811
+ [c.id]: on
3784
3812
  }));
3785
3813
  } finally {
3786
- Me((C) => C === d.id ? null : C);
3814
+ X((C) => C === c.id ? null : C);
3787
3815
  }
3788
3816
  }
3789
3817
  },
3790
- [z, ce]
3791
- ), lt = f(
3792
- (d) => {
3793
- if (De === d) {
3794
- xe(null);
3818
+ [O, ae]
3819
+ ), Rt = f(
3820
+ (c) => {
3821
+ if (Pe === c) {
3822
+ Ue(null);
3795
3823
  return;
3796
3824
  }
3797
- const C = M.find(({ id: T }) => T === d);
3798
- C && (xe(d), kt(C));
3825
+ const C = H.find(({ id: T }) => T === c);
3826
+ C && (Ue(c), Vt(C));
3799
3827
  },
3800
- [M, De, kt]
3801
- ), ot = Q(
3802
- () => Fe.filter((d) => !!d.archivedAt),
3803
- [Fe]
3804
- ), Re = Q(
3805
- () => Fe.filter((d) => !d.archivedAt),
3806
- [Fe]
3807
- ), bt = Q(() => {
3808
- const d = {};
3809
- for (const C of Re) {
3828
+ [H, Pe, Vt]
3829
+ ), ze = Z(
3830
+ () => it.filter((c) => !!c.archivedAt),
3831
+ [it]
3832
+ ), Fe = Z(
3833
+ () => it.filter((c) => !c.archivedAt),
3834
+ [it]
3835
+ ), St = Z(() => {
3836
+ const c = {};
3837
+ for (const C of Fe) {
3810
3838
  const T = Rn(
3811
3839
  C,
3812
- ce[C.invocation_id]
3840
+ ae[C.invocation_id]
3813
3841
  );
3814
- (d[T] ?? (d[T] = [])).push(C);
3842
+ (c[T] ?? (c[T] = [])).push(C);
3815
3843
  }
3816
- return d;
3817
- }, [Re, ce]), vn = ie === "loading" && M.length === 0, Et = Re.length > 0 && Re.some(
3818
- (d) => ce[d.invocation_id] === void 0 && $e[d.id] === void 0
3819
- ), jt = vn || Et, Ct = f((d) => {
3820
- oe(d);
3821
- }, []), Wt = f((d) => {
3822
- tt(null), vt(d);
3823
- }, []), Xt = f(() => {
3824
- Be || (tt(null), vt(null));
3825
- }, [Be]), Zt = f(async () => {
3826
- if (j) {
3827
- Bt(!0), tt(null), He((d) => {
3828
- const C = { ...d };
3829
- return delete C[j.id], C;
3844
+ return c;
3845
+ }, [Fe, ae]), Ot = de === "loading" && H.length === 0, vn = Fe.length > 0 && Fe.some(
3846
+ (c) => ae[c.invocation_id] === void 0 && wt[c.id] === void 0
3847
+ ), It = Ot || vn, Lt = f((c) => {
3848
+ re(c);
3849
+ }, []), Yt = f((c) => {
3850
+ xe(null), ie(c);
3851
+ }, []), Jt = f(() => {
3852
+ yt || (xe(null), ie(null));
3853
+ }, [yt]), Wt = f(async () => {
3854
+ if (ue) {
3855
+ et(!0), xe(null), Ce((c) => {
3856
+ const C = { ...c };
3857
+ return delete C[ue.id], C;
3830
3858
  });
3831
3859
  try {
3832
- await X(j.invocation_id), oe((d) => (d == null ? void 0 : d.id) === j.id ? null : d), xe(j.id), wt(!0), vt(null);
3860
+ await q(ue.invocation_id), re((c) => (c == null ? void 0 : c.id) === ue.id ? null : c), Ue(ue.id), tt(!0), ie(null);
3833
3861
  } catch {
3834
- tt(Ln);
3862
+ xe(Ln);
3835
3863
  } finally {
3836
- Bt(!1);
3864
+ et(!1);
3837
3865
  }
3838
3866
  }
3839
- }, [j, X]), Qt = f((d) => {
3840
- at(null), Nt(d);
3841
- }, []), wn = f(() => {
3842
- nt || (at(null), Nt(null));
3843
- }, [nt]), Tt = f(async () => {
3844
- if (Ce) {
3845
- Ft(!0), at(null);
3867
+ }, [ue, q]), jt = f((c) => {
3868
+ Re(null), Me(c);
3869
+ }, []), Xt = f(() => {
3870
+ At || (Re(null), Me(null));
3871
+ }, [At]), wn = f(async () => {
3872
+ if (nt) {
3873
+ kt(!0), Re(null);
3846
3874
  try {
3847
- await ye(Ce.invocation_id), Nt(null);
3875
+ await j(nt.invocation_id), Me(null);
3848
3876
  } catch {
3849
- at(Pn);
3877
+ Re(Pn);
3850
3878
  } finally {
3851
- Ft(!1);
3879
+ kt(!1);
3852
3880
  }
3853
3881
  }
3854
- }, [Ce, ye]), Nn = j ? Rn(
3855
- j,
3856
- ce[j.invocation_id]
3857
- ) !== E.complete : !1, ct = f(
3858
- async (d) => {
3859
- const C = await K(d);
3860
- oe(C), et(!1);
3882
+ }, [nt, j]), Pt = ue ? Rn(
3883
+ ue,
3884
+ ae[ue.invocation_id]
3885
+ ) !== b.complete : !1, Nn = f(
3886
+ async (c) => {
3887
+ const C = await Y(c);
3888
+ re(C), Ze(!1);
3861
3889
  },
3862
- [K]
3863
- ), en = f((d) => {
3864
- st(null), At(d);
3865
- }, []), tn = f(() => {
3866
- Ge || (st(null), At(null));
3867
- }, [Ge]), yn = f(async () => {
3868
- if (Ae) {
3869
- Te(!0), st(null);
3890
+ [Y]
3891
+ ), lt = f((c) => {
3892
+ Ge(null), He(c);
3893
+ }, []), Zt = f(() => {
3894
+ Et || (Ge(null), He(null));
3895
+ }, [Et]), Qt = f(async () => {
3896
+ if ($e) {
3897
+ at(!0), Ge(null);
3870
3898
  try {
3871
- await Ue(Ae.invocation_id), oe((d) => (d == null ? void 0 : d.id) === Ae.id ? null : d), At(null);
3872
- } catch (d) {
3873
- st(Ia(d));
3899
+ await ke($e.invocation_id), re((c) => (c == null ? void 0 : c.id) === $e.id ? null : c), He(null);
3900
+ } catch (c) {
3901
+ Ge(La(c));
3874
3902
  } finally {
3875
- Te(!1);
3903
+ at(!1);
3876
3904
  }
3877
3905
  }
3878
- }, [Ae, Ue]), Rt = f(() => {
3879
- oe(null);
3880
- }, []), nn = {
3881
- expandedAgentId: De,
3882
- loadingAgentId: Z,
3883
- checklistByInvocationId: ce,
3884
- errorByAgentId: $e,
3885
- definitionNameByRef: _e,
3886
- onToggleAgent: lt,
3887
- onViewAgent: Ct,
3888
- onArchiveAgent: Wt,
3906
+ }, [$e, ke]), yn = f(() => {
3907
+ re(null);
3908
+ }, []), ot = {
3909
+ expandedAgentId: Pe,
3910
+ loadingAgentId: vt,
3911
+ checklistByInvocationId: ae,
3912
+ errorByAgentId: wt,
3913
+ definitionNameByRef: me,
3914
+ onToggleAgent: Rt,
3915
+ onViewAgent: Lt,
3916
+ onArchiveAgent: Yt,
3889
3917
  canArchive: !!l
3890
3918
  };
3891
- return /* @__PURE__ */ c("div", { className: "agent-view-frontend agent-view", children: [
3892
- D && /* @__PURE__ */ c("div", { className: "agent-view__header", children: [
3893
- /* @__PURE__ */ n(Xe, { level: 1, children: "Agents" }),
3919
+ return /* @__PURE__ */ d("div", { className: "agent-view-frontend agent-view", children: [
3920
+ D && /* @__PURE__ */ d("div", { className: "agent-view__header", children: [
3921
+ /* @__PURE__ */ n(We, { level: 1, children: "Agents" }),
3894
3922
  /* @__PURE__ */ n(
3895
- G,
3923
+ z,
3896
3924
  {
3897
3925
  variant: "primary",
3898
3926
  size: "S",
3899
3927
  iconLeftName: "sparkles",
3900
3928
  iconLeftScreenReaderText: "Start an agent",
3901
- onClick: () => et(!0),
3929
+ onClick: () => Ze(!0),
3902
3930
  children: "Start an agent"
3903
3931
  }
3904
3932
  )
3905
3933
  ] }),
3906
- M.length > 0 && fn && /* @__PURE__ */ c("div", { className: "agent-view__filters", children: [
3907
- Jt && /* @__PURE__ */ c("div", { className: "agent-view__filter", children: [
3934
+ H.length > 0 && Tt && /* @__PURE__ */ d("div", { className: "agent-view__filters", children: [
3935
+ Ct && /* @__PURE__ */ d("div", { className: "agent-view__filter", children: [
3908
3936
  /* @__PURE__ */ n(
3909
3937
  "label",
3910
3938
  {
@@ -3921,16 +3949,16 @@ const Sa = (e, t) => (a) => {
3921
3949
  multiple: !0,
3922
3950
  searchType: "substring",
3923
3951
  placeholder: "All institutions",
3924
- options: ze,
3925
- value: Ee,
3926
- onValueChange: me,
3952
+ options: st,
3953
+ value: De,
3954
+ onValueChange: Nt,
3927
3955
  showSelectionCountBadge: !0,
3928
3956
  showClearAll: !0,
3929
3957
  clearAllLabel: "Clear institutions"
3930
3958
  }
3931
3959
  )
3932
3960
  ] }),
3933
- it && /* @__PURE__ */ c("div", { className: "agent-view__filter", children: [
3961
+ Kt && /* @__PURE__ */ d("div", { className: "agent-view__filter", children: [
3934
3962
  /* @__PURE__ */ n("label", { className: "agent-view__filter-label", htmlFor: "agent-view-agent-filter", children: "Agent" }),
3935
3963
  /* @__PURE__ */ n(
3936
3964
  Vn,
@@ -3940,9 +3968,9 @@ const Sa = (e, t) => (a) => {
3940
3968
  multiple: !0,
3941
3969
  searchType: "substring",
3942
3970
  placeholder: "All agents",
3943
- options: Yt,
3944
- value: ue,
3945
- onValueChange: pn,
3971
+ options: rt,
3972
+ value: le,
3973
+ onValueChange: Te,
3946
3974
  showSelectionCountBadge: !0,
3947
3975
  showClearAll: !0,
3948
3976
  clearAllLabel: "Clear agents"
@@ -3950,74 +3978,74 @@ const Sa = (e, t) => (a) => {
3950
3978
  )
3951
3979
  ] })
3952
3980
  ] }),
3953
- ie === "error" ? /* @__PURE__ */ c("div", { className: "agent-view__state agent-view__state--error", role: "alert", children: [
3981
+ de === "error" ? /* @__PURE__ */ d("div", { className: "agent-view__state agent-view__state--error", role: "alert", children: [
3954
3982
  /* @__PURE__ */ n($, { name: "triangle-alert", size: 24, color: "var(--color-semantic-destructive-600)" }),
3955
- /* @__PURE__ */ n("p", { className: "agent-view__state-message", children: b ?? pa }),
3956
- /* @__PURE__ */ n(G, { variant: "secondary", size: "S", onClick: B, children: "Try again" })
3957
- ] }) : jt ? /* @__PURE__ */ n("div", { className: "agent-view__board", "aria-busy": "true", "aria-live": "polite", children: Yn.map((d) => /* @__PURE__ */ n(
3958
- ca,
3983
+ /* @__PURE__ */ n("p", { className: "agent-view__state-message", children: fe ?? fa }),
3984
+ /* @__PURE__ */ n(z, { variant: "secondary", size: "S", onClick: E, children: "Try again" })
3985
+ ] }) : It ? /* @__PURE__ */ n("div", { className: "agent-view__board", "aria-busy": "true", "aria-live": "polite", children: Jn.map((c) => /* @__PURE__ */ n(
3986
+ da,
3959
3987
  {
3960
- column: pt[d],
3988
+ column: pt[c],
3961
3989
  agents: [],
3962
3990
  isLoading: !0,
3963
- ...nn
3991
+ ...ot
3964
3992
  },
3965
- d
3966
- )) }) : M.length === 0 ? /* @__PURE__ */ n(Bs, {}) : /* @__PURE__ */ c(de, { children: [
3967
- /* @__PURE__ */ n("div", { className: "agent-view__board", children: Yn.map((d) => /* @__PURE__ */ n(
3968
- ca,
3993
+ c
3994
+ )) }) : H.length === 0 ? /* @__PURE__ */ n(Gs, {}) : /* @__PURE__ */ d(he, { children: [
3995
+ /* @__PURE__ */ n("div", { className: "agent-view__board", children: Jn.map((c) => /* @__PURE__ */ n(
3996
+ da,
3969
3997
  {
3970
- column: pt[d],
3971
- agents: bt[d] ?? [],
3972
- ...nn
3998
+ column: pt[c],
3999
+ agents: St[c] ?? [],
4000
+ ...ot
3973
4001
  },
3974
- d
4002
+ c
3975
4003
  )) }),
3976
- ot.length > 0 ? /* @__PURE__ */ c(
4004
+ ze.length > 0 ? /* @__PURE__ */ d(
3977
4005
  "details",
3978
4006
  {
3979
4007
  className: "agent-view__archived",
3980
- open: zt,
3981
- onToggle: (d) => {
3982
- wt(d.currentTarget.open);
4008
+ open: _n,
4009
+ onToggle: (c) => {
4010
+ tt(c.currentTarget.open);
3983
4011
  },
3984
4012
  children: [
3985
- /* @__PURE__ */ c("summary", { className: "agent-view__archived-summary", children: [
3986
- /* @__PURE__ */ n(Xe, { level: 4, children: "Archived" }),
3987
- /* @__PURE__ */ n("span", { className: "agent-view__column-count", children: ot.length })
4013
+ /* @__PURE__ */ d("summary", { className: "agent-view__archived-summary", children: [
4014
+ /* @__PURE__ */ n(We, { level: 4, children: "Archived" }),
4015
+ /* @__PURE__ */ n("span", { className: "agent-view__column-count", children: ze.length })
3988
4016
  ] }),
3989
- /* @__PURE__ */ n("ul", { className: "agent-view__card-list agent-view__archived-list", children: ot.map((d) => /* @__PURE__ */ n(
3990
- Pa,
4017
+ /* @__PURE__ */ n("ul", { className: "agent-view__card-list agent-view__archived-list", children: ze.map((c) => /* @__PURE__ */ n(
4018
+ Ua,
3991
4019
  {
3992
- agent: d,
3993
- agentName: un(d, _e),
3994
- column: pt[Rn(d, ce[d.invocation_id])],
3995
- isExpanded: De === d.id,
3996
- isLoading: Z === d.id,
3997
- checklist: ce[d.invocation_id] ?? null,
3998
- error: $e[d.id] ?? null,
4020
+ agent: c,
4021
+ agentName: cn(c, me),
4022
+ column: pt[Rn(c, ae[c.invocation_id])],
4023
+ isExpanded: Pe === c.id,
4024
+ isLoading: vt === c.id,
4025
+ checklist: ae[c.invocation_id] ?? null,
4026
+ error: wt[c.id] ?? null,
3999
4027
  canArchive: !1,
4000
- canUnarchive: !!N && d.usable,
4001
- canDelete: R && d.usable,
4002
- onToggle: lt,
4003
- onViewAgent: Ct,
4004
- onUnarchive: Qt,
4005
- onDelete: en
4028
+ canUnarchive: !!N && c.usable,
4029
+ canDelete: R && c.usable,
4030
+ onToggle: Rt,
4031
+ onViewAgent: Lt,
4032
+ onUnarchive: jt,
4033
+ onDelete: lt
4006
4034
  },
4007
- d.id
4035
+ c.id
4008
4036
  )) })
4009
4037
  ]
4010
4038
  }
4011
4039
  ) : null
4012
4040
  ] }),
4013
- ee && /* @__PURE__ */ n(
4014
- ni,
4041
+ ne && /* @__PURE__ */ n(
4042
+ ai,
4015
4043
  {
4016
- agent: ee,
4017
- invocationId: ee.invocation_id,
4044
+ agent: ne,
4045
+ invocationId: ne.invocation_id,
4018
4046
  open: !0,
4019
4047
  jwt: e,
4020
- headers: we,
4048
+ headers: Ae,
4021
4049
  agentUrl: r,
4022
4050
  agentChecklistUrl: u,
4023
4051
  agentResourcesUrl: i,
@@ -4030,75 +4058,75 @@ const Sa = (e, t) => (a) => {
4030
4058
  unarchiveAgentUrl: N,
4031
4059
  enableUpload: S,
4032
4060
  adminMode: R,
4033
- initialChecklist: ce[ee.invocation_id] ?? null,
4061
+ initialChecklist: ae[ne.invocation_id] ?? null,
4034
4062
  usePusherToRepoll: I,
4035
4063
  pusherChannelPrefix: A,
4036
4064
  pusherKey: _,
4037
4065
  pusherCluster: v,
4038
4066
  subscribeToPusher: P,
4039
- onClose: Rt,
4040
- onAgentUpdated: Qe,
4067
+ onClose: yn,
4068
+ onAgentUpdated: Ft,
4041
4069
  onArchived: () => {
4042
- xe(ee.id), wt(!0), O();
4070
+ Ue(ne.id), tt(!0), M();
4043
4071
  },
4044
4072
  onUnarchived: () => {
4045
- O();
4073
+ M();
4046
4074
  },
4047
4075
  onDeleted: () => {
4048
- Mt(ee.invocation_id);
4076
+ je(ne.invocation_id);
4049
4077
  }
4050
4078
  },
4051
- ee.id || ee.invocation_id
4079
+ ne.id || ne.invocation_id
4052
4080
  ),
4053
4081
  /* @__PURE__ */ n(
4054
- Na,
4082
+ ya,
4055
4083
  {
4056
- open: !!j,
4057
- isInProgress: Nn,
4058
- isArchiving: Be,
4059
- error: Gt,
4060
- onCancel: Xt,
4084
+ open: !!ue,
4085
+ isInProgress: Pt,
4086
+ isArchiving: yt,
4087
+ error: mn,
4088
+ onCancel: Jt,
4061
4089
  onConfirm: () => {
4062
- Zt();
4090
+ Wt();
4063
4091
  }
4064
4092
  }
4065
4093
  ),
4066
4094
  /* @__PURE__ */ n(
4067
- Aa,
4095
+ ka,
4068
4096
  {
4069
- open: !!Ce,
4070
- isUnarchiving: nt,
4071
- error: yt,
4072
- onCancel: wn,
4097
+ open: !!nt,
4098
+ isUnarchiving: At,
4099
+ error: pn,
4100
+ onCancel: Xt,
4073
4101
  onConfirm: () => {
4074
- Tt();
4102
+ wn();
4075
4103
  }
4076
4104
  }
4077
4105
  ),
4078
4106
  /* @__PURE__ */ n(
4079
- ya,
4107
+ Aa,
4080
4108
  {
4081
- open: !!Ae,
4082
- isDeleting: Ge,
4083
- error: qt,
4084
- onCancel: tn,
4109
+ open: !!$e,
4110
+ isDeleting: Et,
4111
+ error: Be,
4112
+ onCancel: Zt,
4085
4113
  onConfirm: () => {
4086
- yn();
4114
+ Qt();
4087
4115
  }
4088
4116
  }
4089
4117
  ),
4090
- /* @__PURE__ */ n(gi, { open: Kt, onClose: () => Vt(!1) }),
4118
+ /* @__PURE__ */ n(mi, { open: fn, onClose: () => bt(!1) }),
4091
4119
  /* @__PURE__ */ n(
4092
- hi,
4120
+ gi,
4093
4121
  {
4094
- open: $t,
4095
- onClose: () => et(!1),
4096
- onStart: ct,
4097
- agentDefinitions: Ne
4122
+ open: Xe,
4123
+ onClose: () => Ze(!1),
4124
+ onStart: Nn,
4125
+ agentDefinitions: ge
4098
4126
  }
4099
4127
  )
4100
4128
  ] });
4101
- }, Ii = (e, t) => {
4129
+ }, Li = (e, t) => {
4102
4130
  const a = Date.now(), s = t.trim() || e.agent_intent;
4103
4131
  return {
4104
4132
  id: `agent-${a}`,
@@ -4109,43 +4137,43 @@ const Sa = (e, t) => (a) => {
4109
4137
  application_id: us,
4110
4138
  created_by: hs,
4111
4139
  usable: !0,
4112
- status: E["generating-a-response"],
4140
+ status: b["generating-a-response"],
4113
4141
  archivedAt: null,
4114
4142
  context_ref: null,
4115
4143
  checklist_ref: null
4116
4144
  };
4117
4145
  };
4118
4146
  export {
4119
- Oi as AgentMonitorKanban,
4147
+ Ii as AgentMonitorKanban,
4120
4148
  $n as AgentServiceClient,
4121
4149
  mt as AgentServiceError,
4122
- ni as AgentView,
4123
- Ca as DEFAULT_PUSHER_CHANNEL_PREFIX,
4124
- Yr as HttpChatConnector,
4125
- Qn as MESSAGE_TYPE_REPOLL,
4126
- hi as NewAgentModal,
4150
+ ai as AgentView,
4151
+ Ta as DEFAULT_PUSHER_CHANNEL_PREFIX,
4152
+ Jr as HttpChatConnector,
4153
+ ea as MESSAGE_TYPE_REPOLL,
4154
+ gi as NewAgentModal,
4127
4155
  _r as PUSHER_AGENT_MESSAGE_EVENT,
4128
- Je as REPOLL_TARGET,
4129
- Ii as buildAgentFromDefinition,
4156
+ Ve as REPOLL_TARGET,
4157
+ Li as buildAgentFromDefinition,
4130
4158
  fr as buildAgentPusherChannel,
4131
- Sa as createHttpChatConnectorFactory,
4132
- Si as formatUserFileChatCardText,
4133
- We as mapApiAgent,
4134
- Ta as mapApiAgentDefinition,
4159
+ Oa as createHttpChatConnectorFactory,
4160
+ Oi as formatUserFileChatCardText,
4161
+ Je as mapApiAgent,
4162
+ Ra as mapApiAgentDefinition,
4135
4163
  Or as mapApiAgentStatus,
4136
4164
  xr as mapApiAgentTimelineResponse,
4137
4165
  Mn as mapApiChecklistEndpointResponse,
4138
- Ra as mapApiChecklistItem,
4139
- Ti as mapApiChecklistResponse,
4166
+ Sa as mapApiChecklistItem,
4167
+ Ri as mapApiChecklistResponse,
4140
4168
  Ir as mapApiChecklistStatus,
4141
- $r as mapApiConversationMessages,
4142
- _n as mapApiOpeningMessage,
4169
+ Hr as mapApiConversationMessages,
4170
+ gn as mapApiOpeningMessage,
4143
4171
  Ur as mapApiResource,
4144
4172
  Dr as mapApiResourcesEndpointResponse,
4145
- Ci as mapApiTripOption,
4146
- Ri as parseConversationContentCaption,
4173
+ Ti as mapApiTripOption,
4174
+ Si as parseConversationContentCaption,
4147
4175
  Nr as parseRepollMessages,
4148
- Wr as useAgentService,
4149
- Zr as useAgentWorkspace,
4150
- Er as useSubscribeToPusher
4176
+ Xr as useAgentService,
4177
+ Qr as useAgentWorkspace,
4178
+ br as useSubscribeToPusher
4151
4179
  };