@dxos/plugin-transcription 0.8.4-main.ae835ea → 0.8.4-main.bcb3aa67d6

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 (249) hide show
  1. package/dist/lib/browser/blueprints/index.mjs +31 -0
  2. package/dist/lib/browser/blueprints/index.mjs.map +7 -0
  3. package/dist/lib/browser/chunk-HOOPZ7EM.mjs +35 -0
  4. package/dist/lib/browser/chunk-HOOPZ7EM.mjs.map +7 -0
  5. package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
  6. package/dist/lib/browser/chunk-RIUSFL62.mjs +112 -0
  7. package/dist/lib/browser/chunk-RIUSFL62.mjs.map +7 -0
  8. package/dist/lib/browser/chunk-YXU2ZO6W.mjs +17 -0
  9. package/dist/lib/browser/chunk-YXU2ZO6W.mjs.map +7 -0
  10. package/dist/lib/browser/create-IZPB7VZW.mjs +19 -0
  11. package/dist/lib/browser/create-IZPB7VZW.mjs.map +7 -0
  12. package/dist/lib/browser/index.mjs +1178 -97
  13. package/dist/lib/browser/index.mjs.map +4 -4
  14. package/dist/lib/browser/meta.json +1 -1
  15. package/dist/lib/browser/open-SN5O5I6X.mjs +29 -0
  16. package/dist/lib/browser/open-SN5O5I6X.mjs.map +7 -0
  17. package/dist/lib/browser/operations/index.mjs +13 -0
  18. package/dist/lib/browser/operations/index.mjs.map +7 -0
  19. package/dist/lib/browser/summarize-5MZENAU5.mjs +71 -0
  20. package/dist/lib/browser/summarize-5MZENAU5.mjs.map +7 -0
  21. package/dist/lib/browser/types/index.mjs +4 -6
  22. package/dist/lib/node-esm/blueprints/index.mjs +32 -0
  23. package/dist/lib/node-esm/blueprints/index.mjs.map +7 -0
  24. package/dist/lib/node-esm/chunk-3GSFEN4L.mjs +113 -0
  25. package/dist/lib/node-esm/chunk-3GSFEN4L.mjs.map +7 -0
  26. package/dist/lib/node-esm/chunk-BR2R6PCT.mjs +19 -0
  27. package/dist/lib/node-esm/chunk-BR2R6PCT.mjs.map +7 -0
  28. package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
  29. package/dist/lib/node-esm/chunk-NVM2QUMX.mjs +37 -0
  30. package/dist/lib/node-esm/chunk-NVM2QUMX.mjs.map +7 -0
  31. package/dist/lib/node-esm/create-TQDGXQBL.mjs +20 -0
  32. package/dist/lib/node-esm/create-TQDGXQBL.mjs.map +7 -0
  33. package/dist/lib/node-esm/index.mjs +1178 -97
  34. package/dist/lib/node-esm/index.mjs.map +4 -4
  35. package/dist/lib/node-esm/meta.json +1 -1
  36. package/dist/lib/node-esm/open-4GAAWWKJ.mjs +30 -0
  37. package/dist/lib/node-esm/open-4GAAWWKJ.mjs.map +7 -0
  38. package/dist/lib/node-esm/operations/index.mjs +14 -0
  39. package/dist/lib/node-esm/operations/index.mjs.map +7 -0
  40. package/dist/lib/node-esm/summarize-RVOSRHEC.mjs +72 -0
  41. package/dist/lib/node-esm/summarize-RVOSRHEC.mjs.map +7 -0
  42. package/dist/lib/node-esm/types/index.mjs +4 -6
  43. package/dist/types/src/TranscriptionPlugin.d.ts +2 -1
  44. package/dist/types/src/TranscriptionPlugin.d.ts.map +1 -1
  45. package/dist/types/src/blueprints/index.d.ts +2 -0
  46. package/dist/types/src/blueprints/index.d.ts.map +1 -0
  47. package/dist/types/src/blueprints/transcription-blueprint.d.ts +4 -0
  48. package/dist/types/src/blueprints/transcription-blueprint.d.ts.map +1 -0
  49. package/dist/types/src/capabilities/blueprint-definition.d.ts +5 -4
  50. package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -1
  51. package/dist/types/src/capabilities/index.d.ts +6 -5
  52. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  53. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  54. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  55. package/dist/types/src/capabilities/react-surface.d.ts +3 -2
  56. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
  57. package/dist/types/src/capabilities/transcriber.d.ts +4 -3
  58. package/dist/types/src/capabilities/transcriber.d.ts.map +1 -1
  59. package/dist/types/src/components/Transcription/Transcription.d.ts +22 -0
  60. package/dist/types/src/components/Transcription/Transcription.d.ts.map +1 -0
  61. package/dist/types/src/components/Transcription/Transcription.stories.d.ts +40 -0
  62. package/dist/types/src/components/Transcription/Transcription.stories.d.ts.map +1 -0
  63. package/dist/types/src/components/Transcription/index.d.ts +2 -0
  64. package/dist/types/src/components/Transcription/index.d.ts.map +1 -0
  65. package/dist/types/src/components/Transcription/transcription-extension.d.ts +15 -0
  66. package/dist/types/src/components/Transcription/transcription-extension.d.ts.map +1 -0
  67. package/dist/types/src/components/index.d.ts +1 -3
  68. package/dist/types/src/components/index.d.ts.map +1 -1
  69. package/dist/types/src/components/stories/FileTranscription.stories.d.ts +3 -3
  70. package/dist/types/src/components/stories/FileTranscription.stories.d.ts.map +1 -1
  71. package/dist/types/src/components/stories/KeyWordRecognition.stories.d.ts +2 -2
  72. package/dist/types/src/components/stories/KeyWordRecognition.stories.d.ts.map +1 -1
  73. package/dist/types/src/components/stories/MicrophoneTranscription.stories.d.ts +5 -5
  74. package/dist/types/src/components/stories/MicrophoneTranscription.stories.d.ts.map +1 -1
  75. package/dist/types/src/components/stories/TranscriptionStory.d.ts +2 -2
  76. package/dist/types/src/components/stories/TranscriptionStory.d.ts.map +1 -1
  77. package/dist/types/src/containers/TranscriptionContainer/TranscriptionContainer.d.ts +6 -0
  78. package/dist/types/src/containers/TranscriptionContainer/TranscriptionContainer.d.ts.map +1 -0
  79. package/dist/types/src/containers/TranscriptionContainer/index.d.ts +3 -0
  80. package/dist/types/src/containers/TranscriptionContainer/index.d.ts.map +1 -0
  81. package/dist/types/src/containers/index.d.ts +3 -0
  82. package/dist/types/src/containers/index.d.ts.map +1 -0
  83. package/dist/types/src/hooks/useQueueModelAdapter.d.ts +1 -1
  84. package/dist/types/src/hooks/useQueueModelAdapter.d.ts.map +1 -1
  85. package/dist/types/src/hooks/useTranscriber.d.ts +1 -1
  86. package/dist/types/src/hooks/useTranscriber.d.ts.map +1 -1
  87. package/dist/types/src/index.d.ts +1 -1
  88. package/dist/types/src/index.d.ts.map +1 -1
  89. package/dist/types/src/meta.d.ts +2 -2
  90. package/dist/types/src/meta.d.ts.map +1 -1
  91. package/dist/types/src/operations/create.d.ts +5 -0
  92. package/dist/types/src/operations/create.d.ts.map +1 -0
  93. package/dist/types/src/operations/definitions.d.ts +905 -0
  94. package/dist/types/src/operations/definitions.d.ts.map +1 -0
  95. package/dist/types/src/operations/index.d.ts +4 -0
  96. package/dist/types/src/operations/index.d.ts.map +1 -0
  97. package/dist/types/src/operations/open.d.ts +5 -0
  98. package/dist/types/src/operations/open.d.ts.map +1 -0
  99. package/dist/types/src/operations/summarize.d.ts +8 -0
  100. package/dist/types/src/operations/summarize.d.ts.map +1 -0
  101. package/dist/types/src/segments-normalization/message-normalizer.d.ts +5 -5
  102. package/dist/types/src/segments-normalization/message-normalizer.d.ts.map +1 -1
  103. package/dist/types/src/segments-normalization/normalization.d.ts +360 -474
  104. package/dist/types/src/segments-normalization/normalization.d.ts.map +1 -1
  105. package/dist/types/src/segments-normalization/utils.d.ts +2 -2
  106. package/dist/types/src/segments-normalization/utils.d.ts.map +1 -1
  107. package/dist/types/src/testing/testing.d.ts +9 -9
  108. package/dist/types/src/testing/testing.d.ts.map +1 -1
  109. package/dist/types/src/transcriber/media-stream-recorder.d.ts +2 -2
  110. package/dist/types/src/transcriber/media-stream-recorder.d.ts.map +1 -1
  111. package/dist/types/src/transcriber/transcriber.d.ts +4 -4
  112. package/dist/types/src/transcriber/transcriber.d.ts.map +1 -1
  113. package/dist/types/src/transcriber/transcription-manager.d.ts +9 -6
  114. package/dist/types/src/transcriber/transcription-manager.d.ts.map +1 -1
  115. package/dist/types/src/translations.d.ts +7 -7
  116. package/dist/types/src/translations.d.ts.map +1 -1
  117. package/dist/types/src/types/capabilities.d.ts +18 -0
  118. package/dist/types/src/types/capabilities.d.ts.map +1 -0
  119. package/dist/types/src/types/index.d.ts +1 -2
  120. package/dist/types/src/types/index.d.ts.map +1 -1
  121. package/dist/types/src/util/index.d.ts +1 -0
  122. package/dist/types/src/util/index.d.ts.map +1 -1
  123. package/dist/types/src/util/render-byline.d.ts +4 -0
  124. package/dist/types/src/util/render-byline.d.ts.map +1 -0
  125. package/dist/types/tsconfig.tsbuildinfo +1 -1
  126. package/package.json +105 -70
  127. package/src/TranscriptionPlugin.tsx +40 -60
  128. package/src/blueprints/index.ts +5 -0
  129. package/src/blueprints/transcription-blueprint.ts +30 -0
  130. package/src/capabilities/blueprint-definition.ts +10 -24
  131. package/src/capabilities/index.ts +9 -7
  132. package/src/capabilities/operation-handler.ts +16 -0
  133. package/src/capabilities/react-surface.tsx +21 -13
  134. package/src/capabilities/transcriber.ts +51 -43
  135. package/src/components/{Transcript/Transcript.stories.tsx → Transcription/Transcription.stories.tsx} +49 -45
  136. package/src/components/Transcription/Transcription.tsx +65 -0
  137. package/src/components/{Transcript → Transcription}/index.ts +1 -1
  138. package/src/components/{Transcript/transcript-extension.ts → Transcription/transcription-extension.ts} +13 -9
  139. package/src/components/index.ts +1 -6
  140. package/src/components/stories/FileTranscription.stories.tsx +30 -36
  141. package/src/components/stories/KeyWordRecognition.stories.tsx +6 -6
  142. package/src/components/stories/MicrophoneTranscription.stories.tsx +53 -74
  143. package/src/components/stories/TranscriptionStory.tsx +7 -9
  144. package/src/containers/TranscriptionContainer/TranscriptionContainer.tsx +32 -0
  145. package/src/containers/TranscriptionContainer/index.ts +7 -0
  146. package/src/containers/index.ts +7 -0
  147. package/src/hooks/useQueueModelAdapter.ts +1 -1
  148. package/src/hooks/useTranscriber.ts +8 -3
  149. package/src/hooks/useVoiceInput.ts +2 -2
  150. package/src/index.ts +1 -1
  151. package/src/meta.ts +3 -3
  152. package/src/model/model.test.ts +20 -14
  153. package/src/operations/create.ts +22 -0
  154. package/src/operations/definitions.ts +102 -0
  155. package/src/operations/index.ts +13 -0
  156. package/src/operations/open.ts +31 -0
  157. package/src/{functions → operations}/summarize.ts +41 -47
  158. package/src/segments-normalization/message-normalizer.ts +18 -13
  159. package/src/segments-normalization/normalization.test.ts +6 -11
  160. package/src/segments-normalization/normalization.ts +34 -72
  161. package/src/segments-normalization/utils.ts +2 -2
  162. package/src/testing/testing.ts +28 -28
  163. package/src/transcriber/media-stream-recorder.ts +3 -3
  164. package/src/transcriber/transcriber.browser.test.ts +4 -4
  165. package/src/transcriber/transcriber.ts +7 -7
  166. package/src/transcriber/transcription-manager.ts +21 -15
  167. package/src/translations.ts +7 -7
  168. package/src/{capabilities → types}/capabilities.ts +10 -10
  169. package/src/types/index.ts +1 -2
  170. package/src/util/index.ts +1 -0
  171. package/src/util/render-byline.ts +33 -0
  172. package/dist/lib/browser/TranscriptContainer-2GSL2XB5.mjs +0 -11
  173. package/dist/lib/browser/blueprint-definition-UAAJYVLZ.mjs +0 -150
  174. package/dist/lib/browser/blueprint-definition-UAAJYVLZ.mjs.map +0 -7
  175. package/dist/lib/browser/chunk-3MKZ2MNQ.mjs +0 -16
  176. package/dist/lib/browser/chunk-3MKZ2MNQ.mjs.map +0 -7
  177. package/dist/lib/browser/chunk-535OJKFO.mjs +0 -8
  178. package/dist/lib/browser/chunk-535OJKFO.mjs.map +0 -7
  179. package/dist/lib/browser/chunk-7DR6HZEF.mjs +0 -732
  180. package/dist/lib/browser/chunk-7DR6HZEF.mjs.map +0 -7
  181. package/dist/lib/browser/chunk-VBUIO677.mjs +0 -29
  182. package/dist/lib/browser/chunk-VBUIO677.mjs.map +0 -7
  183. package/dist/lib/browser/chunk-W7WKZTM4.mjs +0 -63
  184. package/dist/lib/browser/chunk-W7WKZTM4.mjs.map +0 -7
  185. package/dist/lib/browser/chunk-WH36ENNE.mjs +0 -466
  186. package/dist/lib/browser/chunk-WH36ENNE.mjs.map +0 -7
  187. package/dist/lib/browser/intent-resolver-ZTKTEAQX.mjs +0 -25
  188. package/dist/lib/browser/intent-resolver-ZTKTEAQX.mjs.map +0 -7
  189. package/dist/lib/browser/react-surface-KA32A72I.mjs +0 -34
  190. package/dist/lib/browser/react-surface-KA32A72I.mjs.map +0 -7
  191. package/dist/lib/browser/transcriber-LWOLYQHC.mjs +0 -56
  192. package/dist/lib/browser/transcriber-LWOLYQHC.mjs.map +0 -7
  193. package/dist/lib/node-esm/TranscriptContainer-GRLDCESB.mjs +0 -12
  194. package/dist/lib/node-esm/blueprint-definition-Z3LTZ3ID.mjs +0 -151
  195. package/dist/lib/node-esm/blueprint-definition-Z3LTZ3ID.mjs.map +0 -7
  196. package/dist/lib/node-esm/chunk-K4AZOB5Y.mjs +0 -733
  197. package/dist/lib/node-esm/chunk-K4AZOB5Y.mjs.map +0 -7
  198. package/dist/lib/node-esm/chunk-OLMSTF3M.mjs +0 -64
  199. package/dist/lib/node-esm/chunk-OLMSTF3M.mjs.map +0 -7
  200. package/dist/lib/node-esm/chunk-Q6WD7L2J.mjs +0 -10
  201. package/dist/lib/node-esm/chunk-Q6WD7L2J.mjs.map +0 -7
  202. package/dist/lib/node-esm/chunk-SWUVPFKR.mjs +0 -17
  203. package/dist/lib/node-esm/chunk-SWUVPFKR.mjs.map +0 -7
  204. package/dist/lib/node-esm/chunk-YFN4FJFK.mjs +0 -467
  205. package/dist/lib/node-esm/chunk-YFN4FJFK.mjs.map +0 -7
  206. package/dist/lib/node-esm/chunk-YVNQN2J6.mjs +0 -30
  207. package/dist/lib/node-esm/chunk-YVNQN2J6.mjs.map +0 -7
  208. package/dist/lib/node-esm/intent-resolver-55WH2GY6.mjs +0 -26
  209. package/dist/lib/node-esm/intent-resolver-55WH2GY6.mjs.map +0 -7
  210. package/dist/lib/node-esm/react-surface-GU7LW2JO.mjs +0 -35
  211. package/dist/lib/node-esm/react-surface-GU7LW2JO.mjs.map +0 -7
  212. package/dist/lib/node-esm/transcriber-UGB7ECX6.mjs +0 -57
  213. package/dist/lib/node-esm/transcriber-UGB7ECX6.mjs.map +0 -7
  214. package/dist/types/src/capabilities/capabilities.d.ts +0 -17
  215. package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
  216. package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
  217. package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
  218. package/dist/types/src/components/Transcript/Transcript.d.ts +0 -20
  219. package/dist/types/src/components/Transcript/Transcript.d.ts.map +0 -1
  220. package/dist/types/src/components/Transcript/Transcript.stories.d.ts +0 -39
  221. package/dist/types/src/components/Transcript/Transcript.stories.d.ts.map +0 -1
  222. package/dist/types/src/components/Transcript/deprecated/OldTranscript.d.ts +0 -28
  223. package/dist/types/src/components/Transcript/deprecated/OldTranscript.d.ts.map +0 -1
  224. package/dist/types/src/components/Transcript/index.d.ts +0 -2
  225. package/dist/types/src/components/Transcript/index.d.ts.map +0 -1
  226. package/dist/types/src/components/Transcript/transcript-extension.d.ts +0 -15
  227. package/dist/types/src/components/Transcript/transcript-extension.d.ts.map +0 -1
  228. package/dist/types/src/components/TranscriptContainer.d.ts +0 -9
  229. package/dist/types/src/components/TranscriptContainer.d.ts.map +0 -1
  230. package/dist/types/src/functions/index.d.ts +0 -3
  231. package/dist/types/src/functions/index.d.ts.map +0 -1
  232. package/dist/types/src/functions/open.d.ts +0 -7
  233. package/dist/types/src/functions/open.d.ts.map +0 -1
  234. package/dist/types/src/functions/summarize.d.ts +0 -11
  235. package/dist/types/src/functions/summarize.d.ts.map +0 -1
  236. package/dist/types/src/types/Transcript.d.ts +0 -30
  237. package/dist/types/src/types/Transcript.d.ts.map +0 -1
  238. package/dist/types/src/types/TranscriptAction.d.ts +0 -23
  239. package/dist/types/src/types/TranscriptAction.d.ts.map +0 -1
  240. package/src/capabilities/intent-resolver.ts +0 -18
  241. package/src/components/Transcript/Transcript.tsx +0 -93
  242. package/src/components/Transcript/deprecated/OldTranscript.tsx +0 -260
  243. package/src/components/TranscriptContainer.tsx +0 -36
  244. package/src/functions/index.ts +0 -6
  245. package/src/functions/open.ts +0 -39
  246. package/src/types/Transcript.ts +0 -44
  247. package/src/types/TranscriptAction.ts +0 -24
  248. /package/dist/lib/browser/{TranscriptContainer-2GSL2XB5.mjs.map → chunk-J5LGTIGS.mjs.map} +0 -0
  249. /package/dist/lib/node-esm/{TranscriptContainer-GRLDCESB.mjs.map → chunk-HSLMI22Q.mjs.map} +0 -0
@@ -3,36 +3,36 @@
3
3
  //
4
4
 
5
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
6
+ import * as Effect from 'effect/Effect';
7
+ import type * as Types from 'effect/Types';
6
8
  import React, { type FC, useEffect, useMemo, useState } from 'react';
7
9
 
8
- import { IntentPlugin, SettingsPlugin } from '@dxos/app-framework';
9
10
  import { withPluginManager } from '@dxos/app-framework/testing';
10
11
  import { Key } from '@dxos/echo';
11
12
  import { ClientPlugin } from '@dxos/plugin-client';
13
+ import { initializeIdentity } from '@dxos/plugin-client/testing';
12
14
  import { PreviewPlugin } from '@dxos/plugin-preview';
13
- import { SpacePlugin } from '@dxos/plugin-space';
14
- import { StorybookLayoutPlugin } from '@dxos/plugin-storybook-layout';
15
- import { ThemePlugin } from '@dxos/plugin-theme';
15
+ import { StorybookPlugin, corePlugins } from '@dxos/plugin-testing';
16
16
  import { faker } from '@dxos/random';
17
17
  import { useMembers, useSpace } from '@dxos/react-client/echo';
18
18
  import { IconButton, Toolbar } from '@dxos/react-ui';
19
- import { withTheme } from '@dxos/react-ui/testing';
19
+ import { withLayout } from '@dxos/react-ui/testing';
20
20
  import { SyntaxHighlighter } from '@dxos/react-ui-syntax-highlighter';
21
- import { defaultTx } from '@dxos/react-ui-theme';
22
- import { DataType } from '@dxos/schema';
23
- import { Testing } from '@dxos/schema/testing';
21
+ import { TestSchema } from '@dxos/schema/testing';
22
+ import { type ContentBlock, type Message, Organization, Person } from '@dxos/types';
24
23
 
25
- import { useQueueModelAdapter } from '../../hooks';
24
+ import { useQueueModelAdapter } from '#hooks';
26
25
  import { SerializationModel } from '../../model';
27
26
  import {
28
27
  MessageBuilder,
29
28
  TestItem,
30
29
  useTestTranscriptionQueue,
31
30
  useTestTranscriptionQueueWithEntityExtraction,
32
- } from '../../testing';
31
+ } from '#testing';
33
32
  import { translations } from '../../translations';
33
+ import { renderByline } from '../../util';
34
34
 
35
- import { TranscriptView, type TranscriptViewProps, renderByline } from './Transcript';
35
+ import { Transcription, type TranscriptionProps } from './Transcription';
36
36
 
37
37
  faker.seed(1);
38
38
 
@@ -40,15 +40,15 @@ faker.seed(1);
40
40
  * Story wrapper with test controls.
41
41
  */
42
42
  const TranscriptContainer: FC<
43
- TranscriptViewProps & {
43
+ TranscriptionProps & {
44
44
  running: boolean;
45
45
  onRunningChange: (running: boolean) => void;
46
46
  onReset?: () => void;
47
47
  }
48
- > = ({ space, model, running, onRunningChange, onReset }) => {
48
+ > = ({ model, running, onRunningChange, onReset }) => {
49
49
  return (
50
50
  <div className='grid grid-rows-[1fr_40px] grow divide-y divide-separator'>
51
- <TranscriptView space={space} model={model} />
51
+ <Transcription model={model} />
52
52
  <div className='grid grid-cols-[1fr_16rem] overflow-hidden'>
53
53
  <div className='flex items-center'>
54
54
  <SyntaxHighlighter language='json' className='text-sm'>
@@ -68,20 +68,24 @@ const TranscriptContainer: FC<
68
68
  );
69
69
  };
70
70
 
71
- type StoryProps = { messages?: DataType.Message[] } & Pick<TranscriptViewProps, 'ignoreAttention' | 'attendableId'>;
71
+ type DefaultStoryProps = { messages?: Message.Message[] } & Pick<
72
+ TranscriptionProps,
73
+ 'ignoreAttention' | 'attendableId'
74
+ >;
72
75
 
73
76
  /**
74
77
  * Basic story mutates array of messages.
75
78
  */
76
- const BasicStory = ({ messages: initialMessages = [], ...props }: StoryProps) => {
79
+ const BasicStory = ({ messages: initialMessages = [], ...props }: DefaultStoryProps) => {
77
80
  const [reset, setReset] = useState({});
78
81
  const builder = useMemo(() => new MessageBuilder(), []);
79
82
  const model = useMemo(
80
- () => new SerializationModel<DataType.Message>(renderByline([]), initialMessages),
83
+ () => new SerializationModel<Message.Message>(renderByline([]), initialMessages),
81
84
  [initialMessages, reset],
82
85
  );
83
86
  const [running, setRunning] = useState(true);
84
- const [currentMessage, setCurrentMessage] = useState<DataType.Message | null>(null);
87
+ // Use mutable type for local message building (not ECHO-managed).
88
+ const [currentMessage, setCurrentMessage] = useState<Types.Mutable<Message.Message> | null>(null);
85
89
  useEffect(() => {
86
90
  if (!running) {
87
91
  return;
@@ -102,7 +106,7 @@ const BasicStory = ({ messages: initialMessages = [], ...props }: StoryProps) =>
102
106
  return;
103
107
  }
104
108
 
105
- currentMessage.blocks.push(builder.createBlock());
109
+ (currentMessage.blocks as ContentBlock.Any[]).push(builder.createBlock());
106
110
  model.updateChunk(currentMessage);
107
111
  }, 3_000);
108
112
 
@@ -134,22 +138,15 @@ const QueueStory = ({
134
138
  queueId,
135
139
  onReset,
136
140
  ...props
137
- }: StoryProps & { queueId: Key.ObjectId; onReset: () => void }) => {
141
+ }: DefaultStoryProps & { queueId: Key.ObjectId; onReset: () => void }) => {
138
142
  const [running, setRunning] = useState(true);
139
143
  const space = useSpace();
140
- const members = useMembers(space?.key).map((member) => member.identity);
144
+ const members = useMembers(space?.id).map((member) => member.identity);
141
145
  const queue = useTestTranscriptionQueue(space, queueId, running, 2_000);
142
146
  const model = useQueueModelAdapter(renderByline(members), queue, initialMessages);
143
147
 
144
148
  return (
145
- <TranscriptContainer
146
- space={space}
147
- model={model}
148
- running={running}
149
- onRunningChange={setRunning}
150
- onReset={onReset}
151
- {...props}
152
- />
149
+ <TranscriptContainer model={model} running={running} onRunningChange={setRunning} onReset={onReset} {...props} />
153
150
  );
154
151
  };
155
152
 
@@ -161,7 +158,7 @@ const EntityExtractionQueueStory = () => {
161
158
  const queue = useTestTranscriptionQueueWithEntityExtraction(space, undefined, running, 2_000);
162
159
  const model = useQueueModelAdapter(renderByline(members), queue, []);
163
160
 
164
- return <TranscriptContainer space={space} model={model} running={running} onRunningChange={setRunning} />;
161
+ return <TranscriptContainer model={model} running={running} onRunningChange={setRunning} />;
165
162
  };
166
163
 
167
164
  /**
@@ -178,25 +175,22 @@ const QueueStoryWrapper = () => {
178
175
  };
179
176
 
180
177
  const meta = {
181
- title: 'plugins/plugin-transcription/Transcript',
178
+ title: 'plugins/plugin-transcription/components/Transcription',
182
179
  decorators: [
183
- withTheme,
180
+ withLayout({ layout: 'fullscreen' }),
184
181
  withPluginManager({
185
182
  plugins: [
183
+ ...corePlugins(),
184
+ StorybookPlugin({}),
186
185
  ClientPlugin({
187
- types: [TestItem, Testing.DocumentType, DataType.Person, DataType.Organization],
188
- onClientInitialized: async ({ client }) => {
189
- await client.halo.createIdentity();
190
- },
186
+ types: [TestItem, TestSchema.DocumentType, Person.Person, Organization.Organization],
187
+ onClientInitialized: ({ client }) =>
188
+ Effect.gen(function* () {
189
+ yield* initializeIdentity(client);
190
+ }),
191
191
  }),
192
- SpacePlugin({}),
193
- IntentPlugin(),
194
- SettingsPlugin(),
195
192
 
196
- // UI
197
193
  PreviewPlugin(),
198
- ThemePlugin({ tx: defaultTx }),
199
- StorybookLayoutPlugin({}),
200
194
  ],
201
195
  }),
202
196
  ],
@@ -208,12 +202,22 @@ const meta = {
208
202
 
209
203
  export default meta;
210
204
 
211
- export const Default: StoryObj<typeof BasicStory> = {
212
- render: BasicStory,
205
+ const DefaultStory = (props: DefaultStoryProps) => {
206
+ const [messages, setMessages] = useState<Message.Message[]>([]);
207
+ useEffect(() => {
208
+ void Promise.all(Array.from({ length: 10 }, () => MessageBuilder.singleton.createMessage())).then(setMessages);
209
+ }, []);
210
+ if (messages.length === 0) {
211
+ return <div>Loading messages...</div>;
212
+ }
213
+ return <BasicStory {...props} messages={messages} />;
214
+ };
215
+
216
+ export const Default: StoryObj<typeof DefaultStory> = {
217
+ render: DefaultStory,
213
218
  args: {
214
219
  ignoreAttention: true,
215
220
  attendableId: 'story',
216
- messages: await Promise.all(Array.from({ length: 10 }, () => MessageBuilder.singleton.createMessage())),
217
221
  },
218
222
  };
219
223
 
@@ -0,0 +1,65 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import React from 'react';
6
+
7
+ import { useThemeContext } from '@dxos/react-ui';
8
+ import { useTextEditor } from '@dxos/react-ui-editor';
9
+ import { type Message, type Transcript } from '@dxos/types';
10
+ import {
11
+ autoScroll,
12
+ createBasicExtensions,
13
+ createMarkdownExtensions,
14
+ createThemeExtensions,
15
+ decorateMarkdown,
16
+ documentSlots,
17
+ preview,
18
+ } from '@dxos/ui-editor';
19
+ import { composable, composableProps } from '@dxos/ui-theme';
20
+ import { isTruthy } from '@dxos/util';
21
+
22
+ import { type SerializationModel } from '../../model';
23
+ import { renderByline } from '../../util';
24
+
25
+ import { transcription } from './transcription-extension';
26
+
27
+ export { renderByline };
28
+
29
+ export type TranscriptionProps = {
30
+ transcript?: Transcript.Transcript;
31
+ model: SerializationModel<Message.Message>;
32
+ // TODO(burdon): Are these still in use?
33
+ attendableId?: string;
34
+ ignoreAttention?: boolean;
35
+ };
36
+
37
+ /**
38
+ * Transcript component implemented using the editor.
39
+ */
40
+ export const Transcription = composable<HTMLDivElement, TranscriptionProps>(
41
+ ({ transcript: object, model, children, ...props }, forwardedRef) => {
42
+ const { themeMode } = useThemeContext();
43
+ const { parentRef } = useTextEditor(() => {
44
+ return {
45
+ extensions: [
46
+ createBasicExtensions({ readOnly: true, lineWrapping: true, search: true }),
47
+ createMarkdownExtensions(),
48
+ createThemeExtensions({ themeMode, slots: documentSlots }),
49
+ decorateMarkdown(),
50
+ preview(),
51
+ transcription({ model, started: object?.started ? new Date(object.started) : undefined }),
52
+ autoScroll(),
53
+ ].filter(isTruthy),
54
+ };
55
+ }, [model]);
56
+
57
+ return (
58
+ <div
59
+ {...composableProps(props, { classNames: 'dx-container' })}
60
+ ref={parentRef}
61
+ data-popover-collision-boundary={true /* TODO(thure): Make this a constant and document it. */}
62
+ />
63
+ );
64
+ },
65
+ );
@@ -2,4 +2,4 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- export * from './Transcript';
5
+ export * from './Transcription';
@@ -8,22 +8,22 @@ import { format } from 'date-fns/format';
8
8
  import { intervalToDuration } from 'date-fns/intervalToDuration';
9
9
 
10
10
  import { type CleanupFn, addEventListener, combine } from '@dxos/async';
11
- import { type DataType } from '@dxos/schema';
11
+ import { type Message } from '@dxos/types';
12
12
 
13
13
  import { DocumentAdapter, type SerializationModel } from '../../model';
14
14
 
15
15
  /**
16
16
  * Data structure that maps Chunks queue to lines with transcript state.
17
17
  */
18
- export type TranscriptOptions = {
19
- model: SerializationModel<DataType.Message>;
18
+ export type TranscriptionOptions = {
19
+ model: SerializationModel<Message.Message>;
20
20
  started?: Date;
21
21
  };
22
22
 
23
23
  /**
24
24
  * Scrolling transcript with timestamps.
25
25
  */
26
- export const transcript = ({ model, started }: TranscriptOptions): Extension => {
26
+ export const transcription = ({ model, started }: TranscriptionOptions): Extension => {
27
27
  return [
28
28
  // Show timestamps in the gutter.
29
29
  gutter({
@@ -131,8 +131,12 @@ export const transcript = ({ model, started }: TranscriptOptions): Extension =>
131
131
  ),
132
132
 
133
133
  EditorView.theme({
134
+ '.cm-gutters': {
135
+ backgroundColor: 'var(--color-base-surface)',
136
+ },
134
137
  '.cm-timestamp-gutter': {
135
138
  width: '6rem',
139
+ paddingLeft: '0.5rem',
136
140
  paddingRight: '1rem',
137
141
  },
138
142
  '.cm-timestamp-gutter > .cm-gutterElement > div': {
@@ -156,13 +160,13 @@ class TimestampMarker extends GutterMarker {
156
160
  super();
157
161
  }
158
162
 
159
- override eq(other: this): boolean {
160
- return other._timestamp === this._timestamp;
163
+ override eq(other: this) {
164
+ return this._timestamp === other._timestamp;
161
165
  }
162
166
 
163
- override toDOM(view: EditorView): HTMLDivElement {
167
+ override toDOM(view: EditorView) {
164
168
  const el = document.createElement('div');
165
- el.className = 'text-sm text-subdued hover:bg-hoverSurface cursor-pointer';
169
+ el.className = 'text-sm text-subdued hover:bg-hover-surface cursor-pointer';
166
170
  el.textContent = formatTimestamp(this._timestamp, this._started);
167
171
  // TODO(burdon): Click to bookmark or copy hyperlink.
168
172
  el.onclick = () => {
@@ -176,7 +180,7 @@ class TimestampMarker extends GutterMarker {
176
180
  }
177
181
  }
178
182
 
179
- const getStartTime = (started?: Date, message?: DataType.Message): Date | undefined => {
183
+ const getStartTime = (started?: Date, message?: Message.Message): Date | undefined => {
180
184
  if (started) {
181
185
  return started;
182
186
  }
@@ -2,9 +2,4 @@
2
2
  // Copyright 2025 DXOS.org
3
3
  //
4
4
 
5
- import { lazy } from 'react';
6
-
7
- export * from './Transcript';
8
- export * from './TranscriptContainer';
9
-
10
- export const TranscriptContainer = lazy(() => import('./TranscriptContainer'));
5
+ export * from './Transcription';
@@ -3,33 +3,33 @@
3
3
  //
4
4
 
5
5
  import { type Meta, type StoryObj } from '@storybook/react-vite';
6
+ import * as Effect from 'effect/Effect';
6
7
  import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
7
8
 
8
- import { Events, IntentPlugin, SettingsPlugin } from '@dxos/app-framework';
9
9
  import { withPluginManager } from '@dxos/app-framework/testing';
10
+ import { AppActivationEvents } from '@dxos/app-toolkit';
10
11
  import { scheduleTask } from '@dxos/async';
11
12
  import { Context } from '@dxos/context';
12
13
  import { Obj } from '@dxos/echo';
13
14
  import { createQueueDXN } from '@dxos/echo/internal';
14
15
  import { MemoryQueue } from '@dxos/echo-db';
15
- import { FunctionExecutor, ServiceContainer } from '@dxos/functions';
16
+ import { FunctionExecutor, ServiceContainer } from '@dxos/functions-runtime';
16
17
  import { log } from '@dxos/log';
17
18
  import { ClientPlugin } from '@dxos/plugin-client';
19
+ import { initializeIdentity } from '@dxos/plugin-client/testing';
18
20
  import { PreviewPlugin } from '@dxos/plugin-preview';
19
- import { SpacePlugin } from '@dxos/plugin-space';
20
- import { StorybookLayoutPlugin } from '@dxos/plugin-storybook-layout';
21
- import { ThemePlugin } from '@dxos/plugin-theme';
22
- import { withLayout, withTheme } from '@dxos/react-ui/testing';
23
- import { defaultTx } from '@dxos/react-ui-theme';
24
- import { DataType } from '@dxos/schema';
25
- import { Testing, seedTestData } from '@dxos/schema/testing';
21
+ import { StorybookPlugin, corePlugins } from '@dxos/plugin-testing';
22
+ import { withLayout } from '@dxos/react-ui/testing';
23
+ import { TestSchema } from '@dxos/schema/testing';
24
+ import { type Actor, Message, Organization, Person } from '@dxos/types';
25
+ import { seedTestData } from '@dxos/types/testing';
26
26
 
27
- import { useAudioFile, useQueueModelAdapter, useTranscriber } from '../../hooks';
27
+ import { useAudioFile, useQueueModelAdapter, useTranscriber } from '#hooks';
28
28
  import { MessageNormalizer, getActorId } from '../../segments-normalization';
29
- import { TestItem } from '../../testing';
30
- import { type MediaStreamRecorderParams, type TranscriberParams } from '../../transcriber';
29
+ import { TestItem } from '#testing';
30
+ import { type MediaStreamRecorderProps, type TranscriberProps } from '../../transcriber';
31
31
  import { TranscriptionPlugin } from '../../TranscriptionPlugin';
32
- import { renderByline } from '../Transcript';
32
+ import { renderByline } from '../../util';
33
33
 
34
34
  import { TranscriptionStory } from './TranscriptionStory';
35
35
  import { useIsSpeaking } from './useIsSpeaking';
@@ -45,12 +45,12 @@ const AudioFile = ({
45
45
  detectSpeaking?: boolean;
46
46
  normalizeSentences?: boolean;
47
47
  audioUrl: string;
48
- transcriberConfig?: TranscriberParams['config'];
49
- recorderConfig?: MediaStreamRecorderParams['config'];
48
+ transcriberConfig?: TranscriberProps['config'];
49
+ recorderConfig?: MediaStreamRecorderProps['config'];
50
50
  audioConstraints?: MediaTrackConstraints;
51
51
  }) => {
52
52
  const [running, setRunning] = useState(false);
53
- const actor: DataType.Actor = useMemo(() => ({ name: 'You' }), []);
53
+ const actor: Actor.Actor = useMemo(() => ({ name: 'You' }), []);
54
54
 
55
55
  // Audio.
56
56
  const { audio, track, stream } = useAudioFile(audioUrl, audioConstraints);
@@ -79,13 +79,13 @@ const AudioFile = ({
79
79
  // Transcriber.
80
80
  // TODO(dmaretskyi): Use space.queues.create() instead.
81
81
  const queueDxn = useMemo(() => createQueueDXN(), []);
82
- const queue = useMemo(() => new MemoryQueue<DataType.Message>(queueDxn), [queueDxn]);
82
+ const queue = useMemo(() => new MemoryQueue<Message.Message>(queueDxn), [queueDxn]);
83
83
 
84
84
  const model = useQueueModelAdapter(renderByline([]), queue);
85
- const handleSegments = useCallback<TranscriberParams['onSegments']>(
85
+ const handleSegments = useCallback<TranscriberProps['onSegments']>(
86
86
  async (blocks) => {
87
87
  void queue?.append([
88
- Obj.make(DataType.Message, {
88
+ Obj.make(Message.Message, {
89
89
  created: new Date().toISOString(),
90
90
  sender: actor,
91
91
  blocks,
@@ -185,32 +185,26 @@ const AudioFile = ({
185
185
  };
186
186
 
187
187
  const meta = {
188
- title: 'plugins/plugin-transcription/FileTranscription',
188
+ title: 'plugins/plugin-transcription/components/FileTranscription',
189
189
  decorators: [
190
- withTheme,
191
- withLayout({ container: 'column' }),
190
+ withLayout({ layout: 'column' }),
192
191
  withPluginManager({
193
192
  plugins: [
193
+ ...corePlugins(),
194
+ StorybookPlugin({}),
194
195
  ClientPlugin({
195
- types: [TestItem, DataType.Person, DataType.Organization, Testing.DocumentType],
196
- onClientInitialized: async ({ client }) => {
197
- await client.halo.createIdentity();
198
- await client.spaces.waitUntilReady();
199
- await client.spaces.default.waitUntilReady();
200
- await seedTestData(client.spaces.default);
201
- },
196
+ types: [TestItem, Person.Person, Organization.Organization, TestSchema.DocumentType],
197
+ onClientInitialized: ({ client }) =>
198
+ Effect.gen(function* () {
199
+ const { personalSpace } = yield* initializeIdentity(client);
200
+ yield* Effect.promise(() => seedTestData(personalSpace));
201
+ }),
202
202
  }),
203
- SpacePlugin({}),
204
- IntentPlugin(),
205
203
 
206
- // UI
207
- ThemePlugin({ tx: defaultTx }),
208
- SettingsPlugin(),
209
204
  PreviewPlugin(),
210
205
  TranscriptionPlugin(),
211
- StorybookLayoutPlugin({}),
212
206
  ],
213
- fireEvents: [Events.SetupAppGraph],
207
+ fireEvents: [AppActivationEvents.SetupAppGraph],
214
208
  }),
215
209
  ],
216
210
  } satisfies Meta;
@@ -8,18 +8,18 @@ import React, { useEffect, useMemo, useState } from 'react';
8
8
  import { log } from '@dxos/log';
9
9
  import { Toolbar } from '@dxos/react-ui';
10
10
  import { withLayout, withTheme } from '@dxos/react-ui/testing';
11
- import { mx } from '@dxos/react-ui-theme';
11
+ import { mx } from '@dxos/ui-theme';
12
12
 
13
13
  type Word = {
14
14
  text: string;
15
15
  matched: boolean;
16
16
  };
17
17
 
18
- type StoryProps = {
18
+ type DefaultStoryProps = {
19
19
  keywords: string[];
20
20
  };
21
21
 
22
- const DefaultStory = ({ keywords }: StoryProps) => {
22
+ const DefaultStory = ({ keywords }: DefaultStoryProps) => {
23
23
  const [running, setRunning] = useState(false);
24
24
  const [matchingWords, setMatchingWords] = useState<Word[]>(keywords.map((word) => ({ text: word, matched: false })));
25
25
 
@@ -101,7 +101,7 @@ const DefaultStory = ({ keywords }: StoryProps) => {
101
101
  <span
102
102
  key={index}
103
103
  className={mx(
104
- 'px-3 py-1 m-2 rounded border',
104
+ 'px-3 py-1 m-2 rounded-sm border',
105
105
  word.matched ? 'bg-red-200 text-red-800 border-red-300' : 'bg-gray-200 text-gray-600 border-gray-300',
106
106
  )}
107
107
  >
@@ -116,9 +116,9 @@ const DefaultStory = ({ keywords }: StoryProps) => {
116
116
  };
117
117
 
118
118
  const meta = {
119
- title: 'plugins/plugin-transcription/KeyWordDetection',
119
+ title: 'plugins/plugin-transcription/components/KeyWordDetection',
120
120
  render: DefaultStory,
121
- decorators: [withTheme, withLayout({ container: 'column' })],
121
+ decorators: [withTheme(), withLayout({ layout: 'column' })],
122
122
  } satisfies Meta<typeof DefaultStory>;
123
123
 
124
124
  export default meta;