hyperframes 0.8.13 → 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.13" : "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"() {
@@ -99287,7 +99382,7 @@ function hasGit2() {
99287
99382
  }
99288
99383
  function spawnNpx(args, opts = {}) {
99289
99384
  const npx = buildNpxCommand(args);
99290
- return new Promise((resolve78, reject2) => {
99385
+ return new Promise((resolve79, reject2) => {
99291
99386
  const child = spawn6(npx.command, npx.args, {
99292
99387
  // Route the child's stdout to the parent's stderr (fd 2), keeping stdin
99293
99388
  // inherited. `skills update --json` runs this installer before printing its
@@ -99316,7 +99411,7 @@ function spawnNpx(args, opts = {}) {
99316
99411
  }
99317
99412
  });
99318
99413
  child.on("close", (code, signal) => {
99319
- if (code === 0) resolve78();
99414
+ if (code === 0) resolve79();
99320
99415
  else if (signal === "SIGINT" || code === 130)
99321
99416
  reject2(new CliResultSignal({ exitCode: 0, kind: "success", presented: true }));
99322
99417
  else reject2(new Error(`npx ${args.join(" ")} exited with code ${code}`));
@@ -115032,7 +115127,7 @@ function isErrno(err, code) {
115032
115127
  return err.code === code;
115033
115128
  }
115034
115129
  function sleep(ms) {
115035
- return new Promise((resolve78) => setTimeout(resolve78, ms));
115130
+ return new Promise((resolve79) => setTimeout(resolve79, ms));
115036
115131
  }
115037
115132
  function tryAcquireDirLock(lockDir) {
115038
115133
  try {
@@ -116328,10 +116423,10 @@ function createFileServer2(options) {
116328
116423
  }
116329
116424
  });
116330
116425
  });
116331
- return new Promise((resolve78) => {
116426
+ return new Promise((resolve79) => {
116332
116427
  const connections = /* @__PURE__ */ new Set();
116333
116428
  const server = serve2({ fetch: app.fetch, port, hostname: "127.0.0.1" }, (info) => {
116334
- resolve78({
116429
+ resolve79({
116335
116430
  url: `http://localhost:${info.port}`,
116336
116431
  port: info.port,
116337
116432
  addPreHeadScript: (script) => {
@@ -118971,9 +119066,9 @@ var require_compress_binding = __commonJS({
118971
119066
  });
118972
119067
  } else {
118973
119068
  if (readAsync) {
118974
- return new Promise(function(resolve78, reject2) {
119069
+ return new Promise(function(resolve79, reject2) {
118975
119070
  readAsync(wasmBinaryFile, function(response) {
118976
- resolve78(new Uint8Array(response));
119071
+ resolve79(new Uint8Array(response));
118977
119072
  }, reject2);
118978
119073
  });
118979
119074
  }
@@ -120007,8 +120102,8 @@ var require_compress = __commonJS({
120007
120102
  "../../node_modules/.bun/wawoff2@2.0.1/node_modules/wawoff2/compress.js"(exports, module) {
120008
120103
  "use strict";
120009
120104
  var em_module = require_compress_binding();
120010
- var runtimeInit = new Promise((resolve78) => {
120011
- em_module.onRuntimeInitialized = resolve78;
120105
+ var runtimeInit = new Promise((resolve79) => {
120106
+ em_module.onRuntimeInitialized = resolve79;
120012
120107
  });
120013
120108
  module.exports = async function compress2(buffer) {
120014
120109
  await runtimeInit;
@@ -120527,9 +120622,9 @@ var require_decompress_binding = __commonJS({
120527
120622
  });
120528
120623
  } else {
120529
120624
  if (readAsync) {
120530
- return new Promise(function(resolve78, reject2) {
120625
+ return new Promise(function(resolve79, reject2) {
120531
120626
  readAsync(wasmBinaryFile, function(response) {
120532
- resolve78(new Uint8Array(response));
120627
+ resolve79(new Uint8Array(response));
120533
120628
  }, reject2);
120534
120629
  });
120535
120630
  }
@@ -121544,8 +121639,8 @@ var require_decompress = __commonJS({
121544
121639
  "../../node_modules/.bun/wawoff2@2.0.1/node_modules/wawoff2/decompress.js"(exports, module) {
121545
121640
  "use strict";
121546
121641
  var em_module = require_decompress_binding();
121547
- var runtimeInit = new Promise((resolve78) => {
121548
- em_module.onRuntimeInitialized = resolve78;
121642
+ var runtimeInit = new Promise((resolve79) => {
121643
+ em_module.onRuntimeInitialized = resolve79;
121549
121644
  });
121550
121645
  module.exports = async function decompress(buffer) {
121551
121646
  await runtimeInit;
@@ -122132,10 +122227,10 @@ function throwIfCallerAborted(signal) {
122132
122227
  async function waitForFontFetchRetry(delayMs, signal) {
122133
122228
  throwIfCallerAborted(signal);
122134
122229
  if (delayMs <= 0) return;
122135
- await new Promise((resolve78, reject2) => {
122230
+ await new Promise((resolve79, reject2) => {
122136
122231
  const timeout = setTimeout(() => {
122137
122232
  signal?.removeEventListener("abort", onAbort);
122138
- resolve78();
122233
+ resolve79();
122139
122234
  }, delayMs);
122140
122235
  const onAbort = () => {
122141
122236
  clearTimeout(timeout);
@@ -122858,10 +122953,10 @@ var init_semaphore = __esm({
122858
122953
  this.active++;
122859
122954
  return () => this.release();
122860
122955
  }
122861
- return new Promise((resolve78) => {
122956
+ return new Promise((resolve79) => {
122862
122957
  this.queue.push(() => {
122863
122958
  this.active++;
122864
- resolve78(() => this.release());
122959
+ resolve79(() => this.release());
122865
122960
  });
122866
122961
  });
122867
122962
  }
@@ -126890,7 +126985,7 @@ function resolveDeStallTimeoutMs() {
126890
126985
  return Number.isFinite(parsed) && parsed > 0 ? parsed : DEFAULT_DE_STALL_MS;
126891
126986
  }
126892
126987
  function raceAgainstStall(promise, deadlineMs, message, signal) {
126893
- return new Promise((resolve78, reject2) => {
126988
+ return new Promise((resolve79, reject2) => {
126894
126989
  const timer = setTimeout(
126895
126990
  () => {
126896
126991
  reject2(
@@ -126904,7 +126999,7 @@ function raceAgainstStall(promise, deadlineMs, message, signal) {
126904
126999
  promise.then(
126905
127000
  (value) => {
126906
127001
  clearTimeout(timer);
126907
- resolve78(value);
127002
+ resolve79(value);
126908
127003
  },
126909
127004
  (error) => {
126910
127005
  clearTimeout(timer);
@@ -127789,8 +127884,8 @@ async function createShaderTransitionWorkerPool(opts) {
127789
127884
  if (terminated) {
127790
127885
  throw new Error("shader-blend pool already terminated");
127791
127886
  }
127792
- return new Promise((resolve78, reject2) => {
127793
- 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 };
127794
127889
  const idle = slots.find((s2) => !s2.busy && !s2.dead);
127795
127890
  if (idle) {
127796
127891
  queue.unshift(task);
@@ -131691,12 +131786,12 @@ async function startHealthWorker(options = {}) {
131691
131786
  stdout: false,
131692
131787
  stderr: false
131693
131788
  });
131694
- await new Promise((resolve78, reject2) => {
131789
+ await new Promise((resolve79, reject2) => {
131695
131790
  const onMessage = (msg) => {
131696
131791
  if (msg?.type === "listening") {
131697
131792
  worker.off("error", onError);
131698
131793
  worker.off("message", onMessage);
131699
- resolve78();
131794
+ resolve79();
131700
131795
  } else if (msg?.type === "listen-error") {
131701
131796
  worker.off("error", onError);
131702
131797
  worker.off("message", onMessage);
@@ -136068,12 +136163,12 @@ async function runPipeline(options, session, media, format, bgFormat, ffmpegPath
136068
136163
  const drains = [];
136069
136164
  if (!fgWroteFully) {
136070
136165
  drains.push(
136071
- new Promise((resolve78) => fg.proc.stdin.once("drain", () => resolve78()))
136166
+ new Promise((resolve79) => fg.proc.stdin.once("drain", () => resolve79()))
136072
136167
  );
136073
136168
  }
136074
136169
  if (!bgWroteFully && bg) {
136075
136170
  drains.push(
136076
- new Promise((resolve78) => bg.proc.stdin.once("drain", () => resolve78()))
136171
+ new Promise((resolve79) => bg.proc.stdin.once("drain", () => resolve79()))
136077
136172
  );
136078
136173
  }
136079
136174
  await Promise.all(drains);
@@ -136106,11 +136201,11 @@ ${decoder.getStderr().slice(-400)}`
136106
136201
  return processed;
136107
136202
  }
136108
136203
  function waitForExit(proc, label2, getStderr) {
136109
- return new Promise((resolve78, reject2) => {
136204
+ return new Promise((resolve79, reject2) => {
136110
136205
  proc.on("error", reject2);
136111
136206
  proc.on("exit", (code, signal) => {
136112
136207
  if (code === 0 && !signal) {
136113
- resolve78();
136208
+ resolve79();
136114
136209
  return;
136115
136210
  }
136116
136211
  const cause = signal ? `killed by ${signal}` : `exited with code ${code}`;
@@ -139383,6 +139478,10 @@ function variableValuesAttribute(values) {
139383
139478
  const json = JSON.stringify(values).replace(/'/g, "&#39;");
139384
139479
  return ` data-variable-values='${json}'`;
139385
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
+ }
139386
139485
  function buildSnippet(item, relativeTarget, values = null) {
139387
139486
  if (item.type === "hyperframes:block") {
139388
139487
  const dims = "dimensions" in item && item.dimensions ? ` data-width="${item.dimensions.width}" data-height="${item.dimensions.height}"` : "";
@@ -139502,9 +139601,16 @@ async function runAdd(opts) {
139502
139601
  requested: planItem.name === item.name
139503
139602
  });
139504
139603
  }
139604
+ recordProjectRegistryItems(
139605
+ projectDir,
139606
+ installPlan.map((planItem) => ({
139607
+ name: planItem.name,
139608
+ type: planItem.type,
139609
+ target: primaryInstalledTarget(planItem)
139610
+ }))
139611
+ );
139505
139612
  const itemForInstall = installPlan[installPlan.length - 1];
139506
- const primaryFile = itemForInstall.files.find((f3) => f3.type === "hyperframes:snippet") ?? itemForInstall.files.find((f3) => f3.type === "hyperframes:composition") ?? itemForInstall.files[0];
139507
- const snippetTargetRel = primaryFile?.target ?? "";
139613
+ const snippetTargetRel = primaryInstalledTarget(itemForInstall);
139508
139614
  const snippet = buildSnippet(item, snippetTargetRel, variableValues);
139509
139615
  const clipboardCopied = !opts.skipClipboard && snippet ? copyToClipboard(snippet) : false;
139510
139616
  for (const { id, reason } of variablesInvalid) {
@@ -141912,8 +142018,8 @@ async function startLoopback(opts) {
141912
142018
  const timeoutMs = opts.timeoutMs ?? DEFAULT_TIMEOUT_MS;
141913
142019
  let resolveResult;
141914
142020
  let rejectResult;
141915
- const result = new Promise((resolve78, reject2) => {
141916
- resolveResult = resolve78;
142021
+ const result = new Promise((resolve79, reject2) => {
142022
+ resolveResult = resolve79;
141917
142023
  rejectResult = reject2;
141918
142024
  });
141919
142025
  let redirectUri = "";
@@ -141929,7 +142035,7 @@ async function startLoopback(opts) {
141929
142035
  closed = true;
141930
142036
  clearTimeout(timer);
141931
142037
  server.closeAllConnections?.();
141932
- await new Promise((resolve78) => server.close(() => resolve78()));
142038
+ await new Promise((resolve79) => server.close(() => resolve79()));
141933
142039
  };
141934
142040
  const timer = setTimeout(() => {
141935
142041
  rejectResult(new Error(`OAuth callback timed out after ${timeoutMs}ms`));
@@ -141940,11 +142046,11 @@ async function startLoopback(opts) {
141940
142046
  return { result, redirectUri, close };
141941
142047
  }
141942
142048
  async function listen(server, port) {
141943
- await new Promise((resolve78, reject2) => {
142049
+ await new Promise((resolve79, reject2) => {
141944
142050
  server.once("error", reject2);
141945
142051
  server.listen(port, "127.0.0.1", () => {
141946
142052
  server.off("error", reject2);
141947
- resolve78();
142053
+ resolve79();
141948
142054
  });
141949
142055
  });
141950
142056
  }
@@ -142131,7 +142237,7 @@ async function startDeviceAuthorizationFlow(opts = {}) {
142131
142237
  const runtime = {
142132
142238
  clientId: resolveClientId(),
142133
142239
  fetchImpl: opts.fetchImpl ?? fetch,
142134
- sleepImpl: opts.sleepImpl ?? ((ms) => new Promise((resolve78) => setTimeout(resolve78, ms))),
142240
+ sleepImpl: opts.sleepImpl ?? ((ms) => new Promise((resolve79) => setTimeout(resolve79, ms))),
142135
142241
  now: opts.now ?? Date.now,
142136
142242
  requestTimeoutMs: opts.requestTimeoutMs ?? DEVICE_REQUEST_TIMEOUT_MS
142137
142243
  };
@@ -142825,7 +142931,7 @@ function isRequestTimeout(error) {
142825
142931
  return error instanceof DOMException && (error.name === "TimeoutError" || error.name === "AbortError");
142826
142932
  }
142827
142933
  function waitBeforePublishRetry() {
142828
- return new Promise((resolve78) => setTimeout(resolve78, PUBLISH_RETRY_DELAY_MS));
142934
+ return new Promise((resolve79) => setTimeout(resolve79, PUBLISH_RETRY_DELAY_MS));
142829
142935
  }
142830
142936
  async function fetchForPublish(input2, createInit, failureStage, attempts = 1) {
142831
142937
  if (attempts < 1) throw new RangeError("Publish fetch attempts must be at least 1");
@@ -143526,9 +143632,78 @@ var init_publish = __esm({
143526
143632
  }
143527
143633
  });
143528
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
+
143529
143704
  // src/commands/render/plan.ts
143530
143705
  import { statSync as statSync28 } from "fs";
143531
- 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";
143532
143707
  function formatFpsParseError(input2, reason) {
143533
143708
  switch (reason) {
143534
143709
  case "empty":
@@ -143561,7 +143736,7 @@ function createRenderPlan(args, now = /* @__PURE__ */ new Date()) {
143561
143736
  const hasExplicitComposition = hasExplicitCompositionArg(args.composition);
143562
143737
  const project = resolveProject(args.dir, { requireIndex: !hasExplicitComposition });
143563
143738
  const entryFile = resolveCompositionEntryArg(args.composition, project.dir, statSync28);
143564
- const renderTarget = entryFile ? resolve51(project.dir, entryFile) : project.indexPath;
143739
+ const renderTarget = entryFile ? resolve52(project.dir, entryFile) : project.indexPath;
143565
143740
  const fpsArg = resolveDefaultFpsArg(args.fps, project.dir, project.indexPath, entryFile);
143566
143741
  const fpsParse = parseFps(fpsArg ?? "30");
143567
143742
  if (!fpsParse.ok) {
@@ -143578,6 +143753,7 @@ function createRenderPlan(args, now = /* @__PURE__ */ new Date()) {
143578
143753
  const flagSkill = normalizeSkillSlug(args.skill);
143579
143754
  const authoringSkill = flagSkill ?? loadProjectConfig(project.dir).authoringSkill;
143580
143755
  const invalidAuthoringSkill = typeof args.skill === "string" && args.skill.trim() !== "" && !flagSkill ? args.skill : void 0;
143756
+ const catalogUsage = summarizeCatalogUsage(project.dir, renderTarget);
143581
143757
  const formatRaw = args.format ?? "mp4";
143582
143758
  const format = parseRenderFormat(formatRaw);
143583
143759
  if (!format) {
@@ -143657,7 +143833,7 @@ function createRenderPlan(args, now = /* @__PURE__ */ new Date()) {
143657
143833
  const raw = args["frames-cache-dir"].trim();
143658
143834
  const normalized2 = raw.toLowerCase();
143659
143835
  const isDisableAlias = EXTRACT_CACHE_DIR_DISABLED_ALIASES.includes(normalized2);
143660
- environment.HYPERFRAMES_EXTRACT_CACHE_DIR = isDisableAlias ? raw : resolve51(raw);
143836
+ environment.HYPERFRAMES_EXTRACT_CACHE_DIR = isDisableAlias ? raw : resolve52(raw);
143661
143837
  }
143662
143838
  if (args["max-concurrent-renders"] != null) {
143663
143839
  const parsed = positiveInteger(
@@ -143695,11 +143871,11 @@ function createRenderPlan(args, now = /* @__PURE__ */ new Date()) {
143695
143871
  "Invalid batch-concurrency",
143696
143872
  `Got "${args["batch-concurrency"]}". Must be a positive integer.`
143697
143873
  ) : 1;
143698
- const rendersDir = resolve51("renders");
143874
+ const rendersDir = resolve52("renders");
143699
143875
  const ext = FORMAT_EXT[format];
143700
143876
  const timestamp = formatRenderOutputTimestamp(now);
143701
143877
  const batchOutputTemplate = args.output ? args.output : join89(rendersDir, `${project.name}_${timestamp}_{index}${ext}`);
143702
- 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}`);
143703
143879
  const useDocker = args.docker ?? false;
143704
143880
  const useGpu = args.gpu ?? false;
143705
143881
  const browserGpuMode = resolveBrowserGpuForCli(useDocker, args["browser-gpu"]);
@@ -143751,6 +143927,7 @@ function createRenderPlan(args, now = /* @__PURE__ */ new Date()) {
143751
143927
  quality,
143752
143928
  authoringSkill,
143753
143929
  invalidAuthoringSkill,
143930
+ catalogUsage,
143754
143931
  format,
143755
143932
  gifLoop,
143756
143933
  gifFpsCapped,
@@ -143814,6 +143991,7 @@ var init_plan2 = __esm({
143814
143991
  init_renderArgs();
143815
143992
  init_skill();
143816
143993
  init_projectConfig();
143994
+ init_catalogUsage();
143817
143995
  VALID_QUALITY = /* @__PURE__ */ new Set(["draft", "standard", "high"]);
143818
143996
  RENDER_FORMATS = ["mp4", "webm", "mov", "png-sequence", "gif"];
143819
143997
  VALID_FORMAT = new Set(RENDER_FORMATS);
@@ -143830,7 +144008,7 @@ var init_plan2 = __esm({
143830
144008
 
143831
144009
  // src/commands/render/present.ts
143832
144010
  import { cpus as cpus5 } from "os";
143833
- import { readFileSync as readFileSync54 } from "fs";
144011
+ import { readFileSync as readFileSync55 } from "fs";
143834
144012
  async function presentRenderPlan(plan2) {
143835
144013
  await presentRenderWarnings(plan2);
143836
144014
  if (plan2.effectiveQuiet || plan2.batchPath) return;
@@ -143873,7 +144051,7 @@ function presentRenderSummary(plan2) {
143873
144051
  async function warnForSlideshow(plan2) {
143874
144052
  try {
143875
144053
  const { slideshowIslandRegex: slideshowIslandRegex2 } = await Promise.resolve().then(() => (init_slideshow2(), slideshow_exports));
143876
- if (!slideshowIslandRegex2("i").test(readFileSync54(plan2.renderTarget, "utf8"))) return;
144054
+ if (!slideshowIslandRegex2("i").test(readFileSync55(plan2.renderTarget, "utf8"))) return;
143877
144055
  console.log(
143878
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."
143879
144057
  );
@@ -143890,9 +144068,9 @@ var init_present2 = __esm({
143890
144068
  });
143891
144069
 
143892
144070
  // src/utils/variables.ts
143893
- import { readFileSync as readFileSync55 } from "fs";
143894
- import { resolve as resolve52 } from "path";
143895
- 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")) {
143896
144074
  if (inline != null && filePath != null) {
143897
144075
  return { ok: false, error: { kind: "conflict" } };
143898
144076
  }
@@ -143975,7 +144153,7 @@ function validateVariablesAgainstProject(indexPath2, values) {
143975
144153
  function loadProjectVariableSchema(indexPath2) {
143976
144154
  let html;
143977
144155
  try {
143978
- html = readFileSync55(indexPath2, "utf8");
144156
+ html = readFileSync56(indexPath2, "utf8");
143979
144157
  } catch {
143980
144158
  return [];
143981
144159
  }
@@ -144030,8 +144208,8 @@ __export(batchRender_exports, {
144030
144208
  resolveOutputTemplate: () => resolveOutputTemplate,
144031
144209
  runBatchRender: () => runBatchRender
144032
144210
  });
144033
- import { mkdirSync as mkdirSync43, readFileSync as readFileSync56, writeFileSync as writeFileSync31 } from "fs";
144034
- 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";
144035
144213
  function isRecord10(value) {
144036
144214
  return value !== null && typeof value === "object" && !Array.isArray(value);
144037
144215
  }
@@ -144092,7 +144270,7 @@ function isSameOrChildPath(path2, parent) {
144092
144270
  }
144093
144271
  function commonOutputDirectory(outputPaths) {
144094
144272
  const firstPath = outputPaths[0];
144095
- if (!firstPath) return resolve53("renders");
144273
+ if (!firstPath) return resolve54("renders");
144096
144274
  let common = dirname40(firstPath);
144097
144275
  for (const outputPath of outputPaths.slice(1)) {
144098
144276
  const dir = dirname40(outputPath);
@@ -144155,8 +144333,8 @@ function reportBatchVariableIssues(row, index, schema, quiet, json) {
144155
144333
  return issues.length;
144156
144334
  }
144157
144335
  function prepareBatchRender(options) {
144158
- const batchPath = resolve53(options.batchPath);
144159
- const read = options.readFile ?? ((path2) => readFileSync56(path2, "utf8"));
144336
+ const batchPath = resolve54(options.batchPath);
144337
+ const read = options.readFile ?? ((path2) => readFileSync57(path2, "utf8"));
144160
144338
  let raw;
144161
144339
  try {
144162
144340
  raw = read(batchPath);
@@ -144170,7 +144348,7 @@ function prepareBatchRender(options) {
144170
144348
  const rows = variableRows.map((variables, index) => ({
144171
144349
  index,
144172
144350
  variables,
144173
- outputPath: resolve53(resolveOutputTemplate(options.outputTemplate, variables, index))
144351
+ outputPath: resolve54(resolveOutputTemplate(options.outputTemplate, variables, index))
144174
144352
  }));
144175
144353
  const manifestPath2 = join90(
144176
144354
  commonOutputDirectory(rows.map((row) => row.outputPath)),
@@ -144352,7 +144530,7 @@ var init_batchRender = __esm({
144352
144530
  });
144353
144531
 
144354
144532
  // src/commands/render/execute.ts
144355
- import { mkdirSync as mkdirSync44, readFileSync as readFileSync57 } from "fs";
144533
+ import { mkdirSync as mkdirSync44, readFileSync as readFileSync58 } from "fs";
144356
144534
  function renderLintContinuationHint(strictErrors) {
144357
144535
  return strictErrors ? " Continuing render despite lint warnings. Use --strict-all to block warnings." : " Continuing render despite lint issues. Use --strict to block errors.";
144358
144536
  }
@@ -144395,6 +144573,7 @@ async function executeRenderPlan(plan2, dependencies) {
144395
144573
  fps: plan2.fps,
144396
144574
  quality: plan2.quality,
144397
144575
  authoringSkill: plan2.authoringSkill,
144576
+ catalogUsage: plan2.catalogUsage,
144398
144577
  format: plan2.format,
144399
144578
  gifLoop: plan2.gifLoop,
144400
144579
  workers: plan2.workers,
@@ -144495,7 +144674,7 @@ async function runResolutionPreflight(plan2, checkResolution) {
144495
144674
  if (!plan2.outputResolution) return;
144496
144675
  let issue;
144497
144676
  try {
144498
- issue = await checkResolution(readFileSync57(plan2.renderTarget, "utf8"), plan2.outputResolution, {
144677
+ issue = await checkResolution(readFileSync58(plan2.renderTarget, "utf8"), plan2.outputResolution, {
144499
144678
  alphaRequested: plan2.format === "webm" || plan2.format === "mov" || plan2.format === "png-sequence",
144500
144679
  hdrRequested: plan2.hdrMode === "force-hdr",
144501
144680
  aspectAgnostic: plan2.outputResolutionAspectAgnostic
@@ -144513,6 +144692,7 @@ async function executeBatchRender(plan2, browserPath, batchModule, preparedBatch
144513
144692
  fps: plan2.fps,
144514
144693
  quality: plan2.quality,
144515
144694
  authoringSkill: plan2.authoringSkill,
144695
+ catalogUsage: plan2.catalogUsage,
144516
144696
  format: plan2.format,
144517
144697
  workers: plan2.workers,
144518
144698
  gpu: plan2.useGpu,
@@ -144792,18 +144972,18 @@ async function getDoctorSummary() {
144792
144972
  }
144793
144973
  }
144794
144974
  function askQuestion(prompt) {
144795
- return new Promise((resolve78) => {
144975
+ return new Promise((resolve79) => {
144796
144976
  const rl = readline.createInterface({
144797
144977
  input: process.stdin,
144798
144978
  output: process.stdout
144799
144979
  });
144800
144980
  rl.question(prompt, (answer) => {
144801
144981
  rl.close();
144802
- resolve78(answer);
144982
+ resolve79(answer);
144803
144983
  });
144804
144984
  const timeout = setTimeout(() => {
144805
144985
  rl.close();
144806
- resolve78("");
144986
+ resolve79("");
144807
144987
  }, 1e4);
144808
144988
  if (typeof timeout === "object" && timeout !== null && "unref" in timeout) {
144809
144989
  timeout.unref();
@@ -144965,9 +145145,9 @@ __export(render_exports, {
144965
145145
  resolveBrowserGpuForCli: () => resolveBrowserGpuForCli,
144966
145146
  runRenderLint: () => runRenderLint
144967
145147
  });
144968
- 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";
144969
145149
  import { freemem as freemem5, tmpdir as tmpdir13 } from "os";
144970
- 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";
144971
145151
  import { execFileSync as execFileSync12, spawn as spawn15 } from "child_process";
144972
145152
  async function readCompositionDimensions(compositionHtml) {
144973
145153
  try {
@@ -145001,8 +145181,8 @@ function dockerImageTag(version2) {
145001
145181
  return `${DOCKER_IMAGE_PREFIX}:${version2}`;
145002
145182
  }
145003
145183
  function resolveDockerfilePath() {
145004
- const builtPath = resolve54(__dirname, "docker", "Dockerfile.render");
145005
- 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");
145006
145186
  for (const p2 of [builtPath, devPath]) {
145007
145187
  try {
145008
145188
  statSync29(p2);
@@ -145034,7 +145214,7 @@ function ensureDockerImage(version2, platform11, quiet) {
145034
145214
  if (!quiet) console.log(c.dim(` Building Docker image: ${tag} (${platform11})...`));
145035
145215
  const dockerfilePath = resolveDockerfilePath();
145036
145216
  const tmpDir = mkdtempSync13(join91(tmpdir13(), "hyperframes-docker-"));
145037
- writeFileSync33(join91(tmpDir, "Dockerfile"), readFileSync58(dockerfilePath));
145217
+ writeFileSync33(join91(tmpDir, "Dockerfile"), readFileSync59(dockerfilePath));
145038
145218
  const targetArch = platform11 === "linux/arm64" ? "arm64" : "amd64";
145039
145219
  try {
145040
145220
  execFileSync12(
@@ -145105,8 +145285,8 @@ async function renderDocker(projectDir, outputPath, options) {
145105
145285
  const outputFilename = basename16(outputPath);
145106
145286
  const dockerArgs = buildDockerRunArgs({
145107
145287
  imageTag,
145108
- projectDir: resolve54(projectDir),
145109
- outputDir: resolve54(outputDir),
145288
+ projectDir: resolve55(projectDir),
145289
+ outputDir: resolve55(outputDir),
145110
145290
  outputFilename,
145111
145291
  platform: platform11,
145112
145292
  options: {
@@ -145166,6 +145346,7 @@ async function renderDocker(projectDir, outputPath, options) {
145166
145346
  docker: true,
145167
145347
  gpu: options.gpu,
145168
145348
  authoringSkill: options.authoringSkill,
145349
+ catalogUsage: options.catalogUsage,
145169
145350
  ...getMemorySnapshot()
145170
145351
  })
145171
145352
  );
@@ -145591,6 +145772,7 @@ function trackRenderMetrics(job, elapsedMs, options, docker) {
145591
145772
  docker,
145592
145773
  gpu: options.gpu,
145593
145774
  authoringSkill: options.authoringSkill,
145775
+ catalogUsage: options.catalogUsage,
145594
145776
  staticDedupEnabled: perf?.staticDedup?.enabled,
145595
145777
  staticDedupArmed: perf?.staticDedup?.armed,
145596
145778
  staticDedupSkipReason: perf?.staticDedup?.skipReason,
@@ -145971,7 +146153,7 @@ var init_render = __esm({
145971
146153
 
145972
146154
  // src/telemetry/lintStreaks.ts
145973
146155
  import { createHash as createHash23 } from "crypto";
145974
- 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";
145975
146157
  import { homedir as homedir19 } from "os";
145976
146158
  import { join as join93 } from "path";
145977
146159
  function emptyState() {
@@ -145979,7 +146161,7 @@ function emptyState() {
145979
146161
  }
145980
146162
  function readState() {
145981
146163
  try {
145982
- const parsed = JSON.parse(readFileSync59(STATE_FILE2, "utf-8"));
146164
+ const parsed = JSON.parse(readFileSync60(STATE_FILE2, "utf-8"));
145983
146165
  if (typeof parsed === "object" && parsed !== null && parsed.version === 1 && typeof parsed.files === "object") {
145984
146166
  return parsed;
145985
146167
  }
@@ -146247,7 +146429,7 @@ __export(staticProjectServer_exports, {
146247
146429
  });
146248
146430
  import { createServer as createServer2 } from "http";
146249
146431
  import { createReadStream as createReadStream7, existsSync as existsSync85, statSync as statSync30 } from "fs";
146250
- 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";
146251
146433
  function serveFileWithRange(filePath, rangeHeader, res, contentType = getMimeType(filePath)) {
146252
146434
  const size = statSync30(filePath).size;
146253
146435
  const headers = {
@@ -146347,9 +146529,9 @@ async function serveStaticProjectHtml(projectDir, html, bindErrorMessage = "Fail
146347
146529
  const proxyRequest = proxyParam !== null && isProxyVariantRequest(proxyParam) ? proxyParam : null;
146348
146530
  const requestPath = decodeURIComponent(pathOnly).replace(/^\//, "");
146349
146531
  for (const root of roots) {
146350
- const filePath = resolve55(root, requestPath);
146351
- const rel = relative20(root, filePath);
146352
- 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;
146353
146535
  if (existsSync85(filePath)) {
146354
146536
  if (proxyRequest) {
146355
146537
  void serveProxyRequest(
@@ -146814,7 +146996,7 @@ var init_motionAudit = __esm({
146814
146996
  });
146815
146997
 
146816
146998
  // src/utils/motionSpec.ts
146817
- 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";
146818
147000
  import { basename as basename17, join as join94 } from "path";
146819
147001
  function isObject2(value) {
146820
147002
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -146876,7 +147058,7 @@ function findMotionSpec(projectDir) {
146876
147058
  function readMotionSpec(path2) {
146877
147059
  let raw;
146878
147060
  try {
146879
- raw = JSON.parse(readFileSync60(path2, "utf-8"));
147061
+ raw = JSON.parse(readFileSync61(path2, "utf-8"));
146880
147062
  } catch (err) {
146881
147063
  return { ok: false, errors: [`could not read ${basename17(path2)}: ${err.message}`] };
146882
147064
  }
@@ -146929,7 +147111,7 @@ __export(layout_exports, {
146929
147111
  loadBrowserScript: () => loadBrowserScript,
146930
147112
  parseAt: () => parseAt
146931
147113
  });
146932
- import { existsSync as existsSync87, readFileSync as readFileSync61 } from "fs";
147114
+ import { existsSync as existsSync87, readFileSync as readFileSync63 } from "fs";
146933
147115
  import { dirname as dirname42, join as join95 } from "path";
146934
147116
  import { fileURLToPath as fileURLToPath11 } from "url";
146935
147117
  function buildMotionSampleTimes(duration) {
@@ -147090,7 +147272,7 @@ async function runLayoutAudit(projectDir, opts) {
147090
147272
  function loadBrowserScript(name) {
147091
147273
  const candidates = [join95(__dirname2, name), join95(__dirname2, "commands", name)];
147092
147274
  for (const candidate of candidates) {
147093
- if (existsSync87(candidate)) return readFileSync61(candidate, "utf-8");
147275
+ if (existsSync87(candidate)) return readFileSync63(candidate, "utf-8");
147094
147276
  }
147095
147277
  throw new Error(`Missing browser script ${name}`);
147096
147278
  }
@@ -147487,7 +147669,7 @@ __export(validate_exports, {
147487
147669
  resolveNavigationTimeoutMs: () => resolveNavigationTimeoutMs,
147488
147670
  shouldIgnoreRequestFailure: () => shouldIgnoreRequestFailure
147489
147671
  });
147490
- 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";
147491
147673
  import { tmpdir as tmpdir14 } from "os";
147492
147674
  import { join as join96, dirname as dirname43 } from "path";
147493
147675
  import { fileURLToPath as fileURLToPath12 } from "url";
@@ -147519,12 +147701,12 @@ async function getCompositionDuration3(page) {
147519
147701
  }
147520
147702
  function raceMediaReady(el, deadlineMs) {
147521
147703
  if (Number.isFinite(el.duration) && el.duration > 0) return Promise.resolve();
147522
- return new Promise((resolve78) => {
147704
+ return new Promise((resolve79) => {
147523
147705
  const onReady = () => {
147524
147706
  el.removeEventListener("loadedmetadata", onReady);
147525
147707
  el.removeEventListener("error", onReady);
147526
147708
  clearTimeout(timer);
147527
- resolve78();
147709
+ resolve79();
147528
147710
  };
147529
147711
  el.addEventListener("loadedmetadata", onReady, { once: true });
147530
147712
  el.addEventListener("error", onReady, { once: true });
@@ -147540,7 +147722,7 @@ async function auditClipDurations(page, analyzeClipMediaFit2, extraWaitMs) {
147540
147722
  await Promise.all(
147541
147723
  nodes.map((el) => {
147542
147724
  if (Number.isFinite(el.duration) && el.duration > 0) return Promise.resolve();
147543
- return new Promise((resolve78) => {
147725
+ return new Promise((resolve79) => {
147544
147726
  const cleanup = () => {
147545
147727
  el.removeEventListener("loadedmetadata", onReady);
147546
147728
  el.removeEventListener("error", onReady);
@@ -147548,7 +147730,7 @@ async function auditClipDurations(page, analyzeClipMediaFit2, extraWaitMs) {
147548
147730
  };
147549
147731
  const onReady = () => {
147550
147732
  cleanup();
147551
- resolve78();
147733
+ resolve79();
147552
147734
  };
147553
147735
  el.addEventListener("loadedmetadata", onReady, { once: true });
147554
147736
  el.addEventListener("error", onReady, { once: true });
@@ -147642,7 +147824,7 @@ function loadContrastAuditScript() {
147642
147824
  join96(__dirname3, "commands", "contrast-audit.browser.js")
147643
147825
  ];
147644
147826
  for (const candidate of candidates) {
147645
- if (existsSync88(candidate)) return readFileSync63(candidate, "utf-8");
147827
+ if (existsSync88(candidate)) return readFileSync64(candidate, "utf-8");
147646
147828
  }
147647
147829
  throw new Error("Missing contrast audit browser script");
147648
147830
  }
@@ -147973,7 +148155,7 @@ __export(checkBrowser_exports, {
147973
148155
  runBrowserCheck: () => runBrowserCheck
147974
148156
  });
147975
148157
  import { mkdirSync as mkdirSync46, writeFileSync as writeFileSync35 } from "fs";
147976
- import { join as join97, resolve as resolve56 } from "path";
148158
+ import { join as join97, resolve as resolve57 } from "path";
147977
148159
  async function preResolveHostileMediaProxies(projectDir, html, autoProxyOverride) {
147978
148160
  if (!resolveAutoProxy(projectDir, autoProxyOverride)) return;
147979
148161
  let codecMap;
@@ -147994,7 +148176,7 @@ async function preResolveHostileMediaProxies(projectDir, html, autoProxyOverride
147994
148176
  hostileEntries.map(
147995
148177
  ([pathname, facts]) => resolveProxy(
147996
148178
  projectDir,
147997
- resolve56(projectDir, pathname.replace(/^\/+/, "")),
148179
+ resolve57(projectDir, pathname.replace(/^\/+/, "")),
147998
148180
  proxyVariantFor(facts)
147999
148181
  )
148000
148182
  )
@@ -148891,7 +149073,7 @@ var init_checkBrowser = __esm({
148891
149073
 
148892
149074
  // src/utils/checkPipeline.ts
148893
149075
  import { mkdirSync as mkdirSync47, writeFileSync as writeFileSync36 } from "fs";
148894
- import { join as join98, relative as relative21 } from "path";
149076
+ import { join as join98, relative as relative23 } from "path";
148895
149077
  function selectContrastTimes(grid) {
148896
149078
  if (grid.length <= 5) return [...grid];
148897
149079
  return Array.from({ length: 5 }, (_, index) => {
@@ -149538,7 +149720,7 @@ async function runCheckPipeline(project, options, dependencies = DEFAULT_DEPENDE
149538
149720
  "motion_spec_invalid",
149539
149721
  "error",
149540
149722
  motion.message,
149541
- relative21(project.dir, motion.path) || "index.motion.json"
149723
+ relative23(project.dir, motion.path) || "index.motion.json"
149542
149724
  );
149543
149725
  return buildReport(options, lint, emptyBrowserResult(), motion, [finding], []);
149544
149726
  }
@@ -150443,7 +150625,7 @@ var init_beats = __esm({
150443
150625
  });
150444
150626
 
150445
150627
  // src/beats/headlessAnalyzer.ts
150446
- import { existsSync as existsSync89, readFileSync as readFileSync64 } from "fs";
150628
+ import { existsSync as existsSync89, readFileSync as readFileSync65 } from "fs";
150447
150629
  import { createRequire as createRequire4 } from "module";
150448
150630
  import { dirname as dirname44, join as join99 } from "path";
150449
150631
  import { fileURLToPath as fileURLToPath13 } from "url";
@@ -150486,7 +150668,7 @@ function buildAnalyzerBundle() {
150486
150668
  if (bundlePromise) return bundlePromise;
150487
150669
  bundlePromise = (async () => {
150488
150670
  const prebuilt = findPrebuiltBundle();
150489
- if (prebuilt) return readFileSync64(prebuilt, "utf8");
150671
+ if (prebuilt) return readFileSync65(prebuilt, "utf8");
150490
150672
  return buildFromCoreSource();
150491
150673
  })().catch((err) => {
150492
150674
  bundlePromise = null;
@@ -150564,14 +150746,14 @@ __export(beats_exports, {
150564
150746
  default: () => beats_default,
150565
150747
  examples: () => examples13
150566
150748
  });
150567
- import { existsSync as existsSync90, readFileSync as readFileSync65, mkdirSync as mkdirSync48, writeFileSync as writeFileSync37 } from "fs";
150568
- 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";
150569
150751
  function fail(message) {
150570
150752
  console.error(c.error(message));
150571
150753
  failCommand();
150572
150754
  }
150573
150755
  function resolveMusicTarget(project) {
150574
- const src = findMusicAudioSrc(readFileSync65(project.indexPath, "utf-8"));
150756
+ const src = findMusicAudioSrc(readFileSync66(project.indexPath, "utf-8"));
150575
150757
  if (!src) {
150576
150758
  fail(
150577
150759
  'No music track found. Add data-timeline-role="music" to the <audio> element (or give it an id like music/bgm/soundtrack).'
@@ -150579,13 +150761,13 @@ function resolveMusicTarget(project) {
150579
150761
  }
150580
150762
  const rel = audioRelPathForSrc(src);
150581
150763
  if (!rel) fail(`Cannot derive a beat-file path for music src: ${src}`);
150582
- const audioPath = resolve57(project.dir, rel);
150764
+ const audioPath = resolve58(project.dir, rel);
150583
150765
  if (!existsSync90(audioPath)) fail(`Audio file not found: ${rel}`);
150584
150766
  return { rel, audioPath };
150585
150767
  }
150586
150768
  async function detect(audioPath) {
150587
150769
  try {
150588
- return await analyzeBeatsHeadless(readFileSync65(audioPath));
150770
+ return await analyzeBeatsHeadless(readFileSync66(audioPath));
150589
150771
  } catch (err) {
150590
150772
  const msg = err instanceof Error ? err.message : String(err);
150591
150773
  const hint2 = /chrome|executable|browser|ENOENT/i.test(msg) ? "\nRun: npx hyperframes browser ensure" : "";
@@ -150658,8 +150840,8 @@ __export(normalize_audio_exports, {
150658
150840
  updateAudioVolume: () => updateAudioVolume
150659
150841
  });
150660
150842
  import { execFile as execFile8 } from "child_process";
150661
- import { existsSync as existsSync91, readFileSync as readFileSync66, renameSync as renameSync15, writeFileSync as writeFileSync38 } from "fs";
150662
- 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";
150663
150845
  import { promisify as promisify6 } from "util";
150664
150846
  function authoredNumber(raw, fallback, attribute2, id, strictlyPositive = false) {
150665
150847
  if (raw === void 0) return fallback;
@@ -150822,12 +151004,12 @@ function resolveLocalAudioPath(projectDir, src) {
150822
151004
  } catch {
150823
151005
  throw new Error(`Audio source must be a local project file: ${src}`);
150824
151006
  }
150825
- 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)) {
150826
151008
  throw new Error(`Audio source must be a local project file: ${src}`);
150827
151009
  }
150828
- const root = resolve58(projectDir);
150829
- const file = resolve58(root, decoded);
150830
- const rel = relative23(root, file);
151010
+ const root = resolve59(projectDir);
151011
+ const file = resolve59(root, decoded);
151012
+ const rel = relative24(root, file);
150831
151013
  if (!rel || rel === ".." || rel.startsWith(`..${process.platform === "win32" ? "\\" : "/"}`)) {
150832
151014
  throw new Error(`Audio source must be a local project file: ${src}`);
150833
151015
  }
@@ -150944,7 +151126,7 @@ function requiredFfmpeg() {
150944
151126
  function existingAudioFile(projectDir, tag) {
150945
151127
  const file = resolveLocalAudioPath(projectDir, tag.src);
150946
151128
  if (!existsSync91(file)) {
150947
- 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)}`);
150948
151130
  }
150949
151131
  return file;
150950
151132
  }
@@ -150975,7 +151157,7 @@ function parsedTolerance(raw) {
150975
151157
  }
150976
151158
  async function normalizeAudio(options) {
150977
151159
  const project = resolveProject(options.dir);
150978
- const html = readFileSync66(project.indexPath, "utf8");
151160
+ const html = readFileSync67(project.indexPath, "utf8");
150979
151161
  const { referenceTag, targetTag } = selectedTags(html, options.reference, options.target);
150980
151162
  const tolerance = parsedTolerance(options.tolerance);
150981
151163
  const plan2 = await measuredPlan(project.dir, referenceTag, targetTag);
@@ -150984,7 +151166,7 @@ async function normalizeAudio(options) {
150984
151166
  if (wrote) {
150985
151167
  writeAtomically(
150986
151168
  project.indexPath,
150987
- updateAudioVolume(readFileSync66(project.indexPath, "utf8"), targetTag.id, plan2.volume)
151169
+ updateAudioVolume(readFileSync67(project.indexPath, "utf8"), targetTag.id, plan2.volume)
150988
151170
  );
150989
151171
  }
150990
151172
  return { ok: true, wrote, withinTolerance, tolerance, indexPath: project.indexPath, ...plan2 };
@@ -151003,7 +151185,7 @@ function printHumanResult(result) {
151003
151185
  `Set #${result.targetId} data-volume ${result.previousVolume.toFixed(3)} \u2192 ${result.volume.toFixed(6)} (${result.changeDb >= 0 ? "+" : ""}${result.changeDb.toFixed(1)} dB).`
151004
151186
  );
151005
151187
  console.log(
151006
- 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.")
151007
151189
  );
151008
151190
  }
151009
151191
  var execFileAsync4, FFMPEG_TIMEOUT_MS, DEFAULT_TOLERANCE_LU, examples14, normalize_audio_default;
@@ -151484,14 +151666,14 @@ function inlineHelper3(call, ctx) {
151484
151666
  };
151485
151667
  return expandBody3(fn.body.body, bindings, prov, ctx);
151486
151668
  }
151487
- function assignStep3(update2, resolve78) {
151488
- if (update2.operator === "+=") return asNum3(resolve78(update2.right));
151669
+ function assignStep3(update2, resolve79) {
151670
+ if (update2.operator === "+=") return asNum3(resolve79(update2.right));
151489
151671
  if (update2.operator === "-=") {
151490
- const s2 = asNum3(resolve78(update2.right));
151672
+ const s2 = asNum3(resolve79(update2.right));
151491
151673
  return s2 === void 0 ? void 0 : -s2;
151492
151674
  }
151493
151675
  if (update2.operator === "=" && update2.right?.type === "BinaryExpression") {
151494
- return asNum3(resolve78(update2.right.right));
151676
+ return asNum3(resolve79(update2.right.right));
151495
151677
  }
151496
151678
  return void 0;
151497
151679
  }
@@ -151500,10 +151682,10 @@ function updatedVarName3(update2) {
151500
151682
  if (update2?.type === "AssignmentExpression") return update2.left?.name ?? null;
151501
151683
  return null;
151502
151684
  }
151503
- function loopStep3(update2, varName, resolve78) {
151685
+ function loopStep3(update2, varName, resolve79) {
151504
151686
  if (updatedVarName3(update2) !== varName) return void 0;
151505
151687
  if (update2.type === "UpdateExpression") return update2.operator === "++" ? 1 : -1;
151506
- return assignStep3(update2, resolve78);
151688
+ return assignStep3(update2, resolve79);
151507
151689
  }
151508
151690
  function asNum3(v2) {
151509
151691
  return typeof v2 === "number" && Number.isFinite(v2) ? v2 : void 0;
@@ -151520,13 +151702,13 @@ function forInitVar3(init) {
151520
151702
  const d2 = init.declarations[0];
151521
151703
  return d2.id?.type === "Identifier" ? { name: d2.id.name, initExpr: d2.init } : null;
151522
151704
  }
151523
- function parseForHeader3(stmt, resolve78) {
151705
+ function parseForHeader3(stmt, resolve79) {
151524
151706
  const iv = forInitVar3(stmt.init);
151525
151707
  const test = stmt.test;
151526
151708
  if (!iv || test?.type !== "BinaryExpression" || test.left?.name !== iv.name) return null;
151527
- const start = asNum3(resolve78(iv.initExpr));
151528
- const end = asNum3(resolve78(test.right));
151529
- 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);
151530
151712
  if (start === void 0 || end === void 0 || !step) return null;
151531
151713
  return { v: iv.name, start, end, op: test.operator, step };
151532
151714
  }
@@ -151638,12 +151820,12 @@ function expandStatements3(stmts, ctx) {
151638
151820
  }
151639
151821
  return out;
151640
151822
  }
151641
- function inlineComputedTimelines3(ast, timelineVar, resolve78) {
151823
+ function inlineComputedTimelines3(ast, timelineVar, resolve79) {
151642
151824
  const helpers = collectInlinableHelpers3(ast, timelineVar);
151643
151825
  const ctx = {
151644
151826
  helpers,
151645
151827
  timelineVar,
151646
- resolve: resolve78,
151828
+ resolve: resolve79,
151647
151829
  depth: 0,
151648
151830
  site: { n: 0 },
151649
151831
  order: { n: 0 }
@@ -153054,13 +153236,13 @@ function applyOrbitCamera(selectors, cam) {
153054
153236
  lens.style.perspectiveOrigin = "50% 50%";
153055
153237
  }
153056
153238
  function compositeGhostFrames(frames, alphas, W2, H3, label2) {
153057
- return new Promise((resolve78) => {
153239
+ return new Promise((resolve79) => {
153058
153240
  const cv = document.createElement("canvas");
153059
153241
  cv.width = W2;
153060
153242
  cv.height = H3;
153061
153243
  const ctx = cv.getContext("2d");
153062
153244
  if (!ctx) {
153063
- resolve78("");
153245
+ resolve79("");
153064
153246
  return;
153065
153247
  }
153066
153248
  ctx.fillStyle = "#000";
@@ -153072,7 +153254,7 @@ function compositeGhostFrames(frames, alphas, W2, H3, label2) {
153072
153254
  ctx.font = "600 22px ui-monospace, SFMono-Regular, Menlo, monospace";
153073
153255
  ctx.fillStyle = "#86c2ff";
153074
153256
  ctx.fillText(label2, 24, 38);
153075
- resolve78(cv.toDataURL("image/png"));
153257
+ resolve79(cv.toDataURL("image/png"));
153076
153258
  return;
153077
153259
  }
153078
153260
  const img = new Image();
@@ -153495,8 +153677,8 @@ __export(keyframes_exports, {
153495
153677
  resolveScope: () => resolveScope,
153496
153678
  surfaceComposition: () => surfaceComposition
153497
153679
  });
153498
- import { existsSync as existsSync93, readFileSync as readFileSync67, statSync as statSync31 } from "fs";
153499
- 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";
153500
153682
  function queryIncludingTemplates(html, selector) {
153501
153683
  const doc = new DOMParser().parseFromString(html, "text/html");
153502
153684
  const roots = [doc];
@@ -153857,7 +154039,7 @@ function groupTraces(tweens) {
153857
154039
  return traces;
153858
154040
  }
153859
154041
  function collectCompositions(indexPath2) {
153860
- const html = readFileSync67(indexPath2, "utf-8");
154042
+ const html = readFileSync68(indexPath2, "utf-8");
153861
154043
  const baseDir = dirname47(indexPath2);
153862
154044
  const out = [
153863
154045
  surfaceComposition(html, basename18(indexPath2), basename18(indexPath2))
@@ -153866,10 +154048,10 @@ function collectCompositions(indexPath2) {
153866
154048
  for (const div of Array.from(doc.querySelectorAll("[data-composition-src]"))) {
153867
154049
  const src = div.getAttribute("data-composition-src");
153868
154050
  if (!src) continue;
153869
- const subPath = resolve59(baseDir, src);
154051
+ const subPath = resolve60(baseDir, src);
153870
154052
  if (!existsSync93(subPath)) continue;
153871
154053
  const id = div.getAttribute("data-composition-id") ?? src;
153872
- out.push(surfaceComposition(readFileSync67(subPath, "utf-8"), id, src));
154054
+ out.push(surfaceComposition(readFileSync68(subPath, "utf-8"), id, src));
153873
154055
  }
153874
154056
  return out;
153875
154057
  }
@@ -153973,7 +154155,7 @@ async function runOnionShot(comps, allComps, projectDir, entryFile, args) {
153973
154155
  console.log(c.dim(guardError));
153974
154156
  return true;
153975
154157
  }
153976
- const saved = await captureMotionPathShot2(projectDir, requests, resolve59(args.shot), {
154158
+ const saved = await captureMotionPathShot2(projectDir, requests, resolve60(args.shot), {
153977
154159
  ...onionShotOptions(args),
153978
154160
  entryFile
153979
154161
  });
@@ -153987,11 +154169,11 @@ function resolveScope(args) {
153987
154169
  let projectDir;
153988
154170
  let entryFile;
153989
154171
  if (raw && raw.endsWith(".html") && existsSync93(raw) && statSync31(raw).isFile()) {
153990
- const entryPath = resolve59(raw);
153991
- comps = [surfaceComposition(readFileSync67(entryPath, "utf-8"), basename18(entryPath), entryPath)];
154172
+ const entryPath = resolve60(raw);
154173
+ comps = [surfaceComposition(readFileSync68(entryPath, "utf-8"), basename18(entryPath), entryPath)];
153992
154174
  projectName = basename18(entryPath);
153993
154175
  projectDir = findProjectRoot(entryPath);
153994
- entryFile = relative24(projectDir, entryPath).split(sep13).join("/");
154176
+ entryFile = relative25(projectDir, entryPath).split(sep13).join("/");
153995
154177
  } else {
153996
154178
  const project = resolveProject(raw);
153997
154179
  comps = collectCompositions(project.indexPath);
@@ -154209,7 +154391,7 @@ __export(info_exports, {
154209
154391
  examples: () => examples17,
154210
154392
  orientation: () => orientation
154211
154393
  });
154212
- 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";
154213
154395
  import { join as join103 } from "path";
154214
154396
  function orientation(width, height) {
154215
154397
  if (width > height) return "landscape";
@@ -154256,7 +154438,7 @@ var init_info = __esm({
154256
154438
  },
154257
154439
  async run({ args }) {
154258
154440
  const project = resolveProject(args.dir);
154259
- const html = readFileSync68(project.indexPath, "utf-8");
154441
+ const html = readFileSync69(project.indexPath, "utf-8");
154260
154442
  ensureDOMParser();
154261
154443
  const parsed = parseHtml(html);
154262
154444
  const tracks = new Set(parsed.elements.map((el) => el.zIndex));
@@ -154316,8 +154498,8 @@ __export(compositions_exports, {
154316
154498
  parseCompositions: () => parseCompositions,
154317
154499
  parseSubComposition: () => parseSubComposition
154318
154500
  });
154319
- import { existsSync as existsSync94, readFileSync as readFileSync69 } from "fs";
154320
- 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";
154321
154503
  function countRenderableDescendants(root) {
154322
154504
  return Array.from(root.querySelectorAll("*")).filter(
154323
154505
  (el) => !NON_RENDERED_TAGS2.has(el.tagName.toLowerCase())
@@ -154395,9 +154577,9 @@ function parseCompositions(html, baseDir) {
154395
154577
  const height = parseInt(div.getAttribute("data-height") ?? "1080", 10);
154396
154578
  const compositionSrc = div.getAttribute("data-composition-src");
154397
154579
  if (compositionSrc) {
154398
- const subPath = resolve60(baseDir, compositionSrc);
154580
+ const subPath = resolve61(baseDir, compositionSrc);
154399
154581
  if (existsSync94(subPath)) {
154400
- const subHtml = readFileSync69(subPath, "utf-8");
154582
+ const subHtml = readFileSync70(subPath, "utf-8");
154401
154583
  const subInfo = parseSubComposition(subHtml, id, width, height);
154402
154584
  compositions.push({ ...subInfo, source: compositionSrc });
154403
154585
  return;
@@ -154503,7 +154685,7 @@ var init_compositions = __esm({
154503
154685
  },
154504
154686
  async run({ args }) {
154505
154687
  const project = resolveProject(args.dir);
154506
- const html = readFileSync69(project.indexPath, "utf-8");
154688
+ const html = readFileSync70(project.indexPath, "utf-8");
154507
154689
  ensureDOMParser();
154508
154690
  const compositions = parseCompositions(html, dirname48(project.indexPath));
154509
154691
  if (args.json) {
@@ -154542,7 +154724,7 @@ __export(benchmark_exports, {
154542
154724
  examples: () => examples19
154543
154725
  });
154544
154726
  import { existsSync as existsSync95, statSync as statSync34 } from "fs";
154545
- import { resolve as resolve61, join as join104 } from "path";
154727
+ import { resolve as resolve62, join as join104 } from "path";
154546
154728
  var examples19, FPS_30, FPS_60, DEFAULT_CONFIGS, benchmark_default;
154547
154729
  var init_benchmark = __esm({
154548
154730
  "src/commands/benchmark.ts"() {
@@ -154588,7 +154770,7 @@ var init_benchmark = __esm({
154588
154770
  failCommand();
154589
154771
  }
154590
154772
  const jsonOutput = args.json ?? false;
154591
- const benchDir = resolve61("renders", ".benchmark");
154773
+ const benchDir = resolve62("renders", ".benchmark");
154592
154774
  let producer = null;
154593
154775
  try {
154594
154776
  producer = await loadProducer();
@@ -154909,7 +155091,7 @@ __export(remove_background_exports, {
154909
155091
  default: () => remove_background_default,
154910
155092
  examples: () => examples21
154911
155093
  });
154912
- import { resolve as resolve62 } from "path";
155094
+ import { resolve as resolve63 } from "path";
154913
155095
  import { existsSync as existsSync96 } from "fs";
154914
155096
  async function showInfo(json) {
154915
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));
@@ -155053,10 +155235,10 @@ var init_remove_background = __esm({
155053
155235
  );
155054
155236
  failCommand();
155055
155237
  }
155056
- const inputPath = resolve62(args.input);
155057
- const outputPath = resolve62(args.output);
155238
+ const inputPath = resolve63(args.input);
155239
+ const outputPath = resolve63(args.output);
155058
155240
  const backgroundOutputArg = args["background-output"];
155059
- const backgroundOutputPath = backgroundOutputArg ? resolve62(backgroundOutputArg) : void 0;
155241
+ const backgroundOutputPath = backgroundOutputArg ? resolve63(backgroundOutputArg) : void 0;
155060
155242
  const { render: render3 } = await Promise.resolve().then(() => (init_pipeline(), pipeline_exports));
155061
155243
  const spin = args.json ? null : ft();
155062
155244
  spin?.start("Preparing background-removal pipeline...");
@@ -155121,7 +155303,7 @@ var init_remove_background = __esm({
155121
155303
 
155122
155304
  // src/whisper/parakeet.ts
155123
155305
  import { execFileSync as execFileSync13 } from "child_process";
155124
- 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";
155125
155307
  import { homedir as homedir20, tmpdir as tmpdir15 } from "os";
155126
155308
  import { basename as basename19, extname as extname16, join as join105 } from "path";
155127
155309
  function isRunnable(bin) {
@@ -155198,7 +155380,7 @@ function transcribeWithParakeet(inputPath, dir, options) {
155198
155380
  execFileSync13(runner, argv2, { stdio: ["ignore", "pipe", "pipe"], timeout: 18e5 });
155199
155381
  const produced = join105(workDir, `${basename19(inputPath, extname16(inputPath))}.json`);
155200
155382
  if (!existsSync97(produced)) throw new Error("Parakeet did not produce output.");
155201
- const words = mergeTokensToWords(JSON.parse(readFileSync70(produced, "utf-8")));
155383
+ const words = mergeTokensToWords(JSON.parse(readFileSync71(produced, "utf-8")));
155202
155384
  const transcriptPath = join105(dir, "transcript.json");
155203
155385
  writeFileSync40(transcriptPath, JSON.stringify(words, null, 2));
155204
155386
  const durationSeconds = words.length > 0 ? words[words.length - 1].end : 0;
@@ -155223,7 +155405,7 @@ __export(transcribe_exports2, {
155223
155405
  examples: () => examples22
155224
155406
  });
155225
155407
  import { existsSync as existsSync98, writeFileSync as writeFileSync41 } from "fs";
155226
- 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";
155227
155409
  function parseTimeoutMs(raw, json) {
155228
155410
  const source = raw ?? process.env["HYPERFRAMES_TRANSCRIBE_TIMEOUT_MS"];
155229
155411
  if (source == null || source === "") return void 0;
@@ -155277,7 +155459,7 @@ async function exportTranscript(inputPath, dir, to, output, json, preserveCues)
155277
155459
  const { words, format } = loadTranscript2(inputPath);
155278
155460
  if (words.length === 0) exitNoWords(json);
155279
155461
  const preGrouped = preserveCues || format === "srt" || format === "vtt" || void 0;
155280
- const outPath = resolve63(output ?? join106(dir, `transcript.${to}`));
155462
+ const outPath = resolve64(output ?? join106(dir, `transcript.${to}`));
155281
155463
  const content = to === "srt" ? formatSrt2(words, { preGrouped }) : formatVtt2(words, { preGrouped });
155282
155464
  writeFileSync41(outPath, content);
155283
155465
  if (json) {
@@ -155460,14 +155642,14 @@ var init_transcribe2 = __esm({
155460
155642
  }
155461
155643
  },
155462
155644
  async run({ args }) {
155463
- const inputPath = resolve63(args.input);
155645
+ const inputPath = resolve64(args.input);
155464
155646
  if (!existsSync98(inputPath)) {
155465
155647
  const message = `File not found: ${args.input}`;
155466
155648
  trackCommandFailure("transcribe", message);
155467
155649
  console.error(c.error(message));
155468
155650
  failCommand();
155469
155651
  }
155470
- const dir = resolve63(args.dir ?? dirname49(inputPath));
155652
+ const dir = resolve64(args.dir ?? dirname49(inputPath));
155471
155653
  const ext = extname17(inputPath).toLowerCase();
155472
155654
  const isImport = ext === ".json" || ext === ".srt" || ext === ".vtt";
155473
155655
  const to = parseExportFormat(args.to, args.json);
@@ -155810,8 +155992,8 @@ __export(tts_exports, {
155810
155992
  default: () => tts_default,
155811
155993
  examples: () => examples23
155812
155994
  });
155813
- import { existsSync as existsSync101, readFileSync as readFileSync71 } from "fs";
155814
- 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";
155815
155997
  function listVoices(json) {
155816
155998
  const rows = BUNDLED_VOICES.map((v2) => ({ ...v2, defaultLang: inferLangFromVoiceId(v2.id) }));
155817
155999
  if (json) {
@@ -155926,9 +156108,9 @@ var init_tts = __esm({
155926
156108
  failCommand();
155927
156109
  }
155928
156110
  let text2;
155929
- const maybeFile = resolve64(input2);
156111
+ const maybeFile = resolve65(input2);
155930
156112
  if (existsSync101(maybeFile) && extname18(maybeFile).toLowerCase() === ".txt") {
155931
- text2 = readFileSync71(maybeFile, "utf-8").trim();
156113
+ text2 = readFileSync73(maybeFile, "utf-8").trim();
155932
156114
  if (!text2) {
155933
156115
  console.error(c.error("File is empty."));
155934
156116
  failCommand();
@@ -155940,7 +156122,7 @@ var init_tts = __esm({
155940
156122
  console.error(c.error("No text provided."));
155941
156123
  failCommand();
155942
156124
  }
155943
- const output = resolve64(args.output ?? "speech.wav");
156125
+ const output = resolve65(args.output ?? "speech.wav");
155944
156126
  const voice = args.voice ?? DEFAULT_VOICE;
155945
156127
  const speed = args.speed ? parseFloat(args.speed) : 1;
155946
156128
  if (isNaN(speed) || speed <= 0 || speed > 3) {
@@ -156020,14 +156202,14 @@ __export(docs_exports, {
156020
156202
  default: () => docs_default,
156021
156203
  examples: () => examples24
156022
156204
  });
156023
- import { readFileSync as readFileSync73, existsSync as existsSync103 } from "fs";
156024
- 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";
156025
156207
  import { fileURLToPath as fileURLToPath14 } from "url";
156026
156208
  function docsDir() {
156027
156209
  const thisFile = fileURLToPath14(import.meta.url);
156028
156210
  const dir = dirname51(thisFile);
156029
- const devPath = resolve65(dir, "..", "docs");
156030
- const builtPath = resolve65(dir, "docs");
156211
+ const devPath = resolve66(dir, "..", "docs");
156212
+ const builtPath = resolve66(dir, "docs");
156031
156213
  return existsSync103(devPath) ? devPath : builtPath;
156032
156214
  }
156033
156215
  function formatInlineCode(line2) {
@@ -156131,7 +156313,7 @@ var init_docs = __esm({
156131
156313
  console.error(c.error(`Doc file not found: ${filePath}`));
156132
156314
  failCommand();
156133
156315
  }
156134
- const content = readFileSync73(filePath, "utf-8");
156316
+ const content = readFileSync74(filePath, "utf-8");
156135
156317
  console.log();
156136
156318
  renderMarkdown(content);
156137
156319
  }
@@ -156529,8 +156711,8 @@ __export(upgrade_exports, {
156529
156711
  upgradeProjectPins: () => upgradeProjectPins
156530
156712
  });
156531
156713
  import { execFileSync as execFileSync17 } from "child_process";
156532
- import { existsSync as existsSync105, readFileSync as readFileSync74, writeFileSync as writeFileSync44, renameSync as renameSync16 } from "fs";
156533
- 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";
156534
156716
  async function confirmUpgrade() {
156535
156717
  const shouldUpgrade = await ue({ message: "Upgrade now?" });
156536
156718
  return !q(shouldUpgrade) && shouldUpgrade === true;
@@ -156588,11 +156770,11 @@ function resolveProjectArgs(project, opts) {
156588
156770
  return { dir: project, check: opts.check, json: opts.json };
156589
156771
  }
156590
156772
  async function upgradeProjectPins(dir, opts) {
156591
- const pkgPath = resolve66(dir, "package.json");
156773
+ const pkgPath = resolve67(dir, "package.json");
156592
156774
  if (!existsSync105(pkgPath)) {
156593
156775
  return { changed: false, from: [], to: "", path: pkgPath };
156594
156776
  }
156595
- const raw = JSON.parse(readFileSync74(pkgPath, "utf-8"));
156777
+ const raw = JSON.parse(readFileSync75(pkgPath, "utf-8"));
156596
156778
  const scripts = raw.scripts ?? {};
156597
156779
  const { latest } = await checkForUpdate(true);
156598
156780
  if (!isSafeVersion(latest)) return { changed: false, from: [], to: latest, path: pkgPath };
@@ -156670,7 +156852,7 @@ var init_upgrade = __esm({
156670
156852
  const checkOnly = args.check === true;
156671
156853
  if (args.project !== void 0) {
156672
156854
  const p2 = resolveProjectArgs(args.project, { check: checkOnly, json: useJson });
156673
- 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 });
156674
156856
  if (p2.json) {
156675
156857
  console.log(JSON.stringify(withMeta(res), null, 2));
156676
156858
  return;
@@ -156869,7 +157051,7 @@ __export(feedback_exports, {
156869
157051
  examples: () => examples27
156870
157052
  });
156871
157053
  import { randomUUID as randomUUID12 } from "crypto";
156872
- import { resolve as resolve67 } from "path";
157054
+ import { resolve as resolve68 } from "path";
156873
157055
  import open from "open";
156874
157056
  function normalizeComment(raw) {
156875
157057
  return raw || void 0;
@@ -156942,7 +157124,7 @@ async function openAndPrintIssue(url) {
156942
157124
  console.log();
156943
157125
  }
156944
157126
  async function fileGithubIssue(opts) {
156945
- const dir = resolve67(opts.rawDir ?? ".");
157127
+ const dir = resolve68(opts.rawDir ?? ".");
156946
157128
  if (!await confirmFileIssue(dir, opts.yes)) return;
156947
157129
  const repoPublicUrl = await publishRepro(dir);
156948
157130
  const url = buildIssueUrl({
@@ -157278,7 +157460,7 @@ __export(contactSheet_exports, {
157278
157460
  createSvgContactSheet: () => createSvgContactSheet
157279
157461
  });
157280
157462
  import sharp from "sharp";
157281
- 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";
157282
157464
  import { join as join110, extname as extname19, basename as basename21, dirname as dirname53 } from "path";
157283
157465
  async function createContactSheet(imagePaths, outputPath, opts = {}) {
157284
157466
  const {
@@ -157438,7 +157620,7 @@ async function createSvgContactSheet(svgsDir, outputPath, assetsRootDir, budget
157438
157620
  const svgPath = svgPaths[i2];
157439
157621
  const tmpPath = join110(tmpDir, `.thumb-${i2}.png`);
157440
157622
  try {
157441
- const svgBuf = readFileSync75(svgPath);
157623
+ const svgBuf = readFileSync76(svgPath);
157442
157624
  const thumb = await sharp(svgBuf).resize(thumbSize, thumbSize, {
157443
157625
  fit: "contain",
157444
157626
  background: { r: 245, g: 245, b: 245, alpha: 1 }
@@ -157747,7 +157929,7 @@ var require_p_retry = __commonJS({
157747
157929
  return error;
157748
157930
  };
157749
157931
  var isNetworkError = (errorMessage2) => networkErrorMsgs.includes(errorMessage2);
157750
- var pRetry2 = (input2, options) => new Promise((resolve78, reject2) => {
157932
+ var pRetry2 = (input2, options) => new Promise((resolve79, reject2) => {
157751
157933
  options = {
157752
157934
  onFailedAttempt: () => {
157753
157935
  },
@@ -157757,7 +157939,7 @@ var require_p_retry = __commonJS({
157757
157939
  const operation = retry.operation(options);
157758
157940
  operation.attempt(async (attemptNumber) => {
157759
157941
  try {
157760
- resolve78(await input2(attemptNumber));
157942
+ resolve79(await input2(attemptNumber));
157761
157943
  } catch (error) {
157762
157944
  if (!(error instanceof Error)) {
157763
157945
  reject2(new TypeError(`Non-error was thrown: "${error}". You should only throw errors.`));
@@ -158293,8 +158475,8 @@ var require_retry3 = __commonJS({
158293
158475
  }
158294
158476
  const delay2 = getNextRetryDelay(config);
158295
158477
  err.config.retryConfig.currentRetryAttempt += 1;
158296
- const backoff = config.retryBackoff ? config.retryBackoff(err, delay2) : new Promise((resolve78) => {
158297
- setTimeout(resolve78, delay2);
158478
+ const backoff = config.retryBackoff ? config.retryBackoff(err, delay2) : new Promise((resolve79) => {
158479
+ setTimeout(resolve79, delay2);
158298
158480
  });
158299
158481
  if (config.onRetryAttempt) {
158300
158482
  await config.onRetryAttempt(err);
@@ -158422,8 +158604,8 @@ var require_helpers = __commonJS({
158422
158604
  function req(url, opts = {}) {
158423
158605
  const href = typeof url === "string" ? url : url.href;
158424
158606
  const req2 = (href.startsWith("https:") ? https2 : http4).request(url, opts);
158425
- const promise = new Promise((resolve78, reject2) => {
158426
- req2.once("response", resolve78).once("error", reject2).end();
158607
+ const promise = new Promise((resolve79, reject2) => {
158608
+ req2.once("response", resolve79).once("error", reject2).end();
158427
158609
  });
158428
158610
  req2.then = promise.then.bind(promise);
158429
158611
  return req2;
@@ -158600,7 +158782,7 @@ var require_parse_proxy_response = __commonJS({
158600
158782
  var debug_1 = __importDefault2(__require("debug"));
158601
158783
  var debug = (0, debug_1.default)("https-proxy-agent:parse-proxy-response");
158602
158784
  function parseProxyResponse(socket) {
158603
- return new Promise((resolve78, reject2) => {
158785
+ return new Promise((resolve79, reject2) => {
158604
158786
  let buffersLength = 0;
158605
158787
  const buffers = [];
158606
158788
  function read() {
@@ -158666,7 +158848,7 @@ var require_parse_proxy_response = __commonJS({
158666
158848
  }
158667
158849
  debug("got proxy server response: %o %o", firstLine, headers);
158668
158850
  cleanup();
158669
- resolve78({
158851
+ resolve79({
158670
158852
  connect: {
158671
158853
  statusCode,
158672
158854
  statusText,
@@ -158910,7 +159092,7 @@ var require_ponyfill_es2018 = __commonJS({
158910
159092
  return new originalPromise(executor);
158911
159093
  }
158912
159094
  function promiseResolvedWith(value) {
158913
- return newPromise((resolve78) => resolve78(value));
159095
+ return newPromise((resolve79) => resolve79(value));
158914
159096
  }
158915
159097
  function promiseRejectedWith(reason) {
158916
159098
  return originalPromiseReject(reason);
@@ -159080,8 +159262,8 @@ var require_ponyfill_es2018 = __commonJS({
159080
159262
  return new TypeError("Cannot " + name + " a stream using a released reader");
159081
159263
  }
159082
159264
  function defaultReaderClosedPromiseInitialize(reader) {
159083
- reader._closedPromise = newPromise((resolve78, reject2) => {
159084
- reader._closedPromise_resolve = resolve78;
159265
+ reader._closedPromise = newPromise((resolve79, reject2) => {
159266
+ reader._closedPromise_resolve = resolve79;
159085
159267
  reader._closedPromise_reject = reject2;
159086
159268
  });
159087
159269
  }
@@ -159255,8 +159437,8 @@ var require_ponyfill_es2018 = __commonJS({
159255
159437
  }
159256
159438
  let resolvePromise;
159257
159439
  let rejectPromise;
159258
- const promise = newPromise((resolve78, reject2) => {
159259
- resolvePromise = resolve78;
159440
+ const promise = newPromise((resolve79, reject2) => {
159441
+ resolvePromise = resolve79;
159260
159442
  rejectPromise = reject2;
159261
159443
  });
159262
159444
  const readRequest = {
@@ -159361,8 +159543,8 @@ var require_ponyfill_es2018 = __commonJS({
159361
159543
  const reader = this._reader;
159362
159544
  let resolvePromise;
159363
159545
  let rejectPromise;
159364
- const promise = newPromise((resolve78, reject2) => {
159365
- resolvePromise = resolve78;
159546
+ const promise = newPromise((resolve79, reject2) => {
159547
+ resolvePromise = resolve79;
159366
159548
  rejectPromise = reject2;
159367
159549
  });
159368
159550
  const readRequest = {
@@ -160381,8 +160563,8 @@ var require_ponyfill_es2018 = __commonJS({
160381
160563
  }
160382
160564
  let resolvePromise;
160383
160565
  let rejectPromise;
160384
- const promise = newPromise((resolve78, reject2) => {
160385
- resolvePromise = resolve78;
160566
+ const promise = newPromise((resolve79, reject2) => {
160567
+ resolvePromise = resolve79;
160386
160568
  rejectPromise = reject2;
160387
160569
  });
160388
160570
  const readIntoRequest = {
@@ -160694,10 +160876,10 @@ var require_ponyfill_es2018 = __commonJS({
160694
160876
  wasAlreadyErroring = true;
160695
160877
  reason = void 0;
160696
160878
  }
160697
- const promise = newPromise((resolve78, reject2) => {
160879
+ const promise = newPromise((resolve79, reject2) => {
160698
160880
  stream._pendingAbortRequest = {
160699
160881
  _promise: void 0,
160700
- _resolve: resolve78,
160882
+ _resolve: resolve79,
160701
160883
  _reject: reject2,
160702
160884
  _reason: reason,
160703
160885
  _wasAlreadyErroring: wasAlreadyErroring
@@ -160714,9 +160896,9 @@ var require_ponyfill_es2018 = __commonJS({
160714
160896
  if (state === "closed" || state === "errored") {
160715
160897
  return promiseRejectedWith(new TypeError(`The stream (in ${state} state) is not in the writable state and cannot be closed`));
160716
160898
  }
160717
- const promise = newPromise((resolve78, reject2) => {
160899
+ const promise = newPromise((resolve79, reject2) => {
160718
160900
  const closeRequest = {
160719
- _resolve: resolve78,
160901
+ _resolve: resolve79,
160720
160902
  _reject: reject2
160721
160903
  };
160722
160904
  stream._closeRequest = closeRequest;
@@ -160729,9 +160911,9 @@ var require_ponyfill_es2018 = __commonJS({
160729
160911
  return promise;
160730
160912
  }
160731
160913
  function WritableStreamAddWriteRequest(stream) {
160732
- const promise = newPromise((resolve78, reject2) => {
160914
+ const promise = newPromise((resolve79, reject2) => {
160733
160915
  const writeRequest = {
160734
- _resolve: resolve78,
160916
+ _resolve: resolve79,
160735
160917
  _reject: reject2
160736
160918
  };
160737
160919
  stream._writeRequests.push(writeRequest);
@@ -161347,8 +161529,8 @@ var require_ponyfill_es2018 = __commonJS({
161347
161529
  return new TypeError("Cannot " + name + " a stream using a released writer");
161348
161530
  }
161349
161531
  function defaultWriterClosedPromiseInitialize(writer) {
161350
- writer._closedPromise = newPromise((resolve78, reject2) => {
161351
- writer._closedPromise_resolve = resolve78;
161532
+ writer._closedPromise = newPromise((resolve79, reject2) => {
161533
+ writer._closedPromise_resolve = resolve79;
161352
161534
  writer._closedPromise_reject = reject2;
161353
161535
  writer._closedPromiseState = "pending";
161354
161536
  });
@@ -161384,8 +161566,8 @@ var require_ponyfill_es2018 = __commonJS({
161384
161566
  writer._closedPromiseState = "resolved";
161385
161567
  }
161386
161568
  function defaultWriterReadyPromiseInitialize(writer) {
161387
- writer._readyPromise = newPromise((resolve78, reject2) => {
161388
- writer._readyPromise_resolve = resolve78;
161569
+ writer._readyPromise = newPromise((resolve79, reject2) => {
161570
+ writer._readyPromise_resolve = resolve79;
161389
161571
  writer._readyPromise_reject = reject2;
161390
161572
  });
161391
161573
  writer._readyPromiseState = "pending";
@@ -161472,7 +161654,7 @@ var require_ponyfill_es2018 = __commonJS({
161472
161654
  source._disturbed = true;
161473
161655
  let shuttingDown = false;
161474
161656
  let currentWrite = promiseResolvedWith(void 0);
161475
- return newPromise((resolve78, reject2) => {
161657
+ return newPromise((resolve79, reject2) => {
161476
161658
  let abortAlgorithm;
161477
161659
  if (signal !== void 0) {
161478
161660
  abortAlgorithm = () => {
@@ -161617,7 +161799,7 @@ var require_ponyfill_es2018 = __commonJS({
161617
161799
  if (isError) {
161618
161800
  reject2(error);
161619
161801
  } else {
161620
- resolve78(void 0);
161802
+ resolve79(void 0);
161621
161803
  }
161622
161804
  return null;
161623
161805
  }
@@ -161898,8 +162080,8 @@ var require_ponyfill_es2018 = __commonJS({
161898
162080
  let branch1;
161899
162081
  let branch2;
161900
162082
  let resolveCancelPromise;
161901
- const cancelPromise = newPromise((resolve78) => {
161902
- resolveCancelPromise = resolve78;
162083
+ const cancelPromise = newPromise((resolve79) => {
162084
+ resolveCancelPromise = resolve79;
161903
162085
  });
161904
162086
  function pullAlgorithm() {
161905
162087
  if (reading) {
@@ -161990,8 +162172,8 @@ var require_ponyfill_es2018 = __commonJS({
161990
162172
  let branch1;
161991
162173
  let branch2;
161992
162174
  let resolveCancelPromise;
161993
- const cancelPromise = newPromise((resolve78) => {
161994
- resolveCancelPromise = resolve78;
162175
+ const cancelPromise = newPromise((resolve79) => {
162176
+ resolveCancelPromise = resolve79;
161995
162177
  });
161996
162178
  function forwardReaderError(thisReader) {
161997
162179
  uponRejection(thisReader._closedPromise, (r2) => {
@@ -162771,8 +162953,8 @@ var require_ponyfill_es2018 = __commonJS({
162771
162953
  const writableHighWaterMark = ExtractHighWaterMark(writableStrategy, 1);
162772
162954
  const writableSizeAlgorithm = ExtractSizeAlgorithm(writableStrategy);
162773
162955
  let startPromise_resolve;
162774
- const startPromise = newPromise((resolve78) => {
162775
- startPromise_resolve = resolve78;
162956
+ const startPromise = newPromise((resolve79) => {
162957
+ startPromise_resolve = resolve79;
162776
162958
  });
162777
162959
  InitializeTransformStream(this, startPromise, writableHighWaterMark, writableSizeAlgorithm, readableHighWaterMark, readableSizeAlgorithm);
162778
162960
  SetUpTransformStreamDefaultControllerFromTransformer(this, transformer);
@@ -162865,8 +163047,8 @@ var require_ponyfill_es2018 = __commonJS({
162865
163047
  if (stream._backpressureChangePromise !== void 0) {
162866
163048
  stream._backpressureChangePromise_resolve();
162867
163049
  }
162868
- stream._backpressureChangePromise = newPromise((resolve78) => {
162869
- stream._backpressureChangePromise_resolve = resolve78;
163050
+ stream._backpressureChangePromise = newPromise((resolve79) => {
163051
+ stream._backpressureChangePromise_resolve = resolve79;
162870
163052
  });
162871
163053
  stream._backpressure = backpressure;
162872
163054
  }
@@ -163034,8 +163216,8 @@ var require_ponyfill_es2018 = __commonJS({
163034
163216
  return controller._finishPromise;
163035
163217
  }
163036
163218
  const readable = stream._readable;
163037
- controller._finishPromise = newPromise((resolve78, reject2) => {
163038
- controller._finishPromise_resolve = resolve78;
163219
+ controller._finishPromise = newPromise((resolve79, reject2) => {
163220
+ controller._finishPromise_resolve = resolve79;
163039
163221
  controller._finishPromise_reject = reject2;
163040
163222
  });
163041
163223
  const cancelPromise = controller._cancelAlgorithm(reason);
@@ -163061,8 +163243,8 @@ var require_ponyfill_es2018 = __commonJS({
163061
163243
  return controller._finishPromise;
163062
163244
  }
163063
163245
  const readable = stream._readable;
163064
- controller._finishPromise = newPromise((resolve78, reject2) => {
163065
- controller._finishPromise_resolve = resolve78;
163246
+ controller._finishPromise = newPromise((resolve79, reject2) => {
163247
+ controller._finishPromise_resolve = resolve79;
163066
163248
  controller._finishPromise_reject = reject2;
163067
163249
  });
163068
163250
  const flushPromise = controller._flushAlgorithm();
@@ -163092,8 +163274,8 @@ var require_ponyfill_es2018 = __commonJS({
163092
163274
  return controller._finishPromise;
163093
163275
  }
163094
163276
  const writable = stream._writable;
163095
- controller._finishPromise = newPromise((resolve78, reject2) => {
163096
- controller._finishPromise_resolve = resolve78;
163277
+ controller._finishPromise = newPromise((resolve79, reject2) => {
163278
+ controller._finishPromise_resolve = resolve79;
163097
163279
  controller._finishPromise_reject = reject2;
163098
163280
  });
163099
163281
  const cancelPromise = controller._cancelAlgorithm(reason);
@@ -165062,7 +165244,7 @@ import zlib2 from "zlib";
165062
165244
  import Stream2, { PassThrough as PassThrough2, pipeline as pump } from "stream";
165063
165245
  import { Buffer as Buffer4 } from "buffer";
165064
165246
  async function fetch3(url, options_) {
165065
- return new Promise((resolve78, reject2) => {
165247
+ return new Promise((resolve79, reject2) => {
165066
165248
  const request = new Request2(url, options_);
165067
165249
  const { parsedURL, options } = getNodeRequestOptions(request);
165068
165250
  if (!supportedSchemas.has(parsedURL.protocol)) {
@@ -165071,7 +165253,7 @@ async function fetch3(url, options_) {
165071
165253
  if (parsedURL.protocol === "data:") {
165072
165254
  const data2 = dist_default3(request.url);
165073
165255
  const response2 = new Response2(data2, { headers: { "Content-Type": data2.typeFull } });
165074
- resolve78(response2);
165256
+ resolve79(response2);
165075
165257
  return;
165076
165258
  }
165077
165259
  const send = (parsedURL.protocol === "https:" ? https : http3).request;
@@ -165193,7 +165375,7 @@ async function fetch3(url, options_) {
165193
165375
  if (responseReferrerPolicy) {
165194
165376
  requestOptions.referrerPolicy = responseReferrerPolicy;
165195
165377
  }
165196
- resolve78(fetch3(new Request2(locationURL, requestOptions)));
165378
+ resolve79(fetch3(new Request2(locationURL, requestOptions)));
165197
165379
  finalize();
165198
165380
  return;
165199
165381
  }
@@ -165226,7 +165408,7 @@ async function fetch3(url, options_) {
165226
165408
  const codings = headers.get("Content-Encoding");
165227
165409
  if (!request.compress || request.method === "HEAD" || codings === null || response_.statusCode === 204 || response_.statusCode === 304) {
165228
165410
  response = new Response2(body, responseOptions);
165229
- resolve78(response);
165411
+ resolve79(response);
165230
165412
  return;
165231
165413
  }
165232
165414
  const zlibOptions = {
@@ -165240,7 +165422,7 @@ async function fetch3(url, options_) {
165240
165422
  }
165241
165423
  });
165242
165424
  response = new Response2(body, responseOptions);
165243
- resolve78(response);
165425
+ resolve79(response);
165244
165426
  return;
165245
165427
  }
165246
165428
  if (codings === "deflate" || codings === "x-deflate") {
@@ -165264,12 +165446,12 @@ async function fetch3(url, options_) {
165264
165446
  });
165265
165447
  }
165266
165448
  response = new Response2(body, responseOptions);
165267
- resolve78(response);
165449
+ resolve79(response);
165268
165450
  });
165269
165451
  raw.once("end", () => {
165270
165452
  if (!response) {
165271
165453
  response = new Response2(body, responseOptions);
165272
- resolve78(response);
165454
+ resolve79(response);
165273
165455
  }
165274
165456
  });
165275
165457
  return;
@@ -165281,11 +165463,11 @@ async function fetch3(url, options_) {
165281
165463
  }
165282
165464
  });
165283
165465
  response = new Response2(body, responseOptions);
165284
- resolve78(response);
165466
+ resolve79(response);
165285
165467
  return;
165286
165468
  }
165287
165469
  response = new Response2(body, responseOptions);
165288
- resolve78(response);
165470
+ resolve79(response);
165289
165471
  });
165290
165472
  writeToStream(request_, request).catch(reject2);
165291
165473
  });
@@ -171367,7 +171549,7 @@ var require_jwtaccess = __commonJS({
171367
171549
  }
171368
171550
  }
171369
171551
  fromStreamAsync(inputStream) {
171370
- return new Promise((resolve78, reject2) => {
171552
+ return new Promise((resolve79, reject2) => {
171371
171553
  if (!inputStream) {
171372
171554
  reject2(new Error("Must pass in a stream containing the service account auth settings."));
171373
171555
  }
@@ -171376,7 +171558,7 @@ var require_jwtaccess = __commonJS({
171376
171558
  try {
171377
171559
  const data2 = JSON.parse(s2);
171378
171560
  this.fromJSON(data2);
171379
- resolve78();
171561
+ resolve79();
171380
171562
  } catch (err) {
171381
171563
  reject2(err);
171382
171564
  }
@@ -171615,7 +171797,7 @@ var require_jwtclient = __commonJS({
171615
171797
  }
171616
171798
  }
171617
171799
  fromStreamAsync(inputStream) {
171618
- return new Promise((resolve78, reject2) => {
171800
+ return new Promise((resolve79, reject2) => {
171619
171801
  if (!inputStream) {
171620
171802
  throw new Error("Must pass in a stream containing the service account auth settings.");
171621
171803
  }
@@ -171624,7 +171806,7 @@ var require_jwtclient = __commonJS({
171624
171806
  try {
171625
171807
  const data2 = JSON.parse(s2);
171626
171808
  this.fromJSON(data2);
171627
- resolve78();
171809
+ resolve79();
171628
171810
  } catch (e3) {
171629
171811
  reject2(e3);
171630
171812
  }
@@ -171757,7 +171939,7 @@ var require_refreshclient = __commonJS({
171757
171939
  }
171758
171940
  }
171759
171941
  async fromStreamAsync(inputStream) {
171760
- return new Promise((resolve78, reject2) => {
171942
+ return new Promise((resolve79, reject2) => {
171761
171943
  if (!inputStream) {
171762
171944
  return reject2(new Error("Must pass in a stream containing the user refresh token."));
171763
171945
  }
@@ -171766,7 +171948,7 @@ var require_refreshclient = __commonJS({
171766
171948
  try {
171767
171949
  const data2 = JSON.parse(s2);
171768
171950
  this.fromJSON(data2);
171769
- return resolve78();
171951
+ return resolve79();
171770
171952
  } catch (err) {
171771
171953
  return reject2(err);
171772
171954
  }
@@ -173599,7 +173781,7 @@ var require_pluggable_auth_handler = __commonJS({
173599
173781
  * @return A promise that resolves with the executable response.
173600
173782
  */
173601
173783
  retrieveResponseFromExecutable(envMap) {
173602
- return new Promise((resolve78, reject2) => {
173784
+ return new Promise((resolve79, reject2) => {
173603
173785
  const child = childProcess.spawn(this.commandComponents[0], this.commandComponents.slice(1), {
173604
173786
  env: { ...process.env, ...Object.fromEntries(envMap) }
173605
173787
  });
@@ -173621,7 +173803,7 @@ var require_pluggable_auth_handler = __commonJS({
173621
173803
  try {
173622
173804
  const responseJson = JSON.parse(output);
173623
173805
  const response = new executable_response_1.ExecutableResponse(responseJson);
173624
- return resolve78(response);
173806
+ return resolve79(response);
173625
173807
  } catch (error) {
173626
173808
  if (error instanceof executable_response_1.ExecutableResponseError) {
173627
173809
  return reject2(error);
@@ -174524,7 +174706,7 @@ var require_googleauth = __commonJS({
174524
174706
  }
174525
174707
  }
174526
174708
  fromStreamAsync(inputStream, options) {
174527
- return new Promise((resolve78, reject2) => {
174709
+ return new Promise((resolve79, reject2) => {
174528
174710
  if (!inputStream) {
174529
174711
  throw new Error("Must pass in a stream containing the Google auth settings.");
174530
174712
  }
@@ -174534,7 +174716,7 @@ var require_googleauth = __commonJS({
174534
174716
  try {
174535
174717
  const data2 = JSON.parse(chunks.join(""));
174536
174718
  const r2 = this._cacheClientFromJSON(data2, options);
174537
- return resolve78(r2);
174719
+ return resolve79(r2);
174538
174720
  } catch (err) {
174539
174721
  if (!this.keyFilename)
174540
174722
  throw err;
@@ -174544,7 +174726,7 @@ var require_googleauth = __commonJS({
174544
174726
  });
174545
174727
  this.cachedCredential = client;
174546
174728
  this.setGapicJWTValues(client);
174547
- return resolve78(client);
174729
+ return resolve79(client);
174548
174730
  }
174549
174731
  } catch (err) {
174550
174732
  return reject2(err);
@@ -174580,17 +174762,17 @@ var require_googleauth = __commonJS({
174580
174762
  * Run the Google Cloud SDK command that prints the default project ID
174581
174763
  */
174582
174764
  async getDefaultServiceProjectId() {
174583
- return new Promise((resolve78) => {
174765
+ return new Promise((resolve79) => {
174584
174766
  (0, child_process_1.exec)("gcloud config config-helper --format json", (err, stdout2) => {
174585
174767
  if (!err && stdout2) {
174586
174768
  try {
174587
174769
  const projectId = JSON.parse(stdout2).configuration.properties.core.project;
174588
- resolve78(projectId);
174770
+ resolve79(projectId);
174589
174771
  return;
174590
174772
  } catch (e3) {
174591
174773
  }
174592
174774
  }
174593
- resolve78(null);
174775
+ resolve79(null);
174594
174776
  });
174595
174777
  });
174596
174778
  }
@@ -182433,14 +182615,14 @@ function __asyncValues2(o) {
182433
182615
  }, i2);
182434
182616
  function verb(n2) {
182435
182617
  i2[n2] = o[n2] && function(v2) {
182436
- return new Promise(function(resolve78, reject2) {
182437
- 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);
182438
182620
  });
182439
182621
  };
182440
182622
  }
182441
- function settle(resolve78, reject2, d2, v2) {
182623
+ function settle(resolve79, reject2, d2, v2) {
182442
182624
  Promise.resolve(v2).then(function(v3) {
182443
- resolve78({ value: v3, done: d2 });
182625
+ resolve79({ value: v3, done: d2 });
182444
182626
  }, reject2);
182445
182627
  }
182446
182628
  }
@@ -189867,7 +190049,7 @@ function getApiKeyFromEnv() {
189867
190049
  }
189868
190050
  return envGoogleApiKey || envGeminiApiKey || void 0;
189869
190051
  }
189870
- 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;
189871
190053
  var init_node4 = __esm({
189872
190054
  "../../node_modules/.bun/@google+genai@1.52.0/node_modules/@google/genai/dist/node/index.mjs"() {
189873
190055
  "use strict";
@@ -192930,8 +193112,8 @@ var init_node4 = __esm({
192930
193112
  const url = `${websocketBaseUrl}/ws/google.ai.generativelanguage.${apiVersion}.GenerativeService.BidiGenerateMusic?key=${apiKey}`;
192931
193113
  let onopenResolve = () => {
192932
193114
  };
192933
- const onopenPromise = new Promise((resolve78) => {
192934
- onopenResolve = resolve78;
193115
+ const onopenPromise = new Promise((resolve79) => {
193116
+ onopenResolve = resolve79;
192935
193117
  });
192936
193118
  const callbacks = params.callbacks;
192937
193119
  const onopenAwaitedCallback = function() {
@@ -193137,8 +193319,8 @@ var init_node4 = __esm({
193137
193319
  }
193138
193320
  let onopenResolve = () => {
193139
193321
  };
193140
- const onopenPromise = new Promise((resolve78) => {
193141
- onopenResolve = resolve78;
193322
+ const onopenPromise = new Promise((resolve79) => {
193323
+ onopenResolve = resolve79;
193142
193324
  });
193143
193325
  const callbacks = params.callbacks;
193144
193326
  const onopenAwaitedCallback = function() {
@@ -195486,7 +195668,7 @@ var init_node4 = __esm({
195486
195668
  return void 0;
195487
195669
  }
195488
195670
  };
195489
- sleep$1 = (ms) => new Promise((resolve78) => setTimeout(resolve78, ms));
195671
+ sleep$1 = (ms) => new Promise((resolve79) => setTimeout(resolve79, ms));
195490
195672
  FallbackEncoder = ({ headers, body }) => {
195491
195673
  return {
195492
195674
  bodyHeaders: {
@@ -195514,7 +195696,7 @@ var init_node4 = __esm({
195514
195696
  }
195515
195697
  };
195516
195698
  APIResource._key = [];
195517
- EMPTY = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null));
195699
+ EMPTY2 = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.create(null));
195518
195700
  createPathTagFunction = (pathEncoder = encodeURIPath) => (function path2(statics, ...params) {
195519
195701
  if (statics.length === 1)
195520
195702
  return statics[0];
@@ -195528,7 +195710,7 @@ var init_node4 = __esm({
195528
195710
  const value = params[index];
195529
195711
  let encoded = (postPath ? encodeURIComponent : pathEncoder)("" + value);
195530
195712
  if (index !== params.length && (value == null || typeof value === "object" && // handle values from other realms
195531
- 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))) {
195532
195714
  encoded = value + "";
195533
195715
  invalidSegments.push({
195534
195716
  start: previousValue.length + currentValue.length,
@@ -195995,8 +196177,8 @@ ${underline2}`);
195995
196177
  };
195996
196178
  APIPromise = class _APIPromise extends Promise {
195997
196179
  constructor(client, responsePromise, parseResponse = defaultParseResponse) {
195998
- super((resolve78) => {
195999
- resolve78(null);
196180
+ super((resolve79) => {
196181
+ resolve79(null);
196000
196182
  });
196001
196183
  this.responsePromise = responsePromise;
196002
196184
  this.parseResponse = parseResponse;
@@ -197223,9 +197405,9 @@ __export(snapshot_exports, {
197223
197405
  resolveSnapshotVideoFrameTime: () => resolveSnapshotVideoFrameTime,
197224
197406
  tailFrameTime: () => tailFrameTime
197225
197407
  });
197226
- 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";
197227
197409
  import { tmpdir as tmpdir16 } from "os";
197228
- 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";
197229
197411
  function orbitStageSource() {
197230
197412
  return `function(cam) {
197231
197413
  var root = document.querySelector("[data-composition-id]")
@@ -197293,7 +197475,7 @@ async function extractVideoFrameToBuffer(videoPath, timeSeconds, useVp9AlphaDeco
197293
197475
  );
197294
197476
  const result = await runFfmpegOnce(ffmpegPath, args, FFMPEG_EXTRACT_TIMEOUT_MS);
197295
197477
  if (result.code !== 0 || result.timedOut || !existsSync107(outPath)) return null;
197296
- return readFileSync76(outPath);
197478
+ return readFileSync77(outPath);
197297
197479
  } finally {
197298
197480
  try {
197299
197481
  rmSync31(tmp, { recursive: true, force: true });
@@ -197475,9 +197657,9 @@ async function captureSnapshots(projectDir, opts) {
197475
197657
  try {
197476
197658
  const url = new URL(v2.src);
197477
197659
  const decodedPath = decodeURIComponent(url.pathname).replace(/^\//, "");
197478
- const candidate = resolve68(projectDir, decodedPath);
197479
- const rel2 = relative25(projectDir, candidate);
197480
- 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)) {
197481
197663
  ffmpegInput = candidate;
197482
197664
  inputIsLocal = true;
197483
197665
  } else if (url.protocol === "http:" || url.protocol === "https:") {
@@ -197542,8 +197724,8 @@ async function captureSnapshots(projectDir, opts) {
197542
197724
  } else {
197543
197725
  await page.screenshot({ path: framePath, type: "png", omitBackground: true });
197544
197726
  }
197545
- const rel = relative25(projectDir, framePath);
197546
- savedPaths.push(rel.startsWith("..") || isAbsolute15(rel) ? framePath : rel);
197727
+ const rel = relative26(projectDir, framePath);
197728
+ savedPaths.push(rel.startsWith("..") || isAbsolute16(rel) ? framePath : rel);
197547
197729
  }
197548
197730
  } finally {
197549
197731
  await chromeBrowser.close();
@@ -197683,7 +197865,7 @@ var init_snapshot = __esm({
197683
197865
  const angleLabel = camera && (camera.yaw !== 0 || camera.pitch !== 0) ? ` ${c.dim(`(angle yaw ${camera.yaw}\xB0 pitch ${camera.pitch}\xB0)`)}` : "";
197684
197866
  console.log(`${c.accent("\u25C6")} Capturing ${label2} from ${c.accent(project.name)}${angleLabel}`);
197685
197867
  try {
197686
- 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");
197687
197869
  const paths = await captureSnapshots(project.dir, {
197688
197870
  frames,
197689
197871
  timeout,
@@ -197752,7 +197934,7 @@ ${c.success("\u25C7")} ${paths.length} snapshots saved to ${args.output ? snaps
197752
197934
  const filename = basename25(p2);
197753
197935
  const filePath = join111(snapshotDir, filename);
197754
197936
  if (!existsSync107(filePath)) return { filename, desc: "file not found" };
197755
- const raw = readFileSync76(filePath);
197937
+ const raw = readFileSync77(filePath);
197756
197938
  let imageData;
197757
197939
  let mimeType = "image/png";
197758
197940
  if (sharpFn) {
@@ -197817,22 +197999,22 @@ var init_sourceMutation = __esm({
197817
197999
  });
197818
198000
 
197819
198001
  // src/utils/pathArgs.ts
197820
- 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";
197821
198003
  function readOptionalString(value) {
197822
198004
  if (typeof value !== "string") return void 0;
197823
198005
  const trimmed = value.trim();
197824
198006
  return trimmed ? trimmed : void 0;
197825
198007
  }
197826
198008
  function resolveFromBase(baseDir, input2) {
197827
- return isAbsolute16(input2) ? input2 : resolve69(baseDir, input2);
198009
+ return isAbsolute17(input2) ? input2 : resolve70(baseDir, input2);
197828
198010
  }
197829
198011
  function displayPathFromBase(baseDir, filePath) {
197830
- const rel = relative26(baseDir, filePath);
197831
- if (rel && !rel.startsWith("..") && !isAbsolute16(rel)) return rel;
198012
+ const rel = relative27(baseDir, filePath);
198013
+ if (rel && !rel.startsWith("..") && !isAbsolute17(rel)) return rel;
197832
198014
  return filePath;
197833
198015
  }
197834
198016
  function displayPathFromInput(baseDir, input2) {
197835
- return isAbsolute16(input2) ? displayPathFromBase(baseDir, input2) : input2;
198017
+ return isAbsolute17(input2) ? displayPathFromBase(baseDir, input2) : input2;
197836
198018
  }
197837
198019
  var init_pathArgs = __esm({
197838
198020
  "src/utils/pathArgs.ts"() {
@@ -198121,8 +198303,8 @@ __export(media_treatment_exports, {
198121
198303
  mediaTreatmentCommand: () => mediaTreatmentCommand,
198122
198304
  resolveMediaTreatmentSource: () => resolveMediaTreatmentSource
198123
198305
  });
198124
- import { existsSync as existsSync108, readFileSync as readFileSync77, writeFileSync as writeFileSync47 } from "fs";
198125
- 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";
198126
198308
  function getMediaTreatmentCapabilityOverview() {
198127
198309
  const capabilities = getHfColorGradingCapabilities();
198128
198310
  const family = (id, label2, description) => ({
@@ -198549,7 +198731,7 @@ function runCapabilityQuery(args) {
198549
198731
  function resolveMutationFile(args) {
198550
198732
  const project = resolveProject(readOptionalString(args.project));
198551
198733
  const fileArg = readOptionalString(args.file) ?? "index.html";
198552
- const filePath = resolve70(project.dir, fileArg);
198734
+ const filePath = resolve71(project.dir, fileArg);
198553
198735
  if (!isPathInside(filePath, project.dir) || !filePath.toLowerCase().endsWith(".html")) {
198554
198736
  throw new Error("--file must be an HTML file inside the project");
198555
198737
  }
@@ -198565,12 +198747,12 @@ function analyzeTarget(args) {
198565
198747
  }
198566
198748
  const selectorIndex = parseSelectorIndex(readOptionalString(args["selector-index"]));
198567
198749
  const { element, tag } = selectMediaElement(
198568
- readFileSync77(filePath, "utf8"),
198750
+ readFileSync78(filePath, "utf8"),
198569
198751
  selector,
198570
198752
  selectorIndex
198571
198753
  );
198572
198754
  const source = mediaSourceForElement(element);
198573
- const compositionFile = relative27(project.dir, filePath).split("\\").join("/");
198755
+ const compositionFile = relative28(project.dir, filePath).split("\\").join("/");
198574
198756
  const mediaPath = resolveMediaTreatmentSource(project.dir, compositionFile, source);
198575
198757
  return {
198576
198758
  ok: true,
@@ -198590,7 +198772,7 @@ function prepareMutation(args) {
198590
198772
  const clear = args.clear === true;
198591
198773
  const apply = args.apply === true;
198592
198774
  const selectorIndex = parseSelectorIndex(readOptionalString(args["selector-index"]));
198593
- const result = applyMediaTreatmentToHtml(readFileSync77(filePath, "utf8"), {
198775
+ const result = applyMediaTreatmentToHtml(readFileSync78(filePath, "utf8"), {
198594
198776
  selector,
198595
198777
  selectorIndex,
198596
198778
  grading: parseGrading(readOptionalString(args.grading), apply, clear),
@@ -198606,7 +198788,7 @@ function prepareMutation(args) {
198606
198788
  payload: {
198607
198789
  ok: true,
198608
198790
  action,
198609
- file: relative27(project.dir, filePath) || "index.html",
198791
+ file: relative28(project.dir, filePath) || "index.html",
198610
198792
  selector,
198611
198793
  selectorIndex: selectorIndex ?? 0,
198612
198794
  tag: result.tag,
@@ -198779,12 +198961,12 @@ import {
198779
198961
  existsSync as existsSync109,
198780
198962
  mkdirSync as mkdirSync54,
198781
198963
  mkdtempSync as mkdtempSync17,
198782
- readFileSync as readFileSync78,
198964
+ readFileSync as readFileSync79,
198783
198965
  rmSync as rmSync33,
198784
198966
  writeFileSync as writeFileSync48
198785
198967
  } from "fs";
198786
198968
  import { tmpdir as tmpdir17 } from "os";
198787
- 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";
198788
198970
  import sharp2 from "sharp";
198789
198971
  function isRecord14(value) {
198790
198972
  return typeof value === "object" && value !== null && !Array.isArray(value);
@@ -198875,7 +199057,7 @@ function parseGradesFile(filePath) {
198875
199057
  }
198876
199058
  let parsed;
198877
199059
  try {
198878
- parsed = JSON.parse(readFileSync78(filePath, "utf-8"));
199060
+ parsed = JSON.parse(readFileSync79(filePath, "utf-8"));
198879
199061
  } catch (err) {
198880
199062
  throw new Error(`Could not parse grades JSON: ${normalizeErrorMessage(err)}`);
198881
199063
  }
@@ -198916,7 +199098,7 @@ function parseGradeCompareArgs(args) {
198916
199098
  if (Boolean(gradesArg) === Boolean(lutsArg)) {
198917
199099
  throw new Error("Exactly one of --grades or --luts is required");
198918
199100
  }
198919
- const projectDir = resolve71(readOptionalString(args.project) ?? process.cwd());
199101
+ const projectDir = resolve72(readOptionalString(args.project) ?? process.cwd());
198920
199102
  const framePath = resolveFromBase(projectDir, frameArg);
198921
199103
  const outPath = resolveFromBase(projectDir, readOptionalString(args.out) ?? "grade-compare.png");
198922
199104
  return {
@@ -199052,7 +199234,7 @@ async function prepareGradeCompareTempProject(opts) {
199052
199234
  if (!existsSync109(sourcePath)) {
199053
199235
  throw new Error(`LUT file not found for "${cell.label}": ${sourcePath}`);
199054
199236
  }
199055
- const lutText = readFileSync78(sourcePath, "utf-8");
199237
+ const lutText = readFileSync79(sourcePath, "utf-8");
199056
199238
  try {
199057
199239
  parseCubeLut(lutText, { maxSize: 64 });
199058
199240
  } catch (err) {
@@ -199115,7 +199297,7 @@ async function extractVideoFrameToBuffer2(videoPath) {
199115
199297
  const detail = result.stderr.trim() ? `: ${result.stderr.trim()}` : "";
199116
199298
  throw new Error(`ffmpeg could not extract first frame from ${videoPath}${detail}`);
199117
199299
  }
199118
- return readFileSync78(outPath);
199300
+ return readFileSync79(outPath);
199119
199301
  } finally {
199120
199302
  rmSync33(tmp, { recursive: true, force: true });
199121
199303
  }
@@ -199124,7 +199306,7 @@ async function loadReferenceFrame(framePath) {
199124
199306
  if (!existsSync109(framePath)) {
199125
199307
  throw new Error(`Reference frame not found: ${framePath}`);
199126
199308
  }
199127
- const buffer = isVideoPath2(framePath) ? await extractVideoFrameToBuffer2(framePath) : readFileSync78(framePath);
199309
+ const buffer = isVideoPath2(framePath) ? await extractVideoFrameToBuffer2(framePath) : readFileSync79(framePath);
199128
199310
  if (!buffer) {
199129
199311
  throw new Error(`Could not extract a frame from video: ${framePath}`);
199130
199312
  }
@@ -200019,8 +200201,8 @@ __export(video_exports, {
200019
200201
  runVideoMode: () => runVideoMode,
200020
200202
  safeFilename: () => safeFilename
200021
200203
  });
200022
- import { createWriteStream as createWriteStream4, existsSync as existsSync111, mkdirSync as mkdirSync57, readFileSync as readFileSync79, unlinkSync as unlinkSync11 } from "fs";
200023
- 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";
200024
200206
  async function streamToFile(url, destPath) {
200025
200207
  const r2 = await safeFetch(url, {
200026
200208
  signal: AbortSignal.timeout(12e4),
@@ -200138,7 +200320,7 @@ function pickManifestEntry(manifest, args) {
200138
200320
  };
200139
200321
  }
200140
200322
  async function runVideoMode(args) {
200141
- const projectDir = resolve72(args.project);
200323
+ const projectDir = resolve73(args.project);
200142
200324
  const directPath = join117(projectDir, "extracted", "video-manifest.json");
200143
200325
  const w2hPath = join117(projectDir, "capture", "extracted", "video-manifest.json");
200144
200326
  const manifestPath2 = existsSync111(directPath) ? directPath : w2hPath;
@@ -200153,7 +200335,7 @@ async function runVideoMode(args) {
200153
200335
  }
200154
200336
  let manifest;
200155
200337
  try {
200156
- manifest = JSON.parse(readFileSync79(manifestPath2, "utf-8"));
200338
+ manifest = JSON.parse(readFileSync80(manifestPath2, "utf-8"));
200157
200339
  } catch (e3) {
200158
200340
  console.error(`${c.error("\u2717")} video-manifest.json is malformed: ${e3.message}`);
200159
200341
  setCommandExitCode(1);
@@ -201441,7 +201623,7 @@ var init_designStyleExtractor = __esm({
201441
201623
  });
201442
201624
 
201443
201625
  // src/capture/fontMetadataExtractor.ts
201444
- 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";
201445
201627
  import { join as join118 } from "path";
201446
201628
  import * as fontkit from "fontkit";
201447
201629
  function isFontCollection(value) {
@@ -201492,7 +201674,7 @@ function readSingleFont(fullPath, filename) {
201492
201674
  isIcon: false
201493
201675
  };
201494
201676
  try {
201495
- const buf = readFileSync80(fullPath);
201677
+ const buf = readFileSync81(fullPath);
201496
201678
  const created = fontkit.create(buf);
201497
201679
  const font = isFontCollection(created) ? created.fonts[0] : created;
201498
201680
  if (!font) return empty2;
@@ -201760,7 +201942,7 @@ async function lazyScrollForCapture(page, budgetMs, opts = {}) {
201760
201942
  return { steps: 0, timedOut: false, degraded: false };
201761
201943
  }
201762
201944
  const stepDelayMs = opts.stepDelayMs ?? LAZY_SCROLL_STEP_DELAY_MS;
201763
- const sleep5 = opts.sleep ?? ((ms) => new Promise((resolve78) => setTimeout(resolve78, ms)));
201945
+ const sleep5 = opts.sleep ?? ((ms) => new Promise((resolve79) => setTimeout(resolve79, ms)));
201764
201946
  const deadline = Date.now() + budgetMs;
201765
201947
  let steps = 0;
201766
201948
  let timedOut = false;
@@ -201983,7 +202165,7 @@ var init_animationCataloger = __esm({
201983
202165
  });
201984
202166
 
201985
202167
  // src/capture/mediaCapture.ts
201986
- 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";
201987
202169
  import { join as join119, extname as extname25 } from "path";
201988
202170
  function liveRemainingMs(budget, fallbackMs) {
201989
202171
  return budget.remainingMs?.() ?? fallbackMs;
@@ -202056,7 +202238,7 @@ async function renderLottiePreviews(chromeBrowser, lottieDir, outputDir, budget
202056
202238
  if (!file.endsWith(".json")) continue;
202057
202239
  if (liveRemainingMs(budget, 1) <= 0) break;
202058
202240
  try {
202059
- const raw = JSON.parse(readFileSync81(join119(lottieDir, file), "utf-8"));
202241
+ const raw = JSON.parse(readFileSync83(join119(lottieDir, file), "utf-8"));
202060
202242
  const fr = raw.fr || 30;
202061
202243
  const dur = ((raw.op || 0) - (raw.ip || 0)) / fr;
202062
202244
  const previewName = file.replace(".json", "-preview.png");
@@ -202069,7 +202251,7 @@ async function renderLottiePreviews(chromeBrowser, lottieDir, outputDir, budget
202069
202251
  previewPage = await chromeBrowser.newPage();
202070
202252
  if (liveRemainingMs(budget, 1) <= 0) break;
202071
202253
  await previewPage.setViewport({ width: 400, height: 400 });
202072
- const animData = JSON.parse(readFileSync81(join119(lottieDir, file), "utf-8"));
202254
+ const animData = JSON.parse(readFileSync83(join119(lottieDir, file), "utf-8"));
202073
202255
  const midFrame = Math.floor(((raw.op || 0) - (raw.ip || 0)) * 0.3);
202074
202256
  await previewPage.setContent(
202075
202257
  `<!DOCTYPE html>
@@ -202368,7 +202550,7 @@ var init_mediaCapture = __esm({
202368
202550
  });
202369
202551
 
202370
202552
  // src/capture/contentExtractor.ts
202371
- 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";
202372
202554
  import { basename as basename30, join as join120 } from "path";
202373
202555
  function resolveVisionPhaseCompletion(outcome, remainingMs) {
202374
202556
  if (outcome.budgetExhausted || remainingMs <= 0) {
@@ -202638,7 +202820,7 @@ async function captionImagesWithGemini(outputDir, progress, warnings, options =
202638
202820
  const filePath = join120(outputDir, "assets", file);
202639
202821
  const stat3 = statSync38(filePath);
202640
202822
  if (stat3.size > 4e6) return { file, caption: "" };
202641
- const buffer = readFileSync83(filePath);
202823
+ const buffer = readFileSync84(filePath);
202642
202824
  const base64 = buffer.toString("base64");
202643
202825
  const ext = file.split(".").pop()?.toLowerCase() || "png";
202644
202826
  const mimeType = ext === "jpg" ? "image/jpeg" : `image/${ext}`;
@@ -202706,7 +202888,7 @@ async function captionImagesWithGemini(outputDir, progress, warnings, options =
202706
202888
  const filePath = join120(assetsDir, relPath);
202707
202889
  let pngBase64;
202708
202890
  try {
202709
- const svgSource = readFileSync83(filePath, "utf-8");
202891
+ const svgSource = readFileSync84(filePath, "utf-8");
202710
202892
  const lightFillHits = (svgSource.match(/fill\s*=\s*["'](#fff(fff)?|white|#[ef][ef][ef]|#[ef]{6})["']/gi) || []).length;
202711
202893
  const darkFillHits = (svgSource.match(/fill\s*=\s*["'](#000(000)?|black|#[0-3]{6}|#[0-3]{3})["']/gi) || []).length;
202712
202894
  const bg = lightFillHits > darkFillHits ? { r: 32, g: 32, b: 32 } : { r: 255, g: 255, b: 255 };
@@ -202833,7 +203015,7 @@ function generateAssetDescriptions(outputDir, tokens, catalogedAssets, geminiCap
202833
203015
  const videoLines = [];
202834
203016
  try {
202835
203017
  const manifest = JSON.parse(
202836
- readFileSync83(join120(outputDir, "extracted", "video-manifest.json"), "utf-8")
203018
+ readFileSync84(join120(outputDir, "extracted", "video-manifest.json"), "utf-8")
202837
203019
  );
202838
203020
  for (const v2 of manifest) {
202839
203021
  if (!v2.localPath) continue;
@@ -203003,15 +203185,15 @@ var init_agentPromptGenerator = __esm({
203003
203185
  });
203004
203186
 
203005
203187
  // src/capture/scaffolding.ts
203006
- import { existsSync as existsSync116, writeFileSync as writeFileSync54, readFileSync as readFileSync84 } from "fs";
203007
- 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";
203008
203190
  function loadEnvFile(startDir) {
203009
203191
  try {
203010
- let dir = resolve73(startDir);
203192
+ let dir = resolve74(startDir);
203011
203193
  for (let i2 = 0; i2 < 5; i2++) {
203012
- const envPath = resolve73(dir, ".env");
203194
+ const envPath = resolve74(dir, ".env");
203013
203195
  try {
203014
- const envContent = readFileSync84(envPath, "utf-8");
203196
+ const envContent = readFileSync85(envPath, "utf-8");
203015
203197
  for (const line2 of envContent.split("\n")) {
203016
203198
  const trimmed = line2.trim();
203017
203199
  if (!trimmed || trimmed.startsWith("#")) continue;
@@ -203023,7 +203205,7 @@ function loadEnvFile(startDir) {
203023
203205
  }
203024
203206
  break;
203025
203207
  } catch {
203026
- dir = resolve73(dir, "..");
203208
+ dir = resolve74(dir, "..");
203027
203209
  }
203028
203210
  }
203029
203211
  } catch {
@@ -204305,7 +204487,7 @@ __export(capture_exports2, {
204305
204487
  default: () => capture_default,
204306
204488
  examples: () => examples33
204307
204489
  });
204308
- import { resolve as resolve74 } from "path";
204490
+ import { resolve as resolve75 } from "path";
204309
204491
  function emitCapturePhase(event) {
204310
204492
  diag.notice(`${CAPTURE_PHASE_PREFIX}${JSON.stringify(event)}`);
204311
204493
  }
@@ -204429,13 +204611,13 @@ var init_capture2 = __esm({
204429
204611
  const captureBudgetMs = parseCaptureBudget(args["capture-budget"]);
204430
204612
  const isDefaultOutput = !args.output;
204431
204613
  let outputName = args.output ?? "capture";
204432
- let outputDir = resolve74(outputName);
204614
+ let outputDir = resolve75(outputName);
204433
204615
  if (isDefaultOutput) {
204434
204616
  const { existsSync: existsSync131 } = await import("fs");
204435
204617
  let n2 = 2;
204436
204618
  while (existsSync131(outputDir) && n2 < 100) {
204437
204619
  outputName = `capture-${n2}`;
204438
- outputDir = resolve74(outputName);
204620
+ outputDir = resolve75(outputName);
204439
204621
  n2++;
204440
204622
  }
204441
204623
  if (existsSync131(outputDir)) {
@@ -204595,7 +204777,7 @@ __export(state_exports, {
204595
204777
  stateFilePath: () => stateFilePath,
204596
204778
  writeStackOutputs: () => writeStackOutputs
204597
204779
  });
204598
- 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";
204599
204781
  import { dirname as dirname56, join as join126 } from "path";
204600
204782
  function stateFilePath(stackName = DEFAULT_STACK_NAME, cwd = process.cwd()) {
204601
204783
  return join126(cwd, STATE_DIR_NAME, `${STATE_FILE_PREFIX}${stackName}.json`);
@@ -204610,7 +204792,7 @@ function readStackOutputs(stackName = DEFAULT_STACK_NAME, cwd = process.cwd()) {
204610
204792
  const path2 = stateFilePath(stackName, cwd);
204611
204793
  if (!existsSync118(path2)) return null;
204612
204794
  try {
204613
- return JSON.parse(readFileSync85(path2, "utf-8"));
204795
+ return JSON.parse(readFileSync86(path2, "utf-8"));
204614
204796
  } catch {
204615
204797
  return null;
204616
204798
  }
@@ -204776,16 +204958,16 @@ var init_sam = __esm({
204776
204958
 
204777
204959
  // src/commands/lambda/repoRoot.ts
204778
204960
  import { existsSync as existsSync120 } from "fs";
204779
- import { dirname as dirname57, resolve as resolve75 } from "path";
204961
+ import { dirname as dirname57, resolve as resolve76 } from "path";
204780
204962
  import { fileURLToPath as fileURLToPath15 } from "url";
204781
204963
  function repoRoot() {
204782
204964
  const override = process.env.HYPERFRAMES_REPO_ROOT;
204783
- if (override && existsSync120(resolve75(override, "packages", "aws-lambda", "package.json"))) {
204965
+ if (override && existsSync120(resolve76(override, "packages", "aws-lambda", "package.json"))) {
204784
204966
  return override;
204785
204967
  }
204786
204968
  let dir = dirname57(fileURLToPath15(import.meta.url));
204787
204969
  for (let depth = 0; depth < 12; depth++) {
204788
- if (existsSync120(resolve75(dir, "packages", "aws-lambda", "package.json"))) {
204970
+ if (existsSync120(resolve76(dir, "packages", "aws-lambda", "package.json"))) {
204789
204971
  return dir;
204790
204972
  }
204791
204973
  const parent = dirname57(dir);
@@ -204809,7 +204991,7 @@ __export(deploy_exports, {
204809
204991
  });
204810
204992
  import { spawnSync as spawnSync5 } from "child_process";
204811
204993
  import { existsSync as existsSync121 } from "fs";
204812
- import { join as join128, resolve as resolve76 } from "path";
204994
+ import { join as join128, resolve as resolve77 } from "path";
204813
204995
  async function runDeploy(args = {}) {
204814
204996
  const resolved2 = {
204815
204997
  stackName: args.stackName ?? DEFAULT_STACK_NAME,
@@ -204863,7 +205045,7 @@ async function runDeploy(args = {}) {
204863
205045
  console.log(` ${c.dim("Bucket:")} ${outputs.bucketName}`);
204864
205046
  console.log(` ${c.dim("State machine:")} ${outputs.stateMachineArn}`);
204865
205047
  console.log(` ${c.dim("Function:")} ${outputs.functionName}`);
204866
- console.log(` ${c.dim("State file:")} ${resolve76(statePath2)}`);
205048
+ console.log(` ${c.dim("State file:")} ${resolve77(statePath2)}`);
204867
205049
  console.log();
204868
205050
  console.log(c.dim(`Render with: hyperframes lambda render <project-dir>`));
204869
205051
  }
@@ -204939,14 +205121,14 @@ var init_sites = __esm({
204939
205121
  });
204940
205122
 
204941
205123
  // src/commands/lambda/_dimensions.ts
204942
- import { readFileSync as readFileSync86 } from "fs";
205124
+ import { readFileSync as readFileSync87 } from "fs";
204943
205125
  import { join as join129 } from "path";
204944
205126
  function warnOnDimensionMismatch(args) {
204945
205127
  if (args.quiet) return;
204946
205128
  if (args.outputResolution) return;
204947
205129
  let html;
204948
205130
  try {
204949
- html = readFileSync86(join129(args.projectDir, "index.html"), "utf-8");
205131
+ html = readFileSync87(join129(args.projectDir, "index.html"), "utf-8");
204950
205132
  } catch {
204951
205133
  return;
204952
205134
  }
@@ -205126,7 +205308,7 @@ __export(render_batch_exports, {
205126
205308
  runRenderBatch: () => runRenderBatch,
205127
205309
  runWithConcurrencyLimit: () => runWithConcurrencyLimit
205128
205310
  });
205129
- import { existsSync as existsSync123, readFileSync as readFileSync87 } from "fs";
205311
+ import { existsSync as existsSync123, readFileSync as readFileSync88 } from "fs";
205130
205312
  import { join as join131, resolve as resolvePath3 } from "path";
205131
205313
  async function loadSDK3() {
205132
205314
  return import("@hyperframes/aws-lambda/sdk");
@@ -205286,7 +205468,7 @@ function buildLambdaBatchRenderConfig(args) {
205286
205468
  return config;
205287
205469
  }
205288
205470
  function parseBatchFile(path2) {
205289
- const raw = readFileSync87(path2, "utf8");
205471
+ const raw = readFileSync88(path2, "utf8");
205290
205472
  const lines = raw.split(/\r?\n/);
205291
205473
  const out = [];
205292
205474
  for (let i2 = 0; i2 < lines.length; i2++) {
@@ -205480,7 +205662,7 @@ __export(policies_exports, {
205480
205662
  runPolicies: () => runPolicies,
205481
205663
  validatePolicy: () => validatePolicy
205482
205664
  });
205483
- import { readFileSync as readFileSync88 } from "fs";
205665
+ import { readFileSync as readFileSync89 } from "fs";
205484
205666
  function allRequiredActions() {
205485
205667
  const set = /* @__PURE__ */ new Set();
205486
205668
  for (const group of Object.values(REQUIRED_ACTIONS)) {
@@ -205586,7 +205768,7 @@ async function runPolicies(args) {
205586
205768
  }
205587
205769
  }
205588
205770
  function validatePolicy(policyPath) {
205589
- const raw = readFileSync88(policyPath, "utf-8");
205771
+ const raw = readFileSync89(policyPath, "utf-8");
205590
205772
  const parsed = JSON.parse(raw);
205591
205773
  const statements = Array.isArray(parsed.Statement) ? parsed.Statement : parsed.Statement ? [
205592
205774
  parsed.Statement
@@ -206197,9 +206379,9 @@ __export(cloudrun_exports, {
206197
206379
  missingCloudRunAdapterMessage: () => missingCloudRunAdapterMessage
206198
206380
  });
206199
206381
  import { spawnSync as spawnSync6 } from "child_process";
206200
- 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";
206201
206383
  import { homedir as homedir23 } from "os";
206202
- import { join as join133, resolve as resolve77 } from "path";
206384
+ import { join as join133, resolve as resolve78 } from "path";
206203
206385
  function loadCloudRunAdapter() {
206204
206386
  cloudRunAdapterPromise ??= Promise.all([
206205
206387
  import("@hyperframes/gcp-cloud-run/sdk"),
@@ -206235,7 +206417,7 @@ function readState2(args) {
206235
206417
  let base2 = {};
206236
206418
  if (existsSync124(statePath())) {
206237
206419
  try {
206238
- base2 = JSON.parse(readFileSync89(statePath(), "utf8"));
206420
+ base2 = JSON.parse(readFileSync90(statePath(), "utf8"));
206239
206421
  } catch {
206240
206422
  }
206241
206423
  }
@@ -206377,7 +206559,7 @@ function machineVars(args, project, region, image) {
206377
206559
  return vars;
206378
206560
  }
206379
206561
  function findRepoRoot(tfDir) {
206380
- const candidate = resolve77(tfDir, "..", "..", "..");
206562
+ const candidate = resolve78(tfDir, "..", "..", "..");
206381
206563
  if (existsSync124(join133(candidate, "packages", "gcp-cloud-run", "Dockerfile"))) return candidate;
206382
206564
  return null;
206383
206565
  }
@@ -206412,7 +206594,7 @@ async function runSites(args) {
206412
206594
  const state = readState2(args);
206413
206595
  const { deploySite } = await loadCloudRunAdapter();
206414
206596
  const handle = await deploySite({
206415
- projectDir: resolve77(projectDir),
206597
+ projectDir: resolve78(projectDir),
206416
206598
  bucketName: state.bucketName,
206417
206599
  siteId: args["site-id"]
206418
206600
  });
@@ -206447,11 +206629,11 @@ async function runRender2(args) {
206447
206629
  }
206448
206630
  const fps = resolveCloudRunFps(args, projectDir, "render");
206449
206631
  const state = readState2(args);
206450
- const variables = resolveAndValidateVariables(args, resolve77(projectDir));
206632
+ const variables = resolveAndValidateVariables(args, resolve78(projectDir));
206451
206633
  const config = buildRenderConfig(args, fps, width, height, variables);
206452
206634
  const { renderToCloudRun, getRenderProgress } = await loadCloudRunAdapter();
206453
206635
  const handle = await renderToCloudRun({
206454
- projectDir: resolve77(projectDir),
206636
+ projectDir: resolve78(projectDir),
206455
206637
  config,
206456
206638
  bucketName: state.bucketName,
206457
206639
  projectId: state.projectId,
@@ -206527,11 +206709,11 @@ async function runRenderBatch2(args) {
206527
206709
  failCommand();
206528
206710
  }
206529
206711
  const fps = resolveCloudRunFps(args, projectDir, "render-batch");
206530
- if (!existsSync124(resolve77(batchPath))) {
206712
+ if (!existsSync124(resolve78(batchPath))) {
206531
206713
  console.error(`[cloudrun render-batch] batch file not found: ${batchPath}`);
206532
206714
  failCommand();
206533
206715
  }
206534
- const entries2 = parseBatchFile2(resolve77(batchPath));
206716
+ const entries2 = parseBatchFile2(resolve78(batchPath));
206535
206717
  if (entries2.length === 0) {
206536
206718
  console.error("[cloudrun render-batch] batch file has no entries.");
206537
206719
  failCommand();
@@ -206550,7 +206732,7 @@ async function runRenderBatch2(args) {
206550
206732
  const maxConcurrent = parsePositiveInt2(args["max-concurrent"], "--max-concurrent") ?? DEFAULT_BATCH_MAX_CONCURRENT;
206551
206733
  const { deploySite, renderToCloudRun } = await loadCloudRunAdapter();
206552
206734
  const siteHandle = await deploySite({
206553
- projectDir: resolve77(projectDir),
206735
+ projectDir: resolve78(projectDir),
206554
206736
  bucketName: state.bucketName,
206555
206737
  siteId: args["site-id"]
206556
206738
  });
@@ -206594,7 +206776,7 @@ async function runRenderBatch2(args) {
206594
206776
  if (failed.length > 0) failCommand();
206595
206777
  }
206596
206778
  function parseBatchFile2(path2) {
206597
- const lines = readFileSync89(path2, "utf8").split(/\r?\n/);
206779
+ const lines = readFileSync90(path2, "utf8").split(/\r?\n/);
206598
206780
  const entries2 = [];
206599
206781
  lines.forEach((line2, idx) => {
206600
206782
  const trimmed = line2.trim();
@@ -206619,7 +206801,7 @@ function parseBatchFile2(path2) {
206619
206801
  async function runDestroy2(args) {
206620
206802
  const { getTerraformModuleDir } = await loadCloudRunAdapter();
206621
206803
  const tfDir = getTerraformModuleDir();
206622
- const state = existsSync124(statePath()) ? JSON.parse(readFileSync89(statePath(), "utf8")) : {};
206804
+ const state = existsSync124(statePath()) ? JSON.parse(readFileSync90(statePath(), "utf8")) : {};
206623
206805
  const project = args.project ?? state.projectId;
206624
206806
  const region = args.region ?? state.region ?? "us-central1";
206625
206807
  const image = args.image ?? "unused:latest";
@@ -206921,7 +207103,7 @@ ${HELP2}`);
206921
207103
  });
206922
207104
 
206923
207105
  // src/cloud/detectAspectRatio.ts
206924
- import { readFileSync as readFileSync90 } from "fs";
207106
+ import { readFileSync as readFileSync91 } from "fs";
206925
207107
  function extractAttributeNumber(tag, re2) {
206926
207108
  const match = tag.match(re2);
206927
207109
  if (!match) return null;
@@ -206933,7 +207115,7 @@ function extractAttributeNumber(tag, re2) {
206933
207115
  function detectAspectRatioFromHtml(entryHtmlPath) {
206934
207116
  let html;
206935
207117
  try {
206936
- html = readFileSync90(entryHtmlPath, "utf-8");
207118
+ html = readFileSync91(entryHtmlPath, "utf-8");
206937
207119
  } catch (err) {
206938
207120
  return { kind: "read-error", error: normalizeErrorMessage(err) };
206939
207121
  }
@@ -207003,14 +207185,14 @@ function signalAbortError(signal) {
207003
207185
  return reason instanceof Error ? reason : new Error("Poll aborted");
207004
207186
  }
207005
207187
  function defaultAbortableSleep(signal) {
207006
- return (ms) => new Promise((resolve78, reject2) => {
207188
+ return (ms) => new Promise((resolve79, reject2) => {
207007
207189
  const onAbort = () => {
207008
207190
  clearTimeout(timer);
207009
207191
  reject2(signalAbortError(signal));
207010
207192
  };
207011
207193
  const timer = setTimeout(() => {
207012
207194
  signal?.removeEventListener("abort", onAbort);
207013
- resolve78();
207195
+ resolve79();
207014
207196
  }, ms);
207015
207197
  signal?.addEventListener("abort", onAbort, { once: true });
207016
207198
  });
@@ -207085,7 +207267,7 @@ async function downloadToFile(url, destPath, options = {}) {
207085
207267
  return { path: destPath, bytes };
207086
207268
  }
207087
207269
  function waitForDrain(file, signal) {
207088
- return new Promise((resolve78, reject2) => {
207270
+ return new Promise((resolve79, reject2) => {
207089
207271
  const cleanup = () => {
207090
207272
  file.off("drain", onDrain);
207091
207273
  file.off("error", onError);
@@ -207094,7 +207276,7 @@ function waitForDrain(file, signal) {
207094
207276
  };
207095
207277
  const onDrain = () => {
207096
207278
  cleanup();
207097
- resolve78();
207279
+ resolve79();
207098
207280
  };
207099
207281
  const onError = (err) => {
207100
207282
  cleanup();
@@ -207116,10 +207298,10 @@ function waitForDrain(file, signal) {
207116
207298
  });
207117
207299
  }
207118
207300
  function closeFile(file) {
207119
- return new Promise((resolve78) => {
207301
+ return new Promise((resolve79) => {
207120
207302
  const done = () => {
207121
207303
  file.off("error", done);
207122
- resolve78();
207304
+ resolve79();
207123
207305
  };
207124
207306
  file.once("error", done);
207125
207307
  file.end(() => done());
@@ -207640,7 +207822,7 @@ __export(render_exports3, {
207640
207822
  validateDryRunSource: () => validateDryRunSource,
207641
207823
  validateResolutionFormatCombo: () => validateResolutionFormatCombo
207642
207824
  });
207643
- 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";
207644
207826
  import { existsSync as existsSync125 } from "fs";
207645
207827
  function parsePollIntervalMs(raw) {
207646
207828
  const n2 = parseNumericFlag(raw, { flag: "--poll-interval", min: 1 });
@@ -207766,7 +207948,7 @@ function prepareLocalArchive(source, composition, asJson) {
207766
207948
  }
207767
207949
  try {
207768
207950
  const fileMap = buildPublishFileMap(project.dir);
207769
- const entryPath = relative28(
207951
+ const entryPath = relative29(
207770
207952
  project.dir,
207771
207953
  resolvePath4(project.dir, composition ?? "index.html")
207772
207954
  ).replaceAll("\\", "/");
@@ -207951,7 +208133,7 @@ function handleFailedRender(detail, asJson) {
207951
208133
  }
207952
208134
  function resolveOutputPath2(output, renderId, format) {
207953
208135
  if (output) {
207954
- return isAbsolute17(output) ? output : resolvePath4(process.cwd(), output);
208136
+ return isAbsolute18(output) ? output : resolvePath4(process.cwd(), output);
207955
208137
  }
207956
208138
  const ext = FORMAT_EXT2[format] ?? `.${format}`;
207957
208139
  return resolvePath4(process.cwd(), "renders", `${renderId}${ext}`);
@@ -208912,7 +209094,7 @@ async function collectApiKey(inline) {
208912
209094
  return await promptForKey();
208913
209095
  }
208914
209096
  async function readAllWithTimeout(stream, timeoutMs) {
208915
- return await new Promise((resolve78, reject2) => {
209097
+ return await new Promise((resolve79, reject2) => {
208916
209098
  const chunks = [];
208917
209099
  const timer = setTimeout(() => {
208918
209100
  reject2(new Error(`Timed out waiting for stdin (${timeoutMs}ms). Pipe the key explicitly.`));
@@ -208922,7 +209104,7 @@ async function readAllWithTimeout(stream, timeoutMs) {
208922
209104
  });
208923
209105
  stream.on("end", () => {
208924
209106
  clearTimeout(timer);
208925
- resolve78(Buffer.concat(chunks).toString("utf8"));
209107
+ resolve79(Buffer.concat(chunks).toString("utf8"));
208926
209108
  });
208927
209109
  stream.on("error", (err) => {
208928
209110
  clearTimeout(timer);
@@ -209313,8 +209495,8 @@ async function confirmInteractive(prompt) {
209313
209495
  if (!process.stdin.isTTY) return false;
209314
209496
  const { createInterface: createInterface3 } = await import("readline");
209315
209497
  const rl = createInterface3({ input: process.stdin, output: process.stdout });
209316
- const answer = await new Promise((resolve78) => {
209317
- rl.question(prompt, (line2) => resolve78(line2));
209498
+ const answer = await new Promise((resolve79) => {
209499
+ rl.question(prompt, (line2) => resolve79(line2));
209318
209500
  });
209319
209501
  rl.close();
209320
209502
  return /^y(es)?$/i.test(answer.trim());
@@ -209752,12 +209934,12 @@ var init_freeze = __esm({
209752
209934
  });
209753
209935
 
209754
209936
  // ../core/dist/figma/jsonl.js
209755
- import { existsSync as existsSync126, readFileSync as readFileSync91 } from "fs";
209937
+ import { existsSync as existsSync126, readFileSync as readFileSync93 } from "fs";
209756
209938
  function readJsonlValues(path2) {
209757
209939
  if (!existsSync126(path2))
209758
209940
  return [];
209759
209941
  const out = [];
209760
- for (const line2 of readFileSync91(path2, "utf8").split(/\r?\n/)) {
209942
+ for (const line2 of readFileSync93(path2, "utf8").split(/\r?\n/)) {
209761
209943
  const trimmed = line2.trim();
209762
209944
  if (trimmed.length === 0)
209763
209945
  continue;
@@ -209776,7 +209958,7 @@ var init_jsonl = __esm({
209776
209958
  });
209777
209959
 
209778
209960
  // ../core/dist/figma/manifest.js
209779
- 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";
209780
209962
  import { join as join134 } from "path";
209781
209963
  function mediaDir(projectDir) {
209782
209964
  return join134(projectDir, ".media");
@@ -209817,7 +209999,7 @@ function findAllByFigmaNode(projectDir, fileKey2, nodeId) {
209817
209999
  }
209818
210000
  function updateRecord(projectDir, record) {
209819
210001
  const p2 = manifestPath(projectDir);
209820
- const lines = readFileSync93(p2, "utf8").split(/\r?\n/);
210002
+ const lines = readFileSync94(p2, "utf8").split(/\r?\n/);
209821
210003
  const out = lines.map((line2) => {
209822
210004
  const trimmed = line2.trim();
209823
210005
  if (trimmed.length === 0)
@@ -209838,7 +210020,7 @@ function nextId(projectDir, type) {
209838
210020
  const p2 = manifestPath(projectDir);
209839
210021
  if (!existsSync127(p2))
209840
210022
  return `${type}_001`;
209841
- for (const line2 of readFileSync93(p2, "utf8").split(/\r?\n/)) {
210023
+ for (const line2 of readFileSync94(p2, "utf8").split(/\r?\n/)) {
209842
210024
  const trimmed = line2.trim();
209843
210025
  if (trimmed.length === 0)
209844
210026
  continue;
@@ -210592,7 +210774,7 @@ __export(asset_exports, {
210592
210774
  runAssetImportMany: () => runAssetImportMany
210593
210775
  });
210594
210776
  import { existsSync as existsSync128 } from "fs";
210595
- import { join as join137, relative as relative29 } from "path";
210777
+ import { join as join137, relative as relative30 } from "path";
210596
210778
  function gatherAssetRefs(positionals) {
210597
210779
  return positionals.flatMap((r2) => /^https?:/i.test(r2.trim()) ? [r2] : r2.split(",")).map((r2) => r2.trim()).filter((r2) => r2.length > 0);
210598
210780
  }
@@ -210634,7 +210816,7 @@ async function freezeAndRecord(fileKey2, nodeId, url, ext, opts, version2, deps,
210634
210816
  const record = {
210635
210817
  id,
210636
210818
  type: "image",
210637
- path: relative29(deps.projectDir, destAbs),
210819
+ path: relative30(deps.projectDir, destAbs),
210638
210820
  source: `figma:${fileKey2}/${nodeId}`,
210639
210821
  ...description !== void 0 && { description },
210640
210822
  ...entity !== void 0 && { entity },
@@ -210878,7 +211060,7 @@ __export(component_exports, {
210878
211060
  runComponentImport: () => runComponentImport
210879
211061
  });
210880
211062
  import { existsSync as existsSync129, mkdirSync as mkdirSync69, writeFileSync as writeFileSync65 } from "fs";
210881
- import { join as join139, relative as relative30 } from "path";
211063
+ import { join as join139, relative as relative31 } from "path";
210882
211064
  function escapeAttr2(value) {
210883
211065
  return value.replace(/&/g, "&amp;").replace(/</g, "&lt;").replace(/>/g, "&gt;").replace(/"/g, "&quot;");
210884
211066
  }
@@ -210928,7 +211110,7 @@ async function runComponentImport(refInput, deps) {
210928
211110
  );
210929
211111
  return {
210930
211112
  name,
210931
- htmlPath: relative30(deps.projectDir, htmlFile),
211113
+ htmlPath: relative31(deps.projectDir, htmlFile),
210932
211114
  unresolved: bindings.unresolved,
210933
211115
  rasterized: mapped.rasterize,
210934
211116
  failedRasterize
@@ -210948,7 +211130,7 @@ async function rasterizeFallback(mapped, fileKey2, componentDir, deps) {
210948
211130
  continue;
210949
211131
  }
210950
211132
  frozenAssets.push(asset.record.path);
210951
- const srcRel = relative30(componentDir, join139(deps.projectDir, asset.record.path)).replaceAll(
211133
+ const srcRel = relative31(componentDir, join139(deps.projectDir, asset.record.path)).replaceAll(
210952
211134
  "\\",
210953
211135
  "/"
210954
211136
  );
@@ -211569,10 +211751,10 @@ if (rootVersionRequested) {
211569
211751
  process.exit(0);
211570
211752
  }
211571
211753
  try {
211572
- const { readFileSync: readFileSync94 } = await import("fs");
211573
- const { resolve: resolve78 } = await import("path");
211574
- const envPath = resolve78(process.cwd(), ".env");
211575
- 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");
211576
211758
  for (const rawLine of envContent.split("\n")) {
211577
211759
  let line2 = rawLine.trim();
211578
211760
  if (!line2 || line2.startsWith("#")) continue;