@burdenoff/microfe-headshotmarketing 2026.1030.13 → 2026.1101.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/generated/wspace-operations.d.ts +251 -0
- package/dist/generated/wspace-operations.d.ts.map +1 -1
- package/dist/generated/wspace-operations.js +446 -322
- package/dist/generated/wspace-operations.js.map +1 -1
- package/dist/generated/wspace-types.d.ts +4370 -34
- package/dist/generated/wspace-types.d.ts.map +1 -1
- package/dist/generated/wspace-types.js +3 -1
- package/dist/generated/wspace-types.js.map +1 -1
- package/dist/headshotmarketing/components/TrackedLinksPanel.d.ts +19 -0
- package/dist/headshotmarketing/components/TrackedLinksPanel.d.ts.map +1 -0
- package/dist/headshotmarketing/components/TrackedLinksPanel.js +246 -0
- package/dist/headshotmarketing/components/TrackedLinksPanel.js.map +1 -0
- package/dist/headshotmarketing/components/index.d.ts +1 -0
- package/dist/headshotmarketing/components/index.d.ts.map +1 -1
- package/dist/headshotmarketing/components/index.js +1 -0
- package/dist/headshotmarketing/pages/ads/AdCampaignDetailsPage.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/ads/AdCampaignDetailsPage.js +245 -211
- package/dist/headshotmarketing/pages/ads/AdCampaignDetailsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/ads/AdCreativesPage.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/ads/AdCreativesPage.js +86 -76
- package/dist/headshotmarketing/pages/ads/AdCreativesPage.js.map +1 -1
- package/dist/headshotmarketing/pages/analytics/AttributionPage.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/analytics/AttributionPage.js +249 -244
- package/dist/headshotmarketing/pages/analytics/AttributionPage.js.map +1 -1
- package/dist/headshotmarketing/pages/analytics/TouchpointLedgerCard.d.ts +4 -0
- package/dist/headshotmarketing/pages/analytics/TouchpointLedgerCard.d.ts.map +1 -0
- package/dist/headshotmarketing/pages/analytics/TouchpointLedgerCard.js +196 -0
- package/dist/headshotmarketing/pages/analytics/TouchpointLedgerCard.js.map +1 -0
- package/dist/headshotmarketing/pages/content/AIGeneratedBadge.d.ts +12 -0
- package/dist/headshotmarketing/pages/content/AIGeneratedBadge.d.ts.map +1 -0
- package/dist/headshotmarketing/pages/content/AIGeneratedBadge.js +30 -0
- package/dist/headshotmarketing/pages/content/AIGeneratedBadge.js.map +1 -0
- package/dist/headshotmarketing/pages/content/AIToolsPage.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/content/AIToolsPage.js +51 -50
- package/dist/headshotmarketing/pages/content/AIToolsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/content/ContentCreationPage.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/content/ContentCreationPage.js +409 -408
- package/dist/headshotmarketing/pages/content/ContentCreationPage.js.map +1 -1
- package/dist/headshotmarketing/pages/content/ContentDetailsPage.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/content/ContentDetailsPage.js +158 -104
- package/dist/headshotmarketing/pages/content/ContentDetailsPage.js.map +1 -1
- package/dist/headshotmarketing/pages/content/ContentItemActions.d.ts +5 -0
- package/dist/headshotmarketing/pages/content/ContentItemActions.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/content/ContentItemActions.js +103 -34
- package/dist/headshotmarketing/pages/content/ContentItemActions.js.map +1 -1
- package/dist/headshotmarketing/pages/content/ContentLibraryCard.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/content/ContentLibraryCard.js +102 -102
- package/dist/headshotmarketing/pages/content/ContentLibraryCard.js.map +1 -1
- package/dist/headshotmarketing/pages/crm/LeadCreateModal.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/crm/LeadCreateModal.js +150 -76
- package/dist/headshotmarketing/pages/crm/LeadCreateModal.js.map +1 -1
- package/dist/headshotmarketing/pages/social-media/PostsPage.d.ts.map +1 -1
- package/dist/headshotmarketing/pages/social-media/PostsPage.js +254 -246
- package/dist/headshotmarketing/pages/social-media/PostsPage.js.map +1 -1
- package/dist/headshotmarketing/types/index.d.ts +17 -0
- package/dist/headshotmarketing/types/index.d.ts.map +1 -1
- package/dist/headshotmarketing/utils/contentLibrary.d.ts +6 -0
- package/dist/headshotmarketing/utils/contentLibrary.d.ts.map +1 -1
- package/dist/headshotmarketing/utils/contentLibrary.js +17 -11
- package/dist/headshotmarketing/utils/contentLibrary.js.map +1 -1
- package/dist/headshotmarketing/utils/contentMapper.d.ts +13 -1
- package/dist/headshotmarketing/utils/contentMapper.d.ts.map +1 -1
- package/dist/headshotmarketing/utils/contentMapper.js +26 -13
- package/dist/headshotmarketing/utils/contentMapper.js.map +1 -1
- package/dist/headshotmarketing/utils/trackedLinks.d.ts +75 -0
- package/dist/headshotmarketing/utils/trackedLinks.d.ts.map +1 -0
- package/dist/headshotmarketing/utils/trackedLinks.js +99 -0
- package/dist/headshotmarketing/utils/trackedLinks.js.map +1 -0
- package/package.json +1 -1
|
@@ -56,7 +56,7 @@ function we(e, t) {
|
|
|
56
56
|
let n = e.toLowerCase();
|
|
57
57
|
return n.includes("blog") ? x : n.includes("subject line") || n.includes("email") ? v : n.includes("caption") || n.includes("social") ? b : n.includes("ad copy") || n.includes("ad ") || n.includes("advert") ? y : n.includes("seo") || n.includes("meta") || n.includes("keyword") ? C : n.includes("alt") || n.includes("image") || n.includes("photo") ? h : n.includes("repurpose") || n.includes("remix") ? m : n.includes("voice") || n.includes("tone") ? ce : n.includes("translat") ? g : n.includes("summar") ? S : n.includes("video") || n.includes("script") ? T : A[t] ?? w;
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function Te(e, t) {
|
|
60
60
|
let n = e.toLowerCase();
|
|
61
61
|
if (n.includes("blog")) return o.BlogPost;
|
|
62
62
|
if (n.includes("caption") || n.includes("social")) return o.SocialPost;
|
|
@@ -70,23 +70,23 @@ function j(e, t) {
|
|
|
70
70
|
default: return o.Other;
|
|
71
71
|
}
|
|
72
72
|
}
|
|
73
|
-
function
|
|
73
|
+
function Ee(e, t) {
|
|
74
74
|
let n = e.split("\n").find((e) => e.trim())?.trim() ?? "";
|
|
75
75
|
return (n.length > 64 ? `${n.slice(0, 61)}…` : n) || `${t} draft`;
|
|
76
76
|
}
|
|
77
|
-
var
|
|
78
|
-
let { data: m, loading: h, error: g, refetch: v } = te(), { navigate: y, basePath: b } = t(), { copy: ce } = fe(), [x, { loading: S }] = pe(Se), [C] = e(), [T, E] = d(null), [A,
|
|
77
|
+
var j = () => {
|
|
78
|
+
let { data: m, loading: h, error: g, refetch: v } = te(), { navigate: y, basePath: b } = t(), { copy: ce } = fe(), [x, { loading: S }] = pe(Se), [C] = e(), [T, E] = d(null), [A, j] = d(""), [De, Oe] = d(""), [M, N] = d([]), [P, F] = d(null), [ke, I] = d(null), [Ae, L] = d(null), [R, je] = d(null), [z, Me] = d(null), [B, V] = d(/* @__PURE__ */ new Set()), [H, U] = d(null), W = u(() => m?.headshotmarketingAITools.items ?? [], [m]), G = u(() => m?.headshotmarketingAIToolExecutions.items ?? [], [m]), K = u(() => {
|
|
79
79
|
let e = /* @__PURE__ */ new Date();
|
|
80
80
|
return new Date(e.getFullYear(), e.getMonth(), 1).getTime();
|
|
81
|
-
}, []),
|
|
81
|
+
}, []), Ne = u(() => {
|
|
82
82
|
let e = /* @__PURE__ */ new Map();
|
|
83
83
|
for (let t of G) new Date(t.createdAt).getTime() >= K && e.set(t.toolId, (e.get(t.toolId) ?? 0) + 1);
|
|
84
84
|
return e;
|
|
85
|
-
}, [G, K]),
|
|
85
|
+
}, [G, K]), Pe = u(() => {
|
|
86
86
|
let e = 0;
|
|
87
87
|
for (let t of G) new Date(t.createdAt).getTime() >= K && (e += t.tokensUsed ?? 0);
|
|
88
88
|
return e;
|
|
89
|
-
}, [G, K]),
|
|
89
|
+
}, [G, K]), Fe = u(() => G.filter((e) => new Date(e.createdAt).getTime() >= K).length, [G, K]), Ie = u(() => {
|
|
90
90
|
let e = /* @__PURE__ */ new Map();
|
|
91
91
|
for (let t of W) {
|
|
92
92
|
if (!t.model) continue;
|
|
@@ -104,19 +104,19 @@ var M = () => {
|
|
|
104
104
|
isAvailable: e.isEnabled,
|
|
105
105
|
icon: we(e.name, e.category),
|
|
106
106
|
inputType: e.category === a.SeoOptimization ? "url" : "text",
|
|
107
|
-
contentType:
|
|
108
|
-
monthlyUses:
|
|
109
|
-
})), [W,
|
|
107
|
+
contentType: Te(e.name, e.category),
|
|
108
|
+
monthlyUses: Ne.get(e.id) ?? 0
|
|
109
|
+
})), [W, Ne]), Le = u(() => new Map(q.map((e) => [e.id, e])), [q]), J = q.find((e) => e.id === T), Re = q.filter((e) => e.isAvailable).length;
|
|
110
110
|
ie(() => {
|
|
111
111
|
!T && q.length > 0 && E((q.find((e) => e.isAvailable) ?? q[0]).id);
|
|
112
112
|
}, [T, q]);
|
|
113
113
|
let Y = u(() => {
|
|
114
114
|
if (!J) return [];
|
|
115
|
-
let e = new Set(
|
|
115
|
+
let e = new Set(Ie.get(J.provider) ?? []);
|
|
116
116
|
return J.model && e.add(J.model), Array.from(e);
|
|
117
|
-
}, [J,
|
|
118
|
-
E(e),
|
|
119
|
-
},
|
|
117
|
+
}, [J, Ie]), X = De || J?.model || Y[0] || "", ze = (e) => {
|
|
118
|
+
E(e), N([]), I(null), F(null), L(null), U(null), j(""), Oe(""), V(/* @__PURE__ */ new Set());
|
|
119
|
+
}, Be = async () => {
|
|
120
120
|
if (!(!A.trim() || !J || !J.isAvailable)) {
|
|
121
121
|
L(null), U(null), V(/* @__PURE__ */ new Set());
|
|
122
122
|
try {
|
|
@@ -129,7 +129,7 @@ var M = () => {
|
|
|
129
129
|
} : { provider: J.provider }
|
|
130
130
|
} } })).data?.headshotmarketingExecuteAITool;
|
|
131
131
|
if (!e) throw Error("No response from the tool.");
|
|
132
|
-
e.status === "FAILED" ? (
|
|
132
|
+
e.status === "FAILED" ? (N([]), I(null), F(null), L(e.errorMessage ?? "The tool failed to generate a result. Please try again.")) : (N(l(e.output)), I(e.id), F({
|
|
133
133
|
tokensUsed: e.tokensUsed,
|
|
134
134
|
durationMs: e.durationMs
|
|
135
135
|
})), await v();
|
|
@@ -138,17 +138,18 @@ var M = () => {
|
|
|
138
138
|
}
|
|
139
139
|
}
|
|
140
140
|
}, Z = async (e, t) => {
|
|
141
|
-
await ce(t),
|
|
142
|
-
}, Q = async (e, t, n) => {
|
|
141
|
+
await ce(t), je(e), window.setTimeout(() => je((t) => t === e ? null : t), 1500);
|
|
142
|
+
}, Q = async (e, t, n, r) => {
|
|
143
143
|
if (t.trim()) {
|
|
144
|
-
U(null),
|
|
144
|
+
U(null), Me(e);
|
|
145
145
|
try {
|
|
146
146
|
await C({ variables: { input: {
|
|
147
|
-
title:
|
|
147
|
+
title: Ee(t, n?.name ?? "AI"),
|
|
148
148
|
body: t,
|
|
149
149
|
summary: t.replace(/\s+/g, " ").trim().slice(0, 180),
|
|
150
|
-
type: n ?
|
|
150
|
+
type: n ? Te(n.name, n.category) : o.Other,
|
|
151
151
|
tags: ["ai-generated"],
|
|
152
|
+
aiToolExecutionId: r,
|
|
152
153
|
metadata: {
|
|
153
154
|
source: "ai-tools",
|
|
154
155
|
toolId: n?.id ?? null,
|
|
@@ -159,23 +160,23 @@ var M = () => {
|
|
|
159
160
|
} catch (e) {
|
|
160
161
|
U(e instanceof Error ? e.message : "Could not save draft.");
|
|
161
162
|
} finally {
|
|
162
|
-
|
|
163
|
+
Me(null);
|
|
163
164
|
}
|
|
164
165
|
}
|
|
165
|
-
}, $ =
|
|
166
|
+
}, $ = M.join("\n\n"), Ve = [
|
|
166
167
|
{
|
|
167
168
|
label: "Available tools",
|
|
168
|
-
value: String(
|
|
169
|
+
value: String(Re),
|
|
169
170
|
icon: ue
|
|
170
171
|
},
|
|
171
172
|
{
|
|
172
173
|
label: "Generations this month",
|
|
173
|
-
value: i(
|
|
174
|
+
value: i(Fe),
|
|
174
175
|
icon: w
|
|
175
176
|
},
|
|
176
177
|
{
|
|
177
178
|
label: "Tokens this month",
|
|
178
|
-
value: i(
|
|
179
|
+
value: i(Pe),
|
|
179
180
|
icon: de
|
|
180
181
|
}
|
|
181
182
|
];
|
|
@@ -201,7 +202,7 @@ var M = () => {
|
|
|
201
202
|
}) : /* @__PURE__ */ k(D, { children: [
|
|
202
203
|
/* @__PURE__ */ O("div", {
|
|
203
204
|
className: "grid grid-cols-1 gap-4 sm:grid-cols-3",
|
|
204
|
-
children:
|
|
205
|
+
children: Ve.map((e) => {
|
|
205
206
|
let t = e.icon;
|
|
206
207
|
return /* @__PURE__ */ k(me, {
|
|
207
208
|
treatment: "metric",
|
|
@@ -235,7 +236,7 @@ var M = () => {
|
|
|
235
236
|
let t = e.icon, r = T === e.id;
|
|
236
237
|
return /* @__PURE__ */ k("button", {
|
|
237
238
|
type: "button",
|
|
238
|
-
onClick: () =>
|
|
239
|
+
onClick: () => ze(e.id),
|
|
239
240
|
disabled: !e.isAvailable,
|
|
240
241
|
"aria-pressed": r,
|
|
241
242
|
className: n("group relative flex min-h-[44px] flex-col items-start rounded-card border p-4 text-left transition-[box-shadow,border-color,background-color] duration-200", r ? "border-primary bg-accent-wash shadow-elevation-2" : e.isAvailable ? "border-border-subtle bg-bg-surface hover:border-border-strong hover:shadow-elevation-2" : "cursor-not-allowed border-border-subtle bg-bg-sunken opacity-60"),
|
|
@@ -284,7 +285,7 @@ var M = () => {
|
|
|
284
285
|
}) : /* @__PURE__ */ O("div", {
|
|
285
286
|
className: "space-y-3",
|
|
286
287
|
children: G.map((e) => {
|
|
287
|
-
let t =
|
|
288
|
+
let t = Le.get(e.toolId), n = l(e.input)[0] ?? "—", i = l(e.output)[0] ?? "—", a = t?.icon ?? w, o = `gen-${e.id}`, s = B.has(o);
|
|
288
289
|
return /* @__PURE__ */ k("div", {
|
|
289
290
|
className: "rounded-card border border-border-seam bg-gloss-card p-4 shadow-pop",
|
|
290
291
|
children: [
|
|
@@ -318,7 +319,7 @@ var M = () => {
|
|
|
318
319
|
children: R === o ? /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O(f, { className: "h-3 w-3" }), " Copied"] }) : /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O(oe, { className: "h-3 w-3" }), " Copy"] })
|
|
319
320
|
}), /* @__PURE__ */ O("button", {
|
|
320
321
|
type: "button",
|
|
321
|
-
onClick: () => void Q(o, i, t),
|
|
322
|
+
onClick: () => void Q(o, i, t, e.id),
|
|
322
323
|
disabled: z === o || s,
|
|
323
324
|
className: "inline-flex items-center gap-1 text-xs font-medium text-primary hover:underline disabled:opacity-60",
|
|
324
325
|
children: z === o ? /* @__PURE__ */ k(D, { children: [
|
|
@@ -361,20 +362,20 @@ var M = () => {
|
|
|
361
362
|
}),
|
|
362
363
|
/* @__PURE__ */ O(xe, {
|
|
363
364
|
value: A,
|
|
364
|
-
onChange: (e) =>
|
|
365
|
+
onChange: (e) => j(e.target.value),
|
|
365
366
|
disabled: !J?.isAvailable,
|
|
366
367
|
placeholder: J?.inputType === "url" ? "https://your-website.com/page" : "Describe what you want to generate… (Enter to generate, Shift+Enter for a new line)",
|
|
367
368
|
rows: 4,
|
|
368
369
|
className: "min-h-[112px] resize-y",
|
|
369
370
|
onKeyDown: (e) => {
|
|
370
|
-
e.key === "Enter" && !e.shiftKey && (e.preventDefault(),
|
|
371
|
+
e.key === "Enter" && !e.shiftKey && (e.preventDefault(), Be());
|
|
371
372
|
}
|
|
372
373
|
}),
|
|
373
374
|
/* @__PURE__ */ k("div", {
|
|
374
375
|
className: "mt-3 flex flex-col gap-2 sm:flex-row",
|
|
375
376
|
children: [Y.length > 0 ? /* @__PURE__ */ k(ge, {
|
|
376
377
|
value: X,
|
|
377
|
-
onValueChange:
|
|
378
|
+
onValueChange: Oe,
|
|
378
379
|
disabled: !J?.isAvailable,
|
|
379
380
|
children: [/* @__PURE__ */ O(ye, {
|
|
380
381
|
"aria-label": "Model",
|
|
@@ -395,16 +396,16 @@ var M = () => {
|
|
|
395
396
|
})]
|
|
396
397
|
}), /* @__PURE__ */ O("button", {
|
|
397
398
|
type: "button",
|
|
398
|
-
onClick: () => void
|
|
399
|
+
onClick: () => void Be(),
|
|
399
400
|
disabled: S || !A.trim() || !J?.isAvailable,
|
|
400
401
|
className: n("inline-flex min-h-[44px] items-center justify-center gap-2 rounded-md px-5 text-sm font-semibold transition-colors sm:min-w-[132px]", S || !A.trim() || !J?.isAvailable ? "cursor-not-allowed bg-bg-sunken text-text-secondary" : "bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90"),
|
|
401
402
|
children: S ? /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O(_, { className: "h-4 w-4 animate-spin" }), "Generating…"] }) : /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O(le, { className: "h-4 w-4" }), "Generate"] })
|
|
402
403
|
})]
|
|
403
404
|
}),
|
|
404
|
-
|
|
405
|
+
Ae && /* @__PURE__ */ O("div", {
|
|
405
406
|
role: "alert",
|
|
406
407
|
className: "mt-3 rounded-md border border-status-error-border/30 bg-status-error-bg/10 px-3 py-2 text-sm text-status-error-text",
|
|
407
|
-
children:
|
|
408
|
+
children: Ae
|
|
408
409
|
}),
|
|
409
410
|
/* @__PURE__ */ k("div", {
|
|
410
411
|
className: "mt-4 overflow-hidden rounded-card border border-border-seam bg-bg-surface",
|
|
@@ -419,13 +420,13 @@ var M = () => {
|
|
|
419
420
|
children: [/* @__PURE__ */ O("button", {
|
|
420
421
|
type: "button",
|
|
421
422
|
onClick: () => void Z("out-all", $),
|
|
422
|
-
disabled:
|
|
423
|
+
disabled: M.length === 0,
|
|
423
424
|
className: "inline-flex min-h-[32px] items-center gap-1 rounded px-2 text-xs font-medium text-primary transition-colors hover:bg-bg-sunken disabled:opacity-40",
|
|
424
425
|
children: R === "out-all" ? /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O(f, { className: "h-3.5 w-3.5" }), " Copied"] }) : /* @__PURE__ */ k(D, { children: [/* @__PURE__ */ O(oe, { className: "h-3.5 w-3.5" }), " Copy"] })
|
|
425
426
|
}), /* @__PURE__ */ O("button", {
|
|
426
427
|
type: "button",
|
|
427
|
-
onClick: () => void Q("out-all", $, J),
|
|
428
|
-
disabled:
|
|
428
|
+
onClick: () => void Q("out-all", $, J, ke),
|
|
429
|
+
disabled: M.length === 0 || z === "out-all" || B.has("out-all"),
|
|
429
430
|
className: "inline-flex min-h-[32px] items-center gap-1 rounded px-2 text-xs font-medium text-primary transition-colors hover:bg-bg-sunken disabled:opacity-40",
|
|
430
431
|
children: z === "out-all" ? /* @__PURE__ */ k(D, { children: [
|
|
431
432
|
/* @__PURE__ */ O(_, { className: "h-3.5 w-3.5 animate-spin" }),
|
|
@@ -443,7 +444,7 @@ var M = () => {
|
|
|
443
444
|
className: "text-xs",
|
|
444
445
|
children: "Generating your content…"
|
|
445
446
|
})]
|
|
446
|
-
}) :
|
|
447
|
+
}) : M.length === 0 ? /* @__PURE__ */ k("div", {
|
|
447
448
|
className: "flex h-[124px] flex-col items-center justify-center gap-2 text-center text-text-secondary",
|
|
448
449
|
children: [/* @__PURE__ */ O(w, { className: "h-5 w-5 opacity-60" }), /* @__PURE__ */ O("span", {
|
|
449
450
|
className: "text-xs",
|
|
@@ -451,11 +452,11 @@ var M = () => {
|
|
|
451
452
|
})]
|
|
452
453
|
}) : /* @__PURE__ */ O("div", {
|
|
453
454
|
className: "space-y-3",
|
|
454
|
-
children:
|
|
455
|
+
children: M.map((e, t) => {
|
|
455
456
|
let r = `out-${t}`;
|
|
456
457
|
return /* @__PURE__ */ k("div", {
|
|
457
|
-
className: n(
|
|
458
|
-
children: [
|
|
458
|
+
className: n(M.length > 1 && "rounded-md border border-border-subtle bg-bg-sunken p-3"),
|
|
459
|
+
children: [M.length > 1 && /* @__PURE__ */ k("div", {
|
|
459
460
|
className: "mb-1.5 flex items-center justify-between",
|
|
460
461
|
children: [/* @__PURE__ */ k("span", {
|
|
461
462
|
className: "text-xs font-medium text-text-secondary",
|
|
@@ -469,7 +470,7 @@ var M = () => {
|
|
|
469
470
|
children: R === r ? "Copied" : "Copy"
|
|
470
471
|
}), /* @__PURE__ */ O("button", {
|
|
471
472
|
type: "button",
|
|
472
|
-
onClick: () => void Q(r, e, J),
|
|
473
|
+
onClick: () => void Q(r, e, J, ke),
|
|
473
474
|
disabled: z === r || B.has(r),
|
|
474
475
|
className: "text-xs font-medium text-primary hover:underline disabled:opacity-60",
|
|
475
476
|
children: z === r ? "Saving" : B.has(r) ? "Saved" : "Insert"
|
|
@@ -483,22 +484,22 @@ var M = () => {
|
|
|
483
484
|
})
|
|
484
485
|
})
|
|
485
486
|
}),
|
|
486
|
-
(
|
|
487
|
+
(P || H) && /* @__PURE__ */ k("div", {
|
|
487
488
|
className: "flex items-center justify-between gap-2 border-t border-border-subtle px-3 py-2 text-xs",
|
|
488
|
-
children: [
|
|
489
|
+
children: [P ? /* @__PURE__ */ k("span", {
|
|
489
490
|
className: "flex items-center gap-3 text-text-secondary",
|
|
490
|
-
children: [
|
|
491
|
+
children: [P.durationMs != null && /* @__PURE__ */ k("span", {
|
|
491
492
|
className: "flex items-center gap-1",
|
|
492
493
|
children: [
|
|
493
494
|
/* @__PURE__ */ O(ae, { className: "h-3 w-3" }),
|
|
494
|
-
(
|
|
495
|
+
(P.durationMs / 1e3).toFixed(1),
|
|
495
496
|
"s"
|
|
496
497
|
]
|
|
497
|
-
}),
|
|
498
|
+
}), P.tokensUsed != null && /* @__PURE__ */ k("span", {
|
|
498
499
|
className: "flex items-center gap-1",
|
|
499
500
|
children: [
|
|
500
501
|
/* @__PURE__ */ O(de, { className: "h-3 w-3" }),
|
|
501
|
-
i(
|
|
502
|
+
i(P.tokensUsed),
|
|
502
503
|
" tokens"
|
|
503
504
|
]
|
|
504
505
|
})]
|
|
@@ -529,6 +530,6 @@ var M = () => {
|
|
|
529
530
|
});
|
|
530
531
|
};
|
|
531
532
|
//#endregion
|
|
532
|
-
export {
|
|
533
|
+
export { j as AIToolsPage };
|
|
533
534
|
|
|
534
535
|
//# sourceMappingURL=AIToolsPage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AIToolsPage.js","names":[],"sources":["../../../../src/headshotmarketing/pages/content/AIToolsPage.tsx"],"sourcesContent":["/**\n * AI Tools Page\n *\n * A two-pane AI content console: a grid of real, workspace-scoped AI tools on the\n * left and a docked generation panel (prompt + model + streamed output with\n * Copy / Save-as-draft) on the right. All data is real Apollo data from the\n * shared bootstrap — tool catalog, per-tool monthly usage (derived from real\n * executions), and the executions feed. Generation persists a real\n * `AIToolExecution`; \"Save as draft\" persists a real `ContentItem`. The\n * execution ledger below the console accounts for every run (status, tokens,\n * duration, cost) straight off those persisted execution records.\n *\n * @module headshotmarketing/pages/content\n */\n\nimport { useEffect, useMemo, useState, type FC } from \"react\";\nimport {\n Sparkles,\n PenTool,\n Image as ImageIcon,\n Search,\n GitBranch,\n Mic,\n Send,\n Clock,\n Loader2,\n Megaphone,\n MessageSquare,\n Mail,\n Languages,\n Video,\n ScanText,\n Copy,\n FilePlus2,\n Check,\n Wand2,\n Cpu,\n Zap,\n} from \"lucide-react\";\nimport { gql } from \"@apollo/client\";\nimport { useMutation } from \"@apollo/client/react\";\nimport { useCopyToClipboard } from \"@burdenoff/fe-libs/shared/hooks\";\nimport { useHeadshotmarketingBootstrap } from \"../../hooks/useHeadshotmarketingBootstrap\";\nimport { PageLayout, EmptyState, QueryStateBoundary } from \"../../components\";\nimport {\n PagePurpose,\n GlassCard,\n Textarea,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"@burdenoff/fe-libs/ui\";\nimport { useHeadshotMarketing } from \"../../context/HeadshotMarketingContext\";\nimport { cn, formatNumber, formatDate } from \"../../utils/helpers\";\nimport {\n HeadshotmarketingAiToolCategory as AiToolCategory,\n HeadshotmarketingContentItemType as ContentItemType,\n} from \"../../../generated/wspace-types\";\nimport {\n useHeadshotmarketingCreateContentItemMutation,\n type HeadshotmarketingBootstrapDataQuery,\n} from \"../../../generated/wspace-operations\";\nimport { AIExecutionLedger } from \"./AIExecutionLedger\";\nimport { ContentSubNav } from \"./ContentSubNav\";\nimport { toResultStrings } from \"../../utils/aiToolOutput\";\n\nconst EXECUTE_AI_TOOL = gql`\n mutation HeadshotmarketingExecuteAITool(\n $input: HeadshotmarketingExecuteAIToolInput!\n ) {\n headshotmarketingExecuteAITool(input: $input) {\n id\n toolId\n status\n output\n errorMessage\n tokensUsed\n durationMs\n createdAt\n }\n }\n`;\n\ninterface ExecuteAIToolVars {\n input: {\n toolId: string;\n input: Record<string, unknown>;\n metadata?: Record<string, unknown> | null;\n };\n}\n\ninterface ExecuteAIToolResult {\n headshotmarketingExecuteAITool: {\n id: string;\n toolId: string;\n status: string;\n output: Record<string, unknown> | null;\n errorMessage: string | null;\n tokensUsed: number | null;\n durationMs: number | null;\n createdAt: string;\n };\n}\n\ntype RawAITool =\n HeadshotmarketingBootstrapDataQuery[\"headshotmarketingAITools\"][\"items\"][number];\ntype RawExecution =\n HeadshotmarketingBootstrapDataQuery[\"headshotmarketingAIToolExecutions\"][\"items\"][number];\n\n/** Lucide icon component shape (all icons share this signature). */\ntype ToolIcon = typeof Sparkles;\n\n/** A tool prepared for display: real fields + derived icon/type/usage. */\ninterface AIToolView {\n id: string;\n name: string;\n description: string;\n category: AiToolCategory;\n provider: string;\n model: string | null;\n isAvailable: boolean;\n icon: ToolIcon;\n inputType: \"text\" | \"url\";\n contentType: ContentItemType;\n monthlyUses: number;\n}\n\nconst CATEGORY_ICON: Record<AiToolCategory, ToolIcon> = {\n [AiToolCategory.ContentGeneration]: PenTool,\n [AiToolCategory.Copywriting]: Megaphone,\n [AiToolCategory.ImageGeneration]: ImageIcon,\n [AiToolCategory.SeoOptimization]: Search,\n [AiToolCategory.Summarization]: ScanText,\n [AiToolCategory.Translation]: Languages,\n [AiToolCategory.VideoGeneration]: Video,\n [AiToolCategory.Other]: Sparkles,\n};\n\nconst CATEGORY_LABEL: Record<AiToolCategory, string> = {\n [AiToolCategory.ContentGeneration]: \"Content\",\n [AiToolCategory.Copywriting]: \"Copywriting\",\n [AiToolCategory.ImageGeneration]: \"Image\",\n [AiToolCategory.SeoOptimization]: \"SEO\",\n [AiToolCategory.Summarization]: \"Summarize\",\n [AiToolCategory.Translation]: \"Translation\",\n [AiToolCategory.VideoGeneration]: \"Video\",\n [AiToolCategory.Other]: \"AI\",\n};\n\n/** Pick a distinct icon from the tool name first, then fall back to category. */\nfunction pickIcon(name: string, category: AiToolCategory): ToolIcon {\n const n = name.toLowerCase();\n if (n.includes(\"blog\")) return PenTool;\n if (n.includes(\"subject line\") || n.includes(\"email\")) return Mail;\n if (n.includes(\"caption\") || n.includes(\"social\")) return MessageSquare;\n if (n.includes(\"ad copy\") || n.includes(\"ad \") || n.includes(\"advert\"))\n return Megaphone;\n if (n.includes(\"seo\") || n.includes(\"meta\") || n.includes(\"keyword\"))\n return Search;\n if (n.includes(\"alt\") || n.includes(\"image\") || n.includes(\"photo\"))\n return ImageIcon;\n if (n.includes(\"repurpose\") || n.includes(\"remix\")) return GitBranch;\n if (n.includes(\"voice\") || n.includes(\"tone\")) return Mic;\n if (n.includes(\"translat\")) return Languages;\n if (n.includes(\"summar\")) return ScanText;\n if (n.includes(\"video\") || n.includes(\"script\")) return Video;\n return CATEGORY_ICON[category] ?? Sparkles;\n}\n\n/** Map a tool to the most fitting draft content type for \"Save as draft\". */\nfunction pickContentType(\n name: string,\n category: AiToolCategory,\n): ContentItemType {\n const n = name.toLowerCase();\n if (n.includes(\"blog\")) return ContentItemType.BlogPost;\n if (n.includes(\"caption\") || n.includes(\"social\"))\n return ContentItemType.SocialPost;\n if (n.includes(\"email\") || n.includes(\"subject line\"))\n return ContentItemType.Email;\n if (n.includes(\"ad\")) return ContentItemType.AdCopy;\n if (n.includes(\"video\") || n.includes(\"script\"))\n return ContentItemType.VideoScript;\n switch (category) {\n case AiToolCategory.ContentGeneration:\n return ContentItemType.BlogPost;\n case AiToolCategory.Copywriting:\n return ContentItemType.AdCopy;\n case AiToolCategory.VideoGeneration:\n return ContentItemType.VideoScript;\n default:\n return ContentItemType.Other;\n }\n}\n\n/** Build a short draft title from generated text, falling back to the tool. */\nfunction deriveTitle(text: string, toolName: string): string {\n const firstLine =\n text\n .split(\"\\n\")\n .find((l) => l.trim())\n ?.trim() ?? \"\";\n const clipped =\n firstLine.length > 64 ? `${firstLine.slice(0, 61)}…` : firstLine;\n return clipped || `${toolName} draft`;\n}\n\nexport const AIToolsPage: FC = () => {\n const { data, loading, error, refetch } = useHeadshotmarketingBootstrap();\n const { navigate, basePath } = useHeadshotMarketing();\n const { copy } = useCopyToClipboard();\n const [executeTool, { loading: generating }] = useMutation<\n ExecuteAIToolResult,\n ExecuteAIToolVars\n >(EXECUTE_AI_TOOL);\n const [createContentItem] = useHeadshotmarketingCreateContentItemMutation();\n\n const [activeTool, setActiveTool] = useState<string | null>(null);\n const [input, setInput] = useState(\"\");\n const [selectedModel, setSelectedModel] = useState(\"\");\n const [results, setResults] = useState<string[]>([]);\n const [lastMeta, setLastMeta] = useState<{\n tokensUsed: number | null;\n durationMs: number | null;\n } | null>(null);\n const [executeError, setExecuteError] = useState<string | null>(null);\n const [copiedKey, setCopiedKey] = useState<string | null>(null);\n const [insertBusyKey, setInsertBusyKey] = useState<string | null>(null);\n const [insertedKeys, setInsertedKeys] = useState<Set<string>>(new Set());\n const [insertError, setInsertError] = useState<string | null>(null);\n\n const rawTools: RawAITool[] = useMemo(\n () => data?.headshotmarketingAITools.items ?? [],\n [data],\n );\n const executions: RawExecution[] = useMemo(\n () => data?.headshotmarketingAIToolExecutions.items ?? [],\n [data],\n );\n\n // Per-tool usage scoped to the current calendar month, derived from the real\n // executions feed (rather than lifetime usageCount) to match \"N uses this\n // month\". NOTE: the bootstrap caps recent executions, so this reflects recent\n // activity — an exact monthlyUsage field is deferred to the backend.\n const monthStart = useMemo(() => {\n const now = new Date();\n return new Date(now.getFullYear(), now.getMonth(), 1).getTime();\n }, []);\n\n const usesThisMonth = useMemo(() => {\n const counts = new Map<string, number>();\n for (const exec of executions) {\n if (new Date(exec.createdAt).getTime() >= monthStart) {\n counts.set(exec.toolId, (counts.get(exec.toolId) ?? 0) + 1);\n }\n }\n return counts;\n }, [executions, monthStart]);\n\n const tokensThisMonth = useMemo(() => {\n let total = 0;\n for (const exec of executions) {\n if (new Date(exec.createdAt).getTime() >= monthStart) {\n total += exec.tokensUsed ?? 0;\n }\n }\n return total;\n }, [executions, monthStart]);\n\n const generationsThisMonth = useMemo(\n () =>\n executions.filter((e) => new Date(e.createdAt).getTime() >= monthStart)\n .length,\n [executions, monthStart],\n );\n\n // Distinct real model names per provider — the model <select> options.\n const modelsByProvider = useMemo(() => {\n const map = new Map<string, Set<string>>();\n for (const t of rawTools) {\n if (!t.model) continue;\n const set = map.get(t.provider) ?? new Set<string>();\n set.add(t.model);\n map.set(t.provider, set);\n }\n return map;\n }, [rawTools]);\n\n const tools: AIToolView[] = useMemo(\n () =>\n rawTools.map((t) => ({\n id: t.id,\n name: t.name,\n description: t.description ?? \"\",\n category: t.category,\n provider: t.provider,\n model: t.model ?? null,\n isAvailable: t.isEnabled,\n icon: pickIcon(t.name, t.category),\n inputType:\n t.category === AiToolCategory.SeoOptimization ? \"url\" : \"text\",\n contentType: pickContentType(t.name, t.category),\n monthlyUses: usesThisMonth.get(t.id) ?? 0,\n })),\n [rawTools, usesThisMonth],\n );\n\n const toolNameById = useMemo(\n () => new Map(tools.map((t) => [t.id, t] as const)),\n [tools],\n );\n\n const selectedTool = tools.find((t) => t.id === activeTool);\n const availableCount = tools.filter((t) => t.isAvailable).length;\n\n // Auto-select the first available tool so the console is immediately usable.\n useEffect(() => {\n if (!activeTool && tools.length > 0) {\n const first = tools.find((t) => t.isAvailable) ?? tools[0];\n setActiveTool(first.id);\n }\n }, [activeTool, tools]);\n\n const modelOptions = useMemo(() => {\n if (!selectedTool) return [] as string[];\n const set = new Set(modelsByProvider.get(selectedTool.provider) ?? []);\n if (selectedTool.model) set.add(selectedTool.model);\n return Array.from(set);\n }, [selectedTool, modelsByProvider]);\n\n const effectiveModel =\n selectedModel || selectedTool?.model || modelOptions[0] || \"\";\n\n const selectTool = (id: string): void => {\n setActiveTool(id);\n setResults([]);\n setLastMeta(null);\n setExecuteError(null);\n setInsertError(null);\n setInput(\"\");\n setSelectedModel(\"\");\n setInsertedKeys(new Set());\n };\n\n const handleGenerate = async (): Promise<void> => {\n if (!input.trim() || !selectedTool || !selectedTool.isAvailable) return;\n setExecuteError(null);\n setInsertError(null);\n setInsertedKeys(new Set());\n try {\n const res = await executeTool({\n variables: {\n input: {\n toolId: selectedTool.id,\n input: { prompt: input.trim() },\n metadata: effectiveModel\n ? { model: effectiveModel, provider: selectedTool.provider }\n : { provider: selectedTool.provider },\n },\n },\n });\n const execution = res.data?.headshotmarketingExecuteAITool;\n if (!execution) {\n throw new Error(\"No response from the tool.\");\n }\n if (execution.status === \"FAILED\") {\n setResults([]);\n setLastMeta(null);\n setExecuteError(\n execution.errorMessage ??\n \"The tool failed to generate a result. Please try again.\",\n );\n } else {\n setResults(toResultStrings(execution.output));\n setLastMeta({\n tokensUsed: execution.tokensUsed,\n durationMs: execution.durationMs,\n });\n }\n await refetch();\n } catch (err) {\n setExecuteError(\n err instanceof Error ? err.message : \"Generation failed.\",\n );\n }\n };\n\n const handleCopy = async (key: string, text: string): Promise<void> => {\n await copy(text);\n setCopiedKey(key);\n window.setTimeout(() => setCopiedKey((k) => (k === key ? null : k)), 1500);\n };\n\n const handleInsert = async (\n key: string,\n text: string,\n tool?: AIToolView,\n ): Promise<void> => {\n if (!text.trim()) return;\n setInsertError(null);\n setInsertBusyKey(key);\n try {\n await createContentItem({\n variables: {\n input: {\n title: deriveTitle(text, tool?.name ?? \"AI\"),\n body: text,\n summary: text.replace(/\\s+/g, \" \").trim().slice(0, 180),\n type: tool\n ? pickContentType(tool.name, tool.category)\n : ContentItemType.Other,\n tags: [\"ai-generated\"],\n metadata: {\n source: \"ai-tools\",\n toolId: tool?.id ?? null,\n provider: tool?.provider ?? null,\n model: effectiveModel || tool?.model || null,\n },\n },\n },\n });\n setInsertedKeys((prev) => new Set(prev).add(key));\n void refetch();\n } catch (err) {\n setInsertError(\n err instanceof Error ? err.message : \"Could not save draft.\",\n );\n } finally {\n setInsertBusyKey(null);\n }\n };\n\n const combined = results.join(\"\\n\\n\");\n\n const stats: Array<{ label: string; value: string; icon: ToolIcon }> = [\n { label: \"Available tools\", value: String(availableCount), icon: Wand2 },\n {\n label: \"Generations this month\",\n value: formatNumber(generationsThisMonth),\n icon: Sparkles,\n },\n {\n label: \"Tokens this month\",\n value: formatNumber(tokensThisMonth),\n icon: Zap,\n },\n ];\n\n return (\n <PageLayout\n title=\"AI Tools\"\n description=\"AI-powered marketing content and optimization tools\"\n >\n <PagePurpose>\n Let AI do the heavy lifting on content. Generate copy, headlines and\n ideas, rewrite or optimize what you have, and turn a rough brief into a\n polished draft in seconds — then save it straight to your content\n library to refine it in your brand voice.\n </PagePurpose>\n\n <ContentSubNav\n active=\"ai-tools\"\n basePath={basePath}\n navigate={navigate}\n />\n\n <QueryStateBoundary\n loading={loading}\n error={error}\n onRetry={() => void refetch()}\n hasData={Boolean(data)}\n >\n {tools.length === 0 ? (\n <EmptyState\n illustration=\"empty-generic\"\n title=\"No AI tools available\"\n description=\"AI tools will appear here once they're enabled for your workspace.\"\n />\n ) : (\n <>\n {/* At-a-glance activity — all derived from real executions */}\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-3\">\n {stats.map((s) => {\n const StatIcon = s.icon;\n return (\n <GlassCard\n key={s.label}\n treatment=\"metric\"\n className=\"flex items-center gap-3 p-4\"\n >\n <span className=\"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-action-primary-bg/10 text-primary\">\n <StatIcon className=\"h-5 w-5\" />\n </span>\n <span className=\"min-w-0\">\n <span className=\"block text-xl font-bold leading-none text-text-primary\">\n {s.value}\n </span>\n <span className=\"mt-1 block truncate text-xs text-text-secondary\">\n {s.label}\n </span>\n </span>\n </GlassCard>\n );\n })}\n </div>\n\n {/* Two-pane console: tool grid + recent (left), generation (right) */}\n <div className=\"grid grid-cols-1 gap-6 lg:grid-cols-[1fr_minmax(340px,380px)] xl:grid-cols-[1fr_400px]\">\n {/* LEFT COLUMN */}\n <div className=\"min-w-0 space-y-6\">\n <section>\n <h3 className=\"mb-3 text-sm font-semibold text-text-primary\">\n Choose a tool\n </h3>\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-3\">\n {tools.map((tool) => {\n const Icon = tool.icon;\n const isActive = activeTool === tool.id;\n return (\n <button\n key={tool.id}\n type=\"button\"\n onClick={() => selectTool(tool.id)}\n disabled={!tool.isAvailable}\n aria-pressed={isActive}\n className={cn(\n \"group relative flex min-h-[44px] flex-col items-start rounded-card border p-4 text-left transition-[box-shadow,border-color,background-color] duration-200\",\n isActive\n ? \"border-primary bg-accent-wash shadow-elevation-2\"\n : tool.isAvailable\n ? \"border-border-subtle bg-bg-surface hover:border-border-strong hover:shadow-elevation-2\"\n : \"cursor-not-allowed border-border-subtle bg-bg-sunken opacity-60\",\n )}\n >\n <Sparkles\n className={cn(\n \"absolute right-3 top-3 h-4 w-4 transition-opacity\",\n isActive\n ? \"text-primary opacity-90\"\n : \"text-primary opacity-30 group-hover:opacity-60\",\n )}\n />\n <span\n className={cn(\n \"flex h-10 w-10 items-center justify-center rounded-lg transition-colors\",\n isActive\n ? \"bg-action-primary-bg text-action-primary-text\"\n : \"bg-action-primary-bg/10 text-primary\",\n )}\n >\n <Icon className=\"h-5 w-5\" />\n </span>\n <h4 className=\"mt-3 pr-5 text-sm font-semibold text-text-primary\">\n {tool.name}\n </h4>\n {tool.description && (\n <p className=\"mt-1 line-clamp-2 text-xs text-text-secondary\">\n {tool.description}\n </p>\n )}\n <div className=\"mt-3 flex w-full items-center justify-between gap-2 text-xs\">\n <span className=\"rounded-full bg-bg-sunken px-2 py-0.5 font-medium text-text-secondary\">\n {CATEGORY_LABEL[tool.category]}\n </span>\n {tool.isAvailable ? (\n <span className=\"text-text-secondary\">\n {tool.monthlyUses}{\" \"}\n {tool.monthlyUses === 1 ? \"use\" : \"uses\"} this\n month\n </span>\n ) : (\n <span className=\"font-medium text-status-warning-text\">\n Coming soon\n </span>\n )}\n </div>\n </button>\n );\n })}\n </div>\n </section>\n\n {/* Recent Generations — real executions from the workspace */}\n <section>\n <h3 className=\"mb-3 text-sm font-semibold text-text-primary\">\n Recent generations\n </h3>\n {executions.length === 0 ? (\n <EmptyState\n illustration=\"empty-generic\"\n title=\"No generations yet\"\n description=\"Run a tool and your recent AI generations will show up here.\"\n />\n ) : (\n <div className=\"space-y-3\">\n {executions.map((gen) => {\n const tool = toolNameById.get(gen.toolId);\n const inputText = toResultStrings(gen.input)[0] ?? \"—\";\n const outputText =\n toResultStrings(gen.output)[0] ?? \"—\";\n const GenIcon = tool?.icon ?? Sparkles;\n const key = `gen-${gen.id}`;\n const inserted = insertedKeys.has(key);\n return (\n <div\n key={gen.id}\n className=\"rounded-card border border-border-seam bg-gloss-card p-4 shadow-pop\"\n >\n <div className=\"mb-2 flex items-center justify-between gap-2\">\n <div className=\"flex min-w-0 items-center gap-2\">\n <GenIcon className=\"h-3.5 w-3.5 shrink-0 text-primary\" />\n <span className=\"truncate text-xs font-medium text-text-primary\">\n {tool?.name ?? \"AI Tool\"}\n </span>\n </div>\n <div className=\"flex shrink-0 items-center gap-1 text-xs text-text-secondary\">\n <Clock className=\"h-3 w-3\" />\n <span>\n {formatDate(gen.createdAt, \"relative\")}\n </span>\n </div>\n </div>\n <p className=\"line-clamp-1 text-xs text-text-secondary\">\n Prompt: {inputText}\n </p>\n <p className=\"mt-1 line-clamp-3 whitespace-pre-wrap text-sm text-text-primary\">\n {outputText}\n </p>\n {outputText !== \"—\" && (\n <div className=\"mt-2 flex items-center gap-3\">\n <button\n type=\"button\"\n onClick={() =>\n void handleCopy(key, outputText)\n }\n className=\"inline-flex items-center gap-1 text-xs font-medium text-primary hover:underline\"\n >\n {copiedKey === key ? (\n <>\n <Check className=\"h-3 w-3\" /> Copied\n </>\n ) : (\n <>\n <Copy className=\"h-3 w-3\" /> Copy\n </>\n )}\n </button>\n <button\n type=\"button\"\n onClick={() =>\n void handleInsert(key, outputText, tool)\n }\n disabled={insertBusyKey === key || inserted}\n className=\"inline-flex items-center gap-1 text-xs font-medium text-primary hover:underline disabled:opacity-60\"\n >\n {insertBusyKey === key ? (\n <>\n <Loader2 className=\"h-3 w-3 animate-spin\" />{\" \"}\n Saving\n </>\n ) : inserted ? (\n <>\n <Check className=\"h-3 w-3\" /> Saved\n </>\n ) : (\n <>\n <FilePlus2 className=\"h-3 w-3\" /> Save as\n draft\n </>\n )}\n </button>\n </div>\n )}\n </div>\n );\n })}\n </div>\n )}\n </section>\n </div>\n\n {/* RIGHT COLUMN — docked generation console */}\n <div className=\"lg:sticky lg:top-4 lg:self-start\">\n <GlassCard treatment=\"glass\" glow className=\"p-5\">\n <div className=\"mb-4 flex items-center gap-2\">\n <span className=\"flex h-8 w-8 items-center justify-center rounded-lg bg-action-primary-bg/10 text-primary\">\n <Wand2 className=\"h-4 w-4\" />\n </span>\n <div className=\"min-w-0\">\n <h3 className=\"truncate text-sm font-semibold text-text-primary\">\n {selectedTool ? selectedTool.name : \"AI Console\"}\n </h3>\n {selectedTool && (\n <p className=\"truncate text-xs text-text-secondary\">\n {selectedTool.provider}\n </p>\n )}\n </div>\n </div>\n\n {/* Prompt */}\n <label className=\"mb-1.5 block text-xs font-medium text-text-secondary\">\n {selectedTool?.inputType === \"url\"\n ? \"Page URL\"\n : \"Your prompt\"}\n </label>\n <Textarea\n value={input}\n onChange={(e) => setInput(e.target.value)}\n disabled={!selectedTool?.isAvailable}\n placeholder={\n selectedTool?.inputType === \"url\"\n ? \"https://your-website.com/page\"\n : \"Describe what you want to generate… (Enter to generate, Shift+Enter for a new line)\"\n }\n rows={4}\n className=\"min-h-[112px] resize-y\"\n onKeyDown={(e) => {\n if (e.key === \"Enter\" && !e.shiftKey) {\n e.preventDefault();\n void handleGenerate();\n }\n }}\n />\n\n {/* Model + Generate */}\n <div className=\"mt-3 flex flex-col gap-2 sm:flex-row\">\n {modelOptions.length > 0 ? (\n <Select\n value={effectiveModel}\n onValueChange={setSelectedModel}\n disabled={!selectedTool?.isAvailable}\n >\n <SelectTrigger\n aria-label=\"Model\"\n className=\"h-11 flex-1\"\n >\n <span className=\"flex items-center gap-2 truncate\">\n <Cpu className=\"h-4 w-4 shrink-0 text-text-muted\" />\n <SelectValue placeholder=\"Model\" />\n </span>\n </SelectTrigger>\n <SelectContent>\n {modelOptions.map((m) => (\n <SelectItem key={m} value={m}>\n {m}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n ) : (\n <div className=\"flex h-11 flex-1 items-center gap-2 rounded-input border border-border-default bg-bg-surface px-3 text-sm text-text-secondary\">\n <Cpu className=\"h-4 w-4 text-text-muted\" />\n <span className=\"truncate\">\n {selectedTool?.provider ?? \"Default model\"}\n </span>\n </div>\n )}\n <button\n type=\"button\"\n onClick={() => void handleGenerate()}\n disabled={\n generating ||\n !input.trim() ||\n !selectedTool?.isAvailable\n }\n className={cn(\n \"inline-flex min-h-[44px] items-center justify-center gap-2 rounded-md px-5 text-sm font-semibold transition-colors sm:min-w-[132px]\",\n generating ||\n !input.trim() ||\n !selectedTool?.isAvailable\n ? \"cursor-not-allowed bg-bg-sunken text-text-secondary\"\n : \"bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90\",\n )}\n >\n {generating ? (\n <>\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n Generating…\n </>\n ) : (\n <>\n <Send className=\"h-4 w-4\" />\n Generate\n </>\n )}\n </button>\n </div>\n\n {executeError && (\n <div\n role=\"alert\"\n className=\"mt-3 rounded-md border border-status-error-border/30 bg-status-error-bg/10 px-3 py-2 text-sm text-status-error-text\"\n >\n {executeError}\n </div>\n )}\n\n {/* Output */}\n <div className=\"mt-4 overflow-hidden rounded-card border border-border-seam bg-bg-surface\">\n <div className=\"flex items-center justify-between border-b border-border-subtle px-3 py-2\">\n <span className=\"text-xs font-semibold uppercase tracking-wide text-text-secondary\">\n Generated\n </span>\n <div className=\"flex items-center gap-1\">\n <button\n type=\"button\"\n onClick={() => void handleCopy(\"out-all\", combined)}\n disabled={results.length === 0}\n className=\"inline-flex min-h-[32px] items-center gap-1 rounded px-2 text-xs font-medium text-primary transition-colors hover:bg-bg-sunken disabled:opacity-40\"\n >\n {copiedKey === \"out-all\" ? (\n <>\n <Check className=\"h-3.5 w-3.5\" /> Copied\n </>\n ) : (\n <>\n <Copy className=\"h-3.5 w-3.5\" /> Copy\n </>\n )}\n </button>\n <button\n type=\"button\"\n onClick={() =>\n void handleInsert(\"out-all\", combined, selectedTool)\n }\n disabled={\n results.length === 0 ||\n insertBusyKey === \"out-all\" ||\n insertedKeys.has(\"out-all\")\n }\n className=\"inline-flex min-h-[32px] items-center gap-1 rounded px-2 text-xs font-medium text-primary transition-colors hover:bg-bg-sunken disabled:opacity-40\"\n >\n {insertBusyKey === \"out-all\" ? (\n <>\n <Loader2 className=\"h-3.5 w-3.5 animate-spin\" />{\" \"}\n Saving\n </>\n ) : insertedKeys.has(\"out-all\") ? (\n <>\n <Check className=\"h-3.5 w-3.5\" /> Saved\n </>\n ) : (\n <>\n <FilePlus2 className=\"h-3.5 w-3.5\" /> Insert\n </>\n )}\n </button>\n </div>\n </div>\n <div className=\"max-h-[340px] min-h-[148px] overflow-y-auto p-3\">\n {generating ? (\n <div className=\"flex h-[124px] flex-col items-center justify-center gap-2 text-text-secondary\">\n <Loader2 className=\"h-5 w-5 animate-spin\" />\n <span className=\"text-xs\">\n Generating your content…\n </span>\n </div>\n ) : results.length === 0 ? (\n <div className=\"flex h-[124px] flex-col items-center justify-center gap-2 text-center text-text-secondary\">\n <Sparkles className=\"h-5 w-5 opacity-60\" />\n <span className=\"text-xs\">\n Your generated content will appear here.\n </span>\n </div>\n ) : (\n <div className=\"space-y-3\">\n {results.map((result, idx) => {\n const key = `out-${idx}`;\n return (\n <div\n key={key}\n className={cn(\n results.length > 1 &&\n \"rounded-md border border-border-subtle bg-bg-sunken p-3\",\n )}\n >\n {results.length > 1 && (\n <div className=\"mb-1.5 flex items-center justify-between\">\n <span className=\"text-xs font-medium text-text-secondary\">\n Variation {idx + 1}\n </span>\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={() =>\n void handleCopy(key, result)\n }\n className=\"text-xs font-medium text-primary hover:underline\"\n >\n {copiedKey === key ? \"Copied\" : \"Copy\"}\n </button>\n <button\n type=\"button\"\n onClick={() =>\n void handleInsert(\n key,\n result,\n selectedTool,\n )\n }\n disabled={\n insertBusyKey === key ||\n insertedKeys.has(key)\n }\n className=\"text-xs font-medium text-primary hover:underline disabled:opacity-60\"\n >\n {insertBusyKey === key\n ? \"Saving\"\n : insertedKeys.has(key)\n ? \"Saved\"\n : \"Insert\"}\n </button>\n </div>\n </div>\n )}\n <p className=\"whitespace-pre-wrap text-sm text-text-primary\">\n {result}\n </p>\n </div>\n );\n })}\n </div>\n )}\n </div>\n {(lastMeta || insertError) && (\n <div className=\"flex items-center justify-between gap-2 border-t border-border-subtle px-3 py-2 text-xs\">\n {lastMeta ? (\n <span className=\"flex items-center gap-3 text-text-secondary\">\n {lastMeta.durationMs != null && (\n <span className=\"flex items-center gap-1\">\n <Clock className=\"h-3 w-3\" />\n {(lastMeta.durationMs / 1000).toFixed(1)}s\n </span>\n )}\n {lastMeta.tokensUsed != null && (\n <span className=\"flex items-center gap-1\">\n <Zap className=\"h-3 w-3\" />\n {formatNumber(lastMeta.tokensUsed)} tokens\n </span>\n )}\n </span>\n ) : (\n <span />\n )}\n {insertError && (\n <span className=\"text-status-error-text\">\n {insertError}\n </span>\n )}\n </div>\n )}\n </div>\n\n {insertedKeys.size > 0 && (\n <button\n type=\"button\"\n onClick={() => navigate(basePath + \"/content\")}\n className=\"mt-3 inline-flex items-center gap-1 text-xs font-medium text-primary hover:underline\"\n >\n <FilePlus2 className=\"h-3.5 w-3.5\" />\n View saved drafts in Content\n </button>\n )}\n </GlassCard>\n </div>\n </div>\n\n {/* Per-run accounting for every execution the work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OACR,CAAA,CACF;;KAGN,kBAAC,IAAD;MAA+B;MAAY,OAAO;MAAY,CAAA;KAC7D,EAAA,CAAA;IAEc,CAAA;GACV"}
|
|
1
|
+
{"version":3,"file":"AIToolsPage.js","names":[],"sources":["../../../../src/headshotmarketing/pages/content/AIToolsPage.tsx"],"sourcesContent":["/**\n * AI Tools Page\n *\n * A two-pane AI content console: a grid of real, workspace-scoped AI tools on the\n * left and a docked generation panel (prompt + model + streamed output with\n * Copy / Save-as-draft) on the right. All data is real Apollo data from the\n * shared bootstrap — tool catalog, per-tool monthly usage (derived from real\n * executions), and the executions feed. Generation persists a real\n * `AIToolExecution`; \"Save as draft\" persists a real `ContentItem`. The\n * execution ledger below the console accounts for every run (status, tokens,\n * duration, cost) straight off those persisted execution records.\n *\n * @module headshotmarketing/pages/content\n */\n\nimport { useEffect, useMemo, useState, type FC } from \"react\";\nimport {\n Sparkles,\n PenTool,\n Image as ImageIcon,\n Search,\n GitBranch,\n Mic,\n Send,\n Clock,\n Loader2,\n Megaphone,\n MessageSquare,\n Mail,\n Languages,\n Video,\n ScanText,\n Copy,\n FilePlus2,\n Check,\n Wand2,\n Cpu,\n Zap,\n} from \"lucide-react\";\nimport { gql } from \"@apollo/client\";\nimport { useMutation } from \"@apollo/client/react\";\nimport { useCopyToClipboard } from \"@burdenoff/fe-libs/shared/hooks\";\nimport { useHeadshotmarketingBootstrap } from \"../../hooks/useHeadshotmarketingBootstrap\";\nimport { PageLayout, EmptyState, QueryStateBoundary } from \"../../components\";\nimport {\n PagePurpose,\n GlassCard,\n Textarea,\n Select,\n SelectContent,\n SelectItem,\n SelectTrigger,\n SelectValue,\n} from \"@burdenoff/fe-libs/ui\";\nimport { useHeadshotMarketing } from \"../../context/HeadshotMarketingContext\";\nimport { cn, formatNumber, formatDate } from \"../../utils/helpers\";\nimport {\n HeadshotmarketingAiToolCategory as AiToolCategory,\n HeadshotmarketingContentItemType as ContentItemType,\n} from \"../../../generated/wspace-types\";\nimport {\n useHeadshotmarketingCreateContentItemMutation,\n type HeadshotmarketingBootstrapDataQuery,\n} from \"../../../generated/wspace-operations\";\nimport { AIExecutionLedger } from \"./AIExecutionLedger\";\nimport { ContentSubNav } from \"./ContentSubNav\";\nimport { toResultStrings } from \"../../utils/aiToolOutput\";\n\nconst EXECUTE_AI_TOOL = gql`\n mutation HeadshotmarketingExecuteAITool(\n $input: HeadshotmarketingExecuteAIToolInput!\n ) {\n headshotmarketingExecuteAITool(input: $input) {\n id\n toolId\n status\n output\n errorMessage\n tokensUsed\n durationMs\n createdAt\n }\n }\n`;\n\ninterface ExecuteAIToolVars {\n input: {\n toolId: string;\n input: Record<string, unknown>;\n metadata?: Record<string, unknown> | null;\n };\n}\n\ninterface ExecuteAIToolResult {\n headshotmarketingExecuteAITool: {\n id: string;\n toolId: string;\n status: string;\n output: Record<string, unknown> | null;\n errorMessage: string | null;\n tokensUsed: number | null;\n durationMs: number | null;\n createdAt: string;\n };\n}\n\ntype RawAITool =\n HeadshotmarketingBootstrapDataQuery[\"headshotmarketingAITools\"][\"items\"][number];\ntype RawExecution =\n HeadshotmarketingBootstrapDataQuery[\"headshotmarketingAIToolExecutions\"][\"items\"][number];\n\n/** Lucide icon component shape (all icons share this signature). */\ntype ToolIcon = typeof Sparkles;\n\n/** A tool prepared for display: real fields + derived icon/type/usage. */\ninterface AIToolView {\n id: string;\n name: string;\n description: string;\n category: AiToolCategory;\n provider: string;\n model: string | null;\n isAvailable: boolean;\n icon: ToolIcon;\n inputType: \"text\" | \"url\";\n contentType: ContentItemType;\n monthlyUses: number;\n}\n\nconst CATEGORY_ICON: Record<AiToolCategory, ToolIcon> = {\n [AiToolCategory.ContentGeneration]: PenTool,\n [AiToolCategory.Copywriting]: Megaphone,\n [AiToolCategory.ImageGeneration]: ImageIcon,\n [AiToolCategory.SeoOptimization]: Search,\n [AiToolCategory.Summarization]: ScanText,\n [AiToolCategory.Translation]: Languages,\n [AiToolCategory.VideoGeneration]: Video,\n [AiToolCategory.Other]: Sparkles,\n};\n\nconst CATEGORY_LABEL: Record<AiToolCategory, string> = {\n [AiToolCategory.ContentGeneration]: \"Content\",\n [AiToolCategory.Copywriting]: \"Copywriting\",\n [AiToolCategory.ImageGeneration]: \"Image\",\n [AiToolCategory.SeoOptimization]: \"SEO\",\n [AiToolCategory.Summarization]: \"Summarize\",\n [AiToolCategory.Translation]: \"Translation\",\n [AiToolCategory.VideoGeneration]: \"Video\",\n [AiToolCategory.Other]: \"AI\",\n};\n\n/** Pick a distinct icon from the tool name first, then fall back to category. */\nfunction pickIcon(name: string, category: AiToolCategory): ToolIcon {\n const n = name.toLowerCase();\n if (n.includes(\"blog\")) return PenTool;\n if (n.includes(\"subject line\") || n.includes(\"email\")) return Mail;\n if (n.includes(\"caption\") || n.includes(\"social\")) return MessageSquare;\n if (n.includes(\"ad copy\") || n.includes(\"ad \") || n.includes(\"advert\"))\n return Megaphone;\n if (n.includes(\"seo\") || n.includes(\"meta\") || n.includes(\"keyword\"))\n return Search;\n if (n.includes(\"alt\") || n.includes(\"image\") || n.includes(\"photo\"))\n return ImageIcon;\n if (n.includes(\"repurpose\") || n.includes(\"remix\")) return GitBranch;\n if (n.includes(\"voice\") || n.includes(\"tone\")) return Mic;\n if (n.includes(\"translat\")) return Languages;\n if (n.includes(\"summar\")) return ScanText;\n if (n.includes(\"video\") || n.includes(\"script\")) return Video;\n return CATEGORY_ICON[category] ?? Sparkles;\n}\n\n/** Map a tool to the most fitting draft content type for \"Save as draft\". */\nfunction pickContentType(\n name: string,\n category: AiToolCategory,\n): ContentItemType {\n const n = name.toLowerCase();\n if (n.includes(\"blog\")) return ContentItemType.BlogPost;\n if (n.includes(\"caption\") || n.includes(\"social\"))\n return ContentItemType.SocialPost;\n if (n.includes(\"email\") || n.includes(\"subject line\"))\n return ContentItemType.Email;\n if (n.includes(\"ad\")) return ContentItemType.AdCopy;\n if (n.includes(\"video\") || n.includes(\"script\"))\n return ContentItemType.VideoScript;\n switch (category) {\n case AiToolCategory.ContentGeneration:\n return ContentItemType.BlogPost;\n case AiToolCategory.Copywriting:\n return ContentItemType.AdCopy;\n case AiToolCategory.VideoGeneration:\n return ContentItemType.VideoScript;\n default:\n return ContentItemType.Other;\n }\n}\n\n/** Build a short draft title from generated text, falling back to the tool. */\nfunction deriveTitle(text: string, toolName: string): string {\n const firstLine =\n text\n .split(\"\\n\")\n .find((l) => l.trim())\n ?.trim() ?? \"\";\n const clipped =\n firstLine.length > 64 ? `${firstLine.slice(0, 61)}…` : firstLine;\n return clipped || `${toolName} draft`;\n}\n\nexport const AIToolsPage: FC = () => {\n const { data, loading, error, refetch } = useHeadshotmarketingBootstrap();\n const { navigate, basePath } = useHeadshotMarketing();\n const { copy } = useCopyToClipboard();\n const [executeTool, { loading: generating }] = useMutation<\n ExecuteAIToolResult,\n ExecuteAIToolVars\n >(EXECUTE_AI_TOOL);\n const [createContentItem] = useHeadshotmarketingCreateContentItemMutation();\n\n const [activeTool, setActiveTool] = useState<string | null>(null);\n const [input, setInput] = useState(\"\");\n const [selectedModel, setSelectedModel] = useState(\"\");\n const [results, setResults] = useState<string[]>([]);\n const [lastMeta, setLastMeta] = useState<{\n tokensUsed: number | null;\n durationMs: number | null;\n } | null>(null);\n // Execution that produced the current results; drafts saved from them are\n // linked to it so the backend records their AI provenance.\n const [lastExecutionId, setLastExecutionId] = useState<string | null>(null);\n const [executeError, setExecuteError] = useState<string | null>(null);\n const [copiedKey, setCopiedKey] = useState<string | null>(null);\n const [insertBusyKey, setInsertBusyKey] = useState<string | null>(null);\n const [insertedKeys, setInsertedKeys] = useState<Set<string>>(new Set());\n const [insertError, setInsertError] = useState<string | null>(null);\n\n const rawTools: RawAITool[] = useMemo(\n () => data?.headshotmarketingAITools.items ?? [],\n [data],\n );\n const executions: RawExecution[] = useMemo(\n () => data?.headshotmarketingAIToolExecutions.items ?? [],\n [data],\n );\n\n // Per-tool usage scoped to the current calendar month, derived from the real\n // executions feed (rather than lifetime usageCount) to match \"N uses this\n // month\". NOTE: the bootstrap caps recent executions, so this reflects recent\n // activity — an exact monthlyUsage field is deferred to the backend.\n const monthStart = useMemo(() => {\n const now = new Date();\n return new Date(now.getFullYear(), now.getMonth(), 1).getTime();\n }, []);\n\n const usesThisMonth = useMemo(() => {\n const counts = new Map<string, number>();\n for (const exec of executions) {\n if (new Date(exec.createdAt).getTime() >= monthStart) {\n counts.set(exec.toolId, (counts.get(exec.toolId) ?? 0) + 1);\n }\n }\n return counts;\n }, [executions, monthStart]);\n\n const tokensThisMonth = useMemo(() => {\n let total = 0;\n for (const exec of executions) {\n if (new Date(exec.createdAt).getTime() >= monthStart) {\n total += exec.tokensUsed ?? 0;\n }\n }\n return total;\n }, [executions, monthStart]);\n\n const generationsThisMonth = useMemo(\n () =>\n executions.filter((e) => new Date(e.createdAt).getTime() >= monthStart)\n .length,\n [executions, monthStart],\n );\n\n // Distinct real model names per provider — the model <select> options.\n const modelsByProvider = useMemo(() => {\n const map = new Map<string, Set<string>>();\n for (const t of rawTools) {\n if (!t.model) continue;\n const set = map.get(t.provider) ?? new Set<string>();\n set.add(t.model);\n map.set(t.provider, set);\n }\n return map;\n }, [rawTools]);\n\n const tools: AIToolView[] = useMemo(\n () =>\n rawTools.map((t) => ({\n id: t.id,\n name: t.name,\n description: t.description ?? \"\",\n category: t.category,\n provider: t.provider,\n model: t.model ?? null,\n isAvailable: t.isEnabled,\n icon: pickIcon(t.name, t.category),\n inputType:\n t.category === AiToolCategory.SeoOptimization ? \"url\" : \"text\",\n contentType: pickContentType(t.name, t.category),\n monthlyUses: usesThisMonth.get(t.id) ?? 0,\n })),\n [rawTools, usesThisMonth],\n );\n\n const toolNameById = useMemo(\n () => new Map(tools.map((t) => [t.id, t] as const)),\n [tools],\n );\n\n const selectedTool = tools.find((t) => t.id === activeTool);\n const availableCount = tools.filter((t) => t.isAvailable).length;\n\n // Auto-select the first available tool so the console is immediately usable.\n useEffect(() => {\n if (!activeTool && tools.length > 0) {\n const first = tools.find((t) => t.isAvailable) ?? tools[0];\n setActiveTool(first.id);\n }\n }, [activeTool, tools]);\n\n const modelOptions = useMemo(() => {\n if (!selectedTool) return [] as string[];\n const set = new Set(modelsByProvider.get(selectedTool.provider) ?? []);\n if (selectedTool.model) set.add(selectedTool.model);\n return Array.from(set);\n }, [selectedTool, modelsByProvider]);\n\n const effectiveModel =\n selectedModel || selectedTool?.model || modelOptions[0] || \"\";\n\n const selectTool = (id: string): void => {\n setActiveTool(id);\n setResults([]);\n setLastExecutionId(null);\n setLastMeta(null);\n setExecuteError(null);\n setInsertError(null);\n setInput(\"\");\n setSelectedModel(\"\");\n setInsertedKeys(new Set());\n };\n\n const handleGenerate = async (): Promise<void> => {\n if (!input.trim() || !selectedTool || !selectedTool.isAvailable) return;\n setExecuteError(null);\n setInsertError(null);\n setInsertedKeys(new Set());\n try {\n const res = await executeTool({\n variables: {\n input: {\n toolId: selectedTool.id,\n input: { prompt: input.trim() },\n metadata: effectiveModel\n ? { model: effectiveModel, provider: selectedTool.provider }\n : { provider: selectedTool.provider },\n },\n },\n });\n const execution = res.data?.headshotmarketingExecuteAITool;\n if (!execution) {\n throw new Error(\"No response from the tool.\");\n }\n if (execution.status === \"FAILED\") {\n setResults([]);\n setLastExecutionId(null);\n setLastMeta(null);\n setExecuteError(\n execution.errorMessage ??\n \"The tool failed to generate a result. Please try again.\",\n );\n } else {\n setResults(toResultStrings(execution.output));\n setLastExecutionId(execution.id);\n setLastMeta({\n tokensUsed: execution.tokensUsed,\n durationMs: execution.durationMs,\n });\n }\n await refetch();\n } catch (err) {\n setExecuteError(\n err instanceof Error ? err.message : \"Generation failed.\",\n );\n }\n };\n\n const handleCopy = async (key: string, text: string): Promise<void> => {\n await copy(text);\n setCopiedKey(key);\n window.setTimeout(() => setCopiedKey((k) => (k === key ? null : k)), 1500);\n };\n\n const handleInsert = async (\n key: string,\n text: string,\n tool: AIToolView | undefined,\n executionId: string | null,\n ): Promise<void> => {\n if (!text.trim()) return;\n setInsertError(null);\n setInsertBusyKey(key);\n try {\n await createContentItem({\n variables: {\n input: {\n title: deriveTitle(text, tool?.name ?? \"AI\"),\n body: text,\n summary: text.replace(/\\s+/g, \" \").trim().slice(0, 180),\n type: tool\n ? pickContentType(tool.name, tool.category)\n : ContentItemType.Other,\n tags: [\"ai-generated\"],\n aiToolExecutionId: executionId,\n metadata: {\n source: \"ai-tools\",\n toolId: tool?.id ?? null,\n provider: tool?.provider ?? null,\n model: effectiveModel || tool?.model || null,\n },\n },\n },\n });\n setInsertedKeys((prev) => new Set(prev).add(key));\n void refetch();\n } catch (err) {\n setInsertError(\n err instanceof Error ? err.message : \"Could not save draft.\",\n );\n } finally {\n setInsertBusyKey(null);\n }\n };\n\n const combined = results.join(\"\\n\\n\");\n\n const stats: Array<{ label: string; value: string; icon: ToolIcon }> = [\n { label: \"Available tools\", value: String(availableCount), icon: Wand2 },\n {\n label: \"Generations this month\",\n value: formatNumber(generationsThisMonth),\n icon: Sparkles,\n },\n {\n label: \"Tokens this month\",\n value: formatNumber(tokensThisMonth),\n icon: Zap,\n },\n ];\n\n return (\n <PageLayout\n title=\"AI Tools\"\n description=\"AI-powered marketing content and optimization tools\"\n >\n <PagePurpose>\n Let AI do the heavy lifting on content. Generate copy, headlines and\n ideas, rewrite or optimize what you have, and turn a rough brief into a\n polished draft in seconds — then save it straight to your content\n library to refine it in your brand voice.\n </PagePurpose>\n\n <ContentSubNav\n active=\"ai-tools\"\n basePath={basePath}\n navigate={navigate}\n />\n\n <QueryStateBoundary\n loading={loading}\n error={error}\n onRetry={() => void refetch()}\n hasData={Boolean(data)}\n >\n {tools.length === 0 ? (\n <EmptyState\n illustration=\"empty-generic\"\n title=\"No AI tools available\"\n description=\"AI tools will appear here once they're enabled for your workspace.\"\n />\n ) : (\n <>\n {/* At-a-glance activity — all derived from real executions */}\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-3\">\n {stats.map((s) => {\n const StatIcon = s.icon;\n return (\n <GlassCard\n key={s.label}\n treatment=\"metric\"\n className=\"flex items-center gap-3 p-4\"\n >\n <span className=\"flex h-10 w-10 shrink-0 items-center justify-center rounded-lg bg-action-primary-bg/10 text-primary\">\n <StatIcon className=\"h-5 w-5\" />\n </span>\n <span className=\"min-w-0\">\n <span className=\"block text-xl font-bold leading-none text-text-primary\">\n {s.value}\n </span>\n <span className=\"mt-1 block truncate text-xs text-text-secondary\">\n {s.label}\n </span>\n </span>\n </GlassCard>\n );\n })}\n </div>\n\n {/* Two-pane console: tool grid + recent (left), generation (right) */}\n <div className=\"grid grid-cols-1 gap-6 lg:grid-cols-[1fr_minmax(340px,380px)] xl:grid-cols-[1fr_400px]\">\n {/* LEFT COLUMN */}\n <div className=\"min-w-0 space-y-6\">\n <section>\n <h3 className=\"mb-3 text-sm font-semibold text-text-primary\">\n Choose a tool\n </h3>\n <div className=\"grid grid-cols-1 gap-4 sm:grid-cols-2 xl:grid-cols-3\">\n {tools.map((tool) => {\n const Icon = tool.icon;\n const isActive = activeTool === tool.id;\n return (\n <button\n key={tool.id}\n type=\"button\"\n onClick={() => selectTool(tool.id)}\n disabled={!tool.isAvailable}\n aria-pressed={isActive}\n className={cn(\n \"group relative flex min-h-[44px] flex-col items-start rounded-card border p-4 text-left transition-[box-shadow,border-color,background-color] duration-200\",\n isActive\n ? \"border-primary bg-accent-wash shadow-elevation-2\"\n : tool.isAvailable\n ? \"border-border-subtle bg-bg-surface hover:border-border-strong hover:shadow-elevation-2\"\n : \"cursor-not-allowed border-border-subtle bg-bg-sunken opacity-60\",\n )}\n >\n <Sparkles\n className={cn(\n \"absolute right-3 top-3 h-4 w-4 transition-opacity\",\n isActive\n ? \"text-primary opacity-90\"\n : \"text-primary opacity-30 group-hover:opacity-60\",\n )}\n />\n <span\n className={cn(\n \"flex h-10 w-10 items-center justify-center rounded-lg transition-colors\",\n isActive\n ? \"bg-action-primary-bg text-action-primary-text\"\n : \"bg-action-primary-bg/10 text-primary\",\n )}\n >\n <Icon className=\"h-5 w-5\" />\n </span>\n <h4 className=\"mt-3 pr-5 text-sm font-semibold text-text-primary\">\n {tool.name}\n </h4>\n {tool.description && (\n <p className=\"mt-1 line-clamp-2 text-xs text-text-secondary\">\n {tool.description}\n </p>\n )}\n <div className=\"mt-3 flex w-full items-center justify-between gap-2 text-xs\">\n <span className=\"rounded-full bg-bg-sunken px-2 py-0.5 font-medium text-text-secondary\">\n {CATEGORY_LABEL[tool.category]}\n </span>\n {tool.isAvailable ? (\n <span className=\"text-text-secondary\">\n {tool.monthlyUses}{\" \"}\n {tool.monthlyUses === 1 ? \"use\" : \"uses\"} this\n month\n </span>\n ) : (\n <span className=\"font-medium text-status-warning-text\">\n Coming soon\n </span>\n )}\n </div>\n </button>\n );\n })}\n </div>\n </section>\n\n {/* Recent Generations — real executions from the workspace */}\n <section>\n <h3 className=\"mb-3 text-sm font-semibold text-text-primary\">\n Recent generations\n </h3>\n {executions.length === 0 ? (\n <EmptyState\n illustration=\"empty-generic\"\n title=\"No generations yet\"\n description=\"Run a tool and your recent AI generations will show up here.\"\n />\n ) : (\n <div className=\"space-y-3\">\n {executions.map((gen) => {\n const tool = toolNameById.get(gen.toolId);\n const inputText = toResultStrings(gen.input)[0] ?? \"—\";\n const outputText =\n toResultStrings(gen.output)[0] ?? \"—\";\n const GenIcon = tool?.icon ?? Sparkles;\n const key = `gen-${gen.id}`;\n const inserted = insertedKeys.has(key);\n return (\n <div\n key={gen.id}\n className=\"rounded-card border border-border-seam bg-gloss-card p-4 shadow-pop\"\n >\n <div className=\"mb-2 flex items-center justify-between gap-2\">\n <div className=\"flex min-w-0 items-center gap-2\">\n <GenIcon className=\"h-3.5 w-3.5 shrink-0 text-primary\" />\n <span className=\"truncate text-xs font-medium text-text-primary\">\n {tool?.name ?? \"AI Tool\"}\n </span>\n </div>\n <div className=\"flex shrink-0 items-center gap-1 text-xs text-text-secondary\">\n <Clock className=\"h-3 w-3\" />\n <span>\n {formatDate(gen.createdAt, \"relative\")}\n </span>\n </div>\n </div>\n <p className=\"line-clamp-1 text-xs text-text-secondary\">\n Prompt: {inputText}\n </p>\n <p className=\"mt-1 line-clamp-3 whitespace-pre-wrap text-sm text-text-primary\">\n {outputText}\n </p>\n {outputText !== \"—\" && (\n <div className=\"mt-2 flex items-center gap-3\">\n <button\n type=\"button\"\n onClick={() =>\n void handleCopy(key, outputText)\n }\n className=\"inline-flex items-center gap-1 text-xs font-medium text-primary hover:underline\"\n >\n {copiedKey === key ? (\n <>\n <Check className=\"h-3 w-3\" /> Copied\n </>\n ) : (\n <>\n <Copy className=\"h-3 w-3\" /> Copy\n </>\n )}\n </button>\n <button\n type=\"button\"\n onClick={() =>\n void handleInsert(\n key,\n outputText,\n tool,\n gen.id,\n )\n }\n disabled={insertBusyKey === key || inserted}\n className=\"inline-flex items-center gap-1 text-xs font-medium text-primary hover:underline disabled:opacity-60\"\n >\n {insertBusyKey === key ? (\n <>\n <Loader2 className=\"h-3 w-3 animate-spin\" />{\" \"}\n Saving\n </>\n ) : inserted ? (\n <>\n <Check className=\"h-3 w-3\" /> Saved\n </>\n ) : (\n <>\n <FilePlus2 className=\"h-3 w-3\" /> Save as\n draft\n </>\n )}\n </button>\n </div>\n )}\n </div>\n );\n })}\n </div>\n )}\n </section>\n </div>\n\n {/* RIGHT COLUMN — docked generation console */}\n <div className=\"lg:sticky lg:top-4 lg:self-start\">\n <GlassCard treatment=\"glass\" glow className=\"p-5\">\n <div className=\"mb-4 flex items-center gap-2\">\n <span className=\"flex h-8 w-8 items-center justify-center rounded-lg bg-action-primary-bg/10 text-primary\">\n <Wand2 className=\"h-4 w-4\" />\n </span>\n <div className=\"min-w-0\">\n <h3 className=\"truncate text-sm font-semibold text-text-primary\">\n {selectedTool ? selectedTool.name : \"AI Console\"}\n </h3>\n {selectedTool && (\n <p className=\"truncate text-xs text-text-secondary\">\n {selectedTool.provider}\n </p>\n )}\n </div>\n </div>\n\n {/* Prompt */}\n <label className=\"mb-1.5 block text-xs font-medium text-text-secondary\">\n {selectedTool?.inputType === \"url\"\n ? \"Page URL\"\n : \"Your prompt\"}\n </label>\n <Textarea\n value={input}\n onChange={(e) => setInput(e.target.value)}\n disabled={!selectedTool?.isAvailable}\n placeholder={\n selectedTool?.inputType === \"url\"\n ? \"https://your-website.com/page\"\n : \"Describe what you want to generate… (Enter to generate, Shift+Enter for a new line)\"\n }\n rows={4}\n className=\"min-h-[112px] resize-y\"\n onKeyDown={(e) => {\n if (e.key === \"Enter\" && !e.shiftKey) {\n e.preventDefault();\n void handleGenerate();\n }\n }}\n />\n\n {/* Model + Generate */}\n <div className=\"mt-3 flex flex-col gap-2 sm:flex-row\">\n {modelOptions.length > 0 ? (\n <Select\n value={effectiveModel}\n onValueChange={setSelectedModel}\n disabled={!selectedTool?.isAvailable}\n >\n <SelectTrigger\n aria-label=\"Model\"\n className=\"h-11 flex-1\"\n >\n <span className=\"flex items-center gap-2 truncate\">\n <Cpu className=\"h-4 w-4 shrink-0 text-text-muted\" />\n <SelectValue placeholder=\"Model\" />\n </span>\n </SelectTrigger>\n <SelectContent>\n {modelOptions.map((m) => (\n <SelectItem key={m} value={m}>\n {m}\n </SelectItem>\n ))}\n </SelectContent>\n </Select>\n ) : (\n <div className=\"flex h-11 flex-1 items-center gap-2 rounded-input border border-border-default bg-bg-surface px-3 text-sm text-text-secondary\">\n <Cpu className=\"h-4 w-4 text-text-muted\" />\n <span className=\"truncate\">\n {selectedTool?.provider ?? \"Default model\"}\n </span>\n </div>\n )}\n <button\n type=\"button\"\n onClick={() => void handleGenerate()}\n disabled={\n generating ||\n !input.trim() ||\n !selectedTool?.isAvailable\n }\n className={cn(\n \"inline-flex min-h-[44px] items-center justify-center gap-2 rounded-md px-5 text-sm font-semibold transition-colors sm:min-w-[132px]\",\n generating ||\n !input.trim() ||\n !selectedTool?.isAvailable\n ? \"cursor-not-allowed bg-bg-sunken text-text-secondary\"\n : \"bg-action-primary-bg text-action-primary-text hover:bg-action-primary-bg/90\",\n )}\n >\n {generating ? (\n <>\n <Loader2 className=\"h-4 w-4 animate-spin\" />\n Generating…\n </>\n ) : (\n <>\n <Send className=\"h-4 w-4\" />\n Generate\n </>\n )}\n </button>\n </div>\n\n {executeError && (\n <div\n role=\"alert\"\n className=\"mt-3 rounded-md border border-status-error-border/30 bg-status-error-bg/10 px-3 py-2 text-sm text-status-error-text\"\n >\n {executeError}\n </div>\n )}\n\n {/* Output */}\n <div className=\"mt-4 overflow-hidden rounded-card border border-border-seam bg-bg-surface\">\n <div className=\"flex items-center justify-between border-b border-border-subtle px-3 py-2\">\n <span className=\"text-xs font-semibold uppercase tracking-wide text-text-secondary\">\n Generated\n </span>\n <div className=\"flex items-center gap-1\">\n <button\n type=\"button\"\n onClick={() => void handleCopy(\"out-all\", combined)}\n disabled={results.length === 0}\n className=\"inline-flex min-h-[32px] items-center gap-1 rounded px-2 text-xs font-medium text-primary transition-colors hover:bg-bg-sunken disabled:opacity-40\"\n >\n {copiedKey === \"out-all\" ? (\n <>\n <Check className=\"h-3.5 w-3.5\" /> Copied\n </>\n ) : (\n <>\n <Copy className=\"h-3.5 w-3.5\" /> Copy\n </>\n )}\n </button>\n <button\n type=\"button\"\n onClick={() =>\n void handleInsert(\n \"out-all\",\n combined,\n selectedTool,\n lastExecutionId,\n )\n }\n disabled={\n results.length === 0 ||\n insertBusyKey === \"out-all\" ||\n insertedKeys.has(\"out-all\")\n }\n className=\"inline-flex min-h-[32px] items-center gap-1 rounded px-2 text-xs font-medium text-primary transition-colors hover:bg-bg-sunken disabled:opacity-40\"\n >\n {insertBusyKey === \"out-all\" ? (\n <>\n <Loader2 className=\"h-3.5 w-3.5 animate-spin\" />{\" \"}\n Saving\n </>\n ) : insertedKeys.has(\"out-all\") ? (\n <>\n <Check className=\"h-3.5 w-3.5\" /> Saved\n </>\n ) : (\n <>\n <FilePlus2 className=\"h-3.5 w-3.5\" /> Insert\n </>\n )}\n </button>\n </div>\n </div>\n <div className=\"max-h-[340px] min-h-[148px] overflow-y-auto p-3\">\n {generating ? (\n <div className=\"flex h-[124px] flex-col items-center justify-center gap-2 text-text-secondary\">\n <Loader2 className=\"h-5 w-5 animate-spin\" />\n <span className=\"text-xs\">\n Generating your content…\n </span>\n </div>\n ) : results.length === 0 ? (\n <div className=\"flex h-[124px] flex-col items-center justify-center gap-2 text-center text-text-secondary\">\n <Sparkles className=\"h-5 w-5 opacity-60\" />\n <span className=\"text-xs\">\n Your generated content will appear here.\n </span>\n </div>\n ) : (\n <div className=\"space-y-3\">\n {results.map((result, idx) => {\n const key = `out-${idx}`;\n return (\n <div\n key={key}\n className={cn(\n results.length > 1 &&\n \"rounded-md border border-border-subtle bg-bg-sunken p-3\",\n )}\n >\n {results.length > 1 && (\n <div className=\"mb-1.5 flex items-center justify-between\">\n <span className=\"text-xs font-medium text-text-secondary\">\n Variation {idx + 1}\n </span>\n <div className=\"flex items-center gap-2\">\n <button\n type=\"button\"\n onClick={() =>\n void handleCopy(key, result)\n }\n className=\"text-xs font-medium text-primary hover:underline\"\n >\n {copiedKey === key ? \"Copied\" : \"Copy\"}\n </button>\n <button\n type=\"button\"\n onClick={() =>\n void handleInsert(\n key,\n result,\n selectedTool,\n lastExecutionId,\n )\n }\n disabled={\n insertBusyKey === key ||\n insertedKeys.has(key)\n }\n className=\"text-xs font-medium text-primary hover:underline disabled:opacity-60\"\n >\n {insertBusyKey === key\n ? \"Saving\"\n : insertedKeys.has(key)\n ? \"Saved\"\n : \"Insert\"}\n </button>\n </div>\n </div>\n )}\n <p className=\"whitespace-pre-wrap text-sm text-text-primary\">\n {result}\n </p>\n </div>\n );\n })}\n </div>\n )}\n </div>\n {(lastMeta || insertError) && (\n <div className=\"flex items-center justify-between gap-2 border-t border-border-subtle px-3 py-2 text-xs\">\n {lastMeta ? (\n <span className=\"flex items-center gap-3 text-text-secondary\">\n {lastMeta.durationMs != null && (\n <span className=\"flex items-center gap-1\">\n <Clock className=\"h-3 w-3\" />\n {(lastMeta.durationMs / 1000).toFixed(1)}s\n </span>\n )}\n {lastMeta.tokensUsed != null && (\n <span className=\"flex items-center gap-1\">\n <Zap className=\"h-3 w-3\" />\n {formatNumber(lastMeta.tokensUsed)} tokens\n </span>\n )}\n </span>\n ) : (\n <span />\n )}\n {insertError && (\n <span className=\"text-status-error-text\">\n {insertError}\n </span>\n )}\n </div>\n )}\n </div>\n\n {insertedKeys.size > 0 && (\n <button\n type=\"button\"\n onClick={() => navigate(basePath + \"/content\")}\n className=\"mt-3 inline-flex items-center gap-1 text-xs font-medium text-primary hover:underline\"\n >\n <FilePlus2 className=\"h-3.5 w-3.5\" />\n View saved drafts in Content\n </button>\n )}\n </GlassCard>\n </div>\n </div>\n\n {/* Per-run accounting for every execution the workspace has made */}\n <AIExecutionLedger executions={executions} tools={rawTools} />\n </>\n )}\n </QueryStateBoundary>\n </PageLayout>\n );\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAoEA,IAAM,KAAkB,CAAG;;;;;;;;;;;;;;;GA6DrB,IAAkD;EACrD,EAAe,oBAAoB;EACnC,EAAe,cAAc;EAC7B,EAAe,kBAAkB;EACjC,EAAe,kBAAkB;EACjC,EAAe,gBAAgB;EAC/B,EAAe,cAAc;EAC7B,EAAe,kBAAkB;EACjC,EAAe,QAAQ;CACzB,EAEK,KAAiD;EACpD,EAAe,oBAAoB;EACnC,EAAe,cAAc;EAC7B,EAAe,kBAAkB;EACjC,EAAe,kBAAkB;EACjC,EAAe,gBAAgB;EAC/B,EAAe,cAAc;EAC7B,EAAe,kBAAkB;EACjC,EAAe,QAAQ;CACzB;AAGD,SAAS,GAAS,GAAc,GAAoC;CAClE,IAAM,IAAI,EAAK,aAAa;AAe5B,QAdI,EAAE,SAAS,OAAO,GAAS,IAC3B,EAAE,SAAS,eAAe,IAAI,EAAE,SAAS,QAAQ,GAAS,IAC1D,EAAE,SAAS,UAAU,IAAI,EAAE,SAAS,SAAS,GAAS,IACtD,EAAE,SAAS,UAAU,IAAI,EAAE,SAAS,MAAM,IAAI,EAAE,SAAS,SAAS,GAC7D,IACL,EAAE,SAAS,MAAM,IAAI,EAAE,SAAS,OAAO,IAAI,EAAE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AD,EAAO,WAAU,WAAY,CAAA;gBAC3B,EAAS,aAAa,KAAM,QAAQ,EAAE;eAAC;eACpC;iBAER,EAAS,cAAc,QACtB,kBAAC,QAAD;cAAM,WAAU;wBAAhB;eACE,kBAAC,IAAD,EAAK,WAAU,WAAY,CAAA;eAC1B,EAAa,EAAS,WAAW;eAAC;eAC9B;gBAEJ;iBAEP,kBAAC,QAAD,EAAQ,CAAA,EAET,KACC,kBAAC,QAAD;aAAM,WAAU;uBACb;aACI,CAAA,CAEL;;WAEJ;;SAEL,EAAa,OAAO,KACnB,kBAAC,UAAD;UACE,MAAK;UACL,eAAe,EAAS,IAAW,WAAW;UAC9C,WAAU;oBAHZ,CAKE,kBAAC,GAAD,EAAW,WAAU,eAAgB,CAAA,EAAA,+BAE9B;;SAED;;OACR,CAAA,CACF;;KAGN,kBAAC,IAAD;MAA+B;MAAY,OAAO;MAAY,CAAA;KAC7D,EAAA,CAAA;IAEc,CAAA;GACV"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ContentCreationPage.d.ts","sourceRoot":"","sources":["../../../../src/headshotmarketing/pages/content/ContentCreationPage.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAOL,KAAK,EAAE,EAER,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"ContentCreationPage.d.ts","sourceRoot":"","sources":["../../../../src/headshotmarketing/pages/content/ContentCreationPage.tsx"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAOL,KAAK,EAAE,EAER,MAAM,OAAO,CAAC;AAwUf,eAAO,MAAM,mBAAmB,EAAE,EA4yCjC,CAAC;AAEF;;;;GAIG;AACH,eAAO,MAAM,eAAe,EAAE,EAG7B,CAAC"}
|