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.
- package/dist/{add-Z6G2DLNE.js → add-OVHVUHQR.js} +26 -21
- package/dist/{agentPromptGenerator-RCTC2XXL.js → agentPromptGenerator-L2B3HMHF.js} +16 -21
- package/dist/{animatedGifPrep-X7KILCDI.js → animatedGifPrep-YMJH33FX.js} +19 -20
- package/dist/api.js +52 -51
- package/dist/{appHistory-DK2XI4EZ.js → appHistory-T3ZLA7QN.js} +4 -3
- package/dist/{asset-A3ENWWCU.js → asset-ORCN4EVH.js} +2 -2
- package/dist/{assetCataloger-TIMZTOYH.js → assetCataloger-X23VB66T.js} +17 -17
- package/dist/{audio-HMCUO2CV.js → audio-NHNXBUI2.js} +103 -74
- package/dist/{auth-NXR3QM4C.js → auth-DQDDXQFC.js} +5 -5
- package/dist/{autoUpdate-TY7P2Z4F.js → autoUpdate-LF7BJN34.js} +4 -2
- package/dist/{avatars-36MYJUPA.js → avatars-KFUMWRVX.js} +23 -21
- package/dist/{backgroundChecks-EWWJEGF6.js → backgroundChecks-Y6RHADW6.js} +5 -3
- package/dist/backgroundChecksWorker.js +5 -4
- package/dist/{batchRender-VKM4E7PI.js → batchRender-CMG4SVBX.js} +27 -8
- package/dist/{beats-Z4B4B4KM.js → beats-JXZBK7JI.js} +17 -17
- package/dist/{benchmark-PLGO2THH.js → benchmark-CLU6JUGY.js} +34 -16
- package/dist/{billing-ZIXACCLR.js → billing-5GMYFDMC.js} +23 -22
- package/dist/{browser-VZFBNASB.js → browser-S4R6LZMF.js} +13 -13
- package/dist/{bundleWithLocalizedFonts-XD2XDEQL.js → bundleWithLocalizedFonts-SFUFSBEU.js} +1 -1
- package/dist/{capture-BAFLHNDI.js → capture-A3FLQIDI.js} +32 -33
- package/dist/{capture-GC4F54XT.js → capture-NL7V23HG.js} +5 -5
- package/dist/{captureCompositionFrame-YBVEFKWM.js → captureCompositionFrame-R7GYVNTF.js} +22 -22
- package/dist/{captureFile-R5JZ7WRA.js → captureFile-LXMDM5TD.js} +3 -3
- package/dist/{catalog-LHOCJUO2.js → catalog-42I7W7AU.js} +26 -21
- package/dist/{catch-up-6FNQ6I7Q.js → catch-up-TFSQZQZD.js} +16 -15
- package/dist/{check-S7T5LE6V.js → check-CXRQZBLD.js} +59 -56
- package/dist/{checkAudio-AKOI4AWK.js → checkAudio-AJUH6RU6.js} +20 -20
- package/dist/{checkBrowser-NABXGNNM.js → checkBrowser-4BLSYI25.js} +52 -49
- package/dist/{chunk-47MEWWCO.js → chunk-26RTKW2U.js} +2 -2
- package/dist/{chunk-UAU4SIOQ.js → chunk-2PASB3PC.js} +8 -8
- package/dist/{chunk-ZG6BVWQ7.js → chunk-32DAUKF5.js} +4 -4
- package/dist/{chunk-YXQA6MKA.js → chunk-3IHRXHJQ.js} +4 -4
- package/dist/{chunk-PRG42HNH.js → chunk-3IUBSGD2.js} +2 -2
- package/dist/{chunk-GEIWJSWN.js → chunk-3NPZZT2K.js} +10 -10
- package/dist/{chunk-5B425ZB3.js → chunk-3NXY6O4X.js} +1 -1
- package/dist/{chunk-U7ZCBWNM.js → chunk-4IUOWNDS.js} +3 -3
- package/dist/{chunk-4OHV7UZZ.js → chunk-4NG5GSTO.js} +1 -1
- package/dist/{chunk-CIMOTEZB.js → chunk-4Q3Q4NFK.js} +4 -4
- package/dist/{chunk-KUZTIMY3.js → chunk-4WK4O5FI.js} +8 -8
- package/dist/{chunk-CIGQUDEV.js → chunk-4ZFNNWUX.js} +51 -16
- package/dist/{chunk-2MNSS7PH.js → chunk-5HJZGP54.js} +3 -3
- package/dist/{chunk-UX2KMUKC.js → chunk-5XLTJMCN.js} +10 -10
- package/dist/{chunk-YXR5MVBM.js → chunk-63ESYLBY.js} +2 -2
- package/dist/{chunk-MP4TEYUJ.js → chunk-6EMFSRTW.js} +4 -1
- package/dist/{chunk-S5EMQAKL.js → chunk-6SRBTOGD.js} +3 -3
- package/dist/{chunk-7RLMDAUO.js → chunk-6T4PB35F.js} +2 -1
- package/dist/{chunk-IB722ALN.js → chunk-73UFPVUC.js} +2 -2
- package/dist/{chunk-KLIVZ5VG.js → chunk-75TCOXNT.js} +1 -1
- package/dist/{chunk-C66O6A2J.js → chunk-77U3646W.js} +2 -2
- package/dist/{chunk-64T46P7K.js → chunk-7RGWVZOS.js} +3 -3
- package/dist/{chunk-MF53JVZ5.js → chunk-7RI3U46M.js} +1 -1
- package/dist/{chunk-G6QCHM2N.js → chunk-7WRLK2K4.js} +5 -5
- package/dist/{chunk-YPURY3MW.js → chunk-AROERRUJ.js} +2 -2
- package/dist/{chunk-MOTJT42J.js → chunk-ATKA5KHE.js} +15 -3
- package/dist/{chunk-Z2EKCD7H.js → chunk-AU4ZBCR3.js} +1 -1
- package/dist/{chunk-6NGJ55V5.js → chunk-AYESPEPQ.js} +2 -2
- package/dist/{chunk-FCNMU7LC.js → chunk-B5HSHXE2.js} +2 -2
- package/dist/{chunk-CDK23M57.js → chunk-B6AK5P2D.js} +9 -9
- package/dist/{chunk-UBHBB3TB.js → chunk-BBDWXUO3.js} +45 -53
- package/dist/{chunk-AMWWQXTC.js → chunk-BDWLBCTG.js} +7 -7
- package/dist/{chunk-NQ3NHCF6.js → chunk-BNONW4QT.js} +2 -2
- package/dist/{chunk-POGZYVM2.js → chunk-C7LNWZ7G.js} +9 -9
- package/dist/{chunk-WN4W76IQ.js → chunk-CAYQATCT.js} +1 -1
- package/dist/{chunk-TDQUQAW5.js → chunk-CBCB6GPL.js} +105 -41
- package/dist/{chunk-U3LWQGCD.js → chunk-CIYNUD7Q.js} +1 -1
- package/dist/{chunk-SQ64IEA7.js → chunk-CNZOKODL.js} +3 -3
- package/dist/{chunk-7VQ3RAKO.js → chunk-CWXJZB44.js} +19 -16
- package/dist/{chunk-J45SCYTD.js → chunk-D4EGZYDN.js} +8 -8
- package/dist/{chunk-ZW6ZUKBB.js → chunk-DOLVT6CH.js} +1 -1
- package/dist/{chunk-E2KJT7JR.js → chunk-DVTRMGYG.js} +2 -2
- package/dist/{chunk-I6SCA2ME.js → chunk-DWDCE4PO.js} +55 -26
- package/dist/{chunk-P37ZACC6.js → chunk-DXVK3NMV.js} +3 -3
- package/dist/{chunk-DPVXBVLL.js → chunk-DZWAYZG2.js} +6254 -6096
- package/dist/{chunk-HD5RVDL6.js → chunk-E2DHBP6C.js} +1 -1
- package/dist/{chunk-IU5DC4HP.js → chunk-E7T5SMDK.js} +44 -15
- package/dist/{chunk-HS7LT4PL.js → chunk-E7X54BVP.js} +1 -1
- package/dist/{chunk-DE7Q2LWF.js → chunk-EA5W2DWO.js} +2 -2
- package/dist/{chunk-4Q2HYZZK.js → chunk-EB4IWBBC.js} +58 -3
- package/dist/{chunk-B2ZZYISD.js → chunk-ECGNWHFE.js} +29 -6
- package/dist/{chunk-H4S3WY2N.js → chunk-EKANCN4D.js} +3 -3
- package/dist/{chunk-TI7JN55F.js → chunk-EKCGL4MV.js} +1 -1
- package/dist/{chunk-7SZ7QQJ3.js → chunk-ELA3IV4P.js} +2 -2
- package/dist/{chunk-SZGQU7EB.js → chunk-ER22SVLT.js} +1 -1
- package/dist/{chunk-I2UMQAOQ.js → chunk-EXXIFMUX.js} +1 -1
- package/dist/{chunk-UIIQA7DN.js → chunk-EZQJFCWA.js} +6 -3
- package/dist/{chunk-YJFIGFON.js → chunk-F64VFCVC.js} +2 -2
- package/dist/{chunk-UX4HQHMS.js → chunk-F7B2YDPM.js} +17 -13
- package/dist/{chunk-ETXOQXWT.js → chunk-FICKJQU2.js} +5 -5
- package/dist/{chunk-24M5C5EQ.js → chunk-FUPEHRNT.js} +2 -2
- package/dist/{chunk-VXX4S2PH.js → chunk-GA6QR6LN.js} +648 -166
- package/dist/{chunk-P27QDOID.js → chunk-GEUM7NDY.js} +2 -2
- package/dist/chunk-GIOLHGCC.js +181 -0
- package/dist/{chunk-RMO7KIFX.js → chunk-H2GJDFF6.js} +4 -4
- package/dist/{chunk-7GVHPY7W.js → chunk-H5KHQ6KS.js} +1 -1
- package/dist/{chunk-DYYAFCZH.js → chunk-H7DKHNBF.js} +1 -1
- package/dist/{chunk-DONVZZLV.js → chunk-HYO4DIYT.js} +1 -1
- package/dist/{chunk-O45HB74L.js → chunk-IB6FFEDH.js} +32 -28
- package/dist/{chunk-MI54IK7G.js → chunk-IEESWUIQ.js} +11 -2
- package/dist/{chunk-6MKM2RVL.js → chunk-IH2C53YV.js} +460 -1
- package/dist/{chunk-6MYO2IHD.js → chunk-IHXMN5YH.js} +7 -0
- package/dist/{chunk-YHJOTCTV.js → chunk-IJYIIHGK.js} +10 -5
- package/dist/{chunk-NFRKPLTJ.js → chunk-IR2GEREV.js} +1 -1
- package/dist/{chunk-PCH55NAO.js → chunk-JAAIW4JR.js} +1 -1
- package/dist/{chunk-WPC2FKNB.js → chunk-JRSBBFUU.js} +405 -175
- package/dist/{chunk-L2KUIV56.js → chunk-JSYLOPVJ.js} +1 -1
- package/dist/{chunk-DE3JRSGT.js → chunk-KCF6Q54R.js} +1 -1
- package/dist/{chunk-2AZMG6DR.js → chunk-KTLRJZFK.js} +7 -7
- package/dist/{chunk-XWK2RSD5.js → chunk-KWTTELUY.js} +2 -2
- package/dist/{chunk-UB44XZOI.js → chunk-KYUCSRZU.js} +1 -1
- package/dist/{chunk-MOR3H5FK.js → chunk-LKWWY6WN.js} +1 -1
- package/dist/{chunk-HT4FWRIT.js → chunk-LRXARA5O.js} +1 -1
- package/dist/chunk-MEGSQW2I.js +72 -0
- package/dist/{chunk-445BBSZS.js → chunk-MPU2CRFV.js} +4 -4
- package/dist/{chunk-IMNIW22F.js → chunk-N7M2SNAF.js} +2 -2
- package/dist/{chunk-MQGRMXFN.js → chunk-NCLBKHCX.js} +4 -4
- package/dist/{chunk-4Y5IDZOJ.js → chunk-NKAW4RVE.js} +4 -4
- package/dist/{chunk-CQ5VQNOD.js → chunk-NKUUNSII.js} +1 -1
- package/dist/{chunk-Z46RV43W.js → chunk-NRGNEP3R.js} +2 -2
- package/dist/{chunk-ZGWOCGSJ.js → chunk-O6E5HSVF.js} +2 -2
- package/dist/{chunk-RCTY7VNK.js → chunk-O7TIBLSJ.js} +15 -101
- package/dist/{chunk-M3BJEZ7E.js → chunk-OIO7YMBP.js} +44 -13
- package/dist/{chunk-QUUZ2BGC.js → chunk-ON3CGL3V.js} +1 -1
- package/dist/{chunk-LZTBL7SR.js → chunk-OSKSTJNQ.js} +12 -2
- package/dist/{chunk-22EEGJLH.js → chunk-OTWFSHYH.js} +85 -57
- package/dist/{chunk-NXDFCWF2.js → chunk-OWS4ZWEY.js} +1 -1
- package/dist/{chunk-4QFWV5GQ.js → chunk-P2ZMVHTF.js} +2 -1
- package/dist/{chunk-N36NHUGP.js → chunk-P4YIRU76.js} +1 -1
- package/dist/{chunk-7QM73IH2.js → chunk-PAA5FUUL.js} +4 -4
- package/dist/{chunk-6PXVXIC7.js → chunk-PLOVBMJF.js} +177 -69
- package/dist/{chunk-T6VQGCN3.js → chunk-PPLFDG7N.js} +9 -5
- package/dist/chunk-PXLGDX2S.js +104 -0
- package/dist/{chunk-LNZHSISH.js → chunk-Q3ESTCZH.js} +11 -11
- package/dist/{chunk-G55B5LP6.js → chunk-Q42L7V5T.js} +1 -1
- package/dist/{chunk-3LIMD4YP.js → chunk-QBN2W4T3.js} +6 -8
- package/dist/{chunk-ZXMZSU5Y.js → chunk-QGKRHG4Q.js} +15 -15
- package/dist/{chunk-LIPVGXPV.js → chunk-QKYGGUOQ.js} +4 -4
- package/dist/{chunk-JJLPGVTA.js → chunk-QONV77VI.js} +1 -1
- package/dist/{chunk-UFET7UTU.js → chunk-RBBWUYMG.js} +4 -4
- package/dist/{chunk-4FWR7OE3.js → chunk-RXSPJW77.js} +4 -4
- package/dist/{chunk-X3IULMVV.js → chunk-RZJ7BHXB.js} +1 -1
- package/dist/{chunk-7RHN6N5F.js → chunk-SDFGDNWV.js} +1 -1
- package/dist/{chunk-R64WJS45.js → chunk-SOMX57XG.js} +6 -6
- package/dist/{chunk-42JBYXIQ.js → chunk-SUG2AA33.js} +42 -26
- package/dist/{chunk-IZQDQ5AN.js → chunk-SULPT5X6.js} +53 -17
- package/dist/{chunk-VOJ3ICMF.js → chunk-SVIA7POL.js} +1 -1
- package/dist/chunk-SWAG64KW.js +367 -0
- package/dist/{chunk-DC7AOIHN.js → chunk-T5S7U5C6.js} +1 -1
- package/dist/{chunk-L56WTLQP.js → chunk-TM7D3NOR.js} +34 -15
- package/dist/{chunk-KCPIENND.js → chunk-TMV76KPG.js} +1 -1
- package/dist/{chunk-H4LCNEA2.js → chunk-TRAPS5WB.js} +195 -128
- package/dist/{chunk-M4E7CMYS.js → chunk-TW4DB2NK.js} +2 -2
- package/dist/{chunk-XHUFLQGD.js → chunk-UZJ7Y7WU.js} +3 -3
- package/dist/{chunk-M425BL2U.js → chunk-VCKUDUPN.js} +1 -1
- package/dist/{chunk-M6TIOPL5.js → chunk-VT2K6I4A.js} +3 -3
- package/dist/{chunk-QP7MQ43Y.js → chunk-WAAXVZIT.js} +3 -3
- package/dist/{chunk-4XETQ5LC.js → chunk-WPD7JH6F.js} +2 -2
- package/dist/{chunk-HLXZFHEY.js → chunk-WPSPW7SI.js} +6 -6
- package/dist/{chunk-RULKJFRT.js → chunk-X6TDH2OM.js} +1 -1
- package/dist/chunk-XGEJPKRY.js +5069 -0
- package/dist/{chunk-APT2TSYC.js → chunk-Y6UCMYJZ.js} +1 -1
- package/dist/{chunk-7PBJR7WI.js → chunk-YBLBI3O2.js} +1 -1
- package/dist/{chunk-WSZJS4QC.js → chunk-YNF3SH26.js} +61 -10
- package/dist/{chunk-YRXIEP35.js → chunk-YU5LSWA2.js} +90 -11
- package/dist/{chunk-RIHRYTNB.js → chunk-YUDWGRNZ.js} +15 -15
- package/dist/{chunk-MR7VKWYT.js → chunk-YVCPUVHV.js} +1 -1
- package/dist/{clean-Y6YIQRPM.js → clean-JK4VQMTH.js} +35 -34
- package/dist/cli.js +67 -66
- package/dist/{cloud-A5U7YYNA.js → cloud-JZ2WKHQG.js} +4 -4
- package/dist/{cloud-5C5SCK4H.js → cloud-LU4FVT33.js} +7 -6
- package/dist/{cloudrun-EULFHQQL.js → cloudrun-QBXSGBGX.js} +9 -9
- package/dist/{compare-6XCTMUF3.js → compare-YE5BTDCG.js} +50 -48
- package/dist/{compiler-DUG4GFRI.js → compiler-QEA5UQRG.js} +9 -9
- package/dist/{component-JDQIZSAL.js → component-MGT5ZJ4M.js} +3 -3
- package/dist/{compositions-HZDEOSRL.js → compositions-7OF6FDCH.js} +30 -23
- package/dist/{contactSheet-O3FOOHOX.js → contactSheet-CCHQAZLA.js} +4 -4
- package/dist/{curve-SE7ZAMI6.js → curve-JQLVUDXR.js} +20 -19
- package/dist/{cuts-AEFJGBFP.js → cuts-MCJP6LMJ.js} +21 -20
- package/dist/{delete-EQUQ7Z2K.js → delete-PUYEW3RJ.js} +11 -8
- package/dist/{deploy-NSLC6BYZ.js → deploy-M4XGMJM5.js} +2 -2
- package/dist/{describeProject-FTJBPDL3.js → describeProject-P7CBZ6NW.js} +17 -17
- package/dist/{destroy-4O4T3KL3.js → destroy-6XJWSH2A.js} +2 -2
- package/dist/{deterministicFonts-QY4KNTOU.js → deterministicFonts-OXGNMVJE.js} +5 -5
- package/dist/{diff-VJ3CS7YE.js → diff-BATSO64W.js} +46 -44
- package/dist/{dist-2YJCNIWI.js → dist-G6W7GKGP.js} +6 -6
- package/dist/{dist-MNFB4YKV.js → dist-PC3EMMET.js} +21 -21
- package/dist/{dist-MXWEGMRB.js → dist-T62DJJZX.js} +6 -6
- package/dist/{doctor-RR7SNO6X.js → doctor-ONTGSPYF.js} +28 -23
- package/dist/{dotEnv-33RDHX7P.js → dotEnv-RZ52L7X3.js} +5 -4
- package/dist/{energy-PN23W2UJ.js → energy-FNZICGW2.js} +21 -20
- package/dist/{events-5OLO73VJ.js → events-6TNBAVVY.js} +23 -22
- package/dist/{events-NR6UPBHG.js → events-ENJZNXWG.js} +5 -5
- package/dist/{events-4ECJEB2W.js → events-LBHSU7C2.js} +12 -12
- package/dist/{execute-TS3BP65F.js → execute-RXTEBACV.js} +42 -42
- package/dist/{extract-GCZ5HSEN.js → extract-F2CWTMLX.js} +21 -20
- package/dist/{face-QKMYBRV3.js → face-7HL4CP32.js} +22 -21
- package/dist/{feedback-3H43EK7N.js → feedback-4NDDMECH.js} +46 -33
- package/dist/{ffmpeg-JRNM74WY.js → ffmpeg-3LL345SO.js} +18 -18
- package/dist/{figma-JGP2UGGU.js → figma-474E54NB.js} +3 -3
- package/dist/fontLocalizeCli.js +24 -25
- package/dist/{frames-OYSWKB3F.js → frames-EZWGM7QQ.js} +23 -22
- package/dist/{generate-TDXLUFMR.js → generate-I75DZWDU.js} +36 -34
- package/dist/{get-UB2MNBYO.js → get-BHU6CBWO.js} +11 -8
- package/dist/{gpuPolicy-6CTTH3NY.js → gpuPolicy-6J2STCV2.js} +15 -15
- package/dist/{grade-compare-2DXT4RWV.js → grade-compare-D4TBMCBG.js} +49 -47
- package/dist/{gsapParser-L7TM3RGH.js → gsapParser-TSPNHW7F.js} +1 -1
- package/dist/hangReport.js +2 -1
- package/dist/{heifImagePrep-VDZVZ4G7.js → heifImagePrep-VLYGRKSS.js} +20 -21
- package/dist/{help-RGKY4DR4.js → help-2CUXKYJ6.js} +1 -1
- package/dist/{history-AVDXYNAP.js → history-LVAVYTAN.js} +19 -18
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +67 -67
- package/dist/hyperframes-player.global.js +3 -3
- package/dist/{info-NGTQABZC.js → info-SUZOEH6L.js} +29 -23
- package/dist/{init-C3EARHDW.js → init-XI5QN3A6.js} +46 -44
- package/dist/{ink-ISO3VXRQ.js → ink-OVDZOCQJ.js} +21 -20
- package/dist/{inspect-V6MPU5I5.js → inspect-INBCGPBD.js} +50 -47
- package/dist/{installer-FI6HT2FW.js → installer-JNQKFCTN.js} +10 -10
- package/dist/{keyframes-PTJDE47Y.js → keyframes-LYZJK4RH.js} +21 -17
- package/dist/{lambda-JTO5YD2I.js → lambda-DUDXZV6X.js} +21 -21
- package/dist/{layout-QMLEZP5T.js → layout-JKUJW6A4.js} +50 -47
- package/dist/{lint-6BWOQAW6.js → lint-NKDC7IJ2.js} +25 -19
- package/dist/{lintProject-G4MXY4YA.js → lintProject-5Z34NNS4.js} +6 -6
- package/dist/{list-7E4VD7JA.js → list-5HUMDJYL.js} +11 -8
- package/dist/{localPage-BQOYZAOW.js → localPage-RRBRFR4Y.js} +16 -16
- package/dist/{login-37MSZXCY.js → login-C3SHKITR.js} +6 -5
- package/dist/{logout-QGNBUJKS.js → logout-CCATTNTL.js} +2 -1
- package/dist/{look-5GXW3NVP.js → look-3TX2U4BE.js} +21 -20
- package/dist/{manager-TMKN4DX5.js → manager-45VB2G5F.js} +4 -4
- package/dist/{manager-J2IRAOR7.js → manager-MOR255LW.js} +16 -16
- package/dist/{measure-23IL23BL.js → measure-ZAKBHNGY.js} +11 -11
- package/dist/{media-treatment-7ODBREPX.js → media-treatment-QJ35DSED.js} +25 -24
- package/dist/{media-use-QJA6NB3V.js → media-use-YBKHJVXL.js} +12 -18
- package/dist/{models-2Z6SURXU.js → models-OQHKG7B4.js} +20 -20
- package/dist/{motionShot-CYS3L6FK.js → motionShot-TWQTREFH.js} +26 -26
- package/dist/{normalize-audio-6YVF4LED.js → normalize-audio-PXHPUOMD.js} +19 -19
- package/dist/{open-WQ6NRHCN.js → open-TVGO5KVF.js} +34 -27
- package/dist/{parakeetRunner-R7KK6ZHD.js → parakeetRunner-MVJMZSIG.js} +23 -23
- package/dist/{pipeline-HRCK2JQL.js → pipeline-4S5UE4O4.js} +18 -18
- package/dist/{plan-FQNKACYR.js → plan-AMBZUX55.js} +30 -30
- package/dist/{play-UJZBNX2O.js → play-KEAESNBM.js} +43 -39
- package/dist/{preflight-VIMLSE3I.js → preflight-K3CM3W55.js} +18 -18
- package/dist/{present-JIOVM3ZH.js → present-42WDBGBA.js} +35 -32
- package/dist/{preview-HCYGBEWR.js → preview-KSHBU7ZR.js} +43 -34
- package/dist/{probe-6YQA2ZZC.js → probe-TMSXGCL4.js} +21 -20
- package/dist/{producer-JIM74BGL.js → producer-KXRSJPJF.js} +1 -1
- package/dist/{projectConfig-VPL64JBD.js → projectConfig-LOHNVOJG.js} +13 -13
- package/dist/{publicNetwork-F3ZXSVOD.js → publicNetwork-GW7SVP7N.js} +1 -1
- package/dist/{publication-ST3VFFWM.js → publication-LYPU7NTZ.js} +8 -8
- package/dist/{publish-3TTCO4R4.js → publish-PYZXDQJW.js} +51 -38
- package/dist/{refresh-6ONVQ3WV.js → refresh-X5ZLKQO5.js} +2 -1
- package/dist/{remove-background-XTICO22L.js → remove-background-HVX52VOF.js} +19 -19
- package/dist/{render-PFBZJRAN.js → render-57ZYQ53S.js} +73 -62
- package/dist/{render-WYDOZEZ5.js → render-5KMA5P2U.js} +90 -57
- package/dist/{render-MG5MX45D.js → render-CM4MCNVA.js} +9 -9
- package/dist/{render-batch-C3XGAQGX.js → render-batch-URBBGOVC.js} +9 -9
- package/dist/renderSetupWorker.js +10 -10
- package/dist/{resolver-AGMKICJW.js → resolver-UPUCU4XT.js} +10 -10
- package/dist/{reverse-TV524NFW.js → reverse-UYS7KVE2.js} +1 -1
- package/dist/{run-NQBD5RDR.js → run-4LNEWQLG.js} +10 -6
- package/dist/{screenshotCapture-OUZMH7EQ.js → screenshotCapture-IF5AO5XM.js} +18 -18
- package/dist/{service-UIHDIMFM.js → service-OEOC34BD.js} +22 -21
- package/dist/{share-WD7MCA4I.js → share-NS7CMVSU.js} +25 -24
- package/dist/{sherpa-H67ZJICN.js → sherpa-QBTXL6JA.js} +22 -22
- package/dist/sherpaWorker.js +3 -3
- package/dist/skills/hyperframes-cli/references/cloud.md +1 -1
- package/dist/skills/media-use/audio/references/requirements.md +7 -7
- package/dist/skills/media-use/audio/references/tts.md +8 -6
- package/dist/skills/media-use/audio/scripts/lib/heygen.mjs +39 -13
- package/dist/skills/media-use/audio/scripts/lib/heygen.test.mjs +176 -2
- package/dist/skills/media-use/references/heygen.md +1 -1
- package/dist/{skills-7TUSQF6W.js → skills-S5U2MQAI.js} +16 -15
- package/dist/{skillsUpdateCheck-HF6SQWRA.js → skillsUpdateCheck-UZ7CZ6VC.js} +5 -3
- package/dist/{snapshot-P7ZSTKED.js → snapshot-YWFWQTAV.js} +118 -75
- package/dist/{src-H2EUJUV3.js → src-N2SMYJ44.js} +22 -23
- package/dist/{src-TQQ743H4.js → src-UQ3K3UW2.js} +31 -17
- package/dist/{start-7ZTAKHD4.js → start-4IA5GG5D.js} +34 -32
- package/dist/{staticProjectServer-X4PARIVN.js → staticProjectServer-5JP25RRX.js} +34 -33
- package/dist/{status-ELQXIXIB.js → status-ITCKXFBF.js} +25 -24
- package/dist/studio/assets/{hyperframes-player-D7LhzIg1.js → hyperframes-player-Oju91F6x.js} +2 -2
- package/dist/studio/assets/{index-D3WxJaqm.js → index-B0VEzzD2.js} +180 -180
- package/dist/studio/assets/index-Dv67Vrl6.js +74 -0
- package/dist/studio/assets/{index-CQ7o0CBU.js → index-XEm_N45R.js} +1 -1
- package/dist/studio/assets/{pausedVideoDecoder-BVUmBgn0.js → pausedVideoDecoder-p6zibxVM.js} +1 -1
- package/dist/studio/index.html +1 -1
- package/dist/{studio-api-OJEU24EG.js → studio-api-GENM2XVL.js} +21 -21
- package/dist/{studioServer-E5CLZC46.js → studioServer-SWR5Q3PD.js} +90 -77
- package/dist/{sync-VEJWMKDP.js → sync-CK6TTCXO.js} +21 -20
- package/dist/{synthesize-HOLHQCR2.js → synthesize-EXNEBJSY.js} +5 -5
- package/dist/{system-I5KGZTUG.js → system-JBPJHNTG.js} +3 -3
- package/dist/{telemetry-3U4UGQ5V.js → telemetry-T4HQ6AKZ.js} +12 -12
- package/dist/{templates-AUAOWIYA.js → templates-7O7NOIUC.js} +23 -22
- package/dist/{timeline-YO27AP66.js → timeline-P2PLN53O.js} +33 -32
- package/dist/{tokens-UXLQGLVG.js → tokens-SPQN27VG.js} +2 -2
- package/dist/{transcribe-FZ3TE4FK.js → transcribe-SCZG6IM4.js} +19 -19
- package/dist/{transcribe-I7MTUH4M.js → transcribe-YJQ3DDDI.js} +40 -39
- package/dist/{tts-3VHEX4RB.js → tts-5OAB5XX6.js} +1 -1
- package/dist/{update-KBKSO3SH.js → update-JYPZW35A.js} +18 -17
- package/dist/{updateCheck-MUYN55HR.js → updateCheck-5M2JJTH3.js} +4 -2
- package/dist/{upgrade-CRCX7CCK.js → upgrade-BP62FM6V.js} +7 -5
- package/dist/{urlDownloader-4EM6GLN4.js → urlDownloader-WOZQCE6P.js} +14 -14
- package/dist/{validate-Y2KF2DU3.js → validate-NEC5QLH7.js} +40 -39
- package/dist/{video-HG6SINBD.js → video-XEEBISSO.js} +17 -17
- package/dist/{voices-O4UHHFZS.js → voices-GCHA27JA.js} +34 -32
- package/dist/warmCheck.js +59 -57
- package/dist/warmCheckClient.js +2 -1
- package/package.json +1 -1
- package/dist/chunk-DQZRNGDS.js +0 -5069
- package/dist/chunk-IGLEPPTN.js +0 -24
- package/dist/chunk-L2U4ISSS.js +0 -93
- package/dist/studio/assets/index-BX3KHhGX.js +0 -71
|
@@ -11,12 +11,12 @@ import {
|
|
|
11
11
|
iterateFontFamilyDeclarations,
|
|
12
12
|
normalizeSystemFontPrimaryFamilies,
|
|
13
13
|
resolveFontFamilyDeclarationFamilies
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-YU5LSWA2.js";
|
|
15
15
|
import {
|
|
16
16
|
Semaphore,
|
|
17
17
|
prepareHeifImageInputs,
|
|
18
18
|
withMediaProbeSlot
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-7RGWVZOS.js";
|
|
20
20
|
import {
|
|
21
21
|
EncoderInterruptedError,
|
|
22
22
|
encoderFailureError,
|
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
refusesOutsideLink,
|
|
31
31
|
resolveRenderPaths,
|
|
32
32
|
toExternalAssetKey
|
|
33
|
-
} from "./chunk-
|
|
33
|
+
} from "./chunk-KTLRJZFK.js";
|
|
34
34
|
import {
|
|
35
35
|
createStudioPositionSeekReapplyScript,
|
|
36
36
|
openRangeEnd,
|
|
@@ -38,7 +38,7 @@ import {
|
|
|
38
38
|
} from "./chunk-LD6JONPV.js";
|
|
39
39
|
import {
|
|
40
40
|
RENDER_TEMP_DIR
|
|
41
|
-
} from "./chunk-
|
|
41
|
+
} from "./chunk-ER22SVLT.js";
|
|
42
42
|
import {
|
|
43
43
|
BROWSER_GPU_NOT_SOFTWARE,
|
|
44
44
|
CaptureFailure,
|
|
@@ -57,6 +57,7 @@ import {
|
|
|
57
57
|
aacSegmentCount,
|
|
58
58
|
analyzeCompositionHdr,
|
|
59
59
|
analyzeKeyframeIntervals,
|
|
60
|
+
answerOwnLoopbackHostOnly,
|
|
60
61
|
appendRateCapArgs,
|
|
61
62
|
appendRenderProvenanceArgs,
|
|
62
63
|
appendSoftwareEncoderThreadsArg,
|
|
@@ -140,11 +141,13 @@ import {
|
|
|
140
141
|
isDrawElementVerificationError,
|
|
141
142
|
isHdrColorSpace,
|
|
142
143
|
isHttpUrl,
|
|
144
|
+
isInsideAssetRoots,
|
|
143
145
|
isMemoryExhaustionError,
|
|
144
146
|
isNotMediaPayload,
|
|
145
147
|
isProresProfile,
|
|
146
148
|
isSelfOrAncestorHidden,
|
|
147
149
|
isTransientBrowserError,
|
|
150
|
+
isUrlNotPermittedError,
|
|
148
151
|
isVideoFrameFormat,
|
|
149
152
|
isVideoHiddenBeforeStreamStart,
|
|
150
153
|
isVideoPastTimelineEnd,
|
|
@@ -164,6 +167,7 @@ import {
|
|
|
164
167
|
parseVideoElements,
|
|
165
168
|
playlistLeavesItsFolder,
|
|
166
169
|
prepareCaptureSessionForReuse,
|
|
170
|
+
privateCacheRoot,
|
|
167
171
|
probeBeginFrameLiveness,
|
|
168
172
|
probeMediaProfile,
|
|
169
173
|
processCompositionAudio,
|
|
@@ -184,6 +188,7 @@ import {
|
|
|
184
188
|
resolveFrameFormat,
|
|
185
189
|
resolveHeadlessShellPath,
|
|
186
190
|
resolvePlayableVideoDuration,
|
|
191
|
+
resolveRestrictPageNetwork,
|
|
187
192
|
resolveVideoExtractionWindow,
|
|
188
193
|
runFfmpeg,
|
|
189
194
|
runVideoExtractionWithRetry,
|
|
@@ -198,11 +203,12 @@ import {
|
|
|
198
203
|
verifyDiskDrawElementSamples,
|
|
199
204
|
videoAudioId,
|
|
200
205
|
videoStartOnMediaTimeline,
|
|
201
|
-
writeCapturedFrame
|
|
202
|
-
|
|
206
|
+
writeCapturedFrame,
|
|
207
|
+
writeUrlDownloadTelemetry
|
|
208
|
+
} from "./chunk-GA6QR6LN.js";
|
|
203
209
|
import {
|
|
204
210
|
settleOnBrowserSafePort
|
|
205
|
-
} from "./chunk-
|
|
211
|
+
} from "./chunk-OSKSTJNQ.js";
|
|
206
212
|
import {
|
|
207
213
|
assignBundledRuntimeCompositionIds,
|
|
208
214
|
boundMediaSrc,
|
|
@@ -215,14 +221,14 @@ import {
|
|
|
215
221
|
parsesAsScript,
|
|
216
222
|
prepareFlattenedInnerRoot,
|
|
217
223
|
stripSdrPngColourTags
|
|
218
|
-
} from "./chunk-
|
|
224
|
+
} from "./chunk-BBDWXUO3.js";
|
|
219
225
|
import {
|
|
220
226
|
cannotHardLink,
|
|
221
227
|
collectScratchLeftovers,
|
|
222
228
|
createStagingDir,
|
|
223
229
|
removeScratch,
|
|
224
230
|
renameWithRetry
|
|
225
|
-
} from "./chunk-
|
|
231
|
+
} from "./chunk-KCF6Q54R.js";
|
|
226
232
|
import {
|
|
227
233
|
TRANSITIONS,
|
|
228
234
|
convertTransfer,
|
|
@@ -245,7 +251,7 @@ import {
|
|
|
245
251
|
redactTelemetryString,
|
|
246
252
|
resolveAuthoredTimingWindow,
|
|
247
253
|
toFps
|
|
248
|
-
} from "./chunk-
|
|
254
|
+
} from "./chunk-4IUOWNDS.js";
|
|
249
255
|
import {
|
|
250
256
|
CAPTURE_CANVAS_SELECTOR,
|
|
251
257
|
COMPOSITION_SOURCE_URL,
|
|
@@ -281,19 +287,19 @@ import {
|
|
|
281
287
|
sourceTimeAt,
|
|
282
288
|
styleElementsFor,
|
|
283
289
|
timeAtSourceTime
|
|
284
|
-
} from "./chunk-
|
|
290
|
+
} from "./chunk-XGEJPKRY.js";
|
|
285
291
|
import {
|
|
286
292
|
isPrivateFileUnder,
|
|
287
293
|
isSafePath,
|
|
288
|
-
|
|
289
|
-
} from "./chunk-
|
|
294
|
+
isStudioPrivatePath
|
|
295
|
+
} from "./chunk-KWTTELUY.js";
|
|
290
296
|
import {
|
|
291
297
|
chromeMajorCeiling
|
|
292
298
|
} from "./chunk-LEIR7IDJ.js";
|
|
293
299
|
import {
|
|
294
300
|
lintHyperframeHtml,
|
|
295
301
|
resolveReferencedStart
|
|
296
|
-
} from "./chunk-
|
|
302
|
+
} from "./chunk-TRAPS5WB.js";
|
|
297
303
|
import {
|
|
298
304
|
isUnresolvedAssetPlaceholder,
|
|
299
305
|
namesAnotherNetworkRoot,
|
|
@@ -301,31 +307,41 @@ import {
|
|
|
301
307
|
readTextFile,
|
|
302
308
|
resolveCompositionSrc,
|
|
303
309
|
resolveProjectRelativeSrc
|
|
304
|
-
} from "./chunk-
|
|
310
|
+
} from "./chunk-6EMFSRTW.js";
|
|
305
311
|
import {
|
|
306
312
|
LOW_MEMORY_TOTAL_MB_THRESHOLD,
|
|
307
313
|
getCgroupMemoryLimitMb,
|
|
308
314
|
getSystemTotalMb,
|
|
309
315
|
hostCpuCount,
|
|
310
316
|
usableCpuCount
|
|
311
|
-
} from "./chunk-
|
|
317
|
+
} from "./chunk-CIYNUD7Q.js";
|
|
312
318
|
import {
|
|
313
|
-
CSS_URL_RE,
|
|
314
319
|
MEDIA_START_BASIS_ATTR,
|
|
315
320
|
checkSubCompositionUsability,
|
|
316
321
|
compositionOriginSeconds,
|
|
322
|
+
cssRuleMatches,
|
|
323
|
+
cssUrlMatches,
|
|
317
324
|
cutToHostSlots,
|
|
318
325
|
decodedUrlPath,
|
|
326
|
+
fontFaceBlockMatches,
|
|
327
|
+
hasBackgroundImageDeclaration,
|
|
319
328
|
hostInPointSeconds,
|
|
329
|
+
importRuleMatches,
|
|
320
330
|
isNonRelativeUrl,
|
|
331
|
+
localFontFaceUrlMatches,
|
|
321
332
|
readMediaStartBasis,
|
|
322
333
|
readPlaybackRate,
|
|
334
|
+
remoteBackgroundUrlMatches,
|
|
335
|
+
remoteFontFaceUrlMatches,
|
|
336
|
+
replaceMatches,
|
|
323
337
|
resolveAbsoluteMediaStartSeconds,
|
|
324
338
|
rewriteAssetPath,
|
|
325
339
|
rewriteAssetPaths,
|
|
326
340
|
rewriteCssAssetUrls,
|
|
327
|
-
rewriteInlineStyleAssetUrls
|
|
328
|
-
|
|
341
|
+
rewriteInlineStyleAssetUrls,
|
|
342
|
+
styleBlockMatches,
|
|
343
|
+
stylesheetLinkMatches
|
|
344
|
+
} from "./chunk-IH2C53YV.js";
|
|
329
345
|
import {
|
|
330
346
|
CANVAS_DIMENSIONS,
|
|
331
347
|
HTML_BODY_CSS_HEIGHT_FIRST_RE,
|
|
@@ -336,7 +352,7 @@ import {
|
|
|
336
352
|
isAspectAgnosticResolutionAlias,
|
|
337
353
|
normalizeResolutionFlag,
|
|
338
354
|
suggestMatchingPreset
|
|
339
|
-
} from "./chunk-
|
|
355
|
+
} from "./chunk-VCKUDUPN.js";
|
|
340
356
|
import {
|
|
341
357
|
parseHTML
|
|
342
358
|
} from "./chunk-GWTIFRF5.js";
|
|
@@ -353,7 +369,7 @@ import {
|
|
|
353
369
|
appendFileSync
|
|
354
370
|
} from "fs";
|
|
355
371
|
import { tmpdir as tmpdir2 } from "os";
|
|
356
|
-
import { join as join29, dirname as
|
|
372
|
+
import { join as join29, dirname as dirname12, resolve as resolve6 } from "path";
|
|
357
373
|
import { totalmem as totalmem2 } from "os";
|
|
358
374
|
import { randomUUID } from "crypto";
|
|
359
375
|
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
@@ -521,6 +537,7 @@ var MIME_TYPES = {
|
|
|
521
537
|
".css": "text/css; charset=utf-8",
|
|
522
538
|
".js": "application/javascript; charset=utf-8",
|
|
523
539
|
".mjs": "application/javascript; charset=utf-8",
|
|
540
|
+
".cjs": "application/javascript; charset=utf-8",
|
|
524
541
|
".json": "application/json; charset=utf-8",
|
|
525
542
|
".cube": "text/plain; charset=utf-8",
|
|
526
543
|
".png": "image/png",
|
|
@@ -1064,6 +1081,12 @@ function createFileServer(options) {
|
|
|
1064
1081
|
const bodyScripts = options.bodyScripts ?? [buildRenderModeScript(options.fps), HF_BRIDGE_SCRIPT];
|
|
1065
1082
|
const app = new Hono();
|
|
1066
1083
|
const warnLeftOut = (line) => console.warn(`[FileServer] ${line}`);
|
|
1084
|
+
let listeningPort = -1;
|
|
1085
|
+
app.use(async function loadEachFileOnlyAsItsNamedType(c, next) {
|
|
1086
|
+
await next();
|
|
1087
|
+
c.res.headers.set("X-Content-Type-Options", "nosniff");
|
|
1088
|
+
});
|
|
1089
|
+
answerOwnLoopbackHostOnly(app, () => listeningPort);
|
|
1067
1090
|
app.get("/*", async (c) => {
|
|
1068
1091
|
let requestPath = c.req.path;
|
|
1069
1092
|
if (requestPath === "/") requestPath = "/index.html";
|
|
@@ -1073,7 +1096,7 @@ function createFileServer(options) {
|
|
|
1073
1096
|
const candidate = join(root, relativePath);
|
|
1074
1097
|
const resolveSymlinks = !allowOutsideProjectAssets && root !== compiledDir;
|
|
1075
1098
|
if (!isPathInside2(candidate, root, { resolveSymlinks })) continue;
|
|
1076
|
-
if (isPrivateFileUnder(root, candidate,
|
|
1099
|
+
if (isPrivateFileUnder(root, candidate, isStudioPrivatePath)) continue;
|
|
1077
1100
|
const checksLinks = allowOutsideProjectAssets && root !== compiledDir;
|
|
1078
1101
|
if (checksLinks && refusesOutsideLink(root, candidate, warnLeftOut)) continue;
|
|
1079
1102
|
file = openRegularFile(candidate);
|
|
@@ -1159,6 +1182,7 @@ function createFileServer(options) {
|
|
|
1159
1182
|
const server = serve({ fetch: app.fetch, port, hostname: "127.0.0.1" }, (info) => {
|
|
1160
1183
|
const bound = port === 0 ? settleOnBrowserSafePort(server, "127.0.0.1") : Promise.resolve(info.port);
|
|
1161
1184
|
bound.then((boundPort) => {
|
|
1185
|
+
listeningPort = boundPort;
|
|
1162
1186
|
resolve11({
|
|
1163
1187
|
url: `http://localhost:${boundPort}`,
|
|
1164
1188
|
port: boundPort,
|
|
@@ -1311,6 +1335,9 @@ import {
|
|
|
1311
1335
|
writeFileSync
|
|
1312
1336
|
} from "fs";
|
|
1313
1337
|
import { basename, dirname as dirname2, isAbsolute, join as join2, relative, resolve as resolve3 } from "path";
|
|
1338
|
+
function audioWorkDir(workDir) {
|
|
1339
|
+
return join2(workDir, "audio-work");
|
|
1340
|
+
}
|
|
1314
1341
|
var BROWSER_MEDIA_EPSILON = 1e-4;
|
|
1315
1342
|
function resolveBrowserMediaEnd(start, end, duration) {
|
|
1316
1343
|
return Number.isFinite(duration) && duration > 0 ? start + duration : end;
|
|
@@ -6557,7 +6584,7 @@ import { join as join17, relative as relative3 } from "path";
|
|
|
6557
6584
|
// ../producer/src/services/htmlCompiler.ts
|
|
6558
6585
|
import { createHash as createHash4 } from "crypto";
|
|
6559
6586
|
import { createReadStream as createReadStream2, existsSync as existsSync10, mkdirSync as mkdirSync7, readFileSync as readFileSync6 } from "fs";
|
|
6560
|
-
import { join as join16, dirname as
|
|
6587
|
+
import { join as join16, dirname as dirname7, resolve as resolve5, basename as basename4, relative as relative2, sep as sep2 } from "path";
|
|
6561
6588
|
|
|
6562
6589
|
// ../producer/src/services/bundledScripts.ts
|
|
6563
6590
|
import { existsSync as existsSync8, readFileSync as readFileSync5 } from "fs";
|
|
@@ -6718,7 +6745,7 @@ function getPositionEditsRenderScript() {
|
|
|
6718
6745
|
|
|
6719
6746
|
// ../producer/src/services/assetMediaType.ts
|
|
6720
6747
|
import { existsSync as existsSync9 } from "fs";
|
|
6721
|
-
import { join as join15 } from "path";
|
|
6748
|
+
import { dirname as dirname6, join as join15 } from "path";
|
|
6722
6749
|
var ASSET_MEDIA_TYPE_MISMATCH = "ASSET_MEDIA_TYPE_MISMATCH";
|
|
6723
6750
|
var AssetMediaTypeMismatchError = class extends Error {
|
|
6724
6751
|
// fallow-ignore-next-line unused-class-member
|
|
@@ -6758,17 +6785,17 @@ function assertAssetMediaTypeProfile(expected, profile, elementIdentity) {
|
|
|
6758
6785
|
}
|
|
6759
6786
|
]);
|
|
6760
6787
|
}
|
|
6761
|
-
function
|
|
6762
|
-
return
|
|
6788
|
+
function mediaAssetRoots(projectDir, compiledDir) {
|
|
6789
|
+
return [projectDir, compiledDir, join15(dirname6(compiledDir), "downloads")];
|
|
6763
6790
|
}
|
|
6764
6791
|
function dropMediaOutsideProject(input) {
|
|
6765
6792
|
const { projectDir, workDir, composition, log } = input;
|
|
6766
6793
|
const compiledDir = join15(workDir, "compiled");
|
|
6767
|
-
const roots =
|
|
6794
|
+
const roots = mediaAssetRoots(projectDir, compiledDir);
|
|
6768
6795
|
const staysInside = ({ id, src }) => {
|
|
6769
|
-
if (!src ||
|
|
6796
|
+
if (!src || isHttpUrl(src)) return true;
|
|
6770
6797
|
const path = resolveProjectRelativeSrc(src, projectDir, compiledDir);
|
|
6771
|
-
if (
|
|
6798
|
+
if (isInsideAssetRoots(path, roots)) return true;
|
|
6772
6799
|
if (input.allowOutsideProjectAssets) {
|
|
6773
6800
|
const refusal = outsideAssetRefusal(projectDir, path);
|
|
6774
6801
|
if (refusal) log.warn(`[Render] ${leftOutOfRender(`Media "${id}"`, src, refusal)}`);
|
|
@@ -6806,7 +6833,7 @@ async function preflightCompositionAssetMediaTypes(input) {
|
|
|
6806
6833
|
];
|
|
6807
6834
|
const byPath = /* @__PURE__ */ new Map();
|
|
6808
6835
|
for (const reference of references) {
|
|
6809
|
-
if (!reference.src ||
|
|
6836
|
+
if (!reference.src || isHttpUrl(reference.src)) continue;
|
|
6810
6837
|
const resolvedPath = resolveProjectRelativeSrc(
|
|
6811
6838
|
reference.src,
|
|
6812
6839
|
input.projectDir,
|
|
@@ -6906,11 +6933,17 @@ function normalizeCompositionSrcs(html, projectDir) {
|
|
|
6906
6933
|
return `${name}${quote}${relative2(projectDir, file).split(sep2).join("/")}${quote}`;
|
|
6907
6934
|
});
|
|
6908
6935
|
}
|
|
6909
|
-
|
|
6936
|
+
var COMPOSITION_FILE = /\.html?$/i;
|
|
6937
|
+
var NOT_A_COMPOSITION_FILE = "it is not an .html file, so it is refused";
|
|
6938
|
+
function resolveCompositionPath(projectDir, src, assetRoot) {
|
|
6910
6939
|
const file = resolveCompositionSrc(projectDir, src);
|
|
6911
6940
|
return file === null || escapesAssetRoot(file, assetRoot) ? null : file;
|
|
6912
6941
|
}
|
|
6913
|
-
|
|
6942
|
+
function resolveCompositionFile(projectDir, src, assetRoot) {
|
|
6943
|
+
const file = resolveCompositionPath(projectDir, src, assetRoot);
|
|
6944
|
+
return file !== null && COMPOSITION_FILE.test(file) ? file : null;
|
|
6945
|
+
}
|
|
6946
|
+
var isPrivateCompositionFile = (projectDir, filePath) => isPrivateFileUnder(projectDir, filePath, isStudioPrivatePath);
|
|
6914
6947
|
function assertSubCompositionsUsable(html, projectDir, assetRoot, visited = /* @__PURE__ */ new Set()) {
|
|
6915
6948
|
const { document: document2 } = parseHTML(html);
|
|
6916
6949
|
const hosts = [...document2.querySelectorAll("[data-composition-src]")];
|
|
@@ -6919,7 +6952,7 @@ function assertSubCompositionsUsable(html, projectDir, assetRoot, visited = /* @
|
|
|
6919
6952
|
const srcPath = el.getAttribute("data-composition-src");
|
|
6920
6953
|
if (!srcPath) continue;
|
|
6921
6954
|
if (isUnresolvedAssetPlaceholder(srcPath)) continue;
|
|
6922
|
-
const filePath =
|
|
6955
|
+
const filePath = resolveCompositionPath(projectDir, srcPath, assetRoot);
|
|
6923
6956
|
if (filePath === null) {
|
|
6924
6957
|
problems.push({ srcPath, detail: "it is outside the project folder" });
|
|
6925
6958
|
continue;
|
|
@@ -6929,7 +6962,14 @@ function assertSubCompositionsUsable(html, projectDir, assetRoot, visited = /* @
|
|
|
6929
6962
|
continue;
|
|
6930
6963
|
}
|
|
6931
6964
|
if (isPrivateCompositionFile(projectDir, filePath)) {
|
|
6932
|
-
problems.push({
|
|
6965
|
+
problems.push({
|
|
6966
|
+
srcPath,
|
|
6967
|
+
detail: "it is git metadata, an env file or a private tool record"
|
|
6968
|
+
});
|
|
6969
|
+
continue;
|
|
6970
|
+
}
|
|
6971
|
+
if (!COMPOSITION_FILE.test(filePath)) {
|
|
6972
|
+
problems.push({ srcPath, detail: NOT_A_COMPOSITION_FILE });
|
|
6933
6973
|
continue;
|
|
6934
6974
|
}
|
|
6935
6975
|
if (visited.has(filePath)) continue;
|
|
@@ -7027,7 +7067,6 @@ var THREE_D_CONTEXT_PATTERN = /transform-style\s*:\s*preserve-3d|backface-visibi
|
|
|
7027
7067
|
function detectThreeDTransformUsage(html) {
|
|
7028
7068
|
return THREE_D_CONTEXT_PATTERN.test(html);
|
|
7029
7069
|
}
|
|
7030
|
-
var BACKGROUND_IMAGE_DECL_PATTERN = /(?:^|;|\{)\s*background(?:-image)?\s*:[^;}]*(?:\bgradient\s*\(|url\s*\()/i;
|
|
7031
7070
|
function detectAncestorBackgroundImage(html) {
|
|
7032
7071
|
const { document: document2 } = parseHTML(html);
|
|
7033
7072
|
const root = document2.querySelector("[data-composition-id]");
|
|
@@ -7039,13 +7078,13 @@ function detectAncestorBackgroundImage(html) {
|
|
|
7039
7078
|
}
|
|
7040
7079
|
for (const el of ancestors) {
|
|
7041
7080
|
const style = el.getAttribute("style");
|
|
7042
|
-
if (style &&
|
|
7081
|
+
if (style && hasBackgroundImageDeclaration(`{${style}}`)) return true;
|
|
7043
7082
|
}
|
|
7044
7083
|
for (const styleEl of document2.querySelectorAll("style")) {
|
|
7045
7084
|
const css = styleEl.textContent ?? "";
|
|
7046
|
-
for (const rule of css
|
|
7047
|
-
const [, selectorList
|
|
7048
|
-
if (!
|
|
7085
|
+
for (const { parts: rule } of cssRuleMatches(css)) {
|
|
7086
|
+
const [, selectorList, declarations] = rule;
|
|
7087
|
+
if (!hasBackgroundImageDeclaration(`{${declarations}}`)) continue;
|
|
7049
7088
|
for (const selector of selectorList.split(",")) {
|
|
7050
7089
|
const sel = selector.trim();
|
|
7051
7090
|
if (!sel || sel.startsWith("@")) continue;
|
|
@@ -7255,7 +7294,7 @@ async function parseSubCompositions(html, projectDir, downloadDir, visited = /*
|
|
|
7255
7294
|
workItems.map(async (item) => {
|
|
7256
7295
|
const { html: compiledSub } = await compileHtmlFile(
|
|
7257
7296
|
rewriteUnresolvableGsapToCdn(item.rawSubHtml, projectDir, item.srcPath),
|
|
7258
|
-
|
|
7297
|
+
dirname7(item.filePath),
|
|
7259
7298
|
downloadDir,
|
|
7260
7299
|
void 0,
|
|
7261
7300
|
urlByAbsentLocalPath,
|
|
@@ -7366,7 +7405,6 @@ function coalesceHeadStylesAndBodyScripts(html) {
|
|
|
7366
7405
|
el.textContent = dedupedStyles[i] ?? "";
|
|
7367
7406
|
});
|
|
7368
7407
|
const styleEls = head ? Array.from(head.querySelectorAll("style")) : [];
|
|
7369
|
-
const importRe = /@import\s+url\([^)]*\)\s*;|@import\s+["'][^"']+["']\s*;/gi;
|
|
7370
7408
|
for (const run of styleEls.length > 1 ? headStyleRuns(styleEls) : []) {
|
|
7371
7409
|
const imports = [];
|
|
7372
7410
|
const cssParts = [];
|
|
@@ -7374,7 +7412,7 @@ function coalesceHeadStylesAndBodyScripts(html) {
|
|
|
7374
7412
|
for (const el of run) {
|
|
7375
7413
|
const raw = (el.textContent || "").trim();
|
|
7376
7414
|
if (!raw) continue;
|
|
7377
|
-
const nonImportCss = raw
|
|
7415
|
+
const nonImportCss = replaceMatches(raw, importRuleMatches(raw), (match) => {
|
|
7378
7416
|
const cleaned = match.trim();
|
|
7379
7417
|
if (!seenImports.has(cleaned)) {
|
|
7380
7418
|
seenImports.add(cleaned);
|
|
@@ -7684,7 +7722,7 @@ function collectExternalAssets(html, projectDir, log = defaultLogger, file = "in
|
|
|
7684
7722
|
for (const styleEl of document2.querySelectorAll("style")) {
|
|
7685
7723
|
const css = styleEl.textContent || "";
|
|
7686
7724
|
if (!css.includes("url(")) continue;
|
|
7687
|
-
const rewritten = css
|
|
7725
|
+
const rewritten = replaceMatches(css, cssUrlMatches(css), (full, quote, rawUrl) => {
|
|
7688
7726
|
const result = processPath((rawUrl || "").trim());
|
|
7689
7727
|
if (!result) return full;
|
|
7690
7728
|
return `url(${quote || ""}${result}${quote || ""})`;
|
|
@@ -7694,7 +7732,7 @@ function collectExternalAssets(html, projectDir, log = defaultLogger, file = "in
|
|
|
7694
7732
|
for (const el of document2.querySelectorAll("[style]")) {
|
|
7695
7733
|
const style = el.getAttribute("style") || "";
|
|
7696
7734
|
if (!style.includes("url(")) continue;
|
|
7697
|
-
const rewritten = style
|
|
7735
|
+
const rewritten = replaceMatches(style, cssUrlMatches(style), (full, quote, rawUrl) => {
|
|
7698
7736
|
const result = processPath((rawUrl || "").trim());
|
|
7699
7737
|
if (!result) return full;
|
|
7700
7738
|
return `url(${quote || ""}${result}${quote || ""})`;
|
|
@@ -7797,13 +7835,10 @@ async function localizeRemoteImageSources(html, downloadDir) {
|
|
|
7797
7835
|
"Localized remote image source(s)"
|
|
7798
7836
|
);
|
|
7799
7837
|
}
|
|
7800
|
-
var REMOTE_BG_URL_RE = /background(?:-image)?\s*:\s*[^;}"']*?url\(\s*["']?(https?:\/\/[^"')]+)["']?\s*\)/gi;
|
|
7801
7838
|
async function localizeRemoteBackgroundImages(html, downloadDir) {
|
|
7802
7839
|
const urlSet = /* @__PURE__ */ new Set();
|
|
7803
|
-
const
|
|
7804
|
-
|
|
7805
|
-
while ((m = re.exec(html)) !== null) {
|
|
7806
|
-
if (m[1] && !isGoogleFontsUrl(m[1])) urlSet.add(m[1]);
|
|
7840
|
+
for (const { parts } of remoteBackgroundUrlMatches(html)) {
|
|
7841
|
+
if (parts[1] && !isGoogleFontsUrl(parts[1])) urlSet.add(parts[1]);
|
|
7807
7842
|
}
|
|
7808
7843
|
return downloadAndRewriteUrls(
|
|
7809
7844
|
urlSet,
|
|
@@ -7816,7 +7851,6 @@ async function localizeRemoteBackgroundImages(html, downloadDir) {
|
|
|
7816
7851
|
(h, url, rel) => h.replaceAll(`url(${url})`, `url(${rel})`)
|
|
7817
7852
|
);
|
|
7818
7853
|
}
|
|
7819
|
-
var REMOTE_FONTFACE_URL_RE = /url\(["']?(https?:\/\/[^"')]+)["']?\)/gi;
|
|
7820
7854
|
function isGoogleFontsUrl(href) {
|
|
7821
7855
|
try {
|
|
7822
7856
|
const host = new URL(href).hostname.toLowerCase();
|
|
@@ -7844,31 +7878,33 @@ async function fetchExternalStylesheetCss(href) {
|
|
|
7844
7878
|
}
|
|
7845
7879
|
function extractFontFaceBlocks(css) {
|
|
7846
7880
|
const blocks = [];
|
|
7881
|
+
const closes = matchingBraces(css);
|
|
7847
7882
|
const atRule = /@font-face\s*/gi;
|
|
7848
|
-
let
|
|
7849
|
-
|
|
7850
|
-
|
|
7851
|
-
if (
|
|
7852
|
-
|
|
7853
|
-
|
|
7854
|
-
|
|
7855
|
-
|
|
7856
|
-
else if (css[i] === "}") depth--;
|
|
7857
|
-
}
|
|
7858
|
-
if (depth === 0) {
|
|
7859
|
-
blocks.push(css.slice(m.index, i));
|
|
7860
|
-
atRule.lastIndex = i;
|
|
7861
|
-
}
|
|
7883
|
+
let open2 = -1;
|
|
7884
|
+
for (let m = atRule.exec(css); m; m = atRule.exec(css)) {
|
|
7885
|
+
if (open2 < atRule.lastIndex) open2 = css.indexOf("{", atRule.lastIndex);
|
|
7886
|
+
if (open2 === -1) break;
|
|
7887
|
+
const close = closes.get(open2);
|
|
7888
|
+
if (close === void 0) continue;
|
|
7889
|
+
blocks.push(css.slice(m.index, close + 1));
|
|
7890
|
+
atRule.lastIndex = close + 1;
|
|
7862
7891
|
}
|
|
7863
7892
|
return blocks;
|
|
7864
7893
|
}
|
|
7894
|
+
function matchingBraces(css) {
|
|
7895
|
+
const closes = /* @__PURE__ */ new Map();
|
|
7896
|
+
const unclosed = [];
|
|
7897
|
+
for (let i = 0; i < css.length; i++) {
|
|
7898
|
+
if (css[i] === "{") unclosed.push(i);
|
|
7899
|
+
else if (css[i] === "}" && unclosed.length > 0) closes.set(unclosed.pop(), i);
|
|
7900
|
+
}
|
|
7901
|
+
return closes;
|
|
7902
|
+
}
|
|
7865
7903
|
async function inlineExternalFontStylesheets(html) {
|
|
7866
|
-
const linkRe = /<link\b[^>]*\brel=["']stylesheet["'][^>]*>/gi;
|
|
7867
7904
|
const hrefRe = /\bhref=["']([^"']+)["']/i;
|
|
7868
7905
|
const linkMatches = [];
|
|
7869
|
-
|
|
7870
|
-
|
|
7871
|
-
const tag = linkMatch[0];
|
|
7906
|
+
for (const { parts } of stylesheetLinkMatches(html)) {
|
|
7907
|
+
const tag = parts[0];
|
|
7872
7908
|
const hrefMatch = hrefRe.exec(tag);
|
|
7873
7909
|
if (!hrefMatch?.[1]) continue;
|
|
7874
7910
|
const href = hrefMatch[1];
|
|
@@ -7909,16 +7945,18 @@ ${fontFaceBlocks.join("\n")}
|
|
|
7909
7945
|
}
|
|
7910
7946
|
function projectStylesheetFontFamilies(html, projectDir) {
|
|
7911
7947
|
const families = [];
|
|
7912
|
-
for (const
|
|
7948
|
+
for (const {
|
|
7949
|
+
parts: [tag]
|
|
7950
|
+
} of stylesheetLinkMatches(html)) {
|
|
7913
7951
|
const href = /\bhref=["']([^"']+)["']/i.exec(tag)?.[1];
|
|
7914
7952
|
if (!href || /^(?:[a-z][a-z\d+.-]*:|\/\/)/i.test(href)) continue;
|
|
7915
7953
|
const sheet = resolve5(projectDir, decodedUrlPath(href).replace(/^(?:\.?\/)+/, ""));
|
|
7916
7954
|
if (!isPathInside(sheet, projectDir) || !existsSync10(sheet)) continue;
|
|
7917
7955
|
for (const face of extractFontFaceBlocks(readFileSync6(sheet, "utf8"))) {
|
|
7918
7956
|
const family = /font-family\s*:\s*([^;}]+)/i.exec(face)?.[1]?.trim().replace(/^['"]|['"]$/g, "");
|
|
7919
|
-
const shipsFile = [...face
|
|
7957
|
+
const shipsFile = [...localFontFaceUrlMatches(face)].some(({ parts: [, url = ""] }) => {
|
|
7920
7958
|
const path = decodedUrlPath(url);
|
|
7921
|
-
const file = path.startsWith("/") ? resolve5(projectDir, `.${path}`) : resolve5(
|
|
7959
|
+
const file = path.startsWith("/") ? resolve5(projectDir, `.${path}`) : resolve5(dirname7(sheet), path);
|
|
7922
7960
|
return isPathInside(file, projectDir) && existsSync10(file);
|
|
7923
7961
|
});
|
|
7924
7962
|
if (family && shipsFile) families.push(family);
|
|
@@ -7927,11 +7965,9 @@ function projectStylesheetFontFamilies(html, projectDir) {
|
|
|
7927
7965
|
return families;
|
|
7928
7966
|
}
|
|
7929
7967
|
function collectFontFaceUrls(html) {
|
|
7930
|
-
const styleBlockRe = /<style\b[^>]*>([\s\S]*?)<\/style>/gi;
|
|
7931
7968
|
const urlSet = /* @__PURE__ */ new Set();
|
|
7932
|
-
|
|
7933
|
-
|
|
7934
|
-
const cssText = styleMatch[1] ?? "";
|
|
7969
|
+
for (const { parts } of styleBlockMatches(html)) {
|
|
7970
|
+
const cssText = parts[1];
|
|
7935
7971
|
let i = 0;
|
|
7936
7972
|
while (i < cssText.length) {
|
|
7937
7973
|
const atIdx = cssText.indexOf("@font-face", i);
|
|
@@ -7946,10 +7982,8 @@ function collectFontFaceUrls(html) {
|
|
|
7946
7982
|
j++;
|
|
7947
7983
|
}
|
|
7948
7984
|
const block = cssText.slice(braceStart + 1, j - 1);
|
|
7949
|
-
const
|
|
7950
|
-
|
|
7951
|
-
while ((urlMatch = urlRe.exec(block)) !== null) {
|
|
7952
|
-
if (urlMatch[1]) urlSet.add(urlMatch[1]);
|
|
7985
|
+
for (const { parts: parts2 } of remoteFontFaceUrlMatches(block)) {
|
|
7986
|
+
if (parts2[1]) urlSet.add(parts2[1]);
|
|
7953
7987
|
}
|
|
7954
7988
|
i = j;
|
|
7955
7989
|
}
|
|
@@ -7969,7 +8003,6 @@ function localizeFontFaceUrls(html, downloadDir) {
|
|
|
7969
8003
|
(h, url, relPath) => h.replaceAll(`url(${url})`, `url("${relPath}")`)
|
|
7970
8004
|
);
|
|
7971
8005
|
}
|
|
7972
|
-
var LOCAL_FONTFACE_URL_RE = /url\(["']?(?!data:|file:|https?:\/\/)([^"')]+)["']?\)/gi;
|
|
7973
8006
|
function urlOccurrenceRe(localPath) {
|
|
7974
8007
|
const escaped = localPath.replace(/[.*+?^${}()|[\]\\]/g, "\\$&");
|
|
7975
8008
|
return new RegExp(`url\\((["']?)${escaped}\\1\\)`, "g");
|
|
@@ -7989,24 +8022,16 @@ async function readLocalFont(absPath) {
|
|
|
7989
8022
|
return { kind: "inline", buffer: Buffer.concat(chunks, totalBytes) };
|
|
7990
8023
|
}
|
|
7991
8024
|
async function embedLocalFontFaces(html, projectDir, assetRoot, log = defaultLogger) {
|
|
7992
|
-
const { fontToDataUri: toDataUri } = await import("./deterministicFonts-
|
|
7993
|
-
const styleBlockRe = /<style\b[^>]*>([\s\S]*?)<\/style>/gi;
|
|
7994
|
-
const fontFaceRe = /@font-face\s*\{([^}]*)\}/gi;
|
|
8025
|
+
const { fontToDataUri: toDataUri } = await import("./deterministicFonts-OXGNMVJE.js");
|
|
7995
8026
|
let result = html;
|
|
7996
8027
|
const embeddedPaths = /* @__PURE__ */ new Set();
|
|
7997
8028
|
const dataUriByAbsolutePath = /* @__PURE__ */ new Map();
|
|
7998
8029
|
const fileBackedAbsolutePaths = /* @__PURE__ */ new Set();
|
|
7999
|
-
|
|
8000
|
-
|
|
8001
|
-
|
|
8002
|
-
|
|
8003
|
-
|
|
8004
|
-
while ((ffMatch = ffRe.exec(cssText)) !== null) {
|
|
8005
|
-
const block = ffMatch[1] ?? "";
|
|
8006
|
-
const urlRe = new RegExp(LOCAL_FONTFACE_URL_RE.source, LOCAL_FONTFACE_URL_RE.flags);
|
|
8007
|
-
let urlMatch;
|
|
8008
|
-
while ((urlMatch = urlRe.exec(block)) !== null) {
|
|
8009
|
-
const localPath = urlMatch[1];
|
|
8030
|
+
for (const { parts: style } of styleBlockMatches(html)) {
|
|
8031
|
+
for (const { parts: face } of fontFaceBlockMatches(style[1])) {
|
|
8032
|
+
const block = face[1];
|
|
8033
|
+
for (const { parts } of localFontFaceUrlMatches(block)) {
|
|
8034
|
+
const localPath = parts[1];
|
|
8010
8035
|
if (!localPath || embeddedPaths.has(localPath)) continue;
|
|
8011
8036
|
const absPath = localPath.startsWith("/") ? localPath : resolve5(projectDir, localPath);
|
|
8012
8037
|
if (!isPathInside(absPath, projectDir) || escapesAssetRoot(absPath, assetRoot)) continue;
|
|
@@ -8125,6 +8150,9 @@ async function compileForRender(projectDir, htmlPath, downloadDir, options = {})
|
|
|
8125
8150
|
if (isPathInside(htmlPath, projectDir) && escapesAssetRoot(htmlPath, assetRoot)) {
|
|
8126
8151
|
throw new Error(`Entry file ${htmlPath} leads outside the project folder`);
|
|
8127
8152
|
}
|
|
8153
|
+
if (!COMPOSITION_FILE.test(htmlPath)) {
|
|
8154
|
+
throw new Error(`Entry file ${htmlPath} is not an .html file, so it is refused`);
|
|
8155
|
+
}
|
|
8128
8156
|
const entryHtml = rebaseDirectEntryAssetPaths(readTextFile(htmlPath), projectDir, htmlPath);
|
|
8129
8157
|
const rawHtml = bindVariableMediaSources(
|
|
8130
8158
|
normalizeCompositionSrcs(rewriteUnresolvableGsapToCdn(entryHtml, projectDir), projectDir),
|
|
@@ -8680,6 +8708,14 @@ async function recompileWithResolutions(compiled, resolutions, projectDir, downl
|
|
|
8680
8708
|
}
|
|
8681
8709
|
|
|
8682
8710
|
// ../producer/src/services/render/stages/compileStage.ts
|
|
8711
|
+
function animatedGifCacheDir(extractCacheDir) {
|
|
8712
|
+
try {
|
|
8713
|
+
const root = extractCacheDir && privateCacheRoot(extractCacheDir);
|
|
8714
|
+
return root ? join17(root, "animated-gif") : void 0;
|
|
8715
|
+
} catch {
|
|
8716
|
+
return void 0;
|
|
8717
|
+
}
|
|
8718
|
+
}
|
|
8683
8719
|
function adaptAspectAgnosticResolution(requested, aspectAgnostic, width, height, log) {
|
|
8684
8720
|
if (!requested || !aspectAgnostic) return requested;
|
|
8685
8721
|
const flipped = suggestMatchingPreset(width, height, requested);
|
|
@@ -8759,7 +8795,7 @@ async function runCompileStage(input) {
|
|
|
8759
8795
|
variables: input.variables,
|
|
8760
8796
|
urlByAbsentLocalPath: input.urlByAbsentLocalPath,
|
|
8761
8797
|
pageMotionBlur: input.pageMotionBlur,
|
|
8762
|
-
animatedGifCacheDir:
|
|
8798
|
+
animatedGifCacheDir: animatedGifCacheDir(cfg.extractCacheDir),
|
|
8763
8799
|
ffmpegProcessTimeout: cfg.ffmpegProcessTimeout,
|
|
8764
8800
|
allowOutsideProjectAssets: job.config.allowOutsideProjectAssets
|
|
8765
8801
|
});
|
|
@@ -9827,9 +9863,11 @@ async function runExtractVideosStage(input) {
|
|
|
9827
9863
|
deferRangeExtraction,
|
|
9828
9864
|
shownBoxes,
|
|
9829
9865
|
urlByAbsentLocalPath,
|
|
9866
|
+
audioDownloadDir,
|
|
9830
9867
|
skipFrameExtractionIds = []
|
|
9831
9868
|
} = input;
|
|
9832
9869
|
const stage2Start = Date.now();
|
|
9870
|
+
const assetRoots = job.config.allowOutsideProjectAssets ? void 0 : mediaAssetRoots(projectDir, compiledDir);
|
|
9833
9871
|
const extractionPolicy = resolveVideoExtractionPolicy();
|
|
9834
9872
|
composition.videos = composition.videos.filter(
|
|
9835
9873
|
(video) => !isVideoPastTimelineEnd(video, composition.duration)
|
|
@@ -9848,7 +9886,7 @@ async function runExtractVideosStage(input) {
|
|
|
9848
9886
|
const probeFailures = await Promise.all(
|
|
9849
9887
|
composition.videos.map(async (v) => {
|
|
9850
9888
|
const videoPath = resolveProjectRelativeSrc(v.src, projectDir, compiledDir);
|
|
9851
|
-
if (!
|
|
9889
|
+
if (!opensLocally(videoPath, assetRoots)) return null;
|
|
9852
9890
|
try {
|
|
9853
9891
|
const attempted = extractionPolicy.maxTransientRetries === 0 ? { result: await extractMediaMetadata(videoPath), retries: 0 } : await runVideoExtractionWithRetry(() => extractMediaMetadata(videoPath), {
|
|
9854
9892
|
signal: abortSignal,
|
|
@@ -9886,7 +9924,7 @@ async function runExtractVideosStage(input) {
|
|
|
9886
9924
|
const probed = await Promise.all(
|
|
9887
9925
|
composition.images.map(async (img) => {
|
|
9888
9926
|
const imgPath = resolveProjectRelativeSrc(img.src, projectDir, compiledDir);
|
|
9889
|
-
if (!
|
|
9927
|
+
if (!opensLocally(imgPath, assetRoots)) return null;
|
|
9890
9928
|
const colorSpace = await probeColorSpaceSafely(imgPath, log);
|
|
9891
9929
|
if (isHdrColorSpace(colorSpace)) {
|
|
9892
9930
|
nativeHdrImageIds.add(img.id);
|
|
@@ -9899,7 +9937,16 @@ async function runExtractVideosStage(input) {
|
|
|
9899
9937
|
imageColorSpaces.push(...probed);
|
|
9900
9938
|
}
|
|
9901
9939
|
if (skipFrameExtractionIds.length > 0) {
|
|
9902
|
-
await appendVideoAudioFromProbe({
|
|
9940
|
+
await appendVideoAudioFromProbe({
|
|
9941
|
+
projectDir,
|
|
9942
|
+
compiledDir,
|
|
9943
|
+
composition,
|
|
9944
|
+
urlByAbsentLocalPath,
|
|
9945
|
+
downloadDir: audioDownloadDir,
|
|
9946
|
+
allowOutsideProjectAssets: job.config.allowOutsideProjectAssets,
|
|
9947
|
+
signal: abortSignal,
|
|
9948
|
+
log
|
|
9949
|
+
});
|
|
9903
9950
|
videoReadinessSkipIds = [...skipFrameExtractionIds];
|
|
9904
9951
|
} else if (composition.videos.length > 0) {
|
|
9905
9952
|
const totalVideos = composition.videos.length;
|
|
@@ -9930,6 +9977,7 @@ async function runExtractVideosStage(input) {
|
|
|
9930
9977
|
shownBoxes,
|
|
9931
9978
|
contentKeyedDirs: [join19(compiledDir, REMOTE_MEDIA_SUBDIR)],
|
|
9932
9979
|
urlByAbsentLocalPath,
|
|
9980
|
+
assetRoots,
|
|
9933
9981
|
onProgress: ({ planned = 0, done = 0 }) => {
|
|
9934
9982
|
framesPlanned += planned;
|
|
9935
9983
|
framesDone += done;
|
|
@@ -10006,17 +10054,41 @@ function isPublicHttpsUrl(url) {
|
|
|
10006
10054
|
return false;
|
|
10007
10055
|
}
|
|
10008
10056
|
}
|
|
10057
|
+
function opensLocally(path, assetRoots) {
|
|
10058
|
+
return existsSync12(path) && (!assetRoots || isInsideAssetRoots(path, assetRoots));
|
|
10059
|
+
}
|
|
10060
|
+
function localProbeSource(src, input) {
|
|
10061
|
+
const path = resolveProjectRelativeSrc(src, input.projectDir, input.compiledDir);
|
|
10062
|
+
const readFrom = input.urlByAbsentLocalPath?.get(path) ?? path;
|
|
10063
|
+
const roots = input.allowOutsideProjectAssets ? void 0 : mediaAssetRoots(input.projectDir, input.compiledDir);
|
|
10064
|
+
return isHttpUrl(readFrom) || opensLocally(readFrom, roots) ? readFrom : null;
|
|
10065
|
+
}
|
|
10066
|
+
async function remoteProbeSource(video, input) {
|
|
10067
|
+
if (!isPublicHttpsUrl(video.src)) return null;
|
|
10068
|
+
if (!resolveRestrictPageNetwork()) return video.src;
|
|
10069
|
+
if (!video.hasAudio || video.hidden) return null;
|
|
10070
|
+
const downloadDir = input.downloadDir ?? join19(input.compiledDir, REMOTE_MEDIA_SUBDIR);
|
|
10071
|
+
try {
|
|
10072
|
+
return await downloadToTemp(video.src, downloadDir, void 0, input.signal, void 0, {
|
|
10073
|
+
onTelemetry: writeUrlDownloadTelemetry
|
|
10074
|
+
});
|
|
10075
|
+
} catch (error) {
|
|
10076
|
+
if (!isUrlNotPermittedError(error)) throw error;
|
|
10077
|
+
input.log?.warn("Video sound skipped: its URL is outside the download address rules", {
|
|
10078
|
+
videoId: video.id
|
|
10079
|
+
});
|
|
10080
|
+
return null;
|
|
10081
|
+
}
|
|
10082
|
+
}
|
|
10009
10083
|
async function appendVideoAudioFromProbe(input) {
|
|
10010
|
-
const {
|
|
10084
|
+
const { composition } = input;
|
|
10011
10085
|
const videos = composition.videos.filter(
|
|
10012
10086
|
(video) => !isVideoPastTimelineEnd(video, composition.duration)
|
|
10013
10087
|
);
|
|
10014
10088
|
const probed = await Promise.all(
|
|
10015
10089
|
videos.map(async (video) => {
|
|
10016
|
-
|
|
10017
|
-
|
|
10018
|
-
const readFrom = urlByAbsentLocalPath?.get(path) ?? path;
|
|
10019
|
-
if (!isHttpUrl(readFrom) && !existsSync12(readFrom)) return null;
|
|
10090
|
+
const readFrom = isHttpUrl(video.src) ? await remoteProbeSource(video, input) : localProbeSource(video.src, input);
|
|
10091
|
+
if (readFrom === null) return null;
|
|
10020
10092
|
const metadata = await extractMediaMetadata(readFrom);
|
|
10021
10093
|
const window2 = await resolveFinalFrameExtractionWindow(
|
|
10022
10094
|
readFrom,
|
|
@@ -10118,11 +10190,11 @@ import { join as join22 } from "path";
|
|
|
10118
10190
|
|
|
10119
10191
|
// ../producer/src/services/render/audioDeliveryLimit.ts
|
|
10120
10192
|
import { existsSync as existsSync14 } from "fs";
|
|
10121
|
-
import { dirname as
|
|
10193
|
+
import { dirname as dirname9, join as join21 } from "path";
|
|
10122
10194
|
|
|
10123
10195
|
// ../producer/src/services/render/audioPadTrim.ts
|
|
10124
10196
|
import { spawn } from "child_process";
|
|
10125
|
-
import { dirname as
|
|
10197
|
+
import { dirname as dirname8, join as join20 } from "path";
|
|
10126
10198
|
|
|
10127
10199
|
// ../producer/src/services/render/audioTruePeak.ts
|
|
10128
10200
|
var toDbfs = (token) => token.toLowerCase() === "-inf" ? Number.NEGATIVE_INFINITY : Number(token);
|
|
@@ -10396,7 +10468,7 @@ async function cutSource(input, scratchDir, attenuationDb) {
|
|
|
10396
10468
|
async function enforceAacTruePeak(input) {
|
|
10397
10469
|
let scratchDir;
|
|
10398
10470
|
try {
|
|
10399
|
-
scratchDir = createStagingDir(
|
|
10471
|
+
scratchDir = createStagingDir(dirname8(input.audioPath), ".true-peak-");
|
|
10400
10472
|
const correctedPath = join20(scratchDir, "audio.m4a");
|
|
10401
10473
|
const measurements = [];
|
|
10402
10474
|
let attenuationDb = 0;
|
|
@@ -10607,7 +10679,7 @@ async function limitDeliveryPeaks(input, deps = {
|
|
|
10607
10679
|
const peak = await deps.measure(audioPath, { timeoutMs, signal });
|
|
10608
10680
|
if (peak <= AAC_DELIVERY_TRUE_PEAK_DBFS) return { success: true };
|
|
10609
10681
|
const alternating = ["a", "b"].map(
|
|
10610
|
-
(k) => join21(
|
|
10682
|
+
(k) => join21(dirname9(sourcePath), `audio-source-limited-${k}.wav`)
|
|
10611
10683
|
);
|
|
10612
10684
|
let encodedFrom;
|
|
10613
10685
|
let ceiling = AAC_DELIVERY_TRUE_PEAK_DBFS;
|
|
@@ -10755,7 +10827,7 @@ async function mixAudioForDelivery(input, duration, pcmSourcePath) {
|
|
|
10755
10827
|
audioResult = await processCompositionAudio(
|
|
10756
10828
|
audios,
|
|
10757
10829
|
projectDir,
|
|
10758
|
-
|
|
10830
|
+
audioWorkDir(workDir),
|
|
10759
10831
|
audioOutputPath,
|
|
10760
10832
|
duration,
|
|
10761
10833
|
abortSignal,
|
|
@@ -10765,7 +10837,8 @@ async function mixAudioForDelivery(input, duration, pcmSourcePath) {
|
|
|
10765
10837
|
masterFxChain,
|
|
10766
10838
|
urlByAbsentLocalPath,
|
|
10767
10839
|
audioSidecarUrlByLocalPath,
|
|
10768
|
-
keepEncoderInputAt: pcmSourcePath
|
|
10840
|
+
keepEncoderInputAt: pcmSourcePath,
|
|
10841
|
+
assetRoots: input.allowOutsideProjectAssets ? void 0 : mediaAssetRoots(projectDir, compiledDir)
|
|
10769
10842
|
},
|
|
10770
10843
|
compiledDir
|
|
10771
10844
|
);
|
|
@@ -11408,7 +11481,7 @@ import { join as join26 } from "path";
|
|
|
11408
11481
|
// ../producer/src/services/shaderTransitionWorkerPool.ts
|
|
11409
11482
|
import { Worker } from "worker_threads";
|
|
11410
11483
|
import { fileURLToPath as fileURLToPath2, pathToFileURL } from "url";
|
|
11411
|
-
import { dirname as
|
|
11484
|
+
import { dirname as dirname10, join as join25 } from "path";
|
|
11412
11485
|
import { createRequire } from "module";
|
|
11413
11486
|
import { existsSync as existsSync17 } from "fs";
|
|
11414
11487
|
function resolveWorkerEntry(explicit) {
|
|
@@ -11420,7 +11493,7 @@ function resolveWorkerEntry(explicit) {
|
|
|
11420
11493
|
const isTs = override.endsWith(".ts");
|
|
11421
11494
|
return { path: override, isTs };
|
|
11422
11495
|
}
|
|
11423
|
-
const moduleDir =
|
|
11496
|
+
const moduleDir = dirname10(fileURLToPath2(import.meta.url));
|
|
11424
11497
|
const jsPath = join25(moduleDir, "shaderTransitionWorker.js");
|
|
11425
11498
|
if (existsSync17(jsPath)) return { path: jsPath, isTs: false };
|
|
11426
11499
|
const tsPath = join25(moduleDir, "shaderTransitionWorker.ts");
|
|
@@ -12149,7 +12222,7 @@ import {
|
|
|
12149
12222
|
writeFileSync as writeFileSync5
|
|
12150
12223
|
} from "fs";
|
|
12151
12224
|
import { readFile as readFile2 } from "fs/promises";
|
|
12152
|
-
import { dirname as
|
|
12225
|
+
import { dirname as dirname11, join as join28 } from "path";
|
|
12153
12226
|
|
|
12154
12227
|
// ../producer/src/services/render/stages/gifEncodeArgs.ts
|
|
12155
12228
|
function fpsToFfmpegArg2(fps) {
|
|
@@ -12452,7 +12525,7 @@ async function runEncodeStage(input) {
|
|
|
12452
12525
|
const encodeResult2 = await encodeGifFromDir(framesDir, framePattern2, outputPath, {
|
|
12453
12526
|
fps: job.config.fps,
|
|
12454
12527
|
loop,
|
|
12455
|
-
palettePath: join28(
|
|
12528
|
+
palettePath: join28(dirname11(videoOnlyPath), "gif-palette.png"),
|
|
12456
12529
|
preserveAlpha: needsAlpha,
|
|
12457
12530
|
signal: abortSignal,
|
|
12458
12531
|
timeout: engineCfg.ffmpegEncodeTimeout
|
|
@@ -12896,7 +12969,7 @@ function getNextRetryWorkerCount(currentWorkers) {
|
|
|
12896
12969
|
}
|
|
12897
12970
|
function resolveRenderWorkDirPrefix(outputPath, jobId, platform2 = process.platform, systemTempDir = tmpdir2()) {
|
|
12898
12971
|
if (platform2 === "win32" || platform2 === "darwin") return join29(systemTempDir, "hf-render-");
|
|
12899
|
-
return join29(
|
|
12972
|
+
return join29(dirname12(outputPath), `work-${jobId}-`);
|
|
12900
12973
|
}
|
|
12901
12974
|
var MAX_TRANSIENT_CAPTURE_RETRIES = 1;
|
|
12902
12975
|
function isTransientCaptureRetryEligible(failureKind, missing, retriesUsed) {
|
|
@@ -13599,6 +13672,19 @@ function resolveCaptureForceScreenshotForPageSideCompositing(args) {
|
|
|
13599
13672
|
function shouldDiscardProbeSessionForPageSideCompositing(args) {
|
|
13600
13673
|
return args.hasProbeSession && args.usePageSideCompositing;
|
|
13601
13674
|
}
|
|
13675
|
+
var PAGE_SIDE_COMPOSITOR_CANVAS_ID = "__hf-page-side-compositor";
|
|
13676
|
+
async function pageInstallsShaderCompositor(open2, session = { initializeSession, closeCaptureSession }) {
|
|
13677
|
+
const probe = await open2();
|
|
13678
|
+
try {
|
|
13679
|
+
await session.initializeSession(probe);
|
|
13680
|
+
return await probe.page.evaluate(
|
|
13681
|
+
(id) => document.getElementById(id) !== null,
|
|
13682
|
+
PAGE_SIDE_COMPOSITOR_CANVAS_ID
|
|
13683
|
+
);
|
|
13684
|
+
} finally {
|
|
13685
|
+
await session.closeCaptureSession(probe);
|
|
13686
|
+
}
|
|
13687
|
+
}
|
|
13602
13688
|
function deVerifyFallbackTelemetry(err) {
|
|
13603
13689
|
const details = getDrawElementVerificationDetails(err);
|
|
13604
13690
|
return {
|
|
@@ -13609,7 +13695,7 @@ function deVerifyFallbackTelemetry(err) {
|
|
|
13609
13695
|
};
|
|
13610
13696
|
}
|
|
13611
13697
|
function resolveRenderDebugDir() {
|
|
13612
|
-
const producerRoot = process.env.PRODUCER_RENDERS_DIR ? resolve6(process.env.PRODUCER_RENDERS_DIR, "..") : resolve6(
|
|
13698
|
+
const producerRoot = process.env.PRODUCER_RENDERS_DIR ? resolve6(process.env.PRODUCER_RENDERS_DIR, "..") : resolve6(dirname12(fileURLToPath3(import.meta.url)), "../..");
|
|
13613
13699
|
return join29(producerRoot, ".debug");
|
|
13614
13700
|
}
|
|
13615
13701
|
async function executeRenderJob(job, projectDir, outputPath, progressSink, abortSignal, assertRenderActive) {
|
|
@@ -13617,7 +13703,7 @@ async function executeRenderJob(job, projectDir, outputPath, progressSink, abort
|
|
|
13617
13703
|
validateDeliveryEncoderConfig(job.config);
|
|
13618
13704
|
validateChromaSubsamplingConfig(job.config);
|
|
13619
13705
|
const debugDir = resolveRenderDebugDir();
|
|
13620
|
-
const outputDir =
|
|
13706
|
+
const outputDir = dirname12(outputPath);
|
|
13621
13707
|
if (!existsSync20(outputDir)) mkdirSync10(outputDir, { recursive: true });
|
|
13622
13708
|
const workDir = job.config.debug ? join29(debugDir, job.id) : createRenderWorkDir(resolveRenderWorkDirPrefix(outputPath, job.id), outputDir);
|
|
13623
13709
|
const pipelineStart = Date.now();
|
|
@@ -14029,6 +14115,7 @@ async function executeRenderPipeline(input) {
|
|
|
14029
14115
|
log,
|
|
14030
14116
|
composition,
|
|
14031
14117
|
skipFrameExtractionIds: videoLayer ? [videoLayer.videoId] : [],
|
|
14118
|
+
audioDownloadDir: audioWorkDir(workDir),
|
|
14032
14119
|
abortSignal: executionSignal,
|
|
14033
14120
|
assertNotAborted,
|
|
14034
14121
|
// Local staging can use links; distributed plan() alone requires real copies.
|
|
@@ -14115,6 +14202,7 @@ async function executeRenderPipeline(input) {
|
|
|
14115
14202
|
audioGain: cfg.audioGain,
|
|
14116
14203
|
audios: composition.audios,
|
|
14117
14204
|
masterFxChain: composition.masterFxChain,
|
|
14205
|
+
allowOutsideProjectAssets: job.config.allowOutsideProjectAssets,
|
|
14118
14206
|
abortSignal: executionSignal,
|
|
14119
14207
|
assertNotAborted,
|
|
14120
14208
|
log,
|
|
@@ -14734,7 +14822,7 @@ async function executeRenderPipeline(input) {
|
|
|
14734
14822
|
};
|
|
14735
14823
|
const videoExt = FORMAT_EXT[outputFormat] ?? ".mp4";
|
|
14736
14824
|
const videoOnlyPath = join29(workDir, `video-only${videoExt}`);
|
|
14737
|
-
|
|
14825
|
+
let usePageSideCompositingForTransitions = (cfg.enablePageSideCompositing || isGif) && compiled.hasShaderTransitions && !hasHdrContent && outputSupportsPageSideShaderCompositing(outputFormat);
|
|
14738
14826
|
if (usePageSideCompositingForTransitions) {
|
|
14739
14827
|
activeFileServer.addPreHeadScript(HF_PAGE_SIDE_COMPOSITING_STUB);
|
|
14740
14828
|
if (shouldDiscardProbeSessionForPageSideCompositing({
|
|
@@ -14748,6 +14836,26 @@ async function executeRenderPipeline(input) {
|
|
|
14748
14836
|
"[Render] Recreating capture session so page-side compositing pre-head script is loaded."
|
|
14749
14837
|
);
|
|
14750
14838
|
}
|
|
14839
|
+
try {
|
|
14840
|
+
usePageSideCompositingForTransitions = await pageInstallsShaderCompositor(
|
|
14841
|
+
() => createCaptureSession(activeFileServer.url, framesDir, buildPrepCaptureOptions(), null, {
|
|
14842
|
+
...cfg,
|
|
14843
|
+
forceScreenshot: true
|
|
14844
|
+
})
|
|
14845
|
+
);
|
|
14846
|
+
} catch (error) {
|
|
14847
|
+
assertNotAborted();
|
|
14848
|
+
log.warn("[Render] Shader compositor check failed; keeping page-side compositing.", {
|
|
14849
|
+
error: error instanceof Error ? error.message : String(error)
|
|
14850
|
+
});
|
|
14851
|
+
}
|
|
14852
|
+
if (!usePageSideCompositingForTransitions) {
|
|
14853
|
+
log.warn(
|
|
14854
|
+
"[Render] The page's shader-transitions build cannot composite in this browser; shader transitions blend on the Node-side layered path."
|
|
14855
|
+
);
|
|
14856
|
+
}
|
|
14857
|
+
}
|
|
14858
|
+
if (usePageSideCompositingForTransitions) {
|
|
14751
14859
|
captureForceScreenshot = resolveCaptureForceScreenshotForPageSideCompositing({
|
|
14752
14860
|
forceScreenshot: captureForceScreenshot,
|
|
14753
14861
|
usePageSideCompositing: true
|
|
@@ -15762,7 +15870,7 @@ import { tmpdir as tmpdir4 } from "os";
|
|
|
15762
15870
|
// ../producer/src/services/distributed/mp4Stitch.ts
|
|
15763
15871
|
import { createReadStream as createReadStream3, createWriteStream, mkdirSync as mkdirSync11, rmSync as rmSync11 } from "fs";
|
|
15764
15872
|
import { open } from "fs/promises";
|
|
15765
|
-
import { basename as basename6, dirname as
|
|
15873
|
+
import { basename as basename6, dirname as dirname13, join as join30 } from "path";
|
|
15766
15874
|
import { finished, pipeline } from "stream/promises";
|
|
15767
15875
|
function boxAt(src, off, at, limit) {
|
|
15768
15876
|
let size = src.readUInt32BE(off);
|
|
@@ -16126,8 +16234,8 @@ async function writeStitchedMp4(chunkPaths, outputPath, audioPath) {
|
|
|
16126
16234
|
const sourcePaths = audioPath ? [audioPath, ...chunkPaths] : chunkPaths;
|
|
16127
16235
|
const layouts = await Promise.all(sourcePaths.map((path) => readMp4Layout(fileRange(path))));
|
|
16128
16236
|
const header = audioPath ? buildStitchedHeader(layouts.slice(1), layouts[0]) : buildStitchedHeader(layouts);
|
|
16129
|
-
mkdirSync11(
|
|
16130
|
-
const workDir = createStagingDir(
|
|
16237
|
+
mkdirSync11(dirname13(outputPath), { recursive: true });
|
|
16238
|
+
const workDir = createStagingDir(dirname13(outputPath), `${basename6(outputPath)}.stitch-`);
|
|
16131
16239
|
const out = createWriteStream(join30(workDir, "out.mp4"));
|
|
16132
16240
|
try {
|
|
16133
16241
|
out.write(header);
|
|
@@ -16162,7 +16270,7 @@ import { extname as extname4, join as join32 } from "path";
|
|
|
16162
16270
|
|
|
16163
16271
|
// ../producer/src/services/distributed/shared.ts
|
|
16164
16272
|
import { execFile as execFileCallback } from "child_process";
|
|
16165
|
-
import { dirname as
|
|
16273
|
+
import { dirname as dirname14, join as join31 } from "path";
|
|
16166
16274
|
import { existsSync as existsSync21, readFileSync as readFileSync8 } from "fs";
|
|
16167
16275
|
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
16168
16276
|
import { promisify as promisify2 } from "util";
|
|
@@ -16434,7 +16542,7 @@ function buildSyntheticRenderJob(input) {
|
|
|
16434
16542
|
var cachedProducerVersion = null;
|
|
16435
16543
|
function readProducerVersion() {
|
|
16436
16544
|
if (cachedProducerVersion !== null) return cachedProducerVersion;
|
|
16437
|
-
const startDir =
|
|
16545
|
+
const startDir = dirname14(fileURLToPath4(import.meta.url));
|
|
16438
16546
|
let current = startDir;
|
|
16439
16547
|
for (let i = 0; i < 10; i++) {
|
|
16440
16548
|
const candidate = join31(current, "package.json");
|
|
@@ -16448,7 +16556,7 @@ function readProducerVersion() {
|
|
|
16448
16556
|
} catch {
|
|
16449
16557
|
}
|
|
16450
16558
|
}
|
|
16451
|
-
const parent =
|
|
16559
|
+
const parent = dirname14(current);
|
|
16452
16560
|
if (parent === current) break;
|
|
16453
16561
|
current = parent;
|
|
16454
16562
|
}
|
|
@@ -18017,7 +18125,7 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
|
|
|
18017
18125
|
if (probeResult.fileServer) closeFileServerSafely(probeResult.fileServer, "plan", log);
|
|
18018
18126
|
if (probeResult.probeSession) {
|
|
18019
18127
|
try {
|
|
18020
|
-
const { closeCaptureSession: closeCaptureSession2 } = await import("./src-
|
|
18128
|
+
const { closeCaptureSession: closeCaptureSession2 } = await import("./src-UQ3K3UW2.js");
|
|
18021
18129
|
await closeCaptureSession2(probeResult.probeSession);
|
|
18022
18130
|
} catch (err) {
|
|
18023
18131
|
log.warn("[plan] probe session close failed", {
|
|
@@ -18057,6 +18165,7 @@ function mixPlanAudio(c, compiledDir) {
|
|
|
18057
18165
|
compiledDir,
|
|
18058
18166
|
urlByAbsentLocalPath: c.urlByAbsentLocalPath,
|
|
18059
18167
|
audioSidecarUrlByLocalPath: c.audioSidecarUrlByLocalPath,
|
|
18168
|
+
allowOutsideProjectAssets: c.job.config.allowOutsideProjectAssets,
|
|
18060
18169
|
totalFrames: c.totalFrames,
|
|
18061
18170
|
fps: c.job.config.fps,
|
|
18062
18171
|
ffmpegProcessTimeout: c.cfg.ffmpegProcessTimeout,
|
|
@@ -18394,7 +18503,7 @@ import {
|
|
|
18394
18503
|
writeFileSync as writeFileSync11
|
|
18395
18504
|
} from "fs";
|
|
18396
18505
|
import { tmpdir as tmpdir3 } from "os";
|
|
18397
|
-
import { dirname as
|
|
18506
|
+
import { dirname as dirname16, isAbsolute as isAbsolute3, join as join41, relative as relative7, resolve as resolve8, sep as sep4 } from "path";
|
|
18398
18507
|
|
|
18399
18508
|
// ../producer/src/services/distributed/planV2Publisher.ts
|
|
18400
18509
|
import {
|
|
@@ -18406,7 +18515,7 @@ import {
|
|
|
18406
18515
|
statSync as statSync8,
|
|
18407
18516
|
writeFileSync as writeFileSync10
|
|
18408
18517
|
} from "fs";
|
|
18409
|
-
import { dirname as
|
|
18518
|
+
import { dirname as dirname15, join as join40 } from "path";
|
|
18410
18519
|
|
|
18411
18520
|
// ../producer/src/services/distributed/planV2Errors.ts
|
|
18412
18521
|
var PLAN_V2_INTEGRITY_UNRECOVERABLE = "PLAN_V2_INTEGRITY_UNRECOVERABLE";
|
|
@@ -18466,8 +18575,8 @@ var LocalPlanV2ArtifactPublisher = class {
|
|
|
18466
18575
|
}
|
|
18467
18576
|
this.destinationDir = destinationDir;
|
|
18468
18577
|
this.#linkFile = options.linkFile ?? linkSync2;
|
|
18469
|
-
mkdirSync15(
|
|
18470
|
-
this.temporaryDir = createStagingDir(
|
|
18578
|
+
mkdirSync15(dirname15(destinationDir), { recursive: true });
|
|
18579
|
+
this.temporaryDir = createStagingDir(dirname15(destinationDir), ".plan-v2-publish-");
|
|
18471
18580
|
}
|
|
18472
18581
|
async putBlob(blob) {
|
|
18473
18582
|
const digest = assertPlanV2Sha256(blob.sha256, "published blob sha256");
|
|
@@ -18479,8 +18588,8 @@ var LocalPlanV2ArtifactPublisher = class {
|
|
|
18479
18588
|
}
|
|
18480
18589
|
const destinationPath = planV2BlobPath(this.temporaryDir, digest);
|
|
18481
18590
|
if (existsSync26(destinationPath)) return;
|
|
18482
|
-
mkdirSync15(
|
|
18483
|
-
const stagingDir = createStagingDir(
|
|
18591
|
+
mkdirSync15(dirname15(destinationPath), { recursive: true });
|
|
18592
|
+
const stagingDir = createStagingDir(dirname15(destinationPath), ".plan-v2-blob-");
|
|
18484
18593
|
const temporaryPath = join40(stagingDir, "blob");
|
|
18485
18594
|
try {
|
|
18486
18595
|
try {
|
|
@@ -18770,8 +18879,8 @@ function computeManifestHash(manifest) {
|
|
|
18770
18879
|
}
|
|
18771
18880
|
function writeBlob(sourcePath, destinationPath) {
|
|
18772
18881
|
if (existsSync27(destinationPath)) return;
|
|
18773
|
-
mkdirSync16(
|
|
18774
|
-
const temporaryDir = createStagingDir(
|
|
18882
|
+
mkdirSync16(dirname16(destinationPath), { recursive: true });
|
|
18883
|
+
const temporaryDir = createStagingDir(dirname16(destinationPath), ".plan-v2-blob-");
|
|
18775
18884
|
const temporaryPath = join41(temporaryDir, "blob");
|
|
18776
18885
|
try {
|
|
18777
18886
|
copyFileSync6(sourcePath, temporaryPath);
|
|
@@ -18896,8 +19005,8 @@ function createPlanV2FromExecutionPlan(executionPlanDir, planV2Dir) {
|
|
|
18896
19005
|
if (publication.storedBlobs.length > 0) {
|
|
18897
19006
|
throw new PlanV2IntegrityError("a local plan v2 directory cannot reference remote files");
|
|
18898
19007
|
}
|
|
18899
|
-
mkdirSync16(
|
|
18900
|
-
const tempDir = createStagingDir(
|
|
19008
|
+
mkdirSync16(dirname16(planV2Dir), { recursive: true });
|
|
19009
|
+
const tempDir = createStagingDir(dirname16(planV2Dir), ".plan-v2-build-");
|
|
18901
19010
|
try {
|
|
18902
19011
|
for (const blob of publication.blobs) {
|
|
18903
19012
|
writeBlob(blob.sourcePath, planV2BlobPath(tempDir, blob.sha256));
|
|
@@ -18981,7 +19090,7 @@ async function planV2(projectDir, config, planV2Dir) {
|
|
|
18981
19090
|
}
|
|
18982
19091
|
const publisher = new LocalPlanV2ArtifactPublisher(planV2Dir);
|
|
18983
19092
|
const manifest = await planV2WithPublisher(projectDir, config, publisher, {
|
|
18984
|
-
stagingParentDir:
|
|
19093
|
+
stagingParentDir: dirname16(planV2Dir)
|
|
18985
19094
|
});
|
|
18986
19095
|
return resultFromManifest(planV2Dir, manifest);
|
|
18987
19096
|
}
|
|
@@ -19174,12 +19283,12 @@ function materializePlanV2Target(planV2Dir, target, destinationDir, options = {}
|
|
|
19174
19283
|
artifact,
|
|
19175
19284
|
sourcePath: verifyBlob(planV2Dir, artifact)
|
|
19176
19285
|
}));
|
|
19177
|
-
mkdirSync16(
|
|
19178
|
-
const tempDir = createStagingDir(
|
|
19286
|
+
mkdirSync16(dirname16(destinationDir), { recursive: true });
|
|
19287
|
+
const tempDir = createStagingDir(dirname16(destinationDir), ".plan-v2-materialize-");
|
|
19179
19288
|
try {
|
|
19180
19289
|
for (const { artifact, sourcePath } of verified) {
|
|
19181
19290
|
const destinationPath = join41(tempDir, ...artifact.path.split("/"));
|
|
19182
|
-
mkdirSync16(
|
|
19291
|
+
mkdirSync16(dirname16(destinationPath), { recursive: true });
|
|
19183
19292
|
copyFileSync6(sourcePath, destinationPath);
|
|
19184
19293
|
}
|
|
19185
19294
|
if (target.role === "chunk") materializeExtractedVideoDirectories(tempDir);
|
|
@@ -20616,9 +20725,10 @@ import {
|
|
|
20616
20725
|
rmSync as rmSync17,
|
|
20617
20726
|
createReadStream as createReadStream5
|
|
20618
20727
|
} from "fs";
|
|
20619
|
-
import { resolve as resolve10, dirname as
|
|
20728
|
+
import { resolve as resolve10, dirname as dirname18, join as join46 } from "path";
|
|
20620
20729
|
import { tmpdir as tmpdir5 } from "os";
|
|
20621
20730
|
import { parseArgs } from "util";
|
|
20731
|
+
import { isIP } from "net";
|
|
20622
20732
|
import crypto from "crypto";
|
|
20623
20733
|
import { Hono as Hono2 } from "hono";
|
|
20624
20734
|
import { streamSSE } from "hono/streaming";
|
|
@@ -20677,7 +20787,11 @@ function readEntryHtml(filePath) {
|
|
|
20677
20787
|
closeSync6(fd);
|
|
20678
20788
|
}
|
|
20679
20789
|
}
|
|
20680
|
-
function
|
|
20790
|
+
function leavesProject(absProjectDir, absoluteEntryPath, isAllowedEntry) {
|
|
20791
|
+
const entryRelativePath = relative8(absProjectDir, absoluteEntryPath);
|
|
20792
|
+
return entryRelativePath === ".." || entryRelativePath.startsWith(`..${sep5}`) || isAbsolute4(entryRelativePath) || isAllowedEntry !== void 0 && !isAllowedEntry(absoluteEntryPath);
|
|
20793
|
+
}
|
|
20794
|
+
function readProjectEntryFile(projectDir, preferredEntryFile, isAllowedEntry) {
|
|
20681
20795
|
const absProjectDir = resolve9(projectDir);
|
|
20682
20796
|
if (!existsSync29(absProjectDir) || !statSync10(absProjectDir).isDirectory()) {
|
|
20683
20797
|
return { error: `Project directory not found: ${absProjectDir}` };
|
|
@@ -20687,8 +20801,7 @@ function readProjectEntryFile(projectDir, preferredEntryFile) {
|
|
|
20687
20801
|
);
|
|
20688
20802
|
for (const entryFile of entryCandidates) {
|
|
20689
20803
|
const absoluteEntryPath = resolve9(absProjectDir, entryFile);
|
|
20690
|
-
|
|
20691
|
-
if (entryRelativePath === ".." || entryRelativePath.startsWith(`..${sep5}`) || isAbsolute4(entryRelativePath)) {
|
|
20804
|
+
if (leavesProject(absProjectDir, absoluteEntryPath, isAllowedEntry)) {
|
|
20692
20805
|
return { error: `Entry file must stay inside project directory: ${entryFile}` };
|
|
20693
20806
|
}
|
|
20694
20807
|
const html = readEntryHtml(absoluteEntryPath);
|
|
@@ -20704,10 +20817,10 @@ function readProjectEntryFile(projectDir, preferredEntryFile) {
|
|
|
20704
20817
|
error: `No HTML entry file found in project directory: ${join44(absProjectDir, preferredEntryFile || "index.html")}`
|
|
20705
20818
|
};
|
|
20706
20819
|
}
|
|
20707
|
-
function prepareHyperframeLintBody(body) {
|
|
20820
|
+
function prepareHyperframeLintBody(body, isAllowedEntry) {
|
|
20708
20821
|
const requestedEntryFile = typeof body.entryFile === "string" && body.entryFile.trim().length > 0 ? body.entryFile.trim() : void 0;
|
|
20709
20822
|
if (typeof body.projectDir === "string" && body.projectDir.trim().length > 0) {
|
|
20710
|
-
const prepared = readProjectEntryFile(body.projectDir, requestedEntryFile);
|
|
20823
|
+
const prepared = readProjectEntryFile(body.projectDir, requestedEntryFile, isAllowedEntry);
|
|
20711
20824
|
if ("error" in prepared) {
|
|
20712
20825
|
return prepared;
|
|
20713
20826
|
}
|
|
@@ -20747,7 +20860,7 @@ async function runHyperframeLint(prepared) {
|
|
|
20747
20860
|
// ../producer/src/services/healthWorker.ts
|
|
20748
20861
|
import { Worker as Worker2 } from "worker_threads";
|
|
20749
20862
|
import { fileURLToPath as fileURLToPath5 } from "url";
|
|
20750
|
-
import { dirname as
|
|
20863
|
+
import { dirname as dirname17, join as join45 } from "path";
|
|
20751
20864
|
import { existsSync as existsSync30 } from "fs";
|
|
20752
20865
|
var DEFAULT_HEALTH_PORT = 9848;
|
|
20753
20866
|
async function startHealthWorker(options = {}) {
|
|
@@ -20822,7 +20935,7 @@ function defaultLogger2() {
|
|
|
20822
20935
|
};
|
|
20823
20936
|
}
|
|
20824
20937
|
function resolveWorkerEntry2() {
|
|
20825
|
-
const here =
|
|
20938
|
+
const here = dirname17(fileURLToPath5(import.meta.url));
|
|
20826
20939
|
const candidates = [join45(here, "healthWorkerThread.js"), join45(here, "healthWorkerThread.ts")];
|
|
20827
20940
|
for (const candidate of candidates) {
|
|
20828
20941
|
if (existsSync30(candidate)) return candidate;
|
|
@@ -20977,16 +21090,22 @@ function buildRenderJobConfig(input, outputPath, log) {
|
|
|
20977
21090
|
});
|
|
20978
21091
|
return renderConfigFromRequest(request, { logger: log });
|
|
20979
21092
|
}
|
|
20980
|
-
function resolvePreparedRenderOutput(prepared, rendersDir, log) {
|
|
21093
|
+
function resolvePreparedRenderOutput(prepared, rendersDir, log, confineOutput) {
|
|
20981
21094
|
const { input, cleanupProjectDir } = prepared;
|
|
20982
21095
|
const absoluteOutputPath = resolveOutputPath(input.projectDir, input.outputPath, rendersDir, log);
|
|
20983
|
-
|
|
21096
|
+
if (confineOutput) {
|
|
21097
|
+
mkdirSync19(rendersDir, { recursive: true });
|
|
21098
|
+
if (!isSafePath(rendersDir, absoluteOutputPath)) {
|
|
21099
|
+
throw new Error("outputPath must be inside the renders directory");
|
|
21100
|
+
}
|
|
21101
|
+
}
|
|
21102
|
+
const outputDir = dirname18(absoluteOutputPath);
|
|
20984
21103
|
if (!existsSync31(outputDir)) mkdirSync19(outputDir, { recursive: true });
|
|
20985
21104
|
return { input, cleanupProjectDir, absoluteOutputPath };
|
|
20986
21105
|
}
|
|
20987
|
-
function prepareRenderJob(prepared, rendersDir, log) {
|
|
21106
|
+
function prepareRenderJob(prepared, rendersDir, log, confineOutput) {
|
|
20988
21107
|
try {
|
|
20989
|
-
const output = resolvePreparedRenderOutput(prepared, rendersDir, log);
|
|
21108
|
+
const output = resolvePreparedRenderOutput(prepared, rendersDir, log, confineOutput);
|
|
20990
21109
|
const job = createRenderJob(buildRenderJobConfig(output.input, output.absoluteOutputPath, log));
|
|
20991
21110
|
return { ...output, job };
|
|
20992
21111
|
} catch (error) {
|
|
@@ -21037,16 +21156,32 @@ function validateOutputResolutionOverride(body) {
|
|
|
21037
21156
|
return void 0;
|
|
21038
21157
|
}
|
|
21039
21158
|
var MAX_PREVIEW_HTML_BYTES = 20 * 1024 * 1024;
|
|
21040
|
-
function
|
|
21159
|
+
function resolveRenderRequestPolicy(options) {
|
|
21160
|
+
return {
|
|
21161
|
+
projectsDir: resolve10(
|
|
21162
|
+
options.projectsDir ?? (process.env.PRODUCER_PROJECTS_DIR || process.cwd())
|
|
21163
|
+
),
|
|
21164
|
+
allowDebug: options.allowDebug ?? process.env.PRODUCER_ALLOW_DEBUG === "1"
|
|
21165
|
+
};
|
|
21166
|
+
}
|
|
21167
|
+
function isAllowedProjectPath(projectsDir, path) {
|
|
21168
|
+
return isSafePath(projectsDir, path) && !isSafePath(resolveRenderDebugDir(), path);
|
|
21169
|
+
}
|
|
21170
|
+
function isAllowedEntryPath(policy, projectDir, path) {
|
|
21171
|
+
return isSafePath(projectDir, path) && isAllowedProjectPath(policy.projectsDir, path);
|
|
21172
|
+
}
|
|
21173
|
+
function prepareProjectDirectory(projectDir, options, policy) {
|
|
21041
21174
|
const candidate = nonEmptyString(projectDir);
|
|
21042
21175
|
if (!candidate) return null;
|
|
21043
|
-
const absProjectDir = resolve10(candidate);
|
|
21044
|
-
|
|
21045
|
-
|
|
21176
|
+
const absProjectDir = policy ? resolve10(policy.projectsDir, candidate) : resolve10(candidate);
|
|
21177
|
+
const shown = policy ? candidate : absProjectDir;
|
|
21178
|
+
if (policy && !isAllowedProjectPath(policy.projectsDir, absProjectDir) || !existsSync31(absProjectDir) || !statSync11(absProjectDir).isDirectory()) {
|
|
21179
|
+
return { error: `Project directory not found: ${shown}` };
|
|
21046
21180
|
}
|
|
21047
21181
|
const entry = options.entryFile || "index.html";
|
|
21048
|
-
|
|
21049
|
-
|
|
21182
|
+
const entryPath = resolve10(absProjectDir, entry);
|
|
21183
|
+
if (policy && !isAllowedEntryPath(policy, absProjectDir, entryPath) || !existsSync31(entryPath)) {
|
|
21184
|
+
return { error: `Entry file "${entry}" not found in project directory: ${shown}` };
|
|
21050
21185
|
}
|
|
21051
21186
|
return { prepared: { input: { projectDir: absProjectDir, ...options } } };
|
|
21052
21187
|
}
|
|
@@ -21075,15 +21210,18 @@ function materializeInlineProject(html, options) {
|
|
|
21075
21210
|
}
|
|
21076
21211
|
};
|
|
21077
21212
|
}
|
|
21078
|
-
async function prepareRenderBody(body) {
|
|
21213
|
+
async function prepareRenderBody(body, policy) {
|
|
21079
21214
|
const overrideError = validateRenderOverrides(body);
|
|
21080
21215
|
if (overrideError) return { error: overrideError };
|
|
21216
|
+
if (policy && body.debug === true && !policy.allowDebug) {
|
|
21217
|
+
return { error: "debug is disabled on this server (set allowDebug or PRODUCER_ALLOW_DEBUG=1)" };
|
|
21218
|
+
}
|
|
21081
21219
|
const pageMotionBlur = body.pageMotionBlur;
|
|
21082
21220
|
if (pageMotionBlur !== void 0 && pageMotionBlur !== "off") {
|
|
21083
21221
|
return { error: "pageMotionBlur must be off when supplied" };
|
|
21084
21222
|
}
|
|
21085
21223
|
const options = { ...parseRenderOptions(body), pageMotionBlur };
|
|
21086
|
-
const project = prepareProjectDirectory(body.projectDir, options);
|
|
21224
|
+
const project = prepareProjectDirectory(body.projectDir, options, policy);
|
|
21087
21225
|
if (project) return project;
|
|
21088
21226
|
const source = await resolveInlineRenderHtml(body);
|
|
21089
21227
|
return "error" in source ? source : materializeInlineProject(source.html, options);
|
|
@@ -21136,6 +21274,9 @@ function cleanupTempDir(dir, log) {
|
|
|
21136
21274
|
});
|
|
21137
21275
|
}
|
|
21138
21276
|
}
|
|
21277
|
+
function publicPerfSummary(job) {
|
|
21278
|
+
return job.perfSummary ? { ...job.perfSummary, renderId: void 0 } : null;
|
|
21279
|
+
}
|
|
21139
21280
|
function outputFileSize(path) {
|
|
21140
21281
|
return existsSync31(path) ? statSync11(path).size : 0;
|
|
21141
21282
|
}
|
|
@@ -21148,7 +21289,7 @@ function createBlockingProgressReporter(log, requestId) {
|
|
|
21148
21289
|
log.info(`render progress ${pct}%`, { requestId, stage: job.currentStage, message });
|
|
21149
21290
|
};
|
|
21150
21291
|
}
|
|
21151
|
-
async function prepareSseRenderRequest(c, stream, requestId) {
|
|
21292
|
+
async function prepareSseRenderRequest(c, stream, requestId, policy) {
|
|
21152
21293
|
let body;
|
|
21153
21294
|
try {
|
|
21154
21295
|
body = await c.req.json();
|
|
@@ -21163,7 +21304,7 @@ async function prepareSseRenderRequest(c, stream, requestId) {
|
|
|
21163
21304
|
});
|
|
21164
21305
|
return null;
|
|
21165
21306
|
}
|
|
21166
|
-
const prepared = await prepareRenderBody(body);
|
|
21307
|
+
const prepared = await prepareRenderBody(body, policy);
|
|
21167
21308
|
if (!("error" in prepared)) return prepared.prepared;
|
|
21168
21309
|
await stream.writeSSE({
|
|
21169
21310
|
data: JSON.stringify({
|
|
@@ -21235,6 +21376,7 @@ function createRenderHandlers(options = {}) {
|
|
|
21235
21376
|
const getRequestId = options.getRequestId ?? ((c) => c.req.header("x-request-id") || crypto.randomUUID());
|
|
21236
21377
|
const outputUrlPrefix = options.outputUrlPrefix ?? "/outputs";
|
|
21237
21378
|
const rendersDir = options.rendersDir ?? process.env.PRODUCER_RENDERS_DIR ?? "/tmp";
|
|
21379
|
+
const policy = options.confineRequests ? resolveRenderRequestPolicy(options) : void 0;
|
|
21238
21380
|
const artifactTtlMs = options.artifactTtlMs ?? Number(process.env.PRODUCER_OUTPUT_ARTIFACT_TTL_MS || 15 * 60 * 1e3);
|
|
21239
21381
|
const store = createArtifactStore(artifactTtlMs);
|
|
21240
21382
|
const maxConcurrentRenders = options.maxConcurrentRenders ?? Number(process.env.PRODUCER_MAX_CONCURRENT_RENDERS || 2);
|
|
@@ -21253,7 +21395,18 @@ function createRenderHandlers(options = {}) {
|
|
|
21253
21395
|
} catch {
|
|
21254
21396
|
return c.json({ success: false, requestId, error: "Invalid JSON body" }, 400);
|
|
21255
21397
|
}
|
|
21256
|
-
const
|
|
21398
|
+
const lintProjectDir = nonEmptyString(body.projectDir);
|
|
21399
|
+
let isAllowedEntry;
|
|
21400
|
+
if (policy && lintProjectDir) {
|
|
21401
|
+
const absProjectDir = resolve10(policy.projectsDir, lintProjectDir);
|
|
21402
|
+
if (!isAllowedProjectPath(policy.projectsDir, absProjectDir)) {
|
|
21403
|
+
const error = `Project directory not found: ${lintProjectDir}`;
|
|
21404
|
+
return c.json({ success: false, requestId, error }, 400);
|
|
21405
|
+
}
|
|
21406
|
+
body = { ...body, projectDir: absProjectDir };
|
|
21407
|
+
isAllowedEntry = (path) => isAllowedEntryPath(policy, absProjectDir, path);
|
|
21408
|
+
}
|
|
21409
|
+
const preparedResult = prepareHyperframeLintBody(body, isAllowedEntry);
|
|
21257
21410
|
if ("error" in preparedResult) {
|
|
21258
21411
|
return c.json({ success: false, requestId, error: preparedResult.error }, 400);
|
|
21259
21412
|
}
|
|
@@ -21282,11 +21435,11 @@ function createRenderHandlers(options = {}) {
|
|
|
21282
21435
|
} catch {
|
|
21283
21436
|
return c.json({ success: false, requestId, error: "Invalid JSON body" }, 400);
|
|
21284
21437
|
}
|
|
21285
|
-
const preparedResult = await prepareRenderBody(body);
|
|
21438
|
+
const preparedResult = await prepareRenderBody(body, policy);
|
|
21286
21439
|
if ("error" in preparedResult) {
|
|
21287
21440
|
return c.json({ success: false, requestId, error: preparedResult.error }, 400);
|
|
21288
21441
|
}
|
|
21289
|
-
const preparedJob = prepareRenderJob(preparedResult.prepared, rendersDir, log);
|
|
21442
|
+
const preparedJob = prepareRenderJob(preparedResult.prepared, rendersDir, log, !!policy);
|
|
21290
21443
|
if ("error" in preparedJob) {
|
|
21291
21444
|
return c.json({ success: false, requestId, error: preparedJob.error }, 400);
|
|
21292
21445
|
}
|
|
@@ -21327,7 +21480,7 @@ function createRenderHandlers(options = {}) {
|
|
|
21327
21480
|
videoDurationSeconds: job.duration ?? null,
|
|
21328
21481
|
outcome: job.outcome ?? "completed",
|
|
21329
21482
|
warnings: job.warnings,
|
|
21330
|
-
perf: job.perfSummary ?? null,
|
|
21483
|
+
perf: policy ? publicPerfSummary(job) : job.perfSummary ?? null,
|
|
21331
21484
|
...strictVariablesResult(job)
|
|
21332
21485
|
});
|
|
21333
21486
|
} catch (error) {
|
|
@@ -21364,9 +21517,9 @@ function createRenderHandlers(options = {}) {
|
|
|
21364
21517
|
return streamSSE(c, async (stream) => {
|
|
21365
21518
|
const requestId = getRequestId(c);
|
|
21366
21519
|
const t0 = Date.now();
|
|
21367
|
-
const prepared = await prepareSseRenderRequest(c, stream, requestId);
|
|
21520
|
+
const prepared = await prepareSseRenderRequest(c, stream, requestId, policy);
|
|
21368
21521
|
if (!prepared) return;
|
|
21369
|
-
const preparedJob = prepareRenderJob(prepared, rendersDir, log);
|
|
21522
|
+
const preparedJob = prepareRenderJob(prepared, rendersDir, log, !!policy);
|
|
21370
21523
|
if ("error" in preparedJob) {
|
|
21371
21524
|
await stream.writeSSE({
|
|
21372
21525
|
data: JSON.stringify({
|
|
@@ -21423,7 +21576,7 @@ function createRenderHandlers(options = {}) {
|
|
|
21423
21576
|
videoDurationSeconds: job.duration ?? null,
|
|
21424
21577
|
outcome: job.outcome ?? "completed",
|
|
21425
21578
|
warnings: job.warnings,
|
|
21426
|
-
perf: job.perfSummary ?? null,
|
|
21579
|
+
perf: policy ? publicPerfSummary(job) : job.perfSummary ?? null,
|
|
21427
21580
|
producerVersion: readProducerVersion(),
|
|
21428
21581
|
...strictVariablesResult(job)
|
|
21429
21582
|
})
|
|
@@ -21481,9 +21634,79 @@ function isCrossOriginBrowserRequest(c) {
|
|
|
21481
21634
|
return true;
|
|
21482
21635
|
}
|
|
21483
21636
|
}
|
|
21637
|
+
function hostnameOf(host) {
|
|
21638
|
+
try {
|
|
21639
|
+
return new URL(`http://${host}`).hostname.toLowerCase();
|
|
21640
|
+
} catch {
|
|
21641
|
+
return null;
|
|
21642
|
+
}
|
|
21643
|
+
}
|
|
21644
|
+
function isAllowedBrowserHostname(hostname2, allowed) {
|
|
21645
|
+
if (!hostname2) return false;
|
|
21646
|
+
if (hostname2 === "localhost" || hostname2.endsWith(".localhost")) return true;
|
|
21647
|
+
if (isIP(hostname2.replace(/^\[|\]$/g, "")) !== 0) return true;
|
|
21648
|
+
return allowed.has(hostname2);
|
|
21649
|
+
}
|
|
21650
|
+
function allowedHostnames(options) {
|
|
21651
|
+
const fromEnv = (process.env.PRODUCER_ALLOWED_HOSTS ?? "").split(",");
|
|
21652
|
+
const names = /* @__PURE__ */ new Set();
|
|
21653
|
+
for (const entry of [...options.allowedHosts ?? [], ...fromEnv]) {
|
|
21654
|
+
const hostname2 = entry.trim() ? hostnameOf(entry.trim()) : null;
|
|
21655
|
+
if (hostname2) names.add(hostname2);
|
|
21656
|
+
}
|
|
21657
|
+
return names;
|
|
21658
|
+
}
|
|
21659
|
+
function resolveAuthToken(options) {
|
|
21660
|
+
return options.authToken?.trim() || process.env.PRODUCER_AUTH_TOKEN?.trim() || "";
|
|
21661
|
+
}
|
|
21662
|
+
function hasBearerToken(c, token) {
|
|
21663
|
+
const digest = (value) => crypto.createHash("sha256").update(value).digest();
|
|
21664
|
+
return crypto.timingSafeEqual(
|
|
21665
|
+
digest(c.req.header("authorization") ?? ""),
|
|
21666
|
+
digest(`Bearer ${token}`)
|
|
21667
|
+
);
|
|
21668
|
+
}
|
|
21669
|
+
function isLoopbackHostname(hostname2) {
|
|
21670
|
+
const host = hostname2.replace(/^\[|\]$/g, "").toLowerCase();
|
|
21671
|
+
return host === "localhost" || host === "::1" || isIP(host) === 4 && host.startsWith("127.");
|
|
21672
|
+
}
|
|
21673
|
+
function isDisallowedBrowserHost(c, allowed) {
|
|
21674
|
+
const origin = c.req.header("origin");
|
|
21675
|
+
if (!origin && !c.req.header("sec-fetch-site")) return false;
|
|
21676
|
+
if (!isAllowedBrowserHostname(hostnameOf(c.req.header("host") ?? ""), allowed)) return true;
|
|
21677
|
+
if (!origin) return false;
|
|
21678
|
+
try {
|
|
21679
|
+
return !isAllowedBrowserHostname(new URL(origin).hostname.toLowerCase(), allowed);
|
|
21680
|
+
} catch {
|
|
21681
|
+
return true;
|
|
21682
|
+
}
|
|
21683
|
+
}
|
|
21484
21684
|
function createProducerApp(options = {}) {
|
|
21485
21685
|
const app = new Hono2();
|
|
21486
|
-
const handlers = createRenderHandlers(
|
|
21686
|
+
const handlers = createRenderHandlers({
|
|
21687
|
+
...options,
|
|
21688
|
+
confineRequests: options.confineRequests ?? true
|
|
21689
|
+
});
|
|
21690
|
+
const allowed = allowedHostnames(options);
|
|
21691
|
+
const authToken = resolveAuthToken(options);
|
|
21692
|
+
app.use("*", async (c, next) => {
|
|
21693
|
+
if (authToken && c.req.path !== "/health" && !hasBearerToken(c, authToken)) {
|
|
21694
|
+
return c.json({ success: false, error: "Unauthorized" }, 401);
|
|
21695
|
+
}
|
|
21696
|
+
await next();
|
|
21697
|
+
});
|
|
21698
|
+
app.use("*", async (c, next) => {
|
|
21699
|
+
if (isDisallowedBrowserHost(c, allowed)) {
|
|
21700
|
+
return c.json(
|
|
21701
|
+
{
|
|
21702
|
+
success: false,
|
|
21703
|
+
error: "Host not allowed. Add it to allowedHosts or PRODUCER_ALLOWED_HOSTS."
|
|
21704
|
+
},
|
|
21705
|
+
403
|
|
21706
|
+
);
|
|
21707
|
+
}
|
|
21708
|
+
await next();
|
|
21709
|
+
});
|
|
21487
21710
|
app.post("*", async (c, next) => {
|
|
21488
21711
|
if (isCrossOriginBrowserRequest(c)) {
|
|
21489
21712
|
return c.json({ success: false, error: "Cross-origin requests are not allowed" }, 403);
|
|
@@ -21500,10 +21723,17 @@ function createProducerApp(options = {}) {
|
|
|
21500
21723
|
}
|
|
21501
21724
|
function startServer(options = {}) {
|
|
21502
21725
|
const port = options.port ?? parseInt(process.env.PRODUCER_PORT ?? "9847", 10);
|
|
21726
|
+
const hostname2 = options.hostname || process.env.PRODUCER_HOST || "127.0.0.1";
|
|
21503
21727
|
const log = options.logger ?? defaultLogger;
|
|
21728
|
+
if (!isLoopbackHostname(hostname2) && !resolveAuthToken(options)) {
|
|
21729
|
+
throw new Error(
|
|
21730
|
+
`Refusing to listen on ${hostname2} without an auth token. Set authToken or PRODUCER_AUTH_TOKEN, or listen on a loopback address.`
|
|
21731
|
+
);
|
|
21732
|
+
}
|
|
21504
21733
|
const app = createProducerApp(options);
|
|
21505
|
-
const server = serve2({ fetch: app.fetch, port }, () => {
|
|
21506
|
-
|
|
21734
|
+
const server = serve2({ fetch: app.fetch, port, hostname: hostname2 }, (info) => {
|
|
21735
|
+
const address = info.family === "IPv6" ? `[${info.address}]` : info.address;
|
|
21736
|
+
log.info(`Listening on http://${address}:${info.port}`);
|
|
21507
21737
|
});
|
|
21508
21738
|
server.setTimeout(0);
|
|
21509
21739
|
server.requestTimeout = 0;
|
|
@@ -21514,7 +21744,7 @@ function startServer(options = {}) {
|
|
|
21514
21744
|
});
|
|
21515
21745
|
async function shutdown(signal) {
|
|
21516
21746
|
log.info(`Received ${signal}, shutting down`);
|
|
21517
|
-
const { drainBrowserPool } = await import("./src-
|
|
21747
|
+
const { drainBrowserPool } = await import("./src-UQ3K3UW2.js");
|
|
21518
21748
|
await drainBrowserPool().catch(() => {
|
|
21519
21749
|
});
|
|
21520
21750
|
const handle = await Promise.race([
|
|
@@ -21565,7 +21795,7 @@ import {
|
|
|
21565
21795
|
statSync as statSync12,
|
|
21566
21796
|
writeFileSync as writeFileSync14
|
|
21567
21797
|
} from "fs";
|
|
21568
|
-
import { basename as basename7, dirname as
|
|
21798
|
+
import { basename as basename7, dirname as dirname19, join as join47 } from "path";
|
|
21569
21799
|
function cfrRateControlArgs(locked) {
|
|
21570
21800
|
const preset = getEncoderPreset(locked.quality ?? "standard", "mp4");
|
|
21571
21801
|
if (locked.crf == null && locked.bitrate) {
|
|
@@ -21598,10 +21828,10 @@ async function assemble(planDir, chunkOutputs, audioPath, outputPath, options) {
|
|
|
21598
21828
|
}
|
|
21599
21829
|
const format = plan2.dimensions.format;
|
|
21600
21830
|
const cfrEncoder = cfr ? readCfrEncoder(planDir, format) : null;
|
|
21601
|
-
if (!existsSync32(
|
|
21602
|
-
mkdirSync20(
|
|
21831
|
+
if (!existsSync32(dirname19(outputPath))) {
|
|
21832
|
+
mkdirSync20(dirname19(outputPath), { recursive: true });
|
|
21603
21833
|
}
|
|
21604
|
-
const workDir = createStagingDir(
|
|
21834
|
+
const workDir = createStagingDir(dirname19(outputPath), `${basename7(outputPath)}.assemble-work-`);
|
|
21605
21835
|
const fps = { num: plan2.dimensions.fpsNum, den: plan2.dimensions.fpsDen };
|
|
21606
21836
|
const stageMs = {};
|
|
21607
21837
|
const ctx = {
|