@contractspec/example.video-docs-terminal 0.0.0-canary-20260224194731

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.
Files changed (42) hide show
  1. package/.turbo/turbo-build.log +38 -0
  2. package/.turbo/turbo-prebuild.log +1 -0
  3. package/CHANGELOG.md +92 -0
  4. package/README.md +34 -0
  5. package/dist/browser/build-tutorial.js +60 -0
  6. package/dist/browser/docs/index.js +89 -0
  7. package/dist/browser/docs/video-docs-terminal.docblock.js +89 -0
  8. package/dist/browser/example.js +33 -0
  9. package/dist/browser/generate-narration.js +18 -0
  10. package/dist/browser/index.js +389 -0
  11. package/dist/browser/sample-tutorials.js +192 -0
  12. package/dist/build-tutorial.d.ts +44 -0
  13. package/dist/build-tutorial.js +61 -0
  14. package/dist/docs/index.d.ts +1 -0
  15. package/dist/docs/index.js +90 -0
  16. package/dist/docs/video-docs-terminal.docblock.d.ts +1 -0
  17. package/dist/docs/video-docs-terminal.docblock.js +90 -0
  18. package/dist/example.d.ts +2 -0
  19. package/dist/example.js +34 -0
  20. package/dist/generate-narration.d.ts +42 -0
  21. package/dist/generate-narration.js +19 -0
  22. package/dist/index.d.ts +5 -0
  23. package/dist/index.js +390 -0
  24. package/dist/node/build-tutorial.js +60 -0
  25. package/dist/node/docs/index.js +89 -0
  26. package/dist/node/docs/video-docs-terminal.docblock.js +89 -0
  27. package/dist/node/example.js +33 -0
  28. package/dist/node/generate-narration.js +18 -0
  29. package/dist/node/index.js +389 -0
  30. package/dist/node/sample-tutorials.js +192 -0
  31. package/dist/sample-tutorials.d.ts +40 -0
  32. package/dist/sample-tutorials.js +193 -0
  33. package/package.json +159 -0
  34. package/src/build-tutorial.ts +120 -0
  35. package/src/docs/index.ts +1 -0
  36. package/src/docs/video-docs-terminal.docblock.ts +93 -0
  37. package/src/example.ts +32 -0
  38. package/src/generate-narration.ts +70 -0
  39. package/src/index.ts +7 -0
  40. package/src/sample-tutorials.ts +241 -0
  41. package/tsconfig.json +9 -0
  42. package/tsdown.config.js +3 -0
@@ -0,0 +1,38 @@
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=7
6
+ Bundled 7 modules in 45ms
7
+
8
+ ./build-tutorial.js 1.87 KB (entry point)
9
+ ./index.js 14.53 KB (entry point)
10
+ docs/index.js 3.77 KB (entry point)
11
+ docs/video-docs-terminal.docblock.js 3.77 KB (entry point)
12
+ ./example.js 1.0 KB (entry point)
13
+ ./generate-narration.js 0.69 KB (entry point)
14
+ ./sample-tutorials.js 7.26 KB (entry point)
15
+
16
+ [contractspec-bun-build] transpile target=node root=src entries=7
17
+ Bundled 7 modules in 48ms
18
+
19
+ ./build-tutorial.js 1.86 KB (entry point)
20
+ ./index.js 14.42 KB (entry point)
21
+ docs/index.js 3.76 KB (entry point)
22
+ docs/video-docs-terminal.docblock.js 3.76 KB (entry point)
23
+ ./example.js 1.00 KB (entry point)
24
+ ./generate-narration.js 0.68 KB (entry point)
25
+ ./sample-tutorials.js 7.15 KB (entry point)
26
+
27
+ [contractspec-bun-build] transpile target=browser root=src entries=7
28
+ Bundled 7 modules in 26ms
29
+
30
+ ./build-tutorial.js 1.86 KB (entry point)
31
+ ./index.js 14.42 KB (entry point)
32
+ docs/index.js 3.76 KB (entry point)
33
+ docs/video-docs-terminal.docblock.js 3.76 KB (entry point)
34
+ ./example.js 1.00 KB (entry point)
35
+ ./generate-narration.js 0.68 KB (entry point)
36
+ ./sample-tutorials.js 7.15 KB (entry point)
37
+
38
+ $ contractspec-bun-build types
@@ -0,0 +1 @@
1
+ $ contractspec-bun-build prebuild
package/CHANGELOG.md ADDED
@@ -0,0 +1,92 @@
1
+ # @contractspec/example.video-docs-terminal
2
+
3
+ ## 0.0.0-canary-20260224194731
4
+
5
+ ### Patch Changes
6
+
7
+ - chore: auto-bump internal dependents
8
+ - Updated dependencies
9
+ - @contractspec/lib.video-gen@0.0.0-canary-20260224194731
10
+
11
+ ## 2.6.0
12
+
13
+ ### Minor Changes
14
+
15
+ - bae3db1: fix: build issues
16
+
17
+ ### Patch Changes
18
+
19
+ - Updated dependencies [bae3db1]
20
+ - @contractspec/lib.video-gen@1.47.0
21
+ - @contractspec/lib.content-gen@2.6.0
22
+ - @contractspec/lib.contracts-spec@2.6.0
23
+
24
+ ## 2.5.0
25
+
26
+ ### Minor Changes
27
+
28
+ - c83c323: feat: major change to content generation
29
+
30
+ ### Patch Changes
31
+
32
+ - Updated dependencies [4fa3bd4]
33
+ - Updated dependencies [63eee9b]
34
+ - Updated dependencies [284cbe2]
35
+ - Updated dependencies [c83c323]
36
+ - Updated dependencies [397b7c0]
37
+ - Updated dependencies [4d19382]
38
+ - @contractspec/lib.contracts-spec@2.5.0
39
+ - @contractspec/lib.video-gen@1.46.0
40
+ - @contractspec/lib.content-gen@2.5.0
41
+
42
+ ## 2.4.0
43
+
44
+ ### Minor Changes
45
+
46
+ - chore: improve documentation
47
+
48
+ ### Patch Changes
49
+
50
+ - Updated dependencies
51
+ - @contractspec/lib.contracts-spec@2.4.0
52
+ - @contractspec/lib.content-gen@2.4.0
53
+ - @contractspec/lib.video-gen@1.45.0
54
+
55
+ ## 2.3.0
56
+
57
+ ### Minor Changes
58
+
59
+ - 12c9556: feat: release agentpacks
60
+
61
+ ### Patch Changes
62
+
63
+ - Updated dependencies [12c9556]
64
+ - @contractspec/lib.contracts-spec@2.3.0
65
+ - @contractspec/lib.content-gen@2.3.0
66
+ - @contractspec/lib.video-gen@1.44.0
67
+
68
+ ## 2.2.0
69
+
70
+ ### Minor Changes
71
+
72
+ - feat: release ContractSpec Studio
73
+
74
+ ### Patch Changes
75
+
76
+ - Updated dependencies
77
+ - @contractspec/lib.contracts-spec@2.2.0
78
+ - @contractspec/lib.content-gen@2.2.0
79
+ - @contractspec/lib.video-gen@1.43.0
80
+
81
+ ## 2.1.0
82
+
83
+ ### Minor Changes
84
+
85
+ - ac88935: chore: add examples
86
+
87
+ ### Patch Changes
88
+
89
+ - Updated dependencies [57e2819]
90
+ - @contractspec/lib.contracts-spec@2.1.1
91
+ - @contractspec/lib.content-gen@2.1.1
92
+ - @contractspec/lib.video-gen@1.42.1
package/README.md ADDED
@@ -0,0 +1,34 @@
1
+ # @contractspec/example.video-docs-terminal
2
+
3
+ Website: https://contractspec.io/
4
+
5
+ Generate terminal demo videos from CLI walkthroughs using the `TerminalDemo` composition and `ScriptGenerator`.
6
+
7
+ This package demonstrates:
8
+
9
+ - Defining `CliTutorial` objects that combine terminal lines with content briefs
10
+ - Building single-scene and multi-scene `VideoProject` instances from tutorials
11
+ - Generating deterministic narration scripts from content briefs using `ScriptGenerator`
12
+ - Composing a full tutorial suite (init, build, validate, deploy) into one video
13
+
14
+ ## Quickstart
15
+
16
+ ```typescript
17
+ import { buildTutorialVideo, buildTutorialSuite } from "@contractspec/example.video-docs-terminal";
18
+ import { initTutorial, allTutorials } from "@contractspec/example.video-docs-terminal";
19
+
20
+ // Build a single tutorial video
21
+ const project = buildTutorialVideo(initTutorial);
22
+
23
+ // Build a multi-scene suite from all tutorials
24
+ const suite = buildTutorialSuite(allTutorials);
25
+ ```
26
+
27
+ ```typescript
28
+ import { generateTutorialNarration } from "@contractspec/example.video-docs-terminal";
29
+
30
+ // Generate narration for a tutorial (deterministic, no LLM needed)
31
+ const narration = await generateTutorialNarration(initTutorial);
32
+ ```
33
+
34
+ Four sample tutorials are included: project initialization, build and code generation, contract validation, and deployment. The entire pipeline is fully deterministic -- no LLM or voice provider required.
@@ -0,0 +1,60 @@
1
+ // src/build-tutorial.ts
2
+ import { VIDEO_FORMATS } from "@contractspec/lib.video-gen/design/layouts";
3
+ var DEFAULT_FPS = 30;
4
+ var DEFAULT_SCENE_DURATION_SECONDS = 12;
5
+ function buildTutorialVideo(tutorial, options) {
6
+ const fps = options?.fps ?? DEFAULT_FPS;
7
+ const sceneDuration = options?.sceneDurationSeconds ?? DEFAULT_SCENE_DURATION_SECONDS;
8
+ const durationInFrames = sceneDuration * fps;
9
+ return {
10
+ id: `tutorial-${tutorial.id}-${Date.now().toString(36)}`,
11
+ scenes: [
12
+ {
13
+ id: `scene-${tutorial.id}`,
14
+ compositionId: "TerminalDemo",
15
+ props: {
16
+ title: tutorial.title,
17
+ subtitle: tutorial.subtitle,
18
+ lines: tutorial.lines,
19
+ terminalTitle: tutorial.terminalTitle,
20
+ prompt: options?.prompt ?? "$ ",
21
+ summary: tutorial.summary
22
+ },
23
+ durationInFrames
24
+ }
25
+ ],
26
+ totalDurationInFrames: durationInFrames,
27
+ fps,
28
+ format: VIDEO_FORMATS.landscape
29
+ };
30
+ }
31
+ function buildTutorialSuite(tutorials, options) {
32
+ const fps = options?.fps ?? DEFAULT_FPS;
33
+ const sceneDuration = options?.sceneDurationSeconds ?? DEFAULT_SCENE_DURATION_SECONDS;
34
+ const durationInFrames = sceneDuration * fps;
35
+ const scenes = tutorials.map((tutorial) => ({
36
+ id: `scene-${tutorial.id}`,
37
+ compositionId: "TerminalDemo",
38
+ props: {
39
+ title: tutorial.title,
40
+ subtitle: tutorial.subtitle,
41
+ lines: tutorial.lines,
42
+ terminalTitle: tutorial.terminalTitle,
43
+ prompt: options?.prompt ?? "$ ",
44
+ summary: tutorial.summary
45
+ },
46
+ durationInFrames
47
+ }));
48
+ const totalDurationInFrames = scenes.reduce((sum, s) => sum + s.durationInFrames, 0);
49
+ return {
50
+ id: `tutorial-suite-${Date.now().toString(36)}`,
51
+ scenes,
52
+ totalDurationInFrames,
53
+ fps,
54
+ format: VIDEO_FORMATS.landscape
55
+ };
56
+ }
57
+ export {
58
+ buildTutorialVideo,
59
+ buildTutorialSuite
60
+ };
@@ -0,0 +1,89 @@
1
+ // src/docs/video-docs-terminal.docblock.ts
2
+ import { registerDocBlocks } from "@contractspec/lib.contracts-spec/docs";
3
+ var blocks = [
4
+ {
5
+ id: "docs.examples.video-docs-terminal",
6
+ title: "Video Docs Terminal (example)",
7
+ summary: "Generate terminal demo videos from CLI walkthroughs using the TerminalDemo composition and ScriptGenerator.",
8
+ kind: "reference",
9
+ visibility: "public",
10
+ route: "/docs/examples/video-docs-terminal",
11
+ tags: ["video", "documentation", "terminal", "cli", "example"],
12
+ body: `## What this example shows
13
+
14
+ - Defining CLI tutorials as structured \`CliTutorial\` objects with \`TerminalLine\` arrays.
15
+ - Building single-scene and multi-scene \`VideoProject\` instances using the \`TerminalDemo\` composition.
16
+ - Using \`ScriptGenerator\` (deterministic, no LLM) to generate narration from tutorial content briefs.
17
+ - Assembling a full documentation video covering init, build, validate, and deploy workflows.
18
+
19
+ ## Key concepts
20
+
21
+ - **CliTutorial**: Combines \`TerminalLine[]\` (commands + output) with a \`ContentBrief\` for narration.
22
+ - **TerminalDemo**: The Remotion composition that renders animated terminal sessions.
23
+ - **ScriptGenerator**: Produces narration scripts from content briefs. Deterministic by default.
24
+ - **VideoProject**: The output scene graph -- one scene per tutorial, ready for rendering or preview.
25
+
26
+ ## Notes
27
+
28
+ - No LLM or voice provider is needed -- the pipeline is fully deterministic.
29
+ - Each tutorial maps to one \`TerminalDemo\` scene in the final video project.
30
+ - The example produces the \`VideoProject\` data structure, not rendered MP4. Use \`LocalRenderer\` for final output.
31
+ `
32
+ },
33
+ {
34
+ id: "docs.examples.video-docs-terminal.usage",
35
+ title: "Video Docs Terminal -- Usage",
36
+ summary: "How to generate terminal demo videos and narration from CLI tutorials.",
37
+ kind: "usage",
38
+ visibility: "public",
39
+ route: "/docs/examples/video-docs-terminal/usage",
40
+ tags: ["video", "terminal", "usage"],
41
+ body: `## Usage
42
+
43
+ ### Build a single tutorial video
44
+
45
+ \`\`\`ts
46
+ import { buildTutorialVideo } from "@contractspec/example.video-docs-terminal/build-tutorial";
47
+ import { initTutorial } from "@contractspec/example.video-docs-terminal/sample-tutorials";
48
+
49
+ const project = buildTutorialVideo(initTutorial);
50
+
51
+ console.log(project.scenes.length); // 1
52
+ console.log(project.scenes[0].compositionId); // "TerminalDemo"
53
+ console.log(project.totalDurationInFrames); // 360 (12s × 30fps)
54
+ \`\`\`
55
+
56
+ ### Build a multi-scene tutorial suite
57
+
58
+ \`\`\`ts
59
+ import { buildTutorialSuite } from "@contractspec/example.video-docs-terminal/build-tutorial";
60
+ import { allTutorials } from "@contractspec/example.video-docs-terminal/sample-tutorials";
61
+
62
+ const project = buildTutorialSuite(allTutorials);
63
+
64
+ console.log(project.scenes.length); // 4 (init, build, validate, deploy)
65
+ \`\`\`
66
+
67
+ ### Generate narration
68
+
69
+ \`\`\`ts
70
+ import { generateTutorialNarration } from "@contractspec/example.video-docs-terminal/generate-narration";
71
+ import { buildTutorial } from "@contractspec/example.video-docs-terminal/sample-tutorials";
72
+
73
+ const narration = await generateTutorialNarration(buildTutorial);
74
+
75
+ console.log(narration.fullText); // Full narration text
76
+ console.log(narration.segments.length); // Per-scene segments
77
+ console.log(narration.estimatedDurationSeconds); // ~12s
78
+ \`\`\`
79
+
80
+ ## Guardrails
81
+
82
+ - Keep terminal lines concise -- long output slows the typing animation.
83
+ - Target 10-15 lines per tutorial for optimal pacing at 12 seconds per scene.
84
+ - The \`summary\` field is displayed as a call-out after the terminal completes -- keep it to one sentence.
85
+ - Use \`"technical"\` narration style for documentation videos and \`"professional"\` for marketing.
86
+ `
87
+ }
88
+ ];
89
+ registerDocBlocks(blocks);
@@ -0,0 +1,89 @@
1
+ // src/docs/video-docs-terminal.docblock.ts
2
+ import { registerDocBlocks } from "@contractspec/lib.contracts-spec/docs";
3
+ var blocks = [
4
+ {
5
+ id: "docs.examples.video-docs-terminal",
6
+ title: "Video Docs Terminal (example)",
7
+ summary: "Generate terminal demo videos from CLI walkthroughs using the TerminalDemo composition and ScriptGenerator.",
8
+ kind: "reference",
9
+ visibility: "public",
10
+ route: "/docs/examples/video-docs-terminal",
11
+ tags: ["video", "documentation", "terminal", "cli", "example"],
12
+ body: `## What this example shows
13
+
14
+ - Defining CLI tutorials as structured \`CliTutorial\` objects with \`TerminalLine\` arrays.
15
+ - Building single-scene and multi-scene \`VideoProject\` instances using the \`TerminalDemo\` composition.
16
+ - Using \`ScriptGenerator\` (deterministic, no LLM) to generate narration from tutorial content briefs.
17
+ - Assembling a full documentation video covering init, build, validate, and deploy workflows.
18
+
19
+ ## Key concepts
20
+
21
+ - **CliTutorial**: Combines \`TerminalLine[]\` (commands + output) with a \`ContentBrief\` for narration.
22
+ - **TerminalDemo**: The Remotion composition that renders animated terminal sessions.
23
+ - **ScriptGenerator**: Produces narration scripts from content briefs. Deterministic by default.
24
+ - **VideoProject**: The output scene graph -- one scene per tutorial, ready for rendering or preview.
25
+
26
+ ## Notes
27
+
28
+ - No LLM or voice provider is needed -- the pipeline is fully deterministic.
29
+ - Each tutorial maps to one \`TerminalDemo\` scene in the final video project.
30
+ - The example produces the \`VideoProject\` data structure, not rendered MP4. Use \`LocalRenderer\` for final output.
31
+ `
32
+ },
33
+ {
34
+ id: "docs.examples.video-docs-terminal.usage",
35
+ title: "Video Docs Terminal -- Usage",
36
+ summary: "How to generate terminal demo videos and narration from CLI tutorials.",
37
+ kind: "usage",
38
+ visibility: "public",
39
+ route: "/docs/examples/video-docs-terminal/usage",
40
+ tags: ["video", "terminal", "usage"],
41
+ body: `## Usage
42
+
43
+ ### Build a single tutorial video
44
+
45
+ \`\`\`ts
46
+ import { buildTutorialVideo } from "@contractspec/example.video-docs-terminal/build-tutorial";
47
+ import { initTutorial } from "@contractspec/example.video-docs-terminal/sample-tutorials";
48
+
49
+ const project = buildTutorialVideo(initTutorial);
50
+
51
+ console.log(project.scenes.length); // 1
52
+ console.log(project.scenes[0].compositionId); // "TerminalDemo"
53
+ console.log(project.totalDurationInFrames); // 360 (12s × 30fps)
54
+ \`\`\`
55
+
56
+ ### Build a multi-scene tutorial suite
57
+
58
+ \`\`\`ts
59
+ import { buildTutorialSuite } from "@contractspec/example.video-docs-terminal/build-tutorial";
60
+ import { allTutorials } from "@contractspec/example.video-docs-terminal/sample-tutorials";
61
+
62
+ const project = buildTutorialSuite(allTutorials);
63
+
64
+ console.log(project.scenes.length); // 4 (init, build, validate, deploy)
65
+ \`\`\`
66
+
67
+ ### Generate narration
68
+
69
+ \`\`\`ts
70
+ import { generateTutorialNarration } from "@contractspec/example.video-docs-terminal/generate-narration";
71
+ import { buildTutorial } from "@contractspec/example.video-docs-terminal/sample-tutorials";
72
+
73
+ const narration = await generateTutorialNarration(buildTutorial);
74
+
75
+ console.log(narration.fullText); // Full narration text
76
+ console.log(narration.segments.length); // Per-scene segments
77
+ console.log(narration.estimatedDurationSeconds); // ~12s
78
+ \`\`\`
79
+
80
+ ## Guardrails
81
+
82
+ - Keep terminal lines concise -- long output slows the typing animation.
83
+ - Target 10-15 lines per tutorial for optimal pacing at 12 seconds per scene.
84
+ - The \`summary\` field is displayed as a call-out after the terminal completes -- keep it to one sentence.
85
+ - Use \`"technical"\` narration style for documentation videos and \`"professional"\` for marketing.
86
+ `
87
+ }
88
+ ];
89
+ 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-docs-terminal",
6
+ version: "1.0.0",
7
+ title: "Video Docs Terminal",
8
+ description: "Generate terminal demo videos from CLI walkthroughs using the TerminalDemo composition and ScriptGenerator.",
9
+ kind: "script",
10
+ visibility: "public",
11
+ stability: "experimental",
12
+ owners: ["@platform.core"],
13
+ tags: ["video", "documentation", "terminal", "cli", "tutorial"]
14
+ },
15
+ docs: {
16
+ rootDocId: "docs.examples.video-docs-terminal",
17
+ usageDocId: "docs.examples.video-docs-terminal.usage"
18
+ },
19
+ entrypoints: {
20
+ packageName: "@contractspec/example.video-docs-terminal",
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,18 @@
1
+ // src/generate-narration.ts
2
+ import { ScriptGenerator } from "@contractspec/lib.video-gen/generators/script-generator";
3
+ async function generateTutorialNarration(tutorial, options) {
4
+ const generator = new ScriptGenerator;
5
+ const style = options?.style ?? "technical";
6
+ return generator.generate(tutorial.brief, { enabled: true, style });
7
+ }
8
+ async function generateSuiteNarration(tutorials, options) {
9
+ const results = await Promise.all(tutorials.map(async (tutorial) => {
10
+ const script = await generateTutorialNarration(tutorial, options);
11
+ return [tutorial.id, script];
12
+ }));
13
+ return new Map(results);
14
+ }
15
+ export {
16
+ generateTutorialNarration,
17
+ generateSuiteNarration
18
+ };