@burdenoff/microfe-subscriberbot 2026.1103.1 → 2026.1105.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/index.js +3 -3
- package/dist/stories/Accessibility.stories.d.ts +13 -0
- package/dist/stories/Accessibility.stories.d.ts.map +1 -0
- package/dist/stories/pages/AgentDetailPage.stories.d.ts.map +1 -1
- package/dist/stories/pages/AgentNewPage.stories.d.ts.map +1 -1
- package/dist/stories/pages/AgentsListPage.stories.d.ts.map +1 -1
- package/dist/stories/pages/BankConnectionsPage.stories.d.ts +1 -0
- package/dist/stories/pages/BankConnectionsPage.stories.d.ts.map +1 -1
- package/dist/stories/pages/EnterpriseSpendPage.stories.d.ts.map +1 -1
- package/dist/stories/pages/InboxPage.stories.d.ts.map +1 -1
- package/dist/subscriberbot/admin/AdminDashboardPage.d.ts.map +1 -1
- package/dist/subscriberbot/admin/AdminDashboardPage.js +168 -168
- package/dist/subscriberbot/admin/AdminDashboardPage.js.map +1 -1
- package/dist/subscriberbot/admin/NegotiationDeskPanel.d.ts.map +1 -1
- package/dist/subscriberbot/admin/NegotiationDeskPanel.js +116 -116
- package/dist/subscriberbot/admin/NegotiationDeskPanel.js.map +1 -1
- package/dist/subscriberbot/admin/ProcurementDeskPanel.d.ts.map +1 -1
- package/dist/subscriberbot/admin/ProcurementDeskPanel.js +211 -211
- package/dist/subscriberbot/admin/ProcurementDeskPanel.js.map +1 -1
- package/dist/subscriberbot/components/Modal.d.ts.map +1 -1
- package/dist/subscriberbot/components/Modal.js +43 -33
- package/dist/subscriberbot/components/Modal.js.map +1 -1
- package/dist/subscriberbot/components/PostureOptions.d.ts.map +1 -1
- package/dist/subscriberbot/components/PostureOptions.js +10 -10
- package/dist/subscriberbot/components/PostureOptions.js.map +1 -1
- package/dist/subscriberbot/components/StateViews.d.ts.map +1 -1
- package/dist/subscriberbot/components/StateViews.js +45 -37
- package/dist/subscriberbot/components/StateViews.js.map +1 -1
- package/dist/subscriberbot/components/StatusBadge.d.ts.map +1 -1
- package/dist/subscriberbot/components/StatusBadge.js +6 -6
- package/dist/subscriberbot/components/StatusBadge.js.map +1 -1
- package/dist/subscriberbot/components/decisions/DecisionBanners.js +6 -6
- package/dist/subscriberbot/components/decisions/DecisionCard.d.ts.map +1 -1
- package/dist/subscriberbot/components/decisions/DecisionCard.js +149 -147
- package/dist/subscriberbot/components/decisions/DecisionCard.js.map +1 -1
- package/dist/subscriberbot/components/mobile/MobileDashboard.d.ts.map +1 -1
- package/dist/subscriberbot/components/mobile/MobileDashboard.js +127 -127
- package/dist/subscriberbot/components/mobile/MobileDashboard.js.map +1 -1
- package/dist/subscriberbot/components/mobile/MobileRelationshipList.d.ts.map +1 -1
- package/dist/subscriberbot/components/mobile/MobileRelationshipList.js +114 -114
- package/dist/subscriberbot/components/mobile/MobileRelationshipList.js.map +1 -1
- package/dist/subscriberbot/components/mobile/MobileScreen.js +1 -1
- package/dist/subscriberbot/components/mobile/MobileScreen.js.map +1 -1
- package/dist/subscriberbot/components/negotiations/NegotiationStatusPill.js +4 -4
- package/dist/subscriberbot/components/negotiations/NegotiationTimeline.d.ts.map +1 -1
- package/dist/subscriberbot/components/negotiations/NegotiationTimeline.js +11 -11
- package/dist/subscriberbot/components/negotiations/NegotiationTimeline.js.map +1 -1
- package/dist/subscriberbot/components/negotiations/OutcomeForm.d.ts.map +1 -1
- package/dist/subscriberbot/components/negotiations/OutcomeForm.js +29 -29
- package/dist/subscriberbot/components/negotiations/OutcomeForm.js.map +1 -1
- package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.d.ts.map +1 -1
- package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.js +43 -43
- package/dist/subscriberbot/components/procurement/ProcurementOutcomeForm.js.map +1 -1
- package/dist/subscriberbot/components/procurement/ProcurementStatusPill.js +4 -4
- package/dist/subscriberbot/components/procurement/ProcurementThread.d.ts.map +1 -1
- package/dist/subscriberbot/components/procurement/ProcurementThread.js +14 -14
- package/dist/subscriberbot/components/procurement/ProcurementThread.js.map +1 -1
- package/dist/subscriberbot/components/savings/SavingsCards.d.ts.map +1 -1
- package/dist/subscriberbot/components/savings/SavingsCards.js +242 -237
- package/dist/subscriberbot/components/savings/SavingsCards.js.map +1 -1
- package/dist/subscriberbot/components/viz.d.ts +1 -0
- package/dist/subscriberbot/components/viz.d.ts.map +1 -1
- package/dist/subscriberbot/components/viz.js +100 -101
- package/dist/subscriberbot/components/viz.js.map +1 -1
- package/dist/subscriberbot/hooks/index.js +1 -1
- package/dist/subscriberbot/hooks/useFormError.d.ts +7 -0
- package/dist/subscriberbot/hooks/useFormError.d.ts.map +1 -0
- package/dist/subscriberbot/hooks/useFormError.js +28 -0
- package/dist/subscriberbot/hooks/useFormError.js.map +1 -0
- package/dist/subscriberbot/hooks/useFormatters.d.ts +11 -0
- package/dist/subscriberbot/hooks/useFormatters.d.ts.map +1 -0
- package/dist/subscriberbot/hooks/useFormatters.js +13 -0
- package/dist/subscriberbot/hooks/useFormatters.js.map +1 -0
- package/dist/subscriberbot/hooks/useSubscriberBotApi.d.ts.map +1 -1
- package/dist/subscriberbot/hooks/useSubscriberBotApi.js +371 -370
- package/dist/subscriberbot/hooks/useSubscriberBotApi.js.map +1 -1
- package/dist/subscriberbot/hooks/useTr.d.ts.map +1 -1
- package/dist/subscriberbot/hooks/useTr.js +1 -1
- package/dist/subscriberbot/hooks/useTr.js.map +1 -1
- package/dist/subscriberbot/index.js +1 -1
- package/dist/subscriberbot/pages/AssetVaultPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/AssetVaultPage.js +124 -124
- package/dist/subscriberbot/pages/AssetVaultPage.js.map +1 -1
- package/dist/subscriberbot/pages/DashboardPage.d.ts +0 -10
- package/dist/subscriberbot/pages/DashboardPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/DashboardPage.js +107 -98
- package/dist/subscriberbot/pages/DashboardPage.js.map +1 -1
- package/dist/subscriberbot/pages/InboxPage.d.ts +0 -10
- package/dist/subscriberbot/pages/InboxPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/InboxPage.js +421 -402
- 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 +130 -121
- package/dist/subscriberbot/pages/InsightsPage.js.map +1 -1
- package/dist/subscriberbot/pages/InvoicesPage.d.ts +0 -12
- package/dist/subscriberbot/pages/InvoicesPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/InvoicesPage.js +237 -215
- package/dist/subscriberbot/pages/InvoicesPage.js.map +1 -1
- package/dist/subscriberbot/pages/RenewalsPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/RenewalsPage.js +303 -295
- package/dist/subscriberbot/pages/RenewalsPage.js.map +1 -1
- package/dist/subscriberbot/pages/SavingsPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/SavingsPage.js +57 -57
- package/dist/subscriberbot/pages/SavingsPage.js.map +1 -1
- package/dist/subscriberbot/pages/WorkflowsPage.d.ts +0 -13
- package/dist/subscriberbot/pages/WorkflowsPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/WorkflowsPage.js +202 -196
- package/dist/subscriberbot/pages/WorkflowsPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentDetailPage.d.ts +0 -18
- package/dist/subscriberbot/pages/agents/AgentDetailPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentDetailPage.js +283 -275
- package/dist/subscriberbot/pages/agents/AgentDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentNewPage.d.ts +0 -6
- package/dist/subscriberbot/pages/agents/AgentNewPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentNewPage.js +85 -77
- package/dist/subscriberbot/pages/agents/AgentNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentsListPage.d.ts +0 -9
- package/dist/subscriberbot/pages/agents/AgentsListPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/agents/AgentsListPage.js +136 -136
- package/dist/subscriberbot/pages/agents/AgentsListPage.js.map +1 -1
- package/dist/subscriberbot/pages/banking/BankConnectionsPage.d.ts +0 -9
- package/dist/subscriberbot/pages/banking/BankConnectionsPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/banking/BankConnectionsPage.js +267 -260
- package/dist/subscriberbot/pages/banking/BankConnectionsPage.js.map +1 -1
- package/dist/subscriberbot/pages/decisions/DecisionDetailPage.d.ts +0 -10
- package/dist/subscriberbot/pages/decisions/DecisionDetailPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/decisions/DecisionDetailPage.js +96 -96
- package/dist/subscriberbot/pages/decisions/DecisionDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/decisions/DecisionsPage.d.ts +0 -11
- package/dist/subscriberbot/pages/decisions/DecisionsPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/decisions/DecisionsPage.js +46 -46
- package/dist/subscriberbot/pages/decisions/DecisionsPage.js.map +1 -1
- package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.d.ts +0 -11
- package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.js +181 -171
- package/dist/subscriberbot/pages/enterprise/EnterpriseSpendPage.js.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.d.ts +0 -9
- package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.js +164 -164
- package/dist/subscriberbot/pages/negotiations/NegotiationDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.d.ts +0 -9
- package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.js +197 -181
- package/dist/subscriberbot/pages/negotiations/NegotiationNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationsPage.d.ts +0 -8
- package/dist/subscriberbot/pages/negotiations/NegotiationsPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/negotiations/NegotiationsPage.js +79 -79
- package/dist/subscriberbot/pages/negotiations/NegotiationsPage.js.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.d.ts +0 -9
- package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.js +147 -147
- package/dist/subscriberbot/pages/procurement/ProcurementDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementNewPage.d.ts +0 -10
- package/dist/subscriberbot/pages/procurement/ProcurementNewPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementNewPage.js +204 -188
- package/dist/subscriberbot/pages/procurement/ProcurementNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementPage.d.ts +0 -9
- package/dist/subscriberbot/pages/procurement/ProcurementPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/procurement/ProcurementPage.js +80 -80
- package/dist/subscriberbot/pages/procurement/ProcurementPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.d.ts +0 -10
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.js +484 -458
- package/dist/subscriberbot/pages/providers/ProviderDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderNewPage.d.ts +0 -8
- package/dist/subscriberbot/pages/providers/ProviderNewPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/providers/ProviderNewPage.js +146 -136
- package/dist/subscriberbot/pages/providers/ProviderNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/providers/ProvidersListPage.d.ts +0 -10
- package/dist/subscriberbot/pages/providers/ProvidersListPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/providers/ProvidersListPage.js +88 -87
- package/dist/subscriberbot/pages/providers/ProvidersListPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.d.ts +0 -11
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js +520 -490
- package/dist/subscriberbot/pages/relationships/RelationshipDetailPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.d.ts +0 -8
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js +104 -90
- package/dist/subscriberbot/pages/relationships/RelationshipNewPage.js.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.d.ts +0 -8
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js +97 -96
- package/dist/subscriberbot/pages/relationships/RelationshipsListPage.js.map +1 -1
- package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.d.ts.map +1 -1
- package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.js +76 -74
- package/dist/subscriberbot/pages/workflows/WorkflowBuilderPage.js.map +1 -1
- package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.d.ts +5 -3
- package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.d.ts.map +1 -1
- package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.js +26 -25
- package/dist/subscriberbot/pages/workflows/workflowBuilderGraph.js.map +1 -1
- package/dist/subscriberbot/utils/formatters.d.ts +16 -5
- package/dist/subscriberbot/utils/formatters.d.ts.map +1 -1
- package/dist/subscriberbot/utils/formatters.js +57 -25
- package/dist/subscriberbot/utils/formatters.js.map +1 -1
- package/dist/subscriberbot/utils/plaidLink.d.ts +2 -1
- package/dist/subscriberbot/utils/plaidLink.d.ts.map +1 -1
- package/dist/subscriberbot/utils/plaidLink.js +21 -21
- package/dist/subscriberbot/utils/plaidLink.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,28 +1,29 @@
|
|
|
1
1
|
import { useSubscriberBot as e } from "../../context/SubscriberBotContext.js";
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { PostureOptions as
|
|
11
|
-
import { ErrorView as
|
|
12
|
-
import { Timeline as
|
|
2
|
+
import { useTr as t } from "../../hooks/useTr.js";
|
|
3
|
+
import { useFormatters as n } from "../../hooks/useFormatters.js";
|
|
4
|
+
import { PageLayout as r } from "../../components/PageLayout.js";
|
|
5
|
+
import { MetricsCard as i } from "../../components/MetricsCard.js";
|
|
6
|
+
import { StatusBadge as a } from "../../components/StatusBadge.js";
|
|
7
|
+
import { EmptyState as o } from "../../components/EmptyState.js";
|
|
8
|
+
import { Modal as s } from "../../components/Modal.js";
|
|
9
|
+
import { useAutonomousAgentMode as c } from "../../hooks/useAutonomousAgentMode.js";
|
|
10
|
+
import { PostureOptions as l } from "../../components/PostureOptions.js";
|
|
11
|
+
import { ErrorView as u, LoadingView as d, Section as f } from "../../components/StateViews.js";
|
|
12
|
+
import { Timeline as p } from "../../components/viz.js";
|
|
13
13
|
import "../../components/index.js";
|
|
14
|
-
import { useAgent as
|
|
15
|
-
import { RUNNABLE_AGENT_KINDS as
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
14
|
+
import { useAgent as m, useCreatePolicy as h, useDecisions as g, useRunAgent as _, useSetAgentStatus as v } from "../../hooks/useSubscriberBotApi.js";
|
|
15
|
+
import { RUNNABLE_AGENT_KINDS as y } from "../../components/decisions/decisionModel.js";
|
|
16
|
+
import { useFormError as b } from "../../hooks/useFormError.js";
|
|
17
|
+
import { DecisionCard as x } from "../../components/decisions/DecisionCard.js";
|
|
18
|
+
import { AiDisclaimer as S, DecisionsUnavailableBanner as C } from "../../components/decisions/DecisionBanners.js";
|
|
18
19
|
import "../../components/decisions/index.js";
|
|
19
|
-
import { useState as
|
|
20
|
-
import { ArrowLeft as
|
|
21
|
-
import { useParams as
|
|
22
|
-
import { jsx as
|
|
23
|
-
import { GlassCard as
|
|
20
|
+
import { useState as w } from "react";
|
|
21
|
+
import { ArrowLeft as ee, ArrowLeftRight as T, ArrowRight as te, Bot as ne, Building2 as E, Clock as D, ConciergeBell as O, DollarSign as k, Handshake as A, History as re, ListChecks as ie, Mail as j, Play as ae, Plus as oe, RefreshCw as M, Search as N, ShieldCheck as P, SlidersHorizontal as F, Zap as se } from "lucide-react";
|
|
22
|
+
import { useParams as ce } from "react-router";
|
|
23
|
+
import { jsx as I, jsxs as L } from "react/jsx-runtime";
|
|
24
|
+
import { GlassCard as R } from "@burdenoff/fe-libs/ui";
|
|
24
25
|
//#region src/subscriberbot/pages/agents/AgentDetailPage.tsx
|
|
25
|
-
function
|
|
26
|
+
function le(e) {
|
|
26
27
|
let t = /* @__PURE__ */ new Map();
|
|
27
28
|
for (let n of e) {
|
|
28
29
|
let e = t.get(n.runId) ?? {
|
|
@@ -36,11 +37,11 @@ function de(e) {
|
|
|
36
37
|
}
|
|
37
38
|
return [...t.values()];
|
|
38
39
|
}
|
|
39
|
-
var
|
|
40
|
+
var ue = [
|
|
40
41
|
"DISABLED",
|
|
41
42
|
"SUGGEST_ONLY",
|
|
42
43
|
"AUTONOMOUS"
|
|
43
|
-
],
|
|
44
|
+
], de = {
|
|
44
45
|
DISCOVERY: "agents.kinds.discovery",
|
|
45
46
|
RENEWAL: "agents.kinds.renewal",
|
|
46
47
|
COST: "agents.kinds.cost",
|
|
@@ -50,7 +51,7 @@ var R = [
|
|
|
50
51
|
NEGOTIATION: "agents.kinds.negotiation",
|
|
51
52
|
MIGRATION: "agents.kinds.migration",
|
|
52
53
|
CONCIERGE: "agents.kinds.concierge"
|
|
53
|
-
},
|
|
54
|
+
}, z = [
|
|
54
55
|
"ALERT",
|
|
55
56
|
"CREATE_TASK",
|
|
56
57
|
"RENEW",
|
|
@@ -58,18 +59,18 @@ var R = [
|
|
|
58
59
|
"PAUSE",
|
|
59
60
|
"UPGRADE",
|
|
60
61
|
"DOWNGRADE"
|
|
61
|
-
],
|
|
62
|
-
DISCOVERY:
|
|
63
|
-
RENEWAL:
|
|
64
|
-
COST:
|
|
65
|
-
NEWSLETTER:
|
|
66
|
-
VENDOR:
|
|
67
|
-
COMPLIANCE:
|
|
68
|
-
NEGOTIATION:
|
|
69
|
-
MIGRATION:
|
|
70
|
-
CONCIERGE:
|
|
62
|
+
], fe = {
|
|
63
|
+
DISCOVERY: N,
|
|
64
|
+
RENEWAL: M,
|
|
65
|
+
COST: k,
|
|
66
|
+
NEWSLETTER: j,
|
|
67
|
+
VENDOR: E,
|
|
68
|
+
COMPLIANCE: P,
|
|
69
|
+
NEGOTIATION: A,
|
|
70
|
+
MIGRATION: T,
|
|
71
|
+
CONCIERGE: O
|
|
71
72
|
};
|
|
72
|
-
function
|
|
73
|
+
function pe(e) {
|
|
73
74
|
switch (e) {
|
|
74
75
|
case "RENEW":
|
|
75
76
|
case "UPGRADE": return "positive";
|
|
@@ -80,267 +81,274 @@ function fe(e) {
|
|
|
80
81
|
default: return "default";
|
|
81
82
|
}
|
|
82
83
|
}
|
|
83
|
-
var
|
|
84
|
-
function
|
|
84
|
+
var B = "w-full rounded-lg border border-border-subtle bg-bg-surface px-3 py-2 text-sm text-text-primary placeholder:text-text-secondary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]", V = "mb-1 block text-xs font-medium text-text-secondary";
|
|
85
|
+
function H(e) {
|
|
85
86
|
let t = e.replace(/([a-z0-9])([A-Z])/g, "$1 $2").replace(/[_-]+/g, " ").trim();
|
|
86
87
|
return t.charAt(0).toUpperCase() + t.slice(1);
|
|
87
88
|
}
|
|
88
|
-
function
|
|
89
|
-
return e == null ? "—" : typeof e == "string" ? e : typeof e == "number" ?
|
|
89
|
+
function U(e, t, n) {
|
|
90
|
+
return e == null ? "—" : typeof e == "string" ? e : typeof e == "number" ? t(e) : typeof e == "boolean" ? e ? n("common.yes", "Yes") : n("common.no", "No") : Array.isArray(e) ? e.map((e) => U(e, t, n)).join(", ") : JSON.stringify(e);
|
|
90
91
|
}
|
|
91
|
-
function
|
|
92
|
-
return !e || Array.isArray(e) ? [] : Object.entries(e).filter(([, e]) => e != null && e !== "").map(([e,
|
|
92
|
+
function W(e, t, n) {
|
|
93
|
+
return !e || Array.isArray(e) ? [] : Object.entries(e).filter(([, e]) => e != null && e !== "").map(([e, r]) => ({
|
|
93
94
|
key: e,
|
|
94
|
-
value:
|
|
95
|
+
value: U(r, t, n)
|
|
95
96
|
}));
|
|
96
97
|
}
|
|
97
|
-
function
|
|
98
|
-
let
|
|
99
|
-
return /* @__PURE__ */
|
|
98
|
+
function G({ enabled: e }) {
|
|
99
|
+
let n = t();
|
|
100
|
+
return /* @__PURE__ */ L("span", {
|
|
100
101
|
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",
|
|
101
|
-
children: [/* @__PURE__ */
|
|
102
|
+
children: [/* @__PURE__ */ I("span", {
|
|
102
103
|
"aria-hidden": !0,
|
|
103
104
|
className: "size-1.5 rounded-full bg-current",
|
|
104
105
|
style: { opacity: e ? 1 : .6 }
|
|
105
|
-
}), e ?
|
|
106
|
+
}), e ? n("agents.detail.enabled", "Enabled") : n("agents.detail.disabled", "Disabled")]
|
|
106
107
|
});
|
|
107
108
|
}
|
|
108
|
-
function
|
|
109
|
-
let n =
|
|
110
|
-
return /* @__PURE__ */
|
|
111
|
-
title:
|
|
112
|
-
onClose:
|
|
109
|
+
function me({ agentId: e, onClose: r }) {
|
|
110
|
+
let { formatEnumLabel: i } = n(), a = t(), o = h(), [c, l] = w(""), [u, d] = w("ALERT"), [f, p] = w(""), [m, g] = w(""), [_, v] = w(!0), [y, x, S, C] = b();
|
|
111
|
+
return /* @__PURE__ */ I(s, {
|
|
112
|
+
title: a("agents.policyModal.title", "Add policy"),
|
|
113
|
+
onClose: r,
|
|
113
114
|
maxWidthClassName: "max-w-xl",
|
|
114
|
-
children: /* @__PURE__ */
|
|
115
|
-
onSubmit: (
|
|
116
|
-
if (
|
|
117
|
-
|
|
115
|
+
children: /* @__PURE__ */ L("form", {
|
|
116
|
+
onSubmit: (t) => {
|
|
117
|
+
if (t.preventDefault(), x(null), !c.trim()) {
|
|
118
|
+
x(a("agents.policyModal.nameRequired", "A policy name is required."), "policy-name");
|
|
118
119
|
return;
|
|
119
120
|
}
|
|
120
|
-
let
|
|
121
|
-
if (
|
|
122
|
-
|
|
121
|
+
let n;
|
|
122
|
+
if (m.trim()) try {
|
|
123
|
+
n = JSON.parse(m);
|
|
123
124
|
} catch {
|
|
124
|
-
|
|
125
|
+
x(a("agents.policyModal.conditionInvalid", "Condition must be valid JSON (e.g. {\"amountOver\": 100})."), "policy-condition");
|
|
125
126
|
return;
|
|
126
127
|
}
|
|
127
|
-
|
|
128
|
+
o.mutate({
|
|
128
129
|
agentId: e,
|
|
129
|
-
name:
|
|
130
|
-
action:
|
|
131
|
-
isEnabled:
|
|
132
|
-
...
|
|
133
|
-
...
|
|
130
|
+
name: c.trim(),
|
|
131
|
+
action: u,
|
|
132
|
+
isEnabled: _,
|
|
133
|
+
...f.trim() ? { description: f.trim() } : {},
|
|
134
|
+
...n ? { condition: n } : {}
|
|
134
135
|
}, {
|
|
135
|
-
onSuccess: () =>
|
|
136
|
-
onError: (e) =>
|
|
136
|
+
onSuccess: () => r(),
|
|
137
|
+
onError: (e) => x(e instanceof Error ? e.message : a("agents.policyModal.error", "Could not add policy."))
|
|
137
138
|
});
|
|
138
139
|
},
|
|
139
140
|
className: "space-y-4",
|
|
140
141
|
children: [
|
|
141
|
-
|
|
142
|
+
y && /* @__PURE__ */ I("div", {
|
|
143
|
+
id: C,
|
|
144
|
+
tabIndex: -1,
|
|
145
|
+
role: "alert",
|
|
142
146
|
className: "rounded-lg border border-status-error-text/30 bg-status-error-bg-subtle px-4 py-2 text-sm text-status-error-text",
|
|
143
|
-
children:
|
|
147
|
+
children: y
|
|
144
148
|
}),
|
|
145
|
-
/* @__PURE__ */
|
|
149
|
+
/* @__PURE__ */ L("div", { children: [/* @__PURE__ */ L("label", {
|
|
146
150
|
htmlFor: "policy-name",
|
|
147
|
-
className:
|
|
151
|
+
className: V,
|
|
148
152
|
children: [
|
|
149
|
-
|
|
153
|
+
a("agents.policyModal.nameLabel", "Name"),
|
|
150
154
|
" ",
|
|
151
|
-
/* @__PURE__ */
|
|
155
|
+
/* @__PURE__ */ I("span", {
|
|
152
156
|
className: "text-status-error-text",
|
|
153
157
|
children: "*"
|
|
154
158
|
})
|
|
155
159
|
]
|
|
156
|
-
}), /* @__PURE__ */
|
|
160
|
+
}), /* @__PURE__ */ I("input", {
|
|
161
|
+
...S("policy-name"),
|
|
157
162
|
id: "policy-name",
|
|
158
163
|
type: "text",
|
|
159
|
-
value:
|
|
160
|
-
onChange: (e) =>
|
|
161
|
-
placeholder:
|
|
162
|
-
className:
|
|
164
|
+
value: c,
|
|
165
|
+
onChange: (e) => l(e.target.value),
|
|
166
|
+
placeholder: a("agents.policyModal.namePlaceholder", "e.g. Alert on price hike over 20%"),
|
|
167
|
+
className: B,
|
|
163
168
|
required: !0
|
|
164
169
|
})] }),
|
|
165
|
-
/* @__PURE__ */
|
|
170
|
+
/* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("label", {
|
|
166
171
|
htmlFor: "policy-action",
|
|
167
|
-
className:
|
|
168
|
-
children:
|
|
169
|
-
}), /* @__PURE__ */
|
|
172
|
+
className: V,
|
|
173
|
+
children: a("agents.policyModal.actionLabel", "Action")
|
|
174
|
+
}), /* @__PURE__ */ I("select", {
|
|
175
|
+
...S("policy-action"),
|
|
170
176
|
id: "policy-action",
|
|
171
|
-
value:
|
|
172
|
-
onChange: (e) =>
|
|
173
|
-
className:
|
|
174
|
-
children:
|
|
177
|
+
value: u,
|
|
178
|
+
onChange: (e) => d(e.target.value),
|
|
179
|
+
className: B,
|
|
180
|
+
children: z.map((e) => /* @__PURE__ */ I("option", {
|
|
175
181
|
value: e,
|
|
176
|
-
children:
|
|
182
|
+
children: i(e)
|
|
177
183
|
}, e))
|
|
178
184
|
})] }),
|
|
179
|
-
/* @__PURE__ */
|
|
185
|
+
/* @__PURE__ */ L("div", { children: [/* @__PURE__ */ L("label", {
|
|
180
186
|
htmlFor: "policy-condition",
|
|
181
|
-
className:
|
|
187
|
+
className: V,
|
|
182
188
|
children: [
|
|
183
|
-
|
|
189
|
+
a("agents.policyModal.conditionLabel", "Condition"),
|
|
184
190
|
" ",
|
|
185
|
-
/* @__PURE__ */
|
|
191
|
+
/* @__PURE__ */ L("span", {
|
|
186
192
|
className: "text-text-secondary",
|
|
187
193
|
children: [
|
|
188
194
|
"(",
|
|
189
|
-
|
|
195
|
+
a("agents.policyModal.conditionOptional", "optional JSON"),
|
|
190
196
|
")"
|
|
191
197
|
]
|
|
192
198
|
})
|
|
193
199
|
]
|
|
194
|
-
}), /* @__PURE__ */
|
|
200
|
+
}), /* @__PURE__ */ I("textarea", {
|
|
201
|
+
...S("policy-condition"),
|
|
195
202
|
id: "policy-condition",
|
|
196
|
-
value:
|
|
197
|
-
onChange: (e) =>
|
|
203
|
+
value: m,
|
|
204
|
+
onChange: (e) => g(e.target.value),
|
|
198
205
|
rows: 3,
|
|
199
|
-
placeholder:
|
|
200
|
-
className: `${
|
|
206
|
+
placeholder: a("agents.policyModal.conditionPlaceholder", "{ \"priceIncreasePct\": 20 }"),
|
|
207
|
+
className: `${B} font-mono`
|
|
201
208
|
})] }),
|
|
202
|
-
/* @__PURE__ */
|
|
209
|
+
/* @__PURE__ */ L("div", { children: [/* @__PURE__ */ I("label", {
|
|
203
210
|
htmlFor: "policy-desc",
|
|
204
|
-
className:
|
|
205
|
-
children:
|
|
206
|
-
}), /* @__PURE__ */
|
|
211
|
+
className: V,
|
|
212
|
+
children: a("agents.policyModal.descriptionLabel", "Description")
|
|
213
|
+
}), /* @__PURE__ */ I("textarea", {
|
|
214
|
+
...S("policy-desc"),
|
|
207
215
|
id: "policy-desc",
|
|
208
|
-
value:
|
|
209
|
-
onChange: (e) =>
|
|
216
|
+
value: f,
|
|
217
|
+
onChange: (e) => p(e.target.value),
|
|
210
218
|
rows: 2,
|
|
211
|
-
className:
|
|
219
|
+
className: B
|
|
212
220
|
})] }),
|
|
213
|
-
/* @__PURE__ */
|
|
221
|
+
/* @__PURE__ */ L("label", {
|
|
214
222
|
className: "flex items-center gap-2 text-sm text-text-primary",
|
|
215
|
-
children: [/* @__PURE__ */
|
|
223
|
+
children: [/* @__PURE__ */ I("input", {
|
|
216
224
|
type: "checkbox",
|
|
217
|
-
checked:
|
|
218
|
-
onChange: (e) =>
|
|
225
|
+
checked: _,
|
|
226
|
+
onChange: (e) => v(e.target.checked),
|
|
219
227
|
className: "size-4 rounded border-border-subtle"
|
|
220
|
-
}),
|
|
228
|
+
}), a("agents.policyModal.enabled", "Enabled")]
|
|
221
229
|
}),
|
|
222
|
-
/* @__PURE__ */
|
|
230
|
+
/* @__PURE__ */ L("div", {
|
|
223
231
|
className: "flex justify-end gap-3",
|
|
224
|
-
children: [/* @__PURE__ */
|
|
232
|
+
children: [/* @__PURE__ */ I("button", {
|
|
225
233
|
type: "button",
|
|
226
|
-
onClick:
|
|
234
|
+
onClick: r,
|
|
227
235
|
className: "rounded-lg border border-border-subtle px-4 py-2 text-sm font-medium text-text-primary hover:bg-bg-sunken",
|
|
228
|
-
children:
|
|
229
|
-
}), /* @__PURE__ */
|
|
236
|
+
children: a("agents.policyModal.cancel", "Cancel")
|
|
237
|
+
}), /* @__PURE__ */ I("button", {
|
|
230
238
|
type: "submit",
|
|
231
|
-
disabled:
|
|
239
|
+
disabled: o.isPending,
|
|
232
240
|
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",
|
|
233
|
-
children:
|
|
241
|
+
children: o.isPending ? a("agents.policyModal.adding", "Adding…") : a("agents.policyModal.submit", "Add policy")
|
|
234
242
|
})]
|
|
235
243
|
})
|
|
236
244
|
]
|
|
237
245
|
})
|
|
238
246
|
});
|
|
239
247
|
}
|
|
240
|
-
function
|
|
241
|
-
let
|
|
242
|
-
return /* @__PURE__ */
|
|
248
|
+
function he({ policy: e }) {
|
|
249
|
+
let { formatEnumLabel: r, formatNumber: i } = n(), a = t(), o = W(e.condition, i, a);
|
|
250
|
+
return /* @__PURE__ */ L(R, {
|
|
243
251
|
treatment: "metric",
|
|
244
252
|
className: "flex flex-col p-4",
|
|
245
253
|
children: [
|
|
246
|
-
/* @__PURE__ */
|
|
254
|
+
/* @__PURE__ */ L("div", {
|
|
247
255
|
className: "flex items-start justify-between gap-2",
|
|
248
|
-
children: [/* @__PURE__ */
|
|
256
|
+
children: [/* @__PURE__ */ I("p", {
|
|
249
257
|
className: "text-sm font-semibold text-text-primary",
|
|
250
258
|
children: e.name
|
|
251
|
-
}), /* @__PURE__ */
|
|
259
|
+
}), /* @__PURE__ */ I(G, { enabled: e.isEnabled })]
|
|
252
260
|
}),
|
|
253
|
-
/* @__PURE__ */
|
|
261
|
+
/* @__PURE__ */ L("div", {
|
|
254
262
|
className: "mt-2 flex flex-wrap items-center gap-2",
|
|
255
|
-
children: [/* @__PURE__ */
|
|
263
|
+
children: [/* @__PURE__ */ L("span", {
|
|
256
264
|
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",
|
|
257
265
|
children: [
|
|
258
|
-
/* @__PURE__ */
|
|
266
|
+
/* @__PURE__ */ I(P, {
|
|
259
267
|
className: "h-3 w-3",
|
|
260
268
|
"aria-hidden": !0
|
|
261
269
|
}),
|
|
262
270
|
" ",
|
|
263
271
|
r(e.action)
|
|
264
272
|
]
|
|
265
|
-
}), /* @__PURE__ */
|
|
273
|
+
}), /* @__PURE__ */ I("span", {
|
|
266
274
|
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",
|
|
267
|
-
children:
|
|
275
|
+
children: a("agents.detail.triggered", "Triggered {{count}}×", { count: e.triggerCount })
|
|
268
276
|
})]
|
|
269
277
|
}),
|
|
270
|
-
e.description && /* @__PURE__ */
|
|
278
|
+
e.description && /* @__PURE__ */ I("p", {
|
|
271
279
|
className: "mt-2 line-clamp-2 text-xs text-text-secondary",
|
|
272
280
|
children: e.description
|
|
273
281
|
}),
|
|
274
|
-
|
|
282
|
+
o.length > 0 && /* @__PURE__ */ L("div", {
|
|
275
283
|
className: "mt-3 border-t border-border-subtle pt-2.5",
|
|
276
|
-
children: [/* @__PURE__ */
|
|
284
|
+
children: [/* @__PURE__ */ L("p", {
|
|
277
285
|
className: "flex items-center gap-1.5 text-[10px] font-medium uppercase tracking-wide text-text-secondary",
|
|
278
286
|
children: [
|
|
279
|
-
/* @__PURE__ */ F
|
|
287
|
+
/* @__PURE__ */ I(F, {
|
|
280
288
|
className: "h-3 w-3",
|
|
281
289
|
"aria-hidden": !0
|
|
282
290
|
}),
|
|
283
291
|
" ",
|
|
284
|
-
|
|
292
|
+
a("agents.detail.firesWhen", "Fires when")
|
|
285
293
|
]
|
|
286
|
-
}), /* @__PURE__ */
|
|
294
|
+
}), /* @__PURE__ */ I("div", {
|
|
287
295
|
className: "mt-1.5 flex flex-wrap gap-1.5",
|
|
288
|
-
children:
|
|
296
|
+
children: o.map((e) => /* @__PURE__ */ L("span", {
|
|
289
297
|
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",
|
|
290
|
-
children: [/* @__PURE__ */
|
|
298
|
+
children: [/* @__PURE__ */ I("span", {
|
|
291
299
|
className: "font-medium text-text-primary",
|
|
292
|
-
children:
|
|
293
|
-
}), /* @__PURE__ */
|
|
300
|
+
children: H(e.key)
|
|
301
|
+
}), /* @__PURE__ */ I("span", {
|
|
294
302
|
className: "font-mono tabular-nums",
|
|
295
303
|
children: e.value
|
|
296
304
|
})]
|
|
297
305
|
}, e.key))
|
|
298
306
|
})]
|
|
299
307
|
}),
|
|
300
|
-
/* @__PURE__ */
|
|
308
|
+
/* @__PURE__ */ L("p", {
|
|
301
309
|
className: "mt-2 flex items-center gap-1.5 text-xs text-text-secondary",
|
|
302
|
-
children: [/* @__PURE__ */
|
|
310
|
+
children: [/* @__PURE__ */ I(D, {
|
|
303
311
|
className: "h-3.5 w-3.5",
|
|
304
312
|
"aria-hidden": !0
|
|
305
|
-
}), e.lastTriggeredAt ?
|
|
313
|
+
}), e.lastTriggeredAt ? a("agents.detail.triggered", "Triggered {{count}}×", { count: e.triggerCount }) : a("agents.detail.notYetTriggered", "Not yet triggered")]
|
|
306
314
|
})
|
|
307
315
|
]
|
|
308
316
|
});
|
|
309
317
|
}
|
|
310
|
-
function
|
|
311
|
-
let
|
|
312
|
-
if (
|
|
313
|
-
title:
|
|
314
|
-
children: /* @__PURE__ */
|
|
318
|
+
function K() {
|
|
319
|
+
let { formatEnumLabel: s, formatRelativeTime: h } = n(), b = t(), { id: T } = ce(), { navigateTo: E } = e(), { data: O, isLoading: k, isError: A, refetch: j } = m(T), M = v(), N = c(), [F, z] = w(null), [B, V] = w(!1), H = _(), [U, W] = w(null), [G, K] = w(null), q = g({ agentId: T }, { enabled: !!T });
|
|
320
|
+
if (k) return /* @__PURE__ */ I(r, {
|
|
321
|
+
title: b("agents.detail.loading", "Loading agent…"),
|
|
322
|
+
children: /* @__PURE__ */ I(d, { label: b("agents.detail.loading", "Loading agent…") })
|
|
315
323
|
});
|
|
316
|
-
if (
|
|
317
|
-
title:
|
|
318
|
-
children: /* @__PURE__ */
|
|
319
|
-
message:
|
|
320
|
-
onRetry: () => void
|
|
324
|
+
if (A) return /* @__PURE__ */ I(r, {
|
|
325
|
+
title: b("agents.title", "AI Agents"),
|
|
326
|
+
children: /* @__PURE__ */ I(u, {
|
|
327
|
+
message: b("agents.detail.error", "Could not load this agent."),
|
|
328
|
+
onRetry: () => void j()
|
|
321
329
|
})
|
|
322
330
|
});
|
|
323
|
-
if (!
|
|
324
|
-
title:
|
|
325
|
-
children: /* @__PURE__ */
|
|
331
|
+
if (!O) return /* @__PURE__ */ I(r, {
|
|
332
|
+
title: b("agents.title", "AI Agents"),
|
|
333
|
+
children: /* @__PURE__ */ I(o, {
|
|
326
334
|
illustration: "empty-data",
|
|
327
|
-
title:
|
|
328
|
-
description:
|
|
329
|
-
action: /* @__PURE__ */
|
|
335
|
+
title: b("agents.detail.notFoundTitle", "Agent not found"),
|
|
336
|
+
description: b("agents.detail.notFoundDescription", "It may have been removed, or you may not have access to it."),
|
|
337
|
+
action: /* @__PURE__ */ I("button", {
|
|
330
338
|
type: "button",
|
|
331
|
-
onClick: () =>
|
|
339
|
+
onClick: () => E("/agents"),
|
|
332
340
|
className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90",
|
|
333
|
-
children:
|
|
341
|
+
children: b("agents.detail.backToAgents", "Back to agents")
|
|
334
342
|
})
|
|
335
343
|
})
|
|
336
344
|
});
|
|
337
|
-
let J =
|
|
345
|
+
let J = O, ge = fe[J.kind] ?? ne, Y = J.policies ?? [], _e = Y.filter((e) => e.isEnabled).length, ve = Y.reduce((e, t) => e + (t.triggerCount || 0), 0), X = [];
|
|
338
346
|
J.lastRunAt && X.push({
|
|
339
347
|
ts: new Date(J.lastRunAt).getTime(),
|
|
340
348
|
item: {
|
|
341
|
-
title:
|
|
342
|
-
sub:
|
|
343
|
-
meta:
|
|
349
|
+
title: b("agents.detail.agentRun", "Agent run"),
|
|
350
|
+
sub: b("agents.detail.agentRunSub", "Latest agent run"),
|
|
351
|
+
meta: h(J.lastRunAt),
|
|
344
352
|
tone: "positive"
|
|
345
353
|
}
|
|
346
354
|
});
|
|
@@ -348,273 +356,273 @@ function J() {
|
|
|
348
356
|
ts: new Date(e.lastTriggeredAt).getTime(),
|
|
349
357
|
item: {
|
|
350
358
|
title: e.name,
|
|
351
|
-
sub: `${
|
|
352
|
-
meta:
|
|
353
|
-
tone:
|
|
359
|
+
sub: `${s(e.action)} · ${b("agents.detail.triggered", "Triggered {{count}}×", { count: e.triggerCount })}`,
|
|
360
|
+
meta: h(e.lastTriggeredAt),
|
|
361
|
+
tone: pe(e.action)
|
|
354
362
|
}
|
|
355
363
|
});
|
|
356
364
|
let Z = q.data?.items ?? [];
|
|
357
|
-
for (let e of
|
|
365
|
+
for (let e of le(Z)) X.push({
|
|
358
366
|
ts: new Date(e.ranAt).getTime(),
|
|
359
367
|
item: {
|
|
360
|
-
title:
|
|
361
|
-
sub:
|
|
368
|
+
title: b("agents.detail.decisionRun", "Decision run"),
|
|
369
|
+
sub: b("agents.detail.decisionRunSub", "{{total}} recommendations · {{proposed}} open · {{flagged}} flagged", {
|
|
362
370
|
total: e.total,
|
|
363
371
|
proposed: e.proposed,
|
|
364
372
|
flagged: e.flagged
|
|
365
373
|
}),
|
|
366
|
-
meta:
|
|
374
|
+
meta: h(e.ranAt),
|
|
367
375
|
tone: e.flagged > 0 ? "warning" : "positive"
|
|
368
376
|
}
|
|
369
377
|
});
|
|
370
378
|
X.sort((e, t) => t.ts - e.ts);
|
|
371
|
-
let Q =
|
|
379
|
+
let Q = y.has(J.kind) ? J.status === "DISABLED" ? b("agents.detail.runDisabled", "Set the posture to Suggest-only to run this agent.") : null : b("agents.detail.runUnsupported", "This agent kind does not make decisions yet. Cost, renewal, vendor and discovery agents do."), ye = () => {
|
|
372
380
|
K(null), W(null), H.mutate(J.id, {
|
|
373
381
|
onSuccess: (e) => W(e),
|
|
374
|
-
onError: (e) => K(e instanceof Error && e.message ? e.message :
|
|
382
|
+
onError: (e) => K(e instanceof Error && e.message ? e.message : b("agents.detail.runError", "The agent run failed."))
|
|
375
383
|
});
|
|
376
384
|
}, $ = X.map((e) => e.item);
|
|
377
|
-
return /* @__PURE__ */
|
|
385
|
+
return /* @__PURE__ */ L(r, {
|
|
378
386
|
title: J.name,
|
|
379
|
-
description: `${
|
|
380
|
-
actions: /* @__PURE__ */
|
|
387
|
+
description: `${b(de[J.kind] ?? "", s(J.kind))} ${b("agents.card.kindSuffix", "agent")}`,
|
|
388
|
+
actions: /* @__PURE__ */ L("div", {
|
|
381
389
|
className: "flex flex-wrap gap-2",
|
|
382
|
-
children: [/* @__PURE__ */
|
|
390
|
+
children: [/* @__PURE__ */ L("button", {
|
|
383
391
|
type: "button",
|
|
384
|
-
onClick: () =>
|
|
392
|
+
onClick: () => E("/agents"),
|
|
385
393
|
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",
|
|
386
394
|
children: [
|
|
387
|
-
/* @__PURE__ */
|
|
395
|
+
/* @__PURE__ */ I(ee, { className: "rtl:rotate-180 h-4 w-4" }),
|
|
388
396
|
" ",
|
|
389
|
-
|
|
397
|
+
b("agents.new.back", "Back")
|
|
390
398
|
]
|
|
391
|
-
}), /* @__PURE__ */
|
|
399
|
+
}), /* @__PURE__ */ L("button", {
|
|
392
400
|
type: "button",
|
|
393
|
-
onClick:
|
|
401
|
+
onClick: ye,
|
|
394
402
|
disabled: H.isPending || Q !== null,
|
|
395
403
|
title: Q ?? void 0,
|
|
396
404
|
"data-testid": "run-agent",
|
|
397
405
|
className: "inline-flex items-center gap-2 rounded-lg bg-action-primary-bg px-3 py-2 text-sm font-medium text-action-primary-text hover:opacity-90 disabled:cursor-not-allowed disabled:opacity-50",
|
|
398
|
-
children: [/* @__PURE__ */
|
|
406
|
+
children: [/* @__PURE__ */ I(ae, {
|
|
399
407
|
className: "h-4 w-4",
|
|
400
408
|
"aria-hidden": !0
|
|
401
|
-
}), H.isPending ?
|
|
409
|
+
}), H.isPending ? b("agents.detail.running", "Running…") : b("agents.detail.run", "Run agent")]
|
|
402
410
|
})]
|
|
403
411
|
}),
|
|
404
412
|
children: [
|
|
405
|
-
/* @__PURE__ */
|
|
413
|
+
/* @__PURE__ */ I(R, {
|
|
406
414
|
treatment: "glass",
|
|
407
415
|
glow: J.status === "AUTONOMOUS",
|
|
408
416
|
className: "p-5",
|
|
409
|
-
children: /* @__PURE__ */
|
|
417
|
+
children: /* @__PURE__ */ L("div", {
|
|
410
418
|
className: "flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between",
|
|
411
|
-
children: [/* @__PURE__ */
|
|
419
|
+
children: [/* @__PURE__ */ L("div", {
|
|
412
420
|
className: "flex items-start gap-4",
|
|
413
|
-
children: [/* @__PURE__ */
|
|
421
|
+
children: [/* @__PURE__ */ I("span", {
|
|
414
422
|
className: "flex size-12 shrink-0 items-center justify-center rounded-xl bg-[var(--color-accent-soft)] text-text-primary",
|
|
415
|
-
children: /* @__PURE__ */
|
|
416
|
-
}), /* @__PURE__ */
|
|
423
|
+
children: /* @__PURE__ */ I(ge, { className: "h-6 w-6" })
|
|
424
|
+
}), /* @__PURE__ */ L("div", {
|
|
417
425
|
className: "min-w-0",
|
|
418
426
|
children: [
|
|
419
|
-
/* @__PURE__ */
|
|
427
|
+
/* @__PURE__ */ L("div", {
|
|
420
428
|
className: "flex flex-wrap items-center gap-2",
|
|
421
|
-
children: [/* @__PURE__ */
|
|
429
|
+
children: [/* @__PURE__ */ I("p", {
|
|
422
430
|
className: "text-lg font-semibold text-text-primary",
|
|
423
431
|
children: J.name
|
|
424
|
-
}), /* @__PURE__ */
|
|
432
|
+
}), /* @__PURE__ */ I(a, { status: J.status })]
|
|
425
433
|
}),
|
|
426
|
-
/* @__PURE__ */
|
|
434
|
+
/* @__PURE__ */ L("p", {
|
|
427
435
|
className: "mt-1 flex items-center gap-1.5 text-xs text-text-secondary",
|
|
428
|
-
children: [/* @__PURE__ */
|
|
436
|
+
children: [/* @__PURE__ */ I(D, {
|
|
429
437
|
className: "h-3.5 w-3.5",
|
|
430
438
|
"aria-hidden": !0
|
|
431
|
-
}), J.lastRunAt ?
|
|
439
|
+
}), J.lastRunAt ? b("agents.card.lastRun", "Last run {{when}}", { when: h(J.lastRunAt) }) : b("agents.card.neverRun", "Never run")]
|
|
432
440
|
}),
|
|
433
|
-
J.description && /* @__PURE__ */
|
|
441
|
+
J.description && /* @__PURE__ */ I("p", {
|
|
434
442
|
className: "mt-2 max-w-2xl text-sm text-text-secondary",
|
|
435
443
|
children: J.description
|
|
436
444
|
})
|
|
437
445
|
]
|
|
438
446
|
})]
|
|
439
|
-
}), /* @__PURE__ */
|
|
447
|
+
}), /* @__PURE__ */ L("div", {
|
|
440
448
|
className: "w-full sm:w-56 sm:shrink-0",
|
|
441
449
|
children: [
|
|
442
|
-
/* @__PURE__ */
|
|
450
|
+
/* @__PURE__ */ I("label", {
|
|
443
451
|
htmlFor: "agent-posture",
|
|
444
452
|
className: "mb-1 block text-xs font-medium text-text-secondary",
|
|
445
|
-
children:
|
|
453
|
+
children: b("agents.detail.operatingPosture", "Operating posture")
|
|
446
454
|
}),
|
|
447
|
-
/* @__PURE__ */
|
|
455
|
+
/* @__PURE__ */ I("select", {
|
|
448
456
|
id: "agent-posture",
|
|
449
457
|
value: J.status,
|
|
450
|
-
disabled:
|
|
458
|
+
disabled: M.isPending,
|
|
451
459
|
onChange: (e) => {
|
|
452
|
-
|
|
460
|
+
z(null), M.mutate({
|
|
453
461
|
id: J.id,
|
|
454
462
|
status: e.target.value
|
|
455
|
-
}, { onError: (e) =>
|
|
463
|
+
}, { onError: (e) => z(e instanceof Error ? e.message : b("agents.detail.error", "Could not load this agent.")) });
|
|
456
464
|
},
|
|
457
465
|
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",
|
|
458
|
-
children: /* @__PURE__ */
|
|
459
|
-
options:
|
|
466
|
+
children: /* @__PURE__ */ I(l, {
|
|
467
|
+
options: ue,
|
|
460
468
|
currentStatus: J.status
|
|
461
469
|
})
|
|
462
470
|
}),
|
|
463
|
-
/* @__PURE__ */
|
|
471
|
+
/* @__PURE__ */ I("p", {
|
|
464
472
|
className: "mt-1.5 text-[11px] leading-snug text-text-secondary",
|
|
465
|
-
children:
|
|
473
|
+
children: N ? b("agents.detail.postureHint", "Disabled never acts · Suggest-only proposes. You review proposed actions before applying them. Policy-driven autonomous execution is not available yet.") : b("agents.detail.postureHintGated", "Disabled never acts · Suggest-only proposes. Autonomous mode is not available yet — agents only suggest, they never act on their own.")
|
|
466
474
|
})
|
|
467
475
|
]
|
|
468
476
|
})]
|
|
469
477
|
})
|
|
470
478
|
}),
|
|
471
|
-
|
|
479
|
+
F && /* @__PURE__ */ I("div", {
|
|
472
480
|
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",
|
|
473
|
-
children:
|
|
481
|
+
children: F
|
|
474
482
|
}),
|
|
475
|
-
H.isPending && /* @__PURE__ */
|
|
483
|
+
H.isPending && /* @__PURE__ */ I("div", {
|
|
476
484
|
role: "status",
|
|
477
485
|
className: "mt-4 rounded-lg border border-border-subtle bg-bg-sunken px-4 py-2 text-sm text-text-secondary",
|
|
478
|
-
children:
|
|
486
|
+
children: b("agents.detail.runProgress", "Evaluating your active and trial subscriptions. Nothing is changed by this run.")
|
|
479
487
|
}),
|
|
480
|
-
U && /* @__PURE__ */
|
|
488
|
+
U && /* @__PURE__ */ L("div", {
|
|
481
489
|
role: "status",
|
|
482
490
|
"data-testid": "run-result",
|
|
483
491
|
className: "mt-4 rounded-lg border border-status-success-text/30 bg-status-success-bg-subtle px-4 py-2 text-sm text-status-success-text",
|
|
484
|
-
children: [
|
|
492
|
+
children: [b("agents.detail.runResult", "Run finished: {{evaluated}} subscriptions evaluated, {{proposed}} recommendations to review, {{flagged}} held back by validation.", {
|
|
485
493
|
evaluated: U.evaluated,
|
|
486
494
|
proposed: U.proposed,
|
|
487
495
|
flagged: U.flagged
|
|
488
|
-
}), U.truncated && ` ${
|
|
496
|
+
}), U.truncated && ` ${b("agents.detail.runTruncated", "Only part of the portfolio was evaluated in this run.")}`]
|
|
489
497
|
}),
|
|
490
|
-
G && /* @__PURE__ */
|
|
498
|
+
G && /* @__PURE__ */ I("div", {
|
|
491
499
|
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",
|
|
492
500
|
children: G
|
|
493
501
|
}),
|
|
494
|
-
Q && /* @__PURE__ */
|
|
502
|
+
Q && /* @__PURE__ */ I("p", {
|
|
495
503
|
className: "mt-3 text-xs text-text-secondary",
|
|
496
504
|
children: Q
|
|
497
505
|
}),
|
|
498
|
-
/* @__PURE__ */
|
|
506
|
+
/* @__PURE__ */ L("div", {
|
|
499
507
|
className: "mt-6 grid grid-cols-1 gap-4 sm:grid-cols-3",
|
|
500
508
|
children: [
|
|
501
|
-
/* @__PURE__ */
|
|
502
|
-
icon: /* @__PURE__ */
|
|
509
|
+
/* @__PURE__ */ I(i, {
|
|
510
|
+
icon: /* @__PURE__ */ I(ie, { className: "h-5 w-5" }),
|
|
503
511
|
value: Y.length,
|
|
504
|
-
label:
|
|
512
|
+
label: b("agents.detail.policies", "Policies")
|
|
505
513
|
}),
|
|
506
|
-
/* @__PURE__ */
|
|
507
|
-
icon: /* @__PURE__ */
|
|
508
|
-
value: ge,
|
|
509
|
-
label: i("agents.detail.enabled", "Enabled")
|
|
510
|
-
}),
|
|
511
|
-
/* @__PURE__ */ F(n, {
|
|
512
|
-
icon: /* @__PURE__ */ F(le, { className: "h-5 w-5" }),
|
|
514
|
+
/* @__PURE__ */ I(i, {
|
|
515
|
+
icon: /* @__PURE__ */ I(P, { className: "h-5 w-5" }),
|
|
513
516
|
value: _e,
|
|
514
|
-
label:
|
|
517
|
+
label: b("agents.detail.enabled", "Enabled")
|
|
518
|
+
}),
|
|
519
|
+
/* @__PURE__ */ I(i, {
|
|
520
|
+
icon: /* @__PURE__ */ I(se, { className: "h-5 w-5" }),
|
|
521
|
+
value: ve,
|
|
522
|
+
label: b("agents.detail.totalTriggers", "Total triggers")
|
|
515
523
|
})
|
|
516
524
|
]
|
|
517
525
|
}),
|
|
518
|
-
/* @__PURE__ */
|
|
526
|
+
/* @__PURE__ */ L("div", {
|
|
519
527
|
className: "mt-8 grid grid-cols-1 gap-6 lg:grid-cols-3",
|
|
520
|
-
children: [/* @__PURE__ */
|
|
528
|
+
children: [/* @__PURE__ */ I("div", {
|
|
521
529
|
className: "lg:col-span-2",
|
|
522
|
-
children: /* @__PURE__ */
|
|
523
|
-
title:
|
|
524
|
-
description:
|
|
525
|
-
action: /* @__PURE__ */
|
|
530
|
+
children: /* @__PURE__ */ I(f, {
|
|
531
|
+
title: b("agents.detail.policies", "Policies"),
|
|
532
|
+
description: b("agents.detail.policiesDescription", "Saved policy settings for this agent; autonomous execution is not available yet"),
|
|
533
|
+
action: /* @__PURE__ */ L("button", {
|
|
526
534
|
type: "button",
|
|
527
|
-
onClick: () =>
|
|
535
|
+
onClick: () => V(!0),
|
|
528
536
|
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",
|
|
529
537
|
children: [
|
|
530
|
-
/* @__PURE__ */
|
|
538
|
+
/* @__PURE__ */ I(oe, { className: "h-3.5 w-3.5" }),
|
|
531
539
|
" ",
|
|
532
|
-
|
|
540
|
+
b("agents.detail.addPolicy", "Add policy")
|
|
533
541
|
]
|
|
534
542
|
}),
|
|
535
|
-
children: Y.length === 0 ? /* @__PURE__ */
|
|
543
|
+
children: Y.length === 0 ? /* @__PURE__ */ I(o, {
|
|
536
544
|
illustration: "empty-data",
|
|
537
|
-
title:
|
|
538
|
-
description:
|
|
539
|
-
action: /* @__PURE__ */
|
|
545
|
+
title: b("agents.detail.noPoliciesTitle", "No policies"),
|
|
546
|
+
description: b("agents.detail.noPoliciesDescription", "You can save policy settings here. Policy-driven autonomous execution is not available yet; proposed actions still need your review."),
|
|
547
|
+
action: /* @__PURE__ */ I("button", {
|
|
540
548
|
type: "button",
|
|
541
|
-
onClick: () =>
|
|
549
|
+
onClick: () => V(!0),
|
|
542
550
|
className: "rounded-lg bg-action-primary-bg px-4 py-2 text-sm font-medium text-action-primary-text hover:opacity-90",
|
|
543
|
-
children:
|
|
551
|
+
children: b("agents.detail.addPolicy", "Add policy")
|
|
544
552
|
})
|
|
545
|
-
}) : /* @__PURE__ */
|
|
553
|
+
}) : /* @__PURE__ */ I("div", {
|
|
546
554
|
className: "grid grid-cols-1 gap-3 sm:grid-cols-2",
|
|
547
|
-
children: Y.map((e) => /* @__PURE__ */
|
|
555
|
+
children: Y.map((e) => /* @__PURE__ */ I(he, { policy: e }, e.id))
|
|
548
556
|
})
|
|
549
557
|
})
|
|
550
|
-
}), /* @__PURE__ */
|
|
558
|
+
}), /* @__PURE__ */ I("div", {
|
|
551
559
|
className: "lg:col-span-1",
|
|
552
|
-
children: /* @__PURE__ */
|
|
553
|
-
title:
|
|
554
|
-
description:
|
|
555
|
-
children: /* @__PURE__ */
|
|
560
|
+
children: /* @__PURE__ */ I(f, {
|
|
561
|
+
title: b("agents.detail.runHistory", "Run history"),
|
|
562
|
+
description: b("agents.detail.runHistoryDescription", "Recent agent activity"),
|
|
563
|
+
children: /* @__PURE__ */ I(R, {
|
|
556
564
|
treatment: "metric",
|
|
557
565
|
className: "p-5",
|
|
558
|
-
children: $.length === 0 ? /* @__PURE__ */
|
|
566
|
+
children: $.length === 0 ? /* @__PURE__ */ L("div", {
|
|
559
567
|
className: "flex flex-col items-center justify-center gap-2 py-6 text-center",
|
|
560
568
|
children: [
|
|
561
|
-
/* @__PURE__ */
|
|
569
|
+
/* @__PURE__ */ I(re, {
|
|
562
570
|
className: "h-8 w-8 text-text-secondary",
|
|
563
571
|
"aria-hidden": !0
|
|
564
572
|
}),
|
|
565
|
-
/* @__PURE__ */
|
|
573
|
+
/* @__PURE__ */ I("p", {
|
|
566
574
|
className: "text-sm font-medium text-text-primary",
|
|
567
|
-
children:
|
|
575
|
+
children: b("agents.detail.noRunsTitle", "No runs yet")
|
|
568
576
|
}),
|
|
569
|
-
/* @__PURE__ */
|
|
577
|
+
/* @__PURE__ */ I("p", {
|
|
570
578
|
className: "text-xs text-text-secondary",
|
|
571
|
-
children:
|
|
579
|
+
children: b("agents.detail.noRunsDescription", "Activity appears here once the agent runs.")
|
|
572
580
|
})
|
|
573
581
|
]
|
|
574
|
-
}) : /* @__PURE__ */
|
|
582
|
+
}) : /* @__PURE__ */ I(p, { items: $ })
|
|
575
583
|
})
|
|
576
584
|
})
|
|
577
585
|
})]
|
|
578
586
|
}),
|
|
579
|
-
/* @__PURE__ */
|
|
580
|
-
title:
|
|
581
|
-
description:
|
|
582
|
-
action: /* @__PURE__ */
|
|
587
|
+
/* @__PURE__ */ L(f, {
|
|
588
|
+
title: b("agents.detail.decisions", "Decisions"),
|
|
589
|
+
description: b("agents.detail.decisionsDescription", "Recommendations from this agent. Review, apply or dismiss each one."),
|
|
590
|
+
action: /* @__PURE__ */ L("button", {
|
|
583
591
|
type: "button",
|
|
584
|
-
onClick: () =>
|
|
592
|
+
onClick: () => E("/decisions"),
|
|
585
593
|
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",
|
|
586
|
-
children: [
|
|
587
|
-
className: "h-3.5 w-3.5",
|
|
594
|
+
children: [b("agents.detail.allDecisions", "All decisions"), /* @__PURE__ */ I(te, {
|
|
595
|
+
className: "rtl:rotate-180 h-3.5 w-3.5",
|
|
588
596
|
"aria-hidden": !0
|
|
589
597
|
})]
|
|
590
598
|
}),
|
|
591
|
-
children: [/* @__PURE__ */
|
|
599
|
+
children: [/* @__PURE__ */ I(S, { className: "mb-3" }), q.isLoading ? /* @__PURE__ */ I(d, {
|
|
592
600
|
className: "min-h-[120px]",
|
|
593
|
-
label:
|
|
594
|
-
}) : q.isError ? /* @__PURE__ */
|
|
601
|
+
label: b("decisions.loading", "Loading decisions…")
|
|
602
|
+
}) : q.isError ? /* @__PURE__ */ I(C, {
|
|
595
603
|
message: q.error instanceof Error ? q.error.message : void 0,
|
|
596
604
|
onRetry: () => void q.refetch()
|
|
597
|
-
}) : Z.length === 0 ? /* @__PURE__ */
|
|
605
|
+
}) : Z.length === 0 ? /* @__PURE__ */ I(o, {
|
|
598
606
|
illustration: "empty-data",
|
|
599
|
-
title:
|
|
600
|
-
description: Q ??
|
|
601
|
-
}) : /* @__PURE__ */
|
|
607
|
+
title: b("agents.detail.noDecisionsTitle", "No decisions yet"),
|
|
608
|
+
description: Q ?? b("agents.detail.noDecisionsDescription", "Run the agent to get recommendations. A run only proposes; nothing changes until you apply.")
|
|
609
|
+
}) : /* @__PURE__ */ I("div", {
|
|
602
610
|
className: "grid grid-cols-1 gap-3 lg:grid-cols-2",
|
|
603
611
|
"data-testid": "agent-decisions",
|
|
604
|
-
children: Z.slice(0, 6).map((e) => /* @__PURE__ */
|
|
612
|
+
children: Z.slice(0, 6).map((e) => /* @__PURE__ */ I(x, {
|
|
605
613
|
decision: e,
|
|
606
614
|
hideAgent: !0
|
|
607
615
|
}, e.id))
|
|
608
616
|
})]
|
|
609
617
|
}),
|
|
610
|
-
|
|
618
|
+
B && /* @__PURE__ */ I(me, {
|
|
611
619
|
agentId: J.id,
|
|
612
|
-
onClose: () =>
|
|
620
|
+
onClose: () => V(!1)
|
|
613
621
|
})
|
|
614
622
|
]
|
|
615
623
|
});
|
|
616
624
|
}
|
|
617
625
|
//#endregion
|
|
618
|
-
export {
|
|
626
|
+
export { K as AgentDetailPage };
|
|
619
627
|
|
|
620
628
|
//# sourceMappingURL=AgentDetailPage.js.map
|