hyperframes 0.9.69 → 0.9.71

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 (312) hide show
  1. package/dist/{add-OQ4ZXNC7.js → add-XWHDS7YX.js} +16 -16
  2. package/dist/{agentPromptGenerator-GUD24KW2.js → agentPromptGenerator-BLMDKRCG.js} +10 -10
  3. package/dist/{animatedGifPrep-BKKYEUKH.js → animatedGifPrep-UE462FBV.js} +10 -10
  4. package/dist/api.js +38 -38
  5. package/dist/{asset-2P4LAYTV.js → asset-BLC34AN6.js} +6 -6
  6. package/dist/{assetCataloger-KI45LYJP.js → assetCataloger-MG6KCN75.js} +11 -11
  7. package/dist/{audio-MKXMEX7T.js → audio-YAFY5J25.js} +25 -25
  8. package/dist/{auth-LPCMSL7H.js → auth-4CRMXDLN.js} +4 -4
  9. package/dist/{autoUpdate-SI5HXYS2.js → autoUpdate-RMRYEKVS.js} +4 -4
  10. package/dist/{avatars-KQV6VM6N.js → avatars-JTVLM4MK.js} +18 -18
  11. package/dist/{backgroundChecks-AUVPQSZ3.js → backgroundChecks-SL33RDD3.js} +5 -5
  12. package/dist/backgroundChecksWorker.js +5 -5
  13. package/dist/{batchRender-7KFJQNBY.js → batchRender-CZ6LXSKM.js} +5 -5
  14. package/dist/{beats-JHEEJ2G6.js → beats-SSHPB25F.js} +14 -14
  15. package/dist/{benchmark-GLT62VBC.js → benchmark-2VOEXNAG.js} +16 -16
  16. package/dist/{billing-D63PXBEG.js → billing-MA7256GL.js} +18 -18
  17. package/dist/{browser-L4XVUSJX.js → browser-ZTPHXS3J.js} +11 -11
  18. package/dist/{bundleWithLocalizedFonts-XEGC45Y4.js → bundleWithLocalizedFonts-ZPBNLZ6L.js} +1 -1
  19. package/dist/{capture-3NE7JKCY.js → capture-FLEHXO4D.js} +20 -22
  20. package/dist/{capture-PFEPJ5CQ.js → capture-WLCFTBVY.js} +7 -7
  21. package/dist/{captureCompositionFrame-Q6YPUL24.js → captureCompositionFrame-Y27APMZK.js} +17 -17
  22. package/dist/{catalog-MUFHKZWR.js → catalog-MB363QIW.js} +17 -17
  23. package/dist/{catch-up-U6OBJCO7.js → catch-up-M5RL2PYQ.js} +11 -11
  24. package/dist/{check-RDN4RKVS.js → check-R6BJV65S.js} +47 -47
  25. package/dist/{checkAudio-SFPBOZBY.js → checkAudio-CTBAZEZ4.js} +15 -15
  26. package/dist/{checkBrowser-FAWJXPTX.js → checkBrowser-WNCJM7D4.js} +40 -40
  27. package/dist/{chunk-VPIA3GTO.js → chunk-2LTW5J45.js} +11 -12
  28. package/dist/{chunk-FYV3LZUN.js → chunk-2NPP73LA.js} +2 -2
  29. package/dist/{chunk-3HDWAGMI.js → chunk-2QH7LC2N.js} +2 -2
  30. package/dist/{chunk-F272XKKS.js → chunk-2WDUJDEH.js} +2 -2
  31. package/dist/{chunk-HJAB3JOG.js → chunk-3AVPJZGU.js} +1 -1
  32. package/dist/{chunk-OB2XFBWG.js → chunk-3MJHEGWD.js} +12 -9
  33. package/dist/{chunk-V7W64LZY.js → chunk-3NP5S3G6.js} +1 -1
  34. package/dist/{chunk-QBMXTRZ2.js → chunk-3OTSUGBE.js} +1 -1
  35. package/dist/{chunk-XQTNYI52.js → chunk-3OY4DOGB.js} +3 -3
  36. package/dist/{chunk-7QNCNGN6.js → chunk-47KES52H.js} +1 -1
  37. package/dist/{chunk-YOCGTMQB.js → chunk-4KM5FC2Y.js} +2 -2
  38. package/dist/{chunk-OPJBIXRI.js → chunk-4L6VD5EC.js} +1 -1
  39. package/dist/{chunk-SQBVJUBS.js → chunk-4VNK4SSU.js} +3 -3
  40. package/dist/{chunk-X2EBEAN2.js → chunk-5QBONJKT.js} +1 -1
  41. package/dist/{chunk-MTOPOZIM.js → chunk-5VHQS6YQ.js} +2 -2
  42. package/dist/{chunk-KKJRKVZ5.js → chunk-6ESQKLNR.js} +1 -1
  43. package/dist/{chunk-PYSHL3ZA.js → chunk-6OCWJJLC.js} +13 -9
  44. package/dist/{chunk-ARZI5CTG.js → chunk-6UIELAGX.js} +1 -1
  45. package/dist/{chunk-I6O4DZI7.js → chunk-6UUF7VEA.js} +1 -1
  46. package/dist/{chunk-HJXFRTK3.js → chunk-72S3VDZS.js} +1 -1
  47. package/dist/{chunk-WOPCPR72.js → chunk-77H7YCR4.js} +2 -2
  48. package/dist/{chunk-BBDE5NOY.js → chunk-77PZ7BBT.js} +1 -1
  49. package/dist/{chunk-3JXFI7JB.js → chunk-A6ZYZED3.js} +22 -22
  50. package/dist/{chunk-5NRI2GZ2.js → chunk-AJ6EPEUU.js} +3 -3
  51. package/dist/{chunk-PCHSXE5J.js → chunk-ARBHOMLB.js} +1 -1
  52. package/dist/{chunk-MKSJX4I6.js → chunk-BNCJBI7K.js} +2 -2
  53. package/dist/{chunk-O3HO75D5.js → chunk-C4262VTW.js} +1 -1
  54. package/dist/{chunk-OTXQ4VDJ.js → chunk-CNOH3G6W.js} +3 -3
  55. package/dist/{chunk-HUF42U37.js → chunk-CRTKWMS5.js} +12 -12
  56. package/dist/{chunk-OUXG24ZI.js → chunk-CSXAUBGU.js} +1 -1
  57. package/dist/{chunk-LAQLTWMD.js → chunk-CW3TCFCI.js} +12 -8
  58. package/dist/{chunk-4K5UJMKD.js → chunk-DBLPDI6N.js} +7 -7
  59. package/dist/{chunk-KCUSOXKM.js → chunk-DE3BPVY4.js} +2 -2
  60. package/dist/{chunk-T5RAZMWO.js → chunk-DE7TZC76.js} +10 -10
  61. package/dist/{chunk-IL4LPAZQ.js → chunk-DHPUX7Q2.js} +1 -1
  62. package/dist/{chunk-GG6GYXUV.js → chunk-DHSVK2NO.js} +4 -4
  63. package/dist/{chunk-UHEM6SYQ.js → chunk-DLBAENCZ.js} +28 -31
  64. package/dist/{chunk-DJWBK4UK.js → chunk-DMSWCKVS.js} +9 -9
  65. package/dist/{chunk-PGQEXWKK.js → chunk-DPKQTAJH.js} +3 -3
  66. package/dist/{chunk-EWXYRRN7.js → chunk-DVUB3NJI.js} +4 -4
  67. package/dist/{chunk-EECHZKSA.js → chunk-E7D7KG7O.js} +1 -20
  68. package/dist/{chunk-QEXNYXWZ.js → chunk-EHDUOOIH.js} +3 -3
  69. package/dist/{chunk-YZPBPF7E.js → chunk-ETEKL25D.js} +2 -2
  70. package/dist/{chunk-MTKXKULM.js → chunk-EXQTV3OZ.js} +1 -1
  71. package/dist/{chunk-I2B2TRZG.js → chunk-EXZQ7VUS.js} +1 -1
  72. package/dist/{chunk-5CC5NT52.js → chunk-FMA53TF7.js} +1 -1
  73. package/dist/{chunk-5E46EQ3U.js → chunk-FPVUZ4OL.js} +1 -1
  74. package/dist/{chunk-BBCXLNFM.js → chunk-GEKUZPSK.js} +4 -4
  75. package/dist/{chunk-JO3I4BXO.js → chunk-GN6CIYSK.js} +2 -2
  76. package/dist/{chunk-PGRXYVKK.js → chunk-GYK5TUEU.js} +3 -3
  77. package/dist/{chunk-62DXFOO5.js → chunk-HAMBGPXQ.js} +2 -2
  78. package/dist/{chunk-W74TM3NV.js → chunk-HFXOEUXM.js} +2 -2
  79. package/dist/{chunk-YOIK5SLW.js → chunk-HIG3JV5T.js} +10 -10
  80. package/dist/{chunk-K6GODNZT.js → chunk-HZGO2GNX.js} +1 -1
  81. package/dist/{chunk-NE5YEOIA.js → chunk-IEQCOWZU.js} +2 -2
  82. package/dist/{chunk-4OW5VENT.js → chunk-IPSLXUKG.js} +2 -2
  83. package/dist/{chunk-3TSD7EQ2.js → chunk-IVSDEUPE.js} +15 -15
  84. package/dist/{chunk-ME6EKVXB.js → chunk-IYVCMBYV.js} +5 -5
  85. package/dist/{chunk-RDNVSDFY.js → chunk-JOJ35UOG.js} +2 -2
  86. package/dist/{chunk-4YNVKPGH.js → chunk-JPQNMMYT.js} +2 -2
  87. package/dist/{chunk-Z67ELZGQ.js → chunk-KDQDCSTA.js} +18 -0
  88. package/dist/{chunk-LMUPRQ3G.js → chunk-KRRQGJIF.js} +1 -1
  89. package/dist/chunk-KTVURB6P.js +5148 -0
  90. package/dist/{chunk-HY67LTYS.js → chunk-KXL4WNPB.js} +1 -1
  91. package/dist/{chunk-TIH6APOB.js → chunk-LTRRYJSA.js} +3 -3
  92. package/dist/{chunk-EYW6PB36.js → chunk-M5MDKF6U.js} +3 -3
  93. package/dist/{chunk-GHXVDBBC.js → chunk-MEIQSBM3.js} +2 -2
  94. package/dist/{chunk-YEMCMFL7.js → chunk-MHVMNSCB.js} +2 -2
  95. package/dist/{chunk-42PB3OZT.js → chunk-MODACKQY.js} +2 -2
  96. package/dist/{chunk-JAO46FOY.js → chunk-MRXUJ3MV.js} +8 -8
  97. package/dist/{chunk-H2LAM5FR.js → chunk-N242PSDK.js} +2 -2
  98. package/dist/{chunk-QDMLR2K6.js → chunk-NBGYJ7B3.js} +4 -4
  99. package/dist/{chunk-3RN4ZGGL.js → chunk-ND53YU4M.js} +2 -2
  100. package/dist/{chunk-6EX3FAXP.js → chunk-NWGLQ7SR.js} +1 -1
  101. package/dist/{chunk-CKLS2RVS.js → chunk-NWOMYHWS.js} +2 -2
  102. package/dist/{chunk-SDOVSUQP.js → chunk-NWZXJ4EH.js} +1 -1
  103. package/dist/{chunk-FPLH6C55.js → chunk-OPDA3GMT.js} +2 -2
  104. package/dist/{chunk-OHGEF6QU.js → chunk-OVBCL5FU.js} +4 -4
  105. package/dist/{chunk-WMOQ57TW.js → chunk-P77PIIRV.js} +1 -1
  106. package/dist/{chunk-NEFSXXXQ.js → chunk-PFVEPQLT.js} +1 -1
  107. package/dist/{chunk-VBNZJYTW.js → chunk-PQLTN44Y.js} +1 -1
  108. package/dist/{chunk-5KWT5ELY.js → chunk-Q2ZB6CXS.js} +4 -4
  109. package/dist/{chunk-5ZJVIDUI.js → chunk-Q3XMQVDG.js} +4 -4
  110. package/dist/{chunk-4NDSGKPO.js → chunk-QURE6VDP.js} +16 -5
  111. package/dist/{chunk-GDPNIGCY.js → chunk-R6ARS4HA.js} +18 -12
  112. package/dist/{chunk-KQR4FJDI.js → chunk-R6LA7R2G.js} +5 -5
  113. package/dist/{chunk-KZ5PV5TL.js → chunk-RADFYYSJ.js} +19 -2
  114. package/dist/{chunk-OB3SAKXM.js → chunk-RBIU5EPK.js} +1 -1
  115. package/dist/{chunk-2IWNTFTH.js → chunk-RJHHZEFV.js} +2 -2
  116. package/dist/{chunk-OH6B5TJL.js → chunk-RKVDGDTB.js} +6 -6
  117. package/dist/{chunk-SMLMTEV6.js → chunk-RQ4N6A4W.js} +1 -1
  118. package/dist/{chunk-TCBQLCIH.js → chunk-RS34CIQG.js} +5 -5
  119. package/dist/{chunk-VPZDUCSM.js → chunk-S3JPCNRU.js} +1 -1
  120. package/dist/{chunk-ZVA57LRU.js → chunk-S44NPI2H.js} +1 -1
  121. package/dist/{chunk-6WPMMYRT.js → chunk-S6A2CTIE.js} +235 -105
  122. package/dist/{chunk-B7Z757RJ.js → chunk-SBD775KI.js} +1 -1
  123. package/dist/{chunk-A3G5SSWK.js → chunk-T2J2E27U.js} +1 -1
  124. package/dist/{chunk-DRB5UK2D.js → chunk-T62PZIBF.js} +4 -4
  125. package/dist/{chunk-FG3DCSJ4.js → chunk-T6FUWIRT.js} +5 -5
  126. package/dist/{chunk-24FLLQSF.js → chunk-TYCJTCIL.js} +1 -1
  127. package/dist/{chunk-CBJDDSLN.js → chunk-U4C2AK5M.js} +12 -12
  128. package/dist/{chunk-RWDZPTDG.js → chunk-UKFJUEAD.js} +1 -1
  129. package/dist/{chunk-TGXF6UDS.js → chunk-UMRF36PX.js} +369 -282
  130. package/dist/{chunk-733AQ5WF.js → chunk-URATFSHD.js} +1 -1
  131. package/dist/{chunk-MUZBTTQE.js → chunk-V4XODAJ3.js} +2 -2
  132. package/dist/{chunk-SRYGFL4X.js → chunk-VK2J45KH.js} +2 -2
  133. package/dist/{chunk-AEH6I3VA.js → chunk-VSUDCHZG.js} +2 -2
  134. package/dist/{chunk-N3P2V7RS.js → chunk-W5GEGL53.js} +2 -2
  135. package/dist/{chunk-Z7GGJNHT.js → chunk-WA3VZSMD.js} +10 -10
  136. package/dist/{chunk-7XA7AZGV.js → chunk-WQ57PQIL.js} +2 -2
  137. package/dist/{chunk-NKRVZC5S.js → chunk-WZQ6WGFC.js} +1 -1
  138. package/dist/{chunk-E5UU5MU2.js → chunk-X6XTWKCX.js} +101 -34
  139. package/dist/{chunk-J3FUIWZX.js → chunk-XJQKSMOK.js} +2 -2
  140. package/dist/{chunk-MAFH2AJE.js → chunk-XNKIHG7E.js} +13 -13
  141. package/dist/{chunk-7QV5IJB7.js → chunk-YCJJRFHP.js} +1 -1
  142. package/dist/{chunk-4QCDMVB3.js → chunk-YCT3TQ53.js} +1 -1
  143. package/dist/{chunk-CPQTWPMM.js → chunk-Z56VK5EM.js} +1 -1
  144. package/dist/{chunk-BFR4Z6XZ.js → chunk-ZFGXKQS2.js} +2 -2
  145. package/dist/{chunk-64HSIFOR.js → chunk-ZH3Z4CMQ.js} +3 -3
  146. package/dist/{clean-PBUDBKN3.js → clean-4QI63VWI.js} +26 -26
  147. package/dist/cli.js +70 -70
  148. package/dist/{cloud-DMWF7YD7.js → cloud-2D2FPOAS.js} +8 -8
  149. package/dist/{cloud-WS73EESF.js → cloud-4AYLCFXV.js} +4 -4
  150. package/dist/{cloudrun-QMDS5WTP.js → cloudrun-OW4PMMBU.js} +10 -10
  151. package/dist/{compare-NHKYHUFA.js → compare-X7574P5M.js} +38 -38
  152. package/dist/{compiler-VP7WQKBE.js → compiler-FBCFBEVR.js} +8 -6
  153. package/dist/{component-5BFZ6K3S.js → component-IAATW22P.js} +7 -7
  154. package/dist/{compositions-66KLKTAT.js → compositions-3LUIEPYT.js} +18 -18
  155. package/dist/{curve-HL4GYKLW.js → curve-7H65IJGX.js} +15 -15
  156. package/dist/{cuts-A3DIDUE5.js → cuts-YMQPCCMK.js} +16 -16
  157. package/dist/{delete-2FH5U3BS.js → delete-LTH43TQ2.js} +12 -12
  158. package/dist/{deploy-T2I6TX6S.js → deploy-X4NGXNMK.js} +6 -6
  159. package/dist/{describeProject-CGO3JNDQ.js → describeProject-2MZQPUIN.js} +12 -12
  160. package/dist/{destroy-XILHHKHS.js → destroy-F27X4BSW.js} +6 -6
  161. package/dist/{deterministicFonts-645ILNLP.js → deterministicFonts-LAVFR7ST.js} +2 -2
  162. package/dist/{diff-H7YAKNOY.js → diff-3XOE6HG3.js} +37 -37
  163. package/dist/{dist-XBACRUL3.js → dist-KK4LXXZ2.js} +4 -4
  164. package/dist/{dist-D2LKDDWO.js → dist-LU5D4LW7.js} +4 -4
  165. package/dist/{dist-653H5YTV.js → dist-YVWNTGL3.js} +13 -13
  166. package/dist/{doctor-MIR7OXRP.js → doctor-QPOIJ2NR.js} +19 -19
  167. package/dist/{dotEnv-ZPSOMSOP.js → dotEnv-YOQMWFNF.js} +5 -7
  168. package/dist/{energy-H5SUZGZT.js → energy-VJ27SJEY.js} +16 -16
  169. package/dist/{events-T3ALKAW6.js → events-2JLEGPPH.js} +10 -10
  170. package/dist/{events-Z4LW2Q7K.js → events-CZND4KW2.js} +5 -5
  171. package/dist/{events-LXKVJNED.js → events-V7P42MG3.js} +18 -18
  172. package/dist/{execute-EY26E6OZ.js → execute-2JP3CJMK.js} +30 -30
  173. package/dist/{extract-5OMVLJS6.js → extract-46N3SUQY.js} +16 -16
  174. package/dist/{face-C3EYNUI7.js → face-7V6G7KYX.js} +16 -16
  175. package/dist/{face-3CA2ELZF.js → face-YXPQ5D5V.js} +12 -12
  176. package/dist/{feedback-JVZM3H3Y.js → feedback-77SRGPAG.js} +17 -17
  177. package/dist/{ffmpeg-SHN36SBB.js → ffmpeg-QAULWC67.js} +10 -10
  178. package/dist/{figma-GFBJK253.js → figma-OD5ESSI4.js} +3 -3
  179. package/dist/fontLocalizeCli.js +15 -15
  180. package/dist/{frames-VUKOJHMC.js → frames-MS6XRSHU.js} +17 -17
  181. package/dist/{generate-LBZ7YBAJ.js → generate-ANGMXYC3.js} +29 -29
  182. package/dist/{get-XG6EMYSN.js → get-S6WXKTDS.js} +12 -12
  183. package/dist/{gpuPolicy-EPYGPUWY.js → gpuPolicy-VQFOQQYQ.js} +10 -10
  184. package/dist/{grade-compare-QEAK2WAN.js → grade-compare-L67KOIK7.js} +37 -37
  185. package/dist/{hands-D5FFNG7P.js → hands-35AMXCAK.js} +18 -18
  186. package/dist/hangReport.js +2 -2
  187. package/dist/{heifImagePrep-EPHLAUQS.js → heifImagePrep-DCWFFQRJ.js} +11 -11
  188. package/dist/{help-RGE2WSYV.js → help-GT2BYSUO.js} +1 -1
  189. package/dist/{history-6AR7FJP6.js → history-TAZ3JKGK.js} +14 -14
  190. package/dist/hyperframe.manifest.json +1 -1
  191. package/dist/hyperframe.runtime.iife.js +72 -72
  192. package/dist/hyperframes-player.global.js +3 -3
  193. package/dist/{info-ID4PL6UT.js → info-EDVUZ6C5.js} +18 -18
  194. package/dist/{init-SHB3DP6L.js → init-BSVJKLRB.js} +32 -32
  195. package/dist/{ink-I7LJRWCL.js → ink-LIEJHJD6.js} +16 -16
  196. package/dist/{inspect-5WQ44QNB.js → inspect-YHEUR53N.js} +41 -41
  197. package/dist/inspection.js +1 -2088
  198. package/dist/{installer-X4QZF2DI.js → installer-Y7MOWIYS.js} +6 -6
  199. package/dist/{keyframes-4E3RRUEE.js → keyframes-Q2VCJDAF.js} +20 -18
  200. package/dist/{lambda-2TQJLXU6.js → lambda-MEFG5LJQ.js} +17 -17
  201. package/dist/{launch-E3YGINZ4.js → launch-FY2JFGOT.js} +11 -11
  202. package/dist/{layout-2HS6DI7K.js → layout-6W5DINBY.js} +41 -41
  203. package/dist/{lint-KM2IBX4H.js → lint-KYGSUGVZ.js} +15 -15
  204. package/dist/{lintProject-FPQL3VUS.js → lintProject-FBFR7O2G.js} +4 -4
  205. package/dist/{list-TK67T6NQ.js → list-XE5RHEEY.js} +12 -12
  206. package/dist/{localPage-FKCJ56LM.js → localPage-Z7LGTYR2.js} +10 -10
  207. package/dist/{login-KNXZW6TL.js → login-Y6BCS3JB.js} +10 -10
  208. package/dist/{logout-RTMUK5GM.js → logout-ISUH3ZWQ.js} +6 -6
  209. package/dist/{look-3MW776RP.js → look-BWLF7IML.js} +16 -16
  210. package/dist/{manager-TOFBFPBV.js → manager-EIIBQKQX.js} +11 -11
  211. package/dist/{manager-AA3ZNHAP.js → manager-TOS3JZ3D.js} +4 -4
  212. package/dist/{measure-FYVTCZOB.js → measure-JXWBOYEX.js} +12 -12
  213. package/dist/{media-TZ62KQW4.js → media-EGNEEACI.js} +11 -11
  214. package/dist/{media-treatment-E63ULHVY.js → media-treatment-XEGZQEFP.js} +20 -20
  215. package/dist/{media-use-FMUH7ZUS.js → media-use-EFQ2BPQM.js} +11 -11
  216. package/dist/{models-TN7Q6LHX.js → models-M5SCRKPF.js} +15 -15
  217. package/dist/{motionShot-BQDN72EP.js → motionShot-UQ6NTHJP.js} +21 -21
  218. package/dist/{normalize-audio-UCFVXTIJ.js → normalize-audio-5JCB2HCI.js} +14 -14
  219. package/dist/{oauth-NRCCRSM7.js → oauth-DVFQMBWX.js} +4 -4
  220. package/dist/{open-V4ZVSII2.js → open-R4MALQKL.js} +17 -17
  221. package/dist/{parakeetRunner-2CAJDREF.js → parakeetRunner-D4IKJLIT.js} +17 -17
  222. package/dist/{pipeline-FPO2KBRR.js → pipeline-QZIJWBVD.js} +13 -13
  223. package/dist/{plan-UVCFCV2Y.js → plan-EFAHJHAI.js} +22 -22
  224. package/dist/{play-Q5K56OLI.js → play-L5DV5IQM.js} +26 -26
  225. package/dist/{preflight-LWGJARUS.js → preflight-N47VXI3H.js} +13 -13
  226. package/dist/{present-YYOXFE4M.js → present-CVT6CHJS.js} +22 -22
  227. package/dist/{preview-HZNQXLLA.js → preview-ZIEDS5EN.js} +23 -23
  228. package/dist/{privateProjectFile-HR24FBS3.js → privateProjectFile-TURAMXG6.js} +4 -4
  229. package/dist/{probe-Q3CAECJE.js → probe-RNDZW5JD.js} +16 -16
  230. package/dist/{producer-NUMTF4NV.js → producer-CH55FS26.js} +1 -1
  231. package/dist/{projectConfig-MTV36AK5.js → projectConfig-E3FY2DBH.js} +8 -8
  232. package/dist/{publication-RYPB4ECT.js → publication-DO2SCIXS.js} +4 -4
  233. package/dist/{publish-6LEWK7PW.js → publish-MZDYJQPP.js} +21 -21
  234. package/dist/{receivedRecordFollow-IOWRQGUZ.js → receivedRecordFollow-QCZFP4HL.js} +7 -7
  235. package/dist/{refresh-26TY6T3T.js → refresh-UUUL77GJ.js} +6 -6
  236. package/dist/{remove-background-WTNU2B6P.js → remove-background-E73KHYRC.js} +14 -14
  237. package/dist/{render-AKSYGATG.js → render-HEPV3YU3.js} +34 -34
  238. package/dist/{render-2D2UAKFF.js → render-HYE4VCCN.js} +46 -46
  239. package/dist/{render-2CMNV3HD.js → render-U6PZWGUV.js} +7 -7
  240. package/dist/{render-batch-PJJ2IAXB.js → render-batch-JEUJ6EZD.js} +7 -7
  241. package/dist/renderSetupWorker.js +8 -8
  242. package/dist/{resolver-EOLWQUXN.js → resolver-KGEFMJ3G.js} +6 -6
  243. package/dist/{reverse-JYB76V4W.js → reverse-NKHFJU5N.js} +1 -1
  244. package/dist/{run-GROTBG7F.js → run-NU27ZVP2.js} +11 -11
  245. package/dist/{sam-PHMZPQBM.js → sam-SIUSVAOL.js} +4 -4
  246. package/dist/{screenshotCapture-MBE35AZB.js → screenshotCapture-TQND5WAK.js} +12 -12
  247. package/dist/{service-KPPBDSXJ.js → service-TQ6BSTIQ.js} +17 -17
  248. package/dist/{share-4XINQNHQ.js → share-LGS3YIO6.js} +20 -20
  249. package/dist/{sherpa-2AN24GHU.js → sherpa-XE2PVYNT.js} +16 -16
  250. package/dist/sherpaWorker.js +3 -3
  251. package/dist/skills/hyperframes/references/plugin-installation.md +1 -1
  252. package/dist/skills/hyperframes/scripts/plugin-cli.mjs +1 -1
  253. package/dist/skills/media-use/audio/scripts/audio.mjs +12 -7
  254. package/dist/skills/media-use/audio/scripts/heygen-tts.mjs +7 -4
  255. package/dist/skills/media-use/audio/scripts/lib/heygen.mjs +7 -16
  256. package/dist/skills/media-use/audio/scripts/wait-bgm.mjs +13 -7
  257. package/dist/skills/media-use/scripts/audio-duck.mjs +5 -2
  258. package/dist/skills/media-use/scripts/dither.mjs +4 -3
  259. package/dist/skills/media-use/scripts/lib/codex-provider.mjs +4 -1
  260. package/dist/skills/media-use/scripts/lib/heygen-cli.mjs +2 -1
  261. package/dist/skills/media-use/scripts/lib/heygen-search.mjs +4 -1
  262. package/dist/skills/media-use/scripts/lib/heygen-video-provider.mjs +2 -1
  263. package/dist/skills/media-use/scripts/lib/ltx-video-provider.mjs +4 -1
  264. package/dist/skills/media-use/scripts/lib/mflux-provider.mjs +5 -2
  265. package/dist/skills/media-use/scripts/lib/recipe-store.mjs +27 -4
  266. package/dist/skills/media-use/scripts/lib/sfx-provider.mjs +5 -2
  267. package/dist/skills/media-use/scripts/lib/terminal-text.d.mts +1 -0
  268. package/dist/skills/media-use/scripts/lib/terminal-text.mjs +9 -0
  269. package/dist/skills/media-use/scripts/lib/tts-local-provider.mjs +2 -1
  270. package/dist/skills/media-use/scripts/prefs.mjs +6 -3
  271. package/dist/skills/media-use/scripts/recipe.mjs +19 -9
  272. package/dist/skills/media-use/scripts/transcribe.mjs +9 -3
  273. package/dist/skills/media-use/scripts/transcript-cut.mjs +8 -5
  274. package/dist/{skills-EMPTMUD4.js → skills-PXOV33AC.js} +15 -15
  275. package/dist/{skillsUpdateCheck-2EBTDXQK.js → skillsUpdateCheck-2FBSAJ22.js} +5 -5
  276. package/dist/{snapshot-OGWDPVEW.js → snapshot-JHI2FKUO.js} +46 -46
  277. package/dist/{snapshotHeldVideos-L5G4BJMS.js → snapshotHeldVideos-BUY7XBI2.js} +11 -11
  278. package/dist/{src-UG2WAJ4N.js → src-T6K3VPXH.js} +16 -12
  279. package/dist/{src-RG4SCSGS.js → src-XJOJW5RZ.js} +13 -13
  280. package/dist/{start-6O2YSEDG.js → start-CE556AMS.js} +27 -27
  281. package/dist/{staticProjectServer-V63BNPSM.js → staticProjectServer-EAXLMYDM.js} +22 -22
  282. package/dist/{status-2WOIELO6.js → status-KNH7MD5E.js} +20 -20
  283. package/dist/studio/assets/{hyperframes-player-nG4__A3B.js → hyperframes-player-DqReb4X0.js} +1 -1
  284. package/dist/studio/assets/{index-kDyUffRn.js → index-CEWlhXBE.js} +1 -1
  285. package/dist/studio/assets/{index-C5iAFIqv.js → index-CcVJGJWt.js} +135 -135
  286. package/dist/studio/assets/{pausedVideoDecoder-IQoJJyyF.js → pausedVideoDecoder-BIHwpgUB.js} +1 -1
  287. package/dist/studio/index.html +1 -1
  288. package/dist/{studio-api-4GYCLMID.js → studio-api-F2RUYN3D.js} +13 -13
  289. package/dist/{studioServer-QX63XIEQ.js → studioServer-H66TRJEE.js} +66 -66
  290. package/dist/subCompositionWorker.js +21 -24
  291. package/dist/{sync-Z7IBEP3C.js → sync-IICYK6ZZ.js} +16 -16
  292. package/dist/{synthesize-W7KYX6CI.js → synthesize-KWGLMBF6.js} +2 -2
  293. package/dist/{system-V6IZXVU4.js → system-XT77HD36.js} +3 -3
  294. package/dist/{telemetry-SLK6NDNI.js → telemetry-7RHY5NXL.js} +10 -10
  295. package/dist/{templates-AUPWONXJ.js → templates-KNTJ7UHN.js} +18 -18
  296. package/dist/{textOverFace-GWO5YXHJ.js → textOverFace-HCQ2ARZ6.js} +3 -3
  297. package/dist/{timeline-7RPZOK45.js → timeline-IJMTJ2Z4.js} +24 -24
  298. package/dist/{tokens-JMQW7UGW.js → tokens-53F2OGSX.js} +6 -6
  299. package/dist/{transcribe-TKI4KIJK.js → transcribe-CGABVCYD.js} +32 -32
  300. package/dist/{transcribe-5DBUPMYG.js → transcribe-HQLUK6QL.js} +14 -14
  301. package/dist/{tts-ZXYMSDHK.js → tts-MRNDK2OS.js} +5 -5
  302. package/dist/{update-YP3YCDUJ.js → update-DFATNVNM.js} +16 -16
  303. package/dist/{updateCheck-INFKS2YR.js → updateCheck-ZAMNFB7U.js} +4 -4
  304. package/dist/{upgrade-HDDWKPJM.js → upgrade-ZBN3FUYF.js} +5 -5
  305. package/dist/{urlDownloader-VP7QI3OV.js → urlDownloader-27M3WTMJ.js} +9 -9
  306. package/dist/{validate-DPETQTM3.js → validate-XS6VQQWO.js} +31 -31
  307. package/dist/{video-H2JJ32WV.js → video-42GENFKJ.js} +11 -11
  308. package/dist/{voices-J6PWVAVA.js → voices-GFVEEVSX.js} +27 -27
  309. package/dist/warmCheck.js +47 -47
  310. package/dist/warmCheckClient.js +2 -2
  311. package/package.json +1 -1
  312. package/dist/chunk-VDZP4BZ5.js +0 -5146
@@ -11,26 +11,26 @@ import {
11
11
  iterateFontFamilyDeclarations,
12
12
  normalizeSystemFontPrimaryFamilies,
13
13
  resolveFontFamilyDeclarationFamilies
14
- } from "./chunk-7QNCNGN6.js";
14
+ } from "./chunk-47KES52H.js";
15
15
  import {
16
16
  Semaphore,
17
17
  prepareHeifImageInputs,
18
18
  withMediaProbeSlot
19
- } from "./chunk-YOCGTMQB.js";
19
+ } from "./chunk-4KM5FC2Y.js";
20
20
  import {
21
21
  EncoderInterruptedError,
22
22
  encoderFailureError,
23
23
  escapesAssetRoot,
24
24
  formatCaptureFrameName,
25
25
  formatExportFrameName,
26
- isPathInside,
26
+ isPathInside as isPathInside2,
27
27
  leftOutOfRender,
28
28
  outsideAssetRefusal,
29
29
  prepareAnimatedGifInputs,
30
30
  refusesOutsideLink,
31
31
  resolveRenderPaths,
32
32
  toExternalAssetKey
33
- } from "./chunk-MUZBTTQE.js";
33
+ } from "./chunk-V4XODAJ3.js";
34
34
  import {
35
35
  linksOutside
36
36
  } from "./chunk-6ACARSAZ.js";
@@ -215,8 +215,9 @@ import {
215
215
  withFfmpegProgress,
216
216
  withPublicOnlyProxy,
217
217
  writeCapturedFrame,
218
- writeUrlDownloadTelemetry
219
- } from "./chunk-E5UU5MU2.js";
218
+ writeUrlDownloadTelemetry,
219
+ writeVideoConcatList
220
+ } from "./chunk-X6XTWKCX.js";
220
221
  import {
221
222
  settleOnBrowserSafePort
222
223
  } from "./chunk-33JUCUTM.js";
@@ -232,6 +233,7 @@ import {
232
233
  import {
233
234
  assignBundledRuntimeCompositionIds,
234
235
  boundMediaSrc,
236
+ dropAuthoredSvgReferenceAliases,
235
237
  emitMountedModuleScripts,
236
238
  emitRootCompositionVariableStyles,
237
239
  ensureExternalLinkTag,
@@ -241,7 +243,7 @@ import {
241
243
  parsesAsScript,
242
244
  prepareFlattenedInnerRoot,
243
245
  stripSdrPngColourTags
244
- } from "./chunk-6WPMMYRT.js";
246
+ } from "./chunk-S6A2CTIE.js";
245
247
  import {
246
248
  RENDER_TEMP_DIR
247
249
  } from "./chunk-F6PI5O3H.js";
@@ -250,7 +252,8 @@ import {
250
252
  collectScratchLeftovers,
251
253
  createStagingDir,
252
254
  removeScratch,
253
- renameWithRetry
255
+ renameWithRetry,
256
+ replaceFileAtomically
254
257
  } from "./chunk-NIEOUHVQ.js";
255
258
  import {
256
259
  DISTRIBUTED_FPS,
@@ -269,7 +272,7 @@ import {
269
272
  redactTelemetryString,
270
273
  resolveAuthoredTimingWindow,
271
274
  toFps
272
- } from "./chunk-QEXNYXWZ.js";
275
+ } from "./chunk-EHDUOOIH.js";
273
276
  import {
274
277
  CAPTURE_CANVAS_SELECTOR,
275
278
  COMPOSITION_SOURCE_URL,
@@ -306,9 +309,10 @@ import {
306
309
  sourceTimeAt,
307
310
  styleElementsFor,
308
311
  timeAtSourceTime
309
- } from "./chunk-VDZP4BZ5.js";
312
+ } from "./chunk-KTVURB6P.js";
310
313
  import {
311
314
  isSafePath,
315
+ realpath,
312
316
  terminalText
313
317
  } from "./chunk-OGL5VQGT.js";
314
318
  import {
@@ -316,7 +320,7 @@ import {
316
320
  } from "./chunk-LWX5PI73.js";
317
321
  import {
318
322
  resolveReferencedStart
319
- } from "./chunk-GDPNIGCY.js";
323
+ } from "./chunk-R6ARS4HA.js";
320
324
  import {
321
325
  isUnresolvedAssetPlaceholder,
322
326
  namesAnotherNetworkRoot,
@@ -332,7 +336,7 @@ import {
332
336
  getSystemTotalMb,
333
337
  hostCpuCount,
334
338
  usableCpuCount
335
- } from "./chunk-HY67LTYS.js";
339
+ } from "./chunk-KXL4WNPB.js";
336
340
  import {
337
341
  MEDIA_START_BASIS_ATTR,
338
342
  checkSubCompositionUsability,
@@ -346,6 +350,7 @@ import {
346
350
  hostInPointSeconds,
347
351
  importRuleMatches,
348
352
  isNonRelativeUrl,
353
+ isPathInside,
349
354
  localFontFaceUrlMatches,
350
355
  readMediaStartBasis,
351
356
  readPlaybackRate,
@@ -359,7 +364,7 @@ import {
359
364
  rewriteInlineStyleAssetUrls,
360
365
  styleBlockMatches,
361
366
  stylesheetLinkMatches
362
- } from "./chunk-KZ5PV5TL.js";
367
+ } from "./chunk-RADFYYSJ.js";
363
368
  import {
364
369
  CANVAS_DIMENSIONS,
365
370
  VALID_CANVAS_RESOLUTIONS,
@@ -370,7 +375,7 @@ import {
370
375
  matchHtmlBodyCssWidthFirst,
371
376
  normalizeResolutionFlag,
372
377
  suggestMatchingPreset
373
- } from "./chunk-4NDSGKPO.js";
378
+ } from "./chunk-QURE6VDP.js";
374
379
  import {
375
380
  parseHTML
376
381
  } from "./chunk-GWTIFRF5.js";
@@ -379,17 +384,23 @@ import {
379
384
  isStudioPrivatePath
380
385
  } from "./chunk-NTGTWXAO.js";
381
386
  import {
382
- concatListInputArgs
383
- } from "./chunk-Z67ELZGQ.js";
387
+ assertPrivateCachePath,
388
+ ensurePrivateCacheDir,
389
+ hyperframesCacheDir
390
+ } from "./chunk-KUJJJBV2.js";
391
+ import {
392
+ concatListInputArgs,
393
+ localContainerInputArgs
394
+ } from "./chunk-KDQDCSTA.js";
384
395
 
385
396
  // ../producer/src/services/renderOrchestrator.ts
386
397
  import {
387
- existsSync as existsSync21,
398
+ existsSync as existsSync20,
388
399
  mkdirSync as mkdirSync10,
389
400
  readdirSync as readdirSync6,
390
401
  rmSync as rmSync10,
391
402
  statSync as statSync7,
392
- writeFileSync as writeFileSync6,
403
+ writeFileSync as writeFileSync5,
393
404
  copyFileSync as copyFileSync3,
394
405
  appendFileSync
395
406
  } from "fs";
@@ -838,7 +849,7 @@ var defaultLogger = createConsoleLogger(
838
849
 
839
850
  // ../producer/src/services/fileServer.ts
840
851
  var readFileAsync = promisify(readFile);
841
- function isPathInside2(child2, parent, options = {}) {
852
+ function isPathInside3(child2, parent, options = {}) {
842
853
  const { resolveSymlinks = false, pathModule } = options;
843
854
  const resolveFn = pathModule?.resolve ?? resolve2;
844
855
  const separator = pathModule?.sep ?? sep;
@@ -1422,7 +1433,7 @@ function createFileServer(options) {
1422
1433
  for (const root of compiledDir ? [compiledDir, projectDir] : [projectDir]) {
1423
1434
  const candidate = join(root, relativePath);
1424
1435
  const resolveSymlinks = !allowOutsideProjectAssets && root !== compiledDir;
1425
- if (!isPathInside2(candidate, root, { resolveSymlinks })) continue;
1436
+ if (!isPathInside3(candidate, root, { resolveSymlinks })) continue;
1426
1437
  if (isPrivateFileUnder(root, candidate, isStudioPrivatePath)) continue;
1427
1438
  const checksLinks = allowOutsideProjectAssets && root !== compiledDir;
1428
1439
  if (checksLinks && refusesOutsideLink(root, candidate, warnLeftOut, outsidePolicy)) continue;
@@ -1702,7 +1713,7 @@ function writeCompiledArtifacts(compiled, workDir, includeSummary) {
1702
1713
  writeFileSync(join2(compileDir, "index.html"), compiled.html, "utf-8");
1703
1714
  for (const [srcPath, html] of compiled.subCompositions) {
1704
1715
  const outPath = join2(compileDir, srcPath);
1705
- if (!isPathInside(outPath, compileDir)) {
1716
+ if (!isPathInside2(outPath, compileDir)) {
1706
1717
  console.warn(`[Render] Skipping sub-composition with unsafe path: ${terminalText(srcPath)}`);
1707
1718
  continue;
1708
1719
  }
@@ -1711,7 +1722,7 @@ function writeCompiledArtifacts(compiled, workDir, includeSummary) {
1711
1722
  }
1712
1723
  for (const [relativePath, absolutePath] of compiled.externalAssets) {
1713
1724
  const outPath = resolve3(join2(compileDir, relativePath));
1714
- if (!isPathInside(outPath, compileDir)) {
1725
+ if (!isPathInside2(outPath, compileDir)) {
1715
1726
  console.warn(
1716
1727
  `[Render] Skipping external asset with unsafe path: ${terminalText(relativePath)}`
1717
1728
  );
@@ -1999,7 +2010,7 @@ function materializeExtractedFramesForCompiledDir(extracted, compiledDir, option
1999
2010
  const compiledFrameRoot = pathModule.join(resolvedCompiledDir, "__hyperframes_video_frames");
2000
2011
  for (const ext of extracted) {
2001
2012
  const resolvedOut = pathModule.resolve(ext.outputDir);
2002
- if (isPathInside(resolvedOut, resolvedCompiledDir, { pathModule })) continue;
2013
+ if (isPathInside2(resolvedOut, resolvedCompiledDir, { pathModule })) continue;
2003
2014
  const linkPath = pathModule.join(compiledFrameRoot, mediaIdPathSegment(ext.videoId));
2004
2015
  if (!fileSystem.existsSync(linkPath)) {
2005
2016
  fileSystem.mkdirSync(pathModule.dirname(linkPath), { recursive: true });
@@ -2805,7 +2816,7 @@ function replanAfterFailure(plan2, failure) {
2805
2816
  }
2806
2817
 
2807
2818
  // ../producer/src/services/render/stages/captureSegmentedStage.ts
2808
- import { existsSync as existsSync8, mkdirSync as mkdirSync4, rmSync as rmSync6, statSync as statSync3 } from "fs";
2819
+ import { existsSync as existsSync7, mkdirSync as mkdirSync4, rmSync as rmSync6, statSync as statSync3 } from "fs";
2809
2820
  import { join as join11 } from "path";
2810
2821
 
2811
2822
  // ../producer/src/services/render/perfSummary.ts
@@ -4479,12 +4490,14 @@ function createSegmentQueue(slices) {
4479
4490
  // ../producer/src/services/render/segmentManifest.ts
4480
4491
  import { createHash as createHash2, createHmac, timingSafeEqual } from "crypto";
4481
4492
  import {
4493
+ closeSync as closeSync4,
4494
+ constants as constants3,
4482
4495
  createReadStream as createReadStream2,
4483
- existsSync as existsSync7,
4496
+ fstatSync as fstatSync3,
4484
4497
  lstatSync as lstatSync3,
4485
4498
  mkdirSync as mkdirSync3,
4486
- readFileSync as readFileSync4,
4487
- writeFileSync as writeFileSync3
4499
+ openSync as openSync4,
4500
+ readFileSync as readFileSync4
4488
4501
  } from "fs";
4489
4502
  import { join as join9 } from "path";
4490
4503
  var MANIFEST_FILENAME = "segments.json";
@@ -4512,8 +4525,20 @@ function computeSegmentPlanHash(input) {
4512
4525
  if (delivery.some((v) => v !== "")) ordered.push(...delivery.map(String));
4513
4526
  return createHash2("sha256").update(ordered.join(" ")).digest("hex").slice(0, 16);
4514
4527
  }
4515
- function segmentDirFor(projectRendersDir, planHash) {
4516
- return join9(projectRendersDir, ".hf-segments", planHash);
4528
+ function segmentDirFor(projectDir, planHash) {
4529
+ const root = hyperframesCacheDir();
4530
+ const projectKey = createHash2("sha256").update(realpath(projectDir)).digest("hex");
4531
+ const parent = join9(root, "segments", projectKey);
4532
+ const dir = join9(parent, planHash);
4533
+ if (isPathInside(root, projectDir) || isSafePath(projectDir, root) || isSafePath(projectDir, parent) || isSafePath(projectDir, dir)) {
4534
+ throw new Error("Segmented capture requires HYPERFRAMES_CACHE_DIR outside the project.");
4535
+ }
4536
+ assertPrivateCachePath(root, root);
4537
+ ensurePrivateCacheDir(parent, root);
4538
+ if (!isSafePath(parent, dir) || lstatSync3(dir, { throwIfNoEntry: false })?.isSymbolicLink()) {
4539
+ throw new Error("Invalid segment cache directory");
4540
+ }
4541
+ return dir;
4517
4542
  }
4518
4543
  function hasNumber(value, key) {
4519
4544
  return key in value && typeof Reflect.get(value, key) === "number";
@@ -4532,12 +4557,22 @@ function isManifest(value) {
4532
4557
  }
4533
4558
  function readSegmentManifest(segmentDir) {
4534
4559
  const path = join9(segmentDir, MANIFEST_FILENAME);
4535
- if (!existsSync7(path)) return null;
4560
+ let fd;
4536
4561
  try {
4537
- const parsed = JSON.parse(readFileSync4(path, "utf-8"));
4562
+ fd = openSync4(
4563
+ path,
4564
+ constants3.O_RDONLY | (constants3.O_NOFOLLOW ?? 0) | (constants3.O_NONBLOCK ?? 0)
4565
+ );
4566
+ const opened = fstatSync3(fd);
4567
+ if (!opened.isFile() || opened.nlink !== 1) return null;
4568
+ const named = lstatSync3(path);
4569
+ if (!named.isFile() || named.dev !== opened.dev || named.ino !== opened.ino) return null;
4570
+ const parsed = JSON.parse(readFileSync4(fd, "utf-8"));
4538
4571
  return isManifest(parsed) ? parsed : null;
4539
4572
  } catch {
4540
4573
  return null;
4574
+ } finally {
4575
+ if (fd !== void 0) closeSync4(fd);
4541
4576
  }
4542
4577
  }
4543
4578
  function segmentManifestKey(token = previewToken()) {
@@ -4570,9 +4605,11 @@ async function hashSegmentFile(path) {
4570
4605
  }
4571
4606
  function writeSegmentManifest(segmentDir, manifest, key) {
4572
4607
  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));
4608
+ replaceFileAtomically(
4609
+ join9(segmentDir, MANIFEST_FILENAME),
4610
+ JSON.stringify(signSegmentManifest(manifest, key), null, 2),
4611
+ 384
4612
+ );
4576
4613
  }
4577
4614
  async function probeSegmentFrameCount(path, probe) {
4578
4615
  try {
@@ -4592,19 +4629,27 @@ function plannedSlice(entry, plan2) {
4592
4629
  }
4593
4630
  return slice;
4594
4631
  }
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;
4632
+ async function matchesSegmentFile(path, entry) {
4633
+ try {
4634
+ const stat = lstatSync3(path, { throwIfNoEntry: false });
4635
+ if (!stat?.isFile() || stat.nlink !== 1 || stat.size <= 0 || stat.size !== entry.bytes) {
4636
+ return false;
4637
+ }
4638
+ return await hashSegmentFile(path) === entry.sha256;
4639
+ } catch {
4640
+ return false;
4641
+ }
4598
4642
  }
4599
4643
  async function validateCompletedSegments(manifest, check) {
4600
4644
  const ok = /* @__PURE__ */ new Set();
4601
- if (manifest.planHash !== check.expectedHash || !hasValidMac(manifest, check.key)) return ok;
4645
+ if (manifest.totalFrames !== check.totalFrames || manifest.segmentFrames !== check.segmentFrames || manifest.planHash !== check.expectedHash || !hasValidMac(manifest, check.key))
4646
+ return ok;
4647
+ const plan2 = planSegments(check.totalFrames, check.segmentFrames);
4602
4648
  for (const entry of manifest.completed) {
4603
- const slice = plannedSlice(entry, check.plan);
4649
+ const slice = plannedSlice(entry, plan2);
4604
4650
  if (!slice) continue;
4605
4651
  const path = segmentOutputPath(check.segmentDir, slice.index);
4606
- if (!isPlainFileOfSize(path, entry.bytes)) continue;
4607
- if (await hashSegmentFile(path) !== entry.sha256) continue;
4652
+ if (entry.path !== path || !await matchesSegmentFile(path, entry)) continue;
4608
4653
  const frames = await check.probeFrames(path);
4609
4654
  if (frames !== slice.endFrame - slice.startFrame) continue;
4610
4655
  ok.add(slice.index);
@@ -5475,6 +5520,7 @@ async function captureSegment(ctx, segment) {
5475
5520
  }
5476
5521
  async function captureSegmentToEncoder(ctx, segment) {
5477
5522
  const segmentPath = segmentOutputPath(ctx.segmentDir, segment.index);
5523
+ rmSync6(segmentPath, { force: true });
5478
5524
  let encoder;
5479
5525
  try {
5480
5526
  encoder = await ctx.spawnEncoder(
@@ -5503,8 +5549,8 @@ async function captureSegmentToEncoder(ctx, segment) {
5503
5549
  path: segmentPath,
5504
5550
  // Recorded so resume can prove the file on disk is the one that
5505
5551
  // finished; absent only in unit tests, whose fake encoder writes none.
5506
- bytes: existsSync8(segmentPath) ? statSync3(segmentPath).size : 0,
5507
- sha256: existsSync8(segmentPath) ? await hashSegmentFile(segmentPath) : ""
5552
+ bytes: existsSync7(segmentPath) ? statSync3(segmentPath).size : 0,
5553
+ sha256: existsSync7(segmentPath) ? await hashSegmentFile(segmentPath) : ""
5508
5554
  });
5509
5555
  return encodeResult;
5510
5556
  } finally {
@@ -7138,7 +7184,7 @@ function requireOutputDimensions(expected, width, height) {
7138
7184
  }
7139
7185
 
7140
7186
  // ../producer/src/services/render/stages/compileStage.ts
7141
- import { existsSync as existsSync12, writeFileSync as writeFileSync4 } from "fs";
7187
+ import { existsSync as existsSync11, writeFileSync as writeFileSync3 } from "fs";
7142
7188
  import { join as join19, relative as relative4 } from "path";
7143
7189
 
7144
7190
  // ../producer/src/services/compositionSizeLimit.ts
@@ -7146,7 +7192,7 @@ import { statSync as statSync5 } from "fs";
7146
7192
  var MAX_COMPOSITION_HTML_BYTES = 16 * 1024 * 1024;
7147
7193
  var COMPOSITION_TOO_LARGE = "COMPOSITION_TOO_LARGE";
7148
7194
  var megabytes = (bytes) => `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
7149
- var MAX_EXPANDED_COMPOSITION_BYTES = 2 * MAX_COMPOSITION_HTML_BYTES;
7195
+ var MAX_EXPANDED_COMPOSITION_BYTES = 4 * MAX_COMPOSITION_HTML_BYTES;
7150
7196
  var MAX_COMPOSITION_MOUNTS = 1e4;
7151
7197
  var CompositionTooLargeError = class extends Error {
7152
7198
  constructor(message, publicMetadata) {
@@ -7229,18 +7275,18 @@ function assertCompositionFileSize(path, file) {
7229
7275
 
7230
7276
  // ../producer/src/services/htmlCompiler.ts
7231
7277
  import { createHash as createHash4 } from "crypto";
7232
- import { createReadStream as createReadStream3, existsSync as existsSync11, mkdirSync as mkdirSync7, readFileSync as readFileSync6 } from "fs";
7278
+ import { createReadStream as createReadStream3, existsSync as existsSync10, mkdirSync as mkdirSync7, readFileSync as readFileSync6 } from "fs";
7233
7279
  import { join as join18, dirname as dirname7, resolve as resolve6, basename as basename5, relative as relative3, sep as sep3 } from "path";
7234
7280
 
7235
7281
  // ../producer/src/services/bundledScripts.ts
7236
- import { existsSync as existsSync9, readFileSync as readFileSync5 } from "fs";
7282
+ import { existsSync as existsSync8, readFileSync as readFileSync5 } from "fs";
7237
7283
  import { join as join16 } from "path";
7238
7284
  var GSAP_VENDOR_DIR_ENV = "HYPERFRAMES_GSAP_VENDOR_DIR";
7239
7285
  function bundledScript(url) {
7240
7286
  const dir = process.env[GSAP_VENDOR_DIR_ENV];
7241
7287
  if (!dir || url !== `${gsapCdnDist()}gsap.min.js`) return null;
7242
7288
  const file = join16(dir, "gsap.min.js");
7243
- return existsSync9(file) ? readFileSync5(file) : null;
7289
+ return existsSync8(file) ? readFileSync5(file) : null;
7244
7290
  }
7245
7291
 
7246
7292
  // ../producer/src/services/renderMediaCollector.ts
@@ -7390,7 +7436,7 @@ function getPositionEditsRenderScript() {
7390
7436
  }
7391
7437
 
7392
7438
  // ../producer/src/services/assetMediaType.ts
7393
- import { existsSync as existsSync10 } from "fs";
7439
+ import { existsSync as existsSync9 } from "fs";
7394
7440
  import { dirname as dirname6, join as join17 } from "path";
7395
7441
  var ASSET_MEDIA_TYPE_MISMATCH = "ASSET_MEDIA_TYPE_MISMATCH";
7396
7442
  var AssetMediaTypeMismatchError = class extends Error {
@@ -7491,7 +7537,7 @@ async function preflightCompositionAssetMediaTypes(input) {
7491
7537
  input.projectDir,
7492
7538
  input.compiledDir
7493
7539
  );
7494
- if (!existsSync10(resolvedPath)) continue;
7540
+ if (!existsSync9(resolvedPath)) continue;
7495
7541
  byPath.set(resolvedPath, [...byPath.get(resolvedPath) ?? [], reference]);
7496
7542
  }
7497
7543
  const mismatches = [];
@@ -7788,7 +7834,7 @@ async function resolveMediaDuration(src, mediaStart, playbackRate, projectDir, b
7788
7834
  let filePath = src;
7789
7835
  if (isHttpUrl(src)) {
7790
7836
  const remoteDir = join18(downloadDir, REMOTE_MEDIA_SUBDIR);
7791
- if (!existsSync11(remoteDir)) mkdirSync7(remoteDir, { recursive: true });
7837
+ if (!existsSync10(remoteDir)) mkdirSync7(remoteDir, { recursive: true });
7792
7838
  try {
7793
7839
  filePath = await downloadToTemp(src, remoteDir, void 0, void 0, void 0, {
7794
7840
  onTelemetry: logRemoteDownloadTelemetry
@@ -7807,7 +7853,7 @@ async function resolveMediaDuration(src, mediaStart, playbackRate, projectDir, b
7807
7853
  return { duration: null, resolvedPath: filePath };
7808
7854
  }
7809
7855
  }
7810
- if (!isHttpUrl(filePath) && !existsSync11(filePath)) {
7856
+ if (!isHttpUrl(filePath) && !existsSync10(filePath)) {
7811
7857
  return { duration: null, resolvedPath: filePath };
7812
7858
  }
7813
7859
  const withSrcContext = (error) => {
@@ -8133,13 +8179,14 @@ function inlineSubCompositions2(html, subCompositions, projectDir, variableOverr
8133
8179
  const body = document2.querySelector("body");
8134
8180
  const hosts = Array.from(document2.querySelectorAll("[data-composition-src]"));
8135
8181
  if (!hosts.length) {
8182
+ const dropped = dropAuthoredSvgReferenceAliases(document2);
8136
8183
  const emitted = emitRootCompositionVariableStyles(
8137
8184
  document2,
8138
8185
  {},
8139
8186
  variableOverrides,
8140
8187
  { chargeBytes: (bytes) => budget.chargeGenerated("composition variables", bytes) }
8141
8188
  );
8142
- return { html: emitted ? document2.toString() : html, variablesByComp: {} };
8189
+ return { html: emitted || dropped ? document2.toString() : html, variablesByComp: {} };
8143
8190
  }
8144
8191
  const readOnce = /* @__PURE__ */ new Map();
8145
8192
  const readMountHtml = (srcPath) => {
@@ -8331,18 +8378,31 @@ function operatorGsapMirror() {
8331
8378
  return void 0;
8332
8379
  }
8333
8380
  }
8334
- async function downloadScript(src, mirror) {
8381
+ async function downloadScript(src, mirror, signal) {
8335
8382
  if (mirror && new URL(src).href.startsWith(mirror)) {
8336
- const response = await fetch(src, { redirect: "error", signal: AbortSignal.timeout(15e3) });
8383
+ const response = await fetch(src, {
8384
+ redirect: "error",
8385
+ signal: AbortSignal.any([AbortSignal.timeout(15e3), signal])
8386
+ });
8337
8387
  if (!response.ok) throw new Error(`HTTP ${response.status} for ${src}`);
8338
8388
  const bytes = new Uint8Array(await response.arrayBuffer());
8339
8389
  if (bytes.byteLength > MAX_SCRIPT_BYTES) throw new Error(`Script over 16 MiB: ${src}`);
8340
8390
  return bytes;
8341
8391
  }
8342
- return fetchPublicHttpsBytes(src, { maxBytes: MAX_SCRIPT_BYTES, timeoutMs: 15e3 });
8392
+ return fetchPublicHttpsBytes(src, { maxBytes: MAX_SCRIPT_BYTES, timeoutMs: 15e3, signal });
8343
8393
  }
8344
8394
  var MAX_CONCURRENT_SCRIPT_FETCHES = 4;
8345
- async function inlineExternalScripts(html, budget = new CompositionExpansionBudget()) {
8395
+ var MAX_REMOTE_FETCHES = 32;
8396
+ var REMOTE_FETCH_DEADLINE_MS = 6e4;
8397
+ var fetchSignalOf = (signal) => typeof signal === "function" ? signal() : signal;
8398
+ function assertRemoteFetchCount(kind, count) {
8399
+ if (count > MAX_REMOTE_FETCHES) {
8400
+ throw new Error(
8401
+ `The composition links ${count} remote ${kind}; at most ${MAX_REMOTE_FETCHES} are downloaded at compile time`
8402
+ );
8403
+ }
8404
+ }
8405
+ async function inlineExternalScripts(html, budget = new CompositionExpansionBudget(), signal) {
8346
8406
  const fullHtml = ensureFullDocument(html);
8347
8407
  const wrappedFragment = fullHtml !== html;
8348
8408
  const { document: document2 } = parseHTML(fullHtml);
@@ -8355,9 +8415,19 @@ async function inlineExternalScripts(html, budget = new CompositionExpansionBudg
8355
8415
  }
8356
8416
  }
8357
8417
  if (externalScripts.length === 0) return html;
8418
+ const bundled = /* @__PURE__ */ new Map();
8419
+ const local = externalScripts.map(({ el, src }) => {
8420
+ if (!bundled.has(src)) bundled.set(src, bundledScript(src));
8421
+ const bytes = bundled.get(src);
8422
+ return bytes && matchesScriptIntegrity(bytes, el.getAttribute("integrity") || "") ? bytes : null;
8423
+ });
8424
+ const remote = new Set(externalScripts.filter((_, i) => !local[i]).map(({ src }) => src));
8425
+ assertRemoteFetchCount("scripts", remote.size);
8358
8426
  const mirror = operatorGsapMirror();
8359
8427
  const limit = createConcurrencyLimit(MAX_CONCURRENT_SCRIPT_FETCHES);
8360
8428
  const stop = new AbortController();
8429
+ const shared = remote.size > 0 ? fetchSignalOf(signal) : void 0;
8430
+ const fetchSignal = shared ? AbortSignal.any([stop.signal, shared]) : stop.signal;
8361
8431
  const fail = (error) => {
8362
8432
  stop.abort(error);
8363
8433
  throw error;
@@ -8374,21 +8444,21 @@ async function inlineExternalScripts(html, budget = new CompositionExpansionBudg
8374
8444
  let bytes = fetches.get(src);
8375
8445
  if (!bytes) {
8376
8446
  bytes = limit(async () => {
8377
- if (stop.signal.aborted) throw stop.signal.reason;
8378
- const downloaded = await downloadScript(src, mirror);
8447
+ fetchSignal.throwIfAborted();
8448
+ const downloaded = await downloadScript(src, mirror, fetchSignal);
8379
8449
  charge(downloaded.byteLength);
8380
8450
  return downloaded;
8381
- }, stop.signal);
8451
+ }, fetchSignal);
8382
8452
  fetches.set(src, bytes);
8383
8453
  }
8384
8454
  return bytes;
8385
8455
  };
8386
8456
  const placed = /* @__PURE__ */ new Set();
8387
8457
  const downloads = await Promise.allSettled(
8388
- externalScripts.map(async ({ el, src }) => {
8458
+ externalScripts.map(async ({ el, src }, i) => {
8389
8459
  const integrity = el.getAttribute("integrity") || "";
8390
- let bytes = bundledScript(src);
8391
- if (bytes && matchesScriptIntegrity(bytes, integrity)) {
8460
+ let bytes = local[i];
8461
+ if (bytes) {
8392
8462
  charge(bytes.byteLength);
8393
8463
  } else {
8394
8464
  bytes = await fetchOnce(src);
@@ -8435,11 +8505,11 @@ function collectExternalAssets(html, projectDir, log = defaultLogger, file = "in
8435
8505
  const trimmed = rawPath.trim();
8436
8506
  if (isNonRelativeUrl(trimmed)) return null;
8437
8507
  const absPath = resolve6(absProjectDir, trimmed);
8438
- if (isPathInside(absPath, absProjectDir)) {
8508
+ if (isPathInside2(absPath, absProjectDir)) {
8439
8509
  return null;
8440
8510
  }
8441
8511
  const onShare = namesAnotherNetworkRoot(absProjectDir, absPath);
8442
- if (!onShare && !existsSync11(absPath)) return null;
8512
+ if (!onShare && !existsSync10(absPath)) return null;
8443
8513
  const refusal = onShare ? "network_share" : outsideAssetRefusal(absProjectDir, absPath, policy);
8444
8514
  if (refusal) {
8445
8515
  if (!leftOut.has(trimmed)) log.warn(`[Compiler] ${leftOutOfRender(file, trimmed, refusal)}`);
@@ -8492,7 +8562,7 @@ function collectExternalAssets(html, projectDir, log = defaultLogger, file = "in
8492
8562
  var REMOTE_MEDIA_SUBDIR = "_remote_media";
8493
8563
  async function downloadAndRewriteUrls(urlSet, html, remoteDir, warnLabel, logLabel, extraRewrite) {
8494
8564
  if (urlSet.size === 0) return { html, remoteMediaAssets: /* @__PURE__ */ new Map() };
8495
- if (!existsSync11(remoteDir)) mkdirSync7(remoteDir, { recursive: true });
8565
+ if (!existsSync10(remoteDir)) mkdirSync7(remoteDir, { recursive: true });
8496
8566
  const urlToLocal = /* @__PURE__ */ new Map();
8497
8567
  await Promise.all(
8498
8568
  [...urlSet].map(async (url) => {
@@ -8585,12 +8655,13 @@ function isGoogleFontsUrl(href) {
8585
8655
  }
8586
8656
  }
8587
8657
  var MAX_STYLESHEET_BYTES = 2 * 1024 * 1024;
8588
- async function fetchExternalStylesheetCss(href) {
8658
+ async function fetchExternalStylesheetCss(href, signal) {
8589
8659
  const identity = safeDownloadUrlIdentity(href);
8590
8660
  try {
8591
8661
  return await fetchPublicHttpsText(href, {
8592
8662
  maxBytes: MAX_STYLESHEET_BYTES,
8593
- timeoutMs: 15e3
8663
+ timeoutMs: 15e3,
8664
+ signal
8594
8665
  });
8595
8666
  } catch (err) {
8596
8667
  defaultLogger.warn("[Compiler] External stylesheet fetch failed, preserving link tag.", {
@@ -8630,36 +8701,42 @@ function remoteFontStylesheetHref(tag) {
8630
8701
  if (!href || !/^https?:\/\//i.test(href) || isGoogleFontsUrl(href)) return void 0;
8631
8702
  return href;
8632
8703
  }
8633
- async function inlineExternalFontStylesheets(html, budget = new CompositionExpansionBudget()) {
8704
+ async function inlineExternalFontStylesheets(html, budget = new CompositionExpansionBudget(), signal) {
8634
8705
  const hrefs = /* @__PURE__ */ new Set();
8635
8706
  for (const { parts } of stylesheetLinkMatches(html)) {
8636
8707
  const href = remoteFontStylesheetHref(parts[0]);
8637
8708
  if (href) hrefs.add(href);
8638
8709
  }
8639
8710
  if (hrefs.size === 0) return html;
8640
- const MAX_CONCURRENT_STYLESHEET_FETCHES = 4;
8711
+ assertRemoteFetchCount("stylesheets", hrefs.size);
8712
+ const limit = createConcurrencyLimit(MAX_CONCURRENT_SCRIPT_FETCHES);
8713
+ const stop = new AbortController();
8714
+ const shared = fetchSignalOf(signal);
8715
+ const fetchSignal = shared ? AbortSignal.any([stop.signal, shared]) : stop.signal;
8641
8716
  const inlineByHref = /* @__PURE__ */ new Map();
8642
- const unique = [...hrefs];
8643
- for (let i = 0; i < unique.length; i += MAX_CONCURRENT_STYLESHEET_FETCHES) {
8644
- const batch = unique.slice(i, i + MAX_CONCURRENT_STYLESHEET_FETCHES);
8645
- const sheets = await Promise.all(batch.map(fetchExternalStylesheetCss));
8646
- batch.forEach((href, index) => {
8647
- const css = sheets[index];
8648
- const fontFaceBlocks = css ? extractFontFaceBlocks(css) : [];
8649
- if (fontFaceBlocks.length === 0) return;
8650
- const inlineStyle = `<style>/* Inlined external font stylesheet */
8717
+ const inlineSheet = async (href) => {
8718
+ const css = await fetchExternalStylesheetCss(href, fetchSignal);
8719
+ const fontFaceBlocks = css ? extractFontFaceBlocks(css) : [];
8720
+ if (fontFaceBlocks.length === 0) return;
8721
+ const inlineStyle = `<style>/* Inlined external font stylesheet */
8651
8722
  ${fontFaceBlocks.join("\n")}
8652
8723
  </style>`;
8724
+ try {
8653
8725
  budget.chargeGenerated(REMOTE_STYLESHEETS, inlineStyle.length);
8654
- inlineByHref.set(href, inlineStyle);
8655
- const identity = safeDownloadUrlIdentity(href);
8656
- defaultLogger.debug("[Compiler] Inlined external @font-face rule(s)", {
8657
- count: fontFaceBlocks.length,
8658
- urlFingerprint: identity.urlFingerprint,
8659
- host: identity.host
8660
- });
8726
+ } catch (error) {
8727
+ stop.abort(error);
8728
+ throw error;
8729
+ }
8730
+ inlineByHref.set(href, inlineStyle);
8731
+ const identity = safeDownloadUrlIdentity(href);
8732
+ defaultLogger.debug("[Compiler] Inlined external @font-face rule(s)", {
8733
+ count: fontFaceBlocks.length,
8734
+ urlFingerprint: identity.urlFingerprint,
8735
+ host: identity.host
8661
8736
  });
8662
- }
8737
+ };
8738
+ await Promise.allSettled([...hrefs].map((href) => limit(() => inlineSheet(href), fetchSignal)));
8739
+ if (stop.signal.aborted) throw stop.signal.reason;
8663
8740
  const placed = /* @__PURE__ */ new Set();
8664
8741
  return replaceMatches(html, stylesheetLinkMatches(html), (tag) => {
8665
8742
  const href = remoteFontStylesheetHref(tag);
@@ -8678,13 +8755,13 @@ function projectStylesheetFontFamilies(html, projectDir) {
8678
8755
  const href = /\bhref=["']([^"']+)["']/i.exec(tag)?.[1];
8679
8756
  if (!href || /^(?:[a-z][a-z\d+.-]*:|\/\/)/i.test(href)) continue;
8680
8757
  const sheet = resolve6(projectDir, decodedUrlPath(href).replace(/^(?:\.?\/)+/, ""));
8681
- if (!isPathInside(sheet, projectDir) || !existsSync11(sheet)) continue;
8758
+ if (!isPathInside2(sheet, projectDir) || !existsSync10(sheet)) continue;
8682
8759
  for (const face of extractFontFaceBlocks(readFileSync6(sheet, "utf8"))) {
8683
8760
  const family = /font-family\s*:\s*([^;}]+)/i.exec(face)?.[1]?.trim().replace(/^['"]|['"]$/g, "");
8684
8761
  const shipsFile = [...localFontFaceUrlMatches(face)].some(({ parts: [, url = ""] }) => {
8685
8762
  const path = decodedUrlPath(url);
8686
8763
  const file = path.startsWith("/") ? resolve6(projectDir, `.${path}`) : resolve6(dirname7(sheet), path);
8687
- return isPathInside(file, projectDir) && existsSync11(file);
8764
+ return isPathInside2(file, projectDir) && existsSync10(file);
8688
8765
  });
8689
8766
  if (family && shipsFile) families.push(family);
8690
8767
  }
@@ -8746,7 +8823,7 @@ async function readLocalFont(absPath) {
8746
8823
  }
8747
8824
  async function localFontDataUri(localPath, projectDir, assetRoot, dataUriByAbsolutePath, log) {
8748
8825
  const absPath = localPath.startsWith("/") ? localPath : resolve6(projectDir, localPath);
8749
- if (!isPathInside(absPath, projectDir) || escapesAssetRoot(absPath, assetRoot)) return void 0;
8826
+ if (!isPathInside2(absPath, projectDir) || escapesAssetRoot(absPath, assetRoot)) return void 0;
8750
8827
  if (refusesOutsideLink(projectDir, absPath, (line) => log.warn(`[Compiler] ${line}`))) {
8751
8828
  return void 0;
8752
8829
  }
@@ -8762,7 +8839,7 @@ async function localFontDataUri(localPath, projectDir, assetRoot, dataUriByAbsol
8762
8839
  );
8763
8840
  return void 0;
8764
8841
  }
8765
- const { fontToDataUri } = await import("./deterministicFonts-645ILNLP.js");
8842
+ const { fontToDataUri } = await import("./deterministicFonts-LAVFR7ST.js");
8766
8843
  const dataUri = await fontToDataUri(font.buffer, ext, { compressToWoff2: false });
8767
8844
  dataUriByAbsolutePath.set(absPath, dataUri);
8768
8845
  defaultLogger.debug(
@@ -8836,7 +8913,7 @@ function rewriteUnresolvableGsapToCdn(html, projectDir, compSrcPath) {
8836
8913
  let gsapDist;
8837
8914
  const exists = (path) => {
8838
8915
  const file = resolve6(projectDir, path);
8839
- return !namesAnotherNetworkRoot(projectDir, file) && existsSync11(file);
8916
+ return !namesAnotherNetworkRoot(projectDir, file) && existsSync10(file);
8840
8917
  };
8841
8918
  return replaceGsapDistScripts(html, (full, prefix, src, file, suffix) => {
8842
8919
  if (/^https?:\/\//i.test(src)) return full;
@@ -8847,7 +8924,7 @@ function rewriteUnresolvableGsapToCdn(html, projectDir, compSrcPath) {
8847
8924
  });
8848
8925
  }
8849
8926
  function rebaseDirectEntryAssetPaths(html, projectDir, htmlPath, budget) {
8850
- if (!isPathInside(htmlPath, projectDir)) return html;
8927
+ if (!isPathInside2(htmlPath, projectDir)) return html;
8851
8928
  const entryPath = relative3(projectDir, htmlPath).replace(/\\/g, "/");
8852
8929
  if (!entryPath.includes("/")) return html;
8853
8930
  const { document: document2 } = parseHTML(html);
@@ -8908,14 +8985,14 @@ function bindVariableMediaSources(html, variables, budget, log) {
8908
8985
  }
8909
8986
  return changed ? document2.toString() : html;
8910
8987
  }
8911
- var entryFileName = (projectDir, htmlPath) => isPathInside(htmlPath, projectDir) ? relative3(projectDir, htmlPath).split(sep3).join("/") : basename5(htmlPath);
8988
+ var entryFileName = (projectDir, htmlPath) => isPathInside2(htmlPath, projectDir) ? relative3(projectDir, htmlPath).split(sep3).join("/") : basename5(htmlPath);
8912
8989
  async function compileForRender(projectDir, htmlPath, downloadDir, options = {}) {
8913
8990
  const assetRoot = options.allowOutsideProjectAssets ? void 0 : projectDir;
8914
8991
  const outsideFiles = { includeScripts: options.includeOutsideScripts };
8915
- if (isPathInside(htmlPath, projectDir) && escapesAssetRoot(htmlPath, assetRoot)) {
8992
+ if (isPathInside2(htmlPath, projectDir) && escapesAssetRoot(htmlPath, assetRoot)) {
8916
8993
  throw new Error(`Entry file ${htmlPath} leads outside the project folder`);
8917
8994
  }
8918
- if (isPathInside(htmlPath, projectDir) && runsOutsideMarkupUnasked(projectDir, htmlPath, assetRoot, outsideFiles)) {
8995
+ if (isPathInside2(htmlPath, projectDir) && runsOutsideMarkupUnasked(projectDir, htmlPath, assetRoot, outsideFiles)) {
8919
8996
  throw new Error(`Entry file ${htmlPath} ${OUTSIDE_COMPOSITION_NEEDS_FLAG}`);
8920
8997
  }
8921
8998
  if (!COMPOSITION_FILE.test(htmlPath)) {
@@ -8972,10 +9049,17 @@ async function compileForRender(projectDir, htmlPath, downloadDir, options = {})
8972
9049
  const hasShaderTransitions = detectShaderTransitionUsage(sanitizedHtml);
8973
9050
  const usesThreeDTransforms = detectThreeDTransformUsage(sanitizedHtml);
8974
9051
  const hasAncestorBackgroundImage = detectAncestorBackgroundImage(sanitizedHtml);
9052
+ let deadline;
9053
+ const remoteFetches = () => deadline ??= AbortSignal.any([
9054
+ AbortSignal.timeout(REMOTE_FETCH_DEADLINE_MS),
9055
+ ...options.abortSignal ? [options.abortSignal] : []
9056
+ ]);
8975
9057
  const fontSheetHtml = await inlineExternalFontStylesheets(
8976
9058
  promoteCssImportsToLinkTags(sanitizedHtml),
8977
- budget
9059
+ budget,
9060
+ remoteFetches
8978
9061
  );
9062
+ options.abortSignal?.throwIfAborted();
8979
9063
  const normalizedFontHtml = normalizeSystemFontPrimaryFamilies(
8980
9064
  injectTextRenderingRule(coalesceHeadStylesAndBodyScripts(fontSheetHtml))
8981
9065
  );
@@ -8986,7 +9070,8 @@ async function compileForRender(projectDir, htmlPath, downloadDir, options = {})
8986
9070
  projectFontFamilies: projectStylesheetFontFamilies(fontSheetHtml, projectDir),
8987
9071
  abortSignal: options.abortSignal
8988
9072
  });
8989
- const assembledHtml = await inlineExternalScripts(coalescedHtml, budget);
9073
+ const assembledHtml = await inlineExternalScripts(coalescedHtml, budget, remoteFetches);
9074
+ options.abortSignal?.throwIfAborted();
8990
9075
  const htmlWithPositionScript = htmlHasStudioPositionEdits(assembledHtml) ? insertBeforeCloseTag(
8991
9076
  assembledHtml,
8992
9077
  "body",
@@ -9072,7 +9157,7 @@ async function compileForRender(projectDir, htmlPath, downloadDir, options = {})
9072
9157
  for (const video of videos) {
9073
9158
  if (isHttpUrl(video.src)) continue;
9074
9159
  const videoPath = resolve6(projectDir, video.src);
9075
- if (advised.has(videoPath) || namesAnotherNetworkRoot(projectDir, videoPath) || !existsSync11(videoPath) || escapesAssetRoot(videoPath, assetRoot) || isPrivateUnderAssetRoots(videoPath, [projectDir, downloadDir]))
9160
+ if (advised.has(videoPath) || namesAnotherNetworkRoot(projectDir, videoPath) || !existsSync10(videoPath) || escapesAssetRoot(videoPath, assetRoot) || isPrivateUnderAssetRoots(videoPath, [projectDir, downloadDir]))
9076
9161
  continue;
9077
9162
  advised.add(videoPath);
9078
9163
  const reencode = `ffmpeg -i "${video.src}" -c:v libx264 -r 30 -g 30 -keyint_min 30 -movflags +faststart -c:a copy output.mp4`;
@@ -9519,7 +9604,7 @@ function resolveEntryHtmlPath(input) {
9519
9604
  const rawEntry = readEntry(htmlPath);
9520
9605
  if (entryFile === "index.html" || !isTemplateEntry(rawEntry)) return htmlPath;
9521
9606
  const projectIndexPath = join19(projectDir, "index.html");
9522
- if (!existsSync12(projectIndexPath)) {
9607
+ if (!existsSync11(projectIndexPath)) {
9523
9608
  throw new Error(
9524
9609
  `Template entry file "${entryFile}" requires a project index.html to extract its render shell.`
9525
9610
  );
@@ -9535,7 +9620,7 @@ function resolveEntryHtmlPath(input) {
9535
9620
  );
9536
9621
  }
9537
9622
  const wrapperPath = join19(workDir, "standalone-entry.html");
9538
- writeFileSync4(wrapperPath, standaloneHtml, "utf-8");
9623
+ writeFileSync3(wrapperPath, standaloneHtml, "utf-8");
9539
9624
  log.info("Extracted standalone entry from index.html host context", { entryFile });
9540
9625
  return wrapperPath;
9541
9626
  }
@@ -10494,7 +10579,7 @@ function validateDistributedDuration(input) {
10494
10579
  }
10495
10580
 
10496
10581
  // ../producer/src/services/render/stages/extractVideosStage.ts
10497
- import { existsSync as existsSync13 } from "fs";
10582
+ import { existsSync as existsSync12 } from "fs";
10498
10583
  import { join as join21 } from "path";
10499
10584
 
10500
10585
  // ../producer/src/services/render/extractionFailureMetadata.ts
@@ -10923,7 +11008,7 @@ function isPublicHttpsUrl(url) {
10923
11008
  }
10924
11009
  }
10925
11010
  function opensLocally(path, assetRoots) {
10926
- return existsSync13(path) && (!assetRoots || assetRootsRefusal(path, assetRoots) === null);
11011
+ return existsSync12(path) && (!assetRoots || assetRootsRefusal(path, assetRoots) === null);
10927
11012
  }
10928
11013
  function localProbeSource(src, input) {
10929
11014
  const path = resolveProjectRelativeSrc(src, input.projectDir, input.compiledDir);
@@ -10976,7 +11061,7 @@ async function appendVideoAudioFromProbe(input) {
10976
11061
  }
10977
11062
 
10978
11063
  // ../producer/src/services/render/videoLayerPassthroughPlan.ts
10979
- import { existsSync as existsSync14 } from "fs";
11064
+ import { existsSync as existsSync13 } from "fs";
10980
11065
  var SAMPLES = 9;
10981
11066
  function inspectVideoLayout(id, w, h, time) {
10982
11067
  window.__hf?.seek?.(time);
@@ -11038,7 +11123,7 @@ async function planVideoLayerPassthrough(input) {
11038
11123
  const { video } = q;
11039
11124
  if (isHttpUrl(video.src)) return { reason: "remote_source" };
11040
11125
  const path = resolveProjectRelativeSrc(video.src, input.projectDir, input.compiledDir);
11041
- if (!existsSync14(path)) return { reason: "source_missing" };
11126
+ if (!existsSync13(path)) return { reason: "source_missing" };
11042
11127
  const layout = await probeVideoLayout(input.page, video.id, input.canvas, input.duration);
11043
11128
  if ("reason" in layout) return layout;
11044
11129
  const layer = await buildVideoLayerInput(
@@ -11053,11 +11138,11 @@ async function planVideoLayerPassthrough(input) {
11053
11138
  }
11054
11139
 
11055
11140
  // ../producer/src/services/render/stages/audioStage.ts
11056
- import { existsSync as existsSync16 } from "fs";
11141
+ import { existsSync as existsSync15 } from "fs";
11057
11142
  import { join as join24 } from "path";
11058
11143
 
11059
11144
  // ../producer/src/services/render/audioDeliveryLimit.ts
11060
- import { existsSync as existsSync15 } from "fs";
11145
+ import { existsSync as existsSync14 } from "fs";
11061
11146
  import { dirname as dirname9, join as join23 } from "path";
11062
11147
 
11063
11148
  // ../producer/src/services/render/audioPadTrim.ts
@@ -11191,10 +11276,10 @@ function sanitizeProbeFailure(reason, paths) {
11191
11276
  }
11192
11277
  async function padOrTrimAudioToVideoFrameCount(input) {
11193
11278
  const probeVideo = input.probeVideoFrameInfo ?? ((videoPath) => defaultProbeVideoFrameInfo(videoPath, input.signal));
11194
- const probeAudio = input.probeAudioInfo ?? defaultProbeAudioInfo;
11279
+ const probeAudio = input.probeAudioInfo ?? ((path, signal) => defaultProbeAudioInfo(path, signal, input.audioContainer));
11195
11280
  const timeoutMs = input.timeoutMs ?? DEFAULT_CONFIG.ffmpegProcessTimeout;
11196
11281
  const runner = input.runFfmpeg ?? ((args) => defaultRunFfmpeg(args, timeoutMs, input.signal));
11197
- const encode = input.encodeAac ?? defaultAacEncoder(timeoutMs, input.signal, input.sourcePath);
11282
+ const encode = input.encodeAac ?? defaultAacEncoder(timeoutMs, input.signal, input.sourcePath, input.audioContainer);
11198
11283
  const probeTruePeak = input.probeAudioTruePeakDbfs ?? (input.runFfmpeg || input.encodeAac ? void 0 : (audioPath, signal) => measureTruePeakDbfs(audioPath, { timeoutMs, signal }));
11199
11284
  const [videoResult, audioResult] = await Promise.allSettled([
11200
11285
  probeVideo(input.videoPath),
@@ -11242,7 +11327,7 @@ async function padOrTrimAudioToVideoFrameCount(input) {
11242
11327
  );
11243
11328
  try {
11244
11329
  for (const step of plan2.steps) {
11245
- const ffmpegResult = step.kind === "copy" ? await runner(step.args) : await encode(
11330
+ const ffmpegResult = step.kind === "copy" ? await runner([...localContainerInputArgs(input.audioContainer), ...step.args]) : await encode(
11246
11331
  input.sourcePath ?? input.audioPath,
11247
11332
  input.outputPath,
11248
11333
  targetDurationSeconds,
@@ -11408,7 +11493,8 @@ function failResult(outputPath, target, source, error) {
11408
11493
  error
11409
11494
  };
11410
11495
  }
11411
- async function defaultProbeVideoFrameInfo(videoPath, signal) {
11496
+ async function defaultProbeVideoFrameInfo(videoPath, signal, container) {
11497
+ const inputArgs = localContainerInputArgs(container);
11412
11498
  const fastInfo = await runFfprobeJson(
11413
11499
  [
11414
11500
  "-v",
@@ -11419,6 +11505,7 @@ async function defaultProbeVideoFrameInfo(videoPath, signal) {
11419
11505
  "stream=nb_frames,r_frame_rate",
11420
11506
  "-of",
11421
11507
  "json",
11508
+ ...inputArgs,
11422
11509
  "--",
11423
11510
  videoPath
11424
11511
  ],
@@ -11440,6 +11527,7 @@ async function defaultProbeVideoFrameInfo(videoPath, signal) {
11440
11527
  "stream=nb_read_packets,r_frame_rate",
11441
11528
  "-of",
11442
11529
  "json",
11530
+ ...inputArgs,
11443
11531
  "--",
11444
11532
  videoPath
11445
11533
  ],
@@ -11462,8 +11550,8 @@ function parseFrameRate(rate) {
11462
11550
  }
11463
11551
  return { fpsNum, fpsDen };
11464
11552
  }
11465
- async function defaultProbeAudioInfo(audioPath, signal) {
11466
- const metadata = await extractAudioMetadata(audioPath, { signal });
11553
+ async function defaultProbeAudioInfo(audioPath, signal, inputContainer) {
11554
+ const metadata = await extractAudioMetadata(audioPath, { signal, inputContainer });
11467
11555
  return {
11468
11556
  durationSeconds: metadata.durationSeconds,
11469
11557
  sampleRate: metadata.sampleRate,
@@ -11474,9 +11562,9 @@ async function defaultProbeAudioInfo(audioPath, signal) {
11474
11562
  async function defaultRunFfmpeg(args, timeoutMs, signal) {
11475
11563
  return toStepResult(await runFfmpeg(args, { signal, timeout: timeoutMs }), timeoutMs);
11476
11564
  }
11477
- function defaultAacEncoder(timeoutMs, signal, pcmSourcePath) {
11565
+ function defaultAacEncoder(timeoutMs, signal, pcmSourcePath, inputContainer) {
11478
11566
  return async (inputPath, outputPath, durationSeconds, filter) => {
11479
- const options = pcmSourcePath ? { signal, timeout: timeoutMs, filter } : { signal, timeout: timeoutMs, filter, segments: 1 };
11567
+ const options = pcmSourcePath ? { signal, timeout: timeoutMs, filter } : { signal, timeout: timeoutMs, filter, segments: 1, inputContainer };
11480
11568
  return toStepResult(
11481
11569
  await encodeAac(pcmSourcePath ?? inputPath, outputPath, durationSeconds, options),
11482
11570
  timeoutMs
@@ -11550,7 +11638,7 @@ async function limitDeliveryPeaks(input, deps = {
11550
11638
  applyChain: applyAudioFxChain,
11551
11639
  encode: encodeAac,
11552
11640
  rename: renameWithRetry,
11553
- sourceExists: existsSync15
11641
+ sourceExists: existsSync14
11554
11642
  }) {
11555
11643
  const { audioPath, sourcePath, signal, timeoutMs } = input;
11556
11644
  if (!deps.sourceExists(sourcePath)) return { success: true };
@@ -11646,7 +11734,7 @@ async function runAudioStageScoped(input) {
11646
11734
  );
11647
11735
  audioLoweredDb = guard.loweredDb;
11648
11736
  input.log?.info("[audio] phases", { ...result.audioPhaseMs, guard: Date.now() - guardStart });
11649
- if (input.keepDeliverySource && !guard.sourceStale && existsSync16(pcmSourcePath)) {
11737
+ if (input.keepDeliverySource && !guard.sourceStale && existsSync15(pcmSourcePath)) {
11650
11738
  deliverySourcePath = pcmSourcePath;
11651
11739
  }
11652
11740
  }
@@ -11775,7 +11863,7 @@ async function mixAudioForDelivery(input, duration, pcmSourcePath) {
11775
11863
  }
11776
11864
 
11777
11865
  // ../producer/src/services/render/stages/captureStage.ts
11778
- import { existsSync as existsSync17, readdirSync as readdirSync4, statfsSync as statfsSync2 } from "fs";
11866
+ import { existsSync as existsSync16, readdirSync as readdirSync4, statfsSync as statfsSync2 } from "fs";
11779
11867
  import { join as join25 } from "path";
11780
11868
  function shouldAllowAdaptiveCaptureRetry(workerCount, _explicitlyConfigured) {
11781
11869
  return workerCount > 1;
@@ -11832,7 +11920,7 @@ function diskCaptureShortfallError(needBytes, freeBytes, framesDir, basis, remed
11832
11920
  }
11833
11921
  function measureCaptureFrameBytes(workDir, framesDir) {
11834
11922
  let total = sampleDirectoryBytes(framesDir);
11835
- if (!existsSync17(workDir)) return total;
11923
+ if (!existsSync16(workDir)) return total;
11836
11924
  for (const attempt of readdirSync4(workDir)) {
11837
11925
  if (/^retry-\d+-batch-\d+-worker-\d+$/.test(attempt)) {
11838
11926
  total += sampleDirectoryBytes(join25(workDir, attempt));
@@ -12139,7 +12227,7 @@ async function captureSessionFrames(session, { input, rangeStart, rangeEnd, resu
12139
12227
  }
12140
12228
 
12141
12229
  // ../producer/src/services/render/stages/captureHdrStage.ts
12142
- import { existsSync as existsSync19, mkdirSync as mkdirSync8 } from "fs";
12230
+ import { existsSync as existsSync18, mkdirSync as mkdirSync8 } from "fs";
12143
12231
  import { join as join29 } from "path";
12144
12232
 
12145
12233
  // ../producer/src/services/hdrImageTransferCache.ts
@@ -12362,7 +12450,7 @@ import { Worker } from "worker_threads";
12362
12450
  import { fileURLToPath as fileURLToPath2, pathToFileURL } from "url";
12363
12451
  import { dirname as dirname10, join as join27 } from "path";
12364
12452
  import { createRequire } from "module";
12365
- import { existsSync as existsSync18 } from "fs";
12453
+ import { existsSync as existsSync17 } from "fs";
12366
12454
  function resolveWorkerEntry(explicit) {
12367
12455
  if (explicit && explicit.length > 0) {
12368
12456
  return { path: explicit, isTs: explicit.endsWith(".ts") };
@@ -12374,7 +12462,7 @@ function resolveWorkerEntry(explicit) {
12374
12462
  }
12375
12463
  const moduleDir = dirname10(fileURLToPath2(import.meta.url));
12376
12464
  const jsPath = join27(moduleDir, "shaderTransitionWorker.js");
12377
- if (existsSync18(jsPath)) return { path: jsPath, isTs: false };
12465
+ if (existsSync17(jsPath)) return { path: jsPath, isTs: false };
12378
12466
  const tsPath = join27(moduleDir, "shaderTransitionWorker.ts");
12379
12467
  return { path: tsPath, isTs: true };
12380
12468
  }
@@ -12940,7 +13028,7 @@ async function runCaptureHdrStage(input) {
12940
13028
  }
12941
13029
  const debugDumpEnabled = process.env.KEEP_TEMP === "1";
12942
13030
  const debugDumpDir = debugDumpEnabled ? join29(framesDir, "debug-composite") : null;
12943
- if (debugDumpDir && !existsSync19(debugDumpDir)) {
13031
+ if (debugDumpDir && !existsSync18(debugDumpDir)) {
12944
13032
  mkdirSync8(debugDumpDir, { recursive: true });
12945
13033
  }
12946
13034
  const compositeTransfer = resolveCompositeTransfer(hasHdrContent, effectiveHdr);
@@ -13099,13 +13187,13 @@ async function runCaptureHdrStage(input) {
13099
13187
  // ../producer/src/services/render/stages/encodeStage.ts
13100
13188
  import {
13101
13189
  copyFileSync as copyFileSync2,
13102
- existsSync as existsSync20,
13190
+ existsSync as existsSync19,
13103
13191
  mkdirSync as mkdirSync9,
13104
13192
  readdirSync as readdirSync5,
13105
13193
  readFileSync as readFileSync7,
13106
13194
  rmSync as rmSync9,
13107
13195
  statSync as statSync6,
13108
- writeFileSync as writeFileSync5
13196
+ writeFileSync as writeFileSync4
13109
13197
  } from "fs";
13110
13198
  import { readFile as readFile2 } from "fs/promises";
13111
13199
  import { dirname as dirname11, join as join30 } from "path";
@@ -13186,7 +13274,7 @@ async function reencodeWithClearedWholeFrames(argsInput, run, startTime) {
13186
13274
  const error = "[FFmpeg] GIF output could not be parsed to clear its frames";
13187
13275
  return gifEncodeFailure(startTime, outputPath, error);
13188
13276
  }
13189
- writeFileSync5(outputPath, gif);
13277
+ writeFileSync4(outputPath, gif);
13190
13278
  return null;
13191
13279
  }
13192
13280
  async function encodeGifFromDir(framesDir, framePattern, outputPath, input) {
@@ -13218,7 +13306,7 @@ async function encodeGifFromDir(framesDir, framePattern, outputPath, input) {
13218
13306
  const failure = await reencodeWithClearedWholeFrames(argsInput, run, startTime);
13219
13307
  if (failure) return failure;
13220
13308
  }
13221
- const fileSize = existsSync20(outputPath) ? statSync6(outputPath).size : 0;
13309
+ const fileSize = existsSync19(outputPath) ? statSync6(outputPath).size : 0;
13222
13310
  return {
13223
13311
  success: true,
13224
13312
  outputPath,
@@ -13387,7 +13475,7 @@ async function runEncodeStage(input) {
13387
13475
  const stage5Start = Date.now();
13388
13476
  if (isPngSequence) {
13389
13477
  const encoded = startEncodeProgress(job, "Writing PNG sequence", onProgress);
13390
- if (!existsSync20(outputPath)) mkdirSync9(outputPath, { recursive: true });
13478
+ if (!existsSync19(outputPath)) mkdirSync9(outputPath, { recursive: true });
13391
13479
  const captured = readdirSync5(framesDir).filter((name) => name.endsWith(".png")).sort();
13392
13480
  if (captured.length === 0) {
13393
13481
  throw new Error(
@@ -13398,7 +13486,7 @@ async function runEncodeStage(input) {
13398
13486
  const dst = join30(outputPath, formatExportFrameName(i, "png"));
13399
13487
  copyFileSync2(join30(framesDir, name), dst);
13400
13488
  });
13401
- if (hasAudio && audioOutputPath && existsSync20(audioOutputPath)) {
13489
+ if (hasAudio && audioOutputPath && existsSync19(audioOutputPath)) {
13402
13490
  copyFileSync2(audioOutputPath, join30(outputPath, MIXED_AUDIO_FILENAME));
13403
13491
  log.info(
13404
13492
  `[Render] png-sequence: ${MIXED_AUDIO_FILENAME} sidecar written to ${outputPath}/${MIXED_AUDIO_FILENAME}`
@@ -13788,7 +13876,7 @@ function findMissingFrameRanges(totalFrames, framesDir, frameExt) {
13788
13876
  let rangeStart = null;
13789
13877
  for (let frameIndex = 0; frameIndex < totalFrames; frameIndex++) {
13790
13878
  const framePath = join31(framesDir, formatCaptureFrameName(frameIndex, frameExt));
13791
- const missing = !existsSync21(framePath) || statSync7(framePath).size <= 8;
13879
+ const missing = !existsSync20(framePath) || statSync7(framePath).size <= 8;
13792
13880
  if (missing && rangeStart === null) {
13793
13881
  rangeStart = frameIndex;
13794
13882
  } else if (!missing && rangeStart !== null) {
@@ -13921,7 +14009,7 @@ function countCapturedFrames(totalFrames, framesDir, frameExt) {
13921
14009
  let captured = 0;
13922
14010
  for (let frameIndex = 0; frameIndex < totalFrames; frameIndex++) {
13923
14011
  const framePath = join31(framesDir, formatCaptureFrameName(frameIndex, frameExt));
13924
- if (existsSync21(framePath)) captured++;
14012
+ if (existsSync20(framePath)) captured++;
13925
14013
  }
13926
14014
  return captured;
13927
14015
  }
@@ -14602,7 +14690,7 @@ async function executeRenderJob(job, projectDir, outputPath, progressSink, abort
14602
14690
  validateChromaSubsamplingConfig(job.config);
14603
14691
  const debugDir = resolveRenderDebugDir();
14604
14692
  const outputDir = dirname12(outputPath);
14605
- if (!existsSync21(outputDir)) mkdirSync10(outputDir, { recursive: true });
14693
+ if (!existsSync20(outputDir)) mkdirSync10(outputDir, { recursive: true });
14606
14694
  const workDir = job.config.debug ? join31(debugDir, job.id) : createRenderWorkDir(resolveRenderWorkDirPrefix(outputPath, job.id), outputDir);
14607
14695
  const pipelineStart = Date.now();
14608
14696
  const baseLog = job.config.logger ?? defaultLogger;
@@ -14759,7 +14847,7 @@ async function executeRenderPipeline(input) {
14759
14847
  job.startedAt = /* @__PURE__ */ new Date();
14760
14848
  assertNotAborted();
14761
14849
  assertConfiguredFfmpegBinariesExist();
14762
- if (!existsSync21(workDir)) mkdirSync10(workDir, { recursive: true });
14850
+ if (!existsSync20(workDir)) mkdirSync10(workDir, { recursive: true });
14763
14851
  if (job.config.debug) {
14764
14852
  log.info("[Render] Debug artifacts enabled", { workDir, logPath });
14765
14853
  }
@@ -14789,7 +14877,7 @@ async function executeRenderPipeline(input) {
14789
14877
  });
14790
14878
  const entryFile = job.config.entryFile || "index.html";
14791
14879
  const htmlPath = join31(projectDir, entryFile);
14792
- if (!existsSync21(htmlPath)) {
14880
+ if (!existsSync20(htmlPath)) {
14793
14881
  throw new Error(`Entry file not found: ${htmlPath}`);
14794
14882
  }
14795
14883
  assertNotAborted();
@@ -14810,6 +14898,7 @@ async function executeRenderPipeline(input) {
14810
14898
  needsAlpha,
14811
14899
  log,
14812
14900
  assertNotAborted,
14901
+ abortSignal: executionSignal,
14813
14902
  variables: job.config.variables,
14814
14903
  pageMotionBlur: job.config.pageMotionBlur
14815
14904
  })
@@ -15157,7 +15246,7 @@ async function executeRenderPipeline(input) {
15157
15246
  throw new Error("File server failed to initialize before frame capture");
15158
15247
  }
15159
15248
  const framesDir = join31(workDir, "captured-frames");
15160
- if (!existsSync21(framesDir)) mkdirSync10(framesDir, { recursive: true });
15249
+ if (!existsSync20(framesDir)) mkdirSync10(framesDir, { recursive: true });
15161
15250
  updateJobStatus(job, "rendering", "Checking browser GPU", 25, onProgress, {
15162
15251
  code: "start_browsers"
15163
15252
  });
@@ -16054,29 +16143,8 @@ async function executeRenderPipeline(input) {
16054
16143
  pageMotionBlur: job.config.pageMotionBlur,
16055
16144
  captureQuality: captureOptions.quality
16056
16145
  });
16057
- const segmentDir = segmentDirFor(join31(projectDir, "renders"), segmentPlanHash);
16146
+ const segmentDir = segmentDirFor(projectDir, segmentPlanHash);
16058
16147
  const manifestKey = loadResumeKeyOrWarn(job.config.resumeSegments === true, log);
16059
- let completedSegments = /* @__PURE__ */ new Set();
16060
- if (job.config.resumeSegments === true) {
16061
- const existing = readSegmentManifest(segmentDir);
16062
- if (existing) {
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
- });
16070
- log.info(`[Render] resuming: ${completedSegments.size} segments complete`, {
16071
- segmentDir
16072
- });
16073
- }
16074
- if (completedSegments.size === 0) {
16075
- rmSync10(segmentDir, { recursive: true, force: true });
16076
- }
16077
- } else {
16078
- rmSync10(segmentDir, { recursive: true, force: true });
16079
- }
16080
16148
  const emptySegmentManifest = () => ({
16081
16149
  version: 1,
16082
16150
  planHash: segmentPlanHash,
@@ -16084,7 +16152,26 @@ async function executeRenderPipeline(input) {
16084
16152
  segmentFrames,
16085
16153
  completed: []
16086
16154
  });
16087
- let segmentManifest = readSegmentManifest(segmentDir) ?? emptySegmentManifest();
16155
+ let segmentManifest = emptySegmentManifest();
16156
+ let completedSegments = /* @__PURE__ */ new Set();
16157
+ const existing = job.config.resumeSegments ? readSegmentManifest(segmentDir) : null;
16158
+ if (existing) {
16159
+ completedSegments = await validateCompletedSegments(existing, {
16160
+ expectedHash: segmentPlanHash,
16161
+ segmentDir,
16162
+ totalFrames,
16163
+ segmentFrames,
16164
+ key: manifestKey,
16165
+ probeFrames: (path) => probeSegmentFrameCount(path, extractMediaMetadata)
16166
+ });
16167
+ segmentManifest.completed = existing.completed.filter(
16168
+ (entry) => completedSegments.has(entry.index)
16169
+ );
16170
+ log.info(`[Render] resuming: ${completedSegments.size} segments complete`, {
16171
+ segmentDir
16172
+ });
16173
+ }
16174
+ if (completedSegments.size === 0) rmSync10(segmentDir, { recursive: true, force: true });
16088
16175
  const invokeSegmented = () => {
16089
16176
  if (capturePlan.kind !== "sdr_segmented") {
16090
16177
  throw new Error(`Cannot invoke segmented stage with ${capturePlan.kind} plan`);
@@ -16601,7 +16688,7 @@ async function executeRenderPipeline(input) {
16601
16688
  })
16602
16689
  );
16603
16690
  const totalElapsed = Date.now() - pipelineStart;
16604
- const tmpPeakBytes = existsSync21(workDir) ? sampleDirectoryBytes(workDir) : 0;
16691
+ const tmpPeakBytes = existsSync20(workDir) ? sampleDirectoryBytes(workDir) : 0;
16605
16692
  recordTransientRetryObservability();
16606
16693
  observability.checkpoint("pipeline", "artifact validated", { totalElapsedMs: totalElapsed });
16607
16694
  const observabilitySummary = observability.summary({
@@ -16673,7 +16760,7 @@ async function executeRenderPipeline(input) {
16673
16760
  job.perfSummary = perfSummary;
16674
16761
  if (job.config.debug) {
16675
16762
  try {
16676
- writeFileSync6(perfOutputPath, JSON.stringify(perfSummary, null, 2), "utf-8");
16763
+ writeFileSync5(perfOutputPath, JSON.stringify(perfSummary, null, 2), "utf-8");
16677
16764
  } catch (err) {
16678
16765
  log.debug("Failed to write perf summary", {
16679
16766
  perfOutputPath,
@@ -16682,7 +16769,7 @@ async function executeRenderPipeline(input) {
16682
16769
  }
16683
16770
  }
16684
16771
  if (job.config.debug) {
16685
- if (!isPngSequence && !isHls && existsSync21(stagedOutputPath)) {
16772
+ if (!isPngSequence && !isHls && existsSync20(stagedOutputPath)) {
16686
16773
  const debugOutput = join31(workDir, `output${videoExt}`);
16687
16774
  copyFileSync3(stagedOutputPath, debugOutput);
16688
16775
  }
@@ -17187,11 +17274,11 @@ async function writeStitchedMp4(chunkPaths, outputPath, audioPath) {
17187
17274
  import {
17188
17275
  copyFileSync as copyFileSync4,
17189
17276
  cpSync as cpSync2,
17190
- existsSync as existsSync26,
17277
+ existsSync as existsSync25,
17191
17278
  linkSync,
17192
17279
  mkdirSync as mkdirSync14,
17193
17280
  rmSync as rmSync12,
17194
- writeFileSync as writeFileSync9
17281
+ writeFileSync as writeFileSync8
17195
17282
  } from "fs";
17196
17283
  import { extname as extname6, isAbsolute as isAbsolute3, join as join40, relative as relative7, sep as sep4 } from "path";
17197
17284
 
@@ -17199,13 +17286,13 @@ import { extname as extname6, isAbsolute as isAbsolute3, join as join40, relativ
17199
17286
  import { join as join35 } from "path";
17200
17287
 
17201
17288
  // ../producer/src/services/distributed/chunkFrames.ts
17202
- import { existsSync as existsSync23, readdirSync as readdirSync7 } from "fs";
17289
+ import { existsSync as existsSync22, readdirSync as readdirSync7 } from "fs";
17203
17290
  import { extname as extname4, join as join34 } from "path";
17204
17291
 
17205
17292
  // ../producer/src/services/distributed/shared.ts
17206
17293
  import { execFile as execFileCallback } from "child_process";
17207
17294
  import { dirname as dirname14, join as join33 } from "path";
17208
- import { existsSync as existsSync22, readFileSync as readFileSync8 } from "fs";
17295
+ import { existsSync as existsSync21, readFileSync as readFileSync8 } from "fs";
17209
17296
  import { fileURLToPath as fileURLToPath4 } from "url";
17210
17297
  import { promisify as promisify2 } from "util";
17211
17298
  var PLAN_VIDEOS_META_RELATIVE_PATH = "meta/videos.json";
@@ -17217,7 +17304,7 @@ function isPlanAudioArtifactPath(path) {
17217
17304
  function resolvePlanAudioPath(planDir) {
17218
17305
  for (const name of [PLAN_AUDIO_RELATIVE_PATH, PLAN_AUDIO_LEGACY_RELATIVE_PATH]) {
17219
17306
  const candidate = join33(planDir, name);
17220
- if (existsSync22(candidate)) return candidate;
17307
+ if (existsSync21(candidate)) return candidate;
17221
17308
  }
17222
17309
  return null;
17223
17310
  }
@@ -17482,7 +17569,7 @@ function readProducerVersion() {
17482
17569
  let current = startDir;
17483
17570
  for (let i = 0; i < 10; i++) {
17484
17571
  const candidate = join33(current, "package.json");
17485
- if (existsSync22(candidate)) {
17572
+ if (existsSync21(candidate)) {
17486
17573
  try {
17487
17574
  const pkg = JSON.parse(readFileSync8(candidate, "utf-8"));
17488
17575
  if (pkg.name === "@hyperframes/producer" && typeof pkg.version === "string") {
@@ -17537,7 +17624,7 @@ function rebuildExtractedFramesFromPlanDir(planDir, videos, indexMode = "dense-v
17537
17624
  const result = [];
17538
17625
  for (const v of videos) {
17539
17626
  const outputDir = join34(planDir, "video-frames", mediaIdPathSegment(v.videoId));
17540
- if (!existsSync23(outputDir)) {
17627
+ if (!existsSync22(outputDir)) {
17541
17628
  throw new Error(
17542
17629
  `[renderChunk] planDir missing extracted video frames for ${JSON.stringify(v.videoId)}: ${outputDir} not present. plan() should have written frames here; the planDir is malformed.`
17543
17630
  );
@@ -17636,7 +17723,7 @@ async function extractDeferredVideoFramesForChunk(input) {
17636
17723
  const range = planned.get(video.videoId).deferredRange;
17637
17724
  const remoteUrl = remoteSources[range.sourcePath];
17638
17725
  const sourcePath = remoteUrl ?? join34(input.planDir, ...range.sourcePath.split("/"));
17639
- if (remoteUrl === void 0 && !existsSync23(sourcePath)) {
17726
+ if (remoteUrl === void 0 && !existsSync22(sourcePath)) {
17640
17727
  throw new RenderChunkValidationError(
17641
17728
  MISSING_PLAN_ARTIFACT,
17642
17729
  `[renderChunk] planDir is missing the source for video ${JSON.stringify(video.videoId)}: ${range.sourcePath}`
@@ -17829,7 +17916,7 @@ async function readPlanReferenceBackground(input) {
17829
17916
  }
17830
17917
 
17831
17918
  // ../producer/src/services/render/stages/freezePlan.ts
17832
- import { existsSync as existsSync24, mkdirSync as mkdirSync12, readFileSync as readFileSync9, readdirSync as readdirSync8, writeFileSync as writeFileSync7 } from "fs";
17919
+ import { existsSync as existsSync23, mkdirSync as mkdirSync12, readFileSync as readFileSync9, readdirSync as readdirSync8, writeFileSync as writeFileSync6 } from "fs";
17833
17920
  import { join as join37, relative as relative5, resolve as resolve8 } from "path";
17834
17921
 
17835
17922
  // ../producer/src/services/distributed/planProtocol.ts
@@ -17925,7 +18012,7 @@ function readPlanProtocolV1(planJson, capabilities = DISTRIBUTED_RENDER_CAPABILI
17925
18012
 
17926
18013
  // ../producer/src/services/render/stages/planHash.ts
17927
18014
  import { createHash as createHash6 } from "crypto";
17928
- import { closeSync as closeSync4, createReadStream as createReadStream5, openSync as openSync4, readSync as readSync4 } from "fs";
18015
+ import { closeSync as closeSync5, createReadStream as createReadStream5, openSync as openSync5, readSync as readSync4 } from "fs";
17929
18016
  var PLAN_HASH_SCHEMA_PREFIX = "hyperframes-plan-hash-v1\0";
17930
18017
  var FIELD_DELIMITER = Buffer.from([0]);
17931
18018
  function computePlanHash(input) {
@@ -17983,7 +18070,7 @@ function sha256Hex(bytes) {
17983
18070
  function sha256File(path) {
17984
18071
  const hash = createHash6("sha256");
17985
18072
  const buffer = Buffer.allocUnsafe(1024 * 1024);
17986
- const fd = openSync4(path, "r");
18073
+ const fd = openSync5(path, "r");
17987
18074
  try {
17988
18075
  let bytesRead = 0;
17989
18076
  do {
@@ -17991,7 +18078,7 @@ function sha256File(path) {
17991
18078
  if (bytesRead > 0) hash.update(buffer.subarray(0, bytesRead));
17992
18079
  } while (bytesRead > 0);
17993
18080
  } finally {
17994
- closeSync4(fd);
18081
+ closeSync5(fd);
17995
18082
  }
17996
18083
  return hash.digest("hex");
17997
18084
  }
@@ -18019,7 +18106,7 @@ function planFileSha256(absolutePath, digests) {
18019
18106
  return sha256;
18020
18107
  }
18021
18108
  async function prehashPlanFiles(dir, digests) {
18022
- if (!existsSync24(dir)) return;
18109
+ if (!existsSync23(dir)) return;
18023
18110
  for (const { absolutePath } of listPlanFiles(dir)) {
18024
18111
  if (!digests.has(absolutePath)) digests.set(absolutePath, await sha256FileAsync(absolutePath));
18025
18112
  }
@@ -18085,19 +18172,19 @@ var PLAN_REMOTE_FILES_RELATIVE_PATH = "meta/remote-files.json";
18085
18172
  function writePlanRemoteFiles(planDir, files) {
18086
18173
  if (files.length === 0) return;
18087
18174
  const sorted = [...files].sort((a, b) => a.path < b.path ? -1 : 1);
18088
- writeFileSync7(join37(planDir, PLAN_REMOTE_FILES_RELATIVE_PATH), JSON.stringify(sorted), "utf-8");
18175
+ writeFileSync6(join37(planDir, PLAN_REMOTE_FILES_RELATIVE_PATH), JSON.stringify(sorted), "utf-8");
18089
18176
  }
18090
18177
  function readPlanRemoteFiles(planDir) {
18091
18178
  const path = join37(planDir, PLAN_REMOTE_FILES_RELATIVE_PATH);
18092
- return existsSync24(path) ? JSON.parse(readFileSync9(path, "utf-8")) : [];
18179
+ return existsSync23(path) ? JSON.parse(readFileSync9(path, "utf-8")) : [];
18093
18180
  }
18094
18181
  function recomputePlanHashFromPlanDir(planDir, digests) {
18095
18182
  const planJsonPath = join37(planDir, "plan.json");
18096
18183
  const encoderJsonPath = join37(planDir, "meta", "encoder.json");
18097
- if (!existsSync24(planJsonPath)) {
18184
+ if (!existsSync23(planJsonPath)) {
18098
18185
  throw new Error(`[freezePlan] plan.json missing: ${planJsonPath}`);
18099
18186
  }
18100
- if (!existsSync24(encoderJsonPath)) {
18187
+ if (!existsSync23(encoderJsonPath)) {
18101
18188
  throw new Error(`[freezePlan] meta/encoder.json missing: ${encoderJsonPath}`);
18102
18189
  }
18103
18190
  const planJson = JSON.parse(readFileSync9(planJsonPath, "utf-8"));
@@ -18127,12 +18214,12 @@ async function freezePlan(input) {
18127
18214
  hasAudio,
18128
18215
  digests
18129
18216
  } = input;
18130
- if (!existsSync24(planDir)) {
18217
+ if (!existsSync23(planDir)) {
18131
18218
  throw new Error(`[freezePlan] planDir does not exist: ${planDir}`);
18132
18219
  }
18133
18220
  const metaDir = join37(planDir, "meta");
18134
- if (!existsSync24(metaDir)) mkdirSync12(metaDir, { recursive: true });
18135
- writeFileSync7(
18221
+ if (!existsSync23(metaDir)) mkdirSync12(metaDir, { recursive: true });
18222
+ writeFileSync6(
18136
18223
  join37(metaDir, "composition.json"),
18137
18224
  `${JSON.stringify(composition, null, 2)}
18138
18225
  `,
@@ -18140,8 +18227,8 @@ async function freezePlan(input) {
18140
18227
  );
18141
18228
  const encoderForCanonical = stripUndefined(encoder);
18142
18229
  const encoderConfigCanonicalJson = canonicalJsonStringify(encoderForCanonical);
18143
- writeFileSync7(join37(metaDir, "encoder.json"), encoderConfigCanonicalJson, "utf-8");
18144
- writeFileSync7(join37(metaDir, "chunks.json"), `${JSON.stringify(chunks, null, 2)}
18230
+ writeFileSync6(join37(metaDir, "encoder.json"), encoderConfigCanonicalJson, "utf-8");
18231
+ writeFileSync6(join37(metaDir, "chunks.json"), `${JSON.stringify(chunks, null, 2)}
18145
18232
  `, "utf-8");
18146
18233
  const { compositionHtml, assets } = collectPlanAssetShas(planDir, digests);
18147
18234
  const planHash = computePlanHash({
@@ -18167,7 +18254,7 @@ async function freezePlan(input) {
18167
18254
  hasAudio
18168
18255
  };
18169
18256
  const planJsonPath = join37(planDir, "plan.json");
18170
- writeFileSync7(planJsonPath, `${JSON.stringify(planJson, null, 2)}
18257
+ writeFileSync6(planJsonPath, `${JSON.stringify(planJson, null, 2)}
18171
18258
  `, "utf-8");
18172
18259
  return { planJsonPath, planHash };
18173
18260
  }
@@ -18208,8 +18295,8 @@ function applyRuntimeEnvSnapshot(snapshot, env = process.env) {
18208
18295
  }
18209
18296
 
18210
18297
  // ../producer/src/services/distributed/chunkAudio.ts
18211
- import { closeSync as closeSync5, existsSync as existsSync25, ftruncateSync, mkdirSync as mkdirSync13, openSync as openSync5, readFileSync as readFileSync10 } from "fs";
18212
- import { writeFileSync as writeFileSync8, writeSync } from "fs";
18298
+ import { closeSync as closeSync6, existsSync as existsSync24, ftruncateSync, mkdirSync as mkdirSync13, openSync as openSync6, readFileSync as readFileSync10 } from "fs";
18299
+ import { writeFileSync as writeFileSync7, writeSync } from "fs";
18213
18300
  import { join as join38 } from "path";
18214
18301
  function audioCutForChunk(grid, chunks, index, fps) {
18215
18302
  const firstPacketAt = (frame) => Math.min(
@@ -18305,18 +18392,18 @@ async function writeChunkAudioSlices(input) {
18305
18392
  const start = offsets[cut.firstPacket];
18306
18393
  layout.partStarts[index] = start;
18307
18394
  const end = offsets[last] + track.sizes[last];
18308
- writeFileSync8(join38(input.planDir, chunkAudioSlicePath(index)), bytes.subarray(start, end));
18395
+ writeFileSync7(join38(input.planDir, chunkAudioSlicePath(index)), bytes.subarray(start, end));
18309
18396
  });
18310
18397
  const frame = [bytes.subarray(0, payloadStart), bytes.subarray(payloadEnd)];
18311
- writeFileSync8(join38(input.planDir, SLICE_FRAME), Buffer.concat(frame));
18312
- writeFileSync8(join38(input.planDir, SLICE_LAYOUT), JSON.stringify(layout));
18398
+ writeFileSync7(join38(input.planDir, SLICE_FRAME), Buffer.concat(frame));
18399
+ writeFileSync7(join38(input.planDir, SLICE_LAYOUT), JSON.stringify(layout));
18313
18400
  }
18314
18401
  function chunkAudioSource(planDir, chunkIndex, scratchPath) {
18315
18402
  const layoutPath = join38(planDir, SLICE_LAYOUT);
18316
- if (!existsSync25(layoutPath)) return resolvePlanAudioPath(planDir);
18403
+ if (!existsSync24(layoutPath)) return resolvePlanAudioPath(planDir);
18317
18404
  const layout = JSON.parse(readFileSync10(layoutPath, "utf-8"));
18318
18405
  const frame = readFileSync10(join38(planDir, SLICE_FRAME));
18319
- const fd = openSync5(scratchPath, "w");
18406
+ const fd = openSync6(scratchPath, "w");
18320
18407
  try {
18321
18408
  writeSync(fd, frame, 0, layout.payloadStart, 0);
18322
18409
  writeSync(
@@ -18333,7 +18420,7 @@ function chunkAudioSource(planDir, chunkIndex, scratchPath) {
18333
18420
  }
18334
18421
  ftruncateSync(fd, layout.sizeBytes);
18335
18422
  } finally {
18336
- closeSync5(fd);
18423
+ closeSync6(fd);
18337
18424
  }
18338
18425
  return scratchPath;
18339
18426
  }
@@ -18880,7 +18967,7 @@ function createVideoSourceShipper(input) {
18880
18967
  let result = null;
18881
18968
  for (const root of stagedRel === null ? [input.workCompiledDir, input.projectDir] : []) {
18882
18969
  const rel = pathInside(root, srcPath);
18883
- if (rel !== null && (existsSync26(join40(input.planDir, "compiled", rel)) || input.isRemote(srcPath))) {
18970
+ if (rel !== null && (existsSync25(join40(input.planDir, "compiled", rel)) || input.isRemote(srcPath))) {
18884
18971
  result = ["compiled", ...rel.split(sep4)].join("/");
18885
18972
  break;
18886
18973
  }
@@ -18908,7 +18995,7 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
18908
18995
  useGpu: false,
18909
18996
  browserGpuMode: "software"
18910
18997
  });
18911
- if (!existsSync26(planDir)) mkdirSync14(planDir, { recursive: true });
18998
+ if (!existsSync25(planDir)) mkdirSync14(planDir, { recursive: true });
18912
18999
  const log = config.logger ?? defaultLogger;
18913
19000
  const sizeLimitBytes = options.executionPlanSizeLimitBytes ?? config.planDirSizeLimitBytes ?? PLAN_DIR_SIZE_LIMIT_BYTES;
18914
19001
  const abortSignal = config.abortSignal;
@@ -18943,7 +19030,7 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
18943
19030
  });
18944
19031
  const entryFile = config.entryFile ?? "index.html";
18945
19032
  const htmlPath = join40(projectDir, entryFile);
18946
- if (!existsSync26(htmlPath)) {
19033
+ if (!existsSync25(htmlPath)) {
18947
19034
  throw new Error(`[plan] entry file not found: ${htmlPath}`);
18948
19035
  }
18949
19036
  const workDir = join40(planDir, ".plan-work");
@@ -19069,7 +19156,7 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
19069
19156
  if (probeResult.fileServer) closeFileServerSafely(probeResult.fileServer, "plan", log);
19070
19157
  if (probeResult.probeSession) {
19071
19158
  try {
19072
- const { closeCaptureSession: closeCaptureSession2 } = await import("./src-UG2WAJ4N.js");
19159
+ const { closeCaptureSession: closeCaptureSession2 } = await import("./src-T6K3VPXH.js");
19073
19160
  await closeCaptureSession2(probeResult.probeSession);
19074
19161
  } catch (err) {
19075
19162
  log.warn("[plan] probe session close failed", {
@@ -19179,15 +19266,15 @@ async function buildLocalExecutionPlan(projectDir, config, executionPlanDir, opt
19179
19266
  logPlanStage(log, "extract", stageStarted);
19180
19267
  const stagedVideoFrames = join40(compiledDir, "__hyperframes_video_frames");
19181
19268
  const videoFramesDst = join40(planDir, "video-frames");
19182
- if (existsSync26(videoFramesDst)) rmSync12(videoFramesDst, { recursive: true, force: true });
19269
+ if (existsSync25(videoFramesDst)) rmSync12(videoFramesDst, { recursive: true, force: true });
19183
19270
  const videoSourcesDir = join40(planDir, "video-sources");
19184
19271
  rmSync12(videoSourcesDir, { recursive: true, force: true });
19185
- if (existsSync26(stagedVideoFrames)) {
19272
+ if (existsSync25(stagedVideoFrames)) {
19186
19273
  renameWithRetry(stagedVideoFrames, videoFramesDst);
19187
19274
  } else {
19188
19275
  mkdirSync14(videoFramesDst, { recursive: true });
19189
19276
  }
19190
- if (existsSync26(finalCompiledDir)) rmSync12(finalCompiledDir, { recursive: true, force: true });
19277
+ if (existsSync25(finalCompiledDir)) rmSync12(finalCompiledDir, { recursive: true, force: true });
19191
19278
  renameWithRetry(compiledDir, finalCompiledDir);
19192
19279
  const shipVideoSource = createVideoSourceShipper({
19193
19280
  planDir,
@@ -19226,7 +19313,7 @@ async function buildLocalExecutionPlan(projectDir, config, executionPlanDir, opt
19226
19313
  sizeBytes
19227
19314
  }))
19228
19315
  );
19229
- writeFileSync9(
19316
+ writeFileSync8(
19230
19317
  join40(planDir, PLAN_VIDEOS_META_RELATIVE_PATH),
19231
19318
  JSON.stringify(planVideosJson, null, 2),
19232
19319
  "utf-8"
@@ -19308,10 +19395,10 @@ async function buildLocalExecutionPlan(projectDir, config, executionPlanDir, opt
19308
19395
  applyDistributedAudioWarningPolicy(job, audioResult.audioError, audioResult.audioFailures, log);
19309
19396
  }
19310
19397
  const planAudioPath = join40(planDir, PLAN_AUDIO_RELATIVE_PATH);
19311
- if (audioResult?.hasAudio && existsSync26(audioResult.audioOutputPath)) {
19398
+ if (audioResult?.hasAudio && existsSync25(audioResult.audioOutputPath)) {
19312
19399
  renameWithRetry(audioResult.audioOutputPath, planAudioPath);
19313
19400
  }
19314
- if (chunksCarryAudio && existsSync26(planAudioPath)) {
19401
+ if (chunksCarryAudio && existsSync25(planAudioPath)) {
19315
19402
  if (options.sliceChunkAudio) {
19316
19403
  stageStarted = Date.now();
19317
19404
  await writeChunkAudioSlices({
@@ -19433,20 +19520,20 @@ async function plan(projectDir, config, planDir, options = {}) {
19433
19520
 
19434
19521
  // ../producer/src/services/distributed/renderChunk.ts
19435
19522
  import { randomBytes } from "crypto";
19436
- import { existsSync as existsSync29, mkdirSync as mkdirSync17, readFileSync as readFileSync12, readdirSync as readdirSync11, rmSync as rmSync15, writeFileSync as writeFileSync12 } from "fs";
19523
+ import { existsSync as existsSync28, mkdirSync as mkdirSync17, readFileSync as readFileSync12, readdirSync as readdirSync11, rmSync as rmSync15, writeFileSync as writeFileSync11 } from "fs";
19437
19524
  import { join as join44 } from "path";
19438
19525
 
19439
19526
  // ../producer/src/services/distributed/planV2.ts
19440
19527
  import {
19441
19528
  copyFileSync as copyFileSync6,
19442
- existsSync as existsSync28,
19529
+ existsSync as existsSync27,
19443
19530
  lstatSync as lstatSync5,
19444
19531
  mkdirSync as mkdirSync16,
19445
19532
  readFileSync as readFileSync11,
19446
19533
  readdirSync as readdirSync10,
19447
19534
  rmSync as rmSync14,
19448
19535
  statSync as statSync9,
19449
- writeFileSync as writeFileSync11
19536
+ writeFileSync as writeFileSync10
19450
19537
  } from "fs";
19451
19538
  import { tmpdir as tmpdir4 } from "os";
19452
19539
  import { dirname as dirname16, isAbsolute as isAbsolute4, join as join43, relative as relative8, resolve as resolve9, sep as sep5 } from "path";
@@ -19454,12 +19541,12 @@ import { dirname as dirname16, isAbsolute as isAbsolute4, join as join43, relati
19454
19541
  // ../producer/src/services/distributed/planV2Publisher.ts
19455
19542
  import {
19456
19543
  copyFileSync as copyFileSync5,
19457
- existsSync as existsSync27,
19544
+ existsSync as existsSync26,
19458
19545
  linkSync as linkSync2,
19459
19546
  mkdirSync as mkdirSync15,
19460
19547
  rmSync as rmSync13,
19461
19548
  statSync as statSync8,
19462
- writeFileSync as writeFileSync10
19549
+ writeFileSync as writeFileSync9
19463
19550
  } from "fs";
19464
19551
  import { dirname as dirname15, join as join42 } from "path";
19465
19552
 
@@ -19516,7 +19603,7 @@ var LocalPlanV2ArtifactPublisher = class {
19516
19603
  #linkFile;
19517
19604
  #committed = false;
19518
19605
  constructor(destinationDir, options = {}) {
19519
- if (existsSync27(destinationDir)) {
19606
+ if (existsSync26(destinationDir)) {
19520
19607
  throw new PlanV2IntegrityError(`output directory already exists: ${destinationDir}`);
19521
19608
  }
19522
19609
  this.destinationDir = destinationDir;
@@ -19533,7 +19620,7 @@ var LocalPlanV2ArtifactPublisher = class {
19533
19620
  );
19534
19621
  }
19535
19622
  const destinationPath = planV2BlobPath(this.temporaryDir, digest);
19536
- if (existsSync27(destinationPath)) return;
19623
+ if (existsSync26(destinationPath)) return;
19537
19624
  mkdirSync15(dirname15(destinationPath), { recursive: true });
19538
19625
  const stagingDir = createStagingDir(dirname15(destinationPath), ".plan-v2-blob-");
19539
19626
  const temporaryPath = join42(stagingDir, "blob");
@@ -19551,13 +19638,13 @@ var LocalPlanV2ArtifactPublisher = class {
19551
19638
  }
19552
19639
  async commitManifest(manifestBytes) {
19553
19640
  for (const digest of new Set(manifestDigests(manifestBytes))) {
19554
- if (!existsSync27(planV2BlobPath(this.temporaryDir, digest))) {
19641
+ if (!existsSync26(planV2BlobPath(this.temporaryDir, digest))) {
19555
19642
  throw new PlanV2IntegrityError(
19556
19643
  `cannot commit manifest before referenced blob is durable: ${digest}`
19557
19644
  );
19558
19645
  }
19559
19646
  }
19560
- writeFileSync10(join42(this.temporaryDir, "plan.json"), manifestBytes, "utf-8");
19647
+ writeFileSync9(join42(this.temporaryDir, "plan.json"), manifestBytes, "utf-8");
19561
19648
  renameWithRetry(this.temporaryDir, this.destinationDir);
19562
19649
  this.#committed = true;
19563
19650
  }
@@ -19630,7 +19717,7 @@ function assertValidExtractionCacheCompleteSentinel(path) {
19630
19717
  }
19631
19718
  function validateExtractionCacheCompleteSentinels(executionPlanDir) {
19632
19719
  const videoRoot = join43(executionPlanDir, "video-frames");
19633
- if (!existsSync28(videoRoot)) return;
19720
+ if (!existsSync27(videoRoot)) return;
19634
19721
  for (const videoEntry of readdirSync10(videoRoot, { withFileTypes: true })) {
19635
19722
  if (!videoEntry.isDirectory()) continue;
19636
19723
  const videoDir = join43(videoRoot, videoEntry.name);
@@ -19731,7 +19818,7 @@ function parsePlanVideosJson2(value) {
19731
19818
  }
19732
19819
  function materializeExtractedVideoDirectories(planDir) {
19733
19820
  const videosPath = join43(planDir, PLAN_VIDEOS_META_RELATIVE_PATH);
19734
- if (!existsSync28(videosPath)) return;
19821
+ if (!existsSync27(videosPath)) return;
19735
19822
  const videos = parsePlanVideosJson2(readJsonFile(videosPath, PLAN_VIDEOS_META_RELATIVE_PATH));
19736
19823
  for (const video of videos.extracted) {
19737
19824
  mkdirSync16(resolveExtractedVideoOutputDir(planDir, video.videoId), { recursive: true });
@@ -19765,9 +19852,9 @@ function parseChunkSlices(value) {
19765
19852
  }
19766
19853
  function buildVideoChunkDependencies(executionPlanDir, dimensions) {
19767
19854
  const videoRoot = join43(executionPlanDir, "video-frames");
19768
- const hasExtractedFrames = existsSync28(videoRoot) && listFiles(videoRoot).length > 0;
19855
+ const hasExtractedFrames = existsSync27(videoRoot) && listFiles(videoRoot).length > 0;
19769
19856
  const videosPath = join43(executionPlanDir, PLAN_VIDEOS_META_RELATIVE_PATH);
19770
- if (!existsSync28(videosPath)) {
19857
+ if (!existsSync27(videosPath)) {
19771
19858
  return hasExtractedFrames ? { mode: "full-source-pack", dependencies: null } : { mode: "exact-rendered-frames", dependencies: /* @__PURE__ */ new Map() };
19772
19859
  }
19773
19860
  const chunksPath = join43(executionPlanDir, "meta", "chunks.json");
@@ -19824,7 +19911,7 @@ function computeManifestHash(manifest) {
19824
19911
  return sha256Hex(`${PLAN_V2_HASH_PREFIX}${canonicalJsonStringify(manifestPayload(manifest))}`);
19825
19912
  }
19826
19913
  function writeBlob(sourcePath, destinationPath) {
19827
- if (existsSync28(destinationPath)) return;
19914
+ if (existsSync27(destinationPath)) return;
19828
19915
  mkdirSync16(dirname16(destinationPath), { recursive: true });
19829
19916
  const temporaryDir = createStagingDir(dirname16(destinationPath), ".plan-v2-blob-");
19830
19917
  const temporaryPath = join43(temporaryDir, "blob");
@@ -19864,7 +19951,7 @@ async function putTasks(tasks) {
19864
19951
  }
19865
19952
  function buildPlanV2Publication(executionPlanDir, digests) {
19866
19953
  const executionPlanPath = join43(executionPlanDir, "plan.json");
19867
- if (!existsSync28(executionPlanPath)) {
19954
+ if (!existsSync27(executionPlanPath)) {
19868
19955
  throw new PlanV2IntegrityError(`execution plan is missing plan.json: ${executionPlanPath}`);
19869
19956
  }
19870
19957
  const executionPlanValue = readJsonFile(executionPlanPath, "execution plan.json");
@@ -19944,7 +20031,7 @@ function buildPlanV2Publication(executionPlanDir, digests) {
19944
20031
  };
19945
20032
  }
19946
20033
  function createPlanV2FromExecutionPlan(executionPlanDir, planV2Dir) {
19947
- if (existsSync28(planV2Dir)) {
20034
+ if (existsSync27(planV2Dir)) {
19948
20035
  throw new PlanV2IntegrityError(`output directory already exists: ${planV2Dir}`);
19949
20036
  }
19950
20037
  const publication = buildPlanV2Publication(executionPlanDir);
@@ -19957,7 +20044,7 @@ function createPlanV2FromExecutionPlan(executionPlanDir, planV2Dir) {
19957
20044
  for (const blob of publication.blobs) {
19958
20045
  writeBlob(blob.sourcePath, planV2BlobPath(tempDir, blob.sha256));
19959
20046
  }
19960
- writeFileSync11(
20047
+ writeFileSync10(
19961
20048
  join43(tempDir, "plan.json"),
19962
20049
  canonicalJsonStringify(publication.manifest),
19963
20050
  "utf-8"
@@ -20034,7 +20121,7 @@ async function planV2WithPublisher(projectDir, config, publisher, options = {})
20034
20121
  }
20035
20122
  }
20036
20123
  async function planV2(projectDir, config, planV2Dir) {
20037
- if (existsSync28(planV2Dir)) {
20124
+ if (existsSync27(planV2Dir)) {
20038
20125
  throw new PlanV2IntegrityError(`output directory already exists: ${planV2Dir}`);
20039
20126
  }
20040
20127
  const publisher = new LocalPlanV2ArtifactPublisher(planV2Dir);
@@ -20188,7 +20275,7 @@ function parsePlanV2Manifest(value) {
20188
20275
  }
20189
20276
  function readPlanV2Manifest(planV2Dir) {
20190
20277
  const manifestPath = join43(planV2Dir, "plan.json");
20191
- if (!existsSync28(manifestPath)) {
20278
+ if (!existsSync27(manifestPath)) {
20192
20279
  throw new PlanV2IntegrityError(`missing v2 manifest: ${manifestPath}`);
20193
20280
  }
20194
20281
  const value = readJsonFile(manifestPath, "v2 manifest");
@@ -20207,7 +20294,7 @@ function listPlanV2ArtifactsForTarget(manifest, target) {
20207
20294
  }
20208
20295
  function verifyBlob(planV2Dir, artifact) {
20209
20296
  const sourcePath = planV2BlobPath(planV2Dir, artifact.sha256);
20210
- if (!existsSync28(sourcePath)) {
20297
+ if (!existsSync27(sourcePath)) {
20211
20298
  throw new PlanV2IntegrityError(`missing content-addressed artifact ${artifact.sha256}`);
20212
20299
  }
20213
20300
  const stats = statSync9(sourcePath);
@@ -20220,7 +20307,7 @@ function verifyBlob(planV2Dir, artifact) {
20220
20307
  return sourcePath;
20221
20308
  }
20222
20309
  function materializePlanV2Target(planV2Dir, target, destinationDir, options = {}) {
20223
- if (existsSync28(destinationDir)) {
20310
+ if (existsSync27(destinationDir)) {
20224
20311
  throw new PlanV2IntegrityError(`materialization destination already exists: ${destinationDir}`);
20225
20312
  }
20226
20313
  const manifest = readPlanV2Manifest(planV2Dir);
@@ -20241,7 +20328,7 @@ function materializePlanV2Target(planV2Dir, target, destinationDir, options = {}
20241
20328
  copyFileSync6(sourcePath, destinationPath);
20242
20329
  }
20243
20330
  if (target.role === "chunk") materializeExtractedVideoDirectories(tempDir);
20244
- writeFileSync11(
20331
+ writeFileSync10(
20245
20332
  join43(tempDir, PLAN_V2_MATERIALIZATION_MARKER),
20246
20333
  canonicalJsonStringify({
20247
20334
  manifest,
@@ -20285,7 +20372,7 @@ function validatePlanV2MaterializedTarget(planDir, expectedTarget) {
20285
20372
  }
20286
20373
  function readValidatedPlanV2Materialization(planDir, expectedTarget) {
20287
20374
  const markerPath = join43(planDir, PLAN_V2_MATERIALIZATION_MARKER);
20288
- if (!existsSync28(markerPath)) return null;
20375
+ if (!existsSync27(markerPath)) return null;
20289
20376
  const marker = readJsonFile(markerPath, "materialization marker");
20290
20377
  if (!isRecord3(marker) || !isRecord3(marker.manifest) || !isRecord3(marker.target)) {
20291
20378
  throw new PlanV2IntegrityError("malformed materialization marker");
@@ -20303,7 +20390,7 @@ function readValidatedPlanV2Materialization(planDir, expectedTarget) {
20303
20390
  for (const artifact of required) {
20304
20391
  if (Object.hasOwn(remoteSources, artifact.path)) continue;
20305
20392
  const path = join43(planDir, ...artifact.path.split("/"));
20306
- if (!existsSync28(path) || statSync9(path).size !== artifact.sizeBytes) {
20393
+ if (!existsSync27(path) || statSync9(path).size !== artifact.sizeBytes) {
20307
20394
  throw new PlanV2IntegrityError(
20308
20395
  `materialized artifact missing or truncated: ${artifact.path}`
20309
20396
  );
@@ -20453,7 +20540,7 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
20453
20540
  const planJsonPath = join44(planDir, "plan.json");
20454
20541
  const encoderJsonPath = join44(planDir, "meta", "encoder.json");
20455
20542
  const chunksJsonPath = join44(planDir, "meta", "chunks.json");
20456
- if (!existsSync29(planJsonPath)) {
20543
+ if (!existsSync28(planJsonPath)) {
20457
20544
  throw new RenderChunkValidationError(
20458
20545
  MISSING_PLAN_ARTIFACT,
20459
20546
  `[renderChunk] planDir is missing required artifact: ${planJsonPath}`
@@ -20469,7 +20556,7 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
20469
20556
  const v2Manifest = v2Materialization?.manifest ?? null;
20470
20557
  const remoteSources = v2Materialization?.remoteSources ?? {};
20471
20558
  for (const required of [encoderJsonPath, chunksJsonPath]) {
20472
- if (!existsSync29(required)) {
20559
+ if (!existsSync28(required)) {
20473
20560
  throw new RenderChunkValidationError(
20474
20561
  MISSING_PLAN_ARTIFACT,
20475
20562
  `[renderChunk] planDir is missing required artifact: ${required}`
@@ -20480,7 +20567,7 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
20480
20567
  const chunks = JSON.parse(readFileSync12(chunksJsonPath, "utf-8"));
20481
20568
  const videosJsonPath = join44(planDir, PLAN_VIDEOS_META_RELATIVE_PATH);
20482
20569
  let planVideos = null;
20483
- if (existsSync29(videosJsonPath)) {
20570
+ if (existsSync28(videosJsonPath)) {
20484
20571
  try {
20485
20572
  planVideos = validatePlanVideosForChunk(JSON.parse(readFileSync12(videosJsonPath, "utf-8")));
20486
20573
  } catch (err) {
@@ -20511,7 +20598,7 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
20511
20598
  const range = resolveChunkFrameRange(slice, chunkIndex, options?.frameRange);
20512
20599
  const framesInChunk = range.endFrame - range.startFrame;
20513
20600
  const compiledDir = join44(planDir, "compiled");
20514
- if (!existsSync29(compiledDir)) {
20601
+ if (!existsSync28(compiledDir)) {
20515
20602
  throw new RenderChunkValidationError(
20516
20603
  MISSING_PLAN_ARTIFACT,
20517
20604
  `[renderChunk] planDir missing compiled/ directory: ${compiledDir}`
@@ -20763,10 +20850,10 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
20763
20850
  const effectiveBitrate = encoder.crf != null ? void 0 : encoder.bitrate;
20764
20851
  const videoOnlyPath = encoder.chunksCarryAudio ? `${outputChunkPath}.video.mp4` : outputChunkPath;
20765
20852
  if (isPngSequence) {
20766
- if (!existsSync29(outputChunkPath)) mkdirSync17(outputChunkPath, { recursive: true });
20853
+ if (!existsSync28(outputChunkPath)) mkdirSync17(outputChunkPath, { recursive: true });
20767
20854
  } else {
20768
20855
  const outDir = join44(outputChunkPath, "..");
20769
- if (!existsSync29(outDir)) mkdirSync17(outDir, { recursive: true });
20856
+ if (!existsSync28(outDir)) mkdirSync17(outDir, { recursive: true });
20770
20857
  }
20771
20858
  const encodeInput = {
20772
20859
  job,
@@ -20979,7 +21066,7 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
20979
21066
  producerVersion: plan2.producerVersion,
20980
21067
  ffmpegVersion
20981
21068
  };
20982
- writeFileSync12(perfPath, `${JSON.stringify(perfPayload, null, 2)}
21069
+ writeFileSync11(perfPath, `${JSON.stringify(perfPayload, null, 2)}
20983
21070
  `, "utf-8");
20984
21071
  try {
20985
21072
  rmSync15(workDir, { recursive: true, force: true, maxRetries: 3, retryDelay: 100 });
@@ -21689,11 +21776,11 @@ function renderRequestFromDistributedConfig(input) {
21689
21776
 
21690
21777
  // ../producer/src/server.ts
21691
21778
  import {
21692
- existsSync as existsSync32,
21779
+ existsSync as existsSync31,
21693
21780
  mkdirSync as mkdirSync19,
21694
21781
  statSync as statSync11,
21695
21782
  mkdtempSync as mkdtempSync2,
21696
- writeFileSync as writeFileSync13,
21783
+ writeFileSync as writeFileSync12,
21697
21784
  rmSync as rmSync17,
21698
21785
  createReadStream as createReadStream6
21699
21786
  } from "fs";
@@ -21708,13 +21795,13 @@ import { serve as serve2 } from "@hono/node-server";
21708
21795
 
21709
21796
  // ../producer/src/services/hyperframeLint.ts
21710
21797
  import {
21711
- existsSync as existsSync30,
21798
+ existsSync as existsSync29,
21712
21799
  readFileSync as readFileSync14,
21713
21800
  statSync as statSync10,
21714
- openSync as openSync6,
21715
- fstatSync as fstatSync3,
21716
- closeSync as closeSync6,
21717
- constants as constants3
21801
+ openSync as openSync7,
21802
+ fstatSync as fstatSync4,
21803
+ closeSync as closeSync7,
21804
+ constants as constants4
21718
21805
  } from "fs";
21719
21806
  import { resolve as resolve10, join as join46, relative as relative9, isAbsolute as isAbsolute5, sep as sep6, dirname as dirname17 } from "path";
21720
21807
  import { fileURLToPath as fileURLToPath5 } from "url";
@@ -21747,7 +21834,7 @@ function pickEntryFile(files, preferredEntryFile) {
21747
21834
  function readEntryHtml(filePath) {
21748
21835
  let fd;
21749
21836
  try {
21750
- fd = openSync6(filePath, constants3.O_RDONLY | constants3.O_NONBLOCK);
21837
+ fd = openSync7(filePath, constants4.O_RDONLY | constants4.O_NONBLOCK);
21751
21838
  } catch (error) {
21752
21839
  if (error instanceof Error && "code" in error && (error.code === "ENOENT" || error.code === "ENOTDIR"))
21753
21840
  return null;
@@ -21755,10 +21842,10 @@ function readEntryHtml(filePath) {
21755
21842
  throw error;
21756
21843
  }
21757
21844
  try {
21758
- if (!fstatSync3(fd).isFile()) return null;
21845
+ if (!fstatSync4(fd).isFile()) return null;
21759
21846
  return readFileSync14(fd, "utf-8");
21760
21847
  } finally {
21761
- closeSync6(fd);
21848
+ closeSync7(fd);
21762
21849
  }
21763
21850
  }
21764
21851
  function leavesProject(absProjectDir, absoluteEntryPath, isAllowedEntry) {
@@ -21767,7 +21854,7 @@ function leavesProject(absProjectDir, absoluteEntryPath, isAllowedEntry) {
21767
21854
  }
21768
21855
  function readProjectEntryFile(projectDir, preferredEntryFile, isAllowedEntry) {
21769
21856
  const absProjectDir = resolve10(projectDir);
21770
- if (!existsSync30(absProjectDir) || !statSync10(absProjectDir).isDirectory()) {
21857
+ if (!existsSync29(absProjectDir) || !statSync10(absProjectDir).isDirectory()) {
21771
21858
  return { error: `Project directory not found: ${absProjectDir}` };
21772
21859
  }
21773
21860
  const entryCandidates = [preferredEntryFile, "index.html", "src/index.html"].filter(
@@ -21858,7 +21945,7 @@ function resolveLintWorkerEntry() {
21858
21945
  const here = dirname17(fileURLToPath5(import.meta.url));
21859
21946
  for (const name of ["hyperframeLintWorker.js", "hyperframeLintWorker.ts"]) {
21860
21947
  const candidate = join46(here, name);
21861
- if (existsSync30(candidate)) return candidate;
21948
+ if (existsSync29(candidate)) return candidate;
21862
21949
  }
21863
21950
  return void 0;
21864
21951
  }
@@ -21929,7 +22016,7 @@ async function runHyperframeLint(prepared, options = {}) {
21929
22016
  import { Worker as Worker3 } from "worker_threads";
21930
22017
  import { fileURLToPath as fileURLToPath6 } from "url";
21931
22018
  import { dirname as dirname18, join as join47 } from "path";
21932
- import { existsSync as existsSync31 } from "fs";
22019
+ import { existsSync as existsSync30 } from "fs";
21933
22020
  var DEFAULT_HEALTH_PORT = 9848;
21934
22021
  async function startHealthWorker(options = {}) {
21935
22022
  const log = options.logger ?? defaultLogger2();
@@ -22006,7 +22093,7 @@ function resolveWorkerEntry2() {
22006
22093
  const here = dirname18(fileURLToPath6(import.meta.url));
22007
22094
  const candidates = [join47(here, "healthWorkerThread.js"), join47(here, "healthWorkerThread.ts")];
22008
22095
  for (const candidate of candidates) {
22009
- if (existsSync31(candidate)) return candidate;
22096
+ if (existsSync30(candidate)) return candidate;
22010
22097
  }
22011
22098
  return void 0;
22012
22099
  }
@@ -22170,7 +22257,7 @@ function resolvePreparedRenderOutput(prepared, rendersDir, log, confineOutput) {
22170
22257
  }
22171
22258
  }
22172
22259
  const outputDir = dirname19(absoluteOutputPath);
22173
- if (!existsSync32(outputDir)) mkdirSync19(outputDir, { recursive: true });
22260
+ if (!existsSync31(outputDir)) mkdirSync19(outputDir, { recursive: true });
22174
22261
  return { input, cleanupProjectDir, absoluteOutputPath };
22175
22262
  }
22176
22263
  function prepareRenderJob(prepared, rendersDir, log, confineOutput) {
@@ -22248,12 +22335,12 @@ function prepareProjectDirectory(projectDir, options, policy) {
22248
22335
  if (!candidate) return null;
22249
22336
  const absProjectDir = policy ? resolve11(policy.projectsDir, candidate) : resolve11(candidate);
22250
22337
  const shown = policy ? candidate : absProjectDir;
22251
- if (policy && !isAllowedProjectPath(policy.projectsDir, absProjectDir) || !existsSync32(absProjectDir) || !statSync11(absProjectDir).isDirectory()) {
22338
+ if (policy && !isAllowedProjectPath(policy.projectsDir, absProjectDir) || !existsSync31(absProjectDir) || !statSync11(absProjectDir).isDirectory()) {
22252
22339
  return { error: `Project directory not found: ${shown}` };
22253
22340
  }
22254
22341
  const entry = options.entryFile || "index.html";
22255
22342
  const entryPath = resolve11(absProjectDir, entry);
22256
- if (policy && !isAllowedEntryPath(policy, absProjectDir, entryPath) || !existsSync32(entryPath)) {
22343
+ if (policy && !isAllowedEntryPath(policy, absProjectDir, entryPath) || !existsSync31(entryPath)) {
22257
22344
  return { error: `Entry file "${entry}" not found in project directory: ${shown}` };
22258
22345
  }
22259
22346
  return { prepared: { input: { projectDir: absProjectDir, ...options } } };
@@ -22275,7 +22362,7 @@ async function resolveInlineRenderHtml(body) {
22275
22362
  function materializeInlineProject(html, options) {
22276
22363
  const tempRoot = process.env.PRODUCER_TMP_PROJECT_DIR || tmpdir6();
22277
22364
  const tempProjectDir = mkdtempSync2(join48(tempRoot, "producer-project-"));
22278
- writeFileSync13(join48(tempProjectDir, "index.html"), html, "utf-8");
22365
+ writeFileSync12(join48(tempProjectDir, "index.html"), html, "utf-8");
22279
22366
  return {
22280
22367
  prepared: {
22281
22368
  input: { projectDir: tempProjectDir, ...options },
@@ -22351,7 +22438,7 @@ function publicPerfSummary(job) {
22351
22438
  return job.perfSummary ? { ...job.perfSummary, renderId: void 0 } : null;
22352
22439
  }
22353
22440
  function outputFileSize(path) {
22354
- return existsSync32(path) ? statSync11(path).size : 0;
22441
+ return existsSync31(path) ? statSync11(path).size : 0;
22355
22442
  }
22356
22443
  function createBlockingProgressReporter(log, requestId) {
22357
22444
  let lastLoggedPct = -10;
@@ -22678,7 +22765,7 @@ function createRenderHandlers(options = {}) {
22678
22765
  if (!artifact) {
22679
22766
  return c.json({ success: false, error: "Output artifact not found or expired" }, 404);
22680
22767
  }
22681
- if (!existsSync32(artifact.path)) {
22768
+ if (!existsSync31(artifact.path)) {
22682
22769
  store.delete(token);
22683
22770
  return c.json({ success: false, error: "Output artifact file missing" }, 404);
22684
22771
  }
@@ -22819,7 +22906,7 @@ function startServer(options = {}) {
22819
22906
  });
22820
22907
  async function shutdown(signal) {
22821
22908
  log.info(`Received ${signal}, shutting down`);
22822
- const { drainBrowserPool } = await import("./src-UG2WAJ4N.js");
22909
+ const { drainBrowserPool } = await import("./src-T6K3VPXH.js");
22823
22910
  await drainBrowserPool().catch(() => {
22824
22911
  });
22825
22912
  const handle = await Promise.race([
@@ -22862,13 +22949,12 @@ import { join as join50 } from "path";
22862
22949
  // ../producer/src/services/distributed/assemble.ts
22863
22950
  import {
22864
22951
  cpSync as cpSync3,
22865
- existsSync as existsSync33,
22952
+ existsSync as existsSync32,
22866
22953
  mkdirSync as mkdirSync20,
22867
22954
  readFileSync as readFileSync15,
22868
22955
  readdirSync as readdirSync12,
22869
22956
  rmSync as rmSync18,
22870
- statSync as statSync12,
22871
- writeFileSync as writeFileSync14
22957
+ statSync as statSync12
22872
22958
  } from "fs";
22873
22959
  import { basename as basename8, dirname as dirname20, join as join49 } from "path";
22874
22960
  function cfrRateControlArgs(locked) {
@@ -22903,7 +22989,7 @@ async function assemble(planDir, chunkOutputs, audioPath, outputPath, options) {
22903
22989
  }
22904
22990
  const format = plan2.dimensions.format;
22905
22991
  const cfrEncoder = cfr ? readCfrEncoder(planDir, format) : null;
22906
- if (!existsSync33(dirname20(outputPath))) {
22992
+ if (!existsSync32(dirname20(outputPath))) {
22907
22993
  mkdirSync20(dirname20(outputPath), { recursive: true });
22908
22994
  }
22909
22995
  const workDir = createStagingDir(dirname20(outputPath), `${basename8(outputPath)}.assemble-work-`);
@@ -22927,7 +23013,7 @@ async function assemble(planDir, chunkOutputs, audioPath, outputPath, options) {
22927
23013
  try {
22928
23014
  const videoSources = cfrEncoder ? [await reencodeCfr(ctx, chunkPaths, cfrEncoder)] : chunkPaths;
22929
23015
  const finalPath = join49(workDir, `output.${format}`);
22930
- const audio = audioPath !== null && existsSync33(audioPath) ? audioPath : null;
23016
+ const audio = audioPath !== null && existsSync32(audioPath) ? audioPath : null;
22931
23017
  await writeJoined(ctx, videoSources, audio, finalPath);
22932
23018
  renameWithRetry(finalPath, outputPath);
22933
23019
  log.info("[assemble] stage timings", {
@@ -22945,7 +23031,7 @@ async function assemble(planDir, chunkOutputs, audioPath, outputPath, options) {
22945
23031
  });
22946
23032
  }
22947
23033
  }
22948
- const fileSize = existsSync33(outputPath) ? statSync12(outputPath).size : 0;
23034
+ const fileSize = existsSync32(outputPath) ? statSync12(outputPath).size : 0;
22949
23035
  return {
22950
23036
  ...referenceBackgroundResult(plan2[REFERENCE_BACKGROUND_FIELD]),
22951
23037
  outputPath,
@@ -22957,13 +23043,13 @@ async function assemble(planDir, chunkOutputs, audioPath, outputPath, options) {
22957
23043
  function readAssemblePlan(planDir, chunkPaths) {
22958
23044
  const planJsonPath = join49(planDir, "plan.json");
22959
23045
  const chunksJsonPath = join49(planDir, "meta", "chunks.json");
22960
- if (!existsSync33(planJsonPath)) {
23046
+ if (!existsSync32(planJsonPath)) {
22961
23047
  throw new Error(`[assemble] planDir missing plan.json: ${planJsonPath}`);
22962
23048
  }
22963
23049
  const plan2 = JSON.parse(readFileSync15(planJsonPath, "utf-8"));
22964
23050
  readPlanProtocolV1(plan2, DISTRIBUTED_RENDER_CAPABILITIES.roles.assembler);
22965
23051
  validatePlanV2MaterializedTarget(planDir, { role: "assembler" });
22966
- if (!existsSync33(chunksJsonPath)) {
23052
+ if (!existsSync32(chunksJsonPath)) {
22967
23053
  throw new Error(`[assemble] planDir missing meta/chunks.json: ${chunksJsonPath}`);
22968
23054
  }
22969
23055
  const chunks = JSON.parse(readFileSync15(chunksJsonPath, "utf-8"));
@@ -22978,14 +23064,18 @@ function readAssemblePlan(planDir, chunkPaths) {
22978
23064
  }
22979
23065
  }
22980
23066
  for (const path of chunkPaths.flat()) {
22981
- if (!existsSync33(path)) {
23067
+ if (!existsSync32(path)) {
22982
23068
  throw new Error(`[assemble] chunk path does not exist: ${path}`);
22983
23069
  }
22984
23070
  }
22985
23071
  return plan2;
22986
23072
  }
22987
23073
  function videoInputArgs(ctx, videoSources) {
22988
- return videoSources.length === 1 ? ["-i", videoSources[0]] : concatDemuxerInput(videoSources, ctx.workDir, ctx.fpsArg);
23074
+ return videoSources.length === 1 ? [
23075
+ ...localContainerInputArgs(ctx.format === "webm" ? "matroska" : "mov"),
23076
+ "-i",
23077
+ videoSources[0]
23078
+ ] : ["-r", ctx.fpsArg, ...concatListInputArgs(writeVideoConcatList(ctx.workDir, videoSources))];
22989
23079
  }
22990
23080
  function cfrEncodeArgs(inputArgs, encoder, fpsArg) {
22991
23081
  const args = [
@@ -23039,8 +23129,9 @@ async function writeJoined(ctx, videoSources, audioPath, finalPath) {
23039
23129
  "audioMs",
23040
23130
  () => padOrTrimAudioToVideoFrameCount({
23041
23131
  videoPath: videoSources[0],
23042
- probeVideoFrameInfo: () => probeJoinedFrameInfo(videoSources, ctx.fps, ctx.signal),
23132
+ probeVideoFrameInfo: () => probeJoinedFrameInfo(videoSources, ctx),
23043
23133
  audioPath,
23134
+ audioContainer: "mov",
23044
23135
  outputPath: paddedAudioPath,
23045
23136
  signal: ctx.signal,
23046
23137
  timeoutMs: ctx.timeout
@@ -23063,6 +23154,7 @@ async function writeJoined(ctx, videoSources, audioPath, finalPath) {
23063
23154
  ctx.signal,
23064
23155
  {
23065
23156
  audioCodec: "aac",
23157
+ audioContainer: "mov",
23066
23158
  ffmpegProcessTimeout: ctx.timeout,
23067
23159
  videoInputArgs: videoInputArgs(ctx, videoSources)
23068
23160
  },
@@ -23073,21 +23165,16 @@ async function writeJoined(ctx, videoSources, audioPath, finalPath) {
23073
23165
  throw encoderFailureError("[assemble] audio mux failed", muxResult);
23074
23166
  }
23075
23167
  }
23076
- function concatDemuxerInput(chunkPaths, workDir, fpsArg) {
23077
- const listPath = join49(workDir, "concat-list.txt");
23078
- const body = chunkPaths.map((path) => `file '${path.replace(/'/g, "'\\''")}'`).join("\n");
23079
- writeFileSync14(listPath, `${body}
23080
- `, "utf-8");
23081
- return ["-r", fpsArg, ...concatListInputArgs(listPath)];
23082
- }
23083
- async function probeJoinedFrameInfo(videoPaths, fps, signal) {
23168
+ async function probeJoinedFrameInfo(videoPaths, ctx) {
23084
23169
  const infos = await Promise.all(
23085
- videoPaths.map((path) => defaultProbeVideoFrameInfo(path, signal))
23170
+ videoPaths.map(
23171
+ (path) => defaultProbeVideoFrameInfo(path, ctx.signal, ctx.format === "webm" ? "matroska" : "mov")
23172
+ )
23086
23173
  );
23087
23174
  return {
23088
23175
  frameCount: infos.reduce((sum2, info) => sum2 + info.frameCount, 0),
23089
- fpsNum: fps.num,
23090
- fpsDen: fps.den
23176
+ fpsNum: ctx.fps.num,
23177
+ fpsDen: ctx.fps.den
23091
23178
  };
23092
23179
  }
23093
23180
  async function runAssembleFfmpeg(args, step, signal, timeout) {
@@ -23117,7 +23204,7 @@ function planFormat(planDir) {
23117
23204
  }
23118
23205
  function lockedAudio(planDir) {
23119
23206
  const encoderJsonPath = join49(planDir, "meta", "encoder.json");
23120
- if (!existsSync33(encoderJsonPath)) return {};
23207
+ if (!existsSync32(encoderJsonPath)) return {};
23121
23208
  return JSON.parse(readFileSync15(encoderJsonPath, "utf-8"));
23122
23209
  }
23123
23210
  function readCfrEncoder(planDir, format) {
@@ -23127,7 +23214,7 @@ function readCfrEncoder(planDir, format) {
23127
23214
  );
23128
23215
  }
23129
23216
  const encoderJsonPath = join49(planDir, "meta", "encoder.json");
23130
- if (!existsSync33(encoderJsonPath)) {
23217
+ if (!existsSync32(encoderJsonPath)) {
23131
23218
  throw new Error(`[assemble] planDir missing meta/encoder.json: ${encoderJsonPath}`);
23132
23219
  }
23133
23220
  const encoderJson = JSON.parse(readFileSync15(encoderJsonPath, "utf-8"));
@@ -23139,7 +23226,7 @@ function readCfrEncoder(planDir, format) {
23139
23226
  return encoderJson;
23140
23227
  }
23141
23228
  function mergePngFrameDirs(chunkPaths, outputPath, totalFrames, audioPath, startTimeMs) {
23142
- if (existsSync33(outputPath)) rmSync18(outputPath, { recursive: true, force: true });
23229
+ if (existsSync32(outputPath)) rmSync18(outputPath, { recursive: true, force: true });
23143
23230
  mkdirSync20(outputPath, { recursive: true });
23144
23231
  let globalIdx = 0;
23145
23232
  for (const chunkDir of chunkPaths) {
@@ -23163,7 +23250,7 @@ function mergePngFrameDirs(chunkPaths, outputPath, totalFrames, audioPath, start
23163
23250
  `[assemble] png-sequence frame count mismatch: merged ${globalIdx} frames vs plan.totalFrames=${totalFrames}. Using on-disk count.`
23164
23251
  );
23165
23252
  }
23166
- if (audioPath !== null && existsSync33(audioPath)) {
23253
+ if (audioPath !== null && existsSync32(audioPath)) {
23167
23254
  const sidecar = join49(outputPath, MIXED_AUDIO_FILENAME);
23168
23255
  cpSync3(audioPath, sidecar);
23169
23256
  }
@@ -23215,7 +23302,7 @@ async function assembleV2(planV2Dir, chunkPaths, outputPath, options) {
23215
23302
  }
23216
23303
 
23217
23304
  // ../producer/src/services/distributed/projectHash.ts
23218
- import { closeSync as closeSync7, openSync as openSync7, readdirSync as readdirSync13, readSync as readSync5, realpathSync as realpathSync2, statSync as statSync13 } from "fs";
23305
+ import { closeSync as closeSync8, openSync as openSync8, readdirSync as readdirSync13, readSync as readSync5, realpathSync as realpathSync2, statSync as statSync13 } from "fs";
23219
23306
  import { createHash as createHash8 } from "crypto";
23220
23307
  import { join as join51, sep as sep7 } from "path";
23221
23308
  var READ_CHUNK_BYTES = 256 * 1024;
@@ -23225,7 +23312,7 @@ import { extname as extname7 } from "path";
23225
23312
  var AUDIO_SIDECAR_MIN_BYTES = 32 * 1024 * 1024;
23226
23313
 
23227
23314
  // ../producer/src/services/distributed/probeFacts.ts
23228
- import { writeFileSync as writeFileSync15 } from "fs";
23315
+ import { writeFileSync as writeFileSync13 } from "fs";
23229
23316
  import { extname as extname8 } from "path";
23230
23317
 
23231
23318
  export {