dsh-hyperframes 0.3.1 → 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/README.en.md +6 -5
- package/README.md +7 -6
- package/lib/index.d.ts +1 -1
- package/lib/index.js +1 -0
- package/package.json +63 -63
- package/skills/embedded-captions/SKILL.md +28 -3
- package/skills/embedded-captions/references/aesthetic-principles.md +2 -3
- package/skills/embedded-captions/references/rail.md +1 -1
- package/skills/embedded-captions/scripts/check-occlusion.cjs +4 -1
- package/skills/embedded-captions/scripts/check-overflow.cjs +1 -0
- package/skills/embedded-captions/scripts/check-rail-climax.cjs +5 -1
- package/skills/embedded-captions/scripts/fixtures/heroless/theme.json +11 -0
- package/skills/embedded-captions/scripts/hf-cli.cjs +33 -0
- package/skills/embedded-captions/scripts/make-theme.cjs +95 -57
- package/skills/embedded-captions/scripts/make-theme.test.mjs +131 -0
- package/skills/embedded-captions/scripts/matte.cjs +1 -13
- package/skills/embedded-captions/scripts/measure-layout.cjs +2 -1
- package/skills/embedded-captions/scripts/preview-frames.cjs +39 -11
- package/skills/embedded-captions/scripts/preview-frames.test.mjs +24 -0
- package/skills/embedded-captions/scripts/render-and-composite.sh +8 -52
- package/skills/embedded-captions/scripts/safe-zones.cjs +4 -1
- package/skills/embedded-captions/scripts/transcribe.cjs +5 -14
- package/skills/embedded-captions/scripts/transcribe.test.mjs +41 -0
- package/skills/faceless-explainer/SKILL.md +20 -16
- package/skills/faceless-explainer/references/story-design.md +1 -1
- package/skills/faceless-explainer/scripts/assemble-index.mjs +6 -4
- package/skills/faceless-explainer/scripts/assemble-index.test.mjs +57 -2
- package/skills/faceless-explainer/scripts/audio.mjs +2 -0
- package/skills/faceless-explainer/scripts/build-frame.mjs +6 -3
- package/skills/faceless-explainer/scripts/captions.mjs +7 -4
- package/skills/faceless-explainer/scripts/frame-packets.mjs +4 -4
- package/skills/faceless-explainer/scripts/lib/bgm-volume.mjs +4 -0
- package/skills/faceless-explainer/scripts/lib/captured-fonts.mjs +58 -0
- package/skills/{hyperframes-core → faceless-explainer}/scripts/lib/frame-packets-core.mjs +5 -23
- package/skills/faceless-explainer/scripts/lib/storyboard.mjs +1 -1
- package/skills/faceless-explainer/scripts/lib/transitions.json +3 -3
- package/skills/faceless-explainer/scripts/transitions.mjs +1 -0
- package/skills/faceless-explainer/scripts/transitions.test.mjs +2 -0
- package/skills/faceless-explainer/sub-agents/frame-worker.md +1 -1
- package/skills/figma/SKILL.md +2 -0
- package/skills/general-video/SKILL.md +13 -11
- package/skills/general-video/scripts/frame-packets.mjs +4 -4
- package/skills/general-video/scripts/lib/frame-packets-core.mjs +194 -0
- package/skills/general-video/sub-agents/frame-worker.md +1 -1
- package/skills/hyperframes/SKILL.md +40 -30
- package/skills/{hyperframes-core → hyperframes}/references/brief-contract.md +15 -15
- package/skills/{hyperframes-core → hyperframes}/references/brief-format.md +8 -8
- package/skills/hyperframes/references/capability-menu.md +2 -2
- package/skills/{hyperframes-core → hyperframes}/references/frame-worker-core.md +1 -1
- package/skills/hyperframes/references/intent-interview.md +16 -16
- package/skills/hyperframes/references/plugin-installation.md +43 -0
- package/skills/{hyperframes-core → hyperframes}/references/production-loop.md +11 -11
- package/skills/hyperframes/references/review-loop.md +37 -0
- package/skills/hyperframes/references/route-briefs.md +1 -1
- package/skills/hyperframes/references/routes/motion-graphics.md +1 -1
- package/skills/{hyperframes-core → hyperframes}/references/script-format.md +3 -3
- package/skills/hyperframes/references/skill-lifecycle.md +2 -0
- package/skills/{hyperframes-core → hyperframes}/references/storyboard-format.md +3 -34
- package/skills/hyperframes/scripts/lib/frame-packets-core.mjs +194 -0
- package/skills/hyperframes/scripts/plugin-cli.mjs +88 -0
- package/skills/hyperframes/scripts/plugin-cli.test.mjs +117 -0
- package/skills/hyperframes-animation/SKILL.md +5 -1
- package/skills/hyperframes-animation/adapters/gsap.md +1 -1
- package/skills/hyperframes-animation/adapters/lottie.md +15 -2
- package/skills/hyperframes-animation/adapters/three.md +14 -0
- package/skills/hyperframes-animation/blueprints/titlecard-reveal.md +1 -1
- package/skills/hyperframes-animation/references/motion-blur.md +133 -0
- package/skills/hyperframes-animation/rules/cursor-click-ripple.md +1 -1
- package/skills/hyperframes-animation/rules/dynamic-content-sequencing.md +1 -1
- package/skills/hyperframes-animation/rules/hacker-flip-3d.md +1 -1
- package/skills/hyperframes-animation/rules/kinetic-beat-slam.md +2 -2
- package/skills/hyperframes-animation/rules/motion-blur-streak.md +1 -1
- package/skills/hyperframes-animation/rules/vertical-spring-ticker.md +1 -1
- package/skills/hyperframes-animation/scripts/package-loader.mjs +47 -16
- package/skills/hyperframes-animation/scripts/package-loader.test.mjs +52 -0
- package/skills/hyperframes-animation/techniques.md +1 -1
- package/skills/hyperframes-animation/transitions/TRANSITION-REGISTRY.md +3 -3
- package/skills/hyperframes-animation/transitions/css-push.md +4 -4
- package/skills/hyperframes-audio/SKILL.md +30 -22
- package/skills/hyperframes-audio/scripts/carve.mjs +6 -3
- package/skills/hyperframes-audio/scripts/carve.test.mjs +16 -1
- package/skills/hyperframes-cli/SKILL.md +44 -35
- package/skills/hyperframes-cli/references/init-and-scaffold.md +8 -6
- package/skills/hyperframes-cli/references/lint-validate-inspect.md +3 -3
- package/skills/hyperframes-cli/references/preview-render.md +35 -32
- package/skills/hyperframes-cli/references/upgrade-info-misc.md +50 -1
- package/skills/hyperframes-core/SKILL.md +30 -24
- package/skills/hyperframes-core/references/composition-patterns.md +3 -42
- package/skills/hyperframes-core/references/creator-editing-recipes.md +131 -7
- package/skills/hyperframes-core/references/data-attributes.md +11 -11
- package/skills/hyperframes-core/references/determinism-rules.md +2 -19
- package/skills/hyperframes-core/references/full-screen-motion.md +0 -9
- package/skills/hyperframes-core/references/minimal-composition.md +2 -2
- package/skills/hyperframes-core/references/sub-compositions.md +3 -66
- package/skills/hyperframes-core/references/tailwind.md +1 -20
- package/skills/hyperframes-core/references/tracks-and-clips.md +2 -6
- package/skills/hyperframes-core/references/variables-and-media.md +3 -3
- package/skills/hyperframes-creative/SKILL.md +2 -0
- package/skills/hyperframes-creative/references/house-style.md +15 -15
- package/skills/hyperframes-creative/references/story-spine.md +3 -1
- package/skills/hyperframes-creative/references/storyboard-recipe.md +57 -0
- package/skills/hyperframes-creative/references/typography.md +1 -1
- package/skills/hyperframes-creative/scripts/package-loader.mjs +47 -16
- package/skills/hyperframes-creative/scripts/package-loader.test.mjs +52 -0
- package/skills/hyperframes-keyframes/SKILL.md +4 -2
- package/skills/hyperframes-registry/SKILL.md +3 -1
- package/skills/hyperframes-registry/references/contributing.md +8 -2
- package/skills/hyperframes-registry/references/discovery.md +20 -34
- package/skills/hyperframes-studio/SKILL.md +77 -0
- package/skills/media-use/SKILL.md +14 -12
- package/skills/media-use/audio/references/captions/authoring.md +4 -0
- package/skills/media-use/audio/references/remove-background.md +1 -1
- package/skills/media-use/audio/references/tts-to-captions.md +11 -2
- package/skills/media-use/audio/references/tts.md +84 -6
- package/skills/media-use/audio/scripts/audio.mjs +15 -6
- package/skills/media-use/audio/scripts/gemini-pipeline.test.mjs +113 -0
- package/skills/media-use/audio/scripts/lib/audio-meta.mjs +39 -0
- package/skills/media-use/audio/scripts/lib/audio-meta.test.mjs +136 -0
- package/skills/media-use/audio/scripts/lib/bgm-volume.mjs +4 -0
- package/skills/media-use/audio/scripts/lib/bgm.mjs +2 -6
- package/skills/media-use/audio/scripts/lib/gemini-auth.mjs +43 -0
- package/skills/media-use/audio/scripts/lib/gemini-auth.py +52 -0
- package/skills/media-use/audio/scripts/lib/gemini-auth.test.mjs +86 -0
- package/skills/media-use/audio/scripts/lib/gemini-auth_test.py +90 -0
- package/skills/media-use/audio/scripts/lib/gemini-tts.mjs +122 -0
- package/skills/media-use/audio/scripts/lib/gemini-tts.test.mjs +243 -0
- package/skills/media-use/audio/scripts/lib/heygen.mjs +2 -1
- package/skills/media-use/audio/scripts/lib/tts.mjs +15 -3
- package/skills/media-use/audio/scripts/wait-bgm.mjs +8 -4
- package/skills/media-use/audio/scripts/wait-bgm.test.mjs +65 -0
- package/skills/media-use/references/audio.md +3 -2
- package/skills/media-use/references/grading.md +7 -7
- package/skills/media-use/references/media-treatment-recipes.md +1 -1
- package/skills/media-use/references/memory.md +2 -2
- package/skills/media-use/references/meta.md +2 -2
- package/skills/media-use/references/operations.md +15 -13
- package/skills/media-use/references/resolve.md +22 -11
- package/skills/media-use/references/setup-providers.md +11 -11
- package/skills/media-use/scripts/audio-duck.mjs +19 -27
- package/skills/media-use/scripts/compatibility.test.mjs +96 -0
- package/skills/media-use/scripts/lib/config-lock.mjs +45 -0
- package/skills/media-use/scripts/lib/duck.mjs +16 -10
- package/skills/media-use/scripts/lib/media-fetch.mjs +85 -0
- package/skills/media-use/scripts/lib/media-home.mjs +20 -0
- package/skills/media-use/scripts/lib/npx-sync.mjs +28 -2
- package/skills/media-use/scripts/lib/prefs-store.mjs +2 -2
- package/skills/media-use/scripts/lib/recipe-store.mjs +2 -2
- package/skills/media-use/scripts/lib/telemetry.mjs +29 -41
- package/skills/media-use/scripts/lib/transcriptCutFade.mjs +21 -0
- package/skills/media-use/scripts/prefs.mjs +1 -1
- package/skills/media-use/scripts/recipe.mjs +1 -1
- package/skills/media-use/scripts/resolve-plugin.test.mjs +62 -0
- package/skills/media-use/scripts/resolve.mjs +27 -1267
- package/skills/media-use/scripts/transcribe.mjs +39 -25
- package/skills/media-use/scripts/transcribe.test.mjs +112 -0
- package/skills/media-use/scripts/transcript-cut.mjs +39 -8
- package/skills/media-use/scripts/transcript-cut.test.mjs +117 -0
- package/skills/motion-graphics/SKILL.md +3 -1
- package/skills/motion-graphics/agents/builder.md +1 -0
- package/skills/motion-graphics/agents/director.md +2 -1
- package/skills/motion-graphics/catalog-map.md +25 -13
- package/skills/motion-graphics/categories/charts/module.md +2 -1
- package/skills/motion-graphics/categories/lower-thirds/module.md +4 -0
- package/skills/motion-graphics/categories/news/module.md +1 -1
- package/skills/motion-graphics/references/motion-vocabulary.md +4 -0
- package/skills/music-to-video/SKILL.md +8 -6
- package/skills/music-to-video/references/montage.md +3 -6
- package/skills/music-to-video/references/motion-primitives/3d-card-flip/index.html +10 -111
- package/skills/music-to-video/references/motion-primitives/3d-card-flip/scene.html +119 -0
- package/skills/music-to-video/references/motion-primitives/bg-flow-field/index.html +11 -284
- package/skills/music-to-video/references/motion-primitives/bg-flow-field/scene.html +294 -0
- package/skills/music-to-video/references/motion-primitives/binary-decrypt/index.html +10 -76
- package/skills/music-to-video/references/motion-primitives/binary-decrypt/scene.html +85 -0
- package/skills/music-to-video/references/motion-primitives/blur-resolve/index.html +10 -52
- package/skills/music-to-video/references/motion-primitives/blur-resolve/scene.html +60 -0
- package/skills/music-to-video/references/motion-primitives/braam-punch/index.html +10 -92
- package/skills/music-to-video/references/motion-primitives/braam-punch/scene.html +100 -0
- package/skills/music-to-video/references/motion-primitives/chromatic-split/index.html +10 -103
- package/skills/music-to-video/references/motion-primitives/chromatic-split/scene.html +111 -0
- package/skills/music-to-video/references/motion-primitives/chrome-sweep/index.html +10 -60
- package/skills/music-to-video/references/motion-primitives/chrome-sweep/scene.html +68 -0
- package/skills/music-to-video/references/motion-primitives/counting-punch/index.html +10 -110
- package/skills/music-to-video/references/motion-primitives/counting-punch/scene.html +119 -0
- package/skills/music-to-video/references/motion-primitives/crash-zoom-in/index.html +10 -112
- package/skills/music-to-video/references/motion-primitives/crash-zoom-in/scene.html +120 -0
- package/skills/music-to-video/references/motion-primitives/datamosh-smear/index.html +10 -121
- package/skills/music-to-video/references/motion-primitives/datamosh-smear/scene.html +131 -0
- package/skills/music-to-video/references/motion-primitives/directional-fill/index.html +10 -90
- package/skills/music-to-video/references/motion-primitives/directional-fill/scene.html +103 -0
- package/skills/music-to-video/references/motion-primitives/dolly-zoom/index.html +10 -94
- package/skills/music-to-video/references/motion-primitives/dolly-zoom/scene.html +102 -0
- package/skills/music-to-video/references/motion-primitives/electric-arc/index.html +10 -100
- package/skills/music-to-video/references/motion-primitives/electric-arc/scene.html +105 -0
- package/skills/music-to-video/references/motion-primitives/flash-cut/index.html +10 -89
- package/skills/music-to-video/references/motion-primitives/flash-cut/scene.html +97 -0
- package/skills/music-to-video/references/motion-primitives/gooey-metaball/index.html +10 -197
- package/skills/music-to-video/references/motion-primitives/gooey-metaball/scene.html +206 -0
- package/skills/music-to-video/references/motion-primitives/hard-cut/index.html +10 -74
- package/skills/music-to-video/references/motion-primitives/hard-cut/scene.html +82 -0
- package/skills/music-to-video/references/motion-primitives/hypercut-whip/index.html +10 -36
- package/skills/music-to-video/references/motion-primitives/hypercut-whip/scene.html +44 -0
- package/skills/music-to-video/references/motion-primitives/iris-open/index.html +10 -61
- package/skills/music-to-video/references/motion-primitives/iris-open/scene.html +69 -0
- package/skills/music-to-video/references/motion-primitives/kinetic-letter-in/index.html +10 -55
- package/skills/music-to-video/references/motion-primitives/kinetic-letter-in/scene.html +64 -0
- package/skills/music-to-video/references/motion-primitives/liquid-morph/index.html +10 -88
- package/skills/music-to-video/references/motion-primitives/liquid-morph/scene.html +96 -0
- package/skills/music-to-video/references/motion-primitives/mask-reveal/index.html +10 -66
- package/skills/music-to-video/references/motion-primitives/mask-reveal/scene.html +74 -0
- package/skills/music-to-video/references/motion-primitives/mosaic-pack/index.html +10 -81
- package/skills/music-to-video/references/motion-primitives/mosaic-pack/scene.html +89 -0
- package/skills/music-to-video/references/motion-primitives/neon-flicker/index.html +10 -65
- package/skills/music-to-video/references/motion-primitives/neon-flicker/scene.html +73 -0
- package/skills/music-to-video/references/motion-primitives/outline-to-fill/index.html +10 -74
- package/skills/music-to-video/references/motion-primitives/outline-to-fill/scene.html +82 -0
- package/skills/music-to-video/references/motion-primitives/palette-flip/index.html +10 -89
- package/skills/music-to-video/references/motion-primitives/palette-flip/scene.html +97 -0
- package/skills/music-to-video/references/motion-primitives/particle-burst/index.html +10 -98
- package/skills/music-to-video/references/motion-primitives/particle-burst/scene.html +106 -0
- package/skills/music-to-video/references/motion-primitives/pixel-dissolve/index.html +10 -78
- package/skills/music-to-video/references/motion-primitives/pixel-dissolve/scene.html +86 -0
- package/skills/music-to-video/references/motion-primitives/radial-burst-lines/index.html +10 -117
- package/skills/music-to-video/references/motion-primitives/radial-burst-lines/scene.html +130 -0
- package/skills/music-to-video/references/motion-primitives/screen-shake/index.html +10 -70
- package/skills/music-to-video/references/motion-primitives/screen-shake/scene.html +78 -0
- package/skills/music-to-video/references/motion-primitives/slot-machine-reveal/index.html +10 -87
- package/skills/music-to-video/references/motion-primitives/slot-machine-reveal/scene.html +100 -0
- package/skills/music-to-video/references/motion-primitives/spotlight-sweep/index.html +10 -94
- package/skills/music-to-video/references/motion-primitives/spotlight-sweep/scene.html +102 -0
- package/skills/music-to-video/references/motion-primitives/staggered-exit/index.html +10 -74
- package/skills/music-to-video/references/motion-primitives/staggered-exit/scene.html +82 -0
- package/skills/music-to-video/references/motion-primitives/text-spectral-rays/index.html +11 -271
- package/skills/music-to-video/references/motion-primitives/text-spectral-rays/scene.html +280 -0
- package/skills/music-to-video/references/motion-primitives/text-wave-distort/index.html +10 -92
- package/skills/music-to-video/references/motion-primitives/text-wave-distort/scene.html +106 -0
- package/skills/music-to-video/references/motion-primitives/tile-mosaic/index.html +10 -101
- package/skills/music-to-video/references/motion-primitives/tile-mosaic/scene.html +109 -0
- package/skills/music-to-video/references/motion-primitives/typewriter-reveal/index.html +10 -79
- package/skills/music-to-video/references/motion-primitives/typewriter-reveal/scene.html +91 -0
- package/skills/music-to-video/references/motion-primitives/word-grid-burst/index.html +10 -83
- package/skills/music-to-video/references/motion-primitives/word-grid-burst/scene.html +96 -0
- package/skills/music-to-video/references/planning.md +2 -2
- package/skills/music-to-video/scripts/lib/storyboard.mjs +1 -1
- package/skills/music-to-video/sub-agents/frame-worker.md +2 -2
- package/skills/pr-to-video/SKILL.md +20 -16
- package/skills/pr-to-video/references/code-vocabulary.md +14 -12
- package/skills/pr-to-video/references/story-design.md +1 -1
- package/skills/pr-to-video/scripts/assemble-index.mjs +6 -4
- package/skills/pr-to-video/scripts/assemble-index.test.mjs +57 -2
- package/skills/pr-to-video/scripts/audio.mjs +2 -0
- package/skills/pr-to-video/scripts/build-frame.mjs +6 -3
- package/skills/pr-to-video/scripts/captions.mjs +7 -4
- package/skills/pr-to-video/scripts/captions.test.mjs +41 -0
- package/skills/pr-to-video/scripts/frame-packets.mjs +4 -4
- package/skills/pr-to-video/scripts/lib/bgm-volume.mjs +4 -0
- package/skills/pr-to-video/scripts/lib/captured-fonts.mjs +58 -0
- package/skills/pr-to-video/scripts/lib/frame-packets-core.mjs +194 -0
- package/skills/pr-to-video/scripts/lib/storyboard.mjs +1 -1
- package/skills/pr-to-video/scripts/lib/transitions.json +3 -3
- package/skills/pr-to-video/scripts/transitions.mjs +7 -5
- package/skills/pr-to-video/sub-agents/frame-worker.md +1 -1
- package/skills/product-launch-video/SKILL.md +20 -16
- package/skills/product-launch-video/references/story-design.md +1 -1
- package/skills/product-launch-video/scripts/assemble-index.mjs +6 -4
- package/skills/product-launch-video/scripts/assemble-index.test.mjs +57 -2
- package/skills/product-launch-video/scripts/audio.mjs +2 -0
- package/skills/product-launch-video/scripts/audio.test.mjs +16 -0
- package/skills/product-launch-video/scripts/build-frame-subsets.test.mjs +152 -0
- package/skills/product-launch-video/scripts/build-frame.mjs +6 -3
- package/skills/product-launch-video/scripts/captions.mjs +7 -4
- package/skills/product-launch-video/scripts/frame-packets.mjs +4 -4
- package/skills/product-launch-video/scripts/lib/bgm-volume.mjs +4 -0
- package/skills/product-launch-video/scripts/lib/captured-fonts.mjs +58 -0
- package/skills/product-launch-video/scripts/lib/frame-packets-core.mjs +194 -0
- package/skills/product-launch-video/scripts/lib/storyboard.mjs +1 -1
- package/skills/product-launch-video/scripts/lib/transitions.json +3 -3
- package/skills/product-launch-video/scripts/transitions.mjs +7 -5
- package/skills/product-launch-video/scripts/transitions.test.mjs +68 -0
- package/skills/product-launch-video/sub-agents/frame-worker.md +1 -1
- package/skills/remotion-to-hyperframes/SKILL.md +7 -4
- package/skills/remotion-to-hyperframes/assets/test-corpus/tier-1-title-card/expected.json +5 -5
- package/skills/remotion-to-hyperframes/assets/test-corpus/tier-1-title-card/hf-src/compositions/title.html +31 -0
- package/skills/remotion-to-hyperframes/assets/test-corpus/tier-1-title-card/hf-src/index.html +10 -25
- package/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/README.md +8 -8
- package/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/expected.json +9 -9
- package/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/hf-src/compositions/scene-1.html +35 -0
- package/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/hf-src/compositions/scene-2.html +35 -0
- package/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/hf-src/compositions/scene-3.html +36 -0
- package/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/hf-src/index.html +28 -71
- package/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/expected.json +3 -3
- package/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/hf-src/compositions/scene-1.html +52 -0
- package/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/hf-src/compositions/scene-2.html +99 -0
- package/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/hf-src/compositions/scene-3.html +55 -0
- package/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/hf-src/index.html +13 -212
- package/skills/remotion-to-hyperframes/references/api-map.md +16 -16
- package/skills/remotion-to-hyperframes/references/limitations.md +7 -7
- package/skills/remotion-to-hyperframes/references/lottie.md +5 -7
- package/skills/remotion-to-hyperframes/references/media.md +3 -3
- package/skills/remotion-to-hyperframes/references/parameters.md +5 -0
- package/skills/remotion-to-hyperframes/references/sequencing.md +71 -18
- package/skills/slideshow/SKILL.md +4 -1
- package/skills/slideshow/references/standalone-harness.md +0 -3
- package/skills/talking-head-recut/SKILL.md +10 -1
- package/skills/hyperframes-core/references/review-loop.md +0 -41
- package/skills/media-use/scripts/lib/adopt.mjs +0 -128
- package/skills/media-use/scripts/lib/adopt.test.mjs +0 -95
- package/skills/media-use/scripts/lib/bgm-provider.mjs +0 -20
- package/skills/media-use/scripts/lib/brand-provider.mjs +0 -59
- package/skills/media-use/scripts/lib/bundled-sfx-provider.mjs +0 -108
- package/skills/media-use/scripts/lib/bundled-sfx-provider.test.mjs +0 -85
- package/skills/media-use/scripts/lib/cache.mjs +0 -150
- package/skills/media-use/scripts/lib/candidates.mjs +0 -91
- package/skills/media-use/scripts/lib/candidates.test.mjs +0 -155
- package/skills/media-use/scripts/lib/codex-provider.mjs +0 -161
- package/skills/media-use/scripts/lib/codex-provider.test.mjs +0 -34
- package/skills/media-use/scripts/lib/coverage.test.mjs +0 -117
- package/skills/media-use/scripts/lib/cube-build.mjs +0 -181
- package/skills/media-use/scripts/lib/cube-build.test.mjs +0 -80
- package/skills/media-use/scripts/lib/cube-validate.mjs +0 -198
- package/skills/media-use/scripts/lib/cube-validate.test.mjs +0 -125
- package/skills/media-use/scripts/lib/cutlist.test.mjs +0 -148
- package/skills/media-use/scripts/lib/duck.test.mjs +0 -118
- package/skills/media-use/scripts/lib/error-diffusion.test.mjs +0 -102
- package/skills/media-use/scripts/lib/freeze.mjs +0 -70
- package/skills/media-use/scripts/lib/freeze.test.mjs +0 -46
- package/skills/media-use/scripts/lib/grade-analyzer.mjs +0 -264
- package/skills/media-use/scripts/lib/grade-analyzer.test.mjs +0 -285
- package/skills/media-use/scripts/lib/heygen-cli.mjs +0 -191
- package/skills/media-use/scripts/lib/heygen-cli.test.mjs +0 -301
- package/skills/media-use/scripts/lib/heygen-search.mjs +0 -45
- package/skills/media-use/scripts/lib/heygen-search.test.mjs +0 -49
- package/skills/media-use/scripts/lib/heygen-video-provider.mjs +0 -127
- package/skills/media-use/scripts/lib/heygen-video-provider.test.mjs +0 -344
- package/skills/media-use/scripts/lib/image-provider.mjs +0 -44
- package/skills/media-use/scripts/lib/local-models.mjs +0 -318
- package/skills/media-use/scripts/lib/local-models.test.mjs +0 -220
- package/skills/media-use/scripts/lib/local-run.mjs +0 -78
- package/skills/media-use/scripts/lib/local-run.test.mjs +0 -121
- package/skills/media-use/scripts/lib/logo-provider.mjs +0 -222
- package/skills/media-use/scripts/lib/logo-provider.test.mjs +0 -137
- package/skills/media-use/scripts/lib/ltx-video-provider.mjs +0 -94
- package/skills/media-use/scripts/lib/ltx-video-provider.test.mjs +0 -316
- package/skills/media-use/scripts/lib/lut-preset-provider.mjs +0 -266
- package/skills/media-use/scripts/lib/lut-preset-provider.test.mjs +0 -176
- package/skills/media-use/scripts/lib/manifest.test.mjs +0 -388
- package/skills/media-use/scripts/lib/match.mjs +0 -47
- package/skills/media-use/scripts/lib/mflux-provider.mjs +0 -128
- package/skills/media-use/scripts/lib/mflux-provider.test.mjs +0 -174
- package/skills/media-use/scripts/lib/misses.mjs +0 -49
- package/skills/media-use/scripts/lib/misses.test.mjs +0 -78
- package/skills/media-use/scripts/lib/npx-sync.test.mjs +0 -50
- package/skills/media-use/scripts/lib/parakeet-words.test.mjs +0 -44
- package/skills/media-use/scripts/lib/prefs-store.test.mjs +0 -189
- package/skills/media-use/scripts/lib/probe.mjs +0 -39
- package/skills/media-use/scripts/lib/probe.test.mjs +0 -31
- package/skills/media-use/scripts/lib/providers.mjs +0 -5
- package/skills/media-use/scripts/lib/recipe-store.test.mjs +0 -367
- package/skills/media-use/scripts/lib/registry.mjs +0 -218
- package/skills/media-use/scripts/lib/registry.test.mjs +0 -261
- package/skills/media-use/scripts/lib/search.mjs +0 -24
- package/skills/media-use/scripts/lib/search.test.mjs +0 -32
- package/skills/media-use/scripts/lib/sfx-provider.mjs +0 -23
- package/skills/media-use/scripts/lib/specs.mjs +0 -132
- package/skills/media-use/scripts/lib/specs.test.mjs +0 -157
- package/skills/media-use/scripts/lib/stats.mjs +0 -117
- package/skills/media-use/scripts/lib/stats.test.mjs +0 -165
- package/skills/media-use/scripts/lib/telemetry.test.mjs +0 -373
- package/skills/media-use/scripts/lib/tts-local-provider.mjs +0 -92
- package/skills/media-use/scripts/lib/tts-local-provider.test.mjs +0 -72
- package/skills/media-use/scripts/lib/usage.mjs +0 -57
- package/skills/media-use/scripts/lib/usage.test.mjs +0 -54
- package/skills/media-use/scripts/lib/voice-provider.mjs +0 -57
- package/skills/media-use/scripts/lib/voice-provider.test.mjs +0 -46
- package/skills/media-use/scripts/resolve.test.mjs +0 -1120
- /package/skills/{hyperframes-core → hyperframes}/references/subagent-dispatch.md +0 -0
|
@@ -23,8 +23,24 @@
|
|
|
23
23
|
const path = require("path");
|
|
24
24
|
const fs = require("fs");
|
|
25
25
|
const os = require("os");
|
|
26
|
+
const crypto = require("crypto");
|
|
27
|
+
const { pathToFileURL } = require("url");
|
|
28
|
+
|
|
29
|
+
function sriSha384(source) {
|
|
30
|
+
return `sha384-${crypto.createHash("sha384").update(source).digest("base64")}`;
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function withPreviewGsapSri(html, gsapSource) {
|
|
34
|
+
const integrity = sriSha384(gsapSource);
|
|
35
|
+
return html.replace(/<script\b(?=[^>]*\bsrc=["'][^"']*gsap[^"']*["'])[^>]*>/gi, (tag) =>
|
|
36
|
+
tag
|
|
37
|
+
.replace(/\s+integrity\s*=\s*(?:"[^"]*"|'[^']*')/gi, "")
|
|
38
|
+
.replace(/>$/, ` integrity="${integrity}">`),
|
|
39
|
+
);
|
|
40
|
+
}
|
|
26
41
|
|
|
27
42
|
const HF_ROOTS = [
|
|
43
|
+
process.argv[2] && path.resolve(process.argv[2]), // project-owned helper dependencies
|
|
28
44
|
process.env.HYPERFRAMES_ROOT,
|
|
29
45
|
path.resolve(__dirname, "../../.."),
|
|
30
46
|
path.join(os.homedir(), "Downloads", "hyperframes"),
|
|
@@ -63,11 +79,13 @@ for (const r of HF_ROOTS) {
|
|
|
63
79
|
}
|
|
64
80
|
if (!gsapSource) {
|
|
65
81
|
const g = findInBun(r, "gsap", path.join("dist", "gsap.min.js"));
|
|
66
|
-
if (g) gsapSource = fs.readFileSync(g
|
|
82
|
+
if (g) gsapSource = fs.readFileSync(g);
|
|
67
83
|
}
|
|
68
84
|
}
|
|
69
|
-
if (!puppeteer || !sharp) {
|
|
70
|
-
console.error(
|
|
85
|
+
if (require.main === module && (!puppeteer || !sharp)) {
|
|
86
|
+
console.error(
|
|
87
|
+
"[preview] need puppeteer+sharp — install project dependencies per embedded-captions SKILL.md Runtime prerequisites",
|
|
88
|
+
);
|
|
71
89
|
process.exit(0);
|
|
72
90
|
}
|
|
73
91
|
|
|
@@ -80,9 +98,15 @@ async function shotAt(browser, file, W, H, t) {
|
|
|
80
98
|
// evaluation runs while document.head is still null, and gsap's init then
|
|
81
99
|
// throws "appendChild of null" — which killed previews for theme projects.
|
|
82
100
|
await page.setRequestInterception(true);
|
|
101
|
+
const documentUrl = pathToFileURL(file).href;
|
|
102
|
+
const documentHtml = gsapSource
|
|
103
|
+
? withPreviewGsapSri(fs.readFileSync(file, "utf8"), gsapSource)
|
|
104
|
+
: fs.readFileSync(file, "utf8");
|
|
83
105
|
page.on("request", (req) => {
|
|
84
106
|
const u = req.url();
|
|
85
|
-
if (req.
|
|
107
|
+
if (req.isNavigationRequest() && u === documentUrl) {
|
|
108
|
+
req.respond({ status: 200, contentType: "text/html", body: documentHtml });
|
|
109
|
+
} else if (req.resourceType() === "script" && /gsap/i.test(u) && /^https?:/i.test(u)) {
|
|
86
110
|
if (gsapSource)
|
|
87
111
|
req.respond({ status: 200, contentType: "application/javascript", body: gsapSource });
|
|
88
112
|
else req.continue(); // no local bundle — let the CDN load (online machines)
|
|
@@ -90,7 +114,7 @@ async function shotAt(browser, file, W, H, t) {
|
|
|
90
114
|
req.abort(); // a-roll pixels come from frames_bg
|
|
91
115
|
else req.continue();
|
|
92
116
|
});
|
|
93
|
-
await page.goto(
|
|
117
|
+
await page.goto(documentUrl, { waitUntil: "load", timeout: 15000 });
|
|
94
118
|
const t0 = Date.now();
|
|
95
119
|
let tlReady = false;
|
|
96
120
|
while (Date.now() - t0 < 15000) {
|
|
@@ -260,9 +284,13 @@ async function main() {
|
|
|
260
284
|
await Promise.race([browser.close().catch(() => {}), new Promise((r) => setTimeout(r, 8000))]);
|
|
261
285
|
}
|
|
262
286
|
}
|
|
263
|
-
main
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
287
|
+
if (require.main === module) {
|
|
288
|
+
main()
|
|
289
|
+
.then(() => process.exit(0))
|
|
290
|
+
.catch((e) => {
|
|
291
|
+
console.error("[preview]", e.message);
|
|
292
|
+
process.exit(1);
|
|
293
|
+
});
|
|
294
|
+
}
|
|
295
|
+
|
|
296
|
+
module.exports = { sriSha384, withPreviewGsapSri };
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import crypto from "node:crypto";
|
|
3
|
+
import { createRequire } from "node:module";
|
|
4
|
+
import test from "node:test";
|
|
5
|
+
|
|
6
|
+
const require = createRequire(import.meta.url);
|
|
7
|
+
const { sriSha384, withPreviewGsapSri } = require("./preview-frames.cjs");
|
|
8
|
+
|
|
9
|
+
test("preview GSAP integrity matches the intercepted asset bytes", () => {
|
|
10
|
+
const servedAsset = Buffer.from("the exact local GSAP response body");
|
|
11
|
+
const html = `
|
|
12
|
+
<script src="https://cdn.jsdelivr.net/npm/gsap@3.14.2/dist/gsap.min.js" integrity="sha384-stale" crossorigin="anonymous"></script>
|
|
13
|
+
<script src="https://cdn.example.test/app.js" integrity="sha384-app" crossorigin="anonymous"></script>
|
|
14
|
+
`;
|
|
15
|
+
|
|
16
|
+
const emitted = withPreviewGsapSri(html, servedAsset);
|
|
17
|
+
const expected = `sha384-${crypto.createHash("sha384").update(servedAsset).digest("base64")}`;
|
|
18
|
+
const gsapTag = emitted.match(/<script[^>]*gsap[^>]*>/i)[0];
|
|
19
|
+
|
|
20
|
+
assert.equal(sriSha384(servedAsset), expected);
|
|
21
|
+
assert.match(gsapTag, new RegExp(`integrity="${expected}"`));
|
|
22
|
+
assert.match(gsapTag, /crossorigin="anonymous"/);
|
|
23
|
+
assert.match(emitted, /app\.js" integrity="sha384-app" crossorigin="anonymous"/);
|
|
24
|
+
});
|
|
@@ -12,21 +12,10 @@ set -euo pipefail
|
|
|
12
12
|
PROJECT="${1:?usage: render-and-composite.sh <project-dir> [hyperframes-repo]}"
|
|
13
13
|
PROJECT="$(cd "$PROJECT" && pwd)"
|
|
14
14
|
|
|
15
|
-
# Resolve the hyperframes checkout. Candidate order:
|
|
16
|
-
# 1. arg 2 2. $HYPERFRAMES_ROOT 3. repo root if this skill ships INSIDE the
|
|
17
|
-
# hyperframes repo (skills/embedded-captions/scripts → ../../..) 4. ~/Downloads/hyperframes
|
|
18
15
|
SKILL_SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
done
|
|
23
|
-
if [[ -z "$HF" ]]; then
|
|
24
|
-
echo "[render] hyperframes CLI not found. Set HYPERFRAMES_ROOT to your hyperframes" >&2
|
|
25
|
-
echo " checkout (needs packages/cli/dist/cli.js — 'bun install && bun run build')." >&2
|
|
26
|
-
exit 1
|
|
27
|
-
fi
|
|
28
|
-
export HYPERFRAMES_ROOT="$HF" # so the occlusion gate's measure-layout.cjs finds puppeteer too
|
|
29
|
-
HF_CLI="$HF/packages/cli/dist/cli.js"
|
|
16
|
+
HF_CLI="$(node "$SKILL_SCRIPT_DIR/hf-cli.cjs" "${2:-}")"
|
|
17
|
+
# Retain the explicit dependency-root override for source-checkout users.
|
|
18
|
+
if [[ -n "${2:-}" ]]; then export HYPERFRAMES_ROOT="$2"; fi
|
|
30
19
|
if [[ ! -d "$PROJECT/frames_fg" ]]; then
|
|
31
20
|
echo "[render] missing matte frames at $PROJECT/frames_fg — run matte.cjs first" >&2
|
|
32
21
|
exit 1
|
|
@@ -237,49 +226,16 @@ echo "[render] snapshot → history/index-${STAMP}.html"
|
|
|
237
226
|
|
|
238
227
|
echo "[render] hyperframes render @ ${FPS}fps"
|
|
239
228
|
|
|
240
|
-
#
|
|
241
|
-
#
|
|
242
|
-
#
|
|
243
|
-
# and if the output is already on disk when we hit it, treats the run as
|
|
244
|
-
# successful and kills the zombie. Tune HF_TIMEOUT_S via env if needed.
|
|
245
|
-
# Default SCALES with clip size: two parallel Chromium passes on a long clip
|
|
246
|
-
# legitimately exceed a fixed 240s (a 38s/1151-frame render was killed at 244s
|
|
247
|
-
# while healthy). ~1.5s per source frame, floor 240s.
|
|
248
|
-
N_FRAMES="$(ls "$PROJECT/frames_fg" 2>/dev/null | wc -l | tr -d ' ')"
|
|
249
|
-
HF_TIMEOUT_S="${HF_TIMEOUT_S:-$(( N_FRAMES * 3 / 2 > 240 ? N_FRAMES * 3 / 2 : 240 ))}"
|
|
250
|
-
# hf_render_dir: render one hyperframes composition.
|
|
251
|
-
# args: <output.mp4> <label> <project_dir>
|
|
252
|
-
# watches for the Chromium-shutdown-hang; if output file exists and is >1MB
|
|
253
|
-
# past timeout, treats as success and kills the zombie.
|
|
229
|
+
# Wait for the renderer's real exit status. File size cannot prove completion,
|
|
230
|
+
# and a portable process snapshot cannot safely recover a timed-out render tree.
|
|
231
|
+
# Cancellation/browser cleanup belongs to the CLI that owns those processes.
|
|
254
232
|
hf_render_dir() {
|
|
255
233
|
local out="$1" label="$2" proj="$3" fmt="${4:-}"
|
|
256
|
-
# bash 3.2 (macOS) throws on empty-array expansion under `set -u`, so branch
|
|
257
|
-
# explicitly instead of splatting an optional --format array.
|
|
258
234
|
if [[ -n "$fmt" ]]; then
|
|
259
|
-
node "$HF_CLI" render --skill=embedded-captions --dir "$proj" --fps "$FPS" --format "$fmt" --crf 11 -o "$out"
|
|
235
|
+
node "$HF_CLI" render --skill=embedded-captions --dir "$proj" --fps "$FPS" --format "$fmt" --crf 11 -o "$out" || return $?
|
|
260
236
|
else
|
|
261
|
-
node "$HF_CLI" render --skill=embedded-captions --dir "$proj" --fps "$FPS" --crf 11 -o "$out"
|
|
237
|
+
node "$HF_CLI" render --skill=embedded-captions --dir "$proj" --fps "$FPS" --crf 11 -o "$out" || return $?
|
|
262
238
|
fi
|
|
263
|
-
local pid=$! start=$SECONDS elapsed
|
|
264
|
-
while kill -0 "$pid" 2>/dev/null; do
|
|
265
|
-
elapsed=$((SECONDS - start))
|
|
266
|
-
if (( elapsed > HF_TIMEOUT_S )); then
|
|
267
|
-
local sz=0
|
|
268
|
-
[[ -f "$out" ]] && sz=$(stat -f%z "$out" 2>/dev/null || echo 0)
|
|
269
|
-
if (( sz > 1000000 )); then
|
|
270
|
-
echo "[render] ${label}: node hung ${elapsed}s after shutdown (output ${sz}B exists, treating as success)"
|
|
271
|
-
kill -9 "$pid" 2>/dev/null
|
|
272
|
-
pkill -9 -f "puppeteer_dev_chrome_profile" 2>/dev/null
|
|
273
|
-
return 0
|
|
274
|
-
fi
|
|
275
|
-
echo "[render] ${label}: hung ${elapsed}s with no output — killing and failing" >&2
|
|
276
|
-
kill -9 "$pid" 2>/dev/null
|
|
277
|
-
pkill -9 -f "puppeteer_dev_chrome_profile" 2>/dev/null
|
|
278
|
-
return 2
|
|
279
|
-
fi
|
|
280
|
-
sleep 5
|
|
281
|
-
done
|
|
282
|
-
wait "$pid" 2>/dev/null
|
|
283
239
|
[[ -f "$out" ]]
|
|
284
240
|
}
|
|
285
241
|
|
|
@@ -22,6 +22,7 @@ const THRESH = 30 / 255; // a cell is "subject" if ≥12% covered at any sampled
|
|
|
22
22
|
const SAMPLES = 48; // frames cached across the clip (windows aggregate the cached grids)
|
|
23
23
|
|
|
24
24
|
const HF_ROOTS = [
|
|
25
|
+
process.argv[2] && path.resolve(process.argv[2]), // project-owned helper dependencies
|
|
25
26
|
process.env.HYPERFRAMES_ROOT,
|
|
26
27
|
path.resolve(__dirname, "../../.."),
|
|
27
28
|
path.join(os.homedir(), "Downloads", "hyperframes"),
|
|
@@ -558,7 +559,9 @@ async function main() {
|
|
|
558
559
|
process.exit(2);
|
|
559
560
|
}
|
|
560
561
|
if (!sharp) {
|
|
561
|
-
console.error(
|
|
562
|
+
console.error(
|
|
563
|
+
"[safe-zones] sharp unavailable — install project dependencies per embedded-captions SKILL.md Runtime prerequisites",
|
|
564
|
+
);
|
|
562
565
|
process.exit(0);
|
|
563
566
|
}
|
|
564
567
|
|
|
@@ -9,20 +9,10 @@
|
|
|
9
9
|
*/
|
|
10
10
|
const path = require("path");
|
|
11
11
|
const fs = require("fs");
|
|
12
|
-
const os = require("os");
|
|
13
12
|
const cp = require("child_process");
|
|
14
13
|
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
process.env.HYPERFRAMES_ROOT,
|
|
18
|
-
path.resolve(__dirname, "..", "..", ".."),
|
|
19
|
-
path.join(os.homedir(), "Downloads", "hyperframes"),
|
|
20
|
-
].filter(Boolean);
|
|
21
|
-
for (const r of roots)
|
|
22
|
-
if (fs.existsSync(path.join(r, "packages", "cli", "dist", "cli.js"))) return r;
|
|
23
|
-
console.error("[transcribe] hyperframes CLI not found — set HYPERFRAMES_ROOT");
|
|
24
|
-
process.exit(3);
|
|
25
|
-
}
|
|
14
|
+
const { hfCli } = require("./hf-cli.cjs");
|
|
15
|
+
|
|
26
16
|
function ensureSource(project) {
|
|
27
17
|
const src = path.join(project, "source.mp4");
|
|
28
18
|
if (fs.existsSync(src)) return src;
|
|
@@ -247,7 +237,7 @@ function main() {
|
|
|
247
237
|
|
|
248
238
|
if (!words) {
|
|
249
239
|
// run hyperframes Whisper → writes a flat word array to <dir>/transcript.json
|
|
250
|
-
const cli =
|
|
240
|
+
const cli = hfCli();
|
|
251
241
|
const args = ["transcribe", audio, "-d", project, "--json", "--model", model];
|
|
252
242
|
if (language) args.push("--language", language);
|
|
253
243
|
let info = {};
|
|
@@ -270,7 +260,8 @@ function main() {
|
|
|
270
260
|
end: w.end ?? w.t1,
|
|
271
261
|
type: "word",
|
|
272
262
|
}));
|
|
273
|
-
engine
|
|
263
|
+
// Under the default --engine auto the CLI may have run Parakeet; it reports which.
|
|
264
|
+
engine = info.engine === "parakeet" ? `parakeet(${info.model})` : `whisper.cpp(${model})`;
|
|
274
265
|
}
|
|
275
266
|
|
|
276
267
|
// Tail-hallucination guard: drop words whisper placed entirely inside a terminal
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import assert from "node:assert/strict";
|
|
2
|
+
import { execFileSync } from "node:child_process";
|
|
3
|
+
import { mkdirSync, mkdtempSync, readFileSync, rmSync, writeFileSync } from "node:fs";
|
|
4
|
+
import { tmpdir } from "node:os";
|
|
5
|
+
import { join } from "node:path";
|
|
6
|
+
import test from "node:test";
|
|
7
|
+
import { fileURLToPath } from "node:url";
|
|
8
|
+
|
|
9
|
+
// A stub CLI answers as `transcribe --json` does when --engine auto ran Parakeet.
|
|
10
|
+
const STUB_CLI = `
|
|
11
|
+
const fs = require("fs"), path = require("path");
|
|
12
|
+
const project = process.argv[process.argv.indexOf("-d") + 1];
|
|
13
|
+
const transcriptPath = path.join(project, "cli-words.json");
|
|
14
|
+
fs.writeFileSync(transcriptPath, JSON.stringify([{ text: "hello", start: 0.1, end: 0.5 }]));
|
|
15
|
+
console.log(JSON.stringify({ ok: true, engine: "parakeet", model: "parakeet-tdt-0.6b-v3", transcriptPath }));
|
|
16
|
+
`;
|
|
17
|
+
|
|
18
|
+
test("the CLI fallback labels the transcript with the engine the CLI ran", () => {
|
|
19
|
+
const root = mkdtempSync(join(tmpdir(), "embedded-captions-transcribe-"));
|
|
20
|
+
try {
|
|
21
|
+
const cliDir = join(root, "hf", "packages", "cli", "dist");
|
|
22
|
+
mkdirSync(cliDir, { recursive: true });
|
|
23
|
+
writeFileSync(join(cliDir, "cli.js"), STUB_CLI);
|
|
24
|
+
const project = join(root, "project");
|
|
25
|
+
mkdirSync(project);
|
|
26
|
+
writeFileSync(join(project, "source.mp4"), "");
|
|
27
|
+
writeFileSync(join(project, "audio.mp3"), "");
|
|
28
|
+
execFileSync(
|
|
29
|
+
process.execPath,
|
|
30
|
+
[fileURLToPath(new URL("./transcribe.cjs", import.meta.url)), project],
|
|
31
|
+
{
|
|
32
|
+
stdio: "ignore",
|
|
33
|
+
env: { ...process.env, HYPERFRAMES_ROOT: join(root, "hf"), TRANSCRIBE_ENGINE: "whisper" },
|
|
34
|
+
},
|
|
35
|
+
);
|
|
36
|
+
const transcript = JSON.parse(readFileSync(join(project, "transcript.json"), "utf8"));
|
|
37
|
+
assert.equal(transcript.engine, "parakeet(parakeet-tdt-0.6b-v3)");
|
|
38
|
+
} finally {
|
|
39
|
+
rmSync(root, { recursive: true, force: true });
|
|
40
|
+
}
|
|
41
|
+
});
|
|
@@ -3,6 +3,8 @@ name: faceless-explainer
|
|
|
3
3
|
description: "Turn arbitrary text — an article, notes, a topic, a brief — into a faceless explainer video: there is no site or footage to capture, so the visuals are invented per scene (typography, abstract graphics, diagrams, data-viz). Use for topic explainers, concept breakdowns, how-tos, listicles. Not a video built from a website (/product-launch-video — promo or tour). Unclear → /hyperframes."
|
|
4
4
|
---
|
|
5
5
|
|
|
6
|
+
**Plugin installs:** Before setup or freshness commands, follow [plugin execution rules](../hyperframes/references/plugin-installation.md) when this skill is inside a HyperFrames plugin. Standalone installs keep the update instructions below.
|
|
7
|
+
|
|
6
8
|
> **First, keep this skill fresh — confirm with the user before running:** `npx hyperframes skills update faceless-explainer`. A fast no-op when everything is current; otherwise it refreshes this skill plus the core domain skills it depends on before you rely on them.
|
|
7
9
|
|
|
8
10
|
> **media-use**: Before sourcing audio/images/logos, call `/media-use` to resolve BGM/SFX/images from the HeyGen catalog and brand logos from their official sources. Run `--adopt` first to register existing assets. See `/media-use` skill.
|
|
@@ -13,7 +15,7 @@ Use this skill to turn a body of text into an explainer video: pick a design sys
|
|
|
13
15
|
|
|
14
16
|
> **The front door is `/hyperframes`.** You are the orchestrator. Run each step, verify its gate, and only then continue. This skill is for **explaining a topic from text, with no product and no website to capture**. Any other intent, a bare "make a video", or any uncertainty → read `/hyperframes` first — the intent layer owns every route decision, and a fresh creation arriving here without `BRIEF.md` goes through it anyway (Setup's opening rule).
|
|
15
17
|
|
|
16
|
-
You are the orchestrator. Work in `videos/<project>/`. Run steps in order and pass each gate before continuing. User-gated steps are Step 0, Step 3, and Step 6. Read `../hyperframes
|
|
18
|
+
You are the orchestrator. Work in `videos/<project>/`. Run steps in order and pass each gate before continuing. User-gated steps are Step 0, Step 3, and Step 6. Read `../hyperframes/references/brief-contract.md` before Step 0 — it defines the gate types and how `BRIEF.md`'s `flow`/`storyboard` derive the mode that governs the Step 3/4/6 gates. Do every step yourself except Step 5, where you dispatch one sub-agent per frame. Do not put design or motion rules here; those live in the frame-worker sub-agent, this skill's local `../hyperframes-animation/rules/` + `../hyperframes-animation/blueprints/`, and `hyperframes-creative`.
|
|
17
19
|
|
|
18
20
|
Workflow: Step 0 setup → `hyperframes.json`; Step 1 brief → `capture/extracted/`; Step 2 design system → `frame.md`; Step 3 storyboard/script → `STORYBOARD.md` and `SCRIPT.md`; Step 3.1 audio → `audio_meta.json`; Step 4 visual design → enriched `STORYBOARD.md`; Step 5 frames → `compositions/frames/NN-*.html` and `index.html`; Step 6 final render → `renders/video.mp4`.
|
|
19
21
|
|
|
@@ -31,7 +33,7 @@ Initialize only if `hyperframes.json` is missing. Name `<project>` from the topi
|
|
|
31
33
|
|
|
32
34
|
After init, let `<PROJECT_ROOT>` be `videos/<project>` and run every subsequent relative-path command with that directory as its working directory. In the commands below, `.` means `<PROJECT_ROOT>`; never write `.media`, `capture`, or output files in the caller directory.
|
|
33
35
|
|
|
34
|
-
**Write `BRIEF.md` immediately after init** (never before — `init` refuses a non-empty directory): the intent layer's locked brief, shape per `../hyperframes
|
|
36
|
+
**Write `BRIEF.md` immediately after init** (never before — `init` refuses a non-empty directory): the intent layer's locked brief, shape per `../hyperframes/references/brief-format.md`. Resolve `<MEDIA_DIR>` as the installed `/media-use` skill directory. Then record each preference-backed answer with `node <MEDIA_DIR>/scripts/prefs.mjs record --hyperframes .` (`brief-format.md` names the subset). If the intent layer adopted a recipe, run `node <MEDIA_DIR>/scripts/recipe.mjs use --hyperframes . --name <name>`; it copies its `frame.md` into the project (Step 2 is then skipped) and returns the skeletons Step 3 drafts from. A recipe fills answers, not approvals; the review gates still run.
|
|
35
37
|
|
|
36
38
|
**Show sign-in status before proceeding past Setup** — run `npx hyperframes auth status` and relay its output verbatim. It reports whether voice/BGM will use HeyGen or local engines and, when signed out, how to sign in. Apply one branch:
|
|
37
39
|
|
|
@@ -83,11 +85,11 @@ A faceless explainer usually has **no brand colors/fonts** (`tokens.json` colors
|
|
|
83
85
|
|
|
84
86
|
Goal: Turn the text into an approved frame-by-frame teaching plan.
|
|
85
87
|
|
|
86
|
-
Read `../hyperframes-creative/references/story-spine.md` (hook language, value-before-evidence, storyboard-as-proposal, source-traceable visuals), `references/story-design.md`, `../hyperframes-animation/blueprints-index.md`, `../hyperframes
|
|
88
|
+
Read `../hyperframes-creative/references/story-spine.md` (hook language, value-before-evidence, storyboard-as-proposal, source-traceable visuals), `references/story-design.md`, `../hyperframes-animation/blueprints-index.md`, `../hyperframes/references/storyboard-format.md`, and `../hyperframes/references/script-format.md`. Use them to write `STORYBOARD.md` and, when narration is needed, `SCRIPT.md`. Set the frontmatter `duration:` from the brief's `length` — a rough expectation; assembly reports where the cut lands against it.
|
|
87
89
|
|
|
88
90
|
Use `story-design.md` for the explainer structure (concept / how-to / listicle / story), hook strategy, clarity techniques, emotional beats, the type-enum mapping, and `VO_MODE`. The video's sequence comes from **narrative design, not the input text's paragraph order** — reorder, merge, omit, compress. As a **soft guide**, consult the role→blueprint menu in `../hyperframes-animation/blueprints-index.md`: for each beat, write the voiceover in the shape its candidate blueprint implies and tag that candidate `blueprint:` id when one fits. Teaching truth still decides which beats exist — never force a beat to fit a blueprint, and never invent a beat just because a proven shape is available. Faceless visuals are invented downstream, so frames do **not** carry an asset inventory: leave `asset_candidates` empty unless the user supplied a real `public/<basename>` image. Use the exact required fields from the storyboard and script references.
|
|
89
91
|
|
|
90
|
-
After drafting, run the review loop's plan pass — `../hyperframes
|
|
92
|
+
After drafting, run the review loop's plan pass — `../hyperframes/references/review-loop.md` § 1: present the plan as a proposal, and ask the two questions — approve or change, and **sketches first** (recommended) or skip. Feedback arrives as a chat reply; loop until approved. This is a **checkpoint gate** (brief contract § 1): in autonomous mode there is nothing to ask — post the same summary as a heads-up and proceed; sketches collapse into the build, and the one preview question comes at Step 6.
|
|
91
93
|
|
|
92
94
|
**Gate:** `STORYBOARD.md` exists, every frame has the required narrative fields, `SCRIPT.md` exists when narration is needed, and the user approved the frame-by-frame plan (autonomous: the summary was posted as a heads-up).
|
|
93
95
|
|
|
@@ -117,17 +119,19 @@ If there is no narration and no `SCRIPT.md`, skip voice generation. BGM may stil
|
|
|
117
119
|
|
|
118
120
|
Goal: Add the visual direction, layout intent, and motion choices to each storyboard frame.
|
|
119
121
|
|
|
120
|
-
**Sketch the
|
|
122
|
+
**Sketch the storyboard sheet first (collaborative only).** The moment the plan is approved, run the sketch pass — `../hyperframes/references/review-loop.md` § 2 (don't wait on Step 3.1; sketches don't use timings): wireframe every frame yourself as a cell of `storyboard.html` (`../hyperframes-creative/references/storyboard-recipe.md` § 3), mark each `built`, pause for the one layout question when every frame is `built`, and revise only the sketches named until the sheet is confirmed. Only then write the visual design below onto the confirmed layouts. In autonomous mode, or when the user chose to skip sketches at Step 3, skip this pass — frames go straight from `outline` to `animated` at Step 5.
|
|
121
123
|
|
|
122
124
|
Edit `STORYBOARD.md` in place. Do not create another storyboard. Use `frame.md` as source of truth for color, type, layout feel, and style.
|
|
123
125
|
|
|
124
126
|
Read `references/visual-design.md`, `../hyperframes-animation/blueprints-index.md`, `references/motion-language.md`, and `../hyperframes-animation/rules-index.md`. Use `visual-design.md` for the method (the time-coded shot sequence, the inline Layout vocabulary, and the invented-visual treatment), plus the required `## Video direction` block. Use `../hyperframes-animation/blueprints-index.md` to pick each frame's shot shape. Use `motion-language.md` (the motion vocabulary + the motion doctrine) and `../hyperframes-animation/rules-index.md` (valid rule names) for motion — do not invent motion names.
|
|
125
127
|
|
|
128
|
+
**Search the live catalog before you invent any named look.** A faceless explainer invents every visual, which is exactly when a hand-authored rebuild of an existing block is most likely. For every look, effect, treatment or transition the brief names — "CRT scanlines", "glitch", "film grain", "shimmer sweep", "confetti burst" — run `npx hyperframes catalog --query "<the look, in plain English>" --json` and read the top results BEFORE you write that look into `STORYBOARD.md`. The search needs **nothing installed**: no project, no prior `add`, no account. It ranks the whole hosted registry (~400 blocks and components) from any directory. A block that already does the job becomes the frame's `focal` — name it here so Step 5's workers install and customize it. Invent a visual only after a search for it came back with nothing that fits.
|
|
129
|
+
|
|
126
130
|
For every frame, write a **time-coded shot sequence** into `STORYBOARD.md` per `visual-design.md`'s method: pick the frame's blueprint (or compose), instantiate it with THIS frame's **invented** content, and pace each Scene's reveal to the voiceover so the frame develops across its full duration instead of front-loading then freezing. Because the explainer is faceless, `focal`/`roles` name the **invented visual elements** (a hero word, a diagram node, a data-viz series) — you are designing them, not selecting captured assets. State layout and motion **inline** per Scene (vocabularies in `visual-design.md` and `motion-language.md`). Add one video-wide `## Video direction` block.
|
|
127
131
|
|
|
128
132
|
Do not change story, script, `transition_in`, or the source text. Do not write HTML in this step. There is **no asset-staging step** — faceless visuals are built by the workers in Step 5. If the user supplied a real `public/<basename>` image, reference it by path in the relevant frame's `focal`/`roles`; otherwise nothing to stage.
|
|
129
133
|
|
|
130
|
-
**Gate:** every frame has a time-coded shot sequence whose reveals are paced to the voiceover (no front-loading); each frame names its invented `focal` and/or `roles`; `## Video direction` exists. Collaborative: the sketch
|
|
134
|
+
**Gate:** every frame has a time-coded shot sequence whose reveals are paced to the voiceover (no front-loading); each frame names its invented `focal` and/or `roles`; `## Video direction` exists. Collaborative: the sketch sheet was confirmed.
|
|
131
135
|
|
|
132
136
|
---
|
|
133
137
|
|
|
@@ -143,15 +147,15 @@ Wait for Step 3.1 audio to finish if audio was started. Then sync durations and
|
|
|
143
147
|
|
|
144
148
|
Duration sync is mechanical: real voice duration wins; silent frames keep estimates; never hand-edit synced durations.
|
|
145
149
|
|
|
146
|
-
Before dispatch, read `../hyperframes
|
|
150
|
+
Before dispatch, read `../hyperframes/references/subagent-dispatch.md`. Build the per-frame packets and the worker role payload:
|
|
147
151
|
|
|
148
152
|
`node <SKILL_DIR>/scripts/frame-packets.mjs --project "$PROJECT_DIR" --storyboard "$PROJECT_DIR/STORYBOARD.md"`
|
|
149
153
|
|
|
150
|
-
The builder writes one bounded packet per frame under `.hyperframes/frame-packets/` (the frame's exact storyboard block + the blueprint body + every cited rule recipe, inlined) and `_role.md` (`../hyperframes
|
|
154
|
+
The builder writes one bounded packet per frame under `.hyperframes/frame-packets/` (the frame's exact storyboard block + the blueprint body + every cited rule recipe, inlined) and `_role.md` (`../hyperframes/references/frame-worker-core.md` + this skill's `sub-agents/frame-worker.md`, concatenated verbatim — the complete worker role). Dispatch one sub-agent per frame, in parallel if possible; otherwise run workers in waves. Each worker gets exactly one frame: its prompt carries `_role.md` and that frame's packet — paste both in full, or hand the two file paths for the worker to read first (equivalent; the worker starts from exactly those two documents either way) — plus a dispatch context with `PROJECT_DIR`, `frame_id`, whether the frame has a **confirmed sketch** on disk (the worker dresses that layout rather than redrawing it — frame-worker core § When a confirmed sketch exists), canvas size, and caption status + keep-out band if captions are enabled.
|
|
151
155
|
|
|
152
156
|
Workers read only their packet and `frame.md`; they never open `STORYBOARD.md` or the skill documents (the packet inlines what was selected upstream). Each worker writes only `compositions/frames/NN-*.html`. Workers must never edit `STORYBOARD.md`.
|
|
153
157
|
|
|
154
|
-
**Full-bleed backgrounds ride on a `class="clip"` layer, never the `#root`.** A frame's ground (color field / gradient / grid) is its own full-duration background clip — a `background` set on the `#root` / `data-composition-id` element is clip-gated to the frame's window and is not a dependable ground, so dark content can land on the black host `body` and render invisible. The video's base ground is painted by the assembler from `frame.md`'s `canvas` color onto the index `#root`. (Full rule + self-check: `../hyperframes
|
|
158
|
+
**Full-bleed backgrounds ride on a `class="clip"` layer, never the `#root`.** A frame's ground (color field / gradient / grid) is its own full-duration background clip — a `background` set on the `#root` / `data-composition-id` element is clip-gated to the frame's window and is not a dependable ground, so dark content can land on the black host `body` and render invisible. The video's base ground is painted by the assembler from `frame.md`'s `canvas` color onto the index `#root`. (Full rule + self-check: `../hyperframes/references/frame-worker-core.md`.)
|
|
155
159
|
|
|
156
160
|
As each worker returns, the orchestrator marks that frame as `animated` in `STORYBOARD.md`.
|
|
157
161
|
|
|
@@ -163,7 +167,7 @@ After audio timings exist, build captions in the background and assemble the ind
|
|
|
163
167
|
|
|
164
168
|
`captions.mjs` uses the project's `.hyperframes/caption-skin.html` (copied in Step 2) as the caption look, injecting brand tokens from `frame.md`; with no skin present it renders the built-in default pill. `captions: skipped (<reason>)` is valid. Continue without captions when explicitly skipped.
|
|
165
169
|
|
|
166
|
-
**Gate:** every frame is marked `animated` (collaborative: the sketch
|
|
170
|
+
**Gate:** every frame is marked `animated` (collaborative: the sketch sheet was confirmed at Step 4), `index.html` exists, and captions are built or explicitly skipped.
|
|
167
171
|
|
|
168
172
|
---
|
|
169
173
|
|
|
@@ -189,7 +193,7 @@ If a command fails, surface stderr and stop — don't pile on recovery commands.
|
|
|
189
193
|
|
|
190
194
|
**Known false-positive — do not chase it.** `check` may report a handful of `text_box_overflow` findings of ~1–4px on the **caption** highlight words (selector `#caption-word-*` / `.caption-line`). The caption pill uses a deliberately snug `line-height` (set once in `scripts/captions.mjs`) and has **no `overflow:hidden`**, so a heavy display glyph's ink spills a few px into the pill's own padding — nothing is actually clipped. Treat these as expected and proceed. Do **not** inflate the caption `line-height` (it balloons the pill, which is worse). Only act on a `text_box_overflow` when it names a **frame** element (`#el-NN-*`), not a caption word.
|
|
191
195
|
|
|
192
|
-
After checks pass, pause for user review — the review loop's final look (`../hyperframes
|
|
196
|
+
After checks pass, pause for user review — the review loop's final look (`../hyperframes/references/review-loop.md` § 4): one question, on the final Studio preview — render now, or what changes? (Autonomous: the one kept question, preview first or render.) Then deliver the MP4 with the contact sheet and the frame ids so revisions can target a single frame.
|
|
193
197
|
|
|
194
198
|
Preview: `npx hyperframes preview --background`
|
|
195
199
|
|
|
@@ -215,19 +219,19 @@ The reusable, domain-agnostic shot shapes live in `../hyperframes-animation/blue
|
|
|
215
219
|
|
|
216
220
|
| Read | When |
|
|
217
221
|
| ----------------------------------------------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------- |
|
|
218
|
-
| `[../hyperframes
|
|
222
|
+
| `[../hyperframes/references/brief-contract.md](../hyperframes/references/brief-contract.md)` | Gate types, mode derivation from `BRIEF.md`, field semantics. |
|
|
219
223
|
| `[../hyperframes-creative/references/story-spine.md](../hyperframes-creative/references/story-spine.md)` | Step 3: story doctrine — hook language, value-before-evidence, proposal shape, source-traceable visuals. |
|
|
220
224
|
| `[../hyperframes-creative/frame-presets/](../hyperframes-creative/frame-presets/)` | Step 2: choose and adopt a frame preset. |
|
|
221
225
|
| `[../hyperframes-creative/references/design-spec.md](../hyperframes-creative/references/design-spec.md)` | Step 2: apply brand tokens correctly. |
|
|
222
226
|
| `[references/story-design.md](references/story-design.md)` | Step 3: plan the explainer story. |
|
|
223
227
|
| `[../hyperframes-animation/blueprints-index.md](../hyperframes-animation/blueprints-index.md)` | Step 3: role→blueprint menu. Step 4: pick the shot shape. |
|
|
224
|
-
| `[../hyperframes
|
|
225
|
-
| `[../hyperframes
|
|
228
|
+
| `[../hyperframes/references/storyboard-format.md](../hyperframes/references/storyboard-format.md)` | Step 3: write `STORYBOARD.md`. |
|
|
229
|
+
| `[../hyperframes/references/script-format.md](../hyperframes/references/script-format.md)` | Step 3: write `SCRIPT.md`. |
|
|
226
230
|
| `[../media-use/audio/references/tts.md](../media-use/audio/references/tts.md)` | Step 3.1: choose or understand TTS providers and voices. |
|
|
227
231
|
| `[references/visual-design.md](references/visual-design.md)` | Step 4: write the frame's shot sequence (+ Layout vocabulary). |
|
|
228
232
|
| `[references/motion-language.md](references/motion-language.md)` | Step 4: the motion vocabulary + the motion doctrine. |
|
|
229
233
|
| `[references/cut-catalog.md](references/cut-catalog.md)` | Step 4-5: the cut catalog (worker builds within-frame seams). |
|
|
230
234
|
| `[../hyperframes-animation/rules-index.md](../hyperframes-animation/rules-index.md)` + `[../hyperframes-animation/rules/](../hyperframes-animation/rules/)` | Step 5: local rule recipe bodies for the cited motions. |
|
|
231
|
-
| `[../hyperframes
|
|
235
|
+
| `[../hyperframes/references/frame-worker-core.md](../hyperframes/references/frame-worker-core.md)` | Step 5: the shared worker contract (packet builder prepends it to the delta). |
|
|
232
236
|
| `[sub-agents/frame-worker.md](sub-agents/frame-worker.md)` | Step 5: the workflow's frame-worker delta. |
|
|
233
|
-
| `[../hyperframes
|
|
237
|
+
| `[../hyperframes/references/subagent-dispatch.md](../hyperframes/references/subagent-dispatch.md)` | Step 5: dispatch sub-agents safely. |
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Use this reference in Step 3 to write `STORYBOARD.md` and `SCRIPT.md` for a faceless explainer — a topic, concept, how-to, listicle, or narrative explainer built from text, with **no product, no website, and no captured assets**.
|
|
4
4
|
|
|
5
|
-
This file defines the story: what the video teaches, in what order, and why each frame exists. It does not define layout, visual effects, animation, or final markdown schemas. For exact file syntax, follow `../hyperframes
|
|
5
|
+
This file defines the story: what the video teaches, in what order, and why each frame exists. It does not define layout, visual effects, animation, or final markdown schemas. For exact file syntax, follow `../hyperframes/references/storyboard-format.md` and `../hyperframes/references/script-format.md`.
|
|
6
6
|
|
|
7
7
|
## Read first
|
|
8
8
|
|
|
@@ -6,8 +6,7 @@
|
|
|
6
6
|
//
|
|
7
7
|
// index.html is a *standalone* composition (root <div id="root"> directly in
|
|
8
8
|
// <body>, no <template> wrapper — template is for sub-comps). Structure is
|
|
9
|
-
// modeled on the canonical fixture
|
|
10
|
-
// index.html and the authoritative head/audio template in
|
|
9
|
+
// modeled on the canonical fixture project index.html and the authoritative head/audio template in
|
|
11
10
|
// packages/core/docs/quickstart-template.html. Frame mount order = STORYBOARD
|
|
12
11
|
// document order. Transitions are NOT written here — the transitions injector
|
|
13
12
|
// mutates this file afterward (data-start/duration/track-index + GSAP).
|
|
@@ -58,7 +57,7 @@ import { parseStoryboard } from "./lib/storyboard.mjs";
|
|
|
58
57
|
import { parseFormat } from "./lib/dimensions.mjs";
|
|
59
58
|
import { stageAssets } from "./lib/assets.mjs";
|
|
60
59
|
import { parseColors, semanticColors } from "./lib/tokens.mjs";
|
|
61
|
-
import { bgmDefaultVolume } from "
|
|
60
|
+
import { bgmDefaultVolume } from "./lib/bgm-volume.mjs";
|
|
62
61
|
|
|
63
62
|
// ---------- argv ----------
|
|
64
63
|
const argv = process.argv.slice(2);
|
|
@@ -92,7 +91,10 @@ function ensureBgmCovers(relPath, hyperframesDir, total) {
|
|
|
92
91
|
if (!Number.isFinite(dur) || dur <= 0)
|
|
93
92
|
return { looped: false, short: false, reason: "unreadable duration" };
|
|
94
93
|
if (dur >= total - 0.1) return { looped: false, short: false, dur }; // already covers
|
|
95
|
-
|
|
94
|
+
// Always emit .mp3: the encode below is libmp3lame regardless of the source
|
|
95
|
+
// extension, so preserving relPath's own extension (e.g. "bgm.wav") would
|
|
96
|
+
// smuggle an MP3 stream into a .wav-named file (PRINFRA-309).
|
|
97
|
+
const relOut = relPath.replace(/\.([^./]+)$/, ".loop.mp3");
|
|
96
98
|
const absOut = join(hyperframesDir, relOut);
|
|
97
99
|
const fadeOut = Math.max(0, total - 1.5);
|
|
98
100
|
const ff = spawnSync(
|
|
@@ -1,18 +1,21 @@
|
|
|
1
1
|
import assert from "node:assert/strict";
|
|
2
|
-
import { existsSync, mkdirSync, mkdtempSync, writeFileSync } from "node:fs";
|
|
2
|
+
import { existsSync, mkdirSync, mkdtempSync, readFileSync, writeFileSync } from "node:fs";
|
|
3
3
|
import { tmpdir } from "node:os";
|
|
4
4
|
import { join } from "node:path";
|
|
5
5
|
import { spawnSync } from "node:child_process";
|
|
6
6
|
import test from "node:test";
|
|
7
7
|
|
|
8
8
|
const assembleScript = new URL("./assemble-index.mjs", import.meta.url).pathname;
|
|
9
|
+
const HAS_FFMPEG =
|
|
10
|
+
spawnSync("ffmpeg", ["-version"], { stdio: "ignore" }).status === 0 &&
|
|
11
|
+
spawnSync("ffprobe", ["-version"], { stdio: "ignore" }).status === 0;
|
|
9
12
|
|
|
10
13
|
// ── bgm_pending at the assembly boundary ─────────────────────────────────────
|
|
11
14
|
// Regression: the flag survived into audio_meta.json but assemble rebuilt its audio object
|
|
12
15
|
// from three named keys and dropped it, so the step that actually builds the film could not
|
|
13
16
|
// tell "not ready yet" from "silent by design" and would ship the silent one.
|
|
14
17
|
|
|
15
|
-
function assembleWith({ audioMeta, extraArgs = [] }) {
|
|
18
|
+
function assembleWith({ audioMeta, extraArgs = [], beforeAssemble }) {
|
|
16
19
|
const dir = mkdtempSync(join(tmpdir(), "product-launch-assemble-"));
|
|
17
20
|
writeFileSync(
|
|
18
21
|
join(dir, "STORYBOARD.md"),
|
|
@@ -25,6 +28,7 @@ function assembleWith({ audioMeta, extraArgs = [] }) {
|
|
|
25
28
|
'<section class="clip" data-start="0" data-duration="3"></section></div>',
|
|
26
29
|
);
|
|
27
30
|
if (audioMeta) writeFileSync(join(dir, "audio_meta.json"), JSON.stringify(audioMeta));
|
|
31
|
+
if (beforeAssemble) beforeAssemble(dir);
|
|
28
32
|
const r = spawnSync(
|
|
29
33
|
process.execPath,
|
|
30
34
|
[
|
|
@@ -70,3 +74,54 @@ test("a film that is silent BY DESIGN still assembles untouched", () => {
|
|
|
70
74
|
assert.equal(existsSync(join(dir, "index.html")), true);
|
|
71
75
|
assert.doesNotMatch(r.stderr, /bgm_pending/);
|
|
72
76
|
});
|
|
77
|
+
|
|
78
|
+
// ── PRINFRA-309: loop-extended BGM must be a real .mp3, not MP3-in-a-.wav ────
|
|
79
|
+
// ensureBgmCovers() always encodes the loop-extended track with libmp3lame — so a source
|
|
80
|
+
// asset named "*.wav" that's short of TOTAL used to come out as MP3 audio inside a
|
|
81
|
+
// .loop.wav-named file: decodes fine via ffprobe/ffmpeg/Chromium (which sniff the real
|
|
82
|
+
// WAVE_FORMAT_MPEGLAYER3 tag), but hard-fails in any naive/strict WAV parser (e.g. Python's
|
|
83
|
+
// stdlib `wave` module) that doesn't do full format-tag dispatch.
|
|
84
|
+
test(
|
|
85
|
+
"loop-extended bgm is written as .mp3, not .loop.wav, even when the source is a .wav",
|
|
86
|
+
{ skip: !HAS_FFMPEG },
|
|
87
|
+
() => {
|
|
88
|
+
const { dir, r } = assembleWith({
|
|
89
|
+
audioMeta: { bgm: { path: "assets/bgm/bed.wav" }, voices: [], sfx: [] },
|
|
90
|
+
beforeAssemble: (projectDir) => {
|
|
91
|
+
mkdirSync(join(projectDir, "assets", "bgm"), { recursive: true });
|
|
92
|
+
// 1s tone, well short of the 3s TOTAL from the single storyboard frame above —
|
|
93
|
+
// guarantees ensureBgmCovers() takes the loop-extend branch.
|
|
94
|
+
const gen = spawnSync(
|
|
95
|
+
"ffmpeg",
|
|
96
|
+
[
|
|
97
|
+
"-y",
|
|
98
|
+
"-f",
|
|
99
|
+
"lavfi",
|
|
100
|
+
"-i",
|
|
101
|
+
"sine=frequency=440:duration=1",
|
|
102
|
+
join(projectDir, "assets", "bgm", "bed.wav"),
|
|
103
|
+
],
|
|
104
|
+
{ encoding: "utf8" },
|
|
105
|
+
);
|
|
106
|
+
assert.equal(gen.status, 0, gen.stderr);
|
|
107
|
+
},
|
|
108
|
+
});
|
|
109
|
+
|
|
110
|
+
assert.equal(r.status, 0, r.stderr);
|
|
111
|
+
const html = readFileSync(join(dir, "index.html"), "utf8");
|
|
112
|
+
const bgmEl = html.match(/id="el-bgm"[\s\S]*?src="([^"]+)"/);
|
|
113
|
+
assert.ok(bgmEl, "expected a bgm <audio> element in index.html");
|
|
114
|
+
const bgmSrc = bgmEl[1];
|
|
115
|
+
assert.match(bgmSrc, /\.mp3$/, `bgm src should end in .mp3, got "${bgmSrc}"`);
|
|
116
|
+
assert.doesNotMatch(bgmSrc, /\.wav$/);
|
|
117
|
+
|
|
118
|
+
const outPath = join(dir, bgmSrc);
|
|
119
|
+
assert.equal(existsSync(outPath), true);
|
|
120
|
+
const probe = spawnSync(
|
|
121
|
+
"ffprobe",
|
|
122
|
+
["-v", "error", "-show_entries", "stream=codec_name", "-of", "csv=p=0", "--", outPath],
|
|
123
|
+
{ encoding: "utf8" },
|
|
124
|
+
);
|
|
125
|
+
assert.equal(probe.stdout.trim(), "mp3");
|
|
126
|
+
},
|
|
127
|
+
);
|
|
@@ -173,6 +173,8 @@ function runGenerate(argv) {
|
|
|
173
173
|
: { mode: "retrieve", query, blob: g.message || "", arc: g.arc || "" },
|
|
174
174
|
};
|
|
175
175
|
if (userVoice) request.voice = userVoice;
|
|
176
|
+
if (flag(argv, "tts-model", null)) request.tts_model = flag(argv, "tts-model", null);
|
|
177
|
+
if (flag(argv, "style", null)) request.style = flag(argv, "style", null);
|
|
176
178
|
|
|
177
179
|
const neutral = neutralPath(outPath);
|
|
178
180
|
runEngine({ request, hyperframesDir, neutral, only: "tts,bgm" }, die);
|
|
@@ -41,6 +41,8 @@ import {
|
|
|
41
41
|
UA_DEFAULT_COLORS,
|
|
42
42
|
} from "./lib/tokens.mjs";
|
|
43
43
|
|
|
44
|
+
import { stageCapturedFonts } from "./lib/captured-fonts.mjs";
|
|
45
|
+
|
|
44
46
|
const __dirname = dirname(fileURLToPath(import.meta.url));
|
|
45
47
|
const argv = process.argv.slice(2);
|
|
46
48
|
const flag = (name, def) => {
|
|
@@ -481,11 +483,12 @@ if (brandFonts.length) {
|
|
|
481
483
|
const famOf = (f) =>
|
|
482
484
|
fams.length === 1 ? fams[0] : ranked.find((x) => norm(f).includes(norm(x)));
|
|
483
485
|
const outDir = join(hyperframesDir, "assets/fonts");
|
|
484
|
-
const
|
|
485
|
-
const
|
|
486
|
+
const captured = stageCapturedFonts(hyperframesDir, fams);
|
|
487
|
+
const faces = [...captured.faces];
|
|
488
|
+
const stagedNames = new Set(captured.files);
|
|
486
489
|
for (const { d, f } of files) {
|
|
487
490
|
const fam = famOf(f);
|
|
488
|
-
if (!fam) continue;
|
|
491
|
+
if (!fam || captured.families.has(fam.toLowerCase())) continue;
|
|
489
492
|
const { n, w } = weightInfo(f);
|
|
490
493
|
const style = styleOf(f);
|
|
491
494
|
const clean = `${fam.replace(/[^A-Za-z0-9]/g, "")}-${w}${style === "italic" ? "-Italic" : ""}.${extOf(f)}`;
|