hyperframes 0.8.184 → 0.8.185

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 (309) hide show
  1. package/dist/{add-5ZTD3MUZ.js → add-ODTNPRGG.js} +14 -14
  2. package/dist/{agentPromptGenerator-VIIPZCJ3.js → agentPromptGenerator-KYO5MKTW.js} +1 -1
  3. package/dist/{animatedGifPrep-AGASIWVA.js → animatedGifPrep-PEP5GWOJ.js} +9 -9
  4. package/dist/api.js +17 -17
  5. package/dist/{asset-LSTEMPIB.js → asset-EZG42XPA.js} +2 -2
  6. package/dist/{assetCataloger-BKBMNL3A.js → assetCataloger-OHAJFCA7.js} +9 -9
  7. package/dist/{audio-KGK44XE4.js → audio-65R4T74I.js} +16 -15
  8. package/dist/{auth-MJWKYK77.js → auth-VP2SIZFN.js} +1 -1
  9. package/dist/{autoUpdate-2GGDKYR2.js → autoUpdate-RVSUX4SS.js} +2 -2
  10. package/dist/{backgroundChecks-7GRX5VQY.js → backgroundChecks-LEHK74NS.js} +3 -3
  11. package/dist/backgroundChecksWorker.js +3 -3
  12. package/dist/{batchRender-BCV2LELR.js → batchRender-3X6CL7PK.js} +5 -5
  13. package/dist/{beats-7BCFRBAL.js → beats-66VPQLSC.js} +6 -6
  14. package/dist/{benchmark-2R6CN5MQ.js → benchmark-PBJVTOJP.js} +10 -10
  15. package/dist/{browser-6AFGOI7G.js → browser-TPL5MWGC.js} +3 -3
  16. package/dist/{bundleWithLocalizedFonts-2EGPA5ZO.js → bundleWithLocalizedFonts-67MLTHKM.js} +2 -2
  17. package/dist/{capture-HOIAW6MO.js → capture-F3GNMRZM.js} +13 -13
  18. package/dist/{capture-HA2UHLIU.js → capture-YYRE7EV3.js} +2 -2
  19. package/dist/{captureCompositionFrame-4236FVWJ.js → captureCompositionFrame-PXV2ISHD.js} +13 -13
  20. package/dist/{catalog-A6CZAWW4.js → catalog-6SDD3OHF.js} +14 -14
  21. package/dist/{catch-up-TNA4DJOA.js → catch-up-CWIVA5VG.js} +4 -4
  22. package/dist/{check-5E5U2EQZ.js → check-YQ6REK2S.js} +34 -34
  23. package/dist/{checkBrowser-FNINXBMZ.js → checkBrowser-5XZCBRXM.js} +31 -31
  24. package/dist/{chunk-2ULXZ4PG.js → chunk-2TAS5O4P.js} +56 -11
  25. package/dist/{chunk-3TXNNBI2.js → chunk-37CNYTQQ.js} +2 -2
  26. package/dist/chunk-3NPOFC43.js +3805 -0
  27. package/dist/{chunk-EEP5Y5IE.js → chunk-46HEFGXJ.js} +1 -1
  28. package/dist/{chunk-2XA7KXQO.js → chunk-4CTNDBE3.js} +2 -2
  29. package/dist/{chunk-MFAETWIF.js → chunk-55YELV7B.js} +1 -1
  30. package/dist/{chunk-LRGYPXHF.js → chunk-5GUKZRQN.js} +1 -1
  31. package/dist/{chunk-SAX7HQ5E.js → chunk-6ASIXMFP.js} +1 -1
  32. package/dist/{chunk-SN7KI5JA.js → chunk-6GPR3G3C.js} +2 -2
  33. package/dist/{chunk-E32ZQ2WO.js → chunk-6RIZY7OP.js} +1 -1
  34. package/dist/{chunk-5CS4T6C6.js → chunk-7L37AB57.js} +1 -1
  35. package/dist/{chunk-BCHSTE7U.js → chunk-7PS6RVWD.js} +1 -1
  36. package/dist/{chunk-X3CG5YQA.js → chunk-7RAY4WZP.js} +3 -3
  37. package/dist/{chunk-YWHCXIMD.js → chunk-A6QCO474.js} +5 -5
  38. package/dist/{chunk-YMS5FOMC.js → chunk-B2A56S5C.js} +1 -1
  39. package/dist/{chunk-IWTNTUPQ.js → chunk-BH7TTIPN.js} +11 -13
  40. package/dist/{chunk-DWUGKEHR.js → chunk-BRAPBUPQ.js} +1 -1
  41. package/dist/{chunk-R2BFTECP.js → chunk-CX3USX23.js} +3 -3
  42. package/dist/{chunk-JB6ARMQS.js → chunk-D42NU3DZ.js} +1 -1
  43. package/dist/{chunk-GDEV42FA.js → chunk-EMAWIZ54.js} +481 -36
  44. package/dist/{chunk-UNNXFKVG.js → chunk-EMSDWBG3.js} +2 -2
  45. package/dist/{chunk-CXABAXB3.js → chunk-ESBMUZXZ.js} +1 -1
  46. package/dist/{chunk-EM7C7H7S.js → chunk-F3OPUWQX.js} +7 -7
  47. package/dist/{chunk-YOZPQCSR.js → chunk-FX6RUJUY.js} +3 -3
  48. package/dist/{chunk-PSKEKWVU.js → chunk-G2UANIDX.js} +1 -1
  49. package/dist/{chunk-UKOTVJFV.js → chunk-H5SM5PJI.js} +1 -1
  50. package/dist/{chunk-YWNJTZGN.js → chunk-H6UY725W.js} +2 -2
  51. package/dist/{chunk-PFYWVUHA.js → chunk-HDIRZGK4.js} +1 -1
  52. package/dist/{chunk-HR23IKLZ.js → chunk-HHSJJFVM.js} +2 -2
  53. package/dist/{chunk-LLC4CS6I.js → chunk-HXUTX5GR.js} +3 -3
  54. package/dist/{chunk-RGXVEYHI.js → chunk-I3IH5MV5.js} +6 -10
  55. package/dist/{chunk-Q33P4EAC.js → chunk-I45HL3VP.js} +3 -3
  56. package/dist/{chunk-TYXH3EKP.js → chunk-I5JRXMCV.js} +16 -1
  57. package/dist/{chunk-4N4P3ZWL.js → chunk-I7QMXZSB.js} +2 -2
  58. package/dist/{chunk-ICJEAFPD.js → chunk-IDFNKFPL.js} +7 -7
  59. package/dist/{chunk-VNVQGDPC.js → chunk-IDGLGXPA.js} +1 -1
  60. package/dist/{chunk-2PVE4WS2.js → chunk-IPDKZ5IN.js} +33 -6
  61. package/dist/{chunk-ABZYYUUH.js → chunk-ISTRDGIX.js} +1 -1
  62. package/dist/{chunk-3MDJIWOV.js → chunk-IVEFOUZI.js} +46 -30
  63. package/dist/{chunk-4KKKBEP3.js → chunk-J5XEZ24I.js} +3 -3
  64. package/dist/{chunk-7HJALUIO.js → chunk-K2ZKXTVL.js} +1 -1
  65. package/dist/{chunk-TE427YID.js → chunk-K73RJB23.js} +2 -2
  66. package/dist/{chunk-3QVMJ7GX.js → chunk-KQ4JEJLF.js} +9 -9
  67. package/dist/{chunk-J3QM7AHP.js → chunk-KROXPHXX.js} +9 -3
  68. package/dist/{chunk-OLZENUPI.js → chunk-LLFQA7XF.js} +1 -1
  69. package/dist/chunk-LLMSX6V6.js +17 -0
  70. package/dist/{chunk-WTFUDNW2.js → chunk-LYKSTRAY.js} +3 -3
  71. package/dist/{chunk-VDM3FEDP.js → chunk-OAG47RE6.js} +1 -1
  72. package/dist/{chunk-FGJEUV4S.js → chunk-PHMBMOXF.js} +1 -1
  73. package/dist/{chunk-7MB2ZAQF.js → chunk-PMMQRJDE.js} +1 -1
  74. package/dist/{chunk-ADDHW2FS.js → chunk-Q447CX26.js} +82 -12
  75. package/dist/{chunk-YALM6XN4.js → chunk-Q47FAYYK.js} +3 -3
  76. package/dist/{chunk-ZOCHDXDG.js → chunk-RTBSA3EA.js} +1 -1
  77. package/dist/{chunk-UJKUB2LH.js → chunk-RUEGYANA.js} +11 -11
  78. package/dist/{chunk-OYLO6TYK.js → chunk-RUOG4VB7.js} +1 -1
  79. package/dist/{chunk-ZRHO6YMM.js → chunk-SKYPMHQC.js} +4 -4
  80. package/dist/{chunk-ES426XRJ.js → chunk-SQVRXHOW.js} +3 -3
  81. package/dist/{chunk-QL2PNIXC.js → chunk-TAX2ZJAP.js} +24 -16
  82. package/dist/{chunk-KN46TGHV.js → chunk-TOI35GN2.js} +1 -1
  83. package/dist/{chunk-74JMKLVU.js → chunk-UPR3MU6Z.js} +1 -1
  84. package/dist/{chunk-JIUTXKWA.js → chunk-WQLKDL35.js} +2 -1
  85. package/dist/{chunk-WHPN2TIT.js → chunk-X6L6MD5B.js} +5 -5
  86. package/dist/{chunk-7NRI7HYX.js → chunk-XWC7CNPY.js} +1 -1
  87. package/dist/{clean-HGASSMWI.js → clean-7J6ZCCGV.js} +18 -18
  88. package/dist/cli.js +53 -53
  89. package/dist/{cloud-JPDVNXHN.js → cloud-7IJCJCDD.js} +4 -4
  90. package/dist/{cloudrun-AMMGSDRP.js → cloudrun-UNZRIIDB.js} +7 -7
  91. package/dist/commands/contrast-audit.browser.js +1 -2
  92. package/dist/commands/layout-audit.browser.js +196 -0
  93. package/dist/{compare-LHHVHUN3.js → compare-Q7VW5JZT.js} +28 -28
  94. package/dist/{compiler-Q3N6QXMT.js → compiler-KPHYGFXL.js} +6 -6
  95. package/dist/{component-D72J32Q7.js → component-UUBREJKN.js} +3 -3
  96. package/dist/{compositions-UQRJ5ROG.js → compositions-T4FTKIDP.js} +13 -13
  97. package/dist/{delete-P42VIDDA.js → delete-WZQF2IIA.js} +2 -2
  98. package/dist/{deploy-WZTH57O4.js → deploy-JU7A3XNC.js} +1 -1
  99. package/dist/{deterministicFonts-VQ5UBMXY.js → deterministicFonts-EGAAE7QL.js} +3 -3
  100. package/dist/{dist-SENYPQGW.js → dist-LM7AVHOU.js} +3 -3
  101. package/dist/{dist-DYS24AMA.js → dist-ULGTPSU4.js} +8 -4
  102. package/dist/docs/data-attributes.md +1 -1
  103. package/dist/{doctor-KEJIG2SK.js → doctor-VSNGRKXJ.js} +13 -13
  104. package/dist/{events-CYKSNR7N.js → events-CRW2DYUT.js} +3 -3
  105. package/dist/{events-UZXFQPMT.js → events-E63YBUL2.js} +3 -3
  106. package/dist/{feedback-LXNQF7CA.js → feedback-OSZWVR6N.js} +8 -8
  107. package/dist/{ffmpeg-BYHON577.js → ffmpeg-JLH3Z7G7.js} +9 -9
  108. package/dist/{figma-EIQ35PS6.js → figma-2BQNNR53.js} +3 -3
  109. package/dist/fontLocalizeCli.js +12 -12
  110. package/dist/{get-CC2YL7QO.js → get-P2XI53QW.js} +2 -2
  111. package/dist/{gpuPolicy-VFSACUQV.js → gpuPolicy-NTKQJY75.js} +9 -9
  112. package/dist/{grade-compare-TUQL7IV2.js → grade-compare-OYASIHIB.js} +29 -29
  113. package/dist/{gsapParserAcorn-7NCK2LVT.js → gsapParserAcorn-SKODXC2N.js} +2 -2
  114. package/dist/{help-ROROO5K6.js → help-HK6K2N4G.js} +1 -1
  115. package/dist/{history-PNELYLXX.js → history-JMTYKLXW.js} +6 -6
  116. package/dist/hyperframe.manifest.json +1 -1
  117. package/dist/hyperframe.runtime.iife.js +63 -63
  118. package/dist/hyperframes-player.global.js +1 -1
  119. package/dist/{info-4FZTH6AS.js → info-AW7CIVRE.js} +9 -9
  120. package/dist/{init-I43GHHVP.js → init-6KIDG4LB.js} +30 -30
  121. package/dist/{inspect-IT4TYIZ3.js → inspect-B7BLYMRZ.js} +29 -29
  122. package/dist/{installer-CWOJVK5K.js → installer-ZP2LQZUQ.js} +7 -7
  123. package/dist/{keyframes-3FBOGVD4.js → keyframes-EQ36A5JE.js} +7 -7
  124. package/dist/{lambda-H3V32I7M.js → lambda-E6VURLIS.js} +9 -9
  125. package/dist/{layout-BZ5LYJ5C.js → layout-XYC64QQQ.js} +29 -29
  126. package/dist/{lint-ZTNSGP2S.js → lint-V5DJYWBX.js} +9 -9
  127. package/dist/{lintProject-C2ONSH2U.js → lintProject-JATQKR64.js} +3 -3
  128. package/dist/{list-XM4GWJYY.js → list-RUGVRTVD.js} +2 -2
  129. package/dist/{login-H6HYKMWX.js → login-ZTKGKXGS.js} +4 -4
  130. package/dist/{manager-TWVDSJXO.js → manager-JUP7PM6N.js} +10 -10
  131. package/dist/{media-treatment-N7MY5NXB.js → media-treatment-VIUPK4OR.js} +15 -15
  132. package/dist/{models-WEMIMYBD.js → models-LJS2HBOZ.js} +13 -13
  133. package/dist/{motionShot-RHICTVPU.js → motionShot-3UAXZ7SN.js} +16 -16
  134. package/dist/{normalize-audio-ZFUZCJE3.js → normalize-audio-SBYI4YIH.js} +4 -4
  135. package/dist/{open-IBJ4FL3G.js → open-S27TUD3A.js} +14 -14
  136. package/dist/{parakeetRunner-XXO4WSLR.js → parakeetRunner-ETLMLJ4L.js} +14 -14
  137. package/dist/{pipeline-6ML3LUVK.js → pipeline-I2M22M24.js} +10 -10
  138. package/dist/{play-RV4NAVF5.js → play-COJU6VJK.js} +21 -21
  139. package/dist/{preflight-R3DEFMLA.js → preflight-FZ24NCHH.js} +10 -10
  140. package/dist/{present-5TBJGE6B.js → present-YAHKLC5D.js} +17 -17
  141. package/dist/{preview-FLKZ5CXJ.js → preview-KQOEU5YE.js} +20 -20
  142. package/dist/{producer-7XYSPVKH.js → producer-DTNNG4T6.js} +1 -1
  143. package/dist/{projectConfig-TBU2VWZX.js → projectConfig-4A76VYUP.js} +9 -9
  144. package/dist/{publication-CWWUJYJ5.js → publication-SQPMC2W3.js} +4 -4
  145. package/dist/{publish-FSNE4FEB.js → publish-QUEJBGGT.js} +11 -11
  146. package/dist/{remove-background-MDFWRWCT.js → remove-background-FP2ETAQH.js} +11 -11
  147. package/dist/{render-F4JQ553X.js → render-BIFIL4U6.js} +31 -31
  148. package/dist/{render-DBGQZAZT.js → render-GQFXJWLV.js} +17 -29
  149. package/dist/{render-LWZKXCLY.js → render-P664SMC7.js} +5 -5
  150. package/dist/{render-batch-PU7NMLIJ.js → render-batch-ZCPMYH6Z.js} +5 -5
  151. package/dist/renderSetupWorker.js +3 -3
  152. package/dist/{resolver-RUBGFXPC.js → resolver-BUC2GFZQ.js} +6 -6
  153. package/dist/{sherpa-X2TBNO6P.js → sherpa-HFT6XEP6.js} +13 -13
  154. package/dist/skills/hyperframes/SKILL.md +52 -174
  155. package/dist/skills/hyperframes/assets/frame-presets/biennale-yellow/FRAME.md +289 -0
  156. package/dist/skills/hyperframes/assets/frame-presets/biennale-yellow/caption-skin.html +220 -0
  157. package/dist/skills/hyperframes/assets/frame-presets/biennale-yellow/frame-showcase.html +1214 -0
  158. package/dist/skills/hyperframes/assets/frame-presets/blockframe/FRAME.md +275 -0
  159. package/dist/skills/hyperframes/assets/frame-presets/blockframe/caption-skin.html +223 -0
  160. package/dist/skills/hyperframes/assets/frame-presets/blockframe/frame-showcase.html +1347 -0
  161. package/dist/skills/hyperframes/assets/frame-presets/blue-professional/FRAME.md +307 -0
  162. package/dist/skills/hyperframes/assets/frame-presets/blue-professional/caption-skin.html +222 -0
  163. package/dist/skills/hyperframes/assets/frame-presets/blue-professional/frame-showcase.html +1372 -0
  164. package/dist/skills/hyperframes/assets/frame-presets/bold-poster/FRAME.md +275 -0
  165. package/dist/skills/hyperframes/assets/frame-presets/bold-poster/caption-skin.html +229 -0
  166. package/dist/skills/hyperframes/assets/frame-presets/bold-poster/frame-showcase.html +1140 -0
  167. package/dist/skills/hyperframes/assets/frame-presets/broadside/FRAME.md +284 -0
  168. package/dist/skills/hyperframes/assets/frame-presets/broadside/caption-skin.html +224 -0
  169. package/dist/skills/hyperframes/assets/frame-presets/broadside/frame-showcase.html +1166 -0
  170. package/dist/skills/hyperframes/assets/frame-presets/capsule/FRAME.md +284 -0
  171. package/dist/skills/hyperframes/assets/frame-presets/capsule/caption-skin.html +223 -0
  172. package/dist/skills/hyperframes/assets/frame-presets/capsule/frame-showcase.html +1465 -0
  173. package/dist/skills/hyperframes/assets/frame-presets/cartesian/FRAME.md +278 -0
  174. package/dist/skills/hyperframes/assets/frame-presets/cartesian/caption-skin.html +221 -0
  175. package/dist/skills/hyperframes/assets/frame-presets/cartesian/frame-showcase.html +1263 -0
  176. package/dist/skills/hyperframes/assets/frame-presets/cobalt-grid/FRAME.md +265 -0
  177. package/dist/skills/hyperframes/assets/frame-presets/cobalt-grid/caption-skin.html +237 -0
  178. package/dist/skills/hyperframes/assets/frame-presets/cobalt-grid/frame-showcase.html +1468 -0
  179. package/dist/skills/hyperframes/assets/frame-presets/code-editorial/FRAME.md +277 -0
  180. package/dist/skills/hyperframes/assets/frame-presets/code-editorial/caption-skin.html +223 -0
  181. package/dist/skills/hyperframes/assets/frame-presets/code-editorial/fonts/EBGaramond-400.woff2 +0 -0
  182. package/dist/skills/hyperframes/assets/frame-presets/code-editorial/fonts/EBGaramond-700.woff2 +0 -0
  183. package/dist/skills/hyperframes/assets/frame-presets/code-editorial/fonts/Inter-400.woff2 +0 -0
  184. package/dist/skills/hyperframes/assets/frame-presets/code-editorial/fonts/Inter-700.woff2 +0 -0
  185. package/dist/skills/hyperframes/assets/frame-presets/code-editorial/fonts/JetBrainsMono-400.woff2 +0 -0
  186. package/dist/skills/hyperframes/assets/frame-presets/code-editorial/fonts/JetBrainsMono-700.woff2 +0 -0
  187. package/dist/skills/hyperframes/assets/frame-presets/code-editorial/fonts/OFL-eb-garamond.txt +93 -0
  188. package/dist/skills/hyperframes/assets/frame-presets/code-editorial/fonts/OFL-inter.txt +93 -0
  189. package/dist/skills/hyperframes/assets/frame-presets/code-editorial/fonts/OFL-jetbrains-mono.txt +93 -0
  190. package/dist/skills/hyperframes/assets/frame-presets/code-editorial/frame-showcase.html +1438 -0
  191. package/dist/skills/hyperframes/assets/frame-presets/coral/FRAME.md +314 -0
  192. package/dist/skills/hyperframes/assets/frame-presets/coral/caption-skin.html +225 -0
  193. package/dist/skills/hyperframes/assets/frame-presets/coral/frame-showcase.html +1268 -0
  194. package/dist/skills/hyperframes/assets/frame-presets/creative-mode/FRAME.md +333 -0
  195. package/dist/skills/hyperframes/assets/frame-presets/creative-mode/caption-skin.html +226 -0
  196. package/dist/skills/hyperframes/assets/frame-presets/creative-mode/frame-showcase.html +1330 -0
  197. package/dist/skills/hyperframes/assets/frame-presets/daisy-days/FRAME.md +274 -0
  198. package/dist/skills/hyperframes/assets/frame-presets/daisy-days/caption-skin.html +229 -0
  199. package/dist/skills/hyperframes/assets/frame-presets/daisy-days/frame-showcase.html +1444 -0
  200. package/dist/skills/hyperframes/assets/frame-presets/editorial-forest/FRAME.md +265 -0
  201. package/dist/skills/hyperframes/assets/frame-presets/editorial-forest/caption-skin.html +222 -0
  202. package/dist/skills/hyperframes/assets/frame-presets/editorial-forest/frame-showcase.html +1273 -0
  203. package/dist/skills/hyperframes/references/captions.md +46 -0
  204. package/dist/skills/hyperframes/references/film.md +47 -0
  205. package/dist/skills/hyperframes/references/format.md +157 -0
  206. package/dist/skills/hyperframes/references/look.md +69 -0
  207. package/dist/skills/hyperframes/references/motion.md +94 -0
  208. package/dist/skills/hyperframes/references/overlays.md +39 -0
  209. package/dist/skills/hyperframes/references/plugin-installation.md +3 -3
  210. package/dist/skills/hyperframes/references/review.md +51 -0
  211. package/dist/skills/hyperframes/references/runtimes.md +43 -0
  212. package/dist/skills/hyperframes/references/skill-lifecycle.md +21 -13
  213. package/dist/skills/hyperframes/references/sound.md +43 -0
  214. package/dist/skills/hyperframes/references/spec.md +76 -0
  215. package/dist/skills/hyperframes/references/story.md +103 -0
  216. package/dist/skills/hyperframes/references/storyboard-format.md +30 -22
  217. package/dist/skills/hyperframes/references/storyboard.md +36 -0
  218. package/dist/skills/hyperframes/references/types/3d.md +25 -0
  219. package/dist/skills/hyperframes/references/types/character.md +20 -0
  220. package/dist/skills/hyperframes/references/types/data.md +19 -0
  221. package/dist/skills/hyperframes/references/types/explainer.md +34 -0
  222. package/dist/skills/hyperframes/references/types/launch.md +31 -0
  223. package/dist/skills/hyperframes/references/types/music.md +24 -0
  224. package/dist/skills/hyperframes/references/types/vertical.md +23 -0
  225. package/dist/skills/hyperframes/scripts/bake-basemap.mjs +324 -0
  226. package/dist/skills/hyperframes/scripts/lib/main-module.test.mjs +1 -6
  227. package/dist/skills/hyperframes/scripts/locate.mjs +228 -0
  228. package/dist/skills/hyperframes-cli/SKILL.md +76 -179
  229. package/dist/skills/hyperframes-cli/references/beats.md +1 -1
  230. package/dist/skills/hyperframes-cli/references/cloud.md +2 -2
  231. package/dist/skills/hyperframes-cli/references/cloudrun.md +1 -1
  232. package/dist/skills/hyperframes-cli/references/conventions.md +17 -0
  233. package/dist/skills/hyperframes-cli/references/feedback.md +14 -0
  234. package/dist/skills/hyperframes-cli/references/init-and-scaffold.md +11 -7
  235. package/dist/skills/hyperframes-cli/references/lambda.md +1 -1
  236. package/dist/skills/hyperframes-cli/references/lint-validate-inspect.md +19 -8
  237. package/dist/skills/hyperframes-cli/references/preview-render.md +8 -2
  238. package/dist/skills/hyperframes-cli/references/upgrade-info-misc.md +8 -0
  239. package/dist/skills/media-use/SKILL.md +47 -91
  240. package/dist/skills/media-use/audio/references/bgm.md +1 -1
  241. package/dist/skills/media-use/audio/references/captions/authoring.md +1 -2
  242. package/dist/skills/media-use/audio/references/captions/motion.md +5 -5
  243. package/dist/skills/media-use/audio/references/tts.md +0 -3
  244. package/dist/skills/media-use/audio/scripts/audio.mjs +5 -6
  245. package/dist/skills/media-use/audio/scripts/carve.mjs +560 -0
  246. package/dist/skills/media-use/audio/scripts/carve.test.mjs +254 -0
  247. package/dist/skills/media-use/audio/scripts/extract-audio-data.py +199 -0
  248. package/dist/skills/media-use/references/local.md +24 -0
  249. package/dist/skills/media-use/references/memory.md +4 -4
  250. package/dist/skills/media-use/references/mixing.md +71 -0
  251. package/dist/skills/media-use/references/operations.md +1 -1
  252. package/dist/skills/media-use/scripts/compatibility.test.mjs +1 -56
  253. package/dist/skills/media-use/scripts/lib/prefs-store.mjs +1 -1
  254. package/dist/skills/media-use/scripts/lib/recipe-store.mjs +1 -1
  255. package/dist/skills/media-use/scripts/prefs.mjs +2 -3
  256. package/dist/skills/media-use/scripts/recipe.mjs +1 -3
  257. package/dist/{skills-WHKMWO2D.js → skills-3WEVO3NU.js} +20 -13
  258. package/dist/{skillsUpdateCheck-XQGZGJJG.js → skillsUpdateCheck-BFPWFOK5.js} +3 -3
  259. package/dist/{snapshot-M4NUUSNU.js → snapshot-WDQ6S7CJ.js} +457 -98
  260. package/dist/{src-6MSC62U2.js → src-NPR2JZOJ.js} +11 -11
  261. package/dist/{src-4UYM2K3S.js → src-RZ574OKP.js} +8 -8
  262. package/dist/{staticProjectServer-ERDTFP45.js → staticProjectServer-FTGTEZI4.js} +17 -17
  263. package/dist/studio/assets/{hyperframes-player-DEncBxR7.js → hyperframes-player-CoOdf435.js} +1 -1
  264. package/dist/studio/assets/{index-Cc22mgvY.js → index-CR85xg2x.js} +1 -1
  265. package/dist/studio/assets/{index-BABXr78Q.js → index-C_6rTpaB.js} +5 -5
  266. package/dist/studio/index.html +1 -1
  267. package/dist/{studio-api-SAKD3VKC.js → studio-api-TAWB7B23.js} +11 -11
  268. package/dist/{studioServer-IRI7EVOM.js → studioServer-HRQGJTBU.js} +48 -48
  269. package/dist/{telemetry-F4XADVAF.js → telemetry-QZ6HJF4W.js} +3 -3
  270. package/dist/templates/_shared/AGENTS.md +14 -19
  271. package/dist/templates/_shared/CLAUDE.md +14 -19
  272. package/dist/templates/blank/index.html +10 -4
  273. package/dist/{timeline-5I444RRE.js → timeline-IKUEW42T.js} +20 -19
  274. package/dist/{tokens-LRRYM35A.js → tokens-AUGUEWHS.js} +2 -2
  275. package/dist/{transcribe-44XDFNVU.js → transcribe-7734CG3N.js} +18 -18
  276. package/dist/{transcribe-WHYHWAB2.js → transcribe-FWU6EMEO.js} +12 -12
  277. package/dist/{updateCheck-7CPH3CAZ.js → updateCheck-VIPQ3FPW.js} +2 -2
  278. package/dist/{upgrade-WW4GQ2RI.js → upgrade-4VNDQTVO.js} +2 -2
  279. package/dist/{urlDownloader-OHLLP45A.js → urlDownloader-6CXL4CL7.js} +8 -8
  280. package/dist/{validate-VNCDH2LW.js → validate-QWCMVWID.js} +23 -23
  281. package/dist/{video-5OHTLL2D.js → video-245Q5WN4.js} +9 -9
  282. package/dist/warmCheck.js +36 -36
  283. package/package.json +1 -1
  284. package/dist/chunk-R2SQBPMH.js +0 -3805
  285. package/dist/skills/hyperframes/references/brief-contract.md +0 -108
  286. package/dist/skills/hyperframes/references/brief-format.md +0 -72
  287. package/dist/skills/hyperframes/references/capability-menu.md +0 -47
  288. package/dist/skills/hyperframes/references/frame-worker-core.md +0 -82
  289. package/dist/skills/hyperframes/references/intent-interview.md +0 -73
  290. package/dist/skills/hyperframes/references/pitch-round.md +0 -40
  291. package/dist/skills/hyperframes/references/production-loop.md +0 -26
  292. package/dist/skills/hyperframes/references/review-loop.md +0 -37
  293. package/dist/skills/hyperframes/references/route-briefs.md +0 -11
  294. package/dist/skills/hyperframes/references/routes/embedded-captions.md +0 -11
  295. package/dist/skills/hyperframes/references/routes/faceless-explainer.md +0 -12
  296. package/dist/skills/hyperframes/references/routes/general-video.md +0 -12
  297. package/dist/skills/hyperframes/references/routes/motion-graphics.md +0 -11
  298. package/dist/skills/hyperframes/references/routes/music-to-video.md +0 -12
  299. package/dist/skills/hyperframes/references/routes/pr-to-video.md +0 -28
  300. package/dist/skills/hyperframes/references/routes/product-launch-video.md +0 -13
  301. package/dist/skills/hyperframes/references/routes/remotion-to-hyperframes.md +0 -9
  302. package/dist/skills/hyperframes/references/routes/slideshow.md +0 -11
  303. package/dist/skills/hyperframes/references/routes/talking-head-recut.md +0 -11
  304. package/dist/skills/hyperframes/references/script-format.md +0 -52
  305. package/dist/skills/hyperframes/references/subagent-dispatch.md +0 -35
  306. package/dist/skills/hyperframes/references/workflow-catalog.md +0 -10
  307. package/dist/skills/hyperframes/scripts/lib/frame-packets-core.mjs +0 -176
  308. package/dist/skills/media-use/audio/scripts/lib/host-audio.mjs +0 -28
  309. package/dist/skills/media-use/audio/scripts/lib/host-audio.test.mjs +0 -106
@@ -0,0 +1,560 @@
1
+ #!/usr/bin/env node
2
+ /**
3
+ * Apply a voiceover carve to a composition, from the command line.
4
+ *
5
+ * The carve is an analysis: it listens to a voice track, finds the bands it
6
+ * occupies, and writes a chain of dips into the music bed plus a level match. In
7
+ * Studio a panel runs it. This is the same analysis for an agent that has no
8
+ * panel to click — identical functions from `@hyperframes/core`, identical
9
+ * output, so a composition carved here and one carved in Studio are the same
10
+ * three attributes.
11
+ *
12
+ * node carve.mjs --comp index.html
13
+ * node carve.mjs --comp index.html --bed music-bed --voice narration \
14
+ * --voice interview-guest --strength 0.45
15
+ *
16
+ * With no --bed/--voice it works out the tracks itself: the bed, and every voice
17
+ * playing over it. `--voice` may be repeated to name them instead. Every named
18
+ * voice is analysed together, so a bed running under a narrator and an answer makes
19
+ * room for both.
20
+ *
21
+ * Needs `ffmpeg` on PATH (to decode the audio) and `@hyperframes/core` resolvable
22
+ * from the composition's project (`npm i -D @hyperframes/core`) — the CLI bundles
23
+ * core inline rather than shipping it as a package, so it cannot be borrowed from
24
+ * there.
25
+ */
26
+
27
+ import { execFileSync } from "node:child_process";
28
+ import { createRequire } from "node:module";
29
+ import { readFileSync, writeFileSync } from "node:fs";
30
+ import { dirname, resolve } from "node:path";
31
+ import { pathToFileURL } from "node:url";
32
+ import { isMainModule } from "./lib/main-module.mjs";
33
+
34
+ /** Sample rate the analysis runs at. Matches Studio's own decode rate, so the
35
+ * bands and envelopes come out the same either way. */
36
+ const SAMPLE_RATE = 48000;
37
+
38
+ /** Default carve strength. 0.25 kept the bed present but still fighting the voice. */
39
+ export const DEFAULT_STRENGTH = 0.8;
40
+
41
+ const usage = `carve.mjs --comp <file.html> [--bed <elementId>] [--voice <elementId> ...]
42
+ [--strength 0..1] [--dry-run] [--core <dir>]
43
+
44
+ --bed id of the music track that gets carved (detected if omitted)
45
+ --voice id of a voice to make room for; repeatable (detected if omitted)
46
+ --strength how hard to carve, 0..1 (default ${DEFAULT_STRENGTH})
47
+ --dry-run report what it would write, touch nothing
48
+ --core directory to resolve @hyperframes/core from (default: the comp's)`;
49
+
50
+ export function parseArgs(argv) {
51
+ const args = { strength: DEFAULT_STRENGTH, dryRun: false, voices: [] };
52
+ for (let i = 0; i < argv.length; i += 1) {
53
+ const flag = argv[i];
54
+ const next = () => {
55
+ const value = argv[i + 1];
56
+ if (value === undefined) fail(`${flag} needs a value`);
57
+ i += 1;
58
+ return value;
59
+ };
60
+ if (flag === "--comp") args.comp = next();
61
+ else if (flag === "--bed") args.bed = next();
62
+ else if (flag === "--voice") args.voices.push(next());
63
+ else if (flag === "--strength") args.strength = Number(next());
64
+ else if (flag === "--core") args.core = next();
65
+ else if (flag === "--dry-run") args.dryRun = true;
66
+ else if (flag === "-h" || flag === "--help") fail(usage, 0);
67
+ else fail(`unknown flag: ${flag}\n\n${usage}`);
68
+ }
69
+ if (!args.comp) fail(`--comp is required\n\n${usage}`);
70
+ if (!Number.isFinite(args.strength) || args.strength < 0 || args.strength > 1) {
71
+ fail("--strength must be a number from 0 to 1");
72
+ }
73
+ return args;
74
+ }
75
+
76
+ function fail(message, code = 1) {
77
+ process.stderr.write(`${message}\n`);
78
+ process.exit(code);
79
+ }
80
+
81
+ /**
82
+ * Load the carve analysis out of `@hyperframes/core`.
83
+ *
84
+ * Resolved from the project rather than from this script, which lives wherever
85
+ * the skill was installed — a sibling of the composition is what has the
86
+ * dependency.
87
+ */
88
+ export async function loadCore(fromDir) {
89
+ const require = createRequire(pathToFileURL(resolve(fromDir, "package.json")));
90
+
91
+ /*
92
+ * Two constraints at once, and satisfying either alone is broken:
93
+ *
94
+ * 1. Anchored at the PROJECT, not at this script. This file lives wherever
95
+ * the skill was installed, which has no @hyperframes/core; the
96
+ * composition's project is what holds the dependency. So a bare
97
+ * `import("@hyperframes/core/audio-carve")` from here cannot work — bare
98
+ * specifiers resolve relative to the importing module.
99
+ * 2. Honouring the package's export CONDITIONS. `require.resolve` asks for
100
+ * "require"/"node". The workspace manifest declares `node`, so this
101
+ * resolved fine inside the monorepo — but the PUBLISHED manifest carries
102
+ * only `import` + `types`, so every consumer of the released package got
103
+ * ERR_PACKAGE_PATH_NOT_EXPORTED for a package that ships the file. That
104
+ * is the audience this skill is shipped to, so the script was broken
105
+ * everywhere except where it was developed.
106
+ *
107
+ * Keep the project anchor; fall back to the package's declared `import`
108
+ * target when no require-resolvable condition exists.
109
+ */
110
+ const load = async (subpath) => {
111
+ const spec = `@hyperframes/core/${subpath}`;
112
+ try {
113
+ return await import(pathToFileURL(require.resolve(spec)).href);
114
+ } catch (error) {
115
+ if (error?.code !== "ERR_PACKAGE_PATH_NOT_EXPORTED") throw error;
116
+ // `./package.json` is exported by every manifest, so this always resolves
117
+ // and gives us the package root without guessing at node_modules layout.
118
+ const pkgPath = require.resolve("@hyperframes/core/package.json");
119
+ const pkg = JSON.parse(readFileSync(pkgPath, "utf-8"));
120
+ const entry = pkg.exports?.[`./${subpath}`];
121
+ const target = typeof entry === "string" ? entry : (entry?.import ?? entry?.default ?? null);
122
+ if (!target) {
123
+ fail(
124
+ `@hyperframes/core does not export ./${subpath}\n` +
125
+ ` found at: ${pkgPath} (version ${pkg.version})\n` +
126
+ ` update it: npm i -D @hyperframes/core`,
127
+ );
128
+ }
129
+ return import(pathToFileURL(resolve(dirname(pkgPath), target)).href);
130
+ }
131
+ };
132
+
133
+ try {
134
+ return {
135
+ carve: await load("audio-carve"),
136
+ fx: await load("audio-fx"),
137
+ };
138
+ } catch (error) {
139
+ fail(
140
+ `cannot load @hyperframes/core from ${fromDir}\n` +
141
+ ` is it installed there? npm i -D @hyperframes/core\n` +
142
+ ` or point at one: --core <dir containing node_modules/@hyperframes/core>\n` +
143
+ ` (${error.code ?? "error"}: ${error.message.split("\n")[0]})`,
144
+ );
145
+ }
146
+ }
147
+
148
+ /**
149
+ * The `sources` a carve should record for these voices, on this bed.
150
+ *
151
+ * SKILL.md states the invariant: "A carve against more than one clip id is
152
+ * wrong. Group the clips and carve against the group." Naming the group lets
153
+ * `resolveCarveSourceIds` resolve membership at analysis time, so a voice added
154
+ * later is covered without editing `sources` — whereas a list of clip ids rots
155
+ * silently the moment a fourth narration clip appears. The lint rule
156
+ * `audio_carve_ungrouped_sources` enforces exactly this.
157
+ *
158
+ * This script was writing clip ids unconditionally, so it violated its own
159
+ * skill's invariant and tripped its own lint rule on every run. When every
160
+ * voice shares one group, record the group. Mixed or ungrouped voices keep
161
+ * their ids, and the lint rule then correctly tells the author to group them.
162
+ *
163
+ * The bed has to be part of the decision, because the group form resolves
164
+ * LATER and wider than it looks. If the bed is itself a member of the voices'
165
+ * group, `resolveCarveSourceIds` expands that id to every current member on the
166
+ * next analysis — including the bed — and the bed ends up carved against
167
+ * itself, which SKILL.md calls a bug rather than a mix choice. This run cannot
168
+ * see it: `main()` sums the voice list it detected and never round-trips
169
+ * through group resolution, so the first pass is correct and only the next
170
+ * re-analysis in Studio is wrong. So decline the group form there and fall back
171
+ * to clip ids, which is exactly the case `audio_carve_ungrouped_sources` exists
172
+ * to put in front of the author.
173
+ *
174
+ * Only an `<audio>` bed can trip it: group membership is audio-only
175
+ * (`audioGroupOf`), so `data-audio-group` on a `<video>` bed is ignored by core
176
+ * and expanding a group can never pull it in.
177
+ */
178
+ export function carveSources(voices, bed, members) {
179
+ const group = sharedVoiceGroup(voices);
180
+ return group && !groupSourceRefusal(voices, bed, members) ? [group] : voices.map((v) => v.id);
181
+ }
182
+
183
+ /** The one group every voice belongs to, or null if they do not share exactly one. */
184
+ function sharedVoiceGroup(voices) {
185
+ const groups = voices.map((v) => attrOf(v.tag, "data-audio-group"));
186
+ const first = groups[0];
187
+ return Boolean(first) && groups.every((g) => g === first) ? first : null;
188
+ }
189
+
190
+ /**
191
+ * Why naming the voices' shared group would persist something this run did not
192
+ * analyse — or null when the group is safe to name.
193
+ *
194
+ * `members` is every `<audio>` in the composition as `{id, group, nameKind}`,
195
+ * with `nameKind` from core's `classifyAudioName`, so this and Studio's picker
196
+ * classify the same way.
197
+ *
198
+ * Required, deliberately not defaulting to `[]`. With an empty list the `mixed`
199
+ * refusal below cannot fire, so a call that forgot the argument would return the
200
+ * group form and restore the exact behaviour this function exists to prevent —
201
+ * silently, because the first CLI pass is correct either way and only a later
202
+ * Studio re-analysis is wrong. A missing argument throws on `members.filter`
203
+ * instead.
204
+ *
205
+ * Two refusals, and both exist because the group form resolves LATER and WIDER
206
+ * than the analysis: `resolveCarveSourceIds` expands a group id to every current
207
+ * member on every analysis, and `resolveCarveVoices` keeps any audio member with
208
+ * a src. `main()` meanwhile sums the voice list `detectTracks` returned, so the
209
+ * first pass looks correct however wrong the persisted attribute is.
210
+ *
211
+ * `bed` — the bed is a member, so it would be handed to itself as a voice
212
+ * and carved against its own content.
213
+ * `mixed` — a member classified music or sfx is not a voice this run measured,
214
+ * so it would enter the sidechain on the next analysis and duck the
215
+ * bed under a whoosh.
216
+ *
217
+ * Deliberately NOT a refusal: a member classified `voice` or `unknown` that this
218
+ * run left out. That is the group form working as designed — `detectTracks` only
219
+ * takes voices that overlap the bed, and picking up a clip that starts playing
220
+ * later without an edit to `sources` is the whole reason SKILL.md says to name
221
+ * the group. Refusing there would collapse the group form into clip ids for
222
+ * every ordinary narration sequence.
223
+ */
224
+ export function groupSourceRefusal(voices, bed, members) {
225
+ const group = sharedVoiceGroup(voices);
226
+ if (!group) return null;
227
+ if (bed?.kind === "audio" && attrOf(bed.tag, "data-audio-group") === group) {
228
+ return { group, reason: "bed", ids: [bed.id] };
229
+ }
230
+ const analysed = new Set(voices.map((v) => v.id));
231
+ const strays = members
232
+ .filter(
233
+ (m) =>
234
+ m.group === group &&
235
+ !analysed.has(m.id) &&
236
+ (m.nameKind === "music" || m.nameKind === "sfx"),
237
+ )
238
+ .map((m) => m.id);
239
+ return strays.length > 0 ? { group, reason: "mixed", ids: strays } : null;
240
+ }
241
+
242
+ /** Mono float PCM for one media file, via ffmpeg. */
243
+ function decode(path) {
244
+ let raw;
245
+ try {
246
+ raw = execFileSync(
247
+ "ffmpeg",
248
+ [
249
+ "-v",
250
+ "error",
251
+ "-i",
252
+ path,
253
+ "-vn",
254
+ "-ac",
255
+ "1",
256
+ "-ar",
257
+ String(SAMPLE_RATE),
258
+ "-f",
259
+ "f32le",
260
+ "-",
261
+ ],
262
+ { maxBuffer: 1 << 30 },
263
+ );
264
+ } catch (error) {
265
+ fail(`could not decode ${path}\n ${error.message.split("\n")[0]}`);
266
+ }
267
+ if (raw.length === 0) fail(`no audio in ${path}`);
268
+ return new Float32Array(raw.buffer, raw.byteOffset, raw.length / 4);
269
+ }
270
+
271
+ const attrOf = (tag, name) => tag.match(new RegExp(`\\s${name}="([^"]*)"`, "i"))?.[1] ?? null;
272
+
273
+ const unescapeAttr = (value) =>
274
+ value
275
+ .replace(/&quot;/g, '"')
276
+ .replace(/&#39;/g, "'")
277
+ .replace(/&amp;/g, "&");
278
+
279
+ const escapeAttr = (value) => value.replace(/&/g, "&amp;").replace(/"/g, "&quot;");
280
+
281
+ /** Every media element with a src, as {id, tag, kind}. */
282
+ function mediaElements(html) {
283
+ const found = [];
284
+ for (const match of html.matchAll(/<(audio|video)\b[^>]*>/gi)) {
285
+ const tag = match[0];
286
+ // `\sid=` and not `id=`: `data-hf-id` would match first.
287
+ const id = tag.match(/\sid="([^"]+)"/)?.[1];
288
+ if (id && attrOf(tag, "src")) found.push({ id, tag, kind: match[1].toLowerCase() });
289
+ }
290
+ return found;
291
+ }
292
+
293
+ /**
294
+ * Work out which track is the bed and which tracks are its voices.
295
+ *
296
+ * Names first, because they are what the author already told us and the answer is
297
+ * explainable: a track whose id or filename looks like music is the bed, ones that
298
+ * look like speech are voices, SFX-shaped names are neither. `classifyAudioName`
299
+ * comes from core so Studio's own picker and this cannot disagree.
300
+ *
301
+ * EVERY voice over the bed, not one of them. A bed usually runs under a whole
302
+ * sequence, and they are analysed together — so there is nothing to disambiguate,
303
+ * which is why this no longer refuses when several tracks look like speech.
304
+ *
305
+ * Only tracks that actually play while the bed does: one somewhere else on the
306
+ * timeline cannot mask it. It still refuses when it cannot find a bed at all, or
307
+ * finds no voice to make room for.
308
+ */
309
+ function detectTracks(html, given, classify, overlaps) {
310
+ const all = mediaElements(html);
311
+ const kindOf = (el) => classify(el.id, unescapeAttr(attrOf(el.tag, "src") ?? ""));
312
+ const spanOf = (el) => {
313
+ const raw = attrOf(el.tag, "data-duration");
314
+ const n = raw === null ? Number.NaN : Number(raw);
315
+ return {
316
+ start: startOf(el.tag),
317
+ duration: Number.isFinite(n) ? n : null,
318
+ };
319
+ };
320
+ const pick = (id, what) => {
321
+ const found = all.find((el) => el.id === id);
322
+ if (!found) fail(`no <audio>/<video> with id="${id}" in the composition`);
323
+ return { ...found, why: `--${what}` };
324
+ };
325
+
326
+ let bed = given.bed ? pick(given.bed, "bed") : null;
327
+ const named = given.voices.map((id) => pick(id, "voice"));
328
+
329
+ if (!bed) {
330
+ const others = all.filter((el) => !named.some((v) => v.id === el.id));
331
+ const music = others.filter((el) => kindOf(el) === "music");
332
+ if (music.length === 1) bed = { ...music[0], why: "name looks like music" };
333
+ else if (music.length > 1) {
334
+ fail(
335
+ `several tracks look like music (${music.map((el) => el.id).join(", ")}) — name one with --bed`,
336
+ );
337
+ } else if (others.length === 1) {
338
+ bed = { ...others[0], why: "only track left" };
339
+ } else {
340
+ fail(
341
+ `cannot tell which track is the music bed\n` +
342
+ ` media in the composition: ${all.map((el) => el.id).join(", ") || "none"}\n` +
343
+ ` name it with --bed`,
344
+ );
345
+ }
346
+ }
347
+
348
+ const bedSpan = spanOf(bed);
349
+ const overlapping = (el) => overlaps(bedSpan, spanOf(el));
350
+ const plausible = all
351
+ .filter((el) => el.id !== bed.id && kindOf(el) !== "music" && kindOf(el) !== "sfx")
352
+ .filter(overlapping);
353
+ // A voiceover is normally its own <audio>. Video counts only when no audio track
354
+ // is left to be the voice — a talking-head recut — because otherwise every B-roll
355
+ // clip in the composition reads as somebody talking.
356
+ const spoken = plausible.filter((el) => el.kind === "audio");
357
+ const pool = spoken.length > 0 ? spoken : plausible;
358
+ const voices = named.length
359
+ ? named
360
+ : pool.map((el) => ({
361
+ ...el,
362
+ why: kindOf(el) === "voice" ? "name looks like a voice" : "plays over the bed",
363
+ }));
364
+
365
+ const usable = voices.filter((el) => attrOf(el.tag, "src"));
366
+ if (usable.length === 0) {
367
+ fail(
368
+ `no voice to make room for on ${bed.id}\n` +
369
+ ` media in the composition: ${all.map((el) => el.id).join(", ") || "none"}\n` +
370
+ ` name one with --voice`,
371
+ );
372
+ }
373
+ return { bed, voices: usable, all };
374
+ }
375
+
376
+ const startOf = (tag) => {
377
+ const raw = Number(attrOf(tag, "data-start"));
378
+ return Number.isFinite(raw) ? raw : 0;
379
+ };
380
+
381
+ async function main() {
382
+ const args = parseArgs(process.argv.slice(2));
383
+ const compPath = resolve(args.comp);
384
+ const compDir = dirname(compPath);
385
+ const { carve: carveApi, fx: fxApi } = await loadCore(args.core ? resolve(args.core) : compDir);
386
+
387
+ const html = readFileSync(compPath, "utf-8");
388
+ const {
389
+ bed: bedEl,
390
+ voices,
391
+ all: media,
392
+ } = detectTracks(html, args, carveApi.classifyAudioName, carveApi.clipsOverlap);
393
+ // Group membership + name classification for every audio track, so the source
394
+ // decision can see what the group will resolve to later and not just what this
395
+ // run analysed.
396
+ const members = media
397
+ .filter((el) => el.kind === "audio")
398
+ .map((el) => ({
399
+ id: el.id,
400
+ group: attrOf(el.tag, "data-audio-group"),
401
+ nameKind: carveApi.classifyAudioName(el.id, unescapeAttr(attrOf(el.tag, "src") ?? "")),
402
+ }));
403
+ const bedTag = bedEl.tag;
404
+ const bedSrc = attrOf(bedTag, "src");
405
+ process.stdout.write(
406
+ `bed ${bedEl.id} (${bedEl.why})\n` +
407
+ voices.map((v) => `voice ${v.id} (${v.why})`).join("\n") +
408
+ "\n",
409
+ );
410
+
411
+ const profile = carveApi.carveProfile(args.strength);
412
+ // Every voice summed onto the BED's clock before anything is measured. One
413
+ // question — where and when is speech masking this bed — with one answer, even
414
+ // when the answer comes from several people at different times.
415
+ const voice = carveApi.mixCarveSources(
416
+ voices.map((v) => ({
417
+ samples: decode(resolve(compDir, unescapeAttr(attrOf(v.tag, "src")))),
418
+ offsetSeconds: startOf(v.tag) - startOf(bedTag),
419
+ })),
420
+ SAMPLE_RATE,
421
+ );
422
+ if (voice.length === 0) fail("the voices do not overlap the bed, so there is nothing to carve");
423
+ const bands = carveApi.analyseCarveBands(voice, SAMPLE_RATE, profile);
424
+
425
+ // The level half of the carve needs both sides: "how far over the speech is this
426
+ // bed" cannot be answered by listening to one of them. No offset — the mix is
427
+ // already on the bed's clock.
428
+ const bed = profile.duckDb > 0 ? decode(resolve(compDir, unescapeAttr(bedSrc))) : null;
429
+ const duck = bed ? carveApi.analyseCarveDuck(voice, bed, SAMPLE_RATE, profile, 0) : [];
430
+
431
+ // Anything the author built by hand survives a carve; only the previous
432
+ // carve's own nodes are replaced. That is what `fromCarve` is for.
433
+ const existingChain = attrOf(bedTag, "data-fx-chain");
434
+ const existingNodes = existingChain
435
+ ? fxApi.parseAudioFxChain(unescapeAttr(existingChain)).nodes
436
+ : [];
437
+ const kept = existingNodes.filter((n) => !n.fromCarve);
438
+ // Lanes belonging to the carve being replaced, addressed by the ids the OLD
439
+ // nodes had. Taken before anything is minted: those ids are freed by the
440
+ // replacement and a new node can be handed one of them, so reading them off the
441
+ // new chain would keep exactly the stale lanes it is supposed to drop.
442
+ const stalePrefixes = existingNodes.filter((n) => n.fromCarve && n.id).map((n) => `fx.${n.id}.`);
443
+
444
+ let claimed = { version: 1, nodes: kept };
445
+ const mint = (node) => {
446
+ const withId = { ...node, id: fxApi.mintAudioFxNodeId(claimed), fromCarve: true };
447
+ claimed = { version: 1, nodes: [...claimed.nodes, withId] };
448
+ return withId;
449
+ };
450
+ const bandNodes = bands.map((band) => mint(carveApi.carveBandsToChain([band]).nodes[0]));
451
+
452
+ const duckNode =
453
+ duck.length > 0
454
+ ? mint({
455
+ type: "gain",
456
+ enabled: true,
457
+ params: {
458
+ ...fxApi.defaultAudioFxParams("gain"),
459
+ gain: 0,
460
+ },
461
+ })
462
+ : null;
463
+ const chain = {
464
+ version: 1,
465
+ nodes: [...bandNodes, ...(duckNode ? [duckNode] : []), ...kept],
466
+ };
467
+
468
+ /**
469
+ * One carve envelope as a lane on the BED's clock.
470
+ *
471
+ * Nothing to shift: the voices were summed onto that clock before the analysis
472
+ * ran. A lane does hold its first value backwards to the start of its clip, so an
473
+ * envelope that begins later needs an explicit "no cut" at zero or the bed starts
474
+ * out ducked.
475
+ */
476
+ const laneFor = (id, points) => {
477
+ const timed = points
478
+ .map((p) => ({ t: Number(p.t.toFixed(3)), v: p.v }))
479
+ .filter((p) => p.t >= 0);
480
+ if ((timed[0]?.t ?? 0) > 0) timed.unshift({ t: 0, v: 0 });
481
+ return timed.length > 1 ? [{ target: `fx.${id}.gain`, points: timed }] : [];
482
+ };
483
+
484
+ // Every carve follows the speech: a fixed depth thins the bed through every pause.
485
+ const carvedLanes = [
486
+ ...carveApi
487
+ .analyseCarveDynamics(voice, SAMPLE_RATE, bands)
488
+ .flatMap((dyn, i) => (bandNodes[i]?.id ? laneFor(bandNodes[i].id, dyn.points) : [])),
489
+ ...(duckNode?.id && duck.length > 0 ? laneFor(duckNode.id, duck) : []),
490
+ ];
491
+
492
+ // Hand-drawn lanes are kept the same way hand-built nodes are: by dropping only
493
+ // the ones that addressed the previous carve's nodes.
494
+ const existingAutomation = attrOf(bedTag, "data-automation");
495
+ const carriedLanes = existingAutomation
496
+ ? (JSON.parse(unescapeAttr(existingAutomation)).lanes ?? []).filter(
497
+ (lane) => !stalePrefixes.some((prefix) => String(lane.target).startsWith(prefix)),
498
+ )
499
+ : [];
500
+ const lanes = [...carriedLanes, ...carvedLanes];
501
+
502
+ const settings = {
503
+ enabled: true,
504
+ sources: carveSources(voices, bedEl, members),
505
+ strength: args.strength,
506
+ };
507
+ // Say why the group form was declined, or the lint rule tells the author to
508
+ // group clips they have already grouped.
509
+ const refusal = groupSourceRefusal(voices, bedEl, members);
510
+ if (refusal) {
511
+ process.stderr.write(
512
+ refusal.reason === "bed"
513
+ ? `note bed ${bedEl.id} is in group "${refusal.group}" with the voices, so\n` +
514
+ ` sources are clip ids: naming that group would carve the bed\n` +
515
+ ` against itself on the next analysis. Move the bed to its own group.\n`
516
+ : `note group "${refusal.group}" also holds ${refusal.ids.join(", ")}, which this run\n` +
517
+ ` did not analyse (music/sfx by name), so sources are clip ids: naming\n` +
518
+ ` the group would pull them into the sidechain on the next analysis.\n` +
519
+ ` Move them out of the voice group.\n`,
520
+ );
521
+ }
522
+ const written =
523
+ ` data-fx-carve="${escapeAttr(JSON.stringify(settings))}"` +
524
+ ` data-fx-chain="${escapeAttr(fxApi.serializeAudioFxChain(chain))}"` +
525
+ (lanes.length > 0
526
+ ? ` data-automation="${escapeAttr(JSON.stringify({ version: 1, lanes }))}"`
527
+ : "");
528
+
529
+ process.stdout.write(
530
+ `carve strength ${args.strength}, ${voices.length} voice${voices.length === 1 ? "" : "s"}\n` +
531
+ `bands ${bands.map((b) => `${b.freq}Hz ${b.gainDb}dB q${b.q}`).join(", ")}\n` +
532
+ `level ${
533
+ duckNode
534
+ ? `${duck.length}-point envelope, floor ${Math.min(...duck.map((p) => p.v))} dB`
535
+ : "no level match at this strength"
536
+ }\n` +
537
+ `lanes ${carvedLanes.length} carve${carriedLanes.length ? ` + ${carriedLanes.length} kept` : ""}\n`,
538
+ );
539
+ if (args.dryRun) {
540
+ process.stdout.write("dry run: nothing written\n");
541
+ return;
542
+ }
543
+
544
+ let stripped = bedTag;
545
+ for (const attr of ["data-fx-carve", "data-fx-chain", "data-automation"]) {
546
+ stripped = stripped.replace(new RegExp(`\\s${attr}="[^"]*"`, "i"), "");
547
+ }
548
+ // Inserted before the tag's own closing ">", which is the only place they can
549
+ // go: `stripped` is the opening tag alone, so appending would land outside it.
550
+ const nextTag = stripped.replace(/\/?>$/, (close) => `${written}${close}`);
551
+ if (nextTag === stripped) fail("attribute write produced no change — refusing to save");
552
+ writeFileSync(compPath, html.replace(bedTag, nextTag));
553
+ process.stdout.write(`wrote ${args.comp} (id="${bedEl.id}")\n`);
554
+ }
555
+
556
+ // Only run as a CLI. Guarded so the pure helpers above can be unit-tested by
557
+ // importing this module (`skills/**/*.test.mjs`, run by `bun run test:skills`).
558
+ if (isMainModule(import.meta.url)) {
559
+ await main();
560
+ }