hyperframes 0.9.67 → 0.9.69

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 (290) hide show
  1. package/dist/{add-2FYFE3ZX.js → add-OQ4ZXNC7.js} +14 -14
  2. package/dist/{agentPromptGenerator-5YFPYST7.js → agentPromptGenerator-GUD24KW2.js} +9 -9
  3. package/dist/{animatedGifPrep-SIL3ADIS.js → animatedGifPrep-BKKYEUKH.js} +9 -9
  4. package/dist/api.js +39 -39
  5. package/dist/{asset-D5BXLEK4.js → asset-2P4LAYTV.js} +4 -4
  6. package/dist/{assetCataloger-7UREFLWJ.js → assetCataloger-KI45LYJP.js} +10 -10
  7. package/dist/{audio-NGQW5Z7O.js → audio-MKXMEX7T.js} +24 -24
  8. package/dist/{auth-L2MGMG62.js → auth-LPCMSL7H.js} +4 -4
  9. package/dist/{autoUpdate-FKWV43U5.js → autoUpdate-SI5HXYS2.js} +4 -4
  10. package/dist/{avatars-SM7BUIVL.js → avatars-KQV6VM6N.js} +18 -18
  11. package/dist/{backgroundChecks-XGOO6ETM.js → backgroundChecks-AUVPQSZ3.js} +5 -5
  12. package/dist/backgroundChecksWorker.js +5 -5
  13. package/dist/{batchRender-LK46EDAZ.js → batchRender-7KFJQNBY.js} +6 -5
  14. package/dist/{beats-FPJEEBO2.js → beats-JHEEJ2G6.js} +12 -12
  15. package/dist/{benchmark-BMM3E56O.js → benchmark-GLT62VBC.js} +14 -14
  16. package/dist/{billing-S37OJE6G.js → billing-D63PXBEG.js} +23 -19
  17. package/dist/{browser-ACTTU67A.js → browser-L4XVUSJX.js} +9 -9
  18. package/dist/{bundleWithLocalizedFonts-H2UJUDSF.js → bundleWithLocalizedFonts-XEGC45Y4.js} +1 -1
  19. package/dist/{capture-N24KHG3V.js → capture-3NE7JKCY.js} +55 -30
  20. package/dist/{capture-V4ATIGRR.js → capture-PFEPJ5CQ.js} +6 -6
  21. package/dist/{captureCompositionFrame-Y2GGNU43.js → captureCompositionFrame-Q6YPUL24.js} +16 -16
  22. package/dist/{captureProxy-4K3J652A.js → captureProxy-ZKHJ6HRI.js} +1 -1
  23. package/dist/{catalog-4FAP2CFF.js → catalog-MUFHKZWR.js} +14 -14
  24. package/dist/{catch-up-6RCTMCTI.js → catch-up-U6OBJCO7.js} +9 -9
  25. package/dist/{check-P6XW2CX7.js → check-RDN4RKVS.js} +47 -47
  26. package/dist/{checkAudio-R7ZSNHPD.js → checkAudio-SFPBOZBY.js} +13 -13
  27. package/dist/{checkBrowser-ZTEBVQMM.js → checkBrowser-FAWJXPTX.js} +40 -39
  28. package/dist/{chunk-EYFZRI6U.js → chunk-24FLLQSF.js} +1 -1
  29. package/dist/{chunk-3RUFJGIT.js → chunk-2IWNTFTH.js} +2 -2
  30. package/dist/{chunk-PJQVJSMG.js → chunk-33JUCUTM.js} +7 -2
  31. package/dist/{chunk-77SURLKL.js → chunk-3HDWAGMI.js} +3 -3
  32. package/dist/{chunk-SIVDQSNV.js → chunk-3JXFI7JB.js} +26 -23
  33. package/dist/{chunk-5U4QTHAS.js → chunk-3RN4ZGGL.js} +2 -2
  34. package/dist/{chunk-3XS35R5E.js → chunk-3TSD7EQ2.js} +14 -14
  35. package/dist/{chunk-AH4QO6YC.js → chunk-42PB3OZT.js} +1 -1
  36. package/dist/{chunk-Q3OZGUZ4.js → chunk-4K5UJMKD.js} +6 -6
  37. package/dist/{chunk-XEP7ER4Z.js → chunk-4OW5VENT.js} +2 -2
  38. package/dist/{chunk-A5ZULLJX.js → chunk-4QCDMVB3.js} +1 -1
  39. package/dist/{chunk-3NPAQ5FV.js → chunk-4YNVKPGH.js} +2 -2
  40. package/dist/{chunk-AEBDHKTJ.js → chunk-5CC5NT52.js} +1 -1
  41. package/dist/{chunk-W7MKF4I2.js → chunk-5KWT5ELY.js} +4 -4
  42. package/dist/{chunk-CGHKK2BY.js → chunk-5NRI2GZ2.js} +3 -3
  43. package/dist/{chunk-IRW7AWIC.js → chunk-5ZJVIDUI.js} +5 -5
  44. package/dist/{chunk-BHOQKOW3.js → chunk-62DXFOO5.js} +1 -1
  45. package/dist/{chunk-JK2WTAKR.js → chunk-64HSIFOR.js} +3 -3
  46. package/dist/{chunk-4E3AKTSD.js → chunk-6EX3FAXP.js} +1 -1
  47. package/dist/{chunk-2FKIIF2W.js → chunk-6WPMMYRT.js} +2 -2
  48. package/dist/{chunk-A4USKCUY.js → chunk-733AQ5WF.js} +1 -1
  49. package/dist/{chunk-EMUKI7UB.js → chunk-7QV5IJB7.js} +1 -1
  50. package/dist/{chunk-BO2FQEM4.js → chunk-7XA7AZGV.js} +2 -2
  51. package/dist/{chunk-6U5JJJFB.js → chunk-A3G5SSWK.js} +1 -1
  52. package/dist/{chunk-FZT7QWVE.js → chunk-AEH6I3VA.js} +2 -2
  53. package/dist/{chunk-4MJCBHXI.js → chunk-ARZI5CTG.js} +1 -1
  54. package/dist/{chunk-TTG6TSI6.js → chunk-B7Z757RJ.js} +2 -2
  55. package/dist/{chunk-S36C2TEK.js → chunk-BBCXLNFM.js} +4 -4
  56. package/dist/{chunk-BANMRXAN.js → chunk-BBDE5NOY.js} +2 -2
  57. package/dist/{chunk-IUUEMVZV.js → chunk-BFR4Z6XZ.js} +2 -2
  58. package/dist/{chunk-6QKW4E7D.js → chunk-CBJDDSLN.js} +12 -12
  59. package/dist/{chunk-2FEZFXKE.js → chunk-CHEMP247.js} +1 -1
  60. package/dist/{chunk-U6ZR7GBQ.js → chunk-CJGFAAQM.js} +11 -7
  61. package/dist/{chunk-K7VV4XSD.js → chunk-CKLS2RVS.js} +2 -2
  62. package/dist/{chunk-AQYZW46G.js → chunk-DJWBK4UK.js} +10 -10
  63. package/dist/{chunk-XOXWJAWW.js → chunk-DRB5UK2D.js} +4 -4
  64. package/dist/{chunk-WMUBDXHG.js → chunk-E5UU5MU2.js} +73 -24
  65. package/dist/{chunk-4SBR3ZP7.js → chunk-EECHZKSA.js} +2 -1
  66. package/dist/{chunk-NNKKJ2MI.js → chunk-EWXYRRN7.js} +4 -4
  67. package/dist/{chunk-3DENR37V.js → chunk-EYW6PB36.js} +3 -3
  68. package/dist/{chunk-IFC533NZ.js → chunk-F272XKKS.js} +2 -2
  69. package/dist/{chunk-GHPPUALY.js → chunk-FG3DCSJ4.js} +3 -3
  70. package/dist/{chunk-FXQRMULT.js → chunk-FPLH6C55.js} +2 -2
  71. package/dist/{chunk-SW4TVGUR.js → chunk-FYV3LZUN.js} +2 -2
  72. package/dist/{chunk-GXKCFOMR.js → chunk-GDPNIGCY.js} +1 -1
  73. package/dist/{chunk-ZHNHAA6O.js → chunk-GG6GYXUV.js} +4 -4
  74. package/dist/{chunk-PHBS5KEY.js → chunk-GHXVDBBC.js} +1 -1
  75. package/dist/{chunk-AWP277ZO.js → chunk-H2LAM5FR.js} +5 -2
  76. package/dist/{chunk-W742C6SA.js → chunk-HJAB3JOG.js} +1 -1
  77. package/dist/{chunk-RF3DT4CS.js → chunk-HJXFRTK3.js} +1 -1
  78. package/dist/{chunk-AJPSKAQ6.js → chunk-HUF42U37.js} +13 -13
  79. package/dist/{chunk-5GUYYSVT.js → chunk-HY67LTYS.js} +1 -1
  80. package/dist/{chunk-BLPMKSO7.js → chunk-I2B2TRZG.js} +1 -1
  81. package/dist/{chunk-FHSBI5MM.js → chunk-I6O4DZI7.js} +2 -2
  82. package/dist/{chunk-QOIEPOKY.js → chunk-IL4LPAZQ.js} +1 -1
  83. package/dist/{chunk-FLJ4S7NA.js → chunk-J3FUIWZX.js} +2 -2
  84. package/dist/{chunk-YU4OCNWW.js → chunk-JAO46FOY.js} +8 -8
  85. package/dist/{chunk-BAL7FD4W.js → chunk-JO3I4BXO.js} +2 -2
  86. package/dist/{chunk-X2VXJFX2.js → chunk-K6GODNZT.js} +1 -1
  87. package/dist/{chunk-D7W642TJ.js → chunk-KCUSOXKM.js} +2 -2
  88. package/dist/{chunk-A4AMJI7L.js → chunk-KKJRKVZ5.js} +1 -1
  89. package/dist/{chunk-AMQBBQCF.js → chunk-KQR4FJDI.js} +4 -4
  90. package/dist/{chunk-VQ72HDX3.js → chunk-LAQLTWMD.js} +76 -45
  91. package/dist/{chunk-YB2ZJJFJ.js → chunk-LMUPRQ3G.js} +1 -1
  92. package/dist/{chunk-VW733NCS.js → chunk-MAFH2AJE.js} +13 -13
  93. package/dist/{chunk-MDWOXUEU.js → chunk-ME6EKVXB.js} +5 -5
  94. package/dist/{chunk-O3ENZQHQ.js → chunk-MKSJX4I6.js} +2 -2
  95. package/dist/chunk-MOIJOTXX.js +25 -0
  96. package/dist/{chunk-P6WWZ4ZZ.js → chunk-MTOPOZIM.js} +2 -2
  97. package/dist/{chunk-KNRZBLQH.js → chunk-MUZBTTQE.js} +2 -2
  98. package/dist/{chunk-HPENBBIH.js → chunk-N3P2V7RS.js} +1 -1
  99. package/dist/{chunk-ULR3HM3L.js → chunk-NE5YEOIA.js} +2 -2
  100. package/dist/{chunk-KRRKEWWI.js → chunk-NEFSXXXQ.js} +1 -1
  101. package/dist/{chunk-4ORH2OXS.js → chunk-NKRVZC5S.js} +1 -1
  102. package/dist/{chunk-3F7MJNGG.js → chunk-O3HO75D5.js} +1 -1
  103. package/dist/{chunk-H3AH7NDI.js → chunk-OB2XFBWG.js} +8 -8
  104. package/dist/{chunk-ZTD6VXAE.js → chunk-OB3SAKXM.js} +1 -1
  105. package/dist/{chunk-2F2HLVI5.js → chunk-OH6B5TJL.js} +6 -6
  106. package/dist/{chunk-TNO5EVXS.js → chunk-OHGEF6QU.js} +5 -5
  107. package/dist/{chunk-W3AUR4EP.js → chunk-OPJBIXRI.js} +1 -1
  108. package/dist/{chunk-PEXUCK6Y.js → chunk-OTXQ4VDJ.js} +3 -3
  109. package/dist/{chunk-PI6ZYIGK.js → chunk-OUXG24ZI.js} +1 -1
  110. package/dist/{chunk-JB7OF43L.js → chunk-PCHSXE5J.js} +1 -1
  111. package/dist/{chunk-PS26KCCH.js → chunk-PGQEXWKK.js} +3 -3
  112. package/dist/{chunk-ITBQLYIV.js → chunk-PGRXYVKK.js} +3 -3
  113. package/dist/{chunk-DKEP2QM5.js → chunk-PYSHL3ZA.js} +6 -6
  114. package/dist/{chunk-LD6JONPV.js → chunk-Q7CZZWPB.js} +53 -46
  115. package/dist/{chunk-U4BP54JI.js → chunk-QBMXTRZ2.js} +1 -1
  116. package/dist/{chunk-2SE62YIX.js → chunk-QDMLR2K6.js} +5 -5
  117. package/dist/{chunk-STUDSWGR.js → chunk-QEXNYXWZ.js} +1 -1
  118. package/dist/{chunk-RVQQUHIT.js → chunk-RDNVSDFY.js} +2 -2
  119. package/dist/{chunk-SDIQEPAR.js → chunk-RWDZPTDG.js} +1 -1
  120. package/dist/{chunk-NK2UW3WR.js → chunk-SDOVSUQP.js} +1 -1
  121. package/dist/{chunk-ERYGKPIR.js → chunk-SMLMTEV6.js} +1 -1
  122. package/dist/{chunk-JOW7SA7F.js → chunk-SQBVJUBS.js} +2 -2
  123. package/dist/{chunk-QTLKOGK4.js → chunk-SRYGFL4X.js} +2 -2
  124. package/dist/{chunk-T73BVHZ5.js → chunk-T5RAZMWO.js} +5 -5
  125. package/dist/{chunk-MIPRIUWU.js → chunk-TCBQLCIH.js} +6 -6
  126. package/dist/{chunk-L7YERJVL.js → chunk-TGXF6UDS.js} +451 -389
  127. package/dist/{chunk-HUUPDIBE.js → chunk-TIH6APOB.js} +3 -3
  128. package/dist/{chunk-XNBVJAL4.js → chunk-UHEM6SYQ.js} +22 -13
  129. package/dist/{chunk-PAKYOFVJ.js → chunk-V7W64LZY.js} +1 -1
  130. package/dist/{chunk-ZS2ROUIG.js → chunk-VBNZJYTW.js} +1 -1
  131. package/dist/chunk-VDZP4BZ5.js +5146 -0
  132. package/dist/{chunk-B3HZTUCD.js → chunk-VPIA3GTO.js} +3 -3
  133. package/dist/{chunk-MDFQC4J2.js → chunk-VPZDUCSM.js} +1 -1
  134. package/dist/{chunk-U55SJQPA.js → chunk-W74TM3NV.js} +2 -2
  135. package/dist/{chunk-JYFQXM2E.js → chunk-WMOQ57TW.js} +1 -1
  136. package/dist/{chunk-JXUDMAKX.js → chunk-WOPCPR72.js} +2 -2
  137. package/dist/{chunk-DNBMLRSA.js → chunk-X2EBEAN2.js} +1 -1
  138. package/dist/{chunk-BC24UT7V.js → chunk-XQTNYI52.js} +3 -3
  139. package/dist/{chunk-LHCQ4TMY.js → chunk-YEMCMFL7.js} +2 -2
  140. package/dist/{chunk-WU3JL3BC.js → chunk-YOCGTMQB.js} +2 -2
  141. package/dist/{chunk-UN5SNMRS.js → chunk-YOIK5SLW.js} +10 -10
  142. package/dist/{chunk-OMLJTCNR.js → chunk-YZPBPF7E.js} +2 -2
  143. package/dist/{chunk-VM2VBJRC.js → chunk-Z67ELZGQ.js} +16 -0
  144. package/dist/{chunk-2U6Z7QH5.js → chunk-Z7GGJNHT.js} +10 -10
  145. package/dist/{chunk-NYJ4OV4H.js → chunk-ZVA57LRU.js} +2 -2
  146. package/dist/{clean-NP652D74.js → clean-PBUDBKN3.js} +26 -25
  147. package/dist/cli.js +68 -68
  148. package/dist/{cloud-TNWRELD4.js → cloud-DMWF7YD7.js} +7 -7
  149. package/dist/{cloud-EBVLMT6V.js → cloud-WS73EESF.js} +4 -4
  150. package/dist/{cloudrun-NAQ26OGP.js → cloudrun-QMDS5WTP.js} +7 -7
  151. package/dist/{compare-NPK5WR6F.js → compare-NHKYHUFA.js} +42 -44
  152. package/dist/{compiler-TYKIETZY.js → compiler-VP7WQKBE.js} +4 -4
  153. package/dist/{component-YTC25I6A.js → component-5BFZ6K3S.js} +5 -5
  154. package/dist/{compositions-A3WYG7XA.js → compositions-66KLKTAT.js} +15 -15
  155. package/dist/{curve-HULZZNO2.js → curve-HL4GYKLW.js} +14 -14
  156. package/dist/{cuts-EEN2AJLR.js → cuts-A3DIDUE5.js} +15 -15
  157. package/dist/{delete-QBPY4DUZ.js → delete-2FH5U3BS.js} +11 -11
  158. package/dist/{deploy-ZOTTUJKO.js → deploy-T2I6TX6S.js} +6 -6
  159. package/dist/{describeProject-AT42RQAC.js → describeProject-CGO3JNDQ.js} +10 -10
  160. package/dist/{destroy-72TCFGIU.js → destroy-XILHHKHS.js} +6 -6
  161. package/dist/{diff-L76A3S3I.js → diff-H7YAKNOY.js} +37 -37
  162. package/dist/{dist-56QKGCNA.js → dist-653H5YTV.js} +12 -11
  163. package/dist/{dist-FU3Y3LDE.js → dist-D2LKDDWO.js} +2 -2
  164. package/dist/{dist-XRESUN6B.js → dist-XBACRUL3.js} +2 -2
  165. package/dist/{doctor-MTSMQTIP.js → doctor-MIR7OXRP.js} +18 -18
  166. package/dist/{dotEnv-NMTSGEYW.js → dotEnv-ZPSOMSOP.js} +3 -3
  167. package/dist/{energy-Y7UZSF5R.js → energy-H5SUZGZT.js} +15 -15
  168. package/dist/{events-NLBWWYJR.js → events-LXKVJNED.js} +17 -17
  169. package/dist/{events-RY7F26WJ.js → events-T3ALKAW6.js} +8 -8
  170. package/dist/{events-5IZJ6IG4.js → events-Z4LW2Q7K.js} +5 -5
  171. package/dist/{execute-X6GOJYI7.js → execute-EY26E6OZ.js} +30 -29
  172. package/dist/{extract-PO4ERZG7.js → extract-5OMVLJS6.js} +15 -15
  173. package/dist/{face-GS7FT77Y.js → face-3CA2ELZF.js} +11 -11
  174. package/dist/{face-O7W6DN3E.js → face-C3EYNUI7.js} +15 -15
  175. package/dist/{feedback-OLPHMAVY.js → feedback-JVZM3H3Y.js} +17 -17
  176. package/dist/{ffmpeg-6R5HYRLA.js → ffmpeg-SHN36SBB.js} +9 -9
  177. package/dist/{figma-3WLCHH7N.js → figma-GFBJK253.js} +3 -3
  178. package/dist/fontLocalizeCli.js +15 -14
  179. package/dist/{frames-RELC7P5I.js → frames-VUKOJHMC.js} +16 -16
  180. package/dist/{generate-KDKHARPX.js → generate-LBZ7YBAJ.js} +29 -29
  181. package/dist/{get-Y4JVREKO.js → get-XG6EMYSN.js} +11 -11
  182. package/dist/{gpuPolicy-IJE7MB5Y.js → gpuPolicy-EPYGPUWY.js} +9 -9
  183. package/dist/{grade-compare-T25JDQLV.js → grade-compare-QEAK2WAN.js} +37 -36
  184. package/dist/{hands-WXGO4FOI.js → hands-D5FFNG7P.js} +17 -17
  185. package/dist/hangReport.js +2 -2
  186. package/dist/{heifImagePrep-5X36VXGL.js → heifImagePrep-EPHLAUQS.js} +10 -10
  187. package/dist/{help-N66Y52S7.js → help-RGE2WSYV.js} +1 -1
  188. package/dist/{history-F7C2MXWT.js → history-6AR7FJP6.js} +13 -13
  189. package/dist/hyperframe.manifest.json +1 -1
  190. package/dist/hyperframe.runtime.iife.js +67 -66
  191. package/dist/hyperframes-player.global.js +1 -1
  192. package/dist/{info-IHOMN6HZ.js → info-ID4PL6UT.js} +17 -17
  193. package/dist/{init-S2SZ3YJW.js → init-SHB3DP6L.js} +31 -31
  194. package/dist/{ink-DMKCUCA4.js → ink-I7LJRWCL.js} +15 -15
  195. package/dist/{inspect-ILBSFULF.js → inspect-5WQ44QNB.js} +41 -40
  196. package/dist/{installer-5ZPAYISO.js → installer-X4QZF2DI.js} +4 -4
  197. package/dist/{keyframes-U4XFMXJ3.js → keyframes-4E3RRUEE.js} +15 -15
  198. package/dist/{lambda-DYOGW62Q.js → lambda-2TQJLXU6.js} +15 -15
  199. package/dist/{launch-D5BGD7YR.js → launch-E3YGINZ4.js} +10 -10
  200. package/dist/{layout-F7SIJYUI.js → layout-2HS6DI7K.js} +41 -40
  201. package/dist/{lint-3HQJQBVK.js → lint-KM2IBX4H.js} +13 -13
  202. package/dist/{lintProject-55U44GOP.js → lintProject-FPQL3VUS.js} +2 -2
  203. package/dist/{list-JUPBF73K.js → list-TK67T6NQ.js} +11 -11
  204. package/dist/{localPage-SI4COAH7.js → localPage-FKCJ56LM.js} +9 -9
  205. package/dist/{login-H6EP7A3D.js → login-KNXZW6TL.js} +14 -12
  206. package/dist/{logout-S5JLGTKW.js → logout-RTMUK5GM.js} +6 -6
  207. package/dist/{look-X5LTWUIV.js → look-3MW776RP.js} +15 -15
  208. package/dist/{manager-PXRZQDDT.js → manager-AA3ZNHAP.js} +4 -4
  209. package/dist/{manager-GGOPVDOZ.js → manager-TOFBFPBV.js} +10 -10
  210. package/dist/{measure-XUHMK2AU.js → measure-FYVTCZOB.js} +12 -12
  211. package/dist/{media-YXE5MDL4.js → media-TZ62KQW4.js} +10 -10
  212. package/dist/{media-treatment-SJXT2VQM.js → media-treatment-E63ULHVY.js} +17 -17
  213. package/dist/{media-use-VK62B4E2.js → media-use-FMUH7ZUS.js} +10 -10
  214. package/dist/{models-GBAKNMXA.js → models-TN7Q6LHX.js} +14 -14
  215. package/dist/{motionShot-6DNYNDSA.js → motionShot-BQDN72EP.js} +20 -20
  216. package/dist/{normalize-audio-RWERSIGD.js → normalize-audio-UCFVXTIJ.js} +11 -11
  217. package/dist/{oauth-RETRT7QD.js → oauth-NRCCRSM7.js} +16 -1
  218. package/dist/{open-3YMOWNPY.js → open-V4ZVSII2.js} +16 -16
  219. package/dist/{parakeetRunner-TVDHLBTI.js → parakeetRunner-2CAJDREF.js} +16 -16
  220. package/dist/{pipeline-WCH5HSYI.js → pipeline-FPO2KBRR.js} +12 -12
  221. package/dist/{plan-HVP3IH7H.js → plan-UVCFCV2Y.js} +21 -21
  222. package/dist/{play-CQQ7HHSQ.js → play-Q5K56OLI.js} +26 -25
  223. package/dist/{preflight-6B6A46GT.js → preflight-LWGJARUS.js} +12 -12
  224. package/dist/{present-UB6UPVOL.js → present-YYOXFE4M.js} +22 -21
  225. package/dist/{preview-BVSDP4Z7.js → preview-HZNQXLLA.js} +23 -23
  226. package/dist/{privateProjectFile-NBXWYT2G.js → privateProjectFile-HR24FBS3.js} +2 -2
  227. package/dist/{probe-BOCLZXCU.js → probe-Q3CAECJE.js} +15 -15
  228. package/dist/{producer-HKFKQO2J.js → producer-NUMTF4NV.js} +1 -1
  229. package/dist/{projectConfig-S7ZS2Q7T.js → projectConfig-MTV36AK5.js} +6 -6
  230. package/dist/{publicNetwork-66HWFKYG.js → publicNetwork-RUALPHQQ.js} +1 -1
  231. package/dist/{publication-A6ZCUXEK.js → publication-RYPB4ECT.js} +2 -2
  232. package/dist/{publish-UA5UUDMQ.js → publish-6LEWK7PW.js} +25 -24
  233. package/dist/{receivedRecordFollow-Y7JQ2W2O.js → receivedRecordFollow-IOWRQGUZ.js} +5 -5
  234. package/dist/{refresh-T3APLU23.js → refresh-26TY6T3T.js} +6 -6
  235. package/dist/{remove-background-YZ4FAKSD.js → remove-background-WTNU2B6P.js} +13 -13
  236. package/dist/{render-POJSNMDW.js → render-2CMNV3HD.js} +5 -5
  237. package/dist/{render-CTU3KQWD.js → render-2D2UAKFF.js} +70 -45
  238. package/dist/{render-HZFDCEBU.js → render-AKSYGATG.js} +43 -41
  239. package/dist/{render-batch-XUPWNAEB.js → render-batch-PJJ2IAXB.js} +5 -5
  240. package/dist/renderSetupWorker.js +6 -6
  241. package/dist/{resolver-XFJ2W7CE.js → resolver-EOLWQUXN.js} +4 -4
  242. package/dist/{reverse-DP3LTE2X.js → reverse-JYB76V4W.js} +1 -1
  243. package/dist/{run-7YFWJGQA.js → run-GROTBG7F.js} +10 -10
  244. package/dist/{sam-O7Y2CCK3.js → sam-PHMZPQBM.js} +4 -4
  245. package/dist/{screenshotCapture-XDIKLRCX.js → screenshotCapture-MBE35AZB.js} +11 -11
  246. package/dist/{service-BMH3KCG2.js → service-KPPBDSXJ.js} +17 -17
  247. package/dist/{share-GNE5S6JA.js → share-4XINQNHQ.js} +24 -23
  248. package/dist/{sherpa-2NMBO7EI.js → sherpa-2AN24GHU.js} +15 -15
  249. package/dist/sherpaWorker.js +3 -3
  250. package/dist/skills/hyperframes/references/plugin-installation.md +1 -1
  251. package/dist/skills/hyperframes/scripts/plugin-cli.mjs +4 -4
  252. package/dist/{skills-SB465LBL.js → skills-EMPTMUD4.js} +13 -13
  253. package/dist/{skillsUpdateCheck-OO3QYY7I.js → skillsUpdateCheck-2EBTDXQK.js} +5 -5
  254. package/dist/{snapshot-YYE5X4D6.js → snapshot-OGWDPVEW.js} +46 -46
  255. package/dist/{snapshotHeldVideos-WKU5Q4NL.js → snapshotHeldVideos-L5G4BJMS.js} +10 -10
  256. package/dist/{src-UEZXRPFJ.js → src-RG4SCSGS.js} +13 -12
  257. package/dist/{src-COKNEXLI.js → src-UG2WAJ4N.js} +11 -9
  258. package/dist/{start-RXKU3NS3.js → start-6O2YSEDG.js} +27 -27
  259. package/dist/{staticProjectServer-PYOO5BKL.js → staticProjectServer-V63BNPSM.js} +22 -21
  260. package/dist/{status-OO7JXNVG.js → status-2WOIELO6.js} +20 -20
  261. package/dist/studio/assets/{hyperframes-player-DHYu0XuV.js → hyperframes-player-nG4__A3B.js} +1 -1
  262. package/dist/studio/assets/{index-BBKHfua5.js → index-C5iAFIqv.js} +190 -190
  263. package/dist/studio/assets/{index-DqND4rHq.js → index-kDyUffRn.js} +1 -1
  264. package/dist/studio/assets/{pausedVideoDecoder-B1FNXBMe.js → pausedVideoDecoder-IQoJJyyF.js} +1 -1
  265. package/dist/studio/index.html +1 -1
  266. package/dist/{studio-api-3QHWJQ5S.js → studio-api-4GYCLMID.js} +12 -11
  267. package/dist/{studioServer-DDL676LA.js → studioServer-QX63XIEQ.js} +70 -70
  268. package/dist/subCompositionWorker.js +13 -18
  269. package/dist/{sync-JOQ6E5IN.js → sync-Z7IBEP3C.js} +15 -15
  270. package/dist/{synthesize-JECKYUGO.js → synthesize-W7KYX6CI.js} +2 -2
  271. package/dist/{system-PKL4Y4MX.js → system-V6IZXVU4.js} +3 -3
  272. package/dist/{telemetry-PEPGYBEH.js → telemetry-SLK6NDNI.js} +8 -8
  273. package/dist/{templates-U3LTK3E6.js → templates-AUPWONXJ.js} +17 -17
  274. package/dist/{textOverFace-665L5B6Q.js → textOverFace-GWO5YXHJ.js} +3 -3
  275. package/dist/{timeline-5H5XHN2E.js → timeline-7RPZOK45.js} +24 -23
  276. package/dist/{tokens-ZT2YAOJ2.js → tokens-JMQW7UGW.js} +4 -4
  277. package/dist/{transcribe-62GITMY3.js → transcribe-5DBUPMYG.js} +13 -13
  278. package/dist/{transcribe-DVXDCZX7.js → transcribe-TKI4KIJK.js} +32 -32
  279. package/dist/{tts-V36EOYBQ.js → tts-ZXYMSDHK.js} +3 -3
  280. package/dist/{update-QVKPG5CA.js → update-YP3YCDUJ.js} +14 -14
  281. package/dist/{updateCheck-X36OZADC.js → updateCheck-INFKS2YR.js} +4 -4
  282. package/dist/{upgrade-YE57GX33.js → upgrade-HDDWKPJM.js} +5 -5
  283. package/dist/{urlDownloader-UJ5T4WGL.js → urlDownloader-VP7QI3OV.js} +8 -8
  284. package/dist/{validate-IXPYD4ZO.js → validate-DPETQTM3.js} +31 -30
  285. package/dist/{video-OX3ZLXXC.js → video-H2JJ32WV.js} +10 -10
  286. package/dist/{voices-ND6HWM5H.js → voices-J6PWVAVA.js} +27 -27
  287. package/dist/warmCheck.js +47 -47
  288. package/dist/warmCheckClient.js +2 -2
  289. package/package.json +1 -1
  290. package/dist/chunk-S3IQW75Q.js +0 -5146
@@ -16,7 +16,7 @@ import {
16
16
  Semaphore,
17
17
  prepareHeifImageInputs,
18
18
  withMediaProbeSlot
19
- } from "./chunk-WU3JL3BC.js";
19
+ } from "./chunk-YOCGTMQB.js";
20
20
  import {
21
21
  EncoderInterruptedError,
22
22
  encoderFailureError,
@@ -30,15 +30,19 @@ import {
30
30
  refusesOutsideLink,
31
31
  resolveRenderPaths,
32
32
  toExternalAssetKey
33
- } from "./chunk-KNRZBLQH.js";
33
+ } from "./chunk-MUZBTTQE.js";
34
34
  import {
35
35
  linksOutside
36
36
  } from "./chunk-6ACARSAZ.js";
37
37
  import {
38
38
  createStudioPositionSeekReapplyScript,
39
+ htmlHasStudioPositionEdits,
39
40
  openRangeEnd,
40
41
  parseEncoderOptions
41
- } from "./chunk-LD6JONPV.js";
42
+ } from "./chunk-Q7CZZWPB.js";
43
+ import {
44
+ previewToken
45
+ } from "./chunk-HLVNKNSW.js";
42
46
  import {
43
47
  BROWSER_GPU_NOT_SOFTWARE,
44
48
  CaptureFailure,
@@ -212,10 +216,10 @@ import {
212
216
  withPublicOnlyProxy,
213
217
  writeCapturedFrame,
214
218
  writeUrlDownloadTelemetry
215
- } from "./chunk-WMUBDXHG.js";
219
+ } from "./chunk-E5UU5MU2.js";
216
220
  import {
217
221
  settleOnBrowserSafePort
218
- } from "./chunk-PJQVJSMG.js";
222
+ } from "./chunk-33JUCUTM.js";
219
223
  import {
220
224
  TRANSITIONS,
221
225
  convertTransfer,
@@ -237,7 +241,7 @@ import {
237
241
  parsesAsScript,
238
242
  prepareFlattenedInnerRoot,
239
243
  stripSdrPngColourTags
240
- } from "./chunk-2FKIIF2W.js";
244
+ } from "./chunk-6WPMMYRT.js";
241
245
  import {
242
246
  RENDER_TEMP_DIR
243
247
  } from "./chunk-F6PI5O3H.js";
@@ -265,7 +269,7 @@ import {
265
269
  redactTelemetryString,
266
270
  resolveAuthoredTimingWindow,
267
271
  toFps
268
- } from "./chunk-STUDSWGR.js";
272
+ } from "./chunk-QEXNYXWZ.js";
269
273
  import {
270
274
  CAPTURE_CANVAS_SELECTOR,
271
275
  COMPOSITION_SOURCE_URL,
@@ -302,7 +306,7 @@ import {
302
306
  sourceTimeAt,
303
307
  styleElementsFor,
304
308
  timeAtSourceTime
305
- } from "./chunk-S3IQW75Q.js";
309
+ } from "./chunk-VDZP4BZ5.js";
306
310
  import {
307
311
  isSafePath,
308
312
  terminalText
@@ -312,7 +316,7 @@ import {
312
316
  } from "./chunk-LWX5PI73.js";
313
317
  import {
314
318
  resolveReferencedStart
315
- } from "./chunk-GXKCFOMR.js";
319
+ } from "./chunk-GDPNIGCY.js";
316
320
  import {
317
321
  isUnresolvedAssetPlaceholder,
318
322
  namesAnotherNetworkRoot,
@@ -328,7 +332,7 @@ import {
328
332
  getSystemTotalMb,
329
333
  hostCpuCount,
330
334
  usableCpuCount
331
- } from "./chunk-5GUYYSVT.js";
335
+ } from "./chunk-HY67LTYS.js";
332
336
  import {
333
337
  MEDIA_START_BASIS_ATTR,
334
338
  checkSubCompositionUsability,
@@ -374,6 +378,9 @@ import {
374
378
  isPrivateFileUnder,
375
379
  isStudioPrivatePath
376
380
  } from "./chunk-NTGTWXAO.js";
381
+ import {
382
+ concatListInputArgs
383
+ } from "./chunk-Z67ELZGQ.js";
377
384
 
378
385
  // ../producer/src/services/renderOrchestrator.ts
379
386
  import {
@@ -381,7 +388,7 @@ import {
381
388
  mkdirSync as mkdirSync10,
382
389
  readdirSync as readdirSync6,
383
390
  rmSync as rmSync10,
384
- statSync as statSync8,
391
+ statSync as statSync7,
385
392
  writeFileSync as writeFileSync6,
386
393
  copyFileSync as copyFileSync3,
387
394
  appendFileSync
@@ -680,7 +687,7 @@ function firstCompositionIdTag(html) {
680
687
  }
681
688
 
682
689
  // ../producer/src/services/renderOrchestrator.ts
683
- import { join as join30, dirname as dirname12, resolve as resolve7 } from "path";
690
+ import { join as join31, dirname as dirname12, resolve as resolve7 } from "path";
684
691
  import { totalmem as totalmem2 } from "os";
685
692
  import { randomUUID } from "crypto";
686
693
  import { fileURLToPath as fileURLToPath3 } from "url";
@@ -2798,8 +2805,8 @@ function replanAfterFailure(plan2, failure) {
2798
2805
  }
2799
2806
 
2800
2807
  // ../producer/src/services/render/stages/captureSegmentedStage.ts
2801
- import { existsSync as existsSync7, mkdirSync as mkdirSync3, rmSync as rmSync6, statSync as statSync3 } from "fs";
2802
- import { join as join9 } from "path";
2808
+ import { existsSync as existsSync8, mkdirSync as mkdirSync4, rmSync as rmSync6, statSync as statSync3 } from "fs";
2809
+ import { join as join11 } from "path";
2803
2810
 
2804
2811
  // ../producer/src/services/render/perfSummary.ts
2805
2812
  import { arch, platform, totalmem } from "os";
@@ -4428,6 +4435,7 @@ function cleanupEndedHdrVideos(args) {
4428
4435
  }
4429
4436
 
4430
4437
  // ../producer/src/services/render/segmentPlan.ts
4438
+ import { join as join8 } from "path";
4431
4439
  var DEFAULT_SEGMENT_FRAMES = 3e3;
4432
4440
  var MIN_SEGMENT_FRAMES = 30;
4433
4441
  function assertPositiveInteger(name, value) {
@@ -4448,6 +4456,9 @@ function planSegments(totalFrames, segmentFrames) {
4448
4456
  }
4449
4457
  return slices;
4450
4458
  }
4459
+ function segmentOutputPath(segmentDir, index) {
4460
+ return join8(segmentDir, `segment_${String(index).padStart(5, "0")}.mp4`);
4461
+ }
4451
4462
  function resolveSegmentFrames(env) {
4452
4463
  const raw = env.HF_SEGMENT_FRAMES;
4453
4464
  if (raw === void 0 || raw.trim() === "") return DEFAULT_SEGMENT_FRAMES;
@@ -4465,6 +4476,142 @@ function createSegmentQueue(slices) {
4465
4476
  };
4466
4477
  }
4467
4478
 
4479
+ // ../producer/src/services/render/segmentManifest.ts
4480
+ import { createHash as createHash2, createHmac, timingSafeEqual } from "crypto";
4481
+ import {
4482
+ createReadStream as createReadStream2,
4483
+ existsSync as existsSync7,
4484
+ lstatSync as lstatSync3,
4485
+ mkdirSync as mkdirSync3,
4486
+ readFileSync as readFileSync4,
4487
+ writeFileSync as writeFileSync3
4488
+ } from "fs";
4489
+ import { join as join9 } from "path";
4490
+ var MANIFEST_FILENAME = "segments.json";
4491
+ function computeSegmentPlanHash(input) {
4492
+ const ordered = [
4493
+ input.compositionHash,
4494
+ input.cliVersion,
4495
+ String(input.totalFrames),
4496
+ String(input.segmentFrames),
4497
+ `${input.fps.num}/${input.fps.den}`,
4498
+ `${input.width}x${input.height}`,
4499
+ input.codec,
4500
+ input.preset,
4501
+ input.quality === void 0 ? "" : String(input.quality),
4502
+ input.bitrate ?? "",
4503
+ input.pixelFormat ?? "",
4504
+ input.imageFormat,
4505
+ input.useGpu ? "gpu" : "cpu",
4506
+ `${input.outputWidth}x${input.outputHeight}`,
4507
+ input.motionBlur,
4508
+ input.pageMotionBlur ?? "",
4509
+ input.captureQuality === void 0 ? "" : String(input.captureQuality)
4510
+ ];
4511
+ const delivery = [input.maxBitrate, input.bufferSize, input.gopSize].map((v) => v ?? "");
4512
+ if (delivery.some((v) => v !== "")) ordered.push(...delivery.map(String));
4513
+ return createHash2("sha256").update(ordered.join(" ")).digest("hex").slice(0, 16);
4514
+ }
4515
+ function segmentDirFor(projectRendersDir, planHash) {
4516
+ return join9(projectRendersDir, ".hf-segments", planHash);
4517
+ }
4518
+ function hasNumber(value, key) {
4519
+ return key in value && typeof Reflect.get(value, key) === "number";
4520
+ }
4521
+ function hasString(value, key) {
4522
+ return key in value && typeof Reflect.get(value, key) === "string";
4523
+ }
4524
+ function isEntry(value) {
4525
+ if (typeof value !== "object" || value === null) return false;
4526
+ return hasNumber(value, "index") && hasNumber(value, "startFrame") && hasNumber(value, "endFrame") && hasString(value, "path") && hasNumber(value, "bytes") && hasString(value, "sha256") && hasString(value, "completedAt");
4527
+ }
4528
+ function isManifest(value) {
4529
+ if (typeof value !== "object" || value === null) return false;
4530
+ const completed = Reflect.get(value, "completed");
4531
+ return Reflect.get(value, "version") === 1 && hasString(value, "planHash") && hasNumber(value, "totalFrames") && hasNumber(value, "segmentFrames") && Array.isArray(completed) && completed.every(isEntry);
4532
+ }
4533
+ function readSegmentManifest(segmentDir) {
4534
+ const path = join9(segmentDir, MANIFEST_FILENAME);
4535
+ if (!existsSync7(path)) return null;
4536
+ try {
4537
+ const parsed = JSON.parse(readFileSync4(path, "utf-8"));
4538
+ return isManifest(parsed) ? parsed : null;
4539
+ } catch {
4540
+ return null;
4541
+ }
4542
+ }
4543
+ function segmentManifestKey(token = previewToken()) {
4544
+ return token ? createHmac("sha256", token).update("segment-manifest").digest() : null;
4545
+ }
4546
+ function manifestMac(manifest, key) {
4547
+ const signed = [
4548
+ manifest.planHash,
4549
+ manifest.totalFrames,
4550
+ manifest.segmentFrames,
4551
+ manifest.completed.map((e) => [e.index, e.startFrame, e.endFrame, e.bytes, e.sha256])
4552
+ ];
4553
+ return createHmac("sha256", key).update(JSON.stringify(signed)).digest("hex");
4554
+ }
4555
+ function signSegmentManifest(manifest, key) {
4556
+ const { version, planHash, totalFrames, segmentFrames, completed } = manifest;
4557
+ const unsigned = { version, planHash, totalFrames, segmentFrames, completed };
4558
+ return key ? { ...unsigned, mac: manifestMac(unsigned, key) } : unsigned;
4559
+ }
4560
+ function hasValidMac(manifest, key) {
4561
+ if (!key || typeof manifest.mac !== "string") return false;
4562
+ const expected = Buffer.from(manifestMac(manifest, key), "hex");
4563
+ const actual = Buffer.from(manifest.mac, "hex");
4564
+ return actual.length === expected.length && timingSafeEqual(actual, expected);
4565
+ }
4566
+ async function hashSegmentFile(path) {
4567
+ const hash = createHash2("sha256");
4568
+ for await (const chunk of createReadStream2(path)) hash.update(chunk);
4569
+ return hash.digest("hex");
4570
+ }
4571
+ function writeSegmentManifest(segmentDir, manifest, key) {
4572
+ mkdirSync3(segmentDir, { recursive: true });
4573
+ const tmp = join9(segmentDir, `${MANIFEST_FILENAME}.${process.pid}.tmp`);
4574
+ writeFileSync3(tmp, JSON.stringify(signSegmentManifest(manifest, key), null, 2), "utf-8");
4575
+ renameWithRetry(tmp, join9(segmentDir, MANIFEST_FILENAME));
4576
+ }
4577
+ async function probeSegmentFrameCount(path, probe) {
4578
+ try {
4579
+ const meta = await probe(path);
4580
+ if (!Number.isFinite(meta.videoStreamDurationSeconds) || !Number.isFinite(meta.fps))
4581
+ return null;
4582
+ if (meta.fps <= 0) return null;
4583
+ return Math.round(meta.videoStreamDurationSeconds * meta.fps);
4584
+ } catch {
4585
+ return null;
4586
+ }
4587
+ }
4588
+ function plannedSlice(entry, plan2) {
4589
+ const slice = Number.isInteger(entry.index) ? plan2[entry.index] : void 0;
4590
+ if (!slice || slice.startFrame !== entry.startFrame || slice.endFrame !== entry.endFrame) {
4591
+ return void 0;
4592
+ }
4593
+ return slice;
4594
+ }
4595
+ function isPlainFileOfSize(path, bytes) {
4596
+ const stat = lstatSync3(path, { throwIfNoEntry: false });
4597
+ return stat !== void 0 && stat.isFile() && stat.size > 0 && stat.size === bytes;
4598
+ }
4599
+ async function validateCompletedSegments(manifest, check) {
4600
+ const ok = /* @__PURE__ */ new Set();
4601
+ if (manifest.planHash !== check.expectedHash || !hasValidMac(manifest, check.key)) return ok;
4602
+ for (const entry of manifest.completed) {
4603
+ const slice = plannedSlice(entry, check.plan);
4604
+ if (!slice) continue;
4605
+ const path = segmentOutputPath(check.segmentDir, slice.index);
4606
+ if (!isPlainFileOfSize(path, entry.bytes)) continue;
4607
+ if (await hashSegmentFile(path) !== entry.sha256) continue;
4608
+ const frames = await check.probeFrames(path);
4609
+ if (frames !== slice.endFrame - slice.startFrame) continue;
4610
+ ok.add(slice.index);
4611
+ }
4612
+ return ok;
4613
+ }
4614
+
4468
4615
  // ../producer/src/services/render/segmentRecycle.ts
4469
4616
  var DEFAULT_SEGMENT_BROWSER_RECYCLE = 3;
4470
4617
  function resolveSegmentBrowserRecycle(env) {
@@ -4482,7 +4629,7 @@ function isTargetLossError(error) {
4482
4629
  // ../producer/src/services/render/stages/captureStreamingStage.ts
4483
4630
  import { mkdtemp, writeFile } from "fs/promises";
4484
4631
  import { tmpdir as tmpdir2 } from "os";
4485
- import { join as join8 } from "path";
4632
+ import { join as join10 } from "path";
4486
4633
 
4487
4634
  // ../producer/src/services/render/stallClock.ts
4488
4635
  var SUSPEND_GAP_MS = 15e3;
@@ -4685,11 +4832,11 @@ async function verifyDrawElementSample(session, idx, buf, ctx) {
4685
4832
  return;
4686
4833
  }
4687
4834
  if (db < verifyMinDb) {
4688
- const dumpDir = await mkdtemp(join8(tmpdir2(), "hf-de-verify-fail-")).catch(() => null);
4835
+ const dumpDir = await mkdtemp(join10(tmpdir2(), "hf-de-verify-fail-")).catch(() => null);
4689
4836
  if (dumpDir) {
4690
4837
  await Promise.all([
4691
- writeFile(join8(dumpDir, `frame-${idx}-de.jpg`), buf),
4692
- writeFile(join8(dumpDir, `frame-${idx}-truth.jpg`), truth)
4838
+ writeFile(join10(dumpDir, `frame-${idx}-de.jpg`), buf),
4839
+ writeFile(join10(dumpDir, `frame-${idx}-truth.jpg`), truth)
4693
4840
  ]).catch(() => {
4694
4841
  });
4695
4842
  }
@@ -5259,9 +5406,6 @@ async function runCaptureStreamingStage(input) {
5259
5406
  }
5260
5407
 
5261
5408
  // ../producer/src/services/render/stages/captureSegmentedStage.ts
5262
- function segmentOutputPath(segmentDir, index) {
5263
- return join9(segmentDir, `segment_${String(index).padStart(5, "0")}.mp4`);
5264
- }
5265
5409
  function segmentEncoderOptions(base, segment) {
5266
5410
  return {
5267
5411
  ...base,
@@ -5359,7 +5503,8 @@ async function captureSegmentToEncoder(ctx, segment) {
5359
5503
  path: segmentPath,
5360
5504
  // Recorded so resume can prove the file on disk is the one that
5361
5505
  // finished; absent only in unit tests, whose fake encoder writes none.
5362
- bytes: existsSync7(segmentPath) ? statSync3(segmentPath).size : 0
5506
+ bytes: existsSync8(segmentPath) ? statSync3(segmentPath).size : 0,
5507
+ sha256: existsSync8(segmentPath) ? await hashSegmentFile(segmentPath) : ""
5363
5508
  });
5364
5509
  return encodeResult;
5365
5510
  } finally {
@@ -5593,8 +5738,8 @@ async function runCaptureSegmentedStage(input) {
5593
5738
  const { log, dedupPerfs, assertNotAborted } = input;
5594
5739
  const deps = { ...DEFAULT_DEPS, ...input.deps };
5595
5740
  const segments = planSegments(input.totalFrames, input.segmentFrames);
5596
- const segmentDir = input.segmentDir ?? join9(input.workDir, "segments");
5597
- mkdirSync3(segmentDir, { recursive: true });
5741
+ const segmentDir = input.segmentDir ?? join11(input.workDir, "segments");
5742
+ mkdirSync4(segmentDir, { recursive: true });
5598
5743
  const skip = input.completedSegments ?? /* @__PURE__ */ new Set();
5599
5744
  const pending = segments.filter((s) => !skip.has(s.index));
5600
5745
  for (const index of skip) log.info("[Render] segment skipped (resume)", { index });
@@ -5749,7 +5894,7 @@ function startRenderEtaGuard(options) {
5749
5894
  }
5750
5895
 
5751
5896
  // ../producer/src/services/render/captureCost.ts
5752
- import { join as join10 } from "path";
5897
+ import { join as join12 } from "path";
5753
5898
  var CAPTURE_CALIBRATION_TARGET_MS = 600;
5754
5899
  var MAX_MEASURED_CAPTURE_COST_MULTIPLIER = 8;
5755
5900
  var CAPTURE_CALIBRATION_PROTOCOL_TIMEOUT_MS = 3e4;
@@ -5993,7 +6138,7 @@ async function runCaptureCalibration(input) {
5993
6138
  });
5994
6139
  let calibration;
5995
6140
  try {
5996
- calibration = await runOneCalibration(join10(workDir, "capture-calibration"), calibrationCfg);
6141
+ calibration = await runOneCalibration(join12(workDir, "capture-calibration"), calibrationCfg);
5997
6142
  } catch (error) {
5998
6143
  const shouldFallback = !forceScreenshot && shouldFallbackToScreenshotAfterCalibrationError(error);
5999
6144
  if (!shouldFallback) {
@@ -6027,7 +6172,7 @@ async function runCaptureCalibration(input) {
6027
6172
  const screenshotCfg = createCaptureCalibrationConfig({ ...cfg, forceScreenshot: true });
6028
6173
  try {
6029
6174
  calibration = await runOneCalibration(
6030
- join10(workDir, "capture-calibration-screenshot"),
6175
+ join12(workDir, "capture-calibration-screenshot"),
6031
6176
  screenshotCfg
6032
6177
  );
6033
6178
  } catch (fallbackError) {
@@ -6091,8 +6236,8 @@ function checkPageNeverReady(input) {
6091
6236
  }
6092
6237
 
6093
6238
  // ../producer/src/services/render/deferredVideoFrames.ts
6094
- import { mkdirSync as mkdirSync4, rmSync as rmSync7 } from "fs";
6095
- import { dirname as dirname5, join as join11 } from "path";
6239
+ import { mkdirSync as mkdirSync5, rmSync as rmSync7 } from "fs";
6240
+ import { dirname as dirname5, join as join13 } from "path";
6096
6241
  function contiguousRuns(sortedIndexes) {
6097
6242
  const runs2 = [];
6098
6243
  for (const index of sortedIndexes) {
@@ -6131,7 +6276,7 @@ async function extractDeferredFrames(input) {
6131
6276
  const shown = shownDeferredFrameIndexes(input, input.frames, input.fps);
6132
6277
  return Promise.all(
6133
6278
  deferred.map(async (video) => {
6134
- const outputDir = join11(input.outputRoot, mediaIdPathSegment(video.videoId));
6279
+ const outputDir = join13(input.outputRoot, mediaIdPathSegment(video.videoId));
6135
6280
  const indexes = [...shown.get(video.videoId) ?? []].sort((a, b) => a - b);
6136
6281
  if (indexes.length === 0) {
6137
6282
  return { ...video, outputDir, framePaths: /* @__PURE__ */ new Map(), ownedByLookup: false };
@@ -6187,7 +6332,7 @@ async function extractAllDeferredFrames(extracted, input) {
6187
6332
  maxTransientRetries: input.maxTransientRetries,
6188
6333
  onRetry: () => {
6189
6334
  rmSync7(video.outputDir, { recursive: true, force: true });
6190
- mkdirSync4(video.outputDir, { recursive: true });
6335
+ mkdirSync5(video.outputDir, { recursive: true });
6191
6336
  }
6192
6337
  }
6193
6338
  );
@@ -6273,10 +6418,10 @@ async function measureLocalShownBoxes(page, videos, fps, duration, log) {
6273
6418
  }
6274
6419
 
6275
6420
  // ../producer/src/services/render/segmentVideoFrames.ts
6276
- import { mkdirSync as mkdirSync5, rmSync as rmSync8 } from "fs";
6277
- import { join as join12 } from "path";
6421
+ import { mkdirSync as mkdirSync6, rmSync as rmSync8 } from "fs";
6422
+ import { join as join14 } from "path";
6278
6423
  function segmentFramesDir(rootDir, index) {
6279
- return join12(rootDir, "segment-frames", `segment_${String(index).padStart(5, "0")}`);
6424
+ return join14(rootDir, "segment-frames", `segment_${String(index).padStart(5, "0")}`);
6280
6425
  }
6281
6426
  function createSegmentVideoFrames(input) {
6282
6427
  const extractFrames = input.extractFrames ?? extractDeferredFrames;
@@ -6307,7 +6452,7 @@ function createSegmentVideoFrames(input) {
6307
6452
  let onDemandCalls = 0;
6308
6453
  const onDemandHook = () => Object.assign(
6309
6454
  async (page, time, heldVideoTime) => {
6310
- const dir = join12(
6455
+ const dir = join14(
6311
6456
  input.rootDir,
6312
6457
  "segment-frames",
6313
6458
  `on-demand_${String(onDemandCalls++).padStart(5, "0")}`
@@ -6324,11 +6469,11 @@ function createSegmentVideoFrames(input) {
6324
6469
  );
6325
6470
  return {
6326
6471
  async forFrames(frames, name) {
6327
- const dir = join12(input.rootDir, "segment-frames", name);
6472
+ const dir = join14(input.rootDir, "segment-frames", name);
6328
6473
  const release = () => rmSync8(dir, { recursive: true, force: true });
6329
6474
  try {
6330
6475
  release();
6331
- mkdirSync5(dir, { recursive: true });
6476
+ mkdirSync6(dir, { recursive: true });
6332
6477
  const table = await tableFor([...frames], dir);
6333
6478
  return { injector: () => createVideoFrameInjector(table, input.injectorOptions), release };
6334
6479
  } catch (error) {
@@ -6357,7 +6502,7 @@ function createSegmentVideoFrames(input) {
6357
6502
  folder = dir;
6358
6503
  try {
6359
6504
  rmSync8(dir, { recursive: true, force: true });
6360
- mkdirSync5(dir, { recursive: true });
6505
+ mkdirSync6(dir, { recursive: true });
6361
6506
  injector = await injectorFor(
6362
6507
  Array.from(
6363
6508
  { length: segment.endFrame - segment.startFrame },
@@ -6377,7 +6522,7 @@ function createSegmentVideoFrames(input) {
6377
6522
 
6378
6523
  // ../producer/src/services/render/videoFrameWindow.ts
6379
6524
  import { readdirSync as readdirSync3, statSync as statSync4 } from "fs";
6380
- import { join as join13 } from "path";
6525
+ import { join as join15 } from "path";
6381
6526
  function shouldWindowVideoFrames(args) {
6382
6527
  return args.segmented && args.env.HF_VIDEO_FRAME_WINDOW?.trim().toLowerCase() === "true";
6383
6528
  }
@@ -6390,7 +6535,7 @@ function directoryBytes(path) {
6390
6535
  return 0;
6391
6536
  }
6392
6537
  for (const entry of entries) {
6393
- const child2 = join13(path, entry.name);
6538
+ const child2 = join15(path, entry.name);
6394
6539
  try {
6395
6540
  bytes += entry.isDirectory() ? directoryBytes(child2) : statSync4(child2).size;
6396
6541
  } catch {
@@ -6408,7 +6553,7 @@ function trackSegmentFramePeak(frames, rootDir, onPeak) {
6408
6553
  ...worker,
6409
6554
  async prepare(segment) {
6410
6555
  await worker.prepare(segment);
6411
- const held = directoryBytes(join13(rootDir, "segment-frames"));
6556
+ const held = directoryBytes(join15(rootDir, "segment-frames"));
6412
6557
  if (held > peak) {
6413
6558
  peak = held;
6414
6559
  onPeak(peak);
@@ -6419,94 +6564,6 @@ function trackSegmentFramePeak(frames, rootDir, onPeak) {
6419
6564
  };
6420
6565
  }
6421
6566
 
6422
- // ../producer/src/services/render/segmentManifest.ts
6423
- import { createHash as createHash2 } from "crypto";
6424
- import { existsSync as existsSync8, mkdirSync as mkdirSync6, readFileSync as readFileSync4, statSync as statSync5, writeFileSync as writeFileSync3 } from "fs";
6425
- import { join as join14 } from "path";
6426
- var MANIFEST_FILENAME = "segments.json";
6427
- function computeSegmentPlanHash(input) {
6428
- const ordered = [
6429
- input.compositionHash,
6430
- input.cliVersion,
6431
- String(input.totalFrames),
6432
- String(input.segmentFrames),
6433
- `${input.fps.num}/${input.fps.den}`,
6434
- `${input.width}x${input.height}`,
6435
- input.codec,
6436
- input.preset,
6437
- input.quality === void 0 ? "" : String(input.quality),
6438
- input.bitrate ?? "",
6439
- input.pixelFormat ?? "",
6440
- input.imageFormat,
6441
- input.useGpu ? "gpu" : "cpu",
6442
- `${input.outputWidth}x${input.outputHeight}`,
6443
- input.motionBlur,
6444
- input.pageMotionBlur ?? "",
6445
- input.captureQuality === void 0 ? "" : String(input.captureQuality)
6446
- ];
6447
- const delivery = [input.maxBitrate, input.bufferSize, input.gopSize].map((v) => v ?? "");
6448
- if (delivery.some((v) => v !== "")) ordered.push(...delivery.map(String));
6449
- return createHash2("sha256").update(ordered.join(" ")).digest("hex").slice(0, 16);
6450
- }
6451
- function segmentDirFor(projectRendersDir, planHash) {
6452
- return join14(projectRendersDir, ".hf-segments", planHash);
6453
- }
6454
- function hasNumber(value, key) {
6455
- return key in value && typeof Reflect.get(value, key) === "number";
6456
- }
6457
- function hasString(value, key) {
6458
- return key in value && typeof Reflect.get(value, key) === "string";
6459
- }
6460
- function isEntry(value) {
6461
- if (typeof value !== "object" || value === null) return false;
6462
- return hasNumber(value, "index") && hasNumber(value, "startFrame") && hasNumber(value, "endFrame") && hasString(value, "path") && hasNumber(value, "bytes") && hasString(value, "completedAt");
6463
- }
6464
- function isManifest(value) {
6465
- if (typeof value !== "object" || value === null) return false;
6466
- const completed = Reflect.get(value, "completed");
6467
- return Reflect.get(value, "version") === 1 && hasString(value, "planHash") && hasNumber(value, "totalFrames") && hasNumber(value, "segmentFrames") && Array.isArray(completed) && completed.every(isEntry);
6468
- }
6469
- function readSegmentManifest(segmentDir) {
6470
- const path = join14(segmentDir, MANIFEST_FILENAME);
6471
- if (!existsSync8(path)) return null;
6472
- try {
6473
- const parsed = JSON.parse(readFileSync4(path, "utf-8"));
6474
- return isManifest(parsed) ? parsed : null;
6475
- } catch {
6476
- return null;
6477
- }
6478
- }
6479
- function writeSegmentManifest(segmentDir, manifest) {
6480
- mkdirSync6(segmentDir, { recursive: true });
6481
- const tmp = join14(segmentDir, `${MANIFEST_FILENAME}.${process.pid}.tmp`);
6482
- writeFileSync3(tmp, JSON.stringify(manifest, null, 2), "utf-8");
6483
- renameWithRetry(tmp, join14(segmentDir, MANIFEST_FILENAME));
6484
- }
6485
- async function probeSegmentFrameCount(path, probe) {
6486
- try {
6487
- const meta = await probe(path);
6488
- if (!Number.isFinite(meta.videoStreamDurationSeconds) || !Number.isFinite(meta.fps))
6489
- return null;
6490
- if (meta.fps <= 0) return null;
6491
- return Math.round(meta.videoStreamDurationSeconds * meta.fps);
6492
- } catch {
6493
- return null;
6494
- }
6495
- }
6496
- async function validateCompletedSegments(manifest, expectedHash, probeFrames) {
6497
- const ok = /* @__PURE__ */ new Set();
6498
- if (manifest.planHash !== expectedHash) return ok;
6499
- for (const entry of manifest.completed) {
6500
- if (!existsSync8(entry.path)) continue;
6501
- const size = statSync5(entry.path).size;
6502
- if (size <= 0 || size !== entry.bytes) continue;
6503
- const frames = await probeFrames(entry.path);
6504
- if (frames !== entry.endFrame - entry.startFrame) continue;
6505
- ok.add(entry.index);
6506
- }
6507
- return ok;
6508
- }
6509
-
6510
6567
  // ../producer/src/services/render/hdrMode.ts
6511
6568
  function formatDowngradeWarning(outputFormat, forcedHdrWithoutSources) {
6512
6569
  const hdrSourceReason = forcedHdrWithoutSources ? "HDR was forced without detected HDR sources" : "HDR source detected";
@@ -7082,10 +7139,10 @@ function requireOutputDimensions(expected, width, height) {
7082
7139
 
7083
7140
  // ../producer/src/services/render/stages/compileStage.ts
7084
7141
  import { existsSync as existsSync12, writeFileSync as writeFileSync4 } from "fs";
7085
- import { join as join18, relative as relative4 } from "path";
7142
+ import { join as join19, relative as relative4 } from "path";
7086
7143
 
7087
7144
  // ../producer/src/services/compositionSizeLimit.ts
7088
- import { statSync as statSync6 } from "fs";
7145
+ import { statSync as statSync5 } from "fs";
7089
7146
  var MAX_COMPOSITION_HTML_BYTES = 16 * 1024 * 1024;
7090
7147
  var COMPOSITION_TOO_LARGE = "COMPOSITION_TOO_LARGE";
7091
7148
  var megabytes = (bytes) => `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
@@ -7161,7 +7218,7 @@ var CompositionExpansionBudget = class {
7161
7218
  function assertCompositionFileSize(path, file) {
7162
7219
  let bytes;
7163
7220
  try {
7164
- const stats = statSync6(path);
7221
+ const stats = statSync5(path);
7165
7222
  if (!stats.isFile()) return;
7166
7223
  bytes = stats.size;
7167
7224
  } catch {
@@ -7172,17 +7229,17 @@ function assertCompositionFileSize(path, file) {
7172
7229
 
7173
7230
  // ../producer/src/services/htmlCompiler.ts
7174
7231
  import { createHash as createHash4 } from "crypto";
7175
- import { createReadStream as createReadStream2, existsSync as existsSync11, mkdirSync as mkdirSync7, readFileSync as readFileSync6 } from "fs";
7176
- import { join as join17, dirname as dirname7, resolve as resolve6, basename as basename5, relative as relative3, sep as sep3 } from "path";
7232
+ import { createReadStream as createReadStream3, existsSync as existsSync11, mkdirSync as mkdirSync7, readFileSync as readFileSync6 } from "fs";
7233
+ import { join as join18, dirname as dirname7, resolve as resolve6, basename as basename5, relative as relative3, sep as sep3 } from "path";
7177
7234
 
7178
7235
  // ../producer/src/services/bundledScripts.ts
7179
7236
  import { existsSync as existsSync9, readFileSync as readFileSync5 } from "fs";
7180
- import { join as join15 } from "path";
7237
+ import { join as join16 } from "path";
7181
7238
  var GSAP_VENDOR_DIR_ENV = "HYPERFRAMES_GSAP_VENDOR_DIR";
7182
7239
  function bundledScript(url) {
7183
7240
  const dir = process.env[GSAP_VENDOR_DIR_ENV];
7184
7241
  if (!dir || url !== `${gsapCdnDist()}gsap.min.js`) return null;
7185
- const file = join15(dir, "gsap.min.js");
7242
+ const file = join16(dir, "gsap.min.js");
7186
7243
  return existsSync9(file) ? readFileSync5(file) : null;
7187
7244
  }
7188
7245
 
@@ -7334,7 +7391,7 @@ function getPositionEditsRenderScript() {
7334
7391
 
7335
7392
  // ../producer/src/services/assetMediaType.ts
7336
7393
  import { existsSync as existsSync10 } from "fs";
7337
- import { dirname as dirname6, join as join16 } from "path";
7394
+ import { dirname as dirname6, join as join17 } from "path";
7338
7395
  var ASSET_MEDIA_TYPE_MISMATCH = "ASSET_MEDIA_TYPE_MISMATCH";
7339
7396
  var AssetMediaTypeMismatchError = class extends Error {
7340
7397
  // fallow-ignore-next-line unused-class-member
@@ -7375,11 +7432,11 @@ function assertAssetMediaTypeProfile(expected, profile, elementIdentity) {
7375
7432
  ]);
7376
7433
  }
7377
7434
  function mediaAssetRoots(projectDir, compiledDir) {
7378
- return [projectDir, compiledDir, join16(dirname6(compiledDir), "downloads")];
7435
+ return [projectDir, compiledDir, join17(dirname6(compiledDir), "downloads")];
7379
7436
  }
7380
7437
  function dropMediaOutsideProject(input) {
7381
7438
  const { projectDir, workDir, composition, log } = input;
7382
- const compiledDir = join16(workDir, "compiled");
7439
+ const compiledDir = join17(workDir, "compiled");
7383
7440
  const roots = mediaAssetRoots(projectDir, compiledDir);
7384
7441
  const staysInside = ({ id, src }) => {
7385
7442
  if (!src || isHttpUrl(src)) return true;
@@ -7730,7 +7787,7 @@ function detectShaderTransitionUsage(html) {
7730
7787
  async function resolveMediaDuration(src, mediaStart, playbackRate, projectDir, baseDir, downloadDir, tagName, elementIdentity, log, urlByAbsentLocalPath, probes, assetRoot) {
7731
7788
  let filePath = src;
7732
7789
  if (isHttpUrl(src)) {
7733
- const remoteDir = join17(downloadDir, REMOTE_MEDIA_SUBDIR);
7790
+ const remoteDir = join18(downloadDir, REMOTE_MEDIA_SUBDIR);
7734
7791
  if (!existsSync11(remoteDir)) mkdirSync7(remoteDir, { recursive: true });
7735
7792
  try {
7736
7793
  filePath = await downloadToTemp(src, remoteDir, void 0, void 0, void 0, {
@@ -7741,7 +7798,7 @@ async function resolveMediaDuration(src, mediaStart, playbackRate, projectDir, b
7741
7798
  }
7742
7799
  } else {
7743
7800
  filePath = decodedUrlPath(src);
7744
- if (!filePath.startsWith("/")) filePath = join17(baseDir, filePath);
7801
+ if (!filePath.startsWith("/")) filePath = join18(baseDir, filePath);
7745
7802
  if (escapesAssetRoot(filePath, assetRoot) || isPrivateUnderAssetRoots(filePath, [projectDir, downloadDir])) {
7746
7803
  return { duration: null, resolvedPath: filePath };
7747
7804
  }
@@ -8475,7 +8532,7 @@ async function localizeRemoteMediaSources(html, downloadDir) {
8475
8532
  const localized = await downloadAndRewriteUrls(
8476
8533
  urlSet,
8477
8534
  html,
8478
- join17(downloadDir, REMOTE_MEDIA_SUBDIR),
8535
+ join18(downloadDir, REMOTE_MEDIA_SUBDIR),
8479
8536
  "Remote media download failed",
8480
8537
  "Localized remote media source(s)"
8481
8538
  );
@@ -8498,7 +8555,7 @@ async function localizeRemoteImageSources(html, downloadDir) {
8498
8555
  return downloadAndRewriteUrls(
8499
8556
  urlSet,
8500
8557
  html,
8501
- join17(downloadDir, REMOTE_MEDIA_SUBDIR),
8558
+ join18(downloadDir, REMOTE_MEDIA_SUBDIR),
8502
8559
  "Remote image download failed",
8503
8560
  "Localized remote image source(s)"
8504
8561
  );
@@ -8511,7 +8568,7 @@ async function localizeRemoteBackgroundImages(html, downloadDir) {
8511
8568
  return downloadAndRewriteUrls(
8512
8569
  urlSet,
8513
8570
  html,
8514
- join17(downloadDir, REMOTE_MEDIA_SUBDIR),
8571
+ join18(downloadDir, REMOTE_MEDIA_SUBDIR),
8515
8572
  "Remote background-image download failed",
8516
8573
  "Localized remote background-image(s)",
8517
8574
  // Quoted url('..')/url("..") are rewritten by downloadAndRewriteUrls' default
@@ -8667,7 +8724,7 @@ function localizeFontFaceUrls(html, downloadDir) {
8667
8724
  return downloadAndRewriteUrls(
8668
8725
  collectFontFaceUrls(html),
8669
8726
  html,
8670
- join17(downloadDir, REMOTE_MEDIA_SUBDIR),
8727
+ join18(downloadDir, REMOTE_MEDIA_SUBDIR),
8671
8728
  "Remote font download failed",
8672
8729
  "Localized remote font face(s)",
8673
8730
  (h, url, relPath) => h.replaceAll(`url(${url})`, `url("${relPath}")`)
@@ -8677,7 +8734,7 @@ var MAX_LOCAL_FONT_DATA_URI_BYTES = 5 * 1024 * 1024;
8677
8734
  async function readLocalFont(absPath) {
8678
8735
  const chunks = [];
8679
8736
  let totalBytes = 0;
8680
- for await (const chunk of createReadStream2(absPath)) {
8737
+ for await (const chunk of createReadStream3(absPath)) {
8681
8738
  const buffer = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
8682
8739
  totalBytes += buffer.length;
8683
8740
  if (totalBytes > MAX_LOCAL_FONT_DATA_URI_BYTES) {
@@ -8930,14 +8987,7 @@ async function compileForRender(projectDir, htmlPath, downloadDir, options = {})
8930
8987
  abortSignal: options.abortSignal
8931
8988
  });
8932
8989
  const assembledHtml = await inlineExternalScripts(coalescedHtml, budget);
8933
- const HF_POSITION_ATTRS = [
8934
- 'data-hf-studio-path-offset="true"',
8935
- 'data-hf-studio-box-size="true"',
8936
- 'data-hf-studio-rotation="true"',
8937
- 'data-hf-studio-motion="'
8938
- ];
8939
- const hasPositionEdits = HF_POSITION_ATTRS.some((attr) => assembledHtml.includes(attr));
8940
- const htmlWithPositionScript = hasPositionEdits ? insertBeforeCloseTag(
8990
+ const htmlWithPositionScript = htmlHasStudioPositionEdits(assembledHtml) ? insertBeforeCloseTag(
8941
8991
  assembledHtml,
8942
8992
  "body",
8943
8993
  `<script>${createStudioPositionSeekReapplyScript()}
@@ -9437,7 +9487,7 @@ async function recompileWithResolutions(compiled, resolutions, projectDir, downl
9437
9487
  function animatedGifCacheDir(extractCacheDir) {
9438
9488
  try {
9439
9489
  const root = extractCacheDir && privateCacheRoot(extractCacheDir);
9440
- return root ? join18(root, "animated-gif") : void 0;
9490
+ return root ? join19(root, "animated-gif") : void 0;
9441
9491
  } catch {
9442
9492
  return void 0;
9443
9493
  }
@@ -9465,10 +9515,10 @@ function resolveEntryHtmlPath(input) {
9465
9515
  assertCompositionFileSize(path, relative4(projectDir, path));
9466
9516
  return readTextFile(path);
9467
9517
  };
9468
- const htmlPath = join18(projectDir, entryFile);
9518
+ const htmlPath = join19(projectDir, entryFile);
9469
9519
  const rawEntry = readEntry(htmlPath);
9470
9520
  if (entryFile === "index.html" || !isTemplateEntry(rawEntry)) return htmlPath;
9471
- const projectIndexPath = join18(projectDir, "index.html");
9521
+ const projectIndexPath = join19(projectDir, "index.html");
9472
9522
  if (!existsSync12(projectIndexPath)) {
9473
9523
  throw new Error(
9474
9524
  `Template entry file "${entryFile}" requires a project index.html to extract its render shell.`
@@ -9484,7 +9534,7 @@ function resolveEntryHtmlPath(input) {
9484
9534
  `Entry file "${entryFile}" is not mounted from index.html via data-composition-src, so it cannot be rendered independently.`
9485
9535
  );
9486
9536
  }
9487
- const wrapperPath = join18(workDir, "standalone-entry.html");
9537
+ const wrapperPath = join19(workDir, "standalone-entry.html");
9488
9538
  writeFileSync4(wrapperPath, standaloneHtml, "utf-8");
9489
9539
  log.info("Extracted standalone entry from index.html host context", { entryFile });
9490
9540
  return wrapperPath;
@@ -9514,7 +9564,7 @@ async function runCompileStage(input) {
9514
9564
  const assetRoot = job.config.allowOutsideProjectAssets ? void 0 : projectDir;
9515
9565
  const htmlPath = resolveEntryHtmlPath({ projectDir, workDir, entryFile, log, assetRoot });
9516
9566
  const compileStart = Date.now();
9517
- const compiled = await compileForRender(projectDir, htmlPath, join18(workDir, "downloads"), {
9567
+ const compiled = await compileForRender(projectDir, htmlPath, join19(workDir, "downloads"), {
9518
9568
  log,
9519
9569
  failClosedFontFetch: failClosedFontFetch === true,
9520
9570
  allowSystemFontCapture,
@@ -9589,7 +9639,7 @@ async function runCompileStage(input) {
9589
9639
  });
9590
9640
  await preflightCompositionAssetMediaTypes({
9591
9641
  projectDir,
9592
- compiledDir: join18(workDir, "compiled"),
9642
+ compiledDir: join19(workDir, "compiled"),
9593
9643
  composition,
9594
9644
  signal: abortSignal
9595
9645
  });
@@ -9637,7 +9687,7 @@ async function runCompileStage(input) {
9637
9687
 
9638
9688
  // ../producer/src/services/render/stages/probeStage.ts
9639
9689
  import { createHash as createHash5 } from "crypto";
9640
- import { basename as basename6, join as join19 } from "path";
9690
+ import { basename as basename6, join as join20 } from "path";
9641
9691
 
9642
9692
  // ../producer/src/services/render/stages/probeFailures.ts
9643
9693
  var NETWORK_FAILURE_PATTERN = /404|ERR_NAME_NOT_RESOLVED|ERR_CONNECTION_REFUSED|net::ERR_/i;
@@ -9926,7 +9976,7 @@ async function runProbeStage(input) {
9926
9976
  });
9927
9977
  fileServer = await createFileServer({
9928
9978
  projectDir,
9929
- compiledDir: join19(workDir, "compiled"),
9979
+ compiledDir: join20(workDir, "compiled"),
9930
9980
  port: 0,
9931
9981
  preHeadScripts: [VIRTUAL_TIME_SHIM],
9932
9982
  fps: job.config.fps,
@@ -9963,7 +10013,7 @@ async function runProbeStage(input) {
9963
10013
  log.info("Creating capture session...", { attempt, maxAttempts: PROBE_MAX_ATTEMPTS });
9964
10014
  probeSession = await createCaptureSession(
9965
10015
  fileServer.url,
9966
- join19(workDir, "probe"),
10016
+ join20(workDir, "probe"),
9967
10017
  captureOpts,
9968
10018
  null,
9969
10019
  probeCfg
@@ -10048,7 +10098,7 @@ async function runProbeStage(input) {
10048
10098
  });
10049
10099
  probeSession = await createCaptureSession(
10050
10100
  fileServer.url,
10051
- join19(workDir, "probe-screenshot"),
10101
+ join20(workDir, "probe-screenshot"),
10052
10102
  captureOpts,
10053
10103
  null,
10054
10104
  { ...probeCfg, forceScreenshot: true }
@@ -10086,7 +10136,7 @@ async function runProbeStage(input) {
10086
10136
  compiled,
10087
10137
  resolutions,
10088
10138
  projectDir,
10089
- join19(workDir, "downloads"),
10139
+ join20(workDir, "downloads"),
10090
10140
  job.config.allowOutsideProjectAssets ? void 0 : projectDir,
10091
10141
  { includeScripts: job.config.includeOutsideScripts }
10092
10142
  );
@@ -10286,7 +10336,7 @@ async function runProbeStage(input) {
10286
10336
  });
10287
10337
  await preflightCompositionAssetMediaTypes({
10288
10338
  projectDir,
10289
- compiledDir: join19(workDir, "compiled"),
10339
+ compiledDir: join20(workDir, "compiled"),
10290
10340
  composition,
10291
10341
  signal: abortSignal
10292
10342
  });
@@ -10445,7 +10495,7 @@ function validateDistributedDuration(input) {
10445
10495
 
10446
10496
  // ../producer/src/services/render/stages/extractVideosStage.ts
10447
10497
  import { existsSync as existsSync13 } from "fs";
10448
- import { join as join20 } from "path";
10498
+ import { join as join21 } from "path";
10449
10499
 
10450
10500
  // ../producer/src/services/render/extractionFailureMetadata.ts
10451
10501
  function stringOrEmpty(value) {
@@ -10785,7 +10835,7 @@ async function runExtractVideosStage(input) {
10785
10835
  // because short boundary counts can differ by one frame.
10786
10836
  {
10787
10837
  fps: job.config.fps,
10788
- outputDir: join20(compiledDir, "__hyperframes_video_frames"),
10838
+ outputDir: join21(compiledDir, "__hyperframes_video_frames"),
10789
10839
  format: job.config.videoFrameFormat ?? "auto",
10790
10840
  toneMapHdrToSdr: rendersSdrOnly(job.config, composition),
10791
10841
  timelineEnd: composition.duration,
@@ -10793,7 +10843,7 @@ async function runExtractVideosStage(input) {
10793
10843
  collectProbeFailures: extractionPolicy.failureMode === "enforce",
10794
10844
  deferRangeExtraction,
10795
10845
  shownBoxes,
10796
- contentKeyedDirs: [join20(compiledDir, REMOTE_MEDIA_SUBDIR)],
10846
+ contentKeyedDirs: [join21(compiledDir, REMOTE_MEDIA_SUBDIR)],
10797
10847
  urlByAbsentLocalPath,
10798
10848
  assetRoots,
10799
10849
  onProgress: ({ planned = 0, done = 0 }) => {
@@ -10885,7 +10935,7 @@ async function remoteProbeSource(video, input) {
10885
10935
  if (!isPublicHttpsUrl(video.src)) return null;
10886
10936
  if (!resolveRestrictPageNetwork()) return video.src;
10887
10937
  if (!video.hasAudio || video.hidden) return null;
10888
- const downloadDir = input.downloadDir ?? join20(input.compiledDir, REMOTE_MEDIA_SUBDIR);
10938
+ const downloadDir = input.downloadDir ?? join21(input.compiledDir, REMOTE_MEDIA_SUBDIR);
10889
10939
  try {
10890
10940
  return await downloadToTemp(video.src, downloadDir, void 0, input.signal, void 0, {
10891
10941
  onTelemetry: writeUrlDownloadTelemetry
@@ -11004,15 +11054,15 @@ async function planVideoLayerPassthrough(input) {
11004
11054
 
11005
11055
  // ../producer/src/services/render/stages/audioStage.ts
11006
11056
  import { existsSync as existsSync16 } from "fs";
11007
- import { join as join23 } from "path";
11057
+ import { join as join24 } from "path";
11008
11058
 
11009
11059
  // ../producer/src/services/render/audioDeliveryLimit.ts
11010
11060
  import { existsSync as existsSync15 } from "fs";
11011
- import { dirname as dirname9, join as join22 } from "path";
11061
+ import { dirname as dirname9, join as join23 } from "path";
11012
11062
 
11013
11063
  // ../producer/src/services/render/audioPadTrim.ts
11014
11064
  import { spawn } from "child_process";
11015
- import { dirname as dirname8, join as join21 } from "path";
11065
+ import { dirname as dirname8, join as join22 } from "path";
11016
11066
 
11017
11067
  // ../producer/src/services/render/audioTruePeak.ts
11018
11068
  var toDbfs = (token) => token.toLowerCase() === "-inf" ? Number.NEGATIVE_INFINITY : Number(token);
@@ -11272,7 +11322,7 @@ async function constrainAacTruePeak(input) {
11272
11322
  }
11273
11323
  async function cutSource(input, scratchDir, attenuationDb) {
11274
11324
  if (!input.sourcePath || !input.rewriteSource) return true;
11275
- const cutPath = join21(scratchDir, "source.wav");
11325
+ const cutPath = join22(scratchDir, "source.wav");
11276
11326
  try {
11277
11327
  const result = await input.rewriteSource(input.sourcePath, cutPath, gainFilter(attenuationDb));
11278
11328
  if (!result.success) throw new Error(result.error);
@@ -11287,7 +11337,7 @@ async function enforceAacTruePeak(input) {
11287
11337
  let scratchDir;
11288
11338
  try {
11289
11339
  scratchDir = createStagingDir(dirname8(input.audioPath), ".true-peak-");
11290
- const correctedPath = join21(scratchDir, "audio.m4a");
11340
+ const correctedPath = join22(scratchDir, "audio.m4a");
11291
11341
  const measurements = [];
11292
11342
  let attenuationDb = 0;
11293
11343
  let sourcePeakDbfs;
@@ -11507,7 +11557,7 @@ async function limitDeliveryPeaks(input, deps = {
11507
11557
  const peak = await deps.measure(audioPath, { timeoutMs, signal });
11508
11558
  if (peak <= AAC_DELIVERY_TRUE_PEAK_DBFS) return { success: true };
11509
11559
  const alternating = ["a", "b"].map(
11510
- (k) => join22(dirname9(sourcePath), `audio-source-limited-${k}.wav`)
11560
+ (k) => join23(dirname9(sourcePath), `audio-source-limited-${k}.wav`)
11511
11561
  );
11512
11562
  let encodedFrom;
11513
11563
  let ceiling = AAC_DELIVERY_TRUE_PEAK_DBFS;
@@ -11580,7 +11630,7 @@ function runAudioStage(input) {
11580
11630
  }
11581
11631
  async function runAudioStageScoped(input) {
11582
11632
  const stageStart = Date.now();
11583
- const pcmSourcePath = join23(input.workDir, "audio-source.wav");
11633
+ const pcmSourcePath = join24(input.workDir, "audio-source.wav");
11584
11634
  const duration = input.totalFrames * input.fps.den / input.fps.num;
11585
11635
  let deliverySourcePath;
11586
11636
  try {
@@ -11645,7 +11695,7 @@ async function mixAudioForDelivery(input, duration, pcmSourcePath) {
11645
11695
  assertNotAborted,
11646
11696
  log
11647
11697
  } = input;
11648
- const audioOutputPath = join23(workDir, MIXED_AUDIO_FILENAME);
11698
+ const audioOutputPath = join24(workDir, MIXED_AUDIO_FILENAME);
11649
11699
  let hasAudio = false;
11650
11700
  let audioError;
11651
11701
  let audioFailures;
@@ -11726,7 +11776,7 @@ async function mixAudioForDelivery(input, duration, pcmSourcePath) {
11726
11776
 
11727
11777
  // ../producer/src/services/render/stages/captureStage.ts
11728
11778
  import { existsSync as existsSync17, readdirSync as readdirSync4, statfsSync as statfsSync2 } from "fs";
11729
- import { join as join24 } from "path";
11779
+ import { join as join25 } from "path";
11730
11780
  function shouldAllowAdaptiveCaptureRetry(workerCount, _explicitlyConfigured) {
11731
11781
  return workerCount > 1;
11732
11782
  }
@@ -11785,13 +11835,13 @@ function measureCaptureFrameBytes(workDir, framesDir) {
11785
11835
  if (!existsSync17(workDir)) return total;
11786
11836
  for (const attempt of readdirSync4(workDir)) {
11787
11837
  if (/^retry-\d+-batch-\d+-worker-\d+$/.test(attempt)) {
11788
- total += sampleDirectoryBytes(join24(workDir, attempt));
11838
+ total += sampleDirectoryBytes(join25(workDir, attempt));
11789
11839
  continue;
11790
11840
  }
11791
11841
  if (!/^capture-attempt-\d+$/.test(attempt)) continue;
11792
- const attemptDir = join24(workDir, attempt);
11842
+ const attemptDir = join25(workDir, attempt);
11793
11843
  for (const name of readdirSync4(attemptDir)) {
11794
- if (/^worker-\d+$/.test(name)) total += sampleDirectoryBytes(join24(attemptDir, name));
11844
+ if (/^worker-\d+$/.test(name)) total += sampleDirectoryBytes(join25(attemptDir, name));
11795
11845
  }
11796
11846
  }
11797
11847
  return total;
@@ -12090,7 +12140,7 @@ async function captureSessionFrames(session, { input, rangeStart, rangeEnd, resu
12090
12140
 
12091
12141
  // ../producer/src/services/render/stages/captureHdrStage.ts
12092
12142
  import { existsSync as existsSync19, mkdirSync as mkdirSync8 } from "fs";
12093
- import { join as join28 } from "path";
12143
+ import { join as join29 } from "path";
12094
12144
 
12095
12145
  // ../producer/src/services/hdrImageTransferCache.ts
12096
12146
  var DEFAULT_MAX_BYTES = 200 * 1024 * 1024;
@@ -12152,7 +12202,7 @@ function createHdrImageTransferCache(options = {}) {
12152
12202
  }
12153
12203
 
12154
12204
  // ../producer/src/services/render/stages/captureHdrSequentialLoop.ts
12155
- import { join as join25 } from "path";
12205
+ import { join as join26 } from "path";
12156
12206
  async function runSequentialLayeredFrameLoop(input) {
12157
12207
  const {
12158
12208
  job,
@@ -12273,7 +12323,7 @@ async function runSequentialLayeredFrameLoop(input) {
12273
12323
  );
12274
12324
  if (debugDumpEnabled && debugDumpDir && i % 30 === 0) {
12275
12325
  writeFileExclusiveSync(
12276
- join25(debugDumpDir, `frame_${String(i).padStart(4, "0")}_final_rgb48le.bin`),
12326
+ join26(debugDumpDir, `frame_${String(i).padStart(4, "0")}_final_rgb48le.bin`),
12277
12327
  normalCanvas
12278
12328
  );
12279
12329
  }
@@ -12305,12 +12355,12 @@ async function runSequentialLayeredFrameLoop(input) {
12305
12355
  }
12306
12356
 
12307
12357
  // ../producer/src/services/render/stages/captureHdrHybridLoop.ts
12308
- import { join as join27 } from "path";
12358
+ import { join as join28 } from "path";
12309
12359
 
12310
12360
  // ../producer/src/services/shaderTransitionWorkerPool.ts
12311
12361
  import { Worker } from "worker_threads";
12312
12362
  import { fileURLToPath as fileURLToPath2, pathToFileURL } from "url";
12313
- import { dirname as dirname10, join as join26 } from "path";
12363
+ import { dirname as dirname10, join as join27 } from "path";
12314
12364
  import { createRequire } from "module";
12315
12365
  import { existsSync as existsSync18 } from "fs";
12316
12366
  function resolveWorkerEntry(explicit) {
@@ -12323,9 +12373,9 @@ function resolveWorkerEntry(explicit) {
12323
12373
  return { path: override, isTs };
12324
12374
  }
12325
12375
  const moduleDir = dirname10(fileURLToPath2(import.meta.url));
12326
- const jsPath = join26(moduleDir, "shaderTransitionWorker.js");
12376
+ const jsPath = join27(moduleDir, "shaderTransitionWorker.js");
12327
12377
  if (existsSync18(jsPath)) return { path: jsPath, isTs: false };
12328
- const tsPath = join26(moduleDir, "shaderTransitionWorker.ts");
12378
+ const tsPath = join27(moduleDir, "shaderTransitionWorker.ts");
12329
12379
  return { path: tsPath, isTs: true };
12330
12380
  }
12331
12381
  function buildExecArgv(entryIsTs) {
@@ -12693,7 +12743,7 @@ async function runHybridLayeredFrameLoop(input) {
12693
12743
  );
12694
12744
  if (debugDumpEnabled && debugDumpDir && i % 30 === 0) {
12695
12745
  writeFileExclusiveSync(
12696
- join27(debugDumpDir, `frame_${String(i).padStart(4, "0")}_final_rgb48le.bin`),
12746
+ join28(debugDumpDir, `frame_${String(i).padStart(4, "0")}_final_rgb48le.bin`),
12697
12747
  canvas
12698
12748
  );
12699
12749
  }
@@ -12889,7 +12939,7 @@ async function runCaptureHdrStage(input) {
12889
12939
  if (hdrVideoFrameSources.has(v.id)) hdrVideoEndTimes.set(v.id, v.end);
12890
12940
  }
12891
12941
  const debugDumpEnabled = process.env.KEEP_TEMP === "1";
12892
- const debugDumpDir = debugDumpEnabled ? join28(framesDir, "debug-composite") : null;
12942
+ const debugDumpDir = debugDumpEnabled ? join29(framesDir, "debug-composite") : null;
12893
12943
  if (debugDumpDir && !existsSync19(debugDumpDir)) {
12894
12944
  mkdirSync8(debugDumpDir, { recursive: true });
12895
12945
  }
@@ -13054,11 +13104,11 @@ import {
13054
13104
  readdirSync as readdirSync5,
13055
13105
  readFileSync as readFileSync7,
13056
13106
  rmSync as rmSync9,
13057
- statSync as statSync7,
13107
+ statSync as statSync6,
13058
13108
  writeFileSync as writeFileSync5
13059
13109
  } from "fs";
13060
13110
  import { readFile as readFile2 } from "fs/promises";
13061
- import { dirname as dirname11, join as join29 } from "path";
13111
+ import { dirname as dirname11, join as join30 } from "path";
13062
13112
 
13063
13113
  // ../producer/src/services/render/stages/gifEncodeArgs.ts
13064
13114
  function fpsToFfmpegArg2(fps) {
@@ -13168,7 +13218,7 @@ async function encodeGifFromDir(framesDir, framePattern, outputPath, input) {
13168
13218
  const failure = await reencodeWithClearedWholeFrames(argsInput, run, startTime);
13169
13219
  if (failure) return failure;
13170
13220
  }
13171
- const fileSize = existsSync20(outputPath) ? statSync7(outputPath).size : 0;
13221
+ const fileSize = existsSync20(outputPath) ? statSync6(outputPath).size : 0;
13172
13222
  return {
13173
13223
  success: true,
13174
13224
  outputPath,
@@ -13262,7 +13312,7 @@ function encodeWhileCapturing(input, totalFrames, captureBudget) {
13262
13312
  await new Promise((resolve12) => wake = resolve12);
13263
13313
  }
13264
13314
  if (signal.aborted) return;
13265
- const mergedPath = join29(input.framesDir, formatCaptureFrameName(next, "jpg"));
13315
+ const mergedPath = join30(input.framesDir, formatCaptureFrameName(next, "jpg"));
13266
13316
  const frame = await readLandedFrame(landed.get(next), mergedPath);
13267
13317
  landed.delete(next);
13268
13318
  if (!await stream.writeFrame(frame)) {
@@ -13345,11 +13395,11 @@ async function runEncodeStage(input) {
13345
13395
  );
13346
13396
  }
13347
13397
  captured.forEach((name, i) => {
13348
- const dst = join29(outputPath, formatExportFrameName(i, "png"));
13349
- copyFileSync2(join29(framesDir, name), dst);
13398
+ const dst = join30(outputPath, formatExportFrameName(i, "png"));
13399
+ copyFileSync2(join30(framesDir, name), dst);
13350
13400
  });
13351
13401
  if (hasAudio && audioOutputPath && existsSync20(audioOutputPath)) {
13352
- copyFileSync2(audioOutputPath, join29(outputPath, MIXED_AUDIO_FILENAME));
13402
+ copyFileSync2(audioOutputPath, join30(outputPath, MIXED_AUDIO_FILENAME));
13353
13403
  log.info(
13354
13404
  `[Render] png-sequence: ${MIXED_AUDIO_FILENAME} sidecar written to ${outputPath}/${MIXED_AUDIO_FILENAME}`
13355
13405
  );
@@ -13369,7 +13419,7 @@ async function runEncodeStage(input) {
13369
13419
  const encodeResult2 = await encodeGifFromDir(framesDir, framePattern2, outputPath, {
13370
13420
  fps: job.config.fps,
13371
13421
  loop,
13372
- palettePath: join29(dirname11(videoOnlyPath), "gif-palette.png"),
13422
+ palettePath: join30(dirname11(videoOnlyPath), "gif-palette.png"),
13373
13423
  preserveAlpha: needsAlpha,
13374
13424
  signal: abortSignal,
13375
13425
  timeout: engineCfg.ffmpegEncodeTimeout
@@ -13579,9 +13629,9 @@ function sampleDirectoryBytes(dir) {
13579
13629
  continue;
13580
13630
  }
13581
13631
  for (const name of entries) {
13582
- const full = join30(current, name);
13632
+ const full = join31(current, name);
13583
13633
  try {
13584
- const st = statSync8(full);
13634
+ const st = statSync7(full);
13585
13635
  if (st.isDirectory()) {
13586
13636
  stack.push(full);
13587
13637
  } else if (st.isFile()) {
@@ -13737,8 +13787,8 @@ function findMissingFrameRanges(totalFrames, framesDir, frameExt) {
13737
13787
  const ranges = [];
13738
13788
  let rangeStart = null;
13739
13789
  for (let frameIndex = 0; frameIndex < totalFrames; frameIndex++) {
13740
- const framePath = join30(framesDir, formatCaptureFrameName(frameIndex, frameExt));
13741
- const missing = !existsSync21(framePath) || statSync8(framePath).size <= 8;
13790
+ const framePath = join31(framesDir, formatCaptureFrameName(frameIndex, frameExt));
13791
+ const missing = !existsSync21(framePath) || statSync7(framePath).size <= 8;
13742
13792
  if (missing && rangeStart === null) {
13743
13793
  rangeStart = frameIndex;
13744
13794
  } else if (!missing && rangeStart !== null) {
@@ -13754,7 +13804,7 @@ function findMissingFrameRanges(totalFrames, framesDir, frameExt) {
13754
13804
  function buildMissingFrameRetryBatches(ranges, maxWorkers, workDir, attempt, rangeStart = 0, stride = 1) {
13755
13805
  const workersPerBatch = Math.max(1, Math.floor(maxWorkers));
13756
13806
  const batches = [];
13757
- const outputDirFor = (batchIndex, workerId) => join30(workDir, `retry-${attempt}-batch-${batchIndex}-worker-${workerId}`);
13807
+ const outputDirFor = (batchIndex, workerId) => join31(workDir, `retry-${attempt}-batch-${batchIndex}-worker-${workerId}`);
13758
13808
  if (stride > 1) {
13759
13809
  const spans = /* @__PURE__ */ new Map();
13760
13810
  for (const range of ranges) {
@@ -13814,8 +13864,8 @@ function getNextRetryWorkerCount(currentWorkers) {
13814
13864
  return Math.max(1, Math.floor(currentWorkers / 2));
13815
13865
  }
13816
13866
  function resolveRenderWorkDirPrefix(outputPath, jobId, platform2 = process.platform, systemTempDir = tmpdir3()) {
13817
- if (platform2 === "win32" || platform2 === "darwin") return join30(systemTempDir, "hf-render-");
13818
- return join30(dirname12(outputPath), `work-${jobId}-`);
13867
+ if (platform2 === "win32" || platform2 === "darwin") return join31(systemTempDir, "hf-render-");
13868
+ return join31(dirname12(outputPath), `work-${jobId}-`);
13819
13869
  }
13820
13870
  var MAX_TRANSIENT_CAPTURE_RETRIES = 1;
13821
13871
  function isTransientCaptureRetryEligible(failureKind, missing, retriesUsed) {
@@ -13870,7 +13920,7 @@ The composition is too large for the available memory. To reduce memory pressure
13870
13920
  function countCapturedFrames(totalFrames, framesDir, frameExt) {
13871
13921
  let captured = 0;
13872
13922
  for (let frameIndex = 0; frameIndex < totalFrames; frameIndex++) {
13873
- const framePath = join30(framesDir, formatCaptureFrameName(frameIndex, frameExt));
13923
+ const framePath = join31(framesDir, formatCaptureFrameName(frameIndex, frameExt));
13874
13924
  if (existsSync21(framePath)) captured++;
13875
13925
  }
13876
13926
  return captured;
@@ -13896,7 +13946,7 @@ async function executeDiskCaptureWithAdaptiveRetry(options) {
13896
13946
  reason: attempt === 0 ? "initial" : pendingTransientRetry ? "transient-retry" : "retry"
13897
13947
  });
13898
13948
  pendingTransientRetry = false;
13899
- const attemptWorkDir = join30(options.workDir, `capture-attempt-${attempt}`);
13949
+ const attemptWorkDir = join31(options.workDir, `capture-attempt-${attempt}`);
13900
13950
  const batches = missingRanges ? buildMissingFrameRetryBatches(
13901
13951
  missingRanges,
13902
13952
  currentWorkers,
@@ -14544,7 +14594,7 @@ function deVerifyFallbackTelemetry(err) {
14544
14594
  }
14545
14595
  function resolveRenderDebugDir() {
14546
14596
  const producerRoot = process.env.PRODUCER_RENDERS_DIR ? resolve7(process.env.PRODUCER_RENDERS_DIR, "..") : resolve7(dirname12(fileURLToPath3(import.meta.url)), "../..");
14547
- return join30(producerRoot, ".debug");
14597
+ return join31(producerRoot, ".debug");
14548
14598
  }
14549
14599
  async function executeRenderJob(job, projectDir, outputPath, progressSink, abortSignal, assertRenderActive) {
14550
14600
  validateHlsRenderConfig(job.config);
@@ -14553,10 +14603,10 @@ async function executeRenderJob(job, projectDir, outputPath, progressSink, abort
14553
14603
  const debugDir = resolveRenderDebugDir();
14554
14604
  const outputDir = dirname12(outputPath);
14555
14605
  if (!existsSync21(outputDir)) mkdirSync10(outputDir, { recursive: true });
14556
- const workDir = job.config.debug ? join30(debugDir, job.id) : createRenderWorkDir(resolveRenderWorkDirPrefix(outputPath, job.id), outputDir);
14606
+ const workDir = job.config.debug ? join31(debugDir, job.id) : createRenderWorkDir(resolveRenderWorkDirPrefix(outputPath, job.id), outputDir);
14557
14607
  const pipelineStart = Date.now();
14558
14608
  const baseLog = job.config.logger ?? defaultLogger;
14559
- const logPath = job.config.debug ? join30(workDir, "render.log") : null;
14609
+ const logPath = job.config.debug ? join31(workDir, "render.log") : null;
14560
14610
  const execution = new RenderExecutionContext({
14561
14611
  request: { renderJobId: job.id, projectDir, outputPath },
14562
14612
  logger: logPath ? createRenderFileLogger(logPath, baseLog) : baseLog,
@@ -14587,6 +14637,15 @@ async function executeRenderJob(job, projectDir, outputPath, progressSink, abort
14587
14637
  await execution.dispose();
14588
14638
  }
14589
14639
  }
14640
+ function loadResumeKeyOrWarn(resume, log) {
14641
+ const key = segmentManifestKey();
14642
+ if (resume && !key) {
14643
+ log.warn(
14644
+ "[Render] --resume: no preview token could be read or created, so every segment will be captured again"
14645
+ );
14646
+ }
14647
+ return key;
14648
+ }
14590
14649
  async function executeRenderPipeline(input) {
14591
14650
  const {
14592
14651
  job,
@@ -14624,7 +14683,7 @@ async function executeRenderPipeline(input) {
14624
14683
  imageDecodeFailures: 0
14625
14684
  };
14626
14685
  let hdrPerf;
14627
- const perfOutputPath = join30(workDir, "perf-summary.json");
14686
+ const perfOutputPath = join31(workDir, "perf-summary.json");
14628
14687
  const cfg = { ...job.config.producerConfig ?? resolveConfig() };
14629
14688
  const observability = new RenderObservabilityRecorder({
14630
14689
  pipelineStartMs: pipelineStart,
@@ -14729,7 +14788,7 @@ async function executeRenderPipeline(input) {
14729
14788
  requestedWorkers: job.config.workers ?? "auto"
14730
14789
  });
14731
14790
  const entryFile = job.config.entryFile || "index.html";
14732
- const htmlPath = join30(projectDir, entryFile);
14791
+ const htmlPath = join31(projectDir, entryFile);
14733
14792
  if (!existsSync21(htmlPath)) {
14734
14793
  throw new Error(`Entry file not found: ${htmlPath}`);
14735
14794
  }
@@ -14826,7 +14885,7 @@ async function executeRenderPipeline(input) {
14826
14885
  const largerThanCanvas = await oversizedVideos(
14827
14886
  composition.videos,
14828
14887
  projectDir,
14829
- join30(workDir, "compiled"),
14888
+ join31(workDir, "compiled"),
14830
14889
  { width: outputWidth, height: outputHeight }
14831
14890
  );
14832
14891
  const probeResult = await observeRenderStage(
@@ -14923,7 +14982,7 @@ async function executeRenderPipeline(input) {
14923
14982
  canvas: { width, height },
14924
14983
  page: probeSession.page,
14925
14984
  projectDir,
14926
- compiledDir: join30(workDir, "compiled")
14985
+ compiledDir: join31(workDir, "compiled")
14927
14986
  });
14928
14987
  if (videoLayerPlan.videoId === void 0) {
14929
14988
  log.info(`[Render] Video layer passthrough off: ${videoLayerPlan.reason}`);
@@ -14941,7 +15000,7 @@ async function executeRenderPipeline(input) {
14941
15000
  updateJobStatus(job, "preprocessing", "Extracting video frames", 10, onProgress, {
14942
15001
  code: "extract_video"
14943
15002
  });
14944
- const compiledDir = join30(workDir, "compiled");
15003
+ const compiledDir = join31(workDir, "compiled");
14945
15004
  const segmentsCapture = (layeredOrEffectRoute) => shouldSegmentCapture({
14946
15005
  env: process.env,
14947
15006
  durationSeconds: probeResult.duration,
@@ -15077,7 +15136,7 @@ async function executeRenderPipeline(input) {
15077
15136
  try {
15078
15137
  fileServer = await createFileServer({
15079
15138
  projectDir,
15080
- compiledDir: join30(workDir, "compiled"),
15139
+ compiledDir: join31(workDir, "compiled"),
15081
15140
  port: 0,
15082
15141
  preHeadScripts: [VIRTUAL_TIME_SHIM],
15083
15142
  fps: job.config.fps,
@@ -15097,7 +15156,7 @@ async function executeRenderPipeline(input) {
15097
15156
  if (!activeFileServer) {
15098
15157
  throw new Error("File server failed to initialize before frame capture");
15099
15158
  }
15100
- const framesDir = join30(workDir, "captured-frames");
15159
+ const framesDir = join31(workDir, "captured-frames");
15101
15160
  if (!existsSync21(framesDir)) mkdirSync10(framesDir, { recursive: true });
15102
15161
  updateJobStatus(job, "rendering", "Checking browser GPU", 25, onProgress, {
15103
15162
  code: "start_browsers"
@@ -15678,7 +15737,7 @@ async function executeRenderPipeline(input) {
15678
15737
  hls: ".mp4"
15679
15738
  };
15680
15739
  const videoExt = FORMAT_EXT[outputFormat] ?? ".mp4";
15681
- const videoOnlyPath = join30(workDir, `video-only${videoExt}`);
15740
+ const videoOnlyPath = join31(workDir, `video-only${videoExt}`);
15682
15741
  let usePageSideCompositingForTransitions = (cfg.enablePageSideCompositing || isGif) && compiled.hasShaderTransitions && !hasHdrContent && outputSupportsPageSideShaderCompositing(outputFormat);
15683
15742
  if (usePageSideCompositingForTransitions) {
15684
15743
  activeFileServer.addPreHeadScript(HF_PAGE_SIDE_COMPOSITING_STUB);
@@ -15995,16 +16054,19 @@ async function executeRenderPipeline(input) {
15995
16054
  pageMotionBlur: job.config.pageMotionBlur,
15996
16055
  captureQuality: captureOptions.quality
15997
16056
  });
15998
- const segmentDir = segmentDirFor(join30(projectDir, "renders"), segmentPlanHash);
16057
+ const segmentDir = segmentDirFor(join31(projectDir, "renders"), segmentPlanHash);
16058
+ const manifestKey = loadResumeKeyOrWarn(job.config.resumeSegments === true, log);
15999
16059
  let completedSegments = /* @__PURE__ */ new Set();
16000
16060
  if (job.config.resumeSegments === true) {
16001
16061
  const existing = readSegmentManifest(segmentDir);
16002
16062
  if (existing) {
16003
- completedSegments = await validateCompletedSegments(
16004
- existing,
16005
- segmentPlanHash,
16006
- (path) => probeSegmentFrameCount(path, extractMediaMetadata)
16007
- );
16063
+ completedSegments = await validateCompletedSegments(existing, {
16064
+ expectedHash: segmentPlanHash,
16065
+ segmentDir,
16066
+ plan: planSegments(totalFrames, segmentFrames),
16067
+ key: manifestKey,
16068
+ probeFrames: (path) => probeSegmentFrameCount(path, extractMediaMetadata)
16069
+ });
16008
16070
  log.info(`[Render] resuming: ${completedSegments.size} segments complete`, {
16009
16071
  segmentDir
16010
16072
  });
@@ -16078,7 +16140,7 @@ async function executeRenderPipeline(input) {
16078
16140
  ...segmentManifest.completed.filter((e) => e.index !== entry.index),
16079
16141
  { ...entry, completedAt: (/* @__PURE__ */ new Date()).toISOString() }
16080
16142
  ];
16081
- writeSegmentManifest(segmentDir, segmentManifest);
16143
+ writeSegmentManifest(segmentDir, segmentManifest, manifestKey);
16082
16144
  },
16083
16145
  updateCaptureObservability
16084
16146
  })
@@ -16621,7 +16683,7 @@ async function executeRenderPipeline(input) {
16621
16683
  }
16622
16684
  if (job.config.debug) {
16623
16685
  if (!isPngSequence && !isHls && existsSync21(stagedOutputPath)) {
16624
- const debugOutput = join30(workDir, `output${videoExt}`);
16686
+ const debugOutput = join31(workDir, `output${videoExt}`);
16625
16687
  copyFileSync3(stagedOutputPath, debugOutput);
16626
16688
  }
16627
16689
  }
@@ -16736,13 +16798,13 @@ async function executeRenderPipeline(input) {
16736
16798
 
16737
16799
  // ../producer/src/services/distributed/renderSpan.ts
16738
16800
  import { mkdirSync as mkdirSync18, mkdtempSync, readFileSync as readFileSync13, rmSync as rmSync16 } from "fs";
16739
- import { join as join44 } from "path";
16801
+ import { join as join45 } from "path";
16740
16802
  import { tmpdir as tmpdir5 } from "os";
16741
16803
 
16742
16804
  // ../producer/src/services/distributed/mp4Stitch.ts
16743
- import { createReadStream as createReadStream3, createWriteStream, mkdirSync as mkdirSync11, rmSync as rmSync11 } from "fs";
16805
+ import { createReadStream as createReadStream4, createWriteStream, mkdirSync as mkdirSync11, rmSync as rmSync11 } from "fs";
16744
16806
  import { open } from "fs/promises";
16745
- import { basename as basename7, dirname as dirname13, join as join31 } from "path";
16807
+ import { basename as basename7, dirname as dirname13, join as join32 } from "path";
16746
16808
  import { finished, pipeline } from "stream/promises";
16747
16809
  function boxAt(src, off, at, limit) {
16748
16810
  let size = src.readUInt32BE(off);
@@ -17094,7 +17156,7 @@ function fileRange(path) {
17094
17156
  }
17095
17157
  async function copyPayload(path, layout, index, out) {
17096
17158
  const { payloadStart, payloadEnd } = layout;
17097
- const payload = createReadStream3(path, { start: payloadStart, end: payloadEnd - 1 });
17159
+ const payload = createReadStream4(path, { start: payloadStart, end: payloadEnd - 1 });
17098
17160
  await pipeline(payload, out, { end: false });
17099
17161
  if (payload.bytesRead !== payloadEnd - payloadStart) {
17100
17162
  throw new Error(
@@ -17108,13 +17170,13 @@ async function writeStitchedMp4(chunkPaths, outputPath, audioPath) {
17108
17170
  const header = audioPath ? buildStitchedHeader(layouts.slice(1), layouts[0]) : buildStitchedHeader(layouts);
17109
17171
  mkdirSync11(dirname13(outputPath), { recursive: true });
17110
17172
  const workDir = createStagingDir(dirname13(outputPath), `${basename7(outputPath)}.stitch-`);
17111
- const out = createWriteStream(join31(workDir, "out.mp4"));
17173
+ const out = createWriteStream(join32(workDir, "out.mp4"));
17112
17174
  try {
17113
17175
  out.write(header);
17114
17176
  for (const [i, path] of sourcePaths.entries()) await copyPayload(path, layouts[i], i, out);
17115
17177
  out.end();
17116
17178
  await finished(out);
17117
- renameWithRetry(join31(workDir, "out.mp4"), outputPath);
17179
+ renameWithRetry(join32(workDir, "out.mp4"), outputPath);
17118
17180
  } finally {
17119
17181
  out.destroy();
17120
17182
  rmSync11(workDir, { recursive: true, force: true });
@@ -17131,18 +17193,18 @@ import {
17131
17193
  rmSync as rmSync12,
17132
17194
  writeFileSync as writeFileSync9
17133
17195
  } from "fs";
17134
- import { extname as extname6, isAbsolute as isAbsolute3, join as join39, relative as relative7, sep as sep4 } from "path";
17196
+ import { extname as extname6, isAbsolute as isAbsolute3, join as join40, relative as relative7, sep as sep4 } from "path";
17135
17197
 
17136
17198
  // ../producer/src/services/distributed/planFrameCost.ts
17137
- import { join as join34 } from "path";
17199
+ import { join as join35 } from "path";
17138
17200
 
17139
17201
  // ../producer/src/services/distributed/chunkFrames.ts
17140
17202
  import { existsSync as existsSync23, readdirSync as readdirSync7 } from "fs";
17141
- import { extname as extname4, join as join33 } from "path";
17203
+ import { extname as extname4, join as join34 } from "path";
17142
17204
 
17143
17205
  // ../producer/src/services/distributed/shared.ts
17144
17206
  import { execFile as execFileCallback } from "child_process";
17145
- import { dirname as dirname14, join as join32 } from "path";
17207
+ import { dirname as dirname14, join as join33 } from "path";
17146
17208
  import { existsSync as existsSync22, readFileSync as readFileSync8 } from "fs";
17147
17209
  import { fileURLToPath as fileURLToPath4 } from "url";
17148
17210
  import { promisify as promisify2 } from "util";
@@ -17154,7 +17216,7 @@ function isPlanAudioArtifactPath(path) {
17154
17216
  }
17155
17217
  function resolvePlanAudioPath(planDir) {
17156
17218
  for (const name of [PLAN_AUDIO_RELATIVE_PATH, PLAN_AUDIO_LEGACY_RELATIVE_PATH]) {
17157
- const candidate = join32(planDir, name);
17219
+ const candidate = join33(planDir, name);
17158
17220
  if (existsSync22(candidate)) return candidate;
17159
17221
  }
17160
17222
  return null;
@@ -17419,7 +17481,7 @@ function readProducerVersion() {
17419
17481
  const startDir = dirname14(fileURLToPath4(import.meta.url));
17420
17482
  let current = startDir;
17421
17483
  for (let i = 0; i < 10; i++) {
17422
- const candidate = join32(current, "package.json");
17484
+ const candidate = join33(current, "package.json");
17423
17485
  if (existsSync22(candidate)) {
17424
17486
  try {
17425
17487
  const pkg = JSON.parse(readFileSync8(candidate, "utf-8"));
@@ -17474,7 +17536,7 @@ function frameNumberFromFileName(name) {
17474
17536
  function rebuildExtractedFramesFromPlanDir(planDir, videos, indexMode = "dense-v1") {
17475
17537
  const result = [];
17476
17538
  for (const v of videos) {
17477
- const outputDir = join33(planDir, "video-frames", mediaIdPathSegment(v.videoId));
17539
+ const outputDir = join34(planDir, "video-frames", mediaIdPathSegment(v.videoId));
17478
17540
  if (!existsSync23(outputDir)) {
17479
17541
  throw new Error(
17480
17542
  `[renderChunk] planDir missing extracted video frames for ${JSON.stringify(v.videoId)}: ${outputDir} not present. plan() should have written frames here; the planDir is malformed.`
@@ -17493,7 +17555,7 @@ function rebuildExtractedFramesFromPlanDir(planDir, videos, indexMode = "dense-v
17493
17555
  if (!frameName) continue;
17494
17556
  const frameNumber = indexMode === "sparse-v2" ? frameNumberFromFileName(frameName) : null;
17495
17557
  const frameIndex = frameNumber === null ? i : frameNumber - 1;
17496
- framePaths.set(frameIndex, join33(outputDir, frameName));
17558
+ framePaths.set(frameIndex, join34(outputDir, frameName));
17497
17559
  }
17498
17560
  result.push({
17499
17561
  videoId: v.videoId,
@@ -17573,7 +17635,7 @@ async function extractDeferredVideoFramesForChunk(input) {
17573
17635
  sourceOf: (video) => {
17574
17636
  const range = planned.get(video.videoId).deferredRange;
17575
17637
  const remoteUrl = remoteSources[range.sourcePath];
17576
- const sourcePath = remoteUrl ?? join33(input.planDir, ...range.sourcePath.split("/"));
17638
+ const sourcePath = remoteUrl ?? join34(input.planDir, ...range.sourcePath.split("/"));
17577
17639
  if (remoteUrl === void 0 && !existsSync23(sourcePath)) {
17578
17640
  throw new RenderChunkValidationError(
17579
17641
  MISSING_PLAN_ARTIFACT,
@@ -17604,12 +17666,12 @@ async function measurePlanSecondsPerFrame(input) {
17604
17666
  planVideos,
17605
17667
  frames: sampled,
17606
17668
  fps: fpsRatio,
17607
- outputRoot: join34(workDir, "frame-cost-video-frames"),
17669
+ outputRoot: join35(workDir, "frame-cost-video-frames"),
17608
17670
  cfg: input.cfg
17609
17671
  })
17610
17672
  ];
17611
17673
  const lookup = extracted.length > 0 ? createFrameLookupTable(planVideos.videos, extracted, resolveRenderFpsConfig(fpsRatio).value) : null;
17612
- const compiledDir = join34(planDir, "compiled");
17674
+ const compiledDir = join35(planDir, "compiled");
17613
17675
  const fileServer = await createFileServer({
17614
17676
  projectDir: compiledDir,
17615
17677
  compiledDir,
@@ -17621,7 +17683,7 @@ async function measurePlanSecondsPerFrame(input) {
17621
17683
  try {
17622
17684
  session = await createCaptureSession(
17623
17685
  fileServer.url,
17624
- join34(workDir, "frame-cost"),
17686
+ join35(workDir, "frame-cost"),
17625
17687
  buildChunkCaptureOptions({
17626
17688
  dimensions: { ...input, fpsNum: fps, fpsDen: 1 },
17627
17689
  encoder: input,
@@ -17717,21 +17779,21 @@ function buildWeightedChunkSlices(weights, chunkCount, minFrames, maxFrames) {
17717
17779
  }
17718
17780
 
17719
17781
  // ../producer/src/services/render/planReferenceBackground.ts
17720
- import { join as join35 } from "path";
17782
+ import { join as join36 } from "path";
17721
17783
  async function readPlanReferenceBackground(input) {
17722
17784
  let server;
17723
17785
  let session;
17724
17786
  try {
17725
17787
  server = await createFileServer({
17726
17788
  projectDir: input.projectDir,
17727
- compiledDir: join35(input.workDir, "compiled"),
17789
+ compiledDir: join36(input.workDir, "compiled"),
17728
17790
  port: 0,
17729
17791
  preHeadScripts: [VIRTUAL_TIME_SHIM],
17730
17792
  fps: input.options.fps
17731
17793
  });
17732
17794
  session = await createCaptureSession(
17733
17795
  server.url,
17734
- join35(input.workDir, "reference"),
17796
+ join36(input.workDir, "reference"),
17735
17797
  {
17736
17798
  ...input.options,
17737
17799
  requiresWebGpu: false
@@ -17768,7 +17830,7 @@ async function readPlanReferenceBackground(input) {
17768
17830
 
17769
17831
  // ../producer/src/services/render/stages/freezePlan.ts
17770
17832
  import { existsSync as existsSync24, mkdirSync as mkdirSync12, readFileSync as readFileSync9, readdirSync as readdirSync8, writeFileSync as writeFileSync7 } from "fs";
17771
- import { join as join36, relative as relative5, resolve as resolve8 } from "path";
17833
+ import { join as join37, relative as relative5, resolve as resolve8 } from "path";
17772
17834
 
17773
17835
  // ../producer/src/services/distributed/planProtocol.ts
17774
17836
  var PLAN_SCHEMA_VERSION = 1;
@@ -17863,7 +17925,7 @@ function readPlanProtocolV1(planJson, capabilities = DISTRIBUTED_RENDER_CAPABILI
17863
17925
 
17864
17926
  // ../producer/src/services/render/stages/planHash.ts
17865
17927
  import { createHash as createHash6 } from "crypto";
17866
- import { closeSync as closeSync4, createReadStream as createReadStream4, openSync as openSync4, readSync as readSync4 } from "fs";
17928
+ import { closeSync as closeSync4, createReadStream as createReadStream5, openSync as openSync4, readSync as readSync4 } from "fs";
17867
17929
  var PLAN_HASH_SCHEMA_PREFIX = "hyperframes-plan-hash-v1\0";
17868
17930
  var FIELD_DELIMITER = Buffer.from([0]);
17869
17931
  function computePlanHash(input) {
@@ -17935,7 +17997,7 @@ function sha256File(path) {
17935
17997
  }
17936
17998
  async function sha256FileAsync(path) {
17937
17999
  const hash = createHash6("sha256");
17938
- for await (const chunk of createReadStream4(path, { highWaterMark: 1024 * 1024 })) {
18000
+ for await (const chunk of createReadStream5(path, { highWaterMark: 1024 * 1024 })) {
17939
18001
  hash.update(chunk);
17940
18002
  }
17941
18003
  return hash.digest("hex");
@@ -17982,7 +18044,7 @@ function listPlanFiles(planDir) {
17982
18044
  function walk(dir) {
17983
18045
  const entries = readdirSync8(dir, { withFileTypes: true });
17984
18046
  for (const entry of entries) {
17985
- const full = join36(dir, entry.name);
18047
+ const full = join37(dir, entry.name);
17986
18048
  if (entry.isDirectory()) {
17987
18049
  walk(full);
17988
18050
  } else if (entry.isFile()) {
@@ -18023,15 +18085,15 @@ var PLAN_REMOTE_FILES_RELATIVE_PATH = "meta/remote-files.json";
18023
18085
  function writePlanRemoteFiles(planDir, files) {
18024
18086
  if (files.length === 0) return;
18025
18087
  const sorted = [...files].sort((a, b) => a.path < b.path ? -1 : 1);
18026
- writeFileSync7(join36(planDir, PLAN_REMOTE_FILES_RELATIVE_PATH), JSON.stringify(sorted), "utf-8");
18088
+ writeFileSync7(join37(planDir, PLAN_REMOTE_FILES_RELATIVE_PATH), JSON.stringify(sorted), "utf-8");
18027
18089
  }
18028
18090
  function readPlanRemoteFiles(planDir) {
18029
- const path = join36(planDir, PLAN_REMOTE_FILES_RELATIVE_PATH);
18091
+ const path = join37(planDir, PLAN_REMOTE_FILES_RELATIVE_PATH);
18030
18092
  return existsSync24(path) ? JSON.parse(readFileSync9(path, "utf-8")) : [];
18031
18093
  }
18032
18094
  function recomputePlanHashFromPlanDir(planDir, digests) {
18033
- const planJsonPath = join36(planDir, "plan.json");
18034
- const encoderJsonPath = join36(planDir, "meta", "encoder.json");
18095
+ const planJsonPath = join37(planDir, "plan.json");
18096
+ const encoderJsonPath = join37(planDir, "meta", "encoder.json");
18035
18097
  if (!existsSync24(planJsonPath)) {
18036
18098
  throw new Error(`[freezePlan] plan.json missing: ${planJsonPath}`);
18037
18099
  }
@@ -18068,18 +18130,18 @@ async function freezePlan(input) {
18068
18130
  if (!existsSync24(planDir)) {
18069
18131
  throw new Error(`[freezePlan] planDir does not exist: ${planDir}`);
18070
18132
  }
18071
- const metaDir = join36(planDir, "meta");
18133
+ const metaDir = join37(planDir, "meta");
18072
18134
  if (!existsSync24(metaDir)) mkdirSync12(metaDir, { recursive: true });
18073
18135
  writeFileSync7(
18074
- join36(metaDir, "composition.json"),
18136
+ join37(metaDir, "composition.json"),
18075
18137
  `${JSON.stringify(composition, null, 2)}
18076
18138
  `,
18077
18139
  "utf-8"
18078
18140
  );
18079
18141
  const encoderForCanonical = stripUndefined(encoder);
18080
18142
  const encoderConfigCanonicalJson = canonicalJsonStringify(encoderForCanonical);
18081
- writeFileSync7(join36(metaDir, "encoder.json"), encoderConfigCanonicalJson, "utf-8");
18082
- writeFileSync7(join36(metaDir, "chunks.json"), `${JSON.stringify(chunks, null, 2)}
18143
+ writeFileSync7(join37(metaDir, "encoder.json"), encoderConfigCanonicalJson, "utf-8");
18144
+ writeFileSync7(join37(metaDir, "chunks.json"), `${JSON.stringify(chunks, null, 2)}
18083
18145
  `, "utf-8");
18084
18146
  const { compositionHtml, assets } = collectPlanAssetShas(planDir, digests);
18085
18147
  const planHash = computePlanHash({
@@ -18104,7 +18166,7 @@ async function freezePlan(input) {
18104
18166
  duration: durationSeconds,
18105
18167
  hasAudio
18106
18168
  };
18107
- const planJsonPath = join36(planDir, "plan.json");
18169
+ const planJsonPath = join37(planDir, "plan.json");
18108
18170
  writeFileSync7(planJsonPath, `${JSON.stringify(planJson, null, 2)}
18109
18171
  `, "utf-8");
18110
18172
  return { planJsonPath, planHash };
@@ -18148,7 +18210,7 @@ function applyRuntimeEnvSnapshot(snapshot, env = process.env) {
18148
18210
  // ../producer/src/services/distributed/chunkAudio.ts
18149
18211
  import { closeSync as closeSync5, existsSync as existsSync25, ftruncateSync, mkdirSync as mkdirSync13, openSync as openSync5, readFileSync as readFileSync10 } from "fs";
18150
18212
  import { writeFileSync as writeFileSync8, writeSync } from "fs";
18151
- import { join as join37 } from "path";
18213
+ import { join as join38 } from "path";
18152
18214
  function audioCutForChunk(grid, chunks, index, fps) {
18153
18215
  const firstPacketAt = (frame) => Math.min(
18154
18216
  grid.packetCount,
@@ -18235,7 +18297,7 @@ async function writeChunkAudioSlices(input) {
18235
18297
  });
18236
18298
  const bytes = readFileSync10(input.audioPath);
18237
18299
  const layout = { sizeBytes: bytes.length, payloadStart, payloadEnd, partStarts: {} };
18238
- mkdirSync13(join37(input.planDir, SLICE_DIR), { recursive: true });
18300
+ mkdirSync13(join38(input.planDir, SLICE_DIR), { recursive: true });
18239
18301
  input.chunks.forEach((_, index) => {
18240
18302
  const cut = audioCutForChunk(grid, input.chunks, index, input.fps);
18241
18303
  if (!cut) return;
@@ -18243,17 +18305,17 @@ async function writeChunkAudioSlices(input) {
18243
18305
  const start = offsets[cut.firstPacket];
18244
18306
  layout.partStarts[index] = start;
18245
18307
  const end = offsets[last] + track.sizes[last];
18246
- writeFileSync8(join37(input.planDir, chunkAudioSlicePath(index)), bytes.subarray(start, end));
18308
+ writeFileSync8(join38(input.planDir, chunkAudioSlicePath(index)), bytes.subarray(start, end));
18247
18309
  });
18248
18310
  const frame = [bytes.subarray(0, payloadStart), bytes.subarray(payloadEnd)];
18249
- writeFileSync8(join37(input.planDir, SLICE_FRAME), Buffer.concat(frame));
18250
- writeFileSync8(join37(input.planDir, SLICE_LAYOUT), JSON.stringify(layout));
18311
+ writeFileSync8(join38(input.planDir, SLICE_FRAME), Buffer.concat(frame));
18312
+ writeFileSync8(join38(input.planDir, SLICE_LAYOUT), JSON.stringify(layout));
18251
18313
  }
18252
18314
  function chunkAudioSource(planDir, chunkIndex, scratchPath) {
18253
- const layoutPath = join37(planDir, SLICE_LAYOUT);
18315
+ const layoutPath = join38(planDir, SLICE_LAYOUT);
18254
18316
  if (!existsSync25(layoutPath)) return resolvePlanAudioPath(planDir);
18255
18317
  const layout = JSON.parse(readFileSync10(layoutPath, "utf-8"));
18256
- const frame = readFileSync10(join37(planDir, SLICE_FRAME));
18318
+ const frame = readFileSync10(join38(planDir, SLICE_FRAME));
18257
18319
  const fd = openSync5(scratchPath, "w");
18258
18320
  try {
18259
18321
  writeSync(fd, frame, 0, layout.payloadStart, 0);
@@ -18266,7 +18328,7 @@ function chunkAudioSource(planDir, chunkIndex, scratchPath) {
18266
18328
  );
18267
18329
  const start = layout.partStarts[chunkIndex];
18268
18330
  if (start !== void 0) {
18269
- const part = readFileSync10(join37(planDir, chunkAudioSlicePath(chunkIndex)));
18331
+ const part = readFileSync10(join38(planDir, chunkAudioSlicePath(chunkIndex)));
18270
18332
  writeSync(fd, part, 0, part.length, start);
18271
18333
  }
18272
18334
  ftruncateSync(fd, layout.sizeBytes);
@@ -18321,8 +18383,8 @@ async function muxChunkWithAudio(input) {
18321
18383
 
18322
18384
  // ../producer/src/services/distributed/planSize.ts
18323
18385
  import { createHash as createHash7 } from "crypto";
18324
- import { lstatSync as lstatSync3, readdirSync as readdirSync9 } from "fs";
18325
- import { extname as extname5, join as join38, relative as relative6 } from "path";
18386
+ import { lstatSync as lstatSync4, readdirSync as readdirSync9 } from "fs";
18387
+ import { extname as extname5, join as join39, relative as relative6 } from "path";
18326
18388
  var MAX_TOP_COMPONENTS = 10;
18327
18389
  var SOURCE_MEDIA_EXTENSIONS = /* @__PURE__ */ new Set([
18328
18390
  ".aac",
@@ -18405,7 +18467,7 @@ function addCategoryBytes(result, category, filePath, sizeBytes) {
18405
18467
  function recordFile(result, components, rootDir, rootKind, filePath) {
18406
18468
  let sizeBytes;
18407
18469
  try {
18408
- const stat = lstatSync3(filePath);
18470
+ const stat = lstatSync4(filePath);
18409
18471
  if (!stat.isFile()) return;
18410
18472
  sizeBytes = stat.size;
18411
18473
  } catch {
@@ -18434,7 +18496,7 @@ function walkRegularFiles(dir, visit) {
18434
18496
  return;
18435
18497
  }
18436
18498
  for (const entry of entries) {
18437
- const full = join38(dir, entry.name);
18499
+ const full = join39(dir, entry.name);
18438
18500
  if (entry.isDirectory()) {
18439
18501
  walkRegularFiles(full, visit);
18440
18502
  } else if (entry.isFile()) {
@@ -18650,13 +18712,13 @@ function assertPositiveInteger2(name, value) {
18650
18712
  }
18651
18713
  var FREEZE_OWNED_PLAN_FILES = [
18652
18714
  "plan.json",
18653
- join39("meta", "composition.json"),
18654
- join39("meta", "encoder.json"),
18655
- join39("meta", "chunks.json")
18715
+ join40("meta", "composition.json"),
18716
+ join40("meta", "encoder.json"),
18717
+ join40("meta", "chunks.json")
18656
18718
  ];
18657
18719
  function removeFreezeOwnedPlanFiles(planDir) {
18658
18720
  for (const relativePath of FREEZE_OWNED_PLAN_FILES) {
18659
- rmSync12(join39(planDir, relativePath), { force: true });
18721
+ rmSync12(join40(planDir, relativePath), { force: true });
18660
18722
  }
18661
18723
  }
18662
18724
  function buildChunkSlices(totalFrames, chunkCount, effectiveChunkSize) {
@@ -18814,19 +18876,19 @@ function createVideoSourceShipper(input) {
18814
18876
  const known = shipped.get(srcPath);
18815
18877
  if (known) return known;
18816
18878
  const stagedRel = pathInside(input.workVideoFramesDir, srcPath);
18817
- const current = stagedRel === null ? srcPath : join39(input.planDir, "video-frames", stagedRel);
18879
+ const current = stagedRel === null ? srcPath : join40(input.planDir, "video-frames", stagedRel);
18818
18880
  let result = null;
18819
18881
  for (const root of stagedRel === null ? [input.workCompiledDir, input.projectDir] : []) {
18820
18882
  const rel = pathInside(root, srcPath);
18821
- if (rel !== null && (existsSync26(join39(input.planDir, "compiled", rel)) || input.isRemote(srcPath))) {
18883
+ if (rel !== null && (existsSync26(join40(input.planDir, "compiled", rel)) || input.isRemote(srcPath))) {
18822
18884
  result = ["compiled", ...rel.split(sep4)].join("/");
18823
18885
  break;
18824
18886
  }
18825
18887
  }
18826
18888
  if (result === null) {
18827
18889
  result = `video-sources/${shipped.size}${extname6(current)}`;
18828
- const destination = join39(input.planDir, ...result.split("/"));
18829
- mkdirSync14(join39(input.planDir, "video-sources"), { recursive: true });
18890
+ const destination = join40(input.planDir, ...result.split("/"));
18891
+ mkdirSync14(join40(input.planDir, "video-sources"), { recursive: true });
18830
18892
  try {
18831
18893
  linkSync(current, destination);
18832
18894
  } catch {
@@ -18880,14 +18942,14 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
18880
18942
  includeOutsideScripts: options.includeOutsideScripts === true
18881
18943
  });
18882
18944
  const entryFile = config.entryFile ?? "index.html";
18883
- const htmlPath = join39(projectDir, entryFile);
18945
+ const htmlPath = join40(projectDir, entryFile);
18884
18946
  if (!existsSync26(htmlPath)) {
18885
18947
  throw new Error(`[plan] entry file not found: ${htmlPath}`);
18886
18948
  }
18887
- const workDir = join39(planDir, ".plan-work");
18949
+ const workDir = join40(planDir, ".plan-work");
18888
18950
  rmSync12(workDir, { recursive: true, force: true });
18889
18951
  mkdirSync14(workDir, { recursive: true });
18890
- const compiledDir = join39(workDir, "compiled");
18952
+ const compiledDir = join40(workDir, "compiled");
18891
18953
  mkdirSync14(compiledDir, { recursive: true });
18892
18954
  let stageStarted = Date.now();
18893
18955
  cpSync2(projectDir, compiledDir, {
@@ -18907,10 +18969,10 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
18907
18969
  }
18908
18970
  });
18909
18971
  logPlanStage(log, "copy", stageStarted);
18910
- const finalCompiledDir = join39(planDir, "compiled");
18972
+ const finalCompiledDir = join40(planDir, "compiled");
18911
18973
  const needsAlpha = outputNeedsAlpha(config.format);
18912
18974
  const remoteFiles = Object.entries(options.remoteFiles ?? {});
18913
- const remoteLocalPath = (rel) => join39(projectDir, ...rel.split("/"));
18975
+ const remoteLocalPath = (rel) => join40(projectDir, ...rel.split("/"));
18914
18976
  for (const [, file] of remoteFiles) {
18915
18977
  declareContentAddressedUrl(file.url, file.sha256);
18916
18978
  if (file.probeFactsUrl) declareProbeFactsUrl(file.url, file.probeFactsUrl);
@@ -19007,7 +19069,7 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
19007
19069
  if (probeResult.fileServer) closeFileServerSafely(probeResult.fileServer, "plan", log);
19008
19070
  if (probeResult.probeSession) {
19009
19071
  try {
19010
- const { closeCaptureSession: closeCaptureSession2 } = await import("./src-COKNEXLI.js");
19072
+ const { closeCaptureSession: closeCaptureSession2 } = await import("./src-UG2WAJ4N.js");
19011
19073
  await closeCaptureSession2(probeResult.probeSession);
19012
19074
  } catch (err) {
19013
19075
  log.warn("[plan] probe session close failed", {
@@ -19115,10 +19177,10 @@ async function buildLocalExecutionPlan(projectDir, config, executionPlanDir, opt
19115
19177
  let stageStarted = Date.now();
19116
19178
  const extractResult = await extractPlanVideos(c, options.deferVideoExtraction);
19117
19179
  logPlanStage(log, "extract", stageStarted);
19118
- const stagedVideoFrames = join39(compiledDir, "__hyperframes_video_frames");
19119
- const videoFramesDst = join39(planDir, "video-frames");
19180
+ const stagedVideoFrames = join40(compiledDir, "__hyperframes_video_frames");
19181
+ const videoFramesDst = join40(planDir, "video-frames");
19120
19182
  if (existsSync26(videoFramesDst)) rmSync12(videoFramesDst, { recursive: true, force: true });
19121
- const videoSourcesDir = join39(planDir, "video-sources");
19183
+ const videoSourcesDir = join40(planDir, "video-sources");
19122
19184
  rmSync12(videoSourcesDir, { recursive: true, force: true });
19123
19185
  if (existsSync26(stagedVideoFrames)) {
19124
19186
  renameWithRetry(stagedVideoFrames, videoFramesDst);
@@ -19155,7 +19217,7 @@ async function buildLocalExecutionPlan(projectDir, config, executionPlanDir, opt
19155
19217
  };
19156
19218
  })
19157
19219
  });
19158
- mkdirSync14(join39(planDir, "meta"), { recursive: true });
19220
+ mkdirSync14(join40(planDir, "meta"), { recursive: true });
19159
19221
  writePlanRemoteFiles(
19160
19222
  planDir,
19161
19223
  remoteFiles.map(([rel, { sha256, sizeBytes }]) => ({
@@ -19165,7 +19227,7 @@ async function buildLocalExecutionPlan(projectDir, config, executionPlanDir, opt
19165
19227
  }))
19166
19228
  );
19167
19229
  writeFileSync9(
19168
- join39(planDir, PLAN_VIDEOS_META_RELATIVE_PATH),
19230
+ join40(planDir, PLAN_VIDEOS_META_RELATIVE_PATH),
19169
19231
  JSON.stringify(planVideosJson, null, 2),
19170
19232
  "utf-8"
19171
19233
  );
@@ -19245,7 +19307,7 @@ async function buildLocalExecutionPlan(projectDir, config, executionPlanDir, opt
19245
19307
  if (audioResult?.audioError) {
19246
19308
  applyDistributedAudioWarningPolicy(job, audioResult.audioError, audioResult.audioFailures, log);
19247
19309
  }
19248
- const planAudioPath = join39(planDir, PLAN_AUDIO_RELATIVE_PATH);
19310
+ const planAudioPath = join40(planDir, PLAN_AUDIO_RELATIVE_PATH);
19249
19311
  if (audioResult?.hasAudio && existsSync26(audioResult.audioOutputPath)) {
19250
19312
  renameWithRetry(audioResult.audioOutputPath, planAudioPath);
19251
19313
  }
@@ -19372,22 +19434,22 @@ async function plan(projectDir, config, planDir, options = {}) {
19372
19434
  // ../producer/src/services/distributed/renderChunk.ts
19373
19435
  import { randomBytes } from "crypto";
19374
19436
  import { existsSync as existsSync29, mkdirSync as mkdirSync17, readFileSync as readFileSync12, readdirSync as readdirSync11, rmSync as rmSync15, writeFileSync as writeFileSync12 } from "fs";
19375
- import { join as join43 } from "path";
19437
+ import { join as join44 } from "path";
19376
19438
 
19377
19439
  // ../producer/src/services/distributed/planV2.ts
19378
19440
  import {
19379
19441
  copyFileSync as copyFileSync6,
19380
19442
  existsSync as existsSync28,
19381
- lstatSync as lstatSync4,
19443
+ lstatSync as lstatSync5,
19382
19444
  mkdirSync as mkdirSync16,
19383
19445
  readFileSync as readFileSync11,
19384
19446
  readdirSync as readdirSync10,
19385
19447
  rmSync as rmSync14,
19386
- statSync as statSync10,
19448
+ statSync as statSync9,
19387
19449
  writeFileSync as writeFileSync11
19388
19450
  } from "fs";
19389
19451
  import { tmpdir as tmpdir4 } from "os";
19390
- import { dirname as dirname16, isAbsolute as isAbsolute4, join as join42, relative as relative8, resolve as resolve9, sep as sep5 } from "path";
19452
+ import { dirname as dirname16, isAbsolute as isAbsolute4, join as join43, relative as relative8, resolve as resolve9, sep as sep5 } from "path";
19391
19453
 
19392
19454
  // ../producer/src/services/distributed/planV2Publisher.ts
19393
19455
  import {
@@ -19396,10 +19458,10 @@ import {
19396
19458
  linkSync as linkSync2,
19397
19459
  mkdirSync as mkdirSync15,
19398
19460
  rmSync as rmSync13,
19399
- statSync as statSync9,
19461
+ statSync as statSync8,
19400
19462
  writeFileSync as writeFileSync10
19401
19463
  } from "fs";
19402
- import { dirname as dirname15, join as join41 } from "path";
19464
+ import { dirname as dirname15, join as join42 } from "path";
19403
19465
 
19404
19466
  // ../producer/src/services/distributed/planV2Errors.ts
19405
19467
  var PLAN_V2_INTEGRITY_UNRECOVERABLE = "PLAN_V2_INTEGRITY_UNRECOVERABLE";
@@ -19414,7 +19476,7 @@ var PlanV2IntegrityError = class extends Error {
19414
19476
  };
19415
19477
 
19416
19478
  // ../producer/src/services/distributed/planV2Layout.ts
19417
- import { join as join40 } from "path";
19479
+ import { join as join41 } from "path";
19418
19480
  var SHA256_PATTERN = /^[0-9a-f]{64}$/;
19419
19481
  function assertPlanV2Sha256(value, field) {
19420
19482
  if (typeof value !== "string" || !SHA256_PATTERN.test(value)) {
@@ -19424,7 +19486,7 @@ function assertPlanV2Sha256(value, field) {
19424
19486
  }
19425
19487
  function planV2BlobPath(root, sha256) {
19426
19488
  const digest = assertPlanV2Sha256(sha256, "artifact sha256");
19427
- return join40(root, "artifacts", "sha256", digest.slice(0, 2), digest);
19489
+ return join41(root, "artifacts", "sha256", digest.slice(0, 2), digest);
19428
19490
  }
19429
19491
 
19430
19492
  // ../producer/src/services/distributed/planV2Publisher.ts
@@ -19464,7 +19526,7 @@ var LocalPlanV2ArtifactPublisher = class {
19464
19526
  }
19465
19527
  async putBlob(blob) {
19466
19528
  const digest = assertPlanV2Sha256(blob.sha256, "published blob sha256");
19467
- const sourceSize = statSync9(blob.sourcePath).size;
19529
+ const sourceSize = statSync8(blob.sourcePath).size;
19468
19530
  if (sourceSize !== blob.sizeBytes) {
19469
19531
  throw new PlanV2IntegrityError(
19470
19532
  `published blob size changed for ${digest}: expected ${blob.sizeBytes}, got ${sourceSize}`
@@ -19474,7 +19536,7 @@ var LocalPlanV2ArtifactPublisher = class {
19474
19536
  if (existsSync27(destinationPath)) return;
19475
19537
  mkdirSync15(dirname15(destinationPath), { recursive: true });
19476
19538
  const stagingDir = createStagingDir(dirname15(destinationPath), ".plan-v2-blob-");
19477
- const temporaryPath = join41(stagingDir, "blob");
19539
+ const temporaryPath = join42(stagingDir, "blob");
19478
19540
  try {
19479
19541
  try {
19480
19542
  this.#linkFile(blob.sourcePath, temporaryPath);
@@ -19495,7 +19557,7 @@ var LocalPlanV2ArtifactPublisher = class {
19495
19557
  );
19496
19558
  }
19497
19559
  }
19498
- writeFileSync10(join41(this.temporaryDir, "plan.json"), manifestBytes, "utf-8");
19560
+ writeFileSync10(join42(this.temporaryDir, "plan.json"), manifestBytes, "utf-8");
19499
19561
  renameWithRetry(this.temporaryDir, this.destinationDir);
19500
19562
  this.#committed = true;
19501
19563
  }
@@ -19540,7 +19602,7 @@ function listFiles(root) {
19540
19602
  const rootResolved = resolve9(root);
19541
19603
  function walk(dir) {
19542
19604
  for (const entry of readdirSync10(dir, { withFileTypes: true })) {
19543
- const absolutePath = join42(dir, entry.name);
19605
+ const absolutePath = join43(dir, entry.name);
19544
19606
  if (entry.isDirectory()) {
19545
19607
  walk(absolutePath);
19546
19608
  } else if (entry.isFile()) {
@@ -19559,7 +19621,7 @@ function listFiles(root) {
19559
19621
  return files.sort((a, b) => a.path.localeCompare(b.path));
19560
19622
  }
19561
19623
  function assertValidExtractionCacheCompleteSentinel(path) {
19562
- const sentinel = lstatSync4(path);
19624
+ const sentinel = lstatSync5(path);
19563
19625
  if (!sentinel.isFile() || sentinel.size !== 0) {
19564
19626
  throw new PlanV2IntegrityError(
19565
19627
  `${EXTRACTION_CACHE_COMPLETE_SENTINEL} must be a zero-byte regular file`
@@ -19567,13 +19629,13 @@ function assertValidExtractionCacheCompleteSentinel(path) {
19567
19629
  }
19568
19630
  }
19569
19631
  function validateExtractionCacheCompleteSentinels(executionPlanDir) {
19570
- const videoRoot = join42(executionPlanDir, "video-frames");
19632
+ const videoRoot = join43(executionPlanDir, "video-frames");
19571
19633
  if (!existsSync28(videoRoot)) return;
19572
19634
  for (const videoEntry of readdirSync10(videoRoot, { withFileTypes: true })) {
19573
19635
  if (!videoEntry.isDirectory()) continue;
19574
- const videoDir = join42(videoRoot, videoEntry.name);
19636
+ const videoDir = join43(videoRoot, videoEntry.name);
19575
19637
  if (readdirSync10(videoDir).includes(EXTRACTION_CACHE_COMPLETE_SENTINEL)) {
19576
- const sentinelPath = join42(videoDir, EXTRACTION_CACHE_COMPLETE_SENTINEL);
19638
+ const sentinelPath = join43(videoDir, EXTRACTION_CACHE_COMPLETE_SENTINEL);
19577
19639
  assertValidExtractionCacheCompleteSentinel(sentinelPath);
19578
19640
  }
19579
19641
  }
@@ -19620,7 +19682,7 @@ function listVideoFramePaths(executionPlanDir, videos) {
19620
19682
  if (video.deferredRange) {
19621
19683
  const framePaths2 = /* @__PURE__ */ new Map();
19622
19684
  for (let index = 0; index < video.totalFrames; index++) {
19623
- framePaths2.set(index, join42(outputDir, String(index)));
19685
+ framePaths2.set(index, join43(outputDir, String(index)));
19624
19686
  }
19625
19687
  return { ...video, outputDir, framePaths: framePaths2, ownedByLookup: false };
19626
19688
  }
@@ -19628,7 +19690,7 @@ function listVideoFramePaths(executionPlanDir, videos) {
19628
19690
  const framePaths = /* @__PURE__ */ new Map();
19629
19691
  for (const frameName of frameNames) {
19630
19692
  if (frameName === EXTRACTION_CACHE_COMPLETE_SENTINEL) {
19631
- assertValidExtractionCacheCompleteSentinel(join42(outputDir, frameName));
19693
+ assertValidExtractionCacheCompleteSentinel(join43(outputDir, frameName));
19632
19694
  continue;
19633
19695
  }
19634
19696
  const match = /(\d+)(?=\.[^.]+$)/.exec(frameName);
@@ -19647,7 +19709,7 @@ function listVideoFramePaths(executionPlanDir, videos) {
19647
19709
  `duplicate extracted frame index ${frameIndex} in ${outputDir}`
19648
19710
  );
19649
19711
  }
19650
- framePaths.set(frameIndex, join42(outputDir, frameName));
19712
+ framePaths.set(frameIndex, join43(outputDir, frameName));
19651
19713
  }
19652
19714
  return {
19653
19715
  ...video,
@@ -19668,7 +19730,7 @@ function parsePlanVideosJson2(value) {
19668
19730
  }
19669
19731
  }
19670
19732
  function materializeExtractedVideoDirectories(planDir) {
19671
- const videosPath = join42(planDir, PLAN_VIDEOS_META_RELATIVE_PATH);
19733
+ const videosPath = join43(planDir, PLAN_VIDEOS_META_RELATIVE_PATH);
19672
19734
  if (!existsSync28(videosPath)) return;
19673
19735
  const videos = parsePlanVideosJson2(readJsonFile(videosPath, PLAN_VIDEOS_META_RELATIVE_PATH));
19674
19736
  for (const video of videos.extracted) {
@@ -19702,13 +19764,13 @@ function parseChunkSlices(value) {
19702
19764
  });
19703
19765
  }
19704
19766
  function buildVideoChunkDependencies(executionPlanDir, dimensions) {
19705
- const videoRoot = join42(executionPlanDir, "video-frames");
19767
+ const videoRoot = join43(executionPlanDir, "video-frames");
19706
19768
  const hasExtractedFrames = existsSync28(videoRoot) && listFiles(videoRoot).length > 0;
19707
- const videosPath = join42(executionPlanDir, PLAN_VIDEOS_META_RELATIVE_PATH);
19769
+ const videosPath = join43(executionPlanDir, PLAN_VIDEOS_META_RELATIVE_PATH);
19708
19770
  if (!existsSync28(videosPath)) {
19709
19771
  return hasExtractedFrames ? { mode: "full-source-pack", dependencies: null } : { mode: "exact-rendered-frames", dependencies: /* @__PURE__ */ new Map() };
19710
19772
  }
19711
- const chunksPath = join42(executionPlanDir, "meta", "chunks.json");
19773
+ const chunksPath = join43(executionPlanDir, "meta", "chunks.json");
19712
19774
  const videos = readJsonFile(videosPath, PLAN_VIDEOS_META_RELATIVE_PATH);
19713
19775
  const chunks = readJsonFile(chunksPath, "meta/chunks.json");
19714
19776
  const parsedVideos = parsePlanVideosJson2(videos);
@@ -19765,7 +19827,7 @@ function writeBlob(sourcePath, destinationPath) {
19765
19827
  if (existsSync28(destinationPath)) return;
19766
19828
  mkdirSync16(dirname16(destinationPath), { recursive: true });
19767
19829
  const temporaryDir = createStagingDir(dirname16(destinationPath), ".plan-v2-blob-");
19768
- const temporaryPath = join42(temporaryDir, "blob");
19830
+ const temporaryPath = join43(temporaryDir, "blob");
19769
19831
  try {
19770
19832
  copyFileSync6(sourcePath, temporaryPath);
19771
19833
  renameWithRetry(temporaryPath, destinationPath);
@@ -19777,7 +19839,7 @@ function publishBlobFor(absolutePath, digests) {
19777
19839
  return {
19778
19840
  sourcePath: absolutePath,
19779
19841
  sha256: planFileSha256(absolutePath, digests),
19780
- sizeBytes: statSync10(absolutePath).size
19842
+ sizeBytes: statSync9(absolutePath).size
19781
19843
  };
19782
19844
  }
19783
19845
  async function putBlobs(publisher, blobs) {
@@ -19801,7 +19863,7 @@ async function putTasks(tasks) {
19801
19863
  if (failure) throw failure.reason;
19802
19864
  }
19803
19865
  function buildPlanV2Publication(executionPlanDir, digests) {
19804
- const executionPlanPath = join42(executionPlanDir, "plan.json");
19866
+ const executionPlanPath = join43(executionPlanDir, "plan.json");
19805
19867
  if (!existsSync28(executionPlanPath)) {
19806
19868
  throw new PlanV2IntegrityError(`execution plan is missing plan.json: ${executionPlanPath}`);
19807
19869
  }
@@ -19829,7 +19891,7 @@ function buildPlanV2Publication(executionPlanDir, digests) {
19829
19891
  }
19830
19892
  validateExtractionCacheCompleteSentinels(executionPlanDir);
19831
19893
  const videoDependencyPlan = buildVideoChunkDependencies(executionPlanDir, dimensions);
19832
- const encoder = readJsonFile(join42(executionPlanDir, "meta", "encoder.json"), "meta/encoder.json");
19894
+ const encoder = readJsonFile(join43(executionPlanDir, "meta", "encoder.json"), "meta/encoder.json");
19833
19895
  const files = listFiles(executionPlanDir);
19834
19896
  const chunkAudio = !isRecord3(encoder) || encoder.chunksCarryAudio !== true ? "none" : files.some((file) => chunkAudioSliceTarget(file.path) !== null) ? "sliced" : "whole";
19835
19897
  for (const file of files) {
@@ -19896,7 +19958,7 @@ function createPlanV2FromExecutionPlan(executionPlanDir, planV2Dir) {
19896
19958
  writeBlob(blob.sourcePath, planV2BlobPath(tempDir, blob.sha256));
19897
19959
  }
19898
19960
  writeFileSync11(
19899
- join42(tempDir, "plan.json"),
19961
+ join43(tempDir, "plan.json"),
19900
19962
  canonicalJsonStringify(publication.manifest),
19901
19963
  "utf-8"
19902
19964
  );
@@ -19948,7 +20010,7 @@ async function planV2WithPublisher(projectDir, config, publisher, options = {})
19948
20010
  // artifactTargets ships every compiled/ file to all chunks, so each is in the manifest.
19949
20011
  whileAudioMixes: () => putBlobs(
19950
20012
  publisher,
19951
- listFiles(join42(stagingRoot, "compiled")).map(
20013
+ listFiles(join43(stagingRoot, "compiled")).map(
19952
20014
  (file) => publishBlobFor(file.absolutePath, digests)
19953
20015
  )
19954
20016
  ),
@@ -19989,7 +20051,7 @@ function resultFromManifest(planV2Dir, manifest) {
19989
20051
  isRecord3(executionPlan) ? executionPlan[REFERENCE_BACKGROUND_FIELD] : void 0
19990
20052
  ),
19991
20053
  planDir: planV2Dir,
19992
- manifestPath: join42(planV2Dir, "plan.json"),
20054
+ manifestPath: join43(planV2Dir, "plan.json"),
19993
20055
  planProtocol: PLAN_PROTOCOL_V2,
19994
20056
  planHash: manifest.planHash,
19995
20057
  sourcePlanV1Hash: getPlanV2ExecutionPlanHash(manifest),
@@ -20125,7 +20187,7 @@ function parsePlanV2Manifest(value) {
20125
20187
  return parsed;
20126
20188
  }
20127
20189
  function readPlanV2Manifest(planV2Dir) {
20128
- const manifestPath = join42(planV2Dir, "plan.json");
20190
+ const manifestPath = join43(planV2Dir, "plan.json");
20129
20191
  if (!existsSync28(manifestPath)) {
20130
20192
  throw new PlanV2IntegrityError(`missing v2 manifest: ${manifestPath}`);
20131
20193
  }
@@ -20148,7 +20210,7 @@ function verifyBlob(planV2Dir, artifact) {
20148
20210
  if (!existsSync28(sourcePath)) {
20149
20211
  throw new PlanV2IntegrityError(`missing content-addressed artifact ${artifact.sha256}`);
20150
20212
  }
20151
- const stats = statSync10(sourcePath);
20213
+ const stats = statSync9(sourcePath);
20152
20214
  if (!stats.isFile() || stats.size !== artifact.sizeBytes) {
20153
20215
  throw new PlanV2IntegrityError(`artifact size mismatch for ${artifact.path}`);
20154
20216
  }
@@ -20174,13 +20236,13 @@ function materializePlanV2Target(planV2Dir, target, destinationDir, options = {}
20174
20236
  const tempDir = createStagingDir(dirname16(destinationDir), ".plan-v2-materialize-");
20175
20237
  try {
20176
20238
  for (const { artifact, sourcePath } of verified) {
20177
- const destinationPath = join42(tempDir, ...artifact.path.split("/"));
20239
+ const destinationPath = join43(tempDir, ...artifact.path.split("/"));
20178
20240
  mkdirSync16(dirname16(destinationPath), { recursive: true });
20179
20241
  copyFileSync6(sourcePath, destinationPath);
20180
20242
  }
20181
20243
  if (target.role === "chunk") materializeExtractedVideoDirectories(tempDir);
20182
20244
  writeFileSync11(
20183
- join42(tempDir, PLAN_V2_MATERIALIZATION_MARKER),
20245
+ join43(tempDir, PLAN_V2_MATERIALIZATION_MARKER),
20184
20246
  canonicalJsonStringify({
20185
20247
  manifest,
20186
20248
  target,
@@ -20203,7 +20265,7 @@ function materializePlanV2Target(planV2Dir, target, destinationDir, options = {}
20203
20265
  // Join the artifact's OWN name, not the current constant: a plan written
20204
20266
  // before the container change carries the legacy name, and materializing it
20205
20267
  // under the new one would point at a file that was never written.
20206
- audioPath: target.role === "assembler" ? audioArtifact ? join42(destinationDir, audioArtifact.path) : null : null
20268
+ audioPath: target.role === "assembler" ? audioArtifact ? join43(destinationDir, audioArtifact.path) : null : null
20207
20269
  };
20208
20270
  }
20209
20271
  function assertRemoteSources(remoteSources, artifacts) {
@@ -20222,7 +20284,7 @@ function validatePlanV2MaterializedTarget(planDir, expectedTarget) {
20222
20284
  return readValidatedPlanV2Materialization(planDir, expectedTarget)?.manifest ?? null;
20223
20285
  }
20224
20286
  function readValidatedPlanV2Materialization(planDir, expectedTarget) {
20225
- const markerPath = join42(planDir, PLAN_V2_MATERIALIZATION_MARKER);
20287
+ const markerPath = join43(planDir, PLAN_V2_MATERIALIZATION_MARKER);
20226
20288
  if (!existsSync28(markerPath)) return null;
20227
20289
  const marker = readJsonFile(markerPath, "materialization marker");
20228
20290
  if (!isRecord3(marker) || !isRecord3(marker.manifest) || !isRecord3(marker.target)) {
@@ -20240,8 +20302,8 @@ function readValidatedPlanV2Materialization(planDir, expectedTarget) {
20240
20302
  assertRemoteSources(remoteSources, required);
20241
20303
  for (const artifact of required) {
20242
20304
  if (Object.hasOwn(remoteSources, artifact.path)) continue;
20243
- const path = join42(planDir, ...artifact.path.split("/"));
20244
- if (!existsSync28(path) || statSync10(path).size !== artifact.sizeBytes) {
20305
+ const path = join43(planDir, ...artifact.path.split("/"));
20306
+ if (!existsSync28(path) || statSync9(path).size !== artifact.sizeBytes) {
20245
20307
  throw new PlanV2IntegrityError(
20246
20308
  `materialized artifact missing or truncated: ${artifact.path}`
20247
20309
  );
@@ -20371,7 +20433,7 @@ function hashChunkOutput(outputPath, kind) {
20371
20433
  if (kind === "file") return sha256Hex(readFileSync12(outputPath));
20372
20434
  const entries = readdirSync11(outputPath).filter((name) => /\.(png|jpg|jpeg)$/i.test(name)).sort();
20373
20435
  const lines = entries.map(
20374
- (name) => `${name}\0${sha256Hex(readFileSync12(join43(outputPath, name)))}`
20436
+ (name) => `${name}\0${sha256Hex(readFileSync12(join44(outputPath, name)))}`
20375
20437
  );
20376
20438
  return sha256Hex(lines.join("\0"));
20377
20439
  }
@@ -20388,9 +20450,9 @@ function resolveLockedVp9CpuUsed(lockedEncoder) {
20388
20450
  async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
20389
20451
  const start = Date.now();
20390
20452
  const log = defaultLogger;
20391
- const planJsonPath = join43(planDir, "plan.json");
20392
- const encoderJsonPath = join43(planDir, "meta", "encoder.json");
20393
- const chunksJsonPath = join43(planDir, "meta", "chunks.json");
20453
+ const planJsonPath = join44(planDir, "plan.json");
20454
+ const encoderJsonPath = join44(planDir, "meta", "encoder.json");
20455
+ const chunksJsonPath = join44(planDir, "meta", "chunks.json");
20394
20456
  if (!existsSync29(planJsonPath)) {
20395
20457
  throw new RenderChunkValidationError(
20396
20458
  MISSING_PLAN_ARTIFACT,
@@ -20416,7 +20478,7 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
20416
20478
  }
20417
20479
  const encoder = JSON.parse(readFileSync12(encoderJsonPath, "utf-8"));
20418
20480
  const chunks = JSON.parse(readFileSync12(chunksJsonPath, "utf-8"));
20419
- const videosJsonPath = join43(planDir, PLAN_VIDEOS_META_RELATIVE_PATH);
20481
+ const videosJsonPath = join44(planDir, PLAN_VIDEOS_META_RELATIVE_PATH);
20420
20482
  let planVideos = null;
20421
20483
  if (existsSync29(videosJsonPath)) {
20422
20484
  try {
@@ -20448,7 +20510,7 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
20448
20510
  }
20449
20511
  const range = resolveChunkFrameRange(slice, chunkIndex, options?.frameRange);
20450
20512
  const framesInChunk = range.endFrame - range.startFrame;
20451
- const compiledDir = join43(planDir, "compiled");
20513
+ const compiledDir = join44(planDir, "compiled");
20452
20514
  if (!existsSync29(compiledDir)) {
20453
20515
  throw new RenderChunkValidationError(
20454
20516
  MISSING_PLAN_ARTIFACT,
@@ -20507,7 +20569,7 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
20507
20569
  };
20508
20570
  const workDir = `${outputChunkPath}.work.${process.pid}.${randomBytes(4).toString("hex")}`;
20509
20571
  mkdirSync17(workDir, { recursive: true });
20510
- const framesDir = join43(workDir, "captured-frames");
20572
+ const framesDir = join44(workDir, "captured-frames");
20511
20573
  mkdirSync17(framesDir, { recursive: true });
20512
20574
  const videoFramesDir = `${workDir}.video-frames`;
20513
20575
  const chunkFrameNumbers = Array.from({ length: framesInChunk }, (_, i) => range.startFrame + i);
@@ -20532,7 +20594,7 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
20532
20594
  dimensions: plan2.dimensions,
20533
20595
  encoder,
20534
20596
  videoCount: planVideos?.videos.length ?? 0,
20535
- html: readFileSync12(join43(compiledDir, "index.html"), "utf-8"),
20597
+ html: readFileSync12(join44(compiledDir, "index.html"), "utf-8"),
20536
20598
  // The plan ships a deferred source only to chunks that show it; don't wait on the rest.
20537
20599
  skipReadinessVideoIds: deferredVideos.filter(
20538
20600
  (video) => !shownFrames.get(video.videoId)?.size || remoteVideoIds.has(video.videoId)
@@ -20703,7 +20765,7 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
20703
20765
  if (isPngSequence) {
20704
20766
  if (!existsSync29(outputChunkPath)) mkdirSync17(outputChunkPath, { recursive: true });
20705
20767
  } else {
20706
- const outDir = join43(outputChunkPath, "..");
20768
+ const outDir = join44(outputChunkPath, "..");
20707
20769
  if (!existsSync29(outDir)) mkdirSync17(outDir, { recursive: true });
20708
20770
  }
20709
20771
  const encodeInput = {
@@ -20980,10 +21042,10 @@ async function renderSpan(projectDir, config, span, outputPath, options = {}) {
20980
21042
  if (config.cfr === true) {
20981
21043
  throw new RenderSpanUnsupportedError("--start/--end cannot be combined with a cfr re-encode.");
20982
21044
  }
20983
- const workDir = mkdtempSync(join44(tmpdir5(), "hf-render-span-"));
21045
+ const workDir = mkdtempSync(join45(tmpdir5(), "hf-render-span-"));
20984
21046
  try {
20985
- const planDir = join44(workDir, "plan");
20986
- const partsDir = join44(workDir, "parts");
21047
+ const planDir = join45(workDir, "plan");
21048
+ const partsDir = join45(workDir, "parts");
20987
21049
  mkdirSync18(partsDir, { recursive: true });
20988
21050
  const planned = await plan(
20989
21051
  projectDir,
@@ -21002,7 +21064,7 @@ async function renderSpan(projectDir, config, span, outputPath, options = {}) {
21002
21064
  planned.totalFrames
21003
21065
  );
21004
21066
  const slices = JSON.parse(
21005
- readFileSync13(join44(planDir, "meta", "chunks.json"), "utf-8")
21067
+ readFileSync13(join45(planDir, "meta", "chunks.json"), "utf-8")
21006
21068
  );
21007
21069
  const parts = [];
21008
21070
  for (const slice of slices) {
@@ -21012,7 +21074,7 @@ async function renderSpan(projectDir, config, span, outputPath, options = {}) {
21012
21074
  };
21013
21075
  if (range.endFrame <= range.startFrame) continue;
21014
21076
  throwIfAborted(config.abortSignal);
21015
- const part = join44(partsDir, `part-${String(parts.length).padStart(4, "0")}.mp4`);
21077
+ const part = join45(partsDir, `part-${String(parts.length).padStart(4, "0")}.mp4`);
21016
21078
  await renderChunk(planDir, slice.index, part, { frameRange: range });
21017
21079
  parts.push(part);
21018
21080
  }
@@ -21629,13 +21691,13 @@ function renderRequestFromDistributedConfig(input) {
21629
21691
  import {
21630
21692
  existsSync as existsSync32,
21631
21693
  mkdirSync as mkdirSync19,
21632
- statSync as statSync12,
21694
+ statSync as statSync11,
21633
21695
  mkdtempSync as mkdtempSync2,
21634
21696
  writeFileSync as writeFileSync13,
21635
21697
  rmSync as rmSync17,
21636
- createReadStream as createReadStream5
21698
+ createReadStream as createReadStream6
21637
21699
  } from "fs";
21638
- import { resolve as resolve11, dirname as dirname19, join as join47 } from "path";
21700
+ import { resolve as resolve11, dirname as dirname19, join as join48 } from "path";
21639
21701
  import { tmpdir as tmpdir6 } from "os";
21640
21702
  import { parseArgs } from "util";
21641
21703
  import { isIP } from "net";
@@ -21648,13 +21710,13 @@ import { serve as serve2 } from "@hono/node-server";
21648
21710
  import {
21649
21711
  existsSync as existsSync30,
21650
21712
  readFileSync as readFileSync14,
21651
- statSync as statSync11,
21713
+ statSync as statSync10,
21652
21714
  openSync as openSync6,
21653
21715
  fstatSync as fstatSync3,
21654
21716
  closeSync as closeSync6,
21655
21717
  constants as constants3
21656
21718
  } from "fs";
21657
- import { resolve as resolve10, join as join45, relative as relative9, isAbsolute as isAbsolute5, sep as sep6, dirname as dirname17 } from "path";
21719
+ import { resolve as resolve10, join as join46, relative as relative9, isAbsolute as isAbsolute5, sep as sep6, dirname as dirname17 } from "path";
21658
21720
  import { fileURLToPath as fileURLToPath5 } from "url";
21659
21721
  import { Worker as Worker2 } from "worker_threads";
21660
21722
  function isStringRecord(value) {
@@ -21689,7 +21751,7 @@ function readEntryHtml(filePath) {
21689
21751
  } catch (error) {
21690
21752
  if (error instanceof Error && "code" in error && (error.code === "ENOENT" || error.code === "ENOTDIR"))
21691
21753
  return null;
21692
- if (!statSync11(filePath, { throwIfNoEntry: false })?.isFile()) return null;
21754
+ if (!statSync10(filePath, { throwIfNoEntry: false })?.isFile()) return null;
21693
21755
  throw error;
21694
21756
  }
21695
21757
  try {
@@ -21705,7 +21767,7 @@ function leavesProject(absProjectDir, absoluteEntryPath, isAllowedEntry) {
21705
21767
  }
21706
21768
  function readProjectEntryFile(projectDir, preferredEntryFile, isAllowedEntry) {
21707
21769
  const absProjectDir = resolve10(projectDir);
21708
- if (!existsSync30(absProjectDir) || !statSync11(absProjectDir).isDirectory()) {
21770
+ if (!existsSync30(absProjectDir) || !statSync10(absProjectDir).isDirectory()) {
21709
21771
  return { error: `Project directory not found: ${absProjectDir}` };
21710
21772
  }
21711
21773
  const entryCandidates = [preferredEntryFile, "index.html", "src/index.html"].filter(
@@ -21726,7 +21788,7 @@ function readProjectEntryFile(projectDir, preferredEntryFile, isAllowedEntry) {
21726
21788
  }
21727
21789
  }
21728
21790
  return {
21729
- error: `No HTML entry file found in project directory: ${join45(absProjectDir, preferredEntryFile || "index.html")}`
21791
+ error: `No HTML entry file found in project directory: ${join46(absProjectDir, preferredEntryFile || "index.html")}`
21730
21792
  };
21731
21793
  }
21732
21794
  function prepareHyperframeLintBody(body, isAllowedEntry) {
@@ -21795,7 +21857,7 @@ function freeLintSlot() {
21795
21857
  function resolveLintWorkerEntry() {
21796
21858
  const here = dirname17(fileURLToPath5(import.meta.url));
21797
21859
  for (const name of ["hyperframeLintWorker.js", "hyperframeLintWorker.ts"]) {
21798
- const candidate = join45(here, name);
21860
+ const candidate = join46(here, name);
21799
21861
  if (existsSync30(candidate)) return candidate;
21800
21862
  }
21801
21863
  return void 0;
@@ -21866,7 +21928,7 @@ async function runHyperframeLint(prepared, options = {}) {
21866
21928
  // ../producer/src/services/healthWorker.ts
21867
21929
  import { Worker as Worker3 } from "worker_threads";
21868
21930
  import { fileURLToPath as fileURLToPath6 } from "url";
21869
- import { dirname as dirname18, join as join46 } from "path";
21931
+ import { dirname as dirname18, join as join47 } from "path";
21870
21932
  import { existsSync as existsSync31 } from "fs";
21871
21933
  var DEFAULT_HEALTH_PORT = 9848;
21872
21934
  async function startHealthWorker(options = {}) {
@@ -21942,7 +22004,7 @@ function defaultLogger2() {
21942
22004
  }
21943
22005
  function resolveWorkerEntry2() {
21944
22006
  const here = dirname18(fileURLToPath6(import.meta.url));
21945
- const candidates = [join46(here, "healthWorkerThread.js"), join46(here, "healthWorkerThread.ts")];
22007
+ const candidates = [join47(here, "healthWorkerThread.js"), join47(here, "healthWorkerThread.ts")];
21946
22008
  for (const candidate of candidates) {
21947
22009
  if (existsSync31(candidate)) return candidate;
21948
22010
  }
@@ -22186,7 +22248,7 @@ function prepareProjectDirectory(projectDir, options, policy) {
22186
22248
  if (!candidate) return null;
22187
22249
  const absProjectDir = policy ? resolve11(policy.projectsDir, candidate) : resolve11(candidate);
22188
22250
  const shown = policy ? candidate : absProjectDir;
22189
- if (policy && !isAllowedProjectPath(policy.projectsDir, absProjectDir) || !existsSync32(absProjectDir) || !statSync12(absProjectDir).isDirectory()) {
22251
+ if (policy && !isAllowedProjectPath(policy.projectsDir, absProjectDir) || !existsSync32(absProjectDir) || !statSync11(absProjectDir).isDirectory()) {
22190
22252
  return { error: `Project directory not found: ${shown}` };
22191
22253
  }
22192
22254
  const entry = options.entryFile || "index.html";
@@ -22212,8 +22274,8 @@ async function resolveInlineRenderHtml(body) {
22212
22274
  }
22213
22275
  function materializeInlineProject(html, options) {
22214
22276
  const tempRoot = process.env.PRODUCER_TMP_PROJECT_DIR || tmpdir6();
22215
- const tempProjectDir = mkdtempSync2(join47(tempRoot, "producer-project-"));
22216
- writeFileSync13(join47(tempProjectDir, "index.html"), html, "utf-8");
22277
+ const tempProjectDir = mkdtempSync2(join48(tempRoot, "producer-project-"));
22278
+ writeFileSync13(join48(tempProjectDir, "index.html"), html, "utf-8");
22217
22279
  return {
22218
22280
  prepared: {
22219
22281
  input: { projectDir: tempProjectDir, ...options },
@@ -22289,7 +22351,7 @@ function publicPerfSummary(job) {
22289
22351
  return job.perfSummary ? { ...job.perfSummary, renderId: void 0 } : null;
22290
22352
  }
22291
22353
  function outputFileSize(path) {
22292
- return existsSync32(path) ? statSync12(path).size : 0;
22354
+ return existsSync32(path) ? statSync11(path).size : 0;
22293
22355
  }
22294
22356
  function createBlockingProgressReporter(log, requestId) {
22295
22357
  let lastLoggedPct = -10;
@@ -22620,8 +22682,8 @@ function createRenderHandlers(options = {}) {
22620
22682
  store.delete(token);
22621
22683
  return c.json({ success: false, error: "Output artifact file missing" }, 404);
22622
22684
  }
22623
- const stats = statSync12(artifact.path);
22624
- return new Response(createReadStream5(artifact.path), {
22685
+ const stats = statSync11(artifact.path);
22686
+ return new Response(createReadStream6(artifact.path), {
22625
22687
  headers: {
22626
22688
  "content-type": "video/mp4",
22627
22689
  "content-length": String(stats.size),
@@ -22757,7 +22819,7 @@ function startServer(options = {}) {
22757
22819
  });
22758
22820
  async function shutdown(signal) {
22759
22821
  log.info(`Received ${signal}, shutting down`);
22760
- const { drainBrowserPool } = await import("./src-COKNEXLI.js");
22822
+ const { drainBrowserPool } = await import("./src-UG2WAJ4N.js");
22761
22823
  await drainBrowserPool().catch(() => {
22762
22824
  });
22763
22825
  const handle = await Promise.race([
@@ -22795,7 +22857,7 @@ if (isPublicServerEntry) {
22795
22857
  // ../producer/src/services/distributed/planV2Execution.ts
22796
22858
  import { mkdtempSync as mkdtempSync3, rmSync as rmSync19 } from "fs";
22797
22859
  import { tmpdir as tmpdir7 } from "os";
22798
- import { join as join49 } from "path";
22860
+ import { join as join50 } from "path";
22799
22861
 
22800
22862
  // ../producer/src/services/distributed/assemble.ts
22801
22863
  import {
@@ -22805,10 +22867,10 @@ import {
22805
22867
  readFileSync as readFileSync15,
22806
22868
  readdirSync as readdirSync12,
22807
22869
  rmSync as rmSync18,
22808
- statSync as statSync13,
22870
+ statSync as statSync12,
22809
22871
  writeFileSync as writeFileSync14
22810
22872
  } from "fs";
22811
- import { basename as basename8, dirname as dirname20, join as join48 } from "path";
22873
+ import { basename as basename8, dirname as dirname20, join as join49 } from "path";
22812
22874
  function cfrRateControlArgs(locked) {
22813
22875
  const preset = getEncoderPreset(locked.quality ?? "standard", "mp4");
22814
22876
  if (locked.crf == null && locked.bitrate) {
@@ -22836,7 +22898,7 @@ async function assemble(planDir, chunkOutputs, audioPath, outputPath, options) {
22836
22898
  outputPath,
22837
22899
  durationMs: Date.now() - start,
22838
22900
  framesEncoded: plan2.totalFrames,
22839
- fileSize: statSync13(outputPath).size
22901
+ fileSize: statSync12(outputPath).size
22840
22902
  };
22841
22903
  }
22842
22904
  const format = plan2.dimensions.format;
@@ -22864,7 +22926,7 @@ async function assemble(planDir, chunkOutputs, audioPath, outputPath, options) {
22864
22926
  };
22865
22927
  try {
22866
22928
  const videoSources = cfrEncoder ? [await reencodeCfr(ctx, chunkPaths, cfrEncoder)] : chunkPaths;
22867
- const finalPath = join48(workDir, `output.${format}`);
22929
+ const finalPath = join49(workDir, `output.${format}`);
22868
22930
  const audio = audioPath !== null && existsSync33(audioPath) ? audioPath : null;
22869
22931
  await writeJoined(ctx, videoSources, audio, finalPath);
22870
22932
  renameWithRetry(finalPath, outputPath);
@@ -22883,7 +22945,7 @@ async function assemble(planDir, chunkOutputs, audioPath, outputPath, options) {
22883
22945
  });
22884
22946
  }
22885
22947
  }
22886
- const fileSize = existsSync33(outputPath) ? statSync13(outputPath).size : 0;
22948
+ const fileSize = existsSync33(outputPath) ? statSync12(outputPath).size : 0;
22887
22949
  return {
22888
22950
  ...referenceBackgroundResult(plan2[REFERENCE_BACKGROUND_FIELD]),
22889
22951
  outputPath,
@@ -22893,8 +22955,8 @@ async function assemble(planDir, chunkOutputs, audioPath, outputPath, options) {
22893
22955
  };
22894
22956
  }
22895
22957
  function readAssemblePlan(planDir, chunkPaths) {
22896
- const planJsonPath = join48(planDir, "plan.json");
22897
- const chunksJsonPath = join48(planDir, "meta", "chunks.json");
22958
+ const planJsonPath = join49(planDir, "plan.json");
22959
+ const chunksJsonPath = join49(planDir, "meta", "chunks.json");
22898
22960
  if (!existsSync33(planJsonPath)) {
22899
22961
  throw new Error(`[assemble] planDir missing plan.json: ${planJsonPath}`);
22900
22962
  }
@@ -22945,7 +23007,7 @@ function cfrEncodeArgs(inputArgs, encoder, fpsArg) {
22945
23007
  return args;
22946
23008
  }
22947
23009
  async function reencodeCfr(ctx, chunkPaths, encoder) {
22948
- const cfrOutputPath = join48(ctx.workDir, `cfr.${ctx.format}`);
23010
+ const cfrOutputPath = join49(ctx.workDir, `cfr.${ctx.format}`);
22949
23011
  const cfrArgs = cfrEncodeArgs(videoInputArgs(ctx, chunkPaths), encoder, ctx.fpsArg);
22950
23012
  appendRenderProvenanceArgs(cfrArgs, cfrOutputPath);
22951
23013
  cfrArgs.push("-y", cfrOutputPath);
@@ -22972,7 +23034,7 @@ async function writeJoined(ctx, videoSources, audioPath, finalPath) {
22972
23034
  );
22973
23035
  return;
22974
23036
  }
22975
- const paddedAudioPath = join48(ctx.workDir, "audio-padded.m4a");
23037
+ const paddedAudioPath = join49(ctx.workDir, "audio-padded.m4a");
22976
23038
  const padTrimResult = await ctx.timed(
22977
23039
  "audioMs",
22978
23040
  () => padOrTrimAudioToVideoFrameCount({
@@ -23012,11 +23074,11 @@ async function writeJoined(ctx, videoSources, audioPath, finalPath) {
23012
23074
  }
23013
23075
  }
23014
23076
  function concatDemuxerInput(chunkPaths, workDir, fpsArg) {
23015
- const listPath = join48(workDir, "concat-list.txt");
23077
+ const listPath = join49(workDir, "concat-list.txt");
23016
23078
  const body = chunkPaths.map((path) => `file '${path.replace(/'/g, "'\\''")}'`).join("\n");
23017
23079
  writeFileSync14(listPath, `${body}
23018
23080
  `, "utf-8");
23019
- return ["-r", fpsArg, "-f", "concat", "-safe", "0", "-i", listPath];
23081
+ return ["-r", fpsArg, ...concatListInputArgs(listPath)];
23020
23082
  }
23021
23083
  async function probeJoinedFrameInfo(videoPaths, fps, signal) {
23022
23084
  const infos = await Promise.all(
@@ -23050,11 +23112,11 @@ function stitchesSeparateAudio(planDir) {
23050
23112
  return lockedAudio(planDir).separateAudio === true;
23051
23113
  }
23052
23114
  function planFormat(planDir) {
23053
- const plan2 = JSON.parse(readFileSync15(join48(planDir, "plan.json"), "utf-8"));
23115
+ const plan2 = JSON.parse(readFileSync15(join49(planDir, "plan.json"), "utf-8"));
23054
23116
  return plan2.dimensions.format;
23055
23117
  }
23056
23118
  function lockedAudio(planDir) {
23057
- const encoderJsonPath = join48(planDir, "meta", "encoder.json");
23119
+ const encoderJsonPath = join49(planDir, "meta", "encoder.json");
23058
23120
  if (!existsSync33(encoderJsonPath)) return {};
23059
23121
  return JSON.parse(readFileSync15(encoderJsonPath, "utf-8"));
23060
23122
  }
@@ -23064,7 +23126,7 @@ function readCfrEncoder(planDir, format) {
23064
23126
  `[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.`
23065
23127
  );
23066
23128
  }
23067
- const encoderJsonPath = join48(planDir, "meta", "encoder.json");
23129
+ const encoderJsonPath = join49(planDir, "meta", "encoder.json");
23068
23130
  if (!existsSync33(encoderJsonPath)) {
23069
23131
  throw new Error(`[assemble] planDir missing meta/encoder.json: ${encoderJsonPath}`);
23070
23132
  }
@@ -23081,7 +23143,7 @@ function mergePngFrameDirs(chunkPaths, outputPath, totalFrames, audioPath, start
23081
23143
  mkdirSync20(outputPath, { recursive: true });
23082
23144
  let globalIdx = 0;
23083
23145
  for (const chunkDir of chunkPaths) {
23084
- if (!statSync13(chunkDir).isDirectory()) {
23146
+ if (!statSync12(chunkDir).isDirectory()) {
23085
23147
  throw new Error(
23086
23148
  `[assemble] png-sequence chunk must be a directory: ${chunkDir} (got a file)`
23087
23149
  );
@@ -23091,8 +23153,8 @@ function mergePngFrameDirs(chunkPaths, outputPath, totalFrames, audioPath, start
23091
23153
  throw new Error(`[assemble] png-sequence chunk has no frames: ${chunkDir}`);
23092
23154
  }
23093
23155
  for (const frame of frames) {
23094
- const dst = join48(outputPath, formatExportFrameName(globalIdx, "png"));
23095
- cpSync3(join48(chunkDir, frame), dst);
23156
+ const dst = join49(outputPath, formatExportFrameName(globalIdx, "png"));
23157
+ cpSync3(join49(chunkDir, frame), dst);
23096
23158
  globalIdx += 1;
23097
23159
  }
23098
23160
  }
@@ -23102,13 +23164,13 @@ function mergePngFrameDirs(chunkPaths, outputPath, totalFrames, audioPath, start
23102
23164
  );
23103
23165
  }
23104
23166
  if (audioPath !== null && existsSync33(audioPath)) {
23105
- const sidecar = join48(outputPath, MIXED_AUDIO_FILENAME);
23167
+ const sidecar = join49(outputPath, MIXED_AUDIO_FILENAME);
23106
23168
  cpSync3(audioPath, sidecar);
23107
23169
  }
23108
23170
  let fileSize = 0;
23109
23171
  for (const name of readdirSync12(outputPath)) {
23110
23172
  try {
23111
- fileSize += statSync13(join48(outputPath, name)).size;
23173
+ fileSize += statSync12(join49(outputPath, name)).size;
23112
23174
  } catch {
23113
23175
  }
23114
23176
  }
@@ -23122,8 +23184,8 @@ function mergePngFrameDirs(chunkPaths, outputPath, totalFrames, audioPath, start
23122
23184
 
23123
23185
  // ../producer/src/services/distributed/planV2Execution.ts
23124
23186
  async function renderChunkV2(planV2Dir, chunkIndex, outputChunkPath, options) {
23125
- const workRoot = mkdtempSync3(join49(tmpdir7(), "hf-plan-v2-chunk-"));
23126
- const materializedPlanDir = join49(workRoot, "plan");
23187
+ const workRoot = mkdtempSync3(join50(tmpdir7(), "hf-plan-v2-chunk-"));
23188
+ const materializedPlanDir = join50(workRoot, "plan");
23127
23189
  try {
23128
23190
  materializePlanV2Target(planV2Dir, { role: "chunk", chunkIndex }, materializedPlanDir);
23129
23191
  return await renderChunk(materializedPlanDir, chunkIndex, outputChunkPath, options);
@@ -23132,8 +23194,8 @@ async function renderChunkV2(planV2Dir, chunkIndex, outputChunkPath, options) {
23132
23194
  }
23133
23195
  }
23134
23196
  async function assembleV2(planV2Dir, chunkPaths, outputPath, options) {
23135
- const workRoot = mkdtempSync3(join49(tmpdir7(), "hf-plan-v2-assembler-"));
23136
- const materializedPlanDir = join49(workRoot, "plan");
23197
+ const workRoot = mkdtempSync3(join50(tmpdir7(), "hf-plan-v2-assembler-"));
23198
+ const materializedPlanDir = join50(workRoot, "plan");
23137
23199
  try {
23138
23200
  const materialized = materializePlanV2Target(
23139
23201
  planV2Dir,
@@ -23153,9 +23215,9 @@ async function assembleV2(planV2Dir, chunkPaths, outputPath, options) {
23153
23215
  }
23154
23216
 
23155
23217
  // ../producer/src/services/distributed/projectHash.ts
23156
- import { closeSync as closeSync7, openSync as openSync7, readdirSync as readdirSync13, readSync as readSync5, realpathSync as realpathSync2, statSync as statSync14 } from "fs";
23218
+ import { closeSync as closeSync7, openSync as openSync7, readdirSync as readdirSync13, readSync as readSync5, realpathSync as realpathSync2, statSync as statSync13 } from "fs";
23157
23219
  import { createHash as createHash8 } from "crypto";
23158
- import { join as join50, sep as sep7 } from "path";
23220
+ import { join as join51, sep as sep7 } from "path";
23159
23221
  var READ_CHUNK_BYTES = 256 * 1024;
23160
23222
 
23161
23223
  // ../producer/src/services/distributed/audioSidecar.ts