@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.
- package/LICENSE +21 -0
- package/dist/agent/adapters/index.d.ts +1 -0
- package/dist/agent/adapters/index.d.ts.map +1 -1
- package/dist/agent/adapters/index.js +5 -0
- package/dist/agent/adapters/index.js.map +1 -1
- package/dist/agent/adapters/openrouter.d.ts +16 -0
- package/dist/agent/adapters/openrouter.d.ts.map +1 -0
- package/dist/agent/adapters/openrouter.js +100 -0
- package/dist/agent/adapters/openrouter.js.map +1 -0
- package/dist/agent/types.d.ts +1 -1
- package/dist/agent/types.d.ts.map +1 -1
- package/dist/commands/agent.d.ts.map +1 -1
- package/dist/commands/agent.js +3 -1
- package/dist/commands/agent.js.map +1 -1
- package/dist/commands/ai-edit-cli.d.ts.map +1 -1
- package/dist/commands/ai-edit-cli.js +18 -0
- package/dist/commands/ai-edit-cli.js.map +1 -1
- package/dist/commands/generate.js +14 -0
- package/dist/commands/generate.js.map +1 -1
- package/dist/commands/schema.d.ts +1 -0
- package/dist/commands/schema.d.ts.map +1 -1
- package/dist/commands/schema.js +122 -21
- package/dist/commands/schema.js.map +1 -1
- package/dist/commands/setup.js +5 -2
- package/dist/commands/setup.js.map +1 -1
- package/dist/config/schema.d.ts +2 -1
- package/dist/config/schema.d.ts.map +1 -1
- package/dist/config/schema.js +2 -0
- package/dist/config/schema.js.map +1 -1
- package/dist/index.js +0 -0
- package/package.json +16 -12
- package/.turbo/turbo-build.log +0 -4
- package/.turbo/turbo-lint.log +0 -21
- package/.turbo/turbo-test.log +0 -689
- package/src/agent/adapters/claude.ts +0 -143
- package/src/agent/adapters/gemini.ts +0 -159
- package/src/agent/adapters/index.ts +0 -61
- package/src/agent/adapters/ollama.ts +0 -231
- package/src/agent/adapters/openai.ts +0 -116
- package/src/agent/adapters/xai.ts +0 -119
- package/src/agent/index.ts +0 -251
- package/src/agent/memory/index.ts +0 -151
- package/src/agent/prompts/system.ts +0 -106
- package/src/agent/tools/ai-editing.ts +0 -845
- package/src/agent/tools/ai-generation.ts +0 -1073
- package/src/agent/tools/ai-pipeline.ts +0 -1055
- package/src/agent/tools/ai.ts +0 -21
- package/src/agent/tools/batch.ts +0 -429
- package/src/agent/tools/e2e.test.ts +0 -545
- package/src/agent/tools/export.ts +0 -184
- package/src/agent/tools/filesystem.ts +0 -237
- package/src/agent/tools/index.ts +0 -150
- package/src/agent/tools/integration.test.ts +0 -775
- package/src/agent/tools/media.ts +0 -697
- package/src/agent/tools/project.ts +0 -313
- package/src/agent/tools/timeline.ts +0 -951
- package/src/agent/types.ts +0 -68
- package/src/commands/agent.ts +0 -340
- package/src/commands/ai-analyze.ts +0 -429
- package/src/commands/ai-animated-caption.ts +0 -390
- package/src/commands/ai-audio.ts +0 -941
- package/src/commands/ai-broll.ts +0 -490
- package/src/commands/ai-edit-cli.ts +0 -658
- package/src/commands/ai-edit.ts +0 -1542
- package/src/commands/ai-fill-gaps.ts +0 -566
- package/src/commands/ai-helpers.ts +0 -65
- package/src/commands/ai-highlights.ts +0 -1303
- package/src/commands/ai-image.ts +0 -761
- package/src/commands/ai-motion.ts +0 -347
- package/src/commands/ai-narrate.ts +0 -451
- package/src/commands/ai-review.ts +0 -309
- package/src/commands/ai-script-pipeline-cli.ts +0 -1710
- package/src/commands/ai-script-pipeline.ts +0 -1365
- package/src/commands/ai-suggest-edit.ts +0 -264
- package/src/commands/ai-video-fx.ts +0 -445
- package/src/commands/ai-video.ts +0 -915
- package/src/commands/ai-viral.ts +0 -595
- package/src/commands/ai-visual-fx.ts +0 -601
- package/src/commands/ai.test.ts +0 -627
- package/src/commands/ai.ts +0 -307
- package/src/commands/analyze.ts +0 -282
- package/src/commands/audio.ts +0 -644
- package/src/commands/batch.test.ts +0 -279
- package/src/commands/batch.ts +0 -440
- package/src/commands/detect.ts +0 -329
- package/src/commands/doctor.ts +0 -237
- package/src/commands/edit-cmd.ts +0 -1014
- package/src/commands/export.ts +0 -918
- package/src/commands/generate.ts +0 -2146
- package/src/commands/media.ts +0 -177
- package/src/commands/output.ts +0 -142
- package/src/commands/pipeline.ts +0 -398
- package/src/commands/project.test.ts +0 -127
- package/src/commands/project.ts +0 -149
- package/src/commands/sanitize.ts +0 -60
- package/src/commands/schema.ts +0 -130
- package/src/commands/setup.ts +0 -509
- package/src/commands/timeline.test.ts +0 -499
- package/src/commands/timeline.ts +0 -529
- package/src/commands/validate.ts +0 -77
- package/src/config/config.test.ts +0 -197
- package/src/config/index.ts +0 -125
- package/src/config/schema.ts +0 -82
- package/src/engine/index.ts +0 -2
- package/src/engine/project.test.ts +0 -702
- package/src/engine/project.ts +0 -439
- package/src/index.ts +0 -146
- package/src/utils/api-key.test.ts +0 -41
- package/src/utils/api-key.ts +0 -247
- package/src/utils/audio.ts +0 -83
- package/src/utils/exec-safe.ts +0 -75
- package/src/utils/first-run.ts +0 -52
- package/src/utils/provider-resolver.ts +0 -56
- package/src/utils/remotion.ts +0 -951
- package/src/utils/subtitle.test.ts +0 -227
- package/src/utils/subtitle.ts +0 -169
- package/src/utils/tty.ts +0 -196
- package/tsconfig.json +0 -20
|
@@ -1,279 +0,0 @@
|
|
|
1
|
-
import { describe, it, expect, beforeEach, afterEach } from "vitest";
|
|
2
|
-
import { execSync } from "child_process";
|
|
3
|
-
import {
|
|
4
|
-
readFileSync,
|
|
5
|
-
writeFileSync,
|
|
6
|
-
mkdtempSync,
|
|
7
|
-
mkdirSync,
|
|
8
|
-
rmSync,
|
|
9
|
-
} from "fs";
|
|
10
|
-
import { join, resolve } from "path";
|
|
11
|
-
import { tmpdir } from "os";
|
|
12
|
-
|
|
13
|
-
const CLI = `npx tsx ${resolve(__dirname, "../index.ts")}`;
|
|
14
|
-
|
|
15
|
-
describe("batch commands", () => {
|
|
16
|
-
let tempDir: string;
|
|
17
|
-
let projectFile: string;
|
|
18
|
-
let mediaDir: string;
|
|
19
|
-
|
|
20
|
-
beforeEach(() => {
|
|
21
|
-
tempDir = mkdtempSync(join(tmpdir(), "vibe-batch-test-"));
|
|
22
|
-
projectFile = join(tempDir, "test.vibe.json");
|
|
23
|
-
mediaDir = join(tempDir, "media");
|
|
24
|
-
mkdirSync(mediaDir);
|
|
25
|
-
|
|
26
|
-
// Create project
|
|
27
|
-
execSync(`${CLI} project create "Batch Test" -o "${projectFile}"`, {
|
|
28
|
-
cwd: process.cwd(),
|
|
29
|
-
encoding: "utf-8",
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
// Create dummy media files
|
|
33
|
-
writeFileSync(join(mediaDir, "clip1.mp4"), "dummy video 1");
|
|
34
|
-
writeFileSync(join(mediaDir, "clip2.mp4"), "dummy video 2");
|
|
35
|
-
writeFileSync(join(mediaDir, "clip3.mp4"), "dummy video 3");
|
|
36
|
-
writeFileSync(join(mediaDir, "audio.mp3"), "dummy audio");
|
|
37
|
-
writeFileSync(join(mediaDir, "image.jpg"), "dummy image");
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
afterEach(() => {
|
|
41
|
-
rmSync(tempDir, { recursive: true, force: true });
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
describe("batch import", () => {
|
|
45
|
-
it("imports all media files from directory", () => {
|
|
46
|
-
execSync(`${CLI} batch import "${projectFile}" "${mediaDir}"`, {
|
|
47
|
-
cwd: process.cwd(),
|
|
48
|
-
encoding: "utf-8",
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
const content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
52
|
-
expect(content.state.sources).toHaveLength(5);
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
it("filters files by extension", () => {
|
|
56
|
-
execSync(
|
|
57
|
-
`${CLI} batch import "${projectFile}" "${mediaDir}" --filter ".mp4"`,
|
|
58
|
-
{ cwd: process.cwd(), encoding: "utf-8" }
|
|
59
|
-
);
|
|
60
|
-
|
|
61
|
-
const content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
62
|
-
expect(content.state.sources).toHaveLength(3);
|
|
63
|
-
expect(content.state.sources.every((s: any) => s.name.endsWith(".mp4"))).toBe(
|
|
64
|
-
true
|
|
65
|
-
);
|
|
66
|
-
});
|
|
67
|
-
|
|
68
|
-
it("imports recursively", () => {
|
|
69
|
-
// Create subdirectory with media
|
|
70
|
-
const subDir = join(mediaDir, "subdir");
|
|
71
|
-
mkdirSync(subDir);
|
|
72
|
-
writeFileSync(join(subDir, "nested.mp4"), "nested video");
|
|
73
|
-
|
|
74
|
-
execSync(`${CLI} batch import "${projectFile}" "${mediaDir}" -r`, {
|
|
75
|
-
cwd: process.cwd(),
|
|
76
|
-
encoding: "utf-8",
|
|
77
|
-
});
|
|
78
|
-
|
|
79
|
-
const content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
80
|
-
expect(content.state.sources).toHaveLength(6);
|
|
81
|
-
});
|
|
82
|
-
});
|
|
83
|
-
|
|
84
|
-
describe("batch concat", () => {
|
|
85
|
-
beforeEach(() => {
|
|
86
|
-
// Import media first
|
|
87
|
-
execSync(
|
|
88
|
-
`${CLI} batch import "${projectFile}" "${mediaDir}" --filter ".mp4"`,
|
|
89
|
-
{ cwd: process.cwd(), encoding: "utf-8" }
|
|
90
|
-
);
|
|
91
|
-
|
|
92
|
-
// Set durations for sources
|
|
93
|
-
const content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
94
|
-
content.state.sources.forEach((s: any, i: number) => {
|
|
95
|
-
s.duration = 5 + i; // 5, 6, 7 seconds
|
|
96
|
-
});
|
|
97
|
-
writeFileSync(projectFile, JSON.stringify(content, null, 2), "utf-8");
|
|
98
|
-
});
|
|
99
|
-
|
|
100
|
-
it("concatenates all sources", () => {
|
|
101
|
-
execSync(`${CLI} batch concat "${projectFile}" --all`, {
|
|
102
|
-
cwd: process.cwd(),
|
|
103
|
-
encoding: "utf-8",
|
|
104
|
-
});
|
|
105
|
-
|
|
106
|
-
const content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
107
|
-
expect(content.state.clips).toHaveLength(3);
|
|
108
|
-
|
|
109
|
-
// Check sequential positioning
|
|
110
|
-
const clips = content.state.clips;
|
|
111
|
-
expect(clips[0].startTime).toBe(0);
|
|
112
|
-
expect(clips[1].startTime).toBe(clips[0].duration);
|
|
113
|
-
expect(clips[2].startTime).toBe(clips[0].duration + clips[1].duration);
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
it("concatenates with gap between clips", () => {
|
|
117
|
-
execSync(`${CLI} batch concat "${projectFile}" --all --gap 2`, {
|
|
118
|
-
cwd: process.cwd(),
|
|
119
|
-
encoding: "utf-8",
|
|
120
|
-
});
|
|
121
|
-
|
|
122
|
-
const content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
123
|
-
const clips = content.state.clips;
|
|
124
|
-
|
|
125
|
-
expect(clips[1].startTime).toBe(clips[0].duration + 2);
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
it("concatenates from specific start time", () => {
|
|
129
|
-
execSync(`${CLI} batch concat "${projectFile}" --all --start 10`, {
|
|
130
|
-
cwd: process.cwd(),
|
|
131
|
-
encoding: "utf-8",
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
const content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
135
|
-
expect(content.state.clips[0].startTime).toBe(10);
|
|
136
|
-
});
|
|
137
|
-
});
|
|
138
|
-
|
|
139
|
-
describe("batch apply-effect", () => {
|
|
140
|
-
let clipIds: string[];
|
|
141
|
-
|
|
142
|
-
beforeEach(() => {
|
|
143
|
-
// Import and concat
|
|
144
|
-
execSync(
|
|
145
|
-
`${CLI} batch import "${projectFile}" "${mediaDir}" --filter ".mp4"`,
|
|
146
|
-
{ cwd: process.cwd(), encoding: "utf-8" }
|
|
147
|
-
);
|
|
148
|
-
|
|
149
|
-
let content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
150
|
-
content.state.sources.forEach((s: any) => {
|
|
151
|
-
s.duration = 5;
|
|
152
|
-
});
|
|
153
|
-
writeFileSync(projectFile, JSON.stringify(content, null, 2), "utf-8");
|
|
154
|
-
|
|
155
|
-
execSync(`${CLI} batch concat "${projectFile}" --all`, {
|
|
156
|
-
cwd: process.cwd(),
|
|
157
|
-
encoding: "utf-8",
|
|
158
|
-
});
|
|
159
|
-
|
|
160
|
-
content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
161
|
-
clipIds = content.state.clips.map((c: any) => c.id);
|
|
162
|
-
});
|
|
163
|
-
|
|
164
|
-
it("applies effect to all clips", () => {
|
|
165
|
-
execSync(`${CLI} batch apply-effect "${projectFile}" fadeIn --all`, {
|
|
166
|
-
cwd: process.cwd(),
|
|
167
|
-
encoding: "utf-8",
|
|
168
|
-
});
|
|
169
|
-
|
|
170
|
-
const content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
171
|
-
expect(content.state.clips[0].effects).toHaveLength(1);
|
|
172
|
-
expect(content.state.clips[1].effects).toHaveLength(1);
|
|
173
|
-
expect(content.state.clips[2].effects).toHaveLength(1);
|
|
174
|
-
expect(content.state.clips[0].effects[0].type).toBe("fadeIn");
|
|
175
|
-
});
|
|
176
|
-
|
|
177
|
-
it("applies effect with custom duration", () => {
|
|
178
|
-
execSync(
|
|
179
|
-
`${CLI} batch apply-effect "${projectFile}" fadeOut --all -d 2`,
|
|
180
|
-
{ cwd: process.cwd(), encoding: "utf-8" }
|
|
181
|
-
);
|
|
182
|
-
|
|
183
|
-
const content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
184
|
-
expect(content.state.clips[0].effects[0].duration).toBe(2);
|
|
185
|
-
});
|
|
186
|
-
|
|
187
|
-
it("applies effect to specific clips", () => {
|
|
188
|
-
execSync(
|
|
189
|
-
`${CLI} batch apply-effect "${projectFile}" blur ${clipIds[0]} ${clipIds[2]}`,
|
|
190
|
-
{ cwd: process.cwd(), encoding: "utf-8" }
|
|
191
|
-
);
|
|
192
|
-
|
|
193
|
-
const content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
194
|
-
expect(content.state.clips[0].effects).toHaveLength(1);
|
|
195
|
-
expect(content.state.clips[1].effects).toHaveLength(0);
|
|
196
|
-
expect(content.state.clips[2].effects).toHaveLength(1);
|
|
197
|
-
});
|
|
198
|
-
});
|
|
199
|
-
|
|
200
|
-
describe("batch remove-clips", () => {
|
|
201
|
-
beforeEach(() => {
|
|
202
|
-
// Import and concat
|
|
203
|
-
execSync(
|
|
204
|
-
`${CLI} batch import "${projectFile}" "${mediaDir}" --filter ".mp4"`,
|
|
205
|
-
{ cwd: process.cwd(), encoding: "utf-8" }
|
|
206
|
-
);
|
|
207
|
-
|
|
208
|
-
const content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
209
|
-
content.state.sources.forEach((s: any) => {
|
|
210
|
-
s.duration = 5;
|
|
211
|
-
});
|
|
212
|
-
writeFileSync(projectFile, JSON.stringify(content, null, 2), "utf-8");
|
|
213
|
-
|
|
214
|
-
execSync(`${CLI} batch concat "${projectFile}" --all`, {
|
|
215
|
-
cwd: process.cwd(),
|
|
216
|
-
encoding: "utf-8",
|
|
217
|
-
});
|
|
218
|
-
});
|
|
219
|
-
|
|
220
|
-
it("removes all clips", () => {
|
|
221
|
-
const before = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
222
|
-
expect(before.state.clips).toHaveLength(3);
|
|
223
|
-
|
|
224
|
-
execSync(`${CLI} batch remove-clips "${projectFile}" --all`, {
|
|
225
|
-
cwd: process.cwd(),
|
|
226
|
-
encoding: "utf-8",
|
|
227
|
-
});
|
|
228
|
-
|
|
229
|
-
const content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
230
|
-
expect(content.state.clips).toHaveLength(0);
|
|
231
|
-
});
|
|
232
|
-
|
|
233
|
-
it("removes specific clips", () => {
|
|
234
|
-
const before = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
235
|
-
const clipId = before.state.clips[0].id;
|
|
236
|
-
|
|
237
|
-
execSync(`${CLI} batch remove-clips "${projectFile}" ${clipId}`, {
|
|
238
|
-
cwd: process.cwd(),
|
|
239
|
-
encoding: "utf-8",
|
|
240
|
-
});
|
|
241
|
-
|
|
242
|
-
const content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
243
|
-
expect(content.state.clips).toHaveLength(2);
|
|
244
|
-
});
|
|
245
|
-
});
|
|
246
|
-
|
|
247
|
-
describe("batch info", () => {
|
|
248
|
-
beforeEach(() => {
|
|
249
|
-
// Import and concat
|
|
250
|
-
execSync(
|
|
251
|
-
`${CLI} batch import "${projectFile}" "${mediaDir}" --filter ".mp4"`,
|
|
252
|
-
{ cwd: process.cwd(), encoding: "utf-8" }
|
|
253
|
-
);
|
|
254
|
-
|
|
255
|
-
const content = JSON.parse(readFileSync(projectFile, "utf-8"));
|
|
256
|
-
content.state.sources.forEach((s: any) => {
|
|
257
|
-
s.duration = 5;
|
|
258
|
-
});
|
|
259
|
-
writeFileSync(projectFile, JSON.stringify(content, null, 2), "utf-8");
|
|
260
|
-
|
|
261
|
-
execSync(`${CLI} batch concat "${projectFile}" --all`, {
|
|
262
|
-
cwd: process.cwd(),
|
|
263
|
-
encoding: "utf-8",
|
|
264
|
-
});
|
|
265
|
-
});
|
|
266
|
-
|
|
267
|
-
it("shows project statistics", () => {
|
|
268
|
-
const output = execSync(`${CLI} batch info "${projectFile}"`, {
|
|
269
|
-
cwd: process.cwd(),
|
|
270
|
-
encoding: "utf-8",
|
|
271
|
-
});
|
|
272
|
-
|
|
273
|
-
expect(output).toContain("Sources:");
|
|
274
|
-
expect(output).toContain("Clips:");
|
|
275
|
-
expect(output).toContain("Timeline:");
|
|
276
|
-
expect(output).toContain("3"); // 3 sources/clips
|
|
277
|
-
});
|
|
278
|
-
});
|
|
279
|
-
});
|