@dxos/plugin-transcription 0.8.4-main.c85a9c8dae → 0.8.4-main.dfabb4ec29

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 (303) hide show
  1. package/dist/lib/{browser/TranscriptionContainer-RBFHP2AV.mjs → neutral/TranscriptionContainer-XNGXNGPX.mjs} +10 -16
  2. package/dist/lib/neutral/TranscriptionContainer-XNGXNGPX.mjs.map +7 -0
  3. package/dist/lib/neutral/TranscriptionPlugin.mjs +34 -0
  4. package/dist/lib/neutral/TranscriptionPlugin.mjs.map +7 -0
  5. package/dist/lib/neutral/TranscriptionPlugin.node.mjs +25 -0
  6. package/dist/lib/neutral/TranscriptionPlugin.node.mjs.map +7 -0
  7. package/dist/lib/{browser/blueprint-definition-C6XA2SVZ.mjs → neutral/blueprint-definition-HOXDG5QP.mjs} +4 -7
  8. package/dist/lib/neutral/blueprint-definition-HOXDG5QP.mjs.map +7 -0
  9. package/dist/lib/{browser → neutral}/blueprints/index.mjs +1 -2
  10. package/dist/lib/neutral/capabilities/index.mjs +17 -0
  11. package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
  12. package/dist/lib/{browser/chunk-2B74LZZD.mjs → neutral/chunk-GL4RS533.mjs} +2 -2
  13. package/dist/lib/{browser/chunk-2B74LZZD.mjs.map → neutral/chunk-GL4RS533.mjs.map} +3 -3
  14. package/dist/lib/{browser/chunk-HOOPZ7EM.mjs → neutral/chunk-KAEXRX3Y.mjs} +1 -1
  15. package/dist/lib/{browser/chunk-EV5ZYKET.mjs → neutral/chunk-LS3R7EQI.mjs} +74 -104
  16. package/dist/lib/neutral/chunk-LS3R7EQI.mjs.map +7 -0
  17. package/dist/lib/neutral/chunk-MLRJWAQH.mjs +179 -0
  18. package/dist/lib/neutral/chunk-MLRJWAQH.mjs.map +7 -0
  19. package/dist/lib/neutral/chunk-NNR3EYR2.mjs +124 -0
  20. package/dist/lib/neutral/chunk-NNR3EYR2.mjs.map +7 -0
  21. package/dist/lib/neutral/chunk-NQQK7UZQ.mjs +244 -0
  22. package/dist/lib/neutral/chunk-NQQK7UZQ.mjs.map +7 -0
  23. package/dist/lib/neutral/chunk-WVEZMGBT.mjs +8 -0
  24. package/dist/lib/neutral/chunk-WVEZMGBT.mjs.map +7 -0
  25. package/dist/lib/neutral/chunk-ZR4BH4QQ.mjs +30 -0
  26. package/dist/lib/neutral/chunk-ZR4BH4QQ.mjs.map +7 -0
  27. package/dist/lib/neutral/components/index.mjs +207 -0
  28. package/dist/lib/neutral/components/index.mjs.map +7 -0
  29. package/dist/lib/neutral/containers/index.mjs +9 -0
  30. package/dist/lib/neutral/containers/index.mjs.map +7 -0
  31. package/dist/lib/neutral/create-2D6S4IMQ.mjs +21 -0
  32. package/dist/lib/neutral/create-2D6S4IMQ.mjs.map +7 -0
  33. package/dist/lib/neutral/hooks/index.mjs +17 -0
  34. package/dist/lib/neutral/index.mjs +44 -0
  35. package/dist/lib/neutral/meta.json +1 -0
  36. package/dist/lib/neutral/meta.mjs +8 -0
  37. package/dist/lib/neutral/open-2QB6IIET.mjs +27 -0
  38. package/dist/lib/neutral/open-2QB6IIET.mjs.map +7 -0
  39. package/dist/lib/neutral/operation-handler-NXMOAXFP.mjs +13 -0
  40. package/dist/lib/neutral/operation-handler-NXMOAXFP.mjs.map +7 -0
  41. package/dist/lib/neutral/operations/index.mjs +8 -0
  42. package/dist/lib/neutral/plugin.mjs +16 -0
  43. package/dist/lib/neutral/plugin.mjs.map +7 -0
  44. package/dist/lib/neutral/react-surface-QF4MUMWG.mjs +26 -0
  45. package/dist/lib/neutral/react-surface-QF4MUMWG.mjs.map +7 -0
  46. package/dist/lib/neutral/summarize-CJPVKWYZ.mjs +78 -0
  47. package/dist/lib/neutral/summarize-CJPVKWYZ.mjs.map +7 -0
  48. package/dist/lib/neutral/text-content-LHSUG2D2.mjs +30 -0
  49. package/dist/lib/neutral/text-content-LHSUG2D2.mjs.map +7 -0
  50. package/dist/lib/{browser/transcriber-WCPHHJYY.mjs → neutral/transcriber-M3R6HPTZ.mjs} +8 -10
  51. package/dist/lib/neutral/transcriber-M3R6HPTZ.mjs.map +7 -0
  52. package/dist/lib/neutral/translations.mjs +22 -0
  53. package/dist/lib/neutral/translations.mjs.map +7 -0
  54. package/dist/lib/neutral/types/index.mjs +12 -0
  55. package/dist/lib/neutral/types/index.mjs.map +7 -0
  56. package/dist/types/src/TranscriptionPlugin.d.ts +1 -0
  57. package/dist/types/src/TranscriptionPlugin.d.ts.map +1 -1
  58. package/dist/types/src/TranscriptionPlugin.node.d.ts +4 -0
  59. package/dist/types/src/TranscriptionPlugin.node.d.ts.map +1 -0
  60. package/dist/types/src/TranscriptionPlugin.test.d.ts +2 -0
  61. package/dist/types/src/TranscriptionPlugin.test.d.ts.map +1 -0
  62. package/dist/types/src/blueprints/transcription-blueprint.d.ts +2 -2
  63. package/dist/types/src/blueprints/transcription-blueprint.d.ts.map +1 -1
  64. package/dist/types/src/capabilities/blueprint-definition.d.ts +6 -0
  65. package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
  66. package/dist/types/src/capabilities/index.d.ts +10 -4
  67. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  68. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  69. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  70. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
  71. package/dist/types/src/capabilities/text-content.d.ts +8 -0
  72. package/dist/types/src/capabilities/text-content.d.ts.map +1 -0
  73. package/dist/types/src/capabilities/{transcriber/transcriber.d.ts → transcriber.d.ts} +1 -1
  74. package/dist/types/src/capabilities/transcriber.d.ts.map +1 -0
  75. package/dist/types/src/components/Transcription/Transcription.d.ts +5 -4
  76. package/dist/types/src/components/Transcription/Transcription.d.ts.map +1 -1
  77. package/dist/types/src/components/Transcription/Transcription.stories.d.ts +10 -10
  78. package/dist/types/src/components/Transcription/Transcription.stories.d.ts.map +1 -1
  79. package/dist/types/src/components/Transcription/transcription-extension.d.ts.map +1 -1
  80. package/dist/types/src/containers/TranscriptionContainer/TranscriptionContainer.d.ts +3 -3
  81. package/dist/types/src/containers/TranscriptionContainer/TranscriptionContainer.d.ts.map +1 -1
  82. package/dist/types/src/containers/TranscriptionContainer/index.d.ts +1 -2
  83. package/dist/types/src/containers/TranscriptionContainer/index.d.ts.map +1 -1
  84. package/dist/types/src/hooks/useAudioFile.d.ts.map +1 -1
  85. package/dist/types/src/hooks/useAudioTrack.d.ts.map +1 -1
  86. package/dist/types/src/hooks/useQueueModelAdapter.d.ts.map +1 -1
  87. package/dist/types/src/hooks/useTranscriber.d.ts +2 -2
  88. package/dist/types/src/hooks/useTranscriber.d.ts.map +1 -1
  89. package/dist/types/src/hooks/useVoiceInput.d.ts.map +1 -1
  90. package/dist/types/src/index.d.ts +2 -3
  91. package/dist/types/src/index.d.ts.map +1 -1
  92. package/dist/types/src/model/model.d.ts +2 -2
  93. package/dist/types/src/model/model.d.ts.map +1 -1
  94. package/dist/types/src/{segments-normalization → normalization}/index.d.ts +1 -1
  95. package/dist/types/src/normalization/index.d.ts.map +1 -0
  96. package/dist/types/src/normalization/message-normalizer.d.ts.map +1 -0
  97. package/dist/types/src/{segments-normalization → normalization}/normalization.d.ts +330 -321
  98. package/dist/types/src/normalization/normalization.d.ts.map +1 -0
  99. package/dist/types/src/normalization/normalization.test.d.ts.map +1 -0
  100. package/dist/types/src/normalization/utils.d.ts.map +1 -0
  101. package/dist/types/src/operations/create.d.ts +5 -0
  102. package/dist/types/src/operations/create.d.ts.map +1 -0
  103. package/dist/types/src/operations/index.d.ts +3 -0
  104. package/dist/types/src/operations/index.d.ts.map +1 -0
  105. package/dist/types/src/operations/open.d.ts +5 -0
  106. package/dist/types/src/operations/open.d.ts.map +1 -0
  107. package/dist/types/src/operations/summarize.d.ts +8 -0
  108. package/dist/types/src/operations/summarize.d.ts.map +1 -0
  109. package/dist/types/src/plugin.d.ts +4 -0
  110. package/dist/types/src/plugin.d.ts.map +1 -0
  111. package/dist/types/src/{components/stories → stories}/FileTranscription.stories.d.ts +3 -3
  112. package/dist/types/src/stories/FileTranscription.stories.d.ts.map +1 -0
  113. package/dist/types/src/{components/stories → stories}/KeyWordRecognition.stories.d.ts +2 -2
  114. package/dist/types/src/stories/KeyWordRecognition.stories.d.ts.map +1 -0
  115. package/dist/types/src/{components/stories → stories}/MicrophoneTranscription.stories.d.ts +3 -3
  116. package/dist/types/src/stories/MicrophoneTranscription.stories.d.ts.map +1 -0
  117. package/dist/types/src/stories/TranscriptionStory.d.ts +23 -0
  118. package/dist/types/src/stories/TranscriptionStory.d.ts.map +1 -0
  119. package/dist/types/src/stories/useIsSpeaking.d.ts.map +1 -0
  120. package/dist/types/src/testing/testing.d.ts.map +1 -1
  121. package/dist/types/src/transcriber/index.d.ts +1 -1
  122. package/dist/types/src/transcriber/index.d.ts.map +1 -1
  123. package/dist/types/src/transcriber/media-stream-recorder.d.ts.map +1 -1
  124. package/dist/types/src/transcriber/transcriber.d.ts +57 -2
  125. package/dist/types/src/transcriber/transcriber.d.ts.map +1 -1
  126. package/dist/types/src/transcriber/transcriber.test.d.ts +2 -0
  127. package/dist/types/src/transcriber/transcriber.test.d.ts.map +1 -0
  128. package/dist/types/src/transcriber/transcription-manager.d.ts.map +1 -1
  129. package/dist/types/src/translations.d.ts +7 -8
  130. package/dist/types/src/translations.d.ts.map +1 -1
  131. package/dist/types/src/types/TranscriptOperation.d.ts +917 -0
  132. package/dist/types/src/types/TranscriptOperation.d.ts.map +1 -0
  133. package/dist/types/src/types/TranscriptionCapabilities.d.ts +17 -0
  134. package/dist/types/src/types/TranscriptionCapabilities.d.ts.map +1 -0
  135. package/dist/types/src/types/{types.d.ts → defs.d.ts} +1 -1
  136. package/dist/types/src/types/defs.d.ts.map +1 -0
  137. package/dist/types/src/types/index.d.ts +3 -4
  138. package/dist/types/src/types/index.d.ts.map +1 -1
  139. package/dist/types/src/util/array.d.ts.map +1 -1
  140. package/dist/types/src/util/get-time-str.d.ts.map +1 -1
  141. package/dist/types/src/util/monitor-audio-level.d.ts.map +1 -1
  142. package/dist/types/src/util/render-byline.d.ts.map +1 -1
  143. package/dist/types/tsconfig.tsbuildinfo +1 -1
  144. package/package.json +133 -81
  145. package/src/TranscriptionPlugin.node.ts +20 -0
  146. package/src/TranscriptionPlugin.test.ts +31 -0
  147. package/src/TranscriptionPlugin.tsx +8 -29
  148. package/src/blueprints/transcription-blueprint.ts +5 -9
  149. package/src/capabilities/{blueprint-definition/blueprint-definition.ts → blueprint-definition.ts} +3 -1
  150. package/src/capabilities/index.ts +12 -4
  151. package/src/capabilities/operation-handler.ts +16 -0
  152. package/src/capabilities/react-surface.tsx +31 -0
  153. package/src/capabilities/text-content.ts +33 -0
  154. package/src/capabilities/{transcriber/transcriber.ts → transcriber.ts} +5 -2
  155. package/src/components/Transcription/Transcription.stories.tsx +24 -23
  156. package/src/components/Transcription/Transcription.tsx +30 -29
  157. package/src/containers/TranscriptionContainer/TranscriptionContainer.tsx +10 -8
  158. package/src/containers/TranscriptionContainer/index.ts +1 -3
  159. package/src/hooks/useTranscriber.ts +5 -2
  160. package/src/hooks/useVoiceInput.ts +0 -1
  161. package/src/index.ts +4 -5
  162. package/src/meta.ts +1 -1
  163. package/src/model/model.test.ts +6 -6
  164. package/src/model/model.ts +3 -3
  165. package/src/{segments-normalization → normalization}/message-normalizer.ts +1 -5
  166. package/src/normalization/normalization.ts +76 -0
  167. package/src/operations/create.ts +24 -0
  168. package/src/operations/index.ts +11 -0
  169. package/src/operations/open.ts +28 -0
  170. package/src/operations/summarize.ts +101 -0
  171. package/src/plugin.ts +11 -0
  172. package/src/{components/stories → stories}/FileTranscription.stories.tsx +33 -16
  173. package/src/{components/stories → stories}/KeyWordRecognition.stories.tsx +32 -30
  174. package/src/{components/stories → stories}/MicrophoneTranscription.stories.tsx +18 -36
  175. package/src/stories/TranscriptionStory.tsx +93 -0
  176. package/src/testing/testing.ts +8 -18
  177. package/src/transcriber/index.ts +1 -1
  178. package/src/transcriber/transcriber.browser.test.ts +0 -1
  179. package/src/transcriber/transcriber.test.ts +104 -0
  180. package/src/transcriber/transcriber.ts +94 -53
  181. package/src/translations.ts +7 -7
  182. package/src/types/TranscriptOperation.ts +103 -0
  183. package/src/types/TranscriptionCapabilities.ts +39 -0
  184. package/src/types/index.ts +4 -4
  185. package/dist/lib/browser/TranscriptionContainer-RBFHP2AV.mjs.map +0 -7
  186. package/dist/lib/browser/blueprint-definition-C6XA2SVZ.mjs.map +0 -7
  187. package/dist/lib/browser/chunk-EV5ZYKET.mjs.map +0 -7
  188. package/dist/lib/browser/chunk-GH4IIQ6C.mjs +0 -54
  189. package/dist/lib/browser/chunk-GH4IIQ6C.mjs.map +0 -7
  190. package/dist/lib/browser/chunk-O7ILGNBZ.mjs +0 -148
  191. package/dist/lib/browser/chunk-O7ILGNBZ.mjs.map +0 -7
  192. package/dist/lib/browser/chunk-XLMRCOQN.mjs +0 -668
  193. package/dist/lib/browser/chunk-XLMRCOQN.mjs.map +0 -7
  194. package/dist/lib/browser/index.mjs +0 -114
  195. package/dist/lib/browser/index.mjs.map +0 -7
  196. package/dist/lib/browser/meta.json +0 -1
  197. package/dist/lib/browser/operation-resolver-5BLRH4XE.mjs +0 -23
  198. package/dist/lib/browser/operation-resolver-5BLRH4XE.mjs.map +0 -7
  199. package/dist/lib/browser/react-surface-U2SI74JK.mjs +0 -36
  200. package/dist/lib/browser/react-surface-U2SI74JK.mjs.map +0 -7
  201. package/dist/lib/browser/transcriber-WCPHHJYY.mjs.map +0 -7
  202. package/dist/lib/browser/types/index.mjs +0 -15
  203. package/dist/lib/node-esm/TranscriptionContainer-3OOID5KH.mjs +0 -42
  204. package/dist/lib/node-esm/TranscriptionContainer-3OOID5KH.mjs.map +0 -7
  205. package/dist/lib/node-esm/blueprint-definition-TLXDUXIQ.mjs +0 -19
  206. package/dist/lib/node-esm/blueprint-definition-TLXDUXIQ.mjs.map +0 -7
  207. package/dist/lib/node-esm/blueprints/index.mjs +0 -10
  208. package/dist/lib/node-esm/chunk-6GW5NZYG.mjs +0 -55
  209. package/dist/lib/node-esm/chunk-6GW5NZYG.mjs.map +0 -7
  210. package/dist/lib/node-esm/chunk-7UE7G6DE.mjs +0 -461
  211. package/dist/lib/node-esm/chunk-7UE7G6DE.mjs.map +0 -7
  212. package/dist/lib/node-esm/chunk-DYUGYQCB.mjs +0 -669
  213. package/dist/lib/node-esm/chunk-DYUGYQCB.mjs.map +0 -7
  214. package/dist/lib/node-esm/chunk-F47HK7GT.mjs +0 -24
  215. package/dist/lib/node-esm/chunk-F47HK7GT.mjs.map +0 -7
  216. package/dist/lib/node-esm/chunk-H3MXHMQL.mjs +0 -149
  217. package/dist/lib/node-esm/chunk-H3MXHMQL.mjs.map +0 -7
  218. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
  219. package/dist/lib/node-esm/chunk-NVM2QUMX.mjs +0 -37
  220. package/dist/lib/node-esm/chunk-NVM2QUMX.mjs.map +0 -7
  221. package/dist/lib/node-esm/index.mjs +0 -115
  222. package/dist/lib/node-esm/index.mjs.map +0 -7
  223. package/dist/lib/node-esm/meta.json +0 -1
  224. package/dist/lib/node-esm/operation-resolver-CVZB7BF4.mjs +0 -24
  225. package/dist/lib/node-esm/operation-resolver-CVZB7BF4.mjs.map +0 -7
  226. package/dist/lib/node-esm/react-surface-2ICJPBPX.mjs +0 -37
  227. package/dist/lib/node-esm/react-surface-2ICJPBPX.mjs.map +0 -7
  228. package/dist/lib/node-esm/transcriber-2RIHUEX4.mjs +0 -62
  229. package/dist/lib/node-esm/transcriber-2RIHUEX4.mjs.map +0 -7
  230. package/dist/lib/node-esm/types/index.mjs +0 -16
  231. package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +0 -6
  232. package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +0 -1
  233. package/dist/types/src/capabilities/blueprint-definition/index.d.ts +0 -3
  234. package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +0 -1
  235. package/dist/types/src/capabilities/operation-handler/index.d.ts +0 -3
  236. package/dist/types/src/capabilities/operation-handler/index.d.ts.map +0 -1
  237. package/dist/types/src/capabilities/operation-handler/operation-handler.d.ts +0 -5
  238. package/dist/types/src/capabilities/operation-handler/operation-handler.d.ts.map +0 -1
  239. package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
  240. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
  241. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
  242. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
  243. package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
  244. package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
  245. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
  246. package/dist/types/src/capabilities/transcriber/index.d.ts +0 -3
  247. package/dist/types/src/capabilities/transcriber/index.d.ts.map +0 -1
  248. package/dist/types/src/capabilities/transcriber/transcriber.d.ts.map +0 -1
  249. package/dist/types/src/components/stories/FileTranscription.stories.d.ts.map +0 -1
  250. package/dist/types/src/components/stories/KeyWordRecognition.stories.d.ts.map +0 -1
  251. package/dist/types/src/components/stories/MicrophoneTranscription.stories.d.ts.map +0 -1
  252. package/dist/types/src/components/stories/TranscriptionStory.d.ts +0 -12
  253. package/dist/types/src/components/stories/TranscriptionStory.d.ts.map +0 -1
  254. package/dist/types/src/components/stories/useIsSpeaking.d.ts.map +0 -1
  255. package/dist/types/src/functions/index.d.ts +0 -18
  256. package/dist/types/src/functions/index.d.ts.map +0 -1
  257. package/dist/types/src/functions/open.d.ts +0 -11
  258. package/dist/types/src/functions/open.d.ts.map +0 -1
  259. package/dist/types/src/functions/summarize.d.ts +0 -11
  260. package/dist/types/src/functions/summarize.d.ts.map +0 -1
  261. package/dist/types/src/segments-normalization/index.d.ts.map +0 -1
  262. package/dist/types/src/segments-normalization/message-normalizer.d.ts.map +0 -1
  263. package/dist/types/src/segments-normalization/normalization.d.ts.map +0 -1
  264. package/dist/types/src/segments-normalization/normalization.test.d.ts.map +0 -1
  265. package/dist/types/src/segments-normalization/utils.d.ts.map +0 -1
  266. package/dist/types/src/types/TranscriptAction.d.ts +0 -25
  267. package/dist/types/src/types/TranscriptAction.d.ts.map +0 -1
  268. package/dist/types/src/types/capabilities.d.ts +0 -18
  269. package/dist/types/src/types/capabilities.d.ts.map +0 -1
  270. package/dist/types/src/types/types.d.ts.map +0 -1
  271. package/src/capabilities/blueprint-definition/index.ts +0 -7
  272. package/src/capabilities/operation-handler/index.ts +0 -7
  273. package/src/capabilities/operation-handler/operation-handler.ts +0 -25
  274. package/src/capabilities/operation-resolver/index.ts +0 -7
  275. package/src/capabilities/operation-resolver/operation-resolver.ts +0 -25
  276. package/src/capabilities/react-surface/index.ts +0 -7
  277. package/src/capabilities/react-surface/react-surface.tsx +0 -28
  278. package/src/capabilities/transcriber/index.ts +0 -7
  279. package/src/components/stories/TranscriptionStory.tsx +0 -41
  280. package/src/functions/index.ts +0 -11
  281. package/src/functions/open.ts +0 -37
  282. package/src/functions/summarize.ts +0 -103
  283. package/src/segments-normalization/normalization.ts +0 -115
  284. package/src/types/TranscriptAction.ts +0 -32
  285. package/src/types/capabilities.ts +0 -33
  286. package/dist/lib/{browser → neutral}/blueprints/index.mjs.map +0 -0
  287. package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs +0 -0
  288. package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs.map +0 -0
  289. package/dist/lib/{browser/chunk-HOOPZ7EM.mjs.map → neutral/chunk-KAEXRX3Y.mjs.map} +0 -0
  290. package/dist/lib/{browser/types → neutral/hooks}/index.mjs.map +0 -0
  291. package/dist/lib/{node-esm/blueprints → neutral}/index.mjs.map +0 -0
  292. package/dist/lib/{node-esm/chunk-HSLMI22Q.mjs.map → neutral/meta.mjs.map} +0 -0
  293. package/dist/lib/{node-esm/types → neutral/operations}/index.mjs.map +0 -0
  294. package/dist/types/src/capabilities/{react-surface/react-surface.d.ts → react-surface.d.ts} +0 -0
  295. package/dist/types/src/{segments-normalization → normalization}/message-normalizer.d.ts +0 -0
  296. package/dist/types/src/{segments-normalization → normalization}/normalization.test.d.ts +0 -0
  297. package/dist/types/src/{segments-normalization → normalization}/utils.d.ts +0 -0
  298. package/dist/types/src/{components/stories → stories}/useIsSpeaking.d.ts +0 -0
  299. package/src/{segments-normalization → normalization}/index.ts +1 -1
  300. package/src/{segments-normalization → normalization}/normalization.test.ts +1 -1
  301. /package/src/{segments-normalization → normalization}/utils.ts +0 -0
  302. /package/src/{components/stories → stories}/useIsSpeaking.tsx +0 -0
  303. /package/src/types/{types.ts → defs.ts} +0 -0
@@ -9,31 +9,32 @@ import React, { type FC, useEffect, useMemo, useState } from 'react';
9
9
 
10
10
  import { withPluginManager } from '@dxos/app-framework/testing';
11
11
  import { Key } from '@dxos/echo';
12
- import { ClientPlugin } from '@dxos/plugin-client';
13
- import { PreviewPlugin } from '@dxos/plugin-preview';
12
+ import { ClientPlugin } from '@dxos/plugin-client/plugin';
13
+ import { initializeIdentity } from '@dxos/plugin-client/testing';
14
+ import { PreviewPlugin } from '@dxos/plugin-preview/testing';
14
15
  import { StorybookPlugin, corePlugins } from '@dxos/plugin-testing';
15
- import { faker } from '@dxos/random';
16
- import { useMembers, useSpace } from '@dxos/react-client/echo';
16
+ import { random } from '@dxos/random';
17
+ import { useMembers, useSpaces } from '@dxos/react-client/echo';
17
18
  import { IconButton, Toolbar } from '@dxos/react-ui';
18
- import { withLayout, withTheme } from '@dxos/react-ui/testing';
19
- import { SyntaxHighlighter } from '@dxos/react-ui-syntax-highlighter';
19
+ import { JsonHighlighter } from '@dxos/react-ui-syntax-highlighter';
20
+ import { withLayout } from '@dxos/react-ui/testing';
20
21
  import { TestSchema } from '@dxos/schema/testing';
21
22
  import { type ContentBlock, type Message, Organization, Person } from '@dxos/types';
22
23
 
23
- import { useQueueModelAdapter } from '../../hooks';
24
- import { SerializationModel } from '../../model';
24
+ import { useQueueModelAdapter } from '#hooks';
25
25
  import {
26
26
  MessageBuilder,
27
27
  TestItem,
28
28
  useTestTranscriptionQueue,
29
29
  useTestTranscriptionQueueWithEntityExtraction,
30
- } from '../../testing';
31
- import { translations } from '../../translations';
32
- import { renderByline } from '../../util';
30
+ } from '#testing';
31
+ import { translations } from '#translations';
33
32
 
33
+ import { SerializationModel } from '../../model';
34
+ import { renderByline } from '../../util';
34
35
  import { Transcription, type TranscriptionProps } from './Transcription';
35
36
 
36
- faker.seed(1);
37
+ random.seed(1);
37
38
 
38
39
  /**
39
40
  * Story wrapper with test controls.
@@ -50,9 +51,7 @@ const TranscriptContainer: FC<
50
51
  <Transcription model={model} />
51
52
  <div className='grid grid-cols-[1fr_16rem] overflow-hidden'>
52
53
  <div className='flex items-center'>
53
- <SyntaxHighlighter language='json' className='text-sm'>
54
- {JSON.stringify(model.toJSON())}
55
- </SyntaxHighlighter>
54
+ <JsonHighlighter data={model.toJSON()} indent={0} classNames='text-sm' />
56
55
  </div>
57
56
  <Toolbar.Root classNames='justify-end'>
58
57
  <IconButton
@@ -67,12 +66,15 @@ const TranscriptContainer: FC<
67
66
  );
68
67
  };
69
68
 
70
- type StoryProps = { messages?: Message.Message[] } & Pick<TranscriptionProps, 'ignoreAttention' | 'attendableId'>;
69
+ type DefaultStoryProps = { messages?: Message.Message[] } & Pick<
70
+ TranscriptionProps,
71
+ 'ignoreAttention' | 'attendableId'
72
+ >;
71
73
 
72
74
  /**
73
75
  * Basic story mutates array of messages.
74
76
  */
75
- const BasicStory = ({ messages: initialMessages = [], ...props }: StoryProps) => {
77
+ const BasicStory = ({ messages: initialMessages = [], ...props }: DefaultStoryProps) => {
76
78
  const [reset, setReset] = useState({});
77
79
  const builder = useMemo(() => new MessageBuilder(), []);
78
80
  const model = useMemo(
@@ -134,9 +136,9 @@ const QueueStory = ({
134
136
  queueId,
135
137
  onReset,
136
138
  ...props
137
- }: StoryProps & { queueId: Key.ObjectId; onReset: () => void }) => {
139
+ }: DefaultStoryProps & { queueId: Key.ObjectId; onReset: () => void }) => {
138
140
  const [running, setRunning] = useState(true);
139
- const space = useSpace();
141
+ const [space] = useSpaces();
140
142
  const members = useMembers(space?.id).map((member) => member.identity);
141
143
  const queue = useTestTranscriptionQueue(space, queueId, running, 2_000);
142
144
  const model = useQueueModelAdapter(renderByline(members), queue, initialMessages);
@@ -149,7 +151,7 @@ const QueueStory = ({
149
151
  // TODO(burdon): Reconcile with QueueStory.
150
152
  const EntityExtractionQueueStory = () => {
151
153
  const [running, setRunning] = useState(true);
152
- const space = useSpace();
154
+ const [space] = useSpaces();
153
155
  const members = useMembers(space?.key).map((member) => member.identity);
154
156
  const queue = useTestTranscriptionQueueWithEntityExtraction(space, undefined, running, 2_000);
155
157
  const model = useQueueModelAdapter(renderByline(members), queue, []);
@@ -173,7 +175,6 @@ const QueueStoryWrapper = () => {
173
175
  const meta = {
174
176
  title: 'plugins/plugin-transcription/components/Transcription',
175
177
  decorators: [
176
- withTheme(),
177
178
  withLayout({ layout: 'fullscreen' }),
178
179
  withPluginManager({
179
180
  plugins: [
@@ -183,7 +184,7 @@ const meta = {
183
184
  types: [TestItem, TestSchema.DocumentType, Person.Person, Organization.Organization],
184
185
  onClientInitialized: ({ client }) =>
185
186
  Effect.gen(function* () {
186
- yield* Effect.promise(() => client.halo.createIdentity());
187
+ yield* initializeIdentity(client);
187
188
  }),
188
189
  }),
189
190
 
@@ -199,7 +200,7 @@ const meta = {
199
200
 
200
201
  export default meta;
201
202
 
202
- const DefaultStory = (props: StoryProps) => {
203
+ const DefaultStory = (props: DefaultStoryProps) => {
203
204
  const [messages, setMessages] = useState<Message.Message[]>([]);
204
205
  useEffect(() => {
205
206
  void Promise.all(Array.from({ length: 10 }, () => MessageBuilder.singleton.createMessage())).then(setMessages);
@@ -4,7 +4,7 @@
4
4
 
5
5
  import React from 'react';
6
6
 
7
- import { type ThemedClassName, useThemeContext } from '@dxos/react-ui';
7
+ import { useThemeContext } from '@dxos/react-ui';
8
8
  import { useTextEditor } from '@dxos/react-ui-editor';
9
9
  import { type Message, type Transcript } from '@dxos/types';
10
10
  import {
@@ -13,51 +13,52 @@ import {
13
13
  createMarkdownExtensions,
14
14
  createThemeExtensions,
15
15
  decorateMarkdown,
16
- editorSlots,
16
+ documentSlots,
17
17
  preview,
18
18
  } from '@dxos/ui-editor';
19
- import { mx } from '@dxos/ui-theme';
19
+ import { composable, composableProps } from '@dxos/ui-theme';
20
20
  import { isTruthy } from '@dxos/util';
21
21
 
22
22
  import { type SerializationModel } from '../../model';
23
23
  import { renderByline } from '../../util';
24
-
25
24
  import { transcription } from './transcription-extension';
26
25
 
27
26
  export { renderByline };
28
27
 
29
- export type TranscriptionProps = ThemedClassName<{
28
+ export type TranscriptionProps = {
30
29
  transcript?: Transcript.Transcript;
31
30
  model: SerializationModel<Message.Message>;
32
31
  // TODO(burdon): Are these still in use?
33
32
  attendableId?: string;
34
33
  ignoreAttention?: boolean;
35
- }>;
34
+ };
36
35
 
37
36
  /**
38
37
  * Transcript component implemented using the editor.
39
38
  */
40
- export const Transcription = ({ classNames, transcript: object, model }: TranscriptionProps) => {
41
- const { themeMode } = useThemeContext();
42
- const { parentRef } = useTextEditor(() => {
43
- return {
44
- extensions: [
45
- createBasicExtensions({ readOnly: true, lineWrapping: true, search: true }),
46
- createMarkdownExtensions(),
47
- createThemeExtensions({ themeMode, slots: editorSlots }),
48
- decorateMarkdown(),
49
- preview(),
50
- transcription({ model, started: object?.started ? new Date(object.started) : undefined }),
51
- autoScroll(),
52
- ].filter(isTruthy),
53
- };
54
- }, [model]);
39
+ export const Transcription = composable<HTMLDivElement, TranscriptionProps>(
40
+ ({ transcript: object, model, children, ...props }, forwardedRef) => {
41
+ const { themeMode } = useThemeContext();
42
+ const { parentRef } = useTextEditor(() => {
43
+ return {
44
+ extensions: [
45
+ createBasicExtensions({ readOnly: true, lineWrapping: true, search: true }),
46
+ createMarkdownExtensions(),
47
+ createThemeExtensions({ themeMode, slots: documentSlots }),
48
+ decorateMarkdown(),
49
+ preview(),
50
+ transcription({ model, started: object?.started ? new Date(object.started) : undefined }),
51
+ autoScroll(),
52
+ ].filter(isTruthy),
53
+ };
54
+ }, [model]);
55
55
 
56
- return (
57
- <div
58
- ref={parentRef}
59
- className={mx('dx-container', classNames)}
60
- data-popover-collision-boundary={true /* TODO(thure): Make this a constant and document it. */}
61
- />
62
- );
63
- };
56
+ return (
57
+ <div
58
+ {...composableProps(props, { classNames: 'dx-container' })}
59
+ ref={parentRef}
60
+ data-popover-collision-boundary={true /* TODO(thure): Make this a constant and document it. */}
61
+ />
62
+ );
63
+ },
64
+ );
@@ -4,23 +4,25 @@
4
4
 
5
5
  import React from 'react';
6
6
 
7
- import { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';
8
- import { Obj } from '@dxos/echo';
7
+ import { type AppSurface } from '@dxos/app-toolkit/ui';
8
+ import { Feed, Obj } from '@dxos/echo';
9
9
  import { useMembers, useQueue } from '@dxos/react-client/echo';
10
10
  import { Panel } from '@dxos/react-ui';
11
11
  import { type Message, type Transcript } from '@dxos/types';
12
12
 
13
- import { Transcription } from '../../components';
14
- import { useQueueModelAdapter } from '../../hooks';
13
+ import { Transcription } from '#components';
14
+ import { useQueueModelAdapter } from '#hooks';
15
+
15
16
  import { renderByline } from '../../util';
16
17
 
17
- export type TranscriptionContainerProps = SurfaceComponentProps<Transcript.Transcript>;
18
+ export type TranscriptionContainerProps = AppSurface.ObjectArticleProps<Transcript.Transcript>;
18
19
 
19
- export const TranscriptionContainer = ({ role, subject: transcript }: TranscriptionContainerProps) => {
20
- const attendableId = Obj.getDXN(transcript).toString();
20
+ export const TranscriptionContainer = ({ role, subject: transcript, attendableId }: TranscriptionContainerProps) => {
21
21
  const db = Obj.getDatabase(transcript);
22
22
  const members = useMembers(db?.spaceId).map((member) => member.identity);
23
- const queue = useQueue<Message.Message>(transcript.queue.dxn, { pollInterval: 1_000 });
23
+ const feed = transcript.feed.target;
24
+ const queueDxn = feed ? Feed.getQueueDxn(feed) : undefined;
25
+ const queue = useQueue<Message.Message>(queueDxn, { pollInterval: 1_000 });
24
26
  const model = useQueueModelAdapter(renderByline(members), queue);
25
27
 
26
28
  return (
@@ -2,6 +2,4 @@
2
2
  // Copyright 2024 DXOS.org
3
3
  //
4
4
 
5
- import { TranscriptionContainer } from './TranscriptionContainer';
6
-
7
- export default TranscriptionContainer;
5
+ export { TranscriptionContainer as default } from './TranscriptionContainer';
@@ -6,8 +6,9 @@ import { useEffect, useMemo } from 'react';
6
6
 
7
7
  import { useCapabilities } from '@dxos/app-framework/ui';
8
8
 
9
+ import { TranscriptionCapabilities } from '#types';
10
+
9
11
  import { type Transcriber } from '../transcriber';
10
- import { TranscriptionCapabilities } from '../types';
11
12
 
12
13
  /**
13
14
  * Records audio while user is speaking and transcribes it after user is done speaking.
@@ -17,6 +18,7 @@ export const useTranscriber = ({
17
18
  recorderConfig,
18
19
  transcriberConfig,
19
20
  onSegments,
21
+ transcribe,
20
22
  }: Partial<TranscriptionCapabilities.GetTranscriberProps>) => {
21
23
  const [getTranscriber] = useCapabilities(TranscriptionCapabilities.Transcriber);
22
24
 
@@ -31,8 +33,9 @@ export const useTranscriber = ({
31
33
  recorderConfig,
32
34
  transcriberConfig,
33
35
  onSegments,
36
+ transcribe,
34
37
  });
35
- }, [getTranscriber, audioStreamTrack, recorderConfig, transcriberConfig, onSegments]);
38
+ }, [getTranscriber, audioStreamTrack, recorderConfig, transcriberConfig, onSegments, transcribe]);
36
39
 
37
40
  useEffect(() => {
38
41
  return () => {
@@ -10,7 +10,6 @@ import { log } from '@dxos/log';
10
10
  import { useSoundEffect } from '@dxos/react-ui-sfx';
11
11
 
12
12
  import { type TranscriberProps } from '../transcriber';
13
-
14
13
  import { useAudioTrack } from './useAudioTrack';
15
14
  import { useTranscriber } from './useTranscriber';
16
15
 
package/src/index.ts CHANGED
@@ -2,11 +2,10 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- export { TranscriptionCapabilities } from './types';
6
-
7
- export * from './components';
5
+ // TODO(wittjosiah): Hooks should not be exported from the plugin package at all.
6
+ // Either refactor callers to not need them or factor them out to a shared package.
7
+ export * from './blueprints';
8
8
  export * from './hooks';
9
9
  export * from './meta';
10
10
  export * from './transcriber';
11
-
12
- export * from './TranscriptionPlugin';
11
+ export * from './types';
package/src/meta.ts CHANGED
@@ -6,7 +6,7 @@ import { type Plugin } from '@dxos/app-framework';
6
6
  import { trim } from '@dxos/util';
7
7
 
8
8
  export const meta: Plugin.Meta = {
9
- id: 'dxos.org/plugin/transcription',
9
+ id: 'org.dxos.plugin.transcription',
10
10
  name: 'Transcription',
11
11
  description: trim`
12
12
  Real-time voice-to-text transcription service for capturing spoken content.
@@ -51,8 +51,8 @@ describe('SerializationModel', () => {
51
51
  }
52
52
 
53
53
  // Update message.
54
- Obj.change(message, (m) => {
55
- m.blocks.push({ _tag: 'transcript', started: createDate(), text: 'Hello again!' });
54
+ Obj.update(message, (message) => {
55
+ message.blocks.push({ _tag: 'transcript', started: createDate(), text: 'Hello again!' });
56
56
  });
57
57
  model.updateChunk(message);
58
58
  {
@@ -133,16 +133,16 @@ describe('SerializationModel', () => {
133
133
  expect(view.state.doc.toString()).to.eq('###### Alice\nHello world!\n\n');
134
134
 
135
135
  // Update message (add block).
136
- Obj.change(message, (m) => {
137
- m.blocks.push({ _tag: 'transcript', started: createDate(), text: 'Hello again!' });
136
+ Obj.update(message, (message) => {
137
+ message.blocks.push({ _tag: 'transcript', started: createDate(), text: 'Hello again!' });
138
138
  });
139
139
  model.updateChunk(message);
140
140
  model.sync(adapter);
141
141
  expect(view.state.doc.toString()).to.eq('###### Alice\nHello world!\nHello again!\n\n');
142
142
 
143
143
  // Update message (remove block).
144
- Obj.change(message, (m) => {
145
- m.blocks.splice(0, 1);
144
+ Obj.update(message, (message) => {
145
+ message.blocks.splice(0, 1);
146
146
  });
147
147
  model.updateChunk(message);
148
148
  model.sync(adapter);
@@ -80,6 +80,9 @@ type ChunkChange<T extends Chunk> =
80
80
  * Instead this model tracks changes and syncs them with the ChunkDocument.
81
81
  */
82
82
  export class SerializationModel<T extends Chunk> {
83
+ /** Emits when the document is updated. */
84
+ public readonly update = new Event<void>();
85
+
83
86
  /** Ordered set of chunks. */
84
87
  private readonly _chunks: T[] = [];
85
88
 
@@ -92,9 +95,6 @@ export class SerializationModel<T extends Chunk> {
92
95
  /** Track chunk changes since last sync. */
93
96
  private readonly _changes: Array<ChunkChange<T>> = [];
94
97
 
95
- /** Emits when the document is updated. */
96
- public readonly update = new Event<void>();
97
-
98
98
  constructor(
99
99
  private readonly _renderer: ChunkRenderer<T>,
100
100
  initialChunks: T[] = [],
@@ -2,10 +2,6 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- //
6
- // Copyright 2025 DXOS.org
7
- //
8
-
9
5
  import { DeferredTask, asyncTimeout } from '@dxos/async';
10
6
  import { LifecycleState, Resource } from '@dxos/context';
11
7
  import { type Queue } from '@dxos/echo-db';
@@ -31,9 +27,9 @@ export type QueueCursor = {
31
27
  timestamp: string;
32
28
  };
33
29
 
34
- // TODO(mykola): .
35
30
  export class MessageNormalizer extends Resource {
36
31
  private readonly _functionExecutor: FunctionExecutor;
32
+
37
33
  private _queue: Queue<Message.Message>;
38
34
  private _cursor: QueueCursor;
39
35
  private _messagesToProcess: MessageWithRangeId[] = [];
@@ -0,0 +1,76 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+ import * as Schema from 'effect/Schema';
7
+
8
+ import { Operation } from '@dxos/compute';
9
+ import { log } from '@dxos/log';
10
+ import { trim } from '@dxos/util';
11
+
12
+ import { TranscriptOperation } from '../types';
13
+
14
+ type MessageWithRangeIdType = TranscriptOperation.MessageWithRangeIdType;
15
+ type SentenceNormalizationInputType = TranscriptOperation.SentenceNormalizationInputType;
16
+ const { SentenceNormalization, SentenceNormalizationOutput } = TranscriptOperation;
17
+
18
+ export type MessageWithRangeId = MessageWithRangeIdType;
19
+
20
+ /** @deprecated Use SentenceNormalizationInputType */
21
+ export type NormalizationInput = SentenceNormalizationInputType;
22
+
23
+ /** @deprecated Use SentenceNormalizationOutput */
24
+ export type NormalizationOutput = Schema.Schema.Type<typeof SentenceNormalizationOutput>;
25
+
26
+ /**
27
+ * Sentence normalization for transcription.
28
+ * TODO(dmaretskyi): Reimplement using AiRequest.run or LanguageModel.generateObject - runStructured was removed.
29
+ */
30
+ export const sentenceNormalization = SentenceNormalization.pipe(
31
+ Operation.withHandler(
32
+ Effect.fn(function* ({ messages }) {
33
+ log.info('input', { messages });
34
+ // TODO(dmaretskyi): runStructured was removed from AiRequest. Reimplement using new API.
35
+ return yield* Effect.die(
36
+ new Error(
37
+ 'Sentence normalization needs to be reimplemented - runStructured was removed from AiRequest. Use AiRequest.run or LanguageModel.generateObject.',
38
+ ),
39
+ );
40
+ }),
41
+ ),
42
+ );
43
+
44
+ const _unused = trim`
45
+ You are observing a real-time transcript of a single person speaking.
46
+ The transcription is delivered in chunks of 10 seconds or less. As a result, individual sentences may be split across multiple messages, or multiple sentences may appear within a single message. Additionally, because this is real-time transcription, punctuation and capitalization may be incorrect or missing.
47
+
48
+ # Task Description:
49
+ - Your task is to detect and reconstruct broken or incomplete sentences by merging segments into coherent, grammatically correct sentences where appropriate.
50
+
51
+ # Input Format:
52
+ - The input is an array of messages that contain transcription blocks.
53
+ - Each message is a Message.Message, as described in the output format.
54
+
55
+ # Output Format:
56
+ - You have been provided with the tool that defines the output format; make sure to query it.
57
+ - Do not output anything other than the expected format.
58
+
59
+ # Segment Handling Rules:
60
+ - Sort messages by timestamp.
61
+ - Leave ID of the first message in a sentence.
62
+ - Each divided sentence should be added to the output as a separate message or block within existing messages, preserving the original order.
63
+ - If one message contains multiple sentences, you should not split them.
64
+ - The last sentence may be incomplete; it should still be output as a separate block or message.
65
+ - Keep track of the original timestamps of the messages and blocks and, use the timestamp of the first message/block of a sentence as the 'started' field of the merged message.
66
+ - The 'rangeId' field of the merged message should include 'messageId'-s and 'rangeId'-s of all messages that have been used to construct this message.
67
+
68
+ # Punctuation and Capitalization:
69
+ - Do not rely on the original punctuation and capitalization—they may be incorrect.
70
+ - Use logical reasoning to apply appropriate punctuation (e.g., period, comma, question mark, exclamation mark) and capitalization.
71
+
72
+ # Restrictions:
73
+ - Do not alter the order of the original messages; maintain the natural flow of speech.
74
+ - Do not interpret or infer meaning beyond reconstructing sentences.
75
+ - Do not add or remove any words or phrases.
76
+ `;
@@ -0,0 +1,24 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Operation } from '@dxos/compute';
8
+ import { Feed, Ref } from '@dxos/echo';
9
+ import { Transcript } from '@dxos/types';
10
+
11
+ import { TranscriptOperation } from '../types';
12
+
13
+ const handler: Operation.WithHandler<typeof TranscriptOperation.Create> = TranscriptOperation.Create.pipe(
14
+ Operation.withHandler(
15
+ Effect.fn(function* ({ space }) {
16
+ const feed = space.db.add(Feed.make());
17
+ return {
18
+ object: Transcript.make(Ref.make(feed)),
19
+ };
20
+ }),
21
+ ),
22
+ );
23
+
24
+ export default handler;
@@ -0,0 +1,11 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { OperationHandlerSet } from '@dxos/compute';
6
+
7
+ export const TranscriptionOperationHandlerSet = OperationHandlerSet.lazy(
8
+ () => import('./create'),
9
+ () => import('./open'),
10
+ () => import('./summarize'),
11
+ );
@@ -0,0 +1,28 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Operation } from '@dxos/compute';
8
+ import { Database, Feed, Filter } from '@dxos/echo';
9
+ import { Message } from '@dxos/types';
10
+
11
+ import { TranscriptOperation } from '../types';
12
+ import { renderByline } from '../util';
13
+
14
+ const handler: Operation.WithHandler<typeof TranscriptOperation.Open> = TranscriptOperation.Open.pipe(
15
+ Operation.withHandler(
16
+ Effect.fn(function* ({ transcript }) {
17
+ const transcriptObj = yield* Database.load(transcript);
18
+ const feed = yield* Database.load(transcriptObj.feed);
19
+ const messages = yield* Feed.runQuery(feed, Filter.type(Message.Message));
20
+ const content = messages
21
+ .flatMap((message: Message.Message, index: number) => renderByline([])(message, index))
22
+ .join('\n\n');
23
+ return { content };
24
+ }),
25
+ ),
26
+ );
27
+
28
+ export default handler;
@@ -0,0 +1,101 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Array from 'effect/Array';
6
+ import * as Effect from 'effect/Effect';
7
+ import * as Function from 'effect/Function';
8
+ import * as Layer from 'effect/Layer';
9
+ import * as Option from 'effect/Option';
10
+
11
+ import { AiService, ConsolePrinter, ToolExecutionService, ToolResolverService } from '@dxos/ai';
12
+ import { AiRequest, GenerationObserver } from '@dxos/assistant';
13
+ import { Trace, Operation, OperationRegistry } from '@dxos/compute';
14
+ import { Database } from '@dxos/echo';
15
+ import { trim } from '@dxos/util';
16
+
17
+ import { TranscriptOperation } from '../types';
18
+
19
+ /**
20
+ * Summarize a transcript of a meeting.
21
+ */
22
+ const handler: Operation.WithHandler<typeof TranscriptOperation.Summarize> = TranscriptOperation.Summarize.pipe(
23
+ Operation.withHandler(
24
+ Effect.fnUntraced(
25
+ function* ({ transcript, notes }) {
26
+ const result = yield* new AiRequest({
27
+ observer: GenerationObserver.fromPrinter(new ConsolePrinter({ tag: 'summarize' })),
28
+ }).run({
29
+ prompt: `Transcript: ${transcript}\n\nNotes: ${notes}`,
30
+ history: [],
31
+ system: systemPrompt,
32
+ });
33
+
34
+ const summary = Function.pipe(
35
+ result,
36
+ Array.findLast((msg) => msg.sender.role === 'assistant' && msg.blocks.some((block) => block._tag === 'text')),
37
+ Option.flatMap((msg) =>
38
+ Function.pipe(
39
+ msg.blocks,
40
+ Array.findLast((block) => block._tag === 'text'),
41
+ Option.map((block) => block.text),
42
+ ),
43
+ ),
44
+ Option.getOrThrowWith(() => new Error('No summary found')),
45
+ );
46
+
47
+ return { summary };
48
+ },
49
+ Effect.provide(
50
+ Layer.mergeAll(
51
+ AiService.model('@anthropic/claude-sonnet-4-0'),
52
+ ToolResolverService.layerEmpty,
53
+ ToolExecutionService.layerEmpty,
54
+ Trace.writerLayerNoop,
55
+ Database.notAvailable,
56
+ Layer.succeed(Operation.Service, {
57
+ invoke: () => Effect.die('Not available.'),
58
+ schedule: () => Effect.die('Not available.'),
59
+ invokePromise: async () => ({ error: new Error('Not available.') }),
60
+ } as any),
61
+ Layer.succeed(OperationRegistry.Service, { resolve: () => Effect.succeed(undefined) } as any),
62
+ ),
63
+ ),
64
+ ),
65
+ ),
66
+ );
67
+
68
+ export default handler;
69
+
70
+ const systemPrompt = trim`
71
+ You are a helpful assistant that summarizes transcripts of meetings.
72
+
73
+ # Goal
74
+ Create a markdown summary of the meeting transcript with text notes provided.
75
+ Notes are very important so make sure to include them in the summary if they contain meaningful information.
76
+
77
+ # Formatting
78
+ - Format the summary as a markdown document without extra comments like "Here is the summary of the transcript:".
79
+ - Use markdown formatting for headings and bullet points.
80
+ - Format the summary as a list of key points and takeaways.
81
+ - All names of people should be in bold.
82
+
83
+ # Note Taking
84
+ - Correlate items in the summary with the person of origin to build a coherent narrative.
85
+ - Include short quotes verbatim where appropriate. Especially when concerned with design decisions and problem descriptions.
86
+
87
+ # Tasks
88
+ At the end of the summary include tasks.
89
+ Extract only the tasks that are:
90
+ - Directly actionable.
91
+ - Clearly assigned to a person or team (or can easily be inferred).
92
+ - Strongly implied by the conversation and/or user note (no speculative tasks).
93
+ - Specific enough that someone reading them would know exactly what to do next.
94
+
95
+ Format all tasks as markdown checkboxes using the syntax:
96
+ - [ ] Task description.
97
+
98
+ Additional information can be included (indented).
99
+
100
+ If no actionable tasks are found, omit this tasks section.
101
+ `;
package/src/plugin.ts ADDED
@@ -0,0 +1,11 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { Plugin } from '@dxos/app-framework';
6
+
7
+ import { meta } from './meta';
8
+
9
+ export const TranscriptionPlugin = Plugin.lazy(meta, () => import('#plugin'));
10
+
11
+ export { TranscriptionOperationHandlerSet } from './operations';