@arbor-education/agent-view-frontend 0.2.1 → 0.4.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1,24 +1,24 @@
1
- import { jsxs as i, jsx as n, Fragment as Xe } from "react/jsx-runtime";
2
- import { useMemo as U, useRef as Re, useState as _, useEffect as B, useCallback as I, useLayoutEffect as Ze } from "react";
3
- import M from "classnames";
4
- import { Heading as he, Icon as E, Dot as Ge, Button as X, Modal as Q, SelectDropdown as et, TextInput as tt, Combobox as Oe, Card as nt } from "@arbor-education/design-system.components";
5
- import { CHAT_RESPONSE_TYPE_AGENT as Be, CHAT_RESPONSE_TYPE_ERROR as at, ChatPanel as st, CHAT_RESPONSE_TYPE_USER as rt, CHAT_RESPONSE_TYPE_INFO as ot } from "@arbor-education/ask-arbor-chat-panel";
1
+ import { jsxs as i, jsx as n, Fragment as et } from "react/jsx-runtime";
2
+ import { useMemo as U, useLayoutEffect as Ge, useState as m, useEffect as G, useCallback as T, useRef as Re } from "react";
3
+ import H from "classnames";
4
+ import { Heading as he, Icon as E, Dot as Be, Button as J, Modal as W, SelectDropdown as tt, TextInput as nt, Combobox as Oe, Card as at } from "@arbor-education/design-system.components";
5
+ import { CHAT_RESPONSE_TYPE_AGENT as qe, CHAT_RESPONSE_TYPE_ERROR as st, ChatPanel as rt, CHAT_RESPONSE_TYPE_USER as ot, CHAT_RESPONSE_TYPE_INFO as it } from "@arbor-education/ask-arbor-chat-panel";
6
6
  const v = {
7
7
  "generating-a-response": "generating-a-response",
8
8
  hitl: "hitl",
9
9
  complete: "complete",
10
10
  failed: "failed"
11
- }, b = {
11
+ }, S = {
12
12
  "generating-a-response": "generating-a-response",
13
13
  hitl: "hitl",
14
14
  complete: "complete",
15
15
  failed: "failed"
16
- }, T = {
16
+ }, b = {
17
17
  briefing: "briefing",
18
18
  running: "running",
19
19
  stopped: "stopped",
20
20
  complete: "complete"
21
- }, Z = {
21
+ }, j = {
22
22
  agent: "agent",
23
23
  user: "user",
24
24
  system: "system"
@@ -30,39 +30,39 @@ const v = {
30
30
  }, xe = {
31
31
  cancelled: "cancelled",
32
32
  archived: "archived"
33
- }, Se = {
33
+ }, Te = {
34
34
  in_progress: "in_progress",
35
35
  requires_attention: "requires_attention",
36
36
  available: "available"
37
- }, G = {
38
- [b.complete]: {
37
+ }, F = {
38
+ [S.complete]: {
39
39
  label: "Complete",
40
40
  icon: "circle-check",
41
41
  color: "var(--color-semantic-success-600)"
42
42
  },
43
- [b.failed]: {
43
+ [S.failed]: {
44
44
  label: "Failed",
45
45
  icon: "circle-x",
46
46
  color: "var(--color-semantic-destructive-600)"
47
47
  },
48
- [b.hitl]: {
48
+ [S.hitl]: {
49
49
  label: "Requires attention",
50
50
  icon: "triangle-alert",
51
51
  color: "var(--color-semantic-warning-600)"
52
52
  },
53
- [b["generating-a-response"]]: {
53
+ [S["generating-a-response"]]: {
54
54
  label: "Generating a response",
55
55
  icon: "loader",
56
56
  color: "var(--color-brand-600)"
57
57
  }
58
- }, we = {
58
+ }, ve = {
59
59
  [v["generating-a-response"]]: {
60
60
  status: v["generating-a-response"],
61
61
  title: "Active",
62
62
  dotColour: "green",
63
63
  statusIcon: {
64
- name: G["generating-a-response"].icon,
65
- color: G["generating-a-response"].color,
64
+ name: F["generating-a-response"].icon,
65
+ color: F["generating-a-response"].color,
66
66
  spin: !0
67
67
  }
68
68
  },
@@ -71,8 +71,8 @@ const v = {
71
71
  title: "Requires attention",
72
72
  dotColour: "orange",
73
73
  statusIcon: {
74
- name: G.hitl.icon,
75
- color: G.hitl.color
74
+ name: F.hitl.icon,
75
+ color: F.hitl.color
76
76
  }
77
77
  },
78
78
  [v.complete]: {
@@ -81,8 +81,8 @@ const v = {
81
81
  dotColour: "green",
82
82
  dotModifier: "grey-dark",
83
83
  statusIcon: {
84
- name: G.complete.icon,
85
- color: G.complete.color
84
+ name: F.complete.icon,
85
+ color: F.complete.color
86
86
  }
87
87
  },
88
88
  [v.failed]: {
@@ -90,32 +90,32 @@ const v = {
90
90
  title: "Failed",
91
91
  dotColour: "salmon",
92
92
  statusIcon: {
93
- name: G.failed.icon,
94
- color: G.failed.color
93
+ name: F.failed.icon,
94
+ color: F.failed.color
95
95
  }
96
96
  }
97
- }, it = [
97
+ }, ct = [
98
98
  v["generating-a-response"],
99
99
  v.hitl
100
- ], ct = [
100
+ ], lt = [
101
101
  v.complete,
102
102
  v.failed
103
- ], lt = "m4", dt = "1", qe = "msg-opening", be = "Unable to load agent tasks. Please try again.", gt = "Unable to load the resources for this agent", pt = "Something went wrong. Please try again.", ze = "Unable to load agents. Please try again.", oe = "Loading tasks…", Pe = "Loading agents…", ut = "Task", ht = "What recent actions have you taken?", _t = {
104
- [T.briefing]: "Briefing",
105
- [T.running]: "Working",
106
- [T.stopped]: "Stopped",
107
- [T.complete]: "Complete"
108
- }, mt = [
103
+ ], dt = "m4", gt = "1", ze = "msg-opening", Ee = "Unable to load agent tasks. Please try again.", pt = "Unable to load the resources for this agent", ut = "Something went wrong. Please try again.", Ke = "Unable to load agents. Please try again.", oe = "Loading tasks…", Pe = "Loading agents…", ht = "Task", _t = "What recent actions have you taken?", mt = {
104
+ [b.briefing]: "Briefing",
105
+ [b.running]: "Working",
106
+ [b.stopped]: "Stopped",
107
+ [b.complete]: "Complete"
108
+ }, ft = [
109
109
  v["generating-a-response"],
110
110
  v.hitl,
111
111
  v.complete,
112
112
  v.failed
113
- ], ft = {
113
+ ], vt = {
114
114
  [v["generating-a-response"]]: "Agents currently working on tasks for you.",
115
115
  [v.hitl]: "Agents that need your input before they can continue.",
116
116
  [v.complete]: "Agents that have finished their work.",
117
117
  [v.failed]: "Agents that failed or were stopped."
118
- }, vt = () => /* @__PURE__ */ i(
118
+ }, wt = () => /* @__PURE__ */ i(
119
119
  "svg",
120
120
  {
121
121
  className: "agent-view__empty-illustration",
@@ -231,8 +231,8 @@ const v = {
231
231
  /* @__PURE__ */ n("circle", { cx: "256", cy: "160", r: "4", fill: "var(--color-semantic-destructive-500)" })
232
232
  ]
233
233
  }
234
- ), wt = ({ status: e }) => {
235
- const t = we[e];
234
+ ), kt = ({ status: e }) => {
235
+ const t = ve[e];
236
236
  return t.statusIcon ? /* @__PURE__ */ n(
237
237
  E,
238
238
  {
@@ -241,8 +241,8 @@ const v = {
241
241
  color: t.statusIcon.color,
242
242
  screenReaderText: t.title
243
243
  }
244
- ) : /* @__PURE__ */ n(Ge, { colour: t.dotColour, label: t.title });
245
- }, kt = () => /* @__PURE__ */ i(
244
+ ) : /* @__PURE__ */ n(Be, { colour: t.dotColour, label: t.title });
245
+ }, yt = () => /* @__PURE__ */ i(
246
246
  "section",
247
247
  {
248
248
  className: "agent-view__empty",
@@ -251,13 +251,13 @@ const v = {
251
251
  /* @__PURE__ */ i("div", { className: "agent-view__empty-content", children: [
252
252
  /* @__PURE__ */ n(he, { level: 4, children: "Your agents board" }),
253
253
  /* @__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." }),
254
- /* @__PURE__ */ n("ul", { className: "agent-view__empty-columns", children: mt.map((e) => {
255
- const t = we[e];
254
+ /* @__PURE__ */ n("ul", { className: "agent-view__empty-columns", children: ft.map((e) => {
255
+ const t = ve[e];
256
256
  return /* @__PURE__ */ i("li", { className: "agent-view__empty-column", children: [
257
- /* @__PURE__ */ n("span", { className: "agent-view__empty-column-indicator", children: /* @__PURE__ */ n(wt, { status: e }) }),
257
+ /* @__PURE__ */ n("span", { className: "agent-view__empty-column-indicator", children: /* @__PURE__ */ n(kt, { status: e }) }),
258
258
  /* @__PURE__ */ i("span", { className: "agent-view__empty-column-text", children: [
259
259
  /* @__PURE__ */ n("span", { className: "agent-view__empty-column-title", children: t.title }),
260
- /* @__PURE__ */ n("span", { className: "agent-view__empty-column-description", children: ft[e] })
260
+ /* @__PURE__ */ n("span", { className: "agent-view__empty-column-description", children: vt[e] })
261
261
  ] })
262
262
  ] }, e);
263
263
  }) }),
@@ -267,39 +267,39 @@ const v = {
267
267
  " above to begin."
268
268
  ] })
269
269
  ] }),
270
- /* @__PURE__ */ n("div", { className: "agent-view__empty-visual", children: /* @__PURE__ */ n(vt, {}) })
270
+ /* @__PURE__ */ n("div", { className: "agent-view__empty-visual", children: /* @__PURE__ */ n(wt, {}) })
271
271
  ]
272
272
  }
273
273
  ), Nt = (e, t) => ({
274
274
  ...e,
275
275
  ...t.length > 0 ? { children: t } : {}
276
- }), Ke = (e) => {
277
- const t = [], s = [];
278
- for (const a of e) {
279
- const r = a.children ? Ke(a.children) : { needsInput: [], tasks: [] };
280
- if (t.push(...r.needsInput), a.status === b.hitl) {
281
- t.push({ ...a, children: void 0 });
276
+ }), We = (e) => {
277
+ const t = [], a = [];
278
+ for (const s of e) {
279
+ const r = s.children ? We(s.children) : { needsInput: [], tasks: [] };
280
+ if (t.push(...r.needsInput), s.status === S.hitl) {
281
+ t.push({ ...s, children: void 0 });
282
282
  continue;
283
283
  }
284
- s.push(Nt(a, r.tasks));
284
+ a.push(Nt(s, r.tasks));
285
285
  }
286
- return { needsInput: t, tasks: s };
287
- }, yt = (e) => e.map((t, s) => ({ item: t, index: s })).sort((t, s) => {
288
- const a = t.item.status === b.hitl, r = s.item.status === b.hitl;
289
- return a !== r ? a ? -1 : 1 : t.index - s.index;
290
- }).map(({ item: t }) => t), At = ({
286
+ return { needsInput: t, tasks: a };
287
+ }, At = (e) => e.map((t, a) => ({ item: t, index: a })).sort((t, a) => {
288
+ const s = t.item.status === S.hitl, r = a.item.status === S.hitl;
289
+ return s !== r ? s ? -1 : 1 : t.index - a.index;
290
+ }).map(({ item: t }) => t), St = ({
291
291
  checklist: e
292
292
  }) => e.length === 0 ? /* @__PURE__ */ n("p", { className: "agent-view__progress-empty", children: "No tasks to display." }) : /* @__PURE__ */ n(
293
293
  "ul",
294
294
  {
295
295
  className: "agent-view__progress-list",
296
296
  "aria-label": "Agent tasks",
297
- children: yt(e).map((t) => {
298
- const s = G[t.status];
297
+ children: At(e).map((t) => {
298
+ const a = F[t.status];
299
299
  return /* @__PURE__ */ i(
300
300
  "li",
301
301
  {
302
- className: M(
302
+ className: H(
303
303
  "agent-view__progress-item",
304
304
  `agent-view__progress-item--${t.status.replace(/_/g, "-")}`
305
305
  ),
@@ -307,18 +307,18 @@ const v = {
307
307
  /* @__PURE__ */ n(
308
308
  E,
309
309
  {
310
- name: s.icon,
310
+ name: a.icon,
311
311
  size: 16,
312
- color: s.color,
313
- screenReaderText: `${s.label}:`,
314
- className: M({
315
- "agent-view__progress-icon--spinning": t.status === b["generating-a-response"]
312
+ color: a.color,
313
+ screenReaderText: `${a.label}:`,
314
+ className: H({
315
+ "agent-view__progress-icon--spinning": t.status === S["generating-a-response"]
316
316
  })
317
317
  }
318
318
  ),
319
319
  /* @__PURE__ */ i("div", { className: "agent-view__progress-item-content", children: [
320
320
  /* @__PURE__ */ n("span", { className: "agent-view__progress-label", children: t.task }),
321
- t.status !== b.complete && /* @__PURE__ */ n(
321
+ t.status !== S.complete && /* @__PURE__ */ n(
322
322
  "span",
323
323
  {
324
324
  className: "agent-view__progress-description",
@@ -332,23 +332,23 @@ const v = {
332
332
  );
333
333
  })
334
334
  }
335
- ), St = ({
335
+ ), bt = ({
336
336
  prompts: e,
337
337
  classNamePrefix: t = "agent-workspace",
338
- onSelect: s
339
- }) => e.length === 0 ? null : /* @__PURE__ */ n("div", { className: `${t}__chips`, children: e.map((a) => /* @__PURE__ */ n(
338
+ onSelect: a
339
+ }) => e.length === 0 ? null : /* @__PURE__ */ n("div", { className: `${t}__chips`, children: e.map((s) => /* @__PURE__ */ n(
340
340
  "button",
341
341
  {
342
342
  type: "button",
343
343
  className: `${t}__chip`,
344
- onClick: () => s(a),
345
- children: a
344
+ onClick: () => a(s),
345
+ children: s
346
346
  },
347
- a
347
+ s
348
348
  )) });
349
- class bt {
350
- constructor(t, s) {
351
- this.connector = t, this.canSend = s.canSend, this.onTurn = s.onTurn, this.onAwaitingChange = s.onAwaitingChange;
349
+ class Ct {
350
+ constructor(t, a) {
351
+ this.connector = t, this.canSend = a.canSend, this.onTurn = a.onTurn, this.onAwaitingChange = a.onAwaitingChange;
352
352
  }
353
353
  get canRate() {
354
354
  return !1;
@@ -366,26 +366,26 @@ class bt {
366
366
  return {};
367
367
  }
368
368
  async sendMessage(t) {
369
- var s, a;
369
+ var a, s;
370
370
  if (!this.canSend())
371
371
  return null;
372
- (s = this.onAwaitingChange) == null || s.call(this, !0);
372
+ (a = this.onAwaitingChange) == null || a.call(this, !0);
373
373
  try {
374
374
  const r = await this.connector.sendMessage(t.userMessage);
375
375
  return this.onTurn(r), {
376
376
  id: r.message.id,
377
377
  text: r.message.text,
378
- type: Be,
378
+ type: qe,
379
379
  ...r.message.followUpPrompts ? { followUpPrompts: r.message.followUpPrompts } : {}
380
380
  };
381
381
  } catch {
382
382
  return {
383
383
  id: `error-${Date.now()}`,
384
- text: pt,
385
- type: at
384
+ text: ut,
385
+ type: st
386
386
  };
387
387
  } finally {
388
- (a = this.onAwaitingChange) == null || a.call(this, !1);
388
+ (s = this.onAwaitingChange) == null || s.call(this, !1);
389
389
  }
390
390
  }
391
391
  async loadHistory(t) {
@@ -400,40 +400,41 @@ class bt {
400
400
  return !1;
401
401
  }
402
402
  }
403
- const Ct = ({
403
+ const Tt = ({
404
404
  connector: e,
405
405
  phase: t,
406
- chatHistory: s,
407
- chatSessionKey: a,
406
+ chatHistory: a,
407
+ chatSessionKey: s,
408
408
  startQuery: r,
409
- clarificationMessage: o,
410
- onTurn: c,
411
- onAwaitingChange: d,
412
- onClarificationPrompt: w,
413
- onDismissClarification: g
409
+ clarificationMessage: d,
410
+ enableUpload: g = !1,
411
+ onTurn: l,
412
+ onAwaitingChange: w,
413
+ onClarificationPrompt: f,
414
+ onDismissClarification: p
414
415
  }) => {
415
- const p = U(
416
- () => new bt(e, {
417
- canSend: () => t === T.running,
418
- onTurn: c,
419
- onAwaitingChange: d
416
+ const _ = U(
417
+ () => new Ct(e, {
418
+ canSend: () => t === b.running,
419
+ onTurn: l,
420
+ onAwaitingChange: w
420
421
  }),
421
- [e, t, c, d]
422
- ), m = t !== T.running, k = t === T.running;
422
+ [e, t, l, w]
423
+ ), u = t !== b.running, C = t === b.running;
423
424
  return /* @__PURE__ */ i("section", { className: "agent-workspace__panel agent-workspace__panel--chat", "aria-label": "Chat", children: [
424
- o && /* @__PURE__ */ i(
425
+ d && /* @__PURE__ */ i(
425
426
  "div",
426
427
  {
427
428
  className: "agent-workspace__clarification",
428
429
  role: "region",
429
430
  "aria-label": "Agent question",
430
431
  children: [
431
- /* @__PURE__ */ n("p", { className: "agent-workspace__clarification-text", children: o.text }),
432
- o.followUpPrompts && /* @__PURE__ */ n(
433
- St,
432
+ /* @__PURE__ */ n("p", { className: "agent-workspace__clarification-text", children: d.text }),
433
+ d.followUpPrompts && /* @__PURE__ */ n(
434
+ bt,
434
435
  {
435
- prompts: o.followUpPrompts,
436
- onSelect: w
436
+ prompts: d.followUpPrompts,
437
+ onSelect: f
437
438
  }
438
439
  ),
439
440
  /* @__PURE__ */ n(
@@ -441,7 +442,7 @@ const Ct = ({
441
442
  {
442
443
  type: "button",
443
444
  className: "agent-workspace__clarification-dismiss",
444
- onClick: g,
445
+ onClick: p,
445
446
  children: "Dismiss"
446
447
  }
447
448
  )
@@ -449,40 +450,40 @@ const Ct = ({
449
450
  }
450
451
  ),
451
452
  /* @__PURE__ */ n("div", { className: "agent-workspace__ask-arbor", children: /* @__PURE__ */ n(
452
- st,
453
+ rt,
453
454
  {
454
- connector: p,
455
- chatHistory: s,
455
+ connector: _,
456
+ chatHistory: a,
456
457
  startQuery: r,
457
- lockConversation: m,
458
- enableUpload: !0,
459
- speechEnabled: k,
458
+ lockConversation: u,
459
+ enableUpload: g,
460
+ speechEnabled: C,
460
461
  speechLanguage: "en-GB",
461
462
  speechSubmissionDelay: 1e3,
462
463
  slashMenuItems: [],
463
464
  menuContent: [],
464
465
  introHeading: "Message your agent",
465
466
  introBody: "Ask questions, share trip details, or paste a link. The agent will update the checklist as it works.",
466
- placeholder: k ? "Message the agent, paste a link, or attach a file…" : "The agent is not accepting messages."
467
+ placeholder: C ? "Message the agent, paste a link, or attach a file…" : "The agent is not accepting messages."
467
468
  },
468
- a
469
+ s
469
470
  ) }),
470
- t === T.stopped && /* @__PURE__ */ i("div", { className: "agent-workspace__notice", role: "status", children: [
471
+ t === b.stopped && /* @__PURE__ */ i("div", { className: "agent-workspace__notice", role: "status", children: [
471
472
  /* @__PURE__ */ n(E, { name: "circle-alert", size: 16, color: "var(--color-semantic-warning-600)" }),
472
473
  /* @__PURE__ */ n("span", { children: "You stopped the agent. Its progress is saved in the checklist on the left." })
473
474
  ] }),
474
- t === T.complete && /* @__PURE__ */ i("div", { className: "agent-workspace__notice", role: "status", children: [
475
+ t === b.complete && /* @__PURE__ */ i("div", { className: "agent-workspace__notice", role: "status", children: [
475
476
  /* @__PURE__ */ n(E, { name: "party-popper", size: 16, color: "var(--color-semantic-success-600)" }),
476
477
  /* @__PURE__ */ n("span", { children: "The agent has finished." })
477
478
  ] })
478
479
  ] });
479
- }, We = ({
480
+ }, Je = ({
480
481
  item: e,
481
482
  depth: t,
482
- canRequestInput: s,
483
- onAttentionItemClick: a
483
+ canRequestInput: a,
484
+ onAttentionItemClick: s
484
485
  }) => {
485
- const r = G[e.status], o = e.status.replace(/_/g, "-"), c = e.status === b.hitl && s && a, d = /* @__PURE__ */ i("div", { className: "agent-workspace__task-row", children: [
486
+ const r = F[e.status], d = e.status.replace(/_/g, "-"), g = e.status === S.hitl && a && s, l = /* @__PURE__ */ i("div", { className: "agent-workspace__task-row", children: [
486
487
  /* @__PURE__ */ n(
487
488
  E,
488
489
  {
@@ -490,40 +491,40 @@ const Ct = ({
490
491
  size: 16,
491
492
  color: r.color,
492
493
  screenReaderText: `${r.label}:`,
493
- className: M({
494
- "agent-workspace__task-icon--spinning": e.status === b["generating-a-response"]
494
+ className: H({
495
+ "agent-workspace__task-icon--spinning": e.status === S["generating-a-response"]
495
496
  })
496
497
  }
497
498
  ),
498
499
  /* @__PURE__ */ i("div", { className: "agent-workspace__task-content", children: [
499
500
  /* @__PURE__ */ n("span", { className: "agent-workspace__task-label", children: e.task }),
500
- e.status !== b.complete && e.description && /* @__PURE__ */ n("span", { className: "agent-workspace__task-description", children: e.description })
501
+ e.status !== S.complete && e.description && /* @__PURE__ */ n("span", { className: "agent-workspace__task-description", children: e.description })
501
502
  ] })
502
503
  ] });
503
504
  return /* @__PURE__ */ i(
504
505
  "li",
505
506
  {
506
- className: M("agent-workspace__task", `agent-workspace__task--${o}`, {
507
+ className: H("agent-workspace__task", `agent-workspace__task--${d}`, {
507
508
  "agent-workspace__task--child": t > 0
508
509
  }),
509
510
  children: [
510
- c ? /* @__PURE__ */ n(
511
+ g ? /* @__PURE__ */ n(
511
512
  "button",
512
513
  {
513
514
  type: "button",
514
515
  className: "agent-workspace__task-button",
515
516
  "aria-label": `Provide input for ${e.task}`,
516
- onClick: () => a(e),
517
- children: d
517
+ onClick: () => s(e),
518
+ children: l
518
519
  }
519
- ) : d,
520
+ ) : l,
520
521
  e.children && e.children.length > 0 && /* @__PURE__ */ n("ul", { className: "agent-workspace__task-children", children: e.children.map((w) => /* @__PURE__ */ n(
521
- We,
522
+ Je,
522
523
  {
523
524
  item: w,
524
525
  depth: t + 1,
525
- canRequestInput: s,
526
- onAttentionItemClick: a
526
+ canRequestInput: a,
527
+ onAttentionItemClick: s
527
528
  },
528
529
  w.task
529
530
  )) })
@@ -533,28 +534,28 @@ const Ct = ({
533
534
  }, Le = ({
534
535
  items: e,
535
536
  ariaLabel: t,
536
- canRequestInput: s,
537
- onAttentionItemClick: a
537
+ canRequestInput: a,
538
+ onAttentionItemClick: s
538
539
  }) => /* @__PURE__ */ n("ul", { className: "agent-workspace__task-list", "aria-label": t, children: e.map((r) => /* @__PURE__ */ n(
539
- We,
540
+ Je,
540
541
  {
541
542
  item: r,
542
543
  depth: 0,
543
- canRequestInput: s,
544
- onAttentionItemClick: a
544
+ canRequestInput: a,
545
+ onAttentionItemClick: s
545
546
  },
546
547
  r.task
547
- )) }), Tt = ({
548
+ )) }), Et = ({
548
549
  checklist: e,
549
550
  isLoading: t,
550
- error: s,
551
- phase: a,
551
+ error: a,
552
+ phase: s,
552
553
  canRequestInput: r,
553
- onStop: o,
554
- onAttentionItemClick: c
554
+ onStop: d,
555
+ onAttentionItemClick: g
555
556
  }) => {
556
- const d = U(
557
- () => e ? Ke(e) : null,
557
+ const l = U(
558
+ () => e ? We(e) : null,
558
559
  [e]
559
560
  );
560
561
  return /* @__PURE__ */ i(
@@ -565,14 +566,14 @@ const Ct = ({
565
566
  children: [
566
567
  /* @__PURE__ */ i("div", { className: "agent-workspace__panel-header", children: [
567
568
  /* @__PURE__ */ n(he, { level: 4, children: "Checklist" }),
568
- a === T.running && /* @__PURE__ */ n(
569
- X,
569
+ s === b.running && /* @__PURE__ */ n(
570
+ J,
570
571
  {
571
572
  variant: "secondary-destructive",
572
573
  size: "S",
573
574
  iconLeftName: "circle-x",
574
575
  iconLeftScreenReaderText: "Stop",
575
- onClick: o,
576
+ onClick: d,
576
577
  children: "Stop agent"
577
578
  }
578
579
  )
@@ -591,47 +592,47 @@ const Ct = ({
591
592
  ),
592
593
  /* @__PURE__ */ n("span", { children: oe })
593
594
  ] }),
594
- !t && s && /* @__PURE__ */ n("p", { className: "agent-workspace__error", role: "alert", children: s }),
595
- !t && !s && d && /* @__PURE__ */ i(Xe, { children: [
596
- d.needsInput.length > 0 && /* @__PURE__ */ i("div", { className: "agent-workspace__task-group", children: [
595
+ !t && a && /* @__PURE__ */ n("p", { className: "agent-workspace__error", role: "alert", children: a }),
596
+ !t && !a && l && /* @__PURE__ */ i(et, { children: [
597
+ l.needsInput.length > 0 && /* @__PURE__ */ i("div", { className: "agent-workspace__task-group", children: [
597
598
  /* @__PURE__ */ n("p", { className: "agent-workspace__task-group-label", children: "Needs your input" }),
598
599
  /* @__PURE__ */ n(
599
600
  Le,
600
601
  {
601
- items: d.needsInput,
602
+ items: l.needsInput,
602
603
  ariaLabel: "Tasks needing your input",
603
604
  canRequestInput: r,
604
- onAttentionItemClick: c
605
+ onAttentionItemClick: g
605
606
  }
606
607
  )
607
608
  ] }),
608
- d.tasks.length > 0 && /* @__PURE__ */ i(
609
+ l.tasks.length > 0 && /* @__PURE__ */ i(
609
610
  "div",
610
611
  {
611
- className: M("agent-workspace__task-group", {
612
- "agent-workspace__task-group--following": d.needsInput.length > 0
612
+ className: H("agent-workspace__task-group", {
613
+ "agent-workspace__task-group--following": l.needsInput.length > 0
613
614
  }),
614
615
  children: [
615
- d.needsInput.length > 0 && /* @__PURE__ */ n("p", { className: "agent-workspace__task-group-label", children: "Other tasks" }),
616
+ l.needsInput.length > 0 && /* @__PURE__ */ n("p", { className: "agent-workspace__task-group-label", children: "Other tasks" }),
616
617
  /* @__PURE__ */ n(
617
618
  Le,
618
619
  {
619
- items: d.tasks,
620
+ items: l.tasks,
620
621
  ariaLabel: "Agent tasks",
621
622
  canRequestInput: r,
622
- onAttentionItemClick: c
623
+ onAttentionItemClick: g
623
624
  }
624
625
  )
625
626
  ]
626
627
  }
627
628
  )
628
629
  ] }),
629
- !t && !s && (!d || d.needsInput.length === 0 && d.tasks.length === 0) && /* @__PURE__ */ n("p", { className: "agent-workspace__empty", children: a === T.briefing ? "Tasks will appear here once the agent starts." : "No tasks to display." })
630
+ !t && !a && (!l || l.needsInput.length === 0 && l.tasks.length === 0) && /* @__PURE__ */ n("p", { className: "agent-workspace__empty", children: s === b.briefing ? "Tasks will appear here once the agent starts." : "No tasks to display." })
630
631
  ] })
631
632
  ]
632
633
  }
633
634
  );
634
- }, Et = {
635
+ }, It = {
635
636
  [re.MIS_RECORD]: {
636
637
  icon: "table",
637
638
  label: "Arbor MIS",
@@ -652,10 +653,10 @@ const Ct = ({
652
653
  label: "Link",
653
654
  color: "var(--color-semantic-info-700)"
654
655
  }
655
- }, It = ({
656
+ }, Rt = ({
656
657
  resources: e,
657
658
  isLoading: t = !1,
658
- error: s = null
659
+ error: a = null
659
660
  }) => /* @__PURE__ */ i(
660
661
  "section",
661
662
  {
@@ -680,21 +681,21 @@ const Ct = ({
680
681
  ),
681
682
  /* @__PURE__ */ n("span", { children: "Loading resources…" })
682
683
  ] }),
683
- !t && s && /* @__PURE__ */ n("p", { className: "agent-workspace__error", role: "alert", children: s }),
684
- !t && !s && e.length > 0 && /* @__PURE__ */ n("ul", { className: "agent-workspace__resource-list", "aria-label": "Agent resources", children: e.map((a) => {
685
- const r = Et[a.type];
684
+ !t && a && /* @__PURE__ */ n("p", { className: "agent-workspace__error", role: "alert", children: a }),
685
+ !t && !a && e.length > 0 && /* @__PURE__ */ n("ul", { className: "agent-workspace__resource-list", "aria-label": "Agent resources", children: e.map((s) => {
686
+ const r = It[s.type];
686
687
  return /* @__PURE__ */ n("li", { className: "agent-workspace__resource", children: /* @__PURE__ */ i(
687
688
  "a",
688
689
  {
689
690
  className: "agent-workspace__resource-card",
690
- href: a.uri,
691
+ href: s.uri,
691
692
  target: "_blank",
692
693
  rel: "noreferrer",
693
694
  children: [
694
695
  /* @__PURE__ */ n(
695
696
  "span",
696
697
  {
697
- className: `agent-workspace__resource-icon agent-workspace__resource-icon--${a.type.toLowerCase()}`,
698
+ className: `agent-workspace__resource-icon agent-workspace__resource-icon--${s.type.toLowerCase()}`,
698
699
  children: /* @__PURE__ */ n(
699
700
  E,
700
701
  {
@@ -708,16 +709,16 @@ const Ct = ({
708
709
  ),
709
710
  /* @__PURE__ */ i("span", { className: "agent-workspace__resource-content", children: [
710
711
  /* @__PURE__ */ i("span", { className: "agent-workspace__resource-top", children: [
711
- /* @__PURE__ */ n("span", { className: "agent-workspace__resource-name", children: a.name }),
712
+ /* @__PURE__ */ n("span", { className: "agent-workspace__resource-name", children: s.name }),
712
713
  /* @__PURE__ */ n(
713
714
  "span",
714
715
  {
715
- className: `agent-workspace__resource-badge agent-workspace__resource-badge--${a.type.toLowerCase()}`,
716
+ className: `agent-workspace__resource-badge agent-workspace__resource-badge--${s.type.toLowerCase()}`,
716
717
  children: r.label
717
718
  }
718
719
  )
719
720
  ] }),
720
- a.description && /* @__PURE__ */ n("span", { className: "agent-workspace__resource-description", children: a.description })
721
+ s.description && /* @__PURE__ */ n("span", { className: "agent-workspace__resource-description", children: s.description })
721
722
  ] }),
722
723
  /* @__PURE__ */ n(
723
724
  E,
@@ -731,440 +732,59 @@ const Ct = ({
731
732
  )
732
733
  ]
733
734
  }
734
- ) }, `${a.type}-${a.uri}`);
735
+ ) }, `${s.type}-${s.uri}`);
735
736
  }) }),
736
- !t && !s && e.length === 0 && /* @__PURE__ */ n("p", { className: "agent-workspace__empty", children: "No resources yet." })
737
+ !t && !a && e.length === 0 && /* @__PURE__ */ n("p", { className: "agent-workspace__empty", children: "No resources yet." })
737
738
  ] })
738
739
  ]
739
740
  }
740
- ), Rt = [
741
+ ), Ot = [
741
742
  "I'll get the details and come back to you",
742
743
  "Skip this for now"
743
- ], Ot = (e) => {
744
- var s;
745
- const t = (s = e.prompt) != null && s.trim() ? e.prompt.trim() : `I need a bit more from you on "${e.task}". ${e.description} What can you tell me?`;
744
+ ], xt = (e) => {
745
+ var a;
746
+ 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?`;
746
747
  return {
747
748
  id: `clarification-${Date.now()}`,
748
- author: Z.agent,
749
+ author: j.agent,
749
750
  text: t,
750
- followUpPrompts: e.clarificationPrompts ?? Rt
751
+ followUpPrompts: e.clarificationPrompts ?? Ot
751
752
  };
752
753
  }, pe = (e) => ({
753
754
  id: e.id,
754
755
  text: e.text,
755
- type: e.author === Z.user ? rt : e.author === Z.system ? ot : Be,
756
+ type: e.author === j.user ? ot : e.author === j.system ? it : qe,
756
757
  ...e.followUpPrompts ? { followUpPrompts: e.followUpPrompts } : {}
757
- }), xt = (e, t) => {
758
- const s = e.hasRunBefore ? t || "This trip" : e.tripName.trim() || "A new trip", a = e.destination ? ` to ${e.destination}` : "", r = e.hasRunBefore ? " It has run before." : "";
759
- return `${s}${a}.${r}`.trim();
760
- }, Pt = (e) => {
761
- switch (e) {
762
- case v.failed:
763
- return T.stopped;
764
- case v.complete:
765
- return T.complete;
766
- default:
767
- return T.running;
768
- }
769
- }, Ue = (e, t) => {
770
- t([pe(e)]);
771
- }, Lt = ({
772
- agent: e,
773
- open: t,
774
- onClose: s,
775
- initialBrief: a,
776
- initialPhase: r,
777
- initialChecklist: o,
778
- fetchAgentChecklist: c,
779
- fetchAgentResources: d,
780
- connector: w
781
- }) => {
782
- const g = Re(w), [p, m] = _(
783
- r ?? (a ? T.running : Pt(e.status))
784
- ), [k, x] = _([]), [P, N] = _(0), [D, S] = _(), [H, q] = _(null), [z, ce] = _([]), [ae, ee] = _(!1), [y, C] = _(null), [$, K] = _(
785
- o ?? null
786
- ), [J, W] = _(!1), [L, le] = _(null), [Ne, te] = _(!1), [j, ye] = _(!1), [V, Ae] = _(!1), Y = Re(!1);
787
- B(() => {
788
- g.current = w;
789
- }, [w]), B(() => {
790
- Y.current = !1, x([]), N((u) => u + 1);
791
- }, [e.invocation_id]), B(() => {
792
- if (!t || a || Y.current)
793
- return;
794
- const u = g.current.bootstrapConversation;
795
- if (!u) {
796
- Ue(
797
- g.current.openingMessage(),
798
- x
799
- );
800
- return;
801
- }
802
- Y.current = !0;
803
- let A = !1;
804
- return te(!0), (async () => {
805
- try {
806
- const se = await u.call(g.current);
807
- if (A)
808
- return;
809
- x(se.map(pe));
810
- } catch {
811
- A || Ue(
812
- g.current.openingMessage(),
813
- x
814
- );
815
- } finally {
816
- A || te(!1);
817
- }
818
- })(), () => {
819
- A = !0;
820
- };
821
- }, [t, a, e.invocation_id, w]);
822
- const ne = I((u) => {
823
- u.checklist && K(u.checklist), u.phase && m(u.phase);
824
- }, []);
825
- B(() => {
826
- var u, A;
827
- !t || a || o && o.length > 0 && ((A = (u = g.current).seedChecklist) == null || A.call(u, o));
828
- }, [t, a, o]), B(() => {
829
- if (!t || a || !c)
830
- return;
831
- let u = !1;
832
- return W(!(o != null && o.length)), le(null), (async () => {
833
- var A, se;
834
- try {
835
- const de = await c(e.invocation_id);
836
- if (u)
837
- return;
838
- o != null && o.length || (K(de.checklist), (se = (A = g.current).seedChecklist) == null || se.call(A, de.checklist));
839
- } catch {
840
- !u && !(o != null && o.length) && le(be);
841
- } finally {
842
- u || W(!1);
843
- }
844
- })(), () => {
845
- u = !0;
846
- };
847
- }, [
848
- t,
849
- e.invocation_id,
850
- a,
851
- o,
852
- c
853
- ]), B(() => {
854
- if (!t || !d)
855
- return;
856
- let u = !1;
857
- return ee(!0), C(null), (async () => {
858
- try {
859
- const A = await d(
860
- e.invocation_id
861
- );
862
- u || ce(A);
863
- } catch {
864
- u || C(gt);
865
- } finally {
866
- u || ee(!1);
867
- }
868
- })(), () => {
869
- u = !0;
870
- };
871
- }, [t, e.invocation_id, d]), B(() => {
872
- if (!t || !a || Y.current)
873
- return;
874
- Y.current = !0;
875
- const u = {
876
- id: `user-brief-${Date.now()}`,
877
- author: Z.user,
878
- text: xt(a, e.invocation_name)
879
- };
880
- (async () => {
881
- const A = await g.current.start(a);
882
- x([
883
- pe(g.current.openingMessage()),
884
- pe(u),
885
- pe(A.message)
886
- ]), A.checklist && K(A.checklist), m(A.phase ?? T.running);
887
- })();
888
- }, [t, a, e.invocation_name]);
889
- const _e = I(
890
- (u) => {
891
- q(Ot(u));
892
- },
893
- []
894
- ), me = I((u) => {
895
- q(null), S(u), N((A) => A + 1);
896
- }, []), fe = I(async () => {
897
- await g.current.stop(), m(T.stopped);
898
- }, []), ve = $;
899
- return /* @__PURE__ */ i(
900
- Q,
901
- {
902
- open: t,
903
- closeHandler: s,
904
- hideCloseButton: !0,
905
- className: "agent-workspace",
906
- children: [
907
- /* @__PURE__ */ i(Q.Header, { className: "agent-workspace__header", children: [
908
- /* @__PURE__ */ i("div", { className: "agent-workspace__header-title", children: [
909
- /* @__PURE__ */ n(
910
- "span",
911
- {
912
- className: "agent-workspace__header-avatar",
913
- "aria-hidden": "true",
914
- children: /* @__PURE__ */ n(E, { name: "ask-arbor", size: 24 })
915
- }
916
- ),
917
- /* @__PURE__ */ n(Q.Title, { children: e.invocation_name }),
918
- /* @__PURE__ */ n(
919
- "span",
920
- {
921
- className: M(
922
- "agent-workspace__phase",
923
- `agent-workspace__phase--${p}`
924
- ),
925
- children: _t[p]
926
- }
927
- )
928
- ] }),
929
- /* @__PURE__ */ i("div", { className: "agent-workspace__header-actions", children: [
930
- /* @__PURE__ */ n(
931
- X,
932
- {
933
- variant: "tertiary",
934
- size: "S",
935
- iconLeftName: "clipboard-list",
936
- iconLeftScreenReaderText: "Toggle checklist",
937
- "aria-pressed": !V,
938
- onClick: () => Ae((u) => !u),
939
- children: "Checklist"
940
- }
941
- ),
942
- /* @__PURE__ */ n(
943
- X,
944
- {
945
- variant: "tertiary",
946
- size: "S",
947
- iconLeftName: "files",
948
- iconLeftScreenReaderText: "Toggle resources",
949
- "aria-pressed": !j,
950
- onClick: () => ye((u) => !u),
951
- children: "Resources"
952
- }
953
- ),
954
- /* @__PURE__ */ n(
955
- X,
956
- {
957
- variant: "secondary",
958
- size: "S",
959
- iconLeftName: "x",
960
- iconLeftScreenReaderText: "Close",
961
- onClick: s,
962
- children: "Close"
963
- }
964
- )
965
- ] })
966
- ] }),
967
- /* @__PURE__ */ i(
968
- Q.Body,
969
- {
970
- className: M("agent-workspace__body", {
971
- "agent-workspace__body--no-left": V,
972
- "agent-workspace__body--no-right": j
973
- }),
974
- children: [
975
- !V && /* @__PURE__ */ n(
976
- Tt,
977
- {
978
- checklist: ve,
979
- isLoading: J,
980
- error: L,
981
- phase: p,
982
- canRequestInput: p === T.running && !Ne,
983
- onStop: () => void fe(),
984
- onAttentionItemClick: _e
985
- }
986
- ),
987
- /* @__PURE__ */ n(
988
- Ct,
989
- {
990
- connector: g.current,
991
- phase: p,
992
- chatHistory: k,
993
- chatSessionKey: P,
994
- startQuery: D,
995
- clarificationMessage: H,
996
- onTurn: ne,
997
- onAwaitingChange: te,
998
- onClarificationPrompt: me,
999
- onDismissClarification: () => q(null)
1000
- }
1001
- ),
1002
- !j && /* @__PURE__ */ n(
1003
- It,
1004
- {
1005
- resources: z,
1006
- isLoading: ae,
1007
- error: y
1008
- }
1009
- )
1010
- ]
1011
- }
1012
- )
1013
- ]
1014
- }
1015
- );
1016
- }, Ut = ({
1017
- open: e,
1018
- onClose: t,
1019
- onStart: s,
1020
- agentDefinitions: a
1021
- }) => {
1022
- const r = a[0], [o, c] = _(
1023
- r
1024
- ), [d, w] = _(""), [g, p] = _(!1), [m, k] = _(null), x = [...a].sort((S, H) => S.agent_intent.localeCompare(H.agent_intent)).map((S) => ({
1025
- value: S.ref,
1026
- label: S.agent_intent
1027
- }));
1028
- B(() => {
1029
- e && (c(r), w(""), p(!1), k(null));
1030
- }, [e, r]);
1031
- const P = o !== void 0 && d.trim().length > 0, N = I(
1032
- (S) => {
1033
- const H = a.find(
1034
- (q) => q.ref === S[0]
1035
- );
1036
- H && c(H);
1037
- },
1038
- [a]
1039
- ), D = I(async () => {
1040
- if (!(!o || !P || g)) {
1041
- p(!0), k(null);
1042
- try {
1043
- await s({ definition: o, invocationName: d.trim() });
1044
- } catch (S) {
1045
- k(
1046
- S instanceof Error ? S.message : "Unable to start the agent."
1047
- );
1048
- } finally {
1049
- p(!1);
1050
- }
1051
- }
1052
- }, [P, o, d, g, s]);
1053
- return !o || a.length === 0 ? null : /* @__PURE__ */ i(
1054
- Q,
1055
- {
1056
- open: e,
1057
- closeHandler: t,
1058
- className: "new-agent",
1059
- children: [
1060
- /* @__PURE__ */ n(Q.Header, { className: "new-agent__header", children: /* @__PURE__ */ i("div", { className: "new-agent__header-title", children: [
1061
- /* @__PURE__ */ n(
1062
- "span",
1063
- {
1064
- className: "new-agent__header-avatar",
1065
- "aria-hidden": "true",
1066
- children: /* @__PURE__ */ n(E, { name: "ask-arbor", size: 24 })
1067
- }
1068
- ),
1069
- /* @__PURE__ */ n(Q.Title, { children: "Start an agent" })
1070
- ] }) }),
1071
- /* @__PURE__ */ n(Q.Body, { className: "new-agent__body", children: /* @__PURE__ */ i(
1072
- "form",
1073
- {
1074
- className: "new-agent__form",
1075
- "aria-label": "Start an agent",
1076
- onSubmit: (S) => {
1077
- S.preventDefault(), P && !g && D();
1078
- },
1079
- children: [
1080
- /* @__PURE__ */ i("div", { className: "new-agent__type-field", children: [
1081
- /* @__PURE__ */ n(
1082
- "label",
1083
- {
1084
- className: "new-agent__type-label",
1085
- htmlFor: "new-agent-type",
1086
- children: "What would you like your agent to do?"
1087
- }
1088
- ),
1089
- /* @__PURE__ */ n(
1090
- et,
1091
- {
1092
- id: "new-agent-type",
1093
- placeholder: "Choose an intent",
1094
- options: x,
1095
- selectedValues: [o.ref],
1096
- onSelectionChange: N
1097
- }
1098
- ),
1099
- /* @__PURE__ */ n("p", { className: "new-agent__type-description", children: o.description })
1100
- ] }),
1101
- /* @__PURE__ */ i("div", { className: "new-agent__type-field", children: [
1102
- /* @__PURE__ */ n(
1103
- "label",
1104
- {
1105
- className: "new-agent__type-label",
1106
- htmlFor: "new-agent-invocation-name",
1107
- children: "Name"
1108
- }
1109
- ),
1110
- /* @__PURE__ */ n(
1111
- tt,
1112
- {
1113
- id: "new-agent-invocation-name",
1114
- value: d,
1115
- placeholder: "e.g. Test with memory3",
1116
- onChange: (S) => w(S.target.value)
1117
- }
1118
- )
1119
- ] }),
1120
- m ? /* @__PURE__ */ n("p", { className: "new-agent__error", role: "alert", children: m }) : null,
1121
- /* @__PURE__ */ n("div", { className: "new-agent__actions", children: /* @__PURE__ */ n(
1122
- X,
1123
- {
1124
- type: "submit",
1125
- variant: "primary",
1126
- disabled: !P || g,
1127
- iconLeftName: g ? "loader" : "sparkles",
1128
- iconLeftScreenReaderText: g ? "Starting" : void 0,
1129
- children: g ? "Starting…" : "Start"
1130
- }
1131
- ) })
1132
- ]
1133
- }
1134
- ) })
1135
- ]
1136
- }
1137
- );
1138
- };
758
+ });
1139
759
  class ue extends Error {
1140
- constructor(t, s, a) {
1141
- super(a ?? `Agent service request failed (${t})`), this.name = "AgentServiceError", this.status = t, this.detail = s;
760
+ constructor(t, a, s) {
761
+ super(s ?? `Agent service request failed (${t})`), this.name = "AgentServiceError", this.status = t, this.detail = a;
1142
762
  }
1143
763
  }
1144
- const $t = "/api/v1", R = {
764
+ const Pt = "/api/v1", O = {
1145
765
  agentDefinitions: "/agent-definitions",
1146
766
  agents: "/agents",
1147
767
  tripOptions: "/trip-options",
1148
768
  demoDataset: "/demo/dataset"
1149
- }, O = {
769
+ }, x = {
1150
770
  GET: "GET",
1151
771
  POST: "POST"
1152
- }, Mt = {
772
+ }, Lt = {
1153
773
  error: "error"
1154
- }, Dt = {
774
+ }, Ut = {
1155
775
  user: "user"
1156
776
  }, ie = {
1157
777
  acceptJson: "application/json",
1158
778
  acceptEventStream: "text/event-stream",
1159
779
  contentTypeJson: "application/json",
1160
780
  arborApplicationUrl: "X-Arbor-Application-Url"
1161
- }, Ht = /:invocationId\b/g, Ft = (e) => e.trim().replace(/^Bearer\s+/i, ""), Gt = (e) => e.endsWith("/") ? e.slice(0, -1) : e;
1162
- class Bt {
781
+ }, $t = /:invocationId\b/g, Mt = (e) => e.trim().replace(/^Bearer\s+/i, ""), Dt = (e) => e.endsWith("/") ? e.slice(0, -1) : e;
782
+ class je {
1163
783
  constructor(t) {
1164
- var a;
1165
- this.baseUrl = Gt(t.baseUrl);
1166
- const s = (a = t.token) == null ? void 0 : a.trim();
1167
- this.token = s ? Ft(s) : void 0, this.customHeaders = t.headers, this.urls = t.urls ?? {}, this.fetchImpl = t.fetch ?? globalThis.fetch.bind(globalThis);
784
+ var s;
785
+ this.baseUrl = Dt(t.baseUrl ?? "");
786
+ const a = (s = t.token) == null ? void 0 : s.trim();
787
+ this.token = a ? Mt(a) : void 0, this.customHeaders = t.headers, this.urls = t.urls ?? {}, this.fetchImpl = t.fetch ?? globalThis.fetch.bind(globalThis);
1168
788
  }
1169
789
  // Replaces the extra headers merged into every subsequent request,
1170
790
  // without recreating the client (e.g. an application-URL header that
@@ -1174,130 +794,130 @@ class Bt {
1174
794
  }
1175
795
  async listAgentDefinitions() {
1176
796
  return (await this.request(
1177
- O.GET,
1178
- this.resolveUrl("agentDefinitions", R.agentDefinitions)
797
+ x.GET,
798
+ this.resolveUrl("agentDefinitions", O.agentDefinitions)
1179
799
  )).agent_definitions ?? [];
1180
800
  }
1181
801
  getAgentDefinition(t) {
1182
802
  return this.request(
1183
- O.GET,
803
+ x.GET,
1184
804
  this.apiUrl(
1185
- `${R.agentDefinitions}/${encodeURIComponent(t)}`
805
+ `${O.agentDefinitions}/${encodeURIComponent(t)}`
1186
806
  )
1187
807
  );
1188
808
  }
1189
809
  listTripOptions() {
1190
810
  return this.request(
1191
- O.GET,
1192
- this.apiUrl(R.tripOptions)
811
+ x.GET,
812
+ this.apiUrl(O.tripOptions)
1193
813
  );
1194
814
  }
1195
815
  getDataset() {
1196
816
  return this.request(
1197
- O.GET,
1198
- this.apiUrl(R.demoDataset)
817
+ x.GET,
818
+ this.apiUrl(O.demoDataset)
1199
819
  );
1200
820
  }
1201
821
  setDataset(t) {
1202
822
  return this.request(
1203
- O.POST,
1204
- this.apiUrl(R.demoDataset),
823
+ x.POST,
824
+ this.apiUrl(O.demoDataset),
1205
825
  { dataset: t }
1206
826
  );
1207
827
  }
1208
828
  listAgents(t = {}) {
1209
- const s = new URLSearchParams();
1210
- t.status && s.set("status", t.status), t.agentDefinitionRef && s.set("agent_definition_ref", t.agentDefinitionRef);
1211
- const a = s.toString() ? `?${s.toString()}` : "";
829
+ const a = new URLSearchParams();
830
+ t.status && a.set("status", t.status), t.agentDefinitionRef && a.set("agent_definition_ref", t.agentDefinitionRef);
831
+ const s = a.toString() ? `?${a.toString()}` : "";
1212
832
  return this.request(
1213
- O.GET,
1214
- `${this.resolveUrl("agents", R.agents)}${a}`
833
+ x.GET,
834
+ `${this.resolveUrl("agents", O.agents)}${s}`
1215
835
  );
1216
836
  }
1217
- createAgent(t, s = {}) {
1218
- var c, d;
1219
- const a = {
837
+ createAgent(t, a = {}) {
838
+ var g, l;
839
+ const s = {
1220
840
  agent_definition_ref: t
1221
- }, r = (c = s.invocationName) == null ? void 0 : c.trim(), o = (d = s.agentIntent) == null ? void 0 : d.trim();
1222
- return r && (a.invocation_name = r), o && (a.agent_intent = o), this.request(
1223
- O.POST,
1224
- this.resolveUrl("agents", R.agents),
1225
- a
841
+ }, r = (g = a.invocationName) == null ? void 0 : g.trim(), d = (l = a.agentIntent) == null ? void 0 : l.trim();
842
+ return r && (s.invocation_name = r), d && (s.agent_intent = d), this.request(
843
+ x.POST,
844
+ this.resolveUrl("agents", O.agents),
845
+ s
1226
846
  );
1227
847
  }
1228
848
  getAgent(t) {
1229
849
  return this.request(
1230
- O.GET,
850
+ x.GET,
1231
851
  this.resolveUrl(
1232
852
  "agent",
1233
- `${R.agents}/${encodeURIComponent(t)}`,
853
+ `${O.agents}/${encodeURIComponent(t)}`,
1234
854
  t
1235
855
  )
1236
856
  );
1237
857
  }
1238
858
  getAgentChecklist(t) {
1239
859
  return this.request(
1240
- O.GET,
860
+ x.GET,
1241
861
  this.resolveUrl(
1242
862
  "agentChecklist",
1243
- `${R.agents}/${encodeURIComponent(t)}/checklist`,
863
+ `${O.agents}/${encodeURIComponent(t)}/checklist`,
1244
864
  t
1245
865
  )
1246
866
  );
1247
867
  }
1248
868
  getAgentResources(t) {
1249
869
  return this.request(
1250
- O.GET,
870
+ x.GET,
1251
871
  this.resolveUrl(
1252
872
  "agentResources",
1253
- `${R.agents}/${encodeURIComponent(t)}/resources`,
873
+ `${O.agents}/${encodeURIComponent(t)}/resources`,
1254
874
  t
1255
875
  )
1256
876
  );
1257
877
  }
1258
878
  getAgentContext(t) {
1259
879
  return this.request(
1260
- O.GET,
880
+ x.GET,
1261
881
  this.apiUrl(
1262
- `${R.agents}/${encodeURIComponent(t)}/context`
882
+ `${O.agents}/${encodeURIComponent(t)}/context`
1263
883
  )
1264
884
  );
1265
885
  }
1266
886
  cancelAgent(t) {
1267
887
  return this.request(
1268
- O.POST,
888
+ x.POST,
1269
889
  this.apiUrl(
1270
- `${R.agents}/${encodeURIComponent(t)}/cancel`
890
+ `${O.agents}/${encodeURIComponent(t)}/cancel`
1271
891
  )
1272
892
  );
1273
893
  }
1274
894
  archiveAgent(t) {
1275
895
  return this.request(
1276
- O.POST,
896
+ x.POST,
1277
897
  this.apiUrl(
1278
- `${R.agents}/${encodeURIComponent(t)}/archive`
898
+ `${O.agents}/${encodeURIComponent(t)}/archive`
1279
899
  )
1280
900
  );
1281
901
  }
1282
902
  // Streams a chat turn. Resolves with the final SSE event; `onEvent` fires
1283
903
  // for every event as it arrives.
1284
- async chat(t, s, a = {}) {
904
+ async chat(t, a, s = {}) {
1285
905
  const r = await this.fetchImpl(
1286
906
  this.resolveUrl(
1287
907
  "agentChat",
1288
- `${R.agents}/${encodeURIComponent(t)}/chat`,
908
+ `${O.agents}/${encodeURIComponent(t)}/chat`,
1289
909
  t
1290
910
  ),
1291
911
  {
1292
- method: O.POST,
912
+ method: x.POST,
1293
913
  headers: {
1294
914
  ...this.customHeaders,
1295
915
  ...this.authHeaders(),
1296
916
  Accept: ie.acceptEventStream,
1297
917
  "Content-Type": ie.contentTypeJson
1298
918
  },
1299
- body: JSON.stringify(s),
1300
- signal: a.signal
919
+ body: JSON.stringify(a),
920
+ signal: s.signal
1301
921
  }
1302
922
  );
1303
923
  if (!r.ok)
@@ -1308,36 +928,36 @@ class Bt {
1308
928
  null,
1309
929
  "Chat response contained no stream body"
1310
930
  );
1311
- return this.consumeSse(r.body, a.onEvent);
931
+ return this.consumeSse(r.body, s.onEvent);
1312
932
  }
1313
933
  authHeaders() {
1314
934
  return this.token ? { Authorization: `Bearer ${this.token}` } : {};
1315
935
  }
1316
936
  // Builds a URL from the base url + shared API prefix + route.
1317
937
  apiUrl(t) {
1318
- return `${this.baseUrl}${$t}${t}`;
938
+ return `${this.baseUrl}${Pt}${t}`;
1319
939
  }
1320
940
  // Resolves the URL for an operation, preferring a per-operation override
1321
941
  // (with `:invocationId` substituted) and falling back to the base url.
1322
- resolveUrl(t, s, a) {
942
+ resolveUrl(t, a, s) {
1323
943
  const r = this.urls[t];
1324
- return r ? a ? r.replace(
1325
- Ht,
1326
- encodeURIComponent(a)
1327
- ) : r : this.apiUrl(s);
944
+ return r ? s ? r.replace(
945
+ $t,
946
+ encodeURIComponent(s)
947
+ ) : r : this.apiUrl(a);
1328
948
  }
1329
- async request(t, s, a) {
949
+ async request(t, a, s) {
1330
950
  const r = await this.fetchImpl(
1331
- s,
951
+ a,
1332
952
  {
1333
953
  method: t,
1334
954
  headers: {
1335
955
  ...this.customHeaders,
1336
956
  ...this.authHeaders(),
1337
957
  Accept: ie.acceptJson,
1338
- ...a === void 0 ? {} : { "Content-Type": ie.contentTypeJson }
958
+ ...s === void 0 ? {} : { "Content-Type": ie.contentTypeJson }
1339
959
  },
1340
- ...a === void 0 ? {} : { body: JSON.stringify(a) }
960
+ ...s === void 0 ? {} : { body: JSON.stringify(s) }
1341
961
  }
1342
962
  );
1343
963
  if (!r.ok)
@@ -1346,105 +966,105 @@ class Bt {
1346
966
  return await r.json();
1347
967
  }
1348
968
  async toError(t) {
1349
- let s = null;
969
+ let a = null;
1350
970
  try {
1351
- s = await t.json();
971
+ a = await t.json();
1352
972
  } catch {
1353
973
  }
1354
974
  return new ue(
1355
975
  t.status,
1356
- s,
976
+ a,
1357
977
  `Agent service request failed (${t.status} ${t.statusText})`
1358
978
  );
1359
979
  }
1360
- async consumeSse(t, s) {
1361
- const a = t.getReader(), r = new TextDecoder();
1362
- let o = "", c;
1363
- const d = (w) => {
1364
- const { event: g, data: p } = qt(w);
980
+ async consumeSse(t, a) {
981
+ const s = t.getReader(), r = new TextDecoder();
982
+ let d = "", g;
983
+ const l = (w) => {
984
+ const { event: f, data: p } = Ht(w);
1365
985
  if (p === null)
1366
986
  return;
1367
- if (g === Mt.error) {
1368
- const k = $e(p);
987
+ if (f === Lt.error) {
988
+ const u = Ue(p);
1369
989
  throw new ue(
1370
990
  502,
1371
- k,
1372
- (k == null ? void 0 : k.message) ?? "Chat stream error"
991
+ u,
992
+ (u == null ? void 0 : u.message) ?? "Chat stream error"
1373
993
  );
1374
994
  }
1375
- const m = $e(p);
1376
- m && (c = m, s == null || s(m));
995
+ const _ = Ue(p);
996
+ _ && (g = _, a == null || a(_));
1377
997
  };
1378
998
  for (; ; ) {
1379
- const { done: w, value: g } = await a.read();
999
+ const { done: w, value: f } = await s.read();
1380
1000
  if (w)
1381
1001
  break;
1382
- o += r.decode(g, { stream: !0 });
1383
- const p = o.split(`
1002
+ d += r.decode(f, { stream: !0 });
1003
+ const p = d.split(`
1384
1004
 
1385
1005
  `);
1386
- o = p.pop() ?? "";
1387
- for (const m of p)
1388
- d(m);
1006
+ d = p.pop() ?? "";
1007
+ for (const _ of p)
1008
+ l(_);
1389
1009
  }
1390
- if (o.trim() && d(o), !c)
1010
+ if (d.trim() && l(d), !g)
1391
1011
  throw new ue(
1392
1012
  502,
1393
1013
  null,
1394
1014
  "Chat stream ended without any events"
1395
1015
  );
1396
- return c;
1016
+ return g;
1397
1017
  }
1398
1018
  }
1399
- const qt = (e) => {
1019
+ const Ht = (e) => {
1400
1020
  let t = null;
1401
- const s = [];
1402
- for (const a of e.split(`
1021
+ const a = [];
1022
+ for (const s of e.split(`
1403
1023
  `)) {
1404
- const r = a.trimEnd();
1405
- r.startsWith("event:") ? t = r.slice(6).trim() : r.startsWith("data:") && s.push(r.slice(5).trim());
1024
+ const r = s.trimEnd();
1025
+ r.startsWith("event:") ? t = r.slice(6).trim() : r.startsWith("data:") && a.push(r.slice(5).trim());
1406
1026
  }
1407
1027
  return {
1408
1028
  event: t,
1409
- data: s.length > 0 ? s.join(`
1029
+ data: a.length > 0 ? a.join(`
1410
1030
  `) : null
1411
1031
  };
1412
- }, $e = (e) => {
1032
+ }, Ue = (e) => {
1413
1033
  try {
1414
1034
  return JSON.parse(e);
1415
1035
  } catch {
1416
1036
  return;
1417
1037
  }
1418
- }, zt = {
1419
- id: qe,
1420
- author: Z.agent,
1038
+ }, Ft = {
1039
+ id: ze,
1040
+ author: j.agent,
1421
1041
  text: "I'm connected to this agent. Ask me how it's progressing, or send an instruction and I’ll act on it."
1422
1042
  };
1423
- let Me = 0;
1424
- const De = (e) => (Me += 1, `${e}-${Date.now()}-${Me}`), Kt = (e) => {
1043
+ let $e = 0;
1044
+ const Me = (e) => ($e += 1, `${e}-${Date.now()}-${$e}`), Gt = (e) => {
1425
1045
  const t = e.destination ? ` to ${e.destination}` : "";
1426
1046
  return `Let's get started on ${e.tripName.trim() || e.destination.trim() || "this task"}${t}. What will you do first?`;
1427
1047
  };
1428
- class Wt {
1429
- constructor(t, s, a = {}) {
1430
- this.seededChecklist = [], this.client = t, this.agentId = s, this.opening = a.openingMessage ?? zt, this.model = a.model, this.bootstrapPrompt = a.bootstrapPrompt ?? ht;
1048
+ class Bt {
1049
+ constructor(t, a, s = {}) {
1050
+ this.seededChecklist = [], this.client = t, this.agentId = a, this.opening = s.openingMessage ?? Ft, this.model = s.model, this.bootstrapPrompt = s.bootstrapPrompt ?? _t;
1431
1051
  }
1432
1052
  openingMessage() {
1433
1053
  return this.opening;
1434
1054
  }
1435
1055
  async bootstrapConversation(t = this.bootstrapPrompt) {
1436
- const s = t.trim();
1437
- if (!s)
1056
+ const a = t.trim();
1057
+ if (!a)
1438
1058
  return [this.opening];
1439
- const a = {
1440
- id: De("msg-user"),
1441
- author: Z.user,
1442
- text: s
1443
- }, r = await this.exchange(s);
1444
- return [a, r.message];
1059
+ const s = {
1060
+ id: Me("msg-user"),
1061
+ author: j.user,
1062
+ text: a
1063
+ }, r = await this.exchange(a);
1064
+ return [s, r.message];
1445
1065
  }
1446
1066
  async start(t) {
1447
- return { ...await this.exchange(Kt(t)), phase: T.running };
1067
+ return { ...await this.exchange(Gt(t)), phase: b.running };
1448
1068
  }
1449
1069
  sendMessage(t) {
1450
1070
  return this.exchange(t);
@@ -1455,11 +1075,11 @@ class Wt {
1455
1075
  this.seededChecklist = t;
1456
1076
  }
1457
1077
  async exchange(t) {
1458
- var o;
1459
- const s = [
1460
- { role: Dt.user, content: t }
1461
- ], a = await this.client.chat(this.agentId, {
1462
- messages: s,
1078
+ var d;
1079
+ const a = [
1080
+ { role: Ut.user, content: t }
1081
+ ], s = await this.client.chat(this.agentId, {
1082
+ messages: a,
1463
1083
  ...this.chatId ? { chat_id: this.chatId } : {},
1464
1084
  ...this.model ? { model: this.model } : {},
1465
1085
  moderation_enabled: !0,
@@ -1468,22 +1088,22 @@ class Wt {
1468
1088
  source: "agent_view_frontend"
1469
1089
  }
1470
1090
  });
1471
- return this.chatId = a.chat_id, { message: {
1472
- id: a.event_id || De("msg-agent"),
1473
- author: Z.agent,
1474
- text: a.message.content,
1475
- ...(o = a.follow_up_prompts) != null && o.length ? { followUpPrompts: a.follow_up_prompts } : {}
1091
+ return this.chatId = s.chat_id, { message: {
1092
+ id: s.event_id || Me("msg-agent"),
1093
+ author: j.agent,
1094
+ text: s.message.content,
1095
+ ...(d = s.follow_up_prompts) != null && d.length ? { followUpPrompts: s.follow_up_prompts } : {}
1476
1096
  } };
1477
1097
  }
1478
1098
  }
1479
- const Jt = (e, t) => (s) => {
1480
- var a;
1481
- return new Wt(e, s.invocation_id, {
1099
+ const Ve = (e, t) => (a) => {
1100
+ var s;
1101
+ return new Bt(e, a.invocation_id, {
1482
1102
  model: t == null ? void 0 : t.model,
1483
1103
  bootstrapPrompt: t == null ? void 0 : t.bootstrapPrompt,
1484
- openingMessage: ((a = t == null ? void 0 : t.resolveOpeningMessage) == null ? void 0 : a.call(t, s)) ?? (t == null ? void 0 : t.openingMessage)
1104
+ openingMessage: ((s = t == null ? void 0 : t.resolveOpeningMessage) == null ? void 0 : s.call(t, a)) ?? (t == null ? void 0 : t.openingMessage)
1485
1105
  });
1486
- }, jt = (e) => {
1106
+ }, qt = (e) => {
1487
1107
  switch (e) {
1488
1108
  case xe.cancelled:
1489
1109
  return v.failed;
@@ -1497,195 +1117,633 @@ const Jt = (e, t) => (s) => {
1497
1117
  default:
1498
1118
  return v["generating-a-response"];
1499
1119
  }
1500
- }, Vt = (e) => {
1120
+ }, zt = (e) => {
1501
1121
  switch (e) {
1502
- case Se.requires_attention:
1503
- return b.hitl;
1504
- case Se.in_progress:
1505
- case Se.available:
1506
- return b["generating-a-response"];
1507
- case b.failed:
1508
- case b.complete:
1509
- case b.hitl:
1510
- case b["generating-a-response"]:
1122
+ case Te.requires_attention:
1123
+ return S.hitl;
1124
+ case Te.in_progress:
1125
+ case Te.available:
1126
+ return S["generating-a-response"];
1127
+ case S.failed:
1128
+ case S.complete:
1129
+ case S.hitl:
1130
+ case S["generating-a-response"]:
1511
1131
  return e;
1512
1132
  default:
1513
- return b["generating-a-response"];
1133
+ return S["generating-a-response"];
1514
1134
  }
1515
- }, Yt = (e) => ({
1135
+ }, Kt = (e) => ({
1516
1136
  ref: e.name,
1517
1137
  display_name: e.display_name,
1518
1138
  agent_intent: e.agent_intent ?? e.display_name,
1519
1139
  description: e.description
1520
- }), fn = (e) => ({
1140
+ }), mn = (e) => ({
1521
1141
  id: e.id,
1522
1142
  name: e.name,
1523
1143
  ...e.has_run_before ? { hasRunBefore: e.has_run_before } : {}
1524
- }), Qt = new Set(Object.values(re)), Xt = (e) => e && Qt.has(e) ? e : re.LINK, Zt = (e) => ({
1144
+ }), Wt = new Set(Object.values(re)), Jt = (e) => e && Wt.has(e) ? e : re.LINK, jt = (e) => ({
1525
1145
  uri: e.uri ?? "",
1526
- type: Xt(e.type),
1146
+ type: Jt(e.type),
1527
1147
  name: e.name ?? "",
1528
1148
  description: e.description ?? ""
1529
- }), en = (e) => (Array.isArray(e) ? e : e.resources ?? []).map(Zt), He = (e) => {
1530
- var s;
1149
+ }), Ye = (e) => (Array.isArray(e) ? e : e.resources ?? []).map(jt), De = (e) => {
1150
+ var a;
1531
1151
  const t = e.invocation_id ?? e.id;
1532
1152
  return {
1533
1153
  id: e.id,
1534
1154
  invocation_id: t,
1535
1155
  agent_definition_ref: e.agent_definition_ref,
1536
1156
  ...e.agent_intent ? { agent_intent: e.agent_intent } : {},
1537
- invocation_name: ((s = e.invocation_name) == null ? void 0 : s.trim()) || e.agent_definition_ref,
1157
+ invocation_name: ((a = e.invocation_name) == null ? void 0 : a.trim()) || e.agent_definition_ref,
1538
1158
  application_id: e.application_id,
1539
1159
  ...e.application_name ? { application_name: e.application_name } : {},
1540
1160
  created_by: e.created_by,
1541
- status: jt(e.status),
1161
+ status: qt(e.status),
1542
1162
  context_ref: e.context_ref ?? null,
1543
1163
  checklist_ref: e.checklist_ref ?? null
1544
1164
  };
1545
- }, Je = (e) => {
1165
+ }, Qe = (e) => {
1546
1166
  var t;
1547
1167
  return {
1548
- task: e.task ?? e.name ?? e.label ?? ut,
1549
- status: Vt(e.status),
1168
+ task: e.task ?? e.name ?? e.label ?? ht,
1169
+ status: zt(e.status),
1550
1170
  description: e.description ?? "",
1551
1171
  ...e.prompt ? { prompt: e.prompt } : {},
1552
1172
  ...(t = e.follow_up_prompts) != null && t.length ? { clarificationPrompts: e.follow_up_prompts } : {}
1553
1173
  };
1554
- }, tn = (e) => Array.isArray(e) ? e : e.checklist_items ?? e.checklist ?? e.items ?? [], nn = (e, t, s) => {
1555
- var o;
1556
- const a = !Array.isArray(t) && (t.opening_message || (o = t.opening_follow_up_prompts) != null && o.length) ? t : s, r = a ? ke(a) : void 0;
1174
+ }, Vt = (e) => Array.isArray(e) ? e : e.checklist_items ?? e.checklist ?? e.items ?? [], Xe = (e, t, a) => {
1175
+ var d;
1176
+ const s = !Array.isArray(t) && (t.opening_message || (d = t.opening_follow_up_prompts) != null && d.length) ? t : a, r = s ? we(s) : void 0;
1557
1177
  return {
1558
1178
  invocation_id: e,
1559
- checklist: tn(t).map(Je),
1179
+ checklist: Vt(t).map(Qe),
1560
1180
  ...r ? { openingMessage: r } : {}
1561
1181
  };
1562
- }, vn = (e, t) => {
1563
- const s = ke(t);
1182
+ }, fn = (e, t) => {
1183
+ const a = we(t);
1564
1184
  return {
1565
1185
  invocation_id: t.invocation_id ?? e,
1566
- checklist: (t.checklist_items ?? []).map(Je),
1567
- ...s ? { openingMessage: s } : {}
1186
+ checklist: (t.checklist_items ?? []).map(Qe),
1187
+ ...a ? { openingMessage: a } : {}
1568
1188
  };
1569
- }, ke = (e) => {
1570
- var s, a;
1571
- const t = (s = e.opening_message) == null ? void 0 : s.trim();
1189
+ }, we = (e) => {
1190
+ var a, s;
1191
+ const t = (a = e.opening_message) == null ? void 0 : a.trim();
1572
1192
  if (t)
1573
1193
  return {
1574
- id: qe,
1575
- author: Z.agent,
1194
+ id: ze,
1195
+ author: j.agent,
1576
1196
  text: t,
1577
- ...(a = e.opening_follow_up_prompts) != null && a.length ? { followUpPrompts: e.opening_follow_up_prompts } : {}
1197
+ ...(s = e.opening_follow_up_prompts) != null && s.length ? { followUpPrompts: e.opening_follow_up_prompts } : {}
1578
1198
  };
1579
- }, an = (e) => e instanceof ue ? e.message : e instanceof TypeError ? "Network error while contacting the agent service." : e instanceof Error && e.message ? e.message : ze, sn = (e) => {
1199
+ }, Yt = (e) => e instanceof ue ? e.message : e instanceof TypeError ? "Network error while contacting the agent service." : e instanceof Error && e.message ? e.message : Ke, Qt = (e) => {
1580
1200
  const t = {};
1581
- for (const s of e) {
1582
- const a = ke(s);
1583
- if (!a)
1201
+ for (const a of e) {
1202
+ const s = we(a);
1203
+ if (!s)
1584
1204
  continue;
1585
- const r = s.invocation_id ?? s.id;
1586
- t[r] = a, t[s.id] = a;
1205
+ const r = a.invocation_id ?? a.id;
1206
+ t[r] = s, t[a.id] = s;
1587
1207
  }
1588
1208
  return t;
1589
- }, rn = (e) => JSON.stringify(e), on = (e) => {
1590
- const { jwt: t, headers: s, urls: a } = e, r = JSON.stringify(s ?? {}), o = rn(a), c = U(
1591
- () => {
1592
- const { baseUrl: y, ...C } = a;
1593
- return new Bt({
1594
- baseUrl: y,
1595
- token: t,
1596
- headers: s,
1597
- urls: C
1598
- });
1599
- },
1209
+ }, Xt = (e) => JSON.stringify(e), Zt = (e) => {
1210
+ const { jwt: t, headers: a, urls: s } = e, r = JSON.stringify(a ?? {}), d = Xt(s), g = U(
1211
+ () => new je({
1212
+ token: t,
1213
+ headers: a,
1214
+ urls: s
1215
+ }),
1600
1216
  // eslint-disable-next-line react-hooks/exhaustive-deps -- keyed on serialised config to keep a stable client.
1601
- [t, o]
1217
+ [t, d]
1602
1218
  );
1603
- Ze(() => {
1604
- c.setHeaders(s);
1605
- }, [c, r]);
1606
- const [d, w] = _([]), [g, p] = _(
1219
+ Ge(() => {
1220
+ g.setHeaders(a);
1221
+ }, [g, r]);
1222
+ const [l, w] = m([]), [f, p] = m(
1607
1223
  []
1608
- ), [m, k] = _({}), [x, P] = _("loading"), [N, D] = _(null), [S, H] = _(0);
1609
- B(() => {
1610
- let y = !1;
1611
- return P("loading"), D(null), (async () => {
1224
+ ), [_, u] = m({}), [C, R] = m("loading"), [y, A] = m(null), [k, $] = m(0);
1225
+ G(() => {
1226
+ let N = !1;
1227
+ return R("loading"), A(null), (async () => {
1612
1228
  try {
1613
- const [C, $] = await Promise.all([
1614
- c.listAgents(),
1615
- c.listAgentDefinitions()
1229
+ const [I, D] = await Promise.all([
1230
+ g.listAgents(),
1231
+ g.listAgentDefinitions()
1616
1232
  ]);
1617
- if (y)
1233
+ if (N)
1618
1234
  return;
1619
- w(C.map(He)), p($.map(Yt)), k(sn(C)), P("idle");
1620
- } catch (C) {
1621
- if (y)
1235
+ w(I.map(De)), p(D.map(Kt)), u(Qt(I)), R("idle");
1236
+ } catch (I) {
1237
+ if (N)
1622
1238
  return;
1623
- w([]), p([]), k({}), P("error"), D(an(C));
1239
+ w([]), p([]), u({}), R("error"), A(Yt(I));
1624
1240
  }
1625
1241
  })(), () => {
1626
- y = !0;
1242
+ N = !0;
1627
1243
  };
1628
- }, [c, S]);
1629
- const q = I(() => {
1630
- H((y) => y + 1);
1631
- }, []), z = I(
1632
- async (y) => {
1633
- const [C, $] = await Promise.all([
1634
- c.getAgentChecklist(y),
1635
- c.getAgent(y).catch(() => null)
1244
+ }, [g, k]);
1245
+ const V = T(() => {
1246
+ $((N) => N + 1);
1247
+ }, []), M = T(
1248
+ async (N) => {
1249
+ const [I, D] = await Promise.all([
1250
+ g.getAgentChecklist(N),
1251
+ g.getAgent(N).catch(() => null)
1636
1252
  ]);
1637
- return nn(
1638
- y,
1639
- C,
1640
- $ ?? void 0
1253
+ return Xe(
1254
+ N,
1255
+ I,
1256
+ D ?? void 0
1641
1257
  );
1642
1258
  },
1643
- [c]
1644
- ), ce = I(
1645
- async (y) => {
1646
- const C = await c.getAgentResources(y);
1647
- return en(C);
1259
+ [g]
1260
+ ), ee = T(
1261
+ async (N) => {
1262
+ const I = await g.getAgentResources(N);
1263
+ return Ye(I);
1648
1264
  },
1649
- [c]
1650
- ), ae = I(
1265
+ [g]
1266
+ ), te = T(
1651
1267
  async ({
1652
- definition: y,
1653
- invocationName: C
1268
+ definition: N,
1269
+ invocationName: I
1654
1270
  }) => {
1655
- const $ = await c.createAgent(y.ref, {
1656
- invocationName: C
1657
- }), K = await c.getAgent($.id), J = He(K), W = ke(K);
1658
- return w((L) => [J, ...L]), W && k((L) => ({
1659
- ...L,
1660
- [J.invocation_id]: W,
1661
- [J.id]: W
1662
- })), J;
1271
+ const D = await g.createAgent(N.ref, {
1272
+ invocationName: I
1273
+ }), Q = await g.getAgent(D.id), P = De(Q), B = we(Q);
1274
+ return w((q) => [P, ...q]), B && u((q) => ({
1275
+ ...q,
1276
+ [P.invocation_id]: B,
1277
+ [P.id]: B
1278
+ })), P;
1663
1279
  },
1664
- [c]
1665
- ), ee = U(
1666
- () => Jt(c, {
1667
- resolveOpeningMessage: (y) => m[y.invocation_id] ?? m[y.id]
1280
+ [g]
1281
+ ), Y = U(
1282
+ () => Ve(g, {
1283
+ resolveOpeningMessage: (N) => _[N.invocation_id] ?? _[N.id]
1284
+ }),
1285
+ [g, _]
1286
+ );
1287
+ return {
1288
+ agents: l,
1289
+ agentDefinitions: f,
1290
+ loadState: C,
1291
+ loadError: y,
1292
+ reload: V,
1293
+ fetchAgentChecklist: M,
1294
+ fetchAgentResources: ee,
1295
+ createAgent: te,
1296
+ chatConnector: Y
1297
+ };
1298
+ }, en = (e) => JSON.stringify(e), tn = (e) => {
1299
+ const { agent: t, jwt: a, headers: s, urls: r } = e, d = JSON.stringify(s ?? {}), g = en(r), l = U(
1300
+ () => new je({
1301
+ token: a,
1302
+ headers: s,
1303
+ urls: {
1304
+ agent: r.agentUrl,
1305
+ agentChecklist: r.agentChecklistUrl,
1306
+ agentResources: r.agentResourcesUrl,
1307
+ agentChat: r.agentChatUrl
1308
+ }
1668
1309
  }),
1669
- [c, m]
1310
+ // eslint-disable-next-line react-hooks/exhaustive-deps -- keyed on serialised config to keep a stable client.
1311
+ [a, g]
1312
+ );
1313
+ Ge(() => {
1314
+ l.setHeaders(s);
1315
+ }, [l, d]);
1316
+ const w = T(
1317
+ async (_) => {
1318
+ const [u, C] = await Promise.all([
1319
+ l.getAgentChecklist(_),
1320
+ l.getAgent(_).catch(() => null)
1321
+ ]);
1322
+ return Xe(
1323
+ _,
1324
+ u,
1325
+ C ?? void 0
1326
+ );
1327
+ },
1328
+ [l]
1329
+ ), f = T(
1330
+ async (_) => {
1331
+ const u = await l.getAgentResources(_);
1332
+ return Ye(u);
1333
+ },
1334
+ [l]
1670
1335
  );
1671
1336
  return {
1672
- agents: d,
1673
- agentDefinitions: g,
1674
- loadState: x,
1675
- loadError: N,
1676
- reload: q,
1677
- fetchAgentChecklist: z,
1678
- fetchAgentResources: ce,
1679
- createAgent: ae,
1680
- chatConnector: ee
1337
+ connector: U(
1338
+ () => Ve(l)(t),
1339
+ [l, t]
1340
+ ),
1341
+ fetchAgentChecklist: w,
1342
+ fetchAgentResources: f
1681
1343
  };
1682
- }, cn = (e) => e !== void 0 && e.some((t) => t.status === b.hitl), ln = (e, t) => cn(t) ? v.hitl : e.status, dn = ({ column: e, label: t }) => e.statusIcon ? /* @__PURE__ */ n("span", { className: "agent-view__status-indicator", children: /* @__PURE__ */ n(
1344
+ }, nn = (e, t) => {
1345
+ 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." : "";
1346
+ return `${a}${s}.${r}`.trim();
1347
+ }, an = (e) => {
1348
+ switch (e) {
1349
+ case v.failed:
1350
+ return b.stopped;
1351
+ case v.complete:
1352
+ return b.complete;
1353
+ default:
1354
+ return b.running;
1355
+ }
1356
+ }, He = (e, t) => {
1357
+ t([pe(e)]);
1358
+ }, sn = ({
1359
+ agent: e,
1360
+ open: t,
1361
+ onClose: a,
1362
+ jwt: s,
1363
+ headers: r,
1364
+ agentUrl: d,
1365
+ agentChecklistUrl: g,
1366
+ agentResourcesUrl: l,
1367
+ agentChatUrl: w,
1368
+ enableUpload: f,
1369
+ initialBrief: p,
1370
+ initialPhase: _,
1371
+ initialChecklist: u
1372
+ }) => {
1373
+ const { connector: C, fetchAgentChecklist: R, fetchAgentResources: y } = tn({
1374
+ agent: e,
1375
+ jwt: s,
1376
+ headers: r,
1377
+ urls: {
1378
+ agentUrl: d,
1379
+ agentChecklistUrl: g,
1380
+ agentResourcesUrl: l,
1381
+ agentChatUrl: w
1382
+ }
1383
+ }), A = Re(C), [k, $] = m(
1384
+ _ ?? (p ? b.running : an(e.status))
1385
+ ), [V, M] = m([]), [ee, te] = m(0), [Y, N] = m(), [I, D] = m(null), [Q, P] = m([]), [B, q] = m(!1), [ce, X] = m(null), [ke, z] = m(
1386
+ u ?? null
1387
+ ), [ye, le] = m(!1), [Z, de] = m(null), [_e, ne] = m(!1), [ae, Ne] = m(!1), [se, Ae] = m(!1), K = Re(!1);
1388
+ G(() => {
1389
+ A.current = C;
1390
+ }, [C]), G(() => {
1391
+ K.current = !1, M([]), te((o) => o + 1);
1392
+ }, [e.invocation_id]), G(() => {
1393
+ if (!t || p || K.current)
1394
+ return;
1395
+ const o = A.current.bootstrapConversation;
1396
+ if (!o) {
1397
+ He(
1398
+ A.current.openingMessage(),
1399
+ M
1400
+ );
1401
+ return;
1402
+ }
1403
+ K.current = !0;
1404
+ let c = !1;
1405
+ return ne(!0), (async () => {
1406
+ try {
1407
+ const h = await o.call(A.current);
1408
+ if (c)
1409
+ return;
1410
+ M(h.map(pe));
1411
+ } catch {
1412
+ c || He(
1413
+ A.current.openingMessage(),
1414
+ M
1415
+ );
1416
+ } finally {
1417
+ c || ne(!1);
1418
+ }
1419
+ })(), () => {
1420
+ c = !0;
1421
+ };
1422
+ }, [t, p, e.invocation_id, C]);
1423
+ const Se = T((o) => {
1424
+ o.checklist && z(o.checklist), o.phase && $(o.phase);
1425
+ }, []);
1426
+ G(() => {
1427
+ var o, c;
1428
+ !t || p || u && u.length > 0 && ((c = (o = A.current).seedChecklist) == null || c.call(o, u));
1429
+ }, [t, p, u]), G(() => {
1430
+ if (!t || p)
1431
+ return;
1432
+ let o = !1;
1433
+ return le(!(u != null && u.length)), de(null), (async () => {
1434
+ var c, h;
1435
+ try {
1436
+ const L = await R(e.invocation_id);
1437
+ if (o)
1438
+ return;
1439
+ u != null && u.length || (z(L.checklist), (h = (c = A.current).seedChecklist) == null || h.call(c, L.checklist));
1440
+ } catch {
1441
+ !o && !(u != null && u.length) && de(Ee);
1442
+ } finally {
1443
+ o || le(!1);
1444
+ }
1445
+ })(), () => {
1446
+ o = !0;
1447
+ };
1448
+ }, [
1449
+ t,
1450
+ e.invocation_id,
1451
+ p,
1452
+ u,
1453
+ R
1454
+ ]), G(() => {
1455
+ if (!t)
1456
+ return;
1457
+ let o = !1;
1458
+ return q(!0), X(null), (async () => {
1459
+ try {
1460
+ const c = await y(
1461
+ e.invocation_id
1462
+ );
1463
+ o || P(c);
1464
+ } catch {
1465
+ o || X(pt);
1466
+ } finally {
1467
+ o || q(!1);
1468
+ }
1469
+ })(), () => {
1470
+ o = !0;
1471
+ };
1472
+ }, [t, e.invocation_id, y]), G(() => {
1473
+ if (!t || !p || K.current)
1474
+ return;
1475
+ K.current = !0;
1476
+ const o = {
1477
+ id: `user-brief-${Date.now()}`,
1478
+ author: j.user,
1479
+ text: nn(p, e.invocation_name)
1480
+ };
1481
+ (async () => {
1482
+ const c = await A.current.start(p);
1483
+ M([
1484
+ pe(A.current.openingMessage()),
1485
+ pe(o),
1486
+ pe(c.message)
1487
+ ]), c.checklist && z(c.checklist), $(c.phase ?? b.running);
1488
+ })();
1489
+ }, [t, p, e.invocation_name]);
1490
+ const be = T(
1491
+ (o) => {
1492
+ D(xt(o));
1493
+ },
1494
+ []
1495
+ ), Ce = T((o) => {
1496
+ D(null), N(o), te((c) => c + 1);
1497
+ }, []), me = T(async () => {
1498
+ await A.current.stop(), $(b.stopped);
1499
+ }, []), fe = ke;
1500
+ return /* @__PURE__ */ i(
1501
+ W,
1502
+ {
1503
+ open: t,
1504
+ closeHandler: a,
1505
+ hideCloseButton: !0,
1506
+ className: "agent-workspace",
1507
+ children: [
1508
+ /* @__PURE__ */ i(W.Header, { className: "agent-workspace__header", children: [
1509
+ /* @__PURE__ */ i("div", { className: "agent-workspace__header-title", children: [
1510
+ /* @__PURE__ */ n(
1511
+ "span",
1512
+ {
1513
+ className: "agent-workspace__header-avatar",
1514
+ "aria-hidden": "true",
1515
+ children: /* @__PURE__ */ n(E, { name: "ask-arbor", size: 24 })
1516
+ }
1517
+ ),
1518
+ /* @__PURE__ */ n(W.Title, { children: e.invocation_name }),
1519
+ /* @__PURE__ */ n(
1520
+ "span",
1521
+ {
1522
+ className: H(
1523
+ "agent-workspace__phase",
1524
+ `agent-workspace__phase--${k}`
1525
+ ),
1526
+ children: mt[k]
1527
+ }
1528
+ )
1529
+ ] }),
1530
+ /* @__PURE__ */ i("div", { className: "agent-workspace__header-actions", children: [
1531
+ /* @__PURE__ */ n(
1532
+ J,
1533
+ {
1534
+ variant: "tertiary",
1535
+ size: "S",
1536
+ iconLeftName: "clipboard-list",
1537
+ iconLeftScreenReaderText: "Toggle checklist",
1538
+ "aria-pressed": !se,
1539
+ onClick: () => Ae((o) => !o),
1540
+ children: "Checklist"
1541
+ }
1542
+ ),
1543
+ /* @__PURE__ */ n(
1544
+ J,
1545
+ {
1546
+ variant: "tertiary",
1547
+ size: "S",
1548
+ iconLeftName: "files",
1549
+ iconLeftScreenReaderText: "Toggle resources",
1550
+ "aria-pressed": !ae,
1551
+ onClick: () => Ne((o) => !o),
1552
+ children: "Resources"
1553
+ }
1554
+ ),
1555
+ /* @__PURE__ */ n(
1556
+ J,
1557
+ {
1558
+ variant: "secondary",
1559
+ size: "S",
1560
+ iconLeftName: "x",
1561
+ iconLeftScreenReaderText: "Close",
1562
+ onClick: a,
1563
+ children: "Close"
1564
+ }
1565
+ )
1566
+ ] })
1567
+ ] }),
1568
+ /* @__PURE__ */ i(
1569
+ W.Body,
1570
+ {
1571
+ className: H("agent-workspace__body", {
1572
+ "agent-workspace__body--no-left": se,
1573
+ "agent-workspace__body--no-right": ae
1574
+ }),
1575
+ children: [
1576
+ !se && /* @__PURE__ */ n(
1577
+ Et,
1578
+ {
1579
+ checklist: fe,
1580
+ isLoading: ye,
1581
+ error: Z,
1582
+ phase: k,
1583
+ canRequestInput: k === b.running && !_e,
1584
+ onStop: () => void me(),
1585
+ onAttentionItemClick: be
1586
+ }
1587
+ ),
1588
+ /* @__PURE__ */ n(
1589
+ Tt,
1590
+ {
1591
+ connector: A.current,
1592
+ phase: k,
1593
+ chatHistory: V,
1594
+ chatSessionKey: ee,
1595
+ startQuery: Y,
1596
+ clarificationMessage: I,
1597
+ enableUpload: f,
1598
+ onTurn: Se,
1599
+ onAwaitingChange: ne,
1600
+ onClarificationPrompt: Ce,
1601
+ onDismissClarification: () => D(null)
1602
+ }
1603
+ ),
1604
+ !ae && /* @__PURE__ */ n(
1605
+ Rt,
1606
+ {
1607
+ resources: Q,
1608
+ isLoading: B,
1609
+ error: ce
1610
+ }
1611
+ )
1612
+ ]
1613
+ }
1614
+ )
1615
+ ]
1616
+ }
1617
+ );
1618
+ }, rn = ({
1619
+ open: e,
1620
+ onClose: t,
1621
+ onStart: a,
1622
+ agentDefinitions: s
1623
+ }) => {
1624
+ const r = s[0], [d, g] = m(
1625
+ r
1626
+ ), [l, w] = m(""), [f, p] = m(!1), [_, u] = m(null), C = [...s].sort((k, $) => k.agent_intent.localeCompare($.agent_intent)).map((k) => ({
1627
+ value: k.ref,
1628
+ label: k.agent_intent
1629
+ }));
1630
+ G(() => {
1631
+ e && (g(r), w(""), p(!1), u(null));
1632
+ }, [e, r]);
1633
+ const R = d !== void 0 && l.trim().length > 0, y = T(
1634
+ (k) => {
1635
+ const $ = s.find(
1636
+ (V) => V.ref === k[0]
1637
+ );
1638
+ $ && g($);
1639
+ },
1640
+ [s]
1641
+ ), A = T(async () => {
1642
+ if (!(!d || !R || f)) {
1643
+ p(!0), u(null);
1644
+ try {
1645
+ await a({ definition: d, invocationName: l.trim() });
1646
+ } catch (k) {
1647
+ u(
1648
+ k instanceof Error ? k.message : "Unable to start the agent."
1649
+ );
1650
+ } finally {
1651
+ p(!1);
1652
+ }
1653
+ }
1654
+ }, [R, d, l, f, a]);
1655
+ return !d || s.length === 0 ? null : /* @__PURE__ */ i(
1656
+ W,
1657
+ {
1658
+ open: e,
1659
+ closeHandler: t,
1660
+ className: "new-agent",
1661
+ children: [
1662
+ /* @__PURE__ */ n(W.Header, { className: "new-agent__header", children: /* @__PURE__ */ i("div", { className: "new-agent__header-title", children: [
1663
+ /* @__PURE__ */ n(
1664
+ "span",
1665
+ {
1666
+ className: "new-agent__header-avatar",
1667
+ "aria-hidden": "true",
1668
+ children: /* @__PURE__ */ n(E, { name: "ask-arbor", size: 24 })
1669
+ }
1670
+ ),
1671
+ /* @__PURE__ */ n(W.Title, { children: "Start an agent" })
1672
+ ] }) }),
1673
+ /* @__PURE__ */ n(W.Body, { className: "new-agent__body", children: /* @__PURE__ */ i(
1674
+ "form",
1675
+ {
1676
+ className: "new-agent__form",
1677
+ "aria-label": "Start an agent",
1678
+ onSubmit: (k) => {
1679
+ k.preventDefault(), R && !f && A();
1680
+ },
1681
+ children: [
1682
+ /* @__PURE__ */ i("div", { className: "new-agent__type-field", children: [
1683
+ /* @__PURE__ */ n(
1684
+ "label",
1685
+ {
1686
+ className: "new-agent__type-label",
1687
+ htmlFor: "new-agent-type",
1688
+ children: "What would you like your agent to do?"
1689
+ }
1690
+ ),
1691
+ /* @__PURE__ */ n(
1692
+ tt,
1693
+ {
1694
+ id: "new-agent-type",
1695
+ placeholder: "Choose an intent",
1696
+ options: C,
1697
+ selectedValues: [d.ref],
1698
+ onSelectionChange: y
1699
+ }
1700
+ ),
1701
+ /* @__PURE__ */ n("p", { className: "new-agent__type-description", children: d.description })
1702
+ ] }),
1703
+ /* @__PURE__ */ i("div", { className: "new-agent__type-field", children: [
1704
+ /* @__PURE__ */ n(
1705
+ "label",
1706
+ {
1707
+ className: "new-agent__type-label",
1708
+ htmlFor: "new-agent-invocation-name",
1709
+ children: "Name"
1710
+ }
1711
+ ),
1712
+ /* @__PURE__ */ n(
1713
+ nt,
1714
+ {
1715
+ id: "new-agent-invocation-name",
1716
+ value: l,
1717
+ placeholder: "e.g. Test with memory3",
1718
+ onChange: (k) => w(k.target.value)
1719
+ }
1720
+ )
1721
+ ] }),
1722
+ _ ? /* @__PURE__ */ n("p", { className: "new-agent__error", role: "alert", children: _ }) : null,
1723
+ /* @__PURE__ */ n("div", { className: "new-agent__actions", children: /* @__PURE__ */ n(
1724
+ J,
1725
+ {
1726
+ type: "submit",
1727
+ variant: "primary",
1728
+ disabled: !R || f,
1729
+ iconLeftName: f ? "loader" : "sparkles",
1730
+ iconLeftScreenReaderText: f ? "Starting" : void 0,
1731
+ children: f ? "Starting…" : "Start"
1732
+ }
1733
+ ) })
1734
+ ]
1735
+ }
1736
+ ) })
1737
+ ]
1738
+ }
1739
+ );
1740
+ }, on = (e) => e !== void 0 && e.some((t) => t.status === S.hitl), cn = (e, t) => on(t) ? v.hitl : e.status, ln = ({ column: e, label: t }) => e.statusIcon ? /* @__PURE__ */ n("span", { className: "agent-view__status-indicator", children: /* @__PURE__ */ n(
1683
1741
  E,
1684
1742
  {
1685
1743
  name: e.statusIcon.name,
1686
1744
  size: 16,
1687
1745
  color: e.statusIcon.color,
1688
- className: M({
1746
+ className: H({
1689
1747
  "agent-view__progress-icon--spinning": e.statusIcon.spin
1690
1748
  }),
1691
1749
  screenReaderText: t
@@ -1693,48 +1751,48 @@ const Jt = (e, t) => (s) => {
1693
1751
  ) }) : /* @__PURE__ */ n(
1694
1752
  "span",
1695
1753
  {
1696
- className: M("agent-view__dot", {
1754
+ className: H("agent-view__dot", {
1697
1755
  [`agent-view__dot--${e.dotModifier}`]: e.dotModifier
1698
1756
  }),
1699
- children: /* @__PURE__ */ n(Ge, { colour: e.dotColour, label: t })
1757
+ children: /* @__PURE__ */ n(Be, { colour: e.dotColour, label: t })
1700
1758
  }
1701
- ), gn = ({
1759
+ ), dn = ({
1702
1760
  agent: e,
1703
1761
  agentName: t,
1704
- column: s,
1705
- isExpanded: a,
1762
+ column: a,
1763
+ isExpanded: s,
1706
1764
  isLoading: r,
1707
- checklist: o,
1708
- error: c,
1709
- onToggle: d,
1765
+ checklist: d,
1766
+ error: g,
1767
+ onToggle: l,
1710
1768
  onViewAgent: w
1711
1769
  }) => {
1712
- const { id: g, invocation_name: p } = e, m = `agent-card-${g}-header`, k = `agent-card-${g}-progress`;
1770
+ const { id: f, invocation_name: p } = e, _ = `agent-card-${f}-header`, u = `agent-card-${f}-progress`;
1713
1771
  return /* @__PURE__ */ n(
1714
1772
  "li",
1715
1773
  {
1716
- className: M("agent-view__card", {
1717
- "agent-view__card--expanded": a
1774
+ className: H("agent-view__card", {
1775
+ "agent-view__card--expanded": s
1718
1776
  }),
1719
- children: /* @__PURE__ */ i(nt, { spacing: "dense", children: [
1777
+ children: /* @__PURE__ */ i(at, { spacing: "dense", children: [
1720
1778
  /* @__PURE__ */ n(
1721
1779
  "button",
1722
1780
  {
1723
1781
  type: "button",
1724
1782
  className: "agent-view__card-toggle",
1725
- "aria-expanded": a,
1726
- "aria-controls": k,
1783
+ "aria-expanded": s,
1784
+ "aria-controls": u,
1727
1785
  "aria-label": p,
1728
- id: m,
1729
- onClick: () => d(g),
1786
+ id: _,
1787
+ onClick: () => l(f),
1730
1788
  children: /* @__PURE__ */ i("div", { className: "agent-view__card-content", children: [
1731
- /* @__PURE__ */ n(dn, { column: s }),
1789
+ /* @__PURE__ */ n(ln, { column: a }),
1732
1790
  /* @__PURE__ */ n("span", { className: "agent-view__card-invocation-name", children: p }),
1733
1791
  /* @__PURE__ */ n("span", { className: "agent-view__card-agent-name", children: t }),
1734
1792
  /* @__PURE__ */ n(
1735
1793
  E,
1736
1794
  {
1737
- name: a ? "chevron-up" : "chevron-down",
1795
+ name: s ? "chevron-up" : "chevron-down",
1738
1796
  size: 16,
1739
1797
  className: "agent-view__card-chevron"
1740
1798
  }
@@ -1742,11 +1800,11 @@ const Jt = (e, t) => (s) => {
1742
1800
  ] })
1743
1801
  }
1744
1802
  ),
1745
- a && /* @__PURE__ */ i(
1803
+ s && /* @__PURE__ */ i(
1746
1804
  "div",
1747
1805
  {
1748
- id: k,
1749
- "aria-labelledby": m,
1806
+ id: u,
1807
+ "aria-labelledby": _,
1750
1808
  className: "agent-view__card-progress",
1751
1809
  children: [
1752
1810
  r && /* @__PURE__ */ i("div", { className: "agent-view__progress-loading", "aria-live": "polite", children: [
@@ -1762,9 +1820,9 @@ const Jt = (e, t) => (s) => {
1762
1820
  ),
1763
1821
  /* @__PURE__ */ n("span", { children: oe })
1764
1822
  ] }),
1765
- !r && c && /* @__PURE__ */ n("p", { className: "agent-view__progress-error", role: "alert", children: c }),
1766
- !r && !c && o !== null && /* @__PURE__ */ n(At, { checklist: o }),
1767
- !r && !c && o === null && /* @__PURE__ */ i("div", { className: "agent-view__progress-loading", "aria-live": "polite", children: [
1823
+ !r && g && /* @__PURE__ */ n("p", { className: "agent-view__progress-error", role: "alert", children: g }),
1824
+ !r && !g && d !== null && /* @__PURE__ */ n(St, { checklist: d }),
1825
+ !r && !g && d === null && /* @__PURE__ */ i("div", { className: "agent-view__progress-loading", "aria-live": "polite", children: [
1768
1826
  /* @__PURE__ */ n(
1769
1827
  E,
1770
1828
  {
@@ -1778,7 +1836,7 @@ const Jt = (e, t) => (s) => {
1778
1836
  /* @__PURE__ */ n("span", { children: oe })
1779
1837
  ] }),
1780
1838
  /* @__PURE__ */ n("div", { className: "agent-view__card-actions", children: /* @__PURE__ */ n(
1781
- X,
1839
+ J,
1782
1840
  {
1783
1841
  variant: "secondary",
1784
1842
  size: "S",
@@ -1795,19 +1853,19 @@ const Jt = (e, t) => (s) => {
1795
1853
  }, Fe = ({
1796
1854
  column: e,
1797
1855
  agents: t,
1798
- expandedAgentId: s,
1799
- loadingAgentId: a,
1856
+ expandedAgentId: a,
1857
+ loadingAgentId: s,
1800
1858
  checklistByInvocationId: r,
1801
- errorByAgentId: o,
1802
- definitionNameByRef: c,
1803
- onToggleAgent: d,
1859
+ errorByAgentId: d,
1860
+ definitionNameByRef: g,
1861
+ onToggleAgent: l,
1804
1862
  onViewAgent: w,
1805
- isSplit: g = !1
1863
+ isSplit: f = !1
1806
1864
  }) => /* @__PURE__ */ i(
1807
1865
  "section",
1808
1866
  {
1809
- className: M("agent-view__column", {
1810
- "agent-view__column--split": g
1867
+ className: H("agent-view__column", {
1868
+ "agent-view__column--split": f
1811
1869
  }),
1812
1870
  "aria-label": e.title,
1813
1871
  children: [
@@ -1816,201 +1874,194 @@ const Jt = (e, t) => (s) => {
1816
1874
  /* @__PURE__ */ n("span", { className: "agent-view__column-count", children: t.length })
1817
1875
  ] }),
1818
1876
  /* @__PURE__ */ n("ul", { className: "agent-view__card-list", children: t.map((p) => /* @__PURE__ */ n(
1819
- gn,
1877
+ dn,
1820
1878
  {
1821
1879
  agent: p,
1822
- agentName: Ce(p, c),
1880
+ agentName: Ie(p, g),
1823
1881
  column: e,
1824
- isExpanded: s === p.id,
1825
- isLoading: a === p.id,
1882
+ isExpanded: a === p.id,
1883
+ isLoading: s === p.id,
1826
1884
  checklist: r[p.invocation_id] ?? null,
1827
- error: o[p.id] ?? null,
1828
- onToggle: d,
1885
+ error: d[p.id] ?? null,
1886
+ onToggle: l,
1829
1887
  onViewAgent: w
1830
1888
  },
1831
1889
  p.id
1832
1890
  )) })
1833
1891
  ]
1834
1892
  }
1835
- ), Ce = (e, t) => t.get(e.agent_definition_ref) ?? e.agent_definition_ref.replace(/_/g, " "), wn = ({
1893
+ ), Ie = (e, t) => t.get(e.agent_definition_ref) ?? e.agent_definition_ref.replace(/_/g, " "), vn = ({
1836
1894
  jwt: e,
1837
1895
  headers: t,
1838
- baseUrl: s,
1839
1896
  agentDefinitionsUrl: a,
1840
- agentsUrl: r,
1841
- agentUrl: o,
1842
- agentChecklistUrl: c,
1843
- agentResourcesUrl: d,
1844
- agentChatUrl: w,
1845
- institutions: g
1897
+ agentsUrl: s,
1898
+ agentUrl: r,
1899
+ agentChecklistUrl: d,
1900
+ agentResourcesUrl: g,
1901
+ agentChatUrl: l,
1902
+ enableUpload: w,
1903
+ institutions: f
1846
1904
  }) => {
1847
- var Ie;
1905
+ var fe;
1848
1906
  const p = U(
1849
1907
  () => ({
1850
- baseUrl: s,
1851
- ...a ? { agentDefinitions: a } : {},
1852
- ...r ? { agents: r } : {},
1853
- ...o ? { agent: o } : {},
1854
- ...c ? { agentChecklist: c } : {},
1855
- ...d ? { agentResources: d } : {},
1856
- ...w ? { agentChat: w } : {}
1908
+ agentDefinitions: a,
1909
+ agents: s,
1910
+ agent: r,
1911
+ agentChecklist: d,
1912
+ agentResources: g,
1913
+ agentChat: l
1857
1914
  }),
1858
1915
  [
1859
- s,
1860
1916
  a,
1917
+ s,
1861
1918
  r,
1862
- o,
1863
- c,
1864
1919
  d,
1865
- w
1920
+ g,
1921
+ l
1866
1922
  ]
1867
- ), [m, k] = _(null), x = m ? (Ie = g == null ? void 0 : g.find(
1868
- (l) => l.applicationId === m.application_id
1869
- )) == null ? void 0 : Ie.applicationUrl : void 0, P = U(() => {
1870
- const l = { ...t ?? {} };
1871
- return x ? l[ie.arborApplicationUrl] = x : delete l[ie.arborApplicationUrl], l;
1872
- }, [t, x]), {
1873
- agents: N,
1874
- agentDefinitions: D,
1875
- loadState: S,
1876
- loadError: H,
1877
- reload: q,
1878
- fetchAgentChecklist: z,
1879
- fetchAgentResources: ce,
1880
- createAgent: ae,
1881
- chatConnector: ee
1882
- } = on({ jwt: e, headers: P, urls: p }), [y, C] = _(!1), [$, K] = _(null), [J, W] = _(null), [L, le] = _({}), [Ne, te] = _({}), [j, ye] = _([]), [V, Ae] = _([]), Y = U(() => {
1883
- const l = new Set(N.map((h) => h.application_id)), f = new Map(
1884
- (g ?? []).map((h) => [h.applicationId, h.name])
1923
+ ), [_, u] = m(null), C = _ ? (fe = f == null ? void 0 : f.find(
1924
+ (o) => o.applicationId === _.application_id
1925
+ )) == null ? void 0 : fe.applicationUrl : void 0, R = U(() => {
1926
+ const o = { ...t ?? {} };
1927
+ return C ? o[ie.arborApplicationUrl] = C : delete o[ie.arborApplicationUrl], o;
1928
+ }, [t, C]), {
1929
+ agents: y,
1930
+ agentDefinitions: A,
1931
+ loadState: k,
1932
+ loadError: $,
1933
+ reload: V,
1934
+ fetchAgentChecklist: M,
1935
+ createAgent: ee
1936
+ } = Zt({ jwt: e, headers: R, urls: p }), [te, Y] = m(!1), [N, I] = m(null), [D, Q] = m(null), [P, B] = m({}), [q, ce] = m({}), [X, ke] = m([]), [z, ye] = m([]), le = U(() => {
1937
+ const o = new Set(y.map((h) => h.application_id)), c = new Map(
1938
+ (f ?? []).map((h) => [h.applicationId, h.name])
1885
1939
  );
1886
- return [...l].sort(
1887
- (h, F) => (f.get(h) ?? h).localeCompare(f.get(F) ?? F)
1940
+ return [...o].sort(
1941
+ (h, L) => (c.get(h) ?? h).localeCompare(c.get(L) ?? L)
1888
1942
  ).map((h) => ({
1889
1943
  value: h,
1890
- label: f.get(h) ?? h
1944
+ label: c.get(h) ?? h
1891
1945
  }));
1892
- }, [N, g]), ne = U(
1893
- () => new Map(D.map((l) => [l.ref, l.display_name])),
1894
- [D]
1895
- ), _e = U(() => [...new Set(
1896
- N.map((f) => Ce(f, ne))
1897
- )].sort((f, h) => f.localeCompare(h)).map((f) => ({
1898
- value: f,
1899
- label: f
1900
- })), [N, ne]), me = U(() => N.filter((l) => !(j.length > 0 && !j.includes(l.application_id) || V.length > 0 && !V.includes(Ce(l, ne)))), [N, ne, V, j]), fe = Y.length > 1, ve = _e.length > 1, u = fe || ve;
1901
- B(() => {
1902
- if (N.length === 0)
1946
+ }, [y, f]), Z = U(
1947
+ () => new Map(A.map((o) => [o.ref, o.display_name])),
1948
+ [A]
1949
+ ), de = U(() => [...new Set(
1950
+ y.map((c) => Ie(c, Z))
1951
+ )].sort((c, h) => c.localeCompare(h)).map((c) => ({
1952
+ value: c,
1953
+ label: c
1954
+ })), [y, Z]), _e = U(() => y.filter((o) => !(X.length > 0 && !X.includes(o.application_id) || z.length > 0 && !z.includes(Ie(o, Z)))), [y, Z, z, X]), ne = le.length > 1, ae = de.length > 1, Ne = ne || ae;
1955
+ G(() => {
1956
+ if (y.length === 0)
1903
1957
  return;
1904
- let l = !1;
1958
+ let o = !1;
1905
1959
  return (async () => {
1906
- const f = await Promise.allSettled(
1907
- N.map(async (h) => {
1908
- const F = await z(h.invocation_id);
1960
+ const c = await Promise.allSettled(
1961
+ y.map(async (h) => {
1962
+ const L = await M(h.invocation_id);
1909
1963
  return {
1910
1964
  agentId: h.id,
1911
1965
  invocationId: h.invocation_id,
1912
- checklist: F.checklist
1966
+ checklist: L.checklist
1913
1967
  };
1914
1968
  })
1915
1969
  );
1916
- l || (le((h) => {
1917
- const F = { ...h };
1918
- for (const ge of f)
1919
- ge.status === "fulfilled" && (F[ge.value.invocationId] = ge.value.checklist);
1920
- return F;
1921
- }), te((h) => {
1922
- const F = { ...h };
1923
- return f.forEach((ge, Qe) => {
1924
- ge.status === "rejected" && (F[N[Qe].id] = be);
1925
- }), F;
1970
+ o || (B((h) => {
1971
+ const L = { ...h };
1972
+ for (const ge of c)
1973
+ ge.status === "fulfilled" && (L[ge.value.invocationId] = ge.value.checklist);
1974
+ return L;
1975
+ }), ce((h) => {
1976
+ const L = { ...h };
1977
+ return c.forEach((ge, Ze) => {
1978
+ ge.status === "rejected" && (L[y[Ze].id] = Ee);
1979
+ }), L;
1926
1980
  }));
1927
1981
  })(), () => {
1928
- l = !0;
1982
+ o = !0;
1929
1983
  };
1930
- }, [N, z]);
1931
- const A = I(
1932
- async (l) => {
1933
- if (!L[l.invocation_id]) {
1934
- W(l.id), te((f) => {
1935
- const h = { ...f };
1936
- return delete h[l.id], h;
1984
+ }, [y, M]);
1985
+ const se = T(
1986
+ async (o) => {
1987
+ if (!P[o.invocation_id]) {
1988
+ Q(o.id), ce((c) => {
1989
+ const h = { ...c };
1990
+ return delete h[o.id], h;
1937
1991
  });
1938
1992
  try {
1939
- const f = await z(l.invocation_id);
1940
- le((h) => ({
1993
+ const c = await M(o.invocation_id);
1994
+ B((h) => ({
1941
1995
  ...h,
1942
- [l.invocation_id]: f.checklist
1996
+ [o.invocation_id]: c.checklist
1943
1997
  }));
1944
1998
  } catch {
1945
- te((f) => ({
1946
- ...f,
1947
- [l.id]: be
1999
+ ce((c) => ({
2000
+ ...c,
2001
+ [o.id]: Ee
1948
2002
  }));
1949
2003
  } finally {
1950
- W((f) => f === l.id ? null : f);
2004
+ Q((c) => c === o.id ? null : c);
1951
2005
  }
1952
2006
  }
1953
2007
  },
1954
- [z, L]
1955
- ), se = I(
1956
- (l) => {
1957
- if ($ === l) {
1958
- K(null);
2008
+ [M, P]
2009
+ ), Ae = T(
2010
+ (o) => {
2011
+ if (N === o) {
2012
+ I(null);
1959
2013
  return;
1960
2014
  }
1961
- const f = N.find(({ id: h }) => h === l);
1962
- f && (K(l), A(f));
2015
+ const c = y.find(({ id: h }) => h === o);
2016
+ c && (I(o), se(c));
1963
2017
  },
1964
- [N, $, A]
1965
- ), de = U(() => {
1966
- const l = {};
1967
- for (const f of me) {
1968
- const h = ln(
1969
- f,
1970
- L[f.invocation_id]
2018
+ [y, N, se]
2019
+ ), K = U(() => {
2020
+ const o = {};
2021
+ for (const c of _e) {
2022
+ const h = cn(
2023
+ c,
2024
+ P[c.invocation_id]
1971
2025
  );
1972
- (l[h] ?? (l[h] = [])).push(f);
2026
+ (o[h] ?? (o[h] = [])).push(c);
1973
2027
  }
1974
- return l;
1975
- }, [me, L]), je = I((l) => {
1976
- k(l);
1977
- }, []), Ve = I(
1978
- async (l) => {
1979
- const f = await ae(l);
1980
- k(f), C(!1);
2028
+ return o;
2029
+ }, [_e, P]), Se = T((o) => {
2030
+ u(o);
2031
+ }, []), be = T(
2032
+ async (o) => {
2033
+ const c = await ee(o);
2034
+ u(c), Y(!1);
1981
2035
  },
1982
- [ae]
1983
- ), Ye = I(() => {
1984
- k(null);
1985
- }, []), Te = U(
1986
- () => m ? ee(m) : void 0,
1987
- [ee, m]
1988
- ), Ee = {
1989
- expandedAgentId: $,
1990
- loadingAgentId: J,
1991
- checklistByInvocationId: L,
1992
- errorByAgentId: Ne,
1993
- definitionNameByRef: ne,
1994
- onToggleAgent: se,
1995
- onViewAgent: je
2036
+ [ee]
2037
+ ), Ce = T(() => {
2038
+ u(null);
2039
+ }, []), me = {
2040
+ expandedAgentId: N,
2041
+ loadingAgentId: D,
2042
+ checklistByInvocationId: P,
2043
+ errorByAgentId: q,
2044
+ definitionNameByRef: Z,
2045
+ onToggleAgent: Ae,
2046
+ onViewAgent: Se
1996
2047
  };
1997
2048
  return /* @__PURE__ */ i("div", { className: "agent-view-frontend agent-view", children: [
1998
2049
  /* @__PURE__ */ i("div", { className: "agent-view__header", children: [
1999
2050
  /* @__PURE__ */ n(he, { level: 1, children: "Agents" }),
2000
2051
  /* @__PURE__ */ n(
2001
- X,
2052
+ J,
2002
2053
  {
2003
2054
  variant: "primary",
2004
2055
  size: "S",
2005
2056
  iconLeftName: "sparkles",
2006
2057
  iconLeftScreenReaderText: "Start an agent",
2007
- onClick: () => C(!0),
2058
+ onClick: () => Y(!0),
2008
2059
  children: "Start an agent"
2009
2060
  }
2010
2061
  )
2011
2062
  ] }),
2012
- N.length > 0 && u && /* @__PURE__ */ i("div", { className: "agent-view__filters", children: [
2013
- fe && /* @__PURE__ */ i("div", { className: "agent-view__filter", children: [
2063
+ y.length > 0 && Ne && /* @__PURE__ */ i("div", { className: "agent-view__filters", children: [
2064
+ ne && /* @__PURE__ */ i("div", { className: "agent-view__filter", children: [
2014
2065
  /* @__PURE__ */ n(
2015
2066
  "label",
2016
2067
  {
@@ -2027,16 +2078,16 @@ const Jt = (e, t) => (s) => {
2027
2078
  multiple: !0,
2028
2079
  searchType: "substring",
2029
2080
  placeholder: "All institutions",
2030
- options: Y,
2031
- value: j,
2032
- onValueChange: ye,
2081
+ options: le,
2082
+ value: X,
2083
+ onValueChange: ke,
2033
2084
  showSelectionCountBadge: !0,
2034
2085
  showClearAll: !0,
2035
2086
  clearAllLabel: "Clear institutions"
2036
2087
  }
2037
2088
  )
2038
2089
  ] }),
2039
- ve && /* @__PURE__ */ i("div", { className: "agent-view__filter", children: [
2090
+ ae && /* @__PURE__ */ i("div", { className: "agent-view__filter", children: [
2040
2091
  /* @__PURE__ */ n(
2041
2092
  "label",
2042
2093
  {
@@ -2053,9 +2104,9 @@ const Jt = (e, t) => (s) => {
2053
2104
  multiple: !0,
2054
2105
  searchType: "substring",
2055
2106
  placeholder: "All agents",
2056
- options: _e,
2057
- value: V,
2058
- onValueChange: Ae,
2107
+ options: de,
2108
+ value: z,
2109
+ onValueChange: ye,
2059
2110
  showSelectionCountBadge: !0,
2060
2111
  showClearAll: !0,
2061
2112
  clearAllLabel: "Clear agents"
@@ -2063,7 +2114,7 @@ const Jt = (e, t) => (s) => {
2063
2114
  )
2064
2115
  ] })
2065
2116
  ] }),
2066
- S === "error" ? /* @__PURE__ */ i("div", { className: "agent-view__state agent-view__state--error", role: "alert", children: [
2117
+ k === "error" ? /* @__PURE__ */ i("div", { className: "agent-view__state agent-view__state--error", role: "alert", children: [
2067
2118
  /* @__PURE__ */ n(
2068
2119
  E,
2069
2120
  {
@@ -2072,9 +2123,9 @@ const Jt = (e, t) => (s) => {
2072
2123
  color: "var(--color-semantic-destructive-600)"
2073
2124
  }
2074
2125
  ),
2075
- /* @__PURE__ */ n("p", { className: "agent-view__state-message", children: H ?? ze }),
2076
- /* @__PURE__ */ n(X, { variant: "secondary", size: "S", onClick: q, children: "Try again" })
2077
- ] }) : S === "loading" && N.length === 0 ? /* @__PURE__ */ i("div", { className: "agent-view__state", "aria-live": "polite", children: [
2126
+ /* @__PURE__ */ n("p", { className: "agent-view__state-message", children: $ ?? Ke }),
2127
+ /* @__PURE__ */ n(J, { variant: "secondary", size: "S", onClick: V, children: "Try again" })
2128
+ ] }) : k === "loading" && y.length === 0 ? /* @__PURE__ */ i("div", { className: "agent-view__state", "aria-live": "polite", children: [
2078
2129
  /* @__PURE__ */ n(
2079
2130
  E,
2080
2131
  {
@@ -2086,84 +2137,89 @@ const Jt = (e, t) => (s) => {
2086
2137
  }
2087
2138
  ),
2088
2139
  /* @__PURE__ */ n("p", { className: "agent-view__state-message", children: Pe })
2089
- ] }) : N.length === 0 ? /* @__PURE__ */ n(kt, {}) : /* @__PURE__ */ i("div", { className: "agent-view__board", children: [
2090
- it.map((l) => /* @__PURE__ */ n(
2140
+ ] }) : y.length === 0 ? /* @__PURE__ */ n(yt, {}) : /* @__PURE__ */ i("div", { className: "agent-view__board", children: [
2141
+ ct.map((o) => /* @__PURE__ */ n(
2091
2142
  Fe,
2092
2143
  {
2093
- column: we[l],
2094
- agents: de[l] ?? [],
2095
- ...Ee
2144
+ column: ve[o],
2145
+ agents: K[o] ?? [],
2146
+ ...me
2096
2147
  },
2097
- l
2148
+ o
2098
2149
  )),
2099
- /* @__PURE__ */ n("div", { className: "agent-view__split-column", children: ct.map((l) => /* @__PURE__ */ n(
2150
+ /* @__PURE__ */ n("div", { className: "agent-view__split-column", children: lt.map((o) => /* @__PURE__ */ n(
2100
2151
  Fe,
2101
2152
  {
2102
- column: we[l],
2103
- agents: de[l] ?? [],
2153
+ column: ve[o],
2154
+ agents: K[o] ?? [],
2104
2155
  isSplit: !0,
2105
- ...Ee
2156
+ ...me
2106
2157
  },
2107
- l
2158
+ o
2108
2159
  )) })
2109
2160
  ] }),
2110
- m && Te && /* @__PURE__ */ n(
2111
- Lt,
2161
+ _ && /* @__PURE__ */ n(
2162
+ sn,
2112
2163
  {
2113
- agent: m,
2164
+ agent: _,
2114
2165
  open: !0,
2115
- initialChecklist: L[m.invocation_id] ?? null,
2116
- fetchAgentChecklist: z,
2117
- fetchAgentResources: ce,
2118
- onClose: Ye,
2119
- connector: Te
2166
+ jwt: e,
2167
+ headers: R,
2168
+ agentUrl: r,
2169
+ agentChecklistUrl: d,
2170
+ agentResourcesUrl: g,
2171
+ agentChatUrl: l,
2172
+ enableUpload: w,
2173
+ initialChecklist: P[_.invocation_id] ?? null,
2174
+ onClose: Ce
2120
2175
  },
2121
- m.id
2176
+ _.id
2122
2177
  ),
2123
2178
  /* @__PURE__ */ n(
2124
- Ut,
2179
+ rn,
2125
2180
  {
2126
- open: y,
2127
- onClose: () => C(!1),
2128
- onStart: Ve,
2129
- agentDefinitions: D
2181
+ open: te,
2182
+ onClose: () => Y(!1),
2183
+ onStart: be,
2184
+ agentDefinitions: A
2130
2185
  }
2131
2186
  )
2132
2187
  ] });
2133
- }, kn = (e, t) => {
2134
- const s = Date.now(), a = t.trim() || e.agent_intent;
2188
+ }, wn = (e, t) => {
2189
+ const a = Date.now(), s = t.trim() || e.agent_intent;
2135
2190
  return {
2136
- id: `agent-${s}`,
2137
- invocation_id: `inv-${s}`,
2191
+ id: `agent-${a}`,
2192
+ invocation_id: `inv-${a}`,
2138
2193
  agent_definition_ref: e.ref,
2139
2194
  agent_intent: e.agent_intent,
2140
- invocation_name: a,
2141
- application_id: lt,
2142
- created_by: dt,
2195
+ invocation_name: s,
2196
+ application_id: dt,
2197
+ created_by: gt,
2143
2198
  status: v["generating-a-response"],
2144
2199
  context_ref: null,
2145
2200
  checklist_ref: null
2146
2201
  };
2147
2202
  };
2148
2203
  export {
2149
- wn as AgentMonitorKanban,
2150
- Bt as AgentServiceClient,
2204
+ vn as AgentMonitorKanban,
2205
+ je as AgentServiceClient,
2151
2206
  ue as AgentServiceError,
2152
- Lt as AgentView,
2153
- Wt as HttpChatConnector,
2154
- Ut as NewAgentModal,
2155
- kn as buildAgentFromDefinition,
2156
- Jt as createHttpChatConnectorFactory,
2157
- He as mapApiAgent,
2158
- Yt as mapApiAgentDefinition,
2159
- jt as mapApiAgentStatus,
2160
- nn as mapApiChecklistEndpointResponse,
2161
- Je as mapApiChecklistItem,
2162
- vn as mapApiChecklistResponse,
2163
- Vt as mapApiChecklistStatus,
2164
- ke as mapApiOpeningMessage,
2165
- Zt as mapApiResource,
2166
- en as mapApiResourcesEndpointResponse,
2167
- fn as mapApiTripOption,
2168
- on as useAgentService
2207
+ sn as AgentView,
2208
+ Bt as HttpChatConnector,
2209
+ rn as NewAgentModal,
2210
+ wn as buildAgentFromDefinition,
2211
+ Ve as createHttpChatConnectorFactory,
2212
+ De as mapApiAgent,
2213
+ Kt as mapApiAgentDefinition,
2214
+ qt as mapApiAgentStatus,
2215
+ Xe as mapApiChecklistEndpointResponse,
2216
+ Qe as mapApiChecklistItem,
2217
+ fn as mapApiChecklistResponse,
2218
+ zt as mapApiChecklistStatus,
2219
+ we as mapApiOpeningMessage,
2220
+ jt as mapApiResource,
2221
+ Ye as mapApiResourcesEndpointResponse,
2222
+ mn as mapApiTripOption,
2223
+ Zt as useAgentService,
2224
+ tn as useAgentWorkspace
2169
2225
  };