hyperframes 0.8.191 → 0.8.193
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-S2ZQYG52.js → add-JC6DKZKC.js} +17 -17
- package/dist/{animatedGifPrep-3JA2CQ3U.js → animatedGifPrep-S6KXJGEL.js} +11 -10
- package/dist/api.js +24 -23
- package/dist/{appHistory-TH3TL6N6.js → appHistory-QVCSAOI4.js} +1 -1
- package/dist/{asset-2CNTAPOC.js → asset-XITFIFE6.js} +2 -2
- package/dist/{assetCataloger-5HXLXL7C.js → assetCataloger-K5FNKG35.js} +13 -12
- package/dist/{audio-DZTSYHXS.js → audio-364UHTY4.js} +22 -21
- package/dist/{auth-GX3M6TJ4.js → auth-5JEESRE6.js} +4 -4
- package/dist/{autoUpdate-EDIWE4Z5.js → autoUpdate-RVVYEHAA.js} +5 -5
- package/dist/{backgroundChecks-VPUPJ7UI.js → backgroundChecks-DCBIYWIQ.js} +5 -5
- package/dist/backgroundChecksWorker.js +5 -5
- package/dist/{batchRender-JHIIDBJR.js → batchRender-ZZ4QMBAA.js} +14 -7
- package/dist/{beats-PZRVTRYW.js → beats-YEL65M6G.js} +53 -15
- package/dist/{benchmark-22UFDW2N.js → benchmark-RBTRPA76.js} +18 -14
- package/dist/{browser-VRDWYIUM.js → browser-BVAYXT4R.js} +7 -7
- package/dist/{bundleWithLocalizedFonts-23QDKFSN.js → bundleWithLocalizedFonts-JLB2OYMT.js} +3 -3
- package/dist/{capture-TOCLXYMJ.js → capture-GBXTMYLZ.js} +76 -68
- package/dist/{capture-NFCBXHDE.js → capture-NIFX6IRS.js} +3 -3
- package/dist/{captureCompositionFrame-BEM6MF7F.js → captureCompositionFrame-ATNNKUL5.js} +17 -16
- package/dist/{catalog-NXS35KM7.js → catalog-AGIF5SM5.js} +18 -18
- package/dist/{catch-up-6WJBUI2C.js → catch-up-SZ3ULDTI.js} +7 -7
- package/dist/{check-WVEBMWN5.js → check-YLQS3TF4.js} +43 -42
- package/dist/{checkBrowser-RT45HJ36.js → checkBrowser-QH4FMCBO.js} +38 -37
- package/dist/{chunk-JOLZ3BSL.js → chunk-2LSCYS2H.js} +2 -2
- package/dist/{chunk-B2A56S5C.js → chunk-2MCXIY4B.js} +13 -10
- package/dist/{chunk-TADJOIFW.js → chunk-2NERNYCJ.js} +4 -4
- package/dist/{chunk-KGMHMYWI.js → chunk-2SFDWMSW.js} +2 -2
- package/dist/{chunk-DCAI5DBR.js → chunk-2ST4WAFY.js} +9 -1
- package/dist/{chunk-3NRB7YXW.js → chunk-2VXY3PEF.js} +96 -67
- package/dist/{chunk-IXLUTE6N.js → chunk-3422KMTD.js} +5 -1
- package/dist/{chunk-VYQYVYQ5.js → chunk-3W4B6G7Y.js} +83 -45
- package/dist/{chunk-JYSSPQDT.js → chunk-4LXZJIVY.js} +11 -11
- package/dist/{chunk-WHAEJX26.js → chunk-4PPWAQYV.js} +17 -12
- package/dist/{chunk-COWQITWP.js → chunk-4TKJWWPL.js} +1 -1
- package/dist/{chunk-NXMYHJAL.js → chunk-4VYPICIA.js} +29 -1
- package/dist/{chunk-RE3EEBWC.js → chunk-5J6TWLFG.js} +4 -4
- package/dist/{chunk-TFMZ4RKM.js → chunk-6DLCOQR4.js} +474 -429
- package/dist/{chunk-KV72BP7O.js → chunk-6LWUPIKD.js} +11 -11
- package/dist/{chunk-HRPWRZGF.js → chunk-6N65ZMC5.js} +1 -1
- package/dist/{chunk-XUXGIA7H.js → chunk-6NLPPKBO.js} +1 -2
- package/dist/{chunk-JJJCFKMF.js → chunk-6XUJVEY2.js} +17 -6
- package/dist/{chunk-GM3WIOO6.js → chunk-7HTH5PFK.js} +2 -2
- package/dist/{chunk-LBNEH6IQ.js → chunk-7QNIXBQD.js} +1 -1
- package/dist/{chunk-OV6KHXLX.js → chunk-7YKJF5JV.js} +1 -1
- package/dist/{chunk-COETAXRN.js → chunk-7YSFE4SZ.js} +2 -2
- package/dist/{chunk-3WJT2JCX.js → chunk-AR3DQYRR.js} +52 -23
- package/dist/{chunk-HYW6HTAK.js → chunk-BJAS2JLW.js} +2 -2
- package/dist/{chunk-RWYUK7LM.js → chunk-BP4EMEGH.js} +2 -2
- package/dist/{chunk-XGHHVYC7.js → chunk-BY6OQ6XP.js} +2 -2
- package/dist/{chunk-TMBUBLZB.js → chunk-C4Y3ZREE.js} +185 -46
- package/dist/{chunk-JQYJXUJW.js → chunk-C6KE4AFW.js} +1 -1
- package/dist/{chunk-TMK4Q7JA.js → chunk-CFUCHO4T.js} +20 -5
- package/dist/{chunk-JGTRVG32.js → chunk-CGTZOY53.js} +1 -1
- package/dist/chunk-CZGHFATT.js +31 -0
- package/dist/{chunk-NJGTNWQY.js → chunk-D625D4TV.js} +6 -6
- package/dist/{chunk-CYBXXSC4.js → chunk-DIKAPMMF.js} +2 -2
- package/dist/{chunk-CXMXJEVY.js → chunk-DSQ72G5I.js} +1 -1
- package/dist/{chunk-GLG5JWLI.js → chunk-DYNHVCBF.js} +2 -2
- package/dist/{chunk-7L37AB57.js → chunk-E3P3LJG6.js} +9 -9
- package/dist/{chunk-EFCKV7MY.js → chunk-E77ALFLW.js} +1 -1
- package/dist/{chunk-WQ3X5OH4.js → chunk-EFXMETRK.js} +2 -2
- package/dist/{chunk-7KVVNF7B.js → chunk-ELP5QZWL.js} +1 -1
- package/dist/{chunk-QH3T4WI2.js → chunk-EXAX37XR.js} +8 -2
- package/dist/{chunk-7A65UCMI.js → chunk-F5LLORBP.js} +2 -2
- package/dist/{chunk-EI7FP7F3.js → chunk-FBVUAH7N.js} +12 -2
- package/dist/{chunk-XWOCXIKR.js → chunk-GKHMSSGY.js} +1 -1
- package/dist/{chunk-DOOSC34Z.js → chunk-GR5DQKDR.js} +8 -8
- package/dist/{chunk-W64L7IFS.js → chunk-IW5G323T.js} +1 -1
- package/dist/{chunk-NAUKCKCJ.js → chunk-KU3UFQN7.js} +9 -12
- package/dist/{chunk-NMDUSCCE.js → chunk-L4JB7LI4.js} +478 -129
- package/dist/{chunk-ALEF2F5N.js → chunk-L5YLA54L.js} +2 -2
- package/dist/{chunk-MSM6VRQ4.js → chunk-LFUVTS6V.js} +2 -2
- package/dist/{chunk-7ZJEQY7Q.js → chunk-LMNZLZMJ.js} +23 -3
- package/dist/{chunk-AQB5M53R.js → chunk-M3KZBDPB.js} +3 -3
- package/dist/{chunk-BFFLKQVB.js → chunk-MFUNDJEV.js} +4 -4
- package/dist/{chunk-7NKJS5KM.js → chunk-OFV3WSOE.js} +1 -1
- package/dist/{chunk-CINKQY6M.js → chunk-OFYW4J7Y.js} +3 -3
- package/dist/{chunk-5C7R55BJ.js → chunk-P2I4RLJE.js} +1 -1
- package/dist/{chunk-RUOG4VB7.js → chunk-PKZ7RK5N.js} +5 -4
- package/dist/{chunk-LLFQA7XF.js → chunk-QFPBRZJD.js} +1 -1
- package/dist/{chunk-TRZVS6TL.js → chunk-QKX7ITER.js} +3 -3
- package/dist/{chunk-46HEFGXJ.js → chunk-REUL2KH2.js} +1 -1
- package/dist/{chunk-TFGO5YMI.js → chunk-RTLPWOO6.js} +2 -2
- package/dist/{chunk-DYAPHNV6.js → chunk-RWGASWT7.js} +1 -1
- package/dist/chunk-RXATE6FZ.js +385 -0
- package/dist/{chunk-U5GTDAQL.js → chunk-SOY2FPOR.js} +7 -7
- package/dist/{chunk-KNU5COPB.js → chunk-T2EUWCJE.js} +1 -1
- package/dist/{chunk-RQBB7PYT.js → chunk-TY3LDJA3.js} +5 -12
- package/dist/{chunk-KAC2WR7P.js → chunk-TZEKVLPV.js} +3 -3
- package/dist/{chunk-TJKE4EYX.js → chunk-UB7BIDBS.js} +3 -3
- package/dist/{chunk-WY3TQ2PT.js → chunk-UIC7B5KW.js} +2 -2
- package/dist/{chunk-2WNVHZHA.js → chunk-UNATIAOT.js} +13 -13
- package/dist/chunk-USWPZXEA.js +3897 -0
- package/dist/{chunk-FBDOHH3Q.js → chunk-V7ZA2BNW.js} +29 -59
- package/dist/{chunk-7LUJE3II.js → chunk-VLLFORE2.js} +1 -1
- package/dist/{chunk-T5YF32WV.js → chunk-VPC4XIVI.js} +6 -5
- package/dist/{chunk-7FF36MAD.js → chunk-VW63MHQU.js} +9 -6
- package/dist/{chunk-ZHKUIC7X.js → chunk-WFS6S65A.js} +21 -14
- package/dist/{chunk-UNR3P7IF.js → chunk-WIVOXGEP.js} +3 -3
- package/dist/{chunk-3XI7MIZB.js → chunk-X5CECNCK.js} +1 -1
- package/dist/{chunk-KHCTBZGJ.js → chunk-XQPA4W3M.js} +4 -4
- package/dist/{chunk-XMSQRDAK.js → chunk-YS4JUGNI.js} +2 -2
- package/dist/{chunk-SMEF3TRJ.js → chunk-ZH7J2ZUL.js} +15 -15
- package/dist/{chunk-WJEVUPVD.js → chunk-ZT45TCY3.js} +1 -1
- package/dist/{chunk-JTPHFYZI.js → chunk-ZTKFRXJB.js} +68 -7
- package/dist/{chunk-W3CS2KFV.js → chunk-ZZPBXRYQ.js} +2 -2
- package/dist/{clean-3VIU2BSK.js → clean-5HGESK5A.js} +40 -27
- package/dist/cli.js +70 -68
- package/dist/{cloud-NA3J4XW2.js → cloud-746PHS32.js} +4 -4
- package/dist/{cloudrun-4MHOF7UT.js → cloudrun-DO7WFLSM.js} +9 -9
- package/dist/commands/contrast-audit.browser.js +1 -1
- package/dist/{compare-ZR7XRPPT.js → compare-66YPRNG2.js} +76 -47
- package/dist/{compiler-MA2ELZPG.js → compiler-R4UYDWXO.js} +8 -7
- package/dist/{component-ZJSOPUAM.js → component-EQ3H6RFP.js} +3 -3
- package/dist/{compositions-WA5V2SHF.js → compositions-ZZ7P5HT2.js} +19 -17
- package/dist/{contactSheet-CAGMKI3E.js → contactSheet-SZBJDOMT.js} +2 -2
- package/dist/{delete-UC427UEA.js → delete-Z5MSLJSR.js} +7 -7
- package/dist/{deploy-B5UO4UIK.js → deploy-RGSAC2K5.js} +1 -1
- package/dist/{deterministicFonts-EGAAE7QL.js → deterministicFonts-RO2TCMLZ.js} +3 -3
- package/dist/{dist-XGPSPKKP.js → dist-QQ26RUDV.js} +5 -4
- package/dist/{dist-BPK37SAB.js → dist-RKK4YLAD.js} +5 -5
- package/dist/{doctor-ZERCTKEK.js → doctor-W4ZZDRTU.js} +20 -19
- package/dist/{events-DCOZQERS.js → events-BSSL4A4W.js} +4 -4
- package/dist/{events-CNIXB2QK.js → events-UACT7PX3.js} +5 -5
- package/dist/{feedback-YBD5ITTY.js → feedback-47ILDLQG.js} +16 -16
- package/dist/{ffmpeg-V4BBFDTG.js → ffmpeg-IEHSUNUT.js} +13 -12
- package/dist/{figma-Z45ZYVGE.js → figma-PLFIIYRU.js} +3 -3
- package/dist/fontLocalizeCli.js +14 -13
- package/dist/{get-23NXQWCD.js → get-PDWGJYNL.js} +7 -7
- package/dist/{gpuPolicy-H6ABHVEB.js → gpuPolicy-6UBXO6ME.js} +11 -10
- package/dist/{grade-compare-ZPX2G3UV.js → grade-compare-5VWLQGM7.js} +38 -37
- package/dist/{gsapParserAcorn-SKODXC2N.js → gsapParserAcorn-OOTY2MVN.js} +2 -2
- package/dist/{help-EP4CDPLO.js → help-DS3KMWYO.js} +1 -1
- package/dist/{history-E5OSXO74.js → history-OC326NVZ.js} +41 -17
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +62 -62
- package/dist/hyperframes-player.global.js +3 -3
- package/dist/hyperframes-slideshow.global.js +1 -1
- package/dist/{info-2HHGSW5H.js → info-AUIFV6MX.js} +56 -22
- package/dist/{init-ENEG6RZT.js → init-MRTWWDFW.js} +38 -45
- package/dist/{inspect-PVQK4E2A.js → inspect-55NOAXI2.js} +36 -35
- package/dist/{installer-YGGLEOSF.js → installer-YSFFGBBV.js} +8 -8
- package/dist/{keyframes-UWSYS2SL.js → keyframes-OO2BX2IB.js} +13 -14
- package/dist/{lambda-L3LPXC2M.js → lambda-CXXY6QT3.js} +11 -11
- package/dist/{layout-JVL4QREC.js → layout-57GJXKDK.js} +36 -35
- package/dist/{lint-JXQ72DDB.js → lint-J4FK3Z6G.js} +23 -16
- package/dist/{lintProject-F7IC7WY4.js → lintProject-52SLJPRC.js} +5 -4
- package/dist/{list-UFMLM3VV.js → list-VDQUJ76B.js} +7 -7
- package/dist/{login-CKGMWQJN.js → login-TJSEALWW.js} +7 -7
- package/dist/{logout-DDC4QLVK.js → logout-JYFWWUGK.js} +3 -3
- package/dist/{manager-U6OP3EXB.js → manager-4PLYEEWP.js} +14 -13
- package/dist/{manager-UHWEKPXC.js → manager-MZIJY73J.js} +3 -3
- package/dist/{media-treatment-MFMEWCDY.js → media-treatment-GXP4PMJH.js} +20 -19
- package/dist/{models-QA3TJ75Y.js → models-HQQQKEEP.js} +18 -17
- package/dist/{motionShot-NV2OPJHD.js → motionShot-2BT5D7DC.js} +21 -20
- package/dist/{normalize-3AYFSN2F.js → normalize-FASIPBUM.js} +1 -1
- package/dist/{normalize-audio-JWJRUKK2.js → normalize-audio-SOLFMHNP.js} +12 -8
- package/dist/{open-PTJNDRER.js → open-KHEUODFQ.js} +18 -18
- package/dist/{parakeetRunner-B5FCWWOO.js → parakeetRunner-BHU5NCAX.js} +20 -19
- package/dist/{pipeline-N26NA6ZG.js → pipeline-WFV5HDTD.js} +15 -14
- package/dist/{play-45D6X6TV.js → play-GB34CANJ.js} +27 -26
- package/dist/{policies-MBWGLMWB.js → policies-GHVXA5PE.js} +1 -1
- package/dist/{preflight-MFOHPUOI.js → preflight-REF3VSJ7.js} +15 -14
- package/dist/{present-IFBUDI4D.js → present-SIUTA7TD.js} +24 -23
- package/dist/{preview-MQRLXQOV.js → preview-T2GE7Z4A.js} +27 -26
- package/dist/{producer-2QG7HLAW.js → producer-23KVQZAB.js} +1 -1
- package/dist/{projectConfig-I4FTZXHB.js → projectConfig-DBSNBPNP.js} +10 -10
- package/dist/{publication-3GOFXCGU.js → publication-IXPUKYWJ.js} +5 -5
- package/dist/{publish-3B2TZCFH.js → publish-3BA5VHXJ.js} +18 -17
- package/dist/{refresh-RXTOPRBB.js → refresh-USSFPJAU.js} +3 -3
- package/dist/{remove-background-RK4BJDBF.js → remove-background-RMSCJVVQ.js} +16 -15
- package/dist/{render-SJ4HFPFU.js → render-6RNE2MLU.js} +26 -25
- package/dist/{render-PW3XGS7B.js → render-XGOZMMWX.js} +42 -41
- package/dist/{render-BV6FWFX3.js → render-Y6CTQ3YW.js} +8 -8
- package/dist/{render-batch-GKX54O6N.js → render-batch-VUR6N6EY.js} +9 -9
- package/dist/renderSetupWorker.js +9 -8
- package/dist/{resolver-RQJ7CNXD.js → resolver-GJCUH57W.js} +7 -7
- package/dist/{screenshotCapture-UBY6TT75.js → screenshotCapture-I5EDCITF.js} +6 -3
- package/dist/{sherpa-XZPG7QFF.js → sherpa-VVAKRCPL.js} +19 -18
- package/dist/skills/hyperframes/references/format.md +1 -0
- package/dist/skills/hyperframes/references/skill-lifecycle.md +8 -4
- package/dist/skills/hyperframes-cli/references/init-and-scaffold.md +1 -1
- package/dist/{skills-EYLB2V6F.js → skills-ZHBURVQG.js} +13 -75
- package/dist/{skillsUpdateCheck-TE6K5ROM.js → skillsUpdateCheck-VMDAL2O2.js} +5 -5
- package/dist/{slideshow-YTWATJRT.js → slideshow-SJGK4RQS.js} +1 -1
- package/dist/{snapshot-FE4T3SCN.js → snapshot-KEOG56SL.js} +61 -53
- package/dist/{src-ZOXSEJCD.js → src-BH5NICGQ.js} +24 -9
- package/dist/{src-SEJ7LNNB.js → src-TZLGFRRX.js} +13 -12
- package/dist/{staticProjectServer-LSVIRDRO.js → staticProjectServer-BKXL5CXB.js} +22 -21
- package/dist/{status-CM7IQTU2.js → status-H5WLKQDS.js} +3 -3
- package/dist/studio/assets/{hyperframes-player-Bv9hQ3v7.js → hyperframes-player-BMcUdmDb.js} +3 -3
- package/dist/studio/assets/{index-CBO8uz7-.css → index-CYbvOVp-.css} +1 -1
- package/dist/studio/assets/{index-D_QqfWhx.js → index-Ca-mgTnS.js} +122 -122
- package/dist/studio/assets/{index-Df14bh-L.js → index-Ci6GuloR.js} +1 -1
- package/dist/studio/index.html +2 -2
- package/dist/{studio-api-SL2Z76NU.js → studio-api-A5U6QAMC.js} +19 -14
- package/dist/{studioServer-BADWVIHU.js → studioServer-5EC5CP4W.js} +60 -59
- package/dist/{telemetry-QG5AANZ4.js → telemetry-4K6CPMNT.js} +2 -2
- package/dist/{telemetry-RN6VYEID.js → telemetry-BCKJXDSW.js} +5 -5
- package/dist/{timeline-JBTCIPLU.js → timeline-AZWAXTAY.js} +65 -43
- package/dist/{tokens-A7V7UHNK.js → tokens-X7NC3V7C.js} +2 -2
- package/dist/{transcribe-E4BOSNM4.js → transcribe-7NCY7QZ2.js} +17 -16
- package/dist/{transcribe-NTUCJGFI.js → transcribe-SH26H755.js} +26 -25
- package/dist/{tts-A2WILYGN.js → tts-5I2AJNLM.js} +1 -1
- package/dist/{updateCheck-M7UAYLUR.js → updateCheck-Y7FUWQM4.js} +4 -4
- package/dist/{upgrade-A2COSIMB.js → upgrade-ZHGEVL65.js} +4 -4
- package/dist/{urlDownloader-MBSQYART.js → urlDownloader-FPILIT7M.js} +10 -9
- package/dist/{validate-NODZYBHY.js → validate-KQOZR4F6.js} +30 -29
- package/dist/{video-LBCUUYK7.js → video-N2QAETFB.js} +12 -11
- package/dist/warmCheck.js +43 -42
- package/package.json +2 -1
- package/dist/chunk-I5JRXMCV.js +0 -6077
- package/dist/chunk-LM265QNK.js +0 -3896
|
@@ -21,9 +21,9 @@ import {
|
|
|
21
21
|
mkdirWithinProject
|
|
22
22
|
} from "./chunk-OFQWTKPW.js";
|
|
23
23
|
|
|
24
|
-
// ../studio-server/dist/chunk-
|
|
24
|
+
// ../studio-server/dist/chunk-JPKAFJIJ.js
|
|
25
25
|
import { randomUUID as randomUUID7 } from "crypto";
|
|
26
|
-
import { mkdir as mkdir2, readdir as readdir3, rm as rm3, rmdir, writeFile } from "fs/promises";
|
|
26
|
+
import { mkdir as mkdir2, readdir as readdir3, rm as rm3, rmdir, stat as stat2, writeFile } from "fs/promises";
|
|
27
27
|
import {
|
|
28
28
|
existsSync as existsSync3,
|
|
29
29
|
lstatSync as lstatSync4,
|
|
@@ -58,6 +58,7 @@ import { constants, createReadStream, createWriteStream, renameSync as renameSyn
|
|
|
58
58
|
import { copyFile, mkdir, readdir, readFile, rename, rm, stat } from "fs/promises";
|
|
59
59
|
import { dirname, join as join2 } from "path";
|
|
60
60
|
import { pipeline } from "stream/promises";
|
|
61
|
+
import { extname as extname2 } from "path";
|
|
61
62
|
import { randomUUID as randomUUID5 } from "crypto";
|
|
62
63
|
import { readdirSync as readdirSync2, readFileSync as readFileSync5, renameSync as renameSync3, statSync as statSync3, writeFileSync as writeFileSync3 } from "fs";
|
|
63
64
|
import { lstat, readdir as readdir2, rm as rm2 } from "fs/promises";
|
|
@@ -97,6 +98,9 @@ import {
|
|
|
97
98
|
import { dirname as dirname3, join as join6, relative as relative4, resolve as resolve5, sep as sep4 } from "path";
|
|
98
99
|
import { closeSync as closeSync3, constants as constants4, mkdirSync as mkdirSync4, openSync as openSync3, readFileSync as readFileSync9, writeSync as writeSync2 } from "fs";
|
|
99
100
|
import { dirname as dirname4 } from "path";
|
|
101
|
+
import { readdirSync as readdirSync5 } from "fs";
|
|
102
|
+
import { rm as rm4, stat as stat3 } from "fs/promises";
|
|
103
|
+
import { join as join9 } from "path";
|
|
100
104
|
var RECEIPT_TTL_MS = 1e4;
|
|
101
105
|
var receipts = /* @__PURE__ */ new Map();
|
|
102
106
|
var overwriteListeners = /* @__PURE__ */ new Set();
|
|
@@ -110,9 +114,9 @@ function hashVersion(hex) {
|
|
|
110
114
|
function hashOfVersion(version) {
|
|
111
115
|
return /^"sha256:([0-9a-f]{64})"$/.exec(version)?.[1];
|
|
112
116
|
}
|
|
113
|
-
function settledFileTag(
|
|
114
|
-
if (now -
|
|
115
|
-
return [
|
|
117
|
+
function settledFileTag(stat4, now = Date.now()) {
|
|
118
|
+
if (now - stat4.ctimeMs < 3e3) return null;
|
|
119
|
+
return [stat4.ino, stat4.ctimeMs, stat4.size].map((n) => n.toString(36)).join("-");
|
|
116
120
|
}
|
|
117
121
|
function createWriteToken(requestToken) {
|
|
118
122
|
const token = requestToken?.trim();
|
|
@@ -391,8 +395,8 @@ function signatureEntryStat(projectDir, entry, file, outputs) {
|
|
|
391
395
|
if (isSkippedEntry(entry) || !isPathWithin(projectDir, file)) return null;
|
|
392
396
|
if (isRenderOutput(projectDir, file, outputs)) return null;
|
|
393
397
|
try {
|
|
394
|
-
const
|
|
395
|
-
return
|
|
398
|
+
const stat4 = lstatSync(file);
|
|
399
|
+
return stat4.isSymbolicLink() ? null : stat4;
|
|
396
400
|
} catch {
|
|
397
401
|
return null;
|
|
398
402
|
}
|
|
@@ -406,17 +410,17 @@ function collectProjectSignatureFiles(projectDir, dir, files, outputs = readRend
|
|
|
406
410
|
}
|
|
407
411
|
for (const entry of entries) {
|
|
408
412
|
const file = resolve2(dir, entry);
|
|
409
|
-
const
|
|
410
|
-
if (!
|
|
411
|
-
if (
|
|
413
|
+
const stat4 = signatureEntryStat(projectDir, entry, file, outputs);
|
|
414
|
+
if (!stat4) continue;
|
|
415
|
+
if (stat4.isDirectory()) {
|
|
412
416
|
collectProjectSignatureFiles(projectDir, file, files, outputs);
|
|
413
|
-
} else if (
|
|
417
|
+
} else if (stat4.isFile()) {
|
|
414
418
|
files.push({
|
|
415
419
|
file,
|
|
416
|
-
mtimeMs:
|
|
417
|
-
ctimeMs:
|
|
418
|
-
size:
|
|
419
|
-
textContentEligible: isTextContentEligible(file,
|
|
420
|
+
mtimeMs: stat4.mtimeMs,
|
|
421
|
+
ctimeMs: stat4.ctimeMs,
|
|
422
|
+
size: stat4.size,
|
|
423
|
+
textContentEligible: isTextContentEligible(file, stat4.size)
|
|
420
424
|
});
|
|
421
425
|
}
|
|
422
426
|
}
|
|
@@ -426,19 +430,19 @@ function collectProjectSignatureManifestFiles(projectDir, files) {
|
|
|
426
430
|
for (const manifestPath of STUDIO_SIGNATURE_MANIFEST_PATHS) {
|
|
427
431
|
const file = resolve2(projectDir, manifestPath);
|
|
428
432
|
if (seen.has(file) || !isPathWithin(projectDir, file)) continue;
|
|
429
|
-
let
|
|
433
|
+
let stat4;
|
|
430
434
|
try {
|
|
431
|
-
|
|
435
|
+
stat4 = lstatSync(file);
|
|
432
436
|
} catch {
|
|
433
437
|
continue;
|
|
434
438
|
}
|
|
435
|
-
if (
|
|
439
|
+
if (stat4.isSymbolicLink() || !stat4.isFile()) continue;
|
|
436
440
|
files.push({
|
|
437
441
|
file,
|
|
438
|
-
mtimeMs:
|
|
439
|
-
ctimeMs:
|
|
440
|
-
size:
|
|
441
|
-
textContentEligible: isTextContentEligible(file,
|
|
442
|
+
mtimeMs: stat4.mtimeMs,
|
|
443
|
+
ctimeMs: stat4.ctimeMs,
|
|
444
|
+
size: stat4.size,
|
|
445
|
+
textContentEligible: isTextContentEligible(file, stat4.size)
|
|
442
446
|
});
|
|
443
447
|
seen.add(file);
|
|
444
448
|
}
|
|
@@ -578,11 +582,21 @@ async function openBlobStore(dir) {
|
|
|
578
582
|
total += size;
|
|
579
583
|
return hash;
|
|
580
584
|
},
|
|
585
|
+
reference: (absPath) => hashFile(absPath),
|
|
581
586
|
has: (hash) => sizes.has(hash),
|
|
582
587
|
read: async (hash) => readBlob(dir, hash),
|
|
583
588
|
writeTo: async (hash, absPath, beforeReplace) => cloneOrCopy(pathOf(hash), absPath, beforeReplace),
|
|
584
589
|
bytes: () => total,
|
|
585
590
|
size: (hash) => sizes.get(hash) ?? 0,
|
|
591
|
+
async drop(hashes) {
|
|
592
|
+
for (const hash of hashes) {
|
|
593
|
+
const size = sizes.get(hash);
|
|
594
|
+
if (size === void 0) continue;
|
|
595
|
+
await rm(pathOf(hash), { force: true });
|
|
596
|
+
sizes.delete(hash);
|
|
597
|
+
total -= size;
|
|
598
|
+
}
|
|
599
|
+
},
|
|
586
600
|
async prune(keep) {
|
|
587
601
|
for (const [hash, size] of sizes) {
|
|
588
602
|
if (keep.has(hash)) continue;
|
|
@@ -593,6 +607,39 @@ async function openBlobStore(dir) {
|
|
|
593
607
|
}
|
|
594
608
|
};
|
|
595
609
|
}
|
|
610
|
+
var MEDIA_EXTENSIONS = /* @__PURE__ */ new Set([
|
|
611
|
+
".mp4",
|
|
612
|
+
".mov",
|
|
613
|
+
".m4v",
|
|
614
|
+
".webm",
|
|
615
|
+
".mkv",
|
|
616
|
+
".avi",
|
|
617
|
+
".mxf",
|
|
618
|
+
".m2ts",
|
|
619
|
+
".mp3",
|
|
620
|
+
".wav",
|
|
621
|
+
".aac",
|
|
622
|
+
".m4a",
|
|
623
|
+
".flac",
|
|
624
|
+
".ogg",
|
|
625
|
+
".opus"
|
|
626
|
+
]);
|
|
627
|
+
var COPY_NOTHING_ABOVE_BYTES = 64 * 1024 ** 2;
|
|
628
|
+
var isUncopied = (path, size) => size > COPY_NOTHING_ABOVE_BYTES || MEDIA_EXTENSIONS.has(extname2(path).toLowerCase());
|
|
629
|
+
function uncopiedOnlyHashes(log, sizeOf) {
|
|
630
|
+
const copied = /* @__PURE__ */ new Set();
|
|
631
|
+
const uncopied = /* @__PURE__ */ new Set();
|
|
632
|
+
const note = (path, hash) => {
|
|
633
|
+
if (hash) (isUncopied(path, sizeOf(hash)) ? uncopied : copied).add(hash);
|
|
634
|
+
};
|
|
635
|
+
for (const [path, hash] of log.baseline) note(path, hash);
|
|
636
|
+
for (const entry of log.entries)
|
|
637
|
+
for (const file of entry.files) {
|
|
638
|
+
note(file.path, file.before);
|
|
639
|
+
note(file.path, file.after);
|
|
640
|
+
}
|
|
641
|
+
return [...uncopied].filter((hash) => !copied.has(hash));
|
|
642
|
+
}
|
|
596
643
|
var ID_PATH = join3(".hyperframes", "history-id");
|
|
597
644
|
var ID_SHAPE = /^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/;
|
|
598
645
|
var isHistoryId = (name) => ID_SHAPE.test(name);
|
|
@@ -763,13 +810,13 @@ function projectGone(dir, id, dev, tempDir) {
|
|
|
763
810
|
}
|
|
764
811
|
function diskStillHere(dir, dev, tempDir) {
|
|
765
812
|
let at = dir;
|
|
766
|
-
let
|
|
767
|
-
while (!
|
|
813
|
+
let stat4 = statSync3(at, { throwIfNoEntry: false });
|
|
814
|
+
while (!stat4) {
|
|
768
815
|
if (dirname2(at) === at) return false;
|
|
769
816
|
at = dirname2(at);
|
|
770
|
-
|
|
817
|
+
stat4 = statSync3(at, { throwIfNoEntry: false });
|
|
771
818
|
}
|
|
772
|
-
if (typeof dev === "number") return
|
|
819
|
+
if (typeof dev === "number") return stat4.dev === dev;
|
|
773
820
|
return at === dir || isSafePath(tempDir, at);
|
|
774
821
|
}
|
|
775
822
|
function lastUsed(home) {
|
|
@@ -870,12 +917,12 @@ function stillPendingAfterUnlink(item) {
|
|
|
870
917
|
let descriptor;
|
|
871
918
|
try {
|
|
872
919
|
descriptor = openSync(item.path, constants2.O_RDONLY | constants2.O_NOFOLLOW);
|
|
873
|
-
const
|
|
874
|
-
if (!
|
|
920
|
+
const stat4 = fstatSync(descriptor);
|
|
921
|
+
if (!stat4.isFile() || stat4.isSymbolicLink()) return false;
|
|
875
922
|
const hash = createHash4("sha256").update(readFileSync6(descriptor)).digest("hex");
|
|
876
923
|
if (hash !== item.hash) return false;
|
|
877
924
|
const current = lstatSync2(item.path);
|
|
878
|
-
if (current.dev !==
|
|
925
|
+
if (current.dev !== stat4.dev || current.ino !== stat4.ino) return false;
|
|
879
926
|
unlinkSync(item.path);
|
|
880
927
|
return false;
|
|
881
928
|
} catch (error) {
|
|
@@ -975,8 +1022,8 @@ function ownerPid(owner) {
|
|
|
975
1022
|
const pid = owner.pid;
|
|
976
1023
|
return typeof pid === "number" && Number.isSafeInteger(pid) && pid > 0 ? pid : null;
|
|
977
1024
|
}
|
|
978
|
-
function ordinaryOwner(
|
|
979
|
-
return
|
|
1025
|
+
function ordinaryOwner(stat4) {
|
|
1026
|
+
return stat4.isFile() && stat4.nlink === 1;
|
|
980
1027
|
}
|
|
981
1028
|
function sameOwnerFile(before, current) {
|
|
982
1029
|
return current.dev === before.dev && current.ino === before.ino;
|
|
@@ -1050,8 +1097,8 @@ function runsOnDisk(root) {
|
|
|
1050
1097
|
return entries.filter((entry) => entry.isDirectory() && UUID.test(entry.name)).flatMap((entry) => {
|
|
1051
1098
|
const path = join6(root, entry.name);
|
|
1052
1099
|
try {
|
|
1053
|
-
const
|
|
1054
|
-
return [{ path, stat:
|
|
1100
|
+
const stat4 = lstatSync3(path);
|
|
1101
|
+
return [{ path, stat: stat4 }];
|
|
1055
1102
|
} catch {
|
|
1056
1103
|
return [];
|
|
1057
1104
|
}
|
|
@@ -1065,10 +1112,10 @@ function planSnapshotCleanup(project, state, now = Date.now()) {
|
|
|
1065
1112
|
const runs = runsOnDisk(root);
|
|
1066
1113
|
for (const run of runs.slice(0, SNAPSHOT_RUNS_TO_KEEP)) keep.add(run.path);
|
|
1067
1114
|
const pending = [];
|
|
1068
|
-
for (const { path, stat:
|
|
1069
|
-
if (keep.has(path) || now -
|
|
1115
|
+
for (const { path, stat: stat4 } of runs) {
|
|
1116
|
+
if (keep.has(path) || now - stat4.mtimeMs < SNAPSHOT_GRACE_MS || liveOwner(path)) continue;
|
|
1070
1117
|
try {
|
|
1071
|
-
const run = { path, dev:
|
|
1118
|
+
const run = { path, dev: stat4.dev, ino: stat4.ino, mtimeMs: stat4.mtimeMs };
|
|
1072
1119
|
if (!unchangedRun(project, run)) continue;
|
|
1073
1120
|
pending.push(run);
|
|
1074
1121
|
retireReferences(records2, root, path);
|
|
@@ -1704,6 +1751,7 @@ var Engine = class {
|
|
|
1704
1751
|
);
|
|
1705
1752
|
if (!log) return this.firstOpen();
|
|
1706
1753
|
this.log = withoutHiddenPaths(log);
|
|
1754
|
+
await this.reclaimUncopied();
|
|
1707
1755
|
if (!this.log.keepsLedger) await this.takeInUnnamedLedger();
|
|
1708
1756
|
const cache = this.readStatCache();
|
|
1709
1757
|
const last = this.log.entries.at(-1)?.id ?? START;
|
|
@@ -1717,6 +1765,10 @@ var Engine = class {
|
|
|
1717
1765
|
this.reopenClosedWindow();
|
|
1718
1766
|
await this.settleAll();
|
|
1719
1767
|
}
|
|
1768
|
+
/** Copies an older version took of files that are no longer copied; text and small files are never touched. */
|
|
1769
|
+
async reclaimUncopied() {
|
|
1770
|
+
await this.blobs.drop(uncopiedOnlyHashes(this.log, (hash) => this.blobs.size(hash)));
|
|
1771
|
+
}
|
|
1720
1772
|
hearWrites() {
|
|
1721
1773
|
const realDir = realFilePath(this.dir);
|
|
1722
1774
|
this.stopHearing = onFileOverwritten((absPath, version, bytes) => {
|
|
@@ -1731,7 +1783,8 @@ var Engine = class {
|
|
|
1731
1783
|
chainBackFrom(this.overwritten.get(path), replaced).set(after, replaced)
|
|
1732
1784
|
);
|
|
1733
1785
|
this.queue(async () => {
|
|
1734
|
-
if (!this.blobs.has(replaced)
|
|
1786
|
+
if (!this.blobs.has(replaced) && !isUncopied(path, bytes.length))
|
|
1787
|
+
await this.storeBytes(bytes);
|
|
1735
1788
|
}).catch((error) => this.options.onError?.(error));
|
|
1736
1789
|
});
|
|
1737
1790
|
}
|
|
@@ -1810,7 +1863,8 @@ var Engine = class {
|
|
|
1810
1863
|
}
|
|
1811
1864
|
async recordAdopted(file, sweptAt, stored) {
|
|
1812
1865
|
if (stored === null || this.whereFolder() !== "here") return;
|
|
1813
|
-
const
|
|
1866
|
+
const kept = this.blobs.has(stored) || isUncopied(file.path, file.size);
|
|
1867
|
+
const hash = kept ? stored : await this.storeIfPresent(file.path);
|
|
1814
1868
|
if (hash === null) return;
|
|
1815
1869
|
const change = { path: file.path, before: null, after: hash };
|
|
1816
1870
|
const found = this.overwrittenBy(change, void 0, /* @__PURE__ */ new Set());
|
|
@@ -1886,22 +1940,24 @@ var Engine = class {
|
|
|
1886
1940
|
/** The file's hash once copied in; null when it was removed before the copy (the next sweep records that). */
|
|
1887
1941
|
async storeIfPresent(path) {
|
|
1888
1942
|
try {
|
|
1889
|
-
|
|
1943
|
+
const abs = join8(this.dir, path);
|
|
1944
|
+
const { size } = await stat2(abs);
|
|
1945
|
+
return await (isUncopied(path, size) ? this.blobs.reference(abs) : this.blobs.put(abs));
|
|
1890
1946
|
} catch (error) {
|
|
1891
1947
|
if (error.code === "ENOENT") return null;
|
|
1892
1948
|
throw error;
|
|
1893
1949
|
}
|
|
1894
1950
|
}
|
|
1895
|
-
async observe(path,
|
|
1951
|
+
async observe(path, stat4, at) {
|
|
1896
1952
|
const known = this.tracked.get(path) ?? { hash: null, stat: null };
|
|
1897
|
-
if (
|
|
1953
|
+
if (stat4 && known.stat === stat4) return false;
|
|
1898
1954
|
const heard = this.overwritten.get(path);
|
|
1899
1955
|
const hash = await this.storeIfPresent(path);
|
|
1900
1956
|
if (hash === null || this.whereFolder() !== "here") return false;
|
|
1901
|
-
this.tracked.set(path, { hash, stat:
|
|
1957
|
+
this.tracked.set(path, { hash, stat: stat4 });
|
|
1902
1958
|
this.forgetWritesBefore(path, hash, heard);
|
|
1903
1959
|
if (known.hash !== hash) await this.record(path, known.hash, hash, at);
|
|
1904
|
-
return known.hash !== hash || known.stat !==
|
|
1960
|
+
return known.hash !== hash || known.stat !== stat4;
|
|
1905
1961
|
}
|
|
1906
1962
|
async record(path, before, after, at) {
|
|
1907
1963
|
const endedBeforeThisWrite = this.windows.filter((open) => !takesWrite(open, at));
|
|
@@ -2199,9 +2255,9 @@ var Engine = class {
|
|
|
2199
2255
|
const parts = path.split("/");
|
|
2200
2256
|
for (let depth = 1; depth <= parts.length; depth += 1) {
|
|
2201
2257
|
const at = parts.slice(0, depth).join("/");
|
|
2202
|
-
const
|
|
2203
|
-
if (!
|
|
2204
|
-
if (at === path || !
|
|
2258
|
+
const stat4 = lstatSync4(join8(this.dir, at), { throwIfNoEntry: false });
|
|
2259
|
+
if (!stat4) return void 0;
|
|
2260
|
+
if (at === path || !stat4.isDirectory()) return { at, stat: stat4 };
|
|
2205
2261
|
}
|
|
2206
2262
|
return void 0;
|
|
2207
2263
|
}
|
|
@@ -2220,6 +2276,11 @@ var Engine = class {
|
|
|
2220
2276
|
async writeAs(who, label, target, extra) {
|
|
2221
2277
|
this.assertWritable();
|
|
2222
2278
|
const changes = [...target].filter(([path, hash]) => (this.tracked.get(path)?.hash ?? null) !== hash).sort(([, a], [, b]) => Number(a !== null) - Number(b !== null));
|
|
2279
|
+
const gone = changes.find(([, hash]) => hash !== null && !this.blobs.has(hash));
|
|
2280
|
+
if (gone)
|
|
2281
|
+
throw new Error(
|
|
2282
|
+
`An earlier version of ${gone[0]} is not kept, so this cannot be brought back.`
|
|
2283
|
+
);
|
|
2223
2284
|
const deleted = new Set(changes.filter(([, hash]) => hash === null).map(([path]) => path));
|
|
2224
2285
|
const blocked = changes.filter(([, hash]) => hash !== null).map(([path]) => this.inTheWay(path, deleted)).find(Boolean);
|
|
2225
2286
|
if (blocked) throw new Error(`${blocked} is in the way; move or delete it, then try again.`);
|
|
@@ -2327,6 +2388,18 @@ var Engine = class {
|
|
|
2327
2388
|
[...this.tracked.keys()].map((path) => [path, null])
|
|
2328
2389
|
);
|
|
2329
2390
|
for (const [path, hash] of files) target.set(path, hash);
|
|
2391
|
+
if (point === START && this.adopting.size > 0) {
|
|
2392
|
+
throw new HistoryRefusedError(
|
|
2393
|
+
"The project's starting copy is still being saved; try again in a moment. Nothing was changed."
|
|
2394
|
+
);
|
|
2395
|
+
}
|
|
2396
|
+
const isProjectFile = (path) => !KEPT_HIDDEN_PATHS.has(path);
|
|
2397
|
+
const keepsAny = [...target].some(([path, hash]) => hash !== null && isProjectFile(path));
|
|
2398
|
+
if ([...this.tracked.keys()].some(isProjectFile) && !keepsAny) {
|
|
2399
|
+
throw new HistoryRefusedError(
|
|
2400
|
+
"Restoring this point would remove every file in this project, so nothing was changed."
|
|
2401
|
+
);
|
|
2402
|
+
}
|
|
2330
2403
|
return this.writeAs(who, label, target, { restoredTo: point });
|
|
2331
2404
|
}
|
|
2332
2405
|
/** Settles, then runs `task` with its writes labelled `writeToken`. */
|
|
@@ -2386,6 +2459,9 @@ var Engine = class {
|
|
|
2386
2459
|
if ((await readdir3(dest).catch(missingIsEmpty)).length > 0)
|
|
2387
2460
|
throw new Error(`Checkout writes into an empty folder only: ${dest}`);
|
|
2388
2461
|
const files = manifestAround(this.log, entryId, side);
|
|
2462
|
+
for (const [path, hash] of files)
|
|
2463
|
+
if (!this.blobs.has(hash))
|
|
2464
|
+
throw new Error(`The version of ${path} from then is not kept.`);
|
|
2389
2465
|
try {
|
|
2390
2466
|
for (const [path, hash] of files) await this.blobs.writeTo(hash, join8(dest, path));
|
|
2391
2467
|
} catch (error) {
|
|
@@ -2443,6 +2519,12 @@ var HistoryClosedError = class extends Error {
|
|
|
2443
2519
|
this.name = "HistoryClosedError";
|
|
2444
2520
|
}
|
|
2445
2521
|
};
|
|
2522
|
+
var HistoryRefusedError = class extends Error {
|
|
2523
|
+
constructor(message) {
|
|
2524
|
+
super(message);
|
|
2525
|
+
this.name = "HistoryRefusedError";
|
|
2526
|
+
}
|
|
2527
|
+
};
|
|
2446
2528
|
async function openProjectHistory(options) {
|
|
2447
2529
|
if (!existsSync3(options.projectDir))
|
|
2448
2530
|
throw new HistoryClosedError(`${options.projectDir} is gone or now another project.`);
|
|
@@ -2490,6 +2572,61 @@ function readProjectHistory(options) {
|
|
|
2490
2572
|
}
|
|
2491
2573
|
};
|
|
2492
2574
|
}
|
|
2575
|
+
function historyIds(historyRoot) {
|
|
2576
|
+
try {
|
|
2577
|
+
return readdirSync5(historyRoot).filter(isHistoryId);
|
|
2578
|
+
} catch {
|
|
2579
|
+
return [];
|
|
2580
|
+
}
|
|
2581
|
+
}
|
|
2582
|
+
function namedHashes(log) {
|
|
2583
|
+
const hashes = new Set(log.baseline.values());
|
|
2584
|
+
for (const entry of log.entries) {
|
|
2585
|
+
for (const file of entry.files) {
|
|
2586
|
+
if (file.before) hashes.add(file.before);
|
|
2587
|
+
if (file.after) hashes.add(file.after);
|
|
2588
|
+
}
|
|
2589
|
+
}
|
|
2590
|
+
return hashes;
|
|
2591
|
+
}
|
|
2592
|
+
async function blobSizes(blobs, hashes) {
|
|
2593
|
+
const sizes = /* @__PURE__ */ new Map();
|
|
2594
|
+
for (const hash of hashes)
|
|
2595
|
+
sizes.set(hash, (await stat3(blobPath(blobs, hash)).catch(() => null))?.size ?? 0);
|
|
2596
|
+
return sizes;
|
|
2597
|
+
}
|
|
2598
|
+
async function reclaimOne(home, dryRun) {
|
|
2599
|
+
const log = readLog(join9(home, "log.jsonl"), () => {
|
|
2600
|
+
});
|
|
2601
|
+
if (!log) return 0;
|
|
2602
|
+
const blobs = join9(home, "blobs");
|
|
2603
|
+
const sizes = await blobSizes(blobs, namedHashes(log));
|
|
2604
|
+
let bytes = 0;
|
|
2605
|
+
for (const hash of uncopiedOnlyHashes(log, (known) => sizes.get(known) ?? 0)) {
|
|
2606
|
+
const size = sizes.get(hash) ?? 0;
|
|
2607
|
+
if (size === 0) continue;
|
|
2608
|
+
bytes += size;
|
|
2609
|
+
if (!dryRun) await rm4(blobPath(blobs, hash), { force: true });
|
|
2610
|
+
}
|
|
2611
|
+
return bytes;
|
|
2612
|
+
}
|
|
2613
|
+
async function reclaimUncopiedBlobs(historyRoot, { dryRun = false, onError } = {}) {
|
|
2614
|
+
const reclaimed = [];
|
|
2615
|
+
for (const id of historyIds(historyRoot)) {
|
|
2616
|
+
const home = join9(historyRoot, id);
|
|
2617
|
+
let release;
|
|
2618
|
+
try {
|
|
2619
|
+
release = await takeHistoryOwnership(home, 0);
|
|
2620
|
+
const bytes = await reclaimOne(home, dryRun);
|
|
2621
|
+
if (bytes > 0) reclaimed.push({ id, bytes });
|
|
2622
|
+
} catch (error) {
|
|
2623
|
+
if (!(error instanceof HistoryBusyError)) onError?.(error);
|
|
2624
|
+
} finally {
|
|
2625
|
+
release?.();
|
|
2626
|
+
}
|
|
2627
|
+
}
|
|
2628
|
+
return reclaimed;
|
|
2629
|
+
}
|
|
2493
2630
|
function historyCache(open) {
|
|
2494
2631
|
const histories = /* @__PURE__ */ new Map();
|
|
2495
2632
|
const get = async (projectDir) => {
|
|
@@ -2545,7 +2682,9 @@ export {
|
|
|
2545
2682
|
MAX_WINDOW_IDLE_MS,
|
|
2546
2683
|
UNDO_MODES,
|
|
2547
2684
|
HistoryClosedError,
|
|
2685
|
+
HistoryRefusedError,
|
|
2548
2686
|
openProjectHistory,
|
|
2549
2687
|
readProjectHistory,
|
|
2688
|
+
reclaimUncopiedBlobs,
|
|
2550
2689
|
historyCache
|
|
2551
2690
|
};
|
|
@@ -11,6 +11,7 @@ import {
|
|
|
11
11
|
// src/whisper/normalize.ts
|
|
12
12
|
import { readFileSync, readdirSync, writeFileSync } from "fs";
|
|
13
13
|
import { extname, join } from "path";
|
|
14
|
+
import { parseExpressionAt, tokenizer } from "acorn";
|
|
14
15
|
function detectFormat(filePath) {
|
|
15
16
|
const ext = extname(filePath).toLowerCase();
|
|
16
17
|
if (ext === ".srt") return "srt";
|
|
@@ -306,6 +307,20 @@ function loadTranscript(filePath) {
|
|
|
306
307
|
}))).map((w, i) => ({ ...w, id: w.id || `w${i}` }));
|
|
307
308
|
return { words, format };
|
|
308
309
|
}
|
|
310
|
+
function findCaptionArray(source, name) {
|
|
311
|
+
const prefix = `const ${name} = `;
|
|
312
|
+
const start = source.indexOf(`${prefix}[`);
|
|
313
|
+
if (start < 0) return void 0;
|
|
314
|
+
try {
|
|
315
|
+
const array = parseExpressionAt(source, start + prefix.length, { ecmaVersion: "latest" });
|
|
316
|
+
if (array.type !== "ArrayExpression") return void 0;
|
|
317
|
+
const terminator = tokenizer(source.slice(array.end), { ecmaVersion: "latest" }).getToken();
|
|
318
|
+
if (terminator.type.label !== ";") return void 0;
|
|
319
|
+
return source.slice(start, array.end + terminator.end);
|
|
320
|
+
} catch {
|
|
321
|
+
return void 0;
|
|
322
|
+
}
|
|
323
|
+
}
|
|
309
324
|
function patchCaptionHtml(dir, words) {
|
|
310
325
|
if (words.length === 0) return;
|
|
311
326
|
const wordsJson = JSON.stringify(words, null, 2).replace(/</g, "\\u003c").replace(/\n/g, "\n ");
|
|
@@ -318,16 +333,16 @@ function patchCaptionHtml(dir, words) {
|
|
|
318
333
|
for (const file of htmlFiles) {
|
|
319
334
|
let content = readFileSync(file, "utf-8");
|
|
320
335
|
const scriptBlocks = content.match(/<script>[\s\S]*?<\/script>/g) ?? [];
|
|
321
|
-
let scriptMatch
|
|
322
|
-
let transcriptMatch
|
|
336
|
+
let scriptMatch;
|
|
337
|
+
let transcriptMatch;
|
|
323
338
|
for (const block of scriptBlocks) {
|
|
324
|
-
scriptMatch = scriptMatch ?? block
|
|
325
|
-
transcriptMatch = transcriptMatch ?? block
|
|
339
|
+
scriptMatch = scriptMatch ?? findCaptionArray(block, "script");
|
|
340
|
+
transcriptMatch = transcriptMatch ?? findCaptionArray(block, "TRANSCRIPT");
|
|
326
341
|
}
|
|
327
342
|
const match = scriptMatch ?? transcriptMatch;
|
|
328
343
|
if (match) {
|
|
329
344
|
const varName = scriptMatch ? "script" : "TRANSCRIPT";
|
|
330
|
-
content = content.replace(match
|
|
345
|
+
content = content.replace(match, () => `const ${varName} = ${wordsJson};`);
|
|
331
346
|
writeFileSync(file, content, "utf-8");
|
|
332
347
|
}
|
|
333
348
|
}
|
|
@@ -0,0 +1,31 @@
|
|
|
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
|
+
// ../parsers/dist/compositionDuration.js
|
|
9
|
+
var TIMING_TOLERANCE_SECONDS = 0.05;
|
|
10
|
+
var isPositiveFinite = (value) => value !== null && Number.isFinite(value) && value > 0;
|
|
11
|
+
function resolveCompositionDuration(input) {
|
|
12
|
+
const pendingClips = input.clipEndsSeconds.filter((end) => end === null).length;
|
|
13
|
+
if (isPositiveFinite(input.authoredDurationSeconds)) {
|
|
14
|
+
return { seconds: input.authoredDurationSeconds, source: "authored", pendingClips };
|
|
15
|
+
}
|
|
16
|
+
const known = input.clipEndsSeconds.filter(isPositiveFinite);
|
|
17
|
+
if (known.length > 0) {
|
|
18
|
+
return { seconds: Math.max(...known), source: "derived", pendingClips };
|
|
19
|
+
}
|
|
20
|
+
return {
|
|
21
|
+
seconds: null,
|
|
22
|
+
source: "unresolved",
|
|
23
|
+
pendingClips,
|
|
24
|
+
reason: pendingClips > 0 ? "every clip's length is still pending" : "no authored duration and no clip with a length"
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export {
|
|
29
|
+
TIMING_TOLERANCE_SECONDS,
|
|
30
|
+
resolveCompositionDuration
|
|
31
|
+
};
|
|
@@ -14,33 +14,33 @@ import {
|
|
|
14
14
|
} from "./chunk-6JR2XUEE.js";
|
|
15
15
|
import {
|
|
16
16
|
readCompositionFps
|
|
17
|
-
} from "./chunk-
|
|
17
|
+
} from "./chunk-VW63MHQU.js";
|
|
18
18
|
import {
|
|
19
19
|
HF_AUDIO_GROUP_ATTR,
|
|
20
20
|
extractAudioMetadata,
|
|
21
21
|
extractMediaMetadata
|
|
22
|
-
} from "./chunk-
|
|
22
|
+
} from "./chunk-L4JB7LI4.js";
|
|
23
23
|
import {
|
|
24
24
|
byStart,
|
|
25
25
|
fpsToNumber,
|
|
26
26
|
parseFpsWithDefault
|
|
27
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-7HTH5PFK.js";
|
|
28
28
|
import {
|
|
29
29
|
HF_AUDIO_AUTOMATION_ATTR,
|
|
30
30
|
HF_AUDIO_FX_ATTR,
|
|
31
31
|
parseAudioFxChain,
|
|
32
32
|
parseAutomation,
|
|
33
33
|
resolveAutomation
|
|
34
|
-
} from "./chunk-
|
|
34
|
+
} from "./chunk-USWPZXEA.js";
|
|
35
35
|
import {
|
|
36
36
|
isSubCompositionHost,
|
|
37
37
|
topLevelElements,
|
|
38
38
|
trackKindOf
|
|
39
|
-
} from "./chunk-
|
|
39
|
+
} from "./chunk-2MCXIY4B.js";
|
|
40
40
|
import {
|
|
41
41
|
resolveReferencedDuration,
|
|
42
42
|
resolveReferencedStart
|
|
43
|
-
} from "./chunk-
|
|
43
|
+
} from "./chunk-2VXY3PEF.js";
|
|
44
44
|
import {
|
|
45
45
|
resolveAuthoredAssetFile
|
|
46
46
|
} from "./chunk-6BNTGNGD.js";
|
|
@@ -7,7 +7,7 @@ var __dirname = __hf_dirname(__filename);
|
|
|
7
7
|
import {
|
|
8
8
|
runCancellableProcess,
|
|
9
9
|
runRenderSetupWorker
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-RWGASWT7.js";
|
|
11
11
|
import {
|
|
12
12
|
getFreeDiskMb
|
|
13
13
|
} from "./chunk-T6AGUTZJ.js";
|
|
@@ -18,7 +18,7 @@ import {
|
|
|
18
18
|
} from "./chunk-4UMPIPCQ.js";
|
|
19
19
|
import {
|
|
20
20
|
normalizeErrorMessage
|
|
21
|
-
} from "./chunk-
|
|
21
|
+
} from "./chunk-T2EUWCJE.js";
|
|
22
22
|
|
|
23
23
|
// src/browser/manager.ts
|
|
24
24
|
import { execSync, spawnSync } from "child_process";
|
|
@@ -6,10 +6,10 @@ var __filename = __hf_fileURLToPath(import.meta.url);
|
|
|
6
6
|
var __dirname = __hf_dirname(__filename);
|
|
7
7
|
import {
|
|
8
8
|
detectGpuEncoder
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-L4JB7LI4.js";
|
|
10
10
|
import {
|
|
11
11
|
runCancellableProcess
|
|
12
|
-
} from "./chunk-
|
|
12
|
+
} from "./chunk-RWGASWT7.js";
|
|
13
13
|
import {
|
|
14
14
|
findFfBinary
|
|
15
15
|
} from "./chunk-VAS6HQX3.js";
|