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