hyperframes 0.8.12 → 0.8.14

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/cli.js CHANGED
@@ -50,7 +50,7 @@ var VERSION;
50
50
  var init_version = __esm({
51
51
  "src/version.ts"() {
52
52
  "use strict";
53
- VERSION = true ? "0.8.12" : "0.0.0-dev";
53
+ VERSION = true ? "0.8.14" : "0.0.0-dev";
54
54
  }
55
55
  });
56
56
 
@@ -809,11 +809,11 @@ function __metadata(metadataKey, metadataValue) {
809
809
  }
810
810
  function __awaiter(thisArg, _arguments, P2, generator) {
811
811
  function adopt(value) {
812
- return value instanceof P2 ? value : new P2(function(resolve78) {
813
- resolve78(value);
812
+ return value instanceof P2 ? value : new P2(function(resolve79) {
813
+ resolve79(value);
814
814
  });
815
815
  }
816
- return new (P2 || (P2 = Promise))(function(resolve78, reject2) {
816
+ return new (P2 || (P2 = Promise))(function(resolve79, reject2) {
817
817
  function fulfilled(value) {
818
818
  try {
819
819
  step(generator.next(value));
@@ -829,7 +829,7 @@ function __awaiter(thisArg, _arguments, P2, generator) {
829
829
  }
830
830
  }
831
831
  function step(result) {
832
- result.done ? resolve78(result.value) : adopt(result.value).then(fulfilled, rejected);
832
+ result.done ? resolve79(result.value) : adopt(result.value).then(fulfilled, rejected);
833
833
  }
834
834
  step((generator = generator.apply(thisArg, _arguments || [])).next());
835
835
  });
@@ -1020,14 +1020,14 @@ function __asyncValues(o) {
1020
1020
  }, i2);
1021
1021
  function verb(n2) {
1022
1022
  i2[n2] = o[n2] && function(v2) {
1023
- return new Promise(function(resolve78, reject2) {
1024
- v2 = o[n2](v2), settle(resolve78, reject2, v2.done, v2.value);
1023
+ return new Promise(function(resolve79, reject2) {
1024
+ v2 = o[n2](v2), settle(resolve79, reject2, v2.done, v2.value);
1025
1025
  });
1026
1026
  };
1027
1027
  }
1028
- function settle(resolve78, reject2, d2, v2) {
1028
+ function settle(resolve79, reject2, d2, v2) {
1029
1029
  Promise.resolve(v2).then(function(v3) {
1030
- resolve78({ value: v3, done: d2 });
1030
+ resolve79({ value: v3, done: d2 });
1031
1031
  }, reject2);
1032
1032
  }
1033
1033
  }
@@ -4858,7 +4858,7 @@ var require_util = __commonJS({
4858
4858
  }
4859
4859
  path2 = url.path;
4860
4860
  }
4861
- var isAbsolute18 = exports.isAbsolute(path2);
4861
+ var isAbsolute19 = exports.isAbsolute(path2);
4862
4862
  var parts = path2.split(/\/+/);
4863
4863
  for (var part, up = 0, i2 = parts.length - 1; i2 >= 0; i2--) {
4864
4864
  part = parts[i2];
@@ -4878,7 +4878,7 @@ var require_util = __commonJS({
4878
4878
  }
4879
4879
  path2 = parts.join("/");
4880
4880
  if (path2 === "") {
4881
- path2 = isAbsolute18 ? "/" : ".";
4881
+ path2 = isAbsolute19 ? "/" : ".";
4882
4882
  }
4883
4883
  if (url) {
4884
4884
  url.path = path2;
@@ -4923,7 +4923,7 @@ var require_util = __commonJS({
4923
4923
  exports.isAbsolute = function(aPath) {
4924
4924
  return aPath.charAt(0) === "/" || urlRegexp.test(aPath);
4925
4925
  };
4926
- function relative31(aRoot, aPath) {
4926
+ function relative33(aRoot, aPath) {
4927
4927
  if (aRoot === "") {
4928
4928
  aRoot = ".";
4929
4929
  }
@@ -4942,7 +4942,7 @@ var require_util = __commonJS({
4942
4942
  }
4943
4943
  return Array(level + 1).join("../") + aPath.substr(aRoot.length + 1);
4944
4944
  }
4945
- exports.relative = relative31;
4945
+ exports.relative = relative33;
4946
4946
  var supportsNullProto = (function() {
4947
4947
  var obj = /* @__PURE__ */ Object.create(null);
4948
4948
  return !("__proto__" in obj);
@@ -41390,10 +41390,10 @@ function compareDocumentPosition(nodeA, nodeB) {
41390
41390
  function uniqueSort(nodes) {
41391
41391
  nodes = nodes.filter((node, i2, arr) => !arr.includes(node, i2 + 1));
41392
41392
  nodes.sort((a, b2) => {
41393
- const relative31 = compareDocumentPosition(a, b2);
41394
- if (relative31 & DocumentPosition.PRECEDING) {
41393
+ const relative33 = compareDocumentPosition(a, b2);
41394
+ if (relative33 & DocumentPosition.PRECEDING) {
41395
41395
  return -1;
41396
- } else if (relative31 & DocumentPosition.FOLLOWING) {
41396
+ } else if (relative33 & DocumentPosition.FOLLOWING) {
41397
41397
  return 1;
41398
41398
  }
41399
41399
  return 0;
@@ -41855,8 +41855,8 @@ var init_custom_element_registry = __esm({
41855
41855
  } : (element) => element.localName === localName;
41856
41856
  registry.set(localName, { Class, check });
41857
41857
  if (waiting.has(localName)) {
41858
- for (const resolve78 of waiting.get(localName))
41859
- resolve78(Class);
41858
+ for (const resolve79 of waiting.get(localName))
41859
+ resolve79(Class);
41860
41860
  waiting.delete(localName);
41861
41861
  }
41862
41862
  ownerDocument.querySelectorAll(
@@ -41896,13 +41896,13 @@ var init_custom_element_registry = __esm({
41896
41896
  */
41897
41897
  whenDefined(localName) {
41898
41898
  const { registry, waiting } = this;
41899
- return new Promise((resolve78) => {
41899
+ return new Promise((resolve79) => {
41900
41900
  if (registry.has(localName))
41901
- resolve78(registry.get(localName).Class);
41901
+ resolve79(registry.get(localName).Class);
41902
41902
  else {
41903
41903
  if (!waiting.has(localName))
41904
41904
  waiting.set(localName, []);
41905
- waiting.get(localName).push(resolve78);
41905
+ waiting.get(localName).push(resolve79);
41906
41906
  }
41907
41907
  });
41908
41908
  }
@@ -50603,8 +50603,8 @@ var init_esm10 = __esm({
50603
50603
  });
50604
50604
 
50605
50605
  // ../../node_modules/.bun/@jridgewell+sourcemap-codec@1.5.5/node_modules/@jridgewell/sourcemap-codec/dist/sourcemap-codec.mjs
50606
- function encodeInteger(builder, num2, relative31) {
50607
- let delta = num2 - relative31;
50606
+ function encodeInteger(builder, num2, relative33) {
50607
+ let delta = num2 - relative33;
50608
50608
  delta = delta < 0 ? -delta << 1 | 1 : delta << 1;
50609
50609
  do {
50610
50610
  let clamped = delta & 31;
@@ -52269,14 +52269,14 @@ function inlineHelper(call, ctx) {
52269
52269
  };
52270
52270
  return expandBody(fn.body.body, bindings, prov, ctx);
52271
52271
  }
52272
- function assignStep(update2, resolve78) {
52273
- if (update2.operator === "+=") return asNum(resolve78(update2.right));
52272
+ function assignStep(update2, resolve79) {
52273
+ if (update2.operator === "+=") return asNum(resolve79(update2.right));
52274
52274
  if (update2.operator === "-=") {
52275
- const s2 = asNum(resolve78(update2.right));
52275
+ const s2 = asNum(resolve79(update2.right));
52276
52276
  return s2 === void 0 ? void 0 : -s2;
52277
52277
  }
52278
52278
  if (update2.operator === "=" && update2.right?.type === "BinaryExpression") {
52279
- return asNum(resolve78(update2.right.right));
52279
+ return asNum(resolve79(update2.right.right));
52280
52280
  }
52281
52281
  return void 0;
52282
52282
  }
@@ -52285,10 +52285,10 @@ function updatedVarName(update2) {
52285
52285
  if (update2?.type === "AssignmentExpression") return update2.left?.name ?? null;
52286
52286
  return null;
52287
52287
  }
52288
- function loopStep(update2, varName, resolve78) {
52288
+ function loopStep(update2, varName, resolve79) {
52289
52289
  if (updatedVarName(update2) !== varName) return void 0;
52290
52290
  if (update2.type === "UpdateExpression") return update2.operator === "++" ? 1 : -1;
52291
- return assignStep(update2, resolve78);
52291
+ return assignStep(update2, resolve79);
52292
52292
  }
52293
52293
  function asNum(v2) {
52294
52294
  return typeof v2 === "number" && Number.isFinite(v2) ? v2 : void 0;
@@ -52305,13 +52305,13 @@ function forInitVar(init) {
52305
52305
  const d2 = init.declarations[0];
52306
52306
  return d2.id?.type === "Identifier" ? { name: d2.id.name, initExpr: d2.init } : null;
52307
52307
  }
52308
- function parseForHeader(stmt, resolve78) {
52308
+ function parseForHeader(stmt, resolve79) {
52309
52309
  const iv = forInitVar(stmt.init);
52310
52310
  const test = stmt.test;
52311
52311
  if (!iv || test?.type !== "BinaryExpression" || test.left?.name !== iv.name) return null;
52312
- const start = asNum(resolve78(iv.initExpr));
52313
- const end = asNum(resolve78(test.right));
52314
- const step = loopStep(stmt.update, iv.name, resolve78);
52312
+ const start = asNum(resolve79(iv.initExpr));
52313
+ const end = asNum(resolve79(test.right));
52314
+ const step = loopStep(stmt.update, iv.name, resolve79);
52315
52315
  if (start === void 0 || end === void 0 || !step) return null;
52316
52316
  return { v: iv.name, start, end, op: test.operator, step };
52317
52317
  }
@@ -52423,12 +52423,12 @@ function expandStatements(stmts, ctx) {
52423
52423
  }
52424
52424
  return out;
52425
52425
  }
52426
- function inlineComputedTimelines(ast, timelineVar, resolve78) {
52426
+ function inlineComputedTimelines(ast, timelineVar, resolve79) {
52427
52427
  const helpers = collectInlinableHelpers(ast, timelineVar);
52428
52428
  const ctx = {
52429
52429
  helpers,
52430
52430
  timelineVar,
52431
- resolve: resolve78,
52431
+ resolve: resolve79,
52432
52432
  depth: 0,
52433
52433
  site: { n: 0 },
52434
52434
  order: { n: 0 }
@@ -56279,6 +56279,16 @@ var init_timingCompiler = __esm({
56279
56279
  });
56280
56280
 
56281
56281
  // ../core/dist/compiler/mediaRenderIds.js
56282
+ function hasPlayableSource(el) {
56283
+ if (el.getAttribute("src"))
56284
+ return true;
56285
+ const sources = el.querySelectorAll?.("source[src]");
56286
+ if (!sources)
56287
+ return false;
56288
+ for (const _ of sources)
56289
+ return true;
56290
+ return false;
56291
+ }
56282
56292
  function uniqueRenderId(baseId, taken) {
56283
56293
  if (!taken.has(baseId))
56284
56294
  return baseId;
@@ -56291,6 +56301,8 @@ function assignMediaRenderIds(document2) {
56291
56301
  const taken = /* @__PURE__ */ new Set();
56292
56302
  const pending = [];
56293
56303
  for (const el of document2.querySelectorAll(MEDIA_SELECTOR)) {
56304
+ if (!hasPlayableSource(el))
56305
+ continue;
56294
56306
  const existing = el.getAttribute(MEDIA_RENDER_ID_ATTR);
56295
56307
  if (existing) {
56296
56308
  taken.add(existing);
@@ -56351,7 +56363,7 @@ var init_mediaRenderIds = __esm({
56351
56363
  "use strict";
56352
56364
  MEDIA_RENDER_ID_ATTR = "data-hf-render-id";
56353
56365
  AUDIO_GROUP_RENDER_ID_ATTR = "data-hf-group-render-id";
56354
- MEDIA_SELECTOR = "video[src], audio[src], img[src]";
56366
+ MEDIA_SELECTOR = "video, audio, img[src]";
56355
56367
  AUDIO_GROUP_SELECTOR = "hf-audio-group[id]";
56356
56368
  }
56357
56369
  });
@@ -65311,11 +65323,11 @@ var init_browserLeasePool = __esm({
65311
65323
  await Promise.race([
65312
65324
  this.options.close(result.browser).catch(() => {
65313
65325
  }),
65314
- new Promise((resolve78) => {
65326
+ new Promise((resolve79) => {
65315
65327
  entry.forceClose = () => {
65316
65328
  entry.forceClose = void 0;
65317
65329
  this.options.forceClose(result.browser);
65318
- resolve78();
65330
+ resolve79();
65319
65331
  };
65320
65332
  })
65321
65333
  ]);
@@ -66037,8 +66049,8 @@ async function probeBeginFrameLiveness(page, timeoutMs, frameTimeTicks, interval
66037
66049
  try {
66038
66050
  return await Promise.race([
66039
66051
  client.send("HeadlessExperimental.beginFrame", params).then(() => true).catch(() => false),
66040
- new Promise((resolve78) => {
66041
- timer = setTimeout(() => resolve78(false), timeoutMs);
66052
+ new Promise((resolve79) => {
66053
+ timer = setTimeout(() => resolve79(false), timeoutMs);
66042
66054
  })
66043
66055
  ]);
66044
66056
  } finally {
@@ -66814,7 +66826,7 @@ async function produceDrawElementFrame(page, width, height, quality = 80, syncTo
66814
66826
  );
66815
66827
  }
66816
66828
  const frameId = ++state.nextId;
66817
- const encodeResult = new Promise((resolve78, reject2) => {
66829
+ const encodeResult = new Promise((resolve79, reject2) => {
66818
66830
  const timer = setTimeout(() => {
66819
66831
  if (state.pending.delete(frameId)) {
66820
66832
  reject2(new Error(`drawElement worker encode timed out (frame ${frameId})`));
@@ -66823,7 +66835,7 @@ async function produceDrawElementFrame(page, width, height, quality = 80, syncTo
66823
66835
  state.pending.set(frameId, {
66824
66836
  resolve: (b2) => {
66825
66837
  clearTimeout(timer);
66826
- resolve78(b2);
66838
+ resolve79(b2);
66827
66839
  },
66828
66840
  reject: (e3) => {
66829
66841
  clearTimeout(timer);
@@ -66974,7 +66986,7 @@ async function produceDrawElementFrameBatch(page, times, width, height, quality
66974
66986
  for (let i2 = 0; i2 < times.length; i2++) {
66975
66987
  const frameId = ++state.nextId;
66976
66988
  fids.push(frameId);
66977
- const p2 = new Promise((resolve78, reject2) => {
66989
+ const p2 = new Promise((resolve79, reject2) => {
66978
66990
  const timer = setTimeout(() => {
66979
66991
  if (state.pending.delete(frameId)) {
66980
66992
  reject2(new Error(`drawElement worker encode timed out (frame ${frameId})`));
@@ -66983,7 +66995,7 @@ async function produceDrawElementFrameBatch(page, times, width, height, quality
66983
66995
  state.pending.set(frameId, {
66984
66996
  resolve: (b2) => {
66985
66997
  clearTimeout(timer);
66986
- resolve78(b2);
66998
+ resolve79(b2);
66987
66999
  },
66988
67000
  reject: (e3) => {
66989
67001
  clearTimeout(timer);
@@ -67254,9 +67266,9 @@ async function initThreeDProjectionInPage() {
67254
67266
  const toDataUrl = async (url) => {
67255
67267
  const resp = await fetch(url);
67256
67268
  const blob = await resp.blob();
67257
- return new Promise((resolve78, reject2) => {
67269
+ return new Promise((resolve79, reject2) => {
67258
67270
  const r2 = new FileReader();
67259
- r2.onload = () => resolve78(String(r2.result));
67271
+ r2.onload = () => resolve79(String(r2.result));
67260
67272
  r2.onerror = () => reject2(new Error(`FileReader failed for ${url}`));
67261
67273
  r2.readAsDataURL(blob);
67262
67274
  });
@@ -68469,10 +68481,10 @@ async function waitForCloseWithTimeout(promise) {
68469
68481
  () => void 0,
68470
68482
  () => void 0
68471
68483
  ),
68472
- new Promise((resolve78) => {
68484
+ new Promise((resolve79) => {
68473
68485
  timer = setTimeout(() => {
68474
68486
  timedOut = true;
68475
- resolve78();
68487
+ resolve79();
68476
68488
  }, CAPTURE_SESSION_CLOSE_TIMEOUT_MS);
68477
68489
  })
68478
68490
  ]);
@@ -68880,7 +68892,7 @@ async function pollHfReady(page, timeoutMs, intervalMs = 100) {
68880
68892
  }
68881
68893
  }
68882
68894
  }
68883
- await new Promise((resolve78) => setTimeout(resolve78, intervalMs));
68895
+ await new Promise((resolve79) => setTimeout(resolve79, intervalMs));
68884
68896
  }
68885
68897
  const diag2 = await evaluateHfDiagnostic(page);
68886
68898
  if (diag2.hasSeek && diag2.duration === 0) {
@@ -68921,7 +68933,7 @@ async function pollSubCompositionTimelines(page, timeoutMs, intervalMs = 150, ge
68921
68933
  );
68922
68934
  break;
68923
68935
  }
68924
- await new Promise((resolve78) => setTimeout(resolve78, intervalMs));
68936
+ await new Promise((resolve79) => setTimeout(resolve79, intervalMs));
68925
68937
  }
68926
68938
  if (ready) {
68927
68939
  await page.evaluate(`(function() {
@@ -68970,7 +68982,7 @@ async function pollVideosReady(page, skipIds, timeoutMs, intervalMs = 100) {
68970
68982
  const deadline = Date.now() + timeoutMs;
68971
68983
  while (Date.now() < deadline) {
68972
68984
  if (await check()) return true;
68973
- await new Promise((resolve78) => setTimeout(resolve78, intervalMs));
68985
+ await new Promise((resolve79) => setTimeout(resolve79, intervalMs));
68974
68986
  }
68975
68987
  return check();
68976
68988
  }
@@ -68993,7 +69005,7 @@ async function pollImagesReady(page, timeoutMs, intervalMs = 100) {
68993
69005
  const deadline = Date.now() + timeoutMs;
68994
69006
  while (Date.now() < deadline) {
68995
69007
  if (await check()) return true;
68996
- await new Promise((resolve78) => setTimeout(resolve78, intervalMs));
69008
+ await new Promise((resolve79) => setTimeout(resolve79, intervalMs));
68997
69009
  }
68998
69010
  return check();
68999
69011
  }
@@ -69120,7 +69132,7 @@ async function waitForOptionalTailwindReady(page, timeoutMs) {
69120
69132
  page.evaluate(
69121
69133
  `Promise.resolve(window.__tailwindReady).then(() => true, () => false)`
69122
69134
  ),
69123
- new Promise((resolve78) => setTimeout(() => resolve78(false), timeoutMs))
69135
+ new Promise((resolve79) => setTimeout(() => resolve79(false), timeoutMs))
69124
69136
  ]);
69125
69137
  if (!ready) {
69126
69138
  throw new Error(
@@ -70412,7 +70424,7 @@ var init_frameCapture = __esm({
70412
70424
  BROWSER_CONSOLE_BUFFER_SIZE = 200;
70413
70425
  CAPTURE_SESSION_CLOSE_TIMEOUT_MS = 5e3;
70414
70426
  LOCKED_WARMUP_TICKS = 60;
70415
- realSleep = (ms) => new Promise((resolve78) => setTimeout(resolve78, ms));
70427
+ realSleep = (ms) => new Promise((resolve79) => setTimeout(resolve79, ms));
70416
70428
  BEGIN_FRAME_CAPTURE_HEADROOM_INTERVALS = 10;
70417
70429
  BEGIN_FRAME_COMMIT_LEAD_INTERVALS = 6;
70418
70430
  BEGIN_FRAME_PROBE_LEAD_INTERVALS = 5;
@@ -70464,8 +70476,8 @@ var init_managedChildProcess = __esm({
70464
70476
  this.options = options;
70465
70477
  this.now = options.now ?? Date.now;
70466
70478
  this.startedAtMs = this.now();
70467
- this.outcomePromise = new Promise((resolve78) => {
70468
- this.resolveOutcome = resolve78;
70479
+ this.outcomePromise = new Promise((resolve79) => {
70480
+ this.resolveOutcome = resolve79;
70469
70481
  });
70470
70482
  child.stderr?.on("data", this.onStderr);
70471
70483
  child.once("spawn", this.onSpawn);
@@ -72105,12 +72117,12 @@ function createFrameReorderBuffer(startFrame, endFrame) {
72105
72117
  let cursor = startFrame;
72106
72118
  let aborted = null;
72107
72119
  const pending = /* @__PURE__ */ new Map();
72108
- const enqueueAt = (frame, resolve78, reject2) => {
72120
+ const enqueueAt = (frame, resolve79, reject2) => {
72109
72121
  const list = pending.get(frame);
72110
72122
  if (list === void 0) {
72111
- pending.set(frame, [{ resolve: resolve78, reject: reject2 }]);
72123
+ pending.set(frame, [{ resolve: resolve79, reject: reject2 }]);
72112
72124
  } else {
72113
- list.push({ resolve: resolve78, reject: reject2 });
72125
+ list.push({ resolve: resolve79, reject: reject2 });
72114
72126
  }
72115
72127
  };
72116
72128
  const flushAt = (frame) => {
@@ -72119,31 +72131,31 @@ function createFrameReorderBuffer(startFrame, endFrame) {
72119
72131
  pending.delete(frame);
72120
72132
  for (const waiter of list) waiter.resolve();
72121
72133
  };
72122
- const waitForFrame = (frame) => new Promise((resolve78, reject2) => {
72134
+ const waitForFrame = (frame) => new Promise((resolve79, reject2) => {
72123
72135
  if (aborted) {
72124
72136
  reject2(aborted);
72125
72137
  return;
72126
72138
  }
72127
72139
  if (frame === cursor) {
72128
- resolve78();
72140
+ resolve79();
72129
72141
  return;
72130
72142
  }
72131
- enqueueAt(frame, resolve78, reject2);
72143
+ enqueueAt(frame, resolve79, reject2);
72132
72144
  });
72133
72145
  const advanceTo = (frame) => {
72134
72146
  cursor = frame;
72135
72147
  flushAt(frame);
72136
72148
  };
72137
- const waitForAllDone = () => new Promise((resolve78, reject2) => {
72149
+ const waitForAllDone = () => new Promise((resolve79, reject2) => {
72138
72150
  if (aborted) {
72139
72151
  reject2(aborted);
72140
72152
  return;
72141
72153
  }
72142
72154
  if (cursor >= endFrame) {
72143
- resolve78();
72155
+ resolve79();
72144
72156
  return;
72145
72157
  }
72146
- enqueueAt(endFrame, resolve78, reject2);
72158
+ enqueueAt(endFrame, resolve79, reject2);
72147
72159
  });
72148
72160
  const abort = (err) => {
72149
72161
  if (aborted) return;
@@ -72414,8 +72426,8 @@ async function spawnStreamingEncoder(outputPath, options, signal, config) {
72414
72426
  close: async () => {
72415
72427
  const stdin = ffmpeg.stdin;
72416
72428
  if (stdin && !stdin.destroyed) {
72417
- await new Promise((resolve78) => {
72418
- stdin.end(() => resolve78());
72429
+ await new Promise((resolve79) => {
72430
+ stdin.end(() => resolve79());
72419
72431
  });
72420
72432
  }
72421
72433
  const outcome = await exitPromise;
@@ -72690,10 +72702,10 @@ async function waitForCacheLock(signal) {
72690
72702
  if (signal?.aborted) {
72691
72703
  throw new UrlDownloadError("cancelled", false, "Download cancelled");
72692
72704
  }
72693
- await new Promise((resolve78, reject2) => {
72705
+ await new Promise((resolve79, reject2) => {
72694
72706
  const timeout = setTimeout(() => {
72695
72707
  signal?.removeEventListener("abort", onAbort);
72696
- resolve78();
72708
+ resolve79();
72697
72709
  }, CACHE_LOCK_POLL_MS);
72698
72710
  const onAbort = () => {
72699
72711
  clearTimeout(timeout);
@@ -77684,7 +77696,7 @@ var require_processor = __commonJS({
77684
77696
  if (options === void 0) {
77685
77697
  options = {};
77686
77698
  }
77687
- return new Promise(function(resolve78, reject2) {
77699
+ return new Promise(function(resolve79, reject2) {
77688
77700
  try {
77689
77701
  var root_1 = _this._root(rule, options);
77690
77702
  Promise.resolve(_this.func(root_1)).then(function(transform) {
@@ -77694,7 +77706,7 @@ var require_processor = __commonJS({
77694
77706
  rule.selector = string;
77695
77707
  }
77696
77708
  return { transform, root: root_1, string };
77697
- }).then(resolve78, reject2);
77709
+ }).then(resolve79, reject2);
77698
77710
  } catch (e3) {
77699
77711
  reject2(e3);
77700
77712
  return;
@@ -77972,6 +77984,28 @@ function hasUnresolvedTemplatingToken(url) {
77972
77984
  function isUnresolvedAssetPlaceholder(rawSrc) {
77973
77985
  return /^__[A-Z_]+__$/.test(rawSrc.trim()) || hasUnresolvedTemplatingToken(rawSrc);
77974
77986
  }
77987
+ function collectSubCompositionSrcs(html) {
77988
+ const scannable = maskNonScannableRanges(html);
77989
+ const srcs = [];
77990
+ const seen = /* @__PURE__ */ new Set();
77991
+ let cursor = 0;
77992
+ while (cursor < scannable.length) {
77993
+ const open3 = scannable.indexOf("<", cursor);
77994
+ if (open3 === -1) break;
77995
+ const close = scannable.indexOf(">", open3 + 1);
77996
+ if (close === -1) break;
77997
+ cursor = close + 1;
77998
+ const match = COMPOSITION_SRC_ATTR.exec(scannable.slice(open3, cursor));
77999
+ if (!match) continue;
78000
+ const src = (match[1] ?? "").trim();
78001
+ if (!src || seen.has(src)) continue;
78002
+ if (isUnresolvedAssetPlaceholder(src)) continue;
78003
+ if (isRemoteOrInlineUrl(src)) continue;
78004
+ seen.add(src);
78005
+ srcs.push(src);
78006
+ }
78007
+ return srcs;
78008
+ }
77975
78009
  function cleanAssetUrl(url) {
77976
78010
  return url.trim().split(/[?#]/, 1)[0] ?? "";
77977
78011
  }
@@ -78031,9 +78065,11 @@ function maskNonScannableRanges(html) {
78031
78065
  out = maskRange(out, /<script\b[^>]*>[\s\S]*?<\/script\b[^>]*>/gi);
78032
78066
  return out;
78033
78067
  }
78068
+ var COMPOSITION_SRC_ATTR;
78034
78069
  var init_assetResolution = __esm({
78035
78070
  "../parsers/dist/assetResolution.js"() {
78036
78071
  "use strict";
78072
+ COMPOSITION_SRC_ATTR = /\bdata-composition-src\s*=\s*["']([^"']+)["']/i;
78037
78073
  }
78038
78074
  });
78039
78075
 
@@ -78400,14 +78436,14 @@ function inlineHelper2(call, ctx) {
78400
78436
  };
78401
78437
  return expandBody2(fn.body.body, bindings, prov, ctx);
78402
78438
  }
78403
- function assignStep2(update2, resolve78) {
78404
- if (update2.operator === "+=") return asNum2(resolve78(update2.right));
78439
+ function assignStep2(update2, resolve79) {
78440
+ if (update2.operator === "+=") return asNum2(resolve79(update2.right));
78405
78441
  if (update2.operator === "-=") {
78406
- const s2 = asNum2(resolve78(update2.right));
78442
+ const s2 = asNum2(resolve79(update2.right));
78407
78443
  return s2 === void 0 ? void 0 : -s2;
78408
78444
  }
78409
78445
  if (update2.operator === "=" && update2.right?.type === "BinaryExpression") {
78410
- return asNum2(resolve78(update2.right.right));
78446
+ return asNum2(resolve79(update2.right.right));
78411
78447
  }
78412
78448
  return void 0;
78413
78449
  }
@@ -78416,10 +78452,10 @@ function updatedVarName2(update2) {
78416
78452
  if (update2?.type === "AssignmentExpression") return update2.left?.name ?? null;
78417
78453
  return null;
78418
78454
  }
78419
- function loopStep2(update2, varName, resolve78) {
78455
+ function loopStep2(update2, varName, resolve79) {
78420
78456
  if (updatedVarName2(update2) !== varName) return void 0;
78421
78457
  if (update2.type === "UpdateExpression") return update2.operator === "++" ? 1 : -1;
78422
- return assignStep2(update2, resolve78);
78458
+ return assignStep2(update2, resolve79);
78423
78459
  }
78424
78460
  function asNum2(v2) {
78425
78461
  return typeof v2 === "number" && Number.isFinite(v2) ? v2 : void 0;
@@ -78436,13 +78472,13 @@ function forInitVar2(init) {
78436
78472
  const d2 = init.declarations[0];
78437
78473
  return d2.id?.type === "Identifier" ? { name: d2.id.name, initExpr: d2.init } : null;
78438
78474
  }
78439
- function parseForHeader2(stmt, resolve78) {
78475
+ function parseForHeader2(stmt, resolve79) {
78440
78476
  const iv = forInitVar2(stmt.init);
78441
78477
  const test = stmt.test;
78442
78478
  if (!iv || test?.type !== "BinaryExpression" || test.left?.name !== iv.name) return null;
78443
- const start = asNum2(resolve78(iv.initExpr));
78444
- const end = asNum2(resolve78(test.right));
78445
- const step = loopStep2(stmt.update, iv.name, resolve78);
78479
+ const start = asNum2(resolve79(iv.initExpr));
78480
+ const end = asNum2(resolve79(test.right));
78481
+ const step = loopStep2(stmt.update, iv.name, resolve79);
78446
78482
  if (start === void 0 || end === void 0 || !step) return null;
78447
78483
  return { v: iv.name, start, end, op: test.operator, step };
78448
78484
  }
@@ -78554,12 +78590,12 @@ function expandStatements2(stmts, ctx) {
78554
78590
  }
78555
78591
  return out;
78556
78592
  }
78557
- function inlineComputedTimelines2(ast, timelineVar, resolve78) {
78593
+ function inlineComputedTimelines2(ast, timelineVar, resolve79) {
78558
78594
  const helpers = collectInlinableHelpers2(ast, timelineVar);
78559
78595
  const ctx = {
78560
78596
  helpers,
78561
78597
  timelineVar,
78562
- resolve: resolve78,
78598
+ resolve: resolve79,
78563
78599
  depth: 0,
78564
78600
  site: { n: 0 },
78565
78601
  order: { n: 0 }
@@ -82356,13 +82392,7 @@ function lintMissingOrEmptySubComposition(projectDir, rootHtml) {
82356
82392
  const checked = /* @__PURE__ */ new Map();
82357
82393
  const visited = /* @__PURE__ */ new Set();
82358
82394
  const walk = (html) => {
82359
- const compositionSrcRe = /<[^>]*\bdata-composition-src\s*=\s*["']([^"']+)["'][^>]*>/gi;
82360
- const scannable = maskNonScannableRanges(html);
82361
- let match;
82362
- while ((match = compositionSrcRe.exec(scannable)) !== null) {
82363
- const srcPath = (match[1] ?? "").trim();
82364
- if (!srcPath) continue;
82365
- if (isUnresolvedAssetPlaceholder(srcPath)) continue;
82395
+ for (const srcPath of collectSubCompositionSrcs(html)) {
82366
82396
  const filePath = resolve8(projectDir, srcPath);
82367
82397
  if (visited.has(filePath)) continue;
82368
82398
  visited.add(filePath);
@@ -82490,7 +82520,7 @@ var init_dist4 = __esm({
82490
82520
  }
82491
82521
  ];
82492
82522
  },
82493
- // missing_timeline_registry + timeline_registry_missing_init
82523
+ // missing_timeline_registry
82494
82524
  // fallow-ignore-next-line complexity
82495
82525
  ({ source, rawSource, rootTag, options }) => {
82496
82526
  if (options.isSubComposition || rawSource.trimStart().toLowerCase().startsWith("<template")) {
@@ -82506,14 +82536,6 @@ var init_dist4 = __esm({
82506
82536
  fixHint: "Register each composition timeline on `window.__timelines[compositionId]`."
82507
82537
  });
82508
82538
  }
82509
- if (TIMELINE_REGISTRY_ASSIGN_PATTERN.test(source) && !TIMELINE_REGISTRY_INIT_PATTERN.test(source)) {
82510
- findings.push({
82511
- code: "timeline_registry_missing_init",
82512
- severity: "error",
82513
- message: "`window.__timelines[\u2026] = \u2026` is used without initializing `window.__timelines` first.",
82514
- fixHint: "Add `window.__timelines = window.__timelines || {};` before any timeline assignment."
82515
- });
82516
- }
82517
82539
  return findings;
82518
82540
  },
82519
82541
  // timeline_id_mismatch
@@ -82893,9 +82915,9 @@ var init_dist4 = __esm({
82893
82915
  findings.push({
82894
82916
  code: "video_nested_in_timed_element",
82895
82917
  severity: "error",
82896
- message: `<video> with data-start is nested inside <${parent.name}${parent.id ? ` id="${parent.id}"` : ""}> which also has data-start. The framework cannot manage playback of nested media \u2014 video will be FROZEN in renders.`,
82918
+ message: `<video> with data-start is nested inside <${parent.name}${parent.id ? ` id="${parent.id}"` : ""}> which also has data-start. The frame extractor resolves the video's start from its own data-start without the wrapper's offset, while visibility uses the wrapper's window, so the two disagree: the clip shows the wrong source frames and then disappears partway through its slot.`,
82897
82919
  elementId: readAttr(tag.raw, "id") || void 0,
82898
- fixHint: "Move the <video> to be a direct child of the stage, or remove data-start from the wrapper div (use it as a non-timed visual container).",
82920
+ fixHint: "Time the wrapper OR the video, never both: remove data-start from the wrapper (use it as a non-timed visual container), or move the <video> up to be a direct child of the stage.",
82899
82921
  snippet: truncateSnippet(tag.raw)
82900
82922
  });
82901
82923
  break;
@@ -84464,7 +84486,7 @@ ${other.raw}`)
84464
84486
  severity: "error",
84465
84487
  message: `<${tag.name}${elementId ? ` id="${elementId}"` : ""}> uses data-layer instead of data-track-index.`,
84466
84488
  elementId,
84467
- fixHint: "Replace data-layer with data-track-index. The runtime reads data-track-index.",
84489
+ fixHint: "Replace data-layer with data-track-index, which is the canonical name Studio and the linter read. Neither name is read by the render.",
84468
84490
  snippet: truncateSnippet(tag.raw)
84469
84491
  });
84470
84492
  }
@@ -84862,10 +84884,13 @@ ${other.raw}`)
84862
84884
  // can't leak styles into each other. A rule whose LEFTMOST selector is the ROOT
84863
84885
  // element's own class (e.g. `.frame { ... }` on the same element that carries
84864
84886
  // data-composition-id) therefore becomes a DESCENDANT selector that can never
84865
- // match the root — the whole scene renders unstyled (tiny text top-left, images
84866
- // at natural size). lint/validate/inspect evaluate the file in isolation (no
84867
- // scoping) and Studio previews each scene in its own iframe (no scoping), so the
84868
- // break is invisible until the composited MP4 render. Style the root via `#root`
84887
+ // match the SCOPED element itself. NOTE on the symptom: since #1886 the producer
84888
+ // preserves the authored root as a `data-hf-inner-root` wrapper INSIDE the scoped
84889
+ // element (regression fixture packages/producer/tests/sub-comp-class-selector),
84890
+ // so the class still matches as a descendant and the scene no longer renders
84891
+ // unstyled. This rule is now a consistency constraint, not a render-bug guard:
84892
+ // `#root` is the shape the registry blocks model and the one the scoper
84893
+ // special-cases. Style the root via `#root`
84869
84894
  // (the scoper special-cases the root id) and descendants via plain selectors,
84870
84895
  // like the registry blocks — the runtime already scopes each scene by id, so a
84871
84896
  // class namespace on the root is redundant.
@@ -84882,9 +84907,9 @@ ${other.raw}`)
84882
84907
  {
84883
84908
  code: "subcomposition_root_styled_by_class",
84884
84909
  severity: "error",
84885
- message: `Root element has class="${rootClasses.join(" ")}" and is styled by ${offenders.length} rule(s) keyed off that class (e.g. ${example}). At render, every sub-composition rule is scoped to [data-composition-id="${rootCompositionId}"] <selector>, so a selector whose leftmost part is the ROOT's own class becomes a descendant selector that cannot match the root \u2014 the scene renders unstyled (tiny text top-left, full-size images). lint/validate/inspect and Studio's per-frame iframe preview do not scope, so this passes every static check and looks correct in preview.`,
84910
+ message: `Root element has class="${rootClasses.join(" ")}" and is styled by ${offenders.length} rule(s) keyed off that class (e.g. ${example}). At render, every sub-composition rule is scoped to [data-composition-id="${rootCompositionId}"] <selector>, so a selector whose leftmost part is the ROOT's own class becomes a descendant selector that cannot match the scoped element itself. Since #1886 the producer preserves the authored root as an inner wrapper, so this no longer renders the scene unstyled, but #root is the shape the scoper special-cases and the registry blocks model. Use it so preview, render, and Studio agree.`,
84886
84911
  selector: example,
84887
- fixHint: `Give the root id="root" and style it with \`#root { ... }\` plus plain descendant selectors (\`.kicker\`, \`#hero\`) \u2014 the runtime already scopes each sub-composition by data-composition-id, so a class namespace on the root is redundant and breaks under scoping.`,
84912
+ fixHint: `Give the root id="root" and style it with \`#root { ... }\` plus plain descendant selectors (\`.kicker\`, \`#hero\`) \u2014 the runtime already scopes each sub-composition by data-composition-id, so a class namespace on the root is redundant.`,
84888
84913
  snippet: truncateSnippet(rootTag.raw)
84889
84914
  }
84890
84915
  ];
@@ -85321,7 +85346,7 @@ function enumerateNestedCompositionHosts(assembledHost, ancestry) {
85321
85346
  const hosts = [];
85322
85347
  const skipped = [];
85323
85348
  for (const nestedHost of assembledHost.querySelectorAll(COMPOSITION_HOST_SELECTOR)) {
85324
- const src = nestedHost.getAttribute(COMPOSITION_SRC_ATTR);
85349
+ const src = nestedHost.getAttribute(COMPOSITION_SRC_ATTR2);
85325
85350
  if (!src)
85326
85351
  continue;
85327
85352
  if (ancestry.includes(src)) {
@@ -85336,14 +85361,14 @@ function enumerateNestedCompositionHosts(assembledHost, ancestry) {
85336
85361
  }
85337
85362
  return { hosts, skipped };
85338
85363
  }
85339
- var COMPOSITION_ID_ATTR, COMPOSITION_SRC_ATTR, COMPOSITION_ROOT_SELECTOR, COMPOSITION_HOST_SELECTOR, STYLE_SELECTOR, SCRIPT_SELECTOR, HOISTED_LINK_SELECTOR, MAX_SUB_COMPOSITION_DEPTH;
85364
+ var COMPOSITION_ID_ATTR, COMPOSITION_SRC_ATTR2, COMPOSITION_ROOT_SELECTOR, COMPOSITION_HOST_SELECTOR, STYLE_SELECTOR, SCRIPT_SELECTOR, HOISTED_LINK_SELECTOR, MAX_SUB_COMPOSITION_DEPTH;
85340
85365
  var init_compositionAssembly = __esm({
85341
85366
  "../core/dist/compiler/compositionAssembly.js"() {
85342
85367
  "use strict";
85343
85368
  COMPOSITION_ID_ATTR = "data-composition-id";
85344
- COMPOSITION_SRC_ATTR = "data-composition-src";
85369
+ COMPOSITION_SRC_ATTR2 = "data-composition-src";
85345
85370
  COMPOSITION_ROOT_SELECTOR = `[${COMPOSITION_ID_ATTR}]`;
85346
- COMPOSITION_HOST_SELECTOR = `[${COMPOSITION_SRC_ATTR}]`;
85371
+ COMPOSITION_HOST_SELECTOR = `[${COMPOSITION_SRC_ATTR2}]`;
85347
85372
  STYLE_SELECTOR = "style";
85348
85373
  SCRIPT_SELECTOR = "script";
85349
85374
  HOISTED_LINK_SELECTOR = 'link[rel="stylesheet"], link[rel="preconnect"]';
@@ -91049,11 +91074,11 @@ function createFileServer(options) {
91049
91074
  headers: { "Content-Type": contentType }
91050
91075
  });
91051
91076
  });
91052
- return new Promise((resolve78) => {
91077
+ return new Promise((resolve79) => {
91053
91078
  const server = serve({ fetch: app.fetch, port }, (info) => {
91054
91079
  const actualPort = info.port;
91055
91080
  const url = `http://localhost:${actualPort}`;
91056
- resolve78({
91081
+ resolve79({
91057
91082
  url,
91058
91083
  port: actualPort,
91059
91084
  close: () => server.close()
@@ -93740,6 +93765,25 @@ function trackCommand(command2, runId3) {
93740
93765
  ...runIdField(runId3)
93741
93766
  });
93742
93767
  }
93768
+ function catalogEventProperties(usage) {
93769
+ if (!usage) return {};
93770
+ if (usage.manifestUnreadable) return { registry_manifest_unreadable: true };
93771
+ const names = usage.installed.slice(0, MAX_REPORTED_ITEM_NAMES);
93772
+ const reportedNames = new Set(names);
93773
+ const used = usage.usedBlocks.filter((name) => reportedNames.has(name));
93774
+ const truncated = names.length < usage.installed.length;
93775
+ return {
93776
+ registry_item_count: usage.installed.length,
93777
+ registry_blocks_used_count: usage.usedBlocks.length,
93778
+ // Say when the name lists are a window rather than the whole set. Without
93779
+ // it a name-joining drop-off query silently reads a truncated project as
93780
+ // all-abandoned: the used blocks can all sit past the cap, leaving an empty
93781
+ // `registry_blocks_used` against a non-zero count.
93782
+ ...truncated ? { registry_items_truncated: true } : {},
93783
+ ...names.length > 0 ? { registry_items: names.join(",") } : {},
93784
+ ...used.length > 0 ? { registry_blocks_used: used.join(",") } : {}
93785
+ };
93786
+ }
93743
93787
  function trackRenderComplete(props) {
93744
93788
  trackEvent(
93745
93789
  "render_complete",
@@ -93753,6 +93797,7 @@ function trackRenderComplete(props) {
93753
93797
  fps: props.fps,
93754
93798
  quality: props.quality,
93755
93799
  authoring_skill: props.authoringSkill,
93800
+ ...catalogEventProperties(props.catalogUsage),
93756
93801
  workers: props.workers,
93757
93802
  workers_bound_by: props.workersBoundBy,
93758
93803
  workers_cpu_based: props.workersCpuBased,
@@ -94056,6 +94101,7 @@ function trackLintRuleStreak(props) {
94056
94101
  ...runIdField(props.runId)
94057
94102
  });
94058
94103
  }
94104
+ var MAX_REPORTED_ITEM_NAMES;
94059
94105
  var init_events = __esm({
94060
94106
  "src/telemetry/events.ts"() {
94061
94107
  "use strict";
@@ -94064,6 +94110,7 @@ var init_events = __esm({
94064
94110
  init_client();
94065
94111
  init_config();
94066
94112
  init_system();
94113
+ MAX_REPORTED_ITEM_NAMES = 40;
94067
94114
  }
94068
94115
  });
94069
94116
 
@@ -96441,7 +96488,7 @@ async function fetchWithRetry(url, attempts = 3) {
96441
96488
  } catch (err) {
96442
96489
  lastErr = err;
96443
96490
  if (attempt === attempts || !isRetryableTransport(err)) break;
96444
- await new Promise((resolve78) => setTimeout(resolve78, 150 * attempt));
96491
+ await new Promise((resolve79) => setTimeout(resolve79, 150 * attempt));
96445
96492
  }
96446
96493
  }
96447
96494
  throw lastErr;
@@ -97265,7 +97312,7 @@ function downloadFile(url, dest, options = {}) {
97265
97312
  const tmp = `${dest}.${process.pid}.${randomUUID6()}.tmp`;
97266
97313
  const timeoutMs = options.timeoutMs ?? DEFAULT_DOWNLOAD_TIMEOUT_MS;
97267
97314
  const maxBytes = options.maxBytes;
97268
- return new Promise((resolve78, reject2) => {
97315
+ return new Promise((resolve79, reject2) => {
97269
97316
  const follow = (u, hops = 0) => {
97270
97317
  let activeResponse;
97271
97318
  let responsePipelineStarted = false;
@@ -97306,7 +97353,7 @@ function downloadFile(url, dest, options = {}) {
97306
97353
  const transfer = maxBytes === void 0 ? pipeline2(res, file) : pipeline2(res, enforceByteLimit(maxBytes), file);
97307
97354
  transfer.then(() => {
97308
97355
  renameSync4(tmp, dest);
97309
- resolve78();
97356
+ resolve79();
97310
97357
  }).catch((err) => {
97311
97358
  removePartialFile(tmp);
97312
97359
  reject2(requestError ?? err);
@@ -98253,6 +98300,8 @@ __export(projectConfig_exports, {
98253
98300
  normalizeConfig: () => normalizeConfig,
98254
98301
  projectConfigPath: () => projectConfigPath,
98255
98302
  readProjectConfig: () => readProjectConfig,
98303
+ readProjectConfigWithStatus: () => readProjectConfigWithStatus,
98304
+ recordProjectRegistryItems: () => recordProjectRegistryItems,
98256
98305
  resolveAutoProxy: () => resolveAutoProxy,
98257
98306
  seedProjectAuthoringSkill: () => seedProjectAuthoringSkill,
98258
98307
  writeProjectConfig: () => writeProjectConfig
@@ -98262,15 +98311,23 @@ import { join as join25, resolve as resolve12 } from "path";
98262
98311
  function projectConfigPath(projectDir) {
98263
98312
  return join25(resolve12(projectDir), PROJECT_CONFIG_FILENAME);
98264
98313
  }
98265
- function readProjectConfig(projectDir) {
98314
+ function readProjectConfigWithStatus(projectDir) {
98266
98315
  const path2 = projectConfigPath(projectDir);
98316
+ let text2;
98317
+ try {
98318
+ text2 = readFileSync17(path2, "utf-8");
98319
+ } catch (error) {
98320
+ return { status: isFileNotFound(error) ? "missing" : "unreadable" };
98321
+ }
98267
98322
  try {
98268
- const parsed = JSON.parse(readFileSync17(path2, "utf-8"));
98269
- return normalizeConfig(parsed);
98323
+ return { status: "ok", config: normalizeConfig(JSON.parse(text2)) };
98270
98324
  } catch {
98271
- return void 0;
98325
+ return { status: "unreadable" };
98272
98326
  }
98273
98327
  }
98328
+ function readProjectConfig(projectDir) {
98329
+ return readProjectConfigWithStatus(projectDir).config;
98330
+ }
98274
98331
  function normalizeConfig(partial) {
98275
98332
  return {
98276
98333
  $schema: partial.$schema ?? DEFAULT_PROJECT_CONFIG.$schema,
@@ -98285,9 +98342,20 @@ function normalizeConfig(partial) {
98285
98342
  },
98286
98343
  // Slug-gate on read so a hand-edited or corrupt value never reaches the
98287
98344
  // telemetry stream; an invalid slug simply drops the attribution.
98288
- authoringSkill: normalizeSkillSlug(partial.authoringSkill)
98345
+ authoringSkill: normalizeSkillSlug(partial.authoringSkill),
98346
+ // Whitelist rebuild - an omission here silently drops the manifest on
98347
+ // every config round-trip, which would read as "this project never
98348
+ // installed a catalog item".
98349
+ registryItems: normalizeRegistryItems(partial.registryItems)
98289
98350
  };
98290
98351
  }
98352
+ function normalizeRegistryItems(raw) {
98353
+ if (!Array.isArray(raw)) return void 0;
98354
+ const items = raw.filter(
98355
+ (entry) => isJsonObject(entry) && typeof entry.name === "string" && entry.name !== "" && typeof entry.type === "string" && typeof entry.target === "string"
98356
+ );
98357
+ return items.length > 0 ? items : void 0;
98358
+ }
98291
98359
  function writeProjectConfig(projectDir, config = DEFAULT_PROJECT_CONFIG) {
98292
98360
  const path2 = projectConfigPath(projectDir);
98293
98361
  writeFileSync11(path2, JSON.stringify(config, null, 2) + "\n", "utf-8");
@@ -98333,6 +98401,33 @@ function seedProjectAuthoringSkill(projectDir, rawSkill) {
98333
98401
  } catch {
98334
98402
  }
98335
98403
  }
98404
+ function recordProjectRegistryItems(projectDir, items) {
98405
+ if (items.length === 0) return;
98406
+ const path2 = projectConfigPath(projectDir);
98407
+ let text2;
98408
+ try {
98409
+ text2 = readFileSync17(path2, "utf-8");
98410
+ } catch {
98411
+ return;
98412
+ }
98413
+ try {
98414
+ const parsed = JSON.parse(text2);
98415
+ if (!isJsonObject(parsed)) return;
98416
+ const existing = normalizeRegistryItems(parsed.registryItems) ?? [];
98417
+ const byName = new Map(existing.map((item) => [item.name, item]));
98418
+ for (const item of items) byName.set(item.name, item);
98419
+ const merged = [...byName.values()];
98420
+ const unchanged = merged.length === existing.length && merged.every((item, index) => {
98421
+ const prior = existing[index];
98422
+ return prior !== void 0 && prior.name === item.name && prior.type === item.type && prior.target === item.target;
98423
+ });
98424
+ if (unchanged) return;
98425
+ parsed.registryItems = merged;
98426
+ const indent = /\n([ \t]+)"/.exec(text2)?.[1] ?? " ";
98427
+ writeFileSync11(path2, JSON.stringify(parsed, null, indent) + "\n", "utf-8");
98428
+ } catch {
98429
+ }
98430
+ }
98336
98431
  var PROJECT_CONFIG_FILENAME, PROJECT_CONFIG_SCHEMA_URL, DEFAULT_PROJECT_CONFIG;
98337
98432
  var init_projectConfig = __esm({
98338
98433
  "src/utils/projectConfig.ts"() {
@@ -99161,15 +99256,18 @@ function mirrorGlobalSkills(opts) {
99161
99256
  for (const { agent, base: base2, sub } of AGENT_GLOBAL_DIRS) {
99162
99257
  const targetDir = join28(bases[base2], ...sub.split("/").filter(Boolean));
99163
99258
  if (targetDir === source || targetDir === universalStore) continue;
99259
+ if (UNIVERSAL_STORE_READERS.has(agent)) continue;
99164
99260
  if (!existsSync30(dirname11(targetDir))) continue;
99165
99261
  if (mirrorInto(targetDir, source, skills, platform11)) mirrored.push({ agent, dir: targetDir });
99166
99262
  }
99167
99263
  return { source, mirrored };
99168
99264
  }
99265
+ var UNIVERSAL_STORE_READERS;
99169
99266
  var init_skillsMirror = __esm({
99170
99267
  "src/utils/skillsMirror.ts"() {
99171
99268
  "use strict";
99172
99269
  init_agentDirs_generated();
99270
+ UNIVERSAL_STORE_READERS = /* @__PURE__ */ new Set(["pi"]);
99173
99271
  }
99174
99272
  });
99175
99273
 
@@ -99284,7 +99382,7 @@ function hasGit2() {
99284
99382
  }
99285
99383
  function spawnNpx(args, opts = {}) {
99286
99384
  const npx = buildNpxCommand(args);
99287
- return new Promise((resolve78, reject2) => {
99385
+ return new Promise((resolve79, reject2) => {
99288
99386
  const child = spawn6(npx.command, npx.args, {
99289
99387
  // Route the child's stdout to the parent's stderr (fd 2), keeping stdin
99290
99388
  // inherited. `skills update --json` runs this installer before printing its
@@ -99313,7 +99411,7 @@ function spawnNpx(args, opts = {}) {
99313
99411
  }
99314
99412
  });
99315
99413
  child.on("close", (code, signal) => {
99316
- if (code === 0) resolve78();
99414
+ if (code === 0) resolve79();
99317
99415
  else if (signal === "SIGINT" || code === 130)
99318
99416
  reject2(new CliResultSignal({ exitCode: 0, kind: "success", presented: true }));
99319
99417
  else reject2(new Error(`npx ${args.join(" ")} exited with code ${code}`));
@@ -115029,7 +115127,7 @@ function isErrno(err, code) {
115029
115127
  return err.code === code;
115030
115128
  }
115031
115129
  function sleep(ms) {
115032
- return new Promise((resolve78) => setTimeout(resolve78, ms));
115130
+ return new Promise((resolve79) => setTimeout(resolve79, ms));
115033
115131
  }
115034
115132
  function tryAcquireDirLock(lockDir) {
115035
115133
  try {
@@ -116325,10 +116423,10 @@ function createFileServer2(options) {
116325
116423
  }
116326
116424
  });
116327
116425
  });
116328
- return new Promise((resolve78) => {
116426
+ return new Promise((resolve79) => {
116329
116427
  const connections = /* @__PURE__ */ new Set();
116330
116428
  const server = serve2({ fetch: app.fetch, port, hostname: "127.0.0.1" }, (info) => {
116331
- resolve78({
116429
+ resolve79({
116332
116430
  url: `http://localhost:${info.port}`,
116333
116431
  port: info.port,
116334
116432
  addPreHeadScript: (script) => {
@@ -118968,9 +119066,9 @@ var require_compress_binding = __commonJS({
118968
119066
  });
118969
119067
  } else {
118970
119068
  if (readAsync) {
118971
- return new Promise(function(resolve78, reject2) {
119069
+ return new Promise(function(resolve79, reject2) {
118972
119070
  readAsync(wasmBinaryFile, function(response) {
118973
- resolve78(new Uint8Array(response));
119071
+ resolve79(new Uint8Array(response));
118974
119072
  }, reject2);
118975
119073
  });
118976
119074
  }
@@ -120004,8 +120102,8 @@ var require_compress = __commonJS({
120004
120102
  "../../node_modules/.bun/wawoff2@2.0.1/node_modules/wawoff2/compress.js"(exports, module) {
120005
120103
  "use strict";
120006
120104
  var em_module = require_compress_binding();
120007
- var runtimeInit = new Promise((resolve78) => {
120008
- em_module.onRuntimeInitialized = resolve78;
120105
+ var runtimeInit = new Promise((resolve79) => {
120106
+ em_module.onRuntimeInitialized = resolve79;
120009
120107
  });
120010
120108
  module.exports = async function compress2(buffer) {
120011
120109
  await runtimeInit;
@@ -120524,9 +120622,9 @@ var require_decompress_binding = __commonJS({
120524
120622
  });
120525
120623
  } else {
120526
120624
  if (readAsync) {
120527
- return new Promise(function(resolve78, reject2) {
120625
+ return new Promise(function(resolve79, reject2) {
120528
120626
  readAsync(wasmBinaryFile, function(response) {
120529
- resolve78(new Uint8Array(response));
120627
+ resolve79(new Uint8Array(response));
120530
120628
  }, reject2);
120531
120629
  });
120532
120630
  }
@@ -121541,8 +121639,8 @@ var require_decompress = __commonJS({
121541
121639
  "../../node_modules/.bun/wawoff2@2.0.1/node_modules/wawoff2/decompress.js"(exports, module) {
121542
121640
  "use strict";
121543
121641
  var em_module = require_decompress_binding();
121544
- var runtimeInit = new Promise((resolve78) => {
121545
- em_module.onRuntimeInitialized = resolve78;
121642
+ var runtimeInit = new Promise((resolve79) => {
121643
+ em_module.onRuntimeInitialized = resolve79;
121546
121644
  });
121547
121645
  module.exports = async function decompress(buffer) {
121548
121646
  await runtimeInit;
@@ -122129,10 +122227,10 @@ function throwIfCallerAborted(signal) {
122129
122227
  async function waitForFontFetchRetry(delayMs, signal) {
122130
122228
  throwIfCallerAborted(signal);
122131
122229
  if (delayMs <= 0) return;
122132
- await new Promise((resolve78, reject2) => {
122230
+ await new Promise((resolve79, reject2) => {
122133
122231
  const timeout = setTimeout(() => {
122134
122232
  signal?.removeEventListener("abort", onAbort);
122135
- resolve78();
122233
+ resolve79();
122136
122234
  }, delayMs);
122137
122235
  const onAbort = () => {
122138
122236
  clearTimeout(timeout);
@@ -122855,10 +122953,10 @@ var init_semaphore = __esm({
122855
122953
  this.active++;
122856
122954
  return () => this.release();
122857
122955
  }
122858
- return new Promise((resolve78) => {
122956
+ return new Promise((resolve79) => {
122859
122957
  this.queue.push(() => {
122860
122958
  this.active++;
122861
- resolve78(() => this.release());
122959
+ resolve79(() => this.release());
122862
122960
  });
122863
122961
  });
122864
122962
  }
@@ -126887,7 +126985,7 @@ function resolveDeStallTimeoutMs() {
126887
126985
  return Number.isFinite(parsed) && parsed > 0 ? parsed : DEFAULT_DE_STALL_MS;
126888
126986
  }
126889
126987
  function raceAgainstStall(promise, deadlineMs, message, signal) {
126890
- return new Promise((resolve78, reject2) => {
126988
+ return new Promise((resolve79, reject2) => {
126891
126989
  const timer = setTimeout(
126892
126990
  () => {
126893
126991
  reject2(
@@ -126901,7 +126999,7 @@ function raceAgainstStall(promise, deadlineMs, message, signal) {
126901
126999
  promise.then(
126902
127000
  (value) => {
126903
127001
  clearTimeout(timer);
126904
- resolve78(value);
127002
+ resolve79(value);
126905
127003
  },
126906
127004
  (error) => {
126907
127005
  clearTimeout(timer);
@@ -127786,8 +127884,8 @@ async function createShaderTransitionWorkerPool(opts) {
127786
127884
  if (terminated) {
127787
127885
  throw new Error("shader-blend pool already terminated");
127788
127886
  }
127789
- return new Promise((resolve78, reject2) => {
127790
- const task = traceEnabled ? { req, resolve: resolve78, reject: reject2, enqueuedAtMs: Date.now(), traceId: ++nextTaskId } : { req, resolve: resolve78, reject: reject2 };
127887
+ return new Promise((resolve79, reject2) => {
127888
+ const task = traceEnabled ? { req, resolve: resolve79, reject: reject2, enqueuedAtMs: Date.now(), traceId: ++nextTaskId } : { req, resolve: resolve79, reject: reject2 };
127791
127889
  const idle = slots.find((s2) => !s2.busy && !s2.dead);
127792
127890
  if (idle) {
127793
127891
  queue.unshift(task);
@@ -131688,12 +131786,12 @@ async function startHealthWorker(options = {}) {
131688
131786
  stdout: false,
131689
131787
  stderr: false
131690
131788
  });
131691
- await new Promise((resolve78, reject2) => {
131789
+ await new Promise((resolve79, reject2) => {
131692
131790
  const onMessage = (msg) => {
131693
131791
  if (msg?.type === "listening") {
131694
131792
  worker.off("error", onError);
131695
131793
  worker.off("message", onMessage);
131696
- resolve78();
131794
+ resolve79();
131697
131795
  } else if (msg?.type === "listen-error") {
131698
131796
  worker.off("error", onError);
131699
131797
  worker.off("message", onMessage);
@@ -136065,12 +136163,12 @@ async function runPipeline(options, session, media, format, bgFormat, ffmpegPath
136065
136163
  const drains = [];
136066
136164
  if (!fgWroteFully) {
136067
136165
  drains.push(
136068
- new Promise((resolve78) => fg.proc.stdin.once("drain", () => resolve78()))
136166
+ new Promise((resolve79) => fg.proc.stdin.once("drain", () => resolve79()))
136069
136167
  );
136070
136168
  }
136071
136169
  if (!bgWroteFully && bg) {
136072
136170
  drains.push(
136073
- new Promise((resolve78) => bg.proc.stdin.once("drain", () => resolve78()))
136171
+ new Promise((resolve79) => bg.proc.stdin.once("drain", () => resolve79()))
136074
136172
  );
136075
136173
  }
136076
136174
  await Promise.all(drains);
@@ -136103,11 +136201,11 @@ ${decoder.getStderr().slice(-400)}`
136103
136201
  return processed;
136104
136202
  }
136105
136203
  function waitForExit(proc, label2, getStderr) {
136106
- return new Promise((resolve78, reject2) => {
136204
+ return new Promise((resolve79, reject2) => {
136107
136205
  proc.on("error", reject2);
136108
136206
  proc.on("exit", (code, signal) => {
136109
136207
  if (code === 0 && !signal) {
136110
- resolve78();
136208
+ resolve79();
136111
136209
  return;
136112
136210
  }
136113
136211
  const cause = signal ? `killed by ${signal}` : `exited with code ${code}`;
@@ -139380,6 +139478,10 @@ function variableValuesAttribute(values) {
139380
139478
  const json = JSON.stringify(values).replace(/'/g, "&#39;");
139381
139479
  return ` data-variable-values='${json}'`;
139382
139480
  }
139481
+ function primaryInstalledTarget(item) {
139482
+ const primary = item.files.find((f3) => f3.type === "hyperframes:snippet") ?? item.files.find((f3) => f3.type === "hyperframes:composition") ?? item.files[0];
139483
+ return primary?.target ?? "";
139484
+ }
139383
139485
  function buildSnippet(item, relativeTarget, values = null) {
139384
139486
  if (item.type === "hyperframes:block") {
139385
139487
  const dims = "dimensions" in item && item.dimensions ? ` data-width="${item.dimensions.width}" data-height="${item.dimensions.height}"` : "";
@@ -139499,9 +139601,16 @@ async function runAdd(opts) {
139499
139601
  requested: planItem.name === item.name
139500
139602
  });
139501
139603
  }
139604
+ recordProjectRegistryItems(
139605
+ projectDir,
139606
+ installPlan.map((planItem) => ({
139607
+ name: planItem.name,
139608
+ type: planItem.type,
139609
+ target: primaryInstalledTarget(planItem)
139610
+ }))
139611
+ );
139502
139612
  const itemForInstall = installPlan[installPlan.length - 1];
139503
- const primaryFile = itemForInstall.files.find((f3) => f3.type === "hyperframes:snippet") ?? itemForInstall.files.find((f3) => f3.type === "hyperframes:composition") ?? itemForInstall.files[0];
139504
- const snippetTargetRel = primaryFile?.target ?? "";
139613
+ const snippetTargetRel = primaryInstalledTarget(itemForInstall);
139505
139614
  const snippet = buildSnippet(item, snippetTargetRel, variableValues);
139506
139615
  const clipboardCopied = !opts.skipClipboard && snippet ? copyToClipboard(snippet) : false;
139507
139616
  for (const { id, reason } of variablesInvalid) {
@@ -141909,8 +142018,8 @@ async function startLoopback(opts) {
141909
142018
  const timeoutMs = opts.timeoutMs ?? DEFAULT_TIMEOUT_MS;
141910
142019
  let resolveResult;
141911
142020
  let rejectResult;
141912
- const result = new Promise((resolve78, reject2) => {
141913
- resolveResult = resolve78;
142021
+ const result = new Promise((resolve79, reject2) => {
142022
+ resolveResult = resolve79;
141914
142023
  rejectResult = reject2;
141915
142024
  });
141916
142025
  let redirectUri = "";
@@ -141926,7 +142035,7 @@ async function startLoopback(opts) {
141926
142035
  closed = true;
141927
142036
  clearTimeout(timer);
141928
142037
  server.closeAllConnections?.();
141929
- await new Promise((resolve78) => server.close(() => resolve78()));
142038
+ await new Promise((resolve79) => server.close(() => resolve79()));
141930
142039
  };
141931
142040
  const timer = setTimeout(() => {
141932
142041
  rejectResult(new Error(`OAuth callback timed out after ${timeoutMs}ms`));
@@ -141937,11 +142046,11 @@ async function startLoopback(opts) {
141937
142046
  return { result, redirectUri, close };
141938
142047
  }
141939
142048
  async function listen(server, port) {
141940
- await new Promise((resolve78, reject2) => {
142049
+ await new Promise((resolve79, reject2) => {
141941
142050
  server.once("error", reject2);
141942
142051
  server.listen(port, "127.0.0.1", () => {
141943
142052
  server.off("error", reject2);
141944
- resolve78();
142053
+ resolve79();
141945
142054
  });
141946
142055
  });
141947
142056
  }
@@ -142128,7 +142237,7 @@ async function startDeviceAuthorizationFlow(opts = {}) {
142128
142237
  const runtime = {
142129
142238
  clientId: resolveClientId(),
142130
142239
  fetchImpl: opts.fetchImpl ?? fetch,
142131
- sleepImpl: opts.sleepImpl ?? ((ms) => new Promise((resolve78) => setTimeout(resolve78, ms))),
142240
+ sleepImpl: opts.sleepImpl ?? ((ms) => new Promise((resolve79) => setTimeout(resolve79, ms))),
142132
142241
  now: opts.now ?? Date.now,
142133
142242
  requestTimeoutMs: opts.requestTimeoutMs ?? DEVICE_REQUEST_TIMEOUT_MS
142134
142243
  };
@@ -142822,7 +142931,7 @@ function isRequestTimeout(error) {
142822
142931
  return error instanceof DOMException && (error.name === "TimeoutError" || error.name === "AbortError");
142823
142932
  }
142824
142933
  function waitBeforePublishRetry() {
142825
- return new Promise((resolve78) => setTimeout(resolve78, PUBLISH_RETRY_DELAY_MS));
142934
+ return new Promise((resolve79) => setTimeout(resolve79, PUBLISH_RETRY_DELAY_MS));
142826
142935
  }
142827
142936
  async function fetchForPublish(input2, createInit, failureStage, attempts = 1) {
142828
142937
  if (attempts < 1) throw new RangeError("Publish fetch attempts must be at least 1");
@@ -143523,9 +143632,78 @@ var init_publish = __esm({
143523
143632
  }
143524
143633
  });
143525
143634
 
143635
+ // src/utils/catalogUsage.ts
143636
+ import { readFileSync as readFileSync54 } from "fs";
143637
+ import { isAbsolute as isAbsolute13, relative as relative20, resolve as resolve51 } from "path";
143638
+ function reachableCompositions(projectDir, entryPath) {
143639
+ const seen = /* @__PURE__ */ new Set();
143640
+ const queue = [resolve51(entryPath)];
143641
+ while (queue.length > 0 && seen.size < MAX_VISITED_FILES) {
143642
+ const current2 = queue.shift();
143643
+ if (seen.has(current2)) continue;
143644
+ seen.add(current2);
143645
+ let html;
143646
+ try {
143647
+ html = readFileSync54(current2, "utf-8");
143648
+ } catch {
143649
+ continue;
143650
+ }
143651
+ if (html.length > MAX_HTML_BYTES) continue;
143652
+ for (const src of collectSubCompositionSrcs(html)) {
143653
+ queue.push(resolve51(projectDir, src));
143654
+ }
143655
+ }
143656
+ return seen;
143657
+ }
143658
+ function isReached(projectDir, target, reachable) {
143659
+ if (isAbsolute13(target)) return false;
143660
+ const abs = resolve51(projectDir, target);
143661
+ if (relative20(projectDir, abs).startsWith("..")) return false;
143662
+ return reachable.has(abs);
143663
+ }
143664
+ function reportableNames(names) {
143665
+ return [...new Set(names.filter((name) => REGISTRY_ITEM_NAME.test(name)))].sort();
143666
+ }
143667
+ function summarizeCatalogUsage(projectDir, entryPath) {
143668
+ const { status, config } = readProjectConfigWithStatus(projectDir);
143669
+ if (status === "unreadable") return UNREADABLE;
143670
+ const items = config?.registryItems ?? [];
143671
+ if (items.length === 0) return EMPTY;
143672
+ const installed = reportableNames(items.map((item) => item.name));
143673
+ if (installed.length === 0) return EMPTY;
143674
+ const reachable = reachableCompositions(projectDir, entryPath);
143675
+ const usedBlocks = reportableNames(
143676
+ items.filter(
143677
+ (item) => item.type === "hyperframes:block" && isReached(projectDir, item.target, reachable)
143678
+ ).map((item) => item.name)
143679
+ );
143680
+ return { installed, usedBlocks, manifestUnreadable: false };
143681
+ }
143682
+ var EMPTY, UNREADABLE, MAX_VISITED_FILES, MAX_HTML_BYTES, REGISTRY_ITEM_NAME;
143683
+ var init_catalogUsage = __esm({
143684
+ "src/utils/catalogUsage.ts"() {
143685
+ "use strict";
143686
+ init_assetResolution();
143687
+ init_projectConfig();
143688
+ EMPTY = Object.freeze({
143689
+ installed: [],
143690
+ usedBlocks: [],
143691
+ manifestUnreadable: false
143692
+ });
143693
+ UNREADABLE = Object.freeze({
143694
+ installed: [],
143695
+ usedBlocks: [],
143696
+ manifestUnreadable: true
143697
+ });
143698
+ MAX_VISITED_FILES = 250;
143699
+ MAX_HTML_BYTES = 20 * 1024 * 1024;
143700
+ REGISTRY_ITEM_NAME = /^[a-z0-9][a-z0-9-]{0,63}$/;
143701
+ }
143702
+ });
143703
+
143526
143704
  // src/commands/render/plan.ts
143527
143705
  import { statSync as statSync28 } from "fs";
143528
- import { dirname as dirname39, join as join89, resolve as resolve51 } from "path";
143706
+ import { dirname as dirname39, join as join89, resolve as resolve52 } from "path";
143529
143707
  function formatFpsParseError(input2, reason) {
143530
143708
  switch (reason) {
143531
143709
  case "empty":
@@ -143558,7 +143736,7 @@ function createRenderPlan(args, now = /* @__PURE__ */ new Date()) {
143558
143736
  const hasExplicitComposition = hasExplicitCompositionArg(args.composition);
143559
143737
  const project = resolveProject(args.dir, { requireIndex: !hasExplicitComposition });
143560
143738
  const entryFile = resolveCompositionEntryArg(args.composition, project.dir, statSync28);
143561
- const renderTarget = entryFile ? resolve51(project.dir, entryFile) : project.indexPath;
143739
+ const renderTarget = entryFile ? resolve52(project.dir, entryFile) : project.indexPath;
143562
143740
  const fpsArg = resolveDefaultFpsArg(args.fps, project.dir, project.indexPath, entryFile);
143563
143741
  const fpsParse = parseFps(fpsArg ?? "30");
143564
143742
  if (!fpsParse.ok) {
@@ -143575,6 +143753,7 @@ function createRenderPlan(args, now = /* @__PURE__ */ new Date()) {
143575
143753
  const flagSkill = normalizeSkillSlug(args.skill);
143576
143754
  const authoringSkill = flagSkill ?? loadProjectConfig(project.dir).authoringSkill;
143577
143755
  const invalidAuthoringSkill = typeof args.skill === "string" && args.skill.trim() !== "" && !flagSkill ? args.skill : void 0;
143756
+ const catalogUsage = summarizeCatalogUsage(project.dir, renderTarget);
143578
143757
  const formatRaw = args.format ?? "mp4";
143579
143758
  const format = parseRenderFormat(formatRaw);
143580
143759
  if (!format) {
@@ -143654,7 +143833,7 @@ function createRenderPlan(args, now = /* @__PURE__ */ new Date()) {
143654
143833
  const raw = args["frames-cache-dir"].trim();
143655
143834
  const normalized2 = raw.toLowerCase();
143656
143835
  const isDisableAlias = EXTRACT_CACHE_DIR_DISABLED_ALIASES.includes(normalized2);
143657
- environment.HYPERFRAMES_EXTRACT_CACHE_DIR = isDisableAlias ? raw : resolve51(raw);
143836
+ environment.HYPERFRAMES_EXTRACT_CACHE_DIR = isDisableAlias ? raw : resolve52(raw);
143658
143837
  }
143659
143838
  if (args["max-concurrent-renders"] != null) {
143660
143839
  const parsed = positiveInteger(
@@ -143692,11 +143871,11 @@ function createRenderPlan(args, now = /* @__PURE__ */ new Date()) {
143692
143871
  "Invalid batch-concurrency",
143693
143872
  `Got "${args["batch-concurrency"]}". Must be a positive integer.`
143694
143873
  ) : 1;
143695
- const rendersDir = resolve51("renders");
143874
+ const rendersDir = resolve52("renders");
143696
143875
  const ext = FORMAT_EXT[format];
143697
143876
  const timestamp = formatRenderOutputTimestamp(now);
143698
143877
  const batchOutputTemplate = args.output ? args.output : join89(rendersDir, `${project.name}_${timestamp}_{index}${ext}`);
143699
- const outputPath = args.output ? resolve51(args.output) : join89(rendersDir, `${project.name}_${timestamp}${ext}`);
143878
+ const outputPath = args.output ? resolve52(args.output) : join89(rendersDir, `${project.name}_${timestamp}${ext}`);
143700
143879
  const useDocker = args.docker ?? false;
143701
143880
  const useGpu = args.gpu ?? false;
143702
143881
  const browserGpuMode = resolveBrowserGpuForCli(useDocker, args["browser-gpu"]);
@@ -143748,6 +143927,7 @@ function createRenderPlan(args, now = /* @__PURE__ */ new Date()) {
143748
143927
  quality,
143749
143928
  authoringSkill,
143750
143929
  invalidAuthoringSkill,
143930
+ catalogUsage,
143751
143931
  format,
143752
143932
  gifLoop,
143753
143933
  gifFpsCapped,
@@ -143811,6 +143991,7 @@ var init_plan2 = __esm({
143811
143991
  init_renderArgs();
143812
143992
  init_skill();
143813
143993
  init_projectConfig();
143994
+ init_catalogUsage();
143814
143995
  VALID_QUALITY = /* @__PURE__ */ new Set(["draft", "standard", "high"]);
143815
143996
  RENDER_FORMATS = ["mp4", "webm", "mov", "png-sequence", "gif"];
143816
143997
  VALID_FORMAT = new Set(RENDER_FORMATS);
@@ -143827,7 +144008,7 @@ var init_plan2 = __esm({
143827
144008
 
143828
144009
  // src/commands/render/present.ts
143829
144010
  import { cpus as cpus5 } from "os";
143830
- import { readFileSync as readFileSync54 } from "fs";
144011
+ import { readFileSync as readFileSync55 } from "fs";
143831
144012
  async function presentRenderPlan(plan2) {
143832
144013
  await presentRenderWarnings(plan2);
143833
144014
  if (plan2.effectiveQuiet || plan2.batchPath) return;
@@ -143870,7 +144051,7 @@ function presentRenderSummary(plan2) {
143870
144051
  async function warnForSlideshow(plan2) {
143871
144052
  try {
143872
144053
  const { slideshowIslandRegex: slideshowIslandRegex2 } = await Promise.resolve().then(() => (init_slideshow2(), slideshow_exports));
143873
- if (!slideshowIslandRegex2("i").test(readFileSync54(plan2.renderTarget, "utf8"))) return;
144054
+ if (!slideshowIslandRegex2("i").test(readFileSync55(plan2.renderTarget, "utf8"))) return;
143874
144055
  console.log(
143875
144056
  c.warn("\u26A0") + " This composition carries a slideshow island \u2014 `render` captures only the first scene, so the MP4 will be truncated to slide 1. Use " + c.accent("hyperframes present") + " for the deck; a linear main-line MP4 export is not yet available."
143876
144057
  );
@@ -143887,9 +144068,9 @@ var init_present2 = __esm({
143887
144068
  });
143888
144069
 
143889
144070
  // src/utils/variables.ts
143890
- import { readFileSync as readFileSync55 } from "fs";
143891
- import { resolve as resolve52 } from "path";
143892
- function parseVariablesArg(inline, filePath, readFile5 = (p2) => readFileSync55(resolve52(p2), "utf8")) {
144071
+ import { readFileSync as readFileSync56 } from "fs";
144072
+ import { resolve as resolve53 } from "path";
144073
+ function parseVariablesArg(inline, filePath, readFile5 = (p2) => readFileSync56(resolve53(p2), "utf8")) {
143893
144074
  if (inline != null && filePath != null) {
143894
144075
  return { ok: false, error: { kind: "conflict" } };
143895
144076
  }
@@ -143972,7 +144153,7 @@ function validateVariablesAgainstProject(indexPath2, values) {
143972
144153
  function loadProjectVariableSchema(indexPath2) {
143973
144154
  let html;
143974
144155
  try {
143975
- html = readFileSync55(indexPath2, "utf8");
144156
+ html = readFileSync56(indexPath2, "utf8");
143976
144157
  } catch {
143977
144158
  return [];
143978
144159
  }
@@ -144027,8 +144208,8 @@ __export(batchRender_exports, {
144027
144208
  resolveOutputTemplate: () => resolveOutputTemplate,
144028
144209
  runBatchRender: () => runBatchRender
144029
144210
  });
144030
- import { mkdirSync as mkdirSync43, readFileSync as readFileSync56, writeFileSync as writeFileSync31 } from "fs";
144031
- import { dirname as dirname40, join as join90, resolve as resolve53, sep as sep12 } from "path";
144211
+ import { mkdirSync as mkdirSync43, readFileSync as readFileSync57, writeFileSync as writeFileSync31 } from "fs";
144212
+ import { dirname as dirname40, join as join90, resolve as resolve54, sep as sep12 } from "path";
144032
144213
  function isRecord10(value) {
144033
144214
  return value !== null && typeof value === "object" && !Array.isArray(value);
144034
144215
  }
@@ -144089,7 +144270,7 @@ function isSameOrChildPath(path2, parent) {
144089
144270
  }
144090
144271
  function commonOutputDirectory(outputPaths) {
144091
144272
  const firstPath = outputPaths[0];
144092
- if (!firstPath) return resolve53("renders");
144273
+ if (!firstPath) return resolve54("renders");
144093
144274
  let common = dirname40(firstPath);
144094
144275
  for (const outputPath of outputPaths.slice(1)) {
144095
144276
  const dir = dirname40(outputPath);
@@ -144152,8 +144333,8 @@ function reportBatchVariableIssues(row, index, schema, quiet, json) {
144152
144333
  return issues.length;
144153
144334
  }
144154
144335
  function prepareBatchRender(options) {
144155
- const batchPath = resolve53(options.batchPath);
144156
- const read = options.readFile ?? ((path2) => readFileSync56(path2, "utf8"));
144336
+ const batchPath = resolve54(options.batchPath);
144337
+ const read = options.readFile ?? ((path2) => readFileSync57(path2, "utf8"));
144157
144338
  let raw;
144158
144339
  try {
144159
144340
  raw = read(batchPath);
@@ -144167,7 +144348,7 @@ function prepareBatchRender(options) {
144167
144348
  const rows = variableRows.map((variables, index) => ({
144168
144349
  index,
144169
144350
  variables,
144170
- outputPath: resolve53(resolveOutputTemplate(options.outputTemplate, variables, index))
144351
+ outputPath: resolve54(resolveOutputTemplate(options.outputTemplate, variables, index))
144171
144352
  }));
144172
144353
  const manifestPath2 = join90(
144173
144354
  commonOutputDirectory(rows.map((row) => row.outputPath)),
@@ -144349,7 +144530,7 @@ var init_batchRender = __esm({
144349
144530
  });
144350
144531
 
144351
144532
  // src/commands/render/execute.ts
144352
- import { mkdirSync as mkdirSync44, readFileSync as readFileSync57 } from "fs";
144533
+ import { mkdirSync as mkdirSync44, readFileSync as readFileSync58 } from "fs";
144353
144534
  function renderLintContinuationHint(strictErrors) {
144354
144535
  return strictErrors ? " Continuing render despite lint warnings. Use --strict-all to block warnings." : " Continuing render despite lint issues. Use --strict to block errors.";
144355
144536
  }
@@ -144392,6 +144573,7 @@ async function executeRenderPlan(plan2, dependencies) {
144392
144573
  fps: plan2.fps,
144393
144574
  quality: plan2.quality,
144394
144575
  authoringSkill: plan2.authoringSkill,
144576
+ catalogUsage: plan2.catalogUsage,
144395
144577
  format: plan2.format,
144396
144578
  gifLoop: plan2.gifLoop,
144397
144579
  workers: plan2.workers,
@@ -144492,7 +144674,7 @@ async function runResolutionPreflight(plan2, checkResolution) {
144492
144674
  if (!plan2.outputResolution) return;
144493
144675
  let issue;
144494
144676
  try {
144495
- issue = await checkResolution(readFileSync57(plan2.renderTarget, "utf8"), plan2.outputResolution, {
144677
+ issue = await checkResolution(readFileSync58(plan2.renderTarget, "utf8"), plan2.outputResolution, {
144496
144678
  alphaRequested: plan2.format === "webm" || plan2.format === "mov" || plan2.format === "png-sequence",
144497
144679
  hdrRequested: plan2.hdrMode === "force-hdr",
144498
144680
  aspectAgnostic: plan2.outputResolutionAspectAgnostic
@@ -144510,6 +144692,7 @@ async function executeBatchRender(plan2, browserPath, batchModule, preparedBatch
144510
144692
  fps: plan2.fps,
144511
144693
  quality: plan2.quality,
144512
144694
  authoringSkill: plan2.authoringSkill,
144695
+ catalogUsage: plan2.catalogUsage,
144513
144696
  format: plan2.format,
144514
144697
  workers: plan2.workers,
144515
144698
  gpu: plan2.useGpu,
@@ -144789,18 +144972,18 @@ async function getDoctorSummary() {
144789
144972
  }
144790
144973
  }
144791
144974
  function askQuestion(prompt) {
144792
- return new Promise((resolve78) => {
144975
+ return new Promise((resolve79) => {
144793
144976
  const rl = readline.createInterface({
144794
144977
  input: process.stdin,
144795
144978
  output: process.stdout
144796
144979
  });
144797
144980
  rl.question(prompt, (answer) => {
144798
144981
  rl.close();
144799
- resolve78(answer);
144982
+ resolve79(answer);
144800
144983
  });
144801
144984
  const timeout = setTimeout(() => {
144802
144985
  rl.close();
144803
- resolve78("");
144986
+ resolve79("");
144804
144987
  }, 1e4);
144805
144988
  if (typeof timeout === "object" && timeout !== null && "unref" in timeout) {
144806
144989
  timeout.unref();
@@ -144962,9 +145145,9 @@ __export(render_exports, {
144962
145145
  resolveBrowserGpuForCli: () => resolveBrowserGpuForCli,
144963
145146
  runRenderLint: () => runRenderLint
144964
145147
  });
144965
- import { mkdtempSync as mkdtempSync13, readdirSync as readdirSync29, readFileSync as readFileSync58, statSync as statSync29, writeFileSync as writeFileSync33, rmSync as rmSync28 } from "fs";
145148
+ import { mkdtempSync as mkdtempSync13, readdirSync as readdirSync29, readFileSync as readFileSync59, statSync as statSync29, writeFileSync as writeFileSync33, rmSync as rmSync28 } from "fs";
144966
145149
  import { freemem as freemem5, tmpdir as tmpdir13 } from "os";
144967
- import { resolve as resolve54, dirname as dirname41, join as join91, basename as basename16 } from "path";
145150
+ import { resolve as resolve55, dirname as dirname41, join as join91, basename as basename16 } from "path";
144968
145151
  import { execFileSync as execFileSync12, spawn as spawn15 } from "child_process";
144969
145152
  async function readCompositionDimensions(compositionHtml) {
144970
145153
  try {
@@ -144998,8 +145181,8 @@ function dockerImageTag(version2) {
144998
145181
  return `${DOCKER_IMAGE_PREFIX}:${version2}`;
144999
145182
  }
145000
145183
  function resolveDockerfilePath() {
145001
- const builtPath = resolve54(__dirname, "docker", "Dockerfile.render");
145002
- const devPath = resolve54(__dirname, "..", "src", "docker", "Dockerfile.render");
145184
+ const builtPath = resolve55(__dirname, "docker", "Dockerfile.render");
145185
+ const devPath = resolve55(__dirname, "..", "src", "docker", "Dockerfile.render");
145003
145186
  for (const p2 of [builtPath, devPath]) {
145004
145187
  try {
145005
145188
  statSync29(p2);
@@ -145031,7 +145214,7 @@ function ensureDockerImage(version2, platform11, quiet) {
145031
145214
  if (!quiet) console.log(c.dim(` Building Docker image: ${tag} (${platform11})...`));
145032
145215
  const dockerfilePath = resolveDockerfilePath();
145033
145216
  const tmpDir = mkdtempSync13(join91(tmpdir13(), "hyperframes-docker-"));
145034
- writeFileSync33(join91(tmpDir, "Dockerfile"), readFileSync58(dockerfilePath));
145217
+ writeFileSync33(join91(tmpDir, "Dockerfile"), readFileSync59(dockerfilePath));
145035
145218
  const targetArch = platform11 === "linux/arm64" ? "arm64" : "amd64";
145036
145219
  try {
145037
145220
  execFileSync12(
@@ -145102,8 +145285,8 @@ async function renderDocker(projectDir, outputPath, options) {
145102
145285
  const outputFilename = basename16(outputPath);
145103
145286
  const dockerArgs = buildDockerRunArgs({
145104
145287
  imageTag,
145105
- projectDir: resolve54(projectDir),
145106
- outputDir: resolve54(outputDir),
145288
+ projectDir: resolve55(projectDir),
145289
+ outputDir: resolve55(outputDir),
145107
145290
  outputFilename,
145108
145291
  platform: platform11,
145109
145292
  options: {
@@ -145163,6 +145346,7 @@ async function renderDocker(projectDir, outputPath, options) {
145163
145346
  docker: true,
145164
145347
  gpu: options.gpu,
145165
145348
  authoringSkill: options.authoringSkill,
145349
+ catalogUsage: options.catalogUsage,
145166
145350
  ...getMemorySnapshot()
145167
145351
  })
145168
145352
  );
@@ -145588,6 +145772,7 @@ function trackRenderMetrics(job, elapsedMs, options, docker) {
145588
145772
  docker,
145589
145773
  gpu: options.gpu,
145590
145774
  authoringSkill: options.authoringSkill,
145775
+ catalogUsage: options.catalogUsage,
145591
145776
  staticDedupEnabled: perf?.staticDedup?.enabled,
145592
145777
  staticDedupArmed: perf?.staticDedup?.armed,
145593
145778
  staticDedupSkipReason: perf?.staticDedup?.skipReason,
@@ -145968,7 +146153,7 @@ var init_render = __esm({
145968
146153
 
145969
146154
  // src/telemetry/lintStreaks.ts
145970
146155
  import { createHash as createHash23 } from "crypto";
145971
- import { mkdirSync as mkdirSync45, readFileSync as readFileSync59, writeFileSync as writeFileSync34 } from "fs";
146156
+ import { mkdirSync as mkdirSync45, readFileSync as readFileSync60, writeFileSync as writeFileSync34 } from "fs";
145972
146157
  import { homedir as homedir19 } from "os";
145973
146158
  import { join as join93 } from "path";
145974
146159
  function emptyState() {
@@ -145976,7 +146161,7 @@ function emptyState() {
145976
146161
  }
145977
146162
  function readState() {
145978
146163
  try {
145979
- const parsed = JSON.parse(readFileSync59(STATE_FILE2, "utf-8"));
146164
+ const parsed = JSON.parse(readFileSync60(STATE_FILE2, "utf-8"));
145980
146165
  if (typeof parsed === "object" && parsed !== null && parsed.version === 1 && typeof parsed.files === "object") {
145981
146166
  return parsed;
145982
146167
  }
@@ -146244,7 +146429,7 @@ __export(staticProjectServer_exports, {
146244
146429
  });
146245
146430
  import { createServer as createServer2 } from "http";
146246
146431
  import { createReadStream as createReadStream7, existsSync as existsSync85, statSync as statSync30 } from "fs";
146247
- import { isAbsolute as isAbsolute13, relative as relative20, resolve as resolve55 } from "path";
146432
+ import { isAbsolute as isAbsolute14, relative as relative21, resolve as resolve56 } from "path";
146248
146433
  function serveFileWithRange(filePath, rangeHeader, res, contentType = getMimeType(filePath)) {
146249
146434
  const size = statSync30(filePath).size;
146250
146435
  const headers = {
@@ -146344,9 +146529,9 @@ async function serveStaticProjectHtml(projectDir, html, bindErrorMessage = "Fail
146344
146529
  const proxyRequest = proxyParam !== null && isProxyVariantRequest(proxyParam) ? proxyParam : null;
146345
146530
  const requestPath = decodeURIComponent(pathOnly).replace(/^\//, "");
146346
146531
  for (const root of roots) {
146347
- const filePath = resolve55(root, requestPath);
146348
- const rel = relative20(root, filePath);
146349
- if (rel.startsWith("..") || isAbsolute13(rel)) continue;
146532
+ const filePath = resolve56(root, requestPath);
146533
+ const rel = relative21(root, filePath);
146534
+ if (rel.startsWith("..") || isAbsolute14(rel)) continue;
146350
146535
  if (existsSync85(filePath)) {
146351
146536
  if (proxyRequest) {
146352
146537
  void serveProxyRequest(
@@ -146811,7 +146996,7 @@ var init_motionAudit = __esm({
146811
146996
  });
146812
146997
 
146813
146998
  // src/utils/motionSpec.ts
146814
- import { existsSync as existsSync86, readFileSync as readFileSync60, readdirSync as readdirSync30 } from "fs";
146999
+ import { existsSync as existsSync86, readFileSync as readFileSync61, readdirSync as readdirSync30 } from "fs";
146815
147000
  import { basename as basename17, join as join94 } from "path";
146816
147001
  function isObject2(value) {
146817
147002
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -146873,7 +147058,7 @@ function findMotionSpec(projectDir) {
146873
147058
  function readMotionSpec(path2) {
146874
147059
  let raw;
146875
147060
  try {
146876
- raw = JSON.parse(readFileSync60(path2, "utf-8"));
147061
+ raw = JSON.parse(readFileSync61(path2, "utf-8"));
146877
147062
  } catch (err) {
146878
147063
  return { ok: false, errors: [`could not read ${basename17(path2)}: ${err.message}`] };
146879
147064
  }
@@ -146926,7 +147111,7 @@ __export(layout_exports, {
146926
147111
  loadBrowserScript: () => loadBrowserScript,
146927
147112
  parseAt: () => parseAt
146928
147113
  });
146929
- import { existsSync as existsSync87, readFileSync as readFileSync61 } from "fs";
147114
+ import { existsSync as existsSync87, readFileSync as readFileSync63 } from "fs";
146930
147115
  import { dirname as dirname42, join as join95 } from "path";
146931
147116
  import { fileURLToPath as fileURLToPath11 } from "url";
146932
147117
  function buildMotionSampleTimes(duration) {
@@ -147087,7 +147272,7 @@ async function runLayoutAudit(projectDir, opts) {
147087
147272
  function loadBrowserScript(name) {
147088
147273
  const candidates = [join95(__dirname2, name), join95(__dirname2, "commands", name)];
147089
147274
  for (const candidate of candidates) {
147090
- if (existsSync87(candidate)) return readFileSync61(candidate, "utf-8");
147275
+ if (existsSync87(candidate)) return readFileSync63(candidate, "utf-8");
147091
147276
  }
147092
147277
  throw new Error(`Missing browser script ${name}`);
147093
147278
  }
@@ -147484,7 +147669,7 @@ __export(validate_exports, {
147484
147669
  resolveNavigationTimeoutMs: () => resolveNavigationTimeoutMs,
147485
147670
  shouldIgnoreRequestFailure: () => shouldIgnoreRequestFailure
147486
147671
  });
147487
- import { existsSync as existsSync88, mkdtempSync as mkdtempSync14, readFileSync as readFileSync63, rmSync as rmSync29 } from "fs";
147672
+ import { existsSync as existsSync88, mkdtempSync as mkdtempSync14, readFileSync as readFileSync64, rmSync as rmSync29 } from "fs";
147488
147673
  import { tmpdir as tmpdir14 } from "os";
147489
147674
  import { join as join96, dirname as dirname43 } from "path";
147490
147675
  import { fileURLToPath as fileURLToPath12 } from "url";
@@ -147516,12 +147701,12 @@ async function getCompositionDuration3(page) {
147516
147701
  }
147517
147702
  function raceMediaReady(el, deadlineMs) {
147518
147703
  if (Number.isFinite(el.duration) && el.duration > 0) return Promise.resolve();
147519
- return new Promise((resolve78) => {
147704
+ return new Promise((resolve79) => {
147520
147705
  const onReady = () => {
147521
147706
  el.removeEventListener("loadedmetadata", onReady);
147522
147707
  el.removeEventListener("error", onReady);
147523
147708
  clearTimeout(timer);
147524
- resolve78();
147709
+ resolve79();
147525
147710
  };
147526
147711
  el.addEventListener("loadedmetadata", onReady, { once: true });
147527
147712
  el.addEventListener("error", onReady, { once: true });
@@ -147537,7 +147722,7 @@ async function auditClipDurations(page, analyzeClipMediaFit2, extraWaitMs) {
147537
147722
  await Promise.all(
147538
147723
  nodes.map((el) => {
147539
147724
  if (Number.isFinite(el.duration) && el.duration > 0) return Promise.resolve();
147540
- return new Promise((resolve78) => {
147725
+ return new Promise((resolve79) => {
147541
147726
  const cleanup = () => {
147542
147727
  el.removeEventListener("loadedmetadata", onReady);
147543
147728
  el.removeEventListener("error", onReady);
@@ -147545,7 +147730,7 @@ async function auditClipDurations(page, analyzeClipMediaFit2, extraWaitMs) {
147545
147730
  };
147546
147731
  const onReady = () => {
147547
147732
  cleanup();
147548
- resolve78();
147733
+ resolve79();
147549
147734
  };
147550
147735
  el.addEventListener("loadedmetadata", onReady, { once: true });
147551
147736
  el.addEventListener("error", onReady, { once: true });
@@ -147639,7 +147824,7 @@ function loadContrastAuditScript() {
147639
147824
  join96(__dirname3, "commands", "contrast-audit.browser.js")
147640
147825
  ];
147641
147826
  for (const candidate of candidates) {
147642
- if (existsSync88(candidate)) return readFileSync63(candidate, "utf-8");
147827
+ if (existsSync88(candidate)) return readFileSync64(candidate, "utf-8");
147643
147828
  }
147644
147829
  throw new Error("Missing contrast audit browser script");
147645
147830
  }
@@ -147970,7 +148155,7 @@ __export(checkBrowser_exports, {
147970
148155
  runBrowserCheck: () => runBrowserCheck
147971
148156
  });
147972
148157
  import { mkdirSync as mkdirSync46, writeFileSync as writeFileSync35 } from "fs";
147973
- import { join as join97, resolve as resolve56 } from "path";
148158
+ import { join as join97, resolve as resolve57 } from "path";
147974
148159
  async function preResolveHostileMediaProxies(projectDir, html, autoProxyOverride) {
147975
148160
  if (!resolveAutoProxy(projectDir, autoProxyOverride)) return;
147976
148161
  let codecMap;
@@ -147991,7 +148176,7 @@ async function preResolveHostileMediaProxies(projectDir, html, autoProxyOverride
147991
148176
  hostileEntries.map(
147992
148177
  ([pathname, facts]) => resolveProxy(
147993
148178
  projectDir,
147994
- resolve56(projectDir, pathname.replace(/^\/+/, "")),
148179
+ resolve57(projectDir, pathname.replace(/^\/+/, "")),
147995
148180
  proxyVariantFor(facts)
147996
148181
  )
147997
148182
  )
@@ -148888,7 +149073,7 @@ var init_checkBrowser = __esm({
148888
149073
 
148889
149074
  // src/utils/checkPipeline.ts
148890
149075
  import { mkdirSync as mkdirSync47, writeFileSync as writeFileSync36 } from "fs";
148891
- import { join as join98, relative as relative21 } from "path";
149076
+ import { join as join98, relative as relative23 } from "path";
148892
149077
  function selectContrastTimes(grid) {
148893
149078
  if (grid.length <= 5) return [...grid];
148894
149079
  return Array.from({ length: 5 }, (_, index) => {
@@ -149535,7 +149720,7 @@ async function runCheckPipeline(project, options, dependencies = DEFAULT_DEPENDE
149535
149720
  "motion_spec_invalid",
149536
149721
  "error",
149537
149722
  motion.message,
149538
- relative21(project.dir, motion.path) || "index.motion.json"
149723
+ relative23(project.dir, motion.path) || "index.motion.json"
149539
149724
  );
149540
149725
  return buildReport(options, lint, emptyBrowserResult(), motion, [finding], []);
149541
149726
  }
@@ -150440,7 +150625,7 @@ var init_beats = __esm({
150440
150625
  });
150441
150626
 
150442
150627
  // src/beats/headlessAnalyzer.ts
150443
- import { existsSync as existsSync89, readFileSync as readFileSync64 } from "fs";
150628
+ import { existsSync as existsSync89, readFileSync as readFileSync65 } from "fs";
150444
150629
  import { createRequire as createRequire4 } from "module";
150445
150630
  import { dirname as dirname44, join as join99 } from "path";
150446
150631
  import { fileURLToPath as fileURLToPath13 } from "url";
@@ -150483,7 +150668,7 @@ function buildAnalyzerBundle() {
150483
150668
  if (bundlePromise) return bundlePromise;
150484
150669
  bundlePromise = (async () => {
150485
150670
  const prebuilt = findPrebuiltBundle();
150486
- if (prebuilt) return readFileSync64(prebuilt, "utf8");
150671
+ if (prebuilt) return readFileSync65(prebuilt, "utf8");
150487
150672
  return buildFromCoreSource();
150488
150673
  })().catch((err) => {
150489
150674
  bundlePromise = null;
@@ -150561,14 +150746,14 @@ __export(beats_exports, {
150561
150746
  default: () => beats_default,
150562
150747
  examples: () => examples13
150563
150748
  });
150564
- import { existsSync as existsSync90, readFileSync as readFileSync65, mkdirSync as mkdirSync48, writeFileSync as writeFileSync37 } from "fs";
150565
- import { resolve as resolve57, join as join100, dirname as dirname45 } from "path";
150749
+ import { existsSync as existsSync90, readFileSync as readFileSync66, mkdirSync as mkdirSync48, writeFileSync as writeFileSync37 } from "fs";
150750
+ import { resolve as resolve58, join as join100, dirname as dirname45 } from "path";
150566
150751
  function fail(message) {
150567
150752
  console.error(c.error(message));
150568
150753
  failCommand();
150569
150754
  }
150570
150755
  function resolveMusicTarget(project) {
150571
- const src = findMusicAudioSrc(readFileSync65(project.indexPath, "utf-8"));
150756
+ const src = findMusicAudioSrc(readFileSync66(project.indexPath, "utf-8"));
150572
150757
  if (!src) {
150573
150758
  fail(
150574
150759
  'No music track found. Add data-timeline-role="music" to the <audio> element (or give it an id like music/bgm/soundtrack).'
@@ -150576,13 +150761,13 @@ function resolveMusicTarget(project) {
150576
150761
  }
150577
150762
  const rel = audioRelPathForSrc(src);
150578
150763
  if (!rel) fail(`Cannot derive a beat-file path for music src: ${src}`);
150579
- const audioPath = resolve57(project.dir, rel);
150764
+ const audioPath = resolve58(project.dir, rel);
150580
150765
  if (!existsSync90(audioPath)) fail(`Audio file not found: ${rel}`);
150581
150766
  return { rel, audioPath };
150582
150767
  }
150583
150768
  async function detect(audioPath) {
150584
150769
  try {
150585
- return await analyzeBeatsHeadless(readFileSync65(audioPath));
150770
+ return await analyzeBeatsHeadless(readFileSync66(audioPath));
150586
150771
  } catch (err) {
150587
150772
  const msg = err instanceof Error ? err.message : String(err);
150588
150773
  const hint2 = /chrome|executable|browser|ENOENT/i.test(msg) ? "\nRun: npx hyperframes browser ensure" : "";
@@ -150655,8 +150840,8 @@ __export(normalize_audio_exports, {
150655
150840
  updateAudioVolume: () => updateAudioVolume
150656
150841
  });
150657
150842
  import { execFile as execFile8 } from "child_process";
150658
- import { existsSync as existsSync91, readFileSync as readFileSync66, renameSync as renameSync15, writeFileSync as writeFileSync38 } from "fs";
150659
- import { isAbsolute as isAbsolute14, relative as relative23, resolve as resolve58 } from "path";
150843
+ import { existsSync as existsSync91, readFileSync as readFileSync67, renameSync as renameSync15, writeFileSync as writeFileSync38 } from "fs";
150844
+ import { isAbsolute as isAbsolute15, relative as relative24, resolve as resolve59 } from "path";
150660
150845
  import { promisify as promisify6 } from "util";
150661
150846
  function authoredNumber(raw, fallback, attribute2, id, strictlyPositive = false) {
150662
150847
  if (raw === void 0) return fallback;
@@ -150819,12 +151004,12 @@ function resolveLocalAudioPath(projectDir, src) {
150819
151004
  } catch {
150820
151005
  throw new Error(`Audio source must be a local project file: ${src}`);
150821
151006
  }
150822
- if (!decoded || isAbsolute14(decoded) || /^(?:[a-z][a-z\d+.-]*:|\/\/)/i.test(decoded)) {
151007
+ if (!decoded || isAbsolute15(decoded) || /^(?:[a-z][a-z\d+.-]*:|\/\/)/i.test(decoded)) {
150823
151008
  throw new Error(`Audio source must be a local project file: ${src}`);
150824
151009
  }
150825
- const root = resolve58(projectDir);
150826
- const file = resolve58(root, decoded);
150827
- const rel = relative23(root, file);
151010
+ const root = resolve59(projectDir);
151011
+ const file = resolve59(root, decoded);
151012
+ const rel = relative24(root, file);
150828
151013
  if (!rel || rel === ".." || rel.startsWith(`..${process.platform === "win32" ? "\\" : "/"}`)) {
150829
151014
  throw new Error(`Audio source must be a local project file: ${src}`);
150830
151015
  }
@@ -150941,7 +151126,7 @@ function requiredFfmpeg() {
150941
151126
  function existingAudioFile(projectDir, tag) {
150942
151127
  const file = resolveLocalAudioPath(projectDir, tag.src);
150943
151128
  if (!existsSync91(file)) {
150944
- throw new Error(`Audio #${tag.id} file was not found: ${relative23(projectDir, file)}`);
151129
+ throw new Error(`Audio #${tag.id} file was not found: ${relative24(projectDir, file)}`);
150945
151130
  }
150946
151131
  return file;
150947
151132
  }
@@ -150972,7 +151157,7 @@ function parsedTolerance(raw) {
150972
151157
  }
150973
151158
  async function normalizeAudio(options) {
150974
151159
  const project = resolveProject(options.dir);
150975
- const html = readFileSync66(project.indexPath, "utf8");
151160
+ const html = readFileSync67(project.indexPath, "utf8");
150976
151161
  const { referenceTag, targetTag } = selectedTags(html, options.reference, options.target);
150977
151162
  const tolerance = parsedTolerance(options.tolerance);
150978
151163
  const plan2 = await measuredPlan(project.dir, referenceTag, targetTag);
@@ -150981,7 +151166,7 @@ async function normalizeAudio(options) {
150981
151166
  if (wrote) {
150982
151167
  writeAtomically(
150983
151168
  project.indexPath,
150984
- updateAudioVolume(readFileSync66(project.indexPath, "utf8"), targetTag.id, plan2.volume)
151169
+ updateAudioVolume(readFileSync67(project.indexPath, "utf8"), targetTag.id, plan2.volume)
150985
151170
  );
150986
151171
  }
150987
151172
  return { ok: true, wrote, withinTolerance, tolerance, indexPath: project.indexPath, ...plan2 };
@@ -151000,7 +151185,7 @@ function printHumanResult(result) {
151000
151185
  `Set #${result.targetId} data-volume ${result.previousVolume.toFixed(3)} \u2192 ${result.volume.toFixed(6)} (${result.changeDb >= 0 ? "+" : ""}${result.changeDb.toFixed(1)} dB).`
151001
151186
  );
151002
151187
  console.log(
151003
- result.wrote ? c.success(`Updated ${relative23(process.cwd(), result.indexPath) || "index.html"}.`) : c.dim("Dry run only. Pass --write to persist this gain.")
151188
+ result.wrote ? c.success(`Updated ${relative24(process.cwd(), result.indexPath) || "index.html"}.`) : c.dim("Dry run only. Pass --write to persist this gain.")
151004
151189
  );
151005
151190
  }
151006
151191
  var execFileAsync4, FFMPEG_TIMEOUT_MS, DEFAULT_TOLERANCE_LU, examples14, normalize_audio_default;
@@ -151481,14 +151666,14 @@ function inlineHelper3(call, ctx) {
151481
151666
  };
151482
151667
  return expandBody3(fn.body.body, bindings, prov, ctx);
151483
151668
  }
151484
- function assignStep3(update2, resolve78) {
151485
- if (update2.operator === "+=") return asNum3(resolve78(update2.right));
151669
+ function assignStep3(update2, resolve79) {
151670
+ if (update2.operator === "+=") return asNum3(resolve79(update2.right));
151486
151671
  if (update2.operator === "-=") {
151487
- const s2 = asNum3(resolve78(update2.right));
151672
+ const s2 = asNum3(resolve79(update2.right));
151488
151673
  return s2 === void 0 ? void 0 : -s2;
151489
151674
  }
151490
151675
  if (update2.operator === "=" && update2.right?.type === "BinaryExpression") {
151491
- return asNum3(resolve78(update2.right.right));
151676
+ return asNum3(resolve79(update2.right.right));
151492
151677
  }
151493
151678
  return void 0;
151494
151679
  }
@@ -151497,10 +151682,10 @@ function updatedVarName3(update2) {
151497
151682
  if (update2?.type === "AssignmentExpression") return update2.left?.name ?? null;
151498
151683
  return null;
151499
151684
  }
151500
- function loopStep3(update2, varName, resolve78) {
151685
+ function loopStep3(update2, varName, resolve79) {
151501
151686
  if (updatedVarName3(update2) !== varName) return void 0;
151502
151687
  if (update2.type === "UpdateExpression") return update2.operator === "++" ? 1 : -1;
151503
- return assignStep3(update2, resolve78);
151688
+ return assignStep3(update2, resolve79);
151504
151689
  }
151505
151690
  function asNum3(v2) {
151506
151691
  return typeof v2 === "number" && Number.isFinite(v2) ? v2 : void 0;
@@ -151517,13 +151702,13 @@ function forInitVar3(init) {
151517
151702
  const d2 = init.declarations[0];
151518
151703
  return d2.id?.type === "Identifier" ? { name: d2.id.name, initExpr: d2.init } : null;
151519
151704
  }
151520
- function parseForHeader3(stmt, resolve78) {
151705
+ function parseForHeader3(stmt, resolve79) {
151521
151706
  const iv = forInitVar3(stmt.init);
151522
151707
  const test = stmt.test;
151523
151708
  if (!iv || test?.type !== "BinaryExpression" || test.left?.name !== iv.name) return null;
151524
- const start = asNum3(resolve78(iv.initExpr));
151525
- const end = asNum3(resolve78(test.right));
151526
- const step = loopStep3(stmt.update, iv.name, resolve78);
151709
+ const start = asNum3(resolve79(iv.initExpr));
151710
+ const end = asNum3(resolve79(test.right));
151711
+ const step = loopStep3(stmt.update, iv.name, resolve79);
151527
151712
  if (start === void 0 || end === void 0 || !step) return null;
151528
151713
  return { v: iv.name, start, end, op: test.operator, step };
151529
151714
  }
@@ -151635,12 +151820,12 @@ function expandStatements3(stmts, ctx) {
151635
151820
  }
151636
151821
  return out;
151637
151822
  }
151638
- function inlineComputedTimelines3(ast, timelineVar, resolve78) {
151823
+ function inlineComputedTimelines3(ast, timelineVar, resolve79) {
151639
151824
  const helpers = collectInlinableHelpers3(ast, timelineVar);
151640
151825
  const ctx = {
151641
151826
  helpers,
151642
151827
  timelineVar,
151643
- resolve: resolve78,
151828
+ resolve: resolve79,
151644
151829
  depth: 0,
151645
151830
  site: { n: 0 },
151646
151831
  order: { n: 0 }
@@ -153051,13 +153236,13 @@ function applyOrbitCamera(selectors, cam) {
153051
153236
  lens.style.perspectiveOrigin = "50% 50%";
153052
153237
  }
153053
153238
  function compositeGhostFrames(frames, alphas, W2, H3, label2) {
153054
- return new Promise((resolve78) => {
153239
+ return new Promise((resolve79) => {
153055
153240
  const cv = document.createElement("canvas");
153056
153241
  cv.width = W2;
153057
153242
  cv.height = H3;
153058
153243
  const ctx = cv.getContext("2d");
153059
153244
  if (!ctx) {
153060
- resolve78("");
153245
+ resolve79("");
153061
153246
  return;
153062
153247
  }
153063
153248
  ctx.fillStyle = "#000";
@@ -153069,7 +153254,7 @@ function compositeGhostFrames(frames, alphas, W2, H3, label2) {
153069
153254
  ctx.font = "600 22px ui-monospace, SFMono-Regular, Menlo, monospace";
153070
153255
  ctx.fillStyle = "#86c2ff";
153071
153256
  ctx.fillText(label2, 24, 38);
153072
- resolve78(cv.toDataURL("image/png"));
153257
+ resolve79(cv.toDataURL("image/png"));
153073
153258
  return;
153074
153259
  }
153075
153260
  const img = new Image();
@@ -153492,8 +153677,8 @@ __export(keyframes_exports, {
153492
153677
  resolveScope: () => resolveScope,
153493
153678
  surfaceComposition: () => surfaceComposition
153494
153679
  });
153495
- import { existsSync as existsSync93, readFileSync as readFileSync67, statSync as statSync31 } from "fs";
153496
- import { resolve as resolve59, dirname as dirname47, basename as basename18, join as join101, relative as relative24, sep as sep13 } from "path";
153680
+ import { existsSync as existsSync93, readFileSync as readFileSync68, statSync as statSync31 } from "fs";
153681
+ import { resolve as resolve60, dirname as dirname47, basename as basename18, join as join101, relative as relative25, sep as sep13 } from "path";
153497
153682
  function queryIncludingTemplates(html, selector) {
153498
153683
  const doc = new DOMParser().parseFromString(html, "text/html");
153499
153684
  const roots = [doc];
@@ -153854,7 +154039,7 @@ function groupTraces(tweens) {
153854
154039
  return traces;
153855
154040
  }
153856
154041
  function collectCompositions(indexPath2) {
153857
- const html = readFileSync67(indexPath2, "utf-8");
154042
+ const html = readFileSync68(indexPath2, "utf-8");
153858
154043
  const baseDir = dirname47(indexPath2);
153859
154044
  const out = [
153860
154045
  surfaceComposition(html, basename18(indexPath2), basename18(indexPath2))
@@ -153863,10 +154048,10 @@ function collectCompositions(indexPath2) {
153863
154048
  for (const div of Array.from(doc.querySelectorAll("[data-composition-src]"))) {
153864
154049
  const src = div.getAttribute("data-composition-src");
153865
154050
  if (!src) continue;
153866
- const subPath = resolve59(baseDir, src);
154051
+ const subPath = resolve60(baseDir, src);
153867
154052
  if (!existsSync93(subPath)) continue;
153868
154053
  const id = div.getAttribute("data-composition-id") ?? src;
153869
- out.push(surfaceComposition(readFileSync67(subPath, "utf-8"), id, src));
154054
+ out.push(surfaceComposition(readFileSync68(subPath, "utf-8"), id, src));
153870
154055
  }
153871
154056
  return out;
153872
154057
  }
@@ -153970,7 +154155,7 @@ async function runOnionShot(comps, allComps, projectDir, entryFile, args) {
153970
154155
  console.log(c.dim(guardError));
153971
154156
  return true;
153972
154157
  }
153973
- const saved = await captureMotionPathShot2(projectDir, requests, resolve59(args.shot), {
154158
+ const saved = await captureMotionPathShot2(projectDir, requests, resolve60(args.shot), {
153974
154159
  ...onionShotOptions(args),
153975
154160
  entryFile
153976
154161
  });
@@ -153984,11 +154169,11 @@ function resolveScope(args) {
153984
154169
  let projectDir;
153985
154170
  let entryFile;
153986
154171
  if (raw && raw.endsWith(".html") && existsSync93(raw) && statSync31(raw).isFile()) {
153987
- const entryPath = resolve59(raw);
153988
- comps = [surfaceComposition(readFileSync67(entryPath, "utf-8"), basename18(entryPath), entryPath)];
154172
+ const entryPath = resolve60(raw);
154173
+ comps = [surfaceComposition(readFileSync68(entryPath, "utf-8"), basename18(entryPath), entryPath)];
153989
154174
  projectName = basename18(entryPath);
153990
154175
  projectDir = findProjectRoot(entryPath);
153991
- entryFile = relative24(projectDir, entryPath).split(sep13).join("/");
154176
+ entryFile = relative25(projectDir, entryPath).split(sep13).join("/");
153992
154177
  } else {
153993
154178
  const project = resolveProject(raw);
153994
154179
  comps = collectCompositions(project.indexPath);
@@ -154206,7 +154391,7 @@ __export(info_exports, {
154206
154391
  examples: () => examples17,
154207
154392
  orientation: () => orientation
154208
154393
  });
154209
- import { readFileSync as readFileSync68, readdirSync as readdirSync31, statSync as statSync33 } from "fs";
154394
+ import { readFileSync as readFileSync69, readdirSync as readdirSync31, statSync as statSync33 } from "fs";
154210
154395
  import { join as join103 } from "path";
154211
154396
  function orientation(width, height) {
154212
154397
  if (width > height) return "landscape";
@@ -154253,7 +154438,7 @@ var init_info = __esm({
154253
154438
  },
154254
154439
  async run({ args }) {
154255
154440
  const project = resolveProject(args.dir);
154256
- const html = readFileSync68(project.indexPath, "utf-8");
154441
+ const html = readFileSync69(project.indexPath, "utf-8");
154257
154442
  ensureDOMParser();
154258
154443
  const parsed = parseHtml(html);
154259
154444
  const tracks = new Set(parsed.elements.map((el) => el.zIndex));
@@ -154313,8 +154498,8 @@ __export(compositions_exports, {
154313
154498
  parseCompositions: () => parseCompositions,
154314
154499
  parseSubComposition: () => parseSubComposition
154315
154500
  });
154316
- import { existsSync as existsSync94, readFileSync as readFileSync69 } from "fs";
154317
- import { resolve as resolve60, dirname as dirname48 } from "path";
154501
+ import { existsSync as existsSync94, readFileSync as readFileSync70 } from "fs";
154502
+ import { resolve as resolve61, dirname as dirname48 } from "path";
154318
154503
  function countRenderableDescendants(root) {
154319
154504
  return Array.from(root.querySelectorAll("*")).filter(
154320
154505
  (el) => !NON_RENDERED_TAGS2.has(el.tagName.toLowerCase())
@@ -154392,9 +154577,9 @@ function parseCompositions(html, baseDir) {
154392
154577
  const height = parseInt(div.getAttribute("data-height") ?? "1080", 10);
154393
154578
  const compositionSrc = div.getAttribute("data-composition-src");
154394
154579
  if (compositionSrc) {
154395
- const subPath = resolve60(baseDir, compositionSrc);
154580
+ const subPath = resolve61(baseDir, compositionSrc);
154396
154581
  if (existsSync94(subPath)) {
154397
- const subHtml = readFileSync69(subPath, "utf-8");
154582
+ const subHtml = readFileSync70(subPath, "utf-8");
154398
154583
  const subInfo = parseSubComposition(subHtml, id, width, height);
154399
154584
  compositions.push({ ...subInfo, source: compositionSrc });
154400
154585
  return;
@@ -154500,7 +154685,7 @@ var init_compositions = __esm({
154500
154685
  },
154501
154686
  async run({ args }) {
154502
154687
  const project = resolveProject(args.dir);
154503
- const html = readFileSync69(project.indexPath, "utf-8");
154688
+ const html = readFileSync70(project.indexPath, "utf-8");
154504
154689
  ensureDOMParser();
154505
154690
  const compositions = parseCompositions(html, dirname48(project.indexPath));
154506
154691
  if (args.json) {
@@ -154539,7 +154724,7 @@ __export(benchmark_exports, {
154539
154724
  examples: () => examples19
154540
154725
  });
154541
154726
  import { existsSync as existsSync95, statSync as statSync34 } from "fs";
154542
- import { resolve as resolve61, join as join104 } from "path";
154727
+ import { resolve as resolve62, join as join104 } from "path";
154543
154728
  var examples19, FPS_30, FPS_60, DEFAULT_CONFIGS, benchmark_default;
154544
154729
  var init_benchmark = __esm({
154545
154730
  "src/commands/benchmark.ts"() {
@@ -154585,7 +154770,7 @@ var init_benchmark = __esm({
154585
154770
  failCommand();
154586
154771
  }
154587
154772
  const jsonOutput = args.json ?? false;
154588
- const benchDir = resolve61("renders", ".benchmark");
154773
+ const benchDir = resolve62("renders", ".benchmark");
154589
154774
  let producer = null;
154590
154775
  try {
154591
154776
  producer = await loadProducer();
@@ -154906,7 +155091,7 @@ __export(remove_background_exports, {
154906
155091
  default: () => remove_background_default,
154907
155092
  examples: () => examples21
154908
155093
  });
154909
- import { resolve as resolve62 } from "path";
155094
+ import { resolve as resolve63 } from "path";
154910
155095
  import { existsSync as existsSync96 } from "fs";
154911
155096
  async function showInfo(json) {
154912
155097
  const { selectProviders: selectProviders2, listAvailableProviders: listAvailableProviders2, DEFAULT_MODEL: DEFAULT_MODEL5, MODEL_MEMORY_MB: MODEL_MEMORY_MB2, modelPath: modelPath2 } = await Promise.resolve().then(() => (init_manager3(), manager_exports3));
@@ -155050,10 +155235,10 @@ var init_remove_background = __esm({
155050
155235
  );
155051
155236
  failCommand();
155052
155237
  }
155053
- const inputPath = resolve62(args.input);
155054
- const outputPath = resolve62(args.output);
155238
+ const inputPath = resolve63(args.input);
155239
+ const outputPath = resolve63(args.output);
155055
155240
  const backgroundOutputArg = args["background-output"];
155056
- const backgroundOutputPath = backgroundOutputArg ? resolve62(backgroundOutputArg) : void 0;
155241
+ const backgroundOutputPath = backgroundOutputArg ? resolve63(backgroundOutputArg) : void 0;
155057
155242
  const { render: render3 } = await Promise.resolve().then(() => (init_pipeline(), pipeline_exports));
155058
155243
  const spin = args.json ? null : ft();
155059
155244
  spin?.start("Preparing background-removal pipeline...");
@@ -155118,7 +155303,7 @@ var init_remove_background = __esm({
155118
155303
 
155119
155304
  // src/whisper/parakeet.ts
155120
155305
  import { execFileSync as execFileSync13 } from "child_process";
155121
- import { existsSync as existsSync97, mkdtempSync as mkdtempSync15, readFileSync as readFileSync70, rmSync as rmSync30, writeFileSync as writeFileSync40 } from "fs";
155306
+ import { existsSync as existsSync97, mkdtempSync as mkdtempSync15, readFileSync as readFileSync71, rmSync as rmSync30, writeFileSync as writeFileSync40 } from "fs";
155122
155307
  import { homedir as homedir20, tmpdir as tmpdir15 } from "os";
155123
155308
  import { basename as basename19, extname as extname16, join as join105 } from "path";
155124
155309
  function isRunnable(bin) {
@@ -155195,7 +155380,7 @@ function transcribeWithParakeet(inputPath, dir, options) {
155195
155380
  execFileSync13(runner, argv2, { stdio: ["ignore", "pipe", "pipe"], timeout: 18e5 });
155196
155381
  const produced = join105(workDir, `${basename19(inputPath, extname16(inputPath))}.json`);
155197
155382
  if (!existsSync97(produced)) throw new Error("Parakeet did not produce output.");
155198
- const words = mergeTokensToWords(JSON.parse(readFileSync70(produced, "utf-8")));
155383
+ const words = mergeTokensToWords(JSON.parse(readFileSync71(produced, "utf-8")));
155199
155384
  const transcriptPath = join105(dir, "transcript.json");
155200
155385
  writeFileSync40(transcriptPath, JSON.stringify(words, null, 2));
155201
155386
  const durationSeconds = words.length > 0 ? words[words.length - 1].end : 0;
@@ -155220,7 +155405,7 @@ __export(transcribe_exports2, {
155220
155405
  examples: () => examples22
155221
155406
  });
155222
155407
  import { existsSync as existsSync98, writeFileSync as writeFileSync41 } from "fs";
155223
- import { resolve as resolve63, join as join106, extname as extname17, dirname as dirname49 } from "path";
155408
+ import { resolve as resolve64, join as join106, extname as extname17, dirname as dirname49 } from "path";
155224
155409
  function parseTimeoutMs(raw, json) {
155225
155410
  const source = raw ?? process.env["HYPERFRAMES_TRANSCRIBE_TIMEOUT_MS"];
155226
155411
  if (source == null || source === "") return void 0;
@@ -155274,7 +155459,7 @@ async function exportTranscript(inputPath, dir, to, output, json, preserveCues)
155274
155459
  const { words, format } = loadTranscript2(inputPath);
155275
155460
  if (words.length === 0) exitNoWords(json);
155276
155461
  const preGrouped = preserveCues || format === "srt" || format === "vtt" || void 0;
155277
- const outPath = resolve63(output ?? join106(dir, `transcript.${to}`));
155462
+ const outPath = resolve64(output ?? join106(dir, `transcript.${to}`));
155278
155463
  const content = to === "srt" ? formatSrt2(words, { preGrouped }) : formatVtt2(words, { preGrouped });
155279
155464
  writeFileSync41(outPath, content);
155280
155465
  if (json) {
@@ -155457,14 +155642,14 @@ var init_transcribe2 = __esm({
155457
155642
  }
155458
155643
  },
155459
155644
  async run({ args }) {
155460
- const inputPath = resolve63(args.input);
155645
+ const inputPath = resolve64(args.input);
155461
155646
  if (!existsSync98(inputPath)) {
155462
155647
  const message = `File not found: ${args.input}`;
155463
155648
  trackCommandFailure("transcribe", message);
155464
155649
  console.error(c.error(message));
155465
155650
  failCommand();
155466
155651
  }
155467
- const dir = resolve63(args.dir ?? dirname49(inputPath));
155652
+ const dir = resolve64(args.dir ?? dirname49(inputPath));
155468
155653
  const ext = extname17(inputPath).toLowerCase();
155469
155654
  const isImport = ext === ".json" || ext === ".srt" || ext === ".vtt";
155470
155655
  const to = parseExportFormat(args.to, args.json);
@@ -155807,8 +155992,8 @@ __export(tts_exports, {
155807
155992
  default: () => tts_default,
155808
155993
  examples: () => examples23
155809
155994
  });
155810
- import { existsSync as existsSync101, readFileSync as readFileSync71 } from "fs";
155811
- import { resolve as resolve64, extname as extname18 } from "path";
155995
+ import { existsSync as existsSync101, readFileSync as readFileSync73 } from "fs";
155996
+ import { resolve as resolve65, extname as extname18 } from "path";
155812
155997
  function listVoices(json) {
155813
155998
  const rows = BUNDLED_VOICES.map((v2) => ({ ...v2, defaultLang: inferLangFromVoiceId(v2.id) }));
155814
155999
  if (json) {
@@ -155923,9 +156108,9 @@ var init_tts = __esm({
155923
156108
  failCommand();
155924
156109
  }
155925
156110
  let text2;
155926
- const maybeFile = resolve64(input2);
156111
+ const maybeFile = resolve65(input2);
155927
156112
  if (existsSync101(maybeFile) && extname18(maybeFile).toLowerCase() === ".txt") {
155928
- text2 = readFileSync71(maybeFile, "utf-8").trim();
156113
+ text2 = readFileSync73(maybeFile, "utf-8").trim();
155929
156114
  if (!text2) {
155930
156115
  console.error(c.error("File is empty."));
155931
156116
  failCommand();
@@ -155937,7 +156122,7 @@ var init_tts = __esm({
155937
156122
  console.error(c.error("No text provided."));
155938
156123
  failCommand();
155939
156124
  }
155940
- const output = resolve64(args.output ?? "speech.wav");
156125
+ const output = resolve65(args.output ?? "speech.wav");
155941
156126
  const voice = args.voice ?? DEFAULT_VOICE;
155942
156127
  const speed = args.speed ? parseFloat(args.speed) : 1;
155943
156128
  if (isNaN(speed) || speed <= 0 || speed > 3) {
@@ -156017,14 +156202,14 @@ __export(docs_exports, {
156017
156202
  default: () => docs_default,
156018
156203
  examples: () => examples24
156019
156204
  });
156020
- import { readFileSync as readFileSync73, existsSync as existsSync103 } from "fs";
156021
- import { resolve as resolve65, dirname as dirname51, join as join109 } from "path";
156205
+ import { readFileSync as readFileSync74, existsSync as existsSync103 } from "fs";
156206
+ import { resolve as resolve66, dirname as dirname51, join as join109 } from "path";
156022
156207
  import { fileURLToPath as fileURLToPath14 } from "url";
156023
156208
  function docsDir() {
156024
156209
  const thisFile = fileURLToPath14(import.meta.url);
156025
156210
  const dir = dirname51(thisFile);
156026
- const devPath = resolve65(dir, "..", "docs");
156027
- const builtPath = resolve65(dir, "docs");
156211
+ const devPath = resolve66(dir, "..", "docs");
156212
+ const builtPath = resolve66(dir, "docs");
156028
156213
  return existsSync103(devPath) ? devPath : builtPath;
156029
156214
  }
156030
156215
  function formatInlineCode(line2) {
@@ -156128,7 +156313,7 @@ var init_docs = __esm({
156128
156313
  console.error(c.error(`Doc file not found: ${filePath}`));
156129
156314
  failCommand();
156130
156315
  }
156131
- const content = readFileSync73(filePath, "utf-8");
156316
+ const content = readFileSync74(filePath, "utf-8");
156132
156317
  console.log();
156133
156318
  renderMarkdown(content);
156134
156319
  }
@@ -156526,8 +156711,8 @@ __export(upgrade_exports, {
156526
156711
  upgradeProjectPins: () => upgradeProjectPins
156527
156712
  });
156528
156713
  import { execFileSync as execFileSync17 } from "child_process";
156529
- import { existsSync as existsSync105, readFileSync as readFileSync74, writeFileSync as writeFileSync44, renameSync as renameSync16 } from "fs";
156530
- import { resolve as resolve66 } from "path";
156714
+ import { existsSync as existsSync105, readFileSync as readFileSync75, writeFileSync as writeFileSync44, renameSync as renameSync16 } from "fs";
156715
+ import { resolve as resolve67 } from "path";
156531
156716
  async function confirmUpgrade() {
156532
156717
  const shouldUpgrade = await ue({ message: "Upgrade now?" });
156533
156718
  return !q(shouldUpgrade) && shouldUpgrade === true;
@@ -156585,11 +156770,11 @@ function resolveProjectArgs(project, opts) {
156585
156770
  return { dir: project, check: opts.check, json: opts.json };
156586
156771
  }
156587
156772
  async function upgradeProjectPins(dir, opts) {
156588
- const pkgPath = resolve66(dir, "package.json");
156773
+ const pkgPath = resolve67(dir, "package.json");
156589
156774
  if (!existsSync105(pkgPath)) {
156590
156775
  return { changed: false, from: [], to: "", path: pkgPath };
156591
156776
  }
156592
- const raw = JSON.parse(readFileSync74(pkgPath, "utf-8"));
156777
+ const raw = JSON.parse(readFileSync75(pkgPath, "utf-8"));
156593
156778
  const scripts = raw.scripts ?? {};
156594
156779
  const { latest } = await checkForUpdate(true);
156595
156780
  if (!isSafeVersion(latest)) return { changed: false, from: [], to: latest, path: pkgPath };
@@ -156667,7 +156852,7 @@ var init_upgrade = __esm({
156667
156852
  const checkOnly = args.check === true;
156668
156853
  if (args.project !== void 0) {
156669
156854
  const p2 = resolveProjectArgs(args.project, { check: checkOnly, json: useJson });
156670
- const res = await upgradeProjectPins(resolve66(p2.dir), { json: p2.json, check: p2.check });
156855
+ const res = await upgradeProjectPins(resolve67(p2.dir), { json: p2.json, check: p2.check });
156671
156856
  if (p2.json) {
156672
156857
  console.log(JSON.stringify(withMeta(res), null, 2));
156673
156858
  return;
@@ -156866,7 +157051,7 @@ __export(feedback_exports, {
156866
157051
  examples: () => examples27
156867
157052
  });
156868
157053
  import { randomUUID as randomUUID12 } from "crypto";
156869
- import { resolve as resolve67 } from "path";
157054
+ import { resolve as resolve68 } from "path";
156870
157055
  import open from "open";
156871
157056
  function normalizeComment(raw) {
156872
157057
  return raw || void 0;
@@ -156939,7 +157124,7 @@ async function openAndPrintIssue(url) {
156939
157124
  console.log();
156940
157125
  }
156941
157126
  async function fileGithubIssue(opts) {
156942
- const dir = resolve67(opts.rawDir ?? ".");
157127
+ const dir = resolve68(opts.rawDir ?? ".");
156943
157128
  if (!await confirmFileIssue(dir, opts.yes)) return;
156944
157129
  const repoPublicUrl = await publishRepro(dir);
156945
157130
  const url = buildIssueUrl({
@@ -157275,7 +157460,7 @@ __export(contactSheet_exports, {
157275
157460
  createSvgContactSheet: () => createSvgContactSheet
157276
157461
  });
157277
157462
  import sharp from "sharp";
157278
- import { readdirSync as readdirSync34, readFileSync as readFileSync75, writeFileSync as writeFileSync45, unlinkSync as unlinkSync10, existsSync as existsSync106 } from "fs";
157463
+ import { readdirSync as readdirSync34, readFileSync as readFileSync76, writeFileSync as writeFileSync45, unlinkSync as unlinkSync10, existsSync as existsSync106 } from "fs";
157279
157464
  import { join as join110, extname as extname19, basename as basename21, dirname as dirname53 } from "path";
157280
157465
  async function createContactSheet(imagePaths, outputPath, opts = {}) {
157281
157466
  const {
@@ -157435,7 +157620,7 @@ async function createSvgContactSheet(svgsDir, outputPath, assetsRootDir, budget
157435
157620
  const svgPath = svgPaths[i2];
157436
157621
  const tmpPath = join110(tmpDir, `.thumb-${i2}.png`);
157437
157622
  try {
157438
- const svgBuf = readFileSync75(svgPath);
157623
+ const svgBuf = readFileSync76(svgPath);
157439
157624
  const thumb = await sharp(svgBuf).resize(thumbSize, thumbSize, {
157440
157625
  fit: "contain",
157441
157626
  background: { r: 245, g: 245, b: 245, alpha: 1 }
@@ -157744,7 +157929,7 @@ var require_p_retry = __commonJS({
157744
157929
  return error;
157745
157930
  };
157746
157931
  var isNetworkError = (errorMessage2) => networkErrorMsgs.includes(errorMessage2);
157747
- var pRetry2 = (input2, options) => new Promise((resolve78, reject2) => {
157932
+ var pRetry2 = (input2, options) => new Promise((resolve79, reject2) => {
157748
157933
  options = {
157749
157934
  onFailedAttempt: () => {
157750
157935
  },
@@ -157754,7 +157939,7 @@ var require_p_retry = __commonJS({
157754
157939
  const operation = retry.operation(options);
157755
157940
  operation.attempt(async (attemptNumber) => {
157756
157941
  try {
157757
- resolve78(await input2(attemptNumber));
157942
+ resolve79(await input2(attemptNumber));
157758
157943
  } catch (error) {
157759
157944
  if (!(error instanceof Error)) {
157760
157945
  reject2(new TypeError(`Non-error was thrown: "${error}". You should only throw errors.`));
@@ -158290,8 +158475,8 @@ var require_retry3 = __commonJS({
158290
158475
  }
158291
158476
  const delay2 = getNextRetryDelay(config);
158292
158477
  err.config.retryConfig.currentRetryAttempt += 1;
158293
- const backoff = config.retryBackoff ? config.retryBackoff(err, delay2) : new Promise((resolve78) => {
158294
- setTimeout(resolve78, delay2);
158478
+ const backoff = config.retryBackoff ? config.retryBackoff(err, delay2) : new Promise((resolve79) => {
158479
+ setTimeout(resolve79, delay2);
158295
158480
  });
158296
158481
  if (config.onRetryAttempt) {
158297
158482
  await config.onRetryAttempt(err);
@@ -158419,8 +158604,8 @@ var require_helpers = __commonJS({
158419
158604
  function req(url, opts = {}) {
158420
158605
  const href = typeof url === "string" ? url : url.href;
158421
158606
  const req2 = (href.startsWith("https:") ? https2 : http4).request(url, opts);
158422
- const promise = new Promise((resolve78, reject2) => {
158423
- req2.once("response", resolve78).once("error", reject2).end();
158607
+ const promise = new Promise((resolve79, reject2) => {
158608
+ req2.once("response", resolve79).once("error", reject2).end();
158424
158609
  });
158425
158610
  req2.then = promise.then.bind(promise);
158426
158611
  return req2;
@@ -158597,7 +158782,7 @@ var require_parse_proxy_response = __commonJS({
158597
158782
  var debug_1 = __importDefault2(__require("debug"));
158598
158783
  var debug = (0, debug_1.default)("https-proxy-agent:parse-proxy-response");
158599
158784
  function parseProxyResponse(socket) {
158600
- return new Promise((resolve78, reject2) => {
158785
+ return new Promise((resolve79, reject2) => {
158601
158786
  let buffersLength = 0;
158602
158787
  const buffers = [];
158603
158788
  function read() {
@@ -158663,7 +158848,7 @@ var require_parse_proxy_response = __commonJS({
158663
158848
  }
158664
158849
  debug("got proxy server response: %o %o", firstLine, headers);
158665
158850
  cleanup();
158666
- resolve78({
158851
+ resolve79({
158667
158852
  connect: {
158668
158853
  statusCode,
158669
158854
  statusText,
@@ -158907,7 +159092,7 @@ var require_ponyfill_es2018 = __commonJS({
158907
159092
  return new originalPromise(executor);
158908
159093
  }
158909
159094
  function promiseResolvedWith(value) {
158910
- return newPromise((resolve78) => resolve78(value));
159095
+ return newPromise((resolve79) => resolve79(value));
158911
159096
  }
158912
159097
  function promiseRejectedWith(reason) {
158913
159098
  return originalPromiseReject(reason);
@@ -159077,8 +159262,8 @@ var require_ponyfill_es2018 = __commonJS({
159077
159262
  return new TypeError("Cannot " + name + " a stream using a released reader");
159078
159263
  }
159079
159264
  function defaultReaderClosedPromiseInitialize(reader) {
159080
- reader._closedPromise = newPromise((resolve78, reject2) => {
159081
- reader._closedPromise_resolve = resolve78;
159265
+ reader._closedPromise = newPromise((resolve79, reject2) => {
159266
+ reader._closedPromise_resolve = resolve79;
159082
159267
  reader._closedPromise_reject = reject2;
159083
159268
  });
159084
159269
  }
@@ -159252,8 +159437,8 @@ var require_ponyfill_es2018 = __commonJS({
159252
159437
  }
159253
159438
  let resolvePromise;
159254
159439
  let rejectPromise;
159255
- const promise = newPromise((resolve78, reject2) => {
159256
- resolvePromise = resolve78;
159440
+ const promise = newPromise((resolve79, reject2) => {
159441
+ resolvePromise = resolve79;
159257
159442
  rejectPromise = reject2;
159258
159443
  });
159259
159444
  const readRequest = {
@@ -159358,8 +159543,8 @@ var require_ponyfill_es2018 = __commonJS({
159358
159543
  const reader = this._reader;
159359
159544
  let resolvePromise;
159360
159545
  let rejectPromise;
159361
- const promise = newPromise((resolve78, reject2) => {
159362
- resolvePromise = resolve78;
159546
+ const promise = newPromise((resolve79, reject2) => {
159547
+ resolvePromise = resolve79;
159363
159548
  rejectPromise = reject2;
159364
159549
  });
159365
159550
  const readRequest = {
@@ -160378,8 +160563,8 @@ var require_ponyfill_es2018 = __commonJS({
160378
160563
  }
160379
160564
  let resolvePromise;
160380
160565
  let rejectPromise;
160381
- const promise = newPromise((resolve78, reject2) => {
160382
- resolvePromise = resolve78;
160566
+ const promise = newPromise((resolve79, reject2) => {
160567
+ resolvePromise = resolve79;
160383
160568
  rejectPromise = reject2;
160384
160569
  });
160385
160570
  const readIntoRequest = {
@@ -160691,10 +160876,10 @@ var require_ponyfill_es2018 = __commonJS({
160691
160876
  wasAlreadyErroring = true;
160692
160877
  reason = void 0;
160693
160878
  }
160694
- const promise = newPromise((resolve78, reject2) => {
160879
+ const promise = newPromise((resolve79, reject2) => {
160695
160880
  stream._pendingAbortRequest = {
160696
160881
  _promise: void 0,
160697
- _resolve: resolve78,
160882
+ _resolve: resolve79,
160698
160883
  _reject: reject2,
160699
160884
  _reason: reason,
160700
160885
  _wasAlreadyErroring: wasAlreadyErroring
@@ -160711,9 +160896,9 @@ var require_ponyfill_es2018 = __commonJS({
160711
160896
  if (state === "closed" || state === "errored") {
160712
160897
  return promiseRejectedWith(new TypeError(`The stream (in ${state} state) is not in the writable state and cannot be closed`));
160713
160898
  }
160714
- const promise = newPromise((resolve78, reject2) => {
160899
+ const promise = newPromise((resolve79, reject2) => {
160715
160900
  const closeRequest = {
160716
- _resolve: resolve78,
160901
+ _resolve: resolve79,
160717
160902
  _reject: reject2
160718
160903
  };
160719
160904
  stream._closeRequest = closeRequest;
@@ -160726,9 +160911,9 @@ var require_ponyfill_es2018 = __commonJS({
160726
160911
  return promise;
160727
160912
  }
160728
160913
  function WritableStreamAddWriteRequest(stream) {
160729
- const promise = newPromise((resolve78, reject2) => {
160914
+ const promise = newPromise((resolve79, reject2) => {
160730
160915
  const writeRequest = {
160731
- _resolve: resolve78,
160916
+ _resolve: resolve79,
160732
160917
  _reject: reject2
160733
160918
  };
160734
160919
  stream._writeRequests.push(writeRequest);
@@ -161344,8 +161529,8 @@ var require_ponyfill_es2018 = __commonJS({
161344
161529
  return new TypeError("Cannot " + name + " a stream using a released writer");
161345
161530
  }
161346
161531
  function defaultWriterClosedPromiseInitialize(writer) {
161347
- writer._closedPromise = newPromise((resolve78, reject2) => {
161348
- writer._closedPromise_resolve = resolve78;
161532
+ writer._closedPromise = newPromise((resolve79, reject2) => {
161533
+ writer._closedPromise_resolve = resolve79;
161349
161534
  writer._closedPromise_reject = reject2;
161350
161535
  writer._closedPromiseState = "pending";
161351
161536
  });
@@ -161381,8 +161566,8 @@ var require_ponyfill_es2018 = __commonJS({
161381
161566
  writer._closedPromiseState = "resolved";
161382
161567
  }
161383
161568
  function defaultWriterReadyPromiseInitialize(writer) {
161384
- writer._readyPromise = newPromise((resolve78, reject2) => {
161385
- writer._readyPromise_resolve = resolve78;
161569
+ writer._readyPromise = newPromise((resolve79, reject2) => {
161570
+ writer._readyPromise_resolve = resolve79;
161386
161571
  writer._readyPromise_reject = reject2;
161387
161572
  });
161388
161573
  writer._readyPromiseState = "pending";
@@ -161469,7 +161654,7 @@ var require_ponyfill_es2018 = __commonJS({
161469
161654
  source._disturbed = true;
161470
161655
  let shuttingDown = false;
161471
161656
  let currentWrite = promiseResolvedWith(void 0);
161472
- return newPromise((resolve78, reject2) => {
161657
+ return newPromise((resolve79, reject2) => {
161473
161658
  let abortAlgorithm;
161474
161659
  if (signal !== void 0) {
161475
161660
  abortAlgorithm = () => {
@@ -161614,7 +161799,7 @@ var require_ponyfill_es2018 = __commonJS({
161614
161799
  if (isError) {
161615
161800
  reject2(error);
161616
161801
  } else {
161617
- resolve78(void 0);
161802
+ resolve79(void 0);
161618
161803
  }
161619
161804
  return null;
161620
161805
  }
@@ -161895,8 +162080,8 @@ var require_ponyfill_es2018 = __commonJS({
161895
162080
  let branch1;
161896
162081
  let branch2;
161897
162082
  let resolveCancelPromise;
161898
- const cancelPromise = newPromise((resolve78) => {
161899
- resolveCancelPromise = resolve78;
162083
+ const cancelPromise = newPromise((resolve79) => {
162084
+ resolveCancelPromise = resolve79;
161900
162085
  });
161901
162086
  function pullAlgorithm() {
161902
162087
  if (reading) {
@@ -161987,8 +162172,8 @@ var require_ponyfill_es2018 = __commonJS({
161987
162172
  let branch1;
161988
162173
  let branch2;
161989
162174
  let resolveCancelPromise;
161990
- const cancelPromise = newPromise((resolve78) => {
161991
- resolveCancelPromise = resolve78;
162175
+ const cancelPromise = newPromise((resolve79) => {
162176
+ resolveCancelPromise = resolve79;
161992
162177
  });
161993
162178
  function forwardReaderError(thisReader) {
161994
162179
  uponRejection(thisReader._closedPromise, (r2) => {
@@ -162768,8 +162953,8 @@ var require_ponyfill_es2018 = __commonJS({
162768
162953
  const writableHighWaterMark = ExtractHighWaterMark(writableStrategy, 1);
162769
162954
  const writableSizeAlgorithm = ExtractSizeAlgorithm(writableStrategy);
162770
162955
  let startPromise_resolve;
162771
- const startPromise = newPromise((resolve78) => {
162772
- startPromise_resolve = resolve78;
162956
+ const startPromise = newPromise((resolve79) => {
162957
+ startPromise_resolve = resolve79;
162773
162958
  });
162774
162959
  InitializeTransformStream(this, startPromise, writableHighWaterMark, writableSizeAlgorithm, readableHighWaterMark, readableSizeAlgorithm);
162775
162960
  SetUpTransformStreamDefaultControllerFromTransformer(this, transformer);
@@ -162862,8 +163047,8 @@ var require_ponyfill_es2018 = __commonJS({
162862
163047
  if (stream._backpressureChangePromise !== void 0) {
162863
163048
  stream._backpressureChangePromise_resolve();
162864
163049
  }
162865
- stream._backpressureChangePromise = newPromise((resolve78) => {
162866
- stream._backpressureChangePromise_resolve = resolve78;
163050
+ stream._backpressureChangePromise = newPromise((resolve79) => {
163051
+ stream._backpressureChangePromise_resolve = resolve79;
162867
163052
  });
162868
163053
  stream._backpressure = backpressure;
162869
163054
  }
@@ -163031,8 +163216,8 @@ var require_ponyfill_es2018 = __commonJS({
163031
163216
  return controller._finishPromise;
163032
163217
  }
163033
163218
  const readable = stream._readable;
163034
- controller._finishPromise = newPromise((resolve78, reject2) => {
163035
- controller._finishPromise_resolve = resolve78;
163219
+ controller._finishPromise = newPromise((resolve79, reject2) => {
163220
+ controller._finishPromise_resolve = resolve79;
163036
163221
  controller._finishPromise_reject = reject2;
163037
163222
  });
163038
163223
  const cancelPromise = controller._cancelAlgorithm(reason);
@@ -163058,8 +163243,8 @@ var require_ponyfill_es2018 = __commonJS({
163058
163243
  return controller._finishPromise;
163059
163244
  }
163060
163245
  const readable = stream._readable;
163061
- controller._finishPromise = newPromise((resolve78, reject2) => {
163062
- controller._finishPromise_resolve = resolve78;
163246
+ controller._finishPromise = newPromise((resolve79, reject2) => {
163247
+ controller._finishPromise_resolve = resolve79;
163063
163248
  controller._finishPromise_reject = reject2;
163064
163249
  });
163065
163250
  const flushPromise = controller._flushAlgorithm();
@@ -163089,8 +163274,8 @@ var require_ponyfill_es2018 = __commonJS({
163089
163274
  return controller._finishPromise;
163090
163275
  }
163091
163276
  const writable = stream._writable;
163092
- controller._finishPromise = newPromise((resolve78, reject2) => {
163093
- controller._finishPromise_resolve = resolve78;
163277
+ controller._finishPromise = newPromise((resolve79, reject2) => {
163278
+ controller._finishPromise_resolve = resolve79;
163094
163279
  controller._finishPromise_reject = reject2;
163095
163280
  });
163096
163281
  const cancelPromise = controller._cancelAlgorithm(reason);
@@ -165059,7 +165244,7 @@ import zlib2 from "zlib";
165059
165244
  import Stream2, { PassThrough as PassThrough2, pipeline as pump } from "stream";
165060
165245
  import { Buffer as Buffer4 } from "buffer";
165061
165246
  async function fetch3(url, options_) {
165062
- return new Promise((resolve78, reject2) => {
165247
+ return new Promise((resolve79, reject2) => {
165063
165248
  const request = new Request2(url, options_);
165064
165249
  const { parsedURL, options } = getNodeRequestOptions(request);
165065
165250
  if (!supportedSchemas.has(parsedURL.protocol)) {
@@ -165068,7 +165253,7 @@ async function fetch3(url, options_) {
165068
165253
  if (parsedURL.protocol === "data:") {
165069
165254
  const data2 = dist_default3(request.url);
165070
165255
  const response2 = new Response2(data2, { headers: { "Content-Type": data2.typeFull } });
165071
- resolve78(response2);
165256
+ resolve79(response2);
165072
165257
  return;
165073
165258
  }
165074
165259
  const send = (parsedURL.protocol === "https:" ? https : http3).request;
@@ -165190,7 +165375,7 @@ async function fetch3(url, options_) {
165190
165375
  if (responseReferrerPolicy) {
165191
165376
  requestOptions.referrerPolicy = responseReferrerPolicy;
165192
165377
  }
165193
- resolve78(fetch3(new Request2(locationURL, requestOptions)));
165378
+ resolve79(fetch3(new Request2(locationURL, requestOptions)));
165194
165379
  finalize();
165195
165380
  return;
165196
165381
  }
@@ -165223,7 +165408,7 @@ async function fetch3(url, options_) {
165223
165408
  const codings = headers.get("Content-Encoding");
165224
165409
  if (!request.compress || request.method === "HEAD" || codings === null || response_.statusCode === 204 || response_.statusCode === 304) {
165225
165410
  response = new Response2(body, responseOptions);
165226
- resolve78(response);
165411
+ resolve79(response);
165227
165412
  return;
165228
165413
  }
165229
165414
  const zlibOptions = {
@@ -165237,7 +165422,7 @@ async function fetch3(url, options_) {
165237
165422
  }
165238
165423
  });
165239
165424
  response = new Response2(body, responseOptions);
165240
- resolve78(response);
165425
+ resolve79(response);
165241
165426
  return;
165242
165427
  }
165243
165428
  if (codings === "deflate" || codings === "x-deflate") {
@@ -165261,12 +165446,12 @@ async function fetch3(url, options_) {
165261
165446
  });
165262
165447
  }
165263
165448
  response = new Response2(body, responseOptions);
165264
- resolve78(response);
165449
+ resolve79(response);
165265
165450
  });
165266
165451
  raw.once("end", () => {
165267
165452
  if (!response) {
165268
165453
  response = new Response2(body, responseOptions);
165269
- resolve78(response);
165454
+ resolve79(response);
165270
165455
  }
165271
165456
  });
165272
165457
  return;
@@ -165278,11 +165463,11 @@ async function fetch3(url, options_) {
165278
165463
  }
165279
165464
  });
165280
165465
  response = new Response2(body, responseOptions);
165281
- resolve78(response);
165466
+ resolve79(response);
165282
165467
  return;
165283
165468
  }
165284
165469
  response = new Response2(body, responseOptions);
165285
- resolve78(response);
165470
+ resolve79(response);
165286
165471
  });
165287
165472
  writeToStream(request_, request).catch(reject2);
165288
165473
  });
@@ -171364,7 +171549,7 @@ var require_jwtaccess = __commonJS({
171364
171549
  }
171365
171550
  }
171366
171551
  fromStreamAsync(inputStream) {
171367
- return new Promise((resolve78, reject2) => {
171552
+ return new Promise((resolve79, reject2) => {
171368
171553
  if (!inputStream) {
171369
171554
  reject2(new Error("Must pass in a stream containing the service account auth settings."));
171370
171555
  }
@@ -171373,7 +171558,7 @@ var require_jwtaccess = __commonJS({
171373
171558
  try {
171374
171559
  const data2 = JSON.parse(s2);
171375
171560
  this.fromJSON(data2);
171376
- resolve78();
171561
+ resolve79();
171377
171562
  } catch (err) {
171378
171563
  reject2(err);
171379
171564
  }
@@ -171612,7 +171797,7 @@ var require_jwtclient = __commonJS({
171612
171797
  }
171613
171798
  }
171614
171799
  fromStreamAsync(inputStream) {
171615
- return new Promise((resolve78, reject2) => {
171800
+ return new Promise((resolve79, reject2) => {
171616
171801
  if (!inputStream) {
171617
171802
  throw new Error("Must pass in a stream containing the service account auth settings.");
171618
171803
  }
@@ -171621,7 +171806,7 @@ var require_jwtclient = __commonJS({
171621
171806
  try {
171622
171807
  const data2 = JSON.parse(s2);
171623
171808
  this.fromJSON(data2);
171624
- resolve78();
171809
+ resolve79();
171625
171810
  } catch (e3) {
171626
171811
  reject2(e3);
171627
171812
  }
@@ -171754,7 +171939,7 @@ var require_refreshclient = __commonJS({
171754
171939
  }
171755
171940
  }
171756
171941
  async fromStreamAsync(inputStream) {
171757
- return new Promise((resolve78, reject2) => {
171942
+ return new Promise((resolve79, reject2) => {
171758
171943
  if (!inputStream) {
171759
171944
  return reject2(new Error("Must pass in a stream containing the user refresh token."));
171760
171945
  }
@@ -171763,7 +171948,7 @@ var require_refreshclient = __commonJS({
171763
171948
  try {
171764
171949
  const data2 = JSON.parse(s2);
171765
171950
  this.fromJSON(data2);
171766
- return resolve78();
171951
+ return resolve79();
171767
171952
  } catch (err) {
171768
171953
  return reject2(err);
171769
171954
  }
@@ -173596,7 +173781,7 @@ var require_pluggable_auth_handler = __commonJS({
173596
173781
  * @return A promise that resolves with the executable response.
173597
173782
  */
173598
173783
  retrieveResponseFromExecutable(envMap) {
173599
- return new Promise((resolve78, reject2) => {
173784
+ return new Promise((resolve79, reject2) => {
173600
173785
  const child = childProcess.spawn(this.commandComponents[0], this.commandComponents.slice(1), {
173601
173786
  env: { ...process.env, ...Object.fromEntries(envMap) }
173602
173787
  });
@@ -173618,7 +173803,7 @@ var require_pluggable_auth_handler = __commonJS({
173618
173803
  try {
173619
173804
  const responseJson = JSON.parse(output);
173620
173805
  const response = new executable_response_1.ExecutableResponse(responseJson);
173621
- return resolve78(response);
173806
+ return resolve79(response);
173622
173807
  } catch (error) {
173623
173808
  if (error instanceof executable_response_1.ExecutableResponseError) {
173624
173809
  return reject2(error);
@@ -174521,7 +174706,7 @@ var require_googleauth = __commonJS({
174521
174706
  }
174522
174707
  }
174523
174708
  fromStreamAsync(inputStream, options) {
174524
- return new Promise((resolve78, reject2) => {
174709
+ return new Promise((resolve79, reject2) => {
174525
174710
  if (!inputStream) {
174526
174711
  throw new Error("Must pass in a stream containing the Google auth settings.");
174527
174712
  }
@@ -174531,7 +174716,7 @@ var require_googleauth = __commonJS({
174531
174716
  try {
174532
174717
  const data2 = JSON.parse(chunks.join(""));
174533
174718
  const r2 = this._cacheClientFromJSON(data2, options);
174534
- return resolve78(r2);
174719
+ return resolve79(r2);
174535
174720
  } catch (err) {
174536
174721
  if (!this.keyFilename)
174537
174722
  throw err;
@@ -174541,7 +174726,7 @@ var require_googleauth = __commonJS({
174541
174726
  });
174542
174727
  this.cachedCredential = client;
174543
174728
  this.setGapicJWTValues(client);
174544
- return resolve78(client);
174729
+ return resolve79(client);
174545
174730
  }
174546
174731
  } catch (err) {
174547
174732
  return reject2(err);
@@ -174577,17 +174762,17 @@ var require_googleauth = __commonJS({
174577
174762
  * Run the Google Cloud SDK command that prints the default project ID
174578
174763
  */
174579
174764
  async getDefaultServiceProjectId() {
174580
- return new Promise((resolve78) => {
174765
+ return new Promise((resolve79) => {
174581
174766
  (0, child_process_1.exec)("gcloud config config-helper --format json", (err, stdout2) => {
174582
174767
  if (!err && stdout2) {
174583
174768
  try {
174584
174769
  const projectId = JSON.parse(stdout2).configuration.properties.core.project;
174585
- resolve78(projectId);
174770
+ resolve79(projectId);
174586
174771
  return;
174587
174772
  } catch (e3) {
174588
174773
  }
174589
174774
  }
174590
- resolve78(null);
174775
+ resolve79(null);
174591
174776
  });
174592
174777
  });
174593
174778
  }
@@ -182430,14 +182615,14 @@ function __asyncValues2(o) {
182430
182615
  }, i2);
182431
182616
  function verb(n2) {
182432
182617
  i2[n2] = o[n2] && function(v2) {
182433
- return new Promise(function(resolve78, reject2) {
182434
- v2 = o[n2](v2), settle(resolve78, reject2, v2.done, v2.value);
182618
+ return new Promise(function(resolve79, reject2) {
182619
+ v2 = o[n2](v2), settle(resolve79, reject2, v2.done, v2.value);
182435
182620
  });
182436
182621
  };
182437
182622
  }
182438
- function settle(resolve78, reject2, d2, v2) {
182623
+ function settle(resolve79, reject2, d2, v2) {
182439
182624
  Promise.resolve(v2).then(function(v3) {
182440
- resolve78({ value: v3, done: d2 });
182625
+ resolve79({ value: v3, done: d2 });
182441
182626
  }, reject2);
182442
182627
  }
182443
182628
  }
@@ -189864,7 +190049,7 @@ function getApiKeyFromEnv() {
189864
190049
  }
189865
190050
  return envGoogleApiKey || envGeminiApiKey || void 0;
189866
190051
  }
189867
- var import_p_retry, import_google_auth_library, _defaultBaseGeminiUrl, _defaultBaseVertexUrl, BaseModule, Language, Outcome, FunctionResponseScheduling, Type, Environment, AuthType, HttpElementLocation, ApiSpec, PhishBlockThreshold, Behavior, DynamicRetrievalConfigMode, FunctionCallingConfigMode, ThinkingLevel, PersonGeneration, ProminentPeople, HarmCategory, HarmBlockMethod, HarmBlockThreshold, FinishReason, HarmProbability, HarmSeverity, UrlRetrievalStatus, BlockedReason, TrafficType, Modality, ModelStage, MediaResolution, TuningMode, AdapterSize, JobState, TuningJobState, AggregationMetric, PairwiseChoice, TuningTask, DocumentState, PartMediaResolutionLevel, ToolType, ResourceScope, ServiceTier, FeatureSelectionPreference, EmbeddingApiType, SafetyFilterLevel, ImagePromptLanguage, MaskReferenceMode, ControlReferenceType, SubjectReferenceType, EditMode, SegmentMode, VideoGenerationReferenceType, VideoGenerationMaskMode, VideoCompressionQuality, ImageResizeMode, TuningMethod, FileState, FileSource, TurnCompleteReason, MediaModality, VadSignalType, VoiceActivityType, StartSensitivity, EndSensitivity, ActivityHandling, TurnCoverage, Scale, MusicGenerationMode, LiveMusicPlaybackControl, ToolResponse, FunctionResponseBlob, FunctionResponseFileData, FunctionResponsePart, FunctionResponse, HttpResponse, GenerateContentResponsePromptFeedback, GenerateContentResponseUsageMetadata, GenerateContentResponse, EmbedContentResponse, GenerateImagesResponse, EditImageResponse, UpscaleImageResponse, RecontextImageResponse, SegmentImageResponse, ListModelsResponse, DeleteModelResponse, CountTokensResponse, ComputeTokensResponse, GenerateVideosResponse, GenerateVideosOperation, EvaluateDatasetResponse, ListTuningJobsResponse, CancelTuningJobResponse, DeleteCachedContentResponse, ListCachedContentsResponse, ListDocumentsResponse, ListFileSearchStoresResponse, UploadToFileSearchStoreResumableResponse, ImportFileResponse, ImportFileOperation, ListFilesResponse, CreateFileResponse, DeleteFileResponse, RegisterFilesResponse, InlinedResponse, SingleEmbedContentResponse, InlinedEmbedContentResponse, ListBatchJobsResponse, ReplayResponse, RawReferenceImage, MaskReferenceImage, ControlReferenceImage, StyleReferenceImage, SubjectReferenceImage, ContentReferenceImage, LiveServerMessage, LiveClientToolResponse, LiveSendToolResponseParameters, LiveMusicServerMessage, UploadToFileSearchStoreResponse, UploadToFileSearchStoreOperation, PagedItem, Pager, Batches, Caches, Chats, Chat, ApiError, Files, CONTENT_TYPE_HEADER, SERVER_TIMEOUT_HEADER, USER_AGENT_HEADER, GOOGLE_API_CLIENT_HEADER, SDK_VERSION, LIBRARY_LABEL, VERTEX_AI_API_DEFAULT_VERSION, GOOGLE_AI_API_DEFAULT_VERSION, MULTI_REGIONAL_LOCATIONS, DEFAULT_RETRY_ATTEMPTS, DEFAULT_RETRY_HTTP_STATUS_CODES, ApiClient, MCP_LABEL, hasMcpToolUsageFromMcpToTool, McpCallableTool, LiveMusic, LiveMusicSession, FUNCTION_RESPONSE_REQUIRES_ID, Live, defaultLiveSendClientContentParamerters, Session, DEFAULT_MAX_REMOTE_CALLS, Models, Operations, Tokens, Documents, FileSearchStores, uuid4Internal, uuid4, castToError, GeminiNextGenAPIClientError, APIError, APIUserAbortError, APIConnectionError, APIConnectionTimeoutError, BadRequestError, AuthenticationError, PermissionDeniedError, NotFoundError, ConflictError, UnprocessableEntityError, RateLimitError, InternalServerError, startsWithSchemeRegexp, isAbsoluteURL, isArrayInternal, isArray3, isReadonlyArrayInternal, isReadonlyArray, validatePositiveInteger, safeJSON, sleep$1, FallbackEncoder, VERSION2, checkFileSupport, isAsyncIterable, isBlobLike, isFileLike, isResponseLike, APIResource, EMPTY, createPathTagFunction, path, BaseInteractions, Interactions, BaseWebhooks, Webhooks, encodeUTF8_, decodeUTF8_, LineDecoder, levelNumbers, parseLogLevel, noopLogger, cachedLoggers, formatRequestDetails, Stream3, SSEDecoder, APIPromise, brand_privateNullableHeaders, buildHeaders, readEnv, _a3, BaseGeminiNextGenAPIClient, GeminiNextGenAPIClient, GOOGLE_API_KEY_HEADER, REQUIRED_VERTEX_AI_SCOPE, NodeAuth, NodeDownloader, NodeWebSocketFactory, NodeWebSocket, Tunings, MAX_CHUNK_SIZE2, MAX_RETRY_COUNT, INITIAL_RETRY_DELAY_MS, DELAY_MULTIPLIER, X_GOOG_UPLOAD_STATUS_HEADER_FIELD, NodeUploader, NodeFiles, LANGUAGE_LABEL_PREFIX, GoogleGenAI;
190052
+ var import_p_retry, import_google_auth_library, _defaultBaseGeminiUrl, _defaultBaseVertexUrl, BaseModule, Language, Outcome, FunctionResponseScheduling, Type, Environment, AuthType, HttpElementLocation, ApiSpec, PhishBlockThreshold, Behavior, DynamicRetrievalConfigMode, FunctionCallingConfigMode, ThinkingLevel, PersonGeneration, ProminentPeople, HarmCategory, HarmBlockMethod, HarmBlockThreshold, FinishReason, HarmProbability, HarmSeverity, UrlRetrievalStatus, BlockedReason, TrafficType, Modality, ModelStage, MediaResolution, TuningMode, AdapterSize, JobState, TuningJobState, AggregationMetric, PairwiseChoice, TuningTask, DocumentState, PartMediaResolutionLevel, ToolType, ResourceScope, ServiceTier, FeatureSelectionPreference, EmbeddingApiType, SafetyFilterLevel, ImagePromptLanguage, MaskReferenceMode, ControlReferenceType, SubjectReferenceType, EditMode, SegmentMode, VideoGenerationReferenceType, VideoGenerationMaskMode, VideoCompressionQuality, ImageResizeMode, TuningMethod, FileState, FileSource, TurnCompleteReason, MediaModality, VadSignalType, VoiceActivityType, StartSensitivity, EndSensitivity, ActivityHandling, TurnCoverage, Scale, MusicGenerationMode, LiveMusicPlaybackControl, ToolResponse, FunctionResponseBlob, FunctionResponseFileData, FunctionResponsePart, FunctionResponse, HttpResponse, GenerateContentResponsePromptFeedback, GenerateContentResponseUsageMetadata, GenerateContentResponse, EmbedContentResponse, GenerateImagesResponse, EditImageResponse, UpscaleImageResponse, RecontextImageResponse, SegmentImageResponse, ListModelsResponse, DeleteModelResponse, CountTokensResponse, ComputeTokensResponse, GenerateVideosResponse, GenerateVideosOperation, EvaluateDatasetResponse, ListTuningJobsResponse, CancelTuningJobResponse, DeleteCachedContentResponse, ListCachedContentsResponse, ListDocumentsResponse, ListFileSearchStoresResponse, UploadToFileSearchStoreResumableResponse, ImportFileResponse, ImportFileOperation, ListFilesResponse, CreateFileResponse, DeleteFileResponse, RegisterFilesResponse, InlinedResponse, SingleEmbedContentResponse, InlinedEmbedContentResponse, ListBatchJobsResponse, ReplayResponse, RawReferenceImage, MaskReferenceImage, ControlReferenceImage, StyleReferenceImage, SubjectReferenceImage, ContentReferenceImage, LiveServerMessage, LiveClientToolResponse, LiveSendToolResponseParameters, LiveMusicServerMessage, UploadToFileSearchStoreResponse, UploadToFileSearchStoreOperation, PagedItem, Pager, Batches, Caches, Chats, Chat, ApiError, Files, CONTENT_TYPE_HEADER, SERVER_TIMEOUT_HEADER, USER_AGENT_HEADER, GOOGLE_API_CLIENT_HEADER, SDK_VERSION, LIBRARY_LABEL, VERTEX_AI_API_DEFAULT_VERSION, GOOGLE_AI_API_DEFAULT_VERSION, MULTI_REGIONAL_LOCATIONS, DEFAULT_RETRY_ATTEMPTS, DEFAULT_RETRY_HTTP_STATUS_CODES, ApiClient, MCP_LABEL, hasMcpToolUsageFromMcpToTool, McpCallableTool, LiveMusic, LiveMusicSession, FUNCTION_RESPONSE_REQUIRES_ID, Live, defaultLiveSendClientContentParamerters, Session, DEFAULT_MAX_REMOTE_CALLS, Models, Operations, Tokens, Documents, FileSearchStores, uuid4Internal, uuid4, castToError, GeminiNextGenAPIClientError, APIError, APIUserAbortError, APIConnectionError, APIConnectionTimeoutError, BadRequestError, AuthenticationError, PermissionDeniedError, NotFoundError, ConflictError, UnprocessableEntityError, RateLimitError, InternalServerError, startsWithSchemeRegexp, isAbsoluteURL, isArrayInternal, isArray3, isReadonlyArrayInternal, isReadonlyArray, validatePositiveInteger, safeJSON, sleep$1, FallbackEncoder, VERSION2, checkFileSupport, isAsyncIterable, isBlobLike, isFileLike, isResponseLike, APIResource, EMPTY2, createPathTagFunction, path, BaseInteractions, Interactions, BaseWebhooks, Webhooks, encodeUTF8_, decodeUTF8_, LineDecoder, levelNumbers, parseLogLevel, noopLogger, cachedLoggers, formatRequestDetails, Stream3, SSEDecoder, APIPromise, brand_privateNullableHeaders, buildHeaders, readEnv, _a3, BaseGeminiNextGenAPIClient, GeminiNextGenAPIClient, GOOGLE_API_KEY_HEADER, REQUIRED_VERTEX_AI_SCOPE, NodeAuth, NodeDownloader, NodeWebSocketFactory, NodeWebSocket, Tunings, MAX_CHUNK_SIZE2, MAX_RETRY_COUNT, INITIAL_RETRY_DELAY_MS, DELAY_MULTIPLIER, X_GOOG_UPLOAD_STATUS_HEADER_FIELD, NodeUploader, NodeFiles, LANGUAGE_LABEL_PREFIX, GoogleGenAI;
189868
190053
  var init_node4 = __esm({
189869
190054
  "../../node_modules/.bun/@google+genai@1.52.0/node_modules/@google/genai/dist/node/index.mjs"() {
189870
190055
  "use strict";
@@ -192927,8 +193112,8 @@ var init_node4 = __esm({
192927
193112
  const url = `${websocketBaseUrl}/ws/google.ai.generativelanguage.${apiVersion}.GenerativeService.BidiGenerateMusic?key=${apiKey}`;
192928
193113
  let onopenResolve = () => {
192929
193114
  };
192930
- const onopenPromise = new Promise((resolve78) => {
192931
- onopenResolve = resolve78;
193115
+ const onopenPromise = new Promise((resolve79) => {
193116
+ onopenResolve = resolve79;
192932
193117
  });
192933
193118
  const callbacks = params.callbacks;
192934
193119
  const onopenAwaitedCallback = function() {
@@ -193134,8 +193319,8 @@ var init_node4 = __esm({
193134
193319
  }
193135
193320
  let onopenResolve = () => {
193136
193321
  };
193137
- const onopenPromise = new Promise((resolve78) => {
193138
- onopenResolve = resolve78;
193322
+ const onopenPromise = new Promise((resolve79) => {
193323
+ onopenResolve = resolve79;
193139
193324
  });
193140
193325
  const callbacks = params.callbacks;
193141
193326
  const onopenAwaitedCallback = function() {
@@ -195483,7 +195668,7 @@ var init_node4 = __esm({
195483
195668
  return void 0;
195484
195669
  }
195485
195670
  };
195486
- sleep$1 = (ms) => new Promise((resolve78) => setTimeout(resolve78, ms));
195671
+ sleep$1 = (ms) => new Promise((resolve79) => setTimeout(resolve79, ms));
195487
195672
  FallbackEncoder = ({ headers, body }) => {
195488
195673
  return {
195489
195674
  bodyHeaders: {
@@ -195511,7 +195696,7 @@ var init_node4 = __esm({
195511
195696
  }
195512
195697
  };
195513
195698
  APIResource._key = [];
195514
- EMPTY = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null));
195699
+ EMPTY2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null));
195515
195700
  createPathTagFunction = (pathEncoder = encodeURIPath) => (function path2(statics, ...params) {
195516
195701
  if (statics.length === 1)
195517
195702
  return statics[0];
@@ -195525,7 +195710,7 @@ var init_node4 = __esm({
195525
195710
  const value = params[index];
195526
195711
  let encoded = (postPath ? encodeURIComponent : pathEncoder)("" + value);
195527
195712
  if (index !== params.length && (value == null || typeof value === "object" && // handle values from other realms
195528
- value.toString === ((_c2 = Object.getPrototypeOf((_b = Object.getPrototypeOf((_a4 = value.hasOwnProperty) !== null && _a4 !== void 0 ? _a4 : EMPTY)) !== null && _b !== void 0 ? _b : EMPTY)) === null || _c2 === void 0 ? void 0 : _c2.toString))) {
195713
+ value.toString === ((_c2 = Object.getPrototypeOf((_b = Object.getPrototypeOf((_a4 = value.hasOwnProperty) !== null && _a4 !== void 0 ? _a4 : EMPTY2)) !== null && _b !== void 0 ? _b : EMPTY2)) === null || _c2 === void 0 ? void 0 : _c2.toString))) {
195529
195714
  encoded = value + "";
195530
195715
  invalidSegments.push({
195531
195716
  start: previousValue.length + currentValue.length,
@@ -195992,8 +196177,8 @@ ${underline2}`);
195992
196177
  };
195993
196178
  APIPromise = class _APIPromise extends Promise {
195994
196179
  constructor(client, responsePromise, parseResponse = defaultParseResponse) {
195995
- super((resolve78) => {
195996
- resolve78(null);
196180
+ super((resolve79) => {
196181
+ resolve79(null);
195997
196182
  });
195998
196183
  this.responsePromise = responsePromise;
195999
196184
  this.parseResponse = parseResponse;
@@ -197220,9 +197405,9 @@ __export(snapshot_exports, {
197220
197405
  resolveSnapshotVideoFrameTime: () => resolveSnapshotVideoFrameTime,
197221
197406
  tailFrameTime: () => tailFrameTime
197222
197407
  });
197223
- import { existsSync as existsSync107, mkdtempSync as mkdtempSync16, readFileSync as readFileSync76, mkdirSync as mkdirSync53, rmSync as rmSync31, writeFileSync as writeFileSync46 } from "fs";
197408
+ import { existsSync as existsSync107, mkdtempSync as mkdtempSync16, readFileSync as readFileSync77, mkdirSync as mkdirSync53, rmSync as rmSync31, writeFileSync as writeFileSync46 } from "fs";
197224
197409
  import { tmpdir as tmpdir16 } from "os";
197225
- import { resolve as resolve68, join as join111, relative as relative25, isAbsolute as isAbsolute15, basename as basename25, posix as posix7 } from "path";
197410
+ import { resolve as resolve69, join as join111, relative as relative26, isAbsolute as isAbsolute16, basename as basename25, posix as posix7 } from "path";
197226
197411
  function orbitStageSource() {
197227
197412
  return `function(cam) {
197228
197413
  var root = document.querySelector("[data-composition-id]")
@@ -197290,7 +197475,7 @@ async function extractVideoFrameToBuffer(videoPath, timeSeconds, useVp9AlphaDeco
197290
197475
  );
197291
197476
  const result = await runFfmpegOnce(ffmpegPath, args, FFMPEG_EXTRACT_TIMEOUT_MS);
197292
197477
  if (result.code !== 0 || result.timedOut || !existsSync107(outPath)) return null;
197293
- return readFileSync76(outPath);
197478
+ return readFileSync77(outPath);
197294
197479
  } finally {
197295
197480
  try {
197296
197481
  rmSync31(tmp, { recursive: true, force: true });
@@ -197472,9 +197657,9 @@ async function captureSnapshots(projectDir, opts) {
197472
197657
  try {
197473
197658
  const url = new URL(v2.src);
197474
197659
  const decodedPath = decodeURIComponent(url.pathname).replace(/^\//, "");
197475
- const candidate = resolve68(projectDir, decodedPath);
197476
- const rel2 = relative25(projectDir, candidate);
197477
- if (!rel2.startsWith("..") && !isAbsolute15(rel2) && existsSync107(candidate)) {
197660
+ const candidate = resolve69(projectDir, decodedPath);
197661
+ const rel2 = relative26(projectDir, candidate);
197662
+ if (!rel2.startsWith("..") && !isAbsolute16(rel2) && existsSync107(candidate)) {
197478
197663
  ffmpegInput = candidate;
197479
197664
  inputIsLocal = true;
197480
197665
  } else if (url.protocol === "http:" || url.protocol === "https:") {
@@ -197539,8 +197724,8 @@ async function captureSnapshots(projectDir, opts) {
197539
197724
  } else {
197540
197725
  await page.screenshot({ path: framePath, type: "png", omitBackground: true });
197541
197726
  }
197542
- const rel = relative25(projectDir, framePath);
197543
- savedPaths.push(rel.startsWith("..") || isAbsolute15(rel) ? framePath : rel);
197727
+ const rel = relative26(projectDir, framePath);
197728
+ savedPaths.push(rel.startsWith("..") || isAbsolute16(rel) ? framePath : rel);
197544
197729
  }
197545
197730
  } finally {
197546
197731
  await chromeBrowser.close();
@@ -197680,7 +197865,7 @@ var init_snapshot = __esm({
197680
197865
  const angleLabel = camera && (camera.yaw !== 0 || camera.pitch !== 0) ? ` ${c.dim(`(angle yaw ${camera.yaw}\xB0 pitch ${camera.pitch}\xB0)`)}` : "";
197681
197866
  console.log(`${c.accent("\u25C6")} Capturing ${label2} from ${c.accent(project.name)}${angleLabel}`);
197682
197867
  try {
197683
- const snapshotDir = args.output ? resolve68(String(args.output)) : join111(project.dir, "snapshots");
197868
+ const snapshotDir = args.output ? resolve69(String(args.output)) : join111(project.dir, "snapshots");
197684
197869
  const paths = await captureSnapshots(project.dir, {
197685
197870
  frames,
197686
197871
  timeout,
@@ -197749,7 +197934,7 @@ ${c.success("\u25C7")} ${paths.length} snapshots saved to ${args.output ? snaps
197749
197934
  const filename = basename25(p2);
197750
197935
  const filePath = join111(snapshotDir, filename);
197751
197936
  if (!existsSync107(filePath)) return { filename, desc: "file not found" };
197752
- const raw = readFileSync76(filePath);
197937
+ const raw = readFileSync77(filePath);
197753
197938
  let imageData;
197754
197939
  let mimeType = "image/png";
197755
197940
  if (sharpFn) {
@@ -197814,22 +197999,22 @@ var init_sourceMutation = __esm({
197814
197999
  });
197815
198000
 
197816
198001
  // src/utils/pathArgs.ts
197817
- import { isAbsolute as isAbsolute16, relative as relative26, resolve as resolve69 } from "path";
198002
+ import { isAbsolute as isAbsolute17, relative as relative27, resolve as resolve70 } from "path";
197818
198003
  function readOptionalString(value) {
197819
198004
  if (typeof value !== "string") return void 0;
197820
198005
  const trimmed = value.trim();
197821
198006
  return trimmed ? trimmed : void 0;
197822
198007
  }
197823
198008
  function resolveFromBase(baseDir, input2) {
197824
- return isAbsolute16(input2) ? input2 : resolve69(baseDir, input2);
198009
+ return isAbsolute17(input2) ? input2 : resolve70(baseDir, input2);
197825
198010
  }
197826
198011
  function displayPathFromBase(baseDir, filePath) {
197827
- const rel = relative26(baseDir, filePath);
197828
- if (rel && !rel.startsWith("..") && !isAbsolute16(rel)) return rel;
198012
+ const rel = relative27(baseDir, filePath);
198013
+ if (rel && !rel.startsWith("..") && !isAbsolute17(rel)) return rel;
197829
198014
  return filePath;
197830
198015
  }
197831
198016
  function displayPathFromInput(baseDir, input2) {
197832
- return isAbsolute16(input2) ? displayPathFromBase(baseDir, input2) : input2;
198017
+ return isAbsolute17(input2) ? displayPathFromBase(baseDir, input2) : input2;
197833
198018
  }
197834
198019
  var init_pathArgs = __esm({
197835
198020
  "src/utils/pathArgs.ts"() {
@@ -198118,8 +198303,8 @@ __export(media_treatment_exports, {
198118
198303
  mediaTreatmentCommand: () => mediaTreatmentCommand,
198119
198304
  resolveMediaTreatmentSource: () => resolveMediaTreatmentSource
198120
198305
  });
198121
- import { existsSync as existsSync108, readFileSync as readFileSync77, writeFileSync as writeFileSync47 } from "fs";
198122
- import { join as join113, relative as relative27, resolve as resolve70 } from "path";
198306
+ import { existsSync as existsSync108, readFileSync as readFileSync78, writeFileSync as writeFileSync47 } from "fs";
198307
+ import { join as join113, relative as relative28, resolve as resolve71 } from "path";
198123
198308
  function getMediaTreatmentCapabilityOverview() {
198124
198309
  const capabilities = getHfColorGradingCapabilities();
198125
198310
  const family = (id, label2, description) => ({
@@ -198546,7 +198731,7 @@ function runCapabilityQuery(args) {
198546
198731
  function resolveMutationFile(args) {
198547
198732
  const project = resolveProject(readOptionalString(args.project));
198548
198733
  const fileArg = readOptionalString(args.file) ?? "index.html";
198549
- const filePath = resolve70(project.dir, fileArg);
198734
+ const filePath = resolve71(project.dir, fileArg);
198550
198735
  if (!isPathInside(filePath, project.dir) || !filePath.toLowerCase().endsWith(".html")) {
198551
198736
  throw new Error("--file must be an HTML file inside the project");
198552
198737
  }
@@ -198562,12 +198747,12 @@ function analyzeTarget(args) {
198562
198747
  }
198563
198748
  const selectorIndex = parseSelectorIndex(readOptionalString(args["selector-index"]));
198564
198749
  const { element, tag } = selectMediaElement(
198565
- readFileSync77(filePath, "utf8"),
198750
+ readFileSync78(filePath, "utf8"),
198566
198751
  selector,
198567
198752
  selectorIndex
198568
198753
  );
198569
198754
  const source = mediaSourceForElement(element);
198570
- const compositionFile = relative27(project.dir, filePath).split("\\").join("/");
198755
+ const compositionFile = relative28(project.dir, filePath).split("\\").join("/");
198571
198756
  const mediaPath = resolveMediaTreatmentSource(project.dir, compositionFile, source);
198572
198757
  return {
198573
198758
  ok: true,
@@ -198587,7 +198772,7 @@ function prepareMutation(args) {
198587
198772
  const clear = args.clear === true;
198588
198773
  const apply = args.apply === true;
198589
198774
  const selectorIndex = parseSelectorIndex(readOptionalString(args["selector-index"]));
198590
- const result = applyMediaTreatmentToHtml(readFileSync77(filePath, "utf8"), {
198775
+ const result = applyMediaTreatmentToHtml(readFileSync78(filePath, "utf8"), {
198591
198776
  selector,
198592
198777
  selectorIndex,
198593
198778
  grading: parseGrading(readOptionalString(args.grading), apply, clear),
@@ -198603,7 +198788,7 @@ function prepareMutation(args) {
198603
198788
  payload: {
198604
198789
  ok: true,
198605
198790
  action,
198606
- file: relative27(project.dir, filePath) || "index.html",
198791
+ file: relative28(project.dir, filePath) || "index.html",
198607
198792
  selector,
198608
198793
  selectorIndex: selectorIndex ?? 0,
198609
198794
  tag: result.tag,
@@ -198776,12 +198961,12 @@ import {
198776
198961
  existsSync as existsSync109,
198777
198962
  mkdirSync as mkdirSync54,
198778
198963
  mkdtempSync as mkdtempSync17,
198779
- readFileSync as readFileSync78,
198964
+ readFileSync as readFileSync79,
198780
198965
  rmSync as rmSync33,
198781
198966
  writeFileSync as writeFileSync48
198782
198967
  } from "fs";
198783
198968
  import { tmpdir as tmpdir17 } from "os";
198784
- import { basename as basename27, dirname as dirname54, extname as extname21, join as join114, resolve as resolve71 } from "path";
198969
+ import { basename as basename27, dirname as dirname54, extname as extname21, join as join114, resolve as resolve72 } from "path";
198785
198970
  import sharp2 from "sharp";
198786
198971
  function isRecord14(value) {
198787
198972
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -198872,7 +199057,7 @@ function parseGradesFile(filePath) {
198872
199057
  }
198873
199058
  let parsed;
198874
199059
  try {
198875
- parsed = JSON.parse(readFileSync78(filePath, "utf-8"));
199060
+ parsed = JSON.parse(readFileSync79(filePath, "utf-8"));
198876
199061
  } catch (err) {
198877
199062
  throw new Error(`Could not parse grades JSON: ${normalizeErrorMessage(err)}`);
198878
199063
  }
@@ -198913,7 +199098,7 @@ function parseGradeCompareArgs(args) {
198913
199098
  if (Boolean(gradesArg) === Boolean(lutsArg)) {
198914
199099
  throw new Error("Exactly one of --grades or --luts is required");
198915
199100
  }
198916
- const projectDir = resolve71(readOptionalString(args.project) ?? process.cwd());
199101
+ const projectDir = resolve72(readOptionalString(args.project) ?? process.cwd());
198917
199102
  const framePath = resolveFromBase(projectDir, frameArg);
198918
199103
  const outPath = resolveFromBase(projectDir, readOptionalString(args.out) ?? "grade-compare.png");
198919
199104
  return {
@@ -199049,7 +199234,7 @@ async function prepareGradeCompareTempProject(opts) {
199049
199234
  if (!existsSync109(sourcePath)) {
199050
199235
  throw new Error(`LUT file not found for "${cell.label}": ${sourcePath}`);
199051
199236
  }
199052
- const lutText = readFileSync78(sourcePath, "utf-8");
199237
+ const lutText = readFileSync79(sourcePath, "utf-8");
199053
199238
  try {
199054
199239
  parseCubeLut(lutText, { maxSize: 64 });
199055
199240
  } catch (err) {
@@ -199112,7 +199297,7 @@ async function extractVideoFrameToBuffer2(videoPath) {
199112
199297
  const detail = result.stderr.trim() ? `: ${result.stderr.trim()}` : "";
199113
199298
  throw new Error(`ffmpeg could not extract first frame from ${videoPath}${detail}`);
199114
199299
  }
199115
- return readFileSync78(outPath);
199300
+ return readFileSync79(outPath);
199116
199301
  } finally {
199117
199302
  rmSync33(tmp, { recursive: true, force: true });
199118
199303
  }
@@ -199121,7 +199306,7 @@ async function loadReferenceFrame(framePath) {
199121
199306
  if (!existsSync109(framePath)) {
199122
199307
  throw new Error(`Reference frame not found: ${framePath}`);
199123
199308
  }
199124
- const buffer = isVideoPath2(framePath) ? await extractVideoFrameToBuffer2(framePath) : readFileSync78(framePath);
199309
+ const buffer = isVideoPath2(framePath) ? await extractVideoFrameToBuffer2(framePath) : readFileSync79(framePath);
199125
199310
  if (!buffer) {
199126
199311
  throw new Error(`Could not extract a frame from video: ${framePath}`);
199127
199312
  }
@@ -200016,8 +200201,8 @@ __export(video_exports, {
200016
200201
  runVideoMode: () => runVideoMode,
200017
200202
  safeFilename: () => safeFilename
200018
200203
  });
200019
- import { createWriteStream as createWriteStream4, existsSync as existsSync111, mkdirSync as mkdirSync57, readFileSync as readFileSync79, unlinkSync as unlinkSync11 } from "fs";
200020
- import { resolve as resolve72, join as join117, basename as basename29 } from "path";
200204
+ import { createWriteStream as createWriteStream4, existsSync as existsSync111, mkdirSync as mkdirSync57, readFileSync as readFileSync80, unlinkSync as unlinkSync11 } from "fs";
200205
+ import { resolve as resolve73, join as join117, basename as basename29 } from "path";
200021
200206
  async function streamToFile(url, destPath) {
200022
200207
  const r2 = await safeFetch(url, {
200023
200208
  signal: AbortSignal.timeout(12e4),
@@ -200135,7 +200320,7 @@ function pickManifestEntry(manifest, args) {
200135
200320
  };
200136
200321
  }
200137
200322
  async function runVideoMode(args) {
200138
- const projectDir = resolve72(args.project);
200323
+ const projectDir = resolve73(args.project);
200139
200324
  const directPath = join117(projectDir, "extracted", "video-manifest.json");
200140
200325
  const w2hPath = join117(projectDir, "capture", "extracted", "video-manifest.json");
200141
200326
  const manifestPath2 = existsSync111(directPath) ? directPath : w2hPath;
@@ -200150,7 +200335,7 @@ async function runVideoMode(args) {
200150
200335
  }
200151
200336
  let manifest;
200152
200337
  try {
200153
- manifest = JSON.parse(readFileSync79(manifestPath2, "utf-8"));
200338
+ manifest = JSON.parse(readFileSync80(manifestPath2, "utf-8"));
200154
200339
  } catch (e3) {
200155
200340
  console.error(`${c.error("\u2717")} video-manifest.json is malformed: ${e3.message}`);
200156
200341
  setCommandExitCode(1);
@@ -201438,7 +201623,7 @@ var init_designStyleExtractor = __esm({
201438
201623
  });
201439
201624
 
201440
201625
  // src/capture/fontMetadataExtractor.ts
201441
- import { readdirSync as readdirSync35, readFileSync as readFileSync80, writeFileSync as writeFileSync50, existsSync as existsSync113 } from "fs";
201626
+ import { readdirSync as readdirSync35, readFileSync as readFileSync81, writeFileSync as writeFileSync50, existsSync as existsSync113 } from "fs";
201442
201627
  import { join as join118 } from "path";
201443
201628
  import * as fontkit from "fontkit";
201444
201629
  function isFontCollection(value) {
@@ -201489,7 +201674,7 @@ function readSingleFont(fullPath, filename) {
201489
201674
  isIcon: false
201490
201675
  };
201491
201676
  try {
201492
- const buf = readFileSync80(fullPath);
201677
+ const buf = readFileSync81(fullPath);
201493
201678
  const created = fontkit.create(buf);
201494
201679
  const font = isFontCollection(created) ? created.fonts[0] : created;
201495
201680
  if (!font) return empty2;
@@ -201757,7 +201942,7 @@ async function lazyScrollForCapture(page, budgetMs, opts = {}) {
201757
201942
  return { steps: 0, timedOut: false, degraded: false };
201758
201943
  }
201759
201944
  const stepDelayMs = opts.stepDelayMs ?? LAZY_SCROLL_STEP_DELAY_MS;
201760
- const sleep5 = opts.sleep ?? ((ms) => new Promise((resolve78) => setTimeout(resolve78, ms)));
201945
+ const sleep5 = opts.sleep ?? ((ms) => new Promise((resolve79) => setTimeout(resolve79, ms)));
201761
201946
  const deadline = Date.now() + budgetMs;
201762
201947
  let steps = 0;
201763
201948
  let timedOut = false;
@@ -201980,7 +202165,7 @@ var init_animationCataloger = __esm({
201980
202165
  });
201981
202166
 
201982
202167
  // src/capture/mediaCapture.ts
201983
- import { mkdirSync as mkdirSync58, writeFileSync as writeFileSync51, readdirSync as readdirSync36, readFileSync as readFileSync81, statSync as statSync37 } from "fs";
202168
+ import { mkdirSync as mkdirSync58, writeFileSync as writeFileSync51, readdirSync as readdirSync36, readFileSync as readFileSync83, statSync as statSync37 } from "fs";
201984
202169
  import { join as join119, extname as extname25 } from "path";
201985
202170
  function liveRemainingMs(budget, fallbackMs) {
201986
202171
  return budget.remainingMs?.() ?? fallbackMs;
@@ -202053,7 +202238,7 @@ async function renderLottiePreviews(chromeBrowser, lottieDir, outputDir, budget
202053
202238
  if (!file.endsWith(".json")) continue;
202054
202239
  if (liveRemainingMs(budget, 1) <= 0) break;
202055
202240
  try {
202056
- const raw = JSON.parse(readFileSync81(join119(lottieDir, file), "utf-8"));
202241
+ const raw = JSON.parse(readFileSync83(join119(lottieDir, file), "utf-8"));
202057
202242
  const fr = raw.fr || 30;
202058
202243
  const dur = ((raw.op || 0) - (raw.ip || 0)) / fr;
202059
202244
  const previewName = file.replace(".json", "-preview.png");
@@ -202066,7 +202251,7 @@ async function renderLottiePreviews(chromeBrowser, lottieDir, outputDir, budget
202066
202251
  previewPage = await chromeBrowser.newPage();
202067
202252
  if (liveRemainingMs(budget, 1) <= 0) break;
202068
202253
  await previewPage.setViewport({ width: 400, height: 400 });
202069
- const animData = JSON.parse(readFileSync81(join119(lottieDir, file), "utf-8"));
202254
+ const animData = JSON.parse(readFileSync83(join119(lottieDir, file), "utf-8"));
202070
202255
  const midFrame = Math.floor(((raw.op || 0) - (raw.ip || 0)) * 0.3);
202071
202256
  await previewPage.setContent(
202072
202257
  `<!DOCTYPE html>
@@ -202365,7 +202550,7 @@ var init_mediaCapture = __esm({
202365
202550
  });
202366
202551
 
202367
202552
  // src/capture/contentExtractor.ts
202368
- import { existsSync as existsSync114, readdirSync as readdirSync37, statSync as statSync38, readFileSync as readFileSync83 } from "fs";
202553
+ import { existsSync as existsSync114, readdirSync as readdirSync37, statSync as statSync38, readFileSync as readFileSync84 } from "fs";
202369
202554
  import { basename as basename30, join as join120 } from "path";
202370
202555
  function resolveVisionPhaseCompletion(outcome, remainingMs) {
202371
202556
  if (outcome.budgetExhausted || remainingMs <= 0) {
@@ -202635,7 +202820,7 @@ async function captionImagesWithGemini(outputDir, progress, warnings, options =
202635
202820
  const filePath = join120(outputDir, "assets", file);
202636
202821
  const stat3 = statSync38(filePath);
202637
202822
  if (stat3.size > 4e6) return { file, caption: "" };
202638
- const buffer = readFileSync83(filePath);
202823
+ const buffer = readFileSync84(filePath);
202639
202824
  const base64 = buffer.toString("base64");
202640
202825
  const ext = file.split(".").pop()?.toLowerCase() || "png";
202641
202826
  const mimeType = ext === "jpg" ? "image/jpeg" : `image/${ext}`;
@@ -202703,7 +202888,7 @@ async function captionImagesWithGemini(outputDir, progress, warnings, options =
202703
202888
  const filePath = join120(assetsDir, relPath);
202704
202889
  let pngBase64;
202705
202890
  try {
202706
- const svgSource = readFileSync83(filePath, "utf-8");
202891
+ const svgSource = readFileSync84(filePath, "utf-8");
202707
202892
  const lightFillHits = (svgSource.match(/fill\s*=\s*["'](#fff(fff)?|white|#[ef][ef][ef]|#[ef]{6})["']/gi) || []).length;
202708
202893
  const darkFillHits = (svgSource.match(/fill\s*=\s*["'](#000(000)?|black|#[0-3]{6}|#[0-3]{3})["']/gi) || []).length;
202709
202894
  const bg = lightFillHits > darkFillHits ? { r: 32, g: 32, b: 32 } : { r: 255, g: 255, b: 255 };
@@ -202830,7 +203015,7 @@ function generateAssetDescriptions(outputDir, tokens, catalogedAssets, geminiCap
202830
203015
  const videoLines = [];
202831
203016
  try {
202832
203017
  const manifest = JSON.parse(
202833
- readFileSync83(join120(outputDir, "extracted", "video-manifest.json"), "utf-8")
203018
+ readFileSync84(join120(outputDir, "extracted", "video-manifest.json"), "utf-8")
202834
203019
  );
202835
203020
  for (const v2 of manifest) {
202836
203021
  if (!v2.localPath) continue;
@@ -203000,15 +203185,15 @@ var init_agentPromptGenerator = __esm({
203000
203185
  });
203001
203186
 
203002
203187
  // src/capture/scaffolding.ts
203003
- import { existsSync as existsSync116, writeFileSync as writeFileSync54, readFileSync as readFileSync84 } from "fs";
203004
- import { join as join123, resolve as resolve73 } from "path";
203188
+ import { existsSync as existsSync116, writeFileSync as writeFileSync54, readFileSync as readFileSync85 } from "fs";
203189
+ import { join as join123, resolve as resolve74 } from "path";
203005
203190
  function loadEnvFile(startDir) {
203006
203191
  try {
203007
- let dir = resolve73(startDir);
203192
+ let dir = resolve74(startDir);
203008
203193
  for (let i2 = 0; i2 < 5; i2++) {
203009
- const envPath = resolve73(dir, ".env");
203194
+ const envPath = resolve74(dir, ".env");
203010
203195
  try {
203011
- const envContent = readFileSync84(envPath, "utf-8");
203196
+ const envContent = readFileSync85(envPath, "utf-8");
203012
203197
  for (const line2 of envContent.split("\n")) {
203013
203198
  const trimmed = line2.trim();
203014
203199
  if (!trimmed || trimmed.startsWith("#")) continue;
@@ -203020,7 +203205,7 @@ function loadEnvFile(startDir) {
203020
203205
  }
203021
203206
  break;
203022
203207
  } catch {
203023
- dir = resolve73(dir, "..");
203208
+ dir = resolve74(dir, "..");
203024
203209
  }
203025
203210
  }
203026
203211
  } catch {
@@ -204302,7 +204487,7 @@ __export(capture_exports2, {
204302
204487
  default: () => capture_default,
204303
204488
  examples: () => examples33
204304
204489
  });
204305
- import { resolve as resolve74 } from "path";
204490
+ import { resolve as resolve75 } from "path";
204306
204491
  function emitCapturePhase(event) {
204307
204492
  diag.notice(`${CAPTURE_PHASE_PREFIX}${JSON.stringify(event)}`);
204308
204493
  }
@@ -204426,13 +204611,13 @@ var init_capture2 = __esm({
204426
204611
  const captureBudgetMs = parseCaptureBudget(args["capture-budget"]);
204427
204612
  const isDefaultOutput = !args.output;
204428
204613
  let outputName = args.output ?? "capture";
204429
- let outputDir = resolve74(outputName);
204614
+ let outputDir = resolve75(outputName);
204430
204615
  if (isDefaultOutput) {
204431
204616
  const { existsSync: existsSync131 } = await import("fs");
204432
204617
  let n2 = 2;
204433
204618
  while (existsSync131(outputDir) && n2 < 100) {
204434
204619
  outputName = `capture-${n2}`;
204435
- outputDir = resolve74(outputName);
204620
+ outputDir = resolve75(outputName);
204436
204621
  n2++;
204437
204622
  }
204438
204623
  if (existsSync131(outputDir)) {
@@ -204592,7 +204777,7 @@ __export(state_exports, {
204592
204777
  stateFilePath: () => stateFilePath,
204593
204778
  writeStackOutputs: () => writeStackOutputs
204594
204779
  });
204595
- import { existsSync as existsSync118, mkdirSync as mkdirSync61, readdirSync as readdirSync39, readFileSync as readFileSync85, rmSync as rmSync35, writeFileSync as writeFileSync57 } from "fs";
204780
+ import { existsSync as existsSync118, mkdirSync as mkdirSync61, readdirSync as readdirSync39, readFileSync as readFileSync86, rmSync as rmSync35, writeFileSync as writeFileSync57 } from "fs";
204596
204781
  import { dirname as dirname56, join as join126 } from "path";
204597
204782
  function stateFilePath(stackName = DEFAULT_STACK_NAME, cwd = process.cwd()) {
204598
204783
  return join126(cwd, STATE_DIR_NAME, `${STATE_FILE_PREFIX}${stackName}.json`);
@@ -204607,7 +204792,7 @@ function readStackOutputs(stackName = DEFAULT_STACK_NAME, cwd = process.cwd()) {
204607
204792
  const path2 = stateFilePath(stackName, cwd);
204608
204793
  if (!existsSync118(path2)) return null;
204609
204794
  try {
204610
- return JSON.parse(readFileSync85(path2, "utf-8"));
204795
+ return JSON.parse(readFileSync86(path2, "utf-8"));
204611
204796
  } catch {
204612
204797
  return null;
204613
204798
  }
@@ -204773,16 +204958,16 @@ var init_sam = __esm({
204773
204958
 
204774
204959
  // src/commands/lambda/repoRoot.ts
204775
204960
  import { existsSync as existsSync120 } from "fs";
204776
- import { dirname as dirname57, resolve as resolve75 } from "path";
204961
+ import { dirname as dirname57, resolve as resolve76 } from "path";
204777
204962
  import { fileURLToPath as fileURLToPath15 } from "url";
204778
204963
  function repoRoot() {
204779
204964
  const override = process.env.HYPERFRAMES_REPO_ROOT;
204780
- if (override && existsSync120(resolve75(override, "packages", "aws-lambda", "package.json"))) {
204965
+ if (override && existsSync120(resolve76(override, "packages", "aws-lambda", "package.json"))) {
204781
204966
  return override;
204782
204967
  }
204783
204968
  let dir = dirname57(fileURLToPath15(import.meta.url));
204784
204969
  for (let depth = 0; depth < 12; depth++) {
204785
- if (existsSync120(resolve75(dir, "packages", "aws-lambda", "package.json"))) {
204970
+ if (existsSync120(resolve76(dir, "packages", "aws-lambda", "package.json"))) {
204786
204971
  return dir;
204787
204972
  }
204788
204973
  const parent = dirname57(dir);
@@ -204806,7 +204991,7 @@ __export(deploy_exports, {
204806
204991
  });
204807
204992
  import { spawnSync as spawnSync5 } from "child_process";
204808
204993
  import { existsSync as existsSync121 } from "fs";
204809
- import { join as join128, resolve as resolve76 } from "path";
204994
+ import { join as join128, resolve as resolve77 } from "path";
204810
204995
  async function runDeploy(args = {}) {
204811
204996
  const resolved2 = {
204812
204997
  stackName: args.stackName ?? DEFAULT_STACK_NAME,
@@ -204860,7 +205045,7 @@ async function runDeploy(args = {}) {
204860
205045
  console.log(` ${c.dim("Bucket:")} ${outputs.bucketName}`);
204861
205046
  console.log(` ${c.dim("State machine:")} ${outputs.stateMachineArn}`);
204862
205047
  console.log(` ${c.dim("Function:")} ${outputs.functionName}`);
204863
- console.log(` ${c.dim("State file:")} ${resolve76(statePath2)}`);
205048
+ console.log(` ${c.dim("State file:")} ${resolve77(statePath2)}`);
204864
205049
  console.log();
204865
205050
  console.log(c.dim(`Render with: hyperframes lambda render <project-dir>`));
204866
205051
  }
@@ -204936,14 +205121,14 @@ var init_sites = __esm({
204936
205121
  });
204937
205122
 
204938
205123
  // src/commands/lambda/_dimensions.ts
204939
- import { readFileSync as readFileSync86 } from "fs";
205124
+ import { readFileSync as readFileSync87 } from "fs";
204940
205125
  import { join as join129 } from "path";
204941
205126
  function warnOnDimensionMismatch(args) {
204942
205127
  if (args.quiet) return;
204943
205128
  if (args.outputResolution) return;
204944
205129
  let html;
204945
205130
  try {
204946
- html = readFileSync86(join129(args.projectDir, "index.html"), "utf-8");
205131
+ html = readFileSync87(join129(args.projectDir, "index.html"), "utf-8");
204947
205132
  } catch {
204948
205133
  return;
204949
205134
  }
@@ -205123,7 +205308,7 @@ __export(render_batch_exports, {
205123
205308
  runRenderBatch: () => runRenderBatch,
205124
205309
  runWithConcurrencyLimit: () => runWithConcurrencyLimit
205125
205310
  });
205126
- import { existsSync as existsSync123, readFileSync as readFileSync87 } from "fs";
205311
+ import { existsSync as existsSync123, readFileSync as readFileSync88 } from "fs";
205127
205312
  import { join as join131, resolve as resolvePath3 } from "path";
205128
205313
  async function loadSDK3() {
205129
205314
  return import("@hyperframes/aws-lambda/sdk");
@@ -205283,7 +205468,7 @@ function buildLambdaBatchRenderConfig(args) {
205283
205468
  return config;
205284
205469
  }
205285
205470
  function parseBatchFile(path2) {
205286
- const raw = readFileSync87(path2, "utf8");
205471
+ const raw = readFileSync88(path2, "utf8");
205287
205472
  const lines = raw.split(/\r?\n/);
205288
205473
  const out = [];
205289
205474
  for (let i2 = 0; i2 < lines.length; i2++) {
@@ -205477,7 +205662,7 @@ __export(policies_exports, {
205477
205662
  runPolicies: () => runPolicies,
205478
205663
  validatePolicy: () => validatePolicy
205479
205664
  });
205480
- import { readFileSync as readFileSync88 } from "fs";
205665
+ import { readFileSync as readFileSync89 } from "fs";
205481
205666
  function allRequiredActions() {
205482
205667
  const set = /* @__PURE__ */ new Set();
205483
205668
  for (const group of Object.values(REQUIRED_ACTIONS)) {
@@ -205583,7 +205768,7 @@ async function runPolicies(args) {
205583
205768
  }
205584
205769
  }
205585
205770
  function validatePolicy(policyPath) {
205586
- const raw = readFileSync88(policyPath, "utf-8");
205771
+ const raw = readFileSync89(policyPath, "utf-8");
205587
205772
  const parsed = JSON.parse(raw);
205588
205773
  const statements = Array.isArray(parsed.Statement) ? parsed.Statement : parsed.Statement ? [
205589
205774
  parsed.Statement
@@ -206194,9 +206379,9 @@ __export(cloudrun_exports, {
206194
206379
  missingCloudRunAdapterMessage: () => missingCloudRunAdapterMessage
206195
206380
  });
206196
206381
  import { spawnSync as spawnSync6 } from "child_process";
206197
- import { existsSync as existsSync124, mkdirSync as mkdirSync63, readFileSync as readFileSync89, writeFileSync as writeFileSync58 } from "fs";
206382
+ import { existsSync as existsSync124, mkdirSync as mkdirSync63, readFileSync as readFileSync90, writeFileSync as writeFileSync58 } from "fs";
206198
206383
  import { homedir as homedir23 } from "os";
206199
- import { join as join133, resolve as resolve77 } from "path";
206384
+ import { join as join133, resolve as resolve78 } from "path";
206200
206385
  function loadCloudRunAdapter() {
206201
206386
  cloudRunAdapterPromise ??= Promise.all([
206202
206387
  import("@hyperframes/gcp-cloud-run/sdk"),
@@ -206232,7 +206417,7 @@ function readState2(args) {
206232
206417
  let base2 = {};
206233
206418
  if (existsSync124(statePath())) {
206234
206419
  try {
206235
- base2 = JSON.parse(readFileSync89(statePath(), "utf8"));
206420
+ base2 = JSON.parse(readFileSync90(statePath(), "utf8"));
206236
206421
  } catch {
206237
206422
  }
206238
206423
  }
@@ -206374,7 +206559,7 @@ function machineVars(args, project, region, image) {
206374
206559
  return vars;
206375
206560
  }
206376
206561
  function findRepoRoot(tfDir) {
206377
- const candidate = resolve77(tfDir, "..", "..", "..");
206562
+ const candidate = resolve78(tfDir, "..", "..", "..");
206378
206563
  if (existsSync124(join133(candidate, "packages", "gcp-cloud-run", "Dockerfile"))) return candidate;
206379
206564
  return null;
206380
206565
  }
@@ -206409,7 +206594,7 @@ async function runSites(args) {
206409
206594
  const state = readState2(args);
206410
206595
  const { deploySite } = await loadCloudRunAdapter();
206411
206596
  const handle = await deploySite({
206412
- projectDir: resolve77(projectDir),
206597
+ projectDir: resolve78(projectDir),
206413
206598
  bucketName: state.bucketName,
206414
206599
  siteId: args["site-id"]
206415
206600
  });
@@ -206444,11 +206629,11 @@ async function runRender2(args) {
206444
206629
  }
206445
206630
  const fps = resolveCloudRunFps(args, projectDir, "render");
206446
206631
  const state = readState2(args);
206447
- const variables = resolveAndValidateVariables(args, resolve77(projectDir));
206632
+ const variables = resolveAndValidateVariables(args, resolve78(projectDir));
206448
206633
  const config = buildRenderConfig(args, fps, width, height, variables);
206449
206634
  const { renderToCloudRun, getRenderProgress } = await loadCloudRunAdapter();
206450
206635
  const handle = await renderToCloudRun({
206451
- projectDir: resolve77(projectDir),
206636
+ projectDir: resolve78(projectDir),
206452
206637
  config,
206453
206638
  bucketName: state.bucketName,
206454
206639
  projectId: state.projectId,
@@ -206524,11 +206709,11 @@ async function runRenderBatch2(args) {
206524
206709
  failCommand();
206525
206710
  }
206526
206711
  const fps = resolveCloudRunFps(args, projectDir, "render-batch");
206527
- if (!existsSync124(resolve77(batchPath))) {
206712
+ if (!existsSync124(resolve78(batchPath))) {
206528
206713
  console.error(`[cloudrun render-batch] batch file not found: ${batchPath}`);
206529
206714
  failCommand();
206530
206715
  }
206531
- const entries2 = parseBatchFile2(resolve77(batchPath));
206716
+ const entries2 = parseBatchFile2(resolve78(batchPath));
206532
206717
  if (entries2.length === 0) {
206533
206718
  console.error("[cloudrun render-batch] batch file has no entries.");
206534
206719
  failCommand();
@@ -206547,7 +206732,7 @@ async function runRenderBatch2(args) {
206547
206732
  const maxConcurrent = parsePositiveInt2(args["max-concurrent"], "--max-concurrent") ?? DEFAULT_BATCH_MAX_CONCURRENT;
206548
206733
  const { deploySite, renderToCloudRun } = await loadCloudRunAdapter();
206549
206734
  const siteHandle = await deploySite({
206550
- projectDir: resolve77(projectDir),
206735
+ projectDir: resolve78(projectDir),
206551
206736
  bucketName: state.bucketName,
206552
206737
  siteId: args["site-id"]
206553
206738
  });
@@ -206591,7 +206776,7 @@ async function runRenderBatch2(args) {
206591
206776
  if (failed.length > 0) failCommand();
206592
206777
  }
206593
206778
  function parseBatchFile2(path2) {
206594
- const lines = readFileSync89(path2, "utf8").split(/\r?\n/);
206779
+ const lines = readFileSync90(path2, "utf8").split(/\r?\n/);
206595
206780
  const entries2 = [];
206596
206781
  lines.forEach((line2, idx) => {
206597
206782
  const trimmed = line2.trim();
@@ -206616,7 +206801,7 @@ function parseBatchFile2(path2) {
206616
206801
  async function runDestroy2(args) {
206617
206802
  const { getTerraformModuleDir } = await loadCloudRunAdapter();
206618
206803
  const tfDir = getTerraformModuleDir();
206619
- const state = existsSync124(statePath()) ? JSON.parse(readFileSync89(statePath(), "utf8")) : {};
206804
+ const state = existsSync124(statePath()) ? JSON.parse(readFileSync90(statePath(), "utf8")) : {};
206620
206805
  const project = args.project ?? state.projectId;
206621
206806
  const region = args.region ?? state.region ?? "us-central1";
206622
206807
  const image = args.image ?? "unused:latest";
@@ -206918,7 +207103,7 @@ ${HELP2}`);
206918
207103
  });
206919
207104
 
206920
207105
  // src/cloud/detectAspectRatio.ts
206921
- import { readFileSync as readFileSync90 } from "fs";
207106
+ import { readFileSync as readFileSync91 } from "fs";
206922
207107
  function extractAttributeNumber(tag, re2) {
206923
207108
  const match = tag.match(re2);
206924
207109
  if (!match) return null;
@@ -206930,7 +207115,7 @@ function extractAttributeNumber(tag, re2) {
206930
207115
  function detectAspectRatioFromHtml(entryHtmlPath) {
206931
207116
  let html;
206932
207117
  try {
206933
- html = readFileSync90(entryHtmlPath, "utf-8");
207118
+ html = readFileSync91(entryHtmlPath, "utf-8");
206934
207119
  } catch (err) {
206935
207120
  return { kind: "read-error", error: normalizeErrorMessage(err) };
206936
207121
  }
@@ -207000,14 +207185,14 @@ function signalAbortError(signal) {
207000
207185
  return reason instanceof Error ? reason : new Error("Poll aborted");
207001
207186
  }
207002
207187
  function defaultAbortableSleep(signal) {
207003
- return (ms) => new Promise((resolve78, reject2) => {
207188
+ return (ms) => new Promise((resolve79, reject2) => {
207004
207189
  const onAbort = () => {
207005
207190
  clearTimeout(timer);
207006
207191
  reject2(signalAbortError(signal));
207007
207192
  };
207008
207193
  const timer = setTimeout(() => {
207009
207194
  signal?.removeEventListener("abort", onAbort);
207010
- resolve78();
207195
+ resolve79();
207011
207196
  }, ms);
207012
207197
  signal?.addEventListener("abort", onAbort, { once: true });
207013
207198
  });
@@ -207082,7 +207267,7 @@ async function downloadToFile(url, destPath, options = {}) {
207082
207267
  return { path: destPath, bytes };
207083
207268
  }
207084
207269
  function waitForDrain(file, signal) {
207085
- return new Promise((resolve78, reject2) => {
207270
+ return new Promise((resolve79, reject2) => {
207086
207271
  const cleanup = () => {
207087
207272
  file.off("drain", onDrain);
207088
207273
  file.off("error", onError);
@@ -207091,7 +207276,7 @@ function waitForDrain(file, signal) {
207091
207276
  };
207092
207277
  const onDrain = () => {
207093
207278
  cleanup();
207094
- resolve78();
207279
+ resolve79();
207095
207280
  };
207096
207281
  const onError = (err) => {
207097
207282
  cleanup();
@@ -207113,10 +207298,10 @@ function waitForDrain(file, signal) {
207113
207298
  });
207114
207299
  }
207115
207300
  function closeFile(file) {
207116
- return new Promise((resolve78) => {
207301
+ return new Promise((resolve79) => {
207117
207302
  const done = () => {
207118
207303
  file.off("error", done);
207119
- resolve78();
207304
+ resolve79();
207120
207305
  };
207121
207306
  file.once("error", done);
207122
207307
  file.end(() => done());
@@ -207637,7 +207822,7 @@ __export(render_exports3, {
207637
207822
  validateDryRunSource: () => validateDryRunSource,
207638
207823
  validateResolutionFormatCombo: () => validateResolutionFormatCombo
207639
207824
  });
207640
- import { isAbsolute as isAbsolute17, relative as relative28, resolve as resolvePath4 } from "path";
207825
+ import { isAbsolute as isAbsolute18, relative as relative29, resolve as resolvePath4 } from "path";
207641
207826
  import { existsSync as existsSync125 } from "fs";
207642
207827
  function parsePollIntervalMs(raw) {
207643
207828
  const n2 = parseNumericFlag(raw, { flag: "--poll-interval", min: 1 });
@@ -207763,7 +207948,7 @@ function prepareLocalArchive(source, composition, asJson) {
207763
207948
  }
207764
207949
  try {
207765
207950
  const fileMap = buildPublishFileMap(project.dir);
207766
- const entryPath = relative28(
207951
+ const entryPath = relative29(
207767
207952
  project.dir,
207768
207953
  resolvePath4(project.dir, composition ?? "index.html")
207769
207954
  ).replaceAll("\\", "/");
@@ -207948,7 +208133,7 @@ function handleFailedRender(detail, asJson) {
207948
208133
  }
207949
208134
  function resolveOutputPath2(output, renderId, format) {
207950
208135
  if (output) {
207951
- return isAbsolute17(output) ? output : resolvePath4(process.cwd(), output);
208136
+ return isAbsolute18(output) ? output : resolvePath4(process.cwd(), output);
207952
208137
  }
207953
208138
  const ext = FORMAT_EXT2[format] ?? `.${format}`;
207954
208139
  return resolvePath4(process.cwd(), "renders", `${renderId}${ext}`);
@@ -208909,7 +209094,7 @@ async function collectApiKey(inline) {
208909
209094
  return await promptForKey();
208910
209095
  }
208911
209096
  async function readAllWithTimeout(stream, timeoutMs) {
208912
- return await new Promise((resolve78, reject2) => {
209097
+ return await new Promise((resolve79, reject2) => {
208913
209098
  const chunks = [];
208914
209099
  const timer = setTimeout(() => {
208915
209100
  reject2(new Error(`Timed out waiting for stdin (${timeoutMs}ms). Pipe the key explicitly.`));
@@ -208919,7 +209104,7 @@ async function readAllWithTimeout(stream, timeoutMs) {
208919
209104
  });
208920
209105
  stream.on("end", () => {
208921
209106
  clearTimeout(timer);
208922
- resolve78(Buffer.concat(chunks).toString("utf8"));
209107
+ resolve79(Buffer.concat(chunks).toString("utf8"));
208923
209108
  });
208924
209109
  stream.on("error", (err) => {
208925
209110
  clearTimeout(timer);
@@ -209310,8 +209495,8 @@ async function confirmInteractive(prompt) {
209310
209495
  if (!process.stdin.isTTY) return false;
209311
209496
  const { createInterface: createInterface3 } = await import("readline");
209312
209497
  const rl = createInterface3({ input: process.stdin, output: process.stdout });
209313
- const answer = await new Promise((resolve78) => {
209314
- rl.question(prompt, (line2) => resolve78(line2));
209498
+ const answer = await new Promise((resolve79) => {
209499
+ rl.question(prompt, (line2) => resolve79(line2));
209315
209500
  });
209316
209501
  rl.close();
209317
209502
  return /^y(es)?$/i.test(answer.trim());
@@ -209749,12 +209934,12 @@ var init_freeze = __esm({
209749
209934
  });
209750
209935
 
209751
209936
  // ../core/dist/figma/jsonl.js
209752
- import { existsSync as existsSync126, readFileSync as readFileSync91 } from "fs";
209937
+ import { existsSync as existsSync126, readFileSync as readFileSync93 } from "fs";
209753
209938
  function readJsonlValues(path2) {
209754
209939
  if (!existsSync126(path2))
209755
209940
  return [];
209756
209941
  const out = [];
209757
- for (const line2 of readFileSync91(path2, "utf8").split(/\r?\n/)) {
209942
+ for (const line2 of readFileSync93(path2, "utf8").split(/\r?\n/)) {
209758
209943
  const trimmed = line2.trim();
209759
209944
  if (trimmed.length === 0)
209760
209945
  continue;
@@ -209773,7 +209958,7 @@ var init_jsonl = __esm({
209773
209958
  });
209774
209959
 
209775
209960
  // ../core/dist/figma/manifest.js
209776
- import { appendFileSync as appendFileSync2, existsSync as existsSync127, mkdirSync as mkdirSync66, readFileSync as readFileSync93, writeFileSync as writeFileSync60 } from "fs";
209961
+ import { appendFileSync as appendFileSync2, existsSync as existsSync127, mkdirSync as mkdirSync66, readFileSync as readFileSync94, writeFileSync as writeFileSync60 } from "fs";
209777
209962
  import { join as join134 } from "path";
209778
209963
  function mediaDir(projectDir) {
209779
209964
  return join134(projectDir, ".media");
@@ -209814,7 +209999,7 @@ function findAllByFigmaNode(projectDir, fileKey2, nodeId) {
209814
209999
  }
209815
210000
  function updateRecord(projectDir, record) {
209816
210001
  const p2 = manifestPath(projectDir);
209817
- const lines = readFileSync93(p2, "utf8").split(/\r?\n/);
210002
+ const lines = readFileSync94(p2, "utf8").split(/\r?\n/);
209818
210003
  const out = lines.map((line2) => {
209819
210004
  const trimmed = line2.trim();
209820
210005
  if (trimmed.length === 0)
@@ -209835,7 +210020,7 @@ function nextId(projectDir, type) {
209835
210020
  const p2 = manifestPath(projectDir);
209836
210021
  if (!existsSync127(p2))
209837
210022
  return `${type}_001`;
209838
- for (const line2 of readFileSync93(p2, "utf8").split(/\r?\n/)) {
210023
+ for (const line2 of readFileSync94(p2, "utf8").split(/\r?\n/)) {
209839
210024
  const trimmed = line2.trim();
209840
210025
  if (trimmed.length === 0)
209841
210026
  continue;
@@ -210589,7 +210774,7 @@ __export(asset_exports, {
210589
210774
  runAssetImportMany: () => runAssetImportMany
210590
210775
  });
210591
210776
  import { existsSync as existsSync128 } from "fs";
210592
- import { join as join137, relative as relative29 } from "path";
210777
+ import { join as join137, relative as relative30 } from "path";
210593
210778
  function gatherAssetRefs(positionals) {
210594
210779
  return positionals.flatMap((r2) => /^https?:/i.test(r2.trim()) ? [r2] : r2.split(",")).map((r2) => r2.trim()).filter((r2) => r2.length > 0);
210595
210780
  }
@@ -210631,7 +210816,7 @@ async function freezeAndRecord(fileKey2, nodeId, url, ext, opts, version2, deps,
210631
210816
  const record = {
210632
210817
  id,
210633
210818
  type: "image",
210634
- path: relative29(deps.projectDir, destAbs),
210819
+ path: relative30(deps.projectDir, destAbs),
210635
210820
  source: `figma:${fileKey2}/${nodeId}`,
210636
210821
  ...description !== void 0 && { description },
210637
210822
  ...entity !== void 0 && { entity },
@@ -210875,7 +211060,7 @@ __export(component_exports, {
210875
211060
  runComponentImport: () => runComponentImport
210876
211061
  });
210877
211062
  import { existsSync as existsSync129, mkdirSync as mkdirSync69, writeFileSync as writeFileSync65 } from "fs";
210878
- import { join as join139, relative as relative30 } from "path";
211063
+ import { join as join139, relative as relative31 } from "path";
210879
211064
  function escapeAttr2(value) {
210880
211065
  return value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
210881
211066
  }
@@ -210925,7 +211110,7 @@ async function runComponentImport(refInput, deps) {
210925
211110
  );
210926
211111
  return {
210927
211112
  name,
210928
- htmlPath: relative30(deps.projectDir, htmlFile),
211113
+ htmlPath: relative31(deps.projectDir, htmlFile),
210929
211114
  unresolved: bindings.unresolved,
210930
211115
  rasterized: mapped.rasterize,
210931
211116
  failedRasterize
@@ -210945,7 +211130,7 @@ async function rasterizeFallback(mapped, fileKey2, componentDir, deps) {
210945
211130
  continue;
210946
211131
  }
210947
211132
  frozenAssets.push(asset.record.path);
210948
- const srcRel = relative30(componentDir, join139(deps.projectDir, asset.record.path)).replaceAll(
211133
+ const srcRel = relative31(componentDir, join139(deps.projectDir, asset.record.path)).replaceAll(
210949
211134
  "\\",
210950
211135
  "/"
210951
211136
  );
@@ -211566,10 +211751,10 @@ if (rootVersionRequested) {
211566
211751
  process.exit(0);
211567
211752
  }
211568
211753
  try {
211569
- const { readFileSync: readFileSync94 } = await import("fs");
211570
- const { resolve: resolve78 } = await import("path");
211571
- const envPath = resolve78(process.cwd(), ".env");
211572
- const envContent = readFileSync94(envPath, "utf-8");
211754
+ const { readFileSync: readFileSync95 } = await import("fs");
211755
+ const { resolve: resolve79 } = await import("path");
211756
+ const envPath = resolve79(process.cwd(), ".env");
211757
+ const envContent = readFileSync95(envPath, "utf-8");
211573
211758
  for (const rawLine of envContent.split("\n")) {
211574
211759
  let line2 = rawLine.trim();
211575
211760
  if (!line2 || line2.startsWith("#")) continue;