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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (330) hide show
  1. package/dist/lib/browser/blueprints/index.mjs +31 -0
  2. package/dist/lib/browser/blueprints/index.mjs.map +7 -0
  3. package/dist/lib/browser/chunk-3L623EVL.mjs +17 -0
  4. package/dist/lib/browser/chunk-3L623EVL.mjs.map +7 -0
  5. package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
  6. package/dist/lib/browser/chunk-KAEXRX3Y.mjs +35 -0
  7. package/dist/lib/browser/chunk-KAEXRX3Y.mjs.map +7 -0
  8. package/dist/lib/browser/chunk-L4HW35L6.mjs +111 -0
  9. package/dist/lib/browser/chunk-L4HW35L6.mjs.map +7 -0
  10. package/dist/lib/browser/chunk-MLRJWAQH.mjs +179 -0
  11. package/dist/lib/browser/chunk-MLRJWAQH.mjs.map +7 -0
  12. package/dist/lib/browser/chunk-NQQK7UZQ.mjs +244 -0
  13. package/dist/lib/browser/chunk-NQQK7UZQ.mjs.map +7 -0
  14. package/dist/lib/browser/components/index.mjs +207 -0
  15. package/dist/lib/browser/components/index.mjs.map +7 -0
  16. package/dist/lib/browser/create-ULR5DPJZ.mjs +21 -0
  17. package/dist/lib/browser/create-ULR5DPJZ.mjs.map +7 -0
  18. package/dist/lib/browser/hooks/index.mjs +17 -0
  19. package/dist/lib/browser/index.mjs +442 -94
  20. package/dist/lib/browser/index.mjs.map +4 -4
  21. package/dist/lib/browser/meta.json +1 -1
  22. package/dist/lib/browser/open-SFMPLZVW.mjs +27 -0
  23. package/dist/lib/browser/open-SFMPLZVW.mjs.map +7 -0
  24. package/dist/lib/browser/operations/index.mjs +13 -0
  25. package/dist/lib/browser/operations/index.mjs.map +7 -0
  26. package/dist/lib/browser/summarize-BDFX4APN.mjs +78 -0
  27. package/dist/lib/browser/summarize-BDFX4APN.mjs.map +7 -0
  28. package/dist/lib/browser/types/index.mjs +4 -8
  29. package/dist/lib/node-esm/blueprints/index.mjs +32 -0
  30. package/dist/lib/node-esm/blueprints/index.mjs.map +7 -0
  31. package/dist/lib/node-esm/chunk-7UIZWCD4.mjs +112 -0
  32. package/dist/lib/node-esm/chunk-7UIZWCD4.mjs.map +7 -0
  33. package/dist/lib/node-esm/chunk-C3AE2NYJ.mjs +181 -0
  34. package/dist/lib/node-esm/chunk-C3AE2NYJ.mjs.map +7 -0
  35. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
  36. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
  37. package/dist/lib/node-esm/chunk-KO3IOD2O.mjs +19 -0
  38. package/dist/lib/node-esm/chunk-KO3IOD2O.mjs.map +7 -0
  39. package/dist/lib/node-esm/chunk-MQK4R6GT.mjs +245 -0
  40. package/dist/lib/node-esm/chunk-MQK4R6GT.mjs.map +7 -0
  41. package/dist/lib/node-esm/chunk-O533NBMK.mjs +37 -0
  42. package/dist/lib/node-esm/chunk-O533NBMK.mjs.map +7 -0
  43. package/dist/lib/node-esm/components/index.mjs +208 -0
  44. package/dist/lib/node-esm/components/index.mjs.map +7 -0
  45. package/dist/lib/node-esm/create-A5QHNWRF.mjs +22 -0
  46. package/dist/lib/node-esm/create-A5QHNWRF.mjs.map +7 -0
  47. package/dist/lib/node-esm/hooks/index.mjs +18 -0
  48. package/dist/lib/node-esm/hooks/index.mjs.map +7 -0
  49. package/dist/lib/node-esm/index.mjs +442 -94
  50. package/dist/lib/node-esm/index.mjs.map +4 -4
  51. package/dist/lib/node-esm/meta.json +1 -1
  52. package/dist/lib/node-esm/open-OI24QNTO.mjs +28 -0
  53. package/dist/lib/node-esm/open-OI24QNTO.mjs.map +7 -0
  54. package/dist/lib/node-esm/operations/index.mjs +14 -0
  55. package/dist/lib/node-esm/operations/index.mjs.map +7 -0
  56. package/dist/lib/node-esm/summarize-3UNN24I2.mjs +79 -0
  57. package/dist/lib/node-esm/summarize-3UNN24I2.mjs.map +7 -0
  58. package/dist/lib/node-esm/types/index.mjs +4 -8
  59. package/dist/types/src/TranscriptionPlugin.d.ts +3 -1
  60. package/dist/types/src/TranscriptionPlugin.d.ts.map +1 -1
  61. package/dist/types/src/TranscriptionPlugin.node.d.ts +4 -0
  62. package/dist/types/src/TranscriptionPlugin.node.d.ts.map +1 -0
  63. package/dist/types/src/TranscriptionPlugin.test.d.ts +2 -0
  64. package/dist/types/src/TranscriptionPlugin.test.d.ts.map +1 -0
  65. package/dist/types/src/blueprints/index.d.ts +2 -0
  66. package/dist/types/src/blueprints/index.d.ts.map +1 -0
  67. package/dist/types/src/blueprints/transcription-blueprint.d.ts +4 -0
  68. package/dist/types/src/blueprints/transcription-blueprint.d.ts.map +1 -0
  69. package/dist/types/src/capabilities/blueprint-definition.d.ts +6 -0
  70. package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
  71. package/dist/types/src/capabilities/index.d.ts +10 -4
  72. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  73. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  74. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  75. package/dist/types/src/capabilities/react-surface.d.ts +3 -2
  76. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  77. package/dist/types/src/capabilities/text-content.d.ts +8 -0
  78. package/dist/types/src/capabilities/text-content.d.ts.map +1 -0
  79. package/dist/types/src/capabilities/transcriber.d.ts +4 -3
  80. package/dist/types/src/capabilities/transcriber.d.ts.map +1 -1
  81. package/dist/types/src/components/Transcription/Transcription.d.ts +18 -0
  82. package/dist/types/src/components/Transcription/Transcription.d.ts.map +1 -0
  83. package/dist/types/src/components/Transcription/Transcription.stories.d.ts +40 -0
  84. package/dist/types/src/components/Transcription/Transcription.stories.d.ts.map +1 -0
  85. package/dist/types/src/components/Transcription/index.d.ts +2 -0
  86. package/dist/types/src/components/Transcription/index.d.ts.map +1 -0
  87. package/dist/types/src/components/Transcription/transcription-extension.d.ts +15 -0
  88. package/dist/types/src/components/Transcription/transcription-extension.d.ts.map +1 -0
  89. package/dist/types/src/components/index.d.ts +1 -6
  90. package/dist/types/src/components/index.d.ts.map +1 -1
  91. package/dist/types/src/containers/TranscriptionContainer/TranscriptionContainer.d.ts +6 -0
  92. package/dist/types/src/containers/TranscriptionContainer/TranscriptionContainer.d.ts.map +1 -0
  93. package/dist/types/src/containers/TranscriptionContainer/index.d.ts +2 -0
  94. package/dist/types/src/containers/TranscriptionContainer/index.d.ts.map +1 -0
  95. package/dist/types/src/containers/index.d.ts +3 -0
  96. package/dist/types/src/containers/index.d.ts.map +1 -0
  97. package/dist/types/src/hooks/useAudioFile.d.ts.map +1 -1
  98. package/dist/types/src/hooks/useAudioTrack.d.ts.map +1 -1
  99. package/dist/types/src/hooks/useQueueModelAdapter.d.ts +1 -1
  100. package/dist/types/src/hooks/useQueueModelAdapter.d.ts.map +1 -1
  101. package/dist/types/src/hooks/useTranscriber.d.ts +2 -2
  102. package/dist/types/src/hooks/useTranscriber.d.ts.map +1 -1
  103. package/dist/types/src/hooks/useVoiceInput.d.ts.map +1 -1
  104. package/dist/types/src/index.d.ts +4 -4
  105. package/dist/types/src/index.d.ts.map +1 -1
  106. package/dist/types/src/meta.d.ts +2 -3
  107. package/dist/types/src/meta.d.ts.map +1 -1
  108. package/dist/types/src/model/model.d.ts +2 -2
  109. package/dist/types/src/model/model.d.ts.map +1 -1
  110. package/dist/types/src/{segments-normalization → normalization}/index.d.ts +1 -1
  111. package/dist/types/src/normalization/index.d.ts.map +1 -0
  112. package/dist/types/src/{segments-normalization → normalization}/message-normalizer.d.ts +5 -5
  113. package/dist/types/src/normalization/message-normalizer.d.ts.map +1 -0
  114. package/dist/types/src/normalization/normalization.d.ts +364 -0
  115. package/dist/types/src/normalization/normalization.d.ts.map +1 -0
  116. package/dist/types/src/normalization/normalization.test.d.ts.map +1 -0
  117. package/dist/types/src/normalization/utils.d.ts +3 -0
  118. package/dist/types/src/normalization/utils.d.ts.map +1 -0
  119. package/dist/types/src/operations/create.d.ts +5 -0
  120. package/dist/types/src/operations/create.d.ts.map +1 -0
  121. package/dist/types/src/operations/definitions.d.ts +917 -0
  122. package/dist/types/src/operations/definitions.d.ts.map +1 -0
  123. package/dist/types/src/operations/index.d.ts +4 -0
  124. package/dist/types/src/operations/index.d.ts.map +1 -0
  125. package/dist/types/src/operations/open.d.ts +5 -0
  126. package/dist/types/src/operations/open.d.ts.map +1 -0
  127. package/dist/types/src/operations/summarize.d.ts +8 -0
  128. package/dist/types/src/operations/summarize.d.ts.map +1 -0
  129. package/dist/types/src/stories/FileTranscription.stories.d.ts +18 -0
  130. package/dist/types/src/stories/FileTranscription.stories.d.ts.map +1 -0
  131. package/dist/types/src/stories/KeyWordRecognition.stories.d.ts +14 -0
  132. package/dist/types/src/stories/KeyWordRecognition.stories.d.ts.map +1 -0
  133. package/dist/types/src/stories/MicrophoneTranscription.stories.d.ts +20 -0
  134. package/dist/types/src/stories/MicrophoneTranscription.stories.d.ts.map +1 -0
  135. package/dist/types/src/stories/TranscriptionStory.d.ts +23 -0
  136. package/dist/types/src/stories/TranscriptionStory.d.ts.map +1 -0
  137. package/dist/types/src/stories/useIsSpeaking.d.ts.map +1 -0
  138. package/dist/types/src/testing/testing.d.ts +10 -10
  139. package/dist/types/src/testing/testing.d.ts.map +1 -1
  140. package/dist/types/src/transcriber/media-stream-recorder.d.ts +3 -3
  141. package/dist/types/src/transcriber/media-stream-recorder.d.ts.map +1 -1
  142. package/dist/types/src/transcriber/transcriber.d.ts +60 -5
  143. package/dist/types/src/transcriber/transcriber.d.ts.map +1 -1
  144. package/dist/types/src/transcriber/transcriber.test.d.ts +2 -0
  145. package/dist/types/src/transcriber/transcriber.test.d.ts.map +1 -0
  146. package/dist/types/src/transcriber/transcription-manager.d.ts +12 -13
  147. package/dist/types/src/transcriber/transcription-manager.d.ts.map +1 -1
  148. package/dist/types/src/translations.d.ts +10 -11
  149. package/dist/types/src/translations.d.ts.map +1 -1
  150. package/dist/types/src/types/capabilities.d.ts +19 -0
  151. package/dist/types/src/types/capabilities.d.ts.map +1 -0
  152. package/dist/types/src/types/defs.d.ts +5 -0
  153. package/dist/types/src/types/defs.d.ts.map +1 -0
  154. package/dist/types/src/types/index.d.ts +2 -2
  155. package/dist/types/src/types/index.d.ts.map +1 -1
  156. package/dist/types/src/util/array.d.ts.map +1 -1
  157. package/dist/types/src/util/get-time-str.d.ts.map +1 -1
  158. package/dist/types/src/util/index.d.ts +1 -0
  159. package/dist/types/src/util/index.d.ts.map +1 -1
  160. package/dist/types/src/util/monitor-audio-level.d.ts.map +1 -1
  161. package/dist/types/src/util/render-byline.d.ts +4 -0
  162. package/dist/types/src/util/render-byline.d.ts.map +1 -0
  163. package/dist/types/tsconfig.tsbuildinfo +1 -1
  164. package/package.json +127 -82
  165. package/src/TranscriptionPlugin.node.ts +20 -0
  166. package/src/TranscriptionPlugin.test.ts +31 -0
  167. package/src/TranscriptionPlugin.tsx +22 -61
  168. package/src/blueprints/index.ts +5 -0
  169. package/src/blueprints/transcription-blueprint.ts +29 -0
  170. package/src/capabilities/blueprint-definition.ts +19 -0
  171. package/src/capabilities/index.ts +11 -6
  172. package/src/capabilities/operation-handler.ts +16 -0
  173. package/src/capabilities/react-surface.tsx +23 -14
  174. package/src/capabilities/text-content.ts +33 -0
  175. package/src/capabilities/transcriber.ts +54 -42
  176. package/src/components/{Transcript/Transcript.stories.tsx → Transcription/Transcription.stories.tsx} +78 -73
  177. package/src/components/Transcription/Transcription.tsx +64 -0
  178. package/src/components/{Transcript → Transcription}/index.ts +1 -1
  179. package/src/components/{Transcript/transcript-extension.ts → Transcription/transcription-extension.ts} +15 -48
  180. package/src/components/index.ts +1 -6
  181. package/src/containers/TranscriptionContainer/TranscriptionContainer.tsx +35 -0
  182. package/src/containers/TranscriptionContainer/index.ts +5 -0
  183. package/src/containers/index.ts +7 -0
  184. package/src/hooks/useAudioFile.ts +49 -53
  185. package/src/hooks/useQueueModelAdapter.ts +1 -1
  186. package/src/hooks/useTranscriber.ts +15 -7
  187. package/src/hooks/useVoiceInput.ts +3 -3
  188. package/src/index.ts +10 -5
  189. package/src/meta.ts +9 -6
  190. package/src/model/model.test.ts +27 -21
  191. package/src/model/model.ts +3 -3
  192. package/src/{segments-normalization → normalization}/message-normalizer.ts +20 -19
  193. package/src/{segments-normalization → normalization}/normalization.test.ts +26 -33
  194. package/src/normalization/normalization.ts +77 -0
  195. package/src/{segments-normalization → normalization}/utils.ts +2 -2
  196. package/src/operations/create.ts +24 -0
  197. package/src/operations/definitions.ts +101 -0
  198. package/src/operations/index.ts +13 -0
  199. package/src/operations/open.ts +28 -0
  200. package/src/operations/summarize.ts +101 -0
  201. package/src/{components/stories → stories}/FileTranscription.stories.tsx +99 -72
  202. package/src/{components/stories → stories}/KeyWordRecognition.stories.tsx +46 -40
  203. package/src/{components/stories → stories}/MicrophoneTranscription.stories.tsx +85 -101
  204. package/src/stories/TranscriptionStory.tsx +93 -0
  205. package/src/testing/testing.ts +41 -41
  206. package/src/transcriber/media-stream-recorder.ts +4 -4
  207. package/src/transcriber/transcriber.browser.test.ts +5 -5
  208. package/src/transcriber/transcriber.test.ts +104 -0
  209. package/src/transcriber/transcriber.ts +101 -62
  210. package/src/transcriber/transcription-manager.ts +37 -52
  211. package/src/translations.ts +12 -10
  212. package/src/types/capabilities.ts +39 -0
  213. package/src/types/defs.ts +9 -0
  214. package/src/types/index.ts +2 -2
  215. package/src/util/index.ts +1 -0
  216. package/src/util/render-byline.ts +33 -0
  217. package/dist/lib/browser/TranscriptContainer-H3AZQ4CQ.mjs +0 -11
  218. package/dist/lib/browser/chunk-53AXUEIQ.mjs +0 -764
  219. package/dist/lib/browser/chunk-53AXUEIQ.mjs.map +0 -7
  220. package/dist/lib/browser/chunk-GOF7MJNV.mjs +0 -19
  221. package/dist/lib/browser/chunk-GOF7MJNV.mjs.map +0 -7
  222. package/dist/lib/browser/chunk-IQ5ZRMHZ.mjs +0 -495
  223. package/dist/lib/browser/chunk-IQ5ZRMHZ.mjs.map +0 -7
  224. package/dist/lib/browser/chunk-OSISJM2F.mjs +0 -55
  225. package/dist/lib/browser/chunk-OSISJM2F.mjs.map +0 -7
  226. package/dist/lib/browser/chunk-UDCCT32F.mjs +0 -8
  227. package/dist/lib/browser/chunk-UDCCT32F.mjs.map +0 -7
  228. package/dist/lib/browser/chunk-W2KNYJD6.mjs +0 -16
  229. package/dist/lib/browser/chunk-W2KNYJD6.mjs.map +0 -7
  230. package/dist/lib/browser/intent-resolver-BGADCHVM.mjs +0 -30
  231. package/dist/lib/browser/intent-resolver-BGADCHVM.mjs.map +0 -7
  232. package/dist/lib/browser/react-surface-HMJS5FSS.mjs +0 -34
  233. package/dist/lib/browser/react-surface-HMJS5FSS.mjs.map +0 -7
  234. package/dist/lib/browser/transcriber-OYPLZFG5.mjs +0 -56
  235. package/dist/lib/browser/transcriber-OYPLZFG5.mjs.map +0 -7
  236. package/dist/lib/node/TranscriptContainer-KIG3GMAB.cjs +0 -32
  237. package/dist/lib/node/TranscriptContainer-KIG3GMAB.cjs.map +0 -7
  238. package/dist/lib/node/chunk-3PYT3BDM.cjs +0 -40
  239. package/dist/lib/node/chunk-3PYT3BDM.cjs.map +0 -7
  240. package/dist/lib/node/chunk-6LW5RA3K.cjs +0 -75
  241. package/dist/lib/node/chunk-6LW5RA3K.cjs.map +0 -7
  242. package/dist/lib/node/chunk-AFUZI63A.cjs +0 -42
  243. package/dist/lib/node/chunk-AFUZI63A.cjs.map +0 -7
  244. package/dist/lib/node/chunk-CVUN3UO7.cjs +0 -778
  245. package/dist/lib/node/chunk-CVUN3UO7.cjs.map +0 -7
  246. package/dist/lib/node/chunk-FKDJNJ57.cjs +0 -35
  247. package/dist/lib/node/chunk-FKDJNJ57.cjs.map +0 -7
  248. package/dist/lib/node/chunk-ZFAUMZXE.cjs +0 -518
  249. package/dist/lib/node/chunk-ZFAUMZXE.cjs.map +0 -7
  250. package/dist/lib/node/index.cjs +0 -133
  251. package/dist/lib/node/index.cjs.map +0 -7
  252. package/dist/lib/node/intent-resolver-LL3TTI4H.cjs +0 -45
  253. package/dist/lib/node/intent-resolver-LL3TTI4H.cjs.map +0 -7
  254. package/dist/lib/node/meta.json +0 -1
  255. package/dist/lib/node/react-surface-N25TBBG4.cjs +0 -56
  256. package/dist/lib/node/react-surface-N25TBBG4.cjs.map +0 -7
  257. package/dist/lib/node/transcriber-6J4FVFSZ.cjs +0 -68
  258. package/dist/lib/node/transcriber-6J4FVFSZ.cjs.map +0 -7
  259. package/dist/lib/node/types/index.cjs +0 -36
  260. package/dist/lib/node/types/index.cjs.map +0 -7
  261. package/dist/lib/node-esm/TranscriptContainer-G75LDEO5.mjs +0 -12
  262. package/dist/lib/node-esm/chunk-56QHOX4A.mjs +0 -765
  263. package/dist/lib/node-esm/chunk-56QHOX4A.mjs.map +0 -7
  264. package/dist/lib/node-esm/chunk-FH75X4JC.mjs +0 -56
  265. package/dist/lib/node-esm/chunk-FH75X4JC.mjs.map +0 -7
  266. package/dist/lib/node-esm/chunk-MFJO7EKD.mjs +0 -10
  267. package/dist/lib/node-esm/chunk-MFJO7EKD.mjs.map +0 -7
  268. package/dist/lib/node-esm/chunk-MFJPEIVB.mjs +0 -17
  269. package/dist/lib/node-esm/chunk-MFJPEIVB.mjs.map +0 -7
  270. package/dist/lib/node-esm/chunk-PRL64SRU.mjs +0 -496
  271. package/dist/lib/node-esm/chunk-PRL64SRU.mjs.map +0 -7
  272. package/dist/lib/node-esm/chunk-TXMDLLBR.mjs +0 -21
  273. package/dist/lib/node-esm/chunk-TXMDLLBR.mjs.map +0 -7
  274. package/dist/lib/node-esm/intent-resolver-5LVCYSJS.mjs +0 -31
  275. package/dist/lib/node-esm/intent-resolver-5LVCYSJS.mjs.map +0 -7
  276. package/dist/lib/node-esm/react-surface-JGQSYGRR.mjs +0 -35
  277. package/dist/lib/node-esm/react-surface-JGQSYGRR.mjs.map +0 -7
  278. package/dist/lib/node-esm/transcriber-TVG2MBBN.mjs +0 -57
  279. package/dist/lib/node-esm/transcriber-TVG2MBBN.mjs.map +0 -7
  280. package/dist/types/src/capabilities/capabilities.d.ts +0 -17
  281. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  282. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  283. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  284. package/dist/types/src/components/Transcript/Transcript.d.ts +0 -20
  285. package/dist/types/src/components/Transcript/Transcript.d.ts.map +0 -1
  286. package/dist/types/src/components/Transcript/Transcript.stories.d.ts +0 -24
  287. package/dist/types/src/components/Transcript/Transcript.stories.d.ts.map +0 -1
  288. package/dist/types/src/components/Transcript/deprecated/OldTranscript.d.ts +0 -28
  289. package/dist/types/src/components/Transcript/deprecated/OldTranscript.d.ts.map +0 -1
  290. package/dist/types/src/components/Transcript/index.d.ts +0 -2
  291. package/dist/types/src/components/Transcript/index.d.ts.map +0 -1
  292. package/dist/types/src/components/Transcript/transcript-extension.d.ts +0 -19
  293. package/dist/types/src/components/Transcript/transcript-extension.d.ts.map +0 -1
  294. package/dist/types/src/components/TranscriptContainer.d.ts +0 -8
  295. package/dist/types/src/components/TranscriptContainer.d.ts.map +0 -1
  296. package/dist/types/src/components/stories/FileTranscription.stories.d.ts +0 -17
  297. package/dist/types/src/components/stories/FileTranscription.stories.d.ts.map +0 -1
  298. package/dist/types/src/components/stories/KeyWordRecognition.stories.d.ts +0 -10
  299. package/dist/types/src/components/stories/KeyWordRecognition.stories.d.ts.map +0 -1
  300. package/dist/types/src/components/stories/MicrophoneTranscription.stories.d.ts +0 -19
  301. package/dist/types/src/components/stories/MicrophoneTranscription.stories.d.ts.map +0 -1
  302. package/dist/types/src/components/stories/TranscriptionStory.d.ts +0 -11
  303. package/dist/types/src/components/stories/TranscriptionStory.d.ts.map +0 -1
  304. package/dist/types/src/components/stories/useIsSpeaking.d.ts.map +0 -1
  305. package/dist/types/src/segments-normalization/index.d.ts.map +0 -1
  306. package/dist/types/src/segments-normalization/message-normalizer.d.ts.map +0 -1
  307. package/dist/types/src/segments-normalization/normalization.d.ts +0 -329
  308. package/dist/types/src/segments-normalization/normalization.d.ts.map +0 -1
  309. package/dist/types/src/segments-normalization/normalization.test.d.ts.map +0 -1
  310. package/dist/types/src/segments-normalization/utils.d.ts +0 -3
  311. package/dist/types/src/segments-normalization/utils.d.ts.map +0 -1
  312. package/dist/types/src/types/schema.d.ts +0 -41
  313. package/dist/types/src/types/schema.d.ts.map +0 -1
  314. package/dist/types/src/types/types.d.ts +0 -31
  315. package/dist/types/src/types/types.d.ts.map +0 -1
  316. package/src/capabilities/capabilities.ts +0 -33
  317. package/src/capabilities/intent-resolver.ts +0 -24
  318. package/src/components/Transcript/Transcript.tsx +0 -100
  319. package/src/components/Transcript/deprecated/OldTranscript.tsx +0 -260
  320. package/src/components/TranscriptContainer.tsx +0 -30
  321. package/src/components/stories/TranscriptionStory.tsx +0 -41
  322. package/src/segments-normalization/normalization.ts +0 -105
  323. package/src/types/schema.ts +0 -41
  324. package/src/types/types.ts +0 -32
  325. package/dist/lib/browser/{TranscriptContainer-H3AZQ4CQ.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
  326. package/dist/lib/{node-esm/TranscriptContainer-G75LDEO5.mjs.map → browser/hooks/index.mjs.map} +0 -0
  327. package/dist/types/src/{segments-normalization → normalization}/normalization.test.d.ts +0 -0
  328. package/dist/types/src/{components/stories → stories}/useIsSpeaking.d.ts +0 -0
  329. package/src/{segments-normalization → normalization}/index.ts +1 -1
  330. /package/src/{components/stories → stories}/useIsSpeaking.tsx +0 -0
@@ -1,260 +0,0 @@
1
- //
2
- // Copyright 2023 DXOS.org
3
- //
4
-
5
- import { intervalToDuration } from 'date-fns/intervalToDuration';
6
- import { Schema } from 'effect';
7
- import { yieldOrContinue } from 'main-thread-scheduling';
8
- import React, { type FC, useCallback, useEffect, useMemo, useRef, useState, type WheelEvent } from 'react';
9
- import { type OnResizeCallback, useResizeDetector } from 'react-resize-detector';
10
-
11
- import { Type } from '@dxos/echo';
12
- import { IconButton, type ThemedClassName, useTranslation } from '@dxos/react-ui';
13
- import { useAttention } from '@dxos/react-ui-attention';
14
- import {
15
- type DxGridCellValue,
16
- type DxGridElement,
17
- type DxGridAxisMeta,
18
- type DxGridPlaneCells,
19
- Grid,
20
- toPlaneCellIndex,
21
- } from '@dxos/react-ui-grid';
22
- import { mx } from '@dxos/react-ui-theme';
23
-
24
- import { TRANSCRIPTION_PLUGIN } from '../../../meta';
25
-
26
- /**
27
- * Transcription fragment.
28
- */
29
- const TranscriptSegment = Schema.Struct({
30
- // TODO(burdon): TS from service is not Unix TS (x1000).
31
- started: Schema.String,
32
- text: Schema.String,
33
- });
34
-
35
- type TranscriptSegment = Schema.Schema.Type<typeof TranscriptSegment>;
36
-
37
- /**
38
- * Transcription block (from single speaker).
39
- */
40
- const TranscriptBlock = Schema.Struct({
41
- id: Schema.String,
42
- authorName: Schema.optional(Schema.String), // TODO(burdon): Replace with identityDid.
43
- authorHue: Schema.optional(Schema.String), // TOOD(burdon): Remove.
44
- segments: Schema.Array(TranscriptSegment),
45
- }).pipe(
46
- Type.Obj({
47
- typename: 'dxos.org/type/TranscriptBlock',
48
- version: '0.1.0',
49
- }),
50
- );
51
-
52
- type TranscriptBlock = Schema.Schema.Type<typeof TranscriptBlock>;
53
-
54
- // TODO(burdon): Actions (e.g., mark, summarize, translate, label, delete).
55
-
56
- const lineHeight = 20;
57
- const cellSpacing = 8 + 2;
58
- const timestampColumnWidth = 68;
59
-
60
- const authorClasses = 'font-medium text-base leading-[20px]';
61
- const timestampClasses = 'text-xs leading-[20px] text-description pie-0 tabular-nums';
62
- const segmentTextClasses = 'text-sm whitespace-normal hyphens-auto';
63
- const measureClasses = mx(
64
- // NOTE(thure): The `inline-start` value must equal `timestampColumnWidth` plus grid’s gap (1px)
65
- 'absolute inline-start-[69px] inline-end-0 invisible z-[-1] border',
66
- 'pli-[--dx-grid-cell-padding-inline] plb-[--dx-grid-cell-padding-block] leading-[20px]',
67
- segmentTextClasses,
68
- );
69
-
70
- const rowDefault = {
71
- grid: { size: lineHeight + cellSpacing },
72
- };
73
-
74
- type QueueRows = [number, number][];
75
-
76
- const mapTranscriptQueue = (blocks?: TranscriptBlock[]): QueueRows => {
77
- if (!blocks || !Array.isArray(blocks) || blocks.length === 0) {
78
- return [];
79
- } else {
80
- return blocks.flatMap((block, blockIndex) => {
81
- return [
82
- [blockIndex, -1],
83
- ...block.segments.map((segment, segmentIndex) => {
84
- return [blockIndex, segmentIndex] as [number, number];
85
- }),
86
- ];
87
- });
88
- }
89
- };
90
-
91
- const pad = (n = 0) => String(n).padStart(2, '0');
92
-
93
- const formatTimestamp = (start: Date, end: Date) => {
94
- const { hours, minutes, seconds } = intervalToDuration({ start, end });
95
- return `${pad(hours)}:${pad(minutes)}:${pad(seconds)}`;
96
- };
97
-
98
- const measureRows = async (
99
- host: HTMLDivElement,
100
- blocks: TranscriptBlock[],
101
- queueMap: QueueRows,
102
- signal: AbortSignal,
103
- ) => {
104
- const result: DxGridAxisMeta = { grid: {} };
105
- for (let row = 0; row < queueMap.length; row++) {
106
- await yieldOrContinue('smooth', signal);
107
- const [blockIndex, segmentIndex] = queueMap[row];
108
- if (segmentIndex < 0) {
109
- result.grid[row] = { size: lineHeight + cellSpacing };
110
- } else {
111
- host.textContent = blocks[blockIndex]!.segments[segmentIndex]!.text;
112
- result.grid[row] = { size: host.offsetHeight };
113
- }
114
- }
115
- return result;
116
- };
117
-
118
- export type TranscriptProps = ThemedClassName<{
119
- blocks?: TranscriptBlock[];
120
- attendableId?: string;
121
- ignoreAttention?: boolean;
122
- }>;
123
-
124
- /**
125
- * @@deprecated
126
- */
127
- export const Transcript: FC<TranscriptProps> = ({ classNames, blocks, attendableId, ignoreAttention }) => {
128
- const { t } = useTranslation(TRANSCRIPTION_PLUGIN);
129
- const [dxGrid, setDxGrid] = useState<DxGridElement | null>(null);
130
- const [rows, setRows] = useState<DxGridAxisMeta | undefined>(undefined);
131
- const [columns, setColumns] = useState<DxGridAxisMeta | undefined>(undefined);
132
-
133
- const queueMap = useMemo(() => mapTranscriptQueue(blocks), [blocks]);
134
-
135
- const { hasAttention } = useAttention(attendableId);
136
- const [autoScroll, setAutoScroll] = useState(true);
137
- const handleWheel = useCallback(
138
- (event: WheelEvent) => {
139
- setAutoScroll(false);
140
- if (!ignoreAttention && !hasAttention) {
141
- event.stopPropagation();
142
- }
143
- },
144
- [hasAttention, ignoreAttention],
145
- );
146
-
147
- const abortControllerRef = useRef<AbortController>();
148
-
149
- const handleResize = useCallback(
150
- async ({ entry }: { entry: { target: HTMLDivElement } | null }) => {
151
- if (entry?.target && Array.isArray(blocks) && blocks[0] && queueMap) {
152
- abortControllerRef.current?.abort();
153
- abortControllerRef.current = new AbortController();
154
- setColumns({ grid: { 0: { size: timestampColumnWidth }, 1: { size: entry.target.offsetWidth } } });
155
- return measureRows(entry.target, blocks, queueMap, abortControllerRef.current.signal)
156
- .then(setRows)
157
- .catch(() => {
158
- // Aborted mid-measurement by new size.
159
- });
160
- }
161
- },
162
- [blocks, queueMap],
163
- );
164
-
165
- const { width, ref: measureRef } = useResizeDetector({
166
- onResize: handleResize as OnResizeCallback,
167
- refreshOptions: { leading: true },
168
- });
169
-
170
- useEffect(() => {
171
- if (queueMap.length !== Object.keys(rows?.grid ?? {}).length) {
172
- void handleResize({ entry: { target: measureRef.current } }).then(() => {
173
- if (autoScroll) {
174
- // TODO(thure): Implement a deterministic way to do this when `rows` has fully settled and grid has a new `maxPosBlock`.
175
- setTimeout(() => dxGrid?.scrollToEndRow(), 50);
176
- }
177
- });
178
- }
179
- }, [blocks, queueMap, width, autoScroll]);
180
-
181
- useEffect(() => {
182
- if (dxGrid && Array.isArray(blocks) && blocks[0]) {
183
- const transcriptStart = blocks[0]!.segments[0]!.started;
184
- dxGrid.getCells = (range, plane) => {
185
- switch (plane) {
186
- case 'grid': {
187
- const cells: DxGridPlaneCells = {};
188
- for (let row = range.start.row; row <= range.end.row && row < queueMap.length; row++) {
189
- const [blockIndex, segmentIndex] = queueMap[row];
190
-
191
- cells[toPlaneCellIndex({ col: 0, row })] = {
192
- readonly: true,
193
- value:
194
- segmentIndex < 0
195
- ? formatTimestamp(
196
- new Date(transcriptStart),
197
- new Date(blocks[blockIndex]!.segments[Math.max(0, segmentIndex)]!.started),
198
- )
199
- : '',
200
- className: timestampClasses,
201
- } satisfies DxGridCellValue;
202
-
203
- cells[toPlaneCellIndex({ col: 1, row })] = (
204
- segmentIndex < 0
205
- ? {
206
- readonly: true,
207
- accessoryHtml: `<span data-hue="${blocks[blockIndex]!.authorHue}" class="dx-text-hue">${blocks[blockIndex]!.authorName}</span>`,
208
- className: authorClasses,
209
- }
210
- : {
211
- readonly: true,
212
- value: blocks[blockIndex]!.segments[segmentIndex]!.text,
213
- className: segmentTextClasses,
214
- }
215
- ) satisfies DxGridCellValue;
216
- }
217
- return cells;
218
- }
219
- default:
220
- return {};
221
- }
222
- };
223
- }
224
- }, [dxGrid, blocks]);
225
-
226
- const handleScrollToEnd = useCallback(() => {
227
- setAutoScroll(true);
228
- dxGrid?.scrollToEndRow();
229
- }, [dxGrid, autoScroll]);
230
-
231
- return (
232
- <div role='none' className={mx('relative min-bs-0', classNames)}>
233
- <Grid.Root id={`${attendableId}--transcript`}>
234
- <Grid.Content
235
- limitColumns={2}
236
- limitRows={queueMap.length}
237
- columns={columns}
238
- rows={rows}
239
- rowDefault={rowDefault}
240
- onWheel={handleWheel}
241
- className='[--dx-grid-base:var(--dx-baseSurface)] [--dx-grid-lines:var(--dx-baseSurface)] [&_.dx-grid]:min-bs-0 [&_.dx-grid]:min-is-0 [&_.dx-grid]:select-auto'
242
- ref={setDxGrid}
243
- />
244
- </Grid.Root>
245
- <div role='none' {...{ inert: '' }} aria-hidden className={measureClasses} ref={measureRef} />
246
- <IconButton
247
- icon='ph--arrow-line-down--regular'
248
- iconOnly
249
- label={t('scroll to end label')}
250
- tooltipSide='left'
251
- data-state={autoScroll ? 'invisible' : 'visible'}
252
- classNames={[
253
- 'absolute inline-end-2 block-end-2 opacity-0 pointer-events-none',
254
- 'data-[state="visible"]:pointer-events-auto data-[state="visible"]:opacity-100 transition-opacity',
255
- ]}
256
- onClick={handleScrollToEnd}
257
- />
258
- </div>
259
- );
260
- };
@@ -1,30 +0,0 @@
1
- //
2
- // Copyright 2024 DXOS.org
3
- //
4
-
5
- import React, { type FC } from 'react';
6
-
7
- import { fullyQualifiedId, getSpace } from '@dxos/client/echo';
8
- import { useMembers, useQueue } from '@dxos/react-client/echo';
9
- import { StackItem } from '@dxos/react-ui-stack';
10
- import { type DataType } from '@dxos/schema';
11
-
12
- import { Transcript, renderMarkdown } from './Transcript';
13
- import { useQueueModelAdapter } from '../hooks';
14
- import { type TranscriptType } from '../types';
15
-
16
- export const TranscriptionContainer: FC<{ role: string; transcript: TranscriptType }> = ({ role, transcript }) => {
17
- const attendableId = fullyQualifiedId(transcript);
18
- const space = getSpace(transcript);
19
- const members = useMembers(space?.key).map((member) => member.identity);
20
- const queue = useQueue<DataType.Message>(transcript.queue.dxn, { pollInterval: 1_000 });
21
- const model = useQueueModelAdapter(renderMarkdown(members), queue);
22
-
23
- return (
24
- <StackItem.Content role={role} classNames='container-max-width pli-2'>
25
- <Transcript attendableId={attendableId} space={space} model={model} transcript={transcript} />
26
- </StackItem.Content>
27
- );
28
- };
29
-
30
- export default TranscriptionContainer;
@@ -1,41 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import '@dxos-theme';
6
-
7
- import React, { type Dispatch, type FC, type RefObject, type SetStateAction } from 'react';
8
-
9
- import { useSpace } from '@dxos/react-client/echo';
10
- import { IconButton, Toolbar } from '@dxos/react-ui';
11
- import { ScrollContainer } from '@dxos/react-ui-components';
12
- import { type DataType } from '@dxos/schema';
13
-
14
- import { type SerializationModel } from '../../model';
15
- import { Transcript } from '../Transcript';
16
-
17
- export const TranscriptionStory: FC<{
18
- model: SerializationModel<DataType.Message>;
19
- running: boolean;
20
- onRunningChange: Dispatch<SetStateAction<boolean>>;
21
- audioRef?: RefObject<HTMLAudioElement>;
22
- }> = ({ model, running, onRunningChange, audioRef }) => {
23
- const space = useSpace();
24
-
25
- return (
26
- <div className='flex flex-col w-[30rem]'>
27
- {audioRef && <audio ref={audioRef} autoPlay />}
28
- <Toolbar.Root>
29
- <IconButton
30
- iconOnly
31
- icon={running ? 'ph--pause--regular' : 'ph--play--regular'}
32
- label={running ? 'Pause' : 'Play'}
33
- onClick={() => onRunningChange((running) => !running)}
34
- />
35
- </Toolbar.Root>
36
- <ScrollContainer>
37
- <Transcript space={space} model={model} attendableId='story' />
38
- </ScrollContainer>
39
- </div>
40
- );
41
- };
@@ -1,105 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { Schema } from 'effect';
6
-
7
- import { DEFAULT_EDGE_MODEL, Message } from '@dxos/ai';
8
- import { AISession } from '@dxos/assistant';
9
- import { Obj } from '@dxos/echo';
10
- import { AiService, defineFunction } from '@dxos/functions';
11
- import { ObjectId } from '@dxos/keys';
12
- import { log } from '@dxos/log';
13
- import { DataType } from '@dxos/schema';
14
-
15
- const MessageWithRangeId = Schema.extend(
16
- DataType.Message,
17
- Schema.Struct({
18
- // TODO(mykola): Move to meta in DataType.Message. Use `DataType.Message` instead.
19
- rangeId: Schema.optional(Schema.Array(Schema.String)).annotations({
20
- description: 'The IDs of the messages that contain the sentences.',
21
- }),
22
- }),
23
- );
24
-
25
- export interface MessageWithRangeId extends Schema.Schema.Type<typeof MessageWithRangeId> {}
26
-
27
- export const NormalizationInput = Schema.Struct({
28
- // TODO(mykola): Move to meta in DataType.Message. Use `DataType.Message` instead.
29
- messages: Schema.Array(MessageWithRangeId).annotations({
30
- description: 'Messages to normalize into sentences.',
31
- }),
32
- });
33
- export interface NormalizationInput extends Schema.Schema.Type<typeof NormalizationInput> {}
34
-
35
- export const NormalizationOutput = Schema.Struct({
36
- sentences: Schema.Array(MessageWithRangeId.pipe(Schema.mutable)).pipe(Schema.mutable).annotations({
37
- description: 'The sentences of the transcript.',
38
- }),
39
- });
40
- export interface NormalizationOutput extends Schema.Schema.Type<typeof NormalizationOutput> {}
41
-
42
- const prompt = `
43
- You are observing a real-time transcript of a single person speaking.
44
- 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.
45
-
46
- # Task Description:
47
- - Your task is to detect and reconstruct broken or incomplete sentences by merging segments into coherent, grammatically correct sentences where appropriate.
48
-
49
- # Input Format:
50
- - The input is an array of messages that contain transcription blocks.
51
- - Each message is a DataType.Message, as described in the output format.
52
-
53
- # Output Format:
54
- - You have been provided with the tool that defines the output format; make sure to query it.
55
- - Do not output anything other than the expected format.
56
-
57
- # Segment Handling Rules:
58
- - Sort messages by timestamp.
59
- - Leave ID of the first message in a sentence.
60
- - Each divided sentence should be added to the output as a separate message or block within existing messages, preserving the original order.
61
- - If one message contains multiple sentences, you should not split them.
62
- - The last sentence may be incomplete; it should still be output as a separate block or message.
63
- - 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.
64
- - 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.
65
-
66
- # Punctuation and Capitalization:
67
- - Do not rely on the original punctuation and capitalization—they may be incorrect.
68
- - Use logical reasoning to apply appropriate punctuation (e.g., period, comma, question mark, exclamation mark) and capitalization.
69
-
70
- # Restrictions:
71
- - Do not alter the order of the original messages; maintain the natural flow of speech.
72
- - Do not interpret or infer meaning beyond reconstructing sentences.
73
- - Do not add or remove any words or phrases.
74
- `;
75
-
76
- export const sentenceNormalization = defineFunction<NormalizationInput, NormalizationOutput>({
77
- description: 'Post process of transcription for sentence normalization',
78
- inputSchema: NormalizationInput,
79
- outputSchema: NormalizationOutput,
80
- handler: async ({ data: { messages }, context }) => {
81
- log.info('input', { messages });
82
- const ai = context.getService(AiService);
83
- const session = new AISession({ operationModel: 'configured' });
84
-
85
- const response = await session.runStructured(NormalizationOutput, {
86
- generationOptions: { model: DEFAULT_EDGE_MODEL },
87
- client: ai.client,
88
- tools: [],
89
- artifacts: [],
90
- history: [
91
- Obj.make(Message, {
92
- role: 'user',
93
- content: messages.map((message) => ({ type: 'text', text: JSON.stringify(message) }) as const),
94
- }),
95
- ],
96
- prompt,
97
- });
98
-
99
- response.sentences.forEach((sentence) => {
100
- sentence.id = ObjectId.random();
101
- });
102
- log.info('response', { response });
103
- return response;
104
- },
105
- });
@@ -1,41 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { Schema } from 'effect';
6
-
7
- import { Queue } from '@dxos/client/echo';
8
- import { Type } from '@dxos/echo';
9
- import { TypedObject } from '@dxos/echo-schema';
10
-
11
- /**
12
- * Root transcript object created when the user starts a transcription.
13
- */
14
- export const TranscriptSchema = Schema.Struct({
15
- // TODO(wittjosiah): Remove?
16
- // TODO(burdon): Use Date or string?
17
- started: Schema.optional(Schema.String),
18
- ended: Schema.optional(Schema.String),
19
-
20
- /**
21
- * Queue containing TranscriptBlock objects.
22
- */
23
- queue: Type.Ref(Queue),
24
- });
25
-
26
- export class TranscriptType extends TypedObject({
27
- typename: 'dxos.org/type/Transcript',
28
- version: '0.1.0',
29
- })(TranscriptSchema.fields) {}
30
-
31
- // TODO(burdon): Do these need to be kept in sync with EDGE?
32
-
33
- /**
34
- * First message in queue.
35
- * Contains metadata for the recording and transcript.
36
- */
37
- const TranscriptHeader = Schema.Struct({
38
- started: Schema.optional(Schema.String),
39
- });
40
-
41
- export type TranscriptHeader = Schema.Schema.Type<typeof TranscriptHeader>;
@@ -1,32 +0,0 @@
1
- //
2
- // Copyright 2025 DXOS.org
3
- //
4
-
5
- import { Schema } from 'effect';
6
-
7
- import { SpaceId } from '@dxos/react-client/echo';
8
-
9
- import { TranscriptType } from './schema';
10
- import { TRANSCRIPTION_PLUGIN } from '../meta';
11
-
12
- // TODO(burdon): Move to separate proto.
13
-
14
- /**
15
- * Endpoint to the calls service.
16
- */
17
- // TODO(burdon): Reconfigure/move.
18
- export const TRANSCRIPTION_URL = 'https://calls-service.dxos.workers.dev';
19
-
20
- export namespace TranscriptionAction {
21
- const TRANSCRIPTION_ACTION = `${TRANSCRIPTION_PLUGIN}/action`;
22
-
23
- export class Create extends Schema.TaggedClass<Create>()(`${TRANSCRIPTION_ACTION}/create`, {
24
- input: Schema.Struct({
25
- name: Schema.optional(Schema.String),
26
- spaceId: SpaceId,
27
- }),
28
- output: Schema.Struct({
29
- object: TranscriptType,
30
- }),
31
- }) {}
32
- }
@@ -2,6 +2,6 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- export * from './normalization';
6
5
  export * from './message-normalizer';
6
+ export * from './normalization';
7
7
  export * from './utils';