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.
Files changed (185) hide show
  1. package/dist/{add-JAHZJYB7.js → add-3ZIFEN2U.js} +19 -19
  2. package/dist/{animatedGifPrep-HV4ZFVPV.js → animatedGifPrep-77LPFLKJ.js} +6 -6
  3. package/dist/api.d.ts +209 -0
  4. package/dist/api.js +75 -0
  5. package/dist/{asset-SJA7DT6Q.js → asset-EYSZEHM6.js} +3 -3
  6. package/dist/{assetCataloger-JJQ4JW2P.js → assetCataloger-KX3HD7ZI.js} +3 -3
  7. package/dist/{auth-RR3OIXLH.js → auth-L6IWNRXY.js} +4 -4
  8. package/dist/{autoUpdate-KLDV2XWV.js → autoUpdate-2O3HZB65.js} +2 -2
  9. package/dist/{backgroundChecks-OVL3E2RK.js → backgroundChecks-BH2LMJYE.js} +3 -3
  10. package/dist/backgroundChecksWorker.js +3 -3
  11. package/dist/{batchRender-2SAJGOHU.js → batchRender-ZBKAYLWU.js} +7 -7
  12. package/dist/{beats-HTYS42CC.js → beats-IVLF2566.js} +22 -22
  13. package/dist/{benchmark-CAHP4GLB.js → benchmark-SYZFW2G7.js} +19 -19
  14. package/dist/{browser-M7I67IGX.js → browser-OSW3L25S.js} +14 -13
  15. package/dist/{bundleWithLocalizedFonts-EKRXJBXU.js → bundleWithLocalizedFonts-I4CWOXLK.js} +5 -5
  16. package/dist/{capture-P5SNZ6HL.js → capture-AZOQ57TM.js} +2 -2
  17. package/dist/{capture-YZQZ5LKM.js → capture-V5ICGSVJ.js} +20 -20
  18. package/dist/{catalog-LREZPRJS.js → catalog-VBJOA2Y5.js} +35 -35
  19. package/dist/{catch-up-2MLRYAYP.js → catch-up-TKSEDNJK.js} +13 -13
  20. package/dist/{check-BH6NUR22.js → check-3HFISKDB.js} +50 -50
  21. package/dist/{checkBrowser-BM6JBFST.js → checkBrowser-MXBDNZJB.js} +38 -38
  22. package/dist/chunk-2KAL22B5.js +26 -0
  23. package/dist/{chunk-X2G54Y2V.js → chunk-3UAIVF4L.js} +4 -4
  24. package/dist/{chunk-KQHJKJ3V.js → chunk-423DJVX2.js} +1 -1
  25. package/dist/{chunk-UTBQSOEC.js → chunk-4WFNTWKZ.js} +3 -3
  26. package/dist/{chunk-VC7JBNPS.js → chunk-5NAYNDBT.js} +477 -68
  27. package/dist/{chunk-QX26JK43.js → chunk-6KWA3XPS.js} +10 -10
  28. package/dist/{chunk-AY2BONTF.js → chunk-6NPFJ255.js} +1 -1
  29. package/dist/{chunk-ZK3BQXHC.js → chunk-6QB7F2II.js} +1 -1
  30. package/dist/{chunk-54TV77W5.js → chunk-6SFPQ2RZ.js} +6 -8
  31. package/dist/{chunk-YQK445YQ.js → chunk-73RBX2E7.js} +2 -2
  32. package/dist/chunk-7E4VHPKJ.js +329 -0
  33. package/dist/{chunk-A6S35NYA.js → chunk-7IEGPJ4P.js} +1 -1
  34. package/dist/{chunk-NT7EK6ET.js → chunk-7JTFPUMA.js} +1 -1
  35. package/dist/{chunk-VHJPGKUW.js → chunk-A6ZO4BX7.js} +2 -2
  36. package/dist/{chunk-ASEJ2FBO.js → chunk-AFRXL75S.js} +1 -1
  37. package/dist/{chunk-QIJLIULK.js → chunk-AKYQGZLU.js} +2 -2
  38. package/dist/{chunk-4S4VUXW3.js → chunk-AXPNVC3N.js} +1 -1
  39. package/dist/{chunk-A4Q7W4LV.js → chunk-B3XLIBFL.js} +4 -2
  40. package/dist/{chunk-PR7QQBSC.js → chunk-BLRJKBKP.js} +1 -1
  41. package/dist/chunk-CEND6BLF.js +3795 -0
  42. package/dist/{chunk-KVGDFUVO.js → chunk-CZQLCBWY.js} +26 -13
  43. package/dist/{chunk-6IIGT7BX.js → chunk-DNZMBQTH.js} +1 -1
  44. package/dist/{chunk-ELACLQPC.js → chunk-DOVJRUFM.js} +1 -1
  45. package/dist/{chunk-SYUGVPYH.js → chunk-DUUFDLC4.js} +1 -1
  46. package/dist/{chunk-KMJLHHBF.js → chunk-EL5QVJEG.js} +1 -1
  47. package/dist/{chunk-JN4EK6MC.js → chunk-F2RLIE7P.js} +17 -17
  48. package/dist/{chunk-TLGJRK6Q.js → chunk-FN6KAS7A.js} +10 -10
  49. package/dist/{chunk-24GKVAEE.js → chunk-FPAT5HTI.js} +15 -15
  50. package/dist/chunk-HU2SPFNG.js +103 -0
  51. package/dist/{chunk-KQESKXAC.js → chunk-I6DATIHC.js} +2 -2
  52. package/dist/{chunk-4OA4LDTU.js → chunk-IYLHJV34.js} +1 -1
  53. package/dist/{chunk-KBB4RG6F.js → chunk-JZIEZCQM.js} +9 -2
  54. package/dist/chunk-KGPLIH7B.js +127 -0
  55. package/dist/{chunk-B4P5VDFQ.js → chunk-KMAAOHLO.js} +1 -1
  56. package/dist/chunk-LW5VFBSY.js +56 -0
  57. package/dist/{chunk-66SAATRI.js → chunk-M5B42RL5.js} +9 -9
  58. package/dist/{chunk-Q2Y5OZCY.js → chunk-M6UDJ2E7.js} +2 -2
  59. package/dist/{chunk-URYAKNQ2.js → chunk-NFQY7EIC.js} +1 -1
  60. package/dist/{chunk-S7E2I3HT.js → chunk-O4DC5CHF.js} +1 -1
  61. package/dist/{chunk-K35E45SI.js → chunk-OQ7XMM3S.js} +1 -1
  62. package/dist/{chunk-AHBYQRGI.js → chunk-PCWOSS7G.js} +1 -1
  63. package/dist/{chunk-BHVFTYSI.js → chunk-PO2SDVQA.js} +4 -1
  64. package/dist/{chunk-K4RIT6PX.js → chunk-R5A7454P.js} +2 -2
  65. package/dist/{chunk-VXM4BH23.js → chunk-RW7NLGPD.js} +121 -47
  66. package/dist/{chunk-BB3HJLHD.js → chunk-S5F26DUL.js} +3 -3
  67. package/dist/{chunk-OLENCLFE.js → chunk-TZPZE5PS.js} +81 -8
  68. package/dist/{chunk-74JDPWQ3.js → chunk-UAIUVPZE.js} +9 -9
  69. package/dist/{chunk-XIL7KT5Q.js → chunk-UJB7356Y.js} +6 -6
  70. package/dist/{chunk-YA62XGXS.js → chunk-UJKQWGFF.js} +1 -1
  71. package/dist/{chunk-O3EALI4M.js → chunk-UQYQ7TBA.js} +4 -4
  72. package/dist/{chunk-C24LU5XD.js → chunk-UVVI2NJQ.js} +12 -12
  73. package/dist/{normalize-U3SL5VG3.js → chunk-VHZ6DL3M.js} +3 -3
  74. package/dist/{chunk-CNEYCO24.js → chunk-VQ7YIURZ.js} +13 -13
  75. package/dist/{chunk-62RUQJ5J.js → chunk-WLIUULZQ.js} +20 -8
  76. package/dist/{chunk-RKBES4XP.js → chunk-XANZ4R4P.js} +88 -28
  77. package/dist/{chunk-BYSBRF24.js → chunk-XPQSL5VS.js} +5 -120
  78. package/dist/{chunk-SP6XL3NP.js → chunk-XQMEGSHG.js} +1 -1
  79. package/dist/{chunk-ZFN6GQU4.js → chunk-XXPYZBZ3.js} +1 -1
  80. package/dist/{chunk-4SFGME7K.js → chunk-YJDB4FLT.js} +1 -1
  81. package/dist/{chunk-QATWIE4K.js → chunk-YU2QRNWN.js} +2 -2
  82. package/dist/{chunk-6VKQ5JT3.js → chunk-Z6WZDGCS.js} +2 -2
  83. package/dist/{chunk-2HWB4TCI.js → chunk-ZNHAJCEA.js} +1 -1
  84. package/dist/{clean-K7GYTLQE.js → clean-7HU7S7DT.js} +34 -33
  85. package/dist/cli.js +55 -55
  86. package/dist/{cloud-I3J5HTN7.js → cloud-HAXHBO25.js} +4 -4
  87. package/dist/{cloudrun-MJQ363PB.js → cloudrun-A3PIJ6DX.js} +7 -7
  88. package/dist/{compare-LHW6NEFR.js → compare-6IPSQMSM.js} +37 -37
  89. package/dist/{compiler-NPD3MYMO.js → compiler-UQP2VXN6.js} +3 -3
  90. package/dist/{component-LTPK2D3K.js → component-FF3AU24M.js} +4 -4
  91. package/dist/{compositions-QGEHXGIL.js → compositions-JSH4MZXB.js} +20 -20
  92. package/dist/{delete-ATNRBUDJ.js → delete-G763SW64.js} +11 -11
  93. package/dist/{dist-CUIR3GFX.js → dist-Z7Q3JS7K.js} +3 -3
  94. package/dist/{doctor-6B76R5BJ.js → doctor-WZB6WMBY.js} +21 -20
  95. package/dist/{events-BLABPRD5.js → events-MUWJJCC7.js} +6 -6
  96. package/dist/{events-33GOPHSS.js → events-T4YFQC5G.js} +8 -8
  97. package/dist/{feedback-HLXEG7RT.js → feedback-AUTHQNN2.js} +25 -25
  98. package/dist/{ffmpeg-5V4FP3R6.js → ffmpeg-TZB5WAYE.js} +3 -2
  99. package/dist/{figma-T6W7H23L.js → figma-NBG6WBI7.js} +3 -3
  100. package/dist/fontLocalizeCli.js +11 -11
  101. package/dist/{get-UDMLOTKJ.js → get-OXBJLKLV.js} +11 -11
  102. package/dist/{gpuPolicy-M2JZGGVW.js → gpuPolicy-HBCCEQUS.js} +6 -6
  103. package/dist/{grade-compare-P4CHFVBR.js → grade-compare-2LX4FDH7.js} +42 -41
  104. package/dist/{help-4MW6L6YB.js → help-LJI46EDO.js} +3 -3
  105. package/dist/{history-336VM6SH.js → history-MFKAQEHU.js} +15 -15
  106. package/dist/hyperframe-runtime.js +65 -58
  107. package/dist/hyperframe.manifest.json +1 -1
  108. package/dist/hyperframe.runtime.iife.js +65 -58
  109. package/dist/hyperframes-player.global.js +1 -1
  110. package/dist/{info-FPMIDMD5.js → info-D6Y5O2QE.js} +18 -18
  111. package/dist/{init-IWM4PWLO.js → init-47NZPEBI.js} +53 -52
  112. package/dist/{inspect-IIG7756C.js → inspect-U5UXJK5D.js} +34 -34
  113. package/dist/{installer-Q4MMZKLA.js → installer-AW7VFVTQ.js} +5 -5
  114. package/dist/{keyframes-TWO4BXBA.js → keyframes-5G334NWB.js} +16 -16
  115. package/dist/{lambda-2JB2QUK2.js → lambda-GASGXN3A.js} +9 -9
  116. package/dist/{layout-TPKEKFQQ.js → layout-OXAQFLJS.js} +34 -34
  117. package/dist/{lint-H3KL7KSX.js → lint-F36QFSNF.js} +19 -19
  118. package/dist/{list-LYPO4KRE.js → list-TR6QCI53.js} +11 -11
  119. package/dist/{login-SQQWKWTD.js → login-6LA2RWTC.js} +9 -9
  120. package/dist/{logout-B4KS4A7S.js → logout-DKJANASY.js} +3 -3
  121. package/dist/{manager-5ORDVWJB.js → manager-ES2UFT4X.js} +6 -4
  122. package/dist/{manager-BPSR6D3V.js → manager-GWU5J6RJ.js} +3 -2
  123. package/dist/{media-treatment-KSRINVUA.js → media-treatment-BOHYDWVY.js} +28 -27
  124. package/dist/{models-WUBF6GDB.js → models-6GW5Q3IW.js} +20 -18
  125. package/dist/{motionShot-STKG4KYQ.js → motionShot-O7AOMPUN.js} +14 -14
  126. package/dist/normalize-4UDISLPL.js +24 -0
  127. package/dist/{normalize-audio-CA47XZ4I.js → normalize-audio-UO5B4O76.js} +17 -17
  128. package/dist/{open-B5WYEM3Z.js → open-JV2EHVKM.js} +13 -13
  129. package/dist/{parakeetRunner-JBK2JPEH.js → parakeetRunner-23DZUF6G.js} +18 -28
  130. package/dist/{pipeline-FEAAD2RJ.js → pipeline-KTICSIK7.js} +10 -10
  131. package/dist/{play-2LC5XRM6.js → play-CMUYPXBC.js} +37 -37
  132. package/dist/{preflight-ONF5AJNO.js → preflight-JOD4OXGC.js} +5 -4
  133. package/dist/{present-XKYF3VGC.js → present-ZDT5FM2H.js} +27 -27
  134. package/dist/{preview-WDPZRHE5.js → preview-ASHLGKDD.js} +40 -38
  135. package/dist/{producer-343ENLAM.js → producer-FFH2KUAZ.js} +1 -1
  136. package/dist/{projectConfig-YXKU3CTB.js → projectConfig-FHIAOPKW.js} +7 -7
  137. package/dist/{publication-ODXP3JI7.js → publication-WO5ZXURT.js} +3 -3
  138. package/dist/{publish-3OYXNY44.js → publish-QWO2W7FB.js} +23 -23
  139. package/dist/{refresh-PVHBEABE.js → refresh-MGCVWX56.js} +3 -3
  140. package/dist/{remove-background-F6QTJIPZ.js → remove-background-BO5MQR25.js} +39 -35
  141. package/dist/{render-SC77I7FT.js → render-HS3YOLSD.js} +7 -7
  142. package/dist/{render-QQ7NUREG.js → render-SDHFXL3Y.js} +62 -61
  143. package/dist/{render-JKB6GZDB.js → render-XTJKGT3G.js} +31 -31
  144. package/dist/{render-batch-4F44JFAB.js → render-batch-J64AJHQY.js} +7 -7
  145. package/dist/renderSetupWorker.js +4 -3
  146. package/dist/{resolver-7MYXNEAX.js → resolver-IHNWMDJA.js} +5 -5
  147. package/dist/{sherpa-FOXB4XBN.js → sherpa-FXBBYMDR.js} +16 -15
  148. package/dist/sherpaWorker.js +3 -1
  149. package/dist/{skills-GG756RCG.js → skills-ALLSN7TB.js} +15 -15
  150. package/dist/{skillsUpdateCheck-N2LDCNAS.js → skillsUpdateCheck-EIT5NWM6.js} +3 -3
  151. package/dist/{snapshot-2LDOY65W.js → snapshot-Y3I76OIZ.js} +56 -55
  152. package/dist/{src-VMTHSARJ.js → src-7V6LBC56.js} +7 -5
  153. package/dist/{src-PTIV7IVV.js → src-S5IZVJUX.js} +7 -7
  154. package/dist/{staticProjectServer-QBB6WUAY.js → staticProjectServer-QLWWGHZE.js} +16 -16
  155. package/dist/{status-PTKNQD2E.js → status-NBRMGL7D.js} +5 -5
  156. package/dist/studio/assets/{hyperframes-player-BBBg-uvu.js → hyperframes-player-kup62bDR.js} +1 -1
  157. package/dist/studio/assets/{index-BXJLeCqB.js → index-B8BBYY8L.js} +1 -1
  158. package/dist/studio/assets/{index-BJIpZeuk.js → index-CS_m0TkX.js} +131 -131
  159. package/dist/studio/assets/{index-DARhiE_i.js → index-DQ5jGodF.js} +1 -1
  160. package/dist/studio/index.html +1 -1
  161. package/dist/{studio-api-VPTZF2AW.js → studio-api-UBFLZ3DA.js} +9 -9
  162. package/dist/{studioServer-VZKX2MG7.js → studioServer-REOVCIFP.js} +72 -71
  163. package/dist/{synthesize-UCI4X5O7.js → synthesize-22B7L5GX.js} +6 -6
  164. package/dist/{telemetry-76XND6XK.js → telemetry-C3GDIXHO.js} +8 -8
  165. package/dist/{timeline-UJLTA4AX.js → timeline-H42EGLMT.js} +26 -26
  166. package/dist/{tokens-VMWANYJY.js → tokens-2K7ISTKV.js} +3 -3
  167. package/dist/transcribe-DVM7UFZZ.js +332 -0
  168. package/dist/{transcribe-JNOG667L.js → transcribe-NUPASAUP.js} +14 -13
  169. package/dist/{tts-B6AHFQEO.js → tts-QSAQZVEZ.js} +3 -3
  170. package/dist/{updateCheck-WI3HYM72.js → updateCheck-3RWFSEZD.js} +2 -2
  171. package/dist/{upgrade-52RIOKFX.js → upgrade-YKKL36N7.js} +5 -5
  172. package/dist/{urlDownloader-352AY25I.js → urlDownloader-6JNJYLPN.js} +5 -5
  173. package/dist/{validate-MJVNR7YY.js → validate-Z7KQT7GO.js} +27 -27
  174. package/dist/{video-72VNEQEI.js → video-EXL2JDSL.js} +9 -9
  175. package/package.json +8 -1
  176. package/dist/chunk-3WD4JNMU.js +0 -3795
  177. package/dist/chunk-6IHWCZ3W.js +0 -54
  178. package/dist/chunk-SQLK7SJL.js +0 -88
  179. package/dist/manager-RFZNG5YT.js +0 -30
  180. package/dist/renderCancellation-7OEBNE2L.js +0 -43
  181. package/dist/transcribe-FD7A2SH3.js +0 -466
  182. package/dist/{chunk-DKSDVDXG.js → chunk-NAMGMP3R.js} +3 -3
  183. package/dist/{policies-4FEXMXPK.js → policies-DCSIM4AB.js} +3 -3
  184. package/dist/{screenshotCapture-3JXXUZND.js → screenshotCapture-TEUIWXWN.js} +3 -3
  185. package/dist/{telemetry-W5AKPI4R.js → telemetry-CQYHCCPL.js} +3 -3
@@ -14,13 +14,8 @@ import {
14
14
  getInvocationId
15
15
  } from "./chunk-54HJ63Q2.js";
16
16
  import {
17
- CANARIES,
18
- canaryEnvVar,
19
- canaryFeatureProperties,
20
- evaluateCanary,
21
- findCanary,
22
- parseCanaryOverride
23
- } from "./chunk-FXMKHHPO.js";
17
+ c
18
+ } from "./chunk-ZTZA4UWZ.js";
24
19
  import {
25
20
  hostAnswers
26
21
  } from "./chunk-K4WIOZFP.js";
@@ -34,10 +29,15 @@ import {
34
29
  } from "./chunk-XUXGIA7H.js";
35
30
  import {
36
31
  VERSION
37
- } from "./chunk-KQESKXAC.js";
32
+ } from "./chunk-I6DATIHC.js";
38
33
  import {
39
- c
40
- } from "./chunk-ZTZA4UWZ.js";
34
+ CANARIES,
35
+ canaryEnvVar,
36
+ canaryFeatureProperties,
37
+ evaluateCanary,
38
+ findCanary,
39
+ parseCanaryOverride
40
+ } from "./chunk-FXMKHHPO.js";
41
41
 
42
42
  // src/telemetry/transport.ts
43
43
  import { spawn } from "child_process";
@@ -14,7 +14,7 @@ import {
14
14
  } from "./chunk-AWDFDFI3.js";
15
15
  import {
16
16
  isBlockedNetworkHost
17
- } from "./chunk-VC7JBNPS.js";
17
+ } from "./chunk-5NAYNDBT.js";
18
18
  import {
19
19
  DOMParser,
20
20
  parseHTML
@@ -7,7 +7,7 @@ var __dirname = __hf_dirname(__filename);
7
7
 
8
8
  // src/utils/producer.ts
9
9
  async function loadProducer() {
10
- return await import("./src-PTIV7IVV.js");
10
+ return await import("./src-S5IZVJUX.js");
11
11
  }
12
12
 
13
13
  export {
@@ -18,15 +18,13 @@ import {
18
18
  sweepStaleStaging
19
19
  } from "./chunk-3DKN5WKL.js";
20
20
  import {
21
+ emitWords,
21
22
  getPreparedWavDurationSeconds,
22
23
  prepareWav
23
- } from "./chunk-RKBES4XP.js";
24
- import {
25
- emitWords
26
- } from "./chunk-6IHWCZ3W.js";
24
+ } from "./chunk-XANZ4R4P.js";
27
25
  import {
28
26
  stoppedByCancelSignal
29
- } from "./chunk-UTBQSOEC.js";
27
+ } from "./chunk-4WFNTWKZ.js";
30
28
  import {
31
29
  PARAKEET_MODEL_LABEL,
32
30
  SHERPA_ERROR_PREFIX,
@@ -34,7 +32,7 @@ import {
34
32
  SHERPA_WINDOW_PREFIX,
35
33
  mergeWindowsToWords,
36
34
  writeParakeetTranscript
37
- } from "./chunk-KBB4RG6F.js";
35
+ } from "./chunk-JZIEZCQM.js";
38
36
 
39
37
  // src/whisper/sherpa.ts
40
38
  import { execFile, spawn } from "child_process";
@@ -332,9 +330,9 @@ function decode(wavPath, runtimePath, signal, onWindow) {
332
330
  }
333
331
  });
334
332
  }
335
- function prepareSherpaWav(inputPath, onProgress) {
333
+ async function prepareSherpaWav(inputPath, onProgress, signal) {
336
334
  try {
337
- return prepareWav(inputPath, onProgress);
335
+ return await prepareWav(inputPath, onProgress, signal);
338
336
  } catch (err) {
339
337
  if (err.cancelled) {
340
338
  throw new DecodeCancelled("Transcription cancelled");
@@ -7,10 +7,10 @@ var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  trackLintReport,
9
9
  trackLintRuleStreak
10
- } from "./chunk-X2G54Y2V.js";
10
+ } from "./chunk-3UAIVF4L.js";
11
11
  import {
12
12
  shouldTrack
13
- } from "./chunk-QX26JK43.js";
13
+ } from "./chunk-6KWA3XPS.js";
14
14
  import {
15
15
  LINT_RULE_COUNT,
16
16
  LINT_RULE_GROUP_COUNTS
@@ -0,0 +1,329 @@
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
+ parakeetRunner
9
+ } from "./chunk-2KAL22B5.js";
10
+ import {
11
+ DecodeCancelled,
12
+ prepareSherpaWav,
13
+ sherpaUnsupportedReason,
14
+ transcribeWithSherpa
15
+ } from "./chunk-6SFPQ2RZ.js";
16
+ import {
17
+ initialModelForLanguage,
18
+ transcribe
19
+ } from "./chunk-XANZ4R4P.js";
20
+ import {
21
+ createRenderCancellationScope,
22
+ stoppedByCancelSignal
23
+ } from "./chunk-4WFNTWKZ.js";
24
+ import {
25
+ formatSrt,
26
+ formatVtt,
27
+ loadTranscript,
28
+ patchCaptionHtml
29
+ } from "./chunk-VHZ6DL3M.js";
30
+ import {
31
+ DEFAULT_MODEL,
32
+ isWhisperUnavailable
33
+ } from "./chunk-CZQLCBWY.js";
34
+ import {
35
+ normalizeErrorMessage
36
+ } from "./chunk-KNU5COPB.js";
37
+ import {
38
+ PARAKEET_INSTALL_COMMAND,
39
+ PARAKEET_LANGUAGES,
40
+ parakeetSpeaks,
41
+ transcribeWithParakeet
42
+ } from "./chunk-JZIEZCQM.js";
43
+ import {
44
+ TRANSCRIPT_FILE
45
+ } from "./chunk-IR35BCLK.js";
46
+
47
+ // src/api/transcribe.ts
48
+ import { existsSync, realpathSync, rmSync, statSync, writeFileSync } from "fs";
49
+ import { basename, dirname, extname, join, resolve } from "path";
50
+ var MIN_TIMEOUT_MS = 5e3;
51
+ var TranscribeError = class extends Error {
52
+ code;
53
+ /** whisper_unavailable: the command that installs Parakeet, when Parakeet would cover this run. */
54
+ install;
55
+ /** caption_write_failed after transcribing: the transcript, which was saved. */
56
+ transcriptPath;
57
+ constructor(code, message, options = {}) {
58
+ super(message, options.cause === void 0 ? void 0 : { cause: options.cause });
59
+ this.name = "TranscribeError";
60
+ this.code = code;
61
+ if (options.install !== void 0) this.install = options.install;
62
+ if (options.transcriptPath !== void 0) this.transcriptPath = options.transcriptPath;
63
+ }
64
+ };
65
+ async function runTranscribe(options) {
66
+ if (options.signal?.aborted) {
67
+ throw new TranscribeError("cancelled", "Transcription cancelled", {
68
+ cause: options.signal.reason
69
+ });
70
+ }
71
+ const inputPath = resolve(options.input);
72
+ if (!existsSync(inputPath)) {
73
+ throw new TranscribeError("input_not_found", `File not found: ${options.input}`);
74
+ }
75
+ const dir = resolve(options.dir ?? dirname(inputPath));
76
+ const ext = extname(inputPath).toLowerCase();
77
+ const isImport = ext === ".json" || ext === ".srt" || ext === ".vtt";
78
+ const sidecar = parseSidecar(options.captions, inputPath, dir);
79
+ if (sidecar && isImport) return exportTranscript(inputPath, sidecar);
80
+ if (isImport) return importTranscript(inputPath, dir);
81
+ const { timeoutMs } = options;
82
+ if (timeoutMs !== void 0 && !(Number.isInteger(timeoutMs) && timeoutMs >= MIN_TIMEOUT_MS)) {
83
+ throw new TranscribeError(
84
+ "invalid_timeout",
85
+ `Invalid timeoutMs: ${timeoutMs}. Must be an integer >= ${MIN_TIMEOUT_MS} (ms).`
86
+ );
87
+ }
88
+ return transcribeAudio(inputPath, dir, sidecar, options);
89
+ }
90
+ function parseExportFormat(value) {
91
+ if (!value) return void 0;
92
+ const normalized = value.toLowerCase();
93
+ if (normalized === "srt" || normalized === "vtt") return normalized;
94
+ throw new TranscribeError(
95
+ "invalid_option",
96
+ `Unsupported caption export format: ${value}. Use srt or vtt.`
97
+ );
98
+ }
99
+ function parseSidecar(captions, inputPath, dir) {
100
+ const to = parseExportFormat(captions?.format);
101
+ if (!to) return void 0;
102
+ const output = captions?.outputPath;
103
+ const outPath = resolve(output ?? join(dir, `transcript.${to}`));
104
+ const keep = [inputPath, join(dir, TRANSCRIPT_FILE)];
105
+ const problem = output !== void 0 && outputProblem(output, outPath, to) || overwriteProblem(outPath, keep);
106
+ if (problem) throw new TranscribeError("invalid_option", problem);
107
+ return { to, outPath, preserveCues: captions?.preserveCues === true, keep };
108
+ }
109
+ function outputProblem(output, outPath, to) {
110
+ if (!output) return "--output needs a file path";
111
+ const folder = dirname(outPath);
112
+ if (!existsSync(folder) || !statSync(folder).isDirectory()) {
113
+ return `Output folder not found: ${folder}`;
114
+ }
115
+ if (/[\\/]$/.test(output) || existsSync(outPath) && statSync(outPath).isDirectory()) {
116
+ return `--output is a folder; give a file path such as ${join(outPath, `transcript.${to}`)}`;
117
+ }
118
+ return void 0;
119
+ }
120
+ function overwriteProblem(outPath, keep) {
121
+ const hit = keep.find((file) => sameFile(outPath, file));
122
+ return hit && `The caption file would overwrite ${hit}; choose another file with --output`;
123
+ }
124
+ function sameFile(out, file) {
125
+ if (existsSync(out) && existsSync(file)) {
126
+ const [a, b] = [statSync(out, { bigint: true }), statSync(file, { bigint: true })];
127
+ if (a.ino !== 0n && b.ino !== 0n) return a.dev === b.dev && a.ino === b.ino;
128
+ return realpathSync.native(out) === realpathSync.native(file);
129
+ }
130
+ const realDir = (p) => existsSync(dirname(p)) ? realpathSync.native(dirname(p)) : dirname(p);
131
+ return realDir(out) === realDir(file) && basename(out).toLowerCase() === basename(file).toLowerCase();
132
+ }
133
+ function readTranscript(inputPath) {
134
+ let transcript;
135
+ try {
136
+ transcript = loadTranscript(inputPath);
137
+ } catch (err) {
138
+ throw new TranscribeError("invalid_transcript", normalizeErrorMessage(err), { cause: err });
139
+ }
140
+ if (transcript.words.length === 0) {
141
+ throw new TranscribeError("no_words", "No words found in transcript.");
142
+ }
143
+ return transcript;
144
+ }
145
+ function importTranscript(inputPath, dir) {
146
+ const { words, format } = readTranscript(inputPath);
147
+ const transcriptPath = join(dir, TRANSCRIPT_FILE);
148
+ writeFileSync(transcriptPath, JSON.stringify(words, null, 2));
149
+ patchCaptionHtml(dir, words);
150
+ return { kind: "imported", format, wordCount: words.length, transcriptPath };
151
+ }
152
+ function exportTranscript(inputPath, sidecar) {
153
+ const { words, format } = readTranscript(inputPath);
154
+ try {
155
+ writeCaptionSidecar(words, sidecar, format === "srt" || format === "vtt" || void 0);
156
+ } catch (err) {
157
+ throw new TranscribeError(
158
+ "caption_write_failed",
159
+ `The caption file ${sidecar.outPath} could not be written: ${normalizeErrorMessage(err)}`,
160
+ { cause: err }
161
+ );
162
+ }
163
+ return {
164
+ kind: "exported",
165
+ format: sidecar.to,
166
+ wordCount: words.length,
167
+ outputPath: sidecar.outPath
168
+ };
169
+ }
170
+ function writeCaptionSidecar(words, { to, outPath, preserveCues, keep }, phraseLevelSource) {
171
+ const hit = keep.find((file) => sameFile(outPath, file));
172
+ if (hit) throw new Error(`it is the same file as ${hit}`);
173
+ const preGrouped = preserveCues || phraseLevelSource;
174
+ const content = to === "srt" ? formatSrt(words, { preGrouped }) : formatVtt(words, { preGrouped });
175
+ writeFileSync(outPath, content);
176
+ }
177
+ function pickRunner(engine, parakeet, language) {
178
+ if (engine === "whisper" || !parakeetSpeaks(language)) return "whisper";
179
+ return parakeet() ?? "whisper";
180
+ }
181
+ var parakeetFallsBack = (engine) => engine === "auto";
182
+ function withoutTrailingDots(text) {
183
+ let end = text.length;
184
+ while (end > 0 && text[end - 1] === ".") end--;
185
+ return text.slice(0, end);
186
+ }
187
+ var engineOf = (runner) => runner === "whisper" ? "whisper" : "parakeet";
188
+ function failureMessage(err) {
189
+ const base = err instanceof Error ? err.message : String(err);
190
+ const stderr = err && typeof err === "object" && "stderr" in err && err.stderr ? String(err.stderr).trim().split("\n").slice(-3).filter((line) => !base.includes(line)).join("\n") : "";
191
+ return stderr ? `${base}
192
+ ${stderr}` : base;
193
+ }
194
+ async function transcribeAudio(inputPath, dir, sidecar, options) {
195
+ const engine = (options.engine ?? "auto").toLowerCase();
196
+ if (engine !== "auto" && engine !== "parakeet" && engine !== "whisper") {
197
+ throw new TranscribeError(
198
+ "invalid_option",
199
+ `Unknown --engine: ${options.engine}. Use auto, parakeet, or whisper.`
200
+ );
201
+ }
202
+ const unsupported = sherpaUnsupportedReason();
203
+ let runner = pickRunner(engine, () => parakeetRunner({ unsupported }), options.language);
204
+ if (engine === "parakeet" && runner === "whisper") {
205
+ throw new TranscribeError(
206
+ "parakeet_unavailable",
207
+ !parakeetSpeaks(options.language) ? `Parakeet does not transcribe --language ${options.language}; it covers ${PARAKEET_LANGUAGES.split(" ").join(", ")}. Use --engine whisper.` : unsupported ?? `Parakeet is not installed. Install it with: ${PARAKEET_INSTALL_COMMAND} (or use --engine whisper)`
208
+ );
209
+ }
210
+ const model = options.model ?? DEFAULT_MODEL;
211
+ const whisperModel = initialModelForLanguage(model, options.language);
212
+ options.onEngine?.({ runner, engine: engineOf(runner), model: whisperModel });
213
+ const { onStatus, onProgress } = options;
214
+ const startScope = () => options.stopOnProcessSignals ? createRenderCancellationScope() : { signal: options.signal ?? new AbortController().signal, dispose: () => {
215
+ } };
216
+ let wavPath = inputPath;
217
+ let cancellation = runner === "sherpa" || !options.stopOnProcessSignals ? startScope() : null;
218
+ const librarySignal = options.stopOnProcessSignals ? void 0 : cancellation?.signal;
219
+ const run = (r) => {
220
+ switch (r) {
221
+ case "sherpa":
222
+ return transcribeWithSherpa(wavPath, dir, {
223
+ onProgress: onStatus,
224
+ onEvent: onProgress,
225
+ signal: cancellation.signal
226
+ });
227
+ case "parakeet-mlx":
228
+ return transcribeWithParakeet(wavPath, dir, {
229
+ onProgress: onStatus,
230
+ onEvent: onProgress,
231
+ signal: librarySignal
232
+ });
233
+ case "whisper":
234
+ return transcribe(wavPath, dir, {
235
+ model,
236
+ language: options.language,
237
+ onProgress: onStatus,
238
+ onEvent: onProgress,
239
+ timeoutMs: options.timeoutMs,
240
+ installRuntime: options.installRuntime,
241
+ signal: librarySignal,
242
+ startCancellation: () => (cancellation ??= startScope()).signal
243
+ });
244
+ default: {
245
+ const unreachable = r;
246
+ throw new Error(`Unknown transcription runner: ${unreachable}`);
247
+ }
248
+ }
249
+ };
250
+ try {
251
+ if (runner === "sherpa") {
252
+ wavPath = await prepareSherpaWav(inputPath, onStatus, librarySignal);
253
+ }
254
+ let result;
255
+ try {
256
+ result = await run(runner);
257
+ } catch (err) {
258
+ if (runner !== "sherpa" || err instanceof DecodeCancelled) throw err;
259
+ const reason = withoutTrailingDots(normalizeErrorMessage(err));
260
+ const parakeetError = `Parakeet failed: ${reason}. To repair it, run: ${PARAKEET_INSTALL_COMMAND}`;
261
+ if (!parakeetFallsBack(engine)) throw new Error(parakeetError);
262
+ runner = pickRunner(
263
+ engine,
264
+ () => parakeetRunner({ unsupported, skipSherpa: true }),
265
+ options.language
266
+ );
267
+ options.onEngine?.({
268
+ runner,
269
+ engine: engineOf(runner),
270
+ model: whisperModel,
271
+ fallbackReason: parakeetError
272
+ });
273
+ try {
274
+ result = await run(runner);
275
+ } catch (fallbackErr) {
276
+ if (stoppedByCancelSignal(fallbackErr)) {
277
+ throw new DecodeCancelled("Transcription cancelled");
278
+ }
279
+ const why = normalizeErrorMessage(fallbackErr);
280
+ throw new Error(`${parakeetError}. The ${runner} fallback failed too: ${why}`);
281
+ }
282
+ }
283
+ const { words } = loadTranscript(result.transcriptPath);
284
+ writeFileSync(result.transcriptPath, JSON.stringify(words, null, 2));
285
+ patchCaptionHtml(dir, words);
286
+ if (sidecar) {
287
+ try {
288
+ writeCaptionSidecar(words, sidecar, false);
289
+ } catch (err) {
290
+ throw new TranscribeError(
291
+ "caption_write_failed",
292
+ `Transcript saved to ${result.transcriptPath}, but the caption file ${sidecar.outPath} could not be written: ${normalizeErrorMessage(err)}`,
293
+ { cause: err, transcriptPath: result.transcriptPath }
294
+ );
295
+ }
296
+ }
297
+ return {
298
+ kind: "transcribed",
299
+ engine: engineOf(runner),
300
+ model: result.model,
301
+ detectedLanguage: result.detectedLanguage,
302
+ wordCount: words.length,
303
+ durationSeconds: result.durationSeconds,
304
+ speechOnsetSeconds: result.speechOnsetSeconds,
305
+ transcriptPath: result.transcriptPath,
306
+ ...sidecar && { captions: { format: sidecar.to, outputPath: sidecar.outPath } }
307
+ };
308
+ } catch (err) {
309
+ if (err instanceof TranscribeError) throw err;
310
+ if (err instanceof DecodeCancelled || cancellation?.signal.aborted) {
311
+ throw new TranscribeError("cancelled", "Transcription cancelled", { cause: err });
312
+ }
313
+ const message = failureMessage(err);
314
+ if (isWhisperUnavailable(err)) {
315
+ const install = engine === "auto" && parakeetSpeaks(options.language) && !unsupported ? PARAKEET_INSTALL_COMMAND : void 0;
316
+ throw new TranscribeError("whisper_unavailable", message, { cause: err, install });
317
+ }
318
+ throw new TranscribeError("failed", message, { cause: err });
319
+ } finally {
320
+ cancellation?.dispose();
321
+ if (wavPath !== inputPath) rmSync(wavPath, { force: true });
322
+ }
323
+ }
324
+
325
+ export {
326
+ MIN_TIMEOUT_MS,
327
+ TranscribeError,
328
+ runTranscribe
329
+ };
@@ -6,7 +6,7 @@ var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  runRenderSetupWorker
9
- } from "./chunk-BYSBRF24.js";
9
+ } from "./chunk-XPQSL5VS.js";
10
10
  import {
11
11
  chromeMajorCeiling,
12
12
  exceedsChromeCeiling
@@ -1278,7 +1278,7 @@ async function withFigmaErrors(command, fn) {
1278
1278
  } catch (err) {
1279
1279
  if (err instanceof Error) {
1280
1280
  try {
1281
- const { trackCommandFailure } = await import("./events-33GOPHSS.js");
1281
+ const { trackCommandFailure } = await import("./events-T4YFQC5G.js");
1282
1282
  trackCommandFailure(
1283
1283
  command,
1284
1284
  err,
@@ -6,10 +6,10 @@ var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  getMimeType
9
- } from "./chunk-C24LU5XD.js";
9
+ } from "./chunk-UVVI2NJQ.js";
10
10
  import {
11
11
  injectTagsAtHeadStart
12
- } from "./chunk-3WD4JNMU.js";
12
+ } from "./chunk-CEND6BLF.js";
13
13
 
14
14
  // src/utils/compositionServer.ts
15
15
  import { createHash } from "crypto";
@@ -17,7 +17,7 @@ import {
17
17
  } from "./chunk-ISN5GRYI.js";
18
18
  import {
19
19
  VERSION
20
- } from "./chunk-KQESKXAC.js";
20
+ } from "./chunk-I6DATIHC.js";
21
21
 
22
22
  // src/utils/updateCheck.ts
23
23
  import { existsSync, readFileSync } from "fs";
@@ -7,7 +7,7 @@ var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  resolveConfig,
9
9
  usesSoftwareWebGpu
10
- } from "./chunk-VC7JBNPS.js";
10
+ } from "./chunk-5NAYNDBT.js";
11
11
 
12
12
  // src/browser/gpuPolicy.ts
13
13
  function resolveLocalBrowserGpuMode(browserGpuArg, envMode = process.env.PRODUCER_BROWSER_GPU_MODE) {
@@ -17,7 +17,7 @@ function resolveLocalBrowserGpuMode(browserGpuArg, envMode = process.env.PRODUCE
17
17
  return "auto";
18
18
  }
19
19
  async function resolveCaptureBrowserGpuMode(requestedMode, chromePath) {
20
- const { resolveBrowserGpuMode } = await import("./src-VMTHSARJ.js");
20
+ const { resolveBrowserGpuMode } = await import("./src-7V6LBC56.js");
21
21
  return resolveBrowserGpuMode(requestedMode, { chromePath });
22
22
  }
23
23
  function resolveLocalWebGpu(browserGpuMode, requiresWebGpu) {
@@ -6,7 +6,7 @@ var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
  import {
8
8
  resolveCaptureBrowserGpuMode
9
- } from "./chunk-QIJLIULK.js";
9
+ } from "./chunk-AKYQGZLU.js";
10
10
  import {
11
11
  requestCliExit
12
12
  } from "./chunk-PBN6GBJE.js";
@@ -5,9 +5,11 @@ var require = __hf_createRequire(import.meta.url);
5
5
  var __filename = __hf_fileURLToPath(import.meta.url);
6
6
  var __dirname = __hf_dirname(__filename);
7
7
  import {
8
- runRenderSetupWorker,
8
+ runRenderSetupWorker
9
+ } from "./chunk-XPQSL5VS.js";
10
+ import {
9
11
  terminateProcessTree
10
- } from "./chunk-BYSBRF24.js";
12
+ } from "./chunk-KGPLIH7B.js";
11
13
 
12
14
  // src/utils/orphanCleanup.ts
13
15
  import { execFileSync } from "child_process";
@@ -8,7 +8,7 @@ import {
8
8
  DEFAULT_REGISTRY_URL,
9
9
  fetchItemManifest,
10
10
  fetchRegistryManifest
11
- } from "./chunk-K35E45SI.js";
11
+ } from "./chunk-OQ7XMM3S.js";
12
12
 
13
13
  // src/registry/resolver.ts
14
14
  function defaultWarn(message) {