@dxos/plugin-transcription 0.8.4-main.1da679c → 0.8.4-main.21d9917

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 (240) hide show
  1. package/dist/lib/browser/TranscriptContainer-6EHKWVS4.mjs +12 -0
  2. package/dist/lib/browser/blueprint-definition-FTRNMLJZ.mjs +18 -0
  3. package/dist/lib/browser/blueprint-definition-FTRNMLJZ.mjs.map +7 -0
  4. package/dist/lib/browser/blueprints/index.mjs +9 -0
  5. package/dist/lib/browser/chunk-HOOPZ7EM.mjs +35 -0
  6. package/dist/lib/browser/chunk-HOOPZ7EM.mjs.map +7 -0
  7. package/dist/lib/browser/{chunk-DHMLTHPB.mjs → chunk-ICM7JRCO.mjs} +159 -207
  8. package/dist/lib/browser/chunk-ICM7JRCO.mjs.map +7 -0
  9. package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
  10. package/dist/lib/browser/chunk-J5LGTIGS.mjs.map +7 -0
  11. package/dist/lib/browser/chunk-Q5OC3WVG.mjs +72 -0
  12. package/dist/lib/browser/chunk-Q5OC3WVG.mjs.map +7 -0
  13. package/dist/lib/browser/{chunk-ZNCGBPXR.mjs → chunk-SYGEFDWO.mjs} +2 -2
  14. package/dist/lib/browser/{chunk-BA64VLLR.mjs → chunk-TKFU53OZ.mjs} +60 -86
  15. package/dist/lib/browser/chunk-TKFU53OZ.mjs.map +7 -0
  16. package/dist/lib/browser/{blueprint-definition-C62MH2FL.mjs → chunk-ZZF7ICVM.mjs} +44 -36
  17. package/dist/lib/browser/chunk-ZZF7ICVM.mjs.map +7 -0
  18. package/dist/lib/browser/index.mjs +59 -73
  19. package/dist/lib/browser/index.mjs.map +4 -4
  20. package/dist/lib/browser/meta.json +1 -1
  21. package/dist/lib/browser/operation-resolver-ZUWTU7C5.mjs +22 -0
  22. package/dist/lib/browser/operation-resolver-ZUWTU7C5.mjs.map +7 -0
  23. package/dist/lib/browser/react-surface-ZXH5267I.mjs +34 -0
  24. package/dist/lib/browser/react-surface-ZXH5267I.mjs.map +7 -0
  25. package/dist/lib/browser/{transcriber-L3NQP2OM.mjs → transcriber-EZZTUCPE.mjs} +17 -13
  26. package/dist/lib/browser/transcriber-EZZTUCPE.mjs.map +7 -0
  27. package/dist/lib/browser/types/index.mjs +7 -5
  28. package/dist/lib/node-esm/{TranscriptContainer-LJLH47VF.mjs → TranscriptContainer-5YT5W73I.mjs} +5 -4
  29. package/dist/lib/node-esm/TranscriptContainer-5YT5W73I.mjs.map +7 -0
  30. package/dist/lib/node-esm/blueprint-definition-IOX35YUX.mjs +19 -0
  31. package/dist/lib/node-esm/blueprint-definition-IOX35YUX.mjs.map +7 -0
  32. package/dist/lib/node-esm/blueprints/index.mjs +10 -0
  33. package/dist/lib/node-esm/blueprints/index.mjs.map +7 -0
  34. package/dist/lib/node-esm/chunk-4BFY6P2D.mjs +73 -0
  35. package/dist/lib/node-esm/chunk-4BFY6P2D.mjs.map +7 -0
  36. package/dist/lib/node-esm/{chunk-JQARMZNW.mjs → chunk-BX2AB7S7.mjs} +159 -207
  37. package/dist/lib/node-esm/chunk-BX2AB7S7.mjs.map +7 -0
  38. package/dist/lib/node-esm/{blueprint-definition-PH3DDDHR.mjs → chunk-CWP22IHV.mjs} +44 -36
  39. package/dist/lib/node-esm/chunk-CWP22IHV.mjs.map +7 -0
  40. package/dist/lib/node-esm/{chunk-J5GQ3KGX.mjs → chunk-EPC27WWV.mjs} +60 -86
  41. package/dist/lib/node-esm/chunk-EPC27WWV.mjs.map +7 -0
  42. package/dist/lib/node-esm/{chunk-JQBXD6KX.mjs → chunk-GVAVEVZ6.mjs} +2 -2
  43. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
  44. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
  45. package/dist/lib/node-esm/chunk-NVM2QUMX.mjs +37 -0
  46. package/dist/lib/node-esm/chunk-NVM2QUMX.mjs.map +7 -0
  47. package/dist/lib/node-esm/index.mjs +59 -73
  48. package/dist/lib/node-esm/index.mjs.map +4 -4
  49. package/dist/lib/node-esm/meta.json +1 -1
  50. package/dist/lib/node-esm/operation-resolver-Z72B4H2Q.mjs +23 -0
  51. package/dist/lib/node-esm/operation-resolver-Z72B4H2Q.mjs.map +7 -0
  52. package/dist/lib/node-esm/react-surface-6GUBZX2V.mjs +35 -0
  53. package/dist/lib/node-esm/react-surface-6GUBZX2V.mjs.map +7 -0
  54. package/dist/lib/node-esm/{transcriber-KJX4U74D.mjs → transcriber-RGW3YYT4.mjs} +17 -13
  55. package/dist/lib/node-esm/transcriber-RGW3YYT4.mjs.map +7 -0
  56. package/dist/lib/node-esm/types/index.mjs +7 -5
  57. package/dist/types/src/TranscriptionPlugin.d.ts +2 -1
  58. package/dist/types/src/TranscriptionPlugin.d.ts.map +1 -1
  59. package/dist/types/src/blueprints/index.d.ts +2 -0
  60. package/dist/types/src/blueprints/index.d.ts.map +1 -0
  61. package/dist/types/src/blueprints/transcription-blueprint.d.ts +21 -0
  62. package/dist/types/src/blueprints/transcription-blueprint.d.ts.map +1 -0
  63. package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +9 -0
  64. package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +1 -0
  65. package/dist/types/src/capabilities/blueprint-definition/index.d.ts +3 -0
  66. package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +1 -0
  67. package/dist/types/src/capabilities/index.d.ts +4 -5
  68. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  69. package/dist/types/src/capabilities/operation-handler/index.d.ts +3 -0
  70. package/dist/types/src/capabilities/operation-handler/index.d.ts.map +1 -0
  71. package/dist/types/src/capabilities/operation-handler/operation-handler.d.ts +5 -0
  72. package/dist/types/src/capabilities/operation-handler/operation-handler.d.ts.map +1 -0
  73. package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
  74. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
  75. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
  76. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
  77. package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
  78. package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
  79. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
  80. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
  81. package/dist/types/src/capabilities/transcriber/index.d.ts +3 -0
  82. package/dist/types/src/capabilities/transcriber/index.d.ts.map +1 -0
  83. package/dist/types/src/capabilities/transcriber/transcriber.d.ts +9 -0
  84. package/dist/types/src/capabilities/transcriber/transcriber.d.ts.map +1 -0
  85. package/dist/types/src/components/Transcript/Transcript.d.ts +5 -8
  86. package/dist/types/src/components/Transcript/Transcript.d.ts.map +1 -1
  87. package/dist/types/src/components/Transcript/Transcript.stories.d.ts +5 -4
  88. package/dist/types/src/components/Transcript/Transcript.stories.d.ts.map +1 -1
  89. package/dist/types/src/components/Transcript/deprecated/OldTranscript.d.ts +10 -10
  90. package/dist/types/src/components/Transcript/deprecated/OldTranscript.d.ts.map +1 -1
  91. package/dist/types/src/components/Transcript/transcript-extension.d.ts +2 -2
  92. package/dist/types/src/components/Transcript/transcript-extension.d.ts.map +1 -1
  93. package/dist/types/src/components/TranscriptContainer.d.ts +4 -6
  94. package/dist/types/src/components/TranscriptContainer.d.ts.map +1 -1
  95. package/dist/types/src/components/index.d.ts +1 -1
  96. package/dist/types/src/components/index.d.ts.map +1 -1
  97. package/dist/types/src/components/stories/FileTranscription.stories.d.ts +3 -4
  98. package/dist/types/src/components/stories/FileTranscription.stories.d.ts.map +1 -1
  99. package/dist/types/src/components/stories/KeyWordRecognition.stories.d.ts +0 -1
  100. package/dist/types/src/components/stories/KeyWordRecognition.stories.d.ts.map +1 -1
  101. package/dist/types/src/components/stories/MicrophoneTranscription.stories.d.ts +3 -4
  102. package/dist/types/src/components/stories/MicrophoneTranscription.stories.d.ts.map +1 -1
  103. package/dist/types/src/components/stories/TranscriptionStory.d.ts +3 -3
  104. package/dist/types/src/components/stories/TranscriptionStory.d.ts.map +1 -1
  105. package/dist/types/src/functions/open.d.ts +1 -1
  106. package/dist/types/src/functions/open.d.ts.map +1 -1
  107. package/dist/types/src/functions/summarize.d.ts +1 -1
  108. package/dist/types/src/functions/summarize.d.ts.map +1 -1
  109. package/dist/types/src/hooks/useAudioFile.d.ts.map +1 -1
  110. package/dist/types/src/hooks/useQueueModelAdapter.d.ts +1 -1
  111. package/dist/types/src/hooks/useQueueModelAdapter.d.ts.map +1 -1
  112. package/dist/types/src/hooks/useTranscriber.d.ts +1 -1
  113. package/dist/types/src/hooks/useTranscriber.d.ts.map +1 -1
  114. package/dist/types/src/index.d.ts +1 -1
  115. package/dist/types/src/index.d.ts.map +1 -1
  116. package/dist/types/src/meta.d.ts +2 -3
  117. package/dist/types/src/meta.d.ts.map +1 -1
  118. package/dist/types/src/segments-normalization/message-normalizer.d.ts +5 -5
  119. package/dist/types/src/segments-normalization/message-normalizer.d.ts.map +1 -1
  120. package/dist/types/src/segments-normalization/normalization.d.ts +503 -443
  121. package/dist/types/src/segments-normalization/normalization.d.ts.map +1 -1
  122. package/dist/types/src/segments-normalization/utils.d.ts +2 -2
  123. package/dist/types/src/segments-normalization/utils.d.ts.map +1 -1
  124. package/dist/types/src/testing/testing.d.ts +10 -10
  125. package/dist/types/src/testing/testing.d.ts.map +1 -1
  126. package/dist/types/src/transcriber/media-stream-recorder.d.ts +2 -2
  127. package/dist/types/src/transcriber/media-stream-recorder.d.ts.map +1 -1
  128. package/dist/types/src/transcriber/transcriber.d.ts +4 -4
  129. package/dist/types/src/transcriber/transcriber.d.ts.map +1 -1
  130. package/dist/types/src/transcriber/transcription-manager.d.ts +9 -6
  131. package/dist/types/src/transcriber/transcription-manager.d.ts.map +1 -1
  132. package/dist/types/src/types/TranscriptAction.d.ts +23 -21
  133. package/dist/types/src/types/TranscriptAction.d.ts.map +1 -1
  134. package/dist/types/src/types/capabilities.d.ts +18 -0
  135. package/dist/types/src/types/capabilities.d.ts.map +1 -0
  136. package/dist/types/src/types/index.d.ts +2 -1
  137. package/dist/types/src/types/index.d.ts.map +1 -1
  138. package/dist/types/src/util/index.d.ts +1 -0
  139. package/dist/types/src/util/index.d.ts.map +1 -1
  140. package/dist/types/src/util/render-byline.d.ts +4 -0
  141. package/dist/types/src/util/render-byline.d.ts.map +1 -0
  142. package/dist/types/tsconfig.tsbuildinfo +1 -1
  143. package/package.json +84 -71
  144. package/src/TranscriptionPlugin.tsx +38 -62
  145. package/src/blueprints/index.ts +5 -0
  146. package/src/blueprints/transcription-blueprint.ts +25 -0
  147. package/src/capabilities/blueprint-definition/blueprint-definition.ts +23 -0
  148. package/src/capabilities/blueprint-definition/index.ts +7 -0
  149. package/src/capabilities/index.ts +4 -8
  150. package/src/capabilities/operation-handler/index.ts +7 -0
  151. package/src/capabilities/operation-handler/operation-handler.ts +25 -0
  152. package/src/capabilities/operation-resolver/index.ts +7 -0
  153. package/src/capabilities/operation-resolver/operation-resolver.ts +25 -0
  154. package/src/capabilities/react-surface/index.ts +7 -0
  155. package/src/capabilities/react-surface/react-surface.tsx +27 -0
  156. package/src/capabilities/transcriber/index.ts +7 -0
  157. package/src/capabilities/transcriber/transcriber.ts +85 -0
  158. package/src/components/Transcript/Transcript.stories.tsx +39 -39
  159. package/src/components/Transcript/Transcript.tsx +13 -40
  160. package/src/components/Transcript/deprecated/OldTranscript.tsx +7 -7
  161. package/src/components/Transcript/transcript-extension.ts +10 -6
  162. package/src/components/TranscriptContainer.tsx +15 -17
  163. package/src/components/stories/FileTranscription.stories.tsx +31 -35
  164. package/src/components/stories/KeyWordRecognition.stories.tsx +5 -7
  165. package/src/components/stories/MicrophoneTranscription.stories.tsx +51 -54
  166. package/src/components/stories/TranscriptionStory.tsx +8 -12
  167. package/src/functions/open.ts +10 -8
  168. package/src/functions/summarize.ts +10 -4
  169. package/src/hooks/useAudioFile.ts +50 -45
  170. package/src/hooks/useQueueModelAdapter.ts +1 -1
  171. package/src/hooks/useTranscriber.ts +8 -3
  172. package/src/hooks/useVoiceInput.ts +2 -2
  173. package/src/index.ts +1 -1
  174. package/src/meta.ts +9 -6
  175. package/src/model/model.test.ts +20 -14
  176. package/src/segments-normalization/message-normalizer.ts +18 -13
  177. package/src/segments-normalization/normalization.test.ts +6 -11
  178. package/src/segments-normalization/normalization.ts +7 -7
  179. package/src/segments-normalization/utils.ts +2 -2
  180. package/src/testing/testing.ts +30 -20
  181. package/src/transcriber/media-stream-recorder.ts +3 -3
  182. package/src/transcriber/transcriber.browser.test.ts +4 -4
  183. package/src/transcriber/transcriber.ts +6 -6
  184. package/src/transcriber/transcription-manager.ts +21 -15
  185. package/src/types/TranscriptAction.ts +22 -14
  186. package/src/types/capabilities.ts +33 -0
  187. package/src/types/index.ts +2 -1
  188. package/src/util/index.ts +1 -0
  189. package/src/util/render-byline.ts +33 -0
  190. package/dist/lib/browser/TranscriptContainer-W6CHJPIB.mjs +0 -11
  191. package/dist/lib/browser/blueprint-definition-C62MH2FL.mjs.map +0 -7
  192. package/dist/lib/browser/chunk-3X7HP44M.mjs +0 -26
  193. package/dist/lib/browser/chunk-3X7HP44M.mjs.map +0 -7
  194. package/dist/lib/browser/chunk-BA64VLLR.mjs.map +0 -7
  195. package/dist/lib/browser/chunk-DHMLTHPB.mjs.map +0 -7
  196. package/dist/lib/browser/chunk-HXVGV7T6.mjs +0 -63
  197. package/dist/lib/browser/chunk-HXVGV7T6.mjs.map +0 -7
  198. package/dist/lib/browser/chunk-TNEQFHIU.mjs +0 -16
  199. package/dist/lib/browser/chunk-TNEQFHIU.mjs.map +0 -7
  200. package/dist/lib/browser/intent-resolver-LKRGWUX2.mjs +0 -25
  201. package/dist/lib/browser/intent-resolver-LKRGWUX2.mjs.map +0 -7
  202. package/dist/lib/browser/react-surface-2AGVHCYU.mjs +0 -34
  203. package/dist/lib/browser/react-surface-2AGVHCYU.mjs.map +0 -7
  204. package/dist/lib/browser/transcriber-L3NQP2OM.mjs.map +0 -7
  205. package/dist/lib/node-esm/blueprint-definition-PH3DDDHR.mjs.map +0 -7
  206. package/dist/lib/node-esm/chunk-3QAIZGMW.mjs +0 -17
  207. package/dist/lib/node-esm/chunk-3QAIZGMW.mjs.map +0 -7
  208. package/dist/lib/node-esm/chunk-J5GQ3KGX.mjs.map +0 -7
  209. package/dist/lib/node-esm/chunk-JQARMZNW.mjs.map +0 -7
  210. package/dist/lib/node-esm/chunk-QARUDLHN.mjs +0 -27
  211. package/dist/lib/node-esm/chunk-QARUDLHN.mjs.map +0 -7
  212. package/dist/lib/node-esm/chunk-W72HVQMD.mjs +0 -64
  213. package/dist/lib/node-esm/chunk-W72HVQMD.mjs.map +0 -7
  214. package/dist/lib/node-esm/intent-resolver-AGLWBOCO.mjs +0 -26
  215. package/dist/lib/node-esm/intent-resolver-AGLWBOCO.mjs.map +0 -7
  216. package/dist/lib/node-esm/react-surface-HPQQ3WIF.mjs +0 -35
  217. package/dist/lib/node-esm/react-surface-HPQQ3WIF.mjs.map +0 -7
  218. package/dist/lib/node-esm/transcriber-KJX4U74D.mjs.map +0 -7
  219. package/dist/types/src/capabilities/blueprint-definition.d.ts +0 -5
  220. package/dist/types/src/capabilities/blueprint-definition.d.ts.map +0 -1
  221. package/dist/types/src/capabilities/capabilities.d.ts +0 -17
  222. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  223. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  224. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  225. package/dist/types/src/capabilities/react-surface.d.ts +0 -4
  226. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  227. package/dist/types/src/capabilities/transcriber.d.ts +0 -8
  228. package/dist/types/src/capabilities/transcriber.d.ts.map +0 -1
  229. package/dist/types/src/types/Transcript.d.ts +0 -30
  230. package/dist/types/src/types/Transcript.d.ts.map +0 -1
  231. package/src/capabilities/blueprint-definition.ts +0 -31
  232. package/src/capabilities/capabilities.ts +0 -33
  233. package/src/capabilities/intent-resolver.ts +0 -18
  234. package/src/capabilities/react-surface.tsx +0 -22
  235. package/src/capabilities/transcriber.ts +0 -77
  236. package/src/types/Transcript.ts +0 -44
  237. /package/dist/lib/browser/{TranscriptContainer-W6CHJPIB.mjs.map → TranscriptContainer-6EHKWVS4.mjs.map} +0 -0
  238. /package/dist/lib/{node-esm/TranscriptContainer-LJLH47VF.mjs.map → browser/blueprints/index.mjs.map} +0 -0
  239. /package/dist/lib/browser/{chunk-ZNCGBPXR.mjs.map → chunk-SYGEFDWO.mjs.map} +0 -0
  240. /package/dist/lib/node-esm/{chunk-JQBXD6KX.mjs.map → chunk-GVAVEVZ6.mjs.map} +0 -0
@@ -0,0 +1,12 @@
1
+ import {
2
+ TranscriptContainer_default,
3
+ TranscriptionContainer
4
+ } from "./chunk-ICM7JRCO.mjs";
5
+ import "./chunk-HOOPZ7EM.mjs";
6
+ import "./chunk-Q5OC3WVG.mjs";
7
+ import "./chunk-J5LGTIGS.mjs";
8
+ export {
9
+ TranscriptionContainer,
10
+ TranscriptContainer_default as default
11
+ };
12
+ //# sourceMappingURL=TranscriptContainer-6EHKWVS4.mjs.map
@@ -0,0 +1,18 @@
1
+ import {
2
+ transcription_blueprint_exports
3
+ } from "./chunk-ZZF7ICVM.mjs";
4
+ import "./chunk-HOOPZ7EM.mjs";
5
+ import "./chunk-J5LGTIGS.mjs";
6
+
7
+ // src/capabilities/blueprint-definition/blueprint-definition.ts
8
+ import * as Effect from "effect/Effect";
9
+ import { Capability, Common } from "@dxos/app-framework";
10
+ var blueprintDefinition = Capability.makeModule(() => Effect.succeed([
11
+ Capability.contributes(Common.Capability.Functions, transcription_blueprint_exports.functions),
12
+ Capability.contributes(Common.Capability.BlueprintDefinition, transcription_blueprint_exports.make())
13
+ ]));
14
+ var blueprint_definition_default = blueprintDefinition;
15
+ export {
16
+ blueprint_definition_default as default
17
+ };
18
+ //# sourceMappingURL=blueprint-definition-FTRNMLJZ.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/capabilities/blueprint-definition/blueprint-definition.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability, Common } from '@dxos/app-framework';\n\nimport { TranscriptionBlueprint } from '../../blueprints';\n\nexport type BlueprintCapabilities = [\n Capability.Capability<typeof Common.Capability.Functions>,\n Capability.Capability<typeof Common.Capability.BlueprintDefinition>,\n];\n\nconst blueprintDefinition = Capability.makeModule<[], BlueprintCapabilities>(() =>\n Effect.succeed([\n Capability.contributes(Common.Capability.Functions, TranscriptionBlueprint.functions),\n Capability.contributes(Common.Capability.BlueprintDefinition, TranscriptionBlueprint.make()),\n ]),\n);\n\nexport default blueprintDefinition;\n"],
5
+ "mappings": ";;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,YAAYC,cAAc;AASnC,IAAMC,sBAAsBC,WAAWC,WAAsC,MACpEC,eAAQ;EACbF,WAAWG,YAAYC,OAAOJ,WAAWK,WAAWC,gCAAuBC,SAAS;EACpFP,WAAWG,YAAYC,OAAOJ,WAAWQ,qBAAqBF,gCAAuBG,KAAI,CAAA;CAC1F,CAAA;AAGH,IAAA,+BAAeV;",
6
+ "names": ["Effect", "Capability", "Common", "blueprintDefinition", "Capability", "makeModule", "succeed", "contributes", "Common", "Functions", "TranscriptionBlueprint", "functions", "BlueprintDefinition", "make"]
7
+ }
@@ -0,0 +1,9 @@
1
+ import {
2
+ transcription_blueprint_exports
3
+ } from "../chunk-ZZF7ICVM.mjs";
4
+ import "../chunk-HOOPZ7EM.mjs";
5
+ import "../chunk-J5LGTIGS.mjs";
6
+ export {
7
+ transcription_blueprint_exports as TranscriptionBlueprint
8
+ };
9
+ //# sourceMappingURL=index.mjs.map
@@ -0,0 +1,35 @@
1
+ // src/util/render-byline.ts
2
+ var renderByline = (identities) => (message, index, debug = false) => {
3
+ if (message.sender.role === "assistant") {
4
+ return [
5
+ message.blocks.find((block) => block._tag === "transcript")?.text ?? "",
6
+ ""
7
+ ];
8
+ }
9
+ const identity = identities.find((identity2) => identity2.did === message.sender.identityDid);
10
+ const name = identity?.profile?.displayName ?? message.sender.contact?.target?.fullName ?? message.sender.name ?? message.sender.email ?? message.sender.identityDid;
11
+ const blocks = message.blocks.filter((block) => block._tag === "transcript");
12
+ return [
13
+ // TODO(thure): Use an XML tag with the bits needed here.
14
+ `###### ${name}` + (debug ? ` [${index}]:${message.id}` : ""),
15
+ blocks.map((block) => block.text.trim()).join(" "),
16
+ ""
17
+ ];
18
+ };
19
+
20
+ // src/util/array.ts
21
+ var mergeFloat64Arrays = (arrays) => {
22
+ const newArray = new Float64Array(arrays.reduce((acc, array) => array.length + acc, 0));
23
+ let offset = 0;
24
+ for (const array of arrays) {
25
+ newArray.set(array, offset);
26
+ offset += array.length;
27
+ }
28
+ return newArray;
29
+ };
30
+
31
+ export {
32
+ mergeFloat64Arrays,
33
+ renderByline
34
+ };
35
+ //# sourceMappingURL=chunk-HOOPZ7EM.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/util/render-byline.ts", "../../../src/util/array.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type Identity } from '@dxos/react-client/halo';\nimport { type Message } from '@dxos/types';\n\n// TODO(thure): Move this?\nexport const renderByline =\n (identities: Identity[]) =>\n (message: Message.Message, index: number, debug = false): string[] => {\n if (message.sender.role === 'assistant') {\n // Start/stop block.\n return [message.blocks.find((block) => block._tag === 'transcript')?.text ?? '', ''];\n }\n\n // TODO(burdon): Use link/reference markup for users (with popover).\n // TODO(burdon): Color and avatar.\n const identity = identities.find((identity) => identity.did === message.sender.identityDid);\n const name =\n identity?.profile?.displayName ??\n message.sender.contact?.target?.fullName ??\n message.sender.name ??\n message.sender.email ??\n message.sender.identityDid;\n const blocks = message.blocks.filter((block) => block._tag === 'transcript');\n return [\n // TODO(thure): Use an XML tag with the bits needed here.\n `###### ${name}` + (debug ? ` [${index}]:${message.id}` : ''),\n blocks.map((block) => block.text.trim()).join(' '),\n '',\n ];\n };\n", "//\n// Copyright 2025 DXOS.org\n//\n\nexport const mergeFloat64Arrays = (arrays: Float64Array[]) => {\n const newArray = new Float64Array(arrays.reduce((acc, array) => array.length + acc, 0));\n let offset = 0;\n for (const array of arrays) {\n newArray.set(array, offset);\n offset += array.length;\n }\n\n return newArray;\n};\n"],
5
+ "mappings": ";AAQO,IAAMA,eACX,CAACC,eACD,CAACC,SAA0BC,OAAeC,QAAQ,UAAK;AACrD,MAAIF,QAAQG,OAAOC,SAAS,aAAa;AAEvC,WAAO;MAACJ,QAAQK,OAAOC,KAAK,CAACC,UAAUA,MAAMC,SAAS,YAAA,GAAeC,QAAQ;MAAI;;EACnF;AAIA,QAAMC,WAAWX,WAAWO,KAAK,CAACI,cAAaA,UAASC,QAAQX,QAAQG,OAAOS,WAAW;AAC1F,QAAMC,OACJH,UAAUI,SAASC,eACnBf,QAAQG,OAAOa,SAASC,QAAQC,YAChClB,QAAQG,OAAOU,QACfb,QAAQG,OAAOgB,SACfnB,QAAQG,OAAOS;AACjB,QAAMP,SAASL,QAAQK,OAAOe,OAAO,CAACb,UAAUA,MAAMC,SAAS,YAAA;AAC/D,SAAO;;IAEL,UAAUK,IAAAA,MAAUX,QAAQ,KAAKD,KAAAA,KAAUD,QAAQqB,EAAE,KAAK;IAC1DhB,OAAOiB,IAAI,CAACf,UAAUA,MAAME,KAAKc,KAAI,CAAA,EAAIC,KAAK,GAAA;IAC9C;;AAEJ;;;AC5BK,IAAMC,qBAAqB,CAACC,WAAAA;AACjC,QAAMC,WAAW,IAAIC,aAAaF,OAAOG,OAAO,CAACC,KAAKC,UAAUA,MAAMC,SAASF,KAAK,CAAA,CAAA;AACpF,MAAIG,SAAS;AACb,aAAWF,SAASL,QAAQ;AAC1BC,aAASO,IAAIH,OAAOE,MAAAA;AACpBA,cAAUF,MAAMC;EAClB;AAEA,SAAOL;AACT;",
6
+ "names": ["renderByline", "identities", "message", "index", "debug", "sender", "role", "blocks", "find", "block", "_tag", "text", "identity", "did", "identityDid", "name", "profile", "displayName", "contact", "target", "fullName", "email", "filter", "id", "map", "trim", "join", "mergeFloat64Arrays", "arrays", "newArray", "Float64Array", "reduce", "acc", "array", "length", "offset", "set"]
7
+ }
@@ -1,13 +1,15 @@
1
+ import {
2
+ renderByline
3
+ } from "./chunk-HOOPZ7EM.mjs";
1
4
  import {
2
5
  TranscriptionCapabilities
3
- } from "./chunk-TNEQFHIU.mjs";
6
+ } from "./chunk-Q5OC3WVG.mjs";
4
7
 
5
8
  // src/components/TranscriptContainer.tsx
6
- import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
7
9
  import React2 from "react";
8
- import { fullyQualifiedId, getSpace } from "@dxos/client/echo";
10
+ import { Obj } from "@dxos/echo";
9
11
  import { useMembers, useQueue } from "@dxos/react-client/echo";
10
- import { StackItem } from "@dxos/react-ui-stack";
12
+ import { Layout } from "@dxos/react-ui-mosaic";
11
13
 
12
14
  // src/hooks/useAudioFile.ts
13
15
  import { useEffect, useState } from "react";
@@ -23,57 +25,66 @@ var useAudioFile = (audioUrl, constraints) => {
23
25
  L: 20
24
26
  });
25
27
  scheduleTask(ctx, async () => {
26
- const response = await fetch(audioUrl);
27
- const blob = await response.blob();
28
- const objectUrl = URL.createObjectURL(blob);
29
- ctx.onDispose(() => {
30
- URL.revokeObjectURL(objectUrl);
31
- });
32
- const audio2 = new Audio();
33
- audio2.src = objectUrl;
34
- await new Promise((resolve, reject) => {
35
- audio2.addEventListener("error", (err) => {
36
- log.error("error", {
37
- err
28
+ try {
29
+ const response = await fetch(audioUrl);
30
+ const blob = await response.blob();
31
+ const objectUrl = URL.createObjectURL(blob);
32
+ ctx.onDispose(() => {
33
+ URL.revokeObjectURL(objectUrl);
34
+ });
35
+ const audio2 = new Audio();
36
+ audio2.src = objectUrl;
37
+ await new Promise((resolve, reject) => {
38
+ audio2.addEventListener("error", (err) => {
39
+ log.error("error", {
40
+ err
41
+ }, {
42
+ F: __dxlog_file,
43
+ L: 39,
44
+ S: void 0,
45
+ C: (f, a) => f(...a)
46
+ });
47
+ reject(err);
38
48
  }, {
49
+ once: true
50
+ });
51
+ audio2.addEventListener("canplay", async () => {
52
+ resolve();
53
+ }, {
54
+ once: true
55
+ });
56
+ audio2.load();
57
+ });
58
+ const audioCtx = new AudioContext();
59
+ if (audioCtx.state === "suspended") {
60
+ await audioCtx.resume();
61
+ }
62
+ const destination = audioCtx.createMediaStreamDestination();
63
+ destination.channelCount = 1;
64
+ const source = audioCtx.createMediaElementSource(audio2);
65
+ source.connect(destination);
66
+ const track2 = destination.stream.getAudioTracks()[0];
67
+ if (constraints) {
68
+ await track2.applyConstraints(constraints).catch((err) => log.catch(err, void 0, {
39
69
  F: __dxlog_file,
40
- L: 37,
70
+ L: 68,
41
71
  S: void 0,
42
72
  C: (f, a) => f(...a)
43
- });
44
- reject(err);
45
- }, {
46
- once: true
47
- });
48
- audio2.addEventListener("canplay", async () => {
49
- resolve();
50
- }, {
51
- once: true
73
+ }));
74
+ }
75
+ setStream({
76
+ audio: audio2,
77
+ stream: destination.stream,
78
+ track: destination.stream.getAudioTracks()[0]
52
79
  });
53
- audio2.load();
54
- });
55
- const audioCtx = new AudioContext();
56
- if (audioCtx.state === "suspended") {
57
- await audioCtx.resume();
58
- }
59
- const destination = audioCtx.createMediaStreamDestination();
60
- destination.channelCount = 1;
61
- const source = audioCtx.createMediaElementSource(audio2);
62
- source.connect(destination);
63
- const track2 = destination.stream.getAudioTracks()[0];
64
- if (constraints) {
65
- await track2.applyConstraints(constraints).catch((err) => log.catch(err, void 0, {
80
+ } catch (err) {
81
+ log.catch(err, void 0, {
66
82
  F: __dxlog_file,
67
- L: 66,
83
+ L: 78,
68
84
  S: void 0,
69
85
  C: (f, a) => f(...a)
70
- }));
86
+ });
71
87
  }
72
- setStream({
73
- audio: audio2,
74
- stream: destination.stream,
75
- track: destination.stream.getAudioTracks()[0]
76
- });
77
88
  });
78
89
  return () => {
79
90
  void ctx.dispose();
@@ -125,21 +136,12 @@ import { Text } from "@codemirror/state";
125
136
  import { Event } from "@dxos/async";
126
137
  import { invariant } from "@dxos/invariant";
127
138
  import { log as log2 } from "@dxos/log";
128
- function _define_property(obj, key, value) {
129
- if (key in obj) {
130
- Object.defineProperty(obj, key, {
131
- value,
132
- enumerable: true,
133
- configurable: true,
134
- writable: true
135
- });
136
- } else {
137
- obj[key] = value;
138
- }
139
- return obj;
140
- }
141
139
  var __dxlog_file2 = "/__w/dxos/dxos/packages/plugins/plugin-transcription/src/model/model.ts";
142
140
  var DocumentAdapter = class {
141
+ _view;
142
+ constructor(_view) {
143
+ this._view = _view;
144
+ }
143
145
  /** The document must always have at least one line. */
144
146
  lineCount() {
145
147
  return this._view.state.doc.lines - 1;
@@ -171,12 +173,25 @@ var DocumentAdapter = class {
171
173
  }
172
174
  });
173
175
  }
174
- constructor(_view) {
175
- _define_property(this, "_view", void 0);
176
- this._view = _view;
177
- }
178
176
  };
179
177
  var SerializationModel = class {
178
+ _renderer;
179
+ /** Ordered set of chunks. */
180
+ _chunks = [];
181
+ /** Map of chunk IDs to their current line counts. */
182
+ _chunkLineCounts = /* @__PURE__ */ new Map();
183
+ /** Map of line numbers to chunk IDs. */
184
+ _lineToChunk = /* @__PURE__ */ new Map();
185
+ /** Track chunk changes since last sync. */
186
+ _changes = [];
187
+ /** Emits when the document is updated. */
188
+ update = new Event();
189
+ constructor(_renderer, initialChunks = []) {
190
+ this._renderer = _renderer;
191
+ initialChunks.forEach((chunk) => {
192
+ this.appendChunk(chunk);
193
+ });
194
+ }
180
195
  toJSON() {
181
196
  return {
182
197
  chunks: this._chunks.length,
@@ -314,23 +329,6 @@ var SerializationModel = class {
314
329
  this._changes.length = 0;
315
330
  return this;
316
331
  }
317
- constructor(_renderer, initialChunks = []) {
318
- _define_property(this, "_renderer", void 0);
319
- _define_property(this, "_chunks", void 0);
320
- _define_property(this, "_chunkLineCounts", void 0);
321
- _define_property(this, "_lineToChunk", void 0);
322
- _define_property(this, "_changes", void 0);
323
- _define_property(this, "update", void 0);
324
- this._renderer = _renderer;
325
- this._chunks = [];
326
- this._chunkLineCounts = /* @__PURE__ */ new Map();
327
- this._lineToChunk = /* @__PURE__ */ new Map();
328
- this._changes = [];
329
- this.update = new Event();
330
- initialChunks.forEach((chunk) => {
331
- this.appendChunk(chunk);
332
- });
333
- }
334
332
  };
335
333
 
336
334
  // src/hooks/useQueueModelAdapter.ts
@@ -383,16 +381,7 @@ var useQueueModelAdapter = (renderer, queue, initialChunks = []) => {
383
381
 
384
382
  // src/hooks/useTranscriber.ts
385
383
  import { useEffect as useEffect4, useMemo as useMemo2 } from "react";
386
- import { useCapabilities } from "@dxos/app-framework";
387
-
388
- // src/capabilities/index.ts
389
- import { lazy } from "@dxos/app-framework";
390
- var BlueprintDefinition = lazy(() => import("./blueprint-definition-C62MH2FL.mjs"));
391
- var IntentResolver = lazy(() => import("./intent-resolver-LKRGWUX2.mjs"));
392
- var ReactSurface = lazy(() => import("./react-surface-2AGVHCYU.mjs"));
393
- var Transcriber = lazy(() => import("./transcriber-L3NQP2OM.mjs"));
394
-
395
- // src/hooks/useTranscriber.ts
384
+ import { useCapabilities } from "@dxos/app-framework/react";
396
385
  var useTranscriber = ({ audioStreamTrack, recorderConfig, transcriberConfig, onSegments }) => {
397
386
  const [getTranscriber] = useCapabilities(TranscriptionCapabilities.Transcriber);
398
387
  const transcriber = useMemo2(() => {
@@ -485,12 +474,12 @@ var useVoiceInput = ({ active, onUpdate }) => {
485
474
  };
486
475
 
487
476
  // src/components/Transcript/Transcript.tsx
488
- import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
489
477
  import React from "react";
490
478
  import { useThemeContext } from "@dxos/react-ui";
491
- import { autoScroll, createBasicExtensions, createMarkdownExtensions, createThemeExtensions, decorateMarkdown, preview, useTextEditor } from "@dxos/react-ui-editor";
492
- import { mx } from "@dxos/react-ui-theme";
493
- import { isNotFalsy } from "@dxos/util";
479
+ import { useTextEditor } from "@dxos/react-ui-editor";
480
+ import { autoScroll, createBasicExtensions, createMarkdownExtensions, createThemeExtensions, decorateMarkdown, editorSlots, preview } from "@dxos/ui-editor";
481
+ import { mx } from "@dxos/ui-theme";
482
+ import { isTruthy } from "@dxos/util";
494
483
 
495
484
  // src/components/Transcript/transcript-extension.ts
496
485
  import { RangeSetBuilder } from "@codemirror/state";
@@ -498,19 +487,6 @@ import { EditorView, GutterMarker, ViewPlugin, gutter } from "@codemirror/view";
498
487
  import { format } from "date-fns/format";
499
488
  import { intervalToDuration } from "date-fns/intervalToDuration";
500
489
  import { addEventListener, combine } from "@dxos/async";
501
- function _define_property2(obj, key, value) {
502
- if (key in obj) {
503
- Object.defineProperty(obj, key, {
504
- value,
505
- enumerable: true,
506
- configurable: true,
507
- writable: true
508
- });
509
- } else {
510
- obj[key] = value;
511
- }
512
- return obj;
513
- }
514
490
  var transcript = ({ model, started }) => {
515
491
  return [
516
492
  // Show timestamps in the gutter.
@@ -539,23 +515,11 @@ var transcript = ({ model, started }) => {
539
515
  }),
540
516
  // Listen for model updates.
541
517
  ViewPlugin.fromClass(class {
542
- update(_update) {
543
- if (!this._initialized) {
544
- this._initialized = true;
545
- setTimeout(() => {
546
- model.sync(this._adapter);
547
- });
548
- }
549
- }
550
- destroy() {
551
- this._controls?.remove();
552
- this._cleanup();
553
- }
518
+ _controls;
519
+ _cleanup;
520
+ _adapter;
521
+ _initialized = false;
554
522
  constructor(view) {
555
- _define_property2(this, "_controls", void 0);
556
- _define_property2(this, "_cleanup", void 0);
557
- _define_property2(this, "_adapter", void 0);
558
- _define_property2(this, "_initialized", false);
559
523
  this._adapter = new DocumentAdapter(view);
560
524
  const scroller = view.scrollDOM;
561
525
  let isAutoScrolling = false;
@@ -590,10 +554,26 @@ var transcript = ({ model, started }) => {
590
554
  }
591
555
  }));
592
556
  }
557
+ update(_update) {
558
+ if (!this._initialized) {
559
+ this._initialized = true;
560
+ setTimeout(() => {
561
+ model.sync(this._adapter);
562
+ });
563
+ }
564
+ }
565
+ destroy() {
566
+ this._controls?.remove();
567
+ this._cleanup();
568
+ }
593
569
  }),
594
570
  EditorView.theme({
571
+ ".cm-gutters": {
572
+ backgroundColor: "var(--dx-baseSurface)"
573
+ },
595
574
  ".cm-timestamp-gutter": {
596
575
  width: "6rem",
576
+ paddingLeft: "0.5rem",
597
577
  paddingRight: "1rem"
598
578
  },
599
579
  ".cm-timestamp-gutter > .cm-gutterElement > div": {
@@ -605,8 +585,14 @@ var transcript = ({ model, started }) => {
605
585
  ];
606
586
  };
607
587
  var TimestampMarker = class extends GutterMarker {
588
+ _line;
589
+ _timestamp;
590
+ _started;
591
+ constructor(_line, _timestamp, _started) {
592
+ super(), this._line = _line, this._timestamp = _timestamp, this._started = _started;
593
+ }
608
594
  eq(other) {
609
- return other._timestamp === this._timestamp;
595
+ return this._timestamp === other._timestamp;
610
596
  }
611
597
  toDOM(view) {
612
598
  const el = document.createElement("div");
@@ -622,9 +608,6 @@ var TimestampMarker = class extends GutterMarker {
622
608
  };
623
609
  return el;
624
610
  }
625
- constructor(_line, _timestamp, _started) {
626
- 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;
627
- }
628
611
  };
629
612
  var getStartTime = (started, message) => {
630
613
  if (started) {
@@ -649,87 +632,60 @@ var formatTimestamp = (timestamp, relative) => {
649
632
  };
650
633
 
651
634
  // src/components/Transcript/Transcript.tsx
652
- var renderByline = (identities) => (message, index, debug = false) => {
653
- if (message.sender.role === "assistant") {
654
- return [
655
- message.blocks.find((block) => block._tag === "transcript")?.text ?? "",
656
- ""
657
- ];
658
- }
659
- const identity = identities.find((identity2) => identity2.did === message.sender.identityDid);
660
- const name = identity?.profile?.displayName ?? message.sender.contact?.target?.fullName ?? message.sender.name ?? message.sender.email ?? message.sender.identityDid;
661
- const blocks = message.blocks.filter((block) => block._tag === "transcript");
662
- return [
663
- // TODO(thure): Use an XML tag with the bits needed here.
664
- `###### ${name}` + (debug ? ` [${index}]:${message.id}` : ""),
665
- blocks.map((block) => block.text.trim()).join(" "),
666
- ""
667
- ];
668
- };
669
- var TranscriptView = ({ classNames, space, transcript: object, model }) => {
670
- var _effect = _useSignals();
671
- try {
672
- const { themeMode } = useThemeContext();
673
- const { parentRef } = useTextEditor(() => {
674
- return {
675
- extensions: [
676
- createBasicExtensions({
677
- readOnly: true,
678
- lineWrapping: true,
679
- search: true
680
- }),
681
- createMarkdownExtensions(),
682
- createThemeExtensions({
683
- themeMode
684
- }),
685
- decorateMarkdown(),
686
- preview(),
687
- transcript({
688
- model,
689
- started: object?.started ? new Date(object.started) : void 0
690
- }),
691
- autoScroll()
692
- ].filter(isNotFalsy)
693
- };
694
- }, [
695
- space,
696
- model
697
- ]);
698
- return /* @__PURE__ */ React.createElement("div", {
699
- ref: parentRef,
700
- className: mx("flex grow overflow-hidden container-max-width", classNames),
701
- "data-popover-collision-boundary": true
702
- });
703
- } finally {
704
- _effect.f();
705
- }
635
+ var TranscriptView = ({ classNames, transcript: object, model }) => {
636
+ const { themeMode } = useThemeContext();
637
+ const { parentRef } = useTextEditor(() => {
638
+ return {
639
+ extensions: [
640
+ createBasicExtensions({
641
+ readOnly: true,
642
+ lineWrapping: true,
643
+ search: true
644
+ }),
645
+ createMarkdownExtensions(),
646
+ createThemeExtensions({
647
+ themeMode,
648
+ slots: editorSlots
649
+ }),
650
+ decorateMarkdown(),
651
+ preview(),
652
+ transcript({
653
+ model,
654
+ started: object?.started ? new Date(object.started) : void 0
655
+ }),
656
+ autoScroll()
657
+ ].filter(isTruthy)
658
+ };
659
+ }, [
660
+ model
661
+ ]);
662
+ return /* @__PURE__ */ React.createElement("div", {
663
+ ref: parentRef,
664
+ className: mx("flex grow overflow-hidden container-max-width", classNames),
665
+ "data-popover-collision-boundary": true
666
+ });
706
667
  };
707
668
 
708
669
  // src/components/TranscriptContainer.tsx
709
- var TranscriptionContainer = ({ transcript: transcript2 }) => {
710
- var _effect = _useSignals2();
711
- try {
712
- const attendableId = fullyQualifiedId(transcript2);
713
- const space = getSpace(transcript2);
714
- const members = useMembers(space?.key).map((member) => member.identity);
715
- const queue = useQueue(transcript2.queue.dxn, {
716
- pollInterval: 1e3
717
- });
718
- const model = useQueueModelAdapter(renderByline(members), queue);
719
- return /* @__PURE__ */ React2.createElement(StackItem.Content, null, /* @__PURE__ */ React2.createElement(TranscriptView, {
720
- attendableId,
721
- space,
722
- model,
723
- transcript: transcript2
724
- }));
725
- } finally {
726
- _effect.f();
727
- }
670
+ var TranscriptionContainer = ({ role, subject: transcript2 }) => {
671
+ const attendableId = Obj.getDXN(transcript2).toString();
672
+ const db = Obj.getDatabase(transcript2);
673
+ const members = useMembers(db?.spaceId).map((member) => member.identity);
674
+ const queue = useQueue(transcript2.queue.dxn, {
675
+ pollInterval: 1e3
676
+ });
677
+ const model = useQueueModelAdapter(renderByline(members), queue);
678
+ return /* @__PURE__ */ React2.createElement(Layout.Main, {
679
+ role
680
+ }, /* @__PURE__ */ React2.createElement(TranscriptView, {
681
+ attendableId,
682
+ model,
683
+ transcript: transcript2
684
+ }));
728
685
  };
729
686
  var TranscriptContainer_default = TranscriptionContainer;
730
687
 
731
688
  export {
732
- renderByline,
733
689
  TranscriptView,
734
690
  useAudioFile,
735
691
  useAudioTrack,
@@ -737,10 +693,6 @@ export {
737
693
  useTranscriber,
738
694
  useVoiceInput,
739
695
  TranscriptionContainer,
740
- TranscriptContainer_default,
741
- BlueprintDefinition,
742
- IntentResolver,
743
- ReactSurface,
744
- Transcriber
696
+ TranscriptContainer_default
745
697
  };
746
- //# sourceMappingURL=chunk-DHMLTHPB.mjs.map
698
+ //# sourceMappingURL=chunk-ICM7JRCO.mjs.map