@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.
Files changed (586) hide show
  1. package/LICENSE +190 -0
  2. package/NOTICE +54 -0
  3. package/README.md +23 -0
  4. package/bin/ignix-editor.mjs +8 -0
  5. package/package.json +53 -0
  6. package/patches/index.mjs +53 -0
  7. package/scripts/build-ffmpeg-macos.sh +35 -0
  8. package/scripts/build-whisper-macos.sh +21 -0
  9. package/scripts/vendor.mjs +41 -0
  10. package/skills/ignix-editor/SKILL.md +132 -0
  11. package/src/audio.mjs +31 -0
  12. package/src/binaries.json +46 -0
  13. package/src/binaries.mjs +83 -0
  14. package/src/cli.mjs +254 -0
  15. package/src/prepare.mjs +74 -0
  16. package/src/runtime/ignix-frame.js +92 -0
  17. package/src/transcribe.mjs +71 -0
  18. package/src/validate.mjs +71 -0
  19. package/templates/blank/index.html +41 -0
  20. package/vendor/hyperframes/README.md +181 -0
  21. package/vendor/hyperframes/UPSTREAM.json +12 -0
  22. package/vendor/hyperframes/bin/hyperframes-localize-fonts.mjs +12 -0
  23. package/vendor/hyperframes/bin/hyperframes.mjs +11 -0
  24. package/vendor/hyperframes/dist/add-LR3ZR2A5.js +79 -0
  25. package/vendor/hyperframes/dist/agentPromptGenerator-VIIPZCJ3.js +143 -0
  26. package/vendor/hyperframes/dist/animatedGifPrep-P2T6YM7Z.js +34 -0
  27. package/vendor/hyperframes/dist/asset-BE2DOV72.js +26 -0
  28. package/vendor/hyperframes/dist/assetCataloger-VBLPHX24.js +340 -0
  29. package/vendor/hyperframes/dist/auth-RCQB2ZT7.js +60 -0
  30. package/vendor/hyperframes/dist/autoUpdate-RJAX3DAZ.js +268 -0
  31. package/vendor/hyperframes/dist/backgroundChecks-H2LCUIMJ.js +61 -0
  32. package/vendor/hyperframes/dist/backgroundChecksWorker.js +26 -0
  33. package/vendor/hyperframes/dist/batchRender-FT7AP7XH.js +355 -0
  34. package/vendor/hyperframes/dist/beat-analyzer.global.js +338 -0
  35. package/vendor/hyperframes/dist/beats-Y2EOP72P.js +309 -0
  36. package/vendor/hyperframes/dist/benchmark-MZ7GY3JW.js +231 -0
  37. package/vendor/hyperframes/dist/browser-HUTAMRQE.js +237 -0
  38. package/vendor/hyperframes/dist/bundleWithLocalizedFonts-5QOPOB5D.js +52 -0
  39. package/vendor/hyperframes/dist/capture-RLZA6EMR.js +4079 -0
  40. package/vendor/hyperframes/dist/capture-SZZ4IYJK.js +290 -0
  41. package/vendor/hyperframes/dist/captureFile-LYOJOUIE.js +15 -0
  42. package/vendor/hyperframes/dist/captureTimeout-PA4FYWT5.js +27 -0
  43. package/vendor/hyperframes/dist/catalog-KYU55EWR.js +1001 -0
  44. package/vendor/hyperframes/dist/check-TCG4PXLR.js +1697 -0
  45. package/vendor/hyperframes/dist/checkBrowser-RPMO4OW5.js +1032 -0
  46. package/vendor/hyperframes/dist/chunk-2EAXUCCE.js +88 -0
  47. package/vendor/hyperframes/dist/chunk-2EGFTPWD.js +1077 -0
  48. package/vendor/hyperframes/dist/chunk-2PSPARWP.js +6058 -0
  49. package/vendor/hyperframes/dist/chunk-2YN64IN5.js +5747 -0
  50. package/vendor/hyperframes/dist/chunk-3GXQPCJC.js +682 -0
  51. package/vendor/hyperframes/dist/chunk-3ZP5DXE7.js +15 -0
  52. package/vendor/hyperframes/dist/chunk-4NWOGZZS.js +1990 -0
  53. package/vendor/hyperframes/dist/chunk-4PFZPP2N.js +587 -0
  54. package/vendor/hyperframes/dist/chunk-4THIAPBL.js +128 -0
  55. package/vendor/hyperframes/dist/chunk-4YYJOFKS.js +28 -0
  56. package/vendor/hyperframes/dist/chunk-54HJ63Q2.js +29 -0
  57. package/vendor/hyperframes/dist/chunk-5ETJX6WM.js +89 -0
  58. package/vendor/hyperframes/dist/chunk-5IAKAQA7.js +389 -0
  59. package/vendor/hyperframes/dist/chunk-5Z63TBTX.js +37 -0
  60. package/vendor/hyperframes/dist/chunk-6BEFEWFB.js +25 -0
  61. package/vendor/hyperframes/dist/chunk-6CSYCFQV.js +68 -0
  62. package/vendor/hyperframes/dist/chunk-6CTIGJY7.js +154 -0
  63. package/vendor/hyperframes/dist/chunk-7HG4BFIN.js +93 -0
  64. package/vendor/hyperframes/dist/chunk-7JZ4FXP2.js +118 -0
  65. package/vendor/hyperframes/dist/chunk-A2Z4Z4VL.js +2961 -0
  66. package/vendor/hyperframes/dist/chunk-AMKC3AXA.js +25 -0
  67. package/vendor/hyperframes/dist/chunk-AVUUN2XD.js +4847 -0
  68. package/vendor/hyperframes/dist/chunk-AWDFDFI3.js +46 -0
  69. package/vendor/hyperframes/dist/chunk-AWNBM3MZ.js +94 -0
  70. package/vendor/hyperframes/dist/chunk-BXCMXMJQ.js +73 -0
  71. package/vendor/hyperframes/dist/chunk-BZ56MTDX.js +6 -0
  72. package/vendor/hyperframes/dist/chunk-CFKU7HTK.js +171 -0
  73. package/vendor/hyperframes/dist/chunk-CWPVM2QV.js +308 -0
  74. package/vendor/hyperframes/dist/chunk-DPVXBVLL.js +31292 -0
  75. package/vendor/hyperframes/dist/chunk-DQBY7FRR.js +397 -0
  76. package/vendor/hyperframes/dist/chunk-E6RPWJVC.js +213 -0
  77. package/vendor/hyperframes/dist/chunk-EISRN4E6.js +294 -0
  78. package/vendor/hyperframes/dist/chunk-EOVYQ3IG.js +143 -0
  79. package/vendor/hyperframes/dist/chunk-F3WZGU7C.js +479 -0
  80. package/vendor/hyperframes/dist/chunk-FCSIGXXP.js +366 -0
  81. package/vendor/hyperframes/dist/chunk-FI4I7CME.js +56 -0
  82. package/vendor/hyperframes/dist/chunk-FLWXXDNS.js +15 -0
  83. package/vendor/hyperframes/dist/chunk-GK4AIFIH.js +11171 -0
  84. package/vendor/hyperframes/dist/chunk-GMECXFAN.js +57 -0
  85. package/vendor/hyperframes/dist/chunk-GULOKZLI.js +155 -0
  86. package/vendor/hyperframes/dist/chunk-H4YZZ2VQ.js +68 -0
  87. package/vendor/hyperframes/dist/chunk-H6QMKUYA.js +477 -0
  88. package/vendor/hyperframes/dist/chunk-HBBJFK6I.js +273 -0
  89. package/vendor/hyperframes/dist/chunk-HRUGC23L.js +212 -0
  90. package/vendor/hyperframes/dist/chunk-HVW7ABXD.js +19 -0
  91. package/vendor/hyperframes/dist/chunk-HW6OYASV.js +344 -0
  92. package/vendor/hyperframes/dist/chunk-HWKCIWQT.js +3578 -0
  93. package/vendor/hyperframes/dist/chunk-I465DBM6.js +1214 -0
  94. package/vendor/hyperframes/dist/chunk-IGLEPPTN.js +24 -0
  95. package/vendor/hyperframes/dist/chunk-IGNAAHS3.js +433 -0
  96. package/vendor/hyperframes/dist/chunk-IHFUKJOR.js +85 -0
  97. package/vendor/hyperframes/dist/chunk-IQ3OUQ5Z.js +213 -0
  98. package/vendor/hyperframes/dist/chunk-ISN5GRYI.js +20 -0
  99. package/vendor/hyperframes/dist/chunk-IUZFXWSV.js +446 -0
  100. package/vendor/hyperframes/dist/chunk-JH556Q42.js +647 -0
  101. package/vendor/hyperframes/dist/chunk-JTHMTOMQ.js +601 -0
  102. package/vendor/hyperframes/dist/chunk-K2EQN4VU.js +405 -0
  103. package/vendor/hyperframes/dist/chunk-K2FTXJYH.js +16044 -0
  104. package/vendor/hyperframes/dist/chunk-K4WIOZFP.js +32 -0
  105. package/vendor/hyperframes/dist/chunk-K4WKGXRC.js +18 -0
  106. package/vendor/hyperframes/dist/chunk-KBJUXVOJ.js +172 -0
  107. package/vendor/hyperframes/dist/chunk-KC5XXX3X.js +590 -0
  108. package/vendor/hyperframes/dist/chunk-KNU5COPB.js +29 -0
  109. package/vendor/hyperframes/dist/chunk-KZI44OPA.js +185 -0
  110. package/vendor/hyperframes/dist/chunk-L3YOGIPG.js +48 -0
  111. package/vendor/hyperframes/dist/chunk-LAOCA3MQ.js +189 -0
  112. package/vendor/hyperframes/dist/chunk-LCSMOLGX.js +312 -0
  113. package/vendor/hyperframes/dist/chunk-LFGJWOVA.js +61 -0
  114. package/vendor/hyperframes/dist/chunk-LHSR3M4M.js +498 -0
  115. package/vendor/hyperframes/dist/chunk-LYNI3FOL.js +123 -0
  116. package/vendor/hyperframes/dist/chunk-M2WBOQ2Q.js +54 -0
  117. package/vendor/hyperframes/dist/chunk-MRF4AMKD.js +104 -0
  118. package/vendor/hyperframes/dist/chunk-MWB3ZIFM.js +852 -0
  119. package/vendor/hyperframes/dist/chunk-NGKM64BP.js +39 -0
  120. package/vendor/hyperframes/dist/chunk-NXMYHJAL.js +43 -0
  121. package/vendor/hyperframes/dist/chunk-OAF4XJOW.js +192 -0
  122. package/vendor/hyperframes/dist/chunk-OFQWTKPW.js +117 -0
  123. package/vendor/hyperframes/dist/chunk-P6LJ4Y32.js +4662 -0
  124. package/vendor/hyperframes/dist/chunk-PBN6GBJE.js +108 -0
  125. package/vendor/hyperframes/dist/chunk-PDAMK4Q5.js +28 -0
  126. package/vendor/hyperframes/dist/chunk-PFCFR3KZ.js +20 -0
  127. package/vendor/hyperframes/dist/chunk-PJ3HDUCY.js +108 -0
  128. package/vendor/hyperframes/dist/chunk-PMRBLBUP.js +152 -0
  129. package/vendor/hyperframes/dist/chunk-PPQUYWTW.js +240 -0
  130. package/vendor/hyperframes/dist/chunk-Q5X2B5WT.js +29 -0
  131. package/vendor/hyperframes/dist/chunk-Q7IU7MOR.js +351 -0
  132. package/vendor/hyperframes/dist/chunk-QC4FJVLM.js +371 -0
  133. package/vendor/hyperframes/dist/chunk-QNYYOUU3.js +1318 -0
  134. package/vendor/hyperframes/dist/chunk-RDNNAKEP.js +161 -0
  135. package/vendor/hyperframes/dist/chunk-RMHUQGRK.js +657 -0
  136. package/vendor/hyperframes/dist/chunk-RQVDTPGD.js +6 -0
  137. package/vendor/hyperframes/dist/chunk-RVCWIIZ7.js +68 -0
  138. package/vendor/hyperframes/dist/chunk-S3D6GE5W.js +72 -0
  139. package/vendor/hyperframes/dist/chunk-S3S4TGEH.js +424 -0
  140. package/vendor/hyperframes/dist/chunk-S7NPLFWV.js +11395 -0
  141. package/vendor/hyperframes/dist/chunk-SHB5VDMH.js +51 -0
  142. package/vendor/hyperframes/dist/chunk-TCLGPL65.js +860 -0
  143. package/vendor/hyperframes/dist/chunk-THXFSPLV.js +40 -0
  144. package/vendor/hyperframes/dist/chunk-TJSTGSAW.js +354 -0
  145. package/vendor/hyperframes/dist/chunk-TQFG7HTI.js +1024 -0
  146. package/vendor/hyperframes/dist/chunk-TVCRUG2S.js +265 -0
  147. package/vendor/hyperframes/dist/chunk-TWWSYAKJ.js +24 -0
  148. package/vendor/hyperframes/dist/chunk-U7CZBDMV.js +27 -0
  149. package/vendor/hyperframes/dist/chunk-UEZXMWG3.js +139 -0
  150. package/vendor/hyperframes/dist/chunk-UYEZTK4U.js +61 -0
  151. package/vendor/hyperframes/dist/chunk-VC76R6W2.js +27 -0
  152. package/vendor/hyperframes/dist/chunk-VFCKXTBB.js +159 -0
  153. package/vendor/hyperframes/dist/chunk-VWG7OQKU.js +22 -0
  154. package/vendor/hyperframes/dist/chunk-VXVRPIJA.js +105 -0
  155. package/vendor/hyperframes/dist/chunk-WBLXWOYK.js +15 -0
  156. package/vendor/hyperframes/dist/chunk-WERLJGIC.js +20 -0
  157. package/vendor/hyperframes/dist/chunk-WMQNIQDJ.js +2057 -0
  158. package/vendor/hyperframes/dist/chunk-WPHMNO44.js +4528 -0
  159. package/vendor/hyperframes/dist/chunk-X5HWXQPU.js +113 -0
  160. package/vendor/hyperframes/dist/chunk-X7MTZ4T2.js +6 -0
  161. package/vendor/hyperframes/dist/chunk-XH4DSOS5.js +59 -0
  162. package/vendor/hyperframes/dist/chunk-XS4EJSKU.js +23 -0
  163. package/vendor/hyperframes/dist/chunk-XT5P4QMO.js +181 -0
  164. package/vendor/hyperframes/dist/chunk-XT7X6QCP.js +6 -0
  165. package/vendor/hyperframes/dist/chunk-XUHOIDKG.js +6 -0
  166. package/vendor/hyperframes/dist/chunk-XUXGIA7H.js +485 -0
  167. package/vendor/hyperframes/dist/chunk-XZABUQTX.js +113 -0
  168. package/vendor/hyperframes/dist/chunk-Y6W4DVPS.js +356 -0
  169. package/vendor/hyperframes/dist/chunk-YEIFI443.js +44 -0
  170. package/vendor/hyperframes/dist/chunk-YQZNILVH.js +375 -0
  171. package/vendor/hyperframes/dist/chunk-Z27A7NUB.js +65 -0
  172. package/vendor/hyperframes/dist/chunk-Z6B37SNM.js +3081 -0
  173. package/vendor/hyperframes/dist/chunk-ZJUKFZ2P.js +10954 -0
  174. package/vendor/hyperframes/dist/chunk-ZKDMAOFU.js +32 -0
  175. package/vendor/hyperframes/dist/chunk-ZMXUQLI2.js +17219 -0
  176. package/vendor/hyperframes/dist/chunk-ZTZ7NCJT.js +58 -0
  177. package/vendor/hyperframes/dist/chunk-ZTZA4UWZ.js +108 -0
  178. package/vendor/hyperframes/dist/clean-W57E5YQ3.js +293 -0
  179. package/vendor/hyperframes/dist/cli.js +495 -0
  180. package/vendor/hyperframes/dist/cloud-FFTJGZ24.js +70 -0
  181. package/vendor/hyperframes/dist/cloudrun-AJUTHUEA.js +763 -0
  182. package/vendor/hyperframes/dist/colors-HKWSZCGK.js +15 -0
  183. package/vendor/hyperframes/dist/commands/contrast-audit.browser.js +459 -0
  184. package/vendor/hyperframes/dist/commands/layout-audit.browser.js +2102 -0
  185. package/vendor/hyperframes/dist/commands/motion-sample.browser.js +74 -0
  186. package/vendor/hyperframes/dist/commands/motion-signature.browser.js +374 -0
  187. package/vendor/hyperframes/dist/compare-AYCTT55F.js +421 -0
  188. package/vendor/hyperframes/dist/compiler-QO36EXLS.js +121 -0
  189. package/vendor/hyperframes/dist/component-VFFR2O7T.js +176 -0
  190. package/vendor/hyperframes/dist/compositions-QTVN3U2A.js +228 -0
  191. package/vendor/hyperframes/dist/contactSheet-27SRU7A4.js +22 -0
  192. package/vendor/hyperframes/dist/delete-ZAKYCB7I.js +114 -0
  193. package/vendor/hyperframes/dist/deploy-MX76RZ36.js +101 -0
  194. package/vendor/hyperframes/dist/destroy-H2TZBYHH.js +42 -0
  195. package/vendor/hyperframes/dist/deterministicFonts-HAEMV4TM.js +50 -0
  196. package/vendor/hyperframes/dist/dist-EWXJGN63.js +129 -0
  197. package/vendor/hyperframes/dist/dist-FNNGCKFS.js +29 -0
  198. package/vendor/hyperframes/dist/dist-S3PJNPXQ.js +392 -0
  199. package/vendor/hyperframes/dist/docker/Dockerfile.render +65 -0
  200. package/vendor/hyperframes/dist/docs/compositions.md +67 -0
  201. package/vendor/hyperframes/dist/docs/data-attributes.md +27 -0
  202. package/vendor/hyperframes/dist/docs/examples.md +19 -0
  203. package/vendor/hyperframes/dist/docs/gsap.md +26 -0
  204. package/vendor/hyperframes/dist/docs/rendering.md +35 -0
  205. package/vendor/hyperframes/dist/docs/troubleshooting.md +29 -0
  206. package/vendor/hyperframes/dist/docs-QAPJEGLS.js +131 -0
  207. package/vendor/hyperframes/dist/doctor-AI7C3FON.js +67 -0
  208. package/vendor/hyperframes/dist/dom-IROKGVJI.js +14 -0
  209. package/vendor/hyperframes/dist/dotEnv-AECLXQSO.js +14 -0
  210. package/vendor/hyperframes/dist/events-7LALYNKZ.js +92 -0
  211. package/vendor/hyperframes/dist/events-FQY3HGKZ.js +88 -0
  212. package/vendor/hyperframes/dist/feedback-WCMDMSTK.js +472 -0
  213. package/vendor/hyperframes/dist/ffmpeg-QIUFEFTY.js +35 -0
  214. package/vendor/hyperframes/dist/figma-64WY462P.js +63 -0
  215. package/vendor/hyperframes/dist/fontData.generated-NXAOI4GH.js +13 -0
  216. package/vendor/hyperframes/dist/fontLocalizeCli.js +132 -0
  217. package/vendor/hyperframes/dist/get-FPOMJMZB.js +103 -0
  218. package/vendor/hyperframes/dist/gpuPolicy-2ZUZE5D6.js +38 -0
  219. package/vendor/hyperframes/dist/grade-compare-E2CKPST4.js +647 -0
  220. package/vendor/hyperframes/dist/gsapParser-DIYYX6JT.js +2846 -0
  221. package/vendor/hyperframes/dist/gsapParserAcorn-E3GEIRZB.js +28 -0
  222. package/vendor/hyperframes/dist/help-YRQIDDML.js +197 -0
  223. package/vendor/hyperframes/dist/history-PP5NDRV3.js +571 -0
  224. package/vendor/hyperframes/dist/hyperframe-runtime.js +1081 -0
  225. package/vendor/hyperframes/dist/hyperframe.manifest.json +22 -0
  226. package/vendor/hyperframes/dist/hyperframe.runtime.iife.js +1081 -0
  227. package/vendor/hyperframes/dist/hyperframes-player.global.js +474 -0
  228. package/vendor/hyperframes/dist/hyperframes-slideshow.global.js +149 -0
  229. package/vendor/hyperframes/dist/info-SEX3B7JL.js +153 -0
  230. package/vendor/hyperframes/dist/init-U3AKHO5B.js +1147 -0
  231. package/vendor/hyperframes/dist/inspect-Q3K6EDEK.js +97 -0
  232. package/vendor/hyperframes/dist/installer-K6O5WF44.js +37 -0
  233. package/vendor/hyperframes/dist/keyframes-DC64JCI3.js +2602 -0
  234. package/vendor/hyperframes/dist/lambda-D7UMN4DJ.js +451 -0
  235. package/vendor/hyperframes/dist/layout-XSPPDHOO.js +86 -0
  236. package/vendor/hyperframes/dist/lib-TPG2ZMAX.js +128 -0
  237. package/vendor/hyperframes/dist/lint-7DQZE7L3.js +164 -0
  238. package/vendor/hyperframes/dist/lintProject-OHBBM3DJ.js +27 -0
  239. package/vendor/hyperframes/dist/list-4K5MVDQX.js +162 -0
  240. package/vendor/hyperframes/dist/login-NTX4OWXL.js +377 -0
  241. package/vendor/hyperframes/dist/logout-Q654A3SI.js +100 -0
  242. package/vendor/hyperframes/dist/manager-67P2XFXQ.js +34 -0
  243. package/vendor/hyperframes/dist/manager-CT3D67CG.js +38 -0
  244. package/vendor/hyperframes/dist/manager-GFN75DM4.js +30 -0
  245. package/vendor/hyperframes/dist/media-treatment-5FYAOPNL.js +972 -0
  246. package/vendor/hyperframes/dist/media-use-4XXGABIL.js +113 -0
  247. package/vendor/hyperframes/dist/models-C4E4IWJD.js +137 -0
  248. package/vendor/hyperframes/dist/motionShot-S4MIGMT5.js +614 -0
  249. package/vendor/hyperframes/dist/normalize-O76AC4HE.js +333 -0
  250. package/vendor/hyperframes/dist/normalize-audio-CSFTXLXD.js +276 -0
  251. package/vendor/hyperframes/dist/open-2ZD6BHZG.js +115 -0
  252. package/vendor/hyperframes/dist/pipeline-TNGWUZQC.js +54 -0
  253. package/vendor/hyperframes/dist/play-CTMUXX6E.js +349 -0
  254. package/vendor/hyperframes/dist/policies-FSDZVS2E.js +292 -0
  255. package/vendor/hyperframes/dist/preflight-SMNV6RW2.js +45 -0
  256. package/vendor/hyperframes/dist/present-WQVHV5CR.js +350 -0
  257. package/vendor/hyperframes/dist/preview-JOJXTH75.js +1820 -0
  258. package/vendor/hyperframes/dist/producer-ECLEN5RP.js +13 -0
  259. package/vendor/hyperframes/dist/progress-FBIEEB7Y.js +73 -0
  260. package/vendor/hyperframes/dist/projectConfig-HYJMJ5BY.js +56 -0
  261. package/vendor/hyperframes/dist/publication-HQ5Y3KBM.js +29 -0
  262. package/vendor/hyperframes/dist/publish-VHDYQASC.js +430 -0
  263. package/vendor/hyperframes/dist/refresh-K24ETHMA.js +53 -0
  264. package/vendor/hyperframes/dist/remove-background-W2YX2NVH.js +253 -0
  265. package/vendor/hyperframes/dist/render-AO5VX3YI.js +177 -0
  266. package/vendor/hyperframes/dist/render-LNO62LEL.js +2367 -0
  267. package/vendor/hyperframes/dist/render-TTQI7TGN.js +796 -0
  268. package/vendor/hyperframes/dist/render-batch-YH7CTWNY.js +284 -0
  269. package/vendor/hyperframes/dist/renderCancellation-JPIHE47X.js +35 -0
  270. package/vendor/hyperframes/dist/renderSetupWorker.js +79 -0
  271. package/vendor/hyperframes/dist/resolver-IZ647GBZ.js +38 -0
  272. package/vendor/hyperframes/dist/runtimeVersion.js +18 -0
  273. package/vendor/hyperframes/dist/screenshotCapture-ECBTLCU6.js +179 -0
  274. package/vendor/hyperframes/dist/shaderTransitionWorker.js +44 -0
  275. package/vendor/hyperframes/dist/sherpa-KKLNW6U2.js +314 -0
  276. package/vendor/hyperframes/dist/sherpaWorker.js +77 -0
  277. package/vendor/hyperframes/dist/sites-TNVKZS73.js +52 -0
  278. package/vendor/hyperframes/dist/skill-ZHVLH7KX.js +15 -0
  279. package/vendor/hyperframes/dist/skills/hyperframes/SKILL.md +152 -0
  280. package/vendor/hyperframes/dist/skills/hyperframes/references/brief-contract.md +108 -0
  281. package/vendor/hyperframes/dist/skills/hyperframes/references/brief-format.md +72 -0
  282. package/vendor/hyperframes/dist/skills/hyperframes/references/capability-menu.md +47 -0
  283. package/vendor/hyperframes/dist/skills/hyperframes/references/frame-worker-core.md +80 -0
  284. package/vendor/hyperframes/dist/skills/hyperframes/references/intent-interview.md +73 -0
  285. package/vendor/hyperframes/dist/skills/hyperframes/references/pitch-round.md +40 -0
  286. package/vendor/hyperframes/dist/skills/hyperframes/references/plugin-installation.md +43 -0
  287. package/vendor/hyperframes/dist/skills/hyperframes/references/production-loop.md +26 -0
  288. package/vendor/hyperframes/dist/skills/hyperframes/references/review-loop.md +37 -0
  289. package/vendor/hyperframes/dist/skills/hyperframes/references/route-briefs.md +11 -0
  290. package/vendor/hyperframes/dist/skills/hyperframes/references/routes/embedded-captions.md +11 -0
  291. package/vendor/hyperframes/dist/skills/hyperframes/references/routes/faceless-explainer.md +12 -0
  292. package/vendor/hyperframes/dist/skills/hyperframes/references/routes/general-video.md +12 -0
  293. package/vendor/hyperframes/dist/skills/hyperframes/references/routes/motion-graphics.md +11 -0
  294. package/vendor/hyperframes/dist/skills/hyperframes/references/routes/music-to-video.md +12 -0
  295. package/vendor/hyperframes/dist/skills/hyperframes/references/routes/pr-to-video.md +28 -0
  296. package/vendor/hyperframes/dist/skills/hyperframes/references/routes/product-launch-video.md +13 -0
  297. package/vendor/hyperframes/dist/skills/hyperframes/references/routes/remotion-to-hyperframes.md +9 -0
  298. package/vendor/hyperframes/dist/skills/hyperframes/references/routes/slideshow.md +11 -0
  299. package/vendor/hyperframes/dist/skills/hyperframes/references/routes/talking-head-recut.md +11 -0
  300. package/vendor/hyperframes/dist/skills/hyperframes/references/script-format.md +52 -0
  301. package/vendor/hyperframes/dist/skills/hyperframes/references/skill-lifecycle.md +35 -0
  302. package/vendor/hyperframes/dist/skills/hyperframes/references/storyboard-format.md +99 -0
  303. package/vendor/hyperframes/dist/skills/hyperframes/references/subagent-dispatch.md +35 -0
  304. package/vendor/hyperframes/dist/skills/hyperframes/references/workflow-catalog.md +10 -0
  305. package/vendor/hyperframes/dist/skills/hyperframes/scripts/lib/frame-packets-core.mjs +194 -0
  306. package/vendor/hyperframes/dist/skills/hyperframes/scripts/plugin-cli.mjs +88 -0
  307. package/vendor/hyperframes/dist/skills/hyperframes/scripts/plugin-cli.test.mjs +117 -0
  308. package/vendor/hyperframes/dist/skills/hyperframes-cli/SKILL.md +189 -0
  309. package/vendor/hyperframes/dist/skills/hyperframes-cli/references/beats.md +19 -0
  310. package/vendor/hyperframes/dist/skills/hyperframes-cli/references/cloud.md +163 -0
  311. package/vendor/hyperframes/dist/skills/hyperframes-cli/references/cloudrun.md +62 -0
  312. package/vendor/hyperframes/dist/skills/hyperframes-cli/references/compare-and-batch.md +105 -0
  313. package/vendor/hyperframes/dist/skills/hyperframes-cli/references/doctor-browser.md +57 -0
  314. package/vendor/hyperframes/dist/skills/hyperframes-cli/references/init-and-scaffold.md +74 -0
  315. package/vendor/hyperframes/dist/skills/hyperframes-cli/references/lambda.md +185 -0
  316. package/vendor/hyperframes/dist/skills/hyperframes-cli/references/lint-validate-inspect.md +132 -0
  317. package/vendor/hyperframes/dist/skills/hyperframes-cli/references/preview-render.md +193 -0
  318. package/vendor/hyperframes/dist/skills/hyperframes-cli/references/upgrade-info-misc.md +134 -0
  319. package/vendor/hyperframes/dist/skills/media-use/SKILL.md +100 -0
  320. package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/CREDITS.md +35 -0
  321. package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/chime.mp3 +0 -0
  322. package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/click-soft.mp3 +0 -0
  323. package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/click.mp3 +0 -0
  324. package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/error.mp3 +0 -0
  325. package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/glitch-1.mp3 +0 -0
  326. package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/glitch-2.mp3 +0 -0
  327. package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/glitch-3.mp3 +0 -0
  328. package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/impact-bass-1.mp3 +0 -0
  329. package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/impact-bass-2.mp3 +0 -0
  330. package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/key-press.mp3 +0 -0
  331. package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/manifest.json +97 -0
  332. package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/notification.mp3 +0 -0
  333. package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/ping.mp3 +0 -0
  334. package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/pop.mp3 +0 -0
  335. package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/riser.mp3 +0 -0
  336. package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/sparkle.mp3 +0 -0
  337. package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/typing.mp3 +0 -0
  338. package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/whoosh-cinematic.mp3 +0 -0
  339. package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/whoosh-short.mp3 +0 -0
  340. package/vendor/hyperframes/dist/skills/media-use/audio/assets/sfx/whoosh.mp3 +0 -0
  341. package/vendor/hyperframes/dist/skills/media-use/audio/references/bgm.md +76 -0
  342. package/vendor/hyperframes/dist/skills/media-use/audio/references/captions/authoring.md +163 -0
  343. package/vendor/hyperframes/dist/skills/media-use/audio/references/captions/motion.md +87 -0
  344. package/vendor/hyperframes/dist/skills/media-use/audio/references/captions/transcript-handling.md +97 -0
  345. package/vendor/hyperframes/dist/skills/media-use/audio/references/remove-background.md +143 -0
  346. package/vendor/hyperframes/dist/skills/media-use/audio/references/requirements.md +29 -0
  347. package/vendor/hyperframes/dist/skills/media-use/audio/references/sfx.md +42 -0
  348. package/vendor/hyperframes/dist/skills/media-use/audio/references/transcribe.md +52 -0
  349. package/vendor/hyperframes/dist/skills/media-use/audio/references/tts-to-captions.md +35 -0
  350. package/vendor/hyperframes/dist/skills/media-use/audio/references/tts.md +260 -0
  351. package/vendor/hyperframes/dist/skills/media-use/audio/scripts/audio.mjs +311 -0
  352. package/vendor/hyperframes/dist/skills/media-use/audio/scripts/audio.test.mjs +159 -0
  353. package/vendor/hyperframes/dist/skills/media-use/audio/scripts/gemini-pipeline.test.mjs +131 -0
  354. package/vendor/hyperframes/dist/skills/media-use/audio/scripts/heygen-tts.mjs +122 -0
  355. package/vendor/hyperframes/dist/skills/media-use/audio/scripts/heygen-tts.test.mjs +38 -0
  356. package/vendor/hyperframes/dist/skills/media-use/audio/scripts/heygen-voice.mjs +98 -0
  357. package/vendor/hyperframes/dist/skills/media-use/audio/scripts/heygen-voice.test.mjs +233 -0
  358. package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/audio-meta.mjs +39 -0
  359. package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/audio-meta.test.mjs +136 -0
  360. package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/bgm-volume.mjs +4 -0
  361. package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/bgm.mjs +257 -0
  362. package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/bgm.test.mjs +74 -0
  363. package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/concurrency.mjs +14 -0
  364. package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/concurrency.test.mjs +41 -0
  365. package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/gemini-auth.mjs +43 -0
  366. package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/gemini-auth.py +52 -0
  367. package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/gemini-auth.test.mjs +86 -0
  368. package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/gemini-auth_test.py +90 -0
  369. package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/gemini-tts.mjs +122 -0
  370. package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/gemini-tts.test.mjs +243 -0
  371. package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/heygen.mjs +197 -0
  372. package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/heygen.test.mjs +185 -0
  373. package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/media-record.mjs +114 -0
  374. package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/media-record.test.mjs +205 -0
  375. package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/python.mjs +77 -0
  376. package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/python.test.mjs +136 -0
  377. package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/sfx.mjs +165 -0
  378. package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/sfx.test.mjs +121 -0
  379. package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/tts.mjs +389 -0
  380. package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/tts.spawn.test.mjs +158 -0
  381. package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lib/tts.test.mjs +230 -0
  382. package/vendor/hyperframes/dist/skills/media-use/audio/scripts/lyria-recipe.py +136 -0
  383. package/vendor/hyperframes/dist/skills/media-use/audio/scripts/wait-bgm.mjs +175 -0
  384. package/vendor/hyperframes/dist/skills/media-use/audio/scripts/wait-bgm.test.mjs +108 -0
  385. package/vendor/hyperframes/dist/skills/media-use/luts/README.md +28 -0
  386. package/vendor/hyperframes/dist/skills/media-use/luts/index.json +57 -0
  387. package/vendor/hyperframes/dist/skills/media-use/references/audio.md +20 -0
  388. package/vendor/hyperframes/dist/skills/media-use/references/grading.md +160 -0
  389. package/vendor/hyperframes/dist/skills/media-use/references/media-treatment-recipes.md +929 -0
  390. package/vendor/hyperframes/dist/skills/media-use/references/media-treatments.md +202 -0
  391. package/vendor/hyperframes/dist/skills/media-use/references/memory.md +37 -0
  392. package/vendor/hyperframes/dist/skills/media-use/references/meta.md +61 -0
  393. package/vendor/hyperframes/dist/skills/media-use/references/operations.md +327 -0
  394. package/vendor/hyperframes/dist/skills/media-use/references/resolve.md +150 -0
  395. package/vendor/hyperframes/dist/skills/media-use/references/setup-providers.md +80 -0
  396. package/vendor/hyperframes/dist/skills/media-use/references/telemetry-dashboard.md +49 -0
  397. package/vendor/hyperframes/dist/skills/media-use/scripts/audio-duck.mjs +113 -0
  398. package/vendor/hyperframes/dist/skills/media-use/scripts/compatibility.test.mjs +96 -0
  399. package/vendor/hyperframes/dist/skills/media-use/scripts/dither.mjs +328 -0
  400. package/vendor/hyperframes/dist/skills/media-use/scripts/dither.test.mjs +176 -0
  401. package/vendor/hyperframes/dist/skills/media-use/scripts/eval.mjs +369 -0
  402. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/adopt.mjs +128 -0
  403. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/adopt.test.mjs +95 -0
  404. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/bgm-provider.mjs +20 -0
  405. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/brand-provider.mjs +59 -0
  406. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/bundled-sfx-provider.mjs +119 -0
  407. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/bundled-sfx-provider.test.mjs +139 -0
  408. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/cache.mjs +148 -0
  409. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/candidates.mjs +91 -0
  410. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/candidates.test.mjs +155 -0
  411. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/codex-provider.mjs +161 -0
  412. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/codex-provider.test.mjs +34 -0
  413. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/config-lock.d.mts +3 -0
  414. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/config-lock.mjs +45 -0
  415. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/config-lock.test.mjs +79 -0
  416. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/coverage.test.mjs +136 -0
  417. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/cube-build.mjs +181 -0
  418. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/cube-build.test.mjs +80 -0
  419. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/cube-validate.mjs +198 -0
  420. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/cube-validate.test.mjs +125 -0
  421. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/cutlist.mjs +184 -0
  422. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/cutlist.test.mjs +162 -0
  423. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/duck.mjs +95 -0
  424. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/duck.test.mjs +153 -0
  425. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/error-diffusion.mjs +230 -0
  426. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/error-diffusion.test.mjs +102 -0
  427. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/ff-binaries.mjs +37 -0
  428. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/freeze.mjs +72 -0
  429. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/freeze.test.mjs +138 -0
  430. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/grade-analyzer.mjs +265 -0
  431. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/grade-analyzer.test.mjs +285 -0
  432. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/heygen-cli.mjs +191 -0
  433. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/heygen-cli.test.mjs +301 -0
  434. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/heygen-search.mjs +45 -0
  435. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/heygen-search.test.mjs +49 -0
  436. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/heygen-video-provider.mjs +138 -0
  437. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/heygen-video-provider.test.mjs +435 -0
  438. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/image-provider.mjs +44 -0
  439. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/index-gen.mjs +63 -0
  440. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/local-media-search.mjs +32 -0
  441. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/local-models.mjs +318 -0
  442. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/local-models.test.mjs +220 -0
  443. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/local-run.mjs +78 -0
  444. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/local-run.test.mjs +121 -0
  445. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/logo-provider.mjs +244 -0
  446. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/logo-provider.test.mjs +298 -0
  447. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/ltx-video-provider.mjs +94 -0
  448. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/ltx-video-provider.test.mjs +316 -0
  449. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/lut-preset-provider.mjs +271 -0
  450. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/lut-preset-provider.test.mjs +199 -0
  451. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/manifest.d.mts +19 -0
  452. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/manifest.mjs +279 -0
  453. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/manifest.test.mjs +397 -0
  454. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/match.mjs +47 -0
  455. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/media-fetch.mjs +85 -0
  456. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/media-fetch.test.mjs +197 -0
  457. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/media-home.mjs +20 -0
  458. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/media-home.test.mjs +61 -0
  459. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/media-search.d.mts +9 -0
  460. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/media-search.mjs +107 -0
  461. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/mflux-provider.mjs +128 -0
  462. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/mflux-provider.test.mjs +174 -0
  463. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/misses.mjs +49 -0
  464. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/misses.test.mjs +89 -0
  465. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/npx-sync.mjs +31 -0
  466. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/npx-sync.test.mjs +50 -0
  467. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/parakeet-words.mjs +27 -0
  468. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/parakeet-words.test.mjs +44 -0
  469. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/prefs-store.mjs +180 -0
  470. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/prefs-store.test.mjs +189 -0
  471. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/probe.mjs +41 -0
  472. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/probe.test.mjs +148 -0
  473. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/providers.mjs +5 -0
  474. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/recipe-store.mjs +367 -0
  475. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/recipe-store.test.mjs +367 -0
  476. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/registry.mjs +212 -0
  477. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/registry.test.mjs +262 -0
  478. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/search.mjs +24 -0
  479. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/search.test.mjs +32 -0
  480. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/sfx-provider.mjs +23 -0
  481. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/specs.mjs +132 -0
  482. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/specs.test.mjs +157 -0
  483. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/stats.mjs +117 -0
  484. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/stats.test.mjs +165 -0
  485. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/svg-sanitize.mjs +21 -0
  486. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/telemetry.mjs +210 -0
  487. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/telemetry.test.mjs +437 -0
  488. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/test-home.test.mjs +10 -0
  489. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/transcriptCutFade.mjs +21 -0
  490. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/transcriptCutFade.test.mjs +33 -0
  491. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/tts-local-provider.mjs +94 -0
  492. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/tts-local-provider.test.mjs +72 -0
  493. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/usage.mjs +57 -0
  494. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/usage.test.mjs +54 -0
  495. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/voice-provider.mjs +57 -0
  496. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/voice-provider.test.mjs +46 -0
  497. package/vendor/hyperframes/dist/skills/media-use/scripts/lib/words.mjs +18 -0
  498. package/vendor/hyperframes/dist/skills/media-use/scripts/prefs.mjs +70 -0
  499. package/vendor/hyperframes/dist/skills/media-use/scripts/recipe.mjs +103 -0
  500. package/vendor/hyperframes/dist/skills/media-use/scripts/resolve-plugin.test.mjs +62 -0
  501. package/vendor/hyperframes/dist/skills/media-use/scripts/resolve.mjs +1369 -0
  502. package/vendor/hyperframes/dist/skills/media-use/scripts/transcribe.mjs +194 -0
  503. package/vendor/hyperframes/dist/skills/media-use/scripts/transcribe.test.mjs +112 -0
  504. package/vendor/hyperframes/dist/skills/media-use/scripts/transcript-cut.mjs +270 -0
  505. package/vendor/hyperframes/dist/skills/media-use/scripts/transcript-cut.test.mjs +117 -0
  506. package/vendor/hyperframes/dist/skills-MJ2J4GEM.js +808 -0
  507. package/vendor/hyperframes/dist/skillsUpdateCheck-TKTYQN5R.js +26 -0
  508. package/vendor/hyperframes/dist/slideshow-EJ4IMY6P.js +24 -0
  509. package/vendor/hyperframes/dist/snapshot-KIVDUUMN.js +875 -0
  510. package/vendor/hyperframes/dist/src-6YQBJGWR.js +202 -0
  511. package/vendor/hyperframes/dist/src-PVYUYV3M.js +471 -0
  512. package/vendor/hyperframes/dist/state-KAXGHF77.js +26 -0
  513. package/vendor/hyperframes/dist/staticProjectServer-7EU666GS.js +49 -0
  514. package/vendor/hyperframes/dist/status-YM52BQ6S.js +311 -0
  515. package/vendor/hyperframes/dist/studio/assets/hyperframes-player-Cp8e_Zst.js +473 -0
  516. package/vendor/hyperframes/dist/studio/assets/index-BX3KHhGX.js +71 -0
  517. package/vendor/hyperframes/dist/studio/assets/index-CASEBNy2.js +1 -0
  518. package/vendor/hyperframes/dist/studio/assets/index-D11atkBt.css +1 -0
  519. package/vendor/hyperframes/dist/studio/assets/index-DMTt9nTf.js +531 -0
  520. package/vendor/hyperframes/dist/studio/assets/index-oE1pOdAy.js +399 -0
  521. package/vendor/hyperframes/dist/studio/chunk-5VSXRGIX.js +948 -0
  522. package/vendor/hyperframes/dist/studio/chunk-5VSXRGIX.js.map +1 -0
  523. package/vendor/hyperframes/dist/studio/chunk-7UQWVN52.js +938 -0
  524. package/vendor/hyperframes/dist/studio/chunk-7UQWVN52.js.map +1 -0
  525. package/vendor/hyperframes/dist/studio/chunk-EEXSYY5F.js +190 -0
  526. package/vendor/hyperframes/dist/studio/chunk-EEXSYY5F.js.map +1 -0
  527. package/vendor/hyperframes/dist/studio/chunk-FOEID72M.js +1441 -0
  528. package/vendor/hyperframes/dist/studio/chunk-FOEID72M.js.map +1 -0
  529. package/vendor/hyperframes/dist/studio/chunk-PZ5AY32C.js +10 -0
  530. package/vendor/hyperframes/dist/studio/chunk-PZ5AY32C.js.map +1 -0
  531. package/vendor/hyperframes/dist/studio/chunk-TDWGXBUT.js +1103 -0
  532. package/vendor/hyperframes/dist/studio/chunk-TDWGXBUT.js.map +1 -0
  533. package/vendor/hyperframes/dist/studio/domEditingLayers-IEVLO54Z.js +47 -0
  534. package/vendor/hyperframes/dist/studio/domEditingLayers-IEVLO54Z.js.map +1 -0
  535. package/vendor/hyperframes/dist/studio/favicon.svg +14 -0
  536. package/vendor/hyperframes/dist/studio/icons/timeline/audio.svg +7 -0
  537. package/vendor/hyperframes/dist/studio/icons/timeline/captions.svg +5 -0
  538. package/vendor/hyperframes/dist/studio/icons/timeline/composition.svg +12 -0
  539. package/vendor/hyperframes/dist/studio/icons/timeline/image.svg +18 -0
  540. package/vendor/hyperframes/dist/studio/icons/timeline/music.svg +10 -0
  541. package/vendor/hyperframes/dist/studio/icons/timeline/text.svg +3 -0
  542. package/vendor/hyperframes/dist/studio/index.css +165 -0
  543. package/vendor/hyperframes/dist/studio/index.css.map +1 -0
  544. package/vendor/hyperframes/dist/studio/index.d.ts +4296 -0
  545. package/vendor/hyperframes/dist/studio/index.html +23 -0
  546. package/vendor/hyperframes/dist/studio/index.js +99693 -0
  547. package/vendor/hyperframes/dist/studio/index.js.map +1 -0
  548. package/vendor/hyperframes/dist/studio/player.d.ts +30 -0
  549. package/vendor/hyperframes/dist/studio/player.js +10 -0
  550. package/vendor/hyperframes/dist/studio/player.js.map +1 -0
  551. package/vendor/hyperframes/dist/studio/styles/tailwind-preset.d.ts +39 -0
  552. package/vendor/hyperframes/dist/studio/styles/tailwind-preset.js +50 -0
  553. package/vendor/hyperframes/dist/studio/styles/tailwind-preset.js.map +1 -0
  554. package/vendor/hyperframes/dist/studio/styles.css +1 -0
  555. package/vendor/hyperframes/dist/studio/ui.d.ts +296 -0
  556. package/vendor/hyperframes/dist/studio/ui.js +66 -0
  557. package/vendor/hyperframes/dist/studio/ui.js.map +1 -0
  558. package/vendor/hyperframes/dist/studio-api-PNQZRPX5.js +136 -0
  559. package/vendor/hyperframes/dist/studioSelectionClient-IUUPKUHZ.js +25 -0
  560. package/vendor/hyperframes/dist/studioServer-UWRBPIOJ.js +1457 -0
  561. package/vendor/hyperframes/dist/synthesize-K62TIZWI.js +182 -0
  562. package/vendor/hyperframes/dist/system-EZYZNUFD.js +44 -0
  563. package/vendor/hyperframes/dist/telemetry-2YC4SGQU.js +144 -0
  564. package/vendor/hyperframes/dist/telemetry-QMYM4WME.js +95 -0
  565. package/vendor/hyperframes/dist/templates/_shared/AGENTS.md +107 -0
  566. package/vendor/hyperframes/dist/templates/_shared/CLAUDE.md +107 -0
  567. package/vendor/hyperframes/dist/templates/blank/index.html +55 -0
  568. package/vendor/hyperframes/dist/templates/from-file/index.html +75 -0
  569. package/vendor/hyperframes/dist/templates/warm-grain/compositions/captions.html +154 -0
  570. package/vendor/hyperframes/dist/templates/warm-grain/compositions/graphics.html +162 -0
  571. package/vendor/hyperframes/dist/templates/warm-grain/compositions/intro.html +87 -0
  572. package/vendor/hyperframes/dist/templates/warm-grain/index.html +264 -0
  573. package/vendor/hyperframes/dist/templates/warm-grain/registry-item.json +34 -0
  574. package/vendor/hyperframes/dist/timeline-77Z3BBQM.js +1377 -0
  575. package/vendor/hyperframes/dist/tokens-OBGTYE4Z.js +92 -0
  576. package/vendor/hyperframes/dist/transcribe-7NVFHCGA.js +387 -0
  577. package/vendor/hyperframes/dist/transcribe-BNSJRR4M.js +62 -0
  578. package/vendor/hyperframes/dist/tts-P3LIPIL5.js +234 -0
  579. package/vendor/hyperframes/dist/updateCheck-UDWIJ4ZQ.js +39 -0
  580. package/vendor/hyperframes/dist/upgrade-CT3CPO3E.js +231 -0
  581. package/vendor/hyperframes/dist/urlDownloader-H6WRI2UE.js +39 -0
  582. package/vendor/hyperframes/dist/usage-EC3KFUIJ.js +2139 -0
  583. package/vendor/hyperframes/dist/validate-65QDZJWZ.js +70 -0
  584. package/vendor/hyperframes/dist/video-FGSGKRSV.js +261 -0
  585. package/vendor/hyperframes/dist/workspaceBuildCheck-TOLGAI4T.js +133 -0
  586. 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
+ };