hyperframes 0.9.58 → 0.9.61

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 (365) hide show
  1. package/bin/hyperframes.mjs +3 -1
  2. package/dist/{add-JQUKPSEZ.js → add-LNPIKHAX.js} +33 -32
  3. package/dist/{agentPromptGenerator-3NEY7FPP.js → agentPromptGenerator-N3HL4JWM.js} +19 -20
  4. package/dist/{animatedGifPrep-VMUZ6IVJ.js → animatedGifPrep-SEPXIM4W.js} +24 -24
  5. package/dist/api.d.ts +8 -1
  6. package/dist/api.js +70 -69
  7. package/dist/{appHistory-JNI6IOR6.js → appHistory-ASGUPUUV.js} +6 -6
  8. package/dist/{asset-ZT3VXZ67.js → asset-3L2G3ROU.js} +17 -7
  9. package/dist/{assetCataloger-D2DV65BA.js → assetCataloger-3D75A6GI.js} +21 -22
  10. package/dist/{audio-LD5H2R5V.js → audio-U4W5ZWQ7.js} +54 -53
  11. package/dist/{auth-4FPYYMSH.js → auth-V4G5ZE3P.js} +4 -4
  12. package/dist/{autoUpdate-5ZKSFCG4.js → autoUpdate-QYKF3DDS.js} +6 -6
  13. package/dist/{avatars-DCLFE7VG.js → avatars-SB2XCDWJ.js} +31 -32
  14. package/dist/{backgroundChecks-UZA3F46H.js → backgroundChecks-KHBYRE6J.js} +16 -9
  15. package/dist/backgroundChecksWorker.js +9 -9
  16. package/dist/{batchRender-TAUW3CT2.js → batchRender-6S5GMICZ.js} +13 -14
  17. package/dist/{beats-X3LCR6OG.js → beats-7YLYCCMD.js} +21 -22
  18. package/dist/{benchmark-DNZQT3YQ.js → benchmark-IBX7ZWVU.js} +37 -35
  19. package/dist/{billing-4BFUAHWX.js → billing-EAHOGMQW.js} +28 -29
  20. package/dist/{browser-5J2MTDB6.js → browser-XKYRXDJW.js} +23 -24
  21. package/dist/{bundleWithLocalizedFonts-XWK47ZVF.js → bundleWithLocalizedFonts-ZFX7TSWT.js} +1 -1
  22. package/dist/{capture-TVYTKWTG.js → capture-4WKQKMXG.js} +38 -17
  23. package/dist/{capture-2YSVFKWV.js → capture-IBOCZ2MK.js} +56 -50
  24. package/dist/{captureCompositionFrame-L765HLCT.js → captureCompositionFrame-HZA3LNU3.js} +29 -30
  25. package/dist/{captureFile-DOCK42K3.js → captureFile-Z7HQDRC2.js} +4 -4
  26. package/dist/captureProxy-4K3J652A.js +23 -0
  27. package/dist/{catalog-CHGGRRQX.js → catalog-TSXQTLKM.js} +45 -43
  28. package/dist/{catch-up-OCFU6ZR3.js → catch-up-LD2B5CE3.js} +35 -29
  29. package/dist/{check-LWK4Z7FI.js → check-TEZKUD26.js} +72 -72
  30. package/dist/{checkAudio-R5ORBXBO.js → checkAudio-3GM74ZGV.js} +22 -23
  31. package/dist/{checkBrowser-6SH73T47.js → checkBrowser-OFH3I7Q6.js} +62 -62
  32. package/dist/{chunk-2WA62M3B.js → chunk-22B53HD3.js} +10 -5
  33. package/dist/{chunk-K2EJQ44S.js → chunk-2CNVJQKU.js} +1 -1
  34. package/dist/{chunk-XMT4MG6W.js → chunk-2H4SJSUS.js} +14 -14
  35. package/dist/{chunk-6RPKPL22.js → chunk-2SPQTJA2.js} +25 -23
  36. package/dist/{chunk-GIVMQDSK.js → chunk-32H642MS.js} +2 -2
  37. package/dist/chunk-3GF72UPC.js +256 -0
  38. package/dist/chunk-3HJX4F2S.js +39 -0
  39. package/dist/{chunk-VXE46PXX.js → chunk-3JVTHNDH.js} +1 -1
  40. package/dist/{chunk-H3LEOZVK.js → chunk-3ROFCQAW.js} +1 -1
  41. package/dist/{chunk-NLVIE7VN.js → chunk-3W2ORSFV.js} +4 -4
  42. package/dist/{chunk-4QPT3IEL.js → chunk-4AMOVEV7.js} +181 -59
  43. package/dist/{chunk-A4L7G74T.js → chunk-4EWS3KP3.js} +3 -3
  44. package/dist/{chunk-AJ7YRQS4.js → chunk-4ORH2OXS.js} +2 -2
  45. package/dist/{chunk-2GRCLLKU.js → chunk-4SDNEKTL.js} +4 -4
  46. package/dist/{chunk-CDNVZEGQ.js → chunk-4T45V6GF.js} +5 -2
  47. package/dist/{chunk-GDIBE57N.js → chunk-4ZLWEPK4.js} +2 -2
  48. package/dist/{chunk-CRPLPK6J.js → chunk-5F2ULLFW.js} +7 -7
  49. package/dist/{chunk-O5U3Y5DX.js → chunk-5GUYYSVT.js} +1 -1
  50. package/dist/{chunk-EOXNEA4Z.js → chunk-5RM7274K.js} +21 -9
  51. package/dist/{chunk-E4IR34CF.js → chunk-5T2LNQAH.js} +58 -20
  52. package/dist/{chunk-M5TTYUZM.js → chunk-5ZAM42GH.js} +6 -6
  53. package/dist/{chunk-5IE5ZI66.js → chunk-62UUXB3F.js} +1 -1
  54. package/dist/{chunk-A4YRESMH.js → chunk-63CSQYYO.js} +2 -2
  55. package/dist/{chunk-R4EWRIDL.js → chunk-6B2TH52B.js} +8 -1
  56. package/dist/{chunk-X3IVUSOX.js → chunk-6KU6TCSS.js} +3 -3
  57. package/dist/{chunk-DHVRVI7F.js → chunk-6NDSDQCR.js} +62 -27
  58. package/dist/{chunk-O4K22EFS.js → chunk-6OKMCIDU.js} +24 -14
  59. package/dist/{chunk-D3M5VOC5.js → chunk-6P7FLYOR.js} +55 -125
  60. package/dist/{chunk-JQZ5WP7L.js → chunk-6R22Y26Z.js} +1 -1
  61. package/dist/{chunk-2SJNGWSY.js → chunk-6X2CLRU7.js} +1 -1
  62. package/dist/{chunk-PYTF6VHF.js → chunk-6ZU654EU.js} +3 -3
  63. package/dist/{chunk-G3U5CUF3.js → chunk-73NC557V.js} +2 -2
  64. package/dist/{chunk-7WAWUQDQ.js → chunk-7463BOQJ.js} +4 -4
  65. package/dist/{chunk-4N3WOFP3.js → chunk-7AP5C4C2.js} +19 -19
  66. package/dist/{chunk-FFOFGL2O.js → chunk-7DMES2F3.js} +2 -2
  67. package/dist/{chunk-Y6CZFX5X.js → chunk-7GDEQJSL.js} +28 -19
  68. package/dist/{chunk-ECGNWHFE.js → chunk-A2ZUVULS.js} +88 -2
  69. package/dist/{chunk-CNAOJ7XI.js → chunk-A7NRMVUG.js} +1 -1
  70. package/dist/{chunk-TLGQQ324.js → chunk-ADQ7XZE5.js} +11 -9
  71. package/dist/{chunk-M3IHARIW.js → chunk-B5JWBMDR.js} +102 -40
  72. package/dist/{chunk-7ZHBY7T5.js → chunk-B5TLZC2D.js} +11 -4
  73. package/dist/{chunk-DH3M5X3Y.js → chunk-BAU3ASNM.js} +4 -4
  74. package/dist/{chunk-ELRE6LVJ.js → chunk-BHZZM2PK.js} +5 -5
  75. package/dist/chunk-BNH2IKGV.js +5101 -0
  76. package/dist/{chunk-ROESFEBP.js → chunk-BNO5RN55.js} +74 -66
  77. package/dist/{chunk-EWKJDXH6.js → chunk-C2GAAMZ3.js} +4 -4
  78. package/dist/{chunk-OMZSPAK5.js → chunk-C7IEAEKF.js} +1 -1
  79. package/dist/{chunk-ZFOV3R2L.js → chunk-CAAUQUCW.js} +23 -9
  80. package/dist/{chunk-CPDPSNSB.js → chunk-CPHK3XMF.js} +7 -7
  81. package/dist/{chunk-NJPLH762.js → chunk-CPLVXXRS.js} +4 -4
  82. package/dist/{chunk-AMS7Q7P7.js → chunk-CRX444MF.js} +22 -21
  83. package/dist/{chunk-4LZSNWFJ.js → chunk-CRZ7FUMI.js} +3 -3
  84. package/dist/{chunk-VI2LLFW6.js → chunk-CSWJCRDU.js} +2 -2
  85. package/dist/{chunk-37Y334MN.js → chunk-CT54FOTS.js} +18 -14
  86. package/dist/{chunk-CGODFJZ7.js → chunk-CYM53TWZ.js} +32 -18
  87. package/dist/chunk-D37I36FY.js +21 -0
  88. package/dist/{chunk-LO5USUM4.js → chunk-DD37XZVE.js} +1 -1
  89. package/dist/{chunk-OD7XWF5T.js → chunk-DWGDP537.js} +12 -6
  90. package/dist/chunk-EDH2DMXM.js +113 -0
  91. package/dist/{chunk-TAXMLPTE.js → chunk-ENKXJNKX.js} +2 -2
  92. package/dist/{chunk-UJTLTFB6.js → chunk-ERYGKPIR.js} +1 -1
  93. package/dist/{chunk-HOIEN7O4.js → chunk-F6PI5O3H.js} +3 -1
  94. package/dist/{chunk-GVIJFPZV.js → chunk-FLJ4S7NA.js} +2 -2
  95. package/dist/{chunk-KYKQO4VN.js → chunk-FU62NEWC.js} +3 -3
  96. package/dist/{chunk-MPC3OODR.js → chunk-G7HO2FFX.js} +4 -4
  97. package/dist/chunk-GADMF4BL.js +170 -0
  98. package/dist/{chunk-DWFWF6IR.js → chunk-GNRC4L6F.js} +34 -242
  99. package/dist/{chunk-BSFTB6AM.js → chunk-GYPZTG46.js} +12 -6
  100. package/dist/{chunk-OL7RHRNJ.js → chunk-H4HYZUE3.js} +2 -2
  101. package/dist/{chunk-V3O4AFO3.js → chunk-H6Y4XOSP.js} +17 -15
  102. package/dist/{chunk-PGITR2WX.js → chunk-HAMPVCRY.js} +4 -4
  103. package/dist/{chunk-677JGYQL.js → chunk-HLVNKNSW.js} +1 -0
  104. package/dist/{chunk-HFIVZJJD.js → chunk-HTHLFEO2.js} +1 -1
  105. package/dist/{chunk-SM5PNCDI.js → chunk-ICZWQNBR.js} +2 -2
  106. package/dist/{chunk-HTGJOOXE.js → chunk-IIXSSRUR.js} +4 -4
  107. package/dist/{chunk-GEOJA37C.js → chunk-ILKK6F5E.js} +3 -3
  108. package/dist/{chunk-IHXMN5YH.js → chunk-IOWECUEU.js} +2 -2
  109. package/dist/{chunk-SE4NOUB6.js → chunk-IT2YUKYY.js} +5 -5
  110. package/dist/chunk-IU6AC3WL.js +125 -0
  111. package/dist/{chunk-IGZQYMZA.js → chunk-J56ZJFSF.js} +303 -123
  112. package/dist/{chunk-5SGGOZNL.js → chunk-KBEC6VQS.js} +595 -206
  113. package/dist/{chunk-WEU6WLVT.js → chunk-KTY46LIH.js} +8 -4
  114. package/dist/chunk-KUJJJBV2.js +211 -0
  115. package/dist/{chunk-CHCMXYER.js → chunk-KVIXXJLO.js} +1 -1
  116. package/dist/{chunk-XYP4T6TQ.js → chunk-KYZEK7QF.js} +5 -5
  117. package/dist/{chunk-UGKUGYHD.js → chunk-L7MFHIG7.js} +5 -2
  118. package/dist/{chunk-YTHXSYYB.js → chunk-LB6ZAP4I.js} +19 -11
  119. package/dist/{chunk-SV72WLBE.js → chunk-LGIWC6KN.js} +28 -15
  120. package/dist/{chunk-ADVVQX4I.js → chunk-LMNCEQCC.js} +4 -2
  121. package/dist/{chunk-VLFBOKZX.js → chunk-LTXZLTXW.js} +304 -234
  122. package/dist/{chunk-WJIWXHXK.js → chunk-LULZFFDN.js} +3 -3
  123. package/dist/{chunk-CGJIMWNU.js → chunk-LV2ETFC5.js} +5 -5
  124. package/dist/{chunk-DL6PEJWH.js → chunk-LYTELQL2.js} +2 -4
  125. package/dist/{chunk-W2OXNTHG.js → chunk-LZSSGF7G.js} +3 -3
  126. package/dist/chunk-MERWX4DZ.js +159 -0
  127. package/dist/{chunk-CVTIGS5K.js → chunk-MJBBKSKB.js} +1 -1
  128. package/dist/{chunk-5IUVWP3A.js → chunk-MPVJI4SE.js} +2 -2
  129. package/dist/{chunk-7WYJXKIG.js → chunk-MPX3FO4A.js} +5 -5
  130. package/dist/{chunk-ERDQIRUL.js → chunk-MQCIX6O2.js} +20 -10
  131. package/dist/{chunk-ZO5NHAF3.js → chunk-MTCVUAUK.js} +10 -4
  132. package/dist/{chunk-E26Z73S3.js → chunk-MTKXKULM.js} +2 -2
  133. package/dist/{chunk-MCDNAIFF.js → chunk-NGRWDXRZ.js} +1 -1
  134. package/dist/{chunk-FNXU56VT.js → chunk-NK2UW3WR.js} +1 -1
  135. package/dist/{chunk-PS7WBIPK.js → chunk-NOJRZCN3.js} +33 -18
  136. package/dist/{chunk-JOOKM2NC.js → chunk-NU7BEOCX.js} +3 -3
  137. package/dist/chunk-NY6E4272.js +112 -0
  138. package/dist/{chunk-JZVI2TMX.js → chunk-OBP5WNKP.js} +3 -3
  139. package/dist/{chunk-AM4Y3XMR.js → chunk-OGOR22GY.js} +4 -4
  140. package/dist/{chunk-D2LIT7UR.js → chunk-OH3MUFZG.js} +1 -1
  141. package/dist/{chunk-DX5Y3L5B.js → chunk-OPUR2XQ2.js} +6 -6
  142. package/dist/{chunk-SYKUNH25.js → chunk-OW6MOJSR.js} +59 -7
  143. package/dist/{chunk-XCJ2YYMV.js → chunk-P5M3IEXO.js} +1 -1
  144. package/dist/{chunk-D2LSYXLW.js → chunk-PAHTZDMZ.js} +1 -1
  145. package/dist/{chunk-OSKSTJNQ.js → chunk-PJQVJSMG.js} +21 -12
  146. package/dist/{chunk-72GTIFAI.js → chunk-POVOGRMU.js} +2 -2
  147. package/dist/{chunk-U5MILT4G.js → chunk-PPETKAEO.js} +1 -1
  148. package/dist/{chunk-ZLTB7ZCQ.js → chunk-PQ2OPPGP.js} +8 -4
  149. package/dist/chunk-PTGNUVCB.js +112 -0
  150. package/dist/{chunk-X6JUUQCM.js → chunk-Q4FVSYTD.js} +5 -2
  151. package/dist/{chunk-MYETYFDI.js → chunk-Q7IOMZ5X.js} +2 -2
  152. package/dist/{chunk-GRSZAGJB.js → chunk-R2LBMDYH.js} +2 -2
  153. package/dist/{chunk-QBN2W4T3.js → chunk-RC2DDVX5.js} +1 -1
  154. package/dist/{chunk-VSM7OIG2.js → chunk-RDJOA5MM.js} +2 -2
  155. package/dist/{chunk-OEGWTN6N.js → chunk-RF3DT4CS.js} +1 -1
  156. package/dist/{chunk-WGHJUGNU.js → chunk-RJCQZMNI.js} +10 -10
  157. package/dist/{chunk-B2WXMYMA.js → chunk-RPICLHBJ.js} +1 -1
  158. package/dist/{chunk-7ECPFKQV.js → chunk-RRI7NGQZ.js} +37 -13
  159. package/dist/{chunk-X3UXEB2U.js → chunk-RSYV6NNI.js} +2 -2
  160. package/dist/{chunk-6EMFSRTW.js → chunk-S35RUNXJ.js} +7 -0
  161. package/dist/{chunk-QGQCWG7F.js → chunk-SCEBICAQ.js} +2 -2
  162. package/dist/{chunk-JKLWQUSV.js → chunk-SDIQEPAR.js} +1 -1
  163. package/dist/{chunk-3VMZQQUI.js → chunk-SIQGTRZ5.js} +1 -1
  164. package/dist/{chunk-N6PAWR5C.js → chunk-SQI2MWJE.js} +5 -5
  165. package/dist/{chunk-BSDUTNFX.js → chunk-SYMLVFQF.js} +1 -1
  166. package/dist/{chunk-XMAU5ZQX.js → chunk-TFAKFI3R.js} +1 -1
  167. package/dist/{chunk-SNKBI4YB.js → chunk-TJAFCC37.js} +9 -9
  168. package/dist/{chunk-6T4PB35F.js → chunk-TRQDC2UC.js} +9 -2
  169. package/dist/{chunk-4NNYYCJN.js → chunk-TRVWLAQ3.js} +25 -21
  170. package/dist/{chunk-UDLWVQ74.js → chunk-TTRX7NM3.js} +35 -21
  171. package/dist/{chunk-66W5IWLO.js → chunk-U7M4SZUB.js} +13 -2
  172. package/dist/{chunk-TLDIP7Y3.js → chunk-UEJMLVGW.js} +16 -17
  173. package/dist/{chunk-ZAWQJOTW.js → chunk-UX5KLSAJ.js} +74 -76
  174. package/dist/{chunk-O2BLY7PO.js → chunk-VJVTGSGW.js} +1 -1
  175. package/dist/{chunk-IE6BIB3L.js → chunk-VM2VBJRC.js} +34 -3
  176. package/dist/{chunk-AM6UYKVR.js → chunk-VNWPHKKI.js} +11 -11
  177. package/dist/{chunk-WQZQMADW.js → chunk-VRUVJTFW.js} +244 -28
  178. package/dist/{chunk-37VS6QY6.js → chunk-VSS3OAZB.js} +1 -1
  179. package/dist/{chunk-H7DTMLAR.js → chunk-VZM7AFUH.js} +39 -24
  180. package/dist/{chunk-WLNHZ2OM.js → chunk-W772ZFTE.js} +21 -6
  181. package/dist/{chunk-3GKGBYW3.js → chunk-WTO3A7ET.js} +120 -9
  182. package/dist/{chunk-ALD7JBPV.js → chunk-WTS245RC.js} +2 -2
  183. package/dist/{chunk-VBEDZGBW.js → chunk-WTUDKVWQ.js} +74 -19
  184. package/dist/{chunk-OPSGEOCO.js → chunk-WVCCSYZC.js} +53 -31
  185. package/dist/{chunk-ZCLC3KVY.js → chunk-X3NGTIE3.js} +1 -1
  186. package/dist/{chunk-RV3HR3BZ.js → chunk-XLG3JMSS.js} +9 -9
  187. package/dist/{chunk-ZYNNZ5DE.js → chunk-Y53Z2M77.js} +2 -2
  188. package/dist/{chunk-O2INZCGB.js → chunk-YB2ZJJFJ.js} +1 -1
  189. package/dist/{chunk-J6VYWZSO.js → chunk-YLC67YFR.js} +1 -1
  190. package/dist/{chunk-6LU6JICP.js → chunk-YWUE4CRU.js} +96 -9
  191. package/dist/chunk-Z3BPDCRV.js +537 -0
  192. package/dist/{chunk-I6V25IXG.js → chunk-Z55ASKZE.js} +2 -2
  193. package/dist/{chunk-EZJHKHWU.js → chunk-ZBDITGMP.js} +3 -3
  194. package/dist/{chunk-MSC5KBCE.js → chunk-ZGSGBGTB.js} +32 -24
  195. package/dist/{clean-6ODSABBF.js → clean-RJKQ23WH.js} +46 -46
  196. package/dist/cli.js +120 -77
  197. package/dist/{cloud-IMYQB5RC.js → cloud-R3NQSUTQ.js} +4 -4
  198. package/dist/{cloud-NTKLXMBS.js → cloud-VUR3ZO6O.js} +10 -10
  199. package/dist/{cloudrun-JNLDP33J.js → cloudrun-SZYAYV7N.js} +24 -16
  200. package/dist/{compare-VLYZ6ZS4.js → compare-AO5VJBJW.js} +79 -100
  201. package/dist/{compiler-7M2UCEWG.js → compiler-65SP7M2P.js} +9 -10
  202. package/dist/{component-KMUHKZ4R.js → component-WGTPAIKX.js} +23 -9
  203. package/dist/{compositions-ESLWNOMS.js → compositions-HWM6DNJA.js} +28 -29
  204. package/dist/{contactSheet-4YF7U6U7.js → contactSheet-ROUVWDRO.js} +7 -7
  205. package/dist/{curve-7RPSNRPE.js → curve-PLPTMDS4.js} +27 -28
  206. package/dist/{cuts-KBAAZSPS.js → cuts-T5GYTDUA.js} +28 -29
  207. package/dist/{delete-EP5Z7HKF.js → delete-6WE3N3VO.js} +33 -21
  208. package/dist/{deploy-MVR63JLD.js → deploy-GYY6CYQD.js} +14 -13
  209. package/dist/{describeProject-NBVZT5EN.js → describeProject-UQQ2GGIX.js} +19 -20
  210. package/dist/{destroy-DQKIT574.js → destroy-WSGREGAG.js} +14 -13
  211. package/dist/{deterministicFonts-LYBMXXBW.js → deterministicFonts-JER4GPCM.js} +7 -7
  212. package/dist/{diff-RI3FTMOZ.js → diff-JQBZUPKG.js} +305 -114
  213. package/dist/{dist-LRGTXDSM.js → dist-6EF2P3P7.js} +6 -5
  214. package/dist/{dist-G7VFX23I.js → dist-HF753IX4.js} +12 -10
  215. package/dist/{dist-TOOMD57O.js → dist-JRJHFP27.js} +24 -24
  216. package/dist/{docs-YTM4NX2R.js → docs-3OAPSKPG.js} +1 -1
  217. package/dist/{doctor-43YNRCRB.js → doctor-SPJ5AJKX.js} +31 -32
  218. package/dist/{dotEnv-RZ52L7X3.js → dotEnv-7JWLJ2TG.js} +11 -3
  219. package/dist/{energy-YCH36KCC.js → energy-KPDVIZ5D.js} +28 -29
  220. package/dist/{events-VUR27EF6.js → events-4WAMG3JE.js} +15 -16
  221. package/dist/{events-6RJBITYN.js → events-P4223ZZZ.js} +30 -31
  222. package/dist/{events-JCPYG3CD.js → events-XON5I7VU.js} +9 -9
  223. package/dist/{execute-OXMKWIFI.js → execute-CN5FLBYU.js} +57 -53
  224. package/dist/{extract-XGD2RDEX.js → extract-ABSBKYYH.js} +29 -30
  225. package/dist/{face-XCNWNTGN.js → face-PLPQ5335.js} +29 -30
  226. package/dist/{feedback-JNFDVBFV.js → feedback-QPQ4G72X.js} +70 -44
  227. package/dist/{ffmpeg-YQLAJUEA.js → ffmpeg-F3XK57IP.js} +19 -20
  228. package/dist/{figma-XXGHYEB3.js → figma-S5CVANVZ.js} +3 -3
  229. package/dist/fontLocalizeCli.js +29 -29
  230. package/dist/{frames-PEMWFRRY.js → frames-F4QEQB4V.js} +30 -31
  231. package/dist/{generate-H5M4QSJR.js → generate-O3OPOCHP.js} +46 -47
  232. package/dist/{get-R6Y2OE5P.js → get-P7LQ7U22.js} +29 -17
  233. package/dist/{gpuPolicy-2WVDQYZA.js → gpuPolicy-JPRDRQWU.js} +18 -19
  234. package/dist/{grade-compare-KFXPZFDL.js → grade-compare-6UZ6SK4J.js} +61 -61
  235. package/dist/hangReport.js +2 -2
  236. package/dist/{heifImagePrep-VLKYA5QZ.js → heifImagePrep-3PDFNYIE.js} +25 -25
  237. package/dist/{help-T3XUX5RI.js → help-DLOCAL7E.js} +1 -1
  238. package/dist/{history-QJPUCUUC.js → history-YIJVOGH7.js} +29 -30
  239. package/dist/hyperframe.manifest.json +1 -1
  240. package/dist/hyperframe.runtime.iife.js +64 -64
  241. package/dist/hyperframes-player.global.js +14 -6
  242. package/dist/{info-556DHJHJ.js → info-FVYJNNQL.js} +33 -34
  243. package/dist/{init-P62TPWR3.js → init-V45K4VAG.js} +54 -53
  244. package/dist/{ink-SRN65OZH.js → ink-P72OB7L4.js} +28 -29
  245. package/dist/{inspect-U5FWQQFB.js → inspect-3W2IG3JF.js} +63 -59
  246. package/dist/{installer-3TNMANQV.js → installer-QGDTFTDU.js} +11 -12
  247. package/dist/{keyframes-FPGEFGCH.js → keyframes-57OPHIR2.js} +111 -49
  248. package/dist/{lambda-YJY2MYWL.js → lambda-EQZS7UMO.js} +40 -33
  249. package/dist/{layout-QIKSVA44.js → layout-KSWMO6MH.js} +63 -61
  250. package/dist/{lint-RD33ESM5.js → lint-WIYBGVF2.js} +23 -24
  251. package/dist/{lintProject-ZWLXB3A2.js → lintProject-N3UN6HEE.js} +6 -5
  252. package/dist/{list-FFO3WOB2.js → list-3FQAHEE2.js} +32 -20
  253. package/dist/{localPage-DHIBMNJH.js → localPage-G2QEA7JL.js} +19 -20
  254. package/dist/{login-IMFRQOEQ.js → login-C3U6WSHF.js} +10 -10
  255. package/dist/{logout-SLBKP67J.js → logout-525LWS6J.js} +5 -5
  256. package/dist/{look-ZZHJYSPC.js → look-U5LWOI4H.js} +28 -29
  257. package/dist/{manager-U4WEPCLV.js → manager-C5S25OOK.js} +7 -7
  258. package/dist/{manager-V4LGD4HB.js → manager-ZVYDWLHI.js} +21 -22
  259. package/dist/{measure-ZRBVN45B.js → measure-R2KZIHXT.js} +11 -11
  260. package/dist/{media-treatment-3I2CMQJZ.js → media-treatment-FAW5ZLT7.js} +37 -36
  261. package/dist/{media-use-2OYJ3CCN.js → media-use-CPTT2ZDE.js} +14 -10
  262. package/dist/{models-PRW7EWSV.js → models-53JHNGSL.js} +31 -32
  263. package/dist/{motionShot-VWILMLHQ.js → motionShot-K5ZHHHE6.js} +33 -34
  264. package/dist/{normalize-PGMS24I2.js → normalize-TBACWMEK.js} +4 -1
  265. package/dist/{normalize-audio-42XMF35K.js → normalize-audio-EOO2ORPP.js} +25 -25
  266. package/dist/{oauth-V3HSFZRE.js → oauth-E5QBYYTX.js} +2 -2
  267. package/dist/{open-D52MJZQA.js → open-3YABRCER.js} +34 -35
  268. package/dist/{parakeetRunner-ZR2JWQZH.js → parakeetRunner-TLZC2WAJ.js} +31 -32
  269. package/dist/{pipeline-W3H4JA6H.js → pipeline-LZ73CHLB.js} +27 -26
  270. package/dist/{plan-2HQOFJO7.js → plan-3QQZ57IC.js} +38 -39
  271. package/dist/{play-G5XDRDIZ.js → play-ESWP4SF2.js} +53 -50
  272. package/dist/{policies-5RUNO47I.js → policies-XG6OTGQC.js} +2 -2
  273. package/dist/{preflight-W2JDYF3T.js → preflight-7G5OBMAA.js} +22 -23
  274. package/dist/{present-CYMTHQFM.js → present-5ER4JKR5.js} +45 -44
  275. package/dist/{preview-DTQPQZTK.js → preview-62XOVSXM.js} +61 -60
  276. package/dist/privateProjectFile-6NPNZXK3.js +65 -0
  277. package/dist/{probe-WZJK3YQI.js → probe-CFOGEVFU.js} +28 -29
  278. package/dist/{producer-2BSMSO6I.js → producer-LLE32VVO.js} +1 -1
  279. package/dist/{progress-KRDVC24C.js → progress-PT3NAFVP.js} +6 -5
  280. package/dist/{projectConfig-BYRVYLCC.js → projectConfig-R54UDB5Y.js} +14 -15
  281. package/dist/{prompts-7VQEH645.js → prompts-XC3IBT4D.js} +2 -2
  282. package/dist/{publicNetwork-GW7SVP7N.js → publicNetwork-66HWFKYG.js} +3 -1
  283. package/dist/{publication-UCFJLELD.js → publication-TOBV6M4Q.js} +8 -9
  284. package/dist/{publish-KXVPSWCO.js → publish-QVNH5PXC.js} +107 -76
  285. package/dist/receivedRecordFollow-U43DTVLP.js +54 -0
  286. package/dist/{refresh-2GVNKDQE.js → refresh-HK4YEHWC.js} +5 -5
  287. package/dist/{remove-background-O7BZNS3X.js → remove-background-XHE6JL35.js} +31 -30
  288. package/dist/{render-TYS3LCIQ.js → render-7JJ2DFEB.js} +16 -15
  289. package/dist/{render-QOWXGWQZ.js → render-GRZMK6ET.js} +143 -100
  290. package/dist/{render-DGAP4Q2Z.js → render-WK3D5VOW.js} +173 -138
  291. package/dist/{render-batch-TEQRGAUC.js → render-batch-KFEZFJXB.js} +20 -18
  292. package/dist/renderSetupWorker.js +23 -13
  293. package/dist/{resolver-RN2JGGQL.js → resolver-N4U52UK5.js} +11 -12
  294. package/dist/{reverse-FUARFEG2.js → reverse-6AOA3PXF.js} +1 -1
  295. package/dist/{run-V722HMUG.js → run-M2J3ZJ3W.js} +14 -14
  296. package/dist/runtimeVersion.js +6 -1
  297. package/dist/{sam-KHLM2DJA.js → sam-O7Y2CCK3.js} +5 -5
  298. package/dist/{screenshotCapture-4BB4LUMX.js → screenshotCapture-UXJZ7D3L.js} +21 -22
  299. package/dist/{service-ZPCHJY6B.js → service-DBNZZLPU.js} +31 -31
  300. package/dist/{share-PXUN7AH7.js → share-6P7S3USP.js} +36 -36
  301. package/dist/{sherpa-LT6Y7IGM.js → sherpa-CXEHEVAJ.js} +30 -31
  302. package/dist/sherpaWorker.js +6 -6
  303. package/dist/{sites-WWCABDSX.js → sites-R5F5FNAL.js} +9 -6
  304. package/dist/skills/hyperframes/scripts/locate.mjs +13 -19
  305. package/dist/skills/hyperframes-cli/references/lambda.md +1 -1
  306. package/dist/skills/media-use/audio/references/tts-to-captions.md +1 -1
  307. package/dist/skills/media-use/audio/references/tts.md +6 -6
  308. package/dist/skills/media-use/audio/scripts/lib/heygen.mjs +143 -2
  309. package/dist/skills/media-use/audio/scripts/lib/tts.mjs +12 -2
  310. package/dist/skills/media-use/scripts/lib/candidates.mjs +3 -2
  311. package/dist/skills/media-use/scripts/lib/credit-limit.d.mts +1 -1
  312. package/dist/skills/media-use/scripts/lib/credit-limit.mjs +14 -9
  313. package/dist/skills/media-use/scripts/lib/terminal-text.d.mts +1 -0
  314. package/dist/skills/media-use/scripts/lib/terminal-text.mjs +12 -0
  315. package/dist/skills/media-use/scripts/resolve.mjs +21 -15
  316. package/dist/{skills-G63W5GD5.js → skills-RMIHFNI6.js} +21 -22
  317. package/dist/{skillsUpdateCheck-2T3JVDAA.js → skillsUpdateCheck-EHOSL2AC.js} +7 -7
  318. package/dist/{snapshot-EVSKTVDG.js → snapshot-DQK3P7TF.js} +114 -90
  319. package/dist/{src-K5FSMLTB.js → src-4INHWM6L.js} +29 -29
  320. package/dist/{src-R57EQQSI.js → src-BNSCFKOD.js} +25 -22
  321. package/dist/{start-XBCYKGBV.js → start-KPCEUG5K.js} +52 -45
  322. package/dist/{state-FO64CPYE.js → state-5LE7AN6F.js} +6 -5
  323. package/dist/{staticProjectServer-Q6VR7CXT.js → staticProjectServer-VCS4TOU2.js} +37 -37
  324. package/dist/{status-E5XIWRCQ.js → status-WBNQSG4H.js} +31 -32
  325. package/dist/studio/assets/hyperframes-player-Cm0hYGm2.js +573 -0
  326. package/dist/studio/assets/{index-D7ICtobF.js → index-BGrNWeLK.js} +199 -199
  327. package/dist/studio/assets/{index-ww7-RmuM.js → index-REqr_dLu.js} +1 -1
  328. package/dist/studio/assets/{pausedVideoDecoder-Dbe8Cmab.js → pausedVideoDecoder-DqLDSq8J.js} +1 -1
  329. package/dist/studio/index.html +1 -1
  330. package/dist/{studio-api-GMJVYGET.js → studio-api-RAW4CIPR.js} +24 -24
  331. package/dist/{studioSelectionClient-S46TNAAZ.js → studioSelectionClient-PLBQBLCJ.js} +2 -2
  332. package/dist/{studioServer-MIQCMK6U.js → studioServer-5PWBZADN.js} +357 -163
  333. package/dist/subCompositionWorker.js +62 -55
  334. package/dist/{sync-WJOFN6VN.js → sync-PM2WLBUC.js} +28 -29
  335. package/dist/{synthesize-FXM7ZD6J.js → synthesize-NGU4DRKC.js} +24 -14
  336. package/dist/{system-DBUN5UDD.js → system-PKL4Y4MX.js} +3 -3
  337. package/dist/{telemetry-HZ4P4DMC.js → telemetry-4BST73P2.js} +15 -16
  338. package/dist/{telemetry-M722DCXI.js → telemetry-UC4MSMG3.js} +1 -1
  339. package/dist/{templates-KFZZSSKW.js → templates-G3XOWYXG.js} +36 -31
  340. package/dist/{timeline-5M6DPCXF.js → timeline-E6ZXYGQR.js} +50 -46
  341. package/dist/{tokens-H4NPNRFR.js → tokens-KRHXM44C.js} +17 -7
  342. package/dist/{transcribe-6STI2ALX.js → transcribe-RJ3GOCJL.js} +56 -57
  343. package/dist/{transcribe-7PE5UH7J.js → transcribe-TKV3POYD.js} +26 -27
  344. package/dist/{tts-D7CLD3AD.js → tts-EPXRE275.js} +26 -10
  345. package/dist/{update-H3T3AVVG.js → update-TO7MLJCS.js} +23 -24
  346. package/dist/{updateCheck-TLCXUNBV.js → updateCheck-5AY447D5.js} +6 -6
  347. package/dist/{upgrade-BZVTMCQU.js → upgrade-BLZWWXYL.js} +11 -11
  348. package/dist/{urlDownloader-FJXNC3IM.js → urlDownloader-ME67HQ4O.js} +17 -18
  349. package/dist/{validate-WTRVCEL5.js → validate-SRBV5NFV.js} +53 -49
  350. package/dist/{video-TVO2U5F2.js → video-JPESR36I.js} +38 -34
  351. package/dist/{voices-F3EW43LX.js → voices-AECYKXGA.js} +43 -44
  352. package/dist/warmCheck.js +73 -73
  353. package/dist/warmCheckClient.js +4 -4
  354. package/package.json +1 -1
  355. package/dist/chunk-23SG3B6M.js +0 -81
  356. package/dist/chunk-2RUCE54M.js +0 -5083
  357. package/dist/chunk-HFUI6LVF.js +0 -34
  358. package/dist/chunk-JOQR4AP6.js +0 -22
  359. package/dist/chunk-MK23FXLH.js +0 -21
  360. package/dist/chunk-SALNTRJA.js +0 -204
  361. package/dist/chunk-VC76R6W2.js +0 -27
  362. package/dist/chunk-Z642P33A.js +0 -270
  363. package/dist/studio/assets/hyperframes-player-B78JDyI_.js +0 -565
  364. package/dist/{chunk-7IMHPBSH.js → chunk-4NDSGKPO.js} +3 -3
  365. /package/dist/{chunk-YXX6CIHL.js → chunk-BWFNWEUO.js} +0 -0
@@ -4,11 +4,6 @@ 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
- Semaphore,
9
- prepareHeifImageInputs,
10
- withMediaProbeSlot
11
- } from "./chunk-PYTF6VHF.js";
12
7
  import {
13
8
  GENERIC_FAMILIES,
14
9
  collectFontFamilyCustomProperties,
@@ -16,7 +11,12 @@ import {
16
11
  iterateFontFamilyDeclarations,
17
12
  normalizeSystemFontPrimaryFamilies,
18
13
  resolveFontFamilyDeclarationFamilies
19
- } from "./chunk-PGITR2WX.js";
14
+ } from "./chunk-HAMPVCRY.js";
15
+ import {
16
+ Semaphore,
17
+ prepareHeifImageInputs,
18
+ withMediaProbeSlot
19
+ } from "./chunk-6ZU654EU.js";
20
20
  import {
21
21
  EncoderInterruptedError,
22
22
  encoderFailureError,
@@ -30,7 +30,10 @@ import {
30
30
  refusesOutsideLink,
31
31
  resolveRenderPaths,
32
32
  toExternalAssetKey
33
- } from "./chunk-37Y334MN.js";
33
+ } from "./chunk-CT54FOTS.js";
34
+ import {
35
+ linksOutside
36
+ } from "./chunk-B5TLZC2D.js";
34
37
  import {
35
38
  createStudioPositionSeekReapplyScript,
36
39
  openRangeEnd,
@@ -204,23 +207,22 @@ import {
204
207
  verifyDiskDrawElementSamples,
205
208
  videoAudioId,
206
209
  videoStartOnMediaTimeline,
210
+ withFfmpegProgress,
211
+ withPublicOnlyProxy,
207
212
  writeCapturedFrame,
208
213
  writeUrlDownloadTelemetry
209
- } from "./chunk-VLFBOKZX.js";
214
+ } from "./chunk-LTXZLTXW.js";
210
215
  import {
211
216
  settleOnBrowserSafePort
212
- } from "./chunk-OSKSTJNQ.js";
217
+ } from "./chunk-PJQVJSMG.js";
213
218
  import {
214
219
  TRANSITIONS,
215
220
  convertTransfer,
216
221
  crossfade
217
222
  } from "./chunk-3GXQPCJC.js";
218
- import {
219
- RENDER_TEMP_DIR
220
- } from "./chunk-HOIEN7O4.js";
221
223
  import {
222
224
  PREVIEW_FOR_ANOTHER_SITE_META
223
- } from "./chunk-YXX6CIHL.js";
225
+ } from "./chunk-BWFNWEUO.js";
224
226
  import {
225
227
  assignBundledRuntimeCompositionIds,
226
228
  boundMediaSrc,
@@ -233,14 +235,17 @@ import {
233
235
  parsesAsScript,
234
236
  prepareFlattenedInnerRoot,
235
237
  stripSdrPngColourTags
236
- } from "./chunk-4N3WOFP3.js";
238
+ } from "./chunk-7AP5C4C2.js";
239
+ import {
240
+ RENDER_TEMP_DIR
241
+ } from "./chunk-F6PI5O3H.js";
237
242
  import {
238
243
  cannotHardLink,
239
244
  collectScratchLeftovers,
240
245
  createStagingDir,
241
246
  removeScratch,
242
247
  renameWithRetry
243
- } from "./chunk-DL6PEJWH.js";
248
+ } from "./chunk-LYTELQL2.js";
244
249
  import {
245
250
  DISTRIBUTED_FPS,
246
251
  HF_VFX_ATTR,
@@ -258,7 +263,7 @@ import {
258
263
  redactTelemetryString,
259
264
  resolveAuthoredTimingWindow,
260
265
  toFps
261
- } from "./chunk-5IUVWP3A.js";
266
+ } from "./chunk-MPVJI4SE.js";
262
267
  import {
263
268
  CAPTURE_CANVAS_SELECTOR,
264
269
  COMPOSITION_SOURCE_URL,
@@ -295,37 +300,33 @@ import {
295
300
  sourceTimeAt,
296
301
  styleElementsFor,
297
302
  timeAtSourceTime
298
- } from "./chunk-2RUCE54M.js";
303
+ } from "./chunk-BNH2IKGV.js";
299
304
  import {
300
- isPrivateFileUnder,
301
305
  isSafePath,
302
- isStudioPrivatePath
303
- } from "./chunk-SALNTRJA.js";
304
- import {
305
306
  terminalText
306
- } from "./chunk-MK23FXLH.js";
307
+ } from "./chunk-3GF72UPC.js";
307
308
  import {
308
309
  chromeMajorCeiling
309
- } from "./chunk-6LU6JICP.js";
310
+ } from "./chunk-YWUE4CRU.js";
310
311
  import {
311
- lintHyperframeHtml,
312
312
  resolveReferencedStart
313
- } from "./chunk-UDLWVQ74.js";
313
+ } from "./chunk-TTRX7NM3.js";
314
314
  import {
315
315
  isUnresolvedAssetPlaceholder,
316
316
  namesAnotherNetworkRoot,
317
+ projectAssetExists,
317
318
  readProjectFile,
318
319
  readTextFile,
319
320
  resolveCompositionSrc,
320
321
  resolveProjectRelativeSrc
321
- } from "./chunk-6EMFSRTW.js";
322
+ } from "./chunk-S35RUNXJ.js";
322
323
  import {
323
324
  LOW_MEMORY_TOTAL_MB_THRESHOLD,
324
325
  getCgroupMemoryLimitMb,
325
326
  getSystemTotalMb,
326
327
  hostCpuCount,
327
328
  usableCpuCount
328
- } from "./chunk-O5U3Y5DX.js";
329
+ } from "./chunk-5GUYYSVT.js";
329
330
  import {
330
331
  MEDIA_START_BASIS_ATTR,
331
332
  checkSubCompositionUsability,
@@ -363,10 +364,14 @@ import {
363
364
  matchHtmlBodyCssWidthFirst,
364
365
  normalizeResolutionFlag,
365
366
  suggestMatchingPreset
366
- } from "./chunk-7IMHPBSH.js";
367
+ } from "./chunk-4NDSGKPO.js";
367
368
  import {
368
369
  parseHTML
369
370
  } from "./chunk-GWTIFRF5.js";
371
+ import {
372
+ isPrivateFileUnder,
373
+ isStudioPrivatePath
374
+ } from "./chunk-PTGNUVCB.js";
370
375
 
371
376
  // ../producer/src/services/renderOrchestrator.ts
372
377
  import {
@@ -374,7 +379,7 @@ import {
374
379
  mkdirSync as mkdirSync10,
375
380
  readdirSync as readdirSync6,
376
381
  rmSync as rmSync10,
377
- statSync as statSync7,
382
+ statSync as statSync8,
378
383
  writeFileSync as writeFileSync6,
379
384
  copyFileSync as copyFileSync3,
380
385
  appendFileSync
@@ -532,6 +537,10 @@ function stripPreloadNone(html) {
532
537
  return attr && attr.index < tagEnd ? [attr.index, attr.index + attr[0].length] : void 0;
533
538
  });
534
539
  }
540
+ function hasClosedMediaTag(text) {
541
+ const open2 = /<(?:video|audio)\b/i.exec(text);
542
+ return open2 !== null && text.includes(">", open2.index + open2[0].length);
543
+ }
535
544
  var REMOTE_SRC_TAGS = {
536
545
  media: { opener: "<(?:video|audio)\\b", attr: /\bsrc\s*=\s*["'](https?:\/\/)/gi },
537
546
  source: { opener: "<source\\b", attr: /\bsrc\s*=\s*["'](https?:\/\/)/gi },
@@ -1371,7 +1380,8 @@ function createFileServer(options) {
1371
1380
  compiledDir,
1372
1381
  port = 0,
1373
1382
  stripEmbeddedRuntime = true,
1374
- allowOutsideProjectAssets = false
1383
+ allowOutsideProjectAssets = false,
1384
+ includeOutsideScripts = false
1375
1385
  } = options;
1376
1386
  const preHeadScripts = [
1377
1387
  HF_EARLY_STUB,
@@ -1382,6 +1392,7 @@ function createFileServer(options) {
1382
1392
  const bodyScripts = options.bodyScripts ?? [buildRenderModeScript(options.fps), HF_BRIDGE_SCRIPT];
1383
1393
  const app = new Hono();
1384
1394
  const warnLeftOut = (line) => console.warn(`[FileServer] ${terminalText(line)}`);
1395
+ const outsidePolicy = { includeScripts: includeOutsideScripts };
1385
1396
  let listeningPort = -1;
1386
1397
  app.use(async function loadEachFileOnlyAsItsNamedType(c, next) {
1387
1398
  await next();
@@ -1399,7 +1410,7 @@ function createFileServer(options) {
1399
1410
  if (!isPathInside2(candidate, root, { resolveSymlinks })) continue;
1400
1411
  if (isPrivateFileUnder(root, candidate, isStudioPrivatePath)) continue;
1401
1412
  const checksLinks = allowOutsideProjectAssets && root !== compiledDir;
1402
- if (checksLinks && refusesOutsideLink(root, candidate, warnLeftOut)) continue;
1413
+ if (checksLinks && refusesOutsideLink(root, candidate, warnLeftOut, outsidePolicy)) continue;
1403
1414
  file = openRegularFile(candidate);
1404
1415
  if (file) break;
1405
1416
  }
@@ -1795,6 +1806,30 @@ function reportEncodeProgress(job, done, total, onProgress, from) {
1795
1806
  "encoding"
1796
1807
  );
1797
1808
  }
1809
+ var AUDIO_STAGE = "Processing audio tracks";
1810
+ var AUDIO_WAIT_REPORT_MS = 5e3;
1811
+ function audioWaitReporter(job, onProgress) {
1812
+ let waiting2 = false;
1813
+ let reportedAt = -Infinity;
1814
+ return {
1815
+ progressed() {
1816
+ const now = Date.now();
1817
+ if (!waiting2 || now - reportedAt < AUDIO_WAIT_REPORT_MS) return;
1818
+ reportedAt = now;
1819
+ updateJobStatus(job, job.status, AUDIO_STAGE, job.progress, onProgress, {
1820
+ code: "process_audio"
1821
+ });
1822
+ },
1823
+ async wait(audio) {
1824
+ waiting2 = true;
1825
+ try {
1826
+ return await audio;
1827
+ } finally {
1828
+ waiting2 = false;
1829
+ }
1830
+ }
1831
+ };
1832
+ }
1798
1833
  var lastAssembleReportAt = /* @__PURE__ */ new WeakMap();
1799
1834
  function reportAssembleProgress(job, done, total, onProgress) {
1800
1835
  if (total <= 0) return;
@@ -2874,9 +2909,10 @@ function frameWeightedAvgMs(perfs, avgOf) {
2874
2909
  function aggregateDedup(perfs) {
2875
2910
  if (perfs.length === 0) return void 0;
2876
2911
  const armed = perfs.some((p) => p.staticDedupArmed);
2877
- const skipReasons = armed ? [] : [
2878
- ...new Set(perfs.map((p) => p.staticDedupSkipReason).filter((r) => !!r))
2879
- ].sort();
2912
+ const distinctUnarmed = (values) => {
2913
+ const distinct = armed ? [] : [...new Set(values.filter((v) => !!v))].sort();
2914
+ return distinct.length > 0 ? distinct.join("|") : void 0;
2915
+ };
2880
2916
  const verificationPerfs = perfs.filter((perf) => perf.staticDedupVerificationOutcome);
2881
2917
  const verificationOutcomes = [
2882
2918
  ...new Set(
@@ -2888,7 +2924,8 @@ function aggregateDedup(perfs) {
2888
2924
  armed,
2889
2925
  predictedFrames: perfs.reduce((sum2, p) => sum2 + (p.staticDedupPredicted ?? 0), 0),
2890
2926
  reusedFrames: perfs.reduce((sum2, p) => sum2 + (p.staticDedupReused ?? 0), 0),
2891
- skipReason: skipReasons.length > 0 ? skipReasons.join("|") : void 0,
2927
+ skipReason: distinctUnarmed(perfs.map((p) => p.staticDedupSkipReason)),
2928
+ ineligibleCause: distinctUnarmed(perfs.map((p) => p.staticDedupIneligibleCause)),
2892
2929
  ...verificationPerfs.length === 0 ? {} : {
2893
2930
  verifiedFrames: verificationPerfs.reduce(
2894
2931
  (sum2, perf) => sum2 + (perf.staticDedupVerified ?? 0),
@@ -6912,10 +6949,81 @@ function countAuthoredTimedClips(html) {
6912
6949
  return document2.querySelectorAll("[data-start]").length;
6913
6950
  }
6914
6951
 
6952
+ // ../producer/src/services/render/outputDimensions.ts
6953
+ function isExpectedOutputDimensions(value) {
6954
+ 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;
6955
+ }
6956
+ var OutputDimensionsMismatchError = class extends Error {
6957
+ code = "OUTPUT_DIMENSIONS_MISMATCH";
6958
+ constructor() {
6959
+ super("Compiled output dimensions do not match the requested render dimensions.");
6960
+ }
6961
+ };
6962
+ function requireOutputDimensions(expected, width, height) {
6963
+ if (expected !== void 0 && (!isExpectedOutputDimensions(expected) || expected.width !== width || expected.height !== height)) {
6964
+ throw new OutputDimensionsMismatchError();
6965
+ }
6966
+ }
6967
+
6915
6968
  // ../producer/src/services/render/stages/compileStage.ts
6916
6969
  import { existsSync as existsSync11, writeFileSync as writeFileSync4 } from "fs";
6917
6970
  import { join as join17, relative as relative3 } from "path";
6918
6971
 
6972
+ // ../producer/src/services/compositionSizeLimit.ts
6973
+ import { statSync as statSync6 } from "fs";
6974
+ var MAX_COMPOSITION_HTML_BYTES = 16 * 1024 * 1024;
6975
+ var COMPOSITION_TOO_LARGE = "COMPOSITION_TOO_LARGE";
6976
+ var megabytes = (bytes) => `${(bytes / (1024 * 1024)).toFixed(1)} MB`;
6977
+ var MAX_EXPANDED_COMPOSITION_BYTES = 2 * MAX_COMPOSITION_HTML_BYTES;
6978
+ var MAX_COMPOSITION_MOUNTS = 1e4;
6979
+ var CompositionTooLargeError = class extends Error {
6980
+ constructor(message, publicMetadata) {
6981
+ super(message);
6982
+ this.publicMetadata = publicMetadata;
6983
+ this.name = "CompositionTooLargeError";
6984
+ }
6985
+ publicMetadata;
6986
+ code = COMPOSITION_TOO_LARGE;
6987
+ // The producer server reads these off the error for the wire envelope.
6988
+ owner = "user";
6989
+ retryable = false;
6990
+ };
6991
+ var fileTooLarge = (file, bytes) => new CompositionTooLargeError(
6992
+ `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.`,
6993
+ { bytes, limitBytes: MAX_COMPOSITION_HTML_BYTES }
6994
+ );
6995
+ var CompositionExpansionBudget = class {
6996
+ bytes = 0;
6997
+ mounts = 0;
6998
+ charge(file, bytes) {
6999
+ this.bytes += bytes;
7000
+ this.mounts += 1;
7001
+ if (this.bytes <= MAX_EXPANDED_COMPOSITION_BYTES && this.mounts <= MAX_COMPOSITION_MOUNTS) {
7002
+ return;
7003
+ }
7004
+ throw new CompositionTooLargeError(
7005
+ `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.`,
7006
+ {
7007
+ bytes: this.bytes,
7008
+ limitBytes: MAX_EXPANDED_COMPOSITION_BYTES,
7009
+ mounts: this.mounts,
7010
+ exceeded: this.mounts > MAX_COMPOSITION_MOUNTS ? "mounts" : "bytes"
7011
+ }
7012
+ );
7013
+ }
7014
+ };
7015
+ function assertCompositionFileSize(path, file) {
7016
+ let bytes;
7017
+ try {
7018
+ const stats = statSync6(path);
7019
+ if (!stats.isFile()) return;
7020
+ bytes = stats.size;
7021
+ } catch {
7022
+ return;
7023
+ }
7024
+ if (bytes > MAX_COMPOSITION_HTML_BYTES) throw fileTooLarge(file, bytes);
7025
+ }
7026
+
6919
7027
  // ../producer/src/services/htmlCompiler.ts
6920
7028
  import { createHash as createHash4 } from "crypto";
6921
7029
  import { createReadStream as createReadStream2, existsSync as existsSync10, mkdirSync as mkdirSync7, readFileSync as readFileSync6 } from "fs";
@@ -7268,7 +7376,7 @@ Check that each file referenced by data-composition-src contains valid HTML with
7268
7376
  };
7269
7377
  function normalizeCompositionSrcs(html, projectDir) {
7270
7378
  return html.replace(/(\bdata-composition-src=)(["'])([^"']*)\2/g, (whole, name, quote, value) => {
7271
- if (!value.includes("%") && !value.startsWith("/")) return whole;
7379
+ if (!value.includes("%") && !/^\.?[\\/]/.test(value)) return whole;
7272
7380
  const file = resolveCompositionSrc(projectDir, value);
7273
7381
  if (file === null) return whole;
7274
7382
  return `${name}${quote}${relative2(projectDir, file).split(sep2).join("/")}${quote}`;
@@ -7284,68 +7392,94 @@ function resolveCompositionFile(projectDir, src, assetRoot) {
7284
7392
  const file = resolveCompositionPath(projectDir, src, assetRoot);
7285
7393
  return file !== null && COMPOSITION_FILE.test(file) ? file : null;
7286
7394
  }
7395
+ 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";
7396
+ var runsOutsideMarkupUnasked = (projectDir, filePath, assetRoot, outsideFiles) => assetRoot === void 0 && !outsideFiles.includeScripts && linksOutside(projectDir, filePath);
7397
+ function assertOutsideMarkupAsked(projectDir, filePath, srcPath, assetRoot, outsideFiles) {
7398
+ if (runsOutsideMarkupUnasked(projectDir, filePath, assetRoot, outsideFiles)) {
7399
+ throw new EmptyCompositionError([{ srcPath, detail: OUTSIDE_COMPOSITION_NEEDS_FLAG }]);
7400
+ }
7401
+ }
7287
7402
  var isPrivateCompositionFile = (projectDir, filePath) => isPrivateFileUnder(projectDir, filePath, isStudioPrivatePath);
7288
- function assertSubCompositionsUsable(html, projectDir, assetRoot, visited = /* @__PURE__ */ new Set()) {
7403
+ var mountSrcsUnder = (root) => [...root.querySelectorAll("[data-composition-src]")].map((el) => el.getAttribute("data-composition-src")).filter((srcPath) => !!srcPath && !isUnresolvedAssetPlaceholder(srcPath));
7404
+ function compositionSrcsIn(html) {
7289
7405
  const { document: document2 } = parseHTML(html);
7290
- const hosts = [...document2.querySelectorAll("[data-composition-src]")];
7291
- const problems = [];
7292
- for (const el of hosts) {
7293
- const srcPath = el.getAttribute("data-composition-src");
7294
- if (!srcPath) continue;
7295
- if (isUnresolvedAssetPlaceholder(srcPath)) continue;
7406
+ const templated = [];
7407
+ const templates = [...document2.querySelectorAll("template")];
7408
+ for (let template = templates.pop(); template; template = templates.pop()) {
7409
+ templated.push(...mountSrcsUnder(template.content));
7410
+ templates.push(...template.content.querySelectorAll("template"));
7411
+ }
7412
+ return { mounts: mountSrcsUnder(document2), templated };
7413
+ }
7414
+ function compositionPathProblem(projectDir, filePath, assetRoot, outsideFiles) {
7415
+ if (outsideAssetRefusal(projectDir, filePath) === "blocklisted") {
7416
+ return "it is outside the project in a private location";
7417
+ }
7418
+ if (runsOutsideMarkupUnasked(projectDir, filePath, assetRoot, outsideFiles)) {
7419
+ return OUTSIDE_COMPOSITION_NEEDS_FLAG;
7420
+ }
7421
+ if (isPrivateCompositionFile(projectDir, filePath)) {
7422
+ return "it is git metadata, an env file or a private tool record";
7423
+ }
7424
+ return COMPOSITION_FILE.test(filePath) ? null : NOT_A_COMPOSITION_FILE;
7425
+ }
7426
+ function readSubCompositionFile(filePath, srcPath) {
7427
+ assertCompositionFileSize(filePath, srcPath);
7428
+ const read = readProjectFile(filePath);
7429
+ if (read.kind === "missing") return { detail: "the file does not exist" };
7430
+ if (read.kind === "folder") return { detail: "it is a folder, not an HTML file" };
7431
+ const validity = checkSubCompositionUsability(read.text, parseSubCompHtmlForValidity);
7432
+ if (!validity.ok)
7433
+ return { detail: validity.detail ?? "the file is empty or could not be parsed" };
7434
+ return { bytes: Buffer.byteLength(read.text), ...compositionSrcsIn(read.text) };
7435
+ }
7436
+ function assertSubCompositionsUsable(html, projectDir, assetRoot, outsideFiles) {
7437
+ const budget = new CompositionExpansionBudget();
7438
+ const files = /* @__PURE__ */ new Map();
7439
+ const problems = /* @__PURE__ */ new Map();
7440
+ const report = (srcPath, detail) => problems.set(`${srcPath}\0${detail}`, { srcPath, detail });
7441
+ const chain = /* @__PURE__ */ new Set();
7442
+ const paths = /* @__PURE__ */ new Map();
7443
+ const resolveMount = (srcPath) => {
7296
7444
  const filePath = resolveCompositionPath(projectDir, srcPath, assetRoot);
7297
- if (filePath === null) {
7298
- problems.push({ srcPath, detail: "it is outside the project folder" });
7299
- continue;
7300
- }
7301
- if (outsideAssetRefusal(projectDir, filePath) === "blocklisted") {
7302
- problems.push({ srcPath, detail: "it is outside the project in a private location" });
7303
- continue;
7304
- }
7305
- if (isPrivateCompositionFile(projectDir, filePath)) {
7306
- problems.push({
7307
- srcPath,
7308
- detail: "it is git metadata, an env file or a private tool record"
7309
- });
7310
- continue;
7311
- }
7312
- if (!COMPOSITION_FILE.test(filePath)) {
7313
- problems.push({ srcPath, detail: NOT_A_COMPOSITION_FILE });
7314
- continue;
7315
- }
7316
- if (visited.has(filePath)) continue;
7317
- const read = readProjectFile(filePath);
7318
- if (read.kind === "missing") {
7319
- problems.push({ srcPath, detail: "the file does not exist" });
7320
- continue;
7321
- }
7322
- if (read.kind === "folder") {
7323
- problems.push({ srcPath, detail: "it is a folder, not an HTML file" });
7324
- continue;
7325
- }
7326
- const fileHtml = read.text;
7327
- const validity = checkSubCompositionUsability(fileHtml, parseSubCompHtmlForValidity);
7328
- if (!validity.ok) {
7329
- problems.push({
7330
- srcPath,
7331
- detail: validity.detail ?? "the file is empty or could not be parsed"
7332
- });
7333
- continue;
7334
- }
7335
- const nestedVisited = new Set(visited);
7336
- nestedVisited.add(filePath);
7337
- try {
7338
- assertSubCompositionsUsable(fileHtml, projectDir, assetRoot, nestedVisited);
7339
- } catch (err) {
7340
- if (err instanceof EmptyCompositionError) {
7341
- problems.push(...err.problems);
7342
- } else {
7343
- throw err;
7445
+ if (filePath === null) return { detail: "it is outside the project folder" };
7446
+ const detail = compositionPathProblem(projectDir, filePath, assetRoot, outsideFiles);
7447
+ return detail ? { detail } : { filePath };
7448
+ };
7449
+ const walk = (srcPaths, quiet) => {
7450
+ for (const srcPath of srcPaths) {
7451
+ let resolved = paths.get(srcPath);
7452
+ if (!resolved) {
7453
+ resolved = resolveMount(srcPath);
7454
+ paths.set(srcPath, resolved);
7455
+ }
7456
+ if ("detail" in resolved) {
7457
+ if (!quiet) report(srcPath, resolved.detail);
7458
+ continue;
7344
7459
  }
7460
+ const { filePath } = resolved;
7461
+ if (chain.has(filePath)) continue;
7462
+ let file = files.get(filePath);
7463
+ if (!file) {
7464
+ file = readSubCompositionFile(filePath, srcPath);
7465
+ files.set(filePath, file);
7466
+ }
7467
+ if ("detail" in file) {
7468
+ if (!quiet) report(srcPath, file.detail);
7469
+ continue;
7470
+ }
7471
+ budget.charge(srcPath, file.bytes);
7472
+ chain.add(filePath);
7473
+ walk(file.mounts, quiet);
7474
+ walk(file.templated, true);
7475
+ chain.delete(filePath);
7345
7476
  }
7346
- }
7347
- if (problems.length > 0) {
7348
- throw new EmptyCompositionError(problems);
7477
+ };
7478
+ const entry = compositionSrcsIn(html);
7479
+ walk(entry.mounts, false);
7480
+ walk(entry.templated, true);
7481
+ if (problems.size > 0) {
7482
+ throw new EmptyCompositionError([...problems.values()]);
7349
7483
  }
7350
7484
  }
7351
7485
  var COMPILER_MOUNT_BLOCK_START = "/* __HF_COMPILER_MOUNT_START__ */";
@@ -7600,7 +7734,7 @@ async function compileHtmlFile(html, projectDir, baseDir, downloadDir, log, urlB
7600
7734
  compiledHtml = stripCrossoriginAttr(compiledHtml, "audio");
7601
7735
  return { html: compiledHtml, unresolvedCompositions };
7602
7736
  }
7603
- async function parseSubCompositions(html, projectDir, downloadDir, visited = /* @__PURE__ */ new Set(), urlByAbsentLocalPath, probes, assetRoot) {
7737
+ async function parseSubCompositions(html, projectDir, downloadDir, visited = /* @__PURE__ */ new Set(), urlByAbsentLocalPath, probes, assetRoot, outsideFiles = {}, compiledSrcs = /* @__PURE__ */ new Set()) {
7604
7738
  const subCompositions = /* @__PURE__ */ new Map();
7605
7739
  const { document: document2 } = parseHTML(html);
7606
7740
  const compEls = document2.querySelectorAll("[data-composition-src]");
@@ -7613,6 +7747,10 @@ async function parseSubCompositions(html, projectDir, downloadDir, visited = /*
7613
7747
  if (visited.has(filePath)) {
7614
7748
  continue;
7615
7749
  }
7750
+ if (compiledSrcs.has(srcPath)) continue;
7751
+ compiledSrcs.add(srcPath);
7752
+ assertOutsideMarkupAsked(projectDir, filePath, srcPath, assetRoot, outsideFiles);
7753
+ assertCompositionFileSize(filePath, srcPath);
7616
7754
  const read = readProjectFile(filePath);
7617
7755
  if (read.kind !== "file") {
7618
7756
  continue;
@@ -7641,7 +7779,9 @@ async function parseSubCompositions(html, projectDir, downloadDir, visited = /*
7641
7779
  item.nestedVisited,
7642
7780
  urlByAbsentLocalPath,
7643
7781
  probes,
7644
- assetRoot
7782
+ assetRoot,
7783
+ outsideFiles,
7784
+ compiledSrcs
7645
7785
  );
7646
7786
  return {
7647
7787
  srcPath: item.srcPath,
@@ -7777,7 +7917,7 @@ function coalesceHeadStylesAndBodyScripts(html) {
7777
7917
  }
7778
7918
  return document2.toString();
7779
7919
  }
7780
- function inlineSubCompositions2(html, subCompositions, projectDir, variableOverrides, assetRoot) {
7920
+ function inlineSubCompositions2(html, subCompositions, projectDir, variableOverrides, assetRoot, outsideFiles) {
7781
7921
  const { document: document2 } = parseHTML(html);
7782
7922
  const head = document2.querySelector("head");
7783
7923
  const body = document2.querySelector("body");
@@ -7788,8 +7928,29 @@ function inlineSubCompositions2(html, subCompositions, projectDir, variableOverr
7788
7928
  {},
7789
7929
  variableOverrides
7790
7930
  );
7791
- return emitted ? document2.toString() : html;
7931
+ return { html: emitted ? document2.toString() : html, variablesByComp: {} };
7792
7932
  }
7933
+ const budget = new CompositionExpansionBudget();
7934
+ const readOnce = /* @__PURE__ */ new Map();
7935
+ const readMountHtml = (srcPath) => {
7936
+ const filePath = resolveCompositionFile(projectDir, srcPath, assetRoot);
7937
+ if (filePath) {
7938
+ assertOutsideMarkupAsked(projectDir, filePath, srcPath, assetRoot, outsideFiles);
7939
+ assertCompositionFileSize(filePath, srcPath);
7940
+ }
7941
+ const read = filePath && !isPrivateCompositionFile(projectDir, filePath) ? readProjectFile(filePath) : null;
7942
+ return read?.kind === "file" ? rewriteUnresolvableGsapToCdn(
7943
+ normalizeCompositionSrcs(read.text, projectDir),
7944
+ projectDir,
7945
+ srcPath
7946
+ ) : null;
7947
+ };
7948
+ const resolveMountHtml = (srcPath) => {
7949
+ const compiled = subCompositions.get(srcPath);
7950
+ if (compiled) return compiled;
7951
+ if (!readOnce.has(srcPath)) readOnce.set(srcPath, readMountHtml(srcPath));
7952
+ return readOnce.get(srcPath) ?? null;
7953
+ };
7793
7954
  const hostIdentityByElement = new ProducerHostIdentityMap(
7794
7955
  document2,
7795
7956
  hosts
@@ -7805,20 +7966,14 @@ function inlineSubCompositions2(html, subCompositions, projectDir, variableOverr
7805
7966
  readVariableDefaults: readDeclaredDefaults,
7806
7967
  parseHostVariables: parseHostVariableValues,
7807
7968
  resolveHtml: (srcPath) => {
7808
- let compHtml = subCompositions.get(srcPath) || null;
7809
- if (!compHtml) {
7810
- const filePath = resolveCompositionFile(projectDir, srcPath, assetRoot);
7811
- const read = filePath && !isPrivateCompositionFile(projectDir, filePath) ? readProjectFile(filePath) : null;
7812
- if (read?.kind === "file") {
7813
- compHtml = rewriteUnresolvableGsapToCdn(read.text, projectDir, srcPath);
7814
- }
7815
- }
7969
+ const compHtml = resolveMountHtml(srcPath);
7970
+ if (compHtml) budget.charge(srcPath, Buffer.byteLength(compHtml));
7816
7971
  return compHtml;
7817
7972
  },
7818
7973
  parseHtml: (htmlStr) => parseHTML(htmlStr).document,
7819
7974
  // Mirrors the preview bundler: a sub-composition's SIBLING assets resolve
7820
7975
  // against its own directory, project-root refs stay as authored.
7821
- assetExists: (path) => existsSync10(resolve5(projectDir, path)),
7976
+ assetExists: projectAssetExists(projectDir),
7822
7977
  // Preserve the authored root wrapper as a child of the host, matching
7823
7978
  // the preview bundler's shape (htmlBundler.ts's prepareFlattenedInnerRoot,
7824
7979
  // which the runtime compositionLoader mirrors with its own copy for the
@@ -7902,7 +8057,7 @@ function inlineSubCompositions2(html, subCompositions, projectDir, variableOverr
7902
8057
  variableOverrides
7903
8058
  );
7904
8059
  assignMediaRenderIds(document2);
7905
- return document2.toString();
8060
+ return { html: document2.toString(), variablesByComp: result.variablesByComp };
7906
8061
  }
7907
8062
  function ensureFullDocument(html) {
7908
8063
  const trimmed = html.trim();
@@ -8023,7 +8178,7 @@ ${safeText}
8023
8178
  }
8024
8179
  return wrappedFragment ? document2.body.innerHTML || "" : document2.toString();
8025
8180
  }
8026
- function collectExternalAssets(html, projectDir, log = defaultLogger, file = "index.html") {
8181
+ function collectExternalAssets(html, projectDir, log = defaultLogger, file = "index.html", policy = {}) {
8027
8182
  const absProjectDir = resolve5(projectDir);
8028
8183
  const externalAssets = /* @__PURE__ */ new Map();
8029
8184
  const leftOut = /* @__PURE__ */ new Set();
@@ -8036,7 +8191,7 @@ function collectExternalAssets(html, projectDir, log = defaultLogger, file = "in
8036
8191
  }
8037
8192
  const onShare = namesAnotherNetworkRoot(absProjectDir, absPath);
8038
8193
  if (!onShare && !existsSync10(absPath)) return null;
8039
- const refusal = onShare ? "network_share" : outsideAssetRefusal(absProjectDir, absPath);
8194
+ const refusal = onShare ? "network_share" : outsideAssetRefusal(absProjectDir, absPath, policy);
8040
8195
  if (refusal) {
8041
8196
  if (!leftOut.has(trimmed)) log.warn(`[Compiler] ${leftOutOfRender(file, trimmed, refusal)}`);
8042
8197
  leftOut.add(trimmed);
@@ -8343,7 +8498,7 @@ async function readLocalFont(absPath) {
8343
8498
  return { kind: "inline", buffer: Buffer.concat(chunks, totalBytes) };
8344
8499
  }
8345
8500
  async function embedLocalFontFaces(html, projectDir, assetRoot, log = defaultLogger) {
8346
- const { fontToDataUri: toDataUri } = await import("./deterministicFonts-LYBMXXBW.js");
8501
+ const { fontToDataUri: toDataUri } = await import("./deterministicFonts-JER4GPCM.js");
8347
8502
  let result = html;
8348
8503
  const embeddedPaths = /* @__PURE__ */ new Set();
8349
8504
  const dataUriByAbsolutePath = /* @__PURE__ */ new Map();
@@ -8425,7 +8580,7 @@ function rebaseDirectEntryAssetPaths(html, projectDir, htmlPath) {
8425
8580
  const entryPath = relative2(projectDir, htmlPath).replace(/\\/g, "/");
8426
8581
  if (!entryPath.includes("/")) return html;
8427
8582
  const { document: document2 } = parseHTML(html);
8428
- const assetExists = (path) => existsSync10(resolve5(projectDir, path));
8583
+ const assetExists = projectAssetExists(projectDir);
8429
8584
  rewriteAssetPaths(
8430
8585
  document2.querySelectorAll("[src], [href], [srcset]"),
8431
8586
  entryPath,
@@ -8466,18 +8621,23 @@ function bindVariableMediaSources(html, variables) {
8466
8621
  var entryFileName = (projectDir, htmlPath) => isPathInside(htmlPath, projectDir) ? relative2(projectDir, htmlPath).split(sep2).join("/") : basename4(htmlPath);
8467
8622
  async function compileForRender(projectDir, htmlPath, downloadDir, options = {}) {
8468
8623
  const assetRoot = options.allowOutsideProjectAssets ? void 0 : projectDir;
8624
+ const outsideFiles = { includeScripts: options.includeOutsideScripts };
8469
8625
  if (isPathInside(htmlPath, projectDir) && escapesAssetRoot(htmlPath, assetRoot)) {
8470
8626
  throw new Error(`Entry file ${htmlPath} leads outside the project folder`);
8471
8627
  }
8628
+ if (isPathInside(htmlPath, projectDir) && runsOutsideMarkupUnasked(projectDir, htmlPath, assetRoot, outsideFiles)) {
8629
+ throw new Error(`Entry file ${htmlPath} ${OUTSIDE_COMPOSITION_NEEDS_FLAG}`);
8630
+ }
8472
8631
  if (!COMPOSITION_FILE.test(htmlPath)) {
8473
8632
  throw new Error(`Entry file ${htmlPath} is not an .html file, so it is refused`);
8474
8633
  }
8634
+ assertCompositionFileSize(htmlPath, basename4(htmlPath));
8475
8635
  const entryHtml = rebaseDirectEntryAssetPaths(readTextFile(htmlPath), projectDir, htmlPath);
8476
8636
  const rawHtml = bindVariableMediaSources(
8477
8637
  normalizeCompositionSrcs(rewriteUnresolvableGsapToCdn(entryHtml, projectDir), projectDir),
8478
8638
  options.variables ?? {}
8479
8639
  );
8480
- assertSubCompositionsUsable(rawHtml, projectDir, assetRoot);
8640
+ assertSubCompositionsUsable(rawHtml, projectDir, assetRoot, outsideFiles);
8481
8641
  const probes = /* @__PURE__ */ new Map();
8482
8642
  const { html: compiledHtml, unresolvedCompositions } = await compileHtmlFile(
8483
8643
  rawHtml,
@@ -8496,15 +8656,17 @@ async function compileForRender(projectDir, htmlPath, downloadDir, options = {})
8496
8656
  void 0,
8497
8657
  options.urlByAbsentLocalPath,
8498
8658
  probes,
8499
- assetRoot
8659
+ assetRoot,
8660
+ outsideFiles
8500
8661
  );
8501
8662
  const fullHtml = ensureFullDocument(compiledHtml);
8502
- const inlinedHtml = inlineSubCompositions2(
8663
+ const { html: inlinedHtml, variablesByComp } = inlineSubCompositions2(
8503
8664
  fullHtml,
8504
8665
  subCompositions,
8505
8666
  projectDir,
8506
8667
  options.variables ?? {},
8507
- assetRoot
8668
+ assetRoot,
8669
+ outsideFiles
8508
8670
  );
8509
8671
  const sanitizedHtml = stripPreloadNone(inlinedHtml);
8510
8672
  const renderModeHints = detectRenderModeHints(sanitizedHtml, options.pageMotionBlur);
@@ -8558,7 +8720,7 @@ async function compileForRender(projectDir, htmlPath, downloadDir, options = {})
8558
8720
  cacheDir: options.animatedGifCacheDir,
8559
8721
  sourceAssets: remoteImageAssets,
8560
8722
  timeoutMs: options.ffmpegProcessTimeout,
8561
- assetRoot
8723
+ allowOutsideFiles: assetRoot === void 0
8562
8724
  });
8563
8725
  if (preparedHeifImages.length > 0) {
8564
8726
  defaultLogger.debug(`[Compiler] Converted ${preparedHeifImages.length} HEIC image(s) to JPEG`);
@@ -8574,7 +8736,7 @@ async function compileForRender(projectDir, htmlPath, downloadDir, options = {})
8574
8736
  cacheDir: options.animatedGifCacheDir,
8575
8737
  sourceAssets: gifSourceAssets,
8576
8738
  timeoutMs: options.ffmpegProcessTimeout,
8577
- assetRoot
8739
+ allowOutsideFiles: assetRoot === void 0
8578
8740
  });
8579
8741
  if (preparedGifs.length > 0) {
8580
8742
  defaultLogger.debug(`[Compiler] Prepared ${preparedGifs.length} animated GIF input(s) as WebM`);
@@ -8589,7 +8751,8 @@ async function compileForRender(projectDir, htmlPath, downloadDir, options = {})
8589
8751
  embeddedHtml,
8590
8752
  projectDir,
8591
8753
  options.log,
8592
- entryFileName(projectDir, htmlPath)
8754
+ entryFileName(projectDir, htmlPath),
8755
+ { includeScripts: options.includeOutsideScripts }
8593
8756
  ) : { html: embeddedHtml, externalAssets: /* @__PURE__ */ new Map() };
8594
8757
  for (const [relPath, absPath] of remoteMediaAssets) {
8595
8758
  externalAssets.set(relPath, absPath);
@@ -8652,6 +8815,7 @@ async function compileForRender(projectDir, htmlPath, downloadDir, options = {})
8652
8815
  gradedCanvas,
8653
8816
  ...masterFxChain ? { masterFxChain } : {},
8654
8817
  unresolvedCompositions,
8818
+ variablesByComp,
8655
8819
  externalAssets,
8656
8820
  width,
8657
8821
  height,
@@ -8995,7 +9159,7 @@ async function resolveCompositionDurations(page, unresolved) {
8995
9159
  }
8996
9160
  return resolutions;
8997
9161
  }
8998
- async function recompileWithResolutions(compiled, resolutions, projectDir, downloadDir, assetRoot) {
9162
+ async function recompileWithResolutions(compiled, resolutions, projectDir, downloadDir, assetRoot, outsideFiles = {}) {
8999
9163
  if (resolutions.length === 0) return compiled;
9000
9164
  const html = injectDurations(compiled.html, resolutions);
9001
9165
  const { subCompositions } = await parseSubCompositions(
@@ -9005,7 +9169,8 @@ async function recompileWithResolutions(compiled, resolutions, projectDir, downl
9005
9169
  void 0,
9006
9170
  void 0,
9007
9171
  void 0,
9008
- assetRoot
9172
+ assetRoot,
9173
+ outsideFiles
9009
9174
  );
9010
9175
  const { videos, audios, images } = compiled;
9011
9176
  const remaining = compiled.unresolvedCompositions.filter(
@@ -9053,6 +9218,7 @@ function resolveEntryHtmlPath(input) {
9053
9218
  `Entry file "${relative3(projectDir, path)}" leads outside the project folder`
9054
9219
  );
9055
9220
  }
9221
+ assertCompositionFileSize(path, relative3(projectDir, path));
9056
9222
  return readTextFile(path);
9057
9223
  };
9058
9224
  const htmlPath = join17(projectDir, entryFile);
@@ -9114,7 +9280,8 @@ async function runCompileStage(input) {
9114
9280
  pageMotionBlur: input.pageMotionBlur,
9115
9281
  animatedGifCacheDir: animatedGifCacheDir(cfg.extractCacheDir),
9116
9282
  ffmpegProcessTimeout: cfg.ffmpegProcessTimeout,
9117
- allowOutsideProjectAssets: job.config.allowOutsideProjectAssets
9283
+ allowOutsideProjectAssets: job.config.allowOutsideProjectAssets,
9284
+ includeOutsideScripts: job.config.includeOutsideScripts
9118
9285
  });
9119
9286
  assertNotAborted();
9120
9287
  const compileOnlyMs = Date.now() - compileStart;
@@ -9200,6 +9367,8 @@ async function runCompileStage(input) {
9200
9367
  });
9201
9368
  const outputWidth = Math.round(width * deviceScaleFactor);
9202
9369
  const outputHeight = Math.round(height * deviceScaleFactor);
9370
+ requireOutputDimensions(job.config.expectedOutputDimensions, outputWidth, outputHeight);
9371
+ if (job.config.expectedOutputDimensions !== void 0) job.outputDimensionsChecked = true;
9203
9372
  if (deviceScaleFactor !== 1) {
9204
9373
  log.info("Scaling composition via deviceScaleFactor", {
9205
9374
  compositionWidth: width,
@@ -9269,23 +9438,50 @@ function hasAutoStartVideos(html) {
9269
9438
  const { document: document2 } = parseHTML(html);
9270
9439
  return document2.querySelector("video[data-hf-auto-start]") !== null;
9271
9440
  }
9272
- function variableHasValue(element, variableId, variables) {
9441
+ var MAX_VARIABLE_SCOPE_STEPS = 1e6;
9442
+ function variableIdsOn(scan, element) {
9443
+ let ids = scan.ids.get(element);
9444
+ if (!ids) {
9445
+ ids = /* @__PURE__ */ new Set([
9446
+ ...Object.keys(parseHostVariableValues(element)),
9447
+ ...Object.keys(readDeclaredDefaults(element))
9448
+ ]);
9449
+ scan.ids.set(element, ids);
9450
+ }
9451
+ return ids;
9452
+ }
9453
+ function scopedVariablesFor(scan, element, variablesByComp) {
9454
+ for (let node = element; node; node = node.parentElement) {
9455
+ if (++scan.steps > MAX_VARIABLE_SCOPE_STEPS) return null;
9456
+ if (!node.hasAttribute("data-composition-id")) continue;
9457
+ const compId = node.getAttribute("data-composition-id")?.trim() ?? "";
9458
+ return compId && Object.hasOwn(variablesByComp, compId) ? variablesByComp[compId] : void 0;
9459
+ }
9460
+ return void 0;
9461
+ }
9462
+ function variableHasValue(scan, element, variableId, variables, variablesByComp) {
9273
9463
  if (variables && Object.hasOwn(variables, variableId)) return true;
9464
+ const scoped = scopedVariablesFor(scan, element, variablesByComp);
9465
+ if (scoped === null) return true;
9466
+ if (scoped) return Object.hasOwn(scoped, variableId);
9274
9467
  for (let scope = element.parentElement; scope; scope = scope.parentElement) {
9275
- if (Object.hasOwn(parseHostVariableValues(scope), variableId)) return true;
9276
- if (Object.hasOwn(readDeclaredDefaults(scope), variableId)) return true;
9468
+ if (++scan.steps > MAX_VARIABLE_SCOPE_STEPS) return true;
9469
+ if (variableIdsOn(scan, scope).has(variableId)) return true;
9277
9470
  }
9278
- return Object.hasOwn(readDeclaredDefaults(element.ownerDocument.documentElement), variableId);
9471
+ return variableIdsOn(scan, element.ownerDocument.documentElement).has(variableId);
9279
9472
  }
9280
- function hasVariableBoundMedia(html, variables) {
9473
+ function hasVariableBoundMedia(html, variables, variablesByComp = {}) {
9281
9474
  const { document: document2 } = parseHTML(html);
9475
+ const scan = { ids: /* @__PURE__ */ new Map(), steps: 0 };
9282
9476
  return Array.from(
9283
9477
  document2.querySelectorAll(
9284
9478
  "img[data-var-src], audio[data-var-src], video[data-var-src], source[data-var-src]"
9285
9479
  )
9286
9480
  ).some((element) => {
9287
9481
  const variableId = element.getAttribute("data-var-src")?.trim();
9288
- return Boolean(variableId && variableHasValue(element, variableId, variables));
9482
+ return Boolean(
9483
+ variableId && variableHasValue(scan, element, variableId, variables, variablesByComp)
9484
+ );
9289
9485
  });
9290
9486
  }
9291
9487
  function authoredMediaStarts(html) {
@@ -9325,29 +9521,54 @@ function reconcileBrowserMediaEnd(existingEnd, projectedEnd, sourceChanged, dura
9325
9521
  if (sourceChanged && durationInferred) return projectedEnd;
9326
9522
  return existingEnd <= 0 ? projectedEnd : Math.min(existingEnd, projectedEnd);
9327
9523
  }
9524
+ var MAX_MEDIA_SELECTOR_WORK = 1e6;
9525
+ var SIBLING_COMBINATOR = /[~+]/;
9526
+ function managedMediaElements(document2) {
9527
+ const managed = [];
9528
+ const pending = [];
9529
+ for (const element of Array.from(document2.children)) pending.push({ element, inMedia: false });
9530
+ for (let next = pending.pop(); next; next = pending.pop()) {
9531
+ const name = next.element.tagName.toLowerCase();
9532
+ const isMedia = name === "video" || name === "audio";
9533
+ if (isMedia || next.inMedia && name === "source") managed.push(next.element);
9534
+ for (const child2 of Array.from(next.element.children)) {
9535
+ pending.push({ element: child2, inMedia: next.inMedia || isMedia });
9536
+ }
9537
+ }
9538
+ return managed;
9539
+ }
9328
9540
  function hasRuntimeMediaChanges(html) {
9329
9541
  const { document: document2 } = parseHTML(html);
9330
9542
  const scriptBodies = [...document2.querySelectorAll("script")].map(
9331
9543
  (script) => script.textContent ?? ""
9332
9544
  );
9333
9545
  const insertedMedia = scriptBodies.some(
9334
- (script) => /\bcreateElement\s*\(\s*["'`](?:video|audio)["'`]\s*\)/i.test(script) || /\bnew\s+(?:Audio|Video)\s*\(/i.test(script) || /<(?:video|audio)\b[^>]*>/i.test(script)
9546
+ (script) => /\bcreateElement\s*\(\s*["'`](?:video|audio)["'`]\s*\)/i.test(script) || /\bnew\s+(?:Audio|Video)\s*\(/i.test(script) || hasClosedMediaTag(script)
9335
9547
  );
9336
9548
  if (insertedMedia) return true;
9337
- const isManagedMedia = (element) => {
9338
- const name = element.tagName.toLowerCase();
9339
- if (name === "video" || name === "audio") return true;
9340
- return name === "source" && element.closest("video, audio") !== null;
9341
- };
9549
+ const managed = managedMediaElements(document2);
9550
+ if (managed.length === 0) return false;
9551
+ const managedIds = new Set(managed.map((element) => element.getAttribute("id")).filter(Boolean));
9552
+ const selectors = /* @__PURE__ */ new Set();
9553
+ let selectorChars = 0;
9342
9554
  for (const script of scriptBodies) {
9343
9555
  for (const mutation of extractMediaSrcMutations(script)) {
9344
- try {
9345
- const id = /^#[A-Za-z_][\w-]*$/.test(mutation.selector) ? mutation.selector.slice(1) : null;
9346
- const idTarget = id ? document2.getElementById(id) : null;
9347
- const targets = id ? idTarget ? [idTarget] : [] : [...document2.querySelectorAll(mutation.selector)];
9348
- if (targets.some(isManagedMedia)) return true;
9349
- } catch {
9556
+ const id = /^#[A-Za-z_][\w-]*$/.test(mutation.selector) ? mutation.selector.slice(1) : null;
9557
+ if (id) {
9558
+ if (managedIds.has(id)) return true;
9559
+ continue;
9350
9560
  }
9561
+ if (selectors.has(mutation.selector)) continue;
9562
+ if (SIBLING_COMBINATOR.test(mutation.selector)) return true;
9563
+ selectors.add(mutation.selector);
9564
+ selectorChars += mutation.selector.length;
9565
+ if (selectorChars * managed.length > MAX_MEDIA_SELECTOR_WORK) return true;
9566
+ }
9567
+ }
9568
+ for (const selector of selectors) {
9569
+ try {
9570
+ if (managed.some((element) => element.matches(selector))) return true;
9571
+ } catch {
9351
9572
  }
9352
9573
  }
9353
9574
  return false;
@@ -9400,7 +9621,11 @@ async function runProbeStage(input) {
9400
9621
  compiled.html,
9401
9622
  composition.audios.length
9402
9623
  );
9403
- const hasVariableMedia = hasVariableBoundMedia(compiled.html, job.config.variables);
9624
+ const hasVariableMedia = hasVariableBoundMedia(
9625
+ compiled.html,
9626
+ job.config.variables,
9627
+ compiled.variablesByComp
9628
+ );
9404
9629
  const hasInsertedMedia = hasRuntimeMediaChanges(compiled.html);
9405
9630
  const needsBrowser = cfg.videoLayerPassthrough || input.measuresShownBoxes === true || probeRequiresBrowser({
9406
9631
  durationSeconds: composition.duration,
@@ -9431,7 +9656,8 @@ async function runProbeStage(input) {
9431
9656
  port: 0,
9432
9657
  preHeadScripts: [VIRTUAL_TIME_SHIM],
9433
9658
  fps: job.config.fps,
9434
- allowOutsideProjectAssets: job.config.allowOutsideProjectAssets
9659
+ allowOutsideProjectAssets: job.config.allowOutsideProjectAssets,
9660
+ includeOutsideScripts: job.config.includeOutsideScripts
9435
9661
  });
9436
9662
  assertNotAborted();
9437
9663
  const motionBlur = job.config.motionBlur;
@@ -9587,7 +9813,8 @@ async function runProbeStage(input) {
9587
9813
  resolutions,
9588
9814
  projectDir,
9589
9815
  join18(workDir, "downloads"),
9590
- job.config.allowOutsideProjectAssets ? void 0 : projectDir
9816
+ job.config.allowOutsideProjectAssets ? void 0 : projectDir,
9817
+ { includeScripts: job.config.includeOutsideScripts }
9591
9818
  );
9592
9819
  assertNotAborted();
9593
9820
  composition.videos = compiled.videos;
@@ -10944,7 +11171,17 @@ async function runFfprobeJson(args, signal) {
10944
11171
  if (!args.includes("--")) {
10945
11172
  throw new Error('[audioPadTrim] ffprobe args must terminate options with "--".');
10946
11173
  }
11174
+ const proxying = withPublicOnlyProxy(args, [args.indexOf("--") + 1]);
11175
+ const routed = proxying && await proxying;
11176
+ try {
11177
+ return await spawnFfprobeJson(routed?.args ?? args, routed?.env, signal);
11178
+ } finally {
11179
+ await routed?.close();
11180
+ }
11181
+ }
11182
+ async function spawnFfprobeJson(args, env, signal) {
10947
11183
  const proc = spawn(getFfprobeBinary(), args, {
11184
+ ...env && { env },
10948
11185
  stdio: ["ignore", "pipe", "pipe"],
10949
11186
  windowsHide: true
10950
11187
  });
@@ -11060,7 +11297,8 @@ function assertAudioNotInterrupted(failures) {
11060
11297
  }
11061
11298
  function runAudioStage(input) {
11062
11299
  return collectScratchLeftovers(
11063
- () => runAudioStageScoped(input),
11300
+ () => withFfmpegProgress(input.onFfmpegProgress ?? (() => {
11301
+ }), () => runAudioStageScoped(input)),
11064
11302
  (left) => {
11065
11303
  if (left.length > 0) input.log?.warn("[audio] scratch left behind", { count: left.length });
11066
11304
  }
@@ -12542,7 +12780,7 @@ import {
12542
12780
  readdirSync as readdirSync5,
12543
12781
  readFileSync as readFileSync7,
12544
12782
  rmSync as rmSync9,
12545
- statSync as statSync6,
12783
+ statSync as statSync7,
12546
12784
  writeFileSync as writeFileSync5
12547
12785
  } from "fs";
12548
12786
  import { readFile as readFile2 } from "fs/promises";
@@ -12656,7 +12894,7 @@ async function encodeGifFromDir(framesDir, framePattern, outputPath, input) {
12656
12894
  const failure = await reencodeWithClearedWholeFrames(argsInput, run, startTime);
12657
12895
  if (failure) return failure;
12658
12896
  }
12659
- const fileSize = existsSync19(outputPath) ? statSync6(outputPath).size : 0;
12897
+ const fileSize = existsSync19(outputPath) ? statSync7(outputPath).size : 0;
12660
12898
  return {
12661
12899
  success: true,
12662
12900
  outputPath,
@@ -12679,7 +12917,10 @@ function startEncodeProgress(job, stage, onProgress) {
12679
12917
  function resolveEngineConfig(input) {
12680
12918
  return input.engineConfig ?? input.job.config.producerConfig ?? resolveConfig();
12681
12919
  }
12682
- function videoEncoderOptions(input, engineCfg) {
12920
+ function overlapEncoderThreads(workerCount, cpuCount) {
12921
+ return Math.max(1, Math.floor(cpuCount) - Math.floor(workerCount));
12922
+ }
12923
+ function videoEncoderOptions(input, engineCfg, softwareEncoderThreads) {
12683
12924
  const { job, preset } = input;
12684
12925
  return {
12685
12926
  fps: job.config.fps,
@@ -12699,7 +12940,8 @@ function videoEncoderOptions(input, engineCfg) {
12699
12940
  // keyframes that survive `-f concat -c copy` at assemble time. In-process
12700
12941
  // renders leave both undefined → preserves the existing open-GOP output.
12701
12942
  lockGopForChunkConcat: input.lockGopForChunkConcat === true,
12702
- gopSize: input.gopSize
12943
+ gopSize: input.gopSize,
12944
+ softwareEncoderThreads
12703
12945
  };
12704
12946
  }
12705
12947
  function canEncodeWhileCapturing(input, workerCount, cpuCount) {
@@ -12715,8 +12957,9 @@ async function readLandedFrame(workerPath, mergedPath) {
12715
12957
  }
12716
12958
  return readFile2(mergedPath);
12717
12959
  }
12718
- function encodeWhileCapturing(input, totalFrames) {
12960
+ function encodeWhileCapturing(input, totalFrames, captureBudget) {
12719
12961
  const engineCfg = resolveEngineConfig(input);
12962
+ const softwareEncoderThreads = captureBudget ? overlapEncoderThreads(captureBudget.workerCount, captureBudget.cpuCount) : void 0;
12720
12963
  const stop = new AbortController();
12721
12964
  const signal = input.abortSignal ? AbortSignal.any([input.abortSignal, stop.signal]) : stop.signal;
12722
12965
  const landed = /* @__PURE__ */ new Map();
@@ -12731,7 +12974,10 @@ function encodeWhileCapturing(input, totalFrames) {
12731
12974
  let reportFed = null;
12732
12975
  const encoder = spawnStreamingEncoder(
12733
12976
  input.videoOnlyPath,
12734
- { ...videoEncoderOptions(input, engineCfg), imageFormat: "jpeg" },
12977
+ {
12978
+ ...videoEncoderOptions(input, engineCfg, softwareEncoderThreads),
12979
+ imageFormat: "jpeg"
12980
+ },
12735
12981
  signal,
12736
12982
  engineCfg
12737
12983
  );
@@ -13061,7 +13307,7 @@ function sampleDirectoryBytes(dir) {
13061
13307
  for (const name of entries) {
13062
13308
  const full = join29(current, name);
13063
13309
  try {
13064
- const st = statSync7(full);
13310
+ const st = statSync8(full);
13065
13311
  if (st.isDirectory()) {
13066
13312
  stack.push(full);
13067
13313
  } else if (st.isFile()) {
@@ -13216,7 +13462,7 @@ function findMissingFrameRanges(totalFrames, framesDir, frameExt) {
13216
13462
  let rangeStart = null;
13217
13463
  for (let frameIndex = 0; frameIndex < totalFrames; frameIndex++) {
13218
13464
  const framePath = join29(framesDir, formatCaptureFrameName(frameIndex, frameExt));
13219
- const missing = !existsSync20(framePath) || statSync7(framePath).size <= 8;
13465
+ const missing = !existsSync20(framePath) || statSync8(framePath).size <= 8;
13220
13466
  if (missing && rangeStart === null) {
13221
13467
  rangeStart = frameIndex;
13222
13468
  } else if (!missing && rangeStart !== null) {
@@ -14511,9 +14757,10 @@ async function executeRenderPipeline(input) {
14511
14757
  nativeHdrVideoCount: nativeHdrVideoIds.size,
14512
14758
  nativeHdrImageCount: nativeHdrImageIds.size
14513
14759
  });
14514
- updateJobStatus(job, "preprocessing", "Processing audio tracks", 20, onProgress, {
14760
+ updateJobStatus(job, "preprocessing", AUDIO_STAGE, 20, onProgress, {
14515
14761
  code: "process_audio"
14516
14762
  });
14763
+ const audioWait = audioWaitReporter(job, onProgress);
14517
14764
  const audioStage = observeRenderStage(
14518
14765
  observability,
14519
14766
  "audio_process",
@@ -14532,7 +14779,8 @@ async function executeRenderPipeline(input) {
14532
14779
  abortSignal: executionSignal,
14533
14780
  assertNotAborted,
14534
14781
  log,
14535
- keepDeliverySource: true
14782
+ keepDeliverySource: true,
14783
+ onFfmpegProgress: audioWait.progressed
14536
14784
  })
14537
14785
  );
14538
14786
  pendingAudio = audioStage.catch(() => void 0);
@@ -14551,7 +14799,8 @@ async function executeRenderPipeline(input) {
14551
14799
  port: 0,
14552
14800
  preHeadScripts: [VIRTUAL_TIME_SHIM],
14553
14801
  fps: job.config.fps,
14554
- allowOutsideProjectAssets: job.config.allowOutsideProjectAssets
14802
+ allowOutsideProjectAssets: job.config.allowOutsideProjectAssets,
14803
+ includeOutsideScripts: job.config.includeOutsideScripts
14555
14804
  });
14556
14805
  assertNotAborted();
14557
14806
  observability.stageEnd("file_server", fileServerStart);
@@ -15342,7 +15591,7 @@ async function executeRenderPipeline(input) {
15342
15591
  }
15343
15592
  const effectiveQuality = job.config.crf ?? preset.quality;
15344
15593
  const effectiveBitrate = job.config.crf != null ? void 0 : job.config.videoBitrate;
15345
- const audioResult = await audioStage;
15594
+ const audioResult = await audioWait.wait(audioStage);
15346
15595
  const { audioOutputPath, deliverySourcePath, hasAudio } = audioResult;
15347
15596
  perfStages.audioProcessMs = audioResult.audioProcessMs;
15348
15597
  recordLimiterAttenuation(job, audioResult.audioLoweredDb);
@@ -15840,7 +16089,10 @@ async function executeRenderPipeline(input) {
15840
16089
  assertNotAborted,
15841
16090
  onProgress
15842
16091
  };
15843
- const overlap = !cfg.useDrawElement && workerSizing !== void 0 && canEncodeWhileCapturing(encodeInput, capturePlan.workerCount, workerSizing.cpuCount) ? encodeWhileCapturing(encodeInput, totalFrames) : null;
16092
+ const overlap = !cfg.useDrawElement && workerSizing !== void 0 && canEncodeWhileCapturing(encodeInput, capturePlan.workerCount, workerSizing.cpuCount) ? encodeWhileCapturing(encodeInput, totalFrames, {
16093
+ workerCount: capturePlan.workerCount,
16094
+ cpuCount: workerSizing.cpuCount
16095
+ }) : null;
15844
16096
  const captureFrameStart = Date.now();
15845
16097
  const invokeDiskCapture = (diskPlan) => observeRenderStage(
15846
16098
  observability,
@@ -16860,8 +17112,10 @@ function buildSyntheticRenderJob(input) {
16860
17112
  producerConfig: input.producerConfig,
16861
17113
  variables: input.variables,
16862
17114
  strictVariables: input.strictVariables,
17115
+ expectedOutputDimensions: input.expectedOutputDimensions,
16863
17116
  pageMotionBlur: input.pageMotionBlur,
16864
- allowOutsideProjectAssets: input.allowOutsideProjectAssets
17117
+ allowOutsideProjectAssets: input.allowOutsideProjectAssets,
17118
+ includeOutsideScripts: input.includeOutsideScripts
16865
17119
  };
16866
17120
  return createRenderJob(renderConfig);
16867
17121
  }
@@ -18326,8 +18580,10 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
18326
18580
  producerConfig: cfg,
18327
18581
  variables: config.variables,
18328
18582
  strictVariables: config.strictVariables,
18583
+ expectedOutputDimensions: config.expectedOutputDimensions,
18329
18584
  pageMotionBlur: config.pageMotionBlur,
18330
- allowOutsideProjectAssets: options.allowOutsideProjectAssets === true
18585
+ allowOutsideProjectAssets: options.allowOutsideProjectAssets === true,
18586
+ includeOutsideScripts: options.includeOutsideScripts === true
18331
18587
  });
18332
18588
  const entryFile = config.entryFile ?? "index.html";
18333
18589
  const htmlPath = join38(projectDir, entryFile);
@@ -18348,7 +18604,9 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
18348
18604
  if (rel === "") return true;
18349
18605
  if (leavesRoot(rel)) return false;
18350
18606
  if (job.config.allowOutsideProjectAssets) {
18351
- if (refusesOutsideLink(projectDir, src, (line) => log.warn(`[Plan] ${line}`))) return false;
18607
+ const warn = (line) => log.warn(`[Plan] ${line}`);
18608
+ const policy = { includeScripts: job.config.includeOutsideScripts };
18609
+ if (refusesOutsideLink(projectDir, src, warn, policy)) return false;
18352
18610
  } else if (!isSafePath(projectDir, src)) return false;
18353
18611
  const firstSegment = rel.split(sep3, 1)[0];
18354
18612
  return firstSegment === void 0 || !PLAN_PROJECT_DIR_SKIP_SEGMENTS.has(firstSegment);
@@ -18455,7 +18713,7 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
18455
18713
  if (probeResult.fileServer) closeFileServerSafely(probeResult.fileServer, "plan", log);
18456
18714
  if (probeResult.probeSession) {
18457
18715
  try {
18458
- const { closeCaptureSession: closeCaptureSession2 } = await import("./src-R57EQQSI.js");
18716
+ const { closeCaptureSession: closeCaptureSession2 } = await import("./src-BNSCFKOD.js");
18459
18717
  await closeCaptureSession2(probeResult.probeSession);
18460
18718
  } catch (err) {
18461
18719
  log.warn("[plan] probe session close failed", {
@@ -18793,6 +19051,7 @@ async function buildLocalExecutionPlan(projectDir, config, executionPlanDir, opt
18793
19051
  format: config.format,
18794
19052
  ffmpegVersion,
18795
19053
  producerVersion,
19054
+ ...job.outputDimensionsChecked === void 0 ? {} : { outputDimensionsChecked: job.outputDimensionsChecked },
18796
19055
  ...job.strictVariablesChecked === void 0 ? {} : { strictVariablesChecked: job.strictVariablesChecked }
18797
19056
  };
18798
19057
  }
@@ -18811,6 +19070,7 @@ async function plan(projectDir, config, planDir, options = {}) {
18811
19070
  format: executionPlan.format,
18812
19071
  ffmpegVersion: executionPlan.ffmpegVersion,
18813
19072
  producerVersion: executionPlan.producerVersion,
19073
+ ...executionPlan.outputDimensionsChecked === void 0 ? {} : { outputDimensionsChecked: executionPlan.outputDimensionsChecked },
18814
19074
  ...executionPlan.strictVariablesChecked === void 0 ? {} : { strictVariablesChecked: executionPlan.strictVariablesChecked }
18815
19075
  };
18816
19076
  }
@@ -18829,7 +19089,7 @@ import {
18829
19089
  readFileSync as readFileSync11,
18830
19090
  readdirSync as readdirSync10,
18831
19091
  rmSync as rmSync14,
18832
- statSync as statSync9,
19092
+ statSync as statSync10,
18833
19093
  writeFileSync as writeFileSync11
18834
19094
  } from "fs";
18835
19095
  import { tmpdir as tmpdir3 } from "os";
@@ -18842,7 +19102,7 @@ import {
18842
19102
  linkSync as linkSync2,
18843
19103
  mkdirSync as mkdirSync15,
18844
19104
  rmSync as rmSync13,
18845
- statSync as statSync8,
19105
+ statSync as statSync9,
18846
19106
  writeFileSync as writeFileSync10
18847
19107
  } from "fs";
18848
19108
  import { dirname as dirname15, join as join40 } from "path";
@@ -18910,7 +19170,7 @@ var LocalPlanV2ArtifactPublisher = class {
18910
19170
  }
18911
19171
  async putBlob(blob) {
18912
19172
  const digest = assertPlanV2Sha256(blob.sha256, "published blob sha256");
18913
- const sourceSize = statSync8(blob.sourcePath).size;
19173
+ const sourceSize = statSync9(blob.sourcePath).size;
18914
19174
  if (sourceSize !== blob.sizeBytes) {
18915
19175
  throw new PlanV2IntegrityError(
18916
19176
  `published blob size changed for ${digest}: expected ${blob.sizeBytes}, got ${sourceSize}`
@@ -19223,7 +19483,7 @@ function publishBlobFor(absolutePath, digests) {
19223
19483
  return {
19224
19484
  sourcePath: absolutePath,
19225
19485
  sha256: planFileSha256(absolutePath, digests),
19226
- sizeBytes: statSync9(absolutePath).size
19486
+ sizeBytes: statSync10(absolutePath).size
19227
19487
  };
19228
19488
  }
19229
19489
  async function putBlobs(publisher, blobs) {
@@ -19402,7 +19662,10 @@ async function planV2WithPublisher(projectDir, config, publisher, options = {})
19402
19662
  sliceChunkAudio: true,
19403
19663
  deferAudio: options.deferAudio
19404
19664
  });
19405
- options.onPlanned?.({ strictVariablesChecked: planned.strictVariablesChecked });
19665
+ options.onPlanned?.({
19666
+ strictVariablesChecked: planned.strictVariablesChecked,
19667
+ outputDimensionsChecked: planned.outputDimensionsChecked
19668
+ });
19406
19669
  return await publishExecutionPlan(stagingRoot, publisher, { digests, log: config.logger });
19407
19670
  } catch (error) {
19408
19671
  try {
@@ -19591,7 +19854,7 @@ function verifyBlob(planV2Dir, artifact) {
19591
19854
  if (!existsSync27(sourcePath)) {
19592
19855
  throw new PlanV2IntegrityError(`missing content-addressed artifact ${artifact.sha256}`);
19593
19856
  }
19594
- const stats = statSync9(sourcePath);
19857
+ const stats = statSync10(sourcePath);
19595
19858
  if (!stats.isFile() || stats.size !== artifact.sizeBytes) {
19596
19859
  throw new PlanV2IntegrityError(`artifact size mismatch for ${artifact.path}`);
19597
19860
  }
@@ -19684,7 +19947,7 @@ function readValidatedPlanV2Materialization(planDir, expectedTarget) {
19684
19947
  for (const artifact of required) {
19685
19948
  if (Object.hasOwn(remoteSources, artifact.path)) continue;
19686
19949
  const path = join41(planDir, ...artifact.path.split("/"));
19687
- if (!existsSync27(path) || statSync9(path).size !== artifact.sizeBytes) {
19950
+ if (!existsSync27(path) || statSync10(path).size !== artifact.sizeBytes) {
19688
19951
  throw new PlanV2IntegrityError(
19689
19952
  `materialized artifact missing or truncated: ${artifact.path}`
19690
19953
  );
@@ -20224,7 +20487,10 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
20224
20487
  const captureSession = session;
20225
20488
  session = null;
20226
20489
  verifyStarted = Date.now();
20227
- overlap.current = canEncodeWhileCapturing(encodeInput, chunkWorkerCount, usableCpuCount()) ? encodeWhileCapturing(encodeInput, framesInChunk) : null;
20490
+ overlap.current = canEncodeWhileCapturing(encodeInput, chunkWorkerCount, usableCpuCount()) ? encodeWhileCapturing(encodeInput, framesInChunk, {
20491
+ workerCount: chunkWorkerCount,
20492
+ cpuCount: usableCpuCount()
20493
+ }) : null;
20228
20494
  await observeRenderStage(
20229
20495
  new RenderObservabilityRecorder({ pipelineStartMs: start, log }),
20230
20496
  "capture_chunk",
@@ -20429,7 +20695,11 @@ async function renderSpan(projectDir, config, span, outputPath, options = {}) {
20429
20695
  projectDir,
20430
20696
  { ...config, rejectOnSystemFonts: false, failClosedFontFetch: false },
20431
20697
  planDir,
20432
- { chunksCarryAudio: true, allowOutsideProjectAssets: options.allowOutsideProjectAssets }
20698
+ {
20699
+ chunksCarryAudio: true,
20700
+ allowOutsideProjectAssets: options.allowOutsideProjectAssets,
20701
+ includeOutsideScripts: options.includeOutsideScripts
20702
+ }
20433
20703
  );
20434
20704
  const { startFrame, endFrame } = spanFrameRange(
20435
20705
  span.startSeconds,
@@ -20478,7 +20748,9 @@ var SAFE_RENDER_ERROR_CODES = /* @__PURE__ */ new Set([
20478
20748
  "RENDER_TOO_SLOW",
20479
20749
  "RENDER_STAGE_STALLED",
20480
20750
  "PAGE_NEVER_READY",
20481
- "VARIABLES_INVALID"
20751
+ "VARIABLES_INVALID",
20752
+ "OUTPUT_DIMENSIONS_MISMATCH",
20753
+ "COMPOSITION_TOO_LARGE"
20482
20754
  ]);
20483
20755
  function extractSafeRenderErrorCode(error) {
20484
20756
  if (typeof error !== "object" || error === null || !("code" in error)) return void 0;
@@ -20520,6 +20792,12 @@ function validateDistributedRenderConfig(config) {
20520
20792
  `must be one of ${DISTRIBUTED_FPS.join(", ")}; got ${String(config.fps)}`
20521
20793
  );
20522
20794
  }
20795
+ if (config.expectedOutputDimensions !== void 0 && !isExpectedOutputDimensions(config.expectedOutputDimensions)) {
20796
+ throw new InvalidConfigError(
20797
+ "config.expectedOutputDimensions",
20798
+ "must contain positive integer width and height"
20799
+ );
20800
+ }
20523
20801
  validateIntDimension("config.width", config.width);
20524
20802
  validateIntDimension("config.height", config.height);
20525
20803
  if (config.pageMotionBlur !== void 0 && config.pageMotionBlur !== "off") {
@@ -20873,6 +21151,11 @@ function assertRequestOptionScalars(options) {
20873
21151
  }
20874
21152
  function assertRequestOptionObjects(options) {
20875
21153
  validateEngineConfigSnapshot(options.engineConfig);
21154
+ if (options.expectedOutputDimensions !== void 0 && !isExpectedOutputDimensions(options.expectedOutputDimensions)) {
21155
+ throw new Error(
21156
+ "Render request expectedOutputDimensions must contain positive integer width and height"
21157
+ );
21158
+ }
20876
21159
  if (options.variables !== void 0 && !isPlainObject(options.variables)) {
20877
21160
  throw new Error("Render request variables must be a JSON object");
20878
21161
  }
@@ -20938,7 +21221,8 @@ function renderConfigFromRequest(request, runtime = {}) {
20938
21221
  ...options,
20939
21222
  producerConfig: engineConfig,
20940
21223
  logger: runtime.logger,
20941
- allowOutsideProjectAssets: runtime.allowOutsideProjectAssets === true
21224
+ allowOutsideProjectAssets: runtime.allowOutsideProjectAssets === true,
21225
+ includeOutsideScripts: runtime.includeOutsideScripts === true
20942
21226
  };
20943
21227
  }
20944
21228
  function distributedFps(fps) {
@@ -20993,7 +21277,8 @@ function distributedConfigFromRequest(request, runtime = {}) {
20993
21277
  abortSignal: runtime.abortSignal,
20994
21278
  planDirSizeLimitBytes: distributed.planDirSizeLimitBytes,
20995
21279
  variables: options.variables,
20996
- strictVariables: options.strictVariables
21280
+ strictVariables: options.strictVariables,
21281
+ expectedOutputDimensions: options.expectedOutputDimensions
20997
21282
  };
20998
21283
  }
20999
21284
  function optionalProperty(key, value) {
@@ -21035,7 +21320,8 @@ function renderRequestFromDistributedConfig(input) {
21035
21320
  ...optionalProperty("strictness", config.strictness),
21036
21321
  ...optionalProperty("entryFile", config.entryFile),
21037
21322
  ...optionalProperty("variables", config.variables),
21038
- ...optionalProperty("strictVariables", config.strictVariables)
21323
+ ...optionalProperty("strictVariables", config.strictVariables),
21324
+ ...optionalProperty("expectedOutputDimensions", config.expectedOutputDimensions)
21039
21325
  };
21040
21326
  return createRenderRequest({
21041
21327
  projectDir: input.projectDir,
@@ -21049,13 +21335,13 @@ function renderRequestFromDistributedConfig(input) {
21049
21335
  import {
21050
21336
  existsSync as existsSync31,
21051
21337
  mkdirSync as mkdirSync19,
21052
- statSync as statSync11,
21338
+ statSync as statSync12,
21053
21339
  mkdtempSync as mkdtempSync2,
21054
21340
  writeFileSync as writeFileSync13,
21055
21341
  rmSync as rmSync17,
21056
21342
  createReadStream as createReadStream5
21057
21343
  } from "fs";
21058
- import { resolve as resolve10, dirname as dirname18, join as join46 } from "path";
21344
+ import { resolve as resolve10, dirname as dirname19, join as join46 } from "path";
21059
21345
  import { tmpdir as tmpdir5 } from "os";
21060
21346
  import { parseArgs } from "util";
21061
21347
  import { isIP } from "net";
@@ -21068,13 +21354,15 @@ import { serve as serve2 } from "@hono/node-server";
21068
21354
  import {
21069
21355
  existsSync as existsSync29,
21070
21356
  readFileSync as readFileSync14,
21071
- statSync as statSync10,
21357
+ statSync as statSync11,
21072
21358
  openSync as openSync6,
21073
21359
  fstatSync as fstatSync3,
21074
21360
  closeSync as closeSync6,
21075
21361
  constants as constants3
21076
21362
  } from "fs";
21077
- import { resolve as resolve9, join as join44, relative as relative8, isAbsolute as isAbsolute4, sep as sep5 } from "path";
21363
+ import { resolve as resolve9, join as join44, relative as relative8, isAbsolute as isAbsolute4, sep as sep5, dirname as dirname17 } from "path";
21364
+ import { fileURLToPath as fileURLToPath5 } from "url";
21365
+ import { Worker as Worker2 } from "worker_threads";
21078
21366
  function isStringRecord(value) {
21079
21367
  if (!value || typeof value !== "object" || Array.isArray(value)) {
21080
21368
  return false;
@@ -21107,7 +21395,7 @@ function readEntryHtml(filePath) {
21107
21395
  } catch (error) {
21108
21396
  if (error instanceof Error && "code" in error && (error.code === "ENOENT" || error.code === "ENOTDIR"))
21109
21397
  return null;
21110
- if (!statSync10(filePath, { throwIfNoEntry: false })?.isFile()) return null;
21398
+ if (!statSync11(filePath, { throwIfNoEntry: false })?.isFile()) return null;
21111
21399
  throw error;
21112
21400
  }
21113
21401
  try {
@@ -21123,7 +21411,7 @@ function leavesProject(absProjectDir, absoluteEntryPath, isAllowedEntry) {
21123
21411
  }
21124
21412
  function readProjectEntryFile(projectDir, preferredEntryFile, isAllowedEntry) {
21125
21413
  const absProjectDir = resolve9(projectDir);
21126
- if (!existsSync29(absProjectDir) || !statSync10(absProjectDir).isDirectory()) {
21414
+ if (!existsSync29(absProjectDir) || !statSync11(absProjectDir).isDirectory()) {
21127
21415
  return { error: `Project directory not found: ${absProjectDir}` };
21128
21416
  }
21129
21417
  const entryCandidates = [preferredEntryFile, "index.html", "src/index.html"].filter(
@@ -21180,17 +21468,111 @@ function prepareHyperframeLintBody(body, isAllowedEntry) {
21180
21468
  }
21181
21469
  return { error: "Missing lint source: provide projectDir, files, or html" };
21182
21470
  }
21183
- async function runHyperframeLint(prepared) {
21184
- return lintHyperframeHtml(prepared.html, {
21185
- filePath: prepared.entryFile,
21186
- compSrcPath: prepared.entryFile
21471
+ var LINT_HEAP_MB = 512;
21472
+ var LINT_TIMEOUT_MS = 15e3;
21473
+ var LINT_MAX_WORKERS = 2;
21474
+ var waiting = [];
21475
+ var running = 0;
21476
+ function takeLintSlot(limit, waitMs) {
21477
+ if (running < limit) {
21478
+ running++;
21479
+ return Promise.resolve(true);
21480
+ }
21481
+ return new Promise((resolve11) => {
21482
+ const entry = () => {
21483
+ clearTimeout(timer);
21484
+ running++;
21485
+ resolve11(true);
21486
+ };
21487
+ const timer = setTimeout(
21488
+ () => {
21489
+ waiting.splice(waiting.indexOf(entry), 1);
21490
+ resolve11(false);
21491
+ },
21492
+ Math.max(0, waitMs)
21493
+ );
21494
+ waiting.push(entry);
21495
+ });
21496
+ }
21497
+ function freeLintSlot() {
21498
+ running--;
21499
+ waiting.shift()?.();
21500
+ }
21501
+ function resolveLintWorkerEntry() {
21502
+ const here = dirname17(fileURLToPath5(import.meta.url));
21503
+ for (const name of ["hyperframeLintWorker.js", "hyperframeLintWorker.ts"]) {
21504
+ const candidate = join44(here, name);
21505
+ if (existsSync29(candidate)) return candidate;
21506
+ }
21507
+ return void 0;
21508
+ }
21509
+ function abortedLintResult(filePath, afterMs) {
21510
+ return {
21511
+ ok: false,
21512
+ errorCount: 1,
21513
+ warningCount: 0,
21514
+ infoCount: 0,
21515
+ findings: [
21516
+ {
21517
+ code: "lint_aborted",
21518
+ severity: "error",
21519
+ message: "This composition's script could not be checked: linting it ran too long or out of memory, so it was stopped. A very large or deeply nested script is the usual cause.",
21520
+ file: filePath
21521
+ }
21522
+ ],
21523
+ timings: { totalMs: afterMs, groupMs: {}, slowestRule: "", slowestRuleMs: 0 }
21524
+ };
21525
+ }
21526
+ async function runHyperframeLint(prepared, options = {}) {
21527
+ const began = performance.now();
21528
+ const aborted = () => abortedLintResult(prepared.entryFile, Math.round(performance.now() - began));
21529
+ const entry = options.workerEntry ?? resolveLintWorkerEntry();
21530
+ if (!entry) return aborted();
21531
+ const timeoutMs = options.timeoutMs ?? LINT_TIMEOUT_MS;
21532
+ const gotSlot = await takeLintSlot(options.maxWorkers ?? LINT_MAX_WORKERS, timeoutMs);
21533
+ if (!gotSlot) return aborted();
21534
+ const remainingMs = Math.max(0, timeoutMs - (performance.now() - began));
21535
+ return new Promise((resolvePromise, reject) => {
21536
+ let worker;
21537
+ try {
21538
+ worker = new Worker2(entry, {
21539
+ workerData: {
21540
+ html: prepared.html,
21541
+ opts: { filePath: prepared.entryFile, compSrcPath: prepared.entryFile }
21542
+ },
21543
+ resourceLimits: { maxOldGenerationSizeMb: options.heapMb ?? LINT_HEAP_MB },
21544
+ stdout: false,
21545
+ stderr: false
21546
+ });
21547
+ } catch {
21548
+ freeLintSlot();
21549
+ resolvePromise(aborted());
21550
+ return;
21551
+ }
21552
+ let settled = false;
21553
+ const settle = (finish) => {
21554
+ if (settled) return;
21555
+ settled = true;
21556
+ clearTimeout(timer);
21557
+ void worker.terminate().finally(freeLintSlot);
21558
+ finish();
21559
+ };
21560
+ const timer = setTimeout(() => settle(() => resolvePromise(aborted())), remainingMs);
21561
+ worker.on(
21562
+ "message",
21563
+ (message) => settle(
21564
+ () => message.result ? resolvePromise(message.result) : reject(new Error(message.error))
21565
+ )
21566
+ );
21567
+ worker.on("error", () => settle(() => resolvePromise(aborted())));
21568
+ worker.on("exit", () => settle(() => resolvePromise(aborted())));
21187
21569
  });
21188
21570
  }
21189
21571
 
21190
21572
  // ../producer/src/services/healthWorker.ts
21191
- import { Worker as Worker2 } from "worker_threads";
21192
- import { fileURLToPath as fileURLToPath5 } from "url";
21193
- import { dirname as dirname17, join as join45 } from "path";
21573
+ import { Worker as Worker3 } from "worker_threads";
21574
+ import { fileURLToPath as fileURLToPath6 } from "url";
21575
+ import { dirname as dirname18, join as join45 } from "path";
21194
21576
  import { existsSync as existsSync30 } from "fs";
21195
21577
  var DEFAULT_HEALTH_PORT = 9848;
21196
21578
  async function startHealthWorker(options = {}) {
@@ -21202,7 +21584,7 @@ async function startHealthWorker(options = {}) {
21202
21584
  "[healthWorker] could not resolve worker entry. Pass options.workerEntry or ensure healthWorkerThread.{js,ts} is co-located."
21203
21585
  );
21204
21586
  }
21205
- const worker = new Worker2(entry, {
21587
+ const worker = new Worker3(entry, {
21206
21588
  workerData: { port },
21207
21589
  // Keep stdio inherited so the worker's console logs land in the pod logs
21208
21590
  // alongside the main thread's.
@@ -21265,7 +21647,7 @@ function defaultLogger2() {
21265
21647
  };
21266
21648
  }
21267
21649
  function resolveWorkerEntry2() {
21268
- const here = dirname17(fileURLToPath5(import.meta.url));
21650
+ const here = dirname18(fileURLToPath6(import.meta.url));
21269
21651
  const candidates = [join45(here, "healthWorkerThread.js"), join45(here, "healthWorkerThread.ts")];
21270
21652
  for (const candidate of candidates) {
21271
21653
  if (existsSync30(candidate)) return candidate;
@@ -21372,6 +21754,7 @@ function parseRenderOptions(body) {
21372
21754
  outputDynamicRange,
21373
21755
  variables,
21374
21756
  strictVariables,
21757
+ expectedOutputDimensions: isExpectedOutputDimensions(body.expectedOutputDimensions) ? body.expectedOutputDimensions : void 0,
21375
21758
  outputResolution,
21376
21759
  outputResolutionAspectAgnostic,
21377
21760
  videoFrameFormat
@@ -21411,6 +21794,7 @@ function buildRenderJobConfig(input, outputPath, log) {
21411
21794
  entryFile: input.entryFile,
21412
21795
  variables: input.variables,
21413
21796
  strictVariables: input.strictVariables,
21797
+ expectedOutputDimensions: input.expectedOutputDimensions,
21414
21798
  outputResolution: input.outputResolution,
21415
21799
  outputResolutionAspectAgnostic: input.outputResolutionAspectAgnostic,
21416
21800
  videoFrameFormat: input.videoFrameFormat,
@@ -21429,7 +21813,7 @@ function resolvePreparedRenderOutput(prepared, rendersDir, log, confineOutput) {
21429
21813
  throw new Error("outputPath must be inside the renders directory");
21430
21814
  }
21431
21815
  }
21432
- const outputDir = dirname18(absoluteOutputPath);
21816
+ const outputDir = dirname19(absoluteOutputPath);
21433
21817
  if (!existsSync31(outputDir)) mkdirSync19(outputDir, { recursive: true });
21434
21818
  return { input, cleanupProjectDir, absoluteOutputPath };
21435
21819
  }
@@ -21455,6 +21839,9 @@ function validateRenderOverrides(body) {
21455
21839
  if (body.variables !== void 0 && !isPlainObject2(body.variables)) {
21456
21840
  return 'variables must be a JSON object keyed by variable id (e.g. {"title":"Hello"})';
21457
21841
  }
21842
+ if (body.expectedOutputDimensions !== void 0 && !isExpectedOutputDimensions(body.expectedOutputDimensions)) {
21843
+ return "expectedOutputDimensions must contain positive integer width and height";
21844
+ }
21458
21845
  if (body.strictVariables !== void 0 && typeof body.strictVariables !== "boolean") {
21459
21846
  return "strictVariables must be a boolean";
21460
21847
  }
@@ -21505,7 +21892,7 @@ function prepareProjectDirectory(projectDir, options, policy) {
21505
21892
  if (!candidate) return null;
21506
21893
  const absProjectDir = policy ? resolve10(policy.projectsDir, candidate) : resolve10(candidate);
21507
21894
  const shown = policy ? candidate : absProjectDir;
21508
- if (policy && !isAllowedProjectPath(policy.projectsDir, absProjectDir) || !existsSync31(absProjectDir) || !statSync11(absProjectDir).isDirectory()) {
21895
+ if (policy && !isAllowedProjectPath(policy.projectsDir, absProjectDir) || !existsSync31(absProjectDir) || !statSync12(absProjectDir).isDirectory()) {
21509
21896
  return { error: `Project directory not found: ${shown}` };
21510
21897
  }
21511
21898
  const entry = options.entryFile || "index.html";
@@ -21608,7 +21995,7 @@ function publicPerfSummary(job) {
21608
21995
  return job.perfSummary ? { ...job.perfSummary, renderId: void 0 } : null;
21609
21996
  }
21610
21997
  function outputFileSize(path) {
21611
- return existsSync31(path) ? statSync11(path).size : 0;
21998
+ return existsSync31(path) ? statSync12(path).size : 0;
21612
21999
  }
21613
22000
  function createBlockingProgressReporter(log, requestId) {
21614
22001
  let lastLoggedPct = -10;
@@ -21811,7 +22198,8 @@ function createRenderHandlers(options = {}) {
21811
22198
  outcome: job.outcome ?? "completed",
21812
22199
  warnings: job.warnings,
21813
22200
  perf: policy ? publicPerfSummary(job) : job.perfSummary ?? null,
21814
- ...strictVariablesResult(job)
22201
+ ...strictVariablesResult(job),
22202
+ ...job.outputDimensionsChecked === void 0 ? {} : { outputDimensionsChecked: job.outputDimensionsChecked }
21815
22203
  });
21816
22204
  } catch (error) {
21817
22205
  const durationMs = Date.now() - t0;
@@ -21908,7 +22296,8 @@ function createRenderHandlers(options = {}) {
21908
22296
  warnings: job.warnings,
21909
22297
  perf: policy ? publicPerfSummary(job) : job.perfSummary ?? null,
21910
22298
  producerVersion: readProducerVersion(),
21911
- ...strictVariablesResult(job)
22299
+ ...strictVariablesResult(job),
22300
+ ...job.outputDimensionsChecked === void 0 ? {} : { outputDimensionsChecked: job.outputDimensionsChecked }
21912
22301
  })
21913
22302
  });
21914
22303
  } catch (error) {
@@ -21937,7 +22326,7 @@ function createRenderHandlers(options = {}) {
21937
22326
  store.delete(token);
21938
22327
  return c.json({ success: false, error: "Output artifact file missing" }, 404);
21939
22328
  }
21940
- const stats = statSync11(artifact.path);
22329
+ const stats = statSync12(artifact.path);
21941
22330
  return new Response(createReadStream5(artifact.path), {
21942
22331
  headers: {
21943
22332
  "content-type": "video/mp4",
@@ -22074,7 +22463,7 @@ function startServer(options = {}) {
22074
22463
  });
22075
22464
  async function shutdown(signal) {
22076
22465
  log.info(`Received ${signal}, shutting down`);
22077
- const { drainBrowserPool } = await import("./src-R57EQQSI.js");
22466
+ const { drainBrowserPool } = await import("./src-BNSCFKOD.js");
22078
22467
  await drainBrowserPool().catch(() => {
22079
22468
  });
22080
22469
  const handle = await Promise.race([
@@ -22122,10 +22511,10 @@ import {
22122
22511
  readFileSync as readFileSync15,
22123
22512
  readdirSync as readdirSync12,
22124
22513
  rmSync as rmSync18,
22125
- statSync as statSync12,
22514
+ statSync as statSync13,
22126
22515
  writeFileSync as writeFileSync14
22127
22516
  } from "fs";
22128
- import { basename as basename7, dirname as dirname19, join as join47 } from "path";
22517
+ import { basename as basename7, dirname as dirname20, join as join47 } from "path";
22129
22518
  function cfrRateControlArgs(locked) {
22130
22519
  const preset = getEncoderPreset(locked.quality ?? "standard", "mp4");
22131
22520
  if (locked.crf == null && locked.bitrate) {
@@ -22153,15 +22542,15 @@ async function assemble(planDir, chunkOutputs, audioPath, outputPath, options) {
22153
22542
  outputPath,
22154
22543
  durationMs: Date.now() - start,
22155
22544
  framesEncoded: plan2.totalFrames,
22156
- fileSize: statSync12(outputPath).size
22545
+ fileSize: statSync13(outputPath).size
22157
22546
  };
22158
22547
  }
22159
22548
  const format = plan2.dimensions.format;
22160
22549
  const cfrEncoder = cfr ? readCfrEncoder(planDir, format) : null;
22161
- if (!existsSync32(dirname19(outputPath))) {
22162
- mkdirSync20(dirname19(outputPath), { recursive: true });
22550
+ if (!existsSync32(dirname20(outputPath))) {
22551
+ mkdirSync20(dirname20(outputPath), { recursive: true });
22163
22552
  }
22164
- const workDir = createStagingDir(dirname19(outputPath), `${basename7(outputPath)}.assemble-work-`);
22553
+ const workDir = createStagingDir(dirname20(outputPath), `${basename7(outputPath)}.assemble-work-`);
22165
22554
  const fps = { num: plan2.dimensions.fpsNum, den: plan2.dimensions.fpsDen };
22166
22555
  const stageMs = {};
22167
22556
  const ctx = {
@@ -22200,7 +22589,7 @@ async function assemble(planDir, chunkOutputs, audioPath, outputPath, options) {
22200
22589
  });
22201
22590
  }
22202
22591
  }
22203
- const fileSize = existsSync32(outputPath) ? statSync12(outputPath).size : 0;
22592
+ const fileSize = existsSync32(outputPath) ? statSync13(outputPath).size : 0;
22204
22593
  return {
22205
22594
  ...referenceBackgroundResult(plan2[REFERENCE_BACKGROUND_FIELD]),
22206
22595
  outputPath,
@@ -22398,7 +22787,7 @@ function mergePngFrameDirs(chunkPaths, outputPath, totalFrames, audioPath, start
22398
22787
  mkdirSync20(outputPath, { recursive: true });
22399
22788
  let globalIdx = 0;
22400
22789
  for (const chunkDir of chunkPaths) {
22401
- if (!statSync12(chunkDir).isDirectory()) {
22790
+ if (!statSync13(chunkDir).isDirectory()) {
22402
22791
  throw new Error(
22403
22792
  `[assemble] png-sequence chunk must be a directory: ${chunkDir} (got a file)`
22404
22793
  );
@@ -22425,7 +22814,7 @@ function mergePngFrameDirs(chunkPaths, outputPath, totalFrames, audioPath, start
22425
22814
  let fileSize = 0;
22426
22815
  for (const name of readdirSync12(outputPath)) {
22427
22816
  try {
22428
- fileSize += statSync12(join47(outputPath, name)).size;
22817
+ fileSize += statSync13(join47(outputPath, name)).size;
22429
22818
  } catch {
22430
22819
  }
22431
22820
  }
@@ -22470,9 +22859,9 @@ async function assembleV2(planV2Dir, chunkPaths, outputPath, options) {
22470
22859
  }
22471
22860
 
22472
22861
  // ../producer/src/services/distributed/projectHash.ts
22473
- import { closeSync as closeSync7, openSync as openSync7, readdirSync as readdirSync13, readSync as readSync5, realpathSync as realpathSync2, statSync as statSync13 } from "fs";
22862
+ import { closeSync as closeSync7, openSync as openSync7, readdirSync as readdirSync13, readSync as readSync5, realpathSync as realpathSync2, statSync as statSync14 } from "fs";
22474
22863
  import { createHash as createHash8 } from "crypto";
22475
- import { join as join49 } from "path";
22864
+ import { join as join49, sep as sep6 } from "path";
22476
22865
  var READ_CHUNK_BYTES = 256 * 1024;
22477
22866
 
22478
22867
  // ../producer/src/services/distributed/audioSidecar.ts