@tscaps/engine 0.2.1 → 0.3.0

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 (495) hide show
  1. package/README.md +47 -7
  2. package/dist/index.d.ts +3 -0
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +3 -0
  5. package/dist/index.js.map +1 -1
  6. package/dist/modules/bidi/BidiAnalyzer.d.ts +23 -0
  7. package/dist/modules/bidi/BidiAnalyzer.d.ts.map +1 -0
  8. package/dist/modules/bidi/BidiAnalyzer.js +2 -0
  9. package/dist/modules/bidi/BidiAnalyzer.js.map +1 -0
  10. package/dist/modules/bidi/BidiCharacterClassifier.d.ts +13 -0
  11. package/dist/modules/bidi/BidiCharacterClassifier.d.ts.map +1 -0
  12. package/dist/modules/bidi/BidiCharacterClassifier.js +2 -0
  13. package/dist/modules/bidi/BidiCharacterClassifier.js.map +1 -0
  14. package/dist/modules/bidi/BidiJsAnalyzer.d.ts +14 -0
  15. package/dist/modules/bidi/BidiJsAnalyzer.d.ts.map +1 -0
  16. package/dist/modules/bidi/BidiJsAnalyzer.js +19 -0
  17. package/dist/modules/bidi/BidiJsAnalyzer.js.map +1 -0
  18. package/dist/modules/bidi/BidiJsCharacterClassifier.d.ts +8 -0
  19. package/dist/modules/bidi/BidiJsCharacterClassifier.d.ts.map +1 -0
  20. package/dist/modules/bidi/BidiJsCharacterClassifier.js +19 -0
  21. package/dist/modules/bidi/BidiJsCharacterClassifier.js.map +1 -0
  22. package/dist/modules/bidi/CursiveScriptDetector.d.ts +12 -0
  23. package/dist/modules/bidi/CursiveScriptDetector.d.ts.map +1 -0
  24. package/dist/modules/bidi/CursiveScriptDetector.js +20 -0
  25. package/dist/modules/bidi/CursiveScriptDetector.js.map +1 -0
  26. package/dist/modules/bidi/HorizontalSide.d.ts +18 -0
  27. package/dist/modules/bidi/HorizontalSide.d.ts.map +1 -0
  28. package/dist/modules/bidi/HorizontalSide.js +3 -0
  29. package/dist/modules/bidi/HorizontalSide.js.map +1 -0
  30. package/dist/modules/bidi/HorizontalSideResolver.d.ts +21 -0
  31. package/dist/modules/bidi/HorizontalSideResolver.d.ts.map +1 -0
  32. package/dist/modules/bidi/HorizontalSideResolver.js +27 -0
  33. package/dist/modules/bidi/HorizontalSideResolver.js.map +1 -0
  34. package/dist/modules/bidi/StrongCharacterMajorityTextDirectionDetector.d.ts +24 -0
  35. package/dist/modules/bidi/StrongCharacterMajorityTextDirectionDetector.d.ts.map +1 -0
  36. package/dist/modules/bidi/StrongCharacterMajorityTextDirectionDetector.js +34 -0
  37. package/dist/modules/bidi/StrongCharacterMajorityTextDirectionDetector.js.map +1 -0
  38. package/dist/modules/bidi/TextDirection.d.ts +9 -0
  39. package/dist/modules/bidi/TextDirection.d.ts.map +1 -0
  40. package/dist/modules/bidi/TextDirection.js +2 -0
  41. package/dist/modules/bidi/TextDirection.js.map +1 -0
  42. package/dist/modules/bidi/TextDirectionDetector.d.ts +12 -0
  43. package/dist/modules/bidi/TextDirectionDetector.d.ts.map +1 -0
  44. package/dist/modules/bidi/TextDirectionDetector.js +2 -0
  45. package/dist/modules/bidi/TextDirectionDetector.js.map +1 -0
  46. package/dist/modules/bidi/WordFragment.d.ts +34 -0
  47. package/dist/modules/bidi/WordFragment.d.ts.map +1 -0
  48. package/dist/modules/bidi/WordFragment.js +2 -0
  49. package/dist/modules/bidi/WordFragment.js.map +1 -0
  50. package/dist/modules/bidi/WordFragmenter.d.ts +43 -0
  51. package/dist/modules/bidi/WordFragmenter.d.ts.map +1 -0
  52. package/dist/modules/bidi/WordFragmenter.js +112 -0
  53. package/dist/modules/bidi/WordFragmenter.js.map +1 -0
  54. package/dist/modules/bidi/index.d.ts +14 -0
  55. package/dist/modules/bidi/index.d.ts.map +1 -0
  56. package/dist/modules/bidi/index.js +8 -0
  57. package/dist/modules/bidi/index.js.map +1 -0
  58. package/dist/modules/css/CssBlockSealer.d.ts +30 -0
  59. package/dist/modules/css/CssBlockSealer.d.ts.map +1 -0
  60. package/dist/modules/css/CssBlockSealer.js +64 -0
  61. package/dist/modules/css/CssBlockSealer.js.map +1 -0
  62. package/dist/modules/css/CssCustomPropertyDefinitionScanner.d.ts +13 -0
  63. package/dist/modules/css/CssCustomPropertyDefinitionScanner.d.ts.map +1 -0
  64. package/dist/modules/css/CssCustomPropertyDefinitionScanner.js +24 -0
  65. package/dist/modules/css/CssCustomPropertyDefinitionScanner.js.map +1 -0
  66. package/dist/modules/css/CssFilterReferenceScanner.d.ts +15 -0
  67. package/dist/modules/css/CssFilterReferenceScanner.d.ts.map +1 -0
  68. package/dist/modules/css/CssFilterReferenceScanner.js +22 -0
  69. package/dist/modules/css/CssFilterReferenceScanner.js.map +1 -0
  70. package/dist/modules/css/CssFragmentParser.d.ts +53 -0
  71. package/dist/modules/css/CssFragmentParser.d.ts.map +1 -0
  72. package/dist/modules/css/CssFragmentParser.js +127 -0
  73. package/dist/modules/css/CssFragmentParser.js.map +1 -0
  74. package/dist/modules/css/CssKeyframeNamespacer.d.ts +21 -0
  75. package/dist/modules/css/CssKeyframeNamespacer.d.ts.map +1 -0
  76. package/dist/modules/css/CssKeyframeNamespacer.js +48 -0
  77. package/dist/modules/css/CssKeyframeNamespacer.js.map +1 -0
  78. package/dist/modules/css/CssKeyframesScanner.d.ts +29 -0
  79. package/dist/modules/css/CssKeyframesScanner.d.ts.map +1 -0
  80. package/dist/modules/css/CssKeyframesScanner.js +102 -0
  81. package/dist/modules/css/CssKeyframesScanner.js.map +1 -0
  82. package/dist/modules/css/CssLayer.d.ts +20 -0
  83. package/dist/modules/css/CssLayer.d.ts.map +1 -0
  84. package/dist/modules/css/CssLayer.js +21 -0
  85. package/dist/modules/css/CssLayer.js.map +1 -0
  86. package/dist/modules/css/CssScoper.d.ts +11 -2
  87. package/dist/modules/css/CssScoper.d.ts.map +1 -1
  88. package/dist/modules/css/CssScoper.js +53 -37
  89. package/dist/modules/css/CssScoper.js.map +1 -1
  90. package/dist/modules/css/CssSelectorClassScanner.d.ts +25 -0
  91. package/dist/modules/css/CssSelectorClassScanner.d.ts.map +1 -0
  92. package/dist/modules/css/CssSelectorClassScanner.js +91 -0
  93. package/dist/modules/css/CssSelectorClassScanner.js.map +1 -0
  94. package/dist/modules/css/CssVarReferenceScanner.d.ts +8 -5
  95. package/dist/modules/css/CssVarReferenceScanner.d.ts.map +1 -1
  96. package/dist/modules/css/CssVarReferenceScanner.js +14 -7
  97. package/dist/modules/css/CssVarReferenceScanner.js.map +1 -1
  98. package/dist/modules/css/index.d.ts +8 -0
  99. package/dist/modules/css/index.d.ts.map +1 -1
  100. package/dist/modules/css/index.js +8 -0
  101. package/dist/modules/css/index.js.map +1 -1
  102. package/dist/modules/document/CssClass.d.ts +20 -0
  103. package/dist/modules/document/CssClass.d.ts.map +1 -0
  104. package/dist/modules/document/CssClass.js +21 -0
  105. package/dist/modules/document/CssClass.js.map +1 -0
  106. package/dist/modules/document/CssVariable.d.ts +0 -6
  107. package/dist/modules/document/CssVariable.d.ts.map +1 -1
  108. package/dist/modules/document/CssVariable.js +0 -6
  109. package/dist/modules/document/CssVariable.js.map +1 -1
  110. package/dist/modules/document/DataAttribute.d.ts +26 -0
  111. package/dist/modules/document/DataAttribute.d.ts.map +1 -0
  112. package/dist/modules/document/DataAttribute.js +27 -0
  113. package/dist/modules/document/DataAttribute.js.map +1 -0
  114. package/dist/modules/document/DocumentEditor.d.ts +40 -9
  115. package/dist/modules/document/DocumentEditor.d.ts.map +1 -1
  116. package/dist/modules/document/DocumentEditor.js +69 -17
  117. package/dist/modules/document/DocumentEditor.js.map +1 -1
  118. package/dist/modules/document/DocumentNodeId.d.ts +23 -0
  119. package/dist/modules/document/DocumentNodeId.d.ts.map +1 -0
  120. package/dist/modules/document/DocumentNodeId.js +31 -0
  121. package/dist/modules/document/DocumentNodeId.js.map +1 -0
  122. package/dist/modules/document/Line.d.ts +1 -1
  123. package/dist/modules/document/Line.d.ts.map +1 -1
  124. package/dist/modules/document/Line.js +2 -1
  125. package/dist/modules/document/Line.js.map +1 -1
  126. package/dist/modules/document/Section.d.ts +1 -4
  127. package/dist/modules/document/Section.d.ts.map +1 -1
  128. package/dist/modules/document/Section.js +2 -17
  129. package/dist/modules/document/Section.js.map +1 -1
  130. package/dist/modules/document/Segment.d.ts +14 -7
  131. package/dist/modules/document/Segment.d.ts.map +1 -1
  132. package/dist/modules/document/Segment.js +26 -1
  133. package/dist/modules/document/Segment.js.map +1 -1
  134. package/dist/modules/document/Word.d.ts +1 -1
  135. package/dist/modules/document/Word.d.ts.map +1 -1
  136. package/dist/modules/document/Word.js +2 -1
  137. package/dist/modules/document/Word.js.map +1 -1
  138. package/dist/modules/document/index.d.ts +4 -2
  139. package/dist/modules/document/index.d.ts.map +1 -1
  140. package/dist/modules/document/index.js +3 -1
  141. package/dist/modules/document/index.js.map +1 -1
  142. package/dist/modules/effect/GapFreeEffect.d.ts +15 -0
  143. package/dist/modules/effect/GapFreeEffect.d.ts.map +1 -1
  144. package/dist/modules/effect/GapFreeEffect.js +29 -4
  145. package/dist/modules/effect/GapFreeEffect.js.map +1 -1
  146. package/dist/modules/pipeline/RenderPipelineBuilder.js +3 -3
  147. package/dist/modules/pipeline/RenderPipelineBuilder.js.map +1 -1
  148. package/dist/modules/rendering/BrowserSubtitleFrameRenderer.d.ts.map +1 -1
  149. package/dist/modules/rendering/BrowserSubtitleFrameRenderer.js +4 -1
  150. package/dist/modules/rendering/BrowserSubtitleFrameRenderer.js.map +1 -1
  151. package/dist/modules/rendering/HorizontalPlacementResolver.d.ts +27 -0
  152. package/dist/modules/rendering/HorizontalPlacementResolver.d.ts.map +1 -0
  153. package/dist/modules/rendering/HorizontalPlacementResolver.js +31 -0
  154. package/dist/modules/rendering/HorizontalPlacementResolver.js.map +1 -0
  155. package/dist/modules/rendering/SubtitleFrameRenderer.d.ts +2 -0
  156. package/dist/modules/rendering/SubtitleFrameRenderer.d.ts.map +1 -1
  157. package/dist/modules/rendering/index.d.ts +7 -4
  158. package/dist/modules/rendering/index.d.ts.map +1 -1
  159. package/dist/modules/rendering/index.js +5 -2
  160. package/dist/modules/rendering/index.js.map +1 -1
  161. package/dist/modules/rendering/styles/BaselineCssComposer.d.ts +19 -1
  162. package/dist/modules/rendering/styles/BaselineCssComposer.d.ts.map +1 -1
  163. package/dist/modules/rendering/styles/BaselineCssComposer.js +32 -8
  164. package/dist/modules/rendering/styles/BaselineCssComposer.js.map +1 -1
  165. package/dist/modules/rendering/styles/DecorationContainerBaselineCss.d.ts.map +1 -1
  166. package/dist/modules/rendering/styles/DecorationContainerBaselineCss.js +5 -4
  167. package/dist/modules/rendering/styles/DecorationContainerBaselineCss.js.map +1 -1
  168. package/dist/modules/rendering/styles/FrozenFrameCss.d.ts +28 -0
  169. package/dist/modules/rendering/styles/FrozenFrameCss.d.ts.map +1 -0
  170. package/dist/modules/rendering/styles/FrozenFrameCss.js +28 -0
  171. package/dist/modules/rendering/styles/FrozenFrameCss.js.map +1 -0
  172. package/dist/modules/rendering/styles/InlineStyleEmitter.d.ts +0 -7
  173. package/dist/modules/rendering/styles/InlineStyleEmitter.d.ts.map +1 -1
  174. package/dist/modules/rendering/styles/InlineStyleEmitter.js +0 -9
  175. package/dist/modules/rendering/styles/InlineStyleEmitter.js.map +1 -1
  176. package/dist/modules/rendering/styles/{VideoFrameLayerClass.d.ts → VideoFrameLayerBaselineCss.d.ts} +3 -10
  177. package/dist/modules/rendering/styles/VideoFrameLayerBaselineCss.d.ts.map +1 -0
  178. package/dist/modules/rendering/styles/VideoFrameLayerBaselineCss.js +15 -0
  179. package/dist/modules/rendering/styles/VideoFrameLayerBaselineCss.js.map +1 -0
  180. package/dist/modules/rendering/subtitle/ActiveRenderSessionFactory.d.ts +3 -1
  181. package/dist/modules/rendering/subtitle/ActiveRenderSessionFactory.d.ts.map +1 -1
  182. package/dist/modules/rendering/subtitle/ActiveRenderSessionFactory.js +9 -4
  183. package/dist/modules/rendering/subtitle/ActiveRenderSessionFactory.js.map +1 -1
  184. package/dist/modules/rendering/subtitle/AnimationProbe.d.ts +23 -9
  185. package/dist/modules/rendering/subtitle/AnimationProbe.d.ts.map +1 -1
  186. package/dist/modules/rendering/subtitle/AnimationProbe.js +86 -81
  187. package/dist/modules/rendering/subtitle/AnimationProbe.js.map +1 -1
  188. package/dist/modules/rendering/subtitle/BatchPlanner.d.ts +1 -0
  189. package/dist/modules/rendering/subtitle/BatchPlanner.d.ts.map +1 -1
  190. package/dist/modules/rendering/subtitle/BatchPlanner.js +16 -14
  191. package/dist/modules/rendering/subtitle/BatchPlanner.js.map +1 -1
  192. package/dist/modules/rendering/subtitle/PreparedStyle.d.ts +1 -0
  193. package/dist/modules/rendering/subtitle/PreparedStyle.d.ts.map +1 -1
  194. package/dist/modules/rendering/subtitle/PreparedStyleFactory.js +1 -1
  195. package/dist/modules/rendering/subtitle/PreparedStyleFactory.js.map +1 -1
  196. package/dist/modules/rendering/subtitle/SegmentPaintRegionResolver.d.ts.map +1 -1
  197. package/dist/modules/rendering/subtitle/SegmentPaintRegionResolver.js +7 -4
  198. package/dist/modules/rendering/subtitle/SegmentPaintRegionResolver.js.map +1 -1
  199. package/dist/modules/rendering/subtitle/SegmentSubtreeHtmlBuilder.d.ts +30 -2
  200. package/dist/modules/rendering/subtitle/SegmentSubtreeHtmlBuilder.d.ts.map +1 -1
  201. package/dist/modules/rendering/subtitle/SegmentSubtreeHtmlBuilder.js +85 -27
  202. package/dist/modules/rendering/subtitle/SegmentSubtreeHtmlBuilder.js.map +1 -1
  203. package/dist/modules/rendering/subtitle/SegmentWrapperRenderer.d.ts +3 -8
  204. package/dist/modules/rendering/subtitle/SegmentWrapperRenderer.d.ts.map +1 -1
  205. package/dist/modules/rendering/subtitle/SegmentWrapperRenderer.js +31 -40
  206. package/dist/modules/rendering/subtitle/SegmentWrapperRenderer.js.map +1 -1
  207. package/dist/modules/rendering/subtitle/SpriteSheetCompositor.d.ts +2 -0
  208. package/dist/modules/rendering/subtitle/SpriteSheetCompositor.d.ts.map +1 -1
  209. package/dist/modules/rendering/subtitle/SpriteSheetCompositor.js +18 -9
  210. package/dist/modules/rendering/subtitle/SpriteSheetCompositor.js.map +1 -1
  211. package/dist/modules/rendering/subtitle/SvgFilterMaterializer.d.ts +8 -15
  212. package/dist/modules/rendering/subtitle/SvgFilterMaterializer.d.ts.map +1 -1
  213. package/dist/modules/rendering/subtitle/SvgFilterMaterializer.js +10 -20
  214. package/dist/modules/rendering/subtitle/SvgFilterMaterializer.js.map +1 -1
  215. package/dist/modules/rendering/subtitle/VideoFrameVarsBuilder.d.ts.map +1 -1
  216. package/dist/modules/rendering/subtitle/VideoFrameVarsBuilder.js +12 -3
  217. package/dist/modules/rendering/subtitle/VideoFrameVarsBuilder.js.map +1 -1
  218. package/dist/modules/rendering/types/AlignmentConfig.d.ts +16 -4
  219. package/dist/modules/rendering/types/AlignmentConfig.d.ts.map +1 -1
  220. package/dist/modules/rendering/types/AlignmentConfig.js +2 -1
  221. package/dist/modules/rendering/types/AlignmentConfig.js.map +1 -1
  222. package/dist/modules/rendering/types/ElementRenderOverrides.d.ts +8 -0
  223. package/dist/modules/rendering/types/ElementRenderOverrides.d.ts.map +1 -1
  224. package/dist/modules/rendering/types/ElementRenderOverrides.js +28 -0
  225. package/dist/modules/rendering/types/ElementRenderOverrides.js.map +1 -1
  226. package/dist/modules/rendering/types/RenderingConfig.d.ts +7 -2
  227. package/dist/modules/rendering/types/RenderingConfig.d.ts.map +1 -1
  228. package/dist/modules/rendering/types/ScopedRenderOverride.d.ts +9 -4
  229. package/dist/modules/rendering/types/ScopedRenderOverride.d.ts.map +1 -1
  230. package/dist/modules/subtitle-file/AssSubtitleFileSerializer.d.ts +53 -0
  231. package/dist/modules/subtitle-file/AssSubtitleFileSerializer.d.ts.map +1 -0
  232. package/dist/modules/subtitle-file/AssSubtitleFileSerializer.js +133 -0
  233. package/dist/modules/subtitle-file/AssSubtitleFileSerializer.js.map +1 -0
  234. package/dist/modules/subtitle-file/SbvSubtitleFileSerializer.d.ts +20 -0
  235. package/dist/modules/subtitle-file/SbvSubtitleFileSerializer.d.ts.map +1 -0
  236. package/dist/modules/subtitle-file/SbvSubtitleFileSerializer.js +31 -0
  237. package/dist/modules/subtitle-file/SbvSubtitleFileSerializer.js.map +1 -0
  238. package/dist/modules/subtitle-file/SrtSubtitleFileSerializer.d.ts +21 -0
  239. package/dist/modules/subtitle-file/SrtSubtitleFileSerializer.d.ts.map +1 -0
  240. package/dist/modules/subtitle-file/SrtSubtitleFileSerializer.js +33 -0
  241. package/dist/modules/subtitle-file/SrtSubtitleFileSerializer.js.map +1 -0
  242. package/dist/modules/subtitle-file/SubtitleCue.d.ts +18 -0
  243. package/dist/modules/subtitle-file/SubtitleCue.d.ts.map +1 -0
  244. package/dist/modules/subtitle-file/SubtitleCue.js +20 -0
  245. package/dist/modules/subtitle-file/SubtitleCue.js.map +1 -0
  246. package/dist/modules/subtitle-file/SubtitleCueBuilder.d.ts +38 -0
  247. package/dist/modules/subtitle-file/SubtitleCueBuilder.d.ts.map +1 -0
  248. package/dist/modules/subtitle-file/SubtitleCueBuilder.js +106 -0
  249. package/dist/modules/subtitle-file/SubtitleCueBuilder.js.map +1 -0
  250. package/dist/modules/subtitle-file/SubtitleFileJob.d.ts +17 -0
  251. package/dist/modules/subtitle-file/SubtitleFileJob.d.ts.map +1 -0
  252. package/dist/modules/subtitle-file/SubtitleFileJob.js +2 -0
  253. package/dist/modules/subtitle-file/SubtitleFileJob.js.map +1 -0
  254. package/dist/modules/subtitle-file/SubtitleFileSerializer.d.ts +36 -0
  255. package/dist/modules/subtitle-file/SubtitleFileSerializer.d.ts.map +1 -0
  256. package/dist/modules/subtitle-file/SubtitleFileSerializer.js +44 -0
  257. package/dist/modules/subtitle-file/SubtitleFileSerializer.js.map +1 -0
  258. package/dist/modules/subtitle-file/SubtitleGranularity.d.ts +11 -0
  259. package/dist/modules/subtitle-file/SubtitleGranularity.d.ts.map +1 -0
  260. package/dist/modules/subtitle-file/SubtitleGranularity.js +2 -0
  261. package/dist/modules/subtitle-file/SubtitleGranularity.js.map +1 -0
  262. package/dist/modules/subtitle-file/SubtitleRow.d.ts +11 -0
  263. package/dist/modules/subtitle-file/SubtitleRow.d.ts.map +1 -0
  264. package/dist/modules/subtitle-file/SubtitleRow.js +14 -0
  265. package/dist/modules/subtitle-file/SubtitleRow.js.map +1 -0
  266. package/dist/modules/subtitle-file/SubtitleToken.d.ts +13 -0
  267. package/dist/modules/subtitle-file/SubtitleToken.d.ts.map +1 -0
  268. package/dist/modules/subtitle-file/SubtitleToken.js +15 -0
  269. package/dist/modules/subtitle-file/SubtitleToken.js.map +1 -0
  270. package/dist/modules/subtitle-file/TextSubtitleFileSerializer.d.ts +19 -0
  271. package/dist/modules/subtitle-file/TextSubtitleFileSerializer.d.ts.map +1 -0
  272. package/dist/modules/subtitle-file/TextSubtitleFileSerializer.js +24 -0
  273. package/dist/modules/subtitle-file/TextSubtitleFileSerializer.js.map +1 -0
  274. package/dist/modules/subtitle-file/Timecode.d.ts +20 -0
  275. package/dist/modules/subtitle-file/Timecode.d.ts.map +1 -0
  276. package/dist/modules/subtitle-file/Timecode.js +32 -0
  277. package/dist/modules/subtitle-file/Timecode.js.map +1 -0
  278. package/dist/modules/subtitle-file/TtmlSubtitleFileSerializer.d.ts +22 -0
  279. package/dist/modules/subtitle-file/TtmlSubtitleFileSerializer.d.ts.map +1 -0
  280. package/dist/modules/subtitle-file/TtmlSubtitleFileSerializer.js +57 -0
  281. package/dist/modules/subtitle-file/TtmlSubtitleFileSerializer.js.map +1 -0
  282. package/dist/modules/subtitle-file/VttSubtitleFileSerializer.d.ts +21 -0
  283. package/dist/modules/subtitle-file/VttSubtitleFileSerializer.d.ts.map +1 -0
  284. package/dist/modules/subtitle-file/VttSubtitleFileSerializer.js +39 -0
  285. package/dist/modules/subtitle-file/VttSubtitleFileSerializer.js.map +1 -0
  286. package/dist/modules/subtitle-file/index.d.ts +10 -0
  287. package/dist/modules/subtitle-file/index.d.ts.map +1 -0
  288. package/dist/modules/subtitle-file/index.js +8 -0
  289. package/dist/modules/subtitle-file/index.js.map +1 -0
  290. package/dist/modules/svg-filter/SvgFilter.d.ts +8 -1
  291. package/dist/modules/svg-filter/SvgFilter.d.ts.map +1 -1
  292. package/dist/modules/svg-filter/SvgFilter.js +9 -1
  293. package/dist/modules/svg-filter/SvgFilter.js.map +1 -1
  294. package/dist/modules/svg-filter/SvgFilterDefinitionsParser.d.ts +1 -0
  295. package/dist/modules/svg-filter/SvgFilterDefinitionsParser.d.ts.map +1 -1
  296. package/dist/modules/svg-filter/SvgFilterDefinitionsParser.js +9 -1
  297. package/dist/modules/svg-filter/SvgFilterDefinitionsParser.js.map +1 -1
  298. package/dist/modules/svg-filter/SvgFilterDefsRenderer.d.ts +44 -0
  299. package/dist/modules/svg-filter/SvgFilterDefsRenderer.d.ts.map +1 -0
  300. package/dist/modules/svg-filter/SvgFilterDefsRenderer.js +47 -0
  301. package/dist/modules/svg-filter/SvgFilterDefsRenderer.js.map +1 -0
  302. package/dist/modules/svg-filter/index.d.ts +2 -0
  303. package/dist/modules/svg-filter/index.d.ts.map +1 -1
  304. package/dist/modules/svg-filter/index.js +1 -0
  305. package/dist/modules/svg-filter/index.js.map +1 -1
  306. package/dist/modules/tagging/PauseTagger.d.ts.map +1 -1
  307. package/dist/modules/tagging/PauseTagger.js +2 -1
  308. package/dist/modules/tagging/PauseTagger.js.map +1 -1
  309. package/dist/modules/tagging/RegexTagger.js +1 -1
  310. package/dist/modules/tagging/RegexTagger.js.map +1 -1
  311. package/dist/modules/tagging/SpanTagger.js +1 -1
  312. package/dist/modules/tagging/SpanTagger.js.map +1 -1
  313. package/dist/modules/tagging/StructureTagger.d.ts +0 -1
  314. package/dist/modules/tagging/StructureTagger.d.ts.map +1 -1
  315. package/dist/modules/tagging/StructureTagger.js +3 -8
  316. package/dist/modules/tagging/StructureTagger.js.map +1 -1
  317. package/dist/modules/tagging/WordlistTagger.js +1 -1
  318. package/dist/modules/tagging/WordlistTagger.js.map +1 -1
  319. package/dist/modules/tags/AndTagCondition.d.ts +10 -0
  320. package/dist/modules/tags/AndTagCondition.d.ts.map +1 -0
  321. package/dist/modules/tags/AndTagCondition.js +14 -0
  322. package/dist/modules/tags/AndTagCondition.js.map +1 -0
  323. package/dist/modules/tags/HasTagCondition.d.ts +10 -0
  324. package/dist/modules/tags/HasTagCondition.d.ts.map +1 -0
  325. package/dist/modules/tags/HasTagCondition.js +18 -0
  326. package/dist/modules/tags/HasTagCondition.js.map +1 -0
  327. package/dist/modules/tags/NotTagCondition.d.ts +10 -0
  328. package/dist/modules/tags/NotTagCondition.d.ts.map +1 -0
  329. package/dist/modules/tags/NotTagCondition.js +14 -0
  330. package/dist/modules/tags/NotTagCondition.js.map +1 -0
  331. package/dist/modules/tags/OrTagCondition.d.ts +10 -0
  332. package/dist/modules/tags/OrTagCondition.d.ts.map +1 -0
  333. package/dist/modules/tags/OrTagCondition.js +14 -0
  334. package/dist/modules/tags/OrTagCondition.js.map +1 -0
  335. package/dist/modules/{document/Tag.d.ts → tags/StructureTag.d.ts} +2 -11
  336. package/dist/modules/tags/StructureTag.d.ts.map +1 -0
  337. package/dist/modules/{document/Tag.js → tags/StructureTag.js} +1 -19
  338. package/dist/modules/tags/StructureTag.js.map +1 -0
  339. package/dist/modules/tags/Tag.d.ts +8 -0
  340. package/dist/modules/tags/Tag.d.ts.map +1 -0
  341. package/dist/modules/tags/Tag.js +16 -0
  342. package/dist/modules/tags/Tag.js.map +1 -0
  343. package/dist/modules/tags/TagCondition.d.ts +12 -0
  344. package/dist/modules/tags/TagCondition.d.ts.map +1 -0
  345. package/dist/modules/tags/TagCondition.js +2 -0
  346. package/dist/modules/tags/TagCondition.js.map +1 -0
  347. package/dist/modules/tags/TagConditionParser.d.ts +21 -0
  348. package/dist/modules/tags/TagConditionParser.d.ts.map +1 -0
  349. package/dist/modules/tags/TagConditionParser.js +75 -0
  350. package/dist/modules/tags/TagConditionParser.js.map +1 -0
  351. package/dist/modules/tags/index.d.ts +9 -0
  352. package/dist/modules/tags/index.d.ts.map +1 -0
  353. package/dist/modules/tags/index.js +8 -0
  354. package/dist/modules/tags/index.js.map +1 -0
  355. package/dist/modules/transcription/AudioDecoder.d.ts +9 -4
  356. package/dist/modules/transcription/AudioDecoder.d.ts.map +1 -1
  357. package/dist/modules/transcription/BatchedMonoResampler.d.ts +45 -0
  358. package/dist/modules/transcription/BatchedMonoResampler.d.ts.map +1 -0
  359. package/dist/modules/transcription/BatchedMonoResampler.js +116 -0
  360. package/dist/modules/transcription/BatchedMonoResampler.js.map +1 -0
  361. package/dist/modules/transcription/CacheStorageModelFileCache.d.ts +38 -0
  362. package/dist/modules/transcription/CacheStorageModelFileCache.d.ts.map +1 -0
  363. package/dist/modules/transcription/CacheStorageModelFileCache.js +86 -0
  364. package/dist/modules/transcription/CacheStorageModelFileCache.js.map +1 -0
  365. package/dist/modules/transcription/CueDocumentBuilder.d.ts +40 -0
  366. package/dist/modules/transcription/CueDocumentBuilder.d.ts.map +1 -0
  367. package/dist/modules/transcription/CueDocumentBuilder.js +77 -0
  368. package/dist/modules/transcription/CueDocumentBuilder.js.map +1 -0
  369. package/dist/modules/transcription/CueParseResult.d.ts +16 -0
  370. package/dist/modules/transcription/CueParseResult.d.ts.map +1 -0
  371. package/dist/modules/transcription/CueParseResult.js +2 -0
  372. package/dist/modules/transcription/CueParseResult.js.map +1 -0
  373. package/dist/modules/transcription/CueTextTokenizer.d.ts +10 -0
  374. package/dist/modules/transcription/CueTextTokenizer.d.ts.map +1 -0
  375. package/dist/modules/transcription/CueTextTokenizer.js +21 -0
  376. package/dist/modules/transcription/CueTextTokenizer.js.map +1 -0
  377. package/dist/modules/transcription/CueTimecodeReader.d.ts +19 -0
  378. package/dist/modules/transcription/CueTimecodeReader.d.ts.map +1 -0
  379. package/dist/modules/transcription/CueTimecodeReader.js +45 -0
  380. package/dist/modules/transcription/CueTimecodeReader.js.map +1 -0
  381. package/dist/modules/transcription/CueWordReader.d.ts +12 -0
  382. package/dist/modules/transcription/CueWordReader.d.ts.map +1 -0
  383. package/dist/modules/transcription/CueWordReader.js +2 -0
  384. package/dist/modules/transcription/CueWordReader.js.map +1 -0
  385. package/dist/modules/transcription/EstimatedCueWordReader.d.ts +16 -0
  386. package/dist/modules/transcription/EstimatedCueWordReader.d.ts.map +1 -0
  387. package/dist/modules/transcription/EstimatedCueWordReader.js +17 -0
  388. package/dist/modules/transcription/EstimatedCueWordReader.js.map +1 -0
  389. package/dist/modules/transcription/LogitsProcessorListFactory.d.ts +43 -0
  390. package/dist/modules/transcription/LogitsProcessorListFactory.d.ts.map +1 -0
  391. package/dist/modules/transcription/LogitsProcessorListFactory.js +72 -0
  392. package/dist/modules/transcription/LogitsProcessorListFactory.js.map +1 -0
  393. package/dist/modules/transcription/MediaBunnyAudioDecoder.d.ts +27 -0
  394. package/dist/modules/transcription/MediaBunnyAudioDecoder.d.ts.map +1 -0
  395. package/dist/modules/transcription/MediaBunnyAudioDecoder.js +76 -0
  396. package/dist/modules/transcription/MediaBunnyAudioDecoder.js.map +1 -0
  397. package/dist/modules/transcription/ModelFileCache.d.ts +20 -0
  398. package/dist/modules/transcription/ModelFileCache.d.ts.map +1 -0
  399. package/dist/modules/transcription/ModelFileCache.js +2 -0
  400. package/dist/modules/transcription/ModelFileCache.js.map +1 -0
  401. package/dist/modules/transcription/ModelFileCacheUnavailableError.d.ts +18 -0
  402. package/dist/modules/transcription/ModelFileCacheUnavailableError.d.ts.map +1 -0
  403. package/dist/modules/transcription/ModelFileCacheUnavailableError.js +18 -0
  404. package/dist/modules/transcription/ModelFileCacheUnavailableError.js.map +1 -0
  405. package/dist/modules/transcription/SrtTranscriber.d.ts +24 -15
  406. package/dist/modules/transcription/SrtTranscriber.d.ts.map +1 -1
  407. package/dist/modules/transcription/SrtTranscriber.js +32 -90
  408. package/dist/modules/transcription/SrtTranscriber.js.map +1 -1
  409. package/dist/modules/transcription/SubtitleFileUnreadableError.d.ts +22 -0
  410. package/dist/modules/transcription/SubtitleFileUnreadableError.d.ts.map +1 -0
  411. package/dist/modules/transcription/SubtitleFileUnreadableError.js +22 -0
  412. package/dist/modules/transcription/SubtitleFileUnreadableError.js.map +1 -0
  413. package/dist/modules/transcription/TimestampedCueWordReader.d.ts +27 -0
  414. package/dist/modules/transcription/TimestampedCueWordReader.d.ts.map +1 -0
  415. package/dist/modules/transcription/TimestampedCueWordReader.js +52 -0
  416. package/dist/modules/transcription/TimestampedCueWordReader.js.map +1 -0
  417. package/dist/modules/transcription/Transcriber.d.ts +13 -0
  418. package/dist/modules/transcription/Transcriber.d.ts.map +1 -1
  419. package/dist/modules/transcription/TransformersRuntime.d.ts +50 -0
  420. package/dist/modules/transcription/TransformersRuntime.d.ts.map +1 -0
  421. package/dist/modules/transcription/TransformersRuntime.js +79 -0
  422. package/dist/modules/transcription/TransformersRuntime.js.map +1 -0
  423. package/dist/modules/transcription/VttTranscriber.d.ts +25 -7
  424. package/dist/modules/transcription/VttTranscriber.d.ts.map +1 -1
  425. package/dist/modules/transcription/VttTranscriber.js +36 -15
  426. package/dist/modules/transcription/VttTranscriber.js.map +1 -1
  427. package/dist/modules/transcription/WhisperChunkStitcher.d.ts +51 -0
  428. package/dist/modules/transcription/WhisperChunkStitcher.d.ts.map +1 -0
  429. package/dist/modules/transcription/WhisperChunkStitcher.js +101 -0
  430. package/dist/modules/transcription/WhisperChunkStitcher.js.map +1 -0
  431. package/dist/modules/transcription/WhisperDeviceUnavailableError.d.ts +16 -0
  432. package/dist/modules/transcription/WhisperDeviceUnavailableError.d.ts.map +1 -0
  433. package/dist/modules/transcription/WhisperDeviceUnavailableError.js +16 -0
  434. package/dist/modules/transcription/WhisperDeviceUnavailableError.js.map +1 -0
  435. package/dist/modules/transcription/WhisperInferenceFailedError.d.ts +16 -0
  436. package/dist/modules/transcription/WhisperInferenceFailedError.d.ts.map +1 -0
  437. package/dist/modules/transcription/WhisperInferenceFailedError.js +16 -0
  438. package/dist/modules/transcription/WhisperInferenceFailedError.js.map +1 -0
  439. package/dist/modules/transcription/WhisperInferenceProgressTracker.d.ts +61 -0
  440. package/dist/modules/transcription/WhisperInferenceProgressTracker.d.ts.map +1 -0
  441. package/dist/modules/transcription/WhisperInferenceProgressTracker.js +102 -0
  442. package/dist/modules/transcription/WhisperInferenceProgressTracker.js.map +1 -0
  443. package/dist/modules/transcription/WhisperLoopAbortLogitsProcessor.d.ts +38 -0
  444. package/dist/modules/transcription/WhisperLoopAbortLogitsProcessor.d.ts.map +1 -0
  445. package/dist/modules/transcription/WhisperLoopAbortLogitsProcessor.js +94 -0
  446. package/dist/modules/transcription/WhisperLoopAbortLogitsProcessor.js.map +1 -0
  447. package/dist/modules/transcription/WhisperModelLoadFailedError.d.ts +15 -0
  448. package/dist/modules/transcription/WhisperModelLoadFailedError.d.ts.map +1 -0
  449. package/dist/modules/transcription/WhisperModelLoadFailedError.js +15 -0
  450. package/dist/modules/transcription/WhisperModelLoadFailedError.js.map +1 -0
  451. package/dist/modules/transcription/WhisperTranscriber.d.ts +106 -7
  452. package/dist/modules/transcription/WhisperTranscriber.d.ts.map +1 -1
  453. package/dist/modules/transcription/WhisperTranscriber.js +312 -25
  454. package/dist/modules/transcription/WhisperTranscriber.js.map +1 -1
  455. package/dist/modules/transcription/WhisperWindowCoverage.d.ts +79 -0
  456. package/dist/modules/transcription/WhisperWindowCoverage.d.ts.map +1 -0
  457. package/dist/modules/transcription/WhisperWindowCoverage.js +129 -0
  458. package/dist/modules/transcription/WhisperWindowCoverage.js.map +1 -0
  459. package/dist/modules/transcription/WordTimingEstimator.d.ts +14 -0
  460. package/dist/modules/transcription/WordTimingEstimator.d.ts.map +1 -0
  461. package/dist/modules/transcription/WordTimingEstimator.js +33 -0
  462. package/dist/modules/transcription/WordTimingEstimator.js.map +1 -0
  463. package/dist/modules/transcription/index.d.ts +8 -2
  464. package/dist/modules/transcription/index.d.ts.map +1 -1
  465. package/dist/modules/transcription/index.js +5 -1
  466. package/dist/modules/transcription/index.js.map +1 -1
  467. package/dist/modules/video/mediabunny/MediaBunnyTranscodeCoordinator.d.ts.map +1 -1
  468. package/dist/modules/video/mediabunny/MediaBunnyTranscodeCoordinator.js +8 -0
  469. package/dist/modules/video/mediabunny/MediaBunnyTranscodeCoordinator.js.map +1 -1
  470. package/dist/modules/video/mediabunny/frame/CurrentFrameVideoSource.d.ts +3 -1
  471. package/dist/modules/video/mediabunny/frame/CurrentFrameVideoSource.d.ts.map +1 -1
  472. package/dist/modules/video/mediabunny/frame/CurrentFrameVideoSource.js +33 -23
  473. package/dist/modules/video/mediabunny/frame/CurrentFrameVideoSource.js.map +1 -1
  474. package/dist/modules/video/mediabunny/painter/CaptionsOverlayFramePainter.js +1 -1
  475. package/dist/modules/video/mediabunny/painter/CaptionsOverlayFramePainter.js.map +1 -1
  476. package/dist/modules/video/mediabunny/painter/TopLayerSource.d.ts +6 -7
  477. package/dist/modules/video/mediabunny/painter/TopLayerSource.d.ts.map +1 -1
  478. package/package.json +13 -10
  479. package/dist/modules/document/Tag.d.ts.map +0 -1
  480. package/dist/modules/document/Tag.js.map +0 -1
  481. package/dist/modules/rendering/styles/BehindActorBaselineCss.d.ts +0 -19
  482. package/dist/modules/rendering/styles/BehindActorBaselineCss.d.ts.map +0 -1
  483. package/dist/modules/rendering/styles/BehindActorBaselineCss.js +0 -19
  484. package/dist/modules/rendering/styles/BehindActorBaselineCss.js.map +0 -1
  485. package/dist/modules/rendering/styles/VideoFrameLayerClass.d.ts.map +0 -1
  486. package/dist/modules/rendering/styles/VideoFrameLayerClass.js +0 -21
  487. package/dist/modules/rendering/styles/VideoFrameLayerClass.js.map +0 -1
  488. package/dist/modules/rendering/types/BehindActorRequirement.d.ts +0 -12
  489. package/dist/modules/rendering/types/BehindActorRequirement.d.ts.map +0 -1
  490. package/dist/modules/rendering/types/BehindActorRequirement.js +0 -2
  491. package/dist/modules/rendering/types/BehindActorRequirement.js.map +0 -1
  492. package/dist/modules/transcription/BrowserAudioDecoder.d.ts +0 -13
  493. package/dist/modules/transcription/BrowserAudioDecoder.d.ts.map +0 -1
  494. package/dist/modules/transcription/BrowserAudioDecoder.js +0 -34
  495. package/dist/modules/transcription/BrowserAudioDecoder.js.map +0 -1
@@ -0,0 +1,102 @@
1
+ /**
2
+ * Turns Whisper's chunk-relative timestamp stream into a monotonic
3
+ * fraction of the inference work done so far, in
4
+ * `[0, MAX_STREAMING_FRACTION]`.
5
+ *
6
+ * The transformers.js pipeline slices audio into fixed windows of
7
+ * `chunkLengthSeconds` and slides them by `chunkLengthSeconds - 2 *
8
+ * strideLengthSeconds`, decoding each window independently. Whisper's
9
+ * predicted timestamps restart at zero on every window, so a backward
10
+ * step in the observed stream is treated as the boundary between two
11
+ * pipeline windows. Small backward jitter *within* a window (the
12
+ * decoder occasionally re-emits an earlier timestamp) is tolerated up
13
+ * to `INTRA_CHUNK_TOLERANCE_SECONDS`.
14
+ *
15
+ * Progress is measured against the audio each window decodes, not
16
+ * against the position reached in the source. Consecutive windows
17
+ * overlap by `2 * strideLengthSeconds`, and that overlap is decoded
18
+ * twice: a position-based fraction cannot advance until a new window
19
+ * has re-decoded everything the previous one already covered, which
20
+ * shows up as the bar sitting frozen for the first third of every
21
+ * window. Counting each window's own audio makes the fraction track
22
+ * the decoder's actual cost instead.
23
+ *
24
+ * The returned fraction never decreases and never reaches `1`:
25
+ * Whisper still runs a word-timestamp post-processing pass after the
26
+ * last streamed segment, so a strictly-below-one ceiling leaves room
27
+ * for the caller to emit the terminal `1` from outside the streamer
28
+ * once the whole call actually completes.
29
+ */
30
+ export class WhisperInferenceProgressTracker {
31
+ static INTRA_CHUNK_TOLERANCE_SECONDS = 1;
32
+ static MAX_STREAMING_FRACTION = 0.95;
33
+ windowSeconds;
34
+ totalWorkSeconds;
35
+ windowAdvanceSeconds;
36
+ currentWindowIndex = 0;
37
+ workBeforeCurrentWindow = 0;
38
+ lastReportedChunkTime = 0;
39
+ lastFraction = 0;
40
+ constructor(durationSeconds, chunkLengthSeconds, strideLengthSeconds) {
41
+ this.windowAdvanceSeconds = Math.max(1, chunkLengthSeconds - 2 * strideLengthSeconds);
42
+ this.windowSeconds = this.measureWindows(durationSeconds, chunkLengthSeconds);
43
+ this.totalWorkSeconds = this.windowSeconds.reduce((total, seconds) => total + seconds, 0);
44
+ }
45
+ /** The audio each pipeline window decodes, in window order. */
46
+ get windowLayout() {
47
+ return this.windowSeconds;
48
+ }
49
+ /** How far the pipeline slides between consecutive windows, in seconds. */
50
+ get advanceSeconds() {
51
+ return this.windowAdvanceSeconds;
52
+ }
53
+ /**
54
+ * Feeds a chunk-relative timestamp and returns the resulting monotonic
55
+ * progress fraction over the whole inference.
56
+ */
57
+ observeChunkEnd(timeWithinChunk) {
58
+ if (this.isNewPipelineWindow(timeWithinChunk)) {
59
+ this.advanceWindow();
60
+ }
61
+ this.lastReportedChunkTime = timeWithinChunk;
62
+ this.lastFraction = Math.max(this.lastFraction, this.fractionAt(timeWithinChunk));
63
+ return this.lastFraction;
64
+ }
65
+ /**
66
+ * Reproduces the window layout the transformers.js ASR pipeline builds
67
+ * for this audio, as the amount of audio each window carries. The last
68
+ * window is short whenever the audio does not end on a window boundary.
69
+ */
70
+ measureWindows(durationSeconds, chunkLengthSeconds) {
71
+ const advance = this.windowAdvanceSeconds;
72
+ const windows = [];
73
+ for (let start = 0;; start += advance) {
74
+ windows.push(Math.min(chunkLengthSeconds, durationSeconds - start));
75
+ if (start + chunkLengthSeconds >= durationSeconds)
76
+ return windows;
77
+ }
78
+ }
79
+ isNewPipelineWindow(timeWithinChunk) {
80
+ const tolerance = WhisperInferenceProgressTracker.INTRA_CHUNK_TOLERANCE_SECONDS;
81
+ return timeWithinChunk < this.lastReportedChunkTime - tolerance;
82
+ }
83
+ // Whisper can report more boundaries than the layout predicts; staying on
84
+ // the last window keeps the fraction below its ceiling instead of overshooting.
85
+ advanceWindow() {
86
+ if (this.currentWindowIndex >= this.windowSeconds.length - 1)
87
+ return;
88
+ this.workBeforeCurrentWindow += this.currentWindowSeconds();
89
+ this.currentWindowIndex += 1;
90
+ }
91
+ currentWindowSeconds() {
92
+ return this.windowSeconds[this.currentWindowIndex] ?? 0;
93
+ }
94
+ fractionAt(timeWithinChunk) {
95
+ if (this.totalWorkSeconds <= 0)
96
+ return 0;
97
+ const workWithinWindow = Math.min(Math.max(timeWithinChunk, 0), this.currentWindowSeconds());
98
+ const fraction = (this.workBeforeCurrentWindow + workWithinWindow) / this.totalWorkSeconds;
99
+ return Math.min(WhisperInferenceProgressTracker.MAX_STREAMING_FRACTION, fraction);
100
+ }
101
+ }
102
+ //# sourceMappingURL=WhisperInferenceProgressTracker.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WhisperInferenceProgressTracker.js","sourceRoot":"","sources":["../../../src/modules/transcription/WhisperInferenceProgressTracker.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,MAAM,OAAO,+BAA+B;IAClC,MAAM,CAAU,6BAA6B,GAAG,CAAC,CAAC;IAClD,MAAM,CAAU,sBAAsB,GAAG,IAAI,CAAC;IAErC,aAAa,CAAW;IACxB,gBAAgB,CAAS;IACzB,oBAAoB,CAAS;IAEtC,kBAAkB,GAAG,CAAC,CAAC;IACvB,uBAAuB,GAAG,CAAC,CAAC;IAC5B,qBAAqB,GAAG,CAAC,CAAC;IAC1B,YAAY,GAAG,CAAC,CAAC;IAEzB,YACE,eAAuB,EACvB,kBAA0B,EAC1B,mBAA2B;QAE3B,IAAI,CAAC,oBAAoB,GAAG,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,kBAAkB,GAAG,CAAC,GAAG,mBAAmB,CAAC,CAAC;QACtF,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC,cAAc,CAAC,eAAe,EAAE,kBAAkB,CAAC,CAAC;QAC9E,IAAI,CAAC,gBAAgB,GAAG,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,CAAC,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,KAAK,GAAG,OAAO,EAAE,CAAC,CAAC,CAAC;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AC;YAAE,OAAO;QACrE,IAAI,CAAC,uBAAuB,IAAI,IAAI,CAAC,oBAAoB,EAAE,CAAC;QAC5D,IAAI,CAAC,kBAAkB,IAAI,CAAC,CAAC;IAC/B,CAAC;IAEO,oBAAoB;QAC1B,OAAO,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,kBAAkB,CAAC,IAAI,CAAC,CAAC;IAC1D,CAAC;IAEO,UAAU,CAAC,eAAuB;QACxC,IAAI,IAAI,CAAC,gBAAgB,IAAI,CAAC;YAAE,OAAO,CAAC,CAAC;QACzC,MAAM,gBAAgB,GAAG,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,eAAe,EAAE,CAAC,CAAC,EAAE,IAAI,CAAC,oBAAoB,EAAE,CAAC,CAAC;QAC7F,MAAM,QAAQ,GAAG,CAAC,IAAI,CAAC,uBAAuB,GAAG,gBAAgB,CAAC,GAAG,IAAI,CAAC,gBAAgB,CAAC;QAC3F,OAAO,IAAI,CAAC,GAAG,CAAC,+BAA+B,CAAC,sBAAsB,EAAE,QAAQ,CAAC,CAAC;IACpF,CAAC"}
@@ -0,0 +1,38 @@
1
+ import type { Tensor } from '@huggingface/transformers';
2
+ /**
3
+ * Cuts short a generation that has degenerated into a repetition loop.
4
+ *
5
+ * Detection: the tail of the generated sequence contains at least
6
+ * `MIN_FULL_PERIODS` verbatim repetitions of some unit AND spans at
7
+ * least `MIN_REPETITION_TOKENS` tokens. On detection every logit
8
+ * except end-of-sequence is forced to `-Infinity`, so the next step
9
+ * emits end-of-sequence and the generation stops without burning the
10
+ * rest of the token budget on garbage.
11
+ *
12
+ * The guard only ends generations early; it never alters the content
13
+ * of a healthy one.
14
+ *
15
+ * Deliberately not a subclass of the inference library's processor base.
16
+ * Extending it would make this file load the library, and none of the
17
+ * detection below needs anything from it — `apply` is the whole of it.
18
+ * A thin subclass built once the library is loaded adapts this to what
19
+ * the pipeline expects.
20
+ */
21
+ export declare class WhisperLoopAbortLogitsProcessor {
22
+ private readonly endOfSequenceTokenId;
23
+ private fired;
24
+ constructor(endOfSequenceTokenId: number);
25
+ /**
26
+ * Inspects one generation step and, on a detected loop, rewrites the
27
+ * logits so the next token can only be end-of-sequence. Returns the
28
+ * same tensor it was given, rewritten in place or untouched.
29
+ */
30
+ apply(inputIds: bigint[][], logits: Tensor): Tensor;
31
+ /** True when the guard fired since the previous call; reading resets it. */
32
+ consumeFired(): boolean;
33
+ private endsInRepetitionLoop;
34
+ private detectionWindowFor;
35
+ private isPeriodic;
36
+ private forceEndOfSequence;
37
+ }
38
+ //# sourceMappingURL=WhisperLoopAbortLogitsProcessor.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WhisperLoopAbortLogitsProcessor.d.ts","sourceRoot":"","sources":["../../../src/modules/transcription/WhisperLoopAbortLogitsProcessor.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,2BAA2B,CAAC;AAiBxD;;;;;;;;;;;;;;;;;;GAkBG;AACH,qBAAa,+BAA+B;IAG9B,OAAO,CAAC,QAAQ,CAAC,oBAAoB;IAFjD,OAAO,CAAC,KAAK,CAAS;gBAEO,oBAAoB,EAAE,MAAM;IAEzD;;;;OAIG;IACH,KAAK,CAAC,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM;IASnD,4EAA4E;IAC5E,YAAY,IAAI,OAAO;IAMvB,OAAO,CAAC,oBAAoB;IAc5B,OAAO,CAAC,kBAAkB;IAM1B,OAAO,CAAC,UAAU;IAOlB,OAAO,CAAC,kBAAkB;CAM3B"}
@@ -0,0 +1,94 @@
1
+ // Full repetitions the tail must show before the pattern is trusted as
2
+ // degenerate. Two verbatim repetitions of a phrase can be legitimate
3
+ // emphasis; five cannot realistically be. This is a floor — longer
4
+ // per-period windows still need at least this many repetitions.
5
+ const MIN_FULL_PERIODS = 5;
6
+ // Total token count the repeating tail must reach before it counts. Short
7
+ // repeated tails — a 3-word chorus repeated a handful of times, a hymn
8
+ // refrain — can be legitimate speech and stay below this bar. The
9
+ // combination `MIN_FULL_PERIODS` full periods AND `MIN_REPETITION_TOKENS`
10
+ // total tokens filters those out while still catching the multi-hundred-
11
+ // token degenerate loops Whisper falls into. This is a floor on total
12
+ // length, not a cap on period size.
13
+ const MIN_REPETITION_TOKENS = 50;
14
+ /**
15
+ * Cuts short a generation that has degenerated into a repetition loop.
16
+ *
17
+ * Detection: the tail of the generated sequence contains at least
18
+ * `MIN_FULL_PERIODS` verbatim repetitions of some unit AND spans at
19
+ * least `MIN_REPETITION_TOKENS` tokens. On detection every logit
20
+ * except end-of-sequence is forced to `-Infinity`, so the next step
21
+ * emits end-of-sequence and the generation stops without burning the
22
+ * rest of the token budget on garbage.
23
+ *
24
+ * The guard only ends generations early; it never alters the content
25
+ * of a healthy one.
26
+ *
27
+ * Deliberately not a subclass of the inference library's processor base.
28
+ * Extending it would make this file load the library, and none of the
29
+ * detection below needs anything from it — `apply` is the whole of it.
30
+ * A thin subclass built once the library is loaded adapts this to what
31
+ * the pipeline expects.
32
+ */
33
+ export class WhisperLoopAbortLogitsProcessor {
34
+ endOfSequenceTokenId;
35
+ fired = false;
36
+ constructor(endOfSequenceTokenId) {
37
+ this.endOfSequenceTokenId = endOfSequenceTokenId;
38
+ }
39
+ /**
40
+ * Inspects one generation step and, on a detected loop, rewrites the
41
+ * logits so the next token can only be end-of-sequence. Returns the
42
+ * same tensor it was given, rewritten in place or untouched.
43
+ */
44
+ apply(inputIds, logits) {
45
+ for (let batch = 0; batch < inputIds.length; batch++) {
46
+ if (!this.endsInRepetitionLoop(inputIds[batch] ?? []))
47
+ continue;
48
+ this.fired = true;
49
+ this.forceEndOfSequence(batch, logits);
50
+ }
51
+ return logits;
52
+ }
53
+ /** True when the guard fired since the previous call; reading resets it. */
54
+ consumeFired() {
55
+ const fired = this.fired;
56
+ this.fired = false;
57
+ return fired;
58
+ }
59
+ endsInRepetitionLoop(sequence) {
60
+ const maxPeriod = Math.floor(sequence.length / MIN_FULL_PERIODS);
61
+ for (let period = 1; period <= maxPeriod; period++) {
62
+ const windowSize = this.detectionWindowFor(period);
63
+ if (windowSize > sequence.length)
64
+ continue;
65
+ if (this.isPeriodic(sequence, sequence.length - windowSize, period))
66
+ return true;
67
+ }
68
+ return false;
69
+ }
70
+ // Smallest multiple of `period` that satisfies both floors: at least
71
+ // `MIN_FULL_PERIODS` full repetitions, and at least `MIN_REPETITION_TOKENS`
72
+ // total tokens. Rounding up to a multiple of `period` keeps `isPeriodic`
73
+ // aligned to full repetitions.
74
+ detectionWindowFor(period) {
75
+ const byPeriodFloor = period * MIN_FULL_PERIODS;
76
+ const byTokenFloor = period * Math.ceil(MIN_REPETITION_TOKENS / period);
77
+ return Math.max(byPeriodFloor, byTokenFloor);
78
+ }
79
+ isPeriodic(sequence, from, period) {
80
+ for (let i = from + period; i < sequence.length; i++) {
81
+ if (sequence[i] !== sequence[i - period])
82
+ return false;
83
+ }
84
+ return true;
85
+ }
86
+ forceEndOfSequence(batch, logits) {
87
+ const row = logits[batch];
88
+ if (!row)
89
+ return;
90
+ row.data.fill(-Infinity);
91
+ row.data[this.endOfSequenceTokenId] = 0;
92
+ }
93
+ }
94
+ //# sourceMappingURL=WhisperLoopAbortLogitsProcessor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WhisperLoopAbortLogitsProcessor.js","sourceRoot":"","sources":["../../../src/modules/transcription/WhisperLoopAbortLogitsProcessor.ts"],"names":[],"mappings":"AAEA,uEAAuE;AACvE,qEAAqE;AACrE,mEAAmE;AACnE,gEAAgE;AAChE,MAAM,gBAAgB,GAAG,CAAC,CAAC;AAE3B,0EAA0E;AAC1E,uEAAuE;AACvE,kEAAkE;AAClE,0EAA0E;AAC1E,yEAAyE;AACzE,sEAAsE;AACtE,oCAAoC;AACpC,MAAM,qBAAqB,GAAG,EAAE,CAAC;AAEjC;;;;;;;;;;;;;;;;;;GAkBG;AACH,MAAM,OAAO,+BAA+B;IAGb;IA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kBAAkB,CAAC,MAAc;QACvC,MAAM,aAAa,GAAG,MAAM,GAAG,gBAAgB,CAAC;QAChD,MAAM,YAAY,GAAG,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,qBAAqB,GAAG,MAAM,CAAC,CAAC;QACxE,OAAO,IAAI,CAAC,GAAG,CAAC,aAAa,EAAE,YAAY,CAAC,CAAC;IAC/C,CAAC;IAEO,UAAU,CAAC,QAA2B,EAAE,IAAY,EAAE,MAAc;QAC1E,KAAK,IAAI,CAAC,GAAG,IAAI,GAAG,MAAM,EAAE,CAAC,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE,CAAC;YACrD,IAAI,QAAQ,CAAC,CAAC,CAAC,KAAK,QAAQ,CAAC,CAAC,GAAG,MAAM,CAAC;gBAAE,OAAO,KAAK,CAAC;QACzD,CAAC;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAEO,kBAAkB,CAAC,KAAa,EAAE,MAAc;QACtD,MAAM,GAAG,GAAI,MAAmD,CAAC,KAAK,CAAC,CAAC;QACxE,IAAI,CAAC,GAAG;YAAE,OAAO;QACjB,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,QAAQ,CAAC,CAAC;QACzB,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,oBAAoB,CAAC,GAAG,CAAC,CAAC;IAC1C,CAAC;CACF"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Raised when preparing the Whisper pipeline fails — the model files
3
+ * could not be fetched, the runtime could not instantiate them, or an
4
+ * upstream library rejected the load for any other reason.
5
+ *
6
+ * The `.name` string is set explicitly, and exposed as `ERROR_NAME` on
7
+ * the class, so consumers can recognise the failure across a Worker
8
+ * boundary (where structured cloning preserves the string fields but
9
+ * not the class identity) with a single source of truth.
10
+ */
11
+ export declare class WhisperModelLoadFailedError extends Error {
12
+ static readonly ERROR_NAME = "WhisperModelLoadFailedError";
13
+ readonly name = "WhisperModelLoadFailedError";
14
+ }
15
+ //# sourceMappingURL=WhisperModelLoadFailedError.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WhisperModelLoadFailedError.d.ts","sourceRoot":"","sources":["../../../src/modules/transcription/WhisperModelLoadFailedError.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,qBAAa,2BAA4B,SAAQ,KAAK;IACpD,MAAM,CAAC,QAAQ,CAAC,UAAU,iCAAiC;IAC3D,QAAQ,CAAC,IAAI,iCAA0C;CACxD"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Raised when preparing the Whisper pipeline fails — the model files
3
+ * could not be fetched, the runtime could not instantiate them, or an
4
+ * upstream library rejected the load for any other reason.
5
+ *
6
+ * The `.name` string is set explicitly, and exposed as `ERROR_NAME` on
7
+ * the class, so consumers can recognise the failure across a Worker
8
+ * boundary (where structured cloning preserves the string fields but
9
+ * not the class identity) with a single source of truth.
10
+ */
11
+ export class WhisperModelLoadFailedError extends Error {
12
+ static ERROR_NAME = 'WhisperModelLoadFailedError';
13
+ name = WhisperModelLoadFailedError.ERROR_NAME;
14
+ }
15
+ //# sourceMappingURL=WhisperModelLoadFailedError.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"WhisperModelLoadFailedError.js","sourceRoot":"","sources":["../../../src/modules/transcription/WhisperModelLoadFailedError.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,MAAM,OAAO,2BAA4B,SAAQ,KAAK;IACpD,MAAM,CAAU,UAAU,GAAG,6BAA6B,CAAC;IAClD,IAAI,GAAG,2BAA2B,CAAC,UAAU,CAAC"}
@@ -1,8 +1,9 @@
1
1
  import { Document } from '../document/index';
2
2
  import type { AudioDecoder } from '../transcription/AudioDecoder';
3
- import type { Transcriber, TranscriberOptions, TranscriberProgressEvent } from '../transcription/Transcriber';
3
+ import type { ModelFileCache } from '../transcription/ModelFileCache';
4
+ import type { Transcriber, TranscriberOptions, TranscriberProgressEvent, UntranscribedRegion } from '../transcription/Transcriber';
4
5
  export declare const WHISPER_SAMPLE_RATE = 16000;
5
- export type WhisperModel = 'tiny' | 'base' | 'small' | 'distil-small.en' | 'distil-medium.en';
6
+ export type WhisperModel = 'tiny' | 'base' | 'small' | 'medium' | 'distil-small.en' | 'distil-medium.en';
6
7
  export type WhisperDevice = 'auto' | 'wasm' | 'webgpu';
7
8
  export interface WhisperTranscriberConfig {
8
9
  model?: WhisperModel;
@@ -21,24 +22,122 @@ export interface WhisperTranscriberConfig {
21
22
  * in a Web Worker (where browser audio APIs are unavailable) with a pre-
22
23
  * decoded byte-stream decoder.
23
24
  *
24
- * Progress reporting is real-only: the loading stage tracks model weight
25
- * download from HuggingFace; the inferring stage emits a single boundary
26
- * event when inference begins, since the underlying pipeline exposes no
27
- * usable per-chunk hook in v4.
25
+ * Progress reporting is real-only for both stages. The loading stage
26
+ * tracks model weight download from HuggingFace. The inferring stage
27
+ * hooks a `WhisperTextStreamer` into `model.generate` so each
28
+ * pipeline-window boundary that Whisper predicts translates into an
29
+ * `[0, 1]` fraction of the audio processed so far. Clips short enough to
30
+ * fit in a single window emit no boundaries — the field stays at zero
31
+ * and the consumer can only render that as indeterminate.
32
+ *
33
+ * Coverage policy: every pipeline window's decoding is audited. A
34
+ * non-final window that ended by its own end-of-sequence but left
35
+ * audio before the next window's start gets one re-decode over real
36
+ * audio from that point. A window cut from outside — the repetition-
37
+ * loop guard or the token ceiling — is degenerate: its unclosed tail
38
+ * is dropped and its region is deliberately left untranscribed, never
39
+ * retried. A re-decode that degenerates too is discarded the same way.
40
+ * The final window is reported the same way when cut or stopped
41
+ * mid-segment; a clean close there is trusted as the end of speech.
28
42
  */
29
43
  export declare class WhisperTranscriber implements Transcriber {
30
44
  private readonly decoder;
31
45
  private readonly model;
32
46
  private readonly device;
47
+ private readonly chunkStitcher;
48
+ private readonly transformers;
49
+ private processorLists;
33
50
  private pipelinePromise;
34
- constructor(decoder: AudioDecoder, { model, device }?: WhisperTranscriberConfig);
51
+ constructor(decoder: AudioDecoder, { model, device }?: WhisperTranscriberConfig, modelFileCache?: ModelFileCache);
35
52
  onProgress?: (event: TranscriberProgressEvent) => void;
53
+ onUntranscribedRegion?: (region: UntranscribedRegion) => void;
36
54
  transcribe(audio: Blob, options?: TranscriberOptions): Promise<Document>;
55
+ /**
56
+ * Builds the progress tracker for this audio, or `null` when a single
57
+ * pipeline window covers everything — no window boundary is ever
58
+ * reported then, so the progress bar stays indeterminate.
59
+ */
60
+ private buildProgressTracker;
61
+ /**
62
+ * Builds a `WhisperTextStreamer` that translates Whisper's per-window
63
+ * timestamp emissions into `[0, 1]` inference progress and feeds the
64
+ * per-window coverage record.
65
+ *
66
+ * `on_finalize` fires at the end of every `model.generate` call — one
67
+ * per pipeline window while the long-form layering stays opted out —
68
+ * which makes it the exact window delimiter the coverage record needs.
69
+ * It is deliberately not wired to progress: the terminal `progress: 1`
70
+ * can only come from the caller, after the whole call returns.
71
+ */
72
+ private buildProgressStreamer;
73
+ /**
74
+ * Builds the anti-loop guard for a generation, or `null` when the
75
+ * model's end-of-sequence token cannot be located — the guard can
76
+ * only abort by forcing that token.
77
+ */
78
+ private buildLoopGuard;
79
+ private loadPipelineOrFail;
80
+ private runInferenceOrFail;
81
+ /**
82
+ * Loads the pipeline once and reuses it for every later call.
83
+ *
84
+ * A failed load is *not* kept. The weights arrive over the network
85
+ * and the common failure is a transfer that dies partway, which the
86
+ * next attempt may well complete; caching the rejection would make
87
+ * every retry fail instantly without ever reaching the network
88
+ * again, leaving a reload as the only way out.
89
+ */
37
90
  private loadPipeline;
38
91
  private resolveDevice;
39
92
  private isWebGPUAvailable;
40
93
  private buildPipelineOptions;
94
+ /**
95
+ * The factory is built from the loaded library, so it is reached
96
+ * through the same load the pipeline came from rather than held from
97
+ * construction. By the time any generation runs, that load is settled.
98
+ */
99
+ private buildProcessorList;
41
100
  private handleLoadProgress;
101
+ /**
102
+ * The audio regions the main pass left uncovered. Empty when the
103
+ * number of generation passes does not match the expected window
104
+ * layout — that means the underlying pipeline changed its long-form
105
+ * behaviour and per-window attribution can no longer be trusted.
106
+ */
107
+ private detectUncoveredGaps;
108
+ /**
109
+ * Replaces the content of every uncovered gap. The main pass's words
110
+ * inside a gap come from tokens past their window's last closed
111
+ * segment — the same unclosed tail the reference Whisper decoder
112
+ * discards before re-decoding — so they are dropped. Dropping is safe
113
+ * because the word-timestamp alignment is monotonic in token order:
114
+ * no word of a closed segment lands past that segment's end.
115
+ *
116
+ * A rescuable gap gets one extra pass over real audio. A
117
+ * non-rescuable gap does not — its region is reported and left
118
+ * untranscribed rather than retried.
119
+ */
120
+ private redecodeGaps;
121
+ private isInsideAnyGap;
122
+ /**
123
+ * Runs one extra decoding pass over a full window of real audio
124
+ * starting at the gap and keeps the words that fall inside it. Words
125
+ * past the gap's end are dropped — the next pipeline window already
126
+ * covers that region.
127
+ *
128
+ * Best-effort by design: the main transcription is already in hand, so
129
+ * a failed rescue logs and contributes nothing instead of failing the
130
+ * whole call.
131
+ */
132
+ private rescueGap;
133
+ private reportUntranscribed;
134
+ /**
135
+ * Shifts slice-relative rescue chunks to absolute time and keeps the
136
+ * ones anchored inside the gap. A chunk with no usable timestamp
137
+ * cannot be placed and is dropped.
138
+ */
139
+ private chunksWithinGap;
140
+ private mergeChunks;
42
141
  private buildDocument;
43
142
  }
44
143
  //# sourceMappingURL=WhisperTranscriber.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"WhisperTranscriber.d.ts","sourceRoot":"","sources":["../../../src/modules/transcription/WhisperTranscriber.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,QAAQ,EAA8C,MAAM,yBAAyB,CAAC;AAC/F,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,qCAAqC,CAAC;AACxE,OAAO,KAAK,EACV,WAAW,EACX,kBAAkB,EAClB,wBAAwB,EACzB,MAAM,oCAAoC,CAAC;AAE5C,eAAO,MAAM,mBAAmB,QAAS,CAAC;AAE1C,MAAM,MAAM,YAAY,GACpB,MAAM,GACN,MAAM,GACN,OAAO,GACP,iBAAiB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