@burdenoff/microfe-botmanor 2026.1115.2 → 2026.1117.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (53) hide show
  1. package/dist/botlit/components/BotFormFields.js +66 -87
  2. package/dist/botlit/components/BotFormFields.js.map +1 -1
  3. package/dist/botlit/components/EmojiPicker.d.ts +20 -0
  4. package/dist/botlit/components/EmojiPicker.js +42 -0
  5. package/dist/botlit/components/EmojiPicker.js.map +1 -0
  6. package/dist/botlit/components/index.d.ts +1 -0
  7. package/dist/botlit/hooks/internal/allPages.d.ts +2 -0
  8. package/dist/botlit/hooks/internal/allPages.js +25 -0
  9. package/dist/botlit/hooks/internal/allPages.js.map +1 -0
  10. package/dist/botlit/hooks/internal/workspaceGateway.js +33 -32
  11. package/dist/botlit/hooks/internal/workspaceGateway.js.map +1 -1
  12. package/dist/botlit/hooks/useAgents.d.ts +26 -3
  13. package/dist/botlit/hooks/useAgents.js +160 -110
  14. package/dist/botlit/hooks/useAgents.js.map +1 -1
  15. package/dist/botlit/hooks/useBotAgents.d.ts +35 -0
  16. package/dist/botlit/hooks/useBotAgents.js +95 -0
  17. package/dist/botlit/hooks/useBotAgents.js.map +1 -0
  18. package/dist/botlit/hooks/useBots.js +2 -2
  19. package/dist/botlit/hooks/useBots.js.map +1 -1
  20. package/dist/botlit/hooks/useKnowledgeBases.d.ts +13 -0
  21. package/dist/botlit/hooks/useKnowledgeBases.js +77 -58
  22. package/dist/botlit/hooks/useKnowledgeBases.js.map +1 -1
  23. package/dist/botlit/hooks/useMCPServers.js +53 -57
  24. package/dist/botlit/hooks/useMCPServers.js.map +1 -1
  25. package/dist/botlit/pages/AgentBuilderPage.js +848 -425
  26. package/dist/botlit/pages/AgentBuilderPage.js.map +1 -1
  27. package/dist/botlit/pages/AgentDetailPage.js +629 -518
  28. package/dist/botlit/pages/AgentDetailPage.js.map +1 -1
  29. package/dist/botlit/pages/AgentsListPage.js +487 -291
  30. package/dist/botlit/pages/AgentsListPage.js.map +1 -1
  31. package/dist/botlit/pages/KnowledgeBaseDetailPage.js +519 -265
  32. package/dist/botlit/pages/KnowledgeBaseDetailPage.js.map +1 -1
  33. package/dist/botlit/pages/KnowledgeBasesPage.js +269 -130
  34. package/dist/botlit/pages/KnowledgeBasesPage.js.map +1 -1
  35. package/dist/botlit/types/index.d.ts +4 -1
  36. package/dist/botlit/utils/agentDelete.d.ts +5 -0
  37. package/dist/botlit/utils/agentDelete.js +15 -0
  38. package/dist/botlit/utils/agentDelete.js.map +1 -0
  39. package/dist/botlit/utils/agentSettings.d.ts +77 -0
  40. package/dist/botlit/utils/agentSettings.js +78 -0
  41. package/dist/botlit/utils/agentSettings.js.map +1 -0
  42. package/dist/botlit/utils/kbDelete.d.ts +5 -0
  43. package/dist/botlit/utils/kbDelete.js +11 -0
  44. package/dist/botlit/utils/kbDelete.js.map +1 -0
  45. package/dist/botlit/utils/kbSettings.d.ts +41 -0
  46. package/dist/botlit/utils/kbSettings.js +60 -0
  47. package/dist/botlit/utils/kbSettings.js.map +1 -0
  48. package/dist/generated/wspace-operations.d.ts +75 -0
  49. package/dist/generated/wspace-operations.js +60 -48
  50. package/dist/generated/wspace-operations.js.map +1 -1
  51. package/dist/generated/wspace-types.d.ts +66 -0
  52. package/dist/generated/wspace-types.js.map +1 -1
  53. package/package.json +1 -1
@@ -1,602 +1,713 @@
1
1
  import { useTr as e } from "../../shared/hooks/useTr.js";
2
2
  import { PageLayout as t } from "../components/PageLayout.js";
3
- import { HandoffConfigPanel as ee } from "../components/HandoffConfigPanel.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 { BOTMANOR_PERMISSIONS as c } from "../permissions/botmanorPermissions.js";
7
- import { BotmanorPermissionGate as l, useBotmanorCan as te } from "../permissions/useBotmanorPermissions.js";
8
- import { Badge as u, StatusBadge as d } from "../components/Badge.js";
9
- import { EmptyState as ne } from "../components/EmptyState.js";
3
+ import { HandoffConfigPanel as n } from "../components/HandoffConfigPanel.js";
4
+ import { Card as r, CardContent as i, CardDescription as a, CardHeader as o, CardTitle as s } from "../components/Card.js";
5
+ import { Button as c } from "../components/Button.js";
6
+ import { Badge as l, StatusBadge as u } from "../components/Badge.js";
7
+ import { EmptyState as ee } from "../components/EmptyState.js";
8
+ import { BOTMANOR_PERMISSIONS as d } from "../permissions/botmanorPermissions.js";
9
+ import { BotmanorPermissionGate as f, useBotmanorCan as te } from "../permissions/useBotmanorPermissions.js";
10
+ import { ErrorState as ne } from "../components/ErrorState.js";
10
11
  import { VersionHistoryPanel as re } from "../components/VersionHistoryPanel.js";
11
12
  import { AgentApprovalPanel as ie } from "../components/AgentApprovalPanel.js";
12
13
  import { useAgentApprovalSettings as ae } from "../hooks/useAgentApprovals.js";
13
- import { AssistantRuntimeSetupPanel as f } from "../components/AssistantRuntimeSetupPanel.js";
14
- import { AssistantChannelPanel as p } from "../components/AssistantChannelPanel.js";
15
- import { AssistantWebsitePanel as m } from "../components/AssistantWebsitePanel.js";
16
- import { AiOperationsPanel as h } from "../components/AiOperationsPanel.js";
17
- import { useAgent as g, useDeleteAgent as _, useUpdateAgent as v } from "../hooks/useAgents.js";
18
- import { useBotlit as y } from "../providers/BotlitProvider.js";
19
- import { formatRelativeTime as b } from "../utils/formatters.js";
20
- import { cn as oe } from "../utils/cn.js";
14
+ import { AssistantRuntimeSetupPanel as oe } from "../components/AssistantRuntimeSetupPanel.js";
15
+ import { AssistantChannelPanel as se } from "../components/AssistantChannelPanel.js";
16
+ import { AssistantWebsitePanel as ce } from "../components/AssistantWebsitePanel.js";
17
+ import { AiOperationsPanel as le } from "../components/AiOperationsPanel.js";
18
+ import { useAgent as ue, useDeleteAgent as de, useLoadAgentUsage as fe, useUpdateAgent as pe } from "../hooks/useAgents.js";
19
+ import { useKnowledgeBases as me } from "../hooks/useKnowledgeBases.js";
20
+ import { useMCPServers as he } from "../hooks/useMCPServers.js";
21
+ import { useBotlit as ge } from "../providers/BotlitProvider.js";
22
+ import { formatRelativeTime as p } from "../utils/formatters.js";
23
+ import { cn as _e } from "../utils/cn.js";
24
+ import { agentDeleteMessage as ve } from "../utils/agentDelete.js";
25
+ import { confirmAction as m } from "../utils/confirmAction.js";
21
26
  import "../permissions/index.js";
22
- import { useState as se } from "react";
23
- import { GlassCard as ce, NextSteps as le, PagePurpose as ue } from "@burdenoff/fe-libs/ui";
24
- import { Fragment as de, jsx as x, jsxs as S } from "react/jsx-runtime";
25
- import { useParams as fe } from "react-router";
26
- import { ArrowLeft as pe, BarChart3 as me, BookOpen as C, Brain as w, Edit as he, FileText as T, Headset as ge, History as _e, MessageSquare as ve, Play as E, Settings as D, Share2 as O, Shield as k, ShieldCheck as A, Trash2 as j, Wrench as M } from "lucide-react";
27
- import { toast as N } from "sonner";
27
+ import { useState as ye } from "react";
28
+ import { GlassCard as be, NextSteps as xe, PagePurpose as Se } from "@burdenoff/fe-libs/ui";
29
+ import { Fragment as h, jsx as g, jsxs as _ } from "react/jsx-runtime";
30
+ import { useParams as Ce } from "react-router";
31
+ import { ArrowLeft as we, BarChart3 as Te, BookOpen as v, Brain as y, Edit as Ee, FileText as b, Headset as De, History as Oe, MessageSquare as ke, Play as x, Settings as S, Share2 as C, Shield as w, ShieldCheck as Ae, Trash2 as je, Wrench as T } from "lucide-react";
32
+ import { toast as E } from "sonner";
28
33
  // src/botlit/pages/AgentDetailPage.tsx
29
- var P = () => {
30
- let P = e(), { agentId: F } = fe(), { navigateTo: I } = y(), L = te(), { data: R, loading: ye, refetch: z } = g(F), [B, V] = v(), [be, xe] = _(), [H, U] = se("overview"), Se = ae();
31
- if (ye) return /* @__PURE__ */ x(t, {
32
- title: P("botlit.common.loading", "Loading..."),
33
- children: /* @__PURE__ */ x("div", { className: "h-96 bg-bg-sunken motion-safe:animate-vc-shimmer rounded-lg" })
34
+ var Me = "🤖", D = {
35
+ key: "activate",
36
+ to: "ACTIVE",
37
+ variant: "default",
38
+ confirm: !1
39
+ }, O = {
40
+ key: "resume",
41
+ to: "ACTIVE",
42
+ variant: "default",
43
+ confirm: !1
44
+ }, k = {
45
+ key: "pause",
46
+ to: "PAUSED",
47
+ variant: "outline",
48
+ confirm: !0
49
+ }, A = {
50
+ key: "archive",
51
+ to: "ARCHIVED",
52
+ variant: "outline",
53
+ confirm: !0
54
+ }, Ne = {
55
+ DRAFT: [D, A],
56
+ ACTIVE: [k, A],
57
+ PAUSED: [O, A],
58
+ TRAINING: [k, A],
59
+ ARCHIVED: [{
60
+ key: "restore",
61
+ to: "DRAFT",
62
+ variant: "default",
63
+ confirm: !1
64
+ }]
65
+ }, j = () => {
66
+ let D = e(), { agentId: O, botId: k } = Ce(), { navigateTo: A } = ge(), j = te(), { data: M, loading: Pe, error: N, refetch: P } = ue(O), [Fe, Ie] = pe(), [Le, Re] = de(), ze = fe(), [F, I] = ye("overview"), L = he(), R = me(), Be = L.data, z = R.data, Ve = ae(), B = k ? `bots/${k}/agents` : "agents";
67
+ if (Pe) return /* @__PURE__ */ g(t, {
68
+ title: D("botlit.common.loading", "Loading..."),
69
+ children: /* @__PURE__ */ g("div", {
70
+ role: "status",
71
+ "aria-busy": "true",
72
+ "aria-label": D("botlit.common.loading", "Loading..."),
73
+ className: "h-96 bg-bg-sunken motion-safe:animate-vc-shimmer rounded-lg"
74
+ })
75
+ });
76
+ if (N) return /* @__PURE__ */ g(t, {
77
+ title: D("botlit.agentDetail.errorTitle", "Agent"),
78
+ children: /* @__PURE__ */ g(ne, {
79
+ resource: D("botlit.agentDetail.resource", "this agent"),
80
+ error: N,
81
+ onRetry: () => void P()
82
+ })
34
83
  });
35
- if (!R) return /* @__PURE__ */ x(t, {
36
- title: P("botlit.agentDetail.notFound.title", "Agent Not Found"),
37
- children: /* @__PURE__ */ x(ne, {
84
+ if (!M) return /* @__PURE__ */ g(t, {
85
+ title: D("botlit.agentDetail.notFound.title", "Agent Not Found"),
86
+ children: /* @__PURE__ */ g(ee, {
38
87
  illustration: "empty-agents",
39
- title: P("botlit.agentDetail.notFound.title", "Agent Not Found"),
40
- description: P("botlit.agentDetail.notFound.description", "The agent you're looking for doesn't exist."),
41
- action: /* @__PURE__ */ x(s, {
42
- onClick: () => I("agents"),
43
- children: P("botlit.agentDetail.notFound.backAction", "Back to Agents")
88
+ title: D("botlit.agentDetail.notFound.title", "Agent Not Found"),
89
+ description: D("botlit.agentDetail.notFound.description", "The agent you're looking for doesn't exist."),
90
+ action: /* @__PURE__ */ g(c, {
91
+ onClick: () => A(B),
92
+ children: D("botlit.agentDetail.notFound.backAction", "Back to Agents")
44
93
  })
45
94
  })
46
95
  });
47
- let W = R.systemPrompt || "", G = R.llmModelId || "", Ce = R.temperature, K = R.maxTokens, q = R.mcpConnectionIds ?? [], J = R.knowledgeBaseIds ?? [], Y = R.workflowIds ?? [], X = R.capabilities ?? [], Z = R.tagIds ?? [], Q = R.maxConcurrentExecutions || 10, $ = R.metadata ?? null, we = [
96
+ let V = M.systemPrompt || "", H = M.llmModelId || "", He = M.temperature, Ue = M.maxTokens, U = M.mcpConnectionIds ?? [], W = M.knowledgeBaseIds ?? [], G = M.workflowIds ?? [], K = M.capabilities ?? [], q = M.tagIds ?? [], J = M.maxConcurrentExecutions || 10, Y = M.metadata ?? null, X = !!Ve.data?.requireActivationApproval && (M.status === "DRAFT" || M.status === "ARCHIVED") && !M.currentVersionId, Z = new Map(Be.map((e) => [e.id, e.name])), Q = new Map(z.map((e) => [e.id, e.name])), We = K.includes("RAG") && !R.loading && !R.error ? W.flatMap((e) => {
97
+ let t = z.find((t) => t.id === e);
98
+ return t ? t.indexStatus === "READY" ? [] : [{
99
+ id: e,
100
+ name: t.name,
101
+ status: t.indexStatus
102
+ }] : [{
103
+ id: e,
104
+ name: null,
105
+ status: "MISSING"
106
+ }];
107
+ }) : [], Ge = (e, t, n, r) => t.get(e) ?? (n.loading ? D("botlit.agentDetail.resourceLoading", "Loading…") : n.error ? D("botlit.agentDetail.resourceUnnamed", "Name unavailable") : D(r, "No longer available")), Ke = (() => {
108
+ switch (M.status) {
109
+ case "ACTIVE": return null;
110
+ case "DRAFT": return X ? D("botlit.agentDetail.reason.pendingApproval", "This agent is a draft. This workspace needs a reviewer to approve it before it goes live: use Request activation.") : M.currentVersionId ? D("botlit.agentDetail.reason.deactivated", "This agent was taken out of service and is a draft again. Activate it to put it back live.") : D("botlit.agentDetail.reason.neverPublished", "This agent is a draft that was never published, so it does not answer bots yet. Activate it to publish it.");
111
+ case "PAUSED": return D("botlit.agentDetail.reason.paused", "This agent is paused and does not answer bots or other agents. Resume it to put it back live.");
112
+ case "TRAINING": return D("botlit.agentDetail.reason.training", "This agent is in training and does not answer bots or other agents yet.");
113
+ case "ARCHIVED": return D("botlit.agentDetail.reason.archived", "This agent is archived and does not answer. Restore it to bring it back as a draft.");
114
+ default: return null;
115
+ }
116
+ })(), $ = (e, t) => {
117
+ switch (e) {
118
+ case "activate": return {
119
+ label: D("botlit.agentDetail.actions.activate", "Activate"),
120
+ success: D("botlit.agentDetail.activate.success", "Agent \"{{name}}\" activated", { name: t }),
121
+ error: D("botlit.agentDetail.activate.error", "Failed to activate agent")
122
+ };
123
+ case "resume": return {
124
+ label: D("botlit.agentDetail.actions.resume", "Resume"),
125
+ success: D("botlit.agentDetail.resume.success", "Agent \"{{name}}\" resumed", { name: t }),
126
+ error: D("botlit.agentDetail.resume.error", "Failed to resume agent")
127
+ };
128
+ case "pause": return {
129
+ label: D("botlit.agentDetail.actions.pause", "Pause"),
130
+ success: D("botlit.agentDetail.pause.success", "Agent \"{{name}}\" paused", { name: t }),
131
+ error: D("botlit.agentDetail.pause.error", "Failed to pause agent"),
132
+ confirmTitle: D("botlit.agentDetail.pause.confirmTitle", "Pause agent?"),
133
+ confirmMessage: D("botlit.agentDetail.pause.confirmMessage", "Pause \"{{name}}\"? It stops answering bots and other agents until you resume it.", { name: t })
134
+ };
135
+ case "archive": return {
136
+ label: D("botlit.agentDetail.actions.archive", "Archive"),
137
+ success: D("botlit.agentDetail.archive.success", "Agent \"{{name}}\" archived", { name: t }),
138
+ error: D("botlit.agentDetail.archive.error", "Failed to archive agent"),
139
+ confirmTitle: D("botlit.agentDetail.archive.confirmTitle", "Archive agent?"),
140
+ confirmMessage: D("botlit.agentDetail.archive.confirmMessage", "Archive \"{{name}}\"? It stops answering bots and other agents. You can restore it later.", { name: t })
141
+ };
142
+ case "restore": return {
143
+ label: D("botlit.agentDetail.actions.restore", "Restore"),
144
+ success: D("botlit.agentDetail.restore.success", "Agent \"{{name}}\" restored as a draft", { name: t }),
145
+ error: D("botlit.agentDetail.restore.error", "Failed to restore agent")
146
+ };
147
+ }
148
+ }, qe = async (e) => {
149
+ if (!O) return;
150
+ let t = $(e.key, M.name);
151
+ if (!(e.confirm && t.confirmTitle && t.confirmMessage && !await m({
152
+ title: t.confirmTitle,
153
+ message: t.confirmMessage,
154
+ confirmLabel: t.label,
155
+ cancelLabel: D("botlit.common.cancel", "Cancel")
156
+ }))) try {
157
+ await Fe({
158
+ agentId: O,
159
+ input: { status: e.to }
160
+ }), await P(), E.success(t.success);
161
+ } catch (e) {
162
+ E.error(e instanceof Error ? e.message : t.error);
163
+ }
164
+ }, Je = async () => {
165
+ if (!O) return;
166
+ let e = await ze(O).catch(() => null), t = ve(D, M.name, e);
167
+ if (await m({
168
+ title: D("botlit.agentsList.delete.title", "Delete agent?"),
169
+ message: t,
170
+ confirmLabel: D("botlit.agentsList.delete.okButton", "Delete"),
171
+ cancelLabel: D("botlit.agentsList.delete.cancelButton", "Cancel")
172
+ })) try {
173
+ if (!await Le(O)) {
174
+ E.error(D("botlit.agentDetail.delete.error", "Failed to delete agent"));
175
+ return;
176
+ }
177
+ E.success(D("botlit.agentDetail.delete.success", "Agent \"{{name}}\" deleted successfully", { name: M.name })), A(B);
178
+ } catch (e) {
179
+ E.error(e instanceof Error ? e.message : D("botlit.agentDetail.delete.error", "Failed to delete agent"));
180
+ }
181
+ }, Ye = [
48
182
  {
49
183
  id: "assistant",
50
184
  label: "Assistant setup",
51
- icon: /* @__PURE__ */ x(D, { size: 16 })
185
+ icon: /* @__PURE__ */ g(S, { size: 16 })
52
186
  },
53
187
  {
54
188
  id: "overview",
55
- label: P("botlit.agentDetail.tabs.overview", "Overview"),
56
- icon: /* @__PURE__ */ x(me, { size: 16 })
189
+ label: D("botlit.agentDetail.tabs.overview", "Overview"),
190
+ icon: /* @__PURE__ */ g(Te, { size: 16 })
57
191
  },
58
192
  {
59
193
  id: "prompt",
60
- label: P("botlit.agentDetail.tabs.prompt", "Prompt"),
61
- icon: /* @__PURE__ */ x(T, { size: 16 })
194
+ label: D("botlit.agentDetail.tabs.prompt", "Prompt"),
195
+ icon: /* @__PURE__ */ g(b, { size: 16 })
62
196
  },
63
197
  {
64
198
  id: "llm",
65
- label: P("botlit.agentDetail.tabs.llmConfig", "LLM Config"),
66
- icon: /* @__PURE__ */ x(w, { size: 16 })
199
+ label: D("botlit.agentDetail.tabs.llmConfig", "LLM Config"),
200
+ icon: /* @__PURE__ */ g(y, { size: 16 })
67
201
  },
68
202
  {
69
203
  id: "tools",
70
- label: P("botlit.agentDetail.tabs.tools", "Tools"),
71
- icon: /* @__PURE__ */ x(M, { size: 16 })
204
+ label: D("botlit.agentDetail.tabs.tools", "Tools"),
205
+ icon: /* @__PURE__ */ g(T, { size: 16 })
72
206
  },
73
207
  {
74
208
  id: "knowledge",
75
- label: P("botlit.agentDetail.tabs.knowledge", "Knowledge"),
76
- icon: /* @__PURE__ */ x(C, { size: 16 })
209
+ label: D("botlit.agentDetail.tabs.knowledge", "Knowledge"),
210
+ icon: /* @__PURE__ */ g(v, { size: 16 })
77
211
  },
78
212
  {
79
213
  id: "guardrails",
80
- label: P("botlit.agentDetail.tabs.guardrails", "Guardrails"),
81
- icon: /* @__PURE__ */ x(k, { size: 16 })
214
+ label: D("botlit.agentDetail.tabs.guardrails", "Guardrails"),
215
+ icon: /* @__PURE__ */ g(w, { size: 16 })
82
216
  },
83
217
  {
84
218
  id: "handoff",
85
- label: P("botlit.agentDetail.tabs.handoff", "Handoff"),
86
- icon: /* @__PURE__ */ x(ge, { size: 16 })
219
+ label: D("botlit.agentDetail.tabs.handoff", "Handoff"),
220
+ icon: /* @__PURE__ */ g(De, { size: 16 })
87
221
  },
88
222
  {
89
223
  id: "aiOperations",
90
- label: P("botlit.agentDetail.tabs.aiOperations", "AI Operations"),
91
- icon: /* @__PURE__ */ x(A, { size: 16 })
224
+ label: D("botlit.agentDetail.tabs.aiOperations", "AI Operations"),
225
+ icon: /* @__PURE__ */ g(Ae, { size: 16 })
92
226
  },
93
227
  {
94
228
  id: "a2a",
95
- label: P("botlit.agentDetail.tabs.a2a", "A2A"),
96
- icon: /* @__PURE__ */ x(O, { size: 16 })
229
+ label: D("botlit.agentDetail.tabs.a2a", "A2A"),
230
+ icon: /* @__PURE__ */ g(C, { size: 16 })
97
231
  },
98
232
  {
99
233
  id: "versions",
100
- label: P("botlit.agentDetail.tabs.versions", "Versions"),
101
- icon: /* @__PURE__ */ x(_e, { size: 16 })
234
+ label: D("botlit.agentDetail.tabs.versions", "Versions"),
235
+ icon: /* @__PURE__ */ g(Oe, { size: 16 })
102
236
  }
103
237
  ];
104
- return /* @__PURE__ */ x(t, {
105
- title: /* @__PURE__ */ S("div", {
106
- className: "flex items-center gap-3",
107
- children: [
108
- /* @__PURE__ */ x(s, {
109
- variant: "ghost",
110
- size: "icon",
111
- onClick: () => I("agents"),
112
- children: /* @__PURE__ */ x(pe, { size: 20 })
113
- }),
114
- /* @__PURE__ */ x("span", {
115
- className: "text-3xl",
116
- children: "🤖"
117
- }),
118
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ S("div", {
119
- className: "flex items-center gap-2",
120
- children: [
121
- /* @__PURE__ */ x("span", { children: R.name }),
122
- /* @__PURE__ */ x(d, { status: R.status }),
123
- /* @__PURE__ */ x(u, {
124
- variant: "outline",
125
- children: R.slug
126
- })
127
- ]
128
- }), /* @__PURE__ */ x("p", {
129
- className: "text-sm font-normal text-text-secondary",
130
- children: R.description
131
- })] })
132
- ]
133
- }),
134
- actions: /* @__PURE__ */ S("div", {
238
+ return /* @__PURE__ */ _(t, {
239
+ title: M.name,
240
+ leading: /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(c, {
241
+ variant: "ghost",
242
+ size: "icon",
243
+ "aria-label": D("botlit.agentDetail.back", "Back to agents"),
244
+ onClick: () => A(B),
245
+ children: /* @__PURE__ */ g(we, {
246
+ size: 20,
247
+ "aria-hidden": "true"
248
+ })
249
+ }), /* @__PURE__ */ g("span", {
250
+ className: "text-3xl",
251
+ "aria-hidden": "true",
252
+ children: M.avatar || Me
253
+ })] }),
254
+ meta: /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(u, { status: M.status }), /* @__PURE__ */ g(l, {
255
+ variant: "outline",
256
+ children: M.slug
257
+ })] }),
258
+ description: M.description,
259
+ actions: /* @__PURE__ */ _("div", {
135
260
  className: "flex gap-2",
136
261
  children: [
137
- Se.data?.requireActivationApproval && (R.status === "DRAFT" || R.status === "ARCHIVED") && !R.currentVersionId ? /* @__PURE__ */ x(l, {
138
- permission: c.AGENT_UPDATE,
139
- children: /* @__PURE__ */ x(s, {
262
+ /* @__PURE__ */ g(f, {
263
+ permission: d.AGENT_UPDATE,
264
+ children: X ? /* @__PURE__ */ g(c, {
140
265
  variant: "default",
141
266
  onClick: () => {
142
- U("overview"), requestAnimationFrame(() => document.querySelector("[data-testid=\"agent-approval-panel\"]")?.scrollIntoView({
267
+ I("overview"), requestAnimationFrame(() => document.querySelector("[data-testid=\"agent-approval-panel\"]")?.scrollIntoView({
143
268
  behavior: "smooth",
144
269
  block: "start"
145
270
  }));
146
271
  },
147
- children: P("botlit.agentApproval.requestAction", "Request activation")
148
- })
149
- }) : R.status === "DRAFT" || R.status === "ARCHIVED" ? /* @__PURE__ */ x(l, {
150
- permission: c.AGENT_UPDATE,
151
- children: /* @__PURE__ */ x(s, {
152
- variant: "default",
153
- isLoading: V.loading,
154
- onClick: async () => {
155
- try {
156
- if (!F) return;
157
- await B({
158
- agentId: F,
159
- input: { status: "ACTIVE" }
160
- }), await z(), N.success(`${P("botlit.agentDetail.activate.successPrefix", "Agent")} "${R.name}" ${P("botlit.agentDetail.activate.successSuffix", "activated")}`);
161
- } catch (e) {
162
- N.error(e instanceof Error ? e.message : P("botlit.agentDetail.activate.error", "Failed to activate agent"));
163
- }
164
- },
165
- children: P("botlit.agentDetail.actions.activate", "Activate")
166
- })
167
- }) : /* @__PURE__ */ x(l, {
168
- permission: c.AGENT_UPDATE,
169
- children: /* @__PURE__ */ x(s, {
170
- variant: "outline",
171
- isLoading: V.loading,
172
- onClick: async () => {
173
- try {
174
- if (!F) return;
175
- await B({
176
- agentId: F,
177
- input: { status: "DRAFT" }
178
- }), await z(), N.success(`${P("botlit.agentDetail.deactivate.successPrefix", "Agent")} "${R.name}" ${P("botlit.agentDetail.deactivate.successSuffix", "deactivated")}`);
179
- } catch (e) {
180
- N.error(e instanceof Error ? e.message : P("botlit.agentDetail.deactivate.error", "Failed to deactivate agent"));
181
- }
182
- },
183
- children: P("botlit.agentDetail.actions.deactivate", "Deactivate")
184
- })
272
+ children: D("botlit.agentApproval.requestAction", "Request activation")
273
+ }) : (Ne[M.status] ?? []).map((e) => /* @__PURE__ */ g(c, {
274
+ variant: e.variant,
275
+ isLoading: Ie.loading,
276
+ onClick: () => void qe(e),
277
+ children: $(e.key, M.name).label
278
+ }, e.key))
185
279
  }),
186
- /* @__PURE__ */ x(l, {
187
- permission: c.AGENT_UPDATE,
188
- children: /* @__PURE__ */ x(s, {
280
+ /* @__PURE__ */ g(f, {
281
+ permission: d.AGENT_UPDATE,
282
+ children: /* @__PURE__ */ g(c, {
189
283
  variant: "outline",
190
- leftIcon: /* @__PURE__ */ x(he, { size: 16 }),
191
- onClick: () => I(`agents/${F}/edit`),
192
- children: P("botlit.agentDetail.actions.editAgent", "Edit Agent")
284
+ leftIcon: /* @__PURE__ */ g(Ee, { size: 16 }),
285
+ onClick: () => A(k ? `bots/${k}/agents/${O}/edit` : `agents/${O}/edit`),
286
+ children: D("botlit.agentDetail.actions.editAgent", "Edit Agent")
193
287
  })
194
288
  }),
195
- /* @__PURE__ */ x(l, {
196
- permission: c.AGENT_EXECUTE,
197
- children: /* @__PURE__ */ x(s, {
198
- leftIcon: /* @__PURE__ */ x(E, { size: 16 }),
199
- onClick: () => I(`chat/${F}`),
200
- children: P("botlit.agentDetail.actions.testAgent", "Test Agent")
289
+ /* @__PURE__ */ g(f, {
290
+ permission: d.AGENT_EXECUTE,
291
+ children: /* @__PURE__ */ g(c, {
292
+ leftIcon: /* @__PURE__ */ g(x, { size: 16 }),
293
+ onClick: () => A(`chat/${O}`),
294
+ children: D("botlit.agentDetail.actions.testAgent", "Test Agent")
201
295
  })
202
296
  }),
203
- /* @__PURE__ */ x(l, {
204
- permission: c.AGENT_DELETE,
205
- children: /* @__PURE__ */ x(s, {
297
+ /* @__PURE__ */ g(f, {
298
+ permission: d.AGENT_DELETE,
299
+ children: /* @__PURE__ */ g(c, {
206
300
  variant: "destructive",
207
- leftIcon: /* @__PURE__ */ x(j, { size: 16 }),
208
- isLoading: xe.loading,
209
- onClick: async () => {
210
- if (F && confirm(`${P("botlit.agentDetail.delete.confirmPrefix", "Are you sure you want to delete")} "${R.name}"? ${P("botlit.agentDetail.delete.confirmSuffix", "This action cannot be undone.")}`)) try {
211
- await be(F), N.success(`${P("botlit.agentDetail.delete.successPrefix", "Agent")} "${R.name}" ${P("botlit.agentDetail.delete.successSuffix", "deleted successfully")}`), I("agents");
212
- } catch (e) {
213
- N.error(e instanceof Error ? e.message : P("botlit.agentDetail.delete.error", "Failed to delete agent"));
214
- }
215
- },
216
- children: P("botlit.common.delete", "Delete")
301
+ leftIcon: /* @__PURE__ */ g(je, { size: 16 }),
302
+ isLoading: Re.loading,
303
+ onClick: () => void Je(),
304
+ children: D("botlit.common.delete", "Delete")
217
305
  })
218
306
  })
219
307
  ]
220
308
  }),
221
- children: /* @__PURE__ */ S("div", {
222
- className: "space-y-6",
223
- children: [
224
- H === "assistant" && F && /* @__PURE__ */ S("div", {
225
- className: "space-y-5",
226
- children: [
227
- L(c.AGENT_UPDATE) && /* @__PURE__ */ x(f, {
228
- agentId: F,
229
- onConfigured: () => void z()
230
- }),
231
- L(c.AGENT_PUBLISH) && /* @__PURE__ */ S(de, { children: [/* @__PURE__ */ x(m, {
232
- agentId: F,
233
- knowledgeBaseIds: J
234
- }), /* @__PURE__ */ x(p, { agentId: F })] }),
235
- !L(c.AGENT_UPDATE) && !L(c.AGENT_PUBLISH) && /* @__PURE__ */ x("p", {
236
- role: "status",
237
- className: "text-sm text-text-secondary",
238
- children: P("botlit.agentDetail.assistant.readOnly", "Assistant setup and publishing are available to members who can edit or publish agents in this workspace.")
239
- })
240
- ]
241
- }),
242
- /* @__PURE__ */ x(ue, {
243
- icon: /* @__PURE__ */ x(w, { size: 18 }),
244
- children: P("botlit.agentDetail.purpose", "This is the full configuration for a single agent — its prompt, model settings, the tools and knowledge it can use, its guardrails and how it talks to other agents. Use the tabs to inspect or change any part, and test the agent in chat to confirm it behaves the way you expect before going live.")
245
- }),
246
- /* @__PURE__ */ x("div", {
247
- className: "flex gap-1 border-b border-border-subtle overflow-x-auto",
248
- children: we.map((e) => /* @__PURE__ */ S("button", {
249
- onClick: () => U(e.id),
250
- className: oe("flex items-center gap-2 px-4 py-2 text-sm font-medium border-b-2 transition-colors whitespace-nowrap", H === e.id ? "border-primary text-primary" : "border-transparent text-text-secondary hover:text-text-primary"),
251
- children: [e.icon, e.label]
252
- }, e.id))
253
- }),
254
- H === "overview" && /* @__PURE__ */ S("div", {
255
- className: "space-y-6",
256
- children: [
257
- /* @__PURE__ */ x(le, {
258
- storageKey: `botlit-agent-${F}`,
259
- steps: [
260
- {
261
- id: "test",
262
- label: P("botlit.agentDetail.nextSteps.test", "Test the agent in chat"),
263
- description: P("botlit.agentDetail.nextSteps.testDesc", "Send it a few real prompts to see how it responds."),
264
- icon: /* @__PURE__ */ x(E, { size: 16 }),
265
- onClick: () => I(`chat/${F}`)
266
- },
267
- {
268
- id: "prompt",
269
- label: P("botlit.agentDetail.nextSteps.prompt", "Refine the system prompt"),
270
- description: P("botlit.agentDetail.nextSteps.promptDesc", "Tune its instructions and behaviour."),
271
- icon: /* @__PURE__ */ x(T, { size: 16 }),
272
- onClick: () => U("prompt")
273
- },
274
- {
275
- id: "tools",
276
- label: P("botlit.agentDetail.nextSteps.tools", "Connect tools & knowledge"),
277
- description: P("botlit.agentDetail.nextSteps.toolsDesc", "Give it MCP tools and knowledge bases to work with."),
278
- icon: /* @__PURE__ */ x(M, { size: 16 }),
279
- onClick: () => U("tools")
280
- },
281
- {
282
- id: "activate",
283
- label: P("botlit.agentDetail.nextSteps.activate", "Activate and attach to a bot"),
284
- description: P("botlit.agentDetail.nextSteps.activateDesc", "Put it live so a bot can route conversations to it."),
285
- icon: /* @__PURE__ */ x(O, { size: 16 }),
286
- onClick: () => I(`agents/${F}/edit`),
287
- done: R.status === "ACTIVE"
288
- }
289
- ]
290
- }),
291
- F && /* @__PURE__ */ x(ie, {
292
- agentId: F,
293
- agentStatus: R.status,
294
- onChanged: () => void z()
295
- }),
296
- /* @__PURE__ */ S("div", {
297
- className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
298
- children: [
299
- /* @__PURE__ */ S(n, {
300
- className: "lg:col-span-1",
301
- children: [/* @__PURE__ */ x(a, { children: /* @__PURE__ */ x(o, { children: "Details" }) }), /* @__PURE__ */ S(r, {
302
- className: "space-y-4",
303
- children: [
304
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
305
- className: "text-sm text-text-secondary",
306
- children: "Status"
307
- }), /* @__PURE__ */ x(d, { status: R.status })] }),
308
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
309
- className: "text-sm text-text-secondary",
310
- children: "Type"
311
- }), /* @__PURE__ */ x(u, {
312
- variant: "outline",
313
- children: R.type
314
- })] }),
315
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
316
- className: "text-sm text-text-secondary",
317
- children: "Visibility"
318
- }), /* @__PURE__ */ x(u, {
319
- variant: "outline",
320
- children: R.visibility
321
- })] }),
322
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
323
- className: "text-sm text-text-secondary",
324
- children: "LLM Model"
325
- }), /* @__PURE__ */ x("p", {
326
- className: "font-medium font-mono text-sm",
327
- children: G || "Not configured"
328
- })] }),
329
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
330
- className: "text-sm text-text-secondary",
331
- children: "MCP Connections"
332
- }), /* @__PURE__ */ S("p", {
333
- className: "font-medium",
334
- children: [q.length, " servers"]
335
- })] }),
336
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
337
- className: "text-sm text-text-secondary",
338
- children: "Knowledge Bases"
339
- }), /* @__PURE__ */ S("p", {
340
- className: "font-medium",
341
- children: [J.length, " KBs"]
342
- })] }),
343
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
344
- className: "text-sm text-text-secondary",
345
- children: "Max Concurrent"
346
- }), /* @__PURE__ */ x("p", {
347
- className: "font-medium",
348
- children: Q
349
- })] }),
350
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
351
- className: "text-sm text-text-secondary",
352
- children: "Executions"
353
- }), /* @__PURE__ */ x("p", {
354
- className: "font-medium",
355
- children: R.executionCount ?? 0
356
- })] }),
357
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
358
- className: "text-sm text-text-secondary",
359
- children: "Created"
360
- }), /* @__PURE__ */ x("p", {
361
- className: "font-medium",
362
- children: b(R.createdAt)
363
- })] }),
364
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
365
- className: "text-sm text-text-secondary",
366
- children: "Updated"
367
- }), /* @__PURE__ */ x("p", {
368
- className: "font-medium",
369
- children: b(R.updatedAt)
370
- })] })
371
- ]
372
- })]
373
- }),
374
- /* @__PURE__ */ S(ce, {
375
- treatment: "glass",
376
- glow: !0,
377
- className: "lg:col-span-2 p-6",
378
- children: [/* @__PURE__ */ x("h3", {
379
- className: "mb-4 text-lg font-semibold tracking-tight text-text-primary",
380
- children: P("botlit.agentDetail.capabilities.title", "Capabilities")
381
- }), /* @__PURE__ */ x("div", { children: X.length > 0 ? /* @__PURE__ */ x("div", {
382
- className: "grid grid-cols-2 md:grid-cols-3 gap-4",
383
- children: X.map((e) => /* @__PURE__ */ S("div", {
384
- className: "p-3 rounded-lg border border-status-success-border bg-status-success-bg-subtle",
385
- children: [/* @__PURE__ */ x("p", {
386
- className: "font-medium",
387
- children: e
388
- }), /* @__PURE__ */ x(u, {
389
- variant: "success",
390
- children: P("botlit.agentDetail.capabilities.enabled", "Enabled")
391
- })]
392
- }, e))
393
- }) : /* @__PURE__ */ x("p", {
394
- className: "text-text-secondary",
395
- children: P("botlit.agentDetail.capabilities.empty", "No capabilities configured")
396
- }) })]
397
- }),
398
- Z.length > 0 && /* @__PURE__ */ S(n, {
399
- className: "lg:col-span-3",
400
- children: [/* @__PURE__ */ x(a, { children: /* @__PURE__ */ x(o, { children: P("botlit.agentDetail.tags.title", "Tags") }) }), /* @__PURE__ */ x(r, { children: /* @__PURE__ */ x("div", {
401
- className: "flex flex-wrap gap-2",
402
- children: Z.map((e) => /* @__PURE__ */ x(u, {
403
- variant: "outline",
404
- children: e
405
- }, e))
406
- }) })]
407
- })
408
- ]
409
- })
410
- ]
411
- }),
412
- H === "prompt" && /* @__PURE__ */ x("div", {
413
- className: "space-y-6",
414
- children: /* @__PURE__ */ S(n, { children: [/* @__PURE__ */ S(a, { children: [/* @__PURE__ */ S(o, {
415
- className: "flex items-center gap-2",
416
- children: [/* @__PURE__ */ x(T, { size: 18 }), P("botlit.agentDetail.prompt.title", "System Prompt")]
417
- }), /* @__PURE__ */ x(i, { children: P("botlit.agentDetail.prompt.description", "The system prompt that defines this agent's behavior") })] }), /* @__PURE__ */ x(r, {
418
- className: "space-y-4",
419
- children: W ? /* @__PURE__ */ x("pre", {
420
- className: "p-4 bg-bg-sunken rounded-lg text-sm whitespace-pre-wrap font-mono",
421
- children: W
422
- }) : /* @__PURE__ */ x("p", {
423
- className: "text-text-secondary",
424
- children: P("botlit.agentDetail.prompt.empty", "No system prompt configured")
425
- })
426
- })] })
427
- }),
428
- H === "llm" && /* @__PURE__ */ S("div", {
429
- className: "grid grid-cols-1 lg:grid-cols-2 gap-6",
430
- children: [/* @__PURE__ */ S(n, { children: [/* @__PURE__ */ x(a, { children: /* @__PURE__ */ S(o, {
431
- className: "flex items-center gap-2",
432
- children: [/* @__PURE__ */ x(w, { size: 18 }), P("botlit.agentDetail.llm.title", "Model Configuration")]
433
- }) }), /* @__PURE__ */ S(r, {
434
- className: "space-y-4",
309
+ children: [
310
+ Ke && /* @__PURE__ */ g("div", {
311
+ role: "status",
312
+ "data-testid": "agent-status-reason",
313
+ className: "mb-4 rounded-lg border border-status-warning-border bg-status-warning-bg-subtle p-3 text-sm text-text-primary",
314
+ children: Ke
315
+ }),
316
+ We.length > 0 && /* @__PURE__ */ _("div", {
317
+ role: "status",
318
+ "data-testid": "agent-knowledge-warning",
319
+ className: "mb-4 rounded-lg border border-status-warning-border bg-status-warning-bg-subtle p-3 text-sm text-text-primary",
320
+ children: [/* @__PURE__ */ g("p", {
321
+ className: "font-medium",
322
+ children: D("botlit.agentDetail.knowledgeWarning.title", "This agent cannot answer right now: a knowledge base it uses cannot be searched.")
323
+ }), /* @__PURE__ */ g("ul", {
324
+ className: "mt-1 list-disc pl-5",
325
+ children: We.map((e) => /* @__PURE__ */ g("li", { children: e.name === null ? D("botlit.agentDetail.knowledgeWarning.missing", "A knowledge base that no longer exists ({{id}}). Remove it from the agent.", { id: e.id }) : D("botlit.agentDetail.knowledgeWarning.notReady", "\"{{name}}\" is {{status}}.", {
326
+ name: e.name,
327
+ status: D(`botlit.status.${e.status.toLowerCase()}`, e.status.toLowerCase())
328
+ }) }, e.id))
329
+ })]
330
+ }),
331
+ /* @__PURE__ */ _("div", {
332
+ className: "space-y-6",
333
+ children: [
334
+ F === "assistant" && O && /* @__PURE__ */ _("div", {
335
+ className: "space-y-5",
435
336
  children: [
436
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
437
- className: "text-sm text-text-secondary",
438
- children: "LLM Model ID"
439
- }), /* @__PURE__ */ x("p", {
440
- className: "font-medium font-mono",
441
- children: G || "Not configured"
442
- })] }),
443
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
337
+ j(d.AGENT_UPDATE) && /* @__PURE__ */ g(oe, {
338
+ agentId: O,
339
+ onConfigured: () => void P()
340
+ }),
341
+ j(d.AGENT_PUBLISH) && /* @__PURE__ */ _(h, { children: [/* @__PURE__ */ g(ce, {
342
+ agentId: O,
343
+ knowledgeBaseIds: W
344
+ }), /* @__PURE__ */ g(se, { agentId: O })] }),
345
+ !j(d.AGENT_UPDATE) && !j(d.AGENT_PUBLISH) && /* @__PURE__ */ g("p", {
346
+ role: "status",
444
347
  className: "text-sm text-text-secondary",
445
- children: "Temperature"
446
- }), /* @__PURE__ */ x("p", {
447
- className: "font-medium",
448
- children: Ce ?? "Default"
449
- })] }),
450
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
451
- className: "text-sm text-text-secondary",
452
- children: "Max Tokens"
453
- }), /* @__PURE__ */ x("p", {
454
- className: "font-medium",
455
- children: K ?? "Default"
456
- })] })
348
+ children: D("botlit.agentDetail.assistant.readOnly", "Assistant setup and publishing are available to members who can edit or publish agents in this workspace.")
349
+ })
457
350
  ]
458
- })] }), /* @__PURE__ */ S(n, { children: [/* @__PURE__ */ x(a, { children: /* @__PURE__ */ S(o, {
459
- className: "flex items-center gap-2",
460
- children: [/* @__PURE__ */ x(ve, { size: 18 }), P("botlit.agentDetail.executionLimits.title", "Execution Limits")]
461
- }) }), /* @__PURE__ */ S(r, {
462
- className: "space-y-4",
351
+ }),
352
+ /* @__PURE__ */ g(Se, {
353
+ icon: /* @__PURE__ */ g(y, { size: 18 }),
354
+ children: D("botlit.agentDetail.purpose", "This is the full configuration for a single agent — its prompt, model settings, the tools and knowledge it can use, its guardrails and how it talks to other agents. Use the tabs to inspect or change any part, and test the agent in chat to confirm it behaves the way you expect before going live.")
355
+ }),
356
+ /* @__PURE__ */ g("div", {
357
+ className: "flex gap-1 border-b border-border-subtle overflow-x-auto",
358
+ children: Ye.map((e) => /* @__PURE__ */ _("button", {
359
+ onClick: () => I(e.id),
360
+ className: _e("flex items-center gap-2 px-4 py-2 text-sm font-medium border-b-2 transition-colors whitespace-nowrap", F === e.id ? "border-primary text-primary" : "border-transparent text-text-secondary hover:text-text-primary"),
361
+ children: [e.icon, e.label]
362
+ }, e.id))
363
+ }),
364
+ F === "overview" && /* @__PURE__ */ _("div", {
365
+ className: "space-y-6",
463
366
  children: [
464
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
465
- className: "text-sm text-text-secondary",
466
- children: "Max Concurrent Executions"
467
- }), /* @__PURE__ */ x("p", {
468
- className: "font-medium",
469
- children: Q
470
- })] }),
471
- /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
472
- className: "text-sm text-text-secondary",
473
- children: "Total Executions"
474
- }), /* @__PURE__ */ x("p", {
475
- className: "font-medium",
476
- children: R.executionCount ?? 0
477
- })] }),
478
- R.lastExecutedAt && /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
479
- className: "text-sm text-text-secondary",
480
- children: "Last Executed"
481
- }), /* @__PURE__ */ x("p", {
482
- className: "font-medium",
483
- children: b(R.lastExecutedAt)
484
- })] })
367
+ /* @__PURE__ */ g(xe, {
368
+ storageKey: `botlit-agent-${O}`,
369
+ steps: [
370
+ {
371
+ id: "test",
372
+ label: D("botlit.agentDetail.nextSteps.test", "Test the agent in chat"),
373
+ description: D("botlit.agentDetail.nextSteps.testDesc", "Send it a few real prompts to see how it responds."),
374
+ icon: /* @__PURE__ */ g(x, { size: 16 }),
375
+ onClick: () => A(`chat/${O}`)
376
+ },
377
+ {
378
+ id: "prompt",
379
+ label: D("botlit.agentDetail.nextSteps.prompt", "Refine the system prompt"),
380
+ description: D("botlit.agentDetail.nextSteps.promptDesc", "Tune its instructions and behaviour."),
381
+ icon: /* @__PURE__ */ g(b, { size: 16 }),
382
+ onClick: () => I("prompt")
383
+ },
384
+ {
385
+ id: "tools",
386
+ label: D("botlit.agentDetail.nextSteps.tools", "Connect tools & knowledge"),
387
+ description: D("botlit.agentDetail.nextSteps.toolsDesc", "Give it MCP tools and knowledge bases to work with."),
388
+ icon: /* @__PURE__ */ g(T, { size: 16 }),
389
+ onClick: () => I("tools")
390
+ },
391
+ {
392
+ id: "activate",
393
+ label: D("botlit.agentDetail.nextSteps.activate", "Activate and attach to a bot"),
394
+ description: D("botlit.agentDetail.nextSteps.activateDesc", "Put it live so a bot can route conversations to it."),
395
+ icon: /* @__PURE__ */ g(C, { size: 16 }),
396
+ onClick: () => A(`agents/${O}/edit`),
397
+ done: M.status === "ACTIVE"
398
+ }
399
+ ]
400
+ }),
401
+ O && /* @__PURE__ */ g(ie, {
402
+ agentId: O,
403
+ agentStatus: M.status,
404
+ onChanged: () => void P()
405
+ }),
406
+ /* @__PURE__ */ _("div", {
407
+ className: "grid grid-cols-1 lg:grid-cols-3 gap-6",
408
+ children: [
409
+ /* @__PURE__ */ _(r, {
410
+ className: "lg:col-span-1",
411
+ children: [/* @__PURE__ */ g(o, { children: /* @__PURE__ */ g(s, { children: "Details" }) }), /* @__PURE__ */ _(i, {
412
+ className: "space-y-4",
413
+ children: [
414
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
415
+ className: "text-sm text-text-secondary",
416
+ children: "Status"
417
+ }), /* @__PURE__ */ g(u, { status: M.status })] }),
418
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
419
+ className: "text-sm text-text-secondary",
420
+ children: "Type"
421
+ }), /* @__PURE__ */ g(l, {
422
+ variant: "outline",
423
+ children: M.type
424
+ })] }),
425
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
426
+ className: "text-sm text-text-secondary",
427
+ children: "Visibility"
428
+ }), /* @__PURE__ */ g(l, {
429
+ variant: "outline",
430
+ children: M.visibility
431
+ })] }),
432
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
433
+ className: "text-sm text-text-secondary",
434
+ children: "LLM Model"
435
+ }), /* @__PURE__ */ g("p", {
436
+ className: "font-medium font-mono text-sm",
437
+ children: H || "Not configured"
438
+ })] }),
439
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
440
+ className: "text-sm text-text-secondary",
441
+ children: "MCP Connections"
442
+ }), /* @__PURE__ */ _("p", {
443
+ className: "font-medium",
444
+ children: [U.length, " servers"]
445
+ })] }),
446
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
447
+ className: "text-sm text-text-secondary",
448
+ children: "Knowledge Bases"
449
+ }), /* @__PURE__ */ _("p", {
450
+ className: "font-medium",
451
+ children: [W.length, " KBs"]
452
+ })] }),
453
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
454
+ className: "text-sm text-text-secondary",
455
+ children: "Max Concurrent"
456
+ }), /* @__PURE__ */ g("p", {
457
+ className: "font-medium",
458
+ children: J
459
+ })] }),
460
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
461
+ className: "text-sm text-text-secondary",
462
+ children: "Executions"
463
+ }), /* @__PURE__ */ g("p", {
464
+ className: "font-medium",
465
+ children: M.executionCount ?? 0
466
+ })] }),
467
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
468
+ className: "text-sm text-text-secondary",
469
+ children: "Created"
470
+ }), /* @__PURE__ */ g("p", {
471
+ className: "font-medium",
472
+ children: p(M.createdAt)
473
+ })] }),
474
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
475
+ className: "text-sm text-text-secondary",
476
+ children: "Updated"
477
+ }), /* @__PURE__ */ g("p", {
478
+ className: "font-medium",
479
+ children: p(M.updatedAt)
480
+ })] })
481
+ ]
482
+ })]
483
+ }),
484
+ /* @__PURE__ */ _(be, {
485
+ treatment: "glass",
486
+ glow: !0,
487
+ className: "lg:col-span-2 p-6",
488
+ children: [/* @__PURE__ */ g("h3", {
489
+ className: "mb-4 text-lg font-semibold tracking-tight text-text-primary",
490
+ children: D("botlit.agentDetail.capabilities.title", "Capabilities")
491
+ }), /* @__PURE__ */ g("div", { children: K.length > 0 ? /* @__PURE__ */ g("div", {
492
+ className: "grid grid-cols-2 md:grid-cols-3 gap-4",
493
+ children: K.map((e) => /* @__PURE__ */ _("div", {
494
+ className: "p-3 rounded-lg border border-status-success-border bg-status-success-bg-subtle",
495
+ children: [/* @__PURE__ */ g("p", {
496
+ className: "font-medium",
497
+ children: e
498
+ }), /* @__PURE__ */ g(l, {
499
+ variant: "success",
500
+ children: D("botlit.agentDetail.capabilities.enabled", "Enabled")
501
+ })]
502
+ }, e))
503
+ }) : /* @__PURE__ */ g("p", {
504
+ className: "text-text-secondary",
505
+ children: D("botlit.agentDetail.capabilities.empty", "No capabilities configured")
506
+ }) })]
507
+ }),
508
+ q.length > 0 && /* @__PURE__ */ _(r, {
509
+ className: "lg:col-span-3",
510
+ children: [/* @__PURE__ */ g(o, { children: /* @__PURE__ */ g(s, { children: D("botlit.agentDetail.tags.title", "Tags") }) }), /* @__PURE__ */ g(i, { children: /* @__PURE__ */ g("div", {
511
+ className: "flex flex-wrap gap-2",
512
+ children: q.map((e) => /* @__PURE__ */ g(l, {
513
+ variant: "outline",
514
+ children: e
515
+ }, e))
516
+ }) })]
517
+ })
518
+ ]
519
+ })
485
520
  ]
486
- })] })]
487
- }),
488
- H === "tools" && /* @__PURE__ */ S("div", {
489
- className: "space-y-6",
490
- children: [/* @__PURE__ */ S(n, { children: [/* @__PURE__ */ S(a, { children: [/* @__PURE__ */ S(o, {
491
- className: "flex items-center gap-2",
492
- children: [/* @__PURE__ */ x(M, { size: 18 }), "MCP Server Connections"]
493
- }), /* @__PURE__ */ x(i, { children: "Connected MCP servers providing tools" })] }), /* @__PURE__ */ x(r, { children: q.length > 0 ? /* @__PURE__ */ x("div", {
494
- className: "grid grid-cols-1 md:grid-cols-2 gap-4",
495
- children: q.map((e) => /* @__PURE__ */ S("div", {
496
- className: "flex items-center gap-3 p-4 border border-border-subtle rounded-lg",
497
- children: [/* @__PURE__ */ x("div", {
498
- className: "p-2 bg-action-primary-bg/10 rounded-lg",
499
- children: /* @__PURE__ */ x(M, {
500
- size: 18,
501
- className: "text-primary"
521
+ }),
522
+ F === "prompt" && /* @__PURE__ */ g("div", {
523
+ className: "space-y-6",
524
+ children: /* @__PURE__ */ _(r, { children: [/* @__PURE__ */ _(o, { children: [/* @__PURE__ */ _(s, {
525
+ className: "flex items-center gap-2",
526
+ children: [/* @__PURE__ */ g(b, { size: 18 }), D("botlit.agentDetail.prompt.title", "System Prompt")]
527
+ }), /* @__PURE__ */ g(a, { children: D("botlit.agentDetail.prompt.description", "The system prompt that defines this agent's behavior") })] }), /* @__PURE__ */ g(i, {
528
+ className: "space-y-4",
529
+ children: V ? /* @__PURE__ */ g("pre", {
530
+ className: "p-4 bg-bg-sunken rounded-lg text-sm whitespace-pre-wrap font-mono",
531
+ children: V
532
+ }) : /* @__PURE__ */ g("p", {
533
+ className: "text-text-secondary",
534
+ children: D("botlit.agentDetail.prompt.empty", "No system prompt configured")
535
+ })
536
+ })] })
537
+ }),
538
+ F === "llm" && /* @__PURE__ */ _("div", {
539
+ className: "grid grid-cols-1 lg:grid-cols-2 gap-6",
540
+ children: [/* @__PURE__ */ _(r, { children: [/* @__PURE__ */ g(o, { children: /* @__PURE__ */ _(s, {
541
+ className: "flex items-center gap-2",
542
+ children: [/* @__PURE__ */ g(y, { size: 18 }), D("botlit.agentDetail.llm.title", "Model Configuration")]
543
+ }) }), /* @__PURE__ */ _(i, {
544
+ className: "space-y-4",
545
+ children: [
546
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
547
+ className: "text-sm text-text-secondary",
548
+ children: "LLM Model ID"
549
+ }), /* @__PURE__ */ g("p", {
550
+ className: "font-medium font-mono",
551
+ children: H || "Not configured"
552
+ })] }),
553
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
554
+ className: "text-sm text-text-secondary",
555
+ children: "Temperature"
556
+ }), /* @__PURE__ */ g("p", {
557
+ className: "font-medium",
558
+ children: He ?? "Default"
559
+ })] }),
560
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
561
+ className: "text-sm text-text-secondary",
562
+ children: "Max Tokens"
563
+ }), /* @__PURE__ */ g("p", {
564
+ className: "font-medium",
565
+ children: Ue ?? "Default"
566
+ })] })
567
+ ]
568
+ })] }), /* @__PURE__ */ _(r, { children: [/* @__PURE__ */ g(o, { children: /* @__PURE__ */ _(s, {
569
+ className: "flex items-center gap-2",
570
+ children: [/* @__PURE__ */ g(ke, { size: 18 }), D("botlit.agentDetail.executionLimits.title", "Execution Limits")]
571
+ }) }), /* @__PURE__ */ _(i, {
572
+ className: "space-y-4",
573
+ children: [
574
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
575
+ className: "text-sm text-text-secondary",
576
+ children: "Max Concurrent Executions"
577
+ }), /* @__PURE__ */ g("p", {
578
+ className: "font-medium",
579
+ children: J
580
+ })] }),
581
+ /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
582
+ className: "text-sm text-text-secondary",
583
+ children: "Total Executions"
584
+ }), /* @__PURE__ */ g("p", {
585
+ className: "font-medium",
586
+ children: M.executionCount ?? 0
587
+ })] }),
588
+ M.lastExecutedAt && /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
589
+ className: "text-sm text-text-secondary",
590
+ children: "Last Executed"
591
+ }), /* @__PURE__ */ g("p", {
592
+ className: "font-medium",
593
+ children: p(M.lastExecutedAt)
594
+ })] })
595
+ ]
596
+ })] })]
597
+ }),
598
+ F === "tools" && /* @__PURE__ */ _("div", {
599
+ className: "space-y-6",
600
+ children: [/* @__PURE__ */ _(r, { children: [/* @__PURE__ */ _(o, { children: [/* @__PURE__ */ _(s, {
601
+ className: "flex items-center gap-2",
602
+ children: [/* @__PURE__ */ g(T, { size: 18 }), "MCP Server Connections"]
603
+ }), /* @__PURE__ */ g(a, { children: "Connected MCP servers providing tools" })] }), /* @__PURE__ */ g(i, { children: U.length > 0 ? /* @__PURE__ */ g("div", {
604
+ className: "grid grid-cols-1 md:grid-cols-2 gap-4",
605
+ children: U.map((e) => /* @__PURE__ */ _("div", {
606
+ className: "flex items-center gap-3 p-4 border border-border-subtle rounded-lg",
607
+ children: [/* @__PURE__ */ g("div", {
608
+ className: "p-2 bg-action-primary-bg/10 rounded-lg",
609
+ children: /* @__PURE__ */ g(T, {
610
+ size: 18,
611
+ className: "text-primary"
612
+ })
613
+ }), /* @__PURE__ */ _("div", { children: [/* @__PURE__ */ g("p", {
614
+ className: "font-medium",
615
+ children: Ge(e, Z, L, "botlit.agentDetail.tools.unavailable")
616
+ }), !Z.has(e) && /* @__PURE__ */ g("p", {
617
+ className: "text-sm text-text-secondary font-mono",
618
+ children: e
619
+ })] })]
620
+ }, e))
621
+ }) : /* @__PURE__ */ _("p", {
622
+ className: "text-text-secondary",
623
+ children: [D("botlit.agentDetail.tools.none", "No MCP servers connected."), j(d.AGENT_UPDATE) && ` ${D("botlit.agentDetail.tools.attachHint", "Attach servers from Edit Agent.")}`]
624
+ }) })] }), G.length > 0 && /* @__PURE__ */ _(r, { children: [/* @__PURE__ */ g(o, { children: /* @__PURE__ */ _(s, {
625
+ className: "flex items-center gap-2",
626
+ children: [/* @__PURE__ */ g(S, { size: 18 }), "Workflows"]
627
+ }) }), /* @__PURE__ */ g(i, { children: /* @__PURE__ */ g("div", {
628
+ className: "grid grid-cols-1 md:grid-cols-2 gap-4",
629
+ children: G.map((e) => /* @__PURE__ */ g("div", {
630
+ className: "p-4 border border-border-subtle rounded-lg",
631
+ children: /* @__PURE__ */ g("p", {
632
+ className: "font-mono text-sm",
633
+ children: e
502
634
  })
503
- }), /* @__PURE__ */ S("div", { children: [/* @__PURE__ */ x("p", {
504
- className: "font-medium",
505
- children: "MCP Server"
506
- }), /* @__PURE__ */ x("p", {
507
- className: "text-sm text-text-secondary font-mono",
635
+ }, e))
636
+ }) })] })]
637
+ }),
638
+ F === "knowledge" && /* @__PURE__ */ _(r, { children: [/* @__PURE__ */ _(o, { children: [/* @__PURE__ */ _(s, {
639
+ className: "flex items-center gap-2",
640
+ children: [/* @__PURE__ */ g(v, { size: 18 }), "Knowledge Bases"]
641
+ }), /* @__PURE__ */ g(a, { children: "Connected knowledge bases for RAG" })] }), /* @__PURE__ */ g(i, { children: W.length > 0 ? /* @__PURE__ */ g("div", {
642
+ className: "space-y-4",
643
+ children: W.map((e, t) => /* @__PURE__ */ _("div", {
644
+ className: "p-4 border border-border-subtle rounded-lg space-y-2",
645
+ children: [/* @__PURE__ */ _("div", {
646
+ className: "flex items-center justify-between",
647
+ children: [/* @__PURE__ */ g("p", {
648
+ className: "font-medium",
649
+ children: Ge(e, Q, R, "botlit.agentDetail.knowledge.unavailable")
650
+ }), /* @__PURE__ */ _(l, {
651
+ variant: "outline",
652
+ children: ["#", t + 1]
653
+ })]
654
+ }), !Q.has(e) && /* @__PURE__ */ g("p", {
655
+ className: "font-mono text-sm",
508
656
  children: e
509
- })] })]
657
+ })]
510
658
  }, e))
511
- }) : /* @__PURE__ */ x("p", {
659
+ }) : /* @__PURE__ */ _("p", {
512
660
  className: "text-text-secondary",
513
- children: "No MCP servers connected"
514
- }) })] }), Y.length > 0 && /* @__PURE__ */ S(n, { children: [/* @__PURE__ */ x(a, { children: /* @__PURE__ */ S(o, {
661
+ children: [D("botlit.agentDetail.knowledge.none", "No knowledge bases connected."), j(d.AGENT_UPDATE) && ` ${D("botlit.agentDetail.knowledge.attachHint", "Attach knowledge bases from Edit Agent.")}`]
662
+ }) })] }),
663
+ F === "handoff" && O && /* @__PURE__ */ g("div", {
664
+ className: "mx-auto w-full max-w-3xl",
665
+ children: /* @__PURE__ */ g(n, { agentId: O })
666
+ }),
667
+ F === "guardrails" && /* @__PURE__ */ _(r, { children: [/* @__PURE__ */ _(o, { children: [/* @__PURE__ */ _(s, {
515
668
  className: "flex items-center gap-2",
516
- children: [/* @__PURE__ */ x(D, { size: 18 }), "Workflows"]
517
- }) }), /* @__PURE__ */ x(r, { children: /* @__PURE__ */ x("div", {
669
+ children: [/* @__PURE__ */ g(w, { size: 18 }), "Guardrails & Policies"]
670
+ }), /* @__PURE__ */ g(a, { children: "Security and policy configurations" })] }), /* @__PURE__ */ g(i, { children: Y ? /* @__PURE__ */ g("div", {
518
671
  className: "grid grid-cols-1 md:grid-cols-2 gap-4",
519
- children: Y.map((e) => /* @__PURE__ */ x("div", {
672
+ children: Object.entries(Y).filter(([e, t]) => t).map(([e, t]) => /* @__PURE__ */ _("div", {
520
673
  className: "p-4 border border-border-subtle rounded-lg",
521
- children: /* @__PURE__ */ x("p", {
674
+ children: [/* @__PURE__ */ g("p", {
675
+ className: "text-sm text-text-secondary capitalize",
676
+ children: e.replace("Id", "").replace(/([A-Z])/g, " $1").trim()
677
+ }), /* @__PURE__ */ g("p", {
522
678
  className: "font-mono text-sm",
523
- children: e
524
- })
525
- }, e))
526
- }) })] })]
527
- }),
528
- H === "knowledge" && /* @__PURE__ */ S(n, { children: [/* @__PURE__ */ S(a, { children: [/* @__PURE__ */ S(o, {
529
- className: "flex items-center gap-2",
530
- children: [/* @__PURE__ */ x(C, { size: 18 }), "Knowledge Bases"]
531
- }), /* @__PURE__ */ x(i, { children: "Connected knowledge bases for RAG" })] }), /* @__PURE__ */ x(r, { children: J.length > 0 ? /* @__PURE__ */ x("div", {
532
- className: "space-y-4",
533
- children: J.map((e, t) => /* @__PURE__ */ S("div", {
534
- className: "p-4 border border-border-subtle rounded-lg space-y-2",
535
- children: [/* @__PURE__ */ S("div", {
536
- className: "flex items-center justify-between",
537
- children: [/* @__PURE__ */ x("p", {
538
- className: "font-medium",
539
- children: "Knowledge Base"
540
- }), /* @__PURE__ */ S(u, {
541
- variant: "outline",
542
- children: ["#", t + 1]
679
+ children: String(t)
543
680
  })]
544
- }), /* @__PURE__ */ x("p", {
545
- className: "font-mono text-sm",
546
- children: e
547
- })]
548
- }, t))
549
- }) : /* @__PURE__ */ x("p", {
550
- className: "text-text-secondary",
551
- children: "No knowledge bases connected"
552
- }) })] }),
553
- H === "handoff" && F && /* @__PURE__ */ x("div", {
554
- className: "mx-auto w-full max-w-3xl",
555
- children: /* @__PURE__ */ x(ee, { agentId: F })
556
- }),
557
- H === "guardrails" && /* @__PURE__ */ S(n, { children: [/* @__PURE__ */ S(a, { children: [/* @__PURE__ */ S(o, {
558
- className: "flex items-center gap-2",
559
- children: [/* @__PURE__ */ x(k, { size: 18 }), "Guardrails & Policies"]
560
- }), /* @__PURE__ */ x(i, { children: "Security and policy configurations" })] }), /* @__PURE__ */ x(r, { children: $ ? /* @__PURE__ */ x("div", {
561
- className: "grid grid-cols-1 md:grid-cols-2 gap-4",
562
- children: Object.entries($).filter(([e, t]) => t).map(([e, t]) => /* @__PURE__ */ S("div", {
563
- className: "p-4 border border-border-subtle rounded-lg",
564
- children: [/* @__PURE__ */ x("p", {
565
- className: "text-sm text-text-secondary capitalize",
566
- children: e.replace("Id", "").replace(/([A-Z])/g, " $1").trim()
567
- }), /* @__PURE__ */ x("p", {
568
- className: "font-mono text-sm",
569
- children: String(t)
570
- })]
571
- }, e))
572
- }) : /* @__PURE__ */ x("p", {
573
- className: "text-text-secondary",
574
- children: "No policy bindings configured"
575
- }) })] }),
576
- H === "aiOperations" && F && /* @__PURE__ */ x(h, {
577
- filter: {
578
- subjectType: "AGENT",
579
- subjectId: F
580
- },
581
- description: P("botlit.agentDetail.aiOperationsDescription", "What the supervisor flagged for this agent — drift, evidence and the recommended action.")
582
- }),
583
- H === "a2a" && /* @__PURE__ */ S(n, { children: [/* @__PURE__ */ S(a, { children: [/* @__PURE__ */ S(o, {
584
- className: "flex items-center gap-2",
585
- children: [/* @__PURE__ */ x(O, { size: 18 }), "A2A Configuration"]
586
- }), /* @__PURE__ */ x(i, { children: "Agent-to-Agent communication settings" })] }), /* @__PURE__ */ x(r, { children: /* @__PURE__ */ x("p", {
587
- className: "text-text-secondary",
588
- children: "A2A is not enabled for this agent"
589
- }) })] }),
590
- H === "versions" && F && /* @__PURE__ */ x(re, {
591
- agentId: F,
592
- draftVersionId: R.draftVersionId,
593
- currentVersionId: R.currentVersionId,
594
- onChanged: () => void z()
595
- })
596
- ]
597
- })
681
+ }, e))
682
+ }) : /* @__PURE__ */ g("p", {
683
+ className: "text-text-secondary",
684
+ children: "No policy bindings configured"
685
+ }) })] }),
686
+ F === "aiOperations" && O && /* @__PURE__ */ g(le, {
687
+ filter: {
688
+ subjectType: "AGENT",
689
+ subjectId: O
690
+ },
691
+ description: D("botlit.agentDetail.aiOperationsDescription", "What the supervisor flagged for this agent — drift, evidence and the recommended action.")
692
+ }),
693
+ F === "a2a" && /* @__PURE__ */ _(r, { children: [/* @__PURE__ */ _(o, { children: [/* @__PURE__ */ _(s, {
694
+ className: "flex items-center gap-2",
695
+ children: [/* @__PURE__ */ g(C, { size: 18 }), "A2A Configuration"]
696
+ }), /* @__PURE__ */ g(a, { children: "Agent-to-Agent communication settings" })] }), /* @__PURE__ */ g(i, { children: /* @__PURE__ */ g("p", {
697
+ className: "text-text-secondary",
698
+ children: "A2A is not enabled for this agent"
699
+ }) })] }),
700
+ F === "versions" && O && /* @__PURE__ */ g(re, {
701
+ agentId: O,
702
+ draftVersionId: M.draftVersionId,
703
+ currentVersionId: M.currentVersionId,
704
+ onChanged: () => void P()
705
+ })
706
+ ]
707
+ })
708
+ ]
598
709
  });
599
710
  };
600
- export { P as AgentDetailPage };
711
+ export { j as AgentDetailPage };
601
712
 
602
713
  //# sourceMappingURL=AgentDetailPage.js.map