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