@contractspec/example.content-generation 1.44.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.
@@ -0,0 +1,25 @@
1
+ $ tsdown
2
+ ℹ tsdown v0.18.3 powered by rolldown v1.0.0-beta.57
3
+ ℹ config file: /home/runner/work/contractspec/contractspec/packages/examples/content-generation/tsdown.config.js
4
+ ℹ entry: src/example.ts, src/generate.ts, src/index.ts, src/docs/content-generation.docblock.ts, src/docs/index.ts
5
+ ℹ target: esnext
6
+ ℹ tsconfig: tsconfig.json
7
+ ℹ Build start
8
+ ℹ Cleaning 16 files
9
+ ℹ dist/generate.js 1.81 kB │ gzip: 0.90 kB
10
+ ℹ dist/docs/content-generation.docblock.js 1.37 kB │ gzip: 0.69 kB
11
+ ℹ dist/example.js 0.84 kB │ gzip: 0.43 kB
12
+ ℹ dist/index.js 0.20 kB │ gzip: 0.13 kB
13
+ ℹ dist/docs/index.js 0.04 kB │ gzip: 0.06 kB
14
+ ℹ dist/generate.js.map 2.89 kB │ gzip: 1.31 kB
15
+ ℹ dist/docs/content-generation.docblock.js.map 1.86 kB │ gzip: 0.88 kB
16
+ ℹ dist/example.js.map 1.19 kB │ gzip: 0.60 kB
17
+ ℹ dist/example.d.ts.map 0.14 kB │ gzip: 0.13 kB
18
+ ℹ dist/generate.d.ts.map 0.14 kB │ gzip: 0.13 kB
19
+ ℹ dist/example.d.ts 1.07 kB │ gzip: 0.43 kB
20
+ ℹ dist/generate.d.ts 0.18 kB │ gzip: 0.15 kB
21
+ ℹ dist/index.d.ts 0.14 kB │ gzip: 0.10 kB
22
+ ℹ dist/docs/content-generation.docblock.d.ts 0.01 kB │ gzip: 0.03 kB
23
+ ℹ dist/docs/index.d.ts 0.01 kB │ gzip: 0.03 kB
24
+ ℹ 15 files, total: 11.91 kB
25
+ ✔ Build complete in 10058ms
@@ -0,0 +1,26 @@
1
+ $ bun build:types && bun build:bundle
2
+ $ tsc --noEmit
3
+ $ tsdown
4
+ ℹ tsdown v0.18.3 powered by rolldown v1.0.0-beta.57
5
+ ℹ config file: /home/runner/work/contractspec/contractspec/packages/examples/content-generation/tsdown.config.js
6
+ ℹ entry: src/example.ts, src/generate.ts, src/index.ts, src/docs/content-generation.docblock.ts, src/docs/index.ts
7
+ ℹ target: esnext
8
+ ℹ tsconfig: tsconfig.json
9
+ ℹ Build start
10
+ ℹ dist/generate.js 1.81 kB │ gzip: 0.90 kB
11
+ ℹ dist/docs/content-generation.docblock.js 1.37 kB │ gzip: 0.69 kB
12
+ ℹ dist/example.js 0.84 kB │ gzip: 0.43 kB
13
+ ℹ dist/index.js 0.20 kB │ gzip: 0.13 kB
14
+ ℹ dist/docs/index.js 0.04 kB │ gzip: 0.06 kB
15
+ ℹ dist/generate.js.map 2.89 kB │ gzip: 1.31 kB
16
+ ℹ dist/docs/content-generation.docblock.js.map 1.86 kB │ gzip: 0.88 kB
17
+ ℹ dist/example.js.map 1.19 kB │ gzip: 0.60 kB
18
+ ℹ dist/example.d.ts.map 0.14 kB │ gzip: 0.13 kB
19
+ ℹ dist/generate.d.ts.map 0.14 kB │ gzip: 0.13 kB
20
+ ℹ dist/example.d.ts 1.07 kB │ gzip: 0.43 kB
21
+ ℹ dist/generate.d.ts 0.18 kB │ gzip: 0.15 kB
22
+ ℹ dist/index.d.ts 0.14 kB │ gzip: 0.10 kB
23
+ ℹ dist/docs/content-generation.docblock.d.ts 0.01 kB │ gzip: 0.03 kB
24
+ ℹ dist/docs/index.d.ts 0.01 kB │ gzip: 0.03 kB
25
+ ℹ 15 files, total: 11.91 kB
26
+ ✔ Build complete in 14963ms
package/CHANGELOG.md ADDED
@@ -0,0 +1,194 @@
1
+ # @contractspec/example.content-generation
2
+
3
+ ## 1.44.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 5f3a868: chore: isolate branding to contractspec.io
8
+
9
+ ### Patch Changes
10
+
11
+ - Updated dependencies [5f3a868]
12
+ - @contractspec/lib.content-gen@1.44.0
13
+ - @contractspec/lib.contracts@1.44.0
14
+ - @contractspec/lib.logger@1.44.0
15
+ - @contractspec/lib.schema@1.44.0
16
+
17
+ ## 1.43.3
18
+
19
+ ### Patch Changes
20
+
21
+ - 9216062: fix: cross-platform compatibility
22
+ - Updated dependencies [9216062]
23
+ - @contractspec/lib.content-gen@1.43.4
24
+ - @contractspec/lib.contracts@1.43.4
25
+ - @contractspec/lib.logger@1.43.3
26
+ - @contractspec/lib.schema@1.43.3
27
+
28
+ ## 1.43.2
29
+
30
+ ### Patch Changes
31
+
32
+ - 24d9759: improve documentation
33
+ - Updated dependencies [24d9759]
34
+ - @contractspec/lib.content-gen@1.43.3
35
+ - @contractspec/lib.contracts@1.43.3
36
+ - @contractspec/lib.logger@1.43.2
37
+ - @contractspec/lib.schema@1.43.2
38
+
39
+ ## 1.43.2
40
+
41
+ ### Patch Changes
42
+
43
+ - e147271: fix: improve stability
44
+ - Updated dependencies [e147271]
45
+ - @contractspec/lib.content-gen@1.43.2
46
+ - @contractspec/lib.contracts@1.43.2
47
+ - @contractspec/lib.logger@1.43.1
48
+ - @contractspec/lib.schema@1.43.1
49
+
50
+ ## 1.43.1
51
+
52
+ ### Patch Changes
53
+
54
+ - Updated dependencies [f28fdad]
55
+ - @contractspec/lib.contracts@1.43.1
56
+ - @contractspec/lib.content-gen@1.43.1
57
+
58
+ ## 1.43.0
59
+
60
+ ### Minor Changes
61
+
62
+ - 042d072: feat: schema declaration using json schema, including zod
63
+
64
+ ### Patch Changes
65
+
66
+ - Updated dependencies [042d072]
67
+ - @contractspec/lib.content-gen@1.43.0
68
+ - @contractspec/lib.contracts@1.43.0
69
+ - @contractspec/lib.logger@1.43.0
70
+ - @contractspec/lib.schema@1.43.0
71
+
72
+ ## 1.42.10
73
+
74
+ ### Patch Changes
75
+
76
+ - 1e6a0f1: fix: mcp server
77
+ - Updated dependencies [1e6a0f1]
78
+ - @contractspec/lib.content-gen@1.42.10
79
+ - @contractspec/lib.contracts@1.42.10
80
+ - @contractspec/lib.logger@1.42.10
81
+ - @contractspec/lib.schema@1.42.10
82
+
83
+ ## 1.42.9
84
+
85
+ ### Patch Changes
86
+
87
+ - 9281db7: fix ModelRegistry
88
+ - Updated dependencies [9281db7]
89
+ - @contractspec/lib.content-gen@1.42.9
90
+ - @contractspec/lib.contracts@1.42.9
91
+ - @contractspec/lib.logger@1.42.9
92
+ - @contractspec/lib.schema@1.42.9
93
+
94
+ ## 1.42.8
95
+
96
+ ### Patch Changes
97
+
98
+ - e07b5ac: fix
99
+ - Updated dependencies [e07b5ac]
100
+ - @contractspec/lib.content-gen@1.42.8
101
+ - @contractspec/lib.contracts@1.42.8
102
+ - @contractspec/lib.logger@1.42.8
103
+ - @contractspec/lib.schema@1.42.8
104
+
105
+ ## 1.42.7
106
+
107
+ ### Patch Changes
108
+
109
+ - e9b575d: fix release
110
+ - Updated dependencies [e9b575d]
111
+ - @contractspec/lib.content-gen@1.42.7
112
+ - @contractspec/lib.contracts@1.42.7
113
+ - @contractspec/lib.logger@1.42.7
114
+ - @contractspec/lib.schema@1.42.7
115
+
116
+ ## 1.42.6
117
+
118
+ ### Patch Changes
119
+
120
+ - 1500242: fix tooling
121
+ - Updated dependencies [1500242]
122
+ - @contractspec/lib.content-gen@1.42.6
123
+ - @contractspec/lib.contracts@1.42.6
124
+ - @contractspec/lib.logger@1.42.6
125
+ - @contractspec/lib.schema@1.42.6
126
+
127
+ ## 1.42.5
128
+
129
+ ### Patch Changes
130
+
131
+ - 1299719: fix vscode
132
+ - Updated dependencies [1299719]
133
+ - @contractspec/lib.content-gen@1.42.5
134
+ - @contractspec/lib.contracts@1.42.5
135
+ - @contractspec/lib.logger@1.42.5
136
+ - @contractspec/lib.schema@1.42.5
137
+
138
+ ## 1.42.4
139
+
140
+ ### Patch Changes
141
+
142
+ - ac28b99: fix: generate from openapi
143
+ - Updated dependencies [ac28b99]
144
+ - @contractspec/lib.content-gen@1.42.4
145
+ - @contractspec/lib.contracts@1.42.4
146
+ - @contractspec/lib.logger@1.42.4
147
+ - @contractspec/lib.schema@1.42.4
148
+
149
+ ## 1.42.3
150
+
151
+ ### Patch Changes
152
+
153
+ - 3f5d015: fix(tooling): cicd
154
+ - Updated dependencies [3f5d015]
155
+ - @contractspec/lib.content-gen@1.42.3
156
+ - @contractspec/lib.contracts@1.42.3
157
+ - @contractspec/lib.logger@1.42.3
158
+ - @contractspec/lib.schema@1.42.3
159
+
160
+ ## 1.42.2
161
+
162
+ ### Patch Changes
163
+
164
+ - 1f9ac4c: fix
165
+ - Updated dependencies [1f9ac4c]
166
+ - @contractspec/lib.content-gen@1.42.2
167
+ - @contractspec/lib.contracts@1.42.2
168
+ - @contractspec/lib.logger@1.42.2
169
+ - @contractspec/lib.schema@1.42.2
170
+
171
+ ## 1.42.1
172
+
173
+ ### Patch Changes
174
+
175
+ - f043995: Fix release
176
+ - Updated dependencies [f043995]
177
+ - @contractspec/lib.content-gen@1.42.1
178
+ - @contractspec/lib.contracts@1.42.1
179
+ - @contractspec/lib.logger@1.42.1
180
+ - @contractspec/lib.schema@1.42.1
181
+
182
+ ## 1.42.0
183
+
184
+ ### Minor Changes
185
+
186
+ - 8eefd9c: initial release
187
+
188
+ ### Patch Changes
189
+
190
+ - Updated dependencies [8eefd9c]
191
+ - @contractspec/lib.content-gen@1.42.0
192
+ - @contractspec/lib.contracts@1.42.0
193
+ - @contractspec/lib.logger@1.42.0
194
+ - @contractspec/lib.schema@1.42.0
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Chaman Ventures, SASU
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md ADDED
@@ -0,0 +1,14 @@
1
+ # Content Generation Example
2
+
3
+ Website: https://contractspec.io/
4
+
5
+
6
+ Shows how to take a ContractSpec content brief and produce marketing assets with `@contractspec/lib.content-gen`.
7
+
8
+ ## Generates
9
+
10
+ - Long-form blog post
11
+ - Landing page hero copy
12
+ - Email announcement
13
+ - Social posts
14
+ - SEO metadata
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1,29 @@
1
+ import { registerDocBlocks } from "@contractspec/lib.contracts/docs";
2
+
3
+ //#region src/docs/content-generation.docblock.ts
4
+ registerDocBlocks([{
5
+ id: "docs.examples.content-generation",
6
+ title: "Content Generation (example)",
7
+ summary: "Generate a consistent set of marketing assets from a typed ContentBrief (blog, landing hero, email, social, SEO).",
8
+ kind: "reference",
9
+ visibility: "public",
10
+ route: "/docs/examples/content-generation",
11
+ tags: [
12
+ "content",
13
+ "marketing",
14
+ "example"
15
+ ],
16
+ body: `## What this example shows\n- A spec-first-ish interface for content brief inputs (typed, validated).\n- Deterministic orchestration of generators (same input → same structure).\n\n## Outputs\n- Blog intro\n- Landing hero\n- Email subject/body\n- Social post bodies\n- SEO metadata`
17
+ }, {
18
+ id: "docs.examples.content-generation.usage",
19
+ title: "Content Generation — Usage",
20
+ summary: "How to run the example and extend the brief.",
21
+ kind: "usage",
22
+ visibility: "public",
23
+ route: "/docs/examples/content-generation/usage",
24
+ tags: ["content", "usage"],
25
+ body: `## Usage\n- Call \`runContentGenerationExample()\`.\n- Modify the \`ContentBrief\` fields to drive different outputs.\n\n## Guardrails\n- Avoid PII in briefs.\n- Keep output logging structured; no raw \`console.log\` in library code.`
26
+ }]);
27
+
28
+ //#endregion
29
+ //# sourceMappingURL=content-generation.docblock.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"content-generation.docblock.js","names":[],"sources":["../../src/docs/content-generation.docblock.ts"],"sourcesContent":["import type { DocBlock } from '@contractspec/lib.contracts/docs';\nimport { registerDocBlocks } from '@contractspec/lib.contracts/docs';\n\nconst blocks: DocBlock[] = [\n {\n id: 'docs.examples.content-generation',\n title: 'Content Generation (example)',\n summary:\n 'Generate a consistent set of marketing assets from a typed ContentBrief (blog, landing hero, email, social, SEO).',\n kind: 'reference',\n visibility: 'public',\n route: '/docs/examples/content-generation',\n tags: ['content', 'marketing', 'example'],\n body: `## What this example shows\\n- A spec-first-ish interface for content brief inputs (typed, validated).\\n- Deterministic orchestration of generators (same input → same structure).\\n\\n## Outputs\\n- Blog intro\\n- Landing hero\\n- Email subject/body\\n- Social post bodies\\n- SEO metadata`,\n },\n {\n id: 'docs.examples.content-generation.usage',\n title: 'Content Generation — Usage',\n summary: 'How to run the example and extend the brief.',\n kind: 'usage',\n visibility: 'public',\n route: '/docs/examples/content-generation/usage',\n tags: ['content', 'usage'],\n body: `## Usage\\n- Call \\`runContentGenerationExample()\\`.\\n- Modify the \\`ContentBrief\\` fields to drive different outputs.\\n\\n## Guardrails\\n- Avoid PII in briefs.\\n- Keep output logging structured; no raw \\`console.log\\` in library code.`,\n },\n];\n\nregisterDocBlocks(blocks);\n"],"mappings":";;;AA2BA,kBAxB2B,CACzB;CACE,IAAI;CACJ,OAAO;CACP,SACE;CACF,MAAM;CACN,YAAY;CACZ,OAAO;CACP,MAAM;EAAC;EAAW;EAAa;EAAU;CACzC,MAAM;CACP,EACD;CACE,IAAI;CACJ,OAAO;CACP,SAAS;CACT,MAAM;CACN,YAAY;CACZ,OAAO;CACP,MAAM,CAAC,WAAW,QAAQ;CAC1B,MAAM;CACP,CACF,CAEwB"}
@@ -0,0 +1 @@
1
+ export { };
@@ -0,0 +1 @@
1
+ import "./content-generation.docblock.js";
@@ -0,0 +1,34 @@
1
+ //#region src/example.d.ts
2
+ declare const example: {
3
+ readonly id: "content-generation";
4
+ readonly title: "Content Generation";
5
+ readonly summary: "Generate blog/landing/email/social/SEO assets from a typed ContentBrief using @contractspec/lib.content-gen.";
6
+ readonly tags: readonly ["content", "marketing", "generation", "ai"];
7
+ readonly kind: "script";
8
+ readonly visibility: "public";
9
+ readonly docs: {
10
+ readonly rootDocId: "docs.examples.content-generation";
11
+ readonly usageDocId: "docs.examples.content-generation.usage";
12
+ };
13
+ readonly entrypoints: {
14
+ readonly packageName: "@contractspec/example.content-generation";
15
+ readonly docs: "./docs";
16
+ };
17
+ readonly surfaces: {
18
+ readonly templates: true;
19
+ readonly sandbox: {
20
+ readonly enabled: true;
21
+ readonly modes: readonly ["markdown"];
22
+ };
23
+ readonly studio: {
24
+ readonly enabled: true;
25
+ readonly installable: true;
26
+ };
27
+ readonly mcp: {
28
+ readonly enabled: true;
29
+ };
30
+ };
31
+ };
32
+ //#endregion
33
+ export { example as default };
34
+ //# sourceMappingURL=example.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"example.d.ts","names":[],"sources":["../src/example.ts"],"sourcesContent":[],"mappings":";cAAM;EAAA,SAAA,EAsBI,EAAA,oBAAA"}
@@ -0,0 +1,39 @@
1
+ //#region src/example.ts
2
+ const example = {
3
+ id: "content-generation",
4
+ title: "Content Generation",
5
+ summary: "Generate blog/landing/email/social/SEO assets from a typed ContentBrief using @contractspec/lib.content-gen.",
6
+ tags: [
7
+ "content",
8
+ "marketing",
9
+ "generation",
10
+ "ai"
11
+ ],
12
+ kind: "script",
13
+ visibility: "public",
14
+ docs: {
15
+ rootDocId: "docs.examples.content-generation",
16
+ usageDocId: "docs.examples.content-generation.usage"
17
+ },
18
+ entrypoints: {
19
+ packageName: "@contractspec/example.content-generation",
20
+ docs: "./docs"
21
+ },
22
+ surfaces: {
23
+ templates: true,
24
+ sandbox: {
25
+ enabled: true,
26
+ modes: ["markdown"]
27
+ },
28
+ studio: {
29
+ enabled: true,
30
+ installable: true
31
+ },
32
+ mcp: { enabled: true }
33
+ }
34
+ };
35
+ var example_default = example;
36
+
37
+ //#endregion
38
+ export { example_default as default };
39
+ //# sourceMappingURL=example.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"example.js","names":[],"sources":["../src/example.ts"],"sourcesContent":["const example = {\n id: 'content-generation',\n title: 'Content Generation',\n summary:\n 'Generate blog/landing/email/social/SEO assets from a typed ContentBrief using @contractspec/lib.content-gen.',\n tags: ['content', 'marketing', 'generation', 'ai'],\n kind: 'script',\n visibility: 'public',\n docs: {\n rootDocId: 'docs.examples.content-generation',\n usageDocId: 'docs.examples.content-generation.usage',\n },\n entrypoints: {\n packageName: '@contractspec/example.content-generation',\n docs: './docs',\n },\n surfaces: {\n templates: true,\n sandbox: { enabled: true, modes: ['markdown'] },\n studio: { enabled: true, installable: true },\n mcp: { enabled: true },\n },\n} as const;\n\nexport default example;\n"],"mappings":";AAAA,MAAM,UAAU;CACd,IAAI;CACJ,OAAO;CACP,SACE;CACF,MAAM;EAAC;EAAW;EAAa;EAAc;EAAK;CAClD,MAAM;CACN,YAAY;CACZ,MAAM;EACJ,WAAW;EACX,YAAY;EACb;CACD,aAAa;EACX,aAAa;EACb,MAAM;EACP;CACD,UAAU;EACR,WAAW;EACX,SAAS;GAAE,SAAS;GAAM,OAAO,CAAC,WAAW;GAAE;EAC/C,QAAQ;GAAE,SAAS;GAAM,aAAa;GAAM;EAC5C,KAAK,EAAE,SAAS,MAAM;EACvB;CACF;AAED,sBAAe"}
@@ -0,0 +1,5 @@
1
+ //#region src/generate.d.ts
2
+ declare function runContentGenerationExample(): Promise<void>;
3
+ //#endregion
4
+ export { runContentGenerationExample };
5
+ //# sourceMappingURL=generate.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate.d.ts","names":[],"sources":["../src/generate.ts"],"sourcesContent":[],"mappings":";iBAkBsB,2BAAA,CAAA,GAA+B"}
@@ -0,0 +1,48 @@
1
+ import { BlogGenerator, EmailCampaignGenerator, LandingPageGenerator, SocialPostGenerator } from "@contractspec/lib.content-gen/generators";
2
+ import { SeoOptimizer } from "@contractspec/lib.content-gen/seo";
3
+ import { LogLevel, Logger } from "@contractspec/lib.logger";
4
+
5
+ //#region src/generate.ts
6
+ const logger = new Logger({
7
+ level: process.env.NODE_ENV === "production" ? LogLevel.INFO : LogLevel.DEBUG,
8
+ environment: process.env.NODE_ENV || "development",
9
+ enableColors: process.env.NODE_ENV !== "production"
10
+ });
11
+ async function runContentGenerationExample() {
12
+ const brief = {
13
+ title: "AI-Native Operations Copilot",
14
+ summary: "Automates support resolutions, growth playbooks, and DevOps rituals.",
15
+ problems: ["Support queues pile up after hours", "Growth teams lack fresh experiments"],
16
+ solutions: [
17
+ "Stateful AI agents grounded in your knowledge spaces",
18
+ "CI-safe approval workflows for human review",
19
+ "Analytics + experimentation stack built into ContractSpec"
20
+ ],
21
+ metrics: ["80% auto-resolution rate", "10+ experiments shipped weekly"],
22
+ audience: {
23
+ role: "COO",
24
+ industry: "Fintech",
25
+ maturity: "scaleup"
26
+ },
27
+ callToAction: "Book a 15‑minute pilot run"
28
+ };
29
+ const blog = await new BlogGenerator().generate(brief);
30
+ const landing = await new LandingPageGenerator().generate(brief);
31
+ const email = await new EmailCampaignGenerator().generate({
32
+ brief,
33
+ variant: "announcement"
34
+ });
35
+ const social = await new SocialPostGenerator().generate(brief);
36
+ const seo = new SeoOptimizer().optimize(brief);
37
+ logger.info("Generated content assets", {
38
+ blogIntro: blog.intro,
39
+ landingHero: landing.hero,
40
+ emailSubject: email.subject,
41
+ socialPosts: social.map((post) => post.body),
42
+ seo
43
+ });
44
+ }
45
+
46
+ //#endregion
47
+ export { runContentGenerationExample };
48
+ //# sourceMappingURL=generate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate.js","names":["brief: ContentBrief"],"sources":["../src/generate.ts"],"sourcesContent":["import {\n BlogGenerator,\n EmailCampaignGenerator,\n LandingPageGenerator,\n SocialPostGenerator,\n} from '@contractspec/lib.content-gen/generators';\nimport { SeoOptimizer } from '@contractspec/lib.content-gen/seo';\nimport type { ContentBrief } from '@contractspec/lib.content-gen';\nimport { Logger, LogLevel } from '@contractspec/lib.logger';\nimport type { LoggerConfig } from '@contractspec/lib.logger/types';\n\nconst logger = new Logger({\n level: process.env.NODE_ENV === 'production' ? LogLevel.INFO : LogLevel.DEBUG,\n environment:\n (process.env.NODE_ENV as LoggerConfig['environment']) || 'development',\n enableColors: process.env.NODE_ENV !== 'production',\n});\n\nexport async function runContentGenerationExample(): Promise<void> {\n const brief: ContentBrief = {\n title: 'AI-Native Operations Copilot',\n summary:\n 'Automates support resolutions, growth playbooks, and DevOps rituals.',\n problems: [\n 'Support queues pile up after hours',\n 'Growth teams lack fresh experiments',\n ],\n solutions: [\n 'Stateful AI agents grounded in your knowledge spaces',\n 'CI-safe approval workflows for human review',\n 'Analytics + experimentation stack built into ContractSpec',\n ],\n metrics: ['80% auto-resolution rate', '10+ experiments shipped weekly'],\n audience: { role: 'COO', industry: 'Fintech', maturity: 'scaleup' },\n callToAction: 'Book a 15‑minute pilot run',\n };\n\n const blog = await new BlogGenerator().generate(brief);\n const landing = await new LandingPageGenerator().generate(brief);\n const email = await new EmailCampaignGenerator().generate({\n brief,\n variant: 'announcement',\n });\n const social = await new SocialPostGenerator().generate(brief);\n const seo = new SeoOptimizer().optimize(brief);\n\n logger.info('Generated content assets', {\n blogIntro: blog.intro,\n landingHero: landing.hero,\n emailSubject: email.subject,\n socialPosts: social.map((post) => post.body),\n seo,\n });\n}\n"],"mappings":";;;;;AAWA,MAAM,SAAS,IAAI,OAAO;CACxB,OAAO,QAAQ,IAAI,aAAa,eAAe,SAAS,OAAO,SAAS;CACxE,aACG,QAAQ,IAAI,YAA4C;CAC3D,cAAc,QAAQ,IAAI,aAAa;CACxC,CAAC;AAEF,eAAsB,8BAA6C;CACjE,MAAMA,QAAsB;EAC1B,OAAO;EACP,SACE;EACF,UAAU,CACR,sCACA,sCACD;EACD,WAAW;GACT;GACA;GACA;GACD;EACD,SAAS,CAAC,4BAA4B,iCAAiC;EACvE,UAAU;GAAE,MAAM;GAAO,UAAU;GAAW,UAAU;GAAW;EACnE,cAAc;EACf;CAED,MAAM,OAAO,MAAM,IAAI,eAAe,CAAC,SAAS,MAAM;CACtD,MAAM,UAAU,MAAM,IAAI,sBAAsB,CAAC,SAAS,MAAM;CAChE,MAAM,QAAQ,MAAM,IAAI,wBAAwB,CAAC,SAAS;EACxD;EACA,SAAS;EACV,CAAC;CACF,MAAM,SAAS,MAAM,IAAI,qBAAqB,CAAC,SAAS,MAAM;CAC9D,MAAM,MAAM,IAAI,cAAc,CAAC,SAAS,MAAM;AAE9C,QAAO,KAAK,4BAA4B;EACtC,WAAW,KAAK;EAChB,aAAa,QAAQ;EACrB,cAAc,MAAM;EACpB,aAAa,OAAO,KAAK,SAAS,KAAK,KAAK;EAC5C;EACD,CAAC"}
@@ -0,0 +1,3 @@
1
+ import example from "./example.js";
2
+ import { runContentGenerationExample } from "./generate.js";
3
+ export { example, runContentGenerationExample };
package/dist/index.js ADDED
@@ -0,0 +1,5 @@
1
+ import example_default from "./example.js";
2
+ import { runContentGenerationExample } from "./generate.js";
3
+ import "./docs/index.js";
4
+
5
+ export { example_default as example, runContentGenerationExample };
package/package.json ADDED
@@ -0,0 +1,61 @@
1
+ {
2
+ "name": "@contractspec/example.content-generation",
3
+ "version": "1.44.0",
4
+ "description": "Content generation example using @contractspec/lib.content-gen.",
5
+ "type": "module",
6
+ "main": "./dist/index.js",
7
+ "types": "./dist/index.d.ts",
8
+ "exports": {
9
+ ".": "./dist/index.js",
10
+ "./docs": "./dist/docs/index.js",
11
+ "./docs/content-generation.docblock": "./dist/docs/content-generation.docblock.js",
12
+ "./example": "./dist/example.js",
13
+ "./generate": "./dist/generate.js",
14
+ "./*": "./*"
15
+ },
16
+ "scripts": {
17
+ "publish:pkg": "bun publish --tolerate-republish --ignore-scripts --verbose",
18
+ "publish:pkg:canary": "bun publish:pkg --tag canary",
19
+ "build": "bun build:types && bun build:bundle",
20
+ "build:bundle": "tsdown",
21
+ "build:types": "tsc --noEmit",
22
+ "dev": "bun build:bundle --watch",
23
+ "clean": "rimraf dist .turbo",
24
+ "lint": "bun lint:fix",
25
+ "lint:fix": "eslint src --fix",
26
+ "lint:check": "eslint src",
27
+ "test": "bun test"
28
+ },
29
+ "dependencies": {
30
+ "@contractspec/lib.schema": "1.44.0",
31
+ "@contractspec/lib.contracts": "1.44.0",
32
+ "@contractspec/lib.content-gen": "1.44.0",
33
+ "@contractspec/lib.logger": "1.44.0"
34
+ },
35
+ "devDependencies": {
36
+ "@contractspec/tool.tsdown": "1.44.0",
37
+ "@contractspec/tool.typescript": "1.44.0",
38
+ "tsdown": "^0.18.3",
39
+ "typescript": "^5.9.3"
40
+ },
41
+ "publishConfig": {
42
+ "access": "public",
43
+ "exports": {
44
+ ".": "./dist/index.js",
45
+ "./docs": "./dist/docs/index.js",
46
+ "./docs/content-generation.docblock": "./dist/docs/content-generation.docblock.js",
47
+ "./example": "./dist/example.js",
48
+ "./generate": "./dist/generate.js",
49
+ "./*": "./*"
50
+ },
51
+ "registry": "https://registry.npmjs.org/"
52
+ },
53
+ "module": "./dist/index.js",
54
+ "license": "MIT",
55
+ "repository": {
56
+ "type": "git",
57
+ "url": "https://github.com/lssm-tech/contractspec.git",
58
+ "directory": "packages/examples/content-generation"
59
+ },
60
+ "homepage": "https://contractspec.io"
61
+ }
@@ -0,0 +1,28 @@
1
+ import type { DocBlock } from '@contractspec/lib.contracts/docs';
2
+ import { registerDocBlocks } from '@contractspec/lib.contracts/docs';
3
+
4
+ const blocks: DocBlock[] = [
5
+ {
6
+ id: 'docs.examples.content-generation',
7
+ title: 'Content Generation (example)',
8
+ summary:
9
+ 'Generate a consistent set of marketing assets from a typed ContentBrief (blog, landing hero, email, social, SEO).',
10
+ kind: 'reference',
11
+ visibility: 'public',
12
+ route: '/docs/examples/content-generation',
13
+ tags: ['content', 'marketing', 'example'],
14
+ body: `## What this example shows\n- A spec-first-ish interface for content brief inputs (typed, validated).\n- Deterministic orchestration of generators (same input → same structure).\n\n## Outputs\n- Blog intro\n- Landing hero\n- Email subject/body\n- Social post bodies\n- SEO metadata`,
15
+ },
16
+ {
17
+ id: 'docs.examples.content-generation.usage',
18
+ title: 'Content Generation — Usage',
19
+ summary: 'How to run the example and extend the brief.',
20
+ kind: 'usage',
21
+ visibility: 'public',
22
+ route: '/docs/examples/content-generation/usage',
23
+ tags: ['content', 'usage'],
24
+ body: `## Usage\n- Call \`runContentGenerationExample()\`.\n- Modify the \`ContentBrief\` fields to drive different outputs.\n\n## Guardrails\n- Avoid PII in briefs.\n- Keep output logging structured; no raw \`console.log\` in library code.`,
25
+ },
26
+ ];
27
+
28
+ registerDocBlocks(blocks);
@@ -0,0 +1 @@
1
+ import './content-generation.docblock';
package/src/example.ts ADDED
@@ -0,0 +1,25 @@
1
+ const example = {
2
+ id: 'content-generation',
3
+ title: 'Content Generation',
4
+ summary:
5
+ 'Generate blog/landing/email/social/SEO assets from a typed ContentBrief using @contractspec/lib.content-gen.',
6
+ tags: ['content', 'marketing', 'generation', 'ai'],
7
+ kind: 'script',
8
+ visibility: 'public',
9
+ docs: {
10
+ rootDocId: 'docs.examples.content-generation',
11
+ usageDocId: 'docs.examples.content-generation.usage',
12
+ },
13
+ entrypoints: {
14
+ packageName: '@contractspec/example.content-generation',
15
+ docs: './docs',
16
+ },
17
+ surfaces: {
18
+ templates: true,
19
+ sandbox: { enabled: true, modes: ['markdown'] },
20
+ studio: { enabled: true, installable: true },
21
+ mcp: { enabled: true },
22
+ },
23
+ } as const;
24
+
25
+ export default example;