@vibeframe/cli 0.111.3 → 0.112.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.
|
@@ -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({
|
|
@@ -42583,10 +42583,10 @@ async function prompt2(question) {
|
|
|
42583
42583
|
input,
|
|
42584
42584
|
output: process.stdout
|
|
42585
42585
|
});
|
|
42586
|
-
return new Promise((
|
|
42586
|
+
return new Promise((resolve66) => {
|
|
42587
42587
|
rl.question(question, (answer) => {
|
|
42588
42588
|
rl.close();
|
|
42589
|
-
|
|
42589
|
+
resolve66(answer);
|
|
42590
42590
|
});
|
|
42591
42591
|
});
|
|
42592
42592
|
}
|
|
@@ -59764,9 +59764,146 @@ var timelineTools = [
|
|
|
59764
59764
|
];
|
|
59765
59765
|
|
|
59766
59766
|
// src/tools/manifest/project.ts
|
|
59767
|
-
import { resolve as
|
|
59767
|
+
import { resolve as resolve61 } from "node:path";
|
|
59768
59768
|
import { writeFile as writeFile49 } from "node:fs/promises";
|
|
59769
59769
|
init_engine();
|
|
59770
|
+
|
|
59771
|
+
// src/commands/_shared/project-list.ts
|
|
59772
|
+
init_storyboard_parse();
|
|
59773
|
+
import { readdir as readdir6, readFile as readFile42, stat as stat7 } from "node:fs/promises";
|
|
59774
|
+
import { existsSync as existsSync46 } from "node:fs";
|
|
59775
|
+
import { join as join25, resolve as resolve60 } from "node:path";
|
|
59776
|
+
async function executeProjectList(opts = {}) {
|
|
59777
|
+
const workspaceDir = resolve60(opts.workspaceDir ?? ".");
|
|
59778
|
+
if (!existsSync46(workspaceDir)) {
|
|
59779
|
+
return {
|
|
59780
|
+
success: false,
|
|
59781
|
+
workspaceDir,
|
|
59782
|
+
projects: [],
|
|
59783
|
+
archivedCount: 0,
|
|
59784
|
+
error: `Workspace directory not found: ${workspaceDir}`
|
|
59785
|
+
};
|
|
59786
|
+
}
|
|
59787
|
+
const entries = await readdir6(workspaceDir, { withFileTypes: true });
|
|
59788
|
+
const projects = [];
|
|
59789
|
+
let archivedCount = 0;
|
|
59790
|
+
for (const entry of entries) {
|
|
59791
|
+
if (!entry.isDirectory()) continue;
|
|
59792
|
+
if (entry.name === "node_modules") continue;
|
|
59793
|
+
if (entry.name.startsWith(".")) continue;
|
|
59794
|
+
if (entry.name.startsWith("_")) {
|
|
59795
|
+
archivedCount += await countProjects(join25(workspaceDir, entry.name));
|
|
59796
|
+
continue;
|
|
59797
|
+
}
|
|
59798
|
+
const projectDir = join25(workspaceDir, entry.name);
|
|
59799
|
+
if (!existsSync46(join25(projectDir, "STORYBOARD.md"))) continue;
|
|
59800
|
+
projects.push(await describeProject(entry.name, projectDir));
|
|
59801
|
+
}
|
|
59802
|
+
projects.sort((a, b) => b.updatedAt.localeCompare(a.updatedAt));
|
|
59803
|
+
return { success: true, workspaceDir, projects, archivedCount };
|
|
59804
|
+
}
|
|
59805
|
+
async function countProjects(dir) {
|
|
59806
|
+
try {
|
|
59807
|
+
const entries = await readdir6(dir, { withFileTypes: true });
|
|
59808
|
+
return entries.filter(
|
|
59809
|
+
(e) => e.isDirectory() && existsSync46(join25(dir, e.name, "STORYBOARD.md"))
|
|
59810
|
+
).length;
|
|
59811
|
+
} catch {
|
|
59812
|
+
return 0;
|
|
59813
|
+
}
|
|
59814
|
+
}
|
|
59815
|
+
async function describeProject(name, projectDir) {
|
|
59816
|
+
let beats = 0;
|
|
59817
|
+
let storyboardDurationSec = 0;
|
|
59818
|
+
const timestamps = [];
|
|
59819
|
+
try {
|
|
59820
|
+
const storyboardPath = join25(projectDir, "STORYBOARD.md");
|
|
59821
|
+
const parsed = parseStoryboard(await readFile42(storyboardPath, "utf-8"));
|
|
59822
|
+
beats = parsed.beats.length;
|
|
59823
|
+
storyboardDurationSec = Number(
|
|
59824
|
+
parsed.beats.reduce((sum, beat) => sum + (beat.duration ?? 0), 0).toFixed(2)
|
|
59825
|
+
);
|
|
59826
|
+
timestamps.push((await stat7(storyboardPath)).mtimeMs);
|
|
59827
|
+
} catch {
|
|
59828
|
+
}
|
|
59829
|
+
let buildStatus;
|
|
59830
|
+
let buildUpdatedAt;
|
|
59831
|
+
try {
|
|
59832
|
+
const reportPath = join25(projectDir, "build-report.json");
|
|
59833
|
+
const report = JSON.parse(await readFile42(reportPath, "utf-8"));
|
|
59834
|
+
buildStatus = report.status ?? report.phase;
|
|
59835
|
+
buildUpdatedAt = report.updatedAt;
|
|
59836
|
+
timestamps.push((await stat7(reportPath)).mtimeMs);
|
|
59837
|
+
} catch {
|
|
59838
|
+
}
|
|
59839
|
+
let latestRender;
|
|
59840
|
+
try {
|
|
59841
|
+
const rendersDir = join25(projectDir, "renders");
|
|
59842
|
+
const files = await readdir6(rendersDir);
|
|
59843
|
+
let newest;
|
|
59844
|
+
for (const file of files) {
|
|
59845
|
+
if (!/\.(mp4|webm|mov)$/i.test(file)) continue;
|
|
59846
|
+
const { mtimeMs } = await stat7(join25(rendersDir, file));
|
|
59847
|
+
if (!newest || mtimeMs > newest.mtimeMs) newest = { file, mtimeMs };
|
|
59848
|
+
}
|
|
59849
|
+
if (newest) {
|
|
59850
|
+
latestRender = { file: newest.file, modifiedAt: new Date(newest.mtimeMs).toISOString() };
|
|
59851
|
+
timestamps.push(newest.mtimeMs);
|
|
59852
|
+
}
|
|
59853
|
+
} catch {
|
|
59854
|
+
}
|
|
59855
|
+
const updatedAt = new Date(
|
|
59856
|
+
timestamps.length > 0 ? Math.max(...timestamps) : (await stat7(projectDir)).mtimeMs
|
|
59857
|
+
).toISOString();
|
|
59858
|
+
return {
|
|
59859
|
+
name,
|
|
59860
|
+
path: projectDir,
|
|
59861
|
+
beats,
|
|
59862
|
+
storyboardDurationSec,
|
|
59863
|
+
...buildStatus ? { buildStatus } : {},
|
|
59864
|
+
...buildUpdatedAt ? { buildUpdatedAt } : {},
|
|
59865
|
+
...latestRender ? { latestRender } : {},
|
|
59866
|
+
updatedAt
|
|
59867
|
+
};
|
|
59868
|
+
}
|
|
59869
|
+
|
|
59870
|
+
// src/tools/manifest/project.ts
|
|
59871
|
+
var projectListTool = defineTool({
|
|
59872
|
+
name: "project_list",
|
|
59873
|
+
category: "project",
|
|
59874
|
+
cost: "free",
|
|
59875
|
+
title: "List Video Projects",
|
|
59876
|
+
annotations: { readOnly: true, openWorld: false },
|
|
59877
|
+
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.`,
|
|
59878
|
+
schema: external_exports.object({
|
|
59879
|
+
dir: external_exports.string().optional().describe(
|
|
59880
|
+
"Workspace directory to scan. Defaults to the surface's cwd; in MCP hosts this is the configured server workspace."
|
|
59881
|
+
)
|
|
59882
|
+
}),
|
|
59883
|
+
async execute(args, ctx) {
|
|
59884
|
+
const result = await executeProjectList({
|
|
59885
|
+
workspaceDir: args.dir ? resolve61(ctx.workingDirectory, args.dir) : ctx.workingDirectory
|
|
59886
|
+
});
|
|
59887
|
+
if (!result.success) {
|
|
59888
|
+
return { success: false, error: result.error ?? "project list failed" };
|
|
59889
|
+
}
|
|
59890
|
+
return {
|
|
59891
|
+
success: true,
|
|
59892
|
+
data: {
|
|
59893
|
+
workspaceDir: result.workspaceDir,
|
|
59894
|
+
count: result.projects.length,
|
|
59895
|
+
archivedCount: result.archivedCount,
|
|
59896
|
+
projects: result.projects
|
|
59897
|
+
},
|
|
59898
|
+
humanLines: [
|
|
59899
|
+
`\u{1F4C1} ${result.projects.length} project(s) in ${result.workspaceDir}` + (result.archivedCount > 0 ? ` (+${result.archivedCount} archived)` : ""),
|
|
59900
|
+
...result.projects.map(
|
|
59901
|
+
(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})`
|
|
59902
|
+
)
|
|
59903
|
+
]
|
|
59904
|
+
};
|
|
59905
|
+
}
|
|
59906
|
+
});
|
|
59770
59907
|
var projectCreateTool = defineTool({
|
|
59771
59908
|
name: "project_create",
|
|
59772
59909
|
category: "project",
|
|
@@ -59782,7 +59919,7 @@ var projectCreateTool = defineTool({
|
|
|
59782
59919
|
fps: external_exports.number().optional().describe("Frames per second (default: 30)")
|
|
59783
59920
|
}),
|
|
59784
59921
|
async execute(args, ctx) {
|
|
59785
|
-
const outputPath =
|
|
59922
|
+
const outputPath = resolve61(ctx.workingDirectory, args.outputPath ?? `${args.name}.vibe.json`);
|
|
59786
59923
|
const project = new Project(args.name);
|
|
59787
59924
|
if (args.fps) project.setFrameRate(args.fps);
|
|
59788
59925
|
await writeFile49(outputPath, JSON.stringify(project.toJSON(), null, 2), "utf-8");
|
|
@@ -59823,12 +59960,13 @@ var projectInfoTool = defineTool({
|
|
|
59823
59960
|
}
|
|
59824
59961
|
});
|
|
59825
59962
|
var projectTools = [
|
|
59963
|
+
projectListTool,
|
|
59826
59964
|
projectCreateTool,
|
|
59827
59965
|
projectInfoTool
|
|
59828
59966
|
];
|
|
59829
59967
|
|
|
59830
59968
|
// src/tools/manifest/export.ts
|
|
59831
|
-
import { resolve as
|
|
59969
|
+
import { resolve as resolve63 } from "node:path";
|
|
59832
59970
|
|
|
59833
59971
|
// src/commands/export.ts
|
|
59834
59972
|
init_esm();
|
|
@@ -59839,8 +59977,8 @@ init_exec_safe();
|
|
|
59839
59977
|
init_output();
|
|
59840
59978
|
init_validate();
|
|
59841
59979
|
init_project_resolver();
|
|
59842
|
-
import { readFile as
|
|
59843
|
-
import { resolve as
|
|
59980
|
+
import { readFile as readFile43, access as access6 } from "node:fs/promises";
|
|
59981
|
+
import { resolve as resolve62, basename as basename17 } from "node:path";
|
|
59844
59982
|
import { spawn } from "node:child_process";
|
|
59845
59983
|
function timelineBaseName(path2) {
|
|
59846
59984
|
const name = basename17(path2);
|
|
@@ -59916,7 +60054,7 @@ async function runExport(projectPath, outputPath, options = {}) {
|
|
|
59916
60054
|
};
|
|
59917
60055
|
}
|
|
59918
60056
|
const filePath = await resolveTimelineFile(projectPath);
|
|
59919
|
-
const content = await
|
|
60057
|
+
const content = await readFile43(filePath, "utf-8");
|
|
59920
60058
|
const data = JSON.parse(content);
|
|
59921
60059
|
const project = Project.fromJSON(data);
|
|
59922
60060
|
const summary = project.getSummary();
|
|
@@ -59926,7 +60064,7 @@ async function runExport(projectPath, outputPath, options = {}) {
|
|
|
59926
60064
|
message: "Project has no clips to export"
|
|
59927
60065
|
};
|
|
59928
60066
|
}
|
|
59929
|
-
const finalOutputPath =
|
|
60067
|
+
const finalOutputPath = resolve62(process.cwd(), outputPath);
|
|
59930
60068
|
const basePresetSettings = getPresetSettings(preset, summary.aspectRatio);
|
|
59931
60069
|
const presetSettings = applyCustomOverrides(basePresetSettings, { bitrate, fps, resolution, codec });
|
|
59932
60070
|
const clips = project.getClips().sort((a, b) => a.startTime - b.startTime);
|
|
@@ -60040,7 +60178,7 @@ Run 'vibe schema export' for structured parameter info.`).action(async (projectP
|
|
|
60040
60178
|
}
|
|
60041
60179
|
spinner2.text = "Loading project...";
|
|
60042
60180
|
const filePath = await resolveTimelineFile(projectPath);
|
|
60043
|
-
const content = await
|
|
60181
|
+
const content = await readFile43(filePath, "utf-8");
|
|
60044
60182
|
const data = JSON.parse(content);
|
|
60045
60183
|
const project = Project.fromJSON(data);
|
|
60046
60184
|
const summary = project.getSummary();
|
|
@@ -60048,7 +60186,7 @@ Run 'vibe schema export' for structured parameter info.`).action(async (projectP
|
|
|
60048
60186
|
spinner2.fail("Project has no clips to export");
|
|
60049
60187
|
exitWithError(usageError("Project has no clips to export"));
|
|
60050
60188
|
}
|
|
60051
|
-
const outputPath = options.output ?
|
|
60189
|
+
const outputPath = options.output ? resolve62(process.cwd(), options.output) : resolve62(
|
|
60052
60190
|
process.cwd(),
|
|
60053
60191
|
`${timelineBaseName(projectPath)}.${options.format}`
|
|
60054
60192
|
);
|
|
@@ -60478,7 +60616,7 @@ function buildFFmpegArgs(clips, sources, presetSettings, outputPath, options, so
|
|
|
60478
60616
|
return args;
|
|
60479
60617
|
}
|
|
60480
60618
|
function runFFmpegProcess(ffmpegPath, args, onProgress) {
|
|
60481
|
-
return new Promise((
|
|
60619
|
+
return new Promise((resolve66, reject) => {
|
|
60482
60620
|
const ffmpeg = spawn(ffmpegPath, args, {
|
|
60483
60621
|
stdio: ["pipe", "pipe", "pipe"]
|
|
60484
60622
|
});
|
|
@@ -60502,7 +60640,7 @@ function runFFmpegProcess(ffmpegPath, args, onProgress) {
|
|
|
60502
60640
|
});
|
|
60503
60641
|
ffmpeg.on("close", (code) => {
|
|
60504
60642
|
if (code === 0) {
|
|
60505
|
-
|
|
60643
|
+
resolve66();
|
|
60506
60644
|
} else {
|
|
60507
60645
|
const errorMatch = stderr.match(/Error.*$/m);
|
|
60508
60646
|
const errorMsg = errorMatch ? errorMatch[0] : `FFmpeg exited with code ${code}`;
|
|
@@ -60638,17 +60776,17 @@ function getPresetSettings(preset, aspectRatio2) {
|
|
|
60638
60776
|
}
|
|
60639
60777
|
async function runHyperframesExport(projectPath, options, spinner2, startedAt) {
|
|
60640
60778
|
spinner2.text = "Loading project...";
|
|
60641
|
-
const { readFile:
|
|
60642
|
-
const { resolve:
|
|
60779
|
+
const { readFile: readFile45 } = await import("node:fs/promises");
|
|
60780
|
+
const { resolve: resolve66 } = await import("node:path");
|
|
60643
60781
|
const { Project: Project2 } = await Promise.resolve().then(() => (init_engine(), engine_exports));
|
|
60644
60782
|
const { createHyperframesBackend: createHyperframesBackend2 } = await Promise.resolve().then(() => (init_hyperframes(), hyperframes_exports));
|
|
60645
60783
|
const { exitWithError: exitWithError2, generalError: generalError2, outputSuccess: outputSuccess2 } = await Promise.resolve().then(() => (init_output(), output_exports));
|
|
60646
60784
|
const chalk2 = (await Promise.resolve().then(() => (init_source(), source_exports))).default;
|
|
60647
60785
|
const filePath = await resolveTimelineFile(projectPath);
|
|
60648
|
-
const content = await
|
|
60786
|
+
const content = await readFile45(filePath, "utf-8");
|
|
60649
60787
|
const project = Project2.fromJSON(JSON.parse(content));
|
|
60650
60788
|
const state = project.getState();
|
|
60651
|
-
const outputPath = options.output ?
|
|
60789
|
+
const outputPath = options.output ? resolve66(process.cwd(), options.output) : resolve66(process.cwd(), `${timelineBaseName(projectPath)}.${options.format ?? "mp4"}`);
|
|
60652
60790
|
const quality = ["draft", "standard", "high"].includes(options.preset ?? "") ? options.preset : "standard";
|
|
60653
60791
|
const backend = createHyperframesBackend2();
|
|
60654
60792
|
spinner2.text = "Rendering with Hyperframes...";
|
|
@@ -60696,8 +60834,8 @@ var exportVideoTool = defineTool({
|
|
|
60696
60834
|
overwrite: external_exports.boolean().optional().describe("Overwrite existing output file (default: false)")
|
|
60697
60835
|
}),
|
|
60698
60836
|
async execute(args, ctx) {
|
|
60699
|
-
const projectPath =
|
|
60700
|
-
const outputPath =
|
|
60837
|
+
const projectPath = resolve63(ctx.workingDirectory, args.projectPath);
|
|
60838
|
+
const outputPath = resolve63(ctx.workingDirectory, args.outputPath);
|
|
60701
60839
|
const result = await runExport(projectPath, outputPath, {
|
|
60702
60840
|
preset: args.preset,
|
|
60703
60841
|
format: args.format,
|
|
@@ -60714,8 +60852,8 @@ var exportVideoTool = defineTool({
|
|
|
60714
60852
|
var exportTools = [exportVideoTool];
|
|
60715
60853
|
|
|
60716
60854
|
// src/tools/manifest/agent-only.ts
|
|
60717
|
-
import { readFile as
|
|
60718
|
-
import { resolve as
|
|
60855
|
+
import { readFile as readFile44, writeFile as writeFile50, readdir as readdir7, stat as stat8, access as access7, unlink as unlink4 } from "node:fs/promises";
|
|
60856
|
+
import { resolve as resolve64, join as join26, basename as basename18, extname as extname12 } from "node:path";
|
|
60719
60857
|
init_engine();
|
|
60720
60858
|
init_exec_safe();
|
|
60721
60859
|
init_project_resolver();
|
|
@@ -60788,13 +60926,13 @@ var fsListTool = defineTool({
|
|
|
60788
60926
|
async execute(args, ctx) {
|
|
60789
60927
|
const dirPath = args.path ?? ".";
|
|
60790
60928
|
try {
|
|
60791
|
-
const absPath =
|
|
60792
|
-
const entries = await
|
|
60929
|
+
const absPath = resolve64(ctx.workingDirectory, dirPath);
|
|
60930
|
+
const entries = await readdir7(absPath, { withFileTypes: true });
|
|
60793
60931
|
const results = [];
|
|
60794
60932
|
for (const entry of entries) {
|
|
60795
60933
|
if (args.pattern && !matchPattern(entry.name, args.pattern)) continue;
|
|
60796
|
-
const fullPath =
|
|
60797
|
-
const stats = await
|
|
60934
|
+
const fullPath = join26(absPath, entry.name);
|
|
60935
|
+
const stats = await stat8(fullPath);
|
|
60798
60936
|
if (entry.isDirectory()) {
|
|
60799
60937
|
results.push(`[DIR] ${entry.name}/`);
|
|
60800
60938
|
} else {
|
|
@@ -60821,8 +60959,8 @@ var fsReadTool = defineTool({
|
|
|
60821
60959
|
}),
|
|
60822
60960
|
async execute(args, ctx) {
|
|
60823
60961
|
try {
|
|
60824
|
-
const absPath =
|
|
60825
|
-
const content = await
|
|
60962
|
+
const absPath = resolve64(ctx.workingDirectory, args.path);
|
|
60963
|
+
const content = await readFile44(absPath, "utf-8");
|
|
60826
60964
|
const maxLength = 4e3;
|
|
60827
60965
|
const truncated = content.length > maxLength;
|
|
60828
60966
|
const output = truncated ? content.substring(0, maxLength) + "\n... (truncated)" : content;
|
|
@@ -60846,7 +60984,7 @@ var fsWriteTool = defineTool({
|
|
|
60846
60984
|
}),
|
|
60847
60985
|
async execute(args, ctx) {
|
|
60848
60986
|
try {
|
|
60849
|
-
const absPath =
|
|
60987
|
+
const absPath = resolve64(ctx.workingDirectory, args.path);
|
|
60850
60988
|
await writeFile50(absPath, args.content, "utf-8");
|
|
60851
60989
|
return { success: true, data: { bytes: args.content.length }, humanLines: [`File written: ${args.path} (${formatSize(args.content.length)})`] };
|
|
60852
60990
|
} catch (error) {
|
|
@@ -60866,10 +61004,10 @@ var fsExistsTool = defineTool({
|
|
|
60866
61004
|
path: external_exports.string().describe("Path to check")
|
|
60867
61005
|
}),
|
|
60868
61006
|
async execute(args, ctx) {
|
|
60869
|
-
const absPath =
|
|
61007
|
+
const absPath = resolve64(ctx.workingDirectory, args.path);
|
|
60870
61008
|
try {
|
|
60871
61009
|
await access7(absPath);
|
|
60872
|
-
const stats = await
|
|
61010
|
+
const stats = await stat8(absPath);
|
|
60873
61011
|
const type = stats.isDirectory() ? "directory" : "file";
|
|
60874
61012
|
return { success: true, data: { exists: true, type }, humanLines: [`${type} exists: ${args.path}`] };
|
|
60875
61013
|
} catch {
|
|
@@ -60894,19 +61032,19 @@ var batchImportTool = defineTool({
|
|
|
60894
61032
|
}),
|
|
60895
61033
|
async execute(args, ctx) {
|
|
60896
61034
|
try {
|
|
60897
|
-
const filePath =
|
|
60898
|
-
const content = await
|
|
61035
|
+
const filePath = resolve64(ctx.workingDirectory, args.project);
|
|
61036
|
+
const content = await readFile44(filePath, "utf-8");
|
|
60899
61037
|
const data = JSON.parse(content);
|
|
60900
61038
|
const project = Project.fromJSON(data);
|
|
60901
|
-
const dirPath =
|
|
61039
|
+
const dirPath = resolve64(ctx.workingDirectory, args.directory);
|
|
60902
61040
|
const filterExts = args.filter ? args.filter.split(",").map((e) => e.trim().toLowerCase()) : null;
|
|
60903
61041
|
const imageDuration = args.imageDuration ?? 5;
|
|
60904
61042
|
const recursive = args.recursive ?? false;
|
|
60905
61043
|
const mediaFiles = [];
|
|
60906
61044
|
const scanDir = async (dir) => {
|
|
60907
|
-
const entries = await
|
|
61045
|
+
const entries = await readdir7(dir, { withFileTypes: true });
|
|
60908
61046
|
for (const entry of entries) {
|
|
60909
|
-
const entryPath =
|
|
61047
|
+
const entryPath = join26(dir, entry.name);
|
|
60910
61048
|
if (entry.isDirectory() && recursive) {
|
|
60911
61049
|
await scanDir(entryPath);
|
|
60912
61050
|
} else if (entry.isFile()) {
|
|
@@ -60966,8 +61104,8 @@ var batchConcatTool = defineTool({
|
|
|
60966
61104
|
}),
|
|
60967
61105
|
async execute(args, ctx) {
|
|
60968
61106
|
try {
|
|
60969
|
-
const filePath =
|
|
60970
|
-
const content = await
|
|
61107
|
+
const filePath = resolve64(ctx.workingDirectory, args.project);
|
|
61108
|
+
const content = await readFile44(filePath, "utf-8");
|
|
60971
61109
|
const data = JSON.parse(content);
|
|
60972
61110
|
const project = Project.fromJSON(data);
|
|
60973
61111
|
const sourceIds = args.sourceIds ?? [];
|
|
@@ -61037,8 +61175,8 @@ var batchApplyEffectTool = defineTool({
|
|
|
61037
61175
|
}),
|
|
61038
61176
|
async execute(args, ctx) {
|
|
61039
61177
|
try {
|
|
61040
|
-
const filePath =
|
|
61041
|
-
const content = await
|
|
61178
|
+
const filePath = resolve64(ctx.workingDirectory, args.project);
|
|
61179
|
+
const content = await readFile44(filePath, "utf-8");
|
|
61042
61180
|
const data = JSON.parse(content);
|
|
61043
61181
|
const project = Project.fromJSON(data);
|
|
61044
61182
|
const clipIds = args.clipIds ?? [];
|
|
@@ -61093,7 +61231,7 @@ var timelineClearTool = defineTool({
|
|
|
61093
61231
|
async execute(args, ctx) {
|
|
61094
61232
|
try {
|
|
61095
61233
|
const filePath = await resolveTimelineFile(args.project, ctx.workingDirectory);
|
|
61096
|
-
const content = await
|
|
61234
|
+
const content = await readFile44(filePath, "utf-8");
|
|
61097
61235
|
const data = JSON.parse(content);
|
|
61098
61236
|
const project = Project.fromJSON(data);
|
|
61099
61237
|
const what = args.what ?? "clips";
|
|
@@ -61170,7 +61308,7 @@ var projectSetTool = defineTool({
|
|
|
61170
61308
|
async execute(args, ctx) {
|
|
61171
61309
|
try {
|
|
61172
61310
|
const filePath = await resolveTimelineFile(args.projectPath, ctx.workingDirectory);
|
|
61173
|
-
const content = await
|
|
61311
|
+
const content = await readFile44(filePath, "utf-8");
|
|
61174
61312
|
const data = JSON.parse(content);
|
|
61175
61313
|
const project = Project.fromJSON(data);
|
|
61176
61314
|
const updates = [];
|
|
@@ -61329,7 +61467,7 @@ var mediaInfoTool = defineTool({
|
|
|
61329
61467
|
}),
|
|
61330
61468
|
async execute(args, ctx) {
|
|
61331
61469
|
try {
|
|
61332
|
-
const absPath =
|
|
61470
|
+
const absPath = resolve64(ctx.workingDirectory, args.path);
|
|
61333
61471
|
const { stdout } = await execSafe(
|
|
61334
61472
|
"ffprobe",
|
|
61335
61473
|
["-v", "quiet", "-print_format", "json", "-show_format", "-show_streams", absPath],
|
|
@@ -61418,10 +61556,10 @@ var mediaCompressTool = defineTool({
|
|
|
61418
61556
|
}),
|
|
61419
61557
|
async execute(args, ctx) {
|
|
61420
61558
|
try {
|
|
61421
|
-
const absInput =
|
|
61559
|
+
const absInput = resolve64(ctx.workingDirectory, args.input);
|
|
61422
61560
|
const ext = args.input.split(".").pop() || "mp4";
|
|
61423
61561
|
const baseName = args.input.replace(/\.[^/.]+$/, "");
|
|
61424
|
-
const outputPath = args.output ?
|
|
61562
|
+
const outputPath = args.output ? resolve64(ctx.workingDirectory, args.output) : resolve64(ctx.workingDirectory, `${baseName}-compressed.${ext}`);
|
|
61425
61563
|
const crfValues = { low: 28, medium: 23, high: 18 };
|
|
61426
61564
|
const crf = crfValues[args.quality ?? "medium"];
|
|
61427
61565
|
await execSafe(
|
|
@@ -61444,8 +61582,8 @@ var mediaCompressTool = defineTool({
|
|
|
61444
61582
|
],
|
|
61445
61583
|
{ maxBuffer: 50 * 1024 * 1024 }
|
|
61446
61584
|
);
|
|
61447
|
-
const inputBuf = await
|
|
61448
|
-
const outputBuf = await
|
|
61585
|
+
const inputBuf = await readFile44(absInput);
|
|
61586
|
+
const outputBuf = await readFile44(outputPath);
|
|
61449
61587
|
const inputSize = inputBuf.length;
|
|
61450
61588
|
const outputSize = outputBuf.length;
|
|
61451
61589
|
const reduction = (inputSize - outputSize) / inputSize * 100;
|
|
@@ -61481,8 +61619,8 @@ var mediaConvertTool = defineTool({
|
|
|
61481
61619
|
}),
|
|
61482
61620
|
async execute(args, ctx) {
|
|
61483
61621
|
try {
|
|
61484
|
-
const absInput =
|
|
61485
|
-
const absOutput =
|
|
61622
|
+
const absInput = resolve64(ctx.workingDirectory, args.input);
|
|
61623
|
+
const absOutput = resolve64(ctx.workingDirectory, args.output);
|
|
61486
61624
|
const codecMap = {
|
|
61487
61625
|
h264: "libx264",
|
|
61488
61626
|
h265: "libx265",
|
|
@@ -61535,11 +61673,11 @@ var mediaConcatTool = defineTool({
|
|
|
61535
61673
|
};
|
|
61536
61674
|
}
|
|
61537
61675
|
try {
|
|
61538
|
-
const absOutput =
|
|
61676
|
+
const absOutput = resolve64(ctx.workingDirectory, args.output);
|
|
61539
61677
|
if (args.reencode) {
|
|
61540
61678
|
const ffmpegArgs = [];
|
|
61541
61679
|
for (const i of args.inputs) {
|
|
61542
|
-
ffmpegArgs.push("-i",
|
|
61680
|
+
ffmpegArgs.push("-i", resolve64(ctx.workingDirectory, i));
|
|
61543
61681
|
}
|
|
61544
61682
|
const filterComplex = args.inputs.map((_, i) => `[${i}:v][${i}:a]`).join("");
|
|
61545
61683
|
ffmpegArgs.push(
|
|
@@ -61554,8 +61692,8 @@ var mediaConcatTool = defineTool({
|
|
|
61554
61692
|
);
|
|
61555
61693
|
await execSafe("ffmpeg", ffmpegArgs, { maxBuffer: 100 * 1024 * 1024 });
|
|
61556
61694
|
} else {
|
|
61557
|
-
const tempList =
|
|
61558
|
-
const listContent = args.inputs.map((i) => `file '${
|
|
61695
|
+
const tempList = resolve64(ctx.workingDirectory, `concat-list-${Date.now()}.txt`);
|
|
61696
|
+
const listContent = args.inputs.map((i) => `file '${resolve64(ctx.workingDirectory, i)}'`).join("\n");
|
|
61559
61697
|
await writeFile50(tempList, listContent, "utf-8");
|
|
61560
61698
|
try {
|
|
61561
61699
|
await execSafe(
|
|
@@ -62086,7 +62224,7 @@ var guideTool = defineTool({
|
|
|
62086
62224
|
var guideTools = [guideTool];
|
|
62087
62225
|
|
|
62088
62226
|
// src/tools/manifest/status.ts
|
|
62089
|
-
import { resolve as
|
|
62227
|
+
import { resolve as resolve65 } from "node:path";
|
|
62090
62228
|
init_status_jobs();
|
|
62091
62229
|
var PROJECT_DIR_DESCRIPTION4 = "Project directory. Defaults to the surface's cwd; in MCP hosts, relative paths resolve under the configured server workspace.";
|
|
62092
62230
|
var statusJobTool = defineTool({
|
|
@@ -62104,7 +62242,7 @@ var statusJobTool = defineTool({
|
|
|
62104
62242
|
output: external_exports.string().optional().describe("Download result media to this path when complete.")
|
|
62105
62243
|
}),
|
|
62106
62244
|
async execute(args, ctx) {
|
|
62107
|
-
const projectDir = args.projectDir ?
|
|
62245
|
+
const projectDir = args.projectDir ? resolve65(ctx.workingDirectory, args.projectDir) : findProjectRoot(ctx.workingDirectory);
|
|
62108
62246
|
const record = await readJobRecord(args.jobId, projectDir);
|
|
62109
62247
|
if (!record) return { success: false, error: `Job not found: ${args.jobId}` };
|
|
62110
62248
|
const result = args.refresh === false ? makeJobStatusResult(record, {
|
|
@@ -62113,7 +62251,7 @@ var statusJobTool = defineTool({
|
|
|
62113
62251
|
warnings: []
|
|
62114
62252
|
}) : await refreshJobRecord(record, {
|
|
62115
62253
|
wait: args.wait,
|
|
62116
|
-
output: args.output ?
|
|
62254
|
+
output: args.output ? resolve65(ctx.workingDirectory, args.output) : void 0,
|
|
62117
62255
|
workingDirectory: ctx.workingDirectory
|
|
62118
62256
|
});
|
|
62119
62257
|
return {
|
|
@@ -62138,7 +62276,7 @@ var statusProjectTool = defineTool({
|
|
|
62138
62276
|
refresh: external_exports.boolean().optional().describe("Refresh active supported jobs before summarizing. Default false.")
|
|
62139
62277
|
}),
|
|
62140
62278
|
async execute(args, ctx) {
|
|
62141
|
-
const projectDir = args.projectDir ?
|
|
62279
|
+
const projectDir = args.projectDir ? resolve65(ctx.workingDirectory, args.projectDir) : ctx.workingDirectory;
|
|
62142
62280
|
const result = await inspectProjectStatus(projectDir, { refresh: args.refresh === true });
|
|
62143
62281
|
return {
|
|
62144
62282
|
success: true,
|