@dxos/plugin-transcription 0.9.0 → 0.9.1-staging.ee54ba693a

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 (324) hide show
  1. package/PLUGIN.mdl +25 -5
  2. package/dist/lib/neutral/{TranscriptionArticle-L6XANBH5.mjs → TranscriptionArticle-FEWCWG4A.mjs} +4 -7
  3. package/dist/lib/neutral/TranscriptionArticle-FEWCWG4A.mjs.map +7 -0
  4. package/dist/lib/neutral/TranscriptionPlugin.mjs +29 -6
  5. package/dist/lib/neutral/TranscriptionPlugin.mjs.map +4 -4
  6. package/dist/lib/neutral/TranscriptionPlugin.node.mjs +3 -3
  7. package/dist/lib/neutral/TranscriptionPlugin.node.mjs.map +3 -3
  8. package/dist/lib/neutral/app-graph-builder-GQRMI22E.mjs +48 -0
  9. package/dist/lib/neutral/app-graph-builder-GQRMI22E.mjs.map +7 -0
  10. package/dist/lib/neutral/capabilities/index.mjs +19 -5
  11. package/dist/lib/neutral/capabilities/index.mjs.map +3 -3
  12. package/dist/lib/neutral/chunk-5BVHY75B.mjs +54 -0
  13. package/dist/lib/neutral/chunk-5BVHY75B.mjs.map +7 -0
  14. package/dist/lib/neutral/chunk-HNXSU7HJ.mjs +8 -0
  15. package/dist/lib/neutral/{chunk-KXJZEYS7.mjs.map → chunk-HNXSU7HJ.mjs.map} +2 -2
  16. package/dist/lib/neutral/chunk-KOXLGGSL.mjs +30 -0
  17. package/dist/lib/neutral/chunk-KOXLGGSL.mjs.map +7 -0
  18. package/dist/lib/neutral/chunk-MDV7NBFJ.mjs +182 -0
  19. package/dist/lib/neutral/chunk-MDV7NBFJ.mjs.map +7 -0
  20. package/dist/lib/neutral/components/index.mjs +114 -258
  21. package/dist/lib/neutral/components/index.mjs.map +4 -4
  22. package/dist/lib/neutral/containers/index.mjs +1 -1
  23. package/dist/lib/neutral/{create-RVR7VC33.mjs → create-HNHGCKZ4.mjs} +2 -2
  24. package/dist/lib/neutral/enrich-message-DSJU4TXC.mjs +24 -0
  25. package/dist/lib/neutral/enrich-message-DSJU4TXC.mjs.map +7 -0
  26. package/dist/lib/neutral/entity-lookup-PCDW7NC4.mjs +25 -0
  27. package/dist/lib/neutral/entity-lookup-PCDW7NC4.mjs.map +7 -0
  28. package/dist/lib/neutral/hooks/index.mjs +93 -15
  29. package/dist/lib/neutral/hooks/index.mjs.map +4 -4
  30. package/dist/lib/neutral/index.mjs +8 -32
  31. package/dist/lib/neutral/markdown-extension-CCDXXY7E.mjs +16 -0
  32. package/dist/lib/neutral/markdown-extension-CCDXXY7E.mjs.map +7 -0
  33. package/dist/lib/neutral/meta.json +1 -1
  34. package/dist/lib/neutral/meta.mjs +1 -1
  35. package/dist/lib/neutral/{open-A5KXKRH4.mjs → open-SNMZXXYO.mjs} +4 -6
  36. package/dist/lib/neutral/open-SNMZXXYO.mjs.map +7 -0
  37. package/dist/lib/neutral/operations/index.mjs +1 -1
  38. package/dist/lib/neutral/pipeline-status-XMWMAUJY.mjs +17 -0
  39. package/dist/lib/neutral/pipeline-status-XMWMAUJY.mjs.map +7 -0
  40. package/dist/lib/neutral/plugin.mjs +2 -2
  41. package/dist/lib/neutral/recording-session-IADO7ATU.mjs +15 -0
  42. package/dist/lib/neutral/recording-session-IADO7ATU.mjs.map +7 -0
  43. package/dist/lib/neutral/settings-7KE4MABW.mjs +31 -0
  44. package/dist/lib/neutral/settings-7KE4MABW.mjs.map +7 -0
  45. package/dist/lib/neutral/skill-definition-DXNK324V.mjs +15 -0
  46. package/dist/lib/neutral/skill-definition-DXNK324V.mjs.map +7 -0
  47. package/dist/lib/neutral/skills/index.mjs +8 -0
  48. package/dist/lib/neutral/{summarize-5XPPMVTE.mjs → summarize-LBUZTOTH.mjs} +4 -4
  49. package/dist/lib/neutral/summarize-LBUZTOTH.mjs.map +7 -0
  50. package/dist/lib/neutral/{text-content-KBB37HSM.mjs → text-content-NOWR642C.mjs} +9 -9
  51. package/dist/lib/neutral/text-content-NOWR642C.mjs.map +7 -0
  52. package/dist/lib/neutral/transcriber-6XZHUUHK.mjs +174 -0
  53. package/dist/lib/neutral/transcriber-6XZHUUHK.mjs.map +7 -0
  54. package/dist/lib/neutral/transcription-driver-DN6ELQXZ.mjs +207 -0
  55. package/dist/lib/neutral/transcription-driver-DN6ELQXZ.mjs.map +7 -0
  56. package/dist/lib/neutral/translations.mjs +8 -1
  57. package/dist/lib/neutral/translations.mjs.map +3 -3
  58. package/dist/lib/neutral/types/index.mjs +3 -1
  59. package/dist/types/dx.config.d.ts +28 -0
  60. package/dist/types/dx.config.d.ts.map +1 -0
  61. package/dist/types/src/TranscriptionPlugin.d.ts.map +1 -1
  62. package/dist/types/src/capabilities/app-graph-builder.d.ts +5 -0
  63. package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
  64. package/dist/types/src/capabilities/entity-lookup.d.ts +10 -0
  65. package/dist/types/src/capabilities/entity-lookup.d.ts.map +1 -0
  66. package/dist/types/src/capabilities/index.d.ts +11 -8
  67. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  68. package/dist/types/src/capabilities/markdown-extension.d.ts +5 -0
  69. package/dist/types/src/capabilities/markdown-extension.d.ts.map +1 -0
  70. package/dist/types/src/capabilities/pipeline-status.d.ts +9 -0
  71. package/dist/types/src/capabilities/pipeline-status.d.ts.map +1 -0
  72. package/dist/types/src/capabilities/react-surface.d.ts +2 -2
  73. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  74. package/dist/types/src/capabilities/recording-session.d.ts +5 -0
  75. package/dist/types/src/capabilities/recording-session.d.ts.map +1 -0
  76. package/dist/types/src/capabilities/settings.d.ts +5 -0
  77. package/dist/types/src/capabilities/settings.d.ts.map +1 -0
  78. package/dist/types/src/capabilities/skill-definition.d.ts +5 -0
  79. package/dist/types/src/capabilities/skill-definition.d.ts.map +1 -0
  80. package/dist/types/src/capabilities/text-content.d.ts +1 -4
  81. package/dist/types/src/capabilities/transcriber.d.ts +4 -3
  82. package/dist/types/src/capabilities/transcriber.d.ts.map +1 -1
  83. package/dist/types/src/capabilities/transcription-driver.d.ts +5 -0
  84. package/dist/types/src/capabilities/transcription-driver.d.ts.map +1 -0
  85. package/dist/types/src/components/Mic/Mic.d.ts +12 -0
  86. package/dist/types/src/components/Mic/Mic.d.ts.map +1 -0
  87. package/dist/types/src/components/{Oracle/Oracle.stories.d.ts → Mic/Mic.stories.d.ts} +9 -7
  88. package/dist/types/src/components/Mic/Mic.stories.d.ts.map +1 -0
  89. package/dist/types/src/components/Mic/index.d.ts +2 -0
  90. package/dist/types/src/components/Mic/index.d.ts.map +1 -0
  91. package/dist/types/src/components/index.d.ts +1 -2
  92. package/dist/types/src/components/index.d.ts.map +1 -1
  93. package/dist/types/src/containers/TranscriptionArticle/TranscriptionArticle.d.ts.map +1 -1
  94. package/dist/types/src/containers/TranscriptionArticle/TranscriptionArticle.stories.d.ts +7 -0
  95. package/dist/types/src/containers/TranscriptionArticle/TranscriptionArticle.stories.d.ts.map +1 -1
  96. package/dist/types/src/hooks/index.d.ts +0 -5
  97. package/dist/types/src/hooks/index.d.ts.map +1 -1
  98. package/dist/types/src/hooks/useTranscriptionRecording.d.ts.map +1 -1
  99. package/dist/types/src/index.d.ts +1 -3
  100. package/dist/types/src/index.d.ts.map +1 -1
  101. package/dist/types/src/meta.d.ts +32 -2
  102. package/dist/types/src/meta.d.ts.map +1 -1
  103. package/dist/types/src/normalization/message-normalizer.d.ts +2 -2
  104. package/dist/types/src/normalization/message-normalizer.d.ts.map +1 -1
  105. package/dist/types/src/normalization/normalization.d.ts +98 -733
  106. package/dist/types/src/normalization/normalization.d.ts.map +1 -1
  107. package/dist/types/src/operations/enrich-message.d.ts +9 -0
  108. package/dist/types/src/operations/enrich-message.d.ts.map +1 -0
  109. package/dist/types/src/operations/index.d.ts.map +1 -1
  110. package/dist/types/src/operations/open.d.ts.map +1 -1
  111. package/dist/types/src/operations/summarize.d.ts.map +1 -1
  112. package/dist/types/src/skills/index.d.ts +2 -0
  113. package/dist/types/src/skills/index.d.ts.map +1 -0
  114. package/dist/types/src/skills/transcription-skill.d.ts +4 -0
  115. package/dist/types/src/skills/transcription-skill.d.ts.map +1 -0
  116. package/dist/types/src/stories/Keyword.stories.d.ts +51 -0
  117. package/dist/types/src/stories/Keyword.stories.d.ts.map +1 -0
  118. package/dist/types/src/stories/Pipeline.stories.d.ts +60 -0
  119. package/dist/types/src/stories/Pipeline.stories.d.ts.map +1 -0
  120. package/dist/types/src/stories/Transcription.stories.d.ts +23 -0
  121. package/dist/types/src/stories/Transcription.stories.d.ts.map +1 -0
  122. package/dist/types/src/testing/decorators.d.ts +21 -0
  123. package/dist/types/src/testing/decorators.d.ts.map +1 -0
  124. package/dist/types/src/testing/index.d.ts +1 -0
  125. package/dist/types/src/testing/index.d.ts.map +1 -1
  126. package/dist/types/src/testing/testing.d.ts +3 -13
  127. package/dist/types/src/testing/testing.d.ts.map +1 -1
  128. package/dist/types/src/{transcriber/transcription-manager.d.ts → transcription-manager.d.ts} +6 -5
  129. package/dist/types/src/transcription-manager.d.ts.map +1 -0
  130. package/dist/types/src/translations.d.ts +7 -0
  131. package/dist/types/src/translations.d.ts.map +1 -1
  132. package/dist/types/src/types/Settings.d.ts +13 -0
  133. package/dist/types/src/types/Settings.d.ts.map +1 -0
  134. package/dist/types/src/types/TranscriptOperation.d.ts +114 -1564
  135. package/dist/types/src/types/TranscriptOperation.d.ts.map +1 -1
  136. package/dist/types/src/types/TranscriptionCapabilities.d.ts +52 -11
  137. package/dist/types/src/types/TranscriptionCapabilities.d.ts.map +1 -1
  138. package/dist/types/src/types/index.d.ts +1 -0
  139. package/dist/types/src/types/index.d.ts.map +1 -1
  140. package/dist/types/src/util/index.d.ts +0 -3
  141. package/dist/types/src/util/index.d.ts.map +1 -1
  142. package/dist/types/tsconfig.tsbuildinfo +1 -1
  143. package/dx.config.ts +42 -0
  144. package/package.json +69 -69
  145. package/src/TranscriptionPlugin.node.ts +2 -2
  146. package/src/TranscriptionPlugin.test.ts +2 -2
  147. package/src/TranscriptionPlugin.tsx +40 -3
  148. package/src/capabilities/app-graph-builder.tsx +49 -0
  149. package/src/capabilities/entity-lookup.ts +32 -0
  150. package/src/capabilities/index.ts +8 -7
  151. package/src/capabilities/markdown-extension.ts +17 -0
  152. package/src/capabilities/pipeline-status.ts +23 -0
  153. package/src/capabilities/recording-session.ts +17 -0
  154. package/src/capabilities/settings.ts +34 -0
  155. package/src/capabilities/skill-definition.ts +15 -0
  156. package/src/capabilities/text-content.ts +10 -7
  157. package/src/capabilities/transcriber.ts +5 -48
  158. package/src/capabilities/transcription-driver.tsx +263 -0
  159. package/src/components/Mic/Mic.stories.tsx +66 -0
  160. package/src/components/Mic/Mic.tsx +136 -0
  161. package/src/components/Mic/index.ts +5 -0
  162. package/src/components/index.ts +1 -2
  163. package/src/containers/TranscriptionArticle/TranscriptionArticle.stories.tsx +4 -0
  164. package/src/containers/TranscriptionArticle/TranscriptionArticle.tsx +5 -6
  165. package/src/hooks/index.ts +0 -5
  166. package/src/hooks/useTranscriptionRecording.ts +27 -9
  167. package/src/index.ts +1 -5
  168. package/src/meta.ts +2 -35
  169. package/src/normalization/message-normalizer.ts +3 -3
  170. package/src/normalization/normalization.ts +3 -0
  171. package/src/operations/enrich-message.ts +27 -0
  172. package/src/operations/index.ts +1 -0
  173. package/src/operations/open.ts +2 -2
  174. package/src/operations/summarize.ts +2 -2
  175. package/src/skills/index.ts +5 -0
  176. package/src/skills/transcription-skill.ts +29 -0
  177. package/src/stories/Keyword.stories.tsx +98 -0
  178. package/src/stories/Pipeline.stories.tsx +361 -0
  179. package/src/stories/Transcription.stories.tsx +178 -0
  180. package/src/testing/decorators.ts +78 -0
  181. package/src/testing/index.ts +1 -0
  182. package/src/testing/testing.ts +14 -134
  183. package/src/{transcriber/transcription-manager.ts → transcription-manager.ts} +13 -12
  184. package/src/translations.ts +9 -1
  185. package/src/types/Settings.ts +59 -0
  186. package/src/types/TranscriptOperation.ts +22 -4
  187. package/src/types/TranscriptionCapabilities.ts +61 -20
  188. package/src/types/index.ts +1 -0
  189. package/src/util/index.ts +0 -3
  190. package/dist/lib/neutral/TranscriptionArticle-L6XANBH5.mjs.map +0 -7
  191. package/dist/lib/neutral/blueprint-definition-DA4QFRYJ.mjs +0 -15
  192. package/dist/lib/neutral/blueprint-definition-DA4QFRYJ.mjs.map +0 -7
  193. package/dist/lib/neutral/blueprints/index.mjs +0 -8
  194. package/dist/lib/neutral/chunk-FHNI26QW.mjs +0 -45
  195. package/dist/lib/neutral/chunk-FHNI26QW.mjs.map +0 -7
  196. package/dist/lib/neutral/chunk-KAEXRX3Y.mjs +0 -35
  197. package/dist/lib/neutral/chunk-KAEXRX3Y.mjs.map +0 -7
  198. package/dist/lib/neutral/chunk-KMT3BMMQ.mjs +0 -124
  199. package/dist/lib/neutral/chunk-KMT3BMMQ.mjs.map +0 -7
  200. package/dist/lib/neutral/chunk-KXJZEYS7.mjs +0 -8
  201. package/dist/lib/neutral/chunk-MLRJWAQH.mjs +0 -179
  202. package/dist/lib/neutral/chunk-MLRJWAQH.mjs.map +0 -7
  203. package/dist/lib/neutral/chunk-TO77KAQK.mjs +0 -298
  204. package/dist/lib/neutral/chunk-TO77KAQK.mjs.map +0 -7
  205. package/dist/lib/neutral/chunk-TX3NQISZ.mjs +0 -435
  206. package/dist/lib/neutral/chunk-TX3NQISZ.mjs.map +0 -7
  207. package/dist/lib/neutral/chunk-ZR4BH4QQ.mjs +0 -30
  208. package/dist/lib/neutral/chunk-ZR4BH4QQ.mjs.map +0 -7
  209. package/dist/lib/neutral/open-A5KXKRH4.mjs.map +0 -7
  210. package/dist/lib/neutral/summarize-5XPPMVTE.mjs.map +0 -7
  211. package/dist/lib/neutral/text-content-KBB37HSM.mjs.map +0 -7
  212. package/dist/lib/neutral/transcriber-OGSF3XO5.mjs +0 -59
  213. package/dist/lib/neutral/transcriber-OGSF3XO5.mjs.map +0 -7
  214. package/dist/types/src/blueprints/index.d.ts +0 -2
  215. package/dist/types/src/blueprints/index.d.ts.map +0 -1
  216. package/dist/types/src/blueprints/transcription-blueprint.d.ts +0 -4
  217. package/dist/types/src/blueprints/transcription-blueprint.d.ts.map +0 -1
  218. package/dist/types/src/capabilities/blueprint-definition.d.ts +0 -6
  219. package/dist/types/src/capabilities/blueprint-definition.d.ts.map +0 -1
  220. package/dist/types/src/components/Oracle/Oracle.d.ts +0 -24
  221. package/dist/types/src/components/Oracle/Oracle.d.ts.map +0 -1
  222. package/dist/types/src/components/Oracle/Oracle.stories.d.ts.map +0 -1
  223. package/dist/types/src/components/Oracle/index.d.ts +0 -2
  224. package/dist/types/src/components/Oracle/index.d.ts.map +0 -1
  225. package/dist/types/src/components/Transcription/Transcription.d.ts +0 -11
  226. package/dist/types/src/components/Transcription/Transcription.d.ts.map +0 -1
  227. package/dist/types/src/components/Transcription/Transcription.stories.d.ts +0 -37
  228. package/dist/types/src/components/Transcription/Transcription.stories.d.ts.map +0 -1
  229. package/dist/types/src/components/Transcription/index.d.ts +0 -2
  230. package/dist/types/src/components/Transcription/index.d.ts.map +0 -1
  231. package/dist/types/src/components/Transcription/transcription-extension.d.ts +0 -15
  232. package/dist/types/src/components/Transcription/transcription-extension.d.ts.map +0 -1
  233. package/dist/types/src/enrichment/conversation.test.d.ts +0 -2
  234. package/dist/types/src/enrichment/conversation.test.d.ts.map +0 -1
  235. package/dist/types/src/enrichment/operations.d.ts +0 -200
  236. package/dist/types/src/enrichment/operations.d.ts.map +0 -1
  237. package/dist/types/src/enrichment/parser.d.ts +0 -26
  238. package/dist/types/src/enrichment/parser.d.ts.map +0 -1
  239. package/dist/types/src/enrichment/stream-simulator.d.ts +0 -38
  240. package/dist/types/src/enrichment/stream-simulator.d.ts.map +0 -1
  241. package/dist/types/src/hooks/useAudioFile.d.ts +0 -7
  242. package/dist/types/src/hooks/useAudioFile.d.ts.map +0 -1
  243. package/dist/types/src/hooks/useAudioTrack.d.ts +0 -5
  244. package/dist/types/src/hooks/useAudioTrack.d.ts.map +0 -1
  245. package/dist/types/src/hooks/useFeedModelAdapter.d.ts +0 -12
  246. package/dist/types/src/hooks/useFeedModelAdapter.d.ts.map +0 -1
  247. package/dist/types/src/hooks/useTranscriber.d.ts +0 -7
  248. package/dist/types/src/hooks/useTranscriber.d.ts.map +0 -1
  249. package/dist/types/src/hooks/useVoiceInput.d.ts +0 -11
  250. package/dist/types/src/hooks/useVoiceInput.d.ts.map +0 -1
  251. package/dist/types/src/model/index.d.ts +0 -2
  252. package/dist/types/src/model/index.d.ts.map +0 -1
  253. package/dist/types/src/model/model.d.ts +0 -68
  254. package/dist/types/src/model/model.d.ts.map +0 -1
  255. package/dist/types/src/model/model.test.d.ts +0 -2
  256. package/dist/types/src/model/model.test.d.ts.map +0 -1
  257. package/dist/types/src/stories/FileTranscription.stories.d.ts +0 -20
  258. package/dist/types/src/stories/FileTranscription.stories.d.ts.map +0 -1
  259. package/dist/types/src/stories/KeyWordRecognition.stories.d.ts +0 -14
  260. package/dist/types/src/stories/KeyWordRecognition.stories.d.ts.map +0 -1
  261. package/dist/types/src/stories/LiveTranscription.stories.d.ts +0 -20
  262. package/dist/types/src/stories/LiveTranscription.stories.d.ts.map +0 -1
  263. package/dist/types/src/stories/TranscriptionStory.d.ts +0 -21
  264. package/dist/types/src/stories/TranscriptionStory.d.ts.map +0 -1
  265. package/dist/types/src/stories/common.d.ts +0 -248
  266. package/dist/types/src/stories/common.d.ts.map +0 -1
  267. package/dist/types/src/transcriber/audio-recorder.d.ts +0 -47
  268. package/dist/types/src/transcriber/audio-recorder.d.ts.map +0 -1
  269. package/dist/types/src/transcriber/index.d.ts +0 -5
  270. package/dist/types/src/transcriber/index.d.ts.map +0 -1
  271. package/dist/types/src/transcriber/media-stream-recorder.d.ts +0 -30
  272. package/dist/types/src/transcriber/media-stream-recorder.d.ts.map +0 -1
  273. package/dist/types/src/transcriber/transcriber.browser.test.d.ts +0 -2
  274. package/dist/types/src/transcriber/transcriber.browser.test.d.ts.map +0 -1
  275. package/dist/types/src/transcriber/transcriber.d.ts +0 -105
  276. package/dist/types/src/transcriber/transcriber.d.ts.map +0 -1
  277. package/dist/types/src/transcriber/transcriber.test.d.ts +0 -2
  278. package/dist/types/src/transcriber/transcriber.test.d.ts.map +0 -1
  279. package/dist/types/src/transcriber/transcription-manager.d.ts.map +0 -1
  280. package/dist/types/src/util/array.d.ts +0 -2
  281. package/dist/types/src/util/array.d.ts.map +0 -1
  282. package/dist/types/src/util/monitor-audio-level.d.ts +0 -6
  283. package/dist/types/src/util/monitor-audio-level.d.ts.map +0 -1
  284. package/dist/types/src/util/render-byline.d.ts +0 -4
  285. package/dist/types/src/util/render-byline.d.ts.map +0 -1
  286. package/src/blueprints/index.ts +0 -5
  287. package/src/blueprints/transcription-blueprint.ts +0 -29
  288. package/src/capabilities/blueprint-definition.ts +0 -19
  289. package/src/components/Oracle/Oracle.stories.tsx +0 -147
  290. package/src/components/Oracle/Oracle.tsx +0 -142
  291. package/src/components/Oracle/index.ts +0 -5
  292. package/src/components/Transcription/Transcription.stories.tsx +0 -213
  293. package/src/components/Transcription/Transcription.tsx +0 -55
  294. package/src/components/Transcription/index.ts +0 -5
  295. package/src/components/Transcription/transcription-extension.ts +0 -203
  296. package/src/enrichment/conversation.test.ts +0 -162
  297. package/src/enrichment/conversation.txt +0 -23
  298. package/src/enrichment/operations.ts +0 -271
  299. package/src/enrichment/parser.ts +0 -101
  300. package/src/enrichment/stream-simulator.ts +0 -125
  301. package/src/hooks/useAudioFile.ts +0 -88
  302. package/src/hooks/useAudioTrack.ts +0 -35
  303. package/src/hooks/useFeedModelAdapter.ts +0 -46
  304. package/src/hooks/useTranscriber.ts +0 -47
  305. package/src/hooks/useVoiceInput.ts +0 -66
  306. package/src/model/index.ts +0 -5
  307. package/src/model/model.test.ts +0 -175
  308. package/src/model/model.ts +0 -229
  309. package/src/stories/FileTranscription.stories.tsx +0 -143
  310. package/src/stories/KeyWordRecognition.stories.tsx +0 -132
  311. package/src/stories/LiveTranscription.stories.tsx +0 -153
  312. package/src/stories/TranscriptionStory.tsx +0 -101
  313. package/src/stories/common.ts +0 -233
  314. package/src/transcriber/audio-recorder.ts +0 -56
  315. package/src/transcriber/index.ts +0 -8
  316. package/src/transcriber/media-stream-recorder.ts +0 -120
  317. package/src/transcriber/transcriber.browser.test.ts +0 -230
  318. package/src/transcriber/transcriber.test.ts +0 -104
  319. package/src/transcriber/transcriber.ts +0 -303
  320. package/src/util/array.ts +0 -14
  321. package/src/util/monitor-audio-level.ts +0 -58
  322. package/src/util/render-byline.ts +0 -33
  323. /package/dist/lib/neutral/{create-RVR7VC33.mjs.map → create-HNHGCKZ4.mjs.map} +0 -0
  324. /package/dist/lib/neutral/{blueprints → skills}/index.mjs.map +0 -0
@@ -1,229 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { Text } from '@codemirror/state';
6
- import { type EditorView } from '@codemirror/view';
7
-
8
- import { Event } from '@dxos/async';
9
- import { invariant } from '@dxos/invariant';
10
- import { log } from '@dxos/log';
11
-
12
- export type Chunk = { id: string };
13
-
14
- /**
15
- * Covert block to a set of markdown lines.
16
- */
17
- export type ChunkRenderer<T extends Chunk> = (chunk: T, index: number, debug?: boolean) => string[];
18
-
19
- /**
20
- * Abstract representation of the document model.
21
- */
22
- export interface ChunkDocument {
23
- lineCount(): number;
24
- replaceLines(from: number, remove: number, insert: string[]): void;
25
- }
26
-
27
- /**
28
- * Codemirror document adapter.
29
- */
30
- export class DocumentAdapter implements ChunkDocument {
31
- constructor(private readonly _view: EditorView) {}
32
-
33
- /** The document must always have at least one line. */
34
- lineCount(): number {
35
- return this._view.state.doc.lines - 1;
36
- }
37
-
38
- replaceLines(from: number, remove: number, insert: string[]): void {
39
- log('replaceLines', { count: this._view.state.doc.lines, from, remove, insert });
40
-
41
- const numLines = this._view.state.doc.lines;
42
- const posFrom = this._view.state.doc.line(from).from;
43
- const posTo = remove === 0 ? posFrom : this._view.state.doc.line(Math.min(numLines, from + remove)).from;
44
-
45
- // Don't remove the last line.
46
- let text = insert.join('\n');
47
- if (posTo === this._view.state.doc.length) {
48
- text += '\n';
49
- }
50
-
51
- this._view.dispatch({
52
- changes: { from: posFrom, to: posTo, insert: text },
53
- });
54
- }
55
- }
56
-
57
- type ChunkChange<T extends Chunk> =
58
- | {
59
- type: 'append';
60
- index: number;
61
- chunk: T;
62
- }
63
- | {
64
- type: 'update';
65
- index: number;
66
- chunk: T;
67
- }
68
- | {
69
- type: 'delete';
70
- index: number;
71
- id: string;
72
- };
73
-
74
- /**
75
- * Each Chunk can be converted into a set of lines.
76
- * Chunks can be added, updated or deleted from the Queue.
77
- * A Document is an immutable projection that represents a flat list of lines corresponding to the Queue.
78
- *
79
- * Ideally we would implement a custom virtual Text model for the View, but this currently isn't possible in Codemirror.
80
- * Instead this model tracks changes and syncs them with the ChunkDocument.
81
- */
82
- export class SerializationModel<T extends Chunk> {
83
- /** Emits when the document is updated. */
84
- public readonly update = new Event<void>();
85
-
86
- /** Ordered set of chunks. */
87
- private readonly _chunks: T[] = [];
88
-
89
- /** Map of chunk IDs to their current line counts. */
90
- private readonly _chunkLineCounts = new Map<string, number>();
91
-
92
- /** Map of line numbers to chunk IDs. */
93
- private readonly _lineToChunk = new Map<number, T>();
94
-
95
- /** Track chunk changes since last sync. */
96
- private readonly _changes: Array<ChunkChange<T>> = [];
97
-
98
- constructor(
99
- private readonly _renderer: ChunkRenderer<T>,
100
- initialChunks: T[] = [],
101
- ) {
102
- initialChunks.forEach((chunk) => {
103
- this.appendChunk(chunk);
104
- });
105
- }
106
-
107
- toJSON(): { chunks: number; changes: number } {
108
- return {
109
- chunks: this._chunks.length,
110
- changes: this._changes.length,
111
- };
112
- }
113
-
114
- get doc() {
115
- return Text.of([...this._chunks.flatMap((chunk, index) => this._renderer(chunk, index)), '']);
116
- }
117
-
118
- get chunks() {
119
- return this._chunks;
120
- }
121
-
122
- /**
123
- * Get the block ID at the given line number.
124
- */
125
- getChunkAtLine(line: number): T | undefined {
126
- return this._lineToChunk.get(line);
127
- }
128
-
129
- reset(): this {
130
- this._chunks.length = 0;
131
- this._chunkLineCounts.clear();
132
- this._lineToChunk.clear();
133
- this.update.emit();
134
- return this;
135
- }
136
-
137
- appendChunk(chunk: T): this {
138
- const index = this._chunks.length;
139
- this._chunks.push(chunk);
140
- this._changes.push({ type: 'append', index, chunk });
141
- this.update.emit();
142
- return this;
143
- }
144
-
145
- updateChunk(chunk: T): this {
146
- const index = this._chunks.findIndex((c) => c.id === chunk.id);
147
- invariant(index !== -1);
148
- this._chunks[index] = chunk;
149
- this._changes.push({ type: 'update', index, chunk });
150
- this.update.emit();
151
- return this;
152
- }
153
-
154
- deleteBlock(id: string): this {
155
- const index = this._chunks.findIndex((c) => c.id === id);
156
- invariant(index !== -1);
157
- this._chunks.splice(index, 1);
158
- this._changes.push({ type: 'delete', index, id });
159
- this.update.emit();
160
- return this;
161
- }
162
-
163
- /**
164
- * Syncs the tracked changes with the ChunkDocument.
165
- */
166
- sync(document: ChunkDocument): this {
167
- log('sync', { changes: this._changes });
168
-
169
- // Process each change in order.
170
- for (const change of this._changes) {
171
- switch (change.type) {
172
- case 'append': {
173
- // For appends, convert block to lines and add at the end.
174
- const lines = this._renderer(change.chunk, change.index);
175
- const lastLine = document.lineCount();
176
- document.replaceLines(lastLine + 1, 0, lines);
177
- break;
178
- }
179
-
180
- case 'update': {
181
- // For updates, find the block's line range and replace with new lines.
182
- let lineStart = 1;
183
- for (let i = 0; i < change.index; i++) {
184
- lineStart += this._chunkLineCounts.get(this._chunks[i].id)!;
185
- }
186
- const previousLineCount = this._chunkLineCounts.get(change.chunk.id)!;
187
- const newLines = this._renderer(change.chunk, change.index);
188
- document.replaceLines(lineStart, previousLineCount, newLines);
189
- break;
190
- }
191
-
192
- case 'delete': {
193
- // For deletes, find the block's line range and remove those lines.
194
- let lineStart = 1;
195
- for (let i = 0; i < change.index; i++) {
196
- lineStart += this._chunkLineCounts.get(this._chunks[i].id)!;
197
- }
198
- const previousLineCount = this._chunkLineCounts.get(change.id)!;
199
- document.replaceLines(lineStart, previousLineCount, []);
200
- break;
201
- }
202
- }
203
- }
204
-
205
- // Clear the line-to-block mapping.
206
- this._lineToChunk.clear();
207
-
208
- // Update all block line counts and line-to-block mapping after processing changes.
209
- let currentLine = 1;
210
- for (const [index, chunk] of this._chunks.entries()) {
211
- const lineCount = this._renderer(chunk, index).length;
212
- this._chunkLineCounts.set(chunk.id, lineCount);
213
- this._lineToChunk.set(currentLine, chunk);
214
- currentLine += lineCount;
215
- }
216
-
217
- // Clean up deleted blocks.
218
- const chunkIds = new Set(this._chunks.map((chunk) => chunk.id));
219
- for (const id of this._chunkLineCounts.keys()) {
220
- if (!chunkIds.has(id)) {
221
- this._chunkLineCounts.delete(id);
222
- }
223
- }
224
-
225
- // Clear changes after sync.
226
- this._changes.length = 0;
227
- return this;
228
- }
229
- }
@@ -1,143 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { type Meta, type StoryObj } from '@storybook/react-vite';
6
- import React, { useCallback, useEffect, useRef, useState } from 'react';
7
-
8
- import { useAudioFile } from '#hooks';
9
-
10
- import { type MediaStreamRecorderProps, type TranscriberProps } from '../transcriber';
11
- import {
12
- useIsSpeaking,
13
- createStoryDecorators,
14
- useStoryAppendSegments,
15
- useStoryMessageModel,
16
- useStoryTranscriber,
17
- } from './common';
18
- import { TranscriptionStory } from './TranscriptionStory';
19
-
20
- const DEFAULT_TRANSCRIBER_CONFIG = {
21
- transcribeAfterChunksAmount: 100,
22
- prefixBufferChunksAmount: 50,
23
- normalizeSentences: true,
24
- };
25
-
26
- const DEFAULT_RECORDER_CONFIG = {
27
- interval: 200,
28
- };
29
-
30
- type DefaultStoryProps = {
31
- detectSpeaking?: boolean;
32
- normalizeSentences?: boolean;
33
- audioUrl: string;
34
- transcriberConfig?: TranscriberProps['config'];
35
- recorderConfig?: MediaStreamRecorderProps['config'];
36
- audioConstraints?: MediaTrackConstraints;
37
- };
38
-
39
- const DefaultStory = ({
40
- detectSpeaking,
41
- audioUrl,
42
- normalizeSentences,
43
- transcriberConfig = DEFAULT_TRANSCRIBER_CONFIG,
44
- recorderConfig = DEFAULT_RECORDER_CONFIG,
45
- audioConstraints,
46
- }: DefaultStoryProps) => {
47
- const [running, setRunning] = useState(false);
48
-
49
- // Optional uploaded file overrides the default URL; revoke the previous URL on change/unmount.
50
- const [uploadedUrl, setUploadedUrl] = useState<string>();
51
- useEffect(() => {
52
- return () => {
53
- if (uploadedUrl) {
54
- URL.revokeObjectURL(uploadedUrl);
55
- }
56
- };
57
- }, [uploadedUrl]);
58
-
59
- const handleUpload = useCallback((file: File) => {
60
- setRunning(false);
61
- setUploadedUrl(URL.createObjectURL(file));
62
- }, []);
63
-
64
- const sourceUrl = uploadedUrl ?? audioUrl;
65
- const { audio, track, stream } = useAudioFile(sourceUrl, audioConstraints);
66
- const isSpeaking = detectSpeaking ? useIsSpeaking(track) : true;
67
-
68
- // Pipe the decoded stream into the <audio> element so the user hears playback.
69
- const ref = useRef<HTMLAudioElement>(null);
70
- useEffect(() => {
71
- if (ref.current && stream) {
72
- ref.current.srcObject = stream;
73
- }
74
- }, [stream]);
75
-
76
- // Mirror the toolbar's running flag to the underlying HTMLAudioElement.
77
- useEffect(() => {
78
- if (!audio) {
79
- return;
80
- }
81
-
82
- if (running) {
83
- void audio.play();
84
- } else {
85
- void audio.pause();
86
- }
87
- }, [audio, running]);
88
-
89
- const { model, appendMessage } = useStoryMessageModel();
90
- const handleSegments = useStoryAppendSegments(appendMessage);
91
-
92
- useStoryTranscriber({
93
- audioStreamTrack: track,
94
- running,
95
- isSpeaking,
96
- transcriberConfig,
97
- recorderConfig,
98
- onSegments: handleSegments,
99
- });
100
-
101
- // TODO(burdon): Sentence normalization moved to require a real space-backed Feed + FeedService runtime.
102
- // Re-enable here once the story has access to one.
103
- void normalizeSentences;
104
-
105
- return (
106
- <TranscriptionStory
107
- audioRef={ref}
108
- disabled={!stream}
109
- model={model}
110
- running={running}
111
- onRunningChange={setRunning}
112
- onUpload={handleUpload}
113
- />
114
- );
115
- };
116
-
117
- const meta = {
118
- title: 'plugins/plugin-transcription/stories/FileTranscription',
119
- render: DefaultStory,
120
- decorators: createStoryDecorators(),
121
- } satisfies Meta<DefaultStoryProps>;
122
-
123
- export default meta;
124
-
125
- type Story = StoryObj<typeof meta>;
126
-
127
- export const Default: Story = {
128
- args: {
129
- detectSpeaking: true,
130
- // https://learnenglish.britishcouncil.org/general-english/audio-zone/living-london
131
- audioUrl: 'https://dxos.network/audio-london.m4a',
132
- // textUrl: 'https://dxos.network/audio-london.txt',
133
- },
134
- };
135
-
136
- // TODO(mykola): Fix sentence normalization.
137
- // export const WithSentenceNormalization: StoryObj<typeof AudioFile> = {
138
- // args: {
139
- // detectSpeaking: true,
140
- // normalizeSentences: true,
141
- // audioUrl: 'https://dxos.network/audio-london.m4a',
142
- // },
143
- // };
@@ -1,132 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { type Meta, type StoryObj } from '@storybook/react-vite';
6
- import React, { useEffect, useMemo, useState } from 'react';
7
-
8
- import { log } from '@dxos/log';
9
- import { Panel, Toolbar } from '@dxos/react-ui';
10
- import { withLayout, withTheme } from '@dxos/react-ui/testing';
11
- import { mx } from '@dxos/ui-theme';
12
-
13
- type Word = {
14
- text: string;
15
- matched: boolean;
16
- };
17
-
18
- type DefaultStoryProps = {
19
- keywords: string[];
20
- };
21
-
22
- const DefaultStory = ({ keywords }: DefaultStoryProps) => {
23
- const [running, setRunning] = useState(false);
24
- const [matchingWords, setMatchingWords] = useState<Word[]>(keywords.map((word) => ({ text: word, matched: false })));
25
-
26
- const recognition = useMemo(() => {
27
- // TODO(mykola): Fix types
28
- const SpeechRecognition = (window as any).SpeechRecognition || (window as any).webkitSpeechRecognition;
29
- const SpeechGrammarList = (window as any).SpeechGrammarList || (window as any).webkitSpeechGrammarList;
30
- if (!SpeechRecognition || !SpeechGrammarList) {
31
- log.error('Speech recognition not supported in this browser');
32
- return;
33
- }
34
-
35
- const recognition = new SpeechRecognition();
36
- recognition.continuous = true;
37
- recognition.interimResults = true;
38
- recognition.lang = 'en-US';
39
- recognition.maxAlternatives = 1;
40
- // Add this line to enable punctuation.
41
- recognition.grammars = new SpeechGrammarList();
42
-
43
- // TODO(mykola): Fix types.
44
- recognition.onresult = (event: any) => {
45
- log.info('recognition result', { event });
46
- const current = event.resultIndex;
47
- const transcript = event.results[current][0].transcript;
48
-
49
- // Remove punctuation and normalize whitespace for comparison.
50
- const normalizeText = (text: string) =>
51
- text
52
- .toLowerCase()
53
- .replace(/[.,!?]/g, '')
54
- .replace(/\s+/g, ' ')
55
- .trim();
56
-
57
- const normalizedTranscript = normalizeText(transcript);
58
-
59
- // Check each keyword and update matching words.
60
- const updatedWords = matchingWords.map((word) => {
61
- const normalizedKeyword = normalizeText(word.text);
62
- const matched = normalizedTranscript.includes(normalizedKeyword);
63
- return { ...word, matched };
64
- });
65
-
66
- setMatchingWords(updatedWords);
67
- };
68
-
69
- // TODO(mykola): Fix types.
70
- recognition.onerror = (event: any) => {
71
- log.error('Speech recognition error:', { error: event.error });
72
- setRunning(false);
73
- };
74
-
75
- return recognition;
76
- }, []);
77
-
78
- useEffect(() => {
79
- if (running) {
80
- recognition?.start();
81
- } else {
82
- recognition?.stop();
83
- }
84
- }, [running, recognition]);
85
-
86
- return (
87
- <Panel.Root>
88
- <Panel.Toolbar asChild>
89
- <Toolbar.Root>
90
- <Toolbar.IconButton
91
- iconOnly
92
- icon={running ? 'ph--pause--regular' : 'ph--play--regular'}
93
- label={running ? 'Pause' : 'Play'}
94
- onClick={() => setRunning((running) => !running)}
95
- />
96
- </Toolbar.Root>
97
- </Panel.Toolbar>
98
-
99
- <Panel.Content>
100
- <div className='p-2 grid grid-cols-[repeat(auto-fill,minmax(6rem,1fr))] gap-2'>
101
- {matchingWords.map((word, index) => (
102
- <span
103
- key={index}
104
- className={mx(
105
- 'grid place-items-center p-2 aspect-square rounded-sm border border-separator',
106
- word.matched && 'border-red-300',
107
- )}
108
- >
109
- {word.text}
110
- </span>
111
- ))}
112
- </div>
113
- </Panel.Content>
114
- </Panel.Root>
115
- );
116
- };
117
-
118
- const meta = {
119
- title: 'plugins/plugin-transcription/stories/KeyWordDetection',
120
- render: DefaultStory,
121
- decorators: [withTheme(), withLayout({ layout: 'column' })],
122
- } satisfies Meta<typeof DefaultStory>;
123
-
124
- export default meta;
125
-
126
- type Story = StoryObj<typeof meta>;
127
-
128
- export const SpeechRecognitionAPI: Story = {
129
- args: {
130
- keywords: ['kai', 'computer', 'hello', 'dxos'],
131
- },
132
- };
@@ -1,153 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { type Meta, type StoryObj } from '@storybook/react-vite';
6
- import React, { useCallback, useMemo, useState } from 'react';
7
-
8
- import {
9
- type ExtractionFunction,
10
- extractionAnthropicFunction,
11
- extractionNerFunction,
12
- getNer,
13
- processTranscriptMessage,
14
- } from '@dxos/assistant/extraction';
15
- import { Filter, type Obj } from '@dxos/echo';
16
- import { invariant } from '@dxos/invariant';
17
- import { useSpaces } from '@dxos/react-client/echo';
18
- import { Message, Organization, Person } from '@dxos/types';
19
-
20
- import { useAudioTrack } from '#hooks';
21
-
22
- import { type MediaStreamRecorderProps, type TranscriberProps } from '../transcriber';
23
- import { useIsSpeaking, createStoryDecorators, useStoryMessageModel, useStoryTranscriber } from './common';
24
- import { TranscriptionStory } from './TranscriptionStory';
25
-
26
- const DEFAULT_TRANSCRIBER_CONFIG = {
27
- transcribeAfterChunksAmount: 50,
28
- prefixBufferChunksAmount: 10,
29
- };
30
-
31
- const DEFAULT_RECORDER_CONFIG = {
32
- interval: 200,
33
- };
34
-
35
- type DefaultStoryProps = {
36
- detectSpeaking?: boolean;
37
- transcriberConfig?: TranscriberProps['config'];
38
- recorderConfig?: MediaStreamRecorderProps['config'];
39
- audioConstraints?: MediaTrackConstraints;
40
- entityExtraction?: 'ner' | 'llm';
41
- };
42
-
43
- const DefaultStory = ({
44
- detectSpeaking,
45
- entityExtraction,
46
- transcriberConfig = DEFAULT_TRANSCRIBER_CONFIG,
47
- recorderConfig = DEFAULT_RECORDER_CONFIG,
48
- audioConstraints,
49
- }: DefaultStoryProps) => {
50
- const [running, setRunning] = useState(false);
51
- const track = useAudioTrack(running, audioConstraints);
52
- const isSpeaking = detectSpeaking ? useIsSpeaking(track) : true;
53
- const { model, appendMessage } = useStoryMessageModel();
54
- const [space] = useSpaces();
55
-
56
- // Resolve the entity-extraction function + nearby objects once per `entityExtraction` toggle.
57
- const { extractionFunction, objects } = useMemo(() => {
58
- if (!space || !entityExtraction) {
59
- return {};
60
- }
61
-
62
- let extractionFunction: ExtractionFunction | undefined;
63
- let objects: Promise<Obj.Unknown[]> | undefined;
64
- if (entityExtraction === 'ner') {
65
- void getNer(); // Init model loading. Takes time.
66
- extractionFunction = extractionNerFunction;
67
- } else if (entityExtraction === 'llm') {
68
- extractionFunction = extractionAnthropicFunction;
69
- objects = space.db.query(Filter.or(Filter.type(Person.Person), Filter.type(Organization.Organization))).run();
70
- }
71
- return { extractionFunction, objects };
72
- }, [entityExtraction, space]);
73
-
74
- // Build a Message from each transcribed batch; optionally enrich via entity extraction.
75
- const handleSegments = useCallback<TranscriberProps['onSegments']>(
76
- async (blocks) => {
77
- const message = Message.make({
78
- sender: { name: 'You' },
79
- created: new Date().toISOString(),
80
- blocks,
81
- });
82
-
83
- if (entityExtraction && space) {
84
- invariant(extractionFunction, 'extractionFunction is required');
85
- const result = await processTranscriptMessage({
86
- function: extractionFunction,
87
- input: { message, objects: await objects },
88
- options: { fallbackToRaw: true, timeout: 30_000 },
89
- });
90
- appendMessage(result.message);
91
- } else {
92
- appendMessage(message);
93
- }
94
- },
95
- [appendMessage, space, entityExtraction, extractionFunction, objects],
96
- );
97
-
98
- useStoryTranscriber({
99
- audioStreamTrack: track,
100
- running,
101
- isSpeaking,
102
- transcriberConfig,
103
- recorderConfig,
104
- onSegments: handleSegments,
105
- });
106
-
107
- return <TranscriptionStory model={model} running={running} onRunningChange={setRunning} />;
108
- };
109
-
110
- const meta = {
111
- title: 'plugins/plugin-transcription/stories/LiveTranscription',
112
- render: DefaultStory,
113
- decorators: createStoryDecorators({ enableVectorIndex: true }),
114
- } satisfies Meta<typeof DefaultStory>;
115
-
116
- export default meta;
117
-
118
- type Story = StoryObj<typeof meta>;
119
-
120
- export const Default: Story = {
121
- args: {
122
- detectSpeaking: false,
123
- audioConstraints: {
124
- echoCancellation: false,
125
- noiseSuppression: false,
126
- autoGainControl: false,
127
- },
128
- },
129
- };
130
-
131
- export const SpeechDetection: Story = {
132
- args: {
133
- detectSpeaking: true,
134
- audioConstraints: {
135
- echoCancellation: true,
136
- noiseSuppression: true,
137
- autoGainControl: true,
138
- },
139
- },
140
- };
141
-
142
- // TODO(mykola): Fix hugging face quota issues.
143
- // export const EntityExtraction: Story = {
144
- // args: {
145
- // detectSpeaking: true,
146
- // entityExtraction: 'ner',
147
- // audioConstraints: {
148
- // echoCancellation: true,
149
- // noiseSuppression: true,
150
- // autoGainControl: true,
151
- // },
152
- // },
153
- // };