@ignix-social/editor 0.1.0
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/LICENSE +190 -0
- package/NOTICE +54 -0
- package/README.md +23 -0
- package/bin/ignix-editor.mjs +8 -0
- package/package.json +53 -0
- package/patches/index.mjs +53 -0
- package/scripts/build-ffmpeg-macos.sh +35 -0
- package/scripts/build-whisper-macos.sh +21 -0
- package/scripts/vendor.mjs +41 -0
- package/skills/ignix-editor/SKILL.md +132 -0
- package/src/audio.mjs +31 -0
- package/src/binaries.json +46 -0
- package/src/binaries.mjs +83 -0
- package/src/cli.mjs +254 -0
- package/src/prepare.mjs +74 -0
- package/src/runtime/ignix-frame.js +92 -0
- package/src/transcribe.mjs +71 -0
- package/src/validate.mjs +71 -0
- package/templates/blank/index.html +41 -0
- package/vendor/hyperframes/README.md +181 -0
- package/vendor/hyperframes/UPSTREAM.json +12 -0
- package/vendor/hyperframes/bin/hyperframes-localize-fonts.mjs +12 -0
- package/vendor/hyperframes/bin/hyperframes.mjs +11 -0
- package/vendor/hyperframes/dist/add-LR3ZR2A5.js +79 -0
- package/vendor/hyperframes/dist/agentPromptGenerator-VIIPZCJ3.js +143 -0
- package/vendor/hyperframes/dist/animatedGifPrep-P2T6YM7Z.js +34 -0
- package/vendor/hyperframes/dist/asset-BE2DOV72.js +26 -0
- package/vendor/hyperframes/dist/assetCataloger-VBLPHX24.js +340 -0
- package/vendor/hyperframes/dist/auth-RCQB2ZT7.js +60 -0
- package/vendor/hyperframes/dist/autoUpdate-RJAX3DAZ.js +268 -0
- package/vendor/hyperframes/dist/backgroundChecks-H2LCUIMJ.js +61 -0
- package/vendor/hyperframes/dist/backgroundChecksWorker.js +26 -0
- package/vendor/hyperframes/dist/batchRender-FT7AP7XH.js +355 -0
- package/vendor/hyperframes/dist/beat-analyzer.global.js +338 -0
- package/vendor/hyperframes/dist/beats-Y2EOP72P.js +309 -0
- package/vendor/hyperframes/dist/benchmark-MZ7GY3JW.js +231 -0
- package/vendor/hyperframes/dist/browser-HUTAMRQE.js +237 -0
- package/vendor/hyperframes/dist/bundleWithLocalizedFonts-5QOPOB5D.js +52 -0
- package/vendor/hyperframes/dist/capture-RLZA6EMR.js +4079 -0
- package/vendor/hyperframes/dist/capture-SZZ4IYJK.js +290 -0
- package/vendor/hyperframes/dist/captureFile-LYOJOUIE.js +15 -0
- package/vendor/hyperframes/dist/captureTimeout-PA4FYWT5.js +27 -0
- package/vendor/hyperframes/dist/catalog-KYU55EWR.js +1001 -0
- package/vendor/hyperframes/dist/check-TCG4PXLR.js +1697 -0
- package/vendor/hyperframes/dist/checkBrowser-RPMO4OW5.js +1032 -0
- package/vendor/hyperframes/dist/chunk-2EAXUCCE.js +88 -0
- package/vendor/hyperframes/dist/chunk-2EGFTPWD.js +1077 -0
- package/vendor/hyperframes/dist/chunk-2PSPARWP.js +6058 -0
- package/vendor/hyperframes/dist/chunk-2YN64IN5.js +5747 -0
- package/vendor/hyperframes/dist/chunk-3GXQPCJC.js +682 -0
- package/vendor/hyperframes/dist/chunk-3ZP5DXE7.js +15 -0
- package/vendor/hyperframes/dist/chunk-4NWOGZZS.js +1990 -0
- package/vendor/hyperframes/dist/chunk-4PFZPP2N.js +587 -0
- package/vendor/hyperframes/dist/chunk-4THIAPBL.js +128 -0
- package/vendor/hyperframes/dist/chunk-4YYJOFKS.js +28 -0
- package/vendor/hyperframes/dist/chunk-54HJ63Q2.js +29 -0
- package/vendor/hyperframes/dist/chunk-5ETJX6WM.js +89 -0
- package/vendor/hyperframes/dist/chunk-5IAKAQA7.js +389 -0
- package/vendor/hyperframes/dist/chunk-5Z63TBTX.js +37 -0
- package/vendor/hyperframes/dist/chunk-6BEFEWFB.js +25 -0
- package/vendor/hyperframes/dist/chunk-6CSYCFQV.js +68 -0
- package/vendor/hyperframes/dist/chunk-6CTIGJY7.js +154 -0
- package/vendor/hyperframes/dist/chunk-7HG4BFIN.js +93 -0
- package/vendor/hyperframes/dist/chunk-7JZ4FXP2.js +118 -0
- package/vendor/hyperframes/dist/chunk-A2Z4Z4VL.js +2961 -0
- package/vendor/hyperframes/dist/chunk-AMKC3AXA.js +25 -0
- package/vendor/hyperframes/dist/chunk-AVUUN2XD.js +4847 -0
- package/vendor/hyperframes/dist/chunk-AWDFDFI3.js +46 -0
- package/vendor/hyperframes/dist/chunk-AWNBM3MZ.js +94 -0
- package/vendor/hyperframes/dist/chunk-BXCMXMJQ.js +73 -0
- package/vendor/hyperframes/dist/chunk-BZ56MTDX.js +6 -0
- package/vendor/hyperframes/dist/chunk-CFKU7HTK.js +171 -0
- package/vendor/hyperframes/dist/chunk-CWPVM2QV.js +308 -0
- package/vendor/hyperframes/dist/chunk-DPVXBVLL.js +31292 -0
- package/vendor/hyperframes/dist/chunk-DQBY7FRR.js +397 -0
- package/vendor/hyperframes/dist/chunk-E6RPWJVC.js +213 -0
- package/vendor/hyperframes/dist/chunk-EISRN4E6.js +294 -0
- package/vendor/hyperframes/dist/chunk-EOVYQ3IG.js +143 -0
- package/vendor/hyperframes/dist/chunk-F3WZGU7C.js +479 -0
- package/vendor/hyperframes/dist/chunk-FCSIGXXP.js +366 -0
- package/vendor/hyperframes/dist/chunk-FI4I7CME.js +56 -0
- package/vendor/hyperframes/dist/chunk-FLWXXDNS.js +15 -0
- package/vendor/hyperframes/dist/chunk-GK4AIFIH.js +11171 -0
- package/vendor/hyperframes/dist/chunk-GMECXFAN.js +57 -0
- package/vendor/hyperframes/dist/chunk-GULOKZLI.js +155 -0
- package/vendor/hyperframes/dist/chunk-H4YZZ2VQ.js +68 -0
- package/vendor/hyperframes/dist/chunk-H6QMKUYA.js +477 -0
- package/vendor/hyperframes/dist/chunk-HBBJFK6I.js +273 -0
- package/vendor/hyperframes/dist/chunk-HRUGC23L.js +212 -0
- package/vendor/hyperframes/dist/chunk-HVW7ABXD.js +19 -0
- package/vendor/hyperframes/dist/chunk-HW6OYASV.js +344 -0
- package/vendor/hyperframes/dist/chunk-HWKCIWQT.js +3578 -0
- package/vendor/hyperframes/dist/chunk-I465DBM6.js +1214 -0
- package/vendor/hyperframes/dist/chunk-IGLEPPTN.js +24 -0
- package/vendor/hyperframes/dist/chunk-IGNAAHS3.js +433 -0
- package/vendor/hyperframes/dist/chunk-IHFUKJOR.js +85 -0
- package/vendor/hyperframes/dist/chunk-IQ3OUQ5Z.js +213 -0
- package/vendor/hyperframes/dist/chunk-ISN5GRYI.js +20 -0
- package/vendor/hyperframes/dist/chunk-IUZFXWSV.js +446 -0
- package/vendor/hyperframes/dist/chunk-JH556Q42.js +647 -0
- package/vendor/hyperframes/dist/chunk-JTHMTOMQ.js +601 -0
- package/vendor/hyperframes/dist/chunk-K2EQN4VU.js +405 -0
- package/vendor/hyperframes/dist/chunk-K2FTXJYH.js +16044 -0
- package/vendor/hyperframes/dist/chunk-K4WIOZFP.js +32 -0
- package/vendor/hyperframes/dist/chunk-K4WKGXRC.js +18 -0
- package/vendor/hyperframes/dist/chunk-KBJUXVOJ.js +172 -0
- package/vendor/hyperframes/dist/chunk-KC5XXX3X.js +590 -0
- package/vendor/hyperframes/dist/chunk-KNU5COPB.js +29 -0
- package/vendor/hyperframes/dist/chunk-KZI44OPA.js +185 -0
- package/vendor/hyperframes/dist/chunk-L3YOGIPG.js +48 -0
- package/vendor/hyperframes/dist/chunk-LAOCA3MQ.js +189 -0
- package/vendor/hyperframes/dist/chunk-LCSMOLGX.js +312 -0
- package/vendor/hyperframes/dist/chunk-LFGJWOVA.js +61 -0
- package/vendor/hyperframes/dist/chunk-LHSR3M4M.js +498 -0
- package/vendor/hyperframes/dist/chunk-LYNI3FOL.js +123 -0
- package/vendor/hyperframes/dist/chunk-M2WBOQ2Q.js +54 -0
- package/vendor/hyperframes/dist/chunk-MRF4AMKD.js +104 -0
- package/vendor/hyperframes/dist/chunk-MWB3ZIFM.js +852 -0
- package/vendor/hyperframes/dist/chunk-NGKM64BP.js +39 -0
- package/vendor/hyperframes/dist/chunk-NXMYHJAL.js +43 -0
- package/vendor/hyperframes/dist/chunk-OAF4XJOW.js +192 -0
- package/vendor/hyperframes/dist/chunk-OFQWTKPW.js +117 -0
- package/vendor/hyperframes/dist/chunk-P6LJ4Y32.js +4662 -0
- package/vendor/hyperframes/dist/chunk-PBN6GBJE.js +108 -0
- package/vendor/hyperframes/dist/chunk-PDAMK4Q5.js +28 -0
- package/vendor/hyperframes/dist/chunk-PFCFR3KZ.js +20 -0
- package/vendor/hyperframes/dist/chunk-PJ3HDUCY.js +108 -0
- package/vendor/hyperframes/dist/chunk-PMRBLBUP.js +152 -0
- package/vendor/hyperframes/dist/chunk-PPQUYWTW.js +240 -0
- package/vendor/hyperframes/dist/chunk-Q5X2B5WT.js +29 -0
- package/vendor/hyperframes/dist/chunk-Q7IU7MOR.js +351 -0
- package/vendor/hyperframes/dist/chunk-QC4FJVLM.js +371 -0
- package/vendor/hyperframes/dist/chunk-QNYYOUU3.js +1318 -0
- package/vendor/hyperframes/dist/chunk-RDNNAKEP.js +161 -0
- package/vendor/hyperframes/dist/chunk-RMHUQGRK.js +657 -0
- package/vendor/hyperframes/dist/chunk-RQVDTPGD.js +6 -0
- package/vendor/hyperframes/dist/chunk-RVCWIIZ7.js +68 -0
- package/vendor/hyperframes/dist/chunk-S3D6GE5W.js +72 -0
- package/vendor/hyperframes/dist/chunk-S3S4TGEH.js +424 -0
- package/vendor/hyperframes/dist/chunk-S7NPLFWV.js +11395 -0
- package/vendor/hyperframes/dist/chunk-SHB5VDMH.js +51 -0
- package/vendor/hyperframes/dist/chunk-TCLGPL65.js +860 -0
- package/vendor/hyperframes/dist/chunk-THXFSPLV.js +40 -0
- package/vendor/hyperframes/dist/chunk-TJSTGSAW.js +354 -0
- package/vendor/hyperframes/dist/chunk-TQFG7HTI.js +1024 -0
- package/vendor/hyperframes/dist/chunk-TVCRUG2S.js +265 -0
- package/vendor/hyperframes/dist/chunk-TWWSYAKJ.js +24 -0
- package/vendor/hyperframes/dist/chunk-U7CZBDMV.js +27 -0
- package/vendor/hyperframes/dist/chunk-UEZXMWG3.js +139 -0
- package/vendor/hyperframes/dist/chunk-UYEZTK4U.js +61 -0
- package/vendor/hyperframes/dist/chunk-VC76R6W2.js +27 -0
- package/vendor/hyperframes/dist/chunk-VFCKXTBB.js +159 -0
- package/vendor/hyperframes/dist/chunk-VWG7OQKU.js +22 -0
- package/vendor/hyperframes/dist/chunk-VXVRPIJA.js +105 -0
- package/vendor/hyperframes/dist/chunk-WBLXWOYK.js +15 -0
- package/vendor/hyperframes/dist/chunk-WERLJGIC.js +20 -0
- package/vendor/hyperframes/dist/chunk-WMQNIQDJ.js +2057 -0
- package/vendor/hyperframes/dist/chunk-WPHMNO44.js +4528 -0
- package/vendor/hyperframes/dist/chunk-X5HWXQPU.js +113 -0
- package/vendor/hyperframes/dist/chunk-X7MTZ4T2.js +6 -0
- package/vendor/hyperframes/dist/chunk-XH4DSOS5.js +59 -0
- package/vendor/hyperframes/dist/chunk-XS4EJSKU.js +23 -0
- package/vendor/hyperframes/dist/chunk-XT5P4QMO.js +181 -0
- package/vendor/hyperframes/dist/chunk-XT7X6QCP.js +6 -0
- package/vendor/hyperframes/dist/chunk-XUHOIDKG.js +6 -0
- package/vendor/hyperframes/dist/chunk-XUXGIA7H.js +485 -0
- package/vendor/hyperframes/dist/chunk-XZABUQTX.js +113 -0
- package/vendor/hyperframes/dist/chunk-Y6W4DVPS.js +356 -0
- package/vendor/hyperframes/dist/chunk-YEIFI443.js +44 -0
- package/vendor/hyperframes/dist/chunk-YQZNILVH.js +375 -0
- package/vendor/hyperframes/dist/chunk-Z27A7NUB.js +65 -0
- package/vendor/hyperframes/dist/chunk-Z6B37SNM.js +3081 -0
- package/vendor/hyperframes/dist/chunk-ZJUKFZ2P.js +10954 -0
- package/vendor/hyperframes/dist/chunk-ZKDMAOFU.js +32 -0
- package/vendor/hyperframes/dist/chunk-ZMXUQLI2.js +17219 -0
- package/vendor/hyperframes/dist/chunk-ZTZ7NCJT.js +58 -0
- package/vendor/hyperframes/dist/chunk-ZTZA4UWZ.js +108 -0
- package/vendor/hyperframes/dist/clean-W57E5YQ3.js +293 -0
- package/vendor/hyperframes/dist/cli.js +495 -0
- package/vendor/hyperframes/dist/cloud-FFTJGZ24.js +70 -0
- package/vendor/hyperframes/dist/cloudrun-AJUTHUEA.js +763 -0
- package/vendor/hyperframes/dist/colors-HKWSZCGK.js +15 -0
- package/vendor/hyperframes/dist/commands/contrast-audit.browser.js +459 -0
- package/vendor/hyperframes/dist/commands/layout-audit.browser.js +2102 -0
- package/vendor/hyperframes/dist/commands/motion-sample.browser.js +74 -0
- package/vendor/hyperframes/dist/commands/motion-signature.browser.js +374 -0
- package/vendor/hyperframes/dist/compare-AYCTT55F.js +421 -0
- package/vendor/hyperframes/dist/compiler-QO36EXLS.js +121 -0
- package/vendor/hyperframes/dist/component-VFFR2O7T.js +176 -0
- package/vendor/hyperframes/dist/compositions-QTVN3U2A.js +228 -0
- package/vendor/hyperframes/dist/contactSheet-27SRU7A4.js +22 -0
- package/vendor/hyperframes/dist/delete-ZAKYCB7I.js +114 -0
- package/vendor/hyperframes/dist/deploy-MX76RZ36.js +101 -0
- package/vendor/hyperframes/dist/destroy-H2TZBYHH.js +42 -0
- package/vendor/hyperframes/dist/deterministicFonts-HAEMV4TM.js +50 -0
- package/vendor/hyperframes/dist/dist-EWXJGN63.js +129 -0
- package/vendor/hyperframes/dist/dist-FNNGCKFS.js +29 -0
- package/vendor/hyperframes/dist/dist-S3PJNPXQ.js +392 -0
- package/vendor/hyperframes/dist/docker/Dockerfile.render +65 -0
- package/vendor/hyperframes/dist/docs/compositions.md +67 -0
- package/vendor/hyperframes/dist/docs/data-attributes.md +27 -0
- package/vendor/hyperframes/dist/docs/examples.md +19 -0
- package/vendor/hyperframes/dist/docs/gsap.md +26 -0
- package/vendor/hyperframes/dist/docs/rendering.md +35 -0
- package/vendor/hyperframes/dist/docs/troubleshooting.md +29 -0
- package/vendor/hyperframes/dist/docs-QAPJEGLS.js +131 -0
- package/vendor/hyperframes/dist/doctor-AI7C3FON.js +67 -0
- package/vendor/hyperframes/dist/dom-IROKGVJI.js +14 -0
- package/vendor/hyperframes/dist/dotEnv-AECLXQSO.js +14 -0
- package/vendor/hyperframes/dist/events-7LALYNKZ.js +92 -0
- package/vendor/hyperframes/dist/events-FQY3HGKZ.js +88 -0
- package/vendor/hyperframes/dist/feedback-WCMDMSTK.js +472 -0
- package/vendor/hyperframes/dist/ffmpeg-QIUFEFTY.js +35 -0
- package/vendor/hyperframes/dist/figma-64WY462P.js +63 -0
- package/vendor/hyperframes/dist/fontData.generated-NXAOI4GH.js +13 -0
- package/vendor/hyperframes/dist/fontLocalizeCli.js +132 -0
- package/vendor/hyperframes/dist/get-FPOMJMZB.js +103 -0
- package/vendor/hyperframes/dist/gpuPolicy-2ZUZE5D6.js +38 -0
- package/vendor/hyperframes/dist/grade-compare-E2CKPST4.js +647 -0
- package/vendor/hyperframes/dist/gsapParser-DIYYX6JT.js +2846 -0
- package/vendor/hyperframes/dist/gsapParserAcorn-E3GEIRZB.js +28 -0
- package/vendor/hyperframes/dist/help-YRQIDDML.js +197 -0
- package/vendor/hyperframes/dist/history-PP5NDRV3.js +571 -0
- package/vendor/hyperframes/dist/hyperframe-runtime.js +1081 -0
- package/vendor/hyperframes/dist/hyperframe.manifest.json +22 -0
- package/vendor/hyperframes/dist/hyperframe.runtime.iife.js +1081 -0
- package/vendor/hyperframes/dist/hyperframes-player.global.js +474 -0
- package/vendor/hyperframes/dist/hyperframes-slideshow.global.js +149 -0
- package/vendor/hyperframes/dist/info-SEX3B7JL.js +153 -0
- package/vendor/hyperframes/dist/init-U3AKHO5B.js +1147 -0
- package/vendor/hyperframes/dist/inspect-Q3K6EDEK.js +97 -0
- package/vendor/hyperframes/dist/installer-K6O5WF44.js +37 -0
- package/vendor/hyperframes/dist/keyframes-DC64JCI3.js +2602 -0
- package/vendor/hyperframes/dist/lambda-D7UMN4DJ.js +451 -0
- package/vendor/hyperframes/dist/layout-XSPPDHOO.js +86 -0
- package/vendor/hyperframes/dist/lib-TPG2ZMAX.js +128 -0
- package/vendor/hyperframes/dist/lint-7DQZE7L3.js +164 -0
- package/vendor/hyperframes/dist/lintProject-OHBBM3DJ.js +27 -0
- package/vendor/hyperframes/dist/list-4K5MVDQX.js +162 -0
- package/vendor/hyperframes/dist/login-NTX4OWXL.js +377 -0
- package/vendor/hyperframes/dist/logout-Q654A3SI.js +100 -0
- package/vendor/hyperframes/dist/manager-67P2XFXQ.js +34 -0
- package/vendor/hyperframes/dist/manager-CT3D67CG.js +38 -0
- package/vendor/hyperframes/dist/manager-GFN75DM4.js +30 -0
- package/vendor/hyperframes/dist/media-treatment-5FYAOPNL.js +972 -0
- package/vendor/hyperframes/dist/media-use-4XXGABIL.js +113 -0
- package/vendor/hyperframes/dist/models-C4E4IWJD.js +137 -0
- package/vendor/hyperframes/dist/motionShot-S4MIGMT5.js +614 -0
- package/vendor/hyperframes/dist/normalize-O76AC4HE.js +333 -0
- package/vendor/hyperframes/dist/normalize-audio-CSFTXLXD.js +276 -0
- package/vendor/hyperframes/dist/open-2ZD6BHZG.js +115 -0
- package/vendor/hyperframes/dist/pipeline-TNGWUZQC.js +54 -0
- package/vendor/hyperframes/dist/play-CTMUXX6E.js +349 -0
- package/vendor/hyperframes/dist/policies-FSDZVS2E.js +292 -0
- package/vendor/hyperframes/dist/preflight-SMNV6RW2.js +45 -0
- package/vendor/hyperframes/dist/present-WQVHV5CR.js +350 -0
- package/vendor/hyperframes/dist/preview-JOJXTH75.js +1820 -0
- package/vendor/hyperframes/dist/producer-ECLEN5RP.js +13 -0
- package/vendor/hyperframes/dist/progress-FBIEEB7Y.js +73 -0
- package/vendor/hyperframes/dist/projectConfig-HYJMJ5BY.js +56 -0
- package/vendor/hyperframes/dist/publication-HQ5Y3KBM.js +29 -0
- package/vendor/hyperframes/dist/publish-VHDYQASC.js +430 -0
- package/vendor/hyperframes/dist/refresh-K24ETHMA.js +53 -0
- package/vendor/hyperframes/dist/remove-background-W2YX2NVH.js +253 -0
- package/vendor/hyperframes/dist/render-AO5VX3YI.js +177 -0
- package/vendor/hyperframes/dist/render-LNO62LEL.js +2367 -0
- package/vendor/hyperframes/dist/render-TTQI7TGN.js +796 -0
- package/vendor/hyperframes/dist/render-batch-YH7CTWNY.js +284 -0
- package/vendor/hyperframes/dist/renderCancellation-JPIHE47X.js +35 -0
- package/vendor/hyperframes/dist/renderSetupWorker.js +79 -0
- package/vendor/hyperframes/dist/resolver-IZ647GBZ.js +38 -0
- package/vendor/hyperframes/dist/runtimeVersion.js +18 -0
- package/vendor/hyperframes/dist/screenshotCapture-ECBTLCU6.js +179 -0
- package/vendor/hyperframes/dist/shaderTransitionWorker.js +44 -0
- package/vendor/hyperframes/dist/sherpa-KKLNW6U2.js +314 -0
- package/vendor/hyperframes/dist/sherpaWorker.js +77 -0
- package/vendor/hyperframes/dist/sites-TNVKZS73.js +52 -0
- package/vendor/hyperframes/dist/skill-ZHVLH7KX.js +15 -0
- package/vendor/hyperframes/dist/skills/hyperframes/SKILL.md +152 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/brief-contract.md +108 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/brief-format.md +72 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/capability-menu.md +47 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/frame-worker-core.md +80 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/intent-interview.md +73 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/pitch-round.md +40 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/plugin-installation.md +43 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/production-loop.md +26 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/review-loop.md +37 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/route-briefs.md +11 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/routes/embedded-captions.md +11 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/routes/faceless-explainer.md +12 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/routes/general-video.md +12 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/routes/motion-graphics.md +11 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/routes/music-to-video.md +12 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/routes/pr-to-video.md +28 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/routes/product-launch-video.md +13 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/routes/remotion-to-hyperframes.md +9 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/routes/slideshow.md +11 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/routes/talking-head-recut.md +11 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/script-format.md +52 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/skill-lifecycle.md +35 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/storyboard-format.md +99 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/subagent-dispatch.md +35 -0
- package/vendor/hyperframes/dist/skills/hyperframes/references/workflow-catalog.md +10 -0
- package/vendor/hyperframes/dist/skills/hyperframes/scripts/lib/frame-packets-core.mjs +194 -0
- package/vendor/hyperframes/dist/skills/hyperframes/scripts/plugin-cli.mjs +88 -0
- package/vendor/hyperframes/dist/skills/hyperframes/scripts/plugin-cli.test.mjs +117 -0
- package/vendor/hyperframes/dist/skills/hyperframes-cli/SKILL.md +189 -0
- package/vendor/hyperframes/dist/skills/hyperframes-cli/references/beats.md +19 -0
- package/vendor/hyperframes/dist/skills/hyperframes-cli/references/cloud.md +163 -0
- package/vendor/hyperframes/dist/skills/hyperframes-cli/references/cloudrun.md +62 -0
- package/vendor/hyperframes/dist/skills/hyperframes-cli/references/compare-and-batch.md +105 -0
- package/vendor/hyperframes/dist/skills/hyperframes-cli/references/doctor-browser.md +57 -0
- package/vendor/hyperframes/dist/skills/hyperframes-cli/references/init-and-scaffold.md +74 -0
- package/vendor/hyperframes/dist/skills/hyperframes-cli/references/lambda.md +185 -0
- package/vendor/hyperframes/dist/skills/hyperframes-cli/references/lint-validate-inspect.md +132 -0
- package/vendor/hyperframes/dist/skills/hyperframes-cli/references/preview-render.md +193 -0
- package/vendor/hyperframes/dist/skills/hyperframes-cli/references/upgrade-info-misc.md +134 -0
- package/vendor/hyperframes/dist/skills/media-use/SKILL.md +100 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/CREDITS.md +35 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/chime.mp3 +0 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/click-soft.mp3 +0 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/click.mp3 +0 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/error.mp3 +0 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/glitch-1.mp3 +0 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/glitch-2.mp3 +0 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/glitch-3.mp3 +0 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/impact-bass-1.mp3 +0 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/impact-bass-2.mp3 +0 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/key-press.mp3 +0 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/manifest.json +97 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/notification.mp3 +0 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/ping.mp3 +0 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/pop.mp3 +0 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/riser.mp3 +0 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/sparkle.mp3 +0 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/typing.mp3 +0 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/whoosh-cinematic.mp3 +0 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/whoosh-short.mp3 +0 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/whoosh.mp3 +0 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/references/bgm.md +76 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/references/captions/authoring.md +163 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/references/captions/motion.md +87 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/references/captions/transcript-handling.md +97 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/references/remove-background.md +143 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/references/requirements.md +29 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/references/sfx.md +42 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/references/transcribe.md +52 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/references/tts-to-captions.md +35 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/references/tts.md +260 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/audio.mjs +311 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/audio.test.mjs +159 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/gemini-pipeline.test.mjs +131 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/heygen-tts.mjs +122 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/heygen-tts.test.mjs +38 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/heygen-voice.mjs +98 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/heygen-voice.test.mjs +233 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/audio-meta.mjs +39 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/audio-meta.test.mjs +136 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/bgm-volume.mjs +4 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/bgm.mjs +257 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/bgm.test.mjs +74 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/concurrency.mjs +14 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/concurrency.test.mjs +41 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/gemini-auth.mjs +43 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/gemini-auth.py +52 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/gemini-auth.test.mjs +86 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/gemini-auth_test.py +90 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/gemini-tts.mjs +122 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/gemini-tts.test.mjs +243 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/heygen.mjs +197 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/heygen.test.mjs +185 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/media-record.mjs +114 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/media-record.test.mjs +205 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/python.mjs +77 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/python.test.mjs +136 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/sfx.mjs +165 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/sfx.test.mjs +121 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/tts.mjs +389 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/tts.spawn.test.mjs +158 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/tts.test.mjs +230 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lyria-recipe.py +136 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/wait-bgm.mjs +175 -0
- package/vendor/hyperframes/dist/skills/media-use/audio/scripts/wait-bgm.test.mjs +108 -0
- package/vendor/hyperframes/dist/skills/media-use/luts/README.md +28 -0
- package/vendor/hyperframes/dist/skills/media-use/luts/index.json +57 -0
- package/vendor/hyperframes/dist/skills/media-use/references/audio.md +20 -0
- package/vendor/hyperframes/dist/skills/media-use/references/grading.md +160 -0
- package/vendor/hyperframes/dist/skills/media-use/references/media-treatment-recipes.md +929 -0
- package/vendor/hyperframes/dist/skills/media-use/references/media-treatments.md +202 -0
- package/vendor/hyperframes/dist/skills/media-use/references/memory.md +37 -0
- package/vendor/hyperframes/dist/skills/media-use/references/meta.md +61 -0
- package/vendor/hyperframes/dist/skills/media-use/references/operations.md +327 -0
- package/vendor/hyperframes/dist/skills/media-use/references/resolve.md +150 -0
- package/vendor/hyperframes/dist/skills/media-use/references/setup-providers.md +80 -0
- package/vendor/hyperframes/dist/skills/media-use/references/telemetry-dashboard.md +49 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/audio-duck.mjs +113 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/compatibility.test.mjs +96 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/dither.mjs +328 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/dither.test.mjs +176 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/eval.mjs +369 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/adopt.mjs +128 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/adopt.test.mjs +95 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/bgm-provider.mjs +20 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/brand-provider.mjs +59 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/bundled-sfx-provider.mjs +119 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/bundled-sfx-provider.test.mjs +139 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/cache.mjs +148 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/candidates.mjs +91 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/candidates.test.mjs +155 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/codex-provider.mjs +161 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/codex-provider.test.mjs +34 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/config-lock.d.mts +3 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/config-lock.mjs +45 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/config-lock.test.mjs +79 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/coverage.test.mjs +136 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/cube-build.mjs +181 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/cube-build.test.mjs +80 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/cube-validate.mjs +198 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/cube-validate.test.mjs +125 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/cutlist.mjs +184 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/cutlist.test.mjs +162 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/duck.mjs +95 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/duck.test.mjs +153 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/error-diffusion.mjs +230 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/error-diffusion.test.mjs +102 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/ff-binaries.mjs +37 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/freeze.mjs +72 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/freeze.test.mjs +138 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/grade-analyzer.mjs +265 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/grade-analyzer.test.mjs +285 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/heygen-cli.mjs +191 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/heygen-cli.test.mjs +301 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/heygen-search.mjs +45 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/heygen-search.test.mjs +49 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/heygen-video-provider.mjs +138 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/heygen-video-provider.test.mjs +435 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/image-provider.mjs +44 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/index-gen.mjs +63 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/local-media-search.mjs +32 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/local-models.mjs +318 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/local-models.test.mjs +220 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/local-run.mjs +78 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/local-run.test.mjs +121 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/logo-provider.mjs +244 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/logo-provider.test.mjs +298 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/ltx-video-provider.mjs +94 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/ltx-video-provider.test.mjs +316 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/lut-preset-provider.mjs +271 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/lut-preset-provider.test.mjs +199 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/manifest.d.mts +19 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/manifest.mjs +279 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/manifest.test.mjs +397 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/match.mjs +47 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/media-fetch.mjs +85 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/media-fetch.test.mjs +197 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/media-home.mjs +20 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/media-home.test.mjs +61 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/media-search.d.mts +9 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/media-search.mjs +107 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/mflux-provider.mjs +128 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/mflux-provider.test.mjs +174 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/misses.mjs +49 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/misses.test.mjs +89 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/npx-sync.mjs +31 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/npx-sync.test.mjs +50 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/parakeet-words.mjs +27 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/parakeet-words.test.mjs +44 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/prefs-store.mjs +180 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/prefs-store.test.mjs +189 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/probe.mjs +41 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/probe.test.mjs +148 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/providers.mjs +5 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/recipe-store.mjs +367 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/recipe-store.test.mjs +367 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/registry.mjs +212 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/registry.test.mjs +262 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/search.mjs +24 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/search.test.mjs +32 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/sfx-provider.mjs +23 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/specs.mjs +132 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/specs.test.mjs +157 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/stats.mjs +117 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/stats.test.mjs +165 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/svg-sanitize.mjs +21 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/telemetry.mjs +210 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/telemetry.test.mjs +437 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/test-home.test.mjs +10 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/transcriptCutFade.mjs +21 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/transcriptCutFade.test.mjs +33 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/tts-local-provider.mjs +94 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/tts-local-provider.test.mjs +72 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/usage.mjs +57 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/usage.test.mjs +54 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/voice-provider.mjs +57 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/voice-provider.test.mjs +46 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/lib/words.mjs +18 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/prefs.mjs +70 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/recipe.mjs +103 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/resolve-plugin.test.mjs +62 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/resolve.mjs +1369 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/transcribe.mjs +194 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/transcribe.test.mjs +112 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/transcript-cut.mjs +270 -0
- package/vendor/hyperframes/dist/skills/media-use/scripts/transcript-cut.test.mjs +117 -0
- package/vendor/hyperframes/dist/skills-MJ2J4GEM.js +808 -0
- package/vendor/hyperframes/dist/skillsUpdateCheck-TKTYQN5R.js +26 -0
- package/vendor/hyperframes/dist/slideshow-EJ4IMY6P.js +24 -0
- package/vendor/hyperframes/dist/snapshot-KIVDUUMN.js +875 -0
- package/vendor/hyperframes/dist/src-6YQBJGWR.js +202 -0
- package/vendor/hyperframes/dist/src-PVYUYV3M.js +471 -0
- package/vendor/hyperframes/dist/state-KAXGHF77.js +26 -0
- package/vendor/hyperframes/dist/staticProjectServer-7EU666GS.js +49 -0
- package/vendor/hyperframes/dist/status-YM52BQ6S.js +311 -0
- package/vendor/hyperframes/dist/studio/assets/hyperframes-player-Cp8e_Zst.js +473 -0
- package/vendor/hyperframes/dist/studio/assets/index-BX3KHhGX.js +71 -0
- package/vendor/hyperframes/dist/studio/assets/index-CASEBNy2.js +1 -0
- package/vendor/hyperframes/dist/studio/assets/index-D11atkBt.css +1 -0
- package/vendor/hyperframes/dist/studio/assets/index-DMTt9nTf.js +531 -0
- package/vendor/hyperframes/dist/studio/assets/index-oE1pOdAy.js +399 -0
- package/vendor/hyperframes/dist/studio/chunk-5VSXRGIX.js +948 -0
- package/vendor/hyperframes/dist/studio/chunk-5VSXRGIX.js.map +1 -0
- package/vendor/hyperframes/dist/studio/chunk-7UQWVN52.js +938 -0
- package/vendor/hyperframes/dist/studio/chunk-7UQWVN52.js.map +1 -0
- package/vendor/hyperframes/dist/studio/chunk-EEXSYY5F.js +190 -0
- package/vendor/hyperframes/dist/studio/chunk-EEXSYY5F.js.map +1 -0
- package/vendor/hyperframes/dist/studio/chunk-FOEID72M.js +1441 -0
- package/vendor/hyperframes/dist/studio/chunk-FOEID72M.js.map +1 -0
- package/vendor/hyperframes/dist/studio/chunk-PZ5AY32C.js +10 -0
- package/vendor/hyperframes/dist/studio/chunk-PZ5AY32C.js.map +1 -0
- package/vendor/hyperframes/dist/studio/chunk-TDWGXBUT.js +1103 -0
- package/vendor/hyperframes/dist/studio/chunk-TDWGXBUT.js.map +1 -0
- package/vendor/hyperframes/dist/studio/domEditingLayers-IEVLO54Z.js +47 -0
- package/vendor/hyperframes/dist/studio/domEditingLayers-IEVLO54Z.js.map +1 -0
- package/vendor/hyperframes/dist/studio/favicon.svg +14 -0
- package/vendor/hyperframes/dist/studio/icons/timeline/audio.svg +7 -0
- package/vendor/hyperframes/dist/studio/icons/timeline/captions.svg +5 -0
- package/vendor/hyperframes/dist/studio/icons/timeline/composition.svg +12 -0
- package/vendor/hyperframes/dist/studio/icons/timeline/image.svg +18 -0
- package/vendor/hyperframes/dist/studio/icons/timeline/music.svg +10 -0
- package/vendor/hyperframes/dist/studio/icons/timeline/text.svg +3 -0
- package/vendor/hyperframes/dist/studio/index.css +165 -0
- package/vendor/hyperframes/dist/studio/index.css.map +1 -0
- package/vendor/hyperframes/dist/studio/index.d.ts +4296 -0
- package/vendor/hyperframes/dist/studio/index.html +23 -0
- package/vendor/hyperframes/dist/studio/index.js +99693 -0
- package/vendor/hyperframes/dist/studio/index.js.map +1 -0
- package/vendor/hyperframes/dist/studio/player.d.ts +30 -0
- package/vendor/hyperframes/dist/studio/player.js +10 -0
- package/vendor/hyperframes/dist/studio/player.js.map +1 -0
- package/vendor/hyperframes/dist/studio/styles/tailwind-preset.d.ts +39 -0
- package/vendor/hyperframes/dist/studio/styles/tailwind-preset.js +50 -0
- package/vendor/hyperframes/dist/studio/styles/tailwind-preset.js.map +1 -0
- package/vendor/hyperframes/dist/studio/styles.css +1 -0
- package/vendor/hyperframes/dist/studio/ui.d.ts +296 -0
- package/vendor/hyperframes/dist/studio/ui.js +66 -0
- package/vendor/hyperframes/dist/studio/ui.js.map +1 -0
- package/vendor/hyperframes/dist/studio-api-PNQZRPX5.js +136 -0
- package/vendor/hyperframes/dist/studioSelectionClient-IUUPKUHZ.js +25 -0
- package/vendor/hyperframes/dist/studioServer-UWRBPIOJ.js +1457 -0
- package/vendor/hyperframes/dist/synthesize-K62TIZWI.js +182 -0
- package/vendor/hyperframes/dist/system-EZYZNUFD.js +44 -0
- package/vendor/hyperframes/dist/telemetry-2YC4SGQU.js +144 -0
- package/vendor/hyperframes/dist/telemetry-QMYM4WME.js +95 -0
- package/vendor/hyperframes/dist/templates/_shared/AGENTS.md +107 -0
- package/vendor/hyperframes/dist/templates/_shared/CLAUDE.md +107 -0
- package/vendor/hyperframes/dist/templates/blank/index.html +55 -0
- package/vendor/hyperframes/dist/templates/from-file/index.html +75 -0
- package/vendor/hyperframes/dist/templates/warm-grain/compositions/captions.html +154 -0
- package/vendor/hyperframes/dist/templates/warm-grain/compositions/graphics.html +162 -0
- package/vendor/hyperframes/dist/templates/warm-grain/compositions/intro.html +87 -0
- package/vendor/hyperframes/dist/templates/warm-grain/index.html +264 -0
- package/vendor/hyperframes/dist/templates/warm-grain/registry-item.json +34 -0
- package/vendor/hyperframes/dist/timeline-77Z3BBQM.js +1377 -0
- package/vendor/hyperframes/dist/tokens-OBGTYE4Z.js +92 -0
- package/vendor/hyperframes/dist/transcribe-7NVFHCGA.js +387 -0
- package/vendor/hyperframes/dist/transcribe-BNSJRR4M.js +62 -0
- package/vendor/hyperframes/dist/tts-P3LIPIL5.js +234 -0
- package/vendor/hyperframes/dist/updateCheck-UDWIJ4ZQ.js +39 -0
- package/vendor/hyperframes/dist/upgrade-CT3CPO3E.js +231 -0
- package/vendor/hyperframes/dist/urlDownloader-H6WRI2UE.js +39 -0
- package/vendor/hyperframes/dist/usage-EC3KFUIJ.js +2139 -0
- package/vendor/hyperframes/dist/validate-65QDZJWZ.js +70 -0
- package/vendor/hyperframes/dist/video-FGSGKRSV.js +261 -0
- package/vendor/hyperframes/dist/workspaceBuildCheck-TOLGAI4T.js +133 -0
- package/vendor/hyperframes/package.json +80 -0
|
@@ -0,0 +1,852 @@
|
|
|
1
|
+
import { createRequire as __hf_createRequire } from "node:module";
|
|
2
|
+
import { fileURLToPath as __hf_fileURLToPath } from "node:url";
|
|
3
|
+
import { dirname as __hf_dirname } from "node:path";
|
|
4
|
+
var require = __hf_createRequire(import.meta.url);
|
|
5
|
+
var __filename = __hf_fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = __hf_dirname(__filename);
|
|
7
|
+
import {
|
|
8
|
+
ensureCaptureDirSync,
|
|
9
|
+
writeCaptureFileSync
|
|
10
|
+
} from "./chunk-MRF4AMKD.js";
|
|
11
|
+
import {
|
|
12
|
+
createCaptureDownloadBudget,
|
|
13
|
+
readBoundedResponse
|
|
14
|
+
} from "./chunk-AWDFDFI3.js";
|
|
15
|
+
import {
|
|
16
|
+
isBlockedNetworkHost
|
|
17
|
+
} from "./chunk-K2FTXJYH.js";
|
|
18
|
+
import {
|
|
19
|
+
DOMParser,
|
|
20
|
+
parseHTML
|
|
21
|
+
} from "./chunk-GK4AIFIH.js";
|
|
22
|
+
|
|
23
|
+
// src/capture/userAgent.ts
|
|
24
|
+
var CAPTURE_USER_AGENT = "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/131.0.0.0 Safari/537.36";
|
|
25
|
+
|
|
26
|
+
// src/capture/assetDownloader.ts
|
|
27
|
+
import { join, extname } from "path";
|
|
28
|
+
import { createHash as createHash2 } from "crypto";
|
|
29
|
+
|
|
30
|
+
// src/capture/faviconRanker.ts
|
|
31
|
+
var APPLE_TOUCH_DEFAULT_PX = 180;
|
|
32
|
+
function parseSizes(sizes) {
|
|
33
|
+
if (!sizes) return 0;
|
|
34
|
+
let max = 0;
|
|
35
|
+
for (const token of sizes.trim().split(/\s+/)) {
|
|
36
|
+
const m = /^(\d+)x(\d+)$/i.exec(token);
|
|
37
|
+
if (!m) continue;
|
|
38
|
+
max = Math.max(max, Number(m[1]), Number(m[2]));
|
|
39
|
+
}
|
|
40
|
+
return max;
|
|
41
|
+
}
|
|
42
|
+
function pathnameOf(href) {
|
|
43
|
+
try {
|
|
44
|
+
return new URL(href).pathname.toLowerCase();
|
|
45
|
+
} catch {
|
|
46
|
+
return href.split(/[#?]/)[0].toLowerCase();
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
function isSvg(c) {
|
|
50
|
+
return c.type?.toLowerCase() === "image/svg+xml" || pathnameOf(c.href).endsWith(".svg");
|
|
51
|
+
}
|
|
52
|
+
function isMaskIcon(c) {
|
|
53
|
+
return c.rel.toLowerCase().split(/\s+/).includes("mask-icon");
|
|
54
|
+
}
|
|
55
|
+
function isIco(c) {
|
|
56
|
+
const t = c.type?.toLowerCase();
|
|
57
|
+
return t === "image/x-icon" || t === "image/vnd.microsoft.icon" || pathnameOf(c.href).endsWith(".ico");
|
|
58
|
+
}
|
|
59
|
+
function declaredSize(c) {
|
|
60
|
+
const parsed = parseSizes(c.sizes);
|
|
61
|
+
if (parsed > 0) return parsed;
|
|
62
|
+
return c.rel.toLowerCase().split(/\s+/).some((t) => t.startsWith("apple-touch-icon")) ? APPLE_TOUCH_DEFAULT_PX : 0;
|
|
63
|
+
}
|
|
64
|
+
function tierOf(c) {
|
|
65
|
+
if (isMaskIcon(c)) return 3;
|
|
66
|
+
if (isSvg(c)) return 0;
|
|
67
|
+
return isIco(c) ? 2 : 1;
|
|
68
|
+
}
|
|
69
|
+
function rankIconCandidates(candidates) {
|
|
70
|
+
return candidates.filter((c) => !!c.href).map((c, i) => ({ c, i, tier: tierOf(c), size: declaredSize(c) })).sort((a, b) => a.tier - b.tier || b.size - a.size || a.i - b.i).map((e) => e.c);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
// src/capture/iconClassifier.ts
|
|
74
|
+
import sharp from "sharp";
|
|
75
|
+
var NON_PAINTING = /* @__PURE__ */ new Set(["defs", "clippath", "mask", "style", "title", "desc", "metadata"]);
|
|
76
|
+
var PAINTING = /* @__PURE__ */ new Set(["rect", "circle", "ellipse", "path", "polygon", "image", "use"]);
|
|
77
|
+
function firstPaintedElement(root) {
|
|
78
|
+
for (const child of Array.from(root.children)) {
|
|
79
|
+
const tag = child.tagName.toLowerCase();
|
|
80
|
+
if (NON_PAINTING.has(tag)) continue;
|
|
81
|
+
if (tag === "g" || tag === "svg") {
|
|
82
|
+
const nested = firstPaintedElement(child);
|
|
83
|
+
if (nested) return nested;
|
|
84
|
+
continue;
|
|
85
|
+
}
|
|
86
|
+
if (PAINTING.has(tag)) return child;
|
|
87
|
+
}
|
|
88
|
+
return null;
|
|
89
|
+
}
|
|
90
|
+
function num(el, attr) {
|
|
91
|
+
const raw = el.getAttribute(attr);
|
|
92
|
+
if (raw === null) return null;
|
|
93
|
+
const n = Number.parseFloat(raw);
|
|
94
|
+
return Number.isFinite(n) ? n : null;
|
|
95
|
+
}
|
|
96
|
+
function positiveBox(w, h) {
|
|
97
|
+
return w !== null && h !== null && w > 0 && h > 0 ? { w, h } : null;
|
|
98
|
+
}
|
|
99
|
+
function canvasFromViewBox(viewBox) {
|
|
100
|
+
if (!viewBox) return null;
|
|
101
|
+
const parts = viewBox.trim().split(/[\s,]+/).map(Number);
|
|
102
|
+
if (parts.length !== 4 || !parts.every(Number.isFinite)) return null;
|
|
103
|
+
return positiveBox(parts[2], parts[3]);
|
|
104
|
+
}
|
|
105
|
+
function canvasOf(svg) {
|
|
106
|
+
return canvasFromViewBox(svg.getAttribute("viewBox")) ?? positiveBox(num(svg, "width"), num(svg, "height"));
|
|
107
|
+
}
|
|
108
|
+
var FULL_BLEED_RATIO = 0.95;
|
|
109
|
+
function classifySvgIcon(source) {
|
|
110
|
+
const { document } = parseHTML(`<!doctype html><body>${source}</body>`);
|
|
111
|
+
const svg = document.querySelector("svg");
|
|
112
|
+
if (!svg) return { shape: "unknown", reason: "no <svg> root found" };
|
|
113
|
+
const canvas = canvasOf(svg);
|
|
114
|
+
if (!canvas) return { shape: "unknown", reason: "no viewBox or width/height to measure against" };
|
|
115
|
+
const first = firstPaintedElement(svg);
|
|
116
|
+
if (!first) return { shape: "unknown", reason: "no painted element found" };
|
|
117
|
+
const tag = first.tagName.toLowerCase();
|
|
118
|
+
if (tag === "rect") {
|
|
119
|
+
const w = num(first, "width");
|
|
120
|
+
const h = num(first, "height");
|
|
121
|
+
if (w !== null && h !== null && w >= canvas.w * FULL_BLEED_RATIO && h >= canvas.h * FULL_BLEED_RATIO) {
|
|
122
|
+
const rounded = num(first, "rx");
|
|
123
|
+
return {
|
|
124
|
+
shape: "badge",
|
|
125
|
+
reason: `first painted element is a full-bleed ${rounded ? "rounded " : ""}rect (${w}x${h} of ${canvas.w}x${canvas.h})`
|
|
126
|
+
};
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
if (tag === "circle") {
|
|
130
|
+
const r = num(first, "r");
|
|
131
|
+
if (r !== null && r * 2 >= Math.min(canvas.w, canvas.h) * FULL_BLEED_RATIO) {
|
|
132
|
+
return {
|
|
133
|
+
shape: "badge",
|
|
134
|
+
reason: `first painted element is a full-bleed circle (r=${r} of ${canvas.w}x${canvas.h})`
|
|
135
|
+
};
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
return { shape: "bare-mark", reason: `first painted element is <${tag}> with margins` };
|
|
139
|
+
}
|
|
140
|
+
var OPAQUE_ALPHA = 250;
|
|
141
|
+
var BACKDROP_EDGE_HITS = 3;
|
|
142
|
+
var SAMPLE_EDGE = 32;
|
|
143
|
+
async function classifyRasterIcon(buffer) {
|
|
144
|
+
let data;
|
|
145
|
+
let channels;
|
|
146
|
+
try {
|
|
147
|
+
const raw = await sharp(buffer).resize(SAMPLE_EDGE, SAMPLE_EDGE, { fit: "fill" }).ensureAlpha().raw().toBuffer({ resolveWithObject: true });
|
|
148
|
+
data = raw.data;
|
|
149
|
+
channels = raw.info.channels;
|
|
150
|
+
} catch {
|
|
151
|
+
return { shape: "unknown", reason: "image format could not be decoded for inspection" };
|
|
152
|
+
}
|
|
153
|
+
const last = SAMPLE_EDGE - 1;
|
|
154
|
+
const mid = SAMPLE_EDGE >> 1;
|
|
155
|
+
const alphaAt = (x, y) => data[(y * SAMPLE_EDGE + x) * channels + 3] ?? 0;
|
|
156
|
+
const edgeMidpoints = [alphaAt(mid, 0), alphaAt(mid, last), alphaAt(0, mid), alphaAt(last, mid)];
|
|
157
|
+
const opaqueEdges = edgeMidpoints.filter((a) => a >= OPAQUE_ALPHA).length;
|
|
158
|
+
return opaqueEdges >= BACKDROP_EDGE_HITS ? {
|
|
159
|
+
shape: "badge",
|
|
160
|
+
reason: `${opaqueEdges} of 4 edge midpoints are opaque, so the drawing carries a backdrop`
|
|
161
|
+
} : {
|
|
162
|
+
shape: "bare-mark",
|
|
163
|
+
reason: `${opaqueEdges} of 4 edge midpoints are opaque, so the drawing has transparent margins`
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
async function classifyIcon(buffer, ext) {
|
|
167
|
+
return ext.toLowerCase() === ".svg" ? classifySvgIcon(buffer.toString("utf-8")) : classifyRasterIcon(buffer);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
// src/capture/captureFontValidation.ts
|
|
171
|
+
import { createHash } from "crypto";
|
|
172
|
+
import { create } from "fontkit";
|
|
173
|
+
var MAX_FONT_BYTES = 75 * 1024 * 1024;
|
|
174
|
+
function fontContainerExtension(bytes) {
|
|
175
|
+
if (bytes.length < 12 || bytes.length > MAX_FONT_BYTES) return null;
|
|
176
|
+
const signature = bytes.toString("ascii", 0, 4);
|
|
177
|
+
let extension;
|
|
178
|
+
if (signature === "wOFF" || signature === "wOF2") {
|
|
179
|
+
return woffExtension(bytes, signature);
|
|
180
|
+
} else if (signature === "OTTO") {
|
|
181
|
+
extension = ".otf";
|
|
182
|
+
} else if (bytes.readUInt32BE(0) === 65536 || signature === "true") {
|
|
183
|
+
extension = ".ttf";
|
|
184
|
+
} else {
|
|
185
|
+
return null;
|
|
186
|
+
}
|
|
187
|
+
return extension;
|
|
188
|
+
}
|
|
189
|
+
function woffExtension(bytes, signature) {
|
|
190
|
+
const headerSize = signature === "wOFF" ? 44 : 48;
|
|
191
|
+
if (bytes.length < headerSize || bytes.readUInt32BE(8) !== bytes.length) return null;
|
|
192
|
+
const expandedSize = bytes.readUInt32BE(16);
|
|
193
|
+
if (expandedSize < 12 || expandedSize > MAX_FONT_BYTES) return null;
|
|
194
|
+
return signature === "wOFF" ? ".woff" : ".woff2";
|
|
195
|
+
}
|
|
196
|
+
function captureFontExtension(bytes) {
|
|
197
|
+
const extension = fontContainerExtension(bytes);
|
|
198
|
+
if (!extension) return null;
|
|
199
|
+
try {
|
|
200
|
+
const font = create(bytes);
|
|
201
|
+
if (!("numGlyphs" in font) || font.numGlyphs <= 0 || font.numGlyphs > 65535) return null;
|
|
202
|
+
if (!Number.isFinite(font.unitsPerEm) || font.unitsPerEm <= 0) return null;
|
|
203
|
+
if (!Array.isArray(font.characterSet)) return null;
|
|
204
|
+
return extension;
|
|
205
|
+
} catch {
|
|
206
|
+
return null;
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
function preferredFontFilename(url, extension) {
|
|
210
|
+
const basename = new URL(url).pathname.split("/").pop() ?? "";
|
|
211
|
+
const dot = basename.lastIndexOf(".");
|
|
212
|
+
const stem = dot > 0 ? basename.slice(0, dot) : basename;
|
|
213
|
+
if (/^[a-zA-Z0-9_-][a-zA-Z0-9_.-]{0,119}$/.test(stem) && !/[. ]$/.test(stem) && !/^(?:con|prn|aux|nul|com[1-9]|lpt[1-9])(?:\.|$)/i.test(stem)) {
|
|
214
|
+
return `${stem}${extension}`;
|
|
215
|
+
}
|
|
216
|
+
return `font-${createHash("sha256").update(url).digest("hex").slice(0, 16)}${extension}`;
|
|
217
|
+
}
|
|
218
|
+
function captureFontFilename(url, extension, used = /* @__PURE__ */ new Set()) {
|
|
219
|
+
const preferred = preferredFontFilename(url, extension);
|
|
220
|
+
const stem = preferred.slice(0, -extension.length);
|
|
221
|
+
let name = preferred;
|
|
222
|
+
for (let n = 2; used.has(name.toLowerCase()); n++) name = `${stem}-${n}${extension}`;
|
|
223
|
+
used.add(name.toLowerCase());
|
|
224
|
+
return name;
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
// src/capture/captureImageValidation.ts
|
|
228
|
+
import sharp2 from "sharp";
|
|
229
|
+
import { parse, walk } from "css-tree";
|
|
230
|
+
var SVG_ELEMENTS = new Set(
|
|
231
|
+
"svg g defs title desc metadata path rect circle ellipse line polyline polygon text tspan textPath use symbol image clipPath mask pattern marker linearGradient radialGradient stop filter feBlend feColorMatrix feComponentTransfer feComposite feConvolveMatrix feDiffuseLighting feDisplacementMap feDistantLight feDropShadow feFlood feFuncA feFuncB feFuncG feFuncR feGaussianBlur feImage feMerge feMergeNode feMorphology feOffset fePointLight feSpecularLighting feSpotLight feTile feTurbulence style".toLowerCase().split(" ")
|
|
232
|
+
);
|
|
233
|
+
function localImageReference(value, embedded) {
|
|
234
|
+
const ref = value.trim();
|
|
235
|
+
if (ref.startsWith("#")) return true;
|
|
236
|
+
if (!/^data:image\/(?:png|jpeg|gif|webp);base64,[a-z0-9+/=\s]+$/i.test(ref)) return false;
|
|
237
|
+
embedded.add(ref);
|
|
238
|
+
return true;
|
|
239
|
+
}
|
|
240
|
+
function passiveCss(source, context, embedded) {
|
|
241
|
+
if (source.includes("\\")) return false;
|
|
242
|
+
let safe = true;
|
|
243
|
+
try {
|
|
244
|
+
walk(parse(source, { context, parseCustomProperty: true }), (node) => {
|
|
245
|
+
if (node.type === "Raw") safe = false;
|
|
246
|
+
if (node.type === "Function" && ["image", "image-set", "-webkit-image-set", "src", "paint"].includes(
|
|
247
|
+
node.name.toLowerCase()
|
|
248
|
+
))
|
|
249
|
+
safe = false;
|
|
250
|
+
if (node.type === "Url" && !localImageReference(node.value, embedded)) safe = false;
|
|
251
|
+
if (node.type === "Atrule" && !["media", "supports", "keyframes"].includes(node.name.toLowerCase()))
|
|
252
|
+
safe = false;
|
|
253
|
+
});
|
|
254
|
+
return safe;
|
|
255
|
+
} catch {
|
|
256
|
+
return false;
|
|
257
|
+
}
|
|
258
|
+
}
|
|
259
|
+
function passiveSvg(bytes, embedded) {
|
|
260
|
+
const source = bytes.toString("utf8");
|
|
261
|
+
if (/<!DOCTYPE|<!ENTITY|<\?xml-stylesheet/i.test(source)) return false;
|
|
262
|
+
const document = new DOMParser().parseFromString(source, "image/svg+xml");
|
|
263
|
+
const root = document.documentElement;
|
|
264
|
+
if (root?.localName !== "svg") return false;
|
|
265
|
+
const elements = [root, ...Array.from(root.querySelectorAll("*"))];
|
|
266
|
+
if (elements.length > 1e4) return false;
|
|
267
|
+
return elements.every((element) => {
|
|
268
|
+
if (!SVG_ELEMENTS.has(element.localName.toLowerCase())) return false;
|
|
269
|
+
if (element.localName === "style" && !passiveCss(element.textContent ?? "", "stylesheet", embedded))
|
|
270
|
+
return false;
|
|
271
|
+
return element.getAttributeNames().every(
|
|
272
|
+
(attribute) => passiveSvgAttribute(
|
|
273
|
+
attribute.toLowerCase(),
|
|
274
|
+
element.getAttribute(attribute) ?? "",
|
|
275
|
+
embedded
|
|
276
|
+
)
|
|
277
|
+
);
|
|
278
|
+
});
|
|
279
|
+
}
|
|
280
|
+
function passiveSvgAttribute(name, value, embedded) {
|
|
281
|
+
if (name.startsWith("on") || name === "xml:base") return false;
|
|
282
|
+
if (["href", "xlink:href", "src"].includes(name)) return localImageReference(value, embedded);
|
|
283
|
+
if (name === "style") return passiveCss(value, "declarationList", embedded);
|
|
284
|
+
return !/url\s*\(|\\/i.test(value) || passiveCss(value, "value", embedded);
|
|
285
|
+
}
|
|
286
|
+
async function validIco(bytes) {
|
|
287
|
+
if (bytes.length < 22 || bytes.readUInt32LE(0) !== 65536) return false;
|
|
288
|
+
const count = bytes.readUInt16LE(4);
|
|
289
|
+
if (count === 0 || count > 256 || 6 + count * 16 > bytes.length) return false;
|
|
290
|
+
for (let i = 0; i < count; i++) {
|
|
291
|
+
const size = bytes.readUInt32LE(6 + i * 16 + 8);
|
|
292
|
+
const offset = bytes.readUInt32LE(6 + i * 16 + 12);
|
|
293
|
+
if (!validIconEntry(size, offset, 6 + count * 16, bytes.length)) return false;
|
|
294
|
+
if (!await validIconImage(bytes.subarray(offset, offset + size))) return false;
|
|
295
|
+
}
|
|
296
|
+
return true;
|
|
297
|
+
}
|
|
298
|
+
function validIconEntry(size, offset, directoryEnd, length) {
|
|
299
|
+
return size >= 40 && offset >= directoryEnd && size <= length - offset;
|
|
300
|
+
}
|
|
301
|
+
async function validIconImage(bytes) {
|
|
302
|
+
const png = bytes.subarray(0, 8).equals(Buffer.from([137, 80, 78, 71, 13, 10, 26, 10]));
|
|
303
|
+
if (!png) return validIconBitmap(bytes);
|
|
304
|
+
try {
|
|
305
|
+
await sharp2(bytes, { limitInputPixels: 65536 }).resize(1, 1).raw().toBuffer();
|
|
306
|
+
return true;
|
|
307
|
+
} catch {
|
|
308
|
+
return false;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
function validIconBitmap(bytes) {
|
|
312
|
+
const dibSize = bytes.readUInt32LE(0);
|
|
313
|
+
if (![40, 108, 124].includes(dibSize) || bytes.length < dibSize) return false;
|
|
314
|
+
const width = bytes.readInt32LE(4);
|
|
315
|
+
const height = bytes.readInt32LE(8);
|
|
316
|
+
const bits = bytes.readUInt16LE(14);
|
|
317
|
+
if (!validIconDimensions(width, height)) return false;
|
|
318
|
+
if (bytes.readUInt16LE(12) !== 1 || ![1, 4, 8, 16, 24, 32].includes(bits)) return false;
|
|
319
|
+
if (bytes.readUInt32LE(16) !== 0) return false;
|
|
320
|
+
const pixels = Math.ceil(width * bits / 32) * 4 * (height / 2);
|
|
321
|
+
const palette = bits <= 8 ? 4 * (1 << bits) : 0;
|
|
322
|
+
return dibSize + palette + pixels <= bytes.length;
|
|
323
|
+
}
|
|
324
|
+
function validIconDimensions(width, height) {
|
|
325
|
+
return width > 0 && width <= 256 && height > 0 && height <= 512 && height % 2 === 0;
|
|
326
|
+
}
|
|
327
|
+
async function captureImageExtension(bytes) {
|
|
328
|
+
if (await validIco(bytes)) return ".ico";
|
|
329
|
+
try {
|
|
330
|
+
const embedded = /* @__PURE__ */ new Set();
|
|
331
|
+
if (/^\s*</.test(bytes.toString("utf8", 0, 256)) && !passiveSvg(bytes, embedded)) return null;
|
|
332
|
+
const image = sharp2(bytes, { limitInputPixels: 4e7 });
|
|
333
|
+
const metadata = await image.metadata();
|
|
334
|
+
if (metadata.format === "svg") {
|
|
335
|
+
if (!passiveSvg(bytes, embedded) || !await validEmbeddedImages(embedded)) return null;
|
|
336
|
+
return ".svg";
|
|
337
|
+
}
|
|
338
|
+
const extensions = {
|
|
339
|
+
jpeg: ".jpg",
|
|
340
|
+
png: ".png",
|
|
341
|
+
webp: ".webp",
|
|
342
|
+
gif: ".gif",
|
|
343
|
+
avif: ".avif",
|
|
344
|
+
heif: metadata.compression === "av1" ? ".avif" : ".heic",
|
|
345
|
+
tiff: ".tiff"
|
|
346
|
+
};
|
|
347
|
+
const extension = metadata.format && extensions[metadata.format];
|
|
348
|
+
if (!extension) return null;
|
|
349
|
+
await image.resize(1, 1).raw().toBuffer();
|
|
350
|
+
return extension;
|
|
351
|
+
} catch {
|
|
352
|
+
return null;
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
async function validEmbeddedImages(references) {
|
|
356
|
+
let remainingBytes = 10 * 1024 * 1024;
|
|
357
|
+
let remainingPixels = 4e7;
|
|
358
|
+
for (const reference of references) {
|
|
359
|
+
const comma = reference.indexOf(",");
|
|
360
|
+
const type = reference.slice(11, reference.indexOf(";")).toLowerCase();
|
|
361
|
+
const encoded = reference.slice(comma + 1).replace(/\s/g, "");
|
|
362
|
+
if (encoded.length > Math.ceil(remainingBytes / 3) * 4) return false;
|
|
363
|
+
const bytes = Buffer.from(encoded, "base64");
|
|
364
|
+
remainingBytes -= bytes.length;
|
|
365
|
+
if (remainingBytes < 0) return false;
|
|
366
|
+
const image = sharp2(bytes, { limitInputPixels: remainingPixels });
|
|
367
|
+
const metadata = await image.metadata();
|
|
368
|
+
if (metadata.format !== type || !metadata.width || !metadata.height) return false;
|
|
369
|
+
const pixels = metadata.width * metadata.height * (metadata.pages ?? 1);
|
|
370
|
+
remainingPixels -= pixels;
|
|
371
|
+
if (remainingPixels < 0) return false;
|
|
372
|
+
await image.resize(1, 1).raw().toBuffer();
|
|
373
|
+
}
|
|
374
|
+
return true;
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
// src/capture/assetDownloader.ts
|
|
378
|
+
function noDrops() {
|
|
379
|
+
return { "size-floor": 0, "budget-exhausted": 0, "cap-reached": 0, unavailable: 0 };
|
|
380
|
+
}
|
|
381
|
+
function mergeDrops(a, b) {
|
|
382
|
+
const total = noDrops();
|
|
383
|
+
for (const reason of Object.keys(total)) {
|
|
384
|
+
total[reason] = a[reason] + b[reason];
|
|
385
|
+
}
|
|
386
|
+
return total;
|
|
387
|
+
}
|
|
388
|
+
function totalDrops(drops) {
|
|
389
|
+
return Object.values(drops).reduce((sum, n) => sum + n, 0);
|
|
390
|
+
}
|
|
391
|
+
function svgContentHashSlug(svgSource, isLogo) {
|
|
392
|
+
const hash = createHash2("sha1").update(svgSource).digest("hex").slice(0, 8);
|
|
393
|
+
return isLogo ? `logo-${hash}` : `svg-${hash}`;
|
|
394
|
+
}
|
|
395
|
+
function toStandaloneSvg(outerHTML) {
|
|
396
|
+
const open = outerHTML.match(/<svg\b[^>]*>/i);
|
|
397
|
+
if (!open) return outerHTML;
|
|
398
|
+
const original = open[0];
|
|
399
|
+
let tag = original;
|
|
400
|
+
const add = [];
|
|
401
|
+
if (!/\sxmlns\s*=/i.test(tag)) add.push('xmlns="http://www.w3.org/2000/svg"');
|
|
402
|
+
if (/\sxlink:[a-z-]+\s*=/i.test(outerHTML) && !/\sxmlns:xlink\s*=/i.test(tag)) {
|
|
403
|
+
add.push('xmlns:xlink="http://www.w3.org/1999/xlink"');
|
|
404
|
+
}
|
|
405
|
+
if (!add.length) return outerHTML;
|
|
406
|
+
tag = tag.replace(/^<svg\b/i, `<svg ${add.join(" ")}`);
|
|
407
|
+
return outerHTML.replace(original, tag);
|
|
408
|
+
}
|
|
409
|
+
function emptyIconManifest() {
|
|
410
|
+
return { schema: "hyperframes.capture.icons.v1", headline: null, icons: [] };
|
|
411
|
+
}
|
|
412
|
+
var MAX_ICONS = 8;
|
|
413
|
+
var SHAPE_PREFERENCE = { "bare-mark": 0, unknown: 1, badge: 1 };
|
|
414
|
+
function iconFileStem(icon) {
|
|
415
|
+
const slug = `${icon.rel} ${icon.sizes ?? "unsized"}`.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-+|-+$/g, "");
|
|
416
|
+
return `icon-${slug || "unknown"}`;
|
|
417
|
+
}
|
|
418
|
+
function headlineReason(chosen, all) {
|
|
419
|
+
const badges = all.filter((i) => i.shape === "badge").length;
|
|
420
|
+
if (chosen.shape === "bare-mark") {
|
|
421
|
+
return badges > 0 ? `bare mark preferred over ${badges} badge(s)` : "the only candidate is a bare mark";
|
|
422
|
+
}
|
|
423
|
+
const bare = all.filter((i) => i.shape === "bare-mark").length;
|
|
424
|
+
if (bare > 0) return `best-ranked bare mark was unavailable; used a ${chosen.shape}`;
|
|
425
|
+
return `no bare-mark candidate among ${all.length} icon(s); used the best-ranked ${chosen.shape}`;
|
|
426
|
+
}
|
|
427
|
+
function uniqueStem(icon, used) {
|
|
428
|
+
const base = iconFileStem(icon);
|
|
429
|
+
let stem = base;
|
|
430
|
+
for (let n = 2; used.has(stem); n++) stem = `${base}-${n}`;
|
|
431
|
+
used.add(stem);
|
|
432
|
+
return stem;
|
|
433
|
+
}
|
|
434
|
+
async function fetchAndInspectIcon(icon, rank, stem, outputDir, timeoutMs, byteBudget) {
|
|
435
|
+
const buffer = await fetchBuffer(icon.href, timeoutMs, 2 * 1024 * 1024, byteBudget);
|
|
436
|
+
if (!buffer) return null;
|
|
437
|
+
const ext = await captureImageExtension(buffer);
|
|
438
|
+
if (!ext) return null;
|
|
439
|
+
const file = `assets/${stem}${ext}`;
|
|
440
|
+
writeCaptureFileSync(join(outputDir, file), buffer);
|
|
441
|
+
const verdict = await classifyIcon(buffer, ext);
|
|
442
|
+
return {
|
|
443
|
+
buffer,
|
|
444
|
+
record: {
|
|
445
|
+
file,
|
|
446
|
+
url: icon.href,
|
|
447
|
+
rel: icon.rel,
|
|
448
|
+
sizes: icon.sizes ?? null,
|
|
449
|
+
type: icon.type ?? null,
|
|
450
|
+
rank,
|
|
451
|
+
shape: verdict.shape,
|
|
452
|
+
shapeReason: verdict.reason
|
|
453
|
+
}
|
|
454
|
+
};
|
|
455
|
+
}
|
|
456
|
+
function promoteHeadline(manifest, bytesByFile, outputDir) {
|
|
457
|
+
const chosen = [...manifest.icons].sort(
|
|
458
|
+
(a, b) => SHAPE_PREFERENCE[a.shape] - SHAPE_PREFERENCE[b.shape] || a.rank - b.rank
|
|
459
|
+
)[0];
|
|
460
|
+
if (!chosen) return null;
|
|
461
|
+
const file = `assets/favicon${extname(chosen.file)}`;
|
|
462
|
+
writeCaptureFileSync(join(outputDir, file), bytesByFile.get(chosen.file));
|
|
463
|
+
manifest.headline = {
|
|
464
|
+
file,
|
|
465
|
+
source: chosen.file,
|
|
466
|
+
rank: chosen.rank,
|
|
467
|
+
shape: chosen.shape,
|
|
468
|
+
reason: headlineReason(chosen, manifest.icons)
|
|
469
|
+
};
|
|
470
|
+
return { url: chosen.url, localPath: file, type: "favicon" };
|
|
471
|
+
}
|
|
472
|
+
async function downloadDeclaredIcons(faviconLinks, outputDir, drops, options) {
|
|
473
|
+
const ranked = rankIconCandidates(faviconLinks);
|
|
474
|
+
const attempted = ranked.slice(0, MAX_ICONS);
|
|
475
|
+
drops["cap-reached"] += ranked.length - attempted.length;
|
|
476
|
+
const assets = [];
|
|
477
|
+
const manifest = emptyIconManifest();
|
|
478
|
+
const bytesByFile = /* @__PURE__ */ new Map();
|
|
479
|
+
const usedStems = /* @__PURE__ */ new Set();
|
|
480
|
+
for (const [rank, icon] of attempted.entries()) {
|
|
481
|
+
const remainingMs = options.remainingMs?.() ?? 1e4;
|
|
482
|
+
if (remainingMs <= 0) {
|
|
483
|
+
drops["budget-exhausted"] += attempted.length - rank;
|
|
484
|
+
break;
|
|
485
|
+
}
|
|
486
|
+
try {
|
|
487
|
+
const stem = uniqueStem(icon, usedStems);
|
|
488
|
+
const got = await fetchAndInspectIcon(
|
|
489
|
+
icon,
|
|
490
|
+
rank,
|
|
491
|
+
stem,
|
|
492
|
+
outputDir,
|
|
493
|
+
Math.min(1e4, remainingMs),
|
|
494
|
+
options.byteBudget
|
|
495
|
+
);
|
|
496
|
+
if (!got) {
|
|
497
|
+
drops.unavailable++;
|
|
498
|
+
continue;
|
|
499
|
+
}
|
|
500
|
+
bytesByFile.set(got.record.file, got.buffer);
|
|
501
|
+
manifest.icons.push(got.record);
|
|
502
|
+
assets.push({ url: icon.href, localPath: got.record.file, type: "favicon" });
|
|
503
|
+
} catch {
|
|
504
|
+
drops.unavailable++;
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
try {
|
|
508
|
+
const headline = promoteHeadline(manifest, bytesByFile, outputDir);
|
|
509
|
+
if (headline) assets.push(headline);
|
|
510
|
+
} catch {
|
|
511
|
+
drops.unavailable++;
|
|
512
|
+
}
|
|
513
|
+
return { assets, manifest };
|
|
514
|
+
}
|
|
515
|
+
async function downloadAssets(tokens, outputDir, catalogedAssets, faviconLinks, options = {}) {
|
|
516
|
+
options = { ...options, byteBudget: options.byteBudget ?? createCaptureDownloadBudget() };
|
|
517
|
+
const assetsDir = join(outputDir, "assets");
|
|
518
|
+
ensureCaptureDirSync(outputDir, assetsDir);
|
|
519
|
+
const assets = [];
|
|
520
|
+
const drops = noDrops();
|
|
521
|
+
const downloadedUrls = /* @__PURE__ */ new Set();
|
|
522
|
+
let icons = emptyIconManifest();
|
|
523
|
+
ensureCaptureDirSync(outputDir, join(outputDir, "assets", "svgs"));
|
|
524
|
+
const usedSvgNames = /* @__PURE__ */ new Set();
|
|
525
|
+
const MAX_INLINE_SVGS = 30;
|
|
526
|
+
drops["cap-reached"] += Math.max(0, tokens.svgs.length - MAX_INLINE_SVGS);
|
|
527
|
+
for (let i = 0; i < tokens.svgs.length && i < MAX_INLINE_SVGS; i++) {
|
|
528
|
+
const svg = tokens.svgs[i];
|
|
529
|
+
if (!svg.outerHTML || svg.outerHTML.length < 50) {
|
|
530
|
+
drops["size-floor"]++;
|
|
531
|
+
continue;
|
|
532
|
+
}
|
|
533
|
+
const svgFile = toStandaloneSvg(svg.outerHTML);
|
|
534
|
+
const slug = svgContentHashSlug(svgFile, !!svg.isLogo);
|
|
535
|
+
let finalSlug = slug;
|
|
536
|
+
let suffix = 2;
|
|
537
|
+
while (usedSvgNames.has(finalSlug)) {
|
|
538
|
+
finalSlug = `${slug}-${suffix}`;
|
|
539
|
+
suffix++;
|
|
540
|
+
}
|
|
541
|
+
usedSvgNames.add(finalSlug);
|
|
542
|
+
const name = `${finalSlug}.svg`;
|
|
543
|
+
const localPath = `assets/svgs/${name}`;
|
|
544
|
+
try {
|
|
545
|
+
writeCaptureFileSync(join(outputDir, localPath), svgFile, "utf-8");
|
|
546
|
+
assets.push({ url: "", localPath, type: "svg" });
|
|
547
|
+
} catch {
|
|
548
|
+
drops.unavailable++;
|
|
549
|
+
}
|
|
550
|
+
}
|
|
551
|
+
const iconPass = await downloadDeclaredIcons(faviconLinks || [], outputDir, drops, options);
|
|
552
|
+
assets.push(...iconPass.assets);
|
|
553
|
+
icons = iconPass.manifest;
|
|
554
|
+
const imageUrls = [];
|
|
555
|
+
if (catalogedAssets && catalogedAssets.length > 0) {
|
|
556
|
+
for (const a of catalogedAssets) {
|
|
557
|
+
if (a.type !== "Image" && a.type !== "Background") continue;
|
|
558
|
+
if (!a.url.startsWith("http")) continue;
|
|
559
|
+
if (a.url.includes("pixel") || a.url.includes("beacon") || a.url.includes("analytics"))
|
|
560
|
+
continue;
|
|
561
|
+
if (a.url.includes("/favicon")) continue;
|
|
562
|
+
const hasGoodContext = a.contexts.some(
|
|
563
|
+
(c) => c === "img[src]" || c === "img[srcset]" || c === "video[poster]" || c === "source[srcset]" || c === "data-src" || c === "css url()"
|
|
564
|
+
);
|
|
565
|
+
if (!hasGoodContext) continue;
|
|
566
|
+
const isPoster = a.contexts.includes("video[poster]");
|
|
567
|
+
imageUrls.push({ url: a.url, isPoster });
|
|
568
|
+
}
|
|
569
|
+
}
|
|
570
|
+
const toDownload = [];
|
|
571
|
+
for (const { url, isPoster } of imageUrls) {
|
|
572
|
+
const normalized = normalizeUrl(url);
|
|
573
|
+
if (downloadedUrls.has(normalized)) continue;
|
|
574
|
+
downloadedUrls.add(normalized);
|
|
575
|
+
const catalog = catalogedAssets?.find((a) => normalizeUrl(a.url) === normalized);
|
|
576
|
+
toDownload.push({ url, isPoster, normalized, catalog });
|
|
577
|
+
}
|
|
578
|
+
const BATCH_SIZE = 5;
|
|
579
|
+
let imgIdx = 0;
|
|
580
|
+
const usedNames = /* @__PURE__ */ new Set();
|
|
581
|
+
for (let i = 0; i < toDownload.length; i += BATCH_SIZE) {
|
|
582
|
+
const remainingMs = options.remainingMs?.() ?? 1e4;
|
|
583
|
+
if (remainingMs <= 0) {
|
|
584
|
+
drops["budget-exhausted"] += toDownload.length - i;
|
|
585
|
+
break;
|
|
586
|
+
}
|
|
587
|
+
const batch = toDownload.slice(i, i + BATCH_SIZE);
|
|
588
|
+
const results = await Promise.allSettled(
|
|
589
|
+
batch.map(async ({ url, isPoster, catalog }) => {
|
|
590
|
+
const parsedUrl = new URL(url);
|
|
591
|
+
const buffer = await fetchBuffer(
|
|
592
|
+
url,
|
|
593
|
+
Math.min(1e4, remainingMs),
|
|
594
|
+
20 * 1024 * 1024,
|
|
595
|
+
options.byteBudget
|
|
596
|
+
);
|
|
597
|
+
if (!buffer) {
|
|
598
|
+
drops.unavailable++;
|
|
599
|
+
return null;
|
|
600
|
+
}
|
|
601
|
+
const ext = await captureImageExtension(buffer);
|
|
602
|
+
if (!ext) {
|
|
603
|
+
drops.unavailable++;
|
|
604
|
+
return null;
|
|
605
|
+
}
|
|
606
|
+
const isSvg2 = ext === ".svg";
|
|
607
|
+
const minSize = isSvg2 ? 200 : 1e4;
|
|
608
|
+
if (buffer.length < minSize) {
|
|
609
|
+
drops["size-floor"]++;
|
|
610
|
+
return null;
|
|
611
|
+
}
|
|
612
|
+
return { url, isPoster, parsedUrl, ext, buffer, catalog };
|
|
613
|
+
})
|
|
614
|
+
);
|
|
615
|
+
for (const result of results) {
|
|
616
|
+
if (result.status === "rejected") {
|
|
617
|
+
drops.unavailable++;
|
|
618
|
+
continue;
|
|
619
|
+
}
|
|
620
|
+
if (!result.value) continue;
|
|
621
|
+
const { url, isPoster, parsedUrl, ext, buffer, catalog } = result.value;
|
|
622
|
+
try {
|
|
623
|
+
let slug;
|
|
624
|
+
if (ext === ".svg") {
|
|
625
|
+
const c = catalog;
|
|
626
|
+
const brandRe = /logo|brand|wordmark/i;
|
|
627
|
+
const isLogo = !!(c?.inBanner || c?.inHomeLink || c?.matchesTitleBrand || c?.contexts?.some((s) => brandRe.test(s)) || c?.description && brandRe.test(c.description) || c?.nearestHeading && brandRe.test(c.nearestHeading) || c?.sectionClasses && brandRe.test(c.sectionClasses));
|
|
628
|
+
slug = svgContentHashSlug(buffer, isLogo);
|
|
629
|
+
} else {
|
|
630
|
+
slug = deriveAssetName(parsedUrl, catalog, isPoster, imgIdx, usedNames);
|
|
631
|
+
}
|
|
632
|
+
const name = `${slug}${ext}`;
|
|
633
|
+
usedNames.add(slug);
|
|
634
|
+
const localPath = `assets/${name}`;
|
|
635
|
+
writeCaptureFileSync(join(outputDir, localPath), buffer);
|
|
636
|
+
assets.push({ url, localPath, type: "image" });
|
|
637
|
+
imgIdx++;
|
|
638
|
+
} catch {
|
|
639
|
+
drops.unavailable++;
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
if (tokens.ogImage && !downloadedUrls.has(normalizeUrl(tokens.ogImage))) {
|
|
644
|
+
const remainingMs = options.remainingMs?.() ?? 1e4;
|
|
645
|
+
try {
|
|
646
|
+
if (remainingMs <= 0) {
|
|
647
|
+
drops["budget-exhausted"]++;
|
|
648
|
+
} else {
|
|
649
|
+
const buffer = await fetchBuffer(
|
|
650
|
+
tokens.ogImage,
|
|
651
|
+
Math.min(1e4, remainingMs),
|
|
652
|
+
20 * 1024 * 1024,
|
|
653
|
+
options.byteBudget
|
|
654
|
+
);
|
|
655
|
+
const ext = buffer && await captureImageExtension(buffer);
|
|
656
|
+
if (!buffer || !ext) {
|
|
657
|
+
drops.unavailable++;
|
|
658
|
+
} else if (buffer.length <= 5e3) {
|
|
659
|
+
drops["size-floor"]++;
|
|
660
|
+
} else {
|
|
661
|
+
const localPath = `assets/og-image${ext}`;
|
|
662
|
+
writeCaptureFileSync(join(outputDir, localPath), buffer);
|
|
663
|
+
assets.push({ url: tokens.ogImage, localPath, type: "image" });
|
|
664
|
+
}
|
|
665
|
+
}
|
|
666
|
+
} catch {
|
|
667
|
+
drops.unavailable++;
|
|
668
|
+
}
|
|
669
|
+
}
|
|
670
|
+
return { assets, drops, icons };
|
|
671
|
+
}
|
|
672
|
+
function normalizeUrl(u) {
|
|
673
|
+
try {
|
|
674
|
+
const parsed = new URL(u);
|
|
675
|
+
if (parsed.pathname.includes("_next/image") && parsed.searchParams.has("url")) {
|
|
676
|
+
return decodeURIComponent(parsed.searchParams.get("url"));
|
|
677
|
+
}
|
|
678
|
+
parsed.searchParams.delete("w");
|
|
679
|
+
parsed.searchParams.delete("q");
|
|
680
|
+
parsed.searchParams.delete("dpr");
|
|
681
|
+
return parsed.toString();
|
|
682
|
+
} catch {
|
|
683
|
+
return u;
|
|
684
|
+
}
|
|
685
|
+
}
|
|
686
|
+
async function downloadAndRewriteFonts(css, outputDir, options = {}) {
|
|
687
|
+
options = { ...options, byteBudget: options.byteBudget ?? createCaptureDownloadBudget() };
|
|
688
|
+
const assetsDir = join(outputDir, "assets", "fonts");
|
|
689
|
+
ensureCaptureDirSync(outputDir, assetsDir);
|
|
690
|
+
const drops = noDrops();
|
|
691
|
+
const fontUrlRegex = /url\(['"]?(https?:\/\/[^'")\s]+\.(?:woff2?|ttf|otf)[^'")\s]*?)['"]?\)/g;
|
|
692
|
+
const fontUrls = /* @__PURE__ */ new Set();
|
|
693
|
+
let match;
|
|
694
|
+
while ((match = fontUrlRegex.exec(css)) !== null) {
|
|
695
|
+
if (match[1]) fontUrls.add(match[1]);
|
|
696
|
+
}
|
|
697
|
+
if (fontUrls.size === 0) return { css, drops };
|
|
698
|
+
const MAX_FONTS_PER_FAMILY = 6;
|
|
699
|
+
const MAX_TOTAL_FONTS = 30;
|
|
700
|
+
const familyCounts = /* @__PURE__ */ new Map();
|
|
701
|
+
const getFamilyForUrl = (url) => {
|
|
702
|
+
const idx = css.indexOf(url);
|
|
703
|
+
if (idx === -1) return "_unknown";
|
|
704
|
+
const blockStart = css.lastIndexOf("@font-face", idx);
|
|
705
|
+
if (blockStart === -1) return "_unknown";
|
|
706
|
+
const blockSlice = css.slice(blockStart, idx);
|
|
707
|
+
const familyMatch = blockSlice.match(/font-family\s*:\s*['"]?([^'";}\n]+)/i);
|
|
708
|
+
return familyMatch?.[1] ? familyMatch[1].trim().toLowerCase() : "_unknown";
|
|
709
|
+
};
|
|
710
|
+
const sortedUrls = Array.from(fontUrls).sort((a, b) => {
|
|
711
|
+
const aLatin = /latin|[A-Za-z0-9]{10,}\.woff/.test(a) ? 0 : 1;
|
|
712
|
+
const bLatin = /latin|[A-Za-z0-9]{10,}\.woff/.test(b) ? 0 : 1;
|
|
713
|
+
return aLatin - bLatin;
|
|
714
|
+
});
|
|
715
|
+
const usedFontNames = /* @__PURE__ */ new Set();
|
|
716
|
+
let rewritten = css;
|
|
717
|
+
let count = 0;
|
|
718
|
+
for (const [index, fontUrl] of sortedUrls.entries()) {
|
|
719
|
+
const remainingMs = options.remainingMs?.() ?? 1e4;
|
|
720
|
+
if (remainingMs <= 0) {
|
|
721
|
+
drops["budget-exhausted"] += sortedUrls.length - index;
|
|
722
|
+
break;
|
|
723
|
+
}
|
|
724
|
+
if (count >= MAX_TOTAL_FONTS) {
|
|
725
|
+
drops["cap-reached"] += sortedUrls.length - index;
|
|
726
|
+
break;
|
|
727
|
+
}
|
|
728
|
+
const family = getFamilyForUrl(fontUrl);
|
|
729
|
+
const familyCount = familyCounts.get(family) || 0;
|
|
730
|
+
if (familyCount >= MAX_FONTS_PER_FAMILY) {
|
|
731
|
+
drops["cap-reached"]++;
|
|
732
|
+
continue;
|
|
733
|
+
}
|
|
734
|
+
familyCounts.set(family, familyCount + 1);
|
|
735
|
+
count++;
|
|
736
|
+
try {
|
|
737
|
+
const buffer = await fetchBuffer(
|
|
738
|
+
fontUrl,
|
|
739
|
+
Math.min(1e4, remainingMs),
|
|
740
|
+
10 * 1024 * 1024,
|
|
741
|
+
options.byteBudget
|
|
742
|
+
);
|
|
743
|
+
const extension = buffer && captureFontExtension(buffer);
|
|
744
|
+
if (buffer && extension) {
|
|
745
|
+
const filename = captureFontFilename(fontUrl, extension, usedFontNames);
|
|
746
|
+
const localPath = join(assetsDir, filename);
|
|
747
|
+
const relativePath = `assets/fonts/${filename}`;
|
|
748
|
+
writeCaptureFileSync(localPath, buffer);
|
|
749
|
+
rewritten = rewritten.split(fontUrl).join(relativePath);
|
|
750
|
+
} else {
|
|
751
|
+
drops.unavailable++;
|
|
752
|
+
}
|
|
753
|
+
} catch {
|
|
754
|
+
drops.unavailable++;
|
|
755
|
+
}
|
|
756
|
+
}
|
|
757
|
+
return { css: rewritten, drops };
|
|
758
|
+
}
|
|
759
|
+
function isPrivateUrl(url) {
|
|
760
|
+
try {
|
|
761
|
+
const u = new URL(url);
|
|
762
|
+
if (u.protocol !== "http:" && u.protocol !== "https:") return true;
|
|
763
|
+
return isBlockedNetworkHost(u.hostname);
|
|
764
|
+
} catch {
|
|
765
|
+
return true;
|
|
766
|
+
}
|
|
767
|
+
}
|
|
768
|
+
var MAX_FETCH_REDIRECTS = 5;
|
|
769
|
+
async function safeFetch(url, init) {
|
|
770
|
+
let current = url;
|
|
771
|
+
for (let hop = 0; hop <= MAX_FETCH_REDIRECTS; hop++) {
|
|
772
|
+
if (isPrivateUrl(current)) return null;
|
|
773
|
+
const res = await fetch(current, { ...init, redirect: "manual" });
|
|
774
|
+
if (res.status >= 300 && res.status < 400) {
|
|
775
|
+
const loc = res.headers.get("location");
|
|
776
|
+
if (!loc) return res;
|
|
777
|
+
try {
|
|
778
|
+
current = new URL(loc, current).toString();
|
|
779
|
+
} catch {
|
|
780
|
+
return null;
|
|
781
|
+
}
|
|
782
|
+
continue;
|
|
783
|
+
}
|
|
784
|
+
return res;
|
|
785
|
+
}
|
|
786
|
+
return null;
|
|
787
|
+
}
|
|
788
|
+
async function fetchBuffer(url, timeoutMs, maxBytes, budget = createCaptureDownloadBudget()) {
|
|
789
|
+
if (budget.remainingBytes <= 0) return null;
|
|
790
|
+
try {
|
|
791
|
+
const res = await safeFetch(url, {
|
|
792
|
+
signal: AbortSignal.timeout(timeoutMs),
|
|
793
|
+
headers: { "User-Agent": CAPTURE_USER_AGENT }
|
|
794
|
+
});
|
|
795
|
+
if (!res || !res.ok) return null;
|
|
796
|
+
const ct = res.headers.get("content-type") || "";
|
|
797
|
+
if (ct.includes("text/xml") || ct.includes("text/html") || ct.includes("application/xml")) {
|
|
798
|
+
return null;
|
|
799
|
+
}
|
|
800
|
+
return await readBoundedResponse(res, maxBytes, budget);
|
|
801
|
+
} catch {
|
|
802
|
+
return null;
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
function slugify(text) {
|
|
806
|
+
return text.toLowerCase().replace(/[^a-z0-9]+/g, "-").replace(/^-|-$/g, "").slice(0, 40);
|
|
807
|
+
}
|
|
808
|
+
function deriveAssetName(parsedUrl, catalog, isPoster, idx, usedNames) {
|
|
809
|
+
const candidates = [];
|
|
810
|
+
if (catalog?.description) {
|
|
811
|
+
const desc = catalog.description.replace(/[^a-zA-Z0-9 -]/g, "").trim();
|
|
812
|
+
if (desc.length > 3 && desc.length < 80) candidates.push(desc);
|
|
813
|
+
}
|
|
814
|
+
if (catalog?.nearestHeading) {
|
|
815
|
+
const heading = catalog.nearestHeading.replace(/[^a-zA-Z0-9 -]/g, "").trim();
|
|
816
|
+
if (heading.length > 3 && heading.length < 60) candidates.push(heading);
|
|
817
|
+
}
|
|
818
|
+
const rawName = parsedUrl.pathname.split("/").pop()?.replace(/\.[^.]+$/, "") || "";
|
|
819
|
+
const isMeaningful = rawName.length > 2 && rawName.length < 50 && !/^[a-f0-9]{8,}$/i.test(rawName) && !/^\d+$/.test(rawName) && !rawName.includes("_next") && !rawName.includes("?");
|
|
820
|
+
if (isMeaningful) candidates.push(rawName);
|
|
821
|
+
if (catalog?.sectionClasses) {
|
|
822
|
+
const classes = catalog.sectionClasses.split(/\s+/).filter((c) => c.length > 3 && c.length < 30 && !/^(w-|h-|p-|m-|flex|grid|block)/.test(c)).slice(0, 2).join("-");
|
|
823
|
+
if (classes.length > 3) candidates.push(classes);
|
|
824
|
+
}
|
|
825
|
+
const prefix = isPoster ? "poster" : catalog?.aboveFold ? "hero" : "image";
|
|
826
|
+
let slug = "";
|
|
827
|
+
for (const c of candidates) {
|
|
828
|
+
slug = slugify(c);
|
|
829
|
+
if (slug.length > 3 && !usedNames.has(slug)) break;
|
|
830
|
+
}
|
|
831
|
+
if (!slug || slug.length <= 3 || usedNames.has(slug)) {
|
|
832
|
+
slug = `${prefix}-${idx}`;
|
|
833
|
+
}
|
|
834
|
+
let final = slug;
|
|
835
|
+
let suffix = 2;
|
|
836
|
+
while (usedNames.has(final)) {
|
|
837
|
+
final = `${slug}-${suffix}`;
|
|
838
|
+
suffix++;
|
|
839
|
+
}
|
|
840
|
+
return final;
|
|
841
|
+
}
|
|
842
|
+
|
|
843
|
+
export {
|
|
844
|
+
CAPTURE_USER_AGENT,
|
|
845
|
+
noDrops,
|
|
846
|
+
mergeDrops,
|
|
847
|
+
totalDrops,
|
|
848
|
+
downloadAssets,
|
|
849
|
+
downloadAndRewriteFonts,
|
|
850
|
+
isPrivateUrl,
|
|
851
|
+
safeFetch
|
|
852
|
+
};
|