@contractspec/example.content-generation 1.56.1 → 1.58.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.
- package/.turbo/turbo-build.log +32 -26
- package/.turbo/turbo-prebuild.log +1 -0
- package/CHANGELOG.md +32 -0
- package/dist/browser/docs/content-generation.docblock.js +40 -0
- package/dist/browser/docs/index.js +40 -0
- package/dist/browser/example.js +33 -0
- package/dist/browser/generate.js +50 -0
- package/dist/browser/index.js +122 -0
- package/dist/docs/content-generation.docblock.d.ts +2 -1
- package/dist/docs/content-generation.docblock.d.ts.map +1 -0
- package/dist/docs/content-generation.docblock.js +38 -26
- package/dist/docs/index.d.ts +2 -1
- package/dist/docs/index.d.ts.map +1 -0
- package/dist/docs/index.js +41 -1
- package/dist/example.d.ts +2 -6
- package/dist/example.d.ts.map +1 -1
- package/dist/example.js +31 -43
- package/dist/generate.d.ts +1 -4
- package/dist/generate.d.ts.map +1 -1
- package/dist/generate.js +47 -44
- package/dist/index.d.ts +4 -3
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +122 -4
- package/dist/node/docs/content-generation.docblock.js +40 -0
- package/dist/node/docs/index.js +40 -0
- package/dist/node/example.js +33 -0
- package/dist/node/generate.js +50 -0
- package/dist/node/index.js +122 -0
- package/package.json +62 -25
- package/tsdown.config.js +1 -2
- package/.turbo/turbo-build$colon$bundle.log +0 -25
- package/dist/docs/content-generation.docblock.js.map +0 -1
- package/dist/example.js.map +0 -1
- package/dist/generate.js.map +0 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,26 +1,32 @@
|
|
|
1
|
-
$ bun
|
|
2
|
-
$
|
|
3
|
-
$
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
1
|
+
$ contractspec-bun-build prebuild
|
|
2
|
+
$ bun run prebuild && bun run build:bundle && bun run build:types
|
|
3
|
+
$ contractspec-bun-build prebuild
|
|
4
|
+
$ contractspec-bun-build transpile
|
|
5
|
+
[contractspec-bun-build] transpile target=bun root=src entries=5
|
|
6
|
+
Bundled 5 modules in 19ms
|
|
7
|
+
|
|
8
|
+
docs/content-generation.docblock.js 1.36 KB (entry point)
|
|
9
|
+
./index.js 4.0 KB (entry point)
|
|
10
|
+
docs/index.js 1.36 KB (entry point)
|
|
11
|
+
./example.js 0.98 KB (entry point)
|
|
12
|
+
./generate.js 1.72 KB (entry point)
|
|
13
|
+
|
|
14
|
+
[contractspec-bun-build] transpile target=node root=src entries=5
|
|
15
|
+
Bundled 5 modules in 32ms
|
|
16
|
+
|
|
17
|
+
docs/content-generation.docblock.js 1.35 KB (entry point)
|
|
18
|
+
./index.js 4.0 KB (entry point)
|
|
19
|
+
docs/index.js 1.35 KB (entry point)
|
|
20
|
+
./example.js 0.97 KB (entry point)
|
|
21
|
+
./generate.js 1.71 KB (entry point)
|
|
22
|
+
|
|
23
|
+
[contractspec-bun-build] transpile target=browser root=src entries=5
|
|
24
|
+
Bundled 5 modules in 36ms
|
|
25
|
+
|
|
26
|
+
docs/content-generation.docblock.js 1.35 KB (entry point)
|
|
27
|
+
./index.js 4.0 KB (entry point)
|
|
28
|
+
docs/index.js 1.35 KB (entry point)
|
|
29
|
+
./example.js 0.97 KB (entry point)
|
|
30
|
+
./generate.js 1.71 KB (entry point)
|
|
31
|
+
|
|
32
|
+
$ contractspec-bun-build types
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
$ contractspec-bun-build prebuild
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,37 @@
|
|
|
1
1
|
# @contractspec/example.content-generation
|
|
2
2
|
|
|
3
|
+
## 1.58.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- d1f0fd0: chore: Migrate non-app package builds from tsdown to shared Bun tooling, add `@contractspec/tool.bun`, and standardize `prebuild`/`build`/`typecheck` with platform-aware exports and `tsc` declaration emission into `dist`.
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [d1f0fd0]
|
|
12
|
+
- Updated dependencies [4355a9e]
|
|
13
|
+
- @contractspec/lib.content-gen@1.58.0
|
|
14
|
+
- @contractspec/lib.contracts@1.58.0
|
|
15
|
+
- @contractspec/lib.logger@1.58.0
|
|
16
|
+
|
|
17
|
+
## 1.57.0
|
|
18
|
+
|
|
19
|
+
### Minor Changes
|
|
20
|
+
|
|
21
|
+
- 11a5a05: feat: improve product intent
|
|
22
|
+
|
|
23
|
+
### Patch Changes
|
|
24
|
+
|
|
25
|
+
- Updated dependencies [8ecf3c1]
|
|
26
|
+
- Updated dependencies [47c48c2]
|
|
27
|
+
- Updated dependencies [a119963]
|
|
28
|
+
- Updated dependencies [4651e06]
|
|
29
|
+
- Updated dependencies [ad9d10a]
|
|
30
|
+
- Updated dependencies [11a5a05]
|
|
31
|
+
- @contractspec/lib.contracts@1.57.0
|
|
32
|
+
- @contractspec/lib.content-gen@1.57.0
|
|
33
|
+
- @contractspec/lib.logger@1.57.0
|
|
34
|
+
|
|
3
35
|
## 1.56.1
|
|
4
36
|
|
|
5
37
|
### Patch Changes
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// src/docs/content-generation.docblock.ts
|
|
2
|
+
import { registerDocBlocks } from "@contractspec/lib.contracts/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
|
|
13
|
+
- A spec-first-ish interface for content brief inputs (typed, validated).
|
|
14
|
+
- Deterministic orchestration of generators (same input → same structure).
|
|
15
|
+
|
|
16
|
+
## Outputs
|
|
17
|
+
- Blog intro
|
|
18
|
+
- Landing hero
|
|
19
|
+
- Email subject/body
|
|
20
|
+
- 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);
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
// src/docs/content-generation.docblock.ts
|
|
2
|
+
import { registerDocBlocks } from "@contractspec/lib.contracts/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
|
|
13
|
+
- A spec-first-ish interface for content brief inputs (typed, validated).
|
|
14
|
+
- Deterministic orchestration of generators (same input → same structure).
|
|
15
|
+
|
|
16
|
+
## Outputs
|
|
17
|
+
- Blog intro
|
|
18
|
+
- Landing hero
|
|
19
|
+
- Email subject/body
|
|
20
|
+
- 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);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// src/example.ts
|
|
2
|
+
import { defineExample } from "@contractspec/lib.contracts";
|
|
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
|
+
};
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
// src/generate.ts
|
|
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.DEBUG,
|
|
12
|
+
environment: "development",
|
|
13
|
+
enableColors: true
|
|
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
|
+
};
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
// src/docs/content-generation.docblock.ts
|
|
2
|
+
import { registerDocBlocks } from "@contractspec/lib.contracts/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
|
|
13
|
+
- A spec-first-ish interface for content brief inputs (typed, validated).
|
|
14
|
+
- Deterministic orchestration of generators (same input → same structure).
|
|
15
|
+
|
|
16
|
+
## Outputs
|
|
17
|
+
- Blog intro
|
|
18
|
+
- Landing hero
|
|
19
|
+
- Email subject/body
|
|
20
|
+
- 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);
|
|
41
|
+
// src/example.ts
|
|
42
|
+
import { defineExample } from "@contractspec/lib.contracts";
|
|
43
|
+
var example = defineExample({
|
|
44
|
+
meta: {
|
|
45
|
+
key: "content-generation",
|
|
46
|
+
version: "1.0.0",
|
|
47
|
+
title: "Content Generation",
|
|
48
|
+
description: "Generate blog/landing/email/social/SEO assets from a typed ContentBrief using @contractspec/lib.content-gen.",
|
|
49
|
+
kind: "script",
|
|
50
|
+
visibility: "public",
|
|
51
|
+
stability: "experimental",
|
|
52
|
+
owners: ["@platform.core"],
|
|
53
|
+
tags: ["content", "marketing", "generation", "ai"]
|
|
54
|
+
},
|
|
55
|
+
docs: {
|
|
56
|
+
rootDocId: "docs.examples.content-generation",
|
|
57
|
+
usageDocId: "docs.examples.content-generation.usage"
|
|
58
|
+
},
|
|
59
|
+
entrypoints: {
|
|
60
|
+
packageName: "@contractspec/example.content-generation",
|
|
61
|
+
docs: "./docs"
|
|
62
|
+
},
|
|
63
|
+
surfaces: {
|
|
64
|
+
templates: true,
|
|
65
|
+
sandbox: { enabled: true, modes: ["markdown"] },
|
|
66
|
+
studio: { enabled: true, installable: true },
|
|
67
|
+
mcp: { enabled: true }
|
|
68
|
+
}
|
|
69
|
+
});
|
|
70
|
+
var example_default = example;
|
|
71
|
+
|
|
72
|
+
// src/generate.ts
|
|
73
|
+
import {
|
|
74
|
+
BlogGenerator,
|
|
75
|
+
EmailCampaignGenerator,
|
|
76
|
+
LandingPageGenerator,
|
|
77
|
+
SocialPostGenerator
|
|
78
|
+
} from "@contractspec/lib.content-gen/generators";
|
|
79
|
+
import { SeoOptimizer } from "@contractspec/lib.content-gen/seo";
|
|
80
|
+
import { Logger, LogLevel } from "@contractspec/lib.logger";
|
|
81
|
+
var logger = new Logger({
|
|
82
|
+
level: LogLevel.DEBUG,
|
|
83
|
+
environment: "development",
|
|
84
|
+
enableColors: true
|
|
85
|
+
});
|
|
86
|
+
async function runContentGenerationExample() {
|
|
87
|
+
const brief = {
|
|
88
|
+
title: "AI-Native Operations Copilot",
|
|
89
|
+
summary: "Automates support resolutions, growth playbooks, and DevOps rituals.",
|
|
90
|
+
problems: [
|
|
91
|
+
"Support queues pile up after hours",
|
|
92
|
+
"Growth teams lack fresh experiments"
|
|
93
|
+
],
|
|
94
|
+
solutions: [
|
|
95
|
+
"Stateful AI agents grounded in your knowledge spaces",
|
|
96
|
+
"CI-safe approval workflows for human review",
|
|
97
|
+
"Analytics + experimentation stack built into ContractSpec"
|
|
98
|
+
],
|
|
99
|
+
metrics: ["80% auto-resolution rate", "10+ experiments shipped weekly"],
|
|
100
|
+
audience: { role: "COO", industry: "Fintech", maturity: "scaleup" },
|
|
101
|
+
callToAction: "Book a 15‑minute pilot run"
|
|
102
|
+
};
|
|
103
|
+
const blog = await new BlogGenerator().generate(brief);
|
|
104
|
+
const landing = await new LandingPageGenerator().generate(brief);
|
|
105
|
+
const email = await new EmailCampaignGenerator().generate({
|
|
106
|
+
brief,
|
|
107
|
+
variant: "announcement"
|
|
108
|
+
});
|
|
109
|
+
const social = await new SocialPostGenerator().generate(brief);
|
|
110
|
+
const seo = new SeoOptimizer().optimize(brief);
|
|
111
|
+
logger.info("Generated content assets", {
|
|
112
|
+
blogIntro: blog.intro,
|
|
113
|
+
landingHero: landing.hero,
|
|
114
|
+
emailSubject: email.subject,
|
|
115
|
+
socialPosts: social.map((post) => post.body),
|
|
116
|
+
seo
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
export {
|
|
120
|
+
runContentGenerationExample,
|
|
121
|
+
example_default as example
|
|
122
|
+
};
|
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export {};
|
|
2
|
+
//# sourceMappingURL=content-generation.docblock.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"content-generation.docblock.d.ts","sourceRoot":"","sources":["../../src/docs/content-generation.docblock.ts"],"names":[],"mappings":""}
|
|
@@ -1,29 +1,41 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// src/docs/content-generation.docblock.ts
|
|
1
3
|
import { registerDocBlocks } from "@contractspec/lib.contracts/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
|
|
14
|
+
- A spec-first-ish interface for content brief inputs (typed, validated).
|
|
15
|
+
- Deterministic orchestration of generators (same input \u2192 same structure).
|
|
2
16
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
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
|
-
}]);
|
|
17
|
+
## Outputs
|
|
18
|
+
- Blog intro
|
|
19
|
+
- Landing hero
|
|
20
|
+
- Email subject/body
|
|
21
|
+
- 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.
|
|
27
35
|
|
|
28
|
-
|
|
29
|
-
|
|
36
|
+
## Guardrails
|
|
37
|
+
- Avoid PII in briefs.
|
|
38
|
+
- Keep output logging structured; no raw \`console.log\` in library code.`
|
|
39
|
+
}
|
|
40
|
+
];
|
|
41
|
+
registerDocBlocks(blocks);
|
package/dist/docs/index.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
|
|
1
|
+
import './content-generation.docblock';
|
|
2
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/docs/index.ts"],"names":[],"mappings":"AAAA,OAAO,+BAA+B,CAAC"}
|
package/dist/docs/index.js
CHANGED
|
@@ -1 +1,41 @@
|
|
|
1
|
-
|
|
1
|
+
// @bun
|
|
2
|
+
// src/docs/content-generation.docblock.ts
|
|
3
|
+
import { registerDocBlocks } from "@contractspec/lib.contracts/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
|
|
14
|
+
- A spec-first-ish interface for content brief inputs (typed, validated).
|
|
15
|
+
- Deterministic orchestration of generators (same input \u2192 same structure).
|
|
16
|
+
|
|
17
|
+
## Outputs
|
|
18
|
+
- Blog intro
|
|
19
|
+
- Landing hero
|
|
20
|
+
- Email subject/body
|
|
21
|
+
- 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);
|
package/dist/example.d.ts
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
//#region src/example.d.ts
|
|
4
|
-
declare const example: _contractspec_lib_contracts0.ExampleSpec;
|
|
5
|
-
//#endregion
|
|
6
|
-
export { example as default };
|
|
1
|
+
declare const example: import("@contractspec/lib.contracts").ExampleSpec;
|
|
2
|
+
export default example;
|
|
7
3
|
//# sourceMappingURL=example.d.ts.map
|
package/dist/example.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"example.d.ts","
|
|
1
|
+
{"version":3,"file":"example.d.ts","sourceRoot":"","sources":["../src/example.ts"],"names":[],"mappings":"AAEA,QAAA,MAAM,OAAO,mDA2BX,CAAC;AAEH,eAAe,OAAO,CAAC"}
|
package/dist/example.js
CHANGED
|
@@ -1,46 +1,34 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// src/example.ts
|
|
1
3
|
import { defineExample } from "@contractspec/lib.contracts";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
},
|
|
29
|
-
surfaces: {
|
|
30
|
-
templates: true,
|
|
31
|
-
sandbox: {
|
|
32
|
-
enabled: true,
|
|
33
|
-
modes: ["markdown"]
|
|
34
|
-
},
|
|
35
|
-
studio: {
|
|
36
|
-
enabled: true,
|
|
37
|
-
installable: true
|
|
38
|
-
},
|
|
39
|
-
mcp: { enabled: true }
|
|
40
|
-
}
|
|
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
|
+
}
|
|
41
30
|
});
|
|
42
31
|
var example_default = example;
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
//# sourceMappingURL=example.js.map
|
|
32
|
+
export {
|
|
33
|
+
example_default as default
|
|
34
|
+
};
|
package/dist/generate.d.ts
CHANGED
package/dist/generate.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.d.ts","
|
|
1
|
+
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../src/generate.ts"],"names":[],"mappings":"AAkBA,wBAAsB,2BAA2B,IAAI,OAAO,CAAC,IAAI,CAAC,CAmCjE"}
|