hyperframes 0.9.52 → 0.9.54

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 (310) hide show
  1. package/dist/{add-Z6G2DLNE.js → add-OVHVUHQR.js} +26 -21
  2. package/dist/{agentPromptGenerator-RCTC2XXL.js → agentPromptGenerator-L2B3HMHF.js} +16 -21
  3. package/dist/{animatedGifPrep-X7KILCDI.js → animatedGifPrep-YMJH33FX.js} +19 -20
  4. package/dist/api.js +52 -51
  5. package/dist/{appHistory-DK2XI4EZ.js → appHistory-T3ZLA7QN.js} +4 -3
  6. package/dist/{asset-A3ENWWCU.js → asset-ORCN4EVH.js} +2 -2
  7. package/dist/{assetCataloger-TIMZTOYH.js → assetCataloger-X23VB66T.js} +17 -17
  8. package/dist/{audio-HMCUO2CV.js → audio-NHNXBUI2.js} +103 -74
  9. package/dist/{auth-NXR3QM4C.js → auth-DQDDXQFC.js} +5 -5
  10. package/dist/{autoUpdate-TY7P2Z4F.js → autoUpdate-LF7BJN34.js} +4 -2
  11. package/dist/{avatars-36MYJUPA.js → avatars-KFUMWRVX.js} +23 -21
  12. package/dist/{backgroundChecks-EWWJEGF6.js → backgroundChecks-Y6RHADW6.js} +5 -3
  13. package/dist/backgroundChecksWorker.js +5 -4
  14. package/dist/{batchRender-VKM4E7PI.js → batchRender-CMG4SVBX.js} +27 -8
  15. package/dist/{beats-Z4B4B4KM.js → beats-JXZBK7JI.js} +17 -17
  16. package/dist/{benchmark-PLGO2THH.js → benchmark-CLU6JUGY.js} +34 -16
  17. package/dist/{billing-ZIXACCLR.js → billing-5GMYFDMC.js} +23 -22
  18. package/dist/{browser-VZFBNASB.js → browser-S4R6LZMF.js} +13 -13
  19. package/dist/{bundleWithLocalizedFonts-XD2XDEQL.js → bundleWithLocalizedFonts-SFUFSBEU.js} +1 -1
  20. package/dist/{capture-BAFLHNDI.js → capture-A3FLQIDI.js} +32 -33
  21. package/dist/{capture-GC4F54XT.js → capture-NL7V23HG.js} +5 -5
  22. package/dist/{captureCompositionFrame-YBVEFKWM.js → captureCompositionFrame-R7GYVNTF.js} +22 -22
  23. package/dist/{captureFile-R5JZ7WRA.js → captureFile-LXMDM5TD.js} +3 -3
  24. package/dist/{catalog-LHOCJUO2.js → catalog-42I7W7AU.js} +26 -21
  25. package/dist/{catch-up-6FNQ6I7Q.js → catch-up-TFSQZQZD.js} +16 -15
  26. package/dist/{check-S7T5LE6V.js → check-CXRQZBLD.js} +59 -56
  27. package/dist/{checkAudio-AKOI4AWK.js → checkAudio-AJUH6RU6.js} +20 -20
  28. package/dist/{checkBrowser-NABXGNNM.js → checkBrowser-4BLSYI25.js} +52 -49
  29. package/dist/{chunk-47MEWWCO.js → chunk-26RTKW2U.js} +2 -2
  30. package/dist/{chunk-UAU4SIOQ.js → chunk-2PASB3PC.js} +8 -8
  31. package/dist/{chunk-ZG6BVWQ7.js → chunk-32DAUKF5.js} +4 -4
  32. package/dist/{chunk-YXQA6MKA.js → chunk-3IHRXHJQ.js} +4 -4
  33. package/dist/{chunk-PRG42HNH.js → chunk-3IUBSGD2.js} +2 -2
  34. package/dist/{chunk-GEIWJSWN.js → chunk-3NPZZT2K.js} +10 -10
  35. package/dist/{chunk-5B425ZB3.js → chunk-3NXY6O4X.js} +1 -1
  36. package/dist/{chunk-U7ZCBWNM.js → chunk-4IUOWNDS.js} +3 -3
  37. package/dist/{chunk-4OHV7UZZ.js → chunk-4NG5GSTO.js} +1 -1
  38. package/dist/{chunk-CIMOTEZB.js → chunk-4Q3Q4NFK.js} +4 -4
  39. package/dist/{chunk-KUZTIMY3.js → chunk-4WK4O5FI.js} +8 -8
  40. package/dist/{chunk-CIGQUDEV.js → chunk-4ZFNNWUX.js} +51 -16
  41. package/dist/{chunk-2MNSS7PH.js → chunk-5HJZGP54.js} +3 -3
  42. package/dist/{chunk-UX2KMUKC.js → chunk-5XLTJMCN.js} +10 -10
  43. package/dist/{chunk-YXR5MVBM.js → chunk-63ESYLBY.js} +2 -2
  44. package/dist/{chunk-MP4TEYUJ.js → chunk-6EMFSRTW.js} +4 -1
  45. package/dist/{chunk-S5EMQAKL.js → chunk-6SRBTOGD.js} +3 -3
  46. package/dist/{chunk-7RLMDAUO.js → chunk-6T4PB35F.js} +2 -1
  47. package/dist/{chunk-IB722ALN.js → chunk-73UFPVUC.js} +2 -2
  48. package/dist/{chunk-KLIVZ5VG.js → chunk-75TCOXNT.js} +1 -1
  49. package/dist/{chunk-C66O6A2J.js → chunk-77U3646W.js} +2 -2
  50. package/dist/{chunk-64T46P7K.js → chunk-7RGWVZOS.js} +3 -3
  51. package/dist/{chunk-MF53JVZ5.js → chunk-7RI3U46M.js} +1 -1
  52. package/dist/{chunk-G6QCHM2N.js → chunk-7WRLK2K4.js} +5 -5
  53. package/dist/{chunk-YPURY3MW.js → chunk-AROERRUJ.js} +2 -2
  54. package/dist/{chunk-MOTJT42J.js → chunk-ATKA5KHE.js} +15 -3
  55. package/dist/{chunk-Z2EKCD7H.js → chunk-AU4ZBCR3.js} +1 -1
  56. package/dist/{chunk-6NGJ55V5.js → chunk-AYESPEPQ.js} +2 -2
  57. package/dist/{chunk-FCNMU7LC.js → chunk-B5HSHXE2.js} +2 -2
  58. package/dist/{chunk-CDK23M57.js → chunk-B6AK5P2D.js} +9 -9
  59. package/dist/{chunk-UBHBB3TB.js → chunk-BBDWXUO3.js} +45 -53
  60. package/dist/{chunk-AMWWQXTC.js → chunk-BDWLBCTG.js} +7 -7
  61. package/dist/{chunk-NQ3NHCF6.js → chunk-BNONW4QT.js} +2 -2
  62. package/dist/{chunk-POGZYVM2.js → chunk-C7LNWZ7G.js} +9 -9
  63. package/dist/{chunk-WN4W76IQ.js → chunk-CAYQATCT.js} +1 -1
  64. package/dist/{chunk-TDQUQAW5.js → chunk-CBCB6GPL.js} +105 -41
  65. package/dist/{chunk-U3LWQGCD.js → chunk-CIYNUD7Q.js} +1 -1
  66. package/dist/{chunk-SQ64IEA7.js → chunk-CNZOKODL.js} +3 -3
  67. package/dist/{chunk-7VQ3RAKO.js → chunk-CWXJZB44.js} +19 -16
  68. package/dist/{chunk-J45SCYTD.js → chunk-D4EGZYDN.js} +8 -8
  69. package/dist/{chunk-ZW6ZUKBB.js → chunk-DOLVT6CH.js} +1 -1
  70. package/dist/{chunk-E2KJT7JR.js → chunk-DVTRMGYG.js} +2 -2
  71. package/dist/{chunk-I6SCA2ME.js → chunk-DWDCE4PO.js} +55 -26
  72. package/dist/{chunk-P37ZACC6.js → chunk-DXVK3NMV.js} +3 -3
  73. package/dist/{chunk-DPVXBVLL.js → chunk-DZWAYZG2.js} +6254 -6096
  74. package/dist/{chunk-HD5RVDL6.js → chunk-E2DHBP6C.js} +1 -1
  75. package/dist/{chunk-IU5DC4HP.js → chunk-E7T5SMDK.js} +44 -15
  76. package/dist/{chunk-HS7LT4PL.js → chunk-E7X54BVP.js} +1 -1
  77. package/dist/{chunk-DE7Q2LWF.js → chunk-EA5W2DWO.js} +2 -2
  78. package/dist/{chunk-4Q2HYZZK.js → chunk-EB4IWBBC.js} +58 -3
  79. package/dist/{chunk-B2ZZYISD.js → chunk-ECGNWHFE.js} +29 -6
  80. package/dist/{chunk-H4S3WY2N.js → chunk-EKANCN4D.js} +3 -3
  81. package/dist/{chunk-TI7JN55F.js → chunk-EKCGL4MV.js} +1 -1
  82. package/dist/{chunk-7SZ7QQJ3.js → chunk-ELA3IV4P.js} +2 -2
  83. package/dist/{chunk-SZGQU7EB.js → chunk-ER22SVLT.js} +1 -1
  84. package/dist/{chunk-I2UMQAOQ.js → chunk-EXXIFMUX.js} +1 -1
  85. package/dist/{chunk-UIIQA7DN.js → chunk-EZQJFCWA.js} +6 -3
  86. package/dist/{chunk-YJFIGFON.js → chunk-F64VFCVC.js} +2 -2
  87. package/dist/{chunk-UX4HQHMS.js → chunk-F7B2YDPM.js} +17 -13
  88. package/dist/{chunk-ETXOQXWT.js → chunk-FICKJQU2.js} +5 -5
  89. package/dist/{chunk-24M5C5EQ.js → chunk-FUPEHRNT.js} +2 -2
  90. package/dist/{chunk-VXX4S2PH.js → chunk-GA6QR6LN.js} +648 -166
  91. package/dist/{chunk-P27QDOID.js → chunk-GEUM7NDY.js} +2 -2
  92. package/dist/chunk-GIOLHGCC.js +181 -0
  93. package/dist/{chunk-RMO7KIFX.js → chunk-H2GJDFF6.js} +4 -4
  94. package/dist/{chunk-7GVHPY7W.js → chunk-H5KHQ6KS.js} +1 -1
  95. package/dist/{chunk-DYYAFCZH.js → chunk-H7DKHNBF.js} +1 -1
  96. package/dist/{chunk-DONVZZLV.js → chunk-HYO4DIYT.js} +1 -1
  97. package/dist/{chunk-O45HB74L.js → chunk-IB6FFEDH.js} +32 -28
  98. package/dist/{chunk-MI54IK7G.js → chunk-IEESWUIQ.js} +11 -2
  99. package/dist/{chunk-6MKM2RVL.js → chunk-IH2C53YV.js} +460 -1
  100. package/dist/{chunk-6MYO2IHD.js → chunk-IHXMN5YH.js} +7 -0
  101. package/dist/{chunk-YHJOTCTV.js → chunk-IJYIIHGK.js} +10 -5
  102. package/dist/{chunk-NFRKPLTJ.js → chunk-IR2GEREV.js} +1 -1
  103. package/dist/{chunk-PCH55NAO.js → chunk-JAAIW4JR.js} +1 -1
  104. package/dist/{chunk-WPC2FKNB.js → chunk-JRSBBFUU.js} +405 -175
  105. package/dist/{chunk-L2KUIV56.js → chunk-JSYLOPVJ.js} +1 -1
  106. package/dist/{chunk-DE3JRSGT.js → chunk-KCF6Q54R.js} +1 -1
  107. package/dist/{chunk-2AZMG6DR.js → chunk-KTLRJZFK.js} +7 -7
  108. package/dist/{chunk-XWK2RSD5.js → chunk-KWTTELUY.js} +2 -2
  109. package/dist/{chunk-UB44XZOI.js → chunk-KYUCSRZU.js} +1 -1
  110. package/dist/{chunk-MOR3H5FK.js → chunk-LKWWY6WN.js} +1 -1
  111. package/dist/{chunk-HT4FWRIT.js → chunk-LRXARA5O.js} +1 -1
  112. package/dist/chunk-MEGSQW2I.js +72 -0
  113. package/dist/{chunk-445BBSZS.js → chunk-MPU2CRFV.js} +4 -4
  114. package/dist/{chunk-IMNIW22F.js → chunk-N7M2SNAF.js} +2 -2
  115. package/dist/{chunk-MQGRMXFN.js → chunk-NCLBKHCX.js} +4 -4
  116. package/dist/{chunk-4Y5IDZOJ.js → chunk-NKAW4RVE.js} +4 -4
  117. package/dist/{chunk-CQ5VQNOD.js → chunk-NKUUNSII.js} +1 -1
  118. package/dist/{chunk-Z46RV43W.js → chunk-NRGNEP3R.js} +2 -2
  119. package/dist/{chunk-ZGWOCGSJ.js → chunk-O6E5HSVF.js} +2 -2
  120. package/dist/{chunk-RCTY7VNK.js → chunk-O7TIBLSJ.js} +15 -101
  121. package/dist/{chunk-M3BJEZ7E.js → chunk-OIO7YMBP.js} +44 -13
  122. package/dist/{chunk-QUUZ2BGC.js → chunk-ON3CGL3V.js} +1 -1
  123. package/dist/{chunk-LZTBL7SR.js → chunk-OSKSTJNQ.js} +12 -2
  124. package/dist/{chunk-22EEGJLH.js → chunk-OTWFSHYH.js} +85 -57
  125. package/dist/{chunk-NXDFCWF2.js → chunk-OWS4ZWEY.js} +1 -1
  126. package/dist/{chunk-4QFWV5GQ.js → chunk-P2ZMVHTF.js} +2 -1
  127. package/dist/{chunk-N36NHUGP.js → chunk-P4YIRU76.js} +1 -1
  128. package/dist/{chunk-7QM73IH2.js → chunk-PAA5FUUL.js} +4 -4
  129. package/dist/{chunk-6PXVXIC7.js → chunk-PLOVBMJF.js} +177 -69
  130. package/dist/{chunk-T6VQGCN3.js → chunk-PPLFDG7N.js} +9 -5
  131. package/dist/chunk-PXLGDX2S.js +104 -0
  132. package/dist/{chunk-LNZHSISH.js → chunk-Q3ESTCZH.js} +11 -11
  133. package/dist/{chunk-G55B5LP6.js → chunk-Q42L7V5T.js} +1 -1
  134. package/dist/{chunk-3LIMD4YP.js → chunk-QBN2W4T3.js} +6 -8
  135. package/dist/{chunk-ZXMZSU5Y.js → chunk-QGKRHG4Q.js} +15 -15
  136. package/dist/{chunk-LIPVGXPV.js → chunk-QKYGGUOQ.js} +4 -4
  137. package/dist/{chunk-JJLPGVTA.js → chunk-QONV77VI.js} +1 -1
  138. package/dist/{chunk-UFET7UTU.js → chunk-RBBWUYMG.js} +4 -4
  139. package/dist/{chunk-4FWR7OE3.js → chunk-RXSPJW77.js} +4 -4
  140. package/dist/{chunk-X3IULMVV.js → chunk-RZJ7BHXB.js} +1 -1
  141. package/dist/{chunk-7RHN6N5F.js → chunk-SDFGDNWV.js} +1 -1
  142. package/dist/{chunk-R64WJS45.js → chunk-SOMX57XG.js} +6 -6
  143. package/dist/{chunk-42JBYXIQ.js → chunk-SUG2AA33.js} +42 -26
  144. package/dist/{chunk-IZQDQ5AN.js → chunk-SULPT5X6.js} +53 -17
  145. package/dist/{chunk-VOJ3ICMF.js → chunk-SVIA7POL.js} +1 -1
  146. package/dist/chunk-SWAG64KW.js +367 -0
  147. package/dist/{chunk-DC7AOIHN.js → chunk-T5S7U5C6.js} +1 -1
  148. package/dist/{chunk-L56WTLQP.js → chunk-TM7D3NOR.js} +34 -15
  149. package/dist/{chunk-KCPIENND.js → chunk-TMV76KPG.js} +1 -1
  150. package/dist/{chunk-H4LCNEA2.js → chunk-TRAPS5WB.js} +195 -128
  151. package/dist/{chunk-M4E7CMYS.js → chunk-TW4DB2NK.js} +2 -2
  152. package/dist/{chunk-XHUFLQGD.js → chunk-UZJ7Y7WU.js} +3 -3
  153. package/dist/{chunk-M425BL2U.js → chunk-VCKUDUPN.js} +1 -1
  154. package/dist/{chunk-M6TIOPL5.js → chunk-VT2K6I4A.js} +3 -3
  155. package/dist/{chunk-QP7MQ43Y.js → chunk-WAAXVZIT.js} +3 -3
  156. package/dist/{chunk-4XETQ5LC.js → chunk-WPD7JH6F.js} +2 -2
  157. package/dist/{chunk-HLXZFHEY.js → chunk-WPSPW7SI.js} +6 -6
  158. package/dist/{chunk-RULKJFRT.js → chunk-X6TDH2OM.js} +1 -1
  159. package/dist/chunk-XGEJPKRY.js +5069 -0
  160. package/dist/{chunk-APT2TSYC.js → chunk-Y6UCMYJZ.js} +1 -1
  161. package/dist/{chunk-7PBJR7WI.js → chunk-YBLBI3O2.js} +1 -1
  162. package/dist/{chunk-WSZJS4QC.js → chunk-YNF3SH26.js} +61 -10
  163. package/dist/{chunk-YRXIEP35.js → chunk-YU5LSWA2.js} +90 -11
  164. package/dist/{chunk-RIHRYTNB.js → chunk-YUDWGRNZ.js} +15 -15
  165. package/dist/{chunk-MR7VKWYT.js → chunk-YVCPUVHV.js} +1 -1
  166. package/dist/{clean-Y6YIQRPM.js → clean-JK4VQMTH.js} +35 -34
  167. package/dist/cli.js +67 -66
  168. package/dist/{cloud-A5U7YYNA.js → cloud-JZ2WKHQG.js} +4 -4
  169. package/dist/{cloud-5C5SCK4H.js → cloud-LU4FVT33.js} +7 -6
  170. package/dist/{cloudrun-EULFHQQL.js → cloudrun-QBXSGBGX.js} +9 -9
  171. package/dist/{compare-6XCTMUF3.js → compare-YE5BTDCG.js} +50 -48
  172. package/dist/{compiler-DUG4GFRI.js → compiler-QEA5UQRG.js} +9 -9
  173. package/dist/{component-JDQIZSAL.js → component-MGT5ZJ4M.js} +3 -3
  174. package/dist/{compositions-HZDEOSRL.js → compositions-7OF6FDCH.js} +30 -23
  175. package/dist/{contactSheet-O3FOOHOX.js → contactSheet-CCHQAZLA.js} +4 -4
  176. package/dist/{curve-SE7ZAMI6.js → curve-JQLVUDXR.js} +20 -19
  177. package/dist/{cuts-AEFJGBFP.js → cuts-MCJP6LMJ.js} +21 -20
  178. package/dist/{delete-EQUQ7Z2K.js → delete-PUYEW3RJ.js} +11 -8
  179. package/dist/{deploy-NSLC6BYZ.js → deploy-M4XGMJM5.js} +2 -2
  180. package/dist/{describeProject-FTJBPDL3.js → describeProject-P7CBZ6NW.js} +17 -17
  181. package/dist/{destroy-4O4T3KL3.js → destroy-6XJWSH2A.js} +2 -2
  182. package/dist/{deterministicFonts-QY4KNTOU.js → deterministicFonts-OXGNMVJE.js} +5 -5
  183. package/dist/{diff-VJ3CS7YE.js → diff-BATSO64W.js} +46 -44
  184. package/dist/{dist-2YJCNIWI.js → dist-G6W7GKGP.js} +6 -6
  185. package/dist/{dist-MNFB4YKV.js → dist-PC3EMMET.js} +21 -21
  186. package/dist/{dist-MXWEGMRB.js → dist-T62DJJZX.js} +6 -6
  187. package/dist/{doctor-RR7SNO6X.js → doctor-ONTGSPYF.js} +28 -23
  188. package/dist/{dotEnv-33RDHX7P.js → dotEnv-RZ52L7X3.js} +5 -4
  189. package/dist/{energy-PN23W2UJ.js → energy-FNZICGW2.js} +21 -20
  190. package/dist/{events-5OLO73VJ.js → events-6TNBAVVY.js} +23 -22
  191. package/dist/{events-NR6UPBHG.js → events-ENJZNXWG.js} +5 -5
  192. package/dist/{events-4ECJEB2W.js → events-LBHSU7C2.js} +12 -12
  193. package/dist/{execute-TS3BP65F.js → execute-RXTEBACV.js} +42 -42
  194. package/dist/{extract-GCZ5HSEN.js → extract-F2CWTMLX.js} +21 -20
  195. package/dist/{face-QKMYBRV3.js → face-7HL4CP32.js} +22 -21
  196. package/dist/{feedback-3H43EK7N.js → feedback-4NDDMECH.js} +46 -33
  197. package/dist/{ffmpeg-JRNM74WY.js → ffmpeg-3LL345SO.js} +18 -18
  198. package/dist/{figma-JGP2UGGU.js → figma-474E54NB.js} +3 -3
  199. package/dist/fontLocalizeCli.js +24 -25
  200. package/dist/{frames-OYSWKB3F.js → frames-EZWGM7QQ.js} +23 -22
  201. package/dist/{generate-TDXLUFMR.js → generate-I75DZWDU.js} +36 -34
  202. package/dist/{get-UB2MNBYO.js → get-BHU6CBWO.js} +11 -8
  203. package/dist/{gpuPolicy-6CTTH3NY.js → gpuPolicy-6J2STCV2.js} +15 -15
  204. package/dist/{grade-compare-2DXT4RWV.js → grade-compare-D4TBMCBG.js} +49 -47
  205. package/dist/{gsapParser-L7TM3RGH.js → gsapParser-TSPNHW7F.js} +1 -1
  206. package/dist/hangReport.js +2 -1
  207. package/dist/{heifImagePrep-VDZVZ4G7.js → heifImagePrep-VLYGRKSS.js} +20 -21
  208. package/dist/{help-RGKY4DR4.js → help-2CUXKYJ6.js} +1 -1
  209. package/dist/{history-AVDXYNAP.js → history-LVAVYTAN.js} +19 -18
  210. package/dist/hyperframe.manifest.json +1 -1
  211. package/dist/hyperframe.runtime.iife.js +67 -67
  212. package/dist/hyperframes-player.global.js +3 -3
  213. package/dist/{info-NGTQABZC.js → info-SUZOEH6L.js} +29 -23
  214. package/dist/{init-C3EARHDW.js → init-XI5QN3A6.js} +46 -44
  215. package/dist/{ink-ISO3VXRQ.js → ink-OVDZOCQJ.js} +21 -20
  216. package/dist/{inspect-V6MPU5I5.js → inspect-INBCGPBD.js} +50 -47
  217. package/dist/{installer-FI6HT2FW.js → installer-JNQKFCTN.js} +10 -10
  218. package/dist/{keyframes-PTJDE47Y.js → keyframes-LYZJK4RH.js} +21 -17
  219. package/dist/{lambda-JTO5YD2I.js → lambda-DUDXZV6X.js} +21 -21
  220. package/dist/{layout-QMLEZP5T.js → layout-JKUJW6A4.js} +50 -47
  221. package/dist/{lint-6BWOQAW6.js → lint-NKDC7IJ2.js} +25 -19
  222. package/dist/{lintProject-G4MXY4YA.js → lintProject-5Z34NNS4.js} +6 -6
  223. package/dist/{list-7E4VD7JA.js → list-5HUMDJYL.js} +11 -8
  224. package/dist/{localPage-BQOYZAOW.js → localPage-RRBRFR4Y.js} +16 -16
  225. package/dist/{login-37MSZXCY.js → login-C3SHKITR.js} +6 -5
  226. package/dist/{logout-QGNBUJKS.js → logout-CCATTNTL.js} +2 -1
  227. package/dist/{look-5GXW3NVP.js → look-3TX2U4BE.js} +21 -20
  228. package/dist/{manager-TMKN4DX5.js → manager-45VB2G5F.js} +4 -4
  229. package/dist/{manager-J2IRAOR7.js → manager-MOR255LW.js} +16 -16
  230. package/dist/{measure-23IL23BL.js → measure-ZAKBHNGY.js} +11 -11
  231. package/dist/{media-treatment-7ODBREPX.js → media-treatment-QJ35DSED.js} +25 -24
  232. package/dist/{media-use-QJA6NB3V.js → media-use-YBKHJVXL.js} +12 -18
  233. package/dist/{models-2Z6SURXU.js → models-OQHKG7B4.js} +20 -20
  234. package/dist/{motionShot-CYS3L6FK.js → motionShot-TWQTREFH.js} +26 -26
  235. package/dist/{normalize-audio-6YVF4LED.js → normalize-audio-PXHPUOMD.js} +19 -19
  236. package/dist/{open-WQ6NRHCN.js → open-TVGO5KVF.js} +34 -27
  237. package/dist/{parakeetRunner-R7KK6ZHD.js → parakeetRunner-MVJMZSIG.js} +23 -23
  238. package/dist/{pipeline-HRCK2JQL.js → pipeline-4S5UE4O4.js} +18 -18
  239. package/dist/{plan-FQNKACYR.js → plan-AMBZUX55.js} +30 -30
  240. package/dist/{play-UJZBNX2O.js → play-KEAESNBM.js} +43 -39
  241. package/dist/{preflight-VIMLSE3I.js → preflight-K3CM3W55.js} +18 -18
  242. package/dist/{present-JIOVM3ZH.js → present-42WDBGBA.js} +35 -32
  243. package/dist/{preview-HCYGBEWR.js → preview-KSHBU7ZR.js} +43 -34
  244. package/dist/{probe-6YQA2ZZC.js → probe-TMSXGCL4.js} +21 -20
  245. package/dist/{producer-JIM74BGL.js → producer-KXRSJPJF.js} +1 -1
  246. package/dist/{projectConfig-VPL64JBD.js → projectConfig-LOHNVOJG.js} +13 -13
  247. package/dist/{publicNetwork-F3ZXSVOD.js → publicNetwork-GW7SVP7N.js} +1 -1
  248. package/dist/{publication-ST3VFFWM.js → publication-LYPU7NTZ.js} +8 -8
  249. package/dist/{publish-3TTCO4R4.js → publish-PYZXDQJW.js} +51 -38
  250. package/dist/{refresh-6ONVQ3WV.js → refresh-X5ZLKQO5.js} +2 -1
  251. package/dist/{remove-background-XTICO22L.js → remove-background-HVX52VOF.js} +19 -19
  252. package/dist/{render-PFBZJRAN.js → render-57ZYQ53S.js} +73 -62
  253. package/dist/{render-WYDOZEZ5.js → render-5KMA5P2U.js} +90 -57
  254. package/dist/{render-MG5MX45D.js → render-CM4MCNVA.js} +9 -9
  255. package/dist/{render-batch-C3XGAQGX.js → render-batch-URBBGOVC.js} +9 -9
  256. package/dist/renderSetupWorker.js +10 -10
  257. package/dist/{resolver-AGMKICJW.js → resolver-UPUCU4XT.js} +10 -10
  258. package/dist/{reverse-TV524NFW.js → reverse-UYS7KVE2.js} +1 -1
  259. package/dist/{run-NQBD5RDR.js → run-4LNEWQLG.js} +10 -6
  260. package/dist/{screenshotCapture-OUZMH7EQ.js → screenshotCapture-IF5AO5XM.js} +18 -18
  261. package/dist/{service-UIHDIMFM.js → service-OEOC34BD.js} +22 -21
  262. package/dist/{share-WD7MCA4I.js → share-NS7CMVSU.js} +25 -24
  263. package/dist/{sherpa-H67ZJICN.js → sherpa-QBTXL6JA.js} +22 -22
  264. package/dist/sherpaWorker.js +3 -3
  265. package/dist/skills/hyperframes-cli/references/cloud.md +1 -1
  266. package/dist/skills/media-use/audio/references/requirements.md +7 -7
  267. package/dist/skills/media-use/audio/references/tts.md +8 -6
  268. package/dist/skills/media-use/audio/scripts/lib/heygen.mjs +39 -13
  269. package/dist/skills/media-use/audio/scripts/lib/heygen.test.mjs +176 -2
  270. package/dist/skills/media-use/references/heygen.md +1 -1
  271. package/dist/{skills-7TUSQF6W.js → skills-S5U2MQAI.js} +16 -15
  272. package/dist/{skillsUpdateCheck-HF6SQWRA.js → skillsUpdateCheck-UZ7CZ6VC.js} +5 -3
  273. package/dist/{snapshot-P7ZSTKED.js → snapshot-YWFWQTAV.js} +118 -75
  274. package/dist/{src-H2EUJUV3.js → src-N2SMYJ44.js} +22 -23
  275. package/dist/{src-TQQ743H4.js → src-UQ3K3UW2.js} +31 -17
  276. package/dist/{start-7ZTAKHD4.js → start-4IA5GG5D.js} +34 -32
  277. package/dist/{staticProjectServer-X4PARIVN.js → staticProjectServer-5JP25RRX.js} +34 -33
  278. package/dist/{status-ELQXIXIB.js → status-ITCKXFBF.js} +25 -24
  279. package/dist/studio/assets/{hyperframes-player-D7LhzIg1.js → hyperframes-player-Oju91F6x.js} +2 -2
  280. package/dist/studio/assets/{index-D3WxJaqm.js → index-B0VEzzD2.js} +180 -180
  281. package/dist/studio/assets/index-Dv67Vrl6.js +74 -0
  282. package/dist/studio/assets/{index-CQ7o0CBU.js → index-XEm_N45R.js} +1 -1
  283. package/dist/studio/assets/{pausedVideoDecoder-BVUmBgn0.js → pausedVideoDecoder-p6zibxVM.js} +1 -1
  284. package/dist/studio/index.html +1 -1
  285. package/dist/{studio-api-OJEU24EG.js → studio-api-GENM2XVL.js} +21 -21
  286. package/dist/{studioServer-E5CLZC46.js → studioServer-SWR5Q3PD.js} +90 -77
  287. package/dist/{sync-VEJWMKDP.js → sync-CK6TTCXO.js} +21 -20
  288. package/dist/{synthesize-HOLHQCR2.js → synthesize-EXNEBJSY.js} +5 -5
  289. package/dist/{system-I5KGZTUG.js → system-JBPJHNTG.js} +3 -3
  290. package/dist/{telemetry-3U4UGQ5V.js → telemetry-T4HQ6AKZ.js} +12 -12
  291. package/dist/{templates-AUAOWIYA.js → templates-7O7NOIUC.js} +23 -22
  292. package/dist/{timeline-YO27AP66.js → timeline-P2PLN53O.js} +33 -32
  293. package/dist/{tokens-UXLQGLVG.js → tokens-SPQN27VG.js} +2 -2
  294. package/dist/{transcribe-FZ3TE4FK.js → transcribe-SCZG6IM4.js} +19 -19
  295. package/dist/{transcribe-I7MTUH4M.js → transcribe-YJQ3DDDI.js} +40 -39
  296. package/dist/{tts-3VHEX4RB.js → tts-5OAB5XX6.js} +1 -1
  297. package/dist/{update-KBKSO3SH.js → update-JYPZW35A.js} +18 -17
  298. package/dist/{updateCheck-MUYN55HR.js → updateCheck-5M2JJTH3.js} +4 -2
  299. package/dist/{upgrade-CRCX7CCK.js → upgrade-BP62FM6V.js} +7 -5
  300. package/dist/{urlDownloader-4EM6GLN4.js → urlDownloader-WOZQCE6P.js} +14 -14
  301. package/dist/{validate-Y2KF2DU3.js → validate-NEC5QLH7.js} +40 -39
  302. package/dist/{video-HG6SINBD.js → video-XEEBISSO.js} +17 -17
  303. package/dist/{voices-O4UHHFZS.js → voices-GCHA27JA.js} +34 -32
  304. package/dist/warmCheck.js +59 -57
  305. package/dist/warmCheckClient.js +2 -1
  306. package/package.json +1 -1
  307. package/dist/chunk-DQZRNGDS.js +0 -5069
  308. package/dist/chunk-IGLEPPTN.js +0 -24
  309. package/dist/chunk-L2U4ISSS.js +0 -93
  310. package/dist/studio/assets/index-BX3KHhGX.js +0 -71
@@ -5,12 +5,15 @@ var require = __hf_createRequire(import.meta.url);
5
5
  var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
  import {
8
+ NonPublicHostError,
9
+ assertPublicHostname,
8
10
  browserProxyArgs,
9
11
  createPublicOnlyProfile,
10
12
  isBlockedNetworkHost,
11
13
  logRefusal,
14
+ resolvePublicAddress,
12
15
  startCaptureProxy
13
- } from "./chunk-LZTBL7SR.js";
16
+ } from "./chunk-OSKSTJNQ.js";
14
17
  import {
15
18
  removeTreeBestEffort,
16
19
  removeTreeBestEffortAsync
@@ -30,7 +33,7 @@ import {
30
33
  removeScratch,
31
34
  renameWithRetry,
32
35
  renameWithRetryAsync
33
- } from "./chunk-DE3JRSGT.js";
36
+ } from "./chunk-KCF6Q54R.js";
34
37
  import {
35
38
  DISTRIBUTED_FPS,
36
39
  HF_COLOR_GROUP_ATTR,
@@ -60,7 +63,7 @@ import {
60
63
  resolveAuthoredTimingWindow,
61
64
  toFps,
62
65
  validateVariables
63
- } from "./chunk-U7ZCBWNM.js";
66
+ } from "./chunk-4IUOWNDS.js";
64
67
  import {
65
68
  AUDIO_GROUP_RENDER_ID_ATTR,
66
69
  AUTHORED_SOURCE_BEGIN,
@@ -104,11 +107,12 @@ import {
104
107
  sourceTimeAt,
105
108
  timeAtSourceTime,
106
109
  volumeSegmentSampleCount
107
- } from "./chunk-DQZRNGDS.js";
110
+ } from "./chunk-XGEJPKRY.js";
108
111
  import {
109
112
  isPrivateFileUnder,
110
- isVcsOrSecretPath
111
- } from "./chunk-XWK2RSD5.js";
113
+ isSafePath,
114
+ isStudioPrivatePath
115
+ } from "./chunk-KWTTELUY.js";
112
116
  import {
113
117
  browserPathFromEnv,
114
118
  buildChromeLaunchEnv,
@@ -120,11 +124,11 @@ import {
120
124
  } from "./chunk-LEIR7IDJ.js";
121
125
  import {
122
126
  resolveReferencedStart
123
- } from "./chunk-H4LCNEA2.js";
127
+ } from "./chunk-TRAPS5WB.js";
124
128
  import {
125
129
  isWithinProjectRoot,
126
130
  resolveProjectRelativeSrc
127
- } from "./chunk-MP4TEYUJ.js";
131
+ } from "./chunk-6EMFSRTW.js";
128
132
  import {
129
133
  LOW_MEMORY_TOTAL_MB_THRESHOLD,
130
134
  getAvailableMemoryMb,
@@ -133,19 +137,13 @@ import {
133
137
  hostCpuCount,
134
138
  isLowMemorySystem,
135
139
  usableCpuCount
136
- } from "./chunk-U3LWQGCD.js";
137
- import {
138
- FFMPEG_PATH_ENV,
139
- FFPROBE_PATH_ENV,
140
- findFfBinary,
141
- findTrustedExecutable
142
- } from "./chunk-IU5DC4HP.js";
140
+ } from "./chunk-CIYNUD7Q.js";
143
141
  import {
144
142
  isPathInside
145
- } from "./chunk-6MKM2RVL.js";
143
+ } from "./chunk-IH2C53YV.js";
146
144
  import {
147
145
  readCompositionVariables
148
- } from "./chunk-M425BL2U.js";
146
+ } from "./chunk-VCKUDUPN.js";
149
147
  import {
150
148
  parseHTML
151
149
  } from "./chunk-GWTIFRF5.js";
@@ -162,6 +160,12 @@ import {
162
160
  describeWslGpuAccess,
163
161
  detectWsl
164
162
  } from "./chunk-7KDQAD2W.js";
163
+ import {
164
+ FFMPEG_PATH_ENV,
165
+ FFPROBE_PATH_ENV,
166
+ findFfBinary,
167
+ findTrustedExecutable
168
+ } from "./chunk-E7T5SMDK.js";
165
169
 
166
170
  // ../engine/src/services/referenceBackground.ts
167
171
  var REFERENCE_BACKGROUND_FIELD = "reference_background";
@@ -613,8 +617,21 @@ function resolvePageNavigationTimeout() {
613
617
  const parsed = raw === void 0 || raw === "" ? NaN : Number(raw);
614
618
  return Number.isFinite(parsed) ? parsed : DEFAULT_CONFIG.pageNavigationTimeout;
615
619
  }
620
+ var RESTRICT_PAGE_NETWORK_ON = /* @__PURE__ */ new Set(["true", "1", "yes", "on"]);
621
+ var RESTRICT_PAGE_NETWORK_OFF = /* @__PURE__ */ new Set(["false", "0", "no", "off"]);
622
+ var warnedRestrictPageNetworkValue;
616
623
  function resolveRestrictPageNetwork() {
617
- return process.env.PRODUCER_RESTRICT_PAGE_NETWORK === "true";
624
+ const raw = process.env.PRODUCER_RESTRICT_PAGE_NETWORK ?? "";
625
+ const value = raw.trim().toLowerCase();
626
+ if (value === "" || RESTRICT_PAGE_NETWORK_OFF.has(value)) return false;
627
+ if (RESTRICT_PAGE_NETWORK_ON.has(value)) return true;
628
+ if (warnedRestrictPageNetworkValue !== raw) {
629
+ warnedRestrictPageNetworkValue = raw;
630
+ console.warn(
631
+ `[hyperframes] PRODUCER_RESTRICT_PAGE_NETWORK=${JSON.stringify(raw)} is neither true nor false; the render network stays restricted.`
632
+ );
633
+ }
634
+ return true;
618
635
  }
619
636
  function resolveConfig(overrides) {
620
637
  const env = (key) => process.env[key];
@@ -5486,6 +5503,10 @@ var CA_BUNDLES = [
5486
5503
  "/etc/ssl/cert.pem"
5487
5504
  ];
5488
5505
  var RECONNECT_ARGS = ["-rw_timeout", "30000000", "-reconnect", "1", "-reconnect_delay_max", "2"];
5506
+ var SELF_CONTAINED_FORMATS = "mov,matroska,mxf,avi,mpeg,mpegts,mpegvideo,flv,asf,ogg,wav,mp3,aac,flac,aiff,gif,image2,png_pipe,jpeg_pipe,webp_pipe,bmp_pipe,tiff_pipe";
5507
+ function selfContainedFormatArgs() {
5508
+ return resolveRestrictPageNetwork() ? ["-format_whitelist", SELF_CONTAINED_FORMATS] : [];
5509
+ }
5489
5510
  function urlInputArgs(input, {
5490
5511
  tool = "ffmpeg",
5491
5512
  caBundles = CA_BUNDLES
@@ -5498,7 +5519,7 @@ function urlInputArgs(input, {
5498
5519
  );
5499
5520
  }
5500
5521
  const networkRetry = tool === "ffmpeg" ? ["-reconnect_on_network_error", "1"] : [];
5501
- const nestedOpensStayOnHttps = resolveRestrictPageNetwork() ? ["-protocol_whitelist", "https,tls,tcp"] : [];
5522
+ const renderServiceLimits = resolveRestrictPageNetwork() ? ["-protocol_whitelist", "https,tls,tcp", ...selfContainedFormatArgs()] : [];
5502
5523
  return [
5503
5524
  "-tls_verify",
5504
5525
  "1",
@@ -5506,7 +5527,7 @@ function urlInputArgs(input, {
5506
5527
  caFile,
5507
5528
  ...RECONNECT_ARGS,
5508
5529
  ...networkRetry,
5509
- ...nestedOpensStayOnHttps
5530
+ ...renderServiceLimits
5510
5531
  ];
5511
5532
  }
5512
5533
  function redactUrlQueriesInError(error) {
@@ -12398,7 +12419,7 @@ function isMemberGroupHidden(groupsById, el) {
12398
12419
  }
12399
12420
 
12400
12421
  // ../engine/src/services/videoFrameExtractor.ts
12401
- import { copyFileSync as copyFileSync2, existsSync as existsSync10, linkSync as linkSync2, mkdirSync as mkdirSync6, rmSync as rmSync5 } from "fs";
12422
+ import { copyFileSync as copyFileSync2, existsSync as existsSync11, linkSync as linkSync2, mkdirSync as mkdirSync6, rmSync as rmSync5 } from "fs";
12402
12423
  import { basename as basename2, isAbsolute as isAbsolute2, join as join13, normalize, relative as relative2, win32 } from "path";
12403
12424
 
12404
12425
  // ../engine/src/utils/concurrencyLimit.ts
@@ -12431,6 +12452,13 @@ function createConcurrencyLimit(limit) {
12431
12452
  };
12432
12453
  }
12433
12454
 
12455
+ // ../engine/src/utils/assetRoots.ts
12456
+ import { existsSync as existsSync8 } from "fs";
12457
+ function isInsideAssetRoots(path, roots) {
12458
+ if (roots.some((root) => isSafePath(root, path))) return true;
12459
+ return !existsSync8(path) && roots.some((root) => isWithinProjectRoot(root, path));
12460
+ }
12461
+
12434
12462
  // ../engine/src/services/mediaTimelineWindow.ts
12435
12463
  function isKnownInactiveTimelineWindow(element, resolvedStart) {
12436
12464
  const duration = parseStrictFiniteTimingNumber(element.getAttribute("data-duration"));
@@ -12492,31 +12520,9 @@ function inputAlphaOpaqueWarning(src) {
12492
12520
  `;
12493
12521
  }
12494
12522
 
12495
- // ../engine/src/utils/urlDownloader.ts
12496
- import {
12497
- closeSync as closeSync2,
12498
- createReadStream as createReadStream2,
12499
- createWriteStream,
12500
- existsSync as existsSync8,
12501
- fsyncSync,
12502
- linkSync,
12503
- mkdirSync as mkdirSync4,
12504
- lstatSync,
12505
- openSync as openSync2,
12506
- readdirSync as readdirSync4,
12507
- rmdirSync,
12508
- rmSync as rmSync3,
12509
- statSync as statSync5,
12510
- unlinkSync
12511
- } from "fs";
12512
- import { createHash as createHash2, randomUUID as randomUUID2 } from "crypto";
12513
- import dns from "dns";
12514
- import { dirname as dirname6, extname as extname2, join as join11 } from "path";
12515
- import { Readable, Transform } from "stream";
12516
- import { pipeline } from "stream/promises";
12517
-
12518
12523
  // ../engine/src/utils/notMediaPayload.ts
12519
12524
  import { createHash } from "crypto";
12525
+ import { constants } from "fs";
12520
12526
  import { open as openFile } from "fs/promises";
12521
12527
  import { dirname as dirname5, isAbsolute, relative, resolve as resolve2 } from "path";
12522
12528
  var NOT_MEDIA_PAYLOAD = "NOT_MEDIA_PAYLOAD";
@@ -12558,23 +12564,80 @@ function byteOrderMarkLength(head) {
12558
12564
  }
12559
12565
  return 0;
12560
12566
  }
12561
- async function readHead(filePath, bytes = SNIFF_BYTES) {
12562
- const fh = await openFile(filePath, "r");
12567
+ async function readAt(fh, bytes, position) {
12568
+ const buf = Buffer.alloc(bytes);
12569
+ let filled = 0;
12570
+ while (filled < buf.length) {
12571
+ const { bytesRead } = await fh.read(buf, filled, buf.length - filled, position + filled);
12572
+ if (bytesRead === 0) break;
12573
+ filled += bytesRead;
12574
+ }
12575
+ return buf.subarray(0, filled);
12576
+ }
12577
+ var OPEN_WITHOUT_WAITING = constants.O_RDONLY | (constants.O_NONBLOCK ?? 0);
12578
+ async function openRegular(path) {
12579
+ const fh = await openFile(path, OPEN_WITHOUT_WAITING);
12580
+ try {
12581
+ const stats = await fh.stat();
12582
+ if (stats.isFile() || stats.isDirectory()) return fh;
12583
+ } catch (error) {
12584
+ await fh.close().catch(() => {
12585
+ });
12586
+ throw error;
12587
+ }
12588
+ await fh.close().catch(() => {
12589
+ });
12590
+ return null;
12591
+ }
12592
+ async function readHead(filePath) {
12593
+ const fh = await openRegular(filePath);
12594
+ if (!fh) return null;
12563
12595
  try {
12564
- const buf = Buffer.alloc(bytes);
12565
- let filled = 0;
12566
- while (filled < buf.length) {
12567
- const { bytesRead } = await fh.read(buf, filled, buf.length - filled, filled);
12568
- if (bytesRead === 0) break;
12569
- filled += bytesRead;
12570
- }
12571
- return buf.subarray(0, filled);
12596
+ const { size } = await fh.stat();
12597
+ return { head: await readAt(fh, SNIFF_BYTES, 0), fileSize: size };
12572
12598
  } finally {
12573
12599
  await fh.close().catch(() => {
12574
12600
  });
12575
12601
  }
12576
12602
  }
12577
- function startsWithDocumentByte(head) {
12603
+ var FIRST_BOX_TYPES = /* @__PURE__ */ new Set([
12604
+ "ftyp",
12605
+ "styp",
12606
+ "free",
12607
+ "skip",
12608
+ "wide",
12609
+ "uuid",
12610
+ "pdin",
12611
+ "moov",
12612
+ "mdat",
12613
+ "moof"
12614
+ ]);
12615
+ var BOX_TYPE = /^[\x21-\x7e\xa9][\x21-\x7e]{3}$/;
12616
+ function boxLength(head, offset) {
12617
+ const size = head.readUInt32BE(offset);
12618
+ if (size !== 1) return size >= 8 ? size : -1;
12619
+ if (offset + 16 > head.length) return -1;
12620
+ const largeSize = Number(head.readBigUInt64BE(offset + 8));
12621
+ return largeSize >= 16 ? largeSize : -1;
12622
+ }
12623
+ function boxEnd(head, offset, fileSize) {
12624
+ if (offset + 8 > head.length || !BOX_TYPE.test(head.toString("latin1", offset + 4, offset + 8))) {
12625
+ return -1;
12626
+ }
12627
+ if (head.readUInt32BE(offset) === 0) return fileSize;
12628
+ const length = boxLength(head, offset);
12629
+ return length >= 0 && offset + length <= fileSize ? offset + length : -1;
12630
+ }
12631
+ function opensWithMediaBox(head, fileSize) {
12632
+ if (!FIRST_BOX_TYPES.has(head.toString("latin1", 4, 8))) return false;
12633
+ let offset = boxEnd(head, 0, fileSize);
12634
+ while (offset >= 0 && offset < fileSize && offset + 16 <= head.length) {
12635
+ offset = boxEnd(head, offset, fileSize);
12636
+ }
12637
+ return offset >= 0;
12638
+ }
12639
+ function startsWithDocumentByte(head, fileSize) {
12640
+ if (opensWithMediaBox(head, fileSize)) return false;
12578
12641
  for (let index = byteOrderMarkLength(head); index < head.length; index++) {
12579
12642
  const byte = head[index];
12580
12643
  if (byte === void 0) break;
@@ -12585,7 +12648,8 @@ function startsWithDocumentByte(head) {
12585
12648
  }
12586
12649
  async function isNotMediaPayload(filePath) {
12587
12650
  try {
12588
- return startsWithDocumentByte(await readHead(filePath)) || await playlistLeavesItsFolder(filePath);
12651
+ const sniffed = await readHead(filePath);
12652
+ return !sniffed || startsWithDocumentByte(sniffed.head, sniffed.fileSize) || await playlistLeavesItsFolder(filePath);
12589
12653
  } catch {
12590
12654
  return false;
12591
12655
  }
@@ -12600,15 +12664,53 @@ var MAX_PLAYLIST_DEPTH = 8;
12600
12664
  var HTTP_URL = /^https?:\/\//i;
12601
12665
  var OTHER_SCHEME = /^[a-z][a-z0-9+.-]+:/i;
12602
12666
  var DRIVE_PATH = /^[a-z]:[\\/]/i;
12667
+ var MAX_HLS_LINE_BYTES = 4095;
12668
+ var ATTRIBUTE_GAP = /[\t\n\v\f\r ,]/;
12669
+ function hlsEntries(body) {
12670
+ const names = /* @__PURE__ */ new Set();
12671
+ for (const raw of body.replaceAll("\0", "\n").split(/[\r\n]/)) {
12672
+ for (const whole of /* @__PURE__ */ new Set([raw, raw.slice(0, MAX_HLS_LINE_BYTES)])) {
12673
+ const line = whole.replace(/[\t\v\f ]+$/, "");
12674
+ const found = line.startsWith("#") ? attributeUris(line) : [line, line.trim()];
12675
+ for (const name of found) if (name) names.add(name);
12676
+ }
12677
+ }
12678
+ return [...names];
12679
+ }
12680
+ function attributeUris(line) {
12681
+ const uris = [];
12682
+ let at = line.indexOf(":") + 1;
12683
+ while (at > 0 && at < line.length) {
12684
+ while (at < line.length && ATTRIBUTE_GAP.test(line[at])) at++;
12685
+ const equals = line.indexOf("=", at);
12686
+ if (equals < 0) break;
12687
+ const [value, next] = attributeValue(line, equals + 1);
12688
+ if (line.slice(at, equals).toUpperCase() === "URI") uris.push(value);
12689
+ at = next;
12690
+ }
12691
+ return uris;
12692
+ }
12693
+ function attributeValue(line, at) {
12694
+ if (line[at] !== '"') {
12695
+ let end = at;
12696
+ while (end < line.length && !ATTRIBUTE_GAP.test(line[end])) end++;
12697
+ return [line.slice(at, end), end];
12698
+ }
12699
+ let value = "";
12700
+ let index = at + 1;
12701
+ for (; index < line.length && line[index] !== '"'; index++) {
12702
+ if (line[index] === "\\") {
12703
+ if (index + 1 >= line.length) break;
12704
+ index++;
12705
+ }
12706
+ value += line[index];
12707
+ }
12708
+ return [value, line[index] === '"' ? index + 1 : index];
12709
+ }
12710
+ var UTF8_BOM = "\xEF\xBB\xBF";
12603
12711
  function playlistEntries(text) {
12604
- const body = text.replace(/^\uFEFF/, "").trimStart();
12605
- if (body.startsWith("#EXTM3U")) {
12606
- return body.split(/\r?\n/).flatMap((raw) => {
12607
- const line = raw.trim();
12608
- const uris = [...line.matchAll(/URI="([^"]*)"/gi)].map((match) => match[1]);
12609
- return line && !line.startsWith("#") ? [line, ...uris] : uris;
12610
- });
12611
- }
12712
+ const body = (text.startsWith(UTF8_BOM) ? text.slice(UTF8_BOM.length) : text).trimStart();
12713
+ if (body.startsWith("#EXTM3U")) return hlsEntries(body);
12612
12714
  if (/^ffconcat\s+version/i.test(body)) {
12613
12715
  return body.split(/\r?\n/).flatMap((raw) => {
12614
12716
  const match = /^\s*file\s+(.*)$/.exec(raw);
@@ -12622,54 +12724,116 @@ function playlistEntries(text) {
12622
12724
  function entryLeavesFolder(entry, base, folder) {
12623
12725
  if (HTTP_URL.test(entry)) return false;
12624
12726
  if (OTHER_SCHEME.test(entry) && !DRIVE_PATH.test(entry)) return true;
12625
- return [entry, safeDecode(entry)].some((path) => {
12727
+ return [entry, percentDecoded(entry)].some((path) => {
12626
12728
  if (isAbsolute(path) || DRIVE_PATH.test(path) || path.startsWith("\\")) return true;
12627
12729
  const inside = relative(folder, resolve2(base, path));
12628
12730
  return inside === ".." || inside.startsWith("../") || inside.startsWith("..\\") || isAbsolute(inside);
12629
12731
  });
12630
12732
  }
12631
- function safeDecode(value) {
12733
+ function percentDecoded(value) {
12734
+ return value.replace(
12735
+ /%([0-9a-f]{2})/gi,
12736
+ (_escape, hex) => String.fromCharCode(Number.parseInt(hex, 16))
12737
+ );
12738
+ }
12739
+ var asBytes = (path) => Buffer.from(path).toString("latin1");
12740
+ async function playlistLeavesItsFolder(filePath, placedAt = filePath) {
12741
+ const placed = asBytes(resolve2(placedAt));
12742
+ const walk = { folder: dirname5(placed), seen: /* @__PURE__ */ new Set(), verdicts: /* @__PURE__ */ new Map() };
12632
12743
  try {
12633
- return decodeURIComponent(value);
12744
+ return await listLeaves(asBytes(resolve2(filePath)), placed, walk, 0);
12634
12745
  } catch {
12635
- return value;
12746
+ return false;
12636
12747
  }
12637
12748
  }
12638
- async function playlistLeavesItsFolder(filePath, placedAt = filePath) {
12639
- const placed = resolve2(placedAt);
12640
- return listLeaves(resolve2(filePath), placed, dirname5(placed), /* @__PURE__ */ new Set(), 0);
12749
+ var MAX_ID3_TAGS = 16;
12750
+ function isId3Header(head) {
12751
+ return head.length >= 10 && head.toString("latin1", 0, 3) === "ID3" && head[3] !== 255 && head[4] !== 255 && head.subarray(6, 10).every((byte) => byte < 128);
12641
12752
  }
12642
- async function startsAsPlaylist(path) {
12643
- const head = (await readHead(path)).toString("utf8").replace(/^\uFEFF/, "").trimStart();
12644
- return head.startsWith("#EXTM3U") || /^ffconcat\s+version/i.test(head);
12753
+ async function textStart(fh, first) {
12754
+ let offset = 0;
12755
+ let head = first;
12756
+ for (let tags = 0; tags <= MAX_ID3_TAGS; tags++) {
12757
+ if (!isId3Header(head)) return offset;
12758
+ const size = head[6] << 21 | head[7] << 14 | head[8] << 7 | head[9];
12759
+ offset += 10 + size + (head[5] & 16 ? 10 : 0);
12760
+ head = await readAt(fh, 10, offset);
12761
+ }
12762
+ return -1;
12763
+ }
12764
+ function startsAsPlaylist(head) {
12765
+ const text = head.toString("utf8").replace(/^\uFEFF/, "").trimStart();
12766
+ return text.startsWith("#EXTM3U") || /^ffconcat\s+version/i.test(text);
12645
12767
  }
12646
- async function listLeaves(readPath, path, folder, seen, depth) {
12768
+ async function readList(path) {
12769
+ const fh = await openRegular(Buffer.from(path, "latin1"));
12770
+ if (!fh) return true;
12647
12771
  try {
12648
- if (!await startsAsPlaylist(readPath)) return false;
12649
- if (depth >= MAX_PLAYLIST_DEPTH) return true;
12650
- if (seen.has(path)) return false;
12651
- seen.add(path);
12652
- const body = await readHead(readPath, MAX_PLAYLIST_BYTES + 1);
12653
- if (body.length > MAX_PLAYLIST_BYTES) return true;
12654
- for (const entry of playlistEntries(body.toString("utf8")) ?? []) {
12655
- if (await entryLeaves(entry, dirname5(path), folder, seen, depth)) return true;
12656
- }
12657
- return false;
12658
- } catch {
12659
- return false;
12772
+ const first = await readAt(fh, SNIFF_BYTES, 0);
12773
+ const start = await textStart(fh, first);
12774
+ if (start < 0) return true;
12775
+ if (!startsAsPlaylist(start === 0 ? first : await readAt(fh, SNIFF_BYTES, start))) return null;
12776
+ const body = await readAt(fh, MAX_PLAYLIST_BYTES + 1, start);
12777
+ return body.length > MAX_PLAYLIST_BYTES ? true : body.toString("latin1");
12778
+ } finally {
12779
+ await fh.close().catch(() => {
12780
+ });
12781
+ }
12782
+ }
12783
+ var isMissing = (error) => ["ENOENT", "ENOTDIR", "ENAMETOOLONG"].includes(
12784
+ error?.code ?? ""
12785
+ );
12786
+ async function listLeaves(readPath, path, walk, depth) {
12787
+ const text = await readList(readPath).catch(
12788
+ (error) => depth > 0 && !isMissing(error) ? true : null
12789
+ );
12790
+ if (text === null) return false;
12791
+ if (text === true || depth >= MAX_PLAYLIST_DEPTH) return true;
12792
+ if (walk.seen.has(path)) return false;
12793
+ walk.seen.add(path);
12794
+ for (const entry of playlistEntries(text) ?? []) {
12795
+ if (await entryLeaves(entry, dirname5(path), walk, depth)) return true;
12660
12796
  }
12797
+ return false;
12661
12798
  }
12662
- async function entryLeaves(entry, base, folder, seen, depth) {
12663
- if (entryLeavesFolder(entry, base, folder)) return true;
12799
+ async function entryLeaves(entry, base, walk, depth) {
12800
+ if (entryLeavesFolder(entry, base, walk.folder)) return true;
12664
12801
  if (HTTP_URL.test(entry)) return false;
12665
- for (const local of /* @__PURE__ */ new Set([entry, safeDecode(entry)])) {
12802
+ for (const local of /* @__PURE__ */ new Set([entry, percentDecoded(entry)])) {
12666
12803
  const nested = resolve2(base, local);
12667
- if (await listLeaves(nested, nested, folder, seen, depth + 1)) return true;
12804
+ let verdict = walk.verdicts.get(nested);
12805
+ if (verdict === void 0) {
12806
+ verdict = await listLeaves(nested, nested, walk, depth + 1);
12807
+ walk.verdicts.set(nested, verdict);
12808
+ }
12809
+ if (verdict) return true;
12668
12810
  }
12669
12811
  return false;
12670
12812
  }
12671
12813
 
12672
12814
  // ../engine/src/utils/urlDownloader.ts
12815
+ import {
12816
+ closeSync as closeSync2,
12817
+ createReadStream as createReadStream2,
12818
+ createWriteStream,
12819
+ existsSync as existsSync9,
12820
+ fsyncSync,
12821
+ linkSync,
12822
+ mkdirSync as mkdirSync4,
12823
+ lstatSync,
12824
+ openSync as openSync2,
12825
+ readdirSync as readdirSync4,
12826
+ rmdirSync,
12827
+ rmSync as rmSync3,
12828
+ statSync as statSync5,
12829
+ statfsSync,
12830
+ unlinkSync
12831
+ } from "fs";
12832
+ import { createHash as createHash2, randomUUID as randomUUID2 } from "crypto";
12833
+ import dns from "dns";
12834
+ import { dirname as dirname6, extname as extname2, join as join11 } from "path";
12835
+ import { Readable, Transform } from "stream";
12836
+ import { pipeline } from "stream/promises";
12673
12837
  var inFlightDownloads = /* @__PURE__ */ new Map();
12674
12838
  var signalScopes = /* @__PURE__ */ new WeakMap();
12675
12839
  var nextSignalScope = 1;
@@ -12720,6 +12884,18 @@ var UrlDownloadError = class extends Error {
12720
12884
  telemetry;
12721
12885
  locallyRetryable;
12722
12886
  };
12887
+ var URL_NOT_PERMITTED = "Download URL is not permitted";
12888
+ var REDIRECT_NOT_PERMITTED = "Download redirect target is not permitted";
12889
+ function notPermittedError(redirect) {
12890
+ return new UrlDownloadError(
12891
+ "http_rejected",
12892
+ false,
12893
+ redirect ? REDIRECT_NOT_PERMITTED : URL_NOT_PERMITTED
12894
+ );
12895
+ }
12896
+ function isUrlNotPermittedError(error) {
12897
+ return error instanceof UrlDownloadError && (error.message === URL_NOT_PERMITTED || error.message === REDIRECT_NOT_PERMITTED);
12898
+ }
12723
12899
  function classifyHttpFailure(status) {
12724
12900
  const message = `HTTP ${status}`;
12725
12901
  if (status === 404 || status === 410) {
@@ -12772,10 +12948,19 @@ function assertPublicHttpsUrl(url) {
12772
12948
  if (parsed.protocol !== "https:") {
12773
12949
  throw new Error(`[URLDownloader] Only HTTPS URLs are permitted in compositions`);
12774
12950
  }
12775
- if (isBlockedNetworkHost(parsed.hostname)) {
12951
+ if (isBlockedNetworkHost(parsed.hostname) || refusedByRestrictedNetwork(parsed.hostname)) {
12776
12952
  throw new Error("[URLDownloader] URL targets a private/reserved address and is not permitted");
12777
12953
  }
12778
12954
  }
12955
+ function refusedByRestrictedNetwork(hostname) {
12956
+ if (!resolveRestrictPageNetwork()) return false;
12957
+ try {
12958
+ assertPublicHostname(hostname);
12959
+ return false;
12960
+ } catch {
12961
+ return true;
12962
+ }
12963
+ }
12779
12964
  function getFilenameFromUrl(url, validationScope) {
12780
12965
  const physicalIdentity = validationScope === "" ? url : `${url}\0${validationScope}`;
12781
12966
  const hash = createHash2("md5").update(physicalIdentity).digest("hex").slice(0, 12);
@@ -12924,27 +13109,47 @@ async function acquireCachePathLock(localPath, timeoutMs, signal) {
12924
13109
  var REDIRECT_STATUSES = /* @__PURE__ */ new Set([301, 302, 303, 307, 308]);
12925
13110
  var MAX_REDIRECTS = 5;
12926
13111
  var NON_PUBLIC_ADDRESS_CODE = "HF_NON_PUBLIC_ADDRESS";
13112
+ function nonPublicAddressError() {
13113
+ return Object.assign(new Error("host resolves to a non-public address"), {
13114
+ code: NON_PUBLIC_ADDRESS_CODE
13115
+ });
13116
+ }
12927
13117
  var publicOnlyLookup = (hostname, options, callback) => {
12928
13118
  dns.lookup(hostname, { ...options, all: true }, (error, answers) => {
12929
13119
  if (error) return callback(error, "", 0);
12930
13120
  if (answers.length === 0 || answers.some((a) => isBlockedNetworkHost(a.address.split("%")[0]))) {
12931
- const refused = Object.assign(new Error("host resolves to a non-public address"), {
12932
- code: NON_PUBLIC_ADDRESS_CODE
12933
- });
12934
- return callback(refused, "", 0);
13121
+ return callback(nonPublicAddressError(), "", 0);
12935
13122
  }
12936
13123
  if (options.all) return callback(null, answers);
12937
13124
  return callback(null, answers[0].address, answers[0].family);
12938
13125
  });
12939
13126
  };
12940
- var undiciTransport;
13127
+ var capturePolicyLookup = (hostname, options, callback) => {
13128
+ resolvePublicAddress(hostname).then(
13129
+ (address) => options.all ? callback(null, [{ address, family: 4 }]) : callback(null, address, 4),
13130
+ (error) => callback(
13131
+ error instanceof NonPublicHostError ? nonPublicAddressError() : error,
13132
+ "",
13133
+ 0
13134
+ )
13135
+ );
13136
+ };
13137
+ var undiciTransports = /* @__PURE__ */ new Map();
13138
+ function undiciTransport(lookup) {
13139
+ let transport = undiciTransports.get(lookup);
13140
+ if (!transport) {
13141
+ transport = import("undici").then(({ Agent, fetch: undiciFetch }) => {
13142
+ const dispatcher = new Agent({ connect: { lookup } });
13143
+ return (target, options) => undiciFetch(target, { ...options, dispatcher });
13144
+ });
13145
+ undiciTransports.set(lookup, transport);
13146
+ }
13147
+ return transport;
13148
+ }
12941
13149
  var fetchPublic = async (url, init) => {
13150
+ if (resolveRestrictPageNetwork()) return (await undiciTransport(capturePolicyLookup))(url, init);
12942
13151
  if (fetchGoesThroughEnvProxy()) return fetch(url, init);
12943
- undiciTransport ??= import("undici").then(({ Agent, fetch: undiciFetch }) => {
12944
- const dispatcher = new Agent({ connect: { lookup: publicOnlyLookup } });
12945
- return (target, options) => undiciFetch(target, { ...options, dispatcher });
12946
- });
12947
- return (await undiciTransport)(url, init);
13152
+ return (await undiciTransport(publicOnlyLookup))(url, init);
12948
13153
  };
12949
13154
  var downloadFetch = fetchPublic;
12950
13155
  function _setDownloadFetchForTests(replacement) {
@@ -12963,11 +13168,7 @@ function assertAllowedDownloadUrl(url, redirect) {
12963
13168
  try {
12964
13169
  assertPublicHttpsUrl(url);
12965
13170
  } catch {
12966
- throw new UrlDownloadError(
12967
- "http_rejected",
12968
- false,
12969
- redirect ? "Download redirect target is not permitted" : "Download URL is not permitted"
12970
- );
13171
+ throw notPermittedError(redirect);
12971
13172
  }
12972
13173
  }
12973
13174
  async function cancelResponseBody(response) {
@@ -13004,11 +13205,7 @@ async function fetchWithValidatedRedirects(initialUrl, controller) {
13004
13205
  headers: { "accept-encoding": "identity" }
13005
13206
  }).catch((error) => {
13006
13207
  if (!refusedNonPublicAddress(error)) throw error;
13007
- throw new UrlDownloadError(
13008
- "http_rejected",
13009
- false,
13010
- redirects > 0 ? "Download redirect target is not permitted" : "Download URL is not permitted"
13011
- );
13208
+ throw notPermittedError(redirects > 0);
13012
13209
  });
13013
13210
  if (!REDIRECT_STATUSES.has(response.status)) return { response, finalUrl: currentUrl };
13014
13211
  await cancelResponseBody(response);
@@ -13194,7 +13391,122 @@ function checksumMismatchError(source, status, telemetry) {
13194
13391
  true
13195
13392
  );
13196
13393
  }
13197
- async function fetchToPartial(url, partialPath, controller, options, onSizedBodyBytes) {
13394
+ var DEFAULT_MAX_DOWNLOAD_BYTES = 8 * 1024 ** 3;
13395
+ var DEFAULT_MAX_DOWNLOAD_MS = 30 * 60 * 1e3;
13396
+ var DEFAULT_DOWNLOAD_MIN_FREE_BYTES = 512 * 1024 ** 2;
13397
+ var FREE_SPACE_CHECK_INTERVAL_BYTES = 4 * 1024 ** 2;
13398
+ var DEFAULT_MIN_DOWNLOAD_BYTES_PER_SEC = 32 * 1024;
13399
+ var THROUGHPUT_WINDOW_SECONDS = 60;
13400
+ function integerFromEnv(name, fallback, minimum) {
13401
+ const raw = process.env[name]?.trim();
13402
+ if (!raw || !/^\d+$/.test(raw)) return fallback;
13403
+ const value = Number(raw);
13404
+ return Number.isSafeInteger(value) && value >= minimum ? value : fallback;
13405
+ }
13406
+ var maxDownloadBytes = () => integerFromEnv("HYPERFRAMES_MAX_DOWNLOAD_BYTES", DEFAULT_MAX_DOWNLOAD_BYTES, 1);
13407
+ var minDownloadBytesPerSec = () => integerFromEnv("HYPERFRAMES_MIN_DOWNLOAD_BYTES_PER_SEC", DEFAULT_MIN_DOWNLOAD_BYTES_PER_SEC, 0);
13408
+ var maxDownloadMs = () => integerFromEnv("HYPERFRAMES_MAX_DOWNLOAD_MS", DEFAULT_MAX_DOWNLOAD_MS, 1);
13409
+ var downloadMinFreeBytes = () => integerFromEnv("HYPERFRAMES_DOWNLOAD_MIN_FREE_BYTES", DEFAULT_DOWNLOAD_MIN_FREE_BYTES, 0);
13410
+ function freeDiskBytes(path) {
13411
+ try {
13412
+ const stat = statfsSync(path);
13413
+ return stat.bavail * stat.bsize;
13414
+ } catch {
13415
+ return null;
13416
+ }
13417
+ }
13418
+ var unreceivedBytesByDevice = /* @__PURE__ */ new Map();
13419
+ var DiskHeadroomGuard = class {
13420
+ constructor(dir, minFreeBytes) {
13421
+ this.dir = dir;
13422
+ this.minFreeBytes = minFreeBytes;
13423
+ }
13424
+ dir;
13425
+ minFreeBytes;
13426
+ unreceivedBytes = 0;
13427
+ bytesSinceCheck = 0;
13428
+ device = 0;
13429
+ claim(declaredBytes) {
13430
+ if (this.minFreeBytes === 0) return true;
13431
+ this.device = statSync5(this.dir).dev;
13432
+ this.adjustUnreceived(declaredBytes);
13433
+ return this.keepsMinimum();
13434
+ }
13435
+ receive(byteCount) {
13436
+ if (this.minFreeBytes === 0) return true;
13437
+ this.adjustUnreceived(-Math.min(byteCount, this.unreceivedBytes));
13438
+ this.bytesSinceCheck += byteCount;
13439
+ if (this.bytesSinceCheck < FREE_SPACE_CHECK_INTERVAL_BYTES) return true;
13440
+ this.bytesSinceCheck = 0;
13441
+ return this.keepsMinimum();
13442
+ }
13443
+ release() {
13444
+ this.adjustUnreceived(-this.unreceivedBytes);
13445
+ }
13446
+ keepsMinimum() {
13447
+ const free = freeDiskBytes(this.dir);
13448
+ if (free === null) return true;
13449
+ return free - (unreceivedBytesByDevice.get(this.device) ?? 0) >= this.minFreeBytes;
13450
+ }
13451
+ adjustUnreceived(delta) {
13452
+ this.unreceivedBytes += delta;
13453
+ const total = (unreceivedBytesByDevice.get(this.device) ?? 0) + delta;
13454
+ if (total > 0) unreceivedBytesByDevice.set(this.device, total);
13455
+ else unreceivedBytesByDevice.delete(this.device);
13456
+ }
13457
+ };
13458
+ function lowDiskSpaceError(minFreeBytes, status, telemetry) {
13459
+ return new UrlDownloadError(
13460
+ "filesystem",
13461
+ false,
13462
+ `Download stopped: it would leave less than ${minFreeBytes} bytes free on the download volume`,
13463
+ status,
13464
+ telemetry
13465
+ );
13466
+ }
13467
+ function isCompressedEncoding(contentEncoding) {
13468
+ const encoding = contentEncoding?.trim().toLowerCase();
13469
+ return Boolean(encoding) && encoding !== "identity";
13470
+ }
13471
+ function overByteLimitError(maxBytes, status, telemetry) {
13472
+ return new UrlDownloadError(
13473
+ "length_mismatch",
13474
+ false,
13475
+ `Download exceeded the ${maxBytes}-byte limit`,
13476
+ status,
13477
+ telemetry
13478
+ );
13479
+ }
13480
+ var ThroughputWindow = class {
13481
+ constructor(startedAtMs) {
13482
+ this.startedAtMs = startedAtMs;
13483
+ this.currentSecond = Math.floor(startedAtMs / 1e3);
13484
+ }
13485
+ startedAtMs;
13486
+ buckets = new Array(THROUGHPUT_WINDOW_SECONDS + 1).fill(0);
13487
+ bytesInWindow = 0;
13488
+ currentSecond;
13489
+ record(byteCount, nowMs) {
13490
+ this.advanceTo(nowMs);
13491
+ this.buckets[this.currentSecond % this.buckets.length] += byteCount;
13492
+ this.bytesInWindow += byteCount;
13493
+ }
13494
+ isBelow(minBytesPerSec, nowMs) {
13495
+ this.advanceTo(nowMs);
13496
+ return nowMs - this.startedAtMs >= THROUGHPUT_WINDOW_SECONDS * 1e3 && this.bytesInWindow < minBytesPerSec * THROUGHPUT_WINDOW_SECONDS;
13497
+ }
13498
+ advanceTo(nowMs) {
13499
+ const second = Math.floor(nowMs / 1e3);
13500
+ const expired = Math.min(second - this.currentSecond, this.buckets.length);
13501
+ for (let step = 1; step <= expired; step += 1) {
13502
+ const index = (this.currentSecond + step) % this.buckets.length;
13503
+ this.bytesInWindow -= this.buckets[index];
13504
+ this.buckets[index] = 0;
13505
+ }
13506
+ this.currentSecond = Math.max(second, this.currentSecond);
13507
+ }
13508
+ };
13509
+ async function fetchToPartial(url, partialPath, controller, options, onBodyBytes, headroom) {
13198
13510
  const { response, finalUrl } = await fetchWithValidatedRedirects(url, controller);
13199
13511
  const finalIdentity = safeDownloadUrlIdentity(finalUrl);
13200
13512
  const rangeDisposition = classifyRangeDisposition(response);
@@ -13252,8 +13564,33 @@ async function fetchToPartial(url, partialPath, controller, options, onSizedBody
13252
13564
  }
13253
13565
  throw error;
13254
13566
  }
13255
- const contentEncoding = response.headers.get("content-encoding")?.trim().toLowerCase();
13256
- const expectedBytes = !contentEncoding || contentEncoding === "identity" ? declaredLength : void 0;
13567
+ const responseTelemetry = { finalHost: finalIdentity.host, status: response.status };
13568
+ if (isCompressedEncoding(response.headers.get("content-encoding"))) {
13569
+ await cancelResponseBody(response);
13570
+ throw new UrlDownloadError(
13571
+ "http_rejected",
13572
+ false,
13573
+ "Download response is compressed; only identity Content-Encoding is accepted",
13574
+ response.status,
13575
+ responseTelemetry
13576
+ );
13577
+ }
13578
+ const maxBytes = maxDownloadBytes();
13579
+ if (declaredLength !== void 0 && declaredLength > maxBytes) {
13580
+ await cancelResponseBody(response);
13581
+ throw overByteLimitError(maxBytes, response.status, {
13582
+ ...responseTelemetry,
13583
+ expectedBytes: declaredLength
13584
+ });
13585
+ }
13586
+ if (!headroom.claim(declaredLength ?? 0)) {
13587
+ await cancelResponseBody(response);
13588
+ throw lowDiskSpaceError(headroom.minFreeBytes, response.status, {
13589
+ ...responseTelemetry,
13590
+ expectedBytes: declaredLength
13591
+ });
13592
+ }
13593
+ const expectedBytes = declaredLength;
13257
13594
  let receivedBytes = 0;
13258
13595
  const sha256 = createHash2("sha256");
13259
13596
  const md5 = createHash2("md5");
@@ -13262,8 +13599,28 @@ async function fetchToPartial(url, partialPath, controller, options, onSizedBody
13262
13599
  const inspector = new Transform({
13263
13600
  transform(chunk, _encoding, callback) {
13264
13601
  const bytes = Buffer.isBuffer(chunk) ? chunk : Buffer.from(chunk);
13265
- if (declaredLength !== void 0) onSizedBodyBytes();
13602
+ onBodyBytes(bytes.length, declaredLength !== void 0);
13266
13603
  receivedBytes += bytes.length;
13604
+ if (receivedBytes > maxBytes) {
13605
+ callback(
13606
+ overByteLimitError(maxBytes, response.status, {
13607
+ ...responseTelemetry,
13608
+ expectedBytes,
13609
+ receivedBytes
13610
+ })
13611
+ );
13612
+ return;
13613
+ }
13614
+ if (!headroom.receive(bytes.length)) {
13615
+ callback(
13616
+ lowDiskSpaceError(headroom.minFreeBytes, response.status, {
13617
+ ...responseTelemetry,
13618
+ expectedBytes,
13619
+ receivedBytes
13620
+ })
13621
+ );
13622
+ return;
13623
+ }
13267
13624
  sha256.update(bytes);
13268
13625
  md5.update(bytes);
13269
13626
  if (prefixBytes < 1024) {
@@ -13413,17 +13770,54 @@ async function runDownloadAttempt(url, localPath, timeoutMs, attempt, options, s
13413
13770
  }, timeoutMs);
13414
13771
  };
13415
13772
  armTimeout();
13773
+ const deadlineMs = maxDownloadMs();
13774
+ let pastDeadline = false;
13775
+ const deadlineId = setTimeout(() => {
13776
+ pastDeadline = true;
13777
+ controller.abort();
13778
+ }, deadlineMs);
13416
13779
  let sizedBodyStarted = false;
13417
13780
  const extendTimeout = () => {
13418
13781
  sizedBodyStarted = true;
13419
13782
  armTimeout();
13420
13783
  };
13784
+ const minBytesPerSec = minDownloadBytesPerSec();
13785
+ let throughput;
13786
+ let tooSlow = false;
13787
+ let floorCheckId;
13788
+ const checkThroughputFloor = () => {
13789
+ if (throughput?.isBelow(minBytesPerSec, Date.now())) {
13790
+ tooSlow = true;
13791
+ controller.abort();
13792
+ return;
13793
+ }
13794
+ floorCheckId = setTimeout(checkThroughputFloor, 1e3);
13795
+ };
13796
+ const onBodyBytes = (byteCount, sized) => {
13797
+ if (sized) extendTimeout();
13798
+ if (minBytesPerSec === 0) return;
13799
+ if (!throughput) {
13800
+ throughput = new ThroughputWindow(Date.now());
13801
+ floorCheckId = setTimeout(checkThroughputFloor, 1e3);
13802
+ }
13803
+ throughput.record(byteCount, Date.now());
13804
+ };
13421
13805
  const identity = safeDownloadUrlIdentity(url);
13806
+ const headroom = new DiskHeadroomGuard(attemptDir, downloadMinFreeBytes());
13422
13807
  try {
13423
13808
  if (callerAborted) {
13424
13809
  throw new UrlDownloadError("cancelled", false, "Download cancelled");
13425
13810
  }
13426
- const integrity = await fetchToPartial(url, partialPath, controller, options, extendTimeout);
13811
+ const integrity = await fetchToPartial(
13812
+ url,
13813
+ partialPath,
13814
+ controller,
13815
+ options,
13816
+ onBodyBytes,
13817
+ headroom
13818
+ );
13819
+ clearTimeout(deadlineId);
13820
+ clearTimeout(floorCheckId);
13427
13821
  if (await playlistLeavesItsFolder(partialPath, localPath)) {
13428
13822
  throw new UrlDownloadError(
13429
13823
  "invalid_payload",
@@ -13476,33 +13870,30 @@ async function runDownloadAttempt(url, localPath, timeoutMs, attempt, options, s
13476
13870
  });
13477
13871
  return localPath;
13478
13872
  } catch (error) {
13873
+ let classified;
13479
13874
  if (callerAborted) {
13480
- const classified2 = new UrlDownloadError("cancelled", false, "Download cancelled");
13481
- emitDownloadTelemetry(options, {
13482
- urlFingerprint: identity.urlFingerprint,
13483
- initialHost: identity.host,
13484
- attempt,
13485
- outcome: "attempt_failed",
13486
- failureKind: classified2.kind
13487
- });
13488
- throw classified2;
13489
- }
13490
- if (timedOut) {
13491
- const classified2 = new UrlDownloadError(
13875
+ classified = new UrlDownloadError("cancelled", false, "Download cancelled");
13876
+ } else if (pastDeadline) {
13877
+ classified = new UrlDownloadError(
13878
+ "timeout",
13879
+ false,
13880
+ `Download exceeded the ${deadlineMs / 1e3}s time limit`
13881
+ );
13882
+ } else if (timedOut) {
13883
+ classified = new UrlDownloadError(
13492
13884
  "timeout",
13493
13885
  true,
13494
13886
  sizedBodyStarted ? `Download stalled: no data for ${timeoutMs / 1e3}s` : `Download timeout after ${timeoutMs / 1e3}s`
13495
13887
  );
13496
- emitDownloadTelemetry(options, {
13497
- urlFingerprint: identity.urlFingerprint,
13498
- initialHost: identity.host,
13499
- attempt,
13500
- outcome: "attempt_failed",
13501
- failureKind: classified2.kind
13502
- });
13503
- throw classified2;
13888
+ } else if (tooSlow) {
13889
+ classified = new UrlDownloadError(
13890
+ "timeout",
13891
+ true,
13892
+ `Download too slow: under ${minBytesPerSec} bytes/s over the last ${THROUGHPUT_WINDOW_SECONDS}s`
13893
+ );
13894
+ } else {
13895
+ classified = classifyDownloadFailure(error);
13504
13896
  }
13505
- const classified = classifyDownloadFailure(error);
13506
13897
  emitDownloadTelemetry(options, {
13507
13898
  urlFingerprint: identity.urlFingerprint,
13508
13899
  initialHost: identity.host,
@@ -13514,6 +13905,9 @@ async function runDownloadAttempt(url, localPath, timeoutMs, attempt, options, s
13514
13905
  throw classified;
13515
13906
  } finally {
13516
13907
  clearTimeout(timeoutId);
13908
+ clearTimeout(deadlineId);
13909
+ clearTimeout(floorCheckId);
13910
+ headroom.release();
13517
13911
  signal?.removeEventListener("abort", onCallerAbort);
13518
13912
  controller.abort();
13519
13913
  rmSync3(attemptDir, { recursive: true, force: true });
@@ -13646,7 +14040,7 @@ async function downloadToTemp(url, destDir, timeoutMs = 3e5, signal, onTransient
13646
14040
  if (inFlight) {
13647
14041
  return inFlight;
13648
14042
  }
13649
- if (!existsSync8(destDir)) {
14043
+ if (!existsSync9(destDir)) {
13650
14044
  mkdirSync4(destDir, { recursive: true });
13651
14045
  }
13652
14046
  const filename = getFilenameFromUrl(url, validationScope);
@@ -13748,8 +14142,9 @@ function truncateUtf8(text, maxBytes) {
13748
14142
  // ../engine/src/services/extractionCache.ts
13749
14143
  import { createHash as createHash4, randomUUID as randomUUID3 } from "crypto";
13750
14144
  import {
14145
+ chmodSync,
13751
14146
  createReadStream as createReadStream3,
13752
- existsSync as existsSync9,
14147
+ existsSync as existsSync10,
13753
14148
  lstatSync as lstatSync2,
13754
14149
  mkdirSync as mkdirSync5,
13755
14150
  readdirSync as readdirSync5,
@@ -13761,6 +14156,14 @@ import {
13761
14156
  import { join as join12 } from "path";
13762
14157
  var COMPLETE_SENTINEL = ".hf-complete";
13763
14158
  var GC_MARKER = ".hf-last-gc";
14159
+ function privateCacheRoot(root, uid = process.getuid?.()) {
14160
+ if (uid === void 0 || root !== defaultExtractCacheDir()) return root;
14161
+ mkdirSync5(root, { recursive: true, mode: 448 });
14162
+ const stat = lstatSync2(root);
14163
+ if (!stat.isDirectory() || stat.uid !== uid) return void 0;
14164
+ if ((stat.mode & 63) !== 0) chmodSync(root, 448);
14165
+ return root;
14166
+ }
13764
14167
  var SCHEMA_PREFIX = "hfcache-v10-";
13765
14168
  var KEY_HEX_CHARS = 16;
13766
14169
  async function readContentSha256(path, signal) {
@@ -13810,7 +14213,7 @@ function hasFrameFiles(dir) {
13810
14213
  function lookupCacheEntry(rootDir, input) {
13811
14214
  const keyHash = computeCacheKey(input);
13812
14215
  const dir = join12(rootDir, cacheEntryDirName(keyHash));
13813
- const complete = existsSync9(join12(dir, COMPLETE_SENTINEL)) && hasFrameFiles(dir);
14216
+ const complete = existsSync10(join12(dir, COMPLETE_SENTINEL)) && hasFrameFiles(dir);
13814
14217
  return { entry: { dir, keyHash }, hit: complete };
13815
14218
  }
13816
14219
  function partialCacheEntryDir(entry) {
@@ -13821,7 +14224,7 @@ function isTargetExistsRenameError(err) {
13821
14224
  return code === "EEXIST" || code === "ENOTEMPTY" || code === "EPERM";
13822
14225
  }
13823
14226
  function adoptPublishedWinner(entry, partialDir) {
13824
- if (!existsSync9(join12(entry.dir, COMPLETE_SENTINEL)) || !hasFrameFiles(entry.dir)) return null;
14227
+ if (!existsSync10(join12(entry.dir, COMPLETE_SENTINEL)) || !hasFrameFiles(entry.dir)) return null;
13825
14228
  removeDir(partialDir);
13826
14229
  return { dir: entry.dir, published: true };
13827
14230
  }
@@ -14051,6 +14454,12 @@ function tailFramesFromFinalFrame(input) {
14051
14454
  return count > 0 ? count : null;
14052
14455
  }
14053
14456
  var DOWNLOAD_SUBDIR = "_downloads";
14457
+ async function assertDownloadedVideoIsMedia(path, videoId, signal) {
14458
+ await assertMediaPayload(path, videoId);
14459
+ const formatLimit = selfContainedFormatArgs();
14460
+ if (formatLimit.length === 0) return;
14461
+ await runFfprobe(path, [...formatLimit, "-show_entries", "format=format_name"], signal);
14462
+ }
14054
14463
  var EXTRACT_CACHE_MIN_AGE_MS = 60 * 60 * 1e3;
14055
14464
  var GC_STALENESS_MS = 24 * 60 * 60 * 1e3;
14056
14465
  var SDR_TO_HDR_COLORSPACE_FILTER = "colorspace=all=bt2020:iall=bt709:range=tv";
@@ -14217,6 +14626,14 @@ function classifyVideoExtractionError(error) {
14217
14626
  diagnostic
14218
14627
  );
14219
14628
  }
14629
+ if (error instanceof NotMediaPayloadError) {
14630
+ return new VideoSourceExtractionError(
14631
+ "invalid_media",
14632
+ false,
14633
+ "Video source is a text document, not media",
14634
+ diagnostic
14635
+ );
14636
+ }
14220
14637
  if (lowered.includes("cancelled") || lowered.includes("aborted")) {
14221
14638
  return new VideoSourceExtractionError(
14222
14639
  "cancelled",
@@ -14678,7 +15095,7 @@ async function extractVideoFramesRangeUnredacted(videoPath, videoId, startTime,
14678
15095
  const fps = fpsToNumber(normalizedFps);
14679
15096
  const ffmpegFps = fpsToFfmpegArg(normalizedFps);
14680
15097
  const videoOutputDir = outputDirOverride ?? join13(outputDir, mediaIdPathSegment(videoId));
14681
- if (!existsSync10(videoOutputDir)) mkdirSync6(videoOutputDir, { recursive: true });
15098
+ if (!existsSync11(videoOutputDir)) mkdirSync6(videoOutputDir, { recursive: true });
14682
15099
  let metadata;
14683
15100
  try {
14684
15101
  metadata = await extractMediaMetadata(videoPath);
@@ -15293,6 +15710,16 @@ async function extractAllVideoFrames(videos, baseDir, options, signal, config, c
15293
15710
  resolvedVideos.push({ video, videoPath: remoteUrl });
15294
15711
  continue;
15295
15712
  }
15713
+ const roots = options.assetRoots;
15714
+ if (!isHttpUrl(videoPath) && roots && !isInsideAssetRoots(videoPath, roots)) {
15715
+ errors.push({
15716
+ videoId: video.id,
15717
+ kind: "source_missing",
15718
+ retryable: false,
15719
+ error: `Video source is outside the project folder: ${video.src}`
15720
+ });
15721
+ continue;
15722
+ }
15296
15723
  if (isHttpUrl(videoPath)) {
15297
15724
  const downloadDir = join13(options.outputDir, DOWNLOAD_SUBDIR);
15298
15725
  mkdirSync6(downloadDir, { recursive: true });
@@ -15304,8 +15731,9 @@ async function extractAllVideoFrames(videos, baseDir, options, signal, config, c
15304
15731
  () => recordTransientRetries(1),
15305
15732
  { onTelemetry: writeUrlDownloadTelemetry }
15306
15733
  );
15734
+ await assertDownloadedVideoIsMedia(videoPath, video.id, signal);
15307
15735
  }
15308
- if (!existsSync10(videoPath)) {
15736
+ if (!existsSync11(videoPath)) {
15309
15737
  if (!warnedSrcs.has(video.src)) {
15310
15738
  warnedSrcs.add(video.src);
15311
15739
  process.stderr.write(
@@ -15451,11 +15879,14 @@ async function extractAllVideoFrames(videos, baseDir, options, signal, config, c
15451
15879
  let cacheRootDir;
15452
15880
  if (configuredCacheRootDir) {
15453
15881
  try {
15454
- mkdirSync6(configuredCacheRootDir, { recursive: true });
15455
- cacheRootDir = configuredCacheRootDir;
15882
+ cacheRootDir = privateCacheRoot(configuredCacheRootDir);
15883
+ if (cacheRootDir) mkdirSync6(cacheRootDir, { recursive: true });
15456
15884
  } catch {
15885
+ cacheRootDir = void 0;
15886
+ }
15887
+ if (!cacheRootDir) {
15457
15888
  process.stderr.write(
15458
- `[hyperframes:render] WARNING: extraction cache dir ${configuredCacheRootDir} is not writable; caching disabled for this render
15889
+ `[hyperframes:render] WARNING: extraction cache dir ${configuredCacheRootDir} is not a writable directory of this user; caching disabled for this render
15459
15890
  `
15460
15891
  );
15461
15892
  }
@@ -16043,7 +16474,7 @@ var FrameLookupTable = class {
16043
16474
  cleanup() {
16044
16475
  for (const video of this.videos.values()) {
16045
16476
  if (video.extracted.ownedByLookup) continue;
16046
- if (existsSync10(video.extracted.outputDir)) {
16477
+ if (existsSync11(video.extracted.outputDir)) {
16047
16478
  rmSync5(video.extracted.outputDir, { recursive: true, force: true });
16048
16479
  }
16049
16480
  }
@@ -16590,7 +17021,7 @@ async function queryElementStacking(page, nativeHdrIds) {
16590
17021
  }
16591
17022
 
16592
17023
  // ../engine/src/services/audioMixer.ts
16593
- import { closeSync as closeSync4, existsSync as existsSync12, mkdirSync as mkdirSync7, openSync as openSync4, rmSync as rmSync7, writeFileSync as writeFileSync7 } from "fs";
17024
+ import { closeSync as closeSync4, existsSync as existsSync13, mkdirSync as mkdirSync7, openSync as openSync4, rmSync as rmSync7, writeFileSync as writeFileSync7 } from "fs";
16594
17025
  import { join as join17, dirname as dirname9, isAbsolute as isAbsolute3, relative as relative3 } from "path";
16595
17026
 
16596
17027
  // ../core/dist/audioFade.js
@@ -17218,7 +17649,7 @@ function chainTailSeconds(chain, automation) {
17218
17649
  // ../engine/src/services/audioFxRender.ts
17219
17650
  import {
17220
17651
  closeSync as closeSync3,
17221
- existsSync as existsSync11,
17652
+ existsSync as existsSync12,
17222
17653
  mkdtempSync as mkdtempSync4,
17223
17654
  openSync as openSync3,
17224
17655
  readFileSync as readFileSync8,
@@ -17528,7 +17959,7 @@ async function renderInSegments(openPage, inputWav, header, chain, outputWav, op
17528
17959
  }
17529
17960
  async function applyAudioFxChain(inputWav, chain, outputWav, options) {
17530
17961
  if (enabledAudioFxNodes(chain).length === 0) return { path: inputWav, envelopeBaked: false };
17531
- if (!existsSync11(inputWav)) {
17962
+ if (!existsSync12(inputWav)) {
17532
17963
  throw new AudioFxRenderError(`Audio FX input is missing: ${inputWav}`);
17533
17964
  }
17534
17965
  const limits = { ...DEFAULT_STREAMING_LIMITS, ...options.streaming };
@@ -18065,7 +18496,7 @@ var SIDECAR_WARM_UP_SECONDS = 1;
18065
18496
  async function extractAudioSegment(srcPath, outputPath, stage, mediaStart, duration, playbackRate = 1, signal, config, audioSidecarUrl, options) {
18066
18497
  const ffmpegProcessTimeout = config?.ffmpegProcessTimeout ?? DEFAULT_CONFIG.ffmpegProcessTimeout;
18067
18498
  const outputDir = dirname9(outputPath);
18068
- if (!existsSync12(outputDir)) mkdirSync7(outputDir, { recursive: true });
18499
+ if (!existsSync13(outputDir)) mkdirSync7(outputDir, { recursive: true });
18069
18500
  const normalizedPlaybackRate = normalizeRateSpec(playbackRate);
18070
18501
  const sourceDuration = sourceTimeAt(normalizedPlaybackRate, duration);
18071
18502
  const readsUrl = isHttpUrl(srcPath);
@@ -18211,7 +18642,7 @@ function isRemoteElement(element, baseDir, compiledDir, config) {
18211
18642
  async function generateSilence(outputPath, duration, signal, config) {
18212
18643
  const ffmpegProcessTimeout = config?.ffmpegProcessTimeout ?? DEFAULT_CONFIG.ffmpegProcessTimeout;
18213
18644
  const outputDir = dirname9(outputPath);
18214
- if (!existsSync12(outputDir)) mkdirSync7(outputDir, { recursive: true });
18645
+ if (!existsSync13(outputDir)) mkdirSync7(outputDir, { recursive: true });
18215
18646
  const args = [
18216
18647
  "-f",
18217
18648
  "lavfi",
@@ -18265,7 +18696,7 @@ async function mixAudioTracksFlat(tracks, outputPath, totalDuration, signal, con
18265
18696
  };
18266
18697
  }
18267
18698
  const outputDir = dirname9(outputPath);
18268
- if (!existsSync12(outputDir)) mkdirSync7(outputDir, { recursive: true });
18699
+ if (!existsSync13(outputDir)) mkdirSync7(outputDir, { recursive: true });
18269
18700
  const buildFilterComplex = (ignoreAutomation, useNormalize2) => {
18270
18701
  const filterParts = [];
18271
18702
  tracks.forEach((track, i) => {
@@ -18374,7 +18805,7 @@ function groupNormalizeOptionUnsupported(stderr) {
18374
18805
  async function mixGroupMembersFlat(memberTracks, outputPath, totalDuration, signal, config) {
18375
18806
  const ffmpegProcessTimeout = config?.ffmpegProcessTimeout ?? DEFAULT_CONFIG.ffmpegProcessTimeout;
18376
18807
  const outputDir = dirname9(outputPath);
18377
- if (!existsSync12(outputDir)) mkdirSync7(outputDir, { recursive: true });
18808
+ if (!existsSync13(outputDir)) mkdirSync7(outputDir, { recursive: true });
18378
18809
  const buildInputFilters = (ignoreKeyframes, padMembers) => memberTracks.map((track, i) => {
18379
18810
  const volumeFilter = buildVolumeExpression(track, ignoreKeyframes);
18380
18811
  return buildTrackInputFilter(track, i, volumeFilter, totalDuration, padMembers);
@@ -18601,7 +19032,7 @@ async function processCompositionAudio(elements, baseDir, workDir, outputPath, t
18601
19032
  const failures = [];
18602
19033
  const groupTracks = /* @__PURE__ */ new Map();
18603
19034
  const groupMeta = /* @__PURE__ */ new Map();
18604
- if (!existsSync12(workDir)) mkdirSync7(workDir, { recursive: true });
19035
+ if (!existsSync13(workDir)) mkdirSync7(workDir, { recursive: true });
18605
19036
  const internalController = new AbortController();
18606
19037
  const effectiveSignal = internalController.signal;
18607
19038
  if (signal) {
@@ -18633,6 +19064,18 @@ async function processCompositionAudio(elements, baseDir, workDir, outputPath, t
18633
19064
  audioSidecarUrl = config?.audioSidecarUrlByLocalPath?.get(srcPath);
18634
19065
  srcPath = remoteUrl;
18635
19066
  readInPlace = true;
19067
+ } else if (config?.assetRoots && !isInsideAssetRoots(srcPath, config.assetRoots)) {
19068
+ failures.push({
19069
+ stage: "source",
19070
+ reason: "source_not_found",
19071
+ owner: "user",
19072
+ retryable: false,
19073
+ elementId: element.id,
19074
+ detail: boundedDetail(
19075
+ `Audio element ${element.id} source is outside the project folder`
19076
+ )
19077
+ });
19078
+ return;
18636
19079
  }
18637
19080
  }
18638
19081
  if (isHttpUrl(srcPath) && !readInPlace) {
@@ -18652,7 +19095,7 @@ async function processCompositionAudio(elements, baseDir, workDir, outputPath, t
18652
19095
  return;
18653
19096
  }
18654
19097
  }
18655
- if (!readInPlace && !existsSync12(srcPath)) {
19098
+ if (!readInPlace && !existsSync13(srcPath)) {
18656
19099
  failures.push({
18657
19100
  stage: "source",
18658
19101
  reason: "source_not_found",
@@ -19018,7 +19461,7 @@ async function processCompositionAudio(elements, baseDir, workDir, outputPath, t
19018
19461
 
19019
19462
  // ../engine/src/services/parallelCoordinator.ts
19020
19463
  import { freemem } from "os";
19021
- import { existsSync as existsSync13, mkdirSync as mkdirSync8, readdirSync as readdirSync6 } from "fs";
19464
+ import { existsSync as existsSync14, mkdirSync as mkdirSync8, readdirSync as readdirSync6 } from "fs";
19022
19465
  import { copyFile, readFile as readFile2 } from "fs/promises";
19023
19466
  import { join as join19 } from "path";
19024
19467
  import { getHeapStatistics } from "v8";
@@ -19176,6 +19619,13 @@ function formatWorkerFailure(result) {
19176
19619
  const diagnostics = result.diagnostics.map(compactDiagnosticLine).join(" | ");
19177
19620
  return `${base}; diagnostics: ${diagnostics}`;
19178
19621
  }
19622
+ function formatPoolFailure(errors) {
19623
+ const causes = errors.filter((result) => result.failure?.kind !== "cancelled");
19624
+ const stopped = errors.length - causes.length;
19625
+ if (causes.length === 0 || stopped === 0) return errors.map(formatWorkerFailure).join("; ");
19626
+ const peers = stopped === 1 ? "1 other worker was" : `${stopped} other workers were`;
19627
+ return `${causes.map(formatWorkerFailure).join("; ")} (${peers} stopped after this failure)`;
19628
+ }
19179
19629
  function computeWorkerSizing(totalFrames, requested, config) {
19180
19630
  const cpuCount = usableCpuCount();
19181
19631
  const totalMemoryMb = getSystemTotalMb();
@@ -19509,7 +19959,7 @@ async function verifyDiskDrawElementSamples(session, task, streaming) {
19509
19959
  async function executeWorkerTask(task, serverUrl, captureOptions, createBeforeCaptureHook, signal, onFrameCaptured, onFrameBuffer, config, parallel, onFailure, onWorkerPhase, onWorkerOperation, gate) {
19510
19960
  const startTime = Date.now();
19511
19961
  let framesCaptured = 0;
19512
- if (!existsSync13(task.outputDir)) mkdirSync8(task.outputDir, { recursive: true });
19962
+ if (!existsSync14(task.outputDir)) mkdirSync8(task.outputDir, { recursive: true });
19513
19963
  let session = null;
19514
19964
  let perf;
19515
19965
  const needsSeparateBrowsers = shouldDisableBrowserPoolForParallelWorker({ parallel });
@@ -19750,7 +20200,7 @@ async function executeParallelCapture(serverUrl, workDir, tasks, captureOptions,
19750
20200
  flagSilentWorkerExits(results);
19751
20201
  const errors = results.filter((r) => r.failure || r.error);
19752
20202
  if (errors.length > 0) {
19753
- const errorMessages = errors.map(formatWorkerFailure).join("; ");
20203
+ const errorMessages = formatPoolFailure(errors);
19754
20204
  const representative = failureHandler.firstFatalFailure() ?? errors.find((result) => result.failure)?.failure;
19755
20205
  const workerDiagnostics = errors.flatMap((result) => result.failure?.workerDiagnostics ?? []);
19756
20206
  throw new CaptureFailure({
@@ -19764,11 +20214,11 @@ async function executeParallelCapture(serverUrl, workDir, tasks, captureOptions,
19764
20214
  return results;
19765
20215
  }
19766
20216
  async function mergeWorkerFrames(workDir, tasks, outputDir) {
19767
- if (!existsSync13(outputDir)) mkdirSync8(outputDir, { recursive: true });
20217
+ if (!existsSync14(outputDir)) mkdirSync8(outputDir, { recursive: true });
19768
20218
  let totalFrames = 0;
19769
20219
  const sortedTasks = [...tasks].sort((a, b) => a.startFrame - b.startFrame);
19770
20220
  for (const task of sortedTasks) {
19771
- if (!existsSync13(task.outputDir)) {
20221
+ if (!existsSync14(task.outputDir)) {
19772
20222
  continue;
19773
20223
  }
19774
20224
  const files = readdirSync6(task.outputDir).filter((f) => f.startsWith("frame_") && (f.endsWith(".jpg") || f.endsWith(".png"))).sort();
@@ -19798,8 +20248,29 @@ function getSystemResources() {
19798
20248
  // ../engine/src/services/fileServer.ts
19799
20249
  import { Hono } from "hono";
19800
20250
  import { serve } from "@hono/node-server";
19801
- import { readFileSync as readFileSync9, openSync as openSync5, fstatSync, closeSync as closeSync5, statSync as statSync8, constants } from "fs";
20251
+ import { readFileSync as readFileSync9, openSync as openSync5, fstatSync, closeSync as closeSync5, statSync as statSync8, constants as constants2 } from "fs";
19802
20252
  import { join as join20, extname as extname3 } from "path";
20253
+
20254
+ // ../engine/src/utils/loopbackOnly.ts
20255
+ function isOwnLoopbackHost(host, port) {
20256
+ const name = host?.toLowerCase();
20257
+ return name === `127.0.0.1:${port}` || name === `localhost:${port}` || name === `[::1]:${port}`;
20258
+ }
20259
+ var SAME_ORIGIN_FRAMING_HEADERS = {
20260
+ "Content-Security-Policy": "frame-ancestors 'self'",
20261
+ "X-Frame-Options": "SAMEORIGIN"
20262
+ };
20263
+ function answerOwnLoopbackHostOnly(app, boundPort) {
20264
+ app.use(async function refuseForeignHostAndFraming(c, next) {
20265
+ if (!isOwnLoopbackHost(c.req.header("host"), boundPort())) return c.text("Forbidden", 403);
20266
+ await next();
20267
+ for (const [name, value] of Object.entries(SAME_ORIGIN_FRAMING_HEADERS)) {
20268
+ c.res.headers.set(name, value);
20269
+ }
20270
+ });
20271
+ }
20272
+
20273
+ // ../engine/src/services/fileServer.ts
19803
20274
  var MIME_TYPES = {
19804
20275
  ".html": "text/html; charset=utf-8",
19805
20276
  ".css": "text/css; charset=utf-8",
@@ -19831,7 +20302,7 @@ var MIME_TYPES = {
19831
20302
  function readRegularFile(filePath) {
19832
20303
  let fd;
19833
20304
  try {
19834
- fd = openSync5(filePath, constants.O_RDONLY | constants.O_NONBLOCK);
20305
+ fd = openSync5(filePath, constants2.O_RDONLY | constants2.O_NONBLOCK);
19835
20306
  } catch (error) {
19836
20307
  if (error instanceof Error && "code" in error && (error.code === "ENOENT" || error.code === "ENOTDIR"))
19837
20308
  return null;
@@ -19848,11 +20319,11 @@ function readRegularFile(filePath) {
19848
20319
  function resolveContainedPaths(projectDir, compiledDir, relativePath) {
19849
20320
  const projectPath = join20(projectDir, relativePath);
19850
20321
  if (!isWithinProjectRoot(projectDir, projectPath)) return null;
19851
- if (isPrivateFileUnder(projectDir, projectPath, isVcsOrSecretPath)) return null;
20322
+ if (isPrivateFileUnder(projectDir, projectPath, isStudioPrivatePath)) return null;
19852
20323
  if (!compiledDir) return { projectPath, compiledPath: null };
19853
20324
  const compiledPath = join20(compiledDir, relativePath);
19854
20325
  if (!isWithinProjectRoot(compiledDir, compiledPath)) return null;
19855
- if (isPrivateFileUnder(compiledDir, compiledPath, isVcsOrSecretPath)) return null;
20326
+ if (isPrivateFileUnder(compiledDir, compiledPath, isStudioPrivatePath)) return null;
19856
20327
  return { projectPath, compiledPath };
19857
20328
  }
19858
20329
  function createFileServer(options) {
@@ -19866,6 +20337,9 @@ function createFileServer(options) {
19866
20337
  const headScripts = options.headScripts ?? [];
19867
20338
  const bodyScripts = options.bodyScripts ?? [];
19868
20339
  const app = new Hono();
20340
+ let listeningPort = -1;
20341
+ const boundToLoopbackOnly = ["127.0.0.1", "localhost", "::1"].includes(hostname);
20342
+ if (boundToLoopbackOnly) answerOwnLoopbackHostOnly(app, () => listeningPort);
19869
20343
  app.get("/*", (c) => {
19870
20344
  let requestPath = c.req.path;
19871
20345
  if (requestPath === "/") requestPath = "/index.html";
@@ -19889,6 +20363,7 @@ function createFileServer(options) {
19889
20363
  return new Promise((resolve3) => {
19890
20364
  const server = serve({ fetch: app.fetch, port, hostname }, (info) => {
19891
20365
  const actualPort = info.port;
20366
+ listeningPort = actualPort;
19892
20367
  const url = `http://localhost:${actualPort}`;
19893
20368
  resolve3({
19894
20369
  url,
@@ -20238,6 +20713,7 @@ export {
20238
20713
  resolveExtractCacheDir,
20239
20714
  explainDrawElementDisabled,
20240
20715
  resolvePageNavigationTimeout,
20716
+ resolveRestrictPageNetwork,
20241
20717
  resolveConfig,
20242
20718
  shouldClampToScreenshotForConcreteGpu,
20243
20719
  applyConcreteGpuScreenshotClamp,
@@ -20408,6 +20884,7 @@ export {
20408
20884
  HF_AUDIO_GROUP_TAG,
20409
20885
  HF_AUDIO_GROUP_ATTR,
20410
20886
  isSelfOrAncestorHidden,
20887
+ isInsideAssetRoots,
20411
20888
  NOT_MEDIA_PAYLOAD,
20412
20889
  NotMediaPayloadError,
20413
20890
  fingerprintElementId,
@@ -20416,6 +20893,7 @@ export {
20416
20893
  playlistLeavesItsFolder,
20417
20894
  safeDownloadUrlIdentity,
20418
20895
  writeUrlDownloadTelemetry,
20896
+ isUrlNotPermittedError,
20419
20897
  assertPublicHttpsUrl,
20420
20898
  _setDownloadFetchForTests,
20421
20899
  fetchPublicHttpsBytes,
@@ -20423,6 +20901,7 @@ export {
20423
20901
  downloadToTemp,
20424
20902
  isHttpUrl,
20425
20903
  mediaIdPathSegment,
20904
+ privateCacheRoot,
20426
20905
  directorySizeBytes,
20427
20906
  gcExtractionCache,
20428
20907
  VIDEO_FRAME_FORMATS,
@@ -20487,6 +20966,9 @@ export {
20487
20966
  executeParallelCapture,
20488
20967
  mergeWorkerFrames,
20489
20968
  getSystemResources,
20969
+ isOwnLoopbackHost,
20970
+ SAME_ORIGIN_FRAMING_HEADERS,
20971
+ answerOwnLoopbackHostOnly,
20490
20972
  createFileServer,
20491
20973
  groupIntoLayers,
20492
20974
  diffGpuParityFrames,