@dxos/plugin-transcription 0.8.4-main.406dc2a → 0.8.4-main.548089c
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.
- package/dist/lib/browser/TranscriptContainer-EKSP5DQ6.mjs +11 -0
- package/dist/lib/browser/{blueprint-definition-GO6GTEBT.mjs → blueprint-definition-WBWHO4OH.mjs} +8 -8
- package/dist/lib/browser/blueprint-definition-WBWHO4OH.mjs.map +7 -0
- package/dist/lib/browser/{chunk-LCK3YRQF.mjs → chunk-3MKZ2MNQ.mjs} +2 -2
- package/dist/lib/{node-esm/chunk-PEZRQYKO.mjs → browser/chunk-EHT3TE6U.mjs} +61 -79
- package/dist/lib/browser/chunk-EHT3TE6U.mjs.map +7 -0
- package/dist/lib/browser/{chunk-77NWYLC6.mjs → chunk-OCI42DWB.mjs} +2 -2
- package/dist/lib/browser/{chunk-COBQIZ6B.mjs → chunk-PVU4XCKI.mjs} +46 -66
- package/dist/lib/browser/chunk-PVU4XCKI.mjs.map +7 -0
- package/dist/lib/browser/{chunk-7LNCQDTT.mjs → chunk-VBUIO677.mjs} +7 -2
- package/dist/lib/browser/chunk-VBUIO677.mjs.map +7 -0
- package/dist/lib/browser/{chunk-GGHMOEKZ.mjs → chunk-W7WKZTM4.mjs} +2 -2
- package/dist/lib/browser/index.mjs +10 -9
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-52EPFRMR.mjs → intent-resolver-ZTKTEAQX.mjs} +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-LCP2D2MF.mjs → react-surface-NARMYO2O.mjs} +6 -6
- package/dist/lib/browser/{transcriber-NG5MRCP6.mjs → transcriber-E2KAOXPS.mjs} +5 -5
- package/dist/lib/browser/types/index.mjs +2 -2
- package/dist/lib/node-esm/{TranscriptContainer-WCUWVVSD.mjs → TranscriptContainer-WU3EDQR3.mjs} +4 -4
- package/dist/lib/node-esm/{blueprint-definition-6SU7GLBR.mjs → blueprint-definition-WUHZFRWZ.mjs} +8 -8
- package/dist/lib/node-esm/blueprint-definition-WUHZFRWZ.mjs.map +7 -0
- package/dist/lib/{browser/chunk-ZS2FXKEF.mjs → node-esm/chunk-7XASA7DX.mjs} +62 -78
- package/dist/lib/node-esm/chunk-7XASA7DX.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-FTTZ4YSX.mjs → chunk-OLMSTF3M.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-RWRG3S2O.mjs → chunk-SWUVPFKR.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-A6SB234F.mjs → chunk-UVOYXXDJ.mjs} +46 -66
- package/dist/lib/node-esm/chunk-UVOYXXDJ.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-N5Z4SKPH.mjs → chunk-X5BKN32O.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-KLTPFUKN.mjs → chunk-YVNQN2J6.mjs} +7 -2
- package/dist/lib/node-esm/chunk-YVNQN2J6.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +10 -9
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-DZBQQRHN.mjs → intent-resolver-55WH2GY6.mjs} +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-7UC2YXX2.mjs → react-surface-5MQA3IUS.mjs} +6 -6
- package/dist/lib/node-esm/{transcriber-SMU7HD6F.mjs → transcriber-ZPJM4U2W.mjs} +5 -5
- package/dist/lib/node-esm/types/index.mjs +2 -2
- package/dist/types/src/TranscriptionPlugin.d.ts.map +1 -1
- package/dist/types/src/components/Transcript/Transcript.d.ts +3 -3
- package/dist/types/src/components/Transcript/Transcript.d.ts.map +1 -1
- package/dist/types/src/components/Transcript/Transcript.stories.d.ts +2 -2
- package/dist/types/src/components/Transcript/Transcript.stories.d.ts.map +1 -1
- package/dist/types/src/components/Transcript/transcript-extension.d.ts +2 -2
- package/dist/types/src/components/Transcript/transcript-extension.d.ts.map +1 -1
- package/dist/types/src/components/TranscriptContainer.d.ts.map +1 -1
- package/dist/types/src/components/stories/FileTranscription.stories.d.ts +0 -3
- package/dist/types/src/components/stories/FileTranscription.stories.d.ts.map +1 -1
- package/dist/types/src/components/stories/KeyWordRecognition.stories.d.ts +0 -3
- package/dist/types/src/components/stories/KeyWordRecognition.stories.d.ts.map +1 -1
- package/dist/types/src/components/stories/MicrophoneTranscription.stories.d.ts +0 -3
- package/dist/types/src/components/stories/MicrophoneTranscription.stories.d.ts.map +1 -1
- package/dist/types/src/components/stories/TranscriptionStory.d.ts +2 -2
- package/dist/types/src/components/stories/TranscriptionStory.d.ts.map +1 -1
- package/dist/types/src/hooks/useTranscriber.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/segments-normalization/message-normalizer.d.ts +3 -3
- package/dist/types/src/segments-normalization/message-normalizer.d.ts.map +1 -1
- package/dist/types/src/segments-normalization/normalization.d.ts +18 -9
- package/dist/types/src/segments-normalization/normalization.d.ts.map +1 -1
- package/dist/types/src/segments-normalization/utils.d.ts +2 -2
- package/dist/types/src/segments-normalization/utils.d.ts.map +1 -1
- package/dist/types/src/testing/testing.d.ts +5 -5
- package/dist/types/src/testing/testing.d.ts.map +1 -1
- package/dist/types/src/transcriber/transcriber.d.ts +2 -2
- package/dist/types/src/transcriber/transcriber.d.ts.map +1 -1
- package/dist/types/src/transcriber/transcription-manager.d.ts +3 -3
- package/dist/types/src/transcriber/transcription-manager.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +54 -52
- package/src/TranscriptionPlugin.tsx +5 -4
- package/src/components/Transcript/Transcript.stories.tsx +5 -5
- package/src/components/Transcript/Transcript.tsx +5 -4
- package/src/components/Transcript/transcript-extension.ts +10 -6
- package/src/components/TranscriptContainer.tsx +5 -4
- package/src/components/stories/FileTranscription.stories.tsx +10 -11
- package/src/components/stories/KeyWordRecognition.stories.tsx +3 -6
- package/src/components/stories/MicrophoneTranscription.stories.tsx +11 -12
- package/src/components/stories/TranscriptionStory.tsx +4 -4
- package/src/functions/open.ts +2 -2
- package/src/hooks/useTranscriber.ts +7 -2
- package/src/meta.ts +6 -1
- package/src/model/model.test.ts +11 -11
- package/src/segments-normalization/message-normalizer.ts +6 -6
- package/src/segments-normalization/normalization.test.ts +5 -5
- package/src/segments-normalization/normalization.ts +6 -6
- package/src/segments-normalization/utils.ts +2 -2
- package/src/testing/testing.ts +20 -15
- package/src/transcriber/transcriber.browser.test.ts +3 -3
- package/src/transcriber/transcriber.ts +3 -3
- package/src/transcriber/transcription-manager.ts +6 -6
- package/dist/lib/browser/TranscriptContainer-QN5WUMWJ.mjs +0 -11
- package/dist/lib/browser/blueprint-definition-GO6GTEBT.mjs.map +0 -7
- package/dist/lib/browser/chunk-7LNCQDTT.mjs.map +0 -7
- package/dist/lib/browser/chunk-COBQIZ6B.mjs.map +0 -7
- package/dist/lib/browser/chunk-ZS2FXKEF.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-6SU7GLBR.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-A6SB234F.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-KLTPFUKN.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-PEZRQYKO.mjs.map +0 -7
- /package/dist/lib/browser/{TranscriptContainer-QN5WUMWJ.mjs.map → TranscriptContainer-EKSP5DQ6.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-LCK3YRQF.mjs.map → chunk-3MKZ2MNQ.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-77NWYLC6.mjs.map → chunk-OCI42DWB.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-GGHMOEKZ.mjs.map → chunk-W7WKZTM4.mjs.map} +0 -0
- /package/dist/lib/browser/{intent-resolver-52EPFRMR.mjs.map → intent-resolver-ZTKTEAQX.mjs.map} +0 -0
- /package/dist/lib/browser/{react-surface-LCP2D2MF.mjs.map → react-surface-NARMYO2O.mjs.map} +0 -0
- /package/dist/lib/browser/{transcriber-NG5MRCP6.mjs.map → transcriber-E2KAOXPS.mjs.map} +0 -0
- /package/dist/lib/node-esm/{TranscriptContainer-WCUWVVSD.mjs.map → TranscriptContainer-WU3EDQR3.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-FTTZ4YSX.mjs.map → chunk-OLMSTF3M.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-RWRG3S2O.mjs.map → chunk-SWUVPFKR.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-N5Z4SKPH.mjs.map → chunk-X5BKN32O.mjs.map} +0 -0
- /package/dist/lib/node-esm/{intent-resolver-DZBQQRHN.mjs.map → intent-resolver-55WH2GY6.mjs.map} +0 -0
- /package/dist/lib/node-esm/{react-surface-7UC2YXX2.mjs.map → react-surface-5MQA3IUS.mjs.map} +0 -0
- /package/dist/lib/node-esm/{transcriber-SMU7HD6F.mjs.map → transcriber-ZPJM4U2W.mjs.map} +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-transcription",
|
|
3
|
-
"version": "0.8.4-main.
|
|
3
|
+
"version": "0.8.4-main.548089c",
|
|
4
4
|
"description": "Voice transcription.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -46,46 +46,48 @@
|
|
|
46
46
|
"react-router-dom": "^6.4.0",
|
|
47
47
|
"react-use": "^17.5.1",
|
|
48
48
|
"wavefile": "^11.0.0",
|
|
49
|
-
"@dxos/ai": "0.8.4-main.
|
|
50
|
-
"@dxos/app-framework": "0.8.4-main.
|
|
51
|
-
"@dxos/assistant": "0.8.4-main.
|
|
52
|
-
"@dxos/async": "0.8.4-main.
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/client": "0.8.4-main.
|
|
55
|
-
"@dxos/
|
|
56
|
-
"@dxos/
|
|
57
|
-
"@dxos/
|
|
58
|
-
"@dxos/
|
|
59
|
-
"@dxos/echo": "0.8.4-main.
|
|
60
|
-
"@dxos/
|
|
61
|
-
"@dxos/functions": "0.8.4-main.
|
|
62
|
-
"@dxos/keys": "0.8.4-main.
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/
|
|
67
|
-
"@dxos/
|
|
68
|
-
"@dxos/plugin-deck": "0.8.4-main.
|
|
69
|
-
"@dxos/plugin-
|
|
70
|
-
"@dxos/plugin-
|
|
71
|
-
"@dxos/plugin-
|
|
72
|
-
"@dxos/plugin-
|
|
73
|
-
"@dxos/
|
|
74
|
-
"@dxos/
|
|
75
|
-
"@dxos/react-
|
|
76
|
-
"@dxos/react-
|
|
77
|
-
"@dxos/react-ui-
|
|
78
|
-
"@dxos/react-ui-
|
|
79
|
-
"@dxos/react-ui-
|
|
80
|
-
"@dxos/react-ui-
|
|
81
|
-
"@dxos/react-ui-
|
|
82
|
-
"@dxos/
|
|
83
|
-
"@dxos/react-
|
|
84
|
-
"@dxos/
|
|
85
|
-
"@dxos/
|
|
49
|
+
"@dxos/ai": "0.8.4-main.548089c",
|
|
50
|
+
"@dxos/app-framework": "0.8.4-main.548089c",
|
|
51
|
+
"@dxos/assistant": "0.8.4-main.548089c",
|
|
52
|
+
"@dxos/async": "0.8.4-main.548089c",
|
|
53
|
+
"@dxos/blueprints": "0.8.4-main.548089c",
|
|
54
|
+
"@dxos/client": "0.8.4-main.548089c",
|
|
55
|
+
"@dxos/debug": "0.8.4-main.548089c",
|
|
56
|
+
"@dxos/display-name": "0.8.4-main.548089c",
|
|
57
|
+
"@dxos/codec-protobuf": "0.8.4-main.548089c",
|
|
58
|
+
"@dxos/context": "0.8.4-main.548089c",
|
|
59
|
+
"@dxos/echo-db": "0.8.4-main.548089c",
|
|
60
|
+
"@dxos/functions": "0.8.4-main.548089c",
|
|
61
|
+
"@dxos/functions-runtime": "0.8.4-main.548089c",
|
|
62
|
+
"@dxos/keys": "0.8.4-main.548089c",
|
|
63
|
+
"@dxos/echo": "0.8.4-main.548089c",
|
|
64
|
+
"@dxos/invariant": "0.8.4-main.548089c",
|
|
65
|
+
"@dxos/local-storage": "0.8.4-main.548089c",
|
|
66
|
+
"@dxos/live-object": "0.8.4-main.548089c",
|
|
67
|
+
"@dxos/log": "0.8.4-main.548089c",
|
|
68
|
+
"@dxos/plugin-deck": "0.8.4-main.548089c",
|
|
69
|
+
"@dxos/plugin-client": "0.8.4-main.548089c",
|
|
70
|
+
"@dxos/plugin-graph": "0.8.4-main.548089c",
|
|
71
|
+
"@dxos/plugin-markdown": "0.8.4-main.548089c",
|
|
72
|
+
"@dxos/plugin-space": "0.8.4-main.548089c",
|
|
73
|
+
"@dxos/plugin-thread": "0.8.4-main.548089c",
|
|
74
|
+
"@dxos/protocols": "0.8.4-main.548089c",
|
|
75
|
+
"@dxos/react-client": "0.8.4-main.548089c",
|
|
76
|
+
"@dxos/react-edge-client": "0.8.4-main.548089c",
|
|
77
|
+
"@dxos/react-ui-attention": "0.8.4-main.548089c",
|
|
78
|
+
"@dxos/react-ui-components": "0.8.4-main.548089c",
|
|
79
|
+
"@dxos/react-ui-editor": "0.8.4-main.548089c",
|
|
80
|
+
"@dxos/react-ui-form": "0.8.4-main.548089c",
|
|
81
|
+
"@dxos/react-ui-grid": "0.8.4-main.548089c",
|
|
82
|
+
"@dxos/react-ui-sfx": "0.8.4-main.548089c",
|
|
83
|
+
"@dxos/react-ui-stack": "0.8.4-main.548089c",
|
|
84
|
+
"@dxos/tracing": "0.8.4-main.548089c",
|
|
85
|
+
"@dxos/schema": "0.8.4-main.548089c",
|
|
86
|
+
"@dxos/types": "0.8.4-main.548089c",
|
|
87
|
+
"@dxos/util": "0.8.4-main.548089c"
|
|
86
88
|
},
|
|
87
89
|
"devDependencies": {
|
|
88
|
-
"@effect-
|
|
90
|
+
"@effect-atom/atom-react": "^0.3.4",
|
|
89
91
|
"@effect/platform": "0.92.1",
|
|
90
92
|
"@types/dom-speech-recognition": "^0.0.6",
|
|
91
93
|
"@types/react": "~19.2.2",
|
|
@@ -93,25 +95,25 @@
|
|
|
93
95
|
"react": "~19.2.0",
|
|
94
96
|
"react-dom": "~19.2.0",
|
|
95
97
|
"tailwindcss": "~3.4.1",
|
|
96
|
-
"@dxos/plugin-preview": "0.8.4-main.
|
|
97
|
-
"@dxos/plugin-storybook-layout": "0.8.4-main.
|
|
98
|
-
"@dxos/
|
|
99
|
-
"@dxos/
|
|
100
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
101
|
-
"@dxos/
|
|
102
|
-
"@dxos/react-ui-
|
|
103
|
-
"@dxos/
|
|
104
|
-
"@dxos/
|
|
105
|
-
"@dxos/test-utils": "0.8.4-main.
|
|
98
|
+
"@dxos/plugin-preview": "0.8.4-main.548089c",
|
|
99
|
+
"@dxos/plugin-storybook-layout": "0.8.4-main.548089c",
|
|
100
|
+
"@dxos/random": "0.8.4-main.548089c",
|
|
101
|
+
"@dxos/react-ui": "0.8.4-main.548089c",
|
|
102
|
+
"@dxos/react-ui-syntax-highlighter": "0.8.4-main.548089c",
|
|
103
|
+
"@dxos/plugin-theme": "0.8.4-main.548089c",
|
|
104
|
+
"@dxos/react-ui-form": "0.8.4-main.548089c",
|
|
105
|
+
"@dxos/react-ui-theme": "0.8.4-main.548089c",
|
|
106
|
+
"@dxos/storybook-utils": "0.8.4-main.548089c",
|
|
107
|
+
"@dxos/test-utils": "0.8.4-main.548089c"
|
|
106
108
|
},
|
|
107
109
|
"peerDependencies": {
|
|
108
|
-
"@effect-
|
|
110
|
+
"@effect-atom/atom-react": "^0.3.4",
|
|
109
111
|
"@effect/platform": "^0.80.12",
|
|
110
112
|
"effect": "^3.13.3",
|
|
111
113
|
"react": "^19.0.0",
|
|
112
114
|
"react-dom": "^19.0.0",
|
|
113
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
114
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
115
|
+
"@dxos/react-ui": "0.8.4-main.548089c",
|
|
116
|
+
"@dxos/react-ui-theme": "0.8.4-main.548089c"
|
|
115
117
|
},
|
|
116
118
|
"publishConfig": {
|
|
117
119
|
"access": "public"
|
|
@@ -6,7 +6,7 @@ import { Capabilities, Events, contributes, defineModule, definePlugin } from '@
|
|
|
6
6
|
import { Obj } from '@dxos/echo';
|
|
7
7
|
import { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';
|
|
8
8
|
import { getSpace } from '@dxos/react-client/echo';
|
|
9
|
-
import {
|
|
9
|
+
import { Message } from '@dxos/types';
|
|
10
10
|
|
|
11
11
|
import { BlueprintDefinition, IntentResolver, ReactSurface, Transcriber } from './capabilities';
|
|
12
12
|
import { renderByline } from './components';
|
|
@@ -23,19 +23,20 @@ export const TranscriptionPlugin = definePlugin(meta, () => [
|
|
|
23
23
|
defineModule({
|
|
24
24
|
id: `${meta.id}/module/metadata`,
|
|
25
25
|
activatesOn: Events.SetupMetadata,
|
|
26
|
-
activate: (
|
|
26
|
+
activate: () =>
|
|
27
27
|
contributes(Capabilities.Metadata, {
|
|
28
28
|
id: Transcript.Transcript.typename,
|
|
29
29
|
metadata: {
|
|
30
30
|
icon: 'ph--subtitles--regular',
|
|
31
|
+
iconHue: 'sky',
|
|
31
32
|
// TODO(wittjosiah): Factor out. Artifact? Separate capability?
|
|
32
33
|
getTextContent: async (transcript: Transcript.Transcript) => {
|
|
33
34
|
const space = getSpace(transcript);
|
|
34
35
|
const members = space?.members.get().map((member) => member.identity) ?? [];
|
|
35
|
-
const queue = space?.queues.get<
|
|
36
|
+
const queue = space?.queues.get<Message.Message>(transcript.queue.dxn);
|
|
36
37
|
await queue?.refresh();
|
|
37
38
|
const content = queue?.objects
|
|
38
|
-
.filter((message) => Obj.instanceOf(
|
|
39
|
+
.filter((message) => Obj.instanceOf(Message.Message, message))
|
|
39
40
|
.flatMap((message, index) => renderByline(members)(message, index))
|
|
40
41
|
.join('\n\n');
|
|
41
42
|
return content;
|
|
@@ -19,8 +19,8 @@ import { IconButton, Toolbar } from '@dxos/react-ui';
|
|
|
19
19
|
import { withTheme } from '@dxos/react-ui/testing';
|
|
20
20
|
import { SyntaxHighlighter } from '@dxos/react-ui-syntax-highlighter';
|
|
21
21
|
import { defaultTx } from '@dxos/react-ui-theme';
|
|
22
|
-
import { DataType } from '@dxos/schema';
|
|
23
22
|
import { Testing } from '@dxos/schema/testing';
|
|
23
|
+
import { type Message, Organization, Person } from '@dxos/types';
|
|
24
24
|
|
|
25
25
|
import { useQueueModelAdapter } from '../../hooks';
|
|
26
26
|
import { SerializationModel } from '../../model';
|
|
@@ -68,7 +68,7 @@ const TranscriptContainer: FC<
|
|
|
68
68
|
);
|
|
69
69
|
};
|
|
70
70
|
|
|
71
|
-
type StoryProps = { messages?:
|
|
71
|
+
type StoryProps = { messages?: Message.Message[] } & Pick<TranscriptViewProps, 'ignoreAttention' | 'attendableId'>;
|
|
72
72
|
|
|
73
73
|
/**
|
|
74
74
|
* Basic story mutates array of messages.
|
|
@@ -77,11 +77,11 @@ const BasicStory = ({ messages: initialMessages = [], ...props }: StoryProps) =>
|
|
|
77
77
|
const [reset, setReset] = useState({});
|
|
78
78
|
const builder = useMemo(() => new MessageBuilder(), []);
|
|
79
79
|
const model = useMemo(
|
|
80
|
-
() => new SerializationModel<
|
|
80
|
+
() => new SerializationModel<Message.Message>(renderByline([]), initialMessages),
|
|
81
81
|
[initialMessages, reset],
|
|
82
82
|
);
|
|
83
83
|
const [running, setRunning] = useState(true);
|
|
84
|
-
const [currentMessage, setCurrentMessage] = useState<
|
|
84
|
+
const [currentMessage, setCurrentMessage] = useState<Message.Message | null>(null);
|
|
85
85
|
useEffect(() => {
|
|
86
86
|
if (!running) {
|
|
87
87
|
return;
|
|
@@ -184,7 +184,7 @@ const meta = {
|
|
|
184
184
|
withPluginManager({
|
|
185
185
|
plugins: [
|
|
186
186
|
ClientPlugin({
|
|
187
|
-
types: [TestItem, Testing.DocumentType,
|
|
187
|
+
types: [TestItem, Testing.DocumentType, Person.Person, Organization.Organization],
|
|
188
188
|
onClientInitialized: async ({ client }) => {
|
|
189
189
|
await client.halo.createIdentity();
|
|
190
190
|
},
|
|
@@ -13,11 +13,12 @@ import {
|
|
|
13
13
|
createMarkdownExtensions,
|
|
14
14
|
createThemeExtensions,
|
|
15
15
|
decorateMarkdown,
|
|
16
|
+
editorSlots,
|
|
16
17
|
preview,
|
|
17
18
|
useTextEditor,
|
|
18
19
|
} from '@dxos/react-ui-editor';
|
|
19
20
|
import { mx } from '@dxos/react-ui-theme';
|
|
20
|
-
import { type
|
|
21
|
+
import { type Message } from '@dxos/types';
|
|
21
22
|
import { isTruthy } from '@dxos/util';
|
|
22
23
|
|
|
23
24
|
import { type SerializationModel } from '../../model';
|
|
@@ -28,7 +29,7 @@ import { transcript } from './transcript-extension';
|
|
|
28
29
|
// TODO(thure): Move this?
|
|
29
30
|
export const renderByline =
|
|
30
31
|
(identities: Identity[]) =>
|
|
31
|
-
(message:
|
|
32
|
+
(message: Message.Message, index: number, debug = false): string[] => {
|
|
32
33
|
if (message.sender.role === 'assistant') {
|
|
33
34
|
// Start/stop block.
|
|
34
35
|
return [message.blocks.find((block) => block._tag === 'transcript')?.text ?? '', ''];
|
|
@@ -55,7 +56,7 @@ export const renderByline =
|
|
|
55
56
|
export type TranscriptViewProps = ThemedClassName<{
|
|
56
57
|
space?: Space;
|
|
57
58
|
transcript?: Transcript.Transcript;
|
|
58
|
-
model: SerializationModel<
|
|
59
|
+
model: SerializationModel<Message.Message>;
|
|
59
60
|
// TODO(burdon): Are these still in use?
|
|
60
61
|
attendableId?: string;
|
|
61
62
|
ignoreAttention?: boolean;
|
|
@@ -71,7 +72,7 @@ export const TranscriptView = ({ classNames, space, transcript: object, model }:
|
|
|
71
72
|
extensions: [
|
|
72
73
|
createBasicExtensions({ readOnly: true, lineWrapping: true, search: true }),
|
|
73
74
|
createMarkdownExtensions(),
|
|
74
|
-
createThemeExtensions({ themeMode }),
|
|
75
|
+
createThemeExtensions({ themeMode, slots: editorSlots }),
|
|
75
76
|
decorateMarkdown(),
|
|
76
77
|
preview(),
|
|
77
78
|
transcript({
|
|
@@ -8,7 +8,7 @@ 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
|
|
11
|
+
import { type Message } from '@dxos/types';
|
|
12
12
|
|
|
13
13
|
import { DocumentAdapter, type SerializationModel } from '../../model';
|
|
14
14
|
|
|
@@ -16,7 +16,7 @@ import { DocumentAdapter, type SerializationModel } from '../../model';
|
|
|
16
16
|
* Data structure that maps Chunks queue to lines with transcript state.
|
|
17
17
|
*/
|
|
18
18
|
export type TranscriptOptions = {
|
|
19
|
-
model: SerializationModel<
|
|
19
|
+
model: SerializationModel<Message.Message>;
|
|
20
20
|
started?: Date;
|
|
21
21
|
};
|
|
22
22
|
|
|
@@ -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(--dx-baseSurface)',
|
|
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,11 +160,11 @@ class TimestampMarker extends GutterMarker {
|
|
|
156
160
|
super();
|
|
157
161
|
}
|
|
158
162
|
|
|
159
|
-
override eq(other: this)
|
|
160
|
-
return
|
|
163
|
+
override eq(other: this) {
|
|
164
|
+
return this._timestamp === other._timestamp;
|
|
161
165
|
}
|
|
162
166
|
|
|
163
|
-
override toDOM(view: EditorView)
|
|
167
|
+
override toDOM(view: EditorView) {
|
|
164
168
|
const el = document.createElement('div');
|
|
165
169
|
el.className = 'text-sm text-subdued hover:bg-hoverSurface cursor-pointer';
|
|
166
170
|
el.textContent = formatTimestamp(this._timestamp, this._started);
|
|
@@ -176,7 +180,7 @@ class TimestampMarker extends GutterMarker {
|
|
|
176
180
|
}
|
|
177
181
|
}
|
|
178
182
|
|
|
179
|
-
const getStartTime = (started?: Date, message?:
|
|
183
|
+
const getStartTime = (started?: Date, message?: Message.Message): Date | undefined => {
|
|
180
184
|
if (started) {
|
|
181
185
|
return started;
|
|
182
186
|
}
|
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { getSpace } from '@dxos/client/echo';
|
|
8
|
+
import { Obj } from '@dxos/echo';
|
|
8
9
|
import { useMembers, useQueue } from '@dxos/react-client/echo';
|
|
9
10
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
10
|
-
import { type
|
|
11
|
+
import { type Message } from '@dxos/types';
|
|
11
12
|
|
|
12
13
|
import { useQueueModelAdapter } from '../hooks';
|
|
13
14
|
import { type Transcript } from '../types';
|
|
@@ -20,10 +21,10 @@ export type TranscriptionContainerProps = {
|
|
|
20
21
|
};
|
|
21
22
|
|
|
22
23
|
export const TranscriptionContainer = ({ transcript }: TranscriptionContainerProps) => {
|
|
23
|
-
const attendableId =
|
|
24
|
+
const attendableId = Obj.getDXN(transcript).toString();
|
|
24
25
|
const space = getSpace(transcript);
|
|
25
26
|
const members = useMembers(space?.key).map((member) => member.identity);
|
|
26
|
-
const queue = useQueue<
|
|
27
|
+
const queue = useQueue<Message.Message>(transcript.queue.dxn, { pollInterval: 1_000 });
|
|
27
28
|
const model = useQueueModelAdapter(renderByline(members), queue);
|
|
28
29
|
|
|
29
30
|
return (
|
|
@@ -12,17 +12,18 @@ import { Context } from '@dxos/context';
|
|
|
12
12
|
import { Obj } from '@dxos/echo';
|
|
13
13
|
import { createQueueDXN } from '@dxos/echo/internal';
|
|
14
14
|
import { MemoryQueue } from '@dxos/echo-db';
|
|
15
|
-
import { FunctionExecutor, ServiceContainer } from '@dxos/functions';
|
|
15
|
+
import { FunctionExecutor, ServiceContainer } from '@dxos/functions-runtime';
|
|
16
16
|
import { log } from '@dxos/log';
|
|
17
17
|
import { ClientPlugin } from '@dxos/plugin-client';
|
|
18
18
|
import { PreviewPlugin } from '@dxos/plugin-preview';
|
|
19
19
|
import { SpacePlugin } from '@dxos/plugin-space';
|
|
20
20
|
import { StorybookLayoutPlugin } from '@dxos/plugin-storybook-layout';
|
|
21
21
|
import { ThemePlugin } from '@dxos/plugin-theme';
|
|
22
|
-
import { withTheme } from '@dxos/react-ui/testing';
|
|
22
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
23
23
|
import { defaultTx } from '@dxos/react-ui-theme';
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
24
|
+
import { Testing } from '@dxos/schema/testing';
|
|
25
|
+
import { type Actor, Message, Organization, Person } from '@dxos/types';
|
|
26
|
+
import { seedTestData } from '@dxos/types/testing';
|
|
26
27
|
|
|
27
28
|
import { useAudioFile, useQueueModelAdapter, useTranscriber } from '../../hooks';
|
|
28
29
|
import { MessageNormalizer, getActorId } from '../../segments-normalization';
|
|
@@ -50,7 +51,7 @@ const AudioFile = ({
|
|
|
50
51
|
audioConstraints?: MediaTrackConstraints;
|
|
51
52
|
}) => {
|
|
52
53
|
const [running, setRunning] = useState(false);
|
|
53
|
-
const actor:
|
|
54
|
+
const actor: Actor.Actor = useMemo(() => ({ name: 'You' }), []);
|
|
54
55
|
|
|
55
56
|
// Audio.
|
|
56
57
|
const { audio, track, stream } = useAudioFile(audioUrl, audioConstraints);
|
|
@@ -79,13 +80,13 @@ const AudioFile = ({
|
|
|
79
80
|
// Transcriber.
|
|
80
81
|
// TODO(dmaretskyi): Use space.queues.create() instead.
|
|
81
82
|
const queueDxn = useMemo(() => createQueueDXN(), []);
|
|
82
|
-
const queue = useMemo(() => new MemoryQueue<
|
|
83
|
+
const queue = useMemo(() => new MemoryQueue<Message.Message>(queueDxn), [queueDxn]);
|
|
83
84
|
|
|
84
85
|
const model = useQueueModelAdapter(renderByline([]), queue);
|
|
85
86
|
const handleSegments = useCallback<TranscriberParams['onSegments']>(
|
|
86
87
|
async (blocks) => {
|
|
87
88
|
void queue?.append([
|
|
88
|
-
Obj.make(
|
|
89
|
+
Obj.make(Message.Message, {
|
|
89
90
|
created: new Date().toISOString(),
|
|
90
91
|
sender: actor,
|
|
91
92
|
blocks,
|
|
@@ -188,10 +189,11 @@ const meta = {
|
|
|
188
189
|
title: 'plugins/plugin-transcription/FileTranscription',
|
|
189
190
|
decorators: [
|
|
190
191
|
withTheme,
|
|
192
|
+
withLayout({ container: 'column' }),
|
|
191
193
|
withPluginManager({
|
|
192
194
|
plugins: [
|
|
193
195
|
ClientPlugin({
|
|
194
|
-
types: [TestItem,
|
|
196
|
+
types: [TestItem, Person.Person, Organization.Organization, Testing.DocumentType],
|
|
195
197
|
onClientInitialized: async ({ client }) => {
|
|
196
198
|
await client.halo.createIdentity();
|
|
197
199
|
await client.spaces.waitUntilReady();
|
|
@@ -212,9 +214,6 @@ const meta = {
|
|
|
212
214
|
fireEvents: [Events.SetupAppGraph],
|
|
213
215
|
}),
|
|
214
216
|
],
|
|
215
|
-
parameters: {
|
|
216
|
-
layout: 'column',
|
|
217
|
-
},
|
|
218
217
|
} satisfies Meta;
|
|
219
218
|
|
|
220
219
|
export default meta;
|
|
@@ -7,7 +7,7 @@ import React, { useEffect, useMemo, useState } from 'react';
|
|
|
7
7
|
|
|
8
8
|
import { log } from '@dxos/log';
|
|
9
9
|
import { Toolbar } from '@dxos/react-ui';
|
|
10
|
-
import { withTheme } from '@dxos/react-ui/testing';
|
|
10
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
11
11
|
import { mx } from '@dxos/react-ui-theme';
|
|
12
12
|
|
|
13
13
|
type Word = {
|
|
@@ -101,7 +101,7 @@ const DefaultStory = ({ keywords }: StoryProps) => {
|
|
|
101
101
|
<span
|
|
102
102
|
key={index}
|
|
103
103
|
className={mx(
|
|
104
|
-
'
|
|
104
|
+
'pli-3 plb-1 m-2 rounded 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
|
>
|
|
@@ -118,10 +118,7 @@ const DefaultStory = ({ keywords }: StoryProps) => {
|
|
|
118
118
|
const meta = {
|
|
119
119
|
title: 'plugins/plugin-transcription/KeyWordDetection',
|
|
120
120
|
render: DefaultStory,
|
|
121
|
-
decorators: [withTheme],
|
|
122
|
-
parameters: {
|
|
123
|
-
layout: 'column',
|
|
124
|
-
},
|
|
121
|
+
decorators: [withTheme, withLayout({ container: 'column' })],
|
|
125
122
|
} satisfies Meta<typeof DefaultStory>;
|
|
126
123
|
|
|
127
124
|
export default meta;
|
|
@@ -17,7 +17,7 @@ import {
|
|
|
17
17
|
import { Filter, Obj, type Type } from '@dxos/echo';
|
|
18
18
|
import { createQueueDXN } from '@dxos/echo/internal';
|
|
19
19
|
import { MemoryQueue } from '@dxos/echo-db';
|
|
20
|
-
import { FunctionExecutor, ServiceContainer } from '@dxos/functions';
|
|
20
|
+
import { FunctionExecutor, ServiceContainer } from '@dxos/functions-runtime';
|
|
21
21
|
import { invariant } from '@dxos/invariant';
|
|
22
22
|
import { log } from '@dxos/log';
|
|
23
23
|
import { ClientPlugin } from '@dxos/plugin-client';
|
|
@@ -26,10 +26,11 @@ import { SpacePlugin } from '@dxos/plugin-space';
|
|
|
26
26
|
import { StorybookLayoutPlugin } from '@dxos/plugin-storybook-layout';
|
|
27
27
|
import { ThemePlugin } from '@dxos/plugin-theme';
|
|
28
28
|
import { IndexKind, useSpace } from '@dxos/react-client/echo';
|
|
29
|
-
import { withTheme } from '@dxos/react-ui/testing';
|
|
29
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
30
30
|
import { defaultTx } from '@dxos/react-ui-theme';
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
31
|
+
import { Testing } from '@dxos/schema/testing';
|
|
32
|
+
import { Message, Organization, Person } from '@dxos/types';
|
|
33
|
+
import { seedTestData } from '@dxos/types/testing';
|
|
33
34
|
|
|
34
35
|
import { useAudioTrack, useQueueModelAdapter, useTranscriber } from '../../hooks';
|
|
35
36
|
import { TestItem } from '../../testing';
|
|
@@ -75,7 +76,7 @@ const DefaultStory = ({
|
|
|
75
76
|
// Queue.
|
|
76
77
|
// TODO(dmaretskyi): Use space.queues.create() instead.
|
|
77
78
|
const queueDxn = useMemo(() => createQueueDXN(), []);
|
|
78
|
-
const queue = useMemo(() => new MemoryQueue<
|
|
79
|
+
const queue = useMemo(() => new MemoryQueue<Message.Message>(queueDxn), [queueDxn]);
|
|
79
80
|
const model = useQueueModelAdapter(renderByline([]), queue);
|
|
80
81
|
const space = useSpace();
|
|
81
82
|
|
|
@@ -105,8 +106,8 @@ const DefaultStory = ({
|
|
|
105
106
|
objects = space.db
|
|
106
107
|
.query(
|
|
107
108
|
Filter.or(
|
|
108
|
-
Filter.type(
|
|
109
|
-
Filter.type(
|
|
109
|
+
Filter.type(Person.Person),
|
|
110
|
+
Filter.type(Organization.Organization),
|
|
110
111
|
Filter.type(Testing.DocumentType),
|
|
111
112
|
),
|
|
112
113
|
)
|
|
@@ -132,7 +133,7 @@ const DefaultStory = ({
|
|
|
132
133
|
// Transcriber.
|
|
133
134
|
const handleSegments = useCallback<TranscriberParams['onSegments']>(
|
|
134
135
|
async (blocks) => {
|
|
135
|
-
const message = Obj.make(
|
|
136
|
+
const message = Obj.make(Message.Message, {
|
|
136
137
|
sender: { name: 'You' },
|
|
137
138
|
created: new Date().toISOString(),
|
|
138
139
|
blocks,
|
|
@@ -196,10 +197,11 @@ const meta = {
|
|
|
196
197
|
render: DefaultStory,
|
|
197
198
|
decorators: [
|
|
198
199
|
withTheme,
|
|
200
|
+
withLayout({ container: 'column' }),
|
|
199
201
|
withPluginManager({
|
|
200
202
|
plugins: [
|
|
201
203
|
ClientPlugin({
|
|
202
|
-
types: [TestItem,
|
|
204
|
+
types: [TestItem, Person.Person, Organization.Organization, Testing.DocumentType],
|
|
203
205
|
onClientInitialized: async ({ client }) => {
|
|
204
206
|
await client.halo.createIdentity();
|
|
205
207
|
await client.spaces.waitUntilReady();
|
|
@@ -233,9 +235,6 @@ const meta = {
|
|
|
233
235
|
fireEvents: [Events.SetupAppGraph],
|
|
234
236
|
}),
|
|
235
237
|
],
|
|
236
|
-
parameters: {
|
|
237
|
-
layout: 'column',
|
|
238
|
-
},
|
|
239
238
|
} satisfies Meta<typeof DefaultStory>;
|
|
240
239
|
|
|
241
240
|
export default meta;
|
|
@@ -9,13 +9,13 @@ import React, { type Dispatch, type FC, type RefObject, type SetStateAction } fr
|
|
|
9
9
|
import { useSpace } from '@dxos/react-client/echo';
|
|
10
10
|
import { IconButton, Toolbar } from '@dxos/react-ui';
|
|
11
11
|
import { ScrollContainer } from '@dxos/react-ui-components';
|
|
12
|
-
import { type
|
|
12
|
+
import { type Message } from '@dxos/types';
|
|
13
13
|
|
|
14
14
|
import { type SerializationModel } from '../../model';
|
|
15
15
|
import { TranscriptView } from '../Transcript';
|
|
16
16
|
|
|
17
17
|
export const TranscriptionStory: FC<{
|
|
18
|
-
model: SerializationModel<
|
|
18
|
+
model: SerializationModel<Message.Message>;
|
|
19
19
|
disabled?: boolean;
|
|
20
20
|
running: boolean;
|
|
21
21
|
onRunningChange: Dispatch<SetStateAction<boolean>>;
|
|
@@ -36,9 +36,9 @@ export const TranscriptionStory: FC<{
|
|
|
36
36
|
/>
|
|
37
37
|
</Toolbar.Root>
|
|
38
38
|
<ScrollContainer.Root pin>
|
|
39
|
-
<ScrollContainer.
|
|
39
|
+
<ScrollContainer.Viewport>
|
|
40
40
|
<TranscriptView space={space} model={model} />
|
|
41
|
-
</ScrollContainer.
|
|
41
|
+
</ScrollContainer.Viewport>
|
|
42
42
|
</ScrollContainer.Root>
|
|
43
43
|
</div>
|
|
44
44
|
);
|
package/src/functions/open.ts
CHANGED
|
@@ -8,7 +8,7 @@ import * as Schema from 'effect/Schema';
|
|
|
8
8
|
import { ArtifactId } from '@dxos/assistant';
|
|
9
9
|
import { Obj } from '@dxos/echo';
|
|
10
10
|
import { DatabaseService, QueueService, defineFunction } from '@dxos/functions';
|
|
11
|
-
import {
|
|
11
|
+
import { Message } from '@dxos/types';
|
|
12
12
|
|
|
13
13
|
import { renderByline } from '../components';
|
|
14
14
|
import { Transcript } from '../types';
|
|
@@ -31,7 +31,7 @@ export default defineFunction({
|
|
|
31
31
|
const queue = yield* QueueService.getQueue(dxn);
|
|
32
32
|
yield* Effect.promise(() => queue?.queryObjects());
|
|
33
33
|
const content = queue?.objects
|
|
34
|
-
.filter((message) => Obj.instanceOf(
|
|
34
|
+
.filter((message) => Obj.instanceOf(Message.Message, message))
|
|
35
35
|
.flatMap((message, index) => renderByline([])(message, index))
|
|
36
36
|
.join('\n\n');
|
|
37
37
|
return { content };
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { useEffect, useMemo } from 'react';
|
|
6
6
|
|
|
7
|
-
import { useCapabilities } from '@dxos/app-framework';
|
|
7
|
+
import { useCapabilities } from '@dxos/app-framework/react';
|
|
8
8
|
|
|
9
9
|
import { TranscriptionCapabilities } from '../capabilities';
|
|
10
10
|
import { type Transcriber } from '../transcriber';
|
|
@@ -26,7 +26,12 @@ export const useTranscriber = ({
|
|
|
26
26
|
return undefined;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
-
return getTranscriber({
|
|
29
|
+
return getTranscriber({
|
|
30
|
+
audioStreamTrack,
|
|
31
|
+
recorderConfig,
|
|
32
|
+
transcriberConfig,
|
|
33
|
+
onSegments,
|
|
34
|
+
});
|
|
30
35
|
}, [getTranscriber, audioStreamTrack, recorderConfig, transcriberConfig, onSegments]);
|
|
31
36
|
|
|
32
37
|
useEffect(() => {
|
package/src/meta.ts
CHANGED
|
@@ -3,12 +3,17 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { type PluginMeta } from '@dxos/app-framework';
|
|
6
|
+
import { trim } from '@dxos/util';
|
|
6
7
|
|
|
7
8
|
export const meta: PluginMeta = {
|
|
8
9
|
id: 'dxos.org/plugin/transcription',
|
|
9
10
|
name: 'Transcription',
|
|
10
|
-
description:
|
|
11
|
+
description: trim`
|
|
12
|
+
Real-time voice-to-text transcription service for capturing spoken content.
|
|
13
|
+
Convert audio input into searchable text that integrates seamlessly with notes and documents.
|
|
14
|
+
`,
|
|
11
15
|
icon: 'ph--microphone--regular',
|
|
16
|
+
iconHue: 'sky',
|
|
12
17
|
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-transcription',
|
|
13
18
|
tags: ['labs'],
|
|
14
19
|
screenshots: [],
|