@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,264 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module ai-suggest-edit
|
|
3
|
+
* @description AI suggest, edit, and storyboard CLI commands.
|
|
4
|
+
*
|
|
5
|
+
* ## Commands: vibe ai suggest, vibe ai edit, vibe ai storyboard
|
|
6
|
+
* ## Dependencies: Gemini, OpenAI, Claude
|
|
7
|
+
*
|
|
8
|
+
* Extracted from ai.ts as part of modularisation.
|
|
9
|
+
* ai.ts calls registerSuggestEditCommands(aiCommand).
|
|
10
|
+
* @see MODELS.md for AI model configuration
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
import { type Command } from 'commander';
|
|
14
|
+
import { readFile, writeFile } from 'node:fs/promises';
|
|
15
|
+
import { resolve } from 'node:path';
|
|
16
|
+
import chalk from 'chalk';
|
|
17
|
+
import ora from 'ora';
|
|
18
|
+
import {
|
|
19
|
+
GeminiProvider,
|
|
20
|
+
OpenAIProvider,
|
|
21
|
+
ClaudeProvider,
|
|
22
|
+
} from '@vibeframe/ai-providers';
|
|
23
|
+
import { Project, type ProjectFile } from '../engine/index.js';
|
|
24
|
+
import { getApiKey } from '../utils/api-key.js';
|
|
25
|
+
import { formatTime, applySuggestion } from './ai-helpers.js';
|
|
26
|
+
import { executeCommand } from './ai.js';
|
|
27
|
+
|
|
28
|
+
export function registerSuggestEditCommands(ai: Command): void {
|
|
29
|
+
ai
|
|
30
|
+
.command("suggest")
|
|
31
|
+
.description("Get AI edit suggestions using Gemini")
|
|
32
|
+
.argument("<project>", "Project file path")
|
|
33
|
+
.argument("<instruction>", "Natural language instruction")
|
|
34
|
+
.option("-k, --api-key <key>", "Google API key (or set GOOGLE_API_KEY env)")
|
|
35
|
+
.option("--apply", "Apply the first suggestion automatically")
|
|
36
|
+
.action(async (projectPath: string, instruction: string, options) => {
|
|
37
|
+
try {
|
|
38
|
+
const apiKey = await getApiKey("GOOGLE_API_KEY", "Google", options.apiKey);
|
|
39
|
+
if (!apiKey) {
|
|
40
|
+
console.error(chalk.red("Google API key required. Use --api-key or set GOOGLE_API_KEY"));
|
|
41
|
+
process.exit(1);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const spinner = ora("Initializing Gemini...").start();
|
|
45
|
+
|
|
46
|
+
const filePath = resolve(process.cwd(), projectPath);
|
|
47
|
+
const content = await readFile(filePath, "utf-8");
|
|
48
|
+
const data: ProjectFile = JSON.parse(content);
|
|
49
|
+
const project = Project.fromJSON(data);
|
|
50
|
+
|
|
51
|
+
const gemini = new GeminiProvider();
|
|
52
|
+
await gemini.initialize({ apiKey });
|
|
53
|
+
|
|
54
|
+
spinner.text = "Analyzing...";
|
|
55
|
+
const clips = project.getClips();
|
|
56
|
+
const suggestions = await gemini.autoEdit(clips, instruction);
|
|
57
|
+
|
|
58
|
+
spinner.succeed(chalk.green(`Found ${suggestions.length} suggestion(s)`));
|
|
59
|
+
|
|
60
|
+
console.log();
|
|
61
|
+
console.log(chalk.bold.cyan("Edit Suggestions"));
|
|
62
|
+
console.log(chalk.dim("─".repeat(60)));
|
|
63
|
+
|
|
64
|
+
for (let i = 0; i < suggestions.length; i++) {
|
|
65
|
+
const sug = suggestions[i];
|
|
66
|
+
console.log();
|
|
67
|
+
console.log(chalk.yellow(`[${i + 1}] ${sug.type.toUpperCase()}`));
|
|
68
|
+
console.log(` ${sug.description}`);
|
|
69
|
+
console.log(chalk.dim(` Confidence: ${(sug.confidence * 100).toFixed(0)}%`));
|
|
70
|
+
console.log(chalk.dim(` Clips: ${sug.clipIds.join(", ")}`));
|
|
71
|
+
console.log(chalk.dim(` Params: ${JSON.stringify(sug.params)}`));
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
if (options.apply && suggestions.length > 0) {
|
|
75
|
+
console.log();
|
|
76
|
+
spinner.start("Applying first suggestion...");
|
|
77
|
+
|
|
78
|
+
const sug = suggestions[0];
|
|
79
|
+
const applied = applySuggestion(project, sug);
|
|
80
|
+
|
|
81
|
+
if (applied) {
|
|
82
|
+
await writeFile(filePath, JSON.stringify(project.toJSON(), null, 2), "utf-8");
|
|
83
|
+
spinner.succeed(chalk.green("Suggestion applied"));
|
|
84
|
+
} else {
|
|
85
|
+
spinner.warn(chalk.yellow("Could not apply suggestion automatically"));
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
console.log();
|
|
90
|
+
} catch (error) {
|
|
91
|
+
console.error(chalk.red("AI suggestion failed"));
|
|
92
|
+
console.error(error);
|
|
93
|
+
process.exit(1);
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
ai
|
|
98
|
+
.command("edit")
|
|
99
|
+
.description("Edit timeline using natural language (GPT-powered)")
|
|
100
|
+
.argument("<project>", "Project file path")
|
|
101
|
+
.argument("<instruction>", "Natural language command (e.g., 'trim all clips to 5 seconds')")
|
|
102
|
+
.option("-k, --api-key <key>", "OpenAI API key (or set OPENAI_API_KEY env)")
|
|
103
|
+
.option("--dry-run", "Show commands without executing")
|
|
104
|
+
.action(async (projectPath: string, instruction: string, options) => {
|
|
105
|
+
try {
|
|
106
|
+
const apiKey = await getApiKey("OPENAI_API_KEY", "OpenAI", options.apiKey);
|
|
107
|
+
if (!apiKey) {
|
|
108
|
+
console.error(chalk.red("OpenAI API key required. Use --api-key or set OPENAI_API_KEY"));
|
|
109
|
+
process.exit(1);
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
const spinner = ora("Parsing command...").start();
|
|
113
|
+
|
|
114
|
+
const filePath = resolve(process.cwd(), projectPath);
|
|
115
|
+
const content = await readFile(filePath, "utf-8");
|
|
116
|
+
const data: ProjectFile = JSON.parse(content);
|
|
117
|
+
const project = Project.fromJSON(data);
|
|
118
|
+
|
|
119
|
+
const gpt = new OpenAIProvider();
|
|
120
|
+
await gpt.initialize({ apiKey });
|
|
121
|
+
|
|
122
|
+
const clips = project.getClips();
|
|
123
|
+
const tracks = project.getTracks().map((t) => t.id);
|
|
124
|
+
|
|
125
|
+
const result = await gpt.parseCommand(instruction, { clips, tracks });
|
|
126
|
+
|
|
127
|
+
if (!result.success) {
|
|
128
|
+
spinner.fail(chalk.red(result.error || "Failed to parse command"));
|
|
129
|
+
process.exit(1);
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
if (result.clarification) {
|
|
133
|
+
spinner.warn(chalk.yellow(result.clarification));
|
|
134
|
+
process.exit(0);
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
if (result.commands.length === 0) {
|
|
138
|
+
spinner.warn(chalk.yellow("No commands generated"));
|
|
139
|
+
process.exit(0);
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
spinner.succeed(chalk.green(`Parsed ${result.commands.length} command(s)`));
|
|
143
|
+
|
|
144
|
+
console.log();
|
|
145
|
+
console.log(chalk.bold.cyan("Commands to execute:"));
|
|
146
|
+
console.log(chalk.dim("─".repeat(60)));
|
|
147
|
+
|
|
148
|
+
for (const cmd of result.commands) {
|
|
149
|
+
console.log();
|
|
150
|
+
console.log(chalk.yellow(`▸ ${cmd.action.toUpperCase()}`));
|
|
151
|
+
console.log(` ${cmd.description}`);
|
|
152
|
+
if (cmd.clipIds.length > 0) {
|
|
153
|
+
console.log(chalk.dim(` Clips: ${cmd.clipIds.join(", ")}`));
|
|
154
|
+
}
|
|
155
|
+
console.log(chalk.dim(` Params: ${JSON.stringify(cmd.params)}`));
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
if (options.dryRun) {
|
|
159
|
+
console.log();
|
|
160
|
+
console.log(chalk.dim("Dry run - no changes made"));
|
|
161
|
+
return;
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
console.log();
|
|
165
|
+
spinner.start("Executing commands...");
|
|
166
|
+
|
|
167
|
+
let executed = 0;
|
|
168
|
+
for (const cmd of result.commands) {
|
|
169
|
+
const success = executeCommand(project, cmd);
|
|
170
|
+
if (success) executed++;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
await writeFile(filePath, JSON.stringify(project.toJSON(), null, 2), "utf-8");
|
|
174
|
+
|
|
175
|
+
spinner.succeed(chalk.green(`Executed ${executed}/${result.commands.length} commands`));
|
|
176
|
+
console.log();
|
|
177
|
+
} catch (error) {
|
|
178
|
+
console.error(chalk.red("AI edit failed"));
|
|
179
|
+
console.error(error);
|
|
180
|
+
process.exit(1);
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
|
|
184
|
+
ai
|
|
185
|
+
.command("storyboard")
|
|
186
|
+
.description("Generate video storyboard from content using Claude")
|
|
187
|
+
.argument("<content>", "Content to analyze (text or file path)")
|
|
188
|
+
.option("-k, --api-key <key>", "Anthropic API key (or set ANTHROPIC_API_KEY env)")
|
|
189
|
+
.option("-o, --output <path>", "Output JSON file path")
|
|
190
|
+
.option("-d, --duration <sec>", "Target total duration in seconds")
|
|
191
|
+
.option("-f, --file", "Treat content argument as file path")
|
|
192
|
+
.option("-c, --creativity <level>", "Creativity level: low (default, consistent) or high (varied, unexpected)", "low")
|
|
193
|
+
.action(async (content: string, options) => {
|
|
194
|
+
try {
|
|
195
|
+
const apiKey = await getApiKey("ANTHROPIC_API_KEY", "Anthropic", options.apiKey);
|
|
196
|
+
if (!apiKey) {
|
|
197
|
+
console.error(chalk.red("Anthropic API key required. Use --api-key or set ANTHROPIC_API_KEY"));
|
|
198
|
+
process.exit(1);
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
// Validate creativity level
|
|
202
|
+
const creativity = options.creativity?.toLowerCase();
|
|
203
|
+
if (creativity && creativity !== "low" && creativity !== "high") {
|
|
204
|
+
console.error(chalk.red("Invalid creativity level. Use 'low' or 'high'."));
|
|
205
|
+
process.exit(1);
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
let textContent = content;
|
|
209
|
+
if (options.file) {
|
|
210
|
+
const filePath = resolve(process.cwd(), content);
|
|
211
|
+
textContent = await readFile(filePath, "utf-8");
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
const spinnerText = creativity === "high"
|
|
215
|
+
? "Analyzing content with high creativity..."
|
|
216
|
+
: "Analyzing content...";
|
|
217
|
+
const spinner = ora(spinnerText).start();
|
|
218
|
+
|
|
219
|
+
const claude = new ClaudeProvider();
|
|
220
|
+
await claude.initialize({ apiKey });
|
|
221
|
+
|
|
222
|
+
const segments = await claude.analyzeContent(
|
|
223
|
+
textContent,
|
|
224
|
+
options.duration ? parseFloat(options.duration) : undefined,
|
|
225
|
+
{ creativity: creativity as "low" | "high" | undefined }
|
|
226
|
+
);
|
|
227
|
+
|
|
228
|
+
if (segments.length === 0) {
|
|
229
|
+
spinner.fail(chalk.red("Could not generate storyboard"));
|
|
230
|
+
process.exit(1);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
spinner.succeed(chalk.green(`Generated ${segments.length} segments`));
|
|
234
|
+
|
|
235
|
+
console.log();
|
|
236
|
+
console.log(chalk.bold.cyan("Storyboard"));
|
|
237
|
+
console.log(chalk.dim("─".repeat(60)));
|
|
238
|
+
|
|
239
|
+
for (const seg of segments) {
|
|
240
|
+
console.log();
|
|
241
|
+
console.log(chalk.yellow(`[${seg.index + 1}] ${formatTime(seg.startTime)} - ${formatTime(seg.startTime + seg.duration)}`));
|
|
242
|
+
console.log(` ${seg.description}`);
|
|
243
|
+
console.log(chalk.dim(` Visuals: ${seg.visuals}`));
|
|
244
|
+
if (seg.audio) {
|
|
245
|
+
console.log(chalk.dim(` Audio: ${seg.audio}`));
|
|
246
|
+
}
|
|
247
|
+
if (seg.textOverlays && seg.textOverlays.length > 0) {
|
|
248
|
+
console.log(chalk.dim(` Text: ${seg.textOverlays.join(", ")}`));
|
|
249
|
+
}
|
|
250
|
+
}
|
|
251
|
+
console.log();
|
|
252
|
+
|
|
253
|
+
if (options.output) {
|
|
254
|
+
const outputPath = resolve(process.cwd(), options.output);
|
|
255
|
+
await writeFile(outputPath, JSON.stringify(segments, null, 2), "utf-8");
|
|
256
|
+
console.log(chalk.green(`Saved to: ${outputPath}`));
|
|
257
|
+
}
|
|
258
|
+
} catch (error) {
|
|
259
|
+
console.error(chalk.red("Storyboard generation failed"));
|
|
260
|
+
console.error(error);
|
|
261
|
+
process.exit(1);
|
|
262
|
+
}
|
|
263
|
+
});
|
|
264
|
+
}
|