@dxos/plugin-transcription 0.8.4-main.406dc2a → 0.8.4-main.52d7546f51

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 (235) hide show
  1. package/dist/lib/browser/TranscriptContainer-MV3JBKLS.mjs +12 -0
  2. package/dist/lib/browser/blueprint-definition-K3E72ZBC.mjs +19 -0
  3. package/dist/lib/browser/blueprint-definition-K3E72ZBC.mjs.map +7 -0
  4. package/dist/lib/browser/blueprints/index.mjs +9 -0
  5. package/dist/lib/browser/{blueprint-definition-GO6GTEBT.mjs → chunk-AV44VISC.mjs} +34 -36
  6. package/dist/lib/browser/chunk-AV44VISC.mjs.map +7 -0
  7. package/dist/lib/browser/chunk-HOOPZ7EM.mjs +35 -0
  8. package/dist/lib/browser/chunk-HOOPZ7EM.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-ZS2FXKEF.mjs → chunk-K3JJ46VV.mjs} +107 -164
  12. package/dist/lib/browser/chunk-K3JJ46VV.mjs.map +7 -0
  13. package/dist/lib/browser/chunk-Q5OC3WVG.mjs +72 -0
  14. package/dist/lib/browser/chunk-Q5OC3WVG.mjs.map +7 -0
  15. package/dist/lib/browser/{chunk-77NWYLC6.mjs → chunk-RUKY36XW.mjs} +2 -2
  16. package/dist/lib/browser/{chunk-COBQIZ6B.mjs → chunk-TKFU53OZ.mjs} +60 -86
  17. package/dist/lib/browser/chunk-TKFU53OZ.mjs.map +7 -0
  18. package/dist/lib/browser/index.mjs +60 -71
  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-GLEBGPKH.mjs +22 -0
  22. package/dist/lib/browser/operation-resolver-GLEBGPKH.mjs.map +7 -0
  23. package/dist/lib/browser/react-surface-AWZ2A5WZ.mjs +35 -0
  24. package/dist/lib/browser/react-surface-AWZ2A5WZ.mjs.map +7 -0
  25. package/dist/lib/browser/{transcriber-NG5MRCP6.mjs → transcriber-SLVQP76E.mjs} +17 -13
  26. package/dist/lib/browser/transcriber-SLVQP76E.mjs.map +7 -0
  27. package/dist/lib/browser/types/index.mjs +7 -5
  28. package/dist/lib/node-esm/{TranscriptContainer-WCUWVVSD.mjs → TranscriptContainer-7M43UAZ2.mjs} +5 -4
  29. package/dist/lib/node-esm/TranscriptContainer-7M43UAZ2.mjs.map +7 -0
  30. package/dist/lib/node-esm/blueprint-definition-2WIDDA3Y.mjs +20 -0
  31. package/dist/lib/node-esm/blueprint-definition-2WIDDA3Y.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-A6SB234F.mjs → chunk-EPC27WWV.mjs} +60 -86
  37. package/dist/lib/node-esm/chunk-EPC27WWV.mjs.map +7 -0
  38. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
  39. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
  40. package/dist/lib/node-esm/chunk-NVM2QUMX.mjs +37 -0
  41. package/dist/lib/node-esm/chunk-NVM2QUMX.mjs.map +7 -0
  42. package/dist/lib/node-esm/{chunk-N5Z4SKPH.mjs → chunk-SNZAN34I.mjs} +2 -2
  43. package/dist/lib/node-esm/{chunk-PEZRQYKO.mjs → chunk-TIUYXGQN.mjs} +107 -164
  44. package/dist/lib/node-esm/chunk-TIUYXGQN.mjs.map +7 -0
  45. package/dist/lib/node-esm/{blueprint-definition-6SU7GLBR.mjs → chunk-TTJBW7CY.mjs} +34 -36
  46. package/dist/lib/node-esm/chunk-TTJBW7CY.mjs.map +7 -0
  47. package/dist/lib/node-esm/index.mjs +60 -71
  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-SMCFTUFM.mjs +23 -0
  51. package/dist/lib/node-esm/operation-resolver-SMCFTUFM.mjs.map +7 -0
  52. package/dist/lib/node-esm/react-surface-YBBXC4W5.mjs +36 -0
  53. package/dist/lib/node-esm/react-surface-YBBXC4W5.mjs.map +7 -0
  54. package/dist/lib/node-esm/{transcriber-SMU7HD6F.mjs → transcriber-BO2N3UQ4.mjs} +17 -13
  55. package/dist/lib/node-esm/transcriber-BO2N3UQ4.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 +10 -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 +4 -3
  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 +9 -9
  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 -6
  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 -3
  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 -6
  102. package/dist/types/src/components/stories/MicrophoneTranscription.stories.d.ts.map +1 -1
  103. package/dist/types/src/components/stories/TranscriptionStory.d.ts +2 -2
  104. package/dist/types/src/components/stories/TranscriptionStory.d.ts.map +1 -1
  105. package/dist/types/src/functions/open.d.ts +6 -2
  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/hooks/useQueueModelAdapter.d.ts +1 -1
  109. package/dist/types/src/hooks/useQueueModelAdapter.d.ts.map +1 -1
  110. package/dist/types/src/hooks/useTranscriber.d.ts +1 -1
  111. package/dist/types/src/hooks/useTranscriber.d.ts.map +1 -1
  112. package/dist/types/src/index.d.ts +1 -1
  113. package/dist/types/src/index.d.ts.map +1 -1
  114. package/dist/types/src/meta.d.ts +2 -2
  115. package/dist/types/src/meta.d.ts.map +1 -1
  116. package/dist/types/src/segments-normalization/message-normalizer.d.ts +5 -5
  117. package/dist/types/src/segments-normalization/message-normalizer.d.ts.map +1 -1
  118. package/dist/types/src/segments-normalization/normalization.d.ts +502 -448
  119. package/dist/types/src/segments-normalization/normalization.d.ts.map +1 -1
  120. package/dist/types/src/segments-normalization/utils.d.ts +2 -2
  121. package/dist/types/src/segments-normalization/utils.d.ts.map +1 -1
  122. package/dist/types/src/testing/testing.d.ts +9 -9
  123. package/dist/types/src/testing/testing.d.ts.map +1 -1
  124. package/dist/types/src/transcriber/media-stream-recorder.d.ts +2 -2
  125. package/dist/types/src/transcriber/media-stream-recorder.d.ts.map +1 -1
  126. package/dist/types/src/transcriber/transcriber.d.ts +4 -4
  127. package/dist/types/src/transcriber/transcriber.d.ts.map +1 -1
  128. package/dist/types/src/transcriber/transcription-manager.d.ts +9 -6
  129. package/dist/types/src/transcriber/transcription-manager.d.ts.map +1 -1
  130. package/dist/types/src/types/TranscriptAction.d.ts +22 -20
  131. package/dist/types/src/types/TranscriptAction.d.ts.map +1 -1
  132. package/dist/types/src/types/capabilities.d.ts +18 -0
  133. package/dist/types/src/types/capabilities.d.ts.map +1 -0
  134. package/dist/types/src/types/index.d.ts +2 -1
  135. package/dist/types/src/types/index.d.ts.map +1 -1
  136. package/dist/types/src/util/index.d.ts +1 -0
  137. package/dist/types/src/util/index.d.ts.map +1 -1
  138. package/dist/types/src/util/render-byline.d.ts +4 -0
  139. package/dist/types/src/util/render-byline.d.ts.map +1 -0
  140. package/dist/types/tsconfig.tsbuildinfo +1 -1
  141. package/package.json +84 -69
  142. package/src/TranscriptionPlugin.tsx +35 -57
  143. package/src/blueprints/index.ts +5 -0
  144. package/src/blueprints/transcription-blueprint.ts +25 -0
  145. package/src/capabilities/blueprint-definition/blueprint-definition.ts +24 -0
  146. package/src/capabilities/blueprint-definition/index.ts +7 -0
  147. package/src/capabilities/index.ts +4 -8
  148. package/src/capabilities/operation-handler/index.ts +7 -0
  149. package/src/capabilities/operation-handler/operation-handler.ts +25 -0
  150. package/src/capabilities/operation-resolver/index.ts +7 -0
  151. package/src/capabilities/operation-resolver/operation-resolver.ts +25 -0
  152. package/src/capabilities/react-surface/index.ts +7 -0
  153. package/src/capabilities/react-surface/react-surface.tsx +28 -0
  154. package/src/capabilities/transcriber/index.ts +7 -0
  155. package/src/capabilities/transcriber/transcriber.ts +85 -0
  156. package/src/components/Transcript/Transcript.stories.tsx +39 -38
  157. package/src/components/Transcript/Transcript.tsx +11 -38
  158. package/src/components/Transcript/deprecated/OldTranscript.tsx +2 -2
  159. package/src/components/Transcript/transcript-extension.ts +10 -6
  160. package/src/components/TranscriptContainer.tsx +15 -17
  161. package/src/components/stories/FileTranscription.stories.tsx +29 -35
  162. package/src/components/stories/KeyWordRecognition.stories.tsx +5 -8
  163. package/src/components/stories/MicrophoneTranscription.stories.tsx +49 -54
  164. package/src/components/stories/TranscriptionStory.tsx +7 -11
  165. package/src/functions/open.ts +9 -11
  166. package/src/hooks/useQueueModelAdapter.ts +1 -1
  167. package/src/hooks/useTranscriber.ts +8 -3
  168. package/src/hooks/useVoiceInput.ts +2 -2
  169. package/src/index.ts +1 -1
  170. package/src/meta.ts +8 -3
  171. package/src/model/model.test.ts +20 -14
  172. package/src/segments-normalization/message-normalizer.ts +18 -13
  173. package/src/segments-normalization/normalization.test.ts +5 -10
  174. package/src/segments-normalization/normalization.ts +6 -6
  175. package/src/segments-normalization/utils.ts +2 -2
  176. package/src/testing/testing.ts +28 -18
  177. package/src/transcriber/media-stream-recorder.ts +3 -3
  178. package/src/transcriber/transcriber.browser.test.ts +4 -4
  179. package/src/transcriber/transcriber.ts +6 -6
  180. package/src/transcriber/transcription-manager.ts +21 -15
  181. package/src/types/TranscriptAction.ts +21 -13
  182. package/src/{capabilities → types}/capabilities.ts +8 -8
  183. package/src/types/index.ts +2 -1
  184. package/src/util/index.ts +1 -0
  185. package/src/util/render-byline.ts +33 -0
  186. package/dist/lib/browser/TranscriptContainer-QN5WUMWJ.mjs +0 -11
  187. package/dist/lib/browser/blueprint-definition-GO6GTEBT.mjs.map +0 -7
  188. package/dist/lib/browser/chunk-7LNCQDTT.mjs +0 -24
  189. package/dist/lib/browser/chunk-7LNCQDTT.mjs.map +0 -7
  190. package/dist/lib/browser/chunk-COBQIZ6B.mjs.map +0 -7
  191. package/dist/lib/browser/chunk-GGHMOEKZ.mjs +0 -63
  192. package/dist/lib/browser/chunk-GGHMOEKZ.mjs.map +0 -7
  193. package/dist/lib/browser/chunk-LCK3YRQF.mjs +0 -16
  194. package/dist/lib/browser/chunk-LCK3YRQF.mjs.map +0 -7
  195. package/dist/lib/browser/chunk-ZS2FXKEF.mjs.map +0 -7
  196. package/dist/lib/browser/intent-resolver-52EPFRMR.mjs +0 -25
  197. package/dist/lib/browser/intent-resolver-52EPFRMR.mjs.map +0 -7
  198. package/dist/lib/browser/react-surface-LCP2D2MF.mjs +0 -34
  199. package/dist/lib/browser/react-surface-LCP2D2MF.mjs.map +0 -7
  200. package/dist/lib/browser/transcriber-NG5MRCP6.mjs.map +0 -7
  201. package/dist/lib/node-esm/blueprint-definition-6SU7GLBR.mjs.map +0 -7
  202. package/dist/lib/node-esm/chunk-A6SB234F.mjs.map +0 -7
  203. package/dist/lib/node-esm/chunk-FTTZ4YSX.mjs +0 -64
  204. package/dist/lib/node-esm/chunk-FTTZ4YSX.mjs.map +0 -7
  205. package/dist/lib/node-esm/chunk-KLTPFUKN.mjs +0 -25
  206. package/dist/lib/node-esm/chunk-KLTPFUKN.mjs.map +0 -7
  207. package/dist/lib/node-esm/chunk-PEZRQYKO.mjs.map +0 -7
  208. package/dist/lib/node-esm/chunk-RWRG3S2O.mjs +0 -17
  209. package/dist/lib/node-esm/chunk-RWRG3S2O.mjs.map +0 -7
  210. package/dist/lib/node-esm/intent-resolver-DZBQQRHN.mjs +0 -26
  211. package/dist/lib/node-esm/intent-resolver-DZBQQRHN.mjs.map +0 -7
  212. package/dist/lib/node-esm/react-surface-7UC2YXX2.mjs +0 -35
  213. package/dist/lib/node-esm/react-surface-7UC2YXX2.mjs.map +0 -7
  214. package/dist/lib/node-esm/transcriber-SMU7HD6F.mjs.map +0 -7
  215. package/dist/types/src/capabilities/blueprint-definition.d.ts +0 -5
  216. package/dist/types/src/capabilities/blueprint-definition.d.ts.map +0 -1
  217. package/dist/types/src/capabilities/capabilities.d.ts +0 -17
  218. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  219. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  220. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  221. package/dist/types/src/capabilities/react-surface.d.ts +0 -4
  222. package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
  223. package/dist/types/src/capabilities/transcriber.d.ts +0 -8
  224. package/dist/types/src/capabilities/transcriber.d.ts.map +0 -1
  225. package/dist/types/src/types/Transcript.d.ts +0 -30
  226. package/dist/types/src/types/Transcript.d.ts.map +0 -1
  227. package/src/capabilities/blueprint-definition.ts +0 -31
  228. package/src/capabilities/intent-resolver.ts +0 -18
  229. package/src/capabilities/react-surface.tsx +0 -22
  230. package/src/capabilities/transcriber.ts +0 -77
  231. package/src/types/Transcript.ts +0 -44
  232. /package/dist/lib/browser/{TranscriptContainer-QN5WUMWJ.mjs.map → TranscriptContainer-MV3JBKLS.mjs.map} +0 -0
  233. /package/dist/lib/{node-esm/TranscriptContainer-WCUWVVSD.mjs.map → browser/blueprints/index.mjs.map} +0 -0
  234. /package/dist/lib/browser/{chunk-77NWYLC6.mjs.map → chunk-RUKY36XW.mjs.map} +0 -0
  235. /package/dist/lib/node-esm/{chunk-N5Z4SKPH.mjs.map → chunk-SNZAN34I.mjs.map} +0 -0
@@ -0,0 +1,12 @@
1
+ import {
2
+ TranscriptContainer_default,
3
+ TranscriptionContainer
4
+ } from "./chunk-K3JJ46VV.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-MV3JBKLS.mjs.map
@@ -0,0 +1,19 @@
1
+ import {
2
+ transcription_blueprint_exports
3
+ } from "./chunk-AV44VISC.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 } from "@dxos/app-framework";
10
+ import { AppCapabilities } from "@dxos/app-toolkit";
11
+ var blueprintDefinition = Capability.makeModule(() => Effect.succeed([
12
+ Capability.contributes(AppCapabilities.Functions, transcription_blueprint_exports.functions),
13
+ Capability.contributes(AppCapabilities.BlueprintDefinition, transcription_blueprint_exports.make())
14
+ ]));
15
+ var blueprint_definition_default = blueprintDefinition;
16
+ export {
17
+ blueprint_definition_default as default
18
+ };
19
+ //# sourceMappingURL=blueprint-definition-K3E72ZBC.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 } from '@dxos/app-framework';\nimport { AppCapabilities } from '@dxos/app-toolkit';\n\nimport { TranscriptionBlueprint } from '../../blueprints';\n\nexport type BlueprintCapabilities = [\n Capability.Capability<typeof AppCapabilities.Functions>,\n Capability.Capability<typeof AppCapabilities.BlueprintDefinition>,\n];\n\nconst blueprintDefinition = Capability.makeModule<[], BlueprintCapabilities>(() =>\n Effect.succeed([\n Capability.contributes(AppCapabilities.Functions, TranscriptionBlueprint.functions),\n Capability.contributes(AppCapabilities.BlueprintDefinition, TranscriptionBlueprint.make()),\n ]),\n);\n\nexport default blueprintDefinition;\n"],
5
+ "mappings": ";;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,kBAAkB;AAC3B,SAASC,uBAAuB;AAShC,IAAMC,sBAAsBC,WAAWC,WAAsC,MACpEC,eAAQ;EACbF,WAAWG,YAAYC,gBAAgBC,WAAWC,gCAAuBC,SAAS;EAClFP,WAAWG,YAAYC,gBAAgBI,qBAAqBF,gCAAuBG,KAAI,CAAA;CACxF,CAAA;AAGH,IAAA,+BAAeV;",
6
+ "names": ["Effect", "Capability", "AppCapabilities", "blueprintDefinition", "Capability", "makeModule", "succeed", "contributes", "AppCapabilities", "Functions", "TranscriptionBlueprint", "functions", "BlueprintDefinition", "make"]
7
+ }
@@ -0,0 +1,9 @@
1
+ import {
2
+ transcription_blueprint_exports
3
+ } from "../chunk-AV44VISC.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
@@ -1,43 +1,44 @@
1
- import "./chunk-77NWYLC6.mjs";
2
1
  import {
3
2
  renderByline
4
- } from "./chunk-ZS2FXKEF.mjs";
5
- import "./chunk-LCK3YRQF.mjs";
3
+ } from "./chunk-HOOPZ7EM.mjs";
6
4
  import {
7
- Transcript_exports
8
- } from "./chunk-GGHMOEKZ.mjs";
9
- import "./chunk-7LNCQDTT.mjs";
5
+ __export
6
+ } from "./chunk-J5LGTIGS.mjs";
10
7
 
11
- // src/capabilities/blueprint-definition.ts
12
- import { Capabilities, contributes } from "@dxos/app-framework";
8
+ // src/blueprints/transcription-blueprint.ts
9
+ var transcription_blueprint_exports = {};
10
+ __export(transcription_blueprint_exports, {
11
+ Key: () => Key,
12
+ functions: () => functions,
13
+ make: () => make
14
+ });
13
15
  import { Blueprint, Template } from "@dxos/blueprints";
14
16
  import { trim as trim2 } from "@dxos/util";
15
17
 
16
18
  // src/functions/open.ts
17
19
  import * as Effect from "effect/Effect";
18
20
  import * as Schema from "effect/Schema";
19
- import { ArtifactId } from "@dxos/assistant";
20
- import { Obj } from "@dxos/echo";
21
- import { DatabaseService, QueueService, defineFunction } from "@dxos/functions";
22
- import { DataType } from "@dxos/schema";
21
+ import { Database, Obj, Type } from "@dxos/echo";
22
+ import { QueueService, defineFunction } from "@dxos/functions";
23
+ import { Message, Transcript } from "@dxos/types";
23
24
  var open_default = defineFunction({
24
25
  key: "dxos.org/function/transcription/open",
25
26
  name: "Open",
26
27
  description: "Opens and reads the contents of a transcription object.",
27
28
  inputSchema: Schema.Struct({
28
- id: ArtifactId.annotations({
29
+ transcript: Type.Ref(Transcript.Transcript).annotations({
29
30
  description: "The ID of the transcription object."
30
31
  })
31
32
  }),
32
33
  outputSchema: Schema.Struct({
33
34
  content: Schema.String
34
35
  }),
35
- handler: Effect.fn(function* ({ data: { id } }) {
36
- const transcript = yield* DatabaseService.resolve(ArtifactId.toDXN(id), Transcript_exports.Transcript);
37
- const { dxn } = yield* Effect.promise(() => transcript.queue.load());
36
+ handler: Effect.fn(function* ({ data: { transcript } }) {
37
+ const transcriptObj = yield* Database.load(transcript);
38
+ const { dxn } = yield* Effect.promise(() => transcriptObj.queue.load());
38
39
  const queue = yield* QueueService.getQueue(dxn);
39
40
  yield* Effect.promise(() => queue?.queryObjects());
40
- const content = queue?.objects.filter((message) => Obj.instanceOf(DataType.Message, message)).flatMap((message, index) => renderByline([])(message, index)).join("\n\n");
41
+ const content = queue?.objects.filter((message) => Obj.instanceOf(Message.Message, message)).flatMap((message, index) => renderByline([])(message, index)).join("\n\n");
41
42
  return {
42
43
  content
43
44
  };
@@ -122,29 +123,26 @@ var systemPrompt = trim`
122
123
  If no actionable tasks are found, omit this tasks section.
123
124
  `;
124
125
 
125
- // src/capabilities/blueprint-definition.ts
126
+ // src/blueprints/transcription-blueprint.ts
126
127
  var functions = [
127
128
  open_default,
128
129
  summarize_default
129
130
  ];
130
- var blueprint_definition_default = (() => {
131
- return [
132
- contributes(Capabilities.Functions, functions),
133
- contributes(Capabilities.BlueprintDefinition, Blueprint.make({
134
- key: "dxos.org/blueprint/transcription",
135
- name: "Transcription",
136
- tools: Blueprint.toolDefinitions({
137
- functions
138
- }),
139
- instructions: Template.make({
140
- source: trim2`
141
- You can open and summarize a meeting transcript.
142
- `
143
- })
144
- }))
145
- ];
131
+ var Key = "dxos.org/blueprint/transcription";
132
+ var make = () => Blueprint.make({
133
+ key: Key,
134
+ name: "Transcription",
135
+ tools: Blueprint.toolDefinitions({
136
+ functions
137
+ }),
138
+ instructions: Template.make({
139
+ source: trim2`
140
+ You can open and summarize a meeting transcript.
141
+ `
142
+ })
146
143
  });
144
+
147
145
  export {
148
- blueprint_definition_default as default
146
+ transcription_blueprint_exports
149
147
  };
150
- //# sourceMappingURL=blueprint-definition-GO6GTEBT.mjs.map
148
+ //# sourceMappingURL=chunk-AV44VISC.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/blueprints/transcription-blueprint.ts", "../../../src/functions/open.ts", "../../../src/functions/summarize.ts"],
4
+ "sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Blueprint, Template } from '@dxos/blueprints';\nimport { type FunctionDefinition } from '@dxos/functions';\nimport { trim } from '@dxos/util';\n\nimport { open, summarize } from '../functions';\n\nexport const functions: FunctionDefinition[] = [open, summarize];\n\nexport const Key = 'dxos.org/blueprint/transcription';\n\nexport const make = () =>\n Blueprint.make({\n key: Key,\n name: 'Transcription',\n tools: Blueprint.toolDefinitions({ functions }),\n instructions: Template.make({\n source: trim`\n You can open and summarize a meeting transcript.\n `,\n }),\n });\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Schema from 'effect/Schema';\n\nimport { Database, Obj, Type } from '@dxos/echo';\nimport { QueueService, defineFunction } from '@dxos/functions';\nimport { Message, Transcript } from '@dxos/types';\n\nimport { renderByline } from '../util';\n\nexport default defineFunction({\n key: 'dxos.org/function/transcription/open',\n name: 'Open',\n description: 'Opens and reads the contents of a transcription object.',\n inputSchema: Schema.Struct({\n transcript: Type.Ref(Transcript.Transcript).annotations({\n description: 'The ID of the transcription object.',\n }),\n }),\n outputSchema: Schema.Struct({\n content: Schema.String,\n }),\n handler: Effect.fn(function* ({ data: { transcript } }) {\n const transcriptObj = yield* Database.load(transcript);\n const { dxn } = yield* Effect.promise(() => transcriptObj.queue.load());\n const queue = yield* QueueService.getQueue(dxn);\n yield* Effect.promise(() => queue?.queryObjects());\n const content = queue?.objects\n .filter((message) => Obj.instanceOf(Message.Message, message))\n .flatMap((message, index) => renderByline([])(message, index))\n .join('\\n\\n');\n return { content };\n }),\n});\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Array from 'effect/Array';\nimport * as Effect from 'effect/Effect';\nimport * as Function from 'effect/Function';\nimport * as Layer from 'effect/Layer';\nimport * as Option from 'effect/Option';\nimport * as Schema from 'effect/Schema';\n\nimport { AiService, ConsolePrinter, ToolExecutionService, ToolResolverService } from '@dxos/ai';\nimport { AiSession, GenerationObserver } from '@dxos/assistant';\nimport { TracingService, defineFunction } from '@dxos/functions';\nimport { trim } from '@dxos/util';\n\n/**\n * Summarize a transcript of a meeting.\n */\nexport default defineFunction({\n key: 'dxos.org/function/transcription/summarize',\n name: 'Summarize',\n description: 'Summarize a transcript of a meeting.',\n inputSchema: Schema.Struct({\n transcript: Schema.String.annotations({\n description: 'The transcript of the meeting.',\n }),\n notes: Schema.optional(Schema.String).annotations({\n description: 'Additional notes from the participants.',\n }),\n }),\n outputSchema: Schema.Struct({\n summary: Schema.String.annotations({\n description: 'The summary of the transcript.',\n }),\n }),\n handler: Effect.fnUntraced(\n function* ({ data: { transcript, notes } }) {\n const result = yield* new AiSession().run({\n prompt: `Transcript: ${transcript}\\n\\nNotes: ${notes}`,\n history: [],\n system: systemPrompt,\n observer: GenerationObserver.fromPrinter(new ConsolePrinter({ tag: 'summarize' })),\n });\n\n const summary = Function.pipe(\n result,\n Array.findLast((msg) => msg.sender.role === 'assistant' && msg.blocks.some((block) => block._tag === 'text')),\n Option.flatMap((msg) =>\n Function.pipe(\n msg.blocks,\n Array.findLast((block) => block._tag === 'text'),\n Option.map((block) => block.text),\n ),\n ),\n Option.getOrThrowWith(() => new Error('No summary found')),\n );\n\n return { summary };\n },\n Effect.provide(\n Layer.mergeAll(\n AiService.model('@anthropic/claude-sonnet-4-0'),\n ToolResolverService.layerEmpty,\n ToolExecutionService.layerEmpty,\n TracingService.layerNoop,\n ),\n ),\n ),\n});\n\nconst systemPrompt = trim`\n You are a helpful assistant that summarizes transcripts of meetings.\n\n # Goal\n Create a markdown summary of the meeting transcript with text notes provided.\n Notes are very important so make sure to include them in the summary if they contain meaningful information.\n\n # Formatting\n - Format the summary as a markdown document without extra comments like \"Here is the summary of the transcript:\".\n - Use markdown formatting for headings and bullet points.\n - Format the summary as a list of key points and takeaways.\n - All names of people should be in bold.\n\n # Note Taking\n - Correlate items in the summary with the person of origin to build a coherent narrative.\n - Include short quotes verbatim where appropriate. Especially when concerned with design decisions and problem descriptions.\n\n # Tasks\n At the end of the summary include tasks.\n Extract only the tasks that are:\n - Directly actionable.\n - Clearly assigned to a person or team (or can easily be inferred).\n - Strongly implied by the conversation and/or user note (no speculative tasks).\n - Specific enough that someone reading them would know exactly what to do next.\n\n Format all tasks as markdown checkboxes using the syntax:\n - [ ] Task description.\n\n Additional information can be included (indented).\n\n If no actionable tasks are found, omit this tasks section.\n`;\n"],
5
+ "mappings": "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",
6
+ "names": ["Blueprint", "Template", "trim", "Effect", "Schema", "Database", "Obj", "Type", "QueueService", "defineFunction", "Message", "Transcript", "defineFunction", "key", "name", "description", "inputSchema", "Struct", "transcript", "Type", "Ref", "Transcript", "annotations", "outputSchema", "content", "String", "handler", "fn", "data", "transcriptObj", "Database", "load", "dxn", "promise", "queue", "QueueService", "getQueue", "queryObjects", "objects", "filter", "message", "Obj", "instanceOf", "Message", "flatMap", "index", "renderByline", "join", "Array", "Effect", "Function", "Layer", "Option", "Schema", "AiService", "ConsolePrinter", "ToolExecutionService", "ToolResolverService", "AiSession", "GenerationObserver", "TracingService", "defineFunction", "trim", "defineFunction", "key", "name", "description", "inputSchema", "Struct", "transcript", "String", "annotations", "notes", "optional", "outputSchema", "summary", "handler", "fnUntraced", "data", "result", "AiSession", "run", "prompt", "history", "system", "systemPrompt", "observer", "GenerationObserver", "fromPrinter", "ConsolePrinter", "tag", "pipe", "findLast", "msg", "sender", "role", "blocks", "some", "block", "_tag", "flatMap", "map", "text", "getOrThrowWith", "Error", "provide", "mergeAll", "AiService", "model", "ToolResolverService", "layerEmpty", "ToolExecutionService", "TracingService", "layerNoop", "trim", "functions", "open", "summarize", "Key", "make", "Blueprint", "key", "name", "tools", "toolDefinitions", "instructions", "Template", "source", "trim"]
7
+ }
@@ -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
+ }
@@ -0,0 +1,10 @@
1
+ var __defProp = Object.defineProperty;
2
+ var __export = (target, all) => {
3
+ for (var name in all)
4
+ __defProp(target, name, { get: all[name], enumerable: true });
5
+ };
6
+
7
+ export {
8
+ __export
9
+ };
10
+ //# sourceMappingURL=chunk-J5LGTIGS.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": [],
4
+ "sourcesContent": [],
5
+ "mappings": "",
6
+ "names": []
7
+ }
@@ -1,13 +1,15 @@
1
+ import {
2
+ renderByline
3
+ } from "./chunk-HOOPZ7EM.mjs";
1
4
  import {
2
5
  TranscriptionCapabilities
3
- } from "./chunk-LCK3YRQF.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";
11
13
 
12
14
  // src/hooks/useAudioFile.ts
13
15
  import { useEffect, useState } from "react";
@@ -134,21 +136,12 @@ import { Text } from "@codemirror/state";
134
136
  import { Event } from "@dxos/async";
135
137
  import { invariant } from "@dxos/invariant";
136
138
  import { log as log2 } from "@dxos/log";
137
- function _define_property(obj, key, value) {
138
- if (key in obj) {
139
- Object.defineProperty(obj, key, {
140
- value,
141
- enumerable: true,
142
- configurable: true,
143
- writable: true
144
- });
145
- } else {
146
- obj[key] = value;
147
- }
148
- return obj;
149
- }
150
139
  var __dxlog_file2 = "/__w/dxos/dxos/packages/plugins/plugin-transcription/src/model/model.ts";
151
140
  var DocumentAdapter = class {
141
+ _view;
142
+ constructor(_view) {
143
+ this._view = _view;
144
+ }
152
145
  /** The document must always have at least one line. */
153
146
  lineCount() {
154
147
  return this._view.state.doc.lines - 1;
@@ -180,12 +173,25 @@ var DocumentAdapter = class {
180
173
  }
181
174
  });
182
175
  }
183
- constructor(_view) {
184
- _define_property(this, "_view", void 0);
185
- this._view = _view;
186
- }
187
176
  };
188
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
+ }
189
195
  toJSON() {
190
196
  return {
191
197
  chunks: this._chunks.length,
@@ -323,23 +329,6 @@ var SerializationModel = class {
323
329
  this._changes.length = 0;
324
330
  return this;
325
331
  }
326
- constructor(_renderer, initialChunks = []) {
327
- _define_property(this, "_renderer", void 0);
328
- _define_property(this, "_chunks", void 0);
329
- _define_property(this, "_chunkLineCounts", void 0);
330
- _define_property(this, "_lineToChunk", void 0);
331
- _define_property(this, "_changes", void 0);
332
- _define_property(this, "update", void 0);
333
- this._renderer = _renderer;
334
- this._chunks = [];
335
- this._chunkLineCounts = /* @__PURE__ */ new Map();
336
- this._lineToChunk = /* @__PURE__ */ new Map();
337
- this._changes = [];
338
- this.update = new Event();
339
- initialChunks.forEach((chunk) => {
340
- this.appendChunk(chunk);
341
- });
342
- }
343
332
  };
344
333
 
345
334
  // src/hooks/useQueueModelAdapter.ts
@@ -392,16 +381,7 @@ var useQueueModelAdapter = (renderer, queue, initialChunks = []) => {
392
381
 
393
382
  // src/hooks/useTranscriber.ts
394
383
  import { useEffect as useEffect4, useMemo as useMemo2 } from "react";
395
- import { useCapabilities } from "@dxos/app-framework";
396
-
397
- // src/capabilities/index.ts
398
- import { lazy } from "@dxos/app-framework";
399
- var BlueprintDefinition = lazy(() => import("./blueprint-definition-GO6GTEBT.mjs"));
400
- var IntentResolver = lazy(() => import("./intent-resolver-52EPFRMR.mjs"));
401
- var ReactSurface = lazy(() => import("./react-surface-LCP2D2MF.mjs"));
402
- var Transcriber = lazy(() => import("./transcriber-NG5MRCP6.mjs"));
403
-
404
- // src/hooks/useTranscriber.ts
384
+ import { useCapabilities } from "@dxos/app-framework/ui";
405
385
  var useTranscriber = ({ audioStreamTrack, recorderConfig, transcriberConfig, onSegments }) => {
406
386
  const [getTranscriber] = useCapabilities(TranscriptionCapabilities.Transcriber);
407
387
  const transcriber = useMemo2(() => {
@@ -494,11 +474,11 @@ var useVoiceInput = ({ active, onUpdate }) => {
494
474
  };
495
475
 
496
476
  // src/components/Transcript/Transcript.tsx
497
- import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
498
477
  import React from "react";
499
478
  import { useThemeContext } from "@dxos/react-ui";
500
- import { autoScroll, createBasicExtensions, createMarkdownExtensions, createThemeExtensions, decorateMarkdown, preview, useTextEditor } from "@dxos/react-ui-editor";
501
- import { mx } from "@dxos/react-ui-theme";
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";
502
482
  import { isTruthy } from "@dxos/util";
503
483
 
504
484
  // src/components/Transcript/transcript-extension.ts
@@ -507,19 +487,6 @@ import { EditorView, GutterMarker, ViewPlugin, gutter } from "@codemirror/view";
507
487
  import { format } from "date-fns/format";
508
488
  import { intervalToDuration } from "date-fns/intervalToDuration";
509
489
  import { addEventListener, combine } from "@dxos/async";
510
- function _define_property2(obj, key, value) {
511
- if (key in obj) {
512
- Object.defineProperty(obj, key, {
513
- value,
514
- enumerable: true,
515
- configurable: true,
516
- writable: true
517
- });
518
- } else {
519
- obj[key] = value;
520
- }
521
- return obj;
522
- }
523
490
  var transcript = ({ model, started }) => {
524
491
  return [
525
492
  // Show timestamps in the gutter.
@@ -548,23 +515,11 @@ var transcript = ({ model, started }) => {
548
515
  }),
549
516
  // Listen for model updates.
550
517
  ViewPlugin.fromClass(class {
551
- update(_update) {
552
- if (!this._initialized) {
553
- this._initialized = true;
554
- setTimeout(() => {
555
- model.sync(this._adapter);
556
- });
557
- }
558
- }
559
- destroy() {
560
- this._controls?.remove();
561
- this._cleanup();
562
- }
518
+ _controls;
519
+ _cleanup;
520
+ _adapter;
521
+ _initialized = false;
563
522
  constructor(view) {
564
- _define_property2(this, "_controls", void 0);
565
- _define_property2(this, "_cleanup", void 0);
566
- _define_property2(this, "_adapter", void 0);
567
- _define_property2(this, "_initialized", false);
568
523
  this._adapter = new DocumentAdapter(view);
569
524
  const scroller = view.scrollDOM;
570
525
  let isAutoScrolling = false;
@@ -599,10 +554,26 @@ var transcript = ({ model, started }) => {
599
554
  }
600
555
  }));
601
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
+ }
602
569
  }),
603
570
  EditorView.theme({
571
+ ".cm-gutters": {
572
+ backgroundColor: "var(--dx-baseSurface)"
573
+ },
604
574
  ".cm-timestamp-gutter": {
605
575
  width: "6rem",
576
+ paddingLeft: "0.5rem",
606
577
  paddingRight: "1rem"
607
578
  },
608
579
  ".cm-timestamp-gutter > .cm-gutterElement > div": {
@@ -614,8 +585,14 @@ var transcript = ({ model, started }) => {
614
585
  ];
615
586
  };
616
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
+ }
617
594
  eq(other) {
618
- return other._timestamp === this._timestamp;
595
+ return this._timestamp === other._timestamp;
619
596
  }
620
597
  toDOM(view) {
621
598
  const el = document.createElement("div");
@@ -631,9 +608,6 @@ var TimestampMarker = class extends GutterMarker {
631
608
  };
632
609
  return el;
633
610
  }
634
- constructor(_line, _timestamp, _started) {
635
- 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;
636
- }
637
611
  };
638
612
  var getStartTime = (started, message) => {
639
613
  if (started) {
@@ -658,87 +632,60 @@ var formatTimestamp = (timestamp, relative) => {
658
632
  };
659
633
 
660
634
  // src/components/Transcript/Transcript.tsx
661
- var renderByline = (identities) => (message, index, debug = false) => {
662
- if (message.sender.role === "assistant") {
663
- return [
664
- message.blocks.find((block) => block._tag === "transcript")?.text ?? "",
665
- ""
666
- ];
667
- }
668
- const identity = identities.find((identity2) => identity2.did === message.sender.identityDid);
669
- const name = identity?.profile?.displayName ?? message.sender.contact?.target?.fullName ?? message.sender.name ?? message.sender.email ?? message.sender.identityDid;
670
- const blocks = message.blocks.filter((block) => block._tag === "transcript");
671
- return [
672
- // TODO(thure): Use an XML tag with the bits needed here.
673
- `###### ${name}` + (debug ? ` [${index}]:${message.id}` : ""),
674
- blocks.map((block) => block.text.trim()).join(" "),
675
- ""
676
- ];
677
- };
678
- var TranscriptView = ({ classNames, space, transcript: object, model }) => {
679
- var _effect = _useSignals();
680
- try {
681
- const { themeMode } = useThemeContext();
682
- const { parentRef } = useTextEditor(() => {
683
- return {
684
- extensions: [
685
- createBasicExtensions({
686
- readOnly: true,
687
- lineWrapping: true,
688
- search: true
689
- }),
690
- createMarkdownExtensions(),
691
- createThemeExtensions({
692
- themeMode
693
- }),
694
- decorateMarkdown(),
695
- preview(),
696
- transcript({
697
- model,
698
- started: object?.started ? new Date(object.started) : void 0
699
- }),
700
- autoScroll()
701
- ].filter(isTruthy)
702
- };
703
- }, [
704
- space,
705
- model
706
- ]);
707
- return /* @__PURE__ */ React.createElement("div", {
708
- ref: parentRef,
709
- className: mx("flex grow overflow-hidden container-max-width", classNames),
710
- "data-popover-collision-boundary": true
711
- });
712
- } finally {
713
- _effect.f();
714
- }
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
+ });
715
667
  };
716
668
 
717
669
  // src/components/TranscriptContainer.tsx
718
- var TranscriptionContainer = ({ transcript: transcript2 }) => {
719
- var _effect = _useSignals2();
720
- try {
721
- const attendableId = fullyQualifiedId(transcript2);
722
- const space = getSpace(transcript2);
723
- const members = useMembers(space?.key).map((member) => member.identity);
724
- const queue = useQueue(transcript2.queue.dxn, {
725
- pollInterval: 1e3
726
- });
727
- const model = useQueueModelAdapter(renderByline(members), queue);
728
- return /* @__PURE__ */ React2.createElement(StackItem.Content, null, /* @__PURE__ */ React2.createElement(TranscriptView, {
729
- attendableId,
730
- space,
731
- model,
732
- transcript: transcript2
733
- }));
734
- } finally {
735
- _effect.f();
736
- }
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
+ }));
737
685
  };
738
686
  var TranscriptContainer_default = TranscriptionContainer;
739
687
 
740
688
  export {
741
- renderByline,
742
689
  TranscriptView,
743
690
  useAudioFile,
744
691
  useAudioTrack,
@@ -746,10 +693,6 @@ export {
746
693
  useTranscriber,
747
694
  useVoiceInput,
748
695
  TranscriptionContainer,
749
- TranscriptContainer_default,
750
- BlueprintDefinition,
751
- IntentResolver,
752
- ReactSurface,
753
- Transcriber
696
+ TranscriptContainer_default
754
697
  };
755
- //# sourceMappingURL=chunk-ZS2FXKEF.mjs.map
698
+ //# sourceMappingURL=chunk-K3JJ46VV.mjs.map