@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,101 +0,0 @@
1
- //
2
- // Copyright 2024 DXOS.org
3
- //
4
-
5
- // Parser for the human-authored conversation fixture (see `conversation.txt`).
6
- // Captures both the seed entities (Persons, Organizations, …) and the speaker-tagged
7
- // dialogue used by `stream-simulator.ts` to feed the enrichment pipeline.
8
-
9
- export type ConversationEntity = {
10
- /** Type name as written in the fixture, e.g. `Person`, `Organization`. */
11
- kind: string;
12
- /** Free-form field values; consumers map these to the relevant ECHO schema. */
13
- fields: Record<string, string>;
14
- };
15
-
16
- export type ConversationUtterance = {
17
- /** Speaker label as written in the fixture (e.g. `A`, `B`, `Rich`). */
18
- speaker: string;
19
- /** Raw utterance text. */
20
- text: string;
21
- };
22
-
23
- export type ParsedConversation = {
24
- entities: ConversationEntity[];
25
- utterances: ConversationUtterance[];
26
- /** Distinct speaker labels in first-seen order. */
27
- speakers: string[];
28
- };
29
-
30
- /**
31
- * Parse the on-disk conversation format into structured data.
32
- *
33
- * Tolerates leading whitespace inside blocks and ignores blank / `#` comment lines.
34
- * Throws if the input doesn't contain a `Conversation:` block — `Entities:` is optional.
35
- */
36
- export const parseConversation = (input: string): ParsedConversation => {
37
- const lines = input.split('\n').map((line) => line.replace(/\s+$/, ''));
38
-
39
- const entities: ConversationEntity[] = [];
40
- const utterances: ConversationUtterance[] = [];
41
- const speakerOrder = new Set<string>();
42
-
43
- type Section = 'none' | 'entities' | 'conversation';
44
- let section: Section = 'none';
45
- let currentEntity: ConversationEntity | undefined;
46
-
47
- for (const raw of lines) {
48
- const line = raw.trim();
49
- if (line.length === 0 || line.startsWith('#')) {
50
- continue;
51
- }
52
-
53
- // Section headers (must be left-aligned to switch sections).
54
- if (raw.startsWith('Entities:') || raw.startsWith('Entitites:')) {
55
- // tolerate the typo present in earlier fixtures
56
- section = 'entities';
57
- currentEntity = undefined;
58
- continue;
59
- }
60
- if (raw.startsWith('Conversation:')) {
61
- section = 'conversation';
62
- currentEntity = undefined;
63
- continue;
64
- }
65
-
66
- if (section === 'entities') {
67
- // `<TypeName>:` starts a new entity; nested `<field>: <value>` lines fill it.
68
- const typeMatch = line.match(/^([A-Za-z][A-Za-z0-9_-]*):$/);
69
- if (typeMatch) {
70
- currentEntity = { kind: typeMatch[1], fields: {} };
71
- entities.push(currentEntity);
72
- continue;
73
- }
74
- const fieldMatch = line.match(/^([A-Za-z][A-Za-z0-9_-]*):\s*(.+)$/);
75
- if (fieldMatch && currentEntity) {
76
- currentEntity.fields[fieldMatch[1]] = fieldMatch[2];
77
- continue;
78
- }
79
- // Silently skip unrecognised lines so authors can add free-form annotations.
80
- continue;
81
- }
82
-
83
- if (section === 'conversation') {
84
- const utteranceMatch = line.match(/^([^:]+):\s*(.+)$/);
85
- if (utteranceMatch) {
86
- const speaker = utteranceMatch[1].trim();
87
- const text = utteranceMatch[2].trim();
88
- if (text.length > 0) {
89
- utterances.push({ speaker, text });
90
- speakerOrder.add(speaker);
91
- }
92
- }
93
- }
94
- }
95
-
96
- if (utterances.length === 0) {
97
- throw new Error('parseConversation: no utterances found');
98
- }
99
-
100
- return { entities, utterances, speakers: Array.from(speakerOrder) };
101
- };
@@ -1,125 +0,0 @@
1
- //
2
- // Copyright 2024 DXOS.org
3
- //
4
-
5
- // Turns a parsed conversation into a chronologically-ordered sequence of Whisper-shaped
6
- // transcript batches, one per (speaker, utterance) pair. Each batch carries a virtual
7
- // timestamp (ms since the conversation start) and the speaker label so consumers can fan
8
- // out per-stream — analogous to two microphones being transcribed in parallel.
9
- //
10
- // The simulator does NOT do any wall-clock waiting. Tests drive virtual time via
11
- // `vi.useFakeTimers()` or step through the batches directly; production code wouldn't use
12
- // this module at all.
13
-
14
- import { type ContentBlock } from '@dxos/types';
15
-
16
- import type { ConversationUtterance, ParsedConversation } from './parser';
17
-
18
- export type StreamSimulatorOptions = {
19
- /**
20
- * Average speaking rate, words per second. Used to assign a virtual duration to each
21
- * utterance so consecutive utterances land at realistic offsets.
22
- * @default 2.5 (≈150 wpm — typical conversational pace)
23
- */
24
- wordsPerSecond?: number;
25
-
26
- /**
27
- * Gap between consecutive utterances in seconds. Models a brief pause for turn-taking
28
- * even when speakers don't actually overlap.
29
- * @default 0.5
30
- */
31
- gapSeconds?: number;
32
-
33
- /**
34
- * Whisper batches typically arrive in chunks of N seconds rather than per-utterance.
35
- * When set, utterances shorter than `batchSeconds` are merged into the same batch as
36
- * the following utterance from the same speaker. `0` disables merging — every utterance
37
- * is its own batch.
38
- * @default 0
39
- */
40
- batchSeconds?: number;
41
- };
42
-
43
- export type SimulatedBatch = {
44
- /** Speaker label from the fixture (`A`, `B`, …). Maps to a virtual `identityDid`. */
45
- speaker: string;
46
- /** ms offset from the conversation start when this batch is delivered. */
47
- offsetMs: number;
48
- /** Whisper-shaped transcript blocks (raw text, no enrichment). */
49
- blocks: ContentBlock.Transcript[];
50
- };
51
-
52
- /**
53
- * Build the chronological batch schedule for a parsed conversation. The result is a
54
- * pure data structure — consumers iterate and drive virtual time themselves.
55
- */
56
- export const simulateStream = (
57
- conversation: ParsedConversation,
58
- options: StreamSimulatorOptions = {},
59
- ): SimulatedBatch[] => {
60
- const wordsPerSecond = options.wordsPerSecond ?? 2.5;
61
- const gapSeconds = options.gapSeconds ?? 0.5;
62
- const batchSeconds = options.batchSeconds ?? 0;
63
-
64
- // Guard against divide-by-zero / NaN / negative inputs — `wordsPerSecond` divides into a
65
- // duration below, and the other knobs feed into offsets that must be finite.
66
- if (!Number.isFinite(wordsPerSecond) || wordsPerSecond <= 0) {
67
- throw new Error(`simulateStream: wordsPerSecond must be a finite number > 0 (got ${wordsPerSecond}).`);
68
- }
69
- if (!Number.isFinite(gapSeconds) || gapSeconds < 0) {
70
- throw new Error(`simulateStream: gapSeconds must be a finite number >= 0 (got ${gapSeconds}).`);
71
- }
72
- if (!Number.isFinite(batchSeconds) || batchSeconds < 0) {
73
- throw new Error(`simulateStream: batchSeconds must be a finite number >= 0 (got ${batchSeconds}).`);
74
- }
75
-
76
- const conversationStart = Date.UTC(2024, 0, 1, 12, 0, 0); // deterministic, ignored by callers
77
- let cursorMs = 0;
78
- const batches: SimulatedBatch[] = [];
79
-
80
- // Optionally merge same-speaker consecutive utterances until they reach `batchSeconds`.
81
- const grouped: { speaker: string; utterances: ConversationUtterance[] }[] = [];
82
- if (batchSeconds === 0) {
83
- for (const u of conversation.utterances) {
84
- grouped.push({ speaker: u.speaker, utterances: [u] });
85
- }
86
- } else {
87
- let pending: { speaker: string; utterances: ConversationUtterance[]; words: number } | undefined;
88
- for (const u of conversation.utterances) {
89
- const words = utteranceWordCount(u.text);
90
- if (pending && pending.speaker === u.speaker && pending.words / wordsPerSecond < batchSeconds) {
91
- pending.utterances.push(u);
92
- pending.words += words;
93
- } else {
94
- if (pending) {
95
- grouped.push({ speaker: pending.speaker, utterances: pending.utterances });
96
- }
97
- pending = { speaker: u.speaker, utterances: [u], words };
98
- }
99
- }
100
- if (pending) {
101
- grouped.push({ speaker: pending.speaker, utterances: pending.utterances });
102
- }
103
- }
104
-
105
- for (const group of grouped) {
106
- const startMs = cursorMs;
107
- const blocks: ContentBlock.Transcript[] = [];
108
- let segmentCursorMs = cursorMs;
109
- for (const u of group.utterances) {
110
- const durationMs = Math.max(500, (utteranceWordCount(u.text) / wordsPerSecond) * 1_000);
111
- blocks.push({
112
- _tag: 'transcript',
113
- started: new Date(conversationStart + segmentCursorMs).toISOString(),
114
- text: u.text,
115
- });
116
- segmentCursorMs += durationMs;
117
- }
118
- batches.push({ speaker: group.speaker, offsetMs: startMs, blocks });
119
- cursorMs = segmentCursorMs + gapSeconds * 1_000;
120
- }
121
-
122
- return batches;
123
- };
124
-
125
- const utteranceWordCount = (text: string): number => text.trim().split(/\s+/).filter(Boolean).length;
@@ -1,88 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { useEffect, useState } from 'react';
6
-
7
- import { scheduleTask } from '@dxos/async';
8
- import { Context } from '@dxos/context';
9
- import { log } from '@dxos/log';
10
-
11
- export type UseAudioState = {
12
- audio?: HTMLAudioElement;
13
- stream?: MediaStream;
14
- track?: MediaStreamTrack;
15
- };
16
-
17
- export const useAudioFile = (audioUrl: string, constraints?: MediaTrackConstraints): UseAudioState => {
18
- const [{ audio, stream, track }, setStream] = useState<UseAudioState>({});
19
- useEffect(() => {
20
- const ctx = new Context();
21
-
22
- scheduleTask(ctx, async () => {
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
- });
31
-
32
- const audio = new Audio();
33
- audio.src = objectUrl;
34
-
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 () => {
47
- resolve();
48
- },
49
- { once: true },
50
- );
51
- audio.load();
52
- });
53
-
54
- const audioCtx = new AudioContext();
55
-
56
- // Resume AudioContext if it's suspended.
57
- if (audioCtx.state === 'suspended') {
58
- await audioCtx.resume();
59
- }
60
-
61
- const destination = audioCtx.createMediaStreamDestination();
62
- destination.channelCount = 1;
63
-
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
- }
70
-
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
- }
80
- });
81
-
82
- return () => {
83
- void ctx.dispose();
84
- };
85
- }, [audioUrl]);
86
-
87
- return { audio, stream, track };
88
- };
@@ -1,35 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { useEffect, useState } from 'react';
6
-
7
- /**
8
- *
9
- */
10
- // TODO(burdon): Reconcile with react-ui-experimental and plugin-calls.
11
- export const useAudioTrack = (active?: boolean, constraints?: MediaTrackConstraints): MediaStreamTrack | undefined => {
12
- const [track, setTrack] = useState<MediaStreamTrack>();
13
- useEffect(() => {
14
- if (!active) {
15
- track?.stop();
16
- setTrack(undefined);
17
- return;
18
- }
19
-
20
- const initAudio = async () => {
21
- const audio = new Audio();
22
- audio.srcObject = await navigator.mediaDevices.getUserMedia({ audio: constraints ?? true });
23
- const [track] = audio.srcObject.getAudioTracks();
24
- if (track) {
25
- setTrack(track);
26
- }
27
- };
28
-
29
- if (active) {
30
- void initAudio();
31
- }
32
- }, [active]);
33
-
34
- return track;
35
- };
@@ -1,46 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { useEffect, useMemo } from 'react';
6
-
7
- import type { Obj } from '@dxos/echo';
8
-
9
- import { type ChunkRenderer, SerializationModel } from '../model';
10
-
11
- /**
12
- * Feeds an array of objects (typically from `useQuery(db, Query.from(feed))`) into a
13
- * `SerializationModel`, appending each new tail item as the array grows.
14
- *
15
- * @param renderer - chunk renderer.
16
- * @param objects - current snapshot of feed items.
17
- * @param initialChunks - chunks to seed the model with on first render.
18
- */
19
- export const useFeedModelAdapter = <T extends Obj.Unknown>(
20
- renderer: ChunkRenderer<T>,
21
- objects: readonly T[],
22
- initialChunks: T[] = [],
23
- ): SerializationModel<T> => {
24
- const model = useMemo(() => new SerializationModel<T>(renderer, initialChunks), [renderer]);
25
-
26
- // Seed the model with the current snapshot on first render and whenever the
27
- // identity of `objects` changes (e.g. feed swapped).
28
- useEffect(() => {
29
- for (const chunk of objects) {
30
- model.appendChunk(chunk);
31
- }
32
- }, [model, objects]);
33
-
34
- // Append new tail items as the array grows.
35
- useEffect(() => {
36
- if (model.chunks.length === objects.length) {
37
- return;
38
- }
39
- const chunk = objects.at(-1);
40
- if (chunk) {
41
- model.appendChunk(chunk);
42
- }
43
- }, [model, objects.length]);
44
-
45
- return model;
46
- };
@@ -1,47 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { useEffect, useMemo } from 'react';
6
-
7
- import { useCapabilities } from '@dxos/app-framework/ui';
8
-
9
- import { TranscriptionCapabilities } from '#types';
10
-
11
- import { type Transcriber } from '../transcriber';
12
-
13
- /**
14
- * Records audio while user is speaking and transcribes it after user is done speaking.
15
- */
16
- export const useTranscriber = ({
17
- audioStreamTrack,
18
- recorderConfig,
19
- transcriberConfig,
20
- onSegments,
21
- transcribe,
22
- }: Partial<TranscriptionCapabilities.TranscriberProviderProps>) => {
23
- const [transcriberProvider] = useCapabilities(TranscriptionCapabilities.TranscriberProvider);
24
-
25
- // Initialize audio transcription.
26
- const transcriber = useMemo<Transcriber | undefined>(() => {
27
- if (!transcriberProvider || !audioStreamTrack || !onSegments) {
28
- return undefined;
29
- }
30
-
31
- return transcriberProvider({
32
- audioStreamTrack,
33
- recorderConfig,
34
- transcriberConfig,
35
- onSegments,
36
- transcribe,
37
- });
38
- }, [transcriberProvider, audioStreamTrack, recorderConfig, transcriberConfig, onSegments, transcribe]);
39
-
40
- useEffect(() => {
41
- return () => {
42
- void transcriber?.close();
43
- };
44
- }, [transcriber]);
45
-
46
- return transcriber;
47
- };
@@ -1,66 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { useCallback, useEffect, useState } from 'react';
6
-
7
- import { scheduleMicroTask } from '@dxos/async';
8
- import { Context } from '@dxos/context';
9
- import { log } from '@dxos/log';
10
- import { useSoundEffect } from '@dxos/react-ui-audio';
11
-
12
- import { type TranscriberProps } from '../transcriber';
13
- import { useAudioTrack } from './useAudioTrack';
14
- import { useTranscriber } from './useTranscriber';
15
-
16
- export type UseVoiceInputProps = {
17
- active?: boolean;
18
- onUpdate: (text: string) => void;
19
- };
20
-
21
- /**
22
- * Hook for voice input.
23
- */
24
- export const useVoiceInput = ({ active, onUpdate }: UseVoiceInputProps) => {
25
- const soundStart = useSoundEffect('StartRecording');
26
- const soundStop = useSoundEffect('StopRecording');
27
-
28
- const handleSegments = useCallback<TranscriberProps['onSegments']>(async (segments) => {
29
- const text = segments.map((str) => str.text.trim().replace(/[^\w\s]/g, '')).join(' ');
30
- onUpdate(text);
31
- }, []);
32
-
33
- // Audio/transcription.
34
- const [recording, setRecording] = useState(false);
35
- const track = useAudioTrack(active);
36
- const transcriber = useTranscriber({
37
- audioStreamTrack: track,
38
- onSegments: handleSegments,
39
- });
40
-
41
- // Start/stop transcription.
42
- useEffect(() => {
43
- const ctx = new Context();
44
- scheduleMicroTask(ctx, async () => {
45
- if (active && transcriber) {
46
- await transcriber.open();
47
- log.info('starting...');
48
- setRecording(true);
49
- void soundStart.play();
50
- transcriber.startChunksRecording();
51
- } else if (!active && transcriber?.isOpen) {
52
- transcriber?.stopChunksRecording();
53
- await transcriber?.close();
54
- log.info('stopped');
55
- setRecording(false);
56
- void soundStop.play();
57
- }
58
- });
59
-
60
- return () => {
61
- void ctx.dispose();
62
- };
63
- }, [active, transcriber]);
64
-
65
- return { recording };
66
- };
@@ -1,5 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- export * from './model';
@@ -1,175 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { EditorView } from '@codemirror/view';
6
- import { describe, test } from 'vitest';
7
-
8
- import { Obj } from '@dxos/echo';
9
- import type { EntityId } from '@dxos/keys';
10
- import { Message } from '@dxos/types';
11
-
12
- import { type ChunkRenderer, DocumentAdapter, SerializationModel } from './model';
13
-
14
- const blockToMarkdown: ChunkRenderer<Message.Message> = (
15
- message: Message.Message,
16
- index: number,
17
- debug = true,
18
- ): string[] => {
19
- return [
20
- `###### ${message.sender.name}`,
21
- ...message.blocks.filter((block) => block._tag === 'transcript').map((block) => block.text),
22
- '',
23
- ];
24
- };
25
-
26
- const createDate = () => new Date().toISOString();
27
-
28
- describe('SerializationModel', () => {
29
- test('basic', ({ expect }) => {
30
- const model = new SerializationModel<Message.Message>(blockToMarkdown);
31
- expect(model.chunks.length).to.eq(0);
32
- expect(model.doc.toString()).to.eq('');
33
-
34
- // Create message.
35
- const message = Obj.make(Message.Message, {
36
- created: createDate(),
37
- sender: { name: 'Alice' },
38
- blocks: [
39
- {
40
- _tag: 'transcript',
41
- started: createDate(),
42
- text: 'Hello world!',
43
- },
44
- ],
45
- });
46
- model.appendChunk(message);
47
- {
48
- const text = model.doc.toString();
49
- expect(text).to.eq('###### Alice\nHello world!\n\n');
50
- expect(model.chunks.length).to.eq(1);
51
- }
52
-
53
- // Update message.
54
- Obj.update(message, (message) => {
55
- message.blocks.push({ _tag: 'transcript', started: createDate(), text: 'Hello again!' });
56
- });
57
- model.updateChunk(message);
58
- {
59
- const text = model.doc.toString();
60
- expect(text).to.eq('###### Alice\nHello world!\nHello again!\n\n');
61
- expect(model.chunks.length).to.eq(1);
62
- }
63
- });
64
-
65
- test('sync - append', ({ expect }) => {
66
- const view = new EditorView({ extensions: [], doc: '' });
67
- const model = new SerializationModel<Message.Message>(blockToMarkdown);
68
- const adapter = new DocumentAdapter(view);
69
- expect(adapter.lineCount()).to.eq(0);
70
- expect(view.state.doc.toString()).to.eq('');
71
-
72
- // Append message.
73
- {
74
- const message = Obj.make(Message.Message, {
75
- created: createDate(),
76
- sender: { name: 'Alice' },
77
- blocks: [
78
- {
79
- _tag: 'transcript',
80
- started: createDate(),
81
- text: 'Hello world!',
82
- },
83
- ],
84
- });
85
- model.appendChunk(message);
86
- model.sync(adapter);
87
- expect(view.state.doc.toString()).to.eq('###### Alice\nHello world!\n\n');
88
- }
89
-
90
- // Append message.
91
- {
92
- const message = Obj.make(Message.Message, {
93
- created: createDate(),
94
- sender: { name: 'Bob' },
95
- blocks: [
96
- {
97
- _tag: 'transcript',
98
- started: createDate(),
99
- text: 'Hello world!',
100
- },
101
- ],
102
- });
103
- model.appendChunk(message);
104
- model.sync(adapter);
105
- expect(view.state.doc.toString()).to.eq('###### Alice\nHello world!\n\n###### Bob\nHello world!\n\n');
106
- }
107
- });
108
-
109
- test('sync - append, update, delete', ({ expect }) => {
110
- const view = new EditorView({ extensions: [], doc: '' });
111
- const model = new SerializationModel<Message.Message>(blockToMarkdown);
112
- const adapter = new DocumentAdapter(view);
113
- expect(adapter.lineCount()).to.eq(0);
114
-
115
- let msgId: EntityId;
116
-
117
- // Append message.
118
- {
119
- const message = Obj.make(Message.Message, {
120
- created: createDate(),
121
- sender: { name: 'Alice' },
122
- blocks: [
123
- {
124
- _tag: 'transcript',
125
- started: createDate(),
126
- text: 'Hello world!',
127
- },
128
- ],
129
- });
130
- msgId = message.id;
131
- model.appendChunk(message);
132
- model.sync(adapter);
133
- expect(view.state.doc.toString()).to.eq('###### Alice\nHello world!\n\n');
134
-
135
- // Update message (add block).
136
- Obj.update(message, (message) => {
137
- message.blocks.push({ _tag: 'transcript', started: createDate(), text: 'Hello again!' });
138
- });
139
- model.updateChunk(message);
140
- model.sync(adapter);
141
- expect(view.state.doc.toString()).to.eq('###### Alice\nHello world!\nHello again!\n\n');
142
-
143
- // Update message (remove block).
144
- Obj.update(message, (message) => {
145
- message.blocks.splice(0, 1);
146
- });
147
- model.updateChunk(message);
148
- model.sync(adapter);
149
- expect(view.state.doc.toString()).to.eq('###### Alice\nHello again!\n\n');
150
-
151
- expect(model.getChunkAtLine(1)).to.eq(message);
152
- }
153
-
154
- // Append message.
155
- {
156
- const message = Obj.make(Message.Message, {
157
- created: createDate(),
158
- sender: { name: 'Bob' },
159
- blocks: [{ _tag: 'transcript', started: createDate(), text: 'Hello again!' }],
160
- });
161
- model.appendChunk(message);
162
- model.sync(adapter);
163
- expect(view.state.doc.toString()).to.eq('###### Alice\nHello again!\n\n###### Bob\nHello again!\n\n');
164
-
165
- expect(model.getChunkAtLine(4)).to.eq(message);
166
- }
167
-
168
- // Delete block.
169
- {
170
- model.deleteBlock(msgId);
171
- model.sync(adapter);
172
- expect(view.state.doc.toString()).to.eq('###### Bob\nHello again!\n\n');
173
- }
174
- });
175
- });