@burdenoff/microfe-botmanor 2026.1025.3 → 2026.1027.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.
@@ -9,124 +9,132 @@ import { Card as l, CardContent as u } from "../components/Card.js";
9
9
  import { Button as d } from "../components/Button.js";
10
10
  import { StatusBadge as f } from "../components/Badge.js";
11
11
  import { isNative as p, nativeConfirm as m, nativeImpact as h, nativeNotify as g } from "../../utils/nativeBridge.js";
12
- import { EmptyState as ee } from "../components/EmptyState.js";
13
- import { Input as _ } from "../components/Input.js";
14
- import { ErrorState as v } from "../components/ErrorState.js";
15
- import { useState as y } from "react";
16
- import { GlassCard as b, PagePurpose as x } from "@burdenoff/fe-libs/ui";
17
- import { jsx as S, jsxs as C } from "react/jsx-runtime";
18
- import { Link as w, useParams as T } from "react-router";
19
- import { Bot as E, Grid3X3 as D, List as O, MessageSquare as k, MoreVertical as A, Play as j, Plus as M, Search as N, Settings as P, Trash2 as F } from "lucide-react";
20
- import { toast as I } from "sonner";
12
+ import { EmptyState as _ } from "../components/EmptyState.js";
13
+ import { Input as v } from "../components/Input.js";
14
+ import { ErrorState as y } from "../components/ErrorState.js";
15
+ import { useState as b } from "react";
16
+ import { GlassCard as x, PagePurpose as S } from "@burdenoff/fe-libs/ui";
17
+ import { jsx as C, jsxs as w } from "react/jsx-runtime";
18
+ import { Link as T, useParams as E } from "react-router";
19
+ import { Bot as D, Grid3X3 as ee, List as O, MessageSquare as k, MoreVertical as A, Play as j, Plus as M, Search as N, Settings as P, ShieldCheck as F, Trash2 as I } from "lucide-react";
20
+ import { toast as L } from "sonner";
21
21
  //#region src/botlit/pages/AgentsListPage.tsx
22
- var L = () => {
23
- let L = e(), { botId: R } = T(), { navigateTo: z, getPath: B } = t(), { data: V, loading: H, error: U, refetch: W } = r(), [G] = i(), { viewMode: K, setViewMode: q, agentFilter: J, updateAgentFilter: Y } = n(), [X, Z] = y(null), Q = (e) => {
24
- Y({ search: e.target.value });
25
- }, te = async (e) => {
22
+ var R = () => {
23
+ let R = e(), { botId: z } = E(), { navigateTo: B, getPath: V } = t(), { data: H, loading: U, error: W, refetch: G } = r(), [K] = i(), { viewMode: q, setViewMode: J, agentFilter: Y, updateAgentFilter: X } = n(), [Z, Q] = b(null), te = (e) => {
24
+ X({ search: e.target.value });
25
+ }, ne = async (e) => {
26
26
  let t = await m({
27
- title: L("botlit.agentsList.delete.title", "Delete agent?"),
28
- message: L("botlit.agentsList.delete.message", "Are you sure you want to delete \"{{name}}\"?", { name: e.name }),
29
- okButtonTitle: L("botlit.agentsList.delete.okButton", "Delete"),
30
- cancelButtonTitle: L("botlit.agentsList.delete.cancelButton", "Cancel")
27
+ title: R("botlit.agentsList.delete.title", "Delete agent?"),
28
+ message: R("botlit.agentsList.delete.message", "Are you sure you want to delete \"{{name}}\"?", { name: e.name }),
29
+ okButtonTitle: R("botlit.agentsList.delete.okButton", "Delete"),
30
+ cancelButtonTitle: R("botlit.agentsList.delete.cancelButton", "Cancel")
31
31
  });
32
- if (t === null ? confirm(L("botlit.agentsList.delete.message", "Are you sure you want to delete \"{{name}}\"?", { name: e.name })) : t) {
32
+ if (t === null ? confirm(R("botlit.agentsList.delete.message", "Are you sure you want to delete \"{{name}}\"?", { name: e.name })) : t) {
33
33
  h("medium");
34
34
  try {
35
- await G(e.id), I.success(L("botlit.agentsList.delete.success", "Agent \"{{name}}\" deleted successfully", { name: e.name })), p() && g("success");
35
+ await K(e.id), L.success(R("botlit.agentsList.delete.success", "Agent \"{{name}}\" deleted successfully", { name: e.name })), p() && g("success");
36
36
  } catch (e) {
37
- let t = e instanceof Error ? e.message : L("botlit.agentsList.delete.error", "Failed to delete agent");
38
- I.error(t), p() && g("error");
37
+ let t = e instanceof Error ? e.message : R("botlit.agentsList.delete.error", "Failed to delete agent");
38
+ L.error(t), p() && g("error");
39
39
  }
40
40
  }
41
- Z(null);
42
- }, $ = V.filter((e) => {
43
- if (J.search) {
44
- let t = J.search.toLowerCase();
41
+ Q(null);
42
+ }, $ = H.filter((e) => {
43
+ if (Y.search) {
44
+ let t = Y.search.toLowerCase();
45
45
  return e.name.toLowerCase().includes(t) || (e.description?.toLowerCase().includes(t) ?? !1);
46
46
  }
47
47
  return !0;
48
48
  });
49
- return /* @__PURE__ */ S(c, {
50
- title: R ? L("botlit.agentsList.titleBot", "Bot Agents") : L("botlit.agentsList.title", "All Agents"),
51
- description: R ? L("botlit.agentsList.descriptionBot", "Manage agents for this bot") : L("botlit.agentsList.description", "View and manage all your AI agents"),
52
- actions: /* @__PURE__ */ S(d, {
53
- leftIcon: /* @__PURE__ */ S(M, { size: 16 }),
54
- onClick: () => z(R ? `bots/${R}/agents/new` : "agents/new"),
55
- children: L("botlit.agentsList.actions.createAgent", "Create Agent")
49
+ return /* @__PURE__ */ C(c, {
50
+ title: z ? R("botlit.agentsList.titleBot", "Bot Agents") : R("botlit.agentsList.title", "All Agents"),
51
+ description: z ? R("botlit.agentsList.descriptionBot", "Manage agents for this bot") : R("botlit.agentsList.description", "View and manage all your AI agents"),
52
+ actions: /* @__PURE__ */ w("div", {
53
+ className: "flex gap-2",
54
+ children: [/* @__PURE__ */ C(d, {
55
+ variant: "outline",
56
+ leftIcon: /* @__PURE__ */ C(F, { size: 16 }),
57
+ onClick: () => B("agents/approvals"),
58
+ children: R("botlit.agentsList.actions.approvals", "Approvals")
59
+ }), /* @__PURE__ */ C(d, {
60
+ leftIcon: /* @__PURE__ */ C(M, { size: 16 }),
61
+ onClick: () => B(z ? `bots/${z}/agents/new` : "agents/new"),
62
+ children: R("botlit.agentsList.actions.createAgent", "Create Agent")
63
+ })]
56
64
  }),
57
- children: /* @__PURE__ */ C("div", {
65
+ children: /* @__PURE__ */ w("div", {
58
66
  className: "space-y-6",
59
67
  children: [
60
- /* @__PURE__ */ S(x, {
61
- icon: /* @__PURE__ */ S(E, { size: 18 }),
62
- children: L("botlit.agentsList.purpose", "Agents are the reasoning workers behind your bots — each one bundles a model, a system prompt, tools and knowledge into a callable AI. Build an agent here to handle a specific job (answer support questions, summarise documents, run a workflow), then test it in chat and connect it to a bot or channel.")
68
+ /* @__PURE__ */ C(S, {
69
+ icon: /* @__PURE__ */ C(D, { size: 18 }),
70
+ children: R("botlit.agentsList.purpose", "Agents are the reasoning workers behind your bots — each one bundles a model, a system prompt, tools and knowledge into a callable AI. Build an agent here to handle a specific job (answer support questions, summarise documents, run a workflow), then test it in chat and connect it to a bot or channel.")
63
71
  }),
64
- V.length > 0 ? /* @__PURE__ */ C("div", {
72
+ H.length > 0 ? /* @__PURE__ */ w("div", {
65
73
  className: "grid grid-cols-2 gap-4 sm:grid-cols-3",
66
74
  children: [
67
- /* @__PURE__ */ C(b, {
75
+ /* @__PURE__ */ w(x, {
68
76
  treatment: "glass",
69
77
  glow: !0,
70
78
  className: "p-4",
71
- children: [/* @__PURE__ */ S("p", {
79
+ children: [/* @__PURE__ */ C("p", {
72
80
  className: "text-sm text-text-secondary",
73
- children: L("botlit.agentsList.summary.total", "Total agents")
74
- }), /* @__PURE__ */ S("p", {
81
+ children: R("botlit.agentsList.summary.total", "Total agents")
82
+ }), /* @__PURE__ */ C("p", {
75
83
  className: "mt-1 text-2xl font-semibold tabular-nums text-text-primary",
76
- children: V.length
84
+ children: H.length
77
85
  })]
78
86
  }),
79
- /* @__PURE__ */ C(b, {
87
+ /* @__PURE__ */ w(x, {
80
88
  treatment: "metric",
81
89
  className: "p-4",
82
- children: [/* @__PURE__ */ S("p", {
90
+ children: [/* @__PURE__ */ C("p", {
83
91
  className: "text-sm text-text-secondary",
84
- children: L("botlit.agentsList.summary.active", "Active")
85
- }), /* @__PURE__ */ S("p", {
92
+ children: R("botlit.agentsList.summary.active", "Active")
93
+ }), /* @__PURE__ */ C("p", {
86
94
  className: "mt-1 text-2xl font-semibold tabular-nums text-text-primary",
87
- children: V.filter((e) => e.status === "ACTIVE").length
95
+ children: H.filter((e) => e.status === "ACTIVE").length
88
96
  })]
89
97
  }),
90
- /* @__PURE__ */ C(b, {
98
+ /* @__PURE__ */ w(x, {
91
99
  treatment: "metric",
92
100
  className: "col-span-2 p-4 sm:col-span-1",
93
- children: [/* @__PURE__ */ S("p", {
101
+ children: [/* @__PURE__ */ C("p", {
94
102
  className: "text-sm text-text-secondary",
95
- children: L("botlit.agentsList.summary.executions", "Total executions")
96
- }), /* @__PURE__ */ S("p", {
103
+ children: R("botlit.agentsList.summary.executions", "Total executions")
104
+ }), /* @__PURE__ */ C("p", {
97
105
  className: "mt-1 text-2xl font-semibold tabular-nums text-text-primary",
98
- children: o(V.reduce((e, t) => e + (t.executionCount ?? 0), 0))
106
+ children: o(H.reduce((e, t) => e + (t.executionCount ?? 0), 0))
99
107
  })]
100
108
  })
101
109
  ]
102
110
  }) : null,
103
- /* @__PURE__ */ C("div", {
111
+ /* @__PURE__ */ w("div", {
104
112
  className: "flex items-center justify-between gap-4",
105
- children: [/* @__PURE__ */ C("div", {
113
+ children: [/* @__PURE__ */ w("div", {
106
114
  className: "relative flex-1 max-w-md",
107
- children: [/* @__PURE__ */ S(N, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-text-secondary" }), /* @__PURE__ */ S(_, {
108
- placeholder: L("botlit.agentsList.searchPlaceholder", "Search agents..."),
109
- value: J.search || "",
110
- onChange: Q,
115
+ children: [/* @__PURE__ */ C(N, { className: "absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-text-secondary" }), /* @__PURE__ */ C(v, {
116
+ placeholder: R("botlit.agentsList.searchPlaceholder", "Search agents..."),
117
+ value: Y.search || "",
118
+ onChange: te,
111
119
  className: "pl-9"
112
120
  })]
113
- }), /* @__PURE__ */ C("div", {
121
+ }), /* @__PURE__ */ w("div", {
114
122
  className: "flex items-center gap-2",
115
- children: [/* @__PURE__ */ S(d, {
116
- variant: K === "grid" ? "secondary" : "ghost",
123
+ children: [/* @__PURE__ */ C(d, {
124
+ variant: q === "grid" ? "secondary" : "ghost",
117
125
  size: "icon",
118
- onClick: () => q("grid"),
119
- children: /* @__PURE__ */ S(D, { size: 18 })
120
- }), /* @__PURE__ */ S(d, {
121
- variant: K === "list" ? "secondary" : "ghost",
126
+ onClick: () => J("grid"),
127
+ children: /* @__PURE__ */ C(ee, { size: 18 })
128
+ }), /* @__PURE__ */ C(d, {
129
+ variant: q === "list" ? "secondary" : "ghost",
122
130
  size: "icon",
123
- onClick: () => q("list"),
124
- children: /* @__PURE__ */ S(O, { size: 18 })
131
+ onClick: () => J("list"),
132
+ children: /* @__PURE__ */ C(O, { size: 18 })
125
133
  })]
126
134
  })]
127
135
  }),
128
- H ? /* @__PURE__ */ S("div", {
129
- className: a("gap-4", K === "grid" ? "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3" : "flex flex-col"),
136
+ U ? /* @__PURE__ */ C("div", {
137
+ className: a("gap-4", q === "grid" ? "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3" : "flex flex-col"),
130
138
  children: [
131
139
  1,
132
140
  2,
@@ -134,144 +142,144 @@ var L = () => {
134
142
  4,
135
143
  5,
136
144
  6
137
- ].map((e) => /* @__PURE__ */ S("div", { className: "h-48 bg-bg-sunken motion-safe:animate-vc-shimmer rounded-lg" }, e))
138
- }) : U ? /* @__PURE__ */ S(v, {
145
+ ].map((e) => /* @__PURE__ */ C("div", { className: "h-48 bg-bg-sunken motion-safe:animate-vc-shimmer rounded-lg" }, e))
146
+ }) : W ? /* @__PURE__ */ C(y, {
139
147
  resource: "agents",
140
- error: U,
141
- onRetry: () => void W()
142
- }) : $.length > 0 ? K === "grid" ? /* @__PURE__ */ S("div", {
148
+ error: W,
149
+ onRetry: () => void G()
150
+ }) : $.length > 0 ? q === "grid" ? /* @__PURE__ */ C("div", {
143
151
  className: "grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4",
144
- children: $.map((e) => /* @__PURE__ */ S(l, {
152
+ children: $.map((e) => /* @__PURE__ */ C(l, {
145
153
  className: "group hover:shadow-md transition-shadow cursor-pointer relative",
146
- onClick: () => z(`agents/${e.id}`),
147
- children: /* @__PURE__ */ C(u, {
154
+ onClick: () => B(`agents/${e.id}`),
155
+ children: /* @__PURE__ */ w(u, {
148
156
  className: "pt-6",
149
157
  children: [
150
- /* @__PURE__ */ C("div", {
158
+ /* @__PURE__ */ w("div", {
151
159
  className: "flex items-start justify-between",
152
- children: [/* @__PURE__ */ C("div", {
160
+ children: [/* @__PURE__ */ w("div", {
153
161
  className: "flex items-center gap-3",
154
- children: [/* @__PURE__ */ S("span", {
162
+ children: [/* @__PURE__ */ C("span", {
155
163
  className: "text-4xl",
156
164
  children: "🤖"
157
- }), /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ S("h3", {
165
+ }), /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ C("h3", {
158
166
  className: "font-semibold text-text-primary",
159
167
  children: e.name
160
- }), /* @__PURE__ */ S("div", {
168
+ }), /* @__PURE__ */ C("div", {
161
169
  className: "flex items-center gap-2 mt-1",
162
- children: /* @__PURE__ */ S(f, { status: e.status })
170
+ children: /* @__PURE__ */ C(f, { status: e.status })
163
171
  })] })]
164
- }), /* @__PURE__ */ C("div", {
172
+ }), /* @__PURE__ */ w("div", {
165
173
  className: "relative",
166
- children: [/* @__PURE__ */ S(d, {
174
+ children: [/* @__PURE__ */ C(d, {
167
175
  variant: "ghost",
168
176
  size: "icon",
169
177
  className: "opacity-0 group-hover:opacity-100 transition-opacity",
170
178
  onClick: (t) => {
171
- t.stopPropagation(), Z(X === e.id ? null : e.id);
179
+ t.stopPropagation(), Q(Z === e.id ? null : e.id);
172
180
  },
173
- children: /* @__PURE__ */ S(A, { size: 16 })
174
- }), X === e.id && /* @__PURE__ */ C("div", {
181
+ children: /* @__PURE__ */ C(A, { size: 16 })
182
+ }), Z === e.id && /* @__PURE__ */ w("div", {
175
183
  className: "absolute right-0 top-full mt-1 w-48 bg-popover border border-border-subtle rounded-md shadow-lg z-10",
176
184
  children: [
177
- /* @__PURE__ */ C("button", {
185
+ /* @__PURE__ */ w("button", {
178
186
  className: "w-full px-4 py-2 text-left text-sm hover:bg-accent flex items-center gap-2",
179
187
  onClick: (t) => {
180
- t.stopPropagation(), z(`agents/${e.id}/chat`), Z(null);
188
+ t.stopPropagation(), B(`agents/${e.id}/chat`), Q(null);
181
189
  },
182
- children: [/* @__PURE__ */ S(j, { size: 16 }), L("botlit.agentsList.menu.testAgent", "Test Agent")]
190
+ children: [/* @__PURE__ */ C(j, { size: 16 }), R("botlit.agentsList.menu.testAgent", "Test Agent")]
183
191
  }),
184
- /* @__PURE__ */ C("button", {
192
+ /* @__PURE__ */ w("button", {
185
193
  className: "w-full px-4 py-2 text-left text-sm hover:bg-accent flex items-center gap-2",
186
194
  onClick: (t) => {
187
- t.stopPropagation(), z(`agents/${e.id}/edit`), Z(null);
195
+ t.stopPropagation(), B(`agents/${e.id}/edit`), Q(null);
188
196
  },
189
- children: [/* @__PURE__ */ S(P, { size: 16 }), L("botlit.agentsList.menu.editAgent", "Edit Agent")]
197
+ children: [/* @__PURE__ */ C(P, { size: 16 }), R("botlit.agentsList.menu.editAgent", "Edit Agent")]
190
198
  }),
191
- /* @__PURE__ */ C("button", {
199
+ /* @__PURE__ */ w("button", {
192
200
  className: "w-full px-4 py-2 text-left text-sm hover:bg-accent text-status-error-text flex items-center gap-2",
193
201
  onClick: (t) => {
194
- t.stopPropagation(), te(e);
202
+ t.stopPropagation(), ne(e);
195
203
  },
196
- children: [/* @__PURE__ */ S(F, { size: 16 }), L("botlit.agentsList.menu.delete", "Delete")]
204
+ children: [/* @__PURE__ */ C(I, { size: 16 }), R("botlit.agentsList.menu.delete", "Delete")]
197
205
  })
198
206
  ]
199
207
  })]
200
208
  })]
201
209
  }),
202
- /* @__PURE__ */ S("p", {
210
+ /* @__PURE__ */ C("p", {
203
211
  className: "mt-3 text-sm text-text-secondary line-clamp-2",
204
212
  children: e.description
205
213
  }),
206
- /* @__PURE__ */ S("div", {
214
+ /* @__PURE__ */ C("div", {
207
215
  className: "mt-4 flex items-center gap-4 text-xs text-text-secondary",
208
- children: /* @__PURE__ */ C("span", {
216
+ children: /* @__PURE__ */ w("span", {
209
217
  className: "flex items-center gap-1",
210
218
  children: [
211
- /* @__PURE__ */ S(k, { size: 14 }),
219
+ /* @__PURE__ */ C(k, { size: 14 }),
212
220
  o(e.executionCount),
213
221
  " ",
214
- L("botlit.agentsList.card.executions", "executions")
222
+ R("botlit.agentsList.card.executions", "executions")
215
223
  ]
216
224
  })
217
225
  }),
218
- /* @__PURE__ */ C("div", {
226
+ /* @__PURE__ */ w("div", {
219
227
  className: "mt-3 pt-3 border-t border-border-subtle flex items-center justify-between",
220
- children: [/* @__PURE__ */ C("span", {
228
+ children: [/* @__PURE__ */ w("span", {
221
229
  className: "text-xs text-text-secondary",
222
230
  children: [
223
- L("botlit.agentsList.card.created", "Created"),
231
+ R("botlit.agentsList.card.created", "Created"),
224
232
  " ",
225
233
  s(e.createdAt)
226
234
  ]
227
- }), /* @__PURE__ */ S(d, {
235
+ }), /* @__PURE__ */ C(d, {
228
236
  size: "sm",
229
237
  variant: "ghost",
230
- leftIcon: /* @__PURE__ */ S(j, { size: 14 }),
238
+ leftIcon: /* @__PURE__ */ C(j, { size: 14 }),
231
239
  onClick: (t) => {
232
- t.stopPropagation(), z(`agents/${e.id}/chat`);
240
+ t.stopPropagation(), B(`agents/${e.id}/chat`);
233
241
  },
234
- children: L("botlit.agentsList.card.test", "Test")
242
+ children: R("botlit.agentsList.card.test", "Test")
235
243
  })]
236
244
  })
237
245
  ]
238
246
  })
239
247
  }, e.id))
240
- }) : /* @__PURE__ */ S("div", {
248
+ }) : /* @__PURE__ */ C("div", {
241
249
  className: "space-y-2",
242
- children: $.map((e) => /* @__PURE__ */ S(l, {
250
+ children: $.map((e) => /* @__PURE__ */ C(l, {
243
251
  className: "hover:shadow-md transition-shadow cursor-pointer",
244
- onClick: () => z(`agents/${e.id}`),
245
- children: /* @__PURE__ */ S(u, {
252
+ onClick: () => B(`agents/${e.id}`),
253
+ children: /* @__PURE__ */ C(u, {
246
254
  className: "py-4",
247
- children: /* @__PURE__ */ C("div", {
255
+ children: /* @__PURE__ */ w("div", {
248
256
  className: "flex items-center justify-between",
249
- children: [/* @__PURE__ */ C("div", {
257
+ children: [/* @__PURE__ */ w("div", {
250
258
  className: "flex items-center gap-4",
251
- children: [/* @__PURE__ */ S("span", {
259
+ children: [/* @__PURE__ */ C("span", {
252
260
  className: "text-3xl",
253
261
  children: "🤖"
254
- }), /* @__PURE__ */ C("div", { children: [/* @__PURE__ */ C("div", {
262
+ }), /* @__PURE__ */ w("div", { children: [/* @__PURE__ */ w("div", {
255
263
  className: "flex items-center gap-2",
256
- children: [/* @__PURE__ */ S("h3", {
264
+ children: [/* @__PURE__ */ C("h3", {
257
265
  className: "font-semibold text-text-primary",
258
266
  children: e.name
259
- }), /* @__PURE__ */ S(f, { status: e.status })]
260
- }), /* @__PURE__ */ S("p", {
267
+ }), /* @__PURE__ */ C(f, { status: e.status })]
268
+ }), /* @__PURE__ */ C("p", {
261
269
  className: "text-sm text-text-secondary line-clamp-1",
262
270
  children: e.description
263
271
  })] })]
264
- }), /* @__PURE__ */ C("div", {
272
+ }), /* @__PURE__ */ w("div", {
265
273
  className: "flex items-center gap-4 text-sm text-text-secondary",
266
274
  children: [
267
- /* @__PURE__ */ C("span", { children: [o(e.executionCount), " executions"] }),
268
- /* @__PURE__ */ S("span", { children: s(e.createdAt) }),
269
- /* @__PURE__ */ S(d, {
275
+ /* @__PURE__ */ w("span", { children: [o(e.executionCount), " executions"] }),
276
+ /* @__PURE__ */ C("span", { children: s(e.createdAt) }),
277
+ /* @__PURE__ */ C(d, {
270
278
  variant: "outline",
271
279
  size: "sm",
272
- leftIcon: /* @__PURE__ */ S(j, { size: 14 }),
273
- children: /* @__PURE__ */ S(w, {
274
- to: B(`agents/${e.id}/chat`),
280
+ leftIcon: /* @__PURE__ */ C(j, { size: 14 }),
281
+ children: /* @__PURE__ */ C(T, {
282
+ to: V(`agents/${e.id}/chat`),
275
283
  children: "Test"
276
284
  })
277
285
  })
@@ -280,14 +288,14 @@ var L = () => {
280
288
  })
281
289
  })
282
290
  }, e.id))
283
- }) : /* @__PURE__ */ S(ee, {
291
+ }) : /* @__PURE__ */ C(_, {
284
292
  illustration: "empty-agents",
285
- title: L("botlit.agentsList.empty.title", "No agents yet"),
286
- description: L("botlit.agentsList.empty.description", "Create your first AI agent to start building intelligent automations."),
287
- action: /* @__PURE__ */ S(d, {
288
- leftIcon: /* @__PURE__ */ S(M, { size: 16 }),
289
- onClick: () => z(R ? `bots/${R}/agents/new` : "agents/new"),
290
- children: L("botlit.agentsList.actions.createAgent", "Create Agent")
293
+ title: R("botlit.agentsList.empty.title", "No agents yet"),
294
+ description: R("botlit.agentsList.empty.description", "Create your first AI agent to start building intelligent automations."),
295
+ action: /* @__PURE__ */ C(d, {
296
+ leftIcon: /* @__PURE__ */ C(M, { size: 16 }),
297
+ onClick: () => B(z ? `bots/${z}/agents/new` : "agents/new"),
298
+ children: R("botlit.agentsList.actions.createAgent", "Create Agent")
291
299
  })
292
300
  })
293
301
  ]
@@ -295,6 +303,6 @@ var L = () => {
295
303
  });
296
304
  };
297
305
  //#endregion
298
- export { L as AgentsListPage };
306
+ export { R as AgentsListPage };
299
307
 
300
308
  //# sourceMappingURL=AgentsListPage.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"AgentsListPage.js","names":[],"sources":["../../../src/botlit/pages/AgentsListPage.tsx"],"sourcesContent":["/**\n * Agents List Page\n * @module botlit/pages\n */\n\nimport type { ChangeEvent, FC } from 'react';\nimport { useState } from 'react';\nimport { useParams, Link } from 'react-router';\nimport {\n Bot,\n Plus,\n Search,\n Grid3X3,\n List,\n MoreVertical,\n MessageSquare,\n Trash2,\n Settings,\n Play,\n} from 'lucide-react';\nimport { toast } from 'sonner';\nimport { isNative, nativeConfirm, nativeImpact, nativeNotify } from '../../utils/nativeBridge';\nimport { useTr } from '../../shared/hooks/useTr';\nimport { PagePurpose, GlassCard } from '@burdenoff/fe-libs/ui';\nimport { PageLayout } from '../components/PageLayout';\nimport { Card, CardContent } from '../components/Card';\nimport { Button } from '../components/Button';\nimport { Input } from '../components/Input';\nimport { StatusBadge } from '../components/Badge';\nimport { EmptyState } from '../components/EmptyState';\nimport { ErrorState } from '../components/ErrorState';\nimport { useAgents, useDeleteAgent, type AgentRecord } from '../hooks/useAgents';\nimport { useBotlitStore } from '../store/botlitStore';\nimport { useBotlit } from '../providers/BotlitProvider';\nimport { formatRelativeTime, formatNumber } from '../utils/formatters';\nimport { cn } from '../utils/cn';\n\nexport const AgentsListPage: FC = () => {\n const t = useTr();\n const { botId } = useParams();\n const { navigateTo, getPath } = useBotlit();\n const { data: agents, loading, error, refetch } = useAgents();\n const [deleteAgent] = useDeleteAgent();\n const { viewMode, setViewMode, agentFilter, updateAgentFilter } = useBotlitStore();\n const [menuOpen, setMenuOpen] = useState<string | null>(null);\n\n const handleSearch = (e: ChangeEvent<HTMLInputElement>) => {\n updateAgentFilter({ search: e.target.value });\n };\n\n const handleDelete = async (agent: { id: string; name: string }) => {\n const confirmed = await nativeConfirm({\n title: t('botlit.agentsList.delete.title', 'Delete agent?'),\n message: t(\n 'botlit.agentsList.delete.message',\n 'Are you sure you want to delete \"{{name}}\"?',\n {\n name: agent.name,\n }\n ),\n okButtonTitle: t('botlit.agentsList.delete.okButton', 'Delete'),\n cancelButtonTitle: t('botlit.agentsList.delete.cancelButton', 'Cancel'),\n });\n const ok =\n confirmed === null\n ? confirm(\n t('botlit.agentsList.delete.message', 'Are you sure you want to delete \"{{name}}\"?', {\n name: agent.name,\n })\n )\n : confirmed;\n if (ok) {\n nativeImpact('medium');\n try {\n await deleteAgent(agent.id);\n toast.success(\n t('botlit.agentsList.delete.success', 'Agent \"{{name}}\" deleted successfully', {\n name: agent.name,\n })\n );\n if (isNative()) void nativeNotify('success');\n } catch (err: unknown) {\n const message =\n err instanceof Error\n ? err.message\n : t('botlit.agentsList.delete.error', 'Failed to delete agent');\n toast.error(message);\n if (isNative()) void nativeNotify('error');\n }\n }\n setMenuOpen(null);\n };\n\n const filteredAgents = agents.filter((agent) => {\n if (agentFilter.search) {\n const search = agentFilter.search.toLowerCase();\n return (\n agent.name.toLowerCase().includes(search) ||\n (agent.description?.toLowerCase().includes(search) ?? false)\n );\n }\n return true;\n });\n\n return (\n <PageLayout\n title={\n botId\n ? t('botlit.agentsList.titleBot', 'Bot Agents')\n : t('botlit.agentsList.title', 'All Agents')\n }\n description={\n botId\n ? t('botlit.agentsList.descriptionBot', 'Manage agents for this bot')\n : t('botlit.agentsList.description', 'View and manage all your AI agents')\n }\n actions={\n <Button\n leftIcon={<Plus size={16} />}\n onClick={() => navigateTo(botId ? `bots/${botId}/agents/new` : 'agents/new')}\n >\n {t('botlit.agentsList.actions.createAgent', 'Create Agent')}\n </Button>\n }\n >\n <div className=\"space-y-6\">\n <PagePurpose icon={<Bot size={18} />}>\n {t(\n 'botlit.agentsList.purpose',\n 'Agents are the reasoning workers behind your bots — each one bundles a model, a system prompt, tools and knowledge into a callable AI. Build an agent here to handle a specific job (answer support questions, summarise documents, run a workflow), then test it in chat and connect it to a bot or channel.'\n )}\n </PagePurpose>\n\n {/* Summary */}\n {agents.length > 0 ? (\n <div className=\"grid grid-cols-2 gap-4 sm:grid-cols-3\">\n <GlassCard treatment=\"glass\" glow className=\"p-4\">\n <p className=\"text-sm text-text-secondary\">\n {t('botlit.agentsList.summary.total', 'Total agents')}\n </p>\n <p className=\"mt-1 text-2xl font-semibold tabular-nums text-text-primary\">\n {agents.length}\n </p>\n </GlassCard>\n <GlassCard treatment=\"metric\" className=\"p-4\">\n <p className=\"text-sm text-text-secondary\">\n {t('botlit.agentsList.summary.active', 'Active')}\n </p>\n <p className=\"mt-1 text-2xl font-semibold tabular-nums text-text-primary\">\n {agents.filter((agent) => agent.status === 'ACTIVE').length}\n </p>\n </GlassCard>\n <GlassCard treatment=\"metric\" className=\"col-span-2 p-4 sm:col-span-1\">\n <p className=\"text-sm text-text-secondary\">\n {t('botlit.agentsList.summary.executions', 'Total executions')}\n </p>\n <p className=\"mt-1 text-2xl font-semibold tabular-nums text-text-primary\">\n {formatNumber(agents.reduce((sum, agent) => sum + (agent.executionCount ?? 0), 0))}\n </p>\n </GlassCard>\n </div>\n ) : null}\n\n {/* Toolbar */}\n <div className=\"flex items-center justify-between gap-4\">\n <div className=\"relative flex-1 max-w-md\">\n <Search className=\"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-text-secondary\" />\n <Input\n placeholder={t('botlit.agentsList.searchPlaceholder', 'Search agents...')}\n value={agentFilter.search || ''}\n onChange={handleSearch}\n className=\"pl-9\"\n />\n </div>\n <div className=\"flex items-center gap-2\">\n <Button\n variant={viewMode === 'grid' ? 'secondary' : 'ghost'}\n size=\"icon\"\n onClick={() => setViewMode('grid')}\n >\n <Grid3X3 size={18} />\n </Button>\n <Button\n variant={viewMode === 'list' ? 'secondary' : 'ghost'}\n size=\"icon\"\n onClick={() => setViewMode('list')}\n >\n <List size={18} />\n </Button>\n </div>\n </div>\n\n {/* Content */}\n {loading ? (\n <div\n className={cn(\n 'gap-4',\n viewMode === 'grid'\n ? 'grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3'\n : 'flex flex-col'\n )}\n >\n {[1, 2, 3, 4, 5, 6].map((i) => (\n <div\n key={i}\n className=\"h-48 bg-bg-sunken motion-safe:animate-vc-shimmer rounded-lg\"\n />\n ))}\n </div>\n ) : error ? (\n <ErrorState resource=\"agents\" error={error} onRetry={() => void refetch()} />\n ) : filteredAgents.length > 0 ? (\n viewMode === 'grid' ? (\n <div className=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4\">\n {filteredAgents.map((agent: AgentRecord) => (\n <Card\n key={agent.id}\n className=\"group hover:shadow-md transition-shadow cursor-pointer relative\"\n onClick={() => navigateTo(`agents/${agent.id}`)}\n >\n <CardContent className=\"pt-6\">\n <div className=\"flex items-start justify-between\">\n <div className=\"flex items-center gap-3\">\n <span className=\"text-4xl\">🤖</span>\n <div>\n <h3 className=\"font-semibold text-text-primary\">{agent.name}</h3>\n <div className=\"flex items-center gap-2 mt-1\">\n <StatusBadge status={agent.status} />\n </div>\n </div>\n </div>\n <div className=\"relative\">\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className=\"opacity-0 group-hover:opacity-100 transition-opacity\"\n onClick={(e) => {\n e.stopPropagation();\n setMenuOpen(menuOpen === agent.id ? null : agent.id);\n }}\n >\n <MoreVertical size={16} />\n </Button>\n {menuOpen === agent.id && (\n <div className=\"absolute right-0 top-full mt-1 w-48 bg-popover border border-border-subtle rounded-md shadow-lg z-10\">\n <button\n className=\"w-full px-4 py-2 text-left text-sm hover:bg-accent flex items-center gap-2\"\n onClick={(e) => {\n e.stopPropagation();\n navigateTo(`agents/${agent.id}/chat`);\n setMenuOpen(null);\n }}\n >\n <Play size={16} />\n {t('botlit.agentsList.menu.testAgent', 'Test Agent')}\n </button>\n <button\n className=\"w-full px-4 py-2 text-left text-sm hover:bg-accent flex items-center gap-2\"\n onClick={(e) => {\n e.stopPropagation();\n navigateTo(`agents/${agent.id}/edit`);\n setMenuOpen(null);\n }}\n >\n <Settings size={16} />\n {t('botlit.agentsList.menu.editAgent', 'Edit Agent')}\n </button>\n <button\n className=\"w-full px-4 py-2 text-left text-sm hover:bg-accent text-status-error-text flex items-center gap-2\"\n onClick={(e) => {\n e.stopPropagation();\n handleDelete(agent);\n }}\n >\n <Trash2 size={16} />\n {t('botlit.agentsList.menu.delete', 'Delete')}\n </button>\n </div>\n )}\n </div>\n </div>\n <p className=\"mt-3 text-sm text-text-secondary line-clamp-2\">\n {agent.description}\n </p>\n <div className=\"mt-4 flex items-center gap-4 text-xs text-text-secondary\">\n <span className=\"flex items-center gap-1\">\n <MessageSquare size={14} />\n {formatNumber(agent.executionCount)}{' '}\n {t('botlit.agentsList.card.executions', 'executions')}\n </span>\n </div>\n <div className=\"mt-3 pt-3 border-t border-border-subtle flex items-center justify-between\">\n <span className=\"text-xs text-text-secondary\">\n {t('botlit.agentsList.card.created', 'Created')}{' '}\n {formatRelativeTime(agent.createdAt)}\n </span>\n <Button\n size=\"sm\"\n variant=\"ghost\"\n leftIcon={<Play size={14} />}\n onClick={(e) => {\n e.stopPropagation();\n navigateTo(`agents/${agent.id}/chat`);\n }}\n >\n {t('botlit.agentsList.card.test', 'Test')}\n </Button>\n </div>\n </CardContent>\n </Card>\n ))}\n </div>\n ) : (\n <div className=\"space-y-2\">\n {filteredAgents.map((agent: AgentRecord) => (\n <Card\n key={agent.id}\n className=\"hover:shadow-md transition-shadow cursor-pointer\"\n onClick={() => navigateTo(`agents/${agent.id}`)}\n >\n <CardContent className=\"py-4\">\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-4\">\n <span className=\"text-3xl\">🤖</span>\n <div>\n <div className=\"flex items-center gap-2\">\n <h3 className=\"font-semibold text-text-primary\">{agent.name}</h3>\n <StatusBadge status={agent.status} />\n </div>\n <p className=\"text-sm text-text-secondary line-clamp-1\">\n {agent.description}\n </p>\n </div>\n </div>\n <div className=\"flex items-center gap-4 text-sm text-text-secondary\">\n <span>{formatNumber(agent.executionCount)} executions</span>\n <span>{formatRelativeTime(agent.createdAt)}</span>\n <Button variant=\"outline\" size=\"sm\" leftIcon={<Play size={14} />}>\n <Link to={getPath(`agents/${agent.id}/chat`)}>Test</Link>\n </Button>\n </div>\n </div>\n </CardContent>\n </Card>\n ))}\n </div>\n )\n ) : (\n <EmptyState\n illustration=\"empty-agents\"\n title={t('botlit.agentsList.empty.title', 'No agents yet')}\n description={t(\n 'botlit.agentsList.empty.description',\n 'Create your first AI agent to start building intelligent automations.'\n )}\n action={\n <Button\n leftIcon={<Plus size={16} />}\n onClick={() => navigateTo(botId ? `bots/${botId}/agents/new` : 'agents/new')}\n >\n {t('botlit.agentsList.actions.createAgent', 'Create Agent')}\n </Button>\n }\n />\n )}\n </div>\n </PageLayout>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAqCA,IAAa,UAA2B;CACtC,IAAM,IA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ACL;WACF;;OACM,CAAA;MACT,EA3BA,EAAM,GA2BN,CACP;KACE,CAAA,GAGR,kBAAC,IAAD;KACE,cAAa;KACb,OAAO,EAAE,iCAAiC,gBAAgB;KAC1D,aAAa,EACX,uCACA,wEACD;KACD,QACE,kBAAC,GAAD;MACE,UAAU,kBAAC,GAAD,EAAM,MAAM,IAAM,CAAA;MAC5B,eAAe,EAAW,IAAQ,QAAQ,EAAM,eAAe,aAAa;gBAE3E,EAAE,yCAAyC,eAAe;MACpD,CAAA;KAEX,CAAA;IAEA;;EACK,CAAA"}
1
+ {"version":3,"file":"AgentsListPage.js","names":[],"sources":["../../../src/botlit/pages/AgentsListPage.tsx"],"sourcesContent":["/**\n * Agents List Page\n * @module botlit/pages\n */\n\nimport type { ChangeEvent, FC } from 'react';\nimport { useState } from 'react';\nimport { useParams, Link } from 'react-router';\nimport {\n Bot,\n Plus,\n Search,\n Grid3X3,\n List,\n MoreVertical,\n MessageSquare,\n Trash2,\n Settings,\n Play,\n ShieldCheck,\n} from 'lucide-react';\nimport { toast } from 'sonner';\nimport { isNative, nativeConfirm, nativeImpact, nativeNotify } from '../../utils/nativeBridge';\nimport { useTr } from '../../shared/hooks/useTr';\nimport { PagePurpose, GlassCard } from '@burdenoff/fe-libs/ui';\nimport { PageLayout } from '../components/PageLayout';\nimport { Card, CardContent } from '../components/Card';\nimport { Button } from '../components/Button';\nimport { Input } from '../components/Input';\nimport { StatusBadge } from '../components/Badge';\nimport { EmptyState } from '../components/EmptyState';\nimport { ErrorState } from '../components/ErrorState';\nimport { useAgents, useDeleteAgent, type AgentRecord } from '../hooks/useAgents';\nimport { useBotlitStore } from '../store/botlitStore';\nimport { useBotlit } from '../providers/BotlitProvider';\nimport { formatRelativeTime, formatNumber } from '../utils/formatters';\nimport { cn } from '../utils/cn';\n\nexport const AgentsListPage: FC = () => {\n const t = useTr();\n const { botId } = useParams();\n const { navigateTo, getPath } = useBotlit();\n const { data: agents, loading, error, refetch } = useAgents();\n const [deleteAgent] = useDeleteAgent();\n const { viewMode, setViewMode, agentFilter, updateAgentFilter } = useBotlitStore();\n const [menuOpen, setMenuOpen] = useState<string | null>(null);\n\n const handleSearch = (e: ChangeEvent<HTMLInputElement>) => {\n updateAgentFilter({ search: e.target.value });\n };\n\n const handleDelete = async (agent: { id: string; name: string }) => {\n const confirmed = await nativeConfirm({\n title: t('botlit.agentsList.delete.title', 'Delete agent?'),\n message: t(\n 'botlit.agentsList.delete.message',\n 'Are you sure you want to delete \"{{name}}\"?',\n {\n name: agent.name,\n }\n ),\n okButtonTitle: t('botlit.agentsList.delete.okButton', 'Delete'),\n cancelButtonTitle: t('botlit.agentsList.delete.cancelButton', 'Cancel'),\n });\n const ok =\n confirmed === null\n ? confirm(\n t('botlit.agentsList.delete.message', 'Are you sure you want to delete \"{{name}}\"?', {\n name: agent.name,\n })\n )\n : confirmed;\n if (ok) {\n nativeImpact('medium');\n try {\n await deleteAgent(agent.id);\n toast.success(\n t('botlit.agentsList.delete.success', 'Agent \"{{name}}\" deleted successfully', {\n name: agent.name,\n })\n );\n if (isNative()) void nativeNotify('success');\n } catch (err: unknown) {\n const message =\n err instanceof Error\n ? err.message\n : t('botlit.agentsList.delete.error', 'Failed to delete agent');\n toast.error(message);\n if (isNative()) void nativeNotify('error');\n }\n }\n setMenuOpen(null);\n };\n\n const filteredAgents = agents.filter((agent) => {\n if (agentFilter.search) {\n const search = agentFilter.search.toLowerCase();\n return (\n agent.name.toLowerCase().includes(search) ||\n (agent.description?.toLowerCase().includes(search) ?? false)\n );\n }\n return true;\n });\n\n return (\n <PageLayout\n title={\n botId\n ? t('botlit.agentsList.titleBot', 'Bot Agents')\n : t('botlit.agentsList.title', 'All Agents')\n }\n description={\n botId\n ? t('botlit.agentsList.descriptionBot', 'Manage agents for this bot')\n : t('botlit.agentsList.description', 'View and manage all your AI agents')\n }\n actions={\n <div className=\"flex gap-2\">\n <Button\n variant=\"outline\"\n leftIcon={<ShieldCheck size={16} />}\n onClick={() => navigateTo('agents/approvals')}\n >\n {t('botlit.agentsList.actions.approvals', 'Approvals')}\n </Button>\n <Button\n leftIcon={<Plus size={16} />}\n onClick={() => navigateTo(botId ? `bots/${botId}/agents/new` : 'agents/new')}\n >\n {t('botlit.agentsList.actions.createAgent', 'Create Agent')}\n </Button>\n </div>\n }\n >\n <div className=\"space-y-6\">\n <PagePurpose icon={<Bot size={18} />}>\n {t(\n 'botlit.agentsList.purpose',\n 'Agents are the reasoning workers behind your bots — each one bundles a model, a system prompt, tools and knowledge into a callable AI. Build an agent here to handle a specific job (answer support questions, summarise documents, run a workflow), then test it in chat and connect it to a bot or channel.'\n )}\n </PagePurpose>\n\n {/* Summary */}\n {agents.length > 0 ? (\n <div className=\"grid grid-cols-2 gap-4 sm:grid-cols-3\">\n <GlassCard treatment=\"glass\" glow className=\"p-4\">\n <p className=\"text-sm text-text-secondary\">\n {t('botlit.agentsList.summary.total', 'Total agents')}\n </p>\n <p className=\"mt-1 text-2xl font-semibold tabular-nums text-text-primary\">\n {agents.length}\n </p>\n </GlassCard>\n <GlassCard treatment=\"metric\" className=\"p-4\">\n <p className=\"text-sm text-text-secondary\">\n {t('botlit.agentsList.summary.active', 'Active')}\n </p>\n <p className=\"mt-1 text-2xl font-semibold tabular-nums text-text-primary\">\n {agents.filter((agent) => agent.status === 'ACTIVE').length}\n </p>\n </GlassCard>\n <GlassCard treatment=\"metric\" className=\"col-span-2 p-4 sm:col-span-1\">\n <p className=\"text-sm text-text-secondary\">\n {t('botlit.agentsList.summary.executions', 'Total executions')}\n </p>\n <p className=\"mt-1 text-2xl font-semibold tabular-nums text-text-primary\">\n {formatNumber(agents.reduce((sum, agent) => sum + (agent.executionCount ?? 0), 0))}\n </p>\n </GlassCard>\n </div>\n ) : null}\n\n {/* Toolbar */}\n <div className=\"flex items-center justify-between gap-4\">\n <div className=\"relative flex-1 max-w-md\">\n <Search className=\"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-text-secondary\" />\n <Input\n placeholder={t('botlit.agentsList.searchPlaceholder', 'Search agents...')}\n value={agentFilter.search || ''}\n onChange={handleSearch}\n className=\"pl-9\"\n />\n </div>\n <div className=\"flex items-center gap-2\">\n <Button\n variant={viewMode === 'grid' ? 'secondary' : 'ghost'}\n size=\"icon\"\n onClick={() => setViewMode('grid')}\n >\n <Grid3X3 size={18} />\n </Button>\n <Button\n variant={viewMode === 'list' ? 'secondary' : 'ghost'}\n size=\"icon\"\n onClick={() => setViewMode('list')}\n >\n <List size={18} />\n </Button>\n </div>\n </div>\n\n {/* Content */}\n {loading ? (\n <div\n className={cn(\n 'gap-4',\n viewMode === 'grid'\n ? 'grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3'\n : 'flex flex-col'\n )}\n >\n {[1, 2, 3, 4, 5, 6].map((i) => (\n <div\n key={i}\n className=\"h-48 bg-bg-sunken motion-safe:animate-vc-shimmer rounded-lg\"\n />\n ))}\n </div>\n ) : error ? (\n <ErrorState resource=\"agents\" error={error} onRetry={() => void refetch()} />\n ) : filteredAgents.length > 0 ? (\n viewMode === 'grid' ? (\n <div className=\"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-4\">\n {filteredAgents.map((agent: AgentRecord) => (\n <Card\n key={agent.id}\n className=\"group hover:shadow-md transition-shadow cursor-pointer relative\"\n onClick={() => navigateTo(`agents/${agent.id}`)}\n >\n <CardContent className=\"pt-6\">\n <div className=\"flex items-start justify-between\">\n <div className=\"flex items-center gap-3\">\n <span className=\"text-4xl\">🤖</span>\n <div>\n <h3 className=\"font-semibold text-text-primary\">{agent.name}</h3>\n <div className=\"flex items-center gap-2 mt-1\">\n <StatusBadge status={agent.status} />\n </div>\n </div>\n </div>\n <div className=\"relative\">\n <Button\n variant=\"ghost\"\n size=\"icon\"\n className=\"opacity-0 group-hover:opacity-100 transition-opacity\"\n onClick={(e) => {\n e.stopPropagation();\n setMenuOpen(menuOpen === agent.id ? null : agent.id);\n }}\n >\n <MoreVertical size={16} />\n </Button>\n {menuOpen === agent.id && (\n <div className=\"absolute right-0 top-full mt-1 w-48 bg-popover border border-border-subtle rounded-md shadow-lg z-10\">\n <button\n className=\"w-full px-4 py-2 text-left text-sm hover:bg-accent flex items-center gap-2\"\n onClick={(e) => {\n e.stopPropagation();\n navigateTo(`agents/${agent.id}/chat`);\n setMenuOpen(null);\n }}\n >\n <Play size={16} />\n {t('botlit.agentsList.menu.testAgent', 'Test Agent')}\n </button>\n <button\n className=\"w-full px-4 py-2 text-left text-sm hover:bg-accent flex items-center gap-2\"\n onClick={(e) => {\n e.stopPropagation();\n navigateTo(`agents/${agent.id}/edit`);\n setMenuOpen(null);\n }}\n >\n <Settings size={16} />\n {t('botlit.agentsList.menu.editAgent', 'Edit Agent')}\n </button>\n <button\n className=\"w-full px-4 py-2 text-left text-sm hover:bg-accent text-status-error-text flex items-center gap-2\"\n onClick={(e) => {\n e.stopPropagation();\n handleDelete(agent);\n }}\n >\n <Trash2 size={16} />\n {t('botlit.agentsList.menu.delete', 'Delete')}\n </button>\n </div>\n )}\n </div>\n </div>\n <p className=\"mt-3 text-sm text-text-secondary line-clamp-2\">\n {agent.description}\n </p>\n <div className=\"mt-4 flex items-center gap-4 text-xs text-text-secondary\">\n <span className=\"flex items-center gap-1\">\n <MessageSquare size={14} />\n {formatNumber(agent.executionCount)}{' '}\n {t('botlit.agentsList.card.executions', 'executions')}\n </span>\n </div>\n <div className=\"mt-3 pt-3 border-t border-border-subtle flex items-center justify-between\">\n <span className=\"text-xs text-text-secondary\">\n {t('botlit.agentsList.card.created', 'Created')}{' '}\n {formatRelativeTime(agent.createdAt)}\n </span>\n <Button\n size=\"sm\"\n variant=\"ghost\"\n leftIcon={<Play size={14} />}\n onClick={(e) => {\n e.stopPropagation();\n navigateTo(`agents/${agent.id}/chat`);\n }}\n >\n {t('botlit.agentsList.card.test', 'Test')}\n </Button>\n </div>\n </CardContent>\n </Card>\n ))}\n </div>\n ) : (\n <div className=\"space-y-2\">\n {filteredAgents.map((agent: AgentRecord) => (\n <Card\n key={agent.id}\n className=\"hover:shadow-md transition-shadow cursor-pointer\"\n onClick={() => navigateTo(`agents/${agent.id}`)}\n >\n <CardContent className=\"py-4\">\n <div className=\"flex items-center justify-between\">\n <div className=\"flex items-center gap-4\">\n <span className=\"text-3xl\">🤖</span>\n <div>\n <div className=\"flex items-center gap-2\">\n <h3 className=\"font-semibold text-text-primary\">{agent.name}</h3>\n <StatusBadge status={agent.status} />\n </div>\n <p className=\"text-sm text-text-secondary line-clamp-1\">\n {agent.description}\n </p>\n </div>\n </div>\n <div className=\"flex items-center gap-4 text-sm text-text-secondary\">\n <span>{formatNumber(agent.executionCount)} executions</span>\n <span>{formatRelativeTime(agent.createdAt)}</span>\n <Button variant=\"outline\" size=\"sm\" leftIcon={<Play size={14} />}>\n <Link to={getPath(`agents/${agent.id}/chat`)}>Test</Link>\n </Button>\n </div>\n </div>\n </CardContent>\n </Card>\n ))}\n </div>\n )\n ) : (\n <EmptyState\n illustration=\"empty-agents\"\n title={t('botlit.agentsList.empty.title', 'No agents yet')}\n description={t(\n 'botlit.agentsList.empty.description',\n 'Create your first AI agent to start building intelligent automations.'\n )}\n action={\n <Button\n leftIcon={<Plus size={16} />}\n onClick={() => navigateTo(botId ? `bots/${botId}/agents/new` : 'agents/new')}\n >\n {t('botlit.agentsList.actions.createAgent', 'Create Agent')}\n </Button>\n }\n />\n )}\n </div>\n </PageLayout>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsCA,IAAa,UAA2B;CACtC,IAAM,IAAI,GAAO,EACX,EAAE,aAAU,GAAW,EACvB,EAAE,eAAY,eAAY,GAAW,EACrC,EAAE,MAAM,GAAQ,YAAS,UAAO,eAAY,GAAW,EACvD,CAAC,KAAe,GAAgB,EAChC,EAAE,aAAU,gBAAa,gBAAa,yBAAsB,GAAgB,EAC5E,CAAC,GAAU,KAAe,EAAwB,KAAK,EAEvD,MAAgB,MAAqC;AACzD,IAAkB,EAAE,QAAQ,EAAE,OAAO,OAAO,CAAC;IAG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