hyperframes 0.9.59 → 0.9.63

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 (332) hide show
  1. package/dist/{add-C7J7HSLI.js → add-OBIEVDD7.js} +26 -27
  2. package/dist/{agentPromptGenerator-GCLJUGVE.js → agentPromptGenerator-KOFDIQGE.js} +15 -17
  3. package/dist/{animatedGifPrep-JPQZPZC4.js → animatedGifPrep-C4S7AVG7.js} +20 -21
  4. package/dist/api.d.ts +8 -1
  5. package/dist/api.js +58 -58
  6. package/dist/{appHistory-TQ6JAEP5.js → appHistory-ASGUPUUV.js} +5 -6
  7. package/dist/{asset-HQEPGBDJ.js → asset-FUQDWJ62.js} +15 -5
  8. package/dist/{assetCataloger-LMPPKPF6.js → assetCataloger-A5N6O4JB.js} +16 -18
  9. package/dist/{audio-FD2EBZ6D.js → audio-AFNZLDGT.js} +45 -45
  10. package/dist/{auth-JA7XH6NG.js → auth-N2G7ERXF.js} +4 -4
  11. package/dist/{autoUpdate-WKW2OMIY.js → autoUpdate-ZGC4CJIP.js} +4 -4
  12. package/dist/{avatars-Q7U6CO4X.js → avatars-ALJTTP5M.js} +23 -25
  13. package/dist/{backgroundChecks-H2SOS2CM.js → backgroundChecks-3S6MXDFU.js} +5 -5
  14. package/dist/backgroundChecksWorker.js +5 -5
  15. package/dist/{batchRender-75OLVMZY.js → batchRender-HZIXQY4N.js} +7 -9
  16. package/dist/{beats-R4EHWWJN.js → beats-2XU7WVQU.js} +16 -18
  17. package/dist/{benchmark-F5OHG3Q3.js → benchmark-SBZQIKED.js} +27 -27
  18. package/dist/{billing-LBRSBVXQ.js → billing-2DFCEQSM.js} +21 -23
  19. package/dist/{browser-CNTCFZOG.js → browser-336OZKWA.js} +13 -15
  20. package/dist/{bundleWithLocalizedFonts-RVF7AFP5.js → bundleWithLocalizedFonts-DMW5VAFU.js} +1 -1
  21. package/dist/{capture-CTRZEZTC.js → capture-AD5PYZ2O.js} +10 -12
  22. package/dist/{capture-DLYM3V5F.js → capture-Z3LNLS32.js} +43 -41
  23. package/dist/{captureCompositionFrame-2O2HP6SK.js → captureCompositionFrame-2BVCI3V2.js} +22 -24
  24. package/dist/{captureFile-W7ZDDBCD.js → captureFile-Z7HQDRC2.js} +4 -5
  25. package/dist/{catalog-6XL63LU3.js → catalog-OKCKRILJ.js} +28 -30
  26. package/dist/{catch-up-AOFQWE6O.js → catch-up-MP2BCTZH.js} +15 -17
  27. package/dist/{check-5V7K4RL6.js → check-FYG4RBOV.js} +62 -63
  28. package/dist/{checkAudio-4YUTDQSQ.js → checkAudio-3RKJELTT.js} +18 -20
  29. package/dist/{checkBrowser-BAWRZZZU.js → checkBrowser-R3KY4UR5.js} +52 -53
  30. package/dist/{chunk-EGZQX3UX.js → chunk-2SPQTJA2.js} +24 -22
  31. package/dist/{chunk-2ARKMOCD.js → chunk-2XKRMQJP.js} +6 -6
  32. package/dist/{chunk-MHF5F4FF.js → chunk-3GF72UPC.js} +74 -15
  33. package/dist/chunk-3HJX4F2S.js +39 -0
  34. package/dist/{chunk-KYXH4JWF.js → chunk-3KKKIHBJ.js} +18 -17
  35. package/dist/{chunk-QC35TPEE.js → chunk-3O2FM72C.js} +6 -6
  36. package/dist/{chunk-WDMSNDHS.js → chunk-3SMQ3AKQ.js} +297 -115
  37. package/dist/{chunk-MVA4OQL7.js → chunk-4KEONZJ2.js} +1 -1
  38. package/dist/{chunk-O733DEVT.js → chunk-4ORH2OXS.js} +1 -1
  39. package/dist/{chunk-VPPKUCSP.js → chunk-4SDNEKTL.js} +2 -2
  40. package/dist/{chunk-AEXDJU77.js → chunk-4T45V6GF.js} +1 -1
  41. package/dist/{chunk-CIXP5G7Z.js → chunk-5GUYYSVT.js} +1 -1
  42. package/dist/{chunk-ZQIMO52O.js → chunk-5RCXJH5B.js} +59 -24
  43. package/dist/{chunk-TVWDS5AT.js → chunk-5T2LNQAH.js} +46 -18
  44. package/dist/{chunk-XZ6THYIK.js → chunk-5YY4SRBH.js} +5 -5
  45. package/dist/{chunk-5IE5ZI66.js → chunk-62UUXB3F.js} +1 -1
  46. package/dist/{chunk-5T6HPV25.js → chunk-63CSQYYO.js} +2 -2
  47. package/dist/{chunk-R4EWRIDL.js → chunk-6B2TH52B.js} +8 -1
  48. package/dist/{chunk-N6QWL3E7.js → chunk-6HHKHDMW.js} +2 -2
  49. package/dist/{chunk-Z2U7ELGP.js → chunk-6KU6TCSS.js} +2 -2
  50. package/dist/{chunk-PSREPOJ4.js → chunk-6PANJZEW.js} +18 -14
  51. package/dist/{chunk-YMKCJRVK.js → chunk-7AYDKU2X.js} +1 -1
  52. package/dist/{chunk-PMKWTXHE.js → chunk-7CSPYOLI.js} +2 -2
  53. package/dist/{chunk-KQHDFVFF.js → chunk-7F3NOYSK.js} +2 -2
  54. package/dist/{chunk-ZMLZRMG7.js → chunk-7NHID6VP.js} +2 -2
  55. package/dist/{chunk-BMTT2T7M.js → chunk-7NMH22SY.js} +5 -5
  56. package/dist/{chunk-RDWGNSVI.js → chunk-7YB4BDX7.js} +2 -2
  57. package/dist/{chunk-RAOGN2HG.js → chunk-A65Q5P62.js} +1 -1
  58. package/dist/{chunk-JQ7BPN2R.js → chunk-ABK44JS4.js} +3 -3
  59. package/dist/{chunk-DSCMYTKJ.js → chunk-AQFSYY23.js} +3 -3
  60. package/dist/{chunk-PLOCYJ5U.js → chunk-B5TLZC2D.js} +11 -4
  61. package/dist/{chunk-EUVU5JS4.js → chunk-BGIRYNAW.js} +38 -11
  62. package/dist/{chunk-URHIQHDR.js → chunk-BGV5YKSM.js} +14 -12
  63. package/dist/{chunk-QVHDAS3L.js → chunk-BJLC2UEQ.js} +4 -4
  64. package/dist/{chunk-QHVE6AFU.js → chunk-BJMW2GYO.js} +1 -1
  65. package/dist/{chunk-LSGJY2FG.js → chunk-CDPVVNNZ.js} +1 -1
  66. package/dist/{chunk-HXFGAI6L.js → chunk-CLRASDLH.js} +16 -16
  67. package/dist/{chunk-CAMD2NBN.js → chunk-CSMWC336.js} +2 -2
  68. package/dist/{chunk-WRSGWDDB.js → chunk-CZYQR7VM.js} +9 -9
  69. package/dist/chunk-D37I36FY.js +21 -0
  70. package/dist/{chunk-6LGB4MVX.js → chunk-DEWY2KX4.js} +1 -1
  71. package/dist/{chunk-OV5OSN74.js → chunk-DG4VSBM3.js} +3 -3
  72. package/dist/{chunk-L456Q4KU.js → chunk-DJCBHKQ5.js} +1 -1
  73. package/dist/{chunk-SGQKP2JT.js → chunk-DN4KUTQ5.js} +2 -2
  74. package/dist/{chunk-RHFB457E.js → chunk-DVUC244G.js} +3 -3
  75. package/dist/{chunk-7Q4EGB3N.js → chunk-E6WYYM6K.js} +1 -1
  76. package/dist/chunk-EJINQHA6.js +113 -0
  77. package/dist/{chunk-T5QI7ZL2.js → chunk-EPWGATQN.js} +5 -5
  78. package/dist/{chunk-VXRTE7MZ.js → chunk-ERYGKPIR.js} +1 -1
  79. package/dist/{chunk-HOIEN7O4.js → chunk-F6PI5O3H.js} +3 -1
  80. package/dist/{chunk-L4MXZHRB.js → chunk-FA6TQ22Y.js} +3 -3
  81. package/dist/{chunk-JLMMY3UI.js → chunk-FAYFXXVF.js} +2 -2
  82. package/dist/{chunk-JUUOYXWH.js → chunk-FEURVA3G.js} +2 -2
  83. package/dist/{chunk-PHYFZXOS.js → chunk-FLJ4S7NA.js} +2 -2
  84. package/dist/{chunk-LZWG4GCC.js → chunk-GGSE4SO2.js} +55 -125
  85. package/dist/chunk-GJPT5Q6H.js +112 -0
  86. package/dist/{chunk-C3NDLM4S.js → chunk-GPZIE45V.js} +2 -2
  87. package/dist/{chunk-6UAYOSE7.js → chunk-GRBYYKYT.js} +9 -9
  88. package/dist/{chunk-GYJ7AJXN.js → chunk-H4HYZUE3.js} +1 -1
  89. package/dist/{chunk-7YRZBB4C.js → chunk-H7FGALE4.js} +1 -1
  90. package/dist/{chunk-FQ26QE5N.js → chunk-HAFE7SZR.js} +1 -1
  91. package/dist/{chunk-TIZC4XKU.js → chunk-HAMPVCRY.js} +2 -2
  92. package/dist/{chunk-POFQOZOF.js → chunk-HF2A733B.js} +490 -224
  93. package/dist/{chunk-3DFEBAWJ.js → chunk-HGVBKNLQ.js} +2 -2
  94. package/dist/{chunk-4STRMCGD.js → chunk-HHM2JZLH.js} +4 -4
  95. package/dist/{chunk-PYRM3OAI.js → chunk-HJTCWQGF.js} +11 -13
  96. package/dist/{chunk-677JGYQL.js → chunk-HLVNKNSW.js} +1 -0
  97. package/dist/{chunk-SC7SX2I3.js → chunk-HMY3GUJN.js} +4 -4
  98. package/dist/{chunk-3RTZ2UX7.js → chunk-HS7YBLZS.js} +1 -1
  99. package/dist/{chunk-B653JKWT.js → chunk-HY6N5K6U.js} +4 -4
  100. package/dist/{chunk-WI3FM54X.js → chunk-HZMDLKRP.js} +3 -3
  101. package/dist/{chunk-6ATP7YPZ.js → chunk-IBU2BW4H.js} +9 -4
  102. package/dist/{chunk-I5H2FPNP.js → chunk-ICP22AQY.js} +1 -1
  103. package/dist/{chunk-ORKZUTZW.js → chunk-IOWECUEU.js} +1 -1
  104. package/dist/{chunk-RKIF4EU7.js → chunk-IS45C2EI.js} +14 -14
  105. package/dist/{chunk-SXCM6VY3.js → chunk-IU6AC3WL.js} +1 -1
  106. package/dist/{chunk-FGJUVWAM.js → chunk-J2MAI47E.js} +1 -1
  107. package/dist/{chunk-K33E3YNK.js → chunk-J43NNMIX.js} +10 -10
  108. package/dist/{chunk-FC77MYAD.js → chunk-J4YDHNAH.js} +1 -1
  109. package/dist/{chunk-QKHW5NXL.js → chunk-JDKLF3AG.js} +2 -2
  110. package/dist/{chunk-PCHUX7Y5.js → chunk-JU4ZWNU6.js} +2 -2
  111. package/dist/{chunk-2LJPBYKI.js → chunk-KDLMUU3E.js} +1 -1
  112. package/dist/{chunk-OPIS2YMA.js → chunk-KIWGMFXC.js} +6 -6
  113. package/dist/{chunk-ISSG4PUD.js → chunk-LGIWC6KN.js} +3 -3
  114. package/dist/{chunk-YXX6CIHL.js → chunk-LKHH4BUW.js} +12 -1
  115. package/dist/{chunk-PDT6CBK2.js → chunk-LNDOTF7B.js} +8 -3
  116. package/dist/{chunk-BTXYXM2A.js → chunk-LYGIKJBA.js} +17 -17
  117. package/dist/{chunk-K2WLOTTF.js → chunk-LYTELQL2.js} +2 -4
  118. package/dist/chunk-MCTQEI6H.js +170 -0
  119. package/dist/{chunk-XXJBWKDS.js → chunk-MHS3RUAQ.js} +17 -17
  120. package/dist/{chunk-H3TD4VKX.js → chunk-MJBBKSKB.js} +1 -1
  121. package/dist/{chunk-ODLSLYJR.js → chunk-MTCVUAUK.js} +2 -2
  122. package/dist/{chunk-FFL5R2EZ.js → chunk-N5EZRITN.js} +4 -4
  123. package/dist/{chunk-65X2G57W.js → chunk-NEZVFC34.js} +4 -4
  124. package/dist/{chunk-J4OHC5FU.js → chunk-NK2UW3WR.js} +1 -1
  125. package/dist/{chunk-763UG5II.js → chunk-OOVT26AC.js} +8 -8
  126. package/dist/{chunk-JT7RXK2N.js → chunk-OW6MOJSR.js} +1 -1
  127. package/dist/{chunk-4VJQVTQI.js → chunk-PAHTZDMZ.js} +1 -1
  128. package/dist/chunk-PET4B6IL.js +159 -0
  129. package/dist/{chunk-7XOORL2Q.js → chunk-PJ22RPTH.js} +10 -10
  130. package/dist/{chunk-I6OSAVHD.js → chunk-PLI7YT5S.js} +7 -11
  131. package/dist/{chunk-6VY52EVW.js → chunk-PQ2OPPGP.js} +7 -3
  132. package/dist/{chunk-KK5Z5XQ3.js → chunk-PTGNUVCB.js} +3 -0
  133. package/dist/{chunk-HTISHNLA.js → chunk-Q7IOMZ5X.js} +1 -1
  134. package/dist/{chunk-TNFTRLLJ.js → chunk-QOLZBRLN.js} +3 -3
  135. package/dist/{chunk-WQGDE3L6.js → chunk-QUYSLXNP.js} +1 -1
  136. package/dist/{chunk-6R4MEYWD.js → chunk-QY42NK3T.js} +2 -2
  137. package/dist/{chunk-CC72LTIT.js → chunk-R5HNUPI5.js} +259 -230
  138. package/dist/{chunk-QBN2W4T3.js → chunk-RC2DDVX5.js} +1 -1
  139. package/dist/{chunk-J3H6QDDY.js → chunk-RF3DT4CS.js} +1 -1
  140. package/dist/{chunk-3QMGLSKC.js → chunk-RHHPEUVM.js} +2 -2
  141. package/dist/{chunk-UBNJWS2H.js → chunk-RQ4YNYWE.js} +3 -3
  142. package/dist/{chunk-6EMFSRTW.js → chunk-S35RUNXJ.js} +7 -0
  143. package/dist/{chunk-XXOEYRD5.js → chunk-S4X7H76F.js} +2 -2
  144. package/dist/{chunk-VFGFXE6J.js → chunk-SDIQEPAR.js} +1 -1
  145. package/dist/{chunk-D44MBZI6.js → chunk-SFIUSS3O.js} +2 -2
  146. package/dist/{chunk-OF7SQ77J.js → chunk-SIQGTRZ5.js} +1 -1
  147. package/dist/{chunk-AQIHV4PM.js → chunk-SKQWXQ7H.js} +2 -2
  148. package/dist/{chunk-QJ2BV7FM.js → chunk-SOIOB7FF.js} +9 -9
  149. package/dist/{chunk-GMIFMRWR.js → chunk-T25ZHQR2.js} +6 -6
  150. package/dist/{chunk-6T4PB35F.js → chunk-TRQDC2UC.js} +9 -2
  151. package/dist/{chunk-HLOJSBGC.js → chunk-TTRX7NM3.js} +9 -9
  152. package/dist/chunk-TZ6M2LEV.js +5101 -0
  153. package/dist/{chunk-6K6RIX2A.js → chunk-U4KLJXI4.js} +21 -6
  154. package/dist/{chunk-7CI5MLCC.js → chunk-UOWDVL6M.js} +26 -11
  155. package/dist/{chunk-OYKAS3J5.js → chunk-V7Z2JQRL.js} +3 -3
  156. package/dist/{chunk-UNB2DFR2.js → chunk-VHDT4EME.js} +3 -3
  157. package/dist/{chunk-RX67N2PU.js → chunk-VM2VBJRC.js} +31 -2
  158. package/dist/{chunk-LTOUXR3X.js → chunk-VSCJ76AM.js} +73 -75
  159. package/dist/{chunk-WTZT6FSK.js → chunk-VSS3OAZB.js} +1 -1
  160. package/dist/{chunk-TJGGLLQJ.js → chunk-VWI7V4Q5.js} +35 -16
  161. package/dist/{chunk-SO7FT7YA.js → chunk-WMKIO4OA.js} +33 -32
  162. package/dist/{chunk-THGJTFYB.js → chunk-WTO3A7ET.js} +86 -6
  163. package/dist/{chunk-YBYNBKCN.js → chunk-WTS245RC.js} +2 -2
  164. package/dist/{chunk-ECGNWHFE.js → chunk-XBHPFWRL.js} +88 -2
  165. package/dist/{chunk-KGPHUBBA.js → chunk-XFGC5XLR.js} +1 -1
  166. package/dist/{chunk-R3ONQOLE.js → chunk-XGKNDIBT.js} +11 -11
  167. package/dist/{chunk-DCRHNRUY.js → chunk-XQQRCWS5.js} +5 -5
  168. package/dist/{chunk-XWV6BOCG.js → chunk-XQQZ2G25.js} +5 -5
  169. package/dist/{chunk-WKE3WTIU.js → chunk-YB2ZJJFJ.js} +1 -1
  170. package/dist/{chunk-ZIYYSD6S.js → chunk-YN6UGKZE.js} +79 -40
  171. package/dist/{chunk-TIBFCGLT.js → chunk-YSWORAKY.js} +1 -1
  172. package/dist/{chunk-HY7FPTBD.js → chunk-YWNQOM4P.js} +2 -2
  173. package/dist/{chunk-6LU6JICP.js → chunk-YWUE4CRU.js} +96 -9
  174. package/dist/chunk-Z3BPDCRV.js +537 -0
  175. package/dist/{chunk-HYXQR5I3.js → chunk-Z55ASKZE.js} +1 -1
  176. package/dist/{chunk-4QSDXDLV.js → chunk-ZM3GP62D.js} +3 -3
  177. package/dist/{chunk-ELDZ6C3R.js → chunk-ZYODIJRG.js} +7 -3
  178. package/dist/{clean-Z5REUSNY.js → clean-QXAUIYBP.js} +36 -37
  179. package/dist/cli.js +74 -75
  180. package/dist/{cloud-QP5R6B6A.js → cloud-46NGVK4Q.js} +8 -9
  181. package/dist/{cloud-NJ7G3NF3.js → cloud-7B4YZT5U.js} +4 -4
  182. package/dist/{cloudrun-CPAZLNTW.js → cloudrun-CZGDPM57.js} +19 -12
  183. package/dist/{compare-T5CHD25P.js → compare-O2UN7HGD.js} +70 -92
  184. package/dist/{compiler-QVDXN4OS.js → compiler-ZGIAIJVE.js} +7 -9
  185. package/dist/{component-QMZ46KTE.js → component-ZIGH3VGE.js} +8 -10
  186. package/dist/{compositions-JHYYNBAK.js → compositions-W54S4VIU.js} +21 -23
  187. package/dist/{contactSheet-7SPGUTDV.js → contactSheet-ROUVWDRO.js} +5 -6
  188. package/dist/{curve-ON6QQY7T.js → curve-HBHRWPIE.js} +20 -22
  189. package/dist/{cuts-K4FOVP4E.js → cuts-YHNO7A5G.js} +21 -23
  190. package/dist/{delete-6WFQ3FC2.js → delete-WIW3WLKA.js} +26 -15
  191. package/dist/{deploy-UAZQ5PBA.js → deploy-ICQ2PLU5.js} +12 -13
  192. package/dist/{describeProject-7W6BN5A2.js → describeProject-OCXNHB5X.js} +15 -17
  193. package/dist/{destroy-4B4OVPHJ.js → destroy-UBSVUXYW.js} +12 -13
  194. package/dist/{deterministicFonts-VLIVGXUQ.js → deterministicFonts-JER4GPCM.js} +4 -5
  195. package/dist/{diff-ZSA37QQS.js → diff-43OCC2Y3.js} +57 -54
  196. package/dist/{dist-ACT5C6ME.js → dist-6EF2P3P7.js} +4 -4
  197. package/dist/{dist-VRYZIJFZ.js → dist-A65PCIEN.js} +5 -8
  198. package/dist/{dist-2O52E7QZ.js → dist-DRHXUWGQ.js} +25 -21
  199. package/dist/{doctor-RXQ2Y2YY.js → doctor-XVOTWU62.js} +23 -25
  200. package/dist/{dotEnv-RZ52L7X3.js → dotEnv-MWWLCN66.js} +11 -3
  201. package/dist/{energy-DRA3DCRO.js → energy-SGA245NF.js} +21 -23
  202. package/dist/{events-4SNBQE3M.js → events-6HPYERWI.js} +23 -25
  203. package/dist/{events-GA3YM3WT.js → events-LIZCRDAT.js} +5 -5
  204. package/dist/{events-AJNF2C3H.js → events-MMXXYK5J.js} +10 -12
  205. package/dist/{execute-6LTZRWE4.js → execute-3346FOCY.js} +49 -46
  206. package/dist/{extract-XZQN654B.js → extract-VDV6EY5E.js} +21 -23
  207. package/dist/{face-RKUNVSN3.js → face-EGKO7HYX.js} +22 -24
  208. package/dist/{feedback-AL7NPPMZ.js → feedback-KEX6YIDA.js} +62 -38
  209. package/dist/{ffmpeg-BEL7EZBA.js → ffmpeg-OIAPERTW.js} +14 -16
  210. package/dist/{figma-IZ3NH2KZ.js → figma-KANAV6Q6.js} +3 -3
  211. package/dist/fontLocalizeCli.js +26 -27
  212. package/dist/{frames-AYE53CSZ.js → frames-XBQNOQBU.js} +23 -25
  213. package/dist/{generate-BZ4EVVQI.js → generate-P4E5UIEY.js} +37 -39
  214. package/dist/{get-2GG4NSOK.js → get-R2FJMNJK.js} +26 -15
  215. package/dist/{gpuPolicy-W2ZGBXNG.js → gpuPolicy-AISTDFL2.js} +14 -16
  216. package/dist/{grade-compare-65NWHVXK.js → grade-compare-CE4RUMFU.js} +50 -51
  217. package/dist/hangReport.js +2 -2
  218. package/dist/{heifImagePrep-MRQ4KKDF.js → heifImagePrep-UQUW2OVF.js} +21 -22
  219. package/dist/{help-TEQWNNPI.js → help-SK6PGYI2.js} +1 -1
  220. package/dist/{history-MVNPETRW.js → history-DM5H55WQ.js} +23 -25
  221. package/dist/hyperframe.manifest.json +1 -1
  222. package/dist/hyperframe.runtime.iife.js +67 -67
  223. package/dist/hyperframes-player.global.js +1 -1
  224. package/dist/{info-NGNTHWYX.js → info-UBGKJ5XD.js} +23 -25
  225. package/dist/{init-H7SUGVZX.js → init-SGBCTXCE.js} +41 -43
  226. package/dist/{ink-CPZ4YZFM.js → ink-NWXEZQPJ.js} +21 -23
  227. package/dist/{inspect-GZBQ7XN7.js → inspect-B7VENILS.js} +53 -54
  228. package/dist/{installer-ZTHYVK4L.js → installer-GR5X6HMD.js} +8 -10
  229. package/dist/{keyframes-B52LQUOI.js → keyframes-VZSC75GL.js} +77 -28
  230. package/dist/{lambda-SZDQJMKA.js → lambda-KCTB2LV5.js} +32 -26
  231. package/dist/{layout-BOUOG2D2.js → layout-3HSW3SNT.js} +53 -54
  232. package/dist/{lint-H4OWI5JN.js → lint-Q6NRDYLG.js} +18 -20
  233. package/dist/{lintProject-P4EAXFU2.js → lintProject-N3UN6HEE.js} +4 -4
  234. package/dist/{list-VNEYACGL.js → list-5TAZKTS2.js} +27 -16
  235. package/dist/{localPage-ZP7WVA2N.js → localPage-X22Z5SDE.js} +15 -17
  236. package/dist/{login-RUDOUO5Z.js → login-TIPDZQXX.js} +6 -6
  237. package/dist/{logout-5ZO6ZNS3.js → logout-KQ7VU5M6.js} +2 -2
  238. package/dist/{look-G3NVPKXZ.js → look-VODDQOS6.js} +21 -23
  239. package/dist/{manager-NXH2NJC6.js → manager-B5HWXCKJ.js} +16 -18
  240. package/dist/{manager-KWNID2ZA.js → manager-C5S25OOK.js} +5 -5
  241. package/dist/{measure-5PVIZ2W2.js → measure-EPD4JLR7.js} +11 -11
  242. package/dist/{media-treatment-T5QJI4PQ.js → media-treatment-ZLWCSYMP.js} +29 -29
  243. package/dist/{media-use-RTN3SMVY.js → media-use-HELWSEKT.js} +12 -8
  244. package/dist/{models-J2CJ7EVX.js → models-OKVD2GZS.js} +20 -22
  245. package/dist/{motionShot-HU7P26WJ.js → motionShot-6HJBMGBW.js} +28 -30
  246. package/dist/{normalize-44E7R6T5.js → normalize-TBACWMEK.js} +4 -5
  247. package/dist/{normalize-audio-2YFTP2T6.js → normalize-audio-PKUJQYZZ.js} +20 -21
  248. package/dist/{open-RSCNUV6E.js → open-ZOXZI6MJ.js} +26 -28
  249. package/dist/{parakeetRunner-BUY25EIR.js → parakeetRunner-I3TPZNMG.js} +24 -26
  250. package/dist/{pipeline-A4RL5R5P.js → pipeline-IGYBW7NA.js} +20 -20
  251. package/dist/{plan-7WYNPILA.js → plan-K2WUQRA2.js} +31 -33
  252. package/dist/{play-UKHFNMYZ.js → play-QRRL526W.js} +47 -45
  253. package/dist/{preflight-2VFCT3PI.js → preflight-KTYLNVCB.js} +17 -19
  254. package/dist/{present-ZUGFCQOF.js → present-EX2TKGXD.js} +39 -40
  255. package/dist/{preview-BT2ZFYMC.js → preview-FXMD27D6.js} +50 -50
  256. package/dist/privateProjectFile-TTLLYWGC.js +65 -0
  257. package/dist/{probe-2CLEK2UT.js → probe-2QG66GKK.js} +21 -23
  258. package/dist/{producer-HCAMS55D.js → producer-QH7A62IS.js} +1 -1
  259. package/dist/{progress-5A4N7PTR.js → progress-PT3NAFVP.js} +5 -6
  260. package/dist/{projectConfig-2KJ2PXIM.js → projectConfig-ZX2IUY45.js} +11 -13
  261. package/dist/{publication-AR63EGJF.js → publication-SKR5UXQK.js} +6 -8
  262. package/dist/{publish-EGKYOJWV.js → publish-X2PMT5TT.js} +63 -42
  263. package/dist/receivedRecordFollow-K7DVCCUS.js +54 -0
  264. package/dist/{refresh-GYRLZ7DZ.js → refresh-CYSJHATJ.js} +2 -2
  265. package/dist/{remove-background-IQQPMM24.js → remove-background-5FVNHD45.js} +21 -21
  266. package/dist/{render-ROJ5X53T.js → render-CJDV7E5M.js} +128 -87
  267. package/dist/{render-HJRMJYTA.js → render-GPXJCWM4.js} +12 -13
  268. package/dist/{render-YNSZYEEK.js → render-KAABP77Y.js} +141 -114
  269. package/dist/{render-batch-MXYDIHRO.js → render-batch-JYPH5RA7.js} +12 -13
  270. package/dist/renderSetupWorker.js +9 -9
  271. package/dist/{resolver-SPLAVF76.js → resolver-NXCI42VM.js} +8 -10
  272. package/dist/{reverse-CE6OGBB7.js → reverse-TQTVHTEN.js} +1 -1
  273. package/dist/{run-YVNJJL26.js → run-3O3N737Q.js} +11 -12
  274. package/dist/{sam-2D3BUTL7.js → sam-O7Y2CCK3.js} +4 -4
  275. package/dist/{screenshotCapture-DRO7VMNI.js → screenshotCapture-V6VXB4AZ.js} +17 -19
  276. package/dist/{service-K65JYG4O.js → service-HBLZ3T4R.js} +22 -24
  277. package/dist/{share-CSVWF6SB.js → share-QBLF3RGF.js} +26 -28
  278. package/dist/{sherpa-JE6AFUEV.js → sherpa-UZXWHCV4.js} +23 -25
  279. package/dist/sherpaWorker.js +6 -7
  280. package/dist/{sites-QCGTWVNF.js → sites-R5F5FNAL.js} +6 -6
  281. package/dist/skills/hyperframes/scripts/locate.mjs +13 -19
  282. package/dist/skills/media-use/audio/references/tts-to-captions.md +1 -1
  283. package/dist/skills/media-use/audio/references/tts.md +6 -6
  284. package/dist/skills/media-use/audio/scripts/lib/heygen.mjs +143 -2
  285. package/dist/skills/media-use/audio/scripts/lib/tts.mjs +12 -2
  286. package/dist/skills/media-use/scripts/lib/candidates.mjs +3 -2
  287. package/dist/skills/media-use/scripts/lib/terminal-text.d.mts +1 -0
  288. package/dist/skills/media-use/scripts/lib/terminal-text.mjs +12 -0
  289. package/dist/skills/media-use/scripts/resolve.mjs +21 -15
  290. package/dist/{skills-L3BXM7VJ.js → skills-HVIJD32X.js} +15 -17
  291. package/dist/{skillsUpdateCheck-VUENI5OR.js → skillsUpdateCheck-DD2NM36O.js} +5 -5
  292. package/dist/{snapshot-GI2GWIF6.js → snapshot-JKKROVMI.js} +97 -84
  293. package/dist/{src-ZXZO5RCJ.js → src-BBT6W66H.js} +29 -30
  294. package/dist/{src-B646B52O.js → src-IQKTGPPV.js} +17 -19
  295. package/dist/{start-ZNGKXRNE.js → start-A4KULXY2.js} +43 -37
  296. package/dist/{state-7CJBWHXJ.js → state-5LE7AN6F.js} +5 -6
  297. package/dist/{staticProjectServer-46T6YTPF.js → staticProjectServer-WH2SJFSD.js} +33 -34
  298. package/dist/{status-7SWTPLVI.js → status-ZL2XQWMR.js} +23 -25
  299. package/dist/studio/assets/{hyperframes-player-bya4hgms.js → hyperframes-player-CUQxAJaE.js} +1 -1
  300. package/dist/studio/assets/{index--dcfSUzI.js → index-D3rdYBVx.js} +1 -1
  301. package/dist/studio/assets/{index-Bxh5lW0C.js → index-DSrTQv-k.js} +204 -204
  302. package/dist/studio/assets/{pausedVideoDecoder-BKym1jA6.js → pausedVideoDecoder-BWllfjF-.js} +1 -1
  303. package/dist/studio/index.html +1 -1
  304. package/dist/{studio-api-4XKM5HDR.js → studio-api-FNZ62P67.js} +25 -21
  305. package/dist/{studioSelectionClient-S46TNAAZ.js → studioSelectionClient-PLBQBLCJ.js} +2 -2
  306. package/dist/{studioServer-4TWRIZNU.js → studioServer-BBVHB7A6.js} +260 -117
  307. package/dist/subCompositionWorker.js +60 -54
  308. package/dist/{sync-R3K6LYB3.js → sync-UW6N6ORX.js} +21 -23
  309. package/dist/{synthesize-OZ3SJTOF.js → synthesize-NGU4DRKC.js} +10 -9
  310. package/dist/{system-LZ4PMOJD.js → system-PKL4Y4MX.js} +3 -3
  311. package/dist/{telemetry-WSBY25O3.js → telemetry-OJ2XS46A.js} +10 -12
  312. package/dist/{templates-ITP6ISAF.js → templates-GH4ZOTLA.js} +24 -26
  313. package/dist/{timeline-U7GJMYKV.js → timeline-MABFMT2U.js} +36 -37
  314. package/dist/{tokens-3YTSUU27.js → tokens-XE3K3AJF.js} +15 -5
  315. package/dist/{transcribe-QHHY5M3G.js → transcribe-IRYGXKOQ.js} +44 -46
  316. package/dist/{transcribe-ISCBYWN4.js → transcribe-TV5THKEM.js} +20 -22
  317. package/dist/{tts-24IJXIT2.js → tts-HRWZJFLJ.js} +20 -4
  318. package/dist/{update-SVEH2GOL.js → update-BLVL5JMT.js} +17 -19
  319. package/dist/{updateCheck-MDG7N7VO.js → updateCheck-5QADMRBP.js} +4 -4
  320. package/dist/{upgrade-6CGAI4OR.js → upgrade-CBB7FP3D.js} +8 -9
  321. package/dist/{urlDownloader-VPQTIGEH.js → urlDownloader-ZJ423NLB.js} +13 -15
  322. package/dist/{validate-QUB4KCEQ.js → validate-PASIFGBU.js} +41 -42
  323. package/dist/{video-PUGZ5UHS.js → video-3MS2DCXZ.js} +17 -19
  324. package/dist/{voices-4UO5AYLS.js → voices-TXV5K5WI.js} +34 -36
  325. package/dist/warmCheck.js +62 -63
  326. package/dist/warmCheckClient.js +2 -2
  327. package/package.json +1 -1
  328. package/dist/chunk-6VY6WTY5.js +0 -279
  329. package/dist/chunk-NI7JVGOE.js +0 -5083
  330. package/dist/chunk-NLN5NY3P.js +0 -34
  331. package/dist/chunk-UVZIABYZ.js +0 -40
  332. package/dist/chunk-VC76R6W2.js +0 -27
@@ -4,11 +4,19 @@ import { dirname as __hf_dirname } from "node:path";
4
4
  var require = __hf_createRequire(import.meta.url);
5
5
  var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
+ import {
8
+ GENERIC_FAMILIES,
9
+ collectFontFamilyCustomProperties,
10
+ injectDeterministicFontFaces,
11
+ iterateFontFamilyDeclarations,
12
+ normalizeSystemFontPrimaryFamilies,
13
+ resolveFontFamilyDeclarationFamilies
14
+ } from "./chunk-HAMPVCRY.js";
7
15
  import {
8
16
  Semaphore,
9
17
  prepareHeifImageInputs,
10
18
  withMediaProbeSlot
11
- } from "./chunk-OV5OSN74.js";
19
+ } from "./chunk-DG4VSBM3.js";
12
20
  import {
13
21
  EncoderInterruptedError,
14
22
  encoderFailureError,
@@ -22,15 +30,10 @@ import {
22
30
  refusesOutsideLink,
23
31
  resolveRenderPaths,
24
32
  toExternalAssetKey
25
- } from "./chunk-PSREPOJ4.js";
33
+ } from "./chunk-6PANJZEW.js";
26
34
  import {
27
- GENERIC_FAMILIES,
28
- collectFontFamilyCustomProperties,
29
- injectDeterministicFontFaces,
30
- iterateFontFamilyDeclarations,
31
- normalizeSystemFontPrimaryFamilies,
32
- resolveFontFamilyDeclarationFamilies
33
- } from "./chunk-TIZC4XKU.js";
35
+ linksOutside
36
+ } from "./chunk-B5TLZC2D.js";
34
37
  import {
35
38
  createStudioPositionSeekReapplyScript,
36
39
  openRangeEnd,
@@ -208,7 +211,7 @@ import {
208
211
  withPublicOnlyProxy,
209
212
  writeCapturedFrame,
210
213
  writeUrlDownloadTelemetry
211
- } from "./chunk-CC72LTIT.js";
214
+ } from "./chunk-R5HNUPI5.js";
212
215
  import {
213
216
  settleOnBrowserSafePort
214
217
  } from "./chunk-PJQVJSMG.js";
@@ -218,11 +221,9 @@ import {
218
221
  crossfade
219
222
  } from "./chunk-3GXQPCJC.js";
220
223
  import {
221
- RENDER_TEMP_DIR
222
- } from "./chunk-HOIEN7O4.js";
223
- import {
224
- PREVIEW_FOR_ANOTHER_SITE_META
225
- } from "./chunk-YXX6CIHL.js";
224
+ PREVIEW_FOR_ANOTHER_SITE_META,
225
+ serviceWorkerScriptFetch
226
+ } from "./chunk-LKHH4BUW.js";
226
227
  import {
227
228
  assignBundledRuntimeCompositionIds,
228
229
  boundMediaSrc,
@@ -235,14 +236,17 @@ import {
235
236
  parsesAsScript,
236
237
  prepareFlattenedInnerRoot,
237
238
  stripSdrPngColourTags
238
- } from "./chunk-I6OSAVHD.js";
239
+ } from "./chunk-PLI7YT5S.js";
240
+ import {
241
+ RENDER_TEMP_DIR
242
+ } from "./chunk-F6PI5O3H.js";
239
243
  import {
240
244
  cannotHardLink,
241
245
  collectScratchLeftovers,
242
246
  createStagingDir,
243
247
  removeScratch,
244
248
  renameWithRetry
245
- } from "./chunk-K2WLOTTF.js";
249
+ } from "./chunk-LYTELQL2.js";
246
250
  import {
247
251
  DISTRIBUTED_FPS,
248
252
  HF_VFX_ATTR,
@@ -260,7 +264,7 @@ import {
260
264
  redactTelemetryString,
261
265
  resolveAuthoredTimingWindow,
262
266
  toFps
263
- } from "./chunk-QHVE6AFU.js";
267
+ } from "./chunk-BJMW2GYO.js";
264
268
  import {
265
269
  CAPTURE_CANVAS_SELECTOR,
266
270
  COMPOSITION_SOURCE_URL,
@@ -297,34 +301,33 @@ import {
297
301
  sourceTimeAt,
298
302
  styleElementsFor,
299
303
  timeAtSourceTime
300
- } from "./chunk-NI7JVGOE.js";
301
- import {
302
- isSafePath
303
- } from "./chunk-MHF5F4FF.js";
304
+ } from "./chunk-TZ6M2LEV.js";
304
305
  import {
306
+ isSafePath,
305
307
  terminalText
306
- } from "./chunk-UVZIABYZ.js";
308
+ } from "./chunk-3GF72UPC.js";
307
309
  import {
308
310
  chromeMajorCeiling
309
- } from "./chunk-6LU6JICP.js";
311
+ } from "./chunk-YWUE4CRU.js";
310
312
  import {
311
313
  resolveReferencedStart
312
- } from "./chunk-HLOJSBGC.js";
314
+ } from "./chunk-TTRX7NM3.js";
313
315
  import {
314
316
  isUnresolvedAssetPlaceholder,
315
317
  namesAnotherNetworkRoot,
318
+ projectAssetExists,
316
319
  readProjectFile,
317
320
  readTextFile,
318
321
  resolveCompositionSrc,
319
322
  resolveProjectRelativeSrc
320
- } from "./chunk-6EMFSRTW.js";
323
+ } from "./chunk-S35RUNXJ.js";
321
324
  import {
322
325
  LOW_MEMORY_TOTAL_MB_THRESHOLD,
323
326
  getCgroupMemoryLimitMb,
324
327
  getSystemTotalMb,
325
328
  hostCpuCount,
326
329
  usableCpuCount
327
- } from "./chunk-CIXP5G7Z.js";
330
+ } from "./chunk-5GUYYSVT.js";
328
331
  import {
329
332
  MEDIA_START_BASIS_ATTR,
330
333
  checkSubCompositionUsability,
@@ -369,7 +372,7 @@ import {
369
372
  import {
370
373
  isPrivateFileUnder,
371
374
  isStudioPrivatePath
372
- } from "./chunk-KK5Z5XQ3.js";
375
+ } from "./chunk-PTGNUVCB.js";
373
376
 
374
377
  // ../producer/src/services/renderOrchestrator.ts
375
378
  import {
@@ -377,7 +380,7 @@ import {
377
380
  mkdirSync as mkdirSync10,
378
381
  readdirSync as readdirSync6,
379
382
  rmSync as rmSync10,
380
- statSync as statSync7,
383
+ statSync as statSync8,
381
384
  writeFileSync as writeFileSync6,
382
385
  copyFileSync as copyFileSync3,
383
386
  appendFileSync
@@ -535,6 +538,10 @@ function stripPreloadNone(html) {
535
538
  return attr && attr.index < tagEnd ? [attr.index, attr.index + attr[0].length] : void 0;
536
539
  });
537
540
  }
541
+ function hasClosedMediaTag(text) {
542
+ const open2 = /<(?:video|audio)\b/i.exec(text);
543
+ return open2 !== null && text.includes(">", open2.index + open2[0].length);
544
+ }
538
545
  var REMOTE_SRC_TAGS = {
539
546
  media: { opener: "<(?:video|audio)\\b", attr: /\bsrc\s*=\s*["'](https?:\/\/)/gi },
540
547
  source: { opener: "<source\\b", attr: /\bsrc\s*=\s*["'](https?:\/\/)/gi },
@@ -1374,7 +1381,8 @@ function createFileServer(options) {
1374
1381
  compiledDir,
1375
1382
  port = 0,
1376
1383
  stripEmbeddedRuntime = true,
1377
- allowOutsideProjectAssets = false
1384
+ allowOutsideProjectAssets = false,
1385
+ includeOutsideScripts = false
1378
1386
  } = options;
1379
1387
  const preHeadScripts = [
1380
1388
  HF_EARLY_STUB,
@@ -1385,12 +1393,19 @@ function createFileServer(options) {
1385
1393
  const bodyScripts = options.bodyScripts ?? [buildRenderModeScript(options.fps), HF_BRIDGE_SCRIPT];
1386
1394
  const app = new Hono();
1387
1395
  const warnLeftOut = (line) => console.warn(`[FileServer] ${terminalText(line)}`);
1396
+ const outsidePolicy = { includeScripts: includeOutsideScripts };
1388
1397
  let listeningPort = -1;
1389
1398
  app.use(async function loadEachFileOnlyAsItsNamedType(c, next) {
1390
1399
  await next();
1391
1400
  c.res.headers.set("X-Content-Type-Options", "nosniff");
1392
1401
  });
1393
1402
  answerOwnLoopbackHostOnly(app, () => listeningPort);
1403
+ app.use(async function refuseServiceWorkerScripts(c, next) {
1404
+ const serviceWorker = c.req.header("service-worker");
1405
+ if (!serviceWorkerScriptFetch({ serviceWorker, fetchDest: c.req.header("sec-fetch-dest") }))
1406
+ return next();
1407
+ return c.text("Forbidden", 403);
1408
+ });
1394
1409
  app.get("/*", async (c) => {
1395
1410
  let requestPath = c.req.path;
1396
1411
  if (requestPath === "/") requestPath = "/index.html";
@@ -1402,7 +1417,7 @@ function createFileServer(options) {
1402
1417
  if (!isPathInside2(candidate, root, { resolveSymlinks })) continue;
1403
1418
  if (isPrivateFileUnder(root, candidate, isStudioPrivatePath)) continue;
1404
1419
  const checksLinks = allowOutsideProjectAssets && root !== compiledDir;
1405
- if (checksLinks && refusesOutsideLink(root, candidate, warnLeftOut)) continue;
1420
+ if (checksLinks && refusesOutsideLink(root, candidate, warnLeftOut, outsidePolicy)) continue;
1406
1421
  file = openRegularFile(candidate);
1407
1422
  if (file) break;
1408
1423
  }
@@ -2901,9 +2916,10 @@ function frameWeightedAvgMs(perfs, avgOf) {
2901
2916
  function aggregateDedup(perfs) {
2902
2917
  if (perfs.length === 0) return void 0;
2903
2918
  const armed = perfs.some((p) => p.staticDedupArmed);
2904
- const skipReasons = armed ? [] : [
2905
- ...new Set(perfs.map((p) => p.staticDedupSkipReason).filter((r) => !!r))
2906
- ].sort();
2919
+ const distinctUnarmed = (values) => {
2920
+ const distinct = armed ? [] : [...new Set(values.filter((v) => !!v))].sort();
2921
+ return distinct.length > 0 ? distinct.join("|") : void 0;
2922
+ };
2907
2923
  const verificationPerfs = perfs.filter((perf) => perf.staticDedupVerificationOutcome);
2908
2924
  const verificationOutcomes = [
2909
2925
  ...new Set(
@@ -2915,7 +2931,8 @@ function aggregateDedup(perfs) {
2915
2931
  armed,
2916
2932
  predictedFrames: perfs.reduce((sum2, p) => sum2 + (p.staticDedupPredicted ?? 0), 0),
2917
2933
  reusedFrames: perfs.reduce((sum2, p) => sum2 + (p.staticDedupReused ?? 0), 0),
2918
- skipReason: skipReasons.length > 0 ? skipReasons.join("|") : void 0,
2934
+ skipReason: distinctUnarmed(perfs.map((p) => p.staticDedupSkipReason)),
2935
+ ineligibleCause: distinctUnarmed(perfs.map((p) => p.staticDedupIneligibleCause)),
2919
2936
  ...verificationPerfs.length === 0 ? {} : {
2920
2937
  verifiedFrames: verificationPerfs.reduce(
2921
2938
  (sum2, perf) => sum2 + (perf.staticDedupVerified ?? 0),
@@ -6939,10 +6956,81 @@ function countAuthoredTimedClips(html) {
6939
6956
  return document2.querySelectorAll("[data-start]").length;
6940
6957
  }
6941
6958
 
6959
+ // ../producer/src/services/render/outputDimensions.ts
6960
+ function isExpectedOutputDimensions(value) {
6961
+ return typeof value === "object" && value !== null && "width" in value && "height" in value && typeof value.width === "number" && typeof value.height === "number" && Number.isSafeInteger(value.width) && Number.isSafeInteger(value.height) && value.width > 0 && value.height > 0;
6962
+ }
6963
+ var OutputDimensionsMismatchError = class extends Error {
6964
+ code = "OUTPUT_DIMENSIONS_MISMATCH";
6965
+ constructor() {
6966
+ super("Compiled output dimensions do not match the requested render dimensions.");
6967
+ }
6968
+ };
6969
+ function requireOutputDimensions(expected, width, height) {
6970
+ if (expected !== void 0 && (!isExpectedOutputDimensions(expected) || expected.width !== width || expected.height !== height)) {
6971
+ throw new OutputDimensionsMismatchError();
6972
+ }
6973
+ }
6974
+
6942
6975
  // ../producer/src/services/render/stages/compileStage.ts
6943
6976
  import { existsSync as existsSync11, writeFileSync as writeFileSync4 } from "fs";
6944
6977
  import { join as join17, relative as relative3 } from "path";
6945
6978
 
6979
+ // ../producer/src/services/compositionSizeLimit.ts
6980
+ import { statSync as statSync6 } from "fs";
6981
+ var MAX_COMPOSITION_HTML_BYTES = 16 * 1024 * 1024;
6982
+ var COMPOSITION_TOO_LARGE = "COMPOSITION_TOO_LARGE";
6983
+ var megabytes = (bytes) => `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
6984
+ var MAX_EXPANDED_COMPOSITION_BYTES = 2 * MAX_COMPOSITION_HTML_BYTES;
6985
+ var MAX_COMPOSITION_MOUNTS = 1e4;
6986
+ var CompositionTooLargeError = class extends Error {
6987
+ constructor(message, publicMetadata) {
6988
+ super(message);
6989
+ this.publicMetadata = publicMetadata;
6990
+ this.name = "CompositionTooLargeError";
6991
+ }
6992
+ publicMetadata;
6993
+ code = COMPOSITION_TOO_LARGE;
6994
+ // The producer server reads these off the error for the wire envelope.
6995
+ owner = "user";
6996
+ retryable = false;
6997
+ };
6998
+ var fileTooLarge = (file, bytes) => new CompositionTooLargeError(
6999
+ `Composition file "${file}" is ${megabytes(bytes)}, over the ${megabytes(MAX_COMPOSITION_HTML_BYTES)} limit for one composition HTML file. Keep large data such as images, fonts and JSON in separate asset files and reference them by path instead of inlining them.`,
7000
+ { bytes, limitBytes: MAX_COMPOSITION_HTML_BYTES }
7001
+ );
7002
+ var CompositionExpansionBudget = class {
7003
+ bytes = 0;
7004
+ mounts = 0;
7005
+ charge(file, bytes) {
7006
+ this.bytes += bytes;
7007
+ this.mounts += 1;
7008
+ if (this.bytes <= MAX_EXPANDED_COMPOSITION_BYTES && this.mounts <= MAX_COMPOSITION_MOUNTS) {
7009
+ return;
7010
+ }
7011
+ throw new CompositionTooLargeError(
7012
+ `Sub-composition mounts, ending at "${file}", add up to ${megabytes(this.bytes)} across ${this.mounts} mounts. One render inlines at most ${megabytes(MAX_EXPANDED_COMPOSITION_BYTES)} of composition HTML in at most ${MAX_COMPOSITION_MOUNTS} mounts. Mount large or repeated scenes fewer times.`,
7013
+ {
7014
+ bytes: this.bytes,
7015
+ limitBytes: MAX_EXPANDED_COMPOSITION_BYTES,
7016
+ mounts: this.mounts,
7017
+ exceeded: this.mounts > MAX_COMPOSITION_MOUNTS ? "mounts" : "bytes"
7018
+ }
7019
+ );
7020
+ }
7021
+ };
7022
+ function assertCompositionFileSize(path, file) {
7023
+ let bytes;
7024
+ try {
7025
+ const stats = statSync6(path);
7026
+ if (!stats.isFile()) return;
7027
+ bytes = stats.size;
7028
+ } catch {
7029
+ return;
7030
+ }
7031
+ if (bytes > MAX_COMPOSITION_HTML_BYTES) throw fileTooLarge(file, bytes);
7032
+ }
7033
+
6946
7034
  // ../producer/src/services/htmlCompiler.ts
6947
7035
  import { createHash as createHash4 } from "crypto";
6948
7036
  import { createReadStream as createReadStream2, existsSync as existsSync10, mkdirSync as mkdirSync7, readFileSync as readFileSync6 } from "fs";
@@ -7295,7 +7383,7 @@ Check that each file referenced by data-composition-src contains valid HTML with
7295
7383
  };
7296
7384
  function normalizeCompositionSrcs(html, projectDir) {
7297
7385
  return html.replace(/(\bdata-composition-src=)(["'])([^"']*)\2/g, (whole, name, quote, value) => {
7298
- if (!value.includes("%") && !value.startsWith("/")) return whole;
7386
+ if (!value.includes("%") && !/^\.?[\\/]/.test(value)) return whole;
7299
7387
  const file = resolveCompositionSrc(projectDir, value);
7300
7388
  if (file === null) return whole;
7301
7389
  return `${name}${quote}${relative2(projectDir, file).split(sep2).join("/")}${quote}`;
@@ -7311,68 +7399,94 @@ function resolveCompositionFile(projectDir, src, assetRoot) {
7311
7399
  const file = resolveCompositionPath(projectDir, src, assetRoot);
7312
7400
  return file !== null && COMPOSITION_FILE.test(file) ? file : null;
7313
7401
  }
7402
+ var OUTSIDE_COMPOSITION_NEEDS_FLAG = "it is outside the project, and any scripts in it would run; move it into the project, or pass --include-outside-files to hyperframes render, to include it";
7403
+ var runsOutsideMarkupUnasked = (projectDir, filePath, assetRoot, outsideFiles) => assetRoot === void 0 && !outsideFiles.includeScripts && linksOutside(projectDir, filePath);
7404
+ function assertOutsideMarkupAsked(projectDir, filePath, srcPath, assetRoot, outsideFiles) {
7405
+ if (runsOutsideMarkupUnasked(projectDir, filePath, assetRoot, outsideFiles)) {
7406
+ throw new EmptyCompositionError([{ srcPath, detail: OUTSIDE_COMPOSITION_NEEDS_FLAG }]);
7407
+ }
7408
+ }
7314
7409
  var isPrivateCompositionFile = (projectDir, filePath) => isPrivateFileUnder(projectDir, filePath, isStudioPrivatePath);
7315
- function assertSubCompositionsUsable(html, projectDir, assetRoot, visited = /* @__PURE__ */ new Set()) {
7410
+ var mountSrcsUnder = (root) => [...root.querySelectorAll("[data-composition-src]")].map((el) => el.getAttribute("data-composition-src")).filter((srcPath) => !!srcPath && !isUnresolvedAssetPlaceholder(srcPath));
7411
+ function compositionSrcsIn(html) {
7316
7412
  const { document: document2 } = parseHTML(html);
7317
- const hosts = [...document2.querySelectorAll("[data-composition-src]")];
7318
- const problems = [];
7319
- for (const el of hosts) {
7320
- const srcPath = el.getAttribute("data-composition-src");
7321
- if (!srcPath) continue;
7322
- if (isUnresolvedAssetPlaceholder(srcPath)) continue;
7413
+ const templated = [];
7414
+ const templates = [...document2.querySelectorAll("template")];
7415
+ for (let template = templates.pop(); template; template = templates.pop()) {
7416
+ templated.push(...mountSrcsUnder(template.content));
7417
+ templates.push(...template.content.querySelectorAll("template"));
7418
+ }
7419
+ return { mounts: mountSrcsUnder(document2), templated };
7420
+ }
7421
+ function compositionPathProblem(projectDir, filePath, assetRoot, outsideFiles) {
7422
+ if (outsideAssetRefusal(projectDir, filePath) === "blocklisted") {
7423
+ return "it is outside the project in a private location";
7424
+ }
7425
+ if (runsOutsideMarkupUnasked(projectDir, filePath, assetRoot, outsideFiles)) {
7426
+ return OUTSIDE_COMPOSITION_NEEDS_FLAG;
7427
+ }
7428
+ if (isPrivateCompositionFile(projectDir, filePath)) {
7429
+ return "it is git metadata, an env file or a private tool record";
7430
+ }
7431
+ return COMPOSITION_FILE.test(filePath) ? null : NOT_A_COMPOSITION_FILE;
7432
+ }
7433
+ function readSubCompositionFile(filePath, srcPath) {
7434
+ assertCompositionFileSize(filePath, srcPath);
7435
+ const read = readProjectFile(filePath);
7436
+ if (read.kind === "missing") return { detail: "the file does not exist" };
7437
+ if (read.kind === "folder") return { detail: "it is a folder, not an HTML file" };
7438
+ const validity = checkSubCompositionUsability(read.text, parseSubCompHtmlForValidity);
7439
+ if (!validity.ok)
7440
+ return { detail: validity.detail ?? "the file is empty or could not be parsed" };
7441
+ return { bytes: Buffer.byteLength(read.text), ...compositionSrcsIn(read.text) };
7442
+ }
7443
+ function assertSubCompositionsUsable(html, projectDir, assetRoot, outsideFiles) {
7444
+ const budget = new CompositionExpansionBudget();
7445
+ const files = /* @__PURE__ */ new Map();
7446
+ const problems = /* @__PURE__ */ new Map();
7447
+ const report = (srcPath, detail) => problems.set(`${srcPath}\0${detail}`, { srcPath, detail });
7448
+ const chain = /* @__PURE__ */ new Set();
7449
+ const paths = /* @__PURE__ */ new Map();
7450
+ const resolveMount = (srcPath) => {
7323
7451
  const filePath = resolveCompositionPath(projectDir, srcPath, assetRoot);
7324
- if (filePath === null) {
7325
- problems.push({ srcPath, detail: "it is outside the project folder" });
7326
- continue;
7327
- }
7328
- if (outsideAssetRefusal(projectDir, filePath) === "blocklisted") {
7329
- problems.push({ srcPath, detail: "it is outside the project in a private location" });
7330
- continue;
7331
- }
7332
- if (isPrivateCompositionFile(projectDir, filePath)) {
7333
- problems.push({
7334
- srcPath,
7335
- detail: "it is git metadata, an env file or a private tool record"
7336
- });
7337
- continue;
7338
- }
7339
- if (!COMPOSITION_FILE.test(filePath)) {
7340
- problems.push({ srcPath, detail: NOT_A_COMPOSITION_FILE });
7341
- continue;
7342
- }
7343
- if (visited.has(filePath)) continue;
7344
- const read = readProjectFile(filePath);
7345
- if (read.kind === "missing") {
7346
- problems.push({ srcPath, detail: "the file does not exist" });
7347
- continue;
7348
- }
7349
- if (read.kind === "folder") {
7350
- problems.push({ srcPath, detail: "it is a folder, not an HTML file" });
7351
- continue;
7352
- }
7353
- const fileHtml = read.text;
7354
- const validity = checkSubCompositionUsability(fileHtml, parseSubCompHtmlForValidity);
7355
- if (!validity.ok) {
7356
- problems.push({
7357
- srcPath,
7358
- detail: validity.detail ?? "the file is empty or could not be parsed"
7359
- });
7360
- continue;
7361
- }
7362
- const nestedVisited = new Set(visited);
7363
- nestedVisited.add(filePath);
7364
- try {
7365
- assertSubCompositionsUsable(fileHtml, projectDir, assetRoot, nestedVisited);
7366
- } catch (err) {
7367
- if (err instanceof EmptyCompositionError) {
7368
- problems.push(...err.problems);
7369
- } else {
7370
- throw err;
7452
+ if (filePath === null) return { detail: "it is outside the project folder" };
7453
+ const detail = compositionPathProblem(projectDir, filePath, assetRoot, outsideFiles);
7454
+ return detail ? { detail } : { filePath };
7455
+ };
7456
+ const walk = (srcPaths, quiet) => {
7457
+ for (const srcPath of srcPaths) {
7458
+ let resolved = paths.get(srcPath);
7459
+ if (!resolved) {
7460
+ resolved = resolveMount(srcPath);
7461
+ paths.set(srcPath, resolved);
7462
+ }
7463
+ if ("detail" in resolved) {
7464
+ if (!quiet) report(srcPath, resolved.detail);
7465
+ continue;
7466
+ }
7467
+ const { filePath } = resolved;
7468
+ if (chain.has(filePath)) continue;
7469
+ let file = files.get(filePath);
7470
+ if (!file) {
7471
+ file = readSubCompositionFile(filePath, srcPath);
7472
+ files.set(filePath, file);
7473
+ }
7474
+ if ("detail" in file) {
7475
+ if (!quiet) report(srcPath, file.detail);
7476
+ continue;
7371
7477
  }
7478
+ budget.charge(srcPath, file.bytes);
7479
+ chain.add(filePath);
7480
+ walk(file.mounts, quiet);
7481
+ walk(file.templated, true);
7482
+ chain.delete(filePath);
7372
7483
  }
7373
- }
7374
- if (problems.length > 0) {
7375
- throw new EmptyCompositionError(problems);
7484
+ };
7485
+ const entry = compositionSrcsIn(html);
7486
+ walk(entry.mounts, false);
7487
+ walk(entry.templated, true);
7488
+ if (problems.size > 0) {
7489
+ throw new EmptyCompositionError([...problems.values()]);
7376
7490
  }
7377
7491
  }
7378
7492
  var COMPILER_MOUNT_BLOCK_START = "/* __HF_COMPILER_MOUNT_START__ */";
@@ -7627,7 +7741,7 @@ async function compileHtmlFile(html, projectDir, baseDir, downloadDir, log, urlB
7627
7741
  compiledHtml = stripCrossoriginAttr(compiledHtml, "audio");
7628
7742
  return { html: compiledHtml, unresolvedCompositions };
7629
7743
  }
7630
- async function parseSubCompositions(html, projectDir, downloadDir, visited = /* @__PURE__ */ new Set(), urlByAbsentLocalPath, probes, assetRoot) {
7744
+ async function parseSubCompositions(html, projectDir, downloadDir, visited = /* @__PURE__ */ new Set(), urlByAbsentLocalPath, probes, assetRoot, outsideFiles = {}, compiledSrcs = /* @__PURE__ */ new Set()) {
7631
7745
  const subCompositions = /* @__PURE__ */ new Map();
7632
7746
  const { document: document2 } = parseHTML(html);
7633
7747
  const compEls = document2.querySelectorAll("[data-composition-src]");
@@ -7640,6 +7754,10 @@ async function parseSubCompositions(html, projectDir, downloadDir, visited = /*
7640
7754
  if (visited.has(filePath)) {
7641
7755
  continue;
7642
7756
  }
7757
+ if (compiledSrcs.has(srcPath)) continue;
7758
+ compiledSrcs.add(srcPath);
7759
+ assertOutsideMarkupAsked(projectDir, filePath, srcPath, assetRoot, outsideFiles);
7760
+ assertCompositionFileSize(filePath, srcPath);
7643
7761
  const read = readProjectFile(filePath);
7644
7762
  if (read.kind !== "file") {
7645
7763
  continue;
@@ -7668,7 +7786,9 @@ async function parseSubCompositions(html, projectDir, downloadDir, visited = /*
7668
7786
  item.nestedVisited,
7669
7787
  urlByAbsentLocalPath,
7670
7788
  probes,
7671
- assetRoot
7789
+ assetRoot,
7790
+ outsideFiles,
7791
+ compiledSrcs
7672
7792
  );
7673
7793
  return {
7674
7794
  srcPath: item.srcPath,
@@ -7804,7 +7924,7 @@ function coalesceHeadStylesAndBodyScripts(html) {
7804
7924
  }
7805
7925
  return document2.toString();
7806
7926
  }
7807
- function inlineSubCompositions2(html, subCompositions, projectDir, variableOverrides, assetRoot) {
7927
+ function inlineSubCompositions2(html, subCompositions, projectDir, variableOverrides, assetRoot, outsideFiles) {
7808
7928
  const { document: document2 } = parseHTML(html);
7809
7929
  const head = document2.querySelector("head");
7810
7930
  const body = document2.querySelector("body");
@@ -7817,6 +7937,27 @@ function inlineSubCompositions2(html, subCompositions, projectDir, variableOverr
7817
7937
  );
7818
7938
  return { html: emitted ? document2.toString() : html, variablesByComp: {} };
7819
7939
  }
7940
+ const budget = new CompositionExpansionBudget();
7941
+ const readOnce = /* @__PURE__ */ new Map();
7942
+ const readMountHtml = (srcPath) => {
7943
+ const filePath = resolveCompositionFile(projectDir, srcPath, assetRoot);
7944
+ if (filePath) {
7945
+ assertOutsideMarkupAsked(projectDir, filePath, srcPath, assetRoot, outsideFiles);
7946
+ assertCompositionFileSize(filePath, srcPath);
7947
+ }
7948
+ const read = filePath && !isPrivateCompositionFile(projectDir, filePath) ? readProjectFile(filePath) : null;
7949
+ return read?.kind === "file" ? rewriteUnresolvableGsapToCdn(
7950
+ normalizeCompositionSrcs(read.text, projectDir),
7951
+ projectDir,
7952
+ srcPath
7953
+ ) : null;
7954
+ };
7955
+ const resolveMountHtml = (srcPath) => {
7956
+ const compiled = subCompositions.get(srcPath);
7957
+ if (compiled) return compiled;
7958
+ if (!readOnce.has(srcPath)) readOnce.set(srcPath, readMountHtml(srcPath));
7959
+ return readOnce.get(srcPath) ?? null;
7960
+ };
7820
7961
  const hostIdentityByElement = new ProducerHostIdentityMap(
7821
7962
  document2,
7822
7963
  hosts
@@ -7832,20 +7973,14 @@ function inlineSubCompositions2(html, subCompositions, projectDir, variableOverr
7832
7973
  readVariableDefaults: readDeclaredDefaults,
7833
7974
  parseHostVariables: parseHostVariableValues,
7834
7975
  resolveHtml: (srcPath) => {
7835
- let compHtml = subCompositions.get(srcPath) || null;
7836
- if (!compHtml) {
7837
- const filePath = resolveCompositionFile(projectDir, srcPath, assetRoot);
7838
- const read = filePath && !isPrivateCompositionFile(projectDir, filePath) ? readProjectFile(filePath) : null;
7839
- if (read?.kind === "file") {
7840
- compHtml = rewriteUnresolvableGsapToCdn(read.text, projectDir, srcPath);
7841
- }
7842
- }
7976
+ const compHtml = resolveMountHtml(srcPath);
7977
+ if (compHtml) budget.charge(srcPath, Buffer.byteLength(compHtml));
7843
7978
  return compHtml;
7844
7979
  },
7845
7980
  parseHtml: (htmlStr) => parseHTML(htmlStr).document,
7846
7981
  // Mirrors the preview bundler: a sub-composition's SIBLING assets resolve
7847
7982
  // against its own directory, project-root refs stay as authored.
7848
- assetExists: (path) => existsSync10(resolve5(projectDir, path)),
7983
+ assetExists: projectAssetExists(projectDir),
7849
7984
  // Preserve the authored root wrapper as a child of the host, matching
7850
7985
  // the preview bundler's shape (htmlBundler.ts's prepareFlattenedInnerRoot,
7851
7986
  // which the runtime compositionLoader mirrors with its own copy for the
@@ -8050,7 +8185,7 @@ ${safeText}
8050
8185
  }
8051
8186
  return wrappedFragment ? document2.body.innerHTML || "" : document2.toString();
8052
8187
  }
8053
- function collectExternalAssets(html, projectDir, log = defaultLogger, file = "index.html") {
8188
+ function collectExternalAssets(html, projectDir, log = defaultLogger, file = "index.html", policy = {}) {
8054
8189
  const absProjectDir = resolve5(projectDir);
8055
8190
  const externalAssets = /* @__PURE__ */ new Map();
8056
8191
  const leftOut = /* @__PURE__ */ new Set();
@@ -8063,7 +8198,7 @@ function collectExternalAssets(html, projectDir, log = defaultLogger, file = "in
8063
8198
  }
8064
8199
  const onShare = namesAnotherNetworkRoot(absProjectDir, absPath);
8065
8200
  if (!onShare && !existsSync10(absPath)) return null;
8066
- const refusal = onShare ? "network_share" : outsideAssetRefusal(absProjectDir, absPath);
8201
+ const refusal = onShare ? "network_share" : outsideAssetRefusal(absProjectDir, absPath, policy);
8067
8202
  if (refusal) {
8068
8203
  if (!leftOut.has(trimmed)) log.warn(`[Compiler] ${leftOutOfRender(file, trimmed, refusal)}`);
8069
8204
  leftOut.add(trimmed);
@@ -8370,7 +8505,7 @@ async function readLocalFont(absPath) {
8370
8505
  return { kind: "inline", buffer: Buffer.concat(chunks, totalBytes) };
8371
8506
  }
8372
8507
  async function embedLocalFontFaces(html, projectDir, assetRoot, log = defaultLogger) {
8373
- const { fontToDataUri: toDataUri } = await import("./deterministicFonts-VLIVGXUQ.js");
8508
+ const { fontToDataUri: toDataUri } = await import("./deterministicFonts-JER4GPCM.js");
8374
8509
  let result = html;
8375
8510
  const embeddedPaths = /* @__PURE__ */ new Set();
8376
8511
  const dataUriByAbsolutePath = /* @__PURE__ */ new Map();
@@ -8452,7 +8587,7 @@ function rebaseDirectEntryAssetPaths(html, projectDir, htmlPath) {
8452
8587
  const entryPath = relative2(projectDir, htmlPath).replace(/\\/g, "/");
8453
8588
  if (!entryPath.includes("/")) return html;
8454
8589
  const { document: document2 } = parseHTML(html);
8455
- const assetExists = (path) => existsSync10(resolve5(projectDir, path));
8590
+ const assetExists = projectAssetExists(projectDir);
8456
8591
  rewriteAssetPaths(
8457
8592
  document2.querySelectorAll("[src], [href], [srcset]"),
8458
8593
  entryPath,
@@ -8493,18 +8628,23 @@ function bindVariableMediaSources(html, variables) {
8493
8628
  var entryFileName = (projectDir, htmlPath) => isPathInside(htmlPath, projectDir) ? relative2(projectDir, htmlPath).split(sep2).join("/") : basename4(htmlPath);
8494
8629
  async function compileForRender(projectDir, htmlPath, downloadDir, options = {}) {
8495
8630
  const assetRoot = options.allowOutsideProjectAssets ? void 0 : projectDir;
8631
+ const outsideFiles = { includeScripts: options.includeOutsideScripts };
8496
8632
  if (isPathInside(htmlPath, projectDir) && escapesAssetRoot(htmlPath, assetRoot)) {
8497
8633
  throw new Error(`Entry file ${htmlPath} leads outside the project folder`);
8498
8634
  }
8635
+ if (isPathInside(htmlPath, projectDir) && runsOutsideMarkupUnasked(projectDir, htmlPath, assetRoot, outsideFiles)) {
8636
+ throw new Error(`Entry file ${htmlPath} ${OUTSIDE_COMPOSITION_NEEDS_FLAG}`);
8637
+ }
8499
8638
  if (!COMPOSITION_FILE.test(htmlPath)) {
8500
8639
  throw new Error(`Entry file ${htmlPath} is not an .html file, so it is refused`);
8501
8640
  }
8641
+ assertCompositionFileSize(htmlPath, basename4(htmlPath));
8502
8642
  const entryHtml = rebaseDirectEntryAssetPaths(readTextFile(htmlPath), projectDir, htmlPath);
8503
8643
  const rawHtml = bindVariableMediaSources(
8504
8644
  normalizeCompositionSrcs(rewriteUnresolvableGsapToCdn(entryHtml, projectDir), projectDir),
8505
8645
  options.variables ?? {}
8506
8646
  );
8507
- assertSubCompositionsUsable(rawHtml, projectDir, assetRoot);
8647
+ assertSubCompositionsUsable(rawHtml, projectDir, assetRoot, outsideFiles);
8508
8648
  const probes = /* @__PURE__ */ new Map();
8509
8649
  const { html: compiledHtml, unresolvedCompositions } = await compileHtmlFile(
8510
8650
  rawHtml,
@@ -8523,7 +8663,8 @@ async function compileForRender(projectDir, htmlPath, downloadDir, options = {})
8523
8663
  void 0,
8524
8664
  options.urlByAbsentLocalPath,
8525
8665
  probes,
8526
- assetRoot
8666
+ assetRoot,
8667
+ outsideFiles
8527
8668
  );
8528
8669
  const fullHtml = ensureFullDocument(compiledHtml);
8529
8670
  const { html: inlinedHtml, variablesByComp } = inlineSubCompositions2(
@@ -8531,7 +8672,8 @@ async function compileForRender(projectDir, htmlPath, downloadDir, options = {})
8531
8672
  subCompositions,
8532
8673
  projectDir,
8533
8674
  options.variables ?? {},
8534
- assetRoot
8675
+ assetRoot,
8676
+ outsideFiles
8535
8677
  );
8536
8678
  const sanitizedHtml = stripPreloadNone(inlinedHtml);
8537
8679
  const renderModeHints = detectRenderModeHints(sanitizedHtml, options.pageMotionBlur);
@@ -8585,7 +8727,7 @@ async function compileForRender(projectDir, htmlPath, downloadDir, options = {})
8585
8727
  cacheDir: options.animatedGifCacheDir,
8586
8728
  sourceAssets: remoteImageAssets,
8587
8729
  timeoutMs: options.ffmpegProcessTimeout,
8588
- assetRoot
8730
+ allowOutsideFiles: assetRoot === void 0
8589
8731
  });
8590
8732
  if (preparedHeifImages.length > 0) {
8591
8733
  defaultLogger.debug(`[Compiler] Converted ${preparedHeifImages.length} HEIC image(s) to JPEG`);
@@ -8601,7 +8743,7 @@ async function compileForRender(projectDir, htmlPath, downloadDir, options = {})
8601
8743
  cacheDir: options.animatedGifCacheDir,
8602
8744
  sourceAssets: gifSourceAssets,
8603
8745
  timeoutMs: options.ffmpegProcessTimeout,
8604
- assetRoot
8746
+ allowOutsideFiles: assetRoot === void 0
8605
8747
  });
8606
8748
  if (preparedGifs.length > 0) {
8607
8749
  defaultLogger.debug(`[Compiler] Prepared ${preparedGifs.length} animated GIF input(s) as WebM`);
@@ -8616,7 +8758,8 @@ async function compileForRender(projectDir, htmlPath, downloadDir, options = {})
8616
8758
  embeddedHtml,
8617
8759
  projectDir,
8618
8760
  options.log,
8619
- entryFileName(projectDir, htmlPath)
8761
+ entryFileName(projectDir, htmlPath),
8762
+ { includeScripts: options.includeOutsideScripts }
8620
8763
  ) : { html: embeddedHtml, externalAssets: /* @__PURE__ */ new Map() };
8621
8764
  for (const [relPath, absPath] of remoteMediaAssets) {
8622
8765
  externalAssets.set(relPath, absPath);
@@ -9023,7 +9166,7 @@ async function resolveCompositionDurations(page, unresolved) {
9023
9166
  }
9024
9167
  return resolutions;
9025
9168
  }
9026
- async function recompileWithResolutions(compiled, resolutions, projectDir, downloadDir, assetRoot) {
9169
+ async function recompileWithResolutions(compiled, resolutions, projectDir, downloadDir, assetRoot, outsideFiles = {}) {
9027
9170
  if (resolutions.length === 0) return compiled;
9028
9171
  const html = injectDurations(compiled.html, resolutions);
9029
9172
  const { subCompositions } = await parseSubCompositions(
@@ -9033,7 +9176,8 @@ async function recompileWithResolutions(compiled, resolutions, projectDir, downl
9033
9176
  void 0,
9034
9177
  void 0,
9035
9178
  void 0,
9036
- assetRoot
9179
+ assetRoot,
9180
+ outsideFiles
9037
9181
  );
9038
9182
  const { videos, audios, images } = compiled;
9039
9183
  const remaining = compiled.unresolvedCompositions.filter(
@@ -9081,6 +9225,7 @@ function resolveEntryHtmlPath(input) {
9081
9225
  `Entry file "${relative3(projectDir, path)}" leads outside the project folder`
9082
9226
  );
9083
9227
  }
9228
+ assertCompositionFileSize(path, relative3(projectDir, path));
9084
9229
  return readTextFile(path);
9085
9230
  };
9086
9231
  const htmlPath = join17(projectDir, entryFile);
@@ -9142,7 +9287,8 @@ async function runCompileStage(input) {
9142
9287
  pageMotionBlur: input.pageMotionBlur,
9143
9288
  animatedGifCacheDir: animatedGifCacheDir(cfg.extractCacheDir),
9144
9289
  ffmpegProcessTimeout: cfg.ffmpegProcessTimeout,
9145
- allowOutsideProjectAssets: job.config.allowOutsideProjectAssets
9290
+ allowOutsideProjectAssets: job.config.allowOutsideProjectAssets,
9291
+ includeOutsideScripts: job.config.includeOutsideScripts
9146
9292
  });
9147
9293
  assertNotAborted();
9148
9294
  const compileOnlyMs = Date.now() - compileStart;
@@ -9228,6 +9374,8 @@ async function runCompileStage(input) {
9228
9374
  });
9229
9375
  const outputWidth = Math.round(width * deviceScaleFactor);
9230
9376
  const outputHeight = Math.round(height * deviceScaleFactor);
9377
+ requireOutputDimensions(job.config.expectedOutputDimensions, outputWidth, outputHeight);
9378
+ if (job.config.expectedOutputDimensions !== void 0) job.outputDimensionsChecked = true;
9231
9379
  if (deviceScaleFactor !== 1) {
9232
9380
  log.info("Scaling composition via deviceScaleFactor", {
9233
9381
  compositionWidth: width,
@@ -9297,30 +9445,50 @@ function hasAutoStartVideos(html) {
9297
9445
  const { document: document2 } = parseHTML(html);
9298
9446
  return document2.querySelector("video[data-hf-auto-start]") !== null;
9299
9447
  }
9300
- function scopedVariablesFor(element, variablesByComp) {
9301
- const scope = element.closest("[data-composition-id]");
9302
- const compId = scope?.getAttribute("data-composition-id")?.trim() ?? "";
9303
- return compId && Object.hasOwn(variablesByComp, compId) ? variablesByComp[compId] : void 0;
9448
+ var MAX_VARIABLE_SCOPE_STEPS = 1e6;
9449
+ function variableIdsOn(scan, element) {
9450
+ let ids = scan.ids.get(element);
9451
+ if (!ids) {
9452
+ ids = /* @__PURE__ */ new Set([
9453
+ ...Object.keys(parseHostVariableValues(element)),
9454
+ ...Object.keys(readDeclaredDefaults(element))
9455
+ ]);
9456
+ scan.ids.set(element, ids);
9457
+ }
9458
+ return ids;
9459
+ }
9460
+ function scopedVariablesFor(scan, element, variablesByComp) {
9461
+ for (let node = element; node; node = node.parentElement) {
9462
+ if (++scan.steps > MAX_VARIABLE_SCOPE_STEPS) return null;
9463
+ if (!node.hasAttribute("data-composition-id")) continue;
9464
+ const compId = node.getAttribute("data-composition-id")?.trim() ?? "";
9465
+ return compId && Object.hasOwn(variablesByComp, compId) ? variablesByComp[compId] : void 0;
9466
+ }
9467
+ return void 0;
9304
9468
  }
9305
- function variableHasValue(element, variableId, variables, variablesByComp) {
9469
+ function variableHasValue(scan, element, variableId, variables, variablesByComp) {
9306
9470
  if (variables && Object.hasOwn(variables, variableId)) return true;
9307
- const scoped = scopedVariablesFor(element, variablesByComp);
9471
+ const scoped = scopedVariablesFor(scan, element, variablesByComp);
9472
+ if (scoped === null) return true;
9308
9473
  if (scoped) return Object.hasOwn(scoped, variableId);
9309
9474
  for (let scope = element.parentElement; scope; scope = scope.parentElement) {
9310
- if (Object.hasOwn(parseHostVariableValues(scope), variableId)) return true;
9311
- if (Object.hasOwn(readDeclaredDefaults(scope), variableId)) return true;
9475
+ if (++scan.steps > MAX_VARIABLE_SCOPE_STEPS) return true;
9476
+ if (variableIdsOn(scan, scope).has(variableId)) return true;
9312
9477
  }
9313
- return Object.hasOwn(readDeclaredDefaults(element.ownerDocument.documentElement), variableId);
9478
+ return variableIdsOn(scan, element.ownerDocument.documentElement).has(variableId);
9314
9479
  }
9315
9480
  function hasVariableBoundMedia(html, variables, variablesByComp = {}) {
9316
9481
  const { document: document2 } = parseHTML(html);
9482
+ const scan = { ids: /* @__PURE__ */ new Map(), steps: 0 };
9317
9483
  return Array.from(
9318
9484
  document2.querySelectorAll(
9319
9485
  "img[data-var-src], audio[data-var-src], video[data-var-src], source[data-var-src]"
9320
9486
  )
9321
9487
  ).some((element) => {
9322
9488
  const variableId = element.getAttribute("data-var-src")?.trim();
9323
- return Boolean(variableId && variableHasValue(element, variableId, variables, variablesByComp));
9489
+ return Boolean(
9490
+ variableId && variableHasValue(scan, element, variableId, variables, variablesByComp)
9491
+ );
9324
9492
  });
9325
9493
  }
9326
9494
  function authoredMediaStarts(html) {
@@ -9360,29 +9528,54 @@ function reconcileBrowserMediaEnd(existingEnd, projectedEnd, sourceChanged, dura
9360
9528
  if (sourceChanged && durationInferred) return projectedEnd;
9361
9529
  return existingEnd <= 0 ? projectedEnd : Math.min(existingEnd, projectedEnd);
9362
9530
  }
9531
+ var MAX_MEDIA_SELECTOR_WORK = 1e6;
9532
+ var SIBLING_COMBINATOR = /[~+]/;
9533
+ function managedMediaElements(document2) {
9534
+ const managed = [];
9535
+ const pending = [];
9536
+ for (const element of Array.from(document2.children)) pending.push({ element, inMedia: false });
9537
+ for (let next = pending.pop(); next; next = pending.pop()) {
9538
+ const name = next.element.tagName.toLowerCase();
9539
+ const isMedia = name === "video" || name === "audio";
9540
+ if (isMedia || next.inMedia && name === "source") managed.push(next.element);
9541
+ for (const child2 of Array.from(next.element.children)) {
9542
+ pending.push({ element: child2, inMedia: next.inMedia || isMedia });
9543
+ }
9544
+ }
9545
+ return managed;
9546
+ }
9363
9547
  function hasRuntimeMediaChanges(html) {
9364
9548
  const { document: document2 } = parseHTML(html);
9365
9549
  const scriptBodies = [...document2.querySelectorAll("script")].map(
9366
9550
  (script) => script.textContent ?? ""
9367
9551
  );
9368
9552
  const insertedMedia = scriptBodies.some(
9369
- (script) => /\bcreateElement\s*\(\s*["'`](?:video|audio)["'`]\s*\)/i.test(script) || /\bnew\s+(?:Audio|Video)\s*\(/i.test(script) || /<(?:video|audio)\b[^>]*>/i.test(script)
9553
+ (script) => /\bcreateElement\s*\(\s*["'`](?:video|audio)["'`]\s*\)/i.test(script) || /\bnew\s+(?:Audio|Video)\s*\(/i.test(script) || hasClosedMediaTag(script)
9370
9554
  );
9371
9555
  if (insertedMedia) return true;
9372
- const isManagedMedia = (element) => {
9373
- const name = element.tagName.toLowerCase();
9374
- if (name === "video" || name === "audio") return true;
9375
- return name === "source" && element.closest("video, audio") !== null;
9376
- };
9556
+ const managed = managedMediaElements(document2);
9557
+ if (managed.length === 0) return false;
9558
+ const managedIds = new Set(managed.map((element) => element.getAttribute("id")).filter(Boolean));
9559
+ const selectors = /* @__PURE__ */ new Set();
9560
+ let selectorChars = 0;
9377
9561
  for (const script of scriptBodies) {
9378
9562
  for (const mutation of extractMediaSrcMutations(script)) {
9379
- try {
9380
- const id = /^#[A-Za-z_][\w-]*$/.test(mutation.selector) ? mutation.selector.slice(1) : null;
9381
- const idTarget = id ? document2.getElementById(id) : null;
9382
- const targets = id ? idTarget ? [idTarget] : [] : [...document2.querySelectorAll(mutation.selector)];
9383
- if (targets.some(isManagedMedia)) return true;
9384
- } catch {
9563
+ const id = /^#[A-Za-z_][\w-]*$/.test(mutation.selector) ? mutation.selector.slice(1) : null;
9564
+ if (id) {
9565
+ if (managedIds.has(id)) return true;
9566
+ continue;
9385
9567
  }
9568
+ if (selectors.has(mutation.selector)) continue;
9569
+ if (SIBLING_COMBINATOR.test(mutation.selector)) return true;
9570
+ selectors.add(mutation.selector);
9571
+ selectorChars += mutation.selector.length;
9572
+ if (selectorChars * managed.length > MAX_MEDIA_SELECTOR_WORK) return true;
9573
+ }
9574
+ }
9575
+ for (const selector of selectors) {
9576
+ try {
9577
+ if (managed.some((element) => element.matches(selector))) return true;
9578
+ } catch {
9386
9579
  }
9387
9580
  }
9388
9581
  return false;
@@ -9470,7 +9663,8 @@ async function runProbeStage(input) {
9470
9663
  port: 0,
9471
9664
  preHeadScripts: [VIRTUAL_TIME_SHIM],
9472
9665
  fps: job.config.fps,
9473
- allowOutsideProjectAssets: job.config.allowOutsideProjectAssets
9666
+ allowOutsideProjectAssets: job.config.allowOutsideProjectAssets,
9667
+ includeOutsideScripts: job.config.includeOutsideScripts
9474
9668
  });
9475
9669
  assertNotAborted();
9476
9670
  const motionBlur = job.config.motionBlur;
@@ -9626,7 +9820,8 @@ async function runProbeStage(input) {
9626
9820
  resolutions,
9627
9821
  projectDir,
9628
9822
  join18(workDir, "downloads"),
9629
- job.config.allowOutsideProjectAssets ? void 0 : projectDir
9823
+ job.config.allowOutsideProjectAssets ? void 0 : projectDir,
9824
+ { includeScripts: job.config.includeOutsideScripts }
9630
9825
  );
9631
9826
  assertNotAborted();
9632
9827
  composition.videos = compiled.videos;
@@ -12592,7 +12787,7 @@ import {
12592
12787
  readdirSync as readdirSync5,
12593
12788
  readFileSync as readFileSync7,
12594
12789
  rmSync as rmSync9,
12595
- statSync as statSync6,
12790
+ statSync as statSync7,
12596
12791
  writeFileSync as writeFileSync5
12597
12792
  } from "fs";
12598
12793
  import { readFile as readFile2 } from "fs/promises";
@@ -12706,7 +12901,7 @@ async function encodeGifFromDir(framesDir, framePattern, outputPath, input) {
12706
12901
  const failure = await reencodeWithClearedWholeFrames(argsInput, run, startTime);
12707
12902
  if (failure) return failure;
12708
12903
  }
12709
- const fileSize = existsSync19(outputPath) ? statSync6(outputPath).size : 0;
12904
+ const fileSize = existsSync19(outputPath) ? statSync7(outputPath).size : 0;
12710
12905
  return {
12711
12906
  success: true,
12712
12907
  outputPath,
@@ -12729,7 +12924,10 @@ function startEncodeProgress(job, stage, onProgress) {
12729
12924
  function resolveEngineConfig(input) {
12730
12925
  return input.engineConfig ?? input.job.config.producerConfig ?? resolveConfig();
12731
12926
  }
12732
- function videoEncoderOptions(input, engineCfg) {
12927
+ function overlapEncoderThreads(workerCount, cpuCount) {
12928
+ return Math.max(1, Math.floor(cpuCount) - Math.floor(workerCount));
12929
+ }
12930
+ function videoEncoderOptions(input, engineCfg, softwareEncoderThreads) {
12733
12931
  const { job, preset } = input;
12734
12932
  return {
12735
12933
  fps: job.config.fps,
@@ -12749,7 +12947,8 @@ function videoEncoderOptions(input, engineCfg) {
12749
12947
  // keyframes that survive `-f concat -c copy` at assemble time. In-process
12750
12948
  // renders leave both undefined → preserves the existing open-GOP output.
12751
12949
  lockGopForChunkConcat: input.lockGopForChunkConcat === true,
12752
- gopSize: input.gopSize
12950
+ gopSize: input.gopSize,
12951
+ softwareEncoderThreads
12753
12952
  };
12754
12953
  }
12755
12954
  function canEncodeWhileCapturing(input, workerCount, cpuCount) {
@@ -12765,8 +12964,9 @@ async function readLandedFrame(workerPath, mergedPath) {
12765
12964
  }
12766
12965
  return readFile2(mergedPath);
12767
12966
  }
12768
- function encodeWhileCapturing(input, totalFrames) {
12967
+ function encodeWhileCapturing(input, totalFrames, captureBudget) {
12769
12968
  const engineCfg = resolveEngineConfig(input);
12969
+ const softwareEncoderThreads = captureBudget ? overlapEncoderThreads(captureBudget.workerCount, captureBudget.cpuCount) : void 0;
12770
12970
  const stop = new AbortController();
12771
12971
  const signal = input.abortSignal ? AbortSignal.any([input.abortSignal, stop.signal]) : stop.signal;
12772
12972
  const landed = /* @__PURE__ */ new Map();
@@ -12781,7 +12981,10 @@ function encodeWhileCapturing(input, totalFrames) {
12781
12981
  let reportFed = null;
12782
12982
  const encoder = spawnStreamingEncoder(
12783
12983
  input.videoOnlyPath,
12784
- { ...videoEncoderOptions(input, engineCfg), imageFormat: "jpeg" },
12984
+ {
12985
+ ...videoEncoderOptions(input, engineCfg, softwareEncoderThreads),
12986
+ imageFormat: "jpeg"
12987
+ },
12785
12988
  signal,
12786
12989
  engineCfg
12787
12990
  );
@@ -12834,7 +13037,7 @@ function encodeWhileCapturing(input, totalFrames) {
12834
13037
  error: String(failure ?? result?.error)
12835
13038
  }
12836
13039
  );
12837
- return runEncodeStage(input);
13040
+ return runEncodeStage({ ...input, hasAudio: false });
12838
13041
  },
12839
13042
  abort: async () => {
12840
13043
  stop.abort();
@@ -13111,7 +13314,7 @@ function sampleDirectoryBytes(dir) {
13111
13314
  for (const name of entries) {
13112
13315
  const full = join29(current, name);
13113
13316
  try {
13114
- const st = statSync7(full);
13317
+ const st = statSync8(full);
13115
13318
  if (st.isDirectory()) {
13116
13319
  stack.push(full);
13117
13320
  } else if (st.isFile()) {
@@ -13161,6 +13364,7 @@ var RenderQualityError = class extends Error {
13161
13364
  }
13162
13365
  warnings;
13163
13366
  };
13367
+ var MIN_CPUS_TO_CAPTURE_DURING_MIX = 4;
13164
13368
  function applyRenderWarningPolicy(job, captureWarnings, log = defaultLogger) {
13165
13369
  job.warnings ??= [];
13166
13370
  const existing = new Set(
@@ -13266,7 +13470,7 @@ function findMissingFrameRanges(totalFrames, framesDir, frameExt) {
13266
13470
  let rangeStart = null;
13267
13471
  for (let frameIndex = 0; frameIndex < totalFrames; frameIndex++) {
13268
13472
  const framePath = join29(framesDir, formatCaptureFrameName(frameIndex, frameExt));
13269
- const missing = !existsSync20(framePath) || statSync7(framePath).size <= 8;
13473
+ const missing = !existsSync20(framePath) || statSync8(framePath).size <= 8;
13270
13474
  if (missing && rangeStart === null) {
13271
13475
  rangeStart = frameIndex;
13272
13476
  } else if (!missing && rangeStart !== null) {
@@ -14131,8 +14335,14 @@ async function executeRenderPipeline(input) {
14131
14335
  const onProgress = execution.onProgress;
14132
14336
  const tooSlow = new AbortController();
14133
14337
  let tooSlowError;
14338
+ const audioFailed = new AbortController();
14339
+ let audioFailure;
14134
14340
  let calibrationEvaluateTimedOut = false;
14135
- const executionSignal = job.config.maxRenderMs ? AbortSignal.any([tooSlow.signal, ...execution.signal ? [execution.signal] : []]) : execution.signal;
14341
+ const executionSignal = AbortSignal.any([
14342
+ audioFailed.signal,
14343
+ ...job.config.maxRenderMs ? [tooSlow.signal] : [],
14344
+ ...execution.signal ? [execution.signal] : []
14345
+ ]);
14136
14346
  let fileServer = null;
14137
14347
  let probeSession = null;
14138
14348
  let lastBrowserConsole = [];
@@ -14603,7 +14813,8 @@ async function executeRenderPipeline(input) {
14603
14813
  port: 0,
14604
14814
  preHeadScripts: [VIRTUAL_TIME_SHIM],
14605
14815
  fps: job.config.fps,
14606
- allowOutsideProjectAssets: job.config.allowOutsideProjectAssets
14816
+ allowOutsideProjectAssets: job.config.allowOutsideProjectAssets,
14817
+ includeOutsideScripts: job.config.includeOutsideScripts
14607
14818
  });
14608
14819
  assertNotAborted();
14609
14820
  observability.stageEnd("file_server", fileServerStart);
@@ -15394,33 +15605,41 @@ async function executeRenderPipeline(input) {
15394
15605
  }
15395
15606
  const effectiveQuality = job.config.crf ?? preset.quality;
15396
15607
  const effectiveBitrate = job.config.crf != null ? void 0 : job.config.videoBitrate;
15397
- const audioResult = await audioWait.wait(audioStage);
15398
- const { audioOutputPath, deliverySourcePath, hasAudio } = audioResult;
15399
- perfStages.audioProcessMs = audioResult.audioProcessMs;
15400
- recordLimiterAttenuation(job, audioResult.audioLoweredDb);
15401
- if (audioResult.audioError) {
15402
- const audioFailures = audioResult.audioFailures ?? [];
15403
- const failureOwner = audioFailures.length === 0 ? void 0 : audioFailures.some((failure) => failure.owner === "system") ? "system" : "user";
15404
- const retryable = audioFailures.length === 0 ? void 0 : audioFailures.every((failure) => failure.retryable);
15405
- applyRenderWarningPolicy(
15406
- job,
15407
- [
15408
- {
15409
- code: "audio_processing_failed",
15410
- message: `Audio mix failed; output would be video-only: ${audioResult.audioError}`,
15411
- details: {
15412
- mediaType: "audio",
15413
- audioFailures: audioFailureDiagnostics(audioFailures),
15414
- failureReasons: [...new Set(audioFailures.map((failure) => failure.reason))],
15415
- failureStages: [...new Set(audioFailures.map((failure) => failure.stage))],
15416
- failureOwner,
15417
- retryable
15608
+ const audioReady = audioStage.then((audioResult) => {
15609
+ perfStages.audioProcessMs = audioResult.audioProcessMs;
15610
+ recordLimiterAttenuation(job, audioResult.audioLoweredDb);
15611
+ if (audioResult.audioError) {
15612
+ const audioFailures = audioResult.audioFailures ?? [];
15613
+ const failureOwner = audioFailures.length === 0 ? void 0 : audioFailures.some((failure) => failure.owner === "system") ? "system" : "user";
15614
+ const retryable = audioFailures.length === 0 ? void 0 : audioFailures.every((failure) => failure.retryable);
15615
+ applyRenderWarningPolicy(
15616
+ job,
15617
+ [
15618
+ {
15619
+ code: "audio_processing_failed",
15620
+ message: `Audio mix failed; output would be video-only: ${audioResult.audioError}`,
15621
+ details: {
15622
+ mediaType: "audio",
15623
+ audioFailures: audioFailureDiagnostics(audioFailures),
15624
+ failureReasons: [...new Set(audioFailures.map((failure) => failure.reason))],
15625
+ failureStages: [...new Set(audioFailures.map((failure) => failure.stage))],
15626
+ failureOwner,
15627
+ retryable
15628
+ }
15418
15629
  }
15419
- }
15420
- ],
15421
- log
15422
- );
15423
- }
15630
+ ],
15631
+ log
15632
+ );
15633
+ }
15634
+ return audioResult;
15635
+ });
15636
+ audioReady.catch((error) => {
15637
+ if (executionSignal.aborted) return;
15638
+ audioFailure = error;
15639
+ audioFailed.abort(error);
15640
+ });
15641
+ const mixedAudio = () => audioWait.wait(audioReady);
15642
+ if (usableCpuCount() < MIN_CPUS_TO_CAPTURE_DURING_MIX) await mixedAudio();
15424
15643
  resetCaptureAttemptProgress(job);
15425
15644
  if (capturePlan.kind === "hdr_layered") {
15426
15645
  const layeredPlan = capturePlan;
@@ -15603,7 +15822,7 @@ async function executeRenderPipeline(input) {
15603
15822
  } catch (err) {
15604
15823
  const isVerifyError = isDrawElementVerificationError(err);
15605
15824
  const isDeStall = isDeRendererStallError(err);
15606
- if (!isVerifyError && !isDrawElementCaptureError(err) && !isDeStall || err instanceof RenderCancelledError || executionSignal?.aborted === true) {
15825
+ if (!isVerifyError && !isDrawElementCaptureError(err) && !isDeStall || err instanceof RenderCancelledError || executionSignal.aborted === true) {
15607
15826
  throw err;
15608
15827
  }
15609
15828
  deSelfVerifyFallback = isVerifyError;
@@ -15746,7 +15965,7 @@ async function executeRenderPipeline(input) {
15746
15965
  const isSequentialStall = isSequentialCaptureStallError(err);
15747
15966
  const isParallelStall = isParallelCaptureStallError(err);
15748
15967
  const isEncoderDeath = isRetryableEncoderDeath(err);
15749
- const isCancellation = err instanceof RenderCancelledError || executionSignal?.aborted === true;
15968
+ const isCancellation = err instanceof RenderCancelledError || executionSignal.aborted === true;
15750
15969
  if (!shouldRetryViaPinnedFallback({
15751
15970
  isVerifyError,
15752
15971
  isDeCaptureError,
@@ -15875,8 +16094,6 @@ async function executeRenderPipeline(input) {
15875
16094
  height,
15876
16095
  needsAlpha,
15877
16096
  captureImageFormat: captureOptions.format ?? "jpeg",
15878
- hasAudio,
15879
- audioOutputPath,
15880
16097
  isPngSequence,
15881
16098
  isGif,
15882
16099
  preset,
@@ -15892,7 +16109,10 @@ async function executeRenderPipeline(input) {
15892
16109
  assertNotAborted,
15893
16110
  onProgress
15894
16111
  };
15895
- const overlap = !cfg.useDrawElement && workerSizing !== void 0 && canEncodeWhileCapturing(encodeInput, capturePlan.workerCount, workerSizing.cpuCount) ? encodeWhileCapturing(encodeInput, totalFrames) : null;
16112
+ const overlap = !cfg.useDrawElement && workerSizing !== void 0 && canEncodeWhileCapturing(encodeInput, capturePlan.workerCount, workerSizing.cpuCount) ? encodeWhileCapturing(encodeInput, totalFrames, {
16113
+ workerCount: capturePlan.workerCount,
16114
+ cpuCount: workerSizing.cpuCount
16115
+ }) : null;
15896
16116
  const captureFrameStart = Date.now();
15897
16117
  const invokeDiskCapture = (diskPlan) => observeRenderStage(
15898
16118
  observability,
@@ -15926,7 +16146,7 @@ async function executeRenderPipeline(input) {
15926
16146
  captureRes = await invokeDiskCapture(capturePlan);
15927
16147
  } catch (err) {
15928
16148
  await overlap?.abort();
15929
- if (!isDrawElementVerificationError(err) && !isDrawElementCaptureError(err) || err instanceof RenderCancelledError || executionSignal?.aborted === true) {
16149
+ if (!isDrawElementVerificationError(err) && !isDrawElementCaptureError(err) || err instanceof RenderCancelledError || executionSignal.aborted === true) {
15930
16150
  throw err;
15931
16151
  }
15932
16152
  deSelfVerifyFallback = isDrawElementVerificationError(err);
@@ -15985,16 +16205,17 @@ async function executeRenderPipeline(input) {
15985
16205
  perfStages.captureMs = Date.now() - stage4Start;
15986
16206
  perfStages.captureFrameMs = captureFrameMs;
15987
16207
  perfStages.captureSetupMs = Math.max(0, perfStages.captureMs - captureFrameMs);
16208
+ const { hasAudio: hasAudio2, audioOutputPath: audioOutputPath2 } = await mixedAudio();
15988
16209
  const encodeRes = await observeRenderStage(
15989
16210
  observability,
15990
16211
  "encode",
15991
16212
  captureStageObservationData({
15992
- hasAudio,
16213
+ hasAudio: hasAudio2,
15993
16214
  isPngSequence,
15994
16215
  isGif,
15995
16216
  chunkedEncode: enableChunkedEncode
15996
16217
  }),
15997
- () => overlap ? overlap.finish() : runEncodeStage(encodeInput)
16218
+ () => overlap ? overlap.finish() : runEncodeStage({ ...encodeInput, hasAudio: hasAudio2, audioOutputPath: audioOutputPath2 })
15998
16219
  );
15999
16220
  perfStages.encodeMs = encodeRes.encodeMs;
16000
16221
  }
@@ -16014,6 +16235,7 @@ async function executeRenderPipeline(input) {
16014
16235
  if (frameLookup) frameLookup.cleanup();
16015
16236
  closeFileServerSafely(fileServer, "renderOrchestrator", log);
16016
16237
  fileServer = null;
16238
+ const { audioOutputPath, deliverySourcePath, hasAudio } = await mixedAudio();
16017
16239
  if (!isPngSequence && !isGif) {
16018
16240
  const assembleRes = await observeRenderStage(
16019
16241
  observability,
@@ -16149,8 +16371,11 @@ async function executeRenderPipeline(input) {
16149
16371
  framesRendered: job.framesRendered ?? 0,
16150
16372
  error: caught
16151
16373
  });
16152
- const error = surfaceScriptFailure(tooSlowError ?? pageNeverReady ?? caught, job);
16153
- if (!tooSlowError && (error instanceof RenderCancelledError || executionSignal?.aborted)) {
16374
+ const error = surfaceScriptFailure(
16375
+ tooSlowError ?? audioFailure ?? pageNeverReady ?? caught,
16376
+ job
16377
+ );
16378
+ if (!tooSlowError && !audioFailure && (error instanceof RenderCancelledError || executionSignal.aborted)) {
16154
16379
  job.error = error instanceof Error ? error.message : "render_cancelled";
16155
16380
  updateJobStatus(job, "cancelled", "Render cancelled", job.progress, onProgress);
16156
16381
  await eventPublisher.flush();
@@ -16192,7 +16417,7 @@ async function executeRenderPipeline(input) {
16192
16417
  `Parallel capture timed out with ${captureObservability.workerCount ?? "auto"} workers. Video-heavy compositions often need sequential capture. Retry with --workers 1`
16193
16418
  );
16194
16419
  }
16195
- const failedStage = job.currentStage || "pipeline";
16420
+ const failedStage = audioFailure === void 0 ? job.currentStage || "pipeline" : AUDIO_STAGE;
16196
16421
  const observabilitySummary = observability.summary({
16197
16422
  lastBrowserConsole,
16198
16423
  capture: withCapturedBeyondViewport(captureObservability, dedupPerfs),
@@ -16912,8 +17137,10 @@ function buildSyntheticRenderJob(input) {
16912
17137
  producerConfig: input.producerConfig,
16913
17138
  variables: input.variables,
16914
17139
  strictVariables: input.strictVariables,
17140
+ expectedOutputDimensions: input.expectedOutputDimensions,
16915
17141
  pageMotionBlur: input.pageMotionBlur,
16916
- allowOutsideProjectAssets: input.allowOutsideProjectAssets
17142
+ allowOutsideProjectAssets: input.allowOutsideProjectAssets,
17143
+ includeOutsideScripts: input.includeOutsideScripts
16917
17144
  };
16918
17145
  return createRenderJob(renderConfig);
16919
17146
  }
@@ -18378,8 +18605,10 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
18378
18605
  producerConfig: cfg,
18379
18606
  variables: config.variables,
18380
18607
  strictVariables: config.strictVariables,
18608
+ expectedOutputDimensions: config.expectedOutputDimensions,
18381
18609
  pageMotionBlur: config.pageMotionBlur,
18382
- allowOutsideProjectAssets: options.allowOutsideProjectAssets === true
18610
+ allowOutsideProjectAssets: options.allowOutsideProjectAssets === true,
18611
+ includeOutsideScripts: options.includeOutsideScripts === true
18383
18612
  });
18384
18613
  const entryFile = config.entryFile ?? "index.html";
18385
18614
  const htmlPath = join38(projectDir, entryFile);
@@ -18400,7 +18629,9 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
18400
18629
  if (rel === "") return true;
18401
18630
  if (leavesRoot(rel)) return false;
18402
18631
  if (job.config.allowOutsideProjectAssets) {
18403
- if (refusesOutsideLink(projectDir, src, (line) => log.warn(`[Plan] ${line}`))) return false;
18632
+ const warn = (line) => log.warn(`[Plan] ${line}`);
18633
+ const policy = { includeScripts: job.config.includeOutsideScripts };
18634
+ if (refusesOutsideLink(projectDir, src, warn, policy)) return false;
18404
18635
  } else if (!isSafePath(projectDir, src)) return false;
18405
18636
  const firstSegment = rel.split(sep3, 1)[0];
18406
18637
  return firstSegment === void 0 || !PLAN_PROJECT_DIR_SKIP_SEGMENTS.has(firstSegment);
@@ -18507,7 +18738,7 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
18507
18738
  if (probeResult.fileServer) closeFileServerSafely(probeResult.fileServer, "plan", log);
18508
18739
  if (probeResult.probeSession) {
18509
18740
  try {
18510
- const { closeCaptureSession: closeCaptureSession2 } = await import("./src-B646B52O.js");
18741
+ const { closeCaptureSession: closeCaptureSession2 } = await import("./src-IQKTGPPV.js");
18511
18742
  await closeCaptureSession2(probeResult.probeSession);
18512
18743
  } catch (err) {
18513
18744
  log.warn("[plan] probe session close failed", {
@@ -18845,6 +19076,7 @@ async function buildLocalExecutionPlan(projectDir, config, executionPlanDir, opt
18845
19076
  format: config.format,
18846
19077
  ffmpegVersion,
18847
19078
  producerVersion,
19079
+ ...job.outputDimensionsChecked === void 0 ? {} : { outputDimensionsChecked: job.outputDimensionsChecked },
18848
19080
  ...job.strictVariablesChecked === void 0 ? {} : { strictVariablesChecked: job.strictVariablesChecked }
18849
19081
  };
18850
19082
  }
@@ -18863,6 +19095,7 @@ async function plan(projectDir, config, planDir, options = {}) {
18863
19095
  format: executionPlan.format,
18864
19096
  ffmpegVersion: executionPlan.ffmpegVersion,
18865
19097
  producerVersion: executionPlan.producerVersion,
19098
+ ...executionPlan.outputDimensionsChecked === void 0 ? {} : { outputDimensionsChecked: executionPlan.outputDimensionsChecked },
18866
19099
  ...executionPlan.strictVariablesChecked === void 0 ? {} : { strictVariablesChecked: executionPlan.strictVariablesChecked }
18867
19100
  };
18868
19101
  }
@@ -18881,7 +19114,7 @@ import {
18881
19114
  readFileSync as readFileSync11,
18882
19115
  readdirSync as readdirSync10,
18883
19116
  rmSync as rmSync14,
18884
- statSync as statSync9,
19117
+ statSync as statSync10,
18885
19118
  writeFileSync as writeFileSync11
18886
19119
  } from "fs";
18887
19120
  import { tmpdir as tmpdir3 } from "os";
@@ -18894,7 +19127,7 @@ import {
18894
19127
  linkSync as linkSync2,
18895
19128
  mkdirSync as mkdirSync15,
18896
19129
  rmSync as rmSync13,
18897
- statSync as statSync8,
19130
+ statSync as statSync9,
18898
19131
  writeFileSync as writeFileSync10
18899
19132
  } from "fs";
18900
19133
  import { dirname as dirname15, join as join40 } from "path";
@@ -18962,7 +19195,7 @@ var LocalPlanV2ArtifactPublisher = class {
18962
19195
  }
18963
19196
  async putBlob(blob) {
18964
19197
  const digest = assertPlanV2Sha256(blob.sha256, "published blob sha256");
18965
- const sourceSize = statSync8(blob.sourcePath).size;
19198
+ const sourceSize = statSync9(blob.sourcePath).size;
18966
19199
  if (sourceSize !== blob.sizeBytes) {
18967
19200
  throw new PlanV2IntegrityError(
18968
19201
  `published blob size changed for ${digest}: expected ${blob.sizeBytes}, got ${sourceSize}`
@@ -19275,7 +19508,7 @@ function publishBlobFor(absolutePath, digests) {
19275
19508
  return {
19276
19509
  sourcePath: absolutePath,
19277
19510
  sha256: planFileSha256(absolutePath, digests),
19278
- sizeBytes: statSync9(absolutePath).size
19511
+ sizeBytes: statSync10(absolutePath).size
19279
19512
  };
19280
19513
  }
19281
19514
  async function putBlobs(publisher, blobs) {
@@ -19454,7 +19687,10 @@ async function planV2WithPublisher(projectDir, config, publisher, options = {})
19454
19687
  sliceChunkAudio: true,
19455
19688
  deferAudio: options.deferAudio
19456
19689
  });
19457
- options.onPlanned?.({ strictVariablesChecked: planned.strictVariablesChecked });
19690
+ options.onPlanned?.({
19691
+ strictVariablesChecked: planned.strictVariablesChecked,
19692
+ outputDimensionsChecked: planned.outputDimensionsChecked
19693
+ });
19458
19694
  return await publishExecutionPlan(stagingRoot, publisher, { digests, log: config.logger });
19459
19695
  } catch (error) {
19460
19696
  try {
@@ -19643,7 +19879,7 @@ function verifyBlob(planV2Dir, artifact) {
19643
19879
  if (!existsSync27(sourcePath)) {
19644
19880
  throw new PlanV2IntegrityError(`missing content-addressed artifact ${artifact.sha256}`);
19645
19881
  }
19646
- const stats = statSync9(sourcePath);
19882
+ const stats = statSync10(sourcePath);
19647
19883
  if (!stats.isFile() || stats.size !== artifact.sizeBytes) {
19648
19884
  throw new PlanV2IntegrityError(`artifact size mismatch for ${artifact.path}`);
19649
19885
  }
@@ -19736,7 +19972,7 @@ function readValidatedPlanV2Materialization(planDir, expectedTarget) {
19736
19972
  for (const artifact of required) {
19737
19973
  if (Object.hasOwn(remoteSources, artifact.path)) continue;
19738
19974
  const path = join41(planDir, ...artifact.path.split("/"));
19739
- if (!existsSync27(path) || statSync9(path).size !== artifact.sizeBytes) {
19975
+ if (!existsSync27(path) || statSync10(path).size !== artifact.sizeBytes) {
19740
19976
  throw new PlanV2IntegrityError(
19741
19977
  `materialized artifact missing or truncated: ${artifact.path}`
19742
19978
  );
@@ -20276,7 +20512,10 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
20276
20512
  const captureSession = session;
20277
20513
  session = null;
20278
20514
  verifyStarted = Date.now();
20279
- overlap.current = canEncodeWhileCapturing(encodeInput, chunkWorkerCount, usableCpuCount()) ? encodeWhileCapturing(encodeInput, framesInChunk) : null;
20515
+ overlap.current = canEncodeWhileCapturing(encodeInput, chunkWorkerCount, usableCpuCount()) ? encodeWhileCapturing(encodeInput, framesInChunk, {
20516
+ workerCount: chunkWorkerCount,
20517
+ cpuCount: usableCpuCount()
20518
+ }) : null;
20280
20519
  await observeRenderStage(
20281
20520
  new RenderObservabilityRecorder({ pipelineStartMs: start, log }),
20282
20521
  "capture_chunk",
@@ -20481,7 +20720,11 @@ async function renderSpan(projectDir, config, span, outputPath, options = {}) {
20481
20720
  projectDir,
20482
20721
  { ...config, rejectOnSystemFonts: false, failClosedFontFetch: false },
20483
20722
  planDir,
20484
- { chunksCarryAudio: true, allowOutsideProjectAssets: options.allowOutsideProjectAssets }
20723
+ {
20724
+ chunksCarryAudio: true,
20725
+ allowOutsideProjectAssets: options.allowOutsideProjectAssets,
20726
+ includeOutsideScripts: options.includeOutsideScripts
20727
+ }
20485
20728
  );
20486
20729
  const { startFrame, endFrame } = spanFrameRange(
20487
20730
  span.startSeconds,
@@ -20530,7 +20773,9 @@ var SAFE_RENDER_ERROR_CODES = /* @__PURE__ */ new Set([
20530
20773
  "RENDER_TOO_SLOW",
20531
20774
  "RENDER_STAGE_STALLED",
20532
20775
  "PAGE_NEVER_READY",
20533
- "VARIABLES_INVALID"
20776
+ "VARIABLES_INVALID",
20777
+ "OUTPUT_DIMENSIONS_MISMATCH",
20778
+ "COMPOSITION_TOO_LARGE"
20534
20779
  ]);
20535
20780
  function extractSafeRenderErrorCode(error) {
20536
20781
  if (typeof error !== "object" || error === null || !("code" in error)) return void 0;
@@ -20572,6 +20817,12 @@ function validateDistributedRenderConfig(config) {
20572
20817
  `must be one of ${DISTRIBUTED_FPS.join(", ")}; got ${String(config.fps)}`
20573
20818
  );
20574
20819
  }
20820
+ if (config.expectedOutputDimensions !== void 0 && !isExpectedOutputDimensions(config.expectedOutputDimensions)) {
20821
+ throw new InvalidConfigError(
20822
+ "config.expectedOutputDimensions",
20823
+ "must contain positive integer width and height"
20824
+ );
20825
+ }
20575
20826
  validateIntDimension("config.width", config.width);
20576
20827
  validateIntDimension("config.height", config.height);
20577
20828
  if (config.pageMotionBlur !== void 0 && config.pageMotionBlur !== "off") {
@@ -20925,6 +21176,11 @@ function assertRequestOptionScalars(options) {
20925
21176
  }
20926
21177
  function assertRequestOptionObjects(options) {
20927
21178
  validateEngineConfigSnapshot(options.engineConfig);
21179
+ if (options.expectedOutputDimensions !== void 0 && !isExpectedOutputDimensions(options.expectedOutputDimensions)) {
21180
+ throw new Error(
21181
+ "Render request expectedOutputDimensions must contain positive integer width and height"
21182
+ );
21183
+ }
20928
21184
  if (options.variables !== void 0 && !isPlainObject(options.variables)) {
20929
21185
  throw new Error("Render request variables must be a JSON object");
20930
21186
  }
@@ -20990,7 +21246,8 @@ function renderConfigFromRequest(request, runtime = {}) {
20990
21246
  ...options,
20991
21247
  producerConfig: engineConfig,
20992
21248
  logger: runtime.logger,
20993
- allowOutsideProjectAssets: runtime.allowOutsideProjectAssets === true
21249
+ allowOutsideProjectAssets: runtime.allowOutsideProjectAssets === true,
21250
+ includeOutsideScripts: runtime.includeOutsideScripts === true
20994
21251
  };
20995
21252
  }
20996
21253
  function distributedFps(fps) {
@@ -21045,7 +21302,8 @@ function distributedConfigFromRequest(request, runtime = {}) {
21045
21302
  abortSignal: runtime.abortSignal,
21046
21303
  planDirSizeLimitBytes: distributed.planDirSizeLimitBytes,
21047
21304
  variables: options.variables,
21048
- strictVariables: options.strictVariables
21305
+ strictVariables: options.strictVariables,
21306
+ expectedOutputDimensions: options.expectedOutputDimensions
21049
21307
  };
21050
21308
  }
21051
21309
  function optionalProperty(key, value) {
@@ -21087,7 +21345,8 @@ function renderRequestFromDistributedConfig(input) {
21087
21345
  ...optionalProperty("strictness", config.strictness),
21088
21346
  ...optionalProperty("entryFile", config.entryFile),
21089
21347
  ...optionalProperty("variables", config.variables),
21090
- ...optionalProperty("strictVariables", config.strictVariables)
21348
+ ...optionalProperty("strictVariables", config.strictVariables),
21349
+ ...optionalProperty("expectedOutputDimensions", config.expectedOutputDimensions)
21091
21350
  };
21092
21351
  return createRenderRequest({
21093
21352
  projectDir: input.projectDir,
@@ -21101,7 +21360,7 @@ function renderRequestFromDistributedConfig(input) {
21101
21360
  import {
21102
21361
  existsSync as existsSync31,
21103
21362
  mkdirSync as mkdirSync19,
21104
- statSync as statSync11,
21363
+ statSync as statSync12,
21105
21364
  mkdtempSync as mkdtempSync2,
21106
21365
  writeFileSync as writeFileSync13,
21107
21366
  rmSync as rmSync17,
@@ -21120,7 +21379,7 @@ import { serve as serve2 } from "@hono/node-server";
21120
21379
  import {
21121
21380
  existsSync as existsSync29,
21122
21381
  readFileSync as readFileSync14,
21123
- statSync as statSync10,
21382
+ statSync as statSync11,
21124
21383
  openSync as openSync6,
21125
21384
  fstatSync as fstatSync3,
21126
21385
  closeSync as closeSync6,
@@ -21161,7 +21420,7 @@ function readEntryHtml(filePath) {
21161
21420
  } catch (error) {
21162
21421
  if (error instanceof Error && "code" in error && (error.code === "ENOENT" || error.code === "ENOTDIR"))
21163
21422
  return null;
21164
- if (!statSync10(filePath, { throwIfNoEntry: false })?.isFile()) return null;
21423
+ if (!statSync11(filePath, { throwIfNoEntry: false })?.isFile()) return null;
21165
21424
  throw error;
21166
21425
  }
21167
21426
  try {
@@ -21177,7 +21436,7 @@ function leavesProject(absProjectDir, absoluteEntryPath, isAllowedEntry) {
21177
21436
  }
21178
21437
  function readProjectEntryFile(projectDir, preferredEntryFile, isAllowedEntry) {
21179
21438
  const absProjectDir = resolve9(projectDir);
21180
- if (!existsSync29(absProjectDir) || !statSync10(absProjectDir).isDirectory()) {
21439
+ if (!existsSync29(absProjectDir) || !statSync11(absProjectDir).isDirectory()) {
21181
21440
  return { error: `Project directory not found: ${absProjectDir}` };
21182
21441
  }
21183
21442
  const entryCandidates = [preferredEntryFile, "index.html", "src/index.html"].filter(
@@ -21520,6 +21779,7 @@ function parseRenderOptions(body) {
21520
21779
  outputDynamicRange,
21521
21780
  variables,
21522
21781
  strictVariables,
21782
+ expectedOutputDimensions: isExpectedOutputDimensions(body.expectedOutputDimensions) ? body.expectedOutputDimensions : void 0,
21523
21783
  outputResolution,
21524
21784
  outputResolutionAspectAgnostic,
21525
21785
  videoFrameFormat
@@ -21559,6 +21819,7 @@ function buildRenderJobConfig(input, outputPath, log) {
21559
21819
  entryFile: input.entryFile,
21560
21820
  variables: input.variables,
21561
21821
  strictVariables: input.strictVariables,
21822
+ expectedOutputDimensions: input.expectedOutputDimensions,
21562
21823
  outputResolution: input.outputResolution,
21563
21824
  outputResolutionAspectAgnostic: input.outputResolutionAspectAgnostic,
21564
21825
  videoFrameFormat: input.videoFrameFormat,
@@ -21603,6 +21864,9 @@ function validateRenderOverrides(body) {
21603
21864
  if (body.variables !== void 0 && !isPlainObject2(body.variables)) {
21604
21865
  return 'variables must be a JSON object keyed by variable id (e.g. {"title":"Hello"})';
21605
21866
  }
21867
+ if (body.expectedOutputDimensions !== void 0 && !isExpectedOutputDimensions(body.expectedOutputDimensions)) {
21868
+ return "expectedOutputDimensions must contain positive integer width and height";
21869
+ }
21606
21870
  if (body.strictVariables !== void 0 && typeof body.strictVariables !== "boolean") {
21607
21871
  return "strictVariables must be a boolean";
21608
21872
  }
@@ -21653,7 +21917,7 @@ function prepareProjectDirectory(projectDir, options, policy) {
21653
21917
  if (!candidate) return null;
21654
21918
  const absProjectDir = policy ? resolve10(policy.projectsDir, candidate) : resolve10(candidate);
21655
21919
  const shown = policy ? candidate : absProjectDir;
21656
- if (policy && !isAllowedProjectPath(policy.projectsDir, absProjectDir) || !existsSync31(absProjectDir) || !statSync11(absProjectDir).isDirectory()) {
21920
+ if (policy && !isAllowedProjectPath(policy.projectsDir, absProjectDir) || !existsSync31(absProjectDir) || !statSync12(absProjectDir).isDirectory()) {
21657
21921
  return { error: `Project directory not found: ${shown}` };
21658
21922
  }
21659
21923
  const entry = options.entryFile || "index.html";
@@ -21756,7 +22020,7 @@ function publicPerfSummary(job) {
21756
22020
  return job.perfSummary ? { ...job.perfSummary, renderId: void 0 } : null;
21757
22021
  }
21758
22022
  function outputFileSize(path) {
21759
- return existsSync31(path) ? statSync11(path).size : 0;
22023
+ return existsSync31(path) ? statSync12(path).size : 0;
21760
22024
  }
21761
22025
  function createBlockingProgressReporter(log, requestId) {
21762
22026
  let lastLoggedPct = -10;
@@ -21959,7 +22223,8 @@ function createRenderHandlers(options = {}) {
21959
22223
  outcome: job.outcome ?? "completed",
21960
22224
  warnings: job.warnings,
21961
22225
  perf: policy ? publicPerfSummary(job) : job.perfSummary ?? null,
21962
- ...strictVariablesResult(job)
22226
+ ...strictVariablesResult(job),
22227
+ ...job.outputDimensionsChecked === void 0 ? {} : { outputDimensionsChecked: job.outputDimensionsChecked }
21963
22228
  });
21964
22229
  } catch (error) {
21965
22230
  const durationMs = Date.now() - t0;
@@ -22056,7 +22321,8 @@ function createRenderHandlers(options = {}) {
22056
22321
  warnings: job.warnings,
22057
22322
  perf: policy ? publicPerfSummary(job) : job.perfSummary ?? null,
22058
22323
  producerVersion: readProducerVersion(),
22059
- ...strictVariablesResult(job)
22324
+ ...strictVariablesResult(job),
22325
+ ...job.outputDimensionsChecked === void 0 ? {} : { outputDimensionsChecked: job.outputDimensionsChecked }
22060
22326
  })
22061
22327
  });
22062
22328
  } catch (error) {
@@ -22085,7 +22351,7 @@ function createRenderHandlers(options = {}) {
22085
22351
  store.delete(token);
22086
22352
  return c.json({ success: false, error: "Output artifact file missing" }, 404);
22087
22353
  }
22088
- const stats = statSync11(artifact.path);
22354
+ const stats = statSync12(artifact.path);
22089
22355
  return new Response(createReadStream5(artifact.path), {
22090
22356
  headers: {
22091
22357
  "content-type": "video/mp4",
@@ -22222,7 +22488,7 @@ function startServer(options = {}) {
22222
22488
  });
22223
22489
  async function shutdown(signal) {
22224
22490
  log.info(`Received ${signal}, shutting down`);
22225
- const { drainBrowserPool } = await import("./src-B646B52O.js");
22491
+ const { drainBrowserPool } = await import("./src-IQKTGPPV.js");
22226
22492
  await drainBrowserPool().catch(() => {
22227
22493
  });
22228
22494
  const handle = await Promise.race([
@@ -22270,7 +22536,7 @@ import {
22270
22536
  readFileSync as readFileSync15,
22271
22537
  readdirSync as readdirSync12,
22272
22538
  rmSync as rmSync18,
22273
- statSync as statSync12,
22539
+ statSync as statSync13,
22274
22540
  writeFileSync as writeFileSync14
22275
22541
  } from "fs";
22276
22542
  import { basename as basename7, dirname as dirname20, join as join47 } from "path";
@@ -22301,7 +22567,7 @@ async function assemble(planDir, chunkOutputs, audioPath, outputPath, options) {
22301
22567
  outputPath,
22302
22568
  durationMs: Date.now() - start,
22303
22569
  framesEncoded: plan2.totalFrames,
22304
- fileSize: statSync12(outputPath).size
22570
+ fileSize: statSync13(outputPath).size
22305
22571
  };
22306
22572
  }
22307
22573
  const format = plan2.dimensions.format;
@@ -22348,7 +22614,7 @@ async function assemble(planDir, chunkOutputs, audioPath, outputPath, options) {
22348
22614
  });
22349
22615
  }
22350
22616
  }
22351
- const fileSize = existsSync32(outputPath) ? statSync12(outputPath).size : 0;
22617
+ const fileSize = existsSync32(outputPath) ? statSync13(outputPath).size : 0;
22352
22618
  return {
22353
22619
  ...referenceBackgroundResult(plan2[REFERENCE_BACKGROUND_FIELD]),
22354
22620
  outputPath,
@@ -22546,7 +22812,7 @@ function mergePngFrameDirs(chunkPaths, outputPath, totalFrames, audioPath, start
22546
22812
  mkdirSync20(outputPath, { recursive: true });
22547
22813
  let globalIdx = 0;
22548
22814
  for (const chunkDir of chunkPaths) {
22549
- if (!statSync12(chunkDir).isDirectory()) {
22815
+ if (!statSync13(chunkDir).isDirectory()) {
22550
22816
  throw new Error(
22551
22817
  `[assemble] png-sequence chunk must be a directory: ${chunkDir} (got a file)`
22552
22818
  );
@@ -22573,7 +22839,7 @@ function mergePngFrameDirs(chunkPaths, outputPath, totalFrames, audioPath, start
22573
22839
  let fileSize = 0;
22574
22840
  for (const name of readdirSync12(outputPath)) {
22575
22841
  try {
22576
- fileSize += statSync12(join47(outputPath, name)).size;
22842
+ fileSize += statSync13(join47(outputPath, name)).size;
22577
22843
  } catch {
22578
22844
  }
22579
22845
  }
@@ -22618,9 +22884,9 @@ async function assembleV2(planV2Dir, chunkPaths, outputPath, options) {
22618
22884
  }
22619
22885
 
22620
22886
  // ../producer/src/services/distributed/projectHash.ts
22621
- import { closeSync as closeSync7, openSync as openSync7, readdirSync as readdirSync13, readSync as readSync5, realpathSync as realpathSync2, statSync as statSync13 } from "fs";
22887
+ import { closeSync as closeSync7, openSync as openSync7, readdirSync as readdirSync13, readSync as readSync5, realpathSync as realpathSync2, statSync as statSync14 } from "fs";
22622
22888
  import { createHash as createHash8 } from "crypto";
22623
- import { join as join49 } from "path";
22889
+ import { join as join49, sep as sep6 } from "path";
22624
22890
  var READ_CHUNK_BYTES = 256 * 1024;
22625
22891
 
22626
22892
  // ../producer/src/services/distributed/audioSidecar.ts