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