@burdenoff/microfe-headshotmarketing 2026.1123.1 → 2026.1124.2
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/generated/wspace-operations.d.ts +742 -0
- package/dist/generated/wspace-operations.js +752 -351
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.js +41 -33
- package/dist/generated/wspace-types.js.map +1 -1
- package/dist/headshotmarketing/pages/ads/AdBudgetAiPanel.d.ts +7 -0
- package/dist/headshotmarketing/pages/ads/AdBudgetAiPanel.js +133 -0
- package/dist/headshotmarketing/pages/ads/AdBudgetAiPanel.js.map +1 -0
- package/dist/headshotmarketing/pages/ads/AdCampaignDetailsPage.js +54 -49
- package/dist/headshotmarketing/pages/ads/AdCampaignDetailsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/ai/AiDecisionCard.d.ts +31 -0
- package/dist/headshotmarketing/pages/ai/AiDecisionCard.js +150 -0
- package/dist/headshotmarketing/pages/ai/AiDecisionCard.js.map +1 -0
- package/dist/headshotmarketing/pages/ai/AiOperationsPage.d.ts +2 -18
- package/dist/headshotmarketing/pages/ai/AiOperationsPage.js +607 -8
- package/dist/headshotmarketing/pages/ai/AiOperationsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/ai/aiDecisionHelpers.d.ts +53 -0
- package/dist/headshotmarketing/pages/ai/aiDecisionHelpers.js +50 -0
- package/dist/headshotmarketing/pages/ai/aiDecisionHelpers.js.map +1 -0
- package/dist/headshotmarketing/pages/campaigns/CampaignAiPanel.d.ts +7 -0
- package/dist/headshotmarketing/pages/campaigns/CampaignAiPanel.js +267 -0
- package/dist/headshotmarketing/pages/campaigns/CampaignAiPanel.js.map +1 -0
- package/dist/headshotmarketing/pages/campaigns/CampaignDetailsPage.js +258 -251
- package/dist/headshotmarketing/pages/campaigns/CampaignDetailsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/crm/DealNextActionPanel.d.ts +14 -0
- package/dist/headshotmarketing/pages/crm/DealNextActionPanel.js +116 -0
- package/dist/headshotmarketing/pages/crm/DealNextActionPanel.js.map +1 -0
- package/dist/headshotmarketing/pages/crm/LeadAiDecisionPanel.d.ts +20 -0
- package/dist/headshotmarketing/pages/crm/LeadAiDecisionPanel.js +319 -0
- package/dist/headshotmarketing/pages/crm/LeadAiDecisionPanel.js.map +1 -0
- package/dist/headshotmarketing/pages/crm/LeadsPage.js +78 -41
- package/dist/headshotmarketing/pages/crm/LeadsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/crm/PipelinePage.js +126 -102
- package/dist/headshotmarketing/pages/crm/PipelinePage.js.map +1 -1
- package/package.json +2 -2
|
@@ -1,12 +1,611 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { HeadshotmarketingAiToolExecutionStatus as e, HeadshotmarketingAudienceSuggestionStatus as t } from "../../../generated/wspace-types.js";
|
|
2
|
+
import { useApplyHeadshotmarketingAdBudgetRecommendationMutation as n, useHeadshotmarketingAdBudgetRecommendationsQuery as r, useHeadshotmarketingAgentRunsQuery as i, useHeadshotmarketingApplyAudienceSuggestionMutation as a, useHeadshotmarketingAudienceSuggestionsQuery as ee, useHeadshotmarketingAutonomousLoopStatusQuery as te, useHeadshotmarketingConfigureAutonomousLoopMutation as ne, useHeadshotmarketingDismissAudienceSuggestionMutation as re } from "../../../generated/wspace-operations.js";
|
|
3
|
+
import { useHeadshotMarketing as o } from "../../context/HeadshotMarketingContext.js";
|
|
4
|
+
import { cn as s, formatCurrency as c, formatDate as ie, formatNumber as l } from "../../utils/helpers.js";
|
|
5
|
+
import { AiDecisionCard as u } from "./AiDecisionCard.js";
|
|
6
|
+
import { computeBudgetDelta as ae, formatAiCost as oe, formatAiLatency as se, formatAiProvenance as ce, summarizeAudienceCriteria as le } from "./aiDecisionHelpers.js";
|
|
7
|
+
import { useMemo as d, useState as f } from "react";
|
|
8
|
+
import { Activity as ue, AlertTriangle as p, Bot as m, ChevronRight as h, RefreshCw as g, ShieldCheck as _, Sparkles as de } from "lucide-react";
|
|
9
|
+
import { jsx as v, jsxs as y } from "react/jsx-runtime";
|
|
10
|
+
import { AiPage as fe } from "@burdenoff/fe-libs/shared/pages";
|
|
3
11
|
// src/headshotmarketing/pages/ai/AiOperationsPage.tsx
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
12
|
+
var b = 15, pe = {
|
|
13
|
+
[e.Completed]: e.Completed,
|
|
14
|
+
[e.Failed]: e.Failed,
|
|
15
|
+
[e.Running]: e.Running
|
|
16
|
+
}, x = () => {
|
|
17
|
+
let { navigate: x, basePath: S } = o(), { data: me, loading: he, error: ge, refetch: C } = te({ fetchPolicy: "network-only" }), [_e, { loading: w }] = ne(), [T, ve] = f(""), [E, D] = f(null), [O, k] = f(null), A = me?.headshotmarketingAutonomousLoopStatus ?? null, j = T === "" ? String(A?.dailyBudget ?? 25) : T, M = async (e) => {
|
|
18
|
+
D(null), k(null);
|
|
19
|
+
let t = Number(j), n = Number.isFinite(t) && t >= 1 && t <= 500 ? Math.round(t) : void 0;
|
|
20
|
+
try {
|
|
21
|
+
await _e({ variables: { input: {
|
|
22
|
+
enabled: e,
|
|
23
|
+
dailyBudget: n
|
|
24
|
+
} } }), await C(), D(e ? "Autonomous loop enabled (propose-only)." : "Autonomous loop paused.");
|
|
25
|
+
} catch (e) {
|
|
26
|
+
k(e instanceof Error ? e.message : "Could not update autonomous loop settings.");
|
|
27
|
+
}
|
|
28
|
+
}, { data: N, loading: P, error: F, refetch: I } = ee({
|
|
29
|
+
variables: {
|
|
30
|
+
filter: { status: t.Proposed },
|
|
31
|
+
pagination: {
|
|
32
|
+
limit: 10,
|
|
33
|
+
offset: 0
|
|
34
|
+
}
|
|
35
|
+
},
|
|
36
|
+
fetchPolicy: "network-only"
|
|
37
|
+
}), [ye] = a(), [be] = re(), [L, R] = f(null), [z, B] = f({}), [V, xe] = f(() => /* @__PURE__ */ new Set()), { data: H, loading: Se, error: U, refetch: Ce } = r({
|
|
38
|
+
variables: { pagination: {
|
|
39
|
+
limit: 10,
|
|
40
|
+
offset: 0
|
|
41
|
+
} },
|
|
42
|
+
fetchPolicy: "network-only"
|
|
43
|
+
}), [we] = n(), W = N?.headshotmarketingAudienceSuggestions.items ?? [], G = d(() => (H?.headshotmarketingAdBudgetRecommendations.items ?? []).filter((e) => !e.appliedAt && !V.has(e.id)), [H, V]), Te = async (e) => {
|
|
44
|
+
R(e), B((t) => {
|
|
45
|
+
let n = { ...t };
|
|
46
|
+
return delete n[e], n;
|
|
47
|
+
});
|
|
48
|
+
try {
|
|
49
|
+
await ye({ variables: { input: {
|
|
50
|
+
suggestionId: e,
|
|
51
|
+
confirm: !0
|
|
52
|
+
} } }), await I();
|
|
53
|
+
} catch (t) {
|
|
54
|
+
B((n) => ({
|
|
55
|
+
...n,
|
|
56
|
+
[e]: t instanceof Error ? t.message : "Failed to apply audience suggestion."
|
|
57
|
+
}));
|
|
58
|
+
} finally {
|
|
59
|
+
R(null);
|
|
60
|
+
}
|
|
61
|
+
}, Ee = async (e) => {
|
|
62
|
+
R(e), B((t) => {
|
|
63
|
+
let n = { ...t };
|
|
64
|
+
return delete n[e], n;
|
|
65
|
+
});
|
|
66
|
+
try {
|
|
67
|
+
await be({ variables: { id: e } }), await I();
|
|
68
|
+
} catch (t) {
|
|
69
|
+
B((n) => ({
|
|
70
|
+
...n,
|
|
71
|
+
[e]: t instanceof Error ? t.message : "Failed to dismiss audience suggestion."
|
|
72
|
+
}));
|
|
73
|
+
} finally {
|
|
74
|
+
R(null);
|
|
75
|
+
}
|
|
76
|
+
}, De = async (e) => {
|
|
77
|
+
R(e), B((t) => {
|
|
78
|
+
let n = { ...t };
|
|
79
|
+
return delete n[e], n;
|
|
80
|
+
});
|
|
81
|
+
try {
|
|
82
|
+
await we({ variables: { id: e } }), await Ce();
|
|
83
|
+
} catch (t) {
|
|
84
|
+
B((n) => ({
|
|
85
|
+
...n,
|
|
86
|
+
[e]: t instanceof Error ? t.message : "Failed to apply budget recommendation."
|
|
87
|
+
}));
|
|
88
|
+
} finally {
|
|
89
|
+
R(null);
|
|
90
|
+
}
|
|
91
|
+
}, [K, Oe] = f("all"), [q, ke] = f("all"), J = d(() => {
|
|
92
|
+
let e = {}, t = pe[K];
|
|
93
|
+
return t && (e.status = t), q !== "all" && (e.trigger = q), Object.keys(e).length > 0 ? e : void 0;
|
|
94
|
+
}, [K, q]), { data: Y, loading: Ae, error: X, fetchMore: je, refetch: Me } = i({
|
|
95
|
+
variables: {
|
|
96
|
+
filter: J,
|
|
97
|
+
page: { first: b }
|
|
98
|
+
},
|
|
99
|
+
fetchPolicy: "network-only"
|
|
100
|
+
}), Z = Y?.headshotmarketingAgentRuns.items ?? [], Ne = Y?.headshotmarketingAgentRuns.totalCount ?? 0, Q = Y?.headshotmarketingAgentRuns.pageInfo, Pe = async () => {
|
|
101
|
+
Q?.hasNextPage && Q.endCursor && await je({
|
|
102
|
+
variables: {
|
|
103
|
+
filter: J,
|
|
104
|
+
page: {
|
|
105
|
+
first: b,
|
|
106
|
+
after: Q.endCursor
|
|
107
|
+
}
|
|
108
|
+
},
|
|
109
|
+
updateQuery: (e, { fetchMoreResult: t }) => t ? { headshotmarketingAgentRuns: {
|
|
110
|
+
...t.headshotmarketingAgentRuns,
|
|
111
|
+
items: [...e.headshotmarketingAgentRuns.items, ...t.headshotmarketingAgentRuns.items]
|
|
112
|
+
} } : e
|
|
113
|
+
});
|
|
114
|
+
}, $ = W.length + G.length;
|
|
115
|
+
return /* @__PURE__ */ y("div", {
|
|
116
|
+
className: "space-y-8 pb-10",
|
|
117
|
+
children: [/* @__PURE__ */ v(fe, {
|
|
118
|
+
productName: "HeadshotMarketing",
|
|
119
|
+
productId: "headshotmarketing",
|
|
120
|
+
enableModelRoutes: !0
|
|
121
|
+
}), /* @__PURE__ */ y("div", {
|
|
122
|
+
className: "mx-auto w-full max-w-6xl space-y-6 px-4 sm:px-6",
|
|
123
|
+
children: [
|
|
124
|
+
/* @__PURE__ */ y("section", {
|
|
125
|
+
"aria-labelledby": "hsm-autonomous-loop-heading",
|
|
126
|
+
className: "rounded-lg border border-border-seam bg-gloss-card p-5 shadow-pop space-y-4",
|
|
127
|
+
children: [/* @__PURE__ */ y("div", {
|
|
128
|
+
className: "flex flex-wrap items-start justify-between gap-3",
|
|
129
|
+
children: [/* @__PURE__ */ y("div", {
|
|
130
|
+
className: "space-y-1",
|
|
131
|
+
children: [/* @__PURE__ */ y("div", {
|
|
132
|
+
className: "flex items-center gap-2",
|
|
133
|
+
children: [
|
|
134
|
+
/* @__PURE__ */ v(m, {
|
|
135
|
+
className: "h-4 w-4 text-action-primary-bg",
|
|
136
|
+
"aria-hidden": "true"
|
|
137
|
+
}),
|
|
138
|
+
/* @__PURE__ */ v("h2", {
|
|
139
|
+
id: "hsm-autonomous-loop-heading",
|
|
140
|
+
className: "text-base font-semibold text-text-primary",
|
|
141
|
+
children: "Autonomous Marketing Loop"
|
|
142
|
+
}),
|
|
143
|
+
/* @__PURE__ */ y("span", {
|
|
144
|
+
className: "inline-flex items-center gap-1 rounded-full bg-status-info-bg px-2 py-0.5 text-[11px] font-semibold text-status-info-text",
|
|
145
|
+
children: [/* @__PURE__ */ v(_, {
|
|
146
|
+
className: "h-3 w-3",
|
|
147
|
+
"aria-hidden": "true"
|
|
148
|
+
}), "Propose-only"]
|
|
149
|
+
})
|
|
150
|
+
]
|
|
151
|
+
}), /* @__PURE__ */ v("p", {
|
|
152
|
+
className: "text-xs text-text-secondary",
|
|
153
|
+
children: "Scheduled lead scoring, budget optimization, and anomaly detection run via FluidGrids and queue proposals for explicit human review."
|
|
154
|
+
})]
|
|
155
|
+
}), /* @__PURE__ */ y("button", {
|
|
156
|
+
type: "button",
|
|
157
|
+
onClick: () => void C(),
|
|
158
|
+
className: "inline-flex items-center gap-1.5 rounded-md border border-border-seam bg-gloss-card px-2.5 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken",
|
|
159
|
+
children: [/* @__PURE__ */ v(g, {
|
|
160
|
+
className: "h-3.5 w-3.5",
|
|
161
|
+
"aria-hidden": "true"
|
|
162
|
+
}), "Refresh"]
|
|
163
|
+
})]
|
|
164
|
+
}), ge && !A ? /* @__PURE__ */ y("div", {
|
|
165
|
+
role: "status",
|
|
166
|
+
className: "flex items-center gap-2 rounded-md border border-border-subtle bg-bg-sunken/50 px-3 py-2.5 text-xs text-text-secondary",
|
|
167
|
+
children: [/* @__PURE__ */ v(p, { className: "h-4 w-4 shrink-0 text-status-warning-text" }), /* @__PURE__ */ v("span", { children: "Autonomous loop status is currently unavailable. All manual marketing workflows continue operating normally." })]
|
|
168
|
+
}) : he && !A ? /* @__PURE__ */ v("div", { className: "h-16 animate-pulse rounded-md bg-bg-sunken/50" }) : A ? /* @__PURE__ */ y("div", {
|
|
169
|
+
className: "space-y-4",
|
|
170
|
+
children: [
|
|
171
|
+
/* @__PURE__ */ y("div", {
|
|
172
|
+
className: "grid grid-cols-1 gap-3 sm:grid-cols-3",
|
|
173
|
+
children: [
|
|
174
|
+
/* @__PURE__ */ y("div", {
|
|
175
|
+
className: "rounded-md border border-border-subtle bg-bg-sunken/40 p-3",
|
|
176
|
+
children: [
|
|
177
|
+
/* @__PURE__ */ v("p", {
|
|
178
|
+
className: "text-xs text-text-secondary",
|
|
179
|
+
children: "Workspace Status"
|
|
180
|
+
}),
|
|
181
|
+
/* @__PURE__ */ v("p", {
|
|
182
|
+
className: "mt-1 text-sm font-semibold text-text-primary",
|
|
183
|
+
children: A.enabled ? "Enabled (Propose-only)" : "Paused"
|
|
184
|
+
}),
|
|
185
|
+
!A.flagEnabled && /* @__PURE__ */ v("p", {
|
|
186
|
+
className: "mt-0.5 text-[11px] text-status-warning-text",
|
|
187
|
+
children: "Workspace feature flag is off; scheduled runs will no-op."
|
|
188
|
+
})
|
|
189
|
+
]
|
|
190
|
+
}),
|
|
191
|
+
/* @__PURE__ */ y("div", {
|
|
192
|
+
className: "rounded-md border border-border-subtle bg-bg-sunken/40 p-3",
|
|
193
|
+
children: [/* @__PURE__ */ v("p", {
|
|
194
|
+
className: "text-xs text-text-secondary",
|
|
195
|
+
children: "Daily Decision Budget"
|
|
196
|
+
}), /* @__PURE__ */ y("p", {
|
|
197
|
+
className: "mt-1 text-sm font-semibold tabular-nums text-text-primary",
|
|
198
|
+
children: [
|
|
199
|
+
A.decisionsUsedToday,
|
|
200
|
+
" / ",
|
|
201
|
+
A.dailyBudget,
|
|
202
|
+
" ",
|
|
203
|
+
"used today"
|
|
204
|
+
]
|
|
205
|
+
})]
|
|
206
|
+
}),
|
|
207
|
+
/* @__PURE__ */ y("div", {
|
|
208
|
+
className: "rounded-md border border-border-subtle bg-bg-sunken/40 p-3",
|
|
209
|
+
children: [/* @__PURE__ */ v("p", {
|
|
210
|
+
className: "text-xs text-text-secondary",
|
|
211
|
+
children: "Scheduled Cadences"
|
|
212
|
+
}), /* @__PURE__ */ y("p", {
|
|
213
|
+
className: "mt-1 text-sm font-semibold tabular-nums text-text-primary",
|
|
214
|
+
children: [
|
|
215
|
+
A.schedules.filter((e) => e.enabled).length,
|
|
216
|
+
" of",
|
|
217
|
+
" ",
|
|
218
|
+
A.schedules.length,
|
|
219
|
+
" active"
|
|
220
|
+
]
|
|
221
|
+
})]
|
|
222
|
+
})
|
|
223
|
+
]
|
|
224
|
+
}),
|
|
225
|
+
/* @__PURE__ */ y("div", {
|
|
226
|
+
className: "flex flex-wrap items-end gap-3 border-t border-border-subtle pt-3",
|
|
227
|
+
children: [
|
|
228
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("label", {
|
|
229
|
+
htmlFor: "hsm-loop-daily-budget",
|
|
230
|
+
className: "block text-xs font-medium text-text-secondary",
|
|
231
|
+
children: "Daily decision cap (1–500)"
|
|
232
|
+
}), /* @__PURE__ */ v("input", {
|
|
233
|
+
id: "hsm-loop-daily-budget",
|
|
234
|
+
type: "number",
|
|
235
|
+
min: 1,
|
|
236
|
+
max: 500,
|
|
237
|
+
value: j,
|
|
238
|
+
onChange: (e) => ve(e.target.value),
|
|
239
|
+
className: "mt-1 w-28 rounded-md border border-border-subtle bg-bg-surface px-2.5 py-1.5 text-sm text-text-primary focus:outline-none focus:ring-2 focus:ring-[var(--color-focus-ring)]"
|
|
240
|
+
})] }),
|
|
241
|
+
/* @__PURE__ */ v("button", {
|
|
242
|
+
type: "button",
|
|
243
|
+
disabled: w,
|
|
244
|
+
onClick: () => void M(!A.enabled),
|
|
245
|
+
className: s("inline-flex items-center gap-1.5 rounded-md px-3 py-1.5 text-xs font-medium disabled:opacity-60", A.enabled ? "border border-border-seam bg-gloss-card text-text-primary hover:bg-bg-sunken" : "bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90"),
|
|
246
|
+
children: w ? "Saving..." : A.enabled ? "Pause autonomous loop" : "Enable autonomous loop"
|
|
247
|
+
}),
|
|
248
|
+
A.enabled && /* @__PURE__ */ v("button", {
|
|
249
|
+
type: "button",
|
|
250
|
+
disabled: w,
|
|
251
|
+
onClick: () => void M(!0),
|
|
252
|
+
className: "inline-flex items-center gap-1.5 rounded-md border border-border-seam bg-gloss-card px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken disabled:opacity-60",
|
|
253
|
+
children: "Update cap"
|
|
254
|
+
})
|
|
255
|
+
]
|
|
256
|
+
}),
|
|
257
|
+
E && /* @__PURE__ */ v("p", {
|
|
258
|
+
role: "status",
|
|
259
|
+
className: "text-xs text-status-success-text",
|
|
260
|
+
children: E
|
|
261
|
+
}),
|
|
262
|
+
O && /* @__PURE__ */ v("p", {
|
|
263
|
+
role: "alert",
|
|
264
|
+
className: "text-xs text-status-error-text",
|
|
265
|
+
children: O
|
|
266
|
+
})
|
|
267
|
+
]
|
|
268
|
+
}) : null]
|
|
269
|
+
}),
|
|
270
|
+
/* @__PURE__ */ y("section", {
|
|
271
|
+
"aria-labelledby": "hsm-pending-decisions-heading",
|
|
272
|
+
className: "rounded-lg border border-border-seam bg-gloss-card p-5 shadow-pop space-y-4",
|
|
273
|
+
children: [
|
|
274
|
+
/* @__PURE__ */ y("div", {
|
|
275
|
+
className: "flex flex-wrap items-start justify-between gap-3",
|
|
276
|
+
children: [/* @__PURE__ */ y("div", {
|
|
277
|
+
className: "space-y-1",
|
|
278
|
+
children: [/* @__PURE__ */ y("div", {
|
|
279
|
+
className: "flex items-center gap-2",
|
|
280
|
+
children: [
|
|
281
|
+
/* @__PURE__ */ v(de, {
|
|
282
|
+
className: "h-4 w-4 text-action-primary-bg",
|
|
283
|
+
"aria-hidden": "true"
|
|
284
|
+
}),
|
|
285
|
+
/* @__PURE__ */ v("h2", {
|
|
286
|
+
id: "hsm-pending-decisions-heading",
|
|
287
|
+
className: "text-base font-semibold text-text-primary",
|
|
288
|
+
children: "Pending AI Decisions"
|
|
289
|
+
}),
|
|
290
|
+
/* @__PURE__ */ v("span", {
|
|
291
|
+
className: "rounded-full bg-bg-sunken px-2 py-0.5 text-xs font-medium tabular-nums text-text-secondary",
|
|
292
|
+
children: $
|
|
293
|
+
})
|
|
294
|
+
]
|
|
295
|
+
}), /* @__PURE__ */ v("p", {
|
|
296
|
+
className: "text-xs text-text-secondary",
|
|
297
|
+
children: "Every proposed audience segment and budget shift stays pending until you explicitly apply or dismiss it."
|
|
298
|
+
})]
|
|
299
|
+
}), /* @__PURE__ */ y("div", {
|
|
300
|
+
className: "flex flex-wrap items-center gap-2",
|
|
301
|
+
children: [/* @__PURE__ */ y("button", {
|
|
302
|
+
type: "button",
|
|
303
|
+
onClick: () => x(S + "/crm/leads"),
|
|
304
|
+
className: "inline-flex items-center gap-1 rounded-md border border-border-subtle px-2.5 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken",
|
|
305
|
+
children: ["Score Leads", /* @__PURE__ */ v(h, { className: "h-3.5 w-3.5" })]
|
|
306
|
+
}), /* @__PURE__ */ y("button", {
|
|
307
|
+
type: "button",
|
|
308
|
+
onClick: () => x(S + "/crm/pipeline"),
|
|
309
|
+
className: "inline-flex items-center gap-1 rounded-md border border-border-subtle px-2.5 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken",
|
|
310
|
+
children: ["Deal Next Actions", /* @__PURE__ */ v(h, { className: "h-3.5 w-3.5" })]
|
|
311
|
+
})]
|
|
312
|
+
})]
|
|
313
|
+
}),
|
|
314
|
+
(F || U) && $ === 0 && /* @__PURE__ */ y("div", {
|
|
315
|
+
role: "status",
|
|
316
|
+
className: "flex items-center gap-2 rounded-md border border-border-subtle bg-bg-sunken/50 px-3 py-2.5 text-xs text-text-secondary",
|
|
317
|
+
children: [/* @__PURE__ */ v(p, { className: "h-4 w-4 shrink-0 text-status-warning-text" }), /* @__PURE__ */ v("span", { children: "Pending AI decisions are temporarily unavailable. Non-AI campaign and CRM controls remain available." })]
|
|
318
|
+
}),
|
|
319
|
+
P && Se && $ === 0 ? /* @__PURE__ */ v("div", { className: "h-24 animate-pulse rounded-md bg-bg-sunken/50" }) : $ === 0 && !F && !U ? /* @__PURE__ */ v("p", {
|
|
320
|
+
className: "rounded-md border border-dashed border-border-subtle py-6 text-center text-xs text-text-secondary",
|
|
321
|
+
children: "No pending AI proposals right now. Generate audience suggestions on a campaign, budget proposals on an ad campaign, or score leads from CRM."
|
|
322
|
+
}) : /* @__PURE__ */ y("div", {
|
|
323
|
+
className: "grid grid-cols-1 gap-4 lg:grid-cols-2",
|
|
324
|
+
children: [W.map((e) => {
|
|
325
|
+
let t = le(e.criteria);
|
|
326
|
+
return /* @__PURE__ */ v(u, {
|
|
327
|
+
testId: `decision-card-audience-${e.id}`,
|
|
328
|
+
title: e.name,
|
|
329
|
+
subtitle: `Audience proposal · ${l(e.previewCount)} matching contacts`,
|
|
330
|
+
badge: "Audience segment",
|
|
331
|
+
badgeTone: "info",
|
|
332
|
+
rationale: e.rationale,
|
|
333
|
+
provider: e.provider,
|
|
334
|
+
model: e.model,
|
|
335
|
+
source: e.source,
|
|
336
|
+
applyLabel: "Confirm & create audience",
|
|
337
|
+
dismissLabel: "Dismiss",
|
|
338
|
+
busy: L === e.id,
|
|
339
|
+
error: z[e.id] ?? null,
|
|
340
|
+
onApply: () => void Te(e.id),
|
|
341
|
+
onDismiss: () => void Ee(e.id),
|
|
342
|
+
children: t.length > 0 && /* @__PURE__ */ v("div", {
|
|
343
|
+
className: "flex flex-wrap gap-1.5",
|
|
344
|
+
children: t.map((e) => /* @__PURE__ */ v("span", {
|
|
345
|
+
className: "rounded-full bg-bg-sunken px-2.5 py-0.5 text-[11px] text-text-secondary",
|
|
346
|
+
children: e
|
|
347
|
+
}, e))
|
|
348
|
+
})
|
|
349
|
+
}, e.id);
|
|
350
|
+
}), G.map((e) => {
|
|
351
|
+
let { delta: t, deltaPct: n, direction: r } = ae(e.currentBudget, e.recommendedBudget);
|
|
352
|
+
return /* @__PURE__ */ v(u, {
|
|
353
|
+
testId: `decision-card-budget-${e.id}`,
|
|
354
|
+
title: "Ad budget reallocation proposal",
|
|
355
|
+
subtitle: `Ad campaign ${e.adCampaignId}`,
|
|
356
|
+
badge: r === "increase" ? `+${n}%` : r === "decrease" ? `${n}%` : "Hold",
|
|
357
|
+
badgeTone: r === "increase" ? "success" : r === "decrease" ? "warning" : "info",
|
|
358
|
+
confidence: e.confidence,
|
|
359
|
+
rationale: e.rationale,
|
|
360
|
+
source: e.source,
|
|
361
|
+
metrics: /* @__PURE__ */ y("div", {
|
|
362
|
+
className: "grid grid-cols-3 gap-2 rounded-md border border-border-subtle bg-bg-sunken/40 p-2.5 text-xs",
|
|
363
|
+
children: [
|
|
364
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
|
|
365
|
+
className: "text-text-secondary",
|
|
366
|
+
children: "Current"
|
|
367
|
+
}), /* @__PURE__ */ v("p", {
|
|
368
|
+
className: "font-semibold tabular-nums text-text-primary",
|
|
369
|
+
children: c(e.currentBudget)
|
|
370
|
+
})] }),
|
|
371
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
|
|
372
|
+
className: "text-text-secondary",
|
|
373
|
+
children: "Proposed"
|
|
374
|
+
}), /* @__PURE__ */ v("p", {
|
|
375
|
+
className: "font-semibold tabular-nums text-text-primary",
|
|
376
|
+
children: c(e.recommendedBudget)
|
|
377
|
+
})] }),
|
|
378
|
+
/* @__PURE__ */ y("div", { children: [/* @__PURE__ */ v("p", {
|
|
379
|
+
className: "text-text-secondary",
|
|
380
|
+
children: "Change"
|
|
381
|
+
}), /* @__PURE__ */ y("p", {
|
|
382
|
+
className: "font-semibold tabular-nums text-text-primary",
|
|
383
|
+
children: [t >= 0 ? "+" : "", c(t)]
|
|
384
|
+
})] })
|
|
385
|
+
]
|
|
386
|
+
}),
|
|
387
|
+
applyLabel: "Apply budget change",
|
|
388
|
+
dismissLabel: "Dismiss",
|
|
389
|
+
busy: L === e.id,
|
|
390
|
+
error: z[e.id] ?? null,
|
|
391
|
+
onApply: () => void De(e.id),
|
|
392
|
+
onDismiss: () => xe((t) => new Set(t).add(e.id))
|
|
393
|
+
}, e.id);
|
|
394
|
+
})]
|
|
395
|
+
})
|
|
396
|
+
]
|
|
397
|
+
}),
|
|
398
|
+
/* @__PURE__ */ y("section", {
|
|
399
|
+
"aria-labelledby": "hsm-agent-runs-heading",
|
|
400
|
+
className: "rounded-lg border border-border-seam bg-gloss-card p-5 shadow-pop space-y-4",
|
|
401
|
+
children: [/* @__PURE__ */ y("div", {
|
|
402
|
+
className: "flex flex-wrap items-center justify-between gap-3",
|
|
403
|
+
children: [/* @__PURE__ */ y("div", {
|
|
404
|
+
className: "space-y-0.5",
|
|
405
|
+
children: [/* @__PURE__ */ y("div", {
|
|
406
|
+
className: "flex items-center gap-2",
|
|
407
|
+
children: [
|
|
408
|
+
/* @__PURE__ */ v(ue, {
|
|
409
|
+
className: "h-4 w-4 text-action-primary-bg",
|
|
410
|
+
"aria-hidden": "true"
|
|
411
|
+
}),
|
|
412
|
+
/* @__PURE__ */ v("h2", {
|
|
413
|
+
id: "hsm-agent-runs-heading",
|
|
414
|
+
className: "text-base font-semibold text-text-primary",
|
|
415
|
+
children: "HeadshotMarketing AI Run Activity"
|
|
416
|
+
}),
|
|
417
|
+
/* @__PURE__ */ v("span", {
|
|
418
|
+
className: "rounded-full bg-bg-sunken px-2 py-0.5 text-xs font-medium tabular-nums text-text-secondary",
|
|
419
|
+
children: l(Ne)
|
|
420
|
+
})
|
|
421
|
+
]
|
|
422
|
+
}), /* @__PURE__ */ v("p", {
|
|
423
|
+
className: "text-xs text-text-secondary",
|
|
424
|
+
children: "Product-level audit feed of lead scoring, audience segmentation, budget optimization, content tools, and agent runs reconciled to the shared AI ledger."
|
|
425
|
+
})]
|
|
426
|
+
}), /* @__PURE__ */ y("div", {
|
|
427
|
+
className: "flex flex-wrap items-center gap-2",
|
|
428
|
+
children: [
|
|
429
|
+
/* @__PURE__ */ y("select", {
|
|
430
|
+
"aria-label": "Filter runs by status",
|
|
431
|
+
value: K,
|
|
432
|
+
onChange: (e) => Oe(e.target.value),
|
|
433
|
+
className: "rounded-md border border-border-subtle bg-bg-surface px-2.5 py-1.5 text-xs text-text-primary",
|
|
434
|
+
children: [
|
|
435
|
+
/* @__PURE__ */ v("option", {
|
|
436
|
+
value: "all",
|
|
437
|
+
children: "All statuses"
|
|
438
|
+
}),
|
|
439
|
+
/* @__PURE__ */ v("option", {
|
|
440
|
+
value: e.Completed,
|
|
441
|
+
children: "Completed"
|
|
442
|
+
}),
|
|
443
|
+
/* @__PURE__ */ v("option", {
|
|
444
|
+
value: e.Failed,
|
|
445
|
+
children: "Failed"
|
|
446
|
+
}),
|
|
447
|
+
/* @__PURE__ */ v("option", {
|
|
448
|
+
value: e.Running,
|
|
449
|
+
children: "Running"
|
|
450
|
+
})
|
|
451
|
+
]
|
|
452
|
+
}),
|
|
453
|
+
/* @__PURE__ */ y("select", {
|
|
454
|
+
"aria-label": "Filter runs by trigger",
|
|
455
|
+
value: q,
|
|
456
|
+
onChange: (e) => ke(e.target.value),
|
|
457
|
+
className: "rounded-md border border-border-subtle bg-bg-surface px-2.5 py-1.5 text-xs text-text-primary",
|
|
458
|
+
children: [
|
|
459
|
+
/* @__PURE__ */ v("option", {
|
|
460
|
+
value: "all",
|
|
461
|
+
children: "All triggers"
|
|
462
|
+
}),
|
|
463
|
+
/* @__PURE__ */ v("option", {
|
|
464
|
+
value: "manual",
|
|
465
|
+
children: "Manual"
|
|
466
|
+
}),
|
|
467
|
+
/* @__PURE__ */ v("option", {
|
|
468
|
+
value: "scheduled",
|
|
469
|
+
children: "Scheduled"
|
|
470
|
+
}),
|
|
471
|
+
/* @__PURE__ */ v("option", {
|
|
472
|
+
value: "event",
|
|
473
|
+
children: "Event"
|
|
474
|
+
})
|
|
475
|
+
]
|
|
476
|
+
}),
|
|
477
|
+
/* @__PURE__ */ y("button", {
|
|
478
|
+
type: "button",
|
|
479
|
+
onClick: () => void Me(),
|
|
480
|
+
className: "inline-flex items-center gap-1 rounded-md border border-border-seam bg-gloss-card px-2.5 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken",
|
|
481
|
+
children: [/* @__PURE__ */ v(g, {
|
|
482
|
+
className: "h-3.5 w-3.5",
|
|
483
|
+
"aria-hidden": "true"
|
|
484
|
+
}), "Refresh"]
|
|
485
|
+
})
|
|
486
|
+
]
|
|
487
|
+
})]
|
|
488
|
+
}), X && Z.length === 0 ? /* @__PURE__ */ y("div", {
|
|
489
|
+
role: "status",
|
|
490
|
+
className: "flex items-center gap-2 rounded-md border border-border-subtle bg-bg-sunken/50 px-3 py-2.5 text-xs text-text-secondary",
|
|
491
|
+
children: [/* @__PURE__ */ v(p, { className: "h-4 w-4 shrink-0 text-status-warning-text" }), /* @__PURE__ */ v("span", { children: "AI run activity is unavailable right now (requires AI ledger read permission or active AI service)." })]
|
|
492
|
+
}) : Ae && Z.length === 0 ? /* @__PURE__ */ v("div", {
|
|
493
|
+
className: "space-y-2",
|
|
494
|
+
children: [
|
|
495
|
+
0,
|
|
496
|
+
1,
|
|
497
|
+
2
|
|
498
|
+
].map((e) => /* @__PURE__ */ v("div", { className: "h-10 animate-pulse rounded-md bg-bg-sunken/50" }, e))
|
|
499
|
+
}) : Z.length === 0 ? /* @__PURE__ */ v("p", {
|
|
500
|
+
className: "rounded-md border border-dashed border-border-subtle py-6 text-center text-xs text-text-secondary",
|
|
501
|
+
children: "No AI runs recorded for this workspace yet."
|
|
502
|
+
}) : /* @__PURE__ */ y("div", {
|
|
503
|
+
className: "space-y-3",
|
|
504
|
+
children: [/* @__PURE__ */ v("div", {
|
|
505
|
+
className: "overflow-x-auto",
|
|
506
|
+
children: /* @__PURE__ */ y("table", {
|
|
507
|
+
className: "w-full text-left text-xs",
|
|
508
|
+
children: [/* @__PURE__ */ v("thead", { children: /* @__PURE__ */ y("tr", {
|
|
509
|
+
className: "border-b border-border-subtle text-text-secondary",
|
|
510
|
+
children: [
|
|
511
|
+
/* @__PURE__ */ v("th", {
|
|
512
|
+
className: "py-2 pr-3 font-medium",
|
|
513
|
+
children: "Operation"
|
|
514
|
+
}),
|
|
515
|
+
/* @__PURE__ */ v("th", {
|
|
516
|
+
className: "py-2 pr-3 font-medium",
|
|
517
|
+
children: "Model / Source"
|
|
518
|
+
}),
|
|
519
|
+
/* @__PURE__ */ v("th", {
|
|
520
|
+
className: "py-2 pr-3 font-medium",
|
|
521
|
+
children: "Trigger"
|
|
522
|
+
}),
|
|
523
|
+
/* @__PURE__ */ v("th", {
|
|
524
|
+
className: "py-2 pr-3 font-medium",
|
|
525
|
+
children: "Decision"
|
|
526
|
+
}),
|
|
527
|
+
/* @__PURE__ */ v("th", {
|
|
528
|
+
className: "py-2 pr-3 font-medium",
|
|
529
|
+
children: "Latency"
|
|
530
|
+
}),
|
|
531
|
+
/* @__PURE__ */ v("th", {
|
|
532
|
+
className: "py-2 pr-3 font-medium",
|
|
533
|
+
children: "Cost"
|
|
534
|
+
}),
|
|
535
|
+
/* @__PURE__ */ v("th", {
|
|
536
|
+
className: "py-2 pr-3 font-medium",
|
|
537
|
+
children: "Status"
|
|
538
|
+
}),
|
|
539
|
+
/* @__PURE__ */ v("th", {
|
|
540
|
+
className: "py-2 font-medium",
|
|
541
|
+
children: "When"
|
|
542
|
+
})
|
|
543
|
+
]
|
|
544
|
+
}) }), /* @__PURE__ */ v("tbody", {
|
|
545
|
+
className: "divide-y divide-border-subtle",
|
|
546
|
+
children: Z.map((t) => /* @__PURE__ */ y("tr", {
|
|
547
|
+
className: "text-text-primary",
|
|
548
|
+
children: [
|
|
549
|
+
/* @__PURE__ */ v("td", {
|
|
550
|
+
className: "py-2.5 pr-3 font-medium",
|
|
551
|
+
children: t.operationKey
|
|
552
|
+
}),
|
|
553
|
+
/* @__PURE__ */ v("td", {
|
|
554
|
+
className: "py-2.5 pr-3 text-text-secondary",
|
|
555
|
+
children: ce({
|
|
556
|
+
provider: t.provider,
|
|
557
|
+
model: t.model
|
|
558
|
+
})
|
|
559
|
+
}),
|
|
560
|
+
/* @__PURE__ */ v("td", {
|
|
561
|
+
className: "py-2.5 pr-3 capitalize text-text-secondary",
|
|
562
|
+
children: t.trigger
|
|
563
|
+
}),
|
|
564
|
+
/* @__PURE__ */ v("td", {
|
|
565
|
+
className: "py-2.5 pr-3 text-text-secondary",
|
|
566
|
+
children: t.decision ?? "—"
|
|
567
|
+
}),
|
|
568
|
+
/* @__PURE__ */ v("td", {
|
|
569
|
+
className: "py-2.5 pr-3 tabular-nums text-text-secondary",
|
|
570
|
+
children: se(t.latencyMs ?? t.durationMs)
|
|
571
|
+
}),
|
|
572
|
+
/* @__PURE__ */ v("td", {
|
|
573
|
+
className: "py-2.5 pr-3 tabular-nums text-text-secondary",
|
|
574
|
+
children: oe({
|
|
575
|
+
costUsd: t.costUsd,
|
|
576
|
+
simulated: t.simulated
|
|
577
|
+
})
|
|
578
|
+
}),
|
|
579
|
+
/* @__PURE__ */ v("td", {
|
|
580
|
+
className: "py-2.5 pr-3",
|
|
581
|
+
children: /* @__PURE__ */ v("span", {
|
|
582
|
+
className: s("inline-flex rounded-full px-2 py-0.5 text-[11px] font-medium", t.status === e.Completed ? "bg-status-success-bg text-status-success-text" : t.status === e.Failed ? "bg-status-error-bg text-status-error-text" : "bg-status-warning-bg text-status-warning-text"),
|
|
583
|
+
children: t.status.toLowerCase()
|
|
584
|
+
})
|
|
585
|
+
}),
|
|
586
|
+
/* @__PURE__ */ v("td", {
|
|
587
|
+
className: "py-2.5 whitespace-nowrap text-text-secondary",
|
|
588
|
+
children: ie(t.createdAt, "relative")
|
|
589
|
+
})
|
|
590
|
+
]
|
|
591
|
+
}, t.id))
|
|
592
|
+
})]
|
|
593
|
+
})
|
|
594
|
+
}), Q?.hasNextPage && /* @__PURE__ */ v("div", {
|
|
595
|
+
className: "flex justify-center pt-1",
|
|
596
|
+
children: /* @__PURE__ */ v("button", {
|
|
597
|
+
type: "button",
|
|
598
|
+
onClick: () => void Pe(),
|
|
599
|
+
className: "rounded-md border border-border-seam bg-gloss-card px-3 py-1.5 text-xs font-medium text-text-primary hover:bg-bg-sunken",
|
|
600
|
+
children: "Load more runs"
|
|
601
|
+
})
|
|
602
|
+
})]
|
|
603
|
+
})]
|
|
604
|
+
})
|
|
605
|
+
]
|
|
606
|
+
})]
|
|
8
607
|
});
|
|
9
|
-
}
|
|
10
|
-
export {
|
|
608
|
+
};
|
|
609
|
+
export { x as AiOperationsPage };
|
|
11
610
|
|
|
12
611
|
//# sourceMappingURL=AiOperationsPage.js.map
|