@vibeframe/cli 0.27.0 → 0.30.0

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.
Files changed (118) hide show
  1. package/LICENSE +21 -0
  2. package/dist/agent/adapters/index.d.ts +1 -0
  3. package/dist/agent/adapters/index.d.ts.map +1 -1
  4. package/dist/agent/adapters/index.js +5 -0
  5. package/dist/agent/adapters/index.js.map +1 -1
  6. package/dist/agent/adapters/openrouter.d.ts +16 -0
  7. package/dist/agent/adapters/openrouter.d.ts.map +1 -0
  8. package/dist/agent/adapters/openrouter.js +100 -0
  9. package/dist/agent/adapters/openrouter.js.map +1 -0
  10. package/dist/agent/types.d.ts +1 -1
  11. package/dist/agent/types.d.ts.map +1 -1
  12. package/dist/commands/agent.d.ts.map +1 -1
  13. package/dist/commands/agent.js +3 -1
  14. package/dist/commands/agent.js.map +1 -1
  15. package/dist/commands/ai-edit-cli.d.ts.map +1 -1
  16. package/dist/commands/ai-edit-cli.js +18 -0
  17. package/dist/commands/ai-edit-cli.js.map +1 -1
  18. package/dist/commands/generate.js +14 -0
  19. package/dist/commands/generate.js.map +1 -1
  20. package/dist/commands/schema.d.ts +1 -0
  21. package/dist/commands/schema.d.ts.map +1 -1
  22. package/dist/commands/schema.js +122 -21
  23. package/dist/commands/schema.js.map +1 -1
  24. package/dist/commands/setup.js +5 -2
  25. package/dist/commands/setup.js.map +1 -1
  26. package/dist/config/schema.d.ts +2 -1
  27. package/dist/config/schema.d.ts.map +1 -1
  28. package/dist/config/schema.js +2 -0
  29. package/dist/config/schema.js.map +1 -1
  30. package/dist/index.js +0 -0
  31. package/package.json +16 -12
  32. package/.turbo/turbo-build.log +0 -4
  33. package/.turbo/turbo-lint.log +0 -21
  34. package/.turbo/turbo-test.log +0 -689
  35. package/src/agent/adapters/claude.ts +0 -143
  36. package/src/agent/adapters/gemini.ts +0 -159
  37. package/src/agent/adapters/index.ts +0 -61
  38. package/src/agent/adapters/ollama.ts +0 -231
  39. package/src/agent/adapters/openai.ts +0 -116
  40. package/src/agent/adapters/xai.ts +0 -119
  41. package/src/agent/index.ts +0 -251
  42. package/src/agent/memory/index.ts +0 -151
  43. package/src/agent/prompts/system.ts +0 -106
  44. package/src/agent/tools/ai-editing.ts +0 -845
  45. package/src/agent/tools/ai-generation.ts +0 -1073
  46. package/src/agent/tools/ai-pipeline.ts +0 -1055
  47. package/src/agent/tools/ai.ts +0 -21
  48. package/src/agent/tools/batch.ts +0 -429
  49. package/src/agent/tools/e2e.test.ts +0 -545
  50. package/src/agent/tools/export.ts +0 -184
  51. package/src/agent/tools/filesystem.ts +0 -237
  52. package/src/agent/tools/index.ts +0 -150
  53. package/src/agent/tools/integration.test.ts +0 -775
  54. package/src/agent/tools/media.ts +0 -697
  55. package/src/agent/tools/project.ts +0 -313
  56. package/src/agent/tools/timeline.ts +0 -951
  57. package/src/agent/types.ts +0 -68
  58. package/src/commands/agent.ts +0 -340
  59. package/src/commands/ai-analyze.ts +0 -429
  60. package/src/commands/ai-animated-caption.ts +0 -390
  61. package/src/commands/ai-audio.ts +0 -941
  62. package/src/commands/ai-broll.ts +0 -490
  63. package/src/commands/ai-edit-cli.ts +0 -658
  64. package/src/commands/ai-edit.ts +0 -1542
  65. package/src/commands/ai-fill-gaps.ts +0 -566
  66. package/src/commands/ai-helpers.ts +0 -65
  67. package/src/commands/ai-highlights.ts +0 -1303
  68. package/src/commands/ai-image.ts +0 -761
  69. package/src/commands/ai-motion.ts +0 -347
  70. package/src/commands/ai-narrate.ts +0 -451
  71. package/src/commands/ai-review.ts +0 -309
  72. package/src/commands/ai-script-pipeline-cli.ts +0 -1710
  73. package/src/commands/ai-script-pipeline.ts +0 -1365
  74. package/src/commands/ai-suggest-edit.ts +0 -264
  75. package/src/commands/ai-video-fx.ts +0 -445
  76. package/src/commands/ai-video.ts +0 -915
  77. package/src/commands/ai-viral.ts +0 -595
  78. package/src/commands/ai-visual-fx.ts +0 -601
  79. package/src/commands/ai.test.ts +0 -627
  80. package/src/commands/ai.ts +0 -307
  81. package/src/commands/analyze.ts +0 -282
  82. package/src/commands/audio.ts +0 -644
  83. package/src/commands/batch.test.ts +0 -279
  84. package/src/commands/batch.ts +0 -440
  85. package/src/commands/detect.ts +0 -329
  86. package/src/commands/doctor.ts +0 -237
  87. package/src/commands/edit-cmd.ts +0 -1014
  88. package/src/commands/export.ts +0 -918
  89. package/src/commands/generate.ts +0 -2146
  90. package/src/commands/media.ts +0 -177
  91. package/src/commands/output.ts +0 -142
  92. package/src/commands/pipeline.ts +0 -398
  93. package/src/commands/project.test.ts +0 -127
  94. package/src/commands/project.ts +0 -149
  95. package/src/commands/sanitize.ts +0 -60
  96. package/src/commands/schema.ts +0 -130
  97. package/src/commands/setup.ts +0 -509
  98. package/src/commands/timeline.test.ts +0 -499
  99. package/src/commands/timeline.ts +0 -529
  100. package/src/commands/validate.ts +0 -77
  101. package/src/config/config.test.ts +0 -197
  102. package/src/config/index.ts +0 -125
  103. package/src/config/schema.ts +0 -82
  104. package/src/engine/index.ts +0 -2
  105. package/src/engine/project.test.ts +0 -702
  106. package/src/engine/project.ts +0 -439
  107. package/src/index.ts +0 -146
  108. package/src/utils/api-key.test.ts +0 -41
  109. package/src/utils/api-key.ts +0 -247
  110. package/src/utils/audio.ts +0 -83
  111. package/src/utils/exec-safe.ts +0 -75
  112. package/src/utils/first-run.ts +0 -52
  113. package/src/utils/provider-resolver.ts +0 -56
  114. package/src/utils/remotion.ts +0 -951
  115. package/src/utils/subtitle.test.ts +0 -227
  116. package/src/utils/subtitle.ts +0 -169
  117. package/src/utils/tty.ts +0 -196
  118. package/tsconfig.json +0 -20
@@ -1,177 +0,0 @@
1
- import { Command } from "commander";
2
- import { stat } from "node:fs/promises";
3
- import { resolve, extname, basename } from "node:path";
4
- import chalk from "chalk";
5
- import ora from "ora";
6
- import * as musicMetadata from "music-metadata";
7
-
8
- export const mediaCommand = new Command("media")
9
- .description("Media file utilities");
10
-
11
- mediaCommand
12
- .command("info")
13
- .description("Get media file information")
14
- .argument("<file>", "Media file path")
15
- .action(async (file: string) => {
16
- const spinner = ora("Analyzing media...").start();
17
-
18
- try {
19
- const filePath = resolve(process.cwd(), file);
20
- const ext = extname(filePath).toLowerCase();
21
- const fileName = basename(filePath);
22
- const fileStat = await stat(filePath);
23
-
24
- const mediaType = detectMediaType(ext);
25
-
26
- spinner.stop();
27
-
28
- console.log();
29
- console.log(chalk.bold.cyan("Media Info"));
30
- console.log(chalk.dim("─".repeat(50)));
31
- console.log(chalk.dim(" File:"), fileName);
32
- console.log(chalk.dim(" Path:"), filePath);
33
- console.log(chalk.dim(" Size:"), formatFileSize(fileStat.size));
34
- console.log(chalk.dim(" Type:"), mediaType);
35
-
36
- if (mediaType === "audio" || mediaType === "video") {
37
- try {
38
- const metadata = await musicMetadata.parseFile(filePath);
39
-
40
- console.log();
41
- console.log(chalk.bold.cyan("Format"));
42
- console.log(chalk.dim("─".repeat(50)));
43
-
44
- if (metadata.format.container) {
45
- console.log(chalk.dim(" Container:"), metadata.format.container);
46
- }
47
- if (metadata.format.codec) {
48
- console.log(chalk.dim(" Codec:"), metadata.format.codec);
49
- }
50
- if (metadata.format.duration) {
51
- console.log(chalk.dim(" Duration:"), formatDuration(metadata.format.duration));
52
- }
53
- if (metadata.format.bitrate) {
54
- console.log(chalk.dim(" Bitrate:"), formatBitrate(metadata.format.bitrate));
55
- }
56
- if (metadata.format.sampleRate) {
57
- console.log(chalk.dim(" Sample Rate:"), `${metadata.format.sampleRate} Hz`);
58
- }
59
- if (metadata.format.numberOfChannels) {
60
- console.log(chalk.dim(" Channels:"), metadata.format.numberOfChannels);
61
- }
62
-
63
- // Video-specific info (if available)
64
- if (metadata.format.trackInfo && metadata.format.trackInfo.length > 0) {
65
- const videoTrack = metadata.format.trackInfo.find(
66
- (t) => (t as Record<string, unknown>).type === "video"
67
- ) as Record<string, unknown> | undefined;
68
- if (videoTrack) {
69
- console.log();
70
- console.log(chalk.bold.cyan("Video"));
71
- console.log(chalk.dim("─".repeat(50)));
72
- if (videoTrack.width && videoTrack.height) {
73
- console.log(chalk.dim(" Resolution:"), `${videoTrack.width}x${videoTrack.height}`);
74
- }
75
- if (videoTrack.frameRate) {
76
- console.log(chalk.dim(" Frame Rate:"), `${videoTrack.frameRate} fps`);
77
- }
78
- }
79
- }
80
-
81
- // Audio tags
82
- if (metadata.common && Object.keys(metadata.common).length > 0) {
83
- const { title, artist, album, year, genre } = metadata.common;
84
- if (title || artist || album) {
85
- console.log();
86
- console.log(chalk.bold.cyan("Tags"));
87
- console.log(chalk.dim("─".repeat(50)));
88
- if (title) console.log(chalk.dim(" Title:"), title);
89
- if (artist) console.log(chalk.dim(" Artist:"), artist);
90
- if (album) console.log(chalk.dim(" Album:"), album);
91
- if (year) console.log(chalk.dim(" Year:"), year);
92
- if (genre && genre.length > 0) console.log(chalk.dim(" Genre:"), genre.join(", "));
93
- }
94
- }
95
- } catch (metadataError) {
96
- console.log();
97
- console.log(chalk.yellow(" Could not parse detailed metadata"));
98
- }
99
- }
100
-
101
- if (mediaType === "image") {
102
- console.log();
103
- console.log(chalk.dim(" (Image metadata parsing not yet supported)"));
104
- }
105
-
106
- console.log();
107
- } catch (error) {
108
- spinner.fail(chalk.red("Failed to analyze media"));
109
- if (error instanceof Error) {
110
- console.error(chalk.red(error.message));
111
- }
112
- process.exit(1);
113
- }
114
- });
115
-
116
- mediaCommand
117
- .command("duration")
118
- .description("Get media duration in seconds (for scripting)")
119
- .argument("<file>", "Media file path")
120
- .action(async (file: string) => {
121
- try {
122
- const filePath = resolve(process.cwd(), file);
123
- const metadata = await musicMetadata.parseFile(filePath);
124
-
125
- if (metadata.format.duration) {
126
- console.log(metadata.format.duration.toFixed(3));
127
- } else {
128
- console.error("Could not determine duration");
129
- process.exit(1);
130
- }
131
- } catch (error) {
132
- console.error("Failed to get duration");
133
- process.exit(1);
134
- }
135
- });
136
-
137
- function detectMediaType(ext: string): "video" | "audio" | "image" | "unknown" {
138
- const videoExts = [".mp4", ".mov", ".webm", ".avi", ".mkv", ".m4v", ".flv", ".wmv"];
139
- const audioExts = [".mp3", ".wav", ".ogg", ".m4a", ".aac", ".flac", ".wma", ".aiff"];
140
- const imageExts = [".jpg", ".jpeg", ".png", ".gif", ".webp", ".bmp", ".svg", ".tiff"];
141
-
142
- if (videoExts.includes(ext)) return "video";
143
- if (audioExts.includes(ext)) return "audio";
144
- if (imageExts.includes(ext)) return "image";
145
- return "unknown";
146
- }
147
-
148
- function formatFileSize(bytes: number): string {
149
- const units = ["B", "KB", "MB", "GB"];
150
- let size = bytes;
151
- let unitIndex = 0;
152
-
153
- while (size >= 1024 && unitIndex < units.length - 1) {
154
- size /= 1024;
155
- unitIndex++;
156
- }
157
-
158
- return `${size.toFixed(2)} ${units[unitIndex]}`;
159
- }
160
-
161
- function formatDuration(seconds: number): string {
162
- const hrs = Math.floor(seconds / 3600);
163
- const mins = Math.floor((seconds % 3600) / 60);
164
- const secs = (seconds % 60).toFixed(2);
165
-
166
- if (hrs > 0) {
167
- return `${hrs}:${mins.toString().padStart(2, "0")}:${secs.padStart(5, "0")}`;
168
- }
169
- return `${mins}:${secs.padStart(5, "0")}`;
170
- }
171
-
172
- function formatBitrate(bps: number): string {
173
- if (bps >= 1000000) {
174
- return `${(bps / 1000000).toFixed(2)} Mbps`;
175
- }
176
- return `${(bps / 1000).toFixed(0)} kbps`;
177
- }
@@ -1,142 +0,0 @@
1
- /**
2
- * @module output
3
- * @description Shared output helper for --json structured output support.
4
- */
5
-
6
- import chalk from "chalk";
7
- import ora from "ora";
8
-
9
- // ── Exit Codes ───────────────────────────────────────────────────────────
10
-
11
- export enum ExitCode {
12
- SUCCESS = 0,
13
- GENERAL = 1,
14
- USAGE = 2,
15
- NOT_FOUND = 3,
16
- AUTH = 4,
17
- API_ERROR = 5,
18
- NETWORK = 6,
19
- }
20
-
21
- // ── Structured Errors ────────────────────────────────────────────────────
22
-
23
- export interface StructuredError {
24
- success: false;
25
- error: string;
26
- code: string;
27
- exitCode: ExitCode;
28
- suggestion?: string;
29
- retryable: boolean;
30
- }
31
-
32
- export function usageError(msg: string, suggestion?: string): StructuredError {
33
- return { success: false, error: msg, code: "USAGE_ERROR", exitCode: ExitCode.USAGE, suggestion, retryable: false };
34
- }
35
-
36
- export function authError(envVar: string, provider: string): StructuredError {
37
- return {
38
- success: false,
39
- error: `${provider} API key required.`,
40
- code: "API_KEY_MISSING",
41
- exitCode: ExitCode.AUTH,
42
- suggestion: `Set ${envVar} in .env, or run: vibe setup`,
43
- retryable: false,
44
- };
45
- }
46
-
47
- export function apiError(msg: string, retryable = false): StructuredError {
48
- return { success: false, error: msg, code: "API_ERROR", exitCode: ExitCode.API_ERROR, suggestion: retryable ? "Retry the command." : undefined, retryable };
49
- }
50
-
51
- export function notFoundError(path: string): StructuredError {
52
- return { success: false, error: `File not found: ${path}`, code: "NOT_FOUND", exitCode: ExitCode.NOT_FOUND, retryable: false };
53
- }
54
-
55
- export function networkError(msg: string): StructuredError {
56
- return { success: false, error: msg, code: "NETWORK_ERROR", exitCode: ExitCode.NETWORK, suggestion: "Check your internet connection and retry.", retryable: true };
57
- }
58
-
59
- export function generalError(msg: string, suggestion?: string): StructuredError {
60
- return { success: false, error: msg, code: "ERROR", exitCode: ExitCode.GENERAL, suggestion, retryable: false };
61
- }
62
-
63
- /** Output structured error then exit */
64
- export function exitWithError(err: StructuredError): never {
65
- if (isJsonMode()) {
66
- console.log(JSON.stringify(err, null, 2));
67
- } else {
68
- console.error(chalk.red(`\n ${err.error}`));
69
- if (err.suggestion) {
70
- console.error(chalk.dim(` ${err.suggestion}`));
71
- }
72
- console.error();
73
- }
74
- process.exit(err.exitCode);
75
- }
76
-
77
- // ── Output Modes ─────────────────────────────────────────────────────────
78
-
79
- /** Check if --json flag is active */
80
- export function isJsonMode(): boolean {
81
- return process.env.VIBE_JSON_OUTPUT === "1";
82
- }
83
-
84
- /** Check if --quiet flag is active */
85
- export function isQuietMode(): boolean {
86
- return process.env.VIBE_QUIET_OUTPUT === "1";
87
- }
88
-
89
- /** Output result - JSON mode outputs JSON, quiet mode outputs primary value only */
90
- export function outputResult(result: Record<string, unknown>): void {
91
- if (isJsonMode()) {
92
- // Apply --fields filtering if specified
93
- const fields = process.env.VIBE_OUTPUT_FIELDS;
94
- if (fields) {
95
- const keys = fields.split(",").map((k) => k.trim());
96
- const filtered: Record<string, unknown> = {};
97
- for (const key of keys) {
98
- if (key in result) filtered[key] = result[key];
99
- }
100
- // Always include success
101
- if ("success" in result) filtered.success = result.success;
102
- console.log(JSON.stringify(filtered, null, 2));
103
- } else {
104
- console.log(JSON.stringify(result, null, 2));
105
- }
106
- } else if (isQuietMode()) {
107
- // In quiet mode, output the primary value only (path, url, or id)
108
- const primary = result.output ?? result.path ?? result.url ?? result.id ?? result.result;
109
- if (primary !== undefined) console.log(String(primary));
110
- }
111
- }
112
-
113
- /** Wrap console output - suppressed in JSON/quiet mode */
114
- export function log(...args: unknown[]): void {
115
- if (!isJsonMode() && !isQuietMode()) {
116
- console.log(...args);
117
- }
118
- }
119
-
120
- /** Create a spinner that is silent in JSON/quiet mode */
121
- export function spinner(text: string): ReturnType<typeof ora> {
122
- if (isJsonMode() || isQuietMode()) {
123
- return ora({ text, isSilent: true });
124
- }
125
- return ora(text);
126
- }
127
-
128
- /** Suggest next steps - only in human interactive mode */
129
- export function suggestNext(tip: string): void {
130
- if (!isJsonMode() && !isQuietMode() && process.stdout.isTTY) {
131
- console.log(chalk.dim(`\n Tip: ${tip}`));
132
- }
133
- }
134
-
135
- /** Output an error - always outputs (JSON mode writes to stdout as JSON) */
136
- export function outputError(error: string, details?: Record<string, unknown>): void {
137
- if (isJsonMode()) {
138
- console.log(JSON.stringify({ success: false, error, ...details }, null, 2));
139
- } else {
140
- console.error(error);
141
- }
142
- }