@burdenoff/microfe-botmanor 2026.1117.2 → 2026.1118.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (78) hide show
  1. package/dist/botlit/BotlitRoutes.js +59 -55
  2. package/dist/botlit/BotlitRoutes.js.map +1 -1
  3. package/dist/botlit/components/AgentA2APanel.d.ts +13 -0
  4. package/dist/botlit/components/AgentA2APanel.js +149 -0
  5. package/dist/botlit/components/AgentA2APanel.js.map +1 -0
  6. package/dist/botlit/components/BotAgentsPanel.d.ts +15 -0
  7. package/dist/botlit/components/BotAgentsPanel.js +341 -0
  8. package/dist/botlit/components/BotAgentsPanel.js.map +1 -0
  9. package/dist/botlit/components/BotFormFields.d.ts +4 -0
  10. package/dist/botlit/components/BotFormFields.js +108 -74
  11. package/dist/botlit/components/BotFormFields.js.map +1 -1
  12. package/dist/botlit/components/BotRoutingSummary.d.ts +13 -0
  13. package/dist/botlit/components/BotRoutingSummary.js +126 -0
  14. package/dist/botlit/components/BotRoutingSummary.js.map +1 -0
  15. package/dist/botlit/components/BotVersionHistoryPanel.d.ts +8 -0
  16. package/dist/botlit/components/BotVersionHistoryPanel.js +172 -0
  17. package/dist/botlit/components/BotVersionHistoryPanel.js.map +1 -0
  18. package/dist/botlit/components/CreateFromTemplate.d.ts +12 -0
  19. package/dist/botlit/components/CreateFromTemplate.js +129 -0
  20. package/dist/botlit/components/CreateFromTemplate.js.map +1 -0
  21. package/dist/botlit/components/EntityTags.d.ts +24 -0
  22. package/dist/botlit/components/EntityTags.js +72 -0
  23. package/dist/botlit/components/EntityTags.js.map +1 -0
  24. package/dist/botlit/components/GuardrailPoliciesPanel.d.ts +10 -0
  25. package/dist/botlit/components/GuardrailPoliciesPanel.js +91 -0
  26. package/dist/botlit/components/GuardrailPoliciesPanel.js.map +1 -0
  27. package/dist/botlit/hooks/useA2AConnections.d.ts +21 -0
  28. package/dist/botlit/hooks/useA2AConnections.js +82 -0
  29. package/dist/botlit/hooks/useA2AConnections.js.map +1 -0
  30. package/dist/botlit/hooks/useAgentTestChat.d.ts +29 -0
  31. package/dist/botlit/hooks/useAgentTestChat.js +35 -0
  32. package/dist/botlit/hooks/useAgentTestChat.js.map +1 -0
  33. package/dist/botlit/hooks/useAgents.d.ts +3 -0
  34. package/dist/botlit/hooks/useAgents.js +4 -0
  35. package/dist/botlit/hooks/useAgents.js.map +1 -1
  36. package/dist/botlit/hooks/useBotAgents.d.ts +22 -1
  37. package/dist/botlit/hooks/useBotAgents.js +46 -12
  38. package/dist/botlit/hooks/useBotAgents.js.map +1 -1
  39. package/dist/botlit/hooks/useBotVersions.d.ts +25 -0
  40. package/dist/botlit/hooks/useBotVersions.js +69 -0
  41. package/dist/botlit/hooks/useBotVersions.js.map +1 -0
  42. package/dist/botlit/hooks/useBots.d.ts +3 -0
  43. package/dist/botlit/hooks/useBots.js +4 -0
  44. package/dist/botlit/hooks/useBots.js.map +1 -1
  45. package/dist/botlit/hooks/useLLMProviders.js +40 -32
  46. package/dist/botlit/hooks/useLLMProviders.js.map +1 -1
  47. package/dist/botlit/hooks/useTemplates.d.ts +19 -0
  48. package/dist/botlit/hooks/useTemplates.js +71 -0
  49. package/dist/botlit/hooks/useTemplates.js.map +1 -0
  50. package/dist/botlit/pages/AgentBuilderPage.js +388 -347
  51. package/dist/botlit/pages/AgentBuilderPage.js.map +1 -1
  52. package/dist/botlit/pages/AgentDetailPage.js +237 -247
  53. package/dist/botlit/pages/AgentDetailPage.js.map +1 -1
  54. package/dist/botlit/pages/AgentTestChatPage.d.ts +2 -0
  55. package/dist/botlit/pages/AgentTestChatPage.js +176 -0
  56. package/dist/botlit/pages/AgentTestChatPage.js.map +1 -0
  57. package/dist/botlit/pages/AgentsListPage.js +2 -2
  58. package/dist/botlit/pages/AgentsListPage.js.map +1 -1
  59. package/dist/botlit/pages/BotDetailPage.js +398 -447
  60. package/dist/botlit/pages/BotDetailPage.js.map +1 -1
  61. package/dist/botlit/pages/ChatPage.js +19 -12
  62. package/dist/botlit/pages/ChatPage.js.map +1 -1
  63. package/dist/botlit/pages/PolicyDetailPage.js +605 -293
  64. package/dist/botlit/pages/PolicyDetailPage.js.map +1 -1
  65. package/dist/botlit/pages/SettingsPage.d.ts +7 -0
  66. package/dist/botlit/pages/SettingsPage.js +120 -85
  67. package/dist/botlit/pages/SettingsPage.js.map +1 -1
  68. package/dist/botlit/pages/index.d.ts +1 -0
  69. package/dist/botlit/types/index.d.ts +39 -5
  70. package/dist/botlit/utils/botRouting.d.ts +42 -0
  71. package/dist/botlit/utils/botRouting.js +52 -0
  72. package/dist/botlit/utils/botRouting.js.map +1 -0
  73. package/dist/botlit/utils/policyConfig.d.ts +34 -1
  74. package/dist/botlit/utils/policyConfig.js +172 -55
  75. package/dist/botlit/utils/policyConfig.js.map +1 -1
  76. package/dist/generated/wspace-operations.js +41 -43
  77. package/dist/generated/wspace-operations.js.map +1 -1
  78. package/package.json +1 -1
@@ -1,14 +1,14 @@
1
1
  import { useTr as e } from "../../shared/hooks/useTr.js";
2
2
  import { PageLayout as t } from "../components/PageLayout.js";
3
3
  import { AiOperationsPanel as ee } from "../components/AiOperationsPanel.js";
4
- import { Card as n, CardContent as r, CardDescription as i, CardHeader as a, CardTitle as o } from "../components/Card.js";
5
- import { Button as s } from "../components/Button.js";
6
- import { Badge as c, StatusBadge as l } from "../components/Badge.js";
7
- import { BOTMANOR_PERMISSIONS as u } from "../permissions/botmanorPermissions.js";
8
- import { BotmanorPermissionGate as d, useBotmanorCan as te } from "../permissions/useBotmanorPermissions.js";
4
+ import { Card as n, CardContent as r, CardHeader as i, CardTitle as a } from "../components/Card.js";
5
+ import { Button as o } from "../components/Button.js";
6
+ import { Badge as s, StatusBadge as c } from "../components/Badge.js";
7
+ import { BOTMANOR_PERMISSIONS as l } from "../permissions/botmanorPermissions.js";
8
+ import { BotmanorPermissionGate as u, useBotmanorCan as te } from "../permissions/useBotmanorPermissions.js";
9
9
  import { EmptyState as ne } from "../components/EmptyState.js";
10
10
  import { ErrorState as re } from "../components/ErrorState.js";
11
- import { BotFormFields as f, DEFAULT_BOT_FORM as p, ROUTING_STRATEGIES as m } from "../components/BotFormFields.js";
11
+ import { BOT_VISIBILITIES as d, BotFormFields as f, DEFAULT_BOT_FORM as p, ROUTING_STRATEGIES as m } from "../components/BotFormFields.js";
12
12
  import { useBot as ie, useCreateBot as ae, useDeleteBot as oe, useUpdateBot as se } from "../hooks/useBots.js";
13
13
  import { useAgents as ce } from "../hooks/useAgents.js";
14
14
  import { QuotaExhaustedDialog as le } from "../components/QuotaExhaustedDialog.js";
@@ -17,57 +17,64 @@ import { formatNumber as de, formatRelativeTime as fe } from "../utils/formatter
17
17
  import { cn as pe } from "../utils/cn.js";
18
18
  import { toUnion as h } from "../utils/unions.js";
19
19
  import { confirmAction as g } from "../utils/confirmAction.js";
20
- import { slugify as _, validateBotIdentity as me } from "../utils/botIdentity.js";
21
- import { registerBreadcrumbName as he, unregisterBreadcrumbName as ge } from "../utils/breadcrumb.js";
22
- import { BotChannelsTab as _e } from "./BotChannelsTab.js";
20
+ import { slugify as me, validateBotIdentity as he } from "../utils/botIdentity.js";
21
+ import { registerBreadcrumbName as ge, unregisterBreadcrumbName as _e } from "../utils/breadcrumb.js";
22
+ import { BotChannelsTab as ve } from "./BotChannelsTab.js";
23
+ import { BotAgentsPanel as ye } from "../components/BotAgentsPanel.js";
24
+ import { BotRoutingSummary as be } from "../components/BotRoutingSummary.js";
25
+ import { BotVersionHistoryPanel as xe } from "../components/BotVersionHistoryPanel.js";
26
+ import { GuardrailPoliciesPanel as Se } from "../components/GuardrailPoliciesPanel.js";
27
+ import { CreateFromTemplate as Ce } from "../components/CreateFromTemplate.js";
28
+ import { EntityTags as we } from "../components/EntityTags.js";
23
29
  import "../permissions/index.js";
24
- import { Suspense as ve, lazy as v, useEffect as y, useState as b } from "react";
25
- import { GlassCard as ye, NextSteps as be, PagePurpose as xe } from "@burdenoff/fe-libs/ui";
26
- import { Fragment as x, jsx as S, jsxs as C } from "react/jsx-runtime";
27
- import { Link as Se, useParams as Ce, useSearchParams as we } from "react-router";
28
- import { isQuotaExhaustedError as Te } from "@burdenoff/fe-libs/shared/utils";
29
- import { ArrowLeft as w, BarChart3 as Ee, Bot as T, Edit as De, GitBranch as Oe, Layers as E, MessageSquare as D, Radio as O, Save as k, Shield as A, ShieldCheck as ke, Trash2 as Ae, Workflow as j } from "lucide-react";
30
- import { toast as M } from "sonner";
30
+ import { Suspense as Te, lazy as _, useEffect as v, useState as y } from "react";
31
+ import { GlassCard as Ee, NextSteps as De, PagePurpose as Oe } from "@burdenoff/fe-libs/ui";
32
+ import { Fragment as b, jsx as x, jsxs as S } from "react/jsx-runtime";
33
+ import { Link as ke, useParams as Ae, useSearchParams as je } from "react-router";
34
+ import { isQuotaExhaustedError as Me } from "@burdenoff/fe-libs/shared/utils";
35
+ import { ArrowLeft as C, BarChart3 as Ne, Bot as w, Edit as Pe, GitBranch as Fe, Layers as Ie, MessageSquare as T, Radio as E, Save as D, Shield as O, ShieldCheck as Le, Trash2 as Re, Workflow as k } from "lucide-react";
36
+ import { toast as A } from "sonner";
31
37
  // src/botlit/pages/BotDetailPage.tsx
32
- var je = v(() => import("./BotWorkflowTab.js").then((e) => ({ default: e.BotWorkflowTab }))), N = {
38
+ var ze = _(() => import("./BotWorkflowTab.js").then((e) => ({ default: e.BotWorkflowTab }))), j = {
33
39
  key: "activate",
34
40
  target: "ACTIVE",
35
41
  variant: "default",
36
42
  confirm: !1
37
- }, P = {
43
+ }, M = {
38
44
  key: "resume",
39
45
  target: "ACTIVE",
40
46
  variant: "default",
41
47
  confirm: !1
42
- }, F = {
48
+ }, N = {
43
49
  key: "pause",
44
50
  target: "PAUSED",
45
51
  variant: "outline",
46
52
  confirm: !0
47
- }, I = {
53
+ }, P = {
48
54
  key: "archive",
49
55
  target: "ARCHIVED",
50
56
  variant: "outline",
51
57
  confirm: !0
52
- }, Me = {
53
- DRAFT: [N, I],
54
- ACTIVE: [F, I],
55
- PAUSED: [P, I],
56
- ARCHIVED: [N]
57
- }, Ne = "ASSISTANT";
58
- function Pe(e) {
58
+ }, Be = {
59
+ DRAFT: [j, P],
60
+ ACTIVE: [N, P],
61
+ PAUSED: [M, P],
62
+ ARCHIVED: [j]
63
+ }, Ve = "ASSISTANT";
64
+ function He(e) {
59
65
  return {
60
66
  name: e.name,
61
67
  slug: e.slug,
62
68
  description: e.description ?? "",
63
69
  icon: e.icon || p.icon,
64
70
  routingStrategy: h(e.routingStrategy, m, "SINGLE"),
71
+ visibility: h(e.visibility, d, "PRIVATE"),
65
72
  welcomeMessage: e.welcomeMessage ?? "",
66
73
  fallbackMessage: e.fallbackMessage ?? "",
67
74
  defaultAgentId: e.defaultAgentId ?? ""
68
75
  };
69
76
  }
70
- var L = [
77
+ var F = [
71
78
  "overview",
72
79
  "workflow",
73
80
  "routing",
@@ -77,688 +84,632 @@ var L = [
77
84
  "aiOperations",
78
85
  "releases"
79
86
  ];
80
- function Fe(e) {
87
+ function Ue(e) {
81
88
  if (e.get("code") && e.get("state")) return "channels";
82
89
  let t = e.get("tab");
83
- return L.find((e) => e === t) ?? "overview";
90
+ return F.find((e) => e === t) ?? "overview";
84
91
  }
85
- var R = ({ isNew: m, isEditing: h }) => {
86
- let v = e(), { botId: N } = Ce(), [P] = we(), F = te(), { navigateTo: I, getPath: L, workspaceId: R, navigate: z } = ue(), { data: B, loading: Ie, error: Le, refetch: V } = ie(m ? void 0 : N), { data: H } = ce(), [Re, ze] = ae(), [U, Be] = se(), [Ve, He] = oe(), [W, G] = b(() => Fe(P)), [K, q] = b(p), [Ue, We] = b(p), [Ge, Ke] = b(!1), [qe, J] = b(!1), [Je, Ye] = b(!1), Y = me(K.name, K.slug), Xe = Object.keys(Y).length > 0, X = !qe && JSON.stringify(K) !== JSON.stringify(Ue), Ze = !!(m || h), Qe = () => {
87
- z ? z("/billing") : window.location.assign("/billing");
92
+ var I = ({ isNew: d, isEditing: m }) => {
93
+ let h = e(), { botId: _ } = Ae(), [j] = je(), M = te(), { navigateTo: N, getPath: P, workspaceId: F, navigate: I } = ue(), { data: L, loading: We, error: R, refetch: z } = ie(d ? void 0 : _), { data: Ge } = ce(), [Ke, qe] = ae(), [B, Je] = se(), [Ye, Xe] = oe(), [V, H] = y(() => Ue(j)), [U, W] = y(p), [Ze, Qe] = y(p), [G, $e] = y(!1), [et, K] = y(!1), [tt, q] = y(!1), J = he(U.name, U.slug), nt = Object.keys(J).length > 0, Y = !et && JSON.stringify(U) !== JSON.stringify(Ze), rt = !!(d || m), it = () => {
94
+ I ? I("/billing") : window.location.assign("/billing");
88
95
  };
89
- y(() => {
90
- if (B && !m) {
91
- let e = Pe(B);
92
- q(e), We(e);
96
+ v(() => {
97
+ if (L && !d) {
98
+ let e = He(L);
99
+ W(e), Qe(e);
93
100
  }
94
- }, [B, m]), y(() => {
95
- if (N && B?.name) return he(N, B.name), () => ge(N);
96
- }, [N, B?.name]), y(() => {
97
- if (!Ze || !X) return;
101
+ }, [L, d]), v(() => {
102
+ if (_ && L?.name) return ge(_, L.name), () => _e(_);
103
+ }, [_, L?.name]), v(() => {
104
+ if (!rt || !Y) return;
98
105
  let e = (e) => {
99
106
  e.preventDefault(), e.returnValue = "";
100
107
  };
101
108
  return window.addEventListener("beforeunload", e), () => window.removeEventListener("beforeunload", e);
102
- }, [Ze, X]);
103
- let Z = async (e) => {
104
- (!X || await g({
105
- title: v("botlit.botDetail.discard.title", "Discard changes?"),
106
- message: v("botlit.botDetail.discard.message", "You have unsaved changes. If you leave now they will be lost."),
107
- confirmLabel: v("botlit.botDetail.discard.confirm", "Discard"),
108
- cancelLabel: v("botlit.botDetail.discard.keepEditing", "Keep editing")
109
- })) && (J(!0), I(e));
110
- }, $e = async () => {
111
- if (Ke(!0), Xe || !R) return;
112
- let e = K.name.trim();
109
+ }, [rt, Y]);
110
+ let X = async (e) => {
111
+ (!Y || await g({
112
+ title: h("botlit.botDetail.discard.title", "Discard changes?"),
113
+ message: h("botlit.botDetail.discard.message", "You have unsaved changes. If you leave now they will be lost."),
114
+ confirmLabel: h("botlit.botDetail.discard.confirm", "Discard"),
115
+ cancelLabel: h("botlit.botDetail.discard.keepEditing", "Keep editing")
116
+ })) && (K(!0), N(e));
117
+ }, at = async () => {
118
+ if ($e(!0), nt || !F) return;
119
+ let e = U.name.trim();
113
120
  try {
114
- let t = await Re({
115
- workspaceId: R,
121
+ let t = await Ke({
122
+ workspaceId: F,
116
123
  name: e,
117
- slug: K.slug.trim() || _(e),
118
- type: Ne,
119
- routingStrategy: K.routingStrategy,
120
- description: K.description || void 0,
121
- icon: K.icon || void 0
124
+ slug: U.slug.trim() || me(e),
125
+ type: Ve,
126
+ routingStrategy: U.routingStrategy,
127
+ visibility: U.visibility,
128
+ description: U.description || void 0,
129
+ icon: U.icon || void 0
122
130
  });
123
- J(!0), M.success(v("botlit.botDetail.create.success", "Bot \"{{name}}\" created successfully", { name: e })), t?.id && I(`bots/${t.id}?tab=workflow`);
131
+ K(!0), A.success(h("botlit.botDetail.create.success", "Bot \"{{name}}\" created successfully", { name: e })), t?.id && N(`bots/${t.id}?tab=workflow`);
124
132
  } catch (e) {
125
- if (Te(e)) {
126
- Ye(!0);
133
+ if (Me(e)) {
134
+ q(!0);
127
135
  return;
128
136
  }
129
- let t = e instanceof Error ? e.message : v("botlit.botDetail.create.error", "Failed to create bot");
130
- M.error(t);
137
+ let t = e instanceof Error ? e.message : h("botlit.botDetail.create.error", "Failed to create bot");
138
+ A.error(t);
131
139
  }
132
- }, et = async () => {
133
- if (Ke(!0), !N || Xe) return;
134
- let e = K.name.trim();
140
+ }, ot = async () => {
141
+ if ($e(!0), !_ || nt) return;
142
+ let e = U.name.trim();
135
143
  try {
136
- await U({
137
- botId: N,
144
+ await B({
145
+ botId: _,
138
146
  input: {
139
147
  name: e,
140
- slug: K.slug.trim() || _(e),
141
- description: K.description || null,
142
- icon: K.icon || null,
143
- routingStrategy: K.routingStrategy,
144
- welcomeMessage: K.welcomeMessage || null,
145
- fallbackMessage: K.fallbackMessage || null,
146
- defaultAgentId: K.defaultAgentId || null
148
+ slug: U.slug.trim() || me(e),
149
+ description: U.description || null,
150
+ icon: U.icon || null,
151
+ routingStrategy: U.routingStrategy,
152
+ visibility: U.visibility,
153
+ welcomeMessage: U.welcomeMessage || null,
154
+ fallbackMessage: U.fallbackMessage || null,
155
+ defaultAgentId: U.defaultAgentId || null
147
156
  }
148
- }), J(!0), await V(), M.success(v("botlit.botDetail.update.success", "Bot \"{{name}}\" updated successfully", { name: e })), h && I(`bots/${N}`);
157
+ }), K(!0), await z(), A.success(h("botlit.botDetail.update.success", "Bot \"{{name}}\" updated successfully", { name: e })), m && N(`bots/${_}`);
149
158
  } catch (e) {
150
- let t = e instanceof Error ? e.message : v("botlit.botDetail.update.error", "Failed to update bot");
151
- M.error(t);
159
+ let t = e instanceof Error ? e.message : h("botlit.botDetail.update.error", "Failed to update bot");
160
+ A.error(t);
152
161
  }
153
162
  };
154
- if (m) {
155
- let e = R ? null : v("botlit.botDetail.createPage.waitingWorkspace", "Waiting for your workspace to load…");
156
- return /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(t, {
157
- title: v("botlit.botDetail.createPage.title", "Create New Bot"),
158
- description: v("botlit.botDetail.createPage.description", "Set up a new AI-powered bot"),
159
- actions: /* @__PURE__ */ C("div", {
163
+ if (d) {
164
+ let e = F ? null : h("botlit.botDetail.createPage.waitingWorkspace", "Waiting for your workspace to load…");
165
+ return /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x(t, {
166
+ title: h("botlit.botDetail.createPage.title", "Create New Bot"),
167
+ description: h("botlit.botDetail.createPage.description", "Set up a new AI-powered bot"),
168
+ actions: /* @__PURE__ */ S("div", {
160
169
  className: "flex gap-2",
161
- children: [/* @__PURE__ */ S(s, {
170
+ children: [/* @__PURE__ */ x(o, {
162
171
  variant: "outline",
163
172
  type: "button",
164
- onClick: () => void Z("bots"),
165
- children: v("botlit.common.cancel", "Cancel")
166
- }), /* @__PURE__ */ S(s, {
173
+ onClick: () => void X("bots"),
174
+ children: h("botlit.common.cancel", "Cancel")
175
+ }), /* @__PURE__ */ x(o, {
167
176
  type: "submit",
168
177
  form: "bot-create-form",
169
- leftIcon: /* @__PURE__ */ S(k, { size: 16 }),
170
- isLoading: ze.loading,
178
+ leftIcon: /* @__PURE__ */ x(D, { size: 16 }),
179
+ isLoading: qe.loading,
171
180
  disabled: !!e,
172
181
  "aria-describedby": e ? "bot-create-blocked" : void 0,
173
- children: v("botlit.botDetail.createPage.actions.createBot", "Create Bot")
182
+ children: h("botlit.botDetail.createPage.actions.createBot", "Create Bot")
174
183
  })]
175
184
  }),
176
- children: /* @__PURE__ */ S(n, {
177
- className: "max-w-2xl",
178
- children: /* @__PURE__ */ S(r, {
179
- className: "pt-6",
180
- children: /* @__PURE__ */ C("form", {
181
- id: "bot-create-form",
182
- noValidate: !0,
183
- onSubmit: (e) => {
184
- e.preventDefault(), $e();
185
- },
186
- children: [/* @__PURE__ */ S(f, {
187
- idPrefix: "bot-create",
188
- mode: "create",
189
- value: K,
190
- onChange: q,
191
- errors: Y,
192
- showErrors: Ge
193
- }), e && /* @__PURE__ */ S("p", {
194
- id: "bot-create-blocked",
195
- role: "status",
196
- className: "mt-4 text-sm text-text-secondary",
197
- children: e
198
- })]
185
+ children: /* @__PURE__ */ S("div", {
186
+ className: "space-y-6",
187
+ children: [/* @__PURE__ */ x(Ce, {
188
+ kind: "bot",
189
+ onCreated: (e) => {
190
+ K(!0), N(`bots/${e}`);
191
+ },
192
+ onQuotaExhausted: () => q(!0)
193
+ }), /* @__PURE__ */ x(n, {
194
+ className: "max-w-2xl",
195
+ children: /* @__PURE__ */ x(r, {
196
+ className: "pt-6",
197
+ children: /* @__PURE__ */ S("form", {
198
+ id: "bot-create-form",
199
+ noValidate: !0,
200
+ onSubmit: (e) => {
201
+ e.preventDefault(), at();
202
+ },
203
+ children: [/* @__PURE__ */ x(f, {
204
+ idPrefix: "bot-create",
205
+ mode: "create",
206
+ value: U,
207
+ onChange: W,
208
+ errors: J,
209
+ showErrors: G
210
+ }), e && /* @__PURE__ */ x("p", {
211
+ id: "bot-create-blocked",
212
+ role: "status",
213
+ className: "mt-4 text-sm text-text-secondary",
214
+ children: e
215
+ })]
216
+ })
199
217
  })
200
- })
218
+ })]
201
219
  })
202
- }), /* @__PURE__ */ S(le, {
203
- open: Je,
204
- title: v("botlit.usage.botQuota.title", "Bot Limit Reached"),
205
- description: v("botlit.usage.botQuota.description", "You have reached the number of bots allowed on your current plan."),
206
- onClose: () => Ye(!1),
207
- onViewBilling: Qe
220
+ }), /* @__PURE__ */ x(le, {
221
+ open: tt,
222
+ title: h("botlit.usage.botQuota.title", "Bot Limit Reached"),
223
+ description: h("botlit.usage.botQuota.description", "You have reached the number of bots allowed on your current plan."),
224
+ onClose: () => q(!1),
225
+ onViewBilling: it
208
226
  })] });
209
227
  }
210
- if (Ie) return /* @__PURE__ */ S(t, {
211
- title: v("botlit.common.loading", "Loading..."),
212
- children: /* @__PURE__ */ S("div", {
228
+ if (We) return /* @__PURE__ */ x(t, {
229
+ title: h("botlit.common.loading", "Loading..."),
230
+ children: /* @__PURE__ */ x("div", {
213
231
  role: "status",
214
232
  "aria-busy": "true",
215
- "aria-label": v("botlit.common.loading", "Loading"),
233
+ "aria-label": h("botlit.common.loading", "Loading"),
216
234
  className: "h-96 bg-bg-sunken motion-safe:animate-vc-shimmer rounded-lg"
217
235
  })
218
236
  });
219
- if (Le) return /* @__PURE__ */ S(t, {
220
- title: v("botlit.botDetail.loadError.title", "Bot unavailable"),
221
- children: /* @__PURE__ */ S(re, {
222
- resource: v("botlit.botDetail.resource", "this bot"),
223
- error: Le,
224
- onRetry: () => void V()
237
+ if (R) return /* @__PURE__ */ x(t, {
238
+ title: h("botlit.botDetail.loadError.title", "Bot unavailable"),
239
+ children: /* @__PURE__ */ x(re, {
240
+ resource: h("botlit.botDetail.resource", "this bot"),
241
+ error: R,
242
+ onRetry: () => void z()
225
243
  })
226
244
  });
227
- if (!B) return /* @__PURE__ */ S(t, {
228
- title: v("botlit.botDetail.notFound.title", "Bot Not Found"),
229
- children: /* @__PURE__ */ S(ne, {
245
+ if (!L) return /* @__PURE__ */ x(t, {
246
+ title: h("botlit.botDetail.notFound.title", "Bot Not Found"),
247
+ children: /* @__PURE__ */ x(ne, {
230
248
  illustration: "empty-agents",
231
- title: v("botlit.botDetail.notFound.title", "Bot Not Found"),
232
- description: v("botlit.botDetail.notFound.description", "The bot you're looking for doesn't exist."),
233
- action: /* @__PURE__ */ S(s, {
234
- onClick: () => I("bots"),
235
- children: v("botlit.botDetail.notFound.backAction", "Back to Bots")
249
+ title: h("botlit.botDetail.notFound.title", "Bot Not Found"),
250
+ description: h("botlit.botDetail.notFound.description", "The bot you're looking for doesn't exist."),
251
+ action: /* @__PURE__ */ x(o, {
252
+ onClick: () => N("bots"),
253
+ children: h("botlit.botDetail.notFound.backAction", "Back to Bots")
236
254
  })
237
255
  })
238
256
  });
239
- if (h && B) return /* @__PURE__ */ S(t, {
240
- leading: /* @__PURE__ */ S(s, {
257
+ if (m && L) return /* @__PURE__ */ x(t, {
258
+ leading: /* @__PURE__ */ x(o, {
241
259
  variant: "ghost",
242
260
  size: "icon",
243
261
  type: "button",
244
- "aria-label": v("botlit.common.back", "Back"),
245
- onClick: () => void Z(`bots/${N}`),
246
- children: /* @__PURE__ */ S(w, {
262
+ "aria-label": h("botlit.common.back", "Back"),
263
+ onClick: () => void X(`bots/${_}`),
264
+ children: /* @__PURE__ */ x(C, {
247
265
  size: 20,
248
266
  "aria-hidden": "true"
249
267
  })
250
268
  }),
251
- title: v("botlit.botDetail.editPage.title", "Edit Bot"),
252
- actions: /* @__PURE__ */ C("div", {
269
+ title: h("botlit.botDetail.editPage.title", "Edit Bot"),
270
+ actions: /* @__PURE__ */ S("div", {
253
271
  className: "flex gap-2",
254
- children: [/* @__PURE__ */ S(s, {
272
+ children: [/* @__PURE__ */ x(o, {
255
273
  variant: "outline",
256
274
  type: "button",
257
- onClick: () => void Z(`bots/${N}`),
258
- children: v("botlit.common.cancel", "Cancel")
259
- }), /* @__PURE__ */ S(s, {
275
+ onClick: () => void X(`bots/${_}`),
276
+ children: h("botlit.common.cancel", "Cancel")
277
+ }), /* @__PURE__ */ x(o, {
260
278
  type: "submit",
261
279
  form: "bot-edit-form",
262
- leftIcon: /* @__PURE__ */ S(k, { size: 16 }),
263
- isLoading: Be.loading,
264
- children: v("botlit.botDetail.editPage.actions.saveChanges", "Save Changes")
280
+ leftIcon: /* @__PURE__ */ x(D, { size: 16 }),
281
+ isLoading: Je.loading,
282
+ children: h("botlit.botDetail.editPage.actions.saveChanges", "Save Changes")
265
283
  })]
266
284
  }),
267
- children: /* @__PURE__ */ S(n, {
285
+ children: /* @__PURE__ */ x(n, {
268
286
  className: "max-w-2xl",
269
- children: /* @__PURE__ */ S(r, {
287
+ children: /* @__PURE__ */ x(r, {
270
288
  className: "pt-6",
271
- children: /* @__PURE__ */ S("form", {
289
+ children: /* @__PURE__ */ x("form", {
272
290
  id: "bot-edit-form",
273
291
  noValidate: !0,
274
292
  onSubmit: (e) => {
275
- e.preventDefault(), et();
293
+ e.preventDefault(), ot();
276
294
  },
277
- children: /* @__PURE__ */ S(f, {
295
+ children: /* @__PURE__ */ x(f, {
278
296
  idPrefix: "bot-edit",
279
297
  mode: "edit",
280
- value: K,
281
- onChange: q,
282
- errors: Y,
283
- showErrors: Ge,
284
- agents: H
298
+ value: U,
299
+ onChange: W,
300
+ errors: J,
301
+ showErrors: G,
302
+ agents: Ge
285
303
  })
286
304
  })
287
305
  })
288
306
  })
289
307
  });
290
- let Q = (e, t) => {
308
+ let Z = (e, t) => {
291
309
  switch (e) {
292
310
  case "activate": return {
293
- label: v("botlit.botDetail.actions.activate", "Activate"),
294
- success: v("botlit.botDetail.activate.success", "Bot \"{{name}}\" activated", { name: t }),
295
- error: v("botlit.botDetail.activate.error", "Failed to activate bot")
311
+ label: h("botlit.botDetail.actions.activate", "Activate"),
312
+ success: h("botlit.botDetail.activate.success", "Bot \"{{name}}\" activated", { name: t }),
313
+ error: h("botlit.botDetail.activate.error", "Failed to activate bot")
296
314
  };
297
315
  case "resume": return {
298
- label: v("botlit.botDetail.actions.resume", "Resume"),
299
- success: v("botlit.botDetail.resume.success", "Bot \"{{name}}\" resumed", { name: t }),
300
- error: v("botlit.botDetail.resume.error", "Failed to resume bot")
316
+ label: h("botlit.botDetail.actions.resume", "Resume"),
317
+ success: h("botlit.botDetail.resume.success", "Bot \"{{name}}\" resumed", { name: t }),
318
+ error: h("botlit.botDetail.resume.error", "Failed to resume bot")
301
319
  };
302
320
  case "pause": return {
303
- label: v("botlit.botDetail.actions.pause", "Pause"),
304
- confirmTitle: v("botlit.botDetail.pause.title", "Pause bot?"),
305
- confirmMessage: v("botlit.botDetail.pause.confirm", "Pause \"{{name}}\"? It will stop answering messages on its channels until you resume it.", { name: t }),
306
- success: v("botlit.botDetail.pause.success", "Bot \"{{name}}\" paused", { name: t }),
307
- error: v("botlit.botDetail.pause.error", "Failed to pause bot")
321
+ label: h("botlit.botDetail.actions.pause", "Pause"),
322
+ confirmTitle: h("botlit.botDetail.pause.title", "Pause bot?"),
323
+ confirmMessage: h("botlit.botDetail.pause.confirm", "Pause \"{{name}}\"? It will stop answering messages on its channels until you resume it.", { name: t }),
324
+ success: h("botlit.botDetail.pause.success", "Bot \"{{name}}\" paused", { name: t }),
325
+ error: h("botlit.botDetail.pause.error", "Failed to pause bot")
308
326
  };
309
327
  case "archive": return {
310
- label: v("botlit.botDetail.actions.archive", "Archive"),
311
- confirmTitle: v("botlit.botDetail.archive.title", "Archive bot?"),
312
- confirmMessage: v("botlit.botDetail.archive.confirm", "Archive \"{{name}}\"? It will stop answering messages on its channels. You can activate it again later.", { name: t }),
313
- success: v("botlit.botDetail.archive.success", "Bot \"{{name}}\" archived", { name: t }),
314
- error: v("botlit.botDetail.archive.error", "Failed to archive bot")
328
+ label: h("botlit.botDetail.actions.archive", "Archive"),
329
+ confirmTitle: h("botlit.botDetail.archive.title", "Archive bot?"),
330
+ confirmMessage: h("botlit.botDetail.archive.confirm", "Archive \"{{name}}\"? It will stop answering messages on its channels. You can activate it again later.", { name: t }),
331
+ success: h("botlit.botDetail.archive.success", "Bot \"{{name}}\" archived", { name: t }),
332
+ error: h("botlit.botDetail.archive.error", "Failed to archive bot")
315
333
  };
316
334
  }
317
- }, tt = async (e) => {
318
- if (!N) return;
319
- let t = Q(e.key, B.name);
335
+ }, st = async (e) => {
336
+ if (!_) return;
337
+ let t = Z(e.key, L.name);
320
338
  if (!e.confirm || await g({
321
339
  title: t.confirmTitle ?? t.label,
322
340
  message: t.confirmMessage ?? t.label,
323
341
  confirmLabel: t.label,
324
- cancelLabel: v("botlit.common.cancel", "Cancel")
342
+ cancelLabel: h("botlit.common.cancel", "Cancel")
325
343
  })) try {
326
- await U({
327
- botId: N,
344
+ await B({
345
+ botId: _,
328
346
  input: { status: e.target }
329
- }), await V(), M.success(t.success);
347
+ }), await z(), A.success(t.success);
330
348
  } catch (e) {
331
- M.error(e instanceof Error ? e.message : t.error);
349
+ A.error(e instanceof Error ? e.message : t.error);
332
350
  }
333
- }, nt = [
351
+ }, ct = [
334
352
  {
335
353
  id: "overview",
336
- label: v("botlit.botDetail.tabs.overview", "Overview"),
337
- icon: /* @__PURE__ */ S(Ee, { size: 16 })
354
+ label: h("botlit.botDetail.tabs.overview", "Overview"),
355
+ icon: /* @__PURE__ */ x(Ne, { size: 16 })
338
356
  },
339
357
  {
340
358
  id: "workflow",
341
- label: v("botlit.botDetail.tabs.workflow", "Workflow"),
342
- icon: /* @__PURE__ */ S(j, { size: 16 })
359
+ label: h("botlit.botDetail.tabs.workflow", "Workflow"),
360
+ icon: /* @__PURE__ */ x(k, { size: 16 })
343
361
  },
344
362
  {
345
363
  id: "routing",
346
- label: v("botlit.botDetail.tabs.routing", "Routing"),
347
- icon: /* @__PURE__ */ S(Oe, { size: 16 })
364
+ label: h("botlit.botDetail.tabs.routing", "Routing"),
365
+ icon: /* @__PURE__ */ x(Fe, { size: 16 })
348
366
  },
349
367
  {
350
368
  id: "agents",
351
- label: v("botlit.botDetail.tabs.agents", "Agents"),
352
- icon: /* @__PURE__ */ S(T, { size: 16 })
369
+ label: h("botlit.botDetail.tabs.agents", "Agents"),
370
+ icon: /* @__PURE__ */ x(w, { size: 16 })
353
371
  },
354
372
  {
355
373
  id: "channels",
356
- label: v("botlit.botDetail.tabs.channels", "Channels"),
357
- icon: /* @__PURE__ */ S(O, { size: 16 })
374
+ label: h("botlit.botDetail.tabs.channels", "Channels"),
375
+ icon: /* @__PURE__ */ x(E, { size: 16 })
358
376
  },
359
377
  {
360
378
  id: "guardrails",
361
- label: v("botlit.botDetail.tabs.guardrails", "Guardrails"),
362
- icon: /* @__PURE__ */ S(A, { size: 16 })
379
+ label: h("botlit.botDetail.tabs.guardrails", "Guardrails"),
380
+ icon: /* @__PURE__ */ x(O, { size: 16 })
363
381
  },
364
382
  {
365
383
  id: "aiOperations",
366
- label: v("botlit.botDetail.tabs.aiOperations", "AI Operations"),
367
- icon: /* @__PURE__ */ S(ke, { size: 16 })
384
+ label: h("botlit.botDetail.tabs.aiOperations", "AI Operations"),
385
+ icon: /* @__PURE__ */ x(Le, { size: 16 })
368
386
  },
369
387
  {
370
388
  id: "releases",
371
- label: v("botlit.botDetail.tabs.releases", "Releases"),
372
- icon: /* @__PURE__ */ S(E, { size: 16 })
389
+ label: h("botlit.botDetail.tabs.releases", "Releases"),
390
+ icon: /* @__PURE__ */ x(Ie, { size: 16 })
373
391
  }
374
- ], $ = B.defaultAgentId ? H?.find((e) => e.id === B.defaultAgentId) : null;
375
- return /* @__PURE__ */ S(t, {
376
- leading: /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(s, {
392
+ ], Q = (Ge ?? []).map((e) => ({
393
+ id: e.id,
394
+ name: e.name,
395
+ status: e.status
396
+ })), $ = L.defaultAgentId ? Q.find((e) => e.id === L.defaultAgentId) : void 0;
397
+ return /* @__PURE__ */ x(t, {
398
+ leading: /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x(o, {
377
399
  variant: "ghost",
378
400
  size: "icon",
379
401
  type: "button",
380
- "aria-label": v("botlit.botDetail.backToBots", "Back to Bots"),
381
- onClick: () => I("bots"),
382
- children: /* @__PURE__ */ S(w, {
402
+ "aria-label": h("botlit.botDetail.backToBots", "Back to Bots"),
403
+ onClick: () => N("bots"),
404
+ children: /* @__PURE__ */ x(C, {
383
405
  size: 20,
384
406
  "aria-hidden": "true"
385
407
  })
386
- }), /* @__PURE__ */ S("span", {
408
+ }), /* @__PURE__ */ x("span", {
387
409
  className: "text-3xl",
388
410
  "aria-hidden": "true",
389
- children: B.icon
411
+ children: L.icon
390
412
  })] }),
391
- title: B.name,
392
- meta: /* @__PURE__ */ C(x, { children: [/* @__PURE__ */ S(l, { status: B.status }), /* @__PURE__ */ S(c, {
413
+ title: L.name,
414
+ meta: /* @__PURE__ */ S(b, { children: [/* @__PURE__ */ x(c, { status: L.status }), /* @__PURE__ */ x(s, {
393
415
  variant: "outline",
394
- children: B.slug
416
+ children: L.slug
395
417
  })] }),
396
- description: B.description,
397
- actions: /* @__PURE__ */ C("div", {
418
+ description: L.description,
419
+ actions: /* @__PURE__ */ S("div", {
398
420
  className: "flex gap-2",
399
421
  children: [
400
- /* @__PURE__ */ S(d, {
401
- permission: u.APP_UPDATE,
402
- children: (Me[B.status] ?? []).map((e) => /* @__PURE__ */ S(s, {
422
+ /* @__PURE__ */ x(u, {
423
+ permission: l.APP_UPDATE,
424
+ children: (Be[L.status] ?? []).map((e) => /* @__PURE__ */ x(o, {
403
425
  variant: e.variant,
404
- isLoading: Be.loading,
405
- onClick: () => void tt(e),
406
- children: Q(e.key, B.name).label
426
+ isLoading: Je.loading,
427
+ onClick: () => void st(e),
428
+ children: Z(e.key, L.name).label
407
429
  }, e.key))
408
430
  }),
409
- /* @__PURE__ */ S(d, {
410
- permission: u.APP_UPDATE,
411
- children: /* @__PURE__ */ S(s, {
431
+ /* @__PURE__ */ x(u, {
432
+ permission: l.APP_UPDATE,
433
+ children: /* @__PURE__ */ x(o, {
412
434
  variant: "outline",
413
- leftIcon: /* @__PURE__ */ S(De, { size: 16 }),
414
- onClick: () => I(`bots/${N}/edit`),
415
- children: v("botlit.botDetail.actions.editBot", "Edit Bot")
435
+ leftIcon: /* @__PURE__ */ x(Pe, { size: 16 }),
436
+ onClick: () => N(`bots/${_}/edit`),
437
+ children: h("botlit.botDetail.actions.editBot", "Edit Bot")
416
438
  })
417
439
  }),
418
- /* @__PURE__ */ S(d, {
419
- permission: u.AGENT_EXECUTE,
420
- children: /* @__PURE__ */ S(s, {
440
+ /* @__PURE__ */ x(u, {
441
+ permission: l.AGENT_EXECUTE,
442
+ children: /* @__PURE__ */ x(o, {
421
443
  variant: "outline",
422
- leftIcon: /* @__PURE__ */ S(D, { size: 16 }),
444
+ leftIcon: /* @__PURE__ */ x(T, { size: 16 }),
423
445
  onClick: () => {
424
- let e = B?.defaultAgentId;
425
- I(e ? `chat/${e}` : "chat");
446
+ let e = L?.defaultAgentId;
447
+ N(e ? `agents/${e}/test` : "chat");
426
448
  },
427
- children: v("botlit.botDetail.actions.testBot", "Test Bot")
449
+ children: h("botlit.botDetail.actions.testBot", "Test Bot")
428
450
  })
429
451
  }),
430
- /* @__PURE__ */ S(d, {
431
- permission: u.APP_DELETE,
432
- children: /* @__PURE__ */ S(s, {
452
+ /* @__PURE__ */ x(u, {
453
+ permission: l.APP_DELETE,
454
+ children: /* @__PURE__ */ x(o, {
433
455
  variant: "destructive",
434
- leftIcon: /* @__PURE__ */ S(Ae, { size: 16 }),
435
- isLoading: He.loading,
456
+ leftIcon: /* @__PURE__ */ x(Re, { size: 16 }),
457
+ isLoading: Xe.loading,
436
458
  onClick: async () => {
437
- if (N && await g({
438
- title: v("botlit.botsList.delete.title", "Delete bot?"),
439
- message: v("botlit.botsList.delete.confirm", "Are you sure you want to delete \"{{name}}\"? Its channels will stop answering and this cannot be undone.", { name: B.name }),
440
- confirmLabel: v("botlit.common.delete", "Delete"),
441
- cancelLabel: v("botlit.common.cancel", "Cancel")
459
+ if (_ && await g({
460
+ title: h("botlit.botsList.delete.title", "Delete bot?"),
461
+ message: h("botlit.botsList.delete.confirm", "Are you sure you want to delete \"{{name}}\"? Its channels will stop answering and this cannot be undone.", { name: L.name }),
462
+ confirmLabel: h("botlit.common.delete", "Delete"),
463
+ cancelLabel: h("botlit.common.cancel", "Cancel")
442
464
  })) try {
443
- if (!await Ve(N)) {
444
- M.error(v("botlit.botsList.delete.notDeleted", "The bot could not be deleted."));
465
+ if (!await Ye(_)) {
466
+ A.error(h("botlit.botsList.delete.notDeleted", "The bot could not be deleted."));
445
467
  return;
446
468
  }
447
- M.success(v("botlit.botsList.delete.success", "Bot \"{{name}}\" deleted successfully", { name: B.name })), I("bots");
469
+ A.success(h("botlit.botsList.delete.success", "Bot \"{{name}}\" deleted successfully", { name: L.name })), N("bots");
448
470
  } catch (e) {
449
- M.error(e instanceof Error ? e.message : v("botlit.botDetail.delete.error", "Failed to delete bot"));
471
+ A.error(e instanceof Error ? e.message : h("botlit.botDetail.delete.error", "Failed to delete bot"));
450
472
  }
451
473
  },
452
- children: v("botlit.common.delete", "Delete")
474
+ children: h("botlit.common.delete", "Delete")
453
475
  })
454
476
  })
455
477
  ]
456
478
  }),
457
- children: /* @__PURE__ */ C("div", {
479
+ children: /* @__PURE__ */ S("div", {
458
480
  className: "space-y-6",
459
481
  children: [
460
- /* @__PURE__ */ S(xe, {
461
- icon: /* @__PURE__ */ S(T, { size: 18 }),
462
- children: v("botlit.botDetail.purpose", "This is everything that makes up a single bot — the agent that answers, how requests are routed, which channels it is live on, its guardrails and its release history. Use the tabs to wire it up: assign a default agent, connect a channel and activate it so real users can start chatting.")
482
+ /* @__PURE__ */ x(Oe, {
483
+ icon: /* @__PURE__ */ x(w, { size: 18 }),
484
+ children: h("botlit.botDetail.purpose", "This is everything that makes up a single bot — the agent that answers, how requests are routed, which channels it is live on, its guardrails and its release history. Use the tabs to wire it up: assign a default agent, connect a channel and activate it so real users can start chatting.")
463
485
  }),
464
- /* @__PURE__ */ S("div", {
486
+ /* @__PURE__ */ x("div", {
465
487
  className: "flex gap-1 border-b border-border-subtle overflow-x-auto",
466
- children: nt.map((e) => /* @__PURE__ */ C("button", {
467
- onClick: () => G(e.id),
468
- className: pe("flex items-center gap-2 px-4 py-2 text-sm font-medium border-b-2 transition-colors whitespace-nowrap", W === e.id ? "border-primary text-primary" : "border-transparent text-text-secondary hover:text-text-primary"),
488
+ children: ct.map((e) => /* @__PURE__ */ S("button", {
489
+ onClick: () => H(e.id),
490
+ className: pe("flex items-center gap-2 px-4 py-2 text-sm font-medium border-b-2 transition-colors whitespace-nowrap", V === e.id ? "border-primary text-primary" : "border-transparent text-text-secondary hover:text-text-primary"),
469
491
  children: [e.icon, e.label]
470
492
  }, e.id))
471
493
  }),
472
- W === "overview" && /* @__PURE__ */ C("div", {
494
+ V === "overview" && /* @__PURE__ */ S("div", {
473
495
  className: "space-y-6",
474
- children: [/* @__PURE__ */ S(be, {
475
- storageKey: `botlit-bot-${N}`,
496
+ children: [/* @__PURE__ */ x(De, {
497
+ storageKey: `botlit-bot-${_}`,
476
498
  steps: [
477
499
  {
478
500
  id: "workflow",
479
- label: v("botlit.botDetail.nextSteps.workflow", "Design the workflow"),
480
- description: v("botlit.botDetail.nextSteps.workflowDesc", "Lay out what the bot does on the FluidGrids canvas."),
481
- icon: /* @__PURE__ */ S(j, { size: 16 }),
482
- onClick: () => G("workflow"),
483
- done: !!B.workflowId
501
+ label: h("botlit.botDetail.nextSteps.workflow", "Design the workflow"),
502
+ description: h("botlit.botDetail.nextSteps.workflowDesc", "Lay out what the bot does on the FluidGrids canvas."),
503
+ icon: /* @__PURE__ */ x(k, { size: 16 }),
504
+ onClick: () => H("workflow"),
505
+ done: !!L.workflowId
484
506
  },
485
507
  {
486
508
  id: "agent",
487
- label: v("botlit.botDetail.nextSteps.agent", "Assign a default agent"),
488
- description: v("botlit.botDetail.nextSteps.agentDesc", "Choose which agent answers when this bot is messaged."),
489
- icon: /* @__PURE__ */ S(T, { size: 16 }),
490
- onClick: () => G("agents"),
491
- done: !!B.defaultAgentId
509
+ label: h("botlit.botDetail.nextSteps.agent", "Assign a default agent"),
510
+ description: h("botlit.botDetail.nextSteps.agentDesc", "Choose which agent answers when this bot is messaged."),
511
+ icon: /* @__PURE__ */ x(w, { size: 16 }),
512
+ onClick: () => H("agents"),
513
+ done: !!L.defaultAgentId
492
514
  },
493
515
  {
494
516
  id: "channel",
495
- label: v("botlit.botDetail.nextSteps.channel", "Connect a channel"),
496
- description: v("botlit.botDetail.nextSteps.channelDesc", "Put the bot on Slack, a web widget or another channel."),
497
- icon: /* @__PURE__ */ S(O, { size: 16 }),
498
- onClick: () => G("channels")
517
+ label: h("botlit.botDetail.nextSteps.channel", "Connect a channel"),
518
+ description: h("botlit.botDetail.nextSteps.channelDesc", "Put the bot on Slack, a web widget or another channel."),
519
+ icon: /* @__PURE__ */ x(E, { size: 16 }),
520
+ onClick: () => H("channels")
499
521
  },
500
522
  {
501
523
  id: "test",
502
- label: v("botlit.botDetail.nextSteps.test", "Test the bot"),
503
- description: v("botlit.botDetail.nextSteps.testDesc", "Send a message to check the experience end to end."),
504
- icon: /* @__PURE__ */ S(D, { size: 16 }),
524
+ label: h("botlit.botDetail.nextSteps.test", "Test the bot"),
525
+ description: h("botlit.botDetail.nextSteps.testDesc", "Send a message to check the experience end to end."),
526
+ icon: /* @__PURE__ */ x(T, { size: 16 }),
505
527
  onClick: () => {
506
- let e = B?.defaultAgentId;
507
- I(e ? `chat/${e}` : "chat");
528
+ let e = L?.defaultAgentId;
529
+ N(e ? `agents/${e}/test` : "chat");
508
530
  }
509
531
  },
510
532
  {
511
533
  id: "activate",
512
- label: v("botlit.botDetail.nextSteps.activate", "Activate the bot"),
513
- description: v("botlit.botDetail.nextSteps.activateDesc", "Make it live so it starts handling conversations."),
514
- icon: /* @__PURE__ */ S(A, { size: 16 }),
515
- onClick: () => I(`bots/${N}/edit`),
516
- done: B.status === "ACTIVE"
534
+ label: h("botlit.botDetail.nextSteps.activate", "Activate the bot"),
535
+ description: h("botlit.botDetail.nextSteps.activateDesc", "Make it live so it starts handling conversations."),
536
+ icon: /* @__PURE__ */ x(O, { size: 16 }),
537
+ onClick: () => N(`bots/${_}/edit`),
538
+ done: L.status === "ACTIVE"
517
539
  }
518
540
  ]
519
- }), /* @__PURE__ */ C("div", {
541
+ }), /* @__PURE__ */ S("div", {
520
542
  className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
521
543
  children: [
522
- /* @__PURE__ */ C(n, { children: [/* @__PURE__ */ S(a, { children: /* @__PURE__ */ S(o, { children: "Details" }) }), /* @__PURE__ */ C(r, {
544
+ /* @__PURE__ */ S(n, { children: [/* @__PURE__ */ x(i, { children: /* @__PURE__ */ x(a, { children: "Details" }) }), /* @__PURE__ */ S(r, {
523
545
  className: "space-y-4",
524
546
  children: [
525
- /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
547
+ /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
526
548
  className: "text-sm text-text-secondary",
527
549
  children: "Status"
528
- }), /* @__PURE__ */ S(l, { status: B.status })] }),
529
- /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
550
+ }), /* @__PURE__ */ x(c, { status: L.status })] }),
551
+ /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
530
552
  className: "text-sm text-text-secondary",
531
553
  children: "Visibility"
532
- }), /* @__PURE__ */ S(c, {
554
+ }), /* @__PURE__ */ x(s, {
533
555
  variant: "outline",
534
- children: B.visibility
556
+ children: L.visibility
535
557
  })] }),
536
- /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
558
+ /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
537
559
  className: "text-sm text-text-secondary",
538
560
  children: "Routing Strategy"
539
- }), /* @__PURE__ */ S(c, {
561
+ }), /* @__PURE__ */ x(s, {
540
562
  variant: "outline",
541
- children: B.routingStrategy
563
+ children: L.routingStrategy
542
564
  })] }),
543
- /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
565
+ /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
544
566
  className: "text-sm text-text-secondary",
545
567
  children: "Default Agent"
546
- }), /* @__PURE__ */ S("p", {
568
+ }), /* @__PURE__ */ x("p", {
547
569
  className: "font-medium",
548
- children: B.defaultAgentId ? "1 agent assigned" : "No agents"
570
+ children: L.defaultAgentId ? "1 agent assigned" : "No agents"
549
571
  })] }),
550
- /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
572
+ /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
551
573
  className: "text-sm text-text-secondary",
552
574
  children: "Channels"
553
- }), /* @__PURE__ */ S("p", {
575
+ }), /* @__PURE__ */ x("p", {
554
576
  className: "font-medium",
555
577
  children: "0 channels"
556
578
  })] }),
557
- /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
579
+ /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
558
580
  className: "text-sm text-text-secondary",
559
581
  children: "Created"
560
- }), /* @__PURE__ */ S("p", {
582
+ }), /* @__PURE__ */ x("p", {
561
583
  className: "font-medium",
562
- children: fe(B.createdAt)
584
+ children: fe(L.createdAt)
563
585
  })] }),
564
- /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
586
+ /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
565
587
  className: "text-sm text-text-secondary",
566
588
  children: "Executions"
567
- }), /* @__PURE__ */ S("p", {
589
+ }), /* @__PURE__ */ x("p", {
568
590
  className: "font-medium",
569
- children: de(B.executionCount)
591
+ children: de(L.executionCount)
570
592
  })] })
571
593
  ]
572
594
  })] }),
573
- /* @__PURE__ */ C(ye, {
595
+ /* @__PURE__ */ S(Ee, {
574
596
  treatment: "glass",
575
597
  glow: !0,
576
598
  className: "lg:col-span-2 p-6",
577
- children: [/* @__PURE__ */ C("div", {
599
+ children: [/* @__PURE__ */ S("div", {
578
600
  className: "mb-4 flex flex-row items-center justify-between",
579
- children: [/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("h3", {
601
+ children: [/* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("h3", {
580
602
  className: "text-lg font-semibold tracking-tight text-text-primary",
581
603
  children: "Default Agent"
582
- }), /* @__PURE__ */ S("p", {
604
+ }), /* @__PURE__ */ x("p", {
583
605
  className: "text-sm text-text-secondary",
584
606
  children: "Agent configured for this bot"
585
- })] }), /* @__PURE__ */ S(s, {
607
+ })] }), /* @__PURE__ */ x(o, {
586
608
  size: "sm",
587
609
  variant: "outline",
588
- onClick: () => G("agents"),
610
+ onClick: () => H("agents"),
589
611
  children: "Manage"
590
612
  })]
591
- }), /* @__PURE__ */ S("div", { children: $ ? /* @__PURE__ */ S("div", {
613
+ }), /* @__PURE__ */ x("div", { children: $ ? /* @__PURE__ */ x("div", {
592
614
  className: "space-y-3",
593
- children: /* @__PURE__ */ C(Se, {
594
- to: L(`agents/${$.id}`),
615
+ children: /* @__PURE__ */ S(ke, {
616
+ to: P(`agents/${$.id}`),
595
617
  className: "flex items-center justify-between p-3 rounded-lg border border-border-subtle hover:bg-accent transition-colors",
596
- children: [/* @__PURE__ */ C("div", {
618
+ children: [/* @__PURE__ */ S("div", {
597
619
  className: "flex items-center gap-3",
598
- children: [/* @__PURE__ */ S("span", {
620
+ children: [/* @__PURE__ */ x("span", {
599
621
  className: "text-2xl",
600
622
  children: "🤖"
601
- }), /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
623
+ }), /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
602
624
  className: "font-medium text-text-primary",
603
625
  children: $.name
604
- }), /* @__PURE__ */ S("p", {
626
+ }), /* @__PURE__ */ x("p", {
605
627
  className: "text-xs text-text-secondary",
606
628
  children: "Default Agent"
607
629
  })] })]
608
- }), /* @__PURE__ */ S(l, { status: $.status })]
630
+ }), /* @__PURE__ */ x(c, { status: $.status })]
609
631
  })
610
- }) : /* @__PURE__ */ C("div", {
632
+ }) : /* @__PURE__ */ S("div", {
611
633
  className: "text-center py-8 text-text-secondary",
612
634
  children: [
613
- /* @__PURE__ */ S(T, { className: "h-8 w-8 mx-auto mb-2 opacity-50" }),
614
- /* @__PURE__ */ S("p", { children: "No default agent assigned" }),
615
- /* @__PURE__ */ S(s, {
635
+ /* @__PURE__ */ x(w, { className: "h-8 w-8 mx-auto mb-2 opacity-50" }),
636
+ /* @__PURE__ */ x("p", { children: "No default agent assigned" }),
637
+ /* @__PURE__ */ x(o, {
616
638
  size: "sm",
617
639
  className: "mt-3",
618
- onClick: () => G("agents"),
640
+ onClick: () => H("agents"),
619
641
  children: "Assign Agent"
620
642
  })
621
643
  ]
622
644
  }) })]
623
645
  }),
624
- (B.tagIds || []).length > 0 && /* @__PURE__ */ C(n, {
646
+ /* @__PURE__ */ S(n, {
625
647
  className: "lg:col-span-3",
626
- children: [/* @__PURE__ */ S(a, { children: /* @__PURE__ */ S(o, { children: "Tags" }) }), /* @__PURE__ */ S(r, { children: /* @__PURE__ */ S("div", {
627
- className: "flex flex-wrap gap-2",
628
- children: (B.tagIds || []).map((e) => /* @__PURE__ */ S(c, {
629
- variant: "outline",
630
- children: e
631
- }, e))
648
+ children: [/* @__PURE__ */ x(i, { children: /* @__PURE__ */ x(a, { children: "Tags" }) }), /* @__PURE__ */ x(r, { children: /* @__PURE__ */ x(we, {
649
+ entityType: "BotmanorApp",
650
+ entityId: L.id,
651
+ tags: L.tags,
652
+ editable: M(l.APP_UPDATE),
653
+ onSave: async (e) => {
654
+ _ && (await B({
655
+ botId: _,
656
+ input: { tags: e }
657
+ }), await z());
658
+ }
632
659
  }) })]
633
660
  })
634
661
  ]
635
662
  })]
636
663
  }),
637
- W === "workflow" && N && /* @__PURE__ */ S(ve, {
638
- fallback: /* @__PURE__ */ S("div", { className: "h-64 bg-bg-sunken motion-safe:animate-vc-shimmer rounded-lg" }),
639
- children: /* @__PURE__ */ S(je, {
640
- botId: N,
641
- botName: B.name,
642
- workflowId: B.workflowId,
664
+ V === "workflow" && _ && /* @__PURE__ */ x(Te, {
665
+ fallback: /* @__PURE__ */ x("div", { className: "h-64 bg-bg-sunken motion-safe:animate-vc-shimmer rounded-lg" }),
666
+ children: /* @__PURE__ */ x(ze, {
667
+ botId: _,
668
+ botName: L.name,
669
+ workflowId: L.workflowId,
643
670
  onWorkflowChanged: async () => {
644
- await V();
671
+ await z();
645
672
  }
646
673
  })
647
674
  }),
648
- W === "routing" && /* @__PURE__ */ C("div", {
649
- className: "space-y-6",
650
- children: [/* @__PURE__ */ C(n, { children: [/* @__PURE__ */ C(a, { children: [/* @__PURE__ */ S(o, { children: "Routing Configuration" }), /* @__PURE__ */ S(i, { children: "How requests are routed to agents" })] }), /* @__PURE__ */ S(r, {
651
- className: "space-y-4",
652
- children: /* @__PURE__ */ C("div", {
653
- className: "grid grid-cols-2 gap-4",
654
- children: [/* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
655
- className: "text-sm text-text-secondary",
656
- children: "Strategy"
657
- }), /* @__PURE__ */ S(c, {
658
- variant: "outline",
659
- className: "mt-1",
660
- children: B.routingStrategy
661
- })] }), B.defaultAgentId && /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
662
- className: "text-sm text-text-secondary",
663
- children: "Default Agent"
664
- }), /* @__PURE__ */ S("p", {
665
- className: "font-mono text-sm mt-1",
666
- children: B.defaultAgentId
667
- })] })]
668
- })
669
- })] }), /* @__PURE__ */ C(n, { children: [/* @__PURE__ */ C(a, { children: [/* @__PURE__ */ S(o, { children: "Routing Rules" }), /* @__PURE__ */ S(i, { children: "No routing rules configured" })] }), /* @__PURE__ */ S(r, { children: /* @__PURE__ */ S("p", {
670
- className: "text-text-secondary",
671
- children: "No routing rules configured. Routing rules will be available in a future update."
672
- }) })] })]
675
+ V === "routing" && _ && /* @__PURE__ */ x(be, {
676
+ botId: _,
677
+ routingStrategy: L.routingStrategy,
678
+ defaultAgentName: $?.name,
679
+ agents: Q,
680
+ onManage: () => H("agents")
673
681
  }),
674
- W === "agents" && /* @__PURE__ */ C(n, { children: [/* @__PURE__ */ C(a, { children: [/* @__PURE__ */ S(o, { children: "Default Agent" }), /* @__PURE__ */ S(i, { children: "Select the default agent for this bot" })] }), /* @__PURE__ */ C(r, {
675
- className: "space-y-4",
676
- children: [
677
- $ && /* @__PURE__ */ C("div", {
678
- className: "flex items-center justify-between p-4 border border-border-subtle rounded-lg",
679
- children: [/* @__PURE__ */ C("div", {
680
- className: "flex items-center gap-3",
681
- children: [/* @__PURE__ */ S("span", {
682
- className: "text-2xl",
683
- children: "🤖"
684
- }), /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("p", {
685
- className: "font-medium",
686
- children: $.name
687
- }), /* @__PURE__ */ S(c, {
688
- variant: "success",
689
- children: "Default"
690
- })] })]
691
- }), /* @__PURE__ */ S(l, { status: $.status })]
692
- }),
693
- /* @__PURE__ */ S("div", {
694
- className: "flex items-center gap-3",
695
- children: /* @__PURE__ */ C("select", {
696
- className: "flex h-10 flex-1 rounded-md border border-border-default bg-bg-surface px-3 py-2 text-sm",
697
- value: B.defaultAgentId || "",
698
- disabled: !F(u.APP_UPDATE),
699
- onChange: async (e) => {
700
- if (N) try {
701
- await U({
702
- botId: N,
703
- input: { defaultAgentId: e.target.value || null }
704
- }), M.success(e.target.value ? "Default agent assigned" : "Default agent removed");
705
- } catch (e) {
706
- let t = e instanceof Error ? e.message : "Failed to assign agent";
707
- M.error(t);
708
- }
709
- },
710
- children: [/* @__PURE__ */ S("option", {
711
- value: "",
712
- children: "No default agent"
713
- }), H?.map((e) => /* @__PURE__ */ S("option", {
714
- value: e.id,
715
- children: e.name
716
- }, e.id))]
717
- })
718
- }),
719
- !$ && !H?.length && /* @__PURE__ */ C("div", {
720
- className: "text-center py-8 text-text-secondary",
721
- children: [/* @__PURE__ */ S(T, { className: "h-8 w-8 mx-auto mb-2 opacity-50" }), /* @__PURE__ */ S("p", { children: "No agents available. Create an agent first." })]
722
- })
723
- ]
724
- })] }),
725
- W === "channels" && N && /* @__PURE__ */ S(_e, {
726
- botId: N,
727
- botName: B.name
682
+ V === "agents" && _ && /* @__PURE__ */ x(ye, {
683
+ botId: _,
684
+ defaultAgentId: L.defaultAgentId,
685
+ agents: Q,
686
+ onDefaultAgentChange: async (e) => {
687
+ await B({
688
+ botId: _,
689
+ input: { defaultAgentId: e }
690
+ }), await z();
691
+ }
692
+ }),
693
+ V === "channels" && _ && /* @__PURE__ */ x(ve, {
694
+ botId: _,
695
+ botName: L.name
728
696
  }),
729
- W === "aiOperations" && N && /* @__PURE__ */ S(ee, {
697
+ V === "aiOperations" && _ && /* @__PURE__ */ x(ee, {
730
698
  filter: {
731
699
  subjectType: "APP",
732
- subjectId: N
700
+ subjectId: _
733
701
  },
734
- description: v("botlit.botDetail.aiOperationsDescription", "What the supervisor flagged for this bot — drift, evidence and the recommended action.")
702
+ description: h("botlit.botDetail.aiOperationsDescription", "What the supervisor flagged for this bot — drift, evidence and the recommended action.")
735
703
  }),
736
- W === "guardrails" && /* @__PURE__ */ C(n, { children: [/* @__PURE__ */ C(a, { children: [/* @__PURE__ */ S(o, { children: "Policy Bindings" }), /* @__PURE__ */ S(i, { children: "Guardrails and policies attached to this bot" })] }), /* @__PURE__ */ S(r, { children: /* @__PURE__ */ C("div", {
737
- className: "text-center py-8 text-text-secondary",
738
- children: [
739
- /* @__PURE__ */ S(A, { className: "h-8 w-8 mx-auto mb-2 opacity-50" }),
740
- /* @__PURE__ */ S("p", { children: "Not configured" }),
741
- /* @__PURE__ */ S("p", {
742
- className: "text-sm mt-1",
743
- children: "Policy bindings will be available in a future update."
744
- })
745
- ]
746
- }) })] }),
747
- W === "releases" && /* @__PURE__ */ C(n, { children: [/* @__PURE__ */ C(a, { children: [/* @__PURE__ */ S(o, { children: "Release Tracks" }), /* @__PURE__ */ S(i, { children: "Version deployments across environments" })] }), /* @__PURE__ */ S(r, { children: /* @__PURE__ */ C("div", {
748
- className: "text-center py-8 text-text-secondary",
749
- children: [
750
- /* @__PURE__ */ S(E, { className: "h-8 w-8 mx-auto mb-2 opacity-50" }),
751
- /* @__PURE__ */ S("p", { children: "Not configured" }),
752
- /* @__PURE__ */ S("p", {
753
- className: "text-sm mt-1",
754
- children: "Release tracks will be available in a future update."
755
- })
756
- ]
757
- }) })] })
704
+ V === "guardrails" && /* @__PURE__ */ x(Se, { subject: "bot" }),
705
+ V === "releases" && _ && /* @__PURE__ */ x(xe, {
706
+ botId: _,
707
+ onChanged: () => void z()
708
+ })
758
709
  ]
759
710
  })
760
711
  });
761
712
  };
762
- export { R as BotDetailPage };
713
+ export { I as BotDetailPage };
763
714
 
764
715
  //# sourceMappingURL=BotDetailPage.js.map