@burdenoff/microfe-subscriberbot 2026.706.2 → 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.
- package/dist/subscriberbot/SubscriberBotRoutes.js +14 -6
- package/dist/subscriberbot/SubscriberBotRoutes.js.map +1 -1
- package/dist/subscriberbot/components/index.js +7 -0
- package/dist/subscriberbot/components/viz.js +196 -0
- package/dist/subscriberbot/components/viz.js.map +1 -0
- package/dist/subscriberbot/hooks/useSubscriberBotApi.js +38 -30
- package/dist/subscriberbot/hooks/useSubscriberBotApi.js.map +1 -1
- package/dist/subscriberbot/pages/AssetVaultPage.js +182 -0
- package/dist/subscriberbot/pages/AssetVaultPage.js.map +1 -0
- package/dist/subscriberbot/pages/DashboardPage.js +272 -199
- package/dist/subscriberbot/pages/DashboardPage.js.map +1 -1
- package/dist/subscriberbot/pages/InboxPage.js +517 -234
- package/dist/subscriberbot/pages/InboxPage.js.map +1 -1
- package/dist/subscriberbot/pages/InsightsPage.js +220 -0
- package/dist/subscriberbot/pages/InsightsPage.js.map +1 -0
- package/dist/subscriberbot/pages/InvoicesPage.js +325 -237
- package/dist/subscriberbot/pages/InvoicesPage.js.map +1 -1
- package/dist/subscriberbot/pages/WorkflowsPage.js +301 -112
- package/dist/subscriberbot/pages/WorkflowsPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentDetailPage.js +311 -165
- package/dist/subscriberbot/pages/agents/AgentDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentsListPage.js +183 -93
- package/dist/subscriberbot/pages/agents/AgentsListPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.js +426 -293
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderNewPage.js +217 -153
- package/dist/subscriberbot/pages/providers/ProviderNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProvidersListPage.js +215 -112
- package/dist/subscriberbot/pages/providers/ProvidersListPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js +542 -428
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js +242 -192
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js +174 -133
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,22 +1,25 @@
|
|
|
1
1
|
import { useSubscriberBot as e } from "../../context/SubscriberBotContext.js";
|
|
2
2
|
import { PageLayout as t } from "../../components/PageLayout.js";
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
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";
|
|
14
17
|
//#region src/subscriberbot/pages/agents/AgentDetailPage.tsx
|
|
15
|
-
var
|
|
18
|
+
var I = [
|
|
16
19
|
"DISABLED",
|
|
17
20
|
"SUGGEST_ONLY",
|
|
18
21
|
"AUTONOMOUS"
|
|
19
|
-
],
|
|
22
|
+
], L = [
|
|
20
23
|
"ALERT",
|
|
21
24
|
"CREATE_TASK",
|
|
22
25
|
"RENEW",
|
|
@@ -24,22 +27,54 @@ var S = [
|
|
|
24
27
|
"PAUSE",
|
|
25
28
|
"UPGRADE",
|
|
26
29
|
"DOWNGRADE"
|
|
27
|
-
],
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
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, {
|
|
31
66
|
title: "Add policy",
|
|
32
67
|
onClose: t,
|
|
33
68
|
maxWidthClassName: "max-w-xl",
|
|
34
|
-
children: /* @__PURE__ */
|
|
69
|
+
children: /* @__PURE__ */ P("form", {
|
|
35
70
|
onSubmit: (i) => {
|
|
36
71
|
if (i.preventDefault(), _(null), !r.trim()) {
|
|
37
72
|
_("A policy name is required.");
|
|
38
73
|
return;
|
|
39
74
|
}
|
|
40
75
|
let o;
|
|
41
|
-
if (
|
|
42
|
-
o = JSON.parse(
|
|
76
|
+
if (u.trim()) try {
|
|
77
|
+
o = JSON.parse(u);
|
|
43
78
|
} catch {
|
|
44
79
|
_("Condition must be valid JSON (e.g. {\"amountOver\": 100}).");
|
|
45
80
|
return;
|
|
@@ -48,8 +83,8 @@ function E({ agentId: e, onClose: t }) {
|
|
|
48
83
|
agentId: e,
|
|
49
84
|
name: r.trim(),
|
|
50
85
|
action: a,
|
|
51
|
-
isEnabled:
|
|
52
|
-
...
|
|
86
|
+
isEnabled: f,
|
|
87
|
+
...c.trim() ? { description: c.trim() } : {},
|
|
53
88
|
...o ? { condition: o } : {}
|
|
54
89
|
}, {
|
|
55
90
|
onSuccess: () => t(),
|
|
@@ -58,83 +93,83 @@ function E({ agentId: e, onClose: t }) {
|
|
|
58
93
|
},
|
|
59
94
|
className: "space-y-4",
|
|
60
95
|
children: [
|
|
61
|
-
g && /* @__PURE__ */
|
|
96
|
+
g && /* @__PURE__ */ N("div", {
|
|
62
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",
|
|
63
98
|
children: g
|
|
64
99
|
}),
|
|
65
|
-
/* @__PURE__ */
|
|
100
|
+
/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ P("label", {
|
|
66
101
|
htmlFor: "policy-name",
|
|
67
|
-
className:
|
|
68
|
-
children: ["Name ", /* @__PURE__ */
|
|
102
|
+
className: V,
|
|
103
|
+
children: ["Name ", /* @__PURE__ */ N("span", {
|
|
69
104
|
className: "text-status-error-text",
|
|
70
105
|
children: "*"
|
|
71
106
|
})]
|
|
72
|
-
}), /* @__PURE__ */
|
|
107
|
+
}), /* @__PURE__ */ N("input", {
|
|
73
108
|
id: "policy-name",
|
|
74
109
|
type: "text",
|
|
75
110
|
value: r,
|
|
76
111
|
onChange: (e) => i(e.target.value),
|
|
77
112
|
placeholder: "e.g. Alert on price hike over 20%",
|
|
78
|
-
className:
|
|
113
|
+
className: B,
|
|
79
114
|
required: !0
|
|
80
115
|
})] }),
|
|
81
|
-
/* @__PURE__ */
|
|
116
|
+
/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("label", {
|
|
82
117
|
htmlFor: "policy-action",
|
|
83
|
-
className:
|
|
118
|
+
className: V,
|
|
84
119
|
children: "Action"
|
|
85
|
-
}), /* @__PURE__ */
|
|
120
|
+
}), /* @__PURE__ */ N("select", {
|
|
86
121
|
id: "policy-action",
|
|
87
122
|
value: a,
|
|
88
123
|
onChange: (e) => o(e.target.value),
|
|
89
|
-
className:
|
|
90
|
-
children:
|
|
124
|
+
className: B,
|
|
125
|
+
children: L.map((e) => /* @__PURE__ */ N("option", {
|
|
91
126
|
value: e,
|
|
92
127
|
children: e.replace(/_/g, " ")
|
|
93
128
|
}, e))
|
|
94
129
|
})] }),
|
|
95
|
-
/* @__PURE__ */
|
|
130
|
+
/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ P("label", {
|
|
96
131
|
htmlFor: "policy-condition",
|
|
97
|
-
className:
|
|
98
|
-
children: ["Condition ", /* @__PURE__ */
|
|
132
|
+
className: V,
|
|
133
|
+
children: ["Condition ", /* @__PURE__ */ N("span", {
|
|
99
134
|
className: "text-text-secondary",
|
|
100
135
|
children: "(optional JSON)"
|
|
101
136
|
})]
|
|
102
|
-
}), /* @__PURE__ */
|
|
137
|
+
}), /* @__PURE__ */ N("textarea", {
|
|
103
138
|
id: "policy-condition",
|
|
104
|
-
value:
|
|
139
|
+
value: u,
|
|
105
140
|
onChange: (e) => d(e.target.value),
|
|
106
141
|
rows: 3,
|
|
107
142
|
placeholder: "{ \"priceIncreasePct\": 20 }",
|
|
108
|
-
className: `${
|
|
143
|
+
className: `${B} font-mono`
|
|
109
144
|
})] }),
|
|
110
|
-
/* @__PURE__ */
|
|
145
|
+
/* @__PURE__ */ P("div", { children: [/* @__PURE__ */ N("label", {
|
|
111
146
|
htmlFor: "policy-desc",
|
|
112
|
-
className:
|
|
147
|
+
className: V,
|
|
113
148
|
children: "Description"
|
|
114
|
-
}), /* @__PURE__ */
|
|
149
|
+
}), /* @__PURE__ */ N("textarea", {
|
|
115
150
|
id: "policy-desc",
|
|
116
|
-
value:
|
|
117
|
-
onChange: (e) =>
|
|
151
|
+
value: c,
|
|
152
|
+
onChange: (e) => l(e.target.value),
|
|
118
153
|
rows: 2,
|
|
119
|
-
className:
|
|
154
|
+
className: B
|
|
120
155
|
})] }),
|
|
121
|
-
/* @__PURE__ */
|
|
156
|
+
/* @__PURE__ */ P("label", {
|
|
122
157
|
className: "flex items-center gap-2 text-sm text-text-primary",
|
|
123
|
-
children: [/* @__PURE__ */
|
|
158
|
+
children: [/* @__PURE__ */ N("input", {
|
|
124
159
|
type: "checkbox",
|
|
125
|
-
checked:
|
|
126
|
-
onChange: (e) =>
|
|
160
|
+
checked: f,
|
|
161
|
+
onChange: (e) => m(e.target.checked),
|
|
127
162
|
className: "size-4 rounded border-border-subtle"
|
|
128
163
|
}), "Enabled"]
|
|
129
164
|
}),
|
|
130
|
-
/* @__PURE__ */
|
|
165
|
+
/* @__PURE__ */ P("div", {
|
|
131
166
|
className: "flex justify-end gap-3",
|
|
132
|
-
children: [/* @__PURE__ */
|
|
167
|
+
children: [/* @__PURE__ */ N("button", {
|
|
133
168
|
type: "button",
|
|
134
169
|
onClick: t,
|
|
135
170
|
className: "rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
|
|
136
171
|
children: "Cancel"
|
|
137
|
-
}), /* @__PURE__ */
|
|
172
|
+
}), /* @__PURE__ */ N("button", {
|
|
138
173
|
type: "submit",
|
|
139
174
|
disabled: n.isPending,
|
|
140
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",
|
|
@@ -145,155 +180,266 @@ function E({ agentId: e, onClose: t }) {
|
|
|
145
180
|
})
|
|
146
181
|
});
|
|
147
182
|
}
|
|
148
|
-
function
|
|
149
|
-
|
|
150
|
-
|
|
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, {
|
|
151
233
|
title: "Agent",
|
|
152
|
-
children: /* @__PURE__ */
|
|
234
|
+
children: /* @__PURE__ */ N(l, { label: "Loading agent…" })
|
|
153
235
|
});
|
|
154
|
-
if (
|
|
236
|
+
if (x) return /* @__PURE__ */ N(t, {
|
|
155
237
|
title: "Agent",
|
|
156
|
-
children: /* @__PURE__ */
|
|
238
|
+
children: /* @__PURE__ */ N(c, {
|
|
157
239
|
message: "Could not load this agent.",
|
|
158
|
-
onRetry: () => void
|
|
240
|
+
onRetry: () => void S()
|
|
159
241
|
})
|
|
160
242
|
});
|
|
161
|
-
if (!
|
|
243
|
+
if (!_) return /* @__PURE__ */ N(t, {
|
|
162
244
|
title: "Agent",
|
|
163
|
-
children: /* @__PURE__ */
|
|
245
|
+
children: /* @__PURE__ */ N(o, {
|
|
164
246
|
illustration: "empty-data",
|
|
165
247
|
title: "Agent not found",
|
|
166
248
|
description: "It may have been removed, or you may not have access to it.",
|
|
167
|
-
action: /* @__PURE__ */
|
|
249
|
+
action: /* @__PURE__ */ N("button", {
|
|
168
250
|
type: "button",
|
|
169
|
-
onClick: () =>
|
|
251
|
+
onClick: () => p("/agents"),
|
|
170
252
|
className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90",
|
|
171
253
|
children: "Back to agents"
|
|
172
254
|
})
|
|
173
255
|
})
|
|
174
256
|
});
|
|
175
|
-
let
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
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", {
|
|
180
282
|
type: "button",
|
|
181
|
-
onClick: () =>
|
|
283
|
+
onClick: () => p("/agents"),
|
|
182
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",
|
|
183
|
-
children: [/* @__PURE__ */
|
|
285
|
+
children: [/* @__PURE__ */ N(g, { className: "h-4 w-4" }), " Back"]
|
|
184
286
|
}),
|
|
185
287
|
children: [
|
|
186
|
-
/* @__PURE__ */
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
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
|
+
})
|
|
203
353
|
}),
|
|
204
|
-
|
|
354
|
+
E && /* @__PURE__ */ N("div", {
|
|
205
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",
|
|
206
|
-
children:
|
|
356
|
+
children: E
|
|
207
357
|
}),
|
|
208
|
-
/* @__PURE__ */
|
|
209
|
-
className: "mt-6
|
|
358
|
+
/* @__PURE__ */ P("div", {
|
|
359
|
+
className: "mt-6 grid grid-cols-1 gap-4 sm:grid-cols-3",
|
|
210
360
|
children: [
|
|
211
|
-
/* @__PURE__ */
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
361
|
+
/* @__PURE__ */ N(n, {
|
|
362
|
+
icon: /* @__PURE__ */ N(T, { className: "h-5 w-5" }),
|
|
363
|
+
value: H.length,
|
|
364
|
+
label: "Policies"
|
|
215
365
|
}),
|
|
216
|
-
/* @__PURE__ */
|
|
217
|
-
|
|
218
|
-
value:
|
|
219
|
-
|
|
220
|
-
onChange: (e) => {
|
|
221
|
-
A(null), O.mutate({
|
|
222
|
-
id: N.id,
|
|
223
|
-
status: e.target.value
|
|
224
|
-
}, { onError: (e) => A(e instanceof Error ? e.message : "Could not change posture.") });
|
|
225
|
-
},
|
|
226
|
-
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",
|
|
227
|
-
children: S.map((e) => /* @__PURE__ */ y("option", {
|
|
228
|
-
value: e,
|
|
229
|
-
children: n(e)
|
|
230
|
-
}, e))
|
|
366
|
+
/* @__PURE__ */ N(n, {
|
|
367
|
+
icon: /* @__PURE__ */ N(A, { className: "h-5 w-5" }),
|
|
368
|
+
value: G,
|
|
369
|
+
label: "Enabled"
|
|
231
370
|
}),
|
|
232
|
-
/* @__PURE__ */
|
|
233
|
-
className: "
|
|
234
|
-
|
|
371
|
+
/* @__PURE__ */ N(n, {
|
|
372
|
+
icon: /* @__PURE__ */ N(j, { className: "h-5 w-5" }),
|
|
373
|
+
value: K,
|
|
374
|
+
label: "Total triggers"
|
|
235
375
|
})
|
|
236
376
|
]
|
|
237
377
|
}),
|
|
238
|
-
/* @__PURE__ */
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
className: "
|
|
259
|
-
children:
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
})
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
/* @__PURE__ */ b("p", {
|
|
277
|
-
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",
|
|
278
416
|
children: [
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
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
|
+
})
|
|
283
429
|
]
|
|
284
|
-
})
|
|
285
|
-
|
|
286
|
-
}
|
|
287
|
-
})
|
|
430
|
+
}) : /* @__PURE__ */ N(d, { items: J })
|
|
431
|
+
})
|
|
432
|
+
})
|
|
433
|
+
})]
|
|
288
434
|
}),
|
|
289
|
-
|
|
290
|
-
agentId:
|
|
291
|
-
onClose: () =>
|
|
435
|
+
k && /* @__PURE__ */ N(U, {
|
|
436
|
+
agentId: B.id,
|
|
437
|
+
onClose: () => L(!1)
|
|
292
438
|
})
|
|
293
439
|
]
|
|
294
440
|
});
|
|
295
441
|
}
|
|
296
442
|
//#endregion
|
|
297
|
-
export {
|
|
443
|
+
export { G as AgentDetailPage };
|
|
298
444
|
|
|
299
445
|
//# sourceMappingURL=AgentDetailPage.js.map
|