@dxos/plugin-transcription 0.8.4-main.f9ba587 → 0.8.4-main.fd6878d
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-E5NBJPAY.mjs → TranscriptContainer-FH7VAWYA.mjs} +3 -3
- package/dist/lib/browser/{chunk-F2WY3YTD.mjs → chunk-BJWYA2BU.mjs} +420 -402
- package/dist/lib/browser/chunk-BJWYA2BU.mjs.map +7 -0
- package/dist/lib/browser/{chunk-VDKDOZRR.mjs → chunk-KJIQQHJB.mjs} +38 -27
- package/dist/lib/browser/chunk-KJIQQHJB.mjs.map +7 -0
- package/dist/lib/browser/{chunk-R7INNNUQ.mjs → chunk-KWOOVS5G.mjs} +1 -1
- package/dist/lib/browser/{chunk-R7INNNUQ.mjs.map → chunk-KWOOVS5G.mjs.map} +2 -2
- package/dist/lib/browser/{chunk-U6QBOGTN.mjs → chunk-SREIAQSP.mjs} +1 -1
- package/dist/lib/browser/{chunk-U6QBOGTN.mjs.map → chunk-SREIAQSP.mjs.map} +1 -1
- package/dist/lib/browser/{chunk-EQBICGOD.mjs → chunk-UKUSJTQW.mjs} +2 -2
- package/dist/lib/browser/index.mjs +5 -5
- package/dist/lib/browser/{intent-resolver-3O33MMP5.mjs → intent-resolver-AOVQ7JI4.mjs} +2 -2
- package/dist/lib/{node-esm/intent-resolver-YMN5SXNC.mjs.map → browser/intent-resolver-AOVQ7JI4.mjs.map} +2 -2
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-FJTMNF3K.mjs → react-surface-4MEJMKYQ.mjs} +5 -5
- package/dist/lib/browser/{transcriber-YVOTUBKQ.mjs → transcriber-V77CN7XX.mjs} +4 -4
- package/dist/lib/browser/transcriber-V77CN7XX.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +1 -1
- package/dist/lib/node-esm/{TranscriptContainer-UOS7JG72.mjs → TranscriptContainer-GEUOOYHX.mjs} +3 -3
- package/dist/lib/node-esm/{chunk-HSCG4XPR.mjs → chunk-A33GNR44.mjs} +38 -27
- package/dist/lib/node-esm/chunk-A33GNR44.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-U65ZWK3L.mjs → chunk-IKQMDRY6.mjs} +1 -1
- package/dist/lib/node-esm/{chunk-U65ZWK3L.mjs.map → chunk-IKQMDRY6.mjs.map} +2 -2
- package/dist/lib/node-esm/{chunk-DN522SAP.mjs → chunk-PHP7MCAY.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-RHF2ALML.mjs → chunk-TM2ASOZA.mjs} +1 -1
- package/dist/lib/node-esm/{chunk-RHF2ALML.mjs.map → chunk-TM2ASOZA.mjs.map} +1 -1
- package/dist/lib/node-esm/{chunk-Q3JKLPTW.mjs → chunk-Y7PCJ34K.mjs} +420 -402
- package/dist/lib/node-esm/chunk-Y7PCJ34K.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +5 -5
- package/dist/lib/node-esm/{intent-resolver-YMN5SXNC.mjs → intent-resolver-P4XPIKQF.mjs} +2 -2
- package/dist/lib/{browser/intent-resolver-3O33MMP5.mjs.map → node-esm/intent-resolver-P4XPIKQF.mjs.map} +2 -2
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-57TSIDR2.mjs → react-surface-EZUPNHUC.mjs} +5 -5
- package/dist/lib/node-esm/{transcriber-GPBV52ZR.mjs → transcriber-3SX3DNLV.mjs} +4 -4
- package/dist/lib/node-esm/transcriber-3SX3DNLV.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/transcriber.d.ts.map +1 -1
- package/dist/types/src/components/Transcript/Transcript.d.ts.map +1 -1
- package/dist/types/src/components/Transcript/Transcript.stories.d.ts.map +1 -1
- package/dist/types/src/components/TranscriptContainer.d.ts +1 -1
- package/dist/types/src/components/TranscriptContainer.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/components/stories/FileTranscription.stories.d.ts.map +1 -1
- package/dist/types/src/components/stories/KeyWordRecognition.stories.d.ts +1 -1
- package/dist/types/src/components/stories/KeyWordRecognition.stories.d.ts.map +1 -1
- package/dist/types/src/components/stories/MicrophoneTranscription.stories.d.ts.map +1 -1
- package/dist/types/src/hooks/useVoiceInput.d.ts.map +1 -1
- package/dist/types/src/segments-normalization/normalization.d.ts +159 -66
- 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/transcriber/index.d.ts +1 -1
- package/dist/types/src/transcriber/index.d.ts.map +1 -1
- package/dist/types/src/transcriber/media-stream-recorder.d.ts +1 -1
- package/dist/types/src/transcriber/media-stream-recorder.d.ts.map +1 -1
- package/dist/types/src/transcriber/transcriber.d.ts +1 -1
- package/dist/types/src/transcriber/transcriber.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +55 -53
- package/src/capabilities/capabilities.ts +3 -3
- package/src/capabilities/intent-resolver.ts +2 -2
- package/src/capabilities/transcriber.ts +3 -2
- package/src/components/Transcript/Transcript.stories.tsx +3 -2
- package/src/components/Transcript/Transcript.tsx +5 -4
- package/src/components/Transcript/deprecated/OldTranscript.tsx +2 -2
- package/src/components/Transcript/transcript-extension.ts +2 -2
- package/src/components/TranscriptContainer.tsx +4 -3
- package/src/components/stories/FileTranscription.stories.tsx +22 -18
- package/src/components/stories/KeyWordRecognition.stories.tsx +1 -1
- package/src/components/stories/MicrophoneTranscription.stories.tsx +17 -14
- package/src/hooks/useVoiceInput.ts +3 -2
- package/src/model/model.test.ts +9 -9
- package/src/segments-normalization/message-normalizer.ts +1 -1
- package/src/segments-normalization/normalization.test.ts +19 -21
- package/src/segments-normalization/normalization.ts +54 -45
- package/src/testing/testing.ts +11 -11
- package/src/transcriber/index.ts +1 -1
- package/src/transcriber/media-stream-recorder.ts +1 -1
- package/src/transcriber/transcriber.browser.test.ts +4 -3
- package/src/transcriber/transcriber.ts +5 -7
- package/src/transcriber/transcription-manager.ts +3 -3
- package/src/types/types.ts +2 -1
- package/dist/lib/browser/chunk-F2WY3YTD.mjs.map +0 -7
- package/dist/lib/browser/chunk-VDKDOZRR.mjs.map +0 -7
- package/dist/lib/browser/transcriber-YVOTUBKQ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HSCG4XPR.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-Q3JKLPTW.mjs.map +0 -7
- package/dist/lib/node-esm/transcriber-GPBV52ZR.mjs.map +0 -7
- /package/dist/lib/browser/{TranscriptContainer-E5NBJPAY.mjs.map → TranscriptContainer-FH7VAWYA.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-EQBICGOD.mjs.map → chunk-UKUSJTQW.mjs.map} +0 -0
- /package/dist/lib/browser/{react-surface-FJTMNF3K.mjs.map → react-surface-4MEJMKYQ.mjs.map} +0 -0
- /package/dist/lib/node-esm/{TranscriptContainer-UOS7JG72.mjs.map → TranscriptContainer-GEUOOYHX.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-DN522SAP.mjs.map → chunk-PHP7MCAY.mjs.map} +0 -0
- /package/dist/lib/node-esm/{react-surface-57TSIDR2.mjs.map → react-surface-EZUPNHUC.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.fd6878d",
|
|
4
4
|
"description": "Voice transcription.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -9,11 +9,13 @@
|
|
|
9
9
|
"type": "module",
|
|
10
10
|
"exports": {
|
|
11
11
|
".": {
|
|
12
|
+
"source": "./src/index.ts",
|
|
12
13
|
"types": "./dist/types/src/index.d.ts",
|
|
13
14
|
"browser": "./dist/lib/browser/index.mjs",
|
|
14
15
|
"node": "./dist/lib/node-esm/index.mjs"
|
|
15
16
|
},
|
|
16
17
|
"./types": {
|
|
18
|
+
"source": "./src/types/index.ts",
|
|
17
19
|
"types": "./dist/types/src/types/index.d.ts",
|
|
18
20
|
"browser": "./dist/lib/browser/types/index.mjs",
|
|
19
21
|
"node": "./dist/lib/node-esm/types/index.mjs"
|
|
@@ -44,64 +46,64 @@
|
|
|
44
46
|
"react-router-dom": "^6.4.0",
|
|
45
47
|
"react-use": "^17.5.1",
|
|
46
48
|
"wavefile": "^11.0.0",
|
|
47
|
-
"@dxos/ai": "0.8.4-main.
|
|
48
|
-
"@dxos/app-framework": "0.8.4-main.
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/
|
|
56
|
-
"@dxos/display-name": "0.8.4-main.
|
|
57
|
-
"@dxos/echo": "0.8.4-main.
|
|
58
|
-
"@dxos/echo-db": "0.8.4-main.
|
|
59
|
-
"@dxos/
|
|
60
|
-
"@dxos/
|
|
61
|
-
"@dxos/invariant": "0.8.4-main.
|
|
62
|
-
"@dxos/keys": "0.8.4-main.
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/
|
|
67
|
-
"@dxos/plugin-deck": "0.8.4-main.
|
|
68
|
-
"@dxos/plugin-graph": "0.8.4-main.
|
|
69
|
-
"@dxos/plugin-
|
|
70
|
-
"@dxos/plugin-
|
|
71
|
-
"@dxos/plugin-thread": "0.8.4-main.
|
|
72
|
-
"@dxos/protocols": "0.8.4-main.
|
|
73
|
-
"@dxos/react-client": "0.8.4-main.
|
|
74
|
-
"@dxos/react-edge-client": "0.8.4-main.
|
|
75
|
-
"@dxos/react-ui-attention": "0.8.4-main.
|
|
76
|
-
"@dxos/react-ui-components": "0.8.4-main.
|
|
77
|
-
"@dxos/react-ui-
|
|
78
|
-
"@dxos/react-ui-
|
|
79
|
-
"@dxos/react-ui-grid": "0.8.4-main.
|
|
80
|
-
"@dxos/react-ui-
|
|
81
|
-
"@dxos/react-ui-
|
|
82
|
-
"@dxos/schema": "0.8.4-main.
|
|
83
|
-
"@dxos/tracing": "0.8.4-main.
|
|
84
|
-
"@dxos/util": "0.8.4-main.
|
|
49
|
+
"@dxos/ai": "0.8.4-main.fd6878d",
|
|
50
|
+
"@dxos/app-framework": "0.8.4-main.fd6878d",
|
|
51
|
+
"@dxos/assistant": "0.8.4-main.fd6878d",
|
|
52
|
+
"@dxos/async": "0.8.4-main.fd6878d",
|
|
53
|
+
"@dxos/client": "0.8.4-main.fd6878d",
|
|
54
|
+
"@dxos/blueprints": "0.8.4-main.fd6878d",
|
|
55
|
+
"@dxos/codec-protobuf": "0.8.4-main.fd6878d",
|
|
56
|
+
"@dxos/context": "0.8.4-main.fd6878d",
|
|
57
|
+
"@dxos/debug": "0.8.4-main.fd6878d",
|
|
58
|
+
"@dxos/display-name": "0.8.4-main.fd6878d",
|
|
59
|
+
"@dxos/echo": "0.8.4-main.fd6878d",
|
|
60
|
+
"@dxos/echo-db": "0.8.4-main.fd6878d",
|
|
61
|
+
"@dxos/functions": "0.8.4-main.fd6878d",
|
|
62
|
+
"@dxos/echo-schema": "0.8.4-main.fd6878d",
|
|
63
|
+
"@dxos/invariant": "0.8.4-main.fd6878d",
|
|
64
|
+
"@dxos/keys": "0.8.4-main.fd6878d",
|
|
65
|
+
"@dxos/live-object": "0.8.4-main.fd6878d",
|
|
66
|
+
"@dxos/log": "0.8.4-main.fd6878d",
|
|
67
|
+
"@dxos/plugin-client": "0.8.4-main.fd6878d",
|
|
68
|
+
"@dxos/local-storage": "0.8.4-main.fd6878d",
|
|
69
|
+
"@dxos/plugin-deck": "0.8.4-main.fd6878d",
|
|
70
|
+
"@dxos/plugin-graph": "0.8.4-main.fd6878d",
|
|
71
|
+
"@dxos/plugin-space": "0.8.4-main.fd6878d",
|
|
72
|
+
"@dxos/plugin-markdown": "0.8.4-main.fd6878d",
|
|
73
|
+
"@dxos/plugin-thread": "0.8.4-main.fd6878d",
|
|
74
|
+
"@dxos/protocols": "0.8.4-main.fd6878d",
|
|
75
|
+
"@dxos/react-client": "0.8.4-main.fd6878d",
|
|
76
|
+
"@dxos/react-edge-client": "0.8.4-main.fd6878d",
|
|
77
|
+
"@dxos/react-ui-attention": "0.8.4-main.fd6878d",
|
|
78
|
+
"@dxos/react-ui-components": "0.8.4-main.fd6878d",
|
|
79
|
+
"@dxos/react-ui-form": "0.8.4-main.fd6878d",
|
|
80
|
+
"@dxos/react-ui-editor": "0.8.4-main.fd6878d",
|
|
81
|
+
"@dxos/react-ui-grid": "0.8.4-main.fd6878d",
|
|
82
|
+
"@dxos/react-ui-stack": "0.8.4-main.fd6878d",
|
|
83
|
+
"@dxos/react-ui-sfx": "0.8.4-main.fd6878d",
|
|
84
|
+
"@dxos/schema": "0.8.4-main.fd6878d",
|
|
85
|
+
"@dxos/tracing": "0.8.4-main.fd6878d",
|
|
86
|
+
"@dxos/util": "0.8.4-main.fd6878d"
|
|
85
87
|
},
|
|
86
88
|
"devDependencies": {
|
|
87
89
|
"@effect-rx/rx-react": "0.38.0",
|
|
88
|
-
"@effect/platform": "0.
|
|
90
|
+
"@effect/platform": "0.90.2",
|
|
89
91
|
"@types/dom-speech-recognition": "^0.0.6",
|
|
90
92
|
"@types/react": "~18.2.0",
|
|
91
|
-
"effect": "3.
|
|
93
|
+
"effect": "3.17.7",
|
|
92
94
|
"react": "~18.2.0",
|
|
93
95
|
"react-dom": "~18.2.0",
|
|
94
96
|
"tailwindcss": "~3.4.1",
|
|
95
|
-
"@dxos/plugin-
|
|
96
|
-
"@dxos/plugin-
|
|
97
|
-
"@dxos/plugin-theme": "0.8.4-main.
|
|
98
|
-
"@dxos/
|
|
99
|
-
"@dxos/react-ui-form": "0.8.4-main.
|
|
100
|
-
"@dxos/
|
|
101
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
102
|
-
"@dxos/react-ui-
|
|
103
|
-
"@dxos/storybook-utils": "0.8.4-main.
|
|
104
|
-
"@dxos/test-utils": "0.8.4-main.
|
|
97
|
+
"@dxos/plugin-storybook-layout": "0.8.4-main.fd6878d",
|
|
98
|
+
"@dxos/plugin-preview": "0.8.4-main.fd6878d",
|
|
99
|
+
"@dxos/plugin-theme": "0.8.4-main.fd6878d",
|
|
100
|
+
"@dxos/react-ui": "0.8.4-main.fd6878d",
|
|
101
|
+
"@dxos/react-ui-form": "0.8.4-main.fd6878d",
|
|
102
|
+
"@dxos/random": "0.8.4-main.fd6878d",
|
|
103
|
+
"@dxos/react-ui-theme": "0.8.4-main.fd6878d",
|
|
104
|
+
"@dxos/react-ui-syntax-highlighter": "0.8.4-main.fd6878d",
|
|
105
|
+
"@dxos/storybook-utils": "0.8.4-main.fd6878d",
|
|
106
|
+
"@dxos/test-utils": "0.8.4-main.fd6878d"
|
|
105
107
|
},
|
|
106
108
|
"peerDependencies": {
|
|
107
109
|
"@effect-rx/rx-react": "^0.34.1",
|
|
@@ -109,8 +111,8 @@
|
|
|
109
111
|
"effect": "^3.13.3",
|
|
110
112
|
"react": "~18.2.0",
|
|
111
113
|
"react-dom": "~18.2.0",
|
|
112
|
-
"@dxos/react-ui": "0.8.4-main.
|
|
113
|
-
"@dxos/react-ui-theme": "0.8.4-main.
|
|
114
|
+
"@dxos/react-ui": "0.8.4-main.fd6878d",
|
|
115
|
+
"@dxos/react-ui-theme": "0.8.4-main.fd6878d"
|
|
114
116
|
},
|
|
115
117
|
"publishConfig": {
|
|
116
118
|
"access": "public"
|
|
@@ -6,11 +6,11 @@ import { defineCapability } from '@dxos/app-framework';
|
|
|
6
6
|
|
|
7
7
|
import { TRANSCRIPTION_PLUGIN } from '../meta';
|
|
8
8
|
import {
|
|
9
|
-
type
|
|
9
|
+
type MediaStreamRecorderParams,
|
|
10
10
|
type Transcriber,
|
|
11
|
-
type
|
|
11
|
+
type TranscriberParams,
|
|
12
12
|
type TranscriptMessageEnricher,
|
|
13
|
-
type
|
|
13
|
+
type TranscriptionManager,
|
|
14
14
|
} from '../transcriber';
|
|
15
15
|
|
|
16
16
|
export namespace TranscriptionCapabilities {
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { Capabilities, contributes, createResolver
|
|
5
|
+
import { Capabilities, type PluginContext, contributes, createResolver } from '@dxos/app-framework';
|
|
6
6
|
import { type Key, Obj, Ref } from '@dxos/echo';
|
|
7
7
|
import { createQueueDXN } from '@dxos/echo-schema';
|
|
8
8
|
|
|
9
|
-
import {
|
|
9
|
+
import { TranscriptType, TranscriptionAction } from '../types';
|
|
10
10
|
|
|
11
11
|
export default (context: PluginContext) =>
|
|
12
12
|
contributes(Capabilities.IntentResolver, [
|
|
@@ -2,12 +2,13 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { type PluginContext, contributes } from '@dxos/app-framework';
|
|
6
6
|
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
7
7
|
|
|
8
|
-
import { TranscriptionCapabilities } from './capabilities';
|
|
9
8
|
import { MediaStreamRecorder, Transcriber, TranscriptionManager } from '../transcriber';
|
|
10
9
|
|
|
10
|
+
import { TranscriptionCapabilities } from './capabilities';
|
|
11
|
+
|
|
11
12
|
// TODO(burdon): Move to config?
|
|
12
13
|
|
|
13
14
|
/**
|
|
@@ -24,7 +24,6 @@ import { DataType } from '@dxos/schema';
|
|
|
24
24
|
import { Testing } from '@dxos/schema/testing';
|
|
25
25
|
import { withLayout } from '@dxos/storybook-utils';
|
|
26
26
|
|
|
27
|
-
import { renderMarkdown, Transcript, type TranscriptProps } from './Transcript';
|
|
28
27
|
import { useQueueModelAdapter } from '../../hooks';
|
|
29
28
|
import { SerializationModel } from '../../model';
|
|
30
29
|
import {
|
|
@@ -35,6 +34,8 @@ import {
|
|
|
35
34
|
} from '../../testing';
|
|
36
35
|
import { translations } from '../../translations';
|
|
37
36
|
|
|
37
|
+
import { Transcript, type TranscriptProps, renderMarkdown } from './Transcript';
|
|
38
|
+
|
|
38
39
|
faker.seed(1);
|
|
39
40
|
|
|
40
41
|
/**
|
|
@@ -187,7 +188,7 @@ const meta: Meta<typeof QueueStory> = {
|
|
|
187
188
|
StorybookLayoutPlugin(),
|
|
188
189
|
ClientPlugin({
|
|
189
190
|
types: [TestItem, Testing.DocumentType, DataType.Person, DataType.Organization],
|
|
190
|
-
onClientInitialized: async (
|
|
191
|
+
onClientInitialized: async ({ client }) => {
|
|
191
192
|
await client.halo.createIdentity();
|
|
192
193
|
},
|
|
193
194
|
}),
|
|
@@ -21,16 +21,17 @@ import { mx } from '@dxos/react-ui-theme';
|
|
|
21
21
|
import { type DataType } from '@dxos/schema';
|
|
22
22
|
import { isNotFalsy } from '@dxos/util';
|
|
23
23
|
|
|
24
|
-
import { transcript } from './transcript-extension';
|
|
25
24
|
import { type SerializationModel } from '../../model';
|
|
26
25
|
import { type TranscriptType } from '../../types';
|
|
27
26
|
|
|
27
|
+
import { transcript } from './transcript-extension';
|
|
28
|
+
|
|
28
29
|
export const renderMarkdown =
|
|
29
30
|
(identities: Identity[]) =>
|
|
30
31
|
(message: DataType.Message, index: number, debug = false): string[] => {
|
|
31
32
|
if (message.sender.role === 'assistant') {
|
|
32
33
|
// Start/stop block.
|
|
33
|
-
return [message.blocks.find((block) => block.
|
|
34
|
+
return [message.blocks.find((block) => block._tag === 'transcript')?.text ?? '', ''];
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
// TODO(burdon): Use link/reference markup for users (with popover).
|
|
@@ -42,7 +43,7 @@ export const renderMarkdown =
|
|
|
42
43
|
message.sender.name ??
|
|
43
44
|
message.sender.email ??
|
|
44
45
|
message.sender.identityDid;
|
|
45
|
-
const blocks = message.blocks.filter((block) => block.
|
|
46
|
+
const blocks = message.blocks.filter((block) => block._tag === 'transcript');
|
|
46
47
|
return [
|
|
47
48
|
`###### ${name}` + (debug ? ` [${index}]:${message.id}` : ''),
|
|
48
49
|
blocks.map((block) => block.text.trim()).join(' '),
|
|
@@ -74,7 +75,7 @@ export const Transcript = ({
|
|
|
74
75
|
const { parentRef } = useTextEditor(() => {
|
|
75
76
|
return {
|
|
76
77
|
extensions: [
|
|
77
|
-
createBasicExtensions({ readOnly: true, lineWrapping: true }),
|
|
78
|
+
createBasicExtensions({ readOnly: true, lineWrapping: true, search: true }),
|
|
78
79
|
createMarkdownExtensions({ themeMode }),
|
|
79
80
|
createThemeExtensions({ themeMode }),
|
|
80
81
|
decorateMarkdown(),
|
|
@@ -5,16 +5,16 @@
|
|
|
5
5
|
import { intervalToDuration } from 'date-fns/intervalToDuration';
|
|
6
6
|
import { Schema } from 'effect';
|
|
7
7
|
import { yieldOrContinue } from 'main-thread-scheduling';
|
|
8
|
-
import React, { type FC, useCallback, useEffect, useMemo, useRef, useState
|
|
8
|
+
import React, { type FC, type WheelEvent, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
9
9
|
import { type OnResizeCallback, useResizeDetector } from 'react-resize-detector';
|
|
10
10
|
|
|
11
11
|
import { Type } from '@dxos/echo';
|
|
12
12
|
import { IconButton, type ThemedClassName, useTranslation } from '@dxos/react-ui';
|
|
13
13
|
import { useAttention } from '@dxos/react-ui-attention';
|
|
14
14
|
import {
|
|
15
|
+
type DxGridAxisMeta,
|
|
15
16
|
type DxGridCellValue,
|
|
16
17
|
type DxGridElement,
|
|
17
|
-
type DxGridAxisMeta,
|
|
18
18
|
type DxGridPlaneCells,
|
|
19
19
|
Grid,
|
|
20
20
|
toPlaneCellIndex,
|
|
@@ -38,7 +38,7 @@ export const transcript = ({ model, started, renderButton }: TranscriptOptions):
|
|
|
38
38
|
let line = view.state.doc.lineAt(from);
|
|
39
39
|
while (line.from <= to) {
|
|
40
40
|
const block = model.getChunkAtLine(line.number)?.blocks[0];
|
|
41
|
-
const timestamp = block?.
|
|
41
|
+
const timestamp = block?._tag === 'transcript' && block.started;
|
|
42
42
|
if (timestamp) {
|
|
43
43
|
builder.add(line.from, line.from, new TimestampMarker(line.number, new Date(timestamp), start));
|
|
44
44
|
}
|
|
@@ -218,7 +218,7 @@ const getStartTime = (started?: Date, message?: DataType.Message): Date | undefi
|
|
|
218
218
|
return started;
|
|
219
219
|
}
|
|
220
220
|
|
|
221
|
-
if (message?.blocks[0]?.
|
|
221
|
+
if (message?.blocks[0]?._tag === 'transcript' && message.blocks[0].started) {
|
|
222
222
|
return new Date(message.blocks[0].started);
|
|
223
223
|
}
|
|
224
224
|
|
|
@@ -9,16 +9,17 @@ import { useMembers, useQueue } from '@dxos/react-client/echo';
|
|
|
9
9
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
10
10
|
import { type DataType } from '@dxos/schema';
|
|
11
11
|
|
|
12
|
-
import { Transcript, renderMarkdown } from './Transcript';
|
|
13
12
|
import { useQueueModelAdapter } from '../hooks';
|
|
14
13
|
import { type TranscriptType } from '../types';
|
|
15
14
|
|
|
15
|
+
import { Transcript, renderMarkdown } from './Transcript';
|
|
16
|
+
|
|
16
17
|
export type TranscriptionContainerProps = {
|
|
17
18
|
role: string;
|
|
18
19
|
transcript: TranscriptType;
|
|
19
20
|
};
|
|
20
21
|
|
|
21
|
-
export const TranscriptionContainer = ({
|
|
22
|
+
export const TranscriptionContainer = ({ transcript }: TranscriptionContainerProps) => {
|
|
22
23
|
const attendableId = fullyQualifiedId(transcript);
|
|
23
24
|
const space = getSpace(transcript);
|
|
24
25
|
const members = useMembers(space?.key).map((member) => member.identity);
|
|
@@ -26,7 +27,7 @@ export const TranscriptionContainer = ({ role, transcript }: TranscriptionContai
|
|
|
26
27
|
const model = useQueueModelAdapter(renderMarkdown(members), queue);
|
|
27
28
|
|
|
28
29
|
return (
|
|
29
|
-
<StackItem.Content
|
|
30
|
+
<StackItem.Content classNames='container-max-width pli-2'>
|
|
30
31
|
<Transcript attendableId={attendableId} space={space} model={model} transcript={transcript} />
|
|
31
32
|
</StackItem.Content>
|
|
32
33
|
);
|
|
@@ -7,8 +7,6 @@ import '@dxos-theme';
|
|
|
7
7
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
8
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
9
9
|
|
|
10
|
-
import { EdgeAiServiceClient } from '@dxos/ai';
|
|
11
|
-
import { AI_SERVICE_ENDPOINT } from '@dxos/ai/testing';
|
|
12
10
|
import { Events, IntentPlugin, SettingsPlugin } from '@dxos/app-framework';
|
|
13
11
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
14
12
|
import { scheduleTask } from '@dxos/async';
|
|
@@ -25,18 +23,19 @@ import { StorybookLayoutPlugin } from '@dxos/plugin-storybook-layout';
|
|
|
25
23
|
import { ThemePlugin } from '@dxos/plugin-theme';
|
|
26
24
|
import { defaultTx } from '@dxos/react-ui-theme';
|
|
27
25
|
import { DataType } from '@dxos/schema';
|
|
28
|
-
import {
|
|
26
|
+
import { Testing, seedTestData } from '@dxos/schema/testing';
|
|
29
27
|
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
30
28
|
|
|
31
|
-
import { TranscriptionStory } from './TranscriptionStory';
|
|
32
|
-
import { useIsSpeaking } from './useIsSpeaking';
|
|
33
|
-
import { TranscriptionPlugin } from '../../TranscriptionPlugin';
|
|
34
29
|
import { useAudioFile, useQueueModelAdapter, useTranscriber } from '../../hooks';
|
|
35
|
-
import {
|
|
30
|
+
import { MessageNormalizer, getActorId } from '../../segments-normalization';
|
|
36
31
|
import { TestItem } from '../../testing';
|
|
37
32
|
import { type MediaStreamRecorderParams, type TranscriberParams } from '../../transcriber';
|
|
33
|
+
import { TranscriptionPlugin } from '../../TranscriptionPlugin';
|
|
38
34
|
import { renderMarkdown } from '../Transcript';
|
|
39
35
|
|
|
36
|
+
import { TranscriptionStory } from './TranscriptionStory';
|
|
37
|
+
import { useIsSpeaking } from './useIsSpeaking';
|
|
38
|
+
|
|
40
39
|
const AudioFile = ({
|
|
41
40
|
detectSpeaking,
|
|
42
41
|
audioUrl,
|
|
@@ -88,8 +87,13 @@ const AudioFile = ({
|
|
|
88
87
|
const model = useQueueModelAdapter(renderMarkdown([]), queue);
|
|
89
88
|
const handleSegments = useCallback<TranscriberParams['onSegments']>(
|
|
90
89
|
async (blocks) => {
|
|
91
|
-
|
|
92
|
-
|
|
90
|
+
void queue?.append([
|
|
91
|
+
Obj.make(DataType.Message, {
|
|
92
|
+
created: new Date().toISOString(),
|
|
93
|
+
sender: actor,
|
|
94
|
+
blocks,
|
|
95
|
+
}),
|
|
96
|
+
]);
|
|
93
97
|
},
|
|
94
98
|
[queue],
|
|
95
99
|
);
|
|
@@ -108,14 +112,14 @@ const AudioFile = ({
|
|
|
108
112
|
}
|
|
109
113
|
const executor = new FunctionExecutor(
|
|
110
114
|
new ServiceContainer().setServices({
|
|
111
|
-
ai: {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
},
|
|
115
|
+
// ai: {
|
|
116
|
+
// client: new Edge AiServiceClient({
|
|
117
|
+
// endpoint: AI_SERVICE_ENDPOINT.REMOTE,
|
|
118
|
+
// defaultGenerationOptions: {
|
|
119
|
+
// model: '@anthropic/claude-3-5-sonnet-20241022',
|
|
120
|
+
// },
|
|
121
|
+
// }),
|
|
122
|
+
// },
|
|
119
123
|
}),
|
|
120
124
|
);
|
|
121
125
|
|
|
@@ -184,7 +188,7 @@ const meta: Meta<typeof AudioFile> = {
|
|
|
184
188
|
StorybookLayoutPlugin(),
|
|
185
189
|
ClientPlugin({
|
|
186
190
|
types: [TestItem, DataType.Person, DataType.Organization, Testing.DocumentType],
|
|
187
|
-
onClientInitialized: async (
|
|
191
|
+
onClientInitialized: async ({ client }) => {
|
|
188
192
|
await client.halo.createIdentity();
|
|
189
193
|
await client.spaces.waitUntilReady();
|
|
190
194
|
await client.spaces.default.waitUntilReady();
|
|
@@ -7,17 +7,15 @@ import '@dxos-theme';
|
|
|
7
7
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
8
|
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
9
9
|
|
|
10
|
-
import { EdgeAiServiceClient } from '@dxos/ai';
|
|
11
|
-
import { AI_SERVICE_ENDPOINT } from '@dxos/ai/testing';
|
|
12
10
|
import { Events, IntentPlugin, SettingsPlugin } from '@dxos/app-framework';
|
|
13
11
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
14
12
|
import {
|
|
15
|
-
extractionAnthropicFn,
|
|
16
13
|
type ExtractionFunction,
|
|
14
|
+
extractionAnthropicFn,
|
|
17
15
|
extractionNerFn,
|
|
18
|
-
processTranscriptMessage,
|
|
19
16
|
getNer,
|
|
20
|
-
|
|
17
|
+
processTranscriptMessage,
|
|
18
|
+
} from '@dxos/assistant/extraction';
|
|
21
19
|
import { Filter, Obj, type Type } from '@dxos/echo';
|
|
22
20
|
import { MemoryQueue } from '@dxos/echo-db';
|
|
23
21
|
import { createQueueDXN } from '@dxos/echo-schema';
|
|
@@ -32,17 +30,18 @@ import { ThemePlugin } from '@dxos/plugin-theme';
|
|
|
32
30
|
import { IndexKind, useSpace } from '@dxos/react-client/echo';
|
|
33
31
|
import { defaultTx } from '@dxos/react-ui-theme';
|
|
34
32
|
import { DataType } from '@dxos/schema';
|
|
35
|
-
import {
|
|
33
|
+
import { Testing, seedTestData } from '@dxos/schema/testing';
|
|
36
34
|
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
37
35
|
|
|
38
|
-
import { TranscriptionStory } from './TranscriptionStory';
|
|
39
|
-
import { useIsSpeaking } from './useIsSpeaking';
|
|
40
|
-
import { TranscriptionPlugin } from '../../TranscriptionPlugin';
|
|
41
36
|
import { useAudioTrack, useQueueModelAdapter, useTranscriber } from '../../hooks';
|
|
42
37
|
import { TestItem } from '../../testing';
|
|
43
38
|
import { type MediaStreamRecorderParams, type TranscriberParams } from '../../transcriber';
|
|
39
|
+
import { TranscriptionPlugin } from '../../TranscriptionPlugin';
|
|
44
40
|
import { renderMarkdown } from '../Transcript';
|
|
45
41
|
|
|
42
|
+
import { TranscriptionStory } from './TranscriptionStory';
|
|
43
|
+
import { useIsSpeaking } from './useIsSpeaking';
|
|
44
|
+
|
|
46
45
|
const TRANSCRIBER_CONFIG = {
|
|
47
46
|
transcribeAfterChunksAmount: 50,
|
|
48
47
|
prefixBufferChunksAmount: 10,
|
|
@@ -117,11 +116,15 @@ const DefaultStory = ({
|
|
|
117
116
|
.then((result) => result.objects);
|
|
118
117
|
}
|
|
119
118
|
if (entityExtraction !== 'none') {
|
|
120
|
-
const AiService = new EdgeAiServiceClient({
|
|
121
|
-
endpoint: AI_SERVICE_ENDPOINT.REMOTE,
|
|
122
|
-
});
|
|
123
119
|
executor = new FunctionExecutor(
|
|
124
|
-
new ServiceContainer().setServices({
|
|
120
|
+
new ServiceContainer().setServices({
|
|
121
|
+
// ai: {
|
|
122
|
+
// client: new Edge AiServiceClient({
|
|
123
|
+
// endpoint: AI_SERVICE_ENDPOINT.REMOTE,
|
|
124
|
+
// }),
|
|
125
|
+
// },
|
|
126
|
+
// database: { db: space!.db },
|
|
127
|
+
}),
|
|
125
128
|
);
|
|
126
129
|
}
|
|
127
130
|
|
|
@@ -200,7 +203,7 @@ const meta: Meta<typeof DefaultStory> = {
|
|
|
200
203
|
StorybookLayoutPlugin(),
|
|
201
204
|
ClientPlugin({
|
|
202
205
|
types: [TestItem, DataType.Person, DataType.Organization, Testing.DocumentType],
|
|
203
|
-
onClientInitialized: async (
|
|
206
|
+
onClientInitialized: async ({ client }) => {
|
|
204
207
|
await client.halo.createIdentity();
|
|
205
208
|
await client.spaces.waitUntilReady();
|
|
206
209
|
await client.spaces.default.waitUntilReady();
|
|
@@ -2,16 +2,17 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { useCallback, useEffect, useState } from 'react';
|
|
6
6
|
|
|
7
7
|
import { scheduleMicroTask } from '@dxos/async';
|
|
8
8
|
import { Context } from '@dxos/context';
|
|
9
9
|
import { log } from '@dxos/log';
|
|
10
10
|
import { useSoundEffect } from '@dxos/react-ui-sfx';
|
|
11
11
|
|
|
12
|
+
import { type TranscriberParams } from '../transcriber';
|
|
13
|
+
|
|
12
14
|
import { useAudioTrack } from './useAudioTrack';
|
|
13
15
|
import { useTranscriber } from './useTranscriber';
|
|
14
|
-
import { type TranscriberParams } from '../transcriber';
|
|
15
16
|
|
|
16
17
|
export type UseVoiceInputProps = {
|
|
17
18
|
active?: boolean;
|
package/src/model/model.test.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { Obj } from '@dxos/echo';
|
|
|
9
9
|
import type { ObjectId } from '@dxos/keys';
|
|
10
10
|
import { DataType } from '@dxos/schema';
|
|
11
11
|
|
|
12
|
-
import {
|
|
12
|
+
import { type ChunkRenderer, DocumentAdapter, SerializationModel } from './model';
|
|
13
13
|
|
|
14
14
|
const blockToMarkdown: ChunkRenderer<DataType.Message> = (
|
|
15
15
|
message: DataType.Message,
|
|
@@ -18,7 +18,7 @@ const blockToMarkdown: ChunkRenderer<DataType.Message> = (
|
|
|
18
18
|
): string[] => {
|
|
19
19
|
return [
|
|
20
20
|
`###### ${message.sender.name}`,
|
|
21
|
-
...message.blocks.filter((block) => block.
|
|
21
|
+
...message.blocks.filter((block) => block._tag === 'transcript').map((block) => block.text),
|
|
22
22
|
'',
|
|
23
23
|
];
|
|
24
24
|
};
|
|
@@ -37,7 +37,7 @@ describe('SerializationModel', () => {
|
|
|
37
37
|
sender: { name: 'Alice' },
|
|
38
38
|
blocks: [
|
|
39
39
|
{
|
|
40
|
-
|
|
40
|
+
_tag: 'transcript',
|
|
41
41
|
started: createDate(),
|
|
42
42
|
text: 'Hello world!',
|
|
43
43
|
},
|
|
@@ -51,7 +51,7 @@ describe('SerializationModel', () => {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
// Update message.
|
|
54
|
-
message.blocks.push({
|
|
54
|
+
message.blocks.push({ _tag: 'transcript', started: createDate(), text: 'Hello again!' });
|
|
55
55
|
model.updateChunk(message);
|
|
56
56
|
{
|
|
57
57
|
const text = model.doc.toString();
|
|
@@ -74,7 +74,7 @@ describe('SerializationModel', () => {
|
|
|
74
74
|
sender: { name: 'Alice' },
|
|
75
75
|
blocks: [
|
|
76
76
|
{
|
|
77
|
-
|
|
77
|
+
_tag: 'transcript',
|
|
78
78
|
started: createDate(),
|
|
79
79
|
text: 'Hello world!',
|
|
80
80
|
},
|
|
@@ -92,7 +92,7 @@ describe('SerializationModel', () => {
|
|
|
92
92
|
sender: { name: 'Bob' },
|
|
93
93
|
blocks: [
|
|
94
94
|
{
|
|
95
|
-
|
|
95
|
+
_tag: 'transcript',
|
|
96
96
|
started: createDate(),
|
|
97
97
|
text: 'Hello world!',
|
|
98
98
|
},
|
|
@@ -119,7 +119,7 @@ describe('SerializationModel', () => {
|
|
|
119
119
|
sender: { name: 'Alice' },
|
|
120
120
|
blocks: [
|
|
121
121
|
{
|
|
122
|
-
|
|
122
|
+
_tag: 'transcript',
|
|
123
123
|
started: createDate(),
|
|
124
124
|
text: 'Hello world!',
|
|
125
125
|
},
|
|
@@ -131,7 +131,7 @@ describe('SerializationModel', () => {
|
|
|
131
131
|
expect(view.state.doc.toString()).to.eq('###### Alice\nHello world!\n\n');
|
|
132
132
|
|
|
133
133
|
// Update message (add block).
|
|
134
|
-
message.blocks.push({
|
|
134
|
+
message.blocks.push({ _tag: 'transcript', started: createDate(), text: 'Hello again!' });
|
|
135
135
|
model.updateChunk(message);
|
|
136
136
|
model.sync(adapter);
|
|
137
137
|
expect(view.state.doc.toString()).to.eq('###### Alice\nHello world!\nHello again!\n\n');
|
|
@@ -150,7 +150,7 @@ describe('SerializationModel', () => {
|
|
|
150
150
|
const message = Obj.make(DataType.Message, {
|
|
151
151
|
created: createDate(),
|
|
152
152
|
sender: { name: 'Bob' },
|
|
153
|
-
blocks: [{
|
|
153
|
+
blocks: [{ _tag: 'transcript', started: createDate(), text: 'Hello again!' }],
|
|
154
154
|
});
|
|
155
155
|
model.appendChunk(message);
|
|
156
156
|
model.sync(adapter);
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
import { effect } from '@preact/signals-core';
|
|
10
10
|
|
|
11
|
-
import {
|
|
11
|
+
import { DeferredTask, asyncTimeout } from '@dxos/async';
|
|
12
12
|
import { LifecycleState, Resource } from '@dxos/context';
|
|
13
13
|
import { type Queue } from '@dxos/echo-db';
|
|
14
14
|
import { type FunctionExecutor } from '@dxos/functions';
|