@vibeframe/cli 0.105.1 → 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 +234 -258
  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,93 @@
1
+ /**
2
+ * @module _shared/scene-audio-scan
3
+ *
4
+ * Reads a scene project's root + sub-composition HTML and returns a flat list
5
+ * of audio elements with **absolute** timeline positions. Used by `executeSceneRender`
6
+ * to mux narration / background-audio tracks into the producer's silent video
7
+ * output via ffmpeg.
8
+ *
9
+ * Why a post-render scanner: at time of writing, `@hyperframes/producer`
10
+ * renders frames + assembles the MP4 but does not embed audio from
11
+ * `<audio>` elements that live inside sub-compositions. We pick up the slack
12
+ * here without touching the producer.
13
+ *
14
+ * Pure module — no I/O beyond the explicit `loadCompositionHtml` reader the
15
+ * orchestrator passes in. Easy to unit-test with fixture strings.
16
+ */
17
+ /**
18
+ * One `<audio>` element resolved into an absolute-timeline entry.
19
+ */
20
+ export interface SceneAudioElement {
21
+ /** Project-relative `src` from the audio tag (e.g. `assets/narration-intro.wav`). */
22
+ srcRel: string;
23
+ /** Absolute path on disk — `resolve(projectDir, srcRel)`. */
24
+ srcAbs: string;
25
+ /** Seconds from the start of the root timeline at which playback begins. */
26
+ absoluteStart: number;
27
+ /**
28
+ * Composition-supplied duration. `"auto"` means "use the file's natural
29
+ * duration"; the mux pass probes the file. Numeric means a hard cap.
30
+ */
31
+ durationHint: "auto" | number;
32
+ /** Cap from the parent scene clip — audio is trimmed to fit this many seconds. */
33
+ clipDurationCap: number;
34
+ /** `data-volume`. Defaults to `1`. */
35
+ volume: number;
36
+ /** `data-track-index` — used so callers can group narration vs music vs etc. */
37
+ trackIndex: number;
38
+ /** Composition that owns this audio element (debug aid). */
39
+ compositionSrc: string;
40
+ }
41
+ /**
42
+ * Parsed view of a single `<div class="clip" data-composition-src="...">`
43
+ * reference inside the root composition.
44
+ */
45
+ export interface SceneClipRef {
46
+ compositionId: string;
47
+ compositionSrc: string;
48
+ start: number;
49
+ duration: number;
50
+ trackIndex: number;
51
+ }
52
+ /**
53
+ * Walk the root HTML for clip references. Returns one entry per
54
+ * `<div class="clip">` with the four attributes we care about. Pure: a
55
+ * regex-based scan, not a full DOM parser. The root file is generated by
56
+ * VibeFrame so the markup is predictable; if a user hand-edits it into
57
+ * something unparseable, the scanner simply finds fewer clips.
58
+ */
59
+ export declare function parseRootClips(rootHtml: string): SceneClipRef[];
60
+ /**
61
+ * Walk a single composition's HTML for `<audio>` elements. Returns one entry
62
+ * per element with attributes resolved into our shape. Composition-local —
63
+ * caller adds the parent clip's start to compute absolute timing.
64
+ */
65
+ export declare function parseSceneAudios(compositionHtml: string): Array<{
66
+ srcRel: string;
67
+ localStart: number;
68
+ durationHint: "auto" | number;
69
+ volume: number;
70
+ trackIndex: number;
71
+ }>;
72
+ /** Reader hook so the scanner stays unit-testable without touching the FS. */
73
+ export type CompositionReader = (compositionSrcRel: string) => Promise<string | null>;
74
+ /**
75
+ * Default reader: read the composition file from disk relative to the
76
+ * project directory. Returns `null` for missing files so the scanner can
77
+ * skip them and continue.
78
+ */
79
+ export declare function makeFsCompositionReader(projectDir: string): CompositionReader;
80
+ /**
81
+ * Top-level scan. Parses every clip in the root, loads each composition,
82
+ * pulls every audio element, and resolves absolute timeline positions.
83
+ *
84
+ * Audio absolute start = clip.start + audio.localStart. The `clipDurationCap`
85
+ * is filled in from the clip's own duration so the mux pass can trim audio
86
+ * that runs past the visual end of its parent scene.
87
+ */
88
+ export declare function scanSceneAudio(opts: {
89
+ projectDir: string;
90
+ rootHtml: string;
91
+ /** Override the default FS reader (testing). */
92
+ readComposition?: CompositionReader;
93
+ }): Promise<SceneAudioElement[]>;
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Unit tests for scene-audio-scan. Pure parsing — no fs touches via the
3
+ * injected `readComposition` reader.
4
+ */
5
+ export {};
@@ -0,0 +1,4 @@
1
+ export type SceneBuildMode = "agent" | "batch" | "auto";
2
+ export declare function resolveSceneBuildMode(opts: {
3
+ mode?: SceneBuildMode;
4
+ }): "agent" | "batch";
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,452 @@
1
+ /**
2
+ * @module _shared/scene-build
3
+ *
4
+ * v0.60 one-shot driver: read STORYBOARD.md (with frontmatter + per-beat
5
+ * cues from C2), dispatch the AI primitives the cues call for, run
6
+ * `compose-scenes-with-skills`, then optionally render to MP4.
7
+ *
8
+ * The intent is to make the storyboard the single source of truth — `vibe
9
+ * scene build` walks it and produces an MP4. Per-beat cues drive TTS +
10
+ * image generation; project frontmatter sets defaults. CLI flags override.
11
+ *
12
+ * Idempotent: assets that already exist on disk are reused unless `force`.
13
+ *
14
+ * Scope held tight for v0.60:
15
+ * - TTS via `resolveTtsProvider` (ElevenLabs / Kokoro auto-fallback)
16
+ * - T2I via OpenAI, Gemini, or Grok
17
+ * - No Whisper transcribe step (compose handles its own)
18
+ * - No root `index.html` synthesis — driver expects the project to
19
+ * already have one with sub-composition references.
20
+ */
21
+ import { type ImageOptions } from "@vibeframe/ai-providers";
22
+ import { type ComposeEffort, type ComposeProgressEvent, type ComposeScenesActionResult } from "./compose-scenes-skills.js";
23
+ import type { ComposerProvider } from "./composer-resolve.js";
24
+ import { type ComposePromptsBeat } from "./compose-prompts.js";
25
+ import { type SceneRenderResult } from "./scene-render.js";
26
+ import { type BuildPlanResult, type BuildStage } from "./build-plan.js";
27
+ import { type AssetFreshness } from "./build-asset-metadata.js";
28
+ import { type JobRecord } from "./status-jobs.js";
29
+ import { type SceneRepairResult } from "./scene-repair.js";
30
+ import { type TtsProviderName } from "./tts-resolve.js";
31
+ import { type SceneBuildMode } from "./scene-build-mode.js";
32
+ export { resolveSceneBuildMode, type SceneBuildMode } from "./scene-build-mode.js";
33
+ export type BuildImageProvider = "openai" | "gemini" | "grok";
34
+ export type SceneBuildProgressEvent = {
35
+ type: "phase-start";
36
+ phase: "primitives" | "compose" | "render";
37
+ } | {
38
+ type: "narration-cached";
39
+ beatId: string;
40
+ path: string;
41
+ } | {
42
+ type: "narration-generated";
43
+ beatId: string;
44
+ path: string;
45
+ provider: string;
46
+ } | {
47
+ type: "narration-failed";
48
+ beatId: string;
49
+ error: string;
50
+ } | {
51
+ type: "narration-skipped";
52
+ beatId: string;
53
+ reason: string;
54
+ } | {
55
+ type: "backdrop-cached";
56
+ beatId: string;
57
+ path: string;
58
+ } | {
59
+ type: "backdrop-generated";
60
+ beatId: string;
61
+ path: string;
62
+ provider: string;
63
+ } | {
64
+ type: "backdrop-failed";
65
+ beatId: string;
66
+ error: string;
67
+ } | {
68
+ type: "backdrop-skipped";
69
+ beatId: string;
70
+ reason: string;
71
+ } | {
72
+ type: "video-cached";
73
+ beatId: string;
74
+ path: string;
75
+ } | {
76
+ type: "video-generated";
77
+ beatId: string;
78
+ path: string;
79
+ provider: string;
80
+ } | {
81
+ type: "video-pending";
82
+ beatId: string;
83
+ jobId: string;
84
+ provider: string;
85
+ } | {
86
+ type: "video-failed";
87
+ beatId: string;
88
+ error: string;
89
+ } | {
90
+ type: "video-skipped";
91
+ beatId: string;
92
+ reason: string;
93
+ } | {
94
+ type: "music-cached";
95
+ beatId: string;
96
+ path: string;
97
+ } | {
98
+ type: "music-generated";
99
+ beatId: string;
100
+ path: string;
101
+ provider: string;
102
+ } | {
103
+ type: "music-pending";
104
+ beatId: string;
105
+ jobId: string;
106
+ provider: string;
107
+ } | {
108
+ type: "music-failed";
109
+ beatId: string;
110
+ error: string;
111
+ } | {
112
+ type: "music-skipped";
113
+ beatId: string;
114
+ reason: string;
115
+ } | ComposeProgressEvent | {
116
+ type: "render-start";
117
+ } | {
118
+ type: "render-done";
119
+ outputPath: string;
120
+ };
121
+ export type PrimitiveStatus = "generated" | "cached" | "referenced" | "pending" | "skipped" | "failed" | "no-cue";
122
+ export interface BeatBuildOutcome {
123
+ beatId: string;
124
+ narrationStatus: PrimitiveStatus;
125
+ narrationPath?: string;
126
+ narrationError?: string;
127
+ narrationDurationSec?: number;
128
+ sceneDurationSec?: number;
129
+ narrationText?: string;
130
+ narrationVoice?: string;
131
+ narrationProvider?: string;
132
+ narrationCachePath?: string;
133
+ narrationCacheKey?: string;
134
+ narrationMetadataPath?: string;
135
+ narrationFreshness?: AssetFreshness;
136
+ narrationSourcePath?: string;
137
+ backdropStatus: PrimitiveStatus;
138
+ backdropPath?: string;
139
+ backdropError?: string;
140
+ backdropPrompt?: string;
141
+ backdropProvider?: string;
142
+ backdropCachePath?: string;
143
+ backdropCacheKey?: string;
144
+ backdropMetadataPath?: string;
145
+ backdropFreshness?: AssetFreshness;
146
+ backdropSourcePath?: string;
147
+ videoStatus: PrimitiveStatus;
148
+ videoPath?: string;
149
+ videoJobId?: string;
150
+ videoError?: string;
151
+ videoPrompt?: string;
152
+ videoProvider?: string;
153
+ videoCachePath?: string;
154
+ videoCacheKey?: string;
155
+ videoMetadataPath?: string;
156
+ videoFreshness?: AssetFreshness;
157
+ videoSourcePath?: string;
158
+ musicStatus: PrimitiveStatus;
159
+ musicPath?: string;
160
+ musicJobId?: string;
161
+ musicError?: string;
162
+ musicPrompt?: string;
163
+ musicProvider?: string;
164
+ musicCachePath?: string;
165
+ musicCacheKey?: string;
166
+ musicMetadataPath?: string;
167
+ musicFreshness?: AssetFreshness;
168
+ musicSourcePath?: string;
169
+ musicDurationSec?: number;
170
+ }
171
+ export type BuildVideoProvider = "seedance" | "grok" | "kling" | "runway" | "veo";
172
+ export type BuildMusicProvider = "elevenlabs" | "replicate";
173
+ /**
174
+ * Build mode dispatch (Phase H3 / Plan H).
175
+ *
176
+ * - `agent` — host agent (Claude Code, Cursor, Codex, Aider …) is the
177
+ * sole reasoner. The CLI runs primitives + render, but skips its own
178
+ * LLM compose call. If any `compositions/scene-<id>.html` is missing,
179
+ * `vibe scene build` returns a structured "needs author" plan from
180
+ * `getComposePrompts()` and exits successfully — the host agent is
181
+ * expected to fill the missing files and re-invoke. Otherwise lint +
182
+ * render proceed.
183
+ * - `batch` — current internal-LLM path (PR #176, multi-provider). The
184
+ * CLI calls Claude / OpenAI / Gemini directly to produce HTML. Right
185
+ * choice for CI, headless automation, and "no agent host" contexts.
186
+ * - `auto` (default) — pick `agent` when (a) `VIBE_BUILD_MODE=agent`
187
+ * forces it, OR (b) any agent host is detected via
188
+ * `detectedAgentHosts()`. Falls back to `batch`.
189
+ */
190
+ export interface SceneBuildOptions {
191
+ /** Project directory containing STORYBOARD.md, DESIGN.md, index.html. */
192
+ projectDir: string;
193
+ /**
194
+ * Build mode dispatch. See {@link SceneBuildMode}. Default: `auto`.
195
+ */
196
+ mode?: SceneBuildMode;
197
+ /** Compose effort tier — passed through to `compose-scenes-with-skills`. */
198
+ effort?: ComposeEffort;
199
+ /**
200
+ * Composer LLM provider. Defaults to whatever `resolveComposer()` picks
201
+ * based on env keys (claude > gemini > openai). Pass an explicit value
202
+ * to require that provider's key.
203
+ */
204
+ composer?: ComposerProvider;
205
+ skipNarration?: boolean;
206
+ skipBackdrop?: boolean;
207
+ skipRender?: boolean;
208
+ /** Override frontmatter providers.tts. Defaults to "auto". */
209
+ ttsProvider?: TtsProviderName;
210
+ /** Voice override (TTS-provider-specific id). */
211
+ voice?: string;
212
+ /** Override frontmatter providers.image. */
213
+ imageProvider?: BuildImageProvider;
214
+ /** Video provider for per-beat `video` cues. */
215
+ videoProvider?: BuildVideoProvider;
216
+ /** Music provider for per-beat `music` cues. */
217
+ musicProvider?: BuildMusicProvider;
218
+ /** Skip AI video generation even when beats declare video cues. */
219
+ skipVideo?: boolean;
220
+ /** Skip music generation even when beats declare music cues. */
221
+ skipMusic?: boolean;
222
+ /** OpenAI image quality — see `vibe generate image --quality`. */
223
+ imageQuality?: "standard" | "hd";
224
+ /** OpenAI image size. Default 1536x1024 for cinematic 16:9-ish framing. */
225
+ imageSize?: ImageOptions["size"];
226
+ /** Force re-dispatch even when the asset already exists. */
227
+ force?: boolean;
228
+ /** Stage to run. `all` preserves the historical full build behavior. */
229
+ stage?: BuildStage;
230
+ /** Restrict asset/compose work to one beat id where supported. */
231
+ beatId?: string;
232
+ /** Hard USD cap checked before provider spend. */
233
+ maxCostUsd?: number;
234
+ /** Compose-scenes cache override (tests). */
235
+ cacheDir?: string;
236
+ /** Progress callback. */
237
+ onProgress?: (e: SceneBuildProgressEvent) => void;
238
+ }
239
+ /**
240
+ * Resulting state after dispatch. `phase` makes the agent contract
241
+ * explicit:
242
+ * - `done` — render succeeded, MP4 at {@link outputPath}.
243
+ * - `compose-only` — `--skip-render` was set; compositions written.
244
+ * - `needs-author` — agent mode and one or more `compositions/*.html`
245
+ * missing. {@link composePrompts} carries the plan the host agent
246
+ * needs to author. Re-invoke `vibe scene build` after writing.
247
+ * - `failed` — primitives, compose, or render errored. {@link error}
248
+ * carries the message; {@link beats} reflects partial state.
249
+ */
250
+ export type SceneBuildPhase = "done" | "assets-only" | "pending-jobs" | "compose-only" | "sync-only" | "render-only" | "needs-author" | "failed";
251
+ export type BuildWorkflowStatus = "done" | "running" | "needs-author" | "failed" | "ready";
252
+ export type BuildCurrentStage = "assets" | "compose" | "sync" | "render" | "done";
253
+ export interface BuildBeatSummary {
254
+ total: number;
255
+ assetsReady: number;
256
+ compositionsReady: number;
257
+ needsAuthor: string[];
258
+ }
259
+ export interface StageReport {
260
+ status: "pending" | "skipped" | "done" | "failed" | "needs-author" | "pending-jobs";
261
+ costUsd: number;
262
+ warnings: string[];
263
+ retryWith: string[];
264
+ }
265
+ export type BuildSceneRepairStage = "compose" | "sync";
266
+ export interface BuildSceneRepairSummary {
267
+ ran: boolean;
268
+ stage: BuildSceneRepairStage | null;
269
+ status: "skipped" | SceneRepairResult["status"];
270
+ score: number | null;
271
+ fixed: SceneRepairResult["fixed"];
272
+ remainingIssues: SceneRepairResult["remainingIssues"];
273
+ retryWith: string[];
274
+ }
275
+ export interface SceneBuildResult {
276
+ success: boolean;
277
+ /** Final phase reached — see {@link SceneBuildPhase}. */
278
+ phase: SceneBuildPhase;
279
+ /** Mode the dispatcher actually ran (after auto-resolve). */
280
+ mode: "agent" | "batch";
281
+ code?: string;
282
+ error?: string;
283
+ message?: string;
284
+ suggestion?: string;
285
+ recoverable?: boolean;
286
+ validation?: BuildPlanResult["validation"];
287
+ providerResolution?: BuildPlanResult["providerResolution"];
288
+ beats: BeatBuildOutcome[];
289
+ /** MP4 path when `skipRender` is false and render succeeded. */
290
+ outputPath?: string;
291
+ composeData?: ComposeScenesActionResult["data"];
292
+ renderResult?: SceneRenderResult;
293
+ /**
294
+ * Populated only in agent mode when {@link phase} === `"needs-author"`.
295
+ * The host agent should consume this to write each beat's HTML, then
296
+ * re-run `vibe scene build`.
297
+ */
298
+ composePrompts?: {
299
+ skillReference: string | null;
300
+ designReference: string;
301
+ storyboardReference: string;
302
+ compositionsDir: string;
303
+ instructions: string[];
304
+ beats: ComposePromptsBeat[];
305
+ bundleVersion: string;
306
+ warnings: string[];
307
+ };
308
+ selectedStage?: BuildStage;
309
+ status?: BuildWorkflowStatus;
310
+ currentStage?: BuildCurrentStage;
311
+ beatSummary?: BuildBeatSummary;
312
+ estimatedCostUsd?: number;
313
+ costUsd?: number;
314
+ stageReports?: Record<"assets" | "compose" | "sync" | "render", StageReport>;
315
+ sceneRepair?: BuildSceneRepairSummary;
316
+ jobs?: JobRecord[];
317
+ warnings?: string[];
318
+ retryWith?: string[];
319
+ reportPath?: string;
320
+ /** Wall-clock total. */
321
+ totalLatencyMs: number;
322
+ }
323
+ export declare function executeSceneBuild(opts: SceneBuildOptions): Promise<SceneBuildResult>;
324
+ export type BuildReport = ReturnType<typeof toBuildReport>;
325
+ declare function toBuildReport(projectDir: string, result: SceneBuildResult): {
326
+ schemaVersion: string;
327
+ kind: string;
328
+ project: string;
329
+ phase: SceneBuildPhase;
330
+ status: BuildWorkflowStatus;
331
+ currentStage: BuildCurrentStage;
332
+ mode: "agent" | "batch";
333
+ selectedStage: BuildStage;
334
+ success: boolean;
335
+ code: string | undefined;
336
+ error: string | undefined;
337
+ message: string | undefined;
338
+ suggestion: string | undefined;
339
+ recoverable: boolean | undefined;
340
+ validation: {
341
+ ok: boolean;
342
+ issues: import("./storyboard-edit.js").StoryboardValidationIssue[];
343
+ } | undefined;
344
+ providerResolution: import("./build-plan.js").ProviderResolution[];
345
+ estimatedCostUsd: number;
346
+ costUsd: number;
347
+ beats: {
348
+ id: string;
349
+ startSec: number;
350
+ endSec: number;
351
+ sceneDurationSec: number;
352
+ narration: {
353
+ text: string | undefined;
354
+ voice: string | undefined;
355
+ provider: string | undefined;
356
+ path: string | undefined;
357
+ sourcePath: string | undefined;
358
+ durationSec: number | undefined;
359
+ sceneDurationSec: number;
360
+ status: PrimitiveStatus;
361
+ error: string | undefined;
362
+ cachePath: string | undefined;
363
+ cacheKey: string | undefined;
364
+ metadataPath: string | undefined;
365
+ freshness: AssetFreshness | undefined;
366
+ };
367
+ backdrop: {
368
+ prompt: string | undefined;
369
+ provider: string | undefined;
370
+ path: string | undefined;
371
+ sourcePath: string | undefined;
372
+ status: PrimitiveStatus;
373
+ error: string | undefined;
374
+ cachePath: string | undefined;
375
+ cacheKey: string | undefined;
376
+ metadataPath: string | undefined;
377
+ freshness: AssetFreshness | undefined;
378
+ };
379
+ video: {
380
+ prompt: string | undefined;
381
+ provider: string | undefined;
382
+ path: string | undefined;
383
+ sourcePath: string | undefined;
384
+ status: PrimitiveStatus;
385
+ jobId: string | undefined;
386
+ error: string | undefined;
387
+ cachePath: string | undefined;
388
+ cacheKey: string | undefined;
389
+ metadataPath: string | undefined;
390
+ freshness: AssetFreshness | undefined;
391
+ };
392
+ music: {
393
+ prompt: string | undefined;
394
+ provider: string | undefined;
395
+ path: string | undefined;
396
+ sourcePath: string | undefined;
397
+ durationSec: number | undefined;
398
+ status: PrimitiveStatus;
399
+ jobId: string | undefined;
400
+ error: string | undefined;
401
+ cachePath: string | undefined;
402
+ cacheKey: string | undefined;
403
+ metadataPath: string | undefined;
404
+ freshness: AssetFreshness | undefined;
405
+ };
406
+ composition: {
407
+ path: string;
408
+ exists: boolean;
409
+ status: BuildReportCompositionStatus;
410
+ cacheKey?: string;
411
+ };
412
+ narrationPath: string | undefined;
413
+ narrationDurationSec: number | undefined;
414
+ backdropPath: string | undefined;
415
+ videoPath: string | undefined;
416
+ musicPath: string | undefined;
417
+ compositionPath: string;
418
+ narrationStatus: PrimitiveStatus;
419
+ backdropStatus: PrimitiveStatus;
420
+ videoStatus: PrimitiveStatus;
421
+ videoJobId: string | undefined;
422
+ musicStatus: PrimitiveStatus;
423
+ musicJobId: string | undefined;
424
+ narrationError: string | undefined;
425
+ backdropError: string | undefined;
426
+ videoError: string | undefined;
427
+ musicError: string | undefined;
428
+ }[];
429
+ beatSummary: BuildBeatSummary;
430
+ jobs: {
431
+ id: string;
432
+ jobType: import("./status-jobs.js").JobType;
433
+ status: import("./status-jobs.js").JobStatus;
434
+ provider: string;
435
+ providerTaskId: string;
436
+ providerTaskType: "text2video" | "image2video" | undefined;
437
+ beatId: string | undefined;
438
+ outputPath: string | undefined;
439
+ cachePath: string | undefined;
440
+ cacheKey: string | undefined;
441
+ canonicalPath: string | undefined;
442
+ metadataPath: string | undefined;
443
+ retryWith: string[];
444
+ }[];
445
+ outputPath: string | undefined;
446
+ sceneRepair: BuildSceneRepairSummary;
447
+ stageReports: Record<"assets" | "compose" | "sync" | "render", StageReport> | undefined;
448
+ warnings: string[];
449
+ retryWith: string[];
450
+ totalLatencyMs: number;
451
+ };
452
+ type BuildReportCompositionStatus = "generated" | "cached" | "exists" | "needs-author" | "skipped" | "failed";
@@ -0,0 +1 @@
1
+ export {};