@vibeframe/cli 0.104.3 → 0.105.2

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.
Files changed (245) hide show
  1. package/dist/agent/adapters/claude.d.ts +14 -0
  2. package/dist/agent/adapters/gemini.d.ts +14 -0
  3. package/dist/agent/adapters/index.d.ts +27 -0
  4. package/dist/agent/adapters/ollama.d.ts +19 -0
  5. package/dist/agent/adapters/openai.d.ts +14 -0
  6. package/dist/agent/adapters/openrouter.d.ts +15 -0
  7. package/dist/agent/adapters/openrouter.test.d.ts +4 -0
  8. package/dist/agent/adapters/xai.d.ts +14 -0
  9. package/dist/agent/index.d.ts +109 -0
  10. package/dist/agent/memory/index.d.ts +69 -0
  11. package/dist/agent/prompts/system.d.ts +5 -0
  12. package/dist/agent/tools/e2e.test.d.ts +25 -0
  13. package/dist/agent/tools/index.d.ts +59 -0
  14. package/dist/agent/tools/integration.test.d.ts +10 -0
  15. package/dist/agent/tools/scene.test.d.ts +1 -0
  16. package/dist/agent/types.d.ts +72 -0
  17. package/dist/commands/_shared/build-asset-metadata.d.ts +43 -0
  18. package/dist/commands/_shared/build-asset-reference.d.ts +18 -0
  19. package/dist/commands/_shared/build-backdrop-prompt.d.ts +8 -0
  20. package/dist/commands/_shared/build-backdrop-prompt.test.d.ts +1 -0
  21. package/dist/commands/_shared/build-cache.d.ts +37 -0
  22. package/dist/commands/_shared/build-plan.d.ts +107 -0
  23. package/dist/commands/_shared/build-plan.test.d.ts +1 -0
  24. package/dist/commands/_shared/compose-prompts.d.ts +97 -0
  25. package/dist/commands/_shared/compose-prompts.test.d.ts +1 -0
  26. package/dist/commands/_shared/compose-scenes-skills.d.ts +282 -0
  27. package/dist/commands/_shared/compose-scenes-skills.test.d.ts +1 -0
  28. package/dist/commands/_shared/composer-resolve.d.ts +47 -0
  29. package/dist/commands/_shared/composer-resolve.test.d.ts +1 -0
  30. package/dist/commands/_shared/cost-tier.d.ts +58 -0
  31. package/dist/commands/_shared/edit/_helpers.d.ts +12 -0
  32. package/dist/commands/_shared/edit/caption.d.ts +47 -0
  33. package/dist/commands/_shared/edit/fade.d.ts +38 -0
  34. package/dist/commands/_shared/edit/jump-cut.d.ts +80 -0
  35. package/dist/commands/_shared/edit/noise-reduce.d.ts +33 -0
  36. package/dist/commands/_shared/edit/silence-cut.d.ts +63 -0
  37. package/dist/commands/_shared/edit/text-overlay.d.ts +50 -0
  38. package/dist/commands/_shared/edit/translate-srt.d.ts +40 -0
  39. package/dist/commands/_shared/edit/video-review.d.ts +62 -0
  40. package/dist/commands/_shared/execute-fill-gaps.d.ts +97 -0
  41. package/dist/commands/_shared/hf-skill-bundle/bundle-content.d.ts +16 -0
  42. package/dist/commands/_shared/hf-skill-bundle/bundle.d.ts +57 -0
  43. package/dist/commands/_shared/hf-skill-bundle/bundle.test.d.ts +1 -0
  44. package/dist/commands/_shared/init-templates.d.ts +58 -0
  45. package/dist/commands/_shared/init-templates.test.d.ts +1 -0
  46. package/dist/commands/_shared/install-skill.d.ts +76 -0
  47. package/dist/commands/_shared/install-skill.test.d.ts +1 -0
  48. package/dist/commands/_shared/openai-image.d.ts +49 -0
  49. package/dist/commands/_shared/openai-image.test.d.ts +1 -0
  50. package/dist/commands/_shared/product-surface.d.ts +11 -0
  51. package/dist/commands/_shared/product-surface.test.d.ts +1 -0
  52. package/dist/commands/_shared/project-config.d.ts +60 -0
  53. package/dist/commands/_shared/render-inspect.d.ts +104 -0
  54. package/dist/commands/_shared/render-inspect.test.d.ts +1 -0
  55. package/dist/commands/_shared/review-report.d.ts +65 -0
  56. package/dist/commands/_shared/root-sync.d.ts +39 -0
  57. package/dist/commands/_shared/scene-audio-mux.d.ts +74 -0
  58. package/dist/commands/_shared/scene-audio-mux.test.d.ts +6 -0
  59. package/dist/commands/_shared/scene-audio-scan.d.ts +93 -0
  60. package/dist/commands/_shared/scene-audio-scan.test.d.ts +5 -0
  61. package/dist/commands/_shared/scene-build-mode.d.ts +4 -0
  62. package/dist/commands/_shared/scene-build-mode.test.d.ts +1 -0
  63. package/dist/commands/_shared/scene-build.d.ts +452 -0
  64. package/dist/commands/_shared/scene-build.test.d.ts +1 -0
  65. package/dist/commands/_shared/scene-html-emit.d.ts +139 -0
  66. package/dist/commands/_shared/scene-html-emit.test.d.ts +1 -0
  67. package/dist/commands/_shared/scene-inspect.d.ts +56 -0
  68. package/dist/commands/_shared/scene-inspect.test.d.ts +1 -0
  69. package/dist/commands/_shared/scene-lint.d.ts +109 -0
  70. package/dist/commands/_shared/scene-lint.test.d.ts +1 -0
  71. package/dist/commands/_shared/scene-project.d.ts +147 -0
  72. package/dist/commands/_shared/scene-project.test.d.ts +1 -0
  73. package/dist/commands/_shared/scene-render.d.ts +109 -0
  74. package/dist/commands/_shared/scene-render.test.d.ts +1 -0
  75. package/dist/commands/_shared/scene-repair.d.ts +22 -0
  76. package/dist/commands/_shared/scene-repair.test.d.ts +1 -0
  77. package/dist/commands/_shared/status-jobs.d.ts +197 -0
  78. package/dist/commands/_shared/status-jobs.test.d.ts +1 -0
  79. package/dist/commands/_shared/storyboard-draft.d.ts +13 -0
  80. package/dist/commands/_shared/storyboard-draft.test.d.ts +1 -0
  81. package/dist/commands/_shared/storyboard-edit.d.ts +26 -0
  82. package/dist/commands/_shared/storyboard-edit.test.d.ts +1 -0
  83. package/dist/commands/_shared/storyboard-parse.d.ts +159 -0
  84. package/dist/commands/_shared/storyboard-parse.test.d.ts +1 -0
  85. package/dist/commands/_shared/storyboard-revise.d.ts +32 -0
  86. package/dist/commands/_shared/storyboard-revise.test.d.ts +1 -0
  87. package/dist/commands/_shared/timeline-project.d.ts +32 -0
  88. package/dist/commands/_shared/tts-resolve.d.ts +75 -0
  89. package/dist/commands/_shared/tts-resolve.test.d.ts +5 -0
  90. package/dist/commands/_shared/video-providers.d.ts +44 -0
  91. package/dist/commands/_shared/video-utils.d.ts +71 -0
  92. package/dist/commands/_shared/visual-styles.d.ts +55 -0
  93. package/dist/commands/_shared/visual-styles.test.d.ts +1 -0
  94. package/dist/commands/_shared/walkthroughs/walkthroughs.d.ts +47 -0
  95. package/dist/commands/_shared/walkthroughs/walkthroughs.test.d.ts +1 -0
  96. package/dist/commands/agent.d.ts +24 -0
  97. package/dist/commands/ai-analyze.d.ts +105 -0
  98. package/dist/commands/ai-animated-caption.d.ts +63 -0
  99. package/dist/commands/ai-audio.d.ts +92 -0
  100. package/dist/commands/ai-edit-cli.d.ts +13 -0
  101. package/dist/commands/ai-edit.d.ts +29 -0
  102. package/dist/commands/ai-fill-gaps.d.ts +15 -0
  103. package/dist/commands/ai-helpers.d.ts +26 -0
  104. package/dist/commands/ai-highlights.d.ts +126 -0
  105. package/dist/commands/ai-image.d.ts +71 -0
  106. package/dist/commands/ai-motion.d.ts +53 -0
  107. package/dist/commands/ai-review.d.ts +58 -0
  108. package/dist/commands/ai-script-pipeline-cli.d.ts +10 -0
  109. package/dist/commands/ai-script-pipeline.d.ts +74 -0
  110. package/dist/commands/ai-suggest-edit.d.ts +32 -0
  111. package/dist/commands/ai-video.d.ts +95 -0
  112. package/dist/commands/ai.test.d.ts +1 -0
  113. package/dist/commands/audio.d.ts +17 -0
  114. package/dist/commands/batch.d.ts +2 -0
  115. package/dist/commands/batch.test.d.ts +1 -0
  116. package/dist/commands/build.d.ts +2 -0
  117. package/dist/commands/completion.d.ts +20 -0
  118. package/dist/commands/completion.test.d.ts +1 -0
  119. package/dist/commands/context.d.ts +7 -0
  120. package/dist/commands/context.test.d.ts +1 -0
  121. package/dist/commands/demo.d.ts +6 -0
  122. package/dist/commands/detect.d.ts +55 -0
  123. package/dist/commands/doctor.d.ts +5 -0
  124. package/dist/commands/doctor.test.d.ts +1 -0
  125. package/dist/commands/edit/motion-overlay.d.ts +30 -0
  126. package/dist/commands/edit-cmd.d.ts +112 -0
  127. package/dist/commands/envelope-snapshots.test.d.ts +32 -0
  128. package/dist/commands/export.d.ts +60 -0
  129. package/dist/commands/export.test.d.ts +1 -0
  130. package/dist/commands/generate/background.d.ts +22 -0
  131. package/dist/commands/generate/image.d.ts +8 -0
  132. package/dist/commands/generate/music-status.d.ts +20 -0
  133. package/dist/commands/generate/music.d.ts +27 -0
  134. package/dist/commands/generate/sound-effect.d.ts +19 -0
  135. package/dist/commands/generate/speech.d.ts +21 -0
  136. package/dist/commands/generate/storyboard.d.ts +27 -0
  137. package/dist/commands/generate/thumbnail.d.ts +8 -0
  138. package/dist/commands/generate/video-cancel.d.ts +8 -0
  139. package/dist/commands/generate/video-extend.d.ts +8 -0
  140. package/dist/commands/generate/video-status.d.ts +8 -0
  141. package/dist/commands/generate/video.d.ts +8 -0
  142. package/dist/commands/generate.d.ts +36 -0
  143. package/dist/commands/init.d.ts +24 -0
  144. package/dist/commands/init.test.d.ts +1 -0
  145. package/dist/commands/inspect.d.ts +20 -0
  146. package/dist/commands/media.d.ts +2 -0
  147. package/dist/commands/output.d.ts +80 -0
  148. package/dist/commands/output.test.d.ts +1 -0
  149. package/dist/commands/plan.d.ts +2 -0
  150. package/dist/commands/project.d.ts +2 -0
  151. package/dist/commands/project.test.d.ts +1 -0
  152. package/dist/commands/provider-config-cli.test.d.ts +1 -0
  153. package/dist/commands/q-flag-collision.test.d.ts +1 -0
  154. package/dist/commands/remix.d.ts +20 -0
  155. package/dist/commands/render.d.ts +2 -0
  156. package/dist/commands/run.d.ts +14 -0
  157. package/dist/commands/sanitize.d.ts +20 -0
  158. package/dist/commands/scene.d.ts +92 -0
  159. package/dist/commands/scene.test.d.ts +1 -0
  160. package/dist/commands/schema.d.ts +12 -0
  161. package/dist/commands/setup.d.ts +5 -0
  162. package/dist/commands/setup.test.d.ts +1 -0
  163. package/dist/commands/status.d.ts +2 -0
  164. package/dist/commands/storyboard.d.ts +2 -0
  165. package/dist/commands/timeline.d.ts +2 -0
  166. package/dist/commands/timeline.test.d.ts +1 -0
  167. package/dist/commands/validate.d.ts +33 -0
  168. package/dist/commands/walkthrough.d.ts +21 -0
  169. package/dist/config/config.test.d.ts +1 -0
  170. package/dist/config/index.d.ts +110 -0
  171. package/dist/config/schema.d.ts +64 -0
  172. package/dist/config/scope.test.d.ts +1 -0
  173. package/dist/engine/index.d.ts +2 -0
  174. package/dist/engine/index.js +345 -0
  175. package/dist/engine/project.d.ts +93 -0
  176. package/dist/engine/project.test.d.ts +1 -0
  177. package/dist/index.d.ts +6 -0
  178. package/dist/index.js +483 -291
  179. package/dist/pipeline/executor.d.ts +27 -0
  180. package/dist/pipeline/generate-actions.test.d.ts +1 -0
  181. package/dist/pipeline/index.d.ts +3 -0
  182. package/dist/pipeline/renderers/__tests__/html-template.test.d.ts +1 -0
  183. package/dist/pipeline/renderers/__tests__/integration.test.d.ts +1 -0
  184. package/dist/pipeline/renderers/chrome.d.ts +25 -0
  185. package/dist/pipeline/renderers/html-clips.d.ts +19 -0
  186. package/dist/pipeline/renderers/html-runtime.d.ts +6 -0
  187. package/dist/pipeline/renderers/html-template.d.ts +2 -0
  188. package/dist/pipeline/renderers/hyperframes.d.ts +7 -0
  189. package/dist/pipeline/renderers/project-builder.d.ts +7 -0
  190. package/dist/pipeline/renderers/types.d.ts +39 -0
  191. package/dist/pipeline/resolver.d.ts +19 -0
  192. package/dist/pipeline/scene-actions.test.d.ts +1 -0
  193. package/dist/pipeline/types.d.ts +81 -0
  194. package/dist/tools/adapters/agent.d.ts +9 -0
  195. package/dist/tools/adapters/agent.js +188 -0
  196. package/dist/tools/adapters/mcp.d.ts +34 -0
  197. package/dist/tools/adapters/mcp.js +173 -0
  198. package/dist/tools/define-tool.d.ts +82 -0
  199. package/dist/tools/define-tool.js +214 -0
  200. package/dist/tools/manifest/_project-io.d.ts +13 -0
  201. package/dist/tools/manifest/agent-only.d.ts +236 -0
  202. package/dist/tools/manifest/audio.d.ts +93 -0
  203. package/dist/tools/manifest/detect.d.ts +47 -0
  204. package/dist/tools/manifest/edit.d.ts +398 -0
  205. package/dist/tools/manifest/export.d.ts +27 -0
  206. package/dist/tools/manifest/generate.d.ts +307 -0
  207. package/dist/tools/manifest/index.d.ts +22 -0
  208. package/dist/tools/manifest/index.js +60628 -0
  209. package/dist/tools/manifest/inspect.d.ts +139 -0
  210. package/dist/tools/manifest/project.d.ts +33 -0
  211. package/dist/tools/manifest/remix.d.ts +154 -0
  212. package/dist/tools/manifest/scene.d.ts +221 -0
  213. package/dist/tools/manifest/status.d.ts +36 -0
  214. package/dist/tools/manifest/storyboard.d.ts +136 -0
  215. package/dist/tools/manifest/timeline.d.ts +173 -0
  216. package/dist/tools/manifest/walkthrough.d.ts +22 -0
  217. package/dist/tools/manifest.test.d.ts +13 -0
  218. package/dist/tools/zod-to-json-schema.d.ts +47 -0
  219. package/dist/utils/agent-host-detect.d.ts +61 -0
  220. package/dist/utils/agent-host-detect.test.d.ts +1 -0
  221. package/dist/utils/api-key.d.ts +58 -0
  222. package/dist/utils/api-key.test.d.ts +1 -0
  223. package/dist/utils/audio.d.ts +22 -0
  224. package/dist/utils/clipboard.d.ts +27 -0
  225. package/dist/utils/clipboard.test.d.ts +1 -0
  226. package/dist/utils/exec-safe.d.ts +21 -0
  227. package/dist/utils/first-run.d.ts +16 -0
  228. package/dist/utils/input-validation.d.ts +26 -0
  229. package/dist/utils/key-format.d.ts +15 -0
  230. package/dist/utils/key-live-test.d.ts +29 -0
  231. package/dist/utils/key-live-test.test.d.ts +1 -0
  232. package/dist/utils/open-url.d.ts +26 -0
  233. package/dist/utils/open-url.test.d.ts +1 -0
  234. package/dist/utils/project-resolver.d.ts +30 -0
  235. package/dist/utils/project-resolver.test.d.ts +8 -0
  236. package/dist/utils/provider-resolver.d.ts +32 -0
  237. package/dist/utils/provider-resolver.test.d.ts +13 -0
  238. package/dist/utils/remotion.d.ts +201 -0
  239. package/dist/utils/subtitle.d.ts +64 -0
  240. package/dist/utils/subtitle.test.d.ts +1 -0
  241. package/dist/utils/tty.d.ts +86 -0
  242. package/dist/utils/tty.test.d.ts +1 -0
  243. package/dist/utils/upload-host.d.ts +15 -0
  244. package/dist/utils/upload-host.test.d.ts +1 -0
  245. package/package.json +15 -115
@@ -0,0 +1,27 @@
1
+ /**
2
+ * Pipeline executor — maps YAML actions to CLI execute functions.
3
+ */
4
+ import type { PipelineManifest, PipelineAction, PipelineBudget, PipelineResult } from "./types.js";
5
+ export interface PipelineActionMetadata {
6
+ id: PipelineAction;
7
+ title: string;
8
+ category: "generate" | "edit" | "audio" | "detect" | "analyze" | "scene" | "export";
9
+ command?: string;
10
+ outputs: readonly string[];
11
+ requiredKeys?: readonly string[];
12
+ }
13
+ export declare function getPipelineActionMetadata(action?: PipelineAction): PipelineActionMetadata[] | PipelineActionMetadata | undefined;
14
+ export declare function loadPipeline(filePath: string): Promise<PipelineManifest>;
15
+ export interface ExecutePipelineOptions {
16
+ /** Output directory for all step outputs */
17
+ outputDir?: string;
18
+ /** Only validate and show plan, don't execute */
19
+ dryRun?: boolean;
20
+ /** Resume from checkpoint (skip completed steps) */
21
+ resume?: boolean;
22
+ /** Stop on first failure */
23
+ failFast?: boolean;
24
+ /** Override manifest.budget (partial merge) */
25
+ budget?: PipelineBudget;
26
+ }
27
+ export declare function executePipeline(manifest: PipelineManifest, options?: ExecutePipelineOptions): Promise<PipelineResult>;
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,3 @@
1
+ export { executePipeline, loadPipeline } from "./executor.js";
2
+ export type { PipelineManifest, PipelineAction, StepResult, PipelineResult } from "./types.js";
3
+ export type { ExecutePipelineOptions } from "./executor.js";
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @module pipeline/renderers/chrome
3
+ *
4
+ * Shared Chrome/Chromium discovery + preflight used by every Hyperframes-
5
+ * backed renderer (the FFmpeg-bridge backend in `hyperframes.ts` and the
6
+ * direct scene renderer in `commands/_shared/scene-render.ts`). Centralised
7
+ * so that adding a new candidate path or env var only touches one file.
8
+ */
9
+ /**
10
+ * Walk the candidate list in priority order (env vars first, then puppeteer's
11
+ * cache, then well-known system locations). Returns the first existing path,
12
+ * or undefined when none are present.
13
+ */
14
+ export declare function findChrome(): string | undefined;
15
+ /**
16
+ * Returns `{ok: true}` when Chrome is available, otherwise a structured
17
+ * `{ok: false, reason}` with installation guidance. Used by both the
18
+ * `RenderBackend.preflight` interface and the standalone scene render path.
19
+ */
20
+ export declare function preflightChrome(): Promise<{
21
+ ok: true;
22
+ } | {
23
+ ok: false;
24
+ reason: string;
25
+ }>;
@@ -0,0 +1,19 @@
1
+ import type { TimelineState } from "@vibeframe/core";
2
+ export declare function relAsset(url: string): string;
3
+ export declare function buildClipElements(state: TimelineState): string;
4
+ export interface HfMediaElement {
5
+ elementId: string;
6
+ src: string;
7
+ startTime: number;
8
+ endTime: number;
9
+ mediaOffset: number;
10
+ volume: number;
11
+ hasAudio: boolean;
12
+ }
13
+ export declare function buildMediaDeclarations(state: TimelineState): HfMediaElement[];
14
+ export declare function buildClipRuntimeData(state: TimelineState): {
15
+ id: string;
16
+ startTime: number;
17
+ duration: number;
18
+ effects: import("@vibeframe/core").Effect[];
19
+ }[];
@@ -0,0 +1,6 @@
1
+ /**
2
+ * Browser-side runtime script embedded into the generated HTML.
3
+ * Implements window.__hf.seek(t) and effect application.
4
+ * Kept as a string template so it can be embedded inline without a bundler.
5
+ */
6
+ export declare const RUNTIME_SCRIPT = "\n(function () {\n var CLIPS = /*CLIPS_JSON*/[];\n\n function interpolate(kfs, t) {\n if (!kfs || kfs.length === 0) return null;\n if (kfs.length === 1) return kfs[0].values;\n var prev = kfs[0], next = kfs[kfs.length - 1];\n for (var i = 0; i < kfs.length - 1; i++) {\n if (t >= kfs[i].time && t <= kfs[i + 1].time) { prev = kfs[i]; next = kfs[i + 1]; break; }\n }\n if (t <= prev.time) return prev.values;\n if (t >= next.time) return next.values;\n var raw = (t - prev.time) / (next.time - prev.time);\n var e = prev.easing || 'linear';\n var p = e === 'easeIn' ? raw * raw\n : e === 'easeOut' ? raw * (2 - raw)\n : e === 'easeInOut' ? (raw < 0.5 ? 2 * raw * raw : -1 + (4 - 2 * raw) * raw)\n : raw;\n var out = {};\n for (var k in prev.values) {\n var a = +prev.values[k], b = +next.values[k];\n out[k] = isNaN(a) || isNaN(b) ? prev.values[k] : a + (b - a) * p;\n }\n return out;\n }\n\n function applyEffects(el, effects, clipTime) {\n var opacity = 1;\n var filters = [];\n for (var i = 0; i < effects.length; i++) {\n var fx = effects[i];\n var t = clipTime - fx.startTime;\n if (t < 0 || t > fx.duration) continue;\n var vals = (fx.keyframes && fx.keyframes.length > 0)\n ? interpolate(fx.keyframes, t)\n : fx.params;\n if (!vals) continue;\n switch (fx.type) {\n case 'fadeIn':\n opacity = Math.min(opacity, t / fx.duration * (+(vals.intensity || 1))); break;\n case 'fadeOut':\n opacity = Math.min(opacity, (1 - t / fx.duration) * (+(vals.intensity || 1))); break;\n case 'blur':\n filters.push('blur(' + (+vals.radius || 0) + 'px)'); break;\n case 'brightness':\n filters.push('brightness(' + (+vals.value || 1) + ')'); break;\n case 'contrast':\n filters.push('contrast(' + (+vals.value || 1) + ')'); break;\n case 'saturation':\n filters.push('saturate(' + (+vals.value || 1) + ')'); break;\n }\n }\n el.style.opacity = String(opacity);\n if (filters.length > 0) el.style.filter = filters.join(' ');\n else el.style.filter = '';\n }\n\n window.__hf = {\n duration: /*DURATION*/0,\n media: /*MEDIA_JSON*/[],\n seek: function (t) {\n for (var i = 0; i < CLIPS.length; i++) {\n var c = CLIPS[i];\n var el = document.getElementById(c.id);\n if (!el) continue;\n var active = t >= c.startTime && t < c.startTime + c.duration;\n el.style.display = active ? 'block' : 'none';\n if (active) applyEffects(el, c.effects, t - c.startTime);\n }\n }\n };\n})();\n";
@@ -0,0 +1,2 @@
1
+ import type { TimelineState } from "@vibeframe/core";
2
+ export declare function generateCompositionHtml(state: TimelineState): string;
@@ -0,0 +1,7 @@
1
+ import type { RenderBackend } from "./types.js";
2
+ export declare function createHyperframesBackend(): RenderBackend;
3
+ export declare function aspectToResolution(ratio: string): {
4
+ width: number;
5
+ height: number;
6
+ };
7
+ export declare function qualityToCrf(quality?: "draft" | "standard" | "high"): number;
@@ -0,0 +1,7 @@
1
+ import type { TimelineState } from "@vibeframe/core";
2
+ export interface TempProject {
3
+ dir: string;
4
+ cleanup: () => Promise<void>;
5
+ }
6
+ export declare function buildTempProject(state: TimelineState, projectFileDir?: string): Promise<TempProject>;
7
+ export declare function resolveSourceUrl(url: string, baseDir?: string): string;
@@ -0,0 +1,39 @@
1
+ /**
2
+ * Render backend abstraction for VibeFrame rendering.
3
+ *
4
+ * Backends implement RenderBackend so `vibe render` and YAML render steps can
5
+ * target FFmpeg, Hyperframes, or future renderers through one contract.
6
+ *
7
+ * Renderer details live with each backend implementation.
8
+ */
9
+ import type { TimelineState } from "@vibeframe/core";
10
+ export type BackendName = "ffmpeg" | "hyperframes";
11
+ export interface RenderOptions {
12
+ projectState: TimelineState;
13
+ outputPath: string;
14
+ fps?: 24 | 30 | 60;
15
+ quality?: "draft" | "standard" | "high";
16
+ format?: "mp4" | "webm" | "mov";
17
+ /** Hyperframes capture worker count. Defaults to 1 (sequential) — auto-worker mode times out on small comps. */
18
+ workers?: number;
19
+ onProgress?: (pct: number, stage: string) => void;
20
+ signal?: AbortSignal;
21
+ }
22
+ export interface RenderResult {
23
+ success: boolean;
24
+ outputPath?: string;
25
+ durationMs?: number;
26
+ framesRendered?: number;
27
+ error?: string;
28
+ }
29
+ export interface RenderBackend {
30
+ name: BackendName;
31
+ /** Human-readable check before invocation (e.g. Chrome present, FFmpeg version). */
32
+ preflight?(): Promise<{
33
+ ok: true;
34
+ } | {
35
+ ok: false;
36
+ reason: string;
37
+ }>;
38
+ render(options: RenderOptions): Promise<RenderResult>;
39
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Variable resolver for pipeline steps.
3
+ *
4
+ * Resolves:
5
+ * - $step_id.output → output path from a previous step
6
+ * - $step_id.data.X → arbitrary data from a previous step result
7
+ * - ${ENV_VAR} → environment variable
8
+ */
9
+ import type { StepResult } from "./types.js";
10
+ /**
11
+ * Resolve all variable references in a step's parameters.
12
+ * Returns a new object with all $refs replaced by actual values.
13
+ */
14
+ export declare function resolveStepParams(params: Record<string, unknown>, completedSteps: Map<string, StepResult>): Record<string, unknown>;
15
+ /**
16
+ * Validate that all $refs in a step can be resolved.
17
+ * Returns list of unresolvable references.
18
+ */
19
+ export declare function findUnresolvedRefs(params: Record<string, unknown>, availableStepIds: Set<string>): string[];
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,81 @@
1
+ /**
2
+ * Video as Code — Pipeline type definitions
3
+ *
4
+ * A pipeline is a declarative YAML file that defines a sequence of steps.
5
+ * Each step maps to an existing execute function in the CLI.
6
+ */
7
+ /** Supported pipeline actions (maps to execute functions) */
8
+ export type PipelineAction = "generate-image" | "generate-video" | "generate-tts" | "generate-sfx" | "generate-music" | "generate-storyboard" | "generate-motion" | "edit-silence-cut" | "edit-jump-cut" | "edit-caption" | "edit-noise-reduce" | "edit-fade" | "edit-translate-srt" | "edit-text-overlay" | "edit-motion-overlay" | "edit-grade" | "edit-speed-ramp" | "edit-reframe" | "edit-interpolate" | "edit-upscale" | "edit-image" | "audio-transcribe" | "audio-isolate" | "audio-dub" | "audio-duck" | "detect-scenes" | "detect-silence" | "detect-beats" | "analyze-video" | "analyze-media" | "review-video" | "compose-scenes-with-skills" | "scene-build" | "scene-render" | "export";
9
+ /** A single step in the pipeline */
10
+ export interface PipelineStep {
11
+ /** Unique step identifier (used for variable references) */
12
+ id: string;
13
+ /** Action to execute */
14
+ action: PipelineAction;
15
+ /** Step parameters (action-specific, may contain $refs) */
16
+ [key: string]: unknown;
17
+ }
18
+ /** Effort level passed to LLM providers (maps to Anthropic Opus 4.7 effort) */
19
+ export type EffortLevel = "low" | "medium" | "high" | "xhigh";
20
+ /** Pipeline budget — aborts execution when any ceiling is hit */
21
+ export interface PipelineBudget {
22
+ /** Max estimated USD (uses COST_ESTIMATES.max per action) */
23
+ costUsd?: number;
24
+ /** Max total token budget (tracked when provider returns usage) */
25
+ tokens?: number;
26
+ /** Max number of failed steps before aborting */
27
+ maxToolErrors?: number;
28
+ }
29
+ /** Pipeline manifest (parsed from YAML) */
30
+ export interface PipelineManifest {
31
+ /** Pipeline name */
32
+ name: string;
33
+ /** Optional description */
34
+ description?: string;
35
+ /** Pipeline version */
36
+ version?: number;
37
+ /** Steps to execute */
38
+ steps: PipelineStep[];
39
+ /** Cost / error ceilings enforced by the executor */
40
+ budget?: PipelineBudget;
41
+ /** Default effort level for LLM-backed steps (Opus 4.7 Task Budgets) */
42
+ effort?: EffortLevel;
43
+ }
44
+ /** Result of a single step execution */
45
+ export interface StepResult {
46
+ id: string;
47
+ action: PipelineAction;
48
+ success: boolean;
49
+ /** Primary output path */
50
+ output?: string;
51
+ /** All result data (action-specific) */
52
+ data?: Record<string, unknown>;
53
+ /** Error message if failed */
54
+ error?: string;
55
+ /** Execution time in ms */
56
+ duration?: number;
57
+ }
58
+ /** Running budget usage after execution */
59
+ export interface BudgetUsage {
60
+ /** Upper-bound estimated USD used (sum of max cost per completed step) */
61
+ estimatedCostUsd: number;
62
+ /** Total tokens consumed (when providers report usage) */
63
+ tokensUsed: number;
64
+ /** Failed steps count */
65
+ toolErrors: number;
66
+ /** Set if execution aborted due to a budget ceiling */
67
+ abortedBy?: "costUsd" | "tokens" | "maxToolErrors";
68
+ }
69
+ /** Result of full pipeline execution */
70
+ export interface PipelineResult {
71
+ success: boolean;
72
+ name: string;
73
+ steps: StepResult[];
74
+ completedSteps: number;
75
+ totalSteps: number;
76
+ totalDuration?: number;
77
+ outputDir?: string;
78
+ error?: string;
79
+ /** Budget usage when a budget was configured */
80
+ budget?: BudgetUsage;
81
+ }
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @module adapters/agent
3
+ * @description Adapter from manifest entries to in-process Agent
4
+ * `ToolRegistry`. Consumed by `packages/cli/src/agent/tools/index.ts`.
5
+ */
6
+ import type { ToolDefinition } from "../define-tool.js";
7
+ import type { ToolRegistry } from "../../agent/tools/index.js";
8
+ /** Register every manifest entry tagged `agent` (or surfaces undefined) into a ToolRegistry. */
9
+ export declare function registerManifestIntoAgent(registry: ToolRegistry, manifest: readonly ToolDefinition[]): void;
@@ -0,0 +1,188 @@
1
+ import { createRequire as __vfCreateRequire } from 'node:module';
2
+ const require = __vfCreateRequire(import.meta.url);
3
+
4
+ // src/tools/zod-to-json-schema.ts
5
+ function getDef(z) {
6
+ return z._def;
7
+ }
8
+ function getDescription(z) {
9
+ let current = z;
10
+ while (current) {
11
+ const def = getDef(current);
12
+ if (def.description) return def.description;
13
+ current = def.innerType;
14
+ }
15
+ return void 0;
16
+ }
17
+ function unwrapOptional(z) {
18
+ const def = getDef(z);
19
+ if (def.typeName === "ZodOptional" && def.innerType) {
20
+ return { inner: def.innerType, optional: true };
21
+ }
22
+ return { inner: z, optional: false };
23
+ }
24
+ function unwrapDefault(z) {
25
+ const def = getDef(z);
26
+ if (def.typeName === "ZodDefault" && def.innerType && def.defaultValue) {
27
+ return { inner: def.innerType, defaultValue: def.defaultValue() };
28
+ }
29
+ return { inner: z };
30
+ }
31
+ function convertLeaf(z, description) {
32
+ const { inner: afterDefault, defaultValue } = unwrapDefault(z);
33
+ const def = getDef(afterDefault);
34
+ const desc = description ?? getDescription(z);
35
+ const base = {};
36
+ if (desc) base.description = desc;
37
+ if (defaultValue !== void 0) base.default = defaultValue;
38
+ switch (def.typeName) {
39
+ case "ZodString":
40
+ return { type: "string", ...base };
41
+ case "ZodNumber":
42
+ return { type: "number", ...base };
43
+ case "ZodBoolean":
44
+ return { type: "boolean", ...base };
45
+ case "ZodEnum":
46
+ if (!def.values) throw new Error(`zod-to-json-schema: ZodEnum without values`);
47
+ return { type: "string", enum: def.values, ...base };
48
+ case "ZodLiteral": {
49
+ const value = def.value;
50
+ if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") {
51
+ throw new Error(`zod-to-json-schema: ZodLiteral with unsupported value type`);
52
+ }
53
+ const type = typeof value === "boolean" ? "boolean" : typeof value;
54
+ const out = { type, ...base };
55
+ if (typeof value === "string" || typeof value === "number") out.enum = [value];
56
+ return out;
57
+ }
58
+ case "ZodArray": {
59
+ if (!def.type) throw new Error(`zod-to-json-schema: ZodArray without item type`);
60
+ return { type: "array", items: convertLeaf(def.type), ...base };
61
+ }
62
+ case "ZodRecord": {
63
+ const valueType = def.valueType;
64
+ if (!valueType) {
65
+ return { type: "object", additionalProperties: true, ...base };
66
+ }
67
+ const valueDef = getDef(valueType);
68
+ if (valueDef.typeName === "ZodUnknown" || valueDef.typeName === "ZodAny") {
69
+ return { type: "object", additionalProperties: true, ...base };
70
+ }
71
+ return { type: "object", additionalProperties: convertLeaf(valueType), ...base };
72
+ }
73
+ case "ZodObject":
74
+ return convertObject(afterDefault, desc);
75
+ default:
76
+ throw new Error(
77
+ `zod-to-json-schema: unsupported Zod type "${def.typeName}". Add support in packages/cli/src/tools/zod-to-json-schema.ts or use a supported variant (string, number, boolean, enum, literal, optional, default, array, object).`
78
+ );
79
+ }
80
+ }
81
+ function convertObject(z, description) {
82
+ const def = getDef(z);
83
+ if (def.typeName !== "ZodObject" || !def.shape) {
84
+ throw new Error(`zod-to-json-schema: convertObject called on non-ZodObject (${def.typeName})`);
85
+ }
86
+ const shape = def.shape();
87
+ const properties = {};
88
+ const required = [];
89
+ for (const [key, value] of Object.entries(shape)) {
90
+ const { inner, optional } = unwrapOptional(value);
91
+ const fieldDesc = getDescription(value);
92
+ properties[key] = convertLeaf(inner, fieldDesc);
93
+ if (!optional) required.push(key);
94
+ }
95
+ const out = {
96
+ type: "object",
97
+ properties,
98
+ required
99
+ };
100
+ if (description) out.description = description;
101
+ return out;
102
+ }
103
+ function zodToJsonSchema(schema) {
104
+ const def = getDef(schema);
105
+ if (def.typeName !== "ZodObject") {
106
+ throw new Error(`zodToJsonSchema: top-level schema must be ZodObject; got ${def.typeName}`);
107
+ }
108
+ return convertObject(schema);
109
+ }
110
+ var zodToAgentParameters = zodToJsonSchema;
111
+
112
+ // src/tools/adapters/agent.ts
113
+ function formatZodError(err) {
114
+ return err.issues.map((i) => `${i.path.join(".") || "(root)"}: ${i.message}`).join("; ");
115
+ }
116
+ function toAgentDefinition(t) {
117
+ const json = zodToAgentParameters(t.schema);
118
+ const properties = {};
119
+ for (const [k, v] of Object.entries(json.properties ?? {})) {
120
+ properties[k] = v;
121
+ }
122
+ return {
123
+ name: t.name,
124
+ description: t.description,
125
+ surface: t.productSurface,
126
+ replacement: t.replacement,
127
+ note: t.note,
128
+ // Propagate the manifest's cost tier so the agent's executor can
129
+ // mandate a confirm prompt for high-spend tools without needing a
130
+ // parallel SSOT.
131
+ cost: t.cost,
132
+ parameters: {
133
+ type: "object",
134
+ properties,
135
+ required: json.required ?? []
136
+ }
137
+ };
138
+ }
139
+ function registerManifestIntoAgent(registry, manifest) {
140
+ for (const tool of manifest) {
141
+ if (tool.surfaces && !tool.surfaces.includes("agent")) continue;
142
+ const definition = toAgentDefinition(tool);
143
+ const handler = async (args, context) => {
144
+ const parsed = tool.schema.safeParse(args);
145
+ if (!parsed.success) {
146
+ return {
147
+ toolCallId: "",
148
+ success: false,
149
+ output: "",
150
+ error: formatZodError(parsed.error)
151
+ };
152
+ }
153
+ try {
154
+ const result = await tool.execute(parsed.data, {
155
+ workingDirectory: context.workingDirectory,
156
+ surface: "agent",
157
+ agent: {
158
+ projectPath: context.projectPath,
159
+ setProjectPath(path) {
160
+ context.projectPath = path;
161
+ }
162
+ }
163
+ });
164
+ if (!result.success) {
165
+ return {
166
+ toolCallId: "",
167
+ success: false,
168
+ output: "",
169
+ error: result.error ?? "tool execution failed"
170
+ };
171
+ }
172
+ const output = result.humanLines && result.humanLines.length > 0 ? result.humanLines.join("\n") : result.data ? JSON.stringify(result.data) : "";
173
+ return { toolCallId: "", success: true, output };
174
+ } catch (error) {
175
+ return {
176
+ toolCallId: "",
177
+ success: false,
178
+ output: "",
179
+ error: error instanceof Error ? error.message : String(error)
180
+ };
181
+ }
182
+ };
183
+ registry.register(definition, handler);
184
+ }
185
+ }
186
+ export {
187
+ registerManifestIntoAgent
188
+ };
@@ -0,0 +1,34 @@
1
+ /**
2
+ * @module adapters/mcp
3
+ * @description Adapter from manifest entries to MCP server tool array +
4
+ * dispatcher. Consumed by `packages/mcp-server/src/tools/index.ts`.
5
+ */
6
+ import { type JsonSchema } from "../zod-to-json-schema.js";
7
+ import type { ToolDefinition } from "../define-tool.js";
8
+ /**
9
+ * Top-level MCP tool inputSchema. We always emit `{ type:"object", properties,
10
+ * required }` at the root, so unlike the generic `JsonSchema` (which has
11
+ * optional `properties`/`required` for leaf nodes), the top-level shape's
12
+ * `properties` is required.
13
+ */
14
+ export interface McpInputSchema {
15
+ type: "object";
16
+ properties: Record<string, JsonSchema>;
17
+ required: string[];
18
+ description?: string;
19
+ }
20
+ export interface McpTool {
21
+ name: string;
22
+ description: string;
23
+ inputSchema: McpInputSchema;
24
+ }
25
+ export type McpDispatcher = (name: string, args: Record<string, unknown>) => Promise<{
26
+ content: Array<{
27
+ type: "text";
28
+ text: string;
29
+ }>;
30
+ }>;
31
+ /** Filter manifest by `surfaces.mcp` (default: included) and project to MCP tool shape. */
32
+ export declare function manifestToMcpTools(manifest: readonly ToolDefinition[]): McpTool[];
33
+ /** Build the dispatcher used by `handleToolCall` in the MCP server. */
34
+ export declare function buildMcpDispatcher(manifest: readonly ToolDefinition[]): McpDispatcher;
@@ -0,0 +1,173 @@
1
+ import { createRequire as __vfCreateRequire } from 'node:module';
2
+ const require = __vfCreateRequire(import.meta.url);
3
+
4
+ // src/tools/zod-to-json-schema.ts
5
+ function getDef(z) {
6
+ return z._def;
7
+ }
8
+ function getDescription(z) {
9
+ let current = z;
10
+ while (current) {
11
+ const def = getDef(current);
12
+ if (def.description) return def.description;
13
+ current = def.innerType;
14
+ }
15
+ return void 0;
16
+ }
17
+ function unwrapOptional(z) {
18
+ const def = getDef(z);
19
+ if (def.typeName === "ZodOptional" && def.innerType) {
20
+ return { inner: def.innerType, optional: true };
21
+ }
22
+ return { inner: z, optional: false };
23
+ }
24
+ function unwrapDefault(z) {
25
+ const def = getDef(z);
26
+ if (def.typeName === "ZodDefault" && def.innerType && def.defaultValue) {
27
+ return { inner: def.innerType, defaultValue: def.defaultValue() };
28
+ }
29
+ return { inner: z };
30
+ }
31
+ function convertLeaf(z, description) {
32
+ const { inner: afterDefault, defaultValue } = unwrapDefault(z);
33
+ const def = getDef(afterDefault);
34
+ const desc = description ?? getDescription(z);
35
+ const base = {};
36
+ if (desc) base.description = desc;
37
+ if (defaultValue !== void 0) base.default = defaultValue;
38
+ switch (def.typeName) {
39
+ case "ZodString":
40
+ return { type: "string", ...base };
41
+ case "ZodNumber":
42
+ return { type: "number", ...base };
43
+ case "ZodBoolean":
44
+ return { type: "boolean", ...base };
45
+ case "ZodEnum":
46
+ if (!def.values) throw new Error(`zod-to-json-schema: ZodEnum without values`);
47
+ return { type: "string", enum: def.values, ...base };
48
+ case "ZodLiteral": {
49
+ const value = def.value;
50
+ if (typeof value !== "string" && typeof value !== "number" && typeof value !== "boolean") {
51
+ throw new Error(`zod-to-json-schema: ZodLiteral with unsupported value type`);
52
+ }
53
+ const type = typeof value === "boolean" ? "boolean" : typeof value;
54
+ const out = { type, ...base };
55
+ if (typeof value === "string" || typeof value === "number") out.enum = [value];
56
+ return out;
57
+ }
58
+ case "ZodArray": {
59
+ if (!def.type) throw new Error(`zod-to-json-schema: ZodArray without item type`);
60
+ return { type: "array", items: convertLeaf(def.type), ...base };
61
+ }
62
+ case "ZodRecord": {
63
+ const valueType = def.valueType;
64
+ if (!valueType) {
65
+ return { type: "object", additionalProperties: true, ...base };
66
+ }
67
+ const valueDef = getDef(valueType);
68
+ if (valueDef.typeName === "ZodUnknown" || valueDef.typeName === "ZodAny") {
69
+ return { type: "object", additionalProperties: true, ...base };
70
+ }
71
+ return { type: "object", additionalProperties: convertLeaf(valueType), ...base };
72
+ }
73
+ case "ZodObject":
74
+ return convertObject(afterDefault, desc);
75
+ default:
76
+ throw new Error(
77
+ `zod-to-json-schema: unsupported Zod type "${def.typeName}". Add support in packages/cli/src/tools/zod-to-json-schema.ts or use a supported variant (string, number, boolean, enum, literal, optional, default, array, object).`
78
+ );
79
+ }
80
+ }
81
+ function convertObject(z, description) {
82
+ const def = getDef(z);
83
+ if (def.typeName !== "ZodObject" || !def.shape) {
84
+ throw new Error(`zod-to-json-schema: convertObject called on non-ZodObject (${def.typeName})`);
85
+ }
86
+ const shape = def.shape();
87
+ const properties = {};
88
+ const required = [];
89
+ for (const [key, value] of Object.entries(shape)) {
90
+ const { inner, optional } = unwrapOptional(value);
91
+ const fieldDesc = getDescription(value);
92
+ properties[key] = convertLeaf(inner, fieldDesc);
93
+ if (!optional) required.push(key);
94
+ }
95
+ const out = {
96
+ type: "object",
97
+ properties,
98
+ required
99
+ };
100
+ if (description) out.description = description;
101
+ return out;
102
+ }
103
+ function zodToJsonSchema(schema) {
104
+ const def = getDef(schema);
105
+ if (def.typeName !== "ZodObject") {
106
+ throw new Error(`zodToJsonSchema: top-level schema must be ZodObject; got ${def.typeName}`);
107
+ }
108
+ return convertObject(schema);
109
+ }
110
+
111
+ // src/tools/adapters/mcp.ts
112
+ function formatZodError(err) {
113
+ const missing = err.issues.filter((i) => {
114
+ if (i.code !== "invalid_type") return false;
115
+ const received = i.received;
116
+ return received === "undefined" || received === "null";
117
+ }).map((i) => i.path.join(".")).filter(Boolean);
118
+ if (missing.length > 0) {
119
+ const plural = missing.length > 1 ? "s" : "";
120
+ return `missing required argument${plural}: ${missing.join(", ")}`;
121
+ }
122
+ return err.issues.map((i) => `${i.path.join(".") || "(root)"}: ${i.message}`).join("; ");
123
+ }
124
+ function manifestToMcpTools(manifest) {
125
+ return manifest.filter((t) => !t.surfaces || t.surfaces.includes("mcp")).map((t) => {
126
+ const inputSchema = zodToJsonSchema(t.schema);
127
+ return {
128
+ name: t.name,
129
+ description: t.description,
130
+ inputSchema: {
131
+ type: "object",
132
+ properties: inputSchema.properties ?? {},
133
+ required: inputSchema.required ?? [],
134
+ ...inputSchema.description ? { description: inputSchema.description } : {}
135
+ }
136
+ };
137
+ });
138
+ }
139
+ function buildMcpDispatcher(manifest) {
140
+ const byName = /* @__PURE__ */ new Map();
141
+ for (const t of manifest) {
142
+ if (!t.surfaces || t.surfaces.includes("mcp")) {
143
+ byName.set(t.name, t);
144
+ }
145
+ }
146
+ return async (name, args) => {
147
+ const tool = byName.get(name);
148
+ if (!tool) {
149
+ return { content: [{ type: "text", text: `Unknown tool: ${name}` }] };
150
+ }
151
+ const parsed = tool.schema.safeParse(args);
152
+ if (!parsed.success) {
153
+ return {
154
+ content: [{ type: "text", text: `${name} failed: ${formatZodError(parsed.error)}` }]
155
+ };
156
+ }
157
+ try {
158
+ const result = await tool.execute(parsed.data, {
159
+ workingDirectory: process.cwd(),
160
+ surface: "mcp"
161
+ });
162
+ const text = result.success ? JSON.stringify({ success: true, ...result.data }) : `${name} failed: ${result.error ?? "unknown error"}`;
163
+ return { content: [{ type: "text", text }] };
164
+ } catch (error) {
165
+ const msg = error instanceof Error ? error.message : String(error);
166
+ return { content: [{ type: "text", text: `${name} threw: ${msg}` }] };
167
+ }
168
+ };
169
+ }
170
+ export {
171
+ buildMcpDispatcher,
172
+ manifestToMcpTools
173
+ };