@burdenoff/microfe-subscriberbot 2026.1023.2 → 2026.1029.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 (39) hide show
  1. package/dist/subscriberbot/admin/AdminDashboardPage.js +5 -5
  2. package/dist/subscriberbot/admin/AdminDashboardPage.js.map +1 -1
  3. package/dist/subscriberbot/components/PostureOptions.d.ts +10 -0
  4. package/dist/subscriberbot/components/PostureOptions.d.ts.map +1 -0
  5. package/dist/subscriberbot/components/PostureOptions.js +20 -0
  6. package/dist/subscriberbot/components/PostureOptions.js.map +1 -0
  7. package/dist/subscriberbot/components/index.d.ts +2 -0
  8. package/dist/subscriberbot/components/index.d.ts.map +1 -1
  9. package/dist/subscriberbot/components/index.js +1 -0
  10. package/dist/subscriberbot/hooks/index.d.ts +1 -0
  11. package/dist/subscriberbot/hooks/index.d.ts.map +1 -1
  12. package/dist/subscriberbot/hooks/index.js +2 -1
  13. package/dist/subscriberbot/hooks/useAutonomousAgentMode.d.ts +15 -0
  14. package/dist/subscriberbot/hooks/useAutonomousAgentMode.d.ts.map +1 -0
  15. package/dist/subscriberbot/hooks/useAutonomousAgentMode.js +13 -0
  16. package/dist/subscriberbot/hooks/useAutonomousAgentMode.js.map +1 -0
  17. package/dist/subscriberbot/pages/AssetVaultPage.js +16 -16
  18. package/dist/subscriberbot/pages/DashboardPage.js +23 -23
  19. package/dist/subscriberbot/pages/DashboardPage.js.map +1 -1
  20. package/dist/subscriberbot/pages/InboxPage.js +62 -62
  21. package/dist/subscriberbot/pages/InsightsPage.js +14 -14
  22. package/dist/subscriberbot/pages/InvoicesPage.js +66 -66
  23. package/dist/subscriberbot/pages/WorkflowsPage.js +20 -20
  24. package/dist/subscriberbot/pages/agents/AgentDetailPage.d.ts.map +1 -1
  25. package/dist/subscriberbot/pages/agents/AgentDetailPage.js +184 -182
  26. package/dist/subscriberbot/pages/agents/AgentDetailPage.js.map +1 -1
  27. package/dist/subscriberbot/pages/agents/AgentNewPage.d.ts.map +1 -1
  28. package/dist/subscriberbot/pages/agents/AgentNewPage.js +77 -79
  29. package/dist/subscriberbot/pages/agents/AgentNewPage.js.map +1 -1
  30. package/dist/subscriberbot/pages/agents/AgentsListPage.d.ts.map +1 -1
  31. package/dist/subscriberbot/pages/agents/AgentsListPage.js +134 -133
  32. package/dist/subscriberbot/pages/agents/AgentsListPage.js.map +1 -1
  33. package/dist/subscriberbot/pages/providers/ProviderDetailPage.js +64 -64
  34. package/dist/subscriberbot/pages/providers/ProviderNewPage.js +3 -3
  35. package/dist/subscriberbot/pages/providers/ProvidersListPage.js +18 -18
  36. package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js +76 -76
  37. package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js +6 -6
  38. package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js +7 -7
  39. package/package.json +1 -1
@@ -5,22 +5,24 @@ import { formatEnumLabel as r, formatNumber as i, formatRelativeTime as a } from
5
5
  import { StatusBadge as o } from "../../components/StatusBadge.js";
6
6
  import { EmptyState as s } from "../../components/EmptyState.js";
7
7
  import { Modal as c } from "../../components/Modal.js";
8
- import { ErrorView as l, LoadingView as u, Section as d } from "../../components/StateViews.js";
9
- import { Timeline as f } from "../../components/viz.js";
8
+ import { useAutonomousAgentMode as l } from "../../hooks/useAutonomousAgentMode.js";
9
+ import { useTr as u } from "../../hooks/useTr.js";
10
+ import { PostureOptions as d } from "../../components/PostureOptions.js";
11
+ import { ErrorView as f, LoadingView as p, Section as m } from "../../components/StateViews.js";
12
+ import { Timeline as h } from "../../components/viz.js";
10
13
  import "../../components/index.js";
11
- import { useAgent as p, useCreatePolicy as m, useSetAgentStatus as h } from "../../hooks/useSubscriberBotApi.js";
12
- import { useTr as g } from "../../hooks/useTr.js";
13
- import { useState as _ } from "react";
14
- import { ArrowLeft as v, ArrowLeftRight as y, Bot as b, Building2 as x, Clock as S, ConciergeBell as C, DollarSign as w, Handshake as T, History as E, ListChecks as D, Mail as O, Plus as k, RefreshCw as A, Search as j, ShieldCheck as M, SlidersHorizontal as N, Zap as P } from "lucide-react";
15
- import { useParams as F } from "react-router";
16
- import { jsx as I, jsxs as L } from "react/jsx-runtime";
17
- import { GlassCard as R } from "@burdenoff/fe-libs/ui";
14
+ import { useAgent as g, useCreatePolicy as _, useSetAgentStatus as v } from "../../hooks/useSubscriberBotApi.js";
15
+ import { useState as y } from "react";
16
+ import { ArrowLeft as b, ArrowLeftRight as x, Bot as S, Building2 as C, Clock as w, ConciergeBell as T, DollarSign as E, Handshake as D, History as O, ListChecks as k, Mail as A, Plus as j, RefreshCw as M, Search as N, ShieldCheck as P, SlidersHorizontal as F, Zap as I } from "lucide-react";
17
+ import { useParams as L } from "react-router";
18
+ import { jsx as R, jsxs as z } from "react/jsx-runtime";
19
+ import { GlassCard as B } from "@burdenoff/fe-libs/ui";
18
20
  //#region src/subscriberbot/pages/agents/AgentDetailPage.tsx
19
- var z = [
21
+ var V = [
20
22
  "DISABLED",
21
23
  "SUGGEST_ONLY",
22
24
  "AUTONOMOUS"
23
- ], B = {
25
+ ], H = {
24
26
  DISCOVERY: "agents.kinds.discovery",
25
27
  RENEWAL: "agents.kinds.renewal",
26
28
  COST: "agents.kinds.cost",
@@ -30,7 +32,7 @@ var z = [
30
32
  NEGOTIATION: "agents.kinds.negotiation",
31
33
  MIGRATION: "agents.kinds.migration",
32
34
  CONCIERGE: "agents.kinds.concierge"
33
- }, V = [
35
+ }, U = [
34
36
  "ALERT",
35
37
  "CREATE_TASK",
36
38
  "RENEW",
@@ -38,18 +40,18 @@ var z = [
38
40
  "PAUSE",
39
41
  "UPGRADE",
40
42
  "DOWNGRADE"
41
- ], H = {
42
- DISCOVERY: j,
43
- RENEWAL: A,
44
- COST: w,
45
- NEWSLETTER: O,
46
- VENDOR: x,
47
- COMPLIANCE: M,
48
- NEGOTIATION: T,
49
- MIGRATION: y,
50
- CONCIERGE: C
43
+ ], W = {
44
+ DISCOVERY: N,
45
+ RENEWAL: M,
46
+ COST: E,
47
+ NEWSLETTER: A,
48
+ VENDOR: C,
49
+ COMPLIANCE: P,
50
+ NEGOTIATION: D,
51
+ MIGRATION: x,
52
+ CONCIERGE: T
51
53
  };
52
- function U(e) {
54
+ function G(e) {
53
55
  switch (e) {
54
56
  case "RENEW":
55
57
  case "UPGRADE": return "positive";
@@ -60,46 +62,46 @@ function U(e) {
60
62
  default: return "default";
61
63
  }
62
64
  }
63
- var W = "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)]", G = "mb-1 block text-xs font-medium text-text-secondary";
64
- function K(e) {
65
+ var K = "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)]", q = "mb-1 block text-xs font-medium text-text-secondary";
66
+ function J(e) {
65
67
  let t = e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " ").trim();
66
68
  return t.charAt(0).toUpperCase() + t.slice(1);
67
69
  }
68
- function q(e) {
69
- return e == null ? "—" : typeof e == "string" ? e : typeof e == "number" ? i(e) : typeof e == "boolean" ? e ? "Yes" : "No" : Array.isArray(e) ? e.map(q).join(", ") : JSON.stringify(e);
70
+ function Y(e) {
71
+ return e == null ? "—" : typeof e == "string" ? e : typeof e == "number" ? i(e) : typeof e == "boolean" ? e ? "Yes" : "No" : Array.isArray(e) ? e.map(Y).join(", ") : JSON.stringify(e);
70
72
  }
71
- function J(e) {
73
+ function X(e) {
72
74
  return !e || Array.isArray(e) ? [] : Object.entries(e).filter(([, e]) => e != null && e !== "").map(([e, t]) => ({
73
75
  key: e,
74
- value: q(t)
76
+ value: Y(t)
75
77
  }));
76
78
  }
77
- function Y({ enabled: e }) {
78
- let t = g();
79
- return /* @__PURE__ */ L("span", {
79
+ function Z({ enabled: e }) {
80
+ let t = u();
81
+ return /* @__PURE__ */ z("span", {
80
82
  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",
81
- children: [/* @__PURE__ */ I("span", {
83
+ children: [/* @__PURE__ */ R("span", {
82
84
  "aria-hidden": !0,
83
85
  className: "size-1.5 rounded-full bg-current",
84
86
  style: { opacity: e ? 1 : .6 }
85
87
  }), e ? t("agents.detail.enabled", "Enabled") : t("agents.detail.disabled", "Disabled")]
86
88
  });
87
89
  }
88
- function X({ agentId: e, onClose: t }) {
89
- let n = g(), i = m(), [a, o] = _(""), [s, l] = _("ALERT"), [u, d] = _(""), [f, p] = _(""), [h, v] = _(!0), [y, b] = _(null);
90
- return /* @__PURE__ */ I(c, {
90
+ function Q({ agentId: e, onClose: t }) {
91
+ let n = u(), i = _(), [a, o] = y(""), [s, l] = y("ALERT"), [d, f] = y(""), [p, m] = y(""), [h, g] = y(!0), [v, b] = y(null);
92
+ return /* @__PURE__ */ R(c, {
91
93
  title: n("agents.policyModal.title", "Add policy"),
92
94
  onClose: t,
93
95
  maxWidthClassName: "max-w-xl",
94
- children: /* @__PURE__ */ L("form", {
96
+ children: /* @__PURE__ */ z("form", {
95
97
  onSubmit: (r) => {
96
98
  if (r.preventDefault(), b(null), !a.trim()) {
97
99
  b(n("agents.policyModal.nameRequired", "A policy name is required."));
98
100
  return;
99
101
  }
100
102
  let o;
101
- if (f.trim()) try {
102
- o = JSON.parse(f);
103
+ if (p.trim()) try {
104
+ o = JSON.parse(p);
103
105
  } catch {
104
106
  b(n("agents.policyModal.conditionInvalid", "Condition must be valid JSON (e.g. {\"amountOver\": 100})."));
105
107
  return;
@@ -109,7 +111,7 @@ function X({ agentId: e, onClose: t }) {
109
111
  name: a.trim(),
110
112
  action: s,
111
113
  isEnabled: h,
112
- ...u.trim() ? { description: u.trim() } : {},
114
+ ...d.trim() ? { description: d.trim() } : {},
113
115
  ...o ? { condition: o } : {}
114
116
  }, {
115
117
  onSuccess: () => t(),
@@ -118,51 +120,51 @@ function X({ agentId: e, onClose: t }) {
118
120
  },
119
121
  className: "space-y-4",
120
122
  children: [
121
- y && /* @__PURE__ */ I("div", {
123
+ v && /* @__PURE__ */ R("div", {
122
124
  className: "rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text",
123
- children: y
125
+ children: v
124
126
  }),
125
- /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ L("label", {
127
+ /* @__PURE__ */ z("div", { children: [/* @__PURE__ */ z("label", {
126
128
  htmlFor: "policy-name",
127
- className: G,
129
+ className: q,
128
130
  children: [
129
131
  n("agents.policyModal.nameLabel", "Name"),
130
132
  " ",
131
- /* @__PURE__ */ I("span", {
133
+ /* @__PURE__ */ R("span", {
132
134
  className: "text-status-error-text",
133
135
  children: "*"
134
136
  })
135
137
  ]
136
- }), /* @__PURE__ */ I("input", {
138
+ }), /* @__PURE__ */ R("input", {
137
139
  id: "policy-name",
138
140
  type: "text",
139
141
  value: a,
140
142
  onChange: (e) => o(e.target.value),
141
143
  placeholder: n("agents.policyModal.namePlaceholder", "e.g. Alert on price hike over 20%"),
142
- className: W,
144
+ className: K,
143
145
  required: !0
144
146
  })] }),
145
- /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("label", {
147
+ /* @__PURE__ */ z("div", { children: [/* @__PURE__ */ R("label", {
146
148
  htmlFor: "policy-action",
147
- className: G,
149
+ className: q,
148
150
  children: n("agents.policyModal.actionLabel", "Action")
149
- }), /* @__PURE__ */ I("select", {
151
+ }), /* @__PURE__ */ R("select", {
150
152
  id: "policy-action",
151
153
  value: s,
152
154
  onChange: (e) => l(e.target.value),
153
- className: W,
154
- children: V.map((e) => /* @__PURE__ */ I("option", {
155
+ className: K,
156
+ children: U.map((e) => /* @__PURE__ */ R("option", {
155
157
  value: e,
156
158
  children: r(e)
157
159
  }, e))
158
160
  })] }),
159
- /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ L("label", {
161
+ /* @__PURE__ */ z("div", { children: [/* @__PURE__ */ z("label", {
160
162
  htmlFor: "policy-condition",
161
- className: G,
163
+ className: q,
162
164
  children: [
163
165
  n("agents.policyModal.conditionLabel", "Condition"),
164
166
  " ",
165
- /* @__PURE__ */ L("span", {
167
+ /* @__PURE__ */ z("span", {
166
168
  className: "text-text-secondary",
167
169
  children: [
168
170
  "(",
@@ -171,42 +173,42 @@ function X({ agentId: e, onClose: t }) {
171
173
  ]
172
174
  })
173
175
  ]
174
- }), /* @__PURE__ */ I("textarea", {
176
+ }), /* @__PURE__ */ R("textarea", {
175
177
  id: "policy-condition",
176
- value: f,
177
- onChange: (e) => p(e.target.value),
178
+ value: p,
179
+ onChange: (e) => m(e.target.value),
178
180
  rows: 3,
179
181
  placeholder: n("agents.policyModal.conditionPlaceholder", "{ \"priceIncreasePct\": 20 }"),
180
- className: `${W} font-mono`
182
+ className: `${K} font-mono`
181
183
  })] }),
182
- /* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("label", {
184
+ /* @__PURE__ */ z("div", { children: [/* @__PURE__ */ R("label", {
183
185
  htmlFor: "policy-desc",
184
- className: G,
186
+ className: q,
185
187
  children: n("agents.policyModal.descriptionLabel", "Description")
186
- }), /* @__PURE__ */ I("textarea", {
188
+ }), /* @__PURE__ */ R("textarea", {
187
189
  id: "policy-desc",
188
- value: u,
189
- onChange: (e) => d(e.target.value),
190
+ value: d,
191
+ onChange: (e) => f(e.target.value),
190
192
  rows: 2,
191
- className: W
193
+ className: K
192
194
  })] }),
193
- /* @__PURE__ */ L("label", {
195
+ /* @__PURE__ */ z("label", {
194
196
  className: "flex items-center gap-2 text-sm text-text-primary",
195
- children: [/* @__PURE__ */ I("input", {
197
+ children: [/* @__PURE__ */ R("input", {
196
198
  type: "checkbox",
197
199
  checked: h,
198
- onChange: (e) => v(e.target.checked),
200
+ onChange: (e) => g(e.target.checked),
199
201
  className: "size-4 rounded border-border-subtle"
200
202
  }), n("agents.policyModal.enabled", "Enabled")]
201
203
  }),
202
- /* @__PURE__ */ L("div", {
204
+ /* @__PURE__ */ z("div", {
203
205
  className: "flex justify-end gap-3",
204
- children: [/* @__PURE__ */ I("button", {
206
+ children: [/* @__PURE__ */ R("button", {
205
207
  type: "button",
206
208
  onClick: t,
207
209
  className: "rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
208
210
  children: n("agents.policyModal.cancel", "Cancel")
209
- }), /* @__PURE__ */ I("button", {
211
+ }), /* @__PURE__ */ R("button", {
210
212
  type: "submit",
211
213
  disabled: i.isPending,
212
214
  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",
@@ -217,69 +219,69 @@ function X({ agentId: e, onClose: t }) {
217
219
  })
218
220
  });
219
221
  }
220
- function Z({ policy: e }) {
221
- let t = g(), n = J(e.condition);
222
- return /* @__PURE__ */ L(R, {
222
+ function ee({ policy: e }) {
223
+ let t = u(), n = X(e.condition);
224
+ return /* @__PURE__ */ z(B, {
223
225
  treatment: "metric",
224
226
  className: "flex flex-col p-4",
225
227
  children: [
226
- /* @__PURE__ */ L("div", {
228
+ /* @__PURE__ */ z("div", {
227
229
  className: "flex items-start justify-between gap-2",
228
- children: [/* @__PURE__ */ I("p", {
230
+ children: [/* @__PURE__ */ R("p", {
229
231
  className: "text-sm font-semibold text-text-primary",
230
232
  children: e.name
231
- }), /* @__PURE__ */ I(Y, { enabled: e.isEnabled })]
233
+ }), /* @__PURE__ */ R(Z, { enabled: e.isEnabled })]
232
234
  }),
233
- /* @__PURE__ */ L("div", {
235
+ /* @__PURE__ */ z("div", {
234
236
  className: "mt-2 flex flex-wrap items-center gap-2",
235
- children: [/* @__PURE__ */ L("span", {
237
+ children: [/* @__PURE__ */ z("span", {
236
238
  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",
237
239
  children: [
238
- /* @__PURE__ */ I(M, {
240
+ /* @__PURE__ */ R(P, {
239
241
  className: "h-3 w-3",
240
242
  "aria-hidden": !0
241
243
  }),
242
244
  " ",
243
245
  r(e.action)
244
246
  ]
245
- }), /* @__PURE__ */ I("span", {
247
+ }), /* @__PURE__ */ R("span", {
246
248
  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",
247
249
  children: t("agents.detail.triggered", "Triggered {{count}}×", { count: e.triggerCount })
248
250
  })]
249
251
  }),
250
- e.description && /* @__PURE__ */ I("p", {
252
+ e.description && /* @__PURE__ */ R("p", {
251
253
  className: "mt-2 line-clamp-2 text-xs text-text-secondary",
252
254
  children: e.description
253
255
  }),
254
- n.length > 0 && /* @__PURE__ */ L("div", {
256
+ n.length > 0 && /* @__PURE__ */ z("div", {
255
257
  className: "mt-3 border-t border-border-subtle pt-2.5",
256
- children: [/* @__PURE__ */ L("p", {
258
+ children: [/* @__PURE__ */ z("p", {
257
259
  className: "flex items-center gap-1.5 text-[10px] font-medium uppercase tracking-wide text-text-secondary",
258
260
  children: [
259
- /* @__PURE__ */ I(N, {
261
+ /* @__PURE__ */ R(F, {
260
262
  className: "h-3 w-3",
261
263
  "aria-hidden": !0
262
264
  }),
263
265
  " ",
264
266
  t("agents.detail.firesWhen", "Fires when")
265
267
  ]
266
- }), /* @__PURE__ */ I("div", {
268
+ }), /* @__PURE__ */ R("div", {
267
269
  className: "mt-1.5 flex flex-wrap gap-1.5",
268
- children: n.map((e) => /* @__PURE__ */ L("span", {
270
+ children: n.map((e) => /* @__PURE__ */ z("span", {
269
271
  className: "inline-flex items-center gap-1.5 rounded-md border border-border-subtle bg-bg-sunken px-2 py-0.5 text-[11px] text-text-secondary",
270
- children: [/* @__PURE__ */ I("span", {
272
+ children: [/* @__PURE__ */ R("span", {
271
273
  className: "font-medium text-text-primary",
272
- children: K(e.key)
273
- }), /* @__PURE__ */ I("span", {
274
+ children: J(e.key)
275
+ }), /* @__PURE__ */ R("span", {
274
276
  className: "font-mono tabular-nums",
275
277
  children: e.value
276
278
  })]
277
279
  }, e.key))
278
280
  })]
279
281
  }),
280
- /* @__PURE__ */ L("p", {
282
+ /* @__PURE__ */ z("p", {
281
283
  className: "mt-2 flex items-center gap-1.5 text-xs text-text-secondary",
282
- children: [/* @__PURE__ */ I(S, {
284
+ children: [/* @__PURE__ */ R(w, {
283
285
  className: "h-3.5 w-3.5",
284
286
  "aria-hidden": !0
285
287
  }), e.lastTriggeredAt ? t("agents.detail.triggered", "Triggered {{count}}×", { count: e.triggerCount }) : t("agents.detail.notYetTriggered", "Not yet triggered")]
@@ -287,227 +289,227 @@ function Z({ policy: e }) {
287
289
  ]
288
290
  });
289
291
  }
290
- function Q() {
291
- let i = g(), { id: c } = F(), { navigateTo: m } = e(), { data: y, isLoading: x, isError: C, refetch: w } = p(c), T = h(), [O, A] = _(null), [j, N] = _(!1);
292
- if (x) return /* @__PURE__ */ I(t, {
292
+ function $() {
293
+ let i = u(), { id: c } = L(), { navigateTo: _ } = e(), { data: x, isLoading: C, isError: T, refetch: E } = g(c), D = v(), A = l(), [M, N] = y(null), [F, U] = y(!1);
294
+ if (C) return /* @__PURE__ */ R(t, {
293
295
  title: i("agents.detail.loading", "Loading agent…"),
294
- children: /* @__PURE__ */ I(u, { label: i("agents.detail.loading", "Loading agent…") })
296
+ children: /* @__PURE__ */ R(p, { label: i("agents.detail.loading", "Loading agent…") })
295
297
  });
296
- if (C) return /* @__PURE__ */ I(t, {
298
+ if (T) return /* @__PURE__ */ R(t, {
297
299
  title: i("agents.title", "AI Agents"),
298
- children: /* @__PURE__ */ I(l, {
300
+ children: /* @__PURE__ */ R(f, {
299
301
  message: i("agents.detail.error", "Could not load this agent."),
300
- onRetry: () => void w()
302
+ onRetry: () => void E()
301
303
  })
302
304
  });
303
- if (!y) return /* @__PURE__ */ I(t, {
305
+ if (!x) return /* @__PURE__ */ R(t, {
304
306
  title: i("agents.title", "AI Agents"),
305
- children: /* @__PURE__ */ I(s, {
307
+ children: /* @__PURE__ */ R(s, {
306
308
  illustration: "empty-data",
307
309
  title: i("agents.detail.notFoundTitle", "Agent not found"),
308
310
  description: i("agents.detail.notFoundDescription", "It may have been removed, or you may not have access to it."),
309
- action: /* @__PURE__ */ I("button", {
311
+ action: /* @__PURE__ */ R("button", {
310
312
  type: "button",
311
- onClick: () => m("/agents"),
313
+ onClick: () => _("/agents"),
312
314
  className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90",
313
315
  children: i("agents.detail.backToAgents", "Back to agents")
314
316
  })
315
317
  })
316
318
  });
317
- let V = y, W = H[V.kind] ?? b, G = V.policies ?? [], K = G.filter((e) => e.isEnabled).length, q = G.reduce((e, t) => e + (t.triggerCount || 0), 0), J = [];
318
- V.lastRunAt && J.push({
319
- ts: new Date(V.lastRunAt).getTime(),
319
+ let K = x, q = W[K.kind] ?? S, J = K.policies ?? [], Y = J.filter((e) => e.isEnabled).length, X = J.reduce((e, t) => e + (t.triggerCount || 0), 0), Z = [];
320
+ K.lastRunAt && Z.push({
321
+ ts: new Date(K.lastRunAt).getTime(),
320
322
  item: {
321
323
  title: i("agents.detail.agentRun", "Agent run"),
322
324
  sub: i("agents.detail.agentRunSub", "Latest autonomous cycle"),
323
- meta: a(V.lastRunAt),
325
+ meta: a(K.lastRunAt),
324
326
  tone: "positive"
325
327
  }
326
328
  });
327
- for (let e of G) e.lastTriggeredAt && J.push({
329
+ for (let e of J) e.lastTriggeredAt && Z.push({
328
330
  ts: new Date(e.lastTriggeredAt).getTime(),
329
331
  item: {
330
332
  title: e.name,
331
333
  sub: `${r(e.action)} · ${i("agents.detail.triggered", "Triggered {{count}}×", { count: e.triggerCount })}`,
332
334
  meta: a(e.lastTriggeredAt),
333
- tone: U(e.action)
335
+ tone: G(e.action)
334
336
  }
335
337
  });
336
- J.sort((e, t) => t.ts - e.ts);
337
- let Y = J.map((e) => e.item);
338
- return /* @__PURE__ */ L(t, {
339
- title: V.name,
340
- description: `${i(B[V.kind] ?? "", r(V.kind))} ${i("agents.card.kindSuffix", "agent")}`,
341
- actions: /* @__PURE__ */ L("button", {
338
+ Z.sort((e, t) => t.ts - e.ts);
339
+ let $ = Z.map((e) => e.item);
340
+ return /* @__PURE__ */ z(t, {
341
+ title: K.name,
342
+ description: `${i(H[K.kind] ?? "", r(K.kind))} ${i("agents.card.kindSuffix", "agent")}`,
343
+ actions: /* @__PURE__ */ z("button", {
342
344
  type: "button",
343
- onClick: () => m("/agents"),
345
+ onClick: () => _("/agents"),
344
346
  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",
345
347
  children: [
346
- /* @__PURE__ */ I(v, { className: "h-4 w-4" }),
348
+ /* @__PURE__ */ R(b, { className: "h-4 w-4" }),
347
349
  " ",
348
350
  i("agents.new.back", "Back")
349
351
  ]
350
352
  }),
351
353
  children: [
352
- /* @__PURE__ */ I(R, {
354
+ /* @__PURE__ */ R(B, {
353
355
  treatment: "glass",
354
- glow: V.status === "AUTONOMOUS",
356
+ glow: K.status === "AUTONOMOUS",
355
357
  className: "p-5",
356
- children: /* @__PURE__ */ L("div", {
358
+ children: /* @__PURE__ */ z("div", {
357
359
  className: "flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",
358
- children: [/* @__PURE__ */ L("div", {
360
+ children: [/* @__PURE__ */ z("div", {
359
361
  className: "flex items-start gap-4",
360
- children: [/* @__PURE__ */ I("span", {
362
+ children: [/* @__PURE__ */ R("span", {
361
363
  className: "flex size-12 shrink-0 items-center justify-center rounded-xl bg-[var(--color-accent-soft)] text-text-primary",
362
- children: /* @__PURE__ */ I(W, { className: "h-6 w-6" })
363
- }), /* @__PURE__ */ L("div", {
364
+ children: /* @__PURE__ */ R(q, { className: "h-6 w-6" })
365
+ }), /* @__PURE__ */ z("div", {
364
366
  className: "min-w-0",
365
367
  children: [
366
- /* @__PURE__ */ L("div", {
368
+ /* @__PURE__ */ z("div", {
367
369
  className: "flex flex-wrap items-center gap-2",
368
- children: [/* @__PURE__ */ I("p", {
370
+ children: [/* @__PURE__ */ R("p", {
369
371
  className: "text-lg font-semibold text-text-primary",
370
- children: V.name
371
- }), /* @__PURE__ */ I(o, { status: V.status })]
372
+ children: K.name
373
+ }), /* @__PURE__ */ R(o, { status: K.status })]
372
374
  }),
373
- /* @__PURE__ */ L("p", {
375
+ /* @__PURE__ */ z("p", {
374
376
  className: "mt-1 flex items-center gap-1.5 text-xs text-text-secondary",
375
- children: [/* @__PURE__ */ I(S, {
377
+ children: [/* @__PURE__ */ R(w, {
376
378
  className: "h-3.5 w-3.5",
377
379
  "aria-hidden": !0
378
- }), V.lastRunAt ? i("agents.card.lastRun", "Last run {{when}}", { when: a(V.lastRunAt) }) : i("agents.card.neverRun", "Never run")]
380
+ }), K.lastRunAt ? i("agents.card.lastRun", "Last run {{when}}", { when: a(K.lastRunAt) }) : i("agents.card.neverRun", "Never run")]
379
381
  }),
380
- V.description && /* @__PURE__ */ I("p", {
382
+ K.description && /* @__PURE__ */ R("p", {
381
383
  className: "mt-2 max-w-2xl text-sm text-text-secondary",
382
- children: V.description
384
+ children: K.description
383
385
  })
384
386
  ]
385
387
  })]
386
- }), /* @__PURE__ */ L("div", {
388
+ }), /* @__PURE__ */ z("div", {
387
389
  className: "w-full sm:w-56 sm:shrink-0",
388
390
  children: [
389
- /* @__PURE__ */ I("label", {
391
+ /* @__PURE__ */ R("label", {
390
392
  htmlFor: "agent-posture",
391
393
  className: "mb-1 block text-xs font-medium text-text-secondary",
392
394
  children: i("agents.detail.operatingPosture", "Operating posture")
393
395
  }),
394
- /* @__PURE__ */ I("select", {
396
+ /* @__PURE__ */ R("select", {
395
397
  id: "agent-posture",
396
- value: V.status,
397
- disabled: T.isPending,
398
+ value: K.status,
399
+ disabled: D.isPending,
398
400
  onChange: (e) => {
399
- A(null), T.mutate({
400
- id: V.id,
401
+ N(null), D.mutate({
402
+ id: K.id,
401
403
  status: e.target.value
402
- }, { onError: (e) => A(e instanceof Error ? e.message : i("agents.detail.error", "Could not load this agent.")) });
404
+ }, { onError: (e) => N(e instanceof Error ? e.message : i("agents.detail.error", "Could not load this agent.")) });
403
405
  },
404
406
  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",
405
- children: z.map((e) => /* @__PURE__ */ I("option", {
406
- value: e,
407
- children: i(`agents.postures.${e.toLowerCase()}`, r(e))
408
- }, e))
407
+ children: /* @__PURE__ */ R(d, {
408
+ options: V,
409
+ currentStatus: K.status
410
+ })
409
411
  }),
410
- /* @__PURE__ */ I("p", {
412
+ /* @__PURE__ */ R("p", {
411
413
  className: "mt-1.5 text-[11px] leading-snug text-text-secondary",
412
- children: i("agents.detail.postureHint", "Disabled never acts · Suggest-only proposes · Autonomous acts within its policies.")
414
+ children: A ? i("agents.detail.postureHint", "Disabled never acts · Suggest-only proposes · Autonomous acts within its policies.") : i("agents.detail.postureHintGated", "Disabled never acts · Suggest-only proposes. Autonomous mode is not available yet — agents only suggest, they never act on their own.")
413
415
  })
414
416
  ]
415
417
  })]
416
418
  })
417
419
  }),
418
- O && /* @__PURE__ */ I("div", {
420
+ M && /* @__PURE__ */ R("div", {
419
421
  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",
420
- children: O
422
+ children: M
421
423
  }),
422
- /* @__PURE__ */ L("div", {
424
+ /* @__PURE__ */ z("div", {
423
425
  className: "mt-6 grid grid-cols-1 gap-4 sm:grid-cols-3",
424
426
  children: [
425
- /* @__PURE__ */ I(n, {
426
- icon: /* @__PURE__ */ I(D, { className: "h-5 w-5" }),
427
- value: G.length,
427
+ /* @__PURE__ */ R(n, {
428
+ icon: /* @__PURE__ */ R(k, { className: "h-5 w-5" }),
429
+ value: J.length,
428
430
  label: i("agents.detail.policies", "Policies")
429
431
  }),
430
- /* @__PURE__ */ I(n, {
431
- icon: /* @__PURE__ */ I(M, { className: "h-5 w-5" }),
432
- value: K,
432
+ /* @__PURE__ */ R(n, {
433
+ icon: /* @__PURE__ */ R(P, { className: "h-5 w-5" }),
434
+ value: Y,
433
435
  label: i("agents.detail.enabled", "Enabled")
434
436
  }),
435
- /* @__PURE__ */ I(n, {
436
- icon: /* @__PURE__ */ I(P, { className: "h-5 w-5" }),
437
- value: q,
437
+ /* @__PURE__ */ R(n, {
438
+ icon: /* @__PURE__ */ R(I, { className: "h-5 w-5" }),
439
+ value: X,
438
440
  label: i("agents.detail.totalTriggers", "Total triggers")
439
441
  })
440
442
  ]
441
443
  }),
442
- /* @__PURE__ */ L("div", {
444
+ /* @__PURE__ */ z("div", {
443
445
  className: "mt-8 grid grid-cols-1 gap-6 lg:grid-cols-3",
444
- children: [/* @__PURE__ */ I("div", {
446
+ children: [/* @__PURE__ */ R("div", {
445
447
  className: "lg:col-span-2",
446
- children: /* @__PURE__ */ I(d, {
448
+ children: /* @__PURE__ */ R(m, {
447
449
  title: i("agents.detail.policies", "Policies"),
448
450
  description: i("agents.detail.policiesDescription", "The autonomous rules that bound this agent"),
449
- action: /* @__PURE__ */ L("button", {
451
+ action: /* @__PURE__ */ z("button", {
450
452
  type: "button",
451
- onClick: () => N(!0),
453
+ onClick: () => U(!0),
452
454
  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",
453
455
  children: [
454
- /* @__PURE__ */ I(k, { className: "h-3.5 w-3.5" }),
456
+ /* @__PURE__ */ R(j, { className: "h-3.5 w-3.5" }),
455
457
  " ",
456
458
  i("agents.detail.addPolicy", "Add policy")
457
459
  ]
458
460
  }),
459
- children: G.length === 0 ? /* @__PURE__ */ I(s, {
461
+ children: J.length === 0 ? /* @__PURE__ */ R(s, {
460
462
  illustration: "empty-data",
461
463
  title: i("agents.detail.noPoliciesTitle", "No policies"),
462
464
  description: i("agents.detail.noPoliciesDescription", "Policies define what this agent may do autonomously, and what it must alert on."),
463
- action: /* @__PURE__ */ I("button", {
465
+ action: /* @__PURE__ */ R("button", {
464
466
  type: "button",
465
- onClick: () => N(!0),
467
+ onClick: () => U(!0),
466
468
  className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90",
467
469
  children: i("agents.detail.addPolicy", "Add policy")
468
470
  })
469
- }) : /* @__PURE__ */ I("div", {
471
+ }) : /* @__PURE__ */ R("div", {
470
472
  className: "grid grid-cols-1 gap-3 sm:grid-cols-2",
471
- children: G.map((e) => /* @__PURE__ */ I(Z, { policy: e }, e.id))
473
+ children: J.map((e) => /* @__PURE__ */ R(ee, { policy: e }, e.id))
472
474
  })
473
475
  })
474
- }), /* @__PURE__ */ I("div", {
476
+ }), /* @__PURE__ */ R("div", {
475
477
  className: "lg:col-span-1",
476
- children: /* @__PURE__ */ I(d, {
478
+ children: /* @__PURE__ */ R(m, {
477
479
  title: i("agents.detail.runHistory", "Run history"),
478
480
  description: i("agents.detail.runHistoryDescription", "Recent agent activity"),
479
- children: /* @__PURE__ */ I(R, {
481
+ children: /* @__PURE__ */ R(B, {
480
482
  treatment: "metric",
481
483
  className: "p-5",
482
- children: Y.length === 0 ? /* @__PURE__ */ L("div", {
484
+ children: $.length === 0 ? /* @__PURE__ */ z("div", {
483
485
  className: "flex flex-col items-center justify-center gap-2 py-6 text-center",
484
486
  children: [
485
- /* @__PURE__ */ I(E, {
487
+ /* @__PURE__ */ R(O, {
486
488
  className: "h-8 w-8 text-text-secondary",
487
489
  "aria-hidden": !0
488
490
  }),
489
- /* @__PURE__ */ I("p", {
491
+ /* @__PURE__ */ R("p", {
490
492
  className: "text-sm font-medium text-text-primary",
491
493
  children: i("agents.detail.noRunsTitle", "No runs yet")
492
494
  }),
493
- /* @__PURE__ */ I("p", {
495
+ /* @__PURE__ */ R("p", {
494
496
  className: "text-xs text-text-secondary",
495
497
  children: i("agents.detail.noRunsDescription", "Activity appears here once the agent runs or a policy fires.")
496
498
  })
497
499
  ]
498
- }) : /* @__PURE__ */ I(f, { items: Y })
500
+ }) : /* @__PURE__ */ R(h, { items: $ })
499
501
  })
500
502
  })
501
503
  })]
502
504
  }),
503
- j && /* @__PURE__ */ I(X, {
504
- agentId: V.id,
505
- onClose: () => N(!1)
505
+ F && /* @__PURE__ */ R(Q, {
506
+ agentId: K.id,
507
+ onClose: () => U(!1)
506
508
  })
507
509
  ]
508
510
  });
509
511
  }
510
512
  //#endregion
511
- export { Q as AgentDetailPage };
513
+ export { $ as AgentDetailPage };
512
514
 
513
515
  //# sourceMappingURL=AgentDetailPage.js.map