@vibeframe/cli 0.115.7 → 0.115.9
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/dist/commands/_shared/lottie.d.ts +40 -0
- package/dist/commands/_shared/scene-html-emit.d.ts +8 -9
- package/dist/commands/_shared/scene-inspect.d.ts +0 -1
- package/dist/commands/_shared/scene-render.d.ts +3 -9
- package/dist/commands/ai-analyze.d.ts +1 -3
- package/dist/commands/ai-helpers.d.ts +0 -8
- package/dist/commands/ai-image.d.ts +0 -6
- package/dist/commands/edit/lottie-overlay.d.ts +65 -0
- package/dist/commands/edit/lottie-overlay.integration.test.d.ts +1 -0
- package/dist/commands/edit/lottie-overlay.test.d.ts +1 -0
- package/dist/commands/edit/motion-overlay.d.ts +6 -1
- package/dist/commands/generate.d.ts +0 -2
- package/dist/commands/output.d.ts +0 -3
- package/dist/commands/sanitize.d.ts +0 -5
- package/dist/commands/validate.d.ts +0 -11
- package/dist/config/index.d.ts +0 -9
- package/dist/index.js +1544 -1921
- package/dist/pipeline/executor.d.ts +0 -1
- package/dist/pipeline/renderers/chrome.d.ts +3 -4
- package/dist/tools/manifest/index.js +1262 -1637
- package/dist/utils/audio.d.ts +0 -10
- package/dist/utils/input-validation.d.ts +0 -5
- package/dist/utils/remotion.d.ts +0 -14
- package/dist/utils/tty.d.ts +0 -8
- package/package.json +4 -6
- package/dist/pipeline/renderers/html-clips.d.ts +0 -19
- package/dist/pipeline/renderers/html-runtime.d.ts +0 -6
- package/dist/pipeline/renderers/html-template.d.ts +0 -2
- package/dist/pipeline/renderers/hyperframes.d.ts +0 -7
- package/dist/pipeline/renderers/project-builder.d.ts +0 -7
- package/dist/pipeline/renderers/types.d.ts +0 -39
- /package/dist/{pipeline/renderers/__tests__/html-template.test.d.ts → commands/_shared/lottie.test.d.ts} +0 -0
- /package/dist/{pipeline/renderers/__tests__/integration.test.d.ts → commands/_shared/scene-lottie.integration.test.d.ts} +0 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module _shared/lottie
|
|
3
|
+
*
|
|
4
|
+
* Pieces shared by the two places VibeFrame draws a Lottie animation in a
|
|
5
|
+
* Hyperframes page: `vibe edit motion-overlay --asset` (a standalone layer
|
|
6
|
+
* page) and `vibe scene add --lottie` (a canvas inside a scene).
|
|
7
|
+
*
|
|
8
|
+
* Both drive a dotLottie player frame by frame from the render's seek
|
|
9
|
+
* instead of letting it autoplay, so every captured frame is the frame for
|
|
10
|
+
* that time. Both load the runtime from files copied next to the page, not
|
|
11
|
+
* from a CDN, so a render works offline and never depends on the network.
|
|
12
|
+
*/
|
|
13
|
+
export type LottiePosition = "full" | "center" | "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
14
|
+
export declare const LOTTIE_POSITIONS: readonly LottiePosition[];
|
|
15
|
+
/** Reject files dotLottie cannot open before spending a browser render on them. */
|
|
16
|
+
export declare function checkLottieAsset(path: string): Promise<string | undefined>;
|
|
17
|
+
/** CSS box for the overlay canvas, in pixels of the layer. */
|
|
18
|
+
export declare function overlayBox(layer: {
|
|
19
|
+
width: number;
|
|
20
|
+
height: number;
|
|
21
|
+
}, position: LottiePosition, scale: number): {
|
|
22
|
+
left: number;
|
|
23
|
+
top: number;
|
|
24
|
+
width: number;
|
|
25
|
+
height: number;
|
|
26
|
+
};
|
|
27
|
+
/** File names of the dotLottie runtime inside the vendor directory. */
|
|
28
|
+
export declare const DOTLOTTIE_SCRIPT = "dotlottie-web.js";
|
|
29
|
+
export declare const DOTLOTTIE_WASM = "dotlottie-player.wasm";
|
|
30
|
+
/** Copy the dotLottie runtime (ESM build plus its WASM) into `dir`. */
|
|
31
|
+
export declare function copyDotLottieRuntime(dir: string): Promise<void>;
|
|
32
|
+
/**
|
|
33
|
+
* Browser-side JavaScript: `loadDotLottie(vendorDir)` imports the runtime
|
|
34
|
+
* from a directory relative to the page and points it at the WASM, and
|
|
35
|
+
* `setLottieTime(player, t, loop)` shows the frame for `t` seconds.
|
|
36
|
+
* The render server sends .wasm without application/wasm, which makes
|
|
37
|
+
* WebAssembly.instantiateStreaming reject it, so the WASM goes through a
|
|
38
|
+
* typed Blob URL.
|
|
39
|
+
*/
|
|
40
|
+
export declare const DOTLOTTIE_BROWSER_HELPERS = "async function loadDotLottie(vendorDir) {\n const url = (file) => new URL(vendorDir + \"/\" + file, document.baseURI).href;\n const { DotLottie } = await import(url(\"dotlottie-web.js\"));\n const wasm = await (await fetch(url(\"dotlottie-player.wasm\"))).arrayBuffer();\n DotLottie.setWasmUrl(URL.createObjectURL(new Blob([wasm], { type: \"application/wasm\" })));\n return DotLottie;\n }\n function setLottieTime(player, t, loop) {\n const length = player.duration;\n const frames = player.totalFrames;\n if (!(length > 0) || !(frames > 0)) return;\n const local = Math.max(0, Number(t) || 0);\n const at = loop ? local % length : Math.min(local, length);\n player.setFrame(Math.min(frames - 1, (at / length) * frames));\n }";
|
|
@@ -15,6 +15,7 @@
|
|
|
15
15
|
* Pure functions only — no I/O. The orchestrating command (`scene add`) wires
|
|
16
16
|
* these to the filesystem.
|
|
17
17
|
*/
|
|
18
|
+
import { LOTTIE_POSITIONS, type LottiePosition } from "./lottie.js";
|
|
18
19
|
export type ScenePreset = "simple" | "announcement" | "explainer" | "kinetic-type" | "product-shot";
|
|
19
20
|
export declare const SCENE_PRESETS: readonly ScenePreset[];
|
|
20
21
|
/**
|
|
@@ -27,12 +28,9 @@ export interface SceneTranscriptWord {
|
|
|
27
28
|
start: number;
|
|
28
29
|
end: number;
|
|
29
30
|
}
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
*/
|
|
34
|
-
export type LottiePosition = "full" | "center" | "top-left" | "top-right" | "bottom-left" | "bottom-right";
|
|
35
|
-
export declare const LOTTIE_POSITIONS: readonly LottiePosition[];
|
|
31
|
+
export { LOTTIE_POSITIONS, type LottiePosition };
|
|
32
|
+
/** Project-relative directory `vibe scene add --lottie` copies the dotLottie runtime into. */
|
|
33
|
+
export declare const LOTTIE_RUNTIME_DIR = "assets/vendor/dotlottie";
|
|
36
34
|
export interface LottieOverlayInput {
|
|
37
35
|
/** Project-relative path to the `.json` or `.lottie` file (e.g. "assets/logo.lottie"). */
|
|
38
36
|
src: string;
|
|
@@ -74,9 +72,10 @@ export interface EmitSceneInput {
|
|
|
74
72
|
*/
|
|
75
73
|
transcript?: SceneTranscriptWord[];
|
|
76
74
|
/**
|
|
77
|
-
* Optional Lottie animation overlay
|
|
78
|
-
*
|
|
79
|
-
*
|
|
75
|
+
* Optional Lottie animation overlay, drawn on a canvas above the preset's
|
|
76
|
+
* content. Uses the same position/scale/opacity vocabulary as
|
|
77
|
+
* `vibe edit motion-overlay`. Needs the dotLottie runtime in
|
|
78
|
+
* {@link LOTTIE_RUNTIME_DIR}.
|
|
80
79
|
*/
|
|
81
80
|
lottie?: LottieOverlayInput;
|
|
82
81
|
}
|
|
@@ -2,11 +2,8 @@
|
|
|
2
2
|
* @module _shared/scene-render
|
|
3
3
|
*
|
|
4
4
|
* Render a VibeFrame scene project to MP4/WebM/MOV using the Hyperframes
|
|
5
|
-
* producer directly.
|
|
6
|
-
*
|
|
7
|
-
* into a temp Hyperframes project, scene projects already ARE Hyperframes
|
|
8
|
-
* projects — so we hand the producer the user's project dir and entry file
|
|
9
|
-
* verbatim.
|
|
5
|
+
* producer directly. Scene projects already ARE Hyperframes projects, so
|
|
6
|
+
* we hand the producer the user's project dir and entry file verbatim.
|
|
10
7
|
*
|
|
11
8
|
* `executeSceneRender()` is decoupled from CLI flags so that the C6 agent
|
|
12
9
|
* tool and the C5 `--format scenes` pipeline can call it the same way. It
|
|
@@ -126,10 +123,7 @@ export declare function buildRenderConfig(opts: {
|
|
|
126
123
|
};
|
|
127
124
|
export declare function buildMediaOpenCommand(action: RenderOpenAction, filePath: string, platform?: NodeJS.Platform): MediaOpenCommand;
|
|
128
125
|
/**
|
|
129
|
-
* Render a scene project
|
|
130
|
-
* backend (preflight → execute → structured result), but skips the
|
|
131
|
-
* `TimelineState` → temp project conversion because the user's project is
|
|
132
|
-
* already a valid Hyperframes project.
|
|
126
|
+
* Render a scene project: preflight → execute → structured result.
|
|
133
127
|
*/
|
|
134
128
|
export declare function executeSceneRender(opts?: SceneRenderOptions): Promise<SceneRenderResult>;
|
|
135
129
|
export interface BeatRenderRootResult {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Media analysis execute functions using Gemini multimodal AI.
|
|
5
5
|
*
|
|
6
|
-
*
|
|
6
|
+
* Powers `vibe inspect media` and the matching agent/MCP tools.
|
|
7
7
|
*
|
|
8
8
|
* Execute functions:
|
|
9
9
|
* executeGeminiVideo - Analyze video files or YouTube URLs with Gemini
|
|
@@ -11,7 +11,6 @@
|
|
|
11
11
|
*
|
|
12
12
|
* @dependencies Gemini (Google)
|
|
13
13
|
*/
|
|
14
|
-
import { Command } from "commander";
|
|
15
14
|
/** Options for {@link executeGeminiVideo}. */
|
|
16
15
|
export interface GeminiVideoOptions {
|
|
17
16
|
/** Video file path or YouTube URL */
|
|
@@ -102,4 +101,3 @@ export interface AnalyzeResult {
|
|
|
102
101
|
* @returns Result with Gemini's response, detected source type, and token usage
|
|
103
102
|
*/
|
|
104
103
|
export declare function executeAnalyze(options: AnalyzeOptions): Promise<AnalyzeResult>;
|
|
105
|
-
export declare function registerAnalyzeCommands(aiCommand: Command): void;
|
|
@@ -12,14 +12,6 @@ import { Project } from "../engine/index.js";
|
|
|
12
12
|
* `SuggestEditEntry`, which omits the optional `id`/`previewUrl`.
|
|
13
13
|
*/
|
|
14
14
|
export type ApplicableSuggestion = Pick<EditSuggestion, "type" | "clipIds" | "params">;
|
|
15
|
-
/**
|
|
16
|
-
* Download a video from URL, handling Veo/Google API authentication.
|
|
17
|
-
* Uses x-goog-api-key header (not query param) for Google API URLs.
|
|
18
|
-
*
|
|
19
|
-
* @param url - Video URL to download
|
|
20
|
-
* @param apiKey - Google API key (caller should resolve from env/config)
|
|
21
|
-
*/
|
|
22
|
-
export declare function downloadVideo(url: string, apiKey?: string): Promise<Buffer>;
|
|
23
15
|
/** Format a duration in seconds to m:ss.s display format */
|
|
24
16
|
export declare function formatTime(seconds: number): string;
|
|
25
17
|
/** Apply a single AI edit suggestion to a project */
|
|
@@ -66,12 +66,6 @@ export interface ImageEditResult {
|
|
|
66
66
|
errorKind?: ProviderErrorKind;
|
|
67
67
|
}
|
|
68
68
|
export declare function executeImageEdit(options: ImageEditOptions): Promise<ImageEditResult>;
|
|
69
|
-
/** @deprecated Use `executeImageEdit`; kept for callers that predate other edit providers. */
|
|
70
|
-
export type GeminiEditOptions = Omit<ImageEditOptions, "provider">;
|
|
71
|
-
/** @deprecated Use `executeImageEdit`. */
|
|
72
|
-
export type GeminiEditResult = ImageEditResult;
|
|
73
|
-
/** @deprecated Use `executeImageEdit`. */
|
|
74
|
-
export declare function executeGeminiEdit(options: GeminiEditOptions): Promise<ImageEditResult>;
|
|
75
69
|
export interface ThumbnailBestFrameOptions {
|
|
76
70
|
videoPath: string;
|
|
77
71
|
outputPath: string;
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module edit/lottie-overlay
|
|
3
|
+
*
|
|
4
|
+
* `vibe edit motion-overlay <video> --asset <file.lottie|file.json>`.
|
|
5
|
+
*
|
|
6
|
+
* Two passes, so the source video is never re-rendered through a browser:
|
|
7
|
+
*
|
|
8
|
+
* 1. Hyperframes renders only the Lottie layer, at the source's display
|
|
9
|
+
* size, to ProRes 4444 with alpha. The page drives a dotLottie player
|
|
10
|
+
* frame by frame from `window.__hf.seek`, so every frame is
|
|
11
|
+
* deterministic and nothing depends on wall-clock playback.
|
|
12
|
+
* 2. FFmpeg overlays that layer onto the original video at `start`,
|
|
13
|
+
* keeping the source resolution, frame rate, and audio.
|
|
14
|
+
*/
|
|
15
|
+
import { type LottiePosition } from "../_shared/lottie.js";
|
|
16
|
+
export type { LottiePosition };
|
|
17
|
+
export interface LottieOverlayOptions {
|
|
18
|
+
videoPath: string;
|
|
19
|
+
assetPath: string;
|
|
20
|
+
outputPath: string;
|
|
21
|
+
/** Seconds into the video where the overlay appears. */
|
|
22
|
+
start: number;
|
|
23
|
+
/** Seconds the overlay stays on screen. */
|
|
24
|
+
duration: number;
|
|
25
|
+
position: LottiePosition;
|
|
26
|
+
/** Fraction of the frame the overlay box spans (ignored for `full`). */
|
|
27
|
+
scale: number;
|
|
28
|
+
opacity: number;
|
|
29
|
+
loop: boolean;
|
|
30
|
+
}
|
|
31
|
+
export interface LottieOverlayResult {
|
|
32
|
+
success: boolean;
|
|
33
|
+
outputPath?: string;
|
|
34
|
+
error?: string;
|
|
35
|
+
/** How to fix a failure that retrying will not fix. */
|
|
36
|
+
suggestion?: string;
|
|
37
|
+
}
|
|
38
|
+
export interface VideoStreamInfo {
|
|
39
|
+
/** Display size, after any rotation metadata is applied. */
|
|
40
|
+
width: number;
|
|
41
|
+
height: number;
|
|
42
|
+
fps: number;
|
|
43
|
+
duration: number;
|
|
44
|
+
}
|
|
45
|
+
/** Probe the first video stream. Width/height are swapped for 90/270 degree rotations, as FFmpeg autorotates on decode. */
|
|
46
|
+
export declare function probeVideoStream(path: string): Promise<VideoStreamInfo>;
|
|
47
|
+
/**
|
|
48
|
+
* The layer page. `window.__hf` is published only after the animation has
|
|
49
|
+
* loaded, because the producer starts capturing once `__hf.duration > 0`.
|
|
50
|
+
*/
|
|
51
|
+
export declare function lottieLayerHtml(opts: {
|
|
52
|
+
width: number;
|
|
53
|
+
height: number;
|
|
54
|
+
duration: number;
|
|
55
|
+
assetUrl: string;
|
|
56
|
+
box: {
|
|
57
|
+
left: number;
|
|
58
|
+
top: number;
|
|
59
|
+
width: number;
|
|
60
|
+
height: number;
|
|
61
|
+
};
|
|
62
|
+
opacity: number;
|
|
63
|
+
loop: boolean;
|
|
64
|
+
}): string;
|
|
65
|
+
export declare function renderLottieOverlay(options: LottieOverlayOptions): Promise<LottieOverlayResult>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
2
|
import { type MotionCommandOptions } from "../ai-motion.js";
|
|
3
|
+
import { type LottiePosition } from "./lottie-overlay.js";
|
|
3
4
|
export type MotionOverlayUnderstand = "auto" | "off" | "required";
|
|
4
|
-
export type MotionOverlayPosition =
|
|
5
|
+
export type MotionOverlayPosition = LottiePosition;
|
|
5
6
|
export interface MotionOverlayOptions {
|
|
6
7
|
videoPath: string;
|
|
7
8
|
description?: string;
|
|
@@ -25,6 +26,10 @@ export interface MotionOverlayResult {
|
|
|
25
26
|
renderedPath?: string;
|
|
26
27
|
provider?: "remotion" | "lottie";
|
|
27
28
|
error?: string;
|
|
29
|
+
/** How to fix a failure that a retry will not fix. */
|
|
30
|
+
suggestion?: string;
|
|
31
|
+
/** False for deterministic local failures (bad asset, missing Chrome/FFmpeg). */
|
|
32
|
+
retryable?: boolean;
|
|
28
33
|
}
|
|
29
34
|
export declare function executeMotionOverlay(options: MotionOverlayOptions): Promise<MotionOverlayResult>;
|
|
30
35
|
export declare function registerMotionOverlayCommand(parent: Command): void;
|
|
@@ -18,8 +18,6 @@
|
|
|
18
18
|
import { Command } from "commander";
|
|
19
19
|
export { executeSoundEffect } from "./generate/sound-effect.js";
|
|
20
20
|
export type { ExecuteSoundEffectOptions, ExecuteSoundEffectResult, } from "./generate/sound-effect.js";
|
|
21
|
-
export { executeMusicStatus } from "./generate/music-status.js";
|
|
22
|
-
export type { ExecuteMusicStatusOptions, ExecuteMusicStatusResult, } from "./generate/music-status.js";
|
|
23
21
|
export { executeStoryboard } from "./generate/storyboard.js";
|
|
24
22
|
export type { ExecuteStoryboardOptions, ExecuteStoryboardResult } from "./generate/storyboard.js";
|
|
25
23
|
export { executeSpeech } from "./generate/speech.js";
|
|
@@ -40,7 +40,6 @@ export declare function apiError(msg: string, retryable?: boolean): StructuredEr
|
|
|
40
40
|
*/
|
|
41
41
|
export declare function providerFailure(message: string, kind?: string): StructuredError;
|
|
42
42
|
export declare function notFoundError(path: string): StructuredError;
|
|
43
|
-
export declare function networkError(msg: string): StructuredError;
|
|
44
43
|
export declare function generalError(msg: string, suggestion?: string): StructuredError;
|
|
45
44
|
/**
|
|
46
45
|
* The `--max-cost` refusal. A command that declines to spend is a failure, so
|
|
@@ -114,8 +113,6 @@ export declare function outputResult(result: Record<string, unknown>): void;
|
|
|
114
113
|
export declare function log(...args: unknown[]): void;
|
|
115
114
|
/** Create a spinner that is silent in JSON/quiet mode */
|
|
116
115
|
export declare function spinner(text: string): ReturnType<typeof ora>;
|
|
117
|
-
/** Suggest next steps - only in human interactive mode */
|
|
118
|
-
export declare function suggestNext(tip: string): void;
|
|
119
116
|
export declare function emitDeprecationWarning(oldName: string, newName: string, removeIn: string): void;
|
|
120
117
|
/** Test-only: reset deduplication memory between cases. */
|
|
121
118
|
export declare function _resetDeprecationMemoryForTesting(): void;
|
|
@@ -8,11 +8,6 @@
|
|
|
8
8
|
* fake system prompts, and markdown-disguised commands.
|
|
9
9
|
*/
|
|
10
10
|
export declare function sanitizeLLMResponse(text: string): string;
|
|
11
|
-
/**
|
|
12
|
-
* Sanitize a file path returned by an AI model.
|
|
13
|
-
* Prevents path traversal and null byte injection.
|
|
14
|
-
*/
|
|
15
|
-
export declare function sanitizeFilePath(path: string): string;
|
|
16
11
|
/**
|
|
17
12
|
* Sanitize structured data from AI responses (e.g., JSON parsed results).
|
|
18
13
|
* Recursively sanitizes all string values.
|
|
@@ -20,14 +20,3 @@ export declare function validateResourceId(id: string): string;
|
|
|
20
20
|
* Prevents terminal injection and other control-char exploits.
|
|
21
21
|
*/
|
|
22
22
|
export declare function rejectControlChars(input: string): string;
|
|
23
|
-
/**
|
|
24
|
-
* Validate a media file path and check its extension against an allowlist.
|
|
25
|
-
*/
|
|
26
|
-
export declare function validateMediaFile(path: string, allowedExts: string[]): string;
|
|
27
|
-
/** Common media file extensions */
|
|
28
|
-
export declare const MEDIA_EXTS: {
|
|
29
|
-
video: string[];
|
|
30
|
-
audio: string[];
|
|
31
|
-
image: string[];
|
|
32
|
-
subtitle: string[];
|
|
33
|
-
};
|
package/dist/config/index.d.ts
CHANGED
|
@@ -21,10 +21,6 @@ export type Scope = "user" | "project";
|
|
|
21
21
|
export declare const USER_CONFIG_DIR: string;
|
|
22
22
|
/** User-scope config file (~/.vibeframe/config.yaml by default). */
|
|
23
23
|
export declare const USER_CONFIG_PATH: string;
|
|
24
|
-
/** User data directory (~/.local/share/vibeframe by default). */
|
|
25
|
-
export declare const USER_DATA_DIR: string;
|
|
26
|
-
/** User cache directory (~/.vibeframe/cache by default). */
|
|
27
|
-
export declare const USER_CACHE_DIR: string;
|
|
28
24
|
/** Legacy user-scope config directory used by pre-XDG installs. */
|
|
29
25
|
export declare const LEGACY_USER_CONFIG_DIR: string;
|
|
30
26
|
/** Legacy user-scope config file used by pre-XDG installs. */
|
|
@@ -101,10 +97,5 @@ export declare function isConfigured(options?: Pick<LoadConfigOptions, "cwd">):
|
|
|
101
97
|
* the provider's environment variable if neither config has it.
|
|
102
98
|
*/
|
|
103
99
|
export declare function getApiKeyFromConfig(providerKey: string, options?: Pick<LoadConfigOptions, "cwd">): Promise<string | undefined>;
|
|
104
|
-
/**
|
|
105
|
-
* Update a provider key in the active scope (project if present, else user).
|
|
106
|
-
* Pass `{scope}` to force a specific destination.
|
|
107
|
-
*/
|
|
108
|
-
export declare function updateProviderKey(providerKey: string, apiKey: string, options?: SaveConfigOptions): Promise<void>;
|
|
109
100
|
export type { VibeConfig, LLMProvider } from "./schema.js";
|
|
110
101
|
export { createDefaultConfig, PROVIDER_NAMES, PROVIDER_ENV_ALIASES, PROVIDER_ENV_VARS, } from "./schema.js";
|