@vibeframe/cli 0.115.5 → 0.115.6

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.
@@ -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,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>;
@@ -1,21 +1,21 @@
1
1
  /**
2
2
  * @module ai-video
3
- * @description Library functions for video generation, status, cancel, and
4
- * extension. Powers the manifest tools `generate_video`,
5
- * `generate_video_status`, `generate_video_cancel`, `generate_video_extend`
6
- * (the user reaches these via `vibe generate video[-...]`).
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?: "grok" | "runway" | "kling" | "veo";
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
- provider?: "kling" | "veo";
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,7 @@
1
1
  /**
2
2
  * @module generate/video-cancel
3
- * @description `vibe generate video-cancel` (hidden) — cancel in-flight Grok
4
- * or Runway video generation. Split out of `generate.ts` in v0.69 (Plan G
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 video duration
4
- * via Kling or Veo (Gemini). Split out of `generate.ts` in v0.69 (Plan G
5
- * Phase 2).
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. fal.ai (Seedance 2.0), Grok, Veo (Gemini), Kling, Runway,
5
- * plus Gemini Omni 1.1 Flash (`-p omni`).
6
- * Split out of `generate.ts` in v0.69 (Plan G Phase 2).
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;