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.
- package/LICENSE +4142 -0
- package/README.md +43 -10
- package/lib/audio-media.js +147 -0
- package/lib/audio-service.js +66 -0
- package/lib/canvas-format.js +134 -0
- package/lib/client.js +5283 -223
- package/lib/comfyui-default-workflow.mjs +1825 -0
- package/lib/comfyui-workflow.mjs +426 -0
- package/lib/document-commands.js +12 -0
- package/lib/document-core.js +29 -0
- package/lib/drawing-tasks.js +26 -0
- package/lib/imagegen.mjs +596 -0
- package/lib/index.js +1758 -129
- package/lib/media.js +26 -13
- package/lib/mgstyle-core.js +75 -0
- package/lib/motion/apply.js +180 -0
- package/lib/motion/asset-pack-lock.js +10 -0
- package/lib/motion/asset-pack.js +335 -0
- package/lib/motion/assets.js +290 -0
- package/lib/motion/audio.js +103 -0
- package/lib/motion/audiolevel.js +63 -0
- package/lib/motion/audiomix.js +144 -0
- package/lib/motion/beats.js +337 -0
- package/lib/motion/builtin-assets.js +62 -0
- package/lib/motion/canvas-spec.js +442 -0
- package/lib/motion/capture.js +95 -0
- package/lib/motion/cards.js +80 -0
- package/lib/motion/collect.js +447 -0
- package/lib/motion/delivery.js +112 -0
- package/lib/motion/edge-speech.py +90 -0
- package/lib/motion/entry.jsx +73 -0
- package/lib/motion/export.js +200 -0
- package/lib/motion/ffmpeg.js +42 -0
- package/lib/motion/fonts.js +71 -0
- package/lib/motion/jobs.js +113 -0
- package/lib/motion/json.js +4 -0
- package/lib/motion/media-catalog.js +59 -0
- package/lib/motion/mgstyles/BRIEF-TEMPLATE.md +63 -0
- package/lib/motion/mgstyles/briefs/01-flat-vector.md +104 -0
- package/lib/motion/mgstyles/briefs/02-line-art.md +97 -0
- package/lib/motion/mgstyles/briefs/03-isometric.md +108 -0
- package/lib/motion/mgstyles/briefs/05-cel-boil.md +145 -0
- package/lib/motion/mgstyles/briefs/06-collage.md +149 -0
- package/lib/motion/mgstyles/briefs/07-liquid.md +106 -0
- package/lib/motion/mgstyles/briefs/08-morph.md +111 -0
- package/lib/motion/mgstyles/briefs/09-bauhaus.md +150 -0
- package/lib/motion/mgstyles/briefs/10-synthwave.md +151 -0
- package/lib/motion/mgstyles/briefs/12-aurora-glass.md +147 -0
- package/lib/motion/mgstyles/briefs/18-hanazi.md +140 -0
- package/lib/motion/mgstyles/briefs/19-paperclip.md +156 -0
- package/lib/motion/mgstyles/briefs/20-pixel.md +118 -0
- package/lib/motion/mgstyles/briefs/22-hud.md +118 -0
- package/lib/motion/mgstyles/catalog.d/01-flat-vector.json +34 -0
- package/lib/motion/mgstyles/catalog.d/02-line-art.json +34 -0
- package/lib/motion/mgstyles/catalog.d/03-isometric.json +35 -0
- package/lib/motion/mgstyles/catalog.d/05-cel-boil.json +28 -0
- package/lib/motion/mgstyles/catalog.d/06-collage.json +28 -0
- package/lib/motion/mgstyles/catalog.d/07-liquid.json +28 -0
- package/lib/motion/mgstyles/catalog.d/08-morph.json +28 -0
- package/lib/motion/mgstyles/catalog.d/09-bauhaus.json +28 -0
- package/lib/motion/mgstyles/catalog.d/10-synthwave.json +28 -0
- package/lib/motion/mgstyles/catalog.d/12-aurora-glass.json +28 -0
- package/lib/motion/mgstyles/catalog.d/18-hanazi.json +28 -0
- package/lib/motion/mgstyles/catalog.d/19-paperclip.json +28 -0
- package/lib/motion/mgstyles/catalog.d/20-pixel.json +28 -0
- package/lib/motion/mgstyles/catalog.d/22-hud.json +28 -0
- package/lib/motion/mgstyles/catalog.json +1356 -0
- package/lib/motion/mgstyles/upstream/README.md +147 -0
- package/lib/motion/mgstyles/upstream/README.zh-CN.md +147 -0
- package/lib/motion/mgstyles/upstream/demos/01-flat-vector/cues.json +1 -0
- package/lib/motion/mgstyles/upstream/demos/01-flat-vector/index.html +712 -0
- package/lib/motion/mgstyles/upstream/demos/02-line-art/cues.json +331 -0
- package/lib/motion/mgstyles/upstream/demos/02-line-art/film.js +676 -0
- package/lib/motion/mgstyles/upstream/demos/02-line-art/index.html +18 -0
- package/lib/motion/mgstyles/upstream/demos/02-line-art/tools/dump_timing.mjs +26 -0
- package/lib/motion/mgstyles/upstream/demos/03-isometric/cues.json +109 -0
- package/lib/motion/mgstyles/upstream/demos/03-isometric/index.html +25 -0
- package/lib/motion/mgstyles/upstream/demos/03-isometric/js/anim.js +82 -0
- package/lib/motion/mgstyles/upstream/demos/03-isometric/js/main.js +219 -0
- package/lib/motion/mgstyles/upstream/demos/03-isometric/js/night5.js +180 -0
- package/lib/motion/mgstyles/upstream/demos/03-isometric/js/render.js +202 -0
- package/lib/motion/mgstyles/upstream/demos/03-isometric/js/title.js +167 -0
- package/lib/motion/mgstyles/upstream/demos/03-isometric/js/title5.js +294 -0
- package/lib/motion/mgstyles/upstream/demos/03-isometric/js/ui.js +141 -0
- package/lib/motion/mgstyles/upstream/demos/03-isometric/js/world.js +1399 -0
- package/lib/motion/mgstyles/upstream/demos/05-cel-boil/cues.json +157 -0
- package/lib/motion/mgstyles/upstream/demos/05-cel-boil/index.html +34 -0
- package/lib/motion/mgstyles/upstream/demos/05-cel-boil/js/engine.js +326 -0
- package/lib/motion/mgstyles/upstream/demos/05-cel-boil/js/scene.js +2036 -0
- package/lib/motion/mgstyles/upstream/demos/06-collage/assets/gen/layout.json +157 -0
- package/lib/motion/mgstyles/upstream/demos/06-collage/cues.json +80 -0
- package/lib/motion/mgstyles/upstream/demos/06-collage/index.html +889 -0
- package/lib/motion/mgstyles/upstream/demos/07-liquid/cues.json +100 -0
- package/lib/motion/mgstyles/upstream/demos/07-liquid/index.html +108 -0
- package/lib/motion/mgstyles/upstream/demos/07-liquid/js/engine.js +153 -0
- package/lib/motion/mgstyles/upstream/demos/07-liquid/js/links.js +64 -0
- package/lib/motion/mgstyles/upstream/demos/07-liquid/js/lookdev.js +46 -0
- package/lib/motion/mgstyles/upstream/demos/07-liquid/js/scene.js +963 -0
- package/lib/motion/mgstyles/upstream/demos/07-liquid/js/shaders.js +647 -0
- package/lib/motion/mgstyles/upstream/demos/07-liquid/js/textsdf.js +114 -0
- package/lib/motion/mgstyles/upstream/demos/07-liquid/js/type.js +50 -0
- package/lib/motion/mgstyles/upstream/demos/08-morph/cues.json +131 -0
- package/lib/motion/mgstyles/upstream/demos/08-morph/glyphs.json +1 -0
- package/lib/motion/mgstyles/upstream/demos/08-morph/index.html +901 -0
- package/lib/motion/mgstyles/upstream/demos/09-bauhaus/cues.json +270 -0
- package/lib/motion/mgstyles/upstream/demos/09-bauhaus/film.js +697 -0
- package/lib/motion/mgstyles/upstream/demos/09-bauhaus/index.html +12 -0
- package/lib/motion/mgstyles/upstream/demos/10-synthwave/cues.json +44 -0
- package/lib/motion/mgstyles/upstream/demos/10-synthwave/index.html +1028 -0
- package/lib/motion/mgstyles/upstream/demos/12-aurora-glass/cues.json +67 -0
- package/lib/motion/mgstyles/upstream/demos/12-aurora-glass/index.html +16 -0
- package/lib/motion/mgstyles/upstream/demos/12-aurora-glass/main.js +967 -0
- package/lib/motion/mgstyles/upstream/demos/12-aurora-glass/shaders.js +468 -0
- package/lib/motion/mgstyles/upstream/demos/18-hanazi/cues.json +117 -0
- package/lib/motion/mgstyles/upstream/demos/18-hanazi/index.html +541 -0
- package/lib/motion/mgstyles/upstream/demos/19-paperclip/assets/countries-110m.json +1 -0
- package/lib/motion/mgstyles/upstream/demos/19-paperclip/assets/stickers/meta.json +34 -0
- package/lib/motion/mgstyles/upstream/demos/19-paperclip/cues.json +285 -0
- package/lib/motion/mgstyles/upstream/demos/19-paperclip/index.html +599 -0
- package/lib/motion/mgstyles/upstream/demos/20-pixel/cues.json +42 -0
- package/lib/motion/mgstyles/upstream/demos/20-pixel/film.js +914 -0
- package/lib/motion/mgstyles/upstream/demos/20-pixel/index.html +18 -0
- package/lib/motion/mgstyles/upstream/demos/22-hud/cues.json +108 -0
- package/lib/motion/mgstyles/upstream/demos/22-hud/index.html +125 -0
- package/lib/motion/mgstyles/upstream/demos/22-hud/js/holo.js +275 -0
- package/lib/motion/mgstyles/upstream/demos/22-hud/js/hud.js +855 -0
- package/lib/motion/mgstyles/upstream/demos/22-hud/js/post.js +150 -0
- package/lib/motion/mgstyles/upstream/demos/22-hud/js/util.js +65 -0
- package/lib/motion/mgstyles/upstream/demos/22-hud/js/v5.js +142 -0
- package/lib/motion/mgstyles/upstream/harness/render.mjs +319 -0
- package/lib/motion/mgstyles/upstream/manifest.json +269 -0
- package/lib/motion/mgstyles/upstream/prompts/01-flat-vector.md +98 -0
- package/lib/motion/mgstyles/upstream/prompts/02-line-art.md +95 -0
- package/lib/motion/mgstyles/upstream/prompts/03-isometric.md +97 -0
- package/lib/motion/mgstyles/upstream/prompts/05-cel-boil.md +95 -0
- package/lib/motion/mgstyles/upstream/prompts/06-collage.md +95 -0
- package/lib/motion/mgstyles/upstream/prompts/07-liquid.md +98 -0
- package/lib/motion/mgstyles/upstream/prompts/08-morph.md +95 -0
- package/lib/motion/mgstyles/upstream/prompts/09-bauhaus.md +96 -0
- package/lib/motion/mgstyles/upstream/prompts/10-synthwave.md +95 -0
- package/lib/motion/mgstyles/upstream/prompts/12-aurora-glass.md +96 -0
- package/lib/motion/mgstyles/upstream/prompts/18-hanazi.md +95 -0
- package/lib/motion/mgstyles/upstream/prompts/19-paperclip.md +96 -0
- package/lib/motion/mgstyles/upstream/prompts/20-pixel.md +96 -0
- package/lib/motion/mgstyles/upstream/prompts/22-hud.md +95 -0
- package/lib/motion/mgstyles/upstream/rubric.md +51 -0
- package/lib/motion/mgstyles/upstream/template.md +36 -0
- package/lib/motion/pixelqa.js +198 -0
- package/lib/motion/preview.js +95 -0
- package/lib/motion/project.js +395 -0
- package/lib/motion/qa.js +290 -0
- package/lib/motion/reference-media.jsx +10 -0
- package/lib/motion/render-settings.js +112 -0
- package/lib/motion/render.js +159 -0
- package/lib/motion/scene-kit.js +183 -0
- package/lib/motion/sfx.js +232 -0
- package/lib/motion/shotcraft/ClipCard.tsx +204 -0
- package/lib/motion/shotcraft/catalog.json +2461 -0
- package/lib/motion/shotcraft/upstream/SKILL.md +286 -0
- package/lib/motion/shotcraft/upstream/assets/lib/Caption.tsx +54 -0
- package/lib/motion/shotcraft/upstream/assets/lib/ClipCard.tsx +200 -0
- package/lib/motion/shotcraft/upstream/assets/lib/DigitRoll.tsx +45 -0
- package/lib/motion/shotcraft/upstream/assets/lib/FlashCut.tsx +20 -0
- package/lib/motion/shotcraft/upstream/assets/lib/FlatPanel.tsx +65 -0
- package/lib/motion/shotcraft/upstream/assets/lib/PageCam.tsx +151 -0
- package/lib/motion/shotcraft/upstream/assets/lib/VerticalTicker.tsx +129 -0
- package/lib/motion/shotcraft/upstream/assets/lib/helpers/camera.tsx +75 -0
- package/lib/motion/shotcraft/upstream/assets/lib/helpers/motion.ts +40 -0
- package/lib/motion/shotcraft/upstream/assets/lib/helpers/rand.ts +11 -0
- package/lib/motion/shotcraft/upstream/assets/lib/helpers/shake.ts +10 -0
- package/lib/motion/shotcraft/upstream/assets/scripts/__pycache__/sfx-source.cpython-313.pyc +0 -0
- package/lib/motion/shotcraft/upstream/assets/scripts/build-readme-cover.mjs +49 -0
- package/lib/motion/shotcraft/upstream/assets/scripts/capture-template.mjs +210 -0
- package/lib/motion/shotcraft/upstream/assets/scripts/sfx-source.py +423 -0
- package/lib/motion/shotcraft/upstream/assets/scripts/smoke-render-demos.py +170 -0
- package/lib/motion/shotcraft/upstream/assets/scripts/test_sfx_source.py +157 -0
- package/lib/motion/shotcraft/upstream/demos/README.md +120 -0
- package/lib/motion/shotcraft/upstream/demos/_fixtures/Brand.tsx +112 -0
- package/lib/motion/shotcraft/upstream/demos/_fixtures/Fixtures.tsx +647 -0
- package/lib/motion/shotcraft/upstream/demos/_fixtures/Look.tsx +316 -0
- package/lib/motion/shotcraft/upstream/demos/_fixtures/Motion.tsx +82 -0
- package/lib/motion/shotcraft/upstream/demos/_fixtures/PageCam2D.tsx +115 -0
- package/lib/motion/shotcraft/upstream/demos/_fixtures/Polish.tsx +243 -0
- package/lib/motion/shotcraft/upstream/demos/_textures/live-layout.json +389 -0
- package/lib/motion/shotcraft/upstream/demos/camera/basic-3d-scene/Basic3DScene.tsx +250 -0
- package/lib/motion/shotcraft/upstream/demos/camera/crash-zoom-punch/CrashImpactReal.tsx +305 -0
- package/lib/motion/shotcraft/upstream/demos/camera/crash-zoom-punch/CrashZoomReal.tsx +246 -0
- package/lib/motion/shotcraft/upstream/demos/camera/cursor-flyover/CursorFlyover.tsx +390 -0
- package/lib/motion/shotcraft/upstream/demos/camera/depth-layer-moves/MultiplaneReal.tsx +138 -0
- package/lib/motion/shotcraft/upstream/demos/camera/graze-face-tour/GrazeFaceTour.tsx +542 -0
- package/lib/motion/shotcraft/upstream/demos/camera/overhead-camera-moves/OverheadTabletopDrop.tsx +315 -0
- package/lib/motion/shotcraft/upstream/demos/camera/overhead-camera-moves/TiltReveal.tsx +299 -0
- package/lib/motion/shotcraft/upstream/demos/camera/space-camera-moves/DroneDiveLanding.tsx +173 -0
- package/lib/motion/shotcraft/upstream/demos/camera/space-camera-moves/ExplodedView.tsx +348 -0
- package/lib/motion/shotcraft/upstream/demos/camera/steep-tilt-glide/SteepTiltGlide.tsx +366 -0
- package/lib/motion/shotcraft/upstream/demos/camera/tension-camera-moves/BulletTimeFreezeOrbit.tsx +279 -0
- package/lib/motion/shotcraft/upstream/demos/camera/tension-camera-moves/PullBackIsolation.tsx +184 -0
- package/lib/motion/shotcraft/upstream/demos/camera/terminal-3d/Terminal3D.tsx +390 -0
- package/lib/motion/shotcraft/upstream/demos/data/before-after-slider-scrub/BeforeAfterSliderScrub.tsx +155 -0
- package/lib/motion/shotcraft/upstream/demos/data/chart-live-moves/AxisRescaleShockV2.tsx +303 -0
- package/lib/motion/shotcraft/upstream/demos/data/chart-live-moves/OscilloscopeStreamV2.tsx +290 -0
- package/lib/motion/shotcraft/upstream/demos/data/chart-live-moves/UnitDotSwarmRegroupV2.tsx +278 -0
- package/lib/motion/shotcraft/upstream/demos/data/gauge-readout-moves/NeedleSweepSelftest.tsx +307 -0
- package/lib/motion/shotcraft/upstream/demos/data/gauge-readout-moves/TapeScrollFixedPointer.tsx +215 -0
- package/lib/motion/shotcraft/upstream/demos/data/scroll-brake-moves/BrakeReticleLock.tsx +299 -0
- package/lib/motion/shotcraft/upstream/demos/data/scroll-brake-moves/ChangelogScrollBrake.tsx +232 -0
- package/lib/motion/shotcraft/upstream/demos/data/timeline-travel/TimelineTravel.tsx +290 -0
- package/lib/motion/shotcraft/upstream/demos/effects/assemble-then-type-flyin/AssembleThenTypeFlyin.tsx +273 -0
- package/lib/motion/shotcraft/upstream/demos/effects/aurora-bloom-bg-flip/AuroraBloomBgFlip.tsx +167 -0
- package/lib/motion/shotcraft/upstream/demos/effects/brand-frame-snap/BrandFrameSnap.tsx +536 -0
- package/lib/motion/shotcraft/upstream/demos/effects/fui-hud-moves/ReticleLockOn.tsx +164 -0
- package/lib/motion/shotcraft/upstream/demos/effects/glow-flyline-moves/FlylineArc.tsx +175 -0
- package/lib/motion/shotcraft/upstream/demos/effects/glow-flyline-moves/GlowOrbAmbient.tsx +197 -0
- package/lib/motion/shotcraft/upstream/demos/effects/glow-flyline-moves/OrbFlylineRelay.tsx +241 -0
- package/lib/motion/shotcraft/upstream/demos/effects/icon-performance-moves/AttentionBounce.tsx +279 -0
- package/lib/motion/shotcraft/upstream/demos/effects/impact-feedback/AnimeImpact.tsx +230 -0
- package/lib/motion/shotcraft/upstream/demos/effects/impact-feedback/HitCounter.tsx +345 -0
- package/lib/motion/shotcraft/upstream/demos/effects/light-play-moves/SheenSweepRetry.tsx +275 -0
- package/lib/motion/shotcraft/upstream/demos/effects/light-play-moves/SpotlightSweepReveal.tsx +229 -0
- package/lib/motion/shotcraft/upstream/demos/effects/radial-ripple-phone-chips/RadialRipplePhoneChips.tsx +312 -0
- package/lib/motion/shotcraft/upstream/demos/effects/riso-print-hits/RisoMisregistrationHit.tsx +222 -0
- package/lib/motion/shotcraft/upstream/demos/effects/scan-bracket-sweep/ScanBracketSweep.tsx +295 -0
- package/lib/motion/shotcraft/upstream/demos/effects/scanline-annotate-focus/ScanlineAnnotateFocus.tsx +329 -0
- package/lib/motion/shotcraft/upstream/demos/effects/scanline-assemble-flyin/ScanlineAssembleFlyin.tsx +315 -0
- package/lib/motion/shotcraft/upstream/demos/effects/slam-entrance-moves/ImpactBurstKit.tsx +264 -0
- package/lib/motion/shotcraft/upstream/demos/effects/slam-entrance-moves/KanadaPerspectiveSnap.tsx +260 -0
- package/lib/motion/shotcraft/upstream/demos/effects/slam-entrance-moves/ScoreSlam.tsx +263 -0
- package/lib/motion/shotcraft/upstream/demos/effects/spotlight-sweep-moves/CornerSpotlightReveal.tsx +123 -0
- package/lib/motion/shotcraft/upstream/demos/effects/spotlight-sweep-moves/GlowWakeSleepPanel.tsx +187 -0
- package/lib/motion/shotcraft/upstream/demos/effects/spotlight-sweep-moves/SlideSpotlightPan.tsx +175 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/autolayout-gap-dial/AutolayoutGapDial.tsx +305 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/canvas-materialize-moves/DiagramCascadeBuild.tsx +350 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/canvas-materialize-moves/PanelToCanvasMaterialize.tsx +352 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/chip-grid-single-select-blackout/ChipGridSingleSelectBlackout.tsx +218 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/collab-cursor-moves/CursorCastEnsemble.tsx +297 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/glass-pill-dictation-typing/GlassPillDictationTyping.tsx +157 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/hashtag-to-pill-materialize/HashtagToPillMaterialize.tsx +218 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/picker-carousel-feature-cycle/PickerCarouselFeatureCycle.tsx +202 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/segmented-thumb-hero/SegmentedThumbHero.tsx +265 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/theme-switch-moves/PaletteThemeRipple.tsx +457 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/theme-switch-moves/ThemeSweepToggle.tsx +446 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/type-and-filter/TypeAndFilter.tsx +249 -0
- package/lib/motion/shotcraft/upstream/demos/interaction/voice-waveform-live/VoiceWaveformLive.tsx +278 -0
- package/lib/motion/shotcraft/upstream/demos/opening/crane-rise-reveal/CraneRiseReveal.tsx +332 -0
- package/lib/motion/shotcraft/upstream/demos/opening/dataviz-landscape-open/DatavizLandscapeOpen.tsx +358 -0
- package/lib/motion/shotcraft/upstream/demos/opening/fracture/Fracture.tsx +201 -0
- package/lib/motion/shotcraft/upstream/demos/opening/icon-field-colorize/IconFieldColorize.tsx +200 -0
- package/lib/motion/shotcraft/upstream/demos/opening/letterspace-materialize/LetterspaceMaterialize.tsx +208 -0
- package/lib/motion/shotcraft/upstream/demos/opening/magician-card-flourish/MagicianCardFlourish.tsx +341 -0
- package/lib/motion/shotcraft/upstream/demos/opening/orbit-ring-title-open/OrbitRingTitleOpen.tsx +389 -0
- package/lib/motion/shotcraft/upstream/demos/opening/spotlight-hero-card/SpotlightHeroCard.tsx +293 -0
- package/lib/motion/shotcraft/upstream/demos/opening/stroke-segment-build/StrokeSegmentBuild.tsx +183 -0
- package/lib/motion/shotcraft/upstream/demos/opening/text-as-mask/TextAsMask.tsx +245 -0
- package/lib/motion/shotcraft/upstream/demos/outro/grain-dissolve/GrainDissolve.tsx +222 -0
- package/lib/motion/shotcraft/upstream/demos/outro/logo-shrink-wordmark-lockup/LogoShrinkWordmarkLockup.tsx +223 -0
- package/lib/motion/shotcraft/upstream/demos/outro/neon-triple-marquee/NeonTripleMarquee.tsx +217 -0
- package/lib/motion/shotcraft/upstream/demos/outro/outro-group-photo-launch/OutroGroupPhotoLaunch.tsx +343 -0
- package/lib/motion/shotcraft/upstream/demos/outro/ui-strip-away-outro/UiStripAwayOutro.tsx +357 -0
- package/lib/motion/shotcraft/upstream/demos/outro/ui-to-brand-morph/IconFlipBloomLogo.tsx +187 -0
- package/lib/motion/shotcraft/upstream/demos/outro/ui-to-brand-morph/InputMorphsIntoLogo.tsx +333 -0
- package/lib/motion/shotcraft/upstream/demos/rhythm/beat-cut-moves/PaparazziFlash.tsx +274 -0
- package/lib/motion/shotcraft/upstream/demos/rhythm/beat-step-list-theme-cycle/BeatStepListThemeCycle.tsx +270 -0
- package/lib/motion/shotcraft/upstream/demos/rhythm/panel-grid-moves/ComicPanelSplit.tsx +430 -0
- package/lib/motion/shotcraft/upstream/demos/rhythm/quad-split-parallel-scenes/QuadSplitParallelScenes.tsx +252 -0
- package/lib/motion/shotcraft/upstream/demos/rhythm/rhythm-interrupt-moves/JumpCutPunchIn.tsx +106 -0
- package/lib/motion/shotcraft/upstream/demos/rhythm/sakuga-timing-shift/SakugaTimingShift.tsx +288 -0
- package/lib/motion/shotcraft/upstream/demos/rhythm/speed-ramp-freeze/FreezeAnnotateReal.tsx +362 -0
- package/lib/motion/shotcraft/upstream/demos/rhythm/trailer-grammar-moves/TrailerBumper.tsx +168 -0
- package/lib/motion/shotcraft/upstream/demos/transition/bottom-push-stack-wipe/BottomPushStackWipe.tsx +310 -0
- package/lib/motion/shotcraft/upstream/demos/transition/card-flip-reveal/CardFlipReveal.tsx +261 -0
- package/lib/motion/shotcraft/upstream/demos/transition/card-flock-tumble/CardFlockTumble.tsx +459 -0
- package/lib/motion/shotcraft/upstream/demos/transition/circle-match-iris/CircleMatchIris.tsx +294 -0
- package/lib/motion/shotcraft/upstream/demos/transition/gradient-transition/GradientTransition.tsx +161 -0
- package/lib/motion/shotcraft/upstream/demos/transition/line-carry-transition/LineCarryTransition.tsx +248 -0
- package/lib/motion/shotcraft/upstream/demos/transition/mosaic-reframe/MosaicReframe.tsx +359 -0
- package/lib/motion/shotcraft/upstream/demos/transition/page-turn-transitions/BarnDoorSplit.tsx +227 -0
- package/lib/motion/shotcraft/upstream/demos/transition/print-texture-transitions/InkBleedReveal.tsx +162 -0
- package/lib/motion/shotcraft/upstream/demos/transition/shot-transitions/PortalWipeV2.tsx +248 -0
- package/lib/motion/shotcraft/upstream/demos/transition/shot-transitions/WhipBrakeReal.tsx +186 -0
- package/lib/motion/shotcraft/upstream/demos/transition/tear-streak-transitions/GlitchDisplace.tsx +355 -0
- package/lib/motion/shotcraft/upstream/demos/transition/transition-hidden-cut/InvisibleCut.tsx +272 -0
- package/lib/motion/shotcraft/upstream/demos/transition/transition-hidden-cut/LightLeakBurn.tsx +262 -0
- package/lib/motion/shotcraft/upstream/demos/transition/transition-hidden-cut/VersusSlam.tsx +217 -0
- package/lib/motion/shotcraft/upstream/demos/transition/transition-travel/LetterformZoom.tsx +285 -0
- package/lib/motion/shotcraft/upstream/demos/transition/white-flash-logo-simplify-cut/WhiteFlashLogoSimplifyCut.tsx +205 -0
- package/lib/motion/shotcraft/upstream/demos/transition/wipe-transitions/BlindsSlice.tsx +178 -0
- package/lib/motion/shotcraft/upstream/demos/typography/blur-slide/BlurSlide.tsx +147 -0
- package/lib/motion/shotcraft/upstream/demos/typography/brace-expand/BraceExpand.tsx +143 -0
- package/lib/motion/shotcraft/upstream/demos/typography/brand-ink-open/BrandInkOpen.tsx +134 -0
- package/lib/motion/shotcraft/upstream/demos/typography/countdown-arc-scatter/CountdownArcScatter.tsx +217 -0
- package/lib/motion/shotcraft/upstream/demos/typography/flying-words/FlyingWords.tsx +198 -0
- package/lib/motion/shotcraft/upstream/demos/typography/glitch-cycle/GlitchCycle.tsx +221 -0
- package/lib/motion/shotcraft/upstream/demos/typography/gradient-word-sweep/GradientWordSweep.tsx +312 -0
- package/lib/motion/shotcraft/upstream/demos/typography/lead-word-zoom-assemble/LeadWordZoomAssemble.tsx +261 -0
- package/lib/motion/shotcraft/upstream/demos/typography/marker-underline-title/MarkerUnderlineTitle.tsx +121 -0
- package/lib/motion/shotcraft/upstream/demos/typography/outline-word-fill/OutlineWordFill.tsx +153 -0
- package/lib/motion/shotcraft/upstream/demos/typography/paper-title-card/PaperTitleCard.tsx +179 -0
- package/lib/motion/shotcraft/upstream/demos/typography/pill-chip-slot-cycle-handled/PillChipSlotCycleHandled.tsx +140 -0
- package/lib/motion/shotcraft/upstream/demos/typography/pill-slot-cycle/PillSlotCycle.tsx +309 -0
- package/lib/motion/shotcraft/upstream/demos/typography/text-column-converge/TextColumnConverge.tsx +191 -0
- package/lib/motion/shotcraft/upstream/demos/typography/title-demote-to-label/TitleDemoteToLabel.tsx +292 -0
- package/lib/motion/shotcraft/upstream/demos/typography/type-assembly-moves/LetterformDriftAssembly.tsx +135 -0
- package/lib/motion/shotcraft/upstream/demos/typography/type-assembly-moves/SplitTextStagger.tsx +124 -0
- package/lib/motion/shotcraft/upstream/demos/typography/type-assembly-moves/TextOnPath.tsx +255 -0
- package/lib/motion/shotcraft/upstream/demos/typography/type-entrance-moves/LetterDropPhysics.tsx +173 -0
- package/lib/motion/shotcraft/upstream/demos/typography/type-rhythm-sync/FontWeightPump.tsx +225 -0
- package/lib/motion/shotcraft/upstream/demos/typography/type-rhythm-sync/KaraokeFillSync.tsx +141 -0
- package/lib/motion/shotcraft/upstream/demos/typography/typewriter-moves/TypewriterErrorRetype.tsx +137 -0
- package/lib/motion/shotcraft/upstream/demos/typography/vertical-word-roll-blur-cycle/VerticalWordRollBlurCycle.tsx +147 -0
- package/lib/motion/shotcraft/upstream/demos/typography/word-relay-filmstrip/WordRelayFilmstrip.tsx +409 -0
- package/lib/motion/shotcraft/upstream/demos/typography/word-relay-geometry/WordRelayGeometry.tsx +280 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/avatar-bracket-carousel/AvatarBracketCarousel.tsx +271 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/bezier-source-converge-merge/BezierSourceConvergeMerge.tsx +385 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/card-stack/CardStack.tsx +312 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/carousel-3d/Carousel3D.tsx +303 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/clipcard-looping/ClipCardLooping.tsx +77 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/cloner-depth-echo/ClonerDepthEcho.tsx +311 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/deck-deal-flyin/DeckDealFlyin.tsx +307 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/doc-park-left-pill-deal/DocParkLeftPillDeal.tsx +349 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/document-typewriter-reveal/DocumentTypewriterReveal.tsx +255 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/draw-svg-trace/DrawSvgTrace.tsx +244 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/element-body-moves/ContactShadowLift.tsx +217 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/integration-hub-map/IntegrationHubMap.tsx +652 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/list-reveal/ListReveal.tsx +153 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/list-stack-press/ListStackPress.tsx +238 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/neon-frame-forerun/NeonFrameForerun.tsx +324 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/neon-frame-orbit-drop/NeonFrameForerunOrbit.tsx +354 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/page-waterfall-wall/PageWaterfallWall.tsx +101 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/page-waterfall-wall/VerticalTicker.tsx +129 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/product-card-progressive-assemble/ProductCardProgressiveAssemble.tsx +297 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/radial-wave/RadialWave.tsx +57 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/research-card-stack-scroll/ResearchCardStackScroll.tsx +155 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/row-embed/RowEmbed.tsx +175 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/value-stagger-gradient/ValueStaggerGradient.tsx +153 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/wall-reveal-moves/BentoLightUp.tsx +146 -0
- package/lib/motion/shotcraft/upstream/demos/ui-entrance/wall-reveal-moves/WireframeDrawOn.tsx +226 -0
- package/lib/motion/shotcraft/upstream/gallery/api/library.json +1 -0
- package/lib/motion/shotcraft/upstream/manifest.json +2715 -0
- package/lib/motion/shotcraft/upstream/references/aesthetic-rules.md +193 -0
- package/lib/motion/shotcraft/upstream/references/final-review.md +121 -0
- package/lib/motion/shotcraft/upstream/references/guided-free-creation.md +199 -0
- package/lib/motion/shotcraft/upstream/references/jianying-export.md +183 -0
- package/lib/motion/shotcraft/upstream/references/music-beat-sync.md +257 -0
- package/lib/motion/shotcraft/upstream/references/pipeline.md +382 -0
- package/lib/motion/shotcraft/upstream/references/publish-upload-post.md +111 -0
- package/lib/motion/shotcraft/upstream/references/sequences/promo-energy-arc.md +50 -0
- package/lib/motion/shotcraft/upstream/references/sfx-sourcing.md +95 -0
- package/lib/motion/shotcraft/upstream/references/shots/camera/basic-3d-scene.md +41 -0
- package/lib/motion/shotcraft/upstream/references/shots/camera/crash-zoom-punch.md +52 -0
- package/lib/motion/shotcraft/upstream/references/shots/camera/cursor-flyover.md +39 -0
- package/lib/motion/shotcraft/upstream/references/shots/camera/depth-layer-moves.md +39 -0
- package/lib/motion/shotcraft/upstream/references/shots/camera/graze-face-tour.md +57 -0
- package/lib/motion/shotcraft/upstream/references/shots/camera/overhead-camera-moves.md +51 -0
- package/lib/motion/shotcraft/upstream/references/shots/camera/space-camera-moves.md +46 -0
- package/lib/motion/shotcraft/upstream/references/shots/camera/steep-tilt-glide.md +52 -0
- package/lib/motion/shotcraft/upstream/references/shots/camera/tension-camera-moves.md +43 -0
- package/lib/motion/shotcraft/upstream/references/shots/camera/terminal-3d.md +42 -0
- package/lib/motion/shotcraft/upstream/references/shots/data/before-after-slider-scrub.md +48 -0
- package/lib/motion/shotcraft/upstream/references/shots/data/chart-live-moves.md +52 -0
- package/lib/motion/shotcraft/upstream/references/shots/data/gauge-readout-moves.md +45 -0
- package/lib/motion/shotcraft/upstream/references/shots/data/scroll-brake-moves.md +46 -0
- package/lib/motion/shotcraft/upstream/references/shots/data/timeline-travel.md +44 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/assemble-then-type-flyin.md +63 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/aurora-bloom-bg-flip.md +54 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/brand-frame-snap.md +58 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/fui-hud-moves.md +35 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/glow-flyline-moves.md +53 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/icon-performance-moves.md +42 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/impact-feedback.md +50 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/light-play-moves.md +46 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/radial-ripple-phone-chips.md +56 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/riso-print-hits.md +49 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/scan-bracket-sweep.md +50 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/scanline-annotate-focus.md +53 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/scanline-assemble-flyin.md +53 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/slam-entrance-moves.md +55 -0
- package/lib/motion/shotcraft/upstream/references/shots/effects/spotlight-sweep-moves.md +52 -0
- package/lib/motion/shotcraft/upstream/references/shots/interaction/autolayout-gap-dial.md +60 -0
- package/lib/motion/shotcraft/upstream/references/shots/interaction/canvas-materialize-moves.md +57 -0
- package/lib/motion/shotcraft/upstream/references/shots/interaction/chip-grid-single-select-blackout.md +51 -0
- package/lib/motion/shotcraft/upstream/references/shots/interaction/collab-cursor-moves.md +41 -0
- package/lib/motion/shotcraft/upstream/references/shots/interaction/glass-pill-dictation-typing.md +53 -0
- package/lib/motion/shotcraft/upstream/references/shots/interaction/hashtag-to-pill-materialize.md +60 -0
- package/lib/motion/shotcraft/upstream/references/shots/interaction/picker-carousel-feature-cycle.md +55 -0
- package/lib/motion/shotcraft/upstream/references/shots/interaction/segmented-thumb-hero.md +57 -0
- package/lib/motion/shotcraft/upstream/references/shots/interaction/theme-switch-moves.md +47 -0
- package/lib/motion/shotcraft/upstream/references/shots/interaction/type-and-filter.md +37 -0
- package/lib/motion/shotcraft/upstream/references/shots/interaction/voice-waveform-live.md +54 -0
- package/lib/motion/shotcraft/upstream/references/shots/opening/brand-ink-open.md +36 -0
- package/lib/motion/shotcraft/upstream/references/shots/opening/crane-rise-reveal.md +56 -0
- package/lib/motion/shotcraft/upstream/references/shots/opening/dataviz-landscape-open.md +56 -0
- package/lib/motion/shotcraft/upstream/references/shots/opening/fracture.md +40 -0
- package/lib/motion/shotcraft/upstream/references/shots/opening/icon-field-colorize.md +60 -0
- package/lib/motion/shotcraft/upstream/references/shots/opening/letterspace-materialize.md +57 -0
- package/lib/motion/shotcraft/upstream/references/shots/opening/magician-card-flourish.md +73 -0
- package/lib/motion/shotcraft/upstream/references/shots/opening/orbit-ring-title-open.md +87 -0
- package/lib/motion/shotcraft/upstream/references/shots/opening/spotlight-hero-card.md +55 -0
- package/lib/motion/shotcraft/upstream/references/shots/opening/stroke-segment-build.md +50 -0
- package/lib/motion/shotcraft/upstream/references/shots/opening/text-as-mask.md +59 -0
- package/lib/motion/shotcraft/upstream/references/shots/outro/grain-dissolve.md +38 -0
- package/lib/motion/shotcraft/upstream/references/shots/outro/logo-shrink-wordmark-lockup.md +38 -0
- package/lib/motion/shotcraft/upstream/references/shots/outro/neon-triple-marquee.md +59 -0
- package/lib/motion/shotcraft/upstream/references/shots/outro/outro-group-photo-launch.md +39 -0
- package/lib/motion/shotcraft/upstream/references/shots/outro/ui-strip-away-outro.md +61 -0
- package/lib/motion/shotcraft/upstream/references/shots/outro/ui-to-brand-morph.md +52 -0
- package/lib/motion/shotcraft/upstream/references/shots/rhythm/beat-cut-moves.md +50 -0
- package/lib/motion/shotcraft/upstream/references/shots/rhythm/beat-step-list-theme-cycle.md +66 -0
- package/lib/motion/shotcraft/upstream/references/shots/rhythm/panel-grid-moves.md +43 -0
- package/lib/motion/shotcraft/upstream/references/shots/rhythm/quad-split-parallel-scenes.md +38 -0
- package/lib/motion/shotcraft/upstream/references/shots/rhythm/rhythm-interrupt-moves.md +38 -0
- package/lib/motion/shotcraft/upstream/references/shots/rhythm/sakuga-timing-shift.md +56 -0
- package/lib/motion/shotcraft/upstream/references/shots/rhythm/speed-ramp-freeze.md +44 -0
- package/lib/motion/shotcraft/upstream/references/shots/rhythm/trailer-grammar-moves.md +38 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/bottom-push-stack-wipe.md +63 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/card-flip-reveal.md +57 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/card-flock-tumble.md +63 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/circle-match-iris.md +58 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/gradient-transition.md +45 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/line-carry-transition.md +55 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/mosaic-reframe.md +49 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/page-turn-transitions.md +42 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/print-texture-transitions.md +42 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/shot-transitions.md +45 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/tear-streak-transitions.md +48 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/transition-hidden-cut.md +55 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/transition-travel.md +43 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/white-flash-logo-simplify-cut.md +41 -0
- package/lib/motion/shotcraft/upstream/references/shots/transition/wipe-transitions.md +42 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/blur-slide.md +59 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/brace-expand.md +55 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/countdown-arc-scatter.md +65 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/document-typewriter-reveal.md +42 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/flying-words.md +64 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/glitch-cycle.md +64 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/gradient-word-sweep.md +54 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/lead-word-zoom-assemble.md +91 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/marker-underline-title.md +51 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/outline-word-fill.md +66 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/paper-title-card.md +38 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/pill-chip-slot-cycle-handled.md +66 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/pill-slot-cycle.md +58 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/text-column-converge.md +61 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/title-demote-to-label.md +64 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/type-assembly-moves.md +45 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/type-entrance-moves.md +41 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/type-rhythm-sync.md +51 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/typewriter-moves.md +42 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/vertical-word-roll-blur-cycle.md +63 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/word-relay-filmstrip.md +57 -0
- package/lib/motion/shotcraft/upstream/references/shots/typography/word-relay-geometry.md +75 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/avatar-bracket-carousel.md +59 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/bezier-source-converge-merge.md +67 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/card-stack.md +60 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/carousel-3d.md +66 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/cloner-depth-echo.md +40 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/deck-deal-flyin.md +45 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/doc-park-left-pill-deal.md +62 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/draw-svg-trace.md +55 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/element-body-moves.md +37 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/integration-hub-map.md +55 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/list-reveal.md +50 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/list-stack-press.md +43 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/neon-frame-forerun.md +55 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/neon-frame-orbit-drop.md +51 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/page-waterfall-wall.md +51 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/product-card-progressive-assemble.md +56 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/radial-wave.md +49 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/research-card-stack-scroll.md +57 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/row-embed.md +36 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/value-stagger-gradient.md +64 -0
- package/lib/motion/shotcraft/upstream/references/shots/ui-entrance/wall-reveal-moves.md +47 -0
- package/lib/motion/shotcraft/upstream/references/sound-design.md +170 -0
- package/lib/motion/shotcraft/upstream/references/workbench.md +157 -0
- package/lib/motion/shotcraft/upstream/template/TEMPLATE.md +103 -0
- package/lib/motion/shotcraft/upstream/template/THEMES.md +44 -0
- package/lib/motion/shotcraft/upstream/template/package.json +20 -0
- package/lib/motion/shotcraft/upstream/template/remotion.config.ts +6 -0
- package/lib/motion/shotcraft/upstream/template/src/Root.tsx +17 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/Caption.tsx +65 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/DigitRoll.tsx +48 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/FlashCut.tsx +24 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/Main.tsx +192 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/PaperTitleCard.tsx +111 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/live/PageCam.tsx +150 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/live/SceneDetail.tsx +158 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/live/SceneFlyIn.tsx +468 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/live/SceneOpen.tsx +552 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/live/SceneOutroLive.tsx +411 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/live/ScenePapers.tsx +200 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/live/SceneWbr.tsx +324 -0
- package/lib/motion/shotcraft/upstream/template/src/aifl/live-layout.json +389 -0
- package/lib/motion/shotcraft/upstream/template/src/index.ts +4 -0
- package/lib/motion/shotcraft/upstream/template/src/themes/ThemedFilm.tsx +7 -0
- package/lib/motion/shotcraft/upstream/template/src/themes/manifest.tsx +68 -0
- package/lib/motion/shotcraft/upstream/template/src/themes/palette-assets.json +1 -0
- package/lib/motion/shotcraft/upstream/template/src/themes/palette-assets.ts +24 -0
- package/lib/motion/shotcraft/upstream/template/src/themes/palettes.json +74 -0
- package/lib/motion/shotcraft/upstream/template/src/themes/visual-theme.tsx +91 -0
- package/lib/motion/shotcraft/upstream/template/src/workbench.ts +213 -0
- package/lib/motion/shotcraft/upstream/template/tsconfig.json +15 -0
- package/lib/motion/spec.js +113 -0
- package/lib/motion/style-engine.js +153 -0
- package/lib/motion/style-frames.js +268 -0
- package/lib/motion/sync.js +214 -0
- package/lib/motion/theme.js +121 -0
- package/lib/motion/voice.js +417 -0
- package/lib/motion-agent-files.js +82 -0
- package/lib/motion-agent-protocol.js +66 -0
- package/lib/motion-agent-tools.js +196 -0
- package/lib/motion-agent.js +171 -0
- package/lib/motion-capture.js +92 -0
- package/lib/motion-core.js +238 -0
- package/lib/motion-film-review.js +71 -0
- package/lib/motion-library.js +210 -0
- package/lib/motion-planner.js +254 -0
- package/lib/motion-project.js +80 -0
- package/lib/motion-render-worker.js +145 -0
- package/lib/motion-session.js +32 -0
- package/lib/motion-source.js +49 -0
- package/lib/motion-tasks.js +452 -0
- package/lib/motion-vision.js +43 -0
- package/lib/mxfile.js +27 -7
- package/lib/routing/node-runtime.js +14 -0
- package/lib/routing/router.js +211 -0
- package/lib/routing/vendor/README.md +96 -0
- package/lib/routing/vendor/libavoid-routing.js +753 -0
- package/lib/routing/vendor/libavoid.min.js +59 -0
- package/lib/shotcard-core.js +39 -0
- package/lib/shotcard-reference.js +56 -0
- package/lib/style-kernel.js +37 -3
- package/lib/task-patches.js +26 -2
- package/lib/video-export.js +17 -2
- package/package.json +29 -4
|
@@ -0,0 +1,238 @@
|
|
|
1
|
+
/* 由 tools/build.mjs 生成 —— 请勿直接编辑;改 src/ 下的源文件。 */
|
|
2
|
+
import { isShotCardNode } from './shotcard-core.js'
|
|
3
|
+
import { isMgStyleNode } from './mgstyle-core.js'
|
|
4
|
+
/* Serializable motion documents shared by the host and canvas. Scene sources are rendered only by the worker. */
|
|
5
|
+
export const MOTION_VERSION = 1
|
|
6
|
+
export const MOTION_ROLES = ['material', 'copy', 'instruction', 'style', 'layout', 'shotcard', 'mgstyle', 'audio']
|
|
7
|
+
const motionClone = (value) => JSON.parse(JSON.stringify(value))
|
|
8
|
+
const motionStable = (value) => JSON.stringify(value, (_key, item) => item && typeof item === 'object' && !Array.isArray(item)
|
|
9
|
+
? Object.fromEntries(Object.keys(item).sort().map((key) => [key, item[key]])) : item)
|
|
10
|
+
|
|
11
|
+
export function motionSettings(raw = {}) {
|
|
12
|
+
const integer = (value, fallback, min, max) => {
|
|
13
|
+
const n = value === undefined ? fallback : Number(value)
|
|
14
|
+
if (!Number.isInteger(n) || n < min || n > max) throw new Error('无效的动效尺寸、帧率或时长')
|
|
15
|
+
return n
|
|
16
|
+
}
|
|
17
|
+
if (raw.mode !== undefined && raw.mode !== 'scene') throw new Error('仅支持 Shotcraft 场景创作')
|
|
18
|
+
if (raw.preferredCards !== undefined && (!Array.isArray(raw.preferredCards) || raw.preferredCards.length > 6 || raw.preferredCards.some((id) => typeof id !== 'string' || !/^[a-z0-9-]+$/.test(id)))) throw new Error('最多选择 6 张镜头参考卡')
|
|
19
|
+
const fps = integer(raw.fps, 30, 12, 30)
|
|
20
|
+
const duration = Number(raw.duration ?? 12)
|
|
21
|
+
if (!Number.isFinite(duration) || duration < 2 || duration > 60) throw new Error('无效的动效尺寸、帧率或时长')
|
|
22
|
+
if(raw.audioMode!==undefined&&!['auto','manual','off'].includes(raw.audioMode))throw new Error('未知声音制作模式')
|
|
23
|
+
if(raw.audioPlan!==undefined&&(!raw.audioPlan||typeof raw.audioPlan!=='object'||Array.isArray(raw.audioPlan)||JSON.stringify(raw.audioPlan).length>100000))throw new Error('声音时间表无效或过大')
|
|
24
|
+
return { prompt: String(raw.prompt || '').trim().slice(0, 12000), mode: 'scene',
|
|
25
|
+
...(raw.audioMode?{audioMode:raw.audioMode}:{}),...(raw.audioPrompt!==undefined?{audioPrompt:String(raw.audioPrompt).slice(0,5000)}:{}),...(raw.audioPlan?{audioPlan:motionClone(raw.audioPlan)}:{}),
|
|
26
|
+
...(raw.preferredCards ? { preferredCards: [...new Set(raw.preferredCards)] } : {}),
|
|
27
|
+
width: integer(raw.width, 1280, 256, 1920), height: integer(raw.height, 720, 256, 1920),
|
|
28
|
+
fps, duration: Math.round(duration * fps) / fps }
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// Explicit tool settings override stored values; rendering always uses whole frames.
|
|
32
|
+
export function mergeMotionSettings(current, patch = {}) {
|
|
33
|
+
if (!patch || typeof patch !== 'object' || Array.isArray(patch)) throw new Error('settings 必须是设置对象')
|
|
34
|
+
if (Object.keys(patch).some((key) => !['width', 'height', 'fps', 'duration', 'totalFrames', 'audioMode', 'audioPrompt', 'audioPlan'].includes(key))) throw new Error('未知视频设置字段')
|
|
35
|
+
const { totalFrames, ...values } = patch
|
|
36
|
+
const next = motionSettings({ ...current, ...values })
|
|
37
|
+
if (totalFrames !== undefined) {
|
|
38
|
+
if (!Number.isInteger(totalFrames) || totalFrames < next.fps * 2 || totalFrames > next.fps * 60) throw new Error('totalFrames 必须为 2–60 秒范围内的整数帧数')
|
|
39
|
+
if (patch.duration !== undefined && Math.round(Number(patch.duration) * next.fps) !== totalFrames) throw new Error('duration 与 totalFrames 冲突')
|
|
40
|
+
next.duration = totalFrames / next.fps
|
|
41
|
+
}
|
|
42
|
+
return { ...current, ...next }
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export function isMotionNode(node) { return node?.data?.drawaiMotion === '1' }
|
|
46
|
+
export function isAudioNode(node) { return node?.data?.drawaiAudio === '1' }
|
|
47
|
+
export function audioNodeData(role = 'sfx') {
|
|
48
|
+
if (!['sfx','bgm','voice'].includes(role)) throw new Error('未知音频用途')
|
|
49
|
+
return { drawaiAudio:'1',audioRole:role,audioGainDb:role==='bgm'?'-14':'0',audioTrimStart:'0',audioTrimEnd:'0',audioAt:'0',audioFadeIn:role==='bgm'?'0.3':'0',audioFadeOut:role==='bgm'?'0.5':'0',audioLoop:'0' }
|
|
50
|
+
}
|
|
51
|
+
export function audioNodeSettings(data) {
|
|
52
|
+
const number=(key,fallback,min,max)=>{const value=Number(data[key]??fallback);if(!Number.isFinite(value)||value<min||value>max)throw new Error('无效音频设置:'+key);return value}
|
|
53
|
+
const role=data.audioRole||'sfx'
|
|
54
|
+
if(!['sfx','bgm','voice'].includes(role))throw new Error('未知音频用途')
|
|
55
|
+
const settings={role,gainDb:number('audioGainDb',role==='bgm'?-14:0,-60,18),trimStart:number('audioTrimStart',0,0,600),trimEnd:number('audioTrimEnd',0,0,600),
|
|
56
|
+
at:number('audioAt',0,0,60),fadeIn:number('audioFadeIn',0,0,60),fadeOut:number('audioFadeOut',0,0,60),loop:data.audioLoop==='1'}
|
|
57
|
+
if(settings.trimEnd && settings.trimEnd<=settings.trimStart)throw new Error('音频裁切结束必须晚于开始')
|
|
58
|
+
return settings
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function validateAudioTimeline(raw,composition,input) {
|
|
62
|
+
if(!raw)return {version:1,cues:[],notes:[]}
|
|
63
|
+
if(!Array.isArray(raw.cues)||raw.cues.length>64)throw new Error('声音时间表最多64条')
|
|
64
|
+
const fps=composition.fps,total=composition.durationFrames
|
|
65
|
+
const cues=raw.cues.map((cue,index)=>{
|
|
66
|
+
const ref=input.refs.find(ref=>ref.id===cue.referenceId&&ref.role==='audio')
|
|
67
|
+
if(!ref)throw new Error('音频来源不存在:'+cue.referenceId)
|
|
68
|
+
const node=ref.nodes.find(isAudioNode),defaults=audioNodeSettings(node?.data||{})
|
|
69
|
+
const shot=cue.shotId?composition.shots.find(shot=>shot.id===cue.shotId):null
|
|
70
|
+
if(cue.shotId&&!shot)throw new Error('音频引用未知镜头')
|
|
71
|
+
const offset=Number(cue.offsetFrames??0),from=(shot?.startFrame||0)+offset
|
|
72
|
+
const duration=Number(cue.durationFrames??Math.min(total-from,shot?.durationFrames||total))
|
|
73
|
+
const gainDb=Number(cue.gainDb??defaults.gainDb),trimStart=Number(cue.trimStart??defaults.trimStart)
|
|
74
|
+
const fadeIn=Number(cue.fadeIn??defaults.fadeIn),fadeOut=Number(cue.fadeOut??defaults.fadeOut)
|
|
75
|
+
if(!Number.isInteger(offset)||offset<0||!Number.isInteger(duration)||duration<1||from+duration>total||from>=total||!Number.isFinite(gainDb)||gainDb< -60||gainDb>18||!Number.isFinite(trimStart)||trimStart<0||trimStart>600||![fadeIn,fadeOut].every(value=>Number.isFinite(value)&&value>=0&&value<=duration/fps))throw new Error('音频时间、增益或淡入淡出无效:'+(index+1))
|
|
76
|
+
return {id:'cue-'+(index+1),referenceId:ref.id,role:defaults.role,...(shot?{shotId:shot.id}:{}),offsetFrames:offset,from,durationFrames:duration,
|
|
77
|
+
trimStart,gainDb,fadeIn,fadeOut,loop:cue.loop===undefined?defaults.loop:cue.loop===true,action:String(cue.action||'').slice(0,600)}
|
|
78
|
+
})
|
|
79
|
+
return {version:1,cues,notes:Array.isArray(raw.notes)?raw.notes.map(String).slice(0,12):[]}
|
|
80
|
+
}
|
|
81
|
+
export function motionNodeData() {
|
|
82
|
+
return { drawaiMedia: '1', drawaiMotion: '1', motion: { version: MOTION_VERSION, ...motionSettings(), mode: 'scene', results: [] } }
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
// Incoming canvas arrows are the reference connections, including existing untagged edges.
|
|
86
|
+
export function motionReferenceEdges(doc, nodeId) {
|
|
87
|
+
const seen = new Set()
|
|
88
|
+
return doc.edges.filter((edge) => {
|
|
89
|
+
if (edge.to !== nodeId || seen.has(edge.from)) return false
|
|
90
|
+
seen.add(edge.from)
|
|
91
|
+
return true
|
|
92
|
+
})
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export function motionReferenceRole(doc, edge) {
|
|
96
|
+
if (isAudioNode(doc.nodes.find((item) => item.id === edge.from))) return 'audio'
|
|
97
|
+
if (isShotCardNode(doc.nodes.find((item) => item.id === edge.from))) return 'shotcard'
|
|
98
|
+
if (isMgStyleNode(doc.nodes.find((item) => item.id === edge.from))) return 'mgstyle'
|
|
99
|
+
if (edge.data?.motionReference?.role !== undefined) return edge.data.motionReference.role
|
|
100
|
+
const node = doc.nodes.find((item) => item.id === edge.from)
|
|
101
|
+
const style = node?.style || ''
|
|
102
|
+
if (/(?:^|;)text(?:=[^;]*)?(?:;|$)/.test(style)) return 'copy'
|
|
103
|
+
if (/(?:^|;)(?:group(?:=[^;]*)?|container=1)(?:;|$)/.test(style) || doc.nodes.some((item) => item.parent === edge.from)) return 'layout'
|
|
104
|
+
return 'material'
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
// 没连到任何视频节点的镜头卡。连线同时是「参考关系」和「排期依据」:
|
|
108
|
+
// 断连的卡既不会进 assets,也不会进 timeline——多数时候是漏了 addEdge,不是有意为之。
|
|
109
|
+
export function unlinkedShotCards(doc) {
|
|
110
|
+
const linked = new Set()
|
|
111
|
+
for (const edge of doc.edges || []) {
|
|
112
|
+
if (isMotionNode(doc.nodes.find((node) => node.id === edge.to))) linked.add(edge.from)
|
|
113
|
+
}
|
|
114
|
+
return (doc.nodes || [])
|
|
115
|
+
.filter((node) => isShotCardNode(node) && !linked.has(node.id))
|
|
116
|
+
.map((node) => ({ nodeId: node.id, cardId: node.data?.shotCardId, label: node.label || '' }))
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
export function bindMotionReference(doc, sourceId, targetId, role = 'material', edgeId) {
|
|
120
|
+
const source = doc.nodes.find((node) => node.id === sourceId), target = doc.nodes.find((node) => node.id === targetId)
|
|
121
|
+
if (!source || !isMotionNode(target) || sourceId === targetId) throw new Error('请选择有效的来源和目标视频节点')
|
|
122
|
+
assertMotionEditable(doc, targetId)
|
|
123
|
+
if (!MOTION_ROLES.includes(role)) throw new Error('未知参考用途')
|
|
124
|
+
const seen = new Set()
|
|
125
|
+
function reaches(id) {
|
|
126
|
+
if (id === sourceId) return true
|
|
127
|
+
if (seen.has(id)) return false
|
|
128
|
+
seen.add(id)
|
|
129
|
+
return doc.edges.some((edge) => (edge.data?.motionReference || isMotionNode(doc.nodes.find((item) => item.id === edge.to))) && edge.from === id && reaches(edge.to))
|
|
130
|
+
}
|
|
131
|
+
if (reaches(targetId)) throw new Error('生成参考不能形成循环')
|
|
132
|
+
const existing = doc.edges.find((edge) => edge.from === sourceId && edge.to === targetId && edge.data?.motionReference)
|
|
133
|
+
if (existing) { existing.data.motionReference.role = role; return existing }
|
|
134
|
+
if (!edgeId || doc.nodes.concat(doc.edges, doc.layers || []).some((item) => item.id === edgeId)) throw new Error('参考连线 ID 无效或冲突')
|
|
135
|
+
const edge = { id: edgeId, from: sourceId, to: targetId, label: '',
|
|
136
|
+
style: 'dashed=1;strokeColor=#7c6df2;endArrow=open;', data: { motionReference: { role } } }
|
|
137
|
+
if (target.layer || doc.layers?.[0]?.id) edge.layer = target.layer || doc.layers[0].id
|
|
138
|
+
doc.edges.push(edge)
|
|
139
|
+
if (Array.isArray(doc.drawOrder)) doc.drawOrder.unshift(edge.id)
|
|
140
|
+
return edge
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
export function motionInput(doc, nodeId) {
|
|
144
|
+
const node = doc.nodes.find((item) => item.id === nodeId)
|
|
145
|
+
if (!isMotionNode(node)) throw new Error('目标不是动效视频节点')
|
|
146
|
+
const settings = motionSettings(node.data.motion)
|
|
147
|
+
if (!settings.prompt) throw new Error('请先描述要生成的视频')
|
|
148
|
+
const visiting = new Set(), visited = new Set()
|
|
149
|
+
function visit(id) {
|
|
150
|
+
if (visiting.has(id)) throw new Error('生成参考不能形成循环')
|
|
151
|
+
if (visited.has(id)) return
|
|
152
|
+
visiting.add(id)
|
|
153
|
+
for (const edge of motionReferenceEdges(doc, id)) if (isMotionNode(doc.nodes.find((item) => item.id === id)) || edge.data?.motionReference) visit(edge.from)
|
|
154
|
+
visiting.delete(id); visited.add(id)
|
|
155
|
+
}
|
|
156
|
+
visit(nodeId)
|
|
157
|
+
const refs = motionReferenceEdges(doc, nodeId).map((edge) => {
|
|
158
|
+
const root = doc.nodes.find((item) => item.id === edge.from)
|
|
159
|
+
if (!root) throw new Error('参考素材已删除')
|
|
160
|
+
const role = motionReferenceRole(doc, edge)
|
|
161
|
+
if (!MOTION_ROLES.includes(role)) throw new Error('参考用途无效')
|
|
162
|
+
const ids = new Set([root.id])
|
|
163
|
+
for (let i = 0; i < doc.nodes.length; i++) for (const item of doc.nodes) if (ids.has(item.parent)) ids.add(item.id)
|
|
164
|
+
if (ids.has(nodeId)) throw new Error('参考分组不能包含目标视频')
|
|
165
|
+
const nodes = doc.nodes.filter((item) => ids.has(item.id)).map((item) => {
|
|
166
|
+
const data = { ...(item.data || {}) }; delete data.motion
|
|
167
|
+
return { id: item.id, label: item.label || '', style: item.style || '', x: item.x, y: item.y, w: item.w, h: item.h, parent: item.parent, data }
|
|
168
|
+
})
|
|
169
|
+
return { id: root.id, role, nodes, edges: doc.edges.filter((item) => ids.has(item.from) && ids.has(item.to) && !item.data?.motionReference) }
|
|
170
|
+
})
|
|
171
|
+
if (refs.length > 24 || refs.reduce((n, ref) => n + ref.nodes.length, 0) > 200) throw new Error('每次最多使用 24 组参考、200 个元素')
|
|
172
|
+
return { version: MOTION_VERSION, nodeId, settings, refs }
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export function motionInputKey(input) {
|
|
176
|
+
const text = motionStable(input), words = [0x811c9dc5, 0x9e3779b9, 0x85ebca6b, 0xc2b2ae35]
|
|
177
|
+
for (let i = 0; i < text.length; i++) for (let n = 0; n < words.length; n++) words[n] = Math.imul(words[n] ^ text.charCodeAt(i), 16777619 + n * 2) >>> 0
|
|
178
|
+
return words.map((word) => word.toString(16).padStart(8, '0')).join('')
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export function validateMotionPlan(raw, input) {
|
|
182
|
+
if (!raw || !Array.isArray(raw.shots) || !raw.shots.length || raw.shots.length > 24) throw new Error('分镜需要 1–24 个镜头')
|
|
183
|
+
const total = Math.round(input.settings.fps * input.settings.duration), ids = new Set(input.refs.map((ref) => ref.id))
|
|
184
|
+
const color = (value, fallback) => /^#[0-9a-f]{6}$/i.test(value || '') ? value : fallback
|
|
185
|
+
const shots = raw.shots.map((shot, index) => {
|
|
186
|
+
if (shot.recipeId !== 'scene') throw new Error('不支持的场景类型:' + shot.recipeId)
|
|
187
|
+
if (shot.recipeId === 'scene' && (typeof shot.sceneSource !== 'string' || shot.sceneSource.length < 20 || shot.sceneSource.length > 100000)) throw new Error('场景源码需要 20–100000 字符')
|
|
188
|
+
if (shot.sceneComponents !== undefined && (!Array.isArray(shot.sceneComponents) || shot.sceneComponents.length > 12)) throw new Error('每个镜头最多 12 个场景组件')
|
|
189
|
+
const componentIds = new Set()
|
|
190
|
+
const sceneComponents = (shot.sceneComponents || []).map((component) => {
|
|
191
|
+
if (!component || !/^[A-Z][A-Za-z0-9]{0,47}$/.test(component.id) || componentIds.has(component.id)) throw new Error('场景组件名称无效或重复')
|
|
192
|
+
if (typeof component.source !== 'string' || component.source.length < 20 || component.source.length > 100000) throw new Error('组件源码需要 20–100000 字符')
|
|
193
|
+
componentIds.add(component.id)
|
|
194
|
+
return { id: component.id, description: String(component.description || '').slice(0, 4000), source: component.source }
|
|
195
|
+
})
|
|
196
|
+
const start = Number(shot.startFrame), duration = Number(shot.durationFrames)
|
|
197
|
+
if (!Number.isInteger(start) || !Number.isInteger(duration) || start < 0 || duration < 1 || start + duration > total) throw new Error('镜头时间超出成片范围')
|
|
198
|
+
// A linked shot card is a motion constraint, never an image asset. Recover
|
|
199
|
+
// this unambiguous director mistake while still rejecting fabricated IDs.
|
|
200
|
+
const refs = (Array.isArray(shot.referenceIds) ? [...new Set(shot.referenceIds)] : [])
|
|
201
|
+
.filter((id) => !['shotcard','audio'].includes(input.refs.find((ref) => ref.id === id)?.role))
|
|
202
|
+
if (refs.some((id) => !ids.has(id) || !['material', 'layout'].includes(input.refs.find((ref) => ref.id === id).role))) throw new Error('镜头引用了不存在或仅供参考的素材')
|
|
203
|
+
return { id: 'shot-' + (index + 1), recipeId: shot.recipeId, recipeVersion: 1, startFrame: start, durationFrames: duration,
|
|
204
|
+
...(shot.recipeId === 'scene' ? { sceneSource: shot.sceneSource, ...(sceneComponents.length ? { sceneComponents } : {}), cardId: String(shot.cardId || ''), demo: String(shot.demo || ''), motionCards: Array.isArray(shot.motionCards) ? motionClone(shot.motionCards) : [], fidelity: Array.isArray(shot.fidelity) ? motionClone(shot.fidelity) : [], description: String(shot.description || '').slice(0, 2000) } : {}),
|
|
205
|
+
referenceIds: refs, title: String(shot.title || '').slice(0, 300), subtitle: String(shot.subtitle || '').slice(0, 600),
|
|
206
|
+
background: color(shot.background, '#101827'), color: color(shot.color, '#ffffff'), accent: color(shot.accent, '#8b9dff') }
|
|
207
|
+
}).sort((a, b) => a.startFrame - b.startFrame)
|
|
208
|
+
let end = 0
|
|
209
|
+
for (const shot of shots) { if (shot.startFrame !== end) throw new Error('分镜必须连续且不能重叠'); end += shot.durationFrames }
|
|
210
|
+
if (end !== total) throw new Error('分镜总时长必须等于视频时长')
|
|
211
|
+
if (raw.production && (typeof raw.production !== 'object' || Array.isArray(raw.production) || JSON.stringify(raw.production).length > 100000)) throw new Error('制作记录无效或过大')
|
|
212
|
+
return { version: MOTION_VERSION, ...(raw.production ? { production: motionClone(raw.production) } : {}), width: input.settings.width, height: input.settings.height,
|
|
213
|
+
fps: input.settings.fps, durationFrames: total, shots,...(raw.audio?{audio:validateAudioTimeline(raw.audio,{fps:input.settings.fps,durationFrames:total,shots},input)}:{}) }
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
export function assertMotionEditable(doc, nodeId) {
|
|
217
|
+
const node = doc.nodes.find((item) => item.id === nodeId)
|
|
218
|
+
if (!node) throw new Error('目标视频已删除,成片保留在任务历史')
|
|
219
|
+
const seen = new Set()
|
|
220
|
+
for (let item = node; item; item = doc.nodes.find((n) => n.id === item.parent)) {
|
|
221
|
+
if (seen.has(item.id)) throw new Error('分组结构无效')
|
|
222
|
+
seen.add(item.id)
|
|
223
|
+
if (item.locked || /(?:^|;)locked=1(?:;|$)/.test(item.style || '') || (doc.layers || []).find((layer) => layer.id === (item.layer || doc.layers?.[0]?.id))?.locked) throw new Error('节点或图层已锁定,成片保留在任务历史')
|
|
224
|
+
}
|
|
225
|
+
return node
|
|
226
|
+
}
|
|
227
|
+
|
|
228
|
+
export function applyMotionResult(doc, job, result) {
|
|
229
|
+
const node = assertMotionEditable(doc, job.nodeId)
|
|
230
|
+
if (node.data.motion?.lastJobId === job.id) return node
|
|
231
|
+
if (node.data.motion?.requestId !== job.id || motionInputKey(motionInput(doc, node.id)) !== job.inputKey) throw new Error('描述或参考已变化,成片保留在任务历史')
|
|
232
|
+
const motion = node.data.motion
|
|
233
|
+
node.data = { ...node.data, ...result.data, motion: { ...motion, lastJobId: job.id,
|
|
234
|
+
composition: motionClone(result.composition), inputKey: job.inputKey,
|
|
235
|
+
results: [{ jobId: job.id, clip: result.data.mediaClip }, ...(Array.isArray(motion.results) ? motion.results : [])].slice(0, 12) } }
|
|
236
|
+
node.style = result.style
|
|
237
|
+
return node
|
|
238
|
+
}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
/* 由 tools/build.mjs 生成 —— 请勿直接编辑;改 src/ 下的源文件。 */
|
|
2
|
+
import {mkdirSync,readFileSync,readdirSync,writeFileSync} from 'node:fs'
|
|
3
|
+
import {join} from 'node:path'
|
|
4
|
+
import {execFile} from 'node:child_process'
|
|
5
|
+
import {promisify} from 'node:util'
|
|
6
|
+
import {ffmpegBinary} from './video-export.js'
|
|
7
|
+
import {agentHash,agentAtomicJson} from './motion-agent-files.js'
|
|
8
|
+
import {streamAgentTurn,agentMessage} from './motion-agent-protocol.js'
|
|
9
|
+
const exec=promisify(execFile)
|
|
10
|
+
const run=(args,signal)=>exec(ffmpegBinary(),['-hide_banner','-nostdin',...args],{windowsHide:true,signal,timeout:180000,maxBuffer:8*1024*1024})
|
|
11
|
+
|
|
12
|
+
// Decode the actual delivered file, including its final mixed audio. Visual
|
|
13
|
+
// semantics use ordered contact sheets; listening is a separate human verdict.
|
|
14
|
+
export async function inspectMotionFilm({packDir,composition,signal,reviewSequence,expectedAudio=false,previousMotion}){
|
|
15
|
+
const source=join(packDir,'source.mp4'),sha256=agentHash(readFileSync(source)),directory=join(packDir,'film-review',sha256.slice(0,16))
|
|
16
|
+
mkdirSync(directory,{recursive:true})
|
|
17
|
+
const decoded=await run(['-xerror','-i',source,'-map','0:v:0','-vf','blackdetect=d=0.12:pix_th=0.02,freezedetect=n=-50dB:d=0.35','-an','-progress','pipe:1','-f','null','-'],signal)
|
|
18
|
+
const log=decoded.stderr,frames=Number([...decoded.stdout.matchAll(/^frame=(\d+)/gm)].at(-1)?.[1])
|
|
19
|
+
const durationMatch=/Duration:\s*(\d+):(\d+):([\d.]+)/.exec(log)
|
|
20
|
+
if(!durationMatch||!frames)throw Error('成片无法完整解码')
|
|
21
|
+
const duration=Number(durationMatch[1])*3600+Number(durationMatch[2])*60+Number(durationMatch[3]),expected=composition.durationFrames/composition.fps
|
|
22
|
+
if(Math.abs(duration-expected)>Math.max(.12,2/composition.fps)||Math.abs(frames-composition.durationFrames)>1)throw Error('成片时长或帧数与工程不一致')
|
|
23
|
+
const warnings=[]
|
|
24
|
+
for(const match of log.matchAll(/black_start:([\d.]+) black_end:([\d.]+) black_duration:([\d.]+)/g))warnings.push({kind:'black',from:Number(match[1]),to:Number(match[2]),note:'可能为设计留黑,需结合画面判断'})
|
|
25
|
+
for(const match of log.matchAll(/freeze_start: ([\d.]+)/g))warnings.push({kind:'freeze',from:Number(match[1]),note:'可能为有意停留,需结合分镜判断'})
|
|
26
|
+
let audio={hasAudio:/Stream .*Audio:/.test(log),listening:'not-performed'}
|
|
27
|
+
if(expectedAudio&&!audio.hasAudio)throw Error('声音时间表非空,但最终视频缺少音轨')
|
|
28
|
+
if(audio.hasAudio){
|
|
29
|
+
const measured=await run(['-i',source,'-map','0:a:0','-vn','-af','ebur128=peak=true,silencedetect=noise=-50dB:d=0.4','-f','null','-'],signal)
|
|
30
|
+
const summary=measured.stderr.slice(measured.stderr.lastIndexOf('Summary:'))
|
|
31
|
+
const value=(pattern)=>{const text=pattern.exec(summary)?.[1];return text&&Number.isFinite(Number(text))?Number(text):null}
|
|
32
|
+
audio={...audio,integratedLufs:value(/I:\s*(-?[\d.]+) LUFS/),truePeakDb:value(/Peak:\s*(-?[\d.]+) dBFS/),
|
|
33
|
+
silence:[...measured.stderr.matchAll(/silence_start: ([\d.]+)/g)].map(m=>Number(m[1]))}
|
|
34
|
+
if(audio.truePeakDb!==null&&audio.truePeakDb>-.1)warnings.push({kind:'audio-peak',note:'真峰值接近或超过0 dBFS,请试听失真'})
|
|
35
|
+
if(audio.integratedLufs!==null&&audio.integratedLufs<-50)warnings.push({kind:'audio-silence',note:'整片音轨近乎静音,请核对声音需求'})
|
|
36
|
+
writeFileSync(join(directory,'audio-analysis.log'),measured.stderr)
|
|
37
|
+
}
|
|
38
|
+
const samplingFps=6,panelSeconds=12/samplingFps
|
|
39
|
+
await run(['-y','-i',source,'-an','-vf',`fps=${samplingFps},scale=320:-2,tile=4x3:padding=2:margin=2`,'-fps_mode','vfr',join(directory,'sequence-%03d.png')],signal)
|
|
40
|
+
const sheets=readdirSync(directory).filter(name=>/^sequence-\d+\.png$/.test(name)).sort().map((filename,index)=>({filename,from:index*panelSeconds,to:Math.min(duration,(index+1)*panelSeconds),
|
|
41
|
+
times:Array.from({length:Math.min(12,Math.ceil((duration-index*panelSeconds)*samplingFps))},(_,j)=>(index*12+j)/samplingFps)}))
|
|
42
|
+
const sequences=[]
|
|
43
|
+
for(const sheet of sheets){
|
|
44
|
+
signal?.throwIfAborted()
|
|
45
|
+
if(previousMotion||!reviewSequence){sequences.push({...sheet,status:'unavailable',reason:'未配置支持图片的时序审查模型'});continue}
|
|
46
|
+
try{
|
|
47
|
+
const result=await reviewSequence({file:join(directory,sheet.filename),sheet,composition,warnings:warnings.filter(w=>w.from===undefined||w.from>=sheet.from&&w.from<=sheet.to)})
|
|
48
|
+
if(!['passed','changes-requested','unavailable'].includes(result?.status))throw Error('时序审查响应状态无效')
|
|
49
|
+
sequences.push({...sheet,...result})
|
|
50
|
+
}catch(error){if(signal?.aborted)throw error;sequences.push({...sheet,status:'unavailable',reason:error.message})}
|
|
51
|
+
}
|
|
52
|
+
const motion=previousMotion||{status:sequences.some(s=>s.status==='changes-requested')?'changes-requested':sequences.some(s=>s.status!=='passed')?'unavailable':'passed',
|
|
53
|
+
coverage:'whole-film-ordered-samples',samplingFps,note:'覆盖全片的有序采样;不等于每帧运动或完整视频感知验收',sequences}
|
|
54
|
+
const result={version:1,sha256,duration,decodedFrames:frames,decode:'passed',motion,audio,warnings,
|
|
55
|
+
manual:{status:'pending',motion:'pending',sound:audio.hasAudio?'pending':'not-applicable'},directory,createdAt:new Date().toISOString()}
|
|
56
|
+
writeFileSync(join(directory,'decode.log'),log)
|
|
57
|
+
agentAtomicJson(join(directory,'report.json'),result)
|
|
58
|
+
return result
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export function motionSequenceReviewer({llm,config,attachments,sessionId,signal}){
|
|
62
|
+
return async({file,sheet,composition,warnings})=>{
|
|
63
|
+
const attachment=await attachments.saveImage({data:readFileSync(file),mediaType:'image/png',name:sheet.filename})
|
|
64
|
+
const assistant=await streamAgentTurn({llm,config,sessionId,signal},[agentMessage('user',[{type:'text',text:JSON.stringify({sheet,shots:composition.shots.map(({sceneSource,sceneComponents,...shot})=>shot),warnings})},{type:'image',attachment}])],[],
|
|
65
|
+
'你是独立的视频时序审查员。图片每行从左到右、从上到下按times排列,每秒6帧。检查主体跳变、意外闪烁、跨镜头衔接、文字突然消失和停留节奏。区分有意切镜/静止和缺陷。只输出JSON {"status":"passed或changes-requested","issues":[{"time":秒,"reason":"具体可见问题"}]}。没有音频输入,不判断听感;不声称看到了采样之间的运动。')
|
|
66
|
+
const text=assistant.content.filter(b=>b.type==='text').map(b=>b.text).join('').trim().replace(/^```(?:json)?\s*/,'').replace(/\s*```$/,'')
|
|
67
|
+
const value=JSON.parse(text)
|
|
68
|
+
if(!['passed','changes-requested'].includes(value.status)||!Array.isArray(value.issues))throw Error('时序审查响应无效')
|
|
69
|
+
return {status:value.status,issues:value.issues.slice(0,12)}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
@@ -0,0 +1,210 @@
|
|
|
1
|
+
/* 由 tools/build.mjs 生成 —— 请勿直接编辑;改 src/ 下的源文件。 */
|
|
2
|
+
import { createHash } from 'node:crypto'
|
|
3
|
+
import { existsSync, readFileSync, statSync } from 'node:fs'
|
|
4
|
+
import { posix } from 'node:path'
|
|
5
|
+
import { parse } from '@babel/parser'
|
|
6
|
+
import { resolveShotStyle, shotCardSelections } from './shotcard-core.js'
|
|
7
|
+
import { mgStyleSelection, resolveMgStyle } from './mgstyle-core.js'
|
|
8
|
+
export const shotCardCatalog = JSON.parse(readFileSync(new URL('./motion/shotcraft/catalog.json', import.meta.url), 'utf8'))
|
|
9
|
+
const base = new URL('./motion/shotcraft/upstream/', import.meta.url)
|
|
10
|
+
export const shotcraftLibrary = JSON.parse(readFileSync(new URL('manifest.json', base), 'utf8'))
|
|
11
|
+
export function shotcraftFile(path) {
|
|
12
|
+
if (!Object.hasOwn(shotcraftLibrary.files, path)) throw new Error('未知 Shotcraft 源文件:' + path)
|
|
13
|
+
return readFileSync(new URL(path, base), 'utf8')
|
|
14
|
+
}
|
|
15
|
+
export function shotcraftCatalog() {
|
|
16
|
+
return shotCardCatalog.cards.map((card) => ({ ...card, demos: [...new Set(card.styles.map((style) => style.demo))] }))
|
|
17
|
+
}
|
|
18
|
+
export function shotcraftContext(shots) {
|
|
19
|
+
const chosen = new Set(), documents = []
|
|
20
|
+
function include(path) {
|
|
21
|
+
if (chosen.has(path)) return
|
|
22
|
+
chosen.add(path)
|
|
23
|
+
const source = shotcraftFile(path)
|
|
24
|
+
documents.push({ path, source })
|
|
25
|
+
if (!/\.(tsx?|jsx?)$/.test(path)) return
|
|
26
|
+
const ast = parse(source, { sourceType: 'module', plugins: ['typescript', 'jsx'] })
|
|
27
|
+
for (const node of ast.program.body) {
|
|
28
|
+
if (!['ImportDeclaration', 'ExportNamedDeclaration', 'ExportAllDeclaration'].includes(node.type) || !node.source?.value.startsWith('.')) continue
|
|
29
|
+
const stem = posix.normalize(posix.join(posix.dirname(path), node.source.value))
|
|
30
|
+
const dependency = [stem, stem + '.tsx', stem + '.ts', stem + '.jsx', stem + '.js', stem + '/index.tsx', stem + '/index.ts'].find((candidate) => Object.hasOwn(shotcraftLibrary.files, candidate))
|
|
31
|
+
if (dependency) include(dependency)
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
for (const shot of shots) {
|
|
35
|
+
if (shot.motionCards?.length) {
|
|
36
|
+
for (const selection of shot.motionCards) {
|
|
37
|
+
const resolved = resolveShotStyle(shotCardCatalog, selection.cardId, selection.styleKey)
|
|
38
|
+
include(shotCardCatalog.cards.find((card) => card.id === resolved.cardId).source); include(resolved.demo)
|
|
39
|
+
}
|
|
40
|
+
continue
|
|
41
|
+
}
|
|
42
|
+
if (!shot.cardId) continue
|
|
43
|
+
const card = shotcraftLibrary.cards.find((card) => card.id === shot.cardId)
|
|
44
|
+
if (!card) throw new Error('未知镜头卡:' + shot.cardId)
|
|
45
|
+
if (shot.demo && !card.demos.includes(shot.demo)) throw new Error('镜头卡与参考源码不匹配')
|
|
46
|
+
for (const path of [card.source, ...(shot.demo ? [shot.demo] : card.demos.slice(0, 1))]) {
|
|
47
|
+
include(path)
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
const context = JSON.stringify(documents)
|
|
51
|
+
if (context.length > 300000) throw new Error('参考源码过多,请减少镜头或参考变体')
|
|
52
|
+
return documents
|
|
53
|
+
}
|
|
54
|
+
export function shotcraftModuleMap() {
|
|
55
|
+
return Object.fromEntries(Object.keys(shotcraftLibrary.files).filter((path) => /^(assets\/lib|demos)\/.+\.(tsx?|jsx?)$/.test(path))
|
|
56
|
+
.map((path) => ['@shotcraft/' + path.replace(/^assets\/lib\//, 'lib/').replace(/\.(tsx?|jsx?)$/, ''), new URL(path, base)]))
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export function motionCardContract(selection) {
|
|
60
|
+
const resolved = resolveShotStyle(shotCardCatalog, selection.cardId, selection.styleKey)
|
|
61
|
+
const card = shotCardCatalog.cards.find((item) => item.id === resolved.cardId)
|
|
62
|
+
const recipe = shotcraftFile(card.source)
|
|
63
|
+
const protectedParameters = recipe.split(/(?=^## )/m).filter((section) => /^## (参数表|已知坑|动效核心)/.test(section))
|
|
64
|
+
return { ...resolved, protectedParameters, parametersSha256: createHash('sha256').update(protectedParameters.join('\n')).digest('hex'), cardSource: card.source, demoSha256: shotcraftLibrary.files[resolved.demo],
|
|
65
|
+
recipe, source: shotcraftFile(resolved.demo),
|
|
66
|
+
preservation: '参考准确 demo 的动作顺序、缓动、运镜、遮罩时机、错峰与停留,按需求自由适配源码与内容。30fps 时值按实际 fps 换算;改完用 motion_preview 看帧确认效果。' }
|
|
67
|
+
}
|
|
68
|
+
export function enforceMotionCards(composition, input) {
|
|
69
|
+
if (shotCardCatalog.commit !== shotcraftLibrary.commit) throw new Error('镜头样式索引与源码库版本不匹配')
|
|
70
|
+
const required = shotCardSelections(shotCardCatalog, input)
|
|
71
|
+
const used = new Set()
|
|
72
|
+
for (const shot of composition.shots) {
|
|
73
|
+
let selections = shot.motionCards || []
|
|
74
|
+
if (!selections.length && shot.cardId) {
|
|
75
|
+
const card = shotCardCatalog.cards.find((item) => item.id === shot.cardId)
|
|
76
|
+
if (!card) throw new Error('未知镜头卡:' + shot.cardId)
|
|
77
|
+
const candidates = card.styles.filter((style) => !shot.demo || style.demo === shot.demo)
|
|
78
|
+
if (candidates.length !== 1) throw new Error('镜头卡有多个样式,请指定 motionCards 的 styleKey:' + shot.cardId)
|
|
79
|
+
selections = [{ cardId: card.id, styleKey: candidates[0].key }]
|
|
80
|
+
}
|
|
81
|
+
if (selections.length > 8) throw new Error('单镜最多参考 8 个镜头样式')
|
|
82
|
+
const keys = new Set()
|
|
83
|
+
shot.motionCards = selections.map((item) => {
|
|
84
|
+
const resolved = resolveShotStyle(shotCardCatalog, item.cardId, item.styleKey)
|
|
85
|
+
if (item.demo && item.demo !== resolved.demo) throw new Error('样式与 demo 不匹配')
|
|
86
|
+
const key = resolved.cardId + ':' + resolved.styleKey
|
|
87
|
+
if (keys.has(key)) throw new Error('镜头内重复引用样式:' + key)
|
|
88
|
+
keys.add(key); used.add(key)
|
|
89
|
+
return resolved
|
|
90
|
+
})
|
|
91
|
+
if (shot.motionCards.length) { shot.cardId = shot.motionCards[0].cardId; shot.demo = shot.motionCards[0].demo }
|
|
92
|
+
}
|
|
93
|
+
for (const item of required) if (!used.has(item.cardId + ':' + item.styleKey)) throw new Error('分镜遗漏指定的镜头参考:' + item.label)
|
|
94
|
+
if (used.size) composition.production = { ...composition.production, motionContracts: [...new Map(composition.shots.flatMap((shot) => shot.motionCards)
|
|
95
|
+
.map((item) => [item.cardId + ':' + item.styleKey, motionCardContract(item)])).values()].map(({ source, recipe, protectedParameters, ...item }) => item) }
|
|
96
|
+
return composition
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
// ── mg-styles:14 种整片风格(不是单镜卡;上游 15 支里的 04-3d-render 已移除) ──
|
|
100
|
+
// 上游是「HTML 页 + renderAt(t) + puppeteer 截帧」,这里是「提示词 + 移植 brief + 成片源码」,
|
|
101
|
+
// 供 agent 在 Remotion 里照着写场景。源码只作阅读参考,不进 webpack(和镜头卡不同)。
|
|
102
|
+
|
|
103
|
+
const mgRoot = new URL('./motion/mgstyles/', import.meta.url)
|
|
104
|
+
const mgUpstream = new URL('upstream/', mgRoot)
|
|
105
|
+
const mgReadCache = new Map()
|
|
106
|
+
|
|
107
|
+
export const mgStyleCatalog = JSON.parse(readFileSync(new URL('catalog.json', mgRoot), 'utf8'))
|
|
108
|
+
export const mgStyleLibrary = JSON.parse(readFileSync(new URL('manifest.json', mgUpstream), 'utf8'))
|
|
109
|
+
|
|
110
|
+
function readMg(relative, base = mgUpstream) {
|
|
111
|
+
if (mgReadCache.has(relative)) return mgReadCache.get(relative)
|
|
112
|
+
const source = readFileSync(new URL(relative, base), 'utf8')
|
|
113
|
+
mgReadCache.set(relative, source)
|
|
114
|
+
return source
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
export function mgStyleFile(path) {
|
|
118
|
+
if (!Object.hasOwn(mgStyleLibrary.files, path)) throw new Error('未知 mg 风格源文件:' + path)
|
|
119
|
+
return readMg(path)
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export function mgStyleFileSize(path) {
|
|
123
|
+
if (!Object.hasOwn(mgStyleLibrary.files, path)) throw new Error('未知 mg 风格源文件:' + path)
|
|
124
|
+
return statSync(new URL(path, mgUpstream)).size
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
export function mgStyleBrief(slug) {
|
|
128
|
+
const style = resolveMgStyle(mgStyleCatalog, slug)
|
|
129
|
+
let source
|
|
130
|
+
try { source = readMg(style.brief, mgRoot) } catch {
|
|
131
|
+
throw new Error('风格 ' + slug + ' 还没有移植 brief(' + style.brief + '),先读提示词与上游源码:' + style.prompt)
|
|
132
|
+
}
|
|
133
|
+
return { slug: style.slug, path: style.brief, source, sha256: createHash('sha256').update(source).digest('hex') }
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
export function mgStylePrompt(slug) {
|
|
137
|
+
const style = resolveMgStyle(mgStyleCatalog, slug)
|
|
138
|
+
const source = mgStyleFile(style.prompt)
|
|
139
|
+
return { slug: style.slug, path: style.prompt, source, sha256: createHash('sha256').update(source).digest('hex') }
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/**
|
|
143
|
+
* 上游成片源码,按「最可能被抄的优先」排序:film.js / main.js / scene.js / index.html 先来,
|
|
144
|
+
* 其余 js 其次,json 最后。单文件截断 60k 字符,总量截断 200k —— brief 已经提炼过,
|
|
145
|
+
* 源码是补充细节用的,不该把上下文吃光。
|
|
146
|
+
*/
|
|
147
|
+
export function mgStyleSources(slug, { limit = 200000 } = {}) {
|
|
148
|
+
const style = resolveMgStyle(mgStyleCatalog, slug)
|
|
149
|
+
const rank = (path) => {
|
|
150
|
+
const name = posix.basename(path)
|
|
151
|
+
if (/^(film|main|scene|index)\.(m?js|html)$/.test(name)) return 0
|
|
152
|
+
if (/\.(m?js|html)$/.test(name)) return 1
|
|
153
|
+
if (/\.css$/.test(name)) return 2
|
|
154
|
+
return 3
|
|
155
|
+
}
|
|
156
|
+
const paths = Object.keys(mgStyleLibrary.files).filter((path) => path.startsWith('demos/' + slug + '/')).sort((a, b) => rank(a) - rank(b) || a.localeCompare(b))
|
|
157
|
+
const documents = []
|
|
158
|
+
let total = 0
|
|
159
|
+
for (const path of paths) {
|
|
160
|
+
if (total >= limit) break
|
|
161
|
+
const source = readMg(path)
|
|
162
|
+
const slice = source.length > 60000 ? source.slice(0, 60000) + '\n/* …截断:' + (source.length - 60000) + ' 字符未显示,需要时用 mg_style action:"read" files:["' + path + '"]… */' : source
|
|
163
|
+
documents.push({ path, chars: source.length, source: slice })
|
|
164
|
+
total += slice.length
|
|
165
|
+
}
|
|
166
|
+
return documents
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
/** 一个风格的完整「施工包」:判据 + 色板 + 字体 + 节奏 + 提示词 + brief。 */
|
|
170
|
+
export function mgStyleKit(selection) {
|
|
171
|
+
const style = resolveMgStyle(mgStyleCatalog, selection.slug)
|
|
172
|
+
const brief = mgStyleBrief(selection.slug)
|
|
173
|
+
const prompt = mgStylePrompt(selection.slug)
|
|
174
|
+
return {
|
|
175
|
+
...style,
|
|
176
|
+
brief: brief.source,
|
|
177
|
+
briefSha256: brief.sha256,
|
|
178
|
+
promptSource: prompt.source,
|
|
179
|
+
promptSha256: prompt.sha256,
|
|
180
|
+
demos: style.demos,
|
|
181
|
+
preservation: 'brief 是这个风格的移植说明书;引擎以 engines 为准 —— three.js / WebGL2 必须真跑同一套引擎,不许用 CSS 3D、div 层叠或 Canvas2D 渐变简化替代(motion_render 启动前会扫工程源码拦截)。判据(signature)比形容词重要:做不出判据就不算这个风格。',
|
|
182
|
+
}
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
/** 把选中的风格织进 composition:固定 palette/字体/节奏,并把 brief 摘要留在 production 里备查。 */
|
|
186
|
+
export function enforceMgStyle(composition, input) {
|
|
187
|
+
if (mgStyleCatalog.commit !== mgStyleLibrary.commit) throw new Error('mg 风格索引与源码库版本不匹配')
|
|
188
|
+
const selection = mgStyleSelection(mgStyleCatalog, input)
|
|
189
|
+
if (!selection) return composition
|
|
190
|
+
const kit = mgStyleKit(selection)
|
|
191
|
+
composition.production = {
|
|
192
|
+
...composition.production,
|
|
193
|
+
mgStyle: {
|
|
194
|
+
slug: kit.slug,
|
|
195
|
+
name: kit.name,
|
|
196
|
+
commit: kit.commit,
|
|
197
|
+
nodeId: selection.nodeId,
|
|
198
|
+
palette: kit.palette,
|
|
199
|
+
fonts: kit.fonts,
|
|
200
|
+
rhythm: kit.rhythm,
|
|
201
|
+
signature: kit.signature,
|
|
202
|
+
brief: kit.brief,
|
|
203
|
+
briefSha256: kit.briefSha256,
|
|
204
|
+
promptSha256: kit.promptSha256,
|
|
205
|
+
demos: kit.demos,
|
|
206
|
+
preservation: kit.preservation,
|
|
207
|
+
},
|
|
208
|
+
}
|
|
209
|
+
return composition
|
|
210
|
+
}
|