@contractspec/example.content-generation 3.7.17 → 3.7.18
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/.turbo/turbo-build.log +21 -21
- package/CHANGELOG.md +12 -0
- package/dist/browser/content-generation.feature.js +1 -21
- package/dist/browser/docs/content-generation.docblock.js +2 -32
- package/dist/browser/docs/index.js +2 -32
- package/dist/browser/example.js +1 -33
- package/dist/browser/generate.js +1 -50
- package/dist/browser/index.js +2 -134
- package/dist/content-generation.feature.js +1 -21
- package/dist/docs/content-generation.docblock.js +2 -32
- package/dist/docs/index.js +2 -32
- package/dist/example.js +1 -33
- package/dist/generate.js +1 -50
- package/dist/index.js +2 -134
- package/dist/node/content-generation.feature.js +1 -21
- package/dist/node/docs/content-generation.docblock.js +2 -32
- package/dist/node/docs/index.js +2 -32
- package/dist/node/example.js +1 -33
- package/dist/node/generate.js +1 -50
- package/dist/node/index.js +2 -134
- package/package.json +6 -6
package/.turbo/turbo-build.log
CHANGED
|
@@ -2,33 +2,33 @@ $ contractspec-bun-build prebuild
|
|
|
2
2
|
$ bun run build:bundle && bun run build:types
|
|
3
3
|
$ contractspec-bun-build transpile
|
|
4
4
|
[contractspec-bun-build] transpile target=bun root=src entries=6 noBundle=false
|
|
5
|
-
Bundled 6 modules in
|
|
5
|
+
Bundled 6 modules in 28ms
|
|
6
6
|
|
|
7
|
-
./content-generation.feature.js
|
|
8
|
-
./index.js
|
|
9
|
-
docs/index.js 1.
|
|
10
|
-
docs/content-generation.docblock.js 1.
|
|
11
|
-
./example.js 0.
|
|
12
|
-
./generate.js 1.
|
|
7
|
+
./content-generation.feature.js 471 bytes (entry point)
|
|
8
|
+
./index.js 3.63 KB (entry point)
|
|
9
|
+
docs/index.js 1.18 KB (entry point)
|
|
10
|
+
docs/content-generation.docblock.js 1.18 KB (entry point)
|
|
11
|
+
./example.js 0.74 KB (entry point)
|
|
12
|
+
./generate.js 1.28 KB (entry point)
|
|
13
13
|
|
|
14
14
|
[contractspec-bun-build] transpile target=node root=src entries=6 noBundle=false
|
|
15
|
-
Bundled 6 modules in
|
|
15
|
+
Bundled 6 modules in 35ms
|
|
16
16
|
|
|
17
|
-
./content-generation.feature.js
|
|
18
|
-
./index.js
|
|
19
|
-
docs/index.js 1.
|
|
20
|
-
docs/content-generation.docblock.js 1.
|
|
21
|
-
./example.js 0.
|
|
22
|
-
./generate.js 1.
|
|
17
|
+
./content-generation.feature.js 463 bytes (entry point)
|
|
18
|
+
./index.js 3.61 KB (entry point)
|
|
19
|
+
docs/index.js 1.17 KB (entry point)
|
|
20
|
+
docs/content-generation.docblock.js 1.17 KB (entry point)
|
|
21
|
+
./example.js 0.74 KB (entry point)
|
|
22
|
+
./generate.js 1.27 KB (entry point)
|
|
23
23
|
|
|
24
24
|
[contractspec-bun-build] transpile target=browser root=src entries=6 noBundle=false
|
|
25
|
-
Bundled 6 modules in
|
|
25
|
+
Bundled 6 modules in 26ms
|
|
26
26
|
|
|
27
|
-
./content-generation.feature.js
|
|
28
|
-
./index.js
|
|
29
|
-
docs/index.js 1.
|
|
30
|
-
docs/content-generation.docblock.js 1.
|
|
31
|
-
./example.js 0.
|
|
32
|
-
./generate.js 1.
|
|
27
|
+
./content-generation.feature.js 463 bytes (entry point)
|
|
28
|
+
./index.js 3.61 KB (entry point)
|
|
29
|
+
docs/index.js 1.17 KB (entry point)
|
|
30
|
+
docs/content-generation.docblock.js 1.17 KB (entry point)
|
|
31
|
+
./example.js 0.74 KB (entry point)
|
|
32
|
+
./generate.js 1.27 KB (entry point)
|
|
33
33
|
|
|
34
34
|
$ contractspec-bun-build types
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @contractspec/example.content-generation
|
|
2
2
|
|
|
3
|
+
## 3.7.18
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- chore: auto-bump internal dependents
|
|
8
|
+
- Updated dependencies because of chore: auto-bump internal dependents
|
|
9
|
+
- Updated dependencies because of Introduce the Builder v3 control plane as a governed authoring layer over external execution providers.
|
|
10
|
+
- Updated dependencies because of Implement ContractSpec Connect as a first-class spec, runtime, and CLI workflow.
|
|
11
|
+
- @contractspec/lib.content-gen@3.7.18
|
|
12
|
+
- @contractspec/lib.contracts-spec@5.2.0
|
|
13
|
+
- @contractspec/lib.logger@3.7.13
|
|
14
|
+
|
|
3
15
|
## 3.7.17
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
|
@@ -1,21 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { defineFeature } from "@contractspec/lib.contracts-spec";
|
|
3
|
-
var ContentGenerationFeature = defineFeature({
|
|
4
|
-
meta: {
|
|
5
|
-
key: "content-generation",
|
|
6
|
-
version: "1.0.0",
|
|
7
|
-
title: "Content Generation",
|
|
8
|
-
description: "AI content generation for blog posts, landing pages, emails, and social media",
|
|
9
|
-
domain: "content",
|
|
10
|
-
owners: ["@examples"],
|
|
11
|
-
tags: ["content", "ai", "generation"],
|
|
12
|
-
stability: "experimental"
|
|
13
|
-
},
|
|
14
|
-
docs: [
|
|
15
|
-
"docs.examples.content-generation",
|
|
16
|
-
"docs.examples.content-generation.usage"
|
|
17
|
-
]
|
|
18
|
-
});
|
|
19
|
-
export {
|
|
20
|
-
ContentGenerationFeature
|
|
21
|
-
};
|
|
1
|
+
import{defineFeature as g}from"@contractspec/lib.contracts-spec";var j=g({meta:{key:"content-generation",version:"1.0.0",title:"Content Generation",description:"AI content generation for blog posts, landing pages, emails, and social media",domain:"content",owners:["@examples"],tags:["content","ai","generation"],stability:"experimental"},docs:["docs.examples.content-generation","docs.examples.content-generation.usage"]});export{j as ContentGenerationFeature};
|
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { registerDocBlocks } from "@contractspec/lib.contracts-spec/docs";
|
|
3
|
-
var blocks = [
|
|
4
|
-
{
|
|
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: ["content", "marketing", "example"],
|
|
12
|
-
body: `## What this example shows
|
|
1
|
+
import{registerDocBlocks as f}from"@contractspec/lib.contracts-spec/docs";var h=[{id:"docs.examples.content-generation",title:"Content Generation (example)",summary:"Generate a consistent set of marketing assets from a typed ContentBrief (blog, landing hero, email, social, SEO).",kind:"reference",visibility:"public",route:"/docs/examples/content-generation",tags:["content","marketing","example"],body:`## What this example shows
|
|
13
2
|
- A spec-first-ish interface for content brief inputs (typed, validated).
|
|
14
3
|
- Deterministic orchestration of generators (same input → same structure).
|
|
15
4
|
|
|
@@ -18,23 +7,4 @@ var blocks = [
|
|
|
18
7
|
- Landing hero
|
|
19
8
|
- Email subject/body
|
|
20
9
|
- Social post bodies
|
|
21
|
-
- SEO metadata`
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
id: "docs.examples.content-generation.usage",
|
|
25
|
-
title: "Content Generation — Usage",
|
|
26
|
-
summary: "How to run the example and extend the brief.",
|
|
27
|
-
kind: "usage",
|
|
28
|
-
visibility: "public",
|
|
29
|
-
route: "/docs/examples/content-generation/usage",
|
|
30
|
-
tags: ["content", "usage"],
|
|
31
|
-
body: `## Usage
|
|
32
|
-
- Call \`runContentGenerationExample()\`.
|
|
33
|
-
- Modify the \`ContentBrief\` fields to drive different outputs.
|
|
34
|
-
|
|
35
|
-
## Guardrails
|
|
36
|
-
- Avoid PII in briefs.
|
|
37
|
-
- Keep output logging structured; no raw \`console.log\` in library code.`
|
|
38
|
-
}
|
|
39
|
-
];
|
|
40
|
-
registerDocBlocks(blocks);
|
|
10
|
+
- SEO metadata`},{id:"docs.examples.content-generation.usage",title:"Content Generation — Usage",summary:"How to run the example and extend the brief.",kind:"usage",visibility:"public",route:"/docs/examples/content-generation/usage",tags:["content","usage"],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."}];f(h);
|
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { registerDocBlocks } from "@contractspec/lib.contracts-spec/docs";
|
|
3
|
-
var blocks = [
|
|
4
|
-
{
|
|
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: ["content", "marketing", "example"],
|
|
12
|
-
body: `## What this example shows
|
|
1
|
+
import{registerDocBlocks as m}from"@contractspec/lib.contracts-spec/docs";var f=[{id:"docs.examples.content-generation",title:"Content Generation (example)",summary:"Generate a consistent set of marketing assets from a typed ContentBrief (blog, landing hero, email, social, SEO).",kind:"reference",visibility:"public",route:"/docs/examples/content-generation",tags:["content","marketing","example"],body:`## What this example shows
|
|
13
2
|
- A spec-first-ish interface for content brief inputs (typed, validated).
|
|
14
3
|
- Deterministic orchestration of generators (same input → same structure).
|
|
15
4
|
|
|
@@ -18,23 +7,4 @@ var blocks = [
|
|
|
18
7
|
- Landing hero
|
|
19
8
|
- Email subject/body
|
|
20
9
|
- Social post bodies
|
|
21
|
-
- SEO metadata`
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
id: "docs.examples.content-generation.usage",
|
|
25
|
-
title: "Content Generation — Usage",
|
|
26
|
-
summary: "How to run the example and extend the brief.",
|
|
27
|
-
kind: "usage",
|
|
28
|
-
visibility: "public",
|
|
29
|
-
route: "/docs/examples/content-generation/usage",
|
|
30
|
-
tags: ["content", "usage"],
|
|
31
|
-
body: `## Usage
|
|
32
|
-
- Call \`runContentGenerationExample()\`.
|
|
33
|
-
- Modify the \`ContentBrief\` fields to drive different outputs.
|
|
34
|
-
|
|
35
|
-
## Guardrails
|
|
36
|
-
- Avoid PII in briefs.
|
|
37
|
-
- Keep output logging structured; no raw \`console.log\` in library code.`
|
|
38
|
-
}
|
|
39
|
-
];
|
|
40
|
-
registerDocBlocks(blocks);
|
|
10
|
+
- SEO metadata`},{id:"docs.examples.content-generation.usage",title:"Content Generation — Usage",summary:"How to run the example and extend the brief.",kind:"usage",visibility:"public",route:"/docs/examples/content-generation/usage",tags:["content","usage"],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."}];m(f);
|
package/dist/browser/example.js
CHANGED
|
@@ -1,33 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { defineExample } from "@contractspec/lib.contracts-spec";
|
|
3
|
-
var example = defineExample({
|
|
4
|
-
meta: {
|
|
5
|
-
key: "content-generation",
|
|
6
|
-
version: "1.0.0",
|
|
7
|
-
title: "Content Generation",
|
|
8
|
-
description: "Generate blog/landing/email/social/SEO assets from a typed ContentBrief using @contractspec/lib.content-gen.",
|
|
9
|
-
kind: "script",
|
|
10
|
-
visibility: "public",
|
|
11
|
-
stability: "experimental",
|
|
12
|
-
owners: ["@platform.core"],
|
|
13
|
-
tags: ["content", "marketing", "generation", "ai"]
|
|
14
|
-
},
|
|
15
|
-
docs: {
|
|
16
|
-
rootDocId: "docs.examples.content-generation",
|
|
17
|
-
usageDocId: "docs.examples.content-generation.usage"
|
|
18
|
-
},
|
|
19
|
-
entrypoints: {
|
|
20
|
-
packageName: "@contractspec/example.content-generation",
|
|
21
|
-
docs: "./docs"
|
|
22
|
-
},
|
|
23
|
-
surfaces: {
|
|
24
|
-
templates: true,
|
|
25
|
-
sandbox: { enabled: true, modes: ["markdown"] },
|
|
26
|
-
studio: { enabled: true, installable: true },
|
|
27
|
-
mcp: { enabled: true }
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
var example_default = example;
|
|
31
|
-
export {
|
|
32
|
-
example_default as default
|
|
33
|
-
};
|
|
1
|
+
import{defineExample as g}from"@contractspec/lib.contracts-spec";var h=g({meta:{key:"content-generation",version:"1.0.0",title:"Content Generation",description:"Generate blog/landing/email/social/SEO assets from a typed ContentBrief using @contractspec/lib.content-gen.",kind:"script",visibility:"public",stability:"experimental",owners:["@platform.core"],tags:["content","marketing","generation","ai"]},docs:{rootDocId:"docs.examples.content-generation",usageDocId:"docs.examples.content-generation.usage"},entrypoints:{packageName:"@contractspec/example.content-generation",docs:"./docs"},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["markdown"]},studio:{enabled:!0,installable:!0},mcp:{enabled:!0}}}),q=h;export{q as default};
|
package/dist/browser/generate.js
CHANGED
|
@@ -1,50 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
BlogGenerator,
|
|
4
|
-
EmailCampaignGenerator,
|
|
5
|
-
LandingPageGenerator,
|
|
6
|
-
SocialPostGenerator
|
|
7
|
-
} from "@contractspec/lib.content-gen/generators";
|
|
8
|
-
import { SeoOptimizer } from "@contractspec/lib.content-gen/seo";
|
|
9
|
-
import { Logger, LogLevel } from "@contractspec/lib.logger";
|
|
10
|
-
var logger = new Logger({
|
|
11
|
-
level: LogLevel.INFO,
|
|
12
|
-
environment: "production",
|
|
13
|
-
enableColors: false
|
|
14
|
-
});
|
|
15
|
-
async function runContentGenerationExample() {
|
|
16
|
-
const brief = {
|
|
17
|
-
title: "AI-Native Operations Copilot",
|
|
18
|
-
summary: "Automates support resolutions, growth playbooks, and DevOps rituals.",
|
|
19
|
-
problems: [
|
|
20
|
-
"Support queues pile up after hours",
|
|
21
|
-
"Growth teams lack fresh experiments"
|
|
22
|
-
],
|
|
23
|
-
solutions: [
|
|
24
|
-
"Stateful AI agents grounded in your knowledge spaces",
|
|
25
|
-
"CI-safe approval workflows for human review",
|
|
26
|
-
"Analytics + experimentation stack built into ContractSpec"
|
|
27
|
-
],
|
|
28
|
-
metrics: ["80% auto-resolution rate", "10+ experiments shipped weekly"],
|
|
29
|
-
audience: { role: "COO", industry: "Fintech", maturity: "scaleup" },
|
|
30
|
-
callToAction: "Book a 15‑minute pilot run"
|
|
31
|
-
};
|
|
32
|
-
const blog = await new BlogGenerator().generate(brief);
|
|
33
|
-
const landing = await new LandingPageGenerator().generate(brief);
|
|
34
|
-
const email = await new EmailCampaignGenerator().generate({
|
|
35
|
-
brief,
|
|
36
|
-
variant: "announcement"
|
|
37
|
-
});
|
|
38
|
-
const social = await new SocialPostGenerator().generate(brief);
|
|
39
|
-
const seo = new SeoOptimizer().optimize(brief);
|
|
40
|
-
logger.info("Generated content assets", {
|
|
41
|
-
blogIntro: blog.intro,
|
|
42
|
-
landingHero: landing.hero,
|
|
43
|
-
emailSubject: email.subject,
|
|
44
|
-
socialPosts: social.map((post) => post.body),
|
|
45
|
-
seo
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
export {
|
|
49
|
-
runContentGenerationExample
|
|
50
|
-
};
|
|
1
|
+
import{BlogGenerator as y,EmailCampaignGenerator as A,LandingPageGenerator as D,SocialPostGenerator as F}from"@contractspec/lib.content-gen/generators";import{SeoOptimizer as H}from"@contractspec/lib.content-gen/seo";import{Logger as I,LogLevel as J}from"@contractspec/lib.logger";var K=new I({level:J.INFO,environment:"production",enableColors:!1});async function R(){let h={title:"AI-Native Operations Copilot",summary:"Automates support resolutions, growth playbooks, and DevOps rituals.",problems:["Support queues pile up after hours","Growth teams lack fresh experiments"],solutions:["Stateful AI agents grounded in your knowledge spaces","CI-safe approval workflows for human review","Analytics + experimentation stack built into ContractSpec"],metrics:["80% auto-resolution rate","10+ experiments shipped weekly"],audience:{role:"COO",industry:"Fintech",maturity:"scaleup"},callToAction:"Book a 15‑minute pilot run"},j=await new y().generate(h),k=await new D().generate(h),q=await new A().generate({brief:h,variant:"announcement"}),u=await new F().generate(h),w=new H().optimize(h);K.info("Generated content assets",{blogIntro:j.intro,landingHero:k.hero,emailSubject:q.subject,socialPosts:u.map((x)=>x.body),seo:w})}export{R as runContentGenerationExample};
|
package/dist/browser/index.js
CHANGED
|
@@ -1,34 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { defineFeature } from "@contractspec/lib.contracts-spec";
|
|
3
|
-
var ContentGenerationFeature = defineFeature({
|
|
4
|
-
meta: {
|
|
5
|
-
key: "content-generation",
|
|
6
|
-
version: "1.0.0",
|
|
7
|
-
title: "Content Generation",
|
|
8
|
-
description: "AI content generation for blog posts, landing pages, emails, and social media",
|
|
9
|
-
domain: "content",
|
|
10
|
-
owners: ["@examples"],
|
|
11
|
-
tags: ["content", "ai", "generation"],
|
|
12
|
-
stability: "experimental"
|
|
13
|
-
},
|
|
14
|
-
docs: [
|
|
15
|
-
"docs.examples.content-generation",
|
|
16
|
-
"docs.examples.content-generation.usage"
|
|
17
|
-
]
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
// src/docs/content-generation.docblock.ts
|
|
21
|
-
import { registerDocBlocks } from "@contractspec/lib.contracts-spec/docs";
|
|
22
|
-
var blocks = [
|
|
23
|
-
{
|
|
24
|
-
id: "docs.examples.content-generation",
|
|
25
|
-
title: "Content Generation (example)",
|
|
26
|
-
summary: "Generate a consistent set of marketing assets from a typed ContentBrief (blog, landing hero, email, social, SEO).",
|
|
27
|
-
kind: "reference",
|
|
28
|
-
visibility: "public",
|
|
29
|
-
route: "/docs/examples/content-generation",
|
|
30
|
-
tags: ["content", "marketing", "example"],
|
|
31
|
-
body: `## What this example shows
|
|
1
|
+
import{defineFeature as y}from"@contractspec/lib.contracts-spec";var Y=y({meta:{key:"content-generation",version:"1.0.0",title:"Content Generation",description:"AI content generation for blog posts, landing pages, emails, and social media",domain:"content",owners:["@examples"],tags:["content","ai","generation"],stability:"experimental"},docs:["docs.examples.content-generation","docs.examples.content-generation.usage"]});import{registerDocBlocks as A}from"@contractspec/lib.contracts-spec/docs";var H=[{id:"docs.examples.content-generation",title:"Content Generation (example)",summary:"Generate a consistent set of marketing assets from a typed ContentBrief (blog, landing hero, email, social, SEO).",kind:"reference",visibility:"public",route:"/docs/examples/content-generation",tags:["content","marketing","example"],body:`## What this example shows
|
|
32
2
|
- A spec-first-ish interface for content brief inputs (typed, validated).
|
|
33
3
|
- Deterministic orchestration of generators (same input → same structure).
|
|
34
4
|
|
|
@@ -37,106 +7,4 @@ var blocks = [
|
|
|
37
7
|
- Landing hero
|
|
38
8
|
- Email subject/body
|
|
39
9
|
- Social post bodies
|
|
40
|
-
- SEO metadata`
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
id: "docs.examples.content-generation.usage",
|
|
44
|
-
title: "Content Generation — Usage",
|
|
45
|
-
summary: "How to run the example and extend the brief.",
|
|
46
|
-
kind: "usage",
|
|
47
|
-
visibility: "public",
|
|
48
|
-
route: "/docs/examples/content-generation/usage",
|
|
49
|
-
tags: ["content", "usage"],
|
|
50
|
-
body: `## Usage
|
|
51
|
-
- Call \`runContentGenerationExample()\`.
|
|
52
|
-
- Modify the \`ContentBrief\` fields to drive different outputs.
|
|
53
|
-
|
|
54
|
-
## Guardrails
|
|
55
|
-
- Avoid PII in briefs.
|
|
56
|
-
- Keep output logging structured; no raw \`console.log\` in library code.`
|
|
57
|
-
}
|
|
58
|
-
];
|
|
59
|
-
registerDocBlocks(blocks);
|
|
60
|
-
// src/example.ts
|
|
61
|
-
import { defineExample } from "@contractspec/lib.contracts-spec";
|
|
62
|
-
var example = defineExample({
|
|
63
|
-
meta: {
|
|
64
|
-
key: "content-generation",
|
|
65
|
-
version: "1.0.0",
|
|
66
|
-
title: "Content Generation",
|
|
67
|
-
description: "Generate blog/landing/email/social/SEO assets from a typed ContentBrief using @contractspec/lib.content-gen.",
|
|
68
|
-
kind: "script",
|
|
69
|
-
visibility: "public",
|
|
70
|
-
stability: "experimental",
|
|
71
|
-
owners: ["@platform.core"],
|
|
72
|
-
tags: ["content", "marketing", "generation", "ai"]
|
|
73
|
-
},
|
|
74
|
-
docs: {
|
|
75
|
-
rootDocId: "docs.examples.content-generation",
|
|
76
|
-
usageDocId: "docs.examples.content-generation.usage"
|
|
77
|
-
},
|
|
78
|
-
entrypoints: {
|
|
79
|
-
packageName: "@contractspec/example.content-generation",
|
|
80
|
-
docs: "./docs"
|
|
81
|
-
},
|
|
82
|
-
surfaces: {
|
|
83
|
-
templates: true,
|
|
84
|
-
sandbox: { enabled: true, modes: ["markdown"] },
|
|
85
|
-
studio: { enabled: true, installable: true },
|
|
86
|
-
mcp: { enabled: true }
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
var example_default = example;
|
|
90
|
-
|
|
91
|
-
// src/generate.ts
|
|
92
|
-
import {
|
|
93
|
-
BlogGenerator,
|
|
94
|
-
EmailCampaignGenerator,
|
|
95
|
-
LandingPageGenerator,
|
|
96
|
-
SocialPostGenerator
|
|
97
|
-
} from "@contractspec/lib.content-gen/generators";
|
|
98
|
-
import { SeoOptimizer } from "@contractspec/lib.content-gen/seo";
|
|
99
|
-
import { Logger, LogLevel } from "@contractspec/lib.logger";
|
|
100
|
-
var logger = new Logger({
|
|
101
|
-
level: LogLevel.INFO,
|
|
102
|
-
environment: "production",
|
|
103
|
-
enableColors: false
|
|
104
|
-
});
|
|
105
|
-
async function runContentGenerationExample() {
|
|
106
|
-
const brief = {
|
|
107
|
-
title: "AI-Native Operations Copilot",
|
|
108
|
-
summary: "Automates support resolutions, growth playbooks, and DevOps rituals.",
|
|
109
|
-
problems: [
|
|
110
|
-
"Support queues pile up after hours",
|
|
111
|
-
"Growth teams lack fresh experiments"
|
|
112
|
-
],
|
|
113
|
-
solutions: [
|
|
114
|
-
"Stateful AI agents grounded in your knowledge spaces",
|
|
115
|
-
"CI-safe approval workflows for human review",
|
|
116
|
-
"Analytics + experimentation stack built into ContractSpec"
|
|
117
|
-
],
|
|
118
|
-
metrics: ["80% auto-resolution rate", "10+ experiments shipped weekly"],
|
|
119
|
-
audience: { role: "COO", industry: "Fintech", maturity: "scaleup" },
|
|
120
|
-
callToAction: "Book a 15‑minute pilot run"
|
|
121
|
-
};
|
|
122
|
-
const blog = await new BlogGenerator().generate(brief);
|
|
123
|
-
const landing = await new LandingPageGenerator().generate(brief);
|
|
124
|
-
const email = await new EmailCampaignGenerator().generate({
|
|
125
|
-
brief,
|
|
126
|
-
variant: "announcement"
|
|
127
|
-
});
|
|
128
|
-
const social = await new SocialPostGenerator().generate(brief);
|
|
129
|
-
const seo = new SeoOptimizer().optimize(brief);
|
|
130
|
-
logger.info("Generated content assets", {
|
|
131
|
-
blogIntro: blog.intro,
|
|
132
|
-
landingHero: landing.hero,
|
|
133
|
-
emailSubject: email.subject,
|
|
134
|
-
socialPosts: social.map((post) => post.body),
|
|
135
|
-
seo
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
export {
|
|
139
|
-
runContentGenerationExample,
|
|
140
|
-
example_default as example,
|
|
141
|
-
ContentGenerationFeature
|
|
142
|
-
};
|
|
10
|
+
- SEO metadata`},{id:"docs.examples.content-generation.usage",title:"Content Generation — Usage",summary:"How to run the example and extend the brief.",kind:"usage",visibility:"public",route:"/docs/examples/content-generation/usage",tags:["content","usage"],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."}];A(H);import{defineExample as I}from"@contractspec/lib.contracts-spec";var J=I({meta:{key:"content-generation",version:"1.0.0",title:"Content Generation",description:"Generate blog/landing/email/social/SEO assets from a typed ContentBrief using @contractspec/lib.content-gen.",kind:"script",visibility:"public",stability:"experimental",owners:["@platform.core"],tags:["content","marketing","generation","ai"]},docs:{rootDocId:"docs.examples.content-generation",usageDocId:"docs.examples.content-generation.usage"},entrypoints:{packageName:"@contractspec/example.content-generation",docs:"./docs"},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["markdown"]},studio:{enabled:!0,installable:!0},mcp:{enabled:!0}}}),K=J;import{BlogGenerator as M,EmailCampaignGenerator as N,LandingPageGenerator as Q,SocialPostGenerator as R}from"@contractspec/lib.content-gen/generators";import{SeoOptimizer as T}from"@contractspec/lib.content-gen/seo";import{Logger as U,LogLevel as V}from"@contractspec/lib.logger";var W=new U({level:V.INFO,environment:"production",enableColors:!1});async function O(){let x={title:"AI-Native Operations Copilot",summary:"Automates support resolutions, growth playbooks, and DevOps rituals.",problems:["Support queues pile up after hours","Growth teams lack fresh experiments"],solutions:["Stateful AI agents grounded in your knowledge spaces","CI-safe approval workflows for human review","Analytics + experimentation stack built into ContractSpec"],metrics:["80% auto-resolution rate","10+ experiments shipped weekly"],audience:{role:"COO",industry:"Fintech",maturity:"scaleup"},callToAction:"Book a 15‑minute pilot run"},h=await new M().generate(x),j=await new Q().generate(x),m=await new N().generate({brief:x,variant:"announcement"}),q=await new R().generate(x),u=new T().optimize(x);W.info("Generated content assets",{blogIntro:h.intro,landingHero:j.hero,emailSubject:m.subject,socialPosts:q.map((w)=>w.body),seo:u})}export{O as runContentGenerationExample,K as example,Y as ContentGenerationFeature};
|
|
@@ -1,22 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
import { defineFeature } from "@contractspec/lib.contracts-spec";
|
|
4
|
-
var ContentGenerationFeature = defineFeature({
|
|
5
|
-
meta: {
|
|
6
|
-
key: "content-generation",
|
|
7
|
-
version: "1.0.0",
|
|
8
|
-
title: "Content Generation",
|
|
9
|
-
description: "AI content generation for blog posts, landing pages, emails, and social media",
|
|
10
|
-
domain: "content",
|
|
11
|
-
owners: ["@examples"],
|
|
12
|
-
tags: ["content", "ai", "generation"],
|
|
13
|
-
stability: "experimental"
|
|
14
|
-
},
|
|
15
|
-
docs: [
|
|
16
|
-
"docs.examples.content-generation",
|
|
17
|
-
"docs.examples.content-generation.usage"
|
|
18
|
-
]
|
|
19
|
-
});
|
|
20
|
-
export {
|
|
21
|
-
ContentGenerationFeature
|
|
22
|
-
};
|
|
2
|
+
import{defineFeature as g}from"@contractspec/lib.contracts-spec";var j=g({meta:{key:"content-generation",version:"1.0.0",title:"Content Generation",description:"AI content generation for blog posts, landing pages, emails, and social media",domain:"content",owners:["@examples"],tags:["content","ai","generation"],stability:"experimental"},docs:["docs.examples.content-generation","docs.examples.content-generation.usage"]});export{j as ContentGenerationFeature};
|
|
@@ -1,16 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
import { registerDocBlocks } from "@contractspec/lib.contracts-spec/docs";
|
|
4
|
-
var blocks = [
|
|
5
|
-
{
|
|
6
|
-
id: "docs.examples.content-generation",
|
|
7
|
-
title: "Content Generation (example)",
|
|
8
|
-
summary: "Generate a consistent set of marketing assets from a typed ContentBrief (blog, landing hero, email, social, SEO).",
|
|
9
|
-
kind: "reference",
|
|
10
|
-
visibility: "public",
|
|
11
|
-
route: "/docs/examples/content-generation",
|
|
12
|
-
tags: ["content", "marketing", "example"],
|
|
13
|
-
body: `## What this example shows
|
|
2
|
+
import{registerDocBlocks as f}from"@contractspec/lib.contracts-spec/docs";var h=[{id:"docs.examples.content-generation",title:"Content Generation (example)",summary:"Generate a consistent set of marketing assets from a typed ContentBrief (blog, landing hero, email, social, SEO).",kind:"reference",visibility:"public",route:"/docs/examples/content-generation",tags:["content","marketing","example"],body:`## What this example shows
|
|
14
3
|
- A spec-first-ish interface for content brief inputs (typed, validated).
|
|
15
4
|
- Deterministic orchestration of generators (same input \u2192 same structure).
|
|
16
5
|
|
|
@@ -19,23 +8,4 @@ var blocks = [
|
|
|
19
8
|
- Landing hero
|
|
20
9
|
- Email subject/body
|
|
21
10
|
- Social post bodies
|
|
22
|
-
- SEO metadata`
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
id: "docs.examples.content-generation.usage",
|
|
26
|
-
title: "Content Generation \u2014 Usage",
|
|
27
|
-
summary: "How to run the example and extend the brief.",
|
|
28
|
-
kind: "usage",
|
|
29
|
-
visibility: "public",
|
|
30
|
-
route: "/docs/examples/content-generation/usage",
|
|
31
|
-
tags: ["content", "usage"],
|
|
32
|
-
body: `## Usage
|
|
33
|
-
- Call \`runContentGenerationExample()\`.
|
|
34
|
-
- Modify the \`ContentBrief\` fields to drive different outputs.
|
|
35
|
-
|
|
36
|
-
## Guardrails
|
|
37
|
-
- Avoid PII in briefs.
|
|
38
|
-
- Keep output logging structured; no raw \`console.log\` in library code.`
|
|
39
|
-
}
|
|
40
|
-
];
|
|
41
|
-
registerDocBlocks(blocks);
|
|
11
|
+
- SEO metadata`},{id:"docs.examples.content-generation.usage",title:"Content Generation \u2014 Usage",summary:"How to run the example and extend the brief.",kind:"usage",visibility:"public",route:"/docs/examples/content-generation/usage",tags:["content","usage"],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."}];f(h);
|
package/dist/docs/index.js
CHANGED
|
@@ -1,16 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
import { registerDocBlocks } from "@contractspec/lib.contracts-spec/docs";
|
|
4
|
-
var blocks = [
|
|
5
|
-
{
|
|
6
|
-
id: "docs.examples.content-generation",
|
|
7
|
-
title: "Content Generation (example)",
|
|
8
|
-
summary: "Generate a consistent set of marketing assets from a typed ContentBrief (blog, landing hero, email, social, SEO).",
|
|
9
|
-
kind: "reference",
|
|
10
|
-
visibility: "public",
|
|
11
|
-
route: "/docs/examples/content-generation",
|
|
12
|
-
tags: ["content", "marketing", "example"],
|
|
13
|
-
body: `## What this example shows
|
|
2
|
+
import{registerDocBlocks as m}from"@contractspec/lib.contracts-spec/docs";var f=[{id:"docs.examples.content-generation",title:"Content Generation (example)",summary:"Generate a consistent set of marketing assets from a typed ContentBrief (blog, landing hero, email, social, SEO).",kind:"reference",visibility:"public",route:"/docs/examples/content-generation",tags:["content","marketing","example"],body:`## What this example shows
|
|
14
3
|
- A spec-first-ish interface for content brief inputs (typed, validated).
|
|
15
4
|
- Deterministic orchestration of generators (same input \u2192 same structure).
|
|
16
5
|
|
|
@@ -19,23 +8,4 @@ var blocks = [
|
|
|
19
8
|
- Landing hero
|
|
20
9
|
- Email subject/body
|
|
21
10
|
- Social post bodies
|
|
22
|
-
- SEO metadata`
|
|
23
|
-
},
|
|
24
|
-
{
|
|
25
|
-
id: "docs.examples.content-generation.usage",
|
|
26
|
-
title: "Content Generation \u2014 Usage",
|
|
27
|
-
summary: "How to run the example and extend the brief.",
|
|
28
|
-
kind: "usage",
|
|
29
|
-
visibility: "public",
|
|
30
|
-
route: "/docs/examples/content-generation/usage",
|
|
31
|
-
tags: ["content", "usage"],
|
|
32
|
-
body: `## Usage
|
|
33
|
-
- Call \`runContentGenerationExample()\`.
|
|
34
|
-
- Modify the \`ContentBrief\` fields to drive different outputs.
|
|
35
|
-
|
|
36
|
-
## Guardrails
|
|
37
|
-
- Avoid PII in briefs.
|
|
38
|
-
- Keep output logging structured; no raw \`console.log\` in library code.`
|
|
39
|
-
}
|
|
40
|
-
];
|
|
41
|
-
registerDocBlocks(blocks);
|
|
11
|
+
- SEO metadata`},{id:"docs.examples.content-generation.usage",title:"Content Generation \u2014 Usage",summary:"How to run the example and extend the brief.",kind:"usage",visibility:"public",route:"/docs/examples/content-generation/usage",tags:["content","usage"],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."}];m(f);
|
package/dist/example.js
CHANGED
|
@@ -1,34 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
import { defineExample } from "@contractspec/lib.contracts-spec";
|
|
4
|
-
var example = defineExample({
|
|
5
|
-
meta: {
|
|
6
|
-
key: "content-generation",
|
|
7
|
-
version: "1.0.0",
|
|
8
|
-
title: "Content Generation",
|
|
9
|
-
description: "Generate blog/landing/email/social/SEO assets from a typed ContentBrief using @contractspec/lib.content-gen.",
|
|
10
|
-
kind: "script",
|
|
11
|
-
visibility: "public",
|
|
12
|
-
stability: "experimental",
|
|
13
|
-
owners: ["@platform.core"],
|
|
14
|
-
tags: ["content", "marketing", "generation", "ai"]
|
|
15
|
-
},
|
|
16
|
-
docs: {
|
|
17
|
-
rootDocId: "docs.examples.content-generation",
|
|
18
|
-
usageDocId: "docs.examples.content-generation.usage"
|
|
19
|
-
},
|
|
20
|
-
entrypoints: {
|
|
21
|
-
packageName: "@contractspec/example.content-generation",
|
|
22
|
-
docs: "./docs"
|
|
23
|
-
},
|
|
24
|
-
surfaces: {
|
|
25
|
-
templates: true,
|
|
26
|
-
sandbox: { enabled: true, modes: ["markdown"] },
|
|
27
|
-
studio: { enabled: true, installable: true },
|
|
28
|
-
mcp: { enabled: true }
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
var example_default = example;
|
|
32
|
-
export {
|
|
33
|
-
example_default as default
|
|
34
|
-
};
|
|
2
|
+
import{defineExample as g}from"@contractspec/lib.contracts-spec";var h=g({meta:{key:"content-generation",version:"1.0.0",title:"Content Generation",description:"Generate blog/landing/email/social/SEO assets from a typed ContentBrief using @contractspec/lib.content-gen.",kind:"script",visibility:"public",stability:"experimental",owners:["@platform.core"],tags:["content","marketing","generation","ai"]},docs:{rootDocId:"docs.examples.content-generation",usageDocId:"docs.examples.content-generation.usage"},entrypoints:{packageName:"@contractspec/example.content-generation",docs:"./docs"},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["markdown"]},studio:{enabled:!0,installable:!0},mcp:{enabled:!0}}}),q=h;export{q as default};
|
package/dist/generate.js
CHANGED
|
@@ -1,51 +1,2 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
import {
|
|
4
|
-
BlogGenerator,
|
|
5
|
-
EmailCampaignGenerator,
|
|
6
|
-
LandingPageGenerator,
|
|
7
|
-
SocialPostGenerator
|
|
8
|
-
} from "@contractspec/lib.content-gen/generators";
|
|
9
|
-
import { SeoOptimizer } from "@contractspec/lib.content-gen/seo";
|
|
10
|
-
import { Logger, LogLevel } from "@contractspec/lib.logger";
|
|
11
|
-
var logger = new Logger({
|
|
12
|
-
level: LogLevel.INFO,
|
|
13
|
-
environment: "production",
|
|
14
|
-
enableColors: false
|
|
15
|
-
});
|
|
16
|
-
async function runContentGenerationExample() {
|
|
17
|
-
const brief = {
|
|
18
|
-
title: "AI-Native Operations Copilot",
|
|
19
|
-
summary: "Automates support resolutions, growth playbooks, and DevOps rituals.",
|
|
20
|
-
problems: [
|
|
21
|
-
"Support queues pile up after hours",
|
|
22
|
-
"Growth teams lack fresh experiments"
|
|
23
|
-
],
|
|
24
|
-
solutions: [
|
|
25
|
-
"Stateful AI agents grounded in your knowledge spaces",
|
|
26
|
-
"CI-safe approval workflows for human review",
|
|
27
|
-
"Analytics + experimentation stack built into ContractSpec"
|
|
28
|
-
],
|
|
29
|
-
metrics: ["80% auto-resolution rate", "10+ experiments shipped weekly"],
|
|
30
|
-
audience: { role: "COO", industry: "Fintech", maturity: "scaleup" },
|
|
31
|
-
callToAction: "Book a 15\u2011minute pilot run"
|
|
32
|
-
};
|
|
33
|
-
const blog = await new BlogGenerator().generate(brief);
|
|
34
|
-
const landing = await new LandingPageGenerator().generate(brief);
|
|
35
|
-
const email = await new EmailCampaignGenerator().generate({
|
|
36
|
-
brief,
|
|
37
|
-
variant: "announcement"
|
|
38
|
-
});
|
|
39
|
-
const social = await new SocialPostGenerator().generate(brief);
|
|
40
|
-
const seo = new SeoOptimizer().optimize(brief);
|
|
41
|
-
logger.info("Generated content assets", {
|
|
42
|
-
blogIntro: blog.intro,
|
|
43
|
-
landingHero: landing.hero,
|
|
44
|
-
emailSubject: email.subject,
|
|
45
|
-
socialPosts: social.map((post) => post.body),
|
|
46
|
-
seo
|
|
47
|
-
});
|
|
48
|
-
}
|
|
49
|
-
export {
|
|
50
|
-
runContentGenerationExample
|
|
51
|
-
};
|
|
2
|
+
import{BlogGenerator as y,EmailCampaignGenerator as A,LandingPageGenerator as D,SocialPostGenerator as F}from"@contractspec/lib.content-gen/generators";import{SeoOptimizer as H}from"@contractspec/lib.content-gen/seo";import{Logger as I,LogLevel as J}from"@contractspec/lib.logger";var K=new I({level:J.INFO,environment:"production",enableColors:!1});async function R(){let h={title:"AI-Native Operations Copilot",summary:"Automates support resolutions, growth playbooks, and DevOps rituals.",problems:["Support queues pile up after hours","Growth teams lack fresh experiments"],solutions:["Stateful AI agents grounded in your knowledge spaces","CI-safe approval workflows for human review","Analytics + experimentation stack built into ContractSpec"],metrics:["80% auto-resolution rate","10+ experiments shipped weekly"],audience:{role:"COO",industry:"Fintech",maturity:"scaleup"},callToAction:"Book a 15\u2011minute pilot run"},j=await new y().generate(h),k=await new D().generate(h),q=await new A().generate({brief:h,variant:"announcement"}),u=await new F().generate(h),w=new H().optimize(h);K.info("Generated content assets",{blogIntro:j.intro,landingHero:k.hero,emailSubject:q.subject,socialPosts:u.map((x)=>x.body),seo:w})}export{R as runContentGenerationExample};
|
package/dist/index.js
CHANGED
|
@@ -1,35 +1,5 @@
|
|
|
1
1
|
// @bun
|
|
2
|
-
|
|
3
|
-
import { defineFeature } from "@contractspec/lib.contracts-spec";
|
|
4
|
-
var ContentGenerationFeature = defineFeature({
|
|
5
|
-
meta: {
|
|
6
|
-
key: "content-generation",
|
|
7
|
-
version: "1.0.0",
|
|
8
|
-
title: "Content Generation",
|
|
9
|
-
description: "AI content generation for blog posts, landing pages, emails, and social media",
|
|
10
|
-
domain: "content",
|
|
11
|
-
owners: ["@examples"],
|
|
12
|
-
tags: ["content", "ai", "generation"],
|
|
13
|
-
stability: "experimental"
|
|
14
|
-
},
|
|
15
|
-
docs: [
|
|
16
|
-
"docs.examples.content-generation",
|
|
17
|
-
"docs.examples.content-generation.usage"
|
|
18
|
-
]
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
// src/docs/content-generation.docblock.ts
|
|
22
|
-
import { registerDocBlocks } from "@contractspec/lib.contracts-spec/docs";
|
|
23
|
-
var blocks = [
|
|
24
|
-
{
|
|
25
|
-
id: "docs.examples.content-generation",
|
|
26
|
-
title: "Content Generation (example)",
|
|
27
|
-
summary: "Generate a consistent set of marketing assets from a typed ContentBrief (blog, landing hero, email, social, SEO).",
|
|
28
|
-
kind: "reference",
|
|
29
|
-
visibility: "public",
|
|
30
|
-
route: "/docs/examples/content-generation",
|
|
31
|
-
tags: ["content", "marketing", "example"],
|
|
32
|
-
body: `## What this example shows
|
|
2
|
+
import{defineFeature as y}from"@contractspec/lib.contracts-spec";var Y=y({meta:{key:"content-generation",version:"1.0.0",title:"Content Generation",description:"AI content generation for blog posts, landing pages, emails, and social media",domain:"content",owners:["@examples"],tags:["content","ai","generation"],stability:"experimental"},docs:["docs.examples.content-generation","docs.examples.content-generation.usage"]});import{registerDocBlocks as A}from"@contractspec/lib.contracts-spec/docs";var H=[{id:"docs.examples.content-generation",title:"Content Generation (example)",summary:"Generate a consistent set of marketing assets from a typed ContentBrief (blog, landing hero, email, social, SEO).",kind:"reference",visibility:"public",route:"/docs/examples/content-generation",tags:["content","marketing","example"],body:`## What this example shows
|
|
33
3
|
- A spec-first-ish interface for content brief inputs (typed, validated).
|
|
34
4
|
- Deterministic orchestration of generators (same input \u2192 same structure).
|
|
35
5
|
|
|
@@ -38,106 +8,4 @@ var blocks = [
|
|
|
38
8
|
- Landing hero
|
|
39
9
|
- Email subject/body
|
|
40
10
|
- Social post bodies
|
|
41
|
-
- SEO metadata`
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
id: "docs.examples.content-generation.usage",
|
|
45
|
-
title: "Content Generation \u2014 Usage",
|
|
46
|
-
summary: "How to run the example and extend the brief.",
|
|
47
|
-
kind: "usage",
|
|
48
|
-
visibility: "public",
|
|
49
|
-
route: "/docs/examples/content-generation/usage",
|
|
50
|
-
tags: ["content", "usage"],
|
|
51
|
-
body: `## Usage
|
|
52
|
-
- Call \`runContentGenerationExample()\`.
|
|
53
|
-
- Modify the \`ContentBrief\` fields to drive different outputs.
|
|
54
|
-
|
|
55
|
-
## Guardrails
|
|
56
|
-
- Avoid PII in briefs.
|
|
57
|
-
- Keep output logging structured; no raw \`console.log\` in library code.`
|
|
58
|
-
}
|
|
59
|
-
];
|
|
60
|
-
registerDocBlocks(blocks);
|
|
61
|
-
// src/example.ts
|
|
62
|
-
import { defineExample } from "@contractspec/lib.contracts-spec";
|
|
63
|
-
var example = defineExample({
|
|
64
|
-
meta: {
|
|
65
|
-
key: "content-generation",
|
|
66
|
-
version: "1.0.0",
|
|
67
|
-
title: "Content Generation",
|
|
68
|
-
description: "Generate blog/landing/email/social/SEO assets from a typed ContentBrief using @contractspec/lib.content-gen.",
|
|
69
|
-
kind: "script",
|
|
70
|
-
visibility: "public",
|
|
71
|
-
stability: "experimental",
|
|
72
|
-
owners: ["@platform.core"],
|
|
73
|
-
tags: ["content", "marketing", "generation", "ai"]
|
|
74
|
-
},
|
|
75
|
-
docs: {
|
|
76
|
-
rootDocId: "docs.examples.content-generation",
|
|
77
|
-
usageDocId: "docs.examples.content-generation.usage"
|
|
78
|
-
},
|
|
79
|
-
entrypoints: {
|
|
80
|
-
packageName: "@contractspec/example.content-generation",
|
|
81
|
-
docs: "./docs"
|
|
82
|
-
},
|
|
83
|
-
surfaces: {
|
|
84
|
-
templates: true,
|
|
85
|
-
sandbox: { enabled: true, modes: ["markdown"] },
|
|
86
|
-
studio: { enabled: true, installable: true },
|
|
87
|
-
mcp: { enabled: true }
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
var example_default = example;
|
|
91
|
-
|
|
92
|
-
// src/generate.ts
|
|
93
|
-
import {
|
|
94
|
-
BlogGenerator,
|
|
95
|
-
EmailCampaignGenerator,
|
|
96
|
-
LandingPageGenerator,
|
|
97
|
-
SocialPostGenerator
|
|
98
|
-
} from "@contractspec/lib.content-gen/generators";
|
|
99
|
-
import { SeoOptimizer } from "@contractspec/lib.content-gen/seo";
|
|
100
|
-
import { Logger, LogLevel } from "@contractspec/lib.logger";
|
|
101
|
-
var logger = new Logger({
|
|
102
|
-
level: LogLevel.INFO,
|
|
103
|
-
environment: "production",
|
|
104
|
-
enableColors: false
|
|
105
|
-
});
|
|
106
|
-
async function runContentGenerationExample() {
|
|
107
|
-
const brief = {
|
|
108
|
-
title: "AI-Native Operations Copilot",
|
|
109
|
-
summary: "Automates support resolutions, growth playbooks, and DevOps rituals.",
|
|
110
|
-
problems: [
|
|
111
|
-
"Support queues pile up after hours",
|
|
112
|
-
"Growth teams lack fresh experiments"
|
|
113
|
-
],
|
|
114
|
-
solutions: [
|
|
115
|
-
"Stateful AI agents grounded in your knowledge spaces",
|
|
116
|
-
"CI-safe approval workflows for human review",
|
|
117
|
-
"Analytics + experimentation stack built into ContractSpec"
|
|
118
|
-
],
|
|
119
|
-
metrics: ["80% auto-resolution rate", "10+ experiments shipped weekly"],
|
|
120
|
-
audience: { role: "COO", industry: "Fintech", maturity: "scaleup" },
|
|
121
|
-
callToAction: "Book a 15\u2011minute pilot run"
|
|
122
|
-
};
|
|
123
|
-
const blog = await new BlogGenerator().generate(brief);
|
|
124
|
-
const landing = await new LandingPageGenerator().generate(brief);
|
|
125
|
-
const email = await new EmailCampaignGenerator().generate({
|
|
126
|
-
brief,
|
|
127
|
-
variant: "announcement"
|
|
128
|
-
});
|
|
129
|
-
const social = await new SocialPostGenerator().generate(brief);
|
|
130
|
-
const seo = new SeoOptimizer().optimize(brief);
|
|
131
|
-
logger.info("Generated content assets", {
|
|
132
|
-
blogIntro: blog.intro,
|
|
133
|
-
landingHero: landing.hero,
|
|
134
|
-
emailSubject: email.subject,
|
|
135
|
-
socialPosts: social.map((post) => post.body),
|
|
136
|
-
seo
|
|
137
|
-
});
|
|
138
|
-
}
|
|
139
|
-
export {
|
|
140
|
-
runContentGenerationExample,
|
|
141
|
-
example_default as example,
|
|
142
|
-
ContentGenerationFeature
|
|
143
|
-
};
|
|
11
|
+
- SEO metadata`},{id:"docs.examples.content-generation.usage",title:"Content Generation \u2014 Usage",summary:"How to run the example and extend the brief.",kind:"usage",visibility:"public",route:"/docs/examples/content-generation/usage",tags:["content","usage"],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."}];A(H);import{defineExample as I}from"@contractspec/lib.contracts-spec";var J=I({meta:{key:"content-generation",version:"1.0.0",title:"Content Generation",description:"Generate blog/landing/email/social/SEO assets from a typed ContentBrief using @contractspec/lib.content-gen.",kind:"script",visibility:"public",stability:"experimental",owners:["@platform.core"],tags:["content","marketing","generation","ai"]},docs:{rootDocId:"docs.examples.content-generation",usageDocId:"docs.examples.content-generation.usage"},entrypoints:{packageName:"@contractspec/example.content-generation",docs:"./docs"},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["markdown"]},studio:{enabled:!0,installable:!0},mcp:{enabled:!0}}}),K=J;import{BlogGenerator as M,EmailCampaignGenerator as N,LandingPageGenerator as Q,SocialPostGenerator as R}from"@contractspec/lib.content-gen/generators";import{SeoOptimizer as T}from"@contractspec/lib.content-gen/seo";import{Logger as U,LogLevel as V}from"@contractspec/lib.logger";var W=new U({level:V.INFO,environment:"production",enableColors:!1});async function O(){let x={title:"AI-Native Operations Copilot",summary:"Automates support resolutions, growth playbooks, and DevOps rituals.",problems:["Support queues pile up after hours","Growth teams lack fresh experiments"],solutions:["Stateful AI agents grounded in your knowledge spaces","CI-safe approval workflows for human review","Analytics + experimentation stack built into ContractSpec"],metrics:["80% auto-resolution rate","10+ experiments shipped weekly"],audience:{role:"COO",industry:"Fintech",maturity:"scaleup"},callToAction:"Book a 15\u2011minute pilot run"},h=await new M().generate(x),j=await new Q().generate(x),m=await new N().generate({brief:x,variant:"announcement"}),q=await new R().generate(x),u=new T().optimize(x);W.info("Generated content assets",{blogIntro:h.intro,landingHero:j.hero,emailSubject:m.subject,socialPosts:q.map((w)=>w.body),seo:u})}export{O as runContentGenerationExample,K as example,Y as ContentGenerationFeature};
|
|
@@ -1,21 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { defineFeature } from "@contractspec/lib.contracts-spec";
|
|
3
|
-
var ContentGenerationFeature = defineFeature({
|
|
4
|
-
meta: {
|
|
5
|
-
key: "content-generation",
|
|
6
|
-
version: "1.0.0",
|
|
7
|
-
title: "Content Generation",
|
|
8
|
-
description: "AI content generation for blog posts, landing pages, emails, and social media",
|
|
9
|
-
domain: "content",
|
|
10
|
-
owners: ["@examples"],
|
|
11
|
-
tags: ["content", "ai", "generation"],
|
|
12
|
-
stability: "experimental"
|
|
13
|
-
},
|
|
14
|
-
docs: [
|
|
15
|
-
"docs.examples.content-generation",
|
|
16
|
-
"docs.examples.content-generation.usage"
|
|
17
|
-
]
|
|
18
|
-
});
|
|
19
|
-
export {
|
|
20
|
-
ContentGenerationFeature
|
|
21
|
-
};
|
|
1
|
+
import{defineFeature as g}from"@contractspec/lib.contracts-spec";var j=g({meta:{key:"content-generation",version:"1.0.0",title:"Content Generation",description:"AI content generation for blog posts, landing pages, emails, and social media",domain:"content",owners:["@examples"],tags:["content","ai","generation"],stability:"experimental"},docs:["docs.examples.content-generation","docs.examples.content-generation.usage"]});export{j as ContentGenerationFeature};
|
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { registerDocBlocks } from "@contractspec/lib.contracts-spec/docs";
|
|
3
|
-
var blocks = [
|
|
4
|
-
{
|
|
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: ["content", "marketing", "example"],
|
|
12
|
-
body: `## What this example shows
|
|
1
|
+
import{registerDocBlocks as f}from"@contractspec/lib.contracts-spec/docs";var h=[{id:"docs.examples.content-generation",title:"Content Generation (example)",summary:"Generate a consistent set of marketing assets from a typed ContentBrief (blog, landing hero, email, social, SEO).",kind:"reference",visibility:"public",route:"/docs/examples/content-generation",tags:["content","marketing","example"],body:`## What this example shows
|
|
13
2
|
- A spec-first-ish interface for content brief inputs (typed, validated).
|
|
14
3
|
- Deterministic orchestration of generators (same input → same structure).
|
|
15
4
|
|
|
@@ -18,23 +7,4 @@ var blocks = [
|
|
|
18
7
|
- Landing hero
|
|
19
8
|
- Email subject/body
|
|
20
9
|
- Social post bodies
|
|
21
|
-
- SEO metadata`
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
id: "docs.examples.content-generation.usage",
|
|
25
|
-
title: "Content Generation — Usage",
|
|
26
|
-
summary: "How to run the example and extend the brief.",
|
|
27
|
-
kind: "usage",
|
|
28
|
-
visibility: "public",
|
|
29
|
-
route: "/docs/examples/content-generation/usage",
|
|
30
|
-
tags: ["content", "usage"],
|
|
31
|
-
body: `## Usage
|
|
32
|
-
- Call \`runContentGenerationExample()\`.
|
|
33
|
-
- Modify the \`ContentBrief\` fields to drive different outputs.
|
|
34
|
-
|
|
35
|
-
## Guardrails
|
|
36
|
-
- Avoid PII in briefs.
|
|
37
|
-
- Keep output logging structured; no raw \`console.log\` in library code.`
|
|
38
|
-
}
|
|
39
|
-
];
|
|
40
|
-
registerDocBlocks(blocks);
|
|
10
|
+
- SEO metadata`},{id:"docs.examples.content-generation.usage",title:"Content Generation — Usage",summary:"How to run the example and extend the brief.",kind:"usage",visibility:"public",route:"/docs/examples/content-generation/usage",tags:["content","usage"],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."}];f(h);
|
package/dist/node/docs/index.js
CHANGED
|
@@ -1,15 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { registerDocBlocks } from "@contractspec/lib.contracts-spec/docs";
|
|
3
|
-
var blocks = [
|
|
4
|
-
{
|
|
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: ["content", "marketing", "example"],
|
|
12
|
-
body: `## What this example shows
|
|
1
|
+
import{registerDocBlocks as m}from"@contractspec/lib.contracts-spec/docs";var f=[{id:"docs.examples.content-generation",title:"Content Generation (example)",summary:"Generate a consistent set of marketing assets from a typed ContentBrief (blog, landing hero, email, social, SEO).",kind:"reference",visibility:"public",route:"/docs/examples/content-generation",tags:["content","marketing","example"],body:`## What this example shows
|
|
13
2
|
- A spec-first-ish interface for content brief inputs (typed, validated).
|
|
14
3
|
- Deterministic orchestration of generators (same input → same structure).
|
|
15
4
|
|
|
@@ -18,23 +7,4 @@ var blocks = [
|
|
|
18
7
|
- Landing hero
|
|
19
8
|
- Email subject/body
|
|
20
9
|
- Social post bodies
|
|
21
|
-
- SEO metadata`
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
id: "docs.examples.content-generation.usage",
|
|
25
|
-
title: "Content Generation — Usage",
|
|
26
|
-
summary: "How to run the example and extend the brief.",
|
|
27
|
-
kind: "usage",
|
|
28
|
-
visibility: "public",
|
|
29
|
-
route: "/docs/examples/content-generation/usage",
|
|
30
|
-
tags: ["content", "usage"],
|
|
31
|
-
body: `## Usage
|
|
32
|
-
- Call \`runContentGenerationExample()\`.
|
|
33
|
-
- Modify the \`ContentBrief\` fields to drive different outputs.
|
|
34
|
-
|
|
35
|
-
## Guardrails
|
|
36
|
-
- Avoid PII in briefs.
|
|
37
|
-
- Keep output logging structured; no raw \`console.log\` in library code.`
|
|
38
|
-
}
|
|
39
|
-
];
|
|
40
|
-
registerDocBlocks(blocks);
|
|
10
|
+
- SEO metadata`},{id:"docs.examples.content-generation.usage",title:"Content Generation — Usage",summary:"How to run the example and extend the brief.",kind:"usage",visibility:"public",route:"/docs/examples/content-generation/usage",tags:["content","usage"],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."}];m(f);
|
package/dist/node/example.js
CHANGED
|
@@ -1,33 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import { defineExample } from "@contractspec/lib.contracts-spec";
|
|
3
|
-
var example = defineExample({
|
|
4
|
-
meta: {
|
|
5
|
-
key: "content-generation",
|
|
6
|
-
version: "1.0.0",
|
|
7
|
-
title: "Content Generation",
|
|
8
|
-
description: "Generate blog/landing/email/social/SEO assets from a typed ContentBrief using @contractspec/lib.content-gen.",
|
|
9
|
-
kind: "script",
|
|
10
|
-
visibility: "public",
|
|
11
|
-
stability: "experimental",
|
|
12
|
-
owners: ["@platform.core"],
|
|
13
|
-
tags: ["content", "marketing", "generation", "ai"]
|
|
14
|
-
},
|
|
15
|
-
docs: {
|
|
16
|
-
rootDocId: "docs.examples.content-generation",
|
|
17
|
-
usageDocId: "docs.examples.content-generation.usage"
|
|
18
|
-
},
|
|
19
|
-
entrypoints: {
|
|
20
|
-
packageName: "@contractspec/example.content-generation",
|
|
21
|
-
docs: "./docs"
|
|
22
|
-
},
|
|
23
|
-
surfaces: {
|
|
24
|
-
templates: true,
|
|
25
|
-
sandbox: { enabled: true, modes: ["markdown"] },
|
|
26
|
-
studio: { enabled: true, installable: true },
|
|
27
|
-
mcp: { enabled: true }
|
|
28
|
-
}
|
|
29
|
-
});
|
|
30
|
-
var example_default = example;
|
|
31
|
-
export {
|
|
32
|
-
example_default as default
|
|
33
|
-
};
|
|
1
|
+
import{defineExample as g}from"@contractspec/lib.contracts-spec";var h=g({meta:{key:"content-generation",version:"1.0.0",title:"Content Generation",description:"Generate blog/landing/email/social/SEO assets from a typed ContentBrief using @contractspec/lib.content-gen.",kind:"script",visibility:"public",stability:"experimental",owners:["@platform.core"],tags:["content","marketing","generation","ai"]},docs:{rootDocId:"docs.examples.content-generation",usageDocId:"docs.examples.content-generation.usage"},entrypoints:{packageName:"@contractspec/example.content-generation",docs:"./docs"},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["markdown"]},studio:{enabled:!0,installable:!0},mcp:{enabled:!0}}}),q=h;export{q as default};
|
package/dist/node/generate.js
CHANGED
|
@@ -1,50 +1 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
3
|
-
BlogGenerator,
|
|
4
|
-
EmailCampaignGenerator,
|
|
5
|
-
LandingPageGenerator,
|
|
6
|
-
SocialPostGenerator
|
|
7
|
-
} from "@contractspec/lib.content-gen/generators";
|
|
8
|
-
import { SeoOptimizer } from "@contractspec/lib.content-gen/seo";
|
|
9
|
-
import { Logger, LogLevel } from "@contractspec/lib.logger";
|
|
10
|
-
var logger = new Logger({
|
|
11
|
-
level: LogLevel.INFO,
|
|
12
|
-
environment: "production",
|
|
13
|
-
enableColors: false
|
|
14
|
-
});
|
|
15
|
-
async function runContentGenerationExample() {
|
|
16
|
-
const brief = {
|
|
17
|
-
title: "AI-Native Operations Copilot",
|
|
18
|
-
summary: "Automates support resolutions, growth playbooks, and DevOps rituals.",
|
|
19
|
-
problems: [
|
|
20
|
-
"Support queues pile up after hours",
|
|
21
|
-
"Growth teams lack fresh experiments"
|
|
22
|
-
],
|
|
23
|
-
solutions: [
|
|
24
|
-
"Stateful AI agents grounded in your knowledge spaces",
|
|
25
|
-
"CI-safe approval workflows for human review",
|
|
26
|
-
"Analytics + experimentation stack built into ContractSpec"
|
|
27
|
-
],
|
|
28
|
-
metrics: ["80% auto-resolution rate", "10+ experiments shipped weekly"],
|
|
29
|
-
audience: { role: "COO", industry: "Fintech", maturity: "scaleup" },
|
|
30
|
-
callToAction: "Book a 15‑minute pilot run"
|
|
31
|
-
};
|
|
32
|
-
const blog = await new BlogGenerator().generate(brief);
|
|
33
|
-
const landing = await new LandingPageGenerator().generate(brief);
|
|
34
|
-
const email = await new EmailCampaignGenerator().generate({
|
|
35
|
-
brief,
|
|
36
|
-
variant: "announcement"
|
|
37
|
-
});
|
|
38
|
-
const social = await new SocialPostGenerator().generate(brief);
|
|
39
|
-
const seo = new SeoOptimizer().optimize(brief);
|
|
40
|
-
logger.info("Generated content assets", {
|
|
41
|
-
blogIntro: blog.intro,
|
|
42
|
-
landingHero: landing.hero,
|
|
43
|
-
emailSubject: email.subject,
|
|
44
|
-
socialPosts: social.map((post) => post.body),
|
|
45
|
-
seo
|
|
46
|
-
});
|
|
47
|
-
}
|
|
48
|
-
export {
|
|
49
|
-
runContentGenerationExample
|
|
50
|
-
};
|
|
1
|
+
import{BlogGenerator as y,EmailCampaignGenerator as A,LandingPageGenerator as D,SocialPostGenerator as F}from"@contractspec/lib.content-gen/generators";import{SeoOptimizer as H}from"@contractspec/lib.content-gen/seo";import{Logger as I,LogLevel as J}from"@contractspec/lib.logger";var K=new I({level:J.INFO,environment:"production",enableColors:!1});async function R(){let h={title:"AI-Native Operations Copilot",summary:"Automates support resolutions, growth playbooks, and DevOps rituals.",problems:["Support queues pile up after hours","Growth teams lack fresh experiments"],solutions:["Stateful AI agents grounded in your knowledge spaces","CI-safe approval workflows for human review","Analytics + experimentation stack built into ContractSpec"],metrics:["80% auto-resolution rate","10+ experiments shipped weekly"],audience:{role:"COO",industry:"Fintech",maturity:"scaleup"},callToAction:"Book a 15‑minute pilot run"},j=await new y().generate(h),k=await new D().generate(h),q=await new A().generate({brief:h,variant:"announcement"}),u=await new F().generate(h),w=new H().optimize(h);K.info("Generated content assets",{blogIntro:j.intro,landingHero:k.hero,emailSubject:q.subject,socialPosts:u.map((x)=>x.body),seo:w})}export{R as runContentGenerationExample};
|
package/dist/node/index.js
CHANGED
|
@@ -1,34 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
import { defineFeature } from "@contractspec/lib.contracts-spec";
|
|
3
|
-
var ContentGenerationFeature = defineFeature({
|
|
4
|
-
meta: {
|
|
5
|
-
key: "content-generation",
|
|
6
|
-
version: "1.0.0",
|
|
7
|
-
title: "Content Generation",
|
|
8
|
-
description: "AI content generation for blog posts, landing pages, emails, and social media",
|
|
9
|
-
domain: "content",
|
|
10
|
-
owners: ["@examples"],
|
|
11
|
-
tags: ["content", "ai", "generation"],
|
|
12
|
-
stability: "experimental"
|
|
13
|
-
},
|
|
14
|
-
docs: [
|
|
15
|
-
"docs.examples.content-generation",
|
|
16
|
-
"docs.examples.content-generation.usage"
|
|
17
|
-
]
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
// src/docs/content-generation.docblock.ts
|
|
21
|
-
import { registerDocBlocks } from "@contractspec/lib.contracts-spec/docs";
|
|
22
|
-
var blocks = [
|
|
23
|
-
{
|
|
24
|
-
id: "docs.examples.content-generation",
|
|
25
|
-
title: "Content Generation (example)",
|
|
26
|
-
summary: "Generate a consistent set of marketing assets from a typed ContentBrief (blog, landing hero, email, social, SEO).",
|
|
27
|
-
kind: "reference",
|
|
28
|
-
visibility: "public",
|
|
29
|
-
route: "/docs/examples/content-generation",
|
|
30
|
-
tags: ["content", "marketing", "example"],
|
|
31
|
-
body: `## What this example shows
|
|
1
|
+
import{defineFeature as y}from"@contractspec/lib.contracts-spec";var Y=y({meta:{key:"content-generation",version:"1.0.0",title:"Content Generation",description:"AI content generation for blog posts, landing pages, emails, and social media",domain:"content",owners:["@examples"],tags:["content","ai","generation"],stability:"experimental"},docs:["docs.examples.content-generation","docs.examples.content-generation.usage"]});import{registerDocBlocks as A}from"@contractspec/lib.contracts-spec/docs";var H=[{id:"docs.examples.content-generation",title:"Content Generation (example)",summary:"Generate a consistent set of marketing assets from a typed ContentBrief (blog, landing hero, email, social, SEO).",kind:"reference",visibility:"public",route:"/docs/examples/content-generation",tags:["content","marketing","example"],body:`## What this example shows
|
|
32
2
|
- A spec-first-ish interface for content brief inputs (typed, validated).
|
|
33
3
|
- Deterministic orchestration of generators (same input → same structure).
|
|
34
4
|
|
|
@@ -37,106 +7,4 @@ var blocks = [
|
|
|
37
7
|
- Landing hero
|
|
38
8
|
- Email subject/body
|
|
39
9
|
- Social post bodies
|
|
40
|
-
- SEO metadata`
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
id: "docs.examples.content-generation.usage",
|
|
44
|
-
title: "Content Generation — Usage",
|
|
45
|
-
summary: "How to run the example and extend the brief.",
|
|
46
|
-
kind: "usage",
|
|
47
|
-
visibility: "public",
|
|
48
|
-
route: "/docs/examples/content-generation/usage",
|
|
49
|
-
tags: ["content", "usage"],
|
|
50
|
-
body: `## Usage
|
|
51
|
-
- Call \`runContentGenerationExample()\`.
|
|
52
|
-
- Modify the \`ContentBrief\` fields to drive different outputs.
|
|
53
|
-
|
|
54
|
-
## Guardrails
|
|
55
|
-
- Avoid PII in briefs.
|
|
56
|
-
- Keep output logging structured; no raw \`console.log\` in library code.`
|
|
57
|
-
}
|
|
58
|
-
];
|
|
59
|
-
registerDocBlocks(blocks);
|
|
60
|
-
// src/example.ts
|
|
61
|
-
import { defineExample } from "@contractspec/lib.contracts-spec";
|
|
62
|
-
var example = defineExample({
|
|
63
|
-
meta: {
|
|
64
|
-
key: "content-generation",
|
|
65
|
-
version: "1.0.0",
|
|
66
|
-
title: "Content Generation",
|
|
67
|
-
description: "Generate blog/landing/email/social/SEO assets from a typed ContentBrief using @contractspec/lib.content-gen.",
|
|
68
|
-
kind: "script",
|
|
69
|
-
visibility: "public",
|
|
70
|
-
stability: "experimental",
|
|
71
|
-
owners: ["@platform.core"],
|
|
72
|
-
tags: ["content", "marketing", "generation", "ai"]
|
|
73
|
-
},
|
|
74
|
-
docs: {
|
|
75
|
-
rootDocId: "docs.examples.content-generation",
|
|
76
|
-
usageDocId: "docs.examples.content-generation.usage"
|
|
77
|
-
},
|
|
78
|
-
entrypoints: {
|
|
79
|
-
packageName: "@contractspec/example.content-generation",
|
|
80
|
-
docs: "./docs"
|
|
81
|
-
},
|
|
82
|
-
surfaces: {
|
|
83
|
-
templates: true,
|
|
84
|
-
sandbox: { enabled: true, modes: ["markdown"] },
|
|
85
|
-
studio: { enabled: true, installable: true },
|
|
86
|
-
mcp: { enabled: true }
|
|
87
|
-
}
|
|
88
|
-
});
|
|
89
|
-
var example_default = example;
|
|
90
|
-
|
|
91
|
-
// src/generate.ts
|
|
92
|
-
import {
|
|
93
|
-
BlogGenerator,
|
|
94
|
-
EmailCampaignGenerator,
|
|
95
|
-
LandingPageGenerator,
|
|
96
|
-
SocialPostGenerator
|
|
97
|
-
} from "@contractspec/lib.content-gen/generators";
|
|
98
|
-
import { SeoOptimizer } from "@contractspec/lib.content-gen/seo";
|
|
99
|
-
import { Logger, LogLevel } from "@contractspec/lib.logger";
|
|
100
|
-
var logger = new Logger({
|
|
101
|
-
level: LogLevel.INFO,
|
|
102
|
-
environment: "production",
|
|
103
|
-
enableColors: false
|
|
104
|
-
});
|
|
105
|
-
async function runContentGenerationExample() {
|
|
106
|
-
const brief = {
|
|
107
|
-
title: "AI-Native Operations Copilot",
|
|
108
|
-
summary: "Automates support resolutions, growth playbooks, and DevOps rituals.",
|
|
109
|
-
problems: [
|
|
110
|
-
"Support queues pile up after hours",
|
|
111
|
-
"Growth teams lack fresh experiments"
|
|
112
|
-
],
|
|
113
|
-
solutions: [
|
|
114
|
-
"Stateful AI agents grounded in your knowledge spaces",
|
|
115
|
-
"CI-safe approval workflows for human review",
|
|
116
|
-
"Analytics + experimentation stack built into ContractSpec"
|
|
117
|
-
],
|
|
118
|
-
metrics: ["80% auto-resolution rate", "10+ experiments shipped weekly"],
|
|
119
|
-
audience: { role: "COO", industry: "Fintech", maturity: "scaleup" },
|
|
120
|
-
callToAction: "Book a 15‑minute pilot run"
|
|
121
|
-
};
|
|
122
|
-
const blog = await new BlogGenerator().generate(brief);
|
|
123
|
-
const landing = await new LandingPageGenerator().generate(brief);
|
|
124
|
-
const email = await new EmailCampaignGenerator().generate({
|
|
125
|
-
brief,
|
|
126
|
-
variant: "announcement"
|
|
127
|
-
});
|
|
128
|
-
const social = await new SocialPostGenerator().generate(brief);
|
|
129
|
-
const seo = new SeoOptimizer().optimize(brief);
|
|
130
|
-
logger.info("Generated content assets", {
|
|
131
|
-
blogIntro: blog.intro,
|
|
132
|
-
landingHero: landing.hero,
|
|
133
|
-
emailSubject: email.subject,
|
|
134
|
-
socialPosts: social.map((post) => post.body),
|
|
135
|
-
seo
|
|
136
|
-
});
|
|
137
|
-
}
|
|
138
|
-
export {
|
|
139
|
-
runContentGenerationExample,
|
|
140
|
-
example_default as example,
|
|
141
|
-
ContentGenerationFeature
|
|
142
|
-
};
|
|
10
|
+
- SEO metadata`},{id:"docs.examples.content-generation.usage",title:"Content Generation — Usage",summary:"How to run the example and extend the brief.",kind:"usage",visibility:"public",route:"/docs/examples/content-generation/usage",tags:["content","usage"],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."}];A(H);import{defineExample as I}from"@contractspec/lib.contracts-spec";var J=I({meta:{key:"content-generation",version:"1.0.0",title:"Content Generation",description:"Generate blog/landing/email/social/SEO assets from a typed ContentBrief using @contractspec/lib.content-gen.",kind:"script",visibility:"public",stability:"experimental",owners:["@platform.core"],tags:["content","marketing","generation","ai"]},docs:{rootDocId:"docs.examples.content-generation",usageDocId:"docs.examples.content-generation.usage"},entrypoints:{packageName:"@contractspec/example.content-generation",docs:"./docs"},surfaces:{templates:!0,sandbox:{enabled:!0,modes:["markdown"]},studio:{enabled:!0,installable:!0},mcp:{enabled:!0}}}),K=J;import{BlogGenerator as M,EmailCampaignGenerator as N,LandingPageGenerator as Q,SocialPostGenerator as R}from"@contractspec/lib.content-gen/generators";import{SeoOptimizer as T}from"@contractspec/lib.content-gen/seo";import{Logger as U,LogLevel as V}from"@contractspec/lib.logger";var W=new U({level:V.INFO,environment:"production",enableColors:!1});async function O(){let x={title:"AI-Native Operations Copilot",summary:"Automates support resolutions, growth playbooks, and DevOps rituals.",problems:["Support queues pile up after hours","Growth teams lack fresh experiments"],solutions:["Stateful AI agents grounded in your knowledge spaces","CI-safe approval workflows for human review","Analytics + experimentation stack built into ContractSpec"],metrics:["80% auto-resolution rate","10+ experiments shipped weekly"],audience:{role:"COO",industry:"Fintech",maturity:"scaleup"},callToAction:"Book a 15‑minute pilot run"},h=await new M().generate(x),j=await new Q().generate(x),m=await new N().generate({brief:x,variant:"announcement"}),q=await new R().generate(x),u=new T().optimize(x);W.info("Generated content assets",{blogIntro:h.intro,landingHero:j.hero,emailSubject:m.subject,socialPosts:q.map((w)=>w.body),seo:u})}export{O as runContentGenerationExample,K as example,Y as ContentGenerationFeature};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contractspec/example.content-generation",
|
|
3
|
-
"version": "3.7.
|
|
3
|
+
"version": "3.7.18",
|
|
4
4
|
"description": "Content generation example using @contractspec/lib.content-gen.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -57,21 +57,21 @@
|
|
|
57
57
|
"dev": "contractspec-bun-build dev",
|
|
58
58
|
"clean": "rimraf dist .turbo",
|
|
59
59
|
"lint": "bun lint:fix",
|
|
60
|
-
"lint:fix": "biome check --write --unsafe --only=nursery/useSortedClasses . && biome check --write .",
|
|
61
|
-
"lint:check": "biome check .",
|
|
60
|
+
"lint:fix": "node ../../../scripts/biome.cjs check --write --unsafe --only=nursery/useSortedClasses . && node ../../../scripts/biome.cjs check --write .",
|
|
61
|
+
"lint:check": "node ../../../scripts/biome.cjs check .",
|
|
62
62
|
"test": "bun test --pass-with-no-tests",
|
|
63
63
|
"prebuild": "contractspec-bun-build prebuild",
|
|
64
64
|
"typecheck": "tsc --noEmit"
|
|
65
65
|
},
|
|
66
66
|
"dependencies": {
|
|
67
|
-
"@contractspec/lib.contracts-spec": "5.
|
|
68
|
-
"@contractspec/lib.content-gen": "3.7.
|
|
67
|
+
"@contractspec/lib.contracts-spec": "5.2.0",
|
|
68
|
+
"@contractspec/lib.content-gen": "3.7.18",
|
|
69
69
|
"@contractspec/lib.logger": "3.7.13"
|
|
70
70
|
},
|
|
71
71
|
"devDependencies": {
|
|
72
72
|
"@contractspec/tool.typescript": "3.7.13",
|
|
73
73
|
"typescript": "^5.9.3",
|
|
74
|
-
"@contractspec/tool.bun": "3.7.
|
|
74
|
+
"@contractspec/tool.bun": "3.7.14"
|
|
75
75
|
},
|
|
76
76
|
"publishConfig": {
|
|
77
77
|
"access": "public",
|