@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.
@@ -0,0 +1,68 @@
1
+ // @bun
2
+ // src/docs/video-marketing-clip.docblock.ts
3
+ import { registerDocBlocks } from "@contractspec/lib.contracts-spec/docs";
4
+ var blocks = [
5
+ {
6
+ id: "docs.examples.video-marketing-clip",
7
+ title: "Video Marketing Clips (example)",
8
+ summary: "End-to-end example: generate short-form social clips from content briefs using the deterministic video-gen pipeline.",
9
+ kind: "reference",
10
+ visibility: "public",
11
+ route: "/docs/examples/video-marketing-clip",
12
+ tags: ["video", "marketing", "social-clip", "example"],
13
+ body: `## What this example shows
14
+
15
+ - Building a \`VideoBrief\` from a \`ContentBrief\` with format, duration, and style settings.
16
+ - Using \`VideoGenerator\` in fully deterministic mode (no LLM) to produce a \`VideoProject\`.
17
+ - Generating video projects for all three social formats: landscape (16:9), square (1:1), and portrait (9:16).
18
+ - Accessing the resulting scene graph, durations, and composition props.
19
+
20
+ ## Key concepts
21
+
22
+ - **ContentBrief**: The narrative source (title, problems, solutions, CTA) from \`@contractspec/lib.content-gen\`.
23
+ - **VideoBrief**: Wraps ContentBrief with video-specific config (format, duration, narration, style).
24
+ - **VideoGenerator**: Orchestrates scene planning and project assembly. Deterministic by default.
25
+ - **VideoProject**: The output scene graph ready for rendering or preview.
26
+
27
+ ## Notes
28
+
29
+ - No LLM or voice provider is needed -- the pipeline is fully deterministic.
30
+ - The example does not render to MP4 (that requires Node.js + \`@remotion/renderer\`). It produces the \`VideoProject\` data structure.
31
+ `
32
+ },
33
+ {
34
+ id: "docs.examples.video-marketing-clip.usage",
35
+ title: "Video Marketing Clips -- Usage",
36
+ summary: "How to generate marketing video projects from content briefs.",
37
+ kind: "usage",
38
+ visibility: "public",
39
+ route: "/docs/examples/video-marketing-clip/usage",
40
+ tags: ["video", "marketing", "usage"],
41
+ body: `## Usage
42
+
43
+ \`\`\`ts
44
+ import { generateMarketingClip } from "@contractspec/example.video-marketing-clip/generate-clip";
45
+ import { productLaunchBrief } from "@contractspec/example.video-marketing-clip/briefs";
46
+
47
+ // Generate a landscape video project
48
+ const project = await generateMarketingClip(productLaunchBrief, "landscape");
49
+
50
+ console.log(project.scenes.length); // number of scenes
51
+ console.log(project.totalDurationInFrames); // total frames
52
+ console.log(project.format); // { type: "landscape", width: 1920, height: 1080 }
53
+
54
+ // Generate all three format variants
55
+ const landscapes = await generateMarketingClip(productLaunchBrief, "landscape");
56
+ const square = await generateMarketingClip(productLaunchBrief, "square");
57
+ const portrait = await generateMarketingClip(productLaunchBrief, "portrait");
58
+ \`\`\`
59
+
60
+ ## Guardrails
61
+
62
+ - Keep content briefs concise -- the deterministic planner maps each section to a 2-5 second scene.
63
+ - Target duration defaults to ~17 seconds if not specified. Set \`targetDurationSeconds\` for precise control.
64
+ - The generated \`VideoProject\` is a data structure, not a rendered file. Use \`LocalRenderer\` for MP4 output.
65
+ `
66
+ }
67
+ ];
68
+ registerDocBlocks(blocks);
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,68 @@
1
+ // @bun
2
+ // src/docs/video-marketing-clip.docblock.ts
3
+ import { registerDocBlocks } from "@contractspec/lib.contracts-spec/docs";
4
+ var blocks = [
5
+ {
6
+ id: "docs.examples.video-marketing-clip",
7
+ title: "Video Marketing Clips (example)",
8
+ summary: "End-to-end example: generate short-form social clips from content briefs using the deterministic video-gen pipeline.",
9
+ kind: "reference",
10
+ visibility: "public",
11
+ route: "/docs/examples/video-marketing-clip",
12
+ tags: ["video", "marketing", "social-clip", "example"],
13
+ body: `## What this example shows
14
+
15
+ - Building a \`VideoBrief\` from a \`ContentBrief\` with format, duration, and style settings.
16
+ - Using \`VideoGenerator\` in fully deterministic mode (no LLM) to produce a \`VideoProject\`.
17
+ - Generating video projects for all three social formats: landscape (16:9), square (1:1), and portrait (9:16).
18
+ - Accessing the resulting scene graph, durations, and composition props.
19
+
20
+ ## Key concepts
21
+
22
+ - **ContentBrief**: The narrative source (title, problems, solutions, CTA) from \`@contractspec/lib.content-gen\`.
23
+ - **VideoBrief**: Wraps ContentBrief with video-specific config (format, duration, narration, style).
24
+ - **VideoGenerator**: Orchestrates scene planning and project assembly. Deterministic by default.
25
+ - **VideoProject**: The output scene graph ready for rendering or preview.
26
+
27
+ ## Notes
28
+
29
+ - No LLM or voice provider is needed -- the pipeline is fully deterministic.
30
+ - The example does not render to MP4 (that requires Node.js + \`@remotion/renderer\`). It produces the \`VideoProject\` data structure.
31
+ `
32
+ },
33
+ {
34
+ id: "docs.examples.video-marketing-clip.usage",
35
+ title: "Video Marketing Clips -- Usage",
36
+ summary: "How to generate marketing video projects from content briefs.",
37
+ kind: "usage",
38
+ visibility: "public",
39
+ route: "/docs/examples/video-marketing-clip/usage",
40
+ tags: ["video", "marketing", "usage"],
41
+ body: `## Usage
42
+
43
+ \`\`\`ts
44
+ import { generateMarketingClip } from "@contractspec/example.video-marketing-clip/generate-clip";
45
+ import { productLaunchBrief } from "@contractspec/example.video-marketing-clip/briefs";
46
+
47
+ // Generate a landscape video project
48
+ const project = await generateMarketingClip(productLaunchBrief, "landscape");
49
+
50
+ console.log(project.scenes.length); // number of scenes
51
+ console.log(project.totalDurationInFrames); // total frames
52
+ console.log(project.format); // { type: "landscape", width: 1920, height: 1080 }
53
+
54
+ // Generate all three format variants
55
+ const landscapes = await generateMarketingClip(productLaunchBrief, "landscape");
56
+ const square = await generateMarketingClip(productLaunchBrief, "square");
57
+ const portrait = await generateMarketingClip(productLaunchBrief, "portrait");
58
+ \`\`\`
59
+
60
+ ## Guardrails
61
+
62
+ - Keep content briefs concise -- the deterministic planner maps each section to a 2-5 second scene.
63
+ - Target duration defaults to ~17 seconds if not specified. Set \`targetDurationSeconds\` for precise control.
64
+ - The generated \`VideoProject\` is a data structure, not a rendered file. Use \`LocalRenderer\` for MP4 output.
65
+ `
66
+ }
67
+ ];
68
+ registerDocBlocks(blocks);
@@ -0,0 +1,2 @@
1
+ declare const example: import("@contractspec/lib.contracts-spec").ExampleSpec;
2
+ export default example;
@@ -0,0 +1,34 @@
1
+ // @bun
2
+ // src/example.ts
3
+ import { defineExample } from "@contractspec/lib.contracts-spec";
4
+ var example = defineExample({
5
+ meta: {
6
+ key: "video-marketing-clip",
7
+ version: "1.0.0",
8
+ title: "Video Marketing Clips",
9
+ description: "Generate short-form marketing videos from content briefs using the deterministic video-gen pipeline.",
10
+ kind: "script",
11
+ visibility: "public",
12
+ stability: "experimental",
13
+ owners: ["@platform.core"],
14
+ tags: ["video", "marketing", "content-gen", "social-clip"]
15
+ },
16
+ docs: {
17
+ rootDocId: "docs.examples.video-marketing-clip",
18
+ usageDocId: "docs.examples.video-marketing-clip.usage"
19
+ },
20
+ entrypoints: {
21
+ packageName: "@contractspec/example.video-marketing-clip",
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
+ };
@@ -0,0 +1,35 @@
1
+ import type { ContentBrief } from '@contractspec/lib.content-gen/types';
2
+ import type { VideoProject } from '@contractspec/lib.video-gen/types';
3
+ /** Supported social format keys. */
4
+ export type SocialFormat = 'landscape' | 'square' | 'portrait';
5
+ /**
6
+ * Generate a marketing video project from a content brief.
7
+ *
8
+ * This is the main handler demonstrating the deterministic video-gen pipeline:
9
+ * 1. Wrap the ContentBrief in a VideoBrief with format + duration config
10
+ * 2. Use VideoGenerator (no LLM) to plan scenes and assemble the project
11
+ * 3. Return the VideoProject (scene graph ready for rendering)
12
+ *
13
+ * @example
14
+ * ```ts
15
+ * import { generateMarketingClip } from "@contractspec/example.video-marketing-clip/generate-clip";
16
+ * import { productLaunchBrief } from "@contractspec/example.video-marketing-clip/briefs";
17
+ *
18
+ * const project = await generateMarketingClip(productLaunchBrief, "landscape");
19
+ * console.log(project.scenes.length); // 5
20
+ * ```
21
+ */
22
+ export declare function generateMarketingClip(brief: ContentBrief, format?: SocialFormat, targetDurationSeconds?: number): Promise<VideoProject>;
23
+ /**
24
+ * Generate video projects for all three social formats from a single brief.
25
+ *
26
+ * Returns landscape, square, and portrait variants -- useful for
27
+ * cross-platform social media campaigns.
28
+ *
29
+ * @example
30
+ * ```ts
31
+ * const variants = await generateAllFormats(productLaunchBrief, 30);
32
+ * // variants.landscape, variants.square, variants.portrait
33
+ * ```
34
+ */
35
+ export declare function generateAllFormats(brief: ContentBrief, targetDurationSeconds?: number): Promise<Record<SocialFormat, VideoProject>>;
@@ -0,0 +1,30 @@
1
+ // @bun
2
+ // src/generate-clip.ts
3
+ import { VideoGenerator } from "@contractspec/lib.video-gen/generators";
4
+ import { VIDEO_FORMATS } from "@contractspec/lib.video-gen/design/layouts";
5
+ var FORMAT_MAP = {
6
+ landscape: VIDEO_FORMATS.landscape,
7
+ square: VIDEO_FORMATS.square,
8
+ portrait: VIDEO_FORMATS.portrait
9
+ };
10
+ async function generateMarketingClip(brief, format = "landscape", targetDurationSeconds) {
11
+ const generator = new VideoGenerator({ fps: 30 });
12
+ const videoBrief = {
13
+ content: brief,
14
+ format: FORMAT_MAP[format],
15
+ targetDurationSeconds
16
+ };
17
+ return generator.generate(videoBrief);
18
+ }
19
+ async function generateAllFormats(brief, targetDurationSeconds) {
20
+ const [landscape, square, portrait] = await Promise.all([
21
+ generateMarketingClip(brief, "landscape", targetDurationSeconds),
22
+ generateMarketingClip(brief, "square", targetDurationSeconds),
23
+ generateMarketingClip(brief, "portrait", targetDurationSeconds)
24
+ ]);
25
+ return { landscape, square, portrait };
26
+ }
27
+ export {
28
+ generateMarketingClip,
29
+ generateAllFormats
30
+ };
@@ -0,0 +1,4 @@
1
+ export * from './briefs';
2
+ export * from './generate-clip';
3
+ export { default as example } from './example';
4
+ import './docs';
package/dist/index.js ADDED
@@ -0,0 +1,202 @@
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
+
72
+ // src/docs/video-marketing-clip.docblock.ts
73
+ import { registerDocBlocks } from "@contractspec/lib.contracts-spec/docs";
74
+ var blocks = [
75
+ {
76
+ id: "docs.examples.video-marketing-clip",
77
+ title: "Video Marketing Clips (example)",
78
+ summary: "End-to-end example: generate short-form social clips from content briefs using the deterministic video-gen pipeline.",
79
+ kind: "reference",
80
+ visibility: "public",
81
+ route: "/docs/examples/video-marketing-clip",
82
+ tags: ["video", "marketing", "social-clip", "example"],
83
+ body: `## What this example shows
84
+
85
+ - Building a \`VideoBrief\` from a \`ContentBrief\` with format, duration, and style settings.
86
+ - Using \`VideoGenerator\` in fully deterministic mode (no LLM) to produce a \`VideoProject\`.
87
+ - Generating video projects for all three social formats: landscape (16:9), square (1:1), and portrait (9:16).
88
+ - Accessing the resulting scene graph, durations, and composition props.
89
+
90
+ ## Key concepts
91
+
92
+ - **ContentBrief**: The narrative source (title, problems, solutions, CTA) from \`@contractspec/lib.content-gen\`.
93
+ - **VideoBrief**: Wraps ContentBrief with video-specific config (format, duration, narration, style).
94
+ - **VideoGenerator**: Orchestrates scene planning and project assembly. Deterministic by default.
95
+ - **VideoProject**: The output scene graph ready for rendering or preview.
96
+
97
+ ## Notes
98
+
99
+ - No LLM or voice provider is needed -- the pipeline is fully deterministic.
100
+ - The example does not render to MP4 (that requires Node.js + \`@remotion/renderer\`). It produces the \`VideoProject\` data structure.
101
+ `
102
+ },
103
+ {
104
+ id: "docs.examples.video-marketing-clip.usage",
105
+ title: "Video Marketing Clips -- Usage",
106
+ summary: "How to generate marketing video projects from content briefs.",
107
+ kind: "usage",
108
+ visibility: "public",
109
+ route: "/docs/examples/video-marketing-clip/usage",
110
+ tags: ["video", "marketing", "usage"],
111
+ body: `## Usage
112
+
113
+ \`\`\`ts
114
+ import { generateMarketingClip } from "@contractspec/example.video-marketing-clip/generate-clip";
115
+ import { productLaunchBrief } from "@contractspec/example.video-marketing-clip/briefs";
116
+
117
+ // Generate a landscape video project
118
+ const project = await generateMarketingClip(productLaunchBrief, "landscape");
119
+
120
+ console.log(project.scenes.length); // number of scenes
121
+ console.log(project.totalDurationInFrames); // total frames
122
+ console.log(project.format); // { type: "landscape", width: 1920, height: 1080 }
123
+
124
+ // Generate all three format variants
125
+ const landscapes = await generateMarketingClip(productLaunchBrief, "landscape");
126
+ const square = await generateMarketingClip(productLaunchBrief, "square");
127
+ const portrait = await generateMarketingClip(productLaunchBrief, "portrait");
128
+ \`\`\`
129
+
130
+ ## Guardrails
131
+
132
+ - Keep content briefs concise -- the deterministic planner maps each section to a 2-5 second scene.
133
+ - Target duration defaults to ~17 seconds if not specified. Set \`targetDurationSeconds\` for precise control.
134
+ - The generated \`VideoProject\` is a data structure, not a rendered file. Use \`LocalRenderer\` for MP4 output.
135
+ `
136
+ }
137
+ ];
138
+ registerDocBlocks(blocks);
139
+ // src/example.ts
140
+ import { defineExample } from "@contractspec/lib.contracts-spec";
141
+ var example = defineExample({
142
+ meta: {
143
+ key: "video-marketing-clip",
144
+ version: "1.0.0",
145
+ title: "Video Marketing Clips",
146
+ description: "Generate short-form marketing videos from content briefs using the deterministic video-gen pipeline.",
147
+ kind: "script",
148
+ visibility: "public",
149
+ stability: "experimental",
150
+ owners: ["@platform.core"],
151
+ tags: ["video", "marketing", "content-gen", "social-clip"]
152
+ },
153
+ docs: {
154
+ rootDocId: "docs.examples.video-marketing-clip",
155
+ usageDocId: "docs.examples.video-marketing-clip.usage"
156
+ },
157
+ entrypoints: {
158
+ packageName: "@contractspec/example.video-marketing-clip",
159
+ docs: "./docs"
160
+ },
161
+ surfaces: {
162
+ templates: true,
163
+ sandbox: { enabled: true, modes: ["markdown"] },
164
+ studio: { enabled: true, installable: true },
165
+ mcp: { enabled: true }
166
+ }
167
+ });
168
+ var example_default = example;
169
+
170
+ // src/generate-clip.ts
171
+ import { VideoGenerator } from "@contractspec/lib.video-gen/generators";
172
+ import { VIDEO_FORMATS } from "@contractspec/lib.video-gen/design/layouts";
173
+ var FORMAT_MAP = {
174
+ landscape: VIDEO_FORMATS.landscape,
175
+ square: VIDEO_FORMATS.square,
176
+ portrait: VIDEO_FORMATS.portrait
177
+ };
178
+ async function generateMarketingClip(brief, format = "landscape", targetDurationSeconds) {
179
+ const generator = new VideoGenerator({ fps: 30 });
180
+ const videoBrief = {
181
+ content: brief,
182
+ format: FORMAT_MAP[format],
183
+ targetDurationSeconds
184
+ };
185
+ return generator.generate(videoBrief);
186
+ }
187
+ async function generateAllFormats(brief, targetDurationSeconds) {
188
+ const [landscape, square, portrait] = await Promise.all([
189
+ generateMarketingClip(brief, "landscape", targetDurationSeconds),
190
+ generateMarketingClip(brief, "square", targetDurationSeconds),
191
+ generateMarketingClip(brief, "portrait", targetDurationSeconds)
192
+ ]);
193
+ return { landscape, square, portrait };
194
+ }
195
+ export {
196
+ productLaunchBrief,
197
+ generateMarketingClip,
198
+ generateAllFormats,
199
+ featureAnnouncementBrief,
200
+ example_default as example,
201
+ caseStudyBrief
202
+ };
@@ -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);