@lssm/lib.content-gen 0.4.1 → 1.41.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.
@@ -1 +1 @@
1
- var e=class{llm;model;constructor(e){this.llm=e?.llm,this.model=e?.model}async generate(e){if(this.llm){let t=await this.generateWithLlm(e);if(t.length)return t}return this.generateFallback(e)}async generateWithLlm(e){let t=(await this.llm.chat([{role:`system`,content:[{type:`text`,text:`Create JSON array of social posts for twitter/linkedin/threads with body, hashtags, cta.`}]},{role:`user`,content:[{type:`text`,text:JSON.stringify(e)}]}],{responseFormat:`json`,model:this.model})).message.content.find(e=>`text`in e);return!t||!(`text`in t)?[]:JSON.parse(t.text)}generateFallback(e){let t=this.buildHashtags(e);return[{channel:`linkedin`,body:`${e.title}: ${e.summary}\n${e.problems[0]} → ${e.solutions[0]}`,hashtags:t,cta:e.callToAction??`Book a 15-min run-through`},{channel:`twitter`,body:`${e.solutions[0]} in <60s. ${e.solutions[1]??``}`.trim(),hashtags:t.slice(0,3),cta:`→ contractspec.chaman.ventures/sandbox`},{channel:`threads`,body:`Ops + policy can move fast. ${e.title} automates guardrails so teams ship daily.`,hashtags:t.slice(1,4)}]}buildHashtags(e){let n=[e.audience.industry?`#${t(e.audience.industry)}`:`#operations`,`#automation`,`#aiops`,`#compliance`];return[...new Set(n.map(e=>e.replace(/\s+/g,``)))].slice(0,5)}};function t(e){return e.split(/\s|-/).filter(Boolean).map(e=>e[0]?.toUpperCase()+e.slice(1)).join(``)}export{e as SocialPostGenerator};
1
+ var e=class{llm;model;constructor(e){this.llm=e?.llm,this.model=e?.model}async generate(e){if(this.llm){let t=await this.generateWithLlm(e);if(t.length)return t}return this.generateFallback(e)}async generateWithLlm(e){let t=(await this.llm.chat([{role:`system`,content:[{type:`text`,text:`Create JSON array of social posts for twitter/linkedin/threads with body, hashtags, cta.`}]},{role:`user`,content:[{type:`text`,text:JSON.stringify(e)}]}],{responseFormat:`json`,model:this.model})).message.content.find(e=>`text`in e);return!t||!(`text`in t)?[]:JSON.parse(t.text)}generateFallback(e){let t=this.buildHashtags(e);return[{channel:`linkedin`,body:`${e.title}: ${e.summary}\n${e.problems[0]} → ${e.solutions[0]}`,hashtags:t,cta:e.callToAction??`Book a 15-min run-through`},{channel:`twitter`,body:`${e.solutions[0]} in <60s. ${e.solutions[1]??``}`.trim(),hashtags:t.slice(0,3),cta:`→ contractspec.lssm.tech/sandbox`},{channel:`threads`,body:`Ops + policy can move fast. ${e.title} automates guardrails so teams ship daily.`,hashtags:t.slice(1,4)}]}buildHashtags(e){let n=[e.audience.industry?`#${t(e.audience.industry)}`:`#operations`,`#automation`,`#aiops`,`#compliance`];return[...new Set(n.map(e=>e.replace(/\s+/g,``)))].slice(0,5)}};function t(e){return e.split(/\s|-/).filter(Boolean).map(e=>e[0]?.toUpperCase()+e.slice(1)).join(``)}export{e as SocialPostGenerator};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lssm/lib.content-gen",
3
- "version": "0.4.1",
3
+ "version": "1.41.0",
4
4
  "type": "module",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.js",
@@ -22,27 +22,39 @@
22
22
  "test": "bun run"
23
23
  },
24
24
  "dependencies": {
25
- "@lssm/lib.contracts": "1.11.1"
25
+ "@lssm/lib.contracts": "workspace:*"
26
26
  },
27
27
  "devDependencies": {
28
- "@lssm/tool.tsdown": "0.12.1",
29
- "@lssm/tool.typescript": "0.11.1",
30
- "tsdown": "^0.16.6",
28
+ "@lssm/tool.tsdown": "workspace:*",
29
+ "@lssm/tool.typescript": "workspace:*",
30
+ "tsdown": "^0.17.4",
31
31
  "typescript": "^5.9.3"
32
32
  },
33
33
  "exports": {
34
- ".": "./dist/index.js",
35
- "./generators": "./dist/generators/index.js",
36
- "./generators/blog": "./dist/generators/blog.js",
37
- "./generators/email": "./dist/generators/email.js",
38
- "./generators/landing-page": "./dist/generators/landing-page.js",
39
- "./generators/social": "./dist/generators/social.js",
40
- "./seo": "./dist/seo/index.js",
41
- "./seo/optimizer": "./dist/seo/optimizer.js",
42
- "./types": "./dist/types.js",
34
+ ".": "./src/index.ts",
35
+ "./generators": "./src/generators/index.ts",
36
+ "./generators/blog": "./src/generators/blog.ts",
37
+ "./generators/email": "./src/generators/email.ts",
38
+ "./generators/landing-page": "./src/generators/landing-page.ts",
39
+ "./generators/social": "./src/generators/social.ts",
40
+ "./seo": "./src/seo/index.ts",
41
+ "./seo/optimizer": "./src/seo/optimizer.ts",
42
+ "./types": "./src/types.ts",
43
43
  "./*": "./*"
44
44
  },
45
45
  "publishConfig": {
46
- "access": "public"
46
+ "access": "public",
47
+ "exports": {
48
+ ".": "./dist/index.js",
49
+ "./generators": "./dist/generators/index.js",
50
+ "./generators/blog": "./dist/generators/blog.js",
51
+ "./generators/email": "./dist/generators/email.js",
52
+ "./generators/landing-page": "./dist/generators/landing-page.js",
53
+ "./generators/social": "./dist/generators/social.js",
54
+ "./seo": "./dist/seo/index.js",
55
+ "./seo/optimizer": "./dist/seo/optimizer.js",
56
+ "./types": "./dist/types.js",
57
+ "./*": "./*"
58
+ }
47
59
  }
48
60
  }
@@ -1,15 +0,0 @@
1
- import { ContentBrief, GeneratedContent, GeneratorOptions } from "../types.js";
2
-
3
- //#region src/generators/blog.d.ts
4
- declare class BlogGenerator {
5
- private readonly llm?;
6
- private readonly model?;
7
- private readonly temperature;
8
- constructor(options?: GeneratorOptions);
9
- generate(brief: ContentBrief): Promise<GeneratedContent>;
10
- private generateWithLlm;
11
- private generateDeterministic;
12
- private renderWhyNow;
13
- }
14
- //#endregion
15
- export { BlogGenerator };
@@ -1,18 +0,0 @@
1
- import { EmailCampaignBrief, EmailDraft, GeneratorOptions } from "../types.js";
2
-
3
- //#region src/generators/email.d.ts
4
- declare class EmailCampaignGenerator {
5
- private readonly llm?;
6
- private readonly model?;
7
- private readonly temperature;
8
- constructor(options?: GeneratorOptions);
9
- generate(input: EmailCampaignBrief): Promise<EmailDraft>;
10
- private generateWithLlm;
11
- private generateFallback;
12
- private subjects;
13
- private defaultPreview;
14
- private renderBody;
15
- private variantHook;
16
- }
17
- //#endregion
18
- export { EmailCampaignGenerator };
@@ -1,5 +0,0 @@
1
- import { BlogGenerator } from "./blog.js";
2
- import { EmailCampaignGenerator } from "./email.js";
3
- import { LandingPageCopy, LandingPageGenerator } from "./landing-page.js";
4
- import { SocialPostGenerator } from "./social.js";
5
- export { BlogGenerator, EmailCampaignGenerator, LandingPageCopy, LandingPageGenerator, SocialPostGenerator };
@@ -1,27 +0,0 @@
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[];
15
- }
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;
25
- }
26
- //#endregion
27
- export { LandingPageCopy, LandingPageGenerator };
@@ -1,14 +0,0 @@
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;
12
- }
13
- //#endregion
14
- export { SocialPostGenerator };
package/dist/index.d.ts DELETED
@@ -1,7 +0,0 @@
1
- import { AudienceProfile, ContentBlock, ContentBrief, EmailCampaignBrief, EmailDraft, GeneratedContent, GeneratorOptions, SeoMetadata, SocialPost } from "./types.js";
2
- import { BlogGenerator } from "./generators/blog.js";
3
- import { EmailCampaignGenerator } from "./generators/email.js";
4
- import { LandingPageCopy, LandingPageGenerator } from "./generators/landing-page.js";
5
- import { SocialPostGenerator } from "./generators/social.js";
6
- import { SeoOptimizer } from "./seo/optimizer.js";
7
- export { AudienceProfile, BlogGenerator, ContentBlock, ContentBrief, EmailCampaignBrief, EmailCampaignGenerator, EmailDraft, GeneratedContent, GeneratorOptions, LandingPageCopy, LandingPageGenerator, SeoMetadata, SeoOptimizer, SocialPost, SocialPostGenerator };
@@ -1,2 +0,0 @@
1
- import { SeoOptimizer } from "./optimizer.js";
2
- export { SeoOptimizer };
@@ -1,11 +0,0 @@
1
- import { ContentBrief, SeoMetadata } from "../types.js";
2
-
3
- //#region src/seo/optimizer.d.ts
4
- declare class SeoOptimizer {
5
- optimize(brief: ContentBrief): SeoMetadata;
6
- private keywords;
7
- private slugify;
8
- private schema;
9
- }
10
- //#endregion
11
- export { SeoOptimizer };
package/dist/types.d.ts DELETED
@@ -1,71 +0,0 @@
1
- import { LLMProvider } from "@lssm/lib.contracts/integrations/providers/llm";
2
-
3
- //#region src/types.d.ts
4
- interface AudienceProfile {
5
- role: string;
6
- industry?: string;
7
- region?: string;
8
- maturity?: 'early' | 'scaleup' | 'enterprise';
9
- painPoints?: string[];
10
- }
11
- interface ContentBrief {
12
- title: string;
13
- summary: string;
14
- problems: string[];
15
- solutions: string[];
16
- metrics?: string[];
17
- proofPoints?: string[];
18
- complianceNotes?: string[];
19
- audience: AudienceProfile;
20
- callToAction?: string;
21
- references?: {
22
- label: string;
23
- url: string;
24
- }[];
25
- }
26
- interface ContentBlock {
27
- heading: string;
28
- body: string;
29
- bullets?: string[];
30
- cta?: string;
31
- }
32
- interface GeneratedContent {
33
- title: string;
34
- subtitle?: string;
35
- intro: string;
36
- sections: ContentBlock[];
37
- outro?: string;
38
- }
39
- interface GeneratorOptions {
40
- llm?: LLMProvider;
41
- model?: string;
42
- temperature?: number;
43
- }
44
- interface EmailCampaignBrief {
45
- brief: ContentBrief;
46
- variant: 'announcement' | 'onboarding' | 'nurture';
47
- cadenceDay?: number;
48
- }
49
- interface EmailDraft {
50
- subject: string;
51
- previewText: string;
52
- body: string;
53
- cta: string;
54
- variant: EmailCampaignBrief['variant'];
55
- }
56
- interface SocialPost {
57
- channel: 'twitter' | 'linkedin' | 'threads';
58
- body: string;
59
- hashtags: string[];
60
- cta?: string;
61
- link?: string;
62
- }
63
- interface SeoMetadata {
64
- metaTitle: string;
65
- metaDescription: string;
66
- keywords: string[];
67
- slug: string;
68
- schemaMarkup: Record<string, unknown>;
69
- }
70
- //#endregion
71
- export { AudienceProfile, ContentBlock, ContentBrief, EmailCampaignBrief, EmailDraft, GeneratedContent, GeneratorOptions, SeoMetadata, SocialPost };