@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,1820 @@
|
|
|
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
|
+
openBrowser,
|
|
9
|
+
parseRemoteDebuggingPort,
|
|
10
|
+
validateRemoteDebuggingPortDeps
|
|
11
|
+
} from "./chunk-LFGJWOVA.js";
|
|
12
|
+
import {
|
|
13
|
+
resolveProject,
|
|
14
|
+
resolveProjectOrThrow
|
|
15
|
+
} from "./chunk-S3D6GE5W.js";
|
|
16
|
+
import {
|
|
17
|
+
formatLintStartupMessage
|
|
18
|
+
} from "./chunk-6CSYCFQV.js";
|
|
19
|
+
import {
|
|
20
|
+
desktopHint
|
|
21
|
+
} from "./chunk-GULOKZLI.js";
|
|
22
|
+
import "./chunk-IHFUKJOR.js";
|
|
23
|
+
import {
|
|
24
|
+
MAX_PORT_SCAN,
|
|
25
|
+
PreviewServerPortMismatchError,
|
|
26
|
+
activeServerOnPort,
|
|
27
|
+
findPortAndServe,
|
|
28
|
+
killActiveServers,
|
|
29
|
+
scanActiveServers
|
|
30
|
+
} from "./chunk-DQBY7FRR.js";
|
|
31
|
+
import {
|
|
32
|
+
resolveLocalBrowserGpuMode
|
|
33
|
+
} from "./chunk-XS4EJSKU.js";
|
|
34
|
+
import {
|
|
35
|
+
resolveAutoProxy
|
|
36
|
+
} from "./chunk-CFKU7HTK.js";
|
|
37
|
+
import "./chunk-XT7X6QCP.js";
|
|
38
|
+
import "./chunk-4YYJOFKS.js";
|
|
39
|
+
import "./chunk-HVW7ABXD.js";
|
|
40
|
+
import {
|
|
41
|
+
R,
|
|
42
|
+
ft,
|
|
43
|
+
ge
|
|
44
|
+
} from "./chunk-WMQNIQDJ.js";
|
|
45
|
+
import "./chunk-LYNI3FOL.js";
|
|
46
|
+
import "./chunk-CWPVM2QV.js";
|
|
47
|
+
import "./chunk-A2Z4Z4VL.js";
|
|
48
|
+
import "./chunk-AWDFDFI3.js";
|
|
49
|
+
import "./chunk-P6LJ4Y32.js";
|
|
50
|
+
import "./chunk-GMECXFAN.js";
|
|
51
|
+
import "./chunk-JTHMTOMQ.js";
|
|
52
|
+
import "./chunk-EISRN4E6.js";
|
|
53
|
+
import "./chunk-VWG7OQKU.js";
|
|
54
|
+
import {
|
|
55
|
+
c
|
|
56
|
+
} from "./chunk-ZTZA4UWZ.js";
|
|
57
|
+
import "./chunk-IUZFXWSV.js";
|
|
58
|
+
import "./chunk-AMKC3AXA.js";
|
|
59
|
+
import {
|
|
60
|
+
defineCommand
|
|
61
|
+
} from "./chunk-S3S4TGEH.js";
|
|
62
|
+
import "./chunk-54HJ63Q2.js";
|
|
63
|
+
import {
|
|
64
|
+
requestCliExit,
|
|
65
|
+
setCommandExitCode
|
|
66
|
+
} from "./chunk-PBN6GBJE.js";
|
|
67
|
+
import "./chunk-K2FTXJYH.js";
|
|
68
|
+
import "./chunk-2YN64IN5.js";
|
|
69
|
+
import "./chunk-AVUUN2XD.js";
|
|
70
|
+
import "./chunk-DPVXBVLL.js";
|
|
71
|
+
import "./chunk-Z6B37SNM.js";
|
|
72
|
+
import "./chunk-HWKCIWQT.js";
|
|
73
|
+
import "./chunk-VC76R6W2.js";
|
|
74
|
+
import "./chunk-OFQWTKPW.js";
|
|
75
|
+
import {
|
|
76
|
+
isProcessDescendant,
|
|
77
|
+
killOrphanedProcesses,
|
|
78
|
+
killProcessTree,
|
|
79
|
+
processIdentity
|
|
80
|
+
} from "./chunk-LAOCA3MQ.js";
|
|
81
|
+
import {
|
|
82
|
+
runRenderSetupWorker,
|
|
83
|
+
terminateProcessTree
|
|
84
|
+
} from "./chunk-LCSMOLGX.js";
|
|
85
|
+
import "./chunk-TWWSYAKJ.js";
|
|
86
|
+
import "./chunk-ZJUKFZ2P.js";
|
|
87
|
+
import "./chunk-HBBJFK6I.js";
|
|
88
|
+
import "./chunk-PJ3HDUCY.js";
|
|
89
|
+
import "./chunk-TQFG7HTI.js";
|
|
90
|
+
import "./chunk-GK4AIFIH.js";
|
|
91
|
+
import "./chunk-2PSPARWP.js";
|
|
92
|
+
import "./chunk-K4WIOZFP.js";
|
|
93
|
+
import "./chunk-XUXGIA7H.js";
|
|
94
|
+
import "./chunk-WERLJGIC.js";
|
|
95
|
+
import {
|
|
96
|
+
isDevMode
|
|
97
|
+
} from "./chunk-ISN5GRYI.js";
|
|
98
|
+
import "./chunk-FLWXXDNS.js";
|
|
99
|
+
import {
|
|
100
|
+
normalizeErrorMessage
|
|
101
|
+
} from "./chunk-KNU5COPB.js";
|
|
102
|
+
import {
|
|
103
|
+
buildNpxCommand
|
|
104
|
+
} from "./chunk-6BEFEWFB.js";
|
|
105
|
+
import "./chunk-3GXQPCJC.js";
|
|
106
|
+
import "./chunk-RQVDTPGD.js";
|
|
107
|
+
import "./chunk-PMRBLBUP.js";
|
|
108
|
+
import "./chunk-M2WBOQ2Q.js";
|
|
109
|
+
|
|
110
|
+
// src/commands/preview.ts
|
|
111
|
+
import { spawn } from "child_process";
|
|
112
|
+
import { existsSync as existsSync2, lstatSync, mkdirSync as mkdirSync2, readlinkSync, symlinkSync, unlinkSync } from "fs";
|
|
113
|
+
import { resolve as resolve2, dirname as dirname2, basename, join as join2 } from "path";
|
|
114
|
+
import { fileURLToPath } from "url";
|
|
115
|
+
import { createRequire } from "module";
|
|
116
|
+
|
|
117
|
+
// src/utils/studioProxyEnv.ts
|
|
118
|
+
function studioProxyEnv(autoProxy, baseEnv = process.env, preview) {
|
|
119
|
+
return {
|
|
120
|
+
...baseEnv,
|
|
121
|
+
HYPERFRAMES_AUTO_PROXY: autoProxy ? "true" : "false",
|
|
122
|
+
...preview ? {
|
|
123
|
+
HYPERFRAMES_PREVIEW_PROJECT_DIR: preview.projectDir,
|
|
124
|
+
HYPERFRAMES_PREVIEW_PROJECT_NAME: preview.projectName,
|
|
125
|
+
...preview.browserGpuMode ? { HYPERFRAMES_PREVIEW_BROWSER_GPU_MODE: preview.browserGpuMode } : {}
|
|
126
|
+
} : {}
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
// src/commands/previewLifecycle.ts
|
|
131
|
+
import { spawn as nodeSpawn } from "child_process";
|
|
132
|
+
import { createHash } from "crypto";
|
|
133
|
+
import {
|
|
134
|
+
closeSync,
|
|
135
|
+
existsSync,
|
|
136
|
+
mkdirSync,
|
|
137
|
+
openSync,
|
|
138
|
+
readFileSync,
|
|
139
|
+
readdirSync,
|
|
140
|
+
renameSync,
|
|
141
|
+
rmSync,
|
|
142
|
+
writeFileSync
|
|
143
|
+
} from "fs";
|
|
144
|
+
import { homedir } from "os";
|
|
145
|
+
import { dirname, join, resolve } from "path";
|
|
146
|
+
var PreviewPortUnavailableError = class extends Error {
|
|
147
|
+
requestedPort;
|
|
148
|
+
boundPort;
|
|
149
|
+
constructor(requestedPort, boundPort) {
|
|
150
|
+
super(
|
|
151
|
+
`Port ${requestedPort} is already in use; the background preview would have started on port ${boundPort} instead. Free port ${requestedPort}, pick another --port, or omit --port to accept the next free port.`
|
|
152
|
+
);
|
|
153
|
+
this.name = "PreviewPortUnavailableError";
|
|
154
|
+
this.requestedPort = requestedPort;
|
|
155
|
+
this.boundPort = boundPort;
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
function defaultStateHome() {
|
|
159
|
+
return process.env.XDG_STATE_HOME || join(homedir(), ".local", "state");
|
|
160
|
+
}
|
|
161
|
+
function normalized(path) {
|
|
162
|
+
const resolved = resolve(path).replace(/\\/g, "/");
|
|
163
|
+
return process.platform === "win32" ? resolved.toLowerCase() : resolved;
|
|
164
|
+
}
|
|
165
|
+
function sessionDirectory(stateHome = defaultStateHome()) {
|
|
166
|
+
return join(stateHome, "hyperframes", "previews");
|
|
167
|
+
}
|
|
168
|
+
function previewSessionPath(projectDir, stateHome = defaultStateHome()) {
|
|
169
|
+
const key = createHash("sha256").update(normalized(projectDir)).digest("hex").slice(0, 16);
|
|
170
|
+
return join(sessionDirectory(stateHome), `${key}.json`);
|
|
171
|
+
}
|
|
172
|
+
function previewLogPath(projectDir, stateHome = defaultStateHome()) {
|
|
173
|
+
return previewSessionPath(projectDir, stateHome).replace(/\.json$/, ".log");
|
|
174
|
+
}
|
|
175
|
+
function writePreviewSession(session, stateHome = defaultStateHome()) {
|
|
176
|
+
const path = previewSessionPath(session.projectDir, stateHome);
|
|
177
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
178
|
+
const temporary = `${path}.${process.pid}.tmp`;
|
|
179
|
+
try {
|
|
180
|
+
writeFileSync(temporary, `${JSON.stringify(session, null, 2)}
|
|
181
|
+
`, { mode: 384 });
|
|
182
|
+
renameSync(temporary, path);
|
|
183
|
+
} finally {
|
|
184
|
+
rmSync(temporary, { force: true });
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
function readPreviewSession(projectDir, stateHome = defaultStateHome()) {
|
|
188
|
+
const path = previewSessionPath(projectDir, stateHome);
|
|
189
|
+
if (!existsSync(path)) return null;
|
|
190
|
+
try {
|
|
191
|
+
const parsed = JSON.parse(readFileSync(path, "utf8"));
|
|
192
|
+
if (!Number.isInteger(parsed.pid) || parsed.pid <= 0 || normalized(parsed.projectDir) !== normalized(projectDir)) {
|
|
193
|
+
throw new Error("invalid preview session");
|
|
194
|
+
}
|
|
195
|
+
return parsed;
|
|
196
|
+
} catch {
|
|
197
|
+
rmSync(path, { force: true });
|
|
198
|
+
return null;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
function hasValidPreviewProcess(session) {
|
|
202
|
+
return Number.isInteger(session.pid) && session.pid > 0;
|
|
203
|
+
}
|
|
204
|
+
function hasValidPreviewEndpoint(session) {
|
|
205
|
+
return Number.isInteger(session.port) && session.port > 0 && session.port <= 65535;
|
|
206
|
+
}
|
|
207
|
+
function matchesPreviewSessionFile(session, path, stateHome) {
|
|
208
|
+
return typeof session.projectDir === "string" && typeof session.logPath === "string" && previewSessionPath(session.projectDir, stateHome) === path;
|
|
209
|
+
}
|
|
210
|
+
function readPreviewSessionFile(path, stateHome) {
|
|
211
|
+
try {
|
|
212
|
+
const parsed = JSON.parse(readFileSync(path, "utf8"));
|
|
213
|
+
if (!hasValidPreviewProcess(parsed) || !hasValidPreviewEndpoint(parsed) || !matchesPreviewSessionFile(parsed, path, stateHome)) {
|
|
214
|
+
throw new Error("invalid preview session");
|
|
215
|
+
}
|
|
216
|
+
return parsed;
|
|
217
|
+
} catch {
|
|
218
|
+
rmSync(path, { force: true });
|
|
219
|
+
return null;
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
function removePreviewSession(projectDir, stateHome = defaultStateHome()) {
|
|
223
|
+
rmSync(previewSessionPath(projectDir, stateHome), { force: true });
|
|
224
|
+
}
|
|
225
|
+
function matchingServer(servers, projectDir, browserGpuMode) {
|
|
226
|
+
return policyMatchingServers(servers, projectDir, browserGpuMode)[0] ?? null;
|
|
227
|
+
}
|
|
228
|
+
function policyMatchingServers(servers, projectDir, browserGpuMode) {
|
|
229
|
+
return sameProjectServers(servers, projectDir).filter(
|
|
230
|
+
(server) => browserGpuMode === void 0 || server.browserGpuMode === browserGpuMode
|
|
231
|
+
);
|
|
232
|
+
}
|
|
233
|
+
function matchingServerAtPort(servers, projectDir, port) {
|
|
234
|
+
return matchingServer(
|
|
235
|
+
servers.filter((server) => server.port === port),
|
|
236
|
+
projectDir
|
|
237
|
+
);
|
|
238
|
+
}
|
|
239
|
+
function sameProjectServers(servers, projectDir) {
|
|
240
|
+
const project = normalized(projectDir);
|
|
241
|
+
return servers.filter((server) => normalized(server.projectDir) === project);
|
|
242
|
+
}
|
|
243
|
+
function sameProjectPorts(servers, projectDir) {
|
|
244
|
+
return new Set(sameProjectServers(servers, projectDir).map((server) => server.port));
|
|
245
|
+
}
|
|
246
|
+
async function stopProcess(pid) {
|
|
247
|
+
await terminateProcessTree(pid);
|
|
248
|
+
}
|
|
249
|
+
var delay = (ms) => new Promise((done) => setTimeout(done, ms));
|
|
250
|
+
function spawnDetachedPreview(projectDir, stateHome, dependencies) {
|
|
251
|
+
const logPath = previewLogPath(projectDir, stateHome);
|
|
252
|
+
mkdirSync(dirname(logPath), { recursive: true });
|
|
253
|
+
const logFd = openSync(logPath, "a", 384);
|
|
254
|
+
const spawn2 = dependencies.spawn ?? nodeSpawn;
|
|
255
|
+
let child;
|
|
256
|
+
try {
|
|
257
|
+
child = spawn2(
|
|
258
|
+
dependencies.execPath ?? process.execPath,
|
|
259
|
+
buildBackgroundPreviewArgs(dependencies.argv ?? process.argv.slice(1)),
|
|
260
|
+
{
|
|
261
|
+
detached: true,
|
|
262
|
+
stdio: ["ignore", logFd, logFd],
|
|
263
|
+
env: process.env
|
|
264
|
+
}
|
|
265
|
+
);
|
|
266
|
+
} finally {
|
|
267
|
+
closeSync(logFd);
|
|
268
|
+
}
|
|
269
|
+
if (!child.pid) throw new Error("background preview child did not report a PID");
|
|
270
|
+
child.unref();
|
|
271
|
+
return {
|
|
272
|
+
pid: child.pid,
|
|
273
|
+
wrapperIdentity: (dependencies.identity ?? processIdentity)(child.pid) ?? void 0,
|
|
274
|
+
logPath
|
|
275
|
+
};
|
|
276
|
+
}
|
|
277
|
+
function startedServer(servers, projectDir, preLaunchPorts, launchedPid, dependencies) {
|
|
278
|
+
const isDescendant = dependencies.isDescendant ?? isProcessDescendant;
|
|
279
|
+
const ours = (server) => {
|
|
280
|
+
const pid = Number(server.pid);
|
|
281
|
+
return pid === launchedPid || isDescendant(pid, launchedPid);
|
|
282
|
+
};
|
|
283
|
+
const candidates = servers.filter((server) => !preLaunchPorts.has(server.port) && ours(server));
|
|
284
|
+
return matchingServer(candidates, projectDir, dependencies.browserGpuMode);
|
|
285
|
+
}
|
|
286
|
+
function buildBackgroundPreviewArgs(argv) {
|
|
287
|
+
const filtered = argv.filter(
|
|
288
|
+
(arg) => arg !== "--background" && !arg.startsWith("--background=") && arg !== "--foreground" && !arg.startsWith("--foreground=") && arg !== "--open" && arg !== "--no-open" && arg !== "--force-new" && arg !== "--json"
|
|
289
|
+
);
|
|
290
|
+
return [...filtered, "--foreground", "--no-open", "--force-new"];
|
|
291
|
+
}
|
|
292
|
+
async function readBackgroundPreviewStatus(projectDir, startPort, dependencies = {}) {
|
|
293
|
+
const scan = dependencies.scan ?? scanActiveServers;
|
|
294
|
+
const stateHome = dependencies.stateHome ?? defaultStateHome();
|
|
295
|
+
const saved = readPreviewSession(projectDir, stateHome);
|
|
296
|
+
const server = matchingServer(await scan(saved?.port ?? startPort), projectDir);
|
|
297
|
+
if (server) {
|
|
298
|
+
const pid = Number(server.pid ?? saved?.pid);
|
|
299
|
+
if (Number.isInteger(pid) && pid > 0) {
|
|
300
|
+
return {
|
|
301
|
+
pid,
|
|
302
|
+
port: server.port,
|
|
303
|
+
projectDir: resolve(projectDir),
|
|
304
|
+
logPath: saved?.logPath ?? previewLogPath(projectDir, stateHome)
|
|
305
|
+
};
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
if (saved && wrapperProcessIsAlive(saved, dependencies)) return null;
|
|
309
|
+
removePreviewSession(projectDir, stateHome);
|
|
310
|
+
return null;
|
|
311
|
+
}
|
|
312
|
+
function processIsSignalable(pid) {
|
|
313
|
+
try {
|
|
314
|
+
process.kill(pid, 0);
|
|
315
|
+
return true;
|
|
316
|
+
} catch (error) {
|
|
317
|
+
return error?.code === "EPERM";
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
function wrapperProcessIsAlive(saved, dependencies) {
|
|
321
|
+
if (!saved.wrapperIdentity) return false;
|
|
322
|
+
const signalable = dependencies.isSignalable ?? processIsSignalable;
|
|
323
|
+
if (!signalable(saved.pid)) return false;
|
|
324
|
+
const identity = (dependencies.identity ?? processIdentity)(saved.pid);
|
|
325
|
+
if (identity === null) return true;
|
|
326
|
+
return identity === saved.wrapperIdentity;
|
|
327
|
+
}
|
|
328
|
+
async function listBackgroundPreviewStatuses(dependencies = {}) {
|
|
329
|
+
const stateHome = dependencies.stateHome ?? defaultStateHome();
|
|
330
|
+
const directory = sessionDirectory(stateHome);
|
|
331
|
+
let files;
|
|
332
|
+
try {
|
|
333
|
+
files = readdirSync(directory).filter((name) => name.endsWith(".json")).map((name) => join(directory, name));
|
|
334
|
+
} catch {
|
|
335
|
+
return [];
|
|
336
|
+
}
|
|
337
|
+
const saved = files.map((path) => readPreviewSessionFile(path, stateHome)).filter((session) => session !== null);
|
|
338
|
+
const statuses = await Promise.all(
|
|
339
|
+
saved.map(
|
|
340
|
+
(session) => readBackgroundPreviewStatus(session.projectDir, session.port, {
|
|
341
|
+
...dependencies,
|
|
342
|
+
stateHome
|
|
343
|
+
})
|
|
344
|
+
)
|
|
345
|
+
);
|
|
346
|
+
return statuses.filter((status) => status !== null);
|
|
347
|
+
}
|
|
348
|
+
function readyPreviewSession(server, pid, wrapperIdentity, projectDir, logPath, dependencies) {
|
|
349
|
+
const identity = wrapperIdentity ?? (dependencies.identity ?? processIdentity)(pid) ?? void 0;
|
|
350
|
+
const liveServerPid = Number(server.pid);
|
|
351
|
+
return {
|
|
352
|
+
session: {
|
|
353
|
+
pid,
|
|
354
|
+
wrapperIdentity: identity,
|
|
355
|
+
port: server.port,
|
|
356
|
+
projectDir: resolve(projectDir),
|
|
357
|
+
logPath
|
|
358
|
+
},
|
|
359
|
+
publicPid: Number.isInteger(liveServerPid) && liveServerPid > 0 ? liveServerPid : pid
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
function ownedStopTargetPid(saved, liveServerPid, dependencies) {
|
|
363
|
+
if (!saved?.wrapperIdentity) return liveServerPid;
|
|
364
|
+
const identity = dependencies.identity ?? processIdentity;
|
|
365
|
+
if (identity(saved.pid) !== saved.wrapperIdentity) return liveServerPid;
|
|
366
|
+
if (saved.pid === liveServerPid) return saved.pid;
|
|
367
|
+
const isDescendant = dependencies.isDescendant ?? isProcessDescendant;
|
|
368
|
+
return isDescendant(liveServerPid, saved.pid) ? saved.pid : liveServerPid;
|
|
369
|
+
}
|
|
370
|
+
async function stopOwnedPreviewBeforeReplacement(owned, projectDir, dependencies) {
|
|
371
|
+
if (!owned) return;
|
|
372
|
+
await stopBackgroundPreview(projectDir, owned.port, dependencies);
|
|
373
|
+
}
|
|
374
|
+
function savedOwnedPreview(servers, saved, projectDir) {
|
|
375
|
+
if (!saved) return null;
|
|
376
|
+
const savedPortServers = servers.filter((server) => server.port === saved.port);
|
|
377
|
+
return matchingServer(savedPortServers, projectDir);
|
|
378
|
+
}
|
|
379
|
+
async function readPreviewLifecycleState(projectDir, startPort, dependencies) {
|
|
380
|
+
const scan = dependencies.scan ?? scanActiveServers;
|
|
381
|
+
const stateHome = dependencies.stateHome ?? defaultStateHome();
|
|
382
|
+
const saved = readPreviewSession(projectDir, stateHome);
|
|
383
|
+
const scanStart = saved?.port ?? startPort;
|
|
384
|
+
const scanned = await scan(scanStart);
|
|
385
|
+
return { scan, stateHome, saved, scanStart, scanned };
|
|
386
|
+
}
|
|
387
|
+
function unmetPreferredPort(port, preferredPort) {
|
|
388
|
+
return preferredPort !== void 0 && port !== preferredPort ? preferredPort : void 0;
|
|
389
|
+
}
|
|
390
|
+
function reuseExistingPreview(reusableExisting, candidates, dependencies) {
|
|
391
|
+
if (!reusableExisting || dependencies.forceNew) return null;
|
|
392
|
+
const unmet = unmetPreferredPort(reusableExisting.port, dependencies.preferredPort);
|
|
393
|
+
if (unmet !== void 0) {
|
|
394
|
+
throw new PreviewServerPortMismatchError(
|
|
395
|
+
unmet,
|
|
396
|
+
candidates,
|
|
397
|
+
` To start one on port ${unmet} instead, add --force-new or run --stop first.`
|
|
398
|
+
);
|
|
399
|
+
}
|
|
400
|
+
return {
|
|
401
|
+
type: "reused",
|
|
402
|
+
port: reusableExisting.port,
|
|
403
|
+
pid: reusableExisting.pid ? Number(reusableExisting.pid) : null,
|
|
404
|
+
logPath: null
|
|
405
|
+
};
|
|
406
|
+
}
|
|
407
|
+
async function addPreferredPortServer(scanned, scanStart, dependencies) {
|
|
408
|
+
const preferred = dependencies.preferredPort;
|
|
409
|
+
if (preferred === void 0) return;
|
|
410
|
+
if (preferred >= scanStart && preferred < scanStart + MAX_PORT_SCAN) return;
|
|
411
|
+
const server = await (dependencies.probe ?? activeServerOnPort)(preferred);
|
|
412
|
+
if (server) scanned.push(server);
|
|
413
|
+
}
|
|
414
|
+
async function startBackgroundPreview(projectDir, startPort, dependencies = {}) {
|
|
415
|
+
const { scan, stateHome, saved, scanStart, scanned } = await readPreviewLifecycleState(
|
|
416
|
+
projectDir,
|
|
417
|
+
startPort,
|
|
418
|
+
dependencies
|
|
419
|
+
);
|
|
420
|
+
await addPreferredPortServer(scanned, scanStart, dependencies);
|
|
421
|
+
const candidates = policyMatchingServers(scanned, projectDir, dependencies.browserGpuMode);
|
|
422
|
+
const onPreferredPort = candidates.find((server2) => server2.port === dependencies.preferredPort) ?? null;
|
|
423
|
+
const requestedExisting = candidates[0] ?? null;
|
|
424
|
+
const ownedExisting = savedOwnedPreview(scanned, saved, projectDir);
|
|
425
|
+
const reusableOwned = ownedExisting ? matchingServer([ownedExisting], projectDir, dependencies.browserGpuMode) : null;
|
|
426
|
+
const reusableExisting = onPreferredPort ?? reusableOwned ?? (ownedExisting ? null : requestedExisting);
|
|
427
|
+
const reused = reuseExistingPreview(reusableExisting, candidates, dependencies);
|
|
428
|
+
if (reused) return reused;
|
|
429
|
+
await stopOwnedPreviewBeforeReplacement(ownedExisting, projectDir, dependencies);
|
|
430
|
+
const preLaunchPorts = sameProjectPorts(await scan(startPort), projectDir);
|
|
431
|
+
const { pid, wrapperIdentity, logPath } = spawnDetachedPreview(
|
|
432
|
+
projectDir,
|
|
433
|
+
stateHome,
|
|
434
|
+
dependencies
|
|
435
|
+
);
|
|
436
|
+
const kill = dependencies.kill ?? stopProcess;
|
|
437
|
+
const server = await awaitStartedServer(projectDir, startPort, preLaunchPorts, pid, dependencies);
|
|
438
|
+
if (!server) {
|
|
439
|
+
await kill(pid);
|
|
440
|
+
throw new Error(`background preview did not become ready; see ${logPath}`);
|
|
441
|
+
}
|
|
442
|
+
const unmet = unmetPreferredPort(server.port, dependencies.preferredPort);
|
|
443
|
+
if (unmet !== void 0) {
|
|
444
|
+
await kill(pid);
|
|
445
|
+
if (!await awaitServerGone(projectDir, startPort, server.port, dependencies)) {
|
|
446
|
+
throw new Error(
|
|
447
|
+
`background preview on port ${server.port} did not stop after failing to bind port ${unmet}; see ${logPath}`
|
|
448
|
+
);
|
|
449
|
+
}
|
|
450
|
+
throw new PreviewPortUnavailableError(unmet, server.port);
|
|
451
|
+
}
|
|
452
|
+
const ready = readyPreviewSession(
|
|
453
|
+
server,
|
|
454
|
+
pid,
|
|
455
|
+
wrapperIdentity,
|
|
456
|
+
projectDir,
|
|
457
|
+
logPath,
|
|
458
|
+
dependencies
|
|
459
|
+
);
|
|
460
|
+
writePreviewSession(ready.session, stateHome);
|
|
461
|
+
return {
|
|
462
|
+
type: "started",
|
|
463
|
+
...ready.session,
|
|
464
|
+
pid: ready.publicPid
|
|
465
|
+
};
|
|
466
|
+
}
|
|
467
|
+
async function awaitStartedServer(projectDir, startPort, preLaunchPorts, launchedPid, dependencies) {
|
|
468
|
+
const scan = dependencies.scan ?? scanActiveServers;
|
|
469
|
+
const sleep = dependencies.sleep ?? delay;
|
|
470
|
+
for (let attempt = 0; attempt < 50; attempt++) {
|
|
471
|
+
const server = startedServer(
|
|
472
|
+
await scan(startPort),
|
|
473
|
+
projectDir,
|
|
474
|
+
preLaunchPorts,
|
|
475
|
+
launchedPid,
|
|
476
|
+
dependencies
|
|
477
|
+
);
|
|
478
|
+
if (server) return server;
|
|
479
|
+
await sleep(200);
|
|
480
|
+
}
|
|
481
|
+
return null;
|
|
482
|
+
}
|
|
483
|
+
async function stopBackgroundPreview(projectDir, startPort, dependencies = {}) {
|
|
484
|
+
const { stateHome, saved, scanStart, scanned } = await readPreviewLifecycleState(
|
|
485
|
+
projectDir,
|
|
486
|
+
startPort,
|
|
487
|
+
dependencies
|
|
488
|
+
);
|
|
489
|
+
const server = saved ? matchingServerAtPort(scanned, projectDir, saved.port) : matchingServer(scanned, projectDir);
|
|
490
|
+
if (!server) {
|
|
491
|
+
removePreviewSession(projectDir, stateHome);
|
|
492
|
+
return false;
|
|
493
|
+
}
|
|
494
|
+
const pid = Number(server.pid);
|
|
495
|
+
if (!Number.isInteger(pid) || pid <= 0) {
|
|
496
|
+
throw new Error(`preview ownership could not be proven for ${resolve(projectDir)}`);
|
|
497
|
+
}
|
|
498
|
+
const kill = dependencies.kill ?? stopProcess;
|
|
499
|
+
await kill(ownedStopTargetPid(saved, pid, dependencies));
|
|
500
|
+
if (!await awaitServerGone(projectDir, scanStart, server.port, dependencies)) {
|
|
501
|
+
throw new Error(`background preview did not stop for ${resolve(projectDir)}`);
|
|
502
|
+
}
|
|
503
|
+
removePreviewSession(projectDir, stateHome);
|
|
504
|
+
return true;
|
|
505
|
+
}
|
|
506
|
+
async function awaitServerGone(projectDir, scanStart, port, dependencies) {
|
|
507
|
+
const scan = dependencies.scan ?? scanActiveServers;
|
|
508
|
+
const sleep = dependencies.sleep ?? delay;
|
|
509
|
+
for (let attempt = 0; attempt < 25; attempt++) {
|
|
510
|
+
if (!matchingServerAtPort(await scan(scanStart), projectDir, port)) return true;
|
|
511
|
+
await sleep(100);
|
|
512
|
+
}
|
|
513
|
+
return false;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
// src/commands/previewLifecycleOutput.ts
|
|
517
|
+
function lifecyclePayload(operation, result) {
|
|
518
|
+
return { schemaVersion: 1, operation, ok: true, result };
|
|
519
|
+
}
|
|
520
|
+
function lifecycleFailurePayload(operation, code, message) {
|
|
521
|
+
return { schemaVersion: 1, operation, ok: false, error: { code, message } };
|
|
522
|
+
}
|
|
523
|
+
function writeLifecycleJson(payload) {
|
|
524
|
+
console.log(JSON.stringify(payload));
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
// src/commands/preview.ts
|
|
528
|
+
var examples = [
|
|
529
|
+
["Preview the current project", "hyperframes preview"],
|
|
530
|
+
["Print the current Studio selection as JSON", "hyperframes preview --selection --json"],
|
|
531
|
+
["Print current Studio context as JSON", "hyperframes preview --context --json"],
|
|
532
|
+
["Preview a specific project directory", "hyperframes preview ./my-video"],
|
|
533
|
+
["Use a custom port", "hyperframes preview --port 8080"],
|
|
534
|
+
["Force a new server even if one is already running", "hyperframes preview --force-new"],
|
|
535
|
+
["Keep preview running after this command exits", "hyperframes preview --background"],
|
|
536
|
+
["Force an attached preview in a non-interactive shell", "hyperframes preview --foreground"],
|
|
537
|
+
["Show the background preview for this project", "hyperframes preview --status"],
|
|
538
|
+
["Stop the background preview for this project", "hyperframes preview --stop"],
|
|
539
|
+
["Start without opening the browser", "hyperframes preview --no-open"],
|
|
540
|
+
["Open with a specific browser", "hyperframes preview --browser-path /usr/bin/chromium"],
|
|
541
|
+
[
|
|
542
|
+
"Open with CDP enabled (requires browser path + isolated profile)",
|
|
543
|
+
"hyperframes preview --browser-path /usr/bin/chromium --user-data-dir /tmp/hf-profile --remote-debugging-port 9222"
|
|
544
|
+
],
|
|
545
|
+
["List all active preview servers", "hyperframes preview --list"],
|
|
546
|
+
["Kill all active preview servers", "hyperframes preview --kill-all"],
|
|
547
|
+
[
|
|
548
|
+
"Disable auto-proxying of browser-hostile video codecs (HEVC, ProRes, AV1)",
|
|
549
|
+
"hyperframes preview --no-proxy"
|
|
550
|
+
],
|
|
551
|
+
[
|
|
552
|
+
"Show full lint findings on startup instead of the summary line",
|
|
553
|
+
"hyperframes preview --lint-verbose"
|
|
554
|
+
]
|
|
555
|
+
];
|
|
556
|
+
var STUDIO_CHILD_SHUTDOWN_SIGNALS = ["SIGINT", "SIGTERM", "SIGHUP"];
|
|
557
|
+
var DEFAULT_CONTEXT_FIELDS = ["server", "selection", "lint", "capabilities"];
|
|
558
|
+
var PREVIEW_PORT_MISMATCH_CODE = "preview-port-mismatch";
|
|
559
|
+
function backgroundStartFailureCode(error) {
|
|
560
|
+
if (error instanceof PreviewServerPortMismatchError) return PREVIEW_PORT_MISMATCH_CODE;
|
|
561
|
+
if (error instanceof PreviewPortUnavailableError) return "preview-port-unavailable";
|
|
562
|
+
return "preview-start-failed";
|
|
563
|
+
}
|
|
564
|
+
var preview_default = defineCommand({
|
|
565
|
+
meta: {
|
|
566
|
+
name: "preview",
|
|
567
|
+
description: "Start the studio for previewing compositions"
|
|
568
|
+
},
|
|
569
|
+
args: {
|
|
570
|
+
dir: {
|
|
571
|
+
type: "positional",
|
|
572
|
+
description: "Project directory",
|
|
573
|
+
required: false
|
|
574
|
+
},
|
|
575
|
+
port: {
|
|
576
|
+
type: "string",
|
|
577
|
+
description: "Port to run the preview server on",
|
|
578
|
+
default: "3002"
|
|
579
|
+
},
|
|
580
|
+
"force-new": {
|
|
581
|
+
type: "boolean",
|
|
582
|
+
description: "Start a new server even if one is already running for this project",
|
|
583
|
+
default: false
|
|
584
|
+
},
|
|
585
|
+
background: {
|
|
586
|
+
type: "boolean",
|
|
587
|
+
description: "Start a preview that remains running after the command exits",
|
|
588
|
+
default: false
|
|
589
|
+
},
|
|
590
|
+
foreground: {
|
|
591
|
+
type: "boolean",
|
|
592
|
+
description: "Keep preview attached even when the shell is non-interactive",
|
|
593
|
+
default: false
|
|
594
|
+
},
|
|
595
|
+
status: {
|
|
596
|
+
type: "boolean",
|
|
597
|
+
description: "Show the background preview for this project and exit",
|
|
598
|
+
default: false
|
|
599
|
+
},
|
|
600
|
+
stop: {
|
|
601
|
+
type: "boolean",
|
|
602
|
+
description: "Stop the background preview for this project and exit",
|
|
603
|
+
default: false
|
|
604
|
+
},
|
|
605
|
+
list: {
|
|
606
|
+
type: "boolean",
|
|
607
|
+
description: "List all active preview servers and exit",
|
|
608
|
+
default: false
|
|
609
|
+
},
|
|
610
|
+
"kill-all": {
|
|
611
|
+
type: "boolean",
|
|
612
|
+
description: "Kill all active preview servers and exit",
|
|
613
|
+
default: false
|
|
614
|
+
},
|
|
615
|
+
"lint-verbose": {
|
|
616
|
+
type: "boolean",
|
|
617
|
+
description: "Show full lint findings on startup (default: a one-line summary)",
|
|
618
|
+
default: false
|
|
619
|
+
},
|
|
620
|
+
open: {
|
|
621
|
+
type: "boolean",
|
|
622
|
+
default: true,
|
|
623
|
+
description: "Open browser automatically"
|
|
624
|
+
},
|
|
625
|
+
selection: {
|
|
626
|
+
type: "boolean",
|
|
627
|
+
description: "Print the current element selected in a running Studio preview and exit",
|
|
628
|
+
default: false
|
|
629
|
+
},
|
|
630
|
+
json: {
|
|
631
|
+
type: "boolean",
|
|
632
|
+
description: "Output selection, context, or managed lifecycle state as JSON",
|
|
633
|
+
default: false
|
|
634
|
+
},
|
|
635
|
+
context: {
|
|
636
|
+
type: "boolean",
|
|
637
|
+
description: "Print the current agent-readable context from a running Studio preview and exit",
|
|
638
|
+
default: false
|
|
639
|
+
},
|
|
640
|
+
"context-fields": {
|
|
641
|
+
type: "string",
|
|
642
|
+
description: "Comma-separated context fields to include: server,selection,lint,capabilities (only with --context)"
|
|
643
|
+
},
|
|
644
|
+
"context-detail": {
|
|
645
|
+
type: "string",
|
|
646
|
+
description: "Context payload detail: compact or full (only with --context)",
|
|
647
|
+
default: "compact"
|
|
648
|
+
},
|
|
649
|
+
"browser-path": {
|
|
650
|
+
type: "string",
|
|
651
|
+
description: "Path to the browser executable to open"
|
|
652
|
+
},
|
|
653
|
+
"user-data-dir": {
|
|
654
|
+
type: "string",
|
|
655
|
+
description: "Chromium-compatible user data directory (requires --browser-path)"
|
|
656
|
+
},
|
|
657
|
+
"remote-debugging-port": {
|
|
658
|
+
type: "string",
|
|
659
|
+
description: "Chromium remote debugging port (requires --browser-path and --user-data-dir)"
|
|
660
|
+
},
|
|
661
|
+
"browser-no-gpu": {
|
|
662
|
+
type: "boolean",
|
|
663
|
+
default: false,
|
|
664
|
+
description: "Launch the opened browser with --disable-gpu (requires --browser-path). For hosts where hardware acceleration crashes the graphics driver (e.g. NVIDIA Xid resets); with the system default browser use --no-open instead."
|
|
665
|
+
},
|
|
666
|
+
"browser-gpu": {
|
|
667
|
+
type: "boolean",
|
|
668
|
+
description: "Use hardware GPU for Studio thumbnails and frame capture; pass --no-browser-gpu for deterministic SwiftShader (default: auto-detect)",
|
|
669
|
+
default: void 0
|
|
670
|
+
},
|
|
671
|
+
proxy: {
|
|
672
|
+
type: "boolean",
|
|
673
|
+
description: "Auto-transcode browser-hostile video codecs (HEVC, ProRes, AV1) to a cached authoring proxy for preview (default: on; overrides hyperframes.json's media.autoProxy)",
|
|
674
|
+
negativeDescription: "Disable auto-proxying of browser-hostile video codecs"
|
|
675
|
+
}
|
|
676
|
+
},
|
|
677
|
+
async run({ args }) {
|
|
678
|
+
const launchModeError = previewLaunchModeError({
|
|
679
|
+
background: Boolean(args.background),
|
|
680
|
+
foreground: Boolean(args.foreground),
|
|
681
|
+
forceNew: Boolean(args["force-new"]),
|
|
682
|
+
status: Boolean(args.status),
|
|
683
|
+
stop: Boolean(args.stop),
|
|
684
|
+
list: Boolean(args.list),
|
|
685
|
+
killAll: Boolean(args["kill-all"])
|
|
686
|
+
});
|
|
687
|
+
if (launchModeError) {
|
|
688
|
+
if (args.json) {
|
|
689
|
+
writeLifecycleJson(
|
|
690
|
+
lifecycleFailurePayload(
|
|
691
|
+
args.status ? "status" : args.stop ? "stop" : args.list ? "list" : args["kill-all"] ? "kill-all" : "start",
|
|
692
|
+
"conflicting-lifecycle-flags",
|
|
693
|
+
launchModeError
|
|
694
|
+
)
|
|
695
|
+
);
|
|
696
|
+
} else {
|
|
697
|
+
R.error(launchModeError);
|
|
698
|
+
}
|
|
699
|
+
setCommandExitCode(1);
|
|
700
|
+
return;
|
|
701
|
+
}
|
|
702
|
+
const portError = previewPortError(args.port);
|
|
703
|
+
if (portError) {
|
|
704
|
+
reportPreviewFailure(
|
|
705
|
+
Boolean(args.json),
|
|
706
|
+
args.status ? "status" : args.stop ? "stop" : args.list ? "list" : args["kill-all"] ? "kill-all" : "start",
|
|
707
|
+
"preview-validation-failed",
|
|
708
|
+
portError
|
|
709
|
+
);
|
|
710
|
+
return;
|
|
711
|
+
}
|
|
712
|
+
const browserGpuMode = resolveLocalBrowserGpuMode(args["browser-gpu"]);
|
|
713
|
+
if (args["browser-gpu"] === true) process.env.PRODUCER_BROWSER_GPU_MODE = "hardware";
|
|
714
|
+
if (args["browser-gpu"] === false) process.env.PRODUCER_BROWSER_GPU_MODE = "software";
|
|
715
|
+
const startPort = parseInt(args.port ?? "3002", 10);
|
|
716
|
+
const explicitPort = hasExplicitPreviewPort(process.argv) ? startPort : void 0;
|
|
717
|
+
if (args.status || args.stop) {
|
|
718
|
+
try {
|
|
719
|
+
const project2 = args.json ? resolveProjectOrThrow(args.dir) : resolveProject(args.dir);
|
|
720
|
+
if (args.stop) {
|
|
721
|
+
const stopped = await stopBackgroundPreview(project2.dir, startPort);
|
|
722
|
+
if (args.json) {
|
|
723
|
+
writeLifecycleJson(
|
|
724
|
+
lifecyclePayload(
|
|
725
|
+
"stop",
|
|
726
|
+
stopped ? { state: "stopped", projectDir: project2.dir } : { state: "not-running", projectDir: project2.dir }
|
|
727
|
+
)
|
|
728
|
+
);
|
|
729
|
+
} else {
|
|
730
|
+
console.log(
|
|
731
|
+
stopped ? `
|
|
732
|
+
${c.success("Stopped background preview")} ${c.dim(project2.dir)}
|
|
733
|
+
` : `
|
|
734
|
+
${c.dim("No background preview is running for")} ${project2.dir}
|
|
735
|
+
`
|
|
736
|
+
);
|
|
737
|
+
}
|
|
738
|
+
return;
|
|
739
|
+
}
|
|
740
|
+
const status = await readBackgroundPreviewStatus(project2.dir, startPort);
|
|
741
|
+
if (!status) {
|
|
742
|
+
if (args.json) {
|
|
743
|
+
writeLifecycleJson(
|
|
744
|
+
lifecyclePayload("status", {
|
|
745
|
+
state: "not-running",
|
|
746
|
+
projectDir: project2.dir
|
|
747
|
+
})
|
|
748
|
+
);
|
|
749
|
+
} else {
|
|
750
|
+
console.log(`
|
|
751
|
+
${c.dim("No background preview is running for")} ${project2.dir}
|
|
752
|
+
`);
|
|
753
|
+
}
|
|
754
|
+
return;
|
|
755
|
+
}
|
|
756
|
+
if (args.json) {
|
|
757
|
+
writeLifecycleJson(
|
|
758
|
+
lifecyclePayload(
|
|
759
|
+
"status",
|
|
760
|
+
previewLifecycleSession({
|
|
761
|
+
state: "running",
|
|
762
|
+
mode: "background",
|
|
763
|
+
projectName: project2.name,
|
|
764
|
+
projectDir: project2.dir,
|
|
765
|
+
port: status.port,
|
|
766
|
+
pid: status.pid,
|
|
767
|
+
logPath: status.logPath
|
|
768
|
+
})
|
|
769
|
+
)
|
|
770
|
+
);
|
|
771
|
+
return;
|
|
772
|
+
}
|
|
773
|
+
printStudioSummary(project2.name, previewBaseUrl(status.port), project2.dir, {
|
|
774
|
+
details: [`Background preview running (PID ${status.pid}).`, `Log: ${status.logPath}`]
|
|
775
|
+
});
|
|
776
|
+
return;
|
|
777
|
+
} catch (error) {
|
|
778
|
+
reportPreviewFailure(
|
|
779
|
+
Boolean(args.json),
|
|
780
|
+
args.stop ? "stop" : "status",
|
|
781
|
+
args.stop ? "preview-stop-failed" : "preview-status-failed",
|
|
782
|
+
normalizeErrorMessage(error)
|
|
783
|
+
);
|
|
784
|
+
return;
|
|
785
|
+
}
|
|
786
|
+
}
|
|
787
|
+
if (args.list) {
|
|
788
|
+
await handlePreviewList(startPort, Boolean(args.json));
|
|
789
|
+
return;
|
|
790
|
+
}
|
|
791
|
+
if (args["kill-all"]) {
|
|
792
|
+
await handlePreviewKillAll(startPort, Boolean(args.json));
|
|
793
|
+
return;
|
|
794
|
+
}
|
|
795
|
+
if (args.context) {
|
|
796
|
+
const project2 = resolveProject(args.dir);
|
|
797
|
+
return printCurrentContext(project2.dir, startPort, {
|
|
798
|
+
json: Boolean(args.json),
|
|
799
|
+
fields: args["context-fields"],
|
|
800
|
+
detail: args["context-detail"],
|
|
801
|
+
preferredPort: explicitPort
|
|
802
|
+
});
|
|
803
|
+
}
|
|
804
|
+
if (args.selection) {
|
|
805
|
+
const project2 = resolveProject(args.dir);
|
|
806
|
+
return printCurrentSelection(project2.dir, startPort, Boolean(args.json), explicitPort);
|
|
807
|
+
}
|
|
808
|
+
const rawArg = args.dir;
|
|
809
|
+
const isImplicitCwd = !rawArg || rawArg === "." || rawArg === "./";
|
|
810
|
+
let project;
|
|
811
|
+
try {
|
|
812
|
+
project = args.json ? resolveProjectOrThrow(rawArg) : resolveProject(rawArg);
|
|
813
|
+
} catch (error) {
|
|
814
|
+
reportPreviewFailure(
|
|
815
|
+
Boolean(args.json),
|
|
816
|
+
"start",
|
|
817
|
+
"preview-start-failed",
|
|
818
|
+
normalizeErrorMessage(error)
|
|
819
|
+
);
|
|
820
|
+
return;
|
|
821
|
+
}
|
|
822
|
+
const dir = project.dir;
|
|
823
|
+
const projectName = isImplicitCwd ? basename(process.env.PWD ?? dir) : project.name;
|
|
824
|
+
if (args["user-data-dir"] && !args["browser-path"]) {
|
|
825
|
+
reportPreviewFailure(
|
|
826
|
+
Boolean(args.json),
|
|
827
|
+
"start",
|
|
828
|
+
"preview-validation-failed",
|
|
829
|
+
"--user-data-dir requires --browser-path"
|
|
830
|
+
);
|
|
831
|
+
return;
|
|
832
|
+
}
|
|
833
|
+
const depsError = validateRemoteDebuggingPortDeps({
|
|
834
|
+
browserPath: args["browser-path"],
|
|
835
|
+
userDataDir: args["user-data-dir"],
|
|
836
|
+
remoteDebuggingPort: args["remote-debugging-port"]
|
|
837
|
+
});
|
|
838
|
+
if (depsError) {
|
|
839
|
+
reportPreviewFailure(Boolean(args.json), "start", "preview-validation-failed", depsError);
|
|
840
|
+
return;
|
|
841
|
+
}
|
|
842
|
+
const noOpen = !args.open;
|
|
843
|
+
const browserPath = args["browser-path"];
|
|
844
|
+
const browserNoGpu = !!args["browser-no-gpu"];
|
|
845
|
+
if (browserNoGpu && !browserPath) {
|
|
846
|
+
reportPreviewFailure(
|
|
847
|
+
Boolean(args.json),
|
|
848
|
+
"start",
|
|
849
|
+
"preview-validation-failed",
|
|
850
|
+
"--browser-no-gpu requires --browser-path (the system default browser cannot receive Chromium flags \u2014 use --no-open on GPU-unstable hosts)"
|
|
851
|
+
);
|
|
852
|
+
return;
|
|
853
|
+
}
|
|
854
|
+
const userDataDir = args["user-data-dir"];
|
|
855
|
+
let remoteDebuggingPort;
|
|
856
|
+
try {
|
|
857
|
+
remoteDebuggingPort = parseRemoteDebuggingPort(
|
|
858
|
+
args["remote-debugging-port"]
|
|
859
|
+
);
|
|
860
|
+
} catch (err) {
|
|
861
|
+
reportPreviewFailure(
|
|
862
|
+
Boolean(args.json),
|
|
863
|
+
"start",
|
|
864
|
+
"preview-validation-failed",
|
|
865
|
+
err.message
|
|
866
|
+
);
|
|
867
|
+
return;
|
|
868
|
+
}
|
|
869
|
+
const autoProxy = resolveAutoProxy(dir, args.proxy);
|
|
870
|
+
const orphansKilled = killOrphanedProcesses();
|
|
871
|
+
if (orphansKilled > 0 && !args.json) {
|
|
872
|
+
console.log(
|
|
873
|
+
` ${c.dim(`Cleaned up ${orphansKilled} orphaned process${orphansKilled === 1 ? "" : "es"} from a previous session.`)}`
|
|
874
|
+
);
|
|
875
|
+
}
|
|
876
|
+
const startupLint = args.json ? null : printStartupLint(dir, Boolean(args["lint-verbose"]));
|
|
877
|
+
const launchMode = previewLaunchMode({
|
|
878
|
+
background: Boolean(args.background),
|
|
879
|
+
foreground: Boolean(args.foreground),
|
|
880
|
+
interactive: Boolean(process.stdin.isTTY && process.stdout.isTTY),
|
|
881
|
+
devMode: isDevMode(),
|
|
882
|
+
localStudio: hasLocalStudio(dir)
|
|
883
|
+
});
|
|
884
|
+
if (launchMode === "background") {
|
|
885
|
+
let background;
|
|
886
|
+
try {
|
|
887
|
+
background = await startBackgroundPreview(dir, startPort, {
|
|
888
|
+
forceNew: Boolean(args["force-new"]),
|
|
889
|
+
// A bare launch promises same-project reuse, regardless of the mode
|
|
890
|
+
// the existing managed server resolved earlier. Only an explicit
|
|
891
|
+
// --browser-gpu/--no-browser-gpu request authorizes replacement.
|
|
892
|
+
browserGpuMode: args["browser-gpu"] === void 0 ? void 0 : browserGpuMode,
|
|
893
|
+
preferredPort: explicitPort
|
|
894
|
+
});
|
|
895
|
+
} catch (error) {
|
|
896
|
+
const message = normalizeErrorMessage(error);
|
|
897
|
+
if (args.json) {
|
|
898
|
+
writeLifecycleJson(
|
|
899
|
+
lifecycleFailurePayload("start", backgroundStartFailureCode(error), message)
|
|
900
|
+
);
|
|
901
|
+
} else {
|
|
902
|
+
R.error(message);
|
|
903
|
+
}
|
|
904
|
+
setCommandExitCode(1);
|
|
905
|
+
return;
|
|
906
|
+
}
|
|
907
|
+
const url = `http://localhost:${background.port}`;
|
|
908
|
+
if (args.json) {
|
|
909
|
+
writeLifecycleJson(
|
|
910
|
+
lifecyclePayload(
|
|
911
|
+
"start",
|
|
912
|
+
previewLifecycleSession({
|
|
913
|
+
state: background.type,
|
|
914
|
+
mode: "background",
|
|
915
|
+
projectName,
|
|
916
|
+
projectDir: dir,
|
|
917
|
+
port: background.port,
|
|
918
|
+
pid: background.pid,
|
|
919
|
+
...background.logPath ? { logPath: background.logPath } : {}
|
|
920
|
+
})
|
|
921
|
+
)
|
|
922
|
+
);
|
|
923
|
+
} else {
|
|
924
|
+
ge(c.bold("hyperframes preview"));
|
|
925
|
+
printStudioSummary(projectName, url, dir, {
|
|
926
|
+
details: [
|
|
927
|
+
background.type === "reused" ? "Reusing the background server already running for this project." : `Running in the background. Log: ${background.logPath}`,
|
|
928
|
+
"Changes reload automatically in the studio."
|
|
929
|
+
],
|
|
930
|
+
footer: `Stop with: hyperframes preview ${JSON.stringify(dir)} --stop`
|
|
931
|
+
});
|
|
932
|
+
}
|
|
933
|
+
openStudioBrowser(url, projectName, {
|
|
934
|
+
noOpen,
|
|
935
|
+
browserPath,
|
|
936
|
+
userDataDir,
|
|
937
|
+
remoteDebuggingPort,
|
|
938
|
+
browserNoGpu
|
|
939
|
+
});
|
|
940
|
+
await startupLint;
|
|
941
|
+
return;
|
|
942
|
+
}
|
|
943
|
+
if (launchMode === "dev") {
|
|
944
|
+
return runDevMode(dir, {
|
|
945
|
+
projectName,
|
|
946
|
+
noOpen,
|
|
947
|
+
browserPath,
|
|
948
|
+
userDataDir,
|
|
949
|
+
remoteDebuggingPort,
|
|
950
|
+
browserNoGpu,
|
|
951
|
+
autoProxy,
|
|
952
|
+
browserGpuMode,
|
|
953
|
+
port: startPort,
|
|
954
|
+
json: Boolean(args.json)
|
|
955
|
+
});
|
|
956
|
+
}
|
|
957
|
+
if (launchMode === "local") {
|
|
958
|
+
return runLocalStudioMode(dir, {
|
|
959
|
+
projectName,
|
|
960
|
+
noOpen,
|
|
961
|
+
browserPath,
|
|
962
|
+
userDataDir,
|
|
963
|
+
remoteDebuggingPort,
|
|
964
|
+
browserNoGpu,
|
|
965
|
+
autoProxy,
|
|
966
|
+
browserGpuMode,
|
|
967
|
+
port: startPort,
|
|
968
|
+
json: Boolean(args.json)
|
|
969
|
+
});
|
|
970
|
+
}
|
|
971
|
+
const forceNew = !!args["force-new"];
|
|
972
|
+
return runEmbeddedMode(dir, startPort, {
|
|
973
|
+
projectName,
|
|
974
|
+
forceNew,
|
|
975
|
+
autoProxy,
|
|
976
|
+
noOpen,
|
|
977
|
+
browserPath,
|
|
978
|
+
userDataDir,
|
|
979
|
+
remoteDebuggingPort,
|
|
980
|
+
browserNoGpu,
|
|
981
|
+
browserGpuMode,
|
|
982
|
+
json: Boolean(args.json)
|
|
983
|
+
});
|
|
984
|
+
}
|
|
985
|
+
});
|
|
986
|
+
async function printStartupLint(dir, verbose) {
|
|
987
|
+
try {
|
|
988
|
+
const lintResult = await runRenderSetupWorker(
|
|
989
|
+
"lint",
|
|
990
|
+
{ projectDir: dir },
|
|
991
|
+
{ maxBufferBytes: 8 * 1024 * 1024 }
|
|
992
|
+
);
|
|
993
|
+
if (lintResult.totalErrors === 0 && lintResult.totalWarnings === 0) return;
|
|
994
|
+
console.log();
|
|
995
|
+
for (const line of formatLintStartupMessage(
|
|
996
|
+
lintResult,
|
|
997
|
+
verbose ? { kind: "verbose" } : { kind: "summary", pointer: "studio" }
|
|
998
|
+
))
|
|
999
|
+
console.log(line);
|
|
1000
|
+
console.log();
|
|
1001
|
+
} catch (error) {
|
|
1002
|
+
R.warn(`Lint did not finish: ${normalizeErrorMessage(error)}`);
|
|
1003
|
+
}
|
|
1004
|
+
}
|
|
1005
|
+
function previewLaunchMode(options) {
|
|
1006
|
+
if (options.background) return "background";
|
|
1007
|
+
if (!options.foreground && !options.interactive) return "background";
|
|
1008
|
+
if (options.devMode) return "dev";
|
|
1009
|
+
return options.localStudio ? "local" : "embedded";
|
|
1010
|
+
}
|
|
1011
|
+
function previewLaunchModeError(options) {
|
|
1012
|
+
if (options.background && options.foreground) {
|
|
1013
|
+
return "--background and --foreground cannot be used together";
|
|
1014
|
+
}
|
|
1015
|
+
const actionCount = [options.status, options.stop, options.list, options.killAll].filter(
|
|
1016
|
+
Boolean
|
|
1017
|
+
).length;
|
|
1018
|
+
if (actionCount > 1) {
|
|
1019
|
+
return "Only one of --status, --stop, --list, or --kill-all can be used at a time";
|
|
1020
|
+
}
|
|
1021
|
+
if (actionCount > 0 && (options.background || options.foreground || options.forceNew)) {
|
|
1022
|
+
return "Preview launch overrides cannot be combined with lifecycle actions";
|
|
1023
|
+
}
|
|
1024
|
+
return null;
|
|
1025
|
+
}
|
|
1026
|
+
function previewPortError(port) {
|
|
1027
|
+
const value = port ?? "3002";
|
|
1028
|
+
if (!/^\d+$/.test(value)) return "--port must be an integer between 1 and 65535";
|
|
1029
|
+
const parsed = Number(value);
|
|
1030
|
+
return parsed >= 1 && parsed <= 65535 ? null : "--port must be an integer between 1 and 65535";
|
|
1031
|
+
}
|
|
1032
|
+
function publicPreviewPid(serverPid, fallbackPid) {
|
|
1033
|
+
const parsed = Number(serverPid);
|
|
1034
|
+
return Number.isInteger(parsed) && parsed > 0 ? parsed : fallbackPid;
|
|
1035
|
+
}
|
|
1036
|
+
function reportPreviewFailure(json, operation, code, message) {
|
|
1037
|
+
if (json) writeLifecycleJson(lifecycleFailurePayload(operation, code, message));
|
|
1038
|
+
else R.error(message);
|
|
1039
|
+
setCommandExitCode(1);
|
|
1040
|
+
}
|
|
1041
|
+
async function handlePreviewList(startPort, json, dependencies = {}) {
|
|
1042
|
+
try {
|
|
1043
|
+
const [scannedServers, managedSessions] = await Promise.all([
|
|
1044
|
+
(dependencies.scan ?? scanActiveServers)(startPort),
|
|
1045
|
+
(dependencies.listManaged ?? listBackgroundPreviewStatuses)()
|
|
1046
|
+
]);
|
|
1047
|
+
const managedKeys = new Set(
|
|
1048
|
+
managedSessions.map((session) => `${resolve2(session.projectDir)}\0${session.port}`)
|
|
1049
|
+
);
|
|
1050
|
+
const servers = [
|
|
1051
|
+
...managedSessions.map((session) => ({
|
|
1052
|
+
port: session.port,
|
|
1053
|
+
host: "127.0.0.1",
|
|
1054
|
+
projectName: basename(session.projectDir),
|
|
1055
|
+
projectDir: session.projectDir,
|
|
1056
|
+
version: "managed",
|
|
1057
|
+
pid: String(session.pid)
|
|
1058
|
+
})),
|
|
1059
|
+
...scannedServers.filter(
|
|
1060
|
+
(server) => !managedKeys.has(`${resolve2(server.projectDir)}\0${server.port}`)
|
|
1061
|
+
)
|
|
1062
|
+
];
|
|
1063
|
+
if (json) {
|
|
1064
|
+
writeLifecycleJson(
|
|
1065
|
+
lifecyclePayload("list", {
|
|
1066
|
+
state: "listed",
|
|
1067
|
+
sessions: servers.map(
|
|
1068
|
+
(server) => previewLifecycleSession({
|
|
1069
|
+
state: "running",
|
|
1070
|
+
mode: server.version === "managed" ? "background" : "unknown",
|
|
1071
|
+
projectName: server.projectName,
|
|
1072
|
+
projectDir: server.projectDir,
|
|
1073
|
+
port: server.port,
|
|
1074
|
+
pid: server.pid ? Number(server.pid) : null,
|
|
1075
|
+
host: server.host
|
|
1076
|
+
})
|
|
1077
|
+
)
|
|
1078
|
+
})
|
|
1079
|
+
);
|
|
1080
|
+
return;
|
|
1081
|
+
}
|
|
1082
|
+
if (servers.length === 0) {
|
|
1083
|
+
console.log("\n No active preview servers found.\n");
|
|
1084
|
+
return;
|
|
1085
|
+
}
|
|
1086
|
+
console.log(`
|
|
1087
|
+
${c.bold("Active preview servers:")}
|
|
1088
|
+
`);
|
|
1089
|
+
for (const server of servers) {
|
|
1090
|
+
const pid = server.pid ? c.dim(` (PID ${server.pid})`) : "";
|
|
1091
|
+
console.log(
|
|
1092
|
+
` ${c.accent(`Port ${server.port}`)} ${server.projectName} ${c.dim(server.projectDir)}${pid}`
|
|
1093
|
+
);
|
|
1094
|
+
}
|
|
1095
|
+
console.log(`
|
|
1096
|
+
${servers.length} server${servers.length === 1 ? "" : "s"} running.
|
|
1097
|
+
`);
|
|
1098
|
+
} catch (error) {
|
|
1099
|
+
reportPreviewFailure(json, "list", "preview-list-failed", normalizeErrorMessage(error));
|
|
1100
|
+
}
|
|
1101
|
+
}
|
|
1102
|
+
async function handlePreviewKillAll(startPort, json, dependencies = {}) {
|
|
1103
|
+
try {
|
|
1104
|
+
const managedSessions = await (dependencies.listManaged ?? listBackgroundPreviewStatuses)();
|
|
1105
|
+
let killed = 0;
|
|
1106
|
+
const failures = [];
|
|
1107
|
+
for (const session of managedSessions) {
|
|
1108
|
+
try {
|
|
1109
|
+
if (await (dependencies.stopManaged ?? stopBackgroundPreview)(
|
|
1110
|
+
session.projectDir,
|
|
1111
|
+
session.port
|
|
1112
|
+
)) {
|
|
1113
|
+
killed++;
|
|
1114
|
+
}
|
|
1115
|
+
} catch (error) {
|
|
1116
|
+
failures.push(`${session.projectDir}: ${normalizeErrorMessage(error)}`);
|
|
1117
|
+
}
|
|
1118
|
+
}
|
|
1119
|
+
const swept = await (dependencies.killScanned ?? killActiveServers)(startPort);
|
|
1120
|
+
killed += swept.killed;
|
|
1121
|
+
const unverified = swept.unverified;
|
|
1122
|
+
if (json) {
|
|
1123
|
+
writeLifecycleJson(
|
|
1124
|
+
lifecyclePayload("kill-all", {
|
|
1125
|
+
state: "killed-all",
|
|
1126
|
+
stopped: killed,
|
|
1127
|
+
...failures.length > 0 ? { failed: failures } : {},
|
|
1128
|
+
...unverified.length > 0 ? { unverifiedPorts: unverified } : {}
|
|
1129
|
+
})
|
|
1130
|
+
);
|
|
1131
|
+
} else if (failures.length > 0 || unverified.length > 0) {
|
|
1132
|
+
console.log(`
|
|
1133
|
+
Killed ${killed} preview server${killed === 1 ? "" : "s"}.`);
|
|
1134
|
+
for (const failure of failures) R.warn(`Could not stop ${failure}`);
|
|
1135
|
+
if (unverified.length > 0) {
|
|
1136
|
+
const plural = unverified.length === 1 ? "" : "s";
|
|
1137
|
+
R.warn(
|
|
1138
|
+
`Left ${unverified.length} server${plural} alone (port${plural} ${unverified.join(", ")}): the OS could not confirm which process owns the socket, and the server's own claim is not proof. Install lsof, or stop it with its own preview --stop.`
|
|
1139
|
+
);
|
|
1140
|
+
}
|
|
1141
|
+
console.log();
|
|
1142
|
+
} else if (killed === 0) {
|
|
1143
|
+
console.log("\n No active preview servers to kill.\n");
|
|
1144
|
+
} else {
|
|
1145
|
+
console.log(`
|
|
1146
|
+
Killed ${killed} preview server${killed === 1 ? "" : "s"}.
|
|
1147
|
+
`);
|
|
1148
|
+
}
|
|
1149
|
+
} catch (error) {
|
|
1150
|
+
reportPreviewFailure(json, "kill-all", "preview-kill-all-failed", normalizeErrorMessage(error));
|
|
1151
|
+
}
|
|
1152
|
+
}
|
|
1153
|
+
function previewViteArgs(port) {
|
|
1154
|
+
return ["--host", "127.0.0.1", ...port === void 0 ? [] : ["--port", String(port)]];
|
|
1155
|
+
}
|
|
1156
|
+
function previewBaseUrl(port, host = "127.0.0.1") {
|
|
1157
|
+
return `http://${host}:${port}`;
|
|
1158
|
+
}
|
|
1159
|
+
function absolutePreviewUrl(port, path, host = "127.0.0.1") {
|
|
1160
|
+
if (/^https?:\/\//.test(path)) return path;
|
|
1161
|
+
return `${previewBaseUrl(port, host)}${path.startsWith("/") ? path : `/${path}`}`;
|
|
1162
|
+
}
|
|
1163
|
+
function hasExplicitPreviewPort(argv) {
|
|
1164
|
+
return argv.some((arg) => arg === "--port" || arg.startsWith("--port="));
|
|
1165
|
+
}
|
|
1166
|
+
function printSelectionFailure(code, message, json) {
|
|
1167
|
+
if (json) {
|
|
1168
|
+
console.log(JSON.stringify({ ok: false, error: { code, message } }, null, 2));
|
|
1169
|
+
} else {
|
|
1170
|
+
R.error(message);
|
|
1171
|
+
}
|
|
1172
|
+
setCommandExitCode(1);
|
|
1173
|
+
}
|
|
1174
|
+
function previewServerPayload(server) {
|
|
1175
|
+
return {
|
|
1176
|
+
port: server.port,
|
|
1177
|
+
projectName: server.projectName,
|
|
1178
|
+
projectDir: server.projectDir,
|
|
1179
|
+
url: previewBaseUrl(server.port, server.host)
|
|
1180
|
+
};
|
|
1181
|
+
}
|
|
1182
|
+
function parseContextFields(value) {
|
|
1183
|
+
if (value === void 0) return DEFAULT_CONTEXT_FIELDS;
|
|
1184
|
+
if (!value.trim()) throw new Error("--context-fields cannot be empty");
|
|
1185
|
+
const allowed = new Set(DEFAULT_CONTEXT_FIELDS);
|
|
1186
|
+
const fields = value.split(",").map((field) => field.trim()).filter(Boolean);
|
|
1187
|
+
const invalid = fields.filter((field) => !allowed.has(field));
|
|
1188
|
+
if (invalid.length > 0) {
|
|
1189
|
+
throw new Error(
|
|
1190
|
+
`Unknown context field${invalid.length === 1 ? "" : "s"}: ${invalid.join(", ")}`
|
|
1191
|
+
);
|
|
1192
|
+
}
|
|
1193
|
+
return [...new Set(fields)];
|
|
1194
|
+
}
|
|
1195
|
+
function contextIncludes(fields, field) {
|
|
1196
|
+
return fields.includes(field);
|
|
1197
|
+
}
|
|
1198
|
+
function addContextError(payload, field, error) {
|
|
1199
|
+
payload.errors = {
|
|
1200
|
+
...payload.errors ?? {},
|
|
1201
|
+
[field]: error
|
|
1202
|
+
};
|
|
1203
|
+
}
|
|
1204
|
+
async function printCurrentSelection(projectDir, startPort, json, preferredPort) {
|
|
1205
|
+
const {
|
|
1206
|
+
AmbiguousPreviewServerError,
|
|
1207
|
+
PreviewServerPortMismatchError: PreviewServerPortMismatchError2,
|
|
1208
|
+
fetchStudioSelection,
|
|
1209
|
+
findPreviewServerForProject
|
|
1210
|
+
} = await import("./studioSelectionClient-IUUPKUHZ.js");
|
|
1211
|
+
let server;
|
|
1212
|
+
try {
|
|
1213
|
+
server = await findPreviewServerForProject(
|
|
1214
|
+
projectDir,
|
|
1215
|
+
startPort,
|
|
1216
|
+
void 0,
|
|
1217
|
+
void 0,
|
|
1218
|
+
preferredPort === void 0 ? void 0 : { preferredPort }
|
|
1219
|
+
);
|
|
1220
|
+
} catch (err) {
|
|
1221
|
+
if (err instanceof AmbiguousPreviewServerError) {
|
|
1222
|
+
printSelectionFailure("ambiguous-preview-server", err.message, json);
|
|
1223
|
+
return;
|
|
1224
|
+
}
|
|
1225
|
+
if (err instanceof PreviewServerPortMismatchError2) {
|
|
1226
|
+
printSelectionFailure(PREVIEW_PORT_MISMATCH_CODE, err.message, json);
|
|
1227
|
+
return;
|
|
1228
|
+
}
|
|
1229
|
+
throw err;
|
|
1230
|
+
}
|
|
1231
|
+
if (!server) {
|
|
1232
|
+
printSelectionFailure(
|
|
1233
|
+
"preview-not-running",
|
|
1234
|
+
"No running Studio preview found for this project. Start one with: npx hyperframes preview",
|
|
1235
|
+
json
|
|
1236
|
+
);
|
|
1237
|
+
return;
|
|
1238
|
+
}
|
|
1239
|
+
let response;
|
|
1240
|
+
try {
|
|
1241
|
+
response = await fetchStudioSelection(server);
|
|
1242
|
+
} catch (err) {
|
|
1243
|
+
printSelectionFailure("selection-unavailable", normalizeErrorMessage(err), json);
|
|
1244
|
+
return;
|
|
1245
|
+
}
|
|
1246
|
+
if (!response.selection) {
|
|
1247
|
+
printSelectionFailure(
|
|
1248
|
+
"no-selection",
|
|
1249
|
+
"Studio is running, but no element is selected. Select an element in Studio and rerun this command.",
|
|
1250
|
+
json
|
|
1251
|
+
);
|
|
1252
|
+
return;
|
|
1253
|
+
}
|
|
1254
|
+
const selection = {
|
|
1255
|
+
...response.selection,
|
|
1256
|
+
thumbnailUrl: absolutePreviewUrl(server.port, response.selection.thumbnailUrl, server.host)
|
|
1257
|
+
};
|
|
1258
|
+
if (json) {
|
|
1259
|
+
console.log(
|
|
1260
|
+
JSON.stringify(
|
|
1261
|
+
{
|
|
1262
|
+
ok: true,
|
|
1263
|
+
server: previewServerPayload(server),
|
|
1264
|
+
selection,
|
|
1265
|
+
updatedAt: response.updatedAt
|
|
1266
|
+
},
|
|
1267
|
+
null,
|
|
1268
|
+
2
|
|
1269
|
+
)
|
|
1270
|
+
);
|
|
1271
|
+
return;
|
|
1272
|
+
}
|
|
1273
|
+
console.log(`${c.success("\u25C7")} ${c.accent(selection.label)} selected in Studio`);
|
|
1274
|
+
console.log(` ${c.dim("Source")} ${selection.sourceFile}`);
|
|
1275
|
+
console.log(
|
|
1276
|
+
` ${c.dim("Target")} ${selection.target.hfId ?? selection.target.id ?? selection.target.selector ?? "(none)"}`
|
|
1277
|
+
);
|
|
1278
|
+
console.log(` ${c.dim("Time")} ${selection.currentTime.toFixed(3)}s`);
|
|
1279
|
+
console.log(` ${c.dim("Thumbnail")} ${selection.thumbnailUrl}`);
|
|
1280
|
+
console.log();
|
|
1281
|
+
console.log(c.dim("Use --json for the full agent-readable selection payload."));
|
|
1282
|
+
}
|
|
1283
|
+
function countLintFindings(findings) {
|
|
1284
|
+
return {
|
|
1285
|
+
errors: findings.filter((finding) => finding.severity === "error").length,
|
|
1286
|
+
warnings: findings.filter((finding) => finding.severity === "warning").length
|
|
1287
|
+
};
|
|
1288
|
+
}
|
|
1289
|
+
async function printCurrentContext(projectDir, startPort, options) {
|
|
1290
|
+
let fields;
|
|
1291
|
+
try {
|
|
1292
|
+
fields = parseContextFields(options.fields);
|
|
1293
|
+
} catch (err) {
|
|
1294
|
+
printSelectionFailure("invalid-context-fields", normalizeErrorMessage(err), options.json);
|
|
1295
|
+
return;
|
|
1296
|
+
}
|
|
1297
|
+
const fullDetail = options.detail === "full";
|
|
1298
|
+
if (options.detail !== void 0 && !["compact", "full"].includes(options.detail)) {
|
|
1299
|
+
printSelectionFailure(
|
|
1300
|
+
"invalid-context-detail",
|
|
1301
|
+
"--context-detail must be compact or full",
|
|
1302
|
+
options.json
|
|
1303
|
+
);
|
|
1304
|
+
return;
|
|
1305
|
+
}
|
|
1306
|
+
const {
|
|
1307
|
+
AmbiguousPreviewServerError,
|
|
1308
|
+
PreviewServerPortMismatchError: PreviewServerPortMismatchError2,
|
|
1309
|
+
fetchStudioLint,
|
|
1310
|
+
fetchStudioSelection,
|
|
1311
|
+
findPreviewServerForProject
|
|
1312
|
+
} = await import("./studioSelectionClient-IUUPKUHZ.js");
|
|
1313
|
+
let server;
|
|
1314
|
+
try {
|
|
1315
|
+
server = await findPreviewServerForProject(
|
|
1316
|
+
projectDir,
|
|
1317
|
+
startPort,
|
|
1318
|
+
void 0,
|
|
1319
|
+
void 0,
|
|
1320
|
+
options.preferredPort === void 0 ? void 0 : { preferredPort: options.preferredPort }
|
|
1321
|
+
);
|
|
1322
|
+
} catch (err) {
|
|
1323
|
+
if (err instanceof AmbiguousPreviewServerError) {
|
|
1324
|
+
printSelectionFailure("ambiguous-preview-server", err.message, options.json);
|
|
1325
|
+
return;
|
|
1326
|
+
}
|
|
1327
|
+
if (err instanceof PreviewServerPortMismatchError2) {
|
|
1328
|
+
printSelectionFailure(PREVIEW_PORT_MISMATCH_CODE, err.message, options.json);
|
|
1329
|
+
return;
|
|
1330
|
+
}
|
|
1331
|
+
throw err;
|
|
1332
|
+
}
|
|
1333
|
+
if (!server) {
|
|
1334
|
+
printSelectionFailure(
|
|
1335
|
+
"preview-not-running",
|
|
1336
|
+
"No running Studio preview found for this project. Start one with: npx hyperframes preview",
|
|
1337
|
+
options.json
|
|
1338
|
+
);
|
|
1339
|
+
return;
|
|
1340
|
+
}
|
|
1341
|
+
const wantsSelection = contextIncludes(fields, "selection");
|
|
1342
|
+
const wantsLint = contextIncludes(fields, "lint");
|
|
1343
|
+
const [selectionResult, lintResult] = await Promise.allSettled([
|
|
1344
|
+
wantsSelection ? fetchStudioSelection(server) : Promise.resolve(null),
|
|
1345
|
+
wantsLint ? fetchStudioLint(server) : Promise.resolve(null)
|
|
1346
|
+
]);
|
|
1347
|
+
const selection = selectionResult.status === "fulfilled" && selectionResult.value?.selection ? {
|
|
1348
|
+
ok: true,
|
|
1349
|
+
value: fullDetail ? {
|
|
1350
|
+
...selectionResult.value.selection,
|
|
1351
|
+
thumbnailUrl: absolutePreviewUrl(
|
|
1352
|
+
server.port,
|
|
1353
|
+
selectionResult.value.selection.thumbnailUrl
|
|
1354
|
+
)
|
|
1355
|
+
} : compactSelectionPayload({
|
|
1356
|
+
...selectionResult.value.selection,
|
|
1357
|
+
thumbnailUrl: absolutePreviewUrl(
|
|
1358
|
+
server.port,
|
|
1359
|
+
selectionResult.value.selection.thumbnailUrl
|
|
1360
|
+
)
|
|
1361
|
+
}),
|
|
1362
|
+
updatedAt: selectionResult.value.updatedAt
|
|
1363
|
+
} : {
|
|
1364
|
+
ok: false,
|
|
1365
|
+
error: selectionResult.status === "rejected" ? {
|
|
1366
|
+
code: "selection-unavailable",
|
|
1367
|
+
message: normalizeErrorMessage(selectionResult.reason)
|
|
1368
|
+
} : {
|
|
1369
|
+
code: "no-selection",
|
|
1370
|
+
message: "Studio is running, but no element is selected."
|
|
1371
|
+
}
|
|
1372
|
+
};
|
|
1373
|
+
const lint = lintResult.status === "fulfilled" && lintResult.value ? {
|
|
1374
|
+
ok: true,
|
|
1375
|
+
summary: countLintFindings(lintResult.value.findings),
|
|
1376
|
+
findings: lintResult.value.findings
|
|
1377
|
+
} : {
|
|
1378
|
+
ok: false,
|
|
1379
|
+
error: lintResult.status === "rejected" ? {
|
|
1380
|
+
code: "lint-unavailable",
|
|
1381
|
+
message: normalizeErrorMessage(lintResult.reason)
|
|
1382
|
+
} : {
|
|
1383
|
+
code: "lint-not-requested",
|
|
1384
|
+
message: "Lint was not requested."
|
|
1385
|
+
}
|
|
1386
|
+
};
|
|
1387
|
+
const payload = { ok: true };
|
|
1388
|
+
if (contextIncludes(fields, "server")) payload.server = previewServerPayload(server);
|
|
1389
|
+
if (contextIncludes(fields, "selection")) {
|
|
1390
|
+
payload.selection = selection.ok ? selection.value : null;
|
|
1391
|
+
payload.selectionUpdatedAt = selection.ok ? selection.updatedAt : null;
|
|
1392
|
+
if (!selection.ok) addContextError(payload, "selection", selection.error);
|
|
1393
|
+
}
|
|
1394
|
+
if (contextIncludes(fields, "lint")) payload.lint = lint;
|
|
1395
|
+
if (contextIncludes(fields, "capabilities")) {
|
|
1396
|
+
payload.capabilities = {
|
|
1397
|
+
selection: true,
|
|
1398
|
+
lint: true,
|
|
1399
|
+
frame: false,
|
|
1400
|
+
visibleElements: false,
|
|
1401
|
+
lastAction: false
|
|
1402
|
+
};
|
|
1403
|
+
}
|
|
1404
|
+
if (options.json) {
|
|
1405
|
+
console.log(JSON.stringify(payload, null, 2));
|
|
1406
|
+
return;
|
|
1407
|
+
}
|
|
1408
|
+
console.log(`${c.success("\u25C7")} Studio context`);
|
|
1409
|
+
if (contextIncludes(fields, "server")) {
|
|
1410
|
+
console.log(` ${c.dim("Project")} ${server.projectName}`);
|
|
1411
|
+
console.log(` ${c.dim("Studio")} ${previewBaseUrl(server.port, server.host)}`);
|
|
1412
|
+
}
|
|
1413
|
+
if (contextIncludes(fields, "selection")) {
|
|
1414
|
+
if (selection.ok) {
|
|
1415
|
+
console.log(` ${c.dim("Selection")} ${selection.value.label}`);
|
|
1416
|
+
} else {
|
|
1417
|
+
console.log(` ${c.dim("Selection")} ${selection.error.message}`);
|
|
1418
|
+
}
|
|
1419
|
+
}
|
|
1420
|
+
if (contextIncludes(fields, "lint")) {
|
|
1421
|
+
if (lint.ok) {
|
|
1422
|
+
console.log(
|
|
1423
|
+
` ${c.dim("Lint")} ${lint.summary.errors} error(s), ${lint.summary.warnings} warning(s)`
|
|
1424
|
+
);
|
|
1425
|
+
} else {
|
|
1426
|
+
console.log(` ${c.dim("Lint")} ${lint.error.message}`);
|
|
1427
|
+
}
|
|
1428
|
+
}
|
|
1429
|
+
console.log();
|
|
1430
|
+
console.log(c.dim("Use --json for the full agent-readable context payload."));
|
|
1431
|
+
}
|
|
1432
|
+
function compactSelectionPayload(selection) {
|
|
1433
|
+
return {
|
|
1434
|
+
schemaVersion: selection.schemaVersion,
|
|
1435
|
+
projectId: selection.projectId,
|
|
1436
|
+
compositionPath: selection.compositionPath,
|
|
1437
|
+
sourceFile: selection.sourceFile,
|
|
1438
|
+
currentTime: selection.currentTime,
|
|
1439
|
+
target: selection.target,
|
|
1440
|
+
label: selection.label,
|
|
1441
|
+
tagName: selection.tagName,
|
|
1442
|
+
boundingBox: selection.boundingBox,
|
|
1443
|
+
textContent: selection.textContent,
|
|
1444
|
+
thumbnailUrl: selection.thumbnailUrl
|
|
1445
|
+
};
|
|
1446
|
+
}
|
|
1447
|
+
function studioDeepLink(url, projectName) {
|
|
1448
|
+
return `${url}/#project/${encodeURIComponent(projectName)}`;
|
|
1449
|
+
}
|
|
1450
|
+
function studioSummaryUrls(projectName, serverUrl) {
|
|
1451
|
+
return {
|
|
1452
|
+
serverUrl,
|
|
1453
|
+
studioUrl: studioDeepLink(serverUrl, projectName)
|
|
1454
|
+
};
|
|
1455
|
+
}
|
|
1456
|
+
function prebuildPreview(fetchApp, serverUrl, projectName) {
|
|
1457
|
+
const previewUrl = `${serverUrl}/api/projects/${encodeURIComponent(projectName)}/preview`;
|
|
1458
|
+
return Promise.resolve().then(() => fetchApp(new Request(previewUrl))).catch(() => void 0);
|
|
1459
|
+
}
|
|
1460
|
+
function foregroundPreviewReadyPayload(projectName, serverUrl, projectDir, pid) {
|
|
1461
|
+
const port = Number(new URL(serverUrl).port);
|
|
1462
|
+
return lifecyclePayload(
|
|
1463
|
+
"start",
|
|
1464
|
+
previewLifecycleSession({
|
|
1465
|
+
state: "started",
|
|
1466
|
+
mode: "foreground",
|
|
1467
|
+
projectName,
|
|
1468
|
+
projectDir,
|
|
1469
|
+
port,
|
|
1470
|
+
pid
|
|
1471
|
+
})
|
|
1472
|
+
);
|
|
1473
|
+
}
|
|
1474
|
+
function previewLifecycleSession(options) {
|
|
1475
|
+
const host = options.host ?? "127.0.0.1";
|
|
1476
|
+
const serverUrl = previewBaseUrl(options.port, host);
|
|
1477
|
+
return {
|
|
1478
|
+
state: options.state,
|
|
1479
|
+
mode: options.mode,
|
|
1480
|
+
projectName: options.projectName,
|
|
1481
|
+
projectDir: options.projectDir,
|
|
1482
|
+
host,
|
|
1483
|
+
port: options.port,
|
|
1484
|
+
pid: options.pid,
|
|
1485
|
+
serverUrl,
|
|
1486
|
+
studioUrl: studioDeepLink(serverUrl, options.projectName),
|
|
1487
|
+
ready: true,
|
|
1488
|
+
...options.logPath ? { logPath: options.logPath } : {}
|
|
1489
|
+
};
|
|
1490
|
+
}
|
|
1491
|
+
function openStudioBrowser(url, projectName, options) {
|
|
1492
|
+
if (options?.noOpen) return;
|
|
1493
|
+
openBrowser(studioDeepLink(url, projectName), {
|
|
1494
|
+
browserPath: options?.browserPath,
|
|
1495
|
+
userDataDir: options?.userDataDir,
|
|
1496
|
+
remoteDebuggingPort: options?.remoteDebuggingPort,
|
|
1497
|
+
disableGpu: options?.browserNoGpu
|
|
1498
|
+
});
|
|
1499
|
+
}
|
|
1500
|
+
function printStudioSummary(projectName, serverUrl, projectDir, opts = {}) {
|
|
1501
|
+
const urls = studioSummaryUrls(projectName, serverUrl);
|
|
1502
|
+
console.log();
|
|
1503
|
+
console.log(` ${c.dim("Project")} ${c.accent(projectName)}`);
|
|
1504
|
+
console.log(` ${c.dim("Studio")} ${c.accent(urls.studioUrl)}`);
|
|
1505
|
+
console.log(` ${c.dim("Server")} ${c.accent(urls.serverUrl)}`);
|
|
1506
|
+
const hint = desktopHint(projectDir);
|
|
1507
|
+
if (hint) console.log(` ${c.dim("Desktop")} ${hint}`);
|
|
1508
|
+
console.log();
|
|
1509
|
+
for (const detail of opts.details ?? []) {
|
|
1510
|
+
console.log(` ${c.dim(detail)}`);
|
|
1511
|
+
}
|
|
1512
|
+
if (opts.details?.length && opts.footer) console.log();
|
|
1513
|
+
if (opts.footer) console.log(` ${c.dim(opts.footer)}`);
|
|
1514
|
+
console.log();
|
|
1515
|
+
}
|
|
1516
|
+
function linkProjectIntoStudioData(dir, projectsDir, projectName) {
|
|
1517
|
+
const symlinkPath = join2(projectsDir, projectName);
|
|
1518
|
+
mkdirSync2(projectsDir, { recursive: true });
|
|
1519
|
+
let createdSymlink = false;
|
|
1520
|
+
if (dir !== symlinkPath) {
|
|
1521
|
+
if (existsSync2(symlinkPath)) {
|
|
1522
|
+
try {
|
|
1523
|
+
const stat = lstatSync(symlinkPath);
|
|
1524
|
+
if (stat.isSymbolicLink() && resolve2(readlinkSync(symlinkPath)) !== resolve2(dir)) {
|
|
1525
|
+
unlinkSync(symlinkPath);
|
|
1526
|
+
}
|
|
1527
|
+
} catch {
|
|
1528
|
+
}
|
|
1529
|
+
}
|
|
1530
|
+
if (!existsSync2(symlinkPath)) {
|
|
1531
|
+
symlinkSync(dir, symlinkPath, process.platform === "win32" ? "junction" : "dir");
|
|
1532
|
+
createdSymlink = true;
|
|
1533
|
+
}
|
|
1534
|
+
}
|
|
1535
|
+
return { symlinkPath, createdSymlink };
|
|
1536
|
+
}
|
|
1537
|
+
function removeSymlinkOnExit(createdSymlink, symlinkPath) {
|
|
1538
|
+
if (!createdSymlink) return;
|
|
1539
|
+
process.on("exit", () => {
|
|
1540
|
+
try {
|
|
1541
|
+
if (existsSync2(symlinkPath)) unlinkSync(symlinkPath);
|
|
1542
|
+
} catch {
|
|
1543
|
+
}
|
|
1544
|
+
});
|
|
1545
|
+
}
|
|
1546
|
+
function waitForStudioChildClose(child, signalTarget = process) {
|
|
1547
|
+
const shutdown = () => {
|
|
1548
|
+
if (child.pid) killProcessTree(child.pid);
|
|
1549
|
+
};
|
|
1550
|
+
for (const signal of STUDIO_CHILD_SHUTDOWN_SIGNALS) signalTarget.once(signal, shutdown);
|
|
1551
|
+
const closed = child.exitCode !== null || child.signalCode !== null ? Promise.resolve() : new Promise((resolveClose) => {
|
|
1552
|
+
child.once("exit", () => resolveClose());
|
|
1553
|
+
});
|
|
1554
|
+
return closed.finally(() => {
|
|
1555
|
+
for (const signal of STUDIO_CHILD_SHUTDOWN_SIGNALS) signalTarget.off(signal, shutdown);
|
|
1556
|
+
});
|
|
1557
|
+
}
|
|
1558
|
+
function attachStudioReadyHandler(child, spinner, projectName, projectDir, options) {
|
|
1559
|
+
let detected = false;
|
|
1560
|
+
async function handleOutput(data) {
|
|
1561
|
+
const url = studioReadyUrl(data.toString());
|
|
1562
|
+
if (!url || detected) return;
|
|
1563
|
+
detected = true;
|
|
1564
|
+
if (options?.json) {
|
|
1565
|
+
const port = Number(new URL(url).port);
|
|
1566
|
+
const server = await activeServerOnPort(port);
|
|
1567
|
+
writeLifecycleJson(
|
|
1568
|
+
foregroundPreviewReadyPayload(
|
|
1569
|
+
projectName,
|
|
1570
|
+
url,
|
|
1571
|
+
projectDir,
|
|
1572
|
+
publicPreviewPid(server?.pid, child.pid ?? null)
|
|
1573
|
+
)
|
|
1574
|
+
);
|
|
1575
|
+
} else {
|
|
1576
|
+
spinner.stop(c.success("Studio running"));
|
|
1577
|
+
printStudioSummary(projectName, url, projectDir, {
|
|
1578
|
+
footer: "Press Ctrl+C to stop"
|
|
1579
|
+
});
|
|
1580
|
+
}
|
|
1581
|
+
openStudioBrowser(url, projectName, options);
|
|
1582
|
+
child.stdout.removeListener("data", handleOutput);
|
|
1583
|
+
child.stderr.removeListener("data", handleOutput);
|
|
1584
|
+
}
|
|
1585
|
+
child.stdout.on("data", (data) => void handleOutput(data));
|
|
1586
|
+
child.stderr.on("data", (data) => void handleOutput(data));
|
|
1587
|
+
child.on("error", (err) => {
|
|
1588
|
+
if (options?.json) {
|
|
1589
|
+
reportPreviewFailure(true, "start", "preview-start-failed", err.message);
|
|
1590
|
+
} else {
|
|
1591
|
+
spinner.stop(c.error("Failed to start studio"));
|
|
1592
|
+
console.error(c.dim(err.message));
|
|
1593
|
+
}
|
|
1594
|
+
});
|
|
1595
|
+
}
|
|
1596
|
+
function studioReadyUrl(output) {
|
|
1597
|
+
const localLine = output.split(/\r?\n/).find((line) => line.includes("Local:"));
|
|
1598
|
+
return localLine?.match(/https?:\/\/(?:localhost|127\.0\.0\.1|\[::1\]):\d+/)?.[0] ?? null;
|
|
1599
|
+
}
|
|
1600
|
+
function reportPreviewShutdown(json) {
|
|
1601
|
+
if (json) return;
|
|
1602
|
+
console.log();
|
|
1603
|
+
console.log(` ${c.dim("Shutting down studio...")}`);
|
|
1604
|
+
}
|
|
1605
|
+
async function runDevMode(dir, options) {
|
|
1606
|
+
const thisFile = fileURLToPath(import.meta.url);
|
|
1607
|
+
const repoRoot = resolve2(dirname2(thisFile), "..", "..", "..", "..");
|
|
1608
|
+
const projectsDir = join2(repoRoot, "packages", "studio", "data", "projects");
|
|
1609
|
+
const pName = options?.projectName ?? basename(dir);
|
|
1610
|
+
const { symlinkPath, createdSymlink } = linkProjectIntoStudioData(dir, projectsDir, pName);
|
|
1611
|
+
if (!options?.json) ge(c.bold("hyperframes preview"));
|
|
1612
|
+
const s = ft();
|
|
1613
|
+
if (!options?.json) s.start("Starting studio...");
|
|
1614
|
+
const studioPkgDir = join2(repoRoot, "packages", "studio");
|
|
1615
|
+
const child = spawn("bun", ["run", "dev", "--", ...previewViteArgs(options?.port)], {
|
|
1616
|
+
cwd: studioPkgDir,
|
|
1617
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
1618
|
+
windowsHide: true,
|
|
1619
|
+
env: studioProxyEnv(options?.autoProxy ?? true, process.env, {
|
|
1620
|
+
projectDir: dir,
|
|
1621
|
+
projectName: pName,
|
|
1622
|
+
browserGpuMode: options?.browserGpuMode
|
|
1623
|
+
})
|
|
1624
|
+
});
|
|
1625
|
+
attachStudioReadyHandler(child, s, pName, dir, options);
|
|
1626
|
+
removeSymlinkOnExit(createdSymlink, symlinkPath);
|
|
1627
|
+
return waitForStudioChildClose(child);
|
|
1628
|
+
}
|
|
1629
|
+
function hasLocalStudio(dir) {
|
|
1630
|
+
try {
|
|
1631
|
+
const req = createRequire(join2(dir, "package.json"));
|
|
1632
|
+
const studioPkgPath = dirname2(req.resolve("@hyperframes/studio/package.json"));
|
|
1633
|
+
return existsSync2(join2(studioPkgPath, "vite.config.ts"));
|
|
1634
|
+
} catch {
|
|
1635
|
+
return false;
|
|
1636
|
+
}
|
|
1637
|
+
}
|
|
1638
|
+
async function runLocalStudioMode(dir, options) {
|
|
1639
|
+
const req = createRequire(join2(dir, "package.json"));
|
|
1640
|
+
const studioPkgPath = dirname2(req.resolve("@hyperframes/studio/package.json"));
|
|
1641
|
+
const pName = options?.projectName ?? basename(dir);
|
|
1642
|
+
const projectsDir = join2(studioPkgPath, "data", "projects");
|
|
1643
|
+
const { symlinkPath, createdSymlink } = linkProjectIntoStudioData(dir, projectsDir, pName);
|
|
1644
|
+
if (!options?.json) ge(c.bold("hyperframes preview") + c.dim(" (local studio)"));
|
|
1645
|
+
const s = ft();
|
|
1646
|
+
if (!options?.json) s.start("Starting studio...");
|
|
1647
|
+
const viteCommand = buildNpxCommand(["vite", ...previewViteArgs(options?.port)]);
|
|
1648
|
+
const child = spawn(viteCommand.command, viteCommand.args, {
|
|
1649
|
+
cwd: studioPkgPath,
|
|
1650
|
+
stdio: ["ignore", "pipe", "pipe"],
|
|
1651
|
+
windowsHide: true,
|
|
1652
|
+
env: studioProxyEnv(options?.autoProxy ?? true, process.env, {
|
|
1653
|
+
projectDir: dir,
|
|
1654
|
+
projectName: pName,
|
|
1655
|
+
browserGpuMode: options?.browserGpuMode
|
|
1656
|
+
})
|
|
1657
|
+
});
|
|
1658
|
+
attachStudioReadyHandler(child, s, pName, dir, options);
|
|
1659
|
+
removeSymlinkOnExit(createdSymlink, symlinkPath);
|
|
1660
|
+
return waitForStudioChildClose(child);
|
|
1661
|
+
}
|
|
1662
|
+
async function runEmbeddedMode(dir, startPort, options) {
|
|
1663
|
+
const { createStudioServer, loadPreviewServerBuildSignature, resolveStudioBundle } = await import("./studioServer-UWRBPIOJ.js");
|
|
1664
|
+
const pName = options?.projectName ?? basename(dir);
|
|
1665
|
+
const studioBundle = resolveStudioBundle();
|
|
1666
|
+
if (!options?.json) ge(c.bold("hyperframes preview"));
|
|
1667
|
+
const s = ft();
|
|
1668
|
+
if (!options?.json) s.start("Starting studio...");
|
|
1669
|
+
if (!studioBundle.available) {
|
|
1670
|
+
if (options?.json) {
|
|
1671
|
+
reportPreviewFailure(true, "start", "preview-start-failed", "Studio build missing");
|
|
1672
|
+
} else {
|
|
1673
|
+
s.stop(c.error("Studio build missing"));
|
|
1674
|
+
console.error();
|
|
1675
|
+
console.error(` ${c.dim("Could not find")} ${c.accent("index.html")} ${c.dim("in:")}`);
|
|
1676
|
+
for (const checkedPath of studioBundle.checkedPaths) {
|
|
1677
|
+
console.error(` ${c.dim("-")} ${checkedPath}`);
|
|
1678
|
+
}
|
|
1679
|
+
console.error();
|
|
1680
|
+
console.error(` ${c.dim("Rebuild the CLI package with")} ${c.accent("bun run build")}`);
|
|
1681
|
+
console.error();
|
|
1682
|
+
}
|
|
1683
|
+
setCommandExitCode(1);
|
|
1684
|
+
return;
|
|
1685
|
+
}
|
|
1686
|
+
const serverBuildSignature = await loadPreviewServerBuildSignature();
|
|
1687
|
+
const {
|
|
1688
|
+
app,
|
|
1689
|
+
watcher,
|
|
1690
|
+
shutdown: shutdownStudio
|
|
1691
|
+
} = createStudioServer({
|
|
1692
|
+
projectDir: dir,
|
|
1693
|
+
projectName: pName,
|
|
1694
|
+
autoProxy: options?.autoProxy,
|
|
1695
|
+
browserGpuMode: options?.browserGpuMode
|
|
1696
|
+
});
|
|
1697
|
+
let result;
|
|
1698
|
+
try {
|
|
1699
|
+
result = await findPortAndServe(
|
|
1700
|
+
app.fetch,
|
|
1701
|
+
startPort,
|
|
1702
|
+
dir,
|
|
1703
|
+
!!options?.forceNew,
|
|
1704
|
+
serverBuildSignature,
|
|
1705
|
+
void 0,
|
|
1706
|
+
options?.browserGpuMode
|
|
1707
|
+
);
|
|
1708
|
+
} catch (err) {
|
|
1709
|
+
watcher.close();
|
|
1710
|
+
reportPreviewFailure(
|
|
1711
|
+
Boolean(options?.json),
|
|
1712
|
+
"start",
|
|
1713
|
+
"preview-start-failed",
|
|
1714
|
+
err.message
|
|
1715
|
+
);
|
|
1716
|
+
return;
|
|
1717
|
+
}
|
|
1718
|
+
if (result.type === "already-running") {
|
|
1719
|
+
watcher.close();
|
|
1720
|
+
const url2 = `http://localhost:${result.port}`;
|
|
1721
|
+
if (options?.json) {
|
|
1722
|
+
const server = await activeServerOnPort(result.port);
|
|
1723
|
+
writeLifecycleJson(
|
|
1724
|
+
lifecyclePayload(
|
|
1725
|
+
"start",
|
|
1726
|
+
previewLifecycleSession({
|
|
1727
|
+
state: "reused",
|
|
1728
|
+
mode: "foreground",
|
|
1729
|
+
projectName: pName,
|
|
1730
|
+
projectDir: dir,
|
|
1731
|
+
port: result.port,
|
|
1732
|
+
pid: publicPreviewPid(server?.pid, null)
|
|
1733
|
+
})
|
|
1734
|
+
)
|
|
1735
|
+
);
|
|
1736
|
+
} else {
|
|
1737
|
+
s.stop(c.success("Already running"));
|
|
1738
|
+
printStudioSummary(pName, url2, dir, {
|
|
1739
|
+
details: ["Reusing existing server. Use --force-new to start a fresh instance."]
|
|
1740
|
+
});
|
|
1741
|
+
}
|
|
1742
|
+
openStudioBrowser(url2, pName, options);
|
|
1743
|
+
return;
|
|
1744
|
+
}
|
|
1745
|
+
const url = `http://localhost:${result.port}`;
|
|
1746
|
+
if (options?.json) {
|
|
1747
|
+
writeLifecycleJson(foregroundPreviewReadyPayload(pName, url, dir, process.pid));
|
|
1748
|
+
} else {
|
|
1749
|
+
s.stop(c.success("Studio running"));
|
|
1750
|
+
console.log();
|
|
1751
|
+
if (result.port !== startPort) {
|
|
1752
|
+
console.log(` ${c.warn(`Port ${startPort} is in use, using ${result.port} instead`)}`);
|
|
1753
|
+
console.log();
|
|
1754
|
+
}
|
|
1755
|
+
printStudioSummary(pName, url, dir, {
|
|
1756
|
+
details: [
|
|
1757
|
+
"Edit with your AI agent \u2014 it has HyperFrames skills installed.",
|
|
1758
|
+
"Changes reload automatically in the studio."
|
|
1759
|
+
],
|
|
1760
|
+
footer: "Press Ctrl+C to stop"
|
|
1761
|
+
});
|
|
1762
|
+
}
|
|
1763
|
+
openStudioBrowser(url, pName, options);
|
|
1764
|
+
void prebuildPreview(app.fetch, url, pName);
|
|
1765
|
+
let rl;
|
|
1766
|
+
if (process.platform === "win32") {
|
|
1767
|
+
const readline = await import("readline");
|
|
1768
|
+
rl = readline.createInterface({
|
|
1769
|
+
input: process.stdin,
|
|
1770
|
+
output: process.stdout
|
|
1771
|
+
});
|
|
1772
|
+
rl.on("SIGINT", () => {
|
|
1773
|
+
process.emit("SIGINT", "SIGINT");
|
|
1774
|
+
});
|
|
1775
|
+
}
|
|
1776
|
+
return new Promise((resolveRun) => {
|
|
1777
|
+
let shuttingDown = false;
|
|
1778
|
+
const shutdown = () => {
|
|
1779
|
+
if (shuttingDown) return;
|
|
1780
|
+
shuttingDown = true;
|
|
1781
|
+
rl?.close();
|
|
1782
|
+
reportPreviewShutdown(Boolean(options?.json));
|
|
1783
|
+
setTimeout(() => requestCliExit(0), 3e3).unref();
|
|
1784
|
+
shutdownStudio().catch(() => {
|
|
1785
|
+
}).finally(() => {
|
|
1786
|
+
watcher.close();
|
|
1787
|
+
result.server.close(() => resolveRun());
|
|
1788
|
+
});
|
|
1789
|
+
};
|
|
1790
|
+
process.on("SIGINT", shutdown);
|
|
1791
|
+
process.on("SIGTERM", shutdown);
|
|
1792
|
+
import("./src-PVYUYV3M.js").then(({ killTrackedProcesses }) => {
|
|
1793
|
+
process.once("exit", () => {
|
|
1794
|
+
if (!shuttingDown) killTrackedProcesses();
|
|
1795
|
+
});
|
|
1796
|
+
}).catch(() => {
|
|
1797
|
+
});
|
|
1798
|
+
});
|
|
1799
|
+
}
|
|
1800
|
+
export {
|
|
1801
|
+
backgroundStartFailureCode,
|
|
1802
|
+
preview_default as default,
|
|
1803
|
+
examples,
|
|
1804
|
+
foregroundPreviewReadyPayload,
|
|
1805
|
+
handlePreviewKillAll,
|
|
1806
|
+
handlePreviewList,
|
|
1807
|
+
prebuildPreview,
|
|
1808
|
+
previewLaunchMode,
|
|
1809
|
+
previewLaunchModeError,
|
|
1810
|
+
previewPortError,
|
|
1811
|
+
previewViteArgs,
|
|
1812
|
+
publicPreviewPid,
|
|
1813
|
+
reportPreviewShutdown,
|
|
1814
|
+
runDevMode,
|
|
1815
|
+
runLocalStudioMode,
|
|
1816
|
+
studioDeepLink,
|
|
1817
|
+
studioReadyUrl,
|
|
1818
|
+
studioSummaryUrls,
|
|
1819
|
+
waitForStudioChildClose
|
|
1820
|
+
};
|