@arbor-education/agent-view-frontend 0.7.2 → 0.7.3

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