@contractspec/lib.content-gen 1.57.0 → 1.59.0

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.
Files changed (51) hide show
  1. package/dist/browser/generators/blog.js +88 -0
  2. package/dist/browser/generators/email.js +111 -0
  3. package/dist/browser/generators/index.js +367 -0
  4. package/dist/browser/generators/landing-page.js +93 -0
  5. package/dist/browser/generators/social.js +78 -0
  6. package/dist/browser/index.js +407 -0
  7. package/dist/browser/seo/index.js +42 -0
  8. package/dist/browser/seo/optimizer.js +42 -0
  9. package/dist/browser/types.js +0 -0
  10. package/dist/generators/blog.d.ts +10 -14
  11. package/dist/generators/blog.d.ts.map +1 -1
  12. package/dist/generators/blog.js +88 -69
  13. package/dist/generators/email.d.ts +13 -17
  14. package/dist/generators/email.d.ts.map +1 -1
  15. package/dist/generators/email.js +103 -91
  16. package/dist/generators/index.d.ts +5 -5
  17. package/dist/generators/index.d.ts.map +1 -0
  18. package/dist/generators/index.js +367 -5
  19. package/dist/generators/landing-page.d.ts +21 -25
  20. package/dist/generators/landing-page.d.ts.map +1 -1
  21. package/dist/generators/landing-page.js +93 -77
  22. package/dist/generators/social.d.ts +9 -13
  23. package/dist/generators/social.d.ts.map +1 -1
  24. package/dist/generators/social.js +77 -73
  25. package/dist/index.d.ts +4 -7
  26. package/dist/index.d.ts.map +1 -0
  27. package/dist/index.js +407 -6
  28. package/dist/node/generators/blog.js +88 -0
  29. package/dist/node/generators/email.js +111 -0
  30. package/dist/node/generators/index.js +367 -0
  31. package/dist/node/generators/landing-page.js +93 -0
  32. package/dist/node/generators/social.js +78 -0
  33. package/dist/node/index.js +407 -0
  34. package/dist/node/seo/index.js +42 -0
  35. package/dist/node/seo/optimizer.js +42 -0
  36. package/dist/node/types.js +0 -0
  37. package/dist/seo/index.d.ts +2 -2
  38. package/dist/seo/index.d.ts.map +1 -0
  39. package/dist/seo/index.js +43 -3
  40. package/dist/seo/optimizer.d.ts +6 -10
  41. package/dist/seo/optimizer.d.ts.map +1 -1
  42. package/dist/seo/optimizer.js +42 -48
  43. package/dist/types.d.ts +58 -62
  44. package/dist/types.d.ts.map +1 -1
  45. package/dist/types.js +1 -0
  46. package/package.json +100 -31
  47. package/dist/generators/blog.js.map +0 -1
  48. package/dist/generators/email.js.map +0 -1
  49. package/dist/generators/landing-page.js.map +0 -1
  50. package/dist/generators/social.js.map +0 -1
  51. package/dist/seo/optimizer.js.map +0 -1
@@ -1,6 +1,368 @@
1
- import { BlogGenerator } from "./blog.js";
2
- import { LandingPageGenerator } from "./landing-page.js";
3
- import { EmailCampaignGenerator } from "./email.js";
4
- import { SocialPostGenerator } from "./social.js";
1
+ // @bun
2
+ // src/generators/blog.ts
3
+ class BlogGenerator {
4
+ llm;
5
+ model;
6
+ temperature;
7
+ constructor(options) {
8
+ this.llm = options?.llm;
9
+ this.model = options?.model;
10
+ this.temperature = options?.temperature ?? 0.4;
11
+ }
12
+ async generate(brief) {
13
+ if (this.llm) {
14
+ return this.generateWithLlm(brief);
15
+ }
16
+ return this.generateDeterministic(brief);
17
+ }
18
+ async generateWithLlm(brief) {
19
+ if (!this.llm) {
20
+ return this.generateDeterministic(brief);
21
+ }
22
+ const response = await this.llm.chat([
23
+ {
24
+ role: "system",
25
+ content: [
26
+ {
27
+ type: "text",
28
+ text: "You are a product marketing writer. Produce JSON with title, subtitle, intro, sections[].heading/body/bullets, outro."
29
+ }
30
+ ]
31
+ },
32
+ {
33
+ role: "user",
34
+ content: [
35
+ {
36
+ type: "text",
37
+ text: JSON.stringify({ brief })
38
+ }
39
+ ]
40
+ }
41
+ ], {
42
+ responseFormat: "json",
43
+ model: this.model,
44
+ temperature: this.temperature
45
+ });
46
+ const jsonPart = response.message.content.find((part) => ("text" in part));
47
+ if (jsonPart && "text" in jsonPart) {
48
+ return JSON.parse(jsonPart.text);
49
+ }
50
+ return this.generateDeterministic(brief);
51
+ }
52
+ generateDeterministic(brief) {
53
+ const intro = `Operators like ${brief.audience.role} teams face ${brief.problems.slice(0, 2).join(" and ")}. ${brief.title} changes that by ${brief.summary}.`;
54
+ const sections = [
55
+ {
56
+ heading: "Why now",
57
+ body: this.renderWhyNow(brief)
58
+ },
59
+ {
60
+ heading: "What you get",
61
+ body: "A focused stack built for policy-safe automation.",
62
+ bullets: brief.solutions
63
+ },
64
+ {
65
+ heading: "Proof it works",
66
+ body: "Teams using the blueprint report measurable wins.",
67
+ bullets: brief.metrics ?? [
68
+ "Launch workflows in minutes",
69
+ "Cut review time by 60%"
70
+ ]
71
+ }
72
+ ];
73
+ return {
74
+ title: brief.title,
75
+ subtitle: brief.summary,
76
+ intro,
77
+ sections,
78
+ outro: brief.callToAction ?? "Ready to see it live? Spin up a sandbox in under 5 minutes."
79
+ };
80
+ }
81
+ renderWhyNow(brief) {
82
+ const audience = `${brief.audience.role}${brief.audience.industry ? ` in ${brief.audience.industry}` : ""}`;
83
+ const pains = brief.problems.slice(0, 2).join("; ");
84
+ return `${audience} teams are stuck with ${pains}. ${brief.title} delivers guardrails without slowing shipping.`;
85
+ }
86
+ }
5
87
 
6
- export { BlogGenerator, EmailCampaignGenerator, LandingPageGenerator, SocialPostGenerator };
88
+ // src/generators/email.ts
89
+ class EmailCampaignGenerator {
90
+ llm;
91
+ model;
92
+ temperature;
93
+ constructor(options) {
94
+ this.llm = options?.llm;
95
+ this.model = options?.model;
96
+ this.temperature = options?.temperature ?? 0.6;
97
+ }
98
+ async generate(input) {
99
+ if (this.llm) {
100
+ const draft = await this.generateWithLlm(input);
101
+ if (draft)
102
+ return draft;
103
+ }
104
+ return this.generateFallback(input);
105
+ }
106
+ async generateWithLlm(input) {
107
+ if (!this.llm)
108
+ return null;
109
+ const response = await this.llm.chat([
110
+ {
111
+ role: "system",
112
+ content: [
113
+ {
114
+ type: "text",
115
+ text: "Draft product marketing email as JSON {subject, previewText, body, cta}."
116
+ }
117
+ ]
118
+ },
119
+ {
120
+ role: "user",
121
+ content: [{ type: "text", text: JSON.stringify(input) }]
122
+ }
123
+ ], {
124
+ responseFormat: "json",
125
+ model: this.model,
126
+ temperature: this.temperature
127
+ });
128
+ const jsonPart = response.message.content.find((chunk) => ("text" in chunk));
129
+ if (!jsonPart || !("text" in jsonPart))
130
+ return null;
131
+ const parsed = JSON.parse(jsonPart.text);
132
+ if (!parsed.subject || !parsed.body || !parsed.cta)
133
+ return null;
134
+ return {
135
+ subject: parsed.subject,
136
+ previewText: parsed.previewText ?? this.defaultPreview(input),
137
+ body: parsed.body,
138
+ cta: parsed.cta,
139
+ variant: input.variant
140
+ };
141
+ }
142
+ generateFallback(input) {
143
+ const { brief, variant } = input;
144
+ const subject = this.subjects(brief.title, variant)[0] ?? `${brief.title} update`;
145
+ const previewText = this.defaultPreview(input);
146
+ const body = this.renderBody(input);
147
+ const cta = brief.callToAction ?? "Explore the sandbox";
148
+ return { subject, previewText, body, cta, variant };
149
+ }
150
+ subjects(title, variant) {
151
+ switch (variant) {
152
+ case "announcement":
153
+ return [`Launch: ${title}`, `${title} is live`, `New: ${title}`];
154
+ case "onboarding":
155
+ return [`Get started with ${title}`, `Your ${title} guide`];
156
+ case "nurture":
157
+ default:
158
+ return [`How ${title} speeds ops`, `Proof ${title} works`];
159
+ }
160
+ }
161
+ defaultPreview(input) {
162
+ const win = input.brief.metrics?.[0] ?? "ship faster without policy gaps";
163
+ return `See how teams ${win}.`;
164
+ }
165
+ renderBody(input) {
166
+ const { brief, variant } = input;
167
+ const greeting = "Hi there,";
168
+ const hook = this.variantHook(variant, brief);
169
+ const proof = brief.metrics?.map((metric) => `\u2022 ${metric}`).join(`
170
+ `) ?? "";
171
+ return `${greeting}
172
+
173
+ ${hook}
174
+
175
+ Top reasons teams adopt ${brief.title}:
176
+ ${brief.solutions.map((solution) => `\u2022 ${solution}`).join(`
177
+ `)}
178
+
179
+ ${proof}
180
+
181
+ ${brief.callToAction ?? "Spin up a sandbox"} \u2192 ${(input.cadenceDay ?? 0) + 1}
182
+ `;
183
+ }
184
+ variantHook(variant, brief) {
185
+ switch (variant) {
186
+ case "announcement":
187
+ return `${brief.title} is live. ${brief.summary}`;
188
+ case "onboarding":
189
+ return `Here is your next step to unlock ${brief.title}.`;
190
+ case "nurture":
191
+ default:
192
+ return `Operators like ${brief.audience.role} keep asking how to automate policy checks. Here is what works.`;
193
+ }
194
+ }
195
+ }
196
+
197
+ // src/generators/landing-page.ts
198
+ class LandingPageGenerator {
199
+ options;
200
+ llm;
201
+ model;
202
+ constructor(options) {
203
+ this.options = options;
204
+ this.llm = options?.llm;
205
+ this.model = options?.model;
206
+ }
207
+ async generate(brief) {
208
+ if (this.llm) {
209
+ return this.generateWithLlm(brief);
210
+ }
211
+ return this.generateFallback(brief);
212
+ }
213
+ async generateWithLlm(brief) {
214
+ if (!this.llm) {
215
+ return this.generateFallback(brief);
216
+ }
217
+ const response = await this.llm.chat([
218
+ {
219
+ role: "system",
220
+ content: [
221
+ {
222
+ type: "text",
223
+ text: "Write JSON landing page copy with hero/highlights/socialProof/faq arrays."
224
+ }
225
+ ]
226
+ },
227
+ {
228
+ role: "user",
229
+ content: [{ type: "text", text: JSON.stringify({ brief }) }]
230
+ }
231
+ ], {
232
+ responseFormat: "json",
233
+ model: this.model,
234
+ temperature: this.options?.temperature ?? 0.5
235
+ });
236
+ const part = response.message.content.find((chunk) => ("text" in chunk));
237
+ if (part && "text" in part) {
238
+ return JSON.parse(part.text);
239
+ }
240
+ return this.generateFallback(brief);
241
+ }
242
+ generateFallback(brief) {
243
+ return {
244
+ hero: {
245
+ eyebrow: `${brief.audience.industry ?? "Operations"} teams`,
246
+ title: brief.title,
247
+ subtitle: brief.summary,
248
+ primaryCta: brief.callToAction ?? "Launch a sandbox",
249
+ secondaryCta: "View docs"
250
+ },
251
+ highlights: brief.solutions.slice(0, 3).map((solution, index) => ({
252
+ heading: [
253
+ "Policy-safe by default",
254
+ "Auto-adapts per tenant",
255
+ "Launch-ready in days"
256
+ ][index] ?? "Key capability",
257
+ body: solution
258
+ })),
259
+ socialProof: {
260
+ heading: "Teams using ContractSpec",
261
+ body: brief.proofPoints?.join(`
262
+ `) ?? "\u201CWe ship compliant workflows 5x faster while cutting ops toil in half.\u201D"
263
+ },
264
+ faq: this.buildFaq(brief)
265
+ };
266
+ }
267
+ buildFaq(brief) {
268
+ const faqs = [
269
+ {
270
+ heading: "How does this keep policies enforced?",
271
+ body: "All workflows compile from TypeScript specs and pass through PDP checks before execution, so no shadow logic slips through."
272
+ },
273
+ {
274
+ heading: "Will it fit our existing stack?",
275
+ body: "Runtime adapters plug into REST, GraphQL, or MCP. Integrations stay vendor agnostic."
276
+ }
277
+ ];
278
+ if (brief.complianceNotes?.length) {
279
+ faqs.push({
280
+ heading: "What about compliance requirements?",
281
+ body: brief.complianceNotes.join(" ")
282
+ });
283
+ }
284
+ return faqs;
285
+ }
286
+ }
287
+
288
+ // src/generators/social.ts
289
+ class SocialPostGenerator {
290
+ llm;
291
+ model;
292
+ constructor(options) {
293
+ this.llm = options?.llm;
294
+ this.model = options?.model;
295
+ }
296
+ async generate(brief) {
297
+ if (this.llm) {
298
+ const posts = await this.generateWithLlm(brief);
299
+ if (posts.length)
300
+ return posts;
301
+ }
302
+ return this.generateFallback(brief);
303
+ }
304
+ async generateWithLlm(brief) {
305
+ if (!this.llm)
306
+ return [];
307
+ const response = await this.llm.chat([
308
+ {
309
+ role: "system",
310
+ content: [
311
+ {
312
+ type: "text",
313
+ text: "Create JSON array of social posts for twitter/linkedin/threads with body, hashtags, cta."
314
+ }
315
+ ]
316
+ },
317
+ {
318
+ role: "user",
319
+ content: [{ type: "text", text: JSON.stringify(brief) }]
320
+ }
321
+ ], { responseFormat: "json", model: this.model });
322
+ const part = response.message.content.find((chunk) => ("text" in chunk));
323
+ if (!part || !("text" in part))
324
+ return [];
325
+ return JSON.parse(part.text);
326
+ }
327
+ generateFallback(brief) {
328
+ const hashtags = this.buildHashtags(brief);
329
+ return [
330
+ {
331
+ channel: "linkedin",
332
+ body: `${brief.title}: ${brief.summary}
333
+ ${brief.problems[0]} \u2192 ${brief.solutions[0]}`,
334
+ hashtags,
335
+ cta: brief.callToAction ?? "Book a 15-min run-through"
336
+ },
337
+ {
338
+ channel: "twitter",
339
+ body: `${brief.solutions[0]} in <60s. ${brief.solutions[1] ?? ""}`.trim(),
340
+ hashtags: hashtags.slice(0, 3),
341
+ cta: "\u2192 contractspec.io/sandbox"
342
+ },
343
+ {
344
+ channel: "threads",
345
+ body: `Ops + policy can move fast. ${brief.title} automates guardrails so teams ship daily.`,
346
+ hashtags: hashtags.slice(1, 4)
347
+ }
348
+ ];
349
+ }
350
+ buildHashtags(brief) {
351
+ const base = [
352
+ brief.audience.industry ? `#${camel(brief.audience.industry)}` : "#operations",
353
+ "#automation",
354
+ "#aiops",
355
+ "#compliance"
356
+ ];
357
+ return [...new Set(base.map((tag) => tag.replace(/\s+/g, "")))].slice(0, 5);
358
+ }
359
+ }
360
+ function camel(text) {
361
+ return text.split(/\s|-/).filter(Boolean).map((word) => word[0]?.toUpperCase() + word.slice(1)).join("");
362
+ }
363
+ export {
364
+ SocialPostGenerator,
365
+ LandingPageGenerator,
366
+ EmailCampaignGenerator,
367
+ BlogGenerator
368
+ };
@@ -1,28 +1,24 @@
1
- import { ContentBlock, ContentBrief, GeneratorOptions } from "../types.js";
2
-
3
- //#region src/generators/landing-page.d.ts
4
- interface LandingPageCopy {
5
- hero: {
6
- eyebrow?: string;
7
- title: string;
8
- subtitle: string;
9
- primaryCta: string;
10
- secondaryCta?: string;
11
- };
12
- highlights: ContentBlock[];
13
- socialProof: ContentBlock;
14
- faq: ContentBlock[];
1
+ import type { ContentBrief, ContentBlock, GeneratorOptions } from '../types';
2
+ export interface LandingPageCopy {
3
+ hero: {
4
+ eyebrow?: string;
5
+ title: string;
6
+ subtitle: string;
7
+ primaryCta: string;
8
+ secondaryCta?: string;
9
+ };
10
+ highlights: ContentBlock[];
11
+ socialProof: ContentBlock;
12
+ faq: ContentBlock[];
15
13
  }
16
- declare class LandingPageGenerator {
17
- private readonly options?;
18
- private readonly llm?;
19
- private readonly model?;
20
- constructor(options?: GeneratorOptions | undefined);
21
- generate(brief: ContentBrief): Promise<LandingPageCopy>;
22
- private generateWithLlm;
23
- private generateFallback;
24
- private buildFaq;
14
+ export declare class LandingPageGenerator {
15
+ private readonly options?;
16
+ private readonly llm?;
17
+ private readonly model?;
18
+ constructor(options?: GeneratorOptions | undefined);
19
+ generate(brief: ContentBrief): Promise<LandingPageCopy>;
20
+ private generateWithLlm;
21
+ private generateFallback;
22
+ private buildFaq;
25
23
  }
26
- //#endregion
27
- export { LandingPageCopy, LandingPageGenerator };
28
24
  //# sourceMappingURL=landing-page.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"landing-page.d.ts","names":[],"sources":["../../src/generators/landing-page.ts"],"mappings":";;;UAGiB,eAAA;EACf,IAAA;IACE,OAAA;IACA,KAAA;IACA,QAAA;IACA,UAAA;IACA,YAAA;EAAA;EAEF,UAAA,EAAY,YAAA;EACZ,WAAA,EAAa,YAAA;EACb,GAAA,EAAK,YAAA;AAAA;AAAA,cAGM,oBAAA;EAAA,iBAIkB,OAAA;EAAA,iBAHZ,GAAA;EAAA,iBACA,KAAA;cAEY,OAAA,GAAU,gBAAA;EAKjC,QAAA,CAAS,KAAA,EAAO,YAAA,GAAe,OAAA,CAAQ,eAAA;EAAA,QAO/B,eAAA;EAAA,QAiCN,gBAAA;EAAA,QA4BA,QAAA;AAAA"}
1
+ {"version":3,"file":"landing-page.d.ts","sourceRoot":"","sources":["../../src/generators/landing-page.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,YAAY,EAAE,gBAAgB,EAAE,MAAM,UAAU,CAAC;AAG7E,MAAM,WAAW,eAAe;IAC9B,IAAI,EAAE;QACJ,OAAO,CAAC,EAAE,MAAM,CAAC;QACjB,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;QACjB,UAAU,EAAE,MAAM,CAAC;QACnB,YAAY,CAAC,EAAE,MAAM,CAAC;KACvB,CAAC;IACF,UAAU,EAAE,YAAY,EAAE,CAAC;IAC3B,WAAW,EAAE,YAAY,CAAC;IAC1B,GAAG,EAAE,YAAY,EAAE,CAAC;CACrB;AAED,qBAAa,oBAAoB;IAInB,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;IAHrC,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAc;IACnC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAS;gBAEH,OAAO,CAAC,EAAE,gBAAgB,YAAA;IAKjD,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,eAAe,CAAC;YAO/C,eAAe;IAiC7B,OAAO,CAAC,gBAAgB;IA4BxB,OAAO,CAAC,QAAQ;CAmBjB"}
@@ -1,78 +1,94 @@
1
- //#region src/generators/landing-page.ts
2
- var LandingPageGenerator = class {
3
- llm;
4
- model;
5
- constructor(options) {
6
- this.options = options;
7
- this.llm = options?.llm;
8
- this.model = options?.model;
9
- }
10
- async generate(brief) {
11
- if (this.llm) return this.generateWithLlm(brief);
12
- return this.generateFallback(brief);
13
- }
14
- async generateWithLlm(brief) {
15
- if (!this.llm) return this.generateFallback(brief);
16
- const part = (await this.llm.chat([{
17
- role: "system",
18
- content: [{
19
- type: "text",
20
- text: "Write JSON landing page copy with hero/highlights/socialProof/faq arrays."
21
- }]
22
- }, {
23
- role: "user",
24
- content: [{
25
- type: "text",
26
- text: JSON.stringify({ brief })
27
- }]
28
- }], {
29
- responseFormat: "json",
30
- model: this.model,
31
- temperature: this.options?.temperature ?? .5
32
- })).message.content.find((chunk) => "text" in chunk);
33
- if (part && "text" in part) return JSON.parse(part.text);
34
- return this.generateFallback(brief);
35
- }
36
- generateFallback(brief) {
37
- return {
38
- hero: {
39
- eyebrow: `${brief.audience.industry ?? "Operations"} teams`,
40
- title: brief.title,
41
- subtitle: brief.summary,
42
- primaryCta: brief.callToAction ?? "Launch a sandbox",
43
- secondaryCta: "View docs"
44
- },
45
- highlights: brief.solutions.slice(0, 3).map((solution, index) => ({
46
- heading: [
47
- "Policy-safe by default",
48
- "Auto-adapts per tenant",
49
- "Launch-ready in days"
50
- ][index] ?? "Key capability",
51
- body: solution
52
- })),
53
- socialProof: {
54
- heading: "Teams using ContractSpec",
55
- body: brief.proofPoints?.join("\n") ?? "“We ship compliant workflows 5x faster while cutting ops toil in half.”"
56
- },
57
- faq: this.buildFaq(brief)
58
- };
59
- }
60
- buildFaq(brief) {
61
- const faqs = [{
62
- heading: "How does this keep policies enforced?",
63
- body: "All workflows compile from TypeScript specs and pass through PDP checks before execution, so no shadow logic slips through."
64
- }, {
65
- heading: "Will it fit our existing stack?",
66
- body: "Runtime adapters plug into REST, GraphQL, or MCP. Integrations stay vendor agnostic."
67
- }];
68
- if (brief.complianceNotes?.length) faqs.push({
69
- heading: "What about compliance requirements?",
70
- body: brief.complianceNotes.join(" ")
71
- });
72
- return faqs;
73
- }
1
+ // @bun
2
+ // src/generators/landing-page.ts
3
+ class LandingPageGenerator {
4
+ options;
5
+ llm;
6
+ model;
7
+ constructor(options) {
8
+ this.options = options;
9
+ this.llm = options?.llm;
10
+ this.model = options?.model;
11
+ }
12
+ async generate(brief) {
13
+ if (this.llm) {
14
+ return this.generateWithLlm(brief);
15
+ }
16
+ return this.generateFallback(brief);
17
+ }
18
+ async generateWithLlm(brief) {
19
+ if (!this.llm) {
20
+ return this.generateFallback(brief);
21
+ }
22
+ const response = await this.llm.chat([
23
+ {
24
+ role: "system",
25
+ content: [
26
+ {
27
+ type: "text",
28
+ text: "Write JSON landing page copy with hero/highlights/socialProof/faq arrays."
29
+ }
30
+ ]
31
+ },
32
+ {
33
+ role: "user",
34
+ content: [{ type: "text", text: JSON.stringify({ brief }) }]
35
+ }
36
+ ], {
37
+ responseFormat: "json",
38
+ model: this.model,
39
+ temperature: this.options?.temperature ?? 0.5
40
+ });
41
+ const part = response.message.content.find((chunk) => ("text" in chunk));
42
+ if (part && "text" in part) {
43
+ return JSON.parse(part.text);
44
+ }
45
+ return this.generateFallback(brief);
46
+ }
47
+ generateFallback(brief) {
48
+ return {
49
+ hero: {
50
+ eyebrow: `${brief.audience.industry ?? "Operations"} teams`,
51
+ title: brief.title,
52
+ subtitle: brief.summary,
53
+ primaryCta: brief.callToAction ?? "Launch a sandbox",
54
+ secondaryCta: "View docs"
55
+ },
56
+ highlights: brief.solutions.slice(0, 3).map((solution, index) => ({
57
+ heading: [
58
+ "Policy-safe by default",
59
+ "Auto-adapts per tenant",
60
+ "Launch-ready in days"
61
+ ][index] ?? "Key capability",
62
+ body: solution
63
+ })),
64
+ socialProof: {
65
+ heading: "Teams using ContractSpec",
66
+ body: brief.proofPoints?.join(`
67
+ `) ?? "\u201CWe ship compliant workflows 5x faster while cutting ops toil in half.\u201D"
68
+ },
69
+ faq: this.buildFaq(brief)
70
+ };
71
+ }
72
+ buildFaq(brief) {
73
+ const faqs = [
74
+ {
75
+ heading: "How does this keep policies enforced?",
76
+ body: "All workflows compile from TypeScript specs and pass through PDP checks before execution, so no shadow logic slips through."
77
+ },
78
+ {
79
+ heading: "Will it fit our existing stack?",
80
+ body: "Runtime adapters plug into REST, GraphQL, or MCP. Integrations stay vendor agnostic."
81
+ }
82
+ ];
83
+ if (brief.complianceNotes?.length) {
84
+ faqs.push({
85
+ heading: "What about compliance requirements?",
86
+ body: brief.complianceNotes.join(" ")
87
+ });
88
+ }
89
+ return faqs;
90
+ }
91
+ }
92
+ export {
93
+ LandingPageGenerator
74
94
  };
75
-
76
- //#endregion
77
- export { LandingPageGenerator };
78
- //# sourceMappingURL=landing-page.js.map
@@ -1,15 +1,11 @@
1
- import { ContentBrief, GeneratorOptions, SocialPost } from "../types.js";
2
-
3
- //#region src/generators/social.d.ts
4
- declare class SocialPostGenerator {
5
- private readonly llm?;
6
- private readonly model?;
7
- constructor(options?: GeneratorOptions);
8
- generate(brief: ContentBrief): Promise<SocialPost[]>;
9
- private generateWithLlm;
10
- private generateFallback;
11
- private buildHashtags;
1
+ import type { ContentBrief, GeneratorOptions, SocialPost } from '../types';
2
+ export declare class SocialPostGenerator {
3
+ private readonly llm?;
4
+ private readonly model?;
5
+ constructor(options?: GeneratorOptions);
6
+ generate(brief: ContentBrief): Promise<SocialPost[]>;
7
+ private generateWithLlm;
8
+ private generateFallback;
9
+ private buildHashtags;
12
10
  }
13
- //#endregion
14
- export { SocialPostGenerator };
15
11
  //# sourceMappingURL=social.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"social.d.ts","names":[],"sources":["../../src/generators/social.ts"],"mappings":";;;cAGa,mBAAA;EAAA,iBACM,GAAA;EAAA,iBACA,KAAA;cAEL,OAAA,GAAU,gBAAA;EAKhB,QAAA,CAAS,KAAA,EAAO,YAAA,GAAe,OAAA,CAAQ,UAAA;EAAA,QAQ/B,eAAA;EAAA,QAyBN,gBAAA;EAAA,QAuBA,aAAA;AAAA"}
1
+ {"version":3,"file":"social.d.ts","sourceRoot":"","sources":["../../src/generators/social.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,gBAAgB,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAG3E,qBAAa,mBAAmB;IAC9B,OAAO,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAc;IACnC,OAAO,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAS;gBAEpB,OAAO,CAAC,EAAE,gBAAgB;IAKhC,QAAQ,CAAC,KAAK,EAAE,YAAY,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;YAQ5C,eAAe;IAyB7B,OAAO,CAAC,gBAAgB;IAuBxB,OAAO,CAAC,aAAa;CAWtB"}