@dxos/plugin-transcription 0.8.3 → 0.8.4-main.1c7ec43d41

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 (330) hide show
  1. package/dist/lib/browser/blueprints/index.mjs +31 -0
  2. package/dist/lib/browser/blueprints/index.mjs.map +7 -0
  3. package/dist/lib/browser/chunk-3L623EVL.mjs +17 -0
  4. package/dist/lib/browser/chunk-3L623EVL.mjs.map +7 -0
  5. package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
  6. package/dist/lib/browser/chunk-KAEXRX3Y.mjs +35 -0
  7. package/dist/lib/browser/chunk-KAEXRX3Y.mjs.map +7 -0
  8. package/dist/lib/browser/chunk-L4HW35L6.mjs +111 -0
  9. package/dist/lib/browser/chunk-L4HW35L6.mjs.map +7 -0
  10. package/dist/lib/browser/chunk-MLRJWAQH.mjs +179 -0
  11. package/dist/lib/browser/chunk-MLRJWAQH.mjs.map +7 -0
  12. package/dist/lib/browser/chunk-NQQK7UZQ.mjs +244 -0
  13. package/dist/lib/browser/chunk-NQQK7UZQ.mjs.map +7 -0
  14. package/dist/lib/browser/components/index.mjs +207 -0
  15. package/dist/lib/browser/components/index.mjs.map +7 -0
  16. package/dist/lib/browser/create-ULR5DPJZ.mjs +21 -0
  17. package/dist/lib/browser/create-ULR5DPJZ.mjs.map +7 -0
  18. package/dist/lib/browser/hooks/index.mjs +17 -0
  19. package/dist/lib/browser/index.mjs +442 -94
  20. package/dist/lib/browser/index.mjs.map +4 -4
  21. package/dist/lib/browser/meta.json +1 -1
  22. package/dist/lib/browser/open-SFMPLZVW.mjs +27 -0
  23. package/dist/lib/browser/open-SFMPLZVW.mjs.map +7 -0
  24. package/dist/lib/browser/operations/index.mjs +13 -0
  25. package/dist/lib/browser/operations/index.mjs.map +7 -0
  26. package/dist/lib/browser/summarize-BDFX4APN.mjs +78 -0
  27. package/dist/lib/browser/summarize-BDFX4APN.mjs.map +7 -0
  28. package/dist/lib/browser/types/index.mjs +4 -8
  29. package/dist/lib/node-esm/blueprints/index.mjs +32 -0
  30. package/dist/lib/node-esm/blueprints/index.mjs.map +7 -0
  31. package/dist/lib/node-esm/chunk-7UIZWCD4.mjs +112 -0
  32. package/dist/lib/node-esm/chunk-7UIZWCD4.mjs.map +7 -0
  33. package/dist/lib/node-esm/chunk-C3AE2NYJ.mjs +181 -0
  34. package/dist/lib/node-esm/chunk-C3AE2NYJ.mjs.map +7 -0
  35. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
  36. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
  37. package/dist/lib/node-esm/chunk-KO3IOD2O.mjs +19 -0
  38. package/dist/lib/node-esm/chunk-KO3IOD2O.mjs.map +7 -0
  39. package/dist/lib/node-esm/chunk-MQK4R6GT.mjs +245 -0
  40. package/dist/lib/node-esm/chunk-MQK4R6GT.mjs.map +7 -0
  41. package/dist/lib/node-esm/chunk-O533NBMK.mjs +37 -0
  42. package/dist/lib/node-esm/chunk-O533NBMK.mjs.map +7 -0
  43. package/dist/lib/node-esm/components/index.mjs +208 -0
  44. package/dist/lib/node-esm/components/index.mjs.map +7 -0
  45. package/dist/lib/node-esm/create-A5QHNWRF.mjs +22 -0
  46. package/dist/lib/node-esm/create-A5QHNWRF.mjs.map +7 -0
  47. package/dist/lib/node-esm/hooks/index.mjs +18 -0
  48. package/dist/lib/node-esm/hooks/index.mjs.map +7 -0
  49. package/dist/lib/node-esm/index.mjs +442 -94
  50. package/dist/lib/node-esm/index.mjs.map +4 -4
  51. package/dist/lib/node-esm/meta.json +1 -1
  52. package/dist/lib/node-esm/open-OI24QNTO.mjs +28 -0
  53. package/dist/lib/node-esm/open-OI24QNTO.mjs.map +7 -0
  54. package/dist/lib/node-esm/operations/index.mjs +14 -0
  55. package/dist/lib/node-esm/operations/index.mjs.map +7 -0
  56. package/dist/lib/node-esm/summarize-3UNN24I2.mjs +79 -0
  57. package/dist/lib/node-esm/summarize-3UNN24I2.mjs.map +7 -0
  58. package/dist/lib/node-esm/types/index.mjs +4 -8
  59. package/dist/types/src/TranscriptionPlugin.d.ts +3 -1
  60. package/dist/types/src/TranscriptionPlugin.d.ts.map +1 -1
  61. package/dist/types/src/TranscriptionPlugin.node.d.ts +4 -0
  62. package/dist/types/src/TranscriptionPlugin.node.d.ts.map +1 -0
  63. package/dist/types/src/TranscriptionPlugin.test.d.ts +2 -0
  64. package/dist/types/src/TranscriptionPlugin.test.d.ts.map +1 -0
  65. package/dist/types/src/blueprints/index.d.ts +2 -0
  66. package/dist/types/src/blueprints/index.d.ts.map +1 -0
  67. package/dist/types/src/blueprints/transcription-blueprint.d.ts +4 -0
  68. package/dist/types/src/blueprints/transcription-blueprint.d.ts.map +1 -0
  69. package/dist/types/src/capabilities/blueprint-definition.d.ts +6 -0
  70. package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
  71. package/dist/types/src/capabilities/index.d.ts +10 -4
  72. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  73. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  74. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  75. package/dist/types/src/capabilities/react-surface.d.ts +3 -2
  76. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  77. package/dist/types/src/capabilities/text-content.d.ts +8 -0
  78. package/dist/types/src/capabilities/text-content.d.ts.map +1 -0
  79. package/dist/types/src/capabilities/transcriber.d.ts +4 -3
  80. package/dist/types/src/capabilities/transcriber.d.ts.map +1 -1
  81. package/dist/types/src/components/Transcription/Transcription.d.ts +18 -0
  82. package/dist/types/src/components/Transcription/Transcription.d.ts.map +1 -0
  83. package/dist/types/src/components/Transcription/Transcription.stories.d.ts +40 -0
  84. package/dist/types/src/components/Transcription/Transcription.stories.d.ts.map +1 -0
  85. package/dist/types/src/components/Transcription/index.d.ts +2 -0
  86. package/dist/types/src/components/Transcription/index.d.ts.map +1 -0
  87. package/dist/types/src/components/Transcription/transcription-extension.d.ts +15 -0
  88. package/dist/types/src/components/Transcription/transcription-extension.d.ts.map +1 -0
  89. package/dist/types/src/components/index.d.ts +1 -6
  90. package/dist/types/src/components/index.d.ts.map +1 -1
  91. package/dist/types/src/containers/TranscriptionContainer/TranscriptionContainer.d.ts +6 -0
  92. package/dist/types/src/containers/TranscriptionContainer/TranscriptionContainer.d.ts.map +1 -0
  93. package/dist/types/src/containers/TranscriptionContainer/index.d.ts +2 -0
  94. package/dist/types/src/containers/TranscriptionContainer/index.d.ts.map +1 -0
  95. package/dist/types/src/containers/index.d.ts +3 -0
  96. package/dist/types/src/containers/index.d.ts.map +1 -0
  97. package/dist/types/src/hooks/useAudioFile.d.ts.map +1 -1
  98. package/dist/types/src/hooks/useAudioTrack.d.ts.map +1 -1
  99. package/dist/types/src/hooks/useQueueModelAdapter.d.ts +1 -1
  100. package/dist/types/src/hooks/useQueueModelAdapter.d.ts.map +1 -1
  101. package/dist/types/src/hooks/useTranscriber.d.ts +2 -2
  102. package/dist/types/src/hooks/useTranscriber.d.ts.map +1 -1
  103. package/dist/types/src/hooks/useVoiceInput.d.ts.map +1 -1
  104. package/dist/types/src/index.d.ts +4 -4
  105. package/dist/types/src/index.d.ts.map +1 -1
  106. package/dist/types/src/meta.d.ts +2 -3
  107. package/dist/types/src/meta.d.ts.map +1 -1
  108. package/dist/types/src/model/model.d.ts +2 -2
  109. package/dist/types/src/model/model.d.ts.map +1 -1
  110. package/dist/types/src/{segments-normalization → normalization}/index.d.ts +1 -1
  111. package/dist/types/src/normalization/index.d.ts.map +1 -0
  112. package/dist/types/src/{segments-normalization → normalization}/message-normalizer.d.ts +5 -5
  113. package/dist/types/src/normalization/message-normalizer.d.ts.map +1 -0
  114. package/dist/types/src/normalization/normalization.d.ts +364 -0
  115. package/dist/types/src/normalization/normalization.d.ts.map +1 -0
  116. package/dist/types/src/normalization/normalization.test.d.ts.map +1 -0
  117. package/dist/types/src/normalization/utils.d.ts +3 -0
  118. package/dist/types/src/normalization/utils.d.ts.map +1 -0
  119. package/dist/types/src/operations/create.d.ts +5 -0
  120. package/dist/types/src/operations/create.d.ts.map +1 -0
  121. package/dist/types/src/operations/definitions.d.ts +917 -0
  122. package/dist/types/src/operations/definitions.d.ts.map +1 -0
  123. package/dist/types/src/operations/index.d.ts +4 -0
  124. package/dist/types/src/operations/index.d.ts.map +1 -0
  125. package/dist/types/src/operations/open.d.ts +5 -0
  126. package/dist/types/src/operations/open.d.ts.map +1 -0
  127. package/dist/types/src/operations/summarize.d.ts +8 -0
  128. package/dist/types/src/operations/summarize.d.ts.map +1 -0
  129. package/dist/types/src/stories/FileTranscription.stories.d.ts +18 -0
  130. package/dist/types/src/stories/FileTranscription.stories.d.ts.map +1 -0
  131. package/dist/types/src/stories/KeyWordRecognition.stories.d.ts +14 -0
  132. package/dist/types/src/stories/KeyWordRecognition.stories.d.ts.map +1 -0
  133. package/dist/types/src/stories/MicrophoneTranscription.stories.d.ts +20 -0
  134. package/dist/types/src/stories/MicrophoneTranscription.stories.d.ts.map +1 -0
  135. package/dist/types/src/stories/TranscriptionStory.d.ts +23 -0
  136. package/dist/types/src/stories/TranscriptionStory.d.ts.map +1 -0
  137. package/dist/types/src/stories/useIsSpeaking.d.ts.map +1 -0
  138. package/dist/types/src/testing/testing.d.ts +10 -10
  139. package/dist/types/src/testing/testing.d.ts.map +1 -1
  140. package/dist/types/src/transcriber/media-stream-recorder.d.ts +3 -3
  141. package/dist/types/src/transcriber/media-stream-recorder.d.ts.map +1 -1
  142. package/dist/types/src/transcriber/transcriber.d.ts +60 -5
  143. package/dist/types/src/transcriber/transcriber.d.ts.map +1 -1
  144. package/dist/types/src/transcriber/transcriber.test.d.ts +2 -0
  145. package/dist/types/src/transcriber/transcriber.test.d.ts.map +1 -0
  146. package/dist/types/src/transcriber/transcription-manager.d.ts +12 -13
  147. package/dist/types/src/transcriber/transcription-manager.d.ts.map +1 -1
  148. package/dist/types/src/translations.d.ts +10 -11
  149. package/dist/types/src/translations.d.ts.map +1 -1
  150. package/dist/types/src/types/capabilities.d.ts +19 -0
  151. package/dist/types/src/types/capabilities.d.ts.map +1 -0
  152. package/dist/types/src/types/defs.d.ts +5 -0
  153. package/dist/types/src/types/defs.d.ts.map +1 -0
  154. package/dist/types/src/types/index.d.ts +2 -2
  155. package/dist/types/src/types/index.d.ts.map +1 -1
  156. package/dist/types/src/util/array.d.ts.map +1 -1
  157. package/dist/types/src/util/get-time-str.d.ts.map +1 -1
  158. package/dist/types/src/util/index.d.ts +1 -0
  159. package/dist/types/src/util/index.d.ts.map +1 -1
  160. package/dist/types/src/util/monitor-audio-level.d.ts.map +1 -1
  161. package/dist/types/src/util/render-byline.d.ts +4 -0
  162. package/dist/types/src/util/render-byline.d.ts.map +1 -0
  163. package/dist/types/tsconfig.tsbuildinfo +1 -1
  164. package/package.json +127 -82
  165. package/src/TranscriptionPlugin.node.ts +20 -0
  166. package/src/TranscriptionPlugin.test.ts +31 -0
  167. package/src/TranscriptionPlugin.tsx +22 -61
  168. package/src/blueprints/index.ts +5 -0
  169. package/src/blueprints/transcription-blueprint.ts +29 -0
  170. package/src/capabilities/blueprint-definition.ts +19 -0
  171. package/src/capabilities/index.ts +11 -6
  172. package/src/capabilities/operation-handler.ts +16 -0
  173. package/src/capabilities/react-surface.tsx +23 -14
  174. package/src/capabilities/text-content.ts +33 -0
  175. package/src/capabilities/transcriber.ts +54 -42
  176. package/src/components/{Transcript/Transcript.stories.tsx → Transcription/Transcription.stories.tsx} +78 -73
  177. package/src/components/Transcription/Transcription.tsx +64 -0
  178. package/src/components/{Transcript → Transcription}/index.ts +1 -1
  179. package/src/components/{Transcript/transcript-extension.ts → Transcription/transcription-extension.ts} +15 -48
  180. package/src/components/index.ts +1 -6
  181. package/src/containers/TranscriptionContainer/TranscriptionContainer.tsx +35 -0
  182. package/src/containers/TranscriptionContainer/index.ts +5 -0
  183. package/src/containers/index.ts +7 -0
  184. package/src/hooks/useAudioFile.ts +49 -53
  185. package/src/hooks/useQueueModelAdapter.ts +1 -1
  186. package/src/hooks/useTranscriber.ts +15 -7
  187. package/src/hooks/useVoiceInput.ts +3 -3
  188. package/src/index.ts +10 -5
  189. package/src/meta.ts +9 -6
  190. package/src/model/model.test.ts +27 -21
  191. package/src/model/model.ts +3 -3
  192. package/src/{segments-normalization → normalization}/message-normalizer.ts +20 -19
  193. package/src/{segments-normalization → normalization}/normalization.test.ts +26 -33
  194. package/src/normalization/normalization.ts +77 -0
  195. package/src/{segments-normalization → normalization}/utils.ts +2 -2
  196. package/src/operations/create.ts +24 -0
  197. package/src/operations/definitions.ts +101 -0
  198. package/src/operations/index.ts +13 -0
  199. package/src/operations/open.ts +28 -0
  200. package/src/operations/summarize.ts +101 -0
  201. package/src/{components/stories → stories}/FileTranscription.stories.tsx +99 -72
  202. package/src/{components/stories → stories}/KeyWordRecognition.stories.tsx +46 -40
  203. package/src/{components/stories → stories}/MicrophoneTranscription.stories.tsx +85 -101
  204. package/src/stories/TranscriptionStory.tsx +93 -0
  205. package/src/testing/testing.ts +41 -41
  206. package/src/transcriber/media-stream-recorder.ts +4 -4
  207. package/src/transcriber/transcriber.browser.test.ts +5 -5
  208. package/src/transcriber/transcriber.test.ts +104 -0
  209. package/src/transcriber/transcriber.ts +101 -62
  210. package/src/transcriber/transcription-manager.ts +37 -52
  211. package/src/translations.ts +12 -10
  212. package/src/types/capabilities.ts +39 -0
  213. package/src/types/defs.ts +9 -0
  214. package/src/types/index.ts +2 -2
  215. package/src/util/index.ts +1 -0
  216. package/src/util/render-byline.ts +33 -0
  217. package/dist/lib/browser/TranscriptContainer-H3AZQ4CQ.mjs +0 -11
  218. package/dist/lib/browser/chunk-53AXUEIQ.mjs +0 -764
  219. package/dist/lib/browser/chunk-53AXUEIQ.mjs.map +0 -7
  220. package/dist/lib/browser/chunk-GOF7MJNV.mjs +0 -19
  221. package/dist/lib/browser/chunk-GOF7MJNV.mjs.map +0 -7
  222. package/dist/lib/browser/chunk-IQ5ZRMHZ.mjs +0 -495
  223. package/dist/lib/browser/chunk-IQ5ZRMHZ.mjs.map +0 -7
  224. package/dist/lib/browser/chunk-OSISJM2F.mjs +0 -55
  225. package/dist/lib/browser/chunk-OSISJM2F.mjs.map +0 -7
  226. package/dist/lib/browser/chunk-UDCCT32F.mjs +0 -8
  227. package/dist/lib/browser/chunk-UDCCT32F.mjs.map +0 -7
  228. package/dist/lib/browser/chunk-W2KNYJD6.mjs +0 -16
  229. package/dist/lib/browser/chunk-W2KNYJD6.mjs.map +0 -7
  230. package/dist/lib/browser/intent-resolver-BGADCHVM.mjs +0 -30
  231. package/dist/lib/browser/intent-resolver-BGADCHVM.mjs.map +0 -7
  232. package/dist/lib/browser/react-surface-HMJS5FSS.mjs +0 -34
  233. package/dist/lib/browser/react-surface-HMJS5FSS.mjs.map +0 -7
  234. package/dist/lib/browser/transcriber-OYPLZFG5.mjs +0 -56
  235. package/dist/lib/browser/transcriber-OYPLZFG5.mjs.map +0 -7
  236. package/dist/lib/node/TranscriptContainer-KIG3GMAB.cjs +0 -32
  237. package/dist/lib/node/TranscriptContainer-KIG3GMAB.cjs.map +0 -7
  238. package/dist/lib/node/chunk-3PYT3BDM.cjs +0 -40
  239. package/dist/lib/node/chunk-3PYT3BDM.cjs.map +0 -7
  240. package/dist/lib/node/chunk-6LW5RA3K.cjs +0 -75
  241. package/dist/lib/node/chunk-6LW5RA3K.cjs.map +0 -7
  242. package/dist/lib/node/chunk-AFUZI63A.cjs +0 -42
  243. package/dist/lib/node/chunk-AFUZI63A.cjs.map +0 -7
  244. package/dist/lib/node/chunk-CVUN3UO7.cjs +0 -778
  245. package/dist/lib/node/chunk-CVUN3UO7.cjs.map +0 -7
  246. package/dist/lib/node/chunk-FKDJNJ57.cjs +0 -35
  247. package/dist/lib/node/chunk-FKDJNJ57.cjs.map +0 -7
  248. package/dist/lib/node/chunk-ZFAUMZXE.cjs +0 -518
  249. package/dist/lib/node/chunk-ZFAUMZXE.cjs.map +0 -7
  250. package/dist/lib/node/index.cjs +0 -133
  251. package/dist/lib/node/index.cjs.map +0 -7
  252. package/dist/lib/node/intent-resolver-LL3TTI4H.cjs +0 -45
  253. package/dist/lib/node/intent-resolver-LL3TTI4H.cjs.map +0 -7
  254. package/dist/lib/node/meta.json +0 -1
  255. package/dist/lib/node/react-surface-N25TBBG4.cjs +0 -56
  256. package/dist/lib/node/react-surface-N25TBBG4.cjs.map +0 -7
  257. package/dist/lib/node/transcriber-6J4FVFSZ.cjs +0 -68
  258. package/dist/lib/node/transcriber-6J4FVFSZ.cjs.map +0 -7
  259. package/dist/lib/node/types/index.cjs +0 -36
  260. package/dist/lib/node/types/index.cjs.map +0 -7
  261. package/dist/lib/node-esm/TranscriptContainer-G75LDEO5.mjs +0 -12
  262. package/dist/lib/node-esm/chunk-56QHOX4A.mjs +0 -765
  263. package/dist/lib/node-esm/chunk-56QHOX4A.mjs.map +0 -7
  264. package/dist/lib/node-esm/chunk-FH75X4JC.mjs +0 -56
  265. package/dist/lib/node-esm/chunk-FH75X4JC.mjs.map +0 -7
  266. package/dist/lib/node-esm/chunk-MFJO7EKD.mjs +0 -10
  267. package/dist/lib/node-esm/chunk-MFJO7EKD.mjs.map +0 -7
  268. package/dist/lib/node-esm/chunk-MFJPEIVB.mjs +0 -17
  269. package/dist/lib/node-esm/chunk-MFJPEIVB.mjs.map +0 -7
  270. package/dist/lib/node-esm/chunk-PRL64SRU.mjs +0 -496
  271. package/dist/lib/node-esm/chunk-PRL64SRU.mjs.map +0 -7
  272. package/dist/lib/node-esm/chunk-TXMDLLBR.mjs +0 -21
  273. package/dist/lib/node-esm/chunk-TXMDLLBR.mjs.map +0 -7
  274. package/dist/lib/node-esm/intent-resolver-5LVCYSJS.mjs +0 -31
  275. package/dist/lib/node-esm/intent-resolver-5LVCYSJS.mjs.map +0 -7
  276. package/dist/lib/node-esm/react-surface-JGQSYGRR.mjs +0 -35
  277. package/dist/lib/node-esm/react-surface-JGQSYGRR.mjs.map +0 -7
  278. package/dist/lib/node-esm/transcriber-TVG2MBBN.mjs +0 -57
  279. package/dist/lib/node-esm/transcriber-TVG2MBBN.mjs.map +0 -7
  280. package/dist/types/src/capabilities/capabilities.d.ts +0 -17
  281. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  282. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  283. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  284. package/dist/types/src/components/Transcript/Transcript.d.ts +0 -20
  285. package/dist/types/src/components/Transcript/Transcript.d.ts.map +0 -1
  286. package/dist/types/src/components/Transcript/Transcript.stories.d.ts +0 -24
  287. package/dist/types/src/components/Transcript/Transcript.stories.d.ts.map +0 -1
  288. package/dist/types/src/components/Transcript/deprecated/OldTranscript.d.ts +0 -28
  289. package/dist/types/src/components/Transcript/deprecated/OldTranscript.d.ts.map +0 -1
  290. package/dist/types/src/components/Transcript/index.d.ts +0 -2
  291. package/dist/types/src/components/Transcript/index.d.ts.map +0 -1
  292. package/dist/types/src/components/Transcript/transcript-extension.d.ts +0 -19
  293. package/dist/types/src/components/Transcript/transcript-extension.d.ts.map +0 -1
  294. package/dist/types/src/components/TranscriptContainer.d.ts +0 -8
  295. package/dist/types/src/components/TranscriptContainer.d.ts.map +0 -1
  296. package/dist/types/src/components/stories/FileTranscription.stories.d.ts +0 -17
  297. package/dist/types/src/components/stories/FileTranscription.stories.d.ts.map +0 -1
  298. package/dist/types/src/components/stories/KeyWordRecognition.stories.d.ts +0 -10
  299. package/dist/types/src/components/stories/KeyWordRecognition.stories.d.ts.map +0 -1
  300. package/dist/types/src/components/stories/MicrophoneTranscription.stories.d.ts +0 -19
  301. package/dist/types/src/components/stories/MicrophoneTranscription.stories.d.ts.map +0 -1
  302. package/dist/types/src/components/stories/TranscriptionStory.d.ts +0 -11
  303. package/dist/types/src/components/stories/TranscriptionStory.d.ts.map +0 -1
  304. package/dist/types/src/components/stories/useIsSpeaking.d.ts.map +0 -1
  305. package/dist/types/src/segments-normalization/index.d.ts.map +0 -1
  306. package/dist/types/src/segments-normalization/message-normalizer.d.ts.map +0 -1
  307. package/dist/types/src/segments-normalization/normalization.d.ts +0 -329
  308. package/dist/types/src/segments-normalization/normalization.d.ts.map +0 -1
  309. package/dist/types/src/segments-normalization/normalization.test.d.ts.map +0 -1
  310. package/dist/types/src/segments-normalization/utils.d.ts +0 -3
  311. package/dist/types/src/segments-normalization/utils.d.ts.map +0 -1
  312. package/dist/types/src/types/schema.d.ts +0 -41
  313. package/dist/types/src/types/schema.d.ts.map +0 -1
  314. package/dist/types/src/types/types.d.ts +0 -31
  315. package/dist/types/src/types/types.d.ts.map +0 -1
  316. package/src/capabilities/capabilities.ts +0 -33
  317. package/src/capabilities/intent-resolver.ts +0 -24
  318. package/src/components/Transcript/Transcript.tsx +0 -100
  319. package/src/components/Transcript/deprecated/OldTranscript.tsx +0 -260
  320. package/src/components/TranscriptContainer.tsx +0 -30
  321. package/src/components/stories/TranscriptionStory.tsx +0 -41
  322. package/src/segments-normalization/normalization.ts +0 -105
  323. package/src/types/schema.ts +0 -41
  324. package/src/types/types.ts +0 -32
  325. package/dist/lib/browser/{TranscriptContainer-H3AZQ4CQ.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
  326. package/dist/lib/{node-esm/TranscriptContainer-G75LDEO5.mjs.map → browser/hooks/index.mjs.map} +0 -0
  327. package/dist/types/src/{segments-normalization → normalization}/normalization.test.d.ts +0 -0
  328. package/dist/types/src/{components/stories → stories}/useIsSpeaking.d.ts +0 -0
  329. package/src/{segments-normalization → normalization}/index.ts +1 -1
  330. /package/src/{components/stories → stories}/useIsSpeaking.tsx +0 -0
@@ -20,67 +20,63 @@ export const useAudioFile = (audioUrl: string, constraints?: MediaTrackConstrain
20
20
  const ctx = new Context();
21
21
 
22
22
  scheduleTask(ctx, async () => {
23
- const response = await fetch(audioUrl);
24
- const blob = await response.blob();
25
- const objectUrl = URL.createObjectURL(blob);
26
- ctx.onDispose(() => {
27
- URL.revokeObjectURL(objectUrl);
28
- });
23
+ // TODO(wittjosiah): Fetch to external url fails in headless storybook test.
24
+ try {
25
+ const response = await fetch(audioUrl);
26
+ const blob = await response.blob();
27
+ const objectUrl = URL.createObjectURL(blob);
28
+ ctx.onDispose(() => {
29
+ URL.revokeObjectURL(objectUrl);
30
+ });
29
31
 
30
- const audio = new Audio();
31
- audio.src = objectUrl;
32
+ const audio = new Audio();
33
+ audio.src = objectUrl;
32
34
 
33
- await new Promise<void>((resolve, reject) => {
34
- audio.addEventListener(
35
- 'error',
36
- (err) => {
37
- log.error('error', { err });
38
- reject(err);
39
- },
40
- { once: true },
41
- );
42
- audio.addEventListener(
43
- 'canplay',
44
- async () => {
45
- log.info('starting...');
46
- try {
47
- // Try to play the audio
48
- await audio.play();
35
+ await new Promise<void>((resolve, reject) => {
36
+ audio.addEventListener(
37
+ 'error',
38
+ (err) => {
39
+ log.error('error', { err });
40
+ reject(err);
41
+ },
42
+ { once: true },
43
+ );
44
+ audio.addEventListener(
45
+ 'canplay',
46
+ async () => {
49
47
  resolve();
50
- } catch (playError) {
51
- log.error('Play failed', { playError });
52
- // Still resolve as the audio is ready, even if autoplay failed.
53
- resolve();
54
- }
55
- },
56
- { once: true },
57
- );
58
- audio.load();
59
- });
48
+ },
49
+ { once: true },
50
+ );
51
+ audio.load();
52
+ });
60
53
 
61
- const audioCtx = new AudioContext();
54
+ const audioCtx = new AudioContext();
62
55
 
63
- // Resume AudioContext if it's suspended.
64
- if (audioCtx.state === 'suspended') {
65
- await audioCtx.resume();
66
- }
56
+ // Resume AudioContext if it's suspended.
57
+ if (audioCtx.state === 'suspended') {
58
+ await audioCtx.resume();
59
+ }
67
60
 
68
- const destination = audioCtx.createMediaStreamDestination();
69
- destination.channelCount = 1;
61
+ const destination = audioCtx.createMediaStreamDestination();
62
+ destination.channelCount = 1;
70
63
 
71
- const source = audioCtx.createMediaElementSource(audio);
72
- source.connect(destination);
73
- const track = destination.stream.getAudioTracks()[0];
74
- if (constraints) {
75
- await track.applyConstraints(constraints).catch((err) => log.catch(err));
76
- }
64
+ const source = audioCtx.createMediaElementSource(audio);
65
+ source.connect(destination);
66
+ const track = destination.stream.getAudioTracks()[0];
67
+ if (constraints) {
68
+ await track.applyConstraints(constraints).catch((err) => log.catch(err));
69
+ }
77
70
 
78
- // Also connect to speakers so audio is audible.
79
- setStream({
80
- audio,
81
- stream: destination.stream,
82
- track: destination.stream.getAudioTracks()[0],
83
- });
71
+ // Also connect to speakers so audio is audible.
72
+ setStream({
73
+ audio,
74
+ stream: destination.stream,
75
+ track: destination.stream.getAudioTracks()[0],
76
+ });
77
+ } catch (err) {
78
+ log.catch(err);
79
+ }
84
80
  });
85
81
 
86
82
  return () => {
@@ -12,7 +12,7 @@ import { type ChunkRenderer, SerializationModel } from '../model';
12
12
  /**
13
13
  * Model adapter for a queue.
14
14
  */
15
- export const useQueueModelAdapter = <T extends Obj.Any>(
15
+ export const useQueueModelAdapter = <T extends Obj.Unknown>(
16
16
  renderer: ChunkRenderer<T>,
17
17
  queue: Queue<T> | undefined,
18
18
  initialChunks: T[] = [],
@@ -4,9 +4,10 @@
4
4
 
5
5
  import { useEffect, useMemo } from 'react';
6
6
 
7
- import { useCapabilities } from '@dxos/app-framework';
7
+ import { useCapabilities } from '@dxos/app-framework/ui';
8
+
9
+ import { TranscriptionCapabilities } from '#types';
8
10
 
9
- import { TranscriptionCapabilities } from '../capabilities';
10
11
  import { type Transcriber } from '../transcriber';
11
12
 
12
13
  /**
@@ -14,20 +15,27 @@ import { type Transcriber } from '../transcriber';
14
15
  */
15
16
  export const useTranscriber = ({
16
17
  audioStreamTrack,
17
- onSegments,
18
- transcriberConfig,
19
18
  recorderConfig,
19
+ transcriberConfig,
20
+ onSegments,
21
+ transcribe,
20
22
  }: Partial<TranscriptionCapabilities.GetTranscriberProps>) => {
21
23
  const [getTranscriber] = useCapabilities(TranscriptionCapabilities.Transcriber);
22
24
 
23
25
  // Initialize audio transcription.
24
26
  const transcriber = useMemo<Transcriber | undefined>(() => {
25
- if (!onSegments || !audioStreamTrack || !getTranscriber) {
27
+ if (!getTranscriber || !audioStreamTrack || !onSegments) {
26
28
  return undefined;
27
29
  }
28
30
 
29
- return getTranscriber({ audioStreamTrack, onSegments, transcriberConfig, recorderConfig });
30
- }, [audioStreamTrack, onSegments, getTranscriber, transcriberConfig, recorderConfig]);
31
+ return getTranscriber({
32
+ audioStreamTrack,
33
+ recorderConfig,
34
+ transcriberConfig,
35
+ onSegments,
36
+ transcribe,
37
+ });
38
+ }, [getTranscriber, audioStreamTrack, recorderConfig, transcriberConfig, onSegments, transcribe]);
31
39
 
32
40
  useEffect(() => {
33
41
  return () => {
@@ -2,16 +2,16 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { useState, useEffect, useCallback } from 'react';
5
+ import { useCallback, useEffect, useState } from 'react';
6
6
 
7
7
  import { scheduleMicroTask } from '@dxos/async';
8
8
  import { Context } from '@dxos/context';
9
9
  import { log } from '@dxos/log';
10
10
  import { useSoundEffect } from '@dxos/react-ui-sfx';
11
11
 
12
+ import { type TranscriberProps } from '../transcriber';
12
13
  import { useAudioTrack } from './useAudioTrack';
13
14
  import { useTranscriber } from './useTranscriber';
14
- import { type TranscriberParams } from '../transcriber';
15
15
 
16
16
  export type UseVoiceInputProps = {
17
17
  active?: boolean;
@@ -25,7 +25,7 @@ export const useVoiceInput = ({ active, onUpdate }: UseVoiceInputProps) => {
25
25
  const soundStart = useSoundEffect('StartRecording');
26
26
  const soundStop = useSoundEffect('StopRecording');
27
27
 
28
- const handleSegments = useCallback<TranscriberParams['onSegments']>(async (segments) => {
28
+ const handleSegments = useCallback<TranscriberProps['onSegments']>(async (segments) => {
29
29
  const text = segments.map((str) => str.text.trim().replace(/[^\w\s]/g, '')).join(' ');
30
30
  onUpdate(text);
31
31
  }, []);
package/src/index.ts CHANGED
@@ -2,11 +2,16 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- export { TranscriptionCapabilities } from './capabilities';
5
+ import { Plugin } from '@dxos/app-framework';
6
6
 
7
- export * from './components';
8
- export * from './hooks';
7
+ import { meta } from './meta';
8
+
9
+ export const TranscriptionPlugin = Plugin.lazy(meta, () => import('#plugin'));
10
+
11
+ export { TranscriptionCapabilities } from './types';
12
+
13
+ // TODO(wittjosiah): Hooks should not be exported from the plugin package at all.
14
+ // Either refactor callers to not need them or factor them out to a shared package.
9
15
  export * from './meta';
16
+ export * from './hooks';
10
17
  export * from './transcriber';
11
-
12
- export * from './TranscriptionPlugin';
package/src/meta.ts CHANGED
@@ -2,15 +2,18 @@
2
2
  // Copyright 2023 DXOS.org
3
3
  //
4
4
 
5
- import { type PluginMeta } from '@dxos/app-framework';
5
+ import { type Plugin } from '@dxos/app-framework';
6
+ import { trim } from '@dxos/util';
6
7
 
7
- export const TRANSCRIPTION_PLUGIN = 'dxos.org/plugin/transcription';
8
-
9
- export const meta: PluginMeta = {
10
- id: TRANSCRIPTION_PLUGIN,
8
+ export const meta: Plugin.Meta = {
9
+ id: 'org.dxos.plugin.transcription',
11
10
  name: 'Transcription',
12
- description: 'Voice transcription.',
11
+ description: trim`
12
+ Real-time voice-to-text transcription service for capturing spoken content.
13
+ Convert audio input into searchable text that integrates seamlessly with notes and documents.
14
+ `,
13
15
  icon: 'ph--microphone--regular',
16
+ iconHue: 'sky',
14
17
  source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-transcription',
15
18
  tags: ['labs'],
16
19
  screenshots: [],
@@ -7,18 +7,18 @@ import { describe, test } from 'vitest';
7
7
 
8
8
  import { Obj } from '@dxos/echo';
9
9
  import type { ObjectId } from '@dxos/keys';
10
- import { DataType } from '@dxos/schema';
10
+ import { Message } from '@dxos/types';
11
11
 
12
- import { SerializationModel, DocumentAdapter, type ChunkRenderer } from './model';
12
+ import { type ChunkRenderer, DocumentAdapter, SerializationModel } from './model';
13
13
 
14
- const blockToMarkdown: ChunkRenderer<DataType.Message> = (
15
- message: DataType.Message,
14
+ const blockToMarkdown: ChunkRenderer<Message.Message> = (
15
+ message: Message.Message,
16
16
  index: number,
17
17
  debug = true,
18
18
  ): string[] => {
19
19
  return [
20
20
  `###### ${message.sender.name}`,
21
- ...message.blocks.filter((block) => block.type === 'transcription').map((block) => block.text),
21
+ ...message.blocks.filter((block) => block._tag === 'transcript').map((block) => block.text),
22
22
  '',
23
23
  ];
24
24
  };
@@ -27,17 +27,17 @@ const createDate = () => new Date().toISOString();
27
27
 
28
28
  describe('SerializationModel', () => {
29
29
  test('basic', ({ expect }) => {
30
- const model = new SerializationModel<DataType.Message>(blockToMarkdown);
30
+ const model = new SerializationModel<Message.Message>(blockToMarkdown);
31
31
  expect(model.chunks.length).to.eq(0);
32
32
  expect(model.doc.toString()).to.eq('');
33
33
 
34
34
  // Create message.
35
- const message = Obj.make(DataType.Message, {
35
+ const message = Obj.make(Message.Message, {
36
36
  created: createDate(),
37
37
  sender: { name: 'Alice' },
38
38
  blocks: [
39
39
  {
40
- type: 'transcription',
40
+ _tag: 'transcript',
41
41
  started: createDate(),
42
42
  text: 'Hello world!',
43
43
  },
@@ -51,7 +51,9 @@ describe('SerializationModel', () => {
51
51
  }
52
52
 
53
53
  // Update message.
54
- message.blocks.push({ type: 'transcription', started: createDate(), text: 'Hello again!' });
54
+ Obj.update(message, (message) => {
55
+ message.blocks.push({ _tag: 'transcript', started: createDate(), text: 'Hello again!' });
56
+ });
55
57
  model.updateChunk(message);
56
58
  {
57
59
  const text = model.doc.toString();
@@ -62,19 +64,19 @@ describe('SerializationModel', () => {
62
64
 
63
65
  test('sync - append', ({ expect }) => {
64
66
  const view = new EditorView({ extensions: [], doc: '' });
65
- const model = new SerializationModel<DataType.Message>(blockToMarkdown);
67
+ const model = new SerializationModel<Message.Message>(blockToMarkdown);
66
68
  const adapter = new DocumentAdapter(view);
67
69
  expect(adapter.lineCount()).to.eq(0);
68
70
  expect(view.state.doc.toString()).to.eq('');
69
71
 
70
72
  // Append message.
71
73
  {
72
- const message = Obj.make(DataType.Message, {
74
+ const message = Obj.make(Message.Message, {
73
75
  created: createDate(),
74
76
  sender: { name: 'Alice' },
75
77
  blocks: [
76
78
  {
77
- type: 'transcription',
79
+ _tag: 'transcript',
78
80
  started: createDate(),
79
81
  text: 'Hello world!',
80
82
  },
@@ -87,12 +89,12 @@ describe('SerializationModel', () => {
87
89
 
88
90
  // Append message.
89
91
  {
90
- const message = Obj.make(DataType.Message, {
92
+ const message = Obj.make(Message.Message, {
91
93
  created: createDate(),
92
94
  sender: { name: 'Bob' },
93
95
  blocks: [
94
96
  {
95
- type: 'transcription',
97
+ _tag: 'transcript',
96
98
  started: createDate(),
97
99
  text: 'Hello world!',
98
100
  },
@@ -106,7 +108,7 @@ describe('SerializationModel', () => {
106
108
 
107
109
  test('sync - append, update, delete', ({ expect }) => {
108
110
  const view = new EditorView({ extensions: [], doc: '' });
109
- const model = new SerializationModel<DataType.Message>(blockToMarkdown);
111
+ const model = new SerializationModel<Message.Message>(blockToMarkdown);
110
112
  const adapter = new DocumentAdapter(view);
111
113
  expect(adapter.lineCount()).to.eq(0);
112
114
 
@@ -114,12 +116,12 @@ describe('SerializationModel', () => {
114
116
 
115
117
  // Append message.
116
118
  {
117
- const message = Obj.make(DataType.Message, {
119
+ const message = Obj.make(Message.Message, {
118
120
  created: createDate(),
119
121
  sender: { name: 'Alice' },
120
122
  blocks: [
121
123
  {
122
- type: 'transcription',
124
+ _tag: 'transcript',
123
125
  started: createDate(),
124
126
  text: 'Hello world!',
125
127
  },
@@ -131,13 +133,17 @@ describe('SerializationModel', () => {
131
133
  expect(view.state.doc.toString()).to.eq('###### Alice\nHello world!\n\n');
132
134
 
133
135
  // Update message (add block).
134
- message.blocks.push({ type: 'transcription', started: createDate(), text: 'Hello again!' });
136
+ Obj.update(message, (message) => {
137
+ message.blocks.push({ _tag: 'transcript', started: createDate(), text: 'Hello again!' });
138
+ });
135
139
  model.updateChunk(message);
136
140
  model.sync(adapter);
137
141
  expect(view.state.doc.toString()).to.eq('###### Alice\nHello world!\nHello again!\n\n');
138
142
 
139
143
  // Update message (remove block).
140
- message.blocks.splice(0, 1);
144
+ Obj.update(message, (message) => {
145
+ message.blocks.splice(0, 1);
146
+ });
141
147
  model.updateChunk(message);
142
148
  model.sync(adapter);
143
149
  expect(view.state.doc.toString()).to.eq('###### Alice\nHello again!\n\n');
@@ -147,10 +153,10 @@ describe('SerializationModel', () => {
147
153
 
148
154
  // Append message.
149
155
  {
150
- const message = Obj.make(DataType.Message, {
156
+ const message = Obj.make(Message.Message, {
151
157
  created: createDate(),
152
158
  sender: { name: 'Bob' },
153
- blocks: [{ type: 'transcription', started: createDate(), text: 'Hello again!' }],
159
+ blocks: [{ _tag: 'transcript', started: createDate(), text: 'Hello again!' }],
154
160
  });
155
161
  model.appendChunk(message);
156
162
  model.sync(adapter);
@@ -80,6 +80,9 @@ type ChunkChange<T extends Chunk> =
80
80
  * Instead this model tracks changes and syncs them with the ChunkDocument.
81
81
  */
82
82
  export class SerializationModel<T extends Chunk> {
83
+ /** Emits when the document is updated. */
84
+ public readonly update = new Event<void>();
85
+
83
86
  /** Ordered set of chunks. */
84
87
  private readonly _chunks: T[] = [];
85
88
 
@@ -92,9 +95,6 @@ export class SerializationModel<T extends Chunk> {
92
95
  /** Track chunk changes since last sync. */
93
96
  private readonly _changes: Array<ChunkChange<T>> = [];
94
97
 
95
- /** Emits when the document is updated. */
96
- public readonly update = new Event<void>();
97
-
98
98
  constructor(
99
99
  private readonly _renderer: ChunkRenderer<T>,
100
100
  initialChunks: T[] = [],
@@ -2,28 +2,22 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- //
6
- // Copyright 2025 DXOS.org
7
- //
8
-
9
- import { effect } from '@preact/signals-core';
10
-
11
- import { asyncTimeout, DeferredTask } from '@dxos/async';
5
+ import { DeferredTask, asyncTimeout } from '@dxos/async';
12
6
  import { LifecycleState, Resource } from '@dxos/context';
13
7
  import { type Queue } from '@dxos/echo-db';
14
- import { type FunctionExecutor } from '@dxos/functions';
8
+ import { type FunctionExecutor } from '@dxos/functions-runtime';
15
9
  import { log } from '@dxos/log';
16
- import { type DataType } from '@dxos/schema';
10
+ import { type Message } from '@dxos/types';
17
11
 
18
- import { type MessageWithRangeId, sentenceNormalization } from './normalization';
12
+ import { type MessageWithRangeId, type NormalizationOutput, sentenceNormalization } from './normalization';
19
13
  import { getActorId } from './utils';
20
14
 
21
15
  const PROCESSING_TIMEOUT = 20_000; // ms
22
16
  const MAX_RANGE_ID_COUNT = 10;
23
17
 
24
- export type SegmentsNormalizerParams = {
18
+ export type SegmentsNormalizerProps = {
25
19
  functionExecutor: FunctionExecutor;
26
- queue: Queue<DataType.Message>;
20
+ queue: Queue<Message.Message>;
27
21
  startingCursor: QueueCursor;
28
22
  };
29
23
 
@@ -33,16 +27,16 @@ export type QueueCursor = {
33
27
  timestamp: string;
34
28
  };
35
29
 
36
- // TODO(mykola): .
37
30
  export class MessageNormalizer extends Resource {
38
31
  private readonly _functionExecutor: FunctionExecutor;
39
- private _queue: Queue<DataType.Message>;
32
+
33
+ private _queue: Queue<Message.Message>;
40
34
  private _cursor: QueueCursor;
41
35
  private _messagesToProcess: MessageWithRangeId[] = [];
42
36
  private _normalizationTask?: DeferredTask;
43
37
  private _lastProcessedMessageIds?: string[];
44
38
 
45
- constructor({ functionExecutor, queue, startingCursor }: SegmentsNormalizerParams) {
39
+ constructor({ functionExecutor, queue, startingCursor }: SegmentsNormalizerProps) {
46
40
  super();
47
41
  this._functionExecutor = functionExecutor;
48
42
  this._queue = queue;
@@ -51,7 +45,8 @@ export class MessageNormalizer extends Resource {
51
45
 
52
46
  protected override async _open(): Promise<void> {
53
47
  this._normalizationTask = new DeferredTask(this._ctx, () => this._processMessages());
54
- const unsubscribe = effect(() => {
48
+
49
+ const updateMessages = () => {
55
50
  if (this._lifecycleState !== LifecycleState.OPEN) {
56
51
  return;
57
52
  }
@@ -62,8 +57,14 @@ export class MessageNormalizer extends Resource {
62
57
  });
63
58
 
64
59
  this._normalizationTask!.schedule();
65
- });
66
- this._ctx.onDispose(() => unsubscribe());
60
+ };
61
+
62
+ // Initial update.
63
+ updateMessages();
64
+
65
+ // Subscribe to queue changes.
66
+ const unsubscribe = this._queue.subscribe(updateMessages);
67
+ this._ctx.onDispose(unsubscribe);
67
68
  }
68
69
 
69
70
  // Need to unpack strings from blocks from messages run them through the function and then pack them back into blocks into messages.
@@ -81,7 +82,7 @@ export class MessageNormalizer extends Resource {
81
82
 
82
83
  try {
83
84
  // TODO(mykola): Executor should support timeout.
84
- const response = await asyncTimeout(
85
+ const response: NormalizationOutput = await asyncTimeout(
85
86
  this._functionExecutor.invoke(sentenceNormalization, { messages }),
86
87
  PROCESSING_TIMEOUT,
87
88
  );
@@ -2,25 +2,22 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { effect } from '@preact/signals-core';
6
5
  import { describe, test } from 'vitest';
7
6
 
8
- import { EdgeAiServiceClient, OllamaAiServiceClient } from '@dxos/ai';
9
- import { AI_SERVICE_ENDPOINT } from '@dxos/ai/testing';
10
7
  import { scheduleTaskInterval } from '@dxos/async';
11
8
  import { Context } from '@dxos/context';
12
9
  import { Obj } from '@dxos/echo';
13
10
  import { MemoryQueue } from '@dxos/echo-db';
14
- import { createQueueDXN } from '@dxos/echo-schema';
15
- import { FunctionExecutor, ServiceContainer } from '@dxos/functions';
11
+ import { createQueueDXN } from '@dxos/echo/internal';
12
+ import { FunctionExecutor, ServiceContainer } from '@dxos/functions-runtime';
16
13
  import { log } from '@dxos/log';
17
- import { DataType } from '@dxos/schema';
14
+ import { type Actor, Message } from '@dxos/types';
18
15
 
19
16
  import { MessageNormalizer } from './message-normalizer';
20
17
  import { type MessageWithRangeId, sentenceNormalization } from './normalization';
21
18
  import { getActorId } from './utils';
22
19
 
23
- const sender: DataType.Actor = {
20
+ const sender: Actor.Actor = {
24
21
  identityDid: 'did:key:123',
25
22
  };
26
23
 
@@ -50,34 +47,33 @@ const messages: MessageWithRangeId[] = [
50
47
  // No punctuation.
51
48
  'in classical physics objects have well-defined properties such as position speed and momentum',
52
49
  ].map((string, index) =>
53
- Obj.make(DataType.Message, {
54
- created: new Date(Date.now() + 1000 * index).toISOString(),
50
+ Obj.make(Message.Message, {
51
+ created: new Date(Date.now() + 1_000 * index).toISOString(),
55
52
  sender,
56
- blocks: [{ type: 'transcription', started: new Date(Date.now() + 1000 * index).toISOString(), text: string }],
57
- rangeId: [],
58
- } as any),
53
+ blocks: [{ _tag: 'transcript', started: new Date(Date.now() + 1_000 * index).toISOString(), text: string }],
54
+ }),
59
55
  );
60
56
 
61
- const REMOTE_AI = true;
57
+ // const REMOTE_AI = true;
62
58
 
63
59
  describe.skip('SentenceNormalization', () => {
64
60
  const getExecutor = () => {
65
61
  return new FunctionExecutor(
66
62
  new ServiceContainer().setServices({
67
- ai: {
68
- client: REMOTE_AI
69
- ? new EdgeAiServiceClient({
70
- endpoint: AI_SERVICE_ENDPOINT.REMOTE,
71
- defaultGenerationOptions: {
72
- model: '@anthropic/claude-3-5-sonnet-20241022',
73
- },
74
- })
75
- : new OllamaAiServiceClient({
76
- overrides: {
77
- model: 'llama3.1:8b',
78
- },
79
- }),
80
- },
63
+ // ai: {
64
+ // client: REMOTE_AI
65
+ // ? new Edge AiServiceClient({
66
+ // endpoint: AI_SERVICE_ENDPOINT.REMOTE,
67
+ // defaultGenerationOptions: {
68
+ // model: '@anthropic/claude-3-5-sonnet-20241022',
69
+ // },
70
+ // })
71
+ // : new Ollama AiServiceClient({
72
+ // overrides: {
73
+ // model: 'llama3.1:8b',
74
+ // },
75
+ // }),
76
+ // },
81
77
  }),
82
78
  );
83
79
  };
@@ -100,8 +96,9 @@ describe.skip('SentenceNormalization', () => {
100
96
  buffer = sentences.slice(activeSentenceIndex);
101
97
  }
102
98
  }
99
+
103
100
  log.info('sentences', {
104
- originalMessages: JSON.stringify(messages, null, 2),
101
+ messages: JSON.stringify(messages, null, 2),
105
102
  sentences: JSON.stringify(sentences, null, 2),
106
103
  });
107
104
  throw new Error('test');
@@ -110,7 +107,7 @@ describe.skip('SentenceNormalization', () => {
110
107
  test.only('queue', { timeout: 120_000 }, async () => {
111
108
  // Create queue.
112
109
  // TODO(dmaretskyi): Use space.queues.create() instead.
113
- const queue = new MemoryQueue<DataType.Message>(createQueueDXN());
110
+ const queue = new MemoryQueue<Message.Message>(createQueueDXN());
114
111
  const ctx = new Context();
115
112
  let idx = 0;
116
113
  scheduleTaskInterval(
@@ -135,10 +132,6 @@ describe.skip('SentenceNormalization', () => {
135
132
 
136
133
  // Start normalizer.
137
134
  await normalizer.open();
138
- effect(() => {
139
- log.info('normalizer');
140
- log.info(JSON.stringify(queue.objects, null, 2));
141
- });
142
135
 
143
136
  await new Promise(() => {});
144
137
  });