@burdenoff/microfe-subscriberbot 2026.706.1 → 2026.706.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. package/dist/subscriberbot/SubscriberBotRoutes.js +14 -6
  2. package/dist/subscriberbot/SubscriberBotRoutes.js.map +1 -1
  3. package/dist/subscriberbot/components/Modal.js +51 -0
  4. package/dist/subscriberbot/components/Modal.js.map +1 -0
  5. package/dist/subscriberbot/components/index.js +7 -0
  6. package/dist/subscriberbot/components/viz.js +196 -0
  7. package/dist/subscriberbot/components/viz.js.map +1 -0
  8. package/dist/subscriberbot/hooks/useSubscriberBotApi.js +364 -161
  9. package/dist/subscriberbot/hooks/useSubscriberBotApi.js.map +1 -1
  10. package/dist/subscriberbot/pages/AssetVaultPage.js +182 -0
  11. package/dist/subscriberbot/pages/AssetVaultPage.js.map +1 -0
  12. package/dist/subscriberbot/pages/DashboardPage.js +272 -199
  13. package/dist/subscriberbot/pages/DashboardPage.js.map +1 -1
  14. package/dist/subscriberbot/pages/InboxPage.js +682 -126
  15. package/dist/subscriberbot/pages/InboxPage.js.map +1 -1
  16. package/dist/subscriberbot/pages/InsightsPage.js +220 -0
  17. package/dist/subscriberbot/pages/InsightsPage.js.map +1 -0
  18. package/dist/subscriberbot/pages/InvoicesPage.js +592 -81
  19. package/dist/subscriberbot/pages/InvoicesPage.js.map +1 -1
  20. package/dist/subscriberbot/pages/WorkflowsPage.js +344 -169
  21. package/dist/subscriberbot/pages/WorkflowsPage.js.map +1 -1
  22. package/dist/subscriberbot/pages/agents/AgentDetailPage.js +401 -116
  23. package/dist/subscriberbot/pages/agents/AgentDetailPage.js.map +1 -1
  24. package/dist/subscriberbot/pages/agents/AgentsListPage.js +185 -93
  25. package/dist/subscriberbot/pages/agents/AgentsListPage.js.map +1 -1
  26. package/dist/subscriberbot/pages/providers/ProviderDetailPage.js +735 -135
  27. package/dist/subscriberbot/pages/providers/ProviderDetailPage.js.map +1 -1
  28. package/dist/subscriberbot/pages/providers/ProviderNewPage.js +217 -153
  29. package/dist/subscriberbot/pages/providers/ProviderNewPage.js.map +1 -1
  30. package/dist/subscriberbot/pages/providers/ProvidersListPage.js +216 -111
  31. package/dist/subscriberbot/pages/providers/ProvidersListPage.js.map +1 -1
  32. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js +902 -250
  33. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js.map +1 -1
  34. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js +242 -192
  35. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js.map +1 -1
  36. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js +174 -131
  37. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js.map +1 -1
  38. package/package.json +1 -1
@@ -1,160 +1,445 @@
1
1
  import { useSubscriberBot as e } from "../../context/SubscriberBotContext.js";
2
2
  import { PageLayout as t } from "../../components/PageLayout.js";
3
- import { formatEnumLabel as n, formatRelativeTime as r } from "../../utils/formatters.js";
4
- import { StatusBadge as i } from "../../components/StatusBadge.js";
5
- import { EmptyState as a } from "../../components/EmptyState.js";
6
- import { ErrorView as o, LoadingView as s, Section as c } from "../../components/StateViews.js";
7
- import { useAgent as l, useSetAgentStatus as u } from "../../hooks/useSubscriberBotApi.js";
8
- import { useState as d } from "react";
9
- import { ArrowLeft as f, Bot as p, ShieldCheck as m } from "lucide-react";
10
- import { useParams as h } from "react-router-dom";
11
- import { jsx as g, jsxs as _ } from "react/jsx-runtime";
12
- import { GlassCard as v } from "@burdenoff/fe-libs/ui";
3
+ import { MetricsCard as n } from "../../components/MetricsCard.js";
4
+ import { formatEnumLabel as r, formatRelativeTime as i } from "../../utils/formatters.js";
5
+ import { StatusBadge as a } from "../../components/StatusBadge.js";
6
+ import { EmptyState as o } from "../../components/EmptyState.js";
7
+ import { Modal as s } from "../../components/Modal.js";
8
+ import { ErrorView as c, LoadingView as l, Section as u } from "../../components/StateViews.js";
9
+ import { Timeline as d } from "../../components/viz.js";
10
+ import "../../components/index.js";
11
+ import { useAgent as f, useCreatePolicy as p, useSetAgentStatus as m } from "../../hooks/useSubscriberBotApi.js";
12
+ import { useState as h } from "react";
13
+ import { ArrowLeft as g, ArrowLeftRight as _, Bot as v, Building2 as y, Clock as b, ConciergeBell as x, DollarSign as S, Handshake as C, History as w, ListChecks as T, Mail as E, Plus as D, RefreshCw as O, Search as k, ShieldCheck as A, Zap as j } from "lucide-react";
14
+ import { useParams as M } from "react-router-dom";
15
+ import { jsx as N, jsxs as P } from "react/jsx-runtime";
16
+ import { GlassCard as F } from "@burdenoff/fe-libs/ui";
13
17
  //#region src/subscriberbot/pages/agents/AgentDetailPage.tsx
14
- var y = [
18
+ var I = [
15
19
  "DISABLED",
16
20
  "SUGGEST_ONLY",
17
21
  "AUTONOMOUS"
18
- ];
19
- function b() {
20
- let { id: b } = h(), { navigateTo: x } = e(), { data: S, isLoading: C, isError: w, refetch: T } = l(b), E = u(), [D, O] = d(null);
21
- if (C) return /* @__PURE__ */ g(t, {
22
+ ], L = [
23
+ "ALERT",
24
+ "CREATE_TASK",
25
+ "RENEW",
26
+ "CANCEL",
27
+ "PAUSE",
28
+ "UPGRADE",
29
+ "DOWNGRADE"
30
+ ], R = {
31
+ DISCOVERY: k,
32
+ RENEWAL: O,
33
+ COST: S,
34
+ NEWSLETTER: E,
35
+ VENDOR: y,
36
+ COMPLIANCE: A,
37
+ NEGOTIATION: C,
38
+ MIGRATION: _,
39
+ CONCIERGE: x
40
+ };
41
+ function z(e) {
42
+ switch (e) {
43
+ case "RENEW":
44
+ case "UPGRADE": return "positive";
45
+ case "CANCEL":
46
+ case "PAUSE":
47
+ case "DOWNGRADE":
48
+ case "ALERT": return "warning";
49
+ default: return "default";
50
+ }
51
+ }
52
+ var B = "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]", V = "mb-1 block text-xs font-medium text-text-secondary";
53
+ function H({ enabled: e }) {
54
+ return /* @__PURE__ */ P("span", {
55
+ className: e ? "inline-flex items-center gap-1.5 rounded-full bg-status-success-bg-subtle px-2.5 py-0.5 text-xs font-medium text-status-success-text" : "inline-flex items-center gap-1.5 rounded-full bg-bg-sunken px-2.5 py-0.5 text-xs font-medium text-text-secondary",
56
+ children: [/* @__PURE__ */ N("span", {
57
+ "aria-hidden": !0,
58
+ className: "size-1.5 rounded-full bg-current",
59
+ style: { opacity: e ? 1 : .6 }
60
+ }), e ? "Enabled" : "Disabled"]
61
+ });
62
+ }
63
+ function U({ agentId: e, onClose: t }) {
64
+ let n = p(), [r, i] = h(""), [a, o] = h("ALERT"), [c, l] = h(""), [u, d] = h(""), [f, m] = h(!0), [g, _] = h(null);
65
+ return /* @__PURE__ */ N(s, {
66
+ title: "Add policy",
67
+ onClose: t,
68
+ maxWidthClassName: "max-w-xl",
69
+ children: /* @__PURE__ */ P("form", {
70
+ onSubmit: (i) => {
71
+ if (i.preventDefault(), _(null), !r.trim()) {
72
+ _("A policy name is required.");
73
+ return;
74
+ }
75
+ let o;
76
+ if (u.trim()) try {
77
+ o = JSON.parse(u);
78
+ } catch {
79
+ _("Condition must be valid JSON (e.g. {\"amountOver\": 100}).");
80
+ return;
81
+ }
82
+ n.mutate({
83
+ agentId: e,
84
+ name: r.trim(),
85
+ action: a,
86
+ isEnabled: f,
87
+ ...c.trim() ? { description: c.trim() } : {},
88
+ ...o ? { condition: o } : {}
89
+ }, {
90
+ onSuccess: () => t(),
91
+ onError: (e) => _(e instanceof Error ? e.message : "Could not add policy.")
92
+ });
93
+ },
94
+ className: "space-y-4",
95
+ children: [
96
+ g && /* @__PURE__ */ N("div", {
97
+ className: "rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text",
98
+ children: g
99
+ }),
100
+ /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ P("label", {
101
+ htmlFor: "policy-name",
102
+ className: V,
103
+ children: ["Name ", /* @__PURE__ */ N("span", {
104
+ className: "text-status-error-text",
105
+ children: "*"
106
+ })]
107
+ }), /* @__PURE__ */ N("input", {
108
+ id: "policy-name",
109
+ type: "text",
110
+ value: r,
111
+ onChange: (e) => i(e.target.value),
112
+ placeholder: "e.g. Alert on price hike over 20%",
113
+ className: B,
114
+ required: !0
115
+ })] }),
116
+ /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("label", {
117
+ htmlFor: "policy-action",
118
+ className: V,
119
+ children: "Action"
120
+ }), /* @__PURE__ */ N("select", {
121
+ id: "policy-action",
122
+ value: a,
123
+ onChange: (e) => o(e.target.value),
124
+ className: B,
125
+ children: L.map((e) => /* @__PURE__ */ N("option", {
126
+ value: e,
127
+ children: e.replace(/_/g, " ")
128
+ }, e))
129
+ })] }),
130
+ /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ P("label", {
131
+ htmlFor: "policy-condition",
132
+ className: V,
133
+ children: ["Condition ", /* @__PURE__ */ N("span", {
134
+ className: "text-text-secondary",
135
+ children: "(optional JSON)"
136
+ })]
137
+ }), /* @__PURE__ */ N("textarea", {
138
+ id: "policy-condition",
139
+ value: u,
140
+ onChange: (e) => d(e.target.value),
141
+ rows: 3,
142
+ placeholder: "{ \"priceIncreasePct\": 20 }",
143
+ className: `${B} font-mono`
144
+ })] }),
145
+ /* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("label", {
146
+ htmlFor: "policy-desc",
147
+ className: V,
148
+ children: "Description"
149
+ }), /* @__PURE__ */ N("textarea", {
150
+ id: "policy-desc",
151
+ value: c,
152
+ onChange: (e) => l(e.target.value),
153
+ rows: 2,
154
+ className: B
155
+ })] }),
156
+ /* @__PURE__ */ P("label", {
157
+ className: "flex items-center gap-2 text-sm text-text-primary",
158
+ children: [/* @__PURE__ */ N("input", {
159
+ type: "checkbox",
160
+ checked: f,
161
+ onChange: (e) => m(e.target.checked),
162
+ className: "size-4 rounded border-border-subtle"
163
+ }), "Enabled"]
164
+ }),
165
+ /* @__PURE__ */ P("div", {
166
+ className: "flex justify-end gap-3",
167
+ children: [/* @__PURE__ */ N("button", {
168
+ type: "button",
169
+ onClick: t,
170
+ className: "rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
171
+ children: "Cancel"
172
+ }), /* @__PURE__ */ N("button", {
173
+ type: "submit",
174
+ disabled: n.isPending,
175
+ className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:opacity-50",
176
+ children: n.isPending ? "Adding…" : "Add policy"
177
+ })]
178
+ })
179
+ ]
180
+ })
181
+ });
182
+ }
183
+ function W({ policy: e }) {
184
+ return /* @__PURE__ */ P(F, {
185
+ treatment: "metric",
186
+ className: "flex flex-col p-4",
187
+ children: [
188
+ /* @__PURE__ */ P("div", {
189
+ className: "flex items-start justify-between gap-2",
190
+ children: [/* @__PURE__ */ N("p", {
191
+ className: "text-sm font-semibold text-text-primary",
192
+ children: e.name
193
+ }), /* @__PURE__ */ N(H, { enabled: e.isEnabled })]
194
+ }),
195
+ /* @__PURE__ */ P("div", {
196
+ className: "mt-2 flex flex-wrap items-center gap-2",
197
+ children: [/* @__PURE__ */ P("span", {
198
+ className: "inline-flex items-center gap-1.5 rounded-md bg-[var(--color-accent-soft)] px-2 py-0.5 text-[11px] font-medium text-text-primary",
199
+ children: [
200
+ /* @__PURE__ */ N(A, {
201
+ className: "h-3 w-3",
202
+ "aria-hidden": !0
203
+ }),
204
+ " ",
205
+ r(e.action)
206
+ ]
207
+ }), /* @__PURE__ */ P("span", {
208
+ className: "inline-flex items-center gap-1 rounded-md bg-bg-sunken px-2 py-0.5 text-[11px] font-medium text-text-secondary tabular-nums",
209
+ children: [
210
+ "Triggered ",
211
+ e.triggerCount,
212
+ "×"
213
+ ]
214
+ })]
215
+ }),
216
+ e.description && /* @__PURE__ */ N("p", {
217
+ className: "mt-2 line-clamp-2 text-xs text-text-secondary",
218
+ children: e.description
219
+ }),
220
+ /* @__PURE__ */ P("p", {
221
+ className: "mt-2 flex items-center gap-1.5 text-xs text-text-secondary",
222
+ children: [/* @__PURE__ */ N(b, {
223
+ className: "h-3.5 w-3.5",
224
+ "aria-hidden": !0
225
+ }), e.lastTriggeredAt ? `Last triggered ${i(e.lastTriggeredAt)}` : "Not yet triggered"]
226
+ })
227
+ ]
228
+ });
229
+ }
230
+ function G() {
231
+ let { id: s } = M(), { navigateTo: p } = e(), { data: _, isLoading: y, isError: x, refetch: S } = f(s), C = m(), [E, O] = h(null), [k, L] = h(!1);
232
+ if (y) return /* @__PURE__ */ N(t, {
22
233
  title: "Agent",
23
- children: /* @__PURE__ */ g(s, { label: "Loading agent…" })
234
+ children: /* @__PURE__ */ N(l, { label: "Loading agent…" })
24
235
  });
25
- if (w) return /* @__PURE__ */ g(t, {
236
+ if (x) return /* @__PURE__ */ N(t, {
26
237
  title: "Agent",
27
- children: /* @__PURE__ */ g(o, {
238
+ children: /* @__PURE__ */ N(c, {
28
239
  message: "Could not load this agent.",
29
- onRetry: () => void T()
240
+ onRetry: () => void S()
30
241
  })
31
242
  });
32
- if (!S) return /* @__PURE__ */ g(t, {
243
+ if (!_) return /* @__PURE__ */ N(t, {
33
244
  title: "Agent",
34
- children: /* @__PURE__ */ g(a, {
245
+ children: /* @__PURE__ */ N(o, {
35
246
  illustration: "empty-data",
36
247
  title: "Agent not found",
37
248
  description: "It may have been removed, or you may not have access to it.",
38
- action: /* @__PURE__ */ g("button", {
249
+ action: /* @__PURE__ */ N("button", {
39
250
  type: "button",
40
- onClick: () => x("/agents"),
251
+ onClick: () => p("/agents"),
41
252
  className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90",
42
253
  children: "Back to agents"
43
254
  })
44
255
  })
45
256
  });
46
- let k = S;
47
- return /* @__PURE__ */ _(t, {
48
- title: k.name,
49
- description: `${n(k.kind)} agent`,
50
- actions: /* @__PURE__ */ _("button", {
257
+ let B = _, V = R[B.kind] ?? v, H = B.policies ?? [], G = H.filter((e) => e.isEnabled).length, K = H.reduce((e, t) => e + (t.triggerCount || 0), 0), q = [];
258
+ B.lastRunAt && q.push({
259
+ ts: new Date(B.lastRunAt).getTime(),
260
+ item: {
261
+ title: "Agent run",
262
+ sub: "Latest autonomous cycle",
263
+ meta: i(B.lastRunAt),
264
+ tone: "positive"
265
+ }
266
+ });
267
+ for (let e of H) e.lastTriggeredAt && q.push({
268
+ ts: new Date(e.lastTriggeredAt).getTime(),
269
+ item: {
270
+ title: e.name,
271
+ sub: `${r(e.action)} · fired ${e.triggerCount}×`,
272
+ meta: i(e.lastTriggeredAt),
273
+ tone: z(e.action)
274
+ }
275
+ });
276
+ q.sort((e, t) => t.ts - e.ts);
277
+ let J = q.map((e) => e.item);
278
+ return /* @__PURE__ */ P(t, {
279
+ title: B.name,
280
+ description: `${r(B.kind)} agent`,
281
+ actions: /* @__PURE__ */ P("button", {
51
282
  type: "button",
52
- onClick: () => x("/agents"),
283
+ onClick: () => p("/agents"),
53
284
  className: "inline-flex items-center gap-2 rounded-lg border border-border-subtle px-3 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
54
- children: [/* @__PURE__ */ g(f, { className: "h-4 w-4" }), " Back"]
285
+ children: [/* @__PURE__ */ N(g, { className: "h-4 w-4" }), " Back"]
55
286
  }),
56
287
  children: [
57
- /* @__PURE__ */ _("div", {
58
- className: "flex flex-wrap items-center gap-3",
59
- children: [
60
- /* @__PURE__ */ g("span", {
61
- className: "flex size-10 items-center justify-center rounded-lg bg-[var(--color-accent-soft)] text-text-primary",
62
- children: /* @__PURE__ */ g(p, { className: "h-5 w-5" })
63
- }),
64
- /* @__PURE__ */ g(i, { status: k.status }),
65
- /* @__PURE__ */ g("span", {
66
- className: "text-sm text-text-secondary",
67
- children: k.lastRunAt ? `Last run ${r(k.lastRunAt)}` : "Never run"
68
- })
69
- ]
70
- }),
71
- k.description && /* @__PURE__ */ g("p", {
72
- className: "mt-4 max-w-3xl text-sm text-text-secondary",
73
- children: k.description
288
+ /* @__PURE__ */ N(F, {
289
+ treatment: "glass",
290
+ glow: B.status === "AUTONOMOUS",
291
+ className: "p-5",
292
+ children: /* @__PURE__ */ P("div", {
293
+ className: "flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",
294
+ children: [/* @__PURE__ */ P("div", {
295
+ className: "flex items-start gap-4",
296
+ children: [/* @__PURE__ */ N("span", {
297
+ className: "flex size-12 shrink-0 items-center justify-center rounded-xl bg-[var(--color-accent-soft)] text-text-primary",
298
+ children: /* @__PURE__ */ N(V, { className: "h-6 w-6" })
299
+ }), /* @__PURE__ */ P("div", {
300
+ className: "min-w-0",
301
+ children: [
302
+ /* @__PURE__ */ P("div", {
303
+ className: "flex flex-wrap items-center gap-2",
304
+ children: [/* @__PURE__ */ N("p", {
305
+ className: "text-lg font-semibold text-text-primary",
306
+ children: B.name
307
+ }), /* @__PURE__ */ N(a, { status: B.status })]
308
+ }),
309
+ /* @__PURE__ */ P("p", {
310
+ className: "mt-1 flex items-center gap-1.5 text-xs text-text-secondary",
311
+ children: [/* @__PURE__ */ N(b, {
312
+ className: "h-3.5 w-3.5",
313
+ "aria-hidden": !0
314
+ }), B.lastRunAt ? `Last run ${i(B.lastRunAt)}` : "Never run"]
315
+ }),
316
+ B.description && /* @__PURE__ */ N("p", {
317
+ className: "mt-2 max-w-2xl text-sm text-text-secondary",
318
+ children: B.description
319
+ })
320
+ ]
321
+ })]
322
+ }), /* @__PURE__ */ P("div", {
323
+ className: "w-full sm:w-56 sm:shrink-0",
324
+ children: [
325
+ /* @__PURE__ */ N("label", {
326
+ htmlFor: "agent-posture",
327
+ className: "mb-1 block text-xs font-medium text-text-secondary",
328
+ children: "Operating posture"
329
+ }),
330
+ /* @__PURE__ */ N("select", {
331
+ id: "agent-posture",
332
+ value: B.status,
333
+ disabled: C.isPending,
334
+ onChange: (e) => {
335
+ O(null), C.mutate({
336
+ id: B.id,
337
+ status: e.target.value
338
+ }, { onError: (e) => O(e instanceof Error ? e.message : "Could not change posture.") });
339
+ },
340
+ className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] disabled:opacity-50",
341
+ children: I.map((e) => /* @__PURE__ */ N("option", {
342
+ value: e,
343
+ children: r(e)
344
+ }, e))
345
+ }),
346
+ /* @__PURE__ */ N("p", {
347
+ className: "mt-1.5 text-[11px] leading-snug text-text-secondary",
348
+ children: "Disabled never acts · Suggest-only proposes · Autonomous acts within its policies."
349
+ })
350
+ ]
351
+ })]
352
+ })
74
353
  }),
75
- D && /* @__PURE__ */ g("div", {
354
+ E && /* @__PURE__ */ N("div", {
76
355
  className: "mt-4 rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text",
77
- children: D
356
+ children: E
78
357
  }),
79
- /* @__PURE__ */ _("div", {
80
- className: "mt-6 max-w-sm",
358
+ /* @__PURE__ */ P("div", {
359
+ className: "mt-6 grid grid-cols-1 gap-4 sm:grid-cols-3",
81
360
  children: [
82
- /* @__PURE__ */ g("label", {
83
- htmlFor: "agent-posture",
84
- className: "mb-1 block text-xs font-medium text-text-secondary",
85
- children: "Operating posture"
361
+ /* @__PURE__ */ N(n, {
362
+ icon: /* @__PURE__ */ N(T, { className: "h-5 w-5" }),
363
+ value: H.length,
364
+ label: "Policies"
86
365
  }),
87
- /* @__PURE__ */ g("select", {
88
- id: "agent-posture",
89
- value: k.status,
90
- disabled: E.isPending,
91
- onChange: (e) => {
92
- O(null), E.mutate({
93
- id: k.id,
94
- status: e.target.value
95
- }, { onError: (e) => O(e instanceof Error ? e.message : "Could not change posture.") });
96
- },
97
- className: "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)] disabled:opacity-50",
98
- children: y.map((e) => /* @__PURE__ */ g("option", {
99
- value: e,
100
- children: n(e)
101
- }, e))
366
+ /* @__PURE__ */ N(n, {
367
+ icon: /* @__PURE__ */ N(A, { className: "h-5 w-5" }),
368
+ value: G,
369
+ label: "Enabled"
102
370
  }),
103
- /* @__PURE__ */ g("p", {
104
- className: "mt-1.5 text-xs text-text-secondary",
105
- children: "Disabled never acts; Suggest-only proposes; Autonomous acts within its policies."
371
+ /* @__PURE__ */ N(n, {
372
+ icon: /* @__PURE__ */ N(j, { className: "h-5 w-5" }),
373
+ value: K,
374
+ label: "Total triggers"
106
375
  })
107
376
  ]
108
377
  }),
109
- /* @__PURE__ */ g(c, {
110
- title: "Policies",
111
- description: "The autonomous rules that bound this agent",
112
- children: !k.policies || k.policies.length === 0 ? /* @__PURE__ */ g(a, {
113
- illustration: "empty-data",
114
- title: "No policies",
115
- description: "Policies define what this agent may do autonomously, and what it must alert on."
116
- }) : /* @__PURE__ */ g("div", {
117
- className: "grid grid-cols-1 gap-3 sm:grid-cols-2",
118
- children: k.policies.map((e) => /* @__PURE__ */ _(v, {
119
- treatment: "metric",
120
- className: "p-4",
121
- children: [
122
- /* @__PURE__ */ _("div", {
123
- className: "flex items-start justify-between gap-2",
124
- children: [/* @__PURE__ */ g("p", {
125
- className: "text-sm font-medium text-text-primary",
126
- children: e.name
127
- }), /* @__PURE__ */ g(i, { status: e.isEnabled ? "ACTIVE" : "DISABLED" })]
128
- }),
129
- /* @__PURE__ */ _("p", {
130
- className: "mt-1 flex items-center gap-1.5 text-xs text-text-secondary",
131
- children: [
132
- /* @__PURE__ */ g(m, { className: "h-3.5 w-3.5" }),
133
- " Action: ",
134
- n(e.action)
135
- ]
136
- }),
137
- e.description && /* @__PURE__ */ g("p", {
138
- className: "mt-2 text-xs text-text-secondary",
139
- children: e.description
140
- }),
141
- /* @__PURE__ */ _("p", {
142
- className: "mt-2 text-xs text-text-secondary",
378
+ /* @__PURE__ */ P("div", {
379
+ className: "mt-8 grid grid-cols-1 gap-6 lg:grid-cols-3",
380
+ children: [/* @__PURE__ */ N("div", {
381
+ className: "lg:col-span-2",
382
+ children: /* @__PURE__ */ N(u, {
383
+ title: "Policies",
384
+ description: "The autonomous rules that bound this agent",
385
+ action: /* @__PURE__ */ P("button", {
386
+ type: "button",
387
+ onClick: () => L(!0),
388
+ className: "inline-flex items-center gap-1.5 rounded-lg border border-border-subtle px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken",
389
+ children: [/* @__PURE__ */ N(D, { className: "h-3.5 w-3.5" }), " Add policy"]
390
+ }),
391
+ children: H.length === 0 ? /* @__PURE__ */ N(o, {
392
+ illustration: "empty-data",
393
+ title: "No policies",
394
+ description: "Policies define what this agent may do autonomously, and what it must alert on.",
395
+ action: /* @__PURE__ */ N("button", {
396
+ type: "button",
397
+ onClick: () => L(!0),
398
+ className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90",
399
+ children: "Add policy"
400
+ })
401
+ }) : /* @__PURE__ */ N("div", {
402
+ className: "grid grid-cols-1 gap-3 sm:grid-cols-2",
403
+ children: H.map((e) => /* @__PURE__ */ N(W, { policy: e }, e.id))
404
+ })
405
+ })
406
+ }), /* @__PURE__ */ N("div", {
407
+ className: "lg:col-span-1",
408
+ children: /* @__PURE__ */ N(u, {
409
+ title: "Run history",
410
+ description: "Recent agent activity",
411
+ children: /* @__PURE__ */ N(F, {
412
+ treatment: "metric",
413
+ className: "p-5",
414
+ children: J.length === 0 ? /* @__PURE__ */ P("div", {
415
+ className: "flex flex-col items-center justify-center gap-2 py-6 text-center",
143
416
  children: [
144
- "Triggered ",
145
- e.triggerCount,
146
- "×",
147
- e.lastTriggeredAt ? ` · last ${r(e.lastTriggeredAt)}` : ""
417
+ /* @__PURE__ */ N(w, {
418
+ className: "h-8 w-8 text-text-secondary",
419
+ "aria-hidden": !0
420
+ }),
421
+ /* @__PURE__ */ N("p", {
422
+ className: "text-sm font-medium text-text-primary",
423
+ children: "No runs yet"
424
+ }),
425
+ /* @__PURE__ */ N("p", {
426
+ className: "text-xs text-text-secondary",
427
+ children: "Activity appears here once the agent runs or a policy fires."
428
+ })
148
429
  ]
149
- })
150
- ]
151
- }, e.id))
152
- })
430
+ }) : /* @__PURE__ */ N(d, { items: J })
431
+ })
432
+ })
433
+ })]
434
+ }),
435
+ k && /* @__PURE__ */ N(U, {
436
+ agentId: B.id,
437
+ onClose: () => L(!1)
153
438
  })
154
439
  ]
155
440
  });
156
441
  }
157
442
  //#endregion
158
- export { b as AgentDetailPage };
443
+ export { G as AgentDetailPage };
159
444
 
160
445
  //# sourceMappingURL=AgentDetailPage.js.map