hyperframes 0.8.150 → 0.8.152
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/dist/{add-3ZIFEN2U.js → add-SA33REHW.js} +14 -14
- package/dist/{animatedGifPrep-77LPFLKJ.js → animatedGifPrep-3YXJQZ7L.js} +9 -9
- package/dist/api.js +19 -19
- package/dist/{asset-EYSZEHM6.js → asset-PUVPTWPD.js} +2 -2
- package/dist/{assetCataloger-KX3HD7ZI.js → assetCataloger-VWE2PLBX.js} +4 -4
- package/dist/{auth-L6IWNRXY.js → auth-PS3M6AI7.js} +1 -1
- package/dist/{autoUpdate-2O3HZB65.js → autoUpdate-CMO4SHWU.js} +2 -2
- package/dist/{backgroundChecks-BH2LMJYE.js → backgroundChecks-EDZ2A55J.js} +3 -3
- package/dist/backgroundChecksWorker.js +3 -3
- package/dist/{batchRender-ZBKAYLWU.js → batchRender-7PLJISCN.js} +5 -5
- package/dist/{beats-IVLF2566.js → beats-2MDSIOE7.js} +15 -15
- package/dist/{benchmark-SYZFW2G7.js → benchmark-KBBXAPI4.js} +10 -10
- package/dist/{browser-OSW3L25S.js → browser-OMWKZRSW.js} +5 -5
- package/dist/{bundleWithLocalizedFonts-I4CWOXLK.js → bundleWithLocalizedFonts-76DMCRIW.js} +2 -2
- package/dist/{capture-AZOQ57TM.js → capture-LRUUXH5Q.js} +2 -2
- package/dist/{capture-V5ICGSVJ.js → capture-YGDC7GN3.js} +13 -13
- package/dist/{catalog-VBJOA2Y5.js → catalog-SMEBKEVO.js} +14 -14
- package/dist/{catch-up-TKSEDNJK.js → catch-up-OMILX3WE.js} +4 -4
- package/dist/{check-3HFISKDB.js → check-NUZ62LIW.js} +288 -64
- package/dist/{checkBrowser-MXBDNZJB.js → checkBrowser-MSTVEL4V.js} +181 -38
- package/dist/{chunk-73RBX2E7.js → chunk-3DZBQ7MH.js} +3 -3
- package/dist/{chunk-6QB7F2II.js → chunk-3E4OCOC5.js} +1 -1
- package/dist/{chunk-OQ7XMM3S.js → chunk-3HPJM5IQ.js} +1 -1
- package/dist/{chunk-UJB7356Y.js → chunk-3LO7BBJX.js} +3 -3
- package/dist/{chunk-APDLWWFG.js → chunk-3VGU2SH7.js} +1 -1
- package/dist/{chunk-DUUFDLC4.js → chunk-4MLYMDQ4.js} +1 -1
- package/dist/{chunk-AXPNVC3N.js → chunk-4UMKAUZI.js} +1 -1
- package/dist/{chunk-XPQSL5VS.js → chunk-54DMWFQZ.js} +8 -1
- package/dist/chunk-57GN6KWT.js +179 -0
- package/dist/{chunk-374QQGBQ.js → chunk-5CS4T6C6.js} +63 -12
- package/dist/{chunk-PCWOSS7G.js → chunk-5ERVRJMV.js} +3 -3
- package/dist/{chunk-TZPZE5PS.js → chunk-5VMSUW4Z.js} +6 -3
- package/dist/{chunk-M6UDJ2E7.js → chunk-6Z4YJ5Q3.js} +3 -3
- package/dist/{chunk-FJWEYVEM.js → chunk-7FYFEXD2.js} +658 -198
- package/dist/{chunk-UQYQ7TBA.js → chunk-7NPSXBIN.js} +2 -2
- package/dist/chunk-7TASSBN2.js +215 -0
- package/dist/{chunk-F2RLIE7P.js → chunk-ANS56TPS.js} +11 -11
- package/dist/{chunk-DOVJRUFM.js → chunk-BQK3J7XO.js} +1 -1
- package/dist/{chunk-FPAT5HTI.js → chunk-BYJYQWEX.js} +10 -10
- package/dist/{chunk-XXPYZBZ3.js → chunk-C6TPGUWD.js} +2 -2
- package/dist/{chunk-XQMEGSHG.js → chunk-D6RJXQLD.js} +1 -1
- package/dist/{chunk-RW7NLGPD.js → chunk-DFXK7KUO.js} +25 -17
- package/dist/{chunk-6SFPQ2RZ.js → chunk-E6EYZ33P.js} +2 -2
- package/dist/{chunk-AKYQGZLU.js → chunk-EVTHG34H.js} +2 -2
- package/dist/{chunk-5NAYNDBT.js → chunk-EXH6L2XZ.js} +6 -2
- package/dist/{chunk-AIJS74LG.js → chunk-FFDC5OWV.js} +8 -2
- package/dist/{chunk-4WFNTWKZ.js → chunk-FNN5QINS.js} +2 -2
- package/dist/{chunk-DMKI64EZ.js → chunk-FSZAFCU7.js} +1 -1
- package/dist/{chunk-S5F26DUL.js → chunk-GQETH4PE.js} +3 -3
- package/dist/{chunk-3UAIVF4L.js → chunk-H2SGM2V2.js} +1 -1
- package/dist/{chunk-O4DC5CHF.js → chunk-H7FXBK3Q.js} +1 -1
- package/dist/{chunk-UVVI2NJQ.js → chunk-HBCRRCTX.js} +109 -31
- package/dist/{chunk-NFQY7EIC.js → chunk-IBYC3VUA.js} +1 -1
- package/dist/{chunk-2KAL22B5.js → chunk-IEDT4EXE.js} +1 -1
- package/dist/{chunk-I6DATIHC.js → chunk-IZIRIDJH.js} +2 -2
- package/dist/{chunk-Z6WZDGCS.js → chunk-IZKXUYZE.js} +2 -2
- package/dist/chunk-KCFF4ENE.js +24 -0
- package/dist/{chunk-6KWA3XPS.js → chunk-KZ3L3W4Q.js} +1 -1
- package/dist/{chunk-7IEGPJ4P.js → chunk-LBT4AMSF.js} +1 -1
- package/dist/{chunk-7JTFPUMA.js → chunk-LECTCGGS.js} +1 -1
- package/dist/{chunk-7E4VHPKJ.js → chunk-LVPSWUS6.js} +5 -5
- package/dist/{chunk-6NPFJ255.js → chunk-MNHPG2UO.js} +1 -1
- package/dist/{chunk-FN6KAS7A.js → chunk-NHAG2KCE.js} +7 -7
- package/dist/{chunk-423DJVX2.js → chunk-PKO2EWO7.js} +1 -1
- package/dist/{chunk-ZNHAJCEA.js → chunk-PRXAOZWZ.js} +28 -13
- package/dist/{chunk-VQ7YIURZ.js → chunk-PTXZDSW5.js} +5 -5
- package/dist/{chunk-XANZ4R4P.js → chunk-QECEOV6W.js} +3 -3
- package/dist/{chunk-BLRJKBKP.js → chunk-QESSGUKX.js} +1 -1
- package/dist/{chunk-WLIUULZQ.js → chunk-RN5I2DP5.js} +29 -15
- package/dist/chunk-S3RCK56N.js +3795 -0
- package/dist/{chunk-UAIUVPZE.js → chunk-SWCSL6WS.js} +6 -6
- package/dist/{chunk-2PSPARWP.js → chunk-TYXH3EKP.js} +4 -0
- package/dist/{chunk-FMNVTKX2.js → chunk-U3BCDVZO.js} +1 -1
- package/dist/{chunk-LW5VFBSY.js → chunk-VS732BUG.js} +1 -1
- package/dist/{chunk-LFNQDTSH.js → chunk-VYKPBRCB.js} +63 -12
- package/dist/{chunk-M5B42RL5.js → chunk-WUUOFMHU.js} +3 -3
- package/dist/{chunk-A6ZO4BX7.js → chunk-XEFFJRYX.js} +2 -2
- package/dist/{chunk-EL5QVJEG.js → chunk-XINGD6MS.js} +4 -4
- package/dist/chunk-XSEGMQYA.js +30 -0
- package/dist/{chunk-CZQLCBWY.js → chunk-YG2Y55KF.js} +1 -1
- package/dist/{chunk-B3XLIBFL.js → chunk-YIJMVFEJ.js} +1 -1
- package/dist/{chunk-JDB65PPT.js → chunk-YOEGUBBY.js} +13 -12
- package/dist/{chunk-AFRXL75S.js → chunk-YYEYOFHW.js} +1 -1
- package/dist/{chunk-R5A7454P.js → chunk-ZTM3RMAD.js} +2 -2
- package/dist/{clean-7HU7S7DT.js → clean-F75G45BI.js} +56 -35
- package/dist/cli.js +53 -53
- package/dist/{cloud-HAXHBO25.js → cloud-KVJAOUWH.js} +4 -4
- package/dist/{cloudrun-A3PIJ6DX.js → cloudrun-Q7Q7O4GY.js} +6 -6
- package/dist/{compare-6IPSQMSM.js → compare-DGUJ4QWU.js} +30 -30
- package/dist/{compiler-UQP2VXN6.js → compiler-NCN6PTVH.js} +6 -6
- package/dist/{component-FF3AU24M.js → component-PSYGT3JV.js} +3 -3
- package/dist/{compositions-JSH4MZXB.js → compositions-J3GAETIC.js} +13 -13
- package/dist/{delete-G763SW64.js → delete-MR7LRGRP.js} +2 -2
- package/dist/{deterministicFonts-C5JQLCTS.js → deterministicFonts-EOMDR6ZF.js} +3 -3
- package/dist/{dist-HUMFCJ6T.js → dist-2YYJYYPY.js} +3 -3
- package/dist/{dist-Z7Q3JS7K.js → dist-3MHXG6EJ.js} +4 -4
- package/dist/{doctor-WZB6WMBY.js → doctor-JOUGR5UK.js} +15 -15
- package/dist/{events-T4YFQC5G.js → events-63BKDWVO.js} +3 -3
- package/dist/{events-MUWJJCC7.js → events-FZFBJCIH.js} +2 -2
- package/dist/{feedback-AUTHQNN2.js → feedback-QLKWUDXR.js} +8 -8
- package/dist/{ffmpeg-TZB5WAYE.js → ffmpeg-MJFMBBSF.js} +2 -2
- package/dist/{figma-NBG6WBI7.js → figma-YJ7HGVQC.js} +3 -3
- package/dist/fontLocalizeCli.js +12 -12
- package/dist/{get-OXBJLKLV.js → get-54MUUXMR.js} +2 -2
- package/dist/{gpuPolicy-HBCCEQUS.js → gpuPolicy-5OVNR75D.js} +9 -9
- package/dist/{grade-compare-2LX4FDH7.js → grade-compare-7IDUF673.js} +32 -32
- package/dist/{gsapParserAcorn-VXZ3ZIF2.js → gsapParserAcorn-7NCK2LVT.js} +2 -2
- package/dist/{help-LJI46EDO.js → help-GQFYO5LU.js} +1 -1
- package/dist/{history-MFKAQEHU.js → history-UI3O7CSO.js} +77 -205
- package/dist/hyperframe-runtime.js +54 -54
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +54 -54
- package/dist/hyperframes-player.global.js +3 -3
- package/dist/{info-D6Y5O2QE.js → info-VQV3APEX.js} +9 -9
- package/dist/{init-47NZPEBI.js → init-2UBFV5D7.js} +31 -31
- package/dist/{inspect-U5UXJK5D.js → inspect-36ACJ3CO.js} +31 -31
- package/dist/{installer-AW7VFVTQ.js → installer-GDUZDJG4.js} +7 -7
- package/dist/{keyframes-5G334NWB.js → keyframes-GPBU34BG.js} +227 -82
- package/dist/{lambda-GASGXN3A.js → lambda-CBJVLTHY.js} +7 -7
- package/dist/{layout-OXAQFLJS.js → layout-2IHFV6EI.js} +31 -31
- package/dist/{lint-F36QFSNF.js → lint-IR6IYCEO.js} +9 -9
- package/dist/{lintProject-SSEXWCH6.js → lintProject-XQWXJYSC.js} +3 -3
- package/dist/{list-TR6QCI53.js → list-UAGKWARH.js} +2 -2
- package/dist/{login-6LA2RWTC.js → login-2GYCNCZF.js} +4 -4
- package/dist/{manager-ES2UFT4X.js → manager-X44GKUEL.js} +3 -3
- package/dist/{manager-GWU5J6RJ.js → manager-ZLJD3EAY.js} +2 -2
- package/dist/{media-treatment-BOHYDWVY.js → media-treatment-Z553F7XI.js} +14 -14
- package/dist/{models-6GW5Q3IW.js → models-6AZTNNSO.js} +15 -15
- package/dist/{motionShot-O7AOMPUN.js → motionShot-ARRL7WXT.js} +29 -16
- package/dist/{normalize-audio-UO5B4O76.js → normalize-audio-CME4NUB6.js} +6 -6
- package/dist/{open-JV2EHVKM.js → open-HU2VXUFD.js} +4 -4
- package/dist/{parakeetRunner-23DZUF6G.js → parakeetRunner-X5MKFMCB.js} +16 -16
- package/dist/{pipeline-KTICSIK7.js → pipeline-MNFTEBJU.js} +11 -11
- package/dist/{play-CMUYPXBC.js → play-2BBJDDAZ.js} +24 -24
- package/dist/{preflight-JOD4OXGC.js → preflight-JYOX64YP.js} +4 -4
- package/dist/{present-ZDT5FM2H.js → present-OE2WL2NY.js} +20 -20
- package/dist/{preview-ASHLGKDD.js → preview-RYSCCAWJ.js} +21 -21
- package/dist/{producer-FFH2KUAZ.js → producer-SQWNRO66.js} +1 -1
- package/dist/{projectConfig-FHIAOPKW.js → projectConfig-B55Z7YKQ.js} +9 -9
- package/dist/{publication-WO5ZXURT.js → publication-MDZCOBJP.js} +4 -4
- package/dist/{publish-QWO2W7FB.js → publish-AILV36BO.js} +12 -12
- package/dist/{remove-background-BO5MQR25.js → remove-background-6F72LKHG.js} +12 -12
- package/dist/{render-XTJKGT3G.js → render-2MZKU3L5.js} +10 -10
- package/dist/{render-SDHFXL3Y.js → render-5EREH6YD.js} +95 -37
- package/dist/{render-HS3YOLSD.js → render-6GH5FSXU.js} +5 -5
- package/dist/{render-batch-J64AJHQY.js → render-batch-UMBUQWWS.js} +5 -5
- package/dist/renderSetupWorker.js +6 -6
- package/dist/{resolver-IHNWMDJA.js → resolver-KO6WWO5P.js} +6 -6
- package/dist/{sherpa-FXBBYMDR.js → sherpa-DADGYWNR.js} +15 -15
- package/dist/skills/hyperframes/references/frame-worker-core.md +11 -9
- package/dist/skills/hyperframes/references/subagent-dispatch.md +1 -1
- package/dist/skills/hyperframes-cli/SKILL.md +3 -0
- package/dist/skills/hyperframes-cli/references/lint-validate-inspect.md +5 -1
- package/dist/skills/media-use/audio/scripts/lib/tts.cleanup.test.mjs +175 -0
- package/dist/skills/media-use/audio/scripts/lib/tts.mjs +24 -19
- package/dist/skills/media-use/references/grading.md +1 -2
- package/dist/skills/media-use/references/meta.md +17 -17
- package/dist/skills/media-use/references/operations.md +6 -6
- package/dist/skills/media-use/references/setup-providers.md +3 -4
- package/dist/skills/media-use/scripts/lib/cutlist.mjs +9 -2
- package/dist/skills/media-use/scripts/lib/cutlist.test.mjs +12 -0
- package/dist/skills/media-use/scripts/lib/telemetry.mjs +4 -1
- package/dist/skills/media-use/scripts/lib/telemetry.test.mjs +20 -0
- package/dist/skills/media-use/scripts/transcript-cut.mjs +23 -4
- package/dist/skills/media-use/scripts/transcript-cut.test.mjs +224 -0
- package/dist/{skills-ALLSN7TB.js → skills-QLKSNU4Y.js} +5 -5
- package/dist/{skillsUpdateCheck-EIT5NWM6.js → skillsUpdateCheck-Z2QQGF2W.js} +3 -3
- package/dist/{snapshot-Y3I76OIZ.js → snapshot-D5BBFXOS.js} +342 -154
- package/dist/{src-7V6LBC56.js → src-AVQBAECC.js} +10 -8
- package/dist/{src-S5IZVJUX.js → src-V7263E47.js} +11 -11
- package/dist/{staticProjectServer-QLWWGHZE.js → staticProjectServer-HNWSVEWN.js} +20 -20
- package/dist/studio/assets/{hyperframes-player-kup62bDR.js → hyperframes-player-0BY7-PK7.js} +1 -1
- package/dist/studio/assets/{index-B8BBYY8L.js → index-COrWdzlj.js} +1 -1
- package/dist/studio/assets/{index-CS_m0TkX.js → index-p-VXwuJ2.js} +132 -132
- package/dist/studio/assets/{index-DQ5jGodF.js → index-rmD5k_ES.js} +1 -1
- package/dist/studio/index.html +1 -1
- package/dist/{studio-api-UBFLZ3DA.js → studio-api-UXKTDWLT.js} +30 -16
- package/dist/{studioServer-REOVCIFP.js → studioServer-JOVR24O3.js} +51 -51
- package/dist/{synthesize-22B7L5GX.js → synthesize-MBDVUSH3.js} +2 -1
- package/dist/{telemetry-C3GDIXHO.js → telemetry-UW7XAM5W.js} +3 -3
- package/dist/{timeline-H42EGLMT.js → timeline-JSGTZ3AN.js} +73 -20
- package/dist/{tokens-2K7ISTKV.js → tokens-ADDBGTQ7.js} +2 -2
- package/dist/{transcribe-NUPASAUP.js → transcribe-FEHOK626.js} +14 -14
- package/dist/{transcribe-DVM7UFZZ.js → transcribe-P6MJGSZJ.js} +20 -20
- package/dist/{tts-QSAQZVEZ.js → tts-POI553RG.js} +1 -1
- package/dist/{updateCheck-3RWFSEZD.js → updateCheck-IBWMLXQ4.js} +2 -2
- package/dist/{upgrade-YKKL36N7.js → upgrade-NHZ7AYPO.js} +2 -2
- package/dist/{urlDownloader-6JNJYLPN.js → urlDownloader-ULDRBWS5.js} +8 -8
- package/dist/{validate-Z7KQT7GO.js → validate-NVWNXNBV.js} +25 -25
- package/dist/{video-EXL2JDSL.js → video-74DRD2DN.js} +9 -9
- package/package.json +1 -1
- package/dist/chunk-CEND6BLF.js +0 -3795
- package/dist/chunk-WBLXWOYK.js +0 -15
|
@@ -8,19 +8,20 @@ import {
|
|
|
8
8
|
auditClipDurations,
|
|
9
9
|
shouldIgnoreHttpError,
|
|
10
10
|
shouldIgnoreRequestFailure
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-ANS56TPS.js";
|
|
12
12
|
import {
|
|
13
|
+
checkSnapshotDirectory,
|
|
13
14
|
rectToBbox
|
|
14
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-XSEGMQYA.js";
|
|
15
16
|
import {
|
|
16
17
|
ambiguousIssue,
|
|
17
18
|
loadBrowserScript
|
|
18
|
-
} from "./chunk-
|
|
19
|
+
} from "./chunk-BYJYQWEX.js";
|
|
19
20
|
import {
|
|
20
21
|
serveStaticProjectHtml
|
|
21
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-GQETH4PE.js";
|
|
22
23
|
import "./chunk-XUHOIDKG.js";
|
|
23
|
-
import "./chunk-
|
|
24
|
+
import "./chunk-XEFFJRYX.js";
|
|
24
25
|
import "./chunk-X7MTZ4T2.js";
|
|
25
26
|
import {
|
|
26
27
|
AUDIT_SEEK_OPTIONS,
|
|
@@ -33,42 +34,42 @@ import {
|
|
|
33
34
|
resolveCliChromeGpuMode,
|
|
34
35
|
seekCompositionTimeline,
|
|
35
36
|
waitForPreferredSeekTarget
|
|
36
|
-
} from "./chunk-
|
|
37
|
+
} from "./chunk-SWCSL6WS.js";
|
|
37
38
|
import "./chunk-FH7WODJH.js";
|
|
38
|
-
import "./chunk-
|
|
39
|
-
import "./chunk-
|
|
39
|
+
import "./chunk-4UMKAUZI.js";
|
|
40
|
+
import "./chunk-PKO2EWO7.js";
|
|
40
41
|
import "./chunk-WPNE5NEP.js";
|
|
41
|
-
import "./chunk-
|
|
42
|
-
import "./chunk-
|
|
43
|
-
import "./chunk-
|
|
44
|
-
import "./chunk-
|
|
42
|
+
import "./chunk-HBCRRCTX.js";
|
|
43
|
+
import "./chunk-PRXAOZWZ.js";
|
|
44
|
+
import "./chunk-C6TPGUWD.js";
|
|
45
|
+
import "./chunk-7FYFEXD2.js";
|
|
45
46
|
import {
|
|
46
47
|
FfmpegUnavailableError,
|
|
47
48
|
decideMediaProxyEligibility,
|
|
48
49
|
proxyVariantFor,
|
|
49
50
|
resolveProxies,
|
|
50
51
|
scanProjectMediaCodecMap
|
|
51
|
-
} from "./chunk-
|
|
52
|
-
import "./chunk-
|
|
53
|
-
import "./chunk-
|
|
52
|
+
} from "./chunk-XINGD6MS.js";
|
|
53
|
+
import "./chunk-FFDC5OWV.js";
|
|
54
|
+
import "./chunk-IBYC3VUA.js";
|
|
54
55
|
import "./chunk-K2FLNJVB.js";
|
|
55
|
-
import "./chunk-
|
|
56
|
+
import "./chunk-EVTHG34H.js";
|
|
56
57
|
import "./chunk-442JNXRM.js";
|
|
57
58
|
import {
|
|
58
59
|
resolveAutoProxy
|
|
59
|
-
} from "./chunk-
|
|
60
|
+
} from "./chunk-D6RJXQLD.js";
|
|
60
61
|
import "./chunk-XT7X6QCP.js";
|
|
61
62
|
import "./chunk-4YYJOFKS.js";
|
|
62
63
|
import "./chunk-HVW7ABXD.js";
|
|
63
|
-
import "./chunk-
|
|
64
|
-
import "./chunk-
|
|
65
|
-
import "./chunk-
|
|
64
|
+
import "./chunk-QESSGUKX.js";
|
|
65
|
+
import "./chunk-6Z4YJ5Q3.js";
|
|
66
|
+
import "./chunk-3HPJM5IQ.js";
|
|
66
67
|
import "./chunk-AWDFDFI3.js";
|
|
67
68
|
import "./chunk-P6LJ4Y32.js";
|
|
68
69
|
import "./chunk-GMECXFAN.js";
|
|
69
|
-
import "./chunk-
|
|
70
|
-
import "./chunk-
|
|
71
|
-
import "./chunk-
|
|
70
|
+
import "./chunk-5CS4T6C6.js";
|
|
71
|
+
import "./chunk-H2SGM2V2.js";
|
|
72
|
+
import "./chunk-KZ3L3W4Q.js";
|
|
72
73
|
import "./chunk-VWG7OQKU.js";
|
|
73
74
|
import "./chunk-XBSPQ52S.js";
|
|
74
75
|
import "./chunk-S3S4TGEH.js";
|
|
@@ -77,37 +78,37 @@ import "./chunk-PBN6GBJE.js";
|
|
|
77
78
|
import "./chunk-ZTZA4UWZ.js";
|
|
78
79
|
import "./chunk-EOOEC32M.js";
|
|
79
80
|
import "./chunk-TJSTGSAW.js";
|
|
80
|
-
import "./chunk-
|
|
81
|
+
import "./chunk-YYEYOFHW.js";
|
|
81
82
|
import "./chunk-K4WIOZFP.js";
|
|
82
83
|
import "./chunk-XUXGIA7H.js";
|
|
83
84
|
import "./chunk-WERLJGIC.js";
|
|
84
85
|
import "./chunk-ISN5GRYI.js";
|
|
85
|
-
import "./chunk-
|
|
86
|
+
import "./chunk-IZIRIDJH.js";
|
|
86
87
|
import "./chunk-EOVYQ3IG.js";
|
|
87
88
|
import "./chunk-AMKC3AXA.js";
|
|
88
|
-
import "./chunk-
|
|
89
|
-
import "./chunk-
|
|
89
|
+
import "./chunk-EXH6L2XZ.js";
|
|
90
|
+
import "./chunk-RN5I2DP5.js";
|
|
90
91
|
import "./chunk-NE55C6S5.js";
|
|
91
92
|
import "./chunk-JYVGYKXG.js";
|
|
92
|
-
import "./chunk-
|
|
93
|
-
import "./chunk-
|
|
93
|
+
import "./chunk-5ERVRJMV.js";
|
|
94
|
+
import "./chunk-S3RCK56N.js";
|
|
94
95
|
import "./chunk-VC76R6W2.js";
|
|
95
96
|
import "./chunk-UJKQWGFF.js";
|
|
96
|
-
import "./chunk-
|
|
97
|
+
import "./chunk-VYKPBRCB.js";
|
|
97
98
|
import "./chunk-OFQWTKPW.js";
|
|
98
99
|
import "./chunk-DPVXBVLL.js";
|
|
99
100
|
import "./chunk-T76PLPD6.js";
|
|
100
101
|
import "./chunk-FXMKHHPO.js";
|
|
101
102
|
import "./chunk-RQVDTPGD.js";
|
|
102
103
|
import "./chunk-TWWSYAKJ.js";
|
|
103
|
-
import "./chunk-
|
|
104
|
+
import "./chunk-YOEGUBBY.js";
|
|
104
105
|
import "./chunk-IWFLMU2N.js";
|
|
105
|
-
import "./chunk-
|
|
106
|
+
import "./chunk-3VGU2SH7.js";
|
|
106
107
|
import "./chunk-VAS6HQX3.js";
|
|
107
108
|
import "./chunk-3RM2ETQT.js";
|
|
108
109
|
import "./chunk-BSQ7XANM.js";
|
|
109
110
|
import "./chunk-SDYDNHEE.js";
|
|
110
|
-
import "./chunk-
|
|
111
|
+
import "./chunk-TYXH3EKP.js";
|
|
111
112
|
import "./chunk-IXLUTE6N.js";
|
|
112
113
|
import {
|
|
113
114
|
normalizeErrorMessage
|
|
@@ -118,6 +119,118 @@ import "./chunk-M2WBOQ2Q.js";
|
|
|
118
119
|
// src/utils/checkBrowser.ts
|
|
119
120
|
import { mkdirSync, writeFileSync } from "fs";
|
|
120
121
|
import { join, resolve } from "path";
|
|
122
|
+
|
|
123
|
+
// src/utils/gsapTweenTails.ts
|
|
124
|
+
var TWEEN_TAIL_WINDOW = 0.25;
|
|
125
|
+
function findTweenTails(records) {
|
|
126
|
+
return records.flatMap(
|
|
127
|
+
(earlier) => records.flatMap((later) => {
|
|
128
|
+
const tail = tailBetween(earlier, later);
|
|
129
|
+
return tail ? [tail] : [];
|
|
130
|
+
})
|
|
131
|
+
);
|
|
132
|
+
}
|
|
133
|
+
function tailBetween(earlier, later) {
|
|
134
|
+
if (later.target !== earlier.target || later.timeline !== earlier.timeline) return null;
|
|
135
|
+
const overlaps = earlier.start < later.start && later.start < earlier.end;
|
|
136
|
+
const tail = earlier.end - later.end;
|
|
137
|
+
if (!overlaps || tail <= 0 || tail > TWEEN_TAIL_WINDOW) return null;
|
|
138
|
+
const properties = earlier.properties.filter((name) => later.properties.includes(name));
|
|
139
|
+
if (properties.length === 0) return null;
|
|
140
|
+
return {
|
|
141
|
+
timeline: earlier.timeline,
|
|
142
|
+
label: earlier.label,
|
|
143
|
+
properties,
|
|
144
|
+
earlier: { start: earlier.start, end: earlier.end },
|
|
145
|
+
later: { start: later.start, end: later.end }
|
|
146
|
+
};
|
|
147
|
+
}
|
|
148
|
+
function tweenTailMessage(tail) {
|
|
149
|
+
const props = tail.properties.join(", ");
|
|
150
|
+
const seconds = (value) => `${value.toFixed(3)} s`;
|
|
151
|
+
return `In timeline "${tail.timeline}", a tween on ${props} of ${tail.label} ends at ${seconds(tail.earlier.end)}, ${(tail.earlier.end - tail.later.end).toFixed(3)} s after a later tween on ${props} ends at ${seconds(tail.later.end)}. For that tail the earlier tween takes ${props} back and leaves its own end value on screen, so the later tween's end never shows. End the earlier tween by ${seconds(tail.later.start)}, or add overwrite: "auto" to the later tween.`;
|
|
152
|
+
}
|
|
153
|
+
function collectTweenRecords() {
|
|
154
|
+
const NOT_PROPERTIES = /* @__PURE__ */ new Set([
|
|
155
|
+
"duration",
|
|
156
|
+
"delay",
|
|
157
|
+
"ease",
|
|
158
|
+
"repeat",
|
|
159
|
+
"repeatDelay",
|
|
160
|
+
"repeatRefresh",
|
|
161
|
+
"yoyo",
|
|
162
|
+
"yoyoEase",
|
|
163
|
+
"stagger",
|
|
164
|
+
"overwrite",
|
|
165
|
+
"immediateRender",
|
|
166
|
+
"lazy",
|
|
167
|
+
"paused",
|
|
168
|
+
"reversed",
|
|
169
|
+
"runBackwards",
|
|
170
|
+
"startAt",
|
|
171
|
+
"keyframes",
|
|
172
|
+
"inherit",
|
|
173
|
+
"data",
|
|
174
|
+
"id",
|
|
175
|
+
"callbackScope",
|
|
176
|
+
"onStart",
|
|
177
|
+
"onStartParams",
|
|
178
|
+
"onUpdate",
|
|
179
|
+
"onUpdateParams",
|
|
180
|
+
"onComplete",
|
|
181
|
+
"onCompleteParams",
|
|
182
|
+
"onRepeat",
|
|
183
|
+
"onRepeatParams",
|
|
184
|
+
"onReverseComplete",
|
|
185
|
+
"onReverseCompleteParams",
|
|
186
|
+
"parent",
|
|
187
|
+
"onInterrupt",
|
|
188
|
+
"autoRevert",
|
|
189
|
+
"smoothChildTiming"
|
|
190
|
+
]);
|
|
191
|
+
const registered = window.__timelines ?? {};
|
|
192
|
+
const names = /* @__PURE__ */ new Map();
|
|
193
|
+
for (const [name, timeline] of Object.entries(registered)) {
|
|
194
|
+
if (typeof timeline?.getChildren === "function") names.set(timeline, name);
|
|
195
|
+
}
|
|
196
|
+
const ids = /* @__PURE__ */ new Map();
|
|
197
|
+
function nestedInAnother(timeline) {
|
|
198
|
+
for (let parent = timeline.parent; parent; parent = parent.parent) {
|
|
199
|
+
if (names.has(parent)) return true;
|
|
200
|
+
}
|
|
201
|
+
return false;
|
|
202
|
+
}
|
|
203
|
+
function plainProperties(tween) {
|
|
204
|
+
const vars = tween.vars ?? {};
|
|
205
|
+
const plain = !vars.repeat && !vars.yoyo && !vars.keyframes && !vars.overwrite;
|
|
206
|
+
return plain ? Object.keys(vars).filter((key) => !NOT_PROPERTIES.has(key)) : [];
|
|
207
|
+
}
|
|
208
|
+
function labelOf(target) {
|
|
209
|
+
if (!(target instanceof Element)) return "an object";
|
|
210
|
+
if (target.id) return `#${target.id}`;
|
|
211
|
+
return [target.tagName.toLowerCase(), ...target.classList].join(".");
|
|
212
|
+
}
|
|
213
|
+
function recordsOf(timeline, name) {
|
|
214
|
+
const origin = timeline.globalTime(0);
|
|
215
|
+
return (timeline.getChildren?.(true, true, false) ?? []).flatMap((tween) => {
|
|
216
|
+
const duration = tween.totalDuration();
|
|
217
|
+
const properties = plainProperties(tween);
|
|
218
|
+
if (!(duration > 0) || properties.length === 0) return [];
|
|
219
|
+
const start = tween.globalTime(0) - origin;
|
|
220
|
+
const end = tween.globalTime(duration) - origin;
|
|
221
|
+
return tween.targets().map((target) => {
|
|
222
|
+
if (!ids.has(target)) ids.set(target, ids.size);
|
|
223
|
+
const id = ids.get(target) ?? -1;
|
|
224
|
+
return { timeline: name, target: id, label: labelOf(target), properties, start, end };
|
|
225
|
+
});
|
|
226
|
+
});
|
|
227
|
+
}
|
|
228
|
+
return [...names].flatMap(
|
|
229
|
+
([timeline, name]) => nestedInAnother(timeline) ? [] : recordsOf(timeline, name)
|
|
230
|
+
);
|
|
231
|
+
}
|
|
232
|
+
|
|
233
|
+
// src/utils/checkBrowser.ts
|
|
121
234
|
async function preResolveHostileMediaProxies(projectDir, html, autoProxyOverride) {
|
|
122
235
|
const none = { findings: [], failedPaths: /* @__PURE__ */ new Set() };
|
|
123
236
|
if (!resolveAutoProxy(projectDir, autoProxyOverride)) return none;
|
|
@@ -172,7 +285,7 @@ function proxyFailedDraft(message) {
|
|
|
172
285
|
return { code: "media_proxy_failed", severity: "warning", message, time: 0 };
|
|
173
286
|
}
|
|
174
287
|
async function runBrowserCheck(project, options, motion, runGrid) {
|
|
175
|
-
const { bundleWithLocalizedFonts } = await import("./bundleWithLocalizedFonts-
|
|
288
|
+
const { bundleWithLocalizedFonts } = await import("./bundleWithLocalizedFonts-76DMCRIW.js");
|
|
176
289
|
const html = await bundleWithLocalizedFonts(project.dir);
|
|
177
290
|
const { findings: drafts, failedPaths } = await preResolveHostileMediaProxies(
|
|
178
291
|
project.dir,
|
|
@@ -202,10 +315,14 @@ async function runBrowserCheck(project, options, motion, runGrid) {
|
|
|
202
315
|
await waitForPreferredSeekTarget(page);
|
|
203
316
|
const rootAnchor = await resolveRootAnchor(page);
|
|
204
317
|
const launchSettleMs = Date.now() - launchSettleStart;
|
|
205
|
-
const { analyzeClipMediaFit } = await import("./src-
|
|
318
|
+
const { analyzeClipMediaFit } = await import("./src-AVQBAECC.js");
|
|
206
319
|
for (const entry of await auditClipDurations(page, analyzeClipMediaFit, options.timeout)) {
|
|
207
320
|
drafts.push({ code: "clip_media_fit", severity: entry.level, message: entry.text, time: 0 });
|
|
208
321
|
}
|
|
322
|
+
for (const tail of findTweenTails(await page.evaluate(collectTweenRecords) ?? [])) {
|
|
323
|
+
const message = tweenTailMessage(tail);
|
|
324
|
+
drafts.push({ code: "gsap_tween_tail", severity: "warning", message, time: tail.later.end });
|
|
325
|
+
}
|
|
209
326
|
const driver = createPageDriver(page, (time) => {
|
|
210
327
|
currentTime = time;
|
|
211
328
|
});
|
|
@@ -226,7 +343,7 @@ async function runBrowserCheck(project, options, motion, runGrid) {
|
|
|
226
343
|
}
|
|
227
344
|
async function captureFindingCrops(project, options, requests) {
|
|
228
345
|
if (requests.length === 0) return [];
|
|
229
|
-
const { bundleWithLocalizedFonts } = await import("./bundleWithLocalizedFonts-
|
|
346
|
+
const { bundleWithLocalizedFonts } = await import("./bundleWithLocalizedFonts-76DMCRIW.js");
|
|
230
347
|
const html = await bundleWithLocalizedFonts(project.dir);
|
|
231
348
|
const server = await serveStaticProjectHtml(
|
|
232
349
|
project.dir,
|
|
@@ -247,7 +364,7 @@ async function captureFindingCrops(project, options, requests) {
|
|
|
247
364
|
chromeBrowser = session.browser;
|
|
248
365
|
const page = session.page;
|
|
249
366
|
await waitForPreferredSeekTarget(page);
|
|
250
|
-
const snapshotDir =
|
|
367
|
+
const snapshotDir = checkSnapshotDirectory(project.dir);
|
|
251
368
|
mkdirSync(snapshotDir, { recursive: true });
|
|
252
369
|
for (const request of requests) {
|
|
253
370
|
await seekCompositionTimeline(page, request.time, AUDIT_SEEK_OPTIONS);
|
|
@@ -258,7 +375,7 @@ async function captureFindingCrops(project, options, requests) {
|
|
|
258
375
|
const region = padCropRegion(request.bbox, canvas, DEFAULT_ZOOM_PADDING_PX);
|
|
259
376
|
const buffer = await captureRegionCrop(page, region, DEFAULT_ZOOM_SCALE);
|
|
260
377
|
writeFileSync(join(snapshotDir, request.filename), buffer);
|
|
261
|
-
written.push(join(
|
|
378
|
+
written.push(join(snapshotDir, request.filename));
|
|
262
379
|
}
|
|
263
380
|
return written;
|
|
264
381
|
} finally {
|
|
@@ -438,6 +555,7 @@ function wireNetworkListeners(page, drafts, currentTime) {
|
|
|
438
555
|
function createPageDriver(page, setTime) {
|
|
439
556
|
return {
|
|
440
557
|
initialize: (contrast) => injectAuditScripts(page, contrast),
|
|
558
|
+
matchComponents: (components, findings) => page.evaluate(matchComponentFindings, { components, findings }),
|
|
441
559
|
getDuration: () => getCompositionDuration(page),
|
|
442
560
|
hasNoTimelineDeclaration: () => hasNoTimelineDeclaration(page),
|
|
443
561
|
getTransitionBoundaries: () => collectTweenBoundaries(page),
|
|
@@ -1174,12 +1292,37 @@ function urlPath(url) {
|
|
|
1174
1292
|
return url;
|
|
1175
1293
|
}
|
|
1176
1294
|
}
|
|
1295
|
+
function matchComponentFindings({
|
|
1296
|
+
components,
|
|
1297
|
+
findings
|
|
1298
|
+
}) {
|
|
1299
|
+
const roots = components.flatMap((selector) => {
|
|
1300
|
+
const matches = [...document.querySelectorAll(selector)];
|
|
1301
|
+
if (!matches.length) throw new Error(`Component selector matched nothing: ${selector}`);
|
|
1302
|
+
return matches;
|
|
1303
|
+
});
|
|
1304
|
+
function matchesSelector(selector) {
|
|
1305
|
+
try {
|
|
1306
|
+
const elements = [...document.querySelectorAll(selector)];
|
|
1307
|
+
if (!elements.length) return null;
|
|
1308
|
+
return elements.some((el) => roots.some((root) => root.contains(el)));
|
|
1309
|
+
} catch {
|
|
1310
|
+
return null;
|
|
1311
|
+
}
|
|
1312
|
+
}
|
|
1313
|
+
return findings.map((finding) => {
|
|
1314
|
+
if (!finding.selector || finding.selector === "[data-composition-id]") return true;
|
|
1315
|
+
const container = Reflect.get(finding, "containerSelector");
|
|
1316
|
+
return matchesSelector(finding.selector) !== false || typeof container === "string" && matchesSelector(container) !== false;
|
|
1317
|
+
});
|
|
1318
|
+
}
|
|
1177
1319
|
export {
|
|
1178
1320
|
captureFindingCrops,
|
|
1179
1321
|
captureOverviewShot,
|
|
1180
1322
|
collectSeekClock,
|
|
1181
1323
|
dropFailedProxyEchoes,
|
|
1182
1324
|
keepBrokenImageAborts,
|
|
1325
|
+
matchComponentFindings,
|
|
1183
1326
|
preResolveHostileMediaProxies,
|
|
1184
1327
|
runBrowserCheck
|
|
1185
1328
|
};
|
|
@@ -7,14 +7,14 @@ var __dirname = __hf_dirname(__filename);
|
|
|
7
7
|
import {
|
|
8
8
|
trackLintReport,
|
|
9
9
|
trackLintRuleStreak
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-H2SGM2V2.js";
|
|
11
11
|
import {
|
|
12
12
|
shouldTrack
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-KZ3L3W4Q.js";
|
|
14
14
|
import {
|
|
15
15
|
LINT_RULE_COUNT,
|
|
16
16
|
LINT_RULE_GROUP_COUNTS
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-YOEGUBBY.js";
|
|
18
18
|
|
|
19
19
|
// src/telemetry/lintStreaks.ts
|
|
20
20
|
import { createHash } from "crypto";
|
|
@@ -7,10 +7,10 @@ var __dirname = __hf_dirname(__filename);
|
|
|
7
7
|
import {
|
|
8
8
|
parseFeedbackRating,
|
|
9
9
|
trackRenderFeedback
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-H2SGM2V2.js";
|
|
11
11
|
import {
|
|
12
12
|
shouldTrack
|
|
13
|
-
} from "./chunk-
|
|
13
|
+
} from "./chunk-KZ3L3W4Q.js";
|
|
14
14
|
import {
|
|
15
15
|
detectAgentRuntime
|
|
16
16
|
} from "./chunk-XBSPQ52S.js";
|
|
@@ -84,7 +84,7 @@ async function getDoctorSummary() {
|
|
|
84
84
|
try {
|
|
85
85
|
const [{ getSystemMeta }, { findFFmpeg }] = await Promise.all([
|
|
86
86
|
import("./system-OXRG57F2.js"),
|
|
87
|
-
import("./ffmpeg-
|
|
87
|
+
import("./ffmpeg-MJFMBBSF.js")
|
|
88
88
|
]);
|
|
89
89
|
const sys = getSystemMeta();
|
|
90
90
|
const parts = [
|
|
@@ -6,7 +6,7 @@ var __filename = __hf_fileURLToPath(import.meta.url);
|
|
|
6
6
|
var __dirname = __hf_dirname(__filename);
|
|
7
7
|
import {
|
|
8
8
|
resolveCaptureBrowserGpuMode
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-EVTHG34H.js";
|
|
10
10
|
import {
|
|
11
11
|
requestCliExit
|
|
12
12
|
} from "./chunk-PBN6GBJE.js";
|
|
@@ -218,13 +218,20 @@ function renderSetupError(error) {
|
|
|
218
218
|
const reason = failure?.reason ?? error.stderr.trim();
|
|
219
219
|
return reason ? new Error(reason, { cause: error }) : error;
|
|
220
220
|
}
|
|
221
|
+
function tsxLoaderFromCliInstall() {
|
|
222
|
+
try {
|
|
223
|
+
return import.meta.resolve("tsx");
|
|
224
|
+
} catch {
|
|
225
|
+
return "tsx";
|
|
226
|
+
}
|
|
227
|
+
}
|
|
221
228
|
async function runRenderSetupWorker(mode, input, options) {
|
|
222
229
|
const sourceMode = import.meta.url.endsWith(".ts");
|
|
223
230
|
const workerUrl = new URL(
|
|
224
231
|
sourceMode ? "../renderSetupWorker.ts" : "./renderSetupWorker.js",
|
|
225
232
|
import.meta.url
|
|
226
233
|
);
|
|
227
|
-
const execArgv = sourceMode ? ["--import",
|
|
234
|
+
const execArgv = sourceMode && !process.versions.bun ? ["--import", tsxLoaderFromCliInstall()] : [];
|
|
228
235
|
let result;
|
|
229
236
|
try {
|
|
230
237
|
result = await runCancellableProcess(
|
|
@@ -0,0 +1,179 @@
|
|
|
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
|
+
|
|
8
|
+
// src/utils/pngDimensions.ts
|
|
9
|
+
import { readFileSync } from "fs";
|
|
10
|
+
function pngDimensions(path) {
|
|
11
|
+
try {
|
|
12
|
+
const png = readFileSync(path);
|
|
13
|
+
if (png.length < 24) return {};
|
|
14
|
+
return { width: png.readUInt32BE(16), height: png.readUInt32BE(20) };
|
|
15
|
+
} catch {
|
|
16
|
+
return {};
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
// src/utils/toolContext.ts
|
|
21
|
+
import { appendFileSync } from "fs";
|
|
22
|
+
import { extname, isAbsolute, resolve } from "path";
|
|
23
|
+
var TOOL_CONTEXT_VERSION = 1;
|
|
24
|
+
var isRecord = (value) => typeof value === "object" && value !== null && !Array.isArray(value);
|
|
25
|
+
function parseEvents(value) {
|
|
26
|
+
if (!isRecord(value) || !isRecord(value.transport)) return void 0;
|
|
27
|
+
const { type, path } = value.transport;
|
|
28
|
+
if (type !== "ndjson-file" || typeof path !== "string" || !isAbsolute(path)) return void 0;
|
|
29
|
+
return { path };
|
|
30
|
+
}
|
|
31
|
+
function parseProjectLock(value) {
|
|
32
|
+
if (!isRecord(value)) return void 0;
|
|
33
|
+
const { waitMs } = value;
|
|
34
|
+
if (typeof waitMs !== "number" || !Number.isFinite(waitMs) || waitMs < 0) return void 0;
|
|
35
|
+
return { waitMs };
|
|
36
|
+
}
|
|
37
|
+
function readToolContext(raw = process.env.HF_TOOL_CONTEXT) {
|
|
38
|
+
if (!raw) return {};
|
|
39
|
+
let value;
|
|
40
|
+
try {
|
|
41
|
+
value = JSON.parse(raw);
|
|
42
|
+
} catch {
|
|
43
|
+
return {};
|
|
44
|
+
}
|
|
45
|
+
if (!isRecord(value) || value.version !== TOOL_CONTEXT_VERSION || !isRecord(value.capabilities))
|
|
46
|
+
return {};
|
|
47
|
+
const events = parseEvents(value.capabilities.events);
|
|
48
|
+
const projectLock = parseProjectLock(value.capabilities["project-lock"]);
|
|
49
|
+
return { ...events && { events }, ...projectLock && { projectLock } };
|
|
50
|
+
}
|
|
51
|
+
var MEDIA_TYPES = {
|
|
52
|
+
".png": "image/png",
|
|
53
|
+
".jpg": "image/jpeg",
|
|
54
|
+
".jpeg": "image/jpeg",
|
|
55
|
+
".json": "application/json"
|
|
56
|
+
};
|
|
57
|
+
function reportArtifacts(command, role, paths, context = readToolContext()) {
|
|
58
|
+
if (!context.events || paths.length === 0) return;
|
|
59
|
+
const lines = paths.map((path) => {
|
|
60
|
+
const absolute = resolve(path);
|
|
61
|
+
const event = {
|
|
62
|
+
version: TOOL_CONTEXT_VERSION,
|
|
63
|
+
type: "artifact.created",
|
|
64
|
+
command,
|
|
65
|
+
artifact: {
|
|
66
|
+
role,
|
|
67
|
+
path: absolute,
|
|
68
|
+
mediaType: MEDIA_TYPES[extname(absolute).toLowerCase()] ?? "application/octet-stream"
|
|
69
|
+
}
|
|
70
|
+
};
|
|
71
|
+
return JSON.stringify(event) + "\n";
|
|
72
|
+
});
|
|
73
|
+
try {
|
|
74
|
+
appendFileSync(context.events.path, lines.join(""));
|
|
75
|
+
} catch (error) {
|
|
76
|
+
console.error(`HF_TOOL_CONTEXT events could not be written: ${error.message}`);
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
// src/utils/projectLock.ts
|
|
81
|
+
import { linkSync, mkdirSync, readFileSync as readFileSync2, unlinkSync, writeFileSync } from "fs";
|
|
82
|
+
import { dirname, join } from "path";
|
|
83
|
+
import { setTimeout as sleep } from "timers/promises";
|
|
84
|
+
var ProjectLockTimeout = class extends Error {
|
|
85
|
+
};
|
|
86
|
+
var POLL_MS = 250;
|
|
87
|
+
var projectLockPath = (projectDir) => join(projectDir, ".hyperframes", "project.lock");
|
|
88
|
+
function readHolder(path) {
|
|
89
|
+
try {
|
|
90
|
+
return JSON.parse(readFileSync2(path, "utf8"));
|
|
91
|
+
} catch {
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
function alive(pid) {
|
|
96
|
+
try {
|
|
97
|
+
process.kill(pid, 0);
|
|
98
|
+
return true;
|
|
99
|
+
} catch (error) {
|
|
100
|
+
return error.code === "EPERM";
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
var sameHolder = (a, b) => a?.pid === b.pid && a.startedAt === b.startedAt && a.command === b.command;
|
|
104
|
+
function breakStaleHolder(path, current, holder) {
|
|
105
|
+
const breakPath = `${path}.break`;
|
|
106
|
+
const breakDraft = `${breakPath}.${holder.pid}.${holder.startedAt}`;
|
|
107
|
+
let acquired = false;
|
|
108
|
+
writeFileSync(breakDraft, JSON.stringify(holder), { flag: "wx" });
|
|
109
|
+
try {
|
|
110
|
+
try {
|
|
111
|
+
linkSync(breakDraft, breakPath);
|
|
112
|
+
} catch (error) {
|
|
113
|
+
if (error.code === "EEXIST") return false;
|
|
114
|
+
throw error;
|
|
115
|
+
}
|
|
116
|
+
if (sameHolder(readHolder(path), current)) {
|
|
117
|
+
try {
|
|
118
|
+
unlinkSync(path);
|
|
119
|
+
} catch (error) {
|
|
120
|
+
if (error.code !== "ENOENT") throw error;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
acquired = tryAcquire(path, holder);
|
|
124
|
+
} finally {
|
|
125
|
+
unlinkSync(breakDraft);
|
|
126
|
+
if (sameHolder(readHolder(breakPath), holder)) unlinkSync(breakPath);
|
|
127
|
+
}
|
|
128
|
+
return acquired;
|
|
129
|
+
}
|
|
130
|
+
function tryAcquire(path, holder) {
|
|
131
|
+
const draft = `${path}.${holder.pid}.${holder.startedAt}`;
|
|
132
|
+
writeFileSync(draft, JSON.stringify(holder), { flag: "wx" });
|
|
133
|
+
try {
|
|
134
|
+
linkSync(draft, path);
|
|
135
|
+
return true;
|
|
136
|
+
} catch (error) {
|
|
137
|
+
if (error.code !== "EEXIST") throw error;
|
|
138
|
+
} finally {
|
|
139
|
+
unlinkSync(draft);
|
|
140
|
+
}
|
|
141
|
+
const current = readHolder(path);
|
|
142
|
+
if (current && !alive(current.pid)) return breakStaleHolder(path, current, holder);
|
|
143
|
+
return false;
|
|
144
|
+
}
|
|
145
|
+
async function withProjectLock(projectDir, command, run, context = readToolContext()) {
|
|
146
|
+
if (!context.projectLock) return run();
|
|
147
|
+
const path = projectLockPath(projectDir);
|
|
148
|
+
mkdirSync(dirname(path), { recursive: true });
|
|
149
|
+
const holder = { pid: process.pid, command, startedAt: Date.now() };
|
|
150
|
+
const deadline = holder.startedAt + context.projectLock.waitMs;
|
|
151
|
+
while (!tryAcquire(path, holder)) {
|
|
152
|
+
const remaining = deadline - Date.now();
|
|
153
|
+
if (remaining <= 0) {
|
|
154
|
+
const current = readHolder(path);
|
|
155
|
+
const breakPath = `${path}.break`;
|
|
156
|
+
const breaker = readHolder(breakPath);
|
|
157
|
+
if ((!current || !alive(current.pid)) && breaker && !alive(breaker.pid)) {
|
|
158
|
+
throw new ProjectLockTimeout(
|
|
159
|
+
`hyperframes left ${breakPath} (pid ${breaker.pid}); delete it to continue`
|
|
160
|
+
);
|
|
161
|
+
}
|
|
162
|
+
throw new ProjectLockTimeout(
|
|
163
|
+
`hyperframes ${current?.command ?? "another command"} (pid ${current?.pid ?? "unknown"}) is still using this project after ${Math.round(context.projectLock.waitMs / 1e3)}s`
|
|
164
|
+
);
|
|
165
|
+
}
|
|
166
|
+
await sleep(Math.min(POLL_MS, remaining));
|
|
167
|
+
}
|
|
168
|
+
try {
|
|
169
|
+
return await run();
|
|
170
|
+
} finally {
|
|
171
|
+
if (sameHolder(readHolder(path), holder)) unlinkSync(path);
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
export {
|
|
176
|
+
pngDimensions,
|
|
177
|
+
reportArtifacts,
|
|
178
|
+
withProjectLock
|
|
179
|
+
};
|