@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
@@ -0,0 +1,112 @@
1
+ import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
+ import {
3
+ __export
4
+ } from "./chunk-HSLMI22Q.mjs";
5
+
6
+ // src/operations/definitions.ts
7
+ var definitions_exports = {};
8
+ __export(definitions_exports, {
9
+ Create: () => Create,
10
+ MessageWithRangeId: () => MessageWithRangeId,
11
+ Open: () => Open,
12
+ SentenceNormalization: () => SentenceNormalization,
13
+ SentenceNormalizationInput: () => SentenceNormalizationInput,
14
+ SentenceNormalizationOutput: () => SentenceNormalizationOutput,
15
+ Summarize: () => Summarize
16
+ });
17
+ import * as Schema from "effect/Schema";
18
+ import { AiService } from "@dxos/ai";
19
+ import { SpaceSchema } from "@dxos/client/echo";
20
+ import { Operation } from "@dxos/compute";
21
+ import { Database, Feed, Ref } from "@dxos/echo";
22
+ import { Message, Transcript } from "@dxos/types";
23
+ import { meta } from "#meta";
24
+ var TRANSCRIPT_OPERATION = `${meta.id}.operation`;
25
+ var Create = Operation.make({
26
+ meta: {
27
+ key: `${TRANSCRIPT_OPERATION}.create`,
28
+ name: "Create Transcript"
29
+ },
30
+ input: Schema.Struct({
31
+ name: Schema.optional(Schema.String),
32
+ space: SpaceSchema
33
+ }),
34
+ output: Schema.Struct({
35
+ object: Transcript.Transcript
36
+ })
37
+ });
38
+ var MessageWithRangeId = Schema.extend(Message.Message, Schema.Struct({
39
+ rangeId: Schema.optional(Schema.Array(Schema.String)).annotations({
40
+ description: "The IDs of the messages that contain the sentences."
41
+ })
42
+ }));
43
+ var Open = Operation.make({
44
+ meta: {
45
+ key: "org.dxos.function.transcription.open",
46
+ name: "Open",
47
+ description: "Opens and reads the contents of a transcription object."
48
+ },
49
+ input: Schema.Struct({
50
+ transcript: Ref.Ref(Transcript.Transcript).annotations({
51
+ description: "The ID of the transcription object."
52
+ })
53
+ }),
54
+ output: Schema.Struct({
55
+ content: Schema.String
56
+ }),
57
+ services: [
58
+ Database.Service,
59
+ Feed.FeedService
60
+ ]
61
+ });
62
+ var Summarize = Operation.make({
63
+ meta: {
64
+ key: "org.dxos.function.transcription.summarize",
65
+ name: "Summarize",
66
+ description: "Summarize a transcript of a meeting."
67
+ },
68
+ input: Schema.Struct({
69
+ transcript: Schema.String.annotations({
70
+ description: "The transcript of the meeting."
71
+ }),
72
+ notes: Schema.optional(Schema.String).annotations({
73
+ description: "Additional notes from the participants."
74
+ })
75
+ }),
76
+ output: Schema.Struct({
77
+ summary: Schema.String.annotations({
78
+ description: "The summary of the transcript."
79
+ })
80
+ }),
81
+ services: [
82
+ AiService.AiService
83
+ ]
84
+ });
85
+ var SentenceNormalizationInput = Schema.Struct({
86
+ messages: Schema.Array(MessageWithRangeId).annotations({
87
+ description: "Messages to normalize into sentences."
88
+ })
89
+ });
90
+ var SentenceNormalizationOutput = Schema.Struct({
91
+ sentences: Schema.Array(MessageWithRangeId.pipe(Schema.mutable)).pipe(Schema.mutable).annotations({
92
+ description: "The sentences of the transcript."
93
+ })
94
+ });
95
+ var SentenceNormalization = Operation.make({
96
+ meta: {
97
+ key: "org.dxos.function.transcription.sentence-normalization",
98
+ name: "Sentence Normalization",
99
+ description: "Post process of transcription for sentence normalization"
100
+ },
101
+ input: SentenceNormalizationInput,
102
+ output: SentenceNormalizationOutput,
103
+ services: []
104
+ });
105
+
106
+ export {
107
+ Create,
108
+ Open,
109
+ Summarize,
110
+ definitions_exports
111
+ };
112
+ //# sourceMappingURL=chunk-7UIZWCD4.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/operations/definitions.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { AiService } from '@dxos/ai';\nimport { SpaceSchema } from '@dxos/client/echo';\nimport { Operation } from '@dxos/compute';\nimport { Database, Feed, Ref } from '@dxos/echo';\nimport { Message, Transcript } from '@dxos/types';\n\nimport { meta } from '#meta';\n\nconst TRANSCRIPT_OPERATION = `${meta.id}.operation`;\n\nexport const Create = Operation.make({\n meta: { key: `${TRANSCRIPT_OPERATION}.create`, name: 'Create Transcript' },\n input: Schema.Struct({\n name: Schema.optional(Schema.String),\n space: SpaceSchema,\n }),\n output: Schema.Struct({\n object: Transcript.Transcript,\n }),\n});\n\nexport const MessageWithRangeId = Schema.extend(\n Message.Message,\n Schema.Struct({\n rangeId: Schema.optional(Schema.Array(Schema.String)).annotations({\n description: 'The IDs of the messages that contain the sentences.',\n }),\n }),\n);\n\nexport type MessageWithRangeIdType = Schema.Schema.Type<typeof MessageWithRangeId>;\n\nexport const Open = Operation.make({\n meta: {\n key: 'org.dxos.function.transcription.open',\n name: 'Open',\n description: 'Opens and reads the contents of a transcription object.',\n },\n input: Schema.Struct({\n transcript: Ref.Ref(Transcript.Transcript).annotations({\n description: 'The ID of the transcription object.',\n }),\n }),\n output: Schema.Struct({\n content: Schema.String,\n }),\n services: [Database.Service, Feed.FeedService],\n});\n\nexport const Summarize = Operation.make({\n meta: {\n key: 'org.dxos.function.transcription.summarize',\n name: 'Summarize',\n description: 'Summarize a transcript of a meeting.',\n },\n input: Schema.Struct({\n transcript: Schema.String.annotations({\n description: 'The transcript of the meeting.',\n }),\n notes: Schema.optional(Schema.String).annotations({\n description: 'Additional notes from the participants.',\n }),\n }),\n output: Schema.Struct({\n summary: Schema.String.annotations({\n description: 'The summary of the transcript.',\n }),\n }),\n services: [AiService.AiService],\n});\n\nexport const SentenceNormalizationInput = Schema.Struct({\n messages: Schema.Array(MessageWithRangeId).annotations({\n description: 'Messages to normalize into sentences.',\n }),\n});\n\nexport type SentenceNormalizationInputType = Schema.Schema.Type<typeof SentenceNormalizationInput>;\n\nexport const SentenceNormalizationOutput = Schema.Struct({\n sentences: Schema.Array(MessageWithRangeId.pipe(Schema.mutable)).pipe(Schema.mutable).annotations({\n description: 'The sentences of the transcript.',\n }),\n});\n\nexport const SentenceNormalization = Operation.make({\n meta: {\n key: 'org.dxos.function.transcription.sentence-normalization',\n name: 'Sentence Normalization',\n description: 'Post process of transcription for sentence normalization',\n },\n input: SentenceNormalizationInput,\n output: SentenceNormalizationOutput,\n services: [],\n});\n"],
5
+ "mappings": ";;;;;;AAAA;;;;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,iBAAiB;AAC1B,SAASC,mBAAmB;AAC5B,SAASC,iBAAiB;AAC1B,SAASC,UAAUC,MAAMC,WAAW;AACpC,SAASC,SAASC,kBAAkB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;EACf,CAAA;AACF,CAAA;AAIO,IAAMY,8BAAqCvB,cAAO;EACvDwB,WAAkBf,aAAMH,mBAAmBmB,KAAYC,cAAO,CAAA,EAAGD,KAAYC,cAAO,EAAEhB,YAAY;IAChGC,aAAa;EACf,CAAA;AACF,CAAA;AAEO,IAAMgB,wBAAwBzC,UAAUU,KAAK;EAClDJ,MAAM;IACJK,KAAK;IACLC,MAAM;IACNa,aAAa;EACf;EACAZ,OAAOsB;EACPjB,QAAQmB;EACRR,UAAU,CAAA;AACZ,CAAA;",
6
+ "names": ["Schema", "AiService", "SpaceSchema", "Operation", "Database", "Feed", "Ref", "Message", "Transcript", "meta", "TRANSCRIPT_OPERATION", "id", "Create", "make", "key", "name", "input", "Struct", "optional", "String", "space", "output", "object", "MessageWithRangeId", "extend", "rangeId", "Array", "annotations", "description", "Open", "transcript", "content", "services", "Service", "FeedService", "Summarize", "notes", "summary", "SentenceNormalizationInput", "messages", "SentenceNormalizationOutput", "sentences", "pipe", "mutable", "SentenceNormalization"]
7
+ }
@@ -0,0 +1,181 @@
1
+ import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
+
3
+ // src/model/model.ts
4
+ import { Text } from "@codemirror/state";
5
+ import { Event } from "@dxos/async";
6
+ import { invariant } from "@dxos/invariant";
7
+ import { log } from "@dxos/log";
8
+ var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-transcription/src/model/model.ts";
9
+ var DocumentAdapter = class {
10
+ _view;
11
+ constructor(_view) {
12
+ this._view = _view;
13
+ }
14
+ /** The document must always have at least one line. */
15
+ lineCount() {
16
+ return this._view.state.doc.lines - 1;
17
+ }
18
+ replaceLines(from, remove, insert) {
19
+ log("replaceLines", {
20
+ count: this._view.state.doc.lines,
21
+ from,
22
+ remove,
23
+ insert
24
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 19, S: this });
25
+ const numLines = this._view.state.doc.lines;
26
+ const posFrom = this._view.state.doc.line(from).from;
27
+ const posTo = remove === 0 ? posFrom : this._view.state.doc.line(Math.min(numLines, from + remove)).from;
28
+ let text = insert.join("\n");
29
+ if (posTo === this._view.state.doc.length) {
30
+ text += "\n";
31
+ }
32
+ this._view.dispatch({
33
+ changes: {
34
+ from: posFrom,
35
+ to: posTo,
36
+ insert: text
37
+ }
38
+ });
39
+ }
40
+ };
41
+ var SerializationModel = class {
42
+ _renderer;
43
+ /** Emits when the document is updated. */
44
+ update = new Event();
45
+ /** Ordered set of chunks. */
46
+ _chunks = [];
47
+ /** Map of chunk IDs to their current line counts. */
48
+ _chunkLineCounts = /* @__PURE__ */ new Map();
49
+ /** Map of line numbers to chunk IDs. */
50
+ _lineToChunk = /* @__PURE__ */ new Map();
51
+ /** Track chunk changes since last sync. */
52
+ _changes = [];
53
+ constructor(_renderer, initialChunks = []) {
54
+ this._renderer = _renderer;
55
+ initialChunks.forEach((chunk) => {
56
+ this.appendChunk(chunk);
57
+ });
58
+ }
59
+ toJSON() {
60
+ return {
61
+ chunks: this._chunks.length,
62
+ changes: this._changes.length
63
+ };
64
+ }
65
+ get doc() {
66
+ return Text.of([
67
+ ...this._chunks.flatMap((chunk, index) => this._renderer(chunk, index)),
68
+ ""
69
+ ]);
70
+ }
71
+ get chunks() {
72
+ return this._chunks;
73
+ }
74
+ /**
75
+ * Get the block ID at the given line number.
76
+ */
77
+ getChunkAtLine(line) {
78
+ return this._lineToChunk.get(line);
79
+ }
80
+ reset() {
81
+ this._chunks.length = 0;
82
+ this._chunkLineCounts.clear();
83
+ this._lineToChunk.clear();
84
+ this.update.emit();
85
+ return this;
86
+ }
87
+ appendChunk(chunk) {
88
+ const index = this._chunks.length;
89
+ this._chunks.push(chunk);
90
+ this._changes.push({
91
+ type: "append",
92
+ index,
93
+ chunk
94
+ });
95
+ this.update.emit();
96
+ return this;
97
+ }
98
+ updateChunk(chunk) {
99
+ const index = this._chunks.findIndex((c) => c.id === chunk.id);
100
+ invariant(index !== -1, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 102, S: this, A: ["index !== -1", ""] });
101
+ this._chunks[index] = chunk;
102
+ this._changes.push({
103
+ type: "update",
104
+ index,
105
+ chunk
106
+ });
107
+ this.update.emit();
108
+ return this;
109
+ }
110
+ deleteBlock(id) {
111
+ const index = this._chunks.findIndex((c) => c.id === id);
112
+ invariant(index !== -1, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 114, S: this, A: ["index !== -1", ""] });
113
+ this._chunks.splice(index, 1);
114
+ this._changes.push({
115
+ type: "delete",
116
+ index,
117
+ id
118
+ });
119
+ this.update.emit();
120
+ return this;
121
+ }
122
+ /**
123
+ * Syncs the tracked changes with the ChunkDocument.
124
+ */
125
+ sync(document) {
126
+ log("sync", {
127
+ changes: this._changes
128
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 127, S: this });
129
+ for (const change of this._changes) {
130
+ switch (change.type) {
131
+ case "append": {
132
+ const lines = this._renderer(change.chunk, change.index);
133
+ const lastLine = document.lineCount();
134
+ document.replaceLines(lastLine + 1, 0, lines);
135
+ break;
136
+ }
137
+ case "update": {
138
+ let lineStart = 1;
139
+ for (let i = 0; i < change.index; i++) {
140
+ lineStart += this._chunkLineCounts.get(this._chunks[i].id);
141
+ }
142
+ const previousLineCount = this._chunkLineCounts.get(change.chunk.id);
143
+ const newLines = this._renderer(change.chunk, change.index);
144
+ document.replaceLines(lineStart, previousLineCount, newLines);
145
+ break;
146
+ }
147
+ case "delete": {
148
+ let lineStart = 1;
149
+ for (let i = 0; i < change.index; i++) {
150
+ lineStart += this._chunkLineCounts.get(this._chunks[i].id);
151
+ }
152
+ const previousLineCount = this._chunkLineCounts.get(change.id);
153
+ document.replaceLines(lineStart, previousLineCount, []);
154
+ break;
155
+ }
156
+ }
157
+ }
158
+ this._lineToChunk.clear();
159
+ let currentLine = 1;
160
+ for (const [index, chunk] of this._chunks.entries()) {
161
+ const lineCount = this._renderer(chunk, index).length;
162
+ this._chunkLineCounts.set(chunk.id, lineCount);
163
+ this._lineToChunk.set(currentLine, chunk);
164
+ currentLine += lineCount;
165
+ }
166
+ const chunkIds = new Set(this._chunks.map((chunk) => chunk.id));
167
+ for (const id of this._chunkLineCounts.keys()) {
168
+ if (!chunkIds.has(id)) {
169
+ this._chunkLineCounts.delete(id);
170
+ }
171
+ }
172
+ this._changes.length = 0;
173
+ return this;
174
+ }
175
+ };
176
+
177
+ export {
178
+ DocumentAdapter,
179
+ SerializationModel
180
+ };
181
+ //# sourceMappingURL=chunk-C3AE2NYJ.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/model/model.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Text } from '@codemirror/state';\nimport { type EditorView } from '@codemirror/view';\n\nimport { Event } from '@dxos/async';\nimport { invariant } from '@dxos/invariant';\nimport { log } from '@dxos/log';\n\nexport type Chunk = { id: string };\n\n/**\n * Covert block to a set of markdown lines.\n */\nexport type ChunkRenderer<T extends Chunk> = (chunk: T, index: number, debug?: boolean) => string[];\n\n/**\n * Abstract representation of the document model.\n */\nexport interface ChunkDocument {\n lineCount(): number;\n replaceLines(from: number, remove: number, insert: string[]): void;\n}\n\n/**\n * Codemirror document adapter.\n */\nexport class DocumentAdapter implements ChunkDocument {\n constructor(private readonly _view: EditorView) {}\n\n /** The document must always have at least one line. */\n lineCount(): number {\n return this._view.state.doc.lines - 1;\n }\n\n replaceLines(from: number, remove: number, insert: string[]): void {\n log('replaceLines', { count: this._view.state.doc.lines, from, remove, insert });\n\n const numLines = this._view.state.doc.lines;\n const posFrom = this._view.state.doc.line(from).from;\n const posTo = remove === 0 ? posFrom : this._view.state.doc.line(Math.min(numLines, from + remove)).from;\n\n // Don't remove the last line.\n let text = insert.join('\\n');\n if (posTo === this._view.state.doc.length) {\n text += '\\n';\n }\n\n this._view.dispatch({\n changes: { from: posFrom, to: posTo, insert: text },\n });\n }\n}\n\ntype ChunkChange<T extends Chunk> =\n | {\n type: 'append';\n index: number;\n chunk: T;\n }\n | {\n type: 'update';\n index: number;\n chunk: T;\n }\n | {\n type: 'delete';\n index: number;\n id: string;\n };\n\n/**\n * Each Chunk can be converted into a set of lines.\n * Chunks can be added, updated or deleted from the Queue.\n * A Document is an immutable projection that represents a flat list of lines corresponding to the Queue.\n *\n * Ideally we would implement a custom virtual Text model for the View, but this currently isn't possible in Codemirror.\n * Instead this model tracks changes and syncs them with the ChunkDocument.\n */\nexport class SerializationModel<T extends Chunk> {\n /** Emits when the document is updated. */\n public readonly update = new Event<void>();\n\n /** Ordered set of chunks. */\n private readonly _chunks: T[] = [];\n\n /** Map of chunk IDs to their current line counts. */\n private readonly _chunkLineCounts = new Map<string, number>();\n\n /** Map of line numbers to chunk IDs. */\n private readonly _lineToChunk = new Map<number, T>();\n\n /** Track chunk changes since last sync. */\n private readonly _changes: Array<ChunkChange<T>> = [];\n\n constructor(\n private readonly _renderer: ChunkRenderer<T>,\n initialChunks: T[] = [],\n ) {\n initialChunks.forEach((chunk) => {\n this.appendChunk(chunk);\n });\n }\n\n toJSON(): { chunks: number; changes: number } {\n return {\n chunks: this._chunks.length,\n changes: this._changes.length,\n };\n }\n\n get doc() {\n return Text.of([...this._chunks.flatMap((chunk, index) => this._renderer(chunk, index)), '']);\n }\n\n get chunks() {\n return this._chunks;\n }\n\n /**\n * Get the block ID at the given line number.\n */\n getChunkAtLine(line: number): T | undefined {\n return this._lineToChunk.get(line);\n }\n\n reset(): this {\n this._chunks.length = 0;\n this._chunkLineCounts.clear();\n this._lineToChunk.clear();\n this.update.emit();\n return this;\n }\n\n appendChunk(chunk: T): this {\n const index = this._chunks.length;\n this._chunks.push(chunk);\n this._changes.push({ type: 'append', index, chunk });\n this.update.emit();\n return this;\n }\n\n updateChunk(chunk: T): this {\n const index = this._chunks.findIndex((c) => c.id === chunk.id);\n invariant(index !== -1);\n this._chunks[index] = chunk;\n this._changes.push({ type: 'update', index, chunk });\n this.update.emit();\n return this;\n }\n\n deleteBlock(id: string): this {\n const index = this._chunks.findIndex((c) => c.id === id);\n invariant(index !== -1);\n this._chunks.splice(index, 1);\n this._changes.push({ type: 'delete', index, id });\n this.update.emit();\n return this;\n }\n\n /**\n * Syncs the tracked changes with the ChunkDocument.\n */\n sync(document: ChunkDocument): this {\n log('sync', { changes: this._changes });\n\n // Process each change in order.\n for (const change of this._changes) {\n switch (change.type) {\n case 'append': {\n // For appends, convert block to lines and add at the end.\n const lines = this._renderer(change.chunk, change.index);\n const lastLine = document.lineCount();\n document.replaceLines(lastLine + 1, 0, lines);\n break;\n }\n\n case 'update': {\n // For updates, find the block's line range and replace with new lines.\n let lineStart = 1;\n for (let i = 0; i < change.index; i++) {\n lineStart += this._chunkLineCounts.get(this._chunks[i].id)!;\n }\n const previousLineCount = this._chunkLineCounts.get(change.chunk.id)!;\n const newLines = this._renderer(change.chunk, change.index);\n document.replaceLines(lineStart, previousLineCount, newLines);\n break;\n }\n\n case 'delete': {\n // For deletes, find the block's line range and remove those lines.\n let lineStart = 1;\n for (let i = 0; i < change.index; i++) {\n lineStart += this._chunkLineCounts.get(this._chunks[i].id)!;\n }\n const previousLineCount = this._chunkLineCounts.get(change.id)!;\n document.replaceLines(lineStart, previousLineCount, []);\n break;\n }\n }\n }\n\n // Clear the line-to-block mapping.\n this._lineToChunk.clear();\n\n // Update all block line counts and line-to-block mapping after processing changes.\n let currentLine = 1;\n for (const [index, chunk] of this._chunks.entries()) {\n const lineCount = this._renderer(chunk, index).length;\n this._chunkLineCounts.set(chunk.id, lineCount);\n this._lineToChunk.set(currentLine, chunk);\n currentLine += lineCount;\n }\n\n // Clean up deleted blocks.\n const chunkIds = new Set(this._chunks.map((chunk) => chunk.id));\n for (const id of this._chunkLineCounts.keys()) {\n if (!chunkIds.has(id)) {\n this._chunkLineCounts.delete(id);\n }\n }\n\n // Clear changes after sync.\n this._changes.length = 0;\n return this;\n }\n}\n"],
5
+ "mappings": ";;;AAIA,SAASA,YAAY;AAGrB,SAASC,aAAa;AACtB,SAASC,iBAAi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EF,SAAA,SAAA,SAAA;AACF,WAAA;;;",
6
+ "names": ["Text", "Event", "invariant", "log", "_view", "replaceLines", "from", "remove", "insert", "count", "state", "posFrom", "line", "posTo", "text", "dispatch", "_chunkLineCounts", "_lineToChunk", "_changes", "_renderer", "initialChunks", "forEach", "chunk", "appendChunk", "toJSON", "chunks", "changes", "doc", "reset", "clear", "update", "_chunks", "push", "type", "index", "updateChunk", "deleteBlock", "splice", "id", "change", "document", "lastLine", "lines", "lineStart", "previousLineCount", "get", "newLines", "currentLine", "lineCount", "set", "chunkIds"]
7
+ }
@@ -0,0 +1,11 @@
1
+ import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
+ var __defProp = Object.defineProperty;
3
+ var __export = (target, all) => {
4
+ for (var name in all)
5
+ __defProp(target, name, { get: all[name], enumerable: true });
6
+ };
7
+
8
+ export {
9
+ __export
10
+ };
11
+ //# sourceMappingURL=chunk-HSLMI22Q.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -0,0 +1,19 @@
1
+ import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
+
3
+ // src/types/capabilities.ts
4
+ import { Capability } from "@dxos/app-framework";
5
+ import { meta } from "#meta";
6
+ (function(TranscriptionCapabilities2) {
7
+ TranscriptionCapabilities2.Transcriber = Capability.make(`${meta.id}.capability.transcriber`);
8
+ TranscriptionCapabilities2.TranscriptionManager = Capability.make(`${meta.id}.capability.transcription-manager`);
9
+ })(TranscriptionCapabilities || (TranscriptionCapabilities = {}));
10
+ var TranscriptionCapabilities;
11
+
12
+ // src/types/defs.ts
13
+ var TRANSCRIPTION_URL = "https://calls-service.dxos.workers.dev";
14
+
15
+ export {
16
+ TranscriptionCapabilities,
17
+ TRANSCRIPTION_URL
18
+ };
19
+ //# sourceMappingURL=chunk-KO3IOD2O.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/types/capabilities.ts", "../../../src/types/defs.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\n\nimport { meta } from '#meta';\n\nimport {\n type MediaStreamRecorderProps,\n type Transcriber,\n type TranscriberProps,\n type TranscriptMessageEnricher,\n type TranscriptionManager,\n} from '../transcriber';\n\nexport namespace TranscriptionCapabilities {\n export type GetTranscriberProps = {\n audioStreamTrack: MediaStreamTrack;\n recorderConfig?: Partial<MediaStreamRecorderProps['config']>;\n transcriberConfig?: Partial<TranscriberProps['config']>;\n onSegments: TranscriberProps['onSegments'];\n transcribe?: TranscriberProps['transcribe'];\n };\n\n export type GetTranscriber = (props: GetTranscriberProps) => Transcriber;\n\n export type GetTranscriptionManagerProps = {\n messageEnricher?: TranscriptMessageEnricher;\n };\n\n export type GetTranscriptionManager = (props: GetTranscriptionManagerProps) => TranscriptionManager;\n\n export const Transcriber = Capability.make<GetTranscriber>(`${meta.id}.capability.transcriber`);\n\n export const TranscriptionManager = Capability.make<GetTranscriptionManager>(\n `${meta.id}.capability.transcription-manager`,\n );\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\n/**\n * Endpoint to the calls service.\n */\n// TODO(burdon): Reconfigure/move.\nexport const TRANSCRIPTION_URL = 'https://calls-service.dxos.workers.dev';\n"],
5
+ "mappings": ";;;AAIA,SAASA,kBAAkB;AAE3B,SAASC,YAAY;UAUJC,4BAAAA;6BAiBFC,cAAcH,WAAWI,KAAqB,GAAGH,KAAKI,EAAE,yBAAyB;6BAEjFC,uBAAuBN,WAAWI,KAC7C,GAAGH,KAAKI,EAAE,mCAAmC;AAEjD,GAtBiBH,8BAAAA,4BAAAA,CAAAA,EAAAA;;;;ACRV,IAAMK,oBAAoB;",
6
+ "names": ["Capability", "meta", "TranscriptionCapabilities", "Transcriber", "make", "id", "TranscriptionManager", "TRANSCRIPTION_URL"]
7
+ }
@@ -0,0 +1,245 @@
1
+ import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
+ import {
3
+ SerializationModel
4
+ } from "./chunk-C3AE2NYJ.mjs";
5
+
6
+ // src/hooks/useAudioFile.ts
7
+ import { useEffect, useState } from "react";
8
+ import { scheduleTask } from "@dxos/async";
9
+ import { Context } from "@dxos/context";
10
+ import { log } from "@dxos/log";
11
+ var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-transcription/src/hooks/useAudioFile.ts";
12
+ var useAudioFile = (audioUrl, constraints) => {
13
+ const [{ audio, stream, track }, setStream] = useState({});
14
+ useEffect(() => {
15
+ const ctx = new Context(void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 11 });
16
+ scheduleTask(ctx, async () => {
17
+ try {
18
+ const response = await fetch(audioUrl);
19
+ const blob = await response.blob();
20
+ const objectUrl = URL.createObjectURL(blob);
21
+ ctx.onDispose(() => {
22
+ URL.revokeObjectURL(objectUrl);
23
+ });
24
+ const audio2 = new Audio();
25
+ audio2.src = objectUrl;
26
+ await new Promise((resolve, reject) => {
27
+ audio2.addEventListener("error", (err) => {
28
+ log.error("error", {
29
+ err
30
+ }, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 25, S: void 0 });
31
+ reject(err);
32
+ }, {
33
+ once: true
34
+ });
35
+ audio2.addEventListener("canplay", async () => {
36
+ resolve();
37
+ }, {
38
+ once: true
39
+ });
40
+ audio2.load();
41
+ });
42
+ const audioCtx = new AudioContext();
43
+ if (audioCtx.state === "suspended") {
44
+ await audioCtx.resume();
45
+ }
46
+ const destination = audioCtx.createMediaStreamDestination();
47
+ destination.channelCount = 1;
48
+ const source = audioCtx.createMediaElementSource(audio2);
49
+ source.connect(destination);
50
+ const track2 = destination.stream.getAudioTracks()[0];
51
+ if (constraints) {
52
+ await track2.applyConstraints(constraints).catch((err) => log.catch(err, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 50, S: void 0 }));
53
+ }
54
+ setStream({
55
+ audio: audio2,
56
+ stream: destination.stream,
57
+ track: destination.stream.getAudioTracks()[0]
58
+ });
59
+ } catch (err) {
60
+ log.catch(err, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 59, S: void 0 });
61
+ }
62
+ });
63
+ return () => {
64
+ void ctx.dispose();
65
+ };
66
+ }, [
67
+ audioUrl
68
+ ]);
69
+ return {
70
+ audio,
71
+ stream,
72
+ track
73
+ };
74
+ };
75
+
76
+ // src/hooks/useAudioTrack.ts
77
+ import { useEffect as useEffect2, useState as useState2 } from "react";
78
+ var useAudioTrack = (active, constraints) => {
79
+ const [track, setTrack] = useState2();
80
+ useEffect2(() => {
81
+ if (!active) {
82
+ track?.stop();
83
+ setTrack(void 0);
84
+ return;
85
+ }
86
+ const initAudio = async () => {
87
+ const audio = new Audio();
88
+ audio.srcObject = await navigator.mediaDevices.getUserMedia({
89
+ audio: constraints ?? true
90
+ });
91
+ const [track2] = audio.srcObject.getAudioTracks();
92
+ if (track2) {
93
+ setTrack(track2);
94
+ }
95
+ };
96
+ if (active) {
97
+ void initAudio();
98
+ }
99
+ }, [
100
+ active
101
+ ]);
102
+ return track;
103
+ };
104
+
105
+ // src/hooks/useQueueModelAdapter.ts
106
+ import { useEffect as useEffect3, useMemo, useState as useState3 } from "react";
107
+ var useQueueModelAdapter = (renderer, queue, initialChunks = []) => {
108
+ const model = useMemo(() => new SerializationModel(renderer, initialChunks), [
109
+ queue
110
+ ]);
111
+ const [loaded, setLoaded] = useState3(false);
112
+ useEffect3(() => {
113
+ if (!queue) {
114
+ return;
115
+ }
116
+ const update = () => {
117
+ for (const block of queue?.objects ?? []) {
118
+ model.appendChunk(block);
119
+ }
120
+ setLoaded(true);
121
+ };
122
+ let i;
123
+ if (queue.isLoading) {
124
+ i = setInterval(() => {
125
+ if (!queue?.isLoading) {
126
+ clearInterval(i);
127
+ update();
128
+ }
129
+ }, 1e3);
130
+ } else {
131
+ update();
132
+ }
133
+ return () => clearTimeout(i);
134
+ }, [
135
+ model,
136
+ queue
137
+ ]);
138
+ useEffect3(() => {
139
+ if (!loaded || !queue || model.chunks.length === queue.objects.length) {
140
+ return;
141
+ }
142
+ const chunk = queue.objects.at(-1);
143
+ if (chunk) {
144
+ model.appendChunk(chunk);
145
+ }
146
+ }, [
147
+ model,
148
+ loaded,
149
+ queue?.objects.length
150
+ ]);
151
+ return model;
152
+ };
153
+
154
+ // src/hooks/useTranscriber.ts
155
+ import { useEffect as useEffect4, useMemo as useMemo2 } from "react";
156
+ import { useCapabilities } from "@dxos/app-framework/ui";
157
+ import { TranscriptionCapabilities } from "#types";
158
+ var useTranscriber = ({ audioStreamTrack, recorderConfig, transcriberConfig, onSegments, transcribe }) => {
159
+ const [getTranscriber] = useCapabilities(TranscriptionCapabilities.Transcriber);
160
+ const transcriber = useMemo2(() => {
161
+ if (!getTranscriber || !audioStreamTrack || !onSegments) {
162
+ return void 0;
163
+ }
164
+ return getTranscriber({
165
+ audioStreamTrack,
166
+ recorderConfig,
167
+ transcriberConfig,
168
+ onSegments,
169
+ transcribe
170
+ });
171
+ }, [
172
+ getTranscriber,
173
+ audioStreamTrack,
174
+ recorderConfig,
175
+ transcriberConfig,
176
+ onSegments,
177
+ transcribe
178
+ ]);
179
+ useEffect4(() => {
180
+ return () => {
181
+ void transcriber?.close();
182
+ };
183
+ }, [
184
+ transcriber
185
+ ]);
186
+ return transcriber;
187
+ };
188
+
189
+ // src/hooks/useVoiceInput.ts
190
+ import { useCallback, useEffect as useEffect5, useState as useState4 } from "react";
191
+ import { scheduleMicroTask } from "@dxos/async";
192
+ import { Context as Context2 } from "@dxos/context";
193
+ import { log as log2 } from "@dxos/log";
194
+ import { useSoundEffect } from "@dxos/react-ui-sfx";
195
+ var __dxlog_file2 = "/__w/dxos/dxos/packages/plugins/plugin-transcription/src/hooks/useVoiceInput.ts";
196
+ var useVoiceInput = ({ active, onUpdate }) => {
197
+ const soundStart = useSoundEffect("StartRecording");
198
+ const soundStop = useSoundEffect("StopRecording");
199
+ const handleSegments = useCallback(async (segments) => {
200
+ const text = segments.map((str) => str.text.trim().replace(/[^\w\s]/g, "")).join(" ");
201
+ onUpdate(text);
202
+ }, []);
203
+ const [recording, setRecording] = useState4(false);
204
+ const track = useAudioTrack(active);
205
+ const transcriber = useTranscriber({
206
+ audioStreamTrack: track,
207
+ onSegments: handleSegments
208
+ });
209
+ useEffect5(() => {
210
+ const ctx = new Context2(void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file2, L: 29 });
211
+ scheduleMicroTask(ctx, async () => {
212
+ if (active && transcriber) {
213
+ await transcriber.open();
214
+ log2.info("starting...", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file2, L: 33, S: void 0 });
215
+ setRecording(true);
216
+ void soundStart.play();
217
+ transcriber.startChunksRecording();
218
+ } else if (!active && transcriber?.isOpen) {
219
+ transcriber?.stopChunksRecording();
220
+ await transcriber?.close();
221
+ log2.info("stopped", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file2, L: 40, S: void 0 });
222
+ setRecording(false);
223
+ void soundStop.play();
224
+ }
225
+ });
226
+ return () => {
227
+ void ctx.dispose();
228
+ };
229
+ }, [
230
+ active,
231
+ transcriber
232
+ ]);
233
+ return {
234
+ recording
235
+ };
236
+ };
237
+
238
+ export {
239
+ useAudioFile,
240
+ useAudioTrack,
241
+ useQueueModelAdapter,
242
+ useTranscriber,
243
+ useVoiceInput
244
+ };
245
+ //# sourceMappingURL=chunk-MQK4R6GT.mjs.map