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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (331) hide show
  1. package/dist/lib/neutral/TranscriptionContainer-XNGXNGPX.mjs +35 -0
  2. package/dist/lib/neutral/TranscriptionContainer-XNGXNGPX.mjs.map +7 -0
  3. package/dist/lib/neutral/TranscriptionPlugin.mjs +34 -0
  4. package/dist/lib/neutral/TranscriptionPlugin.mjs.map +7 -0
  5. package/dist/lib/neutral/TranscriptionPlugin.node.mjs +25 -0
  6. package/dist/lib/neutral/TranscriptionPlugin.node.mjs.map +7 -0
  7. package/dist/lib/neutral/blueprint-definition-HOXDG5QP.mjs +15 -0
  8. package/dist/lib/neutral/blueprint-definition-HOXDG5QP.mjs.map +7 -0
  9. package/dist/lib/neutral/blueprints/index.mjs +8 -0
  10. package/dist/lib/neutral/capabilities/index.mjs +17 -0
  11. package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
  12. package/dist/lib/neutral/chunk-GL4RS533.mjs +22 -0
  13. package/dist/lib/neutral/chunk-GL4RS533.mjs.map +7 -0
  14. package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
  15. package/dist/lib/neutral/chunk-KAEXRX3Y.mjs +35 -0
  16. package/dist/lib/neutral/chunk-KAEXRX3Y.mjs.map +7 -0
  17. package/dist/lib/{browser/chunk-BA64VLLR.mjs → neutral/chunk-LS3R7EQI.mjs} +129 -185
  18. package/dist/lib/neutral/chunk-LS3R7EQI.mjs.map +7 -0
  19. package/dist/lib/neutral/chunk-MLRJWAQH.mjs +179 -0
  20. package/dist/lib/neutral/chunk-MLRJWAQH.mjs.map +7 -0
  21. package/dist/lib/neutral/chunk-NNR3EYR2.mjs +124 -0
  22. package/dist/lib/neutral/chunk-NNR3EYR2.mjs.map +7 -0
  23. package/dist/lib/neutral/chunk-NQQK7UZQ.mjs +244 -0
  24. package/dist/lib/neutral/chunk-NQQK7UZQ.mjs.map +7 -0
  25. package/dist/lib/neutral/chunk-WVEZMGBT.mjs +8 -0
  26. package/dist/lib/neutral/chunk-WVEZMGBT.mjs.map +7 -0
  27. package/dist/lib/neutral/chunk-ZR4BH4QQ.mjs +30 -0
  28. package/dist/lib/neutral/chunk-ZR4BH4QQ.mjs.map +7 -0
  29. package/dist/lib/neutral/components/index.mjs +207 -0
  30. package/dist/lib/neutral/components/index.mjs.map +7 -0
  31. package/dist/lib/neutral/containers/index.mjs +9 -0
  32. package/dist/lib/neutral/containers/index.mjs.map +7 -0
  33. package/dist/lib/neutral/create-2D6S4IMQ.mjs +21 -0
  34. package/dist/lib/neutral/create-2D6S4IMQ.mjs.map +7 -0
  35. package/dist/lib/neutral/hooks/index.mjs +17 -0
  36. package/dist/lib/neutral/index.mjs +44 -0
  37. package/dist/lib/neutral/meta.json +1 -0
  38. package/dist/lib/neutral/meta.mjs +8 -0
  39. package/dist/lib/neutral/meta.mjs.map +7 -0
  40. package/dist/lib/neutral/open-2QB6IIET.mjs +27 -0
  41. package/dist/lib/neutral/open-2QB6IIET.mjs.map +7 -0
  42. package/dist/lib/neutral/operation-handler-NXMOAXFP.mjs +13 -0
  43. package/dist/lib/neutral/operation-handler-NXMOAXFP.mjs.map +7 -0
  44. package/dist/lib/neutral/operations/index.mjs +8 -0
  45. package/dist/lib/neutral/operations/index.mjs.map +7 -0
  46. package/dist/lib/neutral/plugin.mjs +16 -0
  47. package/dist/lib/neutral/plugin.mjs.map +7 -0
  48. package/dist/lib/neutral/react-surface-QF4MUMWG.mjs +26 -0
  49. package/dist/lib/neutral/react-surface-QF4MUMWG.mjs.map +7 -0
  50. package/dist/lib/neutral/summarize-CJPVKWYZ.mjs +78 -0
  51. package/dist/lib/neutral/summarize-CJPVKWYZ.mjs.map +7 -0
  52. package/dist/lib/neutral/text-content-LHSUG2D2.mjs +30 -0
  53. package/dist/lib/neutral/text-content-LHSUG2D2.mjs.map +7 -0
  54. package/dist/lib/{node-esm/transcriber-QPS55YP2.mjs → neutral/transcriber-M3R6HPTZ.mjs} +20 -18
  55. package/dist/lib/neutral/transcriber-M3R6HPTZ.mjs.map +7 -0
  56. package/dist/lib/neutral/translations.mjs +22 -0
  57. package/dist/lib/neutral/translations.mjs.map +7 -0
  58. package/dist/lib/neutral/types/index.mjs +12 -0
  59. package/dist/lib/neutral/types/index.mjs.map +7 -0
  60. package/dist/types/src/TranscriptionPlugin.d.ts +3 -1
  61. package/dist/types/src/TranscriptionPlugin.d.ts.map +1 -1
  62. package/dist/types/src/TranscriptionPlugin.node.d.ts +4 -0
  63. package/dist/types/src/TranscriptionPlugin.node.d.ts.map +1 -0
  64. package/dist/types/src/TranscriptionPlugin.test.d.ts +2 -0
  65. package/dist/types/src/TranscriptionPlugin.test.d.ts.map +1 -0
  66. package/dist/types/src/blueprints/index.d.ts +2 -0
  67. package/dist/types/src/blueprints/index.d.ts.map +1 -0
  68. package/dist/types/src/blueprints/transcription-blueprint.d.ts +4 -0
  69. package/dist/types/src/blueprints/transcription-blueprint.d.ts.map +1 -0
  70. package/dist/types/src/capabilities/blueprint-definition.d.ts +5 -4
  71. package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -1
  72. package/dist/types/src/capabilities/index.d.ts +10 -5
  73. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  74. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  75. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  76. package/dist/types/src/capabilities/react-surface.d.ts +3 -2
  77. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  78. package/dist/types/src/capabilities/text-content.d.ts +8 -0
  79. package/dist/types/src/capabilities/text-content.d.ts.map +1 -0
  80. package/dist/types/src/capabilities/transcriber.d.ts +4 -3
  81. package/dist/types/src/capabilities/transcriber.d.ts.map +1 -1
  82. package/dist/types/src/components/Transcription/Transcription.d.ts +18 -0
  83. package/dist/types/src/components/Transcription/Transcription.d.ts.map +1 -0
  84. package/dist/types/src/components/Transcription/Transcription.stories.d.ts +40 -0
  85. package/dist/types/src/components/Transcription/Transcription.stories.d.ts.map +1 -0
  86. package/dist/types/src/components/Transcription/index.d.ts +2 -0
  87. package/dist/types/src/components/Transcription/index.d.ts.map +1 -0
  88. package/dist/types/src/components/Transcription/transcription-extension.d.ts +15 -0
  89. package/dist/types/src/components/Transcription/transcription-extension.d.ts.map +1 -0
  90. package/dist/types/src/components/index.d.ts +1 -3
  91. package/dist/types/src/components/index.d.ts.map +1 -1
  92. package/dist/types/src/containers/TranscriptionContainer/TranscriptionContainer.d.ts +6 -0
  93. package/dist/types/src/containers/TranscriptionContainer/TranscriptionContainer.d.ts.map +1 -0
  94. package/dist/types/src/containers/TranscriptionContainer/index.d.ts +2 -0
  95. package/dist/types/src/containers/TranscriptionContainer/index.d.ts.map +1 -0
  96. package/dist/types/src/containers/index.d.ts +3 -0
  97. package/dist/types/src/containers/index.d.ts.map +1 -0
  98. package/dist/types/src/hooks/useAudioFile.d.ts.map +1 -1
  99. package/dist/types/src/hooks/useAudioTrack.d.ts.map +1 -1
  100. package/dist/types/src/hooks/useQueueModelAdapter.d.ts +1 -1
  101. package/dist/types/src/hooks/useQueueModelAdapter.d.ts.map +1 -1
  102. package/dist/types/src/hooks/useTranscriber.d.ts +2 -2
  103. package/dist/types/src/hooks/useTranscriber.d.ts.map +1 -1
  104. package/dist/types/src/hooks/useVoiceInput.d.ts.map +1 -1
  105. package/dist/types/src/index.d.ts +2 -3
  106. package/dist/types/src/index.d.ts.map +1 -1
  107. package/dist/types/src/meta.d.ts +2 -3
  108. package/dist/types/src/meta.d.ts.map +1 -1
  109. package/dist/types/src/model/model.d.ts +2 -2
  110. package/dist/types/src/model/model.d.ts.map +1 -1
  111. package/dist/types/src/{segments-normalization → normalization}/index.d.ts +1 -1
  112. package/dist/types/src/normalization/index.d.ts.map +1 -0
  113. package/dist/types/src/{segments-normalization → normalization}/message-normalizer.d.ts +5 -5
  114. package/dist/types/src/normalization/message-normalizer.d.ts.map +1 -0
  115. package/dist/types/src/normalization/normalization.d.ts +543 -0
  116. package/dist/types/src/normalization/normalization.d.ts.map +1 -0
  117. package/dist/types/src/normalization/normalization.test.d.ts.map +1 -0
  118. package/dist/types/src/normalization/utils.d.ts +3 -0
  119. package/dist/types/src/normalization/utils.d.ts.map +1 -0
  120. package/dist/types/src/operations/create.d.ts +5 -0
  121. package/dist/types/src/operations/create.d.ts.map +1 -0
  122. package/dist/types/src/operations/index.d.ts +3 -0
  123. package/dist/types/src/operations/index.d.ts.map +1 -0
  124. package/dist/types/src/operations/open.d.ts +5 -0
  125. package/dist/types/src/operations/open.d.ts.map +1 -0
  126. package/dist/types/src/operations/summarize.d.ts +8 -0
  127. package/dist/types/src/operations/summarize.d.ts.map +1 -0
  128. package/dist/types/src/plugin.d.ts +4 -0
  129. package/dist/types/src/plugin.d.ts.map +1 -0
  130. package/dist/types/src/{components/stories → stories}/FileTranscription.stories.d.ts +3 -4
  131. package/dist/types/src/stories/FileTranscription.stories.d.ts.map +1 -0
  132. package/dist/types/src/{components/stories → stories}/KeyWordRecognition.stories.d.ts +2 -3
  133. package/dist/types/src/stories/KeyWordRecognition.stories.d.ts.map +1 -0
  134. package/dist/types/src/{components/stories → stories}/MicrophoneTranscription.stories.d.ts +5 -6
  135. package/dist/types/src/stories/MicrophoneTranscription.stories.d.ts.map +1 -0
  136. package/dist/types/src/stories/TranscriptionStory.d.ts +23 -0
  137. package/dist/types/src/stories/TranscriptionStory.d.ts.map +1 -0
  138. package/dist/types/src/stories/useIsSpeaking.d.ts.map +1 -0
  139. package/dist/types/src/testing/testing.d.ts +10 -10
  140. package/dist/types/src/testing/testing.d.ts.map +1 -1
  141. package/dist/types/src/transcriber/index.d.ts +1 -1
  142. package/dist/types/src/transcriber/index.d.ts.map +1 -1
  143. package/dist/types/src/transcriber/media-stream-recorder.d.ts +2 -2
  144. package/dist/types/src/transcriber/media-stream-recorder.d.ts.map +1 -1
  145. package/dist/types/src/transcriber/transcriber.d.ts +60 -5
  146. package/dist/types/src/transcriber/transcriber.d.ts.map +1 -1
  147. package/dist/types/src/transcriber/transcriber.test.d.ts +2 -0
  148. package/dist/types/src/transcriber/transcriber.test.d.ts.map +1 -0
  149. package/dist/types/src/transcriber/transcription-manager.d.ts +9 -6
  150. package/dist/types/src/transcriber/transcription-manager.d.ts.map +1 -1
  151. package/dist/types/src/translations.d.ts +7 -8
  152. package/dist/types/src/translations.d.ts.map +1 -1
  153. package/dist/types/src/types/TranscriptOperation.d.ts +917 -0
  154. package/dist/types/src/types/TranscriptOperation.d.ts.map +1 -0
  155. package/dist/types/src/types/TranscriptionCapabilities.d.ts +17 -0
  156. package/dist/types/src/types/TranscriptionCapabilities.d.ts.map +1 -0
  157. package/dist/types/src/types/{types.d.ts → defs.d.ts} +1 -1
  158. package/dist/types/src/types/defs.d.ts.map +1 -0
  159. package/dist/types/src/types/index.d.ts +3 -3
  160. package/dist/types/src/types/index.d.ts.map +1 -1
  161. package/dist/types/src/util/array.d.ts.map +1 -1
  162. package/dist/types/src/util/get-time-str.d.ts.map +1 -1
  163. package/dist/types/src/util/index.d.ts +1 -0
  164. package/dist/types/src/util/index.d.ts.map +1 -1
  165. package/dist/types/src/util/monitor-audio-level.d.ts.map +1 -1
  166. package/dist/types/src/util/render-byline.d.ts +4 -0
  167. package/dist/types/src/util/render-byline.d.ts.map +1 -0
  168. package/dist/types/tsconfig.tsbuildinfo +1 -1
  169. package/package.json +148 -82
  170. package/src/TranscriptionPlugin.node.ts +20 -0
  171. package/src/TranscriptionPlugin.test.ts +31 -0
  172. package/src/TranscriptionPlugin.tsx +22 -66
  173. package/src/blueprints/index.ts +5 -0
  174. package/src/blueprints/transcription-blueprint.ts +29 -0
  175. package/src/capabilities/blueprint-definition.ts +12 -24
  176. package/src/capabilities/index.ts +11 -7
  177. package/src/capabilities/operation-handler.ts +16 -0
  178. package/src/capabilities/react-surface.tsx +23 -14
  179. package/src/capabilities/text-content.ts +33 -0
  180. package/src/capabilities/transcriber.ts +53 -42
  181. package/src/components/{Transcript/Transcript.stories.tsx → Transcription/Transcription.stories.tsx} +62 -59
  182. package/src/components/Transcription/Transcription.tsx +64 -0
  183. package/src/components/{Transcript → Transcription}/index.ts +1 -1
  184. package/src/components/{Transcript/transcript-extension.ts → Transcription/transcription-extension.ts} +13 -9
  185. package/src/components/index.ts +1 -6
  186. package/src/containers/TranscriptionContainer/TranscriptionContainer.tsx +35 -0
  187. package/src/containers/TranscriptionContainer/index.ts +5 -0
  188. package/src/containers/index.ts +7 -0
  189. package/src/hooks/useAudioFile.ts +50 -45
  190. package/src/hooks/useQueueModelAdapter.ts +1 -1
  191. package/src/hooks/useTranscriber.ts +12 -4
  192. package/src/hooks/useVoiceInput.ts +2 -3
  193. package/src/index.ts +4 -5
  194. package/src/meta.ts +9 -6
  195. package/src/model/model.test.ts +20 -14
  196. package/src/model/model.ts +3 -3
  197. package/src/{segments-normalization → normalization}/message-normalizer.ts +19 -18
  198. package/src/{segments-normalization → normalization}/normalization.test.ts +7 -12
  199. package/src/normalization/normalization.ts +76 -0
  200. package/src/{segments-normalization → normalization}/utils.ts +2 -2
  201. package/src/operations/create.ts +24 -0
  202. package/src/operations/index.ts +11 -0
  203. package/src/operations/open.ts +28 -0
  204. package/src/operations/summarize.ts +101 -0
  205. package/src/plugin.ts +11 -0
  206. package/src/{components/stories → stories}/FileTranscription.stories.tsx +56 -43
  207. package/src/{components/stories → stories}/KeyWordRecognition.stories.tsx +36 -36
  208. package/src/{components/stories → stories}/MicrophoneTranscription.stories.tsx +60 -81
  209. package/src/stories/TranscriptionStory.tsx +93 -0
  210. package/src/testing/testing.ts +37 -37
  211. package/src/transcriber/index.ts +1 -1
  212. package/src/transcriber/media-stream-recorder.ts +3 -3
  213. package/src/transcriber/transcriber.browser.test.ts +4 -5
  214. package/src/transcriber/transcriber.test.ts +104 -0
  215. package/src/transcriber/transcriber.ts +99 -58
  216. package/src/transcriber/transcription-manager.ts +21 -15
  217. package/src/translations.ts +7 -7
  218. package/src/types/TranscriptOperation.ts +103 -0
  219. package/src/types/TranscriptionCapabilities.ts +39 -0
  220. package/src/types/index.ts +4 -3
  221. package/src/util/index.ts +1 -0
  222. package/src/util/render-byline.ts +33 -0
  223. package/dist/lib/browser/TranscriptContainer-4RBK74JP.mjs +0 -11
  224. package/dist/lib/browser/blueprint-definition-TJABB43G.mjs +0 -142
  225. package/dist/lib/browser/blueprint-definition-TJABB43G.mjs.map +0 -7
  226. package/dist/lib/browser/chunk-3X7HP44M.mjs +0 -26
  227. package/dist/lib/browser/chunk-3X7HP44M.mjs.map +0 -7
  228. package/dist/lib/browser/chunk-AGZYQGSP.mjs +0 -8
  229. package/dist/lib/browser/chunk-AGZYQGSP.mjs.map +0 -7
  230. package/dist/lib/browser/chunk-BA64VLLR.mjs.map +0 -7
  231. package/dist/lib/browser/chunk-HXVGV7T6.mjs +0 -63
  232. package/dist/lib/browser/chunk-HXVGV7T6.mjs.map +0 -7
  233. package/dist/lib/browser/chunk-TNEQFHIU.mjs +0 -16
  234. package/dist/lib/browser/chunk-TNEQFHIU.mjs.map +0 -7
  235. package/dist/lib/browser/chunk-VVXRHJCH.mjs +0 -746
  236. package/dist/lib/browser/chunk-VVXRHJCH.mjs.map +0 -7
  237. package/dist/lib/browser/index.mjs +0 -131
  238. package/dist/lib/browser/index.mjs.map +0 -7
  239. package/dist/lib/browser/intent-resolver-T3EGLS3L.mjs +0 -25
  240. package/dist/lib/browser/intent-resolver-T3EGLS3L.mjs.map +0 -7
  241. package/dist/lib/browser/meta.json +0 -1
  242. package/dist/lib/browser/react-surface-4Y3YISAD.mjs +0 -34
  243. package/dist/lib/browser/react-surface-4Y3YISAD.mjs.map +0 -7
  244. package/dist/lib/browser/transcriber-JOOAQVYV.mjs +0 -56
  245. package/dist/lib/browser/transcriber-JOOAQVYV.mjs.map +0 -7
  246. package/dist/lib/browser/types/index.mjs +0 -12
  247. package/dist/lib/node-esm/TranscriptContainer-EGAAYVOP.mjs +0 -12
  248. package/dist/lib/node-esm/blueprint-definition-R4UF7YJZ.mjs +0 -143
  249. package/dist/lib/node-esm/blueprint-definition-R4UF7YJZ.mjs.map +0 -7
  250. package/dist/lib/node-esm/chunk-3QAIZGMW.mjs +0 -17
  251. package/dist/lib/node-esm/chunk-3QAIZGMW.mjs.map +0 -7
  252. package/dist/lib/node-esm/chunk-CF5Z6FAB.mjs +0 -10
  253. package/dist/lib/node-esm/chunk-CF5Z6FAB.mjs.map +0 -7
  254. package/dist/lib/node-esm/chunk-J5GQ3KGX.mjs +0 -487
  255. package/dist/lib/node-esm/chunk-J5GQ3KGX.mjs.map +0 -7
  256. package/dist/lib/node-esm/chunk-QARUDLHN.mjs +0 -27
  257. package/dist/lib/node-esm/chunk-QARUDLHN.mjs.map +0 -7
  258. package/dist/lib/node-esm/chunk-SFQNMFHX.mjs +0 -747
  259. package/dist/lib/node-esm/chunk-SFQNMFHX.mjs.map +0 -7
  260. package/dist/lib/node-esm/chunk-W72HVQMD.mjs +0 -64
  261. package/dist/lib/node-esm/chunk-W72HVQMD.mjs.map +0 -7
  262. package/dist/lib/node-esm/index.mjs +0 -132
  263. package/dist/lib/node-esm/index.mjs.map +0 -7
  264. package/dist/lib/node-esm/intent-resolver-VDHCUAIO.mjs +0 -26
  265. package/dist/lib/node-esm/intent-resolver-VDHCUAIO.mjs.map +0 -7
  266. package/dist/lib/node-esm/meta.json +0 -1
  267. package/dist/lib/node-esm/react-surface-ZIXDGJAN.mjs +0 -35
  268. package/dist/lib/node-esm/react-surface-ZIXDGJAN.mjs.map +0 -7
  269. package/dist/lib/node-esm/transcriber-QPS55YP2.mjs.map +0 -7
  270. package/dist/lib/node-esm/types/index.mjs +0 -13
  271. package/dist/types/src/capabilities/capabilities.d.ts +0 -17
  272. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  273. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  274. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  275. package/dist/types/src/components/Transcript/Transcript.d.ts +0 -20
  276. package/dist/types/src/components/Transcript/Transcript.d.ts.map +0 -1
  277. package/dist/types/src/components/Transcript/Transcript.stories.d.ts +0 -39
  278. package/dist/types/src/components/Transcript/Transcript.stories.d.ts.map +0 -1
  279. package/dist/types/src/components/Transcript/deprecated/OldTranscript.d.ts +0 -28
  280. package/dist/types/src/components/Transcript/deprecated/OldTranscript.d.ts.map +0 -1
  281. package/dist/types/src/components/Transcript/index.d.ts +0 -2
  282. package/dist/types/src/components/Transcript/index.d.ts.map +0 -1
  283. package/dist/types/src/components/Transcript/transcript-extension.d.ts +0 -15
  284. package/dist/types/src/components/Transcript/transcript-extension.d.ts.map +0 -1
  285. package/dist/types/src/components/TranscriptContainer.d.ts +0 -9
  286. package/dist/types/src/components/TranscriptContainer.d.ts.map +0 -1
  287. package/dist/types/src/components/stories/FileTranscription.stories.d.ts.map +0 -1
  288. package/dist/types/src/components/stories/KeyWordRecognition.stories.d.ts.map +0 -1
  289. package/dist/types/src/components/stories/MicrophoneTranscription.stories.d.ts.map +0 -1
  290. package/dist/types/src/components/stories/TranscriptionStory.d.ts +0 -12
  291. package/dist/types/src/components/stories/TranscriptionStory.d.ts.map +0 -1
  292. package/dist/types/src/components/stories/useIsSpeaking.d.ts.map +0 -1
  293. package/dist/types/src/functions/index.d.ts +0 -3
  294. package/dist/types/src/functions/index.d.ts.map +0 -1
  295. package/dist/types/src/functions/open.d.ts +0 -7
  296. package/dist/types/src/functions/open.d.ts.map +0 -1
  297. package/dist/types/src/functions/summarize.d.ts +0 -11
  298. package/dist/types/src/functions/summarize.d.ts.map +0 -1
  299. package/dist/types/src/segments-normalization/index.d.ts.map +0 -1
  300. package/dist/types/src/segments-normalization/message-normalizer.d.ts.map +0 -1
  301. package/dist/types/src/segments-normalization/normalization.d.ts +0 -461
  302. package/dist/types/src/segments-normalization/normalization.d.ts.map +0 -1
  303. package/dist/types/src/segments-normalization/normalization.test.d.ts.map +0 -1
  304. package/dist/types/src/segments-normalization/utils.d.ts +0 -3
  305. package/dist/types/src/segments-normalization/utils.d.ts.map +0 -1
  306. package/dist/types/src/types/Transcript.d.ts +0 -30
  307. package/dist/types/src/types/Transcript.d.ts.map +0 -1
  308. package/dist/types/src/types/TranscriptAction.d.ts +0 -23
  309. package/dist/types/src/types/TranscriptAction.d.ts.map +0 -1
  310. package/dist/types/src/types/types.d.ts.map +0 -1
  311. package/src/capabilities/capabilities.ts +0 -33
  312. package/src/capabilities/intent-resolver.ts +0 -18
  313. package/src/components/Transcript/Transcript.tsx +0 -93
  314. package/src/components/Transcript/deprecated/OldTranscript.tsx +0 -260
  315. package/src/components/TranscriptContainer.tsx +0 -36
  316. package/src/components/stories/TranscriptionStory.tsx +0 -45
  317. package/src/functions/index.ts +0 -6
  318. package/src/functions/open.ts +0 -37
  319. package/src/functions/summarize.ts +0 -97
  320. package/src/segments-normalization/normalization.ts +0 -115
  321. package/src/types/Transcript.ts +0 -44
  322. package/src/types/TranscriptAction.ts +0 -24
  323. package/dist/lib/{browser/types → neutral/blueprints}/index.mjs.map +0 -0
  324. package/dist/lib/{browser/TranscriptContainer-4RBK74JP.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
  325. package/dist/lib/{node-esm/types → neutral/hooks}/index.mjs.map +0 -0
  326. package/dist/lib/{node-esm/TranscriptContainer-EGAAYVOP.mjs.map → neutral/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
  331. /package/src/types/{types.ts → defs.ts} +0 -0
@@ -1,747 +0,0 @@
1
- import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
2
- import {
3
- TranscriptionCapabilities
4
- } from "./chunk-3QAIZGMW.mjs";
5
-
6
- // src/components/TranscriptContainer.tsx
7
- import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
8
- import React2 from "react";
9
- import { fullyQualifiedId, getSpace } from "@dxos/client/echo";
10
- import { useMembers, useQueue } from "@dxos/react-client/echo";
11
- import { StackItem } from "@dxos/react-ui-stack";
12
-
13
- // src/hooks/useAudioFile.ts
14
- import { useEffect, useState } from "react";
15
- import { scheduleTask } from "@dxos/async";
16
- import { Context } from "@dxos/context";
17
- import { log } from "@dxos/log";
18
- var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-transcription/src/hooks/useAudioFile.ts";
19
- var useAudioFile = (audioUrl, constraints) => {
20
- const [{ audio, stream, track }, setStream] = useState({});
21
- useEffect(() => {
22
- const ctx = new Context(void 0, {
23
- F: __dxlog_file,
24
- L: 20
25
- });
26
- scheduleTask(ctx, async () => {
27
- const response = await fetch(audioUrl);
28
- const blob = await response.blob();
29
- const objectUrl = URL.createObjectURL(blob);
30
- ctx.onDispose(() => {
31
- URL.revokeObjectURL(objectUrl);
32
- });
33
- const audio2 = new Audio();
34
- audio2.src = objectUrl;
35
- await new Promise((resolve, reject) => {
36
- audio2.addEventListener("error", (err) => {
37
- log.error("error", {
38
- err
39
- }, {
40
- F: __dxlog_file,
41
- L: 37,
42
- S: void 0,
43
- C: (f, a) => f(...a)
44
- });
45
- reject(err);
46
- }, {
47
- once: true
48
- });
49
- audio2.addEventListener("canplay", async () => {
50
- resolve();
51
- }, {
52
- once: true
53
- });
54
- audio2.load();
55
- });
56
- const audioCtx = new AudioContext();
57
- if (audioCtx.state === "suspended") {
58
- await audioCtx.resume();
59
- }
60
- const destination = audioCtx.createMediaStreamDestination();
61
- destination.channelCount = 1;
62
- const source = audioCtx.createMediaElementSource(audio2);
63
- source.connect(destination);
64
- const track2 = destination.stream.getAudioTracks()[0];
65
- if (constraints) {
66
- await track2.applyConstraints(constraints).catch((err) => log.catch(err, void 0, {
67
- F: __dxlog_file,
68
- L: 66,
69
- S: void 0,
70
- C: (f, a) => f(...a)
71
- }));
72
- }
73
- setStream({
74
- audio: audio2,
75
- stream: destination.stream,
76
- track: destination.stream.getAudioTracks()[0]
77
- });
78
- });
79
- return () => {
80
- void ctx.dispose();
81
- };
82
- }, [
83
- audioUrl
84
- ]);
85
- return {
86
- audio,
87
- stream,
88
- track
89
- };
90
- };
91
-
92
- // src/hooks/useAudioTrack.ts
93
- import { useEffect as useEffect2, useState as useState2 } from "react";
94
- var useAudioTrack = (active, constraints) => {
95
- const [track, setTrack] = useState2();
96
- useEffect2(() => {
97
- if (!active) {
98
- track?.stop();
99
- setTrack(void 0);
100
- return;
101
- }
102
- const initAudio = async () => {
103
- const audio = new Audio();
104
- audio.srcObject = await navigator.mediaDevices.getUserMedia({
105
- audio: constraints ?? true
106
- });
107
- const [track2] = audio.srcObject.getAudioTracks();
108
- if (track2) {
109
- setTrack(track2);
110
- }
111
- };
112
- if (active) {
113
- void initAudio();
114
- }
115
- }, [
116
- active
117
- ]);
118
- return track;
119
- };
120
-
121
- // src/hooks/useQueueModelAdapter.ts
122
- import { useEffect as useEffect3, useMemo, useState as useState3 } from "react";
123
-
124
- // src/model/model.ts
125
- import { Text } from "@codemirror/state";
126
- import { Event } from "@dxos/async";
127
- import { invariant } from "@dxos/invariant";
128
- import { log as log2 } from "@dxos/log";
129
- function _define_property(obj, key, value) {
130
- if (key in obj) {
131
- Object.defineProperty(obj, key, {
132
- value,
133
- enumerable: true,
134
- configurable: true,
135
- writable: true
136
- });
137
- } else {
138
- obj[key] = value;
139
- }
140
- return obj;
141
- }
142
- var __dxlog_file2 = "/__w/dxos/dxos/packages/plugins/plugin-transcription/src/model/model.ts";
143
- var DocumentAdapter = class {
144
- /** The document must always have at least one line. */
145
- lineCount() {
146
- return this._view.state.doc.lines - 1;
147
- }
148
- replaceLines(from, remove, insert) {
149
- log2("replaceLines", {
150
- count: this._view.state.doc.lines,
151
- from,
152
- remove,
153
- insert
154
- }, {
155
- F: __dxlog_file2,
156
- L: 39,
157
- S: this,
158
- C: (f, a) => f(...a)
159
- });
160
- const numLines = this._view.state.doc.lines;
161
- const posFrom = this._view.state.doc.line(from).from;
162
- const posTo = remove === 0 ? posFrom : this._view.state.doc.line(Math.min(numLines, from + remove)).from;
163
- let text = insert.join("\n");
164
- if (posTo === this._view.state.doc.length) {
165
- text += "\n";
166
- }
167
- this._view.dispatch({
168
- changes: {
169
- from: posFrom,
170
- to: posTo,
171
- insert: text
172
- }
173
- });
174
- }
175
- constructor(_view) {
176
- _define_property(this, "_view", void 0);
177
- this._view = _view;
178
- }
179
- };
180
- var SerializationModel = class {
181
- toJSON() {
182
- return {
183
- chunks: this._chunks.length,
184
- changes: this._changes.length
185
- };
186
- }
187
- get doc() {
188
- return Text.of([
189
- ...this._chunks.flatMap((chunk, index) => this._renderer(chunk, index)),
190
- ""
191
- ]);
192
- }
193
- get chunks() {
194
- return this._chunks;
195
- }
196
- /**
197
- * Get the block ID at the given line number.
198
- */
199
- getChunkAtLine(line) {
200
- return this._lineToChunk.get(line);
201
- }
202
- reset() {
203
- this._chunks.length = 0;
204
- this._chunkLineCounts.clear();
205
- this._lineToChunk.clear();
206
- this.update.emit();
207
- return this;
208
- }
209
- appendChunk(chunk) {
210
- const index = this._chunks.length;
211
- this._chunks.push(chunk);
212
- this._changes.push({
213
- type: "append",
214
- index,
215
- chunk
216
- });
217
- this.update.emit();
218
- return this;
219
- }
220
- updateChunk(chunk) {
221
- const index = this._chunks.findIndex((c) => c.id === chunk.id);
222
- invariant(index !== -1, void 0, {
223
- F: __dxlog_file2,
224
- L: 147,
225
- S: this,
226
- A: [
227
- "index !== -1",
228
- ""
229
- ]
230
- });
231
- this._chunks[index] = chunk;
232
- this._changes.push({
233
- type: "update",
234
- index,
235
- chunk
236
- });
237
- this.update.emit();
238
- return this;
239
- }
240
- deleteBlock(id) {
241
- const index = this._chunks.findIndex((c) => c.id === id);
242
- invariant(index !== -1, void 0, {
243
- F: __dxlog_file2,
244
- L: 156,
245
- S: this,
246
- A: [
247
- "index !== -1",
248
- ""
249
- ]
250
- });
251
- this._chunks.splice(index, 1);
252
- this._changes.push({
253
- type: "delete",
254
- index,
255
- id
256
- });
257
- this.update.emit();
258
- return this;
259
- }
260
- /**
261
- * Syncs the tracked changes with the ChunkDocument.
262
- */
263
- sync(document2) {
264
- log2("sync", {
265
- changes: this._changes
266
- }, {
267
- F: __dxlog_file2,
268
- L: 167,
269
- S: this,
270
- C: (f, a) => f(...a)
271
- });
272
- for (const change of this._changes) {
273
- switch (change.type) {
274
- case "append": {
275
- const lines = this._renderer(change.chunk, change.index);
276
- const lastLine = document2.lineCount();
277
- document2.replaceLines(lastLine + 1, 0, lines);
278
- break;
279
- }
280
- case "update": {
281
- let lineStart = 1;
282
- for (let i = 0; i < change.index; i++) {
283
- lineStart += this._chunkLineCounts.get(this._chunks[i].id);
284
- }
285
- const previousLineCount = this._chunkLineCounts.get(change.chunk.id);
286
- const newLines = this._renderer(change.chunk, change.index);
287
- document2.replaceLines(lineStart, previousLineCount, newLines);
288
- break;
289
- }
290
- case "delete": {
291
- let lineStart = 1;
292
- for (let i = 0; i < change.index; i++) {
293
- lineStart += this._chunkLineCounts.get(this._chunks[i].id);
294
- }
295
- const previousLineCount = this._chunkLineCounts.get(change.id);
296
- document2.replaceLines(lineStart, previousLineCount, []);
297
- break;
298
- }
299
- }
300
- }
301
- this._lineToChunk.clear();
302
- let currentLine = 1;
303
- for (const [index, chunk] of this._chunks.entries()) {
304
- const lineCount = this._renderer(chunk, index).length;
305
- this._chunkLineCounts.set(chunk.id, lineCount);
306
- this._lineToChunk.set(currentLine, chunk);
307
- currentLine += lineCount;
308
- }
309
- const chunkIds = new Set(this._chunks.map((chunk) => chunk.id));
310
- for (const id of this._chunkLineCounts.keys()) {
311
- if (!chunkIds.has(id)) {
312
- this._chunkLineCounts.delete(id);
313
- }
314
- }
315
- this._changes.length = 0;
316
- return this;
317
- }
318
- constructor(_renderer, initialChunks = []) {
319
- _define_property(this, "_renderer", void 0);
320
- _define_property(this, "_chunks", void 0);
321
- _define_property(this, "_chunkLineCounts", void 0);
322
- _define_property(this, "_lineToChunk", void 0);
323
- _define_property(this, "_changes", void 0);
324
- _define_property(this, "update", void 0);
325
- this._renderer = _renderer;
326
- this._chunks = [];
327
- this._chunkLineCounts = /* @__PURE__ */ new Map();
328
- this._lineToChunk = /* @__PURE__ */ new Map();
329
- this._changes = [];
330
- this.update = new Event();
331
- initialChunks.forEach((chunk) => {
332
- this.appendChunk(chunk);
333
- });
334
- }
335
- };
336
-
337
- // src/hooks/useQueueModelAdapter.ts
338
- var useQueueModelAdapter = (renderer, queue, initialChunks = []) => {
339
- const model = useMemo(() => new SerializationModel(renderer, initialChunks), [
340
- queue
341
- ]);
342
- const [loaded, setLoaded] = useState3(false);
343
- useEffect3(() => {
344
- if (!queue) {
345
- return;
346
- }
347
- const update = () => {
348
- for (const block of queue?.objects ?? []) {
349
- model.appendChunk(block);
350
- }
351
- setLoaded(true);
352
- };
353
- let i;
354
- if (queue.isLoading) {
355
- i = setInterval(() => {
356
- if (!queue?.isLoading) {
357
- clearInterval(i);
358
- update();
359
- }
360
- }, 1e3);
361
- } else {
362
- update();
363
- }
364
- return () => clearTimeout(i);
365
- }, [
366
- model,
367
- queue
368
- ]);
369
- useEffect3(() => {
370
- if (!loaded || !queue || model.chunks.length === queue.objects.length) {
371
- return;
372
- }
373
- const chunk = queue.objects.at(-1);
374
- if (chunk) {
375
- model.appendChunk(chunk);
376
- }
377
- }, [
378
- model,
379
- loaded,
380
- queue?.objects.length
381
- ]);
382
- return model;
383
- };
384
-
385
- // src/hooks/useTranscriber.ts
386
- import { useEffect as useEffect4, useMemo as useMemo2 } from "react";
387
- import { useCapabilities } from "@dxos/app-framework";
388
-
389
- // src/capabilities/index.ts
390
- import { lazy } from "@dxos/app-framework";
391
- var BlueprintDefinition = lazy(() => import("./blueprint-definition-R4UF7YJZ.mjs"));
392
- var IntentResolver = lazy(() => import("./intent-resolver-VDHCUAIO.mjs"));
393
- var ReactSurface = lazy(() => import("./react-surface-ZIXDGJAN.mjs"));
394
- var Transcriber = lazy(() => import("./transcriber-QPS55YP2.mjs"));
395
-
396
- // src/hooks/useTranscriber.ts
397
- var useTranscriber = ({ audioStreamTrack, recorderConfig, transcriberConfig, onSegments }) => {
398
- const [getTranscriber] = useCapabilities(TranscriptionCapabilities.Transcriber);
399
- const transcriber = useMemo2(() => {
400
- if (!getTranscriber || !audioStreamTrack || !onSegments) {
401
- return void 0;
402
- }
403
- return getTranscriber({
404
- audioStreamTrack,
405
- recorderConfig,
406
- transcriberConfig,
407
- onSegments
408
- });
409
- }, [
410
- getTranscriber,
411
- audioStreamTrack,
412
- recorderConfig,
413
- transcriberConfig,
414
- onSegments
415
- ]);
416
- useEffect4(() => {
417
- return () => {
418
- void transcriber?.close();
419
- };
420
- }, [
421
- transcriber
422
- ]);
423
- return transcriber;
424
- };
425
-
426
- // src/hooks/useVoiceInput.ts
427
- import { useCallback, useEffect as useEffect5, useState as useState4 } from "react";
428
- import { scheduleMicroTask } from "@dxos/async";
429
- import { Context as Context2 } from "@dxos/context";
430
- import { log as log3 } from "@dxos/log";
431
- import { useSoundEffect } from "@dxos/react-ui-sfx";
432
- var __dxlog_file3 = "/__w/dxos/dxos/packages/plugins/plugin-transcription/src/hooks/useVoiceInput.ts";
433
- var useVoiceInput = ({ active, onUpdate }) => {
434
- const soundStart = useSoundEffect("StartRecording");
435
- const soundStop = useSoundEffect("StopRecording");
436
- const handleSegments = useCallback(async (segments) => {
437
- const text = segments.map((str) => str.text.trim().replace(/[^\w\s]/g, "")).join(" ");
438
- onUpdate(text);
439
- }, []);
440
- const [recording, setRecording] = useState4(false);
441
- const track = useAudioTrack(active);
442
- const transcriber = useTranscriber({
443
- audioStreamTrack: track,
444
- onSegments: handleSegments
445
- });
446
- useEffect5(() => {
447
- const ctx = new Context2(void 0, {
448
- F: __dxlog_file3,
449
- L: 44
450
- });
451
- scheduleMicroTask(ctx, async () => {
452
- if (active && transcriber) {
453
- await transcriber.open();
454
- log3.info("starting...", void 0, {
455
- F: __dxlog_file3,
456
- L: 48,
457
- S: void 0,
458
- C: (f, a) => f(...a)
459
- });
460
- setRecording(true);
461
- void soundStart.play();
462
- transcriber.startChunksRecording();
463
- } else if (!active && transcriber?.isOpen) {
464
- transcriber?.stopChunksRecording();
465
- await transcriber?.close();
466
- log3.info("stopped", void 0, {
467
- F: __dxlog_file3,
468
- L: 55,
469
- S: void 0,
470
- C: (f, a) => f(...a)
471
- });
472
- setRecording(false);
473
- void soundStop.play();
474
- }
475
- });
476
- return () => {
477
- void ctx.dispose();
478
- };
479
- }, [
480
- active,
481
- transcriber
482
- ]);
483
- return {
484
- recording
485
- };
486
- };
487
-
488
- // src/components/Transcript/Transcript.tsx
489
- import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
490
- import React from "react";
491
- import { useThemeContext } from "@dxos/react-ui";
492
- import { autoScroll, createBasicExtensions, createMarkdownExtensions, createThemeExtensions, decorateMarkdown, preview, useTextEditor } from "@dxos/react-ui-editor";
493
- import { mx } from "@dxos/react-ui-theme";
494
- import { isNotFalsy } from "@dxos/util";
495
-
496
- // src/components/Transcript/transcript-extension.ts
497
- import { RangeSetBuilder } from "@codemirror/state";
498
- import { EditorView, GutterMarker, ViewPlugin, gutter } from "@codemirror/view";
499
- import { format } from "date-fns/format";
500
- import { intervalToDuration } from "date-fns/intervalToDuration";
501
- import { addEventListener, combine } from "@dxos/async";
502
- function _define_property2(obj, key, value) {
503
- if (key in obj) {
504
- Object.defineProperty(obj, key, {
505
- value,
506
- enumerable: true,
507
- configurable: true,
508
- writable: true
509
- });
510
- } else {
511
- obj[key] = value;
512
- }
513
- return obj;
514
- }
515
- var transcript = ({ model, started }) => {
516
- return [
517
- // Show timestamps in the gutter.
518
- gutter({
519
- class: "cm-timestamp-gutter",
520
- lineMarkerChange: (update) => update.docChanged || update.viewportChanged,
521
- markers: (view) => {
522
- const start = getStartTime(started, model.chunks[0]);
523
- const builder = new RangeSetBuilder();
524
- for (const { from, to } of view.visibleRanges) {
525
- let line = view.state.doc.lineAt(from);
526
- while (line.from <= to) {
527
- const block = model.getChunkAtLine(line.number)?.blocks[0];
528
- const timestamp = block?._tag === "transcript" && block.started;
529
- if (timestamp) {
530
- builder.add(line.from, line.from, new TimestampMarker(line.number, new Date(timestamp), start));
531
- }
532
- if (line.to + 1 > view.state.doc.length) {
533
- break;
534
- }
535
- line = view.state.doc.lineAt(line.to + 1);
536
- }
537
- }
538
- return builder.finish();
539
- }
540
- }),
541
- // Listen for model updates.
542
- ViewPlugin.fromClass(class {
543
- update(_update) {
544
- if (!this._initialized) {
545
- this._initialized = true;
546
- setTimeout(() => {
547
- model.sync(this._adapter);
548
- });
549
- }
550
- }
551
- destroy() {
552
- this._controls?.remove();
553
- this._cleanup();
554
- }
555
- constructor(view) {
556
- _define_property2(this, "_controls", void 0);
557
- _define_property2(this, "_cleanup", void 0);
558
- _define_property2(this, "_adapter", void 0);
559
- _define_property2(this, "_initialized", false);
560
- this._adapter = new DocumentAdapter(view);
561
- const scroller = view.scrollDOM;
562
- let isAutoScrolling = false;
563
- let hasScrolled = false;
564
- let timeout;
565
- const scrollToBottom = (smooth = false) => {
566
- scroller.style.scrollBehavior = smooth ? "smooth" : "";
567
- scroller.classList.add("cm-hide-scrollbar");
568
- isAutoScrolling = true;
569
- clearTimeout(timeout);
570
- timeout = setTimeout(() => {
571
- this._controls?.classList.add("opacity-0");
572
- scroller.classList.remove("cm-hide-scrollbar");
573
- isAutoScrolling = false;
574
- }, 500);
575
- view.dispatch({
576
- effects: EditorView.scrollIntoView(view.state.doc.length, {
577
- y: "end"
578
- })
579
- });
580
- };
581
- this._cleanup = combine(addEventListener(view.scrollDOM, "scroll", () => {
582
- if (!isAutoScrolling) {
583
- hasScrolled = true;
584
- this._controls?.classList.remove("opacity-0");
585
- }
586
- }), model.update.on(() => {
587
- const autoScroll2 = scroller.scrollHeight - scroller.scrollTop - scroller.clientHeight === 0 || !hasScrolled;
588
- model.sync(this._adapter);
589
- if (autoScroll2) {
590
- scrollToBottom(true);
591
- }
592
- }));
593
- }
594
- }),
595
- EditorView.theme({
596
- ".cm-timestamp-gutter": {
597
- width: "6rem",
598
- paddingRight: "1rem"
599
- },
600
- ".cm-timestamp-gutter > .cm-gutterElement > div": {
601
- display: "inline-flex",
602
- textAlign: "right",
603
- padding: "3px"
604
- }
605
- })
606
- ];
607
- };
608
- var TimestampMarker = class extends GutterMarker {
609
- eq(other) {
610
- return other._timestamp === this._timestamp;
611
- }
612
- toDOM(view) {
613
- const el = document.createElement("div");
614
- el.className = "text-sm text-subdued hover:bg-hoverSurface cursor-pointer";
615
- el.textContent = formatTimestamp(this._timestamp, this._started);
616
- el.onclick = () => {
617
- const pos = view.state.doc.line(this._line).from;
618
- view.dispatch({
619
- effects: EditorView.scrollIntoView(pos, {
620
- y: "start"
621
- })
622
- });
623
- };
624
- return el;
625
- }
626
- constructor(_line, _timestamp, _started) {
627
- super(), _define_property2(this, "_line", void 0), _define_property2(this, "_timestamp", void 0), _define_property2(this, "_started", void 0), this._line = _line, this._timestamp = _timestamp, this._started = _started;
628
- }
629
- };
630
- var getStartTime = (started, message) => {
631
- if (started) {
632
- return started;
633
- }
634
- if (message?.blocks[0]?._tag === "transcript" && message.blocks[0].started) {
635
- return new Date(message.blocks[0].started);
636
- }
637
- return void 0;
638
- };
639
- var formatTimestamp = (timestamp, relative) => {
640
- if (relative) {
641
- const pad = (n = 0) => String(n).padStart(2, "0");
642
- const { hours, minutes, seconds } = intervalToDuration({
643
- start: relative,
644
- end: timestamp
645
- });
646
- return `${pad(hours)}:${pad(minutes)}:${pad(seconds)}`;
647
- } else {
648
- return format(timestamp, "HH:mm:ss");
649
- }
650
- };
651
-
652
- // src/components/Transcript/Transcript.tsx
653
- var renderByline = (identities) => (message, index, debug = false) => {
654
- if (message.sender.role === "assistant") {
655
- return [
656
- message.blocks.find((block) => block._tag === "transcript")?.text ?? "",
657
- ""
658
- ];
659
- }
660
- const identity = identities.find((identity2) => identity2.did === message.sender.identityDid);
661
- const name = identity?.profile?.displayName ?? message.sender.contact?.target?.fullName ?? message.sender.name ?? message.sender.email ?? message.sender.identityDid;
662
- const blocks = message.blocks.filter((block) => block._tag === "transcript");
663
- return [
664
- // TODO(thure): Use an XML tag with the bits needed here.
665
- `###### ${name}` + (debug ? ` [${index}]:${message.id}` : ""),
666
- blocks.map((block) => block.text.trim()).join(" "),
667
- ""
668
- ];
669
- };
670
- var TranscriptView = ({ classNames, space, transcript: object, model }) => {
671
- var _effect = _useSignals();
672
- try {
673
- const { themeMode } = useThemeContext();
674
- const { parentRef } = useTextEditor(() => {
675
- return {
676
- extensions: [
677
- createBasicExtensions({
678
- readOnly: true,
679
- lineWrapping: true,
680
- search: true
681
- }),
682
- createMarkdownExtensions(),
683
- createThemeExtensions({
684
- themeMode
685
- }),
686
- decorateMarkdown(),
687
- preview(),
688
- transcript({
689
- model,
690
- started: object?.started ? new Date(object.started) : void 0
691
- }),
692
- autoScroll()
693
- ].filter(isNotFalsy)
694
- };
695
- }, [
696
- space,
697
- model
698
- ]);
699
- return /* @__PURE__ */ React.createElement("div", {
700
- ref: parentRef,
701
- className: mx("flex grow overflow-hidden container-max-width", classNames),
702
- "data-popover-collision-boundary": true
703
- });
704
- } finally {
705
- _effect.f();
706
- }
707
- };
708
-
709
- // src/components/TranscriptContainer.tsx
710
- var TranscriptionContainer = ({ transcript: transcript2 }) => {
711
- var _effect = _useSignals2();
712
- try {
713
- const attendableId = fullyQualifiedId(transcript2);
714
- const space = getSpace(transcript2);
715
- const members = useMembers(space?.key).map((member) => member.identity);
716
- const queue = useQueue(transcript2.queue.dxn, {
717
- pollInterval: 1e3
718
- });
719
- const model = useQueueModelAdapter(renderByline(members), queue);
720
- return /* @__PURE__ */ React2.createElement(StackItem.Content, null, /* @__PURE__ */ React2.createElement(TranscriptView, {
721
- attendableId,
722
- space,
723
- model,
724
- transcript: transcript2
725
- }));
726
- } finally {
727
- _effect.f();
728
- }
729
- };
730
- var TranscriptContainer_default = TranscriptionContainer;
731
-
732
- export {
733
- renderByline,
734
- TranscriptView,
735
- useAudioFile,
736
- useAudioTrack,
737
- useQueueModelAdapter,
738
- useTranscriber,
739
- useVoiceInput,
740
- TranscriptionContainer,
741
- TranscriptContainer_default,
742
- BlueprintDefinition,
743
- IntentResolver,
744
- ReactSurface,
745
- Transcriber
746
- };
747
- //# sourceMappingURL=chunk-SFQNMFHX.mjs.map