hyperframes 0.8.159 → 0.8.161
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -0
- package/dist/{add-7UMRT6IJ.js → add-7U5TQGSQ.js} +11 -11
- package/dist/{animatedGifPrep-COFZMEVD.js → animatedGifPrep-YAJTDXB7.js} +6 -6
- package/dist/api.js +16 -16
- package/dist/{asset-N37XIJTB.js → asset-N3JO5LHY.js} +2 -2
- package/dist/{assetCataloger-ZOQ67MGR.js → assetCataloger-BIDQA34M.js} +2 -2
- package/dist/audio-QNPSENQR.js +1131 -0
- package/dist/{auth-GKFS2PL6.js → auth-HINUM4A7.js} +1 -1
- package/dist/{autoUpdate-V4PLREDQ.js → autoUpdate-AAMND4XK.js} +2 -2
- package/dist/{backgroundChecks-TVOKARY2.js → backgroundChecks-FXIEHPND.js} +3 -3
- package/dist/backgroundChecksWorker.js +3 -3
- package/dist/{batchRender-IARQXQHN.js → batchRender-C2JCG5EK.js} +3 -3
- package/dist/beats-UZNREIRU.js +239 -0
- package/dist/{benchmark-ZJYFRFYF.js → benchmark-YM3QXPH6.js} +8 -8
- package/dist/{browser-WRZOH4PD.js → browser-SD3T2XMH.js} +5 -5
- package/dist/{bundleWithLocalizedFonts-SFHKZZAX.js → bundleWithLocalizedFonts-SLBVWQ7O.js} +2 -2
- package/dist/{capture-LLLIHYEF.js → capture-GUO23PVN.js} +2 -2
- package/dist/{capture-KFYPMVTT.js → capture-M5ZAD3BI.js} +10 -10
- package/dist/{catalog-QO762U7V.js → catalog-6PF7KZAZ.js} +11 -11
- package/dist/{catch-up-MELHNTGB.js → catch-up-5LTQTD3X.js} +4 -4
- package/dist/{check-RX3LTKYB.js → check-NE2YXJR2.js} +130 -119
- package/dist/{checkBrowser-EUUMEILI.js → checkBrowser-XDTXDEYO.js} +33 -31
- package/dist/{chunk-YIJMVFEJ.js → chunk-22QHO26F.js} +1 -1
- package/dist/{chunk-7F3B5YYT.js → chunk-2742O5DO.js} +178 -23
- package/dist/{chunk-HEEN6X6O.js → chunk-2ZLYSXZC.js} +8 -8
- package/dist/{chunk-5RSV6DWB.js → chunk-4ID635FL.js} +1 -1
- package/dist/{chunk-ODE7HHNN.js → chunk-5YSHR4XC.js} +11 -9
- package/dist/chunk-6JR2XUEE.js +127 -0
- package/dist/{chunk-DLQQA25O.js → chunk-7ZKEOQ5N.js} +1 -1
- package/dist/{chunk-BB2SFTMY.js → chunk-A2DMF2Q6.js} +6 -5
- package/dist/{chunk-K5BMHQOU.js → chunk-AHNJMWMU.js} +14 -14
- package/dist/{chunk-IJ7JPX4W.js → chunk-AY2FEJDR.js} +3 -3
- package/dist/{chunk-MMYY4KV3.js → chunk-B5FZ2CQM.js} +1 -1
- package/dist/{chunk-IWOEAWIP.js → chunk-B7RUGHBT.js} +1 -1
- package/dist/{chunk-AFYZWHR7.js → chunk-CGOGEA62.js} +2 -2
- package/dist/{chunk-7RTTPSXG.js → chunk-D33YJZOH.js} +1 -1
- package/dist/{chunk-54DMWFQZ.js → chunk-D3ZWBHZP.js} +2 -15
- package/dist/{chunk-WWMFR4SH.js → chunk-DJZEIVAP.js} +3 -3
- package/dist/{chunk-EGJVFPUX.js → chunk-ERTJPFCH.js} +1 -1
- package/dist/{chunk-FEKRMXT6.js → chunk-EVRUR7DW.js} +1 -1
- package/dist/chunk-FFJ5TDRD.js +1181 -0
- package/dist/{chunk-BEW7RCCW.js → chunk-G5AZMSQP.js} +2 -2
- package/dist/{chunk-UK4KRTIX.js → chunk-G642IIVK.js} +2 -2
- package/dist/{chunk-AEQWF7PE.js → chunk-GG37I7B3.js} +1 -1
- package/dist/{chunk-A5RDOXZE.js → chunk-GIPNECWL.js} +17 -129
- package/dist/chunk-GJQHHAAX.js +336 -0
- package/dist/{chunk-4IKI2RYR.js → chunk-H4VXLZ6O.js} +10 -10
- package/dist/{chunk-NCVGBBWC.js → chunk-HM4PLNTX.js} +1 -1
- package/dist/{chunk-24N3BB5M.js → chunk-I6CVW5CA.js} +5 -5
- package/dist/{chunk-KEGTYA7V.js → chunk-IK3SOMZ4.js} +5 -3
- package/dist/{chunk-YITZFHRJ.js → chunk-IL6C7T5X.js} +1 -1
- package/dist/{chunk-6PIGOKTE.js → chunk-JGYHWVXQ.js} +339 -67
- package/dist/{chunk-HO3SITVT.js → chunk-KZPG4DXX.js} +1 -1
- package/dist/{chunk-INNBWSZK.js → chunk-LYIG2GZ5.js} +2 -2
- package/dist/{chunk-ESOAYGIT.js → chunk-MMV6IY6U.js} +2 -2
- package/dist/{chunk-4DEBDQD4.js → chunk-MP676E4B.js} +2 -2
- package/dist/{chunk-3W3MOLRL.js → chunk-N2NDDTYW.js} +2 -2
- package/dist/{chunk-GGDCBVXK.js → chunk-OMJA7JP6.js} +5 -5
- package/dist/{chunk-4D5RBIX6.js → chunk-ON2HYNGB.js} +10 -10
- package/dist/chunk-P47XYVEQ.js +3795 -0
- package/dist/{chunk-NIGOOCVS.js → chunk-P4QE7SSN.js} +1 -1
- package/dist/{chunk-AQXJC64X.js → chunk-PBNV5V5G.js} +1 -1
- package/dist/{chunk-2CEH75X3.js → chunk-PLEMSN3E.js} +2 -2
- package/dist/{chunk-DVAEX52Q.js → chunk-PPF65XAF.js} +1 -1
- package/dist/{chunk-5GPX4X4L.js → chunk-PYMYGIZ4.js} +2 -2
- package/dist/{chunk-7XEVZDKU.js → chunk-PZH7FTRZ.js} +7 -7
- package/dist/{chunk-V5J4XEBG.js → chunk-Q3TFX4OZ.js} +1 -1
- package/dist/{chunk-XSEGMQYA.js → chunk-QABAVWEX.js} +26 -3
- package/dist/{chunk-IKDBT5WT.js → chunk-RGYEL7QD.js} +3 -3
- package/dist/{chunk-76NO4ZRM.js → chunk-RTS7BGEC.js} +1 -1
- package/dist/{chunk-6TDZJ43G.js → chunk-SAS6XBY5.js} +1 -1
- package/dist/{chunk-H6BKVVU4.js → chunk-SB5DX6AD.js} +2 -2
- package/dist/{chunk-JZLFHF2M.js → chunk-TXG6W4X4.js} +3 -3
- package/dist/{chunk-EWAAH7AU.js → chunk-VYTGK5YA.js} +1 -1
- package/dist/{chunk-5HNZQSO4.js → chunk-WDUEIP22.js} +1 -1
- package/dist/{chunk-MTUC2Z32.js → chunk-WNXVPPMV.js} +2 -2
- package/dist/{chunk-SQHWDFTV.js → chunk-X3SCQP2A.js} +1 -1
- package/dist/{chunk-LBT4AMSF.js → chunk-XRKMITSS.js} +1 -1
- package/dist/{chunk-5O6I5ZV7.js → chunk-XTLV6UVP.js} +3 -3
- package/dist/{chunk-5YCFHCD4.js → chunk-XWWYGXJ5.js} +2 -2
- package/dist/{clean-RW7Z4XM6.js → clean-4Y4G3YV3.js} +18 -17
- package/dist/cli.js +54 -53
- package/dist/{cloud-EEOV7JKB.js → cloud-BWXJB2B7.js} +4 -4
- package/dist/{cloudrun-EZAXYVXG.js → cloudrun-BIQXBUDO.js} +3 -3
- package/dist/{compare-5UARQFXX.js → compare-OLLJBVNL.js} +25 -24
- package/dist/{compiler-THI7BXZU.js → compiler-57M6W5WY.js} +3 -3
- package/dist/{component-AYOFPL33.js → component-ULSAC45J.js} +3 -3
- package/dist/{compositions-XJNJBOMG.js → compositions-G2JTQBTJ.js} +10 -10
- package/dist/{delete-653AOR25.js → delete-BONV4XUI.js} +2 -2
- package/dist/{dist-DLR4X3KN.js → dist-4JFB3WAR.js} +2 -2
- package/dist/{dist-2VXSQLXO.js → dist-ROVMAL74.js} +1 -1
- package/dist/{doctor-WA6VRRE7.js → doctor-EMLC4VZ4.js} +12 -12
- package/dist/{events-XXBCP2I4.js → events-LF2J436R.js} +3 -3
- package/dist/{events-U5COLUWT.js → events-ZFGAA5UD.js} +2 -2
- package/dist/{feedback-DX6Q3LN7.js → feedback-WKCUQE6T.js} +6 -6
- package/dist/{ffmpeg-2ROTISBL.js → ffmpeg-7BYARPLM.js} +4 -2
- package/dist/{figma-LCQVLBXF.js → figma-VJKG252Z.js} +3 -3
- package/dist/fontLocalizeCli.js +8 -8
- package/dist/{get-UYNPFMHX.js → get-OINAGI2B.js} +2 -2
- package/dist/{gpuPolicy-YIW3HL3B.js → gpuPolicy-VGE3I5J4.js} +6 -6
- package/dist/{grade-compare-YQEYATJV.js → grade-compare-DY5VFXPK.js} +27 -26
- package/dist/{help-FDURC7WR.js → help-HHB7JRZA.js} +2 -1
- package/dist/{history-EU5UZLHT.js → history-D44JJBBC.js} +8 -7
- package/dist/hyperframe-runtime.js +55 -55
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +55 -55
- package/dist/hyperframes-player.global.js +3 -3
- package/dist/{info-7T6CK6CL.js → info-2WZLISAR.js} +7 -7
- package/dist/{init-KQYSKFVU.js → init-UYZS2WXQ.js} +28 -28
- package/dist/{inspect-HQBV7VHS.js → inspect-IEFCB4PT.js} +26 -25
- package/dist/{installer-OKKPQNKS.js → installer-T3STEB4U.js} +4 -4
- package/dist/{keyframes-SK74JHOA.js → keyframes-FS43QHM2.js} +6 -6
- package/dist/{lambda-S2N4VTRO.js → lambda-RAJA6ZNA.js} +4 -4
- package/dist/{layout-MTE5Y6DE.js → layout-AK2A7Q46.js} +26 -25
- package/dist/{lint-FJGGJYB7.js → lint-JRJUSZO7.js} +7 -7
- package/dist/{lintProject-JGHKRO5L.js → lintProject-BGDYHF3F.js} +1 -1
- package/dist/{list-MBPALK5U.js → list-BKKGPT7E.js} +2 -2
- package/dist/{login-HDN4T5E4.js → login-QJZTUDDO.js} +4 -4
- package/dist/{manager-JNJE54OQ.js → manager-B6MVBM2E.js} +3 -3
- package/dist/{manager-ZLJD3EAY.js → manager-HEUPD2YB.js} +2 -2
- package/dist/{media-treatment-IP34DXWN.js → media-treatment-473OM7G7.js} +12 -11
- package/dist/{models-W5TASRHD.js → models-OA4MXEYG.js} +12 -12
- package/dist/{motionShot-2WYEMOPJ.js → motionShot-C2YDYRNB.js} +16 -16
- package/dist/{normalize-audio-F4NQPXII.js → normalize-audio-M3KVTFTQ.js} +4 -4
- package/dist/{open-DRXNALDE.js → open-363TDMEP.js} +4 -4
- package/dist/{parakeetRunner-VISBF2EA.js → parakeetRunner-DBLHMD5T.js} +13 -13
- package/dist/{pipeline-A2XOVZOM.js → pipeline-FSY65OQ4.js} +8 -8
- package/dist/{play-W2QELQX7.js → play-2UB33EGB.js} +19 -18
- package/dist/{preflight-BH2XUQBS.js → preflight-G5KP7ZKA.js} +4 -4
- package/dist/{present-NHYRS4F4.js → present-F3ASSDJX.js} +15 -14
- package/dist/{preview-SMJVUPXE.js → preview-EF76WIHK.js} +18 -18
- package/dist/{producer-276O3CKW.js → producer-C5V2A3YL.js} +1 -1
- package/dist/{projectConfig-FXFUHFPZ.js → projectConfig-X2IEHCSK.js} +6 -6
- package/dist/{publication-SSQO6ECV.js → publication-JEANCWBW.js} +2 -2
- package/dist/{publish-UHDKDXZI.js → publish-VX5OH4ST.js} +8 -8
- package/dist/{remove-background-IG6U56HC.js → remove-background-IXCISD26.js} +9 -9
- package/dist/{render-6P5RSFS3.js → render-GL72Z2W2.js} +8 -8
- package/dist/{render-ZJPSLTKV.js → render-GUBYSVQD.js} +29 -28
- package/dist/{render-XQONIJEJ.js → render-ISUT7Q3X.js} +3 -3
- package/dist/{render-batch-MH3Z6IPT.js → render-batch-2C6RUP3F.js} +3 -3
- package/dist/renderSetupWorker.js +4 -4
- package/dist/{resolver-JMSGO2JF.js → resolver-KTNKZVIB.js} +4 -4
- package/dist/{sherpa-64JLV4YM.js → sherpa-GFRG3TMM.js} +12 -12
- package/dist/skills/hyperframes-cli/SKILL.md +5 -4
- package/dist/skills/hyperframes-cli/references/beats.md +2 -6
- package/dist/skills/hyperframes-cli/references/lint-validate-inspect.md +8 -0
- package/dist/skills/hyperframes-cli/references/upgrade-info-misc.md +1 -1
- package/dist/{skills-UXOL62PY.js → skills-7XI4DHLN.js} +5 -5
- package/dist/{skillsUpdateCheck-5Y6676K6.js → skillsUpdateCheck-34WOCMHV.js} +3 -3
- package/dist/{snapshot-SQBPCXOV.js → snapshot-SGTO2OQ4.js} +40 -30
- package/dist/{src-N42CT3YR.js → src-GPUDUKY6.js} +5 -5
- package/dist/{src-RQMK5INS.js → src-IMCQRH4P.js} +7 -7
- package/dist/{staticProjectServer-AQXVWMLU.js → staticProjectServer-4CQ3KDQK.js} +15 -14
- package/dist/studio/assets/{hyperframes-player-kqB1psAJ.js → hyperframes-player-C8VFb4NS.js} +1 -1
- package/dist/studio/assets/{index-X_d1b5vz.js → index-J8Bpbg6o.js} +118 -118
- package/dist/studio/assets/{index-BrViH8hj.js → index-RZnZPb-B.js} +1 -1
- package/dist/studio/index.html +1 -1
- package/dist/{studio-api-GY5D7RAP.js → studio-api-RYCDLEOR.js} +13 -8
- package/dist/{studioServer-O3VONODG.js → studioServer-VIIVGFZH.js} +45 -44
- package/dist/{telemetry-V2K5P7CI.js → telemetry-YKVYLJSB.js} +3 -3
- package/dist/{timeline-YU3YPLKB.js → timeline-LDRA7QZ3.js} +42 -347
- package/dist/{tokens-NPSSSG2A.js → tokens-ZAOFRU55.js} +2 -2
- package/dist/{transcribe-FNBDG24U.js → transcribe-CJXUHTAS.js} +17 -17
- package/dist/{transcribe-BXJNS3RZ.js → transcribe-FL6NGWHF.js} +11 -11
- package/dist/{updateCheck-MB3RHSVK.js → updateCheck-TIRFQBSI.js} +2 -2
- package/dist/{upgrade-5VNRUR37.js → upgrade-7R5G3MNO.js} +2 -2
- package/dist/{urlDownloader-WCT7FMLA.js → urlDownloader-KDJGLR2Y.js} +5 -5
- package/dist/{usage-EC3KFUIJ.js → usage-HG4WMM7A.js} +33 -5
- package/dist/{validate-UXSXRCE6.js → validate-VGEPWGQO.js} +20 -19
- package/dist/{video-NRNQBZMV.js → video-AHO4CDCK.js} +6 -6
- package/package.json +2 -3
- package/dist/beat-analyzer.global.js +0 -341
- package/dist/beats-FY4UDXBL.js +0 -322
- package/dist/chunk-TWBTXEDZ.js +0 -3795
- package/dist/lib-TPG2ZMAX.js +0 -128
- package/dist/studio/assets/index-C3AZLr-0.js +0 -1
|
@@ -18,19 +18,19 @@ import {
|
|
|
18
18
|
transcribe,
|
|
19
19
|
whisperModelSlowdownFactor,
|
|
20
20
|
wrapWhisperTimeoutError
|
|
21
|
-
} from "./chunk-
|
|
22
|
-
import "./chunk-
|
|
23
|
-
import "./chunk-
|
|
21
|
+
} from "./chunk-DJZEIVAP.js";
|
|
22
|
+
import "./chunk-G642IIVK.js";
|
|
23
|
+
import "./chunk-X3SCQP2A.js";
|
|
24
24
|
import "./chunk-PO2SDVQA.js";
|
|
25
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-IK3SOMZ4.js";
|
|
26
26
|
import "./chunk-XT6MXC7A.js";
|
|
27
|
-
import "./chunk-
|
|
28
|
-
import "./chunk-
|
|
27
|
+
import "./chunk-PLEMSN3E.js";
|
|
28
|
+
import "./chunk-LYIG2GZ5.js";
|
|
29
29
|
import "./chunk-KCF6GHJP.js";
|
|
30
30
|
import "./chunk-JYVGYKXG.js";
|
|
31
31
|
import "./chunk-7KDQAD2W.js";
|
|
32
|
-
import "./chunk-
|
|
33
|
-
import "./chunk-
|
|
32
|
+
import "./chunk-Q3TFX4OZ.js";
|
|
33
|
+
import "./chunk-P47XYVEQ.js";
|
|
34
34
|
import "./chunk-VC76R6W2.js";
|
|
35
35
|
import "./chunk-UJKQWGFF.js";
|
|
36
36
|
import "./chunk-ALLKNYC3.js";
|
|
@@ -39,10 +39,10 @@ import "./chunk-DPVXBVLL.js";
|
|
|
39
39
|
import "./chunk-T76PLPD6.js";
|
|
40
40
|
import "./chunk-FXMKHHPO.js";
|
|
41
41
|
import "./chunk-RQVDTPGD.js";
|
|
42
|
-
import "./chunk-
|
|
43
|
-
import "./chunk-
|
|
42
|
+
import "./chunk-22QHO26F.js";
|
|
43
|
+
import "./chunk-D3ZWBHZP.js";
|
|
44
44
|
import "./chunk-TWWSYAKJ.js";
|
|
45
|
-
import "./chunk-
|
|
45
|
+
import "./chunk-2742O5DO.js";
|
|
46
46
|
import "./chunk-IWFLMU2N.js";
|
|
47
47
|
import "./chunk-3VGU2SH7.js";
|
|
48
48
|
import "./chunk-VAS6HQX3.js";
|
|
@@ -16,12 +16,12 @@ import {
|
|
|
16
16
|
updateCheckDue,
|
|
17
17
|
updateNoticesSuppressed,
|
|
18
18
|
withMeta
|
|
19
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-7ZKEOQ5N.js";
|
|
20
20
|
import "./chunk-K4WIOZFP.js";
|
|
21
21
|
import "./chunk-XUXGIA7H.js";
|
|
22
22
|
import "./chunk-WERLJGIC.js";
|
|
23
23
|
import "./chunk-ISN5GRYI.js";
|
|
24
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-WNXVPPMV.js";
|
|
25
25
|
import "./chunk-KNU5COPB.js";
|
|
26
26
|
import "./chunk-M2WBOQ2Q.js";
|
|
27
27
|
export {
|
|
@@ -28,14 +28,14 @@ import {
|
|
|
28
28
|
rewritePinnedHyperframesText,
|
|
29
29
|
rewriteProjectPinnedScripts,
|
|
30
30
|
withMeta
|
|
31
|
-
} from "./chunk-
|
|
31
|
+
} from "./chunk-7ZKEOQ5N.js";
|
|
32
32
|
import "./chunk-K4WIOZFP.js";
|
|
33
33
|
import "./chunk-XUXGIA7H.js";
|
|
34
34
|
import "./chunk-WERLJGIC.js";
|
|
35
35
|
import "./chunk-ISN5GRYI.js";
|
|
36
36
|
import {
|
|
37
37
|
VERSION
|
|
38
|
-
} from "./chunk-
|
|
38
|
+
} from "./chunk-WNXVPPMV.js";
|
|
39
39
|
import "./chunk-KNU5COPB.js";
|
|
40
40
|
import "./chunk-M2WBOQ2Q.js";
|
|
41
41
|
|
|
@@ -11,13 +11,13 @@ import {
|
|
|
11
11
|
isHttpUrl,
|
|
12
12
|
safeDownloadUrlIdentity,
|
|
13
13
|
writeUrlDownloadTelemetry
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
14
|
+
} from "./chunk-PLEMSN3E.js";
|
|
15
|
+
import "./chunk-LYIG2GZ5.js";
|
|
16
16
|
import "./chunk-KCF6GHJP.js";
|
|
17
17
|
import "./chunk-JYVGYKXG.js";
|
|
18
18
|
import "./chunk-7KDQAD2W.js";
|
|
19
|
-
import "./chunk-
|
|
20
|
-
import "./chunk-
|
|
19
|
+
import "./chunk-Q3TFX4OZ.js";
|
|
20
|
+
import "./chunk-P47XYVEQ.js";
|
|
21
21
|
import "./chunk-VC76R6W2.js";
|
|
22
22
|
import "./chunk-UJKQWGFF.js";
|
|
23
23
|
import "./chunk-ALLKNYC3.js";
|
|
@@ -27,7 +27,7 @@ import "./chunk-T76PLPD6.js";
|
|
|
27
27
|
import "./chunk-FXMKHHPO.js";
|
|
28
28
|
import "./chunk-RQVDTPGD.js";
|
|
29
29
|
import "./chunk-TWWSYAKJ.js";
|
|
30
|
-
import "./chunk-
|
|
30
|
+
import "./chunk-2742O5DO.js";
|
|
31
31
|
import "./chunk-IWFLMU2N.js";
|
|
32
32
|
import "./chunk-3VGU2SH7.js";
|
|
33
33
|
import "./chunk-VAS6HQX3.js";
|
|
@@ -1737,8 +1737,25 @@ var windowSchema = {
|
|
|
1737
1737
|
optionalProperties: { resets_at: { type: "string", nullable: true } },
|
|
1738
1738
|
additionalProperties: true
|
|
1739
1739
|
};
|
|
1740
|
+
var spendSchema = {
|
|
1741
|
+
nullable: true,
|
|
1742
|
+
optionalProperties: {
|
|
1743
|
+
percent: { type: "float64", nullable: true },
|
|
1744
|
+
enabled: { type: "boolean", nullable: true }
|
|
1745
|
+
},
|
|
1746
|
+
additionalProperties: true
|
|
1747
|
+
};
|
|
1748
|
+
var extraUsageSchema = {
|
|
1749
|
+
nullable: true,
|
|
1750
|
+
optionalProperties: {
|
|
1751
|
+
utilization: { type: "float64", nullable: true },
|
|
1752
|
+
is_enabled: { type: "boolean", nullable: true }
|
|
1753
|
+
},
|
|
1754
|
+
additionalProperties: true
|
|
1755
|
+
};
|
|
1740
1756
|
var usageSchema = {
|
|
1741
1757
|
properties: { five_hour: windowSchema, seven_day: windowSchema },
|
|
1758
|
+
optionalProperties: { spend: spendSchema, extra_usage: extraUsageSchema },
|
|
1742
1759
|
additionalProperties: true
|
|
1743
1760
|
};
|
|
1744
1761
|
var parseUsage = new import_jtd.default().compileParser(usageSchema);
|
|
@@ -1756,15 +1773,26 @@ function parseHarnessUsage(text) {
|
|
|
1756
1773
|
};
|
|
1757
1774
|
const session = normalize(usage.five_hour);
|
|
1758
1775
|
const weekly = normalize(usage.seven_day);
|
|
1759
|
-
return knownUsage("claude-code", session, weekly);
|
|
1776
|
+
return knownUsage("claude-code", session, weekly, null, claudeSpendWindow(usage));
|
|
1777
|
+
}
|
|
1778
|
+
function claudeSpendWindow(usage) {
|
|
1779
|
+
const spend = usage.spend;
|
|
1780
|
+
const extra = usage.extra_usage;
|
|
1781
|
+
const percent = spend && spend.enabled !== false && typeof spend.percent === "number" ? spend.percent : extra && extra.is_enabled === true && typeof extra.utilization === "number" ? extra.utilization : null;
|
|
1782
|
+
if (percent === null) return null;
|
|
1783
|
+
const used = percent > 100 ? 100 : percent;
|
|
1784
|
+
return { usedPercent: used, remainingPercent: 100 - used, resetsAt: null };
|
|
1760
1785
|
}
|
|
1761
|
-
function knownUsage(harness, session, weekly, planTier = null) {
|
|
1762
|
-
const windows = [session, weekly].filter(
|
|
1763
|
-
|
|
1786
|
+
function knownUsage(harness, session, weekly, planTier = null, spend = null) {
|
|
1787
|
+
const windows = [session, weekly, spend].filter(
|
|
1788
|
+
(window) => window !== null
|
|
1789
|
+
);
|
|
1790
|
+
if (!windows.length) return unknownUsage("no_usage_windows");
|
|
1791
|
+
if (windows.some(
|
|
1764
1792
|
(window) => !Number.isFinite(window.remainingPercent) || window.remainingPercent < 0 || window.remainingPercent > 100
|
|
1765
1793
|
))
|
|
1766
1794
|
return unknownUsage("invalid_usage_response");
|
|
1767
|
-
return { status: "known", harness, session, weekly, planTier };
|
|
1795
|
+
return { status: "known", harness, session, weekly, spend, planTier };
|
|
1768
1796
|
}
|
|
1769
1797
|
var codexWindowSchema = {
|
|
1770
1798
|
nullable: true,
|
|
@@ -14,25 +14,26 @@ import {
|
|
|
14
14
|
shouldIgnoreHttpError,
|
|
15
15
|
shouldIgnoreRequestFailure,
|
|
16
16
|
validate_default
|
|
17
|
-
} from "./chunk-
|
|
18
|
-
import "./chunk-
|
|
17
|
+
} from "./chunk-AHNJMWMU.js";
|
|
18
|
+
import "./chunk-ON2HYNGB.js";
|
|
19
|
+
import "./chunk-B5FZ2CQM.js";
|
|
19
20
|
import "./chunk-FH7WODJH.js";
|
|
20
|
-
import "./chunk-
|
|
21
|
-
import "./chunk-EGJVFPUX.js";
|
|
21
|
+
import "./chunk-ERTJPFCH.js";
|
|
22
22
|
import "./chunk-WPNE5NEP.js";
|
|
23
|
-
import "./chunk-
|
|
23
|
+
import "./chunk-WDUEIP22.js";
|
|
24
24
|
import "./chunk-K2FLNJVB.js";
|
|
25
|
-
import "./chunk-
|
|
25
|
+
import "./chunk-SB5DX6AD.js";
|
|
26
26
|
import "./chunk-442JNXRM.js";
|
|
27
|
-
import "./chunk-
|
|
28
|
-
import "./chunk-
|
|
27
|
+
import "./chunk-5YSHR4XC.js";
|
|
28
|
+
import "./chunk-GIPNECWL.js";
|
|
29
|
+
import "./chunk-6JR2XUEE.js";
|
|
29
30
|
import "./chunk-C6TPGUWD.js";
|
|
30
|
-
import "./chunk-
|
|
31
|
-
import "./chunk-
|
|
31
|
+
import "./chunk-4ID635FL.js";
|
|
32
|
+
import "./chunk-JGYHWVXQ.js";
|
|
32
33
|
import "./chunk-FFDC5OWV.js";
|
|
33
34
|
import "./chunk-5CS4T6C6.js";
|
|
34
|
-
import "./chunk-
|
|
35
|
-
import "./chunk-
|
|
35
|
+
import "./chunk-HM4PLNTX.js";
|
|
36
|
+
import "./chunk-KZPG4DXX.js";
|
|
36
37
|
import "./chunk-VWG7OQKU.js";
|
|
37
38
|
import "./chunk-QWQ6GQTI.js";
|
|
38
39
|
import "./chunk-S3S4TGEH.js";
|
|
@@ -42,21 +43,21 @@ import "./chunk-ZTZA4UWZ.js";
|
|
|
42
43
|
import "./chunk-KLIKCX6Q.js";
|
|
43
44
|
import "./chunk-EOOEC32M.js";
|
|
44
45
|
import "./chunk-TJSTGSAW.js";
|
|
45
|
-
import "./chunk-
|
|
46
|
+
import "./chunk-7ZKEOQ5N.js";
|
|
46
47
|
import "./chunk-K4WIOZFP.js";
|
|
47
48
|
import "./chunk-XUXGIA7H.js";
|
|
48
49
|
import "./chunk-WERLJGIC.js";
|
|
49
50
|
import "./chunk-ISN5GRYI.js";
|
|
50
|
-
import "./chunk-
|
|
51
|
+
import "./chunk-WNXVPPMV.js";
|
|
51
52
|
import "./chunk-EOVYQ3IG.js";
|
|
52
53
|
import "./chunk-XT6MXC7A.js";
|
|
53
|
-
import "./chunk-
|
|
54
|
-
import "./chunk-
|
|
54
|
+
import "./chunk-PLEMSN3E.js";
|
|
55
|
+
import "./chunk-LYIG2GZ5.js";
|
|
55
56
|
import "./chunk-KCF6GHJP.js";
|
|
56
57
|
import "./chunk-JYVGYKXG.js";
|
|
57
58
|
import "./chunk-7KDQAD2W.js";
|
|
58
|
-
import "./chunk-
|
|
59
|
-
import "./chunk-
|
|
59
|
+
import "./chunk-Q3TFX4OZ.js";
|
|
60
|
+
import "./chunk-P47XYVEQ.js";
|
|
60
61
|
import "./chunk-VC76R6W2.js";
|
|
61
62
|
import "./chunk-UJKQWGFF.js";
|
|
62
63
|
import "./chunk-ALLKNYC3.js";
|
|
@@ -66,7 +67,7 @@ import "./chunk-T76PLPD6.js";
|
|
|
66
67
|
import "./chunk-FXMKHHPO.js";
|
|
67
68
|
import "./chunk-RQVDTPGD.js";
|
|
68
69
|
import "./chunk-TWWSYAKJ.js";
|
|
69
|
-
import "./chunk-
|
|
70
|
+
import "./chunk-2742O5DO.js";
|
|
70
71
|
import "./chunk-IWFLMU2N.js";
|
|
71
72
|
import "./chunk-3VGU2SH7.js";
|
|
72
73
|
import "./chunk-VAS6HQX3.js";
|
|
@@ -7,7 +7,7 @@ var __dirname = __hf_dirname(__filename);
|
|
|
7
7
|
import {
|
|
8
8
|
CAPTURE_USER_AGENT,
|
|
9
9
|
safeFetch
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-PBNV5V5G.js";
|
|
11
11
|
import {
|
|
12
12
|
ensureCaptureDirSync
|
|
13
13
|
} from "./chunk-MRF4AMKD.js";
|
|
@@ -18,13 +18,13 @@ import {
|
|
|
18
18
|
import {
|
|
19
19
|
c
|
|
20
20
|
} from "./chunk-ZTZA4UWZ.js";
|
|
21
|
-
import "./chunk-
|
|
22
|
-
import "./chunk-
|
|
21
|
+
import "./chunk-PLEMSN3E.js";
|
|
22
|
+
import "./chunk-LYIG2GZ5.js";
|
|
23
23
|
import "./chunk-KCF6GHJP.js";
|
|
24
24
|
import "./chunk-JYVGYKXG.js";
|
|
25
25
|
import "./chunk-7KDQAD2W.js";
|
|
26
|
-
import "./chunk-
|
|
27
|
-
import "./chunk-
|
|
26
|
+
import "./chunk-Q3TFX4OZ.js";
|
|
27
|
+
import "./chunk-P47XYVEQ.js";
|
|
28
28
|
import "./chunk-VC76R6W2.js";
|
|
29
29
|
import "./chunk-UJKQWGFF.js";
|
|
30
30
|
import "./chunk-ALLKNYC3.js";
|
|
@@ -34,7 +34,7 @@ import "./chunk-T76PLPD6.js";
|
|
|
34
34
|
import "./chunk-FXMKHHPO.js";
|
|
35
35
|
import "./chunk-RQVDTPGD.js";
|
|
36
36
|
import "./chunk-TWWSYAKJ.js";
|
|
37
|
-
import "./chunk-
|
|
37
|
+
import "./chunk-2742O5DO.js";
|
|
38
38
|
import "./chunk-IWFLMU2N.js";
|
|
39
39
|
import "./chunk-3VGU2SH7.js";
|
|
40
40
|
import "./chunk-VAS6HQX3.js";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "hyperframes",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.161",
|
|
4
4
|
"description": "HyperFrames CLI — create, preview, and render HTML video compositions",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -27,10 +27,9 @@
|
|
|
27
27
|
"scripts": {
|
|
28
28
|
"test": "vitest run",
|
|
29
29
|
"dev": "tsx src/cli.ts",
|
|
30
|
-
"build": "bun run build:fonts && tsup && bun run build:runtime && bun run build:
|
|
30
|
+
"build": "bun run build:fonts && tsup && bun run build:runtime && bun run build:copy",
|
|
31
31
|
"build:fonts": "node scripts/build-fonts.mjs",
|
|
32
32
|
"build:runtime": "tsx scripts/build-runtime.ts",
|
|
33
|
-
"build:beat-analyzer": "node scripts/build-beat-analyzer.mjs",
|
|
34
33
|
"build:copy": "node scripts/build-copy.mjs",
|
|
35
34
|
"typecheck": "tsc --noEmit",
|
|
36
35
|
"gen:skills-manifest": "tsx scripts/gen-skills-manifest.ts",
|
|
@@ -1,341 +0,0 @@
|
|
|
1
|
-
(() => {
|
|
2
|
-
var __create = Object.create;
|
|
3
|
-
var __defProp = Object.defineProperty;
|
|
4
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
-
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
-
var __commonJS = (cb, mod) => function __require() {
|
|
9
|
-
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
10
|
-
};
|
|
11
|
-
var __copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from === "object" || typeof from === "function") {
|
|
13
|
-
for (let key of __getOwnPropNames(from))
|
|
14
|
-
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
15
|
-
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
16
|
-
}
|
|
17
|
-
return to;
|
|
18
|
-
};
|
|
19
|
-
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
20
|
-
// If the importer is in node compatibility mode or this is not an ESM
|
|
21
|
-
// file that has been converted to a CommonJS file using a Babel-
|
|
22
|
-
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
23
|
-
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
24
|
-
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
25
|
-
mod
|
|
26
|
-
));
|
|
27
|
-
|
|
28
|
-
// ../../node_modules/.bun/bpm-detective@2.0.5/node_modules/bpm-detective/lib/detect.js
|
|
29
|
-
var require_detect = __commonJS({
|
|
30
|
-
"../../node_modules/.bun/bpm-detective@2.0.5/node_modules/bpm-detective/lib/detect.js"(exports) {
|
|
31
|
-
"use strict";
|
|
32
|
-
Object.defineProperty(exports, "__esModule", {
|
|
33
|
-
value: true
|
|
34
|
-
});
|
|
35
|
-
exports.default = detect;
|
|
36
|
-
var OfflineContext = window.OfflineAudioContext || window.webkitOfflineAudioContext;
|
|
37
|
-
function detect(buffer) {
|
|
38
|
-
var source = getLowPassSource(buffer);
|
|
39
|
-
source.start(0);
|
|
40
|
-
return [findPeaks, identifyIntervals, groupByTempo(buffer.sampleRate), getTopCandidate].reduce(function(state, fn) {
|
|
41
|
-
return fn(state);
|
|
42
|
-
}, source.buffer.getChannelData(0));
|
|
43
|
-
}
|
|
44
|
-
function getTopCandidate(candidates) {
|
|
45
|
-
return candidates.sort(function(a, b) {
|
|
46
|
-
return b.count - a.count;
|
|
47
|
-
}).splice(0, 5)[0].tempo;
|
|
48
|
-
}
|
|
49
|
-
function getLowPassSource(buffer) {
|
|
50
|
-
var length = buffer.length, numberOfChannels = buffer.numberOfChannels, sampleRate = buffer.sampleRate;
|
|
51
|
-
var context = new OfflineContext(numberOfChannels, length, sampleRate);
|
|
52
|
-
var source = context.createBufferSource();
|
|
53
|
-
source.buffer = buffer;
|
|
54
|
-
var filter = context.createBiquadFilter();
|
|
55
|
-
filter.type = "lowpass";
|
|
56
|
-
source.connect(filter);
|
|
57
|
-
filter.connect(context.destination);
|
|
58
|
-
return source;
|
|
59
|
-
}
|
|
60
|
-
function findPeaks(data) {
|
|
61
|
-
var peaks = [];
|
|
62
|
-
var threshold = 0.9;
|
|
63
|
-
var minThresold = 0.3;
|
|
64
|
-
var minPeaks = 15;
|
|
65
|
-
while (peaks.length < minPeaks && threshold >= minThresold) {
|
|
66
|
-
peaks = findPeaksAtThreshold(data, threshold);
|
|
67
|
-
threshold -= 0.05;
|
|
68
|
-
}
|
|
69
|
-
if (peaks.length < minPeaks) {
|
|
70
|
-
throw new Error("Could not find enough samples for a reliable detection.");
|
|
71
|
-
}
|
|
72
|
-
return peaks;
|
|
73
|
-
}
|
|
74
|
-
function findPeaksAtThreshold(data, threshold) {
|
|
75
|
-
var peaks = [];
|
|
76
|
-
for (var i = 0, l = data.length; i < l; i += 1) {
|
|
77
|
-
if (data[i] > threshold) {
|
|
78
|
-
peaks.push(i);
|
|
79
|
-
i += 1e4;
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
return peaks;
|
|
83
|
-
}
|
|
84
|
-
function identifyIntervals(peaks) {
|
|
85
|
-
var intervals = [];
|
|
86
|
-
peaks.forEach(function(peak, index) {
|
|
87
|
-
var _loop = function _loop2(i2) {
|
|
88
|
-
var interval = peaks[index + i2] - peak;
|
|
89
|
-
var foundInterval = intervals.some(function(intervalCount) {
|
|
90
|
-
if (intervalCount.interval === interval) {
|
|
91
|
-
return intervalCount.count += 1;
|
|
92
|
-
}
|
|
93
|
-
});
|
|
94
|
-
if (!foundInterval) {
|
|
95
|
-
intervals.push({
|
|
96
|
-
interval,
|
|
97
|
-
count: 1
|
|
98
|
-
});
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
for (var i = 0; i < 10; i += 1) {
|
|
102
|
-
_loop(i);
|
|
103
|
-
}
|
|
104
|
-
});
|
|
105
|
-
return intervals;
|
|
106
|
-
}
|
|
107
|
-
function groupByTempo(sampleRate) {
|
|
108
|
-
return function(intervalCounts) {
|
|
109
|
-
var tempoCounts = [];
|
|
110
|
-
intervalCounts.forEach(function(intervalCount) {
|
|
111
|
-
if (intervalCount.interval !== 0) {
|
|
112
|
-
var theoreticalTempo = 60 / (intervalCount.interval / sampleRate);
|
|
113
|
-
while (theoreticalTempo < 90) {
|
|
114
|
-
theoreticalTempo *= 2;
|
|
115
|
-
}
|
|
116
|
-
while (theoreticalTempo > 180) {
|
|
117
|
-
theoreticalTempo /= 2;
|
|
118
|
-
}
|
|
119
|
-
theoreticalTempo = Math.round(theoreticalTempo);
|
|
120
|
-
var foundTempo = tempoCounts.some(function(tempoCount) {
|
|
121
|
-
if (tempoCount.tempo === theoreticalTempo) {
|
|
122
|
-
return tempoCount.count += intervalCount.count;
|
|
123
|
-
}
|
|
124
|
-
});
|
|
125
|
-
if (!foundTempo) {
|
|
126
|
-
tempoCounts.push({
|
|
127
|
-
tempo: theoreticalTempo,
|
|
128
|
-
count: intervalCount.count
|
|
129
|
-
});
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
return tempoCounts;
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
});
|
|
138
|
-
|
|
139
|
-
// ../../node_modules/.bun/bpm-detective@2.0.5/node_modules/bpm-detective/lib/index.js
|
|
140
|
-
var require_lib = __commonJS({
|
|
141
|
-
"../../node_modules/.bun/bpm-detective@2.0.5/node_modules/bpm-detective/lib/index.js"(exports, module) {
|
|
142
|
-
module.exports = require_detect().default;
|
|
143
|
-
}
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
// ../core/src/beats/beatDetection.ts
|
|
147
|
-
var bpmDetectivePromise = null;
|
|
148
|
-
var defaultBpmDetectiveImport = () => (
|
|
149
|
-
// @ts-ignore -- no type declarations for bpm-detective
|
|
150
|
-
Promise.resolve().then(() => __toESM(require_lib(), 1))
|
|
151
|
-
);
|
|
152
|
-
function loadBpmDetective(importFn = defaultBpmDetectiveImport) {
|
|
153
|
-
const useCache = importFn === defaultBpmDetectiveImport;
|
|
154
|
-
if (useCache && bpmDetectivePromise) {
|
|
155
|
-
return bpmDetectivePromise;
|
|
156
|
-
}
|
|
157
|
-
const promise = importFn().then((m) => (m.default ?? m) || null).catch(() => {
|
|
158
|
-
if (useCache) bpmDetectivePromise = null;
|
|
159
|
-
return null;
|
|
160
|
-
});
|
|
161
|
-
if (useCache) {
|
|
162
|
-
bpmDetectivePromise = promise;
|
|
163
|
-
}
|
|
164
|
-
return promise;
|
|
165
|
-
}
|
|
166
|
-
var WINDOW_SIZE = 1024;
|
|
167
|
-
var HOP_SIZE = 512;
|
|
168
|
-
var STRENGTH_WINDOW_S = 0.05;
|
|
169
|
-
function computeRmsAt(channelData, sampleRate, time) {
|
|
170
|
-
const halfWindow = Math.floor(sampleRate * STRENGTH_WINDOW_S);
|
|
171
|
-
const center = Math.floor(time * sampleRate);
|
|
172
|
-
const start = Math.max(0, center - halfWindow);
|
|
173
|
-
const end = Math.min(channelData.length, center + halfWindow);
|
|
174
|
-
let sum = 0;
|
|
175
|
-
for (let i = start; i < end; i++) {
|
|
176
|
-
const s = channelData[i] ?? 0;
|
|
177
|
-
sum += s * s;
|
|
178
|
-
}
|
|
179
|
-
return Math.sqrt(sum / Math.max(end - start, 1));
|
|
180
|
-
}
|
|
181
|
-
async function detectBeats(audioBuffer) {
|
|
182
|
-
const channelData = audioBuffer.getChannelData(0);
|
|
183
|
-
const sampleRate = audioBuffer.sampleRate;
|
|
184
|
-
const energies = [];
|
|
185
|
-
for (let i = 0; i < channelData.length - WINDOW_SIZE; i += HOP_SIZE) {
|
|
186
|
-
let sum = 0;
|
|
187
|
-
for (let j = 0; j < WINDOW_SIZE; j++) {
|
|
188
|
-
const sample = channelData[i + j];
|
|
189
|
-
sum += sample * sample;
|
|
190
|
-
}
|
|
191
|
-
energies.push(sum / WINDOW_SIZE);
|
|
192
|
-
}
|
|
193
|
-
const beats = [];
|
|
194
|
-
const localWindowSize = 20;
|
|
195
|
-
for (let i = localWindowSize; i < energies.length - localWindowSize; i++) {
|
|
196
|
-
let localMean = 0;
|
|
197
|
-
for (let j = i - localWindowSize; j < i + localWindowSize; j++) {
|
|
198
|
-
localMean += energies[j];
|
|
199
|
-
}
|
|
200
|
-
localMean /= localWindowSize * 2;
|
|
201
|
-
const threshold = localMean * 1.5;
|
|
202
|
-
const current = energies[i];
|
|
203
|
-
if (current > threshold && current > (energies[i - 1] ?? 0) && current > (energies[i + 1] ?? 0)) {
|
|
204
|
-
const timeInSeconds = i * HOP_SIZE / sampleRate;
|
|
205
|
-
if (beats.length === 0 || timeInSeconds - beats[beats.length - 1] > 0.1) {
|
|
206
|
-
beats.push(Math.round(timeInSeconds * 1e3) / 1e3);
|
|
207
|
-
}
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
return beats;
|
|
211
|
-
}
|
|
212
|
-
function computeBpmFromBeats(beatTimes) {
|
|
213
|
-
if (beatTimes.length < 4) return null;
|
|
214
|
-
const iois = [];
|
|
215
|
-
for (let i = 1; i < beatTimes.length; i++) {
|
|
216
|
-
iois.push(beatTimes[i] - beatTimes[i - 1]);
|
|
217
|
-
}
|
|
218
|
-
const sorted = [...iois].sort((a, b) => a - b);
|
|
219
|
-
const mid = Math.floor(sorted.length / 2);
|
|
220
|
-
const medianIoi = sorted.length % 2 === 0 ? (sorted[mid - 1] + sorted[mid]) / 2 : sorted[mid];
|
|
221
|
-
if (medianIoi <= 0) return null;
|
|
222
|
-
return Math.round(60 / medianIoi * 10) / 10;
|
|
223
|
-
}
|
|
224
|
-
function canonicalizeBpm(bpm) {
|
|
225
|
-
let b = bpm;
|
|
226
|
-
while (b > 120) b /= 2;
|
|
227
|
-
while (b < 60) b *= 2;
|
|
228
|
-
return b;
|
|
229
|
-
}
|
|
230
|
-
function octaveAlignBpm(bpm, reference) {
|
|
231
|
-
const candidates = [bpm / 2, bpm, bpm * 2];
|
|
232
|
-
let best = bpm;
|
|
233
|
-
let bestDist = Number.POSITIVE_INFINITY;
|
|
234
|
-
for (const c of candidates) {
|
|
235
|
-
if (c <= 0) continue;
|
|
236
|
-
const dist = Math.abs(c - reference);
|
|
237
|
-
if (dist < bestDist) {
|
|
238
|
-
bestDist = dist;
|
|
239
|
-
best = c;
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
return best;
|
|
243
|
-
}
|
|
244
|
-
function regularizeBeats(rawBeats, bpm, duration) {
|
|
245
|
-
if (rawBeats.length === 0 || bpm <= 0 || duration <= 0) return rawBeats;
|
|
246
|
-
const beatInterval = 60 / bpm;
|
|
247
|
-
if (beatInterval < 0.125) return rawBeats;
|
|
248
|
-
const threshold = beatInterval * 0.25;
|
|
249
|
-
let bestOffset = 0;
|
|
250
|
-
let bestScore = -1;
|
|
251
|
-
for (const anchor of rawBeats.slice(0, 10)) {
|
|
252
|
-
const offset = (anchor % beatInterval + beatInterval) % beatInterval;
|
|
253
|
-
let score = 0;
|
|
254
|
-
for (const rb of rawBeats) {
|
|
255
|
-
const phase = (rb % beatInterval + beatInterval) % beatInterval;
|
|
256
|
-
const dist = Math.min(Math.abs(phase - offset), beatInterval - Math.abs(phase - offset));
|
|
257
|
-
if (dist < threshold) score++;
|
|
258
|
-
}
|
|
259
|
-
if (score > bestScore) {
|
|
260
|
-
bestScore = score;
|
|
261
|
-
bestOffset = offset;
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
const beats = [];
|
|
265
|
-
for (let t = bestOffset; t <= duration + 1e-3; t += beatInterval) {
|
|
266
|
-
beats.push(Math.round(t * 1e3) / 1e3);
|
|
267
|
-
}
|
|
268
|
-
return beats;
|
|
269
|
-
}
|
|
270
|
-
function gateBeatsBySilence(beats, channelData, sampleRate) {
|
|
271
|
-
if (beats.length === 0) return { times: beats, strengths: [], peak: 1e-6 };
|
|
272
|
-
const energies = beats.map((t) => computeRmsAt(channelData, sampleRate, t));
|
|
273
|
-
const peak = Math.max(...energies, 1e-6);
|
|
274
|
-
const threshold = peak * 0.12;
|
|
275
|
-
const times = [];
|
|
276
|
-
const strengths = [];
|
|
277
|
-
for (let i = 0; i < beats.length; i++) {
|
|
278
|
-
if (energies[i] >= threshold) {
|
|
279
|
-
times.push(beats[i]);
|
|
280
|
-
strengths.push(Math.min(1, energies[i] / peak));
|
|
281
|
-
}
|
|
282
|
-
}
|
|
283
|
-
return { times, strengths, peak };
|
|
284
|
-
}
|
|
285
|
-
async function analyzeMusicFromBuffer(audioBuffer, { pause } = {}) {
|
|
286
|
-
const channelData = audioBuffer.getChannelData(0);
|
|
287
|
-
const sampleRate = audioBuffer.sampleRate;
|
|
288
|
-
const duration = audioBuffer.duration;
|
|
289
|
-
await pause?.();
|
|
290
|
-
const rawBeats = await detectBeats(audioBuffer);
|
|
291
|
-
const onsetBpm = computeBpmFromBeats(rawBeats);
|
|
292
|
-
let detectiveBpm = null;
|
|
293
|
-
const detect = await loadBpmDetective();
|
|
294
|
-
await pause?.();
|
|
295
|
-
try {
|
|
296
|
-
if (detect) detectiveBpm = detect(audioBuffer);
|
|
297
|
-
} catch {
|
|
298
|
-
}
|
|
299
|
-
let bpm = onsetBpm;
|
|
300
|
-
let confidence = "uncertain";
|
|
301
|
-
let regularizeBpm = null;
|
|
302
|
-
if (onsetBpm !== null && detectiveBpm !== null) {
|
|
303
|
-
const pctDiff = Math.abs(canonicalizeBpm(onsetBpm) - canonicalizeBpm(detectiveBpm)) / canonicalizeBpm(detectiveBpm);
|
|
304
|
-
if (pctDiff < 0.05) {
|
|
305
|
-
bpm = octaveAlignBpm(detectiveBpm, onsetBpm);
|
|
306
|
-
confidence = "high";
|
|
307
|
-
regularizeBpm = bpm;
|
|
308
|
-
} else if (pctDiff < 0.1) {
|
|
309
|
-
bpm = Math.round((onsetBpm + detectiveBpm) / 2);
|
|
310
|
-
confidence = "low";
|
|
311
|
-
regularizeBpm = bpm;
|
|
312
|
-
} else {
|
|
313
|
-
bpm = onsetBpm;
|
|
314
|
-
confidence = "uncertain";
|
|
315
|
-
}
|
|
316
|
-
} else if (onsetBpm !== null) {
|
|
317
|
-
bpm = onsetBpm;
|
|
318
|
-
confidence = "low";
|
|
319
|
-
regularizeBpm = onsetBpm;
|
|
320
|
-
} else if (detectiveBpm !== null) {
|
|
321
|
-
bpm = detectiveBpm;
|
|
322
|
-
confidence = "low";
|
|
323
|
-
regularizeBpm = detectiveBpm;
|
|
324
|
-
}
|
|
325
|
-
await pause?.();
|
|
326
|
-
const gridBeats = regularizeBpm !== null ? regularizeBeats(rawBeats, regularizeBpm, duration) : rawBeats;
|
|
327
|
-
const gated = gateBeatsBySilence(gridBeats, channelData, sampleRate);
|
|
328
|
-
return {
|
|
329
|
-
beatTimes: gated.times,
|
|
330
|
-
beatStrengths: gated.strengths,
|
|
331
|
-
bpm,
|
|
332
|
-
bpmConfidence: confidence,
|
|
333
|
-
channelData,
|
|
334
|
-
sampleRate,
|
|
335
|
-
peak: gated.peak
|
|
336
|
-
};
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
// <stdin>
|
|
340
|
-
globalThis.__hfAnalyze = analyzeMusicFromBuffer;
|
|
341
|
-
})();
|