@dxos/plugin-transcription 0.8.2-staging.7ac8446 → 0.8.2

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