hyperframes 0.8.208 → 0.8.210
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-XMWRBMBR.js → add-36M7YRR4.js} +17 -16
- package/dist/{animatedGifPrep-6XURJIPV.js → animatedGifPrep-RZLTC77F.js} +8 -6
- package/dist/api.js +26 -20
- package/dist/{appHistory-HIBH6XZW.js → appHistory-OHYU5ZBQ.js} +3 -2
- package/dist/{asset-I5GGEOB2.js → asset-HRGZ7ZCB.js} +2 -2
- package/dist/{assetCataloger-YBPXUNUP.js → assetCataloger-LN7RI2IC.js} +9 -7
- package/dist/{audio-GFJCHH5W.js → audio-ULOHC2KL.js} +31 -22
- package/dist/{auth-QOA55RYR.js → auth-K4ZULHQY.js} +4 -4
- package/dist/{autoUpdate-SPS4QPJU.js → autoUpdate-MUJ4WPP6.js} +4 -4
- package/dist/{backgroundChecks-HRJO7YK7.js → backgroundChecks-O6JST752.js} +5 -5
- package/dist/backgroundChecksWorker.js +5 -5
- package/dist/{batchRender-FBP3RKUF.js → batchRender-U742UVOD.js} +4 -4
- package/dist/{beats-VNGJ7F6W.js → beats-2CSE5WJD.js} +15 -12
- package/dist/{benchmark-NZ3N3MIV.js → benchmark-YJB2YKOE.js} +10 -10
- package/dist/{browser-BD5BKRJ5.js → browser-WJ5E7RYS.js} +7 -7
- package/dist/{bundleWithLocalizedFonts-WXVNPAWD.js → bundleWithLocalizedFonts-F5VQMFHZ.js} +3 -3
- package/dist/{capture-CXWXKWS5.js → capture-6OJDKKEZ.js} +26 -22
- package/dist/{capture-LMJ4TQRL.js → capture-IYV3OS5W.js} +3 -3
- package/dist/{captureCompositionFrame-ZKVCRYYU.js → captureCompositionFrame-7357PUMG.js} +15 -14
- package/dist/{catalog-WRXQSCAU.js → catalog-CZBK33QH.js} +18 -17
- package/dist/{catch-up-MDSPABFC.js → catch-up-7IJQ7AUR.js} +9 -8
- package/dist/{check-SIBBK5HA.js → check-ISUFX4DK.js} +46 -44
- package/dist/{checkAudio-QQBR4HR7.js → checkAudio-GAA2SY5E.js} +21 -12
- package/dist/{checkBrowser-4EBJLLIH.js → checkBrowser-JRADOMED.js} +39 -37
- package/dist/{chunk-Z5TGBEPJ.js → chunk-32BLIKEV.js} +1 -1
- package/dist/{chunk-P7WGVXR7.js → chunk-35HSGF46.js} +6 -6
- package/dist/{chunk-6WRN4WC6.js → chunk-36EOFTVG.js} +1 -1
- package/dist/{chunk-FFDYRJBE.js → chunk-3PTZ2TD4.js} +1 -1
- package/dist/{chunk-S4KHJERB.js → chunk-4A27M7CJ.js} +1 -1
- package/dist/{chunk-VYRJAQGC.js → chunk-57QUPSP2.js} +1 -1
- package/dist/{chunk-HUKQW4YE.js → chunk-5IWRGVAX.js} +2 -2
- package/dist/{chunk-SI7QCT2J.js → chunk-5PCT5DDF.js} +6 -6
- package/dist/{chunk-QWBVPWUI.js → chunk-5ZJGEQGS.js} +3 -1
- package/dist/{chunk-CP225S5H.js → chunk-7BOGLQFM.js} +5 -5
- package/dist/{chunk-MOEGCMKI.js → chunk-7J6LQ3SQ.js} +20 -0
- package/dist/chunk-7VZEOCUY.js +98 -0
- package/dist/{chunk-4LTBQEPD.js → chunk-A2H5EJZM.js} +2 -2
- package/dist/{chunk-NZ6G5YWZ.js → chunk-A45HCDG7.js} +2 -2
- package/dist/{chunk-MW2NQQ6Z.js → chunk-AG566TRI.js} +2 -2
- package/dist/{chunk-K4PHB3YQ.js → chunk-AZGVCQGO.js} +7 -3
- package/dist/{chunk-WNMVC3IT.js → chunk-BKXC5XHB.js} +1 -1
- package/dist/{chunk-S2OLTAEL.js → chunk-BN22WCAF.js} +2 -2
- package/dist/{chunk-J67FSI3Q.js → chunk-BW5WYF4N.js} +92 -27
- package/dist/{chunk-ULL3U6PV.js → chunk-BYZPLQSX.js} +1 -1
- package/dist/chunk-D3MUHMFG.js +16 -0
- package/dist/{chunk-4HT2L6W2.js → chunk-DHTWYTSV.js} +1 -1
- package/dist/{chunk-XUQYC5DD.js → chunk-DKJAK6JW.js} +5 -5
- package/dist/{chunk-LSMFOZ4F.js → chunk-DST7GU2Y.js} +2 -2
- package/dist/{chunk-EU7MVORF.js → chunk-E63BDV4Z.js} +10 -1
- package/dist/{chunk-6N7D2GUV.js → chunk-EQPXSSNG.js} +28 -24
- package/dist/{chunk-MBGM26P5.js → chunk-ERVBXEPZ.js} +1 -1
- package/dist/{chunk-MYO77JWR.js → chunk-EVTBRL37.js} +1 -1
- package/dist/{chunk-EGOXYG3M.js → chunk-EYGWMHXV.js} +2 -2
- package/dist/{chunk-DHQSDCWD.js → chunk-F7IWJMIO.js} +3 -2
- package/dist/{chunk-4KG3ESVO.js → chunk-FBIWJ3A4.js} +4 -4
- package/dist/{chunk-DXACKQ3F.js → chunk-FCIO4WSW.js} +3 -3
- package/dist/{chunk-43MW4SY7.js → chunk-FCXEVKFQ.js} +4 -4
- package/dist/{chunk-PKVA6MPV.js → chunk-FHIBBIEZ.js} +65 -204
- package/dist/{chunk-XG3IZV62.js → chunk-GKNTPIFD.js} +17 -9
- package/dist/{chunk-GHSO62LK.js → chunk-GNESG4XA.js} +4 -10
- package/dist/{chunk-G2A6RC5R.js → chunk-HD4KXG5U.js} +70 -49
- package/dist/{chunk-PWEOSJ3E.js → chunk-HKCIRH26.js} +3 -3
- package/dist/{chunk-B5MPMIKQ.js → chunk-HP7BXJFZ.js} +2 -2
- package/dist/{chunk-MPO25DQW.js → chunk-I3PNZDKR.js} +186 -153
- package/dist/chunk-I4H5JWND.js +205 -0
- package/dist/{chunk-ORFRUZPB.js → chunk-IMKBZEGT.js} +2 -2
- package/dist/{chunk-3O2E4Q66.js → chunk-J7A73K2B.js} +35 -22
- package/dist/{chunk-M4QZFUMW.js → chunk-JHNBF2HD.js} +1 -1
- package/dist/{chunk-XOFBXLMG.js → chunk-JLBJRJO6.js} +5 -3
- package/dist/{chunk-GMECXFAN.js → chunk-K4FVGVA6.js} +5 -2
- package/dist/{chunk-XMRA7CQG.js → chunk-KCLBO65Y.js} +1 -1
- package/dist/{chunk-7CPI2DWL.js → chunk-KGAPL42S.js} +1 -1
- package/dist/{chunk-BKDQFOKK.js → chunk-KGG2PUZN.js} +91 -17
- package/dist/{chunk-OTXXDONS.js → chunk-LRE4GDFA.js} +3 -3
- package/dist/{chunk-EYEEZXLI.js → chunk-MA447PNF.js} +25 -17
- package/dist/{chunk-6JNSYFOH.js → chunk-MV3J6ZOP.js} +4 -4
- package/dist/{chunk-CSWCZA6V.js → chunk-NEKKA2DA.js} +2 -2
- package/dist/{chunk-EOVYQ3IG.js → chunk-NQ2INEHX.js} +17 -17
- package/dist/{chunk-4F5NRJ6M.js → chunk-OMLVCHNN.js} +2 -2
- package/dist/{chunk-6CWKORZO.js → chunk-P2L7NNHT.js} +27 -5
- package/dist/{chunk-FC4WT5FX.js → chunk-P327BIJR.js} +1 -14
- package/dist/{chunk-NEASABW6.js → chunk-P6EXMN5D.js} +1 -1
- package/dist/{chunk-VR3JLTZD.js → chunk-PCPMSUW6.js} +3 -3
- package/dist/{chunk-D2CE2J2A.js → chunk-PV4XID2A.js} +1 -1
- package/dist/{chunk-IL2TMC6F.js → chunk-QFXF5GXE.js} +21 -5
- package/dist/{chunk-VS4SK7BN.js → chunk-QI5TLQNW.js} +7 -7
- package/dist/{chunk-CZUAX3BV.js → chunk-QIDN4ML5.js} +1 -1
- package/dist/{chunk-BLCKQPBE.js → chunk-QPX7FJP3.js} +1 -1
- package/dist/chunk-QRC7IVBC.js +4870 -0
- package/dist/{chunk-IIJVSCSH.js → chunk-QRWTVCGH.js} +18 -18
- package/dist/{chunk-56ANHX5U.js → chunk-QXUFQSSK.js} +1 -1
- package/dist/{chunk-KTWGVEN6.js → chunk-RIAWW4G2.js} +2 -2
- package/dist/{chunk-HTZJNQYI.js → chunk-RUW65P3N.js} +1 -1
- package/dist/{chunk-ENRFKCI6.js → chunk-TDEORHFN.js} +3 -3
- package/dist/{chunk-X6MCIK7L.js → chunk-TGFDRZTM.js} +29 -13
- package/dist/{chunk-U6KN6OIP.js → chunk-UA3YNZK6.js} +2 -2
- package/dist/{chunk-TNTGGDSD.js → chunk-UWEGMKKU.js} +1 -1
- package/dist/{chunk-SKKQMW5X.js → chunk-W3V5EOFA.js} +1 -1
- package/dist/{chunk-QP2MJYTJ.js → chunk-W4E3ZOWH.js} +1 -1
- package/dist/{chunk-7PAK7LZ5.js → chunk-WOFTAZSZ.js} +18 -20
- package/dist/{chunk-HZN7ICAF.js → chunk-WWQJYYAB.js} +3 -3
- package/dist/{chunk-PSOAGSNO.js → chunk-X2T5EOI7.js} +2 -2
- package/dist/{chunk-Q43YUROE.js → chunk-X6JUUQCM.js} +1 -1
- package/dist/chunk-XCIHCPJK.js +106 -0
- package/dist/{chunk-5HB4JM7H.js → chunk-XIUHHEBS.js} +5 -3
- package/dist/{chunk-EXAX37XR.js → chunk-Y65ZU7XY.js} +18 -13
- package/dist/{chunk-WABB4LZS.js → chunk-YBY2WVLC.js} +19 -2
- package/dist/{chunk-5PCALX6G.js → chunk-YIFEK3UD.js} +1 -1
- package/dist/{chunk-6DSYBW7Z.js → chunk-YRO3PXWU.js} +1 -85
- package/dist/{chunk-6PWQH77E.js → chunk-ZFVNYA3M.js} +1 -1
- package/dist/{chunk-GEO6THL3.js → chunk-ZRSQNF4A.js} +43 -30
- package/dist/{clean-6GX7WAEC.js → clean-NVBEXXIS.js} +25 -22
- package/dist/cli.js +56 -56
- package/dist/{cloud-6PFJKLNL.js → cloud-3T6HF7DT.js} +4 -4
- package/dist/{cloudrun-UGG3ZFH7.js → cloudrun-TXEEZGJ7.js} +5 -5
- package/dist/commands/layout-audit.browser.js +94 -4
- package/dist/{compare-P4EBOP4B.js → compare-Q42Z56P7.js} +38 -36
- package/dist/{compiler-PG4RKX6K.js → compiler-IL2PZJFH.js} +5 -3
- package/dist/{component-SQPMI3W7.js → component-2IWQZYCZ.js} +3 -3
- package/dist/{compositions-KRIHY3IY.js → compositions-3EZ3GBK2.js} +14 -12
- package/dist/{contactSheet-RYAE7Y5D.js → contactSheet-WG4HT5XP.js} +2 -2
- package/dist/{delete-T5TO4SV6.js → delete-2UBY2JTM.js} +10 -9
- package/dist/{deploy-AO6LQR5G.js → deploy-QTS2OM2H.js} +1 -1
- package/dist/{dist-6IMEDVMC.js → dist-73YTUT3W.js} +1 -1
- package/dist/{dist-23AAB5X2.js → dist-XF53LCKD.js} +4 -2
- package/dist/{doctor-QBUJQ655.js → doctor-FIXMXWE6.js} +21 -15
- package/dist/{events-J7CESLKQ.js → events-7WYSDXTE.js} +4 -4
- package/dist/{events-SIZO7YHI.js → events-NTZSSMBR.js} +5 -5
- package/dist/{feedback-74WOJ5PN.js → feedback-7SOB5GZC.js} +12 -12
- package/dist/{ffmpeg-AKUP6U2S.js → ffmpeg-PYY5FSIX.js} +10 -8
- package/dist/{figma-GGMYRR4Q.js → figma-DTWA3G22.js} +3 -3
- package/dist/fontLocalizeCli.js +11 -9
- package/dist/{get-PLKAI6JM.js → get-DMGUJPLP.js} +10 -9
- package/dist/{gpuPolicy-EYDAAPJF.js → gpuPolicy-KVYO4OU4.js} +8 -6
- package/dist/{grade-compare-UADJP4AV.js → grade-compare-NCYPJFLI.js} +39 -37
- package/dist/{heifImagePrep-KDF3OPOK.js → heifImagePrep-F7LFUYGC.js} +9 -7
- package/dist/{help-WSQQ555Q.js → help-I4RRBHCW.js} +2 -2
- package/dist/{history-VSQ2DQ3V.js → history-GVBBXZKQ.js} +11 -10
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +64 -64
- package/dist/hyperframes-player.global.js +1 -1
- package/dist/{info-MOQ4LRC3.js → info-UE2PY5AF.js} +9 -9
- package/dist/{init-EONQSZJG.js → init-4UGFGJQK.js} +39 -34
- package/dist/{inspect-OLCVLHOU.js → inspect-ZRREAUCB.js} +37 -35
- package/dist/{installer-GHISA75B.js → installer-ABXPRFIJ.js} +6 -5
- package/dist/{keyframes-DGQYCY24.js → keyframes-MFR4TYVR.js} +8 -8
- package/dist/{lambda-AMMWF2YH.js → lambda-E3Z6JCIB.js} +13 -11
- package/dist/{layout-R6CAPGRO.js → layout-IO7T5SSU.js} +37 -35
- package/dist/{lint-QZJEYPHD.js → lint-WYPQK5XA.js} +9 -9
- package/dist/{lintProject-W3YVHAGP.js → lintProject-KCN7MRBN.js} +1 -1
- package/dist/{list-KCJID4SP.js → list-7F2LXWOZ.js} +10 -9
- package/dist/{login-7HKBEPJS.js → login-TTMYCXN2.js} +7 -7
- package/dist/{logout-3IID4KXD.js → logout-QRSB4CNH.js} +3 -3
- package/dist/{manager-Z7W4GQGF.js → manager-LQXZTUTJ.js} +3 -3
- package/dist/{manager-6YSKJMVD.js → manager-OQ5J26ST.js} +11 -9
- package/dist/{media-treatment-E3DL6LEZ.js → media-treatment-ELB6WRA5.js} +17 -15
- package/dist/{models-URWI7YEG.js → models-D2FNIGNZ.js} +15 -13
- package/dist/{motionShot-27IXMDJK.js → motionShot-53VDDRIC.js} +22 -21
- package/dist/{normalize-audio-WGRLPR3P.js → normalize-audio-QHNCFWR2.js} +12 -9
- package/dist/{open-LQ35PLEN.js → open-3KMTT3AV.js} +18 -17
- package/dist/{parakeetRunner-XASVIDTI.js → parakeetRunner-T65S6FW3.js} +20 -17
- package/dist/{pipeline-GA7QVCHS.js → pipeline-DUVRZGIM.js} +15 -10
- package/dist/{play-RYZP77CI.js → play-27R6RBSK.js} +27 -24
- package/dist/{policies-PKLD4UW5.js → policies-NWIEUGGW.js} +1 -1
- package/dist/{preflight-HJFSJXXF.js → preflight-QB6NKBBL.js} +12 -10
- package/dist/{present-YBMLOWZV.js → present-RHV3FKI5.js} +21 -18
- package/dist/{preview-QIRKJCRV.js → preview-IAKIXYLN.js} +29 -27
- package/dist/{producer-524FDOLX.js → producer-F6PHB4M4.js} +1 -1
- package/dist/{projectConfig-IDQN5ZRW.js → projectConfig-MPHWYY5D.js} +10 -9
- package/dist/{publication-3X3IGSDO.js → publication-CBAEINEG.js} +4 -3
- package/dist/{publish-2BF7K6HX.js → publish-4A2A6V7Z.js} +20 -17
- package/dist/{refresh-3IRHJEQA.js → refresh-F7FUCXLX.js} +3 -3
- package/dist/{remove-background-EZBCEFT6.js → remove-background-3I7RZGVG.js} +15 -11
- package/dist/{render-TEEBI2UT.js → render-2HYATL32.js} +56 -57
- package/dist/{render-EFUA2A6A.js → render-BGPUHBFC.js} +6 -5
- package/dist/{render-JFMTAXHD.js → render-BSKLHCZ4.js} +67 -47
- package/dist/{render-batch-XTYNXVSW.js → render-batch-JD6C3BDD.js} +7 -6
- package/dist/renderSetupWorker.js +5 -5
- package/dist/{resolver-FZS6TN6B.js → resolver-SQYR7LII.js} +6 -5
- package/dist/{screenshotCapture-HOW4VSV6.js → screenshotCapture-HDRHY4NN.js} +2 -2
- package/dist/{sherpa-TQIAIKTH.js → sherpa-VXD3DAH4.js} +19 -16
- package/dist/skills/hyperframes-cli/references/lint-validate-inspect.md +2 -2
- package/dist/{skills-S6ZG5KKH.js → skills-B2SHEHWL.js} +7 -7
- package/dist/{skillsUpdateCheck-XC7JQL3F.js → skillsUpdateCheck-ST43UUPK.js} +5 -5
- package/dist/{snapshot-ERYZIM32.js → snapshot-USJYNKDM.js} +118 -75
- package/dist/{src-OL6RHPE4.js → src-5OX35WPG.js} +10 -8
- package/dist/{src-6XOMREMS.js → src-PX3VIS7K.js} +30 -9
- package/dist/{staticProjectServer-JYDDGPAH.js → staticProjectServer-ET7H5LMV.js} +22 -19
- package/dist/{status-DTP6ZYDU.js → status-QVDRHXW2.js} +3 -3
- package/dist/studio/assets/{hyperframes-player-5dRdMVOq.js → hyperframes-player-DUpxahTX.js} +1 -1
- package/dist/studio/assets/{index-ZqyQ91pm.js → index-B4dcZZAm.js} +1 -1
- package/dist/studio/assets/{index-Bu3mJUU2.js → index-CtrcjpbM.js} +5 -5
- package/dist/studio/assets/{index-CYbvOVp-.css → index-RUPGNyct.css} +1 -1
- package/dist/studio/index.html +2 -2
- package/dist/{studio-api-GRU4SHKD.js → studio-api-PLKYSG2X.js} +13 -10
- package/dist/{studioServer-OYPBEI5B.js → studioServer-CNUXGRFS.js} +65 -63
- package/dist/{synthesize-QZHRXGRY.js → synthesize-RVE7IUOJ.js} +3 -2
- package/dist/{telemetry-CPYINR63.js → telemetry-DGDEJLGL.js} +5 -5
- package/dist/{telemetry-6BPSGY5W.js → telemetry-EJS5PXH2.js} +2 -2
- package/dist/{timeline-RGK5BMPD.js → timeline-VCQC4TLM.js} +23 -20
- package/dist/{tokens-EX4BOWRW.js → tokens-AEOBCDW5.js} +2 -2
- package/dist/{transcribe-RI52JMVW.js → transcribe-COFCB3ZB.js} +25 -22
- package/dist/{transcribe-MK367I6A.js → transcribe-X6O5ZSGQ.js} +15 -12
- package/dist/{tts-AY4JO5NQ.js → tts-AGMCPQXE.js} +1 -1
- package/dist/{updateCheck-BIEJKQI4.js → updateCheck-BW7MDUXZ.js} +4 -4
- package/dist/{upgrade-ES3UUI7O.js → upgrade-QXOGA54H.js} +4 -4
- package/dist/{urlDownloader-XAGYSTAG.js → urlDownloader-QB3TBIQ5.js} +7 -5
- package/dist/{validate-A6GZHNEI.js → validate-AU2BZ7D7.js} +29 -27
- package/dist/{video-OEMGR3MN.js → video-GNNYAL5T.js} +9 -7
- package/dist/warmCheck.js +46 -44
- package/package.json +1 -1
- package/dist/chunk-BQMAPNDA.js +0 -4830
- package/dist/chunk-DKPNNYBZ.js +0 -44
|
@@ -0,0 +1,205 @@
|
|
|
1
|
+
import { createRequire as __hf_createRequire } from "node:module";
|
|
2
|
+
import { fileURLToPath as __hf_fileURLToPath } from "node:url";
|
|
3
|
+
import { dirname as __hf_dirname } from "node:path";
|
|
4
|
+
var require = __hf_createRequire(import.meta.url);
|
|
5
|
+
var __filename = __hf_fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = __hf_dirname(__filename);
|
|
7
|
+
import {
|
|
8
|
+
videoStreamHasAlpha
|
|
9
|
+
} from "./chunk-5S7W3TUO.js";
|
|
10
|
+
import {
|
|
11
|
+
decodableAudioStream
|
|
12
|
+
} from "./chunk-D3MUHMFG.js";
|
|
13
|
+
import {
|
|
14
|
+
firstFrameColourArgs,
|
|
15
|
+
parseFirstFrameColour
|
|
16
|
+
} from "./chunk-5ZJGEQGS.js";
|
|
17
|
+
import {
|
|
18
|
+
findFfBinary
|
|
19
|
+
} from "./chunk-VAS6HQX3.js";
|
|
20
|
+
|
|
21
|
+
// ../studio-server/dist/chunk-X73QTST2.js
|
|
22
|
+
import { execFile } from "child_process";
|
|
23
|
+
import { extname } from "path";
|
|
24
|
+
var execFileRunner = (command, args, options) => new Promise((resolvePromise) => {
|
|
25
|
+
execFile(
|
|
26
|
+
command,
|
|
27
|
+
args,
|
|
28
|
+
{ timeout: options?.timeout, maxBuffer: options?.maxBuffer, windowsHide: true },
|
|
29
|
+
(error, stdout, stderr) => {
|
|
30
|
+
if (error && error.code === "ENOENT") {
|
|
31
|
+
resolvePromise({ status: null, stdout: "", stderr: "", error });
|
|
32
|
+
return;
|
|
33
|
+
}
|
|
34
|
+
if (error) {
|
|
35
|
+
const status = typeof error.code === "number" ? error.code : 1;
|
|
36
|
+
resolvePromise({ status, stdout: stdout ?? "", stderr: stderr ?? "" });
|
|
37
|
+
return;
|
|
38
|
+
}
|
|
39
|
+
resolvePromise({ status: 0, stdout: stdout ?? "", stderr: stderr ?? "" });
|
|
40
|
+
}
|
|
41
|
+
);
|
|
42
|
+
});
|
|
43
|
+
var VIDEO_EXT = /* @__PURE__ */ new Set([
|
|
44
|
+
".mp4",
|
|
45
|
+
".mov",
|
|
46
|
+
".webm",
|
|
47
|
+
".mkv",
|
|
48
|
+
".avi",
|
|
49
|
+
".m4v",
|
|
50
|
+
".mxf",
|
|
51
|
+
".mts",
|
|
52
|
+
".m2ts",
|
|
53
|
+
".ts"
|
|
54
|
+
]);
|
|
55
|
+
var IMAGE_EXT = /* @__PURE__ */ new Set([".jpg", ".jpeg", ".png", ".webp", ".avif"]);
|
|
56
|
+
var AUDIO_EXT = /* @__PURE__ */ new Set([".mp3", ".wav", ".ogg", ".m4a", ".aac", ".flac"]);
|
|
57
|
+
function lower(value) {
|
|
58
|
+
return value?.toLowerCase() ?? "";
|
|
59
|
+
}
|
|
60
|
+
function inferKindFromPath(path) {
|
|
61
|
+
const ext = extname(path).toLowerCase();
|
|
62
|
+
if (VIDEO_EXT.has(ext)) return "video";
|
|
63
|
+
if (IMAGE_EXT.has(ext)) return "image";
|
|
64
|
+
if (AUDIO_EXT.has(ext)) return "audio";
|
|
65
|
+
return "unknown";
|
|
66
|
+
}
|
|
67
|
+
function colorLabel(input) {
|
|
68
|
+
if (input.isHdr) {
|
|
69
|
+
if (input.hdrTransfer === "pq") return "HDR PQ";
|
|
70
|
+
if (input.hdrTransfer === "hlg") return "HDR HLG";
|
|
71
|
+
return "HDR";
|
|
72
|
+
}
|
|
73
|
+
if (input.colorPrimaries.includes("bt709") || input.colorSpace.includes("bt709") || input.colorTransfer.includes("bt709")) {
|
|
74
|
+
return "SDR Rec.709";
|
|
75
|
+
}
|
|
76
|
+
return "SDR/unknown";
|
|
77
|
+
}
|
|
78
|
+
function classifyMediaColor(stream) {
|
|
79
|
+
const colorPrimaries = lower(stream?.color_primaries);
|
|
80
|
+
const colorSpace = lower(stream?.color_space);
|
|
81
|
+
const colorTransfer = lower(stream?.color_transfer);
|
|
82
|
+
const isHdr = colorPrimaries.includes("bt2020") || colorSpace.includes("bt2020") || colorTransfer === "smpte2084" || colorTransfer === "arib-std-b67";
|
|
83
|
+
const hdrTransfer = isHdr ? colorTransfer === "smpte2084" ? "pq" : colorTransfer === "arib-std-b67" ? "hlg" : "unknown" : null;
|
|
84
|
+
return {
|
|
85
|
+
dynamicRange: stream ? isHdr ? "hdr" : "sdr" : "unknown",
|
|
86
|
+
hdrTransfer,
|
|
87
|
+
label: stream ? colorLabel({ isHdr, hdrTransfer, colorPrimaries, colorSpace, colorTransfer }) : "Unknown",
|
|
88
|
+
isHdr,
|
|
89
|
+
codecName: stream?.codec_name,
|
|
90
|
+
profile: stream?.profile,
|
|
91
|
+
pixelFormat: stream?.pix_fmt,
|
|
92
|
+
colorSpace: stream?.color_space,
|
|
93
|
+
colorTransfer: stream?.color_transfer,
|
|
94
|
+
colorPrimaries: stream?.color_primaries,
|
|
95
|
+
bitsPerRawSample: stream?.bits_per_raw_sample
|
|
96
|
+
};
|
|
97
|
+
}
|
|
98
|
+
async function probeFirstFrameColour(filePath, runner = execFileRunner) {
|
|
99
|
+
const ffmpegPath = findFfBinary("ffmpeg", { configuredMustExist: true }) ?? (runner === execFileRunner ? void 0 : "ffmpeg");
|
|
100
|
+
if (!ffmpegPath) return {};
|
|
101
|
+
const result = await runner(ffmpegPath, firstFrameColourArgs(filePath), {
|
|
102
|
+
timeout: 15e3,
|
|
103
|
+
maxBuffer: 1024 * 1024
|
|
104
|
+
});
|
|
105
|
+
return result.status === 0 ? parseFirstFrameColour(String(result.stderr)) : {};
|
|
106
|
+
}
|
|
107
|
+
function bitDepthOf(stream) {
|
|
108
|
+
const raw = Number(stream.bits_per_raw_sample);
|
|
109
|
+
if (Number.isFinite(raw) && raw > 0) return raw;
|
|
110
|
+
const suffixed = /(\d{1,3})(?:le|be)$/.exec(stream.pix_fmt ?? "");
|
|
111
|
+
return suffixed ? Number(suffixed[1]) : 8;
|
|
112
|
+
}
|
|
113
|
+
function sourceFactsOf(stream, formatBitrate) {
|
|
114
|
+
if (!stream?.width || !stream.height) return void 0;
|
|
115
|
+
const bitrate = Number(stream.bit_rate ?? formatBitrate);
|
|
116
|
+
return {
|
|
117
|
+
width: stream.width,
|
|
118
|
+
height: stream.height,
|
|
119
|
+
bitDepth: bitDepthOf(stream),
|
|
120
|
+
bitrate: Number.isFinite(bitrate) ? bitrate : 0
|
|
121
|
+
};
|
|
122
|
+
}
|
|
123
|
+
var STREAM_SUMMARY_MAX = 12;
|
|
124
|
+
function summarizeStream(stream) {
|
|
125
|
+
const flags = Object.entries(stream.disposition ?? {}).filter(([, on]) => on === 1).map(([name]) => name);
|
|
126
|
+
return `${stream.codec_type ?? "?"}:${stream.codec_name ?? "?"}[${flags.join(",")}]`;
|
|
127
|
+
}
|
|
128
|
+
function audioOf(streams) {
|
|
129
|
+
const audioStream = decodableAudioStream(streams);
|
|
130
|
+
return audioStream === null ? { hasAudio: false } : { hasAudio: true, audioStream };
|
|
131
|
+
}
|
|
132
|
+
function metadataFromProbe(kind, parsed) {
|
|
133
|
+
const stream = parsed.streams?.find((item) => {
|
|
134
|
+
if (kind === "image") return item.codec_type === "video";
|
|
135
|
+
return item.codec_type === kind && item.disposition?.attached_pic !== 1;
|
|
136
|
+
});
|
|
137
|
+
const metadata = {
|
|
138
|
+
kind,
|
|
139
|
+
color: classifyMediaColor(stream),
|
|
140
|
+
streams: (parsed.streams ?? []).slice(0, STREAM_SUMMARY_MAX).map(summarizeStream)
|
|
141
|
+
};
|
|
142
|
+
if (kind === "video") {
|
|
143
|
+
Object.assign(metadata, audioOf(parsed.streams ?? []));
|
|
144
|
+
metadata.hasAlpha = stream !== void 0 && videoStreamHasAlpha(stream);
|
|
145
|
+
const duration = Number(parsed.format?.duration);
|
|
146
|
+
if (Number.isFinite(duration) && duration > 0) metadata.durationSeconds = duration;
|
|
147
|
+
metadata.source = sourceFactsOf(stream, parsed.format?.bit_rate);
|
|
148
|
+
}
|
|
149
|
+
return metadata;
|
|
150
|
+
}
|
|
151
|
+
async function probeAudioTrack(filePath, runner = execFileRunner) {
|
|
152
|
+
const result = await runner(
|
|
153
|
+
findFfBinary("ffprobe") ?? "ffprobe",
|
|
154
|
+
[
|
|
155
|
+
...["-v", "error", "-select_streams", "a"],
|
|
156
|
+
...["-show_entries", "stream=codec_type,codec_name,channels", "-of", "json", "--", filePath]
|
|
157
|
+
],
|
|
158
|
+
{ timeout: 3e4 }
|
|
159
|
+
);
|
|
160
|
+
if (result.status !== 0) return null;
|
|
161
|
+
const streams = JSON.parse(String(result.stdout || "{}")).streams ?? [];
|
|
162
|
+
const stream = decodableAudioStream(streams);
|
|
163
|
+
return stream === null ? null : { stream, channels: streams[stream]?.channels ?? 0 };
|
|
164
|
+
}
|
|
165
|
+
async function probeMediaMetadata(filePath, runner = execFileRunner) {
|
|
166
|
+
const kind = inferKindFromPath(filePath);
|
|
167
|
+
if (kind === "audio" || kind === "unknown") {
|
|
168
|
+
return { kind, color: classifyMediaColor(null) };
|
|
169
|
+
}
|
|
170
|
+
const ffprobePath = findFfBinary("ffprobe", { configuredMustExist: true }) ?? (runner === execFileRunner ? void 0 : "ffprobe");
|
|
171
|
+
if (!ffprobePath) {
|
|
172
|
+
return { kind, color: classifyMediaColor(null), probeError: "ffprobe unavailable" };
|
|
173
|
+
}
|
|
174
|
+
const result = await runner(
|
|
175
|
+
ffprobePath,
|
|
176
|
+
[
|
|
177
|
+
"-v",
|
|
178
|
+
"error",
|
|
179
|
+
"-show_entries",
|
|
180
|
+
"stream=codec_type,codec_name,profile,pix_fmt,color_space,color_transfer,color_primaries,bits_per_raw_sample,width,height,bit_rate:stream_disposition:stream_tags=alpha_mode:format=duration,bit_rate",
|
|
181
|
+
"-of",
|
|
182
|
+
"json",
|
|
183
|
+
"--",
|
|
184
|
+
filePath
|
|
185
|
+
],
|
|
186
|
+
{ timeout: 15e3, maxBuffer: 1024 * 1024 }
|
|
187
|
+
);
|
|
188
|
+
if (result.error?.code === "ENOENT") {
|
|
189
|
+
return { kind, color: classifyMediaColor(null), probeError: "ffprobe unavailable" };
|
|
190
|
+
}
|
|
191
|
+
if (result.status !== 0) {
|
|
192
|
+
return { kind, color: classifyMediaColor(null), probeError: "ffprobe failed" };
|
|
193
|
+
}
|
|
194
|
+
try {
|
|
195
|
+
return metadataFromProbe(kind, JSON.parse(String(result.stdout || "{}")));
|
|
196
|
+
} catch {
|
|
197
|
+
return { kind, color: classifyMediaColor(null), probeError: "ffprobe returned invalid json" };
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
export {
|
|
202
|
+
probeFirstFrameColour,
|
|
203
|
+
probeAudioTrack,
|
|
204
|
+
probeMediaMetadata
|
|
205
|
+
};
|
|
@@ -6,13 +6,13 @@ var __filename = __hf_fileURLToPath(import.meta.url);
|
|
|
6
6
|
var __dirname = __hf_dirname(__filename);
|
|
7
7
|
import {
|
|
8
8
|
writeNewFileSync
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-KCLBO65Y.js";
|
|
10
10
|
import {
|
|
11
11
|
normalizeSkillSlug
|
|
12
12
|
} from "./chunk-HVW7ABXD.js";
|
|
13
13
|
import {
|
|
14
14
|
DEFAULT_REGISTRY_URL
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-5IWRGVAX.js";
|
|
16
16
|
|
|
17
17
|
// src/utils/projectConfig.ts
|
|
18
18
|
import { readFileSync, writeFileSync } from "fs";
|
|
@@ -12,16 +12,20 @@ import {
|
|
|
12
12
|
atomicTempPath,
|
|
13
13
|
isAtomicTempPath,
|
|
14
14
|
replaceFileAtomically
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-NQ2INEHX.js";
|
|
16
16
|
import {
|
|
17
17
|
isProjectIgnoredDir
|
|
18
18
|
} from "./chunk-EVMY7IPL.js";
|
|
19
|
+
import {
|
|
20
|
+
renameWithRetry,
|
|
21
|
+
renameWithRetryAsync
|
|
22
|
+
} from "./chunk-XCIHCPJK.js";
|
|
19
23
|
import {
|
|
20
24
|
isSafePath,
|
|
21
25
|
mkdirWithinProject
|
|
22
26
|
} from "./chunk-OFQWTKPW.js";
|
|
23
27
|
|
|
24
|
-
// ../studio-server/dist/chunk-
|
|
28
|
+
// ../studio-server/dist/chunk-BWZMWYB2.js
|
|
25
29
|
import { randomUUID as randomUUID7 } from "crypto";
|
|
26
30
|
import { mkdir as mkdir2, readdir as readdir3, rm as rm3, rmdir, stat as stat2, writeFile } from "fs/promises";
|
|
27
31
|
import {
|
|
@@ -48,13 +52,13 @@ import { createHash as createHash2 } from "crypto";
|
|
|
48
52
|
import { lstatSync, readFileSync as readFileSync3, readdirSync } from "fs";
|
|
49
53
|
import { extname, isAbsolute as isAbsolute2, relative as relative2, resolve as resolve2, sep as sep2 } from "path";
|
|
50
54
|
import { createHash as createHash3, randomUUID as randomUUID3 } from "crypto";
|
|
51
|
-
import { constants, createReadStream, createWriteStream
|
|
52
|
-
import { copyFile, mkdir, readdir, readFile,
|
|
55
|
+
import { constants, createReadStream, createWriteStream } from "fs";
|
|
56
|
+
import { copyFile, mkdir, readdir, readFile, rm, stat } from "fs/promises";
|
|
53
57
|
import { dirname, join as join2 } from "path";
|
|
54
58
|
import { pipeline } from "stream/promises";
|
|
55
59
|
import { extname as extname2 } from "path";
|
|
56
60
|
import { randomUUID as randomUUID5 } from "crypto";
|
|
57
|
-
import { readdirSync as readdirSync2, readFileSync as readFileSync5, renameSync
|
|
61
|
+
import { readdirSync as readdirSync2, readFileSync as readFileSync5, renameSync, statSync as statSync3, writeFileSync as writeFileSync3 } from "fs";
|
|
58
62
|
import { lstat, readdir as readdir2, rm as rm2 } from "fs/promises";
|
|
59
63
|
import { tmpdir } from "os";
|
|
60
64
|
import { dirname as dirname2, join as join4 } from "path";
|
|
@@ -62,7 +66,7 @@ import { randomUUID as randomUUID4 } from "crypto";
|
|
|
62
66
|
import { existsSync, mkdirSync as mkdirSync2, readFileSync as readFileSync4, statSync as statSync2, writeFileSync as writeFileSync2 } from "fs";
|
|
63
67
|
import { basename, join as join3, resolve as resolve3 } from "path";
|
|
64
68
|
import { createHash as createHash5, randomUUID as randomUUID6 } from "crypto";
|
|
65
|
-
import { createReadStream as createReadStream2, existsSync as existsSync2, readFileSync as readFileSync8, renameSync as
|
|
69
|
+
import { createReadStream as createReadStream2, existsSync as existsSync2, readFileSync as readFileSync8, renameSync as renameSync2, statSync as statSync4 } from "fs";
|
|
66
70
|
import { isAbsolute as isAbsolute4, join as join7, resolve as resolve6 } from "path";
|
|
67
71
|
import { createHash as createHash4 } from "crypto";
|
|
68
72
|
import {
|
|
@@ -262,14 +266,15 @@ function claim(file) {
|
|
|
262
266
|
const draft = `${file}-${process.pid}-${randomUUID2()}.tmp`;
|
|
263
267
|
writeFileSync(draft, String(process.pid));
|
|
264
268
|
try {
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
269
|
+
try {
|
|
270
|
+
linkSync(draft, file);
|
|
271
|
+
} catch (error) {
|
|
272
|
+
const code = error.code ?? "";
|
|
273
|
+
if (code === "EEXIST") return false;
|
|
274
|
+
if (!NO_HARD_LINKS.has(code)) throw error;
|
|
275
|
+
return createExclusively(file);
|
|
276
|
+
}
|
|
277
|
+
return recordOwnership(file);
|
|
273
278
|
} finally {
|
|
274
279
|
rmSync(draft, { force: true });
|
|
275
280
|
}
|
|
@@ -277,12 +282,20 @@ function claim(file) {
|
|
|
277
282
|
function createExclusively(file) {
|
|
278
283
|
try {
|
|
279
284
|
writeFileSync(file, String(process.pid), { flag: "wx" });
|
|
280
|
-
recordStart(file);
|
|
281
|
-
return true;
|
|
282
285
|
} catch (error) {
|
|
283
286
|
if (error.code !== "EEXIST") throw error;
|
|
284
287
|
return false;
|
|
285
288
|
}
|
|
289
|
+
return recordOwnership(file);
|
|
290
|
+
}
|
|
291
|
+
function recordOwnership(file) {
|
|
292
|
+
try {
|
|
293
|
+
recordStart(file);
|
|
294
|
+
return true;
|
|
295
|
+
} catch (error) {
|
|
296
|
+
releaseOwn(file);
|
|
297
|
+
throw error;
|
|
298
|
+
}
|
|
286
299
|
}
|
|
287
300
|
function releaseOwn(file) {
|
|
288
301
|
if (ownerOf(file) !== process.pid) return;
|
|
@@ -595,7 +608,7 @@ async function cloneOrCopy(from, to, beforeReplace) {
|
|
|
595
608
|
try {
|
|
596
609
|
await copyFile(from, temp, constants.COPYFILE_FICLONE);
|
|
597
610
|
beforeReplace?.();
|
|
598
|
-
|
|
611
|
+
renameWithRetry(temp, to);
|
|
599
612
|
} catch (error) {
|
|
600
613
|
await rm(temp, { force: true });
|
|
601
614
|
throw error;
|
|
@@ -651,7 +664,7 @@ async function openBlobStore(dir) {
|
|
|
651
664
|
}
|
|
652
665
|
await mkdir(dirname(blobPath(dir, hash)), { recursive: true });
|
|
653
666
|
const size = (await stat(temp)).size;
|
|
654
|
-
await
|
|
667
|
+
await renameWithRetryAsync(temp, blobPath(dir, hash));
|
|
655
668
|
sizes.set(hash, size);
|
|
656
669
|
total += size;
|
|
657
670
|
return hash;
|
|
@@ -675,7 +688,7 @@ async function openBlobStore(dir) {
|
|
|
675
688
|
}
|
|
676
689
|
const to = blobPath(asideDir, hash);
|
|
677
690
|
await mkdir(dirname(to), { recursive: true });
|
|
678
|
-
const moved = remove && await
|
|
691
|
+
const moved = remove && await renameWithRetryAsync(absPath, to).then(
|
|
679
692
|
() => true,
|
|
680
693
|
() => false
|
|
681
694
|
);
|
|
@@ -685,7 +698,7 @@ async function openBlobStore(dir) {
|
|
|
685
698
|
await rm(temp, { force: true });
|
|
686
699
|
throw error;
|
|
687
700
|
});
|
|
688
|
-
await
|
|
701
|
+
await renameWithRetryAsync(temp, to);
|
|
689
702
|
}
|
|
690
703
|
asideSizes.set(hash, (await stat(to)).size);
|
|
691
704
|
holds.set(hash, /* @__PURE__ */ new Set([path]));
|
|
@@ -886,7 +899,7 @@ function recheckAndMoveAway(historyRoot, id, { now, dryRun, tempDir }) {
|
|
|
886
899
|
if (projectDir === null) return null;
|
|
887
900
|
if (dryRun) return { projectDir, trash: null };
|
|
888
901
|
const trash = join4(historyRoot, `${PRUNED_PREFIX}${id}-${randomUUID5()}`);
|
|
889
|
-
|
|
902
|
+
renameSync(home, trash);
|
|
890
903
|
return { projectDir, trash };
|
|
891
904
|
}
|
|
892
905
|
function abandonedProject(home, id, now, tempDir) {
|
|
@@ -1308,7 +1321,7 @@ async function updateState(dir, update) {
|
|
|
1308
1321
|
state = readState(dir);
|
|
1309
1322
|
} catch (error) {
|
|
1310
1323
|
if (!(error instanceof SyntaxError)) throw error;
|
|
1311
|
-
|
|
1324
|
+
renameSync2(statePath(dir), `${statePath(dir)}.invalid-${randomUUID6()}`);
|
|
1312
1325
|
state = emptyState();
|
|
1313
1326
|
}
|
|
1314
1327
|
update(state);
|
|
@@ -8,12 +8,14 @@ import {
|
|
|
8
8
|
normalizeRelPath,
|
|
9
9
|
resolveLocalImageSourcePath,
|
|
10
10
|
splitUrlSuffix
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-XIUHHEBS.js";
|
|
12
12
|
import {
|
|
13
|
-
renameWithRetry,
|
|
14
13
|
runFfmpeg,
|
|
15
14
|
runFfprobe
|
|
16
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-I3PNZDKR.js";
|
|
16
|
+
import {
|
|
17
|
+
renameWithRetry
|
|
18
|
+
} from "./chunk-XCIHCPJK.js";
|
|
17
19
|
import {
|
|
18
20
|
parseHTML
|
|
19
21
|
} from "./chunk-GWTIFRF5.js";
|
|
@@ -4,13 +4,16 @@ import { dirname as __hf_dirname } from "node:path";
|
|
|
4
4
|
var require = __hf_createRequire(import.meta.url);
|
|
5
5
|
var __filename = __hf_fileURLToPath(import.meta.url);
|
|
6
6
|
var __dirname = __hf_dirname(__filename);
|
|
7
|
+
import {
|
|
8
|
+
renameWithRetry
|
|
9
|
+
} from "./chunk-XCIHCPJK.js";
|
|
7
10
|
import {
|
|
8
11
|
mkdirWithinProject,
|
|
9
12
|
realpath
|
|
10
13
|
} from "./chunk-OFQWTKPW.js";
|
|
11
14
|
|
|
12
15
|
// src/registry/publication.ts
|
|
13
|
-
import { lstatSync, chmodSync, mkdtempSync,
|
|
16
|
+
import { lstatSync, chmodSync, mkdtempSync, rmSync, writeFileSync } from "fs";
|
|
14
17
|
import { basename, dirname, isAbsolute, join, relative, resolve, sep } from "path";
|
|
15
18
|
function registryTargetPath(root, target) {
|
|
16
19
|
const parts = target.split(/[\\/]/);
|
|
@@ -44,7 +47,7 @@ function publishRegistryFile(root, target, bytes) {
|
|
|
44
47
|
writeFileSync(stagedFile, bytes, { flag: "wx" });
|
|
45
48
|
const previous = lstatSync(destination, { throwIfNoEntry: false });
|
|
46
49
|
if (previous?.isFile()) chmodSync(stagedFile, previous.mode & 511);
|
|
47
|
-
|
|
50
|
+
renameWithRetry(stagedFile, destination);
|
|
48
51
|
return destination;
|
|
49
52
|
} finally {
|
|
50
53
|
rmSync(stage, { recursive: true, force: true });
|
|
@@ -6,7 +6,7 @@ var __filename = __hf_fileURLToPath(import.meta.url);
|
|
|
6
6
|
var __dirname = __hf_dirname(__filename);
|
|
7
7
|
import {
|
|
8
8
|
createFileAtomically
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-NQ2INEHX.js";
|
|
10
10
|
|
|
11
11
|
// src/utils/writeNewFile.ts
|
|
12
12
|
function writeNewFileSync(filePath, content) {
|
|
@@ -6,7 +6,7 @@ var __filename = __hf_fileURLToPath(import.meta.url);
|
|
|
6
6
|
var __dirname = __hf_dirname(__filename);
|
|
7
7
|
import {
|
|
8
8
|
findCompositionDimensions
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-BYZPLQSX.js";
|
|
10
10
|
import {
|
|
11
11
|
outputResolutionForSize
|
|
12
12
|
} from "./chunk-NHA4NRBE.js";
|
|
@@ -7,7 +7,7 @@ var __dirname = __hf_dirname(__filename);
|
|
|
7
7
|
import {
|
|
8
8
|
loadOptionalPackage,
|
|
9
9
|
loadSharp
|
|
10
|
-
} from "./chunk-
|
|
10
|
+
} from "./chunk-Y65ZU7XY.js";
|
|
11
11
|
import {
|
|
12
12
|
downloadFile
|
|
13
13
|
} from "./chunk-WQ6ZXHFQ.js";
|
|
@@ -15,28 +15,93 @@ import {
|
|
|
15
15
|
findFFmpeg,
|
|
16
16
|
findFFprobe,
|
|
17
17
|
getFFmpegInstallHint
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-EYGWMHXV.js";
|
|
19
|
+
import {
|
|
20
|
+
registerBrowserSessionCleanup
|
|
21
|
+
} from "./chunk-TGFDRZTM.js";
|
|
19
22
|
import {
|
|
20
23
|
DEFAULT_VP9_CPU_USED,
|
|
21
24
|
SDR_RGB_TO_BT709_FILTER,
|
|
22
25
|
SDR_RGB_TO_TAGGED_BT709_FILTER,
|
|
23
26
|
renderProvenanceArgs
|
|
24
|
-
} from "./chunk-
|
|
27
|
+
} from "./chunk-I3PNZDKR.js";
|
|
25
28
|
import {
|
|
26
29
|
runCancellableProcess
|
|
27
|
-
} from "./chunk-
|
|
30
|
+
} from "./chunk-X6JUUQCM.js";
|
|
31
|
+
import {
|
|
32
|
+
processIsAlive
|
|
33
|
+
} from "./chunk-KGPLIH7B.js";
|
|
28
34
|
|
|
29
35
|
// src/background-removal/pipeline.ts
|
|
30
36
|
import { spawn } from "child_process";
|
|
31
37
|
import { randomUUID } from "crypto";
|
|
32
|
-
import { renameSync, rmSync } from "fs";
|
|
33
|
-
import { basename, dirname, extname, join as
|
|
38
|
+
import { renameSync, rmSync as rmSync2 } from "fs";
|
|
39
|
+
import { basename as basename2, dirname, extname, join as join3 } from "path";
|
|
40
|
+
|
|
41
|
+
// src/background-removal/coremlTemp.ts
|
|
42
|
+
import { mkdirSync, readdirSync, readFileSync, rmSync, writeFileSync } from "fs";
|
|
43
|
+
import { homedir, tmpdir } from "os";
|
|
44
|
+
import { basename, join } from "path";
|
|
45
|
+
var COMPILED_MODEL = /^onnxruntime-.*\.mlmodelc?$/;
|
|
46
|
+
var COREML_TEMP_MANIFESTS = join(
|
|
47
|
+
homedir(),
|
|
48
|
+
".cache",
|
|
49
|
+
"hyperframes",
|
|
50
|
+
"background-removal",
|
|
51
|
+
"coreml-temp"
|
|
52
|
+
);
|
|
53
|
+
var compiledModels = (tmp) => readdirSync(tmp).filter((name) => COMPILED_MODEL.test(name));
|
|
54
|
+
function readManifest(path) {
|
|
55
|
+
try {
|
|
56
|
+
const parsed = JSON.parse(readFileSync(path, "utf-8"));
|
|
57
|
+
return Number.isInteger(parsed.pid) && Array.isArray(parsed.dirs) ? parsed : void 0;
|
|
58
|
+
} catch {
|
|
59
|
+
return void 0;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
function sweepDeadCoreMlTemp(options = {}) {
|
|
63
|
+
const { manifests = COREML_TEMP_MANIFESTS, alive = processIsAlive } = options;
|
|
64
|
+
let names;
|
|
65
|
+
try {
|
|
66
|
+
names = readdirSync(manifests);
|
|
67
|
+
} catch {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
for (const name of names) {
|
|
71
|
+
const path = join(manifests, name);
|
|
72
|
+
const manifest = readManifest(path);
|
|
73
|
+
if (manifest && (manifest.pid === process.pid || alive(manifest.pid))) continue;
|
|
74
|
+
for (const dir of manifest?.dirs ?? []) {
|
|
75
|
+
if (basename(dir) === dir && COMPILED_MODEL.test(dir)) {
|
|
76
|
+
rmSync(join(manifest.tmp, dir), { recursive: true, force: true });
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
rmSync(path, { force: true });
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
function trackCoreMlTemp(options = {}) {
|
|
83
|
+
const { manifests = COREML_TEMP_MANIFESTS, tmp = tmpdir() } = options;
|
|
84
|
+
sweepDeadCoreMlTemp(options);
|
|
85
|
+
const before = new Set(compiledModels(tmp));
|
|
86
|
+
const path = join(manifests, `${process.pid}.json`);
|
|
87
|
+
return {
|
|
88
|
+
record() {
|
|
89
|
+
const dirs = compiledModels(tmp).filter((name) => !before.has(name));
|
|
90
|
+
mkdirSync(manifests, { recursive: true });
|
|
91
|
+
const manifest = { pid: process.pid, tmp, dirs };
|
|
92
|
+
writeFileSync(path, JSON.stringify(manifest));
|
|
93
|
+
},
|
|
94
|
+
forget() {
|
|
95
|
+
rmSync(path, { force: true });
|
|
96
|
+
}
|
|
97
|
+
};
|
|
98
|
+
}
|
|
34
99
|
|
|
35
100
|
// src/background-removal/manager.ts
|
|
36
|
-
import { existsSync, mkdirSync } from "fs";
|
|
37
|
-
import { homedir, platform, arch } from "os";
|
|
38
|
-
import { join } from "path";
|
|
39
|
-
var MODELS_DIR =
|
|
101
|
+
import { existsSync, mkdirSync as mkdirSync2 } from "fs";
|
|
102
|
+
import { homedir as homedir2, platform, arch } from "os";
|
|
103
|
+
import { join as join2 } from "path";
|
|
104
|
+
var MODELS_DIR = join2(homedir2(), ".cache", "hyperframes", "background-removal", "models");
|
|
40
105
|
var DEFAULT_MODEL = "u2net_human_seg";
|
|
41
106
|
var MODEL_URLS = {
|
|
42
107
|
u2net_human_seg: "https://github.com/danielgatis/rembg/releases/download/v0.0.0/u2net_human_seg.onnx"
|
|
@@ -85,12 +150,12 @@ function listAvailableProviders() {
|
|
|
85
150
|
return out;
|
|
86
151
|
}
|
|
87
152
|
function modelPath(model = DEFAULT_MODEL) {
|
|
88
|
-
return
|
|
153
|
+
return join2(MODELS_DIR, `${model}.onnx`);
|
|
89
154
|
}
|
|
90
155
|
async function ensureModel(model = DEFAULT_MODEL, options) {
|
|
91
156
|
const dest = modelPath(model);
|
|
92
157
|
if (existsSync(dest)) return dest;
|
|
93
|
-
|
|
158
|
+
mkdirSync2(MODELS_DIR, { recursive: true });
|
|
94
159
|
options?.onProgress?.(`Downloading ${model} weights (~168 MB)...`);
|
|
95
160
|
await downloadFile(MODEL_URLS[model], dest);
|
|
96
161
|
if (!existsSync(dest)) {
|
|
@@ -117,6 +182,8 @@ async function createSession(options = {}) {
|
|
|
117
182
|
executionProviders: providers,
|
|
118
183
|
graphOptimizationLevel: "all"
|
|
119
184
|
});
|
|
185
|
+
const coreMlTemp = choice.label === "CoreML" ? trackCoreMlTemp() : void 0;
|
|
186
|
+
const unregister = coreMlTemp && registerBrowserSessionCleanup(async () => session?.release());
|
|
120
187
|
let session;
|
|
121
188
|
let providerUsed = choice.label;
|
|
122
189
|
try {
|
|
@@ -126,8 +193,13 @@ async function createSession(options = {}) {
|
|
|
126
193
|
options.onProgress?.(
|
|
127
194
|
`${choice.label} provider failed (${err.message}); falling back to CPU.`
|
|
128
195
|
);
|
|
129
|
-
session = await tryCreate(["cpu"])
|
|
196
|
+
session = await tryCreate(["cpu"]).catch((error) => {
|
|
197
|
+
unregister?.();
|
|
198
|
+
throw error;
|
|
199
|
+
});
|
|
130
200
|
providerUsed = "CPU";
|
|
201
|
+
} finally {
|
|
202
|
+
coreMlTemp?.record();
|
|
131
203
|
}
|
|
132
204
|
const inputName = session.inputNames[0];
|
|
133
205
|
const outputName = session.outputNames[0];
|
|
@@ -184,7 +256,9 @@ async function createSession(options = {}) {
|
|
|
184
256
|
);
|
|
185
257
|
},
|
|
186
258
|
async close() {
|
|
259
|
+
unregister?.();
|
|
187
260
|
await session.release();
|
|
261
|
+
coreMlTemp?.forget();
|
|
188
262
|
}
|
|
189
263
|
};
|
|
190
264
|
}
|
|
@@ -317,7 +391,7 @@ async function decoderTransposesDimensions(inputPath) {
|
|
|
317
391
|
}
|
|
318
392
|
async function probeMedia(inputPath) {
|
|
319
393
|
const isImage = inferInputKind(inputPath) === "image";
|
|
320
|
-
const engine = await import("./src-
|
|
394
|
+
const engine = await import("./src-PX3VIS7K.js");
|
|
321
395
|
const meta = await engine.extractMediaMetadata(inputPath);
|
|
322
396
|
if (isImage) {
|
|
323
397
|
return { width: meta.width, height: meta.height, fps: 0, frameCount: 1 };
|
|
@@ -491,12 +565,12 @@ async function render(options) {
|
|
|
491
565
|
};
|
|
492
566
|
} finally {
|
|
493
567
|
await session.close();
|
|
494
|
-
|
|
495
|
-
if (background)
|
|
568
|
+
rmSync2(output, { force: true, maxRetries: 3 });
|
|
569
|
+
if (background) rmSync2(background, { force: true, maxRetries: 3 });
|
|
496
570
|
}
|
|
497
571
|
}
|
|
498
572
|
function tempBeside(path) {
|
|
499
|
-
return
|
|
573
|
+
return join3(dirname(path), `.tmp-${randomUUID()}-${basename2(path)}`);
|
|
500
574
|
}
|
|
501
575
|
var RECENT_WINDOW = 30;
|
|
502
576
|
function spawnFfmpeg(ffmpegPath, args, label, stdio) {
|
|
@@ -8,14 +8,14 @@ import {
|
|
|
8
8
|
DEFAULT_REGISTRY_URL,
|
|
9
9
|
fetchItemFile,
|
|
10
10
|
validRegistryItem
|
|
11
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-5IWRGVAX.js";
|
|
12
12
|
import {
|
|
13
13
|
publishRegistryFile,
|
|
14
14
|
registryTargetPath
|
|
15
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-K4FVGVA6.js";
|
|
16
16
|
import {
|
|
17
17
|
validateVariables
|
|
18
|
-
} from "./chunk-
|
|
18
|
+
} from "./chunk-5ZJGEQGS.js";
|
|
19
19
|
import {
|
|
20
20
|
realProjectRoot
|
|
21
21
|
} from "./chunk-OFQWTKPW.js";
|