@vibeframe/cli 0.115.6 → 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.
@@ -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 using Whisper API directly.
56
- * Uses timestamp_granularities[]=word for filler detection.
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
- * Shared OpenAI `generateImage` helper for `vibe ai image` and
5
- * `vibe generate image`. Both commands had their own near-identical
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, ImageResult } from "@vibeframe/ai-providers";
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>;
@@ -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>;
@@ -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
- style?: string;
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
- url?: string;
32
- base64?: string;
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 GeminiEditOptions {
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 GeminiEditResult {
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 executeGeminiEdit(options: GeminiEditOptions): Promise<GeminiEditResult>;
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,8 +1,9 @@
1
1
  /**
2
2
  * @module generate/image
3
- * @description `vibe generate image` (alias `img`) — multi-provider image
4
- * generation. OpenAI gpt-image-2.5, Gemini Nano Banana, Grok, Runway. Split
5
- * out of `generate.ts` in v0.69 (Plan G Phase 2).
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
- * Split out of `generate.ts` in v0.69 (Plan G Phase 2).
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 speech` (alias `tts`) — ElevenLabs text-to-
4
- * speech with optional duration-fit post-processing. Split out of
5
- * `generate.ts` in v0.69 (Plan G Phase 2).
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;