@contractspec/example.video-marketing-clip 2.1.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 +35 -0
- package/.turbo/turbo-prebuild.log +1 -0
- package/CHANGELOG.md +14 -0
- package/dist/briefs.d.ts +13 -0
- package/dist/briefs.js +75 -0
- package/dist/browser/briefs.js +74 -0
- package/dist/browser/docs/index.js +67 -0
- package/dist/browser/docs/video-marketing-clip.docblock.js +67 -0
- package/dist/browser/example.js +33 -0
- package/dist/browser/generate-clip.js +29 -0
- package/dist/browser/index.js +201 -0
- package/dist/docs/index.d.ts +1 -0
- package/dist/docs/index.js +68 -0
- package/dist/docs/video-marketing-clip.docblock.d.ts +1 -0
- package/dist/docs/video-marketing-clip.docblock.js +68 -0
- package/dist/example.d.ts +2 -0
- package/dist/example.js +34 -0
- package/dist/generate-clip.d.ts +35 -0
- package/dist/generate-clip.js +30 -0
- package/dist/index.d.ts +4 -0
- package/dist/index.js +202 -0
- package/dist/node/briefs.js +74 -0
- package/dist/node/docs/index.js +67 -0
- package/dist/node/docs/video-marketing-clip.docblock.js +67 -0
- package/dist/node/example.js +33 -0
- package/dist/node/generate-clip.js +29 -0
- package/dist/node/index.js +201 -0
- package/package.json +145 -0
- package/src/briefs.ts +88 -0
- package/src/docs/index.ts +1 -0
- package/src/docs/video-marketing-clip.docblock.ts +70 -0
- package/src/example.ts +32 -0
- package/src/generate-clip.ts +79 -0
- package/src/index.ts +6 -0
- package/tsconfig.json +9 -0
- package/tsdown.config.js +3 -0
|
@@ -0,0 +1,35 @@
|
|
|
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=6
|
|
6
|
+
Bundled 6 modules in 32ms
|
|
7
|
+
|
|
8
|
+
./briefs.js 2.65 KB (entry point)
|
|
9
|
+
./index.js 7.76 KB (entry point)
|
|
10
|
+
docs/index.js 3.12 KB (entry point)
|
|
11
|
+
docs/video-marketing-clip.docblock.js 3.12 KB (entry point)
|
|
12
|
+
./example.js 1.00 KB (entry point)
|
|
13
|
+
./generate-clip.js 1.0 KB (entry point)
|
|
14
|
+
|
|
15
|
+
[contractspec-bun-build] transpile target=node root=src entries=6
|
|
16
|
+
Bundled 6 modules in 54ms
|
|
17
|
+
|
|
18
|
+
./briefs.js 2.64 KB (entry point)
|
|
19
|
+
./index.js 7.76 KB (entry point)
|
|
20
|
+
docs/index.js 3.11 KB (entry point)
|
|
21
|
+
docs/video-marketing-clip.docblock.js 3.11 KB (entry point)
|
|
22
|
+
./example.js 0.99 KB (entry point)
|
|
23
|
+
./generate-clip.js 1.0 KB (entry point)
|
|
24
|
+
|
|
25
|
+
[contractspec-bun-build] transpile target=browser root=src entries=6
|
|
26
|
+
Bundled 6 modules in 32ms
|
|
27
|
+
|
|
28
|
+
./briefs.js 2.64 KB (entry point)
|
|
29
|
+
./index.js 7.76 KB (entry point)
|
|
30
|
+
docs/index.js 3.11 KB (entry point)
|
|
31
|
+
docs/video-marketing-clip.docblock.js 3.11 KB (entry point)
|
|
32
|
+
./example.js 0.99 KB (entry point)
|
|
33
|
+
./generate-clip.js 1.0 KB (entry point)
|
|
34
|
+
|
|
35
|
+
$ contractspec-bun-build types
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
$ contractspec-bun-build prebuild
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# @contractspec/example.video-marketing-clip
|
|
2
|
+
|
|
3
|
+
## 2.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- ac88935: chore: add examples
|
|
8
|
+
|
|
9
|
+
### Patch Changes
|
|
10
|
+
|
|
11
|
+
- Updated dependencies [57e2819]
|
|
12
|
+
- @contractspec/lib.contracts-spec@2.1.1
|
|
13
|
+
- @contractspec/lib.content-gen@2.1.1
|
|
14
|
+
- @contractspec/lib.video-gen@1.42.1
|
package/dist/briefs.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { ContentBrief } from '@contractspec/lib.content-gen/types';
|
|
2
|
+
/**
|
|
3
|
+
* Product launch brief -- announcing ContractSpec to the market.
|
|
4
|
+
*/
|
|
5
|
+
export declare const productLaunchBrief: ContentBrief;
|
|
6
|
+
/**
|
|
7
|
+
* Feature announcement brief -- new MCP tool generation.
|
|
8
|
+
*/
|
|
9
|
+
export declare const featureAnnouncementBrief: ContentBrief;
|
|
10
|
+
/**
|
|
11
|
+
* Case study brief -- customer success story.
|
|
12
|
+
*/
|
|
13
|
+
export declare const caseStudyBrief: ContentBrief;
|
package/dist/briefs.js
ADDED
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// @bun
|
|
2
|
+
// src/briefs.ts
|
|
3
|
+
var productLaunchBrief = {
|
|
4
|
+
title: "Ship APIs 10x Faster with ContractSpec",
|
|
5
|
+
summary: "ContractSpec generates REST, GraphQL, DB schemas, SDKs, and MCP tools from a single spec definition.",
|
|
6
|
+
problems: [
|
|
7
|
+
"Teams rewrite the same API logic across multiple surfaces",
|
|
8
|
+
"Manual synchronization leads to inconsistent endpoints",
|
|
9
|
+
"Schema drift between frontend, backend, and documentation"
|
|
10
|
+
],
|
|
11
|
+
solutions: [
|
|
12
|
+
"One spec, every surface -- define once, generate everything",
|
|
13
|
+
"Deterministic output -- same spec always produces the same code",
|
|
14
|
+
"Fully ejectable -- no lock-in, standard TypeScript"
|
|
15
|
+
],
|
|
16
|
+
metrics: [
|
|
17
|
+
"10x faster API development",
|
|
18
|
+
"Zero schema drift across surfaces",
|
|
19
|
+
"18 generated files from 3 contracts"
|
|
20
|
+
],
|
|
21
|
+
audience: {
|
|
22
|
+
role: "Engineering Lead",
|
|
23
|
+
industry: "SaaS",
|
|
24
|
+
painPoints: ["API maintenance burden", "Cross-surface consistency"]
|
|
25
|
+
},
|
|
26
|
+
callToAction: "Try ContractSpec today at contractspec.dev"
|
|
27
|
+
};
|
|
28
|
+
var featureAnnouncementBrief = {
|
|
29
|
+
title: "Now Generating MCP Tools from Your Specs",
|
|
30
|
+
summary: "ContractSpec v2 adds automatic MCP tool generation -- your contracts now power AI assistants natively.",
|
|
31
|
+
problems: [
|
|
32
|
+
"Building MCP tools manually is tedious and error-prone",
|
|
33
|
+
"AI assistants need structured tool definitions that stay in sync with APIs"
|
|
34
|
+
],
|
|
35
|
+
solutions: [
|
|
36
|
+
"Automatic MCP tool generation from existing contract specs",
|
|
37
|
+
"Type-safe tool definitions with Zod schema validation",
|
|
38
|
+
"Zero additional configuration -- just build"
|
|
39
|
+
],
|
|
40
|
+
audience: {
|
|
41
|
+
role: "Developer",
|
|
42
|
+
painPoints: ["MCP integration complexity"]
|
|
43
|
+
},
|
|
44
|
+
callToAction: "Upgrade to ContractSpec v2"
|
|
45
|
+
};
|
|
46
|
+
var caseStudyBrief = {
|
|
47
|
+
title: "How Acme Corp Cut API Dev Time by 80%",
|
|
48
|
+
summary: "Acme Corp migrated 47 endpoints to ContractSpec and eliminated manual synchronization across 5 surfaces.",
|
|
49
|
+
problems: [
|
|
50
|
+
"47 REST endpoints maintained manually across 3 teams",
|
|
51
|
+
"GraphQL schema constantly out of sync with REST",
|
|
52
|
+
"SDK updates lagged behind API changes by weeks"
|
|
53
|
+
],
|
|
54
|
+
solutions: [
|
|
55
|
+
"Migrated to ContractSpec in 2 weeks",
|
|
56
|
+
"Single source of truth for all 47 endpoints",
|
|
57
|
+
"Automated SDK and documentation generation"
|
|
58
|
+
],
|
|
59
|
+
metrics: [
|
|
60
|
+
"80% reduction in API development time",
|
|
61
|
+
"Zero sync issues since migration",
|
|
62
|
+
"3 teams now share one spec repository"
|
|
63
|
+
],
|
|
64
|
+
audience: {
|
|
65
|
+
role: "CTO",
|
|
66
|
+
industry: "FinTech",
|
|
67
|
+
painPoints: ["API maintenance costs", "Team coordination"]
|
|
68
|
+
},
|
|
69
|
+
callToAction: "Read the full case study at contractspec.dev/customers"
|
|
70
|
+
};
|
|
71
|
+
export {
|
|
72
|
+
productLaunchBrief,
|
|
73
|
+
featureAnnouncementBrief,
|
|
74
|
+
caseStudyBrief
|
|
75
|
+
};
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
// src/briefs.ts
|
|
2
|
+
var productLaunchBrief = {
|
|
3
|
+
title: "Ship APIs 10x Faster with ContractSpec",
|
|
4
|
+
summary: "ContractSpec generates REST, GraphQL, DB schemas, SDKs, and MCP tools from a single spec definition.",
|
|
5
|
+
problems: [
|
|
6
|
+
"Teams rewrite the same API logic across multiple surfaces",
|
|
7
|
+
"Manual synchronization leads to inconsistent endpoints",
|
|
8
|
+
"Schema drift between frontend, backend, and documentation"
|
|
9
|
+
],
|
|
10
|
+
solutions: [
|
|
11
|
+
"One spec, every surface -- define once, generate everything",
|
|
12
|
+
"Deterministic output -- same spec always produces the same code",
|
|
13
|
+
"Fully ejectable -- no lock-in, standard TypeScript"
|
|
14
|
+
],
|
|
15
|
+
metrics: [
|
|
16
|
+
"10x faster API development",
|
|
17
|
+
"Zero schema drift across surfaces",
|
|
18
|
+
"18 generated files from 3 contracts"
|
|
19
|
+
],
|
|
20
|
+
audience: {
|
|
21
|
+
role: "Engineering Lead",
|
|
22
|
+
industry: "SaaS",
|
|
23
|
+
painPoints: ["API maintenance burden", "Cross-surface consistency"]
|
|
24
|
+
},
|
|
25
|
+
callToAction: "Try ContractSpec today at contractspec.dev"
|
|
26
|
+
};
|
|
27
|
+
var featureAnnouncementBrief = {
|
|
28
|
+
title: "Now Generating MCP Tools from Your Specs",
|
|
29
|
+
summary: "ContractSpec v2 adds automatic MCP tool generation -- your contracts now power AI assistants natively.",
|
|
30
|
+
problems: [
|
|
31
|
+
"Building MCP tools manually is tedious and error-prone",
|
|
32
|
+
"AI assistants need structured tool definitions that stay in sync with APIs"
|
|
33
|
+
],
|
|
34
|
+
solutions: [
|
|
35
|
+
"Automatic MCP tool generation from existing contract specs",
|
|
36
|
+
"Type-safe tool definitions with Zod schema validation",
|
|
37
|
+
"Zero additional configuration -- just build"
|
|
38
|
+
],
|
|
39
|
+
audience: {
|
|
40
|
+
role: "Developer",
|
|
41
|
+
painPoints: ["MCP integration complexity"]
|
|
42
|
+
},
|
|
43
|
+
callToAction: "Upgrade to ContractSpec v2"
|
|
44
|
+
};
|
|
45
|
+
var caseStudyBrief = {
|
|
46
|
+
title: "How Acme Corp Cut API Dev Time by 80%",
|
|
47
|
+
summary: "Acme Corp migrated 47 endpoints to ContractSpec and eliminated manual synchronization across 5 surfaces.",
|
|
48
|
+
problems: [
|
|
49
|
+
"47 REST endpoints maintained manually across 3 teams",
|
|
50
|
+
"GraphQL schema constantly out of sync with REST",
|
|
51
|
+
"SDK updates lagged behind API changes by weeks"
|
|
52
|
+
],
|
|
53
|
+
solutions: [
|
|
54
|
+
"Migrated to ContractSpec in 2 weeks",
|
|
55
|
+
"Single source of truth for all 47 endpoints",
|
|
56
|
+
"Automated SDK and documentation generation"
|
|
57
|
+
],
|
|
58
|
+
metrics: [
|
|
59
|
+
"80% reduction in API development time",
|
|
60
|
+
"Zero sync issues since migration",
|
|
61
|
+
"3 teams now share one spec repository"
|
|
62
|
+
],
|
|
63
|
+
audience: {
|
|
64
|
+
role: "CTO",
|
|
65
|
+
industry: "FinTech",
|
|
66
|
+
painPoints: ["API maintenance costs", "Team coordination"]
|
|
67
|
+
},
|
|
68
|
+
callToAction: "Read the full case study at contractspec.dev/customers"
|
|
69
|
+
};
|
|
70
|
+
export {
|
|
71
|
+
productLaunchBrief,
|
|
72
|
+
featureAnnouncementBrief,
|
|
73
|
+
caseStudyBrief
|
|
74
|
+
};
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// src/docs/video-marketing-clip.docblock.ts
|
|
2
|
+
import { registerDocBlocks } from "@contractspec/lib.contracts-spec/docs";
|
|
3
|
+
var blocks = [
|
|
4
|
+
{
|
|
5
|
+
id: "docs.examples.video-marketing-clip",
|
|
6
|
+
title: "Video Marketing Clips (example)",
|
|
7
|
+
summary: "End-to-end example: generate short-form social clips from content briefs using the deterministic video-gen pipeline.",
|
|
8
|
+
kind: "reference",
|
|
9
|
+
visibility: "public",
|
|
10
|
+
route: "/docs/examples/video-marketing-clip",
|
|
11
|
+
tags: ["video", "marketing", "social-clip", "example"],
|
|
12
|
+
body: `## What this example shows
|
|
13
|
+
|
|
14
|
+
- Building a \`VideoBrief\` from a \`ContentBrief\` with format, duration, and style settings.
|
|
15
|
+
- Using \`VideoGenerator\` in fully deterministic mode (no LLM) to produce a \`VideoProject\`.
|
|
16
|
+
- Generating video projects for all three social formats: landscape (16:9), square (1:1), and portrait (9:16).
|
|
17
|
+
- Accessing the resulting scene graph, durations, and composition props.
|
|
18
|
+
|
|
19
|
+
## Key concepts
|
|
20
|
+
|
|
21
|
+
- **ContentBrief**: The narrative source (title, problems, solutions, CTA) from \`@contractspec/lib.content-gen\`.
|
|
22
|
+
- **VideoBrief**: Wraps ContentBrief with video-specific config (format, duration, narration, style).
|
|
23
|
+
- **VideoGenerator**: Orchestrates scene planning and project assembly. Deterministic by default.
|
|
24
|
+
- **VideoProject**: The output scene graph ready for rendering or preview.
|
|
25
|
+
|
|
26
|
+
## Notes
|
|
27
|
+
|
|
28
|
+
- No LLM or voice provider is needed -- the pipeline is fully deterministic.
|
|
29
|
+
- The example does not render to MP4 (that requires Node.js + \`@remotion/renderer\`). It produces the \`VideoProject\` data structure.
|
|
30
|
+
`
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
id: "docs.examples.video-marketing-clip.usage",
|
|
34
|
+
title: "Video Marketing Clips -- Usage",
|
|
35
|
+
summary: "How to generate marketing video projects from content briefs.",
|
|
36
|
+
kind: "usage",
|
|
37
|
+
visibility: "public",
|
|
38
|
+
route: "/docs/examples/video-marketing-clip/usage",
|
|
39
|
+
tags: ["video", "marketing", "usage"],
|
|
40
|
+
body: `## Usage
|
|
41
|
+
|
|
42
|
+
\`\`\`ts
|
|
43
|
+
import { generateMarketingClip } from "@contractspec/example.video-marketing-clip/generate-clip";
|
|
44
|
+
import { productLaunchBrief } from "@contractspec/example.video-marketing-clip/briefs";
|
|
45
|
+
|
|
46
|
+
// Generate a landscape video project
|
|
47
|
+
const project = await generateMarketingClip(productLaunchBrief, "landscape");
|
|
48
|
+
|
|
49
|
+
console.log(project.scenes.length); // number of scenes
|
|
50
|
+
console.log(project.totalDurationInFrames); // total frames
|
|
51
|
+
console.log(project.format); // { type: "landscape", width: 1920, height: 1080 }
|
|
52
|
+
|
|
53
|
+
// Generate all three format variants
|
|
54
|
+
const landscapes = await generateMarketingClip(productLaunchBrief, "landscape");
|
|
55
|
+
const square = await generateMarketingClip(productLaunchBrief, "square");
|
|
56
|
+
const portrait = await generateMarketingClip(productLaunchBrief, "portrait");
|
|
57
|
+
\`\`\`
|
|
58
|
+
|
|
59
|
+
## Guardrails
|
|
60
|
+
|
|
61
|
+
- Keep content briefs concise -- the deterministic planner maps each section to a 2-5 second scene.
|
|
62
|
+
- Target duration defaults to ~17 seconds if not specified. Set \`targetDurationSeconds\` for precise control.
|
|
63
|
+
- The generated \`VideoProject\` is a data structure, not a rendered file. Use \`LocalRenderer\` for MP4 output.
|
|
64
|
+
`
|
|
65
|
+
}
|
|
66
|
+
];
|
|
67
|
+
registerDocBlocks(blocks);
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
// src/docs/video-marketing-clip.docblock.ts
|
|
2
|
+
import { registerDocBlocks } from "@contractspec/lib.contracts-spec/docs";
|
|
3
|
+
var blocks = [
|
|
4
|
+
{
|
|
5
|
+
id: "docs.examples.video-marketing-clip",
|
|
6
|
+
title: "Video Marketing Clips (example)",
|
|
7
|
+
summary: "End-to-end example: generate short-form social clips from content briefs using the deterministic video-gen pipeline.",
|
|
8
|
+
kind: "reference",
|
|
9
|
+
visibility: "public",
|
|
10
|
+
route: "/docs/examples/video-marketing-clip",
|
|
11
|
+
tags: ["video", "marketing", "social-clip", "example"],
|
|
12
|
+
body: `## What this example shows
|
|
13
|
+
|
|
14
|
+
- Building a \`VideoBrief\` from a \`ContentBrief\` with format, duration, and style settings.
|
|
15
|
+
- Using \`VideoGenerator\` in fully deterministic mode (no LLM) to produce a \`VideoProject\`.
|
|
16
|
+
- Generating video projects for all three social formats: landscape (16:9), square (1:1), and portrait (9:16).
|
|
17
|
+
- Accessing the resulting scene graph, durations, and composition props.
|
|
18
|
+
|
|
19
|
+
## Key concepts
|
|
20
|
+
|
|
21
|
+
- **ContentBrief**: The narrative source (title, problems, solutions, CTA) from \`@contractspec/lib.content-gen\`.
|
|
22
|
+
- **VideoBrief**: Wraps ContentBrief with video-specific config (format, duration, narration, style).
|
|
23
|
+
- **VideoGenerator**: Orchestrates scene planning and project assembly. Deterministic by default.
|
|
24
|
+
- **VideoProject**: The output scene graph ready for rendering or preview.
|
|
25
|
+
|
|
26
|
+
## Notes
|
|
27
|
+
|
|
28
|
+
- No LLM or voice provider is needed -- the pipeline is fully deterministic.
|
|
29
|
+
- The example does not render to MP4 (that requires Node.js + \`@remotion/renderer\`). It produces the \`VideoProject\` data structure.
|
|
30
|
+
`
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
id: "docs.examples.video-marketing-clip.usage",
|
|
34
|
+
title: "Video Marketing Clips -- Usage",
|
|
35
|
+
summary: "How to generate marketing video projects from content briefs.",
|
|
36
|
+
kind: "usage",
|
|
37
|
+
visibility: "public",
|
|
38
|
+
route: "/docs/examples/video-marketing-clip/usage",
|
|
39
|
+
tags: ["video", "marketing", "usage"],
|
|
40
|
+
body: `## Usage
|
|
41
|
+
|
|
42
|
+
\`\`\`ts
|
|
43
|
+
import { generateMarketingClip } from "@contractspec/example.video-marketing-clip/generate-clip";
|
|
44
|
+
import { productLaunchBrief } from "@contractspec/example.video-marketing-clip/briefs";
|
|
45
|
+
|
|
46
|
+
// Generate a landscape video project
|
|
47
|
+
const project = await generateMarketingClip(productLaunchBrief, "landscape");
|
|
48
|
+
|
|
49
|
+
console.log(project.scenes.length); // number of scenes
|
|
50
|
+
console.log(project.totalDurationInFrames); // total frames
|
|
51
|
+
console.log(project.format); // { type: "landscape", width: 1920, height: 1080 }
|
|
52
|
+
|
|
53
|
+
// Generate all three format variants
|
|
54
|
+
const landscapes = await generateMarketingClip(productLaunchBrief, "landscape");
|
|
55
|
+
const square = await generateMarketingClip(productLaunchBrief, "square");
|
|
56
|
+
const portrait = await generateMarketingClip(productLaunchBrief, "portrait");
|
|
57
|
+
\`\`\`
|
|
58
|
+
|
|
59
|
+
## Guardrails
|
|
60
|
+
|
|
61
|
+
- Keep content briefs concise -- the deterministic planner maps each section to a 2-5 second scene.
|
|
62
|
+
- Target duration defaults to ~17 seconds if not specified. Set \`targetDurationSeconds\` for precise control.
|
|
63
|
+
- The generated \`VideoProject\` is a data structure, not a rendered file. Use \`LocalRenderer\` for MP4 output.
|
|
64
|
+
`
|
|
65
|
+
}
|
|
66
|
+
];
|
|
67
|
+
registerDocBlocks(blocks);
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// src/example.ts
|
|
2
|
+
import { defineExample } from "@contractspec/lib.contracts-spec";
|
|
3
|
+
var example = defineExample({
|
|
4
|
+
meta: {
|
|
5
|
+
key: "video-marketing-clip",
|
|
6
|
+
version: "1.0.0",
|
|
7
|
+
title: "Video Marketing Clips",
|
|
8
|
+
description: "Generate short-form marketing videos from content briefs using the deterministic video-gen pipeline.",
|
|
9
|
+
kind: "script",
|
|
10
|
+
visibility: "public",
|
|
11
|
+
stability: "experimental",
|
|
12
|
+
owners: ["@platform.core"],
|
|
13
|
+
tags: ["video", "marketing", "content-gen", "social-clip"]
|
|
14
|
+
},
|
|
15
|
+
docs: {
|
|
16
|
+
rootDocId: "docs.examples.video-marketing-clip",
|
|
17
|
+
usageDocId: "docs.examples.video-marketing-clip.usage"
|
|
18
|
+
},
|
|
19
|
+
entrypoints: {
|
|
20
|
+
packageName: "@contractspec/example.video-marketing-clip",
|
|
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,29 @@
|
|
|
1
|
+
// src/generate-clip.ts
|
|
2
|
+
import { VideoGenerator } from "@contractspec/lib.video-gen/generators";
|
|
3
|
+
import { VIDEO_FORMATS } from "@contractspec/lib.video-gen/design/layouts";
|
|
4
|
+
var FORMAT_MAP = {
|
|
5
|
+
landscape: VIDEO_FORMATS.landscape,
|
|
6
|
+
square: VIDEO_FORMATS.square,
|
|
7
|
+
portrait: VIDEO_FORMATS.portrait
|
|
8
|
+
};
|
|
9
|
+
async function generateMarketingClip(brief, format = "landscape", targetDurationSeconds) {
|
|
10
|
+
const generator = new VideoGenerator({ fps: 30 });
|
|
11
|
+
const videoBrief = {
|
|
12
|
+
content: brief,
|
|
13
|
+
format: FORMAT_MAP[format],
|
|
14
|
+
targetDurationSeconds
|
|
15
|
+
};
|
|
16
|
+
return generator.generate(videoBrief);
|
|
17
|
+
}
|
|
18
|
+
async function generateAllFormats(brief, targetDurationSeconds) {
|
|
19
|
+
const [landscape, square, portrait] = await Promise.all([
|
|
20
|
+
generateMarketingClip(brief, "landscape", targetDurationSeconds),
|
|
21
|
+
generateMarketingClip(brief, "square", targetDurationSeconds),
|
|
22
|
+
generateMarketingClip(brief, "portrait", targetDurationSeconds)
|
|
23
|
+
]);
|
|
24
|
+
return { landscape, square, portrait };
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
generateMarketingClip,
|
|
28
|
+
generateAllFormats
|
|
29
|
+
};
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
// src/briefs.ts
|
|
2
|
+
var productLaunchBrief = {
|
|
3
|
+
title: "Ship APIs 10x Faster with ContractSpec",
|
|
4
|
+
summary: "ContractSpec generates REST, GraphQL, DB schemas, SDKs, and MCP tools from a single spec definition.",
|
|
5
|
+
problems: [
|
|
6
|
+
"Teams rewrite the same API logic across multiple surfaces",
|
|
7
|
+
"Manual synchronization leads to inconsistent endpoints",
|
|
8
|
+
"Schema drift between frontend, backend, and documentation"
|
|
9
|
+
],
|
|
10
|
+
solutions: [
|
|
11
|
+
"One spec, every surface -- define once, generate everything",
|
|
12
|
+
"Deterministic output -- same spec always produces the same code",
|
|
13
|
+
"Fully ejectable -- no lock-in, standard TypeScript"
|
|
14
|
+
],
|
|
15
|
+
metrics: [
|
|
16
|
+
"10x faster API development",
|
|
17
|
+
"Zero schema drift across surfaces",
|
|
18
|
+
"18 generated files from 3 contracts"
|
|
19
|
+
],
|
|
20
|
+
audience: {
|
|
21
|
+
role: "Engineering Lead",
|
|
22
|
+
industry: "SaaS",
|
|
23
|
+
painPoints: ["API maintenance burden", "Cross-surface consistency"]
|
|
24
|
+
},
|
|
25
|
+
callToAction: "Try ContractSpec today at contractspec.dev"
|
|
26
|
+
};
|
|
27
|
+
var featureAnnouncementBrief = {
|
|
28
|
+
title: "Now Generating MCP Tools from Your Specs",
|
|
29
|
+
summary: "ContractSpec v2 adds automatic MCP tool generation -- your contracts now power AI assistants natively.",
|
|
30
|
+
problems: [
|
|
31
|
+
"Building MCP tools manually is tedious and error-prone",
|
|
32
|
+
"AI assistants need structured tool definitions that stay in sync with APIs"
|
|
33
|
+
],
|
|
34
|
+
solutions: [
|
|
35
|
+
"Automatic MCP tool generation from existing contract specs",
|
|
36
|
+
"Type-safe tool definitions with Zod schema validation",
|
|
37
|
+
"Zero additional configuration -- just build"
|
|
38
|
+
],
|
|
39
|
+
audience: {
|
|
40
|
+
role: "Developer",
|
|
41
|
+
painPoints: ["MCP integration complexity"]
|
|
42
|
+
},
|
|
43
|
+
callToAction: "Upgrade to ContractSpec v2"
|
|
44
|
+
};
|
|
45
|
+
var caseStudyBrief = {
|
|
46
|
+
title: "How Acme Corp Cut API Dev Time by 80%",
|
|
47
|
+
summary: "Acme Corp migrated 47 endpoints to ContractSpec and eliminated manual synchronization across 5 surfaces.",
|
|
48
|
+
problems: [
|
|
49
|
+
"47 REST endpoints maintained manually across 3 teams",
|
|
50
|
+
"GraphQL schema constantly out of sync with REST",
|
|
51
|
+
"SDK updates lagged behind API changes by weeks"
|
|
52
|
+
],
|
|
53
|
+
solutions: [
|
|
54
|
+
"Migrated to ContractSpec in 2 weeks",
|
|
55
|
+
"Single source of truth for all 47 endpoints",
|
|
56
|
+
"Automated SDK and documentation generation"
|
|
57
|
+
],
|
|
58
|
+
metrics: [
|
|
59
|
+
"80% reduction in API development time",
|
|
60
|
+
"Zero sync issues since migration",
|
|
61
|
+
"3 teams now share one spec repository"
|
|
62
|
+
],
|
|
63
|
+
audience: {
|
|
64
|
+
role: "CTO",
|
|
65
|
+
industry: "FinTech",
|
|
66
|
+
painPoints: ["API maintenance costs", "Team coordination"]
|
|
67
|
+
},
|
|
68
|
+
callToAction: "Read the full case study at contractspec.dev/customers"
|
|
69
|
+
};
|
|
70
|
+
|
|
71
|
+
// src/docs/video-marketing-clip.docblock.ts
|
|
72
|
+
import { registerDocBlocks } from "@contractspec/lib.contracts-spec/docs";
|
|
73
|
+
var blocks = [
|
|
74
|
+
{
|
|
75
|
+
id: "docs.examples.video-marketing-clip",
|
|
76
|
+
title: "Video Marketing Clips (example)",
|
|
77
|
+
summary: "End-to-end example: generate short-form social clips from content briefs using the deterministic video-gen pipeline.",
|
|
78
|
+
kind: "reference",
|
|
79
|
+
visibility: "public",
|
|
80
|
+
route: "/docs/examples/video-marketing-clip",
|
|
81
|
+
tags: ["video", "marketing", "social-clip", "example"],
|
|
82
|
+
body: `## What this example shows
|
|
83
|
+
|
|
84
|
+
- Building a \`VideoBrief\` from a \`ContentBrief\` with format, duration, and style settings.
|
|
85
|
+
- Using \`VideoGenerator\` in fully deterministic mode (no LLM) to produce a \`VideoProject\`.
|
|
86
|
+
- Generating video projects for all three social formats: landscape (16:9), square (1:1), and portrait (9:16).
|
|
87
|
+
- Accessing the resulting scene graph, durations, and composition props.
|
|
88
|
+
|
|
89
|
+
## Key concepts
|
|
90
|
+
|
|
91
|
+
- **ContentBrief**: The narrative source (title, problems, solutions, CTA) from \`@contractspec/lib.content-gen\`.
|
|
92
|
+
- **VideoBrief**: Wraps ContentBrief with video-specific config (format, duration, narration, style).
|
|
93
|
+
- **VideoGenerator**: Orchestrates scene planning and project assembly. Deterministic by default.
|
|
94
|
+
- **VideoProject**: The output scene graph ready for rendering or preview.
|
|
95
|
+
|
|
96
|
+
## Notes
|
|
97
|
+
|
|
98
|
+
- No LLM or voice provider is needed -- the pipeline is fully deterministic.
|
|
99
|
+
- The example does not render to MP4 (that requires Node.js + \`@remotion/renderer\`). It produces the \`VideoProject\` data structure.
|
|
100
|
+
`
|
|
101
|
+
},
|
|
102
|
+
{
|
|
103
|
+
id: "docs.examples.video-marketing-clip.usage",
|
|
104
|
+
title: "Video Marketing Clips -- Usage",
|
|
105
|
+
summary: "How to generate marketing video projects from content briefs.",
|
|
106
|
+
kind: "usage",
|
|
107
|
+
visibility: "public",
|
|
108
|
+
route: "/docs/examples/video-marketing-clip/usage",
|
|
109
|
+
tags: ["video", "marketing", "usage"],
|
|
110
|
+
body: `## Usage
|
|
111
|
+
|
|
112
|
+
\`\`\`ts
|
|
113
|
+
import { generateMarketingClip } from "@contractspec/example.video-marketing-clip/generate-clip";
|
|
114
|
+
import { productLaunchBrief } from "@contractspec/example.video-marketing-clip/briefs";
|
|
115
|
+
|
|
116
|
+
// Generate a landscape video project
|
|
117
|
+
const project = await generateMarketingClip(productLaunchBrief, "landscape");
|
|
118
|
+
|
|
119
|
+
console.log(project.scenes.length); // number of scenes
|
|
120
|
+
console.log(project.totalDurationInFrames); // total frames
|
|
121
|
+
console.log(project.format); // { type: "landscape", width: 1920, height: 1080 }
|
|
122
|
+
|
|
123
|
+
// Generate all three format variants
|
|
124
|
+
const landscapes = await generateMarketingClip(productLaunchBrief, "landscape");
|
|
125
|
+
const square = await generateMarketingClip(productLaunchBrief, "square");
|
|
126
|
+
const portrait = await generateMarketingClip(productLaunchBrief, "portrait");
|
|
127
|
+
\`\`\`
|
|
128
|
+
|
|
129
|
+
## Guardrails
|
|
130
|
+
|
|
131
|
+
- Keep content briefs concise -- the deterministic planner maps each section to a 2-5 second scene.
|
|
132
|
+
- Target duration defaults to ~17 seconds if not specified. Set \`targetDurationSeconds\` for precise control.
|
|
133
|
+
- The generated \`VideoProject\` is a data structure, not a rendered file. Use \`LocalRenderer\` for MP4 output.
|
|
134
|
+
`
|
|
135
|
+
}
|
|
136
|
+
];
|
|
137
|
+
registerDocBlocks(blocks);
|
|
138
|
+
// src/example.ts
|
|
139
|
+
import { defineExample } from "@contractspec/lib.contracts-spec";
|
|
140
|
+
var example = defineExample({
|
|
141
|
+
meta: {
|
|
142
|
+
key: "video-marketing-clip",
|
|
143
|
+
version: "1.0.0",
|
|
144
|
+
title: "Video Marketing Clips",
|
|
145
|
+
description: "Generate short-form marketing videos from content briefs using the deterministic video-gen pipeline.",
|
|
146
|
+
kind: "script",
|
|
147
|
+
visibility: "public",
|
|
148
|
+
stability: "experimental",
|
|
149
|
+
owners: ["@platform.core"],
|
|
150
|
+
tags: ["video", "marketing", "content-gen", "social-clip"]
|
|
151
|
+
},
|
|
152
|
+
docs: {
|
|
153
|
+
rootDocId: "docs.examples.video-marketing-clip",
|
|
154
|
+
usageDocId: "docs.examples.video-marketing-clip.usage"
|
|
155
|
+
},
|
|
156
|
+
entrypoints: {
|
|
157
|
+
packageName: "@contractspec/example.video-marketing-clip",
|
|
158
|
+
docs: "./docs"
|
|
159
|
+
},
|
|
160
|
+
surfaces: {
|
|
161
|
+
templates: true,
|
|
162
|
+
sandbox: { enabled: true, modes: ["markdown"] },
|
|
163
|
+
studio: { enabled: true, installable: true },
|
|
164
|
+
mcp: { enabled: true }
|
|
165
|
+
}
|
|
166
|
+
});
|
|
167
|
+
var example_default = example;
|
|
168
|
+
|
|
169
|
+
// src/generate-clip.ts
|
|
170
|
+
import { VideoGenerator } from "@contractspec/lib.video-gen/generators";
|
|
171
|
+
import { VIDEO_FORMATS } from "@contractspec/lib.video-gen/design/layouts";
|
|
172
|
+
var FORMAT_MAP = {
|
|
173
|
+
landscape: VIDEO_FORMATS.landscape,
|
|
174
|
+
square: VIDEO_FORMATS.square,
|
|
175
|
+
portrait: VIDEO_FORMATS.portrait
|
|
176
|
+
};
|
|
177
|
+
async function generateMarketingClip(brief, format = "landscape", targetDurationSeconds) {
|
|
178
|
+
const generator = new VideoGenerator({ fps: 30 });
|
|
179
|
+
const videoBrief = {
|
|
180
|
+
content: brief,
|
|
181
|
+
format: FORMAT_MAP[format],
|
|
182
|
+
targetDurationSeconds
|
|
183
|
+
};
|
|
184
|
+
return generator.generate(videoBrief);
|
|
185
|
+
}
|
|
186
|
+
async function generateAllFormats(brief, targetDurationSeconds) {
|
|
187
|
+
const [landscape, square, portrait] = await Promise.all([
|
|
188
|
+
generateMarketingClip(brief, "landscape", targetDurationSeconds),
|
|
189
|
+
generateMarketingClip(brief, "square", targetDurationSeconds),
|
|
190
|
+
generateMarketingClip(brief, "portrait", targetDurationSeconds)
|
|
191
|
+
]);
|
|
192
|
+
return { landscape, square, portrait };
|
|
193
|
+
}
|
|
194
|
+
export {
|
|
195
|
+
productLaunchBrief,
|
|
196
|
+
generateMarketingClip,
|
|
197
|
+
generateAllFormats,
|
|
198
|
+
featureAnnouncementBrief,
|
|
199
|
+
example_default as example,
|
|
200
|
+
caseStudyBrief
|
|
201
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import './video-marketing-clip.docblock';
|