zilmate 1.9.3 → 1.10.1
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/.agents/skills/ad-creative/SKILL.md +362 -0
- package/.agents/skills/ad-creative/evals/evals.json +90 -0
- package/.agents/skills/ad-creative/references/generative-tools.md +637 -0
- package/.agents/skills/ad-creative/references/platform-specs.md +213 -0
- package/.agents/skills/ai-seo/SKILL.md +489 -0
- package/.agents/skills/ai-seo/evals/evals.json +90 -0
- package/.agents/skills/ai-seo/references/content-patterns.md +285 -0
- package/.agents/skills/ai-seo/references/content-types.md +71 -0
- package/.agents/skills/ai-seo/references/okf.md +104 -0
- package/.agents/skills/ai-seo/references/platform-ranking-factors.md +154 -0
- package/.agents/skills/clerk-backend-api/SKILL.md +426 -0
- package/.agents/skills/clerk-backend-api/evals/evals.json +87 -0
- package/.agents/skills/clerk-backend-api/scripts/api-specs-context.sh +30 -0
- package/.agents/skills/clerk-backend-api/scripts/execute-request.sh +88 -0
- package/.agents/skills/clerk-backend-api/scripts/extract-endpoint-detail.sh +165 -0
- package/.agents/skills/clerk-backend-api/scripts/extract-tag-endpoints.sh +208 -0
- package/.agents/skills/clerk-backend-api/scripts/extract-tags.js +14 -0
- package/.agents/skills/copy-editing/SKILL.md +457 -0
- package/.agents/skills/copy-editing/evals/evals.json +89 -0
- package/.agents/skills/copy-editing/references/checklist.md +66 -0
- package/.agents/skills/copy-editing/references/content-refresh.md +38 -0
- package/.agents/skills/copy-editing/references/plain-english-alternatives.md +394 -0
- package/.agents/skills/hyperframes/SKILL.md +163 -0
- package/.agents/skills/hyperframes-cli/SKILL.md +109 -0
- package/.agents/skills/hyperframes-cli/references/doctor-browser.md +45 -0
- package/.agents/skills/hyperframes-cli/references/init-and-scaffold.md +51 -0
- package/.agents/skills/hyperframes-cli/references/lambda.md +132 -0
- package/.agents/skills/hyperframes-cli/references/lint-validate-inspect.md +121 -0
- package/.agents/skills/hyperframes-cli/references/preview-render.md +109 -0
- package/.agents/skills/hyperframes-cli/references/upgrade-info-misc.md +75 -0
- package/.agents/skills/hyperframes-media/SKILL.md +97 -0
- package/.agents/skills/hyperframes-media/assets/sfx/CREDITS.md +35 -0
- package/.agents/skills/hyperframes-media/assets/sfx/manifest.json +97 -0
- package/.agents/skills/hyperframes-media/references/bgm.md +72 -0
- package/.agents/skills/hyperframes-media/references/captions/authoring.md +159 -0
- package/.agents/skills/hyperframes-media/references/captions/motion.md +87 -0
- package/.agents/skills/hyperframes-media/references/captions/transcript-handling.md +97 -0
- package/.agents/skills/hyperframes-media/references/remove-background.md +143 -0
- package/.agents/skills/hyperframes-media/references/requirements.md +29 -0
- package/.agents/skills/hyperframes-media/references/sfx.md +42 -0
- package/.agents/skills/hyperframes-media/references/transcribe.md +52 -0
- package/.agents/skills/hyperframes-media/references/tts-to-captions.md +24 -0
- package/.agents/skills/hyperframes-media/references/tts.md +135 -0
- package/.agents/skills/hyperframes-media/scripts/audio.mjs +282 -0
- package/.agents/skills/hyperframes-media/scripts/heygen-tts.mjs +121 -0
- package/.agents/skills/hyperframes-media/scripts/lib/bgm.mjs +235 -0
- package/.agents/skills/hyperframes-media/scripts/lib/heygen.mjs +131 -0
- package/.agents/skills/hyperframes-media/scripts/lib/sfx.mjs +128 -0
- package/.agents/skills/hyperframes-media/scripts/lib/tts.mjs +220 -0
- package/.agents/skills/hyperframes-media/scripts/lyria-recipe.py +128 -0
- package/.agents/skills/hyperframes-media/scripts/wait-bgm.mjs +167 -0
- package/.agents/skills/hyperframes-registry/SKILL.md +101 -0
- package/.agents/skills/hyperframes-registry/examples/add-block.md +51 -0
- package/.agents/skills/hyperframes-registry/examples/add-component.md +73 -0
- package/.agents/skills/hyperframes-registry/references/contributing.md +166 -0
- package/.agents/skills/hyperframes-registry/references/demo-html-pattern.md +54 -0
- package/.agents/skills/hyperframes-registry/references/discovery.md +215 -0
- package/.agents/skills/hyperframes-registry/references/install-locations.md +45 -0
- package/.agents/skills/hyperframes-registry/references/templates.md +417 -0
- package/.agents/skills/hyperframes-registry/references/wiring-blocks.md +61 -0
- package/.agents/skills/hyperframes-registry/references/wiring-components.md +39 -0
- package/.agents/skills/marketing-psychology/SKILL.md +455 -0
- package/.agents/skills/marketing-psychology/evals/evals.json +88 -0
- package/.agents/skills/mintlify/SKILL.md +328 -0
- package/.agents/skills/product-launch-video/SKILL.md +206 -0
- package/.agents/skills/product-launch-video/references/cut-catalog.md +220 -0
- package/.agents/skills/product-launch-video/references/motion-language.md +156 -0
- package/.agents/skills/product-launch-video/references/story-design.md +373 -0
- package/.agents/skills/product-launch-video/references/visual-design.md +126 -0
- package/.agents/skills/product-launch-video/scripts/assemble-index.mjs +570 -0
- package/.agents/skills/product-launch-video/scripts/audio.mjs +253 -0
- package/.agents/skills/product-launch-video/scripts/build-frame.mjs +536 -0
- package/.agents/skills/product-launch-video/scripts/captions.mjs +508 -0
- package/.agents/skills/product-launch-video/scripts/lib/assets.mjs +55 -0
- package/.agents/skills/product-launch-video/scripts/lib/dimensions.mjs +45 -0
- package/.agents/skills/product-launch-video/scripts/lib/storyboard.mjs +249 -0
- package/.agents/skills/product-launch-video/scripts/lib/tokens.mjs +204 -0
- package/.agents/skills/product-launch-video/scripts/lib/transition-registry.mjs +38 -0
- package/.agents/skills/product-launch-video/scripts/lib/transitions.json +71 -0
- package/.agents/skills/product-launch-video/scripts/stage-assets.mjs +39 -0
- package/.agents/skills/product-launch-video/scripts/transitions.mjs +320 -0
- package/.agents/skills/product-launch-video/sub-agents/frame-worker.md +74 -0
- package/.agents/skills/prompt-engineering-patterns/SKILL.md +144 -0
- package/.agents/skills/prompt-engineering-patterns/assets/few-shot-examples.json +106 -0
- package/.agents/skills/prompt-engineering-patterns/assets/prompt-template-library.md +264 -0
- package/.agents/skills/prompt-engineering-patterns/references/chain-of-thought.md +412 -0
- package/.agents/skills/prompt-engineering-patterns/references/details.md +338 -0
- package/.agents/skills/prompt-engineering-patterns/references/few-shot-learning.md +386 -0
- package/.agents/skills/prompt-engineering-patterns/references/prompt-optimization.md +428 -0
- package/.agents/skills/prompt-engineering-patterns/references/prompt-templates.md +484 -0
- package/.agents/skills/prompt-engineering-patterns/references/system-prompts.md +195 -0
- package/.agents/skills/prompt-engineering-patterns/scripts/optimize-prompt.py +279 -0
- package/.agents/skills/remotion-to-hyperframes/SKILL.md +127 -0
- package/.agents/skills/remotion-to-hyperframes/assets/.gitkeep +0 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/run.sh +249 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-1-title-card/README.md +41 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-1-title-card/expected.json +26 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-1-title-card/hf-src/index.html +61 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-1-title-card/remotion-src/package.json +14 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-1-title-card/remotion-src/remotion.config.ts +13 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-1-title-card/remotion-src/src/Root.tsx +13 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-1-title-card/remotion-src/src/TitleCard.tsx +34 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-1-title-card/remotion-src/src/index.ts +4 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-1-title-card/remotion-src/tsconfig.json +15 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/README.md +54 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/expected.json +29 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/hf-src/index.html +118 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/remotion-src/package.json +14 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/remotion-src/remotion.config.ts +13 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/remotion-src/src/MultiScene.tsx +105 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/remotion-src/src/Root.tsx +13 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/remotion-src/src/index.ts +4 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/remotion-src/tsconfig.json +15 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-2-multi-scene/setup.sh +34 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/README.md +85 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/expected.json +41 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/hf-src/index.html +269 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/remotion-src/package.json +15 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/remotion-src/remotion.config.ts +13 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/remotion-src/src/Root.tsx +27 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/remotion-src/src/Stargazed.tsx +37 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/remotion-src/src/components/AnimatedNumber.tsx +23 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/remotion-src/src/components/StatCard.tsx +59 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/remotion-src/src/components/UnderlinedText.tsx +47 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/remotion-src/src/index.ts +4 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/remotion-src/src/scenes/OutroScene.tsx +18 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/remotion-src/src/scenes/StatsScene.tsx +34 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/remotion-src/src/scenes/TitleScene.tsx +55 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-3-data-driven/remotion-src/tsconfig.json +15 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-4-escape-hatch/README.md +51 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-4-escape-hatch/cases/01-use-state.tsx +29 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-4-escape-hatch/cases/02-use-effect-deps.tsx +29 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-4-escape-hatch/cases/03-async-metadata.tsx +39 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-4-escape-hatch/cases/04-third-party-react.tsx +30 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-4-escape-hatch/cases/05-lambda-config.tsx +38 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-4-escape-hatch/cases/06-warnings-only.tsx +36 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-4-escape-hatch/cases/07-custom-hook.tsx +28 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-4-escape-hatch/cases/08-mixed.tsx +41 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-4-escape-hatch/expected.json +85 -0
- package/.agents/skills/remotion-to-hyperframes/assets/test-corpus/tier-4-escape-hatch/validate.sh +110 -0
- package/.agents/skills/remotion-to-hyperframes/references/api-map.md +142 -0
- package/.agents/skills/remotion-to-hyperframes/references/escape-hatch.md +115 -0
- package/.agents/skills/remotion-to-hyperframes/references/eval.md +140 -0
- package/.agents/skills/remotion-to-hyperframes/references/fonts.md +112 -0
- package/.agents/skills/remotion-to-hyperframes/references/limitations.md +136 -0
- package/.agents/skills/remotion-to-hyperframes/references/lottie.md +121 -0
- package/.agents/skills/remotion-to-hyperframes/references/media.md +149 -0
- package/.agents/skills/remotion-to-hyperframes/references/parameters.md +167 -0
- package/.agents/skills/remotion-to-hyperframes/references/sequencing.md +195 -0
- package/.agents/skills/remotion-to-hyperframes/references/timing.md +165 -0
- package/.agents/skills/remotion-to-hyperframes/references/transitions.md +114 -0
- package/.agents/skills/remotion-to-hyperframes/scripts/.gitkeep +0 -0
- package/.agents/skills/remotion-to-hyperframes/scripts/frame_strip.sh +107 -0
- package/.agents/skills/remotion-to-hyperframes/scripts/lint_source.py +358 -0
- package/.agents/skills/remotion-to-hyperframes/scripts/render_diff.sh +103 -0
- package/.agents/skills/remotion-to-hyperframes/scripts/tests/fixtures/blocker.tsx +50 -0
- package/.agents/skills/remotion-to-hyperframes/scripts/tests/fixtures/clean.tsx +46 -0
- package/.agents/skills/remotion-to-hyperframes/scripts/tests/smoke.sh +90 -0
- package/.agents/skills/seo-audit/SKILL.md +497 -0
- package/.agents/skills/seo-audit/evals/evals.json +136 -0
- package/.agents/skills/seo-audit/references/ai-writing-detection.md +200 -0
- package/.agents/skills/seo-audit/references/international-seo.md +230 -0
- package/README.md +4 -2
- package/SDK.md +64 -1
- package/dist/agents/coding.agent.d.ts +632 -0
- package/dist/agents/coding.agent.d.ts.map +1 -1
- package/dist/agents/coding.agent.js +11 -3
- package/dist/agents/coding.agent.js.map +1 -1
- package/dist/agents/developer-helper.agent.d.ts +704 -0
- package/dist/agents/developer-helper.agent.d.ts.map +1 -1
- package/dist/agents/developer-helper.agent.js +6 -0
- package/dist/agents/developer-helper.agent.js.map +1 -1
- package/dist/agents/manager.d.ts +1009 -4
- package/dist/agents/manager.d.ts.map +1 -1
- package/dist/agents/manager.js +16 -5
- package/dist/agents/manager.js.map +1 -1
- package/dist/agents/security.agent.d.ts +157 -3
- package/dist/agents/security.agent.d.ts.map +1 -1
- package/dist/agents/security.agent.js +3 -0
- package/dist/agents/security.agent.js.map +1 -1
- package/dist/agents/swarm/main.js +1 -1
- package/dist/agents/swarm/main.js.map +1 -1
- package/dist/agents/swarm/registry.d.ts.map +1 -1
- package/dist/agents/swarm/registry.js +232 -26
- package/dist/agents/swarm/registry.js.map +1 -1
- package/dist/cli/chat.d.ts +1 -1
- package/dist/cli/chat.d.ts.map +1 -1
- package/dist/cli/chat.js +32 -10
- package/dist/cli/chat.js.map +1 -1
- package/dist/cli/doctor.d.ts +14 -0
- package/dist/cli/doctor.d.ts.map +1 -1
- package/dist/cli/doctor.js +91 -0
- package/dist/cli/doctor.js.map +1 -1
- package/dist/cli/format.d.ts +1 -0
- package/dist/cli/format.d.ts.map +1 -1
- package/dist/cli/format.js +68 -14
- package/dist/cli/format.js.map +1 -1
- package/dist/cli/menu.d.ts.map +1 -1
- package/dist/cli/menu.js +102 -0
- package/dist/cli/menu.js.map +1 -1
- package/dist/cli/setup.d.ts +10 -0
- package/dist/cli/setup.d.ts.map +1 -1
- package/dist/cli/setup.js +187 -3
- package/dist/cli/setup.js.map +1 -1
- package/dist/cli/update.d.ts +2 -0
- package/dist/cli/update.d.ts.map +1 -1
- package/dist/cli/update.js +89 -1
- package/dist/cli/update.js.map +1 -1
- package/dist/config/env.d.ts +12 -0
- package/dist/config/env.d.ts.map +1 -1
- package/dist/config/env.js +19 -5
- package/dist/config/env.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +61 -5
- package/dist/index.js.map +1 -1
- package/dist/jobs/trigger-orchestrator.d.ts +5 -1
- package/dist/jobs/trigger-orchestrator.d.ts.map +1 -1
- package/dist/jobs/trigger-orchestrator.js +29 -9
- package/dist/jobs/trigger-orchestrator.js.map +1 -1
- package/dist/jobs/trigger-router.d.ts.map +1 -1
- package/dist/jobs/trigger-router.js +3 -2
- package/dist/jobs/trigger-router.js.map +1 -1
- package/dist/memory/corporate-wiki.d.ts +15 -0
- package/dist/memory/corporate-wiki.d.ts.map +1 -0
- package/dist/memory/corporate-wiki.js +152 -0
- package/dist/memory/corporate-wiki.js.map +1 -0
- package/dist/observability/doctor.d.ts.map +1 -1
- package/dist/observability/doctor.js +12 -4
- package/dist/observability/doctor.js.map +1 -1
- package/dist/pre-init.d.ts +2 -0
- package/dist/pre-init.d.ts.map +1 -0
- package/dist/pre-init.js +3 -0
- package/dist/pre-init.js.map +1 -0
- package/dist/runtime/chat-bridge.d.ts.map +1 -1
- package/dist/runtime/chat-bridge.js +33 -2
- package/dist/runtime/chat-bridge.js.map +1 -1
- package/dist/runtime/swarm.d.ts +0 -1
- package/dist/runtime/swarm.d.ts.map +1 -1
- package/dist/runtime/swarm.js +26 -15
- package/dist/runtime/swarm.js.map +1 -1
- package/dist/safety/approvals.d.ts +2 -2
- package/dist/safety/approvals.d.ts.map +1 -1
- package/dist/safety/approvals.js +47 -1
- package/dist/safety/approvals.js.map +1 -1
- package/dist/safety/redaction.d.ts.map +1 -1
- package/dist/safety/redaction.js +10 -0
- package/dist/safety/redaction.js.map +1 -1
- package/dist/server.d.ts +1 -0
- package/dist/server.d.ts.map +1 -1
- package/dist/server.js +1 -0
- package/dist/server.js.map +1 -1
- package/dist/tools/cloud.tool.d.ts +394 -0
- package/dist/tools/cloud.tool.d.ts.map +1 -0
- package/dist/tools/cloud.tool.js +784 -0
- package/dist/tools/cloud.tool.js.map +1 -0
- package/dist/tools/computer-use.tool.d.ts +6 -6
- package/dist/tools/corporate-wiki.tool.d.ts +22 -0
- package/dist/tools/corporate-wiki.tool.d.ts.map +1 -0
- package/dist/tools/corporate-wiki.tool.js +39 -0
- package/dist/tools/corporate-wiki.tool.js.map +1 -0
- package/dist/tools/desktop.tool.d.ts +96 -0
- package/dist/tools/desktop.tool.d.ts.map +1 -1
- package/dist/tools/desktop.tool.js +439 -0
- package/dist/tools/desktop.tool.js.map +1 -1
- package/dist/tools/devops.tool.d.ts +162 -0
- package/dist/tools/devops.tool.d.ts.map +1 -0
- package/dist/tools/devops.tool.js +377 -0
- package/dist/tools/devops.tool.js.map +1 -0
- package/dist/tools/multimedia.tool.d.ts +126 -0
- package/dist/tools/multimedia.tool.d.ts.map +1 -0
- package/dist/tools/multimedia.tool.js +533 -0
- package/dist/tools/multimedia.tool.js.map +1 -0
- package/dist/tools/osint.tool.d.ts +6 -6
- package/dist/tools/sandbox-dev.tool.d.ts +15 -0
- package/dist/tools/sandbox-dev.tool.d.ts.map +1 -0
- package/dist/tools/sandbox-dev.tool.js +139 -0
- package/dist/tools/sandbox-dev.tool.js.map +1 -0
- package/dist/tools/setup-assistant.tool.d.ts +1 -1
- package/dist/tools/shell.tool.d.ts +82 -0
- package/dist/tools/shell.tool.d.ts.map +1 -1
- package/dist/tools/shell.tool.js +192 -1
- package/dist/tools/shell.tool.js.map +1 -1
- package/dist/tools/swarm-ops.tool.d.ts +14 -0
- package/dist/tools/swarm-ops.tool.d.ts.map +1 -1
- package/dist/tools/swarm-ops.tool.js +44 -0
- package/dist/tools/swarm-ops.tool.js.map +1 -1
- package/dist/tools/sysops.tool.d.ts +157 -0
- package/dist/tools/sysops.tool.d.ts.map +1 -0
- package/dist/tools/sysops.tool.js +643 -0
- package/dist/tools/sysops.tool.js.map +1 -0
- package/dist/voice/cascade.d.ts +1 -0
- package/dist/voice/cascade.d.ts.map +1 -1
- package/dist/voice/cascade.js +16 -1
- package/dist/voice/cascade.js.map +1 -1
- package/dist/voice/deepgram.d.ts.map +1 -1
- package/dist/voice/deepgram.js +34 -2
- package/dist/voice/deepgram.js.map +1 -1
- package/dist/voice/terminal.d.ts +1 -0
- package/dist/voice/terminal.d.ts.map +1 -1
- package/dist/voice/terminal.js +28 -0
- package/dist/voice/terminal.js.map +1 -1
- package/dist/voice/types.d.ts +2 -0
- package/dist/voice/types.d.ts.map +1 -1
- package/package.json +9 -1
- package/scripts/release-github.mjs +23 -18
|
@@ -0,0 +1,253 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// audio.mjs — product-launch audio ADAPTER. The TTS / BGM / SFX implementation
|
|
3
|
+
// no longer lives here: it is the shared engine at
|
|
4
|
+
// ../../hyperframes-media/scripts/audio.mjs. This file only (a) maps the
|
|
5
|
+
// product-launch model (SCRIPT.md frames + STORYBOARD.md music/sfx) into the
|
|
6
|
+
// engine's neutral audio_request.json, (b) converts the engine's id-keyed
|
|
7
|
+
// audio_meta back into the frame-keyed shape captions.mjs / assemble-index.mjs
|
|
8
|
+
// already consume, and (c) keeps the local `sync-durations` pass (it rewrites
|
|
9
|
+
// STORYBOARD.md, which is product-launch-specific).
|
|
10
|
+
//
|
|
11
|
+
// Three modes (unchanged CLI surface):
|
|
12
|
+
// (default) generate — engine --only tts,bgm. BGM mode is "retrieve" (strict:
|
|
13
|
+
// no HeyGen credential ⇒ skip, never a detached generate, since this
|
|
14
|
+
// workflow has no wait-bgm step). Runs in the background during Step 4.
|
|
15
|
+
// sync-durations — write real voice durations into STORYBOARD.md (local).
|
|
16
|
+
// fetch-sfx — engine --only sfx, merged into the existing meta (Step 5,
|
|
17
|
+
// after the frames' `sfx:` cues exist).
|
|
18
|
+
//
|
|
19
|
+
// node audio.mjs --script ./SCRIPT.md --storyboard ./STORYBOARD.md --hyperframes . --out ./audio_meta.json
|
|
20
|
+
// node audio.mjs sync-durations --audio-meta ./audio_meta.json --storyboard ./STORYBOARD.md
|
|
21
|
+
// node audio.mjs fetch-sfx --storyboard ./STORYBOARD.md --hyperframes .
|
|
22
|
+
|
|
23
|
+
import { spawnSync } from "node:child_process";
|
|
24
|
+
import { existsSync, readFileSync, writeFileSync } from "node:fs";
|
|
25
|
+
import { dirname, join, resolve } from "node:path";
|
|
26
|
+
import { fileURLToPath } from "node:url";
|
|
27
|
+
import { parseStoryboard } from "./lib/storyboard.mjs";
|
|
28
|
+
|
|
29
|
+
const HERE = dirname(fileURLToPath(import.meta.url));
|
|
30
|
+
const DEFAULT_ENGINE = join(HERE, "..", "..", "hyperframes-media", "scripts", "audio.mjs");
|
|
31
|
+
|
|
32
|
+
const flag = (argv, name, def) => {
|
|
33
|
+
const i = argv.indexOf(`--${name}`);
|
|
34
|
+
return i >= 0 && i + 1 < argv.length ? argv[i + 1] : def;
|
|
35
|
+
};
|
|
36
|
+
const pad2 = (n) => String(n).padStart(2, "0");
|
|
37
|
+
|
|
38
|
+
// SCRIPT.md → [{ frame, text }]. `## … (Frame N)` opens a line; `**key:**` rows
|
|
39
|
+
// are metadata; the indented block is the spoken text (the only TTS input).
|
|
40
|
+
function parseScript(md) {
|
|
41
|
+
const out = [];
|
|
42
|
+
let cur = null;
|
|
43
|
+
const flush = () => {
|
|
44
|
+
if (cur && cur.text.trim()) out.push({ frame: cur.frame, text: cur.text.trim() });
|
|
45
|
+
cur = null;
|
|
46
|
+
};
|
|
47
|
+
for (const line of md.split(/\r?\n/)) {
|
|
48
|
+
const h = line.match(/^#{2,3}\s+.*?\(frame\s+(\d+)\)/i);
|
|
49
|
+
if (h) {
|
|
50
|
+
flush();
|
|
51
|
+
cur = { frame: Number(h[1]), text: "" };
|
|
52
|
+
continue;
|
|
53
|
+
}
|
|
54
|
+
if (!cur) continue;
|
|
55
|
+
if (/^\s*\*\*/.test(line)) continue;
|
|
56
|
+
const m = line.match(/^(?: {4,}|\t)(.+)$/);
|
|
57
|
+
if (m) cur.text += (cur.text ? " " : "") + m[1].trim();
|
|
58
|
+
}
|
|
59
|
+
flush();
|
|
60
|
+
return out;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
// Path of the engine's neutral meta — a stable sidecar so `--only` merges
|
|
64
|
+
// (generate then fetch-sfx) accumulate, while audio_meta.json holds the PL shape.
|
|
65
|
+
const neutralPath = (plOutPath) => join(dirname(plOutPath), "audio_engine_meta.json");
|
|
66
|
+
|
|
67
|
+
// Run the shared engine. Returns nothing; dies on a non-zero exit.
|
|
68
|
+
function runEngine({ request, hyperframesDir, neutral, only, extra = [] }, die) {
|
|
69
|
+
const reqPath = join(hyperframesDir, "audio_request.json");
|
|
70
|
+
writeFileSync(reqPath, JSON.stringify(request, null, 2));
|
|
71
|
+
const engine = process.env.HF_MEDIA_ENGINE || DEFAULT_ENGINE;
|
|
72
|
+
if (!existsSync(engine)) die(`media audio engine not found at ${engine} (set $HF_MEDIA_ENGINE)`);
|
|
73
|
+
const args = [
|
|
74
|
+
engine,
|
|
75
|
+
"--request",
|
|
76
|
+
reqPath,
|
|
77
|
+
"--hyperframes",
|
|
78
|
+
hyperframesDir,
|
|
79
|
+
"--out",
|
|
80
|
+
neutral,
|
|
81
|
+
"--only",
|
|
82
|
+
only,
|
|
83
|
+
...extra,
|
|
84
|
+
];
|
|
85
|
+
const r = spawnSync("node", args, { stdio: "inherit" });
|
|
86
|
+
if (r.status !== 0) die(`media audio engine exited ${r.status}`);
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
// Engine neutral meta (id-keyed) → product-launch meta (frame-keyed) consumed by
|
|
90
|
+
// captions.mjs / assemble-index.mjs. id is the zero-padded frame number.
|
|
91
|
+
function toProductLaunchMeta(neutral) {
|
|
92
|
+
const voices = (neutral.voices ?? []).map((v) => ({
|
|
93
|
+
frame: Number(v.id),
|
|
94
|
+
path: v.path,
|
|
95
|
+
duration_s: v.duration_s,
|
|
96
|
+
words: (v.words ?? []).map((w) => ({ id: w.id, text: w.text, start: w.start, end: w.end })),
|
|
97
|
+
}));
|
|
98
|
+
const bgm = neutral.bgm
|
|
99
|
+
? {
|
|
100
|
+
path: neutral.bgm.path,
|
|
101
|
+
volume: neutral.bgm.volume,
|
|
102
|
+
query: neutral.bgm.query ?? null,
|
|
103
|
+
duration_s: neutral.bgm.duration_s ?? null,
|
|
104
|
+
}
|
|
105
|
+
: null;
|
|
106
|
+
const sfx = (neutral.sfx ?? []).map((s) => ({
|
|
107
|
+
frame: Number(s.id),
|
|
108
|
+
file: s.file,
|
|
109
|
+
offset_s: s.offset_s ?? 0,
|
|
110
|
+
duration_s: s.duration_s ?? 1,
|
|
111
|
+
volume: s.volume ?? 0.35,
|
|
112
|
+
}));
|
|
113
|
+
return { bgm, voices, sfx };
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
// ── generate (TTS + BGM) ────────────────────────────────────────────────────
|
|
117
|
+
function runGenerate(argv) {
|
|
118
|
+
const die = (m) => {
|
|
119
|
+
console.error(`✗ audio generate: ${m}`);
|
|
120
|
+
process.exit(1);
|
|
121
|
+
};
|
|
122
|
+
const hyperframesDir = resolve(flag(argv, "hyperframes", "."));
|
|
123
|
+
const storyboardPath = resolve(flag(argv, "storyboard", join(hyperframesDir, "STORYBOARD.md")));
|
|
124
|
+
const scriptPath = resolve(flag(argv, "script", join(hyperframesDir, "SCRIPT.md")));
|
|
125
|
+
const outPath = resolve(flag(argv, "out", join(hyperframesDir, "audio_meta.json")));
|
|
126
|
+
const userVoice = flag(argv, "voice", null);
|
|
127
|
+
const speed = Number(flag(argv, "speed", "1.0")) || 1.0;
|
|
128
|
+
|
|
129
|
+
if (!existsSync(storyboardPath)) die(`STORYBOARD.md not found at ${storyboardPath}`);
|
|
130
|
+
const manifest = parseStoryboard(readFileSync(storyboardPath, "utf8"));
|
|
131
|
+
const g = manifest.globals;
|
|
132
|
+
|
|
133
|
+
const lines = existsSync(scriptPath)
|
|
134
|
+
? parseScript(readFileSync(scriptPath, "utf8")).map((l) => ({
|
|
135
|
+
id: pad2(l.frame),
|
|
136
|
+
text: l.text,
|
|
137
|
+
}))
|
|
138
|
+
: [];
|
|
139
|
+
if (!lines.length) console.error("· no SCRIPT.md — silent film (BGM only)");
|
|
140
|
+
|
|
141
|
+
// BGM mood: storyboard `music:` → message → arc → default. `mode: retrieve` is
|
|
142
|
+
// strict here (no wait-bgm step downstream).
|
|
143
|
+
const query = (g.extra && g.extra.music) || g.message || g.arc || "calm cinematic underscore";
|
|
144
|
+
const request = {
|
|
145
|
+
provider: "auto",
|
|
146
|
+
speed,
|
|
147
|
+
lines,
|
|
148
|
+
bgm: { mode: "retrieve", query, blob: g.message || "", arc: g.arc || "" },
|
|
149
|
+
};
|
|
150
|
+
if (userVoice) request.voice = userVoice;
|
|
151
|
+
|
|
152
|
+
const neutral = neutralPath(outPath);
|
|
153
|
+
runEngine({ request, hyperframesDir, neutral, only: "tts,bgm" }, die);
|
|
154
|
+
|
|
155
|
+
const meta = toProductLaunchMeta(JSON.parse(readFileSync(neutral, "utf8")));
|
|
156
|
+
writeFileSync(outPath, JSON.stringify(meta, null, 2));
|
|
157
|
+
console.log(
|
|
158
|
+
`✓ audio generate: ${meta.voices.length} voice + ${meta.bgm ? "1 bgm" : "no bgm"} → ${outPath}`,
|
|
159
|
+
);
|
|
160
|
+
}
|
|
161
|
+
|
|
162
|
+
// ── fetch-sfx ────────────────────────────────────────────────────────────────
|
|
163
|
+
function runFetchSfx(argv) {
|
|
164
|
+
const die = (m) => {
|
|
165
|
+
console.error(`✗ audio fetch-sfx: ${m}`);
|
|
166
|
+
process.exit(1);
|
|
167
|
+
};
|
|
168
|
+
const hyperframesDir = resolve(flag(argv, "hyperframes", "."));
|
|
169
|
+
const storyboardPath = resolve(flag(argv, "storyboard", join(hyperframesDir, "STORYBOARD.md")));
|
|
170
|
+
const outPath = resolve(flag(argv, "audio-meta", join(hyperframesDir, "audio_meta.json")));
|
|
171
|
+
|
|
172
|
+
if (!existsSync(storyboardPath)) die(`STORYBOARD.md not found at ${storyboardPath}`);
|
|
173
|
+
const manifest = parseStoryboard(readFileSync(storyboardPath, "utf8"));
|
|
174
|
+
|
|
175
|
+
// Per-frame `sfx:` cues (comma-separated) → engine lines carrying only sfx.
|
|
176
|
+
const lines = [];
|
|
177
|
+
for (const f of manifest.frames) {
|
|
178
|
+
const names = (f.extra?.sfx ?? "")
|
|
179
|
+
.split(",")
|
|
180
|
+
.map((s) => s.trim())
|
|
181
|
+
.filter(Boolean);
|
|
182
|
+
if (names.length && f.number != null) lines.push({ id: pad2(f.number), sfx: names });
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
const neutral = neutralPath(outPath);
|
|
186
|
+
const request = { lines, bgm: { mode: "none" } };
|
|
187
|
+
// --only sfx is a MERGE, not an overwrite: the engine reads the existing neutral
|
|
188
|
+
// sidecar (audio_engine_meta.json) and recomputes only the sfx section, so the
|
|
189
|
+
// voices/bgm written by the earlier generate (--only tts,bgm) pass are preserved.
|
|
190
|
+
runEngine({ request, hyperframesDir, neutral, only: "sfx" }, die);
|
|
191
|
+
|
|
192
|
+
const meta = toProductLaunchMeta(JSON.parse(readFileSync(neutral, "utf8")));
|
|
193
|
+
writeFileSync(outPath, JSON.stringify(meta, null, 2));
|
|
194
|
+
console.log(`✓ audio fetch-sfx: ${meta.sfx.length} SFX cue(s) → ${outPath}`);
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
// ── sync-durations (local; rewrites STORYBOARD.md) ────────────────────────────
|
|
198
|
+
function runSyncDurations(argv) {
|
|
199
|
+
const die = (m) => {
|
|
200
|
+
console.error(`✗ audio sync-durations: ${m}`);
|
|
201
|
+
process.exit(1);
|
|
202
|
+
};
|
|
203
|
+
const hyperframesDir = resolve(flag(argv, "hyperframes", "."));
|
|
204
|
+
const audioMetaPath = resolve(flag(argv, "audio-meta", join(hyperframesDir, "audio_meta.json")));
|
|
205
|
+
const storyboardPath = resolve(flag(argv, "storyboard", join(hyperframesDir, "STORYBOARD.md")));
|
|
206
|
+
if (!existsSync(audioMetaPath)) die(`audio_meta.json not found at ${audioMetaPath}`);
|
|
207
|
+
|
|
208
|
+
const meta = JSON.parse(readFileSync(audioMetaPath, "utf8"));
|
|
209
|
+
const durByFrame = new Map();
|
|
210
|
+
for (const v of meta.voices ?? []) {
|
|
211
|
+
if (v.frame != null && v.duration_s) durByFrame.set(v.frame, v.duration_s);
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
// Read directly and handle ENOENT here, rather than an existsSync precheck —
|
|
215
|
+
// the check→write pair (write-back below) is a TOCTOU race CodeQL flags.
|
|
216
|
+
let storyboardRaw = "";
|
|
217
|
+
try {
|
|
218
|
+
storyboardRaw = readFileSync(storyboardPath, "utf8");
|
|
219
|
+
} catch {
|
|
220
|
+
die(`STORYBOARD.md not found at ${storyboardPath}`);
|
|
221
|
+
}
|
|
222
|
+
const lines = storyboardRaw.split(/\r?\n/);
|
|
223
|
+
const FRAME_RE = /^#{2,3}\s+(?:frame|beat|scene)\b.*?(\d+)/i;
|
|
224
|
+
let curFrame = null;
|
|
225
|
+
let updated = 0;
|
|
226
|
+
for (let i = 0; i < lines.length; i++) {
|
|
227
|
+
const h = lines[i].match(FRAME_RE);
|
|
228
|
+
if (h) {
|
|
229
|
+
curFrame = Number(h[1]);
|
|
230
|
+
continue;
|
|
231
|
+
}
|
|
232
|
+
if (curFrame != null && durByFrame.has(curFrame)) {
|
|
233
|
+
const m = lines[i].match(/^(\s*[-*]\s+duration\s*:\s*).*/i);
|
|
234
|
+
if (m) {
|
|
235
|
+
lines[i] = `${m[1]}${durByFrame.get(curFrame)}s`;
|
|
236
|
+
durByFrame.delete(curFrame);
|
|
237
|
+
updated++;
|
|
238
|
+
}
|
|
239
|
+
}
|
|
240
|
+
}
|
|
241
|
+
writeFileSync(storyboardPath, lines.join("\n"));
|
|
242
|
+
const missing = [...durByFrame.keys()];
|
|
243
|
+
console.log(
|
|
244
|
+
`✓ audio sync-durations: ${updated} frame duration(s) updated` +
|
|
245
|
+
(missing.length ? ` · no \`- duration:\` line for frame(s) ${missing.join(", ")}` : ""),
|
|
246
|
+
);
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// ── dispatch ──────────────────────────────────────────────────────────────────
|
|
250
|
+
const sub = process.argv[2];
|
|
251
|
+
if (sub === "sync-durations") runSyncDurations(process.argv.slice(3));
|
|
252
|
+
else if (sub === "fetch-sfx") runFetchSfx(process.argv.slice(3));
|
|
253
|
+
else runGenerate(process.argv.slice(2)); // default: generate
|