@vibeframe/cli 0.111.3 → 0.112.1
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/build-plan.d.ts +9 -0
- package/dist/commands/_shared/project-list.d.ts +39 -0
- package/dist/commands/_shared/project-list.test.d.ts +1 -0
- package/dist/index.js +300 -153
- package/dist/tools/manifest/index.js +271 -128
- package/dist/tools/manifest/project.d.ts +9 -1
- package/package.json +3 -3
|
@@ -969,7 +969,7 @@ function errorMessage(error) {
|
|
|
969
969
|
return error instanceof Error ? error.message : "Unknown error";
|
|
970
970
|
}
|
|
971
971
|
function sleep(ms) {
|
|
972
|
-
return new Promise((
|
|
972
|
+
return new Promise((resolve66) => setTimeout(resolve66, ms));
|
|
973
973
|
}
|
|
974
974
|
var ProviderHttpError;
|
|
975
975
|
var init_http = __esm({
|
|
@@ -4737,15 +4737,15 @@ async function loadKokoroFactory() {
|
|
|
4737
4737
|
}
|
|
4738
4738
|
async function loadKokoroFromWorkspace(baseDir = process.cwd()) {
|
|
4739
4739
|
try {
|
|
4740
|
-
const { readFile:
|
|
4741
|
-
const { join:
|
|
4740
|
+
const { readFile: readFile45 } = await import("node:fs/promises");
|
|
4741
|
+
const { join: join27, resolve: resolve66 } = await import("node:path");
|
|
4742
4742
|
const { pathToFileURL } = await import("node:url");
|
|
4743
|
-
const pkgDir =
|
|
4744
|
-
const pkg = JSON.parse(await
|
|
4743
|
+
const pkgDir = resolve66(baseDir, "node_modules", "kokoro-js");
|
|
4744
|
+
const pkg = JSON.parse(await readFile45(join27(pkgDir, "package.json"), "utf-8"));
|
|
4745
4745
|
const entry = pkg.exports?.node?.import ?? pkg.exports?.default ?? pkg.module ?? pkg.main;
|
|
4746
4746
|
if (!entry)
|
|
4747
4747
|
return null;
|
|
4748
|
-
const mod = await import(pathToFileURL(
|
|
4748
|
+
const mod = await import(pathToFileURL(join27(pkgDir, entry)).href);
|
|
4749
4749
|
return mod.KokoroTTS ?? null;
|
|
4750
4750
|
} catch {
|
|
4751
4751
|
return null;
|
|
@@ -5403,7 +5403,7 @@ var init_RunwayProvider = __esm({
|
|
|
5403
5403
|
* Sleep helper
|
|
5404
5404
|
*/
|
|
5405
5405
|
sleep(ms) {
|
|
5406
|
-
return new Promise((
|
|
5406
|
+
return new Promise((resolve66) => setTimeout(resolve66, ms));
|
|
5407
5407
|
}
|
|
5408
5408
|
};
|
|
5409
5409
|
RunwayProvider.API_VERSION = "2024-11-06";
|
|
@@ -5844,7 +5844,7 @@ var init_KlingProvider = __esm({
|
|
|
5844
5844
|
* Sleep helper
|
|
5845
5845
|
*/
|
|
5846
5846
|
sleep(ms) {
|
|
5847
|
-
return new Promise((
|
|
5847
|
+
return new Promise((resolve66) => setTimeout(resolve66, ms));
|
|
5848
5848
|
}
|
|
5849
5849
|
};
|
|
5850
5850
|
klingProvider = new KlingProvider();
|
|
@@ -6162,7 +6162,7 @@ var init_GrokProvider = __esm({
|
|
|
6162
6162
|
}
|
|
6163
6163
|
}
|
|
6164
6164
|
sleep(ms) {
|
|
6165
|
-
return new Promise((
|
|
6165
|
+
return new Promise((resolve66) => setTimeout(resolve66, ms));
|
|
6166
6166
|
}
|
|
6167
6167
|
};
|
|
6168
6168
|
grokProvider = new GrokProvider();
|
|
@@ -6197,11 +6197,11 @@ var require_middleware = __commonJS({
|
|
|
6197
6197
|
"use strict";
|
|
6198
6198
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
6199
6199
|
function adopt(value) {
|
|
6200
|
-
return value instanceof P ? value : new P(function(
|
|
6201
|
-
|
|
6200
|
+
return value instanceof P ? value : new P(function(resolve66) {
|
|
6201
|
+
resolve66(value);
|
|
6202
6202
|
});
|
|
6203
6203
|
}
|
|
6204
|
-
return new (P || (P = Promise))(function(
|
|
6204
|
+
return new (P || (P = Promise))(function(resolve66, reject) {
|
|
6205
6205
|
function fulfilled(value) {
|
|
6206
6206
|
try {
|
|
6207
6207
|
step(generator.next(value));
|
|
@@ -6217,7 +6217,7 @@ var require_middleware = __commonJS({
|
|
|
6217
6217
|
}
|
|
6218
6218
|
}
|
|
6219
6219
|
function step(result) {
|
|
6220
|
-
result.done ?
|
|
6220
|
+
result.done ? resolve66(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
6221
6221
|
}
|
|
6222
6222
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
6223
6223
|
});
|
|
@@ -6302,11 +6302,11 @@ var require_response = __commonJS({
|
|
|
6302
6302
|
"use strict";
|
|
6303
6303
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
6304
6304
|
function adopt(value) {
|
|
6305
|
-
return value instanceof P ? value : new P(function(
|
|
6306
|
-
|
|
6305
|
+
return value instanceof P ? value : new P(function(resolve66) {
|
|
6306
|
+
resolve66(value);
|
|
6307
6307
|
});
|
|
6308
6308
|
}
|
|
6309
|
-
return new (P || (P = Promise))(function(
|
|
6309
|
+
return new (P || (P = Promise))(function(resolve66, reject) {
|
|
6310
6310
|
function fulfilled(value) {
|
|
6311
6311
|
try {
|
|
6312
6312
|
step(generator.next(value));
|
|
@@ -6322,7 +6322,7 @@ var require_response = __commonJS({
|
|
|
6322
6322
|
}
|
|
6323
6323
|
}
|
|
6324
6324
|
function step(result) {
|
|
6325
|
-
result.done ?
|
|
6325
|
+
result.done ? resolve66(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
6326
6326
|
}
|
|
6327
6327
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
6328
6328
|
});
|
|
@@ -6429,11 +6429,11 @@ var require_utils = __commonJS({
|
|
|
6429
6429
|
"use strict";
|
|
6430
6430
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
6431
6431
|
function adopt(value) {
|
|
6432
|
-
return value instanceof P ? value : new P(function(
|
|
6433
|
-
|
|
6432
|
+
return value instanceof P ? value : new P(function(resolve66) {
|
|
6433
|
+
resolve66(value);
|
|
6434
6434
|
});
|
|
6435
6435
|
}
|
|
6436
|
-
return new (P || (P = Promise))(function(
|
|
6436
|
+
return new (P || (P = Promise))(function(resolve66, reject) {
|
|
6437
6437
|
function fulfilled(value) {
|
|
6438
6438
|
try {
|
|
6439
6439
|
step(generator.next(value));
|
|
@@ -6449,7 +6449,7 @@ var require_utils = __commonJS({
|
|
|
6449
6449
|
}
|
|
6450
6450
|
}
|
|
6451
6451
|
function step(result) {
|
|
6452
|
-
result.done ?
|
|
6452
|
+
result.done ? resolve66(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
6453
6453
|
}
|
|
6454
6454
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
6455
6455
|
});
|
|
@@ -6542,7 +6542,7 @@ var require_utils = __commonJS({
|
|
|
6542
6542
|
}
|
|
6543
6543
|
function sleep4(ms) {
|
|
6544
6544
|
return __awaiter(this, void 0, void 0, function* () {
|
|
6545
|
-
return new Promise((
|
|
6545
|
+
return new Promise((resolve66) => setTimeout(resolve66, ms));
|
|
6546
6546
|
});
|
|
6547
6547
|
}
|
|
6548
6548
|
}
|
|
@@ -6554,11 +6554,11 @@ var require_retry = __commonJS({
|
|
|
6554
6554
|
"use strict";
|
|
6555
6555
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
6556
6556
|
function adopt(value) {
|
|
6557
|
-
return value instanceof P ? value : new P(function(
|
|
6558
|
-
|
|
6557
|
+
return value instanceof P ? value : new P(function(resolve66) {
|
|
6558
|
+
resolve66(value);
|
|
6559
6559
|
});
|
|
6560
6560
|
}
|
|
6561
|
-
return new (P || (P = Promise))(function(
|
|
6561
|
+
return new (P || (P = Promise))(function(resolve66, reject) {
|
|
6562
6562
|
function fulfilled(value) {
|
|
6563
6563
|
try {
|
|
6564
6564
|
step(generator.next(value));
|
|
@@ -6574,7 +6574,7 @@ var require_retry = __commonJS({
|
|
|
6574
6574
|
}
|
|
6575
6575
|
}
|
|
6576
6576
|
function step(result) {
|
|
6577
|
-
result.done ?
|
|
6577
|
+
result.done ? resolve66(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
6578
6578
|
}
|
|
6579
6579
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
6580
6580
|
});
|
|
@@ -6781,11 +6781,11 @@ var require_request = __commonJS({
|
|
|
6781
6781
|
"use strict";
|
|
6782
6782
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
6783
6783
|
function adopt(value) {
|
|
6784
|
-
return value instanceof P ? value : new P(function(
|
|
6785
|
-
|
|
6784
|
+
return value instanceof P ? value : new P(function(resolve66) {
|
|
6785
|
+
resolve66(value);
|
|
6786
6786
|
});
|
|
6787
6787
|
}
|
|
6788
|
-
return new (P || (P = Promise))(function(
|
|
6788
|
+
return new (P || (P = Promise))(function(resolve66, reject) {
|
|
6789
6789
|
function fulfilled(value) {
|
|
6790
6790
|
try {
|
|
6791
6791
|
step(generator.next(value));
|
|
@@ -6801,7 +6801,7 @@ var require_request = __commonJS({
|
|
|
6801
6801
|
}
|
|
6802
6802
|
}
|
|
6803
6803
|
function step(result) {
|
|
6804
|
-
result.done ?
|
|
6804
|
+
result.done ? resolve66(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
6805
6805
|
}
|
|
6806
6806
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
6807
6807
|
});
|
|
@@ -6888,11 +6888,11 @@ var require_storage = __commonJS({
|
|
|
6888
6888
|
"use strict";
|
|
6889
6889
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
6890
6890
|
function adopt(value) {
|
|
6891
|
-
return value instanceof P ? value : new P(function(
|
|
6892
|
-
|
|
6891
|
+
return value instanceof P ? value : new P(function(resolve66) {
|
|
6892
|
+
resolve66(value);
|
|
6893
6893
|
});
|
|
6894
6894
|
}
|
|
6895
|
-
return new (P || (P = Promise))(function(
|
|
6895
|
+
return new (P || (P = Promise))(function(resolve66, reject) {
|
|
6896
6896
|
function fulfilled(value) {
|
|
6897
6897
|
try {
|
|
6898
6898
|
step(generator.next(value));
|
|
@@ -6908,7 +6908,7 @@ var require_storage = __commonJS({
|
|
|
6908
6908
|
}
|
|
6909
6909
|
}
|
|
6910
6910
|
function step(result) {
|
|
6911
|
-
result.done ?
|
|
6911
|
+
result.done ? resolve66(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
6912
6912
|
}
|
|
6913
6913
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
6914
6914
|
});
|
|
@@ -7236,11 +7236,11 @@ var require_auth = __commonJS({
|
|
|
7236
7236
|
"use strict";
|
|
7237
7237
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
7238
7238
|
function adopt(value) {
|
|
7239
|
-
return value instanceof P ? value : new P(function(
|
|
7240
|
-
|
|
7239
|
+
return value instanceof P ? value : new P(function(resolve66) {
|
|
7240
|
+
resolve66(value);
|
|
7241
7241
|
});
|
|
7242
7242
|
}
|
|
7243
|
-
return new (P || (P = Promise))(function(
|
|
7243
|
+
return new (P || (P = Promise))(function(resolve66, reject) {
|
|
7244
7244
|
function fulfilled(value) {
|
|
7245
7245
|
try {
|
|
7246
7246
|
step(generator.next(value));
|
|
@@ -7256,7 +7256,7 @@ var require_auth = __commonJS({
|
|
|
7256
7256
|
}
|
|
7257
7257
|
}
|
|
7258
7258
|
function step(result) {
|
|
7259
|
-
result.done ?
|
|
7259
|
+
result.done ? resolve66(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
7260
7260
|
}
|
|
7261
7261
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
7262
7262
|
});
|
|
@@ -7295,11 +7295,11 @@ var require_streaming = __commonJS({
|
|
|
7295
7295
|
"use strict";
|
|
7296
7296
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
7297
7297
|
function adopt(value) {
|
|
7298
|
-
return value instanceof P ? value : new P(function(
|
|
7299
|
-
|
|
7298
|
+
return value instanceof P ? value : new P(function(resolve66) {
|
|
7299
|
+
resolve66(value);
|
|
7300
7300
|
});
|
|
7301
7301
|
}
|
|
7302
|
-
return new (P || (P = Promise))(function(
|
|
7302
|
+
return new (P || (P = Promise))(function(resolve66, reject) {
|
|
7303
7303
|
function fulfilled(value) {
|
|
7304
7304
|
try {
|
|
7305
7305
|
step(generator.next(value));
|
|
@@ -7315,7 +7315,7 @@ var require_streaming = __commonJS({
|
|
|
7315
7315
|
}
|
|
7316
7316
|
}
|
|
7317
7317
|
function step(result) {
|
|
7318
|
-
result.done ?
|
|
7318
|
+
result.done ? resolve66(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
7319
7319
|
}
|
|
7320
7320
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
7321
7321
|
});
|
|
@@ -7548,7 +7548,7 @@ var require_streaming = __commonJS({
|
|
|
7548
7548
|
query: options.queryParams
|
|
7549
7549
|
});
|
|
7550
7550
|
this.options = options;
|
|
7551
|
-
this.donePromise = new Promise((
|
|
7551
|
+
this.donePromise = new Promise((resolve66, reject) => {
|
|
7552
7552
|
if (this.streamClosed) {
|
|
7553
7553
|
reject(new response_1.ApiError({
|
|
7554
7554
|
message: "Streaming connection is already closed.",
|
|
@@ -7559,11 +7559,11 @@ var require_streaming = __commonJS({
|
|
|
7559
7559
|
}
|
|
7560
7560
|
this.signal.addEventListener("abort", () => {
|
|
7561
7561
|
var _a2;
|
|
7562
|
-
|
|
7562
|
+
resolve66((_a2 = this.currentData) !== null && _a2 !== void 0 ? _a2 : {});
|
|
7563
7563
|
});
|
|
7564
7564
|
this.on("done", (data) => {
|
|
7565
7565
|
this.streamClosed = true;
|
|
7566
|
-
|
|
7566
|
+
resolve66(data);
|
|
7567
7567
|
});
|
|
7568
7568
|
this.on("error", (error) => {
|
|
7569
7569
|
this.streamClosed = true;
|
|
@@ -7588,7 +7588,7 @@ var require_streaming = __commonJS({
|
|
|
7588
7588
|
if (data) {
|
|
7589
7589
|
yield yield __await(data);
|
|
7590
7590
|
}
|
|
7591
|
-
yield __await(new Promise((
|
|
7591
|
+
yield __await(new Promise((resolve66) => setTimeout(resolve66, 16)));
|
|
7592
7592
|
}
|
|
7593
7593
|
});
|
|
7594
7594
|
}
|
|
@@ -7633,11 +7633,11 @@ var require_queue = __commonJS({
|
|
|
7633
7633
|
"use strict";
|
|
7634
7634
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
7635
7635
|
function adopt(value) {
|
|
7636
|
-
return value instanceof P ? value : new P(function(
|
|
7637
|
-
|
|
7636
|
+
return value instanceof P ? value : new P(function(resolve66) {
|
|
7637
|
+
resolve66(value);
|
|
7638
7638
|
});
|
|
7639
7639
|
}
|
|
7640
|
-
return new (P || (P = Promise))(function(
|
|
7640
|
+
return new (P || (P = Promise))(function(resolve66, reject) {
|
|
7641
7641
|
function fulfilled(value) {
|
|
7642
7642
|
try {
|
|
7643
7643
|
step(generator.next(value));
|
|
@@ -7653,7 +7653,7 @@ var require_queue = __commonJS({
|
|
|
7653
7653
|
}
|
|
7654
7654
|
}
|
|
7655
7655
|
function step(result) {
|
|
7656
|
-
result.done ?
|
|
7656
|
+
result.done ? resolve66(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
7657
7657
|
}
|
|
7658
7658
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
7659
7659
|
});
|
|
@@ -7788,7 +7788,7 @@ var require_queue = __commonJS({
|
|
|
7788
7788
|
}
|
|
7789
7789
|
return doneStatus;
|
|
7790
7790
|
}
|
|
7791
|
-
return new Promise((
|
|
7791
|
+
return new Promise((resolve66, reject) => {
|
|
7792
7792
|
var _a;
|
|
7793
7793
|
let pollingTimeoutId;
|
|
7794
7794
|
const pollInterval = "pollInterval" in options && typeof options.pollInterval === "number" ? (_a = options.pollInterval) !== null && _a !== void 0 ? _a : DEFAULT_POLL_INTERVAL : DEFAULT_POLL_INTERVAL;
|
|
@@ -7820,7 +7820,7 @@ var require_queue = __commonJS({
|
|
|
7820
7820
|
}
|
|
7821
7821
|
if (requestStatus.status === "COMPLETED") {
|
|
7822
7822
|
clearScheduledTasks();
|
|
7823
|
-
|
|
7823
|
+
resolve66(requestStatus);
|
|
7824
7824
|
return;
|
|
7825
7825
|
}
|
|
7826
7826
|
pollingTimeoutId = setTimeout(poll, pollInterval);
|
|
@@ -9781,11 +9781,11 @@ var require_realtime = __commonJS({
|
|
|
9781
9781
|
"use strict";
|
|
9782
9782
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
9783
9783
|
function adopt(value) {
|
|
9784
|
-
return value instanceof P ? value : new P(function(
|
|
9785
|
-
|
|
9784
|
+
return value instanceof P ? value : new P(function(resolve66) {
|
|
9785
|
+
resolve66(value);
|
|
9786
9786
|
});
|
|
9787
9787
|
}
|
|
9788
|
-
return new (P || (P = Promise))(function(
|
|
9788
|
+
return new (P || (P = Promise))(function(resolve66, reject) {
|
|
9789
9789
|
function fulfilled(value) {
|
|
9790
9790
|
try {
|
|
9791
9791
|
step(generator.next(value));
|
|
@@ -9801,7 +9801,7 @@ var require_realtime = __commonJS({
|
|
|
9801
9801
|
}
|
|
9802
9802
|
}
|
|
9803
9803
|
function step(result) {
|
|
9804
|
-
result.done ?
|
|
9804
|
+
result.done ? resolve66(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
9805
9805
|
}
|
|
9806
9806
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9807
9807
|
});
|
|
@@ -10126,11 +10126,11 @@ var require_client = __commonJS({
|
|
|
10126
10126
|
"use strict";
|
|
10127
10127
|
var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
|
|
10128
10128
|
function adopt(value) {
|
|
10129
|
-
return value instanceof P ? value : new P(function(
|
|
10130
|
-
|
|
10129
|
+
return value instanceof P ? value : new P(function(resolve66) {
|
|
10130
|
+
resolve66(value);
|
|
10131
10131
|
});
|
|
10132
10132
|
}
|
|
10133
|
-
return new (P || (P = Promise))(function(
|
|
10133
|
+
return new (P || (P = Promise))(function(resolve66, reject) {
|
|
10134
10134
|
function fulfilled(value) {
|
|
10135
10135
|
try {
|
|
10136
10136
|
step(generator.next(value));
|
|
@@ -10146,7 +10146,7 @@ var require_client = __commonJS({
|
|
|
10146
10146
|
}
|
|
10147
10147
|
}
|
|
10148
10148
|
function step(result) {
|
|
10149
|
-
result.done ?
|
|
10149
|
+
result.done ? resolve66(result.value) : adopt(result.value).then(fulfilled, rejected);
|
|
10150
10150
|
}
|
|
10151
10151
|
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
10152
10152
|
});
|
|
@@ -10831,7 +10831,7 @@ var init_ReplicateProvider = __esm({
|
|
|
10831
10831
|
* Sleep helper
|
|
10832
10832
|
*/
|
|
10833
10833
|
sleep(ms) {
|
|
10834
|
-
return new Promise((
|
|
10834
|
+
return new Promise((resolve66) => setTimeout(resolve66, ms));
|
|
10835
10835
|
}
|
|
10836
10836
|
/**
|
|
10837
10837
|
* Generate music from text prompt using MusicGen
|
|
@@ -19591,7 +19591,7 @@ var init_ai_helpers = __esm({
|
|
|
19591
19591
|
import { writeFile as writeFile2, unlink, rename } from "node:fs/promises";
|
|
19592
19592
|
import { resolve as resolve2, basename } from "node:path";
|
|
19593
19593
|
function sleep2(ms) {
|
|
19594
|
-
return new Promise((
|
|
19594
|
+
return new Promise((resolve66) => setTimeout(resolve66, ms));
|
|
19595
19595
|
}
|
|
19596
19596
|
async function uploadToImgbb(imageBuffer, apiKey) {
|
|
19597
19597
|
try {
|
|
@@ -20336,7 +20336,7 @@ async function prompt(question, hidden = false) {
|
|
|
20336
20336
|
input: process.stdin,
|
|
20337
20337
|
output: process.stdout
|
|
20338
20338
|
});
|
|
20339
|
-
return new Promise((
|
|
20339
|
+
return new Promise((resolve66) => {
|
|
20340
20340
|
if (hidden && process.stdin.isTTY) {
|
|
20341
20341
|
process.stdout.write(question);
|
|
20342
20342
|
let input = "";
|
|
@@ -20350,7 +20350,7 @@ async function prompt(question, hidden = false) {
|
|
|
20350
20350
|
process.stdin.removeListener("data", onData);
|
|
20351
20351
|
process.stdout.write("\n");
|
|
20352
20352
|
rl.close();
|
|
20353
|
-
|
|
20353
|
+
resolve66(input);
|
|
20354
20354
|
} else if (char === "") {
|
|
20355
20355
|
process.exit(1);
|
|
20356
20356
|
} else if (char === "\x7F" || char === "\b") {
|
|
@@ -20365,7 +20365,7 @@ async function prompt(question, hidden = false) {
|
|
|
20365
20365
|
} else {
|
|
20366
20366
|
rl.question(question, (answer) => {
|
|
20367
20367
|
rl.close();
|
|
20368
|
-
|
|
20368
|
+
resolve66(answer);
|
|
20369
20369
|
});
|
|
20370
20370
|
}
|
|
20371
20371
|
});
|
|
@@ -24993,7 +24993,7 @@ function unique(items) {
|
|
|
24993
24993
|
];
|
|
24994
24994
|
}
|
|
24995
24995
|
function sleep3(ms) {
|
|
24996
|
-
return new Promise((
|
|
24996
|
+
return new Promise((resolve66) => setTimeout(resolve66, ms));
|
|
24997
24997
|
}
|
|
24998
24998
|
var LOCAL_JOB_ORPHAN_AFTER_MS;
|
|
24999
24999
|
var init_status_jobs = __esm({
|
|
@@ -32697,6 +32697,9 @@ var init_storyboard_edit = __esm({
|
|
|
32697
32697
|
import { existsSync as existsSync17 } from "node:fs";
|
|
32698
32698
|
import { readFile as readFile17 } from "node:fs/promises";
|
|
32699
32699
|
import { dirname as dirname9, join as join15, resolve as resolve22 } from "node:path";
|
|
32700
|
+
function backdropCostUsd(quality) {
|
|
32701
|
+
return quality === "hd" ? 0.2 : 0.05;
|
|
32702
|
+
}
|
|
32700
32703
|
async function createBuildPlan(opts) {
|
|
32701
32704
|
const projectDir = resolve22(opts.projectDir);
|
|
32702
32705
|
loadPlanEnv(projectDir);
|
|
@@ -32852,7 +32855,7 @@ async function createBuildPlan(opts) {
|
|
|
32852
32855
|
reference: backdropReference,
|
|
32853
32856
|
projectDir,
|
|
32854
32857
|
force: opts.force,
|
|
32855
|
-
cost:
|
|
32858
|
+
cost: backdropCostUsd(imageQuality),
|
|
32856
32859
|
active: includeAssets
|
|
32857
32860
|
}) : null;
|
|
32858
32861
|
const video = videoCue && !opts.skipVideo ? assetPlan({
|
|
@@ -33328,7 +33331,7 @@ function loadPlanEnv(projectDir) {
|
|
|
33328
33331
|
dir = dirname9(dir);
|
|
33329
33332
|
}
|
|
33330
33333
|
}
|
|
33331
|
-
var import_dotenv2,
|
|
33334
|
+
var import_dotenv2, VIDEO_COST_USD, MUSIC_COST_USD, ELEVENLABS_NARRATION_COST_USD, COMPOSE_COST_USD, SUPPORTED_BUILD_IMAGE_PROVIDERS;
|
|
33332
33335
|
var init_build_plan = __esm({
|
|
33333
33336
|
"src/commands/_shared/build-plan.ts"() {
|
|
33334
33337
|
"use strict";
|
|
@@ -33343,7 +33346,6 @@ var init_build_plan = __esm({
|
|
|
33343
33346
|
init_storyboard_parse();
|
|
33344
33347
|
init_project_config();
|
|
33345
33348
|
init_storyboard_edit();
|
|
33346
|
-
BACKDROP_COST_USD = 3;
|
|
33347
33349
|
VIDEO_COST_USD = 5;
|
|
33348
33350
|
MUSIC_COST_USD = 0.5;
|
|
33349
33351
|
ELEVENLABS_NARRATION_COST_USD = 0.05;
|
|
@@ -33864,7 +33866,10 @@ async function executeSceneBuild(opts) {
|
|
|
33864
33866
|
(beat) => beat.narrationStatus === "failed" || beat.backdropStatus === "failed" || beat.videoStatus === "failed" || beat.musicStatus === "failed"
|
|
33865
33867
|
);
|
|
33866
33868
|
stageReports.assets.status = assetFailed ? "failed" : pendingJobs.length > 0 ? "pending-jobs" : "done";
|
|
33867
|
-
stageReports.assets.costUsd = estimateActualAssetCost(
|
|
33869
|
+
stageReports.assets.costUsd = estimateActualAssetCost(
|
|
33870
|
+
beatOutcomes,
|
|
33871
|
+
opts.imageQuality ?? "hd"
|
|
33872
|
+
);
|
|
33868
33873
|
stageReports.assets.retryWith = pendingJobs.map(
|
|
33869
33874
|
(job) => `vibe status job ${job.id} --project ${projectDir} --json`
|
|
33870
33875
|
);
|
|
@@ -35047,11 +35052,11 @@ function shouldRunStage(selected, stage) {
|
|
|
35047
35052
|
if (selected === "all") return true;
|
|
35048
35053
|
return selected === stage;
|
|
35049
35054
|
}
|
|
35050
|
-
function estimateActualAssetCost(outcomes) {
|
|
35055
|
+
function estimateActualAssetCost(outcomes, imageQuality) {
|
|
35051
35056
|
let cost = 0;
|
|
35052
35057
|
for (const outcome of outcomes) {
|
|
35053
35058
|
if (outcome.narrationStatus === "generated") cost += 0.05;
|
|
35054
|
-
if (outcome.backdropStatus === "generated") cost +=
|
|
35059
|
+
if (outcome.backdropStatus === "generated") cost += backdropCostUsd(imageQuality);
|
|
35055
35060
|
if (outcome.videoStatus === "generated" || outcome.videoStatus === "pending") cost += 5;
|
|
35056
35061
|
if (outcome.musicStatus === "generated" || outcome.musicStatus === "pending") cost += 0.5;
|
|
35057
35062
|
}
|
|
@@ -42583,10 +42588,10 @@ async function prompt2(question) {
|
|
|
42583
42588
|
input,
|
|
42584
42589
|
output: process.stdout
|
|
42585
42590
|
});
|
|
42586
|
-
return new Promise((
|
|
42591
|
+
return new Promise((resolve66) => {
|
|
42587
42592
|
rl.question(question, (answer) => {
|
|
42588
42593
|
rl.close();
|
|
42589
|
-
|
|
42594
|
+
resolve66(answer);
|
|
42590
42595
|
});
|
|
42591
42596
|
});
|
|
42592
42597
|
}
|
|
@@ -59764,9 +59769,146 @@ var timelineTools = [
|
|
|
59764
59769
|
];
|
|
59765
59770
|
|
|
59766
59771
|
// src/tools/manifest/project.ts
|
|
59767
|
-
import { resolve as
|
|
59772
|
+
import { resolve as resolve61 } from "node:path";
|
|
59768
59773
|
import { writeFile as writeFile49 } from "node:fs/promises";
|
|
59769
59774
|
init_engine();
|
|
59775
|
+
|
|
59776
|
+
// src/commands/_shared/project-list.ts
|
|
59777
|
+
init_storyboard_parse();
|
|
59778
|
+
import { readdir as readdir6, readFile as readFile42, stat as stat7 } from "node:fs/promises";
|
|
59779
|
+
import { existsSync as existsSync46 } from "node:fs";
|
|
59780
|
+
import { join as join25, resolve as resolve60 } from "node:path";
|
|
59781
|
+
async function executeProjectList(opts = {}) {
|
|
59782
|
+
const workspaceDir = resolve60(opts.workspaceDir ?? ".");
|
|
59783
|
+
if (!existsSync46(workspaceDir)) {
|
|
59784
|
+
return {
|
|
59785
|
+
success: false,
|
|
59786
|
+
workspaceDir,
|
|
59787
|
+
projects: [],
|
|
59788
|
+
archivedCount: 0,
|
|
59789
|
+
error: `Workspace directory not found: ${workspaceDir}`
|
|
59790
|
+
};
|
|
59791
|
+
}
|
|
59792
|
+
const entries = await readdir6(workspaceDir, { withFileTypes: true });
|
|
59793
|
+
const projects = [];
|
|
59794
|
+
let archivedCount = 0;
|
|
59795
|
+
for (const entry of entries) {
|
|
59796
|
+
if (!entry.isDirectory()) continue;
|
|
59797
|
+
if (entry.name === "node_modules") continue;
|
|
59798
|
+
if (entry.name.startsWith(".")) continue;
|
|
59799
|
+
if (entry.name.startsWith("_")) {
|
|
59800
|
+
archivedCount += await countProjects(join25(workspaceDir, entry.name));
|
|
59801
|
+
continue;
|
|
59802
|
+
}
|
|
59803
|
+
const projectDir = join25(workspaceDir, entry.name);
|
|
59804
|
+
if (!existsSync46(join25(projectDir, "STORYBOARD.md"))) continue;
|
|
59805
|
+
projects.push(await describeProject(entry.name, projectDir));
|
|
59806
|
+
}
|
|
59807
|
+
projects.sort((a, b) => b.updatedAt.localeCompare(a.updatedAt));
|
|
59808
|
+
return { success: true, workspaceDir, projects, archivedCount };
|
|
59809
|
+
}
|
|
59810
|
+
async function countProjects(dir) {
|
|
59811
|
+
try {
|
|
59812
|
+
const entries = await readdir6(dir, { withFileTypes: true });
|
|
59813
|
+
return entries.filter(
|
|
59814
|
+
(e) => e.isDirectory() && existsSync46(join25(dir, e.name, "STORYBOARD.md"))
|
|
59815
|
+
).length;
|
|
59816
|
+
} catch {
|
|
59817
|
+
return 0;
|
|
59818
|
+
}
|
|
59819
|
+
}
|
|
59820
|
+
async function describeProject(name, projectDir) {
|
|
59821
|
+
let beats = 0;
|
|
59822
|
+
let storyboardDurationSec = 0;
|
|
59823
|
+
const timestamps = [];
|
|
59824
|
+
try {
|
|
59825
|
+
const storyboardPath = join25(projectDir, "STORYBOARD.md");
|
|
59826
|
+
const parsed = parseStoryboard(await readFile42(storyboardPath, "utf-8"));
|
|
59827
|
+
beats = parsed.beats.length;
|
|
59828
|
+
storyboardDurationSec = Number(
|
|
59829
|
+
parsed.beats.reduce((sum, beat) => sum + (beat.duration ?? 0), 0).toFixed(2)
|
|
59830
|
+
);
|
|
59831
|
+
timestamps.push((await stat7(storyboardPath)).mtimeMs);
|
|
59832
|
+
} catch {
|
|
59833
|
+
}
|
|
59834
|
+
let buildStatus;
|
|
59835
|
+
let buildUpdatedAt;
|
|
59836
|
+
try {
|
|
59837
|
+
const reportPath = join25(projectDir, "build-report.json");
|
|
59838
|
+
const report = JSON.parse(await readFile42(reportPath, "utf-8"));
|
|
59839
|
+
buildStatus = report.status ?? report.phase;
|
|
59840
|
+
buildUpdatedAt = report.updatedAt;
|
|
59841
|
+
timestamps.push((await stat7(reportPath)).mtimeMs);
|
|
59842
|
+
} catch {
|
|
59843
|
+
}
|
|
59844
|
+
let latestRender;
|
|
59845
|
+
try {
|
|
59846
|
+
const rendersDir = join25(projectDir, "renders");
|
|
59847
|
+
const files = await readdir6(rendersDir);
|
|
59848
|
+
let newest;
|
|
59849
|
+
for (const file of files) {
|
|
59850
|
+
if (!/\.(mp4|webm|mov)$/i.test(file)) continue;
|
|
59851
|
+
const { mtimeMs } = await stat7(join25(rendersDir, file));
|
|
59852
|
+
if (!newest || mtimeMs > newest.mtimeMs) newest = { file, mtimeMs };
|
|
59853
|
+
}
|
|
59854
|
+
if (newest) {
|
|
59855
|
+
latestRender = { file: newest.file, modifiedAt: new Date(newest.mtimeMs).toISOString() };
|
|
59856
|
+
timestamps.push(newest.mtimeMs);
|
|
59857
|
+
}
|
|
59858
|
+
} catch {
|
|
59859
|
+
}
|
|
59860
|
+
const updatedAt = new Date(
|
|
59861
|
+
timestamps.length > 0 ? Math.max(...timestamps) : (await stat7(projectDir)).mtimeMs
|
|
59862
|
+
).toISOString();
|
|
59863
|
+
return {
|
|
59864
|
+
name,
|
|
59865
|
+
path: projectDir,
|
|
59866
|
+
beats,
|
|
59867
|
+
storyboardDurationSec,
|
|
59868
|
+
...buildStatus ? { buildStatus } : {},
|
|
59869
|
+
...buildUpdatedAt ? { buildUpdatedAt } : {},
|
|
59870
|
+
...latestRender ? { latestRender } : {},
|
|
59871
|
+
updatedAt
|
|
59872
|
+
};
|
|
59873
|
+
}
|
|
59874
|
+
|
|
59875
|
+
// src/tools/manifest/project.ts
|
|
59876
|
+
var projectListTool = defineTool({
|
|
59877
|
+
name: "project_list",
|
|
59878
|
+
category: "project",
|
|
59879
|
+
cost: "free",
|
|
59880
|
+
title: "List Video Projects",
|
|
59881
|
+
annotations: { readOnly: true, openWorld: false },
|
|
59882
|
+
description: `List every VibeFrame video project in the workspace (directories with a STORYBOARD.md), newest activity first: beat count, storyboard duration, last build status, and the latest render. Directories starting with '_' (e.g. _archive) are skipped and reported as an archived count \u2014 move a project into _archive/ to retire it. Use this to answer "what projects do I have?" before init/build/render.`,
|
|
59883
|
+
schema: external_exports.object({
|
|
59884
|
+
dir: external_exports.string().optional().describe(
|
|
59885
|
+
"Workspace directory to scan. Defaults to the surface's cwd; in MCP hosts this is the configured server workspace."
|
|
59886
|
+
)
|
|
59887
|
+
}),
|
|
59888
|
+
async execute(args, ctx) {
|
|
59889
|
+
const result = await executeProjectList({
|
|
59890
|
+
workspaceDir: args.dir ? resolve61(ctx.workingDirectory, args.dir) : ctx.workingDirectory
|
|
59891
|
+
});
|
|
59892
|
+
if (!result.success) {
|
|
59893
|
+
return { success: false, error: result.error ?? "project list failed" };
|
|
59894
|
+
}
|
|
59895
|
+
return {
|
|
59896
|
+
success: true,
|
|
59897
|
+
data: {
|
|
59898
|
+
workspaceDir: result.workspaceDir,
|
|
59899
|
+
count: result.projects.length,
|
|
59900
|
+
archivedCount: result.archivedCount,
|
|
59901
|
+
projects: result.projects
|
|
59902
|
+
},
|
|
59903
|
+
humanLines: [
|
|
59904
|
+
`\u{1F4C1} ${result.projects.length} project(s) in ${result.workspaceDir}` + (result.archivedCount > 0 ? ` (+${result.archivedCount} archived)` : ""),
|
|
59905
|
+
...result.projects.map(
|
|
59906
|
+
(p) => ` \u2022 ${p.name} \u2014 ${p.beats} beat(s), ~${p.storyboardDurationSec}s` + (p.buildStatus ? `, build: ${p.buildStatus}` : "") + (p.latestRender ? `, latest render: ${p.latestRender.file}` : "") + ` (updated ${p.updatedAt})`
|
|
59907
|
+
)
|
|
59908
|
+
]
|
|
59909
|
+
};
|
|
59910
|
+
}
|
|
59911
|
+
});
|
|
59770
59912
|
var projectCreateTool = defineTool({
|
|
59771
59913
|
name: "project_create",
|
|
59772
59914
|
category: "project",
|
|
@@ -59782,7 +59924,7 @@ var projectCreateTool = defineTool({
|
|
|
59782
59924
|
fps: external_exports.number().optional().describe("Frames per second (default: 30)")
|
|
59783
59925
|
}),
|
|
59784
59926
|
async execute(args, ctx) {
|
|
59785
|
-
const outputPath =
|
|
59927
|
+
const outputPath = resolve61(ctx.workingDirectory, args.outputPath ?? `${args.name}.vibe.json`);
|
|
59786
59928
|
const project = new Project(args.name);
|
|
59787
59929
|
if (args.fps) project.setFrameRate(args.fps);
|
|
59788
59930
|
await writeFile49(outputPath, JSON.stringify(project.toJSON(), null, 2), "utf-8");
|
|
@@ -59823,12 +59965,13 @@ var projectInfoTool = defineTool({
|
|
|
59823
59965
|
}
|
|
59824
59966
|
});
|
|
59825
59967
|
var projectTools = [
|
|
59968
|
+
projectListTool,
|
|
59826
59969
|
projectCreateTool,
|
|
59827
59970
|
projectInfoTool
|
|
59828
59971
|
];
|
|
59829
59972
|
|
|
59830
59973
|
// src/tools/manifest/export.ts
|
|
59831
|
-
import { resolve as
|
|
59974
|
+
import { resolve as resolve63 } from "node:path";
|
|
59832
59975
|
|
|
59833
59976
|
// src/commands/export.ts
|
|
59834
59977
|
init_esm();
|
|
@@ -59839,8 +59982,8 @@ init_exec_safe();
|
|
|
59839
59982
|
init_output();
|
|
59840
59983
|
init_validate();
|
|
59841
59984
|
init_project_resolver();
|
|
59842
|
-
import { readFile as
|
|
59843
|
-
import { resolve as
|
|
59985
|
+
import { readFile as readFile43, access as access6 } from "node:fs/promises";
|
|
59986
|
+
import { resolve as resolve62, basename as basename17 } from "node:path";
|
|
59844
59987
|
import { spawn } from "node:child_process";
|
|
59845
59988
|
function timelineBaseName(path2) {
|
|
59846
59989
|
const name = basename17(path2);
|
|
@@ -59916,7 +60059,7 @@ async function runExport(projectPath, outputPath, options = {}) {
|
|
|
59916
60059
|
};
|
|
59917
60060
|
}
|
|
59918
60061
|
const filePath = await resolveTimelineFile(projectPath);
|
|
59919
|
-
const content = await
|
|
60062
|
+
const content = await readFile43(filePath, "utf-8");
|
|
59920
60063
|
const data = JSON.parse(content);
|
|
59921
60064
|
const project = Project.fromJSON(data);
|
|
59922
60065
|
const summary = project.getSummary();
|
|
@@ -59926,7 +60069,7 @@ async function runExport(projectPath, outputPath, options = {}) {
|
|
|
59926
60069
|
message: "Project has no clips to export"
|
|
59927
60070
|
};
|
|
59928
60071
|
}
|
|
59929
|
-
const finalOutputPath =
|
|
60072
|
+
const finalOutputPath = resolve62(process.cwd(), outputPath);
|
|
59930
60073
|
const basePresetSettings = getPresetSettings(preset, summary.aspectRatio);
|
|
59931
60074
|
const presetSettings = applyCustomOverrides(basePresetSettings, { bitrate, fps, resolution, codec });
|
|
59932
60075
|
const clips = project.getClips().sort((a, b) => a.startTime - b.startTime);
|
|
@@ -60040,7 +60183,7 @@ Run 'vibe schema export' for structured parameter info.`).action(async (projectP
|
|
|
60040
60183
|
}
|
|
60041
60184
|
spinner2.text = "Loading project...";
|
|
60042
60185
|
const filePath = await resolveTimelineFile(projectPath);
|
|
60043
|
-
const content = await
|
|
60186
|
+
const content = await readFile43(filePath, "utf-8");
|
|
60044
60187
|
const data = JSON.parse(content);
|
|
60045
60188
|
const project = Project.fromJSON(data);
|
|
60046
60189
|
const summary = project.getSummary();
|
|
@@ -60048,7 +60191,7 @@ Run 'vibe schema export' for structured parameter info.`).action(async (projectP
|
|
|
60048
60191
|
spinner2.fail("Project has no clips to export");
|
|
60049
60192
|
exitWithError(usageError("Project has no clips to export"));
|
|
60050
60193
|
}
|
|
60051
|
-
const outputPath = options.output ?
|
|
60194
|
+
const outputPath = options.output ? resolve62(process.cwd(), options.output) : resolve62(
|
|
60052
60195
|
process.cwd(),
|
|
60053
60196
|
`${timelineBaseName(projectPath)}.${options.format}`
|
|
60054
60197
|
);
|
|
@@ -60478,7 +60621,7 @@ function buildFFmpegArgs(clips, sources, presetSettings, outputPath, options, so
|
|
|
60478
60621
|
return args;
|
|
60479
60622
|
}
|
|
60480
60623
|
function runFFmpegProcess(ffmpegPath, args, onProgress) {
|
|
60481
|
-
return new Promise((
|
|
60624
|
+
return new Promise((resolve66, reject) => {
|
|
60482
60625
|
const ffmpeg = spawn(ffmpegPath, args, {
|
|
60483
60626
|
stdio: ["pipe", "pipe", "pipe"]
|
|
60484
60627
|
});
|
|
@@ -60502,7 +60645,7 @@ function runFFmpegProcess(ffmpegPath, args, onProgress) {
|
|
|
60502
60645
|
});
|
|
60503
60646
|
ffmpeg.on("close", (code) => {
|
|
60504
60647
|
if (code === 0) {
|
|
60505
|
-
|
|
60648
|
+
resolve66();
|
|
60506
60649
|
} else {
|
|
60507
60650
|
const errorMatch = stderr.match(/Error.*$/m);
|
|
60508
60651
|
const errorMsg = errorMatch ? errorMatch[0] : `FFmpeg exited with code ${code}`;
|
|
@@ -60638,17 +60781,17 @@ function getPresetSettings(preset, aspectRatio2) {
|
|
|
60638
60781
|
}
|
|
60639
60782
|
async function runHyperframesExport(projectPath, options, spinner2, startedAt) {
|
|
60640
60783
|
spinner2.text = "Loading project...";
|
|
60641
|
-
const { readFile:
|
|
60642
|
-
const { resolve:
|
|
60784
|
+
const { readFile: readFile45 } = await import("node:fs/promises");
|
|
60785
|
+
const { resolve: resolve66 } = await import("node:path");
|
|
60643
60786
|
const { Project: Project2 } = await Promise.resolve().then(() => (init_engine(), engine_exports));
|
|
60644
60787
|
const { createHyperframesBackend: createHyperframesBackend2 } = await Promise.resolve().then(() => (init_hyperframes(), hyperframes_exports));
|
|
60645
60788
|
const { exitWithError: exitWithError2, generalError: generalError2, outputSuccess: outputSuccess2 } = await Promise.resolve().then(() => (init_output(), output_exports));
|
|
60646
60789
|
const chalk2 = (await Promise.resolve().then(() => (init_source(), source_exports))).default;
|
|
60647
60790
|
const filePath = await resolveTimelineFile(projectPath);
|
|
60648
|
-
const content = await
|
|
60791
|
+
const content = await readFile45(filePath, "utf-8");
|
|
60649
60792
|
const project = Project2.fromJSON(JSON.parse(content));
|
|
60650
60793
|
const state = project.getState();
|
|
60651
|
-
const outputPath = options.output ?
|
|
60794
|
+
const outputPath = options.output ? resolve66(process.cwd(), options.output) : resolve66(process.cwd(), `${timelineBaseName(projectPath)}.${options.format ?? "mp4"}`);
|
|
60652
60795
|
const quality = ["draft", "standard", "high"].includes(options.preset ?? "") ? options.preset : "standard";
|
|
60653
60796
|
const backend = createHyperframesBackend2();
|
|
60654
60797
|
spinner2.text = "Rendering with Hyperframes...";
|
|
@@ -60696,8 +60839,8 @@ var exportVideoTool = defineTool({
|
|
|
60696
60839
|
overwrite: external_exports.boolean().optional().describe("Overwrite existing output file (default: false)")
|
|
60697
60840
|
}),
|
|
60698
60841
|
async execute(args, ctx) {
|
|
60699
|
-
const projectPath =
|
|
60700
|
-
const outputPath =
|
|
60842
|
+
const projectPath = resolve63(ctx.workingDirectory, args.projectPath);
|
|
60843
|
+
const outputPath = resolve63(ctx.workingDirectory, args.outputPath);
|
|
60701
60844
|
const result = await runExport(projectPath, outputPath, {
|
|
60702
60845
|
preset: args.preset,
|
|
60703
60846
|
format: args.format,
|
|
@@ -60714,8 +60857,8 @@ var exportVideoTool = defineTool({
|
|
|
60714
60857
|
var exportTools = [exportVideoTool];
|
|
60715
60858
|
|
|
60716
60859
|
// src/tools/manifest/agent-only.ts
|
|
60717
|
-
import { readFile as
|
|
60718
|
-
import { resolve as
|
|
60860
|
+
import { readFile as readFile44, writeFile as writeFile50, readdir as readdir7, stat as stat8, access as access7, unlink as unlink4 } from "node:fs/promises";
|
|
60861
|
+
import { resolve as resolve64, join as join26, basename as basename18, extname as extname12 } from "node:path";
|
|
60719
60862
|
init_engine();
|
|
60720
60863
|
init_exec_safe();
|
|
60721
60864
|
init_project_resolver();
|
|
@@ -60788,13 +60931,13 @@ var fsListTool = defineTool({
|
|
|
60788
60931
|
async execute(args, ctx) {
|
|
60789
60932
|
const dirPath = args.path ?? ".";
|
|
60790
60933
|
try {
|
|
60791
|
-
const absPath =
|
|
60792
|
-
const entries = await
|
|
60934
|
+
const absPath = resolve64(ctx.workingDirectory, dirPath);
|
|
60935
|
+
const entries = await readdir7(absPath, { withFileTypes: true });
|
|
60793
60936
|
const results = [];
|
|
60794
60937
|
for (const entry of entries) {
|
|
60795
60938
|
if (args.pattern && !matchPattern(entry.name, args.pattern)) continue;
|
|
60796
|
-
const fullPath =
|
|
60797
|
-
const stats = await
|
|
60939
|
+
const fullPath = join26(absPath, entry.name);
|
|
60940
|
+
const stats = await stat8(fullPath);
|
|
60798
60941
|
if (entry.isDirectory()) {
|
|
60799
60942
|
results.push(`[DIR] ${entry.name}/`);
|
|
60800
60943
|
} else {
|
|
@@ -60821,8 +60964,8 @@ var fsReadTool = defineTool({
|
|
|
60821
60964
|
}),
|
|
60822
60965
|
async execute(args, ctx) {
|
|
60823
60966
|
try {
|
|
60824
|
-
const absPath =
|
|
60825
|
-
const content = await
|
|
60967
|
+
const absPath = resolve64(ctx.workingDirectory, args.path);
|
|
60968
|
+
const content = await readFile44(absPath, "utf-8");
|
|
60826
60969
|
const maxLength = 4e3;
|
|
60827
60970
|
const truncated = content.length > maxLength;
|
|
60828
60971
|
const output = truncated ? content.substring(0, maxLength) + "\n... (truncated)" : content;
|
|
@@ -60846,7 +60989,7 @@ var fsWriteTool = defineTool({
|
|
|
60846
60989
|
}),
|
|
60847
60990
|
async execute(args, ctx) {
|
|
60848
60991
|
try {
|
|
60849
|
-
const absPath =
|
|
60992
|
+
const absPath = resolve64(ctx.workingDirectory, args.path);
|
|
60850
60993
|
await writeFile50(absPath, args.content, "utf-8");
|
|
60851
60994
|
return { success: true, data: { bytes: args.content.length }, humanLines: [`File written: ${args.path} (${formatSize(args.content.length)})`] };
|
|
60852
60995
|
} catch (error) {
|
|
@@ -60866,10 +61009,10 @@ var fsExistsTool = defineTool({
|
|
|
60866
61009
|
path: external_exports.string().describe("Path to check")
|
|
60867
61010
|
}),
|
|
60868
61011
|
async execute(args, ctx) {
|
|
60869
|
-
const absPath =
|
|
61012
|
+
const absPath = resolve64(ctx.workingDirectory, args.path);
|
|
60870
61013
|
try {
|
|
60871
61014
|
await access7(absPath);
|
|
60872
|
-
const stats = await
|
|
61015
|
+
const stats = await stat8(absPath);
|
|
60873
61016
|
const type = stats.isDirectory() ? "directory" : "file";
|
|
60874
61017
|
return { success: true, data: { exists: true, type }, humanLines: [`${type} exists: ${args.path}`] };
|
|
60875
61018
|
} catch {
|
|
@@ -60894,19 +61037,19 @@ var batchImportTool = defineTool({
|
|
|
60894
61037
|
}),
|
|
60895
61038
|
async execute(args, ctx) {
|
|
60896
61039
|
try {
|
|
60897
|
-
const filePath =
|
|
60898
|
-
const content = await
|
|
61040
|
+
const filePath = resolve64(ctx.workingDirectory, args.project);
|
|
61041
|
+
const content = await readFile44(filePath, "utf-8");
|
|
60899
61042
|
const data = JSON.parse(content);
|
|
60900
61043
|
const project = Project.fromJSON(data);
|
|
60901
|
-
const dirPath =
|
|
61044
|
+
const dirPath = resolve64(ctx.workingDirectory, args.directory);
|
|
60902
61045
|
const filterExts = args.filter ? args.filter.split(",").map((e) => e.trim().toLowerCase()) : null;
|
|
60903
61046
|
const imageDuration = args.imageDuration ?? 5;
|
|
60904
61047
|
const recursive = args.recursive ?? false;
|
|
60905
61048
|
const mediaFiles = [];
|
|
60906
61049
|
const scanDir = async (dir) => {
|
|
60907
|
-
const entries = await
|
|
61050
|
+
const entries = await readdir7(dir, { withFileTypes: true });
|
|
60908
61051
|
for (const entry of entries) {
|
|
60909
|
-
const entryPath =
|
|
61052
|
+
const entryPath = join26(dir, entry.name);
|
|
60910
61053
|
if (entry.isDirectory() && recursive) {
|
|
60911
61054
|
await scanDir(entryPath);
|
|
60912
61055
|
} else if (entry.isFile()) {
|
|
@@ -60966,8 +61109,8 @@ var batchConcatTool = defineTool({
|
|
|
60966
61109
|
}),
|
|
60967
61110
|
async execute(args, ctx) {
|
|
60968
61111
|
try {
|
|
60969
|
-
const filePath =
|
|
60970
|
-
const content = await
|
|
61112
|
+
const filePath = resolve64(ctx.workingDirectory, args.project);
|
|
61113
|
+
const content = await readFile44(filePath, "utf-8");
|
|
60971
61114
|
const data = JSON.parse(content);
|
|
60972
61115
|
const project = Project.fromJSON(data);
|
|
60973
61116
|
const sourceIds = args.sourceIds ?? [];
|
|
@@ -61037,8 +61180,8 @@ var batchApplyEffectTool = defineTool({
|
|
|
61037
61180
|
}),
|
|
61038
61181
|
async execute(args, ctx) {
|
|
61039
61182
|
try {
|
|
61040
|
-
const filePath =
|
|
61041
|
-
const content = await
|
|
61183
|
+
const filePath = resolve64(ctx.workingDirectory, args.project);
|
|
61184
|
+
const content = await readFile44(filePath, "utf-8");
|
|
61042
61185
|
const data = JSON.parse(content);
|
|
61043
61186
|
const project = Project.fromJSON(data);
|
|
61044
61187
|
const clipIds = args.clipIds ?? [];
|
|
@@ -61093,7 +61236,7 @@ var timelineClearTool = defineTool({
|
|
|
61093
61236
|
async execute(args, ctx) {
|
|
61094
61237
|
try {
|
|
61095
61238
|
const filePath = await resolveTimelineFile(args.project, ctx.workingDirectory);
|
|
61096
|
-
const content = await
|
|
61239
|
+
const content = await readFile44(filePath, "utf-8");
|
|
61097
61240
|
const data = JSON.parse(content);
|
|
61098
61241
|
const project = Project.fromJSON(data);
|
|
61099
61242
|
const what = args.what ?? "clips";
|
|
@@ -61170,7 +61313,7 @@ var projectSetTool = defineTool({
|
|
|
61170
61313
|
async execute(args, ctx) {
|
|
61171
61314
|
try {
|
|
61172
61315
|
const filePath = await resolveTimelineFile(args.projectPath, ctx.workingDirectory);
|
|
61173
|
-
const content = await
|
|
61316
|
+
const content = await readFile44(filePath, "utf-8");
|
|
61174
61317
|
const data = JSON.parse(content);
|
|
61175
61318
|
const project = Project.fromJSON(data);
|
|
61176
61319
|
const updates = [];
|
|
@@ -61329,7 +61472,7 @@ var mediaInfoTool = defineTool({
|
|
|
61329
61472
|
}),
|
|
61330
61473
|
async execute(args, ctx) {
|
|
61331
61474
|
try {
|
|
61332
|
-
const absPath =
|
|
61475
|
+
const absPath = resolve64(ctx.workingDirectory, args.path);
|
|
61333
61476
|
const { stdout } = await execSafe(
|
|
61334
61477
|
"ffprobe",
|
|
61335
61478
|
["-v", "quiet", "-print_format", "json", "-show_format", "-show_streams", absPath],
|
|
@@ -61418,10 +61561,10 @@ var mediaCompressTool = defineTool({
|
|
|
61418
61561
|
}),
|
|
61419
61562
|
async execute(args, ctx) {
|
|
61420
61563
|
try {
|
|
61421
|
-
const absInput =
|
|
61564
|
+
const absInput = resolve64(ctx.workingDirectory, args.input);
|
|
61422
61565
|
const ext = args.input.split(".").pop() || "mp4";
|
|
61423
61566
|
const baseName = args.input.replace(/\.[^/.]+$/, "");
|
|
61424
|
-
const outputPath = args.output ?
|
|
61567
|
+
const outputPath = args.output ? resolve64(ctx.workingDirectory, args.output) : resolve64(ctx.workingDirectory, `${baseName}-compressed.${ext}`);
|
|
61425
61568
|
const crfValues = { low: 28, medium: 23, high: 18 };
|
|
61426
61569
|
const crf = crfValues[args.quality ?? "medium"];
|
|
61427
61570
|
await execSafe(
|
|
@@ -61444,8 +61587,8 @@ var mediaCompressTool = defineTool({
|
|
|
61444
61587
|
],
|
|
61445
61588
|
{ maxBuffer: 50 * 1024 * 1024 }
|
|
61446
61589
|
);
|
|
61447
|
-
const inputBuf = await
|
|
61448
|
-
const outputBuf = await
|
|
61590
|
+
const inputBuf = await readFile44(absInput);
|
|
61591
|
+
const outputBuf = await readFile44(outputPath);
|
|
61449
61592
|
const inputSize = inputBuf.length;
|
|
61450
61593
|
const outputSize = outputBuf.length;
|
|
61451
61594
|
const reduction = (inputSize - outputSize) / inputSize * 100;
|
|
@@ -61481,8 +61624,8 @@ var mediaConvertTool = defineTool({
|
|
|
61481
61624
|
}),
|
|
61482
61625
|
async execute(args, ctx) {
|
|
61483
61626
|
try {
|
|
61484
|
-
const absInput =
|
|
61485
|
-
const absOutput =
|
|
61627
|
+
const absInput = resolve64(ctx.workingDirectory, args.input);
|
|
61628
|
+
const absOutput = resolve64(ctx.workingDirectory, args.output);
|
|
61486
61629
|
const codecMap = {
|
|
61487
61630
|
h264: "libx264",
|
|
61488
61631
|
h265: "libx265",
|
|
@@ -61535,11 +61678,11 @@ var mediaConcatTool = defineTool({
|
|
|
61535
61678
|
};
|
|
61536
61679
|
}
|
|
61537
61680
|
try {
|
|
61538
|
-
const absOutput =
|
|
61681
|
+
const absOutput = resolve64(ctx.workingDirectory, args.output);
|
|
61539
61682
|
if (args.reencode) {
|
|
61540
61683
|
const ffmpegArgs = [];
|
|
61541
61684
|
for (const i of args.inputs) {
|
|
61542
|
-
ffmpegArgs.push("-i",
|
|
61685
|
+
ffmpegArgs.push("-i", resolve64(ctx.workingDirectory, i));
|
|
61543
61686
|
}
|
|
61544
61687
|
const filterComplex = args.inputs.map((_, i) => `[${i}:v][${i}:a]`).join("");
|
|
61545
61688
|
ffmpegArgs.push(
|
|
@@ -61554,8 +61697,8 @@ var mediaConcatTool = defineTool({
|
|
|
61554
61697
|
);
|
|
61555
61698
|
await execSafe("ffmpeg", ffmpegArgs, { maxBuffer: 100 * 1024 * 1024 });
|
|
61556
61699
|
} else {
|
|
61557
|
-
const tempList =
|
|
61558
|
-
const listContent = args.inputs.map((i) => `file '${
|
|
61700
|
+
const tempList = resolve64(ctx.workingDirectory, `concat-list-${Date.now()}.txt`);
|
|
61701
|
+
const listContent = args.inputs.map((i) => `file '${resolve64(ctx.workingDirectory, i)}'`).join("\n");
|
|
61559
61702
|
await writeFile50(tempList, listContent, "utf-8");
|
|
61560
61703
|
try {
|
|
61561
61704
|
await execSafe(
|
|
@@ -62086,7 +62229,7 @@ var guideTool = defineTool({
|
|
|
62086
62229
|
var guideTools = [guideTool];
|
|
62087
62230
|
|
|
62088
62231
|
// src/tools/manifest/status.ts
|
|
62089
|
-
import { resolve as
|
|
62232
|
+
import { resolve as resolve65 } from "node:path";
|
|
62090
62233
|
init_status_jobs();
|
|
62091
62234
|
var PROJECT_DIR_DESCRIPTION4 = "Project directory. Defaults to the surface's cwd; in MCP hosts, relative paths resolve under the configured server workspace.";
|
|
62092
62235
|
var statusJobTool = defineTool({
|
|
@@ -62104,7 +62247,7 @@ var statusJobTool = defineTool({
|
|
|
62104
62247
|
output: external_exports.string().optional().describe("Download result media to this path when complete.")
|
|
62105
62248
|
}),
|
|
62106
62249
|
async execute(args, ctx) {
|
|
62107
|
-
const projectDir = args.projectDir ?
|
|
62250
|
+
const projectDir = args.projectDir ? resolve65(ctx.workingDirectory, args.projectDir) : findProjectRoot(ctx.workingDirectory);
|
|
62108
62251
|
const record = await readJobRecord(args.jobId, projectDir);
|
|
62109
62252
|
if (!record) return { success: false, error: `Job not found: ${args.jobId}` };
|
|
62110
62253
|
const result = args.refresh === false ? makeJobStatusResult(record, {
|
|
@@ -62113,7 +62256,7 @@ var statusJobTool = defineTool({
|
|
|
62113
62256
|
warnings: []
|
|
62114
62257
|
}) : await refreshJobRecord(record, {
|
|
62115
62258
|
wait: args.wait,
|
|
62116
|
-
output: args.output ?
|
|
62259
|
+
output: args.output ? resolve65(ctx.workingDirectory, args.output) : void 0,
|
|
62117
62260
|
workingDirectory: ctx.workingDirectory
|
|
62118
62261
|
});
|
|
62119
62262
|
return {
|
|
@@ -62138,7 +62281,7 @@ var statusProjectTool = defineTool({
|
|
|
62138
62281
|
refresh: external_exports.boolean().optional().describe("Refresh active supported jobs before summarizing. Default false.")
|
|
62139
62282
|
}),
|
|
62140
62283
|
async execute(args, ctx) {
|
|
62141
|
-
const projectDir = args.projectDir ?
|
|
62284
|
+
const projectDir = args.projectDir ? resolve65(ctx.workingDirectory, args.projectDir) : ctx.workingDirectory;
|
|
62142
62285
|
const result = await inspectProjectStatus(projectDir, { refresh: args.refresh === true });
|
|
62143
62286
|
return {
|
|
62144
62287
|
success: true,
|