@dxos/plugin-transcription 0.8.4-main.bc674ce → 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 (221) hide show
  1. package/dist/lib/browser/blueprints/index.mjs +27 -5
  2. package/dist/lib/browser/blueprints/index.mjs.map +4 -4
  3. package/dist/lib/browser/chunk-RIUSFL62.mjs +112 -0
  4. package/dist/lib/browser/chunk-RIUSFL62.mjs.map +7 -0
  5. package/dist/lib/browser/chunk-YXU2ZO6W.mjs +17 -0
  6. package/dist/lib/browser/chunk-YXU2ZO6W.mjs.map +7 -0
  7. package/dist/lib/browser/create-IZPB7VZW.mjs +19 -0
  8. package/dist/lib/browser/create-IZPB7VZW.mjs.map +7 -0
  9. package/dist/lib/browser/index.mjs +1154 -60
  10. package/dist/lib/browser/index.mjs.map +4 -4
  11. package/dist/lib/browser/meta.json +1 -1
  12. package/dist/lib/browser/open-SN5O5I6X.mjs +29 -0
  13. package/dist/lib/browser/open-SN5O5I6X.mjs.map +7 -0
  14. package/dist/lib/browser/operations/index.mjs +13 -0
  15. package/dist/lib/browser/operations/index.mjs.map +7 -0
  16. package/dist/lib/browser/summarize-5MZENAU5.mjs +71 -0
  17. package/dist/lib/browser/summarize-5MZENAU5.mjs.map +7 -0
  18. package/dist/lib/browser/types/index.mjs +1 -5
  19. package/dist/lib/node-esm/blueprints/index.mjs +27 -5
  20. package/dist/lib/node-esm/blueprints/index.mjs.map +4 -4
  21. package/dist/lib/node-esm/chunk-3GSFEN4L.mjs +113 -0
  22. package/dist/lib/node-esm/chunk-3GSFEN4L.mjs.map +7 -0
  23. package/dist/lib/node-esm/chunk-BR2R6PCT.mjs +19 -0
  24. package/dist/lib/node-esm/chunk-BR2R6PCT.mjs.map +7 -0
  25. package/dist/lib/node-esm/create-TQDGXQBL.mjs +20 -0
  26. package/dist/lib/node-esm/create-TQDGXQBL.mjs.map +7 -0
  27. package/dist/lib/node-esm/index.mjs +1154 -60
  28. package/dist/lib/node-esm/index.mjs.map +4 -4
  29. package/dist/lib/node-esm/meta.json +1 -1
  30. package/dist/lib/node-esm/open-4GAAWWKJ.mjs +30 -0
  31. package/dist/lib/node-esm/open-4GAAWWKJ.mjs.map +7 -0
  32. package/dist/lib/node-esm/operations/index.mjs +14 -0
  33. package/dist/lib/node-esm/operations/index.mjs.map +7 -0
  34. package/dist/lib/node-esm/summarize-RVOSRHEC.mjs +72 -0
  35. package/dist/lib/node-esm/summarize-RVOSRHEC.mjs.map +7 -0
  36. package/dist/lib/node-esm/types/index.mjs +1 -5
  37. package/dist/types/src/TranscriptionPlugin.d.ts.map +1 -1
  38. package/dist/types/src/blueprints/index.d.ts +1 -1
  39. package/dist/types/src/blueprints/index.d.ts.map +1 -1
  40. package/dist/types/src/blueprints/transcription-blueprint.d.ts +3 -20
  41. package/dist/types/src/blueprints/transcription-blueprint.d.ts.map +1 -1
  42. package/dist/types/src/capabilities/blueprint-definition.d.ts +6 -0
  43. package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
  44. package/dist/types/src/capabilities/index.d.ts +6 -4
  45. package/dist/types/src/capabilities/index.d.ts.map +1 -1
  46. package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
  47. package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
  48. package/dist/types/src/capabilities/react-surface.d.ts +5 -0
  49. package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
  50. package/dist/types/src/capabilities/transcriber.d.ts +9 -0
  51. package/dist/types/src/capabilities/transcriber.d.ts.map +1 -0
  52. package/dist/types/src/components/{Transcript/Transcript.d.ts → Transcription/Transcription.d.ts} +10 -5
  53. package/dist/types/src/components/Transcription/Transcription.d.ts.map +1 -0
  54. package/dist/types/src/components/{Transcript/Transcript.stories.d.ts → Transcription/Transcription.stories.d.ts} +12 -12
  55. package/dist/types/src/components/Transcription/Transcription.stories.d.ts.map +1 -0
  56. package/dist/types/src/components/Transcription/index.d.ts +2 -0
  57. package/dist/types/src/components/Transcription/index.d.ts.map +1 -0
  58. package/dist/types/src/components/{Transcript/transcript-extension.d.ts → Transcription/transcription-extension.d.ts} +3 -3
  59. package/dist/types/src/components/Transcription/transcription-extension.d.ts.map +1 -0
  60. package/dist/types/src/components/index.d.ts +1 -3
  61. package/dist/types/src/components/index.d.ts.map +1 -1
  62. package/dist/types/src/components/stories/FileTranscription.stories.d.ts.map +1 -1
  63. package/dist/types/src/components/stories/KeyWordRecognition.stories.d.ts +2 -2
  64. package/dist/types/src/components/stories/KeyWordRecognition.stories.d.ts.map +1 -1
  65. package/dist/types/src/components/stories/MicrophoneTranscription.stories.d.ts +2 -2
  66. package/dist/types/src/components/stories/MicrophoneTranscription.stories.d.ts.map +1 -1
  67. package/dist/types/src/components/stories/TranscriptionStory.d.ts.map +1 -1
  68. package/dist/types/src/containers/TranscriptionContainer/TranscriptionContainer.d.ts +6 -0
  69. package/dist/types/src/containers/TranscriptionContainer/TranscriptionContainer.d.ts.map +1 -0
  70. package/dist/types/src/containers/TranscriptionContainer/index.d.ts +3 -0
  71. package/dist/types/src/containers/TranscriptionContainer/index.d.ts.map +1 -0
  72. package/dist/types/src/containers/index.d.ts +3 -0
  73. package/dist/types/src/containers/index.d.ts.map +1 -0
  74. package/dist/types/src/hooks/useTranscriber.d.ts +1 -1
  75. package/dist/types/src/hooks/useTranscriber.d.ts.map +1 -1
  76. package/dist/types/src/operations/create.d.ts +5 -0
  77. package/dist/types/src/operations/create.d.ts.map +1 -0
  78. package/dist/types/src/operations/definitions.d.ts +905 -0
  79. package/dist/types/src/operations/definitions.d.ts.map +1 -0
  80. package/dist/types/src/operations/index.d.ts +4 -0
  81. package/dist/types/src/operations/index.d.ts.map +1 -0
  82. package/dist/types/src/operations/open.d.ts +5 -0
  83. package/dist/types/src/operations/open.d.ts.map +1 -0
  84. package/dist/types/src/operations/summarize.d.ts +8 -0
  85. package/dist/types/src/operations/summarize.d.ts.map +1 -0
  86. package/dist/types/src/segments-normalization/normalization.d.ts +41 -200
  87. package/dist/types/src/segments-normalization/normalization.d.ts.map +1 -1
  88. package/dist/types/src/testing/testing.d.ts.map +1 -1
  89. package/dist/types/src/translations.d.ts +7 -7
  90. package/dist/types/src/translations.d.ts.map +1 -1
  91. package/dist/types/src/types/index.d.ts +0 -2
  92. package/dist/types/src/types/index.d.ts.map +1 -1
  93. package/dist/types/tsconfig.tsbuildinfo +1 -1
  94. package/package.json +86 -65
  95. package/src/TranscriptionPlugin.tsx +17 -13
  96. package/src/blueprints/index.ts +1 -1
  97. package/src/blueprints/transcription-blueprint.ts +13 -8
  98. package/src/capabilities/blueprint-definition.ts +17 -0
  99. package/src/capabilities/index.ts +10 -4
  100. package/src/capabilities/operation-handler.ts +16 -0
  101. package/src/capabilities/react-surface.tsx +30 -0
  102. package/src/capabilities/{transcriber/transcriber.ts → transcriber.ts} +6 -6
  103. package/src/components/{Transcript/Transcript.stories.tsx → Transcription/Transcription.stories.tsx} +17 -14
  104. package/src/components/Transcription/Transcription.tsx +65 -0
  105. package/src/components/{Transcript → Transcription}/index.ts +1 -1
  106. package/src/components/{Transcript/transcript-extension.ts → Transcription/transcription-extension.ts} +4 -4
  107. package/src/components/index.ts +1 -6
  108. package/src/components/stories/FileTranscription.stories.tsx +9 -11
  109. package/src/components/stories/KeyWordRecognition.stories.tsx +6 -6
  110. package/src/components/stories/MicrophoneTranscription.stories.tsx +13 -31
  111. package/src/components/stories/TranscriptionStory.tsx +7 -5
  112. package/src/containers/TranscriptionContainer/TranscriptionContainer.tsx +32 -0
  113. package/src/containers/TranscriptionContainer/index.ts +7 -0
  114. package/src/containers/index.ts +7 -0
  115. package/src/hooks/useTranscriber.ts +2 -2
  116. package/src/meta.ts +1 -1
  117. package/src/model/model.test.ts +6 -6
  118. package/src/operations/create.ts +22 -0
  119. package/src/operations/definitions.ts +102 -0
  120. package/src/operations/index.ts +13 -0
  121. package/src/operations/open.ts +31 -0
  122. package/src/{functions → operations}/summarize.ts +41 -47
  123. package/src/segments-normalization/normalization.test.ts +1 -1
  124. package/src/segments-normalization/normalization.ts +33 -71
  125. package/src/testing/testing.ts +1 -11
  126. package/src/transcriber/transcriber.ts +1 -1
  127. package/src/translations.ts +7 -7
  128. package/src/types/capabilities.ts +3 -3
  129. package/src/types/index.ts +0 -2
  130. package/dist/lib/browser/TranscriptContainer-6EHKWVS4.mjs +0 -12
  131. package/dist/lib/browser/TranscriptContainer-6EHKWVS4.mjs.map +0 -7
  132. package/dist/lib/browser/blueprint-definition-FTRNMLJZ.mjs +0 -18
  133. package/dist/lib/browser/blueprint-definition-FTRNMLJZ.mjs.map +0 -7
  134. package/dist/lib/browser/chunk-ICM7JRCO.mjs +0 -698
  135. package/dist/lib/browser/chunk-ICM7JRCO.mjs.map +0 -7
  136. package/dist/lib/browser/chunk-Q5OC3WVG.mjs +0 -72
  137. package/dist/lib/browser/chunk-Q5OC3WVG.mjs.map +0 -7
  138. package/dist/lib/browser/chunk-SYGEFDWO.mjs +0 -8
  139. package/dist/lib/browser/chunk-SYGEFDWO.mjs.map +0 -7
  140. package/dist/lib/browser/chunk-TKFU53OZ.mjs +0 -460
  141. package/dist/lib/browser/chunk-TKFU53OZ.mjs.map +0 -7
  142. package/dist/lib/browser/chunk-ZZF7ICVM.mjs +0 -150
  143. package/dist/lib/browser/chunk-ZZF7ICVM.mjs.map +0 -7
  144. package/dist/lib/browser/operation-resolver-ZUWTU7C5.mjs +0 -22
  145. package/dist/lib/browser/operation-resolver-ZUWTU7C5.mjs.map +0 -7
  146. package/dist/lib/browser/react-surface-ZXH5267I.mjs +0 -34
  147. package/dist/lib/browser/react-surface-ZXH5267I.mjs.map +0 -7
  148. package/dist/lib/browser/transcriber-EZZTUCPE.mjs +0 -60
  149. package/dist/lib/browser/transcriber-EZZTUCPE.mjs.map +0 -7
  150. package/dist/lib/node-esm/TranscriptContainer-5YT5W73I.mjs +0 -13
  151. package/dist/lib/node-esm/TranscriptContainer-5YT5W73I.mjs.map +0 -7
  152. package/dist/lib/node-esm/blueprint-definition-IOX35YUX.mjs +0 -19
  153. package/dist/lib/node-esm/blueprint-definition-IOX35YUX.mjs.map +0 -7
  154. package/dist/lib/node-esm/chunk-4BFY6P2D.mjs +0 -73
  155. package/dist/lib/node-esm/chunk-4BFY6P2D.mjs.map +0 -7
  156. package/dist/lib/node-esm/chunk-BX2AB7S7.mjs +0 -699
  157. package/dist/lib/node-esm/chunk-BX2AB7S7.mjs.map +0 -7
  158. package/dist/lib/node-esm/chunk-CWP22IHV.mjs +0 -151
  159. package/dist/lib/node-esm/chunk-CWP22IHV.mjs.map +0 -7
  160. package/dist/lib/node-esm/chunk-EPC27WWV.mjs +0 -461
  161. package/dist/lib/node-esm/chunk-EPC27WWV.mjs.map +0 -7
  162. package/dist/lib/node-esm/chunk-GVAVEVZ6.mjs +0 -10
  163. package/dist/lib/node-esm/chunk-GVAVEVZ6.mjs.map +0 -7
  164. package/dist/lib/node-esm/operation-resolver-Z72B4H2Q.mjs +0 -23
  165. package/dist/lib/node-esm/operation-resolver-Z72B4H2Q.mjs.map +0 -7
  166. package/dist/lib/node-esm/react-surface-6GUBZX2V.mjs +0 -35
  167. package/dist/lib/node-esm/react-surface-6GUBZX2V.mjs.map +0 -7
  168. package/dist/lib/node-esm/transcriber-RGW3YYT4.mjs +0 -61
  169. package/dist/lib/node-esm/transcriber-RGW3YYT4.mjs.map +0 -7
  170. package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +0 -9
  171. package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +0 -1
  172. package/dist/types/src/capabilities/blueprint-definition/index.d.ts +0 -3
  173. package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +0 -1
  174. package/dist/types/src/capabilities/operation-handler/index.d.ts +0 -3
  175. package/dist/types/src/capabilities/operation-handler/index.d.ts.map +0 -1
  176. package/dist/types/src/capabilities/operation-handler/operation-handler.d.ts +0 -5
  177. package/dist/types/src/capabilities/operation-handler/operation-handler.d.ts.map +0 -1
  178. package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
  179. package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
  180. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
  181. package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
  182. package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
  183. package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
  184. package/dist/types/src/capabilities/react-surface/react-surface.d.ts +0 -5
  185. package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
  186. package/dist/types/src/capabilities/transcriber/index.d.ts +0 -3
  187. package/dist/types/src/capabilities/transcriber/index.d.ts.map +0 -1
  188. package/dist/types/src/capabilities/transcriber/transcriber.d.ts +0 -9
  189. package/dist/types/src/capabilities/transcriber/transcriber.d.ts.map +0 -1
  190. package/dist/types/src/components/Transcript/Transcript.d.ts.map +0 -1
  191. package/dist/types/src/components/Transcript/Transcript.stories.d.ts.map +0 -1
  192. package/dist/types/src/components/Transcript/deprecated/OldTranscript.d.ts +0 -28
  193. package/dist/types/src/components/Transcript/deprecated/OldTranscript.d.ts.map +0 -1
  194. package/dist/types/src/components/Transcript/index.d.ts +0 -2
  195. package/dist/types/src/components/Transcript/index.d.ts.map +0 -1
  196. package/dist/types/src/components/Transcript/transcript-extension.d.ts.map +0 -1
  197. package/dist/types/src/components/TranscriptContainer.d.ts +0 -7
  198. package/dist/types/src/components/TranscriptContainer.d.ts.map +0 -1
  199. package/dist/types/src/functions/index.d.ts +0 -3
  200. package/dist/types/src/functions/index.d.ts.map +0 -1
  201. package/dist/types/src/functions/open.d.ts +0 -7
  202. package/dist/types/src/functions/open.d.ts.map +0 -1
  203. package/dist/types/src/functions/summarize.d.ts +0 -11
  204. package/dist/types/src/functions/summarize.d.ts.map +0 -1
  205. package/dist/types/src/types/TranscriptAction.d.ts +0 -25
  206. package/dist/types/src/types/TranscriptAction.d.ts.map +0 -1
  207. package/src/capabilities/blueprint-definition/blueprint-definition.ts +0 -23
  208. package/src/capabilities/blueprint-definition/index.ts +0 -7
  209. package/src/capabilities/operation-handler/index.ts +0 -7
  210. package/src/capabilities/operation-handler/operation-handler.ts +0 -25
  211. package/src/capabilities/operation-resolver/index.ts +0 -7
  212. package/src/capabilities/operation-resolver/operation-resolver.ts +0 -25
  213. package/src/capabilities/react-surface/index.ts +0 -7
  214. package/src/capabilities/react-surface/react-surface.tsx +0 -27
  215. package/src/capabilities/transcriber/index.ts +0 -7
  216. package/src/components/Transcript/Transcript.tsx +0 -66
  217. package/src/components/Transcript/deprecated/OldTranscript.tsx +0 -260
  218. package/src/components/TranscriptContainer.tsx +0 -34
  219. package/src/functions/index.ts +0 -6
  220. package/src/functions/open.ts +0 -39
  221. package/src/types/TranscriptAction.ts +0 -32
@@ -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';
@@ -6,8 +6,8 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';
6
6
  import * as Effect from 'effect/Effect';
7
7
  import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
8
8
 
9
- import { Common } from '@dxos/app-framework';
10
9
  import { withPluginManager } from '@dxos/app-framework/testing';
10
+ import { AppActivationEvents } from '@dxos/app-toolkit';
11
11
  import { scheduleTask } from '@dxos/async';
12
12
  import { Context } from '@dxos/context';
13
13
  import { Obj } from '@dxos/echo';
@@ -16,16 +16,17 @@ import { MemoryQueue } from '@dxos/echo-db';
16
16
  import { FunctionExecutor, ServiceContainer } from '@dxos/functions-runtime';
17
17
  import { log } from '@dxos/log';
18
18
  import { ClientPlugin } from '@dxos/plugin-client';
19
+ import { initializeIdentity } from '@dxos/plugin-client/testing';
19
20
  import { PreviewPlugin } from '@dxos/plugin-preview';
20
21
  import { StorybookPlugin, corePlugins } from '@dxos/plugin-testing';
21
- import { withLayout, withTheme } from '@dxos/react-ui/testing';
22
+ import { withLayout } from '@dxos/react-ui/testing';
22
23
  import { TestSchema } from '@dxos/schema/testing';
23
24
  import { type Actor, Message, Organization, Person } from '@dxos/types';
24
25
  import { seedTestData } from '@dxos/types/testing';
25
26
 
26
- import { useAudioFile, useQueueModelAdapter, useTranscriber } from '../../hooks';
27
+ import { useAudioFile, useQueueModelAdapter, useTranscriber } from '#hooks';
27
28
  import { MessageNormalizer, getActorId } from '../../segments-normalization';
28
- import { TestItem } from '../../testing';
29
+ import { TestItem } from '#testing';
29
30
  import { type MediaStreamRecorderProps, type TranscriberProps } from '../../transcriber';
30
31
  import { TranscriptionPlugin } from '../../TranscriptionPlugin';
31
32
  import { renderByline } from '../../util';
@@ -184,9 +185,8 @@ const AudioFile = ({
184
185
  };
185
186
 
186
187
  const meta = {
187
- title: 'plugins/plugin-transcription/FileTranscription',
188
+ title: 'plugins/plugin-transcription/components/FileTranscription',
188
189
  decorators: [
189
- withTheme,
190
190
  withLayout({ layout: 'column' }),
191
191
  withPluginManager({
192
192
  plugins: [
@@ -196,17 +196,15 @@ const meta = {
196
196
  types: [TestItem, Person.Person, Organization.Organization, TestSchema.DocumentType],
197
197
  onClientInitialized: ({ client }) =>
198
198
  Effect.gen(function* () {
199
- yield* Effect.promise(() => client.halo.createIdentity());
200
- yield* Effect.promise(() => client.spaces.waitUntilReady());
201
- yield* Effect.promise(() => client.spaces.default.waitUntilReady());
202
- yield* Effect.promise(() => seedTestData(client.spaces.default));
199
+ const { personalSpace } = yield* initializeIdentity(client);
200
+ yield* Effect.promise(() => seedTestData(personalSpace));
203
201
  }),
204
202
  }),
205
203
 
206
204
  PreviewPlugin(),
207
205
  TranscriptionPlugin(),
208
206
  ],
209
- fireEvents: [Common.ActivationEvent.SetupAppGraph],
207
+ fireEvents: [AppActivationEvents.SetupAppGraph],
210
208
  }),
211
209
  ],
212
210
  } satisfies Meta;
@@ -15,11 +15,11 @@ type Word = {
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
 
@@ -86,7 +86,7 @@ const DefaultStory = ({ keywords }: StoryProps) => {
86
86
  }, [running, recognition]);
87
87
 
88
88
  return (
89
- <div className={mx('flex flex-col gap-2 is-[30rem]')}>
89
+ <div className={mx('flex flex-col gap-2 w-[30rem]')}>
90
90
  <Toolbar.Root>
91
91
  <Toolbar.IconButton
92
92
  iconOnly
@@ -101,7 +101,7 @@ const DefaultStory = ({ keywords }: StoryProps) => {
101
101
  <span
102
102
  key={index}
103
103
  className={mx(
104
- 'pli-3 plb-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({ layout: 'column' })],
121
+ decorators: [withTheme(), withLayout({ layout: 'column' })],
122
122
  } satisfies Meta<typeof DefaultStory>;
123
123
 
124
124
  export default meta;
@@ -6,8 +6,8 @@ import { type Meta, type StoryObj } from '@storybook/react-vite';
6
6
  import * as Effect from 'effect/Effect';
7
7
  import React, { useCallback, useEffect, useMemo, useState } from 'react';
8
8
 
9
- import { Common } from '@dxos/app-framework';
10
9
  import { withPluginManager } from '@dxos/app-framework/testing';
10
+ import { AppActivationEvents } from '@dxos/app-toolkit';
11
11
  import {
12
12
  type ExtractionFunction,
13
13
  extractionAnthropicFunction,
@@ -18,20 +18,20 @@ import {
18
18
  import { Filter, type Obj } from '@dxos/echo';
19
19
  import { createQueueDXN } from '@dxos/echo/internal';
20
20
  import { MemoryQueue } from '@dxos/echo-db';
21
- import { FunctionExecutor, ServiceContainer } from '@dxos/functions-runtime';
22
21
  import { invariant } from '@dxos/invariant';
23
22
  import { log } from '@dxos/log';
24
23
  import { ClientPlugin } from '@dxos/plugin-client';
24
+ import { initializeIdentity } from '@dxos/plugin-client/testing';
25
25
  import { PreviewPlugin } from '@dxos/plugin-preview';
26
26
  import { StorybookPlugin, corePlugins } from '@dxos/plugin-testing';
27
27
  import { IndexKind, useSpace } from '@dxos/react-client/echo';
28
- import { withLayout, withTheme } from '@dxos/react-ui/testing';
28
+ import { withLayout } from '@dxos/react-ui/testing';
29
29
  import { TestSchema } from '@dxos/schema/testing';
30
30
  import { Message, Organization, Person } from '@dxos/types';
31
31
  import { seedTestData } from '@dxos/types/testing';
32
32
 
33
- import { useAudioTrack, useQueueModelAdapter, useTranscriber } from '../../hooks';
34
- import { TestItem } from '../../testing';
33
+ import { useAudioTrack, useQueueModelAdapter, useTranscriber } from '#hooks';
34
+ import { TestItem } from '#testing';
35
35
  import { type MediaStreamRecorderProps, type TranscriberProps } from '../../transcriber';
36
36
  import { TranscriptionPlugin } from '../../TranscriptionPlugin';
37
37
  import { renderByline } from '../../util';
@@ -48,7 +48,7 @@ const RECORDER_CONFIG = {
48
48
  interval: 200,
49
49
  };
50
50
 
51
- type StoryProps = {
51
+ type DefaultStoryProps = {
52
52
  detectSpeaking?: boolean;
53
53
  transcriberConfig: TranscriberProps['config'];
54
54
  recorderConfig: MediaStreamRecorderProps['config'];
@@ -62,7 +62,7 @@ const DefaultStory = ({
62
62
  transcriberConfig,
63
63
  recorderConfig,
64
64
  audioConstraints,
65
- }: StoryProps) => {
65
+ }: DefaultStoryProps) => {
66
66
  const [running, setRunning] = useState(false);
67
67
 
68
68
  // Audio.
@@ -85,13 +85,12 @@ const DefaultStory = ({
85
85
  }, [space]);
86
86
 
87
87
  // Entity extraction.
88
- const { extractionFunction, executor, objects } = useMemo(() => {
88
+ const { extractionFunction, objects } = useMemo(() => {
89
89
  if (!space) {
90
90
  log.warn('no space');
91
91
  return {};
92
92
  }
93
93
 
94
- let executor: FunctionExecutor | undefined;
95
94
  let extractionFunction: ExtractionFunction | undefined;
96
95
  let objects: Promise<Obj.Unknown[]> | undefined;
97
96
 
@@ -111,20 +110,8 @@ const DefaultStory = ({
111
110
  )
112
111
  .run();
113
112
  }
114
- if (entityExtraction !== 'none') {
115
- executor = new FunctionExecutor(
116
- new ServiceContainer().setServices({
117
- // ai: {
118
- // client: new Edge AiServiceClient({
119
- // endpoint: AI_SERVICE_ENDPOINT.REMOTE,
120
- // }),
121
- // },
122
- // database: { db: space!.db },
123
- }),
124
- );
125
- }
126
113
 
127
- return { extractionFunction, executor, objects };
114
+ return { extractionFunction, objects };
128
115
  }, [entityExtraction, space]);
129
116
 
130
117
  // Transcriber.
@@ -142,9 +129,7 @@ const DefaultStory = ({
142
129
 
143
130
  if (entityExtraction !== 'none') {
144
131
  invariant(extractionFunction, 'extractionFunction is required');
145
- invariant(executor, 'executor is required');
146
132
  const result = await processTranscriptMessage({
147
- executor,
148
133
  function: extractionFunction,
149
134
  input: {
150
135
  message,
@@ -190,10 +175,9 @@ const DefaultStory = ({
190
175
  };
191
176
 
192
177
  const meta = {
193
- title: 'plugins/plugin-transcription/MicrophoneTranscription',
178
+ title: 'plugins/plugin-transcription/components/MicrophoneTranscription',
194
179
  render: DefaultStory,
195
180
  decorators: [
196
- withTheme,
197
181
  withLayout({ layout: 'column' }),
198
182
  withPluginManager({
199
183
  plugins: [
@@ -203,9 +187,7 @@ const meta = {
203
187
  types: [TestItem, Person.Person, Organization.Organization, TestSchema.DocumentType],
204
188
  onClientInitialized: ({ client }) =>
205
189
  Effect.gen(function* () {
206
- yield* Effect.promise(() => client.halo.createIdentity());
207
- yield* Effect.promise(() => client.spaces.waitUntilReady());
208
- yield* Effect.promise(() => client.spaces.default.waitUntilReady());
190
+ const { personalSpace } = yield* initializeIdentity(client);
209
191
  // TODO(mykola): Make API easier to use.
210
192
  // TODO(mykola): Delete after enabling vector indexing by default.
211
193
  // Enable vector indexing.
@@ -221,14 +203,14 @@ const meta = {
221
203
  }),
222
204
  );
223
205
  yield* Effect.promise(() => client.services.services.QueryService!.reindex());
224
- yield* Effect.promise(() => seedTestData(client.spaces.default));
206
+ yield* Effect.promise(() => seedTestData(personalSpace));
225
207
  }),
226
208
  }),
227
209
 
228
210
  PreviewPlugin(),
229
211
  TranscriptionPlugin(),
230
212
  ],
231
- fireEvents: [Common.ActivationEvent.SetupAppGraph],
213
+ fireEvents: [AppActivationEvents.SetupAppGraph],
232
214
  }),
233
215
  ],
234
216
  } satisfies Meta<typeof DefaultStory>;
@@ -10,7 +10,7 @@ import { IconButton, ScrollContainer, Toolbar } from '@dxos/react-ui';
10
10
  import { type Message } from '@dxos/types';
11
11
 
12
12
  import { type SerializationModel } from '../../model';
13
- import { TranscriptView } from '../Transcript';
13
+ import { Transcription } from '../Transcription';
14
14
 
15
15
  export const TranscriptionStory: FC<{
16
16
  model: SerializationModel<Message.Message>;
@@ -20,7 +20,7 @@ export const TranscriptionStory: FC<{
20
20
  audioRef?: RefObject<HTMLAudioElement | null>;
21
21
  }> = ({ model, running, onRunningChange, audioRef, disabled }) => {
22
22
  return (
23
- <div className='flex flex-col is-[30rem]'>
23
+ <div className='flex flex-col w-[30rem]'>
24
24
  {audioRef && <audio ref={audioRef} autoPlay />}
25
25
  <Toolbar.Root>
26
26
  <IconButton
@@ -32,9 +32,11 @@ export const TranscriptionStory: FC<{
32
32
  />
33
33
  </Toolbar.Root>
34
34
  <ScrollContainer.Root pin>
35
- <ScrollContainer.Viewport>
36
- <TranscriptView model={model} />
37
- </ScrollContainer.Viewport>
35
+ <ScrollContainer.Content>
36
+ <ScrollContainer.Viewport>
37
+ <Transcription model={model} />
38
+ </ScrollContainer.Viewport>
39
+ </ScrollContainer.Content>
38
40
  </ScrollContainer.Root>
39
41
  </div>
40
42
  );
@@ -0,0 +1,32 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ import React from 'react';
6
+
7
+ import { type ObjectSurfaceProps } from '@dxos/app-toolkit/ui';
8
+ import { Obj } from '@dxos/echo';
9
+ import { useMembers, useQueue } from '@dxos/react-client/echo';
10
+ import { Panel } from '@dxos/react-ui';
11
+ import { type Message, type Transcript } from '@dxos/types';
12
+
13
+ import { Transcription } from '#components';
14
+ import { useQueueModelAdapter } from '#hooks';
15
+ import { renderByline } from '../../util';
16
+
17
+ export type TranscriptionContainerProps = ObjectSurfaceProps<Transcript.Transcript>;
18
+
19
+ export const TranscriptionContainer = ({ role, subject: transcript, attendableId }: TranscriptionContainerProps) => {
20
+ const db = Obj.getDatabase(transcript);
21
+ const members = useMembers(db?.spaceId).map((member) => member.identity);
22
+ const queue = useQueue<Message.Message>(transcript.queue.dxn, { pollInterval: 1_000 });
23
+ const model = useQueueModelAdapter(renderByline(members), queue);
24
+
25
+ return (
26
+ <Panel.Root role={role}>
27
+ <Panel.Content asChild>
28
+ <Transcription attendableId={attendableId} model={model} transcript={transcript} />
29
+ </Panel.Content>
30
+ </Panel.Root>
31
+ );
32
+ };
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ import { TranscriptionContainer } from './TranscriptionContainer';
6
+
7
+ export default TranscriptionContainer;
@@ -0,0 +1,7 @@
1
+ //
2
+ // Copyright 2024 DXOS.org
3
+ //
4
+
5
+ import { type ComponentType, lazy } from 'react';
6
+
7
+ export const TranscriptionContainer: ComponentType<any> = lazy(() => import('./TranscriptionContainer'));
@@ -4,10 +4,10 @@
4
4
 
5
5
  import { useEffect, useMemo } from 'react';
6
6
 
7
- import { useCapabilities } from '@dxos/app-framework/react';
7
+ import { useCapabilities } from '@dxos/app-framework/ui';
8
8
 
9
9
  import { type Transcriber } from '../transcriber';
10
- import { TranscriptionCapabilities } from '../types';
10
+ import { TranscriptionCapabilities } from '#types';
11
11
 
12
12
  /**
13
13
  * Records audio while user is speaking and transcribes it after user is done speaking.
package/src/meta.ts CHANGED
@@ -6,7 +6,7 @@ import { type Plugin } from '@dxos/app-framework';
6
6
  import { trim } from '@dxos/util';
7
7
 
8
8
  export const meta: Plugin.Meta = {
9
- id: 'dxos.org/plugin/transcription',
9
+ id: 'org.dxos.plugin.transcription',
10
10
  name: 'Transcription',
11
11
  description: trim`
12
12
  Real-time voice-to-text transcription service for capturing spoken content.
@@ -51,8 +51,8 @@ describe('SerializationModel', () => {
51
51
  }
52
52
 
53
53
  // Update message.
54
- Obj.change(message, (m) => {
55
- m.blocks.push({ _tag: 'transcript', started: createDate(), text: 'Hello again!' });
54
+ Obj.change(message, (obj) => {
55
+ obj.blocks.push({ _tag: 'transcript', started: createDate(), text: 'Hello again!' });
56
56
  });
57
57
  model.updateChunk(message);
58
58
  {
@@ -133,16 +133,16 @@ describe('SerializationModel', () => {
133
133
  expect(view.state.doc.toString()).to.eq('###### Alice\nHello world!\n\n');
134
134
 
135
135
  // Update message (add block).
136
- Obj.change(message, (m) => {
137
- m.blocks.push({ _tag: 'transcript', started: createDate(), text: 'Hello again!' });
136
+ Obj.change(message, (obj) => {
137
+ obj.blocks.push({ _tag: 'transcript', started: createDate(), text: 'Hello again!' });
138
138
  });
139
139
  model.updateChunk(message);
140
140
  model.sync(adapter);
141
141
  expect(view.state.doc.toString()).to.eq('###### Alice\nHello world!\nHello again!\n\n');
142
142
 
143
143
  // Update message (remove block).
144
- Obj.change(message, (m) => {
145
- m.blocks.splice(0, 1);
144
+ Obj.change(message, (obj) => {
145
+ obj.blocks.splice(0, 1);
146
146
  });
147
147
  model.updateChunk(message);
148
148
  model.sync(adapter);
@@ -0,0 +1,22 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Operation } from '@dxos/operation';
8
+ import { Transcript } from '@dxos/types';
9
+
10
+ import { Create } from './definitions';
11
+
12
+ const handler: Operation.WithHandler<typeof Create> = Create.pipe(
13
+ Operation.withHandler(
14
+ Effect.fn(function* ({ space }) {
15
+ return {
16
+ object: Transcript.make(space.queues.create().dxn),
17
+ };
18
+ }),
19
+ ),
20
+ );
21
+
22
+ export default handler;
@@ -0,0 +1,102 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Schema from 'effect/Schema';
6
+
7
+ import { AiService } from '@dxos/ai';
8
+ import { SpaceSchema } from '@dxos/client/echo';
9
+ import { Database, Ref } from '@dxos/echo';
10
+ import { QueueService } from '@dxos/functions';
11
+ import { Operation } from '@dxos/operation';
12
+ import { Message, Transcript } from '@dxos/types';
13
+
14
+ import { meta } from '#meta';
15
+
16
+ const TRANSCRIPT_OPERATION = `${meta.id}.operation`;
17
+
18
+ export const Create = Operation.make({
19
+ meta: { key: `${TRANSCRIPT_OPERATION}.create`, name: 'Create Transcript' },
20
+ input: Schema.Struct({
21
+ name: Schema.optional(Schema.String),
22
+ space: SpaceSchema,
23
+ }),
24
+ output: Schema.Struct({
25
+ object: Transcript.Transcript,
26
+ }),
27
+ });
28
+
29
+ export const MessageWithRangeId = Schema.extend(
30
+ Message.Message,
31
+ Schema.Struct({
32
+ rangeId: Schema.optional(Schema.Array(Schema.String)).annotations({
33
+ description: 'The IDs of the messages that contain the sentences.',
34
+ }),
35
+ }),
36
+ );
37
+
38
+ export type MessageWithRangeIdType = Schema.Schema.Type<typeof MessageWithRangeId>;
39
+
40
+ export const Open = Operation.make({
41
+ meta: {
42
+ key: 'org.dxos.function.transcription.open',
43
+ name: 'Open',
44
+ description: 'Opens and reads the contents of a transcription object.',
45
+ },
46
+ input: Schema.Struct({
47
+ transcript: Ref.Ref(Transcript.Transcript).annotations({
48
+ description: 'The ID of the transcription object.',
49
+ }),
50
+ }),
51
+ output: Schema.Struct({
52
+ content: Schema.String,
53
+ }),
54
+ services: [Database.Service, QueueService],
55
+ });
56
+
57
+ export const Summarize = Operation.make({
58
+ meta: {
59
+ key: 'org.dxos.function.transcription.summarize',
60
+ name: 'Summarize',
61
+ description: 'Summarize a transcript of a meeting.',
62
+ },
63
+ input: Schema.Struct({
64
+ transcript: Schema.String.annotations({
65
+ description: 'The transcript of the meeting.',
66
+ }),
67
+ notes: Schema.optional(Schema.String).annotations({
68
+ description: 'Additional notes from the participants.',
69
+ }),
70
+ }),
71
+ output: Schema.Struct({
72
+ summary: Schema.String.annotations({
73
+ description: 'The summary of the transcript.',
74
+ }),
75
+ }),
76
+ services: [AiService.AiService],
77
+ });
78
+
79
+ export const SentenceNormalizationInput = Schema.Struct({
80
+ messages: Schema.Array(MessageWithRangeId).annotations({
81
+ description: 'Messages to normalize into sentences.',
82
+ }),
83
+ });
84
+
85
+ export type SentenceNormalizationInputType = Schema.Schema.Type<typeof SentenceNormalizationInput>;
86
+
87
+ export const SentenceNormalizationOutput = Schema.Struct({
88
+ sentences: Schema.Array(MessageWithRangeId.pipe(Schema.mutable)).pipe(Schema.mutable).annotations({
89
+ description: 'The sentences of the transcript.',
90
+ }),
91
+ });
92
+
93
+ export const SentenceNormalization = Operation.make({
94
+ meta: {
95
+ key: 'org.dxos.function.transcription.sentence-normalization',
96
+ name: 'Sentence Normalization',
97
+ description: 'Post process of transcription for sentence normalization',
98
+ },
99
+ input: SentenceNormalizationInput,
100
+ output: SentenceNormalizationOutput,
101
+ services: [],
102
+ });
@@ -0,0 +1,13 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import { OperationHandlerSet } from '@dxos/operation';
6
+
7
+ export * as TranscriptOperation from './definitions';
8
+
9
+ export const TranscriptionOperationHandlerSet = OperationHandlerSet.lazy(
10
+ () => import('./create'),
11
+ () => import('./open'),
12
+ () => import('./summarize'),
13
+ );
@@ -0,0 +1,31 @@
1
+ //
2
+ // Copyright 2025 DXOS.org
3
+ //
4
+
5
+ import * as Effect from 'effect/Effect';
6
+
7
+ import { Database, Obj } from '@dxos/echo';
8
+ import { QueueService } from '@dxos/functions';
9
+ import { Operation } from '@dxos/operation';
10
+ import { Message } from '@dxos/types';
11
+
12
+ import { renderByline } from '../util';
13
+ import { Open } from './definitions';
14
+
15
+ const handler: Operation.WithHandler<typeof Open> = Open.pipe(
16
+ Operation.withHandler(
17
+ Effect.fn(function* ({ transcript }) {
18
+ const transcriptObj = yield* Database.load(transcript);
19
+ const { dxn } = yield* Effect.promise(() => transcriptObj.queue.load());
20
+ const queue = yield* QueueService.getQueue(dxn);
21
+ yield* Effect.promise(() => queue?.queryObjects());
22
+ const content = queue?.objects
23
+ .filter((message: unknown) => Obj.instanceOf(Message.Message, message))
24
+ .flatMap((message: Message.Message, index: number) => renderByline([])(message, index))
25
+ .join('\n\n');
26
+ return { content };
27
+ }),
28
+ ),
29
+ );
30
+
31
+ export default handler;