kasaframe 0.0.0-stage → 0.1.3
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 +21 -0
- package/NOTICE +148 -0
- package/README.md +92 -2
- package/app/package.json +12 -0
- package/app/server/engine.ts +533 -0
- package/app/server/main.ts +209 -0
- package/app/web/env.d.ts +2 -0
- package/app/web/icons.ts +31 -0
- package/app/web/index.html +21 -0
- package/app/web/main.ts +1195 -0
- package/app/web/style.css +463 -0
- package/bin/hooks.mjs +64 -0
- package/bin/kf.mjs +32 -0
- package/docs/AGENTS.md +286 -0
- package/music/README.md +37 -0
- package/package.json +44 -4
- package/packages/adapters/package.json +36 -0
- package/packages/adapters/src/css.ts +11 -0
- package/packages/adapters/src/gsap.ts +26 -0
- package/packages/adapters/src/index.ts +9 -0
- package/packages/adapters/src/lottie.ts +22 -0
- package/packages/adapters/src/media.ts +59 -0
- package/packages/adapters/src/page.ts +229 -0
- package/packages/adapters/src/project.ts +214 -0
- package/packages/adapters/src/react.ts +36 -0
- package/packages/adapters/src/svelte.ts +22 -0
- package/packages/adapters/src/three.ts +18 -0
- package/packages/adapters/src/vue.ts +27 -0
- package/packages/check/package.json +19 -0
- package/packages/check/src/check.ts +280 -0
- package/packages/check/src/cli.ts +70 -0
- package/packages/check/src/image.ts +146 -0
- package/packages/check/src/index.ts +9 -0
- package/packages/check/src/ocr.swift +37 -0
- package/packages/check/src/probe.ts +328 -0
- package/packages/check/src/report.ts +44 -0
- package/packages/check/src/rules/assets.ts +45 -0
- package/packages/check/src/rules/beats.ts +212 -0
- package/packages/check/src/rules/camera.ts +217 -0
- package/packages/check/src/rules/captions.ts +49 -0
- package/packages/check/src/rules/flash.ts +235 -0
- package/packages/check/src/rules/frames.ts +136 -0
- package/packages/check/src/rules/layout.ts +281 -0
- package/packages/check/src/rules/page.ts +87 -0
- package/packages/check/src/rules/runs.ts +20 -0
- package/packages/check/src/rules/text.ts +326 -0
- package/packages/check/src/scan.ts +240 -0
- package/packages/check/src/serve.ts +67 -0
- package/packages/check/src/types.ts +80 -0
- package/packages/check/src/video.ts +137 -0
- package/packages/cli/package.json +30 -0
- package/packages/cli/src/blur.ts +80 -0
- package/packages/cli/src/browser.ts +203 -0
- package/packages/cli/src/command.ts +44 -0
- package/packages/cli/src/commands/app.ts +25 -0
- package/packages/cli/src/commands/beats.ts +36 -0
- package/packages/cli/src/commands/bench.ts +123 -0
- package/packages/cli/src/commands/blender.ts +293 -0
- package/packages/cli/src/commands/check.ts +25 -0
- package/packages/cli/src/commands/direct.ts +210 -0
- package/packages/cli/src/commands/doctor.ts +30 -0
- package/packages/cli/src/commands/gen.ts +173 -0
- package/packages/cli/src/commands/look.ts +46 -0
- package/packages/cli/src/commands/lyrics.ts +157 -0
- package/packages/cli/src/commands/make.ts +1121 -0
- package/packages/cli/src/commands/music.ts +78 -0
- package/packages/cli/src/commands/narrate.ts +238 -0
- package/packages/cli/src/commands/new.ts +185 -0
- package/packages/cli/src/commands/preview.ts +43 -0
- package/packages/cli/src/commands/render.ts +250 -0
- package/packages/cli/src/commands/series.ts +110 -0
- package/packages/cli/src/commands/setup.ts +102 -0
- package/packages/cli/src/commands/sheet.ts +114 -0
- package/packages/cli/src/commands/skill.ts +43 -0
- package/packages/cli/src/commands/still.ts +40 -0
- package/packages/cli/src/commands/theme.ts +172 -0
- package/packages/cli/src/commands/transitions.ts +40 -0
- package/packages/cli/src/deps.ts +122 -0
- package/packages/cli/src/ffmpeg.ts +81 -0
- package/packages/cli/src/index.ts +8 -0
- package/packages/cli/src/kf.ts +64 -0
- package/packages/cli/src/lock.ts +72 -0
- package/packages/cli/src/mix.ts +131 -0
- package/packages/cli/src/out.ts +13 -0
- package/packages/cli/src/pool.ts +34 -0
- package/packages/cli/src/segments.ts +402 -0
- package/packages/cli/src/serve.ts +124 -0
- package/packages/clock/package.json +14 -0
- package/packages/clock/src/index.ts +25 -0
- package/packages/clock/src/install.ts +351 -0
- package/packages/clock/src/types.ts +45 -0
- package/packages/core/package.json +9 -0
- package/packages/core/src/beats.ts +283 -0
- package/packages/core/src/ease.ts +87 -0
- package/packages/core/src/frame.ts +99 -0
- package/packages/core/src/index.ts +27 -0
- package/packages/core/src/project.ts +157 -0
- package/packages/core/src/rand.ts +56 -0
- package/packages/core/src/spring.ts +52 -0
- package/packages/core/src/style.ts +100 -0
- package/packages/core/src/time.ts +88 -0
- package/packages/director/package.json +23 -0
- package/packages/director/src/assemble.ts +361 -0
- package/packages/director/src/brief.ts +122 -0
- package/packages/director/src/catalog.ts +49 -0
- package/packages/director/src/content.ts +343 -0
- package/packages/director/src/fallback.ts +58 -0
- package/packages/director/src/index.ts +13 -0
- package/packages/director/src/pattern.ts +90 -0
- package/packages/director/src/patterns/fill/cells.ts +115 -0
- package/packages/director/src/patterns/formula/stack.ts +93 -0
- package/packages/director/src/patterns/util.ts +58 -0
- package/packages/director/src/scene.ts +62 -0
- package/packages/director/src/select.ts +163 -0
- package/packages/director/src/transitions.ts +115 -0
- package/packages/gen/PROVIDERS.md +90 -0
- package/packages/gen/package.json +9 -0
- package/packages/gen/src/ask.ts +132 -0
- package/packages/gen/src/audio.ts +91 -0
- package/packages/gen/src/blender.ts +54 -0
- package/packages/gen/src/capabilities.ts +151 -0
- package/packages/gen/src/generate.ts +206 -0
- package/packages/gen/src/image/codex.ts +117 -0
- package/packages/gen/src/image/og.ts +133 -0
- package/packages/gen/src/index.ts +26 -0
- package/packages/gen/src/keys.ts +86 -0
- package/packages/gen/src/media.ts +150 -0
- package/packages/gen/src/music/elevenlabs.ts +41 -0
- package/packages/gen/src/music/index.ts +120 -0
- package/packages/gen/src/music/library.ts +73 -0
- package/packages/gen/src/music/lyria.ts +52 -0
- package/packages/gen/src/music/types.ts +28 -0
- package/packages/gen/src/plan.ts +106 -0
- package/packages/gen/src/registry.ts +54 -0
- package/packages/gen/src/seam.ts +103 -0
- package/packages/gen/src/tts/dashscope.ts +64 -0
- package/packages/gen/src/tts/elevenlabs.ts +84 -0
- package/packages/gen/src/tts/gemini.ts +73 -0
- package/packages/gen/src/tts/index.ts +241 -0
- package/packages/gen/src/tts/local.ts +42 -0
- package/packages/gen/src/tts/types.ts +44 -0
- package/packages/gen/src/types.ts +90 -0
- package/packages/gen/src/video/fal.ts +140 -0
- package/packages/gen/src/video/h3.ts +112 -0
- package/packages/gen/src/video/http.ts +44 -0
- package/packages/gen/src/video/ltx.ts +60 -0
- package/packages/gen/src/video/minimax.ts +55 -0
- package/packages/gen/src/video/veo.ts +71 -0
- package/packages/jizura/package.json +16 -0
- package/packages/jizura/src/deny.ts +73 -0
- package/packages/jizura/src/index.ts +7 -0
- package/packages/jizura/src/install.ts +269 -0
- package/packages/jizura/src/layer.ts +325 -0
- package/packages/jizura/src/lyrics.ts +81 -0
- package/packages/jizura/src/pin.ts +8 -0
- package/packages/jizura/src/vendor.ts +140 -0
- package/packages/jizura/src/vite.ts +63 -0
- package/packages/jizura/vendor/JIZURA_LICENSE.txt +21 -0
- package/packages/jizura/vendor/NOTICE +43 -0
- package/packages/jizura/vendor/engine.json +47 -0
- package/packages/jizura/vendor/fonts/BlackHanSans-Regular.woff2 +0 -0
- package/packages/jizura/vendor/fonts/DotGothic16-Regular.woff2 +0 -0
- package/packages/jizura/vendor/fonts/GowunBatang-Bold.woff2 +0 -0
- package/packages/jizura/vendor/fonts/IBMPlexMono-Medium.ttf +0 -0
- package/packages/jizura/vendor/fonts/IBMPlexMono-SemiBold.ttf +0 -0
- package/packages/jizura/vendor/fonts/NotoSansKR-VF.woff2 +0 -0
- package/packages/jizura/vendor/fonts/NotoSerifKR-VF.woff2 +0 -0
- package/packages/jizura/vendor/fonts/OFL-blackhansans.txt +93 -0
- package/packages/jizura/vendor/fonts/OFL-dotgothic16.txt +93 -0
- package/packages/jizura/vendor/fonts/OFL-gowunbatang.txt +94 -0
- package/packages/jizura/vendor/fonts/OFL-ibmplexmono.txt +93 -0
- package/packages/jizura/vendor/fonts/OFL-notosanskr.txt +93 -0
- package/packages/jizura/vendor/fonts/OFL-notoserifkr.txt +94 -0
- package/packages/jizura/vendor/fonts/fonts.json +52 -0
- package/packages/jizura/vendor/jizura_engine.js +35024 -0
- package/packages/motion/README.md +153 -0
- package/packages/motion/package.json +30 -0
- package/packages/motion/src/camera.ts +97 -0
- package/packages/motion/src/captions.ts +487 -0
- package/packages/motion/src/enter.ts +128 -0
- package/packages/motion/src/hangul.ts +129 -0
- package/packages/motion/src/impact.ts +100 -0
- package/packages/motion/src/index.ts +17 -0
- package/packages/motion/src/moves/brushWipe.ts +103 -0
- package/packages/motion/src/moves/cloneArray.ts +111 -0
- package/packages/motion/src/moves/curtains.ts +81 -0
- package/packages/motion/src/moves/dress.ts +191 -0
- package/packages/motion/src/moves/echoStack.ts +70 -0
- package/packages/motion/src/moves/fit.ts +70 -0
- package/packages/motion/src/moves/flood.ts +61 -0
- package/packages/motion/src/moves/ghostStack.ts +88 -0
- package/packages/motion/src/moves/gridFloor.ts +100 -0
- package/packages/motion/src/moves/imageSwarm.ts +113 -0
- package/packages/motion/src/moves/index.ts +38 -0
- package/packages/motion/src/moves/irisBlades.ts +113 -0
- package/packages/motion/src/moves/karaokeLine.ts +108 -0
- package/packages/motion/src/moves/ledBoard.ts +94 -0
- package/packages/motion/src/moves/liquidTab.ts +72 -0
- package/packages/motion/src/moves/markerWrite.ts +63 -0
- package/packages/motion/src/moves/menu.ts +138 -0
- package/packages/motion/src/moves/morphBox.ts +96 -0
- package/packages/motion/src/moves/neonSign.ts +78 -0
- package/packages/motion/src/moves/panelPop.ts +78 -0
- package/packages/motion/src/moves/paperTear.ts +75 -0
- package/packages/motion/src/moves/path.ts +64 -0
- package/packages/motion/src/moves/pathText.ts +107 -0
- package/packages/motion/src/moves/pointSphere.ts +109 -0
- package/packages/motion/src/moves/ransomLetters.ts +73 -0
- package/packages/motion/src/moves/shapeMorph.ts +143 -0
- package/packages/motion/src/moves/slamWords.ts +96 -0
- package/packages/motion/src/moves/sparkTrail.ts +130 -0
- package/packages/motion/src/moves/speedLines.ts +91 -0
- package/packages/motion/src/moves/splitFlap.ts +149 -0
- package/packages/motion/src/moves/stepWords.ts +128 -0
- package/packages/motion/src/moves/strikeOut.ts +98 -0
- package/packages/motion/src/moves/sunburst.ts +58 -0
- package/packages/motion/src/moves/tickerRows.ts +91 -0
- package/packages/motion/src/moves/tokenPicker.ts +115 -0
- package/packages/motion/src/moves/truchet.ts +85 -0
- package/packages/motion/src/moves/wordWall.ts +78 -0
- package/packages/motion/src/moves/worldRoll.ts +32 -0
- package/packages/motion/src/particles.ts +102 -0
- package/packages/motion/src/react/index.tsx +21 -0
- package/packages/motion/src/react/parts.tsx +431 -0
- package/packages/motion/src/react/time.tsx +97 -0
- package/packages/motion/src/text.ts +103 -0
- package/packages/motion/src/transition.ts +82 -0
- package/packages/motion/src/transition3d/cards.ts +65 -0
- package/packages/motion/src/transition3d/chain.ts +84 -0
- package/packages/motion/src/transition3d/dive.ts +181 -0
- package/packages/motion/src/transition3d/fold.ts +110 -0
- package/packages/motion/src/transition3d/gl.ts +219 -0
- package/packages/motion/src/transition3d/index.ts +235 -0
- package/packages/motion/src/transition3d/live.ts +70 -0
- package/packages/motion/src/transition3d/portal.ts +115 -0
- package/packages/motion/src/transition3d/react.tsx +29 -0
- package/packages/motion/src/transition3d/rig.ts +600 -0
- package/packages/motion/src/transition3d/shatter.ts +104 -0
- package/packages/motion/src/transition3d/space.ts +173 -0
- package/packages/motion/src/transition3d/whip.ts +78 -0
- package/packages/motion/src/transition3d/world.ts +737 -0
- package/packages/motion/src/transition3d/zoomOut.ts +114 -0
- package/packages/motion/src/transitions2d/catalog.ts +127 -0
- package/packages/motion/src/transitions2d/css.d.ts +2 -0
- package/packages/motion/src/transitions2d/cult-ui/LICENSE.md +9 -0
- package/packages/motion/src/transitions2d/cult-ui/RollingNumber.tsx +43 -0
- package/packages/motion/src/transitions2d/gl-transitions/LICENSE +25 -0
- package/packages/motion/src/transitions2d/gl-transitions/shaders.ts +1931 -0
- package/packages/motion/src/transitions2d/index.ts +2 -0
- package/packages/motion/src/transitions2d/kokonutui/LICENSE +21 -0
- package/packages/motion/src/transitions2d/kokonutui/MatrixText.css +16 -0
- package/packages/motion/src/transitions2d/kokonutui/MatrixText.tsx +94 -0
- package/packages/motion/src/transitions2d/magicui/HyperText.css +15 -0
- package/packages/motion/src/transitions2d/magicui/HyperText.tsx +115 -0
- package/packages/motion/src/transitions2d/magicui/LICENSE.md +21 -0
- package/packages/motion/src/transitions2d/magicui/MorphingText.css +25 -0
- package/packages/motion/src/transitions2d/magicui/MorphingText.tsx +130 -0
- package/packages/motion/src/transitions2d/magicui/WordRotate.tsx +42 -0
- package/packages/motion/src/transitions2d/react.ts +13 -0
- package/packages/motion/src/transitions2d/skiper-ui/ClipDiv.css +39 -0
- package/packages/motion/src/transitions2d/skiper-ui/ClipDiv.tsx +32 -0
- package/packages/motion/src/transitions2d/smoothui/LICENSE +21 -0
- package/packages/motion/src/transitions2d/smoothui/SharedAxisY.tsx +50 -0
- package/packages/motion/src/transitions2d/smoothui/TextMorph.tsx +90 -0
- package/packages/motion/src/transitions2d/smoothui/shaders.ts +223 -0
- package/packages/motion/src/transitions2d/unlumen/LICENSE +21 -0
- package/packages/motion/src/transitions2d/unlumen/ScrambleText.tsx +114 -0
- package/packages/motion/src/transitions2d/vengeance-ui/LICENSE +21 -0
- package/packages/motion/src/transitions2d/vengeance-ui/MorphText.css +69 -0
- package/packages/motion/src/transitions2d/vengeance-ui/MorphText.tsx +45 -0
- package/packages/motion/src/type.ts +131 -0
- package/packages/motion/src/ui.ts +172 -0
- package/packages/patterns/package.json +15 -0
- package/packages/patterns/src/bars/rank.ts +119 -0
- package/packages/patterns/src/before-after/shrink.ts +127 -0
- package/packages/patterns/src/before-after/strike.ts +125 -0
- package/packages/patterns/src/code/terminal.ts +133 -0
- package/packages/patterns/src/compare/bars.ts +142 -0
- package/packages/patterns/src/compare/duel.ts +103 -0
- package/packages/patterns/src/end/lockup.ts +85 -0
- package/packages/patterns/src/end/slam.ts +91 -0
- package/packages/patterns/src/flow/graph.ts +250 -0
- package/packages/patterns/src/hook-number/counter.ts +101 -0
- package/packages/patterns/src/hook-number/roll.ts +179 -0
- package/packages/patterns/src/hook-number/slam.ts +91 -0
- package/packages/patterns/src/index.ts +38 -0
- package/packages/patterns/src/kit.ts +449 -0
- package/packages/patterns/src/limit/gauge.ts +117 -0
- package/packages/patterns/src/list/cards.ts +131 -0
- package/packages/patterns/src/list/cycle.ts +22 -0
- package/packages/patterns/src/media/panels.ts +100 -0
- package/packages/patterns/src/objects.ts +234 -0
- package/packages/patterns/src/quote/karaoke.ts +126 -0
- package/packages/patterns/src/quote/slam.ts +22 -0
- package/packages/patterns/src/screen/focus.ts +85 -0
- package/packages/patterns/src/steps/path.ts +137 -0
- package/packages/patterns/src/steps/stack.ts +111 -0
- package/packages/patterns/src/term-reveal/chips.ts +92 -0
- package/packages/patterns/src/term-reveal/expand.ts +127 -0
- package/packages/patterns/src/timeline/axis.ts +144 -0
- package/packages/patterns/src/title/mask.ts +85 -0
- package/packages/patterns/src/title/slam.ts +23 -0
- package/packages/patterns/src/toggle-sim/switch.ts +92 -0
- package/packages/patterns/src/trend/columns.ts +108 -0
- package/packages/patterns/src/trend/draw.ts +140 -0
- package/packages/patterns/src/types.ts +67 -0
- package/packages/patterns/src/words/moves.ts +42 -0
- package/packages/patterns/src/words/slam.ts +4 -0
- package/packages/plan/package.json +15 -0
- package/packages/plan/src/asks.ts +256 -0
- package/packages/plan/src/brief.ts +383 -0
- package/packages/plan/src/captions.ts +78 -0
- package/packages/plan/src/detect.ts +93 -0
- package/packages/plan/src/index.ts +27 -0
- package/packages/plan/src/layout.ts +176 -0
- package/packages/plan/src/llm.ts +172 -0
- package/packages/plan/src/look.ts +222 -0
- package/packages/plan/src/plan.ts +179 -0
- package/packages/plan/src/request.ts +55 -0
- package/packages/plan/src/series.ts +76 -0
- package/packages/plan/src/studio.ts +53 -0
- package/packages/plan/src/templates.ts +42 -0
- package/packages/plan/src/themes.ts +48 -0
- package/packages/plan/src/types.ts +157 -0
- package/packages/studio/package.json +12 -0
- package/packages/studio/src/index.ts +1 -0
- package/packages/studio/src/plugin.ts +236 -0
- package/packages/studio/src/ui/main.ts +503 -0
- package/packages/studio/src/ui/studio.css +165 -0
- package/packages/studio/src/ui/timeline.ts +317 -0
- package/packages/themes/kit/THEME-MAKE.md +68 -0
- package/packages/themes/kit/THEME.md +30 -0
- package/packages/themes/kit/briefs/og-intro-15s/brief.json +16 -0
- package/packages/themes/kit/briefs/og-intro-15s/facts.ts +29 -0
- package/packages/themes/kit/briefs/og-intro-15s/logo.svg +12 -0
- package/packages/themes/kit/effects.ts +5 -0
- package/packages/themes/kit/sample/index.html +11 -0
- package/packages/themes/kit/sample/main.ts +9 -0
- package/packages/themes/kit/sample/scenes/scene.ts +15 -0
- package/packages/themes/package.json +19 -0
- package/packages/themes/src/factory.ts +296 -0
- package/packages/themes/src/fx.ts +14 -0
- package/packages/themes/src/index.ts +114 -0
- package/packages/themes/src/slotkit.ts +79 -0
- package/packages/themes/src/slots.ts +46 -0
- package/packages/themes/src/stage3d.ts +197 -0
- package/packages/themes/src/types.ts +58 -0
- package/presets/kawaii-pastel.json +94 -0
- package/presets/neutral-dark.json +82 -0
- package/presets/og.json +98 -0
- package/series/og-shorts.json +14 -0
- package/skills/kasaframe/SKILL.md +33 -0
- package/templates/_shared/project/index.html +11 -0
- package/templates/_shared/project/lib/react.ts +22 -0
- package/templates/_shared/project/lib/stage.ts +292 -0
- package/templates/_shared/project/main.ts +9 -0
- package/templates/_shared/scenes/default.ts +21 -0
- package/templates/_shared/scenes/drop.ts +33 -0
- package/templates/_shared/scenes/end.ts +26 -0
- package/templates/_shared/scenes/hook.ts +18 -0
- package/templates/_shared/scenes/seam.ts +41 -0
- package/templates/_shared/scenes/step.ts +49 -0
- package/templates/ad/preview.png +0 -0
- package/templates/ad/template.json +151 -0
- package/templates/demo/preview.png +0 -0
- package/templates/demo/template.json +141 -0
- package/templates/explainer/preview.png +0 -0
- package/templates/explainer/template.json +193 -0
- package/templates/launch/preview.png +0 -0
- package/templates/launch/template.json +163 -0
- package/templates/mv/preview.png +0 -0
- package/templates/mv/scenes/default.ts +98 -0
- package/templates/mv/template.json +178 -0
- package/templates/promo/preview.png +0 -0
- package/templates/promo/template.json +185 -0
- package/templates/shorts/preview.png +0 -0
- package/templates/shorts/scenes/hook.ts +37 -0
- package/templates/shorts/template.json +196 -0
- package/templates/square/preview.png +0 -0
- package/templates/square/template.json +133 -0
- package/themes/debug-hud/THEME.md +39 -0
- package/themes/debug-hud/effects.ts +389 -0
- package/themes/debug-hud/sample/assets/og/logo.svg +12 -0
- package/themes/debug-hud/sample/beats.json +1 -0
- package/themes/debug-hud/sample/index.html +11 -0
- package/themes/debug-hud/sample/kf.json +59 -0
- package/themes/debug-hud/sample/lib/hudkit.ts +49 -0
- package/themes/debug-hud/sample/lib/og.ts +29 -0
- package/themes/debug-hud/sample/main.ts +9 -0
- package/themes/debug-hud/sample/scenes/end.ts +62 -0
- package/themes/debug-hud/sample/scenes/gather.ts +67 -0
- package/themes/debug-hud/sample/scenes/models.ts +70 -0
- package/themes/debug-hud/sample/scenes/price.ts +79 -0
- package/themes/debug-hud/sample/style.json +91 -0
- package/themes/debug-hud/slots.ts +99 -0
- package/themes/debug-hud/still.png +0 -0
- package/themes/debug-hud/style.json +91 -0
- package/themes/debug-hud/theme.json +68 -0
- package/themes/og-measure/THEME.md +47 -0
- package/themes/og-measure/effects.ts +432 -0
- package/themes/og-measure/sample/assets/brand/og-logo-full.svg +12 -0
- package/themes/og-measure/sample/assets/brand/og-logo.svg +12 -0
- package/themes/og-measure/sample/assets/data/measure.json +353 -0
- package/themes/og-measure/sample/beats.json +1 -0
- package/themes/og-measure/sample/index.html +11 -0
- package/themes/og-measure/sample/kf.json +66 -0
- package/themes/og-measure/sample/lib/data.ts +62 -0
- package/themes/og-measure/sample/main.ts +9 -0
- package/themes/og-measure/sample/measure.ts +78 -0
- package/themes/og-measure/sample/scenes/end.ts +47 -0
- package/themes/og-measure/sample/scenes/gather.ts +51 -0
- package/themes/og-measure/sample/scenes/models.ts +34 -0
- package/themes/og-measure/sample/scenes/one.ts +39 -0
- package/themes/og-measure/sample/scenes/price.ts +56 -0
- package/themes/og-measure/sample/style.json +97 -0
- package/themes/og-measure/slots.ts +88 -0
- package/themes/og-measure/still.png +0 -0
- package/themes/og-measure/style.json +97 -0
- package/themes/og-measure/theme.json +79 -0
- package/themes/riso-zine/THEME.md +43 -0
- package/themes/riso-zine/effects.ts +321 -0
- package/themes/riso-zine/sample/assets/og/logo.svg +12 -0
- package/themes/riso-zine/sample/beats.json +1 -0
- package/themes/riso-zine/sample/index.html +11 -0
- package/themes/riso-zine/sample/kf.json +59 -0
- package/themes/riso-zine/sample/lib/og.ts +29 -0
- package/themes/riso-zine/sample/lib/shot.ts +86 -0
- package/themes/riso-zine/sample/lib/zine.ts +42 -0
- package/themes/riso-zine/sample/main.ts +9 -0
- package/themes/riso-zine/sample/scenes/end.ts +61 -0
- package/themes/riso-zine/sample/scenes/gather.ts +62 -0
- package/themes/riso-zine/sample/scenes/models.ts +52 -0
- package/themes/riso-zine/sample/scenes/price.ts +82 -0
- package/themes/riso-zine/sample/style.json +99 -0
- package/themes/riso-zine/slots.ts +81 -0
- package/themes/riso-zine/still.png +0 -0
- package/themes/riso-zine/style.json +99 -0
- package/themes/riso-zine/theme.json +75 -0
- package/tools/beats/beats.py +372 -0
- package/tools/beats/requirements.txt +3 -0
- package/tools/lyrics/align.py +164 -0
- package/tools/lyrics/requirements.txt +9 -0
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { capabilities } from "@kasaframe/gen";
|
|
2
|
+
import { readFileSync } from "node:fs";
|
|
3
|
+
import { arch, platform } from "node:os";
|
|
4
|
+
import { join } from "node:path";
|
|
5
|
+
import type { Command } from "../command.ts";
|
|
6
|
+
import { checks, pad, report } from "../deps.ts";
|
|
7
|
+
import { repoRoot } from "../serve.ts";
|
|
8
|
+
|
|
9
|
+
const cmd: Command = {
|
|
10
|
+
summary: "바깥 도구 점검 — ffmpeg·크롬(Playwright)·python3+librosa·OG 키, 없으면 까는 명령",
|
|
11
|
+
usage: `kf doctor
|
|
12
|
+
없음 은 렌더가 안 되는 것, 선택 은 그 기능만 빠지는 것. 크롬·librosa 는 kf setup 이 깐다. 종료 코드: 없음 이 있으면 1`,
|
|
13
|
+
async run() {
|
|
14
|
+
const version = JSON.parse(readFileSync(join(repoRoot, "package.json"), "utf8")).version ?? "?";
|
|
15
|
+
console.log(`kasaframe ${version} · Node ${process.version} · ${platform()} ${arch()}\n`);
|
|
16
|
+
const list = await checks();
|
|
17
|
+
report(list);
|
|
18
|
+
const missing = list.filter((c) => c.required && !c.ok);
|
|
19
|
+
console.log("\n생성 능력(kf make 가 쓰는 것 — 없으면 kf make 가 만들기 전에 묻는다. 키는 값 없이 유무만)");
|
|
20
|
+
for (const c of await capabilities({ probe: true })) {
|
|
21
|
+
const ok = c.providers.filter((p) => p.ready);
|
|
22
|
+
console.log(` ${pad(ok.length ? "ok" : "없음", 4)} ${pad(c.label, 30)}${c.best ? `권장 ${c.best.id}${c.best.unitUsd ? ` $${c.best.unitUsd.toFixed(3)}/${c.best.unit}` : " 0원"}` : "쓸 수 있는 것 없음"}${ok.length > 1 ? ` · 그 밖 ${ok.filter((p) => p !== c.best).map((p) => p.id).join(" ")}` : ""}`);
|
|
23
|
+
for (const p of c.providers.filter((x) => !x.ready && x.fix)) console.log(` ${pad("", 36)}${p.id}: ${p.detail} → ${p.fix}`);
|
|
24
|
+
for (const p of ok.filter((x) => x.restrict)) console.log(` ${pad("", 36)}${p.id} 제한: ${p.restrict}`);
|
|
25
|
+
}
|
|
26
|
+
console.log(missing.length ? `\n렌더에 필요한 것이 ${missing.length}개 없다 — 위 → 대로 깔고 다시 kf doctor` : "\n렌더 준비 됨 — kf new <폴더> --template shorts 부터");
|
|
27
|
+
return missing.length ? 1 : 0;
|
|
28
|
+
},
|
|
29
|
+
};
|
|
30
|
+
export default cmd;
|
|
@@ -0,0 +1,173 @@
|
|
|
1
|
+
import { join, resolve } from "node:path";
|
|
2
|
+
import {
|
|
3
|
+
DEFAULT_MAX_USD,
|
|
4
|
+
estimateImageUsd,
|
|
5
|
+
genImage,
|
|
6
|
+
genVideo,
|
|
7
|
+
hasKey,
|
|
8
|
+
imageProviders,
|
|
9
|
+
NeedsApproval,
|
|
10
|
+
planVideo,
|
|
11
|
+
resolvePlan,
|
|
12
|
+
seam,
|
|
13
|
+
videoProviders,
|
|
14
|
+
whereToPut,
|
|
15
|
+
type Asset,
|
|
16
|
+
type GenContext,
|
|
17
|
+
} from "@kasaframe/gen";
|
|
18
|
+
import type { Command } from "../command.ts";
|
|
19
|
+
import { num, parseFlags } from "../command.ts";
|
|
20
|
+
|
|
21
|
+
const USAGE = `kf gen models
|
|
22
|
+
kf gen img "<프롬프트>" --id <이름> [--size 1920x1080] [--transparent] [--ref a.png,b.png] [--quality high] [--provider og-gpt-image-2.5-sunburst]
|
|
23
|
+
kf gen vid "<프롬프트>" --id <이름> [--first a.png] [--last b.png] [--dur 5] [--aspect 16:9] [--provider wan-2.2-turbo] [--max-usd 1] [--yes]
|
|
24
|
+
kf gen seam <폴더> <이음매 장면 id> "<프롬프트>" [--provider ...] [--first a.png] [--last b.png] [--smooth] [--yes]
|
|
25
|
+
kf gen plan <폴더> [--yes]
|
|
26
|
+
|
|
27
|
+
공통: --project <폴더>(결과는 <폴더>/assets/gen) · --out <폴더> · --max-usd <영상 하나 상한, 기본 ${DEFAULT_MAX_USD}>
|
|
28
|
+
영상은 --yes 가 없으면 견적만 내고 종료 코드 3. 같은 입력은 캐시(~/.cache/kasaframe/gen)에서 꺼내 돈이 안 든다.`;
|
|
29
|
+
|
|
30
|
+
function usage(): number {
|
|
31
|
+
console.error(USAGE);
|
|
32
|
+
return 2;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
function ctxOf(opts: Record<string, string | boolean | undefined>, outDir: string): GenContext {
|
|
36
|
+
return {
|
|
37
|
+
outDir,
|
|
38
|
+
maxUsd: num(opts["max-usd"], DEFAULT_MAX_USD),
|
|
39
|
+
approve: opts.yes === true,
|
|
40
|
+
log: (l) => console.error(l),
|
|
41
|
+
};
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function outDirOf(opts: Record<string, string | boolean | undefined>): string {
|
|
45
|
+
if (typeof opts.out === "string") return resolve(opts.out);
|
|
46
|
+
if (typeof opts.project === "string") return join(resolve(opts.project), "assets", "gen");
|
|
47
|
+
return resolve("assets/gen");
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
function report(a: Asset): void {
|
|
51
|
+
const m = a.meta;
|
|
52
|
+
const cost = a.cached ? "캐시(0)" : `$${m.costUsd.toFixed(4)}${m.costEstimated ? "(단가표)" : ""}`;
|
|
53
|
+
const size = m.duration ? `${m.width}x${m.height} ${m.duration.toFixed(2)}초` : `${m.width}x${m.height}`;
|
|
54
|
+
console.log(`${a.path}\n ${m.provider} · ${size} · ${cost} · ${(m.elapsedMs / 1000).toFixed(1)}초${m.notes?.length ? ` · ${m.notes.join(" ")}` : ""}`);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
function models(): number {
|
|
58
|
+
const sample = { prompt: "", duration: 5, aspect: "16:9", firstFrame: "x", lastFrame: "y", resolution: "720p" };
|
|
59
|
+
console.log("그림");
|
|
60
|
+
for (const p of imageProviders()) {
|
|
61
|
+
const est = estimateImageUsd({ prompt: "", size: "1920x1080", quality: "high" });
|
|
62
|
+
console.log(` ${p.id.padEnd(30)} 1920x1080 high 최대 $${est.toFixed(3)} 키 ${hasKey(p.keyName) ? "있음" : `없음 — ${whereToPut(p.keyName)}`}`);
|
|
63
|
+
}
|
|
64
|
+
console.log("\n영상 (5초 720p 끝 프레임 포함 견적)");
|
|
65
|
+
for (const p of videoProviders()) {
|
|
66
|
+
const key = hasKey(p.keyName) ? "있음" : `없음 — ${whereToPut(p.keyName)}`;
|
|
67
|
+
console.log(` ${p.id.padEnd(30)} $${p.estimateUsd(sample).toFixed(3).padEnd(6)} 길이 ${p.durations[0]}–${p.durations[p.durations.length - 1]}초 키 ${key}`);
|
|
68
|
+
console.log(` ${"".padEnd(30)} ${p.license} · ${p.region}`);
|
|
69
|
+
}
|
|
70
|
+
return 0;
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
async function guarded(f: () => Promise<number>): Promise<number> {
|
|
74
|
+
try {
|
|
75
|
+
return await f();
|
|
76
|
+
} catch (e) {
|
|
77
|
+
if (e instanceof NeedsApproval) {
|
|
78
|
+
console.error(`승인 필요: ${e.message}\n 돈을 쓰려면 같은 명령에 --yes (상한은 --max-usd)`);
|
|
79
|
+
return 3;
|
|
80
|
+
}
|
|
81
|
+
throw e;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
const cmd: Command = {
|
|
86
|
+
summary: "그림·영상 생성(OG gpt-image · fal Wan/Kling · MiniMax · Veo · LTX) — 캐시·예산·이음매 전환",
|
|
87
|
+
usage: USAGE,
|
|
88
|
+
async run(argv) {
|
|
89
|
+
const [sub, ...rest] = argv;
|
|
90
|
+
const { args, opts } = parseFlags(rest);
|
|
91
|
+
if (sub === "models") return models();
|
|
92
|
+
|
|
93
|
+
if (sub === "img") {
|
|
94
|
+
const prompt = args[0];
|
|
95
|
+
if (!prompt || typeof opts.id !== "string") return usage();
|
|
96
|
+
return guarded(async () => {
|
|
97
|
+
const refs = typeof opts.ref === "string" ? opts.ref.split(",").map((r) => resolve(r)) : undefined;
|
|
98
|
+
const a = await genImage(
|
|
99
|
+
opts.id as string,
|
|
100
|
+
{ prompt, size: typeof opts.size === "string" ? opts.size : "1920x1080", transparent: opts.transparent === true, refs, quality: opts.quality as string | undefined },
|
|
101
|
+
ctxOf(opts, outDirOf(opts)),
|
|
102
|
+
opts.provider as string | undefined,
|
|
103
|
+
);
|
|
104
|
+
report(a);
|
|
105
|
+
return 0;
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
if (sub === "vid") {
|
|
110
|
+
const prompt = args[0];
|
|
111
|
+
if (!prompt || typeof opts.id !== "string") return usage();
|
|
112
|
+
return guarded(async () => {
|
|
113
|
+
const req = {
|
|
114
|
+
prompt,
|
|
115
|
+
firstFrame: typeof opts.first === "string" ? resolve(opts.first) : undefined,
|
|
116
|
+
lastFrame: typeof opts.last === "string" ? resolve(opts.last) : undefined,
|
|
117
|
+
duration: num(opts.dur, 5),
|
|
118
|
+
aspect: typeof opts.aspect === "string" ? opts.aspect : "16:9",
|
|
119
|
+
resolution: opts.resolution as string | undefined,
|
|
120
|
+
seed: typeof opts.seed === "string" ? Number(opts.seed) : undefined,
|
|
121
|
+
};
|
|
122
|
+
const ctx = ctxOf(opts, outDirOf(opts));
|
|
123
|
+
const plan = planVideo(req, ctx, opts.provider as string | undefined);
|
|
124
|
+
console.error(`${plan.provider.id} 견적 $${plan.estimateUsd.toFixed(3)}${plan.cached ? " (캐시 있음 — 0원)" : ""}`);
|
|
125
|
+
report(await genVideo(opts.id as string, req, ctx, opts.provider as string | undefined));
|
|
126
|
+
return 0;
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
if (sub === "seam") {
|
|
131
|
+
const [project, scene, prompt] = args;
|
|
132
|
+
if (!project || !scene || !prompt) return usage();
|
|
133
|
+
return guarded(async () => {
|
|
134
|
+
const a = await seam(
|
|
135
|
+
{
|
|
136
|
+
project,
|
|
137
|
+
scene,
|
|
138
|
+
prompt,
|
|
139
|
+
provider: opts.provider as string | undefined,
|
|
140
|
+
first: typeof opts.first === "string" ? resolve(opts.first) : undefined,
|
|
141
|
+
last: typeof opts.last === "string" ? resolve(opts.last) : undefined,
|
|
142
|
+
smooth: opts.smooth === true,
|
|
143
|
+
resolution: opts.resolution as string | undefined,
|
|
144
|
+
},
|
|
145
|
+
ctxOf(opts, join(resolve(project), "assets", "gen")),
|
|
146
|
+
);
|
|
147
|
+
report(a);
|
|
148
|
+
return 0;
|
|
149
|
+
});
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
if (sub === "plan") {
|
|
153
|
+
const project = args[0];
|
|
154
|
+
if (!project) return usage();
|
|
155
|
+
const { outDir: _, ...ctx } = ctxOf(opts, "");
|
|
156
|
+
const reports = await resolvePlan(project, ctx);
|
|
157
|
+
let spent = 0;
|
|
158
|
+
let waiting = 0;
|
|
159
|
+
for (const r of reports) {
|
|
160
|
+
spent += r.costUsd ?? 0;
|
|
161
|
+
if (r.status === "needs-approval") waiting += r.estimateUsd ?? 0;
|
|
162
|
+
const tail = r.status === "made" || r.status === "cached" ? r.path : r.error;
|
|
163
|
+
console.log(`${r.status.padEnd(15)} ${r.kind} ${r.id.padEnd(20)} ${tail ?? ""}`);
|
|
164
|
+
}
|
|
165
|
+
console.log(`\n쓴 돈 $${spent.toFixed(4)}${waiting ? ` · 승인 기다리는 영상 견적 $${waiting.toFixed(3)} (--yes)` : ""}`);
|
|
166
|
+
if (reports.some((r) => r.status === "error")) return 1;
|
|
167
|
+
return reports.some((r) => r.status === "needs-approval") ? 3 : 0;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
return usage();
|
|
171
|
+
},
|
|
172
|
+
};
|
|
173
|
+
export default cmd;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { writeFileSync } from "node:fs";
|
|
2
|
+
import { dirname, join, resolve } from "node:path";
|
|
3
|
+
import { DEFAULT_EYES, formatLook, look, lookSheet, premiumBlock } from "@kasaframe/plan";
|
|
4
|
+
import { type Command, parseFlags } from "../command.ts";
|
|
5
|
+
|
|
6
|
+
const cmd: Command = {
|
|
7
|
+
summary: "세션이 직접 볼 것 — 장면 모음 한 장과 장면별 확인표의 경로(외부 모델 0). 눈 없는 세션은 --vision-model",
|
|
8
|
+
usage: `kf look <폴더 | 영상.mp4> [--vision-model ${DEFAULT_EYES} [--ask "<볼 것>"]] [--json]
|
|
9
|
+
|
|
10
|
+
기본: 장면 모음(kf sheet — 장면마다 가운데 한 장, 4열)과 장면별 확인표(look.md)를 만들고 경로를 찍는다.
|
|
11
|
+
세션이 그림을 Read 로 직접 보고 확인표를 따라 고친다. 외부 모델을 부르지 않는다(돈 0). 폴더면 out/, mp4 면 옆에 둔다.
|
|
12
|
+
정지 그림이라 0.1초 멈춤·박·섬광·카메라 이동은 kf check 가 본다.
|
|
13
|
+
|
|
14
|
+
--vision-model 그림을 못 보는 세션(Claude Code 를 OG 로 딥시크 같은 모델에 붙이면 OG /v1/messages 가 그림을 버린다)용.
|
|
15
|
+
그 모델이 OG chat/completions 로 장면 모음을 보고 장면별 글 보고(한 번에 1센트 안팎) — JSON 은 out/look.json,
|
|
16
|
+
문제 장면이 있으면 종료 코드 1
|
|
17
|
+
--ask --vision-model 에게 따로 물을 것
|
|
18
|
+
--allow-premium Opus·GPT 계열 모델을 푼다(KF_ALLOW_PREMIUM=1 과 같다) — 없으면 부르기 전에 막는다`,
|
|
19
|
+
async run(argv) {
|
|
20
|
+
const { args, opts } = parseFlags(argv);
|
|
21
|
+
if (!args[0]) {
|
|
22
|
+
console.error("kf look: 폴더나 mp4 를 준다 — kf look --help");
|
|
23
|
+
return 2;
|
|
24
|
+
}
|
|
25
|
+
const target = resolve(args[0]);
|
|
26
|
+
const model = typeof opts["vision-model"] === "string" ? opts["vision-model"] : undefined;
|
|
27
|
+
if (!model) {
|
|
28
|
+
if (typeof opts.ask === "string") console.error("kf look: --ask 는 --vision-model 과 함께 쓴다 — 기본은 세션이 직접 본다");
|
|
29
|
+
const s = lookSheet(target);
|
|
30
|
+
console.log(opts.json ? JSON.stringify(s, null, 2) : `장면 모음: ${s.sheet}\n확인표: ${s.checklist}\n— 장면 ${s.scenes}개. 그림을 Read 로 직접 보고 확인표대로 고친다`);
|
|
31
|
+
return 0;
|
|
32
|
+
}
|
|
33
|
+
if (opts["allow-premium"]) process.env.KF_ALLOW_PREMIUM = "1";
|
|
34
|
+
const why = premiumBlock(model);
|
|
35
|
+
if (why) {
|
|
36
|
+
console.error(`kf look: ${why}`);
|
|
37
|
+
return 2;
|
|
38
|
+
}
|
|
39
|
+
const r = await look(target, { ask: typeof opts.ask === "string" ? opts.ask : undefined, model });
|
|
40
|
+
const out = /\.(mp4|mov|webm|m4v)$/i.test(target) ? join(dirname(target), "look.json") : join(target, "out", "look.json");
|
|
41
|
+
writeFileSync(out, `${JSON.stringify(r, null, 2)}\n`);
|
|
42
|
+
console.log(opts.json ? JSON.stringify(r, null, 2) : formatLook(r));
|
|
43
|
+
return r.scenes.some((s) => !s.ok) ? 1 : 0;
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
export default cmd;
|
|
@@ -0,0 +1,157 @@
|
|
|
1
|
+
import { spawnSync } from "node:child_process";
|
|
2
|
+
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
3
|
+
import { dirname, join, resolve } from "node:path";
|
|
4
|
+
import { fileURLToPath } from "node:url";
|
|
5
|
+
import { type Question, WAIT } from "@kasaframe/gen";
|
|
6
|
+
import { install, type Missing } from "@kasaframe/jizura/install";
|
|
7
|
+
import { parseLyrics, toLrc } from "@kasaframe/jizura/lyrics";
|
|
8
|
+
import { type Command, num, parseFlags } from "../command.ts";
|
|
9
|
+
import { pyVenv, venvPython } from "../deps.ts";
|
|
10
|
+
|
|
11
|
+
const tools = fileURLToPath(new URL("../../../../tools/lyrics/", import.meta.url));
|
|
12
|
+
const script = join(tools, "align.py");
|
|
13
|
+
const requirements = join(tools, "requirements.txt");
|
|
14
|
+
// torch·demucs 가 무거워(2GB 안팎) beats 의 librosa venv 와 따로 둔다
|
|
15
|
+
const venv = () => pyVenv("lyrics");
|
|
16
|
+
const python = () => process.env.KF_LYRICS_PYTHON ?? venvPython(venv());
|
|
17
|
+
|
|
18
|
+
/** kf doctor 한 줄 */
|
|
19
|
+
export function lyricsCheck() {
|
|
20
|
+
const py = python();
|
|
21
|
+
const r = existsSync(py) || process.env.KF_LYRICS_PYTHON ? spawnSync(py, ["-c", "import demucs, stable_whisper; print(stable_whisper.__version__)"], { encoding: "utf8" }) : null;
|
|
22
|
+
const ok = r?.status === 0;
|
|
23
|
+
return {
|
|
24
|
+
name: "가사 정렬(demucs+stable-ts)",
|
|
25
|
+
ok,
|
|
26
|
+
required: false,
|
|
27
|
+
detail: ok ? `${py} · stable-ts ${r!.stdout.trim()}` : "없음 — kf lyrics align(공식 가사에 시각 붙이기)만 못 쓴다",
|
|
28
|
+
fix: ok ? undefined : "kf setup lyrics (torch·demucs·whisper 2GB 안팎, 첫 정렬 때 whisper 모델 1.6GB 를 더 받는다)",
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
const which = (cmd: string) => spawnSync(cmd, ["--version"], { stdio: "ignore" }).status === 0;
|
|
33
|
+
|
|
34
|
+
/** kf setup lyrics — uv 가 있으면 uv 로(빠르고 파이썬 3.12 를 스스로 받는다), 없으면 python3.12·3.11 venv + pip */
|
|
35
|
+
export function setupLyrics(): boolean {
|
|
36
|
+
const dir = venv();
|
|
37
|
+
const step = (cmd: string, args: string[]) => {
|
|
38
|
+
console.log(`\n가사 정렬: ${cmd} ${args.join(" ")}`);
|
|
39
|
+
return spawnSync(cmd, args, { stdio: "inherit" }).status === 0;
|
|
40
|
+
};
|
|
41
|
+
if (which("uv")) {
|
|
42
|
+
return (existsSync(venvPython(dir)) || step("uv", ["venv", "--python", "3.12", dir])) && step("uv", ["pip", "install", "--python", venvPython(dir), "-r", requirements]);
|
|
43
|
+
}
|
|
44
|
+
const py = ["python3.12", "python3.11"].find(which);
|
|
45
|
+
if (!py) {
|
|
46
|
+
console.error("가사 정렬: python3.12(또는 3.11)이 없다 — torch 가 3.13 이하에서 선다. uv 를 깔면(https://docs.astral.sh/uv) 파이썬까지 알아서 받는다");
|
|
47
|
+
return false;
|
|
48
|
+
}
|
|
49
|
+
return (existsSync(venvPython(dir)) || step(py, ["-m", "venv", dir])) && step(venvPython(dir), ["-m", "pip", "install", "-r", requirements]);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** 가사 층이 처음 쓰는 글꼴을 못 받았을 때 — 다른 글꼴로 대신 그리지 않고 묻는다. 답은 kf lyrics use 가 kf.json 에 적는다 */
|
|
53
|
+
export function fontsQuestion(missing: Missing[]): Question {
|
|
54
|
+
const stand = missing.every((m) => m.stand);
|
|
55
|
+
return {
|
|
56
|
+
id: "lyrics", cap: "lyrics", header: "가사 글꼴", flag: `kf lyrics use ${missing[0].project ?? "<폴더>"}`, missing: true, default: WAIT, skip: "words",
|
|
57
|
+
ask: `가사 층이 처음 쓰는 글꼴 ${missing.map((m) => m.family).join("·")} 을 못 받았다(${missing[0].reason}) — 다른 글꼴로 대신 그리지 않고 멈췄다`,
|
|
58
|
+
choices: [
|
|
59
|
+
{ value: WAIT, label: "받고 다시", note: "지금 다시 받아 본다(kf setup jizura 와 같다 — 막힌 망이면 KF_JIZURA_FONTS_URL 에 google/fonts 거울) → 같은 명령을 다시" },
|
|
60
|
+
...(stand ? [{ value: "builtin", label: "내장 글꼴로", note: `${missing.map((m) => `${m.family} → ${m.stand}`).join(", ")} — 플랜·컷은 그대로, 글자 모양만 바뀐다` }] : []),
|
|
61
|
+
{ value: "words", label: "가사 층 없이 낱말로", note: "JIZURA 레이아웃·효과 없이 부른 낱말을 DOM 글로" },
|
|
62
|
+
],
|
|
63
|
+
};
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
// kf.json "lyrics" — 가사 층이 읽는다(layer.ts lyricsMode). wait 는 지금 받아 보고 되면 원래대로(jizura)
|
|
67
|
+
async function use(dir: string | undefined, value: string | undefined): Promise<number> {
|
|
68
|
+
const kfPath = dir ? join(resolve(dir), "kf.json") : "";
|
|
69
|
+
if (!dir || !existsSync(kfPath) || !value || ![WAIT, "jizura", "builtin", "words"].includes(value)) {
|
|
70
|
+
console.error("kf lyrics use <폴더> wait|builtin|words|jizura");
|
|
71
|
+
return 2;
|
|
72
|
+
}
|
|
73
|
+
if (value === WAIT) {
|
|
74
|
+
const lyricsPath = join(resolve(dir), "lyrics.json");
|
|
75
|
+
const lang = existsSync(lyricsPath) && JSON.parse(readFileSync(lyricsPath, "utf8")).lang === "ja" ? "ja" : "ko";
|
|
76
|
+
try {
|
|
77
|
+
await install([lang]);
|
|
78
|
+
} catch (err) {
|
|
79
|
+
console.error(`kf lyrics use: 아직 못 받는다 — ${err instanceof Error ? err.message : err}`);
|
|
80
|
+
return 1;
|
|
81
|
+
}
|
|
82
|
+
value = "jizura";
|
|
83
|
+
}
|
|
84
|
+
const kf = JSON.parse(readFileSync(kfPath, "utf8"));
|
|
85
|
+
if (value === "jizura") delete kf.lyrics;
|
|
86
|
+
else kf.lyrics = value;
|
|
87
|
+
writeFileSync(kfPath, `${JSON.stringify(kf, null, 2)}\n`);
|
|
88
|
+
console.log(`${kfPath} lyrics: ${value} — 같은 명령을 다시`);
|
|
89
|
+
return 0;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
function writeLrc(json: string, lrcPath: string): void {
|
|
93
|
+
const lyrics = parseLyrics(JSON.parse(readFileSync(json, "utf8")));
|
|
94
|
+
writeFileSync(lrcPath, toLrc(lyrics));
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
const cmd: Command = {
|
|
98
|
+
summary: "가사 — 공식 가사에 줄·어절 시각을 붙여 lyrics.json + LRC (보컬 분리 + whisper 강제 정렬)",
|
|
99
|
+
usage: `kf lyrics align <곡> --text 공식가사.txt [--lang ko|ja] [--out lyrics.json] [--from 초 --duration 초] [--model large-v3-turbo] [--vocals]
|
|
100
|
+
kf lyrics lrc <lyrics.json> [--out x.lrc]
|
|
101
|
+
kf lyrics use <폴더> wait|builtin|words|jizura
|
|
102
|
+
|
|
103
|
+
align 글자는 공식 가사(한 줄 = 가사 한 줄)가 정본이고 시각만 붙인다. 곡의 일부만 쓰면 --from·--duration(시각은 --from 을 0 으로 —
|
|
104
|
+
beats.json 과 같다). 보컬만 있는 소리면 --vocals(분리를 건너뛴다). 옆에 같은 이름 .lrc 도 쓴다(2.5초 넘는 빈 자리는 [間奏]).
|
|
105
|
+
MMS 강제 정렬은 가중치가 비상업(CC-BY-NC)이라 쓰지 않는다. 깔기: kf setup lyrics (KF_LYRICS_PYTHON 으로 바꿀 수 있다)
|
|
106
|
+
모델·장치: --model(기본 large-v3-turbo) · WHISPER_DEVICE(기본 cpu — mps 는 정렬에서 깨질 때가 있다)
|
|
107
|
+
lrc lyrics.json → LRC(JIZURA·노래방 형식)
|
|
108
|
+
use 가사 층 글꼴을 처음 쓰다 못 받았을 때 고른 답을 kf.json 에 — wait(지금 다시 받기) · builtin(못 받은 얼굴을 내장 글꼴로)
|
|
109
|
+
· words(가사 층 없이 낱말로) · jizura(원래대로). 페이지 주소 ?lyrics= 가 그 판만 덮는다`,
|
|
110
|
+
async run(argv) {
|
|
111
|
+
const { args, opts } = parseFlags(argv);
|
|
112
|
+
const [sub, input] = args;
|
|
113
|
+
if (sub === "use") return use(input, args[2]);
|
|
114
|
+
if (sub === "lrc") {
|
|
115
|
+
if (!input || !existsSync(input)) {
|
|
116
|
+
console.error("kf lyrics lrc: lyrics.json 경로가 필요하다");
|
|
117
|
+
return 2;
|
|
118
|
+
}
|
|
119
|
+
const out = typeof opts.out === "string" ? opts.out : input.replace(/\.json$/, "") + ".lrc";
|
|
120
|
+
writeLrc(input, out);
|
|
121
|
+
console.log(out);
|
|
122
|
+
return 0;
|
|
123
|
+
}
|
|
124
|
+
if (sub !== "align") {
|
|
125
|
+
console.error("kf lyrics: align 또는 lrc. kf lyrics --help");
|
|
126
|
+
return 2;
|
|
127
|
+
}
|
|
128
|
+
if (!input || !existsSync(input)) {
|
|
129
|
+
console.error(`kf lyrics align: 곡이 없다: ${input ?? "(안 줌)"}`);
|
|
130
|
+
return 2;
|
|
131
|
+
}
|
|
132
|
+
if (typeof opts.text !== "string" || !existsSync(opts.text)) {
|
|
133
|
+
console.error("kf lyrics align: --text 공식가사.txt 가 필요하다(한 줄 = 가사 한 줄)");
|
|
134
|
+
return 2;
|
|
135
|
+
}
|
|
136
|
+
const lang = typeof opts.lang === "string" ? opts.lang : "ko";
|
|
137
|
+
const out = resolve(typeof opts.out === "string" ? opts.out : "lyrics.json");
|
|
138
|
+
const check = lyricsCheck();
|
|
139
|
+
if (!check.ok) {
|
|
140
|
+
console.error(`kf lyrics align: ${check.detail}\n → ${check.fix}`);
|
|
141
|
+
return 1;
|
|
142
|
+
}
|
|
143
|
+
const pyArgs = [script, "--audio", resolve(input), "--text", resolve(opts.text), "--lang", lang, "--out", out];
|
|
144
|
+
if (opts.from !== undefined) pyArgs.push("--from", String(num(opts.from, 0)));
|
|
145
|
+
if (opts.duration !== undefined) pyArgs.push("--duration", String(num(opts.duration, 0)));
|
|
146
|
+
if (typeof opts.model === "string") pyArgs.push("--model", opts.model);
|
|
147
|
+
if (opts.vocals) pyArgs.push("--no-separate");
|
|
148
|
+
const r = spawnSync(python(), pyArgs, { stdio: "inherit", cwd: dirname(out) });
|
|
149
|
+
if (r.status !== 0) return r.status ?? 1;
|
|
150
|
+
const lrc = out.replace(/\.json$/, "") + ".lrc";
|
|
151
|
+
writeLrc(out, lrc);
|
|
152
|
+
console.log(out);
|
|
153
|
+
console.log(lrc);
|
|
154
|
+
return 0;
|
|
155
|
+
},
|
|
156
|
+
};
|
|
157
|
+
export default cmd;
|