@vibeframe/cli 0.27.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/.turbo/turbo-build.log +4 -0
- package/.turbo/turbo-lint.log +21 -0
- package/.turbo/turbo-test.log +689 -0
- package/dist/agent/adapters/claude.d.ts +15 -0
- package/dist/agent/adapters/claude.d.ts.map +1 -0
- package/dist/agent/adapters/claude.js +119 -0
- package/dist/agent/adapters/claude.js.map +1 -0
- package/dist/agent/adapters/gemini.d.ts +15 -0
- package/dist/agent/adapters/gemini.d.ts.map +1 -0
- package/dist/agent/adapters/gemini.js +132 -0
- package/dist/agent/adapters/gemini.js.map +1 -0
- package/dist/agent/adapters/index.d.ts +27 -0
- package/dist/agent/adapters/index.d.ts.map +1 -0
- package/dist/agent/adapters/index.js +38 -0
- package/dist/agent/adapters/index.js.map +1 -0
- package/dist/agent/adapters/ollama.d.ts +20 -0
- package/dist/agent/adapters/ollama.d.ts.map +1 -0
- package/dist/agent/adapters/ollama.js +186 -0
- package/dist/agent/adapters/ollama.js.map +1 -0
- package/dist/agent/adapters/openai.d.ts +15 -0
- package/dist/agent/adapters/openai.d.ts.map +1 -0
- package/dist/agent/adapters/openai.js +92 -0
- package/dist/agent/adapters/openai.js.map +1 -0
- package/dist/agent/adapters/xai.d.ts +15 -0
- package/dist/agent/adapters/xai.d.ts.map +1 -0
- package/dist/agent/adapters/xai.js +95 -0
- package/dist/agent/adapters/xai.js.map +1 -0
- package/dist/agent/index.d.ts +69 -0
- package/dist/agent/index.d.ts.map +1 -0
- package/dist/agent/index.js +180 -0
- package/dist/agent/index.js.map +1 -0
- package/dist/agent/memory/index.d.ts +70 -0
- package/dist/agent/memory/index.d.ts.map +1 -0
- package/dist/agent/memory/index.js +132 -0
- package/dist/agent/memory/index.js.map +1 -0
- package/dist/agent/prompts/system.d.ts +6 -0
- package/dist/agent/prompts/system.d.ts.map +1 -0
- package/dist/agent/prompts/system.js +103 -0
- package/dist/agent/prompts/system.js.map +1 -0
- package/dist/agent/tools/ai-editing.d.ts +15 -0
- package/dist/agent/tools/ai-editing.d.ts.map +1 -0
- package/dist/agent/tools/ai-editing.js +763 -0
- package/dist/agent/tools/ai-editing.js.map +1 -0
- package/dist/agent/tools/ai-generation.d.ts +13 -0
- package/dist/agent/tools/ai-generation.d.ts.map +1 -0
- package/dist/agent/tools/ai-generation.js +973 -0
- package/dist/agent/tools/ai-generation.js.map +1 -0
- package/dist/agent/tools/ai-pipeline.d.ts +14 -0
- package/dist/agent/tools/ai-pipeline.d.ts.map +1 -0
- package/dist/agent/tools/ai-pipeline.js +961 -0
- package/dist/agent/tools/ai-pipeline.js.map +1 -0
- package/dist/agent/tools/ai.d.ts +13 -0
- package/dist/agent/tools/ai.d.ts.map +1 -0
- package/dist/agent/tools/ai.js +19 -0
- package/dist/agent/tools/ai.js.map +1 -0
- package/dist/agent/tools/batch.d.ts +6 -0
- package/dist/agent/tools/batch.d.ts.map +1 -0
- package/dist/agent/tools/batch.js +383 -0
- package/dist/agent/tools/batch.js.map +1 -0
- package/dist/agent/tools/e2e.test.d.ts +26 -0
- package/dist/agent/tools/e2e.test.d.ts.map +1 -0
- package/dist/agent/tools/e2e.test.js +397 -0
- package/dist/agent/tools/e2e.test.js.map +1 -0
- package/dist/agent/tools/export.d.ts +6 -0
- package/dist/agent/tools/export.d.ts.map +1 -0
- package/dist/agent/tools/export.js +171 -0
- package/dist/agent/tools/export.js.map +1 -0
- package/dist/agent/tools/filesystem.d.ts +6 -0
- package/dist/agent/tools/filesystem.d.ts.map +1 -0
- package/dist/agent/tools/filesystem.js +212 -0
- package/dist/agent/tools/filesystem.js.map +1 -0
- package/dist/agent/tools/index.d.ts +65 -0
- package/dist/agent/tools/index.d.ts.map +1 -0
- package/dist/agent/tools/index.js +120 -0
- package/dist/agent/tools/index.js.map +1 -0
- package/dist/agent/tools/integration.test.d.ts +11 -0
- package/dist/agent/tools/integration.test.d.ts.map +1 -0
- package/dist/agent/tools/integration.test.js +659 -0
- package/dist/agent/tools/integration.test.js.map +1 -0
- package/dist/agent/tools/media.d.ts +6 -0
- package/dist/agent/tools/media.d.ts.map +1 -0
- package/dist/agent/tools/media.js +616 -0
- package/dist/agent/tools/media.js.map +1 -0
- package/dist/agent/tools/project.d.ts +6 -0
- package/dist/agent/tools/project.d.ts.map +1 -0
- package/dist/agent/tools/project.js +284 -0
- package/dist/agent/tools/project.js.map +1 -0
- package/dist/agent/tools/timeline.d.ts +6 -0
- package/dist/agent/tools/timeline.d.ts.map +1 -0
- package/dist/agent/tools/timeline.js +873 -0
- package/dist/agent/tools/timeline.js.map +1 -0
- package/dist/agent/types.d.ts +59 -0
- package/dist/agent/types.d.ts.map +1 -0
- package/dist/agent/types.js +5 -0
- package/dist/agent/types.js.map +1 -0
- package/dist/commands/agent.d.ts +21 -0
- package/dist/commands/agent.d.ts.map +1 -0
- package/dist/commands/agent.js +290 -0
- package/dist/commands/agent.js.map +1 -0
- package/dist/commands/ai-analyze.d.ts +106 -0
- package/dist/commands/ai-analyze.d.ts.map +1 -0
- package/dist/commands/ai-analyze.js +327 -0
- package/dist/commands/ai-analyze.js.map +1 -0
- package/dist/commands/ai-animated-caption.d.ts +64 -0
- package/dist/commands/ai-animated-caption.d.ts.map +1 -0
- package/dist/commands/ai-animated-caption.js +272 -0
- package/dist/commands/ai-animated-caption.js.map +1 -0
- package/dist/commands/ai-audio.d.ts +20 -0
- package/dist/commands/ai-audio.d.ts.map +1 -0
- package/dist/commands/ai-audio.js +808 -0
- package/dist/commands/ai-audio.js.map +1 -0
- package/dist/commands/ai-broll.d.ts +15 -0
- package/dist/commands/ai-broll.d.ts.map +1 -0
- package/dist/commands/ai-broll.js +406 -0
- package/dist/commands/ai-broll.js.map +1 -0
- package/dist/commands/ai-edit-cli.d.ts +14 -0
- package/dist/commands/ai-edit-cli.d.ts.map +1 -0
- package/dist/commands/ai-edit-cli.js +579 -0
- package/dist/commands/ai-edit-cli.js.map +1 -0
- package/dist/commands/ai-edit.d.ts +398 -0
- package/dist/commands/ai-edit.d.ts.map +1 -0
- package/dist/commands/ai-edit.js +1019 -0
- package/dist/commands/ai-edit.js.map +1 -0
- package/dist/commands/ai-fill-gaps.d.ts +14 -0
- package/dist/commands/ai-fill-gaps.d.ts.map +1 -0
- package/dist/commands/ai-fill-gaps.js +451 -0
- package/dist/commands/ai-fill-gaps.js.map +1 -0
- package/dist/commands/ai-helpers.d.ts +20 -0
- package/dist/commands/ai-helpers.d.ts.map +1 -0
- package/dist/commands/ai-helpers.js +59 -0
- package/dist/commands/ai-helpers.js.map +1 -0
- package/dist/commands/ai-highlights.d.ts +127 -0
- package/dist/commands/ai-highlights.d.ts.map +1 -0
- package/dist/commands/ai-highlights.js +1026 -0
- package/dist/commands/ai-highlights.js.map +1 -0
- package/dist/commands/ai-image.d.ts +34 -0
- package/dist/commands/ai-image.d.ts.map +1 -0
- package/dist/commands/ai-image.js +653 -0
- package/dist/commands/ai-image.js.map +1 -0
- package/dist/commands/ai-motion.d.ts +50 -0
- package/dist/commands/ai-motion.d.ts.map +1 -0
- package/dist/commands/ai-motion.js +271 -0
- package/dist/commands/ai-motion.js.map +1 -0
- package/dist/commands/ai-narrate.d.ts +66 -0
- package/dist/commands/ai-narrate.d.ts.map +1 -0
- package/dist/commands/ai-narrate.js +329 -0
- package/dist/commands/ai-narrate.js.map +1 -0
- package/dist/commands/ai-review.d.ts +57 -0
- package/dist/commands/ai-review.d.ts.map +1 -0
- package/dist/commands/ai-review.js +251 -0
- package/dist/commands/ai-review.js.map +1 -0
- package/dist/commands/ai-script-pipeline-cli.d.ts +9 -0
- package/dist/commands/ai-script-pipeline-cli.d.ts.map +1 -0
- package/dist/commands/ai-script-pipeline-cli.js +1494 -0
- package/dist/commands/ai-script-pipeline-cli.js.map +1 -0
- package/dist/commands/ai-script-pipeline.d.ts +259 -0
- package/dist/commands/ai-script-pipeline.d.ts.map +1 -0
- package/dist/commands/ai-script-pipeline.js +1027 -0
- package/dist/commands/ai-script-pipeline.js.map +1 -0
- package/dist/commands/ai-suggest-edit.d.ts +14 -0
- package/dist/commands/ai-suggest-edit.d.ts.map +1 -0
- package/dist/commands/ai-suggest-edit.js +220 -0
- package/dist/commands/ai-suggest-edit.js.map +1 -0
- package/dist/commands/ai-video-fx.d.ts +14 -0
- package/dist/commands/ai-video-fx.d.ts.map +1 -0
- package/dist/commands/ai-video-fx.js +395 -0
- package/dist/commands/ai-video-fx.js.map +1 -0
- package/dist/commands/ai-video.d.ts +15 -0
- package/dist/commands/ai-video.d.ts.map +1 -0
- package/dist/commands/ai-video.js +785 -0
- package/dist/commands/ai-video.js.map +1 -0
- package/dist/commands/ai-viral.d.ts +15 -0
- package/dist/commands/ai-viral.d.ts.map +1 -0
- package/dist/commands/ai-viral.js +519 -0
- package/dist/commands/ai-viral.js.map +1 -0
- package/dist/commands/ai-visual-fx.d.ts +14 -0
- package/dist/commands/ai-visual-fx.d.ts.map +1 -0
- package/dist/commands/ai-visual-fx.js +505 -0
- package/dist/commands/ai-visual-fx.js.map +1 -0
- package/dist/commands/ai.d.ts +38 -0
- package/dist/commands/ai.d.ts.map +1 -0
- package/dist/commands/ai.js +225 -0
- package/dist/commands/ai.js.map +1 -0
- package/dist/commands/ai.test.d.ts +2 -0
- package/dist/commands/ai.test.d.ts.map +1 -0
- package/dist/commands/ai.test.js +554 -0
- package/dist/commands/ai.test.js.map +1 -0
- package/dist/commands/analyze.d.ts +16 -0
- package/dist/commands/analyze.d.ts.map +1 -0
- package/dist/commands/analyze.js +247 -0
- package/dist/commands/analyze.js.map +1 -0
- package/dist/commands/audio.d.ts +18 -0
- package/dist/commands/audio.d.ts.map +1 -0
- package/dist/commands/audio.js +539 -0
- package/dist/commands/audio.js.map +1 -0
- package/dist/commands/batch.d.ts +3 -0
- package/dist/commands/batch.d.ts.map +1 -0
- package/dist/commands/batch.js +366 -0
- package/dist/commands/batch.js.map +1 -0
- package/dist/commands/batch.test.d.ts +2 -0
- package/dist/commands/batch.test.d.ts.map +1 -0
- package/dist/commands/batch.test.js +203 -0
- package/dist/commands/batch.test.js.map +1 -0
- package/dist/commands/detect.d.ts +3 -0
- package/dist/commands/detect.d.ts.map +1 -0
- package/dist/commands/detect.js +273 -0
- package/dist/commands/detect.js.map +1 -0
- package/dist/commands/doctor.d.ts +6 -0
- package/dist/commands/doctor.d.ts.map +1 -0
- package/dist/commands/doctor.js +191 -0
- package/dist/commands/doctor.js.map +1 -0
- package/dist/commands/edit-cmd.d.ts +26 -0
- package/dist/commands/edit-cmd.d.ts.map +1 -0
- package/dist/commands/edit-cmd.js +870 -0
- package/dist/commands/edit-cmd.js.map +1 -0
- package/dist/commands/export.d.ts +39 -0
- package/dist/commands/export.d.ts.map +1 -0
- package/dist/commands/export.js +730 -0
- package/dist/commands/export.js.map +1 -0
- package/dist/commands/generate.d.ts +25 -0
- package/dist/commands/generate.d.ts.map +1 -0
- package/dist/commands/generate.js +1885 -0
- package/dist/commands/generate.js.map +1 -0
- package/dist/commands/media.d.ts +3 -0
- package/dist/commands/media.d.ts.map +1 -0
- package/dist/commands/media.js +165 -0
- package/dist/commands/media.js.map +1 -0
- package/dist/commands/output.d.ts +45 -0
- package/dist/commands/output.d.ts.map +1 -0
- package/dist/commands/output.js +122 -0
- package/dist/commands/output.js.map +1 -0
- package/dist/commands/pipeline.d.ts +19 -0
- package/dist/commands/pipeline.d.ts.map +1 -0
- package/dist/commands/pipeline.js +345 -0
- package/dist/commands/pipeline.js.map +1 -0
- package/dist/commands/project.d.ts +3 -0
- package/dist/commands/project.d.ts.map +1 -0
- package/dist/commands/project.js +139 -0
- package/dist/commands/project.js.map +1 -0
- package/dist/commands/project.test.d.ts +2 -0
- package/dist/commands/project.test.d.ts.map +1 -0
- package/dist/commands/project.test.js +105 -0
- package/dist/commands/project.test.js.map +1 -0
- package/dist/commands/sanitize.d.ts +21 -0
- package/dist/commands/sanitize.d.ts.map +1 -0
- package/dist/commands/sanitize.js +56 -0
- package/dist/commands/sanitize.js.map +1 -0
- package/dist/commands/schema.d.ts +11 -0
- package/dist/commands/schema.d.ts.map +1 -0
- package/dist/commands/schema.js +101 -0
- package/dist/commands/schema.js.map +1 -0
- package/dist/commands/setup.d.ts +6 -0
- package/dist/commands/setup.d.ts.map +1 -0
- package/dist/commands/setup.js +440 -0
- package/dist/commands/setup.js.map +1 -0
- package/dist/commands/timeline.d.ts +3 -0
- package/dist/commands/timeline.d.ts.map +1 -0
- package/dist/commands/timeline.js +469 -0
- package/dist/commands/timeline.js.map +1 -0
- package/dist/commands/timeline.test.d.ts +2 -0
- package/dist/commands/timeline.test.d.ts.map +1 -0
- package/dist/commands/timeline.test.js +320 -0
- package/dist/commands/timeline.test.js.map +1 -0
- package/dist/commands/validate.d.ts +32 -0
- package/dist/commands/validate.d.ts.map +1 -0
- package/dist/commands/validate.js +63 -0
- package/dist/commands/validate.js.map +1 -0
- package/dist/config/config.test.d.ts +2 -0
- package/dist/config/config.test.d.ts.map +1 -0
- package/dist/config/config.test.js +164 -0
- package/dist/config/config.test.js.map +1 -0
- package/dist/config/index.d.ts +35 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +101 -0
- package/dist/config/index.js.map +1 -0
- package/dist/config/schema.d.ts +43 -0
- package/dist/config/schema.d.ts.map +1 -0
- package/dist/config/schema.js +42 -0
- package/dist/config/schema.js.map +1 -0
- package/dist/engine/index.d.ts +3 -0
- package/dist/engine/index.d.ts.map +1 -0
- package/dist/engine/index.js +2 -0
- package/dist/engine/index.js.map +1 -0
- package/dist/engine/project.d.ts +84 -0
- package/dist/engine/project.d.ts.map +1 -0
- package/dist/engine/project.js +355 -0
- package/dist/engine/project.js.map +1 -0
- package/dist/engine/project.test.d.ts +2 -0
- package/dist/engine/project.test.d.ts.map +1 -0
- package/dist/engine/project.test.js +599 -0
- package/dist/engine/project.test.js.map +1 -0
- package/dist/index.d.ts +7 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +131 -0
- package/dist/index.js.map +1 -0
- package/dist/utils/api-key.d.ts +36 -0
- package/dist/utils/api-key.d.ts.map +1 -0
- package/dist/utils/api-key.js +211 -0
- package/dist/utils/api-key.js.map +1 -0
- package/dist/utils/api-key.test.d.ts +2 -0
- package/dist/utils/api-key.test.d.ts.map +1 -0
- package/dist/utils/api-key.test.js +35 -0
- package/dist/utils/api-key.test.js.map +1 -0
- package/dist/utils/audio.d.ts +23 -0
- package/dist/utils/audio.d.ts.map +1 -0
- package/dist/utils/audio.js +79 -0
- package/dist/utils/audio.js.map +1 -0
- package/dist/utils/exec-safe.d.ts +22 -0
- package/dist/utils/exec-safe.d.ts.map +1 -0
- package/dist/utils/exec-safe.js +62 -0
- package/dist/utils/exec-safe.js.map +1 -0
- package/dist/utils/first-run.d.ts +13 -0
- package/dist/utils/first-run.d.ts.map +1 -0
- package/dist/utils/first-run.js +48 -0
- package/dist/utils/first-run.js.map +1 -0
- package/dist/utils/provider-resolver.d.ts +15 -0
- package/dist/utils/provider-resolver.d.ts.map +1 -0
- package/dist/utils/provider-resolver.js +42 -0
- package/dist/utils/provider-resolver.js.map +1 -0
- package/dist/utils/remotion.d.ts +210 -0
- package/dist/utils/remotion.d.ts.map +1 -0
- package/dist/utils/remotion.js +731 -0
- package/dist/utils/remotion.js.map +1 -0
- package/dist/utils/subtitle.d.ts +65 -0
- package/dist/utils/subtitle.d.ts.map +1 -0
- package/dist/utils/subtitle.js +135 -0
- package/dist/utils/subtitle.js.map +1 -0
- package/dist/utils/subtitle.test.d.ts +2 -0
- package/dist/utils/subtitle.test.d.ts.map +1 -0
- package/dist/utils/subtitle.test.js +175 -0
- package/dist/utils/subtitle.test.js.map +1 -0
- package/dist/utils/tty.d.ts +45 -0
- package/dist/utils/tty.d.ts.map +1 -0
- package/dist/utils/tty.js +172 -0
- package/dist/utils/tty.js.map +1 -0
- package/package.json +102 -0
- package/src/agent/adapters/claude.ts +143 -0
- package/src/agent/adapters/gemini.ts +159 -0
- package/src/agent/adapters/index.ts +61 -0
- package/src/agent/adapters/ollama.ts +231 -0
- package/src/agent/adapters/openai.ts +116 -0
- package/src/agent/adapters/xai.ts +119 -0
- package/src/agent/index.ts +251 -0
- package/src/agent/memory/index.ts +151 -0
- package/src/agent/prompts/system.ts +106 -0
- package/src/agent/tools/ai-editing.ts +845 -0
- package/src/agent/tools/ai-generation.ts +1073 -0
- package/src/agent/tools/ai-pipeline.ts +1055 -0
- package/src/agent/tools/ai.ts +21 -0
- package/src/agent/tools/batch.ts +429 -0
- package/src/agent/tools/e2e.test.ts +545 -0
- package/src/agent/tools/export.ts +184 -0
- package/src/agent/tools/filesystem.ts +237 -0
- package/src/agent/tools/index.ts +150 -0
- package/src/agent/tools/integration.test.ts +775 -0
- package/src/agent/tools/media.ts +697 -0
- package/src/agent/tools/project.ts +313 -0
- package/src/agent/tools/timeline.ts +951 -0
- package/src/agent/types.ts +68 -0
- package/src/commands/agent.ts +340 -0
- package/src/commands/ai-analyze.ts +429 -0
- package/src/commands/ai-animated-caption.ts +390 -0
- package/src/commands/ai-audio.ts +941 -0
- package/src/commands/ai-broll.ts +490 -0
- package/src/commands/ai-edit-cli.ts +658 -0
- package/src/commands/ai-edit.ts +1542 -0
- package/src/commands/ai-fill-gaps.ts +566 -0
- package/src/commands/ai-helpers.ts +65 -0
- package/src/commands/ai-highlights.ts +1303 -0
- package/src/commands/ai-image.ts +761 -0
- package/src/commands/ai-motion.ts +347 -0
- package/src/commands/ai-narrate.ts +451 -0
- package/src/commands/ai-review.ts +309 -0
- package/src/commands/ai-script-pipeline-cli.ts +1710 -0
- package/src/commands/ai-script-pipeline.ts +1365 -0
- package/src/commands/ai-suggest-edit.ts +264 -0
- package/src/commands/ai-video-fx.ts +445 -0
- package/src/commands/ai-video.ts +915 -0
- package/src/commands/ai-viral.ts +595 -0
- package/src/commands/ai-visual-fx.ts +601 -0
- package/src/commands/ai.test.ts +627 -0
- package/src/commands/ai.ts +307 -0
- package/src/commands/analyze.ts +282 -0
- package/src/commands/audio.ts +644 -0
- package/src/commands/batch.test.ts +279 -0
- package/src/commands/batch.ts +440 -0
- package/src/commands/detect.ts +329 -0
- package/src/commands/doctor.ts +237 -0
- package/src/commands/edit-cmd.ts +1014 -0
- package/src/commands/export.ts +918 -0
- package/src/commands/generate.ts +2146 -0
- package/src/commands/media.ts +177 -0
- package/src/commands/output.ts +142 -0
- package/src/commands/pipeline.ts +398 -0
- package/src/commands/project.test.ts +127 -0
- package/src/commands/project.ts +149 -0
- package/src/commands/sanitize.ts +60 -0
- package/src/commands/schema.ts +130 -0
- package/src/commands/setup.ts +509 -0
- package/src/commands/timeline.test.ts +499 -0
- package/src/commands/timeline.ts +529 -0
- package/src/commands/validate.ts +77 -0
- package/src/config/config.test.ts +197 -0
- package/src/config/index.ts +125 -0
- package/src/config/schema.ts +82 -0
- package/src/engine/index.ts +2 -0
- package/src/engine/project.test.ts +702 -0
- package/src/engine/project.ts +439 -0
- package/src/index.ts +146 -0
- package/src/utils/api-key.test.ts +41 -0
- package/src/utils/api-key.ts +247 -0
- package/src/utils/audio.ts +83 -0
- package/src/utils/exec-safe.ts +75 -0
- package/src/utils/first-run.ts +52 -0
- package/src/utils/provider-resolver.ts +56 -0
- package/src/utils/remotion.ts +951 -0
- package/src/utils/subtitle.test.ts +227 -0
- package/src/utils/subtitle.ts +169 -0
- package/src/utils/tty.ts +196 -0
- package/tsconfig.json +20 -0
|
@@ -0,0 +1,659 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Integration Tests: CLI ↔ Agent Tool Synchronization
|
|
3
|
+
*
|
|
4
|
+
* These tests verify that:
|
|
5
|
+
* 1. All Agent tools are properly registered
|
|
6
|
+
* 2. Agent tools correctly wrap CLI functions
|
|
7
|
+
* 3. Parameter schemas match between CLI and Agent
|
|
8
|
+
* 4. Tool handlers produce expected output formats
|
|
9
|
+
*/
|
|
10
|
+
import { describe, it, expect, beforeEach, vi } from "vitest";
|
|
11
|
+
import { ToolRegistry } from "./index.js";
|
|
12
|
+
import { registerProjectTools } from "./project.js";
|
|
13
|
+
import { registerTimelineTools } from "./timeline.js";
|
|
14
|
+
import { registerFilesystemTools } from "./filesystem.js";
|
|
15
|
+
import { registerMediaTools } from "./media.js";
|
|
16
|
+
import { registerAITools } from "./ai.js";
|
|
17
|
+
import { registerExportTools } from "./export.js";
|
|
18
|
+
import { registerBatchTools } from "./batch.js";
|
|
19
|
+
// Mock the imported CLI functions to avoid actual API calls
|
|
20
|
+
vi.mock("../../commands/ai-script-pipeline.js", () => ({
|
|
21
|
+
executeScriptToVideo: vi.fn().mockResolvedValue({
|
|
22
|
+
success: true,
|
|
23
|
+
outputDir: "/test/output",
|
|
24
|
+
scenes: 3,
|
|
25
|
+
storyboardPath: "/test/output/storyboard.json",
|
|
26
|
+
projectPath: "/test/output/project.vibe.json",
|
|
27
|
+
narrations: ["/test/output/narration-1.mp3"],
|
|
28
|
+
images: ["/test/output/scene-1.png"],
|
|
29
|
+
videos: ["/test/output/scene-1.mp4"],
|
|
30
|
+
totalDuration: 30,
|
|
31
|
+
failedScenes: [],
|
|
32
|
+
}),
|
|
33
|
+
executeRegenerateScene: vi.fn().mockResolvedValue({ success: true }),
|
|
34
|
+
}));
|
|
35
|
+
vi.mock("../../commands/ai-highlights.js", () => ({
|
|
36
|
+
executeHighlights: vi.fn().mockResolvedValue({
|
|
37
|
+
success: true,
|
|
38
|
+
highlights: [
|
|
39
|
+
{
|
|
40
|
+
index: 1,
|
|
41
|
+
startTime: 10,
|
|
42
|
+
endTime: 25,
|
|
43
|
+
duration: 15,
|
|
44
|
+
category: "emotional",
|
|
45
|
+
confidence: 0.95,
|
|
46
|
+
reason: "Test highlight",
|
|
47
|
+
transcript: "Test transcript",
|
|
48
|
+
},
|
|
49
|
+
],
|
|
50
|
+
totalDuration: 120,
|
|
51
|
+
totalHighlightDuration: 15,
|
|
52
|
+
}),
|
|
53
|
+
executeAutoShorts: vi.fn().mockResolvedValue({
|
|
54
|
+
success: true,
|
|
55
|
+
shorts: [
|
|
56
|
+
{
|
|
57
|
+
index: 1,
|
|
58
|
+
startTime: 30,
|
|
59
|
+
endTime: 60,
|
|
60
|
+
duration: 30,
|
|
61
|
+
confidence: 0.9,
|
|
62
|
+
reason: "Viral moment",
|
|
63
|
+
outputPath: "/test/short-1.mp4",
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
}),
|
|
67
|
+
}));
|
|
68
|
+
vi.mock("../../commands/ai-animated-caption.js", () => ({
|
|
69
|
+
executeAnimatedCaption: vi.fn().mockResolvedValue({
|
|
70
|
+
success: true,
|
|
71
|
+
outputPath: "/test/captioned.mp4",
|
|
72
|
+
wordCount: 42,
|
|
73
|
+
groupCount: 10,
|
|
74
|
+
style: "highlight",
|
|
75
|
+
tier: "remotion",
|
|
76
|
+
}),
|
|
77
|
+
}));
|
|
78
|
+
vi.mock("../../commands/ai-analyze.js", () => ({
|
|
79
|
+
executeGeminiVideo: vi.fn().mockResolvedValue({
|
|
80
|
+
success: true,
|
|
81
|
+
response: "This is a test video summary.",
|
|
82
|
+
model: "gemini-3-flash-preview",
|
|
83
|
+
totalTokens: 1000,
|
|
84
|
+
}),
|
|
85
|
+
executeAnalyze: vi.fn().mockResolvedValue({
|
|
86
|
+
success: true,
|
|
87
|
+
response: "Test analysis",
|
|
88
|
+
}),
|
|
89
|
+
}));
|
|
90
|
+
vi.mock("../../commands/ai-edit.js", () => ({
|
|
91
|
+
executeSilenceCut: vi.fn().mockResolvedValue({
|
|
92
|
+
success: true,
|
|
93
|
+
outputPath: "/test/video-cut.mp4",
|
|
94
|
+
totalDuration: 120,
|
|
95
|
+
silentPeriods: [
|
|
96
|
+
{ start: 10, end: 15, duration: 5 },
|
|
97
|
+
{ start: 60, end: 63, duration: 3 },
|
|
98
|
+
],
|
|
99
|
+
silentDuration: 8,
|
|
100
|
+
}),
|
|
101
|
+
executeJumpCut: vi.fn().mockResolvedValue({
|
|
102
|
+
success: true,
|
|
103
|
+
outputPath: "/test/video-jumpcut.mp4",
|
|
104
|
+
totalDuration: 120,
|
|
105
|
+
fillerCount: 5,
|
|
106
|
+
fillerDuration: 3.2,
|
|
107
|
+
fillers: [
|
|
108
|
+
{ word: "um", start: 5.1, end: 5.6 },
|
|
109
|
+
{ word: "like", start: 12.3, end: 12.8 },
|
|
110
|
+
],
|
|
111
|
+
}),
|
|
112
|
+
executeCaption: vi.fn().mockResolvedValue({
|
|
113
|
+
success: true,
|
|
114
|
+
outputPath: "/test/video-captioned.mp4",
|
|
115
|
+
srtPath: "/test/video-captioned.srt",
|
|
116
|
+
segmentCount: 12,
|
|
117
|
+
}),
|
|
118
|
+
executeNoiseReduce: vi.fn().mockResolvedValue({
|
|
119
|
+
success: true,
|
|
120
|
+
outputPath: "/test/audio-denoised.mp4",
|
|
121
|
+
inputDuration: 60,
|
|
122
|
+
}),
|
|
123
|
+
executeFade: vi.fn().mockResolvedValue({
|
|
124
|
+
success: true,
|
|
125
|
+
outputPath: "/test/video-faded.mp4",
|
|
126
|
+
totalDuration: 120,
|
|
127
|
+
fadeInApplied: true,
|
|
128
|
+
fadeOutApplied: true,
|
|
129
|
+
}),
|
|
130
|
+
executeTranslateSrt: vi.fn().mockResolvedValue({
|
|
131
|
+
success: true,
|
|
132
|
+
outputPath: "/test/subtitles-ko.srt",
|
|
133
|
+
segmentCount: 20,
|
|
134
|
+
sourceLanguage: "en",
|
|
135
|
+
targetLanguage: "ko",
|
|
136
|
+
}),
|
|
137
|
+
executeTextOverlay: vi.fn().mockResolvedValue({
|
|
138
|
+
success: true,
|
|
139
|
+
outputPath: "/test/video-overlay.mp4",
|
|
140
|
+
}),
|
|
141
|
+
DEFAULT_FILLER_WORDS: ["um", "uh", "like", "you know"],
|
|
142
|
+
detectFillerRanges: vi.fn(),
|
|
143
|
+
}));
|
|
144
|
+
vi.mock("../../commands/ai-review.js", () => ({
|
|
145
|
+
executeReview: vi.fn().mockResolvedValue({
|
|
146
|
+
success: true,
|
|
147
|
+
issues: [],
|
|
148
|
+
}),
|
|
149
|
+
}));
|
|
150
|
+
vi.mock("../../commands/ai-image.js", () => ({
|
|
151
|
+
executeThumbnailBestFrame: vi.fn().mockResolvedValue({
|
|
152
|
+
success: true,
|
|
153
|
+
outputPath: "/test/video-thumbnail.png",
|
|
154
|
+
timestamp: 15.5,
|
|
155
|
+
reason: "Best composed frame",
|
|
156
|
+
}),
|
|
157
|
+
executeGeminiEdit: vi.fn().mockResolvedValue({
|
|
158
|
+
success: true,
|
|
159
|
+
outputPath: "/test/edited.png",
|
|
160
|
+
}),
|
|
161
|
+
}));
|
|
162
|
+
describe("CLI ↔ Agent Tool Synchronization", () => {
|
|
163
|
+
let registry;
|
|
164
|
+
beforeEach(() => {
|
|
165
|
+
registry = new ToolRegistry();
|
|
166
|
+
registerProjectTools(registry);
|
|
167
|
+
registerTimelineTools(registry);
|
|
168
|
+
registerFilesystemTools(registry);
|
|
169
|
+
registerMediaTools(registry);
|
|
170
|
+
registerAITools(registry);
|
|
171
|
+
registerExportTools(registry);
|
|
172
|
+
registerBatchTools(registry);
|
|
173
|
+
});
|
|
174
|
+
describe("Tool Registration", () => {
|
|
175
|
+
it("should register all 57 tools", () => {
|
|
176
|
+
const tools = registry.getAll();
|
|
177
|
+
expect(tools.length).toBe(58);
|
|
178
|
+
});
|
|
179
|
+
it("should register all project tools (5)", () => {
|
|
180
|
+
const projectTools = [
|
|
181
|
+
"project_create",
|
|
182
|
+
"project_info",
|
|
183
|
+
"project_set",
|
|
184
|
+
"project_open",
|
|
185
|
+
"project_save",
|
|
186
|
+
];
|
|
187
|
+
for (const name of projectTools) {
|
|
188
|
+
expect(registry.get(name)).toBeDefined();
|
|
189
|
+
}
|
|
190
|
+
});
|
|
191
|
+
it("should register all timeline tools (11)", () => {
|
|
192
|
+
const timelineTools = [
|
|
193
|
+
"timeline_add_source",
|
|
194
|
+
"timeline_add_clip",
|
|
195
|
+
"timeline_add_track",
|
|
196
|
+
"timeline_add_effect",
|
|
197
|
+
"timeline_trim",
|
|
198
|
+
"timeline_split",
|
|
199
|
+
"timeline_move",
|
|
200
|
+
"timeline_clear",
|
|
201
|
+
"timeline_delete",
|
|
202
|
+
"timeline_duplicate",
|
|
203
|
+
"timeline_list",
|
|
204
|
+
];
|
|
205
|
+
for (const name of timelineTools) {
|
|
206
|
+
expect(registry.get(name)).toBeDefined();
|
|
207
|
+
}
|
|
208
|
+
});
|
|
209
|
+
it("should register all filesystem tools (4)", () => {
|
|
210
|
+
const fsTools = ["fs_list", "fs_read", "fs_write", "fs_exists"];
|
|
211
|
+
for (const name of fsTools) {
|
|
212
|
+
expect(registry.get(name)).toBeDefined();
|
|
213
|
+
}
|
|
214
|
+
});
|
|
215
|
+
it("should register all media tools (8)", () => {
|
|
216
|
+
const mediaTools = [
|
|
217
|
+
"media_info",
|
|
218
|
+
"detect_scenes",
|
|
219
|
+
"detect_silence",
|
|
220
|
+
"detect_beats",
|
|
221
|
+
"audio_transcribe",
|
|
222
|
+
"media_compress",
|
|
223
|
+
"media_convert",
|
|
224
|
+
"media_concat",
|
|
225
|
+
];
|
|
226
|
+
for (const name of mediaTools) {
|
|
227
|
+
expect(registry.get(name)).toBeDefined();
|
|
228
|
+
}
|
|
229
|
+
});
|
|
230
|
+
it("should register all batch tools (3)", () => {
|
|
231
|
+
const batchTools = [
|
|
232
|
+
"batch_import",
|
|
233
|
+
"batch_concat",
|
|
234
|
+
"batch_apply_effect",
|
|
235
|
+
];
|
|
236
|
+
for (const name of batchTools) {
|
|
237
|
+
expect(registry.get(name)).toBeDefined();
|
|
238
|
+
}
|
|
239
|
+
});
|
|
240
|
+
it("should register all AI tools (23)", () => {
|
|
241
|
+
const aiTools = [
|
|
242
|
+
// Generation tools (8)
|
|
243
|
+
"generate_image",
|
|
244
|
+
"generate_video",
|
|
245
|
+
"generate_speech",
|
|
246
|
+
"generate_sound_effect",
|
|
247
|
+
"generate_music",
|
|
248
|
+
"generate_storyboard",
|
|
249
|
+
"generate_motion",
|
|
250
|
+
"generate_thumbnail",
|
|
251
|
+
// Edit tools (8)
|
|
252
|
+
"edit_text_overlay",
|
|
253
|
+
"edit_silence_cut",
|
|
254
|
+
"edit_jump_cut",
|
|
255
|
+
"edit_caption",
|
|
256
|
+
"edit_noise_reduce",
|
|
257
|
+
"edit_fade",
|
|
258
|
+
"edit_translate_srt",
|
|
259
|
+
"edit_image",
|
|
260
|
+
// Analyze tools (3)
|
|
261
|
+
"analyze_review",
|
|
262
|
+
"analyze_video",
|
|
263
|
+
"analyze_media",
|
|
264
|
+
// Pipeline tools (4)
|
|
265
|
+
"pipeline_script_to_video",
|
|
266
|
+
"pipeline_highlights",
|
|
267
|
+
"pipeline_auto_shorts",
|
|
268
|
+
"pipeline_regenerate_scene",
|
|
269
|
+
];
|
|
270
|
+
for (const name of aiTools) {
|
|
271
|
+
expect(registry.get(name)).toBeDefined();
|
|
272
|
+
}
|
|
273
|
+
});
|
|
274
|
+
it("should register all export tools (3)", () => {
|
|
275
|
+
const exportTools = ["export_video", "export_audio", "export_subtitles"];
|
|
276
|
+
for (const name of exportTools) {
|
|
277
|
+
expect(registry.get(name)).toBeDefined();
|
|
278
|
+
}
|
|
279
|
+
});
|
|
280
|
+
});
|
|
281
|
+
describe("Tool Definition Schema Validation", () => {
|
|
282
|
+
it("all tools should have valid definitions", () => {
|
|
283
|
+
const tools = registry.getAll();
|
|
284
|
+
for (const tool of tools) {
|
|
285
|
+
expect(tool.name).toBeTruthy();
|
|
286
|
+
expect(tool.description).toBeTruthy();
|
|
287
|
+
expect(tool.parameters).toBeDefined();
|
|
288
|
+
expect(tool.parameters.type).toBe("object");
|
|
289
|
+
expect(tool.parameters.properties).toBeDefined();
|
|
290
|
+
}
|
|
291
|
+
});
|
|
292
|
+
it("all tools should have required parameters listed", () => {
|
|
293
|
+
const tools = registry.getAll();
|
|
294
|
+
for (const tool of tools) {
|
|
295
|
+
if (tool.parameters.required && tool.parameters.required.length > 0) {
|
|
296
|
+
for (const requiredParam of tool.parameters.required) {
|
|
297
|
+
expect(tool.parameters.properties[requiredParam]).toBeDefined();
|
|
298
|
+
}
|
|
299
|
+
}
|
|
300
|
+
}
|
|
301
|
+
});
|
|
302
|
+
it("all parameter properties should have type and description", () => {
|
|
303
|
+
const tools = registry.getAll();
|
|
304
|
+
for (const tool of tools) {
|
|
305
|
+
for (const paramDef of Object.values(tool.parameters.properties)) {
|
|
306
|
+
const param = paramDef;
|
|
307
|
+
expect(param.type).toBeTruthy();
|
|
308
|
+
expect(param.description).toBeTruthy();
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
});
|
|
312
|
+
});
|
|
313
|
+
describe("AI Pipeline Tools - Parameter Mapping", () => {
|
|
314
|
+
describe("pipeline_script_to_video", () => {
|
|
315
|
+
it("should have all CLI options as parameters", () => {
|
|
316
|
+
const tool = registry.get("pipeline_script_to_video");
|
|
317
|
+
expect(tool).toBeDefined();
|
|
318
|
+
const params = tool.parameters.properties;
|
|
319
|
+
// Required
|
|
320
|
+
expect(params.script).toBeDefined();
|
|
321
|
+
// Optional (matching CLI options)
|
|
322
|
+
expect(params.outputDir).toBeDefined();
|
|
323
|
+
expect(params.duration).toBeDefined();
|
|
324
|
+
expect(params.voice).toBeDefined();
|
|
325
|
+
expect(params.generator).toBeDefined();
|
|
326
|
+
expect(params.imageProvider).toBeDefined();
|
|
327
|
+
expect(params.aspectRatio).toBeDefined();
|
|
328
|
+
expect(params.imagesOnly).toBeDefined();
|
|
329
|
+
expect(params.noVoiceover).toBeDefined();
|
|
330
|
+
expect(params.retries).toBeDefined();
|
|
331
|
+
});
|
|
332
|
+
it("should have correct enum values for generator", () => {
|
|
333
|
+
const tool = registry.get("pipeline_script_to_video");
|
|
334
|
+
const generator = tool.parameters.properties.generator;
|
|
335
|
+
expect(generator.enum).toContain("runway");
|
|
336
|
+
expect(generator.enum).toContain("kling");
|
|
337
|
+
});
|
|
338
|
+
it("should have correct enum values for imageProvider", () => {
|
|
339
|
+
const tool = registry.get("pipeline_script_to_video");
|
|
340
|
+
const imageProvider = tool.parameters.properties.imageProvider;
|
|
341
|
+
expect(imageProvider.enum).toContain("openai");
|
|
342
|
+
expect(imageProvider.enum).toContain("gemini");
|
|
343
|
+
});
|
|
344
|
+
it("should have correct enum values for aspectRatio", () => {
|
|
345
|
+
const tool = registry.get("pipeline_script_to_video");
|
|
346
|
+
const aspectRatio = tool.parameters.properties.aspectRatio;
|
|
347
|
+
expect(aspectRatio.enum).toContain("16:9");
|
|
348
|
+
expect(aspectRatio.enum).toContain("9:16");
|
|
349
|
+
expect(aspectRatio.enum).toContain("1:1");
|
|
350
|
+
});
|
|
351
|
+
});
|
|
352
|
+
describe("pipeline_highlights", () => {
|
|
353
|
+
it("should have all CLI options as parameters", () => {
|
|
354
|
+
const tool = registry.get("pipeline_highlights");
|
|
355
|
+
expect(tool).toBeDefined();
|
|
356
|
+
const params = tool.parameters.properties;
|
|
357
|
+
// Required
|
|
358
|
+
expect(params.media).toBeDefined();
|
|
359
|
+
// Optional (matching CLI options)
|
|
360
|
+
expect(params.output).toBeDefined();
|
|
361
|
+
expect(params.project).toBeDefined();
|
|
362
|
+
expect(params.duration).toBeDefined();
|
|
363
|
+
expect(params.count).toBeDefined();
|
|
364
|
+
expect(params.threshold).toBeDefined();
|
|
365
|
+
expect(params.criteria).toBeDefined();
|
|
366
|
+
expect(params.language).toBeDefined();
|
|
367
|
+
expect(params.useGemini).toBeDefined();
|
|
368
|
+
expect(params.lowRes).toBeDefined();
|
|
369
|
+
});
|
|
370
|
+
it("should have correct enum values for criteria", () => {
|
|
371
|
+
const tool = registry.get("pipeline_highlights");
|
|
372
|
+
const criteria = tool.parameters.properties.criteria;
|
|
373
|
+
expect(criteria.enum).toContain("emotional");
|
|
374
|
+
expect(criteria.enum).toContain("informative");
|
|
375
|
+
expect(criteria.enum).toContain("funny");
|
|
376
|
+
expect(criteria.enum).toContain("all");
|
|
377
|
+
});
|
|
378
|
+
});
|
|
379
|
+
describe("pipeline_auto_shorts", () => {
|
|
380
|
+
it("should have all CLI options as parameters", () => {
|
|
381
|
+
const tool = registry.get("pipeline_auto_shorts");
|
|
382
|
+
expect(tool).toBeDefined();
|
|
383
|
+
const params = tool.parameters.properties;
|
|
384
|
+
// Required
|
|
385
|
+
expect(params.video).toBeDefined();
|
|
386
|
+
// Optional (matching CLI options)
|
|
387
|
+
expect(params.outputDir).toBeDefined();
|
|
388
|
+
expect(params.duration).toBeDefined();
|
|
389
|
+
expect(params.count).toBeDefined();
|
|
390
|
+
expect(params.aspect).toBeDefined();
|
|
391
|
+
expect(params.addCaptions).toBeDefined();
|
|
392
|
+
expect(params.captionStyle).toBeDefined();
|
|
393
|
+
expect(params.analyzeOnly).toBeDefined();
|
|
394
|
+
expect(params.language).toBeDefined();
|
|
395
|
+
expect(params.useGemini).toBeDefined();
|
|
396
|
+
expect(params.lowRes).toBeDefined();
|
|
397
|
+
});
|
|
398
|
+
it("should have correct enum values for aspect", () => {
|
|
399
|
+
const tool = registry.get("pipeline_auto_shorts");
|
|
400
|
+
const aspect = tool.parameters.properties.aspect;
|
|
401
|
+
expect(aspect.enum).toContain("9:16");
|
|
402
|
+
expect(aspect.enum).toContain("1:1");
|
|
403
|
+
});
|
|
404
|
+
it("should have correct enum values for captionStyle", () => {
|
|
405
|
+
const tool = registry.get("pipeline_auto_shorts");
|
|
406
|
+
const captionStyle = tool.parameters.properties.captionStyle;
|
|
407
|
+
expect(captionStyle.enum).toContain("minimal");
|
|
408
|
+
expect(captionStyle.enum).toContain("bold");
|
|
409
|
+
expect(captionStyle.enum).toContain("animated");
|
|
410
|
+
});
|
|
411
|
+
});
|
|
412
|
+
describe("analyze_video", () => {
|
|
413
|
+
it("should have all CLI options as parameters", () => {
|
|
414
|
+
const tool = registry.get("analyze_video");
|
|
415
|
+
expect(tool).toBeDefined();
|
|
416
|
+
const params = tool.parameters.properties;
|
|
417
|
+
// Required
|
|
418
|
+
expect(params.source).toBeDefined();
|
|
419
|
+
expect(params.prompt).toBeDefined();
|
|
420
|
+
// Optional (matching CLI options)
|
|
421
|
+
expect(params.model).toBeDefined();
|
|
422
|
+
expect(params.fps).toBeDefined();
|
|
423
|
+
expect(params.start).toBeDefined();
|
|
424
|
+
expect(params.end).toBeDefined();
|
|
425
|
+
expect(params.lowRes).toBeDefined();
|
|
426
|
+
});
|
|
427
|
+
it("should have correct enum values for model", () => {
|
|
428
|
+
const tool = registry.get("analyze_video");
|
|
429
|
+
const model = tool.parameters.properties.model;
|
|
430
|
+
expect(model.enum).toContain("flash");
|
|
431
|
+
expect(model.enum).toContain("flash-2.5");
|
|
432
|
+
expect(model.enum).toContain("pro");
|
|
433
|
+
});
|
|
434
|
+
});
|
|
435
|
+
});
|
|
436
|
+
describe("Tool Handler Execution (Mocked)", () => {
|
|
437
|
+
const mockContext = {
|
|
438
|
+
workingDirectory: "/test/workdir",
|
|
439
|
+
projectPath: "/test/project.vibe.json",
|
|
440
|
+
};
|
|
441
|
+
describe("pipeline_script_to_video handler", () => {
|
|
442
|
+
it("should call executeScriptToVideo with correct parameters", async () => {
|
|
443
|
+
const { executeScriptToVideo } = await import("../../commands/ai-script-pipeline.js");
|
|
444
|
+
const handler = registry.getHandler("pipeline_script_to_video");
|
|
445
|
+
expect(handler).toBeDefined();
|
|
446
|
+
const result = await handler({
|
|
447
|
+
script: "Test script. Scene two. Conclusion.",
|
|
448
|
+
outputDir: "output",
|
|
449
|
+
generator: "runway",
|
|
450
|
+
imageProvider: "gemini",
|
|
451
|
+
aspectRatio: "16:9",
|
|
452
|
+
}, mockContext);
|
|
453
|
+
expect(executeScriptToVideo).toHaveBeenCalledWith(expect.objectContaining({
|
|
454
|
+
script: "Test script. Scene two. Conclusion.",
|
|
455
|
+
generator: "runway",
|
|
456
|
+
imageProvider: "gemini",
|
|
457
|
+
aspectRatio: "16:9",
|
|
458
|
+
}));
|
|
459
|
+
expect(result.success).toBe(true);
|
|
460
|
+
expect(result.output).toContain("Script-to-Video complete");
|
|
461
|
+
});
|
|
462
|
+
it("should handle failure gracefully", async () => {
|
|
463
|
+
const { executeScriptToVideo } = await import("../../commands/ai-script-pipeline.js");
|
|
464
|
+
vi.mocked(executeScriptToVideo).mockResolvedValueOnce({
|
|
465
|
+
success: false,
|
|
466
|
+
outputDir: "/test/output",
|
|
467
|
+
scenes: 0,
|
|
468
|
+
error: "API key missing",
|
|
469
|
+
});
|
|
470
|
+
const handler = registry.getHandler("pipeline_script_to_video");
|
|
471
|
+
const result = await handler({ script: "Test" }, mockContext);
|
|
472
|
+
expect(result.success).toBe(false);
|
|
473
|
+
expect(result.error).toContain("API key missing");
|
|
474
|
+
});
|
|
475
|
+
});
|
|
476
|
+
describe("pipeline_highlights handler", () => {
|
|
477
|
+
it("should call executeHighlights with correct parameters", async () => {
|
|
478
|
+
const { executeHighlights } = await import("../../commands/ai-highlights.js");
|
|
479
|
+
const handler = registry.getHandler("pipeline_highlights");
|
|
480
|
+
expect(handler).toBeDefined();
|
|
481
|
+
const result = await handler({
|
|
482
|
+
media: "video.mp4",
|
|
483
|
+
duration: 60,
|
|
484
|
+
criteria: "emotional",
|
|
485
|
+
useGemini: true,
|
|
486
|
+
}, mockContext);
|
|
487
|
+
expect(executeHighlights).toHaveBeenCalledWith(expect.objectContaining({
|
|
488
|
+
media: "/test/workdir/video.mp4",
|
|
489
|
+
duration: 60,
|
|
490
|
+
criteria: "emotional",
|
|
491
|
+
useGemini: true,
|
|
492
|
+
}));
|
|
493
|
+
expect(result.success).toBe(true);
|
|
494
|
+
expect(result.output).toContain("Found 1 highlights");
|
|
495
|
+
});
|
|
496
|
+
});
|
|
497
|
+
describe("pipeline_auto_shorts handler", () => {
|
|
498
|
+
it("should call executeAutoShorts with correct parameters", async () => {
|
|
499
|
+
const { executeAutoShorts } = await import("../../commands/ai-highlights.js");
|
|
500
|
+
const handler = registry.getHandler("pipeline_auto_shorts");
|
|
501
|
+
expect(handler).toBeDefined();
|
|
502
|
+
const result = await handler({
|
|
503
|
+
video: "long-video.mp4",
|
|
504
|
+
count: 3,
|
|
505
|
+
duration: 45,
|
|
506
|
+
aspect: "9:16",
|
|
507
|
+
}, mockContext);
|
|
508
|
+
expect(executeAutoShorts).toHaveBeenCalledWith(expect.objectContaining({
|
|
509
|
+
video: "/test/workdir/long-video.mp4",
|
|
510
|
+
count: 3,
|
|
511
|
+
duration: 45,
|
|
512
|
+
aspect: "9:16",
|
|
513
|
+
}));
|
|
514
|
+
expect(result.success).toBe(true);
|
|
515
|
+
expect(result.output).toContain("Generated 1 short");
|
|
516
|
+
});
|
|
517
|
+
it("should handle analyzeOnly mode", async () => {
|
|
518
|
+
const handler = registry.getHandler("pipeline_auto_shorts");
|
|
519
|
+
const result = await handler({
|
|
520
|
+
video: "video.mp4",
|
|
521
|
+
analyzeOnly: true,
|
|
522
|
+
}, mockContext);
|
|
523
|
+
expect(result.success).toBe(true);
|
|
524
|
+
});
|
|
525
|
+
});
|
|
526
|
+
describe("analyze_video handler", () => {
|
|
527
|
+
it("should call executeGeminiVideo with correct parameters", async () => {
|
|
528
|
+
const { executeGeminiVideo } = await import("../../commands/ai-analyze.js");
|
|
529
|
+
const handler = registry.getHandler("analyze_video");
|
|
530
|
+
expect(handler).toBeDefined();
|
|
531
|
+
const result = await handler({
|
|
532
|
+
source: "video.mp4",
|
|
533
|
+
prompt: "Summarize this video",
|
|
534
|
+
model: "flash",
|
|
535
|
+
}, mockContext);
|
|
536
|
+
expect(executeGeminiVideo).toHaveBeenCalledWith(expect.objectContaining({
|
|
537
|
+
source: "/test/workdir/video.mp4",
|
|
538
|
+
prompt: "Summarize this video",
|
|
539
|
+
model: "flash",
|
|
540
|
+
}));
|
|
541
|
+
expect(result.success).toBe(true);
|
|
542
|
+
expect(result.output).toContain("test video summary");
|
|
543
|
+
});
|
|
544
|
+
it("should handle YouTube URLs without modification", async () => {
|
|
545
|
+
const { executeGeminiVideo } = await import("../../commands/ai-analyze.js");
|
|
546
|
+
const handler = registry.getHandler("analyze_video");
|
|
547
|
+
await handler({
|
|
548
|
+
source: "https://youtube.com/watch?v=test",
|
|
549
|
+
prompt: "Summarize",
|
|
550
|
+
}, mockContext);
|
|
551
|
+
expect(executeGeminiVideo).toHaveBeenCalledWith(expect.objectContaining({
|
|
552
|
+
source: "https://youtube.com/watch?v=test",
|
|
553
|
+
}));
|
|
554
|
+
});
|
|
555
|
+
});
|
|
556
|
+
});
|
|
557
|
+
describe("Tool Categories Match CLAUDE.md Documentation", () => {
|
|
558
|
+
it("should have correct tool counts per category", () => {
|
|
559
|
+
const allTools = registry.getAll();
|
|
560
|
+
const projectTools = allTools.filter((t) => t.name.startsWith("project_"));
|
|
561
|
+
const timelineTools = allTools.filter((t) => t.name.startsWith("timeline_"));
|
|
562
|
+
const fsTools = allTools.filter((t) => t.name.startsWith("fs_"));
|
|
563
|
+
const mediaTools = allTools.filter((t) => t.name.startsWith("media_") ||
|
|
564
|
+
t.name.startsWith("detect_") ||
|
|
565
|
+
t.name.startsWith("audio_"));
|
|
566
|
+
const generateTools = allTools.filter((t) => t.name.startsWith("generate_"));
|
|
567
|
+
const editTools = allTools.filter((t) => t.name.startsWith("edit_"));
|
|
568
|
+
const analyzeTools = allTools.filter((t) => t.name.startsWith("analyze_"));
|
|
569
|
+
const pipelineTools = allTools.filter((t) => t.name.startsWith("pipeline_"));
|
|
570
|
+
const exportTools = allTools.filter((t) => t.name.startsWith("export_"));
|
|
571
|
+
const batchTools = allTools.filter((t) => t.name.startsWith("batch_"));
|
|
572
|
+
expect(projectTools.length).toBe(5);
|
|
573
|
+
expect(timelineTools.length).toBe(11); // Added timeline_clear
|
|
574
|
+
expect(fsTools.length).toBe(4);
|
|
575
|
+
expect(mediaTools.length).toBe(8); // Added media_compress, media_convert, media_concat
|
|
576
|
+
expect(generateTools.length).toBe(8); // image, video, speech, sound_effect, music, storyboard, motion, thumbnail
|
|
577
|
+
expect(editTools.length).toBe(8); // text_overlay, silence_cut, jump_cut, caption, noise_reduce, fade, translate_srt, image
|
|
578
|
+
expect(analyzeTools.length).toBe(3); // video, media, review
|
|
579
|
+
expect(pipelineTools.length).toBe(5); // script_to_video, highlights, auto_shorts, regenerate_scene, animated_caption
|
|
580
|
+
expect(exportTools.length).toBe(3);
|
|
581
|
+
expect(batchTools.length).toBe(3);
|
|
582
|
+
// Total: 5+11+4+8+8+8+3+4+3+3 = 57
|
|
583
|
+
const totalTools = projectTools.length +
|
|
584
|
+
timelineTools.length +
|
|
585
|
+
fsTools.length +
|
|
586
|
+
mediaTools.length +
|
|
587
|
+
generateTools.length +
|
|
588
|
+
editTools.length +
|
|
589
|
+
analyzeTools.length +
|
|
590
|
+
pipelineTools.length +
|
|
591
|
+
exportTools.length +
|
|
592
|
+
batchTools.length;
|
|
593
|
+
expect(totalTools).toBe(58);
|
|
594
|
+
});
|
|
595
|
+
});
|
|
596
|
+
});
|
|
597
|
+
describe("Exported CLI Functions", () => {
|
|
598
|
+
describe("Function signatures match Agent tool parameters", () => {
|
|
599
|
+
it("executeScriptToVideo accepts ScriptToVideoOptions", async () => {
|
|
600
|
+
// Type check - this will fail at compile time if signatures don't match
|
|
601
|
+
const { executeScriptToVideo } = await import("../../commands/ai-script-pipeline.js");
|
|
602
|
+
expect(typeof executeScriptToVideo).toBe("function");
|
|
603
|
+
});
|
|
604
|
+
it("executeHighlights accepts HighlightsOptions", async () => {
|
|
605
|
+
const { executeHighlights } = await import("../../commands/ai-highlights.js");
|
|
606
|
+
expect(typeof executeHighlights).toBe("function");
|
|
607
|
+
});
|
|
608
|
+
it("executeAutoShorts accepts AutoShortsOptions", async () => {
|
|
609
|
+
const { executeAutoShorts } = await import("../../commands/ai-highlights.js");
|
|
610
|
+
expect(typeof executeAutoShorts).toBe("function");
|
|
611
|
+
});
|
|
612
|
+
it("executeGeminiVideo accepts GeminiVideoOptions", async () => {
|
|
613
|
+
const { executeGeminiVideo } = await import("../../commands/ai-analyze.js");
|
|
614
|
+
expect(typeof executeGeminiVideo).toBe("function");
|
|
615
|
+
});
|
|
616
|
+
});
|
|
617
|
+
});
|
|
618
|
+
describe("Tool Name Consistency", () => {
|
|
619
|
+
let registry;
|
|
620
|
+
beforeEach(() => {
|
|
621
|
+
registry = new ToolRegistry();
|
|
622
|
+
registerProjectTools(registry);
|
|
623
|
+
registerTimelineTools(registry);
|
|
624
|
+
registerFilesystemTools(registry);
|
|
625
|
+
registerMediaTools(registry);
|
|
626
|
+
registerAITools(registry);
|
|
627
|
+
registerExportTools(registry);
|
|
628
|
+
registerBatchTools(registry);
|
|
629
|
+
});
|
|
630
|
+
it("all tool names should follow naming convention", () => {
|
|
631
|
+
const tools = registry.getAll();
|
|
632
|
+
const validPrefixes = [
|
|
633
|
+
"project_",
|
|
634
|
+
"timeline_",
|
|
635
|
+
"fs_",
|
|
636
|
+
"media_",
|
|
637
|
+
"detect_",
|
|
638
|
+
"audio_",
|
|
639
|
+
"generate_",
|
|
640
|
+
"edit_",
|
|
641
|
+
"analyze_",
|
|
642
|
+
"pipeline_",
|
|
643
|
+
"export_",
|
|
644
|
+
"batch_",
|
|
645
|
+
];
|
|
646
|
+
for (const tool of tools) {
|
|
647
|
+
const hasValidPrefix = validPrefixes.some((prefix) => tool.name.startsWith(prefix));
|
|
648
|
+
expect(hasValidPrefix).toBe(true);
|
|
649
|
+
}
|
|
650
|
+
});
|
|
651
|
+
it("all tool names should be lowercase with underscores", () => {
|
|
652
|
+
const tools = registry.getAll();
|
|
653
|
+
const validNamePattern = /^[a-z_]+$/;
|
|
654
|
+
for (const tool of tools) {
|
|
655
|
+
expect(tool.name).toMatch(validNamePattern);
|
|
656
|
+
}
|
|
657
|
+
});
|
|
658
|
+
});
|
|
659
|
+
//# sourceMappingURL=integration.test.js.map
|