@dxos/plugin-transcription 0.8.4-main.fcfe5033a5 → 0.8.4-staging.60fe92afc8

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 (319) hide show
  1. package/LICENSE +102 -5
  2. package/PLUGIN.mdl +401 -0
  3. package/README.md +1 -1
  4. package/dist/lib/neutral/TranscriptionArticle-L6XANBH5.mjs +54 -0
  5. package/dist/lib/neutral/TranscriptionArticle-L6XANBH5.mjs.map +7 -0
  6. package/dist/lib/neutral/TranscriptionPlugin.mjs +46 -0
  7. package/dist/lib/neutral/TranscriptionPlugin.mjs.map +7 -0
  8. package/dist/lib/neutral/TranscriptionPlugin.node.mjs +25 -0
  9. package/dist/lib/neutral/TranscriptionPlugin.node.mjs.map +7 -0
  10. package/dist/lib/neutral/TranscriptionPlugin.workerd.mjs +21 -0
  11. package/dist/lib/neutral/TranscriptionPlugin.workerd.mjs.map +7 -0
  12. package/dist/lib/neutral/blueprint-definition-DA4QFRYJ.mjs +15 -0
  13. package/dist/lib/neutral/blueprint-definition-DA4QFRYJ.mjs.map +7 -0
  14. package/dist/lib/neutral/blueprints/index.mjs +8 -0
  15. package/dist/lib/neutral/capabilities/index.mjs +17 -0
  16. package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
  17. package/dist/lib/neutral/chunk-FHNI26QW.mjs +45 -0
  18. package/dist/lib/neutral/chunk-FHNI26QW.mjs.map +7 -0
  19. package/dist/lib/{browser/chunk-HOOPZ7EM.mjs → neutral/chunk-KAEXRX3Y.mjs} +1 -1
  20. package/dist/lib/{browser/chunk-KOX4WNAR.mjs → neutral/chunk-KMT3BMMQ.mjs} +35 -22
  21. package/dist/lib/neutral/chunk-KMT3BMMQ.mjs.map +7 -0
  22. package/dist/lib/neutral/chunk-KXJZEYS7.mjs +8 -0
  23. package/dist/lib/neutral/chunk-KXJZEYS7.mjs.map +7 -0
  24. package/dist/lib/neutral/chunk-MLRJWAQH.mjs +179 -0
  25. package/dist/lib/neutral/chunk-MLRJWAQH.mjs.map +7 -0
  26. package/dist/lib/neutral/chunk-TO77KAQK.mjs +298 -0
  27. package/dist/lib/neutral/chunk-TO77KAQK.mjs.map +7 -0
  28. package/dist/lib/neutral/chunk-TX3NQISZ.mjs +435 -0
  29. package/dist/lib/neutral/chunk-TX3NQISZ.mjs.map +7 -0
  30. package/dist/lib/{browser/blueprints/index.mjs → neutral/chunk-ZR4BH4QQ.mjs} +5 -6
  31. package/dist/lib/neutral/chunk-ZR4BH4QQ.mjs.map +7 -0
  32. package/dist/lib/neutral/components/index.mjs +269 -0
  33. package/dist/lib/neutral/components/index.mjs.map +7 -0
  34. package/dist/lib/neutral/containers/index.mjs +9 -0
  35. package/dist/lib/neutral/containers/index.mjs.map +7 -0
  36. package/dist/lib/{browser/create-BTWYQ6IM.mjs → neutral/create-RVR7VC33.mjs} +5 -5
  37. package/dist/lib/neutral/create-RVR7VC33.mjs.map +7 -0
  38. package/dist/lib/neutral/hooks/index.mjs +19 -0
  39. package/dist/lib/neutral/index.mjs +44 -0
  40. package/dist/lib/neutral/meta.json +1 -0
  41. package/dist/lib/neutral/meta.mjs +8 -0
  42. package/dist/lib/neutral/meta.mjs.map +7 -0
  43. package/dist/lib/{browser/open-CYRYIEZI.mjs → neutral/open-A5KXKRH4.mjs} +7 -7
  44. package/dist/lib/neutral/open-A5KXKRH4.mjs.map +7 -0
  45. package/dist/lib/neutral/operation-handler-NXMOAXFP.mjs +13 -0
  46. package/dist/lib/neutral/operation-handler-NXMOAXFP.mjs.map +7 -0
  47. package/dist/lib/neutral/operations/index.mjs +8 -0
  48. package/dist/lib/neutral/operations/index.mjs.map +7 -0
  49. package/dist/lib/neutral/plugin.mjs +16 -0
  50. package/dist/lib/neutral/plugin.mjs.map +7 -0
  51. package/dist/lib/neutral/react-surface-YMZRO242.mjs +26 -0
  52. package/dist/lib/neutral/react-surface-YMZRO242.mjs.map +7 -0
  53. package/dist/lib/{browser/summarize-X2ZYTN7S.mjs → neutral/summarize-5XPPMVTE.mjs} +9 -11
  54. package/dist/lib/neutral/summarize-5XPPMVTE.mjs.map +7 -0
  55. package/dist/lib/neutral/text-content-KBB37HSM.mjs +30 -0
  56. package/dist/lib/neutral/text-content-KBB37HSM.mjs.map +7 -0
  57. package/dist/lib/neutral/transcriber-OGSF3XO5.mjs +59 -0
  58. package/dist/lib/neutral/transcriber-OGSF3XO5.mjs.map +7 -0
  59. package/dist/lib/neutral/translations.mjs +24 -0
  60. package/dist/lib/neutral/translations.mjs.map +7 -0
  61. package/dist/lib/neutral/types/index.mjs +10 -0
  62. package/dist/lib/neutral/types/index.mjs.map +7 -0
  63. package/dist/types/src/TranscriptionPlugin.d.ts +1 -0
  64. package/dist/types/src/TranscriptionPlugin.d.ts.map +1 -1
  65. package/dist/types/src/TranscriptionPlugin.node.d.ts +4 -0
  66. package/dist/types/src/TranscriptionPlugin.node.d.ts.map +1 -0
  67. package/dist/types/src/TranscriptionPlugin.test.d.ts +2 -0
  68. package/dist/types/src/TranscriptionPlugin.test.d.ts.map +1 -0
  69. package/dist/types/src/TranscriptionPlugin.workerd.d.ts +4 -0
  70. package/dist/types/src/TranscriptionPlugin.workerd.d.ts.map +1 -0
  71. package/dist/types/src/blueprints/transcription-blueprint.d.ts +2 -2
  72. package/dist/types/src/blueprints/transcription-blueprint.d.ts.map +1 -1
  73. package/dist/types/src/capabilities/blueprint-definition.d.ts +1 -1
  74. package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -1
  75. package/dist/types/src/capabilities/index.d.ts +8 -3
  76. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  77. package/dist/types/src/capabilities/operation-handler.d.ts +1 -1
  78. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -1
  79. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  80. package/dist/types/src/capabilities/text-content.d.ts +8 -0
  81. package/dist/types/src/capabilities/text-content.d.ts.map +1 -0
  82. package/dist/types/src/capabilities/transcriber.d.ts +1 -1
  83. package/dist/types/src/capabilities/transcriber.d.ts.map +1 -1
  84. package/dist/types/src/components/Oracle/Oracle.d.ts +24 -0
  85. package/dist/types/src/components/Oracle/Oracle.d.ts.map +1 -0
  86. package/dist/types/src/components/Oracle/Oracle.stories.d.ts +32 -0
  87. package/dist/types/src/components/Oracle/Oracle.stories.d.ts.map +1 -0
  88. package/dist/types/src/components/Oracle/index.d.ts +2 -0
  89. package/dist/types/src/components/Oracle/index.d.ts.map +1 -0
  90. package/dist/types/src/components/Transcription/Transcription.d.ts +1 -8
  91. package/dist/types/src/components/Transcription/Transcription.d.ts.map +1 -1
  92. package/dist/types/src/components/Transcription/Transcription.stories.d.ts +20 -23
  93. package/dist/types/src/components/Transcription/Transcription.stories.d.ts.map +1 -1
  94. package/dist/types/src/components/Transcription/transcription-extension.d.ts.map +1 -1
  95. package/dist/types/src/components/index.d.ts +1 -0
  96. package/dist/types/src/components/index.d.ts.map +1 -1
  97. package/dist/types/src/containers/TranscriptionArticle/TranscriptionArticle.d.ts +6 -0
  98. package/dist/types/src/containers/TranscriptionArticle/TranscriptionArticle.d.ts.map +1 -0
  99. package/dist/types/src/containers/TranscriptionArticle/TranscriptionArticle.stories.d.ts +28 -0
  100. package/dist/types/src/containers/TranscriptionArticle/TranscriptionArticle.stories.d.ts.map +1 -0
  101. package/dist/types/src/containers/TranscriptionArticle/index.d.ts +2 -0
  102. package/dist/types/src/containers/TranscriptionArticle/index.d.ts.map +1 -0
  103. package/dist/types/src/containers/index.d.ts +1 -1
  104. package/dist/types/src/containers/index.d.ts.map +1 -1
  105. package/dist/types/src/enrichment/conversation.test.d.ts +2 -0
  106. package/dist/types/src/enrichment/conversation.test.d.ts.map +1 -0
  107. package/dist/types/src/enrichment/operations.d.ts +200 -0
  108. package/dist/types/src/enrichment/operations.d.ts.map +1 -0
  109. package/dist/types/src/enrichment/parser.d.ts +26 -0
  110. package/dist/types/src/enrichment/parser.d.ts.map +1 -0
  111. package/dist/types/src/enrichment/stream-simulator.d.ts +38 -0
  112. package/dist/types/src/enrichment/stream-simulator.d.ts.map +1 -0
  113. package/dist/types/src/hooks/index.d.ts +2 -1
  114. package/dist/types/src/hooks/index.d.ts.map +1 -1
  115. package/dist/types/src/hooks/useAudioFile.d.ts.map +1 -1
  116. package/dist/types/src/hooks/useAudioTrack.d.ts.map +1 -1
  117. package/dist/types/src/hooks/useFeedModelAdapter.d.ts +12 -0
  118. package/dist/types/src/hooks/useFeedModelAdapter.d.ts.map +1 -0
  119. package/dist/types/src/hooks/useTranscriber.d.ts +1 -1
  120. package/dist/types/src/hooks/useTranscriber.d.ts.map +1 -1
  121. package/dist/types/src/hooks/useTranscriptionRecording.d.ts +12 -0
  122. package/dist/types/src/hooks/useTranscriptionRecording.d.ts.map +1 -0
  123. package/dist/types/src/hooks/useVoiceInput.d.ts.map +1 -1
  124. package/dist/types/src/index.d.ts +2 -3
  125. package/dist/types/src/index.d.ts.map +1 -1
  126. package/dist/types/src/meta.d.ts +1 -1
  127. package/dist/types/src/meta.d.ts.map +1 -1
  128. package/dist/types/src/model/model.d.ts +2 -2
  129. package/dist/types/src/model/model.d.ts.map +1 -1
  130. package/dist/types/src/{segments-normalization → normalization}/index.d.ts +1 -1
  131. package/dist/types/src/normalization/index.d.ts.map +1 -0
  132. package/dist/types/src/{segments-normalization → normalization}/message-normalizer.d.ts +7 -5
  133. package/dist/types/src/normalization/message-normalizer.d.ts.map +1 -0
  134. package/dist/types/src/{operations/definitions.d.ts → normalization/normalization.d.ts} +464 -547
  135. package/dist/types/src/normalization/normalization.d.ts.map +1 -0
  136. package/dist/types/src/normalization/normalization.test.d.ts.map +1 -0
  137. package/dist/types/src/normalization/utils.d.ts.map +1 -0
  138. package/dist/types/src/operations/create.d.ts +3 -3
  139. package/dist/types/src/operations/create.d.ts.map +1 -1
  140. package/dist/types/src/operations/index.d.ts +1 -2
  141. package/dist/types/src/operations/index.d.ts.map +1 -1
  142. package/dist/types/src/operations/open.d.ts +3 -3
  143. package/dist/types/src/operations/open.d.ts.map +1 -1
  144. package/dist/types/src/operations/summarize.d.ts +3 -3
  145. package/dist/types/src/operations/summarize.d.ts.map +1 -1
  146. package/dist/types/src/plugin.d.ts +4 -0
  147. package/dist/types/src/plugin.d.ts.map +1 -0
  148. package/dist/types/src/stories/FileTranscription.stories.d.ts +20 -0
  149. package/dist/types/src/stories/FileTranscription.stories.d.ts.map +1 -0
  150. package/dist/types/src/stories/KeyWordRecognition.stories.d.ts.map +1 -0
  151. package/dist/types/src/{components/stories/MicrophoneTranscription.stories.d.ts → stories/LiveTranscription.stories.d.ts} +5 -5
  152. package/dist/types/src/stories/LiveTranscription.stories.d.ts.map +1 -0
  153. package/dist/types/src/stories/TranscriptionStory.d.ts +21 -0
  154. package/dist/types/src/stories/TranscriptionStory.d.ts.map +1 -0
  155. package/dist/types/src/stories/common.d.ts +248 -0
  156. package/dist/types/src/stories/common.d.ts.map +1 -0
  157. package/dist/types/src/testing/testing.d.ts +5 -6
  158. package/dist/types/src/testing/testing.d.ts.map +1 -1
  159. package/dist/types/src/transcriber/index.d.ts +1 -1
  160. package/dist/types/src/transcriber/index.d.ts.map +1 -1
  161. package/dist/types/src/transcriber/media-stream-recorder.d.ts.map +1 -1
  162. package/dist/types/src/transcriber/transcriber.d.ts +58 -3
  163. package/dist/types/src/transcriber/transcriber.d.ts.map +1 -1
  164. package/dist/types/src/transcriber/transcriber.test.d.ts +2 -0
  165. package/dist/types/src/transcriber/transcriber.test.d.ts.map +1 -0
  166. package/dist/types/src/transcriber/transcription-manager.d.ts +6 -4
  167. package/dist/types/src/transcriber/transcription-manager.d.ts.map +1 -1
  168. package/dist/types/src/translations.d.ts +9 -8
  169. package/dist/types/src/translations.d.ts.map +1 -1
  170. package/dist/types/src/types/TranscriptOperation.d.ts +1670 -0
  171. package/dist/types/src/types/TranscriptOperation.d.ts.map +1 -0
  172. package/dist/types/src/types/TranscriptionCapabilities.d.ts +17 -0
  173. package/dist/types/src/types/TranscriptionCapabilities.d.ts.map +1 -0
  174. package/dist/types/src/types/index.d.ts +2 -2
  175. package/dist/types/src/types/index.d.ts.map +1 -1
  176. package/dist/types/src/util/array.d.ts.map +1 -1
  177. package/dist/types/src/util/get-time-str.d.ts.map +1 -1
  178. package/dist/types/src/util/monitor-audio-level.d.ts.map +1 -1
  179. package/dist/types/src/util/render-byline.d.ts.map +1 -1
  180. package/dist/types/tsconfig.tsbuildinfo +1 -1
  181. package/package.json +136 -102
  182. package/src/TranscriptionPlugin.node.ts +20 -0
  183. package/src/TranscriptionPlugin.test.ts +31 -0
  184. package/src/TranscriptionPlugin.tsx +11 -31
  185. package/src/TranscriptionPlugin.workerd.ts +18 -0
  186. package/src/blueprints/transcription-blueprint.ts +3 -4
  187. package/src/capabilities/blueprint-definition.ts +6 -4
  188. package/src/capabilities/index.ts +9 -2
  189. package/src/capabilities/operation-handler.ts +1 -1
  190. package/src/capabilities/react-surface.tsx +2 -2
  191. package/src/capabilities/text-content.ts +33 -0
  192. package/src/capabilities/transcriber.ts +9 -5
  193. package/src/components/Oracle/Oracle.stories.tsx +147 -0
  194. package/src/components/Oracle/Oracle.tsx +142 -0
  195. package/src/components/Oracle/index.ts +5 -0
  196. package/src/components/Transcription/Transcription.stories.tsx +117 -153
  197. package/src/components/Transcription/Transcription.tsx +8 -17
  198. package/src/components/index.ts +1 -0
  199. package/src/containers/TranscriptionArticle/TranscriptionArticle.stories.tsx +61 -0
  200. package/src/containers/TranscriptionArticle/TranscriptionArticle.tsx +62 -0
  201. package/src/containers/TranscriptionArticle/index.ts +5 -0
  202. package/src/containers/index.ts +1 -1
  203. package/src/enrichment/conversation.test.ts +162 -0
  204. package/src/enrichment/conversation.txt +23 -0
  205. package/src/enrichment/operations.ts +271 -0
  206. package/src/enrichment/parser.ts +101 -0
  207. package/src/enrichment/stream-simulator.ts +125 -0
  208. package/src/hooks/index.ts +2 -1
  209. package/src/hooks/useAudioTrack.ts +1 -1
  210. package/src/hooks/useFeedModelAdapter.ts +46 -0
  211. package/src/hooks/useTranscriber.ts +7 -5
  212. package/src/hooks/useTranscriptionRecording.ts +87 -0
  213. package/src/hooks/useVoiceInput.ts +1 -1
  214. package/src/index.ts +4 -5
  215. package/src/meta.ts +28 -6
  216. package/src/model/model.test.ts +5 -5
  217. package/src/model/model.ts +3 -3
  218. package/src/{segments-normalization → normalization}/message-normalizer.ts +25 -17
  219. package/src/{segments-normalization → normalization}/normalization.test.ts +4 -38
  220. package/src/{segments-normalization → normalization}/normalization.ts +8 -9
  221. package/src/operations/create.ts +3 -3
  222. package/src/operations/index.ts +1 -3
  223. package/src/operations/open.ts +3 -3
  224. package/src/operations/summarize.ts +7 -7
  225. package/src/plugin.ts +11 -0
  226. package/src/stories/FileTranscription.stories.tsx +143 -0
  227. package/src/{components/stories → stories}/KeyWordRecognition.stories.tsx +36 -36
  228. package/src/stories/LiveTranscription.stories.tsx +153 -0
  229. package/src/stories/TranscriptionStory.tsx +101 -0
  230. package/src/stories/common.ts +233 -0
  231. package/src/testing/testing.ts +22 -34
  232. package/src/transcriber/index.ts +1 -1
  233. package/src/transcriber/transcriber.test.ts +104 -0
  234. package/src/transcriber/transcriber.ts +100 -55
  235. package/src/transcriber/transcription-manager.ts +14 -9
  236. package/src/translations.ts +3 -0
  237. package/src/{operations/definitions.ts → types/TranscriptOperation.ts} +14 -9
  238. package/src/types/TranscriptionCapabilities.ts +39 -0
  239. package/src/types/index.ts +2 -2
  240. package/src/vite-env.d.ts +10 -0
  241. package/dist/lib/browser/blueprints/index.mjs.map +0 -7
  242. package/dist/lib/browser/chunk-5LWSJZTZ.mjs +0 -17
  243. package/dist/lib/browser/chunk-5LWSJZTZ.mjs.map +0 -7
  244. package/dist/lib/browser/chunk-KOX4WNAR.mjs.map +0 -7
  245. package/dist/lib/browser/create-BTWYQ6IM.mjs.map +0 -7
  246. package/dist/lib/browser/index.mjs +0 -1213
  247. package/dist/lib/browser/index.mjs.map +0 -7
  248. package/dist/lib/browser/meta.json +0 -1
  249. package/dist/lib/browser/open-CYRYIEZI.mjs.map +0 -7
  250. package/dist/lib/browser/operations/index.mjs +0 -13
  251. package/dist/lib/browser/operations/index.mjs.map +0 -7
  252. package/dist/lib/browser/summarize-X2ZYTN7S.mjs.map +0 -7
  253. package/dist/lib/browser/types/index.mjs +0 -10
  254. package/dist/lib/node-esm/blueprints/index.mjs +0 -32
  255. package/dist/lib/node-esm/blueprints/index.mjs.map +0 -7
  256. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
  257. package/dist/lib/node-esm/chunk-MT5I4NH5.mjs +0 -112
  258. package/dist/lib/node-esm/chunk-MT5I4NH5.mjs.map +0 -7
  259. package/dist/lib/node-esm/chunk-NVM2QUMX.mjs +0 -37
  260. package/dist/lib/node-esm/chunk-NVM2QUMX.mjs.map +0 -7
  261. package/dist/lib/node-esm/chunk-X74WYCCE.mjs +0 -19
  262. package/dist/lib/node-esm/chunk-X74WYCCE.mjs.map +0 -7
  263. package/dist/lib/node-esm/create-MLUFPST2.mjs +0 -22
  264. package/dist/lib/node-esm/create-MLUFPST2.mjs.map +0 -7
  265. package/dist/lib/node-esm/index.mjs +0 -1214
  266. package/dist/lib/node-esm/index.mjs.map +0 -7
  267. package/dist/lib/node-esm/meta.json +0 -1
  268. package/dist/lib/node-esm/open-5IOC2U4Z.mjs +0 -28
  269. package/dist/lib/node-esm/open-5IOC2U4Z.mjs.map +0 -7
  270. package/dist/lib/node-esm/operations/index.mjs +0 -14
  271. package/dist/lib/node-esm/operations/index.mjs.map +0 -7
  272. package/dist/lib/node-esm/summarize-IORITU7T.mjs +0 -80
  273. package/dist/lib/node-esm/summarize-IORITU7T.mjs.map +0 -7
  274. package/dist/lib/node-esm/types/index.mjs +0 -11
  275. package/dist/types/src/components/stories/FileTranscription.stories.d.ts +0 -18
  276. package/dist/types/src/components/stories/FileTranscription.stories.d.ts.map +0 -1
  277. package/dist/types/src/components/stories/KeyWordRecognition.stories.d.ts.map +0 -1
  278. package/dist/types/src/components/stories/MicrophoneTranscription.stories.d.ts.map +0 -1
  279. package/dist/types/src/components/stories/TranscriptionStory.d.ts +0 -12
  280. package/dist/types/src/components/stories/TranscriptionStory.d.ts.map +0 -1
  281. package/dist/types/src/components/stories/useIsSpeaking.d.ts +0 -3
  282. package/dist/types/src/components/stories/useIsSpeaking.d.ts.map +0 -1
  283. package/dist/types/src/containers/TranscriptionContainer/TranscriptionContainer.d.ts +0 -6
  284. package/dist/types/src/containers/TranscriptionContainer/TranscriptionContainer.d.ts.map +0 -1
  285. package/dist/types/src/containers/TranscriptionContainer/index.d.ts +0 -2
  286. package/dist/types/src/containers/TranscriptionContainer/index.d.ts.map +0 -1
  287. package/dist/types/src/hooks/useQueueModelAdapter.d.ts +0 -8
  288. package/dist/types/src/hooks/useQueueModelAdapter.d.ts.map +0 -1
  289. package/dist/types/src/operations/definitions.d.ts.map +0 -1
  290. package/dist/types/src/segments-normalization/index.d.ts.map +0 -1
  291. package/dist/types/src/segments-normalization/message-normalizer.d.ts.map +0 -1
  292. package/dist/types/src/segments-normalization/normalization.d.ts +0 -364
  293. package/dist/types/src/segments-normalization/normalization.d.ts.map +0 -1
  294. package/dist/types/src/segments-normalization/normalization.test.d.ts.map +0 -1
  295. package/dist/types/src/segments-normalization/utils.d.ts.map +0 -1
  296. package/dist/types/src/types/capabilities.d.ts +0 -18
  297. package/dist/types/src/types/capabilities.d.ts.map +0 -1
  298. package/dist/types/src/types/types.d.ts +0 -5
  299. package/dist/types/src/types/types.d.ts.map +0 -1
  300. package/src/components/stories/FileTranscription.stories.tsx +0 -250
  301. package/src/components/stories/MicrophoneTranscription.stories.tsx +0 -264
  302. package/src/components/stories/TranscriptionStory.tsx +0 -43
  303. package/src/components/stories/useIsSpeaking.tsx +0 -40
  304. package/src/containers/TranscriptionContainer/TranscriptionContainer.tsx +0 -35
  305. package/src/containers/TranscriptionContainer/index.ts +0 -5
  306. package/src/hooks/useQueueModelAdapter.ts +0 -66
  307. package/src/types/capabilities.ts +0 -34
  308. package/src/types/types.ts +0 -9
  309. package/dist/lib/{browser/types → neutral/blueprints}/index.mjs.map +0 -0
  310. package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs +0 -0
  311. package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs.map +0 -0
  312. package/dist/lib/{browser/chunk-HOOPZ7EM.mjs.map → neutral/chunk-KAEXRX3Y.mjs.map} +0 -0
  313. package/dist/lib/{node-esm/types → neutral/hooks}/index.mjs.map +0 -0
  314. package/dist/lib/{node-esm/chunk-HSLMI22Q.mjs.map → neutral/index.mjs.map} +0 -0
  315. package/dist/types/src/{segments-normalization → normalization}/normalization.test.d.ts +0 -0
  316. package/dist/types/src/{segments-normalization → normalization}/utils.d.ts +0 -0
  317. package/dist/types/src/{components/stories → stories}/KeyWordRecognition.stories.d.ts +0 -0
  318. package/src/{segments-normalization → normalization}/index.ts +1 -1
  319. /package/src/{segments-normalization → normalization}/utils.ts +0 -0
@@ -0,0 +1,101 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import React, {
6
+ type ChangeEvent,
7
+ type Dispatch,
8
+ type RefObject,
9
+ type SetStateAction,
10
+ useCallback,
11
+ useRef,
12
+ } from 'react';
13
+
14
+ import { IconButton, ScrollContainer, Toolbar } from '@dxos/react-ui';
15
+ import { type Message } from '@dxos/types';
16
+
17
+ import { Transcription } from '../components';
18
+ import { type SerializationModel } from '../model';
19
+
20
+ export type TranscriptionStoryProps = {
21
+ audioRef?: RefObject<HTMLAudioElement | null>;
22
+ model: SerializationModel<Message.Message>;
23
+ running: boolean;
24
+ disabled?: boolean;
25
+ uploadAccept?: string;
26
+ onRunningChange: Dispatch<SetStateAction<boolean>>;
27
+ onUpload?: (file: File) => void;
28
+ };
29
+
30
+ /**
31
+ * Story wrapper that renders a transcript with playback controls, an optional audio file
32
+ * upload affordance, and a toolbar slot for additional controls.
33
+ *
34
+ * @param onUpload - Callback fired when the user picks a local audio file via the upload button.
35
+ * @param uploadAccept - HTML `accept` filter for the hidden file input. Defaults to `audio/*`.
36
+ */
37
+ export const TranscriptionStory = ({
38
+ audioRef,
39
+ model,
40
+ running,
41
+ disabled,
42
+ uploadAccept = 'audio/*',
43
+ onRunningChange,
44
+ onUpload,
45
+ }: TranscriptionStoryProps) => {
46
+ const fileInputRef = useRef<HTMLInputElement>(null);
47
+
48
+ const handleFileChange = useCallback(
49
+ (event: ChangeEvent<HTMLInputElement>) => {
50
+ const file = event.target.files?.[0];
51
+ if (file && onUpload) {
52
+ onUpload(file);
53
+ }
54
+
55
+ // Reset so the same file can be re-selected.
56
+ event.target.value = '';
57
+ },
58
+ [onUpload],
59
+ );
60
+
61
+ return (
62
+ <>
63
+ {audioRef && <audio ref={audioRef} autoPlay />}
64
+ <Toolbar.Root>
65
+ <IconButton
66
+ iconOnly
67
+ disabled={disabled}
68
+ icon={running ? 'ph--pause--regular' : 'ph--play--regular'}
69
+ label={running ? 'Pause' : 'Play'}
70
+ onClick={() => onRunningChange((running) => !running)}
71
+ />
72
+ {onUpload && (
73
+ <>
74
+ <input
75
+ ref={fileInputRef}
76
+ type='file'
77
+ accept={uploadAccept}
78
+ disabled={disabled}
79
+ className='hidden'
80
+ onChange={handleFileChange}
81
+ />
82
+ <IconButton
83
+ iconOnly
84
+ disabled={disabled}
85
+ icon='ph--upload--regular'
86
+ label='Upload audio'
87
+ onClick={() => fileInputRef.current?.click()}
88
+ />
89
+ </>
90
+ )}
91
+ </Toolbar.Root>
92
+ <ScrollContainer.Root pin>
93
+ <ScrollContainer.Content>
94
+ <ScrollContainer.Viewport>
95
+ <Transcription model={model} />
96
+ </ScrollContainer.Viewport>
97
+ </ScrollContainer.Content>
98
+ </ScrollContainer.Root>
99
+ </>
100
+ );
101
+ };
@@ -0,0 +1,233 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ // Helpers shared between LiveTranscription / FileTranscription stories.
6
+ // Each "live" story differs only in its *audio source* (mic vs file); everything else —
7
+ // the local in-memory message buffer, the transcriber lifecycle, and the plugin-manager
8
+ // decorator stack — is identical and lives here.
9
+
10
+ import { type Decorator } from '@storybook/react-vite';
11
+ import * as Effect from 'effect/Effect';
12
+ import { useCallback, useEffect, useMemo, useRef, useState } from 'react';
13
+
14
+ import { withPluginManager } from '@dxos/app-framework/testing';
15
+ import { AppActivationEvents } from '@dxos/app-toolkit';
16
+ import { scheduleTask } from '@dxos/async';
17
+ import { Context } from '@dxos/context';
18
+ import { Obj } from '@dxos/echo';
19
+ import { SpeakingMonitor } from '@dxos/plugin-calls';
20
+ import { ClientPlugin, initializeIdentity } from '@dxos/plugin-client/testing';
21
+ import { PreviewPlugin } from '@dxos/plugin-preview/testing';
22
+ import { StorybookPlugin, corePlugins } from '@dxos/plugin-testing';
23
+ import { IndexKind } from '@dxos/react-client/echo';
24
+ import { withLayout } from '@dxos/react-ui/testing';
25
+ import { Message, Organization, Person } from '@dxos/types';
26
+ import { seedTestData } from '@dxos/types/testing';
27
+
28
+ import { useFeedModelAdapter, useTranscriber } from '#hooks';
29
+ import { TestItem } from '#testing';
30
+ import { type TranscriptionCapabilities } from '#types';
31
+
32
+ import { type Transcriber, type TranscriberProps } from '../transcriber';
33
+ import { TranscriptionPlugin } from '../TranscriptionPlugin';
34
+ import { renderByline } from '../util';
35
+
36
+ export const useIsSpeaking = (track?: MediaStreamTrack) => {
37
+ const [isSpeaking, setIsSpeaking] = useState(false);
38
+ const speakingMonitor = useMemo(() => {
39
+ if (!track) {
40
+ return;
41
+ }
42
+
43
+ return new SpeakingMonitor(track);
44
+ }, [track]);
45
+
46
+ useEffect(() => {
47
+ if (!speakingMonitor) {
48
+ return;
49
+ }
50
+
51
+ const ctx = new Context();
52
+ scheduleTask(ctx, async () => {
53
+ speakingMonitor.speakingChanged.on(ctx, () => setIsSpeaking(speakingMonitor.isSpeaking));
54
+ await speakingMonitor.open();
55
+ ctx.onDispose(() => speakingMonitor.close());
56
+ });
57
+
58
+ return () => {
59
+ void ctx.dispose();
60
+ };
61
+ }, [speakingMonitor]);
62
+
63
+ return isSpeaking;
64
+ };
65
+
66
+ //
67
+ // Message model.
68
+ //
69
+
70
+ /**
71
+ * In-memory message buffer + model adapter for storybook use (production wires up a real
72
+ * space-backed `Feed`). Returns the renderable `model` plus an `appendMessage` callback.
73
+ */
74
+ export const useStoryMessageModel = () => {
75
+ const [messages, setMessages] = useState<Message.Message[]>([]);
76
+ const appendMessage = useCallback((message: Message.Message) => setMessages((prev) => [...prev, message]), []);
77
+ const model = useFeedModelAdapter(renderByline([]), messages);
78
+ return { model, appendMessage };
79
+ };
80
+
81
+ /**
82
+ * Wraps blocks in a `Message.Message` with the given sender and appends it to the local buffer.
83
+ * Provided as a convenience for stories that don't need entity-extraction or custom enrichment.
84
+ */
85
+ export const useStoryAppendSegments = (
86
+ appendMessage: (message: Message.Message) => void,
87
+ sender: Message.Message['sender'] = {},
88
+ ): TranscriberProps['onSegments'] =>
89
+ useCallback<TranscriberProps['onSegments']>(
90
+ async (blocks) => {
91
+ appendMessage(
92
+ Obj.make(Message.Message, {
93
+ created: new Date().toISOString(),
94
+ sender,
95
+ blocks,
96
+ }),
97
+ );
98
+ },
99
+ [appendMessage, sender],
100
+ );
101
+
102
+ //
103
+ // Transcriber lifecycle.
104
+ //
105
+
106
+ export type UseStoryTranscriberOptions = Pick<
107
+ TranscriptionCapabilities.TranscriberProviderProps,
108
+ 'transcriberConfig' | 'recorderConfig' | 'onSegments'
109
+ > & {
110
+ audioStreamTrack?: MediaStreamTrack;
111
+ /** Whether the user has the toolbar toggle on. */
112
+ running: boolean;
113
+ /** Voice-activity flag — chunks recording only fires while `true`. */
114
+ isSpeaking: boolean;
115
+ };
116
+
117
+ /**
118
+ * Drives the transcriber's open/close + chunk-recording lifecycle off `running`,
119
+ * the open flag, and an `isSpeaking` voice-activity gate. Returns the transcriber instance
120
+ * (`undefined` until the capability resolves and an audio track is available).
121
+ */
122
+ export const useStoryTranscriber = ({
123
+ audioStreamTrack,
124
+ running,
125
+ isSpeaking,
126
+ transcriberConfig,
127
+ recorderConfig,
128
+ onSegments,
129
+ }: UseStoryTranscriberOptions): Transcriber | undefined => {
130
+ const transcriber = useTranscriber({
131
+ audioStreamTrack,
132
+ onSegments,
133
+ transcriberConfig,
134
+ recorderConfig,
135
+ });
136
+
137
+ // Open the transcriber when it becomes available; close on teardown.
138
+ // `tokenRef` is a per-effect identity so a late `close()` completion from a stale
139
+ // transcriber instance can't clobber `isOpen` after a newer instance has opened.
140
+ const [isOpen, setIsOpen] = useState(false);
141
+ const tokenRef = useRef<symbol | null>(null);
142
+ useEffect(() => {
143
+ if (!transcriber) {
144
+ return;
145
+ }
146
+ const token = Symbol();
147
+ tokenRef.current = token;
148
+ void transcriber.open().then(
149
+ () => tokenRef.current === token && setIsOpen(true),
150
+ () => tokenRef.current === token && setIsOpen(false),
151
+ );
152
+ return () => {
153
+ void transcriber.close().then(() => {
154
+ if (tokenRef.current === token) {
155
+ setIsOpen(false);
156
+ }
157
+ });
158
+ };
159
+ }, [transcriber]);
160
+
161
+ // Start/stop chunk recording based on running + open + isSpeaking.
162
+ useEffect(() => {
163
+ if (!transcriber || !isOpen) {
164
+ return;
165
+ }
166
+ if (running && isSpeaking) {
167
+ transcriber.startChunksRecording();
168
+ } else {
169
+ transcriber.stopChunksRecording();
170
+ }
171
+ }, [transcriber, isOpen, running, isSpeaking]);
172
+
173
+ return transcriber;
174
+ };
175
+
176
+ //
177
+ // Plugin manager decorator.
178
+ //
179
+
180
+ export type StoryDecoratorsOptions = {
181
+ /**
182
+ * Enable schema/graph/vector indexes after the client boots; needed for entity-extraction
183
+ * queries over seeded `Person` / `Organization` objects.
184
+ * @default false
185
+ */
186
+ enableVectorIndex?: boolean;
187
+ };
188
+
189
+ /**
190
+ * Standard plugin-manager decorator for transcription stories: core plugins,
191
+ * `ClientPlugin` with `Person`/`Organization`/`TestItem` schemas + seeded test data, plus
192
+ * the `PreviewPlugin` and `TranscriptionPlugin`. Toggle `enableVectorIndex` for entity-extraction.
193
+ */
194
+ export const createStoryDecorators = ({ enableVectorIndex = false }: StoryDecoratorsOptions = {}): Decorator[] => [
195
+ withLayout({ layout: 'column' }),
196
+ withPluginManager({
197
+ plugins: [
198
+ ...corePlugins(),
199
+ StorybookPlugin({}),
200
+ ClientPlugin({
201
+ types: [TestItem, Person.Person, Organization.Organization],
202
+ onClientInitialized: ({ client }) =>
203
+ Effect.gen(function* () {
204
+ const { personalSpace } = yield* initializeIdentity(client);
205
+ if (enableVectorIndex) {
206
+ yield* enableQueryIndexes(client.services.services);
207
+ }
208
+ yield* Effect.promise(() => seedTestData(personalSpace));
209
+ }),
210
+ }),
211
+ PreviewPlugin(),
212
+ TranscriptionPlugin(),
213
+ ],
214
+ fireEvents: [AppActivationEvents.SetupAppGraph],
215
+ }),
216
+ ];
217
+
218
+ // TODO(mykola): Make API easier to use.
219
+ // TODO(mykola): Delete after enabling vector indexing by default.
220
+ const enableQueryIndexes = (services: { QueryService?: any }) =>
221
+ Effect.gen(function* () {
222
+ yield* Effect.promise(() =>
223
+ services.QueryService!.setConfig({
224
+ enabled: true,
225
+ indexes: [
226
+ { kind: IndexKind.Kind.SCHEMA_MATCH },
227
+ { kind: IndexKind.Kind.GRAPH },
228
+ { kind: IndexKind.Kind.VECTOR },
229
+ ],
230
+ }),
231
+ );
232
+ yield* Effect.promise(() => services.QueryService!.reindex());
233
+ });
@@ -2,19 +2,19 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
+ import * as Effect from 'effect/Effect';
5
6
  import * as Schema from 'effect/Schema';
6
7
  import { useEffect, useMemo, useState } from 'react';
7
8
 
8
9
  import { extractionAnthropicFunction, processTranscriptMessage } from '@dxos/assistant/extraction';
9
10
  import { scheduleTaskInterval } from '@dxos/async';
10
- import { Filter, type Queue } from '@dxos/client/echo';
11
+ import { createFeedServiceLayer, type Space } from '@dxos/client/echo';
11
12
  import { Context } from '@dxos/context';
12
- import { type Key, Obj, Ref, Type } from '@dxos/echo';
13
- import { createQueueDXN } from '@dxos/echo/internal';
13
+ import { DXN, Feed, Filter, Obj, Ref, Type } from '@dxos/echo';
14
+ import { EffectEx } from '@dxos/effect';
14
15
  import { IdentityDid } from '@dxos/keys';
15
16
  import { log } from '@dxos/log';
16
17
  import { random } from '@dxos/random';
17
- import { type Space, useQueue } from '@dxos/react-client/echo';
18
18
  import { TestSchema } from '@dxos/schema/testing';
19
19
  import { type ContentBlock, Message, Organization, Person } from '@dxos/types';
20
20
  import { seedTestData } from '@dxos/types/testing';
@@ -29,12 +29,7 @@ export const TestItem = Schema.Struct({
29
29
  title: 'Description',
30
30
  description: 'Product description',
31
31
  }),
32
- }).pipe(
33
- Type.object({
34
- typename: 'org.dxos.type.test',
35
- version: '0.1.0',
36
- }),
37
- );
32
+ }).pipe(Type.makeObject(DXN.make('org.dxos.type.test', '0.1.0')));
38
33
 
39
34
  // TODO(wittjosiah): Make builder generic and reuse for all message types.
40
35
  abstract class AbstractMessageBuilder {
@@ -77,7 +72,7 @@ export class MessageBuilder extends AbstractMessageBuilder {
77
72
  description: random.lorem.paragraph(),
78
73
  }),
79
74
  );
80
- const dxn = Ref.make(obj).dxn.toString();
75
+ const dxn = Ref.make(obj).uri;
81
76
  const words = text.split(' ');
82
77
  words.splice(Math.floor(Math.random() * words.length), 0, `[${label}](${dxn})`);
83
78
  text = words.join(' ');
@@ -139,71 +134,64 @@ class EntityExtractionMessageBuilder extends AbstractMessageBuilder {
139
134
 
140
135
  type UseTestTranscriptionQueue = (
141
136
  space: Space | undefined,
142
- queueId?: Key.ObjectId,
143
137
  running?: boolean,
144
138
  interval?: number,
145
- ) => Queue<Message.Message> | undefined;
139
+ ) => Feed.Feed | undefined;
146
140
 
147
141
  /**
148
- * Test transcriptionqueue.
142
+ * Test transcription feed.
149
143
  */
150
144
  export const useTestTranscriptionQueue: UseTestTranscriptionQueue = (
151
145
  space: Space | undefined,
152
- queueId?: Key.ObjectId,
153
146
  running = true,
154
147
  interval = 1_000,
155
148
  ) => {
156
- // TODO(dmaretskyi): Use space.queues.create() instead.
157
- const queueDxn = useMemo(() => (space ? createQueueDXN(space.id, queueId) : undefined), [space, queueId]);
158
- const queue = useQueue<Message.Message>(queueDxn);
149
+ const feed = useMemo(() => (space ? space.db.add(Feed.make({ name: 'transcription' })) : undefined), [space]);
159
150
  const builder = useMemo(() => new MessageBuilder(space), [space]);
160
151
 
161
152
  useEffect(() => {
162
- if (!queue || !running) {
153
+ if (!space || !feed || !running) {
163
154
  return;
164
155
  }
156
+ const feedServiceLayer = createFeedServiceLayer(space.queues);
165
157
 
166
158
  const i = setInterval(() => {
167
159
  void builder.createMessage(Math.ceil(Math.random() * 3)).then(async (message) => {
168
- await queue.append([Obj.make(Message.Message, message)]);
160
+ await Feed.append(feed, [message]).pipe(Effect.provide(feedServiceLayer), EffectEx.runAndForwardErrors);
169
161
  });
170
162
  }, interval);
171
163
  return () => clearInterval(i);
172
- }, [queue, running, interval]);
164
+ }, [space, feed, running, interval]);
173
165
 
174
- return queue;
166
+ return feed;
175
167
  };
176
168
 
177
169
  /**
178
- * Test transcription queue.
170
+ * Test transcription feed with entity extraction.
179
171
  */
180
172
  // TODO(burdon): Reconcile with useTestTranscriptionQueue.
181
173
  export const useTestTranscriptionQueueWithEntityExtraction: UseTestTranscriptionQueue = (
182
174
  space: Space | undefined,
183
- queueId?: Key.ObjectId,
184
175
  running = true,
185
176
  interval = 1_000,
186
177
  ) => {
187
- // TODO(dmaretskyi): Use space.queues.create() instead.
188
- const queueDxn = useMemo(() => (space ? createQueueDXN(space.id, queueId) : undefined), [space, queueId]);
189
- const queue = useQueue<Message.Message>(queueDxn);
178
+ const feed = useMemo(() => (space ? space.db.add(Feed.make({ name: 'transcription' })) : undefined), [space]);
190
179
  const [builder] = useState(() => new EntityExtractionMessageBuilder());
191
180
 
192
181
  useEffect(() => {
193
- if (!queue || !running) {
182
+ if (!space || !feed || !running) {
194
183
  return;
195
184
  }
196
185
 
197
- if (space) {
198
- void builder.connect(space);
199
- }
186
+ void builder.connect(space);
200
187
 
188
+ const feedServiceLayer = createFeedServiceLayer(space.queues);
201
189
  const ctx = new Context();
202
190
  scheduleTaskInterval(
203
191
  ctx,
204
192
  async () => {
205
193
  const message = await builder.createMessage();
206
- void queue.append([Obj.make(Message.Message, message)]);
194
+ await Feed.append(feed, [message]).pipe(Effect.provide(feedServiceLayer), EffectEx.runAndForwardErrors);
207
195
  },
208
196
  interval,
209
197
  );
@@ -211,7 +199,7 @@ export const useTestTranscriptionQueueWithEntityExtraction: UseTestTranscription
211
199
  return () => {
212
200
  void ctx.dispose();
213
201
  };
214
- }, [space, queue, running, interval]);
202
+ }, [space, feed, running, interval]);
215
203
 
216
- return queue;
204
+ return feed;
217
205
  };
@@ -2,7 +2,7 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- export type * from './audio-recorder';
5
+ export * from './audio-recorder';
6
6
  export * from './media-stream-recorder';
7
7
  export * from './transcriber';
8
8
  export * from './transcription-manager';
@@ -0,0 +1,104 @@
1
+ //
2
+ // Copyright 2026 DXOS.org
3
+ //
4
+
5
+ import { describe, test } from 'vitest';
6
+
7
+ import { type AudioChunk } from './audio-recorder';
8
+ import { alignWhisperSegments, type WhisperSegment } from './transcriber';
9
+
10
+ const T0 = Date.parse('2026-01-01T00:00:00.000Z');
11
+
12
+ const chunk = (offsetMs = 0, samples = 16): AudioChunk => ({
13
+ timestamp: T0 + offsetMs,
14
+ data: new Float64Array(samples),
15
+ });
16
+
17
+ const segment = (overrides: Partial<WhisperSegment>): WhisperSegment => ({
18
+ text: '',
19
+ start: 0,
20
+ end: 0,
21
+ no_speech_prob: 0,
22
+ words: [],
23
+ ...overrides,
24
+ });
25
+
26
+ describe('alignWhisperSegments', () => {
27
+ test('returns empty when no chunks were transcribed', ({ expect }) => {
28
+ const result = alignWhisperSegments(
29
+ [segment({ text: 'x', end: 1, words: [{ word: 'x', start: 0, end: 1 }] })],
30
+ [],
31
+ 0,
32
+ );
33
+ expect(result.transcripts).toEqual([]);
34
+ expect(result.lastTimestamp).toBeUndefined();
35
+ });
36
+
37
+ test('absolute-timestamps and deduplicates segments against lastTimestamp', ({ expect }) => {
38
+ const segments: WhisperSegment[] = [
39
+ segment({
40
+ text: 'hello world',
41
+ start: 0,
42
+ end: 1,
43
+ words: [
44
+ { word: 'hello ', start: 0, end: 0.5 },
45
+ { word: 'world', start: 0.5, end: 1 },
46
+ ],
47
+ }),
48
+ ];
49
+
50
+ const first = alignWhisperSegments(segments, [chunk(0)], 0);
51
+ expect(first.transcripts).toHaveLength(1);
52
+ expect(first.transcripts[0]._tag).toBe('transcript');
53
+ expect(first.transcripts[0].text).toBe('hello world');
54
+ expect(new Date(first.transcripts[0].started).getTime()).toBe(T0);
55
+ expect(first.lastTimestamp).toBe(T0 + 1_000);
56
+
57
+ // Same segments, same chunk start: every word's absolute start is < lastTimestamp -> filtered out.
58
+ const second = alignWhisperSegments(segments, [chunk(0)], first.lastTimestamp!);
59
+ expect(second.transcripts).toEqual([]);
60
+ expect(second.lastTimestamp).toBeUndefined();
61
+ });
62
+
63
+ test('keeps later words when earlier words fall before lastTimestamp', ({ expect }) => {
64
+ const segments: WhisperSegment[] = [
65
+ segment({
66
+ text: 'old new',
67
+ start: 0,
68
+ end: 2,
69
+ words: [
70
+ { word: 'old ', start: 0, end: 1 },
71
+ { word: 'new', start: 1.5, end: 2 },
72
+ ],
73
+ }),
74
+ ];
75
+
76
+ // First word starts at T0, second at T0+1500 — only the second survives a cursor at T0+1000.
77
+ const result = alignWhisperSegments(segments, [chunk(0)], T0 + 1_000);
78
+ expect(result.transcripts).toHaveLength(1);
79
+ expect(result.transcripts[0].text).toBe('new');
80
+ expect(new Date(result.transcripts[0].started).getTime()).toBe(T0 + 1_500);
81
+ expect(result.lastTimestamp).toBe(T0 + 2_000);
82
+ });
83
+
84
+ test('drops segments that end before lastTimestamp', ({ expect }) => {
85
+ const segments: WhisperSegment[] = [
86
+ segment({
87
+ text: 'stale',
88
+ start: 0,
89
+ end: 0.5,
90
+ words: [{ word: 'stale', start: 0, end: 0.5 }],
91
+ }),
92
+ segment({
93
+ text: 'fresh',
94
+ start: 1,
95
+ end: 2,
96
+ words: [{ word: 'fresh', start: 1.5, end: 2 }],
97
+ }),
98
+ ];
99
+
100
+ const result = alignWhisperSegments(segments, [chunk(0)], T0 + 1_000);
101
+ expect(result.transcripts).toHaveLength(1);
102
+ expect(result.transcripts[0].text).toBe('fresh');
103
+ });
104
+ });