hyperframes 0.8.203 → 0.8.204

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.
Files changed (165) hide show
  1. package/dist/{add-HVWZZBVO.js → add-HBFVYKGU.js} +11 -11
  2. package/dist/{animatedGifPrep-7SQD4XQY.js → animatedGifPrep-VBUKGEZ6.js} +5 -5
  3. package/dist/api.js +13 -13
  4. package/dist/{asset-H2D5ENJ6.js → asset-OVLMJY4S.js} +2 -2
  5. package/dist/{assetCataloger-PIRQXMHM.js → assetCataloger-K4INCLFU.js} +5 -5
  6. package/dist/{audio-F6TTYCGR.js → audio-JHW3HLHK.js} +11 -11
  7. package/dist/{auth-HK5IYSNR.js → auth-RH67KQMZ.js} +1 -1
  8. package/dist/{autoUpdate-DQMCXE6X.js → autoUpdate-JYR2RW5Z.js} +2 -2
  9. package/dist/{backgroundChecks-Y466WV7Y.js → backgroundChecks-DPHRM4HJ.js} +3 -3
  10. package/dist/backgroundChecksWorker.js +3 -3
  11. package/dist/{batchRender-PGJELR2B.js → batchRender-JFUWZR3M.js} +3 -3
  12. package/dist/{beats-AD2IJGBZ.js → beats-AWAFZGOT.js} +7 -7
  13. package/dist/{benchmark-B564OTLO.js → benchmark-VQCCULJ2.js} +8 -8
  14. package/dist/{browser-B7BELTLZ.js → browser-TT5L7D32.js} +3 -3
  15. package/dist/{bundleWithLocalizedFonts-INYZKCJN.js → bundleWithLocalizedFonts-EHXEP5ZL.js} +2 -2
  16. package/dist/{capture-VMJVXQJ2.js → capture-5CM2P6CB.js} +8 -8
  17. package/dist/{capture-LKV2HS5Q.js → capture-Y7TGR3BI.js} +2 -2
  18. package/dist/{captureCompositionFrame-L2W6KSAL.js → captureCompositionFrame-LIT6U6C4.js} +10 -10
  19. package/dist/{catalog-5ETWOAL2.js → catalog-WZN2XB7D.js} +11 -11
  20. package/dist/{catch-up-3RWU3BRJ.js → catch-up-WZMQUW5H.js} +4 -4
  21. package/dist/{check-KD57MC5Z.js → check-YVJCDCJS.js} +33 -33
  22. package/dist/{checkBrowser-R72NYI4S.js → checkBrowser-7V2DGDVD.js} +28 -28
  23. package/dist/{chunk-VI7GBPF6.js → chunk-23RPCDGE.js} +2 -2
  24. package/dist/{chunk-WGZOPGHX.js → chunk-2756LXGY.js} +1 -1
  25. package/dist/{chunk-TMIX2WQL.js → chunk-34VLVDOU.js} +3 -3
  26. package/dist/{chunk-Q6B7MFTU.js → chunk-3GPDAE3D.js} +1 -1
  27. package/dist/{chunk-GOPGJXEQ.js → chunk-4CR23IYU.js} +4 -4
  28. package/dist/{chunk-3NUFUEAX.js → chunk-4HJMZI4H.js} +13 -13
  29. package/dist/{chunk-YOLS2E5P.js → chunk-54FO6TN7.js} +17 -17
  30. package/dist/{chunk-OKZZWUZN.js → chunk-54K7HW46.js} +1 -1
  31. package/dist/{chunk-TZKMAQOY.js → chunk-5RJSWYWL.js} +1 -1
  32. package/dist/{chunk-7RQXBL4L.js → chunk-5UW7WCHQ.js} +7 -7
  33. package/dist/{chunk-FRXPZCEP.js → chunk-65VFH2UV.js} +1 -1
  34. package/dist/{chunk-FE72SB2F.js → chunk-6KZY5RSV.js} +1 -1
  35. package/dist/{chunk-GOWNPWCJ.js → chunk-6RLP6RDE.js} +1 -1
  36. package/dist/{chunk-TRDUMOUW.js → chunk-7PRESGFT.js} +2 -2
  37. package/dist/{chunk-TT6HSBYK.js → chunk-7RB4I2E6.js} +5 -5
  38. package/dist/{chunk-VYFMJ2HM.js → chunk-AQS3MMEQ.js} +9 -9
  39. package/dist/{chunk-TVC4EI2W.js → chunk-CXZDIWMK.js} +1 -1
  40. package/dist/{chunk-DZZ6VHPY.js → chunk-D3EZHD2D.js} +1 -1
  41. package/dist/{chunk-X5PKA5KH.js → chunk-D5CAZ7R4.js} +2 -2
  42. package/dist/{chunk-ND5ELD7A.js → chunk-DBF6LLXB.js} +1 -1
  43. package/dist/{chunk-JVWPKIVV.js → chunk-DRDG46KK.js} +12 -12
  44. package/dist/{chunk-CTNWZASM.js → chunk-DTV3VHFE.js} +2 -2
  45. package/dist/{chunk-B7MRZJOW.js → chunk-EF7R5EBJ.js} +9 -9
  46. package/dist/{chunk-OKRH4JU3.js → chunk-GGEA5EHR.js} +1 -1
  47. package/dist/{chunk-HO2N4UWV.js → chunk-HBDQGIQA.js} +2 -2
  48. package/dist/{chunk-3YZ2ESXP.js → chunk-IJ6RY4CH.js} +1 -1
  49. package/dist/{chunk-JKUVH7BF.js → chunk-KOBPUFCN.js} +1 -1
  50. package/dist/{chunk-HAKKV3SY.js → chunk-LN5EJMSC.js} +7 -7
  51. package/dist/{chunk-FTARAZAL.js → chunk-LVMJXO45.js} +1 -1
  52. package/dist/{chunk-5GFNMC2F.js → chunk-MSH2F7VW.js} +1 -1
  53. package/dist/{chunk-H6NXL4VB.js → chunk-N3EJG2X4.js} +1 -1
  54. package/dist/{chunk-CAHZZOEC.js → chunk-NJT6SZGL.js} +1 -1
  55. package/dist/{chunk-2G6EI3WQ.js → chunk-OPFG563D.js} +1 -1
  56. package/dist/{chunk-35KHQKEX.js → chunk-QCQDUQVJ.js} +1 -1
  57. package/dist/{chunk-HYMW42OE.js → chunk-QWATUGUX.js} +3 -3
  58. package/dist/{chunk-DO2OTFCJ.js → chunk-QZ4HQQYS.js} +1 -1
  59. package/dist/{chunk-GX4CEJCX.js → chunk-RFCLI6TW.js} +3 -3
  60. package/dist/{chunk-KWQWEY6F.js → chunk-S35XO2ZA.js} +1 -1
  61. package/dist/{chunk-7SNVSO4A.js → chunk-TAYZSNYS.js} +1 -1
  62. package/dist/{chunk-BD3LJRJT.js → chunk-TBSYUEB7.js} +1 -1
  63. package/dist/{chunk-CFFPH6D3.js → chunk-TCI4MUT6.js} +1 -1
  64. package/dist/{chunk-RUVO77RK.js → chunk-TNOERLC6.js} +2 -2
  65. package/dist/{chunk-R36C6H32.js → chunk-TQH7BF7K.js} +1 -1
  66. package/dist/{chunk-VL5ES6ZM.js → chunk-UKXF4IPA.js} +5 -5
  67. package/dist/{chunk-4GV742H2.js → chunk-US6JSQ2L.js} +2 -2
  68. package/dist/{chunk-RZAPLMVM.js → chunk-VC3BMKYO.js} +3 -3
  69. package/dist/{chunk-HOQNNE3I.js → chunk-VCBZOU7U.js} +1 -1
  70. package/dist/{chunk-UVV2DKZR.js → chunk-WLD4PX3P.js} +2 -2
  71. package/dist/{chunk-ML7IPYOC.js → chunk-WM7GOKEP.js} +1 -1
  72. package/dist/{chunk-E3LRVXM2.js → chunk-WMCGD4XL.js} +1 -1
  73. package/dist/{chunk-RWHMKGJA.js → chunk-WXAQT63P.js} +3 -3
  74. package/dist/{chunk-JEFIEL6S.js → chunk-X7XICOVM.js} +1 -1
  75. package/dist/{chunk-MPGJNUML.js → chunk-XX5U64F2.js} +2 -2
  76. package/dist/{chunk-KBCV6BHL.js → chunk-Y63CT2ZC.js} +50 -36
  77. package/dist/{chunk-UNBGZQZ6.js → chunk-YIN2JAZE.js} +185 -78
  78. package/dist/{chunk-32SIPBON.js → chunk-YLGRZSH4.js} +1 -1
  79. package/dist/chunk-YRQPU7SV.js +3983 -0
  80. package/dist/{chunk-IREQUN2P.js → chunk-YU53JSUZ.js} +1 -1
  81. package/dist/{chunk-YJKSLCKV.js → chunk-ZBDVKLIU.js} +5 -5
  82. package/dist/{clean-7OBS6NMK.js → clean-3JE2KYTC.js} +14 -14
  83. package/dist/cli.js +53 -53
  84. package/dist/{cloud-JFL6IMUV.js → cloud-Z54BHP6G.js} +4 -4
  85. package/dist/{cloudrun-GHA4FXS3.js → cloudrun-4CPQLU5M.js} +4 -4
  86. package/dist/{compare-UFTPPNLD.js → compare-AQMLMTFD.js} +25 -25
  87. package/dist/{compiler-6LUGBYWD.js → compiler-LIJYMSEL.js} +2 -2
  88. package/dist/{component-4W3MT53Y.js → component-ZH37EIYB.js} +3 -3
  89. package/dist/{compositions-63M4AHPA.js → compositions-DF2FM6YD.js} +9 -9
  90. package/dist/{delete-XCSORSYR.js → delete-A3NSK2HH.js} +2 -2
  91. package/dist/{deploy-JUC2BVCE.js → deploy-6RC2DXPQ.js} +1 -1
  92. package/dist/{dist-SOMNYPEE.js → dist-VSIT3UAX.js} +2 -2
  93. package/dist/{doctor-LZ5KMUGS.js → doctor-RILK4ATO.js} +9 -9
  94. package/dist/{events-DSJDLP3V.js → events-B5EKVEPW.js} +3 -3
  95. package/dist/{events-XN26WXN3.js → events-SL434XAY.js} +2 -2
  96. package/dist/{feedback-VZZT77OU.js → feedback-S4PC6VAR.js} +7 -7
  97. package/dist/{ffmpeg-TU5BPXP6.js → ffmpeg-XSDPPZCU.js} +5 -5
  98. package/dist/{figma-BYBMKBNS.js → figma-MV2L6E2Z.js} +3 -3
  99. package/dist/fontLocalizeCli.js +7 -7
  100. package/dist/{get-JAKXQVNF.js → get-ID3Y3PCN.js} +2 -2
  101. package/dist/{gpuPolicy-A6BRKFTK.js → gpuPolicy-2LRMQOAD.js} +5 -5
  102. package/dist/{grade-compare-6TLS63GE.js → grade-compare-NV3TKIOO.js} +26 -26
  103. package/dist/{help-WMABNXSF.js → help-ZPT23LZ3.js} +1 -1
  104. package/dist/{history-PNOTK4KM.js → history-MZGDX3TR.js} +6 -6
  105. package/dist/hyperframe.manifest.json +1 -1
  106. package/dist/hyperframe.runtime.iife.js +17 -17
  107. package/dist/hyperframes-player.global.js +3 -3
  108. package/dist/{info-457IZRNA.js → info-FIZ4A54H.js} +7 -7
  109. package/dist/{init-QNOPZRQJ.js → init-WX4MNPL2.js} +25 -25
  110. package/dist/{inspect-4PECXE65.js → inspect-R5KWWKNJ.js} +26 -26
  111. package/dist/{installer-K6VCZN74.js → installer-CTV5FKYQ.js} +4 -4
  112. package/dist/{keyframes-KBR4RHQO.js → keyframes-FAJY5RK5.js} +6 -6
  113. package/dist/{lambda-FSC3XJOQ.js → lambda-3MCC2ZH7.js} +6 -6
  114. package/dist/{layout-PFXAKL65.js → layout-3RTVYRRN.js} +26 -26
  115. package/dist/{lint-MR7WHCBO.js → lint-ZDCVL7K4.js} +6 -6
  116. package/dist/{list-OCSE7GSX.js → list-SBCXW2UT.js} +2 -2
  117. package/dist/{login-M4L3MHVL.js → login-VQ2LQ2YG.js} +4 -4
  118. package/dist/{manager-G6G2WQU3.js → manager-ZRF6UXUM.js} +6 -6
  119. package/dist/{media-treatment-6ATFI5M2.js → media-treatment-MFIP7Q4G.js} +11 -11
  120. package/dist/{models-NPSWNLVS.js → models-OU36YZCT.js} +9 -9
  121. package/dist/{motionShot-HVPC2V7Q.js → motionShot-SHDUG7YR.js} +13 -13
  122. package/dist/{normalize-audio-YEEAY2TB.js → normalize-audio-7RTPEV7Y.js} +7 -7
  123. package/dist/{open-6LSE4QDQ.js → open-HT4RG32S.js} +11 -11
  124. package/dist/{parakeetRunner-HMDK2MEQ.js → parakeetRunner-DOVPZDCH.js} +10 -10
  125. package/dist/{pipeline-GQV2DL2T.js → pipeline-NIVQ6E2G.js} +6 -6
  126. package/dist/{play-NORPMDGV.js → play-HPX5SIRQ.js} +17 -17
  127. package/dist/{preflight-SDPP63GU.js → preflight-TNYC7EIS.js} +6 -6
  128. package/dist/{present-BVPAEHE6.js → present-QSOIMURR.js} +13 -13
  129. package/dist/{preview-C762R2VY.js → preview-WDO53XKK.js} +16 -16
  130. package/dist/{producer-XXFVYAW6.js → producer-G27KP3IY.js} +1 -1
  131. package/dist/{projectConfig-72HEHSHM.js → projectConfig-CP722RCM.js} +6 -6
  132. package/dist/{publication-QOK2NB7H.js → publication-LCWVBLDN.js} +2 -2
  133. package/dist/{publish-OVCPM2R4.js → publish-BIY6LEZ2.js} +8 -8
  134. package/dist/{remove-background-BK7G24LO.js → remove-background-NPLZGLZ3.js} +7 -7
  135. package/dist/{render-BA4DJGH2.js → render-HHUGUKG6.js} +26 -26
  136. package/dist/{render-3RV5ZZHB.js → render-IHNAZXA2.js} +5 -5
  137. package/dist/{render-KCRWPUSH.js → render-J57LAXB5.js} +13 -13
  138. package/dist/{render-batch-EKMNALAK.js → render-batch-FK26OQ5E.js} +5 -5
  139. package/dist/{resolver-ZQAEKX2N.js → resolver-FWJXO6DY.js} +4 -4
  140. package/dist/{sherpa-UPEEZCVJ.js → sherpa-BXFJU5EP.js} +9 -9
  141. package/dist/{skills-EBCABDEA.js → skills-7XS4HZBC.js} +5 -5
  142. package/dist/{skillsUpdateCheck-2TBQ3R7X.js → skillsUpdateCheck-MGU5KLR4.js} +3 -3
  143. package/dist/{snapshot-KRDQ6UFY.js → snapshot-O2PMEMKH.js} +30 -30
  144. package/dist/{src-FMPMLWOE.js → src-OQRG6BT7.js} +4 -4
  145. package/dist/{src-HODRARUH.js → src-Q4R2YPKA.js} +6 -6
  146. package/dist/{staticProjectServer-NBWPYBIH.js → staticProjectServer-6OY4VMO6.js} +14 -14
  147. package/dist/studio/assets/{hyperframes-player-C3pgGOtp.js → hyperframes-player-CttA4PW7.js} +1 -1
  148. package/dist/studio/assets/{index-BbcMyD3j.js → index-DmST2bTJ.js} +110 -110
  149. package/dist/studio/assets/{index-5EFQxr70.js → index-DpxSurnJ.js} +1 -1
  150. package/dist/studio/index.html +1 -1
  151. package/dist/{studio-api-BOV2DTPC.js → studio-api-YSUTKHV7.js} +7 -7
  152. package/dist/{studioServer-TSKSIQC3.js → studioServer-APGEQIW5.js} +43 -43
  153. package/dist/{telemetry-RLKGEBGR.js → telemetry-3B6EA5IU.js} +3 -3
  154. package/dist/{timeline-ADFTKSNX.js → timeline-QWM6JS4B.js} +15 -15
  155. package/dist/{tokens-2NKS4KAO.js → tokens-TKLSP3OQ.js} +2 -2
  156. package/dist/{transcribe-63XQBLF3.js → transcribe-PODOCWCC.js} +8 -8
  157. package/dist/{transcribe-AHNMYPY4.js → transcribe-XOPMHJLJ.js} +14 -14
  158. package/dist/{updateCheck-XDYXIVKF.js → updateCheck-RO6FPYMZ.js} +2 -2
  159. package/dist/{upgrade-GK2RSMPV.js → upgrade-EVNIL5TZ.js} +2 -2
  160. package/dist/{urlDownloader-X2B7NQSQ.js → urlDownloader-F5HYFRA6.js} +4 -4
  161. package/dist/{validate-UN4RB6KN.js → validate-NXLFCHGG.js} +20 -20
  162. package/dist/{video-QRWQLU5O.js → video-ECV2OIQN.js} +5 -5
  163. package/dist/warmCheck.js +33 -33
  164. package/package.json +1 -1
  165. package/dist/chunk-42DLVZNO.js +0 -3983
@@ -16,7 +16,7 @@ import {
16
16
  EncoderInterruptedError,
17
17
  encoderFailureError,
18
18
  prepareAnimatedGifInputs
19
- } from "./chunk-RUVO77RK.js";
19
+ } from "./chunk-TNOERLC6.js";
20
20
  import {
21
21
  parseEncoderOptions
22
22
  } from "./chunk-KLIKCX6Q.js";
@@ -162,7 +162,7 @@ import {
162
162
  verifyDiskDrawElementSamples,
163
163
  videoAudioId,
164
164
  writeCapturedFrame
165
- } from "./chunk-KBCV6BHL.js";
165
+ } from "./chunk-Y63CT2ZC.js";
166
166
  import {
167
167
  DISTRIBUTED_FPS,
168
168
  HF_VFX_ATTR,
@@ -178,7 +178,7 @@ import {
178
178
  parseVfxChain,
179
179
  resolveAuthoredTimingWindow,
180
180
  toFps
181
- } from "./chunk-FRXPZCEP.js";
181
+ } from "./chunk-65VFH2UV.js";
182
182
  import {
183
183
  assignBundledRuntimeCompositionIds,
184
184
  buildVariablesByCompScript,
@@ -190,7 +190,7 @@ import {
190
190
  inlineSubCompositions,
191
191
  parsesAsScript,
192
192
  prepareFlattenedInnerRoot
193
- } from "./chunk-E3LRVXM2.js";
193
+ } from "./chunk-WMCGD4XL.js";
194
194
  import {
195
195
  COMPOSITION_SOURCE_URL,
196
196
  HF_COLOR_GRADING_ATTR,
@@ -222,7 +222,7 @@ import {
222
222
  sourceTimeAt,
223
223
  styleElementsFor,
224
224
  timeAtSourceTime
225
- } from "./chunk-42DLVZNO.js";
225
+ } from "./chunk-YRQPU7SV.js";
226
226
  import {
227
227
  CANVAS_DIMENSIONS,
228
228
  HTML_BODY_CSS_HEIGHT_FIRST_RE,
@@ -1468,6 +1468,7 @@ function buildRenderErrorDetails(input) {
1468
1468
  }
1469
1469
 
1470
1470
  // ../producer/src/services/render/renderEventPublisher.ts
1471
+ var FLUSH_TIMEOUT_MS = 1e4;
1471
1472
  function snapshotJob(job) {
1472
1473
  return {
1473
1474
  ...job,
@@ -1497,7 +1498,15 @@ var OrderedRenderEventPublisher = class {
1497
1498
  });
1498
1499
  }
1499
1500
  async flush() {
1500
- await this.tail;
1501
+ let timer;
1502
+ const drained = await Promise.race([
1503
+ this.tail.then(() => true),
1504
+ new Promise((resolve11) => {
1505
+ timer = setTimeout(() => resolve11(false), FLUSH_TIMEOUT_MS);
1506
+ })
1507
+ ]);
1508
+ clearTimeout(timer);
1509
+ if (!drained) this.log.warn("Render event sink did not drain; continuing without it");
1501
1510
  }
1502
1511
  };
1503
1512
  function publishRenderFailure(job, failure, onProgress) {
@@ -5442,6 +5451,56 @@ function heartbeatTargetMs(index) {
5442
5451
  const overflow = index - HEARTBEAT_RAMP_MS.length + 1;
5443
5452
  return HEARTBEAT_RAMP_END_MS + overflow * HEARTBEAT_REPEAT_MS;
5444
5453
  }
5454
+ var RenderStageStalledError = class extends CaptureFailure {
5455
+ code = "RENDER_STAGE_STALLED";
5456
+ owner = "system";
5457
+ retryable = false;
5458
+ constructor(phase, silentMs, progress) {
5459
+ super({
5460
+ kind: "protocol_timeout",
5461
+ message: `[Render] ${phase} stalled: no progress for ${silentMs}ms (stuck at ${progress}).`
5462
+ });
5463
+ this.name = "RenderStageStalledError";
5464
+ }
5465
+ };
5466
+ var STALL_POLL_MS = 5e3;
5467
+ function watchStall(phase, rule) {
5468
+ let last = rule.progress();
5469
+ let budgetMs = rule.firstProgressMs;
5470
+ let lastChangeAt = Date.now();
5471
+ let attempt;
5472
+ let timer;
5473
+ const restartWindow = (ms) => {
5474
+ last = rule.progress();
5475
+ budgetMs = ms;
5476
+ lastChangeAt = Date.now();
5477
+ };
5478
+ const tripped = new Promise((_, reject) => {
5479
+ timer = setInterval(
5480
+ () => {
5481
+ const current = rule.progress();
5482
+ if (current !== last) return restartWindow(rule.noProgressMs);
5483
+ if (Date.now() - lastChangeAt < budgetMs) return;
5484
+ const error = new RenderStageStalledError(phase, budgetMs, current);
5485
+ if (attempt && !attempt.signal.aborted) {
5486
+ attempt.abort(error);
5487
+ return restartWindow(rule.noProgressMs);
5488
+ }
5489
+ clearInterval(timer);
5490
+ reject(error);
5491
+ },
5492
+ Math.min(STALL_POLL_MS, rule.noProgressMs, rule.firstProgressMs)
5493
+ );
5494
+ });
5495
+ const openAttempt = (parent) => {
5496
+ attempt = new AbortController();
5497
+ restartWindow(rule.firstProgressMs);
5498
+ return parent ? AbortSignal.any([parent, attempt.signal]) : attempt.signal;
5499
+ };
5500
+ const stalledBy = () => attempt?.signal.aborted ? attempt.signal.reason : void 0;
5501
+ return { tripped, openAttempt, stalledBy, stop: () => clearInterval(timer) };
5502
+ }
5503
+ var openUnwatchedAttempt = (parent) => parent ?? new AbortController().signal;
5445
5504
  async function observeRenderStage(recorder, phase, data, fn, options = {}) {
5446
5505
  const heartbeatMessage = options.heartbeatMessage ?? "stage still running";
5447
5506
  const startedAt = recorder.stageStart(phase, data);
@@ -5463,15 +5522,19 @@ async function observeRenderStage(recorder, phase, data, fn, options = {}) {
5463
5522
  heartbeatTimer.unref?.();
5464
5523
  };
5465
5524
  scheduleNextHeartbeat();
5525
+ const stall = options.stall ? watchStall(phase, options.stall) : void 0;
5466
5526
  const clearHeartbeats = () => {
5467
5527
  clearTimeout(heartbeatTimer);
5528
+ stall?.stop();
5468
5529
  };
5469
5530
  try {
5470
- const result = await fn();
5531
+ const run = fn(stall?.openAttempt ?? openUnwatchedAttempt);
5532
+ const result = await (stall ? Promise.race([run, stall.tripped]) : run);
5471
5533
  clearHeartbeats();
5472
5534
  recorder.stageEnd(phase, startedAt, data);
5473
5535
  return result;
5474
- } catch (error) {
5536
+ } catch (caught) {
5537
+ const error = stall?.stalledBy() ?? caught;
5475
5538
  clearHeartbeats();
5476
5539
  recorder.stageError(phase, startedAt, error, data);
5477
5540
  throw error;
@@ -7209,9 +7272,10 @@ async function discoverMediaFromBrowser(page) {
7209
7272
  const tagName = isImage ? "image" : htmlEl.tagName.toLowerCase() === "video" ? "video" : "audio";
7210
7273
  const id = htmlEl.getAttribute("data-hf-render-id") || htmlEl.id || (isImage ? autoImageIds.get(htmlEl) : void 0);
7211
7274
  if (!id) return;
7212
- const ownSrc = htmlEl.getAttribute("src");
7213
- const blankSrc = ownSrc !== null && ownSrc.trim() === "" && !htmlEl.querySelector("source[src]");
7214
- const src = blankSrc ? "" : htmlEl.currentSrc || htmlEl.src || ownSrc || "";
7275
+ const resolvedSrc = htmlEl.currentSrc || htmlEl.src || htmlEl.getAttribute("src") || "";
7276
+ const withoutQueryAndHash = (url) => url.replace(/[?#][\s\S]*$/, "");
7277
+ const isPageItself = withoutQueryAndHash(resolvedSrc) === withoutQueryAndHash(location.href);
7278
+ const src = isPageItself ? "" : resolvedSrc;
7215
7279
  const start = parseFloat(htmlEl.getAttribute("data-start") || "0");
7216
7280
  const endRaw = htmlEl.getAttribute("data-end");
7217
7281
  const durationRaw = htmlEl.getAttribute("data-duration");
@@ -9432,6 +9496,7 @@ async function runCaptureStage(input) {
9432
9496
  interleaveFrames: input.interleaveFrames,
9433
9497
  dedupPerfs,
9434
9498
  pageErrorLines: workerPageErrors,
9499
+ openAttempt: input.openAttempt,
9435
9500
  onProgress: (progress) => {
9436
9501
  if (progress.latestWorkerPhase) {
9437
9502
  if (progress.capturedFrames === 0) reportWorkerStartup(job, progress, onProgress);
@@ -9503,6 +9568,11 @@ async function runSequentialDiskCapture(input, captureOptions, captureCfg, check
9503
9568
  let transientRetriesUsed = 0;
9504
9569
  let resumeFrom = 0;
9505
9570
  while (true) {
9571
+ const attempt = input.openAttempt?.();
9572
+ const assertAttemptActive = () => {
9573
+ assertNotAborted();
9574
+ attempt?.throwIfAborted();
9575
+ };
9506
9576
  const videoInjector = createRenderVideoFrameInjector();
9507
9577
  const session = probeSession ?? await createCaptureSession(
9508
9578
  fileServer.url,
@@ -9518,10 +9588,10 @@ async function runSequentialDiskCapture(input, captureOptions, captureCfg, check
9518
9588
  probeSession = null;
9519
9589
  }
9520
9590
  await ensureSessionReady(session);
9521
- assertNotAborted();
9591
+ assertAttemptActive();
9522
9592
  lastBrowserConsole = session.browserConsoleBuffer;
9523
9593
  await captureSessionFrames(session, {
9524
- input,
9594
+ input: { ...input, assertNotAborted: assertAttemptActive },
9525
9595
  rangeStart,
9526
9596
  rangeEnd,
9527
9597
  resumeFrom,
@@ -11342,7 +11412,17 @@ function captureAttemptMadeProgress(attemptTargetFrameCount, remainingFrameCount
11342
11412
  function resetCaptureAttemptProgress(job) {
11343
11413
  job.framesRendered = 0;
11344
11414
  }
11415
+ var FIRST_FRAME_STALL_MS = 3e5;
11416
+ function frameStallRule(job) {
11417
+ const noProgressMs = resolveCaptureStallTimeoutMs();
11418
+ return {
11419
+ progress: () => job.framesRendered ?? 0,
11420
+ noProgressMs,
11421
+ firstProgressMs: Math.max(FIRST_FRAME_STALL_MS, noProgressMs)
11422
+ };
11423
+ }
11345
11424
  function isRecoverableParallelCaptureError(error) {
11425
+ if (error instanceof RenderStageStalledError) return true;
11346
11426
  const message = normalizeErrorMessage(error);
11347
11427
  if (!message.includes("[Parallel] Capture failed")) return false;
11348
11428
  const kind = classifyCaptureFailure(error).kind;
@@ -11405,8 +11485,10 @@ async function executeDiskCaptureWithAdaptiveRetry(options) {
11405
11485
  )
11406
11486
  ];
11407
11487
  options.dedupPerfs.length = 0;
11488
+ let attemptSignal = options.abortSignal;
11408
11489
  try {
11409
11490
  for (const tasks of batches) {
11491
+ attemptSignal = options.openAttempt?.(options.abortSignal) ?? options.abortSignal;
11410
11492
  const capturedBeforeBatch = countCapturedFrames(
11411
11493
  options.totalFrames,
11412
11494
  options.framesDir,
@@ -11419,7 +11501,7 @@ async function executeDiskCaptureWithAdaptiveRetry(options) {
11419
11501
  tasks,
11420
11502
  options.captureOptions,
11421
11503
  options.createBeforeCaptureHook,
11422
- options.abortSignal,
11504
+ attemptSignal,
11423
11505
  options.onProgress ? (progress) => {
11424
11506
  options.onProgress?.({
11425
11507
  ...progress,
@@ -11467,7 +11549,8 @@ async function executeDiskCaptureWithAdaptiveRetry(options) {
11467
11549
  currentWorkers = nextWorkers;
11468
11550
  missingRanges = remaining;
11469
11551
  attempt++;
11470
- } catch (error) {
11552
+ } catch (caught) {
11553
+ const error = attemptSignal?.aborted && !options.abortSignal?.aborted ? attemptSignal.reason : caught;
11471
11554
  const failure = classifyCaptureFailure(error, { signal: options.abortSignal });
11472
11555
  if (failure.kind === "cancelled") {
11473
11556
  throw error;
@@ -13136,37 +13219,44 @@ async function executeRenderPipeline(input) {
13136
13219
  observability,
13137
13220
  "capture_hdr_layered",
13138
13221
  captureStageObservationData({ hasHdrContent }),
13139
- () => runCaptureHdrStage({
13140
- job,
13141
- cfg,
13142
- plan: layeredPlan,
13143
- log,
13144
- projectDir,
13145
- compiledDir,
13146
- framesDir,
13147
- videoOnlyPath,
13148
- width,
13149
- height,
13150
- totalFrames,
13151
- composition,
13152
- hasHdrContent,
13153
- effectiveHdr,
13154
- nativeHdrVideoIds,
13155
- nativeHdrImageIds,
13156
- videoTransfers,
13157
- imageTransfers,
13158
- hdrImageSrcPaths,
13159
- preset,
13160
- effectiveQuality,
13161
- effectiveBitrate,
13162
- fileServer: activeFileServer,
13163
- buildCaptureOptions,
13164
- createRenderVideoFrameInjector,
13165
- hdrDiagnostics,
13166
- abortSignal: executionSignal,
13167
- assertNotAborted,
13168
- onProgress
13169
- })
13222
+ (openAttempt) => {
13223
+ const attempt = openAttempt(executionSignal);
13224
+ return runCaptureHdrStage({
13225
+ job,
13226
+ cfg,
13227
+ plan: layeredPlan,
13228
+ log,
13229
+ projectDir,
13230
+ compiledDir,
13231
+ framesDir,
13232
+ videoOnlyPath,
13233
+ width,
13234
+ height,
13235
+ totalFrames,
13236
+ composition,
13237
+ hasHdrContent,
13238
+ effectiveHdr,
13239
+ nativeHdrVideoIds,
13240
+ nativeHdrImageIds,
13241
+ videoTransfers,
13242
+ imageTransfers,
13243
+ hdrImageSrcPaths,
13244
+ preset,
13245
+ effectiveQuality,
13246
+ effectiveBitrate,
13247
+ fileServer: activeFileServer,
13248
+ buildCaptureOptions,
13249
+ createRenderVideoFrameInjector,
13250
+ hdrDiagnostics,
13251
+ abortSignal: attempt,
13252
+ assertNotAborted: () => {
13253
+ assertNotAborted();
13254
+ attempt.throwIfAborted();
13255
+ },
13256
+ onProgress
13257
+ });
13258
+ },
13259
+ { stall: frameStallRule(job) }
13170
13260
  );
13171
13261
  lastBrowserConsole = hdrRes.lastBrowserConsole;
13172
13262
  layeredCaptureWarnings.push(...hdrRes.warnings);
@@ -13531,7 +13621,7 @@ async function executeRenderPipeline(input) {
13531
13621
  observability,
13532
13622
  "capture_disk",
13533
13623
  captureStageObservationData({ needsAlpha: diskPlan.needsAlpha }),
13534
- () => runCaptureStage({
13624
+ (openAttempt) => runCaptureStage({
13535
13625
  fileServer: activeFileServer,
13536
13626
  workDir,
13537
13627
  framesDir,
@@ -13549,8 +13639,10 @@ async function executeRenderPipeline(input) {
13549
13639
  assertNotAborted,
13550
13640
  onProgress,
13551
13641
  onFrameLanded: (frame) => overlap?.onFrameLanded(frame),
13552
- interleaveFrames: overlap !== null
13553
- })
13642
+ interleaveFrames: overlap !== null,
13643
+ openAttempt
13644
+ }),
13645
+ { stall: frameStallRule(job) }
13554
13646
  );
13555
13647
  let captureRes;
13556
13648
  try {
@@ -16070,7 +16162,7 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
16070
16162
  if (probeResult.fileServer) closeFileServerSafely(probeResult.fileServer, "plan", log);
16071
16163
  if (probeResult.probeSession) {
16072
16164
  try {
16073
- const { closeCaptureSession: closeCaptureSession2 } = await import("./src-FMPMLWOE.js");
16165
+ const { closeCaptureSession: closeCaptureSession2 } = await import("./src-OQRG6BT7.js");
16074
16166
  await closeCaptureSession2(probeResult.probeSession);
16075
16167
  } catch (err) {
16076
16168
  log.warn("[plan] probe session close failed", {
@@ -17127,6 +17219,7 @@ function resolveWorkerEntry2() {
17127
17219
 
17128
17220
  // ../producer/src/server.ts
17129
17221
  var DEFAULT_SERVER_FPS = { num: 30, den: 1 };
17222
+ var SSE_KEEPALIVE_MS = 3e4;
17130
17223
  var SAFE_RENDER_ERROR_CODES = /* @__PURE__ */ new Set([
17131
17224
  "ASSET_MEDIA_TYPE_MISMATCH",
17132
17225
  "NOT_MEDIA_PAYLOAD",
@@ -17134,7 +17227,8 @@ var SAFE_RENDER_ERROR_CODES = /* @__PURE__ */ new Set([
17134
17227
  "VIDEO_SOURCE_UNRENDERABLE",
17135
17228
  "VIDEO_EXTRACTION_FAILED",
17136
17229
  "ENCODER_INTERRUPTED",
17137
- "RENDER_TOO_SLOW"
17230
+ "RENDER_TOO_SLOW",
17231
+ "RENDER_STAGE_STALLED"
17138
17232
  ]);
17139
17233
  function extractSafeRenderErrorCode(error) {
17140
17234
  if (typeof error !== "object" || error === null || !("code" in error)) return void 0;
@@ -17648,15 +17742,21 @@ function createRenderHandlers(options = {}) {
17648
17742
  })
17649
17743
  });
17650
17744
  }
17745
+ const reportProgress = createSseProgressReporter(stream, requestId);
17746
+ const keepalive = setInterval(() => {
17747
+ Promise.resolve(reportProgress(job, job.currentStage)).catch(() => {
17748
+ });
17749
+ }, SSE_KEEPALIVE_MS);
17651
17750
  const release = await renderSemaphore.acquire();
17652
17751
  try {
17653
17752
  await executeRenderJob(
17654
17753
  job,
17655
17754
  input.projectDir,
17656
17755
  absoluteOutputPath,
17657
- createSseProgressReporter(stream, requestId),
17756
+ reportProgress,
17658
17757
  abortController.signal
17659
- );
17758
+ ).finally(release);
17759
+ clearInterval(keepalive);
17660
17760
  const fileSize = outputFileSize(absoluteOutputPath);
17661
17761
  const outputToken = store.register(absoluteOutputPath);
17662
17762
  const outputUrl = `${outputUrlPrefix}/${outputToken}`;
@@ -17676,6 +17776,7 @@ function createRenderHandlers(options = {}) {
17676
17776
  })
17677
17777
  });
17678
17778
  } catch (error) {
17779
+ clearInterval(keepalive);
17679
17780
  await writeRenderStreamFailure({
17680
17781
  error,
17681
17782
  job,
@@ -17685,7 +17786,6 @@ function createRenderHandlers(options = {}) {
17685
17786
  log
17686
17787
  });
17687
17788
  } finally {
17688
- release();
17689
17789
  c.req.raw.signal.removeEventListener("abort", onRequestAbort);
17690
17790
  cleanupTempDir(cleanupProjectDir, log);
17691
17791
  }
@@ -17744,7 +17844,7 @@ function startServer(options = {}) {
17744
17844
  });
17745
17845
  async function shutdown(signal) {
17746
17846
  log.info(`Received ${signal}, shutting down`);
17747
- const { drainBrowserPool } = await import("./src-FMPMLWOE.js");
17847
+ const { drainBrowserPool } = await import("./src-OQRG6BT7.js");
17748
17848
  await drainBrowserPool().catch(() => {
17749
17849
  });
17750
17850
  const handle = await Promise.race([
@@ -19458,29 +19558,36 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
19458
19558
  const captureSession = session;
19459
19559
  session = null;
19460
19560
  overlap.current = canEncodeWhileCapturing(encodeInput, chunkWorkerCount, cpus3().length) ? encodeWhileCapturing(encodeInput, framesInChunk) : null;
19461
- await runCaptureStage({
19462
- fileServer,
19463
- workDir,
19464
- framesDir,
19465
- job,
19466
- totalFrames: framesInChunk,
19467
- cfg: captureCfg,
19468
- plan: capturePlan,
19469
- log,
19470
- probeSession: captureSession,
19471
- captureAttempts,
19472
- // This sink records each worker's effective capture mode so a
19473
- // fallback remains observable to adapters and smoke tests.
19474
- dedupPerfs: capturePerfs,
19475
- buildCaptureOptions: () => captureOptions,
19476
- createRenderVideoFrameInjector: createChunkVideoFrameInjector,
19477
- abortSignal: void 0,
19478
- assertNotAborted: () => {
19479
- },
19480
- frameRange: range,
19481
- onFrameLanded: (frame) => overlap.current?.onFrameLanded(frame),
19482
- interleaveFrames: interleavesCapture(overlap.current !== null, options)
19483
- }).catch(async (captureError) => {
19561
+ await observeRenderStage(
19562
+ new RenderObservabilityRecorder({ pipelineStartMs: start, log }),
19563
+ "capture_chunk",
19564
+ { chunkIndex },
19565
+ (openAttempt) => runCaptureStage({
19566
+ fileServer,
19567
+ workDir,
19568
+ framesDir,
19569
+ job,
19570
+ totalFrames: framesInChunk,
19571
+ cfg: captureCfg,
19572
+ plan: capturePlan,
19573
+ log,
19574
+ probeSession: captureSession,
19575
+ captureAttempts,
19576
+ // This sink records each worker's effective capture mode so a
19577
+ // fallback remains observable to adapters and smoke tests.
19578
+ dedupPerfs: capturePerfs,
19579
+ buildCaptureOptions: () => captureOptions,
19580
+ createRenderVideoFrameInjector: createChunkVideoFrameInjector,
19581
+ abortSignal: void 0,
19582
+ assertNotAborted: () => {
19583
+ },
19584
+ frameRange: range,
19585
+ onFrameLanded: (frame) => overlap.current?.onFrameLanded(frame),
19586
+ interleaveFrames: interleavesCapture(overlap.current !== null, options),
19587
+ openAttempt
19588
+ }),
19589
+ { stall: frameStallRule(job) }
19590
+ ).catch(async (captureError) => {
19484
19591
  await overlap.current?.abort();
19485
19592
  overlap.current = null;
19486
19593
  throw captureError;
@@ -10,7 +10,7 @@ import {
10
10
  isDevice,
11
11
  isQuality,
12
12
  render
13
- } from "./chunk-RWHMKGJA.js";
13
+ } from "./chunk-WXAQT63P.js";
14
14
 
15
15
  // src/api/removeBackground.ts
16
16
  import { resolve } from "path";