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