@lssm-tech/lib.video-gen 3.0.10

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 (175) hide show
  1. package/README.md +79 -0
  2. package/dist/browser/compositions/api-overview.js +1 -0
  3. package/dist/browser/compositions/index.js +1 -0
  4. package/dist/browser/compositions/primitives/animated-text.js +1 -0
  5. package/dist/browser/compositions/primitives/brand-frame.js +1 -0
  6. package/dist/browser/compositions/primitives/code-block.js +1 -0
  7. package/dist/browser/compositions/primitives/index.js +1 -0
  8. package/dist/browser/compositions/primitives/progress-bar.js +1 -0
  9. package/dist/browser/compositions/primitives/terminal.js +1 -0
  10. package/dist/browser/compositions/primitives/transition.js +1 -0
  11. package/dist/browser/compositions/social-clip.js +1 -0
  12. package/dist/browser/compositions/terminal-demo.js +1 -0
  13. package/dist/browser/design/index.js +1 -0
  14. package/dist/browser/design/layouts.js +1 -0
  15. package/dist/browser/design/motion.js +1 -0
  16. package/dist/browser/design/tokens.js +1 -0
  17. package/dist/browser/design/typography.js +1 -0
  18. package/dist/browser/docs/compositions.docblock.js +1 -0
  19. package/dist/browser/docs/design.docblock.js +172 -0
  20. package/dist/browser/docs/generators.docblock.js +165 -0
  21. package/dist/browser/docs/rendering.docblock.js +175 -0
  22. package/dist/browser/docs/video-gen.docblock.js +126 -0
  23. package/dist/browser/generators/index.js +82 -0
  24. package/dist/browser/generators/scene-planner.js +82 -0
  25. package/dist/browser/generators/script-generator.js +82 -0
  26. package/dist/browser/generators/video-generator.js +82 -0
  27. package/dist/browser/i18n/catalogs/en.js +28 -0
  28. package/dist/browser/i18n/catalogs/es.js +28 -0
  29. package/dist/browser/i18n/catalogs/fr.js +28 -0
  30. package/dist/browser/i18n/catalogs/index.js +82 -0
  31. package/dist/browser/i18n/index.js +82 -0
  32. package/dist/browser/i18n/keys.js +1 -0
  33. package/dist/browser/i18n/locale.js +1 -0
  34. package/dist/browser/i18n/messages.js +82 -0
  35. package/dist/browser/index.js +82 -0
  36. package/dist/browser/player/demo-player.js +1 -0
  37. package/dist/browser/player/index.js +1 -0
  38. package/dist/browser/remotion/Root.js +19 -0
  39. package/dist/browser/remotion/index.js +19 -0
  40. package/dist/browser/renderers/config.js +1 -0
  41. package/dist/browser/renderers/index.js +1 -0
  42. package/dist/browser/renderers/local.js +1 -0
  43. package/dist/browser/types.js +1 -0
  44. package/dist/browser/video-gen.feature.js +1 -0
  45. package/dist/compositions/api-overview.d.ts +16 -0
  46. package/dist/compositions/api-overview.js +2 -0
  47. package/dist/compositions/index.d.ts +7 -0
  48. package/dist/compositions/index.js +2 -0
  49. package/dist/compositions/primitives/animated-text.d.ts +22 -0
  50. package/dist/compositions/primitives/animated-text.js +2 -0
  51. package/dist/compositions/primitives/brand-frame.d.ts +14 -0
  52. package/dist/compositions/primitives/brand-frame.js +2 -0
  53. package/dist/compositions/primitives/code-block.d.ts +18 -0
  54. package/dist/compositions/primitives/code-block.js +2 -0
  55. package/dist/compositions/primitives/index.d.ts +12 -0
  56. package/dist/compositions/primitives/index.js +2 -0
  57. package/dist/compositions/primitives/progress-bar.d.ts +12 -0
  58. package/dist/compositions/primitives/progress-bar.js +2 -0
  59. package/dist/compositions/primitives/terminal.d.ts +24 -0
  60. package/dist/compositions/primitives/terminal.js +2 -0
  61. package/dist/compositions/primitives/transition.d.ts +14 -0
  62. package/dist/compositions/primitives/transition.js +2 -0
  63. package/dist/compositions/social-clip.d.ts +16 -0
  64. package/dist/compositions/social-clip.js +2 -0
  65. package/dist/compositions/terminal-demo.d.ts +17 -0
  66. package/dist/compositions/terminal-demo.js +2 -0
  67. package/dist/design/index.d.ts +4 -0
  68. package/dist/design/index.js +2 -0
  69. package/dist/design/layouts.d.ts +69 -0
  70. package/dist/design/layouts.js +2 -0
  71. package/dist/design/motion.d.ts +72 -0
  72. package/dist/design/motion.js +2 -0
  73. package/dist/design/tokens.d.ts +31 -0
  74. package/dist/design/tokens.js +2 -0
  75. package/dist/design/typography.d.ts +61 -0
  76. package/dist/design/typography.js +2 -0
  77. package/dist/docs/compositions.docblock.d.ts +1 -0
  78. package/dist/docs/compositions.docblock.js +2 -0
  79. package/dist/docs/design.docblock.d.ts +1 -0
  80. package/dist/docs/design.docblock.js +173 -0
  81. package/dist/docs/generators.docblock.d.ts +1 -0
  82. package/dist/docs/generators.docblock.js +166 -0
  83. package/dist/docs/rendering.docblock.d.ts +1 -0
  84. package/dist/docs/rendering.docblock.js +176 -0
  85. package/dist/docs/video-gen.docblock.d.ts +1 -0
  86. package/dist/docs/video-gen.docblock.js +127 -0
  87. package/dist/generators/index.d.ts +3 -0
  88. package/dist/generators/index.js +83 -0
  89. package/dist/generators/scene-planner.d.ts +31 -0
  90. package/dist/generators/scene-planner.js +83 -0
  91. package/dist/generators/script-generator.d.ts +57 -0
  92. package/dist/generators/script-generator.js +83 -0
  93. package/dist/generators/video-generator.d.ts +21 -0
  94. package/dist/generators/video-generator.js +83 -0
  95. package/dist/i18n/catalogs/en.d.ts +8 -0
  96. package/dist/i18n/catalogs/en.js +29 -0
  97. package/dist/i18n/catalogs/es.d.ts +6 -0
  98. package/dist/i18n/catalogs/es.js +29 -0
  99. package/dist/i18n/catalogs/fr.d.ts +6 -0
  100. package/dist/i18n/catalogs/fr.js +29 -0
  101. package/dist/i18n/catalogs/index.d.ts +8 -0
  102. package/dist/i18n/catalogs/index.js +83 -0
  103. package/dist/i18n/i18n.test.d.ts +1 -0
  104. package/dist/i18n/index.d.ts +22 -0
  105. package/dist/i18n/index.js +83 -0
  106. package/dist/i18n/keys.d.ts +116 -0
  107. package/dist/i18n/keys.js +2 -0
  108. package/dist/i18n/locale.d.ts +8 -0
  109. package/dist/i18n/locale.js +2 -0
  110. package/dist/i18n/messages.d.ts +14 -0
  111. package/dist/i18n/messages.js +83 -0
  112. package/dist/index.d.ts +7 -0
  113. package/dist/index.js +83 -0
  114. package/dist/node/compositions/api-overview.js +1 -0
  115. package/dist/node/compositions/index.js +1 -0
  116. package/dist/node/compositions/primitives/animated-text.js +1 -0
  117. package/dist/node/compositions/primitives/brand-frame.js +1 -0
  118. package/dist/node/compositions/primitives/code-block.js +1 -0
  119. package/dist/node/compositions/primitives/index.js +1 -0
  120. package/dist/node/compositions/primitives/progress-bar.js +1 -0
  121. package/dist/node/compositions/primitives/terminal.js +1 -0
  122. package/dist/node/compositions/primitives/transition.js +1 -0
  123. package/dist/node/compositions/social-clip.js +1 -0
  124. package/dist/node/compositions/terminal-demo.js +1 -0
  125. package/dist/node/design/index.js +1 -0
  126. package/dist/node/design/layouts.js +1 -0
  127. package/dist/node/design/motion.js +1 -0
  128. package/dist/node/design/tokens.js +1 -0
  129. package/dist/node/design/typography.js +1 -0
  130. package/dist/node/docs/compositions.docblock.js +1 -0
  131. package/dist/node/docs/design.docblock.js +172 -0
  132. package/dist/node/docs/generators.docblock.js +165 -0
  133. package/dist/node/docs/rendering.docblock.js +175 -0
  134. package/dist/node/docs/video-gen.docblock.js +126 -0
  135. package/dist/node/generators/index.js +82 -0
  136. package/dist/node/generators/scene-planner.js +82 -0
  137. package/dist/node/generators/script-generator.js +82 -0
  138. package/dist/node/generators/video-generator.js +82 -0
  139. package/dist/node/i18n/catalogs/en.js +28 -0
  140. package/dist/node/i18n/catalogs/es.js +28 -0
  141. package/dist/node/i18n/catalogs/fr.js +28 -0
  142. package/dist/node/i18n/catalogs/index.js +82 -0
  143. package/dist/node/i18n/index.js +82 -0
  144. package/dist/node/i18n/keys.js +1 -0
  145. package/dist/node/i18n/locale.js +1 -0
  146. package/dist/node/i18n/messages.js +82 -0
  147. package/dist/node/index.js +82 -0
  148. package/dist/node/player/demo-player.js +1 -0
  149. package/dist/node/player/index.js +1 -0
  150. package/dist/node/remotion/Root.js +19 -0
  151. package/dist/node/remotion/index.js +19 -0
  152. package/dist/node/renderers/config.js +1 -0
  153. package/dist/node/renderers/index.js +1 -0
  154. package/dist/node/renderers/local.js +1 -0
  155. package/dist/node/types.js +1 -0
  156. package/dist/node/video-gen.feature.js +1 -0
  157. package/dist/player/demo-player.d.ts +55 -0
  158. package/dist/player/demo-player.js +2 -0
  159. package/dist/player/index.d.ts +2 -0
  160. package/dist/player/index.js +2 -0
  161. package/dist/remotion/Root.d.ts +2 -0
  162. package/dist/remotion/Root.js +20 -0
  163. package/dist/remotion/index.d.ts +1 -0
  164. package/dist/remotion/index.js +20 -0
  165. package/dist/renderers/config.d.ts +28 -0
  166. package/dist/renderers/config.js +2 -0
  167. package/dist/renderers/index.d.ts +3 -0
  168. package/dist/renderers/index.js +2 -0
  169. package/dist/renderers/local.d.ts +17 -0
  170. package/dist/renderers/local.js +2 -0
  171. package/dist/types.d.ts +85 -0
  172. package/dist/types.js +2 -0
  173. package/dist/video-gen.feature.d.ts +1 -0
  174. package/dist/video-gen.feature.js +2 -0
  175. package/package.json +675 -0
@@ -0,0 +1,72 @@
1
+ import { Easing } from 'remotion';
2
+ /**
3
+ * Easing functions for video animations.
4
+ * Remotion's interpolate() accepts these directly.
5
+ */
6
+ export declare const videoEasing: {
7
+ /** Smooth entrance -- objects appearing */
8
+ readonly entrance: (t: number) => number;
9
+ /** Smooth exit -- objects disappearing */
10
+ readonly exit: (t: number) => number;
11
+ /** Emphasis/bounce -- drawing attention */
12
+ readonly emphasis: (t: number) => number;
13
+ /** Linear -- constant speed (progress bars, typing) */
14
+ readonly linear: typeof Easing.linear;
15
+ /** Gentle ease -- subtle movements */
16
+ readonly gentle: (t: number) => number;
17
+ /** Spring-like -- playful movements */
18
+ readonly spring: (t: number) => number;
19
+ };
20
+ /**
21
+ * Standard durations in frames.
22
+ * All values assume 30fps unless noted.
23
+ */
24
+ export declare const videoDurations: {
25
+ /** Scene transition (fade, slide, etc.) */
26
+ readonly sceneTransition: 20;
27
+ /** Text entrance animation */
28
+ readonly textEntrance: 15;
29
+ /** Text exit animation */
30
+ readonly textExit: 12;
31
+ /** Code typing speed (frames per character) */
32
+ readonly codeTypingPerChar: 2;
33
+ /** Pause after a section/concept */
34
+ readonly sectionPause: 30;
35
+ /** Brief pause for emphasis */
36
+ readonly emphasisPause: 15;
37
+ /** Logo/brand reveal */
38
+ readonly brandReveal: 25;
39
+ /** Minimum scene duration */
40
+ readonly minScene: 60;
41
+ /** Standard short scene (2s) */
42
+ readonly shortScene: 60;
43
+ /** Standard medium scene (4s) */
44
+ readonly mediumScene: 120;
45
+ /** Standard long scene (8s) */
46
+ readonly longScene: 240;
47
+ };
48
+ /**
49
+ * Pre-built transition configurations for scene-to-scene transitions.
50
+ */
51
+ export declare const videoTransitions: {
52
+ readonly fade: {
53
+ readonly type: "fade";
54
+ readonly durationInFrames: 20;
55
+ };
56
+ readonly slideLeft: {
57
+ readonly type: "slide-left";
58
+ readonly durationInFrames: 20;
59
+ };
60
+ readonly slideRight: {
61
+ readonly type: "slide-right";
62
+ readonly durationInFrames: 20;
63
+ };
64
+ readonly wipe: {
65
+ readonly type: "wipe";
66
+ readonly durationInFrames: 15;
67
+ };
68
+ readonly none: {
69
+ readonly type: "none";
70
+ readonly durationInFrames: 0;
71
+ };
72
+ };
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ var h=import.meta.require;import{Easing as d}from"remotion";var p={entrance:d.out(d.exp),exit:d.in(d.exp),emphasis:d.out(d.back(1.4)),linear:d.linear,gentle:d.bezier(0.25,0.1,0.25,1),spring:d.out(d.back(1.7))},q={sceneTransition:20,textEntrance:15,textExit:12,codeTypingPerChar:2,sectionPause:30,emphasisPause:15,brandReveal:25,minScene:60,shortScene:60,mediumScene:120,longScene:240},v={fade:{type:"fade",durationInFrames:20},slideLeft:{type:"slide-left",durationInFrames:20},slideRight:{type:"slide-right",durationInFrames:20},wipe:{type:"wipe",durationInFrames:15},none:{type:"none",durationInFrames:0}};export{v as videoTransitions,p as videoEasing,q as videoDurations};
@@ -0,0 +1,31 @@
1
+ import type { ThemeTokens } from '@contractspec/lib.design-system';
2
+ import { defaultTokens } from '@contractspec/lib.design-system';
3
+ export type { ThemeTokens };
4
+ export { defaultTokens };
5
+ /**
6
+ * Video-specific color extensions built on top of brand tokens.
7
+ */
8
+ export interface VideoColorTokens {
9
+ /** Background for video frames (may differ from web background) */
10
+ canvasBackground: string;
11
+ /** Code block background */
12
+ codeBackground: string;
13
+ /** Terminal background */
14
+ terminalBackground: string;
15
+ /** Terminal text color */
16
+ terminalForeground: string;
17
+ /** Highlight / emphasis color */
18
+ highlight: string;
19
+ /** Gradient start (for branded backgrounds) */
20
+ gradientStart: string;
21
+ /** Gradient end */
22
+ gradientEnd: string;
23
+ }
24
+ export declare const defaultVideoColors: VideoColorTokens;
25
+ /**
26
+ * Combine brand tokens with video color extensions.
27
+ */
28
+ export interface VideoThemeTokens extends ThemeTokens {
29
+ video: VideoColorTokens;
30
+ }
31
+ export declare const defaultVideoTheme: VideoThemeTokens;
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ var z=import.meta.require;import{defaultTokens as j}from"@contractspec/lib.design-system";var q={canvasBackground:j.colors.background,codeBackground:"#1e1e2e",terminalBackground:"#0d1117",terminalForeground:"#c9d1d9",highlight:j.colors.accent,gradientStart:j.colors.primary,gradientEnd:j.colors.accent},D={...j,video:q};export{D as defaultVideoTheme,q as defaultVideoColors,j as defaultTokens};
@@ -0,0 +1,61 @@
1
+ export interface VideoTypeStyle {
2
+ fontSize: number;
3
+ lineHeight: number;
4
+ fontWeight: number;
5
+ letterSpacing?: number;
6
+ }
7
+ /**
8
+ * Typography scale for 1920x1080 (landscape) videos.
9
+ * Scale down proportionally for smaller formats.
10
+ */
11
+ export declare const videoTypography: {
12
+ /** Main title -- large, bold */
13
+ readonly title: {
14
+ readonly fontSize: 72;
15
+ readonly lineHeight: 1.1;
16
+ readonly fontWeight: 700;
17
+ readonly letterSpacing: -1;
18
+ };
19
+ /** Section heading */
20
+ readonly heading: {
21
+ readonly fontSize: 56;
22
+ readonly lineHeight: 1.2;
23
+ readonly fontWeight: 600;
24
+ readonly letterSpacing: -0.5;
25
+ };
26
+ /** Subheading */
27
+ readonly subheading: {
28
+ readonly fontSize: 40;
29
+ readonly lineHeight: 1.25;
30
+ readonly fontWeight: 500;
31
+ };
32
+ /** Body text */
33
+ readonly body: {
34
+ readonly fontSize: 32;
35
+ readonly lineHeight: 1.5;
36
+ readonly fontWeight: 400;
37
+ };
38
+ /** Code / monospace text */
39
+ readonly code: {
40
+ readonly fontSize: 28;
41
+ readonly lineHeight: 1.6;
42
+ readonly fontWeight: 400;
43
+ };
44
+ /** Small caption text */
45
+ readonly caption: {
46
+ readonly fontSize: 24;
47
+ readonly lineHeight: 1.4;
48
+ readonly fontWeight: 400;
49
+ };
50
+ /** Badge / label text */
51
+ readonly label: {
52
+ readonly fontSize: 20;
53
+ readonly lineHeight: 1.3;
54
+ readonly fontWeight: 600;
55
+ readonly letterSpacing: 1;
56
+ };
57
+ };
58
+ /**
59
+ * Scale typography for a target width relative to 1920px landscape.
60
+ */
61
+ export declare function scaleTypography(style: VideoTypeStyle, targetWidth: number): VideoTypeStyle;
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ var m=import.meta.require;var u={title:{fontSize:72,lineHeight:1.1,fontWeight:700,letterSpacing:-1},heading:{fontSize:56,lineHeight:1.2,fontWeight:600,letterSpacing:-0.5},subheading:{fontSize:40,lineHeight:1.25,fontWeight:500},body:{fontSize:32,lineHeight:1.5,fontWeight:400},code:{fontSize:28,lineHeight:1.6,fontWeight:400},caption:{fontSize:24,lineHeight:1.4,fontWeight:400},label:{fontSize:20,lineHeight:1.3,fontWeight:600,letterSpacing:1}};function z(b,k){let j=k/1920;return{...b,fontSize:Math.round(b.fontSize*j),letterSpacing:b.letterSpacing?Math.round(b.letterSpacing*j*10)/10:void 0}}export{u as videoTypography,z as scaleTypography};
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,2 @@
1
+ // @bun
2
+ import{registerDocBlocks as f}from"@contractspec/lib.contracts-spec/docs";var h=[{id:"docs.video-gen.compositions",title:"Video Compositions & Primitives",summary:"Remotion composition components and reusable primitives for building programmatic videos.",kind:"reference",visibility:"public",route:"/docs/video-gen/compositions",tags:["video","remotion","compositions","primitives","react"],owners:["@contractspec/lib.video-gen"],body:'# Video Compositions & Primitives\n\nCompositions are React components rendered by Remotion. They use `useCurrentFrame()`, `useVideoConfig()`, and `interpolate()` to produce frame-accurate animations. All compositions must be **deterministic**: same props = same visual output.\n\n## Primitive Components\n\nPrimitives are reusable building blocks for constructing full compositions.\n\n```ts\nimport {\n AnimatedText,\n CodeBlock,\n Terminal,\n BrandFrame,\n ProgressBar,\n SceneTransitionWrapper,\n} from "@contractspec/lib.video-gen/compositions/primitives";\n```\n\n### AnimatedText\n\nText with entrance/exit slide + fade animations.\n\n| Prop | Type | Default | Description |\n|------|------|---------|-------------|\n| `text` | `string` | -- | Text content |\n| `variant` | `keyof videoTypography` | `"body"` | Typography preset (title, heading, subheading, body, code, caption, label) |\n| `enterAt` | `number` | `0` | Frame at which text enters |\n| `exitAt` | `number` | -- | Frame at which text exits (omit to keep visible) |\n| `color` | `string` | `"#ffffff"` | Text color |\n| `align` | `"left" \\| "center" \\| "right"` | `"left"` | Text alignment |\n\n### CodeBlock\n\nSyntax-aware code display with typing animation and macOS-style title bar.\n\n| Prop | Type | Default | Description |\n|------|------|---------|-------------|\n| `code` | `string` | -- | Code string to display |\n| `language` | `string` | `"typescript"` | Language label in the title bar |\n| `startAt` | `number` | `0` | Frame at which typing starts |\n| `typeAnimation` | `boolean` | `true` | Animate character-by-character typing |\n| `filename` | `string` | -- | Filename in the title bar (overrides language) |\n\n### Terminal\n\nCLI simulator with command typing, output lines, and cursor animation.\n\n| Prop | Type | Default | Description |\n|------|------|---------|-------------|\n| `lines` | `TerminalLine[]` | -- | Lines to display in sequence |\n| `startAt` | `number` | `0` | Frame at which terminal appears |\n| `prompt` | `string` | `"$ "` | Prompt string before commands |\n| `title` | `string` | `"Terminal"` | Title bar text |\n| `typingSpeed` | `number` | `2` | Frames per character for commands |\n\n`TerminalLine` types: `command` (typed), `output` (faded in), `error` (red), `success` (green), `comment` (dimmed with `#` prefix).\n\n### BrandFrame\n\nBranded container with safe-zone padding, gradient/solid/dark backgrounds, and optional watermark.\n\n| Prop | Type | Default | Description |\n|------|------|---------|-------------|\n| `variant` | `"solid" \\| "gradient" \\| "dark"` | `"gradient"` | Background style |\n| `showBranding` | `boolean` | `true` | Show "ContractSpec" watermark |\n| `animateEntrance` | `boolean` | `true` | Fade-in on first frames |\n| `styleOverrides` | `VideoStyleOverrides` | -- | Override colors, fonts, dark mode |\n\n### ProgressBar\n\nThin progress indicator at the top or bottom of the frame.\n\n| Prop | Type | Default | Description |\n|------|------|---------|-------------|\n| `height` | `number` | `4` | Bar height in pixels |\n| `color` | `string` | primary color | Bar fill color |\n| `position` | `"top" \\| "bottom"` | `"bottom"` | Placement |\n\n### SceneTransitionWrapper\n\nWraps children with entrance/exit transitions (fade, slide-left, slide-right, wipe).\n\n| Prop | Type | Default | Description |\n|------|------|---------|-------------|\n| `type` | `SceneTransitionType` | -- | Transition type |\n| `durationInFrames` | `number` | -- | Transition duration |\n| `direction` | `"in" \\| "out"` | -- | Entering or exiting |\n\n## Full Compositions\n\nFull compositions combine primitives into complete video templates. They are registered in Remotion Studio via `RemotionRoot`.\n\n### ApiOverview\n\nVisualizes a ContractSpec definition generating a full API surface. Used for homepage demos and documentation.\n\n```tsx\nimport { ApiOverview } from "@contractspec/lib.video-gen/compositions/api-overview";\n\n<ApiOverview\n specName="CreateUser"\n method="POST"\n endpoint="/api/users"\n specCode={`export const createUser = defineCommand({...})`}\n generatedOutputs={["REST Endpoint", "GraphQL Mutation", "Prisma Model"]}\n tagline="One spec. Every surface."\n/>\n```\n\n**Scenes**: Title + method badge -> Code typing animation -> Generated outputs fan-out -> Tagline.\n\n### SocialClip\n\nShort-form marketing content for LinkedIn, X, YouTube Shorts. Adapts layout for landscape (16:9), square (1:1), and portrait (9:16).\n\n```tsx\nimport { SocialClip } from "@contractspec/lib.video-gen/compositions/social-clip";\n\n<SocialClip\n hook="Stop rewriting the same API logic."\n message="Generate REST, GraphQL, DB, SDK from a single spec."\n points={["Deterministic output", "Fully ejectable", "No lock-in"]}\n cta="Try ContractSpec"\n ctaUrl="contractspec.dev"\n/>\n```\n\n**Scenes**: Hook (attention grabber) -> Main message -> Supporting points -> CTA button.\n\n### TerminalDemo\n\nCLI command walkthrough with animated terminal. Used in documentation and tutorial videos.\n\n```tsx\nimport { TerminalDemo } from "@contractspec/lib.video-gen/compositions/terminal-demo";\n\n<TerminalDemo\n title="Getting Started with ContractSpec"\n subtitle="Define once, generate everything."\n lines={[\n { type: "command", text: "npx contractspec init my-api" },\n { type: "output", text: "Created my-api/ with 3 sample contracts" },\n { type: "command", text: "npx contractspec build" },\n { type: "success", text: "Built 3 contracts -> 18 generated files" },\n ]}\n summary="Ship faster. Stay coherent."\n/>\n```\n\n**Scenes**: Title + subtitle -> Terminal typing animation -> Summary.\n\n## Creating New Compositions\n\n1. Create a new `.tsx` file in `src/compositions/`.\n2. Use primitives from `./primitives/` and design tokens from `../design/`.\n3. Use `useCurrentFrame()` and `interpolate()` for frame-based animations.\n4. Register in `src/remotion/Root.tsx` with a `<Composition>` entry.\n5. Export from `src/compositions/index.ts`.\n6. Add the export path to `package.json` (both workspace and publishConfig).\n\n### Guardrails\n\n- Keep compositions **pure**: no side effects, no network calls, no randomness.\n- Use `scaleSafeZone()` and `scaleTypography()` to support multiple formats.\n- All timing should be frame-based (not time-based) for deterministic output.\n'}];f(h);
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,173 @@
1
+ // @bun
2
+ import{registerDocBlocks as f}from"@contractspec/lib.contracts-spec/docs";var h=[{id:"docs.video-gen.design",title:"Video Design System",summary:"Design tokens, motion primitives, typography scale, and layout system optimized for programmatic video.",kind:"reference",visibility:"public",route:"/docs/video-gen/design",tags:["video","design-tokens","motion","typography","layout"],owners:["@contractspec/lib.video-gen"],body:`# Video Design System
3
+
4
+ The design layer bridges \`@contractspec/lib.design-system\` brand tokens with video-specific extensions for motion, typography, and spatial layout. All values are optimized for 1920x1080 (landscape) and scale proportionally for other formats.
5
+
6
+ \`\`\`ts
7
+ import {
8
+ defaultVideoTheme,
9
+ videoEasing,
10
+ videoDurations,
11
+ videoTypography,
12
+ videoSafeZone,
13
+ scaleSafeZone,
14
+ } from "@contractspec/lib.video-gen/design";
15
+ \`\`\`
16
+
17
+ ## Tokens
18
+
19
+ ### Brand Bridge
20
+
21
+ \`VideoThemeTokens\` extends the design-system \`ThemeTokens\` with a \`video\` namespace for video-specific colors:
22
+
23
+ \`\`\`ts
24
+ import { defaultVideoTheme } from "@contractspec/lib.video-gen/design/tokens";
25
+
26
+ // Brand tokens (from @contractspec/lib.design-system)
27
+ defaultVideoTheme.colors.primary; // brand primary
28
+ defaultVideoTheme.colors.accent; // brand accent
29
+
30
+ // Video-specific extensions
31
+ defaultVideoTheme.video.canvasBackground; // frame background
32
+ defaultVideoTheme.video.codeBackground; // "#1e1e2e"
33
+ defaultVideoTheme.video.terminalBackground; // "#0d1117"
34
+ defaultVideoTheme.video.terminalForeground; // "#c9d1d9"
35
+ defaultVideoTheme.video.highlight; // accent color
36
+ defaultVideoTheme.video.gradientStart; // primary
37
+ defaultVideoTheme.video.gradientEnd; // accent
38
+ \`\`\`
39
+
40
+ > Do not duplicate brand color values. Import and extend from \`@contractspec/lib.design-system\`.
41
+
42
+ ## Motion
43
+
44
+ ### Easing Functions
45
+
46
+ Pre-configured easing curves for use with Remotion's \`interpolate()\`:
47
+
48
+ | Key | Easing | Use Case |
49
+ |-----|--------|----------|
50
+ | \`entrance\` | \`Easing.out(Easing.exp)\` | Objects appearing |
51
+ | \`exit\` | \`Easing.in(Easing.exp)\` | Objects disappearing |
52
+ | \`emphasis\` | \`Easing.out(Easing.back(1.4))\` | Drawing attention, bounce |
53
+ | \`linear\` | \`Easing.linear\` | Progress bars, typing |
54
+ | \`gentle\` | \`Easing.bezier(0.25, 0.1, 0.25, 1)\` | Subtle movements |
55
+ | \`spring\` | \`Easing.out(Easing.back(1.7))\` | Playful movements |
56
+
57
+ \`\`\`ts
58
+ import { interpolate } from "remotion";
59
+ import { videoEasing } from "@contractspec/lib.video-gen/design/motion";
60
+
61
+ const opacity = interpolate(frame, [0, 15], [0, 1], {
62
+ easing: videoEasing.entrance,
63
+ extrapolateLeft: "clamp",
64
+ extrapolateRight: "clamp",
65
+ });
66
+ \`\`\`
67
+
68
+ ### Durations (frames at 30fps)
69
+
70
+ | Key | Frames | Seconds | Use Case |
71
+ |-----|--------|---------|----------|
72
+ | \`sceneTransition\` | 20 | 0.67s | Between scenes |
73
+ | \`textEntrance\` | 15 | 0.5s | Text slide-in |
74
+ | \`textExit\` | 12 | 0.4s | Text slide-out |
75
+ | \`codeTypingPerChar\` | 2 | 0.07s | Code typing speed |
76
+ | \`sectionPause\` | 30 | 1.0s | Pause after concept |
77
+ | \`emphasisPause\` | 15 | 0.5s | Brief emphasis |
78
+ | \`brandReveal\` | 25 | 0.83s | Logo/watermark |
79
+ | \`minScene\` | 60 | 2.0s | Minimum scene length |
80
+ | \`shortScene\` | 60 | 2.0s | Short scene |
81
+ | \`mediumScene\` | 120 | 4.0s | Medium scene |
82
+ | \`longScene\` | 240 | 8.0s | Long scene |
83
+
84
+ ### Transition Presets
85
+
86
+ \`\`\`ts
87
+ import { videoTransitions } from "@contractspec/lib.video-gen/design/motion";
88
+
89
+ // { type: "fade", durationInFrames: 20 }
90
+ videoTransitions.fade;
91
+
92
+ // { type: "slide-left", durationInFrames: 20 }
93
+ videoTransitions.slideLeft;
94
+ \`\`\`
95
+
96
+ ## Typography
97
+
98
+ ### Type Scale (1920x1080 baseline)
99
+
100
+ | Key | Size | Weight | Use Case |
101
+ |-----|------|--------|----------|
102
+ | \`title\` | 72px | 700 | Main title |
103
+ | \`heading\` | 56px | 600 | Section heading |
104
+ | \`subheading\` | 40px | 500 | Subheading |
105
+ | \`body\` | 32px | 400 | Body text |
106
+ | \`code\` | 28px | 400 | Monospace code |
107
+ | \`caption\` | 24px | 400 | Small caption |
108
+ | \`label\` | 20px | 600 | Badge / label |
109
+
110
+ ### Scaling for Other Formats
111
+
112
+ Use \`scaleTypography()\` to proportionally scale for non-landscape formats:
113
+
114
+ \`\`\`ts
115
+ import {
116
+ videoTypography,
117
+ scaleTypography,
118
+ } from "@contractspec/lib.video-gen/design/typography";
119
+
120
+ // Scale heading for 1080x1080 (square)
121
+ const squareHeading = scaleTypography(videoTypography.heading, 1080);
122
+ // -> fontSize: 32, lineHeight: 1.2, fontWeight: 600
123
+ \`\`\`
124
+
125
+ ## Layouts
126
+
127
+ ### Safe Zones
128
+
129
+ Content-safe padding for text within video frames (1920x1080 baseline):
130
+
131
+ \`\`\`ts
132
+ import {
133
+ videoSafeZone,
134
+ scaleSafeZone,
135
+ } from "@contractspec/lib.video-gen/design/layouts";
136
+
137
+ videoSafeZone.horizontal; // 120px
138
+ videoSafeZone.vertical; // 80px
139
+ videoSafeZone.contentWidth; // 1680px
140
+ videoSafeZone.contentHeight; // 920px
141
+
142
+ // Scale for portrait (1080x1920)
143
+ const portrait = scaleSafeZone({ type: "portrait", width: 1080, height: 1920 });
144
+ \`\`\`
145
+
146
+ ### Standard Positions
147
+
148
+ \`\`\`ts
149
+ import { videoPositions } from "@contractspec/lib.video-gen/design/layouts";
150
+
151
+ videoPositions.center; // { x: 960, y: 540 }
152
+ videoPositions.topLeft; // { x: 120, y: 80 }
153
+ videoPositions.bottomRight; // { x: 1800, y: 1000 } -- logos, watermarks
154
+ videoPositions.bottomCenter; // { x: 960, y: 960 } -- captions
155
+ \`\`\`
156
+
157
+ ### Format Variants
158
+
159
+ \`\`\`ts
160
+ import {
161
+ VIDEO_FORMATS,
162
+ getAllFormatVariants,
163
+ DEFAULT_FPS,
164
+ } from "@contractspec/lib.video-gen/design/layouts";
165
+
166
+ VIDEO_FORMATS.landscape; // { type: "landscape", width: 1920, height: 1080 }
167
+ VIDEO_FORMATS.portrait; // { type: "portrait", width: 1080, height: 1920 }
168
+ VIDEO_FORMATS.square; // { type: "square", width: 1080, height: 1080 }
169
+
170
+ getAllFormatVariants(); // [landscape, square, portrait]
171
+ DEFAULT_FPS; // 30
172
+ \`\`\`
173
+ `}];f(h);
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,166 @@
1
+ // @bun
2
+ import{registerDocBlocks as f}from"@contractspec/lib.contracts-spec/docs";var h=[{id:"docs.video-gen.generators",title:"Video Generation Pipeline",summary:"VideoGenerator, ScenePlanner, and ScriptGenerator -- from content brief to video project with optional LLM enhancement.",kind:"reference",visibility:"public",route:"/docs/video-gen/generators",tags:["video","generators","scene-planner","script-generator","llm","content-pipeline"],owners:["@contractspec/lib.video-gen"],body:`# Video Generation Pipeline
3
+
4
+ The generators layer converts a \`VideoBrief\` (content brief + video config) into a fully specified \`VideoProject\` (scene graph ready for rendering). It follows the \`@contractspec/lib.content-gen\` pattern: optional LLM, deterministic fallback.
5
+
6
+ \`\`\`
7
+ VideoBrief
8
+ |
9
+ v
10
+ ScenePlanner.plan(brief) --> ScenePlan (scenes + durations)
11
+ |
12
+ v
13
+ ScriptGenerator.generate(brief) --> NarrationScript (text + segments)
14
+ |
15
+ v
16
+ VoiceProvider.synthesize(text) --> AudioTrack (optional)
17
+ |
18
+ v
19
+ VideoGenerator.generate(brief) --> VideoProject (complete scene graph)
20
+ \`\`\`
21
+
22
+ ## VideoGenerator
23
+
24
+ The main orchestrator. Wires ScenePlanner, ScriptGenerator, and optional VoiceProvider into a single pipeline.
25
+
26
+ \`\`\`ts
27
+ import { VideoGenerator } from "@contractspec/lib.video-gen/generators";
28
+ import type { VideoBrief } from "@contractspec/lib.video-gen/types";
29
+
30
+ // Minimal (deterministic, no LLM, no voice)
31
+ const generator = new VideoGenerator({ fps: 30 });
32
+
33
+ // Full (with LLM for richer scenes + voice narration)
34
+ const generator = new VideoGenerator({
35
+ llm: myLLMProvider,
36
+ voice: myVoiceProvider,
37
+ model: "gpt-4o",
38
+ temperature: 0.4,
39
+ defaultVoiceId: "rachel",
40
+ fps: 30,
41
+ });
42
+
43
+ const project = await generator.generate(brief);
44
+ \`\`\`
45
+
46
+ ### Pipeline Steps
47
+
48
+ 1. **Scene planning** -- \`ScenePlanner.plan(brief)\` breaks the brief into concrete \`PlannedScene[]\` with composition IDs, props, and durations.
49
+ 2. **Script generation** -- If \`brief.narration.enabled\`, \`ScriptGenerator.generate()\` produces a \`NarrationScript\` with per-scene text segments.
50
+ 3. **Voice synthesis** -- If a \`VoiceProvider\` is configured and narration is enabled, synthesizes audio via \`voice.synthesize()\`.
51
+ 4. **Assembly** -- Combines scenes, audio, and metadata into a \`VideoProject\`.
52
+
53
+ ### Constructor Options
54
+
55
+ | Option | Type | Default | Description |
56
+ |--------|------|---------|-------------|
57
+ | \`llm\` | \`LLMProvider\` | -- | Optional LLM for enhanced generation |
58
+ | \`voice\` | \`VoiceProvider\` | -- | Optional voice synthesis provider |
59
+ | \`model\` | \`string\` | -- | LLM model override |
60
+ | \`temperature\` | \`number\` | \`0.4\` | LLM temperature (lower = more deterministic) |
61
+ | \`defaultVoiceId\` | \`string\` | -- | Default voice for narration |
62
+ | \`fps\` | \`number\` | \`30\` | Frames per second |
63
+
64
+ ## ScenePlanner
65
+
66
+ Breaks a \`VideoBrief\` into concrete scenes mapped to registered compositions.
67
+
68
+ \`\`\`ts
69
+ import { ScenePlanner } from "@contractspec/lib.video-gen/generators";
70
+
71
+ const planner = new ScenePlanner({ fps: 30 });
72
+ const plan = await planner.plan(brief);
73
+
74
+ plan.scenes; // PlannedScene[]
75
+ plan.estimatedDurationSeconds; // total estimated duration
76
+ plan.narrationScript; // combined narration text
77
+ \`\`\`
78
+
79
+ ### Deterministic Path (no LLM)
80
+
81
+ Maps brief sections to \`SocialClip\` compositions:
82
+
83
+ | Brief Section | Scene | Duration |
84
+ |---------------|-------|----------|
85
+ | \`title\` + \`summary\` | Hook / title | 3s |
86
+ | \`problems\` | Problem statement | 4s |
87
+ | \`solutions\` | Solution showcase | 5s |
88
+ | \`metrics\` | Proof / results | 3s |
89
+ | \`callToAction\` | CTA | 2s |
90
+
91
+ If \`brief.targetDurationSeconds\` is set, all scene durations are scaled proportionally.
92
+
93
+ ### LLM-Enhanced Path
94
+
95
+ With an \`LLMProvider\`, the planner sends the brief to the LLM and requests a scene breakdown as JSON. The LLM can choose from \`ApiOverview\`, \`SocialClip\`, or \`TerminalDemo\` compositions. Falls back to deterministic on any failure.
96
+
97
+ ## ScriptGenerator
98
+
99
+ Produces narration text from a \`ContentBrief\` with style control.
100
+
101
+ \`\`\`ts
102
+ import { ScriptGenerator } from "@contractspec/lib.video-gen/generators";
103
+
104
+ const scriptGen = new ScriptGenerator({ temperature: 0.5 });
105
+ const script = await scriptGen.generate(brief.content, brief.narration);
106
+
107
+ script.fullText; // complete narration
108
+ script.segments; // NarrationSegment[] (per-scene text)
109
+ script.estimatedDurationSeconds; // at ~150 words/min
110
+ script.style; // "professional" | "casual" | "technical"
111
+ \`\`\`
112
+
113
+ ### Narration Styles
114
+
115
+ | Style | Tone |
116
+ |-------|------|
117
+ | \`professional\` | Clear, authoritative, concise |
118
+ | \`casual\` | Friendly, conversational, approachable |
119
+ | \`technical\` | Precise, detailed, accurate |
120
+
121
+ ### NarrationSegment
122
+
123
+ Each segment maps to a scene and provides timing estimates:
124
+
125
+ \`\`\`ts
126
+ interface NarrationSegment {
127
+ sceneId: string; // "intro", "problems", "solutions", "metrics", "cta"
128
+ text: string; // narration text for this segment
129
+ estimatedDurationSeconds: number; // at ~150 words/min
130
+ }
131
+ \`\`\`
132
+
133
+ ## Input Types
134
+
135
+ ### VideoBrief
136
+
137
+ \`\`\`ts
138
+ interface VideoBrief {
139
+ content: ContentBrief; // from @contractspec/lib.content-gen
140
+ format: VideoFormat; // landscape, portrait, square, or custom
141
+ targetDurationSeconds?: number; // auto-calculated if omitted
142
+ narration?: NarrationConfig; // { enabled, voiceId, language, style }
143
+ style?: VideoStyleOverrides; // colors, fonts, dark mode
144
+ compositionId?: string; // force a specific composition
145
+ }
146
+ \`\`\`
147
+
148
+ ### PlannedScene
149
+
150
+ \`\`\`ts
151
+ interface PlannedScene {
152
+ compositionId: string; // maps to a registered Remotion composition
153
+ props: Record<string, unknown>; // input props for the composition
154
+ durationInFrames: number; // scene duration
155
+ narrationText?: string; // narrator text for this scene
156
+ notes?: string; // planning notes (LLM path only)
157
+ }
158
+ \`\`\`
159
+
160
+ ## Guardrails
161
+
162
+ - Generators are **stateless** -- no side effects, no caching. Call \`generate()\` / \`plan()\` for each video.
163
+ - LLM responses are parsed as JSON; any parse failure falls back to deterministic.
164
+ - Temperature defaults are conservative (0.3-0.5) for reproducibility.
165
+ - Duration estimates use 150 words/min speaking rate.
166
+ `}];f(h);
@@ -0,0 +1 @@
1
+ export {};