@burdenoff/microfe-subscriberbot 2026.1023.1 → 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.
- package/dist/subscriberbot/admin/AdminDashboardPage.js +5 -5
- package/dist/subscriberbot/admin/AdminDashboardPage.js.map +1 -1
- package/dist/subscriberbot/components/PostureOptions.d.ts +10 -0
- package/dist/subscriberbot/components/PostureOptions.d.ts.map +1 -0
- package/dist/subscriberbot/components/PostureOptions.js +20 -0
- package/dist/subscriberbot/components/PostureOptions.js.map +1 -0
- package/dist/subscriberbot/components/index.d.ts +2 -0
- package/dist/subscriberbot/components/index.d.ts.map +1 -1
- package/dist/subscriberbot/components/index.js +1 -0
- package/dist/subscriberbot/hooks/index.d.ts +1 -0
- package/dist/subscriberbot/hooks/index.d.ts.map +1 -1
- package/dist/subscriberbot/hooks/index.js +2 -1
- package/dist/subscriberbot/hooks/useAutonomousAgentMode.d.ts +15 -0
- package/dist/subscriberbot/hooks/useAutonomousAgentMode.d.ts.map +1 -0
- package/dist/subscriberbot/hooks/useAutonomousAgentMode.js +13 -0
- package/dist/subscriberbot/hooks/useAutonomousAgentMode.js.map +1 -0
- package/dist/subscriberbot/hooks/useSubscriberBotApi.d.ts.map +1 -1
- package/dist/subscriberbot/hooks/useSubscriberBotApi.js +9 -0
- package/dist/subscriberbot/hooks/useSubscriberBotApi.js.map +1 -1
- package/dist/subscriberbot/pages/AssetVaultPage.js +16 -16
- package/dist/subscriberbot/pages/DashboardPage.js +23 -23
- package/dist/subscriberbot/pages/DashboardPage.js.map +1 -1
- package/dist/subscriberbot/pages/InboxPage.js +62 -62
- package/dist/subscriberbot/pages/InsightsPage.js +14 -14
- package/dist/subscriberbot/pages/InvoicesPage.js +66 -66
- package/dist/subscriberbot/pages/WorkflowsPage.js +20 -20
- package/dist/subscriberbot/pages/agents/AgentDetailPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentDetailPage.js +184 -182
- package/dist/subscriberbot/pages/agents/AgentDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentNewPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentNewPage.js +77 -79
- package/dist/subscriberbot/pages/agents/AgentNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentsListPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentsListPage.js +134 -133
- package/dist/subscriberbot/pages/agents/AgentsListPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.js +64 -64
- package/dist/subscriberbot/pages/providers/ProviderNewPage.js +3 -3
- package/dist/subscriberbot/pages/providers/ProvidersListPage.js +18 -18
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js +122 -89
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js +6 -6
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js +7 -7
- package/dist/subscriberbot/types/index.d.ts +1 -0
- package/dist/subscriberbot/types/index.d.ts.map +1 -1
- 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 {
|
|
9
|
-
import {
|
|
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
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
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
|
|
21
|
+
var V = [
|
|
20
22
|
"DISABLED",
|
|
21
23
|
"SUGGEST_ONLY",
|
|
22
24
|
"AUTONOMOUS"
|
|
23
|
-
],
|
|
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
|
-
},
|
|
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
|
-
],
|
|
42
|
-
DISCOVERY:
|
|
43
|
-
RENEWAL:
|
|
44
|
-
COST:
|
|
45
|
-
NEWSLETTER:
|
|
46
|
-
VENDOR:
|
|
47
|
-
COMPLIANCE:
|
|
48
|
-
NEGOTIATION:
|
|
49
|
-
MIGRATION:
|
|
50
|
-
CONCIERGE:
|
|
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
|
|
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
|
|
64
|
-
function
|
|
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
|
|
69
|
-
return e == null ? "—" : typeof e == "string" ? e : typeof e == "number" ? i(e) : typeof e == "boolean" ? e ? "Yes" : "No" : Array.isArray(e) ? e.map(
|
|
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
|
|
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:
|
|
76
|
+
value: Y(t)
|
|
75
77
|
}));
|
|
76
78
|
}
|
|
77
|
-
function
|
|
78
|
-
let t =
|
|
79
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
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
|
|
89
|
-
let n =
|
|
90
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
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 (
|
|
102
|
-
o = JSON.parse(
|
|
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
|
-
...
|
|
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
|
-
|
|
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:
|
|
125
|
+
children: v
|
|
124
126
|
}),
|
|
125
|
-
/* @__PURE__ */
|
|
127
|
+
/* @__PURE__ */ z("div", { children: [/* @__PURE__ */ z("label", {
|
|
126
128
|
htmlFor: "policy-name",
|
|
127
|
-
className:
|
|
129
|
+
className: q,
|
|
128
130
|
children: [
|
|
129
131
|
n("agents.policyModal.nameLabel", "Name"),
|
|
130
132
|
" ",
|
|
131
|
-
/* @__PURE__ */
|
|
133
|
+
/* @__PURE__ */ R("span", {
|
|
132
134
|
className: "text-status-error-text",
|
|
133
135
|
children: "*"
|
|
134
136
|
})
|
|
135
137
|
]
|
|
136
|
-
}), /* @__PURE__ */
|
|
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:
|
|
144
|
+
className: K,
|
|
143
145
|
required: !0
|
|
144
146
|
})] }),
|
|
145
|
-
/* @__PURE__ */
|
|
147
|
+
/* @__PURE__ */ z("div", { children: [/* @__PURE__ */ R("label", {
|
|
146
148
|
htmlFor: "policy-action",
|
|
147
|
-
className:
|
|
149
|
+
className: q,
|
|
148
150
|
children: n("agents.policyModal.actionLabel", "Action")
|
|
149
|
-
}), /* @__PURE__ */
|
|
151
|
+
}), /* @__PURE__ */ R("select", {
|
|
150
152
|
id: "policy-action",
|
|
151
153
|
value: s,
|
|
152
154
|
onChange: (e) => l(e.target.value),
|
|
153
|
-
className:
|
|
154
|
-
children:
|
|
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__ */
|
|
161
|
+
/* @__PURE__ */ z("div", { children: [/* @__PURE__ */ z("label", {
|
|
160
162
|
htmlFor: "policy-condition",
|
|
161
|
-
className:
|
|
163
|
+
className: q,
|
|
162
164
|
children: [
|
|
163
165
|
n("agents.policyModal.conditionLabel", "Condition"),
|
|
164
166
|
" ",
|
|
165
|
-
/* @__PURE__ */
|
|
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__ */
|
|
176
|
+
}), /* @__PURE__ */ R("textarea", {
|
|
175
177
|
id: "policy-condition",
|
|
176
|
-
value:
|
|
177
|
-
onChange: (e) =>
|
|
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: `${
|
|
182
|
+
className: `${K} font-mono`
|
|
181
183
|
})] }),
|
|
182
|
-
/* @__PURE__ */
|
|
184
|
+
/* @__PURE__ */ z("div", { children: [/* @__PURE__ */ R("label", {
|
|
183
185
|
htmlFor: "policy-desc",
|
|
184
|
-
className:
|
|
186
|
+
className: q,
|
|
185
187
|
children: n("agents.policyModal.descriptionLabel", "Description")
|
|
186
|
-
}), /* @__PURE__ */
|
|
188
|
+
}), /* @__PURE__ */ R("textarea", {
|
|
187
189
|
id: "policy-desc",
|
|
188
|
-
value:
|
|
189
|
-
onChange: (e) =>
|
|
190
|
+
value: d,
|
|
191
|
+
onChange: (e) => f(e.target.value),
|
|
190
192
|
rows: 2,
|
|
191
|
-
className:
|
|
193
|
+
className: K
|
|
192
194
|
})] }),
|
|
193
|
-
/* @__PURE__ */
|
|
195
|
+
/* @__PURE__ */ z("label", {
|
|
194
196
|
className: "flex items-center gap-2 text-sm text-text-primary",
|
|
195
|
-
children: [/* @__PURE__ */
|
|
197
|
+
children: [/* @__PURE__ */ R("input", {
|
|
196
198
|
type: "checkbox",
|
|
197
199
|
checked: h,
|
|
198
|
-
onChange: (e) =>
|
|
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__ */
|
|
204
|
+
/* @__PURE__ */ z("div", {
|
|
203
205
|
className: "flex justify-end gap-3",
|
|
204
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
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
|
|
221
|
-
let t =
|
|
222
|
-
return /* @__PURE__ */
|
|
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__ */
|
|
228
|
+
/* @__PURE__ */ z("div", {
|
|
227
229
|
className: "flex items-start justify-between gap-2",
|
|
228
|
-
children: [/* @__PURE__ */
|
|
230
|
+
children: [/* @__PURE__ */ R("p", {
|
|
229
231
|
className: "text-sm font-semibold text-text-primary",
|
|
230
232
|
children: e.name
|
|
231
|
-
}), /* @__PURE__ */
|
|
233
|
+
}), /* @__PURE__ */ R(Z, { enabled: e.isEnabled })]
|
|
232
234
|
}),
|
|
233
|
-
/* @__PURE__ */
|
|
235
|
+
/* @__PURE__ */ z("div", {
|
|
234
236
|
className: "mt-2 flex flex-wrap items-center gap-2",
|
|
235
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
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__ */
|
|
256
|
+
n.length > 0 && /* @__PURE__ */ z("div", {
|
|
255
257
|
className: "mt-3 border-t border-border-subtle pt-2.5",
|
|
256
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
268
|
+
}), /* @__PURE__ */ R("div", {
|
|
267
269
|
className: "mt-1.5 flex flex-wrap gap-1.5",
|
|
268
|
-
children: n.map((e) => /* @__PURE__ */
|
|
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__ */
|
|
272
|
+
children: [/* @__PURE__ */ R("span", {
|
|
271
273
|
className: "font-medium text-text-primary",
|
|
272
|
-
children:
|
|
273
|
-
}), /* @__PURE__ */
|
|
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__ */
|
|
282
|
+
/* @__PURE__ */ z("p", {
|
|
281
283
|
className: "mt-2 flex items-center gap-1.5 text-xs text-text-secondary",
|
|
282
|
-
children: [/* @__PURE__ */
|
|
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
|
|
291
|
-
let i =
|
|
292
|
-
if (
|
|
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__ */
|
|
296
|
+
children: /* @__PURE__ */ R(p, { label: i("agents.detail.loading", "Loading agent…") })
|
|
295
297
|
});
|
|
296
|
-
if (
|
|
298
|
+
if (T) return /* @__PURE__ */ R(t, {
|
|
297
299
|
title: i("agents.title", "AI Agents"),
|
|
298
|
-
children: /* @__PURE__ */
|
|
300
|
+
children: /* @__PURE__ */ R(f, {
|
|
299
301
|
message: i("agents.detail.error", "Could not load this agent."),
|
|
300
|
-
onRetry: () => void
|
|
302
|
+
onRetry: () => void E()
|
|
301
303
|
})
|
|
302
304
|
});
|
|
303
|
-
if (!
|
|
305
|
+
if (!x) return /* @__PURE__ */ R(t, {
|
|
304
306
|
title: i("agents.title", "AI Agents"),
|
|
305
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
311
|
+
action: /* @__PURE__ */ R("button", {
|
|
310
312
|
type: "button",
|
|
311
|
-
onClick: () =>
|
|
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
|
|
318
|
-
|
|
319
|
-
ts: new Date(
|
|
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(
|
|
325
|
+
meta: a(K.lastRunAt),
|
|
324
326
|
tone: "positive"
|
|
325
327
|
}
|
|
326
328
|
});
|
|
327
|
-
for (let e of
|
|
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:
|
|
335
|
+
tone: G(e.action)
|
|
334
336
|
}
|
|
335
337
|
});
|
|
336
|
-
|
|
337
|
-
let
|
|
338
|
-
return /* @__PURE__ */
|
|
339
|
-
title:
|
|
340
|
-
description: `${i(
|
|
341
|
-
actions: /* @__PURE__ */
|
|
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: () =>
|
|
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__ */
|
|
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__ */
|
|
354
|
+
/* @__PURE__ */ R(B, {
|
|
353
355
|
treatment: "glass",
|
|
354
|
-
glow:
|
|
356
|
+
glow: K.status === "AUTONOMOUS",
|
|
355
357
|
className: "p-5",
|
|
356
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
360
|
+
children: [/* @__PURE__ */ z("div", {
|
|
359
361
|
className: "flex items-start gap-4",
|
|
360
|
-
children: [/* @__PURE__ */
|
|
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__ */
|
|
363
|
-
}), /* @__PURE__ */
|
|
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__ */
|
|
368
|
+
/* @__PURE__ */ z("div", {
|
|
367
369
|
className: "flex flex-wrap items-center gap-2",
|
|
368
|
-
children: [/* @__PURE__ */
|
|
370
|
+
children: [/* @__PURE__ */ R("p", {
|
|
369
371
|
className: "text-lg font-semibold text-text-primary",
|
|
370
|
-
children:
|
|
371
|
-
}), /* @__PURE__ */
|
|
372
|
+
children: K.name
|
|
373
|
+
}), /* @__PURE__ */ R(o, { status: K.status })]
|
|
372
374
|
}),
|
|
373
|
-
/* @__PURE__ */
|
|
375
|
+
/* @__PURE__ */ z("p", {
|
|
374
376
|
className: "mt-1 flex items-center gap-1.5 text-xs text-text-secondary",
|
|
375
|
-
children: [/* @__PURE__ */
|
|
377
|
+
children: [/* @__PURE__ */ R(w, {
|
|
376
378
|
className: "h-3.5 w-3.5",
|
|
377
379
|
"aria-hidden": !0
|
|
378
|
-
}),
|
|
380
|
+
}), K.lastRunAt ? i("agents.card.lastRun", "Last run {{when}}", { when: a(K.lastRunAt) }) : i("agents.card.neverRun", "Never run")]
|
|
379
381
|
}),
|
|
380
|
-
|
|
382
|
+
K.description && /* @__PURE__ */ R("p", {
|
|
381
383
|
className: "mt-2 max-w-2xl text-sm text-text-secondary",
|
|
382
|
-
children:
|
|
384
|
+
children: K.description
|
|
383
385
|
})
|
|
384
386
|
]
|
|
385
387
|
})]
|
|
386
|
-
}), /* @__PURE__ */
|
|
388
|
+
}), /* @__PURE__ */ z("div", {
|
|
387
389
|
className: "w-full sm:w-56 sm:shrink-0",
|
|
388
390
|
children: [
|
|
389
|
-
/* @__PURE__ */
|
|
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__ */
|
|
396
|
+
/* @__PURE__ */ R("select", {
|
|
395
397
|
id: "agent-posture",
|
|
396
|
-
value:
|
|
397
|
-
disabled:
|
|
398
|
+
value: K.status,
|
|
399
|
+
disabled: D.isPending,
|
|
398
400
|
onChange: (e) => {
|
|
399
|
-
|
|
400
|
-
id:
|
|
401
|
+
N(null), D.mutate({
|
|
402
|
+
id: K.id,
|
|
401
403
|
status: e.target.value
|
|
402
|
-
}, { onError: (e) =>
|
|
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:
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
}
|
|
407
|
+
children: /* @__PURE__ */ R(d, {
|
|
408
|
+
options: V,
|
|
409
|
+
currentStatus: K.status
|
|
410
|
+
})
|
|
409
411
|
}),
|
|
410
|
-
/* @__PURE__ */
|
|
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
|
-
|
|
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:
|
|
422
|
+
children: M
|
|
421
423
|
}),
|
|
422
|
-
/* @__PURE__ */
|
|
424
|
+
/* @__PURE__ */ z("div", {
|
|
423
425
|
className: "mt-6 grid grid-cols-1 gap-4 sm:grid-cols-3",
|
|
424
426
|
children: [
|
|
425
|
-
/* @__PURE__ */
|
|
426
|
-
icon: /* @__PURE__ */
|
|
427
|
-
value:
|
|
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__ */
|
|
431
|
-
icon: /* @__PURE__ */
|
|
432
|
-
value:
|
|
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__ */
|
|
436
|
-
icon: /* @__PURE__ */ I
|
|
437
|
-
value:
|
|
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__ */
|
|
444
|
+
/* @__PURE__ */ z("div", {
|
|
443
445
|
className: "mt-8 grid grid-cols-1 gap-6 lg:grid-cols-3",
|
|
444
|
-
children: [/* @__PURE__ */
|
|
446
|
+
children: [/* @__PURE__ */ R("div", {
|
|
445
447
|
className: "lg:col-span-2",
|
|
446
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
451
|
+
action: /* @__PURE__ */ z("button", {
|
|
450
452
|
type: "button",
|
|
451
|
-
onClick: () =>
|
|
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__ */
|
|
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:
|
|
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__ */
|
|
465
|
+
action: /* @__PURE__ */ R("button", {
|
|
464
466
|
type: "button",
|
|
465
|
-
onClick: () =>
|
|
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__ */
|
|
471
|
+
}) : /* @__PURE__ */ R("div", {
|
|
470
472
|
className: "grid grid-cols-1 gap-3 sm:grid-cols-2",
|
|
471
|
-
children:
|
|
473
|
+
children: J.map((e) => /* @__PURE__ */ R(ee, { policy: e }, e.id))
|
|
472
474
|
})
|
|
473
475
|
})
|
|
474
|
-
}), /* @__PURE__ */
|
|
476
|
+
}), /* @__PURE__ */ R("div", {
|
|
475
477
|
className: "lg:col-span-1",
|
|
476
|
-
children: /* @__PURE__ */
|
|
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__ */
|
|
481
|
+
children: /* @__PURE__ */ R(B, {
|
|
480
482
|
treatment: "metric",
|
|
481
483
|
className: "p-5",
|
|
482
|
-
children:
|
|
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__ */
|
|
487
|
+
/* @__PURE__ */ R(O, {
|
|
486
488
|
className: "h-8 w-8 text-text-secondary",
|
|
487
489
|
"aria-hidden": !0
|
|
488
490
|
}),
|
|
489
|
-
/* @__PURE__ */
|
|
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__ */
|
|
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__ */
|
|
500
|
+
}) : /* @__PURE__ */ R(h, { items: $ })
|
|
499
501
|
})
|
|
500
502
|
})
|
|
501
503
|
})]
|
|
502
504
|
}),
|
|
503
|
-
|
|
504
|
-
agentId:
|
|
505
|
-
onClose: () =>
|
|
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 {
|
|
513
|
+
export { $ as AgentDetailPage };
|
|
512
514
|
|
|
513
515
|
//# sourceMappingURL=AgentDetailPage.js.map
|