hyperframes 0.8.35 → 0.8.37

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.
@@ -55006,7 +55006,6 @@ async function syncVideoFrameVisibility(page, activeVideoIds) {
55006
55006
  img.style.visibility = "visible";
55007
55007
  }
55008
55008
  } else {
55009
- video.style.removeProperty("display");
55010
55009
  video.style.setProperty("visibility", "hidden", "important");
55011
55010
  video.style.setProperty("pointer-events", "none", "important");
55012
55011
  if (hasImg) {
@@ -74471,6 +74470,7 @@ function declarerVariableRules(document2, layerFor) {
74471
74470
  }
74472
74471
  return rules;
74473
74472
  }
74473
+ var MAX_INLINE_ASSET_BYTES;
74474
74474
  var init_htmlBundler = __esm({
74475
74475
  "../core/dist/compiler/htmlBundler.js"() {
74476
74476
  "use strict";
@@ -74491,6 +74491,7 @@ var init_htmlBundler = __esm({
74491
74491
  init_cssSelector();
74492
74492
  init_safePath();
74493
74493
  init_colorGrading();
74494
+ MAX_INLINE_ASSET_BYTES = 2 * 1024 * 1024;
74494
74495
  }
74495
74496
  });
74496
74497
 
@@ -86803,6 +86804,17 @@ var ArtifactTransaction = class {
86803
86804
  };
86804
86805
 
86805
86806
  // ../producer/src/services/render/capturePlan.ts
86807
+ function drawElementVerificationFailure(plan2, hasDiskFallbackHeadroom) {
86808
+ const { routing } = plan2;
86809
+ const needsHeadroom = routing.kind !== "default" && routing.fallback.kind === "sdr_disk" && routing.memoryExhaustionFallback.kind === "sdr_streaming";
86810
+ return {
86811
+ kind: "draw_element_verification",
86812
+ diskFallbackAvailable: needsHeadroom ? hasDiskFallbackHeadroom() : void 0
86813
+ };
86814
+ }
86815
+ function streamingCaptureFailure(plan2, classification, hasDiskFallbackHeadroom) {
86816
+ return classification.isVerifyError ? drawElementVerificationFailure(plan2, hasDiskFallbackHeadroom) : { kind: "capture_failure", memoryExhaustion: classification.isMemoryExhaustion };
86817
+ }
86806
86818
  function assertWorkerCount(workerCount) {
86807
86819
  if (!Number.isInteger(workerCount) || workerCount < 1) {
86808
86820
  throw new Error(`CapturePlan workerCount must be a positive integer; got ${workerCount}`);
@@ -86873,11 +86885,12 @@ function replanAfterFailure(plan2, failure) {
86873
86885
  });
86874
86886
  }
86875
86887
  const isMemoryExhaustion = failure.kind === "capture_failure" && failure.memoryExhaustion;
86888
+ const diskFallbackUnavailable = failure.kind === "draw_element_verification" && failure.diskFallbackAvailable === false;
86876
86889
  const fallback = plan2.routing.kind === "default" ? {
86877
86890
  kind: plan2.kind,
86878
86891
  workerCount: isMemoryExhaustion ? 1 : plan2.workerCount,
86879
86892
  forceParallelStream: false
86880
- } : isMemoryExhaustion ? plan2.routing.memoryExhaustionFallback : plan2.routing.fallback;
86893
+ } : isMemoryExhaustion || diskFallbackUnavailable ? plan2.routing.memoryExhaustionFallback : plan2.routing.fallback;
86881
86894
  return createCapturePlan({
86882
86895
  ...plan2,
86883
86896
  workerCount: fallback.workerCount,
@@ -92793,7 +92806,7 @@ function estimateDiskCaptureBytes(totalFrames, captureOptions) {
92793
92806
  const outputHeight = Math.ceil(captureOptions.height * scale);
92794
92807
  return Math.ceil(totalFrames) * outputWidth * outputHeight * 4;
92795
92808
  }
92796
- function assertDiskCaptureHeadroom(framesDir, totalFrames, captureOptions, freeDiskBytes = (path) => {
92809
+ function inspectDiskCaptureHeadroom(framesDir, totalFrames, captureOptions, freeDiskBytes = (path) => {
92797
92810
  try {
92798
92811
  const stat = statfsSync(path);
92799
92812
  return stat.bavail * stat.bsize;
@@ -92802,11 +92815,22 @@ function assertDiskCaptureHeadroom(framesDir, totalFrames, captureOptions, freeD
92802
92815
  }
92803
92816
  }) {
92804
92817
  const freeBytes = freeDiskBytes(framesDir);
92805
- if (freeBytes === null) return;
92806
92818
  const estimatedBytes = estimateDiskCaptureBytes(totalFrames, captureOptions);
92807
- if (estimatedBytes <= freeBytes * 0.9) return;
92819
+ if (freeBytes === null || estimatedBytes <= freeBytes * 0.9) {
92820
+ return { available: true, estimatedBytes, freeBytes };
92821
+ }
92822
+ return { available: false, estimatedBytes, freeBytes };
92823
+ }
92824
+ function assertDiskCaptureHeadroom(framesDir, totalFrames, captureOptions, freeDiskBytes) {
92825
+ const headroom = inspectDiskCaptureHeadroom(
92826
+ framesDir,
92827
+ totalFrames,
92828
+ captureOptions,
92829
+ freeDiskBytes
92830
+ );
92831
+ if (headroom.available) return;
92808
92832
  throw new Error(
92809
- `Disk capture may need ~${(estimatedBytes / 1e6).toFixed(1)} MB of temporary frame storage, but only ${(freeBytes / 1e6).toFixed(1)} MB is free at ${framesDir}. Re-run with --low-memory-mode to stream frames, raise PRODUCER_STREAMING_ENCODE_MAX_DURATION_SECONDS if streaming is supported, or free up disk space.`
92833
+ `Disk capture may need ~${(headroom.estimatedBytes / 1e6).toFixed(1)} MB of temporary frame storage, but only ${(headroom.freeBytes / 1e6).toFixed(1)} MB is free at ${framesDir}. Re-run with --low-memory-mode to stream frames, raise PRODUCER_STREAMING_ENCODE_MAX_DURATION_SECONDS if streaming is supported, or free up disk space.`
92810
92834
  );
92811
92835
  }
92812
92836
  async function runCaptureStage(input) {
@@ -95780,6 +95804,7 @@ import { mkdtempSync as mkdtempSync10, renameSync as renameSync6, rmSync as rmSy
95780
95804
  import { dirname as dirname17, join as join42 } from "path";
95781
95805
  var AUDIO_DURATION_TOLERANCE_SECONDS = 1e-3;
95782
95806
  var AAC_DELIVERY_TRUE_PEAK_DBFS = -1;
95807
+ var AAC_TRUE_PEAK_CORRECTION_HEADROOM_DB = 0.5;
95783
95808
  var MAX_TRUE_PEAK_CORRECTION_PASSES = 3;
95784
95809
  function buildAacTruePeakCorrectionArgs(inputPath, outputPath, targetDurationSeconds, attenuationDb) {
95785
95810
  return [
@@ -95979,10 +96004,15 @@ async function enforceAacTruePeak(input) {
95979
96004
  try {
95980
96005
  scratchDir = mkdtempSync10(join42(dirname17(input.audioPath), ".true-peak-"));
95981
96006
  const correctedPath = join42(scratchDir, "audio.m4a");
96007
+ const correctionTargetDbfs = AAC_DELIVERY_TRUE_PEAK_DBFS - AAC_TRUE_PEAK_CORRECTION_HEADROOM_DB;
96008
+ const measurements = [];
95982
96009
  let attenuationDb = 0;
95983
96010
  let measuredPath = input.audioPath;
95984
96011
  for (let pass = 0; pass <= MAX_TRUE_PEAK_CORRECTION_PASSES; pass += 1) {
95985
96012
  const truePeakDbfs = await input.probeTruePeak(measuredPath, input.signal);
96013
+ measurements.push(
96014
+ `pass ${pass}: ${truePeakDbfs.toFixed(3)} dBFS at ${attenuationDb.toFixed(3)} dB attenuation`
96015
+ );
95986
96016
  if (Number.isNaN(truePeakDbfs) || truePeakDbfs === Number.POSITIVE_INFINITY) {
95987
96017
  return { success: false, error: "audioPadTrim: FFmpeg reported an invalid true peak" };
95988
96018
  }
@@ -95991,7 +96021,7 @@ async function enforceAacTruePeak(input) {
95991
96021
  return { success: true };
95992
96022
  }
95993
96023
  if (pass === MAX_TRUE_PEAK_CORRECTION_PASSES) break;
95994
- attenuationDb += AAC_DELIVERY_TRUE_PEAK_DBFS - truePeakDbfs;
96024
+ attenuationDb += correctionTargetDbfs - truePeakDbfs;
95995
96025
  const result = await input.runner(
95996
96026
  buildAacTruePeakCorrectionArgs(
95997
96027
  input.audioPath,
@@ -96014,7 +96044,7 @@ async function enforceAacTruePeak(input) {
96014
96044
  }
96015
96045
  return {
96016
96046
  success: false,
96017
- error: `audioPadTrim: AAC true peak remained above ${AAC_DELIVERY_TRUE_PEAK_DBFS} dBFS after ${MAX_TRUE_PEAK_CORRECTION_PASSES} correction passes`
96047
+ error: `audioPadTrim: AAC true peak remained above ${AAC_DELIVERY_TRUE_PEAK_DBFS} dBFS after ${MAX_TRUE_PEAK_CORRECTION_PASSES} correction passes; ${measurements.join("; ")}`
96018
96048
  };
96019
96049
  } catch (err) {
96020
96050
  return {
@@ -97923,10 +97953,12 @@ async function executeRenderPipeline(input) {
97923
97953
  isVerifyError ? "drawElement self-verify failed; retrying with forceScreenshot" : isDeStall ? "drawElement renderer stalled; retrying with forceScreenshot" : isSequentialStall ? "sequential capture stalled; retrying with a fresh screenshot session" : "capture failed; retrying with a fresh screenshot session"
97924
97954
  );
97925
97955
  const failedRouting = capturePlan.routing.kind;
97926
- capturePlan = replanAfterFailure(
97956
+ const failure = streamingCaptureFailure(
97927
97957
  capturePlan,
97928
- isVerifyError ? { kind: "draw_element_verification" } : { kind: "capture_failure", memoryExhaustion: isMemoryExhaustion }
97958
+ { isVerifyError, isMemoryExhaustion },
97959
+ () => inspectDiskCaptureHeadroom(framesDir, totalFrames, buildCaptureOptions()).available
97929
97960
  );
97961
+ capturePlan = replanAfterFailure(capturePlan, failure);
97930
97962
  syncCapturePlan();
97931
97963
  updateCaptureObservability({
97932
97964
  forceScreenshot: capturePlan.forceScreenshot,
@@ -97946,13 +97978,11 @@ async function executeRenderPipeline(input) {
97946
97978
  probeSession = null;
97947
97979
  await closeOrphanedProbeForRetry(orphaned, closeCaptureSession, log, "streaming");
97948
97980
  }
97949
- if (failedRouting === "worker_inversion") {
97950
- log.info(
97951
- `[Render] Reverting worker inversion for the retry: ${capturePlan.workerCount} workers, plan=${capturePlan.kind}.`
97952
- );
97953
- } else if (failedRouting === "parallel_router") {
97981
+ if (failedRouting !== "default") {
97982
+ const route = failedRouting === "worker_inversion" ? "worker inversion" : "parallel router";
97983
+ const diskFallbackLacksHeadroom = failure.kind === "draw_element_verification" && failure.diskFallbackAvailable === false;
97954
97984
  log.info(
97955
- `[Render] Reverting parallel router for the retry: ${capturePlan.workerCount} workers, plan=${capturePlan.kind}.`
97985
+ diskFallbackLacksHeadroom ? `[Render] ${route} disk fallback lacks headroom; retrying with ${capturePlan.workerCount}-worker screenshot streaming.` : `[Render] Reverting ${route} for the retry: ${capturePlan.workerCount} workers, plan=${capturePlan.kind}.`
97956
97986
  );
97957
97987
  }
97958
97988
  if (capturePlan.kind === "sdr_streaming") {
@@ -99626,8 +99656,8 @@ async function runFontLocalize(io, localize) {
99626
99656
  }
99627
99657
 
99628
99658
  // src/version.ts
99629
- var VERSION = true ? "0.8.35" : "0.0.0-dev";
99630
- var PRODUCER_VERSION = true ? "0.8.35" : "0.0.0-dev";
99659
+ var VERSION = true ? "0.8.37" : "0.0.0-dev";
99660
+ var PRODUCER_VERSION = true ? "0.8.37" : "0.0.0-dev";
99631
99661
 
99632
99662
  // src/fontLocalizeCli.ts
99633
99663
  async function readStdin() {