hyperframes 0.9.37 → 0.9.38
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-IQIHS7ZQ.js → add-IEVY5ZTY.js} +11 -11
- package/dist/{agentPromptGenerator-PBF4MT4B.js → agentPromptGenerator-W2NZ4COJ.js} +6 -6
- package/dist/{animatedGifPrep-7TU6NVDE.js → animatedGifPrep-AIYBHZES.js} +6 -6
- package/dist/api.js +29 -29
- package/dist/{asset-4VSZJOKY.js → asset-NHHEDE53.js} +2 -2
- package/dist/{assetCataloger-PZJR537U.js → assetCataloger-7EQLQWVV.js} +7 -7
- package/dist/{audio-7PWVXSJ2.js → audio-TLLIF3TI.js} +12 -12
- package/dist/{auth-FZ6KZXCL.js → auth-2C5XTYT4.js} +2 -2
- package/dist/{autoUpdate-7B7CD4CQ.js → autoUpdate-S2X7VVX3.js} +2 -2
- package/dist/{avatars-KNHYAOJ4.js → avatars-IJ3B6S32.js} +10 -10
- package/dist/{backgroundChecks-FH2UEVAI.js → backgroundChecks-G56TRIP2.js} +3 -3
- package/dist/backgroundChecksWorker.js +3 -3
- package/dist/{batchRender-OSW3B7A4.js → batchRender-Y6NA4R3W.js} +3 -3
- package/dist/{beats-BW4A2LQ6.js → beats-TAXLD6NH.js} +8 -8
- package/dist/{benchmark-L2WT64XD.js → benchmark-2SHNYHZE.js} +10 -9
- package/dist/{billing-PEFWMJYB.js → billing-44BYXBZX.js} +10 -10
- package/dist/{browser-CZUTCLHK.js → browser-TIBVO5YT.js} +5 -5
- package/dist/{bundleWithLocalizedFonts-IZYW6FIV.js → bundleWithLocalizedFonts-IFN5QSDV.js} +1 -1
- package/dist/{capture-G3OGRUAN.js → capture-7XU2G5CC.js} +3 -3
- package/dist/{capture-NCR2BPKV.js → capture-BTERGN3O.js} +14 -14
- package/dist/{captureCompositionFrame-M2MTVFPY.js → captureCompositionFrame-X2N335V4.js} +13 -13
- package/dist/{catalog-EZP2RWMC.js → catalog-CGZNRLZT.js} +11 -11
- package/dist/{catch-up-IAGAFBUC.js → catch-up-HEHEQUGU.js} +6 -6
- package/dist/{check-Y5ZDSFTL.js → check-B5T4EBDP.js} +38 -38
- package/dist/{checkAudio-UPKSXM6O.js → checkAudio-PNUO23UR.js} +9 -9
- package/dist/{checkBrowser-E3JKBE6E.js → checkBrowser-JF2RQHAL.js} +32 -32
- package/dist/{chunk-P3BHYHEJ.js → chunk-25VZ5TWE.js} +1 -1
- package/dist/{chunk-WMNHHH4G.js → chunk-2JUMKKYH.js} +2 -2
- package/dist/{chunk-NSUA7UGO.js → chunk-2U7EE6EV.js} +3 -3
- package/dist/chunk-2WSLAKIR.js +5053 -0
- package/dist/{chunk-2FY24OAX.js → chunk-3HF2M6AD.js} +1 -1
- package/dist/{chunk-6UQGCFPG.js → chunk-3OE63NFV.js} +2 -2
- package/dist/{chunk-PVC2IEBV.js → chunk-3QN5M3EV.js} +14 -14
- package/dist/{chunk-TJN27NAJ.js → chunk-43H26GOF.js} +7 -7
- package/dist/{chunk-OJEU6EGQ.js → chunk-45WB2J2V.js} +2 -2
- package/dist/{chunk-UVFK4ZJX.js → chunk-4UQPFLJ5.js} +3 -3
- package/dist/{chunk-AC7KSSDQ.js → chunk-6EHXBROO.js} +2 -2
- package/dist/{chunk-UD3JHXDK.js → chunk-6QI3C6QB.js} +2 -2
- package/dist/{chunk-RI4QWPMN.js → chunk-7ICZWIRY.js} +3 -3
- package/dist/{chunk-NC7ZNIXW.js → chunk-7LE2QT2G.js} +1 -1
- package/dist/{chunk-ZZH3BDBR.js → chunk-7T2WUGUN.js} +2 -2
- package/dist/{chunk-IL3VIGJ6.js → chunk-7TEB7IL6.js} +2 -2
- package/dist/{chunk-PK5I3C5A.js → chunk-7VYOOUKU.js} +2 -2
- package/dist/{chunk-DHYYW7TY.js → chunk-AGPIBKN2.js} +3 -3
- package/dist/{chunk-Y47OUROH.js → chunk-AT4BZJKA.js} +1 -1
- package/dist/{chunk-HOKYS2AJ.js → chunk-ATKCZQEN.js} +2 -2
- package/dist/{chunk-57NAJJ2L.js → chunk-BBN7YIEJ.js} +2 -2
- package/dist/{chunk-IB4TJZZM.js → chunk-BC3KAELK.js} +1 -1
- package/dist/{chunk-LGPEN7SE.js → chunk-BPJOCETK.js} +3 -3
- package/dist/{chunk-Y3VS2ULV.js → chunk-CFMC3TWY.js} +1 -1
- package/dist/{chunk-JJA4EMNO.js → chunk-CJAYLJIZ.js} +4 -2
- package/dist/{chunk-VIFUSDHT.js → chunk-CJW5HASG.js} +7 -7
- package/dist/{chunk-OT2VLOPB.js → chunk-CRISFXYR.js} +2 -2
- package/dist/{chunk-XLUF4H7G.js → chunk-DGZZ2GD6.js} +1 -1
- package/dist/{chunk-SF2MHFM4.js → chunk-DQWWKLH3.js} +1 -1
- package/dist/{chunk-D7NBFM36.js → chunk-DUB3IS5Y.js} +1 -1
- package/dist/{chunk-ZHOC7WEG.js → chunk-DZGRFSXY.js} +10 -10
- package/dist/{chunk-WQJ5W4WM.js → chunk-EBC6G2QR.js} +1 -1
- package/dist/{chunk-JKUC7A3A.js → chunk-EXBLXMR3.js} +1 -1
- package/dist/{chunk-L2MAAYAE.js → chunk-FRJNLOOM.js} +1 -1
- package/dist/{chunk-464YPKAD.js → chunk-FWHISQIS.js} +1 -1
- package/dist/{chunk-23FXEJJT.js → chunk-FXKZZMW3.js} +1 -1
- package/dist/{chunk-W6EIGNTX.js → chunk-G3GR4AJH.js} +2 -2
- package/dist/{chunk-36P26ILD.js → chunk-G5RQZWGR.js} +2 -2
- package/dist/{chunk-FB52G27O.js → chunk-GRIGQX2K.js} +1 -1
- package/dist/{chunk-275HEJWI.js → chunk-GWGCECGA.js} +1 -1
- package/dist/{chunk-NL2BKQBO.js → chunk-HCFWBSBP.js} +2 -2
- package/dist/{chunk-6Q2FBJUF.js → chunk-HN3RMJ7S.js} +1 -1
- package/dist/{chunk-OFPYC4XF.js → chunk-I6FQEMLX.js} +1 -1
- package/dist/{chunk-TF3RW2VO.js → chunk-IBJXNAB7.js} +3 -3
- package/dist/{chunk-5KDBUZEB.js → chunk-IDQKSSNE.js} +1 -1
- package/dist/{chunk-ZPGODXXD.js → chunk-IHWZEEJU.js} +1 -1
- package/dist/{chunk-YUQC2PFF.js → chunk-INISVVHP.js} +2 -2
- package/dist/{chunk-SEZQDAYP.js → chunk-J4K7QPM3.js} +10 -10
- package/dist/{chunk-BRTRZFR3.js → chunk-JBDYZFXX.js} +7 -7
- package/dist/{chunk-JCIWX3ZX.js → chunk-JNWVE6QJ.js} +1 -1
- package/dist/{chunk-VDT2JIH2.js → chunk-JYBGWNAP.js} +221 -191
- package/dist/{chunk-43KCJ64B.js → chunk-KKA7VISD.js} +15 -8
- package/dist/{chunk-2XMF3H4T.js → chunk-KZ6TBE2G.js} +1 -1
- package/dist/{chunk-A25ISJEK.js → chunk-LMQTOEVK.js} +1 -1
- package/dist/{chunk-DPKNVEUN.js → chunk-MCU74LYV.js} +67 -7
- package/dist/{chunk-ILIYAYQJ.js → chunk-MN57XFZB.js} +1 -1
- package/dist/{chunk-VO7JX5MH.js → chunk-MVFQPHHF.js} +1 -1
- package/dist/{chunk-5I3EM64R.js → chunk-N4UJZODY.js} +1 -1
- package/dist/{chunk-64KB74WF.js → chunk-NKSEABTT.js} +13 -13
- package/dist/{chunk-H7ECN5WE.js → chunk-OSWXX73R.js} +2 -2
- package/dist/{chunk-ZMJMY5CR.js → chunk-OV3GXLBL.js} +1 -1
- package/dist/{chunk-EEY2ZTO7.js → chunk-PYM4KYRK.js} +4 -4
- package/dist/{chunk-KLDMFHQP.js → chunk-QDWQSLPG.js} +5 -5
- package/dist/{chunk-VOP4S73F.js → chunk-RDC2CERU.js} +2 -2
- package/dist/{chunk-SURRJYN5.js → chunk-RGR7L4YG.js} +1 -1
- package/dist/{chunk-LTB6C2S2.js → chunk-RLGGHE3P.js} +1 -1
- package/dist/{chunk-3GHXPNOB.js → chunk-RTBYKJHZ.js} +2 -2
- package/dist/{chunk-OX73UETR.js → chunk-SNYJ66I4.js} +4 -4
- package/dist/{chunk-X3QJIV5L.js → chunk-SQ3VCDCO.js} +2 -2
- package/dist/{chunk-DOKWEMRD.js → chunk-TE433BWF.js} +66 -18
- package/dist/{chunk-TNQLOBHZ.js → chunk-TM4UMUUT.js} +1 -1
- package/dist/{chunk-YLKJSPO4.js → chunk-TVSUPOOH.js} +74 -61
- package/dist/{chunk-XRWK2BXI.js → chunk-TY4VNKLA.js} +3 -3
- package/dist/{chunk-6BRNC42U.js → chunk-UA2MLJVX.js} +1 -1
- package/dist/{chunk-7E2IR5YL.js → chunk-UBOHJOC7.js} +1 -1
- package/dist/{chunk-HQKQ7G6L.js → chunk-V2WVNSHB.js} +1 -1
- package/dist/{chunk-424M5ITI.js → chunk-VJSO5TVW.js} +1 -1
- package/dist/{chunk-EYCOZTOP.js → chunk-W6H56FIH.js} +1 -1
- package/dist/{chunk-3YWAA2CG.js → chunk-WMIYOQQP.js} +2 -2
- package/dist/{chunk-BZRQQI27.js → chunk-WNS5T3BE.js} +20 -20
- package/dist/{chunk-K3G3RYZY.js → chunk-X247IH65.js} +2 -2
- package/dist/{chunk-PNJC2462.js → chunk-XH3W57AM.js} +6 -6
- package/dist/{chunk-CNAVFDUF.js → chunk-XHAATB5N.js} +3 -3
- package/dist/{chunk-H23DEQUR.js → chunk-XIDRTKQT.js} +4 -4
- package/dist/{chunk-N63ML5LM.js → chunk-XVD33SRZ.js} +1 -1
- package/dist/{chunk-VJCGDSYU.js → chunk-YVS5243B.js} +1 -1
- package/dist/{chunk-K7E6H4DR.js → chunk-YZXAD75P.js} +3 -3
- package/dist/{chunk-OPMYN4QX.js → chunk-Z3BT4JL7.js} +5 -5
- package/dist/{chunk-3RMYJGDR.js → chunk-ZEYCP2XQ.js} +7 -7
- package/dist/{chunk-VXTCMPNE.js → chunk-ZI3POUYS.js} +3 -3
- package/dist/{chunk-IJNSVKFB.js → chunk-ZKIGZ5JN.js} +2 -2
- package/dist/{chunk-4RHBW4E7.js → chunk-ZR372CI2.js} +4 -4
- package/dist/{clean-H7533JWH.js → clean-2WDJJHWC.js} +16 -16
- package/dist/cli.js +62 -62
- package/dist/{cloud-SKP5HRF6.js → cloud-QIS5EIPE.js} +4 -4
- package/dist/{cloudrun-DHM2JTF4.js → cloudrun-QLREZHOA.js} +4 -4
- package/dist/{compare-73KIXXO4.js → compare-7F5BZ5FS.js} +29 -29
- package/dist/{compiler-M72SGDOU.js → compiler-65OMBHLD.js} +3 -3
- package/dist/{component-S36I7EO7.js → component-FULUAJNE.js} +3 -3
- package/dist/{compositions-A52NWBWZ.js → compositions-BJUFWEII.js} +10 -10
- package/dist/{curve-EVDIGJYH.js → curve-SVA33EXV.js} +10 -10
- package/dist/{cuts-F3FIOBTA.js → cuts-F263EEEP.js} +11 -11
- package/dist/{delete-TDRI7D5U.js → delete-2NRKX42A.js} +2 -2
- package/dist/{deploy-JZB6L4J4.js → deploy-BVEXTGBD.js} +2 -2
- package/dist/{describeProject-H36ODIUH.js → describeProject-WAOK5I27.js} +7 -7
- package/dist/{destroy-WV6MWU2X.js → destroy-GLDKI6G2.js} +2 -2
- package/dist/{diff-NAG2HJBV.js → diff-2UIOCAPE.js} +28 -28
- package/dist/{dist-E6EIPNKP.js → dist-APGYU7T5.js} +2 -2
- package/dist/{dist-7HLUWFLO.js → dist-E4C3FE62.js} +1 -1
- package/dist/{dist-OM5EYFH7.js → dist-GCZODNTZ.js} +9 -9
- package/dist/{doctor-VQ7ZUC5L.js → doctor-4F4OTWQE.js} +10 -10
- package/dist/{energy-4MXJFKNG.js → energy-ITPX36L7.js} +11 -11
- package/dist/{events-C5QIPKS6.js → events-EXRYMUQQ.js} +5 -5
- package/dist/{events-YEM2QSWC.js → events-GFLX43TF.js} +12 -12
- package/dist/{events-RXRGHWXQ.js → events-XXHDLYPI.js} +2 -2
- package/dist/{execute-OR5EMOBQ.js → execute-YT5G3S66.js} +22 -22
- package/dist/{extract-J5432KPU.js → extract-WHH3KNQP.js} +11 -11
- package/dist/{face-HXKBJG63.js → face-73TVACYJ.js} +11 -11
- package/dist/{feedback-BHKFHVZA.js → feedback-MXPO6OKT.js} +9 -9
- package/dist/{ffmpeg-VK4BG6KD.js → ffmpeg-R6ZL2OTQ.js} +6 -6
- package/dist/{figma-SPZF4LB6.js → figma-T5YTCXNN.js} +3 -3
- package/dist/fontLocalizeCli.js +9 -9
- package/dist/{frames-RVL3EUMR.js → frames-XPYXDABB.js} +12 -12
- package/dist/{generate-KMDMGHHQ.js → generate-OUTENVD6.js} +20 -20
- package/dist/{get-QOMTEU33.js → get-VYSIHMRG.js} +2 -2
- package/dist/{gpuPolicy-ZKTLDRVT.js → gpuPolicy-Y2PRFRIM.js} +6 -6
- package/dist/{grade-compare-RUIBGR5N.js → grade-compare-HUINMXRB.js} +30 -30
- package/dist/{heifImagePrep-EOEEK5ZL.js → heifImagePrep-5TT3LUUH.js} +7 -7
- package/dist/{help-JM4PZD5K.js → help-2EU2GGRG.js} +1 -1
- package/dist/{history-MHSGJDAM.js → history-AUPHP7HT.js} +8 -8
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +64 -64
- package/dist/hyperframes-player.global.js +1 -1
- package/dist/{info-VZDNMGKV.js → info-XVUIJXJ2.js} +12 -12
- package/dist/{init-H7J3LFXP.js → init-JNZAHOUB.js} +26 -26
- package/dist/{ink-PZZ7VSVL.js → ink-7FCGHCVT.js} +11 -11
- package/dist/{inspect-IK4BU2MQ.js → inspect-NWS6GJWE.js} +30 -30
- package/dist/{installer-2S27QSFN.js → installer-TPMWCI73.js} +4 -4
- package/dist/{keyframes-KLMHHNGZ.js → keyframes-5T7BZEDG.js} +8 -8
- package/dist/{lambda-3QKEQ4SO.js → lambda-A7HZ4ZWN.js} +11 -11
- package/dist/{layout-HGL32QP2.js → layout-M3UWVXOY.js} +30 -30
- package/dist/{lint-IZJ3YYBY.js → lint-2O3O6WW5.js} +9 -9
- package/dist/{lintProject-X7DFX2TQ.js → lintProject-O3YGJFWF.js} +1 -1
- package/dist/{list-BV5ZCZT7.js → list-6VQTYIOQ.js} +2 -2
- package/dist/{localPage-SKD7BT3F.js → localPage-INRAYY2V.js} +6 -6
- package/dist/{login-5EE4LETP.js → login-ZKOYK3RJ.js} +4 -4
- package/dist/{look-P7O2I4L2.js → look-KFOQGREJ.js} +11 -11
- package/dist/{manager-CK7ICQLP.js → manager-Z5YCXHYX.js} +7 -7
- package/dist/{measure-C4JEN64J.js → measure-QA2FBQ33.js} +11 -11
- package/dist/{media-treatment-IGLDY62E.js → media-treatment-4VASTUCZ.js} +12 -12
- package/dist/{media-use-BAIFE26K.js → media-use-2FKER6HL.js} +3 -3
- package/dist/{models-QVVUPP4B.js → models-XZBGKEZW.js} +10 -10
- package/dist/{motionShot-PFM6X5VE.js → motionShot-AHK27S4Z.js} +16 -16
- package/dist/{normalize-audio-WKSQSX26.js → normalize-audio-NTMEHSBR.js} +8 -8
- package/dist/{open-ZKBQRQRC.js → open-F3CKZUBT.js} +11 -11
- package/dist/{parakeetRunner-PIIIYEOE.js → parakeetRunner-JN73STJC.js} +11 -11
- package/dist/{pipeline-AMEOOSDZ.js → pipeline-VUS7LINW.js} +9 -9
- package/dist/{plan-2QUTC33A.js → plan-AGZGV67Q.js} +17 -17
- package/dist/{play-ECN4IJ3Y.js → play-D2GVDYTV.js} +20 -20
- package/dist/{preflight-N6HCWLZE.js → preflight-EDQAPRCV.js} +7 -7
- package/dist/{present-WNUBLYIS.js → present-HM5NE7K2.js} +16 -16
- package/dist/{preview-2ETDMQIS.js → preview-F2BF2MXW.js} +17 -17
- package/dist/{probe-Y6IUEHFX.js → probe-JYJ7XB4N.js} +11 -11
- package/dist/{producer-UXWV4CHN.js → producer-RULBQZPW.js} +1 -1
- package/dist/{projectConfig-42S6NSDI.js → projectConfig-2YW4KK5G.js} +6 -6
- package/dist/{publication-MECWWDCC.js → publication-VDADVGXM.js} +2 -2
- package/dist/{publish-E24MR55T.js → publish-IBOZGMAE.js} +11 -11
- package/dist/{remove-background-5DQNPGJH.js → remove-background-AJGB44MD.js} +10 -10
- package/dist/{render-3ESNQDJD.js → render-FEB45RYJ.js} +23 -23
- package/dist/{render-NIS7ZYEN.js → render-GYA2H3B2.js} +37 -34
- package/dist/{render-7IG344AZ.js → render-SKWWHT7J.js} +5 -5
- package/dist/{render-batch-E3I4LV2Z.js → render-batch-7STRK534.js} +5 -5
- package/dist/renderSetupWorker.js +1 -1
- package/dist/{resolver-URT62PGD.js → resolver-XRDRGH7M.js} +4 -4
- package/dist/{reverse-ZCMPUICN.js → reverse-NMBD7K4I.js} +1 -1
- package/dist/{screenshotCapture-2HZH2JOY.js → screenshotCapture-JCP4M4HA.js} +8 -8
- package/dist/{service-OGBH7FVE.js → service-O7DHNTRA.js} +10 -10
- package/dist/{share-TN3XE5KX.js → share-PFJSZ6XH.js} +13 -13
- package/dist/{sherpa-H3NQLN74.js → sherpa-YO7EBXYO.js} +10 -10
- package/dist/skills/media-use/SKILL.md +1 -1
- package/dist/skills/media-use/references/heygen.md +12 -10
- package/dist/{skills-MTBYCP4B.js → skills-6AFTAMO3.js} +8 -8
- package/dist/{skillsUpdateCheck-KG6HEEJA.js → skillsUpdateCheck-WUTYA6WQ.js} +3 -3
- package/dist/{snapshot-SSV3EWLS.js → snapshot-MGQSVPST.js} +37 -37
- package/dist/{src-AUMP7PM3.js → src-7WMNB2MV.js} +10 -10
- package/dist/{src-INXQLRPL.js → src-KDPZPYCF.js} +5 -5
- package/dist/{start-E5DXVZLN.js → start-VWA6EO4F.js} +18 -18
- package/dist/{staticProjectServer-OPYEJ6YM.js → staticProjectServer-OK7X3GFE.js} +17 -17
- package/dist/{status-JGQXXKRJ.js → status-KEOITQBE.js} +10 -10
- package/dist/studio/assets/{codec-BP7F-7Jx.js → codec-Dz2VdhdD.js} +1 -1
- package/dist/studio/assets/{hyperframes-player-_QnPoHup.js → hyperframes-player-BkaWdGLq.js} +1 -1
- package/dist/studio/assets/{index-D6ePWUpc.js → index-DONaC7VF.js} +1 -1
- package/dist/studio/assets/{index-tjhfci4N.js → index-DsNxqAwr.js} +164 -164
- package/dist/studio/assets/{pausedVideoDecoder-B7U86zDa.js → pausedVideoDecoder-BGN2jKrN.js} +1 -1
- package/dist/studio/index.html +1 -1
- package/dist/{studio-api-3ACJFLTS.js → studio-api-ZJ36ZKJ5.js} +9 -9
- package/dist/{studioServer-UIOYHVKP.js → studioServer-UGFXTDZ7.js} +54 -53
- package/dist/{sync-3MYY7QEU.js → sync-5T6BB642.js} +11 -11
- package/dist/{telemetry-EKXAUDKG.js → telemetry-AX7WB2YQ.js} +5 -5
- package/dist/{templates-VUW7UNCH.js → templates-JTNAD2IQ.js} +10 -10
- package/dist/{timeline-ZMF5PTN4.js → timeline-N7ZZMQG7.js} +17 -17
- package/dist/{tokens-NS5DNZZH.js → tokens-ZDXNTASR.js} +2 -2
- package/dist/{transcribe-DSQ7RAXO.js → transcribe-IICQM5XY.js} +22 -22
- package/dist/{transcribe-27X3WOAN.js → transcribe-UAJUCLE7.js} +9 -9
- package/dist/{update-PN63WGTI.js → update-DGBANL33.js} +9 -9
- package/dist/{updateCheck-WL3FAMQ4.js → updateCheck-ZABSCRDN.js} +2 -2
- package/dist/{upgrade-AUEZJWXS.js → upgrade-3A374XKN.js} +3 -3
- package/dist/{urlDownloader-3B56VUJ2.js → urlDownloader-2C6SHTLZ.js} +5 -5
- package/dist/{validate-LPKMHSD4.js → validate-GK5U4MVO.js} +24 -24
- package/dist/{video-YVOBV3PT.js → video-6FE2IELF.js} +7 -7
- package/dist/{voices-5BWQ5DQR.js → voices-FAOBAP5N.js} +18 -18
- package/dist/warmCheck.js +38 -38
- package/package.json +1 -1
- package/dist/chunk-B54XQ7PG.js +0 -5053
|
@@ -16,12 +16,18 @@ import {
|
|
|
16
16
|
Semaphore,
|
|
17
17
|
prepareHeifImageInputs,
|
|
18
18
|
withMediaProbeSlot
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-HCFWBSBP.js";
|
|
20
20
|
import {
|
|
21
21
|
EncoderInterruptedError,
|
|
22
22
|
encoderFailureError,
|
|
23
|
-
|
|
24
|
-
|
|
23
|
+
escapesAssetRoot,
|
|
24
|
+
formatCaptureFrameName,
|
|
25
|
+
formatExportFrameName,
|
|
26
|
+
isPathInside,
|
|
27
|
+
prepareAnimatedGifInputs,
|
|
28
|
+
resolveRenderPaths,
|
|
29
|
+
toExternalAssetKey
|
|
30
|
+
} from "./chunk-MCU74LYV.js";
|
|
25
31
|
import {
|
|
26
32
|
createStudioPositionSeekReapplyScript,
|
|
27
33
|
openRangeEnd,
|
|
@@ -187,7 +193,7 @@ import {
|
|
|
187
193
|
videoAudioId,
|
|
188
194
|
videoStartOnMediaTimeline,
|
|
189
195
|
writeCapturedFrame
|
|
190
|
-
} from "./chunk-
|
|
196
|
+
} from "./chunk-4UQPFLJ5.js";
|
|
191
197
|
import {
|
|
192
198
|
assignBundledRuntimeCompositionIds,
|
|
193
199
|
boundMediaSrc,
|
|
@@ -200,7 +206,7 @@ import {
|
|
|
200
206
|
parsesAsScript,
|
|
201
207
|
prepareFlattenedInnerRoot,
|
|
202
208
|
stripSdrPngColourTags
|
|
203
|
-
} from "./chunk-
|
|
209
|
+
} from "./chunk-SQ3VCDCO.js";
|
|
204
210
|
import {
|
|
205
211
|
collectScratchLeftovers,
|
|
206
212
|
createStagingDir,
|
|
@@ -229,7 +235,7 @@ import {
|
|
|
229
235
|
redactTelemetryString,
|
|
230
236
|
resolveAuthoredTimingWindow,
|
|
231
237
|
toFps
|
|
232
|
-
} from "./chunk-
|
|
238
|
+
} from "./chunk-OV3GXLBL.js";
|
|
233
239
|
import {
|
|
234
240
|
COMPOSITION_SOURCE_URL,
|
|
235
241
|
HF_COLOR_GRADING_ATTR,
|
|
@@ -264,9 +270,10 @@ import {
|
|
|
264
270
|
sourceTimeAt,
|
|
265
271
|
styleElementsFor,
|
|
266
272
|
timeAtSourceTime
|
|
267
|
-
} from "./chunk-
|
|
273
|
+
} from "./chunk-2WSLAKIR.js";
|
|
268
274
|
import {
|
|
269
275
|
isPrivateFileUnder,
|
|
276
|
+
isSafePath,
|
|
270
277
|
isVcsOrSecretPath
|
|
271
278
|
} from "./chunk-XWK2RSD5.js";
|
|
272
279
|
import {
|
|
@@ -275,7 +282,7 @@ import {
|
|
|
275
282
|
import {
|
|
276
283
|
lintHyperframeHtml,
|
|
277
284
|
resolveReferencedStart
|
|
278
|
-
} from "./chunk-
|
|
285
|
+
} from "./chunk-TVSUPOOH.js";
|
|
279
286
|
import {
|
|
280
287
|
isUnresolvedAssetPlaceholder,
|
|
281
288
|
namesAnotherNetworkRoot,
|
|
@@ -336,7 +343,7 @@ import { tmpdir as tmpdir2 } from "os";
|
|
|
336
343
|
import { join as join29, dirname as dirname11, resolve as resolve6 } from "path";
|
|
337
344
|
import { totalmem as totalmem2 } from "os";
|
|
338
345
|
import { randomUUID } from "crypto";
|
|
339
|
-
import { fileURLToPath as
|
|
346
|
+
import { fileURLToPath as fileURLToPath3 } from "url";
|
|
340
347
|
|
|
341
348
|
// ../producer/src/services/fileServer.ts
|
|
342
349
|
import { Hono } from "hono";
|
|
@@ -473,7 +480,7 @@ var defaultLogger = createConsoleLogger(
|
|
|
473
480
|
|
|
474
481
|
// ../producer/src/services/fileServer.ts
|
|
475
482
|
var readFileAsync = promisify(readFile);
|
|
476
|
-
function
|
|
483
|
+
function isPathInside2(child2, parent, options = {}) {
|
|
477
484
|
const { resolveSymlinks = false, pathModule } = options;
|
|
478
485
|
const resolveFn = pathModule?.resolve ?? resolve2;
|
|
479
486
|
const separator = pathModule?.sep ?? sep;
|
|
@@ -1017,7 +1024,13 @@ function openRegularFile(filePath) {
|
|
|
1017
1024
|
}
|
|
1018
1025
|
}
|
|
1019
1026
|
function createFileServer(options) {
|
|
1020
|
-
const {
|
|
1027
|
+
const {
|
|
1028
|
+
projectDir,
|
|
1029
|
+
compiledDir,
|
|
1030
|
+
port = 0,
|
|
1031
|
+
stripEmbeddedRuntime = true,
|
|
1032
|
+
allowOutsideProjectAssets = false
|
|
1033
|
+
} = options;
|
|
1021
1034
|
const preHeadScripts = [
|
|
1022
1035
|
HF_EARLY_STUB,
|
|
1023
1036
|
RENDER_CAPTURE_MODE_SHIM,
|
|
@@ -1039,7 +1052,8 @@ function createFileServer(options) {
|
|
|
1039
1052
|
let file = null;
|
|
1040
1053
|
for (const root of compiledDir ? [compiledDir, projectDir] : [projectDir]) {
|
|
1041
1054
|
const candidate = join(root, relativePath);
|
|
1042
|
-
|
|
1055
|
+
const resolveSymlinks = !allowOutsideProjectAssets && root !== compiledDir;
|
|
1056
|
+
if (isPathInside2(candidate, root, { resolveSymlinks })) file = openRegularFile(candidate);
|
|
1043
1057
|
if (file) break;
|
|
1044
1058
|
}
|
|
1045
1059
|
if (!file) {
|
|
@@ -1273,56 +1287,7 @@ import {
|
|
|
1273
1287
|
symlinkSync,
|
|
1274
1288
|
writeFileSync
|
|
1275
1289
|
} from "fs";
|
|
1276
|
-
import { basename
|
|
1277
|
-
|
|
1278
|
-
// ../producer/src/utils/paths.ts
|
|
1279
|
-
import {
|
|
1280
|
-
basename,
|
|
1281
|
-
join as join2,
|
|
1282
|
-
resolve as nodeResolve,
|
|
1283
|
-
relative as nodeRelative,
|
|
1284
|
-
isAbsolute as nodeIsAbsolute
|
|
1285
|
-
} from "path";
|
|
1286
|
-
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
1287
|
-
var DEFAULT_RENDERS_DIR = process.env.PRODUCER_RENDERS_DIR ?? // fileURLToPath (not URL.pathname): on Windows .pathname is "/D:/..." which
|
|
1288
|
-
// resolves to a bogus renders dir.
|
|
1289
|
-
nodeResolve(fileURLToPath2(import.meta.url), "../../..", "renders");
|
|
1290
|
-
var LEADING_PARENT_SEGMENT_RE = /^\.\.(?:[\\/]|$)/;
|
|
1291
|
-
function isPathInside2(childPath, parentPath, options = {}) {
|
|
1292
|
-
const resolvePath = options.pathModule?.resolve ?? nodeResolve;
|
|
1293
|
-
const relativePath = options.pathModule?.relative ?? nodeRelative;
|
|
1294
|
-
const isPathAbsolute = options.pathModule?.isAbsolute ?? nodeIsAbsolute;
|
|
1295
|
-
const absChild = resolvePath(childPath);
|
|
1296
|
-
const absParent = resolvePath(parentPath);
|
|
1297
|
-
if (absChild === absParent) return true;
|
|
1298
|
-
const rel = relativePath(absParent, absChild);
|
|
1299
|
-
return rel !== "" && !LEADING_PARENT_SEGMENT_RE.test(rel) && !isPathAbsolute(rel);
|
|
1300
|
-
}
|
|
1301
|
-
function toExternalAssetKey(absPath) {
|
|
1302
|
-
if (absPath.startsWith("hf-ext/")) return absPath;
|
|
1303
|
-
let normalised = absPath.replace(/\\/g, "/");
|
|
1304
|
-
normalised = normalised.replace(/^\/\/\?\/UNC\//i, "//");
|
|
1305
|
-
normalised = normalised.replace(/^\/\/\?\//, "");
|
|
1306
|
-
normalised = normalised.replace(/^\/\/([^/]+)\//, "unc/$1/");
|
|
1307
|
-
normalised = normalised.replace(/^\/+/, "");
|
|
1308
|
-
normalised = normalised.replace(/^([A-Za-z]):\/?/, "$1/");
|
|
1309
|
-
return "hf-ext/" + normalised;
|
|
1310
|
-
}
|
|
1311
|
-
function formatCaptureFrameName(index, ext) {
|
|
1312
|
-
return `frame_${String(index).padStart(6, "0")}.${ext}`;
|
|
1313
|
-
}
|
|
1314
|
-
function formatExportFrameName(index, ext) {
|
|
1315
|
-
return `frame_${String(index + 1).padStart(6, "0")}.${ext}`;
|
|
1316
|
-
}
|
|
1317
|
-
function resolveRenderPaths(projectDir, outputPath, rendersDir = DEFAULT_RENDERS_DIR) {
|
|
1318
|
-
const absoluteProjectDir = nodeResolve(projectDir);
|
|
1319
|
-
const projectName = basename(absoluteProjectDir);
|
|
1320
|
-
const resolvedOutputPath = outputPath ?? join2(rendersDir, `${projectName}.mp4`);
|
|
1321
|
-
const absoluteOutputPath = nodeResolve(resolvedOutputPath);
|
|
1322
|
-
return { absoluteProjectDir, absoluteOutputPath };
|
|
1323
|
-
}
|
|
1324
|
-
|
|
1325
|
-
// ../producer/src/services/render/shared.ts
|
|
1290
|
+
import { basename, dirname as dirname2, isAbsolute, join as join2, relative, resolve as resolve3 } from "path";
|
|
1326
1291
|
var BROWSER_MEDIA_EPSILON = 1e-4;
|
|
1327
1292
|
function resolveBrowserMediaEnd(start, end, duration) {
|
|
1328
1293
|
return Number.isFinite(duration) && duration > 0 ? start + duration : end;
|
|
@@ -1354,12 +1319,12 @@ function resolveDeviceScaleFactor(input) {
|
|
|
1354
1319
|
return Math.max(target.width / input.compositionWidth, target.height / input.compositionHeight);
|
|
1355
1320
|
}
|
|
1356
1321
|
function writeCompiledArtifacts(compiled, workDir, includeSummary) {
|
|
1357
|
-
const compileDir =
|
|
1322
|
+
const compileDir = join2(workDir, "compiled");
|
|
1358
1323
|
mkdirSync(compileDir, { recursive: true });
|
|
1359
|
-
writeFileSync(
|
|
1324
|
+
writeFileSync(join2(compileDir, "index.html"), compiled.html, "utf-8");
|
|
1360
1325
|
for (const [srcPath, html] of compiled.subCompositions) {
|
|
1361
|
-
const outPath =
|
|
1362
|
-
if (!
|
|
1326
|
+
const outPath = join2(compileDir, srcPath);
|
|
1327
|
+
if (!isPathInside(outPath, compileDir)) {
|
|
1363
1328
|
console.warn(`[Render] Skipping sub-composition with unsafe path: ${srcPath}`);
|
|
1364
1329
|
continue;
|
|
1365
1330
|
}
|
|
@@ -1367,8 +1332,8 @@ function writeCompiledArtifacts(compiled, workDir, includeSummary) {
|
|
|
1367
1332
|
writeFileSync(outPath, html, "utf-8");
|
|
1368
1333
|
}
|
|
1369
1334
|
for (const [relativePath, absolutePath] of compiled.externalAssets) {
|
|
1370
|
-
const outPath = resolve3(
|
|
1371
|
-
if (!
|
|
1335
|
+
const outPath = resolve3(join2(compileDir, relativePath));
|
|
1336
|
+
if (!isPathInside(outPath, compileDir)) {
|
|
1372
1337
|
console.warn(`[Render] Skipping external asset with unsafe path: ${relativePath}`);
|
|
1373
1338
|
continue;
|
|
1374
1339
|
}
|
|
@@ -1398,7 +1363,7 @@ function writeCompiledArtifacts(compiled, workDir, includeSummary) {
|
|
|
1398
1363
|
renderModeHints: compiled.renderModeHints,
|
|
1399
1364
|
hasShaderTransitions: compiled.hasShaderTransitions
|
|
1400
1365
|
};
|
|
1401
|
-
writeFileSync(
|
|
1366
|
+
writeFileSync(join2(compileDir, "summary.json"), JSON.stringify(summary, null, 2), "utf-8");
|
|
1402
1367
|
}
|
|
1403
1368
|
}
|
|
1404
1369
|
function applyRenderModeHints(alreadyForced, compiled, log = defaultLogger) {
|
|
@@ -1528,9 +1493,9 @@ function reportWorkerStartup(job, progress, onProgress) {
|
|
|
1528
1493
|
}
|
|
1529
1494
|
var materializePathModule = {
|
|
1530
1495
|
resolve: resolve3,
|
|
1531
|
-
join:
|
|
1496
|
+
join: join2,
|
|
1532
1497
|
dirname: dirname2,
|
|
1533
|
-
basename
|
|
1498
|
+
basename,
|
|
1534
1499
|
relative,
|
|
1535
1500
|
isAbsolute
|
|
1536
1501
|
};
|
|
@@ -1630,7 +1595,7 @@ function materializeExtractedFramesForCompiledDir(extracted, compiledDir, option
|
|
|
1630
1595
|
const compiledFrameRoot = pathModule.join(resolvedCompiledDir, "__hyperframes_video_frames");
|
|
1631
1596
|
for (const ext of extracted) {
|
|
1632
1597
|
const resolvedOut = pathModule.resolve(ext.outputDir);
|
|
1633
|
-
if (
|
|
1598
|
+
if (isPathInside(resolvedOut, resolvedCompiledDir, { pathModule })) continue;
|
|
1634
1599
|
const linkPath = pathModule.join(compiledFrameRoot, mediaIdPathSegment(ext.videoId));
|
|
1635
1600
|
if (!fileSystem.existsSync(linkPath)) {
|
|
1636
1601
|
fileSystem.mkdirSync(pathModule.dirname(linkPath), { recursive: true });
|
|
@@ -1816,7 +1781,7 @@ var RenderExecutionContext = class {
|
|
|
1816
1781
|
|
|
1817
1782
|
// ../producer/src/services/render/artifactTransaction.ts
|
|
1818
1783
|
import { closeSync as closeSync2, existsSync as existsSync5, fstatSync as fstatSync2, openSync as openSync2, readSync, readdirSync as readdirSync2, rmSync as rmSync3 } from "fs";
|
|
1819
|
-
import { basename as
|
|
1784
|
+
import { basename as basename3, dirname as dirname4, extname as extname2, join as join4, resolve as resolve4 } from "path";
|
|
1820
1785
|
|
|
1821
1786
|
// ../producer/src/services/render/renderDirOwner.ts
|
|
1822
1787
|
import {
|
|
@@ -1829,7 +1794,7 @@ import {
|
|
|
1829
1794
|
writeFileSync as writeFileSync2
|
|
1830
1795
|
} from "fs";
|
|
1831
1796
|
import { hostname, uptime } from "os";
|
|
1832
|
-
import { basename as
|
|
1797
|
+
import { basename as basename2, dirname as dirname3, join as join3 } from "path";
|
|
1833
1798
|
var OWNER_FILE = "owner.json";
|
|
1834
1799
|
var TRANSACTION_BACKUP = "backup";
|
|
1835
1800
|
var RENDER_JOB_DIR = /^[0-9a-f]{8}(-[0-9a-f]{4}){3}-[0-9a-f]{12}$/;
|
|
@@ -1849,9 +1814,9 @@ function pidScope() {
|
|
|
1849
1814
|
};
|
|
1850
1815
|
}
|
|
1851
1816
|
function createOwnedRenderDir(prefix) {
|
|
1852
|
-
const dir = createStagingDir(dirname3(prefix),
|
|
1817
|
+
const dir = createStagingDir(dirname3(prefix), basename2(prefix));
|
|
1853
1818
|
const owner = { pid: process.pid, ...pidScope() };
|
|
1854
|
-
writeFileSync2(
|
|
1819
|
+
writeFileSync2(join3(dir, OWNER_FILE), JSON.stringify(owner));
|
|
1855
1820
|
return dir;
|
|
1856
1821
|
}
|
|
1857
1822
|
function alive(pid) {
|
|
@@ -1874,7 +1839,7 @@ function inThisPidScope(owner) {
|
|
|
1874
1839
|
function ownerState(dir) {
|
|
1875
1840
|
let owner;
|
|
1876
1841
|
try {
|
|
1877
|
-
owner = JSON.parse(readFileSync2(
|
|
1842
|
+
owner = JSON.parse(readFileSync2(join3(dir, OWNER_FILE), "utf-8"));
|
|
1878
1843
|
} catch (error) {
|
|
1879
1844
|
return error.code === "ENOENT" ? "none" : "unknown";
|
|
1880
1845
|
}
|
|
@@ -1888,13 +1853,13 @@ function newestWriteMs(path) {
|
|
|
1888
1853
|
const stat = lstatSync(path);
|
|
1889
1854
|
if (!stat.isDirectory()) return stat.mtimeMs;
|
|
1890
1855
|
return readdirSync(path).reduce(
|
|
1891
|
-
(newest, name) => Math.max(newest, newestWriteMs(
|
|
1856
|
+
(newest, name) => Math.max(newest, newestWriteMs(join3(path, name))),
|
|
1892
1857
|
stat.mtimeMs
|
|
1893
1858
|
);
|
|
1894
1859
|
}
|
|
1895
1860
|
function isAbandoned(dir, ownerlessIdleMs, now) {
|
|
1896
1861
|
try {
|
|
1897
|
-
if (!lstatSync(dir).isDirectory() || existsSync4(
|
|
1862
|
+
if (!lstatSync(dir).isDirectory() || existsSync4(join3(dir, TRANSACTION_BACKUP))) return false;
|
|
1898
1863
|
const owner = ownerState(dir);
|
|
1899
1864
|
if (owner === "gone") return true;
|
|
1900
1865
|
return owner === "none" && ownerlessIdleMs !== void 0 && now - newestWriteMs(dir) >= ownerlessIdleMs;
|
|
@@ -1910,7 +1875,7 @@ function listAbandonedRenderDirs(parent, options = {}) {
|
|
|
1910
1875
|
return [];
|
|
1911
1876
|
}
|
|
1912
1877
|
const now = Date.now();
|
|
1913
|
-
return names.filter((name) => (options.names ?? RENDER_TEMP_DIR).test(name)).map((name) =>
|
|
1878
|
+
return names.filter((name) => (options.names ?? RENDER_TEMP_DIR).test(name)).map((name) => join3(parent, name)).filter((dir) => isAbandoned(dir, options.ownerlessIdleMs, now));
|
|
1914
1879
|
}
|
|
1915
1880
|
function createRenderWorkDir(prefix, outputDir) {
|
|
1916
1881
|
for (const parent of /* @__PURE__ */ new Set([outputDir, dirname3(prefix)])) {
|
|
@@ -1959,8 +1924,8 @@ function buildArtifactExpectation(input) {
|
|
|
1959
1924
|
function createSiblingTransactionDirectory(destination) {
|
|
1960
1925
|
const parent = dirname4(destination);
|
|
1961
1926
|
const extension = extname2(destination);
|
|
1962
|
-
const stem = extension ?
|
|
1963
|
-
return createOwnedRenderDir(
|
|
1927
|
+
const stem = extension ? basename3(destination, extension) : basename3(destination);
|
|
1928
|
+
return createOwnedRenderDir(join4(parent, `.${stem}.hf-transaction-`));
|
|
1964
1929
|
}
|
|
1965
1930
|
function assertReadableNonEmptyFile(path) {
|
|
1966
1931
|
const fd = openSync2(path, "r");
|
|
@@ -1978,7 +1943,7 @@ function collectDirectoryFiles(root) {
|
|
|
1978
1943
|
const files = [];
|
|
1979
1944
|
const visit = (directory) => {
|
|
1980
1945
|
for (const entry of readdirSync2(directory, { withFileTypes: true })) {
|
|
1981
|
-
const path =
|
|
1946
|
+
const path = join4(directory, entry.name);
|
|
1982
1947
|
if (entry.isDirectory()) visit(path);
|
|
1983
1948
|
else if (entry.isFile()) files.push(path);
|
|
1984
1949
|
}
|
|
@@ -2035,8 +2000,8 @@ var ArtifactTransaction = class {
|
|
|
2035
2000
|
this.logger = logger;
|
|
2036
2001
|
this.destinationPath = resolve4(destinationPath);
|
|
2037
2002
|
this.transactionDirectory = createSiblingTransactionDirectory(this.destinationPath);
|
|
2038
|
-
this.stagingPath =
|
|
2039
|
-
this.backupPath =
|
|
2003
|
+
this.stagingPath = join4(this.transactionDirectory, basename3(this.destinationPath));
|
|
2004
|
+
this.backupPath = join4(this.transactionDirectory, TRANSACTION_BACKUP);
|
|
2040
2005
|
this.durationProbe = durationProbe;
|
|
2041
2006
|
}
|
|
2042
2007
|
kind;
|
|
@@ -2079,19 +2044,19 @@ var ArtifactTransaction = class {
|
|
|
2079
2044
|
*/
|
|
2080
2045
|
async assertDirectoryExpectation(expected, files) {
|
|
2081
2046
|
for (const required of expected.requiredFiles ?? []) {
|
|
2082
|
-
const path =
|
|
2047
|
+
const path = join4(this.stagingPath, required);
|
|
2083
2048
|
if (!existsSync5(path)) {
|
|
2084
2049
|
throw new Error(`Render artifact directory is missing ${required}: ${this.stagingPath}`);
|
|
2085
2050
|
}
|
|
2086
2051
|
assertReadableNonEmptyFile(path);
|
|
2087
2052
|
}
|
|
2088
2053
|
if (expected.probeTarget !== void 0) {
|
|
2089
|
-
await this.assertArtifactDuration(expected,
|
|
2054
|
+
await this.assertArtifactDuration(expected, join4(this.stagingPath, expected.probeTarget));
|
|
2090
2055
|
return;
|
|
2091
2056
|
}
|
|
2092
2057
|
if (expected.expectedFrames === void 0) return;
|
|
2093
2058
|
const frameCount = files.filter(
|
|
2094
|
-
(file) => dirname4(file) === this.stagingPath && /^frame_\d+\.png$/.test(
|
|
2059
|
+
(file) => dirname4(file) === this.stagingPath && /^frame_\d+\.png$/.test(basename3(file))
|
|
2095
2060
|
).length;
|
|
2096
2061
|
if (frameCount === 0) {
|
|
2097
2062
|
throw new Error(
|
|
@@ -2330,7 +2295,7 @@ function replanAfterFailure(plan2, failure) {
|
|
|
2330
2295
|
|
|
2331
2296
|
// ../producer/src/services/render/stages/captureSegmentedStage.ts
|
|
2332
2297
|
import { existsSync as existsSync6, mkdirSync as mkdirSync3, rmSync as rmSync6, statSync as statSync3 } from "fs";
|
|
2333
|
-
import { join as
|
|
2298
|
+
import { join as join8 } from "path";
|
|
2334
2299
|
|
|
2335
2300
|
// ../producer/src/services/render/perfSummary.ts
|
|
2336
2301
|
import { arch, cpus, platform, totalmem } from "os";
|
|
@@ -2721,7 +2686,7 @@ function getCaptureStageBrowserConsole(error) {
|
|
|
2721
2686
|
|
|
2722
2687
|
// ../producer/src/services/hdrCompositor.ts
|
|
2723
2688
|
import { readSync as readSync2 } from "fs";
|
|
2724
|
-
import { join as
|
|
2689
|
+
import { join as join5 } from "path";
|
|
2725
2690
|
function countNonZeroAlpha(rgba) {
|
|
2726
2691
|
let n = 0;
|
|
2727
2692
|
for (let p = 3; p < rgba.length; p += 4) {
|
|
@@ -3148,7 +3113,7 @@ async function compositeHdrFrame(ctx, canvas, time, fullStacking, elementFilter,
|
|
|
3148
3113
|
if (shouldLog && debugDumpDir) {
|
|
3149
3114
|
const after = countNonZeroRgb48(canvas);
|
|
3150
3115
|
const dumpName = `frame_${String(debugFrameIndex).padStart(4, "0")}_layer_${String(layerIdx).padStart(2, "0")}_dom.png`;
|
|
3151
|
-
const dumpPath =
|
|
3116
|
+
const dumpPath = join5(debugDumpDir, dumpName);
|
|
3152
3117
|
writeFileExclusiveSync(dumpPath, domPng);
|
|
3153
3118
|
log.info("[diag] dom layer blit", {
|
|
3154
3119
|
frame: debugFrameIndex,
|
|
@@ -3187,7 +3152,7 @@ import { mkdirSync as mkdirSync2, readFileSync as readFileSync3, rmSync as rmSyn
|
|
|
3187
3152
|
|
|
3188
3153
|
// ../producer/src/services/hdrFrameWindows.ts
|
|
3189
3154
|
import { closeSync as closeSync3, constants as constants2, openSync as openSync3, rmSync as rmSync4 } from "fs";
|
|
3190
|
-
import { join as
|
|
3155
|
+
import { join as join6 } from "path";
|
|
3191
3156
|
function createHdrFrameWindows(opts) {
|
|
3192
3157
|
const { dir, frameSize, windowFrames, maxResident, extract } = opts;
|
|
3193
3158
|
let totalFrames = opts.totalFrames;
|
|
@@ -3211,7 +3176,7 @@ function createHdrFrameWindows(opts) {
|
|
|
3211
3176
|
const firstFrame = index * windowFrames;
|
|
3212
3177
|
const w = {
|
|
3213
3178
|
firstFrame,
|
|
3214
|
-
path:
|
|
3179
|
+
path: join6(dir, `window-${index}.rgb48le`),
|
|
3215
3180
|
frames: 0,
|
|
3216
3181
|
fd: -1,
|
|
3217
3182
|
pins: 0,
|
|
@@ -3980,7 +3945,7 @@ function isTargetLossError(error) {
|
|
|
3980
3945
|
// ../producer/src/services/render/stages/captureStreamingStage.ts
|
|
3981
3946
|
import { mkdtemp, writeFile } from "fs/promises";
|
|
3982
3947
|
import { tmpdir } from "os";
|
|
3983
|
-
import { join as
|
|
3948
|
+
import { join as join7 } from "path";
|
|
3984
3949
|
|
|
3985
3950
|
// ../producer/src/services/render/stallClock.ts
|
|
3986
3951
|
var SUSPEND_GAP_MS = 15e3;
|
|
@@ -4183,11 +4148,11 @@ async function verifyDrawElementSample(session, idx, buf, ctx) {
|
|
|
4183
4148
|
return;
|
|
4184
4149
|
}
|
|
4185
4150
|
if (db < verifyMinDb) {
|
|
4186
|
-
const dumpDir = await mkdtemp(
|
|
4151
|
+
const dumpDir = await mkdtemp(join7(tmpdir(), "hf-de-verify-fail-")).catch(() => null);
|
|
4187
4152
|
if (dumpDir) {
|
|
4188
4153
|
await Promise.all([
|
|
4189
|
-
writeFile(
|
|
4190
|
-
writeFile(
|
|
4154
|
+
writeFile(join7(dumpDir, `frame-${idx}-de.jpg`), buf),
|
|
4155
|
+
writeFile(join7(dumpDir, `frame-${idx}-truth.jpg`), truth)
|
|
4191
4156
|
]).catch(() => {
|
|
4192
4157
|
});
|
|
4193
4158
|
}
|
|
@@ -4758,7 +4723,7 @@ async function runCaptureStreamingStage(input) {
|
|
|
4758
4723
|
|
|
4759
4724
|
// ../producer/src/services/render/stages/captureSegmentedStage.ts
|
|
4760
4725
|
function segmentOutputPath(segmentDir, index) {
|
|
4761
|
-
return
|
|
4726
|
+
return join8(segmentDir, `segment_${String(index).padStart(5, "0")}.mp4`);
|
|
4762
4727
|
}
|
|
4763
4728
|
function segmentEncoderOptions(base, segment) {
|
|
4764
4729
|
return {
|
|
@@ -5091,7 +5056,7 @@ async function runCaptureSegmentedStage(input) {
|
|
|
5091
5056
|
const { log, dedupPerfs, assertNotAborted } = input;
|
|
5092
5057
|
const deps = { ...DEFAULT_DEPS, ...input.deps };
|
|
5093
5058
|
const segments = planSegments(input.totalFrames, input.segmentFrames);
|
|
5094
|
-
const segmentDir = input.segmentDir ??
|
|
5059
|
+
const segmentDir = input.segmentDir ?? join8(input.workDir, "segments");
|
|
5095
5060
|
mkdirSync3(segmentDir, { recursive: true });
|
|
5096
5061
|
const skip = input.completedSegments ?? /* @__PURE__ */ new Set();
|
|
5097
5062
|
const pending = segments.filter((s) => !skip.has(s.index));
|
|
@@ -5247,7 +5212,7 @@ function startRenderEtaGuard(options) {
|
|
|
5247
5212
|
}
|
|
5248
5213
|
|
|
5249
5214
|
// ../producer/src/services/render/captureCost.ts
|
|
5250
|
-
import { join as
|
|
5215
|
+
import { join as join9 } from "path";
|
|
5251
5216
|
var CAPTURE_CALIBRATION_TARGET_MS = 600;
|
|
5252
5217
|
var MAX_MEASURED_CAPTURE_COST_MULTIPLIER = 8;
|
|
5253
5218
|
var CAPTURE_CALIBRATION_PROTOCOL_TIMEOUT_MS = 3e4;
|
|
@@ -5491,7 +5456,7 @@ async function runCaptureCalibration(input) {
|
|
|
5491
5456
|
});
|
|
5492
5457
|
let calibration;
|
|
5493
5458
|
try {
|
|
5494
|
-
calibration = await runOneCalibration(
|
|
5459
|
+
calibration = await runOneCalibration(join9(workDir, "capture-calibration"), calibrationCfg);
|
|
5495
5460
|
} catch (error) {
|
|
5496
5461
|
const shouldFallback = !forceScreenshot && shouldFallbackToScreenshotAfterCalibrationError(error);
|
|
5497
5462
|
if (!shouldFallback) {
|
|
@@ -5525,7 +5490,7 @@ async function runCaptureCalibration(input) {
|
|
|
5525
5490
|
const screenshotCfg = createCaptureCalibrationConfig({ ...cfg, forceScreenshot: true });
|
|
5526
5491
|
try {
|
|
5527
5492
|
calibration = await runOneCalibration(
|
|
5528
|
-
|
|
5493
|
+
join9(workDir, "capture-calibration-screenshot"),
|
|
5529
5494
|
screenshotCfg
|
|
5530
5495
|
);
|
|
5531
5496
|
} catch (fallbackError) {
|
|
@@ -5590,7 +5555,7 @@ function checkPageNeverReady(input) {
|
|
|
5590
5555
|
|
|
5591
5556
|
// ../producer/src/services/render/deferredVideoFrames.ts
|
|
5592
5557
|
import { mkdirSync as mkdirSync4, rmSync as rmSync7 } from "fs";
|
|
5593
|
-
import { dirname as dirname5, join as
|
|
5558
|
+
import { dirname as dirname5, join as join10 } from "path";
|
|
5594
5559
|
function contiguousRuns(sortedIndexes) {
|
|
5595
5560
|
const runs2 = [];
|
|
5596
5561
|
for (const index of sortedIndexes) {
|
|
@@ -5629,7 +5594,7 @@ async function extractDeferredFrames(input) {
|
|
|
5629
5594
|
const shown = shownDeferredFrameIndexes(input, input.frames, input.fps);
|
|
5630
5595
|
return Promise.all(
|
|
5631
5596
|
deferred.map(async (video) => {
|
|
5632
|
-
const outputDir =
|
|
5597
|
+
const outputDir = join10(input.outputRoot, mediaIdPathSegment(video.videoId));
|
|
5633
5598
|
const indexes = [...shown.get(video.videoId) ?? []].sort((a, b) => a - b);
|
|
5634
5599
|
if (indexes.length === 0) {
|
|
5635
5600
|
return { ...video, outputDir, framePaths: /* @__PURE__ */ new Map(), ownedByLookup: false };
|
|
@@ -5698,9 +5663,9 @@ async function extractAllDeferredFrames(extracted, input) {
|
|
|
5698
5663
|
|
|
5699
5664
|
// ../producer/src/services/render/segmentVideoFrames.ts
|
|
5700
5665
|
import { mkdirSync as mkdirSync5, rmSync as rmSync8 } from "fs";
|
|
5701
|
-
import { join as
|
|
5666
|
+
import { join as join11 } from "path";
|
|
5702
5667
|
function segmentFramesDir(rootDir, index) {
|
|
5703
|
-
return
|
|
5668
|
+
return join11(rootDir, "segment-frames", `segment_${String(index).padStart(5, "0")}`);
|
|
5704
5669
|
}
|
|
5705
5670
|
function createSegmentVideoFrames(input) {
|
|
5706
5671
|
const extractFrames = input.extractFrames ?? extractDeferredFrames;
|
|
@@ -5730,7 +5695,7 @@ function createSegmentVideoFrames(input) {
|
|
|
5730
5695
|
let onDemandCalls = 0;
|
|
5731
5696
|
const onDemandHook = () => Object.assign(
|
|
5732
5697
|
async (page, time, heldVideoTime) => {
|
|
5733
|
-
const dir =
|
|
5698
|
+
const dir = join11(
|
|
5734
5699
|
input.rootDir,
|
|
5735
5700
|
"segment-frames",
|
|
5736
5701
|
`on-demand_${String(onDemandCalls++).padStart(5, "0")}`
|
|
@@ -5747,7 +5712,7 @@ function createSegmentVideoFrames(input) {
|
|
|
5747
5712
|
);
|
|
5748
5713
|
return {
|
|
5749
5714
|
async forFrames(frames, name) {
|
|
5750
|
-
const dir =
|
|
5715
|
+
const dir = join11(input.rootDir, "segment-frames", name);
|
|
5751
5716
|
const release = () => rmSync8(dir, { recursive: true, force: true });
|
|
5752
5717
|
try {
|
|
5753
5718
|
release();
|
|
@@ -5800,7 +5765,7 @@ function createSegmentVideoFrames(input) {
|
|
|
5800
5765
|
|
|
5801
5766
|
// ../producer/src/services/render/videoFrameWindow.ts
|
|
5802
5767
|
import { readdirSync as readdirSync3, statSync as statSync4 } from "fs";
|
|
5803
|
-
import { join as
|
|
5768
|
+
import { join as join12 } from "path";
|
|
5804
5769
|
function shouldWindowVideoFrames(args) {
|
|
5805
5770
|
return args.segmented && args.env.HF_VIDEO_FRAME_WINDOW?.trim().toLowerCase() === "true";
|
|
5806
5771
|
}
|
|
@@ -5813,7 +5778,7 @@ function directoryBytes(path) {
|
|
|
5813
5778
|
return 0;
|
|
5814
5779
|
}
|
|
5815
5780
|
for (const entry of entries) {
|
|
5816
|
-
const child2 =
|
|
5781
|
+
const child2 = join12(path, entry.name);
|
|
5817
5782
|
try {
|
|
5818
5783
|
bytes += entry.isDirectory() ? directoryBytes(child2) : statSync4(child2).size;
|
|
5819
5784
|
} catch {
|
|
@@ -5831,7 +5796,7 @@ function trackSegmentFramePeak(frames, rootDir, onPeak) {
|
|
|
5831
5796
|
...worker,
|
|
5832
5797
|
async prepare(segment) {
|
|
5833
5798
|
await worker.prepare(segment);
|
|
5834
|
-
const held = directoryBytes(
|
|
5799
|
+
const held = directoryBytes(join12(rootDir, "segment-frames"));
|
|
5835
5800
|
if (held > peak) {
|
|
5836
5801
|
peak = held;
|
|
5837
5802
|
onPeak(peak);
|
|
@@ -5845,7 +5810,7 @@ function trackSegmentFramePeak(frames, rootDir, onPeak) {
|
|
|
5845
5810
|
// ../producer/src/services/render/segmentManifest.ts
|
|
5846
5811
|
import { createHash as createHash2 } from "crypto";
|
|
5847
5812
|
import { existsSync as existsSync7, mkdirSync as mkdirSync6, readFileSync as readFileSync4, statSync as statSync5, writeFileSync as writeFileSync3 } from "fs";
|
|
5848
|
-
import { join as
|
|
5813
|
+
import { join as join13 } from "path";
|
|
5849
5814
|
var MANIFEST_FILENAME = "segments.json";
|
|
5850
5815
|
function computeSegmentPlanHash(input) {
|
|
5851
5816
|
const ordered = [
|
|
@@ -5872,7 +5837,7 @@ function computeSegmentPlanHash(input) {
|
|
|
5872
5837
|
return createHash2("sha256").update(ordered.join(" ")).digest("hex").slice(0, 16);
|
|
5873
5838
|
}
|
|
5874
5839
|
function segmentDirFor(projectRendersDir, planHash) {
|
|
5875
|
-
return
|
|
5840
|
+
return join13(projectRendersDir, ".hf-segments", planHash);
|
|
5876
5841
|
}
|
|
5877
5842
|
function hasNumber(value, key) {
|
|
5878
5843
|
return key in value && typeof Reflect.get(value, key) === "number";
|
|
@@ -5890,7 +5855,7 @@ function isManifest(value) {
|
|
|
5890
5855
|
return Reflect.get(value, "version") === 1 && hasString(value, "planHash") && hasNumber(value, "totalFrames") && hasNumber(value, "segmentFrames") && Array.isArray(completed) && completed.every(isEntry);
|
|
5891
5856
|
}
|
|
5892
5857
|
function readSegmentManifest(segmentDir) {
|
|
5893
|
-
const path =
|
|
5858
|
+
const path = join13(segmentDir, MANIFEST_FILENAME);
|
|
5894
5859
|
if (!existsSync7(path)) return null;
|
|
5895
5860
|
try {
|
|
5896
5861
|
const parsed = JSON.parse(readFileSync4(path, "utf-8"));
|
|
@@ -5901,9 +5866,9 @@ function readSegmentManifest(segmentDir) {
|
|
|
5901
5866
|
}
|
|
5902
5867
|
function writeSegmentManifest(segmentDir, manifest) {
|
|
5903
5868
|
mkdirSync6(segmentDir, { recursive: true });
|
|
5904
|
-
const tmp =
|
|
5869
|
+
const tmp = join13(segmentDir, `${MANIFEST_FILENAME}.${process.pid}.tmp`);
|
|
5905
5870
|
writeFileSync3(tmp, JSON.stringify(manifest, null, 2), "utf-8");
|
|
5906
|
-
renameWithRetry(tmp,
|
|
5871
|
+
renameWithRetry(tmp, join13(segmentDir, MANIFEST_FILENAME));
|
|
5907
5872
|
}
|
|
5908
5873
|
async function probeSegmentFrameCount(path, probe) {
|
|
5909
5874
|
try {
|
|
@@ -6489,21 +6454,21 @@ function countAuthoredTimedClips(html) {
|
|
|
6489
6454
|
|
|
6490
6455
|
// ../producer/src/services/render/stages/compileStage.ts
|
|
6491
6456
|
import { existsSync as existsSync11, writeFileSync as writeFileSync4 } from "fs";
|
|
6492
|
-
import { join as join17 } from "path";
|
|
6457
|
+
import { join as join17, relative as relative3 } from "path";
|
|
6493
6458
|
|
|
6494
6459
|
// ../producer/src/services/htmlCompiler.ts
|
|
6495
6460
|
import { createHash as createHash4 } from "crypto";
|
|
6496
6461
|
import { createReadStream as createReadStream2, existsSync as existsSync10, mkdirSync as mkdirSync7, readFileSync as readFileSync6 } from "fs";
|
|
6497
|
-
import { join as join16, dirname as dirname6, resolve as resolve5, basename as
|
|
6462
|
+
import { join as join16, dirname as dirname6, resolve as resolve5, basename as basename4, relative as relative2, sep as sep2 } from "path";
|
|
6498
6463
|
|
|
6499
6464
|
// ../producer/src/services/bundledScripts.ts
|
|
6500
6465
|
import { existsSync as existsSync8, readFileSync as readFileSync5 } from "fs";
|
|
6501
|
-
import { join as
|
|
6466
|
+
import { join as join14 } from "path";
|
|
6502
6467
|
var GSAP_VENDOR_DIR_ENV = "HYPERFRAMES_GSAP_VENDOR_DIR";
|
|
6503
6468
|
function bundledScript(url) {
|
|
6504
6469
|
const dir = process.env[GSAP_VENDOR_DIR_ENV];
|
|
6505
6470
|
if (!dir || url !== `${gsapCdnDist()}gsap.min.js`) return null;
|
|
6506
|
-
const file =
|
|
6471
|
+
const file = join14(dir, "gsap.min.js");
|
|
6507
6472
|
return existsSync8(file) ? readFileSync5(file) : null;
|
|
6508
6473
|
}
|
|
6509
6474
|
|
|
@@ -6655,6 +6620,7 @@ function getPositionEditsRenderScript() {
|
|
|
6655
6620
|
|
|
6656
6621
|
// ../producer/src/services/assetMediaType.ts
|
|
6657
6622
|
import { existsSync as existsSync9 } from "fs";
|
|
6623
|
+
import { join as join15 } from "path";
|
|
6658
6624
|
var ASSET_MEDIA_TYPE_MISMATCH = "ASSET_MEDIA_TYPE_MISMATCH";
|
|
6659
6625
|
var AssetMediaTypeMismatchError = class extends Error {
|
|
6660
6626
|
code = ASSET_MEDIA_TYPE_MISMATCH;
|
|
@@ -6694,6 +6660,21 @@ function assertAssetMediaTypeProfile(expected, profile, elementIdentity) {
|
|
|
6694
6660
|
function isRemoteOrInlineSource(src) {
|
|
6695
6661
|
return /^(?:https?:|data:|blob:|about:)/i.test(src.trim());
|
|
6696
6662
|
}
|
|
6663
|
+
function dropMediaOutsideProject(input) {
|
|
6664
|
+
const { projectDir, workDir, composition, log } = input;
|
|
6665
|
+
const compiledDir = join15(workDir, "compiled");
|
|
6666
|
+
const roots = [projectDir, compiledDir, join15(workDir, "downloads")];
|
|
6667
|
+
const staysInside = ({ id, src }) => {
|
|
6668
|
+
if (!src || isRemoteOrInlineSource(src)) return true;
|
|
6669
|
+
const path = resolveProjectRelativeSrc(src, projectDir, compiledDir);
|
|
6670
|
+
if (roots.some((root) => !escapesAssetRoot(path, root))) return true;
|
|
6671
|
+
log.warn(`[Render] Media "${id}" source is missing: it is outside the project folder`, { src });
|
|
6672
|
+
return false;
|
|
6673
|
+
};
|
|
6674
|
+
composition.videos = composition.videos.filter(staysInside);
|
|
6675
|
+
composition.audios = composition.audios.filter(staysInside);
|
|
6676
|
+
composition.images = composition.images.filter(staysInside);
|
|
6677
|
+
}
|
|
6697
6678
|
async function preflightCompositionAssetMediaTypes(input) {
|
|
6698
6679
|
const references = [
|
|
6699
6680
|
...input.composition.videos.map((asset) => ({
|
|
@@ -6816,8 +6797,12 @@ function normalizeCompositionSrcs(html, projectDir) {
|
|
|
6816
6797
|
return `${name}${quote}${relative2(projectDir, file).split(sep2).join("/")}${quote}`;
|
|
6817
6798
|
});
|
|
6818
6799
|
}
|
|
6800
|
+
function resolveCompositionFile(projectDir, src, assetRoot) {
|
|
6801
|
+
const file = resolveCompositionSrc(projectDir, src);
|
|
6802
|
+
return file === null || escapesAssetRoot(file, assetRoot) ? null : file;
|
|
6803
|
+
}
|
|
6819
6804
|
var isPrivateCompositionFile = (projectDir, filePath) => isPrivateFileUnder(projectDir, filePath, isVcsOrSecretPath);
|
|
6820
|
-
function assertSubCompositionsUsable(html, projectDir, visited = /* @__PURE__ */ new Set()) {
|
|
6805
|
+
function assertSubCompositionsUsable(html, projectDir, assetRoot, visited = /* @__PURE__ */ new Set()) {
|
|
6821
6806
|
const { document: document2 } = parseHTML(html);
|
|
6822
6807
|
const hosts = [...document2.querySelectorAll("[data-composition-src]")];
|
|
6823
6808
|
const problems = [];
|
|
@@ -6825,7 +6810,7 @@ function assertSubCompositionsUsable(html, projectDir, visited = /* @__PURE__ */
|
|
|
6825
6810
|
const srcPath = el.getAttribute("data-composition-src");
|
|
6826
6811
|
if (!srcPath) continue;
|
|
6827
6812
|
if (isUnresolvedAssetPlaceholder(srcPath)) continue;
|
|
6828
|
-
const filePath =
|
|
6813
|
+
const filePath = resolveCompositionFile(projectDir, srcPath, assetRoot);
|
|
6829
6814
|
if (filePath === null) {
|
|
6830
6815
|
problems.push({ srcPath, detail: "it is outside the project folder" });
|
|
6831
6816
|
continue;
|
|
@@ -6856,7 +6841,7 @@ function assertSubCompositionsUsable(html, projectDir, visited = /* @__PURE__ */
|
|
|
6856
6841
|
const nestedVisited = new Set(visited);
|
|
6857
6842
|
nestedVisited.add(filePath);
|
|
6858
6843
|
try {
|
|
6859
|
-
assertSubCompositionsUsable(fileHtml, projectDir, nestedVisited);
|
|
6844
|
+
assertSubCompositionsUsable(fileHtml, projectDir, assetRoot, nestedVisited);
|
|
6860
6845
|
} catch (err) {
|
|
6861
6846
|
if (err instanceof EmptyCompositionError) {
|
|
6862
6847
|
problems.push(...err.problems);
|
|
@@ -6975,7 +6960,7 @@ function detectShaderTransitionUsage(html) {
|
|
|
6975
6960
|
}
|
|
6976
6961
|
return false;
|
|
6977
6962
|
}
|
|
6978
|
-
async function resolveMediaDuration(src, mediaStart, playbackRate, baseDir, downloadDir, tagName, elementIdentity, log, urlByAbsentLocalPath, probes) {
|
|
6963
|
+
async function resolveMediaDuration(src, mediaStart, playbackRate, baseDir, downloadDir, tagName, elementIdentity, log, urlByAbsentLocalPath, probes, assetRoot) {
|
|
6979
6964
|
let filePath = src;
|
|
6980
6965
|
if (isHttpUrl(src)) {
|
|
6981
6966
|
const remoteDir = join16(downloadDir, REMOTE_MEDIA_SUBDIR);
|
|
@@ -6990,6 +6975,7 @@ async function resolveMediaDuration(src, mediaStart, playbackRate, baseDir, down
|
|
|
6990
6975
|
} else {
|
|
6991
6976
|
filePath = decodedUrlPath(src);
|
|
6992
6977
|
if (!filePath.startsWith("/")) filePath = join16(baseDir, filePath);
|
|
6978
|
+
if (escapesAssetRoot(filePath, assetRoot)) return { duration: null, resolvedPath: filePath };
|
|
6993
6979
|
filePath = urlByAbsentLocalPath?.get(filePath) ?? filePath;
|
|
6994
6980
|
if (!isHttpUrl(filePath) && namesAnotherNetworkRoot(baseDir, filePath)) {
|
|
6995
6981
|
return { duration: null, resolvedPath: filePath };
|
|
@@ -7065,7 +7051,7 @@ function markInferredVariableMediaDurations(html, unresolvedMedia) {
|
|
|
7065
7051
|
}
|
|
7066
7052
|
return changed ? document2.toString() : html;
|
|
7067
7053
|
}
|
|
7068
|
-
async function compileHtmlFile(html, baseDir, downloadDir, log, urlByAbsentLocalPath, probes) {
|
|
7054
|
+
async function compileHtmlFile(html, baseDir, downloadDir, log, urlByAbsentLocalPath, probes, assetRoot) {
|
|
7069
7055
|
const { html: staticCompiled, unresolved } = compileTimingAttrs(html);
|
|
7070
7056
|
const mediaUnresolved = unresolved.filter(
|
|
7071
7057
|
(el) => (el.tagName === "video" || el.tagName === "audio") && el.src
|
|
@@ -7083,7 +7069,8 @@ async function compileHtmlFile(html, baseDir, downloadDir, log, urlByAbsentLocal
|
|
|
7083
7069
|
el.id,
|
|
7084
7070
|
log,
|
|
7085
7071
|
urlByAbsentLocalPath,
|
|
7086
|
-
probes
|
|
7072
|
+
probes,
|
|
7073
|
+
assetRoot
|
|
7087
7074
|
).then(({ duration }) => ({ id: el.id, duration }))
|
|
7088
7075
|
)
|
|
7089
7076
|
);
|
|
@@ -7106,7 +7093,8 @@ async function compileHtmlFile(html, baseDir, downloadDir, log, urlByAbsentLocal
|
|
|
7106
7093
|
el.id,
|
|
7107
7094
|
log,
|
|
7108
7095
|
void 0,
|
|
7109
|
-
probes
|
|
7096
|
+
probes,
|
|
7097
|
+
assetRoot
|
|
7110
7098
|
);
|
|
7111
7099
|
return { id: el.id, tagName: el.tagName, duration: el.duration, maxDuration, src: el.src };
|
|
7112
7100
|
})
|
|
@@ -7128,7 +7116,7 @@ async function compileHtmlFile(html, baseDir, downloadDir, log, urlByAbsentLocal
|
|
|
7128
7116
|
compiledHtml = compiledHtml.replace(/(<audio\b[^>]*)\s+crossorigin(?:=["'][^"']*["'])?/gi, "$1");
|
|
7129
7117
|
return { html: compiledHtml, unresolvedCompositions };
|
|
7130
7118
|
}
|
|
7131
|
-
async function parseSubCompositions(html, projectDir, downloadDir, visited = /* @__PURE__ */ new Set(), urlByAbsentLocalPath, probes) {
|
|
7119
|
+
async function parseSubCompositions(html, projectDir, downloadDir, visited = /* @__PURE__ */ new Set(), urlByAbsentLocalPath, probes, assetRoot) {
|
|
7132
7120
|
const subCompositions = /* @__PURE__ */ new Map();
|
|
7133
7121
|
const { document: document2 } = parseHTML(html);
|
|
7134
7122
|
const compEls = document2.querySelectorAll("[data-composition-src]");
|
|
@@ -7136,7 +7124,7 @@ async function parseSubCompositions(html, projectDir, downloadDir, visited = /*
|
|
|
7136
7124
|
for (const el of compEls) {
|
|
7137
7125
|
const srcPath = el.getAttribute("data-composition-src");
|
|
7138
7126
|
if (!srcPath) continue;
|
|
7139
|
-
const filePath =
|
|
7127
|
+
const filePath = resolveCompositionFile(projectDir, srcPath, assetRoot);
|
|
7140
7128
|
if (filePath === null || isPrivateCompositionFile(projectDir, filePath)) continue;
|
|
7141
7129
|
if (visited.has(filePath)) {
|
|
7142
7130
|
continue;
|
|
@@ -7158,7 +7146,8 @@ async function parseSubCompositions(html, projectDir, downloadDir, visited = /*
|
|
|
7158
7146
|
downloadDir,
|
|
7159
7147
|
void 0,
|
|
7160
7148
|
urlByAbsentLocalPath,
|
|
7161
|
-
probes
|
|
7149
|
+
probes,
|
|
7150
|
+
assetRoot
|
|
7162
7151
|
);
|
|
7163
7152
|
const nested = await parseSubCompositions(
|
|
7164
7153
|
compiledSub,
|
|
@@ -7166,7 +7155,8 @@ async function parseSubCompositions(html, projectDir, downloadDir, visited = /*
|
|
|
7166
7155
|
downloadDir,
|
|
7167
7156
|
item.nestedVisited,
|
|
7168
7157
|
urlByAbsentLocalPath,
|
|
7169
|
-
probes
|
|
7158
|
+
probes,
|
|
7159
|
+
assetRoot
|
|
7170
7160
|
);
|
|
7171
7161
|
return {
|
|
7172
7162
|
srcPath: item.srcPath,
|
|
@@ -7303,7 +7293,7 @@ function coalesceHeadStylesAndBodyScripts(html) {
|
|
|
7303
7293
|
}
|
|
7304
7294
|
return document2.toString();
|
|
7305
7295
|
}
|
|
7306
|
-
function inlineSubCompositions2(html, subCompositions, projectDir, variableOverrides
|
|
7296
|
+
function inlineSubCompositions2(html, subCompositions, projectDir, variableOverrides, assetRoot) {
|
|
7307
7297
|
const { document: document2 } = parseHTML(html);
|
|
7308
7298
|
const head = document2.querySelector("head");
|
|
7309
7299
|
const body = document2.querySelector("body");
|
|
@@ -7333,7 +7323,7 @@ function inlineSubCompositions2(html, subCompositions, projectDir, variableOverr
|
|
|
7333
7323
|
resolveHtml: (srcPath) => {
|
|
7334
7324
|
let compHtml = subCompositions.get(srcPath) || null;
|
|
7335
7325
|
if (!compHtml) {
|
|
7336
|
-
const filePath =
|
|
7326
|
+
const filePath = resolveCompositionFile(projectDir, srcPath, assetRoot);
|
|
7337
7327
|
const read = filePath && !isPrivateCompositionFile(projectDir, filePath) ? readProjectFile(filePath) : null;
|
|
7338
7328
|
if (read?.kind === "file") {
|
|
7339
7329
|
compHtml = rewriteUnresolvableGsapToCdn(read.text, projectDir, srcPath);
|
|
@@ -7537,7 +7527,7 @@ function collectExternalAssets(html, projectDir) {
|
|
|
7537
7527
|
const trimmed = rawPath.trim();
|
|
7538
7528
|
if (isNonRelativeUrl(trimmed)) return null;
|
|
7539
7529
|
const absPath = resolve5(absProjectDir, trimmed);
|
|
7540
|
-
if (
|
|
7530
|
+
if (isPathInside(absPath, absProjectDir)) {
|
|
7541
7531
|
return null;
|
|
7542
7532
|
}
|
|
7543
7533
|
if (!existsSync10(absPath)) return null;
|
|
@@ -7613,7 +7603,7 @@ async function downloadAndRewriteUrls(urlSet, html, remoteDir, warnLabel, logLab
|
|
|
7613
7603
|
const remoteMediaAssets = /* @__PURE__ */ new Map();
|
|
7614
7604
|
const urlToRelPath = /* @__PURE__ */ new Map();
|
|
7615
7605
|
for (const [url, absPath] of urlToLocal) {
|
|
7616
|
-
const relPath = `${REMOTE_MEDIA_SUBDIR}/${
|
|
7606
|
+
const relPath = `${REMOTE_MEDIA_SUBDIR}/${basename4(absPath)}`;
|
|
7617
7607
|
remoteMediaAssets.set(relPath, absPath);
|
|
7618
7608
|
urlToRelPath.set(url, relPath);
|
|
7619
7609
|
}
|
|
@@ -7773,13 +7763,13 @@ function projectStylesheetFontFamilies(html, projectDir) {
|
|
|
7773
7763
|
const href = /\bhref=["']([^"']+)["']/i.exec(tag)?.[1];
|
|
7774
7764
|
if (!href || /^(?:[a-z][a-z\d+.-]*:|\/\/)/i.test(href)) continue;
|
|
7775
7765
|
const sheet = resolve5(projectDir, decodedUrlPath(href).replace(/^(?:\.?\/)+/, ""));
|
|
7776
|
-
if (!
|
|
7766
|
+
if (!isPathInside(sheet, projectDir) || !existsSync10(sheet)) continue;
|
|
7777
7767
|
for (const face of extractFontFaceBlocks(readFileSync6(sheet, "utf8"))) {
|
|
7778
7768
|
const family = /font-family\s*:\s*([^;}]+)/i.exec(face)?.[1]?.trim().replace(/^['"]|['"]$/g, "");
|
|
7779
7769
|
const shipsFile = [...face.matchAll(LOCAL_FONTFACE_URL_RE)].some(([, url = ""]) => {
|
|
7780
7770
|
const path = decodedUrlPath(url);
|
|
7781
7771
|
const file = path.startsWith("/") ? resolve5(projectDir, `.${path}`) : resolve5(dirname6(sheet), path);
|
|
7782
|
-
return
|
|
7772
|
+
return isPathInside(file, projectDir) && existsSync10(file);
|
|
7783
7773
|
});
|
|
7784
7774
|
if (family && shipsFile) families.push(family);
|
|
7785
7775
|
}
|
|
@@ -7848,7 +7838,7 @@ async function readLocalFont(absPath) {
|
|
|
7848
7838
|
}
|
|
7849
7839
|
return { kind: "inline", buffer: Buffer.concat(chunks, totalBytes) };
|
|
7850
7840
|
}
|
|
7851
|
-
async function embedLocalFontFaces(html, projectDir) {
|
|
7841
|
+
async function embedLocalFontFaces(html, projectDir, assetRoot) {
|
|
7852
7842
|
const { fontToDataUri: toDataUri } = await import("./deterministicFonts-UDNPRDYM.js");
|
|
7853
7843
|
const styleBlockRe = /<style\b[^>]*>([\s\S]*?)<\/style>/gi;
|
|
7854
7844
|
const fontFaceRe = /@font-face\s*\{([^}]*)\}/gi;
|
|
@@ -7869,7 +7859,7 @@ async function embedLocalFontFaces(html, projectDir) {
|
|
|
7869
7859
|
const localPath = urlMatch[1];
|
|
7870
7860
|
if (!localPath || embeddedPaths.has(localPath)) continue;
|
|
7871
7861
|
const absPath = localPath.startsWith("/") ? localPath : resolve5(projectDir, localPath);
|
|
7872
|
-
if (!
|
|
7862
|
+
if (!isPathInside(absPath, projectDir) || escapesAssetRoot(absPath, assetRoot)) continue;
|
|
7873
7863
|
const ext = absPath.match(/\.(woff2?|ttf|otf|ttc)$/i)?.[1]?.toLowerCase() ?? "ttf";
|
|
7874
7864
|
try {
|
|
7875
7865
|
if (fileBackedAbsolutePaths.has(absPath)) {
|
|
@@ -7933,7 +7923,7 @@ function rewriteUnresolvableGsapToCdn(html, projectDir, compSrcPath) {
|
|
|
7933
7923
|
);
|
|
7934
7924
|
}
|
|
7935
7925
|
function rebaseDirectEntryAssetPaths(html, projectDir, htmlPath) {
|
|
7936
|
-
if (!
|
|
7926
|
+
if (!isPathInside(htmlPath, projectDir)) return html;
|
|
7937
7927
|
const entryPath = relative2(projectDir, htmlPath).replace(/\\/g, "/");
|
|
7938
7928
|
if (!entryPath.includes("/")) return html;
|
|
7939
7929
|
const { document: document2 } = parseHTML(html);
|
|
@@ -7976,12 +7966,16 @@ function bindVariableMediaSources(html, variables) {
|
|
|
7976
7966
|
return changed ? document2.toString() : html;
|
|
7977
7967
|
}
|
|
7978
7968
|
async function compileForRender(projectDir, htmlPath, downloadDir, options = {}) {
|
|
7969
|
+
const assetRoot = options.allowOutsideProjectAssets ? void 0 : projectDir;
|
|
7970
|
+
if (isPathInside(htmlPath, projectDir) && escapesAssetRoot(htmlPath, assetRoot)) {
|
|
7971
|
+
throw new Error(`Entry file ${htmlPath} leads outside the project folder`);
|
|
7972
|
+
}
|
|
7979
7973
|
const entryHtml = rebaseDirectEntryAssetPaths(readTextFile(htmlPath), projectDir, htmlPath);
|
|
7980
7974
|
const rawHtml = bindVariableMediaSources(
|
|
7981
7975
|
normalizeCompositionSrcs(rewriteUnresolvableGsapToCdn(entryHtml, projectDir), projectDir),
|
|
7982
7976
|
options.variables ?? {}
|
|
7983
7977
|
);
|
|
7984
|
-
assertSubCompositionsUsable(rawHtml, projectDir);
|
|
7978
|
+
assertSubCompositionsUsable(rawHtml, projectDir, assetRoot);
|
|
7985
7979
|
const probes = /* @__PURE__ */ new Map();
|
|
7986
7980
|
const { html: compiledHtml, unresolvedCompositions } = await compileHtmlFile(
|
|
7987
7981
|
rawHtml,
|
|
@@ -7989,7 +7983,8 @@ async function compileForRender(projectDir, htmlPath, downloadDir, options = {})
|
|
|
7989
7983
|
downloadDir,
|
|
7990
7984
|
options.log,
|
|
7991
7985
|
options.urlByAbsentLocalPath,
|
|
7992
|
-
probes
|
|
7986
|
+
probes,
|
|
7987
|
+
assetRoot
|
|
7993
7988
|
);
|
|
7994
7989
|
const { subCompositions } = await parseSubCompositions(
|
|
7995
7990
|
compiledHtml,
|
|
@@ -7997,14 +7992,16 @@ async function compileForRender(projectDir, htmlPath, downloadDir, options = {})
|
|
|
7997
7992
|
downloadDir,
|
|
7998
7993
|
void 0,
|
|
7999
7994
|
options.urlByAbsentLocalPath,
|
|
8000
|
-
probes
|
|
7995
|
+
probes,
|
|
7996
|
+
assetRoot
|
|
8001
7997
|
);
|
|
8002
7998
|
const fullHtml = ensureFullDocument(compiledHtml);
|
|
8003
7999
|
const inlinedHtml = inlineSubCompositions2(
|
|
8004
8000
|
fullHtml,
|
|
8005
8001
|
subCompositions,
|
|
8006
8002
|
projectDir,
|
|
8007
|
-
options.variables ?? {}
|
|
8003
|
+
options.variables ?? {},
|
|
8004
|
+
assetRoot
|
|
8008
8005
|
);
|
|
8009
8006
|
const sanitizedHtml = inlinedHtml.replace(
|
|
8010
8007
|
/(<(?:video|audio)\b[^>]*?)\s+preload\s*=\s*["']none["']/gi,
|
|
@@ -8060,7 +8057,8 @@ async function compileForRender(projectDir, htmlPath, downloadDir, options = {})
|
|
|
8060
8057
|
downloadDir,
|
|
8061
8058
|
cacheDir: options.animatedGifCacheDir,
|
|
8062
8059
|
sourceAssets: remoteImageAssets,
|
|
8063
|
-
timeoutMs: options.ffmpegProcessTimeout
|
|
8060
|
+
timeoutMs: options.ffmpegProcessTimeout,
|
|
8061
|
+
assetRoot
|
|
8064
8062
|
});
|
|
8065
8063
|
if (preparedHeifImages.length > 0) {
|
|
8066
8064
|
defaultLogger.debug(`[Compiler] Converted ${preparedHeifImages.length} HEIC image(s) to JPEG`);
|
|
@@ -8075,13 +8073,14 @@ async function compileForRender(projectDir, htmlPath, downloadDir, options = {})
|
|
|
8075
8073
|
downloadDir,
|
|
8076
8074
|
cacheDir: options.animatedGifCacheDir,
|
|
8077
8075
|
sourceAssets: gifSourceAssets,
|
|
8078
|
-
timeoutMs: options.ffmpegProcessTimeout
|
|
8076
|
+
timeoutMs: options.ffmpegProcessTimeout,
|
|
8077
|
+
assetRoot
|
|
8079
8078
|
});
|
|
8080
8079
|
if (preparedGifs.length > 0) {
|
|
8081
8080
|
defaultLogger.debug(`[Compiler] Prepared ${preparedGifs.length} animated GIF input(s) as WebM`);
|
|
8082
8081
|
}
|
|
8083
|
-
const embeddedHtml = await embedLocalFontFaces(htmlWithPreparedGifs, projectDir);
|
|
8084
|
-
const { html, externalAssets } = collectExternalAssets(embeddedHtml, projectDir);
|
|
8082
|
+
const embeddedHtml = await embedLocalFontFaces(htmlWithPreparedGifs, projectDir, assetRoot);
|
|
8083
|
+
const { html, externalAssets } = options.allowOutsideProjectAssets ? collectExternalAssets(embeddedHtml, projectDir) : { html: embeddedHtml, externalAssets: /* @__PURE__ */ new Map() };
|
|
8085
8084
|
for (const [relPath, absPath] of remoteMediaAssets) {
|
|
8086
8085
|
externalAssets.set(relPath, absPath);
|
|
8087
8086
|
}
|
|
@@ -8106,7 +8105,8 @@ async function compileForRender(projectDir, htmlPath, downloadDir, options = {})
|
|
|
8106
8105
|
for (const video of videos) {
|
|
8107
8106
|
if (isHttpUrl(video.src)) continue;
|
|
8108
8107
|
const videoPath = resolve5(projectDir, video.src);
|
|
8109
|
-
if (advised.has(videoPath) || namesAnotherNetworkRoot(projectDir, videoPath))
|
|
8108
|
+
if (advised.has(videoPath) || namesAnotherNetworkRoot(projectDir, videoPath) || !existsSync10(videoPath) || escapesAssetRoot(videoPath, assetRoot))
|
|
8109
|
+
continue;
|
|
8110
8110
|
advised.add(videoPath);
|
|
8111
8111
|
const reencode = `ffmpeg -i "${video.src}" -c:v libx264 -r 30 -g 30 -keyint_min 30 -movflags +faststart -c:a copy output.mp4`;
|
|
8112
8112
|
(async () => {
|
|
@@ -8485,10 +8485,18 @@ async function resolveCompositionDurations(page, unresolved) {
|
|
|
8485
8485
|
}
|
|
8486
8486
|
return resolutions;
|
|
8487
8487
|
}
|
|
8488
|
-
async function recompileWithResolutions(compiled, resolutions, projectDir, downloadDir) {
|
|
8488
|
+
async function recompileWithResolutions(compiled, resolutions, projectDir, downloadDir, assetRoot) {
|
|
8489
8489
|
if (resolutions.length === 0) return compiled;
|
|
8490
8490
|
const html = injectDurations(compiled.html, resolutions);
|
|
8491
|
-
const { subCompositions } = await parseSubCompositions(
|
|
8491
|
+
const { subCompositions } = await parseSubCompositions(
|
|
8492
|
+
html,
|
|
8493
|
+
projectDir,
|
|
8494
|
+
downloadDir,
|
|
8495
|
+
void 0,
|
|
8496
|
+
void 0,
|
|
8497
|
+
void 0,
|
|
8498
|
+
assetRoot
|
|
8499
|
+
);
|
|
8492
8500
|
const { videos, audios, images } = compiled;
|
|
8493
8501
|
const remaining = compiled.unresolvedCompositions.filter(
|
|
8494
8502
|
(c) => !resolutions.some((r) => r.id === c.id)
|
|
@@ -8521,8 +8529,16 @@ function adaptAspectAgnosticResolution(requested, aspectAgnostic, width, height,
|
|
|
8521
8529
|
}
|
|
8522
8530
|
function resolveEntryHtmlPath(input) {
|
|
8523
8531
|
const { projectDir, workDir, entryFile, log } = input;
|
|
8532
|
+
const readEntry = (path) => {
|
|
8533
|
+
if (escapesAssetRoot(path, input.assetRoot)) {
|
|
8534
|
+
throw new Error(
|
|
8535
|
+
`Entry file "${relative3(projectDir, path)}" leads outside the project folder`
|
|
8536
|
+
);
|
|
8537
|
+
}
|
|
8538
|
+
return readTextFile(path);
|
|
8539
|
+
};
|
|
8524
8540
|
const htmlPath = join17(projectDir, entryFile);
|
|
8525
|
-
const rawEntry =
|
|
8541
|
+
const rawEntry = readEntry(htmlPath);
|
|
8526
8542
|
if (entryFile === "index.html" || !isTemplateEntry(rawEntry)) return htmlPath;
|
|
8527
8543
|
const projectIndexPath = join17(projectDir, "index.html");
|
|
8528
8544
|
if (!existsSync11(projectIndexPath)) {
|
|
@@ -8531,7 +8547,7 @@ function resolveEntryHtmlPath(input) {
|
|
|
8531
8547
|
);
|
|
8532
8548
|
}
|
|
8533
8549
|
const standaloneHtml = extractStandaloneEntryFromIndex(
|
|
8534
|
-
|
|
8550
|
+
readEntry(projectIndexPath),
|
|
8535
8551
|
entryFile,
|
|
8536
8552
|
rawEntry
|
|
8537
8553
|
);
|
|
@@ -8567,7 +8583,8 @@ async function runCompileStage(input) {
|
|
|
8567
8583
|
allowSystemFontCapture,
|
|
8568
8584
|
abortSignal
|
|
8569
8585
|
} = input;
|
|
8570
|
-
const
|
|
8586
|
+
const assetRoot = job.config.allowOutsideProjectAssets ? void 0 : projectDir;
|
|
8587
|
+
const htmlPath = resolveEntryHtmlPath({ projectDir, workDir, entryFile, log, assetRoot });
|
|
8571
8588
|
const compileStart = Date.now();
|
|
8572
8589
|
const compiled = await compileForRender(projectDir, htmlPath, join17(workDir, "downloads"), {
|
|
8573
8590
|
log,
|
|
@@ -8578,7 +8595,8 @@ async function runCompileStage(input) {
|
|
|
8578
8595
|
urlByAbsentLocalPath: input.urlByAbsentLocalPath,
|
|
8579
8596
|
pageMotionBlur: input.pageMotionBlur,
|
|
8580
8597
|
animatedGifCacheDir: cfg.extractCacheDir ? join17(cfg.extractCacheDir, "animated-gif") : void 0,
|
|
8581
|
-
ffmpegProcessTimeout: cfg.ffmpegProcessTimeout
|
|
8598
|
+
ffmpegProcessTimeout: cfg.ffmpegProcessTimeout,
|
|
8599
|
+
allowOutsideProjectAssets: job.config.allowOutsideProjectAssets
|
|
8582
8600
|
});
|
|
8583
8601
|
assertNotAborted();
|
|
8584
8602
|
const compileOnlyMs = Date.now() - compileStart;
|
|
@@ -8633,6 +8651,9 @@ async function runCompileStage(input) {
|
|
|
8633
8651
|
width: compiled.width,
|
|
8634
8652
|
height: compiled.height
|
|
8635
8653
|
};
|
|
8654
|
+
if (!job.config.allowOutsideProjectAssets) {
|
|
8655
|
+
dropMediaOutsideProject({ projectDir, workDir, composition, log });
|
|
8656
|
+
}
|
|
8636
8657
|
await preflightCompositionAssetMediaTypes({
|
|
8637
8658
|
projectDir,
|
|
8638
8659
|
compiledDir: join17(workDir, "compiled"),
|
|
@@ -8681,7 +8702,7 @@ async function runCompileStage(input) {
|
|
|
8681
8702
|
|
|
8682
8703
|
// ../producer/src/services/render/stages/probeStage.ts
|
|
8683
8704
|
import { createHash as createHash5 } from "crypto";
|
|
8684
|
-
import { basename as
|
|
8705
|
+
import { basename as basename5, join as join18 } from "path";
|
|
8685
8706
|
|
|
8686
8707
|
// ../producer/src/services/render/stages/probeFailures.ts
|
|
8687
8708
|
var NETWORK_FAILURE_PATTERN = /404|ERR_NAME_NOT_RESOLVED|ERR_CONNECTION_REFUSED|net::ERR_/i;
|
|
@@ -8822,7 +8843,7 @@ function probeRequiresBrowser(args) {
|
|
|
8822
8843
|
function reportedLengthSource(source) {
|
|
8823
8844
|
if (!source) return null;
|
|
8824
8845
|
if (source.from !== "media") return { from: source.from };
|
|
8825
|
-
const name =
|
|
8846
|
+
const name = basename5(source.src.split(/[?#]/, 1)[0] ?? "");
|
|
8826
8847
|
const srcHash = createHash5("sha256").update(name).digest("hex").slice(0, 12);
|
|
8827
8848
|
return { from: "media", tag: source.tag, trimmed: source.trimmed, srcHash };
|
|
8828
8849
|
}
|
|
@@ -8886,7 +8907,8 @@ async function runProbeStage(input) {
|
|
|
8886
8907
|
compiledDir: join18(workDir, "compiled"),
|
|
8887
8908
|
port: 0,
|
|
8888
8909
|
preHeadScripts: [VIRTUAL_TIME_SHIM],
|
|
8889
|
-
fps: job.config.fps
|
|
8910
|
+
fps: job.config.fps,
|
|
8911
|
+
allowOutsideProjectAssets: job.config.allowOutsideProjectAssets
|
|
8890
8912
|
});
|
|
8891
8913
|
assertNotAborted();
|
|
8892
8914
|
const motionBlur = job.config.motionBlur;
|
|
@@ -9041,7 +9063,8 @@ async function runProbeStage(input) {
|
|
|
9041
9063
|
compiled,
|
|
9042
9064
|
resolutions,
|
|
9043
9065
|
projectDir,
|
|
9044
|
-
join18(workDir, "downloads")
|
|
9066
|
+
join18(workDir, "downloads"),
|
|
9067
|
+
job.config.allowOutsideProjectAssets ? void 0 : projectDir
|
|
9045
9068
|
);
|
|
9046
9069
|
assertNotAborted();
|
|
9047
9070
|
composition.videos = compiled.videos;
|
|
@@ -9230,6 +9253,9 @@ async function runProbeStage(input) {
|
|
|
9230
9253
|
}
|
|
9231
9254
|
}
|
|
9232
9255
|
}
|
|
9256
|
+
if (!job.config.allowOutsideProjectAssets) {
|
|
9257
|
+
dropMediaOutsideProject({ projectDir, workDir, composition, log });
|
|
9258
|
+
}
|
|
9233
9259
|
await preflightCompositionAssetMediaTypes({
|
|
9234
9260
|
projectDir,
|
|
9235
9261
|
compiledDir: join18(workDir, "compiled"),
|
|
@@ -11196,7 +11222,7 @@ import { join as join26 } from "path";
|
|
|
11196
11222
|
|
|
11197
11223
|
// ../producer/src/services/shaderTransitionWorkerPool.ts
|
|
11198
11224
|
import { Worker } from "worker_threads";
|
|
11199
|
-
import { fileURLToPath as
|
|
11225
|
+
import { fileURLToPath as fileURLToPath2, pathToFileURL } from "url";
|
|
11200
11226
|
import { dirname as dirname9, join as join25 } from "path";
|
|
11201
11227
|
import { createRequire } from "module";
|
|
11202
11228
|
import { existsSync as existsSync17 } from "fs";
|
|
@@ -11210,7 +11236,7 @@ function resolveWorkerEntry(explicit) {
|
|
|
11210
11236
|
const isTs = override.endsWith(".ts");
|
|
11211
11237
|
return { path: override, isTs };
|
|
11212
11238
|
}
|
|
11213
|
-
const moduleDir = dirname9(
|
|
11239
|
+
const moduleDir = dirname9(fileURLToPath2(import.meta.url));
|
|
11214
11240
|
const jsPath = join25(moduleDir, "shaderTransitionWorker.js");
|
|
11215
11241
|
if (existsSync17(jsPath)) return { path: jsPath, isTs: false };
|
|
11216
11242
|
const tsPath = join25(moduleDir, "shaderTransitionWorker.ts");
|
|
@@ -13399,7 +13425,7 @@ function deVerifyFallbackTelemetry(err) {
|
|
|
13399
13425
|
};
|
|
13400
13426
|
}
|
|
13401
13427
|
function resolveRenderDebugDir() {
|
|
13402
|
-
const producerRoot = process.env.PRODUCER_RENDERS_DIR ? resolve6(process.env.PRODUCER_RENDERS_DIR, "..") : resolve6(dirname11(
|
|
13428
|
+
const producerRoot = process.env.PRODUCER_RENDERS_DIR ? resolve6(process.env.PRODUCER_RENDERS_DIR, "..") : resolve6(dirname11(fileURLToPath3(import.meta.url)), "../..");
|
|
13403
13429
|
return join29(producerRoot, ".debug");
|
|
13404
13430
|
}
|
|
13405
13431
|
async function executeRenderJob(job, projectDir, outputPath, progressSink, abortSignal, assertRenderActive) {
|
|
@@ -13911,7 +13937,8 @@ async function executeRenderPipeline(input) {
|
|
|
13911
13937
|
compiledDir: join29(workDir, "compiled"),
|
|
13912
13938
|
port: 0,
|
|
13913
13939
|
preHeadScripts: [VIRTUAL_TIME_SHIM],
|
|
13914
|
-
fps: job.config.fps
|
|
13940
|
+
fps: job.config.fps,
|
|
13941
|
+
allowOutsideProjectAssets: job.config.allowOutsideProjectAssets
|
|
13915
13942
|
});
|
|
13916
13943
|
assertNotAborted();
|
|
13917
13944
|
observability.stageEnd("file_server", fileServerStart);
|
|
@@ -15534,7 +15561,7 @@ import { tmpdir as tmpdir4 } from "os";
|
|
|
15534
15561
|
// ../producer/src/services/distributed/mp4Stitch.ts
|
|
15535
15562
|
import { createReadStream as createReadStream3, createWriteStream, mkdirSync as mkdirSync11, rmSync as rmSync11 } from "fs";
|
|
15536
15563
|
import { open } from "fs/promises";
|
|
15537
|
-
import { basename as
|
|
15564
|
+
import { basename as basename6, dirname as dirname12, join as join30 } from "path";
|
|
15538
15565
|
import { finished, pipeline } from "stream/promises";
|
|
15539
15566
|
function boxAt(src, off, at, limit) {
|
|
15540
15567
|
let size = src.readUInt32BE(off);
|
|
@@ -15899,7 +15926,7 @@ async function writeStitchedMp4(chunkPaths, outputPath, audioPath) {
|
|
|
15899
15926
|
const layouts = await Promise.all(sourcePaths.map((path) => readMp4Layout(fileRange(path))));
|
|
15900
15927
|
const header = audioPath ? buildStitchedHeader(layouts.slice(1), layouts[0]) : buildStitchedHeader(layouts);
|
|
15901
15928
|
mkdirSync11(dirname12(outputPath), { recursive: true });
|
|
15902
|
-
const workDir = createStagingDir(dirname12(outputPath), `${
|
|
15929
|
+
const workDir = createStagingDir(dirname12(outputPath), `${basename6(outputPath)}.stitch-`);
|
|
15903
15930
|
const out = createWriteStream(join30(workDir, "out.mp4"));
|
|
15904
15931
|
try {
|
|
15905
15932
|
out.write(header);
|
|
@@ -15923,7 +15950,7 @@ import {
|
|
|
15923
15950
|
rmSync as rmSync12,
|
|
15924
15951
|
writeFileSync as writeFileSync9
|
|
15925
15952
|
} from "fs";
|
|
15926
|
-
import { extname as extname6, isAbsolute as isAbsolute2, join as join38, relative as
|
|
15953
|
+
import { extname as extname6, isAbsolute as isAbsolute2, join as join38, relative as relative6, sep as sep3 } from "path";
|
|
15927
15954
|
|
|
15928
15955
|
// ../producer/src/services/distributed/planFrameCost.ts
|
|
15929
15956
|
import { join as join33 } from "path";
|
|
@@ -15936,7 +15963,7 @@ import { extname as extname4, join as join32 } from "path";
|
|
|
15936
15963
|
import { execFile as execFileCallback } from "child_process";
|
|
15937
15964
|
import { dirname as dirname13, join as join31 } from "path";
|
|
15938
15965
|
import { existsSync as existsSync21, readFileSync as readFileSync8 } from "fs";
|
|
15939
|
-
import { fileURLToPath as
|
|
15966
|
+
import { fileURLToPath as fileURLToPath4 } from "url";
|
|
15940
15967
|
import { promisify as promisify2 } from "util";
|
|
15941
15968
|
var PLAN_VIDEOS_META_RELATIVE_PATH = "meta/videos.json";
|
|
15942
15969
|
var PLAN_AUDIO_RELATIVE_PATH = MIXED_AUDIO_FILENAME;
|
|
@@ -16198,14 +16225,15 @@ function buildSyntheticRenderJob(input) {
|
|
|
16198
16225
|
producerConfig: input.producerConfig,
|
|
16199
16226
|
variables: input.variables,
|
|
16200
16227
|
strictVariables: input.strictVariables,
|
|
16201
|
-
pageMotionBlur: input.pageMotionBlur
|
|
16228
|
+
pageMotionBlur: input.pageMotionBlur,
|
|
16229
|
+
allowOutsideProjectAssets: input.allowOutsideProjectAssets
|
|
16202
16230
|
};
|
|
16203
16231
|
return createRenderJob(renderConfig);
|
|
16204
16232
|
}
|
|
16205
16233
|
var cachedProducerVersion = null;
|
|
16206
16234
|
function readProducerVersion() {
|
|
16207
16235
|
if (cachedProducerVersion !== null) return cachedProducerVersion;
|
|
16208
|
-
const startDir = dirname13(
|
|
16236
|
+
const startDir = dirname13(fileURLToPath4(import.meta.url));
|
|
16209
16237
|
let current = startDir;
|
|
16210
16238
|
for (let i = 0; i < 10; i++) {
|
|
16211
16239
|
const candidate = join31(current, "package.json");
|
|
@@ -16557,7 +16585,7 @@ async function readPlanReferenceBackground(input) {
|
|
|
16557
16585
|
|
|
16558
16586
|
// ../producer/src/services/render/stages/freezePlan.ts
|
|
16559
16587
|
import { existsSync as existsSync23, mkdirSync as mkdirSync12, readFileSync as readFileSync9, readdirSync as readdirSync8, writeFileSync as writeFileSync7 } from "fs";
|
|
16560
|
-
import { join as join35, relative as
|
|
16588
|
+
import { join as join35, relative as relative4, resolve as resolve7 } from "path";
|
|
16561
16589
|
|
|
16562
16590
|
// ../producer/src/services/distributed/planProtocol.ts
|
|
16563
16591
|
var PLAN_SCHEMA_VERSION = 1;
|
|
@@ -16776,7 +16804,7 @@ function listPlanFiles(planDir) {
|
|
|
16776
16804
|
walk(full);
|
|
16777
16805
|
} else if (entry.isFile()) {
|
|
16778
16806
|
results.push({
|
|
16779
|
-
planRelativePath:
|
|
16807
|
+
planRelativePath: relative4(rootResolved, full).split(/[\\/]+/).join("/"),
|
|
16780
16808
|
absolutePath: full
|
|
16781
16809
|
});
|
|
16782
16810
|
}
|
|
@@ -17111,7 +17139,7 @@ async function muxChunkWithAudio(input) {
|
|
|
17111
17139
|
// ../producer/src/services/distributed/planSize.ts
|
|
17112
17140
|
import { createHash as createHash7 } from "crypto";
|
|
17113
17141
|
import { lstatSync as lstatSync2, readdirSync as readdirSync9 } from "fs";
|
|
17114
|
-
import { extname as extname5, join as join37, relative as
|
|
17142
|
+
import { extname as extname5, join as join37, relative as relative5 } from "path";
|
|
17115
17143
|
var MAX_TOP_COMPONENTS = 10;
|
|
17116
17144
|
var SOURCE_MEDIA_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
17117
17145
|
".aac",
|
|
@@ -17200,7 +17228,7 @@ function recordFile(result, components, rootDir, rootKind, filePath) {
|
|
|
17200
17228
|
} catch {
|
|
17201
17229
|
return;
|
|
17202
17230
|
}
|
|
17203
|
-
const rel =
|
|
17231
|
+
const rel = relative5(rootDir, filePath);
|
|
17204
17232
|
const segments = rel.split(/[\\/]+/).filter(Boolean);
|
|
17205
17233
|
const classified = classifyFile(segments, rootKind);
|
|
17206
17234
|
result.totalBytes += sizeBytes;
|
|
@@ -17584,7 +17612,7 @@ function resolveDistributedEngineConfig(config) {
|
|
|
17584
17612
|
};
|
|
17585
17613
|
}
|
|
17586
17614
|
function pathInside(root, path) {
|
|
17587
|
-
const rel =
|
|
17615
|
+
const rel = relative6(root, path);
|
|
17588
17616
|
return rel === "" || rel.startsWith("..") || isAbsolute2(rel) ? null : rel;
|
|
17589
17617
|
}
|
|
17590
17618
|
function stableSourcePath(roots, srcPath) {
|
|
@@ -17660,7 +17688,8 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
|
|
|
17660
17688
|
producerConfig: cfg,
|
|
17661
17689
|
variables: config.variables,
|
|
17662
17690
|
strictVariables: config.strictVariables,
|
|
17663
|
-
pageMotionBlur: config.pageMotionBlur
|
|
17691
|
+
pageMotionBlur: config.pageMotionBlur,
|
|
17692
|
+
allowOutsideProjectAssets: options.allowOutsideProjectAssets === true
|
|
17664
17693
|
});
|
|
17665
17694
|
const entryFile = config.entryFile ?? "index.html";
|
|
17666
17695
|
const htmlPath = join38(projectDir, entryFile);
|
|
@@ -17677,8 +17706,9 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
|
|
|
17677
17706
|
recursive: true,
|
|
17678
17707
|
dereference: true,
|
|
17679
17708
|
filter: (src) => {
|
|
17680
|
-
const rel =
|
|
17709
|
+
const rel = relative6(projectDir, src);
|
|
17681
17710
|
if (rel === "" || rel.startsWith("..")) return true;
|
|
17711
|
+
if (!job.config.allowOutsideProjectAssets && !isSafePath(projectDir, src)) return false;
|
|
17682
17712
|
const firstSegment = rel.split(sep3, 1)[0];
|
|
17683
17713
|
return firstSegment === void 0 || !PLAN_PROJECT_DIR_SKIP_SEGMENTS.has(firstSegment);
|
|
17684
17714
|
}
|
|
@@ -17784,7 +17814,7 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
|
|
|
17784
17814
|
if (probeResult.fileServer) closeFileServerSafely(probeResult.fileServer, "plan", log);
|
|
17785
17815
|
if (probeResult.probeSession) {
|
|
17786
17816
|
try {
|
|
17787
|
-
const { closeCaptureSession: closeCaptureSession2 } = await import("./src-
|
|
17817
|
+
const { closeCaptureSession: closeCaptureSession2 } = await import("./src-KDPZPYCF.js");
|
|
17788
17818
|
await closeCaptureSession2(probeResult.probeSession);
|
|
17789
17819
|
} catch (err) {
|
|
17790
17820
|
log.warn("[plan] probe session close failed", {
|
|
@@ -18162,7 +18192,7 @@ import {
|
|
|
18162
18192
|
writeFileSync as writeFileSync11
|
|
18163
18193
|
} from "fs";
|
|
18164
18194
|
import { tmpdir as tmpdir3 } from "os";
|
|
18165
|
-
import { dirname as dirname15, isAbsolute as isAbsolute3, join as join41, relative as
|
|
18195
|
+
import { dirname as dirname15, isAbsolute as isAbsolute3, join as join41, relative as relative7, resolve as resolve8, sep as sep4 } from "path";
|
|
18166
18196
|
|
|
18167
18197
|
// ../producer/src/services/distributed/planV2Publisher.ts
|
|
18168
18198
|
import {
|
|
@@ -18325,7 +18355,7 @@ function listFiles(root) {
|
|
|
18325
18355
|
walk(absolutePath);
|
|
18326
18356
|
} else if (entry.isFile()) {
|
|
18327
18357
|
files.push({
|
|
18328
|
-
path:
|
|
18358
|
+
path: relative7(rootResolved, absolutePath).split(sep4).join("/"),
|
|
18329
18359
|
absolutePath
|
|
18330
18360
|
});
|
|
18331
18361
|
} else {
|
|
@@ -18525,7 +18555,7 @@ function collectChunkVideoDependencies(input) {
|
|
|
18525
18555
|
for (let frame = chunk.startFrame; frame < chunk.endFrame; frame++) {
|
|
18526
18556
|
const globalTime = frame * input.fpsDen / input.fpsNum;
|
|
18527
18557
|
for (const [videoId, payload] of input.table.getActiveFramePayloads(globalTime)) {
|
|
18528
|
-
const path = input.deferredSources.get(videoId) ??
|
|
18558
|
+
const path = input.deferredSources.get(videoId) ?? relative7(resolve8(input.executionPlanDir), payload.framePath).split(sep4).join("/");
|
|
18529
18559
|
assertSafeRelativePath(path);
|
|
18530
18560
|
const indexes = mutable.get(path) ?? /* @__PURE__ */ new Set();
|
|
18531
18561
|
indexes.add(chunk.index);
|
|
@@ -19745,7 +19775,7 @@ function spanFrameRange(startSeconds, endSeconds, fps, totalFrames) {
|
|
|
19745
19775
|
function throwIfAborted(signal) {
|
|
19746
19776
|
if (signal?.aborted) throw new RenderCancelledError("render_cancelled", "user_cancelled");
|
|
19747
19777
|
}
|
|
19748
|
-
async function renderSpan(projectDir, config, span, outputPath) {
|
|
19778
|
+
async function renderSpan(projectDir, config, span, outputPath, options = {}) {
|
|
19749
19779
|
if (config.format !== "mp4") {
|
|
19750
19780
|
throw new RenderSpanUnsupportedError(
|
|
19751
19781
|
`--start/--end render mp4 only; ${config.format} is not supported for a range.`
|
|
@@ -19763,7 +19793,7 @@ async function renderSpan(projectDir, config, span, outputPath) {
|
|
|
19763
19793
|
projectDir,
|
|
19764
19794
|
{ ...config, rejectOnSystemFonts: false, failClosedFontFetch: false },
|
|
19765
19795
|
planDir,
|
|
19766
|
-
{ chunksCarryAudio: true }
|
|
19796
|
+
{ chunksCarryAudio: true, allowOutsideProjectAssets: options.allowOutsideProjectAssets }
|
|
19767
19797
|
);
|
|
19768
19798
|
const { startFrame, endFrame } = spanFrameRange(
|
|
19769
19799
|
span.startSeconds,
|
|
@@ -20271,7 +20301,8 @@ function renderConfigFromRequest(request, runtime = {}) {
|
|
|
20271
20301
|
return {
|
|
20272
20302
|
...options,
|
|
20273
20303
|
producerConfig: engineConfig,
|
|
20274
|
-
logger: runtime.logger
|
|
20304
|
+
logger: runtime.logger,
|
|
20305
|
+
allowOutsideProjectAssets: runtime.allowOutsideProjectAssets === true
|
|
20275
20306
|
};
|
|
20276
20307
|
}
|
|
20277
20308
|
function distributedFps(fps) {
|
|
@@ -20406,7 +20437,7 @@ import {
|
|
|
20406
20437
|
closeSync as closeSync6,
|
|
20407
20438
|
constants as constants3
|
|
20408
20439
|
} from "fs";
|
|
20409
|
-
import { resolve as resolve9, join as join44, relative as
|
|
20440
|
+
import { resolve as resolve9, join as join44, relative as relative8, isAbsolute as isAbsolute4, sep as sep5 } from "path";
|
|
20410
20441
|
function isStringRecord(value) {
|
|
20411
20442
|
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
20412
20443
|
return false;
|
|
@@ -20459,7 +20490,7 @@ function readProjectEntryFile(projectDir, preferredEntryFile) {
|
|
|
20459
20490
|
);
|
|
20460
20491
|
for (const entryFile of entryCandidates) {
|
|
20461
20492
|
const absoluteEntryPath = resolve9(absProjectDir, entryFile);
|
|
20462
|
-
const entryRelativePath =
|
|
20493
|
+
const entryRelativePath = relative8(absProjectDir, absoluteEntryPath);
|
|
20463
20494
|
if (entryRelativePath === ".." || entryRelativePath.startsWith(`..${sep5}`) || isAbsolute4(entryRelativePath)) {
|
|
20464
20495
|
return { error: `Entry file must stay inside project directory: ${entryFile}` };
|
|
20465
20496
|
}
|
|
@@ -20518,7 +20549,7 @@ async function runHyperframeLint(prepared) {
|
|
|
20518
20549
|
|
|
20519
20550
|
// ../producer/src/services/healthWorker.ts
|
|
20520
20551
|
import { Worker as Worker2 } from "worker_threads";
|
|
20521
|
-
import { fileURLToPath as
|
|
20552
|
+
import { fileURLToPath as fileURLToPath5 } from "url";
|
|
20522
20553
|
import { dirname as dirname16, join as join45 } from "path";
|
|
20523
20554
|
import { existsSync as existsSync30 } from "fs";
|
|
20524
20555
|
var DEFAULT_HEALTH_PORT = 9848;
|
|
@@ -20594,7 +20625,7 @@ function defaultLogger2() {
|
|
|
20594
20625
|
};
|
|
20595
20626
|
}
|
|
20596
20627
|
function resolveWorkerEntry2() {
|
|
20597
|
-
const here = dirname16(
|
|
20628
|
+
const here = dirname16(fileURLToPath5(import.meta.url));
|
|
20598
20629
|
const candidates = [join45(here, "healthWorkerThread.js"), join45(here, "healthWorkerThread.ts")];
|
|
20599
20630
|
for (const candidate of candidates) {
|
|
20600
20631
|
if (existsSync30(candidate)) return candidate;
|
|
@@ -21286,7 +21317,7 @@ function startServer(options = {}) {
|
|
|
21286
21317
|
});
|
|
21287
21318
|
async function shutdown(signal) {
|
|
21288
21319
|
log.info(`Received ${signal}, shutting down`);
|
|
21289
|
-
const { drainBrowserPool } = await import("./src-
|
|
21320
|
+
const { drainBrowserPool } = await import("./src-KDPZPYCF.js");
|
|
21290
21321
|
await drainBrowserPool().catch(() => {
|
|
21291
21322
|
});
|
|
21292
21323
|
const handle = await Promise.race([
|
|
@@ -21337,7 +21368,7 @@ import {
|
|
|
21337
21368
|
statSync as statSync12,
|
|
21338
21369
|
writeFileSync as writeFileSync14
|
|
21339
21370
|
} from "fs";
|
|
21340
|
-
import { basename as
|
|
21371
|
+
import { basename as basename7, dirname as dirname18, join as join47 } from "path";
|
|
21341
21372
|
function cfrRateControlArgs(locked) {
|
|
21342
21373
|
const preset = getEncoderPreset(locked.quality ?? "standard", "mp4");
|
|
21343
21374
|
if (locked.crf == null && locked.bitrate) {
|
|
@@ -21373,7 +21404,7 @@ async function assemble(planDir, chunkOutputs, audioPath, outputPath, options) {
|
|
|
21373
21404
|
if (!existsSync32(dirname18(outputPath))) {
|
|
21374
21405
|
mkdirSync20(dirname18(outputPath), { recursive: true });
|
|
21375
21406
|
}
|
|
21376
|
-
const workDir = createStagingDir(dirname18(outputPath), `${
|
|
21407
|
+
const workDir = createStagingDir(dirname18(outputPath), `${basename7(outputPath)}.assemble-work-`);
|
|
21377
21408
|
const fps = { num: plan2.dimensions.fpsNum, den: plan2.dimensions.fpsDen };
|
|
21378
21409
|
const stageMs = {};
|
|
21379
21410
|
const ctx = {
|
|
@@ -21699,7 +21730,6 @@ export {
|
|
|
21699
21730
|
createConsoleLogger,
|
|
21700
21731
|
defaultLogger,
|
|
21701
21732
|
createFileServer,
|
|
21702
|
-
resolveRenderPaths,
|
|
21703
21733
|
normalizeErrorMessage,
|
|
21704
21734
|
RENDER_JOB_DIR,
|
|
21705
21735
|
createOwnedRenderDir,
|