@vibeframe/cli 0.115.5 → 0.115.7
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/edit/jump-cut.d.ts +2 -2
- package/dist/commands/_shared/image-jobs.d.ts +21 -0
- package/dist/commands/_shared/openai-image.d.ts +3 -36
- package/dist/commands/_shared/status-jobs.d.ts +5 -0
- package/dist/commands/_shared/transcription.d.ts +16 -0
- package/dist/commands/_shared/translate-texts.d.ts +30 -0
- package/dist/commands/_shared/translate-texts.test.d.ts +1 -0
- package/dist/commands/_shared/tts-resolve.d.ts +7 -1
- package/dist/commands/_shared/video-jobs.d.ts +34 -0
- package/dist/commands/ai-audio.d.ts +24 -0
- package/dist/commands/ai-image.d.ts +25 -7
- package/dist/commands/ai-video.d.ts +37 -11
- package/dist/commands/ai-video.network.test.d.ts +1 -0
- package/dist/commands/generate/image.d.ts +4 -3
- package/dist/commands/generate/music.d.ts +5 -0
- package/dist/commands/generate/sound-effect.d.ts +7 -1
- package/dist/commands/generate/speech.d.ts +12 -3
- package/dist/commands/generate/video-cancel.d.ts +2 -3
- package/dist/commands/generate/video-extend.d.ts +3 -3
- package/dist/commands/generate/video.d.ts +4 -3
- package/dist/commands/output.d.ts +7 -0
- package/dist/index.js +26907 -28497
- package/dist/testing/fake-provider-network.d.ts +7 -38
- package/dist/tools/manifest/audio.d.ts +4 -1
- package/dist/tools/manifest/edit.d.ts +18 -15
- package/dist/tools/manifest/generate.d.ts +43 -31
- package/dist/tools/manifest/index.js +27129 -28518
- package/dist/tools/manifest/inspect.d.ts +4 -4
- package/dist/tools/manifest/remix.d.ts +4 -4
- package/dist/tools/manifest/scene.d.ts +8 -8
- package/dist/tools/manifest/timeline.d.ts +2 -2
- package/dist/utils/audio-file.d.ts +7 -0
- package/dist/utils/upload-host.d.ts +11 -0
- package/package.json +3 -3
- package/dist/commands/_shared/video-providers.d.ts +0 -44
- package/dist/commands/_shared/video-utils.d.ts +0 -73
|
@@ -52,8 +52,8 @@ export interface JumpCutResult {
|
|
|
52
52
|
/** Default set of filler words detected by jump-cut. */
|
|
53
53
|
export declare const DEFAULT_FILLER_WORDS: string[];
|
|
54
54
|
/**
|
|
55
|
-
* Transcribe audio with word-level timestamps
|
|
56
|
-
*
|
|
55
|
+
* Transcribe audio with word-level timestamps (Whisper through the
|
|
56
|
+
* transcription contract) for filler detection. Throws on failure.
|
|
57
57
|
*/
|
|
58
58
|
export declare function transcribeWithWords(audioPath: string, apiKey: string, language?: string): Promise<{
|
|
59
59
|
words: {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The CLI side of the image contract: open an image provider by name with
|
|
3
|
+
* the user's key, read input images, and save results. Image commands,
|
|
4
|
+
* tools, scenes, and builds go through here instead of branching on
|
|
5
|
+
* provider names.
|
|
6
|
+
*/
|
|
7
|
+
import { type ImageGenerator, type ImageInput } from "@vibeframe/ai-providers";
|
|
8
|
+
/** Env var holding each image provider's key. */
|
|
9
|
+
export declare const IMAGE_PROVIDER_ENV: Readonly<Record<string, string>>;
|
|
10
|
+
/** Display names for spinners and messages. */
|
|
11
|
+
export declare const IMAGE_PROVIDER_LABELS: Readonly<Record<string, string>>;
|
|
12
|
+
/** An image generator for `provider`, with the given key or the configured one. */
|
|
13
|
+
export declare function openImageGenerator(provider: string, apiKey?: string): Promise<ImageGenerator>;
|
|
14
|
+
/** A local image file as contract input. */
|
|
15
|
+
export declare function readImageInput(path: string): Promise<ImageInput>;
|
|
16
|
+
/** Save image bytes to `output` (relative to cwd), converting to the extension's format. */
|
|
17
|
+
export declare function saveImage(output: string, bytes: Uint8Array): Promise<string>;
|
|
18
|
+
/** The catalog label for a model ID, for human output. */
|
|
19
|
+
export declare function imageModelLabel(provider: string, modelId: string): string;
|
|
20
|
+
/** CLI quality words to the contract's: `standard`/`hd` are the old OpenAI names. */
|
|
21
|
+
export declare function contractQuality(quality?: string): "low" | "medium" | "high" | undefined;
|
|
@@ -1,36 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module _shared/openai-image
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
* provider initialisation + model-alias parsing + result construction.
|
|
7
|
-
* v0.52.0 added gpt-image-2 wiring to `ai-image.ts` only and
|
|
8
|
-
* `vibe generate image -m 2` silently fell back to gpt-image-1.5 — the
|
|
9
|
-
* duplication guarantees a recurrence next time the OpenAI image flow
|
|
10
|
-
* is touched.
|
|
11
|
-
*
|
|
12
|
-
* Each top-level command keeps its own CLI wiring and output formatting;
|
|
13
|
-
* this helper owns just the API call + label derivation.
|
|
14
|
-
*
|
|
15
|
-
* See issue #58.
|
|
4
|
+
* OpenAI image model alias resolution, used by image cost estimates.
|
|
5
|
+
* Generation itself goes through the image contract (`executeImageGenerate`).
|
|
16
6
|
*/
|
|
17
|
-
import type { GPTImageModel
|
|
18
|
-
/** Subset of CLI options consumed by the helper. */
|
|
19
|
-
export interface OpenAIImageHelperOptions {
|
|
20
|
-
model?: string;
|
|
21
|
-
size?: string;
|
|
22
|
-
quality?: string;
|
|
23
|
-
style?: string;
|
|
24
|
-
/** Stringified count from commander; parsed inside the helper. */
|
|
25
|
-
count?: string;
|
|
26
|
-
}
|
|
27
|
-
export interface OpenAIImageHelperResult {
|
|
28
|
-
result: ImageResult;
|
|
29
|
-
/** Resolved model id passed to the API. */
|
|
30
|
-
openaiModel: GPTImageModel;
|
|
31
|
-
/** Human-friendly label for spinner / success output. */
|
|
32
|
-
modelLabel: string;
|
|
33
|
-
}
|
|
7
|
+
import type { GPTImageModel } from "@vibeframe/ai-providers";
|
|
34
8
|
/**
|
|
35
9
|
* Resolve the user-supplied model alias to the API id + display label, from
|
|
36
10
|
* the model catalog. Unknown or empty aliases resolve to the default model.
|
|
@@ -41,10 +15,3 @@ export declare function resolveOpenAIImageModel(modelAlias?: string): {
|
|
|
41
15
|
openaiModel: GPTImageModel;
|
|
42
16
|
modelLabel: string;
|
|
43
17
|
};
|
|
44
|
-
/**
|
|
45
|
-
* Run an OpenAI image generation. Caller owns: api-key acquisition,
|
|
46
|
-
* spinner lifecycle, output formatting (JSON vs human), and file save.
|
|
47
|
-
*/
|
|
48
|
-
export declare function executeOpenAIImageGenerate(prompt: string, options: OpenAIImageHelperOptions, ctx: {
|
|
49
|
-
apiKey: string;
|
|
50
|
-
}): Promise<OpenAIImageHelperResult>;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type VideoJob } from "@vibeframe/ai-providers";
|
|
1
2
|
import type { BuildAssetKind } from "./build-cache.js";
|
|
2
3
|
import type { ReviewAction } from "./review-report.js";
|
|
3
4
|
export type JobStatus = "queued" | "running" | "completed" | "failed" | "cancelled" | "unknown";
|
|
@@ -26,7 +27,10 @@ export interface JobRecord {
|
|
|
26
27
|
command: string;
|
|
27
28
|
provider: string;
|
|
28
29
|
providerTaskId: string;
|
|
30
|
+
/** Kling task type; superseded by `providerJob` and kept for older records. */
|
|
29
31
|
providerTaskType?: "text2video" | "image2video";
|
|
32
|
+
/** The provider's job handle, so a refresh polls exactly the job that was submitted. */
|
|
33
|
+
providerJob?: VideoJob;
|
|
30
34
|
progress?: number;
|
|
31
35
|
resultUrl?: string;
|
|
32
36
|
beatId?: string;
|
|
@@ -60,6 +64,7 @@ export interface CreateJobRecordOptions {
|
|
|
60
64
|
provider: string;
|
|
61
65
|
providerTaskId: string;
|
|
62
66
|
providerTaskType?: "text2video" | "image2video";
|
|
67
|
+
providerJob?: VideoJob;
|
|
63
68
|
projectDir?: string;
|
|
64
69
|
workingDirectory?: string;
|
|
65
70
|
command: string;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The CLI side of the transcription contract: transcribe an audio file on
|
|
3
|
+
* disk and get the result shape the commands already use. Every command
|
|
4
|
+
* that needs a transcript (audio, captions, highlights, jump-cut, scene
|
|
5
|
+
* narration) goes through here.
|
|
6
|
+
*/
|
|
7
|
+
import { type ProviderErrorKind, type TranscriptGranularity, type TranscriptResult } from "@vibeframe/ai-providers";
|
|
8
|
+
export interface TranscribeFileOptions {
|
|
9
|
+
apiKey: string;
|
|
10
|
+
language?: string;
|
|
11
|
+
granularity?: TranscriptGranularity;
|
|
12
|
+
}
|
|
13
|
+
/** Transcribe `path` with Whisper. Failures come back as `status: "failed"` with an error kind. */
|
|
14
|
+
export declare function transcribeAudioFile(path: string, options: TranscribeFileOptions): Promise<TranscriptResult & {
|
|
15
|
+
errorKind?: ProviderErrorKind;
|
|
16
|
+
}>;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Translate a list of short texts (subtitle cues, dub segments) with Claude
|
|
3
|
+
* or OpenAI, in batches, keeping each text's position. Lines come back
|
|
4
|
+
* tagged `[N]` and are matched by that index, so a skipped or merged line
|
|
5
|
+
* cannot shift every later translation; anything missing keeps its source
|
|
6
|
+
* text.
|
|
7
|
+
*/
|
|
8
|
+
import { type ProviderErrorKind } from "@vibeframe/ai-providers";
|
|
9
|
+
export interface TranslateTextsOptions {
|
|
10
|
+
/** Target language name or code ("Korean", "ko"). */
|
|
11
|
+
targetLanguage: string;
|
|
12
|
+
sourceLanguage?: string;
|
|
13
|
+
/** Default: Claude when ANTHROPIC_API_KEY is set, else OpenAI. */
|
|
14
|
+
provider?: "claude" | "openai";
|
|
15
|
+
apiKey?: string;
|
|
16
|
+
/** Texts per request. Default 30. */
|
|
17
|
+
batchSize?: number;
|
|
18
|
+
}
|
|
19
|
+
export type TranslateTextsResult = {
|
|
20
|
+
success: true;
|
|
21
|
+
texts: string[];
|
|
22
|
+
provider: "claude" | "openai";
|
|
23
|
+
} | {
|
|
24
|
+
success: false;
|
|
25
|
+
error: string;
|
|
26
|
+
errorKind?: ProviderErrorKind;
|
|
27
|
+
};
|
|
28
|
+
/** "ko" → "Korean"; names pass through. */
|
|
29
|
+
export declare function languageName(code: string): string;
|
|
30
|
+
export declare function translateTexts(texts: string[], options: TranslateTextsOptions): Promise<TranslateTextsResult>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
* to branch on provider id. All providers already return the same
|
|
19
19
|
* `{ success, audioBuffer, error?, characterCount? }` result.
|
|
20
20
|
*/
|
|
21
|
-
import type { KokoroLoadEvent } from "@vibeframe/ai-providers";
|
|
21
|
+
import type { KokoroLoadEvent, ProviderErrorKind } from "@vibeframe/ai-providers";
|
|
22
22
|
/** TTS providers VibeFrame can route to. `"auto"` picks based on key availability. */
|
|
23
23
|
export type TtsProviderName = "auto" | "elevenlabs" | "openai" | "kokoro";
|
|
24
24
|
/** Concrete provider id surfaced in result metadata. Never `"auto"`. */
|
|
@@ -33,6 +33,8 @@ export interface TtsCallOptions {
|
|
|
33
33
|
voice?: string;
|
|
34
34
|
/** Speaking speed multiplier (Kokoro: 0.5–2; ElevenLabs: 0.7–1.2). */
|
|
35
35
|
speed?: number;
|
|
36
|
+
/** Catalog model ID or alias for the resolved provider. */
|
|
37
|
+
model?: string;
|
|
36
38
|
/** Cold-start progress callback (Kokoro only — fires on first ~330MB load). */
|
|
37
39
|
onProgress?: (event: KokoroLoadEvent) => void;
|
|
38
40
|
}
|
|
@@ -41,7 +43,11 @@ export interface TtsCallResult {
|
|
|
41
43
|
success: boolean;
|
|
42
44
|
audioBuffer?: Buffer;
|
|
43
45
|
error?: string;
|
|
46
|
+
/** Why the provider failed (`auth`, `quota`, `invalid-request`, ...). */
|
|
47
|
+
errorKind?: ProviderErrorKind;
|
|
44
48
|
characterCount?: number;
|
|
49
|
+
/** The catalog model that spoke it. */
|
|
50
|
+
model?: string;
|
|
45
51
|
}
|
|
46
52
|
/** Synthesise speech from text. Provider-specific implementation lives behind this. */
|
|
47
53
|
export type TtsCallable = (text: string, options?: TtsCallOptions) => Promise<TtsCallResult>;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The CLI side of the video job contract: open a provider by name with the
|
|
3
|
+
* user's key, and turn local files into the image form it takes. Video
|
|
4
|
+
* executors, job records, and builds go through here instead of branching
|
|
5
|
+
* on provider names.
|
|
6
|
+
*/
|
|
7
|
+
import { type VideoGenerator, type VideoJob } from "@vibeframe/ai-providers";
|
|
8
|
+
/** Env var holding each video provider's key. */
|
|
9
|
+
export declare const VIDEO_PROVIDER_ENV: Readonly<Record<string, string>>;
|
|
10
|
+
/** `fal` is the old name for `seedance`. */
|
|
11
|
+
export declare function canonicalVideoProvider(provider: string): string;
|
|
12
|
+
/** A video generator for `provider`, with the given key or the configured one. */
|
|
13
|
+
export declare function openVideoGenerator(provider: string, apiKey?: string): Promise<VideoGenerator>;
|
|
14
|
+
/**
|
|
15
|
+
* A job handle for a bare task ID (a user typed it, or an old job record
|
|
16
|
+
* predates stored handles). Providers that need more than the ID recover
|
|
17
|
+
* it themselves: Kling tries both task types, Seedance uses its model's app.
|
|
18
|
+
*/
|
|
19
|
+
export declare function jobFromTaskId(provider: string, taskId: string, opts?: {
|
|
20
|
+
model?: string;
|
|
21
|
+
taskType?: string;
|
|
22
|
+
}): VideoJob;
|
|
23
|
+
export declare function mimeTypeForPath(path: string, fallback: string): string;
|
|
24
|
+
/** A local path, URL, or data URI as a URL or data URI (local files are inlined). */
|
|
25
|
+
export declare function fileToUrlOrDataUri(input: string, fallbackMimeType: string): Promise<string>;
|
|
26
|
+
/**
|
|
27
|
+
* An input image in the form `generator` takes: uploaded to the configured
|
|
28
|
+
* upload host for URL-only providers, inlined as a data URI otherwise.
|
|
29
|
+
*
|
|
30
|
+
* Remote URLs are never fetched here: an inline-only provider gets a usage
|
|
31
|
+
* error instead, so a tool call cannot make the CLI read an internal URL
|
|
32
|
+
* and forward its contents to a provider.
|
|
33
|
+
*/
|
|
34
|
+
export declare function videoImageInput(generator: VideoGenerator, input: string): Promise<string>;
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
*
|
|
13
13
|
* @see MODELS.md for AI model configuration
|
|
14
14
|
*/
|
|
15
|
+
import type { ProviderErrorKind } from "@vibeframe/ai-providers";
|
|
15
16
|
export interface TranscribeOptions {
|
|
16
17
|
audioPath: string;
|
|
17
18
|
language?: string;
|
|
@@ -29,7 +30,10 @@ export interface TranscribeResult {
|
|
|
29
30
|
}>;
|
|
30
31
|
detectedLanguage?: string;
|
|
31
32
|
outputPath?: string;
|
|
33
|
+
/** Subtitle format written to `outputPath` (json, srt, vtt). */
|
|
34
|
+
format?: string;
|
|
32
35
|
error?: string;
|
|
36
|
+
errorKind?: ProviderErrorKind;
|
|
33
37
|
}
|
|
34
38
|
export declare function executeTranscribe(options: TranscribeOptions): Promise<TranscribeResult>;
|
|
35
39
|
export interface IsolateOptions {
|
|
@@ -41,6 +45,7 @@ export interface IsolateResult {
|
|
|
41
45
|
success: boolean;
|
|
42
46
|
outputPath?: string;
|
|
43
47
|
error?: string;
|
|
48
|
+
errorKind?: ProviderErrorKind;
|
|
44
49
|
}
|
|
45
50
|
export declare function executeIsolate(options: IsolateOptions): Promise<IsolateResult>;
|
|
46
51
|
export interface VoiceCloneOptions {
|
|
@@ -56,13 +61,18 @@ export interface VoiceCloneResult {
|
|
|
56
61
|
voiceId?: string;
|
|
57
62
|
name?: string;
|
|
58
63
|
error?: string;
|
|
64
|
+
errorKind?: ProviderErrorKind;
|
|
59
65
|
}
|
|
60
66
|
export declare function executeVoiceClone(options: VoiceCloneOptions): Promise<VoiceCloneResult>;
|
|
61
67
|
export interface DubOptions {
|
|
62
68
|
mediaPath: string;
|
|
69
|
+
/** Target language code or name ("ko", "Spanish"). */
|
|
63
70
|
language: string;
|
|
64
71
|
source?: string;
|
|
72
|
+
/** Voice for the chosen TTS provider. */
|
|
65
73
|
voice?: string;
|
|
74
|
+
/** TTS provider: auto (default), elevenlabs, openai, kokoro. */
|
|
75
|
+
tts?: string;
|
|
66
76
|
analyzeOnly?: boolean;
|
|
67
77
|
output?: string;
|
|
68
78
|
}
|
|
@@ -72,8 +82,22 @@ export interface DubResult {
|
|
|
72
82
|
sourceLanguage?: string;
|
|
73
83
|
targetLanguage?: string;
|
|
74
84
|
segmentCount?: number;
|
|
85
|
+
/** Each segment's timing with its original and translated text. */
|
|
86
|
+
segments?: Array<{
|
|
87
|
+
startTime: number;
|
|
88
|
+
endTime: number;
|
|
89
|
+
original: string;
|
|
90
|
+
translated: string;
|
|
91
|
+
}>;
|
|
75
92
|
error?: string;
|
|
93
|
+
errorKind?: ProviderErrorKind;
|
|
76
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* Dub speech to another language: transcribe (Whisper), translate (Claude,
|
|
97
|
+
* or OpenAI without an Anthropic key), speak each segment (any TTS
|
|
98
|
+
* provider), and place each line at its segment's start time, speeding up
|
|
99
|
+
* lines that would overrun their slot.
|
|
100
|
+
*/
|
|
77
101
|
export declare function executeDub(options: DubOptions): Promise<DubResult>;
|
|
78
102
|
export interface DuckOptions {
|
|
79
103
|
musicPath: string;
|
|
@@ -12,48 +12,66 @@
|
|
|
12
12
|
*
|
|
13
13
|
* @see MODELS.md for AI model configuration
|
|
14
14
|
*/
|
|
15
|
+
import { type ProviderErrorKind } from "@vibeframe/ai-providers";
|
|
15
16
|
export interface ImageGenerateOptions {
|
|
16
17
|
prompt: string;
|
|
18
|
+
/** Default: the configured or first available image provider. */
|
|
17
19
|
provider?: string;
|
|
18
20
|
output?: string;
|
|
21
|
+
/** Explicit OpenAI size; otherwise the ratio picks one. */
|
|
19
22
|
size?: string;
|
|
20
23
|
ratio?: string;
|
|
21
24
|
quality?: string;
|
|
22
|
-
|
|
25
|
+
/** Gemini "1K"/"2K"/"4K", Grok "1k"/"2k". */
|
|
26
|
+
resolution?: string;
|
|
23
27
|
count?: number;
|
|
24
28
|
model?: string;
|
|
25
29
|
apiKey?: string;
|
|
26
30
|
}
|
|
27
31
|
export interface ImageGenerateResult {
|
|
28
32
|
success: boolean;
|
|
33
|
+
/** Where the first image was saved. */
|
|
29
34
|
outputPath?: string;
|
|
35
|
+
/** Every saved image: `out.png`, then `out-2.png`, `out-3.png`, ... */
|
|
36
|
+
outputPaths?: string[];
|
|
30
37
|
images?: Array<{
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
mimeType?: string;
|
|
38
|
+
base64: string;
|
|
39
|
+
mimeType: string;
|
|
34
40
|
revisedPrompt?: string;
|
|
35
41
|
}>;
|
|
36
42
|
provider?: string;
|
|
37
43
|
model?: string;
|
|
38
44
|
error?: string;
|
|
45
|
+
errorKind?: ProviderErrorKind;
|
|
39
46
|
}
|
|
40
47
|
export declare function executeImageGenerate(options: ImageGenerateOptions): Promise<ImageGenerateResult>;
|
|
41
|
-
export interface
|
|
48
|
+
export interface ImageEditOptions {
|
|
42
49
|
imagePaths: string[];
|
|
43
50
|
prompt: string;
|
|
51
|
+
/** Default: gemini. */
|
|
52
|
+
provider?: string;
|
|
44
53
|
output?: string;
|
|
45
54
|
model?: string;
|
|
46
55
|
ratio?: string;
|
|
47
56
|
resolution?: string;
|
|
57
|
+
quality?: string;
|
|
48
58
|
apiKey?: string;
|
|
49
59
|
}
|
|
50
|
-
export interface
|
|
60
|
+
export interface ImageEditResult {
|
|
51
61
|
success: boolean;
|
|
52
62
|
outputPath?: string;
|
|
63
|
+
provider?: string;
|
|
53
64
|
model?: string;
|
|
54
65
|
error?: string;
|
|
66
|
+
errorKind?: ProviderErrorKind;
|
|
55
67
|
}
|
|
56
|
-
export declare function
|
|
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>;
|
|
57
75
|
export interface ThumbnailBestFrameOptions {
|
|
58
76
|
videoPath: string;
|
|
59
77
|
outputPath: string;
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module ai-video
|
|
3
|
-
* @description
|
|
4
|
-
*
|
|
5
|
-
* `
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
* The legacy `vibe ai video / video-status / video-cancel / kling / kling-status /
|
|
9
|
-
* video-extend` Commander registrations were removed alongside the dead
|
|
10
|
-
* `commands/ai.ts` orchestrator (the `vibe ai *` namespace was never
|
|
11
|
-
* `addCommand`'d to `program`).
|
|
3
|
+
* @description Video generation, status, cancel, and extension on the video
|
|
4
|
+
* job contract. Powers the manifest tools `generate_video`,
|
|
5
|
+
* `generate_video_cancel`, `generate_video_extend`, and job refreshes in
|
|
6
|
+
* `vibe status`; every provider goes through `VideoGenerator`, so nothing
|
|
7
|
+
* here branches on provider names.
|
|
12
8
|
*
|
|
13
9
|
* @see MODELS.md for AI model configuration
|
|
14
10
|
*/
|
|
11
|
+
import { type ProviderErrorKind, type VideoJob, type VideoJobState } from "@vibeframe/ai-providers";
|
|
15
12
|
export interface VideoGenerateOptions {
|
|
16
13
|
prompt: string;
|
|
14
|
+
/** Default: the configured or first available video provider. */
|
|
17
15
|
provider?: "grok" | "runway" | "kling" | "veo" | "seedance" | "fal" | "omni";
|
|
18
16
|
image?: string;
|
|
17
|
+
/** Ending frame for providers that interpolate between two frames. */
|
|
18
|
+
endImage?: string;
|
|
19
19
|
refImages?: string[];
|
|
20
20
|
refVideos?: string[];
|
|
21
21
|
refAudio?: string[];
|
|
@@ -34,21 +34,37 @@ export interface VideoGenerateOptions {
|
|
|
34
34
|
output?: string;
|
|
35
35
|
wait?: boolean;
|
|
36
36
|
apiKey?: string;
|
|
37
|
+
/**
|
|
38
|
+
* Called as soon as the provider accepts the job, before waiting, so the
|
|
39
|
+
* caller can record it: a crash or timeout mid-wait then leaves a job that
|
|
40
|
+
* can still be polled and downloaded.
|
|
41
|
+
*/
|
|
42
|
+
onSubmitted?: (job: VideoJob) => void | Promise<void>;
|
|
43
|
+
/** Called after every poll while waiting. */
|
|
44
|
+
onProgress?: (state: VideoJobState) => void;
|
|
45
|
+
/** Veo only: `allow_all` or `allow_adult`. */
|
|
46
|
+
personGeneration?: string;
|
|
37
47
|
}
|
|
38
48
|
export interface VideoGenerateResult {
|
|
39
49
|
success: boolean;
|
|
40
50
|
taskId?: string;
|
|
51
|
+
/** The provider job handle; store it to poll, cancel, or extend later. */
|
|
52
|
+
job?: VideoJob;
|
|
41
53
|
status?: string;
|
|
42
54
|
videoUrl?: string;
|
|
43
55
|
duration?: number;
|
|
44
56
|
outputPath?: string;
|
|
45
57
|
provider?: string;
|
|
46
58
|
error?: string;
|
|
59
|
+
errorKind?: ProviderErrorKind;
|
|
47
60
|
}
|
|
48
61
|
export declare function executeVideoGenerate(options: VideoGenerateOptions): Promise<VideoGenerateResult>;
|
|
49
62
|
export interface VideoStatusOptions {
|
|
50
63
|
taskId: string;
|
|
51
|
-
provider?:
|
|
64
|
+
provider?: string;
|
|
65
|
+
/** The stored job handle; preferred over `taskId` + `taskType`. */
|
|
66
|
+
job?: VideoJob;
|
|
67
|
+
/** Kling task type, for a bare task ID. */
|
|
52
68
|
taskType?: "text2video" | "image2video";
|
|
53
69
|
wait?: boolean;
|
|
54
70
|
output?: string;
|
|
@@ -63,20 +79,28 @@ export interface VideoStatusResult {
|
|
|
63
79
|
duration?: number;
|
|
64
80
|
outputPath?: string;
|
|
65
81
|
error?: string;
|
|
82
|
+
errorKind?: ProviderErrorKind;
|
|
66
83
|
}
|
|
67
84
|
export declare function executeVideoStatus(options: VideoStatusOptions): Promise<VideoStatusResult>;
|
|
68
85
|
export interface VideoCancelOptions {
|
|
69
86
|
taskId: string;
|
|
87
|
+
/** Default: runway. */
|
|
88
|
+
provider?: string;
|
|
89
|
+
job?: VideoJob;
|
|
70
90
|
apiKey?: string;
|
|
71
91
|
}
|
|
72
92
|
export interface VideoCancelResult {
|
|
73
93
|
success: boolean;
|
|
74
94
|
error?: string;
|
|
95
|
+
errorKind?: ProviderErrorKind;
|
|
75
96
|
}
|
|
76
97
|
export declare function executeVideoCancel(options: VideoCancelOptions): Promise<VideoCancelResult>;
|
|
77
98
|
export interface VideoExtendOptions {
|
|
99
|
+
/** The task ID of the video to extend (Veo: its operation name). */
|
|
78
100
|
videoId: string;
|
|
79
|
-
|
|
101
|
+
/** Default: kling. */
|
|
102
|
+
provider?: string;
|
|
103
|
+
job?: VideoJob;
|
|
80
104
|
prompt?: string;
|
|
81
105
|
duration?: number;
|
|
82
106
|
negative?: string;
|
|
@@ -88,10 +112,12 @@ export interface VideoExtendOptions {
|
|
|
88
112
|
export interface VideoExtendResult {
|
|
89
113
|
success: boolean;
|
|
90
114
|
taskId?: string;
|
|
115
|
+
job?: VideoJob;
|
|
91
116
|
status?: string;
|
|
92
117
|
videoUrl?: string;
|
|
93
118
|
duration?: number;
|
|
94
119
|
outputPath?: string;
|
|
95
120
|
error?: string;
|
|
121
|
+
errorKind?: ProviderErrorKind;
|
|
96
122
|
}
|
|
97
123
|
export declare function executeVideoExtend(options: VideoExtendOptions): Promise<VideoExtendResult>;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module generate/image
|
|
3
|
-
* @description `vibe generate image` (alias `img`) —
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* @description `vibe generate image` (alias `img`) — image generation on
|
|
4
|
+
* OpenAI GPT Image, Gemini Nano Banana, or Grok Imagine. Validation,
|
|
5
|
+
* provider choice, and the dry run live here; generation is
|
|
6
|
+
* `executeImageGenerate`, the same executor the MCP tool and pipelines use.
|
|
6
7
|
*/
|
|
7
8
|
import type { Command } from "commander";
|
|
8
9
|
export declare function registerImageCommand(parent: Command): void;
|
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* conditioning). Split out of `generate.ts` in v0.69 (Plan G Phase 2).
|
|
6
6
|
*/
|
|
7
7
|
import type { Command } from "commander";
|
|
8
|
+
import { type ProviderErrorKind } from "@vibeframe/ai-providers";
|
|
8
9
|
export interface ExecuteMusicOptions {
|
|
9
10
|
prompt: string;
|
|
10
11
|
output?: string;
|
|
@@ -12,6 +13,9 @@ export interface ExecuteMusicOptions {
|
|
|
12
13
|
provider?: "elevenlabs" | "replicate";
|
|
13
14
|
instrumental?: boolean;
|
|
14
15
|
wait?: boolean;
|
|
16
|
+
/** Replicate MusicGen variant: large, stereo-large, melody-large, stereo-melody-large. */
|
|
17
|
+
model?: string;
|
|
18
|
+
apiKey?: string;
|
|
15
19
|
}
|
|
16
20
|
export interface ExecuteMusicResult {
|
|
17
21
|
success: boolean;
|
|
@@ -22,6 +26,7 @@ export interface ExecuteMusicResult {
|
|
|
22
26
|
status?: string;
|
|
23
27
|
audioUrl?: string;
|
|
24
28
|
error?: string;
|
|
29
|
+
errorKind?: ProviderErrorKind;
|
|
25
30
|
}
|
|
26
31
|
export declare function executeMusic(options: ExecuteMusicOptions): Promise<ExecuteMusicResult>;
|
|
27
32
|
export declare function registerMusicCommand(parent: Command): void;
|
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module generate/sound-effect
|
|
3
3
|
* @description `vibe generate sound-effect` — ElevenLabs SFX generation.
|
|
4
|
-
*
|
|
4
|
+
* The command validates and formats; `executeSoundEffect` (also used by
|
|
5
|
+
* pipelines and the MCP tool) does the work.
|
|
5
6
|
*/
|
|
6
7
|
import type { Command } from "commander";
|
|
8
|
+
import { type ProviderErrorKind } from "@vibeframe/ai-providers";
|
|
7
9
|
export interface ExecuteSoundEffectOptions {
|
|
8
10
|
prompt: string;
|
|
9
11
|
output?: string;
|
|
12
|
+
/** Seconds (0.5-30); the model picks when omitted. */
|
|
10
13
|
duration?: number;
|
|
14
|
+
/** 0-1, default 0.3. */
|
|
11
15
|
promptInfluence?: number;
|
|
16
|
+
apiKey?: string;
|
|
12
17
|
}
|
|
13
18
|
export interface ExecuteSoundEffectResult {
|
|
14
19
|
success: boolean;
|
|
15
20
|
outputPath?: string;
|
|
16
21
|
error?: string;
|
|
22
|
+
errorKind?: ProviderErrorKind;
|
|
17
23
|
}
|
|
18
24
|
export declare function executeSoundEffect(options: ExecuteSoundEffectOptions): Promise<ExecuteSoundEffectResult>;
|
|
19
25
|
export declare function registerSoundEffectCommand(parent: Command): void;
|
|
@@ -1,20 +1,29 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module generate/speech
|
|
3
|
-
* @description `vibe generate
|
|
4
|
-
* speech
|
|
5
|
-
*
|
|
3
|
+
* @description `vibe generate narration` (alias `voiceover`) — text to
|
|
4
|
+
* speech on ElevenLabs, OpenAI, or local Kokoro, through the same TTS
|
|
5
|
+
* resolver scenes and builds use.
|
|
6
6
|
*/
|
|
7
7
|
import type { Command } from "commander";
|
|
8
|
+
import type { ProviderErrorKind } from "@vibeframe/ai-providers";
|
|
8
9
|
export interface ExecuteSpeechOptions {
|
|
9
10
|
text: string;
|
|
10
11
|
output?: string;
|
|
11
12
|
voice?: string;
|
|
13
|
+
/** auto (default): ElevenLabs if its key is set, else OpenAI, else local Kokoro. */
|
|
14
|
+
provider?: string;
|
|
15
|
+
/** Catalog model ID or alias for the chosen provider. */
|
|
16
|
+
model?: string;
|
|
17
|
+
speed?: number;
|
|
12
18
|
}
|
|
13
19
|
export interface ExecuteSpeechResult {
|
|
14
20
|
success: boolean;
|
|
15
21
|
outputPath?: string;
|
|
16
22
|
characterCount?: number;
|
|
23
|
+
provider?: string;
|
|
24
|
+
model?: string;
|
|
17
25
|
error?: string;
|
|
26
|
+
errorKind?: ProviderErrorKind;
|
|
18
27
|
}
|
|
19
28
|
export declare function executeSpeech(options: ExecuteSpeechOptions): Promise<ExecuteSpeechResult>;
|
|
20
29
|
export declare function registerNarrationCommand(parent: Command): void;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module generate/video-cancel
|
|
3
|
-
* @description `vibe generate video-cancel` (hidden) — cancel in-flight
|
|
4
|
-
*
|
|
5
|
-
* Phase 2).
|
|
3
|
+
* @description `vibe generate video-cancel` (hidden) — cancel an in-flight
|
|
4
|
+
* video job on a provider with a cancel API (Runway, Seedance, Gemini Omni).
|
|
6
5
|
*/
|
|
7
6
|
import type { Command } from "commander";
|
|
8
7
|
export declare function registerVideoCancelCommand(parent: Command): void;
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module generate/video-extend
|
|
3
|
-
* @description `vibe generate video-extend` (hidden) — extend
|
|
4
|
-
*
|
|
5
|
-
*
|
|
3
|
+
* @description `vibe generate video-extend` (hidden) — extend a generated
|
|
4
|
+
* video from its last frame, on any provider that can (Kling, Grok classic,
|
|
5
|
+
* Gemini Omni, and Veo until 2026-10-22).
|
|
6
6
|
*/
|
|
7
7
|
import type { Command } from "commander";
|
|
8
8
|
export declare function registerVideoExtendCommand(parent: Command): void;
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @module generate/video
|
|
3
3
|
* @description `vibe generate video` (alias `vid`) — multi-provider video
|
|
4
|
-
* generation
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* generation (Seedance via fal.ai, Grok, Kling, Runway, Gemini Omni, and Veo
|
|
5
|
+
* until 2026-10-22). Validation, provider choice, and the dry run live here;
|
|
6
|
+
* generation itself is `executeVideoGenerate`, the same executor the MCP
|
|
7
|
+
* tool and builds use.
|
|
7
8
|
*/
|
|
8
9
|
import type { Command } from "commander";
|
|
9
10
|
export declare function registerVideoCommand(parent: Command): void;
|
|
@@ -22,6 +22,8 @@ export interface StructuredError {
|
|
|
22
22
|
retryWith?: string[];
|
|
23
23
|
recoverable?: boolean;
|
|
24
24
|
retryable: boolean;
|
|
25
|
+
/** The provider error kind (`auth`, `quota`, `likeness`, ...) when a provider call failed. */
|
|
26
|
+
errorKind?: string;
|
|
25
27
|
/**
|
|
26
28
|
* Structured context carried alongside the failure, so a refusal can hand
|
|
27
29
|
* back the evidence it refused on instead of forcing a second call. Used by
|
|
@@ -32,6 +34,11 @@ export interface StructuredError {
|
|
|
32
34
|
export declare function usageError(msg: string, suggestion?: string): StructuredError;
|
|
33
35
|
export declare function authError(envVar: string, provider: string): StructuredError;
|
|
34
36
|
export declare function apiError(msg: string, retryable?: boolean): StructuredError;
|
|
37
|
+
/**
|
|
38
|
+
* The structured error for a failed provider call, chosen by its error kind
|
|
39
|
+
* (`ProviderError.kind`) instead of by matching provider wording.
|
|
40
|
+
*/
|
|
41
|
+
export declare function providerFailure(message: string, kind?: string): StructuredError;
|
|
35
42
|
export declare function notFoundError(path: string): StructuredError;
|
|
36
43
|
export declare function networkError(msg: string): StructuredError;
|
|
37
44
|
export declare function generalError(msg: string, suggestion?: string): StructuredError;
|