@dxos/plugin-transcription 0.8.4-main.5ea62a8 → 0.8.4-main.ae835ea
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-2GSL2XB5.mjs +11 -0
- package/dist/lib/browser/{blueprint-definition-QQSGTX5F.mjs → blueprint-definition-UAAJYVLZ.mjs} +23 -15
- package/dist/lib/browser/blueprint-definition-UAAJYVLZ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-TNEQFHIU.mjs → chunk-3MKZ2MNQ.mjs} +5 -5
- package/dist/lib/browser/chunk-3MKZ2MNQ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-26XDG6GQ.mjs → chunk-535OJKFO.mjs} +2 -2
- package/dist/lib/browser/{chunk-5I4BMOGE.mjs → chunk-7DR6HZEF.mjs} +119 -170
- package/dist/lib/browser/chunk-7DR6HZEF.mjs.map +7 -0
- package/dist/lib/browser/{chunk-3X7HP44M.mjs → chunk-VBUIO677.mjs} +8 -5
- package/dist/lib/browser/chunk-VBUIO677.mjs.map +7 -0
- package/dist/lib/browser/{chunk-HXVGV7T6.mjs → chunk-W7WKZTM4.mjs} +4 -4
- package/dist/lib/browser/chunk-W7WKZTM4.mjs.map +7 -0
- package/dist/lib/browser/{chunk-BA64VLLR.mjs → chunk-WH36ENNE.mjs} +44 -64
- package/dist/lib/browser/{chunk-BA64VLLR.mjs.map → chunk-WH36ENNE.mjs.map} +2 -2
- package/dist/lib/browser/index.mjs +12 -13
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-T3EGLS3L.mjs → intent-resolver-ZTKTEAQX.mjs} +5 -5
- package/dist/lib/browser/{intent-resolver-T3EGLS3L.mjs.map → intent-resolver-ZTKTEAQX.mjs.map} +1 -1
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-QYX74JNG.mjs → react-surface-KA32A72I.mjs} +8 -8
- package/dist/lib/browser/{react-surface-QYX74JNG.mjs.map → react-surface-KA32A72I.mjs.map} +1 -1
- package/dist/lib/browser/{transcriber-JOOAQVYV.mjs → transcriber-LWOLYQHC.mjs} +7 -7
- package/dist/lib/browser/{transcriber-JOOAQVYV.mjs.map → transcriber-LWOLYQHC.mjs.map} +1 -1
- package/dist/lib/browser/types/index.mjs +2 -2
- package/dist/lib/node-esm/{TranscriptContainer-BUWK63SI.mjs → TranscriptContainer-GRLDCESB.mjs} +4 -4
- package/dist/lib/node-esm/{blueprint-definition-4PLCTH5Q.mjs → blueprint-definition-Z3LTZ3ID.mjs} +23 -15
- package/dist/lib/node-esm/blueprint-definition-Z3LTZ3ID.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-DT3AOC3E.mjs → chunk-K4AZOB5Y.mjs} +119 -170
- package/dist/lib/node-esm/chunk-K4AZOB5Y.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-W72HVQMD.mjs → chunk-OLMSTF3M.mjs} +4 -4
- package/dist/lib/node-esm/chunk-OLMSTF3M.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-NWD757KH.mjs → chunk-Q6WD7L2J.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-3QAIZGMW.mjs → chunk-SWUVPFKR.mjs} +5 -5
- package/dist/lib/node-esm/chunk-SWUVPFKR.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-J5GQ3KGX.mjs → chunk-YFN4FJFK.mjs} +44 -64
- package/dist/lib/node-esm/{chunk-J5GQ3KGX.mjs.map → chunk-YFN4FJFK.mjs.map} +2 -2
- package/dist/lib/node-esm/{chunk-QARUDLHN.mjs → chunk-YVNQN2J6.mjs} +8 -5
- package/dist/lib/node-esm/chunk-YVNQN2J6.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +12 -13
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-VDHCUAIO.mjs → intent-resolver-55WH2GY6.mjs} +5 -5
- package/dist/lib/node-esm/{intent-resolver-VDHCUAIO.mjs.map → intent-resolver-55WH2GY6.mjs.map} +1 -1
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-TM7XOQBR.mjs → react-surface-GU7LW2JO.mjs} +8 -8
- package/dist/lib/node-esm/{react-surface-TM7XOQBR.mjs.map → react-surface-GU7LW2JO.mjs.map} +1 -1
- package/dist/lib/node-esm/{transcriber-QPS55YP2.mjs → transcriber-UGB7ECX6.mjs} +7 -7
- package/dist/lib/node-esm/{transcriber-QPS55YP2.mjs.map → transcriber-UGB7ECX6.mjs.map} +1 -1
- package/dist/lib/node-esm/types/index.mjs +2 -2
- package/dist/types/src/TranscriptionPlugin.d.ts +1 -1
- package/dist/types/src/TranscriptionPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/capabilities.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 +1 -3
- package/dist/types/src/components/Transcript/Transcript.stories.d.ts.map +1 -1
- package/dist/types/src/components/Transcript/deprecated/OldTranscript.d.ts +1 -1
- package/dist/types/src/components/Transcript/deprecated/OldTranscript.d.ts.map +1 -1
- package/dist/types/src/components/Transcript/transcript-extension.d.ts +1 -5
- package/dist/types/src/components/Transcript/transcript-extension.d.ts.map +1 -1
- package/dist/types/src/components/stories/FileTranscription.stories.d.ts +0 -2
- package/dist/types/src/components/stories/FileTranscription.stories.d.ts.map +1 -1
- package/dist/types/src/components/stories/KeyWordRecognition.stories.d.ts +0 -1
- package/dist/types/src/components/stories/KeyWordRecognition.stories.d.ts.map +1 -1
- package/dist/types/src/components/stories/MicrophoneTranscription.stories.d.ts +0 -2
- package/dist/types/src/components/stories/MicrophoneTranscription.stories.d.ts.map +1 -1
- package/dist/types/src/components/stories/TranscriptionStory.d.ts +1 -1
- package/dist/types/src/components/stories/TranscriptionStory.d.ts.map +1 -1
- package/dist/types/src/functions/open.d.ts.map +1 -1
- package/dist/types/src/functions/summarize.d.ts.map +1 -1
- package/dist/types/src/hooks/useAudioFile.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +0 -1
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/segments-normalization/normalization.d.ts +31 -16
- package/dist/types/src/segments-normalization/normalization.d.ts.map +1 -1
- package/dist/types/src/testing/testing.d.ts +1 -1
- package/dist/types/src/testing/testing.d.ts.map +1 -1
- package/dist/types/src/types/Transcript.d.ts +3 -3
- package/dist/types/src/types/Transcript.d.ts.map +1 -1
- package/dist/types/src/types/TranscriptAction.d.ts +1 -1
- package/dist/types/src/types/TranscriptAction.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +61 -62
- package/src/TranscriptionPlugin.tsx +56 -56
- package/src/capabilities/capabilities.ts +3 -3
- package/src/components/Transcript/Transcript.stories.tsx +24 -20
- package/src/components/Transcript/Transcript.tsx +15 -23
- package/src/components/Transcript/deprecated/OldTranscript.tsx +5 -5
- package/src/components/Transcript/transcript-extension.ts +2 -39
- package/src/components/TranscriptContainer.tsx +3 -3
- package/src/components/stories/FileTranscription.stories.tsx +25 -24
- package/src/components/stories/KeyWordRecognition.stories.tsx +2 -4
- package/src/components/stories/MicrophoneTranscription.stories.tsx +31 -29
- package/src/components/stories/TranscriptionStory.tsx +2 -2
- package/src/functions/open.ts +6 -4
- package/src/functions/summarize.ts +10 -4
- package/src/hooks/useAudioFile.ts +50 -45
- package/src/meta.ts +7 -4
- package/src/segments-normalization/normalization.test.ts +1 -1
- package/src/segments-normalization/normalization.ts +1 -1
- package/src/testing/testing.ts +5 -5
- package/src/types/Transcript.ts +1 -1
- package/src/types/TranscriptAction.ts +1 -1
- package/dist/lib/browser/TranscriptContainer-OX7OOODC.mjs +0 -11
- package/dist/lib/browser/blueprint-definition-QQSGTX5F.mjs.map +0 -7
- package/dist/lib/browser/chunk-3X7HP44M.mjs.map +0 -7
- package/dist/lib/browser/chunk-5I4BMOGE.mjs.map +0 -7
- package/dist/lib/browser/chunk-HXVGV7T6.mjs.map +0 -7
- package/dist/lib/browser/chunk-TNEQFHIU.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-4PLCTH5Q.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-3QAIZGMW.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-DT3AOC3E.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-QARUDLHN.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-W72HVQMD.mjs.map +0 -7
- /package/dist/lib/browser/{TranscriptContainer-OX7OOODC.mjs.map → TranscriptContainer-2GSL2XB5.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-26XDG6GQ.mjs.map → chunk-535OJKFO.mjs.map} +0 -0
- /package/dist/lib/node-esm/{TranscriptContainer-BUWK63SI.mjs.map → TranscriptContainer-GRLDCESB.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-NWD757KH.mjs.map → chunk-Q6WD7L2J.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.ae835ea",
|
|
4
4
|
"description": "Voice transcription.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -34,10 +34,10 @@
|
|
|
34
34
|
"src"
|
|
35
35
|
],
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@codemirror/state": "^6.
|
|
38
|
-
"@codemirror/view": "^6.
|
|
37
|
+
"@codemirror/state": "^6.5.2",
|
|
38
|
+
"@codemirror/view": "^6.38.4",
|
|
39
39
|
"@preact-signals/safe-react": "^0.9.0",
|
|
40
|
-
"@preact/signals-core": "^1.
|
|
40
|
+
"@preact/signals-core": "^1.12.1",
|
|
41
41
|
"date-fns": "^3.3.1",
|
|
42
42
|
"extendable-media-recorder": "^9.2.19",
|
|
43
43
|
"extendable-media-recorder-wav-encoder": "^7.0.123",
|
|
@@ -46,73 +46,72 @@
|
|
|
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/client": "0.8.4-main.
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/blueprints": "0.8.4-main.
|
|
55
|
-
"@dxos/
|
|
56
|
-
"@dxos/
|
|
57
|
-
"@dxos/display-name": "0.8.4-main.
|
|
58
|
-
"@dxos/
|
|
59
|
-
"@dxos/
|
|
60
|
-
"@dxos/echo-db": "0.8.4-main.
|
|
61
|
-
"@dxos/
|
|
62
|
-
"@dxos/
|
|
63
|
-
"@dxos/keys": "0.8.4-main.
|
|
64
|
-
"@dxos/
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/
|
|
67
|
-
"@dxos/plugin-
|
|
68
|
-
"@dxos/plugin-
|
|
69
|
-
"@dxos/plugin-markdown": "0.8.4-main.
|
|
70
|
-
"@dxos/plugin-space": "0.8.4-main.
|
|
71
|
-
"@dxos/
|
|
72
|
-
"@dxos/plugin-
|
|
73
|
-
"@dxos/
|
|
74
|
-
"@dxos/
|
|
75
|
-
"@dxos/react-client": "0.8.4-main.
|
|
76
|
-
"@dxos/react-
|
|
77
|
-
"@dxos/react-ui-
|
|
78
|
-
"@dxos/react-ui-
|
|
79
|
-
"@dxos/react-ui-
|
|
80
|
-
"@dxos/react-ui-
|
|
81
|
-
"@dxos/react-ui-sfx": "0.8.4-main.
|
|
82
|
-
"@dxos/react-ui-stack": "0.8.4-main.
|
|
83
|
-
"@dxos/
|
|
84
|
-
"@dxos/
|
|
85
|
-
"@dxos/
|
|
86
|
-
"@dxos/util": "0.8.4-main.5ea62a8"
|
|
49
|
+
"@dxos/ai": "0.8.4-main.ae835ea",
|
|
50
|
+
"@dxos/app-framework": "0.8.4-main.ae835ea",
|
|
51
|
+
"@dxos/assistant": "0.8.4-main.ae835ea",
|
|
52
|
+
"@dxos/client": "0.8.4-main.ae835ea",
|
|
53
|
+
"@dxos/async": "0.8.4-main.ae835ea",
|
|
54
|
+
"@dxos/blueprints": "0.8.4-main.ae835ea",
|
|
55
|
+
"@dxos/codec-protobuf": "0.8.4-main.ae835ea",
|
|
56
|
+
"@dxos/context": "0.8.4-main.ae835ea",
|
|
57
|
+
"@dxos/display-name": "0.8.4-main.ae835ea",
|
|
58
|
+
"@dxos/echo": "0.8.4-main.ae835ea",
|
|
59
|
+
"@dxos/debug": "0.8.4-main.ae835ea",
|
|
60
|
+
"@dxos/echo-db": "0.8.4-main.ae835ea",
|
|
61
|
+
"@dxos/functions": "0.8.4-main.ae835ea",
|
|
62
|
+
"@dxos/invariant": "0.8.4-main.ae835ea",
|
|
63
|
+
"@dxos/keys": "0.8.4-main.ae835ea",
|
|
64
|
+
"@dxos/local-storage": "0.8.4-main.ae835ea",
|
|
65
|
+
"@dxos/live-object": "0.8.4-main.ae835ea",
|
|
66
|
+
"@dxos/log": "0.8.4-main.ae835ea",
|
|
67
|
+
"@dxos/plugin-client": "0.8.4-main.ae835ea",
|
|
68
|
+
"@dxos/plugin-deck": "0.8.4-main.ae835ea",
|
|
69
|
+
"@dxos/plugin-markdown": "0.8.4-main.ae835ea",
|
|
70
|
+
"@dxos/plugin-space": "0.8.4-main.ae835ea",
|
|
71
|
+
"@dxos/protocols": "0.8.4-main.ae835ea",
|
|
72
|
+
"@dxos/plugin-thread": "0.8.4-main.ae835ea",
|
|
73
|
+
"@dxos/plugin-graph": "0.8.4-main.ae835ea",
|
|
74
|
+
"@dxos/react-client": "0.8.4-main.ae835ea",
|
|
75
|
+
"@dxos/react-edge-client": "0.8.4-main.ae835ea",
|
|
76
|
+
"@dxos/react-ui-attention": "0.8.4-main.ae835ea",
|
|
77
|
+
"@dxos/react-ui-components": "0.8.4-main.ae835ea",
|
|
78
|
+
"@dxos/react-ui-editor": "0.8.4-main.ae835ea",
|
|
79
|
+
"@dxos/react-ui-form": "0.8.4-main.ae835ea",
|
|
80
|
+
"@dxos/react-ui-grid": "0.8.4-main.ae835ea",
|
|
81
|
+
"@dxos/react-ui-sfx": "0.8.4-main.ae835ea",
|
|
82
|
+
"@dxos/react-ui-stack": "0.8.4-main.ae835ea",
|
|
83
|
+
"@dxos/tracing": "0.8.4-main.ae835ea",
|
|
84
|
+
"@dxos/util": "0.8.4-main.ae835ea",
|
|
85
|
+
"@dxos/schema": "0.8.4-main.ae835ea"
|
|
87
86
|
},
|
|
88
87
|
"devDependencies": {
|
|
89
|
-
"@effect-rx/rx-react": "0.
|
|
90
|
-
"@effect/platform": "0.
|
|
88
|
+
"@effect-rx/rx-react": "0.42.4",
|
|
89
|
+
"@effect/platform": "0.92.1",
|
|
91
90
|
"@types/dom-speech-recognition": "^0.0.6",
|
|
92
|
-
"@types/react": "~
|
|
93
|
-
"effect": "3.
|
|
94
|
-
"react": "~
|
|
95
|
-
"react-dom": "~
|
|
91
|
+
"@types/react": "~19.2.2",
|
|
92
|
+
"effect": "3.18.3",
|
|
93
|
+
"react": "~19.2.0",
|
|
94
|
+
"react-dom": "~19.2.0",
|
|
96
95
|
"tailwindcss": "~3.4.1",
|
|
97
|
-
"@dxos/plugin-preview": "0.8.4-main.
|
|
98
|
-
"@dxos/plugin-
|
|
99
|
-
"@dxos/
|
|
100
|
-
"@dxos/
|
|
101
|
-
"@dxos/react-ui
|
|
102
|
-
"@dxos/
|
|
103
|
-
"@dxos/
|
|
104
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
105
|
-
"@dxos/
|
|
106
|
-
"@dxos/
|
|
96
|
+
"@dxos/plugin-preview": "0.8.4-main.ae835ea",
|
|
97
|
+
"@dxos/plugin-storybook-layout": "0.8.4-main.ae835ea",
|
|
98
|
+
"@dxos/plugin-theme": "0.8.4-main.ae835ea",
|
|
99
|
+
"@dxos/random": "0.8.4-main.ae835ea",
|
|
100
|
+
"@dxos/react-ui": "0.8.4-main.ae835ea",
|
|
101
|
+
"@dxos/react-ui-form": "0.8.4-main.ae835ea",
|
|
102
|
+
"@dxos/react-ui-syntax-highlighter": "0.8.4-main.ae835ea",
|
|
103
|
+
"@dxos/react-ui-theme": "0.8.4-main.ae835ea",
|
|
104
|
+
"@dxos/storybook-utils": "0.8.4-main.ae835ea",
|
|
105
|
+
"@dxos/test-utils": "0.8.4-main.ae835ea"
|
|
107
106
|
},
|
|
108
107
|
"peerDependencies": {
|
|
109
108
|
"@effect-rx/rx-react": "^0.34.1",
|
|
110
109
|
"@effect/platform": "^0.80.12",
|
|
111
110
|
"effect": "^3.13.3",
|
|
112
|
-
"react": "
|
|
113
|
-
"react-dom": "
|
|
114
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
115
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
111
|
+
"react": "^19.0.0",
|
|
112
|
+
"react-dom": "^19.0.0",
|
|
113
|
+
"@dxos/react-ui": "0.8.4-main.ae835ea",
|
|
114
|
+
"@dxos/react-ui-theme": "0.8.4-main.ae835ea"
|
|
116
115
|
},
|
|
117
116
|
"publishConfig": {
|
|
118
117
|
"access": "public"
|
|
@@ -9,64 +9,64 @@ import { getSpace } from '@dxos/react-client/echo';
|
|
|
9
9
|
import { DataType } from '@dxos/schema';
|
|
10
10
|
|
|
11
11
|
import { BlueprintDefinition, IntentResolver, ReactSurface, Transcriber } from './capabilities';
|
|
12
|
-
import {
|
|
12
|
+
import { renderByline } from './components';
|
|
13
13
|
import { meta } from './meta';
|
|
14
14
|
import { translations } from './translations';
|
|
15
15
|
import { Transcript } from './types';
|
|
16
16
|
|
|
17
|
-
export const TranscriptionPlugin = () =>
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
},
|
|
17
|
+
export const TranscriptionPlugin = definePlugin(meta, () => [
|
|
18
|
+
defineModule({
|
|
19
|
+
id: `${meta.id}/module/translations`,
|
|
20
|
+
activatesOn: Events.SetupTranslations,
|
|
21
|
+
activate: () => contributes(Capabilities.Translations, translations),
|
|
22
|
+
}),
|
|
23
|
+
defineModule({
|
|
24
|
+
id: `${meta.id}/module/metadata`,
|
|
25
|
+
activatesOn: Events.SetupMetadata,
|
|
26
|
+
activate: () =>
|
|
27
|
+
contributes(Capabilities.Metadata, {
|
|
28
|
+
id: Transcript.Transcript.typename,
|
|
29
|
+
metadata: {
|
|
30
|
+
icon: 'ph--subtitles--regular',
|
|
31
|
+
iconHue: 'sky',
|
|
32
|
+
// TODO(wittjosiah): Factor out. Artifact? Separate capability?
|
|
33
|
+
getTextContent: async (transcript: Transcript.Transcript) => {
|
|
34
|
+
const space = getSpace(transcript);
|
|
35
|
+
const members = space?.members.get().map((member) => member.identity) ?? [];
|
|
36
|
+
const queue = space?.queues.get<DataType.Message>(transcript.queue.dxn);
|
|
37
|
+
await queue?.refresh();
|
|
38
|
+
const content = queue?.objects
|
|
39
|
+
.filter((message) => Obj.instanceOf(DataType.Message, message))
|
|
40
|
+
.flatMap((message, index) => renderByline(members)(message, index))
|
|
41
|
+
.join('\n\n');
|
|
42
|
+
return content;
|
|
44
43
|
},
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
44
|
+
},
|
|
45
|
+
}),
|
|
46
|
+
}),
|
|
47
|
+
defineModule({
|
|
48
|
+
id: `${meta.id}/module/schema`,
|
|
49
|
+
activatesOn: ClientEvents.SetupSchema,
|
|
50
|
+
activate: () => [contributes(ClientCapabilities.Schema, [Transcript.Transcript])],
|
|
51
|
+
}),
|
|
52
|
+
defineModule({
|
|
53
|
+
id: `${meta.id}/module/react-surface`,
|
|
54
|
+
activatesOn: Events.SetupReactSurface,
|
|
55
|
+
activate: ReactSurface,
|
|
56
|
+
}),
|
|
57
|
+
defineModule({
|
|
58
|
+
id: `${meta.id}/module/intent-resolver`,
|
|
59
|
+
activatesOn: Events.SetupIntentResolver,
|
|
60
|
+
activate: IntentResolver,
|
|
61
|
+
}),
|
|
62
|
+
defineModule({
|
|
63
|
+
id: `${meta.id}/module/transcription`,
|
|
64
|
+
activatesOn: Events.SetupAppGraph,
|
|
65
|
+
activate: Transcriber,
|
|
66
|
+
}),
|
|
67
|
+
defineModule({
|
|
68
|
+
id: `${meta.id}/module/blueprint`,
|
|
69
|
+
activatesOn: Events.SetupArtifactDefinition,
|
|
70
|
+
activate: BlueprintDefinition,
|
|
71
|
+
}),
|
|
72
|
+
]);
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import { defineCapability } from '@dxos/app-framework';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { meta } from '../meta';
|
|
8
8
|
import {
|
|
9
9
|
type MediaStreamRecorderParams,
|
|
10
10
|
type Transcriber,
|
|
@@ -21,13 +21,13 @@ export namespace TranscriptionCapabilities {
|
|
|
21
21
|
onSegments: TranscriberParams['onSegments'];
|
|
22
22
|
};
|
|
23
23
|
export type GetTranscriber = (props: GetTranscriberProps) => Transcriber;
|
|
24
|
-
export const Transcriber = defineCapability<GetTranscriber>(`${
|
|
24
|
+
export const Transcriber = defineCapability<GetTranscriber>(`${meta.id}/capability/transcriber`);
|
|
25
25
|
|
|
26
26
|
export type GetTranscriptionManagerProps = {
|
|
27
27
|
messageEnricher?: TranscriptMessageEnricher;
|
|
28
28
|
};
|
|
29
29
|
export type GetTranscriptionManager = (props: GetTranscriptionManagerProps) => TranscriptionManager;
|
|
30
30
|
export const TranscriptionManager = defineCapability<GetTranscriptionManager>(
|
|
31
|
-
`${
|
|
31
|
+
`${meta.id}/capability/transcription-manager`,
|
|
32
32
|
);
|
|
33
33
|
}
|
|
@@ -2,8 +2,6 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
6
|
import React, { type FC, useEffect, useMemo, useState } from 'react';
|
|
9
7
|
|
|
@@ -18,11 +16,11 @@ import { ThemePlugin } from '@dxos/plugin-theme';
|
|
|
18
16
|
import { faker } from '@dxos/random';
|
|
19
17
|
import { useMembers, useSpace } from '@dxos/react-client/echo';
|
|
20
18
|
import { IconButton, Toolbar } from '@dxos/react-ui';
|
|
19
|
+
import { withTheme } from '@dxos/react-ui/testing';
|
|
21
20
|
import { SyntaxHighlighter } from '@dxos/react-ui-syntax-highlighter';
|
|
22
21
|
import { defaultTx } from '@dxos/react-ui-theme';
|
|
23
22
|
import { DataType } from '@dxos/schema';
|
|
24
23
|
import { Testing } from '@dxos/schema/testing';
|
|
25
|
-
import { withLayout } from '@dxos/storybook-utils';
|
|
26
24
|
|
|
27
25
|
import { useQueueModelAdapter } from '../../hooks';
|
|
28
26
|
import { SerializationModel } from '../../model';
|
|
@@ -34,7 +32,7 @@ import {
|
|
|
34
32
|
} from '../../testing';
|
|
35
33
|
import { translations } from '../../translations';
|
|
36
34
|
|
|
37
|
-
import { TranscriptView, type TranscriptViewProps,
|
|
35
|
+
import { TranscriptView, type TranscriptViewProps, renderByline } from './Transcript';
|
|
38
36
|
|
|
39
37
|
faker.seed(1);
|
|
40
38
|
|
|
@@ -79,7 +77,7 @@ const BasicStory = ({ messages: initialMessages = [], ...props }: StoryProps) =>
|
|
|
79
77
|
const [reset, setReset] = useState({});
|
|
80
78
|
const builder = useMemo(() => new MessageBuilder(), []);
|
|
81
79
|
const model = useMemo(
|
|
82
|
-
() => new SerializationModel<DataType.Message>(
|
|
80
|
+
() => new SerializationModel<DataType.Message>(renderByline([]), initialMessages),
|
|
83
81
|
[initialMessages, reset],
|
|
84
82
|
);
|
|
85
83
|
const [running, setRunning] = useState(true);
|
|
@@ -141,7 +139,7 @@ const QueueStory = ({
|
|
|
141
139
|
const space = useSpace();
|
|
142
140
|
const members = useMembers(space?.key).map((member) => member.identity);
|
|
143
141
|
const queue = useTestTranscriptionQueue(space, queueId, running, 2_000);
|
|
144
|
-
const model = useQueueModelAdapter(
|
|
142
|
+
const model = useQueueModelAdapter(renderByline(members), queue, initialMessages);
|
|
145
143
|
|
|
146
144
|
return (
|
|
147
145
|
<TranscriptContainer
|
|
@@ -161,7 +159,7 @@ const EntityExtractionQueueStory = () => {
|
|
|
161
159
|
const space = useSpace();
|
|
162
160
|
const members = useMembers(space?.key).map((member) => member.identity);
|
|
163
161
|
const queue = useTestTranscriptionQueueWithEntityExtraction(space, undefined, running, 2_000);
|
|
164
|
-
const model = useQueueModelAdapter(
|
|
162
|
+
const model = useQueueModelAdapter(renderByline(members), queue, []);
|
|
165
163
|
|
|
166
164
|
return <TranscriptContainer space={space} model={model} running={running} onRunningChange={setRunning} />;
|
|
167
165
|
};
|
|
@@ -182,25 +180,28 @@ const QueueStoryWrapper = () => {
|
|
|
182
180
|
const meta = {
|
|
183
181
|
title: 'plugins/plugin-transcription/Transcript',
|
|
184
182
|
decorators: [
|
|
183
|
+
withTheme,
|
|
185
184
|
withPluginManager({
|
|
186
185
|
plugins: [
|
|
187
|
-
ThemePlugin({ tx: defaultTx }),
|
|
188
|
-
StorybookLayoutPlugin(),
|
|
189
186
|
ClientPlugin({
|
|
190
187
|
types: [TestItem, Testing.DocumentType, DataType.Person, DataType.Organization],
|
|
191
188
|
onClientInitialized: async ({ client }) => {
|
|
192
189
|
await client.halo.createIdentity();
|
|
193
190
|
},
|
|
194
191
|
}),
|
|
195
|
-
|
|
196
|
-
SpacePlugin(),
|
|
197
|
-
SettingsPlugin(),
|
|
192
|
+
SpacePlugin({}),
|
|
198
193
|
IntentPlugin(),
|
|
194
|
+
SettingsPlugin(),
|
|
195
|
+
|
|
196
|
+
// UI
|
|
197
|
+
PreviewPlugin(),
|
|
198
|
+
ThemePlugin({ tx: defaultTx }),
|
|
199
|
+
StorybookLayoutPlugin({}),
|
|
199
200
|
],
|
|
200
201
|
}),
|
|
201
|
-
withLayout({ fullscreen: true }),
|
|
202
202
|
],
|
|
203
203
|
parameters: {
|
|
204
|
+
layout: 'fullscreen',
|
|
204
205
|
translations,
|
|
205
206
|
},
|
|
206
207
|
} satisfies Meta;
|
|
@@ -232,10 +233,13 @@ export const WithQueue: StoryObj<typeof QueueStoryWrapper> = {
|
|
|
232
233
|
},
|
|
233
234
|
};
|
|
234
235
|
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
236
|
+
// NOTE: We are running out of free quota on hugging face entity extraction.
|
|
237
|
+
// TODO(mykola): Fix AI service in entity extraction function.
|
|
238
|
+
// TODO(mykola): Fix hugging face quota issues.
|
|
239
|
+
// export const WithEntityExtractionQueue: StoryObj<typeof EntityExtractionQueueStory> = {
|
|
240
|
+
// render: EntityExtractionQueueStory,
|
|
241
|
+
// args: {
|
|
242
|
+
// ignoreAttention: true,
|
|
243
|
+
// attendableId: 'story',
|
|
244
|
+
// },
|
|
245
|
+
// };
|
|
@@ -6,27 +6,27 @@ import React from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { type Space } from '@dxos/react-client/echo';
|
|
8
8
|
import { type Identity } from '@dxos/react-client/halo';
|
|
9
|
-
import {
|
|
9
|
+
import { type ThemedClassName, useThemeContext } from '@dxos/react-ui';
|
|
10
10
|
import {
|
|
11
|
+
autoScroll,
|
|
11
12
|
createBasicExtensions,
|
|
12
13
|
createMarkdownExtensions,
|
|
13
|
-
createRenderer,
|
|
14
14
|
createThemeExtensions,
|
|
15
15
|
decorateMarkdown,
|
|
16
|
-
editorWidth,
|
|
17
16
|
preview,
|
|
18
17
|
useTextEditor,
|
|
19
18
|
} from '@dxos/react-ui-editor';
|
|
20
19
|
import { mx } from '@dxos/react-ui-theme';
|
|
21
20
|
import { type DataType } from '@dxos/schema';
|
|
22
|
-
import {
|
|
21
|
+
import { isTruthy } from '@dxos/util';
|
|
23
22
|
|
|
24
23
|
import { type SerializationModel } from '../../model';
|
|
25
24
|
import { type Transcript } from '../../types';
|
|
26
25
|
|
|
27
26
|
import { transcript } from './transcript-extension';
|
|
28
27
|
|
|
29
|
-
|
|
28
|
+
// TODO(thure): Move this?
|
|
29
|
+
export const renderByline =
|
|
30
30
|
(identities: Identity[]) =>
|
|
31
31
|
(message: DataType.Message, index: number, debug = false): string[] => {
|
|
32
32
|
if (message.sender.role === 'assistant') {
|
|
@@ -45,6 +45,7 @@ export const renderMarkdown =
|
|
|
45
45
|
message.sender.identityDid;
|
|
46
46
|
const blocks = message.blocks.filter((block) => block._tag === 'transcript');
|
|
47
47
|
return [
|
|
48
|
+
// TODO(thure): Use an XML tag with the bits needed here.
|
|
48
49
|
`###### ${name}` + (debug ? ` [${index}]:${message.id}` : ''),
|
|
49
50
|
blocks.map((block) => block.text.trim()).join(' '),
|
|
50
51
|
'',
|
|
@@ -52,10 +53,10 @@ export const renderMarkdown =
|
|
|
52
53
|
};
|
|
53
54
|
|
|
54
55
|
export type TranscriptViewProps = ThemedClassName<{
|
|
55
|
-
transcript?: Transcript.Transcript;
|
|
56
56
|
space?: Space;
|
|
57
|
+
transcript?: Transcript.Transcript;
|
|
57
58
|
model: SerializationModel<DataType.Message>;
|
|
58
|
-
// TODO(
|
|
59
|
+
// TODO(burdon): Are these still in use?
|
|
59
60
|
attendableId?: string;
|
|
60
61
|
ignoreAttention?: boolean;
|
|
61
62
|
}>;
|
|
@@ -63,39 +64,30 @@ export type TranscriptViewProps = ThemedClassName<{
|
|
|
63
64
|
/**
|
|
64
65
|
* Transcript component implemented using the editor.
|
|
65
66
|
*/
|
|
66
|
-
export const TranscriptView = ({
|
|
67
|
-
classNames,
|
|
68
|
-
transcript: object,
|
|
69
|
-
space,
|
|
70
|
-
model,
|
|
71
|
-
attendableId,
|
|
72
|
-
ignoreAttention,
|
|
73
|
-
}: TranscriptViewProps) => {
|
|
67
|
+
export const TranscriptView = ({ classNames, space, transcript: object, model }: TranscriptViewProps) => {
|
|
74
68
|
const { themeMode } = useThemeContext();
|
|
75
69
|
const { parentRef } = useTextEditor(() => {
|
|
76
70
|
return {
|
|
77
71
|
extensions: [
|
|
78
72
|
createBasicExtensions({ readOnly: true, lineWrapping: true, search: true }),
|
|
79
|
-
createMarkdownExtensions(
|
|
73
|
+
createMarkdownExtensions(),
|
|
80
74
|
createThemeExtensions({ themeMode }),
|
|
81
75
|
decorateMarkdown(),
|
|
82
|
-
|
|
76
|
+
preview(),
|
|
83
77
|
transcript({
|
|
84
78
|
model,
|
|
85
79
|
started: object?.started ? new Date(object.started) : undefined,
|
|
86
|
-
renderButton: createRenderer(({ onClick }) => (
|
|
87
|
-
<IconButton icon='ph--arrow-line-down--regular' iconOnly label='Scroll to bottom' onClick={onClick} />
|
|
88
|
-
)),
|
|
89
80
|
}),
|
|
90
|
-
|
|
81
|
+
autoScroll(),
|
|
82
|
+
].filter(isTruthy),
|
|
91
83
|
};
|
|
92
84
|
}, [space, model]);
|
|
93
85
|
|
|
94
86
|
return (
|
|
95
87
|
<div
|
|
96
88
|
ref={parentRef}
|
|
97
|
-
className={mx('flex grow overflow-hidden',
|
|
98
|
-
data-popover-collision-boundary={true}
|
|
89
|
+
className={mx('flex grow overflow-hidden container-max-width', classNames)}
|
|
90
|
+
data-popover-collision-boundary={true /* TODO(thure): Make this a constant and document it. */}
|
|
99
91
|
/>
|
|
100
92
|
);
|
|
101
93
|
};
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { intervalToDuration } from 'date-fns/intervalToDuration';
|
|
6
|
-
import
|
|
6
|
+
import * as Schema from 'effect/Schema';
|
|
7
7
|
import { yieldOrContinue } from 'main-thread-scheduling';
|
|
8
8
|
import React, { type FC, type WheelEvent, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
9
9
|
import { type OnResizeCallback, useResizeDetector } from 'react-resize-detector';
|
|
@@ -21,7 +21,7 @@ import {
|
|
|
21
21
|
} from '@dxos/react-ui-grid';
|
|
22
22
|
import { mx } from '@dxos/react-ui-theme';
|
|
23
23
|
|
|
24
|
-
import {
|
|
24
|
+
import { meta } from '../../../meta';
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
27
|
* Transcription fragment.
|
|
@@ -125,7 +125,7 @@ export type TranscriptViewProps = ThemedClassName<{
|
|
|
125
125
|
* @@deprecated
|
|
126
126
|
*/
|
|
127
127
|
export const Transcript: FC<TranscriptViewProps> = ({ classNames, blocks, attendableId, ignoreAttention }) => {
|
|
128
|
-
const { t } = useTranslation(
|
|
128
|
+
const { t } = useTranslation(meta.id);
|
|
129
129
|
const [dxGrid, setDxGrid] = useState<DxGridElement | null>(null);
|
|
130
130
|
const [rows, setRows] = useState<DxGridAxisMeta | undefined>(undefined);
|
|
131
131
|
const [columns, setColumns] = useState<DxGridAxisMeta | undefined>(undefined);
|
|
@@ -144,7 +144,7 @@ export const Transcript: FC<TranscriptViewProps> = ({ classNames, blocks, attend
|
|
|
144
144
|
[hasAttention, ignoreAttention],
|
|
145
145
|
);
|
|
146
146
|
|
|
147
|
-
const abortControllerRef = useRef<AbortController>();
|
|
147
|
+
const abortControllerRef = useRef<AbortController>(null);
|
|
148
148
|
|
|
149
149
|
const handleResize = useCallback(
|
|
150
150
|
async ({ entry }: { entry: { target: HTMLDivElement } | null }) => {
|
|
@@ -242,7 +242,7 @@ export const Transcript: FC<TranscriptViewProps> = ({ classNames, blocks, attend
|
|
|
242
242
|
ref={setDxGrid}
|
|
243
243
|
/>
|
|
244
244
|
</Grid.Root>
|
|
245
|
-
<div role='none' {...{ inert:
|
|
245
|
+
<div role='none' {...{ inert: true }} aria-hidden className={measureClasses} ref={measureRef} />
|
|
246
246
|
<IconButton
|
|
247
247
|
icon='ph--arrow-line-down--regular'
|
|
248
248
|
iconOnly
|
|
@@ -8,7 +8,6 @@ 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 RenderCallback } from '@dxos/react-ui-editor';
|
|
12
11
|
import { type DataType } from '@dxos/schema';
|
|
13
12
|
|
|
14
13
|
import { DocumentAdapter, type SerializationModel } from '../../model';
|
|
@@ -19,13 +18,12 @@ import { DocumentAdapter, type SerializationModel } from '../../model';
|
|
|
19
18
|
export type TranscriptOptions = {
|
|
20
19
|
model: SerializationModel<DataType.Message>;
|
|
21
20
|
started?: Date;
|
|
22
|
-
renderButton?: RenderCallback<{ onClick: () => void }>;
|
|
23
21
|
};
|
|
24
22
|
|
|
25
23
|
/**
|
|
26
24
|
* Scrolling transcript with timestamps.
|
|
27
25
|
*/
|
|
28
|
-
export const transcript = ({ model, started
|
|
26
|
+
export const transcript = ({ model, started }: TranscriptOptions): Extension => {
|
|
29
27
|
return [
|
|
30
28
|
// Show timestamps in the gutter.
|
|
31
29
|
gutter({
|
|
@@ -90,22 +88,6 @@ export const transcript = ({ model, started, renderButton }: TranscriptOptions):
|
|
|
90
88
|
});
|
|
91
89
|
};
|
|
92
90
|
|
|
93
|
-
// Scroll button.
|
|
94
|
-
if (renderButton) {
|
|
95
|
-
this._controls = document.createElement('div');
|
|
96
|
-
this._controls.classList.add('cm-controls', 'transition-opacity', 'duration-300', 'opacity-0');
|
|
97
|
-
view.dom.appendChild(this._controls);
|
|
98
|
-
renderButton(
|
|
99
|
-
this._controls,
|
|
100
|
-
{
|
|
101
|
-
onClick: () => {
|
|
102
|
-
scrollToBottom(false);
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
view,
|
|
106
|
-
);
|
|
107
|
-
}
|
|
108
|
-
|
|
109
91
|
// Event listeners.
|
|
110
92
|
this._cleanup = combine(
|
|
111
93
|
addEventListener(view.scrollDOM, 'scroll', () => {
|
|
@@ -131,7 +113,7 @@ export const transcript = ({ model, started, renderButton }: TranscriptOptions):
|
|
|
131
113
|
);
|
|
132
114
|
}
|
|
133
115
|
|
|
134
|
-
update(
|
|
116
|
+
update(_update: ViewUpdate) {
|
|
135
117
|
// Initial sync.
|
|
136
118
|
if (!this._initialized) {
|
|
137
119
|
this._initialized = true;
|
|
@@ -149,25 +131,6 @@ export const transcript = ({ model, started, renderButton }: TranscriptOptions):
|
|
|
149
131
|
),
|
|
150
132
|
|
|
151
133
|
EditorView.theme({
|
|
152
|
-
'.cm-scroller': {
|
|
153
|
-
overflowY: 'scroll',
|
|
154
|
-
},
|
|
155
|
-
'.cm-hide-scrollbar': {
|
|
156
|
-
scrollbarWidth: 'none',
|
|
157
|
-
'-ms-overflow-style': 'none',
|
|
158
|
-
},
|
|
159
|
-
'.cm-hide-scrollbar::-webkit-scrollbar': {
|
|
160
|
-
display: 'none',
|
|
161
|
-
},
|
|
162
|
-
'.cm-controls': {
|
|
163
|
-
position: 'absolute',
|
|
164
|
-
bottom: '0.5rem',
|
|
165
|
-
right: '0.5rem',
|
|
166
|
-
zIndex: 1000,
|
|
167
|
-
},
|
|
168
|
-
'.cm-line': {
|
|
169
|
-
paddingRight: '1rem',
|
|
170
|
-
},
|
|
171
134
|
'.cm-timestamp-gutter': {
|
|
172
135
|
width: '6rem',
|
|
173
136
|
paddingRight: '1rem',
|