dsh-drawai 0.3.3 → 0.4.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.
Files changed (533) hide show
  1. package/LICENSE +4142 -0
  2. package/README.md +43 -10
  3. package/lib/audio-media.js +147 -0
  4. package/lib/audio-service.js +66 -0
  5. package/lib/canvas-format.js +134 -0
  6. package/lib/client.js +5283 -223
  7. package/lib/comfyui-default-workflow.mjs +1825 -0
  8. package/lib/comfyui-workflow.mjs +426 -0
  9. package/lib/document-commands.js +12 -0
  10. package/lib/document-core.js +29 -0
  11. package/lib/drawing-tasks.js +26 -0
  12. package/lib/imagegen.mjs +596 -0
  13. package/lib/index.js +1758 -129
  14. package/lib/media.js +26 -13
  15. package/lib/mgstyle-core.js +75 -0
  16. package/lib/motion/apply.js +180 -0
  17. package/lib/motion/asset-pack-lock.js +10 -0
  18. package/lib/motion/asset-pack.js +335 -0
  19. package/lib/motion/assets.js +290 -0
  20. package/lib/motion/audio.js +103 -0
  21. package/lib/motion/audiolevel.js +63 -0
  22. package/lib/motion/audiomix.js +144 -0
  23. package/lib/motion/beats.js +337 -0
  24. package/lib/motion/builtin-assets.js +62 -0
  25. package/lib/motion/canvas-spec.js +442 -0
  26. package/lib/motion/capture.js +95 -0
  27. package/lib/motion/cards.js +80 -0
  28. package/lib/motion/collect.js +447 -0
  29. package/lib/motion/delivery.js +112 -0
  30. package/lib/motion/edge-speech.py +90 -0
  31. package/lib/motion/entry.jsx +73 -0
  32. package/lib/motion/export.js +200 -0
  33. package/lib/motion/ffmpeg.js +42 -0
  34. package/lib/motion/fonts.js +71 -0
  35. package/lib/motion/jobs.js +113 -0
  36. package/lib/motion/json.js +4 -0
  37. package/lib/motion/media-catalog.js +59 -0
  38. package/lib/motion/mgstyles/BRIEF-TEMPLATE.md +63 -0
  39. package/lib/motion/mgstyles/briefs/01-flat-vector.md +104 -0
  40. package/lib/motion/mgstyles/briefs/02-line-art.md +97 -0
  41. package/lib/motion/mgstyles/briefs/03-isometric.md +108 -0
  42. package/lib/motion/mgstyles/briefs/05-cel-boil.md +145 -0
  43. package/lib/motion/mgstyles/briefs/06-collage.md +149 -0
  44. package/lib/motion/mgstyles/briefs/07-liquid.md +106 -0
  45. package/lib/motion/mgstyles/briefs/08-morph.md +111 -0
  46. package/lib/motion/mgstyles/briefs/09-bauhaus.md +150 -0
  47. package/lib/motion/mgstyles/briefs/10-synthwave.md +151 -0
  48. package/lib/motion/mgstyles/briefs/12-aurora-glass.md +147 -0
  49. package/lib/motion/mgstyles/briefs/18-hanazi.md +140 -0
  50. package/lib/motion/mgstyles/briefs/19-paperclip.md +156 -0
  51. package/lib/motion/mgstyles/briefs/20-pixel.md +118 -0
  52. package/lib/motion/mgstyles/briefs/22-hud.md +118 -0
  53. package/lib/motion/mgstyles/catalog.d/01-flat-vector.json +34 -0
  54. package/lib/motion/mgstyles/catalog.d/02-line-art.json +34 -0
  55. package/lib/motion/mgstyles/catalog.d/03-isometric.json +35 -0
  56. package/lib/motion/mgstyles/catalog.d/05-cel-boil.json +28 -0
  57. package/lib/motion/mgstyles/catalog.d/06-collage.json +28 -0
  58. package/lib/motion/mgstyles/catalog.d/07-liquid.json +28 -0
  59. package/lib/motion/mgstyles/catalog.d/08-morph.json +28 -0
  60. package/lib/motion/mgstyles/catalog.d/09-bauhaus.json +28 -0
  61. package/lib/motion/mgstyles/catalog.d/10-synthwave.json +28 -0
  62. package/lib/motion/mgstyles/catalog.d/12-aurora-glass.json +28 -0
  63. package/lib/motion/mgstyles/catalog.d/18-hanazi.json +28 -0
  64. package/lib/motion/mgstyles/catalog.d/19-paperclip.json +28 -0
  65. package/lib/motion/mgstyles/catalog.d/20-pixel.json +28 -0
  66. package/lib/motion/mgstyles/catalog.d/22-hud.json +28 -0
  67. package/lib/motion/mgstyles/catalog.json +1356 -0
  68. package/lib/motion/mgstyles/upstream/README.md +147 -0
  69. package/lib/motion/mgstyles/upstream/README.zh-CN.md +147 -0
  70. package/lib/motion/mgstyles/upstream/demos/01-flat-vector/cues.json +1 -0
  71. package/lib/motion/mgstyles/upstream/demos/01-flat-vector/index.html +712 -0
  72. package/lib/motion/mgstyles/upstream/demos/02-line-art/cues.json +331 -0
  73. package/lib/motion/mgstyles/upstream/demos/02-line-art/film.js +676 -0
  74. package/lib/motion/mgstyles/upstream/demos/02-line-art/index.html +18 -0
  75. package/lib/motion/mgstyles/upstream/demos/02-line-art/tools/dump_timing.mjs +26 -0
  76. package/lib/motion/mgstyles/upstream/demos/03-isometric/cues.json +109 -0
  77. package/lib/motion/mgstyles/upstream/demos/03-isometric/index.html +25 -0
  78. package/lib/motion/mgstyles/upstream/demos/03-isometric/js/anim.js +82 -0
  79. package/lib/motion/mgstyles/upstream/demos/03-isometric/js/main.js +219 -0
  80. package/lib/motion/mgstyles/upstream/demos/03-isometric/js/night5.js +180 -0
  81. package/lib/motion/mgstyles/upstream/demos/03-isometric/js/render.js +202 -0
  82. package/lib/motion/mgstyles/upstream/demos/03-isometric/js/title.js +167 -0
  83. package/lib/motion/mgstyles/upstream/demos/03-isometric/js/title5.js +294 -0
  84. package/lib/motion/mgstyles/upstream/demos/03-isometric/js/ui.js +141 -0
  85. package/lib/motion/mgstyles/upstream/demos/03-isometric/js/world.js +1399 -0
  86. package/lib/motion/mgstyles/upstream/demos/05-cel-boil/cues.json +157 -0
  87. package/lib/motion/mgstyles/upstream/demos/05-cel-boil/index.html +34 -0
  88. package/lib/motion/mgstyles/upstream/demos/05-cel-boil/js/engine.js +326 -0
  89. package/lib/motion/mgstyles/upstream/demos/05-cel-boil/js/scene.js +2036 -0
  90. package/lib/motion/mgstyles/upstream/demos/06-collage/assets/gen/layout.json +157 -0
  91. package/lib/motion/mgstyles/upstream/demos/06-collage/cues.json +80 -0
  92. package/lib/motion/mgstyles/upstream/demos/06-collage/index.html +889 -0
  93. package/lib/motion/mgstyles/upstream/demos/07-liquid/cues.json +100 -0
  94. package/lib/motion/mgstyles/upstream/demos/07-liquid/index.html +108 -0
  95. package/lib/motion/mgstyles/upstream/demos/07-liquid/js/engine.js +153 -0
  96. package/lib/motion/mgstyles/upstream/demos/07-liquid/js/links.js +64 -0
  97. package/lib/motion/mgstyles/upstream/demos/07-liquid/js/lookdev.js +46 -0
  98. package/lib/motion/mgstyles/upstream/demos/07-liquid/js/scene.js +963 -0
  99. package/lib/motion/mgstyles/upstream/demos/07-liquid/js/shaders.js +647 -0
  100. package/lib/motion/mgstyles/upstream/demos/07-liquid/js/textsdf.js +114 -0
  101. package/lib/motion/mgstyles/upstream/demos/07-liquid/js/type.js +50 -0
  102. package/lib/motion/mgstyles/upstream/demos/08-morph/cues.json +131 -0
  103. package/lib/motion/mgstyles/upstream/demos/08-morph/glyphs.json +1 -0
  104. package/lib/motion/mgstyles/upstream/demos/08-morph/index.html +901 -0
  105. package/lib/motion/mgstyles/upstream/demos/09-bauhaus/cues.json +270 -0
  106. package/lib/motion/mgstyles/upstream/demos/09-bauhaus/film.js +697 -0
  107. package/lib/motion/mgstyles/upstream/demos/09-bauhaus/index.html +12 -0
  108. package/lib/motion/mgstyles/upstream/demos/10-synthwave/cues.json +44 -0
  109. package/lib/motion/mgstyles/upstream/demos/10-synthwave/index.html +1028 -0
  110. package/lib/motion/mgstyles/upstream/demos/12-aurora-glass/cues.json +67 -0
  111. package/lib/motion/mgstyles/upstream/demos/12-aurora-glass/index.html +16 -0
  112. package/lib/motion/mgstyles/upstream/demos/12-aurora-glass/main.js +967 -0
  113. package/lib/motion/mgstyles/upstream/demos/12-aurora-glass/shaders.js +468 -0
  114. package/lib/motion/mgstyles/upstream/demos/18-hanazi/cues.json +117 -0
  115. package/lib/motion/mgstyles/upstream/demos/18-hanazi/index.html +541 -0
  116. package/lib/motion/mgstyles/upstream/demos/19-paperclip/assets/countries-110m.json +1 -0
  117. package/lib/motion/mgstyles/upstream/demos/19-paperclip/assets/stickers/meta.json +34 -0
  118. package/lib/motion/mgstyles/upstream/demos/19-paperclip/cues.json +285 -0
  119. package/lib/motion/mgstyles/upstream/demos/19-paperclip/index.html +599 -0
  120. package/lib/motion/mgstyles/upstream/demos/20-pixel/cues.json +42 -0
  121. package/lib/motion/mgstyles/upstream/demos/20-pixel/film.js +914 -0
  122. package/lib/motion/mgstyles/upstream/demos/20-pixel/index.html +18 -0
  123. package/lib/motion/mgstyles/upstream/demos/22-hud/cues.json +108 -0
  124. package/lib/motion/mgstyles/upstream/demos/22-hud/index.html +125 -0
  125. package/lib/motion/mgstyles/upstream/demos/22-hud/js/holo.js +275 -0
  126. package/lib/motion/mgstyles/upstream/demos/22-hud/js/hud.js +855 -0
  127. package/lib/motion/mgstyles/upstream/demos/22-hud/js/post.js +150 -0
  128. package/lib/motion/mgstyles/upstream/demos/22-hud/js/util.js +65 -0
  129. package/lib/motion/mgstyles/upstream/demos/22-hud/js/v5.js +142 -0
  130. package/lib/motion/mgstyles/upstream/harness/render.mjs +319 -0
  131. package/lib/motion/mgstyles/upstream/manifest.json +269 -0
  132. package/lib/motion/mgstyles/upstream/prompts/01-flat-vector.md +98 -0
  133. package/lib/motion/mgstyles/upstream/prompts/02-line-art.md +95 -0
  134. package/lib/motion/mgstyles/upstream/prompts/03-isometric.md +97 -0
  135. package/lib/motion/mgstyles/upstream/prompts/05-cel-boil.md +95 -0
  136. package/lib/motion/mgstyles/upstream/prompts/06-collage.md +95 -0
  137. package/lib/motion/mgstyles/upstream/prompts/07-liquid.md +98 -0
  138. package/lib/motion/mgstyles/upstream/prompts/08-morph.md +95 -0
  139. package/lib/motion/mgstyles/upstream/prompts/09-bauhaus.md +96 -0
  140. package/lib/motion/mgstyles/upstream/prompts/10-synthwave.md +95 -0
  141. package/lib/motion/mgstyles/upstream/prompts/12-aurora-glass.md +96 -0
  142. package/lib/motion/mgstyles/upstream/prompts/18-hanazi.md +95 -0
  143. package/lib/motion/mgstyles/upstream/prompts/19-paperclip.md +96 -0
  144. package/lib/motion/mgstyles/upstream/prompts/20-pixel.md +96 -0
  145. package/lib/motion/mgstyles/upstream/prompts/22-hud.md +95 -0
  146. package/lib/motion/mgstyles/upstream/rubric.md +51 -0
  147. package/lib/motion/mgstyles/upstream/template.md +36 -0
  148. package/lib/motion/pixelqa.js +198 -0
  149. package/lib/motion/preview.js +95 -0
  150. package/lib/motion/project.js +395 -0
  151. package/lib/motion/qa.js +290 -0
  152. package/lib/motion/reference-media.jsx +10 -0
  153. package/lib/motion/render-settings.js +112 -0
  154. package/lib/motion/render.js +159 -0
  155. package/lib/motion/scene-kit.js +183 -0
  156. package/lib/motion/sfx.js +232 -0
  157. package/lib/motion/shotcraft/ClipCard.tsx +204 -0
  158. package/lib/motion/shotcraft/catalog.json +2461 -0
  159. package/lib/motion/shotcraft/upstream/SKILL.md +286 -0
  160. package/lib/motion/shotcraft/upstream/assets/lib/Caption.tsx +54 -0
  161. package/lib/motion/shotcraft/upstream/assets/lib/ClipCard.tsx +200 -0
  162. package/lib/motion/shotcraft/upstream/assets/lib/DigitRoll.tsx +45 -0
  163. package/lib/motion/shotcraft/upstream/assets/lib/FlashCut.tsx +20 -0
  164. package/lib/motion/shotcraft/upstream/assets/lib/FlatPanel.tsx +65 -0
  165. package/lib/motion/shotcraft/upstream/assets/lib/PageCam.tsx +151 -0
  166. package/lib/motion/shotcraft/upstream/assets/lib/VerticalTicker.tsx +129 -0
  167. package/lib/motion/shotcraft/upstream/assets/lib/helpers/camera.tsx +75 -0
  168. package/lib/motion/shotcraft/upstream/assets/lib/helpers/motion.ts +40 -0
  169. package/lib/motion/shotcraft/upstream/assets/lib/helpers/rand.ts +11 -0
  170. package/lib/motion/shotcraft/upstream/assets/lib/helpers/shake.ts +10 -0
  171. package/lib/motion/shotcraft/upstream/assets/scripts/__pycache__/sfx-source.cpython-313.pyc +0 -0
  172. package/lib/motion/shotcraft/upstream/assets/scripts/build-readme-cover.mjs +49 -0
  173. package/lib/motion/shotcraft/upstream/assets/scripts/capture-template.mjs +210 -0
  174. package/lib/motion/shotcraft/upstream/assets/scripts/sfx-source.py +423 -0
  175. package/lib/motion/shotcraft/upstream/assets/scripts/smoke-render-demos.py +170 -0
  176. package/lib/motion/shotcraft/upstream/assets/scripts/test_sfx_source.py +157 -0
  177. package/lib/motion/shotcraft/upstream/demos/README.md +120 -0
  178. package/lib/motion/shotcraft/upstream/demos/_fixtures/Brand.tsx +112 -0
  179. package/lib/motion/shotcraft/upstream/demos/_fixtures/Fixtures.tsx +647 -0
  180. package/lib/motion/shotcraft/upstream/demos/_fixtures/Look.tsx +316 -0
  181. package/lib/motion/shotcraft/upstream/demos/_fixtures/Motion.tsx +82 -0
  182. package/lib/motion/shotcraft/upstream/demos/_fixtures/PageCam2D.tsx +115 -0
  183. package/lib/motion/shotcraft/upstream/demos/_fixtures/Polish.tsx +243 -0
  184. package/lib/motion/shotcraft/upstream/demos/_textures/live-layout.json +389 -0
  185. package/lib/motion/shotcraft/upstream/demos/camera/basic-3d-scene/Basic3DScene.tsx +250 -0
  186. package/lib/motion/shotcraft/upstream/demos/camera/crash-zoom-punch/CrashImpactReal.tsx +305 -0
  187. package/lib/motion/shotcraft/upstream/demos/camera/crash-zoom-punch/CrashZoomReal.tsx +246 -0
  188. package/lib/motion/shotcraft/upstream/demos/camera/cursor-flyover/CursorFlyover.tsx +390 -0
  189. package/lib/motion/shotcraft/upstream/demos/camera/depth-layer-moves/MultiplaneReal.tsx +138 -0
  190. package/lib/motion/shotcraft/upstream/demos/camera/graze-face-tour/GrazeFaceTour.tsx +542 -0
  191. package/lib/motion/shotcraft/upstream/demos/camera/overhead-camera-moves/OverheadTabletopDrop.tsx +315 -0
  192. package/lib/motion/shotcraft/upstream/demos/camera/overhead-camera-moves/TiltReveal.tsx +299 -0
  193. package/lib/motion/shotcraft/upstream/demos/camera/space-camera-moves/DroneDiveLanding.tsx +173 -0
  194. package/lib/motion/shotcraft/upstream/demos/camera/space-camera-moves/ExplodedView.tsx +348 -0
  195. package/lib/motion/shotcraft/upstream/demos/camera/steep-tilt-glide/SteepTiltGlide.tsx +366 -0
  196. package/lib/motion/shotcraft/upstream/demos/camera/tension-camera-moves/BulletTimeFreezeOrbit.tsx +279 -0
  197. package/lib/motion/shotcraft/upstream/demos/camera/tension-camera-moves/PullBackIsolation.tsx +184 -0
  198. package/lib/motion/shotcraft/upstream/demos/camera/terminal-3d/Terminal3D.tsx +390 -0
  199. package/lib/motion/shotcraft/upstream/demos/data/before-after-slider-scrub/BeforeAfterSliderScrub.tsx +155 -0
  200. package/lib/motion/shotcraft/upstream/demos/data/chart-live-moves/AxisRescaleShockV2.tsx +303 -0
  201. package/lib/motion/shotcraft/upstream/demos/data/chart-live-moves/OscilloscopeStreamV2.tsx +290 -0
  202. package/lib/motion/shotcraft/upstream/demos/data/chart-live-moves/UnitDotSwarmRegroupV2.tsx +278 -0
  203. package/lib/motion/shotcraft/upstream/demos/data/gauge-readout-moves/NeedleSweepSelftest.tsx +307 -0
  204. package/lib/motion/shotcraft/upstream/demos/data/gauge-readout-moves/TapeScrollFixedPointer.tsx +215 -0
  205. package/lib/motion/shotcraft/upstream/demos/data/scroll-brake-moves/BrakeReticleLock.tsx +299 -0
  206. package/lib/motion/shotcraft/upstream/demos/data/scroll-brake-moves/ChangelogScrollBrake.tsx +232 -0
  207. package/lib/motion/shotcraft/upstream/demos/data/timeline-travel/TimelineTravel.tsx +290 -0
  208. package/lib/motion/shotcraft/upstream/demos/effects/assemble-then-type-flyin/AssembleThenTypeFlyin.tsx +273 -0
  209. package/lib/motion/shotcraft/upstream/demos/effects/aurora-bloom-bg-flip/AuroraBloomBgFlip.tsx +167 -0
  210. package/lib/motion/shotcraft/upstream/demos/effects/brand-frame-snap/BrandFrameSnap.tsx +536 -0
  211. package/lib/motion/shotcraft/upstream/demos/effects/fui-hud-moves/ReticleLockOn.tsx +164 -0
  212. package/lib/motion/shotcraft/upstream/demos/effects/glow-flyline-moves/FlylineArc.tsx +175 -0
  213. package/lib/motion/shotcraft/upstream/demos/effects/glow-flyline-moves/GlowOrbAmbient.tsx +197 -0
  214. package/lib/motion/shotcraft/upstream/demos/effects/glow-flyline-moves/OrbFlylineRelay.tsx +241 -0
  215. package/lib/motion/shotcraft/upstream/demos/effects/icon-performance-moves/AttentionBounce.tsx +279 -0
  216. package/lib/motion/shotcraft/upstream/demos/effects/impact-feedback/AnimeImpact.tsx +230 -0
  217. package/lib/motion/shotcraft/upstream/demos/effects/impact-feedback/HitCounter.tsx +345 -0
  218. package/lib/motion/shotcraft/upstream/demos/effects/light-play-moves/SheenSweepRetry.tsx +275 -0
  219. package/lib/motion/shotcraft/upstream/demos/effects/light-play-moves/SpotlightSweepReveal.tsx +229 -0
  220. package/lib/motion/shotcraft/upstream/demos/effects/radial-ripple-phone-chips/RadialRipplePhoneChips.tsx +312 -0
  221. package/lib/motion/shotcraft/upstream/demos/effects/riso-print-hits/RisoMisregistrationHit.tsx +222 -0
  222. package/lib/motion/shotcraft/upstream/demos/effects/scan-bracket-sweep/ScanBracketSweep.tsx +295 -0
  223. package/lib/motion/shotcraft/upstream/demos/effects/scanline-annotate-focus/ScanlineAnnotateFocus.tsx +329 -0
  224. package/lib/motion/shotcraft/upstream/demos/effects/scanline-assemble-flyin/ScanlineAssembleFlyin.tsx +315 -0
  225. package/lib/motion/shotcraft/upstream/demos/effects/slam-entrance-moves/ImpactBurstKit.tsx +264 -0
  226. package/lib/motion/shotcraft/upstream/demos/effects/slam-entrance-moves/KanadaPerspectiveSnap.tsx +260 -0
  227. package/lib/motion/shotcraft/upstream/demos/effects/slam-entrance-moves/ScoreSlam.tsx +263 -0
  228. package/lib/motion/shotcraft/upstream/demos/effects/spotlight-sweep-moves/CornerSpotlightReveal.tsx +123 -0
  229. package/lib/motion/shotcraft/upstream/demos/effects/spotlight-sweep-moves/GlowWakeSleepPanel.tsx +187 -0
  230. package/lib/motion/shotcraft/upstream/demos/effects/spotlight-sweep-moves/SlideSpotlightPan.tsx +175 -0
  231. package/lib/motion/shotcraft/upstream/demos/interaction/autolayout-gap-dial/AutolayoutGapDial.tsx +305 -0
  232. package/lib/motion/shotcraft/upstream/demos/interaction/canvas-materialize-moves/DiagramCascadeBuild.tsx +350 -0
  233. package/lib/motion/shotcraft/upstream/demos/interaction/canvas-materialize-moves/PanelToCanvasMaterialize.tsx +352 -0
  234. package/lib/motion/shotcraft/upstream/demos/interaction/chip-grid-single-select-blackout/ChipGridSingleSelectBlackout.tsx +218 -0
  235. package/lib/motion/shotcraft/upstream/demos/interaction/collab-cursor-moves/CursorCastEnsemble.tsx +297 -0
  236. package/lib/motion/shotcraft/upstream/demos/interaction/glass-pill-dictation-typing/GlassPillDictationTyping.tsx +157 -0
  237. package/lib/motion/shotcraft/upstream/demos/interaction/hashtag-to-pill-materialize/HashtagToPillMaterialize.tsx +218 -0
  238. package/lib/motion/shotcraft/upstream/demos/interaction/picker-carousel-feature-cycle/PickerCarouselFeatureCycle.tsx +202 -0
  239. package/lib/motion/shotcraft/upstream/demos/interaction/segmented-thumb-hero/SegmentedThumbHero.tsx +265 -0
  240. package/lib/motion/shotcraft/upstream/demos/interaction/theme-switch-moves/PaletteThemeRipple.tsx +457 -0
  241. package/lib/motion/shotcraft/upstream/demos/interaction/theme-switch-moves/ThemeSweepToggle.tsx +446 -0
  242. package/lib/motion/shotcraft/upstream/demos/interaction/type-and-filter/TypeAndFilter.tsx +249 -0
  243. package/lib/motion/shotcraft/upstream/demos/interaction/voice-waveform-live/VoiceWaveformLive.tsx +278 -0
  244. package/lib/motion/shotcraft/upstream/demos/opening/crane-rise-reveal/CraneRiseReveal.tsx +332 -0
  245. package/lib/motion/shotcraft/upstream/demos/opening/dataviz-landscape-open/DatavizLandscapeOpen.tsx +358 -0
  246. package/lib/motion/shotcraft/upstream/demos/opening/fracture/Fracture.tsx +201 -0
  247. package/lib/motion/shotcraft/upstream/demos/opening/icon-field-colorize/IconFieldColorize.tsx +200 -0
  248. package/lib/motion/shotcraft/upstream/demos/opening/letterspace-materialize/LetterspaceMaterialize.tsx +208 -0
  249. package/lib/motion/shotcraft/upstream/demos/opening/magician-card-flourish/MagicianCardFlourish.tsx +341 -0
  250. package/lib/motion/shotcraft/upstream/demos/opening/orbit-ring-title-open/OrbitRingTitleOpen.tsx +389 -0
  251. package/lib/motion/shotcraft/upstream/demos/opening/spotlight-hero-card/SpotlightHeroCard.tsx +293 -0
  252. package/lib/motion/shotcraft/upstream/demos/opening/stroke-segment-build/StrokeSegmentBuild.tsx +183 -0
  253. package/lib/motion/shotcraft/upstream/demos/opening/text-as-mask/TextAsMask.tsx +245 -0
  254. package/lib/motion/shotcraft/upstream/demos/outro/grain-dissolve/GrainDissolve.tsx +222 -0
  255. package/lib/motion/shotcraft/upstream/demos/outro/logo-shrink-wordmark-lockup/LogoShrinkWordmarkLockup.tsx +223 -0
  256. package/lib/motion/shotcraft/upstream/demos/outro/neon-triple-marquee/NeonTripleMarquee.tsx +217 -0
  257. package/lib/motion/shotcraft/upstream/demos/outro/outro-group-photo-launch/OutroGroupPhotoLaunch.tsx +343 -0
  258. package/lib/motion/shotcraft/upstream/demos/outro/ui-strip-away-outro/UiStripAwayOutro.tsx +357 -0
  259. package/lib/motion/shotcraft/upstream/demos/outro/ui-to-brand-morph/IconFlipBloomLogo.tsx +187 -0
  260. package/lib/motion/shotcraft/upstream/demos/outro/ui-to-brand-morph/InputMorphsIntoLogo.tsx +333 -0
  261. package/lib/motion/shotcraft/upstream/demos/rhythm/beat-cut-moves/PaparazziFlash.tsx +274 -0
  262. package/lib/motion/shotcraft/upstream/demos/rhythm/beat-step-list-theme-cycle/BeatStepListThemeCycle.tsx +270 -0
  263. package/lib/motion/shotcraft/upstream/demos/rhythm/panel-grid-moves/ComicPanelSplit.tsx +430 -0
  264. package/lib/motion/shotcraft/upstream/demos/rhythm/quad-split-parallel-scenes/QuadSplitParallelScenes.tsx +252 -0
  265. package/lib/motion/shotcraft/upstream/demos/rhythm/rhythm-interrupt-moves/JumpCutPunchIn.tsx +106 -0
  266. package/lib/motion/shotcraft/upstream/demos/rhythm/sakuga-timing-shift/SakugaTimingShift.tsx +288 -0
  267. package/lib/motion/shotcraft/upstream/demos/rhythm/speed-ramp-freeze/FreezeAnnotateReal.tsx +362 -0
  268. package/lib/motion/shotcraft/upstream/demos/rhythm/trailer-grammar-moves/TrailerBumper.tsx +168 -0
  269. package/lib/motion/shotcraft/upstream/demos/transition/bottom-push-stack-wipe/BottomPushStackWipe.tsx +310 -0
  270. package/lib/motion/shotcraft/upstream/demos/transition/card-flip-reveal/CardFlipReveal.tsx +261 -0
  271. package/lib/motion/shotcraft/upstream/demos/transition/card-flock-tumble/CardFlockTumble.tsx +459 -0
  272. package/lib/motion/shotcraft/upstream/demos/transition/circle-match-iris/CircleMatchIris.tsx +294 -0
  273. package/lib/motion/shotcraft/upstream/demos/transition/gradient-transition/GradientTransition.tsx +161 -0
  274. package/lib/motion/shotcraft/upstream/demos/transition/line-carry-transition/LineCarryTransition.tsx +248 -0
  275. package/lib/motion/shotcraft/upstream/demos/transition/mosaic-reframe/MosaicReframe.tsx +359 -0
  276. package/lib/motion/shotcraft/upstream/demos/transition/page-turn-transitions/BarnDoorSplit.tsx +227 -0
  277. package/lib/motion/shotcraft/upstream/demos/transition/print-texture-transitions/InkBleedReveal.tsx +162 -0
  278. package/lib/motion/shotcraft/upstream/demos/transition/shot-transitions/PortalWipeV2.tsx +248 -0
  279. package/lib/motion/shotcraft/upstream/demos/transition/shot-transitions/WhipBrakeReal.tsx +186 -0
  280. package/lib/motion/shotcraft/upstream/demos/transition/tear-streak-transitions/GlitchDisplace.tsx +355 -0
  281. package/lib/motion/shotcraft/upstream/demos/transition/transition-hidden-cut/InvisibleCut.tsx +272 -0
  282. package/lib/motion/shotcraft/upstream/demos/transition/transition-hidden-cut/LightLeakBurn.tsx +262 -0
  283. package/lib/motion/shotcraft/upstream/demos/transition/transition-hidden-cut/VersusSlam.tsx +217 -0
  284. package/lib/motion/shotcraft/upstream/demos/transition/transition-travel/LetterformZoom.tsx +285 -0
  285. package/lib/motion/shotcraft/upstream/demos/transition/white-flash-logo-simplify-cut/WhiteFlashLogoSimplifyCut.tsx +205 -0
  286. package/lib/motion/shotcraft/upstream/demos/transition/wipe-transitions/BlindsSlice.tsx +178 -0
  287. package/lib/motion/shotcraft/upstream/demos/typography/blur-slide/BlurSlide.tsx +147 -0
  288. package/lib/motion/shotcraft/upstream/demos/typography/brace-expand/BraceExpand.tsx +143 -0
  289. package/lib/motion/shotcraft/upstream/demos/typography/brand-ink-open/BrandInkOpen.tsx +134 -0
  290. package/lib/motion/shotcraft/upstream/demos/typography/countdown-arc-scatter/CountdownArcScatter.tsx +217 -0
  291. package/lib/motion/shotcraft/upstream/demos/typography/flying-words/FlyingWords.tsx +198 -0
  292. package/lib/motion/shotcraft/upstream/demos/typography/glitch-cycle/GlitchCycle.tsx +221 -0
  293. package/lib/motion/shotcraft/upstream/demos/typography/gradient-word-sweep/GradientWordSweep.tsx +312 -0
  294. package/lib/motion/shotcraft/upstream/demos/typography/lead-word-zoom-assemble/LeadWordZoomAssemble.tsx +261 -0
  295. package/lib/motion/shotcraft/upstream/demos/typography/marker-underline-title/MarkerUnderlineTitle.tsx +121 -0
  296. package/lib/motion/shotcraft/upstream/demos/typography/outline-word-fill/OutlineWordFill.tsx +153 -0
  297. package/lib/motion/shotcraft/upstream/demos/typography/paper-title-card/PaperTitleCard.tsx +179 -0
  298. package/lib/motion/shotcraft/upstream/demos/typography/pill-chip-slot-cycle-handled/PillChipSlotCycleHandled.tsx +140 -0
  299. package/lib/motion/shotcraft/upstream/demos/typography/pill-slot-cycle/PillSlotCycle.tsx +309 -0
  300. package/lib/motion/shotcraft/upstream/demos/typography/text-column-converge/TextColumnConverge.tsx +191 -0
  301. package/lib/motion/shotcraft/upstream/demos/typography/title-demote-to-label/TitleDemoteToLabel.tsx +292 -0
  302. package/lib/motion/shotcraft/upstream/demos/typography/type-assembly-moves/LetterformDriftAssembly.tsx +135 -0
  303. package/lib/motion/shotcraft/upstream/demos/typography/type-assembly-moves/SplitTextStagger.tsx +124 -0
  304. package/lib/motion/shotcraft/upstream/demos/typography/type-assembly-moves/TextOnPath.tsx +255 -0
  305. package/lib/motion/shotcraft/upstream/demos/typography/type-entrance-moves/LetterDropPhysics.tsx +173 -0
  306. package/lib/motion/shotcraft/upstream/demos/typography/type-rhythm-sync/FontWeightPump.tsx +225 -0
  307. package/lib/motion/shotcraft/upstream/demos/typography/type-rhythm-sync/KaraokeFillSync.tsx +141 -0
  308. package/lib/motion/shotcraft/upstream/demos/typography/typewriter-moves/TypewriterErrorRetype.tsx +137 -0
  309. package/lib/motion/shotcraft/upstream/demos/typography/vertical-word-roll-blur-cycle/VerticalWordRollBlurCycle.tsx +147 -0
  310. package/lib/motion/shotcraft/upstream/demos/typography/word-relay-filmstrip/WordRelayFilmstrip.tsx +409 -0
  311. package/lib/motion/shotcraft/upstream/demos/typography/word-relay-geometry/WordRelayGeometry.tsx +280 -0
  312. package/lib/motion/shotcraft/upstream/demos/ui-entrance/avatar-bracket-carousel/AvatarBracketCarousel.tsx +271 -0
  313. package/lib/motion/shotcraft/upstream/demos/ui-entrance/bezier-source-converge-merge/BezierSourceConvergeMerge.tsx +385 -0
  314. package/lib/motion/shotcraft/upstream/demos/ui-entrance/card-stack/CardStack.tsx +312 -0
  315. package/lib/motion/shotcraft/upstream/demos/ui-entrance/carousel-3d/Carousel3D.tsx +303 -0
  316. package/lib/motion/shotcraft/upstream/demos/ui-entrance/clipcard-looping/ClipCardLooping.tsx +77 -0
  317. package/lib/motion/shotcraft/upstream/demos/ui-entrance/cloner-depth-echo/ClonerDepthEcho.tsx +311 -0
  318. package/lib/motion/shotcraft/upstream/demos/ui-entrance/deck-deal-flyin/DeckDealFlyin.tsx +307 -0
  319. package/lib/motion/shotcraft/upstream/demos/ui-entrance/doc-park-left-pill-deal/DocParkLeftPillDeal.tsx +349 -0
  320. package/lib/motion/shotcraft/upstream/demos/ui-entrance/document-typewriter-reveal/DocumentTypewriterReveal.tsx +255 -0
  321. package/lib/motion/shotcraft/upstream/demos/ui-entrance/draw-svg-trace/DrawSvgTrace.tsx +244 -0
  322. package/lib/motion/shotcraft/upstream/demos/ui-entrance/element-body-moves/ContactShadowLift.tsx +217 -0
  323. package/lib/motion/shotcraft/upstream/demos/ui-entrance/integration-hub-map/IntegrationHubMap.tsx +652 -0
  324. package/lib/motion/shotcraft/upstream/demos/ui-entrance/list-reveal/ListReveal.tsx +153 -0
  325. package/lib/motion/shotcraft/upstream/demos/ui-entrance/list-stack-press/ListStackPress.tsx +238 -0
  326. package/lib/motion/shotcraft/upstream/demos/ui-entrance/neon-frame-forerun/NeonFrameForerun.tsx +324 -0
  327. package/lib/motion/shotcraft/upstream/demos/ui-entrance/neon-frame-orbit-drop/NeonFrameForerunOrbit.tsx +354 -0
  328. package/lib/motion/shotcraft/upstream/demos/ui-entrance/page-waterfall-wall/PageWaterfallWall.tsx +101 -0
  329. package/lib/motion/shotcraft/upstream/demos/ui-entrance/page-waterfall-wall/VerticalTicker.tsx +129 -0
  330. package/lib/motion/shotcraft/upstream/demos/ui-entrance/product-card-progressive-assemble/ProductCardProgressiveAssemble.tsx +297 -0
  331. package/lib/motion/shotcraft/upstream/demos/ui-entrance/radial-wave/RadialWave.tsx +57 -0
  332. package/lib/motion/shotcraft/upstream/demos/ui-entrance/research-card-stack-scroll/ResearchCardStackScroll.tsx +155 -0
  333. package/lib/motion/shotcraft/upstream/demos/ui-entrance/row-embed/RowEmbed.tsx +175 -0
  334. package/lib/motion/shotcraft/upstream/demos/ui-entrance/value-stagger-gradient/ValueStaggerGradient.tsx +153 -0
  335. package/lib/motion/shotcraft/upstream/demos/ui-entrance/wall-reveal-moves/BentoLightUp.tsx +146 -0
  336. package/lib/motion/shotcraft/upstream/demos/ui-entrance/wall-reveal-moves/WireframeDrawOn.tsx +226 -0
  337. package/lib/motion/shotcraft/upstream/gallery/api/library.json +1 -0
  338. package/lib/motion/shotcraft/upstream/manifest.json +2715 -0
  339. package/lib/motion/shotcraft/upstream/references/aesthetic-rules.md +193 -0
  340. package/lib/motion/shotcraft/upstream/references/final-review.md +121 -0
  341. package/lib/motion/shotcraft/upstream/references/guided-free-creation.md +199 -0
  342. package/lib/motion/shotcraft/upstream/references/jianying-export.md +183 -0
  343. package/lib/motion/shotcraft/upstream/references/music-beat-sync.md +257 -0
  344. package/lib/motion/shotcraft/upstream/references/pipeline.md +382 -0
  345. package/lib/motion/shotcraft/upstream/references/publish-upload-post.md +111 -0
  346. package/lib/motion/shotcraft/upstream/references/sequences/promo-energy-arc.md +50 -0
  347. package/lib/motion/shotcraft/upstream/references/sfx-sourcing.md +95 -0
  348. package/lib/motion/shotcraft/upstream/references/shots/camera/basic-3d-scene.md +41 -0
  349. package/lib/motion/shotcraft/upstream/references/shots/camera/crash-zoom-punch.md +52 -0
  350. package/lib/motion/shotcraft/upstream/references/shots/camera/cursor-flyover.md +39 -0
  351. package/lib/motion/shotcraft/upstream/references/shots/camera/depth-layer-moves.md +39 -0
  352. package/lib/motion/shotcraft/upstream/references/shots/camera/graze-face-tour.md +57 -0
  353. package/lib/motion/shotcraft/upstream/references/shots/camera/overhead-camera-moves.md +51 -0
  354. package/lib/motion/shotcraft/upstream/references/shots/camera/space-camera-moves.md +46 -0
  355. package/lib/motion/shotcraft/upstream/references/shots/camera/steep-tilt-glide.md +52 -0
  356. package/lib/motion/shotcraft/upstream/references/shots/camera/tension-camera-moves.md +43 -0
  357. package/lib/motion/shotcraft/upstream/references/shots/camera/terminal-3d.md +42 -0
  358. package/lib/motion/shotcraft/upstream/references/shots/data/before-after-slider-scrub.md +48 -0
  359. package/lib/motion/shotcraft/upstream/references/shots/data/chart-live-moves.md +52 -0
  360. package/lib/motion/shotcraft/upstream/references/shots/data/gauge-readout-moves.md +45 -0
  361. package/lib/motion/shotcraft/upstream/references/shots/data/scroll-brake-moves.md +46 -0
  362. package/lib/motion/shotcraft/upstream/references/shots/data/timeline-travel.md +44 -0
  363. package/lib/motion/shotcraft/upstream/references/shots/effects/assemble-then-type-flyin.md +63 -0
  364. package/lib/motion/shotcraft/upstream/references/shots/effects/aurora-bloom-bg-flip.md +54 -0
  365. package/lib/motion/shotcraft/upstream/references/shots/effects/brand-frame-snap.md +58 -0
  366. package/lib/motion/shotcraft/upstream/references/shots/effects/fui-hud-moves.md +35 -0
  367. package/lib/motion/shotcraft/upstream/references/shots/effects/glow-flyline-moves.md +53 -0
  368. package/lib/motion/shotcraft/upstream/references/shots/effects/icon-performance-moves.md +42 -0
  369. package/lib/motion/shotcraft/upstream/references/shots/effects/impact-feedback.md +50 -0
  370. package/lib/motion/shotcraft/upstream/references/shots/effects/light-play-moves.md +46 -0
  371. package/lib/motion/shotcraft/upstream/references/shots/effects/radial-ripple-phone-chips.md +56 -0
  372. package/lib/motion/shotcraft/upstream/references/shots/effects/riso-print-hits.md +49 -0
  373. package/lib/motion/shotcraft/upstream/references/shots/effects/scan-bracket-sweep.md +50 -0
  374. package/lib/motion/shotcraft/upstream/references/shots/effects/scanline-annotate-focus.md +53 -0
  375. package/lib/motion/shotcraft/upstream/references/shots/effects/scanline-assemble-flyin.md +53 -0
  376. package/lib/motion/shotcraft/upstream/references/shots/effects/slam-entrance-moves.md +55 -0
  377. package/lib/motion/shotcraft/upstream/references/shots/effects/spotlight-sweep-moves.md +52 -0
  378. package/lib/motion/shotcraft/upstream/references/shots/interaction/autolayout-gap-dial.md +60 -0
  379. package/lib/motion/shotcraft/upstream/references/shots/interaction/canvas-materialize-moves.md +57 -0
  380. package/lib/motion/shotcraft/upstream/references/shots/interaction/chip-grid-single-select-blackout.md +51 -0
  381. package/lib/motion/shotcraft/upstream/references/shots/interaction/collab-cursor-moves.md +41 -0
  382. package/lib/motion/shotcraft/upstream/references/shots/interaction/glass-pill-dictation-typing.md +53 -0
  383. package/lib/motion/shotcraft/upstream/references/shots/interaction/hashtag-to-pill-materialize.md +60 -0
  384. package/lib/motion/shotcraft/upstream/references/shots/interaction/picker-carousel-feature-cycle.md +55 -0
  385. package/lib/motion/shotcraft/upstream/references/shots/interaction/segmented-thumb-hero.md +57 -0
  386. package/lib/motion/shotcraft/upstream/references/shots/interaction/theme-switch-moves.md +47 -0
  387. package/lib/motion/shotcraft/upstream/references/shots/interaction/type-and-filter.md +37 -0
  388. package/lib/motion/shotcraft/upstream/references/shots/interaction/voice-waveform-live.md +54 -0
  389. package/lib/motion/shotcraft/upstream/references/shots/opening/brand-ink-open.md +36 -0
  390. package/lib/motion/shotcraft/upstream/references/shots/opening/crane-rise-reveal.md +56 -0
  391. package/lib/motion/shotcraft/upstream/references/shots/opening/dataviz-landscape-open.md +56 -0
  392. package/lib/motion/shotcraft/upstream/references/shots/opening/fracture.md +40 -0
  393. package/lib/motion/shotcraft/upstream/references/shots/opening/icon-field-colorize.md +60 -0
  394. package/lib/motion/shotcraft/upstream/references/shots/opening/letterspace-materialize.md +57 -0
  395. package/lib/motion/shotcraft/upstream/references/shots/opening/magician-card-flourish.md +73 -0
  396. package/lib/motion/shotcraft/upstream/references/shots/opening/orbit-ring-title-open.md +87 -0
  397. package/lib/motion/shotcraft/upstream/references/shots/opening/spotlight-hero-card.md +55 -0
  398. package/lib/motion/shotcraft/upstream/references/shots/opening/stroke-segment-build.md +50 -0
  399. package/lib/motion/shotcraft/upstream/references/shots/opening/text-as-mask.md +59 -0
  400. package/lib/motion/shotcraft/upstream/references/shots/outro/grain-dissolve.md +38 -0
  401. package/lib/motion/shotcraft/upstream/references/shots/outro/logo-shrink-wordmark-lockup.md +38 -0
  402. package/lib/motion/shotcraft/upstream/references/shots/outro/neon-triple-marquee.md +59 -0
  403. package/lib/motion/shotcraft/upstream/references/shots/outro/outro-group-photo-launch.md +39 -0
  404. package/lib/motion/shotcraft/upstream/references/shots/outro/ui-strip-away-outro.md +61 -0
  405. package/lib/motion/shotcraft/upstream/references/shots/outro/ui-to-brand-morph.md +52 -0
  406. package/lib/motion/shotcraft/upstream/references/shots/rhythm/beat-cut-moves.md +50 -0
  407. package/lib/motion/shotcraft/upstream/references/shots/rhythm/beat-step-list-theme-cycle.md +66 -0
  408. package/lib/motion/shotcraft/upstream/references/shots/rhythm/panel-grid-moves.md +43 -0
  409. package/lib/motion/shotcraft/upstream/references/shots/rhythm/quad-split-parallel-scenes.md +38 -0
  410. package/lib/motion/shotcraft/upstream/references/shots/rhythm/rhythm-interrupt-moves.md +38 -0
  411. package/lib/motion/shotcraft/upstream/references/shots/rhythm/sakuga-timing-shift.md +56 -0
  412. package/lib/motion/shotcraft/upstream/references/shots/rhythm/speed-ramp-freeze.md +44 -0
  413. package/lib/motion/shotcraft/upstream/references/shots/rhythm/trailer-grammar-moves.md +38 -0
  414. package/lib/motion/shotcraft/upstream/references/shots/transition/bottom-push-stack-wipe.md +63 -0
  415. package/lib/motion/shotcraft/upstream/references/shots/transition/card-flip-reveal.md +57 -0
  416. package/lib/motion/shotcraft/upstream/references/shots/transition/card-flock-tumble.md +63 -0
  417. package/lib/motion/shotcraft/upstream/references/shots/transition/circle-match-iris.md +58 -0
  418. package/lib/motion/shotcraft/upstream/references/shots/transition/gradient-transition.md +45 -0
  419. package/lib/motion/shotcraft/upstream/references/shots/transition/line-carry-transition.md +55 -0
  420. package/lib/motion/shotcraft/upstream/references/shots/transition/mosaic-reframe.md +49 -0
  421. package/lib/motion/shotcraft/upstream/references/shots/transition/page-turn-transitions.md +42 -0
  422. package/lib/motion/shotcraft/upstream/references/shots/transition/print-texture-transitions.md +42 -0
  423. package/lib/motion/shotcraft/upstream/references/shots/transition/shot-transitions.md +45 -0
  424. package/lib/motion/shotcraft/upstream/references/shots/transition/tear-streak-transitions.md +48 -0
  425. package/lib/motion/shotcraft/upstream/references/shots/transition/transition-hidden-cut.md +55 -0
  426. package/lib/motion/shotcraft/upstream/references/shots/transition/transition-travel.md +43 -0
  427. package/lib/motion/shotcraft/upstream/references/shots/transition/white-flash-logo-simplify-cut.md +41 -0
  428. package/lib/motion/shotcraft/upstream/references/shots/transition/wipe-transitions.md +42 -0
  429. package/lib/motion/shotcraft/upstream/references/shots/typography/blur-slide.md +59 -0
  430. package/lib/motion/shotcraft/upstream/references/shots/typography/brace-expand.md +55 -0
  431. package/lib/motion/shotcraft/upstream/references/shots/typography/countdown-arc-scatter.md +65 -0
  432. package/lib/motion/shotcraft/upstream/references/shots/typography/document-typewriter-reveal.md +42 -0
  433. package/lib/motion/shotcraft/upstream/references/shots/typography/flying-words.md +64 -0
  434. package/lib/motion/shotcraft/upstream/references/shots/typography/glitch-cycle.md +64 -0
  435. package/lib/motion/shotcraft/upstream/references/shots/typography/gradient-word-sweep.md +54 -0
  436. package/lib/motion/shotcraft/upstream/references/shots/typography/lead-word-zoom-assemble.md +91 -0
  437. package/lib/motion/shotcraft/upstream/references/shots/typography/marker-underline-title.md +51 -0
  438. package/lib/motion/shotcraft/upstream/references/shots/typography/outline-word-fill.md +66 -0
  439. package/lib/motion/shotcraft/upstream/references/shots/typography/paper-title-card.md +38 -0
  440. package/lib/motion/shotcraft/upstream/references/shots/typography/pill-chip-slot-cycle-handled.md +66 -0
  441. package/lib/motion/shotcraft/upstream/references/shots/typography/pill-slot-cycle.md +58 -0
  442. package/lib/motion/shotcraft/upstream/references/shots/typography/text-column-converge.md +61 -0
  443. package/lib/motion/shotcraft/upstream/references/shots/typography/title-demote-to-label.md +64 -0
  444. package/lib/motion/shotcraft/upstream/references/shots/typography/type-assembly-moves.md +45 -0
  445. package/lib/motion/shotcraft/upstream/references/shots/typography/type-entrance-moves.md +41 -0
  446. package/lib/motion/shotcraft/upstream/references/shots/typography/type-rhythm-sync.md +51 -0
  447. package/lib/motion/shotcraft/upstream/references/shots/typography/typewriter-moves.md +42 -0
  448. package/lib/motion/shotcraft/upstream/references/shots/typography/vertical-word-roll-blur-cycle.md +63 -0
  449. package/lib/motion/shotcraft/upstream/references/shots/typography/word-relay-filmstrip.md +57 -0
  450. package/lib/motion/shotcraft/upstream/references/shots/typography/word-relay-geometry.md +75 -0
  451. package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/avatar-bracket-carousel.md +59 -0
  452. package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/bezier-source-converge-merge.md +67 -0
  453. package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/card-stack.md +60 -0
  454. package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/carousel-3d.md +66 -0
  455. package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/cloner-depth-echo.md +40 -0
  456. package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/deck-deal-flyin.md +45 -0
  457. package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/doc-park-left-pill-deal.md +62 -0
  458. package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/draw-svg-trace.md +55 -0
  459. package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/element-body-moves.md +37 -0
  460. package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/integration-hub-map.md +55 -0
  461. package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/list-reveal.md +50 -0
  462. package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/list-stack-press.md +43 -0
  463. package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/neon-frame-forerun.md +55 -0
  464. package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/neon-frame-orbit-drop.md +51 -0
  465. package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/page-waterfall-wall.md +51 -0
  466. package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/product-card-progressive-assemble.md +56 -0
  467. package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/radial-wave.md +49 -0
  468. package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/research-card-stack-scroll.md +57 -0
  469. package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/row-embed.md +36 -0
  470. package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/value-stagger-gradient.md +64 -0
  471. package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/wall-reveal-moves.md +47 -0
  472. package/lib/motion/shotcraft/upstream/references/sound-design.md +170 -0
  473. package/lib/motion/shotcraft/upstream/references/workbench.md +157 -0
  474. package/lib/motion/shotcraft/upstream/template/TEMPLATE.md +103 -0
  475. package/lib/motion/shotcraft/upstream/template/THEMES.md +44 -0
  476. package/lib/motion/shotcraft/upstream/template/package.json +20 -0
  477. package/lib/motion/shotcraft/upstream/template/remotion.config.ts +6 -0
  478. package/lib/motion/shotcraft/upstream/template/src/Root.tsx +17 -0
  479. package/lib/motion/shotcraft/upstream/template/src/aifl/Caption.tsx +65 -0
  480. package/lib/motion/shotcraft/upstream/template/src/aifl/DigitRoll.tsx +48 -0
  481. package/lib/motion/shotcraft/upstream/template/src/aifl/FlashCut.tsx +24 -0
  482. package/lib/motion/shotcraft/upstream/template/src/aifl/Main.tsx +192 -0
  483. package/lib/motion/shotcraft/upstream/template/src/aifl/PaperTitleCard.tsx +111 -0
  484. package/lib/motion/shotcraft/upstream/template/src/aifl/live/PageCam.tsx +150 -0
  485. package/lib/motion/shotcraft/upstream/template/src/aifl/live/SceneDetail.tsx +158 -0
  486. package/lib/motion/shotcraft/upstream/template/src/aifl/live/SceneFlyIn.tsx +468 -0
  487. package/lib/motion/shotcraft/upstream/template/src/aifl/live/SceneOpen.tsx +552 -0
  488. package/lib/motion/shotcraft/upstream/template/src/aifl/live/SceneOutroLive.tsx +411 -0
  489. package/lib/motion/shotcraft/upstream/template/src/aifl/live/ScenePapers.tsx +200 -0
  490. package/lib/motion/shotcraft/upstream/template/src/aifl/live/SceneWbr.tsx +324 -0
  491. package/lib/motion/shotcraft/upstream/template/src/aifl/live-layout.json +389 -0
  492. package/lib/motion/shotcraft/upstream/template/src/index.ts +4 -0
  493. package/lib/motion/shotcraft/upstream/template/src/themes/ThemedFilm.tsx +7 -0
  494. package/lib/motion/shotcraft/upstream/template/src/themes/manifest.tsx +68 -0
  495. package/lib/motion/shotcraft/upstream/template/src/themes/palette-assets.json +1 -0
  496. package/lib/motion/shotcraft/upstream/template/src/themes/palette-assets.ts +24 -0
  497. package/lib/motion/shotcraft/upstream/template/src/themes/palettes.json +74 -0
  498. package/lib/motion/shotcraft/upstream/template/src/themes/visual-theme.tsx +91 -0
  499. package/lib/motion/shotcraft/upstream/template/src/workbench.ts +213 -0
  500. package/lib/motion/shotcraft/upstream/template/tsconfig.json +15 -0
  501. package/lib/motion/spec.js +113 -0
  502. package/lib/motion/style-engine.js +153 -0
  503. package/lib/motion/style-frames.js +268 -0
  504. package/lib/motion/sync.js +214 -0
  505. package/lib/motion/theme.js +121 -0
  506. package/lib/motion/voice.js +417 -0
  507. package/lib/motion-agent-files.js +82 -0
  508. package/lib/motion-agent-protocol.js +66 -0
  509. package/lib/motion-agent-tools.js +196 -0
  510. package/lib/motion-agent.js +171 -0
  511. package/lib/motion-capture.js +92 -0
  512. package/lib/motion-core.js +238 -0
  513. package/lib/motion-film-review.js +71 -0
  514. package/lib/motion-library.js +210 -0
  515. package/lib/motion-planner.js +254 -0
  516. package/lib/motion-project.js +80 -0
  517. package/lib/motion-render-worker.js +145 -0
  518. package/lib/motion-session.js +32 -0
  519. package/lib/motion-source.js +49 -0
  520. package/lib/motion-tasks.js +452 -0
  521. package/lib/motion-vision.js +43 -0
  522. package/lib/mxfile.js +27 -7
  523. package/lib/routing/node-runtime.js +14 -0
  524. package/lib/routing/router.js +211 -0
  525. package/lib/routing/vendor/README.md +96 -0
  526. package/lib/routing/vendor/libavoid-routing.js +753 -0
  527. package/lib/routing/vendor/libavoid.min.js +59 -0
  528. package/lib/shotcard-core.js +39 -0
  529. package/lib/shotcard-reference.js +56 -0
  530. package/lib/style-kernel.js +37 -3
  531. package/lib/task-patches.js +26 -2
  532. package/lib/video-export.js +17 -2
  533. package/package.json +29 -4
@@ -0,0 +1,395 @@
1
+ // 工程模板:把"一条视频"落成磁盘上的小文件工程。
2
+ //
3
+ // 目录约定(作用域 = 画布里一个视频节点):
4
+ // timeline.json 总谱:尺寸、帧率、时长、每段的起止帧与文件
5
+ // scene-<n>.tsx 一场景一文件,default export React 组件,≤120 行
6
+ // components/ 共享原语,单文件同样 ≤120 行
7
+ // assets/ 旁白、配乐、截图(渲染时作为 public 目录)
8
+ // BRIEF.md 写给模型的一次性规格摘要
9
+ //
10
+ // 这里不启动任何 LLM:模板只是文件,写代码的是主对话 agent。
11
+
12
+ import { existsSync, mkdirSync, readFileSync, writeFileSync, readdirSync } from 'node:fs'
13
+ import { join, dirname } from 'node:path'
14
+ import { prepareMotionProject } from '../motion-project.js'
15
+ import { DEFAULT_SPEC, readSpec, validateSpec } from './spec.js'
16
+ import { timelineFromCards } from './cards.js'
17
+ import { describeTrack, readTrack } from './audio.js'
18
+ import { resolveTheme, writeTheme } from './theme.js'
19
+ import { resolveSync } from './sync.js'
20
+ import { ENGINE_GUIDANCE, ENGINE_LABEL } from './style-engine.js'
21
+ import { writeSceneKit } from './scene-kit.js'
22
+ import { writeDelivery } from './delivery.js'
23
+ import { writeBuiltinAssets } from './builtin-assets.js'
24
+ import { writeBundledFonts, hasBundledFonts, availableBundledFontFaces } from './fonts.js'
25
+ import { parseProjectJson } from './json.js'
26
+
27
+ const TIMELINE = 'timeline.json'
28
+
29
+ function sceneFile(index) {
30
+ return 'scene-' + index + '.tsx'
31
+ }
32
+
33
+ function sceneStub(shot, spec, theme) {
34
+ const lines = [
35
+ "import React from 'react'",
36
+ "import { AbsoluteFill, interpolate, useCurrentFrame, useVideoConfig } from 'remotion'",
37
+ ...(theme ? ["import { PAPER, INK, SERIF } from './theme'"] : []),
38
+ '',
39
+ '// ' + shot.id + ': ' + shot.startFrame + '–' + (shot.startFrame + shot.durationFrames - 1) + ' 帧',
40
+ '// 占位:换成这一镜真正的版面。颜色/字体从 theme.ts 取,不要手写十六进制。',
41
+ '// 时长一律用 useVideoConfig():旁白重排或改时间轴之后,收尾动作会自动跟着挪;',
42
+ '// 写死一个 DUR 常量的话,镜头一变长,最后那段就是静止的(旁白接上就会踩到)。',
43
+ '// anchors.<动作名> 是音乐绑定后的本镜局部帧,用作动效关键帧。',
44
+ 'export default function Scene({ anchors = {} }) {',
45
+ ' const frame = useCurrentFrame()',
46
+ ' const { durationInFrames } = useVideoConfig()',
47
+ ' const opacity = interpolate(frame, [0, 12], [0, 1], { extrapolateRight: \'clamp\' })',
48
+ ' const settle = interpolate(frame, [durationInFrames - 10, durationInFrames], [1, 0.97], { extrapolateLeft: \'clamp\' })',
49
+ ' return (',
50
+ ' <AbsoluteFill style={{ background: ' + (theme ? 'PAPER' : "'#111'") + ', opacity: opacity * settle }}>',
51
+ ' <AbsoluteFill style={{ alignItems: \'center\', justifyContent: \'center\' }}>',
52
+ ' <div style={{ color: ' + (theme ? 'INK' : "'#eee'") + ', fontSize: ' + (theme ? 40 : 64) + ', fontFamily: ' + (theme ? 'SERIF' : "'sans-serif'") + ' }}>' + shot.id + '</div>',
53
+ ' </AbsoluteFill>',
54
+ ' </AbsoluteFill>',
55
+ ' )',
56
+ '}',
57
+ '',
58
+ ]
59
+ return lines.join('\n')
60
+ }
61
+
62
+ export function readTimeline(dir) {
63
+ const file = join(dir, TIMELINE)
64
+ if (!existsSync(file)) throw new Error('工程缺少 timeline.json,请先运行 motion_project create')
65
+ const raw = parseProjectJson(readFileSync(file, 'utf8'))
66
+ if (!Array.isArray(raw.shots) || !raw.shots.length) throw new Error('timeline.json 缺少 shots')
67
+ raw.audio = readTrack(raw)
68
+ return resolveSync(raw)
69
+ }
70
+
71
+ export function writeTimeline(dir, timeline) {
72
+ const resolved = resolveSync(timeline)
73
+ writeFileSync(join(dir, TIMELINE), JSON.stringify(resolved, null, 2) + '\n', 'utf8')
74
+ return resolved
75
+ }
76
+
77
+ // 风格只把"片子需要记住的那点"写进时间轴:slug/名/版本 + 色板/字体/节奏/判据。
78
+ // brief 全文进 STYLE.md,不进 timeline.json —— 时间轴是给程序读的,不是给人读的。
79
+ function withStyle(timeline, style) {
80
+ if (!style) return timeline
81
+ return { ...timeline, style: { slug: style.slug, name: style.name, commit: style.commit,
82
+ palette: style.palette, fonts: style.fonts, rhythm: style.rhythm, signature: style.signature,
83
+ engine: style.engine || null, engines: style.engines || [], engineNote: style.engineNote || '', engineFiles: style.engineFiles || [],
84
+ motion: style.motion || null } }
85
+ }
86
+
87
+ /** 效果配方:brief 只写「是什么」,这里写「怎么动」。每一项都要求对着参考帧做,不许用「差不多」糊过去。 */
88
+ function motionMarkdown(style) {
89
+ const motion = style.motion
90
+ if (!motion) return []
91
+ const rows = []
92
+ rows.push('| 项 | 上游怎么做 | 这里必须做到 |')
93
+ rows.push('| --- | --- | --- |')
94
+ rows.push('| 转场 | ' + (motion.transitions === 'wipe' ? '色块 field wipe(按解析软边擦入/擦出,不是硬切)' : '硬切,切点落在 cue 上')
95
+ + ' | ' + (motion.transitions === 'wipe' ? '至少一次带软边的擦除转场;没有 wipe 的段落不许用淡入淡出冒充' : '切点跟拍点对齐;不许用滑动/缩放转场代替') + ' |')
96
+ rows.push('| 冲击 | ' + (motion.impact ? '接触瞬间 impact:形变挤压 + 地面环/波纹 + 机位抖' : '没有独立 impact 函数')
97
+ + ' | ' + (motion.impact ? '每一次落地/接触都要有:挤压、环、抖动三件里至少两件' : '接触帧仍要有明显 scale 挤压') + ' |')
98
+ rows.push('| 相机 | ' + (motion.camera ? 'world drift / hero push / whip / 冲击 shake,机位一直在动' : '机位基本固定')
99
+ + ' | ' + (motion.camera ? '整片至少三处镜头运动(漂移/推近/甩/抖),不能全片静止机位' : '不要用大幅推拉冒充动效') + ' |')
100
+ rows.push('| 运动模糊 | ' + (motion.motionBlur ? `motionBlur samples ${motion.motionBlur.samples} / shutter ${motion.motionBlur.shutter}` : '未开 motion blur')
101
+ + ' | ' + (motion.motionBlur ? '快速位移的帧要有拖影(MotionBlurTrail / shutter 采样),不能是干净单帧' : '快动作靠形变本身,不加拖影') + ' |')
102
+ rows.push('| 颗粒/纹理 | ' + (motion.grain ? `逐像素颗粒 ${motion.grain.size ? motion.grain.size + '²' : ''}(随帧位移 + 柔化),不是几百个点` : '没有颗粒层')
103
+ + ' | ' + (motion.grain ? '颗粒要"看得见但不起脏":逐像素生成、每帧换位置;几百个 1px 点不算' : '不要加通用噪点') + ' |')
104
+ rows.push('| 二次运动 | ' + (motion.secondary?.length ? '上游还有:' + motion.secondary.join(' / ') : '未检测到二级动作')
105
+ + ' | ' + (motion.secondary?.length ? '这些"让画面活着"的小动作至少保留两样,别只留主形变' : '画面靠主形变推进') + ' |')
106
+ if (motion.feather) rows.push('| 软边 | 色块边缘有 FEATHER 解析软边 | 边缘不许是硬 polygon;按距离场/遮罩做柔边 |')
107
+ return [
108
+ '## 效果配方(必做,逐项对照参考帧)',
109
+ '',
110
+ ...rows,
111
+ '',
112
+ '取得参考帧:`mg_style {action:"frames", slug:"' + style.slug + '"}` → 返回 8 张 PNG,用 `read_image` 逐张看。',
113
+ '**上游未检测到 ≠ 可省**:配方是下限,不是上限;判据(signature)与参考帧才是验收标准。',
114
+ '做完每个镜头,把参考帧和 `motion_preview` 的成片帧并排放一次,逐行对上面的表——对不上的项要么改,要么在下面写一行「偏离:X 改为 Y,因为 Z」。',
115
+ '',
116
+ ]
117
+ }
118
+
119
+ function styleMarkdown(style) {
120
+ const palette = Object.entries(style.palette || {}).map(([role, hex]) => '| ' + role + ' | `' + hex + '` |')
121
+ return [
122
+ '# 整片风格:' + style.name + '(' + style.slug + ')',
123
+ '',
124
+ style.oneLiner || '',
125
+ '',
126
+ '来源:mg-styles-15(MIT,commit ' + String(style.commit || '').slice(0, 8) + ')。上游是「HTML 页 + renderAt(t) + 截帧」,',
127
+ '这里不是逐行搬运(整份 HTML 搬进场景会跟 Remotion 的帧模型打架),但动效、转场、冲击、',
128
+ '相机与质感必须按下面的「效果配方」对齐——对不上就写偏离行,别静默省掉。',
129
+ '',
130
+ '## 判据(做不出这些就不算这个风格)',
131
+ '',
132
+ ...(style.signature || []).map((line) => '- ' + line),
133
+ '',
134
+ ...(style.engines?.length ? [
135
+ '## 引擎契约(硬规定)',
136
+ '',
137
+ '- 上游引擎:' + style.engines.map((engine) => '`' + (ENGINE_LABEL[engine] || engine) + '`').join(' + ') + (style.engines.length > 1 ? '(都要在,缺一个就不像)' : ''),
138
+ style.engineNote ? '- ' + style.engineNote : '',
139
+ '',
140
+ ...(style.engineFiles?.length ? ['上游证据:', ...style.engineFiles.slice(0, 6).map((path) => ' - `' + path + '`'), ''] : []),
141
+ ...style.engines.map((engine) => '- ' + (ENGINE_LABEL[engine] || engine) + ':' + (ENGINE_GUIDANCE[engine] || '')),
142
+ '',
143
+ '**不要用更省事的方式替代**(CSS 3D、div 层叠、纯 Canvas2D 渐变、静态图位移都不算)。`motion_render start` 会扫工程源码:重引擎(three / webgl2 / webgl)缺了直接拒绝渲染,不会静默降级。确实要换实现,先在这里写一行「偏离:引擎 ' + style.engines[0] + ' 改为 …,因为 …」,渲染会带 warning 通过。',
144
+ '',
145
+ ] : []),
146
+ ...motionMarkdown(style),
147
+ '## 色板',
148
+ '',
149
+ '| 角色 | 值 |',
150
+ '| --- | --- |',
151
+ ...palette,
152
+ '',
153
+ style.colors?.length ? '片子里还会用到:' + style.colors.map((hex) => '`' + hex + '`').join(' / ') + '(这些不是 theme 常量,场景里直接写)。' : '',
154
+ '',
155
+ '## 字体',
156
+ '',
157
+ style.fonts ? '- display:`' + style.fonts.display + '`\n- text:`' + style.fonts.text + '`\n- mono:`' + style.fonts.mono + '`' : '-(这个风格没记字体栈,用 theme.ts 的默认值)',
158
+ '',
159
+ style.rhythm ? '## 节奏\n\n' + Object.entries(style.rhythm).map(([key, value]) => '- ' + key + ':' + value).join('\n') + '\n' : '',
160
+ '## 移植说明',
161
+ '',
162
+ style.brief || '(这个风格还没有移植 brief)',
163
+ '',
164
+ '## 上游源码',
165
+ '',
166
+ ...(style.demos || []).map((path) => '- `' + path + '`'),
167
+ '',
168
+ '## 版权',
169
+ '',
170
+ '上游 MIT。品牌名必须虚构;通用几何与三原色可自由使用。',
171
+ '',
172
+ ].filter((line, index, all) => !(line === '' && all[index - 1] === '')).join('\n')
173
+ }
174
+
175
+ export function defaultTimeline(spec, segmentCount = 4) {
176
+ const frames = spec.totalFrames
177
+ const per = Math.round(frames / segmentCount)
178
+ let cursor = 0
179
+ const shots = []
180
+ for (let index = 0; index < segmentCount; index += 1) {
181
+ const durationFrames = index === segmentCount - 1 ? frames - cursor : per
182
+ shots.push({ id: 'shot-' + (index + 1), file: sceneFile(index), startFrame: cursor, durationFrames })
183
+ cursor += durationFrames
184
+ }
185
+ return { version: 1, width: spec.width, height: spec.height, fps: spec.fps, durationInFrames: frames, shots }
186
+ }
187
+
188
+ /**
189
+ * 按分镜表开段:表里每行都给了有效时长且总和对得上总帧数,就照表的来;
190
+ * 否则按行数均分。分镜表是"每一镜要干什么"的真相源,段数不该由卡片或默认值偷偷决定。
191
+ */
192
+ export function timelineFromStoryboard(spec, rows) {
193
+ const durations = rows.map((row) => Math.max(0, Math.round(Number(row.durationFrames) || 0)))
194
+ const specified = durations.every((value) => value > 0)
195
+ const total = durations.reduce((acc, value) => acc + value, 0)
196
+ const count = Math.max(1, rows.length)
197
+ // 表里每行都写了时长就照表走(表是真相源),没写才退回节点时长按行数均分。
198
+ const frames = specified ? total : (Number(spec.totalFrames) || 0)
199
+ const per = Math.round(frames / count)
200
+ let cursor = 0
201
+ const shots = []
202
+ for (let index = 0; index < count; index += 1) {
203
+ const durationFrames = specified ? durations[index] : (index === count - 1 ? frames - cursor : per)
204
+ shots.push({ id: 'shot-' + (index + 1), file: sceneFile(index), startFrame: cursor, durationFrames })
205
+ cursor += durationFrames
206
+ }
207
+ return { version: 1, width: spec.width, height: spec.height, fps: spec.fps, durationInFrames: frames, shots }
208
+ }
209
+
210
+ export function createProject(dir, options = {}) {
211
+ const spec = readSpec({ ...DEFAULT_SPEC, ...options.spec })
212
+ const errors = validateSpec(spec)
213
+ if (errors.length) throw new Error('视频规格不合法:' + errors.join(';'))
214
+ mkdirSync(dir, { recursive: true })
215
+ mkdirSync(join(dir, 'assets'), { recursive: true })
216
+ mkdirSync(join(dir, 'components'), { recursive: true })
217
+ writeBuiltinAssets(dir)
218
+ writeBundledFonts(dir)
219
+ // 场景层脚手架:确定性随机 / 生长曲线 / 画面质感。拷进工程而不是 import 插件包,
220
+ // 因为 Remotion 的 bundle 只解析工程目录里的相对路径。只在文件缺失时写。
221
+ writeSceneKit(dir)
222
+ // 交付级派生脚本(dist/ 下的母版与平台版):平台规则会变,所以放在工程里。
223
+ writeDelivery(dir)
224
+ // 整片风格(mg-styles):一是带上它的色板/字体当主题,二是把施工说明书落成 STYLE.md。
225
+ // 显式给的主题优先于风格自带色板 —— 用户说"就要这个色"时不该被风格覆盖。
226
+ const style = options.style && typeof options.style === 'object' ? options.style : null
227
+ const theme = options.theme ? resolveTheme(options.theme) : style?.palette ? resolveTheme({ ...style.palette, name: style.name }) : null
228
+ const fonts = { ...(style?.fonts ? { serif: style.fonts.display || style.fonts.text, sans: style.fonts.text || style.fonts.display, mono: style.fonts.mono } : {}), ...(options.fonts || {}) }
229
+ if (theme) {
230
+ writeTheme(dir, theme, fonts)
231
+ options.themeName = theme.name
232
+ }
233
+ if (style) writeFileSync(join(dir, 'STYLE.md'), styleMarkdown(style), 'utf8')
234
+ const cards = Array.isArray(options.cards) ? options.cards : []
235
+ const storyRows = Array.isArray(options.storyboard) ? options.storyboard : []
236
+ const warnings = []
237
+ // 段数由谁决定,这里必须排个先后:给了分镜表就按表开段(这是"每一镜要干什么"的真相源),
238
+ // 没给表才看卡片,都没有才用默认均分。旧版不看表,6 行分镜照样按 3 张卡开 4 段且不报错。
239
+ const planned = cards.length
240
+ ? timelineFromCards(spec, cards, { fitFrames: Number(options.fitFrames) || 0 })
241
+ : storyRows.length >= 2
242
+ ? timelineFromStoryboard(spec, storyRows)
243
+ : defaultTimeline(spec, Number(options.segments) || 4)
244
+ let timeline = existsSync(join(dir, TIMELINE))
245
+ ? readTimeline(dir)
246
+ : writeTimeline(dir, withStyle(planned, style))
247
+ if (storyRows.length > 0 && timeline.shots.length !== storyRows.length) { warnings.push('分镜表 ' + storyRows.length + ' 行,时间轴是 ' + timeline.shots.length + ' 段'
248
+ + (cards.length ? '(按 ' + cards.length + ' 张镜头卡排布)' : '')
249
+ + ':多出的分镜行不会自动开段。要么把表收敛到 ' + timeline.shots.length + ' 行,'
250
+ + '要么把段数改到一致(加镜头卡 / 传 segments / 删掉已有 timeline.json 重建)')
251
+ }
252
+ if (storyRows.length >= 2 && !cards.length && timeline.durationInFrames !== spec.totalFrames) {
253
+ warnings.push('分镜表共 ' + timeline.durationInFrames + ' 帧,视频节点是 ' + spec.totalFrames + ' 帧:时间轴按表走('
254
+ + (timeline.durationInFrames / spec.fps).toFixed(2) + ' 秒)。要按节点时长,就把表里的帧区间改到 ' + spec.totalFrames + ' 帧')
255
+ }
256
+ // 老工程后来才挂上风格节点:把风格补进时间轴,不改已排好的分镜。
257
+ if (style && !timeline.style?.slug) timeline = writeTimeline(dir, withStyle(timeline, style))
258
+ for (const shot of timeline.shots) {
259
+ const file = join(dir, shot.file)
260
+ if (!existsSync(file)) writeFileSync(file, sceneStub(shot, spec, theme), 'utf8')
261
+ }
262
+ // 分镜表:先把"每一镜要干什么"写成表,再动笔。表在工程里,不在对话里。
263
+ const storyboard = normalizeStoryboard(options.storyboard, timeline)
264
+ if (storyboard.length) writeFileSync(join(dir, 'storyboard.md'), storyboardMarkdown(timeline, storyboard), 'utf8')
265
+ writeFileSync(join(dir, 'BRIEF.md'), brief(timeline, options, storyboard), 'utf8')
266
+ // 主题与场景已经写出后,再按其中实际引用的字体补齐项目资源。
267
+ writeBundledFonts(dir)
268
+ return { dir, timeline, storyboard, theme: theme ? theme.name : null, files: listFiles(dir), warnings }
269
+ }
270
+
271
+ // 接受 [{card,intent,onScreen,copy}],也接受 ["一句话"] 这种简写。
272
+ export function normalizeStoryboard(input, timeline) { if (!Array.isArray(input) || !input.length) return []
273
+ return input.slice(0, timeline.shots.length).map((item, index) => {
274
+ if (typeof item === 'string') return { shot: timeline.shots[index].id, intent: item.trim() }
275
+ const pick = (key) => (item && typeof item[key] === 'string' ? item[key].trim() : '')
276
+ return {
277
+ shot: timeline.shots[index].id,
278
+ card: pick('card') || timeline.shots[index].card || '',
279
+ intent: pick('intent') || pick('beats') || pick('what'),
280
+ onScreen: pick('onScreen') || pick('screen'),
281
+ copy: pick('copy'),
282
+ }
283
+ }).filter((row) => row.intent || row.onScreen || row.copy)
284
+ }
285
+
286
+ // 分镜表只在提供实际分镜内容时保存。
287
+ function storyboardMarkdown(timeline, storyboard) {
288
+ const lines = [
289
+ '# 分镜表',
290
+ '',
291
+ '每条视频先在表里写清"这一镜讲什么、屏幕上出现什么、配什么字",再写场景代码。',
292
+ '',
293
+ '| 镜头 | 帧区间 | 镜头卡 | 这一镜要做什么 | 屏幕上出现 | 文案 |',
294
+ '| --- | --- | --- | --- | --- | --- |',
295
+ ]
296
+ for (const [index, shot] of timeline.shots.entries()) {
297
+ const row = storyboard.find((item) => item.shot === shot.id) || {}
298
+ lines.push('| ' + shot.id + ' | ' + shot.startFrame + '–' + (shot.startFrame + shot.durationFrames - 1) + ' | '
299
+ + (row.card || shot.card || '—') + ' | ' + (row.intent || '—') + ' | ' + (row.onScreen || '—') + ' | ' + (row.copy || '—') + ' |')
300
+ }
301
+ return lines.join('\n') + '\n'
302
+ }
303
+
304
+ function brief(timeline, options, storyboard = []) {
305
+ const lines = [
306
+ '# 视频工程',
307
+ '',
308
+ '规格:' + timeline.width + '×' + timeline.height + ' / ' + timeline.fps + 'fps / ' + timeline.durationInFrames + ' 帧(' + (timeline.durationInFrames / timeline.fps).toFixed(2) + ' 秒)',
309
+ '',
310
+ '## 分镜',
311
+ '',
312
+ ...timeline.shots.map((shot) => '- ' + shot.id + ':第 ' + shot.startFrame + '–' + (shot.startFrame + shot.durationFrames - 1) + ' 帧,文件 ' + shot.file
313
+ + (shot.card ? '(镜头卡 ' + shot.card + (shot.style && shot.style !== shot.card ? ' · ' + shot.style : '') + ')' : '')),
314
+ '',
315
+ ...(storyboard.length ? ['## 分镜表', '', ...storyboard.map((row) => '- ' + row.shot + ':' + [row.intent, row.onScreen && '画面 ' + row.onScreen, row.copy && '文案 ' + row.copy].filter(Boolean).join(';')), ''] : []),
316
+ '## 音频',
317
+ '',
318
+ describeTrack(readTrack(timeline), timeline.fps),
319
+ '',
320
+ '## 约定',
321
+ '',
322
+ '- 内置素材可用 motion_assets list 查看:builtin/paper.svg、builtin/grain.svg、builtin/grid.svg 可用 staticFile 引用;builtin/whoosh.wav、builtin/impact.wav 可通过 motion_audio add 加入时间轴。素材是 DrawAI 程序生成的通用素材,不是上游原片素材。',
323
+ '- 工程内置 Noto Sans SC、Noto Serif SC 及常用上游字体,场景可按字体名使用;个别字体与上游特定字重可能仍需补充。',
324
+ '- 需要纹理或乐器单音时,先看用户素材和 motion_assets {action:"list",nodeId},再用 {action:"library",nodeId,query:"纸张"} 或 query:"钢琴" 搜索插件库;{action:"use",nodeId,assetId:id} 导入所选条目。图片用返回的 file 调 staticFile,声音须另用 motion_audio {action:"add",nodeId,file,role:"sfx",at:秒} 放入时间轴;先查看来源和许可,试听确认电平。单音不是完整配乐。',
325
+ '- 插件素材随安装包提供,素材 ID 不是工作区路径。不要猜路径、从其他工程拷贝素材或手写 manifest.json;使用 library 返回的 ID 调 use,失败时报告具体错误。',
326
+ '- 一场景一文件,单文件不超过 120 行;共享元素放 components/。',
327
+ '- 场景组件 default export,签名 ({ shot, anchors, assets, render }) => ReactNode;时间用 useCurrentFrame(),相对本段起点。',
328
+ '- scene-kit/ 是场景层脚手架:det.ts(确定性随机 + Halton 抖动,禁 Math.random)、grow.ts(弹簧/落体/生长曲线闭式解)、look.tsx(SSAA/软阴影/色调映射/颗粒/暗角)。要画质就先看这三件,别在场景里另写一套。',
329
+ '- 累积采样数与快门时长从 render.samples / render.shutter 读,不要写死数字。',
330
+ '- 改完先渲染 3 帧看图(motion_preview),确认后再跑全片(motion_render)。',
331
+ options.themeName ? '- 配色主题:' + options.themeName + '(颜色/字体从 theme.ts 取,别手写十六进制)。' : '',
332
+ timeline.style ? '- 整片风格:' + timeline.style.name + '(' + timeline.style.slug + ')—— 施工说明见 STYLE.md,写每一镜之前先读它。' : '',
333
+ '- 时间轴改动只改 timeline.json 的 startFrame / durationFrames,不要改场景文件里的绝对帧号。',
334
+ '',
335
+ options.prompt ? '## 描述\n\n' + String(options.prompt).slice(0, 4000) + '\n' : '',
336
+ options.refs?.length ? '## 参考\n\n' + options.refs.map((ref) => '- ' + ref.role + ':' + (ref.assetId || ref.cardId || ref.id)).join('\n') + '\n' : '',
337
+ ]
338
+ return lines.filter((line, index, all) => !(line === '' && all[index - 1] === '')).join('\n')
339
+ }
340
+
341
+ export function listFiles(dir) {
342
+ const out = []
343
+ const walk = (base, prefix) => {
344
+ for (const entry of readdirSync(base, { withFileTypes: true })) {
345
+ if (entry.name === '.out' || entry.name === 'node_modules') continue
346
+ const rel = prefix ? prefix + '/' + entry.name : entry.name
347
+ if (entry.isDirectory()) walk(join(base, entry.name), rel)
348
+ else out.push(rel)
349
+ }
350
+ }
351
+ walk(dir, '')
352
+ return out.sort()
353
+ }
354
+
355
+ // 把磁盘上的工程读成 Remotion 需要的 composition:
356
+ // sceneSource 现读现取,所以 agent 改完文件后不用重新登记。
357
+ export function buildComposition(dir) {
358
+ const timeline = readTimeline(dir)
359
+ const shots = timeline.shots.map((shot) => {
360
+ const file = join(dir, shot.file)
361
+ if (!existsSync(file)) throw new Error('缺少场景文件:' + shot.file)
362
+ return {
363
+ id: shot.id,
364
+ recipeId: 'scene',
365
+ startFrame: shot.startFrame,
366
+ durationFrames: shot.durationFrames,
367
+ referenceIds: Array.isArray(shot.referenceIds) ? shot.referenceIds : [],
368
+ anchors: shot.anchors || {},
369
+ sceneSource: readFileSync(file, 'utf8'),
370
+ }
371
+ })
372
+ return {
373
+ width: timeline.width,
374
+ height: timeline.height,
375
+ fps: timeline.fps,
376
+ bundledFonts: hasBundledFonts(dir),
377
+ fontFaces: availableBundledFontFaces(dir),
378
+ durationFrames: timeline.durationInFrames,
379
+ shots,
380
+ audio: readTrack(timeline),
381
+ sync: timeline.sync,
382
+ // 渲染规格随 composition 走:worker 拿它设编码参数,场景通过 props.render 拿采样数与快门。
383
+ // 这里只透传时间轴上的值,默认值与夹取由 render-settings.js 统一决定。
384
+ ...(timeline.render ? { render: timeline.render } : {}),
385
+ // 风格跟着工程走:design.json 里能查到这条片子按哪份配方做的、色板与节奏是什么。
386
+ ...(timeline.style ? { production: { mgStyle: timeline.style } } : {}),
387
+ }
388
+ }
389
+
390
+ // 让 Remotion 认这个工程:入口 index.jsx + shotcraft 别名。
391
+ export function registerProject(dir) {
392
+ writeBundledFonts(dir)
393
+ const composition = buildComposition(dir)
394
+ return prepareMotionProject(composition, dir, { preserveSources: true, refreshEntry: true })
395
+ }