@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 +0,0 @@
1
- {"version":3,"file":"transcriber.test.d.ts","sourceRoot":"","sources":["../../../../src/transcriber/transcriber.test.ts"],"names":[],"mappings":""}
@@ -1 +0,0 @@
1
- {"version":3,"file":"transcription-manager.d.ts","sourceRoot":"","sources":["../../../../src/transcriber/transcription-manager.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AAK9D,OAAO,EAA0B,KAAK,KAAK,EAAE,MAAM,mBAAmB,CAAC;AACvE,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,OAAO,EAAE,IAAI,EAAO,MAAM,YAAY,CAAC;AAEvC,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAqB,OAAO,EAAE,MAAM,aAAa,CAAC;AAqBzD,MAAM,MAAM,yBAAyB,GAAG,CAAC,OAAO,EAAE,OAAO,CAAC,OAAO,KAAK,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AAE/F,MAAM,MAAM,2BAA2B,GAAG;IACxC,UAAU,EAAE,cAAc,CAAC;IAC3B,QAAQ,EAAE,QAAQ,CAAC,QAAQ,CAAC;IAE5B;;OAEG;IACH,eAAe,CAAC,EAAE,yBAAyB,CAAC;CAC7C,CAAC;AAEF;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,QAAQ;IAChD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAiB;IAC7C,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAA4B;IAC9D,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAoB;IAC9C,OAAO,CAAC,iBAAiB,CAAC,CAA+B;IACzD,OAAO,CAAC,YAAY,CAAC,CAAqB;IAC1C,OAAO,CAAC,cAAc,CAAC,CAAkC;IACzD,OAAO,CAAC,YAAY,CAAC,CAA0B;IAC/C,OAAO,CAAC,KAAK,CAAC,CAAwB;IACtC,OAAO,CAAC,iBAAiB,CAAC,CAA4C;IACtE,OAAO,CAAC,YAAY,CAAoB;IAExC,YAAY,OAAO,EAAE,2BAA2B,EAK/C;IAED,IAAI,OAAO,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,CAAC,CAEhC;IAED,UAAU,IAAI,OAAO,CAEpB;IAED,OAAO,CAAC,KAAK,EAAE,KAAK,EAAE,IAAI,EAAE,IAAI,CAAC,IAAI,GAAG,IAAI,CAI3C;IAED,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAKhC;IAED,YAAY,CAAC,SAAS,CAAC,EAAE,OAAO,GAAG,IAAI,CAWtC;IAEK,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,OAAO,CAAC,IAAI,CAAC,CAWhD;IAGK,aAAa,CAAC,KAAK,CAAC,EAAE,gBAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CAO3D;IAED,UAAyB,KAAK,IAAI,OAAO,CAAC,IAAI,CAAC,CAE9C;IAED,UAAyB,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC,CAE/C;YAEa,wBAAwB;YA6BxB,gBAAgB;YAIhB,WAAW;CAiB1B"}
@@ -1,2 +0,0 @@
1
- export declare const mergeFloat64Arrays: (arrays: Float64Array[]) => Float64Array<ArrayBuffer>;
2
- //# sourceMappingURL=array.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../../../src/util/array.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,kBAAkB,WAAY,YAAY,EAAE,8BASxD,CAAC"}
@@ -1,6 +0,0 @@
1
- export declare const monitorAudioLevel: ({ mediaStreamTrack, onMeasure, intervalMs, }: {
2
- mediaStreamTrack: MediaStreamTrack;
3
- onMeasure: (value: number) => void;
4
- intervalMs?: number;
5
- }) => () => void;
6
- //# sourceMappingURL=monitor-audio-level.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"monitor-audio-level.d.ts","sourceRoot":"","sources":["../../../../src/util/monitor-audio-level.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,iBAAiB,iDAI3B;IACD,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,eA6CA,CAAC"}
@@ -1,4 +0,0 @@
1
- import { type Identity } from '@dxos/react-client/halo';
2
- import { type Message } from '@dxos/types';
3
- export declare const renderByline: (identities: Identity[]) => (message: Message.Message, index: number, debug?: boolean) => string[];
4
- //# sourceMappingURL=render-byline.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"render-byline.d.ts","sourceRoot":"","sources":["../../../../src/util/render-byline.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,KAAK,OAAO,EAAE,MAAM,aAAa,CAAC;AAG3C,eAAO,MAAM,YAAY,eACV,QAAQ,EAAE,eACb,OAAO,CAAC,OAAO,SAAS,MAAM,sBAAkB,MAAM,EAsB/D,CAAC"}
@@ -1,5 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- export { default as TranscriptionBlueprint } from './transcription-blueprint';
@@ -1,29 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { Blueprint, Template } from '@dxos/compute';
6
- import { trim } from '@dxos/util';
7
-
8
- import { TranscriptOperation } from '#types';
9
-
10
- const BLUEPRINT_KEY = 'org.dxos.blueprint.transcription';
11
-
12
- const make = () =>
13
- Blueprint.make({
14
- key: BLUEPRINT_KEY,
15
- name: 'Transcription',
16
- tools: Blueprint.toolDefinitions({ operations: [TranscriptOperation.Open, TranscriptOperation.Summarize] }),
17
- instructions: Template.make({
18
- source: trim`
19
- You can open and summarize a meeting transcript.
20
- `,
21
- }),
22
- });
23
-
24
- const blueprint: Blueprint.Definition = {
25
- key: BLUEPRINT_KEY,
26
- make,
27
- };
28
-
29
- export default blueprint;
@@ -1,19 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import * as Effect from 'effect/Effect';
6
-
7
- import { Capability } from '@dxos/app-framework';
8
- import { AppCapabilities } from '@dxos/app-toolkit';
9
-
10
- import { TranscriptionBlueprint } from '#blueprints';
11
-
12
- // NOTE: Explicit annotation required: d.ts emit cannot portably name the inferred @dxos/compute types (TS2883).
13
- const blueprintDefinition: () => Effect.Effect<
14
- Capability.Capability<typeof AppCapabilities.BlueprintDefinition>[],
15
- never,
16
- Capability.Service
17
- > = () => Effect.succeed([Capability.contributes(AppCapabilities.BlueprintDefinition, TranscriptionBlueprint)]);
18
-
19
- export default blueprintDefinition;
@@ -1,147 +0,0 @@
1
- //
2
- // Copyright 2024 DXOS.org
3
- //
4
-
5
- import { type Meta, type StoryObj } from '@storybook/react-vite';
6
- import * as Effect from 'effect/Effect';
7
- import React, { useCallback, useEffect, useState } from 'react';
8
-
9
- import { withPluginManager } from '@dxos/app-framework/testing';
10
- import { ClientPlugin, initializeIdentity } from '@dxos/plugin-client/testing';
11
- import { corePlugins } from '@dxos/plugin-testing';
12
- import { IconButton, Panel, Toolbar } from '@dxos/react-ui';
13
- import { withLayout } from '@dxos/react-ui/testing';
14
- import { type ContentBlock, type Message } from '@dxos/types';
15
-
16
- import { useAudioTrack, useTranscriber } from '#hooks';
17
- import { translations } from '#translations';
18
-
19
- import { TranscriptionPlugin } from '../../TranscriptionPlugin';
20
- import { Oracle } from './Oracle';
21
-
22
- type DefaultStoryProps = {
23
- delay?: number;
24
- };
25
-
26
- const DefaultStory = ({ delay }: DefaultStoryProps) => {
27
- const [recording, setRecording] = useState(false);
28
- const [text, setText] = useState('');
29
- const elapsed = useStopwatch(recording);
30
- const track = useAudioTrack(recording);
31
-
32
- // Build the latest transcribed text from incoming blocks.
33
- const handleSegments = useCallback(async (blocks: Message.Message['blocks']) => {
34
- const phrase = blocks
35
- .filter((block): block is ContentBlock.Transcript => block._tag === 'transcript')
36
- .map((block) => block.text.trim())
37
- .filter(Boolean)
38
- .join(' ');
39
-
40
- setText((prev) => (prev ? `${prev} ${phrase}` : phrase));
41
- }, []);
42
-
43
- // Drive the transcriber off the recording flag.
44
- // Default `transcribeAfterChunksAmount` is 50 × 200ms = 10s, so the first phrase only
45
- // surfaces after ~10s. Drop it to 15 chunks (~3s) so the TextBlock starts updating fast.
46
- const transcriber = useTranscriber({
47
- audioStreamTrack: track,
48
- onSegments: handleSegments,
49
- transcriberConfig: { transcribeAfterChunksAmount: 15, prefixBufferChunksAmount: 5 },
50
- });
51
- useEffect(() => {
52
- if (!transcriber) {
53
- return;
54
- }
55
-
56
- let cancelled = false;
57
- void transcriber.open().then(() => {
58
- if (!cancelled && recording) {
59
- transcriber.startChunksRecording();
60
- }
61
- });
62
-
63
- return () => {
64
- cancelled = true;
65
- transcriber.stopChunksRecording();
66
- };
67
- }, [transcriber, recording]);
68
-
69
- return (
70
- <Panel.Root>
71
- <Panel.Toolbar asChild>
72
- <Toolbar.Root>
73
- <IconButton
74
- icon={recording ? 'ph--stop-circle--regular' : 'ph--microphone--regular'}
75
- label={recording ? 'Stop' : 'Record'}
76
- onClick={() => setRecording((value) => !value)}
77
- />
78
- <IconButton disabled={recording} icon='ph--x--regular' label='Clear' onClick={() => setText('')} />
79
- <Toolbar.Separator />
80
- <Toolbar.Text classNames='text-right tabular-nums text-subdued'>{elapsed}s</Toolbar.Text>
81
- </Toolbar.Root>
82
- </Panel.Toolbar>
83
- <Oracle.Root text={text} delay={delay}>
84
- <Panel.Content asChild>
85
- <Oracle.Content>
86
- <Oracle.Canvas />
87
- <Oracle.Text />
88
- </Oracle.Content>
89
- </Panel.Content>
90
- </Oracle.Root>
91
- </Panel.Root>
92
- );
93
- };
94
-
95
- const meta = {
96
- title: 'plugins/plugin-transcription/components/Oracle',
97
- render: DefaultStory,
98
- decorators: [
99
- withLayout({ layout: 'fullscreen' }),
100
- withPluginManager({
101
- plugins: [
102
- ...corePlugins(),
103
- ClientPlugin({
104
- onClientInitialized: ({ client }) =>
105
- Effect.gen(function* () {
106
- yield* initializeIdentity(client);
107
- }),
108
- }),
109
- TranscriptionPlugin(),
110
- ],
111
- }),
112
- ],
113
- parameters: {
114
- layout: 'fullscreen',
115
- translations,
116
- },
117
- } satisfies Meta<typeof DefaultStory>;
118
-
119
- export default meta;
120
-
121
- type Story = StoryObj<typeof meta>;
122
-
123
- export const Default: Story = {
124
- args: {
125
- delay: 12,
126
- },
127
- };
128
-
129
- export const Instant: Story = {
130
- args: {
131
- delay: 0,
132
- },
133
- };
134
-
135
- /** Seconds elapsed while `running`; resets to 0 each time `running` toggles back to true. */
136
- const useStopwatch = (running: boolean): number => {
137
- const [seconds, setSeconds] = useState(0);
138
- useEffect(() => {
139
- if (!running) {
140
- return;
141
- }
142
- setSeconds(0);
143
- const id = setInterval(() => setSeconds((value) => value + 1), 1_000);
144
- return () => clearInterval(id);
145
- }, [running]);
146
- return seconds;
147
- };
@@ -1,142 +0,0 @@
1
- //
2
- // Copyright 2024 DXOS.org
3
- //
4
-
5
- import { Primitive } from '@radix-ui/react-primitive';
6
- import { Slot } from '@radix-ui/react-slot';
7
- import React, { type PropsWithChildren, createContext, useContext, useMemo } from 'react';
8
-
9
- import '@dxos/react-ui-graph/styles/graph.css';
10
- import { type ThemedClassName } from '@dxos/react-ui';
11
- import { composableProps, slottable } from '@dxos/react-ui';
12
- import { TextBlock } from '@dxos/react-ui-components';
13
- import { SVG } from '@dxos/react-ui-graph';
14
- import { mx } from '@dxos/ui-theme';
15
- import { type SlottableProps } from '@dxos/ui-types';
16
-
17
- //
18
- // Context
19
- //
20
-
21
- type OracleContextValue = {
22
- /** Latest utterance / phrase rendered by `Oracle.Text`. */
23
- text: string;
24
- /** Per-character reveal delay in ms for the streaming TextBlock. */
25
- delay: number;
26
- };
27
-
28
- const OracleContext = createContext<OracleContextValue | null>(null);
29
-
30
- const useOracleContext = (consumer: string): OracleContextValue => {
31
- const ctx = useContext(OracleContext);
32
- if (!ctx) {
33
- throw new Error(`<Oracle.${consumer}> must be rendered inside <Oracle.Root>`);
34
- }
35
- return ctx;
36
- };
37
-
38
- //
39
- // Root (headless — provides context only, renders no DOM)
40
- //
41
-
42
- export type OracleRootProps = PropsWithChildren<{
43
- /** Latest utterance / phrase rendered by `Oracle.Text`. */
44
- text?: string;
45
- /** Per-character reveal delay in ms for the streaming TextBlock. @default 12 */
46
- delay?: number;
47
- }>;
48
-
49
- /**
50
- * Oracle surface root. Headless — provides text/delay context to subcomponents and renders
51
- * no DOM of its own. Wrap subcomponents in `<Oracle.Content>` for the standard relative
52
- * stacking layout, or place `<Oracle.Canvas>` / `<Oracle.Text>` inside any positioned
53
- * container of your choice.
54
- */
55
- const Root = ({ children, text = '', delay = 12 }: OracleRootProps) => {
56
- const value = useMemo(() => ({ text, delay }), [text, delay]);
57
- return <OracleContext.Provider value={value}>{children}</OracleContext.Provider>;
58
- };
59
-
60
- //
61
- // Content
62
- //
63
-
64
- export type OracleContentProps = SlottableProps;
65
-
66
- /**
67
- * Positioned container that stacks `Oracle.Canvas` (the SVG graph viewport, absolutely
68
- * positioned to fill) under `Oracle.Text` (the centered overlay). Use this for the standard
69
- * Oracle layout; skip it if you need custom positioning.
70
- *
71
- * Pass `asChild` to merge the positioning + sizing onto a parent slot (e.g. `Panel.Content`).
72
- */
73
- const Content = slottable<HTMLDivElement>(({ children, asChild, ...props }, forwardedRef) => {
74
- const Comp = asChild ? Slot : Primitive.div;
75
- return (
76
- <Comp {...composableProps(props, { classNames: 'relative dx-expander' })} ref={forwardedRef}>
77
- {children}
78
- </Comp>
79
- );
80
- });
81
-
82
- Content.displayName = 'Oracle.Content';
83
-
84
- //
85
- // Canvas
86
- //
87
-
88
- export type OracleCanvasProps = ThemedClassName<PropsWithChildren<{}>>;
89
-
90
- /**
91
- * SVG graph viewport. Renders sensible defaults (markers, grid, pan/zoom, empty graph)
92
- * when no children are supplied; consumers can replace those by passing their own
93
- * SVG.* children (e.g. a populated `<SVG.Graph model={…} />`).
94
- */
95
- const Canvas = ({ classNames, children }: OracleCanvasProps) => (
96
- <SVG.Root centered classNames={mx('absolute inset-0', classNames)}>
97
- {children ?? (
98
- <>
99
- <SVG.Markers />
100
- <SVG.Grid />
101
- <SVG.Zoom extent={[1 / 4, 4]}>
102
- <SVG.Graph />
103
- </SVG.Zoom>
104
- </>
105
- )}
106
- </SVG.Root>
107
- );
108
-
109
- //
110
- // Text
111
- //
112
-
113
- export type OracleTextProps = ThemedClassName<{}>;
114
-
115
- /**
116
- * Centered text overlay. Reads `text` and `delay` from `Oracle.Root` context and renders
117
- * a streaming `TextBlock` floating above the canvas. Pointer-events are disabled so the
118
- * underlying graph remains interactive.
119
- */
120
- const Text = ({ classNames }: OracleTextProps) => {
121
- const { text, delay } = useOracleContext('Text');
122
- return (
123
- <div className='pointer-events-none absolute inset-0 flex items-center justify-center'>
124
- <TextBlock
125
- classNames={mx('max-w-xl px-6 py-4 text-center text-2xl font-medium text-balance text-subdued', classNames)}
126
- text={text}
127
- delay={delay}
128
- />
129
- </div>
130
- );
131
- };
132
-
133
- //
134
- // Namespace
135
- //
136
-
137
- export const Oracle = {
138
- Root,
139
- Content,
140
- Canvas,
141
- Text,
142
- };
@@ -1,5 +0,0 @@
1
- //
2
- // Copyright 2024 DXOS.org
3
- //
4
-
5
- export * from './Oracle';
@@ -1,213 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { type Meta, type StoryObj } from '@storybook/react-vite';
6
- import * as Effect from 'effect/Effect';
7
- import type * as Types from 'effect/Types';
8
- import React, { useCallback, useEffect, useMemo, useState } from 'react';
9
-
10
- import { withPluginManager } from '@dxos/app-framework/testing';
11
- import { Feed, Filter, Obj, Query } from '@dxos/echo';
12
- import { ClientPlugin, initializeIdentity } from '@dxos/plugin-client/testing';
13
- import { PreviewPlugin } from '@dxos/plugin-preview/testing';
14
- import { StorybookPlugin, corePlugins } from '@dxos/plugin-testing';
15
- import { random } from '@dxos/random';
16
- import { useMembers, useQuery, useSpaces } from '@dxos/react-client/echo';
17
- import { IconButton, Panel, Toolbar } from '@dxos/react-ui';
18
- import { JsonHighlighter } from '@dxos/react-ui-syntax-highlighter';
19
- import { withLayout } from '@dxos/react-ui/testing';
20
- import { type ContentBlock, Message, Organization, Person } from '@dxos/types';
21
-
22
- import { useFeedModelAdapter } from '#hooks';
23
- import { MessageBuilder, TestItem, useTestTranscriptionQueue } from '#testing';
24
- import { translations } from '#translations';
25
-
26
- import { SerializationModel } from '../../model';
27
- import { renderByline } from '../../util';
28
- import { Transcription, type TranscriptionProps } from './Transcription';
29
-
30
- random.seed(1);
31
-
32
- type Source = 'local' | 'feed';
33
-
34
- type DefaultStoryProps = {
35
- /** Where transcript messages come from. */
36
- source?: Source;
37
- /** Number of synthetic messages to pre-populate (local source only). */
38
- seed?: number;
39
- };
40
-
41
- const DefaultStory = ({ source = 'local', seed = 0, ...props }: DefaultStoryProps) => {
42
- const [resetKey, setResetKey] = useState(0);
43
- const handleReset = useCallback(() => setResetKey((value) => value + 1), []);
44
- return source === 'feed' ? (
45
- <FeedStory key={resetKey} onReset={handleReset} {...props} />
46
- ) : (
47
- <LocalStory key={resetKey} seed={seed} onReset={handleReset} {...props} />
48
- );
49
- };
50
-
51
- type InnerProps = {
52
- onReset: () => void;
53
- };
54
-
55
- const LocalStory = ({ seed = 0, onReset, ...props }: InnerProps & { seed?: number }) => {
56
- const builder = useMemo(() => new MessageBuilder(), []);
57
- const [initialMessages, setInitialMessages] = useState<Message.Message[]>([]);
58
- const [ready, setReady] = useState(seed === 0);
59
-
60
- useEffect(() => {
61
- // Reset on every seed change so Storybook controls don't leave stale messages from a prior run.
62
- let cancelled = false;
63
- setInitialMessages([]);
64
- setReady(seed === 0);
65
-
66
- if (seed === 0) {
67
- return () => {
68
- cancelled = true;
69
- };
70
- }
71
-
72
- void Promise.all(Array.from({ length: seed }, () => builder.createMessage())).then((messages) => {
73
- if (cancelled) {
74
- return;
75
- }
76
- setInitialMessages(messages);
77
- setReady(true);
78
- });
79
-
80
- return () => {
81
- cancelled = true;
82
- };
83
- }, [seed, builder]);
84
-
85
- const model = useMemo(
86
- () => new SerializationModel<Message.Message>(renderByline([]), initialMessages),
87
- [initialMessages],
88
- );
89
-
90
- const [running, setRunning] = useState(true);
91
- const [currentMessage, setCurrentMessage] = useState<Types.Mutable<Message.Message> | null>(null);
92
-
93
- useEffect(() => {
94
- if (!ready || !running) {
95
- return;
96
- }
97
-
98
- if (!currentMessage) {
99
- void builder.createMessage().then((message) => {
100
- model.appendChunk(message);
101
- setCurrentMessage(message);
102
- });
103
- return;
104
- }
105
-
106
- const id = setInterval(() => {
107
- if (currentMessage.blocks.length >= 3) {
108
- setCurrentMessage(null);
109
- clearInterval(id);
110
- return;
111
- }
112
- Obj.update(currentMessage, (currentMessage) => {
113
- (currentMessage.blocks as ContentBlock.Any[]).push(builder.createBlock());
114
- });
115
- model.updateChunk(currentMessage);
116
- }, 3_000);
117
-
118
- return () => clearInterval(id);
119
- }, [ready, running, currentMessage, model, builder]);
120
-
121
- return <Shell model={model} running={running} onRunningChange={setRunning} onReset={onReset} {...props} />;
122
- };
123
-
124
- const FeedStory = ({ onReset, ...props }: InnerProps) => {
125
- const [running, setRunning] = useState(true);
126
- const [space] = useSpaces();
127
- const members = useMembers(space?.id).map((member) => member.identity);
128
- const feed = useTestTranscriptionQueue(space, running, 2_000);
129
- const messages = useQuery(
130
- space?.db,
131
- feed ? Query.select(Filter.type(Message.Message)).from(feed) : Query.select(Filter.nothing()),
132
- );
133
- const model = useFeedModelAdapter(renderByline(members), messages, []);
134
-
135
- return <Shell model={model} running={running} onRunningChange={setRunning} onReset={onReset} {...props} />;
136
- };
137
-
138
- type ShellProps = TranscriptionProps & {
139
- running: boolean;
140
- onRunningChange: (running: boolean) => void;
141
- onReset: () => void;
142
- };
143
-
144
- const Shell = ({ model, running, onRunningChange, onReset, ...props }: ShellProps) => (
145
- <Panel.Root>
146
- <Panel.Toolbar asChild>
147
- <Toolbar.Root classNames='justify-end'>
148
- <IconButton
149
- icon={running ? 'ph--pause--regular' : 'ph--play--regular'}
150
- label={running ? 'Pause' : 'Start'}
151
- onClick={() => onRunningChange(!running)}
152
- />
153
- <IconButton icon='ph--x--regular' label='Reset' onClick={onReset} />
154
- </Toolbar.Root>
155
- </Panel.Toolbar>
156
- <Panel.Content className='dx-document'>
157
- <Transcription model={model} {...props} />
158
- </Panel.Content>
159
- <Panel.Statusbar className='flex items-center justify-center'>
160
- <JsonHighlighter data={model.toJSON()} indent={0} classNames='text-sm' />
161
- </Panel.Statusbar>
162
- </Panel.Root>
163
- );
164
-
165
- const meta = {
166
- title: 'plugins/plugin-transcription/components/Transcription',
167
- render: DefaultStory,
168
- decorators: [
169
- withLayout({ layout: 'fullscreen' }),
170
- withPluginManager({
171
- plugins: [
172
- ...corePlugins(),
173
- StorybookPlugin({}),
174
- ClientPlugin({
175
- types: [TestItem, Person.Person, Organization.Organization, Feed.Feed, Message.Message],
176
- onClientInitialized: ({ client }) =>
177
- Effect.gen(function* () {
178
- yield* initializeIdentity(client);
179
- }),
180
- }),
181
- PreviewPlugin(),
182
- ],
183
- }),
184
- ],
185
- parameters: {
186
- layout: 'fullscreen',
187
- translations,
188
- },
189
- } satisfies Meta<typeof DefaultStory>;
190
-
191
- export default meta;
192
-
193
- type Story = StoryObj<typeof meta>;
194
-
195
- export const Default: Story = {
196
- args: {
197
- source: 'local',
198
- seed: 10,
199
- },
200
- };
201
-
202
- export const Empty: Story = {
203
- args: {
204
- source: 'local',
205
- seed: 0,
206
- },
207
- };
208
-
209
- export const WithQueue: Story = {
210
- args: {
211
- source: 'feed',
212
- },
213
- };
@@ -1,55 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import React from 'react';
6
-
7
- import { useThemeContext } from '@dxos/react-ui';
8
- import { composable, composableProps } from '@dxos/react-ui';
9
- import { useTextEditor } from '@dxos/react-ui-editor';
10
- import { type Message, type Transcript } from '@dxos/types';
11
- import {
12
- createBasicExtensions,
13
- createMarkdownExtensions,
14
- createThemeExtensions,
15
- decorateMarkdown,
16
- documentSlots,
17
- preview,
18
- scroller,
19
- } from '@dxos/ui-editor';
20
-
21
- import { type SerializationModel } from '../../model';
22
- import { transcription } from './transcription-extension';
23
-
24
- export type TranscriptionProps = {
25
- transcript?: Transcript.Transcript;
26
- model: SerializationModel<Message.Message>;
27
- };
28
-
29
- // TODO(burdon): Remove forwardedRef/use react-ui-editor.
30
- export const Transcription = composable<HTMLDivElement, TranscriptionProps>(
31
- ({ transcript: object, model, children, ...props }, forwardedRef) => {
32
- const { themeMode } = useThemeContext();
33
- const { parentRef } = useTextEditor(() => {
34
- return {
35
- extensions: [
36
- createBasicExtensions({ readOnly: true, lineWrapping: true, search: true }),
37
- createThemeExtensions({ themeMode, slots: documentSlots }),
38
- createMarkdownExtensions(),
39
- decorateMarkdown(),
40
- preview(),
41
- transcription({ model, started: object?.started ? new Date(object.started) : undefined }),
42
- scroller(),
43
- ],
44
- };
45
- }, [model, themeMode]);
46
-
47
- return (
48
- <div
49
- {...composableProps(props, { classNames: 'dx-container' })}
50
- data-popover-collision-boundary={true}
51
- ref={parentRef}
52
- />
53
- );
54
- },
55
- );
@@ -1,5 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- export * from './Transcription';