@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.
package/dist/index.js CHANGED
@@ -7844,7 +7844,7 @@ function errorMessage(error) {
7844
7844
  return error instanceof Error ? error.message : "Unknown error";
7845
7845
  }
7846
7846
  function sleep(ms) {
7847
- return new Promise((resolve85) => setTimeout(resolve85, ms));
7847
+ return new Promise((resolve86) => setTimeout(resolve86, ms));
7848
7848
  }
7849
7849
  var ProviderHttpError;
7850
7850
  var init_http = __esm({
@@ -11612,15 +11612,15 @@ async function loadKokoroFactory() {
11612
11612
  }
11613
11613
  async function loadKokoroFromWorkspace(baseDir = process.cwd()) {
11614
11614
  try {
11615
- const { readFile: readFile55 } = await import("node:fs/promises");
11616
- const { join: join29, resolve: resolve85 } = await import("node:path");
11615
+ const { readFile: readFile56 } = await import("node:fs/promises");
11616
+ const { join: join30, resolve: resolve86 } = await import("node:path");
11617
11617
  const { pathToFileURL } = await import("node:url");
11618
- const pkgDir = resolve85(baseDir, "node_modules", "kokoro-js");
11619
- const pkg = JSON.parse(await readFile55(join29(pkgDir, "package.json"), "utf-8"));
11618
+ const pkgDir = resolve86(baseDir, "node_modules", "kokoro-js");
11619
+ const pkg = JSON.parse(await readFile56(join30(pkgDir, "package.json"), "utf-8"));
11620
11620
  const entry = pkg.exports?.node?.import ?? pkg.exports?.default ?? pkg.module ?? pkg.main;
11621
11621
  if (!entry)
11622
11622
  return null;
11623
- const mod = await import(pathToFileURL(join29(pkgDir, entry)).href);
11623
+ const mod = await import(pathToFileURL(join30(pkgDir, entry)).href);
11624
11624
  return mod.KokoroTTS ?? null;
11625
11625
  } catch {
11626
11626
  return null;
@@ -12278,7 +12278,7 @@ var init_RunwayProvider = __esm({
12278
12278
  * Sleep helper
12279
12279
  */
12280
12280
  sleep(ms) {
12281
- return new Promise((resolve85) => setTimeout(resolve85, ms));
12281
+ return new Promise((resolve86) => setTimeout(resolve86, ms));
12282
12282
  }
12283
12283
  };
12284
12284
  RunwayProvider.API_VERSION = "2024-11-06";
@@ -12719,7 +12719,7 @@ var init_KlingProvider = __esm({
12719
12719
  * Sleep helper
12720
12720
  */
12721
12721
  sleep(ms) {
12722
- return new Promise((resolve85) => setTimeout(resolve85, ms));
12722
+ return new Promise((resolve86) => setTimeout(resolve86, ms));
12723
12723
  }
12724
12724
  };
12725
12725
  klingProvider = new KlingProvider();
@@ -13037,7 +13037,7 @@ var init_GrokProvider = __esm({
13037
13037
  }
13038
13038
  }
13039
13039
  sleep(ms) {
13040
- return new Promise((resolve85) => setTimeout(resolve85, ms));
13040
+ return new Promise((resolve86) => setTimeout(resolve86, ms));
13041
13041
  }
13042
13042
  };
13043
13043
  grokProvider = new GrokProvider();
@@ -13072,11 +13072,11 @@ var require_middleware = __commonJS({
13072
13072
  "use strict";
13073
13073
  var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
13074
13074
  function adopt(value) {
13075
- return value instanceof P ? value : new P(function(resolve85) {
13076
- resolve85(value);
13075
+ return value instanceof P ? value : new P(function(resolve86) {
13076
+ resolve86(value);
13077
13077
  });
13078
13078
  }
13079
- return new (P || (P = Promise))(function(resolve85, reject) {
13079
+ return new (P || (P = Promise))(function(resolve86, reject) {
13080
13080
  function fulfilled(value) {
13081
13081
  try {
13082
13082
  step(generator.next(value));
@@ -13092,7 +13092,7 @@ var require_middleware = __commonJS({
13092
13092
  }
13093
13093
  }
13094
13094
  function step(result) {
13095
- result.done ? resolve85(result.value) : adopt(result.value).then(fulfilled, rejected);
13095
+ result.done ? resolve86(result.value) : adopt(result.value).then(fulfilled, rejected);
13096
13096
  }
13097
13097
  step((generator = generator.apply(thisArg, _arguments || [])).next());
13098
13098
  });
@@ -13177,11 +13177,11 @@ var require_response = __commonJS({
13177
13177
  "use strict";
13178
13178
  var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
13179
13179
  function adopt(value) {
13180
- return value instanceof P ? value : new P(function(resolve85) {
13181
- resolve85(value);
13180
+ return value instanceof P ? value : new P(function(resolve86) {
13181
+ resolve86(value);
13182
13182
  });
13183
13183
  }
13184
- return new (P || (P = Promise))(function(resolve85, reject) {
13184
+ return new (P || (P = Promise))(function(resolve86, reject) {
13185
13185
  function fulfilled(value) {
13186
13186
  try {
13187
13187
  step(generator.next(value));
@@ -13197,7 +13197,7 @@ var require_response = __commonJS({
13197
13197
  }
13198
13198
  }
13199
13199
  function step(result) {
13200
- result.done ? resolve85(result.value) : adopt(result.value).then(fulfilled, rejected);
13200
+ result.done ? resolve86(result.value) : adopt(result.value).then(fulfilled, rejected);
13201
13201
  }
13202
13202
  step((generator = generator.apply(thisArg, _arguments || [])).next());
13203
13203
  });
@@ -13304,11 +13304,11 @@ var require_utils = __commonJS({
13304
13304
  "use strict";
13305
13305
  var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
13306
13306
  function adopt(value) {
13307
- return value instanceof P ? value : new P(function(resolve85) {
13308
- resolve85(value);
13307
+ return value instanceof P ? value : new P(function(resolve86) {
13308
+ resolve86(value);
13309
13309
  });
13310
13310
  }
13311
- return new (P || (P = Promise))(function(resolve85, reject) {
13311
+ return new (P || (P = Promise))(function(resolve86, reject) {
13312
13312
  function fulfilled(value) {
13313
13313
  try {
13314
13314
  step(generator.next(value));
@@ -13324,7 +13324,7 @@ var require_utils = __commonJS({
13324
13324
  }
13325
13325
  }
13326
13326
  function step(result) {
13327
- result.done ? resolve85(result.value) : adopt(result.value).then(fulfilled, rejected);
13327
+ result.done ? resolve86(result.value) : adopt(result.value).then(fulfilled, rejected);
13328
13328
  }
13329
13329
  step((generator = generator.apply(thisArg, _arguments || [])).next());
13330
13330
  });
@@ -13417,7 +13417,7 @@ var require_utils = __commonJS({
13417
13417
  }
13418
13418
  function sleep4(ms) {
13419
13419
  return __awaiter(this, void 0, void 0, function* () {
13420
- return new Promise((resolve85) => setTimeout(resolve85, ms));
13420
+ return new Promise((resolve86) => setTimeout(resolve86, ms));
13421
13421
  });
13422
13422
  }
13423
13423
  }
@@ -13429,11 +13429,11 @@ var require_retry = __commonJS({
13429
13429
  "use strict";
13430
13430
  var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
13431
13431
  function adopt(value) {
13432
- return value instanceof P ? value : new P(function(resolve85) {
13433
- resolve85(value);
13432
+ return value instanceof P ? value : new P(function(resolve86) {
13433
+ resolve86(value);
13434
13434
  });
13435
13435
  }
13436
- return new (P || (P = Promise))(function(resolve85, reject) {
13436
+ return new (P || (P = Promise))(function(resolve86, reject) {
13437
13437
  function fulfilled(value) {
13438
13438
  try {
13439
13439
  step(generator.next(value));
@@ -13449,7 +13449,7 @@ var require_retry = __commonJS({
13449
13449
  }
13450
13450
  }
13451
13451
  function step(result) {
13452
- result.done ? resolve85(result.value) : adopt(result.value).then(fulfilled, rejected);
13452
+ result.done ? resolve86(result.value) : adopt(result.value).then(fulfilled, rejected);
13453
13453
  }
13454
13454
  step((generator = generator.apply(thisArg, _arguments || [])).next());
13455
13455
  });
@@ -13656,11 +13656,11 @@ var require_request = __commonJS({
13656
13656
  "use strict";
13657
13657
  var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
13658
13658
  function adopt(value) {
13659
- return value instanceof P ? value : new P(function(resolve85) {
13660
- resolve85(value);
13659
+ return value instanceof P ? value : new P(function(resolve86) {
13660
+ resolve86(value);
13661
13661
  });
13662
13662
  }
13663
- return new (P || (P = Promise))(function(resolve85, reject) {
13663
+ return new (P || (P = Promise))(function(resolve86, reject) {
13664
13664
  function fulfilled(value) {
13665
13665
  try {
13666
13666
  step(generator.next(value));
@@ -13676,7 +13676,7 @@ var require_request = __commonJS({
13676
13676
  }
13677
13677
  }
13678
13678
  function step(result) {
13679
- result.done ? resolve85(result.value) : adopt(result.value).then(fulfilled, rejected);
13679
+ result.done ? resolve86(result.value) : adopt(result.value).then(fulfilled, rejected);
13680
13680
  }
13681
13681
  step((generator = generator.apply(thisArg, _arguments || [])).next());
13682
13682
  });
@@ -13763,11 +13763,11 @@ var require_storage = __commonJS({
13763
13763
  "use strict";
13764
13764
  var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
13765
13765
  function adopt(value) {
13766
- return value instanceof P ? value : new P(function(resolve85) {
13767
- resolve85(value);
13766
+ return value instanceof P ? value : new P(function(resolve86) {
13767
+ resolve86(value);
13768
13768
  });
13769
13769
  }
13770
- return new (P || (P = Promise))(function(resolve85, reject) {
13770
+ return new (P || (P = Promise))(function(resolve86, reject) {
13771
13771
  function fulfilled(value) {
13772
13772
  try {
13773
13773
  step(generator.next(value));
@@ -13783,7 +13783,7 @@ var require_storage = __commonJS({
13783
13783
  }
13784
13784
  }
13785
13785
  function step(result) {
13786
- result.done ? resolve85(result.value) : adopt(result.value).then(fulfilled, rejected);
13786
+ result.done ? resolve86(result.value) : adopt(result.value).then(fulfilled, rejected);
13787
13787
  }
13788
13788
  step((generator = generator.apply(thisArg, _arguments || [])).next());
13789
13789
  });
@@ -14111,11 +14111,11 @@ var require_auth = __commonJS({
14111
14111
  "use strict";
14112
14112
  var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
14113
14113
  function adopt(value) {
14114
- return value instanceof P ? value : new P(function(resolve85) {
14115
- resolve85(value);
14114
+ return value instanceof P ? value : new P(function(resolve86) {
14115
+ resolve86(value);
14116
14116
  });
14117
14117
  }
14118
- return new (P || (P = Promise))(function(resolve85, reject) {
14118
+ return new (P || (P = Promise))(function(resolve86, reject) {
14119
14119
  function fulfilled(value) {
14120
14120
  try {
14121
14121
  step(generator.next(value));
@@ -14131,7 +14131,7 @@ var require_auth = __commonJS({
14131
14131
  }
14132
14132
  }
14133
14133
  function step(result) {
14134
- result.done ? resolve85(result.value) : adopt(result.value).then(fulfilled, rejected);
14134
+ result.done ? resolve86(result.value) : adopt(result.value).then(fulfilled, rejected);
14135
14135
  }
14136
14136
  step((generator = generator.apply(thisArg, _arguments || [])).next());
14137
14137
  });
@@ -14170,11 +14170,11 @@ var require_streaming = __commonJS({
14170
14170
  "use strict";
14171
14171
  var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
14172
14172
  function adopt(value) {
14173
- return value instanceof P ? value : new P(function(resolve85) {
14174
- resolve85(value);
14173
+ return value instanceof P ? value : new P(function(resolve86) {
14174
+ resolve86(value);
14175
14175
  });
14176
14176
  }
14177
- return new (P || (P = Promise))(function(resolve85, reject) {
14177
+ return new (P || (P = Promise))(function(resolve86, reject) {
14178
14178
  function fulfilled(value) {
14179
14179
  try {
14180
14180
  step(generator.next(value));
@@ -14190,7 +14190,7 @@ var require_streaming = __commonJS({
14190
14190
  }
14191
14191
  }
14192
14192
  function step(result) {
14193
- result.done ? resolve85(result.value) : adopt(result.value).then(fulfilled, rejected);
14193
+ result.done ? resolve86(result.value) : adopt(result.value).then(fulfilled, rejected);
14194
14194
  }
14195
14195
  step((generator = generator.apply(thisArg, _arguments || [])).next());
14196
14196
  });
@@ -14423,7 +14423,7 @@ var require_streaming = __commonJS({
14423
14423
  query: options.queryParams
14424
14424
  });
14425
14425
  this.options = options;
14426
- this.donePromise = new Promise((resolve85, reject) => {
14426
+ this.donePromise = new Promise((resolve86, reject) => {
14427
14427
  if (this.streamClosed) {
14428
14428
  reject(new response_1.ApiError({
14429
14429
  message: "Streaming connection is already closed.",
@@ -14434,11 +14434,11 @@ var require_streaming = __commonJS({
14434
14434
  }
14435
14435
  this.signal.addEventListener("abort", () => {
14436
14436
  var _a2;
14437
- resolve85((_a2 = this.currentData) !== null && _a2 !== void 0 ? _a2 : {});
14437
+ resolve86((_a2 = this.currentData) !== null && _a2 !== void 0 ? _a2 : {});
14438
14438
  });
14439
14439
  this.on("done", (data) => {
14440
14440
  this.streamClosed = true;
14441
- resolve85(data);
14441
+ resolve86(data);
14442
14442
  });
14443
14443
  this.on("error", (error) => {
14444
14444
  this.streamClosed = true;
@@ -14463,7 +14463,7 @@ var require_streaming = __commonJS({
14463
14463
  if (data) {
14464
14464
  yield yield __await(data);
14465
14465
  }
14466
- yield __await(new Promise((resolve85) => setTimeout(resolve85, 16)));
14466
+ yield __await(new Promise((resolve86) => setTimeout(resolve86, 16)));
14467
14467
  }
14468
14468
  });
14469
14469
  }
@@ -14508,11 +14508,11 @@ var require_queue = __commonJS({
14508
14508
  "use strict";
14509
14509
  var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
14510
14510
  function adopt(value) {
14511
- return value instanceof P ? value : new P(function(resolve85) {
14512
- resolve85(value);
14511
+ return value instanceof P ? value : new P(function(resolve86) {
14512
+ resolve86(value);
14513
14513
  });
14514
14514
  }
14515
- return new (P || (P = Promise))(function(resolve85, reject) {
14515
+ return new (P || (P = Promise))(function(resolve86, reject) {
14516
14516
  function fulfilled(value) {
14517
14517
  try {
14518
14518
  step(generator.next(value));
@@ -14528,7 +14528,7 @@ var require_queue = __commonJS({
14528
14528
  }
14529
14529
  }
14530
14530
  function step(result) {
14531
- result.done ? resolve85(result.value) : adopt(result.value).then(fulfilled, rejected);
14531
+ result.done ? resolve86(result.value) : adopt(result.value).then(fulfilled, rejected);
14532
14532
  }
14533
14533
  step((generator = generator.apply(thisArg, _arguments || [])).next());
14534
14534
  });
@@ -14663,7 +14663,7 @@ var require_queue = __commonJS({
14663
14663
  }
14664
14664
  return doneStatus;
14665
14665
  }
14666
- return new Promise((resolve85, reject) => {
14666
+ return new Promise((resolve86, reject) => {
14667
14667
  var _a;
14668
14668
  let pollingTimeoutId;
14669
14669
  const pollInterval = "pollInterval" in options && typeof options.pollInterval === "number" ? (_a = options.pollInterval) !== null && _a !== void 0 ? _a : DEFAULT_POLL_INTERVAL : DEFAULT_POLL_INTERVAL;
@@ -14695,7 +14695,7 @@ var require_queue = __commonJS({
14695
14695
  }
14696
14696
  if (requestStatus.status === "COMPLETED") {
14697
14697
  clearScheduledTasks();
14698
- resolve85(requestStatus);
14698
+ resolve86(requestStatus);
14699
14699
  return;
14700
14700
  }
14701
14701
  pollingTimeoutId = setTimeout(poll, pollInterval);
@@ -16656,11 +16656,11 @@ var require_realtime = __commonJS({
16656
16656
  "use strict";
16657
16657
  var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
16658
16658
  function adopt(value) {
16659
- return value instanceof P ? value : new P(function(resolve85) {
16660
- resolve85(value);
16659
+ return value instanceof P ? value : new P(function(resolve86) {
16660
+ resolve86(value);
16661
16661
  });
16662
16662
  }
16663
- return new (P || (P = Promise))(function(resolve85, reject) {
16663
+ return new (P || (P = Promise))(function(resolve86, reject) {
16664
16664
  function fulfilled(value) {
16665
16665
  try {
16666
16666
  step(generator.next(value));
@@ -16676,7 +16676,7 @@ var require_realtime = __commonJS({
16676
16676
  }
16677
16677
  }
16678
16678
  function step(result) {
16679
- result.done ? resolve85(result.value) : adopt(result.value).then(fulfilled, rejected);
16679
+ result.done ? resolve86(result.value) : adopt(result.value).then(fulfilled, rejected);
16680
16680
  }
16681
16681
  step((generator = generator.apply(thisArg, _arguments || [])).next());
16682
16682
  });
@@ -17001,11 +17001,11 @@ var require_client = __commonJS({
17001
17001
  "use strict";
17002
17002
  var __awaiter = exports && exports.__awaiter || function(thisArg, _arguments, P, generator) {
17003
17003
  function adopt(value) {
17004
- return value instanceof P ? value : new P(function(resolve85) {
17005
- resolve85(value);
17004
+ return value instanceof P ? value : new P(function(resolve86) {
17005
+ resolve86(value);
17006
17006
  });
17007
17007
  }
17008
- return new (P || (P = Promise))(function(resolve85, reject) {
17008
+ return new (P || (P = Promise))(function(resolve86, reject) {
17009
17009
  function fulfilled(value) {
17010
17010
  try {
17011
17011
  step(generator.next(value));
@@ -17021,7 +17021,7 @@ var require_client = __commonJS({
17021
17021
  }
17022
17022
  }
17023
17023
  function step(result) {
17024
- result.done ? resolve85(result.value) : adopt(result.value).then(fulfilled, rejected);
17024
+ result.done ? resolve86(result.value) : adopt(result.value).then(fulfilled, rejected);
17025
17025
  }
17026
17026
  step((generator = generator.apply(thisArg, _arguments || [])).next());
17027
17027
  });
@@ -17706,7 +17706,7 @@ var init_ReplicateProvider = __esm({
17706
17706
  * Sleep helper
17707
17707
  */
17708
17708
  sleep(ms) {
17709
- return new Promise((resolve85) => setTimeout(resolve85, ms));
17709
+ return new Promise((resolve86) => setTimeout(resolve86, ms));
17710
17710
  }
17711
17711
  /**
17712
17712
  * Generate music from text prompt using MusicGen
@@ -26180,7 +26180,7 @@ async function prompt(question, hidden = false) {
26180
26180
  input: process.stdin,
26181
26181
  output: process.stdout
26182
26182
  });
26183
- return new Promise((resolve85) => {
26183
+ return new Promise((resolve86) => {
26184
26184
  if (hidden && process.stdin.isTTY) {
26185
26185
  process.stdout.write(question);
26186
26186
  let input = "";
@@ -26194,7 +26194,7 @@ async function prompt(question, hidden = false) {
26194
26194
  process.stdin.removeListener("data", onData);
26195
26195
  process.stdout.write("\n");
26196
26196
  rl.close();
26197
- resolve85(input);
26197
+ resolve86(input);
26198
26198
  } else if (char === "") {
26199
26199
  process.exit(1);
26200
26200
  } else if (char === "\x7F" || char === "\b") {
@@ -26209,7 +26209,7 @@ async function prompt(question, hidden = false) {
26209
26209
  } else {
26210
26210
  rl.question(question, (answer) => {
26211
26211
  rl.close();
26212
- resolve85(answer);
26212
+ resolve86(answer);
26213
26213
  });
26214
26214
  }
26215
26215
  });
@@ -29414,14 +29414,15 @@ async function expectedRootSync(opts) {
29414
29414
  return { block, totalDurationSec: Number(cursor.toFixed(2)), audioRefs };
29415
29415
  }
29416
29416
  async function resolveSyncedBeatDuration(opts) {
29417
- if (opts.sceneDurationSec !== void 0) return Number(opts.sceneDurationSec.toFixed(2));
29418
29417
  const storyboardMin = opts.beatDuration ?? 3;
29419
- if (!opts.narrationPath) return Number(storyboardMin.toFixed(2));
29418
+ const reported = opts.sceneDurationSec;
29419
+ if (!opts.narrationPath) return Number((reported ?? storyboardMin).toFixed(2));
29420
+ const probe = opts.probeAudioDuration ?? getAudioDuration;
29420
29421
  try {
29421
- const audioDuration = await getAudioDuration(join5(opts.projectDir, opts.narrationPath));
29422
- return Number(Math.max(storyboardMin, audioDuration + 0.5).toFixed(2));
29422
+ const audioDuration = await probe(join5(opts.projectDir, opts.narrationPath));
29423
+ return Number(Math.max(storyboardMin, reported ?? 0, audioDuration + 0.5).toFixed(2));
29423
29424
  } catch {
29424
- return Number(storyboardMin.toFixed(2));
29425
+ return Number(Math.max(storyboardMin, reported ?? 0).toFixed(2));
29425
29426
  }
29426
29427
  }
29427
29428
  async function resolveProjectBeatDurations(projectDir) {
@@ -33766,16 +33767,16 @@ async function prompt2(question) {
33766
33767
  input,
33767
33768
  output: process.stdout
33768
33769
  });
33769
- return new Promise((resolve85) => {
33770
+ return new Promise((resolve86) => {
33770
33771
  rl.question(question, (answer) => {
33771
33772
  rl.close();
33772
- resolve85(answer);
33773
+ resolve86(answer);
33773
33774
  });
33774
33775
  });
33775
33776
  }
33776
33777
  async function promptHidden(question, opts = {}) {
33777
33778
  const input = getTTYInputStream();
33778
- return new Promise((resolve85) => {
33779
+ return new Promise((resolve86) => {
33779
33780
  let value = "";
33780
33781
  if (typeof input.setRawMode === "function") {
33781
33782
  input.setRawMode(true);
@@ -33789,7 +33790,7 @@ async function promptHidden(question, opts = {}) {
33789
33790
  input.setRawMode(false);
33790
33791
  input.removeListener("data", onData);
33791
33792
  process.stdout.write("\n");
33792
- resolve85(value);
33793
+ resolve86(value);
33793
33794
  } else if (char === "") {
33794
33795
  input.setRawMode(false);
33795
33796
  process.stdout.write("\n");
@@ -33815,7 +33816,7 @@ async function promptHidden(question, opts = {}) {
33815
33816
  const rl = createInterface2({ input, output: process.stdout });
33816
33817
  rl.question(question, (answer) => {
33817
33818
  rl.close();
33818
- resolve85(answer);
33819
+ resolve86(answer);
33819
33820
  });
33820
33821
  }
33821
33822
  });
@@ -33823,7 +33824,7 @@ async function promptHidden(question, opts = {}) {
33823
33824
  async function promptSelect(_question, options, defaultIndex = 0, opts = {}) {
33824
33825
  const input = getTTYInputStream();
33825
33826
  if (typeof input.setRawMode === "function") {
33826
- return new Promise((resolve85) => {
33827
+ return new Promise((resolve86) => {
33827
33828
  let selected = defaultIndex;
33828
33829
  const render = () => {
33829
33830
  if (renderCount > 0) {
@@ -33851,7 +33852,7 @@ async function promptSelect(_question, options, defaultIndex = 0, opts = {}) {
33851
33852
  input.setRawMode(false);
33852
33853
  input.removeListener("data", onData);
33853
33854
  process.stdout.write("\n");
33854
- resolve85(selected);
33855
+ resolve86(selected);
33855
33856
  } else if (char === "") {
33856
33857
  input.setRawMode(false);
33857
33858
  process.stdout.write("\n");
@@ -33861,7 +33862,7 @@ async function promptSelect(_question, options, defaultIndex = 0, opts = {}) {
33861
33862
  input.setRawMode(false);
33862
33863
  input.removeListener("data", onData);
33863
33864
  process.stdout.write("\n");
33864
- resolve85(opts.backIndex);
33865
+ resolve86(opts.backIndex);
33865
33866
  } else if (char === "\x1B[A" || char === "k") {
33866
33867
  selected = (selected - 1 + options.length) % options.length;
33867
33868
  render();
@@ -33875,7 +33876,7 @@ async function promptSelect(_question, options, defaultIndex = 0, opts = {}) {
33875
33876
  input.removeListener("data", onData);
33876
33877
  render();
33877
33878
  process.stdout.write("\n");
33878
- resolve85(selected);
33879
+ resolve86(selected);
33879
33880
  }
33880
33881
  };
33881
33882
  const onData = (chunk) => {
@@ -33899,7 +33900,7 @@ async function promptSelect(_question, options, defaultIndex = 0, opts = {}) {
33899
33900
  async function promptConfirm(question, defaultYes = true) {
33900
33901
  const input = getTTYInputStream();
33901
33902
  if (typeof input.setRawMode === "function") {
33902
- return new Promise((resolve85) => {
33903
+ return new Promise((resolve86) => {
33903
33904
  const options = ["Yes", "No"];
33904
33905
  let selected = defaultYes ? 0 : 1;
33905
33906
  let renderCount = 0;
@@ -33929,7 +33930,7 @@ async function promptConfirm(question, defaultYes = true) {
33929
33930
  finished = true;
33930
33931
  input.setRawMode(false);
33931
33932
  input.removeListener("data", onData);
33932
- resolve85(selected === 0);
33933
+ resolve86(selected === 0);
33933
33934
  } else if (char === "") {
33934
33935
  input.setRawMode(false);
33935
33936
  process.stdout.write("\n");
@@ -33943,14 +33944,14 @@ async function promptConfirm(question, defaultYes = true) {
33943
33944
  input.setRawMode(false);
33944
33945
  input.removeListener("data", onData);
33945
33946
  render();
33946
- resolve85(true);
33947
+ resolve86(true);
33947
33948
  } else if (char === "n" || char === "N") {
33948
33949
  selected = 1;
33949
33950
  finished = true;
33950
33951
  input.setRawMode(false);
33951
33952
  input.removeListener("data", onData);
33952
33953
  render();
33953
- resolve85(false);
33954
+ resolve86(false);
33954
33955
  }
33955
33956
  };
33956
33957
  const onData = (chunk) => {
@@ -33969,7 +33970,7 @@ async function promptMultiSelect(_question, options, defaultSelected = [], opts
33969
33970
  const input = getTTYInputStream();
33970
33971
  const selected = options.map((_, i) => Boolean(defaultSelected[i]));
33971
33972
  if (typeof input.setRawMode === "function") {
33972
- return new Promise((resolve85) => {
33973
+ return new Promise((resolve86) => {
33973
33974
  let cursor = 0;
33974
33975
  let renderCount = 0;
33975
33976
  let userToggled = false;
@@ -33999,7 +34000,7 @@ async function promptMultiSelect(_question, options, defaultSelected = [], opts
33999
34000
  for (let i = 0; i < selected.length; i++) {
34000
34001
  if (selected[i]) result.push(i);
34001
34002
  }
34002
- resolve85(result);
34003
+ resolve86(result);
34003
34004
  };
34004
34005
  let finished = false;
34005
34006
  const handleChar = (char) => {
@@ -34313,7 +34314,7 @@ var init_speech = __esm({
34313
34314
  import { writeFile as writeFile20, unlink, rename } from "node:fs/promises";
34314
34315
  import { resolve as resolve24, basename as basename4 } from "node:path";
34315
34316
  function sleep2(ms) {
34316
- return new Promise((resolve85) => setTimeout(resolve85, ms));
34317
+ return new Promise((resolve86) => setTimeout(resolve86, ms));
34317
34318
  }
34318
34319
  async function uploadToImgbb(imageBuffer, apiKey) {
34319
34320
  try {
@@ -36050,7 +36051,7 @@ function unique(items) {
36050
36051
  ];
36051
36052
  }
36052
36053
  function sleep3(ms) {
36053
- return new Promise((resolve85) => setTimeout(resolve85, ms));
36054
+ return new Promise((resolve86) => setTimeout(resolve86, ms));
36054
36055
  }
36055
36056
  var LOCAL_JOB_ORPHAN_AFTER_MS;
36056
36057
  var init_status_jobs = __esm({
@@ -48423,8 +48424,8 @@ var init_FileTokenizer = __esm({
48423
48424
  */
48424
48425
  static async fromFile(sourceFilePath) {
48425
48426
  const fileHandle = await fsOpen(sourceFilePath, "r");
48426
- const stat10 = await fileHandle.stat();
48427
- return new _FileTokenizer(fileHandle, { fileInfo: { path: sourceFilePath, size: stat10.size } });
48427
+ const stat11 = await fileHandle.stat();
48428
+ return new _FileTokenizer(fileHandle, { fileInfo: { path: sourceFilePath, size: stat11.size } });
48428
48429
  }
48429
48430
  constructor(fileHandle, options) {
48430
48431
  super(options);
@@ -60169,6 +60170,22 @@ var init_build_plan = __esm({
60169
60170
  }
60170
60171
  });
60171
60172
 
60173
+ // src/commands/_shared/ffmpeg-gate.ts
60174
+ function ffmpegToolsAvailable() {
60175
+ if (testOverride !== null) return testOverride;
60176
+ if (cached === null) cached = commandExists("ffmpeg") && commandExists("ffprobe");
60177
+ return cached;
60178
+ }
60179
+ var testOverride, cached;
60180
+ var init_ffmpeg_gate = __esm({
60181
+ "src/commands/_shared/ffmpeg-gate.ts"() {
60182
+ "use strict";
60183
+ init_exec_safe();
60184
+ testOverride = null;
60185
+ cached = null;
60186
+ }
60187
+ });
60188
+
60172
60189
  // src/utils/concurrency.ts
60173
60190
  async function mapWithConcurrency(items, limit, fn) {
60174
60191
  if (!Number.isInteger(limit) || limit <= 0) {
@@ -60527,6 +60544,33 @@ async function executeSceneRender(opts = {}) {
60527
60544
  error: `Project directory not found: ${projectDir}`
60528
60545
  };
60529
60546
  }
60547
+ if (!ffmpegToolsAvailable()) {
60548
+ return {
60549
+ success: false,
60550
+ kind: "render",
60551
+ beat: opts.beatId ?? null,
60552
+ code: "FFMPEG_MISSING",
60553
+ 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."
60554
+ };
60555
+ }
60556
+ let autoSyncApplied = false;
60557
+ let autoSyncWarning;
60558
+ if (!opts.beatId && existsSync48(join24(projectDir, "STORYBOARD.md"))) {
60559
+ try {
60560
+ const rootPlan = await createProjectRootSyncPlan({ projectDir });
60561
+ const subPlans = await createSubCompDurationSyncPlans({
60562
+ projectDir,
60563
+ beats: await loadProjectRootSyncBeats(projectDir)
60564
+ });
60565
+ if (rootPlan.changed || subPlans.some((plan) => plan.changed)) {
60566
+ await executeSceneRepair({ projectDir });
60567
+ autoSyncApplied = true;
60568
+ 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`).";
60569
+ }
60570
+ } catch (error) {
60571
+ autoSyncWarning = `Narration drift check skipped: ${error instanceof Error ? error.message : String(error)}`;
60572
+ }
60573
+ }
60530
60574
  let root = opts.root ?? projectConfig.config.composition.entry;
60531
60575
  if (opts.beatId) {
60532
60576
  const prepared = await prepareBeatRenderRoot({
@@ -60643,7 +60687,9 @@ async function executeSceneRender(opts = {}) {
60643
60687
  format: config2.format,
60644
60688
  audioCount,
60645
60689
  audioMuxApplied,
60646
- audioMuxWarning
60690
+ audioMuxWarning,
60691
+ ...autoSyncApplied ? { autoSyncApplied } : {},
60692
+ ...autoSyncWarning ? { autoSyncWarning } : {}
60647
60693
  };
60648
60694
  if (opts.revealInFinder) {
60649
60695
  try {
@@ -60903,6 +60949,10 @@ var init_scene_render = __esm({
60903
60949
  "src/commands/_shared/scene-render.ts"() {
60904
60950
  "use strict";
60905
60951
  init_chrome();
60952
+ init_ffmpeg_gate();
60953
+ init_root_sync();
60954
+ init_sub_comp_duration_sync();
60955
+ init_scene_repair();
60906
60956
  init_scene_lint();
60907
60957
  init_scene_audio_scan();
60908
60958
  init_scene_audio_mux();
@@ -60972,6 +61022,28 @@ async function executeSceneBuild(opts) {
60972
61022
  providerResolution: buildPlan.providerResolution,
60973
61023
  ...result
60974
61024
  });
61025
+ if (shouldRunStage(selectedStage, "assets") || shouldRunStage(selectedStage, "sync")) {
61026
+ if (!ffmpegToolsAvailable()) {
61027
+ return finishBuildResult({
61028
+ success: false,
61029
+ phase: "failed",
61030
+ mode,
61031
+ selectedStage,
61032
+ code: "FFMPEG_MISSING",
61033
+ error: "ffprobe (part of FFmpeg) was not found on PATH. Narration-synced durations cannot be computed without it.",
61034
+ message: "ffprobe not found on PATH.",
61035
+ suggestion: "Install FFmpeg (macOS: `brew install ffmpeg`), then re-run the build.",
61036
+ recoverable: true,
61037
+ beats: [],
61038
+ stageReports,
61039
+ warnings,
61040
+ retryWith,
61041
+ status: "failed",
61042
+ currentStage: "assets",
61043
+ totalLatencyMs: Date.now() - startedAt
61044
+ });
61045
+ }
61046
+ }
60975
61047
  if (!buildPlan.validation.ok) {
60976
61048
  let invalidBeats = [];
60977
61049
  if (existsSync49(storyboardPath2)) {
@@ -62643,6 +62715,7 @@ var init_scene_build = __esm({
62643
62715
  import_dotenv4 = __toESM(require_main(), 1);
62644
62716
  init_dist2();
62645
62717
  init_audio();
62718
+ init_ffmpeg_gate();
62646
62719
  init_concurrency();
62647
62720
  init_compose_scenes_skills();
62648
62721
  init_compose_prompts();
@@ -67963,10 +68036,13 @@ function mapRenderResultToToolResult(result, projectDir) {
67963
68036
  format: result.format,
67964
68037
  audioCount: result.audioCount,
67965
68038
  audioMuxApplied: result.audioMuxApplied,
67966
- audioMuxWarning: result.audioMuxWarning
68039
+ audioMuxWarning: result.audioMuxWarning,
68040
+ ...result.autoSyncApplied ? { autoSyncApplied: true } : {},
68041
+ ...result.autoSyncWarning ? { autoSyncWarning: result.autoSyncWarning } : {}
67967
68042
  },
67968
68043
  humanLines: [
67969
68044
  `\u2705 Render complete: ${result.absoluteOutputPath ?? result.outputPath}`,
68045
+ ...result.autoSyncApplied ? [` auto-sync: narration-synced durations were re-applied before render`] : [],
67970
68046
  ` duration: ${((result.durationMs ?? 0) / 1e3).toFixed(1)}s`,
67971
68047
  ` frames: ${result.framesRendered ?? "?"}${result.totalFrames ? ` / ${result.totalFrames}` : ""}`,
67972
68048
  ` config: ${result.fps}fps \xB7 ${result.quality} \xB7 ${result.format}`,
@@ -70951,17 +71027,158 @@ var init_timeline = __esm({
70951
71027
  }
70952
71028
  });
70953
71029
 
71030
+ // src/commands/_shared/project-list.ts
71031
+ import { readdir as readdir7, readFile as readFile53, stat as stat9 } from "node:fs/promises";
71032
+ import { existsSync as existsSync57 } from "node:fs";
71033
+ import { join as join28, resolve as resolve80 } from "node:path";
71034
+ async function executeProjectList(opts = {}) {
71035
+ const workspaceDir = resolve80(opts.workspaceDir ?? ".");
71036
+ if (!existsSync57(workspaceDir)) {
71037
+ return {
71038
+ success: false,
71039
+ workspaceDir,
71040
+ projects: [],
71041
+ archivedCount: 0,
71042
+ error: `Workspace directory not found: ${workspaceDir}`
71043
+ };
71044
+ }
71045
+ const entries = await readdir7(workspaceDir, { withFileTypes: true });
71046
+ const projects = [];
71047
+ let archivedCount = 0;
71048
+ for (const entry of entries) {
71049
+ if (!entry.isDirectory()) continue;
71050
+ if (entry.name === "node_modules") continue;
71051
+ if (entry.name.startsWith(".")) continue;
71052
+ if (entry.name.startsWith("_")) {
71053
+ archivedCount += await countProjects(join28(workspaceDir, entry.name));
71054
+ continue;
71055
+ }
71056
+ const projectDir = join28(workspaceDir, entry.name);
71057
+ if (!existsSync57(join28(projectDir, "STORYBOARD.md"))) continue;
71058
+ projects.push(await describeProject(entry.name, projectDir));
71059
+ }
71060
+ projects.sort((a, b) => b.updatedAt.localeCompare(a.updatedAt));
71061
+ return { success: true, workspaceDir, projects, archivedCount };
71062
+ }
71063
+ async function countProjects(dir) {
71064
+ try {
71065
+ const entries = await readdir7(dir, { withFileTypes: true });
71066
+ return entries.filter(
71067
+ (e) => e.isDirectory() && existsSync57(join28(dir, e.name, "STORYBOARD.md"))
71068
+ ).length;
71069
+ } catch {
71070
+ return 0;
71071
+ }
71072
+ }
71073
+ async function describeProject(name, projectDir) {
71074
+ let beats = 0;
71075
+ let storyboardDurationSec = 0;
71076
+ const timestamps = [];
71077
+ try {
71078
+ const storyboardPath2 = join28(projectDir, "STORYBOARD.md");
71079
+ const parsed = parseStoryboard(await readFile53(storyboardPath2, "utf-8"));
71080
+ beats = parsed.beats.length;
71081
+ storyboardDurationSec = Number(
71082
+ parsed.beats.reduce((sum, beat) => sum + (beat.duration ?? 0), 0).toFixed(2)
71083
+ );
71084
+ timestamps.push((await stat9(storyboardPath2)).mtimeMs);
71085
+ } catch {
71086
+ }
71087
+ let buildStatus;
71088
+ let buildUpdatedAt;
71089
+ try {
71090
+ const reportPath = join28(projectDir, "build-report.json");
71091
+ const report = JSON.parse(await readFile53(reportPath, "utf-8"));
71092
+ buildStatus = report.status ?? report.phase;
71093
+ buildUpdatedAt = report.updatedAt;
71094
+ timestamps.push((await stat9(reportPath)).mtimeMs);
71095
+ } catch {
71096
+ }
71097
+ let latestRender;
71098
+ try {
71099
+ const rendersDir = join28(projectDir, "renders");
71100
+ const files = await readdir7(rendersDir);
71101
+ let newest;
71102
+ for (const file of files) {
71103
+ if (!/\.(mp4|webm|mov)$/i.test(file)) continue;
71104
+ const { mtimeMs } = await stat9(join28(rendersDir, file));
71105
+ if (!newest || mtimeMs > newest.mtimeMs) newest = { file, mtimeMs };
71106
+ }
71107
+ if (newest) {
71108
+ latestRender = { file: newest.file, modifiedAt: new Date(newest.mtimeMs).toISOString() };
71109
+ timestamps.push(newest.mtimeMs);
71110
+ }
71111
+ } catch {
71112
+ }
71113
+ const updatedAt = new Date(
71114
+ timestamps.length > 0 ? Math.max(...timestamps) : (await stat9(projectDir)).mtimeMs
71115
+ ).toISOString();
71116
+ return {
71117
+ name,
71118
+ path: projectDir,
71119
+ beats,
71120
+ storyboardDurationSec,
71121
+ ...buildStatus ? { buildStatus } : {},
71122
+ ...buildUpdatedAt ? { buildUpdatedAt } : {},
71123
+ ...latestRender ? { latestRender } : {},
71124
+ updatedAt
71125
+ };
71126
+ }
71127
+ var init_project_list = __esm({
71128
+ "src/commands/_shared/project-list.ts"() {
71129
+ "use strict";
71130
+ init_storyboard_parse();
71131
+ }
71132
+ });
71133
+
70954
71134
  // src/tools/manifest/project.ts
70955
- import { resolve as resolve80 } from "node:path";
71135
+ import { resolve as resolve81 } from "node:path";
70956
71136
  import { writeFile as writeFile58 } from "node:fs/promises";
70957
- var projectCreateTool, projectInfoTool, projectTools;
71137
+ var projectListTool, projectCreateTool, projectInfoTool, projectTools;
70958
71138
  var init_project2 = __esm({
70959
71139
  "src/tools/manifest/project.ts"() {
70960
71140
  "use strict";
70961
71141
  init_zod();
70962
71142
  init_define_tool();
70963
71143
  init_engine();
71144
+ init_project_list();
70964
71145
  init_project_io();
71146
+ projectListTool = defineTool({
71147
+ name: "project_list",
71148
+ category: "project",
71149
+ cost: "free",
71150
+ title: "List Video Projects",
71151
+ annotations: { readOnly: true, openWorld: false },
71152
+ 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.`,
71153
+ schema: external_exports.object({
71154
+ dir: external_exports.string().optional().describe(
71155
+ "Workspace directory to scan. Defaults to the surface's cwd; in MCP hosts this is the configured server workspace."
71156
+ )
71157
+ }),
71158
+ async execute(args, ctx) {
71159
+ const result = await executeProjectList({
71160
+ workspaceDir: args.dir ? resolve81(ctx.workingDirectory, args.dir) : ctx.workingDirectory
71161
+ });
71162
+ if (!result.success) {
71163
+ return { success: false, error: result.error ?? "project list failed" };
71164
+ }
71165
+ return {
71166
+ success: true,
71167
+ data: {
71168
+ workspaceDir: result.workspaceDir,
71169
+ count: result.projects.length,
71170
+ archivedCount: result.archivedCount,
71171
+ projects: result.projects
71172
+ },
71173
+ humanLines: [
71174
+ `\u{1F4C1} ${result.projects.length} project(s) in ${result.workspaceDir}` + (result.archivedCount > 0 ? ` (+${result.archivedCount} archived)` : ""),
71175
+ ...result.projects.map(
71176
+ (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})`
71177
+ )
71178
+ ]
71179
+ };
71180
+ }
71181
+ });
70965
71182
  projectCreateTool = defineTool({
70966
71183
  name: "project_create",
70967
71184
  category: "project",
@@ -70977,7 +71194,7 @@ var init_project2 = __esm({
70977
71194
  fps: external_exports.number().optional().describe("Frames per second (default: 30)")
70978
71195
  }),
70979
71196
  async execute(args, ctx) {
70980
- const outputPath = resolve80(ctx.workingDirectory, args.outputPath ?? `${args.name}.vibe.json`);
71197
+ const outputPath = resolve81(ctx.workingDirectory, args.outputPath ?? `${args.name}.vibe.json`);
70981
71198
  const project = new Project(args.name);
70982
71199
  if (args.fps) project.setFrameRate(args.fps);
70983
71200
  await writeFile58(outputPath, JSON.stringify(project.toJSON(), null, 2), "utf-8");
@@ -71018,6 +71235,7 @@ var init_project2 = __esm({
71018
71235
  }
71019
71236
  });
71020
71237
  projectTools = [
71238
+ projectListTool,
71021
71239
  projectCreateTool,
71022
71240
  projectInfoTool
71023
71241
  ];
@@ -71025,8 +71243,8 @@ var init_project2 = __esm({
71025
71243
  });
71026
71244
 
71027
71245
  // src/commands/export.ts
71028
- import { readFile as readFile53, access as access7 } from "node:fs/promises";
71029
- import { resolve as resolve81, basename as basename24 } from "node:path";
71246
+ import { readFile as readFile54, access as access7 } from "node:fs/promises";
71247
+ import { resolve as resolve82, basename as basename24 } from "node:path";
71030
71248
  import { spawn as spawn3 } from "node:child_process";
71031
71249
  function timelineBaseName(path2) {
71032
71250
  const name = basename24(path2);
@@ -71094,7 +71312,7 @@ async function runExport(projectPath, outputPath, options = {}) {
71094
71312
  };
71095
71313
  }
71096
71314
  const filePath = await resolveTimelineFile(projectPath);
71097
- const content = await readFile53(filePath, "utf-8");
71315
+ const content = await readFile54(filePath, "utf-8");
71098
71316
  const data = JSON.parse(content);
71099
71317
  const project = Project.fromJSON(data);
71100
71318
  const summary = project.getSummary();
@@ -71104,7 +71322,7 @@ async function runExport(projectPath, outputPath, options = {}) {
71104
71322
  message: "Project has no clips to export"
71105
71323
  };
71106
71324
  }
71107
- const finalOutputPath = resolve81(process.cwd(), outputPath);
71325
+ const finalOutputPath = resolve82(process.cwd(), outputPath);
71108
71326
  const basePresetSettings = getPresetSettings(preset, summary.aspectRatio);
71109
71327
  const presetSettings = applyCustomOverrides(basePresetSettings, { bitrate, fps, resolution, codec });
71110
71328
  const clips = project.getClips().sort((a, b) => a.startTime - b.startTime);
@@ -71500,7 +71718,7 @@ function buildFFmpegArgs(clips, sources, presetSettings, outputPath, options, so
71500
71718
  return args;
71501
71719
  }
71502
71720
  function runFFmpegProcess(ffmpegPath, args, onProgress) {
71503
- return new Promise((resolve85, reject) => {
71721
+ return new Promise((resolve86, reject) => {
71504
71722
  const ffmpeg = spawn3(ffmpegPath, args, {
71505
71723
  stdio: ["pipe", "pipe", "pipe"]
71506
71724
  });
@@ -71524,7 +71742,7 @@ function runFFmpegProcess(ffmpegPath, args, onProgress) {
71524
71742
  });
71525
71743
  ffmpeg.on("close", (code) => {
71526
71744
  if (code === 0) {
71527
- resolve85();
71745
+ resolve86();
71528
71746
  } else {
71529
71747
  const errorMatch = stderr.match(/Error.*$/m);
71530
71748
  const errorMsg = errorMatch ? errorMatch[0] : `FFmpeg exited with code ${code}`;
@@ -71660,17 +71878,17 @@ function getPresetSettings(preset, aspectRatio2) {
71660
71878
  }
71661
71879
  async function runHyperframesExport(projectPath, options, spinner2, startedAt) {
71662
71880
  spinner2.text = "Loading project...";
71663
- const { readFile: readFile55 } = await import("node:fs/promises");
71664
- const { resolve: resolve85 } = await import("node:path");
71881
+ const { readFile: readFile56 } = await import("node:fs/promises");
71882
+ const { resolve: resolve86 } = await import("node:path");
71665
71883
  const { Project: Project2 } = await Promise.resolve().then(() => (init_engine(), engine_exports));
71666
71884
  const { createHyperframesBackend: createHyperframesBackend2 } = await Promise.resolve().then(() => (init_hyperframes(), hyperframes_exports));
71667
71885
  const { exitWithError: exitWithError2, generalError: generalError2, outputSuccess: outputSuccess2 } = await Promise.resolve().then(() => (init_output(), output_exports));
71668
71886
  const chalk2 = (await Promise.resolve().then(() => (init_source(), source_exports))).default;
71669
71887
  const filePath = await resolveTimelineFile(projectPath);
71670
- const content = await readFile55(filePath, "utf-8");
71888
+ const content = await readFile56(filePath, "utf-8");
71671
71889
  const project = Project2.fromJSON(JSON.parse(content));
71672
71890
  const state = project.getState();
71673
- const outputPath = options.output ? resolve85(process.cwd(), options.output) : resolve85(process.cwd(), `${timelineBaseName(projectPath)}.${options.format ?? "mp4"}`);
71891
+ const outputPath = options.output ? resolve86(process.cwd(), options.output) : resolve86(process.cwd(), `${timelineBaseName(projectPath)}.${options.format ?? "mp4"}`);
71674
71892
  const quality = ["draft", "standard", "high"].includes(options.preset ?? "") ? options.preset : "standard";
71675
71893
  const backend = createHyperframesBackend2();
71676
71894
  spinner2.text = "Rendering with Hyperframes...";
@@ -71789,7 +72007,7 @@ Run 'vibe schema export' for structured parameter info.`).action(async (projectP
71789
72007
  }
71790
72008
  spinner2.text = "Loading project...";
71791
72009
  const filePath = await resolveTimelineFile(projectPath);
71792
- const content = await readFile53(filePath, "utf-8");
72010
+ const content = await readFile54(filePath, "utf-8");
71793
72011
  const data = JSON.parse(content);
71794
72012
  const project = Project.fromJSON(data);
71795
72013
  const summary = project.getSummary();
@@ -71797,7 +72015,7 @@ Run 'vibe schema export' for structured parameter info.`).action(async (projectP
71797
72015
  spinner2.fail("Project has no clips to export");
71798
72016
  exitWithError(usageError("Project has no clips to export"));
71799
72017
  }
71800
- const outputPath = options.output ? resolve81(process.cwd(), options.output) : resolve81(
72018
+ const outputPath = options.output ? resolve82(process.cwd(), options.output) : resolve82(
71801
72019
  process.cwd(),
71802
72020
  `${timelineBaseName(projectPath)}.${options.format}`
71803
72021
  );
@@ -71881,7 +72099,7 @@ Run 'vibe schema export' for structured parameter info.`).action(async (projectP
71881
72099
  });
71882
72100
 
71883
72101
  // src/tools/manifest/export.ts
71884
- import { resolve as resolve82 } from "node:path";
72102
+ import { resolve as resolve83 } from "node:path";
71885
72103
  var exportVideoTool, exportTools;
71886
72104
  var init_export2 = __esm({
71887
72105
  "src/tools/manifest/export.ts"() {
@@ -71904,8 +72122,8 @@ var init_export2 = __esm({
71904
72122
  overwrite: external_exports.boolean().optional().describe("Overwrite existing output file (default: false)")
71905
72123
  }),
71906
72124
  async execute(args, ctx) {
71907
- const projectPath = resolve82(ctx.workingDirectory, args.projectPath);
71908
- const outputPath = resolve82(ctx.workingDirectory, args.outputPath);
72125
+ const projectPath = resolve83(ctx.workingDirectory, args.projectPath);
72126
+ const outputPath = resolve83(ctx.workingDirectory, args.outputPath);
71909
72127
  const result = await runExport(projectPath, outputPath, {
71910
72128
  preset: args.preset,
71911
72129
  format: args.format,
@@ -71924,8 +72142,8 @@ var init_export2 = __esm({
71924
72142
  });
71925
72143
 
71926
72144
  // src/tools/manifest/agent-only.ts
71927
- import { readFile as readFile54, writeFile as writeFile59, readdir as readdir7, stat as stat9, access as access8, unlink as unlink4 } from "node:fs/promises";
71928
- import { resolve as resolve83, join as join28, basename as basename25, extname as extname16 } from "node:path";
72145
+ import { readFile as readFile55, writeFile as writeFile59, readdir as readdir8, stat as stat10, access as access8, unlink as unlink4 } from "node:fs/promises";
72146
+ import { resolve as resolve84, join as join29, basename as basename25, extname as extname16 } from "node:path";
71929
72147
  function matchPattern(filename, pattern) {
71930
72148
  const regex2 = new RegExp(
71931
72149
  "^" + pattern.replace(/\./g, "\\.").replace(/\*/g, ".*").replace(/\?/g, ".") + "$",
@@ -72005,13 +72223,13 @@ var init_agent_only = __esm({
72005
72223
  async execute(args, ctx) {
72006
72224
  const dirPath = args.path ?? ".";
72007
72225
  try {
72008
- const absPath = resolve83(ctx.workingDirectory, dirPath);
72009
- const entries = await readdir7(absPath, { withFileTypes: true });
72226
+ const absPath = resolve84(ctx.workingDirectory, dirPath);
72227
+ const entries = await readdir8(absPath, { withFileTypes: true });
72010
72228
  const results = [];
72011
72229
  for (const entry of entries) {
72012
72230
  if (args.pattern && !matchPattern(entry.name, args.pattern)) continue;
72013
- const fullPath = join28(absPath, entry.name);
72014
- const stats = await stat9(fullPath);
72231
+ const fullPath = join29(absPath, entry.name);
72232
+ const stats = await stat10(fullPath);
72015
72233
  if (entry.isDirectory()) {
72016
72234
  results.push(`[DIR] ${entry.name}/`);
72017
72235
  } else {
@@ -72038,8 +72256,8 @@ var init_agent_only = __esm({
72038
72256
  }),
72039
72257
  async execute(args, ctx) {
72040
72258
  try {
72041
- const absPath = resolve83(ctx.workingDirectory, args.path);
72042
- const content = await readFile54(absPath, "utf-8");
72259
+ const absPath = resolve84(ctx.workingDirectory, args.path);
72260
+ const content = await readFile55(absPath, "utf-8");
72043
72261
  const maxLength = 4e3;
72044
72262
  const truncated = content.length > maxLength;
72045
72263
  const output = truncated ? content.substring(0, maxLength) + "\n... (truncated)" : content;
@@ -72063,7 +72281,7 @@ var init_agent_only = __esm({
72063
72281
  }),
72064
72282
  async execute(args, ctx) {
72065
72283
  try {
72066
- const absPath = resolve83(ctx.workingDirectory, args.path);
72284
+ const absPath = resolve84(ctx.workingDirectory, args.path);
72067
72285
  await writeFile59(absPath, args.content, "utf-8");
72068
72286
  return { success: true, data: { bytes: args.content.length }, humanLines: [`File written: ${args.path} (${formatSize(args.content.length)})`] };
72069
72287
  } catch (error) {
@@ -72083,10 +72301,10 @@ var init_agent_only = __esm({
72083
72301
  path: external_exports.string().describe("Path to check")
72084
72302
  }),
72085
72303
  async execute(args, ctx) {
72086
- const absPath = resolve83(ctx.workingDirectory, args.path);
72304
+ const absPath = resolve84(ctx.workingDirectory, args.path);
72087
72305
  try {
72088
72306
  await access8(absPath);
72089
- const stats = await stat9(absPath);
72307
+ const stats = await stat10(absPath);
72090
72308
  const type = stats.isDirectory() ? "directory" : "file";
72091
72309
  return { success: true, data: { exists: true, type }, humanLines: [`${type} exists: ${args.path}`] };
72092
72310
  } catch {
@@ -72111,19 +72329,19 @@ var init_agent_only = __esm({
72111
72329
  }),
72112
72330
  async execute(args, ctx) {
72113
72331
  try {
72114
- const filePath = resolve83(ctx.workingDirectory, args.project);
72115
- const content = await readFile54(filePath, "utf-8");
72332
+ const filePath = resolve84(ctx.workingDirectory, args.project);
72333
+ const content = await readFile55(filePath, "utf-8");
72116
72334
  const data = JSON.parse(content);
72117
72335
  const project = Project.fromJSON(data);
72118
- const dirPath = resolve83(ctx.workingDirectory, args.directory);
72336
+ const dirPath = resolve84(ctx.workingDirectory, args.directory);
72119
72337
  const filterExts = args.filter ? args.filter.split(",").map((e) => e.trim().toLowerCase()) : null;
72120
72338
  const imageDuration = args.imageDuration ?? 5;
72121
72339
  const recursive = args.recursive ?? false;
72122
72340
  const mediaFiles = [];
72123
72341
  const scanDir = async (dir) => {
72124
- const entries = await readdir7(dir, { withFileTypes: true });
72342
+ const entries = await readdir8(dir, { withFileTypes: true });
72125
72343
  for (const entry of entries) {
72126
- const entryPath = join28(dir, entry.name);
72344
+ const entryPath = join29(dir, entry.name);
72127
72345
  if (entry.isDirectory() && recursive) {
72128
72346
  await scanDir(entryPath);
72129
72347
  } else if (entry.isFile()) {
@@ -72183,8 +72401,8 @@ var init_agent_only = __esm({
72183
72401
  }),
72184
72402
  async execute(args, ctx) {
72185
72403
  try {
72186
- const filePath = resolve83(ctx.workingDirectory, args.project);
72187
- const content = await readFile54(filePath, "utf-8");
72404
+ const filePath = resolve84(ctx.workingDirectory, args.project);
72405
+ const content = await readFile55(filePath, "utf-8");
72188
72406
  const data = JSON.parse(content);
72189
72407
  const project = Project.fromJSON(data);
72190
72408
  const sourceIds = args.sourceIds ?? [];
@@ -72254,8 +72472,8 @@ var init_agent_only = __esm({
72254
72472
  }),
72255
72473
  async execute(args, ctx) {
72256
72474
  try {
72257
- const filePath = resolve83(ctx.workingDirectory, args.project);
72258
- const content = await readFile54(filePath, "utf-8");
72475
+ const filePath = resolve84(ctx.workingDirectory, args.project);
72476
+ const content = await readFile55(filePath, "utf-8");
72259
72477
  const data = JSON.parse(content);
72260
72478
  const project = Project.fromJSON(data);
72261
72479
  const clipIds = args.clipIds ?? [];
@@ -72310,7 +72528,7 @@ var init_agent_only = __esm({
72310
72528
  async execute(args, ctx) {
72311
72529
  try {
72312
72530
  const filePath = await resolveTimelineFile(args.project, ctx.workingDirectory);
72313
- const content = await readFile54(filePath, "utf-8");
72531
+ const content = await readFile55(filePath, "utf-8");
72314
72532
  const data = JSON.parse(content);
72315
72533
  const project = Project.fromJSON(data);
72316
72534
  const what = args.what ?? "clips";
@@ -72387,7 +72605,7 @@ var init_agent_only = __esm({
72387
72605
  async execute(args, ctx) {
72388
72606
  try {
72389
72607
  const filePath = await resolveTimelineFile(args.projectPath, ctx.workingDirectory);
72390
- const content = await readFile54(filePath, "utf-8");
72608
+ const content = await readFile55(filePath, "utf-8");
72391
72609
  const data = JSON.parse(content);
72392
72610
  const project = Project.fromJSON(data);
72393
72611
  const updates = [];
@@ -72546,7 +72764,7 @@ var init_agent_only = __esm({
72546
72764
  }),
72547
72765
  async execute(args, ctx) {
72548
72766
  try {
72549
- const absPath = resolve83(ctx.workingDirectory, args.path);
72767
+ const absPath = resolve84(ctx.workingDirectory, args.path);
72550
72768
  const { stdout } = await execSafe(
72551
72769
  "ffprobe",
72552
72770
  ["-v", "quiet", "-print_format", "json", "-show_format", "-show_streams", absPath],
@@ -72635,10 +72853,10 @@ Audio:`);
72635
72853
  }),
72636
72854
  async execute(args, ctx) {
72637
72855
  try {
72638
- const absInput = resolve83(ctx.workingDirectory, args.input);
72856
+ const absInput = resolve84(ctx.workingDirectory, args.input);
72639
72857
  const ext = args.input.split(".").pop() || "mp4";
72640
72858
  const baseName = args.input.replace(/\.[^/.]+$/, "");
72641
- const outputPath = args.output ? resolve83(ctx.workingDirectory, args.output) : resolve83(ctx.workingDirectory, `${baseName}-compressed.${ext}`);
72859
+ const outputPath = args.output ? resolve84(ctx.workingDirectory, args.output) : resolve84(ctx.workingDirectory, `${baseName}-compressed.${ext}`);
72642
72860
  const crfValues = { low: 28, medium: 23, high: 18 };
72643
72861
  const crf = crfValues[args.quality ?? "medium"];
72644
72862
  await execSafe(
@@ -72661,8 +72879,8 @@ Audio:`);
72661
72879
  ],
72662
72880
  { maxBuffer: 50 * 1024 * 1024 }
72663
72881
  );
72664
- const inputBuf = await readFile54(absInput);
72665
- const outputBuf = await readFile54(outputPath);
72882
+ const inputBuf = await readFile55(absInput);
72883
+ const outputBuf = await readFile55(outputPath);
72666
72884
  const inputSize = inputBuf.length;
72667
72885
  const outputSize = outputBuf.length;
72668
72886
  const reduction = (inputSize - outputSize) / inputSize * 100;
@@ -72698,8 +72916,8 @@ Audio:`);
72698
72916
  }),
72699
72917
  async execute(args, ctx) {
72700
72918
  try {
72701
- const absInput = resolve83(ctx.workingDirectory, args.input);
72702
- const absOutput = resolve83(ctx.workingDirectory, args.output);
72919
+ const absInput = resolve84(ctx.workingDirectory, args.input);
72920
+ const absOutput = resolve84(ctx.workingDirectory, args.output);
72703
72921
  const codecMap = {
72704
72922
  h264: "libx264",
72705
72923
  h265: "libx265",
@@ -72752,11 +72970,11 @@ Audio:`);
72752
72970
  };
72753
72971
  }
72754
72972
  try {
72755
- const absOutput = resolve83(ctx.workingDirectory, args.output);
72973
+ const absOutput = resolve84(ctx.workingDirectory, args.output);
72756
72974
  if (args.reencode) {
72757
72975
  const ffmpegArgs = [];
72758
72976
  for (const i of args.inputs) {
72759
- ffmpegArgs.push("-i", resolve83(ctx.workingDirectory, i));
72977
+ ffmpegArgs.push("-i", resolve84(ctx.workingDirectory, i));
72760
72978
  }
72761
72979
  const filterComplex = args.inputs.map((_, i) => `[${i}:v][${i}:a]`).join("");
72762
72980
  ffmpegArgs.push(
@@ -72771,8 +72989,8 @@ Audio:`);
72771
72989
  );
72772
72990
  await execSafe("ffmpeg", ffmpegArgs, { maxBuffer: 100 * 1024 * 1024 });
72773
72991
  } else {
72774
- const tempList = resolve83(ctx.workingDirectory, `concat-list-${Date.now()}.txt`);
72775
- const listContent = args.inputs.map((i) => `file '${resolve83(ctx.workingDirectory, i)}'`).join("\n");
72992
+ const tempList = resolve84(ctx.workingDirectory, `concat-list-${Date.now()}.txt`);
72993
+ const listContent = args.inputs.map((i) => `file '${resolve84(ctx.workingDirectory, i)}'`).join("\n");
72776
72994
  await writeFile59(tempList, listContent, "utf-8");
72777
72995
  try {
72778
72996
  await execSafe(
@@ -72869,7 +73087,7 @@ var init_walkthrough = __esm({
72869
73087
  });
72870
73088
 
72871
73089
  // src/tools/manifest/status.ts
72872
- import { resolve as resolve84 } from "node:path";
73090
+ import { resolve as resolve85 } from "node:path";
72873
73091
  var PROJECT_DIR_DESCRIPTION4, statusJobTool, statusProjectTool, statusTools;
72874
73092
  var init_status = __esm({
72875
73093
  "src/tools/manifest/status.ts"() {
@@ -72893,7 +73111,7 @@ var init_status = __esm({
72893
73111
  output: external_exports.string().optional().describe("Download result media to this path when complete.")
72894
73112
  }),
72895
73113
  async execute(args, ctx) {
72896
- const projectDir = args.projectDir ? resolve84(ctx.workingDirectory, args.projectDir) : findProjectRoot(ctx.workingDirectory);
73114
+ const projectDir = args.projectDir ? resolve85(ctx.workingDirectory, args.projectDir) : findProjectRoot(ctx.workingDirectory);
72897
73115
  const record = await readJobRecord(args.jobId, projectDir);
72898
73116
  if (!record) return { success: false, error: `Job not found: ${args.jobId}` };
72899
73117
  const result = args.refresh === false ? makeJobStatusResult(record, {
@@ -72902,7 +73120,7 @@ var init_status = __esm({
72902
73120
  warnings: []
72903
73121
  }) : await refreshJobRecord(record, {
72904
73122
  wait: args.wait,
72905
- output: args.output ? resolve84(ctx.workingDirectory, args.output) : void 0,
73123
+ output: args.output ? resolve85(ctx.workingDirectory, args.output) : void 0,
72906
73124
  workingDirectory: ctx.workingDirectory
72907
73125
  });
72908
73126
  return {
@@ -72927,7 +73145,7 @@ var init_status = __esm({
72927
73145
  refresh: external_exports.boolean().optional().describe("Refresh active supported jobs before summarizing. Default false.")
72928
73146
  }),
72929
73147
  async execute(args, ctx) {
72930
- const projectDir = args.projectDir ? resolve84(ctx.workingDirectory, args.projectDir) : ctx.workingDirectory;
73148
+ const projectDir = args.projectDir ? resolve85(ctx.workingDirectory, args.projectDir) : ctx.workingDirectory;
72931
73149
  const result = await inspectProjectStatus(projectDir, { refresh: args.refresh === true });
72932
73150
  return {
72933
73151
  success: true,
@@ -73213,7 +73431,7 @@ init_source();
73213
73431
  // package.json
73214
73432
  var package_default = {
73215
73433
  name: "@vibeframe/cli",
73216
- version: "0.111.1",
73434
+ version: "0.112.0",
73217
73435
  description: "VibeFrame CLI - agentic video workflow runtime",
73218
73436
  private: false,
73219
73437
  license: "MIT",
@@ -80389,12 +80607,12 @@ function resolveCopier() {
80389
80607
  async function copyToClipboard(text) {
80390
80608
  const opener = resolveCopier();
80391
80609
  if (!opener) return false;
80392
- return new Promise((resolve85) => {
80610
+ return new Promise((resolve86) => {
80393
80611
  let settled = false;
80394
80612
  const finish = (ok) => {
80395
80613
  if (settled) return;
80396
80614
  settled = true;
80397
- resolve85(ok);
80615
+ resolve86(ok);
80398
80616
  };
80399
80617
  try {
80400
80618
  const child = spawn2(opener.command, opener.args, {
@@ -84328,13 +84546,13 @@ async function runDiagnostics() {
84328
84546
  installed = false;
84329
84547
  }
84330
84548
  } else if (toolName === "chrome") {
84331
- const { existsSync: existsSync57 } = await import("node:fs");
84549
+ const { existsSync: existsSync58 } = await import("node:fs");
84332
84550
  const { homedir: homedir8 } = await import("node:os");
84333
- const { join: join29 } = await import("node:path");
84551
+ const { join: join30 } = await import("node:path");
84334
84552
  const chromePaths = [
84335
84553
  process.env.HYPERFRAMES_CHROME_PATH,
84336
84554
  process.env.CHROME_PATH,
84337
- join29(
84555
+ join30(
84338
84556
  homedir8(),
84339
84557
  ".cache",
84340
84558
  "puppeteer",
@@ -84349,7 +84567,7 @@ async function runDiagnostics() {
84349
84567
  "/usr/bin/chromium",
84350
84568
  "/usr/bin/chromium-browser"
84351
84569
  ];
84352
- installed = chromePaths.some((p) => p && existsSync57(p));
84570
+ installed = chromePaths.some((p) => p && existsSync58(p));
84353
84571
  } else {
84354
84572
  installed = commandExists(toolName);
84355
84573
  }
@@ -86201,7 +86419,7 @@ async function startAgent(options = {}) {
86201
86419
  console.log();
86202
86420
  console.log(source_default.dim(" Commands: exit \xB7 reset \xB7 tools \xB7 context"));
86203
86421
  console.log();
86204
- return new Promise((resolve85) => {
86422
+ return new Promise((resolve86) => {
86205
86423
  if (typeof process.stdin.ref === "function") {
86206
86424
  process.stdin.ref();
86207
86425
  }
@@ -86308,7 +86526,7 @@ async function startAgent(options = {}) {
86308
86526
  clearInterval(keepalive);
86309
86527
  console.log();
86310
86528
  console.log(source_default.dim("Goodbye!"));
86311
- resolve85();
86529
+ resolve86();
86312
86530
  });
86313
86531
  rl.prompt();
86314
86532
  });