hyperframes 0.9.59 → 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 (332) hide show
  1. package/dist/{add-C7J7HSLI.js → add-LNPIKHAX.js} +26 -27
  2. package/dist/{agentPromptGenerator-GCLJUGVE.js → agentPromptGenerator-N3HL4JWM.js} +15 -17
  3. package/dist/{animatedGifPrep-JPQZPZC4.js → animatedGifPrep-SEPXIM4W.js} +20 -21
  4. package/dist/api.d.ts +8 -1
  5. package/dist/api.js +58 -58
  6. package/dist/{appHistory-TQ6JAEP5.js → appHistory-ASGUPUUV.js} +5 -6
  7. package/dist/{asset-HQEPGBDJ.js → asset-3L2G3ROU.js} +15 -5
  8. package/dist/{assetCataloger-LMPPKPF6.js → assetCataloger-3D75A6GI.js} +16 -18
  9. package/dist/{audio-FD2EBZ6D.js → audio-U4W5ZWQ7.js} +45 -45
  10. package/dist/{auth-JA7XH6NG.js → auth-V4G5ZE3P.js} +4 -4
  11. package/dist/{autoUpdate-WKW2OMIY.js → autoUpdate-QYKF3DDS.js} +4 -4
  12. package/dist/{avatars-Q7U6CO4X.js → avatars-SB2XCDWJ.js} +23 -25
  13. package/dist/{backgroundChecks-H2SOS2CM.js → backgroundChecks-KHBYRE6J.js} +5 -5
  14. package/dist/backgroundChecksWorker.js +5 -5
  15. package/dist/{batchRender-75OLVMZY.js → batchRender-6S5GMICZ.js} +7 -9
  16. package/dist/{beats-R4EHWWJN.js → beats-7YLYCCMD.js} +16 -18
  17. package/dist/{benchmark-F5OHG3Q3.js → benchmark-IBX7ZWVU.js} +27 -27
  18. package/dist/{billing-LBRSBVXQ.js → billing-EAHOGMQW.js} +21 -23
  19. package/dist/{browser-CNTCFZOG.js → browser-XKYRXDJW.js} +13 -15
  20. package/dist/{bundleWithLocalizedFonts-RVF7AFP5.js → bundleWithLocalizedFonts-ZFX7TSWT.js} +1 -1
  21. package/dist/{capture-CTRZEZTC.js → capture-4WKQKMXG.js} +10 -12
  22. package/dist/{capture-DLYM3V5F.js → capture-IBOCZ2MK.js} +43 -41
  23. package/dist/{captureCompositionFrame-2O2HP6SK.js → captureCompositionFrame-HZA3LNU3.js} +22 -24
  24. package/dist/{captureFile-W7ZDDBCD.js → captureFile-Z7HQDRC2.js} +4 -5
  25. package/dist/{catalog-6XL63LU3.js → catalog-TSXQTLKM.js} +28 -30
  26. package/dist/{catch-up-AOFQWE6O.js → catch-up-LD2B5CE3.js} +15 -17
  27. package/dist/{check-5V7K4RL6.js → check-TEZKUD26.js} +62 -63
  28. package/dist/{checkAudio-4YUTDQSQ.js → checkAudio-3GM74ZGV.js} +18 -20
  29. package/dist/{checkBrowser-BAWRZZZU.js → checkBrowser-OFH3I7Q6.js} +52 -53
  30. package/dist/{chunk-6ATP7YPZ.js → chunk-22B53HD3.js} +9 -4
  31. package/dist/{chunk-7Q4EGB3N.js → chunk-2CNVJQKU.js} +1 -1
  32. package/dist/{chunk-7XOORL2Q.js → chunk-2H4SJSUS.js} +10 -10
  33. package/dist/{chunk-EGZQX3UX.js → chunk-2SPQTJA2.js} +24 -22
  34. package/dist/{chunk-HY7FPTBD.js → chunk-32H642MS.js} +2 -2
  35. package/dist/{chunk-MHF5F4FF.js → chunk-3GF72UPC.js} +74 -15
  36. package/dist/chunk-3HJX4F2S.js +39 -0
  37. package/dist/{chunk-7YRZBB4C.js → chunk-3ROFCQAW.js} +1 -1
  38. package/dist/{chunk-B653JKWT.js → chunk-3W2ORSFV.js} +4 -4
  39. package/dist/{chunk-R3ONQOLE.js → chunk-4AMOVEV7.js} +11 -11
  40. package/dist/{chunk-KQHDFVFF.js → chunk-4EWS3KP3.js} +2 -2
  41. package/dist/{chunk-O733DEVT.js → chunk-4ORH2OXS.js} +1 -1
  42. package/dist/{chunk-VPPKUCSP.js → chunk-4SDNEKTL.js} +2 -2
  43. package/dist/{chunk-AEXDJU77.js → chunk-4T45V6GF.js} +1 -1
  44. package/dist/{chunk-MVA4OQL7.js → chunk-4ZLWEPK4.js} +1 -1
  45. package/dist/{chunk-2ARKMOCD.js → chunk-5F2ULLFW.js} +6 -6
  46. package/dist/{chunk-CIXP5G7Z.js → chunk-5GUYYSVT.js} +1 -1
  47. package/dist/{chunk-JQ7BPN2R.js → chunk-5RM7274K.js} +3 -3
  48. package/dist/{chunk-TVWDS5AT.js → chunk-5T2LNQAH.js} +46 -18
  49. package/dist/{chunk-C3NDLM4S.js → chunk-5ZAM42GH.js} +2 -2
  50. package/dist/{chunk-5IE5ZI66.js → chunk-62UUXB3F.js} +1 -1
  51. package/dist/{chunk-5T6HPV25.js → chunk-63CSQYYO.js} +2 -2
  52. package/dist/{chunk-R4EWRIDL.js → chunk-6B2TH52B.js} +8 -1
  53. package/dist/{chunk-Z2U7ELGP.js → chunk-6KU6TCSS.js} +2 -2
  54. package/dist/{chunk-ZQIMO52O.js → chunk-6NDSDQCR.js} +59 -24
  55. package/dist/{chunk-65X2G57W.js → chunk-6OKMCIDU.js} +4 -4
  56. package/dist/{chunk-LZWG4GCC.js → chunk-6P7FLYOR.js} +55 -125
  57. package/dist/{chunk-FQ26QE5N.js → chunk-6R22Y26Z.js} +1 -1
  58. package/dist/{chunk-WQGDE3L6.js → chunk-6X2CLRU7.js} +1 -1
  59. package/dist/{chunk-OV5OSN74.js → chunk-6ZU654EU.js} +3 -3
  60. package/dist/{chunk-6LGB4MVX.js → chunk-73NC557V.js} +1 -1
  61. package/dist/{chunk-AQIHV4PM.js → chunk-7463BOQJ.js} +2 -2
  62. package/dist/{chunk-I6OSAVHD.js → chunk-7AP5C4C2.js} +7 -11
  63. package/dist/{chunk-JLMMY3UI.js → chunk-7DMES2F3.js} +2 -2
  64. package/dist/{chunk-RKIF4EU7.js → chunk-7GDEQJSL.js} +14 -14
  65. package/dist/{chunk-ECGNWHFE.js → chunk-A2ZUVULS.js} +88 -2
  66. package/dist/{chunk-OPIS2YMA.js → chunk-ADQ7XZE5.js} +6 -6
  67. package/dist/{chunk-ZIYYSD6S.js → chunk-B5JWBMDR.js} +79 -40
  68. package/dist/{chunk-PLOCYJ5U.js → chunk-B5TLZC2D.js} +11 -4
  69. package/dist/{chunk-UNB2DFR2.js → chunk-BAU3ASNM.js} +3 -3
  70. package/dist/{chunk-DSCMYTKJ.js → chunk-BHZZM2PK.js} +3 -3
  71. package/dist/chunk-BNH2IKGV.js +5101 -0
  72. package/dist/{chunk-SO7FT7YA.js → chunk-BNO5RN55.js} +33 -32
  73. package/dist/{chunk-TNFTRLLJ.js → chunk-C2GAAMZ3.js} +3 -3
  74. package/dist/{chunk-TIBFCGLT.js → chunk-C7IEAEKF.js} +1 -1
  75. package/dist/{chunk-EUVU5JS4.js → chunk-CAAUQUCW.js} +23 -9
  76. package/dist/{chunk-GMIFMRWR.js → chunk-CPHK3XMF.js} +6 -6
  77. package/dist/{chunk-SGQKP2JT.js → chunk-CPLVXXRS.js} +2 -2
  78. package/dist/{chunk-KYXH4JWF.js → chunk-CRX444MF.js} +18 -17
  79. package/dist/{chunk-6R4MEYWD.js → chunk-CRZ7FUMI.js} +2 -2
  80. package/dist/{chunk-I5H2FPNP.js → chunk-CSWJCRDU.js} +1 -1
  81. package/dist/{chunk-PSREPOJ4.js → chunk-CT54FOTS.js} +18 -14
  82. package/dist/{chunk-TJGGLLQJ.js → chunk-CYM53TWZ.js} +28 -14
  83. package/dist/chunk-D37I36FY.js +21 -0
  84. package/dist/{chunk-3RTZ2UX7.js → chunk-DD37XZVE.js} +1 -1
  85. package/dist/{chunk-QKHW5NXL.js → chunk-DWGDP537.js} +2 -2
  86. package/dist/chunk-EDH2DMXM.js +113 -0
  87. package/dist/{chunk-PCHUX7Y5.js → chunk-ENKXJNKX.js} +2 -2
  88. package/dist/{chunk-VXRTE7MZ.js → chunk-ERYGKPIR.js} +1 -1
  89. package/dist/{chunk-HOIEN7O4.js → chunk-F6PI5O3H.js} +3 -1
  90. package/dist/{chunk-PHYFZXOS.js → chunk-FLJ4S7NA.js} +2 -2
  91. package/dist/{chunk-3DFEBAWJ.js → chunk-FU62NEWC.js} +2 -2
  92. package/dist/{chunk-PDT6CBK2.js → chunk-G7HO2FFX.js} +3 -3
  93. package/dist/chunk-GADMF4BL.js +170 -0
  94. package/dist/{chunk-HXFGAI6L.js → chunk-GNRC4L6F.js} +16 -16
  95. package/dist/{chunk-XZ6THYIK.js → chunk-GYPZTG46.js} +5 -5
  96. package/dist/{chunk-GYJ7AJXN.js → chunk-H4HYZUE3.js} +1 -1
  97. package/dist/{chunk-URHIQHDR.js → chunk-H6Y4XOSP.js} +14 -12
  98. package/dist/{chunk-TIZC4XKU.js → chunk-HAMPVCRY.js} +2 -2
  99. package/dist/{chunk-677JGYQL.js → chunk-HLVNKNSW.js} +1 -0
  100. package/dist/{chunk-YMKCJRVK.js → chunk-HTHLFEO2.js} +1 -1
  101. package/dist/{chunk-RAOGN2HG.js → chunk-ICZWQNBR.js} +1 -1
  102. package/dist/{chunk-4STRMCGD.js → chunk-IIXSSRUR.js} +4 -4
  103. package/dist/{chunk-4QSDXDLV.js → chunk-ILKK6F5E.js} +3 -3
  104. package/dist/{chunk-ORKZUTZW.js → chunk-IOWECUEU.js} +1 -1
  105. package/dist/{chunk-T5QI7ZL2.js → chunk-IT2YUKYY.js} +5 -5
  106. package/dist/{chunk-SXCM6VY3.js → chunk-IU6AC3WL.js} +1 -1
  107. package/dist/{chunk-WDMSNDHS.js → chunk-J56ZJFSF.js} +285 -114
  108. package/dist/{chunk-POFQOZOF.js → chunk-KBEC6VQS.js} +426 -185
  109. package/dist/{chunk-ELDZ6C3R.js → chunk-KTY46LIH.js} +7 -3
  110. package/dist/{chunk-XXOEYRD5.js → chunk-KYZEK7QF.js} +2 -2
  111. package/dist/{chunk-N6QWL3E7.js → chunk-L7MFHIG7.js} +2 -2
  112. package/dist/{chunk-ISSG4PUD.js → chunk-LGIWC6KN.js} +3 -3
  113. package/dist/{chunk-CC72LTIT.js → chunk-LTXZLTXW.js} +180 -202
  114. package/dist/{chunk-WI3FM54X.js → chunk-LULZFFDN.js} +3 -3
  115. package/dist/{chunk-FFL5R2EZ.js → chunk-LV2ETFC5.js} +4 -4
  116. package/dist/{chunk-K2WLOTTF.js → chunk-LYTELQL2.js} +2 -4
  117. package/dist/{chunk-RHFB457E.js → chunk-LZSSGF7G.js} +3 -3
  118. package/dist/chunk-MERWX4DZ.js +159 -0
  119. package/dist/{chunk-H3TD4VKX.js → chunk-MJBBKSKB.js} +1 -1
  120. package/dist/{chunk-QHVE6AFU.js → chunk-MPVJI4SE.js} +1 -1
  121. package/dist/{chunk-BMTT2T7M.js → chunk-MPX3FO4A.js} +5 -5
  122. package/dist/{chunk-SC7SX2I3.js → chunk-MQCIX6O2.js} +4 -4
  123. package/dist/{chunk-ODLSLYJR.js → chunk-MTCVUAUK.js} +2 -2
  124. package/dist/{chunk-J4OHC5FU.js → chunk-NK2UW3WR.js} +1 -1
  125. package/dist/{chunk-7CI5MLCC.js → chunk-NOJRZCN3.js} +26 -11
  126. package/dist/{chunk-3QMGLSKC.js → chunk-NU7BEOCX.js} +2 -2
  127. package/dist/chunk-NY6E4272.js +112 -0
  128. package/dist/{chunk-L4MXZHRB.js → chunk-OBP5WNKP.js} +3 -3
  129. package/dist/{chunk-JUUOYXWH.js → chunk-OGOR22GY.js} +2 -2
  130. package/dist/{chunk-XWV6BOCG.js → chunk-OPUR2XQ2.js} +5 -5
  131. package/dist/{chunk-JT7RXK2N.js → chunk-OW6MOJSR.js} +1 -1
  132. package/dist/{chunk-4VJQVTQI.js → chunk-PAHTZDMZ.js} +1 -1
  133. package/dist/{chunk-FC77MYAD.js → chunk-PPETKAEO.js} +1 -1
  134. package/dist/{chunk-6VY52EVW.js → chunk-PQ2OPPGP.js} +7 -3
  135. package/dist/{chunk-KK5Z5XQ3.js → chunk-PTGNUVCB.js} +3 -0
  136. package/dist/{chunk-HTISHNLA.js → chunk-Q7IOMZ5X.js} +1 -1
  137. package/dist/{chunk-PMKWTXHE.js → chunk-R2LBMDYH.js} +2 -2
  138. package/dist/{chunk-QBN2W4T3.js → chunk-RC2DDVX5.js} +1 -1
  139. package/dist/{chunk-ZMLZRMG7.js → chunk-RDJOA5MM.js} +2 -2
  140. package/dist/{chunk-J3H6QDDY.js → chunk-RF3DT4CS.js} +1 -1
  141. package/dist/{chunk-WRSGWDDB.js → chunk-RJCQZMNI.js} +9 -9
  142. package/dist/{chunk-QC35TPEE.js → chunk-RRI7NGQZ.js} +6 -6
  143. package/dist/{chunk-RDWGNSVI.js → chunk-RSYV6NNI.js} +2 -2
  144. package/dist/{chunk-6EMFSRTW.js → chunk-S35RUNXJ.js} +7 -0
  145. package/dist/{chunk-KGPHUBBA.js → chunk-SCEBICAQ.js} +1 -1
  146. package/dist/{chunk-VFGFXE6J.js → chunk-SDIQEPAR.js} +1 -1
  147. package/dist/{chunk-OF7SQ77J.js → chunk-SIQGTRZ5.js} +1 -1
  148. package/dist/{chunk-QVHDAS3L.js → chunk-SQI2MWJE.js} +4 -4
  149. package/dist/{chunk-2LJPBYKI.js → chunk-SYMLVFQF.js} +1 -1
  150. package/dist/{chunk-QJ2BV7FM.js → chunk-TJAFCC37.js} +9 -9
  151. package/dist/{chunk-6T4PB35F.js → chunk-TRQDC2UC.js} +9 -2
  152. package/dist/{chunk-PYRM3OAI.js → chunk-TRVWLAQ3.js} +11 -13
  153. package/dist/{chunk-HLOJSBGC.js → chunk-TTRX7NM3.js} +9 -9
  154. package/dist/{chunk-763UG5II.js → chunk-UEJMLVGW.js} +8 -8
  155. package/dist/{chunk-LTOUXR3X.js → chunk-UX5KLSAJ.js} +73 -75
  156. package/dist/{chunk-L456Q4KU.js → chunk-VJVTGSGW.js} +1 -1
  157. package/dist/{chunk-RX67N2PU.js → chunk-VM2VBJRC.js} +31 -2
  158. package/dist/{chunk-K33E3YNK.js → chunk-VNWPHKKI.js} +10 -10
  159. package/dist/{chunk-XXJBWKDS.js → chunk-VRUVJTFW.js} +17 -17
  160. package/dist/{chunk-WTZT6FSK.js → chunk-VSS3OAZB.js} +1 -1
  161. package/dist/{chunk-6UAYOSE7.js → chunk-VZM7AFUH.js} +9 -9
  162. package/dist/{chunk-6K6RIX2A.js → chunk-W772ZFTE.js} +21 -6
  163. package/dist/{chunk-THGJTFYB.js → chunk-WTO3A7ET.js} +86 -6
  164. package/dist/{chunk-YBYNBKCN.js → chunk-WTS245RC.js} +2 -2
  165. package/dist/{chunk-UBNJWS2H.js → chunk-WTUDKVWQ.js} +3 -3
  166. package/dist/{chunk-BTXYXM2A.js → chunk-WVCCSYZC.js} +17 -17
  167. package/dist/{chunk-FGJUVWAM.js → chunk-X3NGTIE3.js} +1 -1
  168. package/dist/{chunk-DCRHNRUY.js → chunk-XLG3JMSS.js} +5 -5
  169. package/dist/{chunk-D44MBZI6.js → chunk-Y53Z2M77.js} +2 -2
  170. package/dist/{chunk-WKE3WTIU.js → chunk-YB2ZJJFJ.js} +1 -1
  171. package/dist/{chunk-LSGJY2FG.js → chunk-YLC67YFR.js} +1 -1
  172. package/dist/{chunk-6LU6JICP.js → chunk-YWUE4CRU.js} +96 -9
  173. package/dist/chunk-Z3BPDCRV.js +537 -0
  174. package/dist/{chunk-HYXQR5I3.js → chunk-Z55ASKZE.js} +1 -1
  175. package/dist/{chunk-OYKAS3J5.js → chunk-ZBDITGMP.js} +3 -3
  176. package/dist/{chunk-CAMD2NBN.js → chunk-ZGSGBGTB.js} +2 -2
  177. package/dist/{clean-Z5REUSNY.js → clean-RJKQ23WH.js} +36 -37
  178. package/dist/cli.js +74 -75
  179. package/dist/{cloud-NJ7G3NF3.js → cloud-R3NQSUTQ.js} +4 -4
  180. package/dist/{cloud-QP5R6B6A.js → cloud-VUR3ZO6O.js} +8 -9
  181. package/dist/{cloudrun-CPAZLNTW.js → cloudrun-SZYAYV7N.js} +19 -12
  182. package/dist/{compare-T5CHD25P.js → compare-AO5VJBJW.js} +70 -92
  183. package/dist/{compiler-QVDXN4OS.js → compiler-65SP7M2P.js} +7 -9
  184. package/dist/{component-QMZ46KTE.js → component-WGTPAIKX.js} +8 -10
  185. package/dist/{compositions-JHYYNBAK.js → compositions-HWM6DNJA.js} +21 -23
  186. package/dist/{contactSheet-7SPGUTDV.js → contactSheet-ROUVWDRO.js} +5 -6
  187. package/dist/{curve-ON6QQY7T.js → curve-PLPTMDS4.js} +20 -22
  188. package/dist/{cuts-K4FOVP4E.js → cuts-T5GYTDUA.js} +21 -23
  189. package/dist/{delete-6WFQ3FC2.js → delete-6WE3N3VO.js} +26 -15
  190. package/dist/{deploy-UAZQ5PBA.js → deploy-GYY6CYQD.js} +12 -13
  191. package/dist/{describeProject-7W6BN5A2.js → describeProject-UQQ2GGIX.js} +15 -17
  192. package/dist/{destroy-4B4OVPHJ.js → destroy-WSGREGAG.js} +12 -13
  193. package/dist/{deterministicFonts-VLIVGXUQ.js → deterministicFonts-JER4GPCM.js} +4 -5
  194. package/dist/{diff-ZSA37QQS.js → diff-JQBZUPKG.js} +57 -54
  195. package/dist/{dist-ACT5C6ME.js → dist-6EF2P3P7.js} +4 -4
  196. package/dist/{dist-VRYZIJFZ.js → dist-HF753IX4.js} +5 -8
  197. package/dist/{dist-2O52E7QZ.js → dist-JRJHFP27.js} +20 -21
  198. package/dist/{doctor-RXQ2Y2YY.js → doctor-SPJ5AJKX.js} +23 -25
  199. package/dist/{dotEnv-RZ52L7X3.js → dotEnv-7JWLJ2TG.js} +11 -3
  200. package/dist/{energy-DRA3DCRO.js → energy-KPDVIZ5D.js} +21 -23
  201. package/dist/{events-AJNF2C3H.js → events-4WAMG3JE.js} +10 -12
  202. package/dist/{events-4SNBQE3M.js → events-P4223ZZZ.js} +23 -25
  203. package/dist/{events-GA3YM3WT.js → events-XON5I7VU.js} +5 -5
  204. package/dist/{execute-6LTZRWE4.js → execute-CN5FLBYU.js} +49 -46
  205. package/dist/{extract-XZQN654B.js → extract-ABSBKYYH.js} +21 -23
  206. package/dist/{face-RKUNVSN3.js → face-PLPQ5335.js} +22 -24
  207. package/dist/{feedback-AL7NPPMZ.js → feedback-QPQ4G72X.js} +62 -38
  208. package/dist/{ffmpeg-BEL7EZBA.js → ffmpeg-F3XK57IP.js} +14 -16
  209. package/dist/{figma-IZ3NH2KZ.js → figma-S5CVANVZ.js} +3 -3
  210. package/dist/fontLocalizeCli.js +26 -27
  211. package/dist/{frames-AYE53CSZ.js → frames-F4QEQB4V.js} +23 -25
  212. package/dist/{generate-BZ4EVVQI.js → generate-O3OPOCHP.js} +37 -39
  213. package/dist/{get-2GG4NSOK.js → get-P7LQ7U22.js} +26 -15
  214. package/dist/{gpuPolicy-W2ZGBXNG.js → gpuPolicy-JPRDRQWU.js} +14 -16
  215. package/dist/{grade-compare-65NWHVXK.js → grade-compare-6UZ6SK4J.js} +50 -51
  216. package/dist/hangReport.js +2 -2
  217. package/dist/{heifImagePrep-MRQ4KKDF.js → heifImagePrep-3PDFNYIE.js} +21 -22
  218. package/dist/{help-TEQWNNPI.js → help-DLOCAL7E.js} +1 -1
  219. package/dist/{history-MVNPETRW.js → history-YIJVOGH7.js} +23 -25
  220. package/dist/hyperframe.manifest.json +1 -1
  221. package/dist/hyperframe.runtime.iife.js +64 -64
  222. package/dist/hyperframes-player.global.js +1 -1
  223. package/dist/{info-NGNTHWYX.js → info-FVYJNNQL.js} +23 -25
  224. package/dist/{init-H7SUGVZX.js → init-V45K4VAG.js} +41 -43
  225. package/dist/{ink-CPZ4YZFM.js → ink-P72OB7L4.js} +21 -23
  226. package/dist/{inspect-GZBQ7XN7.js → inspect-3W2IG3JF.js} +53 -54
  227. package/dist/{installer-ZTHYVK4L.js → installer-QGDTFTDU.js} +8 -10
  228. package/dist/{keyframes-B52LQUOI.js → keyframes-57OPHIR2.js} +77 -28
  229. package/dist/{lambda-SZDQJMKA.js → lambda-EQZS7UMO.js} +32 -26
  230. package/dist/{layout-BOUOG2D2.js → layout-KSWMO6MH.js} +53 -54
  231. package/dist/{lint-H4OWI5JN.js → lint-WIYBGVF2.js} +18 -20
  232. package/dist/{lintProject-P4EAXFU2.js → lintProject-N3UN6HEE.js} +4 -4
  233. package/dist/{list-VNEYACGL.js → list-3FQAHEE2.js} +27 -16
  234. package/dist/{localPage-ZP7WVA2N.js → localPage-G2QEA7JL.js} +15 -17
  235. package/dist/{login-RUDOUO5Z.js → login-C3U6WSHF.js} +6 -6
  236. package/dist/{logout-5ZO6ZNS3.js → logout-525LWS6J.js} +2 -2
  237. package/dist/{look-G3NVPKXZ.js → look-U5LWOI4H.js} +21 -23
  238. package/dist/{manager-KWNID2ZA.js → manager-C5S25OOK.js} +5 -5
  239. package/dist/{manager-NXH2NJC6.js → manager-ZVYDWLHI.js} +16 -18
  240. package/dist/{measure-5PVIZ2W2.js → measure-R2KZIHXT.js} +11 -11
  241. package/dist/{media-treatment-T5QJI4PQ.js → media-treatment-FAW5ZLT7.js} +29 -29
  242. package/dist/{media-use-RTN3SMVY.js → media-use-CPTT2ZDE.js} +12 -8
  243. package/dist/{models-J2CJ7EVX.js → models-53JHNGSL.js} +20 -22
  244. package/dist/{motionShot-HU7P26WJ.js → motionShot-K5ZHHHE6.js} +28 -30
  245. package/dist/{normalize-44E7R6T5.js → normalize-TBACWMEK.js} +4 -5
  246. package/dist/{normalize-audio-2YFTP2T6.js → normalize-audio-EOO2ORPP.js} +20 -21
  247. package/dist/{open-RSCNUV6E.js → open-3YABRCER.js} +26 -28
  248. package/dist/{parakeetRunner-BUY25EIR.js → parakeetRunner-TLZC2WAJ.js} +24 -26
  249. package/dist/{pipeline-A4RL5R5P.js → pipeline-LZ73CHLB.js} +20 -20
  250. package/dist/{plan-7WYNPILA.js → plan-3QQZ57IC.js} +31 -33
  251. package/dist/{play-UKHFNMYZ.js → play-ESWP4SF2.js} +44 -43
  252. package/dist/{preflight-2VFCT3PI.js → preflight-7G5OBMAA.js} +17 -19
  253. package/dist/{present-ZUGFCQOF.js → present-5ER4JKR5.js} +36 -37
  254. package/dist/{preview-BT2ZFYMC.js → preview-62XOVSXM.js} +50 -50
  255. package/dist/privateProjectFile-6NPNZXK3.js +65 -0
  256. package/dist/{probe-2CLEK2UT.js → probe-CFOGEVFU.js} +21 -23
  257. package/dist/{producer-HCAMS55D.js → producer-LLE32VVO.js} +1 -1
  258. package/dist/{progress-5A4N7PTR.js → progress-PT3NAFVP.js} +5 -6
  259. package/dist/{projectConfig-2KJ2PXIM.js → projectConfig-R54UDB5Y.js} +11 -13
  260. package/dist/{publication-AR63EGJF.js → publication-TOBV6M4Q.js} +6 -8
  261. package/dist/{publish-EGKYOJWV.js → publish-QVNH5PXC.js} +63 -42
  262. package/dist/receivedRecordFollow-U43DTVLP.js +54 -0
  263. package/dist/{refresh-GYRLZ7DZ.js → refresh-HK4YEHWC.js} +2 -2
  264. package/dist/{remove-background-IQQPMM24.js → remove-background-XHE6JL35.js} +21 -21
  265. package/dist/{render-HJRMJYTA.js → render-7JJ2DFEB.js} +12 -13
  266. package/dist/{render-ROJ5X53T.js → render-GRZMK6ET.js} +128 -87
  267. package/dist/{render-YNSZYEEK.js → render-WK3D5VOW.js} +141 -114
  268. package/dist/{render-batch-MXYDIHRO.js → render-batch-KFEZFJXB.js} +12 -13
  269. package/dist/renderSetupWorker.js +9 -9
  270. package/dist/{resolver-SPLAVF76.js → resolver-N4U52UK5.js} +8 -10
  271. package/dist/{reverse-CE6OGBB7.js → reverse-6AOA3PXF.js} +1 -1
  272. package/dist/{run-YVNJJL26.js → run-M2J3ZJ3W.js} +11 -12
  273. package/dist/{sam-2D3BUTL7.js → sam-O7Y2CCK3.js} +4 -4
  274. package/dist/{screenshotCapture-DRO7VMNI.js → screenshotCapture-UXJZ7D3L.js} +17 -19
  275. package/dist/{service-K65JYG4O.js → service-DBNZZLPU.js} +22 -24
  276. package/dist/{share-CSVWF6SB.js → share-6P7S3USP.js} +26 -28
  277. package/dist/{sherpa-JE6AFUEV.js → sherpa-CXEHEVAJ.js} +23 -25
  278. package/dist/sherpaWorker.js +6 -7
  279. package/dist/{sites-QCGTWVNF.js → sites-R5F5FNAL.js} +6 -6
  280. package/dist/skills/hyperframes/scripts/locate.mjs +13 -19
  281. package/dist/skills/media-use/audio/references/tts-to-captions.md +1 -1
  282. package/dist/skills/media-use/audio/references/tts.md +6 -6
  283. package/dist/skills/media-use/audio/scripts/lib/heygen.mjs +143 -2
  284. package/dist/skills/media-use/audio/scripts/lib/tts.mjs +12 -2
  285. package/dist/skills/media-use/scripts/lib/candidates.mjs +3 -2
  286. package/dist/skills/media-use/scripts/lib/terminal-text.d.mts +1 -0
  287. package/dist/skills/media-use/scripts/lib/terminal-text.mjs +12 -0
  288. package/dist/skills/media-use/scripts/resolve.mjs +21 -15
  289. package/dist/{skills-L3BXM7VJ.js → skills-RMIHFNI6.js} +15 -17
  290. package/dist/{skillsUpdateCheck-VUENI5OR.js → skillsUpdateCheck-EHOSL2AC.js} +5 -5
  291. package/dist/{snapshot-GI2GWIF6.js → snapshot-DQK3P7TF.js} +97 -84
  292. package/dist/{src-ZXZO5RCJ.js → src-4INHWM6L.js} +29 -30
  293. package/dist/{src-B646B52O.js → src-BNSCFKOD.js} +17 -19
  294. package/dist/{start-ZNGKXRNE.js → start-KPCEUG5K.js} +43 -37
  295. package/dist/{state-7CJBWHXJ.js → state-5LE7AN6F.js} +5 -6
  296. package/dist/{staticProjectServer-46T6YTPF.js → staticProjectServer-VCS4TOU2.js} +33 -34
  297. package/dist/{status-7SWTPLVI.js → status-WBNQSG4H.js} +23 -25
  298. package/dist/studio/assets/{hyperframes-player-bya4hgms.js → hyperframes-player-Cm0hYGm2.js} +1 -1
  299. package/dist/studio/assets/{index-Bxh5lW0C.js → index-BGrNWeLK.js} +199 -199
  300. package/dist/studio/assets/{index--dcfSUzI.js → index-REqr_dLu.js} +1 -1
  301. package/dist/studio/assets/{pausedVideoDecoder-BKym1jA6.js → pausedVideoDecoder-DqLDSq8J.js} +1 -1
  302. package/dist/studio/index.html +1 -1
  303. package/dist/{studio-api-4XKM5HDR.js → studio-api-RAW4CIPR.js} +20 -21
  304. package/dist/{studioSelectionClient-S46TNAAZ.js → studioSelectionClient-PLBQBLCJ.js} +2 -2
  305. package/dist/{studioServer-4TWRIZNU.js → studioServer-5PWBZADN.js} +260 -117
  306. package/dist/subCompositionWorker.js +60 -54
  307. package/dist/{sync-R3K6LYB3.js → sync-PM2WLBUC.js} +21 -23
  308. package/dist/{synthesize-OZ3SJTOF.js → synthesize-NGU4DRKC.js} +10 -9
  309. package/dist/{system-LZ4PMOJD.js → system-PKL4Y4MX.js} +3 -3
  310. package/dist/{telemetry-WSBY25O3.js → telemetry-4BST73P2.js} +10 -12
  311. package/dist/{templates-ITP6ISAF.js → templates-G3XOWYXG.js} +24 -26
  312. package/dist/{timeline-U7GJMYKV.js → timeline-E6ZXYGQR.js} +36 -37
  313. package/dist/{tokens-3YTSUU27.js → tokens-KRHXM44C.js} +15 -5
  314. package/dist/{transcribe-QHHY5M3G.js → transcribe-RJ3GOCJL.js} +44 -46
  315. package/dist/{transcribe-ISCBYWN4.js → transcribe-TKV3POYD.js} +20 -22
  316. package/dist/{tts-24IJXIT2.js → tts-EPXRE275.js} +20 -4
  317. package/dist/{update-SVEH2GOL.js → update-TO7MLJCS.js} +17 -19
  318. package/dist/{updateCheck-MDG7N7VO.js → updateCheck-5AY447D5.js} +4 -4
  319. package/dist/{upgrade-6CGAI4OR.js → upgrade-BLZWWXYL.js} +8 -9
  320. package/dist/{urlDownloader-VPQTIGEH.js → urlDownloader-ME67HQ4O.js} +13 -15
  321. package/dist/{validate-QUB4KCEQ.js → validate-SRBV5NFV.js} +41 -42
  322. package/dist/{video-PUGZ5UHS.js → video-JPESR36I.js} +17 -19
  323. package/dist/{voices-4UO5AYLS.js → voices-AECYKXGA.js} +34 -36
  324. package/dist/warmCheck.js +62 -63
  325. package/dist/warmCheckClient.js +2 -2
  326. package/package.json +1 -1
  327. package/dist/chunk-6VY6WTY5.js +0 -279
  328. package/dist/chunk-NI7JVGOE.js +0 -5083
  329. package/dist/chunk-NLN5NY3P.js +0 -34
  330. package/dist/chunk-UVZIABYZ.js +0 -40
  331. package/dist/chunk-VC76R6W2.js +0 -27
  332. /package/dist/{chunk-YXX6CIHL.js → chunk-BWFNWEUO.js} +0 -0
@@ -4,11 +4,19 @@ import { dirname as __hf_dirname } from "node:path";
4
4
  var require = __hf_createRequire(import.meta.url);
5
5
  var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
+ import {
8
+ GENERIC_FAMILIES,
9
+ collectFontFamilyCustomProperties,
10
+ injectDeterministicFontFaces,
11
+ iterateFontFamilyDeclarations,
12
+ normalizeSystemFontPrimaryFamilies,
13
+ resolveFontFamilyDeclarationFamilies
14
+ } from "./chunk-HAMPVCRY.js";
7
15
  import {
8
16
  Semaphore,
9
17
  prepareHeifImageInputs,
10
18
  withMediaProbeSlot
11
- } from "./chunk-OV5OSN74.js";
19
+ } from "./chunk-6ZU654EU.js";
12
20
  import {
13
21
  EncoderInterruptedError,
14
22
  encoderFailureError,
@@ -22,15 +30,10 @@ import {
22
30
  refusesOutsideLink,
23
31
  resolveRenderPaths,
24
32
  toExternalAssetKey
25
- } from "./chunk-PSREPOJ4.js";
33
+ } from "./chunk-CT54FOTS.js";
26
34
  import {
27
- GENERIC_FAMILIES,
28
- collectFontFamilyCustomProperties,
29
- injectDeterministicFontFaces,
30
- iterateFontFamilyDeclarations,
31
- normalizeSystemFontPrimaryFamilies,
32
- resolveFontFamilyDeclarationFamilies
33
- } from "./chunk-TIZC4XKU.js";
35
+ linksOutside
36
+ } from "./chunk-B5TLZC2D.js";
34
37
  import {
35
38
  createStudioPositionSeekReapplyScript,
36
39
  openRangeEnd,
@@ -208,7 +211,7 @@ import {
208
211
  withPublicOnlyProxy,
209
212
  writeCapturedFrame,
210
213
  writeUrlDownloadTelemetry
211
- } from "./chunk-CC72LTIT.js";
214
+ } from "./chunk-LTXZLTXW.js";
212
215
  import {
213
216
  settleOnBrowserSafePort
214
217
  } from "./chunk-PJQVJSMG.js";
@@ -217,12 +220,9 @@ import {
217
220
  convertTransfer,
218
221
  crossfade
219
222
  } from "./chunk-3GXQPCJC.js";
220
- import {
221
- RENDER_TEMP_DIR
222
- } from "./chunk-HOIEN7O4.js";
223
223
  import {
224
224
  PREVIEW_FOR_ANOTHER_SITE_META
225
- } from "./chunk-YXX6CIHL.js";
225
+ } from "./chunk-BWFNWEUO.js";
226
226
  import {
227
227
  assignBundledRuntimeCompositionIds,
228
228
  boundMediaSrc,
@@ -235,14 +235,17 @@ import {
235
235
  parsesAsScript,
236
236
  prepareFlattenedInnerRoot,
237
237
  stripSdrPngColourTags
238
- } from "./chunk-I6OSAVHD.js";
238
+ } from "./chunk-7AP5C4C2.js";
239
+ import {
240
+ RENDER_TEMP_DIR
241
+ } from "./chunk-F6PI5O3H.js";
239
242
  import {
240
243
  cannotHardLink,
241
244
  collectScratchLeftovers,
242
245
  createStagingDir,
243
246
  removeScratch,
244
247
  renameWithRetry
245
- } from "./chunk-K2WLOTTF.js";
248
+ } from "./chunk-LYTELQL2.js";
246
249
  import {
247
250
  DISTRIBUTED_FPS,
248
251
  HF_VFX_ATTR,
@@ -260,7 +263,7 @@ import {
260
263
  redactTelemetryString,
261
264
  resolveAuthoredTimingWindow,
262
265
  toFps
263
- } from "./chunk-QHVE6AFU.js";
266
+ } from "./chunk-MPVJI4SE.js";
264
267
  import {
265
268
  CAPTURE_CANVAS_SELECTOR,
266
269
  COMPOSITION_SOURCE_URL,
@@ -297,34 +300,33 @@ import {
297
300
  sourceTimeAt,
298
301
  styleElementsFor,
299
302
  timeAtSourceTime
300
- } from "./chunk-NI7JVGOE.js";
301
- import {
302
- isSafePath
303
- } from "./chunk-MHF5F4FF.js";
303
+ } from "./chunk-BNH2IKGV.js";
304
304
  import {
305
+ isSafePath,
305
306
  terminalText
306
- } from "./chunk-UVZIABYZ.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
312
  resolveReferencedStart
312
- } from "./chunk-HLOJSBGC.js";
313
+ } from "./chunk-TTRX7NM3.js";
313
314
  import {
314
315
  isUnresolvedAssetPlaceholder,
315
316
  namesAnotherNetworkRoot,
317
+ projectAssetExists,
316
318
  readProjectFile,
317
319
  readTextFile,
318
320
  resolveCompositionSrc,
319
321
  resolveProjectRelativeSrc
320
- } from "./chunk-6EMFSRTW.js";
322
+ } from "./chunk-S35RUNXJ.js";
321
323
  import {
322
324
  LOW_MEMORY_TOTAL_MB_THRESHOLD,
323
325
  getCgroupMemoryLimitMb,
324
326
  getSystemTotalMb,
325
327
  hostCpuCount,
326
328
  usableCpuCount
327
- } from "./chunk-CIXP5G7Z.js";
329
+ } from "./chunk-5GUYYSVT.js";
328
330
  import {
329
331
  MEDIA_START_BASIS_ATTR,
330
332
  checkSubCompositionUsability,
@@ -369,7 +371,7 @@ import {
369
371
  import {
370
372
  isPrivateFileUnder,
371
373
  isStudioPrivatePath
372
- } from "./chunk-KK5Z5XQ3.js";
374
+ } from "./chunk-PTGNUVCB.js";
373
375
 
374
376
  // ../producer/src/services/renderOrchestrator.ts
375
377
  import {
@@ -377,7 +379,7 @@ import {
377
379
  mkdirSync as mkdirSync10,
378
380
  readdirSync as readdirSync6,
379
381
  rmSync as rmSync10,
380
- statSync as statSync7,
382
+ statSync as statSync8,
381
383
  writeFileSync as writeFileSync6,
382
384
  copyFileSync as copyFileSync3,
383
385
  appendFileSync
@@ -535,6 +537,10 @@ function stripPreloadNone(html) {
535
537
  return attr && attr.index < tagEnd ? [attr.index, attr.index + attr[0].length] : void 0;
536
538
  });
537
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
+ }
538
544
  var REMOTE_SRC_TAGS = {
539
545
  media: { opener: "<(?:video|audio)\\b", attr: /\bsrc\s*=\s*["'](https?:\/\/)/gi },
540
546
  source: { opener: "<source\\b", attr: /\bsrc\s*=\s*["'](https?:\/\/)/gi },
@@ -1374,7 +1380,8 @@ function createFileServer(options) {
1374
1380
  compiledDir,
1375
1381
  port = 0,
1376
1382
  stripEmbeddedRuntime = true,
1377
- allowOutsideProjectAssets = false
1383
+ allowOutsideProjectAssets = false,
1384
+ includeOutsideScripts = false
1378
1385
  } = options;
1379
1386
  const preHeadScripts = [
1380
1387
  HF_EARLY_STUB,
@@ -1385,6 +1392,7 @@ function createFileServer(options) {
1385
1392
  const bodyScripts = options.bodyScripts ?? [buildRenderModeScript(options.fps), HF_BRIDGE_SCRIPT];
1386
1393
  const app = new Hono();
1387
1394
  const warnLeftOut = (line) => console.warn(`[FileServer] ${terminalText(line)}`);
1395
+ const outsidePolicy = { includeScripts: includeOutsideScripts };
1388
1396
  let listeningPort = -1;
1389
1397
  app.use(async function loadEachFileOnlyAsItsNamedType(c, next) {
1390
1398
  await next();
@@ -1402,7 +1410,7 @@ function createFileServer(options) {
1402
1410
  if (!isPathInside2(candidate, root, { resolveSymlinks })) continue;
1403
1411
  if (isPrivateFileUnder(root, candidate, isStudioPrivatePath)) continue;
1404
1412
  const checksLinks = allowOutsideProjectAssets && root !== compiledDir;
1405
- if (checksLinks && refusesOutsideLink(root, candidate, warnLeftOut)) continue;
1413
+ if (checksLinks && refusesOutsideLink(root, candidate, warnLeftOut, outsidePolicy)) continue;
1406
1414
  file = openRegularFile(candidate);
1407
1415
  if (file) break;
1408
1416
  }
@@ -2901,9 +2909,10 @@ function frameWeightedAvgMs(perfs, avgOf) {
2901
2909
  function aggregateDedup(perfs) {
2902
2910
  if (perfs.length === 0) return void 0;
2903
2911
  const armed = perfs.some((p) => p.staticDedupArmed);
2904
- const skipReasons = armed ? [] : [
2905
- ...new Set(perfs.map((p) => p.staticDedupSkipReason).filter((r) => !!r))
2906
- ].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
+ };
2907
2916
  const verificationPerfs = perfs.filter((perf) => perf.staticDedupVerificationOutcome);
2908
2917
  const verificationOutcomes = [
2909
2918
  ...new Set(
@@ -2915,7 +2924,8 @@ function aggregateDedup(perfs) {
2915
2924
  armed,
2916
2925
  predictedFrames: perfs.reduce((sum2, p) => sum2 + (p.staticDedupPredicted ?? 0), 0),
2917
2926
  reusedFrames: perfs.reduce((sum2, p) => sum2 + (p.staticDedupReused ?? 0), 0),
2918
- skipReason: skipReasons.length > 0 ? skipReasons.join("|") : void 0,
2927
+ skipReason: distinctUnarmed(perfs.map((p) => p.staticDedupSkipReason)),
2928
+ ineligibleCause: distinctUnarmed(perfs.map((p) => p.staticDedupIneligibleCause)),
2919
2929
  ...verificationPerfs.length === 0 ? {} : {
2920
2930
  verifiedFrames: verificationPerfs.reduce(
2921
2931
  (sum2, perf) => sum2 + (perf.staticDedupVerified ?? 0),
@@ -6939,10 +6949,81 @@ function countAuthoredTimedClips(html) {
6939
6949
  return document2.querySelectorAll("[data-start]").length;
6940
6950
  }
6941
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
+
6942
6968
  // ../producer/src/services/render/stages/compileStage.ts
6943
6969
  import { existsSync as existsSync11, writeFileSync as writeFileSync4 } from "fs";
6944
6970
  import { join as join17, relative as relative3 } from "path";
6945
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
+
6946
7027
  // ../producer/src/services/htmlCompiler.ts
6947
7028
  import { createHash as createHash4 } from "crypto";
6948
7029
  import { createReadStream as createReadStream2, existsSync as existsSync10, mkdirSync as mkdirSync7, readFileSync as readFileSync6 } from "fs";
@@ -7295,7 +7376,7 @@ Check that each file referenced by data-composition-src contains valid HTML with
7295
7376
  };
7296
7377
  function normalizeCompositionSrcs(html, projectDir) {
7297
7378
  return html.replace(/(\bdata-composition-src=)(["'])([^"']*)\2/g, (whole, name, quote, value) => {
7298
- if (!value.includes("%") && !value.startsWith("/")) return whole;
7379
+ if (!value.includes("%") && !/^\.?[\\/]/.test(value)) return whole;
7299
7380
  const file = resolveCompositionSrc(projectDir, value);
7300
7381
  if (file === null) return whole;
7301
7382
  return `${name}${quote}${relative2(projectDir, file).split(sep2).join("/")}${quote}`;
@@ -7311,68 +7392,94 @@ function resolveCompositionFile(projectDir, src, assetRoot) {
7311
7392
  const file = resolveCompositionPath(projectDir, src, assetRoot);
7312
7393
  return file !== null && COMPOSITION_FILE.test(file) ? file : null;
7313
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
+ }
7314
7402
  var isPrivateCompositionFile = (projectDir, filePath) => isPrivateFileUnder(projectDir, filePath, isStudioPrivatePath);
7315
- 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) {
7316
7405
  const { document: document2 } = parseHTML(html);
7317
- const hosts = [...document2.querySelectorAll("[data-composition-src]")];
7318
- const problems = [];
7319
- for (const el of hosts) {
7320
- const srcPath = el.getAttribute("data-composition-src");
7321
- if (!srcPath) continue;
7322
- if (isUnresolvedAssetPlaceholder(srcPath)) continue;
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) => {
7323
7444
  const filePath = resolveCompositionPath(projectDir, srcPath, assetRoot);
7324
- if (filePath === null) {
7325
- problems.push({ srcPath, detail: "it is outside the project folder" });
7326
- continue;
7327
- }
7328
- if (outsideAssetRefusal(projectDir, filePath) === "blocklisted") {
7329
- problems.push({ srcPath, detail: "it is outside the project in a private location" });
7330
- continue;
7331
- }
7332
- if (isPrivateCompositionFile(projectDir, filePath)) {
7333
- problems.push({
7334
- srcPath,
7335
- detail: "it is git metadata, an env file or a private tool record"
7336
- });
7337
- continue;
7338
- }
7339
- if (!COMPOSITION_FILE.test(filePath)) {
7340
- problems.push({ srcPath, detail: NOT_A_COMPOSITION_FILE });
7341
- continue;
7342
- }
7343
- if (visited.has(filePath)) continue;
7344
- const read = readProjectFile(filePath);
7345
- if (read.kind === "missing") {
7346
- problems.push({ srcPath, detail: "the file does not exist" });
7347
- continue;
7348
- }
7349
- if (read.kind === "folder") {
7350
- problems.push({ srcPath, detail: "it is a folder, not an HTML file" });
7351
- continue;
7352
- }
7353
- const fileHtml = read.text;
7354
- const validity = checkSubCompositionUsability(fileHtml, parseSubCompHtmlForValidity);
7355
- if (!validity.ok) {
7356
- problems.push({
7357
- srcPath,
7358
- detail: validity.detail ?? "the file is empty or could not be parsed"
7359
- });
7360
- continue;
7361
- }
7362
- const nestedVisited = new Set(visited);
7363
- nestedVisited.add(filePath);
7364
- try {
7365
- assertSubCompositionsUsable(fileHtml, projectDir, assetRoot, nestedVisited);
7366
- } catch (err) {
7367
- if (err instanceof EmptyCompositionError) {
7368
- problems.push(...err.problems);
7369
- } else {
7370
- throw err;
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;
7371
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);
7372
7476
  }
7373
- }
7374
- if (problems.length > 0) {
7375
- 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()]);
7376
7483
  }
7377
7484
  }
7378
7485
  var COMPILER_MOUNT_BLOCK_START = "/* __HF_COMPILER_MOUNT_START__ */";
@@ -7627,7 +7734,7 @@ async function compileHtmlFile(html, projectDir, baseDir, downloadDir, log, urlB
7627
7734
  compiledHtml = stripCrossoriginAttr(compiledHtml, "audio");
7628
7735
  return { html: compiledHtml, unresolvedCompositions };
7629
7736
  }
7630
- 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()) {
7631
7738
  const subCompositions = /* @__PURE__ */ new Map();
7632
7739
  const { document: document2 } = parseHTML(html);
7633
7740
  const compEls = document2.querySelectorAll("[data-composition-src]");
@@ -7640,6 +7747,10 @@ async function parseSubCompositions(html, projectDir, downloadDir, visited = /*
7640
7747
  if (visited.has(filePath)) {
7641
7748
  continue;
7642
7749
  }
7750
+ if (compiledSrcs.has(srcPath)) continue;
7751
+ compiledSrcs.add(srcPath);
7752
+ assertOutsideMarkupAsked(projectDir, filePath, srcPath, assetRoot, outsideFiles);
7753
+ assertCompositionFileSize(filePath, srcPath);
7643
7754
  const read = readProjectFile(filePath);
7644
7755
  if (read.kind !== "file") {
7645
7756
  continue;
@@ -7668,7 +7779,9 @@ async function parseSubCompositions(html, projectDir, downloadDir, visited = /*
7668
7779
  item.nestedVisited,
7669
7780
  urlByAbsentLocalPath,
7670
7781
  probes,
7671
- assetRoot
7782
+ assetRoot,
7783
+ outsideFiles,
7784
+ compiledSrcs
7672
7785
  );
7673
7786
  return {
7674
7787
  srcPath: item.srcPath,
@@ -7804,7 +7917,7 @@ function coalesceHeadStylesAndBodyScripts(html) {
7804
7917
  }
7805
7918
  return document2.toString();
7806
7919
  }
7807
- function inlineSubCompositions2(html, subCompositions, projectDir, variableOverrides, assetRoot) {
7920
+ function inlineSubCompositions2(html, subCompositions, projectDir, variableOverrides, assetRoot, outsideFiles) {
7808
7921
  const { document: document2 } = parseHTML(html);
7809
7922
  const head = document2.querySelector("head");
7810
7923
  const body = document2.querySelector("body");
@@ -7817,6 +7930,27 @@ function inlineSubCompositions2(html, subCompositions, projectDir, variableOverr
7817
7930
  );
7818
7931
  return { html: emitted ? document2.toString() : html, variablesByComp: {} };
7819
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
+ };
7820
7954
  const hostIdentityByElement = new ProducerHostIdentityMap(
7821
7955
  document2,
7822
7956
  hosts
@@ -7832,20 +7966,14 @@ function inlineSubCompositions2(html, subCompositions, projectDir, variableOverr
7832
7966
  readVariableDefaults: readDeclaredDefaults,
7833
7967
  parseHostVariables: parseHostVariableValues,
7834
7968
  resolveHtml: (srcPath) => {
7835
- let compHtml = subCompositions.get(srcPath) || null;
7836
- if (!compHtml) {
7837
- const filePath = resolveCompositionFile(projectDir, srcPath, assetRoot);
7838
- const read = filePath && !isPrivateCompositionFile(projectDir, filePath) ? readProjectFile(filePath) : null;
7839
- if (read?.kind === "file") {
7840
- compHtml = rewriteUnresolvableGsapToCdn(read.text, projectDir, srcPath);
7841
- }
7842
- }
7969
+ const compHtml = resolveMountHtml(srcPath);
7970
+ if (compHtml) budget.charge(srcPath, Buffer.byteLength(compHtml));
7843
7971
  return compHtml;
7844
7972
  },
7845
7973
  parseHtml: (htmlStr) => parseHTML(htmlStr).document,
7846
7974
  // Mirrors the preview bundler: a sub-composition's SIBLING assets resolve
7847
7975
  // against its own directory, project-root refs stay as authored.
7848
- assetExists: (path) => existsSync10(resolve5(projectDir, path)),
7976
+ assetExists: projectAssetExists(projectDir),
7849
7977
  // Preserve the authored root wrapper as a child of the host, matching
7850
7978
  // the preview bundler's shape (htmlBundler.ts's prepareFlattenedInnerRoot,
7851
7979
  // which the runtime compositionLoader mirrors with its own copy for the
@@ -8050,7 +8178,7 @@ ${safeText}
8050
8178
  }
8051
8179
  return wrappedFragment ? document2.body.innerHTML || "" : document2.toString();
8052
8180
  }
8053
- function collectExternalAssets(html, projectDir, log = defaultLogger, file = "index.html") {
8181
+ function collectExternalAssets(html, projectDir, log = defaultLogger, file = "index.html", policy = {}) {
8054
8182
  const absProjectDir = resolve5(projectDir);
8055
8183
  const externalAssets = /* @__PURE__ */ new Map();
8056
8184
  const leftOut = /* @__PURE__ */ new Set();
@@ -8063,7 +8191,7 @@ function collectExternalAssets(html, projectDir, log = defaultLogger, file = "in
8063
8191
  }
8064
8192
  const onShare = namesAnotherNetworkRoot(absProjectDir, absPath);
8065
8193
  if (!onShare && !existsSync10(absPath)) return null;
8066
- const refusal = onShare ? "network_share" : outsideAssetRefusal(absProjectDir, absPath);
8194
+ const refusal = onShare ? "network_share" : outsideAssetRefusal(absProjectDir, absPath, policy);
8067
8195
  if (refusal) {
8068
8196
  if (!leftOut.has(trimmed)) log.warn(`[Compiler] ${leftOutOfRender(file, trimmed, refusal)}`);
8069
8197
  leftOut.add(trimmed);
@@ -8370,7 +8498,7 @@ async function readLocalFont(absPath) {
8370
8498
  return { kind: "inline", buffer: Buffer.concat(chunks, totalBytes) };
8371
8499
  }
8372
8500
  async function embedLocalFontFaces(html, projectDir, assetRoot, log = defaultLogger) {
8373
- const { fontToDataUri: toDataUri } = await import("./deterministicFonts-VLIVGXUQ.js");
8501
+ const { fontToDataUri: toDataUri } = await import("./deterministicFonts-JER4GPCM.js");
8374
8502
  let result = html;
8375
8503
  const embeddedPaths = /* @__PURE__ */ new Set();
8376
8504
  const dataUriByAbsolutePath = /* @__PURE__ */ new Map();
@@ -8452,7 +8580,7 @@ function rebaseDirectEntryAssetPaths(html, projectDir, htmlPath) {
8452
8580
  const entryPath = relative2(projectDir, htmlPath).replace(/\\/g, "/");
8453
8581
  if (!entryPath.includes("/")) return html;
8454
8582
  const { document: document2 } = parseHTML(html);
8455
- const assetExists = (path) => existsSync10(resolve5(projectDir, path));
8583
+ const assetExists = projectAssetExists(projectDir);
8456
8584
  rewriteAssetPaths(
8457
8585
  document2.querySelectorAll("[src], [href], [srcset]"),
8458
8586
  entryPath,
@@ -8493,18 +8621,23 @@ function bindVariableMediaSources(html, variables) {
8493
8621
  var entryFileName = (projectDir, htmlPath) => isPathInside(htmlPath, projectDir) ? relative2(projectDir, htmlPath).split(sep2).join("/") : basename4(htmlPath);
8494
8622
  async function compileForRender(projectDir, htmlPath, downloadDir, options = {}) {
8495
8623
  const assetRoot = options.allowOutsideProjectAssets ? void 0 : projectDir;
8624
+ const outsideFiles = { includeScripts: options.includeOutsideScripts };
8496
8625
  if (isPathInside(htmlPath, projectDir) && escapesAssetRoot(htmlPath, assetRoot)) {
8497
8626
  throw new Error(`Entry file ${htmlPath} leads outside the project folder`);
8498
8627
  }
8628
+ if (isPathInside(htmlPath, projectDir) && runsOutsideMarkupUnasked(projectDir, htmlPath, assetRoot, outsideFiles)) {
8629
+ throw new Error(`Entry file ${htmlPath} ${OUTSIDE_COMPOSITION_NEEDS_FLAG}`);
8630
+ }
8499
8631
  if (!COMPOSITION_FILE.test(htmlPath)) {
8500
8632
  throw new Error(`Entry file ${htmlPath} is not an .html file, so it is refused`);
8501
8633
  }
8634
+ assertCompositionFileSize(htmlPath, basename4(htmlPath));
8502
8635
  const entryHtml = rebaseDirectEntryAssetPaths(readTextFile(htmlPath), projectDir, htmlPath);
8503
8636
  const rawHtml = bindVariableMediaSources(
8504
8637
  normalizeCompositionSrcs(rewriteUnresolvableGsapToCdn(entryHtml, projectDir), projectDir),
8505
8638
  options.variables ?? {}
8506
8639
  );
8507
- assertSubCompositionsUsable(rawHtml, projectDir, assetRoot);
8640
+ assertSubCompositionsUsable(rawHtml, projectDir, assetRoot, outsideFiles);
8508
8641
  const probes = /* @__PURE__ */ new Map();
8509
8642
  const { html: compiledHtml, unresolvedCompositions } = await compileHtmlFile(
8510
8643
  rawHtml,
@@ -8523,7 +8656,8 @@ async function compileForRender(projectDir, htmlPath, downloadDir, options = {})
8523
8656
  void 0,
8524
8657
  options.urlByAbsentLocalPath,
8525
8658
  probes,
8526
- assetRoot
8659
+ assetRoot,
8660
+ outsideFiles
8527
8661
  );
8528
8662
  const fullHtml = ensureFullDocument(compiledHtml);
8529
8663
  const { html: inlinedHtml, variablesByComp } = inlineSubCompositions2(
@@ -8531,7 +8665,8 @@ async function compileForRender(projectDir, htmlPath, downloadDir, options = {})
8531
8665
  subCompositions,
8532
8666
  projectDir,
8533
8667
  options.variables ?? {},
8534
- assetRoot
8668
+ assetRoot,
8669
+ outsideFiles
8535
8670
  );
8536
8671
  const sanitizedHtml = stripPreloadNone(inlinedHtml);
8537
8672
  const renderModeHints = detectRenderModeHints(sanitizedHtml, options.pageMotionBlur);
@@ -8585,7 +8720,7 @@ async function compileForRender(projectDir, htmlPath, downloadDir, options = {})
8585
8720
  cacheDir: options.animatedGifCacheDir,
8586
8721
  sourceAssets: remoteImageAssets,
8587
8722
  timeoutMs: options.ffmpegProcessTimeout,
8588
- assetRoot
8723
+ allowOutsideFiles: assetRoot === void 0
8589
8724
  });
8590
8725
  if (preparedHeifImages.length > 0) {
8591
8726
  defaultLogger.debug(`[Compiler] Converted ${preparedHeifImages.length} HEIC image(s) to JPEG`);
@@ -8601,7 +8736,7 @@ async function compileForRender(projectDir, htmlPath, downloadDir, options = {})
8601
8736
  cacheDir: options.animatedGifCacheDir,
8602
8737
  sourceAssets: gifSourceAssets,
8603
8738
  timeoutMs: options.ffmpegProcessTimeout,
8604
- assetRoot
8739
+ allowOutsideFiles: assetRoot === void 0
8605
8740
  });
8606
8741
  if (preparedGifs.length > 0) {
8607
8742
  defaultLogger.debug(`[Compiler] Prepared ${preparedGifs.length} animated GIF input(s) as WebM`);
@@ -8616,7 +8751,8 @@ async function compileForRender(projectDir, htmlPath, downloadDir, options = {})
8616
8751
  embeddedHtml,
8617
8752
  projectDir,
8618
8753
  options.log,
8619
- entryFileName(projectDir, htmlPath)
8754
+ entryFileName(projectDir, htmlPath),
8755
+ { includeScripts: options.includeOutsideScripts }
8620
8756
  ) : { html: embeddedHtml, externalAssets: /* @__PURE__ */ new Map() };
8621
8757
  for (const [relPath, absPath] of remoteMediaAssets) {
8622
8758
  externalAssets.set(relPath, absPath);
@@ -9023,7 +9159,7 @@ async function resolveCompositionDurations(page, unresolved) {
9023
9159
  }
9024
9160
  return resolutions;
9025
9161
  }
9026
- async function recompileWithResolutions(compiled, resolutions, projectDir, downloadDir, assetRoot) {
9162
+ async function recompileWithResolutions(compiled, resolutions, projectDir, downloadDir, assetRoot, outsideFiles = {}) {
9027
9163
  if (resolutions.length === 0) return compiled;
9028
9164
  const html = injectDurations(compiled.html, resolutions);
9029
9165
  const { subCompositions } = await parseSubCompositions(
@@ -9033,7 +9169,8 @@ async function recompileWithResolutions(compiled, resolutions, projectDir, downl
9033
9169
  void 0,
9034
9170
  void 0,
9035
9171
  void 0,
9036
- assetRoot
9172
+ assetRoot,
9173
+ outsideFiles
9037
9174
  );
9038
9175
  const { videos, audios, images } = compiled;
9039
9176
  const remaining = compiled.unresolvedCompositions.filter(
@@ -9081,6 +9218,7 @@ function resolveEntryHtmlPath(input) {
9081
9218
  `Entry file "${relative3(projectDir, path)}" leads outside the project folder`
9082
9219
  );
9083
9220
  }
9221
+ assertCompositionFileSize(path, relative3(projectDir, path));
9084
9222
  return readTextFile(path);
9085
9223
  };
9086
9224
  const htmlPath = join17(projectDir, entryFile);
@@ -9142,7 +9280,8 @@ async function runCompileStage(input) {
9142
9280
  pageMotionBlur: input.pageMotionBlur,
9143
9281
  animatedGifCacheDir: animatedGifCacheDir(cfg.extractCacheDir),
9144
9282
  ffmpegProcessTimeout: cfg.ffmpegProcessTimeout,
9145
- allowOutsideProjectAssets: job.config.allowOutsideProjectAssets
9283
+ allowOutsideProjectAssets: job.config.allowOutsideProjectAssets,
9284
+ includeOutsideScripts: job.config.includeOutsideScripts
9146
9285
  });
9147
9286
  assertNotAborted();
9148
9287
  const compileOnlyMs = Date.now() - compileStart;
@@ -9228,6 +9367,8 @@ async function runCompileStage(input) {
9228
9367
  });
9229
9368
  const outputWidth = Math.round(width * deviceScaleFactor);
9230
9369
  const outputHeight = Math.round(height * deviceScaleFactor);
9370
+ requireOutputDimensions(job.config.expectedOutputDimensions, outputWidth, outputHeight);
9371
+ if (job.config.expectedOutputDimensions !== void 0) job.outputDimensionsChecked = true;
9231
9372
  if (deviceScaleFactor !== 1) {
9232
9373
  log.info("Scaling composition via deviceScaleFactor", {
9233
9374
  compositionWidth: width,
@@ -9297,30 +9438,50 @@ function hasAutoStartVideos(html) {
9297
9438
  const { document: document2 } = parseHTML(html);
9298
9439
  return document2.querySelector("video[data-hf-auto-start]") !== null;
9299
9440
  }
9300
- function scopedVariablesFor(element, variablesByComp) {
9301
- const scope = element.closest("[data-composition-id]");
9302
- const compId = scope?.getAttribute("data-composition-id")?.trim() ?? "";
9303
- return compId && Object.hasOwn(variablesByComp, compId) ? variablesByComp[compId] : void 0;
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;
9304
9452
  }
9305
- function variableHasValue(element, variableId, variables, variablesByComp) {
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) {
9306
9463
  if (variables && Object.hasOwn(variables, variableId)) return true;
9307
- const scoped = scopedVariablesFor(element, variablesByComp);
9464
+ const scoped = scopedVariablesFor(scan, element, variablesByComp);
9465
+ if (scoped === null) return true;
9308
9466
  if (scoped) return Object.hasOwn(scoped, variableId);
9309
9467
  for (let scope = element.parentElement; scope; scope = scope.parentElement) {
9310
- if (Object.hasOwn(parseHostVariableValues(scope), variableId)) return true;
9311
- if (Object.hasOwn(readDeclaredDefaults(scope), variableId)) return true;
9468
+ if (++scan.steps > MAX_VARIABLE_SCOPE_STEPS) return true;
9469
+ if (variableIdsOn(scan, scope).has(variableId)) return true;
9312
9470
  }
9313
- return Object.hasOwn(readDeclaredDefaults(element.ownerDocument.documentElement), variableId);
9471
+ return variableIdsOn(scan, element.ownerDocument.documentElement).has(variableId);
9314
9472
  }
9315
9473
  function hasVariableBoundMedia(html, variables, variablesByComp = {}) {
9316
9474
  const { document: document2 } = parseHTML(html);
9475
+ const scan = { ids: /* @__PURE__ */ new Map(), steps: 0 };
9317
9476
  return Array.from(
9318
9477
  document2.querySelectorAll(
9319
9478
  "img[data-var-src], audio[data-var-src], video[data-var-src], source[data-var-src]"
9320
9479
  )
9321
9480
  ).some((element) => {
9322
9481
  const variableId = element.getAttribute("data-var-src")?.trim();
9323
- return Boolean(variableId && variableHasValue(element, variableId, variables, variablesByComp));
9482
+ return Boolean(
9483
+ variableId && variableHasValue(scan, element, variableId, variables, variablesByComp)
9484
+ );
9324
9485
  });
9325
9486
  }
9326
9487
  function authoredMediaStarts(html) {
@@ -9360,29 +9521,54 @@ function reconcileBrowserMediaEnd(existingEnd, projectedEnd, sourceChanged, dura
9360
9521
  if (sourceChanged && durationInferred) return projectedEnd;
9361
9522
  return existingEnd <= 0 ? projectedEnd : Math.min(existingEnd, projectedEnd);
9362
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
+ }
9363
9540
  function hasRuntimeMediaChanges(html) {
9364
9541
  const { document: document2 } = parseHTML(html);
9365
9542
  const scriptBodies = [...document2.querySelectorAll("script")].map(
9366
9543
  (script) => script.textContent ?? ""
9367
9544
  );
9368
9545
  const insertedMedia = scriptBodies.some(
9369
- (script) => /\bcreateElement\s*\(\s*["'`](?:video|audio)["'`]\s*\)/i.test(script) || /\bnew\s+(?:Audio|Video)\s*\(/i.test(script) || /<(?:video|audio)\b[^>]*>/i.test(script)
9546
+ (script) => /\bcreateElement\s*\(\s*["'`](?:video|audio)["'`]\s*\)/i.test(script) || /\bnew\s+(?:Audio|Video)\s*\(/i.test(script) || hasClosedMediaTag(script)
9370
9547
  );
9371
9548
  if (insertedMedia) return true;
9372
- const isManagedMedia = (element) => {
9373
- const name = element.tagName.toLowerCase();
9374
- if (name === "video" || name === "audio") return true;
9375
- return name === "source" && element.closest("video, audio") !== null;
9376
- };
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;
9377
9554
  for (const script of scriptBodies) {
9378
9555
  for (const mutation of extractMediaSrcMutations(script)) {
9379
- try {
9380
- const id = /^#[A-Za-z_][\w-]*$/.test(mutation.selector) ? mutation.selector.slice(1) : null;
9381
- const idTarget = id ? document2.getElementById(id) : null;
9382
- const targets = id ? idTarget ? [idTarget] : [] : [...document2.querySelectorAll(mutation.selector)];
9383
- if (targets.some(isManagedMedia)) return true;
9384
- } catch {
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;
9385
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 {
9386
9572
  }
9387
9573
  }
9388
9574
  return false;
@@ -9470,7 +9656,8 @@ async function runProbeStage(input) {
9470
9656
  port: 0,
9471
9657
  preHeadScripts: [VIRTUAL_TIME_SHIM],
9472
9658
  fps: job.config.fps,
9473
- allowOutsideProjectAssets: job.config.allowOutsideProjectAssets
9659
+ allowOutsideProjectAssets: job.config.allowOutsideProjectAssets,
9660
+ includeOutsideScripts: job.config.includeOutsideScripts
9474
9661
  });
9475
9662
  assertNotAborted();
9476
9663
  const motionBlur = job.config.motionBlur;
@@ -9626,7 +9813,8 @@ async function runProbeStage(input) {
9626
9813
  resolutions,
9627
9814
  projectDir,
9628
9815
  join18(workDir, "downloads"),
9629
- job.config.allowOutsideProjectAssets ? void 0 : projectDir
9816
+ job.config.allowOutsideProjectAssets ? void 0 : projectDir,
9817
+ { includeScripts: job.config.includeOutsideScripts }
9630
9818
  );
9631
9819
  assertNotAborted();
9632
9820
  composition.videos = compiled.videos;
@@ -12592,7 +12780,7 @@ import {
12592
12780
  readdirSync as readdirSync5,
12593
12781
  readFileSync as readFileSync7,
12594
12782
  rmSync as rmSync9,
12595
- statSync as statSync6,
12783
+ statSync as statSync7,
12596
12784
  writeFileSync as writeFileSync5
12597
12785
  } from "fs";
12598
12786
  import { readFile as readFile2 } from "fs/promises";
@@ -12706,7 +12894,7 @@ async function encodeGifFromDir(framesDir, framePattern, outputPath, input) {
12706
12894
  const failure = await reencodeWithClearedWholeFrames(argsInput, run, startTime);
12707
12895
  if (failure) return failure;
12708
12896
  }
12709
- const fileSize = existsSync19(outputPath) ? statSync6(outputPath).size : 0;
12897
+ const fileSize = existsSync19(outputPath) ? statSync7(outputPath).size : 0;
12710
12898
  return {
12711
12899
  success: true,
12712
12900
  outputPath,
@@ -12729,7 +12917,10 @@ function startEncodeProgress(job, stage, onProgress) {
12729
12917
  function resolveEngineConfig(input) {
12730
12918
  return input.engineConfig ?? input.job.config.producerConfig ?? resolveConfig();
12731
12919
  }
12732
- 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) {
12733
12924
  const { job, preset } = input;
12734
12925
  return {
12735
12926
  fps: job.config.fps,
@@ -12749,7 +12940,8 @@ function videoEncoderOptions(input, engineCfg) {
12749
12940
  // keyframes that survive `-f concat -c copy` at assemble time. In-process
12750
12941
  // renders leave both undefined → preserves the existing open-GOP output.
12751
12942
  lockGopForChunkConcat: input.lockGopForChunkConcat === true,
12752
- gopSize: input.gopSize
12943
+ gopSize: input.gopSize,
12944
+ softwareEncoderThreads
12753
12945
  };
12754
12946
  }
12755
12947
  function canEncodeWhileCapturing(input, workerCount, cpuCount) {
@@ -12765,8 +12957,9 @@ async function readLandedFrame(workerPath, mergedPath) {
12765
12957
  }
12766
12958
  return readFile2(mergedPath);
12767
12959
  }
12768
- function encodeWhileCapturing(input, totalFrames) {
12960
+ function encodeWhileCapturing(input, totalFrames, captureBudget) {
12769
12961
  const engineCfg = resolveEngineConfig(input);
12962
+ const softwareEncoderThreads = captureBudget ? overlapEncoderThreads(captureBudget.workerCount, captureBudget.cpuCount) : void 0;
12770
12963
  const stop = new AbortController();
12771
12964
  const signal = input.abortSignal ? AbortSignal.any([input.abortSignal, stop.signal]) : stop.signal;
12772
12965
  const landed = /* @__PURE__ */ new Map();
@@ -12781,7 +12974,10 @@ function encodeWhileCapturing(input, totalFrames) {
12781
12974
  let reportFed = null;
12782
12975
  const encoder = spawnStreamingEncoder(
12783
12976
  input.videoOnlyPath,
12784
- { ...videoEncoderOptions(input, engineCfg), imageFormat: "jpeg" },
12977
+ {
12978
+ ...videoEncoderOptions(input, engineCfg, softwareEncoderThreads),
12979
+ imageFormat: "jpeg"
12980
+ },
12785
12981
  signal,
12786
12982
  engineCfg
12787
12983
  );
@@ -13111,7 +13307,7 @@ function sampleDirectoryBytes(dir) {
13111
13307
  for (const name of entries) {
13112
13308
  const full = join29(current, name);
13113
13309
  try {
13114
- const st = statSync7(full);
13310
+ const st = statSync8(full);
13115
13311
  if (st.isDirectory()) {
13116
13312
  stack.push(full);
13117
13313
  } else if (st.isFile()) {
@@ -13266,7 +13462,7 @@ function findMissingFrameRanges(totalFrames, framesDir, frameExt) {
13266
13462
  let rangeStart = null;
13267
13463
  for (let frameIndex = 0; frameIndex < totalFrames; frameIndex++) {
13268
13464
  const framePath = join29(framesDir, formatCaptureFrameName(frameIndex, frameExt));
13269
- const missing = !existsSync20(framePath) || statSync7(framePath).size <= 8;
13465
+ const missing = !existsSync20(framePath) || statSync8(framePath).size <= 8;
13270
13466
  if (missing && rangeStart === null) {
13271
13467
  rangeStart = frameIndex;
13272
13468
  } else if (!missing && rangeStart !== null) {
@@ -14603,7 +14799,8 @@ async function executeRenderPipeline(input) {
14603
14799
  port: 0,
14604
14800
  preHeadScripts: [VIRTUAL_TIME_SHIM],
14605
14801
  fps: job.config.fps,
14606
- allowOutsideProjectAssets: job.config.allowOutsideProjectAssets
14802
+ allowOutsideProjectAssets: job.config.allowOutsideProjectAssets,
14803
+ includeOutsideScripts: job.config.includeOutsideScripts
14607
14804
  });
14608
14805
  assertNotAborted();
14609
14806
  observability.stageEnd("file_server", fileServerStart);
@@ -15892,7 +16089,10 @@ async function executeRenderPipeline(input) {
15892
16089
  assertNotAborted,
15893
16090
  onProgress
15894
16091
  };
15895
- 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;
15896
16096
  const captureFrameStart = Date.now();
15897
16097
  const invokeDiskCapture = (diskPlan) => observeRenderStage(
15898
16098
  observability,
@@ -16912,8 +17112,10 @@ function buildSyntheticRenderJob(input) {
16912
17112
  producerConfig: input.producerConfig,
16913
17113
  variables: input.variables,
16914
17114
  strictVariables: input.strictVariables,
17115
+ expectedOutputDimensions: input.expectedOutputDimensions,
16915
17116
  pageMotionBlur: input.pageMotionBlur,
16916
- allowOutsideProjectAssets: input.allowOutsideProjectAssets
17117
+ allowOutsideProjectAssets: input.allowOutsideProjectAssets,
17118
+ includeOutsideScripts: input.includeOutsideScripts
16917
17119
  };
16918
17120
  return createRenderJob(renderConfig);
16919
17121
  }
@@ -18378,8 +18580,10 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
18378
18580
  producerConfig: cfg,
18379
18581
  variables: config.variables,
18380
18582
  strictVariables: config.strictVariables,
18583
+ expectedOutputDimensions: config.expectedOutputDimensions,
18381
18584
  pageMotionBlur: config.pageMotionBlur,
18382
- allowOutsideProjectAssets: options.allowOutsideProjectAssets === true
18585
+ allowOutsideProjectAssets: options.allowOutsideProjectAssets === true,
18586
+ includeOutsideScripts: options.includeOutsideScripts === true
18383
18587
  });
18384
18588
  const entryFile = config.entryFile ?? "index.html";
18385
18589
  const htmlPath = join38(projectDir, entryFile);
@@ -18400,7 +18604,9 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
18400
18604
  if (rel === "") return true;
18401
18605
  if (leavesRoot(rel)) return false;
18402
18606
  if (job.config.allowOutsideProjectAssets) {
18403
- 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;
18404
18610
  } else if (!isSafePath(projectDir, src)) return false;
18405
18611
  const firstSegment = rel.split(sep3, 1)[0];
18406
18612
  return firstSegment === void 0 || !PLAN_PROJECT_DIR_SKIP_SEGMENTS.has(firstSegment);
@@ -18507,7 +18713,7 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
18507
18713
  if (probeResult.fileServer) closeFileServerSafely(probeResult.fileServer, "plan", log);
18508
18714
  if (probeResult.probeSession) {
18509
18715
  try {
18510
- const { closeCaptureSession: closeCaptureSession2 } = await import("./src-B646B52O.js");
18716
+ const { closeCaptureSession: closeCaptureSession2 } = await import("./src-BNSCFKOD.js");
18511
18717
  await closeCaptureSession2(probeResult.probeSession);
18512
18718
  } catch (err) {
18513
18719
  log.warn("[plan] probe session close failed", {
@@ -18845,6 +19051,7 @@ async function buildLocalExecutionPlan(projectDir, config, executionPlanDir, opt
18845
19051
  format: config.format,
18846
19052
  ffmpegVersion,
18847
19053
  producerVersion,
19054
+ ...job.outputDimensionsChecked === void 0 ? {} : { outputDimensionsChecked: job.outputDimensionsChecked },
18848
19055
  ...job.strictVariablesChecked === void 0 ? {} : { strictVariablesChecked: job.strictVariablesChecked }
18849
19056
  };
18850
19057
  }
@@ -18863,6 +19070,7 @@ async function plan(projectDir, config, planDir, options = {}) {
18863
19070
  format: executionPlan.format,
18864
19071
  ffmpegVersion: executionPlan.ffmpegVersion,
18865
19072
  producerVersion: executionPlan.producerVersion,
19073
+ ...executionPlan.outputDimensionsChecked === void 0 ? {} : { outputDimensionsChecked: executionPlan.outputDimensionsChecked },
18866
19074
  ...executionPlan.strictVariablesChecked === void 0 ? {} : { strictVariablesChecked: executionPlan.strictVariablesChecked }
18867
19075
  };
18868
19076
  }
@@ -18881,7 +19089,7 @@ import {
18881
19089
  readFileSync as readFileSync11,
18882
19090
  readdirSync as readdirSync10,
18883
19091
  rmSync as rmSync14,
18884
- statSync as statSync9,
19092
+ statSync as statSync10,
18885
19093
  writeFileSync as writeFileSync11
18886
19094
  } from "fs";
18887
19095
  import { tmpdir as tmpdir3 } from "os";
@@ -18894,7 +19102,7 @@ import {
18894
19102
  linkSync as linkSync2,
18895
19103
  mkdirSync as mkdirSync15,
18896
19104
  rmSync as rmSync13,
18897
- statSync as statSync8,
19105
+ statSync as statSync9,
18898
19106
  writeFileSync as writeFileSync10
18899
19107
  } from "fs";
18900
19108
  import { dirname as dirname15, join as join40 } from "path";
@@ -18962,7 +19170,7 @@ var LocalPlanV2ArtifactPublisher = class {
18962
19170
  }
18963
19171
  async putBlob(blob) {
18964
19172
  const digest = assertPlanV2Sha256(blob.sha256, "published blob sha256");
18965
- const sourceSize = statSync8(blob.sourcePath).size;
19173
+ const sourceSize = statSync9(blob.sourcePath).size;
18966
19174
  if (sourceSize !== blob.sizeBytes) {
18967
19175
  throw new PlanV2IntegrityError(
18968
19176
  `published blob size changed for ${digest}: expected ${blob.sizeBytes}, got ${sourceSize}`
@@ -19275,7 +19483,7 @@ function publishBlobFor(absolutePath, digests) {
19275
19483
  return {
19276
19484
  sourcePath: absolutePath,
19277
19485
  sha256: planFileSha256(absolutePath, digests),
19278
- sizeBytes: statSync9(absolutePath).size
19486
+ sizeBytes: statSync10(absolutePath).size
19279
19487
  };
19280
19488
  }
19281
19489
  async function putBlobs(publisher, blobs) {
@@ -19454,7 +19662,10 @@ async function planV2WithPublisher(projectDir, config, publisher, options = {})
19454
19662
  sliceChunkAudio: true,
19455
19663
  deferAudio: options.deferAudio
19456
19664
  });
19457
- options.onPlanned?.({ strictVariablesChecked: planned.strictVariablesChecked });
19665
+ options.onPlanned?.({
19666
+ strictVariablesChecked: planned.strictVariablesChecked,
19667
+ outputDimensionsChecked: planned.outputDimensionsChecked
19668
+ });
19458
19669
  return await publishExecutionPlan(stagingRoot, publisher, { digests, log: config.logger });
19459
19670
  } catch (error) {
19460
19671
  try {
@@ -19643,7 +19854,7 @@ function verifyBlob(planV2Dir, artifact) {
19643
19854
  if (!existsSync27(sourcePath)) {
19644
19855
  throw new PlanV2IntegrityError(`missing content-addressed artifact ${artifact.sha256}`);
19645
19856
  }
19646
- const stats = statSync9(sourcePath);
19857
+ const stats = statSync10(sourcePath);
19647
19858
  if (!stats.isFile() || stats.size !== artifact.sizeBytes) {
19648
19859
  throw new PlanV2IntegrityError(`artifact size mismatch for ${artifact.path}`);
19649
19860
  }
@@ -19736,7 +19947,7 @@ function readValidatedPlanV2Materialization(planDir, expectedTarget) {
19736
19947
  for (const artifact of required) {
19737
19948
  if (Object.hasOwn(remoteSources, artifact.path)) continue;
19738
19949
  const path = join41(planDir, ...artifact.path.split("/"));
19739
- if (!existsSync27(path) || statSync9(path).size !== artifact.sizeBytes) {
19950
+ if (!existsSync27(path) || statSync10(path).size !== artifact.sizeBytes) {
19740
19951
  throw new PlanV2IntegrityError(
19741
19952
  `materialized artifact missing or truncated: ${artifact.path}`
19742
19953
  );
@@ -20276,7 +20487,10 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
20276
20487
  const captureSession = session;
20277
20488
  session = null;
20278
20489
  verifyStarted = Date.now();
20279
- 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;
20280
20494
  await observeRenderStage(
20281
20495
  new RenderObservabilityRecorder({ pipelineStartMs: start, log }),
20282
20496
  "capture_chunk",
@@ -20481,7 +20695,11 @@ async function renderSpan(projectDir, config, span, outputPath, options = {}) {
20481
20695
  projectDir,
20482
20696
  { ...config, rejectOnSystemFonts: false, failClosedFontFetch: false },
20483
20697
  planDir,
20484
- { chunksCarryAudio: true, allowOutsideProjectAssets: options.allowOutsideProjectAssets }
20698
+ {
20699
+ chunksCarryAudio: true,
20700
+ allowOutsideProjectAssets: options.allowOutsideProjectAssets,
20701
+ includeOutsideScripts: options.includeOutsideScripts
20702
+ }
20485
20703
  );
20486
20704
  const { startFrame, endFrame } = spanFrameRange(
20487
20705
  span.startSeconds,
@@ -20530,7 +20748,9 @@ var SAFE_RENDER_ERROR_CODES = /* @__PURE__ */ new Set([
20530
20748
  "RENDER_TOO_SLOW",
20531
20749
  "RENDER_STAGE_STALLED",
20532
20750
  "PAGE_NEVER_READY",
20533
- "VARIABLES_INVALID"
20751
+ "VARIABLES_INVALID",
20752
+ "OUTPUT_DIMENSIONS_MISMATCH",
20753
+ "COMPOSITION_TOO_LARGE"
20534
20754
  ]);
20535
20755
  function extractSafeRenderErrorCode(error) {
20536
20756
  if (typeof error !== "object" || error === null || !("code" in error)) return void 0;
@@ -20572,6 +20792,12 @@ function validateDistributedRenderConfig(config) {
20572
20792
  `must be one of ${DISTRIBUTED_FPS.join(", ")}; got ${String(config.fps)}`
20573
20793
  );
20574
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
+ }
20575
20801
  validateIntDimension("config.width", config.width);
20576
20802
  validateIntDimension("config.height", config.height);
20577
20803
  if (config.pageMotionBlur !== void 0 && config.pageMotionBlur !== "off") {
@@ -20925,6 +21151,11 @@ function assertRequestOptionScalars(options) {
20925
21151
  }
20926
21152
  function assertRequestOptionObjects(options) {
20927
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
+ }
20928
21159
  if (options.variables !== void 0 && !isPlainObject(options.variables)) {
20929
21160
  throw new Error("Render request variables must be a JSON object");
20930
21161
  }
@@ -20990,7 +21221,8 @@ function renderConfigFromRequest(request, runtime = {}) {
20990
21221
  ...options,
20991
21222
  producerConfig: engineConfig,
20992
21223
  logger: runtime.logger,
20993
- allowOutsideProjectAssets: runtime.allowOutsideProjectAssets === true
21224
+ allowOutsideProjectAssets: runtime.allowOutsideProjectAssets === true,
21225
+ includeOutsideScripts: runtime.includeOutsideScripts === true
20994
21226
  };
20995
21227
  }
20996
21228
  function distributedFps(fps) {
@@ -21045,7 +21277,8 @@ function distributedConfigFromRequest(request, runtime = {}) {
21045
21277
  abortSignal: runtime.abortSignal,
21046
21278
  planDirSizeLimitBytes: distributed.planDirSizeLimitBytes,
21047
21279
  variables: options.variables,
21048
- strictVariables: options.strictVariables
21280
+ strictVariables: options.strictVariables,
21281
+ expectedOutputDimensions: options.expectedOutputDimensions
21049
21282
  };
21050
21283
  }
21051
21284
  function optionalProperty(key, value) {
@@ -21087,7 +21320,8 @@ function renderRequestFromDistributedConfig(input) {
21087
21320
  ...optionalProperty("strictness", config.strictness),
21088
21321
  ...optionalProperty("entryFile", config.entryFile),
21089
21322
  ...optionalProperty("variables", config.variables),
21090
- ...optionalProperty("strictVariables", config.strictVariables)
21323
+ ...optionalProperty("strictVariables", config.strictVariables),
21324
+ ...optionalProperty("expectedOutputDimensions", config.expectedOutputDimensions)
21091
21325
  };
21092
21326
  return createRenderRequest({
21093
21327
  projectDir: input.projectDir,
@@ -21101,7 +21335,7 @@ function renderRequestFromDistributedConfig(input) {
21101
21335
  import {
21102
21336
  existsSync as existsSync31,
21103
21337
  mkdirSync as mkdirSync19,
21104
- statSync as statSync11,
21338
+ statSync as statSync12,
21105
21339
  mkdtempSync as mkdtempSync2,
21106
21340
  writeFileSync as writeFileSync13,
21107
21341
  rmSync as rmSync17,
@@ -21120,7 +21354,7 @@ import { serve as serve2 } from "@hono/node-server";
21120
21354
  import {
21121
21355
  existsSync as existsSync29,
21122
21356
  readFileSync as readFileSync14,
21123
- statSync as statSync10,
21357
+ statSync as statSync11,
21124
21358
  openSync as openSync6,
21125
21359
  fstatSync as fstatSync3,
21126
21360
  closeSync as closeSync6,
@@ -21161,7 +21395,7 @@ function readEntryHtml(filePath) {
21161
21395
  } catch (error) {
21162
21396
  if (error instanceof Error && "code" in error && (error.code === "ENOENT" || error.code === "ENOTDIR"))
21163
21397
  return null;
21164
- if (!statSync10(filePath, { throwIfNoEntry: false })?.isFile()) return null;
21398
+ if (!statSync11(filePath, { throwIfNoEntry: false })?.isFile()) return null;
21165
21399
  throw error;
21166
21400
  }
21167
21401
  try {
@@ -21177,7 +21411,7 @@ function leavesProject(absProjectDir, absoluteEntryPath, isAllowedEntry) {
21177
21411
  }
21178
21412
  function readProjectEntryFile(projectDir, preferredEntryFile, isAllowedEntry) {
21179
21413
  const absProjectDir = resolve9(projectDir);
21180
- if (!existsSync29(absProjectDir) || !statSync10(absProjectDir).isDirectory()) {
21414
+ if (!existsSync29(absProjectDir) || !statSync11(absProjectDir).isDirectory()) {
21181
21415
  return { error: `Project directory not found: ${absProjectDir}` };
21182
21416
  }
21183
21417
  const entryCandidates = [preferredEntryFile, "index.html", "src/index.html"].filter(
@@ -21520,6 +21754,7 @@ function parseRenderOptions(body) {
21520
21754
  outputDynamicRange,
21521
21755
  variables,
21522
21756
  strictVariables,
21757
+ expectedOutputDimensions: isExpectedOutputDimensions(body.expectedOutputDimensions) ? body.expectedOutputDimensions : void 0,
21523
21758
  outputResolution,
21524
21759
  outputResolutionAspectAgnostic,
21525
21760
  videoFrameFormat
@@ -21559,6 +21794,7 @@ function buildRenderJobConfig(input, outputPath, log) {
21559
21794
  entryFile: input.entryFile,
21560
21795
  variables: input.variables,
21561
21796
  strictVariables: input.strictVariables,
21797
+ expectedOutputDimensions: input.expectedOutputDimensions,
21562
21798
  outputResolution: input.outputResolution,
21563
21799
  outputResolutionAspectAgnostic: input.outputResolutionAspectAgnostic,
21564
21800
  videoFrameFormat: input.videoFrameFormat,
@@ -21603,6 +21839,9 @@ function validateRenderOverrides(body) {
21603
21839
  if (body.variables !== void 0 && !isPlainObject2(body.variables)) {
21604
21840
  return 'variables must be a JSON object keyed by variable id (e.g. {"title":"Hello"})';
21605
21841
  }
21842
+ if (body.expectedOutputDimensions !== void 0 && !isExpectedOutputDimensions(body.expectedOutputDimensions)) {
21843
+ return "expectedOutputDimensions must contain positive integer width and height";
21844
+ }
21606
21845
  if (body.strictVariables !== void 0 && typeof body.strictVariables !== "boolean") {
21607
21846
  return "strictVariables must be a boolean";
21608
21847
  }
@@ -21653,7 +21892,7 @@ function prepareProjectDirectory(projectDir, options, policy) {
21653
21892
  if (!candidate) return null;
21654
21893
  const absProjectDir = policy ? resolve10(policy.projectsDir, candidate) : resolve10(candidate);
21655
21894
  const shown = policy ? candidate : absProjectDir;
21656
- if (policy && !isAllowedProjectPath(policy.projectsDir, absProjectDir) || !existsSync31(absProjectDir) || !statSync11(absProjectDir).isDirectory()) {
21895
+ if (policy && !isAllowedProjectPath(policy.projectsDir, absProjectDir) || !existsSync31(absProjectDir) || !statSync12(absProjectDir).isDirectory()) {
21657
21896
  return { error: `Project directory not found: ${shown}` };
21658
21897
  }
21659
21898
  const entry = options.entryFile || "index.html";
@@ -21756,7 +21995,7 @@ function publicPerfSummary(job) {
21756
21995
  return job.perfSummary ? { ...job.perfSummary, renderId: void 0 } : null;
21757
21996
  }
21758
21997
  function outputFileSize(path) {
21759
- return existsSync31(path) ? statSync11(path).size : 0;
21998
+ return existsSync31(path) ? statSync12(path).size : 0;
21760
21999
  }
21761
22000
  function createBlockingProgressReporter(log, requestId) {
21762
22001
  let lastLoggedPct = -10;
@@ -21959,7 +22198,8 @@ function createRenderHandlers(options = {}) {
21959
22198
  outcome: job.outcome ?? "completed",
21960
22199
  warnings: job.warnings,
21961
22200
  perf: policy ? publicPerfSummary(job) : job.perfSummary ?? null,
21962
- ...strictVariablesResult(job)
22201
+ ...strictVariablesResult(job),
22202
+ ...job.outputDimensionsChecked === void 0 ? {} : { outputDimensionsChecked: job.outputDimensionsChecked }
21963
22203
  });
21964
22204
  } catch (error) {
21965
22205
  const durationMs = Date.now() - t0;
@@ -22056,7 +22296,8 @@ function createRenderHandlers(options = {}) {
22056
22296
  warnings: job.warnings,
22057
22297
  perf: policy ? publicPerfSummary(job) : job.perfSummary ?? null,
22058
22298
  producerVersion: readProducerVersion(),
22059
- ...strictVariablesResult(job)
22299
+ ...strictVariablesResult(job),
22300
+ ...job.outputDimensionsChecked === void 0 ? {} : { outputDimensionsChecked: job.outputDimensionsChecked }
22060
22301
  })
22061
22302
  });
22062
22303
  } catch (error) {
@@ -22085,7 +22326,7 @@ function createRenderHandlers(options = {}) {
22085
22326
  store.delete(token);
22086
22327
  return c.json({ success: false, error: "Output artifact file missing" }, 404);
22087
22328
  }
22088
- const stats = statSync11(artifact.path);
22329
+ const stats = statSync12(artifact.path);
22089
22330
  return new Response(createReadStream5(artifact.path), {
22090
22331
  headers: {
22091
22332
  "content-type": "video/mp4",
@@ -22222,7 +22463,7 @@ function startServer(options = {}) {
22222
22463
  });
22223
22464
  async function shutdown(signal) {
22224
22465
  log.info(`Received ${signal}, shutting down`);
22225
- const { drainBrowserPool } = await import("./src-B646B52O.js");
22466
+ const { drainBrowserPool } = await import("./src-BNSCFKOD.js");
22226
22467
  await drainBrowserPool().catch(() => {
22227
22468
  });
22228
22469
  const handle = await Promise.race([
@@ -22270,7 +22511,7 @@ import {
22270
22511
  readFileSync as readFileSync15,
22271
22512
  readdirSync as readdirSync12,
22272
22513
  rmSync as rmSync18,
22273
- statSync as statSync12,
22514
+ statSync as statSync13,
22274
22515
  writeFileSync as writeFileSync14
22275
22516
  } from "fs";
22276
22517
  import { basename as basename7, dirname as dirname20, join as join47 } from "path";
@@ -22301,7 +22542,7 @@ async function assemble(planDir, chunkOutputs, audioPath, outputPath, options) {
22301
22542
  outputPath,
22302
22543
  durationMs: Date.now() - start,
22303
22544
  framesEncoded: plan2.totalFrames,
22304
- fileSize: statSync12(outputPath).size
22545
+ fileSize: statSync13(outputPath).size
22305
22546
  };
22306
22547
  }
22307
22548
  const format = plan2.dimensions.format;
@@ -22348,7 +22589,7 @@ async function assemble(planDir, chunkOutputs, audioPath, outputPath, options) {
22348
22589
  });
22349
22590
  }
22350
22591
  }
22351
- const fileSize = existsSync32(outputPath) ? statSync12(outputPath).size : 0;
22592
+ const fileSize = existsSync32(outputPath) ? statSync13(outputPath).size : 0;
22352
22593
  return {
22353
22594
  ...referenceBackgroundResult(plan2[REFERENCE_BACKGROUND_FIELD]),
22354
22595
  outputPath,
@@ -22546,7 +22787,7 @@ function mergePngFrameDirs(chunkPaths, outputPath, totalFrames, audioPath, start
22546
22787
  mkdirSync20(outputPath, { recursive: true });
22547
22788
  let globalIdx = 0;
22548
22789
  for (const chunkDir of chunkPaths) {
22549
- if (!statSync12(chunkDir).isDirectory()) {
22790
+ if (!statSync13(chunkDir).isDirectory()) {
22550
22791
  throw new Error(
22551
22792
  `[assemble] png-sequence chunk must be a directory: ${chunkDir} (got a file)`
22552
22793
  );
@@ -22573,7 +22814,7 @@ function mergePngFrameDirs(chunkPaths, outputPath, totalFrames, audioPath, start
22573
22814
  let fileSize = 0;
22574
22815
  for (const name of readdirSync12(outputPath)) {
22575
22816
  try {
22576
- fileSize += statSync12(join47(outputPath, name)).size;
22817
+ fileSize += statSync13(join47(outputPath, name)).size;
22577
22818
  } catch {
22578
22819
  }
22579
22820
  }
@@ -22618,9 +22859,9 @@ async function assembleV2(planV2Dir, chunkPaths, outputPath, options) {
22618
22859
  }
22619
22860
 
22620
22861
  // ../producer/src/services/distributed/projectHash.ts
22621
- import { closeSync as closeSync7, openSync as openSync7, readdirSync as readdirSync13, readSync as readSync5, realpathSync as realpathSync2, statSync as statSync13 } from "fs";
22862
+ import { closeSync as closeSync7, openSync as openSync7, readdirSync as readdirSync13, readSync as readSync5, realpathSync as realpathSync2, statSync as statSync14 } from "fs";
22622
22863
  import { createHash as createHash8 } from "crypto";
22623
- import { join as join49 } from "path";
22864
+ import { join as join49, sep as sep6 } from "path";
22624
22865
  var READ_CHUNK_BYTES = 256 * 1024;
22625
22866
 
22626
22867
  // ../producer/src/services/distributed/audioSidecar.ts