hyperframes 0.9.19 → 0.9.21
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-YT7BMWZB.js → add-VQVP3JPZ.js} +14 -15
- package/dist/{agentPromptGenerator-VKOL4XCD.js → agentPromptGenerator-PAFWQGHU.js} +10 -11
- package/dist/{animatedGifPrep-MD4BNSPH.js → animatedGifPrep-AK26JDVM.js} +10 -11
- package/dist/api.js +36 -37
- package/dist/{appHistory-WXJ4STHX.js → appHistory-FVDSCS64.js} +1 -1
- package/dist/{asset-J42DGWPQ.js → asset-N6RZSN44.js} +2 -2
- package/dist/{assetCataloger-XDZB53RE.js → assetCataloger-GWF6II54.js} +11 -12
- package/dist/{audio-6EV56WMQ.js → audio-ZHVBBQRA.js} +70 -26
- package/dist/{auth-ECYU3HT4.js → auth-AJM3YSN6.js} +4 -4
- package/dist/{autoUpdate-HIKCPXQA.js → autoUpdate-GV4LPAJX.js} +2 -2
- package/dist/{avatars-X7DEU57Y.js → avatars-5EKOR2DW.js} +16 -17
- package/dist/{backgroundChecks-IYWWBPTC.js → backgroundChecks-J4XJD4ET.js} +3 -3
- package/dist/backgroundChecksWorker.js +3 -3
- package/dist/{batchRender-3TAV6XQQ.js → batchRender-UKQ36JT2.js} +5 -6
- package/dist/{beats-IFJBCISA.js → beats-LXYHFVPP.js} +11 -12
- package/dist/{benchmark-OS6LVCAY.js → benchmark-KXR56MIT.js} +11 -12
- package/dist/{billing-4NRHG5FO.js → billing-3XQYSAKP.js} +15 -16
- package/dist/{browser-CFI3GKFB.js → browser-P52FDITF.js} +16 -4
- package/dist/{bundleWithLocalizedFonts-6YHKES5G.js → bundleWithLocalizedFonts-I3KWYN6X.js} +1 -1
- package/dist/{capture-SNHDWW7W.js → capture-2PSBIAL2.js} +3 -3
- package/dist/{capture-4H3W3FNF.js → capture-SMWSGGMG.js} +22 -23
- package/dist/{captureCompositionFrame-BH4UMGJP.js → captureCompositionFrame-WRY5ATM7.js} +16 -17
- package/dist/{catalog-RZOQ54KZ.js → catalog-JIO6RXSR.js} +14 -15
- package/dist/{catch-up-PA4QGVNL.js → catch-up-A73H7VGC.js} +18 -7
- package/dist/{check-J2TCCJL5.js → check-FI7SUTK7.js} +43 -42
- package/dist/{checkAudio-RIFMEOQI.js → checkAudio-73DDBXXJ.js} +13 -14
- package/dist/{checkBrowser-M4YCLLDJ.js → checkBrowser-X5VVYQES.js} +35 -36
- package/dist/{chunk-E3GBPA37.js → chunk-2HRKRRQH.js} +2 -2
- package/dist/{chunk-OR2FAQFS.js → chunk-3FG3YAHZ.js} +1 -1
- package/dist/{chunk-BJUPV6I3.js → chunk-3OIUJOIR.js} +1 -1
- package/dist/{chunk-FSTINYWN.js → chunk-3TLAQU62.js} +1 -1
- package/dist/{chunk-DTJV7ST5.js → chunk-3ZXKEGKV.js} +1 -1
- package/dist/{chunk-ABT7WBZZ.js → chunk-4EL5RKLS.js} +1 -1
- package/dist/{chunk-TOD5PQJF.js → chunk-4EMQHF3T.js} +2 -2
- package/dist/{chunk-6OBCXHIF.js → chunk-4FNJ2QNP.js} +4 -4
- package/dist/{chunk-3QIHS5V3.js → chunk-4NLG5TO6.js} +3 -3
- package/dist/{chunk-63LNVITK.js → chunk-4UXCWPHU.js} +1 -1
- package/dist/{chunk-UPURJC4I.js → chunk-4ZLMVX3O.js} +1 -1
- package/dist/{chunk-IV2R3NET.js → chunk-5PY66UGZ.js} +3 -3
- package/dist/{chunk-ZPJYWAAS.js → chunk-7ETNIXIN.js} +1 -1
- package/dist/{chunk-HNGHIX26.js → chunk-7EUZAQD6.js} +35 -2
- package/dist/{chunk-BEAEO4OV.js → chunk-A2NL7HGF.js} +1 -1
- package/dist/{chunk-JWQHGM3V.js → chunk-A4JU6QUG.js} +1 -1
- package/dist/{chunk-WMRHEI4N.js → chunk-ADJCNH7M.js} +1 -1
- package/dist/{chunk-ENVFGBRD.js → chunk-AXFYCH7S.js} +12 -0
- package/dist/{chunk-RRGH76QX.js → chunk-BABCRBAO.js} +38 -4
- package/dist/{chunk-SVT6FCQX.js → chunk-BUCJXB6D.js} +1 -1
- package/dist/{chunk-3UYQMVJS.js → chunk-C4KYJSSF.js} +9 -9
- package/dist/{chunk-N7D6YUGR.js → chunk-CFOJE3VR.js} +2 -2
- package/dist/{chunk-GKLZMLX3.js → chunk-CXUT4XVT.js} +22 -1
- package/dist/{chunk-2DPQ347C.js → chunk-CZK7A5IB.js} +4 -4
- package/dist/{chunk-3XJM7XZN.js → chunk-D3NWGOXW.js} +30 -0
- package/dist/{chunk-PTIOZJMF.js → chunk-D7C6NOOO.js} +2 -2
- package/dist/{chunk-H3YZRS32.js → chunk-DXIGIMRP.js} +2 -2
- package/dist/{chunk-T655WZ4R.js → chunk-DYPAXBNK.js} +1 -1
- package/dist/{chunk-4FFKOLNM.js → chunk-DZQEPGNY.js} +3 -3
- package/dist/{chunk-RKRJAQFI.js → chunk-F4XUCHQQ.js} +1 -1
- package/dist/{chunk-URGLY5QV.js → chunk-FASKJUYU.js} +98 -35
- package/dist/{chunk-7EN7RIPV.js → chunk-FET6WMTX.js} +2 -2
- package/dist/{chunk-WRBUQRJJ.js → chunk-FOX7LXZ2.js} +1 -1
- package/dist/chunk-FRBQYFUV.js +481 -0
- package/dist/{chunk-XPIP5ZV3.js → chunk-G5UZHDEZ.js} +2 -2
- package/dist/{chunk-AKEZ2BEE.js → chunk-G77Z4GWC.js} +1 -1
- package/dist/{chunk-6AYTP32B.js → chunk-GG7RYSIU.js} +1 -1
- package/dist/{chunk-KXZD37E5.js → chunk-GH6GWAID.js} +1 -1
- package/dist/{chunk-2LZO4FX3.js → chunk-GKOSN3Q6.js} +3 -3
- package/dist/chunk-GREVQ2SM.js +5035 -0
- package/dist/{chunk-J3QW55W5.js → chunk-H6676SHA.js} +1 -1
- package/dist/{chunk-SJUFAZV5.js → chunk-H7N3J7Y3.js} +2 -2
- package/dist/{chunk-RWJFNJUE.js → chunk-HCFBCEJT.js} +1 -1
- package/dist/{chunk-NKK2FRY7.js → chunk-I7WVS7WN.js} +1 -1
- package/dist/{chunk-UIUILBMB.js → chunk-IFY5ACTF.js} +13 -13
- package/dist/{chunk-M3EGX3ID.js → chunk-IQR26ZJD.js} +5 -5
- package/dist/{chunk-XYHAXHOH.js → chunk-IRWQMKV7.js} +1 -1
- package/dist/{chunk-HY5KQ4KT.js → chunk-ITO3VCCW.js} +10 -10
- package/dist/{chunk-XKYXENEP.js → chunk-JNN2CTGU.js} +2 -2
- package/dist/{chunk-6KBDQAZC.js → chunk-JT6LFFYK.js} +1 -1
- package/dist/{chunk-L24NAUBS.js → chunk-KBHBSWEE.js} +64 -19
- package/dist/{chunk-XQD6XWE3.js → chunk-L2SQTHMP.js} +1 -1
- package/dist/{chunk-ZVDYDMQA.js → chunk-L4C4F4O3.js} +3 -3
- package/dist/{chunk-RLXUABCX.js → chunk-LDO7SB4J.js} +12 -5
- package/dist/{chunk-IPXNWK7O.js → chunk-LGSSYJS2.js} +2 -2
- package/dist/{chunk-ATUCYH5L.js → chunk-LIFQONFJ.js} +1 -1
- package/dist/{chunk-NTMMUK6Q.js → chunk-LLUKDUVS.js} +38 -20
- package/dist/{chunk-IDNKBZNX.js → chunk-LMUF3BGR.js} +1 -1
- package/dist/{chunk-5PC5FMF4.js → chunk-LQBZCXMR.js} +3 -3
- package/dist/{chunk-L6YCPDRH.js → chunk-M32FE7JZ.js} +3 -3
- package/dist/{chunk-BYVDFTG6.js → chunk-M7Z2SEQG.js} +2 -2
- package/dist/{chunk-RL3CNZAX.js → chunk-MERPHIUD.js} +2 -2
- package/dist/{chunk-JWORQ5WQ.js → chunk-MFDNMTOP.js} +1 -1
- package/dist/{chunk-CBHNARFI.js → chunk-MNMIIDOX.js} +1 -1
- package/dist/{chunk-PMAGFCRB.js → chunk-NBHVLN5J.js} +7 -7
- package/dist/{chunk-Z2BBCW57.js → chunk-NTNNGWKO.js} +3 -3
- package/dist/{chunk-VXZOWF6M.js → chunk-ONBYVA2L.js} +62 -25
- package/dist/{chunk-G2HKE5CX.js → chunk-OQ6VGBQV.js} +1 -1
- package/dist/{chunk-GNING3UV.js → chunk-OXMEC34G.js} +1 -1
- package/dist/{chunk-VGAKHIDG.js → chunk-OXUX73RX.js} +10 -10
- package/dist/{chunk-A5MTIN4M.js → chunk-P7WDQTQZ.js} +1 -1
- package/dist/chunk-PJNDSYJV.js +525 -0
- package/dist/{chunk-X2TDLUIK.js → chunk-PPOJMJR5.js} +51 -16
- package/dist/{chunk-67JLV22D.js → chunk-Q2LO2ZF6.js} +3 -3
- package/dist/{chunk-CPFG5QSQ.js → chunk-QAES6F2D.js} +7 -7
- package/dist/{chunk-FJXBDFH6.js → chunk-QXVJ33BP.js} +362 -190
- package/dist/{chunk-WAY7TXDD.js → chunk-RLY4LECT.js} +2 -2
- package/dist/{chunk-JDAYOJGJ.js → chunk-RQIR2BOG.js} +1 -1
- package/dist/{chunk-YCXW65RT.js → chunk-RYRSI623.js} +5 -5
- package/dist/{chunk-BUIZAY4L.js → chunk-TERSCNBN.js} +19 -8
- package/dist/{chunk-I4G55F5J.js → chunk-TLNKHH52.js} +1 -1
- package/dist/{chunk-I2L7KR3N.js → chunk-UFMWWEL3.js} +7 -7
- package/dist/{chunk-GZK32KOL.js → chunk-W62DJ5ZK.js} +5 -5
- package/dist/{chunk-TLZCUWHQ.js → chunk-WFEKL42K.js} +266 -61
- package/dist/{chunk-LDFI55LW.js → chunk-WZCSU7ZP.js} +1 -1
- package/dist/{chunk-7HROKMNQ.js → chunk-XC5PF4T4.js} +4 -4
- package/dist/{chunk-2752JKE6.js → chunk-XQUO3BOS.js} +65 -21
- package/dist/{chunk-2AL2DME3.js → chunk-XRNXGF7I.js} +2 -2
- package/dist/{chunk-QEFMUD5U.js → chunk-YALKIB2K.js} +1 -1
- package/dist/{chunk-W6Q7Q7BS.js → chunk-YQV44DRO.js} +77 -2
- package/dist/{chunk-WBXUGXZP.js → chunk-YZKRMBYH.js} +1 -1
- package/dist/{chunk-D33DCBBM.js → chunk-ZEQOP7XA.js} +2 -2
- package/dist/{chunk-YBUZQGMX.js → chunk-ZFYCYUVY.js} +2 -2
- package/dist/{chunk-LFSSI7W3.js → chunk-ZH3SXWCV.js} +42 -15
- package/dist/{chunk-TJUJJYJC.js → chunk-ZNFYQMFN.js} +2 -2
- package/dist/{clean-PMM6YUQ3.js → clean-PILJFGU2.js} +20 -21
- package/dist/cli.js +62 -62
- package/dist/{cloud-D3WTNTF2.js → cloud-D7DFYONW.js} +4 -4
- package/dist/{cloud-OIPASJZZ.js → cloud-HBMQH4EU.js} +4 -4
- package/dist/{cloudrun-3TXJ2QOV.js → cloudrun-JZQMF5DS.js} +6 -7
- package/dist/commands/layout-audit.browser.js +287 -23
- package/dist/{compare-NC7JQXZH.js → compare-5RSAPYJI.js} +32 -33
- package/dist/{compiler-C2HCN5CA.js → compiler-T4BPLRFY.js} +4 -4
- package/dist/{component-M2VJD3QI.js → component-DMHFV7BD.js} +3 -3
- package/dist/{compositions-3QMQV5OS.js → compositions-OW776OLK.js} +14 -15
- package/dist/{curve-S3VZXTYX.js → curve-4GNM7DWM.js} +14 -15
- package/dist/{cuts-O3OKZGPU.js → cuts-M5R2LKDZ.js} +15 -16
- package/dist/{delete-RFDRT4K6.js → delete-MYG77L66.js} +7 -7
- package/dist/{deploy-LIQXICPP.js → deploy-FGHE4FID.js} +1 -1
- package/dist/{describeProject-IUAV4C55.js → describeProject-SLAKVOOS.js} +11 -12
- package/dist/{deterministicFonts-DQDB47K3.js → deterministicFonts-IXXU76SA.js} +1 -1
- package/dist/{diff-F434Y7GL.js → diff-TNHEXG72.js} +35 -36
- package/dist/{dist-KA45Z5SZ.js → dist-23VTYBIX.js} +11 -12
- package/dist/{dist-URQMS2HM.js → dist-5ITUK4AA.js} +6 -4
- package/dist/{dist-6N5S5326.js → dist-PEDQQRFU.js} +17 -17
- package/dist/docs/motion-blur.md +3 -5
- package/dist/{doctor-VAEAFW3N.js → doctor-ILCPSC6S.js} +14 -15
- package/dist/{energy-HQG367CH.js → energy-SCJII6HC.js} +15 -16
- package/dist/{events-R55FOR6B.js → events-D2QORX35.js} +2 -2
- package/dist/{events-M457QJCL.js → events-OHIGKF4W.js} +16 -4
- package/dist/{events-3HQKXGJN.js → events-ZMK5VRA2.js} +17 -18
- package/dist/{extract-KSYOILWX.js → extract-OD3LI3YL.js} +15 -16
- package/dist/{face-IOYVA3KO.js → face-SFQDTQXC.js} +15 -16
- package/dist/{feedback-OLY2Y2HB.js → feedback-N3JK4ULK.js} +18 -19
- package/dist/{ffmpeg-POWBUKIU.js → ffmpeg-E55HQX7V.js} +10 -11
- package/dist/{figma-PYAOGAQ7.js → figma-JYVZPN5L.js} +3 -3
- package/dist/fontLocalizeCli.js +14 -15
- package/dist/{frames-RIUU6JZF.js → frames-BLCIN32Q.js} +16 -17
- package/dist/{generate-TVFTFEHB.js → generate-B7MUYYON.js} +27 -28
- package/dist/{get-ASVUBVPU.js → get-VQWG2NY4.js} +7 -7
- package/dist/{gpuPolicy-QDYHFIDS.js → gpuPolicy-3TMFL6TM.js} +10 -11
- package/dist/{grade-compare-2TVGR2WJ.js → grade-compare-LCS5CBNW.js} +33 -34
- package/dist/{heifImagePrep-ZDQ6FE6L.js → heifImagePrep-VHAJEZGL.js} +11 -12
- package/dist/{help-MZHLMNGB.js → help-GSE5DFSB.js} +1 -1
- package/dist/{history-CCPMGESN.js → history-RSB65UN3.js} +19 -8
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +65 -65
- package/dist/hyperframes-player.global.js +1 -1
- package/dist/{info-5CRW7PXR.js → info-FLLONVY5.js} +16 -17
- package/dist/{init-6U5JDVOC.js → init-EAKY3LFR.js} +30 -31
- package/dist/{ink-BVK6K2CB.js → ink-ZDZVD5CD.js} +15 -16
- package/dist/{inspect-NUGGYSLQ.js → inspect-LFEK6HOL.js} +33 -34
- package/dist/{installer-TBUJ66L6.js → installer-5NJVGV6X.js} +6 -7
- package/dist/{keyframes-N5637YSK.js → keyframes-TZBDB442.js} +16 -8
- package/dist/{lambda-VPSI7MTF.js → lambda-RYX5NXX5.js} +14 -15
- package/dist/{layout-FHJ2SQTW.js → layout-VATFBERH.js} +33 -34
- package/dist/{lint-XPRHASUK.js → lint-QAGBHUXZ.js} +27 -13
- package/dist/{lintProject-6TML32JZ.js → lintProject-BC5ISNKQ.js} +2 -2
- package/dist/{list-TST4Z4GR.js → list-VQZOLGEO.js} +7 -7
- package/dist/{localPage-NR4NBUTZ.js → localPage-ZEJ7ZKIE.js} +10 -11
- package/dist/{login-64KOPWVK.js → login-7BL2N6JG.js} +6 -6
- package/dist/{logout-EQ2HJDL4.js → logout-EKDVIU6Y.js} +2 -2
- package/dist/{look-VBHITYXG.js → look-OKDV2W4W.js} +15 -16
- package/dist/{manager-OAK67I5F.js → manager-QPEMMSLW.js} +11 -12
- package/dist/{measure-NNQ6XXH2.js → measure-WJ6TR545.js} +11 -11
- package/dist/{media-treatment-M2X3Q5NV.js → media-treatment-QYQVLCYP.js} +16 -17
- package/dist/{media-use-ZGJJL6KV.js → media-use-OWKQQSPJ.js} +4 -4
- package/dist/{models-Y24YJJ6P.js → models-FZ4HL5BX.js} +14 -15
- package/dist/{motionShot-KMU2SMX6.js → motionShot-IHZ544WM.js} +19 -20
- package/dist/{normalize-audio-27XH53UL.js → normalize-audio-77ZTAPPL.js} +11 -12
- package/dist/{open-6MLQR2BC.js → open-Q7AAAYVN.js} +70 -20
- package/dist/{parakeetRunner-BMK7KY7W.js → parakeetRunner-TAMKXXNN.js} +15 -16
- package/dist/{pipeline-AILSBZUB.js → pipeline-MK7LCHQD.js} +13 -14
- package/dist/{play-VTM2B4CS.js → play-WBLWBDBS.js} +22 -23
- package/dist/{preflight-IRQCF5ZW.js → preflight-O2EH2LOC.js} +11 -12
- package/dist/{present-JQH4CETR.js → present-3GW46ZYF.js} +18 -19
- package/dist/{preview-KGMCKLBI.js → preview-MPAHNXEJ.js} +57 -504
- package/dist/{probe-IP6W7U4A.js → probe-4F2PK26B.js} +15 -16
- package/dist/{producer-PRYLGX6W.js → producer-T462QJC7.js} +1 -1
- package/dist/{projectConfig-6WPGQGI3.js → projectConfig-T3WVF6H4.js} +8 -9
- package/dist/{publication-25E6ZMLB.js → publication-DX3VDYCI.js} +4 -5
- package/dist/{publish-6QT26AMU.js → publish-VNMKJMAK.js} +15 -16
- package/dist/{refresh-ARZZRKMP.js → refresh-ZHLUUENK.js} +2 -2
- package/dist/{remove-background-CVQQZNQQ.js → remove-background-7LE4IIOE.js} +14 -15
- package/dist/{render-3VHULZTP.js → render-5PTZ5VLW.js} +7 -8
- package/dist/{render-PUXPIIGJ.js → render-JKUR7OI2.js} +76 -39
- package/dist/{render-VMHF2RVD.js → render-RPHNBD4F.js} +42 -39
- package/dist/{render-batch-UKWKZUJM.js → render-batch-X2QMZUYH.js} +7 -8
- package/dist/renderSetupWorker.js +11 -8
- package/dist/{resolver-KEMGGVU7.js → resolver-AXDCEJ77.js} +6 -7
- package/dist/{reverse-4BCCUHPA.js → reverse-DQSOSC5W.js} +1 -1
- package/dist/{run-WZP6HXIH.js → run-IQLZHH6D.js} +5 -5
- package/dist/{screenshotCapture-VGOH65YU.js → screenshotCapture-EAATIOT3.js} +11 -12
- package/dist/{sherpa-AQJGVMWJ.js → sherpa-NPPB3DTN.js} +14 -15
- package/dist/skills/hyperframes/references/motion.md +1 -1
- package/dist/skills/hyperframes/references/storyboard.md +1 -1
- package/dist/skills/hyperframes-cli/references/lint-validate-inspect.md +1 -1
- package/dist/skills/hyperframes-cli/references/preview-render.md +1 -1
- package/dist/skills/media-use/audio/scripts/audio.mjs +56 -26
- package/dist/skills/media-use/audio/scripts/lib/media-record.mjs +3 -3
- package/dist/skills/media-use/audio/scripts/lib/media-record.test.mjs +16 -1
- package/dist/skills/media-use/audio/scripts/lib/recording.mjs +53 -0
- package/dist/skills/media-use/audio/scripts/lib/voice-credit.mjs +17 -0
- package/dist/skills/media-use/audio/scripts/lib/voice-credit.test.mjs +21 -0
- package/dist/skills/media-use/audio/scripts/recording.test.mjs +139 -0
- package/dist/skills/media-use/references/audio.md +2 -1
- package/dist/skills/media-use/references/heygen.md +9 -9
- package/dist/{skills-VB4OXS7B.js → skills-S2ODBBMC.js} +19 -7
- package/dist/{skillsUpdateCheck-HMGBIR2Z.js → skillsUpdateCheck-AOCZDRXM.js} +3 -3
- package/dist/{snapshot-SXWIDOD3.js → snapshot-SS6WDSZ5.js} +40 -41
- package/dist/{src-IEVHZX7S.js → src-HHRR3UTF.js} +13 -14
- package/dist/{src-RETKK67M.js → src-MYVZPRHS.js} +20 -19
- package/dist/{start-PDD5527T.js → start-OYIXMJKF.js} +24 -25
- package/dist/{staticProjectServer-GJQCWV7Y.js → staticProjectServer-65X4MWEN.js} +21 -22
- package/dist/{status-N6FGW6E2.js → status-JEYVWANY.js} +16 -17
- package/dist/studio/assets/{hyperframes-player-Dszy0WKm.js → hyperframes-player-DqxUNa9H.js} +1 -1
- package/dist/studio/assets/index-Bgfyny02.css +1 -0
- package/dist/studio/assets/{index-CWYuXWlI.js → index-CFUJyYA1.js} +1 -1
- package/dist/studio/assets/{index-BeR5xCi5.js → index-Cq43Ovkf.js} +196 -196
- package/dist/studio/index.html +2 -2
- package/dist/{studio-api-IAELPUY4.js → studio-api-GJGFGQQW.js} +11 -12
- package/dist/{studioServer-XTVVJA3E.js → studioServer-IS27DJNF.js} +66 -59
- package/dist/{sync-SDUSYR4M.js → sync-NLK2RFSR.js} +15 -16
- package/dist/{telemetry-IXOTZW4E.js → telemetry-BMPRZBBX.js} +22 -2
- package/dist/{telemetry-U4VJBESU.js → telemetry-BPPPHER2.js} +16 -4
- package/dist/templates/_shared/AGENTS.md +3 -1
- package/dist/templates/_shared/CLAUDE.md +3 -1
- package/dist/{templates-VFKKDFCR.js → templates-YWBAFFI4.js} +25 -26
- package/dist/{timeline-62HYU4LF.js → timeline-FAFHG2G4.js} +21 -22
- package/dist/{tokens-XJUQMDBP.js → tokens-QCZBFNMS.js} +2 -2
- package/dist/{transcribe-7IPTYLH2.js → transcribe-2P6GMYWR.js} +29 -30
- package/dist/{transcribe-RRGMCQBP.js → transcribe-VL3YKFMY.js} +13 -14
- package/dist/{update-EAL42IMG.js → update-NWDCG6JG.js} +20 -8
- package/dist/{updateCheck-CCDI422O.js → updateCheck-PX4XSKDO.js} +2 -2
- package/dist/{upgrade-A73PJHPY.js → upgrade-VWETDZDT.js} +3 -3
- package/dist/{upload-YQMBLKH5.js → upload-PEY7EYFV.js} +7 -2
- package/dist/{urlDownloader-JZIEE3AD.js → urlDownloader-7TVBPNBG.js} +9 -10
- package/dist/{validate-N6F4N34T.js → validate-HCJAHDTZ.js} +27 -28
- package/dist/{video-6LPKR7VA.js → video-JDUB5IFM.js} +11 -12
- package/dist/{voices-LFPLTLKV.js → voices-YBKCBC6K.js} +30 -29
- package/dist/warmCheck.js +41 -42
- package/package.json +1 -1
- package/dist/chunk-GDQQ4U3L.js +0 -226
- package/dist/chunk-TK7THLRO.js +0 -65
- package/dist/chunk-X7SYA4OP.js +0 -5035
- package/dist/studio/assets/index-CNZk2EFC.css +0 -1
|
@@ -11,17 +11,17 @@ import {
|
|
|
11
11
|
iterateFontFamilyDeclarations,
|
|
12
12
|
normalizeSystemFontPrimaryFamilies,
|
|
13
13
|
resolveFontFamilyDeclarationFamilies
|
|
14
|
-
} from "./chunk-
|
|
14
|
+
} from "./chunk-AXFYCH7S.js";
|
|
15
15
|
import {
|
|
16
16
|
Semaphore,
|
|
17
17
|
prepareHeifImageInputs,
|
|
18
18
|
withMediaProbeSlot
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-G5UZHDEZ.js";
|
|
20
20
|
import {
|
|
21
21
|
EncoderInterruptedError,
|
|
22
22
|
encoderFailureError,
|
|
23
23
|
prepareAnimatedGifInputs
|
|
24
|
-
} from "./chunk-
|
|
24
|
+
} from "./chunk-2HRKRRQH.js";
|
|
25
25
|
import {
|
|
26
26
|
openRangeEnd,
|
|
27
27
|
parseEncoderOptions
|
|
@@ -186,7 +186,7 @@ import {
|
|
|
186
186
|
videoAudioId,
|
|
187
187
|
videoStartOnMediaTimeline,
|
|
188
188
|
writeCapturedFrame
|
|
189
|
-
} from "./chunk-
|
|
189
|
+
} from "./chunk-WFEKL42K.js";
|
|
190
190
|
import {
|
|
191
191
|
assignBundledRuntimeCompositionIds,
|
|
192
192
|
emitMountedModuleScripts,
|
|
@@ -198,12 +198,17 @@ import {
|
|
|
198
198
|
parsesAsScript,
|
|
199
199
|
prepareFlattenedInnerRoot,
|
|
200
200
|
stripSdrPngColourTags
|
|
201
|
-
} from "./chunk-
|
|
201
|
+
} from "./chunk-M7Z2SEQG.js";
|
|
202
202
|
import {
|
|
203
203
|
collectScratchLeftovers,
|
|
204
204
|
removeScratch,
|
|
205
205
|
renameWithRetry
|
|
206
206
|
} from "./chunk-YWRUQ7XZ.js";
|
|
207
|
+
import {
|
|
208
|
+
TRANSITIONS,
|
|
209
|
+
convertTransfer,
|
|
210
|
+
crossfade
|
|
211
|
+
} from "./chunk-3GXQPCJC.js";
|
|
207
212
|
import {
|
|
208
213
|
DISTRIBUTED_FPS,
|
|
209
214
|
HF_VFX_ATTR,
|
|
@@ -217,9 +222,11 @@ import {
|
|
|
217
222
|
normalizeGsapBaseUrl,
|
|
218
223
|
parseFps,
|
|
219
224
|
parseVfxChain,
|
|
225
|
+
redactKnownPaths,
|
|
226
|
+
redactTelemetryString,
|
|
220
227
|
resolveAuthoredTimingWindow,
|
|
221
228
|
toFps
|
|
222
|
-
} from "./chunk-
|
|
229
|
+
} from "./chunk-YQV44DRO.js";
|
|
223
230
|
import {
|
|
224
231
|
COMPOSITION_SOURCE_URL,
|
|
225
232
|
HF_COLOR_GRADING_ATTR,
|
|
@@ -254,29 +261,25 @@ import {
|
|
|
254
261
|
sourceTimeAt,
|
|
255
262
|
styleElementsFor,
|
|
256
263
|
timeAtSourceTime
|
|
257
|
-
} from "./chunk-
|
|
258
|
-
import {
|
|
259
|
-
TRANSITIONS,
|
|
260
|
-
convertTransfer,
|
|
261
|
-
crossfade
|
|
262
|
-
} from "./chunk-3GXQPCJC.js";
|
|
263
|
-
import {
|
|
264
|
-
redactKnownPaths,
|
|
265
|
-
redactTelemetryString
|
|
266
|
-
} from "./chunk-TK7THLRO.js";
|
|
264
|
+
} from "./chunk-GREVQ2SM.js";
|
|
267
265
|
import {
|
|
268
266
|
chromeMajorCeiling
|
|
269
267
|
} from "./chunk-WE42NVH7.js";
|
|
270
268
|
import {
|
|
271
269
|
lintHyperframeHtml,
|
|
272
270
|
resolveReferencedStart
|
|
273
|
-
} from "./chunk-
|
|
271
|
+
} from "./chunk-LLUKDUVS.js";
|
|
274
272
|
import {
|
|
275
273
|
isUnresolvedAssetPlaceholder,
|
|
276
274
|
readProjectFile,
|
|
277
275
|
readTextFile,
|
|
278
276
|
resolveProjectRelativeSrc
|
|
279
277
|
} from "./chunk-WVRAFHJU.js";
|
|
278
|
+
import {
|
|
279
|
+
LOW_MEMORY_TOTAL_MB_THRESHOLD,
|
|
280
|
+
getCgroupMemoryLimitMb,
|
|
281
|
+
getSystemTotalMb
|
|
282
|
+
} from "./chunk-FBN2M2HK.js";
|
|
280
283
|
import {
|
|
281
284
|
CSS_URL_RE,
|
|
282
285
|
MEDIA_START_BASIS_ATTR,
|
|
@@ -308,15 +311,10 @@ import {
|
|
|
308
311
|
import {
|
|
309
312
|
parseHTML
|
|
310
313
|
} from "./chunk-GWTIFRF5.js";
|
|
311
|
-
import {
|
|
312
|
-
LOW_MEMORY_TOTAL_MB_THRESHOLD,
|
|
313
|
-
getCgroupMemoryLimitMb,
|
|
314
|
-
getSystemTotalMb
|
|
315
|
-
} from "./chunk-FBN2M2HK.js";
|
|
316
314
|
|
|
317
315
|
// ../producer/src/services/renderOrchestrator.ts
|
|
318
316
|
import {
|
|
319
|
-
existsSync as
|
|
317
|
+
existsSync as existsSync20,
|
|
320
318
|
mkdirSync as mkdirSync10,
|
|
321
319
|
readdirSync as readdirSync6,
|
|
322
320
|
rmSync as rmSync10,
|
|
@@ -664,6 +662,68 @@ ${seededRandomBlock}
|
|
|
664
662
|
}
|
|
665
663
|
};
|
|
666
664
|
|
|
665
|
+
// Timers set once rendering has started run on film time: each seek fires every timer due by then, in
|
|
666
|
+
// due order. Until a seek after the page reports ready, timers keep the wall clock: setup code waits on
|
|
667
|
+
// them while the renderer may already be seeking.
|
|
668
|
+
var rendering = false;
|
|
669
|
+
var timerQueue = [];
|
|
670
|
+
var nextTimerId = 1000000000;
|
|
671
|
+
var firingDepth = 0;
|
|
672
|
+
function addTimer(callback, delay, args, repeats) {
|
|
673
|
+
// A timer set from a firing timer waits at least 1 ms, so a zero-delay chain cannot stall a seek.
|
|
674
|
+
var ms = Math.max(firingDepth > 0 ? 1 : 0, Number(delay) || 0);
|
|
675
|
+
var entry = { id: nextTimerId++, callback: callback, args: args, due: virtualNowMs + ms, every: repeats ? Math.max(1, ms) : 0, cancelled: false };
|
|
676
|
+
timerQueue.push(entry);
|
|
677
|
+
return entry.id;
|
|
678
|
+
}
|
|
679
|
+
function cancelTimer(id) {
|
|
680
|
+
for (var i = 0; i < timerQueue.length; i++) {
|
|
681
|
+
if (timerQueue[i].id === id) {
|
|
682
|
+
timerQueue[i].cancelled = true;
|
|
683
|
+
return true;
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
return false;
|
|
687
|
+
}
|
|
688
|
+
function fireDueTimers(untilMs) {
|
|
689
|
+
// Frame times are fractional, so a timer due on a frame lands a rounding error past it; it still fires on it.
|
|
690
|
+
untilMs += 0.000001;
|
|
691
|
+
while (true) {
|
|
692
|
+
var next = null;
|
|
693
|
+
for (var i = 0; i < timerQueue.length; i++) {
|
|
694
|
+
var candidate = timerQueue[i];
|
|
695
|
+
if (!candidate.cancelled && candidate.due <= untilMs && (next === null || candidate.due < next.due)) next = candidate;
|
|
696
|
+
}
|
|
697
|
+
if (next === null) break;
|
|
698
|
+
var dueMs = next.due;
|
|
699
|
+
if (next.every) next.due += next.every;
|
|
700
|
+
else next.cancelled = true;
|
|
701
|
+
virtualNowMs = dueMs;
|
|
702
|
+
firingDepth++;
|
|
703
|
+
try {
|
|
704
|
+
next.callback.apply(window, next.args);
|
|
705
|
+
} catch (err) {
|
|
706
|
+
originalSetTimeout(function() { throw err; }, 0);
|
|
707
|
+
}
|
|
708
|
+
firingDepth--;
|
|
709
|
+
}
|
|
710
|
+
timerQueue = timerQueue.filter(function(entry) { return !entry.cancelled; });
|
|
711
|
+
}
|
|
712
|
+
window.setTimeout = function(callback, delay) {
|
|
713
|
+
if (!rendering || typeof callback !== "function") return originalSetTimeout.apply(null, arguments);
|
|
714
|
+
return addTimer(callback, delay, Array.prototype.slice.call(arguments, 2), false);
|
|
715
|
+
};
|
|
716
|
+
window.setInterval = function(callback, delay) {
|
|
717
|
+
if (!rendering || typeof callback !== "function") return originalSetInterval.apply(null, arguments);
|
|
718
|
+
return addTimer(callback, delay, Array.prototype.slice.call(arguments, 2), true);
|
|
719
|
+
};
|
|
720
|
+
window.clearTimeout = function(id) {
|
|
721
|
+
if (!cancelTimer(id)) originalClearTimeout(id);
|
|
722
|
+
};
|
|
723
|
+
window.clearInterval = function(id) {
|
|
724
|
+
if (!cancelTimer(id)) originalClearInterval(id);
|
|
725
|
+
};
|
|
726
|
+
|
|
667
727
|
window.__HF_VIRTUAL_TIME__ = {
|
|
668
728
|
originalSetTimeout: originalSetTimeout,
|
|
669
729
|
originalClearTimeout: originalClearTimeout,
|
|
@@ -673,8 +733,10 @@ ${seededRandomBlock}
|
|
|
673
733
|
originalCancelAnimationFrame: originalCancelAnimationFrame,
|
|
674
734
|
seekToTime: function(nextTimeMs) {
|
|
675
735
|
var safeTimeMs = Math.max(0, Number(nextTimeMs) || 0);
|
|
736
|
+
if (window.__renderReady === true) rendering = true;
|
|
737
|
+
${seekToTimeReseedCall}fireDueTimers(safeTimeMs);
|
|
676
738
|
virtualNowMs = safeTimeMs;
|
|
677
|
-
|
|
739
|
+
flushAnimationFrame();
|
|
678
740
|
return virtualNowMs;
|
|
679
741
|
},
|
|
680
742
|
getTime: function() {
|
|
@@ -1165,7 +1227,7 @@ function resolveDeliveryEncoderOptions(config) {
|
|
|
1165
1227
|
import {
|
|
1166
1228
|
copyFileSync,
|
|
1167
1229
|
cpSync,
|
|
1168
|
-
existsSync as
|
|
1230
|
+
existsSync as existsSync4,
|
|
1169
1231
|
mkdirSync,
|
|
1170
1232
|
rmSync,
|
|
1171
1233
|
symlinkSync,
|
|
@@ -1181,6 +1243,7 @@ import {
|
|
|
1181
1243
|
relative as nodeRelative,
|
|
1182
1244
|
isAbsolute as nodeIsAbsolute
|
|
1183
1245
|
} from "path";
|
|
1246
|
+
import { existsSync as existsSync3 } from "fs";
|
|
1184
1247
|
import { fileURLToPath as fileURLToPath2 } from "url";
|
|
1185
1248
|
var DEFAULT_RENDERS_DIR = process.env.PRODUCER_RENDERS_DIR ?? // fileURLToPath (not URL.pathname): on Windows .pathname is "/D:/..." which
|
|
1186
1249
|
// resolves to a bogus renders dir.
|
|
@@ -1219,6 +1282,13 @@ function resolveRenderPaths(projectDir, outputPath, rendersDir = DEFAULT_RENDERS
|
|
|
1219
1282
|
const absoluteOutputPath = nodeResolve(resolvedOutputPath);
|
|
1220
1283
|
return { absoluteProjectDir, absoluteOutputPath };
|
|
1221
1284
|
}
|
|
1285
|
+
function resolveCompositionSrc(projectDir, src) {
|
|
1286
|
+
const rooted = (value) => nodeResolve(projectDir, value.replace(/^(?:\.?[\\/])+/, ""));
|
|
1287
|
+
const decoded = rooted(decodedUrlPath(src));
|
|
1288
|
+
if (!isPathInside2(decoded, projectDir)) return null;
|
|
1289
|
+
const raw = rooted(src);
|
|
1290
|
+
return !existsSync3(decoded) && isPathInside2(raw, projectDir) && existsSync3(raw) ? raw : decoded;
|
|
1291
|
+
}
|
|
1222
1292
|
|
|
1223
1293
|
// ../producer/src/services/render/shared.ts
|
|
1224
1294
|
var BROWSER_MEDIA_EPSILON = 1e-4;
|
|
@@ -1422,7 +1492,7 @@ var materializePathModule = {
|
|
|
1422
1492
|
isAbsolute
|
|
1423
1493
|
};
|
|
1424
1494
|
var materializeFileSystem = {
|
|
1425
|
-
existsSync:
|
|
1495
|
+
existsSync: existsSync4,
|
|
1426
1496
|
mkdirSync,
|
|
1427
1497
|
symlinkSync,
|
|
1428
1498
|
cpSync,
|
|
@@ -1702,12 +1772,12 @@ var RenderExecutionContext = class {
|
|
|
1702
1772
|
};
|
|
1703
1773
|
|
|
1704
1774
|
// ../producer/src/services/render/artifactTransaction.ts
|
|
1705
|
-
import { closeSync as closeSync2, existsSync as
|
|
1775
|
+
import { closeSync as closeSync2, existsSync as existsSync6, fstatSync as fstatSync2, openSync as openSync2, readSync, readdirSync as readdirSync2, rmSync as rmSync3 } from "fs";
|
|
1706
1776
|
import { basename as basename3, dirname as dirname4, extname as extname2, join as join5, resolve as resolve4 } from "path";
|
|
1707
1777
|
|
|
1708
1778
|
// ../producer/src/services/render/renderDirOwner.ts
|
|
1709
1779
|
import {
|
|
1710
|
-
existsSync as
|
|
1780
|
+
existsSync as existsSync5,
|
|
1711
1781
|
lstatSync,
|
|
1712
1782
|
mkdtempSync,
|
|
1713
1783
|
readFileSync as readFileSync2,
|
|
@@ -1782,7 +1852,7 @@ function newestWriteMs(path) {
|
|
|
1782
1852
|
}
|
|
1783
1853
|
function isAbandoned(dir, ownerlessIdleMs, now) {
|
|
1784
1854
|
try {
|
|
1785
|
-
if (!lstatSync(dir).isDirectory() ||
|
|
1855
|
+
if (!lstatSync(dir).isDirectory() || existsSync5(join4(dir, TRANSACTION_BACKUP))) return false;
|
|
1786
1856
|
const owner = ownerState(dir);
|
|
1787
1857
|
if (owner === "gone") return true;
|
|
1788
1858
|
return owner === "none" && ownerlessIdleMs !== void 0 && now - newestWriteMs(dir) >= ownerlessIdleMs;
|
|
@@ -1814,7 +1884,7 @@ function createRenderWorkDir(prefix, outputDir) {
|
|
|
1814
1884
|
|
|
1815
1885
|
// ../producer/src/services/render/artifactTransaction.ts
|
|
1816
1886
|
var defaultFileSystem = {
|
|
1817
|
-
existsSync:
|
|
1887
|
+
existsSync: existsSync6,
|
|
1818
1888
|
renameSync: (source, destination) => renameWithRetry(source, destination),
|
|
1819
1889
|
rmSync: rmSync3
|
|
1820
1890
|
};
|
|
@@ -1968,7 +2038,7 @@ var ArtifactTransaction = class {
|
|
|
1968
2038
|
async assertDirectoryExpectation(expected, files) {
|
|
1969
2039
|
for (const required of expected.requiredFiles ?? []) {
|
|
1970
2040
|
const path = join5(this.stagingPath, required);
|
|
1971
|
-
if (!
|
|
2041
|
+
if (!existsSync6(path)) {
|
|
1972
2042
|
throw new Error(`Render artifact directory is missing ${required}: ${this.stagingPath}`);
|
|
1973
2043
|
}
|
|
1974
2044
|
assertReadableNonEmptyFile(path);
|
|
@@ -2217,7 +2287,7 @@ function replanAfterFailure(plan2, failure) {
|
|
|
2217
2287
|
}
|
|
2218
2288
|
|
|
2219
2289
|
// ../producer/src/services/render/stages/captureSegmentedStage.ts
|
|
2220
|
-
import { existsSync as
|
|
2290
|
+
import { existsSync as existsSync7, mkdirSync as mkdirSync3, rmSync as rmSync6, statSync as statSync3 } from "fs";
|
|
2221
2291
|
import { join as join10 } from "path";
|
|
2222
2292
|
|
|
2223
2293
|
// ../producer/src/services/render/perfSummary.ts
|
|
@@ -2497,6 +2567,19 @@ function aggregateBeginFrameReuse(perfs) {
|
|
|
2497
2567
|
if (noDamageFrames + hasDamageFrames === 0) return void 0;
|
|
2498
2568
|
return { noDamageFrames, hasDamageFrames };
|
|
2499
2569
|
}
|
|
2570
|
+
function aggregateMotionBlur(perfs) {
|
|
2571
|
+
const ran = perfs.flatMap((p) => p.motionBlur ?? []).filter((m) => m.tier || m.failedFrames > 0);
|
|
2572
|
+
const first = ran[0];
|
|
2573
|
+
if (!first) return void 0;
|
|
2574
|
+
return {
|
|
2575
|
+
tier: first.tier ?? ran.find((m) => m.tier)?.tier ?? null,
|
|
2576
|
+
reasonCode: first.reasonCode,
|
|
2577
|
+
movers: first.movers,
|
|
2578
|
+
failedFrames: ran.reduce((sum2, m) => sum2 + m.failedFrames, 0),
|
|
2579
|
+
readEvents: ran.some((m) => m.readEvents),
|
|
2580
|
+
fingerprint: ran.find((m) => m.fingerprint)?.fingerprint ?? null
|
|
2581
|
+
};
|
|
2582
|
+
}
|
|
2500
2583
|
function buildRenderPerfSummary(input) {
|
|
2501
2584
|
return {
|
|
2502
2585
|
renderId: input.job.id,
|
|
@@ -2547,6 +2630,7 @@ function buildRenderPerfSummary(input) {
|
|
|
2547
2630
|
staticDedup: aggregateDedup(input.dedupPerfs),
|
|
2548
2631
|
chromeMemory: aggregateChromeMemory(input.dedupPerfs),
|
|
2549
2632
|
beginFrameReuse: aggregateBeginFrameReuse(input.dedupPerfs),
|
|
2633
|
+
motionBlur: aggregateMotionBlur(input.dedupPerfs),
|
|
2550
2634
|
drawElement: aggregateDrawElement(
|
|
2551
2635
|
input.dedupPerfs,
|
|
2552
2636
|
input.drawElement ?? { selfVerifyFallback: false }
|
|
@@ -3963,6 +4047,21 @@ function raceAgainstStall(promise, deadlineMs, input, signal) {
|
|
|
3963
4047
|
);
|
|
3964
4048
|
});
|
|
3965
4049
|
}
|
|
4050
|
+
function createSessionInitBudget(input) {
|
|
4051
|
+
const initStallMs = Math.max(SESSION_INIT_STALL_MS, resolveCaptureStallTimeoutMs());
|
|
4052
|
+
const setup = createStallClock();
|
|
4053
|
+
return (work, stalled) => raceAgainstStall(
|
|
4054
|
+
work,
|
|
4055
|
+
initStallMs - setup.idle(0),
|
|
4056
|
+
{
|
|
4057
|
+
session: stalled,
|
|
4058
|
+
frameIndex: input.frameIndex,
|
|
4059
|
+
totalFrames: input.totalFrames,
|
|
4060
|
+
stallTimeoutMs: initStallMs
|
|
4061
|
+
},
|
|
4062
|
+
input.abortSignal
|
|
4063
|
+
);
|
|
4064
|
+
}
|
|
3966
4065
|
function createDrainFrameGuard(args) {
|
|
3967
4066
|
const { log, stats, frameTime } = args;
|
|
3968
4067
|
const verifyMinDb = resolveDeVerifyMinDb();
|
|
@@ -4435,14 +4534,11 @@ async function runCaptureStreamingStage(input) {
|
|
|
4435
4534
|
let resumes = 0;
|
|
4436
4535
|
for (; ; ) {
|
|
4437
4536
|
const videoInjector = createRenderVideoFrameInjector();
|
|
4438
|
-
const
|
|
4439
|
-
|
|
4440
|
-
|
|
4441
|
-
work,
|
|
4442
|
-
initStallMs - setup.idle(0),
|
|
4443
|
-
{ session: stalled, frameIndex: resume.from, totalFrames, stallTimeoutMs: initStallMs },
|
|
4537
|
+
const withinInitBudget = createSessionInitBudget({
|
|
4538
|
+
frameIndex: resume.from,
|
|
4539
|
+
totalFrames,
|
|
4444
4540
|
abortSignal
|
|
4445
|
-
);
|
|
4541
|
+
});
|
|
4446
4542
|
const openSession = async () => {
|
|
4447
4543
|
const opening = createCaptureSession(
|
|
4448
4544
|
fileServer.url,
|
|
@@ -4720,7 +4816,7 @@ async function captureSegmentToEncoder(ctx, segment) {
|
|
|
4720
4816
|
path: segmentPath,
|
|
4721
4817
|
// Recorded so resume can prove the file on disk is the one that
|
|
4722
4818
|
// finished; absent only in unit tests, whose fake encoder writes none.
|
|
4723
|
-
bytes:
|
|
4819
|
+
bytes: existsSync7(segmentPath) ? statSync3(segmentPath).size : 0
|
|
4724
4820
|
});
|
|
4725
4821
|
return encodeResult;
|
|
4726
4822
|
} finally {
|
|
@@ -4750,14 +4846,29 @@ function defaultSessionFactory(input) {
|
|
|
4750
4846
|
});
|
|
4751
4847
|
probeSession = null;
|
|
4752
4848
|
}
|
|
4753
|
-
const
|
|
4849
|
+
const withinInitBudget = createSessionInitBudget({
|
|
4850
|
+
frameIndex: input.job.framesRendered ?? 0,
|
|
4851
|
+
totalFrames: input.totalFrames,
|
|
4852
|
+
abortSignal: input.abortSignal
|
|
4853
|
+
});
|
|
4854
|
+
const openSession = async () => {
|
|
4855
|
+
const opening = openSegmentedSession(input, injector);
|
|
4856
|
+
try {
|
|
4857
|
+
return await withinInitBudget(opening, OPENING_CAPTURE_SESSION);
|
|
4858
|
+
} catch (error) {
|
|
4859
|
+
void opening.then(closeCaptureSession, () => {
|
|
4860
|
+
});
|
|
4861
|
+
throw error;
|
|
4862
|
+
}
|
|
4863
|
+
};
|
|
4864
|
+
const session = probeSession ?? await openSession();
|
|
4754
4865
|
if (probeSession) {
|
|
4755
4866
|
openSegmentedSessionReuse(input, probeSession, injector);
|
|
4756
4867
|
probeSession = null;
|
|
4757
4868
|
}
|
|
4758
4869
|
try {
|
|
4759
|
-
if (!session.isInitialized) await initializeSession(session);
|
|
4760
|
-
await completeDeferredDrawElementInit(session);
|
|
4870
|
+
if (!session.isInitialized) await withinInitBudget(initializeSession(session), session);
|
|
4871
|
+
await withinInitBudget(completeDeferredDrawElementInit(session), session);
|
|
4761
4872
|
} catch (error) {
|
|
4762
4873
|
await closeCaptureSession(session).catch(() => {
|
|
4763
4874
|
});
|
|
@@ -5671,7 +5782,7 @@ function trackSegmentFramePeak(frames, rootDir, onPeak) {
|
|
|
5671
5782
|
|
|
5672
5783
|
// ../producer/src/services/render/segmentManifest.ts
|
|
5673
5784
|
import { createHash as createHash2 } from "crypto";
|
|
5674
|
-
import { existsSync as
|
|
5785
|
+
import { existsSync as existsSync8, mkdirSync as mkdirSync6, readFileSync as readFileSync4, statSync as statSync5, writeFileSync as writeFileSync3 } from "fs";
|
|
5675
5786
|
import { join as join15 } from "path";
|
|
5676
5787
|
var MANIFEST_FILENAME = "segments.json";
|
|
5677
5788
|
function computeSegmentPlanHash(input) {
|
|
@@ -5718,7 +5829,7 @@ function isManifest(value) {
|
|
|
5718
5829
|
}
|
|
5719
5830
|
function readSegmentManifest(segmentDir) {
|
|
5720
5831
|
const path = join15(segmentDir, MANIFEST_FILENAME);
|
|
5721
|
-
if (!
|
|
5832
|
+
if (!existsSync8(path)) return null;
|
|
5722
5833
|
try {
|
|
5723
5834
|
const parsed = JSON.parse(readFileSync4(path, "utf-8"));
|
|
5724
5835
|
return isManifest(parsed) ? parsed : null;
|
|
@@ -5747,7 +5858,7 @@ async function validateCompletedSegments(manifest, expectedHash, probeFrames) {
|
|
|
5747
5858
|
const ok = /* @__PURE__ */ new Set();
|
|
5748
5859
|
if (manifest.planHash !== expectedHash) return ok;
|
|
5749
5860
|
for (const entry of manifest.completed) {
|
|
5750
|
-
if (!
|
|
5861
|
+
if (!existsSync8(entry.path)) continue;
|
|
5751
5862
|
const size = statSync5(entry.path).size;
|
|
5752
5863
|
if (size <= 0 || size !== entry.bytes) continue;
|
|
5753
5864
|
const frames = await probeFrames(entry.path);
|
|
@@ -5877,7 +5988,7 @@ var ALLOWED_STRING_DATA_KEYS = /* @__PURE__ */ new Set([
|
|
|
5877
5988
|
"stagePhase",
|
|
5878
5989
|
// Full-fidelity fast-capture fallback trigger — the specific reason
|
|
5879
5990
|
// drawElement gated off ("filter:blur", "filter:drop-shadow",
|
|
5880
|
-
// "backdrop-filter", "clip-path", "at_risk_timeline", "swiftshader", …).
|
|
5991
|
+
// "backdrop-filter", "clip-path", "at_risk_timeline", "swiftshader", "webgl_unavailable", …).
|
|
5881
5992
|
// Populated on the `capture_fallback_profile` checkpoint emitted by
|
|
5882
5993
|
// `fallbackCaptureProfile.ts` when the operator opts into
|
|
5883
5994
|
// `HF_PROFILE_FALLBACK_CAPTURE=true` so downstream metric consumers can
|
|
@@ -6305,13 +6416,13 @@ function countAuthoredTimedClips(html) {
|
|
|
6305
6416
|
}
|
|
6306
6417
|
|
|
6307
6418
|
// ../producer/src/services/render/stages/compileStage.ts
|
|
6308
|
-
import { existsSync as
|
|
6419
|
+
import { existsSync as existsSync11, writeFileSync as writeFileSync4 } from "fs";
|
|
6309
6420
|
import { join as join17 } from "path";
|
|
6310
6421
|
|
|
6311
6422
|
// ../producer/src/services/htmlCompiler.ts
|
|
6312
6423
|
import { createHash as createHash4 } from "crypto";
|
|
6313
|
-
import { createReadStream as createReadStream2, existsSync as
|
|
6314
|
-
import { join as join16, dirname as dirname6, resolve as resolve5, basename as basename4, relative as relative2 } from "path";
|
|
6424
|
+
import { createReadStream as createReadStream2, existsSync as existsSync10, mkdirSync as mkdirSync7, readFileSync as readFileSync5 } from "fs";
|
|
6425
|
+
import { join as join16, dirname as dirname6, resolve as resolve5, basename as basename4, relative as relative2, sep as sep2 } from "path";
|
|
6315
6426
|
|
|
6316
6427
|
// ../producer/src/services/renderMediaCollector.ts
|
|
6317
6428
|
function resolveHostEnd(host, hostStart) {
|
|
@@ -6460,7 +6571,7 @@ function getPositionEditsRenderScript() {
|
|
|
6460
6571
|
}
|
|
6461
6572
|
|
|
6462
6573
|
// ../producer/src/services/assetMediaType.ts
|
|
6463
|
-
import { existsSync as
|
|
6574
|
+
import { existsSync as existsSync9 } from "fs";
|
|
6464
6575
|
var ASSET_MEDIA_TYPE_MISMATCH = "ASSET_MEDIA_TYPE_MISMATCH";
|
|
6465
6576
|
var AssetMediaTypeMismatchError = class extends Error {
|
|
6466
6577
|
code = ASSET_MEDIA_TYPE_MISMATCH;
|
|
@@ -6526,7 +6637,7 @@ async function preflightCompositionAssetMediaTypes(input) {
|
|
|
6526
6637
|
input.projectDir,
|
|
6527
6638
|
input.compiledDir
|
|
6528
6639
|
);
|
|
6529
|
-
if (!
|
|
6640
|
+
if (!existsSync9(resolvedPath)) continue;
|
|
6530
6641
|
byPath.set(resolvedPath, [...byPath.get(resolvedPath) ?? [], reference]);
|
|
6531
6642
|
}
|
|
6532
6643
|
const mismatches = [];
|
|
@@ -6614,6 +6725,14 @@ Check that each file referenced by data-composition-src contains valid HTML with
|
|
|
6614
6725
|
this.problems = problems;
|
|
6615
6726
|
}
|
|
6616
6727
|
};
|
|
6728
|
+
function normalizeCompositionSrcs(html, projectDir) {
|
|
6729
|
+
return html.replace(/(\bdata-composition-src=)(["'])([^"']*)\2/g, (whole, name, quote, value) => {
|
|
6730
|
+
if (!value.includes("%") && !value.startsWith("/")) return whole;
|
|
6731
|
+
const file = resolveCompositionSrc(projectDir, value);
|
|
6732
|
+
if (file === null) return whole;
|
|
6733
|
+
return `${name}${quote}${relative2(projectDir, file).split(sep2).join("/")}${quote}`;
|
|
6734
|
+
});
|
|
6735
|
+
}
|
|
6617
6736
|
function assertSubCompositionsUsable(html, projectDir, visited = /* @__PURE__ */ new Set()) {
|
|
6618
6737
|
const { document: document2 } = parseHTML(html);
|
|
6619
6738
|
const hosts = [...document2.querySelectorAll("[data-composition-src]")];
|
|
@@ -6622,7 +6741,11 @@ function assertSubCompositionsUsable(html, projectDir, visited = /* @__PURE__ */
|
|
|
6622
6741
|
const srcPath = el.getAttribute("data-composition-src");
|
|
6623
6742
|
if (!srcPath) continue;
|
|
6624
6743
|
if (isUnresolvedAssetPlaceholder(srcPath)) continue;
|
|
6625
|
-
const filePath =
|
|
6744
|
+
const filePath = resolveCompositionSrc(projectDir, srcPath);
|
|
6745
|
+
if (filePath === null) {
|
|
6746
|
+
problems.push({ srcPath, detail: "it is outside the project folder" });
|
|
6747
|
+
continue;
|
|
6748
|
+
}
|
|
6626
6749
|
if (visited.has(filePath)) continue;
|
|
6627
6750
|
const read = readProjectFile(filePath);
|
|
6628
6751
|
if (read.kind === "missing") {
|
|
@@ -6768,7 +6891,7 @@ async function resolveMediaDuration(src, mediaStart, playbackRate, baseDir, down
|
|
|
6768
6891
|
let filePath = src;
|
|
6769
6892
|
if (isHttpUrl(src)) {
|
|
6770
6893
|
const remoteDir = join16(downloadDir, REMOTE_MEDIA_SUBDIR);
|
|
6771
|
-
if (!
|
|
6894
|
+
if (!existsSync10(remoteDir)) mkdirSync7(remoteDir, { recursive: true });
|
|
6772
6895
|
try {
|
|
6773
6896
|
filePath = await downloadToTemp(src, remoteDir, void 0, void 0, void 0, {
|
|
6774
6897
|
onTelemetry: logRemoteDownloadTelemetry
|
|
@@ -6781,7 +6904,7 @@ async function resolveMediaDuration(src, mediaStart, playbackRate, baseDir, down
|
|
|
6781
6904
|
if (!filePath.startsWith("/")) filePath = join16(baseDir, filePath);
|
|
6782
6905
|
filePath = urlByAbsentLocalPath?.get(filePath) ?? filePath;
|
|
6783
6906
|
}
|
|
6784
|
-
if (!isHttpUrl(filePath) && !
|
|
6907
|
+
if (!isHttpUrl(filePath) && !existsSync10(filePath)) {
|
|
6785
6908
|
return { duration: null, resolvedPath: filePath };
|
|
6786
6909
|
}
|
|
6787
6910
|
const withSrcContext = (error) => {
|
|
@@ -6922,7 +7045,8 @@ async function parseSubCompositions(html, projectDir, downloadDir, visited = /*
|
|
|
6922
7045
|
for (const el of compEls) {
|
|
6923
7046
|
const srcPath = el.getAttribute("data-composition-src");
|
|
6924
7047
|
if (!srcPath) continue;
|
|
6925
|
-
const filePath =
|
|
7048
|
+
const filePath = resolveCompositionSrc(projectDir, srcPath);
|
|
7049
|
+
if (filePath === null) continue;
|
|
6926
7050
|
if (visited.has(filePath)) {
|
|
6927
7051
|
continue;
|
|
6928
7052
|
}
|
|
@@ -6930,7 +7054,7 @@ async function parseSubCompositions(html, projectDir, downloadDir, visited = /*
|
|
|
6930
7054
|
if (read.kind !== "file") {
|
|
6931
7055
|
continue;
|
|
6932
7056
|
}
|
|
6933
|
-
const rawSubHtml = read.text;
|
|
7057
|
+
const rawSubHtml = normalizeCompositionSrcs(read.text, projectDir);
|
|
6934
7058
|
const nestedVisited = new Set(visited);
|
|
6935
7059
|
nestedVisited.add(filePath);
|
|
6936
7060
|
workItems.push({ srcPath, filePath, rawSubHtml, nestedVisited });
|
|
@@ -7118,8 +7242,9 @@ function inlineSubCompositions2(html, subCompositions, projectDir, variableOverr
|
|
|
7118
7242
|
resolveHtml: (srcPath) => {
|
|
7119
7243
|
let compHtml = subCompositions.get(srcPath) || null;
|
|
7120
7244
|
if (!compHtml) {
|
|
7121
|
-
const
|
|
7122
|
-
|
|
7245
|
+
const filePath = resolveCompositionSrc(projectDir, srcPath);
|
|
7246
|
+
const read = filePath ? readProjectFile(filePath) : null;
|
|
7247
|
+
if (read?.kind === "file") {
|
|
7123
7248
|
compHtml = rewriteUnresolvableGsapToCdn(read.text, projectDir, srcPath);
|
|
7124
7249
|
}
|
|
7125
7250
|
}
|
|
@@ -7128,7 +7253,7 @@ function inlineSubCompositions2(html, subCompositions, projectDir, variableOverr
|
|
|
7128
7253
|
parseHtml: (htmlStr) => parseHTML(htmlStr).document,
|
|
7129
7254
|
// Mirrors the preview bundler: a sub-composition's SIBLING assets resolve
|
|
7130
7255
|
// against its own directory, project-root refs stay as authored.
|
|
7131
|
-
assetExists: (path) =>
|
|
7256
|
+
assetExists: (path) => existsSync10(resolve5(projectDir, path)),
|
|
7132
7257
|
// Preserve the authored root wrapper as a child of the host, matching
|
|
7133
7258
|
// the preview bundler's shape (htmlBundler.ts's prepareFlattenedInnerRoot,
|
|
7134
7259
|
// which the runtime compositionLoader mirrors with its own copy for the
|
|
@@ -7319,7 +7444,7 @@ function collectExternalAssets(html, projectDir) {
|
|
|
7319
7444
|
if (isPathInside2(absPath, absProjectDir)) {
|
|
7320
7445
|
return null;
|
|
7321
7446
|
}
|
|
7322
|
-
if (!
|
|
7447
|
+
if (!existsSync10(absPath)) return null;
|
|
7323
7448
|
const safeKey = toExternalAssetKey(absPath);
|
|
7324
7449
|
externalAssets.set(safeKey, absPath);
|
|
7325
7450
|
return safeKey;
|
|
@@ -7369,7 +7494,7 @@ var REMOTE_SOURCE_TAG_RE = /<source\b[^>]*?\bsrc\s*=\s*["'](https?:\/\/[^"']+)["
|
|
|
7369
7494
|
var REMOTE_IMG_TAG_RE = /<img\b[^>]*?(?<![\w-])src\s*=\s*["'](https?:\/\/[^"']+)["'][^>]*>/gi;
|
|
7370
7495
|
async function downloadAndRewriteUrls(urlSet, html, remoteDir, warnLabel, logLabel, extraRewrite) {
|
|
7371
7496
|
if (urlSet.size === 0) return { html, remoteMediaAssets: /* @__PURE__ */ new Map() };
|
|
7372
|
-
if (!
|
|
7497
|
+
if (!existsSync10(remoteDir)) mkdirSync7(remoteDir, { recursive: true });
|
|
7373
7498
|
const urlToLocal = /* @__PURE__ */ new Map();
|
|
7374
7499
|
await Promise.all(
|
|
7375
7500
|
[...urlSet].map(async (url) => {
|
|
@@ -7552,13 +7677,13 @@ function projectStylesheetFontFamilies(html, projectDir) {
|
|
|
7552
7677
|
const href = /\bhref=["']([^"']+)["']/i.exec(tag)?.[1];
|
|
7553
7678
|
if (!href || /^(?:[a-z][a-z\d+.-]*:|\/\/)/i.test(href)) continue;
|
|
7554
7679
|
const sheet = resolve5(projectDir, decodedUrlPath(href).replace(/^(?:\.?\/)+/, ""));
|
|
7555
|
-
if (!isPathInside2(sheet, projectDir) || !
|
|
7680
|
+
if (!isPathInside2(sheet, projectDir) || !existsSync10(sheet)) continue;
|
|
7556
7681
|
for (const face of extractFontFaceBlocks(readFileSync5(sheet, "utf8"))) {
|
|
7557
7682
|
const family = /font-family\s*:\s*([^;}]+)/i.exec(face)?.[1]?.trim().replace(/^['"]|['"]$/g, "");
|
|
7558
7683
|
const shipsFile = [...face.matchAll(LOCAL_FONTFACE_URL_RE)].some(([, url = ""]) => {
|
|
7559
7684
|
const path = decodedUrlPath(url);
|
|
7560
7685
|
const file = path.startsWith("/") ? resolve5(projectDir, `.${path}`) : resolve5(dirname6(sheet), path);
|
|
7561
|
-
return isPathInside2(file, projectDir) &&
|
|
7686
|
+
return isPathInside2(file, projectDir) && existsSync10(file);
|
|
7562
7687
|
});
|
|
7563
7688
|
if (family && shipsFile) families.push(family);
|
|
7564
7689
|
}
|
|
@@ -7628,7 +7753,7 @@ async function readLocalFont(absPath) {
|
|
|
7628
7753
|
return { kind: "inline", buffer: Buffer.concat(chunks, totalBytes) };
|
|
7629
7754
|
}
|
|
7630
7755
|
async function embedLocalFontFaces(html, projectDir) {
|
|
7631
|
-
const { fontToDataUri: toDataUri } = await import("./deterministicFonts-
|
|
7756
|
+
const { fontToDataUri: toDataUri } = await import("./deterministicFonts-IXXU76SA.js");
|
|
7632
7757
|
const styleBlockRe = /<style\b[^>]*>([\s\S]*?)<\/style>/gi;
|
|
7633
7758
|
const fontFaceRe = /@font-face\s*\{([^}]*)\}/gi;
|
|
7634
7759
|
let result = html;
|
|
@@ -7696,7 +7821,7 @@ function renderGsapDist() {
|
|
|
7696
7821
|
}
|
|
7697
7822
|
function rewriteUnresolvableGsapToCdn(html, projectDir, compSrcPath) {
|
|
7698
7823
|
let gsapDist;
|
|
7699
|
-
const exists = (path) =>
|
|
7824
|
+
const exists = (path) => existsSync10(resolve5(projectDir, path));
|
|
7700
7825
|
return html.replace(
|
|
7701
7826
|
/(<script\b[^>]*\bsrc=["'])([^"']*gsap[^"']*\/dist\/([^"']+))(["'][^>]*>)/gi,
|
|
7702
7827
|
(full, prefix, src, file, suffix) => {
|
|
@@ -7713,7 +7838,7 @@ function rebaseDirectEntryAssetPaths(html, projectDir, htmlPath) {
|
|
|
7713
7838
|
const entryPath = relative2(projectDir, htmlPath).replace(/\\/g, "/");
|
|
7714
7839
|
if (!entryPath.includes("/")) return html;
|
|
7715
7840
|
const { document: document2 } = parseHTML(html);
|
|
7716
|
-
const assetExists = (path) =>
|
|
7841
|
+
const assetExists = (path) => existsSync10(resolve5(projectDir, path));
|
|
7717
7842
|
rewriteAssetPaths(
|
|
7718
7843
|
document2.querySelectorAll("[src], [href], [srcset]"),
|
|
7719
7844
|
entryPath,
|
|
@@ -7735,7 +7860,10 @@ function rebaseDirectEntryAssetPaths(html, projectDir, htmlPath) {
|
|
|
7735
7860
|
}
|
|
7736
7861
|
async function compileForRender(projectDir, htmlPath, downloadDir, options = {}) {
|
|
7737
7862
|
const entryHtml = rebaseDirectEntryAssetPaths(readTextFile(htmlPath), projectDir, htmlPath);
|
|
7738
|
-
const rawHtml =
|
|
7863
|
+
const rawHtml = normalizeCompositionSrcs(
|
|
7864
|
+
rewriteUnresolvableGsapToCdn(entryHtml, projectDir),
|
|
7865
|
+
projectDir
|
|
7866
|
+
);
|
|
7739
7867
|
assertSubCompositionsUsable(rawHtml, projectDir);
|
|
7740
7868
|
const probes = /* @__PURE__ */ new Map();
|
|
7741
7869
|
const { html: compiledHtml, unresolvedCompositions } = await compileHtmlFile(
|
|
@@ -8280,7 +8408,7 @@ function resolveEntryHtmlPath(input) {
|
|
|
8280
8408
|
const rawEntry = readTextFile(htmlPath);
|
|
8281
8409
|
if (entryFile === "index.html" || !isTemplateEntry(rawEntry)) return htmlPath;
|
|
8282
8410
|
const projectIndexPath = join17(projectDir, "index.html");
|
|
8283
|
-
if (!
|
|
8411
|
+
if (!existsSync11(projectIndexPath)) {
|
|
8284
8412
|
throw new Error(
|
|
8285
8413
|
`Template entry file "${entryFile}" requires a project index.html to extract its render shell.`
|
|
8286
8414
|
);
|
|
@@ -9113,7 +9241,7 @@ function validateDistributedDuration(input) {
|
|
|
9113
9241
|
}
|
|
9114
9242
|
|
|
9115
9243
|
// ../producer/src/services/render/stages/extractVideosStage.ts
|
|
9116
|
-
import { existsSync as
|
|
9244
|
+
import { existsSync as existsSync12 } from "fs";
|
|
9117
9245
|
import { join as join19 } from "path";
|
|
9118
9246
|
|
|
9119
9247
|
// ../producer/src/services/render/extractionFailureMetadata.ts
|
|
@@ -9370,7 +9498,7 @@ async function runExtractVideosStage(input) {
|
|
|
9370
9498
|
const probeFailures = await Promise.all(
|
|
9371
9499
|
composition.videos.map(async (v) => {
|
|
9372
9500
|
const videoPath = resolveProjectRelativeSrc(v.src, projectDir, compiledDir);
|
|
9373
|
-
if (!
|
|
9501
|
+
if (!existsSync12(videoPath)) return null;
|
|
9374
9502
|
try {
|
|
9375
9503
|
const attempted = extractionPolicy.maxTransientRetries === 0 ? { result: await extractMediaMetadata(videoPath), retries: 0 } : await runVideoExtractionWithRetry(() => extractMediaMetadata(videoPath), {
|
|
9376
9504
|
signal: abortSignal,
|
|
@@ -9408,7 +9536,7 @@ async function runExtractVideosStage(input) {
|
|
|
9408
9536
|
const probed = await Promise.all(
|
|
9409
9537
|
composition.images.map(async (img) => {
|
|
9410
9538
|
const imgPath = resolveProjectRelativeSrc(img.src, projectDir, compiledDir);
|
|
9411
|
-
if (!
|
|
9539
|
+
if (!existsSync12(imgPath)) return null;
|
|
9412
9540
|
const colorSpace = await probeColorSpaceSafely(imgPath, log);
|
|
9413
9541
|
if (isHdrColorSpace(colorSpace)) {
|
|
9414
9542
|
nativeHdrImageIds.add(img.id);
|
|
@@ -9528,7 +9656,7 @@ async function appendVideoAudioFromProbe(input) {
|
|
|
9528
9656
|
videos.map(async (video) => {
|
|
9529
9657
|
const path = isHttpUrl(video.src) ? video.src : resolveProjectRelativeSrc(video.src, projectDir, compiledDir);
|
|
9530
9658
|
const readFrom = urlByAbsentLocalPath?.get(path) ?? path;
|
|
9531
|
-
if (!isHttpUrl(readFrom) && !
|
|
9659
|
+
if (!isHttpUrl(readFrom) && !existsSync12(readFrom)) return null;
|
|
9532
9660
|
const metadata = await extractMediaMetadata(readFrom);
|
|
9533
9661
|
const window2 = await resolveFinalFrameExtractionWindow(
|
|
9534
9662
|
readFrom,
|
|
@@ -9548,7 +9676,7 @@ async function appendVideoAudioFromProbe(input) {
|
|
|
9548
9676
|
}
|
|
9549
9677
|
|
|
9550
9678
|
// ../producer/src/services/render/videoLayerPassthroughPlan.ts
|
|
9551
|
-
import { existsSync as
|
|
9679
|
+
import { existsSync as existsSync13 } from "fs";
|
|
9552
9680
|
var SAMPLES = 9;
|
|
9553
9681
|
function inspectVideoLayout(id, w, h, time) {
|
|
9554
9682
|
window.__hf?.seek?.(time);
|
|
@@ -9610,7 +9738,7 @@ async function planVideoLayerPassthrough(input) {
|
|
|
9610
9738
|
const { video } = q;
|
|
9611
9739
|
if (isHttpUrl(video.src)) return { reason: "remote_source" };
|
|
9612
9740
|
const path = resolveProjectRelativeSrc(video.src, input.projectDir, input.compiledDir);
|
|
9613
|
-
if (!
|
|
9741
|
+
if (!existsSync13(path)) return { reason: "source_missing" };
|
|
9614
9742
|
const layout = await probeVideoLayout(input.page, video.id, input.canvas, input.duration);
|
|
9615
9743
|
if ("reason" in layout) return layout;
|
|
9616
9744
|
const layer = await buildVideoLayerInput(
|
|
@@ -9625,11 +9753,11 @@ async function planVideoLayerPassthrough(input) {
|
|
|
9625
9753
|
}
|
|
9626
9754
|
|
|
9627
9755
|
// ../producer/src/services/render/stages/audioStage.ts
|
|
9628
|
-
import { existsSync as
|
|
9756
|
+
import { existsSync as existsSync15 } from "fs";
|
|
9629
9757
|
import { join as join22 } from "path";
|
|
9630
9758
|
|
|
9631
9759
|
// ../producer/src/services/render/audioDeliveryLimit.ts
|
|
9632
|
-
import { existsSync as
|
|
9760
|
+
import { existsSync as existsSync14 } from "fs";
|
|
9633
9761
|
import { dirname as dirname8, join as join21 } from "path";
|
|
9634
9762
|
|
|
9635
9763
|
// ../producer/src/services/render/audioPadTrim.ts
|
|
@@ -10113,7 +10241,7 @@ async function limitDeliveryPeaks(input, deps = {
|
|
|
10113
10241
|
applyChain: applyAudioFxChain,
|
|
10114
10242
|
encode: encodeAac,
|
|
10115
10243
|
rename: renameWithRetry,
|
|
10116
|
-
sourceExists:
|
|
10244
|
+
sourceExists: existsSync14
|
|
10117
10245
|
}) {
|
|
10118
10246
|
const { audioPath, sourcePath, signal, timeoutMs } = input;
|
|
10119
10247
|
if (!deps.sourceExists(sourcePath)) return { success: true };
|
|
@@ -10208,7 +10336,7 @@ async function runAudioStageScoped(input) {
|
|
|
10208
10336
|
);
|
|
10209
10337
|
audioLoweredDb = guard.loweredDb;
|
|
10210
10338
|
input.log?.info("[audio] phases", { ...result.audioPhaseMs, guard: Date.now() - guardStart });
|
|
10211
|
-
if (input.keepDeliverySource && !guard.sourceStale &&
|
|
10339
|
+
if (input.keepDeliverySource && !guard.sourceStale && existsSync15(pcmSourcePath)) {
|
|
10212
10340
|
deliverySourcePath = pcmSourcePath;
|
|
10213
10341
|
}
|
|
10214
10342
|
}
|
|
@@ -10336,7 +10464,7 @@ async function mixAudioForDelivery(input, duration, pcmSourcePath) {
|
|
|
10336
10464
|
}
|
|
10337
10465
|
|
|
10338
10466
|
// ../producer/src/services/render/stages/captureStage.ts
|
|
10339
|
-
import { existsSync as
|
|
10467
|
+
import { existsSync as existsSync16, readdirSync as readdirSync4, statfsSync as statfsSync2 } from "fs";
|
|
10340
10468
|
import { join as join23 } from "path";
|
|
10341
10469
|
function shouldAllowAdaptiveCaptureRetry(workerCount, _explicitlyConfigured) {
|
|
10342
10470
|
return workerCount > 1;
|
|
@@ -10393,7 +10521,7 @@ function diskCaptureShortfallError(needBytes, freeBytes, framesDir, basis, remed
|
|
|
10393
10521
|
}
|
|
10394
10522
|
function measureCaptureFrameBytes(workDir, framesDir) {
|
|
10395
10523
|
let total = sampleDirectoryBytes(framesDir);
|
|
10396
|
-
if (!
|
|
10524
|
+
if (!existsSync16(workDir)) return total;
|
|
10397
10525
|
for (const attempt of readdirSync4(workDir)) {
|
|
10398
10526
|
if (/^retry-\d+-batch-\d+-worker-\d+$/.test(attempt)) {
|
|
10399
10527
|
total += sampleDirectoryBytes(join23(workDir, attempt));
|
|
@@ -10578,7 +10706,11 @@ async function runSequentialDiskCapture(input, captureOptions, captureCfg, check
|
|
|
10578
10706
|
prepareCaptureSessionForReuse(session, framesDir, videoInjector);
|
|
10579
10707
|
probeSession = null;
|
|
10580
10708
|
}
|
|
10581
|
-
await ensureSessionReady(session
|
|
10709
|
+
await ensureSessionReady(session, {
|
|
10710
|
+
frameIndex: resumeFrom,
|
|
10711
|
+
totalFrames,
|
|
10712
|
+
abortSignal: input.abortSignal
|
|
10713
|
+
});
|
|
10582
10714
|
assertAttemptActive();
|
|
10583
10715
|
lastBrowserConsole = session.browserConsoleBuffer;
|
|
10584
10716
|
await captureSessionFrames(session, {
|
|
@@ -10630,13 +10762,13 @@ function planTransientResume(error, ctx) {
|
|
|
10630
10762
|
if (!firstMissing) return null;
|
|
10631
10763
|
return isTransientCaptureRetryEligible(failure.kind, missing, ctx.retriesUsed) ? firstMissing.startFrame : null;
|
|
10632
10764
|
}
|
|
10633
|
-
async function ensureSessionReady(session) {
|
|
10765
|
+
async function ensureSessionReady(session, budget) {
|
|
10634
10766
|
if (!session.isInitialized) {
|
|
10635
10767
|
await initializeSession(session);
|
|
10636
10768
|
return;
|
|
10637
10769
|
}
|
|
10638
10770
|
if (process.env.PRODUCER_EXPERIMENTAL_FAST_CAPTURE === "true") {
|
|
10639
|
-
await completeDeferredDrawElementInit(session);
|
|
10771
|
+
await createSessionInitBudget(budget)(completeDeferredDrawElementInit(session), session);
|
|
10640
10772
|
}
|
|
10641
10773
|
}
|
|
10642
10774
|
async function captureSessionFrames(session, { input, rangeStart, rangeEnd, resumeFrom, checkDiskProjection }) {
|
|
@@ -10696,7 +10828,7 @@ async function captureSessionFrames(session, { input, rangeStart, rangeEnd, resu
|
|
|
10696
10828
|
}
|
|
10697
10829
|
|
|
10698
10830
|
// ../producer/src/services/render/stages/captureHdrStage.ts
|
|
10699
|
-
import { existsSync as
|
|
10831
|
+
import { existsSync as existsSync18, mkdirSync as mkdirSync8 } from "fs";
|
|
10700
10832
|
import { join as join27 } from "path";
|
|
10701
10833
|
|
|
10702
10834
|
// ../producer/src/services/hdrImageTransferCache.ts
|
|
@@ -10919,7 +11051,7 @@ import { Worker } from "worker_threads";
|
|
|
10919
11051
|
import { fileURLToPath as fileURLToPath3, pathToFileURL } from "url";
|
|
10920
11052
|
import { dirname as dirname9, join as join25 } from "path";
|
|
10921
11053
|
import { createRequire } from "module";
|
|
10922
|
-
import { existsSync as
|
|
11054
|
+
import { existsSync as existsSync17 } from "fs";
|
|
10923
11055
|
import { cpus as cpus2 } from "os";
|
|
10924
11056
|
function resolveWorkerEntry(explicit) {
|
|
10925
11057
|
if (explicit && explicit.length > 0) {
|
|
@@ -10932,7 +11064,7 @@ function resolveWorkerEntry(explicit) {
|
|
|
10932
11064
|
}
|
|
10933
11065
|
const moduleDir = dirname9(fileURLToPath3(import.meta.url));
|
|
10934
11066
|
const jsPath = join25(moduleDir, "shaderTransitionWorker.js");
|
|
10935
|
-
if (
|
|
11067
|
+
if (existsSync17(jsPath)) return { path: jsPath, isTs: false };
|
|
10936
11068
|
const tsPath = join25(moduleDir, "shaderTransitionWorker.ts");
|
|
10937
11069
|
return { path: tsPath, isTs: true };
|
|
10938
11070
|
}
|
|
@@ -11493,7 +11625,7 @@ async function runCaptureHdrStage(input) {
|
|
|
11493
11625
|
}
|
|
11494
11626
|
const debugDumpEnabled = process.env.KEEP_TEMP === "1";
|
|
11495
11627
|
const debugDumpDir = debugDumpEnabled ? join27(framesDir, "debug-composite") : null;
|
|
11496
|
-
if (debugDumpDir && !
|
|
11628
|
+
if (debugDumpDir && !existsSync18(debugDumpDir)) {
|
|
11497
11629
|
mkdirSync8(debugDumpDir, { recursive: true });
|
|
11498
11630
|
}
|
|
11499
11631
|
const compositeTransfer = resolveCompositeTransfer(hasHdrContent, effectiveHdr);
|
|
@@ -11650,7 +11782,7 @@ async function runCaptureHdrStage(input) {
|
|
|
11650
11782
|
// ../producer/src/services/render/stages/encodeStage.ts
|
|
11651
11783
|
import {
|
|
11652
11784
|
copyFileSync as copyFileSync2,
|
|
11653
|
-
existsSync as
|
|
11785
|
+
existsSync as existsSync19,
|
|
11654
11786
|
mkdirSync as mkdirSync9,
|
|
11655
11787
|
readdirSync as readdirSync5,
|
|
11656
11788
|
readFileSync as readFileSync6,
|
|
@@ -11769,7 +11901,7 @@ async function encodeGifFromDir(framesDir, framePattern, outputPath, input) {
|
|
|
11769
11901
|
const failure = await reencodeWithClearedWholeFrames(argsInput, run, startTime);
|
|
11770
11902
|
if (failure) return failure;
|
|
11771
11903
|
}
|
|
11772
|
-
const fileSize =
|
|
11904
|
+
const fileSize = existsSync19(outputPath) ? statSync6(outputPath).size : 0;
|
|
11773
11905
|
return {
|
|
11774
11906
|
success: true,
|
|
11775
11907
|
outputPath,
|
|
@@ -11930,7 +12062,7 @@ async function runEncodeStage(input) {
|
|
|
11930
12062
|
const stage5Start = Date.now();
|
|
11931
12063
|
if (isPngSequence) {
|
|
11932
12064
|
const encoded = startEncodeProgress(job, "Writing PNG sequence", onProgress);
|
|
11933
|
-
if (!
|
|
12065
|
+
if (!existsSync19(outputPath)) mkdirSync9(outputPath, { recursive: true });
|
|
11934
12066
|
const captured = readdirSync5(framesDir).filter((name) => name.endsWith(".png")).sort();
|
|
11935
12067
|
if (captured.length === 0) {
|
|
11936
12068
|
throw new Error(
|
|
@@ -11941,7 +12073,7 @@ async function runEncodeStage(input) {
|
|
|
11941
12073
|
const dst = join28(outputPath, formatExportFrameName(i, "png"));
|
|
11942
12074
|
copyFileSync2(join28(framesDir, name), dst);
|
|
11943
12075
|
});
|
|
11944
|
-
if (hasAudio && audioOutputPath &&
|
|
12076
|
+
if (hasAudio && audioOutputPath && existsSync19(audioOutputPath)) {
|
|
11945
12077
|
copyFileSync2(audioOutputPath, join28(outputPath, MIXED_AUDIO_FILENAME));
|
|
11946
12078
|
log.info(
|
|
11947
12079
|
`[Render] png-sequence: ${MIXED_AUDIO_FILENAME} sidecar written to ${outputPath}/${MIXED_AUDIO_FILENAME}`
|
|
@@ -12329,7 +12461,7 @@ function findMissingFrameRanges(totalFrames, framesDir, frameExt) {
|
|
|
12329
12461
|
let rangeStart = null;
|
|
12330
12462
|
for (let frameIndex = 0; frameIndex < totalFrames; frameIndex++) {
|
|
12331
12463
|
const framePath = join29(framesDir, formatCaptureFrameName(frameIndex, frameExt));
|
|
12332
|
-
const missing = !
|
|
12464
|
+
const missing = !existsSync20(framePath) || statSync7(framePath).size <= 8;
|
|
12333
12465
|
if (missing && rangeStart === null) {
|
|
12334
12466
|
rangeStart = frameIndex;
|
|
12335
12467
|
} else if (!missing && rangeStart !== null) {
|
|
@@ -12454,7 +12586,7 @@ function countCapturedFrames(totalFrames, framesDir, frameExt) {
|
|
|
12454
12586
|
let captured = 0;
|
|
12455
12587
|
for (let frameIndex = 0; frameIndex < totalFrames; frameIndex++) {
|
|
12456
12588
|
const framePath = join29(framesDir, formatCaptureFrameName(frameIndex, frameExt));
|
|
12457
|
-
if (
|
|
12589
|
+
if (existsSync20(framePath)) captured++;
|
|
12458
12590
|
}
|
|
12459
12591
|
return captured;
|
|
12460
12592
|
}
|
|
@@ -13119,7 +13251,7 @@ async function executeRenderJob(job, projectDir, outputPath, progressSink, abort
|
|
|
13119
13251
|
validateDeliveryEncoderConfig(job.config);
|
|
13120
13252
|
const debugDir = resolveRenderDebugDir();
|
|
13121
13253
|
const outputDir = dirname11(outputPath);
|
|
13122
|
-
if (!
|
|
13254
|
+
if (!existsSync20(outputDir)) mkdirSync10(outputDir, { recursive: true });
|
|
13123
13255
|
const workDir = job.config.debug ? join29(debugDir, job.id) : createRenderWorkDir(resolveRenderWorkDirPrefix(outputPath, job.id), outputDir);
|
|
13124
13256
|
const pipelineStart = Date.now();
|
|
13125
13257
|
const baseLog = job.config.logger ?? defaultLogger;
|
|
@@ -13261,7 +13393,7 @@ async function executeRenderPipeline(input) {
|
|
|
13261
13393
|
job.startedAt = /* @__PURE__ */ new Date();
|
|
13262
13394
|
assertNotAborted();
|
|
13263
13395
|
assertConfiguredFfmpegBinariesExist();
|
|
13264
|
-
if (!
|
|
13396
|
+
if (!existsSync20(workDir)) mkdirSync10(workDir, { recursive: true });
|
|
13265
13397
|
if (job.config.debug) {
|
|
13266
13398
|
log.info("[Render] Debug artifacts enabled", { workDir, logPath });
|
|
13267
13399
|
}
|
|
@@ -13291,7 +13423,7 @@ async function executeRenderPipeline(input) {
|
|
|
13291
13423
|
});
|
|
13292
13424
|
const entryFile = job.config.entryFile || "index.html";
|
|
13293
13425
|
const htmlPath = join29(projectDir, entryFile);
|
|
13294
|
-
if (!
|
|
13426
|
+
if (!existsSync20(htmlPath)) {
|
|
13295
13427
|
throw new Error(`Entry file not found: ${htmlPath}`);
|
|
13296
13428
|
}
|
|
13297
13429
|
assertNotAborted();
|
|
@@ -13606,9 +13738,11 @@ async function executeRenderPipeline(input) {
|
|
|
13606
13738
|
);
|
|
13607
13739
|
pendingAudio = audioStage.catch(() => void 0);
|
|
13608
13740
|
const stage4Start = Date.now();
|
|
13609
|
-
|
|
13741
|
+
const EFFECT_SCAN_STAGE = "Checking effects";
|
|
13742
|
+
const startingFrameCapture = () => updateJobStatus(job, "rendering", "Starting frame capture", 25, onProgress, {
|
|
13610
13743
|
code: "start_browsers"
|
|
13611
13744
|
});
|
|
13745
|
+
startingFrameCapture();
|
|
13612
13746
|
if (!fileServer) {
|
|
13613
13747
|
const fileServerStart = observability.stageStart("file_server", { reused: false });
|
|
13614
13748
|
try {
|
|
@@ -13633,7 +13767,7 @@ async function executeRenderPipeline(input) {
|
|
|
13633
13767
|
throw new Error("File server failed to initialize before frame capture");
|
|
13634
13768
|
}
|
|
13635
13769
|
const framesDir = join29(workDir, "captured-frames");
|
|
13636
|
-
if (!
|
|
13770
|
+
if (!existsSync20(framesDir)) mkdirSync10(framesDir, { recursive: true });
|
|
13637
13771
|
updateJobStatus(job, "rendering", "Checking browser GPU", 25, onProgress, {
|
|
13638
13772
|
code: "start_browsers"
|
|
13639
13773
|
});
|
|
@@ -13641,6 +13775,7 @@ async function executeRenderPipeline(input) {
|
|
|
13641
13775
|
chromePath: resolveHeadlessShellPath(cfg),
|
|
13642
13776
|
browserTimeout: cfg.browserTimeout
|
|
13643
13777
|
});
|
|
13778
|
+
startingFrameCapture();
|
|
13644
13779
|
captureForceScreenshot = applyConcreteGpuScreenshotClamp(
|
|
13645
13780
|
captureForceScreenshot,
|
|
13646
13781
|
resolvedBrowserGpuMode,
|
|
@@ -13689,10 +13824,13 @@ async function executeRenderPipeline(input) {
|
|
|
13689
13824
|
onEffectScanProgress: (scanned, total) => updateJobStatus(
|
|
13690
13825
|
job,
|
|
13691
13826
|
"rendering",
|
|
13692
|
-
|
|
13827
|
+
`${EFFECT_SCAN_STAGE}, ${scanned} of ${total} frames`,
|
|
13693
13828
|
25,
|
|
13694
13829
|
onProgress
|
|
13695
13830
|
),
|
|
13831
|
+
onEffectScanEnd: () => {
|
|
13832
|
+
if (job.currentStage.startsWith(EFFECT_SCAN_STAGE)) startingFrameCapture();
|
|
13833
|
+
},
|
|
13696
13834
|
requiresWebGpu: compositionRequiresWebGpu(compiled.html),
|
|
13697
13835
|
// Live route for Chrome memory (spec §5 Phase −1). The aggregate route
|
|
13698
13836
|
// through CapturePerfSummary only exists on success; a mid-capture
|
|
@@ -13960,6 +14098,7 @@ async function executeRenderPipeline(input) {
|
|
|
13960
14098
|
} finally {
|
|
13961
14099
|
calibrationFrames?.release();
|
|
13962
14100
|
}
|
|
14101
|
+
startingFrameCapture();
|
|
13963
14102
|
captureCalibration = outcome.calibration;
|
|
13964
14103
|
calibrationEvaluateTimedOut = outcome.calibrationEvaluateTimedOut;
|
|
13965
14104
|
captureForceScreenshot = outcome.forceScreenshot;
|
|
@@ -15018,7 +15157,7 @@ async function executeRenderPipeline(input) {
|
|
|
15018
15157
|
})
|
|
15019
15158
|
);
|
|
15020
15159
|
const totalElapsed = Date.now() - pipelineStart;
|
|
15021
|
-
const tmpPeakBytes =
|
|
15160
|
+
const tmpPeakBytes = existsSync20(workDir) ? sampleDirectoryBytes(workDir) : 0;
|
|
15022
15161
|
recordTransientRetryObservability();
|
|
15023
15162
|
observability.checkpoint("pipeline", "artifact validated", { totalElapsedMs: totalElapsed });
|
|
15024
15163
|
const observabilitySummary = observability.summary({
|
|
@@ -15099,7 +15238,7 @@ async function executeRenderPipeline(input) {
|
|
|
15099
15238
|
}
|
|
15100
15239
|
}
|
|
15101
15240
|
if (job.config.debug) {
|
|
15102
|
-
if (!isPngSequence && !isHls &&
|
|
15241
|
+
if (!isPngSequence && !isHls && existsSync20(stagedOutputPath)) {
|
|
15103
15242
|
const debugOutput = join29(workDir, `output${videoExt}`);
|
|
15104
15243
|
copyFileSync3(stagedOutputPath, debugOutput);
|
|
15105
15244
|
}
|
|
@@ -15600,25 +15739,25 @@ async function writeStitchedMp4(chunkPaths, outputPath, audioPath) {
|
|
|
15600
15739
|
import {
|
|
15601
15740
|
copyFileSync as copyFileSync4,
|
|
15602
15741
|
cpSync as cpSync2,
|
|
15603
|
-
existsSync as
|
|
15742
|
+
existsSync as existsSync25,
|
|
15604
15743
|
linkSync,
|
|
15605
15744
|
mkdirSync as mkdirSync14,
|
|
15606
15745
|
rmSync as rmSync12,
|
|
15607
15746
|
writeFileSync as writeFileSync9
|
|
15608
15747
|
} from "fs";
|
|
15609
|
-
import { extname as extname6, isAbsolute as isAbsolute2, join as join38, relative as relative5, sep as
|
|
15748
|
+
import { extname as extname6, isAbsolute as isAbsolute2, join as join38, relative as relative5, sep as sep3 } from "path";
|
|
15610
15749
|
|
|
15611
15750
|
// ../producer/src/services/distributed/planFrameCost.ts
|
|
15612
15751
|
import { join as join33 } from "path";
|
|
15613
15752
|
|
|
15614
15753
|
// ../producer/src/services/distributed/chunkFrames.ts
|
|
15615
|
-
import { existsSync as
|
|
15754
|
+
import { existsSync as existsSync22, readdirSync as readdirSync7 } from "fs";
|
|
15616
15755
|
import { extname as extname4, join as join32 } from "path";
|
|
15617
15756
|
|
|
15618
15757
|
// ../producer/src/services/distributed/shared.ts
|
|
15619
15758
|
import { execFile as execFileCallback } from "child_process";
|
|
15620
15759
|
import { dirname as dirname13, join as join31 } from "path";
|
|
15621
|
-
import { existsSync as
|
|
15760
|
+
import { existsSync as existsSync21, readFileSync as readFileSync7 } from "fs";
|
|
15622
15761
|
import { fileURLToPath as fileURLToPath5 } from "url";
|
|
15623
15762
|
import { promisify as promisify2 } from "util";
|
|
15624
15763
|
var PLAN_VIDEOS_META_RELATIVE_PATH = "meta/videos.json";
|
|
@@ -15630,7 +15769,7 @@ function isPlanAudioArtifactPath(path) {
|
|
|
15630
15769
|
function resolvePlanAudioPath(planDir) {
|
|
15631
15770
|
for (const name of [PLAN_AUDIO_RELATIVE_PATH, PLAN_AUDIO_LEGACY_RELATIVE_PATH]) {
|
|
15632
15771
|
const candidate = join31(planDir, name);
|
|
15633
|
-
if (
|
|
15772
|
+
if (existsSync21(candidate)) return candidate;
|
|
15634
15773
|
}
|
|
15635
15774
|
return null;
|
|
15636
15775
|
}
|
|
@@ -15891,7 +16030,7 @@ function readProducerVersion() {
|
|
|
15891
16030
|
let current = startDir;
|
|
15892
16031
|
for (let i = 0; i < 10; i++) {
|
|
15893
16032
|
const candidate = join31(current, "package.json");
|
|
15894
|
-
if (
|
|
16033
|
+
if (existsSync21(candidate)) {
|
|
15895
16034
|
try {
|
|
15896
16035
|
const pkg = JSON.parse(readFileSync7(candidate, "utf-8"));
|
|
15897
16036
|
if (pkg.name === "@hyperframes/producer" && typeof pkg.version === "string") {
|
|
@@ -15945,7 +16084,7 @@ function rebuildExtractedFramesFromPlanDir(planDir, videos, indexMode = "dense-v
|
|
|
15945
16084
|
const result = [];
|
|
15946
16085
|
for (const v of videos) {
|
|
15947
16086
|
const outputDir = join32(planDir, "video-frames", v.videoId);
|
|
15948
|
-
if (!
|
|
16087
|
+
if (!existsSync22(outputDir)) {
|
|
15949
16088
|
throw new Error(
|
|
15950
16089
|
`[renderChunk] planDir missing extracted video frames for ${JSON.stringify(v.videoId)}: ${outputDir} not present. plan() should have written frames here; the planDir is malformed.`
|
|
15951
16090
|
);
|
|
@@ -16044,7 +16183,7 @@ async function extractDeferredVideoFramesForChunk(input) {
|
|
|
16044
16183
|
const range = planned.get(video.videoId).deferredRange;
|
|
16045
16184
|
const remoteUrl = remoteSources[range.sourcePath];
|
|
16046
16185
|
const sourcePath = remoteUrl ?? join32(input.planDir, ...range.sourcePath.split("/"));
|
|
16047
|
-
if (remoteUrl === void 0 && !
|
|
16186
|
+
if (remoteUrl === void 0 && !existsSync22(sourcePath)) {
|
|
16048
16187
|
throw new RenderChunkValidationError(
|
|
16049
16188
|
MISSING_PLAN_ARTIFACT,
|
|
16050
16189
|
`[renderChunk] planDir is missing the source for video ${JSON.stringify(video.videoId)}: ${range.sourcePath}`
|
|
@@ -16237,7 +16376,7 @@ async function readPlanReferenceBackground(input) {
|
|
|
16237
16376
|
}
|
|
16238
16377
|
|
|
16239
16378
|
// ../producer/src/services/render/stages/freezePlan.ts
|
|
16240
|
-
import { existsSync as
|
|
16379
|
+
import { existsSync as existsSync23, mkdirSync as mkdirSync12, readFileSync as readFileSync8, readdirSync as readdirSync8, writeFileSync as writeFileSync7 } from "fs";
|
|
16241
16380
|
import { join as join35, relative as relative3, resolve as resolve7 } from "path";
|
|
16242
16381
|
|
|
16243
16382
|
// ../producer/src/services/distributed/planProtocol.ts
|
|
@@ -16427,7 +16566,7 @@ function planFileSha256(absolutePath, digests) {
|
|
|
16427
16566
|
return sha256;
|
|
16428
16567
|
}
|
|
16429
16568
|
async function prehashPlanFiles(dir, digests) {
|
|
16430
|
-
if (!
|
|
16569
|
+
if (!existsSync23(dir)) return;
|
|
16431
16570
|
for (const { absolutePath } of listPlanFiles(dir)) {
|
|
16432
16571
|
if (!digests.has(absolutePath)) digests.set(absolutePath, await sha256FileAsync(absolutePath));
|
|
16433
16572
|
}
|
|
@@ -16497,15 +16636,15 @@ function writePlanRemoteFiles(planDir, files) {
|
|
|
16497
16636
|
}
|
|
16498
16637
|
function readPlanRemoteFiles(planDir) {
|
|
16499
16638
|
const path = join35(planDir, PLAN_REMOTE_FILES_RELATIVE_PATH);
|
|
16500
|
-
return
|
|
16639
|
+
return existsSync23(path) ? JSON.parse(readFileSync8(path, "utf-8")) : [];
|
|
16501
16640
|
}
|
|
16502
16641
|
function recomputePlanHashFromPlanDir(planDir, digests) {
|
|
16503
16642
|
const planJsonPath = join35(planDir, "plan.json");
|
|
16504
16643
|
const encoderJsonPath = join35(planDir, "meta", "encoder.json");
|
|
16505
|
-
if (!
|
|
16644
|
+
if (!existsSync23(planJsonPath)) {
|
|
16506
16645
|
throw new Error(`[freezePlan] plan.json missing: ${planJsonPath}`);
|
|
16507
16646
|
}
|
|
16508
|
-
if (!
|
|
16647
|
+
if (!existsSync23(encoderJsonPath)) {
|
|
16509
16648
|
throw new Error(`[freezePlan] meta/encoder.json missing: ${encoderJsonPath}`);
|
|
16510
16649
|
}
|
|
16511
16650
|
const planJson = JSON.parse(readFileSync8(planJsonPath, "utf-8"));
|
|
@@ -16535,11 +16674,11 @@ async function freezePlan(input) {
|
|
|
16535
16674
|
hasAudio,
|
|
16536
16675
|
digests
|
|
16537
16676
|
} = input;
|
|
16538
|
-
if (!
|
|
16677
|
+
if (!existsSync23(planDir)) {
|
|
16539
16678
|
throw new Error(`[freezePlan] planDir does not exist: ${planDir}`);
|
|
16540
16679
|
}
|
|
16541
16680
|
const metaDir = join35(planDir, "meta");
|
|
16542
|
-
if (!
|
|
16681
|
+
if (!existsSync23(metaDir)) mkdirSync12(metaDir, { recursive: true });
|
|
16543
16682
|
writeFileSync7(
|
|
16544
16683
|
join35(metaDir, "composition.json"),
|
|
16545
16684
|
`${JSON.stringify(composition, null, 2)}
|
|
@@ -16616,7 +16755,7 @@ function applyRuntimeEnvSnapshot(snapshot, env = process.env) {
|
|
|
16616
16755
|
}
|
|
16617
16756
|
|
|
16618
16757
|
// ../producer/src/services/distributed/chunkAudio.ts
|
|
16619
|
-
import { closeSync as closeSync5, existsSync as
|
|
16758
|
+
import { closeSync as closeSync5, existsSync as existsSync24, ftruncateSync, mkdirSync as mkdirSync13, openSync as openSync5, readFileSync as readFileSync9 } from "fs";
|
|
16620
16759
|
import { writeFileSync as writeFileSync8, writeSync } from "fs";
|
|
16621
16760
|
import { join as join36 } from "path";
|
|
16622
16761
|
function audioCutForChunk(grid, chunks, index, fps) {
|
|
@@ -16721,7 +16860,7 @@ async function writeChunkAudioSlices(input) {
|
|
|
16721
16860
|
}
|
|
16722
16861
|
function chunkAudioSource(planDir, chunkIndex, scratchPath) {
|
|
16723
16862
|
const layoutPath = join36(planDir, SLICE_LAYOUT);
|
|
16724
|
-
if (!
|
|
16863
|
+
if (!existsSync24(layoutPath)) return resolvePlanAudioPath(planDir);
|
|
16725
16864
|
const layout = JSON.parse(readFileSync9(layoutPath, "utf-8"));
|
|
16726
16865
|
const frame = readFileSync9(join36(planDir, SLICE_FRAME));
|
|
16727
16866
|
const fd = openSync5(scratchPath, "w");
|
|
@@ -17090,7 +17229,7 @@ function assertPlanSizeWithinLimit(input) {
|
|
|
17090
17229
|
});
|
|
17091
17230
|
throw new PlanTooLargeError(breakdown.totalBytes, input.limitBytes, breakdown, input.observedAt);
|
|
17092
17231
|
}
|
|
17093
|
-
function resolveChunkPlan(totalFrames, configChunkSize, maxParallelChunks, targetChunkFrames) {
|
|
17232
|
+
function resolveChunkPlan(totalFrames, configChunkSize, maxParallelChunks, targetChunkFrames, minParallelChunks = 1) {
|
|
17094
17233
|
assertPositiveInteger2("totalFrames", totalFrames);
|
|
17095
17234
|
assertPositiveInteger2("maxParallelChunks", maxParallelChunks);
|
|
17096
17235
|
if (configChunkSize !== void 0) {
|
|
@@ -17099,7 +17238,11 @@ function resolveChunkPlan(totalFrames, configChunkSize, maxParallelChunks, targe
|
|
|
17099
17238
|
if (targetChunkFrames !== void 0) {
|
|
17100
17239
|
assertPositiveInteger2("targetChunkFrames", targetChunkFrames);
|
|
17101
17240
|
}
|
|
17102
|
-
|
|
17241
|
+
assertPositiveInteger2("minParallelChunks", minParallelChunks);
|
|
17242
|
+
const autoSizeParallel = targetChunkFrames === void 0 ? maxParallelChunks : Math.min(
|
|
17243
|
+
maxParallelChunks,
|
|
17244
|
+
Math.max(minParallelChunks, Math.ceil(totalFrames / targetChunkFrames))
|
|
17245
|
+
);
|
|
17103
17246
|
const resolvedChunkSize = configChunkSize ?? Math.max(MIN_CHUNK_SIZE, Math.ceil(totalFrames / autoSizeParallel));
|
|
17104
17247
|
const naiveCount = Math.ceil(totalFrames / resolvedChunkSize);
|
|
17105
17248
|
const chunkCount = Math.min(maxParallelChunks, Math.max(1, naiveCount));
|
|
@@ -17267,7 +17410,7 @@ function pathInside(root, path) {
|
|
|
17267
17410
|
function stableSourcePath(roots, srcPath) {
|
|
17268
17411
|
for (const [root, prefix] of roots) {
|
|
17269
17412
|
const rel = pathInside(root, srcPath);
|
|
17270
|
-
if (rel !== null) return [prefix, ...rel.split(
|
|
17413
|
+
if (rel !== null) return [prefix, ...rel.split(sep3)].filter(Boolean).join("/");
|
|
17271
17414
|
}
|
|
17272
17415
|
return srcPath;
|
|
17273
17416
|
}
|
|
@@ -17281,8 +17424,8 @@ function createVideoSourceShipper(input) {
|
|
|
17281
17424
|
let result = null;
|
|
17282
17425
|
for (const root of stagedRel === null ? [input.workCompiledDir, input.projectDir] : []) {
|
|
17283
17426
|
const rel = pathInside(root, srcPath);
|
|
17284
|
-
if (rel !== null && (
|
|
17285
|
-
result = ["compiled", ...rel.split(
|
|
17427
|
+
if (rel !== null && (existsSync25(join38(input.planDir, "compiled", rel)) || input.isRemote(srcPath))) {
|
|
17428
|
+
result = ["compiled", ...rel.split(sep3)].join("/");
|
|
17286
17429
|
break;
|
|
17287
17430
|
}
|
|
17288
17431
|
}
|
|
@@ -17309,7 +17452,7 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
|
|
|
17309
17452
|
useGpu: false,
|
|
17310
17453
|
browserGpuMode: "software"
|
|
17311
17454
|
});
|
|
17312
|
-
if (!
|
|
17455
|
+
if (!existsSync25(planDir)) mkdirSync14(planDir, { recursive: true });
|
|
17313
17456
|
const log = config.logger ?? defaultLogger;
|
|
17314
17457
|
const sizeLimitBytes = options.executionPlanSizeLimitBytes ?? config.planDirSizeLimitBytes ?? PLAN_DIR_SIZE_LIMIT_BYTES;
|
|
17315
17458
|
const abortSignal = config.abortSignal;
|
|
@@ -17339,7 +17482,7 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
|
|
|
17339
17482
|
});
|
|
17340
17483
|
const entryFile = config.entryFile ?? "index.html";
|
|
17341
17484
|
const htmlPath = join38(projectDir, entryFile);
|
|
17342
|
-
if (!
|
|
17485
|
+
if (!existsSync25(htmlPath)) {
|
|
17343
17486
|
throw new Error(`[plan] entry file not found: ${htmlPath}`);
|
|
17344
17487
|
}
|
|
17345
17488
|
const workDir = join38(planDir, ".plan-work");
|
|
@@ -17354,7 +17497,7 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
|
|
|
17354
17497
|
filter: (src) => {
|
|
17355
17498
|
const rel = relative5(projectDir, src);
|
|
17356
17499
|
if (rel === "" || rel.startsWith("..")) return true;
|
|
17357
|
-
const firstSegment = rel.split(
|
|
17500
|
+
const firstSegment = rel.split(sep3, 1)[0];
|
|
17358
17501
|
return firstSegment === void 0 || !PLAN_PROJECT_DIR_SKIP_SEGMENTS.has(firstSegment);
|
|
17359
17502
|
}
|
|
17360
17503
|
});
|
|
@@ -17458,7 +17601,7 @@ async function compilePlanComposition(projectDir, config, planDir, options) {
|
|
|
17458
17601
|
if (probeResult.fileServer) closeFileServerSafely(probeResult.fileServer, "plan", log);
|
|
17459
17602
|
if (probeResult.probeSession) {
|
|
17460
17603
|
try {
|
|
17461
|
-
const { closeCaptureSession: closeCaptureSession2 } = await import("./src-
|
|
17604
|
+
const { closeCaptureSession: closeCaptureSession2 } = await import("./src-MYVZPRHS.js");
|
|
17462
17605
|
await closeCaptureSession2(probeResult.probeSession);
|
|
17463
17606
|
} catch (err) {
|
|
17464
17607
|
log.warn("[plan] probe session close failed", {
|
|
@@ -17567,15 +17710,15 @@ async function buildLocalExecutionPlan(projectDir, config, executionPlanDir, opt
|
|
|
17567
17710
|
logPlanStage(log, "extract", stageStarted);
|
|
17568
17711
|
const stagedVideoFrames = join38(compiledDir, "__hyperframes_video_frames");
|
|
17569
17712
|
const videoFramesDst = join38(planDir, "video-frames");
|
|
17570
|
-
if (
|
|
17713
|
+
if (existsSync25(videoFramesDst)) rmSync12(videoFramesDst, { recursive: true, force: true });
|
|
17571
17714
|
const videoSourcesDir = join38(planDir, "video-sources");
|
|
17572
17715
|
rmSync12(videoSourcesDir, { recursive: true, force: true });
|
|
17573
|
-
if (
|
|
17716
|
+
if (existsSync25(stagedVideoFrames)) {
|
|
17574
17717
|
renameWithRetry(stagedVideoFrames, videoFramesDst);
|
|
17575
17718
|
} else {
|
|
17576
17719
|
mkdirSync14(videoFramesDst, { recursive: true });
|
|
17577
17720
|
}
|
|
17578
|
-
if (
|
|
17721
|
+
if (existsSync25(finalCompiledDir)) rmSync12(finalCompiledDir, { recursive: true, force: true });
|
|
17579
17722
|
renameWithRetry(compiledDir, finalCompiledDir);
|
|
17580
17723
|
const shipVideoSource = createVideoSourceShipper({
|
|
17581
17724
|
planDir,
|
|
@@ -17678,7 +17821,8 @@ async function buildLocalExecutionPlan(projectDir, config, executionPlanDir, opt
|
|
|
17678
17821
|
totalFrames,
|
|
17679
17822
|
config.chunkSize,
|
|
17680
17823
|
maxParallel,
|
|
17681
|
-
config.targetChunkFrames
|
|
17824
|
+
config.targetChunkFrames,
|
|
17825
|
+
config.minParallelChunks
|
|
17682
17826
|
);
|
|
17683
17827
|
const chunks = buildPlanChunkSlices(
|
|
17684
17828
|
frameWeights,
|
|
@@ -17695,10 +17839,10 @@ async function buildLocalExecutionPlan(projectDir, config, executionPlanDir, opt
|
|
|
17695
17839
|
applyDistributedAudioWarningPolicy(job, audioResult.audioError, audioResult.audioFailures, log);
|
|
17696
17840
|
}
|
|
17697
17841
|
const planAudioPath = join38(planDir, PLAN_AUDIO_RELATIVE_PATH);
|
|
17698
|
-
if (audioResult?.hasAudio &&
|
|
17842
|
+
if (audioResult?.hasAudio && existsSync25(audioResult.audioOutputPath)) {
|
|
17699
17843
|
renameWithRetry(audioResult.audioOutputPath, planAudioPath);
|
|
17700
17844
|
}
|
|
17701
|
-
if (chunksCarryAudio &&
|
|
17845
|
+
if (chunksCarryAudio && existsSync25(planAudioPath)) {
|
|
17702
17846
|
if (options.sliceChunkAudio) {
|
|
17703
17847
|
stageStarted = Date.now();
|
|
17704
17848
|
await writeChunkAudioSlices({
|
|
@@ -17816,14 +17960,14 @@ async function plan(projectDir, config, planDir, options = {}) {
|
|
|
17816
17960
|
|
|
17817
17961
|
// ../producer/src/services/distributed/renderChunk.ts
|
|
17818
17962
|
import { randomBytes } from "crypto";
|
|
17819
|
-
import { existsSync as
|
|
17963
|
+
import { existsSync as existsSync28, mkdirSync as mkdirSync17, readFileSync as readFileSync11, readdirSync as readdirSync11, rmSync as rmSync15, writeFileSync as writeFileSync12 } from "fs";
|
|
17820
17964
|
import { cpus as cpus3 } from "os";
|
|
17821
17965
|
import { join as join42 } from "path";
|
|
17822
17966
|
|
|
17823
17967
|
// ../producer/src/services/distributed/planV2.ts
|
|
17824
17968
|
import {
|
|
17825
17969
|
copyFileSync as copyFileSync6,
|
|
17826
|
-
existsSync as
|
|
17970
|
+
existsSync as existsSync27,
|
|
17827
17971
|
lstatSync as lstatSync3,
|
|
17828
17972
|
mkdirSync as mkdirSync16,
|
|
17829
17973
|
mkdtempSync as mkdtempSync6,
|
|
@@ -17834,12 +17978,12 @@ import {
|
|
|
17834
17978
|
writeFileSync as writeFileSync11
|
|
17835
17979
|
} from "fs";
|
|
17836
17980
|
import { tmpdir as tmpdir3 } from "os";
|
|
17837
|
-
import { dirname as dirname15, isAbsolute as isAbsolute3, join as join41, relative as relative6, resolve as resolve8, sep as
|
|
17981
|
+
import { dirname as dirname15, isAbsolute as isAbsolute3, join as join41, relative as relative6, resolve as resolve8, sep as sep4 } from "path";
|
|
17838
17982
|
|
|
17839
17983
|
// ../producer/src/services/distributed/planV2Publisher.ts
|
|
17840
17984
|
import {
|
|
17841
17985
|
copyFileSync as copyFileSync5,
|
|
17842
|
-
existsSync as
|
|
17986
|
+
existsSync as existsSync26,
|
|
17843
17987
|
linkSync as linkSync2,
|
|
17844
17988
|
mkdirSync as mkdirSync15,
|
|
17845
17989
|
mkdtempSync as mkdtempSync5,
|
|
@@ -17907,7 +18051,7 @@ var LocalPlanV2ArtifactPublisher = class {
|
|
|
17907
18051
|
#linkFile;
|
|
17908
18052
|
#committed = false;
|
|
17909
18053
|
constructor(destinationDir, options = {}) {
|
|
17910
|
-
if (
|
|
18054
|
+
if (existsSync26(destinationDir)) {
|
|
17911
18055
|
throw new PlanV2IntegrityError(`output directory already exists: ${destinationDir}`);
|
|
17912
18056
|
}
|
|
17913
18057
|
this.destinationDir = destinationDir;
|
|
@@ -17924,7 +18068,7 @@ var LocalPlanV2ArtifactPublisher = class {
|
|
|
17924
18068
|
);
|
|
17925
18069
|
}
|
|
17926
18070
|
const destinationPath = planV2BlobPath(this.temporaryDir, digest);
|
|
17927
|
-
if (
|
|
18071
|
+
if (existsSync26(destinationPath)) return;
|
|
17928
18072
|
mkdirSync15(dirname14(destinationPath), { recursive: true });
|
|
17929
18073
|
const stagingDir = mkdtempSync5(join40(dirname14(destinationPath), ".plan-v2-blob-"));
|
|
17930
18074
|
const temporaryPath = join40(stagingDir, "blob");
|
|
@@ -17942,7 +18086,7 @@ var LocalPlanV2ArtifactPublisher = class {
|
|
|
17942
18086
|
}
|
|
17943
18087
|
async commitManifest(manifestBytes) {
|
|
17944
18088
|
for (const digest of new Set(manifestDigests(manifestBytes))) {
|
|
17945
|
-
if (!
|
|
18089
|
+
if (!existsSync26(planV2BlobPath(this.temporaryDir, digest))) {
|
|
17946
18090
|
throw new PlanV2IntegrityError(
|
|
17947
18091
|
`cannot commit manifest before referenced blob is durable: ${digest}`
|
|
17948
18092
|
);
|
|
@@ -17998,7 +18142,7 @@ function listFiles(root) {
|
|
|
17998
18142
|
walk(absolutePath);
|
|
17999
18143
|
} else if (entry.isFile()) {
|
|
18000
18144
|
files.push({
|
|
18001
|
-
path: relative6(rootResolved, absolutePath).split(
|
|
18145
|
+
path: relative6(rootResolved, absolutePath).split(sep4).join("/"),
|
|
18002
18146
|
absolutePath
|
|
18003
18147
|
});
|
|
18004
18148
|
} else {
|
|
@@ -18021,7 +18165,7 @@ function assertValidExtractionCacheCompleteSentinel(path) {
|
|
|
18021
18165
|
}
|
|
18022
18166
|
function validateExtractionCacheCompleteSentinels(executionPlanDir) {
|
|
18023
18167
|
const videoRoot = join41(executionPlanDir, "video-frames");
|
|
18024
|
-
if (!
|
|
18168
|
+
if (!existsSync27(videoRoot)) return;
|
|
18025
18169
|
for (const videoEntry of readdirSync10(videoRoot, { withFileTypes: true })) {
|
|
18026
18170
|
if (!videoEntry.isDirectory()) continue;
|
|
18027
18171
|
const videoDir = join41(videoRoot, videoEntry.name);
|
|
@@ -18038,7 +18182,7 @@ function isExtractionCacheCompleteSentinelPath(path) {
|
|
|
18038
18182
|
function resolveExtractedVideoOutputDir(planDir, videoId) {
|
|
18039
18183
|
const videoRoot = resolve8(planDir, "video-frames");
|
|
18040
18184
|
const outputDir = resolve8(videoRoot, videoId);
|
|
18041
|
-
if (outputDir === videoRoot || !outputDir.startsWith(`${videoRoot}${
|
|
18185
|
+
if (outputDir === videoRoot || !outputDir.startsWith(`${videoRoot}${sep4}`)) {
|
|
18042
18186
|
throw new PlanV2IntegrityError(`unsafe extracted video id: ${JSON.stringify(videoId)}`);
|
|
18043
18187
|
}
|
|
18044
18188
|
return outputDir;
|
|
@@ -18122,7 +18266,7 @@ function parsePlanVideosJson2(value) {
|
|
|
18122
18266
|
}
|
|
18123
18267
|
function materializeExtractedVideoDirectories(planDir) {
|
|
18124
18268
|
const videosPath = join41(planDir, PLAN_VIDEOS_META_RELATIVE_PATH);
|
|
18125
|
-
if (!
|
|
18269
|
+
if (!existsSync27(videosPath)) return;
|
|
18126
18270
|
const videos = parsePlanVideosJson2(readJsonFile(videosPath, PLAN_VIDEOS_META_RELATIVE_PATH));
|
|
18127
18271
|
for (const video of videos.extracted) {
|
|
18128
18272
|
mkdirSync16(resolveExtractedVideoOutputDir(planDir, video.videoId), { recursive: true });
|
|
@@ -18156,9 +18300,9 @@ function parseChunkSlices(value) {
|
|
|
18156
18300
|
}
|
|
18157
18301
|
function buildVideoChunkDependencies(executionPlanDir, dimensions) {
|
|
18158
18302
|
const videoRoot = join41(executionPlanDir, "video-frames");
|
|
18159
|
-
const hasExtractedFrames =
|
|
18303
|
+
const hasExtractedFrames = existsSync27(videoRoot) && listFiles(videoRoot).length > 0;
|
|
18160
18304
|
const videosPath = join41(executionPlanDir, PLAN_VIDEOS_META_RELATIVE_PATH);
|
|
18161
|
-
if (!
|
|
18305
|
+
if (!existsSync27(videosPath)) {
|
|
18162
18306
|
return hasExtractedFrames ? { mode: "full-source-pack", dependencies: null } : { mode: "exact-rendered-frames", dependencies: /* @__PURE__ */ new Map() };
|
|
18163
18307
|
}
|
|
18164
18308
|
const chunksPath = join41(executionPlanDir, "meta", "chunks.json");
|
|
@@ -18198,7 +18342,7 @@ function collectChunkVideoDependencies(input) {
|
|
|
18198
18342
|
for (let frame = chunk.startFrame; frame < chunk.endFrame; frame++) {
|
|
18199
18343
|
const globalTime = frame * input.fpsDen / input.fpsNum;
|
|
18200
18344
|
for (const [videoId, payload] of input.table.getActiveFramePayloads(globalTime)) {
|
|
18201
|
-
const path = input.deferredSources.get(videoId) ?? relative6(resolve8(input.executionPlanDir), payload.framePath).split(
|
|
18345
|
+
const path = input.deferredSources.get(videoId) ?? relative6(resolve8(input.executionPlanDir), payload.framePath).split(sep4).join("/");
|
|
18202
18346
|
assertSafeRelativePath(path);
|
|
18203
18347
|
const indexes = mutable.get(path) ?? /* @__PURE__ */ new Set();
|
|
18204
18348
|
indexes.add(chunk.index);
|
|
@@ -18215,7 +18359,7 @@ function computeManifestHash(manifest) {
|
|
|
18215
18359
|
return sha256Hex(`${PLAN_V2_HASH_PREFIX}${canonicalJsonStringify(manifestPayload(manifest))}`);
|
|
18216
18360
|
}
|
|
18217
18361
|
function writeBlob(sourcePath, destinationPath) {
|
|
18218
|
-
if (
|
|
18362
|
+
if (existsSync27(destinationPath)) return;
|
|
18219
18363
|
mkdirSync16(dirname15(destinationPath), { recursive: true });
|
|
18220
18364
|
const temporaryDir = mkdtempSync6(join41(dirname15(destinationPath), ".plan-v2-blob-"));
|
|
18221
18365
|
const temporaryPath = join41(temporaryDir, "blob");
|
|
@@ -18255,7 +18399,7 @@ async function putTasks(tasks) {
|
|
|
18255
18399
|
}
|
|
18256
18400
|
function buildPlanV2Publication(executionPlanDir, digests) {
|
|
18257
18401
|
const executionPlanPath = join41(executionPlanDir, "plan.json");
|
|
18258
|
-
if (!
|
|
18402
|
+
if (!existsSync27(executionPlanPath)) {
|
|
18259
18403
|
throw new PlanV2IntegrityError(`execution plan is missing plan.json: ${executionPlanPath}`);
|
|
18260
18404
|
}
|
|
18261
18405
|
const executionPlanValue = readJsonFile(executionPlanPath, "execution plan.json");
|
|
@@ -18335,7 +18479,7 @@ function buildPlanV2Publication(executionPlanDir, digests) {
|
|
|
18335
18479
|
};
|
|
18336
18480
|
}
|
|
18337
18481
|
function createPlanV2FromExecutionPlan(executionPlanDir, planV2Dir) {
|
|
18338
|
-
if (
|
|
18482
|
+
if (existsSync27(planV2Dir)) {
|
|
18339
18483
|
throw new PlanV2IntegrityError(`output directory already exists: ${planV2Dir}`);
|
|
18340
18484
|
}
|
|
18341
18485
|
const publication = buildPlanV2Publication(executionPlanDir);
|
|
@@ -18421,7 +18565,7 @@ async function planV2WithPublisher(projectDir, config, publisher, options = {})
|
|
|
18421
18565
|
}
|
|
18422
18566
|
}
|
|
18423
18567
|
async function planV2(projectDir, config, planV2Dir) {
|
|
18424
|
-
if (
|
|
18568
|
+
if (existsSync27(planV2Dir)) {
|
|
18425
18569
|
throw new PlanV2IntegrityError(`output directory already exists: ${planV2Dir}`);
|
|
18426
18570
|
}
|
|
18427
18571
|
const publisher = new LocalPlanV2ArtifactPublisher(planV2Dir);
|
|
@@ -18575,7 +18719,7 @@ function parsePlanV2Manifest(value) {
|
|
|
18575
18719
|
}
|
|
18576
18720
|
function readPlanV2Manifest(planV2Dir) {
|
|
18577
18721
|
const manifestPath = join41(planV2Dir, "plan.json");
|
|
18578
|
-
if (!
|
|
18722
|
+
if (!existsSync27(manifestPath)) {
|
|
18579
18723
|
throw new PlanV2IntegrityError(`missing v2 manifest: ${manifestPath}`);
|
|
18580
18724
|
}
|
|
18581
18725
|
const value = readJsonFile(manifestPath, "v2 manifest");
|
|
@@ -18594,7 +18738,7 @@ function listPlanV2ArtifactsForTarget(manifest, target) {
|
|
|
18594
18738
|
}
|
|
18595
18739
|
function verifyBlob(planV2Dir, artifact) {
|
|
18596
18740
|
const sourcePath = planV2BlobPath(planV2Dir, artifact.sha256);
|
|
18597
|
-
if (!
|
|
18741
|
+
if (!existsSync27(sourcePath)) {
|
|
18598
18742
|
throw new PlanV2IntegrityError(`missing content-addressed artifact ${artifact.sha256}`);
|
|
18599
18743
|
}
|
|
18600
18744
|
const stats = statSync9(sourcePath);
|
|
@@ -18607,7 +18751,7 @@ function verifyBlob(planV2Dir, artifact) {
|
|
|
18607
18751
|
return sourcePath;
|
|
18608
18752
|
}
|
|
18609
18753
|
function materializePlanV2Target(planV2Dir, target, destinationDir, options = {}) {
|
|
18610
|
-
if (
|
|
18754
|
+
if (existsSync27(destinationDir)) {
|
|
18611
18755
|
throw new PlanV2IntegrityError(`materialization destination already exists: ${destinationDir}`);
|
|
18612
18756
|
}
|
|
18613
18757
|
const manifest = readPlanV2Manifest(planV2Dir);
|
|
@@ -18672,7 +18816,7 @@ function validatePlanV2MaterializedTarget(planDir, expectedTarget) {
|
|
|
18672
18816
|
}
|
|
18673
18817
|
function readValidatedPlanV2Materialization(planDir, expectedTarget) {
|
|
18674
18818
|
const markerPath = join41(planDir, PLAN_V2_MATERIALIZATION_MARKER);
|
|
18675
|
-
if (!
|
|
18819
|
+
if (!existsSync27(markerPath)) return null;
|
|
18676
18820
|
const marker = readJsonFile(markerPath, "materialization marker");
|
|
18677
18821
|
if (!isRecord3(marker) || !isRecord3(marker.manifest) || !isRecord3(marker.target)) {
|
|
18678
18822
|
throw new PlanV2IntegrityError("malformed materialization marker");
|
|
@@ -18690,7 +18834,7 @@ function readValidatedPlanV2Materialization(planDir, expectedTarget) {
|
|
|
18690
18834
|
for (const artifact of required) {
|
|
18691
18835
|
if (Object.hasOwn(remoteSources, artifact.path)) continue;
|
|
18692
18836
|
const path = join41(planDir, ...artifact.path.split("/"));
|
|
18693
|
-
if (!
|
|
18837
|
+
if (!existsSync27(path) || statSync9(path).size !== artifact.sizeBytes) {
|
|
18694
18838
|
throw new PlanV2IntegrityError(
|
|
18695
18839
|
`materialized artifact missing or truncated: ${artifact.path}`
|
|
18696
18840
|
);
|
|
@@ -18789,13 +18933,24 @@ async function runCaptureWithScreenshotFallback(input) {
|
|
|
18789
18933
|
try {
|
|
18790
18934
|
return await input.run(input.forceScreenshot);
|
|
18791
18935
|
} catch (error) {
|
|
18792
|
-
if (input.forceScreenshot || await input.canRetry?.() === false)
|
|
18793
|
-
|
|
18936
|
+
if (input.forceScreenshot || await input.canRetry?.() === false)
|
|
18937
|
+
throw imageMissingIn(error) ?? error;
|
|
18938
|
+
if (!shouldRetryChunkCaptureWithScreenshot(error)) throw imageMissingIn(error) ?? error;
|
|
18794
18939
|
input.onFallback?.(error);
|
|
18795
18940
|
await input.resetForScreenshotRetry();
|
|
18796
|
-
return await input.run(true)
|
|
18941
|
+
return await input.run(true).catch((retryError) => {
|
|
18942
|
+
throw imageMissingIn(retryError) ?? retryError;
|
|
18943
|
+
});
|
|
18797
18944
|
}
|
|
18798
18945
|
}
|
|
18946
|
+
function imageMissingIn(error) {
|
|
18947
|
+
let e = error;
|
|
18948
|
+
for (let depth = 0; depth < 5 && typeof e === "object" && e !== null; depth++) {
|
|
18949
|
+
if (e.name === "ImageMissingFromFrameError") return e;
|
|
18950
|
+
e = e.cause;
|
|
18951
|
+
}
|
|
18952
|
+
return void 0;
|
|
18953
|
+
}
|
|
18799
18954
|
async function beginFrameSessionNeedsScreenshotFallback(session, probe = probeBeginFrameLiveness) {
|
|
18800
18955
|
if (session.launchCaptureMode !== "beginframe") return false;
|
|
18801
18956
|
const timeoutMs = Number(process.env.PRODUCER_BEGINFRAME_PROBE_TIMEOUT_MS) > 0 ? Number(process.env.PRODUCER_BEGINFRAME_PROBE_TIMEOUT_MS) : 3e4;
|
|
@@ -18829,7 +18984,7 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
|
|
|
18829
18984
|
const planJsonPath = join42(planDir, "plan.json");
|
|
18830
18985
|
const encoderJsonPath = join42(planDir, "meta", "encoder.json");
|
|
18831
18986
|
const chunksJsonPath = join42(planDir, "meta", "chunks.json");
|
|
18832
|
-
if (!
|
|
18987
|
+
if (!existsSync28(planJsonPath)) {
|
|
18833
18988
|
throw new RenderChunkValidationError(
|
|
18834
18989
|
MISSING_PLAN_ARTIFACT,
|
|
18835
18990
|
`[renderChunk] planDir is missing required artifact: ${planJsonPath}`
|
|
@@ -18845,7 +19000,7 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
|
|
|
18845
19000
|
const v2Manifest = v2Materialization?.manifest ?? null;
|
|
18846
19001
|
const remoteSources = v2Materialization?.remoteSources ?? {};
|
|
18847
19002
|
for (const required of [encoderJsonPath, chunksJsonPath]) {
|
|
18848
|
-
if (!
|
|
19003
|
+
if (!existsSync28(required)) {
|
|
18849
19004
|
throw new RenderChunkValidationError(
|
|
18850
19005
|
MISSING_PLAN_ARTIFACT,
|
|
18851
19006
|
`[renderChunk] planDir is missing required artifact: ${required}`
|
|
@@ -18856,7 +19011,7 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
|
|
|
18856
19011
|
const chunks = JSON.parse(readFileSync11(chunksJsonPath, "utf-8"));
|
|
18857
19012
|
const videosJsonPath = join42(planDir, PLAN_VIDEOS_META_RELATIVE_PATH);
|
|
18858
19013
|
let planVideos = null;
|
|
18859
|
-
if (
|
|
19014
|
+
if (existsSync28(videosJsonPath)) {
|
|
18860
19015
|
try {
|
|
18861
19016
|
planVideos = validatePlanVideosForChunk(JSON.parse(readFileSync11(videosJsonPath, "utf-8")));
|
|
18862
19017
|
} catch (err) {
|
|
@@ -18887,7 +19042,7 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
|
|
|
18887
19042
|
const range = resolveChunkFrameRange(slice, chunkIndex, options?.frameRange);
|
|
18888
19043
|
const framesInChunk = range.endFrame - range.startFrame;
|
|
18889
19044
|
const compiledDir = join42(planDir, "compiled");
|
|
18890
|
-
if (!
|
|
19045
|
+
if (!existsSync28(compiledDir)) {
|
|
18891
19046
|
throw new RenderChunkValidationError(
|
|
18892
19047
|
MISSING_PLAN_ARTIFACT,
|
|
18893
19048
|
`[renderChunk] planDir missing compiled/ directory: ${compiledDir}`
|
|
@@ -19137,10 +19292,10 @@ async function renderChunk(planDir, chunkIndex, outputChunkPath, options) {
|
|
|
19137
19292
|
const effectiveBitrate = encoder.crf != null ? void 0 : encoder.bitrate;
|
|
19138
19293
|
const videoOnlyPath = encoder.chunksCarryAudio ? `${outputChunkPath}.video.mp4` : outputChunkPath;
|
|
19139
19294
|
if (isPngSequence) {
|
|
19140
|
-
if (!
|
|
19295
|
+
if (!existsSync28(outputChunkPath)) mkdirSync17(outputChunkPath, { recursive: true });
|
|
19141
19296
|
} else {
|
|
19142
19297
|
const outDir = join42(outputChunkPath, "..");
|
|
19143
|
-
if (!
|
|
19298
|
+
if (!existsSync28(outDir)) mkdirSync17(outDir, { recursive: true });
|
|
19144
19299
|
}
|
|
19145
19300
|
const encodeInput = {
|
|
19146
19301
|
job,
|
|
@@ -19629,6 +19784,20 @@ function validateDistributedRenderConfig(config) {
|
|
|
19629
19784
|
);
|
|
19630
19785
|
}
|
|
19631
19786
|
}
|
|
19787
|
+
if (config.minParallelChunks !== void 0) {
|
|
19788
|
+
if (!Number.isInteger(config.minParallelChunks) || config.minParallelChunks < 1) {
|
|
19789
|
+
throw new InvalidConfigError(
|
|
19790
|
+
"config.minParallelChunks",
|
|
19791
|
+
`must be a positive integer; got ${config.minParallelChunks}`
|
|
19792
|
+
);
|
|
19793
|
+
}
|
|
19794
|
+
if (config.minParallelChunks > MAX_PARALLEL_CHUNKS_CEILING) {
|
|
19795
|
+
throw new InvalidConfigError(
|
|
19796
|
+
"config.minParallelChunks",
|
|
19797
|
+
`must be <= ${MAX_PARALLEL_CHUNKS_CEILING}; got ${config.minParallelChunks}`
|
|
19798
|
+
);
|
|
19799
|
+
}
|
|
19800
|
+
}
|
|
19632
19801
|
for (const field of ["workerTimeoutSeconds", "workerConcurrency"]) {
|
|
19633
19802
|
const value = config[field];
|
|
19634
19803
|
if (value !== void 0 && (!Number.isInteger(value) || value < 1)) {
|
|
@@ -19798,6 +19967,7 @@ function assertDistributedOptions(value) {
|
|
|
19798
19967
|
"chunkSize",
|
|
19799
19968
|
"maxParallelChunks",
|
|
19800
19969
|
"targetChunkFrames",
|
|
19970
|
+
"minParallelChunks",
|
|
19801
19971
|
"planDirSizeLimitBytes"
|
|
19802
19972
|
]) {
|
|
19803
19973
|
assertOptionalInteger(value, field, 1);
|
|
@@ -19937,6 +20107,7 @@ function distributedConfigFromRequest(request, runtime = {}) {
|
|
|
19937
20107
|
chunkSize: distributed.chunkSize,
|
|
19938
20108
|
maxParallelChunks: distributed.maxParallelChunks,
|
|
19939
20109
|
targetChunkFrames: distributed.targetChunkFrames,
|
|
20110
|
+
minParallelChunks: distributed.minParallelChunks,
|
|
19940
20111
|
runtimeCap: distributed.runtimeCap,
|
|
19941
20112
|
rejectOnSystemFonts: distributed.rejectOnSystemFonts,
|
|
19942
20113
|
failClosedFontFetch: distributed.failClosedFontFetch,
|
|
@@ -19964,6 +20135,7 @@ function renderRequestFromDistributedConfig(input) {
|
|
|
19964
20135
|
...optionalProperty("chunkSize", config.chunkSize),
|
|
19965
20136
|
...optionalProperty("maxParallelChunks", config.maxParallelChunks),
|
|
19966
20137
|
...optionalProperty("targetChunkFrames", config.targetChunkFrames),
|
|
20138
|
+
...optionalProperty("minParallelChunks", config.minParallelChunks),
|
|
19967
20139
|
...optionalProperty("runtimeCap", config.runtimeCap),
|
|
19968
20140
|
...optionalProperty("rejectOnSystemFonts", config.rejectOnSystemFonts),
|
|
19969
20141
|
...optionalProperty("failClosedFontFetch", config.failClosedFontFetch),
|
|
@@ -20000,7 +20172,7 @@ function renderRequestFromDistributedConfig(input) {
|
|
|
20000
20172
|
|
|
20001
20173
|
// ../producer/src/server.ts
|
|
20002
20174
|
import {
|
|
20003
|
-
existsSync as
|
|
20175
|
+
existsSync as existsSync31,
|
|
20004
20176
|
mkdirSync as mkdirSync19,
|
|
20005
20177
|
statSync as statSync11,
|
|
20006
20178
|
mkdtempSync as mkdtempSync8,
|
|
@@ -20018,7 +20190,7 @@ import { serve as serve2 } from "@hono/node-server";
|
|
|
20018
20190
|
|
|
20019
20191
|
// ../producer/src/services/hyperframeLint.ts
|
|
20020
20192
|
import {
|
|
20021
|
-
existsSync as
|
|
20193
|
+
existsSync as existsSync29,
|
|
20022
20194
|
readFileSync as readFileSync13,
|
|
20023
20195
|
statSync as statSync10,
|
|
20024
20196
|
openSync as openSync6,
|
|
@@ -20026,7 +20198,7 @@ import {
|
|
|
20026
20198
|
closeSync as closeSync6,
|
|
20027
20199
|
constants as constants3
|
|
20028
20200
|
} from "fs";
|
|
20029
|
-
import { resolve as resolve9, join as join44, relative as relative7, isAbsolute as isAbsolute4, sep as
|
|
20201
|
+
import { resolve as resolve9, join as join44, relative as relative7, isAbsolute as isAbsolute4, sep as sep5 } from "path";
|
|
20030
20202
|
function isStringRecord(value) {
|
|
20031
20203
|
if (!value || typeof value !== "object" || Array.isArray(value)) {
|
|
20032
20204
|
return false;
|
|
@@ -20071,7 +20243,7 @@ function readEntryHtml(filePath) {
|
|
|
20071
20243
|
}
|
|
20072
20244
|
function readProjectEntryFile(projectDir, preferredEntryFile) {
|
|
20073
20245
|
const absProjectDir = resolve9(projectDir);
|
|
20074
|
-
if (!
|
|
20246
|
+
if (!existsSync29(absProjectDir) || !statSync10(absProjectDir).isDirectory()) {
|
|
20075
20247
|
return { error: `Project directory not found: ${absProjectDir}` };
|
|
20076
20248
|
}
|
|
20077
20249
|
const entryCandidates = [preferredEntryFile, "index.html", "src/index.html"].filter(
|
|
@@ -20080,7 +20252,7 @@ function readProjectEntryFile(projectDir, preferredEntryFile) {
|
|
|
20080
20252
|
for (const entryFile of entryCandidates) {
|
|
20081
20253
|
const absoluteEntryPath = resolve9(absProjectDir, entryFile);
|
|
20082
20254
|
const entryRelativePath = relative7(absProjectDir, absoluteEntryPath);
|
|
20083
|
-
if (entryRelativePath === ".." || entryRelativePath.startsWith(`..${
|
|
20255
|
+
if (entryRelativePath === ".." || entryRelativePath.startsWith(`..${sep5}`) || isAbsolute4(entryRelativePath)) {
|
|
20084
20256
|
return { error: `Entry file must stay inside project directory: ${entryFile}` };
|
|
20085
20257
|
}
|
|
20086
20258
|
const html = readEntryHtml(absoluteEntryPath);
|
|
@@ -20140,7 +20312,7 @@ async function runHyperframeLint(prepared) {
|
|
|
20140
20312
|
import { Worker as Worker2 } from "worker_threads";
|
|
20141
20313
|
import { fileURLToPath as fileURLToPath6 } from "url";
|
|
20142
20314
|
import { dirname as dirname16, join as join45 } from "path";
|
|
20143
|
-
import { existsSync as
|
|
20315
|
+
import { existsSync as existsSync30 } from "fs";
|
|
20144
20316
|
var DEFAULT_HEALTH_PORT = 9848;
|
|
20145
20317
|
async function startHealthWorker(options = {}) {
|
|
20146
20318
|
const log = options.logger ?? defaultLogger2();
|
|
@@ -20217,7 +20389,7 @@ function resolveWorkerEntry2() {
|
|
|
20217
20389
|
const here = dirname16(fileURLToPath6(import.meta.url));
|
|
20218
20390
|
const candidates = [join45(here, "healthWorkerThread.js"), join45(here, "healthWorkerThread.ts")];
|
|
20219
20391
|
for (const candidate of candidates) {
|
|
20220
|
-
if (
|
|
20392
|
+
if (existsSync30(candidate)) return candidate;
|
|
20221
20393
|
}
|
|
20222
20394
|
return void 0;
|
|
20223
20395
|
}
|
|
@@ -20357,7 +20529,7 @@ function resolvePreparedRenderOutput(prepared, rendersDir, log) {
|
|
|
20357
20529
|
const { input, cleanupProjectDir } = prepared;
|
|
20358
20530
|
const absoluteOutputPath = resolveOutputPath(input.projectDir, input.outputPath, rendersDir, log);
|
|
20359
20531
|
const outputDir = dirname17(absoluteOutputPath);
|
|
20360
|
-
if (!
|
|
20532
|
+
if (!existsSync31(outputDir)) mkdirSync19(outputDir, { recursive: true });
|
|
20361
20533
|
return { input, cleanupProjectDir, absoluteOutputPath };
|
|
20362
20534
|
}
|
|
20363
20535
|
function validateRenderOverrides(body) {
|
|
@@ -20398,11 +20570,11 @@ function prepareProjectDirectory(projectDir, options) {
|
|
|
20398
20570
|
const candidate = nonEmptyString(projectDir);
|
|
20399
20571
|
if (!candidate) return null;
|
|
20400
20572
|
const absProjectDir = resolve10(candidate);
|
|
20401
|
-
if (!
|
|
20573
|
+
if (!existsSync31(absProjectDir) || !statSync11(absProjectDir).isDirectory()) {
|
|
20402
20574
|
return { error: `Project directory not found: ${absProjectDir}` };
|
|
20403
20575
|
}
|
|
20404
20576
|
const entry = options.entryFile || "index.html";
|
|
20405
|
-
if (!
|
|
20577
|
+
if (!existsSync31(resolve10(absProjectDir, entry))) {
|
|
20406
20578
|
return { error: `Entry file "${entry}" not found in project directory: ${absProjectDir}` };
|
|
20407
20579
|
}
|
|
20408
20580
|
return { prepared: { input: { projectDir: absProjectDir, ...options } } };
|
|
@@ -20494,7 +20666,7 @@ function cleanupTempDir(dir, log) {
|
|
|
20494
20666
|
}
|
|
20495
20667
|
}
|
|
20496
20668
|
function outputFileSize(path) {
|
|
20497
|
-
return
|
|
20669
|
+
return existsSync31(path) ? statSync11(path).size : 0;
|
|
20498
20670
|
}
|
|
20499
20671
|
function createBlockingProgressReporter(log, requestId) {
|
|
20500
20672
|
let lastLoggedPct = -10;
|
|
@@ -20798,7 +20970,7 @@ function createRenderHandlers(options = {}) {
|
|
|
20798
20970
|
if (!artifact) {
|
|
20799
20971
|
return c.json({ success: false, error: "Output artifact not found or expired" }, 404);
|
|
20800
20972
|
}
|
|
20801
|
-
if (!
|
|
20973
|
+
if (!existsSync31(artifact.path)) {
|
|
20802
20974
|
store.delete(token);
|
|
20803
20975
|
return c.json({ success: false, error: "Output artifact file missing" }, 404);
|
|
20804
20976
|
}
|
|
@@ -20845,7 +21017,7 @@ function startServer(options = {}) {
|
|
|
20845
21017
|
});
|
|
20846
21018
|
async function shutdown(signal) {
|
|
20847
21019
|
log.info(`Received ${signal}, shutting down`);
|
|
20848
|
-
const { drainBrowserPool } = await import("./src-
|
|
21020
|
+
const { drainBrowserPool } = await import("./src-MYVZPRHS.js");
|
|
20849
21021
|
await drainBrowserPool().catch(() => {
|
|
20850
21022
|
});
|
|
20851
21023
|
const handle = await Promise.race([
|
|
@@ -20888,7 +21060,7 @@ import { join as join48 } from "path";
|
|
|
20888
21060
|
// ../producer/src/services/distributed/assemble.ts
|
|
20889
21061
|
import {
|
|
20890
21062
|
cpSync as cpSync3,
|
|
20891
|
-
existsSync as
|
|
21063
|
+
existsSync as existsSync32,
|
|
20892
21064
|
mkdirSync as mkdirSync20,
|
|
20893
21065
|
mkdtempSync as mkdtempSync9,
|
|
20894
21066
|
readFileSync as readFileSync14,
|
|
@@ -20930,7 +21102,7 @@ async function assemble(planDir, chunkOutputs, audioPath, outputPath, options) {
|
|
|
20930
21102
|
}
|
|
20931
21103
|
const format = plan2.dimensions.format;
|
|
20932
21104
|
const cfrEncoder = cfr ? readCfrEncoder(planDir, format) : null;
|
|
20933
|
-
if (!
|
|
21105
|
+
if (!existsSync32(dirname18(outputPath))) {
|
|
20934
21106
|
mkdirSync20(dirname18(outputPath), { recursive: true });
|
|
20935
21107
|
}
|
|
20936
21108
|
const workDir = mkdtempSync9(`${outputPath}.assemble-work-`);
|
|
@@ -20954,7 +21126,7 @@ async function assemble(planDir, chunkOutputs, audioPath, outputPath, options) {
|
|
|
20954
21126
|
try {
|
|
20955
21127
|
const videoSources = cfrEncoder ? [await reencodeCfr(ctx, chunkPaths, cfrEncoder)] : chunkPaths;
|
|
20956
21128
|
const finalPath = join47(workDir, `output.${format}`);
|
|
20957
|
-
const audio = audioPath !== null &&
|
|
21129
|
+
const audio = audioPath !== null && existsSync32(audioPath) ? audioPath : null;
|
|
20958
21130
|
await writeJoined(ctx, videoSources, audio, finalPath);
|
|
20959
21131
|
renameWithRetry(finalPath, outputPath);
|
|
20960
21132
|
log.info("[assemble] stage timings", {
|
|
@@ -20972,7 +21144,7 @@ async function assemble(planDir, chunkOutputs, audioPath, outputPath, options) {
|
|
|
20972
21144
|
});
|
|
20973
21145
|
}
|
|
20974
21146
|
}
|
|
20975
|
-
const fileSize =
|
|
21147
|
+
const fileSize = existsSync32(outputPath) ? statSync12(outputPath).size : 0;
|
|
20976
21148
|
return {
|
|
20977
21149
|
...referenceBackgroundResult(plan2[REFERENCE_BACKGROUND_FIELD]),
|
|
20978
21150
|
outputPath,
|
|
@@ -20984,13 +21156,13 @@ async function assemble(planDir, chunkOutputs, audioPath, outputPath, options) {
|
|
|
20984
21156
|
function readAssemblePlan(planDir, chunkPaths) {
|
|
20985
21157
|
const planJsonPath = join47(planDir, "plan.json");
|
|
20986
21158
|
const chunksJsonPath = join47(planDir, "meta", "chunks.json");
|
|
20987
|
-
if (!
|
|
21159
|
+
if (!existsSync32(planJsonPath)) {
|
|
20988
21160
|
throw new Error(`[assemble] planDir missing plan.json: ${planJsonPath}`);
|
|
20989
21161
|
}
|
|
20990
21162
|
const plan2 = JSON.parse(readFileSync14(planJsonPath, "utf-8"));
|
|
20991
21163
|
readPlanProtocolV1(plan2, DISTRIBUTED_RENDER_CAPABILITIES.roles.assembler);
|
|
20992
21164
|
validatePlanV2MaterializedTarget(planDir, { role: "assembler" });
|
|
20993
|
-
if (!
|
|
21165
|
+
if (!existsSync32(chunksJsonPath)) {
|
|
20994
21166
|
throw new Error(`[assemble] planDir missing meta/chunks.json: ${chunksJsonPath}`);
|
|
20995
21167
|
}
|
|
20996
21168
|
const chunks = JSON.parse(readFileSync14(chunksJsonPath, "utf-8"));
|
|
@@ -21005,7 +21177,7 @@ function readAssemblePlan(planDir, chunkPaths) {
|
|
|
21005
21177
|
}
|
|
21006
21178
|
}
|
|
21007
21179
|
for (const path of chunkPaths.flat()) {
|
|
21008
|
-
if (!
|
|
21180
|
+
if (!existsSync32(path)) {
|
|
21009
21181
|
throw new Error(`[assemble] chunk path does not exist: ${path}`);
|
|
21010
21182
|
}
|
|
21011
21183
|
}
|
|
@@ -21144,7 +21316,7 @@ function planFormat(planDir) {
|
|
|
21144
21316
|
}
|
|
21145
21317
|
function lockedAudio(planDir) {
|
|
21146
21318
|
const encoderJsonPath = join47(planDir, "meta", "encoder.json");
|
|
21147
|
-
if (!
|
|
21319
|
+
if (!existsSync32(encoderJsonPath)) return {};
|
|
21148
21320
|
return JSON.parse(readFileSync14(encoderJsonPath, "utf-8"));
|
|
21149
21321
|
}
|
|
21150
21322
|
function readCfrEncoder(planDir, format) {
|
|
@@ -21154,7 +21326,7 @@ function readCfrEncoder(planDir, format) {
|
|
|
21154
21326
|
);
|
|
21155
21327
|
}
|
|
21156
21328
|
const encoderJsonPath = join47(planDir, "meta", "encoder.json");
|
|
21157
|
-
if (!
|
|
21329
|
+
if (!existsSync32(encoderJsonPath)) {
|
|
21158
21330
|
throw new Error(`[assemble] planDir missing meta/encoder.json: ${encoderJsonPath}`);
|
|
21159
21331
|
}
|
|
21160
21332
|
const encoderJson = JSON.parse(readFileSync14(encoderJsonPath, "utf-8"));
|
|
@@ -21166,7 +21338,7 @@ function readCfrEncoder(planDir, format) {
|
|
|
21166
21338
|
return encoderJson;
|
|
21167
21339
|
}
|
|
21168
21340
|
function mergePngFrameDirs(chunkPaths, outputPath, totalFrames, audioPath, startTimeMs) {
|
|
21169
|
-
if (
|
|
21341
|
+
if (existsSync32(outputPath)) rmSync18(outputPath, { recursive: true, force: true });
|
|
21170
21342
|
mkdirSync20(outputPath, { recursive: true });
|
|
21171
21343
|
let globalIdx = 0;
|
|
21172
21344
|
for (const chunkDir of chunkPaths) {
|
|
@@ -21190,7 +21362,7 @@ function mergePngFrameDirs(chunkPaths, outputPath, totalFrames, audioPath, start
|
|
|
21190
21362
|
`[assemble] png-sequence frame count mismatch: merged ${globalIdx} frames vs plan.totalFrames=${totalFrames}. Using on-disk count.`
|
|
21191
21363
|
);
|
|
21192
21364
|
}
|
|
21193
|
-
if (audioPath !== null &&
|
|
21365
|
+
if (audioPath !== null && existsSync32(audioPath)) {
|
|
21194
21366
|
const sidecar = join47(outputPath, MIXED_AUDIO_FILENAME);
|
|
21195
21367
|
cpSync3(audioPath, sidecar);
|
|
21196
21368
|
}
|