hyperframes 0.8.148 → 0.8.150
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-JAHZJYB7.js → add-3ZIFEN2U.js} +19 -19
- package/dist/{animatedGifPrep-HV4ZFVPV.js → animatedGifPrep-77LPFLKJ.js} +6 -6
- package/dist/api.d.ts +209 -0
- package/dist/api.js +75 -0
- package/dist/{asset-SJA7DT6Q.js → asset-EYSZEHM6.js} +3 -3
- package/dist/{assetCataloger-JJQ4JW2P.js → assetCataloger-KX3HD7ZI.js} +3 -3
- package/dist/{auth-RR3OIXLH.js → auth-L6IWNRXY.js} +4 -4
- package/dist/{autoUpdate-KLDV2XWV.js → autoUpdate-2O3HZB65.js} +2 -2
- package/dist/{backgroundChecks-OVL3E2RK.js → backgroundChecks-BH2LMJYE.js} +3 -3
- package/dist/backgroundChecksWorker.js +3 -3
- package/dist/{batchRender-2SAJGOHU.js → batchRender-ZBKAYLWU.js} +7 -7
- package/dist/{beats-HTYS42CC.js → beats-IVLF2566.js} +22 -22
- package/dist/{benchmark-CAHP4GLB.js → benchmark-SYZFW2G7.js} +19 -19
- package/dist/{browser-M7I67IGX.js → browser-OSW3L25S.js} +14 -13
- package/dist/{bundleWithLocalizedFonts-EKRXJBXU.js → bundleWithLocalizedFonts-I4CWOXLK.js} +5 -5
- package/dist/{capture-P5SNZ6HL.js → capture-AZOQ57TM.js} +2 -2
- package/dist/{capture-YZQZ5LKM.js → capture-V5ICGSVJ.js} +20 -20
- package/dist/{catalog-LREZPRJS.js → catalog-VBJOA2Y5.js} +35 -35
- package/dist/{catch-up-2MLRYAYP.js → catch-up-TKSEDNJK.js} +13 -13
- package/dist/{check-BH6NUR22.js → check-3HFISKDB.js} +50 -50
- package/dist/{checkBrowser-BM6JBFST.js → checkBrowser-MXBDNZJB.js} +38 -38
- package/dist/chunk-2KAL22B5.js +26 -0
- package/dist/{chunk-X2G54Y2V.js → chunk-3UAIVF4L.js} +4 -4
- package/dist/{chunk-KQHJKJ3V.js → chunk-423DJVX2.js} +1 -1
- package/dist/{chunk-UTBQSOEC.js → chunk-4WFNTWKZ.js} +3 -3
- package/dist/{chunk-VC7JBNPS.js → chunk-5NAYNDBT.js} +477 -68
- package/dist/{chunk-QX26JK43.js → chunk-6KWA3XPS.js} +10 -10
- package/dist/{chunk-AY2BONTF.js → chunk-6NPFJ255.js} +1 -1
- package/dist/{chunk-ZK3BQXHC.js → chunk-6QB7F2II.js} +1 -1
- package/dist/{chunk-54TV77W5.js → chunk-6SFPQ2RZ.js} +6 -8
- package/dist/{chunk-YQK445YQ.js → chunk-73RBX2E7.js} +2 -2
- package/dist/chunk-7E4VHPKJ.js +329 -0
- package/dist/{chunk-A6S35NYA.js → chunk-7IEGPJ4P.js} +1 -1
- package/dist/{chunk-NT7EK6ET.js → chunk-7JTFPUMA.js} +1 -1
- package/dist/{chunk-VHJPGKUW.js → chunk-A6ZO4BX7.js} +2 -2
- package/dist/{chunk-ASEJ2FBO.js → chunk-AFRXL75S.js} +1 -1
- package/dist/{chunk-QIJLIULK.js → chunk-AKYQGZLU.js} +2 -2
- package/dist/{chunk-4S4VUXW3.js → chunk-AXPNVC3N.js} +1 -1
- package/dist/{chunk-A4Q7W4LV.js → chunk-B3XLIBFL.js} +4 -2
- package/dist/{chunk-PR7QQBSC.js → chunk-BLRJKBKP.js} +1 -1
- package/dist/chunk-CEND6BLF.js +3795 -0
- package/dist/{chunk-KVGDFUVO.js → chunk-CZQLCBWY.js} +26 -13
- package/dist/{chunk-6IIGT7BX.js → chunk-DNZMBQTH.js} +1 -1
- package/dist/{chunk-ELACLQPC.js → chunk-DOVJRUFM.js} +1 -1
- package/dist/{chunk-SYUGVPYH.js → chunk-DUUFDLC4.js} +1 -1
- package/dist/{chunk-KMJLHHBF.js → chunk-EL5QVJEG.js} +1 -1
- package/dist/{chunk-JN4EK6MC.js → chunk-F2RLIE7P.js} +17 -17
- package/dist/{chunk-TLGJRK6Q.js → chunk-FN6KAS7A.js} +10 -10
- package/dist/{chunk-24GKVAEE.js → chunk-FPAT5HTI.js} +15 -15
- package/dist/chunk-HU2SPFNG.js +103 -0
- package/dist/{chunk-KQESKXAC.js → chunk-I6DATIHC.js} +2 -2
- package/dist/{chunk-4OA4LDTU.js → chunk-IYLHJV34.js} +1 -1
- package/dist/{chunk-KBB4RG6F.js → chunk-JZIEZCQM.js} +9 -2
- package/dist/chunk-KGPLIH7B.js +127 -0
- package/dist/{chunk-B4P5VDFQ.js → chunk-KMAAOHLO.js} +1 -1
- package/dist/chunk-LW5VFBSY.js +56 -0
- package/dist/{chunk-66SAATRI.js → chunk-M5B42RL5.js} +9 -9
- package/dist/{chunk-Q2Y5OZCY.js → chunk-M6UDJ2E7.js} +2 -2
- package/dist/{chunk-URYAKNQ2.js → chunk-NFQY7EIC.js} +1 -1
- package/dist/{chunk-S7E2I3HT.js → chunk-O4DC5CHF.js} +1 -1
- package/dist/{chunk-K35E45SI.js → chunk-OQ7XMM3S.js} +1 -1
- package/dist/{chunk-AHBYQRGI.js → chunk-PCWOSS7G.js} +1 -1
- package/dist/{chunk-BHVFTYSI.js → chunk-PO2SDVQA.js} +4 -1
- package/dist/{chunk-K4RIT6PX.js → chunk-R5A7454P.js} +2 -2
- package/dist/{chunk-VXM4BH23.js → chunk-RW7NLGPD.js} +121 -47
- package/dist/{chunk-BB3HJLHD.js → chunk-S5F26DUL.js} +3 -3
- package/dist/{chunk-OLENCLFE.js → chunk-TZPZE5PS.js} +81 -8
- package/dist/{chunk-74JDPWQ3.js → chunk-UAIUVPZE.js} +9 -9
- package/dist/{chunk-XIL7KT5Q.js → chunk-UJB7356Y.js} +6 -6
- package/dist/{chunk-YA62XGXS.js → chunk-UJKQWGFF.js} +1 -1
- package/dist/{chunk-O3EALI4M.js → chunk-UQYQ7TBA.js} +4 -4
- package/dist/{chunk-C24LU5XD.js → chunk-UVVI2NJQ.js} +12 -12
- package/dist/{normalize-U3SL5VG3.js → chunk-VHZ6DL3M.js} +3 -3
- package/dist/{chunk-CNEYCO24.js → chunk-VQ7YIURZ.js} +13 -13
- package/dist/{chunk-62RUQJ5J.js → chunk-WLIUULZQ.js} +20 -8
- package/dist/{chunk-RKBES4XP.js → chunk-XANZ4R4P.js} +88 -28
- package/dist/{chunk-BYSBRF24.js → chunk-XPQSL5VS.js} +5 -120
- package/dist/{chunk-SP6XL3NP.js → chunk-XQMEGSHG.js} +1 -1
- package/dist/{chunk-ZFN6GQU4.js → chunk-XXPYZBZ3.js} +1 -1
- package/dist/{chunk-4SFGME7K.js → chunk-YJDB4FLT.js} +1 -1
- package/dist/{chunk-QATWIE4K.js → chunk-YU2QRNWN.js} +2 -2
- package/dist/{chunk-6VKQ5JT3.js → chunk-Z6WZDGCS.js} +2 -2
- package/dist/{chunk-2HWB4TCI.js → chunk-ZNHAJCEA.js} +1 -1
- package/dist/{clean-K7GYTLQE.js → clean-7HU7S7DT.js} +34 -33
- package/dist/cli.js +55 -55
- package/dist/{cloud-I3J5HTN7.js → cloud-HAXHBO25.js} +4 -4
- package/dist/{cloudrun-MJQ363PB.js → cloudrun-A3PIJ6DX.js} +7 -7
- package/dist/{compare-LHW6NEFR.js → compare-6IPSQMSM.js} +37 -37
- package/dist/{compiler-NPD3MYMO.js → compiler-UQP2VXN6.js} +3 -3
- package/dist/{component-LTPK2D3K.js → component-FF3AU24M.js} +4 -4
- package/dist/{compositions-QGEHXGIL.js → compositions-JSH4MZXB.js} +20 -20
- package/dist/{delete-ATNRBUDJ.js → delete-G763SW64.js} +11 -11
- package/dist/{dist-CUIR3GFX.js → dist-Z7Q3JS7K.js} +3 -3
- package/dist/{doctor-6B76R5BJ.js → doctor-WZB6WMBY.js} +21 -20
- package/dist/{events-BLABPRD5.js → events-MUWJJCC7.js} +6 -6
- package/dist/{events-33GOPHSS.js → events-T4YFQC5G.js} +8 -8
- package/dist/{feedback-HLXEG7RT.js → feedback-AUTHQNN2.js} +25 -25
- package/dist/{ffmpeg-5V4FP3R6.js → ffmpeg-TZB5WAYE.js} +3 -2
- package/dist/{figma-T6W7H23L.js → figma-NBG6WBI7.js} +3 -3
- package/dist/fontLocalizeCli.js +11 -11
- package/dist/{get-UDMLOTKJ.js → get-OXBJLKLV.js} +11 -11
- package/dist/{gpuPolicy-M2JZGGVW.js → gpuPolicy-HBCCEQUS.js} +6 -6
- package/dist/{grade-compare-P4CHFVBR.js → grade-compare-2LX4FDH7.js} +42 -41
- package/dist/{help-4MW6L6YB.js → help-LJI46EDO.js} +3 -3
- package/dist/{history-336VM6SH.js → history-MFKAQEHU.js} +15 -15
- package/dist/hyperframe-runtime.js +65 -58
- package/dist/hyperframe.manifest.json +1 -1
- package/dist/hyperframe.runtime.iife.js +65 -58
- package/dist/hyperframes-player.global.js +1 -1
- package/dist/{info-FPMIDMD5.js → info-D6Y5O2QE.js} +18 -18
- package/dist/{init-IWM4PWLO.js → init-47NZPEBI.js} +53 -52
- package/dist/{inspect-IIG7756C.js → inspect-U5UXJK5D.js} +34 -34
- package/dist/{installer-Q4MMZKLA.js → installer-AW7VFVTQ.js} +5 -5
- package/dist/{keyframes-TWO4BXBA.js → keyframes-5G334NWB.js} +16 -16
- package/dist/{lambda-2JB2QUK2.js → lambda-GASGXN3A.js} +9 -9
- package/dist/{layout-TPKEKFQQ.js → layout-OXAQFLJS.js} +34 -34
- package/dist/{lint-H3KL7KSX.js → lint-F36QFSNF.js} +19 -19
- package/dist/{list-LYPO4KRE.js → list-TR6QCI53.js} +11 -11
- package/dist/{login-SQQWKWTD.js → login-6LA2RWTC.js} +9 -9
- package/dist/{logout-B4KS4A7S.js → logout-DKJANASY.js} +3 -3
- package/dist/{manager-5ORDVWJB.js → manager-ES2UFT4X.js} +6 -4
- package/dist/{manager-BPSR6D3V.js → manager-GWU5J6RJ.js} +3 -2
- package/dist/{media-treatment-KSRINVUA.js → media-treatment-BOHYDWVY.js} +28 -27
- package/dist/{models-WUBF6GDB.js → models-6GW5Q3IW.js} +20 -18
- package/dist/{motionShot-STKG4KYQ.js → motionShot-O7AOMPUN.js} +14 -14
- package/dist/normalize-4UDISLPL.js +24 -0
- package/dist/{normalize-audio-CA47XZ4I.js → normalize-audio-UO5B4O76.js} +17 -17
- package/dist/{open-B5WYEM3Z.js → open-JV2EHVKM.js} +13 -13
- package/dist/{parakeetRunner-JBK2JPEH.js → parakeetRunner-23DZUF6G.js} +18 -28
- package/dist/{pipeline-FEAAD2RJ.js → pipeline-KTICSIK7.js} +10 -10
- package/dist/{play-2LC5XRM6.js → play-CMUYPXBC.js} +37 -37
- package/dist/{preflight-ONF5AJNO.js → preflight-JOD4OXGC.js} +5 -4
- package/dist/{present-XKYF3VGC.js → present-ZDT5FM2H.js} +27 -27
- package/dist/{preview-WDPZRHE5.js → preview-ASHLGKDD.js} +40 -38
- package/dist/{producer-343ENLAM.js → producer-FFH2KUAZ.js} +1 -1
- package/dist/{projectConfig-YXKU3CTB.js → projectConfig-FHIAOPKW.js} +7 -7
- package/dist/{publication-ODXP3JI7.js → publication-WO5ZXURT.js} +3 -3
- package/dist/{publish-3OYXNY44.js → publish-QWO2W7FB.js} +23 -23
- package/dist/{refresh-PVHBEABE.js → refresh-MGCVWX56.js} +3 -3
- package/dist/{remove-background-F6QTJIPZ.js → remove-background-BO5MQR25.js} +39 -35
- package/dist/{render-SC77I7FT.js → render-HS3YOLSD.js} +7 -7
- package/dist/{render-QQ7NUREG.js → render-SDHFXL3Y.js} +62 -61
- package/dist/{render-JKB6GZDB.js → render-XTJKGT3G.js} +31 -31
- package/dist/{render-batch-4F44JFAB.js → render-batch-J64AJHQY.js} +7 -7
- package/dist/renderSetupWorker.js +4 -3
- package/dist/{resolver-7MYXNEAX.js → resolver-IHNWMDJA.js} +5 -5
- package/dist/{sherpa-FOXB4XBN.js → sherpa-FXBBYMDR.js} +16 -15
- package/dist/sherpaWorker.js +3 -1
- package/dist/{skills-GG756RCG.js → skills-ALLSN7TB.js} +15 -15
- package/dist/{skillsUpdateCheck-N2LDCNAS.js → skillsUpdateCheck-EIT5NWM6.js} +3 -3
- package/dist/{snapshot-2LDOY65W.js → snapshot-Y3I76OIZ.js} +56 -55
- package/dist/{src-VMTHSARJ.js → src-7V6LBC56.js} +7 -5
- package/dist/{src-PTIV7IVV.js → src-S5IZVJUX.js} +7 -7
- package/dist/{staticProjectServer-QBB6WUAY.js → staticProjectServer-QLWWGHZE.js} +16 -16
- package/dist/{status-PTKNQD2E.js → status-NBRMGL7D.js} +5 -5
- package/dist/studio/assets/{hyperframes-player-BBBg-uvu.js → hyperframes-player-kup62bDR.js} +1 -1
- package/dist/studio/assets/{index-BXJLeCqB.js → index-B8BBYY8L.js} +1 -1
- package/dist/studio/assets/{index-BJIpZeuk.js → index-CS_m0TkX.js} +131 -131
- package/dist/studio/assets/{index-DARhiE_i.js → index-DQ5jGodF.js} +1 -1
- package/dist/studio/index.html +1 -1
- package/dist/{studio-api-VPTZF2AW.js → studio-api-UBFLZ3DA.js} +9 -9
- package/dist/{studioServer-VZKX2MG7.js → studioServer-REOVCIFP.js} +72 -71
- package/dist/{synthesize-UCI4X5O7.js → synthesize-22B7L5GX.js} +6 -6
- package/dist/{telemetry-76XND6XK.js → telemetry-C3GDIXHO.js} +8 -8
- package/dist/{timeline-UJLTA4AX.js → timeline-H42EGLMT.js} +26 -26
- package/dist/{tokens-VMWANYJY.js → tokens-2K7ISTKV.js} +3 -3
- package/dist/transcribe-DVM7UFZZ.js +332 -0
- package/dist/{transcribe-JNOG667L.js → transcribe-NUPASAUP.js} +14 -13
- package/dist/{tts-B6AHFQEO.js → tts-QSAQZVEZ.js} +3 -3
- package/dist/{updateCheck-WI3HYM72.js → updateCheck-3RWFSEZD.js} +2 -2
- package/dist/{upgrade-52RIOKFX.js → upgrade-YKKL36N7.js} +5 -5
- package/dist/{urlDownloader-352AY25I.js → urlDownloader-6JNJYLPN.js} +5 -5
- package/dist/{validate-MJVNR7YY.js → validate-Z7KQT7GO.js} +27 -27
- package/dist/{video-72VNEQEI.js → video-EXL2JDSL.js} +9 -9
- package/package.json +8 -1
- package/dist/chunk-3WD4JNMU.js +0 -3795
- package/dist/chunk-6IHWCZ3W.js +0 -54
- package/dist/chunk-SQLK7SJL.js +0 -88
- package/dist/manager-RFZNG5YT.js +0 -30
- package/dist/renderCancellation-7OEBNE2L.js +0 -43
- package/dist/transcribe-FD7A2SH3.js +0 -466
- package/dist/{chunk-DKSDVDXG.js → chunk-NAMGMP3R.js} +3 -3
- package/dist/{policies-4FEXMXPK.js → policies-DCSIM4AB.js} +3 -3
- package/dist/{screenshotCapture-3JXXUZND.js → screenshotCapture-TEUIWXWN.js} +3 -3
- package/dist/{telemetry-W5AKPI4R.js → telemetry-CQYHCCPL.js} +3 -3
|
@@ -4,29 +4,29 @@ 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
|
-
emitWords
|
|
9
|
-
} from "./chunk-6IHWCZ3W.js";
|
|
10
7
|
import {
|
|
11
8
|
stoppedByCancelSignal
|
|
12
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-4WFNTWKZ.js";
|
|
13
10
|
import {
|
|
14
11
|
DEFAULT_MODEL,
|
|
15
12
|
ensureModel,
|
|
16
13
|
ensureWhisper,
|
|
17
14
|
hasFFmpeg
|
|
18
|
-
} from "./chunk-
|
|
15
|
+
} from "./chunk-CZQLCBWY.js";
|
|
19
16
|
import {
|
|
20
17
|
findFFmpeg,
|
|
21
18
|
findFFprobe,
|
|
22
19
|
getFFmpegInstallHint
|
|
23
|
-
} from "./chunk-
|
|
20
|
+
} from "./chunk-DUUFDLC4.js";
|
|
24
21
|
import {
|
|
25
22
|
findWavChunk
|
|
26
23
|
} from "./chunk-UOFAE5RF.js";
|
|
27
24
|
import {
|
|
28
25
|
TRANSCRIPT_FILE
|
|
29
26
|
} from "./chunk-IR35BCLK.js";
|
|
27
|
+
import {
|
|
28
|
+
stoppableExecFile
|
|
29
|
+
} from "./chunk-HU2SPFNG.js";
|
|
30
30
|
|
|
31
31
|
// src/whisper/transcribe.ts
|
|
32
32
|
import { execFile, execFileSync } from "child_process";
|
|
@@ -36,6 +36,60 @@ import { existsSync, readFileSync, mkdirSync, rmSync, statSync, unlinkSync } fro
|
|
|
36
36
|
import { basename, join, extname } from "path";
|
|
37
37
|
import { tmpdir } from "os";
|
|
38
38
|
import { randomUUID } from "crypto";
|
|
39
|
+
|
|
40
|
+
// src/whisper/modelForLanguage.ts
|
|
41
|
+
function initialModelForLanguage(model, language) {
|
|
42
|
+
const baseLanguage = language?.trim().toLowerCase().split(/[-_]/, 1)[0];
|
|
43
|
+
if (baseLanguage && baseLanguage !== "en" && model.endsWith(".en")) {
|
|
44
|
+
return model.slice(0, -3);
|
|
45
|
+
}
|
|
46
|
+
return model;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
// src/whisper/progress.ts
|
|
50
|
+
var DESKTOP_MAX_LINE_BYTES = 16e3;
|
|
51
|
+
function emitWords(onEvent, model, words, through) {
|
|
52
|
+
const empty = Buffer.byteLength(JSON.stringify({ type: "words", model, words: [], through })) + 1;
|
|
53
|
+
let chunk = [];
|
|
54
|
+
let bytes = empty;
|
|
55
|
+
for (const word of words) {
|
|
56
|
+
const size = Buffer.byteLength(JSON.stringify(word)) + 1;
|
|
57
|
+
if (chunk.length > 0 && bytes + size > DESKTOP_MAX_LINE_BYTES) {
|
|
58
|
+
onEvent({ type: "words", model, words: chunk, through: chunk.at(-1).end });
|
|
59
|
+
chunk = [];
|
|
60
|
+
bytes = empty;
|
|
61
|
+
}
|
|
62
|
+
chunk.push(word);
|
|
63
|
+
bytes += size;
|
|
64
|
+
}
|
|
65
|
+
onEvent({ type: "words", model, words: chunk, through });
|
|
66
|
+
}
|
|
67
|
+
function createProgressWriter(stream) {
|
|
68
|
+
let blocked = false;
|
|
69
|
+
const pending = [];
|
|
70
|
+
const write = (event) => {
|
|
71
|
+
if (blocked) {
|
|
72
|
+
const previous = pending.at(-1);
|
|
73
|
+
if (event.type === "progress" && event.phase === "download" && previous?.type === "progress" && previous.phase === "download" && previous.model === event.model) {
|
|
74
|
+
pending[pending.length - 1] = event;
|
|
75
|
+
} else {
|
|
76
|
+
pending.push(event);
|
|
77
|
+
}
|
|
78
|
+
return;
|
|
79
|
+
}
|
|
80
|
+
blocked = !stream.write(`${JSON.stringify(event)}
|
|
81
|
+
`);
|
|
82
|
+
if (blocked) {
|
|
83
|
+
stream.once("drain", () => {
|
|
84
|
+
blocked = false;
|
|
85
|
+
while (!blocked && pending.length > 0) write(pending.shift());
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
};
|
|
89
|
+
return write;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
// src/whisper/transcribe.ts
|
|
39
93
|
var WHISPER_TIMEOUT_FLOOR_MS = 3e5;
|
|
40
94
|
var WHISPER_TIMEOUT_PER_AUDIO_SECOND_MS = 1e4;
|
|
41
95
|
var WHISPER_TIMEOUT_CAP_MS = 432e5;
|
|
@@ -175,15 +229,17 @@ function isVideoFile(filePath) {
|
|
|
175
229
|
function tempWavPath() {
|
|
176
230
|
return join(tmpdir(), `hyperframes-audio-${process.pid}-${randomUUID()}.wav`);
|
|
177
231
|
}
|
|
178
|
-
function runFfmpeg(ffmpegPath, args, output, timeout) {
|
|
232
|
+
async function runFfmpeg(ffmpegPath, args, output, timeout, signal) {
|
|
179
233
|
try {
|
|
180
|
-
|
|
234
|
+
await stoppableExecFile(ffmpegPath, ["-nostats", "-hide_banner", ...args, "-y", output], {
|
|
181
235
|
stdio: ["ignore", "ignore", "pipe"],
|
|
182
236
|
maxBuffer: 64 * 1024 * 1024,
|
|
183
|
-
timeout
|
|
237
|
+
timeout,
|
|
238
|
+
signal
|
|
184
239
|
});
|
|
185
240
|
} catch (err) {
|
|
186
241
|
rmSync(output, { force: true });
|
|
242
|
+
if (signal?.aborted) throw err;
|
|
187
243
|
const stop = err;
|
|
188
244
|
if (stop.code) throw err;
|
|
189
245
|
const said = String(stop.stderr ?? "").trim();
|
|
@@ -193,7 +249,7 @@ function runFfmpeg(ffmpegPath, args, output, timeout) {
|
|
|
193
249
|
throw Object.assign(failure, { cancelled, stderr: said });
|
|
194
250
|
}
|
|
195
251
|
}
|
|
196
|
-
function extractAudio(videoPath) {
|
|
252
|
+
async function extractAudio(videoPath, signal) {
|
|
197
253
|
const ffmpegPath = findFFmpeg();
|
|
198
254
|
if (!ffmpegPath) {
|
|
199
255
|
throw new Error(
|
|
@@ -201,11 +257,12 @@ function extractAudio(videoPath) {
|
|
|
201
257
|
);
|
|
202
258
|
}
|
|
203
259
|
const wavPath = tempWavPath();
|
|
204
|
-
runFfmpeg(
|
|
260
|
+
await runFfmpeg(
|
|
205
261
|
ffmpegPath,
|
|
206
262
|
["-i", videoPath, "-vn", "-ar", "16000", "-ac", "1", "-f", "wav"],
|
|
207
263
|
wavPath,
|
|
208
|
-
resolveAudioPreparationTimeoutMs(getMediaDurationSeconds(videoPath))
|
|
264
|
+
resolveAudioPreparationTimeoutMs(getMediaDurationSeconds(videoPath)),
|
|
265
|
+
signal
|
|
209
266
|
);
|
|
210
267
|
return wavPath;
|
|
211
268
|
}
|
|
@@ -227,7 +284,7 @@ function isWav16kMono(filePath) {
|
|
|
227
284
|
return false;
|
|
228
285
|
}
|
|
229
286
|
}
|
|
230
|
-
function prepareAudio(audioPath) {
|
|
287
|
+
async function prepareAudio(audioPath, signal) {
|
|
231
288
|
if (extname(audioPath).toLowerCase() === ".wav" && isWav16kMono(audioPath)) {
|
|
232
289
|
return audioPath;
|
|
233
290
|
}
|
|
@@ -236,28 +293,22 @@ function prepareAudio(audioPath) {
|
|
|
236
293
|
throw new Error(`ffmpeg is required to prepare audio. Install: ${getFFmpegInstallHint()}`);
|
|
237
294
|
}
|
|
238
295
|
const wavPath = tempWavPath();
|
|
239
|
-
runFfmpeg(
|
|
296
|
+
await runFfmpeg(
|
|
240
297
|
ffmpegPath,
|
|
241
298
|
["-i", audioPath, "-ar", "16000", "-ac", "1", "-f", "wav"],
|
|
242
299
|
wavPath,
|
|
243
|
-
resolveAudioPreparationTimeoutMs(getMediaDurationSeconds(audioPath))
|
|
300
|
+
resolveAudioPreparationTimeoutMs(getMediaDurationSeconds(audioPath)),
|
|
301
|
+
signal
|
|
244
302
|
);
|
|
245
303
|
return wavPath;
|
|
246
304
|
}
|
|
247
305
|
function dtwPresetForModel(model) {
|
|
248
306
|
return model.replace(/-/g, ".");
|
|
249
307
|
}
|
|
250
|
-
function
|
|
251
|
-
const baseLanguage = language?.trim().toLowerCase().split(/[-_]/, 1)[0];
|
|
252
|
-
if (baseLanguage && baseLanguage !== "en" && model.endsWith(".en")) {
|
|
253
|
-
return model.slice(0, -3);
|
|
254
|
-
}
|
|
255
|
-
return model;
|
|
256
|
-
}
|
|
257
|
-
function prepareWav(inputPath, onProgress) {
|
|
308
|
+
async function prepareWav(inputPath, onProgress, signal) {
|
|
258
309
|
if (isAudioFile(inputPath)) {
|
|
259
310
|
onProgress?.("Preparing audio...");
|
|
260
|
-
return prepareAudio(inputPath);
|
|
311
|
+
return prepareAudio(inputPath, signal);
|
|
261
312
|
}
|
|
262
313
|
if (isVideoFile(inputPath)) {
|
|
263
314
|
if (!hasFFmpeg()) {
|
|
@@ -266,19 +317,24 @@ function prepareWav(inputPath, onProgress) {
|
|
|
266
317
|
);
|
|
267
318
|
}
|
|
268
319
|
onProgress?.("Extracting audio from video...");
|
|
269
|
-
return extractAudio(inputPath);
|
|
320
|
+
return extractAudio(inputPath, signal);
|
|
270
321
|
}
|
|
271
322
|
throw new Error(`Unsupported file type: ${extname(inputPath).toLowerCase()}`);
|
|
272
323
|
}
|
|
273
324
|
async function transcribe(inputPath, outputDir, options) {
|
|
274
325
|
const model = initialModelForLanguage(options?.model ?? DEFAULT_MODEL, options?.language);
|
|
326
|
+
const signal = options?.signal;
|
|
327
|
+
signal?.throwIfAborted();
|
|
275
328
|
options?.onProgress?.("Checking whisper...");
|
|
276
329
|
const whisper = await ensureWhisper({
|
|
277
330
|
onProgress: options?.onProgress,
|
|
278
|
-
installRuntime: options?.installRuntime
|
|
331
|
+
installRuntime: options?.installRuntime,
|
|
332
|
+
signal
|
|
279
333
|
});
|
|
334
|
+
signal?.throwIfAborted();
|
|
280
335
|
options?.onProgress?.("Checking model...");
|
|
281
336
|
const modelPath = await ensureModel(model, {
|
|
337
|
+
signal,
|
|
282
338
|
onProgress: options?.onProgress,
|
|
283
339
|
onDownloadProgress: options?.onEvent ? (receivedBytes, totalBytes) => options.onEvent?.({
|
|
284
340
|
type: "progress",
|
|
@@ -288,7 +344,9 @@ async function transcribe(inputPath, outputDir, options) {
|
|
|
288
344
|
totalBytes
|
|
289
345
|
}) : void 0
|
|
290
346
|
});
|
|
291
|
-
|
|
347
|
+
signal?.throwIfAborted();
|
|
348
|
+
const wavPath = await prepareWav(inputPath, options?.onProgress, signal);
|
|
349
|
+
signal?.throwIfAborted();
|
|
292
350
|
const automaticLanguage = options?.language === void 0 && !model.endsWith(".en");
|
|
293
351
|
const language = options?.language ?? (automaticLanguage ? "auto" : "en");
|
|
294
352
|
options?.onProgress?.("Transcribing...");
|
|
@@ -436,6 +494,9 @@ function wrapWhisperTimeoutError(err, options) {
|
|
|
436
494
|
}
|
|
437
495
|
|
|
438
496
|
export {
|
|
497
|
+
initialModelForLanguage,
|
|
498
|
+
emitWords,
|
|
499
|
+
createProgressWriter,
|
|
439
500
|
whisperModelSlowdownFactor,
|
|
440
501
|
resolveWhisperTimeoutMs,
|
|
441
502
|
resolveAudioPreparationTimeoutMs,
|
|
@@ -444,7 +505,6 @@ export {
|
|
|
444
505
|
detectSpeechOnset,
|
|
445
506
|
isPcm16kMono,
|
|
446
507
|
dtwPresetForModel,
|
|
447
|
-
initialModelForLanguage,
|
|
448
508
|
prepareWav,
|
|
449
509
|
transcribe,
|
|
450
510
|
isWhisperTimeoutError,
|
|
@@ -7,122 +7,9 @@ var __dirname = __hf_dirname(__filename);
|
|
|
7
7
|
import {
|
|
8
8
|
normalizeErrorMessage
|
|
9
9
|
} from "./chunk-KNU5COPB.js";
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
import { readdirSync, readFileSync } from "fs";
|
|
14
|
-
function processIsAlive(pid) {
|
|
15
|
-
try {
|
|
16
|
-
process.kill(pid, 0);
|
|
17
|
-
return true;
|
|
18
|
-
} catch (error) {
|
|
19
|
-
return error?.code !== "ESRCH";
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
function processGroupIsAlive(pid) {
|
|
23
|
-
if (process.platform === "linux") {
|
|
24
|
-
try {
|
|
25
|
-
return readdirSync("/proc").some((entry) => {
|
|
26
|
-
if (!/^\d+$/.test(entry)) return false;
|
|
27
|
-
try {
|
|
28
|
-
const stat = readFileSync(`/proc/${entry}/stat`, "utf8");
|
|
29
|
-
const fields = stat.slice(stat.lastIndexOf(") ") + 2).split(/\s+/);
|
|
30
|
-
return fields[2] === String(pid) && fields[0] !== "Z" && fields[0] !== "X";
|
|
31
|
-
} catch {
|
|
32
|
-
return false;
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
} catch {
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
return processIsAlive(-pid);
|
|
39
|
-
}
|
|
40
|
-
function waitForDelay(delayMs) {
|
|
41
|
-
return new Promise((resolve) => setTimeout(resolve, delayMs));
|
|
42
|
-
}
|
|
43
|
-
async function waitForProcessGroupExit(pid) {
|
|
44
|
-
while (processGroupIsAlive(pid)) await waitForDelay(20);
|
|
45
|
-
}
|
|
46
|
-
function windowsProcessTreeKillArgs(pid) {
|
|
47
|
-
return ["/PID", String(pid), "/T", "/F"];
|
|
48
|
-
}
|
|
49
|
-
function terminateWindowsProcessTree(pid, spawnProcess = (command, args, options) => spawn(command, [...args], options)) {
|
|
50
|
-
return new Promise((resolve, reject) => {
|
|
51
|
-
const killer = spawnProcess("taskkill", windowsProcessTreeKillArgs(pid), {
|
|
52
|
-
stdio: "ignore",
|
|
53
|
-
windowsHide: true
|
|
54
|
-
});
|
|
55
|
-
killer.once("error", reject);
|
|
56
|
-
killer.once("close", (status) => {
|
|
57
|
-
if (status === 0) resolve();
|
|
58
|
-
else reject(new Error(`taskkill exited with status ${status ?? "unknown"}`));
|
|
59
|
-
});
|
|
60
|
-
});
|
|
61
|
-
}
|
|
62
|
-
function signalProcessGroup(pid, signal) {
|
|
63
|
-
try {
|
|
64
|
-
process.kill(-pid, signal);
|
|
65
|
-
} catch {
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
function getDescendants(pid) {
|
|
69
|
-
let children;
|
|
70
|
-
try {
|
|
71
|
-
const raw = execFileSync("pgrep", ["-P", String(pid)], {
|
|
72
|
-
encoding: "utf8",
|
|
73
|
-
timeout: 2e3
|
|
74
|
-
}).trim();
|
|
75
|
-
children = raw.split(/\r?\n/).map(Number).filter((childPid) => Number.isInteger(childPid) && childPid > 0);
|
|
76
|
-
} catch {
|
|
77
|
-
return [];
|
|
78
|
-
}
|
|
79
|
-
return children.flatMap((childPid) => [childPid, ...getDescendants(childPid)]);
|
|
80
|
-
}
|
|
81
|
-
function signalProcesses(pids, signal) {
|
|
82
|
-
for (const pid of pids) {
|
|
83
|
-
try {
|
|
84
|
-
process.kill(pid, signal);
|
|
85
|
-
} catch {
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
async function terminatePidTree(pid, signal) {
|
|
90
|
-
const pids = [...getDescendants(pid).reverse(), pid];
|
|
91
|
-
signalProcesses(pids, signal);
|
|
92
|
-
if (signal === "SIGKILL") return "SIGKILL";
|
|
93
|
-
await waitForDelay(500);
|
|
94
|
-
const survivors = pids.filter(processIsAlive);
|
|
95
|
-
signalProcesses(survivors, "SIGKILL");
|
|
96
|
-
return survivors.length > 0 ? "SIGKILL" : "SIGTERM";
|
|
97
|
-
}
|
|
98
|
-
async function terminateProcessGroup(pid, signal) {
|
|
99
|
-
signalProcessGroup(pid, signal);
|
|
100
|
-
if (signal === "SIGKILL") {
|
|
101
|
-
await waitForProcessGroupExit(pid);
|
|
102
|
-
return "SIGKILL";
|
|
103
|
-
}
|
|
104
|
-
await Promise.race([waitForProcessGroupExit(pid), waitForDelay(250)]);
|
|
105
|
-
if (!processGroupIsAlive(pid)) return "SIGTERM";
|
|
106
|
-
signalProcessGroup(pid, "SIGKILL");
|
|
107
|
-
await waitForProcessGroupExit(pid);
|
|
108
|
-
return "SIGKILL";
|
|
109
|
-
}
|
|
110
|
-
async function terminateProcessTree(pid, options = {}) {
|
|
111
|
-
if (process.platform === "win32") {
|
|
112
|
-
try {
|
|
113
|
-
await terminateWindowsProcessTree(pid, options.spawnProcess);
|
|
114
|
-
} catch (error) {
|
|
115
|
-
try {
|
|
116
|
-
options.child?.kill("SIGKILL");
|
|
117
|
-
} catch {
|
|
118
|
-
}
|
|
119
|
-
if (options.child) throw error;
|
|
120
|
-
}
|
|
121
|
-
return "SIGKILL";
|
|
122
|
-
}
|
|
123
|
-
const signal = options.signal ?? "SIGTERM";
|
|
124
|
-
return options.processGroup ? terminateProcessGroup(pid, signal) : terminatePidTree(pid, signal);
|
|
125
|
-
}
|
|
10
|
+
import {
|
|
11
|
+
terminateProcessTree
|
|
12
|
+
} from "./chunk-KGPLIH7B.js";
|
|
126
13
|
|
|
127
14
|
// src/renderSetupWorkerLifecycle.ts
|
|
128
15
|
var RENDER_SETUP_SIGNALS = ["SIGINT", "SIGTERM", "SIGHUP"];
|
|
@@ -176,7 +63,7 @@ function renderSetupFailureFrom(stderr) {
|
|
|
176
63
|
}
|
|
177
64
|
|
|
178
65
|
// src/utils/cancellableProcess.ts
|
|
179
|
-
import { spawn
|
|
66
|
+
import { spawn } from "child_process";
|
|
180
67
|
import { fileURLToPath } from "url";
|
|
181
68
|
var CancellableProcessError = class extends Error {
|
|
182
69
|
code;
|
|
@@ -209,7 +96,7 @@ function runCancellableProcess(command, args, options = {}) {
|
|
|
209
96
|
windowsHide: true,
|
|
210
97
|
detached: process.platform !== "win32"
|
|
211
98
|
};
|
|
212
|
-
child =
|
|
99
|
+
child = spawn(command, [...args], spawnOptions);
|
|
213
100
|
} catch (error) {
|
|
214
101
|
reject(error);
|
|
215
102
|
return;
|
|
@@ -363,8 +250,6 @@ async function runRenderSetupWorker(mode, input, options) {
|
|
|
363
250
|
}
|
|
364
251
|
|
|
365
252
|
export {
|
|
366
|
-
processIsAlive,
|
|
367
|
-
terminateProcessTree,
|
|
368
253
|
installRenderSetupSignalHandlers,
|
|
369
254
|
renderSetupResultLine,
|
|
370
255
|
renderSetupErrorLine,
|
|
@@ -6,14 +6,14 @@ var __filename = __hf_fileURLToPath(import.meta.url);
|
|
|
6
6
|
var __dirname = __hf_dirname(__filename);
|
|
7
7
|
import {
|
|
8
8
|
refreshIfNeeded
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-KMAAOHLO.js";
|
|
10
10
|
import {
|
|
11
11
|
buildAuthHeaders,
|
|
12
12
|
envCredentialVar,
|
|
13
13
|
isAuthError,
|
|
14
14
|
isTokenExpired,
|
|
15
15
|
tryResolveCredential
|
|
16
|
-
} from "./chunk-
|
|
16
|
+
} from "./chunk-NAMGMP3R.js";
|
|
17
17
|
import {
|
|
18
18
|
CSS_URL_RE,
|
|
19
19
|
isNonRelativeUrl,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
typeDirPath,
|
|
21
21
|
updateRecord,
|
|
22
22
|
withFigmaErrors
|
|
23
|
-
} from "./chunk-
|
|
23
|
+
} from "./chunk-7JTFPUMA.js";
|
|
24
24
|
import {
|
|
25
25
|
defineCommand
|
|
26
26
|
} from "./chunk-S3S4TGEH.js";
|
|
@@ -229,7 +229,7 @@ var asset_default = defineCommand({
|
|
|
229
229
|
rendered > 0 ? `(${results.length} nodes, ${rendered} rendered in 1 figma request)` : `(${results.length} nodes, all reused from cache \u2014 no figma request)`
|
|
230
230
|
);
|
|
231
231
|
}
|
|
232
|
-
const { trackFigmaImport } = await import("./telemetry-
|
|
232
|
+
const { trackFigmaImport } = await import("./telemetry-C3GDIXHO.js");
|
|
233
233
|
trackFigmaImport({
|
|
234
234
|
phase: "asset",
|
|
235
235
|
reused: results.every((r) => r.reused),
|
|
@@ -6,65 +6,76 @@ var __filename = __hf_fileURLToPath(import.meta.url);
|
|
|
6
6
|
var __dirname = __hf_dirname(__filename);
|
|
7
7
|
import {
|
|
8
8
|
redactHome
|
|
9
|
-
} from "./chunk-
|
|
9
|
+
} from "./chunk-VQ7YIURZ.js";
|
|
10
10
|
import "./chunk-Z27A7NUB.js";
|
|
11
11
|
import "./chunk-5ETJX6WM.js";
|
|
12
12
|
import {
|
|
13
13
|
loadProducer
|
|
14
|
-
} from "./chunk-
|
|
15
|
-
import "./chunk-
|
|
16
|
-
import
|
|
17
|
-
formatBytes
|
|
18
|
-
} from "./chunk-K2FLNJVB.js";
|
|
19
|
-
import "./chunk-C24LU5XD.js";
|
|
20
|
-
import "./chunk-2HWB4TCI.js";
|
|
14
|
+
} from "./chunk-6QB7F2II.js";
|
|
15
|
+
import "./chunk-UVVI2NJQ.js";
|
|
16
|
+
import "./chunk-ZNHAJCEA.js";
|
|
21
17
|
import {
|
|
22
18
|
DEFAULT_HISTORY_ROOT,
|
|
23
19
|
listProjectHistories,
|
|
24
20
|
pruneGoneProjectHistories
|
|
25
21
|
} from "./chunk-FJWEYVEM.js";
|
|
26
|
-
import "./chunk-
|
|
22
|
+
import "./chunk-XXPYZBZ3.js";
|
|
27
23
|
import {
|
|
28
24
|
CACHE_DIR_NAME,
|
|
29
25
|
cleanupProxyCache
|
|
30
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-EL5QVJEG.js";
|
|
31
27
|
import "./chunk-AIJS74LG.js";
|
|
32
|
-
import
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
import "./chunk-
|
|
28
|
+
import {
|
|
29
|
+
formatBytes
|
|
30
|
+
} from "./chunk-K2FLNJVB.js";
|
|
31
|
+
import "./chunk-M5B42RL5.js";
|
|
36
32
|
import "./chunk-374QQGBQ.js";
|
|
37
33
|
import "./chunk-XBSPQ52S.js";
|
|
38
|
-
import "./chunk-AMKC3AXA.js";
|
|
39
34
|
import {
|
|
40
35
|
defineCommand
|
|
41
36
|
} from "./chunk-S3S4TGEH.js";
|
|
42
37
|
import {
|
|
43
38
|
setCommandExitCode
|
|
44
39
|
} from "./chunk-PBN6GBJE.js";
|
|
40
|
+
import {
|
|
41
|
+
c
|
|
42
|
+
} from "./chunk-ZTZA4UWZ.js";
|
|
45
43
|
import "./chunk-EOOEC32M.js";
|
|
46
44
|
import "./chunk-TJSTGSAW.js";
|
|
45
|
+
import "./chunk-7IEGPJ4P.js";
|
|
46
|
+
import {
|
|
47
|
+
withMeta
|
|
48
|
+
} from "./chunk-AFRXL75S.js";
|
|
49
|
+
import "./chunk-K4WIOZFP.js";
|
|
50
|
+
import "./chunk-XUXGIA7H.js";
|
|
51
|
+
import "./chunk-WERLJGIC.js";
|
|
52
|
+
import "./chunk-ISN5GRYI.js";
|
|
53
|
+
import "./chunk-I6DATIHC.js";
|
|
54
|
+
import "./chunk-3DKN5WKL.js";
|
|
55
|
+
import "./chunk-EOVYQ3IG.js";
|
|
56
|
+
import "./chunk-6BEFEWFB.js";
|
|
57
|
+
import "./chunk-DUUFDLC4.js";
|
|
58
|
+
import "./chunk-AMKC3AXA.js";
|
|
47
59
|
import {
|
|
48
60
|
EXTRACT_CACHE_MIN_AGE_MS,
|
|
49
61
|
directorySizeBytes,
|
|
50
62
|
gcExtractionCache,
|
|
51
63
|
resolveExtractCacheDir
|
|
52
|
-
} from "./chunk-
|
|
53
|
-
import "./chunk-
|
|
64
|
+
} from "./chunk-5NAYNDBT.js";
|
|
65
|
+
import "./chunk-WLIUULZQ.js";
|
|
54
66
|
import "./chunk-NE55C6S5.js";
|
|
55
67
|
import "./chunk-JYVGYKXG.js";
|
|
56
|
-
import "./chunk-
|
|
57
|
-
import "./chunk-
|
|
68
|
+
import "./chunk-PCWOSS7G.js";
|
|
69
|
+
import "./chunk-CEND6BLF.js";
|
|
58
70
|
import "./chunk-VC76R6W2.js";
|
|
59
|
-
import "./chunk-
|
|
71
|
+
import "./chunk-UJKQWGFF.js";
|
|
60
72
|
import "./chunk-LFNQDTSH.js";
|
|
61
73
|
import "./chunk-OFQWTKPW.js";
|
|
62
74
|
import "./chunk-DPVXBVLL.js";
|
|
63
75
|
import "./chunk-T76PLPD6.js";
|
|
64
76
|
import "./chunk-FXMKHHPO.js";
|
|
65
77
|
import "./chunk-RQVDTPGD.js";
|
|
66
|
-
import "./chunk-
|
|
67
|
-
import "./chunk-BYSBRF24.js";
|
|
78
|
+
import "./chunk-XPQSL5VS.js";
|
|
68
79
|
import "./chunk-TWWSYAKJ.js";
|
|
69
80
|
import "./chunk-JDB65PPT.js";
|
|
70
81
|
import "./chunk-IWFLMU2N.js";
|
|
@@ -75,19 +86,9 @@ import "./chunk-BSQ7XANM.js";
|
|
|
75
86
|
import "./chunk-SDYDNHEE.js";
|
|
76
87
|
import "./chunk-2PSPARWP.js";
|
|
77
88
|
import "./chunk-IXLUTE6N.js";
|
|
78
|
-
import {
|
|
79
|
-
withMeta
|
|
80
|
-
} from "./chunk-ASEJ2FBO.js";
|
|
81
|
-
import "./chunk-K4WIOZFP.js";
|
|
82
|
-
import "./chunk-XUXGIA7H.js";
|
|
83
|
-
import "./chunk-WERLJGIC.js";
|
|
84
|
-
import "./chunk-ISN5GRYI.js";
|
|
85
|
-
import "./chunk-KQESKXAC.js";
|
|
86
89
|
import "./chunk-KNU5COPB.js";
|
|
90
|
+
import "./chunk-KGPLIH7B.js";
|
|
87
91
|
import "./chunk-3GXQPCJC.js";
|
|
88
|
-
import {
|
|
89
|
-
c
|
|
90
|
-
} from "./chunk-ZTZA4UWZ.js";
|
|
91
92
|
import "./chunk-M2WBOQ2Q.js";
|
|
92
93
|
|
|
93
94
|
// src/commands/clean.ts
|