@vibeframe/cli 0.115.8 → 0.115.10
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/image-cost.d.ts +3 -3
- package/dist/commands/_shared/lottie.d.ts +40 -0
- package/dist/commands/_shared/lottie.test.d.ts +1 -0
- package/dist/commands/_shared/scene-html-emit.d.ts +8 -9
- package/dist/commands/_shared/scene-lottie.integration.test.d.ts +1 -0
- package/dist/commands/_shared/storyboard-draft.d.ts +14 -0
- package/dist/commands/_shared/storyboard-revise.d.ts +8 -3
- package/dist/commands/edit/lottie-overlay.d.ts +2 -13
- package/dist/index.js +43888 -43582
- package/dist/tools/manifest/index.js +7707 -8325
- package/package.json +3 -3
|
@@ -3,13 +3,13 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Without these, real runs reported `costUsd: 0`, which reads as "free" to
|
|
5
5
|
* agents that gate spend on the JSON envelope. Values are upper bounds from
|
|
6
|
-
* provider list prices (checked 2026-10-
|
|
6
|
+
* provider list prices (checked 2026-10-17, see
|
|
7
7
|
* `.agents/references/providers/`), not metered billing:
|
|
8
8
|
* - OpenAI: high quality at 1024x1024 (we default to medium).
|
|
9
|
-
* - Gemini: 1K
|
|
9
|
+
* - Gemini: the requested size's price (1K when none is asked for).
|
|
10
10
|
* - Grok: grok-imagine-image-2.0 at its 2K medium price.
|
|
11
11
|
*/
|
|
12
|
-
export declare function estimateImageCostUsd(provider: string, model: string | undefined, count: number): {
|
|
12
|
+
export declare function estimateImageCostUsd(provider: string, model: string | undefined, count: number, resolution?: string): {
|
|
13
13
|
costUsd: number;
|
|
14
14
|
warnings: string[];
|
|
15
15
|
};
|
|
@@ -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 }";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -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
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,3 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @module _shared/storyboard-draft
|
|
3
|
+
*
|
|
4
|
+
* The offline storyboard skeleton `vibe init --from "<brief>"` writes.
|
|
5
|
+
*
|
|
6
|
+
* Without a model this cannot know what the video says, so it does not
|
|
7
|
+
* pretend to: beats come from the brief's own outline when it has one
|
|
8
|
+
* ("hook, buoyancy, folding tip"), each beat gets a backdrop prompt from
|
|
9
|
+
* its topic and the brief, and narration is left for the composer
|
|
10
|
+
* (`storyboard revise`), the host agent, or the user to write. A skeleton
|
|
11
|
+
* that renders silently is better than one that narrates someone else's
|
|
12
|
+
* script. When a composer key is set, `init` hands this skeleton to the
|
|
13
|
+
* composer, which writes the real draft.
|
|
14
|
+
*/
|
|
1
15
|
import type { VisualStyle } from "./visual-styles.js";
|
|
2
16
|
export interface StoryboardDraft {
|
|
3
17
|
storyboardMd: string;
|
|
@@ -1,14 +1,19 @@
|
|
|
1
|
-
import type
|
|
1
|
+
import { type TextGenerator } from "@vibeframe/ai-providers";
|
|
2
2
|
import { type ComposerProvider } from "./composer-resolve.js";
|
|
3
3
|
import { type StoryboardValidationResult } from "./storyboard-edit.js";
|
|
4
|
-
export type StoryboardRevisionChat = (messages: AgentMessage[]) => Promise<string>;
|
|
5
4
|
export interface StoryboardRevisionOptions {
|
|
6
5
|
projectDir: string;
|
|
7
6
|
request: string;
|
|
8
7
|
durationSec?: number;
|
|
9
8
|
composer?: ComposerProvider;
|
|
10
9
|
dryRun?: boolean;
|
|
11
|
-
|
|
10
|
+
/**
|
|
11
|
+
* "draft" writes a storyboard for `request` (a brief) on top of the
|
|
12
|
+
* skeleton `vibe init --from` scaffolds, instead of editing an authored one.
|
|
13
|
+
*/
|
|
14
|
+
mode?: "revise" | "draft";
|
|
15
|
+
/** Overrides the composer's text generator (tests). */
|
|
16
|
+
generator?: TextGenerator;
|
|
12
17
|
}
|
|
13
18
|
export interface StoryboardRevisionResult {
|
|
14
19
|
schemaVersion: "1";
|
|
@@ -12,7 +12,8 @@
|
|
|
12
12
|
* 2. FFmpeg overlays that layer onto the original video at `start`,
|
|
13
13
|
* keeping the source resolution, frame rate, and audio.
|
|
14
14
|
*/
|
|
15
|
-
|
|
15
|
+
import { type LottiePosition } from "../_shared/lottie.js";
|
|
16
|
+
export type { LottiePosition };
|
|
16
17
|
export interface LottieOverlayOptions {
|
|
17
18
|
videoPath: string;
|
|
18
19
|
assetPath: string;
|
|
@@ -43,18 +44,6 @@ export interface VideoStreamInfo {
|
|
|
43
44
|
}
|
|
44
45
|
/** Probe the first video stream. Width/height are swapped for 90/270 degree rotations, as FFmpeg autorotates on decode. */
|
|
45
46
|
export declare function probeVideoStream(path: string): Promise<VideoStreamInfo>;
|
|
46
|
-
/** Reject files dotLottie cannot open before spending a browser render on them. */
|
|
47
|
-
export declare function checkLottieAsset(path: string): Promise<string | undefined>;
|
|
48
|
-
/** CSS box for the overlay canvas, in pixels of the layer. */
|
|
49
|
-
export declare function overlayBox(layer: {
|
|
50
|
-
width: number;
|
|
51
|
-
height: number;
|
|
52
|
-
}, position: LottiePosition, scale: number): {
|
|
53
|
-
left: number;
|
|
54
|
-
top: number;
|
|
55
|
-
width: number;
|
|
56
|
-
height: number;
|
|
57
|
-
};
|
|
58
47
|
/**
|
|
59
48
|
* The layer page. `window.__hf` is published only after the animation has
|
|
60
49
|
* loaded, because the producer starts capturing once `__hf.duration > 0`.
|