@vibeframe/cli 0.111.1 → 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((resolve65) => setTimeout(resolve65, ms));
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: readFile44 } = await import("node:fs/promises");
4741
- const { join: join26, resolve: resolve65 } = await import("node:path");
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 = resolve65(baseDir, "node_modules", "kokoro-js");
4744
- const pkg = JSON.parse(await readFile44(join26(pkgDir, "package.json"), "utf-8"));
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(join26(pkgDir, entry)).href);
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((resolve65) => setTimeout(resolve65, ms));
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((resolve65) => setTimeout(resolve65, ms));
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((resolve65) => setTimeout(resolve65, ms));
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(resolve65) {
6201
- resolve65(value);
6200
+ return value instanceof P ? value : new P(function(resolve66) {
6201
+ resolve66(value);
6202
6202
  });
6203
6203
  }
6204
- return new (P || (P = Promise))(function(resolve65, reject) {
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 ? resolve65(result.value) : adopt(result.value).then(fulfilled, rejected);
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(resolve65) {
6306
- resolve65(value);
6305
+ return value instanceof P ? value : new P(function(resolve66) {
6306
+ resolve66(value);
6307
6307
  });
6308
6308
  }
6309
- return new (P || (P = Promise))(function(resolve65, reject) {
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 ? resolve65(result.value) : adopt(result.value).then(fulfilled, rejected);
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(resolve65) {
6433
- resolve65(value);
6432
+ return value instanceof P ? value : new P(function(resolve66) {
6433
+ resolve66(value);
6434
6434
  });
6435
6435
  }
6436
- return new (P || (P = Promise))(function(resolve65, reject) {
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 ? resolve65(result.value) : adopt(result.value).then(fulfilled, rejected);
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((resolve65) => setTimeout(resolve65, ms));
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(resolve65) {
6558
- resolve65(value);
6557
+ return value instanceof P ? value : new P(function(resolve66) {
6558
+ resolve66(value);
6559
6559
  });
6560
6560
  }
6561
- return new (P || (P = Promise))(function(resolve65, reject) {
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 ? resolve65(result.value) : adopt(result.value).then(fulfilled, rejected);
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(resolve65) {
6785
- resolve65(value);
6784
+ return value instanceof P ? value : new P(function(resolve66) {
6785
+ resolve66(value);
6786
6786
  });
6787
6787
  }
6788
- return new (P || (P = Promise))(function(resolve65, reject) {
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 ? resolve65(result.value) : adopt(result.value).then(fulfilled, rejected);
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(resolve65) {
6892
- resolve65(value);
6891
+ return value instanceof P ? value : new P(function(resolve66) {
6892
+ resolve66(value);
6893
6893
  });
6894
6894
  }
6895
- return new (P || (P = Promise))(function(resolve65, reject) {
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 ? resolve65(result.value) : adopt(result.value).then(fulfilled, rejected);
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(resolve65) {
7240
- resolve65(value);
7239
+ return value instanceof P ? value : new P(function(resolve66) {
7240
+ resolve66(value);
7241
7241
  });
7242
7242
  }
7243
- return new (P || (P = Promise))(function(resolve65, reject) {
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 ? resolve65(result.value) : adopt(result.value).then(fulfilled, rejected);
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(resolve65) {
7299
- resolve65(value);
7298
+ return value instanceof P ? value : new P(function(resolve66) {
7299
+ resolve66(value);
7300
7300
  });
7301
7301
  }
7302
- return new (P || (P = Promise))(function(resolve65, reject) {
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 ? resolve65(result.value) : adopt(result.value).then(fulfilled, rejected);
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((resolve65, reject) => {
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
- resolve65((_a2 = this.currentData) !== null && _a2 !== void 0 ? _a2 : {});
7562
+ resolve66((_a2 = this.currentData) !== null && _a2 !== void 0 ? _a2 : {});
7563
7563
  });
7564
7564
  this.on("done", (data) => {
7565
7565
  this.streamClosed = true;
7566
- resolve65(data);
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((resolve65) => setTimeout(resolve65, 16)));
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(resolve65) {
7637
- resolve65(value);
7636
+ return value instanceof P ? value : new P(function(resolve66) {
7637
+ resolve66(value);
7638
7638
  });
7639
7639
  }
7640
- return new (P || (P = Promise))(function(resolve65, reject) {
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 ? resolve65(result.value) : adopt(result.value).then(fulfilled, rejected);
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((resolve65, reject) => {
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
- resolve65(requestStatus);
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(resolve65) {
9785
- resolve65(value);
9784
+ return value instanceof P ? value : new P(function(resolve66) {
9785
+ resolve66(value);
9786
9786
  });
9787
9787
  }
9788
- return new (P || (P = Promise))(function(resolve65, reject) {
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 ? resolve65(result.value) : adopt(result.value).then(fulfilled, rejected);
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(resolve65) {
10130
- resolve65(value);
10129
+ return value instanceof P ? value : new P(function(resolve66) {
10130
+ resolve66(value);
10131
10131
  });
10132
10132
  }
10133
- return new (P || (P = Promise))(function(resolve65, reject) {
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 ? resolve65(result.value) : adopt(result.value).then(fulfilled, rejected);
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((resolve65) => setTimeout(resolve65, ms));
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((resolve65) => setTimeout(resolve65, ms));
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((resolve65) => {
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
- resolve65(input);
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
- resolve65(answer);
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((resolve65) => setTimeout(resolve65, ms));
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({
@@ -30123,14 +30123,15 @@ async function expectedRootSync(opts) {
30123
30123
  return { block, totalDurationSec: Number(cursor.toFixed(2)), audioRefs };
30124
30124
  }
30125
30125
  async function resolveSyncedBeatDuration(opts) {
30126
- if (opts.sceneDurationSec !== void 0) return Number(opts.sceneDurationSec.toFixed(2));
30127
30126
  const storyboardMin = opts.beatDuration ?? 3;
30128
- if (!opts.narrationPath) return Number(storyboardMin.toFixed(2));
30127
+ const reported = opts.sceneDurationSec;
30128
+ if (!opts.narrationPath) return Number((reported ?? storyboardMin).toFixed(2));
30129
+ const probe = opts.probeAudioDuration ?? getAudioDuration;
30129
30130
  try {
30130
- const audioDuration = await getAudioDuration(join7(opts.projectDir, opts.narrationPath));
30131
- return Number(Math.max(storyboardMin, audioDuration + 0.5).toFixed(2));
30131
+ const audioDuration = await probe(join7(opts.projectDir, opts.narrationPath));
30132
+ return Number(Math.max(storyboardMin, reported ?? 0, audioDuration + 0.5).toFixed(2));
30132
30133
  } catch {
30133
- return Number(storyboardMin.toFixed(2));
30134
+ return Number(Math.max(storyboardMin, reported ?? 0).toFixed(2));
30134
30135
  }
30135
30136
  }
30136
30137
  async function resolveProjectBeatDurations(projectDir) {
@@ -31508,6 +31509,22 @@ var init_chrome = __esm({
31508
31509
  }
31509
31510
  });
31510
31511
 
31512
+ // src/commands/_shared/ffmpeg-gate.ts
31513
+ function ffmpegToolsAvailable() {
31514
+ if (testOverride !== null) return testOverride;
31515
+ if (cached === null) cached = commandExists("ffmpeg") && commandExists("ffprobe");
31516
+ return cached;
31517
+ }
31518
+ var testOverride, cached;
31519
+ var init_ffmpeg_gate = __esm({
31520
+ "src/commands/_shared/ffmpeg-gate.ts"() {
31521
+ "use strict";
31522
+ init_exec_safe();
31523
+ testOverride = null;
31524
+ cached = null;
31525
+ }
31526
+ });
31527
+
31511
31528
  // src/commands/_shared/scene-audio-scan.ts
31512
31529
  import { readFile as readFile15 } from "node:fs/promises";
31513
31530
  import { resolve as resolve18 } from "node:path";
@@ -31833,6 +31850,33 @@ async function executeSceneRender(opts = {}) {
31833
31850
  error: `Project directory not found: ${projectDir}`
31834
31851
  };
31835
31852
  }
31853
+ if (!ffmpegToolsAvailable()) {
31854
+ return {
31855
+ success: false,
31856
+ kind: "render",
31857
+ beat: opts.beatId ?? null,
31858
+ code: "FFMPEG_MISSING",
31859
+ error: "FFmpeg (ffmpeg/ffprobe) was not found on PATH; rendering needs it for audio mux and duration checks. Install it (macOS: `brew install ffmpeg`) and retry."
31860
+ };
31861
+ }
31862
+ let autoSyncApplied = false;
31863
+ let autoSyncWarning;
31864
+ if (!opts.beatId && existsSync15(join14(projectDir, "STORYBOARD.md"))) {
31865
+ try {
31866
+ const rootPlan = await createProjectRootSyncPlan({ projectDir });
31867
+ const subPlans = await createSubCompDurationSyncPlans({
31868
+ projectDir,
31869
+ beats: await loadProjectRootSyncBeats(projectDir)
31870
+ });
31871
+ if (rootPlan.changed || subPlans.some((plan) => plan.changed)) {
31872
+ await executeSceneRepair({ projectDir });
31873
+ autoSyncApplied = true;
31874
+ autoSyncWarning = "Narration-synced durations drifted from the composed timeline; root and scene durations were re-synced before rendering (same pass as `vibe build --stage sync`).";
31875
+ }
31876
+ } catch (error) {
31877
+ autoSyncWarning = `Narration drift check skipped: ${error instanceof Error ? error.message : String(error)}`;
31878
+ }
31879
+ }
31836
31880
  let root = opts.root ?? projectConfig.config.composition.entry;
31837
31881
  if (opts.beatId) {
31838
31882
  const prepared = await prepareBeatRenderRoot({
@@ -31949,7 +31993,9 @@ async function executeSceneRender(opts = {}) {
31949
31993
  format: config2.format,
31950
31994
  audioCount,
31951
31995
  audioMuxApplied,
31952
- audioMuxWarning
31996
+ audioMuxWarning,
31997
+ ...autoSyncApplied ? { autoSyncApplied } : {},
31998
+ ...autoSyncWarning ? { autoSyncWarning } : {}
31953
31999
  };
31954
32000
  if (opts.revealInFinder) {
31955
32001
  try {
@@ -32209,6 +32255,10 @@ var init_scene_render = __esm({
32209
32255
  "src/commands/_shared/scene-render.ts"() {
32210
32256
  "use strict";
32211
32257
  init_chrome();
32258
+ init_ffmpeg_gate();
32259
+ init_root_sync();
32260
+ init_sub_comp_duration_sync();
32261
+ init_scene_repair();
32212
32262
  init_scene_lint();
32213
32263
  init_scene_audio_scan();
32214
32264
  init_scene_audio_mux();
@@ -33659,6 +33709,28 @@ async function executeSceneBuild(opts) {
33659
33709
  providerResolution: buildPlan.providerResolution,
33660
33710
  ...result
33661
33711
  });
33712
+ if (shouldRunStage(selectedStage, "assets") || shouldRunStage(selectedStage, "sync")) {
33713
+ if (!ffmpegToolsAvailable()) {
33714
+ return finishBuildResult({
33715
+ success: false,
33716
+ phase: "failed",
33717
+ mode,
33718
+ selectedStage,
33719
+ code: "FFMPEG_MISSING",
33720
+ error: "ffprobe (part of FFmpeg) was not found on PATH. Narration-synced durations cannot be computed without it.",
33721
+ message: "ffprobe not found on PATH.",
33722
+ suggestion: "Install FFmpeg (macOS: `brew install ffmpeg`), then re-run the build.",
33723
+ recoverable: true,
33724
+ beats: [],
33725
+ stageReports,
33726
+ warnings,
33727
+ retryWith,
33728
+ status: "failed",
33729
+ currentStage: "assets",
33730
+ totalLatencyMs: Date.now() - startedAt
33731
+ });
33732
+ }
33733
+ }
33662
33734
  if (!buildPlan.validation.ok) {
33663
33735
  let invalidBeats = [];
33664
33736
  if (existsSync19(storyboardPath)) {
@@ -35330,6 +35402,7 @@ var init_scene_build = __esm({
35330
35402
  import_dotenv3 = __toESM(require_main(), 1);
35331
35403
  init_dist2();
35332
35404
  init_audio();
35405
+ init_ffmpeg_gate();
35333
35406
  init_concurrency();
35334
35407
  init_compose_scenes_skills();
35335
35408
  init_compose_prompts();
@@ -42510,10 +42583,10 @@ async function prompt2(question) {
42510
42583
  input,
42511
42584
  output: process.stdout
42512
42585
  });
42513
- return new Promise((resolve65) => {
42586
+ return new Promise((resolve66) => {
42514
42587
  rl.question(question, (answer) => {
42515
42588
  rl.close();
42516
- resolve65(answer);
42589
+ resolve66(answer);
42517
42590
  });
42518
42591
  });
42519
42592
  }
@@ -53467,10 +53540,13 @@ function mapRenderResultToToolResult(result, projectDir) {
53467
53540
  format: result.format,
53468
53541
  audioCount: result.audioCount,
53469
53542
  audioMuxApplied: result.audioMuxApplied,
53470
- audioMuxWarning: result.audioMuxWarning
53543
+ audioMuxWarning: result.audioMuxWarning,
53544
+ ...result.autoSyncApplied ? { autoSyncApplied: true } : {},
53545
+ ...result.autoSyncWarning ? { autoSyncWarning: result.autoSyncWarning } : {}
53471
53546
  },
53472
53547
  humanLines: [
53473
53548
  `\u2705 Render complete: ${result.absoluteOutputPath ?? result.outputPath}`,
53549
+ ...result.autoSyncApplied ? [` auto-sync: narration-synced durations were re-applied before render`] : [],
53474
53550
  ` duration: ${((result.durationMs ?? 0) / 1e3).toFixed(1)}s`,
53475
53551
  ` frames: ${result.framesRendered ?? "?"}${result.totalFrames ? ` / ${result.totalFrames}` : ""}`,
53476
53552
  ` config: ${result.fps}fps \xB7 ${result.quality} \xB7 ${result.format}`,
@@ -59688,9 +59764,146 @@ var timelineTools = [
59688
59764
  ];
59689
59765
 
59690
59766
  // src/tools/manifest/project.ts
59691
- import { resolve as resolve60 } from "node:path";
59767
+ import { resolve as resolve61 } from "node:path";
59692
59768
  import { writeFile as writeFile49 } from "node:fs/promises";
59693
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
+ });
59694
59907
  var projectCreateTool = defineTool({
59695
59908
  name: "project_create",
59696
59909
  category: "project",
@@ -59706,7 +59919,7 @@ var projectCreateTool = defineTool({
59706
59919
  fps: external_exports.number().optional().describe("Frames per second (default: 30)")
59707
59920
  }),
59708
59921
  async execute(args, ctx) {
59709
- const outputPath = resolve60(ctx.workingDirectory, args.outputPath ?? `${args.name}.vibe.json`);
59922
+ const outputPath = resolve61(ctx.workingDirectory, args.outputPath ?? `${args.name}.vibe.json`);
59710
59923
  const project = new Project(args.name);
59711
59924
  if (args.fps) project.setFrameRate(args.fps);
59712
59925
  await writeFile49(outputPath, JSON.stringify(project.toJSON(), null, 2), "utf-8");
@@ -59747,12 +59960,13 @@ var projectInfoTool = defineTool({
59747
59960
  }
59748
59961
  });
59749
59962
  var projectTools = [
59963
+ projectListTool,
59750
59964
  projectCreateTool,
59751
59965
  projectInfoTool
59752
59966
  ];
59753
59967
 
59754
59968
  // src/tools/manifest/export.ts
59755
- import { resolve as resolve62 } from "node:path";
59969
+ import { resolve as resolve63 } from "node:path";
59756
59970
 
59757
59971
  // src/commands/export.ts
59758
59972
  init_esm();
@@ -59763,8 +59977,8 @@ init_exec_safe();
59763
59977
  init_output();
59764
59978
  init_validate();
59765
59979
  init_project_resolver();
59766
- import { readFile as readFile42, access as access6 } from "node:fs/promises";
59767
- import { resolve as resolve61, basename as basename17 } from "node:path";
59980
+ import { readFile as readFile43, access as access6 } from "node:fs/promises";
59981
+ import { resolve as resolve62, basename as basename17 } from "node:path";
59768
59982
  import { spawn } from "node:child_process";
59769
59983
  function timelineBaseName(path2) {
59770
59984
  const name = basename17(path2);
@@ -59840,7 +60054,7 @@ async function runExport(projectPath, outputPath, options = {}) {
59840
60054
  };
59841
60055
  }
59842
60056
  const filePath = await resolveTimelineFile(projectPath);
59843
- const content = await readFile42(filePath, "utf-8");
60057
+ const content = await readFile43(filePath, "utf-8");
59844
60058
  const data = JSON.parse(content);
59845
60059
  const project = Project.fromJSON(data);
59846
60060
  const summary = project.getSummary();
@@ -59850,7 +60064,7 @@ async function runExport(projectPath, outputPath, options = {}) {
59850
60064
  message: "Project has no clips to export"
59851
60065
  };
59852
60066
  }
59853
- const finalOutputPath = resolve61(process.cwd(), outputPath);
60067
+ const finalOutputPath = resolve62(process.cwd(), outputPath);
59854
60068
  const basePresetSettings = getPresetSettings(preset, summary.aspectRatio);
59855
60069
  const presetSettings = applyCustomOverrides(basePresetSettings, { bitrate, fps, resolution, codec });
59856
60070
  const clips = project.getClips().sort((a, b) => a.startTime - b.startTime);
@@ -59964,7 +60178,7 @@ Run 'vibe schema export' for structured parameter info.`).action(async (projectP
59964
60178
  }
59965
60179
  spinner2.text = "Loading project...";
59966
60180
  const filePath = await resolveTimelineFile(projectPath);
59967
- const content = await readFile42(filePath, "utf-8");
60181
+ const content = await readFile43(filePath, "utf-8");
59968
60182
  const data = JSON.parse(content);
59969
60183
  const project = Project.fromJSON(data);
59970
60184
  const summary = project.getSummary();
@@ -59972,7 +60186,7 @@ Run 'vibe schema export' for structured parameter info.`).action(async (projectP
59972
60186
  spinner2.fail("Project has no clips to export");
59973
60187
  exitWithError(usageError("Project has no clips to export"));
59974
60188
  }
59975
- const outputPath = options.output ? resolve61(process.cwd(), options.output) : resolve61(
60189
+ const outputPath = options.output ? resolve62(process.cwd(), options.output) : resolve62(
59976
60190
  process.cwd(),
59977
60191
  `${timelineBaseName(projectPath)}.${options.format}`
59978
60192
  );
@@ -60402,7 +60616,7 @@ function buildFFmpegArgs(clips, sources, presetSettings, outputPath, options, so
60402
60616
  return args;
60403
60617
  }
60404
60618
  function runFFmpegProcess(ffmpegPath, args, onProgress) {
60405
- return new Promise((resolve65, reject) => {
60619
+ return new Promise((resolve66, reject) => {
60406
60620
  const ffmpeg = spawn(ffmpegPath, args, {
60407
60621
  stdio: ["pipe", "pipe", "pipe"]
60408
60622
  });
@@ -60426,7 +60640,7 @@ function runFFmpegProcess(ffmpegPath, args, onProgress) {
60426
60640
  });
60427
60641
  ffmpeg.on("close", (code) => {
60428
60642
  if (code === 0) {
60429
- resolve65();
60643
+ resolve66();
60430
60644
  } else {
60431
60645
  const errorMatch = stderr.match(/Error.*$/m);
60432
60646
  const errorMsg = errorMatch ? errorMatch[0] : `FFmpeg exited with code ${code}`;
@@ -60562,17 +60776,17 @@ function getPresetSettings(preset, aspectRatio2) {
60562
60776
  }
60563
60777
  async function runHyperframesExport(projectPath, options, spinner2, startedAt) {
60564
60778
  spinner2.text = "Loading project...";
60565
- const { readFile: readFile44 } = await import("node:fs/promises");
60566
- const { resolve: resolve65 } = await import("node:path");
60779
+ const { readFile: readFile45 } = await import("node:fs/promises");
60780
+ const { resolve: resolve66 } = await import("node:path");
60567
60781
  const { Project: Project2 } = await Promise.resolve().then(() => (init_engine(), engine_exports));
60568
60782
  const { createHyperframesBackend: createHyperframesBackend2 } = await Promise.resolve().then(() => (init_hyperframes(), hyperframes_exports));
60569
60783
  const { exitWithError: exitWithError2, generalError: generalError2, outputSuccess: outputSuccess2 } = await Promise.resolve().then(() => (init_output(), output_exports));
60570
60784
  const chalk2 = (await Promise.resolve().then(() => (init_source(), source_exports))).default;
60571
60785
  const filePath = await resolveTimelineFile(projectPath);
60572
- const content = await readFile44(filePath, "utf-8");
60786
+ const content = await readFile45(filePath, "utf-8");
60573
60787
  const project = Project2.fromJSON(JSON.parse(content));
60574
60788
  const state = project.getState();
60575
- const outputPath = options.output ? resolve65(process.cwd(), options.output) : resolve65(process.cwd(), `${timelineBaseName(projectPath)}.${options.format ?? "mp4"}`);
60789
+ const outputPath = options.output ? resolve66(process.cwd(), options.output) : resolve66(process.cwd(), `${timelineBaseName(projectPath)}.${options.format ?? "mp4"}`);
60576
60790
  const quality = ["draft", "standard", "high"].includes(options.preset ?? "") ? options.preset : "standard";
60577
60791
  const backend = createHyperframesBackend2();
60578
60792
  spinner2.text = "Rendering with Hyperframes...";
@@ -60620,8 +60834,8 @@ var exportVideoTool = defineTool({
60620
60834
  overwrite: external_exports.boolean().optional().describe("Overwrite existing output file (default: false)")
60621
60835
  }),
60622
60836
  async execute(args, ctx) {
60623
- const projectPath = resolve62(ctx.workingDirectory, args.projectPath);
60624
- const outputPath = resolve62(ctx.workingDirectory, args.outputPath);
60837
+ const projectPath = resolve63(ctx.workingDirectory, args.projectPath);
60838
+ const outputPath = resolve63(ctx.workingDirectory, args.outputPath);
60625
60839
  const result = await runExport(projectPath, outputPath, {
60626
60840
  preset: args.preset,
60627
60841
  format: args.format,
@@ -60638,8 +60852,8 @@ var exportVideoTool = defineTool({
60638
60852
  var exportTools = [exportVideoTool];
60639
60853
 
60640
60854
  // src/tools/manifest/agent-only.ts
60641
- import { readFile as readFile43, writeFile as writeFile50, readdir as readdir6, stat as stat7, access as access7, unlink as unlink4 } from "node:fs/promises";
60642
- import { resolve as resolve63, join as join25, basename as basename18, extname as extname12 } from "node:path";
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";
60643
60857
  init_engine();
60644
60858
  init_exec_safe();
60645
60859
  init_project_resolver();
@@ -60712,13 +60926,13 @@ var fsListTool = defineTool({
60712
60926
  async execute(args, ctx) {
60713
60927
  const dirPath = args.path ?? ".";
60714
60928
  try {
60715
- const absPath = resolve63(ctx.workingDirectory, dirPath);
60716
- const entries = await readdir6(absPath, { withFileTypes: true });
60929
+ const absPath = resolve64(ctx.workingDirectory, dirPath);
60930
+ const entries = await readdir7(absPath, { withFileTypes: true });
60717
60931
  const results = [];
60718
60932
  for (const entry of entries) {
60719
60933
  if (args.pattern && !matchPattern(entry.name, args.pattern)) continue;
60720
- const fullPath = join25(absPath, entry.name);
60721
- const stats = await stat7(fullPath);
60934
+ const fullPath = join26(absPath, entry.name);
60935
+ const stats = await stat8(fullPath);
60722
60936
  if (entry.isDirectory()) {
60723
60937
  results.push(`[DIR] ${entry.name}/`);
60724
60938
  } else {
@@ -60745,8 +60959,8 @@ var fsReadTool = defineTool({
60745
60959
  }),
60746
60960
  async execute(args, ctx) {
60747
60961
  try {
60748
- const absPath = resolve63(ctx.workingDirectory, args.path);
60749
- const content = await readFile43(absPath, "utf-8");
60962
+ const absPath = resolve64(ctx.workingDirectory, args.path);
60963
+ const content = await readFile44(absPath, "utf-8");
60750
60964
  const maxLength = 4e3;
60751
60965
  const truncated = content.length > maxLength;
60752
60966
  const output = truncated ? content.substring(0, maxLength) + "\n... (truncated)" : content;
@@ -60770,7 +60984,7 @@ var fsWriteTool = defineTool({
60770
60984
  }),
60771
60985
  async execute(args, ctx) {
60772
60986
  try {
60773
- const absPath = resolve63(ctx.workingDirectory, args.path);
60987
+ const absPath = resolve64(ctx.workingDirectory, args.path);
60774
60988
  await writeFile50(absPath, args.content, "utf-8");
60775
60989
  return { success: true, data: { bytes: args.content.length }, humanLines: [`File written: ${args.path} (${formatSize(args.content.length)})`] };
60776
60990
  } catch (error) {
@@ -60790,10 +61004,10 @@ var fsExistsTool = defineTool({
60790
61004
  path: external_exports.string().describe("Path to check")
60791
61005
  }),
60792
61006
  async execute(args, ctx) {
60793
- const absPath = resolve63(ctx.workingDirectory, args.path);
61007
+ const absPath = resolve64(ctx.workingDirectory, args.path);
60794
61008
  try {
60795
61009
  await access7(absPath);
60796
- const stats = await stat7(absPath);
61010
+ const stats = await stat8(absPath);
60797
61011
  const type = stats.isDirectory() ? "directory" : "file";
60798
61012
  return { success: true, data: { exists: true, type }, humanLines: [`${type} exists: ${args.path}`] };
60799
61013
  } catch {
@@ -60818,19 +61032,19 @@ var batchImportTool = defineTool({
60818
61032
  }),
60819
61033
  async execute(args, ctx) {
60820
61034
  try {
60821
- const filePath = resolve63(ctx.workingDirectory, args.project);
60822
- const content = await readFile43(filePath, "utf-8");
61035
+ const filePath = resolve64(ctx.workingDirectory, args.project);
61036
+ const content = await readFile44(filePath, "utf-8");
60823
61037
  const data = JSON.parse(content);
60824
61038
  const project = Project.fromJSON(data);
60825
- const dirPath = resolve63(ctx.workingDirectory, args.directory);
61039
+ const dirPath = resolve64(ctx.workingDirectory, args.directory);
60826
61040
  const filterExts = args.filter ? args.filter.split(",").map((e) => e.trim().toLowerCase()) : null;
60827
61041
  const imageDuration = args.imageDuration ?? 5;
60828
61042
  const recursive = args.recursive ?? false;
60829
61043
  const mediaFiles = [];
60830
61044
  const scanDir = async (dir) => {
60831
- const entries = await readdir6(dir, { withFileTypes: true });
61045
+ const entries = await readdir7(dir, { withFileTypes: true });
60832
61046
  for (const entry of entries) {
60833
- const entryPath = join25(dir, entry.name);
61047
+ const entryPath = join26(dir, entry.name);
60834
61048
  if (entry.isDirectory() && recursive) {
60835
61049
  await scanDir(entryPath);
60836
61050
  } else if (entry.isFile()) {
@@ -60890,8 +61104,8 @@ var batchConcatTool = defineTool({
60890
61104
  }),
60891
61105
  async execute(args, ctx) {
60892
61106
  try {
60893
- const filePath = resolve63(ctx.workingDirectory, args.project);
60894
- const content = await readFile43(filePath, "utf-8");
61107
+ const filePath = resolve64(ctx.workingDirectory, args.project);
61108
+ const content = await readFile44(filePath, "utf-8");
60895
61109
  const data = JSON.parse(content);
60896
61110
  const project = Project.fromJSON(data);
60897
61111
  const sourceIds = args.sourceIds ?? [];
@@ -60961,8 +61175,8 @@ var batchApplyEffectTool = defineTool({
60961
61175
  }),
60962
61176
  async execute(args, ctx) {
60963
61177
  try {
60964
- const filePath = resolve63(ctx.workingDirectory, args.project);
60965
- const content = await readFile43(filePath, "utf-8");
61178
+ const filePath = resolve64(ctx.workingDirectory, args.project);
61179
+ const content = await readFile44(filePath, "utf-8");
60966
61180
  const data = JSON.parse(content);
60967
61181
  const project = Project.fromJSON(data);
60968
61182
  const clipIds = args.clipIds ?? [];
@@ -61017,7 +61231,7 @@ var timelineClearTool = defineTool({
61017
61231
  async execute(args, ctx) {
61018
61232
  try {
61019
61233
  const filePath = await resolveTimelineFile(args.project, ctx.workingDirectory);
61020
- const content = await readFile43(filePath, "utf-8");
61234
+ const content = await readFile44(filePath, "utf-8");
61021
61235
  const data = JSON.parse(content);
61022
61236
  const project = Project.fromJSON(data);
61023
61237
  const what = args.what ?? "clips";
@@ -61094,7 +61308,7 @@ var projectSetTool = defineTool({
61094
61308
  async execute(args, ctx) {
61095
61309
  try {
61096
61310
  const filePath = await resolveTimelineFile(args.projectPath, ctx.workingDirectory);
61097
- const content = await readFile43(filePath, "utf-8");
61311
+ const content = await readFile44(filePath, "utf-8");
61098
61312
  const data = JSON.parse(content);
61099
61313
  const project = Project.fromJSON(data);
61100
61314
  const updates = [];
@@ -61253,7 +61467,7 @@ var mediaInfoTool = defineTool({
61253
61467
  }),
61254
61468
  async execute(args, ctx) {
61255
61469
  try {
61256
- const absPath = resolve63(ctx.workingDirectory, args.path);
61470
+ const absPath = resolve64(ctx.workingDirectory, args.path);
61257
61471
  const { stdout } = await execSafe(
61258
61472
  "ffprobe",
61259
61473
  ["-v", "quiet", "-print_format", "json", "-show_format", "-show_streams", absPath],
@@ -61342,10 +61556,10 @@ var mediaCompressTool = defineTool({
61342
61556
  }),
61343
61557
  async execute(args, ctx) {
61344
61558
  try {
61345
- const absInput = resolve63(ctx.workingDirectory, args.input);
61559
+ const absInput = resolve64(ctx.workingDirectory, args.input);
61346
61560
  const ext = args.input.split(".").pop() || "mp4";
61347
61561
  const baseName = args.input.replace(/\.[^/.]+$/, "");
61348
- const outputPath = args.output ? resolve63(ctx.workingDirectory, args.output) : resolve63(ctx.workingDirectory, `${baseName}-compressed.${ext}`);
61562
+ const outputPath = args.output ? resolve64(ctx.workingDirectory, args.output) : resolve64(ctx.workingDirectory, `${baseName}-compressed.${ext}`);
61349
61563
  const crfValues = { low: 28, medium: 23, high: 18 };
61350
61564
  const crf = crfValues[args.quality ?? "medium"];
61351
61565
  await execSafe(
@@ -61368,8 +61582,8 @@ var mediaCompressTool = defineTool({
61368
61582
  ],
61369
61583
  { maxBuffer: 50 * 1024 * 1024 }
61370
61584
  );
61371
- const inputBuf = await readFile43(absInput);
61372
- const outputBuf = await readFile43(outputPath);
61585
+ const inputBuf = await readFile44(absInput);
61586
+ const outputBuf = await readFile44(outputPath);
61373
61587
  const inputSize = inputBuf.length;
61374
61588
  const outputSize = outputBuf.length;
61375
61589
  const reduction = (inputSize - outputSize) / inputSize * 100;
@@ -61405,8 +61619,8 @@ var mediaConvertTool = defineTool({
61405
61619
  }),
61406
61620
  async execute(args, ctx) {
61407
61621
  try {
61408
- const absInput = resolve63(ctx.workingDirectory, args.input);
61409
- const absOutput = resolve63(ctx.workingDirectory, args.output);
61622
+ const absInput = resolve64(ctx.workingDirectory, args.input);
61623
+ const absOutput = resolve64(ctx.workingDirectory, args.output);
61410
61624
  const codecMap = {
61411
61625
  h264: "libx264",
61412
61626
  h265: "libx265",
@@ -61459,11 +61673,11 @@ var mediaConcatTool = defineTool({
61459
61673
  };
61460
61674
  }
61461
61675
  try {
61462
- const absOutput = resolve63(ctx.workingDirectory, args.output);
61676
+ const absOutput = resolve64(ctx.workingDirectory, args.output);
61463
61677
  if (args.reencode) {
61464
61678
  const ffmpegArgs = [];
61465
61679
  for (const i of args.inputs) {
61466
- ffmpegArgs.push("-i", resolve63(ctx.workingDirectory, i));
61680
+ ffmpegArgs.push("-i", resolve64(ctx.workingDirectory, i));
61467
61681
  }
61468
61682
  const filterComplex = args.inputs.map((_, i) => `[${i}:v][${i}:a]`).join("");
61469
61683
  ffmpegArgs.push(
@@ -61478,8 +61692,8 @@ var mediaConcatTool = defineTool({
61478
61692
  );
61479
61693
  await execSafe("ffmpeg", ffmpegArgs, { maxBuffer: 100 * 1024 * 1024 });
61480
61694
  } else {
61481
- const tempList = resolve63(ctx.workingDirectory, `concat-list-${Date.now()}.txt`);
61482
- const listContent = args.inputs.map((i) => `file '${resolve63(ctx.workingDirectory, i)}'`).join("\n");
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");
61483
61697
  await writeFile50(tempList, listContent, "utf-8");
61484
61698
  try {
61485
61699
  await execSafe(
@@ -62010,7 +62224,7 @@ var guideTool = defineTool({
62010
62224
  var guideTools = [guideTool];
62011
62225
 
62012
62226
  // src/tools/manifest/status.ts
62013
- import { resolve as resolve64 } from "node:path";
62227
+ import { resolve as resolve65 } from "node:path";
62014
62228
  init_status_jobs();
62015
62229
  var PROJECT_DIR_DESCRIPTION4 = "Project directory. Defaults to the surface's cwd; in MCP hosts, relative paths resolve under the configured server workspace.";
62016
62230
  var statusJobTool = defineTool({
@@ -62028,7 +62242,7 @@ var statusJobTool = defineTool({
62028
62242
  output: external_exports.string().optional().describe("Download result media to this path when complete.")
62029
62243
  }),
62030
62244
  async execute(args, ctx) {
62031
- const projectDir = args.projectDir ? resolve64(ctx.workingDirectory, args.projectDir) : findProjectRoot(ctx.workingDirectory);
62245
+ const projectDir = args.projectDir ? resolve65(ctx.workingDirectory, args.projectDir) : findProjectRoot(ctx.workingDirectory);
62032
62246
  const record = await readJobRecord(args.jobId, projectDir);
62033
62247
  if (!record) return { success: false, error: `Job not found: ${args.jobId}` };
62034
62248
  const result = args.refresh === false ? makeJobStatusResult(record, {
@@ -62037,7 +62251,7 @@ var statusJobTool = defineTool({
62037
62251
  warnings: []
62038
62252
  }) : await refreshJobRecord(record, {
62039
62253
  wait: args.wait,
62040
- output: args.output ? resolve64(ctx.workingDirectory, args.output) : void 0,
62254
+ output: args.output ? resolve65(ctx.workingDirectory, args.output) : void 0,
62041
62255
  workingDirectory: ctx.workingDirectory
62042
62256
  });
62043
62257
  return {
@@ -62062,7 +62276,7 @@ var statusProjectTool = defineTool({
62062
62276
  refresh: external_exports.boolean().optional().describe("Refresh active supported jobs before summarizing. Default false.")
62063
62277
  }),
62064
62278
  async execute(args, ctx) {
62065
- const projectDir = args.projectDir ? resolve64(ctx.workingDirectory, args.projectDir) : ctx.workingDirectory;
62279
+ const projectDir = args.projectDir ? resolve65(ctx.workingDirectory, args.projectDir) : ctx.workingDirectory;
62066
62280
  const result = await inspectProjectStatus(projectDir, { refresh: args.refresh === true });
62067
62281
  return {
62068
62282
  success: true,