hyperframes 0.9.30 → 0.9.31

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 (222) hide show
  1. package/dist/{add-JBBBMWP4.js → add-53MR45WI.js} +11 -11
  2. package/dist/{agentPromptGenerator-NJL6ZJQA.js → agentPromptGenerator-NXF7237H.js} +5 -5
  3. package/dist/{animatedGifPrep-AVZAMI2D.js → animatedGifPrep-XF6VJW22.js} +5 -5
  4. package/dist/api.js +26 -26
  5. package/dist/{asset-VFG5LF4B.js → asset-Y3YAVXJ3.js} +2 -2
  6. package/dist/{assetCataloger-WGNEAI5A.js → assetCataloger-DRLH2VFH.js} +6 -6
  7. package/dist/{audio-URYC7ND7.js → audio-TRDZQ2NW.js} +11 -11
  8. package/dist/{auth-E4ZBU47K.js → auth-MN66MWGN.js} +2 -2
  9. package/dist/{autoUpdate-CEYR6IHF.js → autoUpdate-KAIIQJBV.js} +2 -2
  10. package/dist/{avatars-ZPRQ3ZCD.js → avatars-F2COSI7P.js} +9 -9
  11. package/dist/{backgroundChecks-BL4XMMXE.js → backgroundChecks-36UG4V5N.js} +3 -3
  12. package/dist/backgroundChecksWorker.js +3 -3
  13. package/dist/{batchRender-FK7U2GUF.js → batchRender-CI6OFGS5.js} +3 -3
  14. package/dist/{beats-XK4QL74K.js → beats-GBCNB763.js} +7 -7
  15. package/dist/{benchmark-MABRDF7U.js → benchmark-AHHMJBDN.js} +8 -8
  16. package/dist/{billing-2CABBLDC.js → billing-HME22C5A.js} +10 -10
  17. package/dist/{browser-SHU4XK5O.js → browser-VZTIOZI3.js} +5 -5
  18. package/dist/{bundleWithLocalizedFonts-W7SSOXOO.js → bundleWithLocalizedFonts-XLFSHMET.js} +1 -1
  19. package/dist/{capture-VPWHIN5C.js → capture-NU2ZIXJB.js} +3 -3
  20. package/dist/{capture-CFESIHJR.js → capture-ZILHWIOF.js} +13 -12
  21. package/dist/{captureCompositionFrame-MT3CHQJ6.js → captureCompositionFrame-ZWVKRKLL.js} +12 -11
  22. package/dist/{catalog-BBPONQOO.js → catalog-NVEGPXGE.js} +11 -11
  23. package/dist/{catch-up-DEZVG3A5.js → catch-up-W7ST5JSZ.js} +6 -6
  24. package/dist/{check-LIC6DYFD.js → check-BZ652RYH.js} +38 -37
  25. package/dist/{checkAudio-RHF5CWWX.js → checkAudio-5NVSRMGL.js} +8 -8
  26. package/dist/{checkBrowser-LUHIFDJZ.js → checkBrowser-YN454IBU.js} +32 -31
  27. package/dist/{chunk-WCSEEQ5R.js → chunk-22PWPQVX.js} +3 -3
  28. package/dist/{chunk-HKWKMXAC.js → chunk-3DIYMOES.js} +4 -4
  29. package/dist/{chunk-NLKHXPTZ.js → chunk-3SZ43GZG.js} +3 -3
  30. package/dist/{chunk-KMGF6GJU.js → chunk-44VR2CWT.js} +2 -2
  31. package/dist/{chunk-V4ZFL2E2.js → chunk-4HSE3FWO.js} +3 -3
  32. package/dist/{chunk-6LCIO2YY.js → chunk-56MGA4FM.js} +1 -1
  33. package/dist/{chunk-VHOETOGT.js → chunk-5AMGFTMU.js} +15 -15
  34. package/dist/{chunk-YJYEKNJG.js → chunk-5BIMSULZ.js} +1 -1
  35. package/dist/{chunk-YZH2IWEE.js → chunk-5HVQV4H4.js} +2 -2
  36. package/dist/{chunk-4TCEF2I7.js → chunk-5LLDGJGZ.js} +1 -1
  37. package/dist/{chunk-EPOBJVVG.js → chunk-5Q3TTLGB.js} +20 -20
  38. package/dist/{chunk-P74B5H73.js → chunk-5YYGPTBP.js} +2 -2
  39. package/dist/{chunk-J7PDBGQM.js → chunk-6VNDEMSP.js} +2 -2
  40. package/dist/{chunk-TNZ2EF2Y.js → chunk-6WHOI52Z.js} +7 -7
  41. package/dist/{chunk-5RLMHG3E.js → chunk-7XZS4PNM.js} +1 -1
  42. package/dist/{chunk-AOPNJEQC.js → chunk-AQJA7TAQ.js} +2 -2
  43. package/dist/{chunk-UTU3HSJS.js → chunk-AWL5M7BX.js} +3 -3
  44. package/dist/{chunk-EBU7T3WZ.js → chunk-B7H5RCKP.js} +2 -2
  45. package/dist/{chunk-PGZSYDLZ.js → chunk-BCMR6DE4.js} +1 -1
  46. package/dist/{chunk-NFUXYBOR.js → chunk-BJSUKOWW.js} +1 -1
  47. package/dist/{chunk-MVJ7AX6W.js → chunk-C4U6FRZH.js} +1 -1
  48. package/dist/{chunk-SP5GQGP2.js → chunk-CP4FVXKZ.js} +2 -2
  49. package/dist/{chunk-AW2M5TZW.js → chunk-CUORARXJ.js} +5 -5
  50. package/dist/{chunk-XKSHWUIF.js → chunk-CWOUPW5E.js} +3 -3
  51. package/dist/{chunk-S3S3IHCR.js → chunk-DFSAC4F4.js} +1 -1
  52. package/dist/chunk-ELWX6CAA.js +5049 -0
  53. package/dist/{chunk-V4Z37HFN.js → chunk-FK3KV32T.js} +2 -2
  54. package/dist/{chunk-G3WGKT3B.js → chunk-FKW5FP4C.js} +40 -10
  55. package/dist/{chunk-GQNV4DG6.js → chunk-G5DZZEQF.js} +1 -1
  56. package/dist/{chunk-RZK5ZGVX.js → chunk-G5S72X6Q.js} +4 -4
  57. package/dist/{chunk-SPPSVPY7.js → chunk-GFDXA5QO.js} +2 -2
  58. package/dist/{chunk-AMZ22QP7.js → chunk-GRHBVTBK.js} +2 -2
  59. package/dist/{chunk-MKZ34726.js → chunk-GSXHYLW4.js} +2 -2
  60. package/dist/{chunk-RYT22J4V.js → chunk-HM3PIREE.js} +1 -1
  61. package/dist/{chunk-NBF7SU6Q.js → chunk-IHWNDG5C.js} +3 -3
  62. package/dist/{chunk-76MHB2H6.js → chunk-IIMW46LC.js} +1 -1
  63. package/dist/{chunk-IYYZMZD2.js → chunk-J5LQW6VB.js} +1 -1
  64. package/dist/{chunk-74PW4UVC.js → chunk-JULHFF3J.js} +1 -1
  65. package/dist/{chunk-CK3DD2MC.js → chunk-K7JA32EI.js} +1 -1
  66. package/dist/{chunk-HLRYLZFX.js → chunk-KAHWO4XC.js} +2 -2
  67. package/dist/{chunk-PVRJKEU5.js → chunk-KAICKZZK.js} +1 -1
  68. package/dist/{chunk-2II5FCVK.js → chunk-KKUBMYCY.js} +10 -10
  69. package/dist/{chunk-B23DUMZ4.js → chunk-L6ZLOJBI.js} +1 -1
  70. package/dist/{chunk-FJQGA6H6.js → chunk-LHBQW4GJ.js} +4 -4
  71. package/dist/{chunk-FNC3JNO7.js → chunk-MMAPQWUP.js} +1 -1
  72. package/dist/{chunk-YAKPBJOU.js → chunk-MQOO5Z4U.js} +5 -5
  73. package/dist/{chunk-MSL2BS73.js → chunk-MX3UCKZR.js} +1 -1
  74. package/dist/{chunk-LRDS7MG5.js → chunk-O4Z4D4KA.js} +1 -1
  75. package/dist/{chunk-Q7FX7HOX.js → chunk-O7ZX5DHD.js} +1 -1
  76. package/dist/{chunk-F4Z2UPAA.js → chunk-OB6DVKHE.js} +1 -1
  77. package/dist/{chunk-NHJ5YUBZ.js → chunk-OBRKDUCE.js} +1 -1
  78. package/dist/{chunk-NTNS5EFN.js → chunk-OJSOH2LS.js} +2 -2
  79. package/dist/{chunk-RCYKUNVZ.js → chunk-OOEZ3FT3.js} +2 -2
  80. package/dist/{chunk-7DMIAJD7.js → chunk-OZNJ2QD5.js} +12 -12
  81. package/dist/{chunk-OSDNRYQJ.js → chunk-P7LZ2WSQ.js} +9 -73
  82. package/dist/{chunk-3JFV42QB.js → chunk-PGGMJW7B.js} +2 -2
  83. package/dist/{chunk-WJPEMXI3.js → chunk-Q77TZ76B.js} +7 -7
  84. package/dist/{chunk-VMLPDIR6.js → chunk-Q7EIUAYK.js} +1 -1
  85. package/dist/{chunk-7GJKUOPX.js → chunk-R5U5PFDJ.js} +2 -2
  86. package/dist/{chunk-BJYCLZBQ.js → chunk-RBECDLMQ.js} +1 -1
  87. package/dist/{chunk-DYKBB5HB.js → chunk-RCWPVC4M.js} +1 -1
  88. package/dist/{chunk-BUYUJ3EV.js → chunk-RHUYVGFO.js} +7 -7
  89. package/dist/{chunk-YNRQTFYH.js → chunk-RJA64ACI.js} +2 -2
  90. package/dist/{chunk-5IAFM6M5.js → chunk-RLQOYHXT.js} +10 -10
  91. package/dist/{chunk-UPVM6UDG.js → chunk-RLYYA6IR.js} +9 -4
  92. package/dist/{chunk-6FHIR4KD.js → chunk-RVI665CP.js} +1 -1
  93. package/dist/{chunk-2YZ6GA4E.js → chunk-SCWMPY3F.js} +1 -1
  94. package/dist/{chunk-IX3K55NA.js → chunk-SEVZKBMA.js} +2 -2
  95. package/dist/{chunk-5QGDLMU3.js → chunk-SQ63BIR2.js} +2 -2
  96. package/dist/{chunk-HCC7XLD7.js → chunk-T54RTTFW.js} +2 -2
  97. package/dist/{chunk-LDTJCZZ2.js → chunk-T7PFJH2B.js} +2 -2
  98. package/dist/{chunk-QBRBXVCE.js → chunk-TEOIEMTR.js} +1 -1
  99. package/dist/{chunk-J4Z7LQKU.js → chunk-URXVZMSI.js} +2 -2
  100. package/dist/{chunk-2QUQKYOK.js → chunk-VPPJIWVG.js} +50 -20
  101. package/dist/{chunk-XVDXYUQJ.js → chunk-W4OMDRZF.js} +1 -1
  102. package/dist/{chunk-NZUUKNNZ.js → chunk-WSPGX2SM.js} +1 -1
  103. package/dist/{chunk-VPQXRTEW.js → chunk-X3HQA3YE.js} +2 -2
  104. package/dist/chunk-XB77LMOP.js +82 -0
  105. package/dist/{chunk-ZGQZTSP2.js → chunk-XDIHAX2C.js} +1 -1
  106. package/dist/{chunk-LMCFILEY.js → chunk-Y6RU3H6C.js} +2 -2
  107. package/dist/{chunk-AGHSWES2.js → chunk-YJVJCNK4.js} +3 -3
  108. package/dist/{chunk-WGVWW6O4.js → chunk-ZOOY4LEZ.js} +2 -2
  109. package/dist/{chunk-2NK3K7JL.js → chunk-ZQYRP22G.js} +1 -1
  110. package/dist/{chunk-JVAD6LD7.js → chunk-ZSELEQI2.js} +363 -347
  111. package/dist/{clean-AGQEPUBC.js → clean-WYXHI2DO.js} +16 -16
  112. package/dist/cli.js +61 -61
  113. package/dist/{cloud-H5HJH6SD.js → cloud-X52P5AIE.js} +4 -4
  114. package/dist/{cloudrun-7BR5FKOC.js → cloudrun-36IR6ZKU.js} +4 -4
  115. package/dist/{compare-YWZ6O2FL.js → compare-R2KXOV2I.js} +29 -28
  116. package/dist/{compiler-ZSIKBZBR.js → compiler-FRWUFIQC.js} +2 -2
  117. package/dist/{component-MX2PJOTA.js → component-TIBQY7KQ.js} +3 -3
  118. package/dist/{compositions-PLT4OLGR.js → compositions-NQPORXIX.js} +9 -9
  119. package/dist/{curve-BJYCZUEY.js → curve-DTLRPBSB.js} +9 -9
  120. package/dist/{cuts-TWAVF7WI.js → cuts-73HKU767.js} +10 -10
  121. package/dist/{delete-3KCBCPBD.js → delete-HIHA436T.js} +2 -2
  122. package/dist/{deploy-KWTMJNBL.js → deploy-EB3FS2BT.js} +1 -1
  123. package/dist/{describeProject-HZLM3B55.js → describeProject-4A5UXQ25.js} +6 -6
  124. package/dist/{diff-XC6IU3IY.js → diff-JPADFUMV.js} +27 -27
  125. package/dist/{dist-QRXJMFI7.js → dist-FKEKIXVL.js} +2 -2
  126. package/dist/{dist-M5WQQ6WE.js → dist-KWXQYTRT.js} +11 -9
  127. package/dist/{doctor-VRUSZ6GH.js → doctor-3OO3CONL.js} +9 -9
  128. package/dist/{energy-VNAAJYAW.js → energy-XFPN5YIL.js} +10 -10
  129. package/dist/{events-6WYNARX7.js → events-6ONCYFB5.js} +2 -2
  130. package/dist/{events-WZJTLFCQ.js → events-G2MME5LQ.js} +5 -5
  131. package/dist/{events-MR72RS47.js → events-QWPZT3EQ.js} +11 -11
  132. package/dist/{extract-MKOCZIFN.js → extract-3EV72SMY.js} +10 -10
  133. package/dist/{face-NIV5ZSUX.js → face-JZS6P3AT.js} +10 -10
  134. package/dist/{feedback-A4F4G5JO.js → feedback-JVWBHRQG.js} +6 -6
  135. package/dist/{ffmpeg-OAKTUK5S.js → ffmpeg-XDAITYSU.js} +5 -5
  136. package/dist/{figma-4WZIDYAD.js → figma-KPHTDMCQ.js} +3 -3
  137. package/dist/fontLocalizeCli.js +8 -8
  138. package/dist/{frames-DAKLRIWG.js → frames-KRVRJTKC.js} +11 -11
  139. package/dist/{generate-NRPHH4NJ.js → generate-X2MYGFZX.js} +19 -19
  140. package/dist/{get-ISXQCK3G.js → get-QM24BI7N.js} +2 -2
  141. package/dist/{gpuPolicy-SLVPAQK2.js → gpuPolicy-EFJJLHVV.js} +5 -5
  142. package/dist/{grade-compare-TVMAAZVC.js → grade-compare-W5N5LH4X.js} +30 -29
  143. package/dist/{heifImagePrep-BOIWW7FW.js → heifImagePrep-X5QRRVTV.js} +6 -6
  144. package/dist/{help-ZOYDS3YW.js → help-LWS4YWMO.js} +1 -1
  145. package/dist/{history-CLGGMJ7Z.js → history-SG34LBJY.js} +9 -9
  146. package/dist/hyperframe.manifest.json +1 -1
  147. package/dist/hyperframe.runtime.iife.js +67 -67
  148. package/dist/hyperframes-player.global.js +3 -3
  149. package/dist/{info-ZTFII4N4.js → info-2FC43IYB.js} +11 -11
  150. package/dist/{init-RCDPQKFA.js → init-GKY5OKDV.js} +25 -25
  151. package/dist/{ink-2ATPIDWC.js → ink-7UK6YCUY.js} +10 -10
  152. package/dist/{inspect-GDMUC5F6.js → inspect-ZB2NTNQA.js} +30 -29
  153. package/dist/{installer-VPGNKCEU.js → installer-GALVXWPC.js} +4 -4
  154. package/dist/{keyframes-EPAX446T.js → keyframes-LSP4FLHT.js} +8 -8
  155. package/dist/{lambda-HG6Y6KOH.js → lambda-3F32DRYF.js} +9 -9
  156. package/dist/{layout-KXBKGHOS.js → layout-XPGS3QTX.js} +30 -29
  157. package/dist/{lint-O62OPAW7.js → lint-Q5SO57RK.js} +8 -8
  158. package/dist/{list-4HWWKMM6.js → list-FL5RYSFT.js} +2 -2
  159. package/dist/{localPage-66UVNGQR.js → localPage-IOHQETQT.js} +5 -5
  160. package/dist/{login-2H4XMPUT.js → login-D4TCWDDW.js} +4 -4
  161. package/dist/{look-W6PV445D.js → look-G2BT4E4A.js} +10 -10
  162. package/dist/{manager-ML4OLLSM.js → manager-F6WI43DQ.js} +6 -6
  163. package/dist/{measure-CWOXQCGH.js → measure-VXQQHYMZ.js} +11 -11
  164. package/dist/{media-treatment-SDGXF2PK.js → media-treatment-ZXA3JZSL.js} +11 -11
  165. package/dist/{media-use-NWNX24MD.js → media-use-63LZFAID.js} +3 -3
  166. package/dist/{models-J2P2DLSA.js → models-MWUVU4CY.js} +9 -9
  167. package/dist/{motionShot-VQ2KFPMR.js → motionShot-U4YDT7UV.js} +15 -14
  168. package/dist/{normalize-audio-MABOG5XR.js → normalize-audio-T5QJWU4P.js} +8 -8
  169. package/dist/{open-KWTFPDML.js → open-DRLXHOW2.js} +11 -11
  170. package/dist/{parakeetRunner-GP47AAVT.js → parakeetRunner-5OHEB3XZ.js} +10 -10
  171. package/dist/{pipeline-5HUQFOCY.js → pipeline-MAIRRYD6.js} +8 -8
  172. package/dist/{play-6MSC2ZCU.js → play-33A3EXX3.js} +19 -19
  173. package/dist/{preflight-NTJMXUS2.js → preflight-HSWMKB2Q.js} +6 -6
  174. package/dist/{present-X5T75QS4.js → present-HJIFEIDH.js} +15 -15
  175. package/dist/{preview-7NW7RUET.js → preview-J6Z6RKMN.js} +26 -17
  176. package/dist/{probe-XTZVXTQ2.js → probe-RA4VOGYY.js} +10 -10
  177. package/dist/{producer-ZZROH3WZ.js → producer-KWP2B4A5.js} +1 -1
  178. package/dist/{projectConfig-UHYPGWD5.js → projectConfig-3YIGHLNE.js} +6 -6
  179. package/dist/{publication-5KOANEHK.js → publication-QRUY2WJK.js} +2 -2
  180. package/dist/{publish-3BBHK2NK.js → publish-GV3I3GUL.js} +8 -8
  181. package/dist/{remove-background-W7WMLL5C.js → remove-background-UUITKXEQ.js} +9 -9
  182. package/dist/{render-5G6745C3.js → render-EC67XXR2.js} +38 -31
  183. package/dist/{render-ZGCH2FZJ.js → render-NHVDJRFD.js} +5 -5
  184. package/dist/{render-ZIBXBMNI.js → render-ZITQXHJP.js} +20 -20
  185. package/dist/{render-batch-ONWJJ627.js → render-batch-RII4F3PD.js} +5 -5
  186. package/dist/{resolver-ZWNLOG6O.js → resolver-R3FXDZKS.js} +4 -4
  187. package/dist/{reverse-5YTLWWDZ.js → reverse-2GJ5Y3WM.js} +1 -1
  188. package/dist/{screenshotCapture-ZZE3GMOF.js → screenshotCapture-TEQVEBWB.js} +7 -6
  189. package/dist/{sherpa-7ISRANWA.js → sherpa-YIJR47GX.js} +9 -9
  190. package/dist/{skills-YMSZHKK4.js → skills-DM3XC7RQ.js} +8 -8
  191. package/dist/{skillsUpdateCheck-YJYYN5CH.js → skillsUpdateCheck-ZHVFEOEN.js} +3 -3
  192. package/dist/{snapshot-4MZGXL4A.js → snapshot-72RQQXHW.js} +36 -35
  193. package/dist/{src-NIMSUB4P.js → src-C43KUEBY.js} +4 -4
  194. package/dist/{src-CHPZUZZ3.js → src-SPFGPZZQ.js} +7 -7
  195. package/dist/{start-FPEBVENS.js → start-FSYSYLI7.js} +17 -17
  196. package/dist/{staticProjectServer-XZNME57Y.js → staticProjectServer-RHBRRGPK.js} +17 -17
  197. package/dist/{status-7TRDJU47.js → status-TE74GP4Q.js} +10 -10
  198. package/dist/studio/assets/{codec-B1UWDNJp.js → codec-DXM4vA6G.js} +1 -1
  199. package/dist/studio/assets/{hyperframes-player-DQd2VPm2.js → hyperframes-player-D_016Ubp.js} +1 -1
  200. package/dist/studio/assets/{index-B7CtVv8e.js → index-Bw4stQMm.js} +1 -1
  201. package/dist/studio/assets/{index-gkyTLE7n.js → index-Ob53qo6K.js} +118 -118
  202. package/dist/studio/assets/{pausedVideoDecoder-Bfv1WSlz.js → pausedVideoDecoder-vbdgaMqL.js} +1 -1
  203. package/dist/studio/index.html +1 -1
  204. package/dist/{studio-api-JKJXAELI.js → studio-api-JAOHMYPG.js} +11 -9
  205. package/dist/{studioServer-UCRCZOLS.js → studioServer-RHCPM4CN.js} +52 -48
  206. package/dist/{sync-E72XNR2G.js → sync-UZJ7DOUA.js} +10 -10
  207. package/dist/{telemetry-L5D3U4IO.js → telemetry-TFOEA2PM.js} +5 -5
  208. package/dist/{templates-O7HEL7HC.js → templates-2AHM5TZ3.js} +10 -10
  209. package/dist/{timeline-QTODTYKQ.js → timeline-ZGV323MP.js} +17 -17
  210. package/dist/{tokens-D7JYFE2K.js → tokens-ERUFEWUA.js} +2 -2
  211. package/dist/{transcribe-D2WFL2RO.js → transcribe-6HLYS7NV.js} +21 -21
  212. package/dist/{transcribe-FGVGCTEU.js → transcribe-M5UZ2XFG.js} +8 -8
  213. package/dist/{update-SCMEUTRM.js → update-JDVI2XTM.js} +9 -9
  214. package/dist/{updateCheck-KNTQDXMN.js → updateCheck-GDTYPXKO.js} +2 -2
  215. package/dist/{upgrade-V2BP5PAQ.js → upgrade-SJKYBA4X.js} +3 -3
  216. package/dist/{urlDownloader-4RWM3UH2.js → urlDownloader-2QCNXXUG.js} +4 -4
  217. package/dist/{validate-W3E6QVJ6.js → validate-IUTHTA2N.js} +24 -23
  218. package/dist/{video-KC4AFMAY.js → video-4BJ7WHI2.js} +6 -6
  219. package/dist/{voices-7N6QU3C6.js → voices-UDSFBPZX.js} +17 -17
  220. package/dist/warmCheck.js +38 -37
  221. package/package.json +1 -1
  222. package/dist/chunk-F24B2PLD.js +0 -5049
@@ -16,12 +16,12 @@ import {
16
16
  Semaphore,
17
17
  prepareHeifImageInputs,
18
18
  withMediaProbeSlot
19
- } from "./chunk-HCC7XLD7.js";
19
+ } from "./chunk-T54RTTFW.js";
20
20
  import {
21
21
  EncoderInterruptedError,
22
22
  encoderFailureError,
23
23
  prepareAnimatedGifInputs
24
- } from "./chunk-J7PDBGQM.js";
24
+ } from "./chunk-6VNDEMSP.js";
25
25
  import {
26
26
  openRangeEnd,
27
27
  parseEncoderOptions
@@ -186,7 +186,7 @@ import {
186
186
  videoAudioId,
187
187
  videoStartOnMediaTimeline,
188
188
  writeCapturedFrame
189
- } from "./chunk-7GJKUOPX.js";
189
+ } from "./chunk-R5U5PFDJ.js";
190
190
  import {
191
191
  assignBundledRuntimeCompositionIds,
192
192
  emitMountedModuleScripts,
@@ -198,7 +198,7 @@ import {
198
198
  parsesAsScript,
199
199
  prepareFlattenedInnerRoot,
200
200
  stripSdrPngColourTags
201
- } from "./chunk-NHJ5YUBZ.js";
201
+ } from "./chunk-OBRKDUCE.js";
202
202
  import {
203
203
  collectScratchLeftovers,
204
204
  createStagingDir,
@@ -227,7 +227,7 @@ import {
227
227
  redactTelemetryString,
228
228
  resolveAuthoredTimingWindow,
229
229
  toFps
230
- } from "./chunk-RYT22J4V.js";
230
+ } from "./chunk-HM3PIREE.js";
231
231
  import {
232
232
  COMPOSITION_SOURCE_URL,
233
233
  HF_COLOR_GRADING_ATTR,
@@ -262,7 +262,7 @@ import {
262
262
  sourceTimeAt,
263
263
  styleElementsFor,
264
264
  timeAtSourceTime
265
- } from "./chunk-F24B2PLD.js";
265
+ } from "./chunk-ELWX6CAA.js";
266
266
  import {
267
267
  chromeMajorCeiling
268
268
  } from "./chunk-WE42NVH7.js";
@@ -315,7 +315,7 @@ import {
315
315
 
316
316
  // ../producer/src/services/renderOrchestrator.ts
317
317
  import {
318
- existsSync as existsSync20,
318
+ existsSync as existsSync21,
319
319
  mkdirSync as mkdirSync10,
320
320
  readdirSync as readdirSync6,
321
321
  rmSync as rmSync10,
@@ -325,7 +325,7 @@ import {
325
325
  appendFileSync
326
326
  } from "fs";
327
327
  import { tmpdir as tmpdir2 } from "os";
328
- import { join as join28, dirname as dirname11, resolve as resolve6 } from "path";
328
+ import { join as join29, dirname as dirname11, resolve as resolve6 } from "path";
329
329
  import { totalmem as totalmem2 } from "os";
330
330
  import { randomUUID } from "crypto";
331
331
  import { fileURLToPath as fileURLToPath4 } from "url";
@@ -6433,13 +6433,24 @@ function countAuthoredTimedClips(html) {
6433
6433
  }
6434
6434
 
6435
6435
  // ../producer/src/services/render/stages/compileStage.ts
6436
- import { existsSync as existsSync11, writeFileSync as writeFileSync4 } from "fs";
6437
- import { join as join16 } from "path";
6436
+ import { existsSync as existsSync12, writeFileSync as writeFileSync4 } from "fs";
6437
+ import { join as join17 } from "path";
6438
6438
 
6439
6439
  // ../producer/src/services/htmlCompiler.ts
6440
6440
  import { createHash as createHash4 } from "crypto";
6441
- import { createReadStream as createReadStream2, existsSync as existsSync10, mkdirSync as mkdirSync7, readFileSync as readFileSync5 } from "fs";
6442
- import { join as join15, dirname as dirname6, resolve as resolve5, basename as basename5, relative as relative2, sep as sep2 } from "path";
6441
+ import { createReadStream as createReadStream2, existsSync as existsSync11, mkdirSync as mkdirSync7, readFileSync as readFileSync6 } from "fs";
6442
+ import { join as join16, dirname as dirname6, resolve as resolve5, basename as basename5, relative as relative2, sep as sep2 } from "path";
6443
+
6444
+ // ../producer/src/services/bundledScripts.ts
6445
+ import { existsSync as existsSync9, readFileSync as readFileSync5 } from "fs";
6446
+ import { join as join15 } from "path";
6447
+ var GSAP_VENDOR_DIR_ENV = "HYPERFRAMES_GSAP_VENDOR_DIR";
6448
+ function bundledScript(url) {
6449
+ const dir = process.env[GSAP_VENDOR_DIR_ENV];
6450
+ if (!dir || url !== `${gsapCdnDist()}gsap.min.js`) return null;
6451
+ const file = join15(dir, "gsap.min.js");
6452
+ return existsSync9(file) ? readFileSync5(file) : null;
6453
+ }
6443
6454
 
6444
6455
  // ../producer/src/services/renderMediaCollector.ts
6445
6456
  function resolveHostEnd(host, hostStart) {
@@ -6588,7 +6599,7 @@ function getPositionEditsRenderScript() {
6588
6599
  }
6589
6600
 
6590
6601
  // ../producer/src/services/assetMediaType.ts
6591
- import { existsSync as existsSync9 } from "fs";
6602
+ import { existsSync as existsSync10 } from "fs";
6592
6603
  var ASSET_MEDIA_TYPE_MISMATCH = "ASSET_MEDIA_TYPE_MISMATCH";
6593
6604
  var AssetMediaTypeMismatchError = class extends Error {
6594
6605
  code = ASSET_MEDIA_TYPE_MISMATCH;
@@ -6654,7 +6665,7 @@ async function preflightCompositionAssetMediaTypes(input) {
6654
6665
  input.projectDir,
6655
6666
  input.compiledDir
6656
6667
  );
6657
- if (!existsSync9(resolvedPath)) continue;
6668
+ if (!existsSync10(resolvedPath)) continue;
6658
6669
  byPath.set(resolvedPath, [...byPath.get(resolvedPath) ?? [], reference]);
6659
6670
  }
6660
6671
  const mismatches = [];
@@ -6907,8 +6918,8 @@ function detectShaderTransitionUsage(html) {
6907
6918
  async function resolveMediaDuration(src, mediaStart, playbackRate, baseDir, downloadDir, tagName, elementIdentity, log, urlByAbsentLocalPath, probes) {
6908
6919
  let filePath = src;
6909
6920
  if (isHttpUrl(src)) {
6910
- const remoteDir = join15(downloadDir, REMOTE_MEDIA_SUBDIR);
6911
- if (!existsSync10(remoteDir)) mkdirSync7(remoteDir, { recursive: true });
6921
+ const remoteDir = join16(downloadDir, REMOTE_MEDIA_SUBDIR);
6922
+ if (!existsSync11(remoteDir)) mkdirSync7(remoteDir, { recursive: true });
6912
6923
  try {
6913
6924
  filePath = await downloadToTemp(src, remoteDir, void 0, void 0, void 0, {
6914
6925
  onTelemetry: logRemoteDownloadTelemetry
@@ -6918,10 +6929,10 @@ async function resolveMediaDuration(src, mediaStart, playbackRate, baseDir, down
6918
6929
  }
6919
6930
  } else {
6920
6931
  filePath = decodedUrlPath(src);
6921
- if (!filePath.startsWith("/")) filePath = join15(baseDir, filePath);
6932
+ if (!filePath.startsWith("/")) filePath = join16(baseDir, filePath);
6922
6933
  filePath = urlByAbsentLocalPath?.get(filePath) ?? filePath;
6923
6934
  }
6924
- if (!isHttpUrl(filePath) && !existsSync10(filePath)) {
6935
+ if (!isHttpUrl(filePath) && !existsSync11(filePath)) {
6925
6936
  return { duration: null, resolvedPath: filePath };
6926
6937
  }
6927
6938
  const withSrcContext = (error) => {
@@ -7270,7 +7281,7 @@ function inlineSubCompositions2(html, subCompositions, projectDir, variableOverr
7270
7281
  parseHtml: (htmlStr) => parseHTML(htmlStr).document,
7271
7282
  // Mirrors the preview bundler: a sub-composition's SIBLING assets resolve
7272
7283
  // against its own directory, project-root refs stay as authored.
7273
- assetExists: (path) => existsSync10(resolve5(projectDir, path)),
7284
+ assetExists: (path) => existsSync11(resolve5(projectDir, path)),
7274
7285
  // Preserve the authored root wrapper as a child of the host, matching
7275
7286
  // the preview bundler's shape (htmlBundler.ts's prepareFlattenedInnerRoot,
7276
7287
  // which the runtime compositionLoader mirrors with its own copy for the
@@ -7415,12 +7426,17 @@ async function inlineExternalScripts(html) {
7415
7426
  if (externalScripts.length === 0) return html;
7416
7427
  const downloads = await Promise.allSettled(
7417
7428
  externalScripts.map(async ({ el, src }) => {
7429
+ const integrity = el.getAttribute("integrity") || "";
7430
+ const bundled = bundledScript(src);
7431
+ if (bundled && matchesScriptIntegrity(bundled, integrity)) {
7432
+ return { src, text: new TextDecoder().decode(bundled) };
7433
+ }
7418
7434
  const response = await fetch(src, {
7419
7435
  signal: AbortSignal.timeout(15e3)
7420
7436
  });
7421
7437
  if (!response.ok) throw new Error(`HTTP ${response.status} for ${src}`);
7422
7438
  const bytes = new Uint8Array(await response.arrayBuffer());
7423
- if (!matchesScriptIntegrity(bytes, el.getAttribute("integrity") || "")) {
7439
+ if (!matchesScriptIntegrity(bytes, integrity)) {
7424
7440
  throw new ScriptIntegrityError(`Subresource integrity mismatch for ${src}`);
7425
7441
  }
7426
7442
  return { src, text: new TextDecoder().decode(bytes) };
@@ -7461,7 +7477,7 @@ function collectExternalAssets(html, projectDir) {
7461
7477
  if (isPathInside2(absPath, absProjectDir)) {
7462
7478
  return null;
7463
7479
  }
7464
- if (!existsSync10(absPath)) return null;
7480
+ if (!existsSync11(absPath)) return null;
7465
7481
  const safeKey = toExternalAssetKey(absPath);
7466
7482
  externalAssets.set(safeKey, absPath);
7467
7483
  return safeKey;
@@ -7511,7 +7527,7 @@ var REMOTE_SOURCE_TAG_RE = /<source\b[^>]*?\bsrc\s*=\s*["'](https?:\/\/[^"']+)["
7511
7527
  var REMOTE_IMG_TAG_RE = /<img\b[^>]*?(?<![\w-])src\s*=\s*["'](https?:\/\/[^"']+)["'][^>]*>/gi;
7512
7528
  async function downloadAndRewriteUrls(urlSet, html, remoteDir, warnLabel, logLabel, extraRewrite) {
7513
7529
  if (urlSet.size === 0) return { html, remoteMediaAssets: /* @__PURE__ */ new Map() };
7514
- if (!existsSync10(remoteDir)) mkdirSync7(remoteDir, { recursive: true });
7530
+ if (!existsSync11(remoteDir)) mkdirSync7(remoteDir, { recursive: true });
7515
7531
  const urlToLocal = /* @__PURE__ */ new Map();
7516
7532
  await Promise.all(
7517
7533
  [...urlSet].map(async (url) => {
@@ -7558,7 +7574,7 @@ async function localizeRemoteMediaSources(html, downloadDir) {
7558
7574
  return downloadAndRewriteUrls(
7559
7575
  urlSet,
7560
7576
  html,
7561
- join15(downloadDir, REMOTE_MEDIA_SUBDIR),
7577
+ join16(downloadDir, REMOTE_MEDIA_SUBDIR),
7562
7578
  "Remote media download failed",
7563
7579
  "Localized remote media source(s)"
7564
7580
  );
@@ -7573,7 +7589,7 @@ async function localizeRemoteImageSources(html, downloadDir) {
7573
7589
  return downloadAndRewriteUrls(
7574
7590
  urlSet,
7575
7591
  html,
7576
- join15(downloadDir, REMOTE_MEDIA_SUBDIR),
7592
+ join16(downloadDir, REMOTE_MEDIA_SUBDIR),
7577
7593
  "Remote image download failed",
7578
7594
  "Localized remote image source(s)"
7579
7595
  );
@@ -7589,7 +7605,7 @@ async function localizeRemoteBackgroundImages(html, downloadDir) {
7589
7605
  return downloadAndRewriteUrls(
7590
7606
  urlSet,
7591
7607
  html,
7592
- join15(downloadDir, REMOTE_MEDIA_SUBDIR),
7608
+ join16(downloadDir, REMOTE_MEDIA_SUBDIR),
7593
7609
  "Remote background-image download failed",
7594
7610
  "Localized remote background-image(s)",
7595
7611
  // Quoted url('..')/url("..") are rewritten by downloadAndRewriteUrls' default
@@ -7694,13 +7710,13 @@ function projectStylesheetFontFamilies(html, projectDir) {
7694
7710
  const href = /\bhref=["']([^"']+)["']/i.exec(tag)?.[1];
7695
7711
  if (!href || /^(?:[a-z][a-z\d+.-]*:|\/\/)/i.test(href)) continue;
7696
7712
  const sheet = resolve5(projectDir, decodedUrlPath(href).replace(/^(?:\.?\/)+/, ""));
7697
- if (!isPathInside2(sheet, projectDir) || !existsSync10(sheet)) continue;
7698
- for (const face of extractFontFaceBlocks(readFileSync5(sheet, "utf8"))) {
7713
+ if (!isPathInside2(sheet, projectDir) || !existsSync11(sheet)) continue;
7714
+ for (const face of extractFontFaceBlocks(readFileSync6(sheet, "utf8"))) {
7699
7715
  const family = /font-family\s*:\s*([^;}]+)/i.exec(face)?.[1]?.trim().replace(/^['"]|['"]$/g, "");
7700
7716
  const shipsFile = [...face.matchAll(LOCAL_FONTFACE_URL_RE)].some(([, url = ""]) => {
7701
7717
  const path = decodedUrlPath(url);
7702
7718
  const file = path.startsWith("/") ? resolve5(projectDir, `.${path}`) : resolve5(dirname6(sheet), path);
7703
- return isPathInside2(file, projectDir) && existsSync10(file);
7719
+ return isPathInside2(file, projectDir) && existsSync11(file);
7704
7720
  });
7705
7721
  if (family && shipsFile) families.push(family);
7706
7722
  }
@@ -7744,7 +7760,7 @@ function localizeFontFaceUrls(html, downloadDir) {
7744
7760
  return downloadAndRewriteUrls(
7745
7761
  collectFontFaceUrls(html),
7746
7762
  html,
7747
- join15(downloadDir, REMOTE_MEDIA_SUBDIR),
7763
+ join16(downloadDir, REMOTE_MEDIA_SUBDIR),
7748
7764
  "Remote font download failed",
7749
7765
  "Localized remote font face(s)",
7750
7766
  (h, url, relPath) => h.replaceAll(`url(${url})`, `url("${relPath}")`)
@@ -7838,7 +7854,7 @@ function renderGsapDist() {
7838
7854
  }
7839
7855
  function rewriteUnresolvableGsapToCdn(html, projectDir, compSrcPath) {
7840
7856
  let gsapDist;
7841
- const exists = (path) => existsSync10(resolve5(projectDir, path));
7857
+ const exists = (path) => existsSync11(resolve5(projectDir, path));
7842
7858
  return html.replace(
7843
7859
  /(<script\b[^>]*\bsrc=["'])([^"']*gsap[^"']*\/dist\/([^"']+))(["'][^>]*>)/gi,
7844
7860
  (full, prefix, src, file, suffix) => {
@@ -7855,7 +7871,7 @@ function rebaseDirectEntryAssetPaths(html, projectDir, htmlPath) {
7855
7871
  const entryPath = relative2(projectDir, htmlPath).replace(/\\/g, "/");
7856
7872
  if (!entryPath.includes("/")) return html;
7857
7873
  const { document: document2 } = parseHTML(html);
7858
- const assetExists = (path) => existsSync10(resolve5(projectDir, path));
7874
+ const assetExists = (path) => existsSync11(resolve5(projectDir, path));
7859
7875
  rewriteAssetPaths(
7860
7876
  document2.querySelectorAll("[src], [href], [srcset]"),
7861
7877
  entryPath,
@@ -8421,11 +8437,11 @@ function adaptAspectAgnosticResolution(requested, aspectAgnostic, width, height,
8421
8437
  }
8422
8438
  function resolveEntryHtmlPath(input) {
8423
8439
  const { projectDir, workDir, entryFile, log } = input;
8424
- const htmlPath = join16(projectDir, entryFile);
8440
+ const htmlPath = join17(projectDir, entryFile);
8425
8441
  const rawEntry = readTextFile(htmlPath);
8426
8442
  if (entryFile === "index.html" || !isTemplateEntry(rawEntry)) return htmlPath;
8427
- const projectIndexPath = join16(projectDir, "index.html");
8428
- if (!existsSync11(projectIndexPath)) {
8443
+ const projectIndexPath = join17(projectDir, "index.html");
8444
+ if (!existsSync12(projectIndexPath)) {
8429
8445
  throw new Error(
8430
8446
  `Template entry file "${entryFile}" requires a project index.html to extract its render shell.`
8431
8447
  );
@@ -8440,7 +8456,7 @@ function resolveEntryHtmlPath(input) {
8440
8456
  `Entry file "${entryFile}" is not mounted from index.html via data-composition-src, so it cannot be rendered independently.`
8441
8457
  );
8442
8458
  }
8443
- const wrapperPath = join16(workDir, "standalone-entry.html");
8459
+ const wrapperPath = join17(workDir, "standalone-entry.html");
8444
8460
  writeFileSync4(wrapperPath, standaloneHtml, "utf-8");
8445
8461
  log.info("Extracted standalone entry from index.html host context", { entryFile });
8446
8462
  return wrapperPath;
@@ -8461,7 +8477,7 @@ async function runCompileStage(input) {
8461
8477
  } = input;
8462
8478
  const htmlPath = resolveEntryHtmlPath({ projectDir, workDir, entryFile, log });
8463
8479
  const compileStart = Date.now();
8464
- const compiled = await compileForRender(projectDir, htmlPath, join16(workDir, "downloads"), {
8480
+ const compiled = await compileForRender(projectDir, htmlPath, join17(workDir, "downloads"), {
8465
8481
  log,
8466
8482
  failClosedFontFetch: failClosedFontFetch === true,
8467
8483
  allowSystemFontCapture,
@@ -8469,7 +8485,7 @@ async function runCompileStage(input) {
8469
8485
  variables: input.variables,
8470
8486
  urlByAbsentLocalPath: input.urlByAbsentLocalPath,
8471
8487
  pageMotionBlur: input.pageMotionBlur,
8472
- animatedGifCacheDir: cfg.extractCacheDir ? join16(cfg.extractCacheDir, "animated-gif") : void 0,
8488
+ animatedGifCacheDir: cfg.extractCacheDir ? join17(cfg.extractCacheDir, "animated-gif") : void 0,
8473
8489
  ffmpegProcessTimeout: cfg.ffmpegProcessTimeout
8474
8490
  });
8475
8491
  assertNotAborted();
@@ -8526,7 +8542,7 @@ async function runCompileStage(input) {
8526
8542
  };
8527
8543
  await preflightCompositionAssetMediaTypes({
8528
8544
  projectDir,
8529
- compiledDir: join16(workDir, "compiled"),
8545
+ compiledDir: join17(workDir, "compiled"),
8530
8546
  composition,
8531
8547
  signal: abortSignal
8532
8548
  });
@@ -8572,7 +8588,7 @@ async function runCompileStage(input) {
8572
8588
 
8573
8589
  // ../producer/src/services/render/stages/probeStage.ts
8574
8590
  import { createHash as createHash5 } from "crypto";
8575
- import { basename as basename6, join as join17 } from "path";
8591
+ import { basename as basename6, join as join18 } from "path";
8576
8592
 
8577
8593
  // ../producer/src/services/render/stages/probeFailures.ts
8578
8594
  var NETWORK_FAILURE_PATTERN = /404|ERR_NAME_NOT_RESOLVED|ERR_CONNECTION_REFUSED|net::ERR_/i;
@@ -8757,7 +8773,7 @@ async function runProbeStage(input) {
8757
8773
  });
8758
8774
  fileServer = await createFileServer({
8759
8775
  projectDir,
8760
- compiledDir: join17(workDir, "compiled"),
8776
+ compiledDir: join18(workDir, "compiled"),
8761
8777
  port: 0,
8762
8778
  preHeadScripts: [VIRTUAL_TIME_SHIM],
8763
8779
  fps: job.config.fps
@@ -8787,7 +8803,7 @@ async function runProbeStage(input) {
8787
8803
  log.info("Creating capture session...", { attempt, maxAttempts: PROBE_MAX_ATTEMPTS });
8788
8804
  probeSession = await createCaptureSession(
8789
8805
  fileServer.url,
8790
- join17(workDir, "probe"),
8806
+ join18(workDir, "probe"),
8791
8807
  captureOpts,
8792
8808
  null,
8793
8809
  probeCfg
@@ -8872,7 +8888,7 @@ async function runProbeStage(input) {
8872
8888
  });
8873
8889
  probeSession = await createCaptureSession(
8874
8890
  fileServer.url,
8875
- join17(workDir, "probe-screenshot"),
8891
+ join18(workDir, "probe-screenshot"),
8876
8892
  captureOpts,
8877
8893
  null,
8878
8894
  { ...probeCfg, forceScreenshot: true }
@@ -8910,7 +8926,7 @@ async function runProbeStage(input) {
8910
8926
  compiled,
8911
8927
  resolutions,
8912
8928
  projectDir,
8913
- join17(workDir, "downloads")
8929
+ join18(workDir, "downloads")
8914
8930
  );
8915
8931
  assertNotAborted();
8916
8932
  composition.videos = compiled.videos;
@@ -9101,7 +9117,7 @@ async function runProbeStage(input) {
9101
9117
  }
9102
9118
  await preflightCompositionAssetMediaTypes({
9103
9119
  projectDir,
9104
- compiledDir: join17(workDir, "compiled"),
9120
+ compiledDir: join18(workDir, "compiled"),
9105
9121
  composition,
9106
9122
  signal: abortSignal
9107
9123
  });
@@ -9258,8 +9274,8 @@ function validateDistributedDuration(input) {
9258
9274
  }
9259
9275
 
9260
9276
  // ../producer/src/services/render/stages/extractVideosStage.ts
9261
- import { existsSync as existsSync12 } from "fs";
9262
- import { join as join18 } from "path";
9277
+ import { existsSync as existsSync13 } from "fs";
9278
+ import { join as join19 } from "path";
9263
9279
 
9264
9280
  // ../producer/src/services/render/extractionFailureMetadata.ts
9265
9281
  function stringOrEmpty(value) {
@@ -9515,7 +9531,7 @@ async function runExtractVideosStage(input) {
9515
9531
  const probeFailures = await Promise.all(
9516
9532
  composition.videos.map(async (v) => {
9517
9533
  const videoPath = resolveProjectRelativeSrc(v.src, projectDir, compiledDir);
9518
- if (!existsSync12(videoPath)) return null;
9534
+ if (!existsSync13(videoPath)) return null;
9519
9535
  try {
9520
9536
  const attempted = extractionPolicy.maxTransientRetries === 0 ? { result: await extractMediaMetadata(videoPath), retries: 0 } : await runVideoExtractionWithRetry(() => extractMediaMetadata(videoPath), {
9521
9537
  signal: abortSignal,
@@ -9553,7 +9569,7 @@ async function runExtractVideosStage(input) {
9553
9569
  const probed = await Promise.all(
9554
9570
  composition.images.map(async (img) => {
9555
9571
  const imgPath = resolveProjectRelativeSrc(img.src, projectDir, compiledDir);
9556
- if (!existsSync12(imgPath)) return null;
9572
+ if (!existsSync13(imgPath)) return null;
9557
9573
  const colorSpace = await probeColorSpaceSafely(imgPath, log);
9558
9574
  if (isHdrColorSpace(colorSpace)) {
9559
9575
  nativeHdrImageIds.add(img.id);
@@ -9587,14 +9603,14 @@ async function runExtractVideosStage(input) {
9587
9603
  // because short boundary counts can differ by one frame.
9588
9604
  {
9589
9605
  fps: job.config.fps,
9590
- outputDir: join18(compiledDir, "__hyperframes_video_frames"),
9606
+ outputDir: join19(compiledDir, "__hyperframes_video_frames"),
9591
9607
  format: job.config.videoFrameFormat ?? "auto",
9592
9608
  toneMapHdrToSdr: rendersSdrOnly(job.config, composition),
9593
9609
  timelineEnd: composition.duration,
9594
9610
  maxTransientRetries: extractionPolicy.maxTransientRetries,
9595
9611
  collectProbeFailures: extractionPolicy.failureMode === "enforce",
9596
9612
  deferRangeExtraction,
9597
- contentKeyedDirs: [join18(compiledDir, REMOTE_MEDIA_SUBDIR)],
9613
+ contentKeyedDirs: [join19(compiledDir, REMOTE_MEDIA_SUBDIR)],
9598
9614
  urlByAbsentLocalPath,
9599
9615
  onProgress: ({ planned = 0, done = 0 }) => {
9600
9616
  framesPlanned += planned;
@@ -9673,7 +9689,7 @@ async function appendVideoAudioFromProbe(input) {
9673
9689
  videos.map(async (video) => {
9674
9690
  const path = isHttpUrl(video.src) ? video.src : resolveProjectRelativeSrc(video.src, projectDir, compiledDir);
9675
9691
  const readFrom = urlByAbsentLocalPath?.get(path) ?? path;
9676
- if (!isHttpUrl(readFrom) && !existsSync12(readFrom)) return null;
9692
+ if (!isHttpUrl(readFrom) && !existsSync13(readFrom)) return null;
9677
9693
  const metadata = await extractMediaMetadata(readFrom);
9678
9694
  const window2 = await resolveFinalFrameExtractionWindow(
9679
9695
  readFrom,
@@ -9693,7 +9709,7 @@ async function appendVideoAudioFromProbe(input) {
9693
9709
  }
9694
9710
 
9695
9711
  // ../producer/src/services/render/videoLayerPassthroughPlan.ts
9696
- import { existsSync as existsSync13 } from "fs";
9712
+ import { existsSync as existsSync14 } from "fs";
9697
9713
  var SAMPLES = 9;
9698
9714
  function inspectVideoLayout(id, w, h, time) {
9699
9715
  window.__hf?.seek?.(time);
@@ -9755,7 +9771,7 @@ async function planVideoLayerPassthrough(input) {
9755
9771
  const { video } = q;
9756
9772
  if (isHttpUrl(video.src)) return { reason: "remote_source" };
9757
9773
  const path = resolveProjectRelativeSrc(video.src, input.projectDir, input.compiledDir);
9758
- if (!existsSync13(path)) return { reason: "source_missing" };
9774
+ if (!existsSync14(path)) return { reason: "source_missing" };
9759
9775
  const layout = await probeVideoLayout(input.page, video.id, input.canvas, input.duration);
9760
9776
  if ("reason" in layout) return layout;
9761
9777
  const layer = await buildVideoLayerInput(
@@ -9770,16 +9786,16 @@ async function planVideoLayerPassthrough(input) {
9770
9786
  }
9771
9787
 
9772
9788
  // ../producer/src/services/render/stages/audioStage.ts
9773
- import { existsSync as existsSync15 } from "fs";
9774
- import { join as join21 } from "path";
9789
+ import { existsSync as existsSync16 } from "fs";
9790
+ import { join as join22 } from "path";
9775
9791
 
9776
9792
  // ../producer/src/services/render/audioDeliveryLimit.ts
9777
- import { existsSync as existsSync14 } from "fs";
9778
- import { dirname as dirname8, join as join20 } from "path";
9793
+ import { existsSync as existsSync15 } from "fs";
9794
+ import { dirname as dirname8, join as join21 } from "path";
9779
9795
 
9780
9796
  // ../producer/src/services/render/audioPadTrim.ts
9781
9797
  import { spawn } from "child_process";
9782
- import { dirname as dirname7, join as join19 } from "path";
9798
+ import { dirname as dirname7, join as join20 } from "path";
9783
9799
 
9784
9800
  // ../producer/src/services/render/audioTruePeak.ts
9785
9801
  var toDbfs = (token) => token.toLowerCase() === "-inf" ? Number.NEGATIVE_INFINITY : Number(token);
@@ -10039,7 +10055,7 @@ async function constrainAacTruePeak(input) {
10039
10055
  }
10040
10056
  async function cutSource(input, scratchDir, attenuationDb) {
10041
10057
  if (!input.sourcePath || !input.rewriteSource) return true;
10042
- const cutPath = join19(scratchDir, "source.wav");
10058
+ const cutPath = join20(scratchDir, "source.wav");
10043
10059
  try {
10044
10060
  const result = await input.rewriteSource(input.sourcePath, cutPath, gainFilter(attenuationDb));
10045
10061
  if (!result.success) throw new Error(result.error);
@@ -10054,7 +10070,7 @@ async function enforceAacTruePeak(input) {
10054
10070
  let scratchDir;
10055
10071
  try {
10056
10072
  scratchDir = createStagingDir(dirname7(input.audioPath), ".true-peak-");
10057
- const correctedPath = join19(scratchDir, "audio.m4a");
10073
+ const correctedPath = join20(scratchDir, "audio.m4a");
10058
10074
  const measurements = [];
10059
10075
  let attenuationDb = 0;
10060
10076
  let sourcePeakDbfs;
@@ -10257,14 +10273,14 @@ async function limitDeliveryPeaks(input, deps = {
10257
10273
  applyChain: applyAudioFxChain,
10258
10274
  encode: encodeAac,
10259
10275
  rename: renameWithRetry,
10260
- sourceExists: existsSync14
10276
+ sourceExists: existsSync15
10261
10277
  }) {
10262
10278
  const { audioPath, sourcePath, signal, timeoutMs } = input;
10263
10279
  if (!deps.sourceExists(sourcePath)) return { success: true };
10264
10280
  const peak = await deps.measure(audioPath, { timeoutMs, signal });
10265
10281
  if (peak <= AAC_DELIVERY_TRUE_PEAK_DBFS) return { success: true };
10266
10282
  const alternating = ["a", "b"].map(
10267
- (k) => join20(dirname8(sourcePath), `audio-source-limited-${k}.wav`)
10283
+ (k) => join21(dirname8(sourcePath), `audio-source-limited-${k}.wav`)
10268
10284
  );
10269
10285
  let encodedFrom;
10270
10286
  let ceiling = AAC_DELIVERY_TRUE_PEAK_DBFS;
@@ -10336,7 +10352,7 @@ function runAudioStage(input) {
10336
10352
  }
10337
10353
  async function runAudioStageScoped(input) {
10338
10354
  const stageStart = Date.now();
10339
- const pcmSourcePath = join21(input.workDir, "audio-source.wav");
10355
+ const pcmSourcePath = join22(input.workDir, "audio-source.wav");
10340
10356
  const duration = input.totalFrames * input.fps.den / input.fps.num;
10341
10357
  let deliverySourcePath;
10342
10358
  try {
@@ -10352,7 +10368,7 @@ async function runAudioStageScoped(input) {
10352
10368
  );
10353
10369
  audioLoweredDb = guard.loweredDb;
10354
10370
  input.log?.info("[audio] phases", { ...result.audioPhaseMs, guard: Date.now() - guardStart });
10355
- if (input.keepDeliverySource && !guard.sourceStale && existsSync15(pcmSourcePath)) {
10371
+ if (input.keepDeliverySource && !guard.sourceStale && existsSync16(pcmSourcePath)) {
10356
10372
  deliverySourcePath = pcmSourcePath;
10357
10373
  }
10358
10374
  }
@@ -10401,7 +10417,7 @@ async function mixAudioForDelivery(input, duration, pcmSourcePath) {
10401
10417
  assertNotAborted,
10402
10418
  log
10403
10419
  } = input;
10404
- const audioOutputPath = join21(workDir, MIXED_AUDIO_FILENAME);
10420
+ const audioOutputPath = join22(workDir, MIXED_AUDIO_FILENAME);
10405
10421
  let hasAudio = false;
10406
10422
  let audioError;
10407
10423
  let audioFailures;
@@ -10412,7 +10428,7 @@ async function mixAudioForDelivery(input, duration, pcmSourcePath) {
10412
10428
  audioResult = await processCompositionAudio(
10413
10429
  audios,
10414
10430
  projectDir,
10415
- join21(workDir, "audio-work"),
10431
+ join22(workDir, "audio-work"),
10416
10432
  audioOutputPath,
10417
10433
  duration,
10418
10434
  abortSignal,
@@ -10480,8 +10496,8 @@ async function mixAudioForDelivery(input, duration, pcmSourcePath) {
10480
10496
  }
10481
10497
 
10482
10498
  // ../producer/src/services/render/stages/captureStage.ts
10483
- import { existsSync as existsSync16, readdirSync as readdirSync4, statfsSync as statfsSync2 } from "fs";
10484
- import { join as join22 } from "path";
10499
+ import { existsSync as existsSync17, readdirSync as readdirSync4, statfsSync as statfsSync2 } from "fs";
10500
+ import { join as join23 } from "path";
10485
10501
  function shouldAllowAdaptiveCaptureRetry(workerCount, _explicitlyConfigured) {
10486
10502
  return workerCount > 1;
10487
10503
  }
@@ -10537,16 +10553,16 @@ function diskCaptureShortfallError(needBytes, freeBytes, framesDir, basis, remed
10537
10553
  }
10538
10554
  function measureCaptureFrameBytes(workDir, framesDir) {
10539
10555
  let total = sampleDirectoryBytes(framesDir);
10540
- if (!existsSync16(workDir)) return total;
10556
+ if (!existsSync17(workDir)) return total;
10541
10557
  for (const attempt of readdirSync4(workDir)) {
10542
10558
  if (/^retry-\d+-batch-\d+-worker-\d+$/.test(attempt)) {
10543
- total += sampleDirectoryBytes(join22(workDir, attempt));
10559
+ total += sampleDirectoryBytes(join23(workDir, attempt));
10544
10560
  continue;
10545
10561
  }
10546
10562
  if (!/^capture-attempt-\d+$/.test(attempt)) continue;
10547
- const attemptDir = join22(workDir, attempt);
10563
+ const attemptDir = join23(workDir, attempt);
10548
10564
  for (const name of readdirSync4(attemptDir)) {
10549
- if (/^worker-\d+$/.test(name)) total += sampleDirectoryBytes(join22(attemptDir, name));
10565
+ if (/^worker-\d+$/.test(name)) total += sampleDirectoryBytes(join23(attemptDir, name));
10550
10566
  }
10551
10567
  }
10552
10568
  return total;
@@ -10844,8 +10860,8 @@ async function captureSessionFrames(session, { input, rangeStart, rangeEnd, resu
10844
10860
  }
10845
10861
 
10846
10862
  // ../producer/src/services/render/stages/captureHdrStage.ts
10847
- import { existsSync as existsSync18, mkdirSync as mkdirSync8 } from "fs";
10848
- import { join as join26 } from "path";
10863
+ import { existsSync as existsSync19, mkdirSync as mkdirSync8 } from "fs";
10864
+ import { join as join27 } from "path";
10849
10865
 
10850
10866
  // ../producer/src/services/hdrImageTransferCache.ts
10851
10867
  var DEFAULT_MAX_BYTES = 200 * 1024 * 1024;
@@ -10907,7 +10923,7 @@ function createHdrImageTransferCache(options = {}) {
10907
10923
  }
10908
10924
 
10909
10925
  // ../producer/src/services/render/stages/captureHdrSequentialLoop.ts
10910
- import { join as join23 } from "path";
10926
+ import { join as join24 } from "path";
10911
10927
  async function runSequentialLayeredFrameLoop(input) {
10912
10928
  const {
10913
10929
  job,
@@ -11028,7 +11044,7 @@ async function runSequentialLayeredFrameLoop(input) {
11028
11044
  );
11029
11045
  if (debugDumpEnabled && debugDumpDir && i % 30 === 0) {
11030
11046
  writeFileExclusiveSync(
11031
- join23(debugDumpDir, `frame_${String(i).padStart(4, "0")}_final_rgb48le.bin`),
11047
+ join24(debugDumpDir, `frame_${String(i).padStart(4, "0")}_final_rgb48le.bin`),
11032
11048
  normalCanvas
11033
11049
  );
11034
11050
  }
@@ -11060,14 +11076,14 @@ async function runSequentialLayeredFrameLoop(input) {
11060
11076
  }
11061
11077
 
11062
11078
  // ../producer/src/services/render/stages/captureHdrHybridLoop.ts
11063
- import { join as join25 } from "path";
11079
+ import { join as join26 } from "path";
11064
11080
 
11065
11081
  // ../producer/src/services/shaderTransitionWorkerPool.ts
11066
11082
  import { Worker } from "worker_threads";
11067
11083
  import { fileURLToPath as fileURLToPath3, pathToFileURL } from "url";
11068
- import { dirname as dirname9, join as join24 } from "path";
11084
+ import { dirname as dirname9, join as join25 } from "path";
11069
11085
  import { createRequire } from "module";
11070
- import { existsSync as existsSync17 } from "fs";
11086
+ import { existsSync as existsSync18 } from "fs";
11071
11087
  import { cpus as cpus2 } from "os";
11072
11088
  function resolveWorkerEntry(explicit) {
11073
11089
  if (explicit && explicit.length > 0) {
@@ -11079,9 +11095,9 @@ function resolveWorkerEntry(explicit) {
11079
11095
  return { path: override, isTs };
11080
11096
  }
11081
11097
  const moduleDir = dirname9(fileURLToPath3(import.meta.url));
11082
- const jsPath = join24(moduleDir, "shaderTransitionWorker.js");
11083
- if (existsSync17(jsPath)) return { path: jsPath, isTs: false };
11084
- const tsPath = join24(moduleDir, "shaderTransitionWorker.ts");
11098
+ const jsPath = join25(moduleDir, "shaderTransitionWorker.js");
11099
+ if (existsSync18(jsPath)) return { path: jsPath, isTs: false };
11100
+ const tsPath = join25(moduleDir, "shaderTransitionWorker.ts");
11085
11101
  return { path: tsPath, isTs: true };
11086
11102
  }
11087
11103
  function buildExecArgv(entryIsTs) {
@@ -11449,7 +11465,7 @@ async function runHybridLayeredFrameLoop(input) {
11449
11465
  );
11450
11466
  if (debugDumpEnabled && debugDumpDir && i % 30 === 0) {
11451
11467
  writeFileExclusiveSync(
11452
- join25(debugDumpDir, `frame_${String(i).padStart(4, "0")}_final_rgb48le.bin`),
11468
+ join26(debugDumpDir, `frame_${String(i).padStart(4, "0")}_final_rgb48le.bin`),
11453
11469
  canvas
11454
11470
  );
11455
11471
  }
@@ -11640,8 +11656,8 @@ async function runCaptureHdrStage(input) {
11640
11656
  if (hdrVideoFrameSources.has(v.id)) hdrVideoEndTimes.set(v.id, v.end);
11641
11657
  }
11642
11658
  const debugDumpEnabled = process.env.KEEP_TEMP === "1";
11643
- const debugDumpDir = debugDumpEnabled ? join26(framesDir, "debug-composite") : null;
11644
- if (debugDumpDir && !existsSync18(debugDumpDir)) {
11659
+ const debugDumpDir = debugDumpEnabled ? join27(framesDir, "debug-composite") : null;
11660
+ if (debugDumpDir && !existsSync19(debugDumpDir)) {
11645
11661
  mkdirSync8(debugDumpDir, { recursive: true });
11646
11662
  }
11647
11663
  const compositeTransfer = resolveCompositeTransfer(hasHdrContent, effectiveHdr);
@@ -11798,16 +11814,16 @@ async function runCaptureHdrStage(input) {
11798
11814
  // ../producer/src/services/render/stages/encodeStage.ts
11799
11815
  import {
11800
11816
  copyFileSync as copyFileSync2,
11801
- existsSync as existsSync19,
11817
+ existsSync as existsSync20,
11802
11818
  mkdirSync as mkdirSync9,
11803
11819
  readdirSync as readdirSync5,
11804
- readFileSync as readFileSync6,
11820
+ readFileSync as readFileSync7,
11805
11821
  rmSync as rmSync9,
11806
11822
  statSync as statSync6,
11807
11823
  writeFileSync as writeFileSync5
11808
11824
  } from "fs";
11809
11825
  import { readFile as readFile2 } from "fs/promises";
11810
- import { dirname as dirname10, join as join27 } from "path";
11826
+ import { dirname as dirname10, join as join28 } from "path";
11811
11827
 
11812
11828
  // ../producer/src/services/render/stages/gifEncodeArgs.ts
11813
11829
  function fpsToFfmpegArg2(fps) {
@@ -11880,7 +11896,7 @@ async function reencodeWithClearedWholeFrames(argsInput, run, startTime) {
11880
11896
  const error = formatFfmpegError(result.exitCode, result.stderr);
11881
11897
  return gifEncodeFailure(startTime, outputPath, error, result.failureReason);
11882
11898
  }
11883
- const gif = readFileSync6(outputPath);
11899
+ const gif = readFileSync7(outputPath);
11884
11900
  if (!clearGifFramesBeforeNext(gif)) {
11885
11901
  const error = "[FFmpeg] GIF output could not be parsed to clear its frames";
11886
11902
  return gifEncodeFailure(startTime, outputPath, error);
@@ -11913,11 +11929,11 @@ async function encodeGifFromDir(framesDir, framePattern, outputPath, input) {
11913
11929
  return gifEncodeFailure(startTime, outputPath, error, result.failureReason);
11914
11930
  }
11915
11931
  }
11916
- if (input.preserveAlpha && gifClearsAfterLeavingFrameInPlace(readFileSync6(outputPath)) !== false) {
11932
+ if (input.preserveAlpha && gifClearsAfterLeavingFrameInPlace(readFileSync7(outputPath)) !== false) {
11917
11933
  const failure = await reencodeWithClearedWholeFrames(argsInput, run, startTime);
11918
11934
  if (failure) return failure;
11919
11935
  }
11920
- const fileSize = existsSync19(outputPath) ? statSync6(outputPath).size : 0;
11936
+ const fileSize = existsSync20(outputPath) ? statSync6(outputPath).size : 0;
11921
11937
  return {
11922
11938
  success: true,
11923
11939
  outputPath,
@@ -12003,7 +12019,7 @@ function encodeWhileCapturing(input, totalFrames) {
12003
12019
  await new Promise((resolve11) => wake = resolve11);
12004
12020
  }
12005
12021
  if (signal.aborted) return;
12006
- const mergedPath = join27(input.framesDir, formatCaptureFrameName(next, "jpg"));
12022
+ const mergedPath = join28(input.framesDir, formatCaptureFrameName(next, "jpg"));
12007
12023
  const frame = await readLandedFrame(landed.get(next), mergedPath);
12008
12024
  landed.delete(next);
12009
12025
  if (!await stream.writeFrame(frame)) {
@@ -12078,7 +12094,7 @@ async function runEncodeStage(input) {
12078
12094
  const stage5Start = Date.now();
12079
12095
  if (isPngSequence) {
12080
12096
  const encoded = startEncodeProgress(job, "Writing PNG sequence", onProgress);
12081
- if (!existsSync19(outputPath)) mkdirSync9(outputPath, { recursive: true });
12097
+ if (!existsSync20(outputPath)) mkdirSync9(outputPath, { recursive: true });
12082
12098
  const captured = readdirSync5(framesDir).filter((name) => name.endsWith(".png")).sort();
12083
12099
  if (captured.length === 0) {
12084
12100
  throw new Error(
@@ -12086,11 +12102,11 @@ async function runEncodeStage(input) {
12086
12102
  );
12087
12103
  }
12088
12104
  captured.forEach((name, i) => {
12089
- const dst = join27(outputPath, formatExportFrameName(i, "png"));
12090
- copyFileSync2(join27(framesDir, name), dst);
12105
+ const dst = join28(outputPath, formatExportFrameName(i, "png"));
12106
+ copyFileSync2(join28(framesDir, name), dst);
12091
12107
  });
12092
- if (hasAudio && audioOutputPath && existsSync19(audioOutputPath)) {
12093
- copyFileSync2(audioOutputPath, join27(outputPath, MIXED_AUDIO_FILENAME));
12108
+ if (hasAudio && audioOutputPath && existsSync20(audioOutputPath)) {
12109
+ copyFileSync2(audioOutputPath, join28(outputPath, MIXED_AUDIO_FILENAME));
12094
12110
  log.info(
12095
12111
  `[Render] png-sequence: ${MIXED_AUDIO_FILENAME} sidecar written to ${outputPath}/${MIXED_AUDIO_FILENAME}`
12096
12112
  );
@@ -12110,7 +12126,7 @@ async function runEncodeStage(input) {
12110
12126
  const encodeResult2 = await encodeGifFromDir(framesDir, framePattern2, outputPath, {
12111
12127
  fps: job.config.fps,
12112
12128
  loop,
12113
- palettePath: join27(dirname10(videoOnlyPath), "gif-palette.png"),
12129
+ palettePath: join28(dirname10(videoOnlyPath), "gif-palette.png"),
12114
12130
  preserveAlpha: needsAlpha,
12115
12131
  signal: abortSignal,
12116
12132
  timeout: engineCfg.ffmpegEncodeTimeout
@@ -12320,7 +12336,7 @@ function sampleDirectoryBytes(dir) {
12320
12336
  continue;
12321
12337
  }
12322
12338
  for (const name of entries) {
12323
- const full = join28(current, name);
12339
+ const full = join29(current, name);
12324
12340
  try {
12325
12341
  const st = statSync7(full);
12326
12342
  if (st.isDirectory()) {
@@ -12476,8 +12492,8 @@ function findMissingFrameRanges(totalFrames, framesDir, frameExt) {
12476
12492
  const ranges = [];
12477
12493
  let rangeStart = null;
12478
12494
  for (let frameIndex = 0; frameIndex < totalFrames; frameIndex++) {
12479
- const framePath = join28(framesDir, formatCaptureFrameName(frameIndex, frameExt));
12480
- const missing = !existsSync20(framePath) || statSync7(framePath).size <= 8;
12495
+ const framePath = join29(framesDir, formatCaptureFrameName(frameIndex, frameExt));
12496
+ const missing = !existsSync21(framePath) || statSync7(framePath).size <= 8;
12481
12497
  if (missing && rangeStart === null) {
12482
12498
  rangeStart = frameIndex;
12483
12499
  } else if (!missing && rangeStart !== null) {
@@ -12493,7 +12509,7 @@ function findMissingFrameRanges(totalFrames, framesDir, frameExt) {
12493
12509
  function buildMissingFrameRetryBatches(ranges, maxWorkers, workDir, attempt, rangeStart = 0, stride = 1) {
12494
12510
  const workersPerBatch = Math.max(1, Math.floor(maxWorkers));
12495
12511
  const batches = [];
12496
- const outputDirFor = (batchIndex, workerId) => join28(workDir, `retry-${attempt}-batch-${batchIndex}-worker-${workerId}`);
12512
+ const outputDirFor = (batchIndex, workerId) => join29(workDir, `retry-${attempt}-batch-${batchIndex}-worker-${workerId}`);
12497
12513
  if (stride > 1) {
12498
12514
  const spans = /* @__PURE__ */ new Map();
12499
12515
  for (const range of ranges) {
@@ -12553,8 +12569,8 @@ function getNextRetryWorkerCount(currentWorkers) {
12553
12569
  return Math.max(1, Math.floor(currentWorkers / 2));
12554
12570
  }
12555
12571
  function resolveRenderWorkDirPrefix(outputPath, jobId, platform2 = process.platform, systemTempDir = tmpdir2()) {
12556
- if (platform2 === "win32" || platform2 === "darwin") return join28(systemTempDir, "hf-render-");
12557
- return join28(dirname11(outputPath), `work-${jobId}-`);
12572
+ if (platform2 === "win32" || platform2 === "darwin") return join29(systemTempDir, "hf-render-");
12573
+ return join29(dirname11(outputPath), `work-${jobId}-`);
12558
12574
  }
12559
12575
  var MAX_TRANSIENT_CAPTURE_RETRIES = 1;
12560
12576
  function isTransientCaptureRetryEligible(failureKind, missing, retriesUsed) {
@@ -12601,8 +12617,8 @@ The composition is too large for the available memory. To reduce memory pressure
12601
12617
  function countCapturedFrames(totalFrames, framesDir, frameExt) {
12602
12618
  let captured = 0;
12603
12619
  for (let frameIndex = 0; frameIndex < totalFrames; frameIndex++) {
12604
- const framePath = join28(framesDir, formatCaptureFrameName(frameIndex, frameExt));
12605
- if (existsSync20(framePath)) captured++;
12620
+ const framePath = join29(framesDir, formatCaptureFrameName(frameIndex, frameExt));
12621
+ if (existsSync21(framePath)) captured++;
12606
12622
  }
12607
12623
  return captured;
12608
12624
  }
@@ -12627,7 +12643,7 @@ async function executeDiskCaptureWithAdaptiveRetry(options) {
12627
12643
  reason: attempt === 0 ? "initial" : pendingTransientRetry ? "transient-retry" : "retry"
12628
12644
  });
12629
12645
  pendingTransientRetry = false;
12630
- const attemptWorkDir = join28(options.workDir, `capture-attempt-${attempt}`);
12646
+ const attemptWorkDir = join29(options.workDir, `capture-attempt-${attempt}`);
12631
12647
  const batches = missingRanges ? buildMissingFrameRetryBatches(
12632
12648
  missingRanges,
12633
12649
  currentWorkers,
@@ -13260,18 +13276,18 @@ function deVerifyFallbackTelemetry(err) {
13260
13276
  }
13261
13277
  function resolveRenderDebugDir() {
13262
13278
  const producerRoot = process.env.PRODUCER_RENDERS_DIR ? resolve6(process.env.PRODUCER_RENDERS_DIR, "..") : resolve6(dirname11(fileURLToPath4(import.meta.url)), "../..");
13263
- return join28(producerRoot, ".debug");
13279
+ return join29(producerRoot, ".debug");
13264
13280
  }
13265
13281
  async function executeRenderJob(job, projectDir, outputPath, progressSink, abortSignal, assertRenderActive) {
13266
13282
  validateHlsRenderConfig(job.config);
13267
13283
  validateDeliveryEncoderConfig(job.config);
13268
13284
  const debugDir = resolveRenderDebugDir();
13269
13285
  const outputDir = dirname11(outputPath);
13270
- if (!existsSync20(outputDir)) mkdirSync10(outputDir, { recursive: true });
13271
- const workDir = job.config.debug ? join28(debugDir, job.id) : createRenderWorkDir(resolveRenderWorkDirPrefix(outputPath, job.id), outputDir);
13286
+ if (!existsSync21(outputDir)) mkdirSync10(outputDir, { recursive: true });
13287
+ const workDir = job.config.debug ? join29(debugDir, job.id) : createRenderWorkDir(resolveRenderWorkDirPrefix(outputPath, job.id), outputDir);
13272
13288
  const pipelineStart = Date.now();
13273
13289
  const baseLog = job.config.logger ?? defaultLogger;
13274
- const logPath = job.config.debug ? join28(workDir, "render.log") : null;
13290
+ const logPath = job.config.debug ? join29(workDir, "render.log") : null;
13275
13291
  const execution = new RenderExecutionContext({
13276
13292
  request: { renderJobId: job.id, projectDir, outputPath },
13277
13293
  logger: logPath ? createRenderFileLogger(logPath, baseLog) : baseLog,
@@ -13333,7 +13349,7 @@ async function executeRenderPipeline(input) {
13333
13349
  imageDecodeFailures: 0
13334
13350
  };
13335
13351
  let hdrPerf;
13336
- const perfOutputPath = join28(workDir, "perf-summary.json");
13352
+ const perfOutputPath = join29(workDir, "perf-summary.json");
13337
13353
  const cfg = { ...job.config.producerConfig ?? resolveConfig() };
13338
13354
  const observability = new RenderObservabilityRecorder({
13339
13355
  pipelineStartMs: pipelineStart,
@@ -13409,7 +13425,7 @@ async function executeRenderPipeline(input) {
13409
13425
  job.startedAt = /* @__PURE__ */ new Date();
13410
13426
  assertNotAborted();
13411
13427
  assertConfiguredFfmpegBinariesExist();
13412
- if (!existsSync20(workDir)) mkdirSync10(workDir, { recursive: true });
13428
+ if (!existsSync21(workDir)) mkdirSync10(workDir, { recursive: true });
13413
13429
  if (job.config.debug) {
13414
13430
  log.info("[Render] Debug artifacts enabled", { workDir, logPath });
13415
13431
  }
@@ -13438,8 +13454,8 @@ async function executeRenderPipeline(input) {
13438
13454
  requestedWorkers: job.config.workers ?? "auto"
13439
13455
  });
13440
13456
  const entryFile = job.config.entryFile || "index.html";
13441
- const htmlPath = join28(projectDir, entryFile);
13442
- if (!existsSync20(htmlPath)) {
13457
+ const htmlPath = join29(projectDir, entryFile);
13458
+ if (!existsSync21(htmlPath)) {
13443
13459
  throw new Error(`Entry file not found: ${htmlPath}`);
13444
13460
  }
13445
13461
  assertNotAborted();
@@ -13615,7 +13631,7 @@ async function executeRenderPipeline(input) {
13615
13631
  canvas: { width, height },
13616
13632
  page: probeSession.page,
13617
13633
  projectDir,
13618
- compiledDir: join28(workDir, "compiled")
13634
+ compiledDir: join29(workDir, "compiled")
13619
13635
  });
13620
13636
  if (videoLayerPlan.videoId === void 0) {
13621
13637
  log.info(`[Render] Video layer passthrough off: ${videoLayerPlan.reason}`);
@@ -13633,7 +13649,7 @@ async function executeRenderPipeline(input) {
13633
13649
  updateJobStatus(job, "preprocessing", "Extracting video frames", 10, onProgress, {
13634
13650
  code: "extract_video"
13635
13651
  });
13636
- const compiledDir = join28(workDir, "compiled");
13652
+ const compiledDir = join29(workDir, "compiled");
13637
13653
  const segmentsCapture = (layeredOrEffectRoute) => shouldSegmentCapture({
13638
13654
  env: process.env,
13639
13655
  durationSeconds: probeResult.duration,
@@ -13764,7 +13780,7 @@ async function executeRenderPipeline(input) {
13764
13780
  try {
13765
13781
  fileServer = await createFileServer({
13766
13782
  projectDir,
13767
- compiledDir: join28(workDir, "compiled"),
13783
+ compiledDir: join29(workDir, "compiled"),
13768
13784
  port: 0,
13769
13785
  preHeadScripts: [VIRTUAL_TIME_SHIM],
13770
13786
  fps: job.config.fps
@@ -13782,8 +13798,8 @@ async function executeRenderPipeline(input) {
13782
13798
  if (!activeFileServer) {
13783
13799
  throw new Error("File server failed to initialize before frame capture");
13784
13800
  }
13785
- const framesDir = join28(workDir, "captured-frames");
13786
- if (!existsSync20(framesDir)) mkdirSync10(framesDir, { recursive: true });
13801
+ const framesDir = join29(workDir, "captured-frames");
13802
+ if (!existsSync21(framesDir)) mkdirSync10(framesDir, { recursive: true });
13787
13803
  updateJobStatus(job, "rendering", "Checking browser GPU", 25, onProgress, {
13788
13804
  code: "start_browsers"
13789
13805
  });
@@ -14347,7 +14363,7 @@ async function executeRenderPipeline(input) {
14347
14363
  hls: ".mp4"
14348
14364
  };
14349
14365
  const videoExt = FORMAT_EXT[outputFormat] ?? ".mp4";
14350
- const videoOnlyPath = join28(workDir, `video-only${videoExt}`);
14366
+ const videoOnlyPath = join29(workDir, `video-only${videoExt}`);
14351
14367
  const usePageSideCompositingForTransitions = (cfg.enablePageSideCompositing || isGif) && compiled.hasShaderTransitions && !hasHdrContent && outputSupportsPageSideShaderCompositing(outputFormat);
14352
14368
  if (usePageSideCompositingForTransitions) {
14353
14369
  activeFileServer.addPreHeadScript(HF_PAGE_SIDE_COMPOSITING_STUB);
@@ -14633,7 +14649,7 @@ async function executeRenderPipeline(input) {
14633
14649
  pageMotionBlur: job.config.pageMotionBlur,
14634
14650
  captureQuality: captureOptions.quality
14635
14651
  });
14636
- const segmentDir = segmentDirFor(join28(projectDir, "renders"), segmentPlanHash);
14652
+ const segmentDir = segmentDirFor(join29(projectDir, "renders"), segmentPlanHash);
14637
14653
  let completedSegments = /* @__PURE__ */ new Set();
14638
14654
  if (job.config.resumeSegments === true) {
14639
14655
  const existing = readSegmentManifest(segmentDir);
@@ -15174,7 +15190,7 @@ async function executeRenderPipeline(input) {
15174
15190
  })
15175
15191
  );
15176
15192
  const totalElapsed = Date.now() - pipelineStart;
15177
- const tmpPeakBytes = existsSync20(workDir) ? sampleDirectoryBytes(workDir) : 0;
15193
+ const tmpPeakBytes = existsSync21(workDir) ? sampleDirectoryBytes(workDir) : 0;
15178
15194
  recordTransientRetryObservability();
15179
15195
  observability.checkpoint("pipeline", "artifact validated", { totalElapsedMs: totalElapsed });
15180
15196
  const observabilitySummary = observability.summary({
@@ -15255,8 +15271,8 @@ async function executeRenderPipeline(input) {
15255
15271
  }
15256
15272
  }
15257
15273
  if (job.config.debug) {
15258
- if (!isPngSequence && !isHls && existsSync20(stagedOutputPath)) {
15259
- const debugOutput = join28(workDir, `output${videoExt}`);
15274
+ if (!isPngSequence && !isHls && existsSync21(stagedOutputPath)) {
15275
+ const debugOutput = join29(workDir, `output${videoExt}`);
15260
15276
  copyFileSync3(stagedOutputPath, debugOutput);
15261
15277
  }
15262
15278
  }
@@ -15366,14 +15382,14 @@ async function executeRenderPipeline(input) {
15366
15382
  }
15367
15383
 
15368
15384
  // ../producer/src/services/distributed/renderSpan.ts
15369
- import { mkdirSync as mkdirSync18, mkdtempSync, readFileSync as readFileSync12, rmSync as rmSync16 } from "fs";
15370
- import { join as join42 } from "path";
15385
+ import { mkdirSync as mkdirSync18, mkdtempSync, readFileSync as readFileSync13, rmSync as rmSync16 } from "fs";
15386
+ import { join as join43 } from "path";
15371
15387
  import { tmpdir as tmpdir4 } from "os";
15372
15388
 
15373
15389
  // ../producer/src/services/distributed/mp4Stitch.ts
15374
15390
  import { createReadStream as createReadStream3, createWriteStream, mkdirSync as mkdirSync11, rmSync as rmSync11 } from "fs";
15375
15391
  import { open } from "fs/promises";
15376
- import { basename as basename7, dirname as dirname12, join as join29 } from "path";
15392
+ import { basename as basename7, dirname as dirname12, join as join30 } from "path";
15377
15393
  import { finished, pipeline } from "stream/promises";
15378
15394
  function boxAt(src, off, at, limit) {
15379
15395
  let size = src.readUInt32BE(off);
@@ -15739,13 +15755,13 @@ async function writeStitchedMp4(chunkPaths, outputPath, audioPath) {
15739
15755
  const header = audioPath ? buildStitchedHeader(layouts.slice(1), layouts[0]) : buildStitchedHeader(layouts);
15740
15756
  mkdirSync11(dirname12(outputPath), { recursive: true });
15741
15757
  const workDir = createStagingDir(dirname12(outputPath), `${basename7(outputPath)}.stitch-`);
15742
- const out = createWriteStream(join29(workDir, "out.mp4"));
15758
+ const out = createWriteStream(join30(workDir, "out.mp4"));
15743
15759
  try {
15744
15760
  out.write(header);
15745
15761
  for (const [i, path] of sourcePaths.entries()) await copyPayload(path, layouts[i], i, out);
15746
15762
  out.end();
15747
15763
  await finished(out);
15748
- renameWithRetry(join29(workDir, "out.mp4"), outputPath);
15764
+ renameWithRetry(join30(workDir, "out.mp4"), outputPath);
15749
15765
  } finally {
15750
15766
  out.destroy();
15751
15767
  rmSync11(workDir, { recursive: true, force: true });
@@ -15756,25 +15772,25 @@ async function writeStitchedMp4(chunkPaths, outputPath, audioPath) {
15756
15772
  import {
15757
15773
  copyFileSync as copyFileSync4,
15758
15774
  cpSync as cpSync2,
15759
- existsSync as existsSync25,
15775
+ existsSync as existsSync26,
15760
15776
  linkSync,
15761
15777
  mkdirSync as mkdirSync14,
15762
15778
  rmSync as rmSync12,
15763
15779
  writeFileSync as writeFileSync9
15764
15780
  } from "fs";
15765
- import { extname as extname6, isAbsolute as isAbsolute2, join as join37, relative as relative5, sep as sep3 } from "path";
15781
+ import { extname as extname6, isAbsolute as isAbsolute2, join as join38, relative as relative5, sep as sep3 } from "path";
15766
15782
 
15767
15783
  // ../producer/src/services/distributed/planFrameCost.ts
15768
- import { join as join32 } from "path";
15784
+ import { join as join33 } from "path";
15769
15785
 
15770
15786
  // ../producer/src/services/distributed/chunkFrames.ts
15771
- import { existsSync as existsSync22, readdirSync as readdirSync7 } from "fs";
15772
- import { extname as extname4, join as join31 } from "path";
15787
+ import { existsSync as existsSync23, readdirSync as readdirSync7 } from "fs";
15788
+ import { extname as extname4, join as join32 } from "path";
15773
15789
 
15774
15790
  // ../producer/src/services/distributed/shared.ts
15775
15791
  import { execFile as execFileCallback } from "child_process";
15776
- import { dirname as dirname13, join as join30 } from "path";
15777
- import { existsSync as existsSync21, readFileSync as readFileSync7 } from "fs";
15792
+ import { dirname as dirname13, join as join31 } from "path";
15793
+ import { existsSync as existsSync22, readFileSync as readFileSync8 } from "fs";
15778
15794
  import { fileURLToPath as fileURLToPath5 } from "url";
15779
15795
  import { promisify as promisify2 } from "util";
15780
15796
  var PLAN_VIDEOS_META_RELATIVE_PATH = "meta/videos.json";
@@ -15785,8 +15801,8 @@ function isPlanAudioArtifactPath(path) {
15785
15801
  }
15786
15802
  function resolvePlanAudioPath(planDir) {
15787
15803
  for (const name of [PLAN_AUDIO_RELATIVE_PATH, PLAN_AUDIO_LEGACY_RELATIVE_PATH]) {
15788
- const candidate = join30(planDir, name);
15789
- if (existsSync21(candidate)) return candidate;
15804
+ const candidate = join31(planDir, name);
15805
+ if (existsSync22(candidate)) return candidate;
15790
15806
  }
15791
15807
  return null;
15792
15808
  }
@@ -16046,10 +16062,10 @@ function readProducerVersion() {
16046
16062
  const startDir = dirname13(fileURLToPath5(import.meta.url));
16047
16063
  let current = startDir;
16048
16064
  for (let i = 0; i < 10; i++) {
16049
- const candidate = join30(current, "package.json");
16050
- if (existsSync21(candidate)) {
16065
+ const candidate = join31(current, "package.json");
16066
+ if (existsSync22(candidate)) {
16051
16067
  try {
16052
- const pkg = JSON.parse(readFileSync7(candidate, "utf-8"));
16068
+ const pkg = JSON.parse(readFileSync8(candidate, "utf-8"));
16053
16069
  if (pkg.name === "@hyperframes/producer" && typeof pkg.version === "string") {
16054
16070
  cachedProducerVersion = pkg.version;
16055
16071
  return pkg.version;
@@ -16101,8 +16117,8 @@ function frameNumberFromFileName(name) {
16101
16117
  function rebuildExtractedFramesFromPlanDir(planDir, videos, indexMode = "dense-v1") {
16102
16118
  const result = [];
16103
16119
  for (const v of videos) {
16104
- const outputDir = join31(planDir, "video-frames", v.videoId);
16105
- if (!existsSync22(outputDir)) {
16120
+ const outputDir = join32(planDir, "video-frames", v.videoId);
16121
+ if (!existsSync23(outputDir)) {
16106
16122
  throw new Error(
16107
16123
  `[renderChunk] planDir missing extracted video frames for ${JSON.stringify(v.videoId)}: ${outputDir} not present. plan() should have written frames here; the planDir is malformed.`
16108
16124
  );
@@ -16120,7 +16136,7 @@ function rebuildExtractedFramesFromPlanDir(planDir, videos, indexMode = "dense-v
16120
16136
  if (!frameName) continue;
16121
16137
  const frameNumber = indexMode === "sparse-v2" ? frameNumberFromFileName(frameName) : null;
16122
16138
  const frameIndex = frameNumber === null ? i : frameNumber - 1;
16123
- framePaths.set(frameIndex, join31(outputDir, frameName));
16139
+ framePaths.set(frameIndex, join32(outputDir, frameName));
16124
16140
  }
16125
16141
  result.push({
16126
16142
  videoId: v.videoId,
@@ -16200,8 +16216,8 @@ async function extractDeferredVideoFramesForChunk(input) {
16200
16216
  sourceOf: (video) => {
16201
16217
  const range = planned.get(video.videoId).deferredRange;
16202
16218
  const remoteUrl = remoteSources[range.sourcePath];
16203
- const sourcePath = remoteUrl ?? join31(input.planDir, ...range.sourcePath.split("/"));
16204
- if (remoteUrl === void 0 && !existsSync22(sourcePath)) {
16219
+ const sourcePath = remoteUrl ?? join32(input.planDir, ...range.sourcePath.split("/"));
16220
+ if (remoteUrl === void 0 && !existsSync23(sourcePath)) {
16205
16221
  throw new RenderChunkValidationError(
16206
16222
  MISSING_PLAN_ARTIFACT,
16207
16223
  `[renderChunk] planDir is missing the source for video ${JSON.stringify(video.videoId)}: ${range.sourcePath}`
@@ -16231,12 +16247,12 @@ async function measurePlanSecondsPerFrame(input) {
16231
16247
  planVideos,
16232
16248
  frames: sampled,
16233
16249
  fps: fpsRatio,
16234
- outputRoot: join32(workDir, "frame-cost-video-frames"),
16250
+ outputRoot: join33(workDir, "frame-cost-video-frames"),
16235
16251
  cfg: input.cfg
16236
16252
  })
16237
16253
  ];
16238
16254
  const lookup = extracted.length > 0 ? createFrameLookupTable(planVideos.videos, extracted, resolveRenderFpsConfig(fpsRatio).value) : null;
16239
- const compiledDir = join32(planDir, "compiled");
16255
+ const compiledDir = join33(planDir, "compiled");
16240
16256
  const fileServer = await createFileServer({
16241
16257
  projectDir: compiledDir,
16242
16258
  compiledDir,
@@ -16248,7 +16264,7 @@ async function measurePlanSecondsPerFrame(input) {
16248
16264
  try {
16249
16265
  session = await createCaptureSession(
16250
16266
  fileServer.url,
16251
- join32(workDir, "frame-cost"),
16267
+ join33(workDir, "frame-cost"),
16252
16268
  buildChunkCaptureOptions({
16253
16269
  dimensions: { ...input, fpsNum: fps, fpsDen: 1 },
16254
16270
  encoder: input,
@@ -16344,21 +16360,21 @@ function buildWeightedChunkSlices(weights, chunkCount, minFrames, maxFrames) {
16344
16360
  }
16345
16361
 
16346
16362
  // ../producer/src/services/render/planReferenceBackground.ts
16347
- import { join as join33 } from "path";
16363
+ import { join as join34 } from "path";
16348
16364
  async function readPlanReferenceBackground(input) {
16349
16365
  let server;
16350
16366
  let session;
16351
16367
  try {
16352
16368
  server = await createFileServer({
16353
16369
  projectDir: input.projectDir,
16354
- compiledDir: join33(input.workDir, "compiled"),
16370
+ compiledDir: join34(input.workDir, "compiled"),
16355
16371
  port: 0,
16356
16372
  preHeadScripts: [VIRTUAL_TIME_SHIM],
16357
16373
  fps: input.options.fps
16358
16374
  });
16359
16375
  session = await createCaptureSession(
16360
16376
  server.url,
16361
- join33(input.workDir, "reference"),
16377
+ join34(input.workDir, "reference"),
16362
16378
  {
16363
16379
  ...input.options,
16364
16380
  requiresWebGpu: false
@@ -16394,8 +16410,8 @@ async function readPlanReferenceBackground(input) {
16394
16410
  }
16395
16411
 
16396
16412
  // ../producer/src/services/render/stages/freezePlan.ts
16397
- import { existsSync as existsSync23, mkdirSync as mkdirSync12, readFileSync as readFileSync8, readdirSync as readdirSync8, writeFileSync as writeFileSync7 } from "fs";
16398
- import { join as join34, relative as relative3, resolve as resolve7 } from "path";
16413
+ import { existsSync as existsSync24, mkdirSync as mkdirSync12, readFileSync as readFileSync9, readdirSync as readdirSync8, writeFileSync as writeFileSync7 } from "fs";
16414
+ import { join as join35, relative as relative3, resolve as resolve7 } from "path";
16399
16415
 
16400
16416
  // ../producer/src/services/distributed/planProtocol.ts
16401
16417
  var PLAN_SCHEMA_VERSION = 1;
@@ -16584,7 +16600,7 @@ function planFileSha256(absolutePath, digests) {
16584
16600
  return sha256;
16585
16601
  }
16586
16602
  async function prehashPlanFiles(dir, digests) {
16587
- if (!existsSync23(dir)) return;
16603
+ if (!existsSync24(dir)) return;
16588
16604
  for (const { absolutePath } of listPlanFiles(dir)) {
16589
16605
  if (!digests.has(absolutePath)) digests.set(absolutePath, await sha256FileAsync(absolutePath));
16590
16606
  }
@@ -16609,7 +16625,7 @@ function listPlanFiles(planDir) {
16609
16625
  function walk(dir) {
16610
16626
  const entries = readdirSync8(dir, { withFileTypes: true });
16611
16627
  for (const entry of entries) {
16612
- const full = join34(dir, entry.name);
16628
+ const full = join35(dir, entry.name);
16613
16629
  if (entry.isDirectory()) {
16614
16630
  walk(full);
16615
16631
  } else if (entry.isFile()) {
@@ -16630,7 +16646,7 @@ function collectPlanAssetShas(planDir, digests) {
16630
16646
  const assets = [];
16631
16647
  for (const file of files) {
16632
16648
  if (file.planRelativePath === COMPILED_INDEX_RELATIVE_PATH) {
16633
- compositionHtml = readFileSync8(file.absolutePath);
16649
+ compositionHtml = readFileSync9(file.absolutePath);
16634
16650
  continue;
16635
16651
  }
16636
16652
  if (HASH_EXCLUDED_PLAN_FILES.has(file.planRelativePath)) continue;
@@ -16650,23 +16666,23 @@ var PLAN_REMOTE_FILES_RELATIVE_PATH = "meta/remote-files.json";
16650
16666
  function writePlanRemoteFiles(planDir, files) {
16651
16667
  if (files.length === 0) return;
16652
16668
  const sorted = [...files].sort((a, b) => a.path < b.path ? -1 : 1);
16653
- writeFileSync7(join34(planDir, PLAN_REMOTE_FILES_RELATIVE_PATH), JSON.stringify(sorted), "utf-8");
16669
+ writeFileSync7(join35(planDir, PLAN_REMOTE_FILES_RELATIVE_PATH), JSON.stringify(sorted), "utf-8");
16654
16670
  }
16655
16671
  function readPlanRemoteFiles(planDir) {
16656
- const path = join34(planDir, PLAN_REMOTE_FILES_RELATIVE_PATH);
16657
- return existsSync23(path) ? JSON.parse(readFileSync8(path, "utf-8")) : [];
16672
+ const path = join35(planDir, PLAN_REMOTE_FILES_RELATIVE_PATH);
16673
+ return existsSync24(path) ? JSON.parse(readFileSync9(path, "utf-8")) : [];
16658
16674
  }
16659
16675
  function recomputePlanHashFromPlanDir(planDir, digests) {
16660
- const planJsonPath = join34(planDir, "plan.json");
16661
- const encoderJsonPath = join34(planDir, "meta", "encoder.json");
16662
- if (!existsSync23(planJsonPath)) {
16676
+ const planJsonPath = join35(planDir, "plan.json");
16677
+ const encoderJsonPath = join35(planDir, "meta", "encoder.json");
16678
+ if (!existsSync24(planJsonPath)) {
16663
16679
  throw new Error(`[freezePlan] plan.json missing: ${planJsonPath}`);
16664
16680
  }
16665
- if (!existsSync23(encoderJsonPath)) {
16681
+ if (!existsSync24(encoderJsonPath)) {
16666
16682
  throw new Error(`[freezePlan] meta/encoder.json missing: ${encoderJsonPath}`);
16667
16683
  }
16668
- const planJson = JSON.parse(readFileSync8(planJsonPath, "utf-8"));
16669
- const encoderConfigCanonicalJson = readFileSync8(encoderJsonPath, "utf-8");
16684
+ const planJson = JSON.parse(readFileSync9(planJsonPath, "utf-8"));
16685
+ const encoderConfigCanonicalJson = readFileSync9(encoderJsonPath, "utf-8");
16670
16686
  const { compositionHtml, assets } = collectPlanAssetShas(planDir, digests);
16671
16687
  return computePlanHash({
16672
16688
  compositionHtml,
@@ -16692,21 +16708,21 @@ async function freezePlan(input) {
16692
16708
  hasAudio,
16693
16709
  digests
16694
16710
  } = input;
16695
- if (!existsSync23(planDir)) {
16711
+ if (!existsSync24(planDir)) {
16696
16712
  throw new Error(`[freezePlan] planDir does not exist: ${planDir}`);
16697
16713
  }
16698
- const metaDir = join34(planDir, "meta");
16699
- if (!existsSync23(metaDir)) mkdirSync12(metaDir, { recursive: true });
16714
+ const metaDir = join35(planDir, "meta");
16715
+ if (!existsSync24(metaDir)) mkdirSync12(metaDir, { recursive: true });
16700
16716
  writeFileSync7(
16701
- join34(metaDir, "composition.json"),
16717
+ join35(metaDir, "composition.json"),
16702
16718
  `${JSON.stringify(composition, null, 2)}
16703
16719
  `,
16704
16720
  "utf-8"
16705
16721
  );
16706
16722
  const encoderForCanonical = stripUndefined(encoder);
16707
16723
  const encoderConfigCanonicalJson = canonicalJsonStringify(encoderForCanonical);
16708
- writeFileSync7(join34(metaDir, "encoder.json"), encoderConfigCanonicalJson, "utf-8");
16709
- writeFileSync7(join34(metaDir, "chunks.json"), `${JSON.stringify(chunks, null, 2)}
16724
+ writeFileSync7(join35(metaDir, "encoder.json"), encoderConfigCanonicalJson, "utf-8");
16725
+ writeFileSync7(join35(metaDir, "chunks.json"), `${JSON.stringify(chunks, null, 2)}
16710
16726
  `, "utf-8");
16711
16727
  const { compositionHtml, assets } = collectPlanAssetShas(planDir, digests);
16712
16728
  const planHash = computePlanHash({
@@ -16731,7 +16747,7 @@ async function freezePlan(input) {
16731
16747
  duration: durationSeconds,
16732
16748
  hasAudio
16733
16749
  };
16734
- const planJsonPath = join34(planDir, "plan.json");
16750
+ const planJsonPath = join35(planDir, "plan.json");
16735
16751
  writeFileSync7(planJsonPath, `${JSON.stringify(planJson, null, 2)}
16736
16752
  `, "utf-8");
16737
16753
  return { planJsonPath, planHash };
@@ -16773,9 +16789,9 @@ function applyRuntimeEnvSnapshot(snapshot, env = process.env) {
16773
16789
  }
16774
16790
 
16775
16791
  // ../producer/src/services/distributed/chunkAudio.ts
16776
- import { closeSync as closeSync5, existsSync as existsSync24, ftruncateSync, mkdirSync as mkdirSync13, openSync as openSync5, readFileSync as readFileSync9 } from "fs";
16792
+ import { closeSync as closeSync5, existsSync as existsSync25, ftruncateSync, mkdirSync as mkdirSync13, openSync as openSync5, readFileSync as readFileSync10 } from "fs";
16777
16793
  import { writeFileSync as writeFileSync8, writeSync } from "fs";
16778
- import { join as join35 } from "path";
16794
+ import { join as join36 } from "path";
16779
16795
  function audioCutForChunk(grid, chunks, index, fps) {
16780
16796
  const firstPacketAt = (frame) => Math.min(
16781
16797
  grid.packetCount,
@@ -16860,9 +16876,9 @@ async function writeChunkAudioSlices(input) {
16860
16876
  offset += track.sizes[offsets.length - 1];
16861
16877
  }
16862
16878
  });
16863
- const bytes = readFileSync9(input.audioPath);
16879
+ const bytes = readFileSync10(input.audioPath);
16864
16880
  const layout = { sizeBytes: bytes.length, payloadStart, payloadEnd, partStarts: {} };
16865
- mkdirSync13(join35(input.planDir, SLICE_DIR), { recursive: true });
16881
+ mkdirSync13(join36(input.planDir, SLICE_DIR), { recursive: true });
16866
16882
  input.chunks.forEach((_, index) => {
16867
16883
  const cut = audioCutForChunk(grid, input.chunks, index, input.fps);
16868
16884
  if (!cut) return;
@@ -16870,17 +16886,17 @@ async function writeChunkAudioSlices(input) {
16870
16886
  const start = offsets[cut.firstPacket];
16871
16887
  layout.partStarts[index] = start;
16872
16888
  const end = offsets[last] + track.sizes[last];
16873
- writeFileSync8(join35(input.planDir, chunkAudioSlicePath(index)), bytes.subarray(start, end));
16889
+ writeFileSync8(join36(input.planDir, chunkAudioSlicePath(index)), bytes.subarray(start, end));
16874
16890
  });
16875
16891
  const frame = [bytes.subarray(0, payloadStart), bytes.subarray(payloadEnd)];
16876
- writeFileSync8(join35(input.planDir, SLICE_FRAME), Buffer.concat(frame));
16877
- writeFileSync8(join35(input.planDir, SLICE_LAYOUT), JSON.stringify(layout));
16892
+ writeFileSync8(join36(input.planDir, SLICE_FRAME), Buffer.concat(frame));
16893
+ writeFileSync8(join36(input.planDir, SLICE_LAYOUT), JSON.stringify(layout));
16878
16894
  }
16879
16895
  function chunkAudioSource(planDir, chunkIndex, scratchPath) {
16880
- const layoutPath = join35(planDir, SLICE_LAYOUT);
16881
- if (!existsSync24(layoutPath)) return resolvePlanAudioPath(planDir);
16882
- const layout = JSON.parse(readFileSync9(layoutPath, "utf-8"));
16883
- const frame = readFileSync9(join35(planDir, SLICE_FRAME));
16896
+ const layoutPath = join36(planDir, SLICE_LAYOUT);
16897
+ if (!existsSync25(layoutPath)) return resolvePlanAudioPath(planDir);
16898
+ const layout = JSON.parse(readFileSync10(layoutPath, "utf-8"));
16899
+ const frame = readFileSync10(join36(planDir, SLICE_FRAME));
16884
16900
  const fd = openSync5(scratchPath, "w");
16885
16901
  try {
16886
16902
  writeSync(fd, frame, 0, layout.payloadStart, 0);
@@ -16893,7 +16909,7 @@ function chunkAudioSource(planDir, chunkIndex, scratchPath) {
16893
16909
  );
16894
16910
  const start = layout.partStarts[chunkIndex];
16895
16911
  if (start !== void 0) {
16896
- const part = readFileSync9(join35(planDir, chunkAudioSlicePath(chunkIndex)));
16912
+ const part = readFileSync10(join36(planDir, chunkAudioSlicePath(chunkIndex)));
16897
16913
  writeSync(fd, part, 0, part.length, start);
16898
16914
  }
16899
16915
  ftruncateSync(fd, layout.sizeBytes);
@@ -16949,7 +16965,7 @@ async function muxChunkWithAudio(input) {
16949
16965
  // ../producer/src/services/distributed/planSize.ts
16950
16966
  import { createHash as createHash7 } from "crypto";
16951
16967
  import { lstatSync as lstatSync2, readdirSync as readdirSync9 } from "fs";
16952
- import { extname as extname5, join as join36, relative as relative4 } from "path";
16968
+ import { extname as extname5, join as join37, relative as relative4 } from "path";
16953
16969
  var MAX_TOP_COMPONENTS = 10;
16954
16970
  var SOURCE_MEDIA_EXTENSIONS = /* @__PURE__ */ new Set([
16955
16971
  ".aac",
@@ -17061,7 +17077,7 @@ function walkRegularFiles(dir, visit) {
17061
17077
  return;
17062
17078
  }
17063
17079
  for (const entry of entries) {
17064
- const full = join36(dir, entry.name);
17080
+ const full = join37(dir, entry.name);
17065
17081
  if (entry.isDirectory()) {
17066
17082
  walkRegularFiles(full, visit);
17067
17083
  } else if (entry.isFile()) {
@@ -17277,13 +17293,13 @@ function assertPositiveInteger2(name, value) {
17277
17293
  }
17278
17294
  var FREEZE_OWNED_PLAN_FILES = [
17279
17295
  "plan.json",
17280
- join37("meta", "composition.json"),
17281
- join37("meta", "encoder.json"),
17282
- join37("meta", "chunks.json")
17296
+ join38("meta", "composition.json"),
17297
+ join38("meta", "encoder.json"),
17298
+ join38("meta", "chunks.json")
17283
17299
  ];
17284
17300
  function removeFreezeOwnedPlanFiles(planDir) {
17285
17301
  for (const relativePath of FREEZE_OWNED_PLAN_FILES) {
17286
- rmSync12(join37(planDir, relativePath), { force: true });
17302
+ rmSync12(join38(planDir, relativePath), { force: true });
17287
17303
  }
17288
17304
  }
17289
17305
  function buildChunkSlices(totalFrames, chunkCount, effectiveChunkSize) {
@@ -17438,19 +17454,19 @@ function createVideoSourceShipper(input) {
17438
17454
  const known = shipped.get(srcPath);
17439
17455
  if (known) return known;
17440
17456
  const stagedRel = pathInside(input.workVideoFramesDir, srcPath);
17441
- const current = stagedRel === null ? srcPath : join37(input.planDir, "video-frames", stagedRel);
17457
+ const current = stagedRel === null ? srcPath : join38(input.planDir, "video-frames", stagedRel);
17442
17458
  let result = null;
17443
17459
  for (const root of stagedRel === null ? [input.workCompiledDir, input.projectDir] : []) {
17444
17460
  const rel = pathInside(root, srcPath);
17445
- if (rel !== null && (existsSync25(join37(input.planDir, "compiled", rel)) || input.isRemote(srcPath))) {
17461
+ if (rel !== null && (existsSync26(join38(input.planDir, "compiled", rel)) || input.isRemote(srcPath))) {
17446
17462
  result = ["compiled", ...rel.split(sep3)].join("/");
17447
17463
  break;
17448
17464
  }
17449
17465
  }
17450
17466
  if (result === null) {
17451
17467
  result = `video-sources/${shipped.size}${extname6(current)}`;
17452
- const destination = join37(input.planDir, ...result.split("/"));
17453
- mkdirSync14(join37(input.planDir, "video-sources"), { recursive: true });
17468
+ const destination = join38(input.planDir, ...result.split("/"));
17469
+ mkdirSync14(join38(input.planDir, "video-sources"), { recursive: true });
17454
17470
  try {
17455
17471
  linkSync(current, destination);
17456
17472
  } catch {
@@ -17470,7 +17486,7 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
17470
17486
  useGpu: false,
17471
17487
  browserGpuMode: "software"
17472
17488
  });
17473
- if (!existsSync25(planDir)) mkdirSync14(planDir, { recursive: true });
17489
+ if (!existsSync26(planDir)) mkdirSync14(planDir, { recursive: true });
17474
17490
  const log = config.logger ?? defaultLogger;
17475
17491
  const sizeLimitBytes = options.executionPlanSizeLimitBytes ?? config.planDirSizeLimitBytes ?? PLAN_DIR_SIZE_LIMIT_BYTES;
17476
17492
  const abortSignal = config.abortSignal;
@@ -17500,14 +17516,14 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
17500
17516
  pageMotionBlur: config.pageMotionBlur
17501
17517
  });
17502
17518
  const entryFile = config.entryFile ?? "index.html";
17503
- const htmlPath = join37(projectDir, entryFile);
17504
- if (!existsSync25(htmlPath)) {
17519
+ const htmlPath = join38(projectDir, entryFile);
17520
+ if (!existsSync26(htmlPath)) {
17505
17521
  throw new Error(`[plan] entry file not found: ${htmlPath}`);
17506
17522
  }
17507
- const workDir = join37(planDir, ".plan-work");
17523
+ const workDir = join38(planDir, ".plan-work");
17508
17524
  rmSync12(workDir, { recursive: true, force: true });
17509
17525
  mkdirSync14(workDir, { recursive: true });
17510
- const compiledDir = join37(workDir, "compiled");
17526
+ const compiledDir = join38(workDir, "compiled");
17511
17527
  mkdirSync14(compiledDir, { recursive: true });
17512
17528
  let stageStarted = Date.now();
17513
17529
  cpSync2(projectDir, compiledDir, {
@@ -17521,10 +17537,10 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
17521
17537
  }
17522
17538
  });
17523
17539
  logPlanStage(log, "copy", stageStarted);
17524
- const finalCompiledDir = join37(planDir, "compiled");
17540
+ const finalCompiledDir = join38(planDir, "compiled");
17525
17541
  const needsAlpha = outputNeedsAlpha(config.format);
17526
17542
  const remoteFiles = Object.entries(options.remoteFiles ?? {});
17527
- const remoteLocalPath = (rel) => join37(projectDir, ...rel.split("/"));
17543
+ const remoteLocalPath = (rel) => join38(projectDir, ...rel.split("/"));
17528
17544
  for (const [, file] of remoteFiles) {
17529
17545
  declareContentAddressedUrl(file.url, file.sha256);
17530
17546
  if (file.probeFactsUrl) declareProbeFactsUrl(file.url, file.probeFactsUrl);
@@ -17620,7 +17636,7 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
17620
17636
  if (probeResult.fileServer) closeFileServerSafely(probeResult.fileServer, "plan", log);
17621
17637
  if (probeResult.probeSession) {
17622
17638
  try {
17623
- const { closeCaptureSession: closeCaptureSession2 } = await import("./src-NIMSUB4P.js");
17639
+ const { closeCaptureSession: closeCaptureSession2 } = await import("./src-C43KUEBY.js");
17624
17640
  await closeCaptureSession2(probeResult.probeSession);
17625
17641
  } catch (err) {
17626
17642
  log.warn("[plan] probe session close failed", {
@@ -17727,17 +17743,17 @@ async function buildLocalExecutionPlan(projectDir, config, executionPlanDir, opt
17727
17743
  let stageStarted = Date.now();
17728
17744
  const extractResult = await extractPlanVideos(c, options.deferVideoExtraction);
17729
17745
  logPlanStage(log, "extract", stageStarted);
17730
- const stagedVideoFrames = join37(compiledDir, "__hyperframes_video_frames");
17731
- const videoFramesDst = join37(planDir, "video-frames");
17732
- if (existsSync25(videoFramesDst)) rmSync12(videoFramesDst, { recursive: true, force: true });
17733
- const videoSourcesDir = join37(planDir, "video-sources");
17746
+ const stagedVideoFrames = join38(compiledDir, "__hyperframes_video_frames");
17747
+ const videoFramesDst = join38(planDir, "video-frames");
17748
+ if (existsSync26(videoFramesDst)) rmSync12(videoFramesDst, { recursive: true, force: true });
17749
+ const videoSourcesDir = join38(planDir, "video-sources");
17734
17750
  rmSync12(videoSourcesDir, { recursive: true, force: true });
17735
- if (existsSync25(stagedVideoFrames)) {
17751
+ if (existsSync26(stagedVideoFrames)) {
17736
17752
  renameWithRetry(stagedVideoFrames, videoFramesDst);
17737
17753
  } else {
17738
17754
  mkdirSync14(videoFramesDst, { recursive: true });
17739
17755
  }
17740
- if (existsSync25(finalCompiledDir)) rmSync12(finalCompiledDir, { recursive: true, force: true });
17756
+ if (existsSync26(finalCompiledDir)) rmSync12(finalCompiledDir, { recursive: true, force: true });
17741
17757
  renameWithRetry(compiledDir, finalCompiledDir);
17742
17758
  const shipVideoSource = createVideoSourceShipper({
17743
17759
  planDir,
@@ -17767,7 +17783,7 @@ async function buildLocalExecutionPlan(projectDir, config, executionPlanDir, opt
17767
17783
  };
17768
17784
  })
17769
17785
  });
17770
- mkdirSync14(join37(planDir, "meta"), { recursive: true });
17786
+ mkdirSync14(join38(planDir, "meta"), { recursive: true });
17771
17787
  writePlanRemoteFiles(
17772
17788
  planDir,
17773
17789
  remoteFiles.map(([rel, { sha256, sizeBytes }]) => ({
@@ -17777,7 +17793,7 @@ async function buildLocalExecutionPlan(projectDir, config, executionPlanDir, opt
17777
17793
  }))
17778
17794
  );
17779
17795
  writeFileSync9(
17780
- join37(planDir, PLAN_VIDEOS_META_RELATIVE_PATH),
17796
+ join38(planDir, PLAN_VIDEOS_META_RELATIVE_PATH),
17781
17797
  JSON.stringify(planVideosJson, null, 2),
17782
17798
  "utf-8"
17783
17799
  );
@@ -17857,11 +17873,11 @@ async function buildLocalExecutionPlan(projectDir, config, executionPlanDir, opt
17857
17873
  if (audioResult?.audioError) {
17858
17874
  applyDistributedAudioWarningPolicy(job, audioResult.audioError, audioResult.audioFailures, log);
17859
17875
  }
17860
- const planAudioPath = join37(planDir, PLAN_AUDIO_RELATIVE_PATH);
17861
- if (audioResult?.hasAudio && existsSync25(audioResult.audioOutputPath)) {
17876
+ const planAudioPath = join38(planDir, PLAN_AUDIO_RELATIVE_PATH);
17877
+ if (audioResult?.hasAudio && existsSync26(audioResult.audioOutputPath)) {
17862
17878
  renameWithRetry(audioResult.audioOutputPath, planAudioPath);
17863
17879
  }
17864
- if (chunksCarryAudio && existsSync25(planAudioPath)) {
17880
+ if (chunksCarryAudio && existsSync26(planAudioPath)) {
17865
17881
  if (options.sliceChunkAudio) {
17866
17882
  stageStarted = Date.now();
17867
17883
  await writeChunkAudioSlices({
@@ -17979,36 +17995,36 @@ async function plan(projectDir, config, planDir, options = {}) {
17979
17995
 
17980
17996
  // ../producer/src/services/distributed/renderChunk.ts
17981
17997
  import { randomBytes } from "crypto";
17982
- import { existsSync as existsSync28, mkdirSync as mkdirSync17, readFileSync as readFileSync11, readdirSync as readdirSync11, rmSync as rmSync15, writeFileSync as writeFileSync12 } from "fs";
17998
+ import { existsSync as existsSync29, mkdirSync as mkdirSync17, readFileSync as readFileSync12, readdirSync as readdirSync11, rmSync as rmSync15, writeFileSync as writeFileSync12 } from "fs";
17983
17999
  import { cpus as cpus3 } from "os";
17984
- import { join as join41 } from "path";
18000
+ import { join as join42 } from "path";
17985
18001
 
17986
18002
  // ../producer/src/services/distributed/planV2.ts
17987
18003
  import {
17988
18004
  copyFileSync as copyFileSync6,
17989
- existsSync as existsSync27,
18005
+ existsSync as existsSync28,
17990
18006
  lstatSync as lstatSync3,
17991
18007
  mkdirSync as mkdirSync16,
17992
- readFileSync as readFileSync10,
18008
+ readFileSync as readFileSync11,
17993
18009
  readdirSync as readdirSync10,
17994
18010
  rmSync as rmSync14,
17995
18011
  statSync as statSync9,
17996
18012
  writeFileSync as writeFileSync11
17997
18013
  } from "fs";
17998
18014
  import { tmpdir as tmpdir3 } from "os";
17999
- import { dirname as dirname15, isAbsolute as isAbsolute3, join as join40, relative as relative6, resolve as resolve8, sep as sep4 } from "path";
18015
+ import { dirname as dirname15, isAbsolute as isAbsolute3, join as join41, relative as relative6, resolve as resolve8, sep as sep4 } from "path";
18000
18016
 
18001
18017
  // ../producer/src/services/distributed/planV2Publisher.ts
18002
18018
  import {
18003
18019
  copyFileSync as copyFileSync5,
18004
- existsSync as existsSync26,
18020
+ existsSync as existsSync27,
18005
18021
  linkSync as linkSync2,
18006
18022
  mkdirSync as mkdirSync15,
18007
18023
  rmSync as rmSync13,
18008
18024
  statSync as statSync8,
18009
18025
  writeFileSync as writeFileSync10
18010
18026
  } from "fs";
18011
- import { dirname as dirname14, join as join39 } from "path";
18027
+ import { dirname as dirname14, join as join40 } from "path";
18012
18028
 
18013
18029
  // ../producer/src/services/distributed/planV2Errors.ts
18014
18030
  var PLAN_V2_INTEGRITY_UNRECOVERABLE = "PLAN_V2_INTEGRITY_UNRECOVERABLE";
@@ -18023,7 +18039,7 @@ var PlanV2IntegrityError = class extends Error {
18023
18039
  };
18024
18040
 
18025
18041
  // ../producer/src/services/distributed/planV2Layout.ts
18026
- import { join as join38 } from "path";
18042
+ import { join as join39 } from "path";
18027
18043
  var SHA256_PATTERN = /^[0-9a-f]{64}$/;
18028
18044
  function assertPlanV2Sha256(value, field) {
18029
18045
  if (typeof value !== "string" || !SHA256_PATTERN.test(value)) {
@@ -18033,7 +18049,7 @@ function assertPlanV2Sha256(value, field) {
18033
18049
  }
18034
18050
  function planV2BlobPath(root, sha256) {
18035
18051
  const digest = assertPlanV2Sha256(sha256, "artifact sha256");
18036
- return join38(root, "artifacts", "sha256", digest.slice(0, 2), digest);
18052
+ return join39(root, "artifacts", "sha256", digest.slice(0, 2), digest);
18037
18053
  }
18038
18054
 
18039
18055
  // ../producer/src/services/distributed/planV2Publisher.ts
@@ -18068,7 +18084,7 @@ var LocalPlanV2ArtifactPublisher = class {
18068
18084
  #linkFile;
18069
18085
  #committed = false;
18070
18086
  constructor(destinationDir, options = {}) {
18071
- if (existsSync26(destinationDir)) {
18087
+ if (existsSync27(destinationDir)) {
18072
18088
  throw new PlanV2IntegrityError(`output directory already exists: ${destinationDir}`);
18073
18089
  }
18074
18090
  this.destinationDir = destinationDir;
@@ -18085,10 +18101,10 @@ var LocalPlanV2ArtifactPublisher = class {
18085
18101
  );
18086
18102
  }
18087
18103
  const destinationPath = planV2BlobPath(this.temporaryDir, digest);
18088
- if (existsSync26(destinationPath)) return;
18104
+ if (existsSync27(destinationPath)) return;
18089
18105
  mkdirSync15(dirname14(destinationPath), { recursive: true });
18090
18106
  const stagingDir = createStagingDir(dirname14(destinationPath), ".plan-v2-blob-");
18091
- const temporaryPath = join39(stagingDir, "blob");
18107
+ const temporaryPath = join40(stagingDir, "blob");
18092
18108
  try {
18093
18109
  try {
18094
18110
  this.#linkFile(blob.sourcePath, temporaryPath);
@@ -18103,13 +18119,13 @@ var LocalPlanV2ArtifactPublisher = class {
18103
18119
  }
18104
18120
  async commitManifest(manifestBytes) {
18105
18121
  for (const digest of new Set(manifestDigests(manifestBytes))) {
18106
- if (!existsSync26(planV2BlobPath(this.temporaryDir, digest))) {
18122
+ if (!existsSync27(planV2BlobPath(this.temporaryDir, digest))) {
18107
18123
  throw new PlanV2IntegrityError(
18108
18124
  `cannot commit manifest before referenced blob is durable: ${digest}`
18109
18125
  );
18110
18126
  }
18111
18127
  }
18112
- writeFileSync10(join39(this.temporaryDir, "plan.json"), manifestBytes, "utf-8");
18128
+ writeFileSync10(join40(this.temporaryDir, "plan.json"), manifestBytes, "utf-8");
18113
18129
  renameWithRetry(this.temporaryDir, this.destinationDir);
18114
18130
  this.#committed = true;
18115
18131
  }
@@ -18134,7 +18150,7 @@ function isNonNegativeIntegerArray(value) {
18134
18150
  return Array.isArray(value) && value.every((item) => typeof item === "number" && Number.isInteger(item) && item >= 0);
18135
18151
  }
18136
18152
  function readJsonFile(path, label) {
18137
- const contents = readFileSync10(path, "utf-8");
18153
+ const contents = readFileSync11(path, "utf-8");
18138
18154
  try {
18139
18155
  const parsed = JSON.parse(contents);
18140
18156
  return parsed;
@@ -18154,7 +18170,7 @@ function listFiles(root) {
18154
18170
  const rootResolved = resolve8(root);
18155
18171
  function walk(dir) {
18156
18172
  for (const entry of readdirSync10(dir, { withFileTypes: true })) {
18157
- const absolutePath = join40(dir, entry.name);
18173
+ const absolutePath = join41(dir, entry.name);
18158
18174
  if (entry.isDirectory()) {
18159
18175
  walk(absolutePath);
18160
18176
  } else if (entry.isFile()) {
@@ -18181,13 +18197,13 @@ function assertValidExtractionCacheCompleteSentinel(path) {
18181
18197
  }
18182
18198
  }
18183
18199
  function validateExtractionCacheCompleteSentinels(executionPlanDir) {
18184
- const videoRoot = join40(executionPlanDir, "video-frames");
18185
- if (!existsSync27(videoRoot)) return;
18200
+ const videoRoot = join41(executionPlanDir, "video-frames");
18201
+ if (!existsSync28(videoRoot)) return;
18186
18202
  for (const videoEntry of readdirSync10(videoRoot, { withFileTypes: true })) {
18187
18203
  if (!videoEntry.isDirectory()) continue;
18188
- const videoDir = join40(videoRoot, videoEntry.name);
18204
+ const videoDir = join41(videoRoot, videoEntry.name);
18189
18205
  if (readdirSync10(videoDir).includes(EXTRACTION_CACHE_COMPLETE_SENTINEL)) {
18190
- const sentinelPath = join40(videoDir, EXTRACTION_CACHE_COMPLETE_SENTINEL);
18206
+ const sentinelPath = join41(videoDir, EXTRACTION_CACHE_COMPLETE_SENTINEL);
18191
18207
  assertValidExtractionCacheCompleteSentinel(sentinelPath);
18192
18208
  }
18193
18209
  }
@@ -18234,7 +18250,7 @@ function listVideoFramePaths(executionPlanDir, videos) {
18234
18250
  if (video.deferredRange) {
18235
18251
  const framePaths2 = /* @__PURE__ */ new Map();
18236
18252
  for (let index = 0; index < video.totalFrames; index++) {
18237
- framePaths2.set(index, join40(outputDir, String(index)));
18253
+ framePaths2.set(index, join41(outputDir, String(index)));
18238
18254
  }
18239
18255
  return { ...video, outputDir, framePaths: framePaths2, ownedByLookup: false };
18240
18256
  }
@@ -18242,7 +18258,7 @@ function listVideoFramePaths(executionPlanDir, videos) {
18242
18258
  const framePaths = /* @__PURE__ */ new Map();
18243
18259
  for (const frameName of frameNames) {
18244
18260
  if (frameName === EXTRACTION_CACHE_COMPLETE_SENTINEL) {
18245
- assertValidExtractionCacheCompleteSentinel(join40(outputDir, frameName));
18261
+ assertValidExtractionCacheCompleteSentinel(join41(outputDir, frameName));
18246
18262
  continue;
18247
18263
  }
18248
18264
  const match = /(\d+)(?=\.[^.]+$)/.exec(frameName);
@@ -18261,7 +18277,7 @@ function listVideoFramePaths(executionPlanDir, videos) {
18261
18277
  `duplicate extracted frame index ${frameIndex} in ${outputDir}`
18262
18278
  );
18263
18279
  }
18264
- framePaths.set(frameIndex, join40(outputDir, frameName));
18280
+ framePaths.set(frameIndex, join41(outputDir, frameName));
18265
18281
  }
18266
18282
  return {
18267
18283
  ...video,
@@ -18282,8 +18298,8 @@ function parsePlanVideosJson2(value) {
18282
18298
  }
18283
18299
  }
18284
18300
  function materializeExtractedVideoDirectories(planDir) {
18285
- const videosPath = join40(planDir, PLAN_VIDEOS_META_RELATIVE_PATH);
18286
- if (!existsSync27(videosPath)) return;
18301
+ const videosPath = join41(planDir, PLAN_VIDEOS_META_RELATIVE_PATH);
18302
+ if (!existsSync28(videosPath)) return;
18287
18303
  const videos = parsePlanVideosJson2(readJsonFile(videosPath, PLAN_VIDEOS_META_RELATIVE_PATH));
18288
18304
  for (const video of videos.extracted) {
18289
18305
  mkdirSync16(resolveExtractedVideoOutputDir(planDir, video.videoId), { recursive: true });
@@ -18316,13 +18332,13 @@ function parseChunkSlices(value) {
18316
18332
  });
18317
18333
  }
18318
18334
  function buildVideoChunkDependencies(executionPlanDir, dimensions) {
18319
- const videoRoot = join40(executionPlanDir, "video-frames");
18320
- const hasExtractedFrames = existsSync27(videoRoot) && listFiles(videoRoot).length > 0;
18321
- const videosPath = join40(executionPlanDir, PLAN_VIDEOS_META_RELATIVE_PATH);
18322
- if (!existsSync27(videosPath)) {
18335
+ const videoRoot = join41(executionPlanDir, "video-frames");
18336
+ const hasExtractedFrames = existsSync28(videoRoot) && listFiles(videoRoot).length > 0;
18337
+ const videosPath = join41(executionPlanDir, PLAN_VIDEOS_META_RELATIVE_PATH);
18338
+ if (!existsSync28(videosPath)) {
18323
18339
  return hasExtractedFrames ? { mode: "full-source-pack", dependencies: null } : { mode: "exact-rendered-frames", dependencies: /* @__PURE__ */ new Map() };
18324
18340
  }
18325
- const chunksPath = join40(executionPlanDir, "meta", "chunks.json");
18341
+ const chunksPath = join41(executionPlanDir, "meta", "chunks.json");
18326
18342
  const videos = readJsonFile(videosPath, PLAN_VIDEOS_META_RELATIVE_PATH);
18327
18343
  const chunks = readJsonFile(chunksPath, "meta/chunks.json");
18328
18344
  const parsedVideos = parsePlanVideosJson2(videos);
@@ -18376,10 +18392,10 @@ function computeManifestHash(manifest) {
18376
18392
  return sha256Hex(`${PLAN_V2_HASH_PREFIX}${canonicalJsonStringify(manifestPayload(manifest))}`);
18377
18393
  }
18378
18394
  function writeBlob(sourcePath, destinationPath) {
18379
- if (existsSync27(destinationPath)) return;
18395
+ if (existsSync28(destinationPath)) return;
18380
18396
  mkdirSync16(dirname15(destinationPath), { recursive: true });
18381
18397
  const temporaryDir = createStagingDir(dirname15(destinationPath), ".plan-v2-blob-");
18382
- const temporaryPath = join40(temporaryDir, "blob");
18398
+ const temporaryPath = join41(temporaryDir, "blob");
18383
18399
  try {
18384
18400
  copyFileSync6(sourcePath, temporaryPath);
18385
18401
  renameWithRetry(temporaryPath, destinationPath);
@@ -18415,8 +18431,8 @@ async function putTasks(tasks) {
18415
18431
  if (failure) throw failure.reason;
18416
18432
  }
18417
18433
  function buildPlanV2Publication(executionPlanDir, digests) {
18418
- const executionPlanPath = join40(executionPlanDir, "plan.json");
18419
- if (!existsSync27(executionPlanPath)) {
18434
+ const executionPlanPath = join41(executionPlanDir, "plan.json");
18435
+ if (!existsSync28(executionPlanPath)) {
18420
18436
  throw new PlanV2IntegrityError(`execution plan is missing plan.json: ${executionPlanPath}`);
18421
18437
  }
18422
18438
  const executionPlanValue = readJsonFile(executionPlanPath, "execution plan.json");
@@ -18443,7 +18459,7 @@ function buildPlanV2Publication(executionPlanDir, digests) {
18443
18459
  }
18444
18460
  validateExtractionCacheCompleteSentinels(executionPlanDir);
18445
18461
  const videoDependencyPlan = buildVideoChunkDependencies(executionPlanDir, dimensions);
18446
- const encoder = readJsonFile(join40(executionPlanDir, "meta", "encoder.json"), "meta/encoder.json");
18462
+ const encoder = readJsonFile(join41(executionPlanDir, "meta", "encoder.json"), "meta/encoder.json");
18447
18463
  const files = listFiles(executionPlanDir);
18448
18464
  const chunkAudio = !isRecord3(encoder) || encoder.chunksCarryAudio !== true ? "none" : files.some((file) => chunkAudioSliceTarget(file.path) !== null) ? "sliced" : "whole";
18449
18465
  for (const file of files) {
@@ -18496,7 +18512,7 @@ function buildPlanV2Publication(executionPlanDir, digests) {
18496
18512
  };
18497
18513
  }
18498
18514
  function createPlanV2FromExecutionPlan(executionPlanDir, planV2Dir) {
18499
- if (existsSync27(planV2Dir)) {
18515
+ if (existsSync28(planV2Dir)) {
18500
18516
  throw new PlanV2IntegrityError(`output directory already exists: ${planV2Dir}`);
18501
18517
  }
18502
18518
  const publication = buildPlanV2Publication(executionPlanDir);
@@ -18510,7 +18526,7 @@ function createPlanV2FromExecutionPlan(executionPlanDir, planV2Dir) {
18510
18526
  writeBlob(blob.sourcePath, planV2BlobPath(tempDir, blob.sha256));
18511
18527
  }
18512
18528
  writeFileSync11(
18513
- join40(tempDir, "plan.json"),
18529
+ join41(tempDir, "plan.json"),
18514
18530
  canonicalJsonStringify(publication.manifest),
18515
18531
  "utf-8"
18516
18532
  );
@@ -18562,7 +18578,7 @@ async function planV2WithPublisher(projectDir, config, publisher, options = {})
18562
18578
  // artifactTargets ships every compiled/ file to all chunks, so each is in the manifest.
18563
18579
  whileAudioMixes: () => putBlobs(
18564
18580
  publisher,
18565
- listFiles(join40(stagingRoot, "compiled")).map(
18581
+ listFiles(join41(stagingRoot, "compiled")).map(
18566
18582
  (file) => publishBlobFor(file.absolutePath, digests)
18567
18583
  )
18568
18584
  ),
@@ -18582,7 +18598,7 @@ async function planV2WithPublisher(projectDir, config, publisher, options = {})
18582
18598
  }
18583
18599
  }
18584
18600
  async function planV2(projectDir, config, planV2Dir) {
18585
- if (existsSync27(planV2Dir)) {
18601
+ if (existsSync28(planV2Dir)) {
18586
18602
  throw new PlanV2IntegrityError(`output directory already exists: ${planV2Dir}`);
18587
18603
  }
18588
18604
  const publisher = new LocalPlanV2ArtifactPublisher(planV2Dir);
@@ -18599,7 +18615,7 @@ function resultFromManifest(planV2Dir, manifest) {
18599
18615
  isRecord3(executionPlan) ? executionPlan[REFERENCE_BACKGROUND_FIELD] : void 0
18600
18616
  ),
18601
18617
  planDir: planV2Dir,
18602
- manifestPath: join40(planV2Dir, "plan.json"),
18618
+ manifestPath: join41(planV2Dir, "plan.json"),
18603
18619
  planProtocol: PLAN_PROTOCOL_V2,
18604
18620
  planHash: manifest.planHash,
18605
18621
  sourcePlanV1Hash: getPlanV2ExecutionPlanHash(manifest),
@@ -18735,8 +18751,8 @@ function parsePlanV2Manifest(value) {
18735
18751
  return parsed;
18736
18752
  }
18737
18753
  function readPlanV2Manifest(planV2Dir) {
18738
- const manifestPath = join40(planV2Dir, "plan.json");
18739
- if (!existsSync27(manifestPath)) {
18754
+ const manifestPath = join41(planV2Dir, "plan.json");
18755
+ if (!existsSync28(manifestPath)) {
18740
18756
  throw new PlanV2IntegrityError(`missing v2 manifest: ${manifestPath}`);
18741
18757
  }
18742
18758
  const value = readJsonFile(manifestPath, "v2 manifest");
@@ -18755,7 +18771,7 @@ function listPlanV2ArtifactsForTarget(manifest, target) {
18755
18771
  }
18756
18772
  function verifyBlob(planV2Dir, artifact) {
18757
18773
  const sourcePath = planV2BlobPath(planV2Dir, artifact.sha256);
18758
- if (!existsSync27(sourcePath)) {
18774
+ if (!existsSync28(sourcePath)) {
18759
18775
  throw new PlanV2IntegrityError(`missing content-addressed artifact ${artifact.sha256}`);
18760
18776
  }
18761
18777
  const stats = statSync9(sourcePath);
@@ -18768,7 +18784,7 @@ function verifyBlob(planV2Dir, artifact) {
18768
18784
  return sourcePath;
18769
18785
  }
18770
18786
  function materializePlanV2Target(planV2Dir, target, destinationDir, options = {}) {
18771
- if (existsSync27(destinationDir)) {
18787
+ if (existsSync28(destinationDir)) {
18772
18788
  throw new PlanV2IntegrityError(`materialization destination already exists: ${destinationDir}`);
18773
18789
  }
18774
18790
  const manifest = readPlanV2Manifest(planV2Dir);
@@ -18784,13 +18800,13 @@ function materializePlanV2Target(planV2Dir, target, destinationDir, options = {}
18784
18800
  const tempDir = createStagingDir(dirname15(destinationDir), ".plan-v2-materialize-");
18785
18801
  try {
18786
18802
  for (const { artifact, sourcePath } of verified) {
18787
- const destinationPath = join40(tempDir, ...artifact.path.split("/"));
18803
+ const destinationPath = join41(tempDir, ...artifact.path.split("/"));
18788
18804
  mkdirSync16(dirname15(destinationPath), { recursive: true });
18789
18805
  copyFileSync6(sourcePath, destinationPath);
18790
18806
  }
18791
18807
  if (target.role === "chunk") materializeExtractedVideoDirectories(tempDir);
18792
18808
  writeFileSync11(
18793
- join40(tempDir, PLAN_V2_MATERIALIZATION_MARKER),
18809
+ join41(tempDir, PLAN_V2_MATERIALIZATION_MARKER),
18794
18810
  canonicalJsonStringify({
18795
18811
  manifest,
18796
18812
  target,
@@ -18813,7 +18829,7 @@ function materializePlanV2Target(planV2Dir, target, destinationDir, options = {}
18813
18829
  // Join the artifact's OWN name, not the current constant: a plan written
18814
18830
  // before the container change carries the legacy name, and materializing it
18815
18831
  // under the new one would point at a file that was never written.
18816
- audioPath: target.role === "assembler" ? audioArtifact ? join40(destinationDir, audioArtifact.path) : null : null
18832
+ audioPath: target.role === "assembler" ? audioArtifact ? join41(destinationDir, audioArtifact.path) : null : null
18817
18833
  };
18818
18834
  }
18819
18835
  function assertRemoteSources(remoteSources, artifacts) {
@@ -18832,8 +18848,8 @@ function validatePlanV2MaterializedTarget(planDir, expectedTarget) {
18832
18848
  return readValidatedPlanV2Materialization(planDir, expectedTarget)?.manifest ?? null;
18833
18849
  }
18834
18850
  function readValidatedPlanV2Materialization(planDir, expectedTarget) {
18835
- const markerPath = join40(planDir, PLAN_V2_MATERIALIZATION_MARKER);
18836
- if (!existsSync27(markerPath)) return null;
18851
+ const markerPath = join41(planDir, PLAN_V2_MATERIALIZATION_MARKER);
18852
+ if (!existsSync28(markerPath)) return null;
18837
18853
  const marker = readJsonFile(markerPath, "materialization marker");
18838
18854
  if (!isRecord3(marker) || !isRecord3(marker.manifest) || !isRecord3(marker.target)) {
18839
18855
  throw new PlanV2IntegrityError("malformed materialization marker");
@@ -18850,8 +18866,8 @@ function readValidatedPlanV2Materialization(planDir, expectedTarget) {
18850
18866
  assertRemoteSources(remoteSources, required);
18851
18867
  for (const artifact of required) {
18852
18868
  if (Object.hasOwn(remoteSources, artifact.path)) continue;
18853
- const path = join40(planDir, ...artifact.path.split("/"));
18854
- if (!existsSync27(path) || statSync9(path).size !== artifact.sizeBytes) {
18869
+ const path = join41(planDir, ...artifact.path.split("/"));
18870
+ if (!existsSync28(path) || statSync9(path).size !== artifact.sizeBytes) {
18855
18871
  throw new PlanV2IntegrityError(
18856
18872
  `materialized artifact missing or truncated: ${artifact.path}`
18857
18873
  );
@@ -18978,10 +18994,10 @@ async function beginFrameSessionNeedsScreenshotFallback(session, probe = probeBe
18978
18994
  return !await probe(session.page, timeoutMs, probeTick, session.beginFrameIntervalMs);
18979
18995
  }
18980
18996
  function hashChunkOutput(outputPath, kind) {
18981
- if (kind === "file") return sha256Hex(readFileSync11(outputPath));
18997
+ if (kind === "file") return sha256Hex(readFileSync12(outputPath));
18982
18998
  const entries = readdirSync11(outputPath).filter((name) => /\.(png|jpg|jpeg)$/i.test(name)).sort();
18983
18999
  const lines = entries.map(
18984
- (name) => `${name}\0${sha256Hex(readFileSync11(join41(outputPath, name)))}`
19000
+ (name) => `${name}\0${sha256Hex(readFileSync12(join42(outputPath, name)))}`
18985
19001
  );
18986
19002
  return sha256Hex(lines.join("\0"));
18987
19003
  }
@@ -18998,16 +19014,16 @@ function resolveLockedVp9CpuUsed(lockedEncoder) {
18998
19014
  async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
18999
19015
  const start = Date.now();
19000
19016
  const log = defaultLogger;
19001
- const planJsonPath = join41(planDir, "plan.json");
19002
- const encoderJsonPath = join41(planDir, "meta", "encoder.json");
19003
- const chunksJsonPath = join41(planDir, "meta", "chunks.json");
19004
- if (!existsSync28(planJsonPath)) {
19017
+ const planJsonPath = join42(planDir, "plan.json");
19018
+ const encoderJsonPath = join42(planDir, "meta", "encoder.json");
19019
+ const chunksJsonPath = join42(planDir, "meta", "chunks.json");
19020
+ if (!existsSync29(planJsonPath)) {
19005
19021
  throw new RenderChunkValidationError(
19006
19022
  MISSING_PLAN_ARTIFACT,
19007
19023
  `[renderChunk] planDir is missing required artifact: ${planJsonPath}`
19008
19024
  );
19009
19025
  }
19010
- const plan2 = JSON.parse(readFileSync11(planJsonPath, "utf-8"));
19026
+ const plan2 = JSON.parse(readFileSync12(planJsonPath, "utf-8"));
19011
19027
  readPlanProtocolV1(plan2, DISTRIBUTED_RENDER_CAPABILITIES.roles.chunk);
19012
19028
  const planHashStarted = Date.now();
19013
19029
  const v2Materialization = readValidatedPlanV2Materialization(planDir, {
@@ -19017,20 +19033,20 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
19017
19033
  const v2Manifest = v2Materialization?.manifest ?? null;
19018
19034
  const remoteSources = v2Materialization?.remoteSources ?? {};
19019
19035
  for (const required of [encoderJsonPath, chunksJsonPath]) {
19020
- if (!existsSync28(required)) {
19036
+ if (!existsSync29(required)) {
19021
19037
  throw new RenderChunkValidationError(
19022
19038
  MISSING_PLAN_ARTIFACT,
19023
19039
  `[renderChunk] planDir is missing required artifact: ${required}`
19024
19040
  );
19025
19041
  }
19026
19042
  }
19027
- const encoder = JSON.parse(readFileSync11(encoderJsonPath, "utf-8"));
19028
- const chunks = JSON.parse(readFileSync11(chunksJsonPath, "utf-8"));
19029
- const videosJsonPath = join41(planDir, PLAN_VIDEOS_META_RELATIVE_PATH);
19043
+ const encoder = JSON.parse(readFileSync12(encoderJsonPath, "utf-8"));
19044
+ const chunks = JSON.parse(readFileSync12(chunksJsonPath, "utf-8"));
19045
+ const videosJsonPath = join42(planDir, PLAN_VIDEOS_META_RELATIVE_PATH);
19030
19046
  let planVideos = null;
19031
- if (existsSync28(videosJsonPath)) {
19047
+ if (existsSync29(videosJsonPath)) {
19032
19048
  try {
19033
- planVideos = validatePlanVideosForChunk(JSON.parse(readFileSync11(videosJsonPath, "utf-8")));
19049
+ planVideos = validatePlanVideosForChunk(JSON.parse(readFileSync12(videosJsonPath, "utf-8")));
19034
19050
  } catch (err) {
19035
19051
  if (err instanceof RenderChunkValidationError) throw err;
19036
19052
  throw new RenderChunkValidationError(
@@ -19058,8 +19074,8 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
19058
19074
  }
19059
19075
  const range = resolveChunkFrameRange(slice, chunkIndex, options?.frameRange);
19060
19076
  const framesInChunk = range.endFrame - range.startFrame;
19061
- const compiledDir = join41(planDir, "compiled");
19062
- if (!existsSync28(compiledDir)) {
19077
+ const compiledDir = join42(planDir, "compiled");
19078
+ if (!existsSync29(compiledDir)) {
19063
19079
  throw new RenderChunkValidationError(
19064
19080
  MISSING_PLAN_ARTIFACT,
19065
19081
  `[renderChunk] planDir missing compiled/ directory: ${compiledDir}`
@@ -19117,7 +19133,7 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
19117
19133
  };
19118
19134
  const workDir = `${outputChunkPath}.work.${process.pid}.${randomBytes(4).toString("hex")}`;
19119
19135
  mkdirSync17(workDir, { recursive: true });
19120
- const framesDir = join41(workDir, "captured-frames");
19136
+ const framesDir = join42(workDir, "captured-frames");
19121
19137
  mkdirSync17(framesDir, { recursive: true });
19122
19138
  const videoFramesDir = `${workDir}.video-frames`;
19123
19139
  const chunkFrameNumbers = Array.from({ length: framesInChunk }, (_, i) => range.startFrame + i);
@@ -19142,7 +19158,7 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
19142
19158
  dimensions: plan2.dimensions,
19143
19159
  encoder,
19144
19160
  videoCount: planVideos?.videos.length ?? 0,
19145
- html: readFileSync11(join41(compiledDir, "index.html"), "utf-8"),
19161
+ html: readFileSync12(join42(compiledDir, "index.html"), "utf-8"),
19146
19162
  // The plan ships a deferred source only to chunks that show it; don't wait on the rest.
19147
19163
  skipReadinessVideoIds: deferredVideos.filter(
19148
19164
  (video) => !shownFrames.get(video.videoId)?.size || remoteVideoIds.has(video.videoId)
@@ -19310,10 +19326,10 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
19310
19326
  const effectiveBitrate = encoder.crf != null ? void 0 : encoder.bitrate;
19311
19327
  const videoOnlyPath = encoder.chunksCarryAudio ? `${outputChunkPath}.video.mp4` : outputChunkPath;
19312
19328
  if (isPngSequence) {
19313
- if (!existsSync28(outputChunkPath)) mkdirSync17(outputChunkPath, { recursive: true });
19329
+ if (!existsSync29(outputChunkPath)) mkdirSync17(outputChunkPath, { recursive: true });
19314
19330
  } else {
19315
- const outDir = join41(outputChunkPath, "..");
19316
- if (!existsSync28(outDir)) mkdirSync17(outDir, { recursive: true });
19331
+ const outDir = join42(outputChunkPath, "..");
19332
+ if (!existsSync29(outDir)) mkdirSync17(outDir, { recursive: true });
19317
19333
  }
19318
19334
  const encodeInput = {
19319
19335
  job,
@@ -19586,10 +19602,10 @@ async function renderSpan(projectDir, config, span, outputPath) {
19586
19602
  if (config.cfr === true) {
19587
19603
  throw new RenderSpanUnsupportedError("--start/--end cannot be combined with a cfr re-encode.");
19588
19604
  }
19589
- const workDir = mkdtempSync(join42(tmpdir4(), "hf-render-span-"));
19605
+ const workDir = mkdtempSync(join43(tmpdir4(), "hf-render-span-"));
19590
19606
  try {
19591
- const planDir = join42(workDir, "plan");
19592
- const partsDir = join42(workDir, "parts");
19607
+ const planDir = join43(workDir, "plan");
19608
+ const partsDir = join43(workDir, "parts");
19593
19609
  mkdirSync18(partsDir, { recursive: true });
19594
19610
  const planned = await plan(
19595
19611
  projectDir,
@@ -19604,7 +19620,7 @@ async function renderSpan(projectDir, config, span, outputPath) {
19604
19620
  planned.totalFrames
19605
19621
  );
19606
19622
  const slices = JSON.parse(
19607
- readFileSync12(join42(planDir, "meta", "chunks.json"), "utf-8")
19623
+ readFileSync13(join43(planDir, "meta", "chunks.json"), "utf-8")
19608
19624
  );
19609
19625
  const parts = [];
19610
19626
  for (const slice of slices) {
@@ -19614,7 +19630,7 @@ async function renderSpan(projectDir, config, span, outputPath) {
19614
19630
  };
19615
19631
  if (range.endFrame <= range.startFrame) continue;
19616
19632
  throwIfAborted(config.abortSignal);
19617
- const part = join42(partsDir, `part-${String(parts.length).padStart(4, "0")}.mp4`);
19633
+ const part = join43(partsDir, `part-${String(parts.length).padStart(4, "0")}.mp4`);
19618
19634
  await renderChunk(planDir, slice.index, part, { frameRange: range });
19619
19635
  parts.push(part);
19620
19636
  }
@@ -20190,7 +20206,7 @@ function renderRequestFromDistributedConfig(input) {
20190
20206
 
20191
20207
  // ../producer/src/server.ts
20192
20208
  import {
20193
- existsSync as existsSync31,
20209
+ existsSync as existsSync32,
20194
20210
  mkdirSync as mkdirSync19,
20195
20211
  statSync as statSync11,
20196
20212
  mkdtempSync as mkdtempSync2,
@@ -20198,7 +20214,7 @@ import {
20198
20214
  rmSync as rmSync17,
20199
20215
  createReadStream as createReadStream5
20200
20216
  } from "fs";
20201
- import { resolve as resolve10, dirname as dirname17, join as join45 } from "path";
20217
+ import { resolve as resolve10, dirname as dirname17, join as join46 } from "path";
20202
20218
  import { tmpdir as tmpdir5 } from "os";
20203
20219
  import { parseArgs } from "util";
20204
20220
  import crypto from "crypto";
@@ -20208,15 +20224,15 @@ import { serve as serve2 } from "@hono/node-server";
20208
20224
 
20209
20225
  // ../producer/src/services/hyperframeLint.ts
20210
20226
  import {
20211
- existsSync as existsSync29,
20212
- readFileSync as readFileSync13,
20227
+ existsSync as existsSync30,
20228
+ readFileSync as readFileSync14,
20213
20229
  statSync as statSync10,
20214
20230
  openSync as openSync6,
20215
20231
  fstatSync as fstatSync3,
20216
20232
  closeSync as closeSync6,
20217
20233
  constants as constants3
20218
20234
  } from "fs";
20219
- import { resolve as resolve9, join as join43, relative as relative7, isAbsolute as isAbsolute4, sep as sep5 } from "path";
20235
+ import { resolve as resolve9, join as join44, relative as relative7, isAbsolute as isAbsolute4, sep as sep5 } from "path";
20220
20236
  function isStringRecord(value) {
20221
20237
  if (!value || typeof value !== "object" || Array.isArray(value)) {
20222
20238
  return false;
@@ -20254,14 +20270,14 @@ function readEntryHtml(filePath) {
20254
20270
  }
20255
20271
  try {
20256
20272
  if (!fstatSync3(fd).isFile()) return null;
20257
- return readFileSync13(fd, "utf-8");
20273
+ return readFileSync14(fd, "utf-8");
20258
20274
  } finally {
20259
20275
  closeSync6(fd);
20260
20276
  }
20261
20277
  }
20262
20278
  function readProjectEntryFile(projectDir, preferredEntryFile) {
20263
20279
  const absProjectDir = resolve9(projectDir);
20264
- if (!existsSync29(absProjectDir) || !statSync10(absProjectDir).isDirectory()) {
20280
+ if (!existsSync30(absProjectDir) || !statSync10(absProjectDir).isDirectory()) {
20265
20281
  return { error: `Project directory not found: ${absProjectDir}` };
20266
20282
  }
20267
20283
  const entryCandidates = [preferredEntryFile, "index.html", "src/index.html"].filter(
@@ -20283,7 +20299,7 @@ function readProjectEntryFile(projectDir, preferredEntryFile) {
20283
20299
  }
20284
20300
  }
20285
20301
  return {
20286
- error: `No HTML entry file found in project directory: ${join43(absProjectDir, preferredEntryFile || "index.html")}`
20302
+ error: `No HTML entry file found in project directory: ${join44(absProjectDir, preferredEntryFile || "index.html")}`
20287
20303
  };
20288
20304
  }
20289
20305
  function prepareHyperframeLintBody(body) {
@@ -20329,8 +20345,8 @@ async function runHyperframeLint(prepared) {
20329
20345
  // ../producer/src/services/healthWorker.ts
20330
20346
  import { Worker as Worker2 } from "worker_threads";
20331
20347
  import { fileURLToPath as fileURLToPath6 } from "url";
20332
- import { dirname as dirname16, join as join44 } from "path";
20333
- import { existsSync as existsSync30 } from "fs";
20348
+ import { dirname as dirname16, join as join45 } from "path";
20349
+ import { existsSync as existsSync31 } from "fs";
20334
20350
  var DEFAULT_HEALTH_PORT = 9848;
20335
20351
  async function startHealthWorker(options = {}) {
20336
20352
  const log = options.logger ?? defaultLogger2();
@@ -20405,9 +20421,9 @@ function defaultLogger2() {
20405
20421
  }
20406
20422
  function resolveWorkerEntry2() {
20407
20423
  const here = dirname16(fileURLToPath6(import.meta.url));
20408
- const candidates = [join44(here, "healthWorkerThread.js"), join44(here, "healthWorkerThread.ts")];
20424
+ const candidates = [join45(here, "healthWorkerThread.js"), join45(here, "healthWorkerThread.ts")];
20409
20425
  for (const candidate of candidates) {
20410
- if (existsSync30(candidate)) return candidate;
20426
+ if (existsSync31(candidate)) return candidate;
20411
20427
  }
20412
20428
  return void 0;
20413
20429
  }
@@ -20547,7 +20563,7 @@ function resolvePreparedRenderOutput(prepared, rendersDir, log) {
20547
20563
  const { input, cleanupProjectDir } = prepared;
20548
20564
  const absoluteOutputPath = resolveOutputPath(input.projectDir, input.outputPath, rendersDir, log);
20549
20565
  const outputDir = dirname17(absoluteOutputPath);
20550
- if (!existsSync31(outputDir)) mkdirSync19(outputDir, { recursive: true });
20566
+ if (!existsSync32(outputDir)) mkdirSync19(outputDir, { recursive: true });
20551
20567
  return { input, cleanupProjectDir, absoluteOutputPath };
20552
20568
  }
20553
20569
  function validateRenderOverrides(body) {
@@ -20588,11 +20604,11 @@ function prepareProjectDirectory(projectDir, options) {
20588
20604
  const candidate = nonEmptyString(projectDir);
20589
20605
  if (!candidate) return null;
20590
20606
  const absProjectDir = resolve10(candidate);
20591
- if (!existsSync31(absProjectDir) || !statSync11(absProjectDir).isDirectory()) {
20607
+ if (!existsSync32(absProjectDir) || !statSync11(absProjectDir).isDirectory()) {
20592
20608
  return { error: `Project directory not found: ${absProjectDir}` };
20593
20609
  }
20594
20610
  const entry = options.entryFile || "index.html";
20595
- if (!existsSync31(resolve10(absProjectDir, entry))) {
20611
+ if (!existsSync32(resolve10(absProjectDir, entry))) {
20596
20612
  return { error: `Entry file "${entry}" not found in project directory: ${absProjectDir}` };
20597
20613
  }
20598
20614
  return { prepared: { input: { projectDir: absProjectDir, ...options } } };
@@ -20613,8 +20629,8 @@ async function resolveInlineRenderHtml(body) {
20613
20629
  }
20614
20630
  function materializeInlineProject(html, options) {
20615
20631
  const tempRoot = process.env.PRODUCER_TMP_PROJECT_DIR || tmpdir5();
20616
- const tempProjectDir = mkdtempSync2(join45(tempRoot, "producer-project-"));
20617
- writeFileSync13(join45(tempProjectDir, "index.html"), html, "utf-8");
20632
+ const tempProjectDir = mkdtempSync2(join46(tempRoot, "producer-project-"));
20633
+ writeFileSync13(join46(tempProjectDir, "index.html"), html, "utf-8");
20618
20634
  return {
20619
20635
  prepared: {
20620
20636
  input: { projectDir: tempProjectDir, ...options },
@@ -20684,7 +20700,7 @@ function cleanupTempDir(dir, log) {
20684
20700
  }
20685
20701
  }
20686
20702
  function outputFileSize(path) {
20687
- return existsSync31(path) ? statSync11(path).size : 0;
20703
+ return existsSync32(path) ? statSync11(path).size : 0;
20688
20704
  }
20689
20705
  function createBlockingProgressReporter(log, requestId) {
20690
20706
  let lastLoggedPct = -10;
@@ -20988,7 +21004,7 @@ function createRenderHandlers(options = {}) {
20988
21004
  if (!artifact) {
20989
21005
  return c.json({ success: false, error: "Output artifact not found or expired" }, 404);
20990
21006
  }
20991
- if (!existsSync31(artifact.path)) {
21007
+ if (!existsSync32(artifact.path)) {
20992
21008
  store.delete(token);
20993
21009
  return c.json({ success: false, error: "Output artifact file missing" }, 404);
20994
21010
  }
@@ -21035,7 +21051,7 @@ function startServer(options = {}) {
21035
21051
  });
21036
21052
  async function shutdown(signal) {
21037
21053
  log.info(`Received ${signal}, shutting down`);
21038
- const { drainBrowserPool } = await import("./src-NIMSUB4P.js");
21054
+ const { drainBrowserPool } = await import("./src-C43KUEBY.js");
21039
21055
  await drainBrowserPool().catch(() => {
21040
21056
  });
21041
21057
  const handle = await Promise.race([
@@ -21073,20 +21089,20 @@ if (isPublicServerEntry) {
21073
21089
  // ../producer/src/services/distributed/planV2Execution.ts
21074
21090
  import { mkdtempSync as mkdtempSync3, rmSync as rmSync19 } from "fs";
21075
21091
  import { tmpdir as tmpdir6 } from "os";
21076
- import { join as join47 } from "path";
21092
+ import { join as join48 } from "path";
21077
21093
 
21078
21094
  // ../producer/src/services/distributed/assemble.ts
21079
21095
  import {
21080
21096
  cpSync as cpSync3,
21081
- existsSync as existsSync32,
21097
+ existsSync as existsSync33,
21082
21098
  mkdirSync as mkdirSync20,
21083
- readFileSync as readFileSync14,
21099
+ readFileSync as readFileSync15,
21084
21100
  readdirSync as readdirSync12,
21085
21101
  rmSync as rmSync18,
21086
21102
  statSync as statSync12,
21087
21103
  writeFileSync as writeFileSync14
21088
21104
  } from "fs";
21089
- import { basename as basename8, dirname as dirname18, join as join46 } from "path";
21105
+ import { basename as basename8, dirname as dirname18, join as join47 } from "path";
21090
21106
  function cfrRateControlArgs(locked) {
21091
21107
  const preset = getEncoderPreset(locked.quality ?? "standard", "mp4");
21092
21108
  if (locked.crf == null && locked.bitrate) {
@@ -21119,7 +21135,7 @@ async function assemble(planDir, chunkOutputs, audioPath, outputPath, options) {
21119
21135
  }
21120
21136
  const format = plan2.dimensions.format;
21121
21137
  const cfrEncoder = cfr ? readCfrEncoder(planDir, format) : null;
21122
- if (!existsSync32(dirname18(outputPath))) {
21138
+ if (!existsSync33(dirname18(outputPath))) {
21123
21139
  mkdirSync20(dirname18(outputPath), { recursive: true });
21124
21140
  }
21125
21141
  const workDir = createStagingDir(dirname18(outputPath), `${basename8(outputPath)}.assemble-work-`);
@@ -21142,8 +21158,8 @@ async function assemble(planDir, chunkOutputs, audioPath, outputPath, options) {
21142
21158
  };
21143
21159
  try {
21144
21160
  const videoSources = cfrEncoder ? [await reencodeCfr(ctx, chunkPaths, cfrEncoder)] : chunkPaths;
21145
- const finalPath = join46(workDir, `output.${format}`);
21146
- const audio = audioPath !== null && existsSync32(audioPath) ? audioPath : null;
21161
+ const finalPath = join47(workDir, `output.${format}`);
21162
+ const audio = audioPath !== null && existsSync33(audioPath) ? audioPath : null;
21147
21163
  await writeJoined(ctx, videoSources, audio, finalPath);
21148
21164
  renameWithRetry(finalPath, outputPath);
21149
21165
  log.info("[assemble] stage timings", {
@@ -21161,7 +21177,7 @@ async function assemble(planDir, chunkOutputs, audioPath, outputPath, options) {
21161
21177
  });
21162
21178
  }
21163
21179
  }
21164
- const fileSize = existsSync32(outputPath) ? statSync12(outputPath).size : 0;
21180
+ const fileSize = existsSync33(outputPath) ? statSync12(outputPath).size : 0;
21165
21181
  return {
21166
21182
  ...referenceBackgroundResult(plan2[REFERENCE_BACKGROUND_FIELD]),
21167
21183
  outputPath,
@@ -21171,18 +21187,18 @@ async function assemble(planDir, chunkOutputs, audioPath, outputPath, options) {
21171
21187
  };
21172
21188
  }
21173
21189
  function readAssemblePlan(planDir, chunkPaths) {
21174
- const planJsonPath = join46(planDir, "plan.json");
21175
- const chunksJsonPath = join46(planDir, "meta", "chunks.json");
21176
- if (!existsSync32(planJsonPath)) {
21190
+ const planJsonPath = join47(planDir, "plan.json");
21191
+ const chunksJsonPath = join47(planDir, "meta", "chunks.json");
21192
+ if (!existsSync33(planJsonPath)) {
21177
21193
  throw new Error(`[assemble] planDir missing plan.json: ${planJsonPath}`);
21178
21194
  }
21179
- const plan2 = JSON.parse(readFileSync14(planJsonPath, "utf-8"));
21195
+ const plan2 = JSON.parse(readFileSync15(planJsonPath, "utf-8"));
21180
21196
  readPlanProtocolV1(plan2, DISTRIBUTED_RENDER_CAPABILITIES.roles.assembler);
21181
21197
  validatePlanV2MaterializedTarget(planDir, { role: "assembler" });
21182
- if (!existsSync32(chunksJsonPath)) {
21198
+ if (!existsSync33(chunksJsonPath)) {
21183
21199
  throw new Error(`[assemble] planDir missing meta/chunks.json: ${chunksJsonPath}`);
21184
21200
  }
21185
- const chunks = JSON.parse(readFileSync14(chunksJsonPath, "utf-8"));
21201
+ const chunks = JSON.parse(readFileSync15(chunksJsonPath, "utf-8"));
21186
21202
  if (chunkPaths.length !== chunks.length) {
21187
21203
  throw new Error(
21188
21204
  `[assemble] chunkPaths length (${chunkPaths.length}) does not match chunks.json length (${chunks.length}). Adapters must pass one path per chunk, ordered by index.`
@@ -21194,7 +21210,7 @@ function readAssemblePlan(planDir, chunkPaths) {
21194
21210
  }
21195
21211
  }
21196
21212
  for (const path of chunkPaths.flat()) {
21197
- if (!existsSync32(path)) {
21213
+ if (!existsSync33(path)) {
21198
21214
  throw new Error(`[assemble] chunk path does not exist: ${path}`);
21199
21215
  }
21200
21216
  }
@@ -21223,7 +21239,7 @@ function cfrEncodeArgs(inputArgs, encoder, fpsArg) {
21223
21239
  return args;
21224
21240
  }
21225
21241
  async function reencodeCfr(ctx, chunkPaths, encoder) {
21226
- const cfrOutputPath = join46(ctx.workDir, `cfr.${ctx.format}`);
21242
+ const cfrOutputPath = join47(ctx.workDir, `cfr.${ctx.format}`);
21227
21243
  const cfrArgs = cfrEncodeArgs(videoInputArgs(ctx, chunkPaths), encoder, ctx.fpsArg);
21228
21244
  appendRenderProvenanceArgs(cfrArgs, cfrOutputPath);
21229
21245
  cfrArgs.push("-y", cfrOutputPath);
@@ -21250,7 +21266,7 @@ async function writeJoined(ctx, videoSources, audioPath, finalPath) {
21250
21266
  );
21251
21267
  return;
21252
21268
  }
21253
- const paddedAudioPath = join46(ctx.workDir, "audio-padded.m4a");
21269
+ const paddedAudioPath = join47(ctx.workDir, "audio-padded.m4a");
21254
21270
  const padTrimResult = await ctx.timed(
21255
21271
  "audioMs",
21256
21272
  () => padOrTrimAudioToVideoFrameCount({
@@ -21290,7 +21306,7 @@ async function writeJoined(ctx, videoSources, audioPath, finalPath) {
21290
21306
  }
21291
21307
  }
21292
21308
  function concatDemuxerInput(chunkPaths, workDir, fpsArg) {
21293
- const listPath = join46(workDir, "concat-list.txt");
21309
+ const listPath = join47(workDir, "concat-list.txt");
21294
21310
  const body = chunkPaths.map((path) => `file '${path.replace(/'/g, "'\\''")}'`).join("\n");
21295
21311
  writeFileSync14(listPath, `${body}
21296
21312
  `, "utf-8");
@@ -21328,13 +21344,13 @@ function stitchesSeparateAudio(planDir) {
21328
21344
  return lockedAudio(planDir).separateAudio === true;
21329
21345
  }
21330
21346
  function planFormat(planDir) {
21331
- const plan2 = JSON.parse(readFileSync14(join46(planDir, "plan.json"), "utf-8"));
21347
+ const plan2 = JSON.parse(readFileSync15(join47(planDir, "plan.json"), "utf-8"));
21332
21348
  return plan2.dimensions.format;
21333
21349
  }
21334
21350
  function lockedAudio(planDir) {
21335
- const encoderJsonPath = join46(planDir, "meta", "encoder.json");
21336
- if (!existsSync32(encoderJsonPath)) return {};
21337
- return JSON.parse(readFileSync14(encoderJsonPath, "utf-8"));
21351
+ const encoderJsonPath = join47(planDir, "meta", "encoder.json");
21352
+ if (!existsSync33(encoderJsonPath)) return {};
21353
+ return JSON.parse(readFileSync15(encoderJsonPath, "utf-8"));
21338
21354
  }
21339
21355
  function readCfrEncoder(planDir, format) {
21340
21356
  if (format !== "mp4") {
@@ -21342,11 +21358,11 @@ function readCfrEncoder(planDir, format) {
21342
21358
  `[assemble] cfr=true is only supported for format="mp4" (got "${format}"). Stream-copy paths for webm and mov already produce exact avg_frame_rate; cfr re-encode is not needed.`
21343
21359
  );
21344
21360
  }
21345
- const encoderJsonPath = join46(planDir, "meta", "encoder.json");
21346
- if (!existsSync32(encoderJsonPath)) {
21361
+ const encoderJsonPath = join47(planDir, "meta", "encoder.json");
21362
+ if (!existsSync33(encoderJsonPath)) {
21347
21363
  throw new Error(`[assemble] planDir missing meta/encoder.json: ${encoderJsonPath}`);
21348
21364
  }
21349
- const encoderJson = JSON.parse(readFileSync14(encoderJsonPath, "utf-8"));
21365
+ const encoderJson = JSON.parse(readFileSync15(encoderJsonPath, "utf-8"));
21350
21366
  if (encoderJson.encoder === "libx265-software") {
21351
21367
  throw new Error(
21352
21368
  `[assemble] cfr=true is not yet supported with codec: "h265". The cfr re-encode pass uses libx264 and would silently transcode the h265 chunks. Either disable cfr or render with codec: "h264".`
@@ -21355,7 +21371,7 @@ function readCfrEncoder(planDir, format) {
21355
21371
  return encoderJson;
21356
21372
  }
21357
21373
  function mergePngFrameDirs(chunkPaths, outputPath, totalFrames, audioPath, startTimeMs) {
21358
- if (existsSync32(outputPath)) rmSync18(outputPath, { recursive: true, force: true });
21374
+ if (existsSync33(outputPath)) rmSync18(outputPath, { recursive: true, force: true });
21359
21375
  mkdirSync20(outputPath, { recursive: true });
21360
21376
  let globalIdx = 0;
21361
21377
  for (const chunkDir of chunkPaths) {
@@ -21369,8 +21385,8 @@ function mergePngFrameDirs(chunkPaths, outputPath, totalFrames, audioPath, start
21369
21385
  throw new Error(`[assemble] png-sequence chunk has no frames: ${chunkDir}`);
21370
21386
  }
21371
21387
  for (const frame of frames) {
21372
- const dst = join46(outputPath, formatExportFrameName(globalIdx, "png"));
21373
- cpSync3(join46(chunkDir, frame), dst);
21388
+ const dst = join47(outputPath, formatExportFrameName(globalIdx, "png"));
21389
+ cpSync3(join47(chunkDir, frame), dst);
21374
21390
  globalIdx += 1;
21375
21391
  }
21376
21392
  }
@@ -21379,14 +21395,14 @@ function mergePngFrameDirs(chunkPaths, outputPath, totalFrames, audioPath, start
21379
21395
  `[assemble] png-sequence frame count mismatch: merged ${globalIdx} frames vs plan.totalFrames=${totalFrames}. Using on-disk count.`
21380
21396
  );
21381
21397
  }
21382
- if (audioPath !== null && existsSync32(audioPath)) {
21383
- const sidecar = join46(outputPath, MIXED_AUDIO_FILENAME);
21398
+ if (audioPath !== null && existsSync33(audioPath)) {
21399
+ const sidecar = join47(outputPath, MIXED_AUDIO_FILENAME);
21384
21400
  cpSync3(audioPath, sidecar);
21385
21401
  }
21386
21402
  let fileSize = 0;
21387
21403
  for (const name of readdirSync12(outputPath)) {
21388
21404
  try {
21389
- fileSize += statSync12(join46(outputPath, name)).size;
21405
+ fileSize += statSync12(join47(outputPath, name)).size;
21390
21406
  } catch {
21391
21407
  }
21392
21408
  }
@@ -21400,8 +21416,8 @@ function mergePngFrameDirs(chunkPaths, outputPath, totalFrames, audioPath, start
21400
21416
 
21401
21417
  // ../producer/src/services/distributed/planV2Execution.ts
21402
21418
  async function renderChunkV2(planV2Dir, chunkIndex, outputChunkPath, options) {
21403
- const workRoot = mkdtempSync3(join47(tmpdir6(), "hf-plan-v2-chunk-"));
21404
- const materializedPlanDir = join47(workRoot, "plan");
21419
+ const workRoot = mkdtempSync3(join48(tmpdir6(), "hf-plan-v2-chunk-"));
21420
+ const materializedPlanDir = join48(workRoot, "plan");
21405
21421
  try {
21406
21422
  materializePlanV2Target(planV2Dir, { role: "chunk", chunkIndex }, materializedPlanDir);
21407
21423
  return await renderChunk(materializedPlanDir, chunkIndex, outputChunkPath, options);
@@ -21410,8 +21426,8 @@ async function renderChunkV2(planV2Dir, chunkIndex, outputChunkPath, options) {
21410
21426
  }
21411
21427
  }
21412
21428
  async function assembleV2(planV2Dir, chunkPaths, outputPath, options) {
21413
- const workRoot = mkdtempSync3(join47(tmpdir6(), "hf-plan-v2-assembler-"));
21414
- const materializedPlanDir = join47(workRoot, "plan");
21429
+ const workRoot = mkdtempSync3(join48(tmpdir6(), "hf-plan-v2-assembler-"));
21430
+ const materializedPlanDir = join48(workRoot, "plan");
21415
21431
  try {
21416
21432
  const materialized = materializePlanV2Target(
21417
21433
  planV2Dir,
@@ -21433,7 +21449,7 @@ async function assembleV2(planV2Dir, chunkPaths, outputPath, options) {
21433
21449
  // ../producer/src/services/distributed/projectHash.ts
21434
21450
  import { closeSync as closeSync7, openSync as openSync7, readdirSync as readdirSync13, readSync as readSync5, realpathSync as realpathSync2, statSync as statSync13 } from "fs";
21435
21451
  import { createHash as createHash8 } from "crypto";
21436
- import { join as join48 } from "path";
21452
+ import { join as join49 } from "path";
21437
21453
  var READ_CHUNK_BYTES = 256 * 1024;
21438
21454
 
21439
21455
  // ../producer/src/services/distributed/audioSidecar.ts