@dxos/plugin-transcription 0.8.2-staging.7ac8446 → 0.8.2
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-PFKLKRPQ.mjs +11 -0
- package/dist/lib/browser/{chunk-YCZISX63.mjs → chunk-4KCUYW2F.mjs} +139 -95
- package/dist/lib/browser/chunk-4KCUYW2F.mjs.map +7 -0
- package/dist/lib/browser/{chunk-6ZR5MDK3.mjs → chunk-GOF7MJNV.mjs} +3 -3
- package/dist/lib/browser/{chunk-6ZR5MDK3.mjs.map → chunk-GOF7MJNV.mjs.map} +1 -1
- package/dist/lib/browser/{chunk-K7FOYAXO.mjs → chunk-IGEKO7ZU.mjs} +2 -2
- package/dist/lib/browser/chunk-NODIXNQP.mjs +54 -0
- package/dist/lib/browser/chunk-NODIXNQP.mjs.map +7 -0
- package/dist/lib/browser/chunk-TJPJBE45.mjs +764 -0
- package/dist/lib/browser/chunk-TJPJBE45.mjs.map +7 -0
- package/dist/lib/browser/{chunk-YEPT334A.mjs → chunk-W2KNYJD6.mjs} +4 -4
- package/dist/lib/browser/chunk-W2KNYJD6.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +30 -216
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/{intent-resolver-4R66ZCKT.mjs → intent-resolver-I2LJSQDR.mjs} +7 -11
- package/dist/lib/browser/intent-resolver-I2LJSQDR.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-FQUHU5G7.mjs → react-surface-ID2MLJHZ.mjs} +11 -9
- package/dist/lib/browser/react-surface-ID2MLJHZ.mjs.map +7 -0
- package/dist/lib/browser/transcriber-NA7CIFIT.mjs +56 -0
- package/dist/lib/browser/transcriber-NA7CIFIT.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +4 -8
- package/dist/lib/node/{TranscriptContainer-QEYTTT2V.cjs → TranscriptContainer-LHMC7553.cjs} +9 -8
- package/dist/lib/node/TranscriptContainer-LHMC7553.cjs.map +7 -0
- package/dist/lib/node/chunk-3GS5UNO5.cjs +778 -0
- package/dist/lib/node/chunk-3GS5UNO5.cjs.map +7 -0
- package/dist/lib/node/{chunk-LP4FG423.cjs → chunk-5J3FBCON.cjs} +5 -5
- package/dist/lib/node/{chunk-NVZWGFJL.cjs → chunk-AFUZI63A.cjs} +6 -6
- package/dist/lib/node/{chunk-NVZWGFJL.cjs.map → chunk-AFUZI63A.cjs.map} +1 -1
- package/dist/lib/node/chunk-EIMUQYCZ.cjs +74 -0
- package/dist/lib/node/chunk-EIMUQYCZ.cjs.map +7 -0
- package/dist/lib/node/{chunk-CZMLKKWT.cjs → chunk-FKDJNJ57.cjs} +8 -8
- package/dist/lib/node/chunk-FKDJNJ57.cjs.map +7 -0
- package/dist/lib/node/{chunk-FCCJALOT.cjs → chunk-ZFTXJZXH.cjs} +138 -95
- package/dist/lib/node/chunk-ZFTXJZXH.cjs.map +7 -0
- package/dist/lib/node/index.cjs +59 -251
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/{intent-resolver-WMMCOUEH.cjs → intent-resolver-LLMGF5I5.cjs} +10 -11
- package/dist/lib/node/intent-resolver-LLMGF5I5.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-surface-WI2MGWCC.cjs → react-surface-SEQLEL4K.cjs} +13 -11
- package/dist/lib/node/react-surface-SEQLEL4K.cjs.map +7 -0
- package/dist/lib/node/transcriber-RKKN7LDU.cjs +68 -0
- package/dist/lib/node/transcriber-RKKN7LDU.cjs.map +7 -0
- package/dist/lib/node/types/index.cjs +7 -11
- package/dist/lib/node/types/index.cjs.map +2 -2
- package/dist/lib/node-esm/{TranscriptContainer-ZXUCOWGY.mjs → TranscriptContainer-DLNRFVTA.mjs} +4 -3
- package/dist/lib/node-esm/chunk-BRPFVRAD.mjs +55 -0
- package/dist/lib/node-esm/chunk-BRPFVRAD.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-YQYBLFNI.mjs → chunk-EFIWBQDF.mjs} +139 -95
- package/dist/lib/node-esm/chunk-EFIWBQDF.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-J4D2RBBH.mjs → chunk-KUWWHMOA.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-PTZHDZ36.mjs → chunk-MFJPEIVB.mjs} +4 -4
- package/dist/lib/node-esm/chunk-MFJPEIVB.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-PR7EYODX.mjs +765 -0
- package/dist/lib/node-esm/chunk-PR7EYODX.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-X4DDJIVL.mjs → chunk-TXMDLLBR.mjs} +3 -3
- package/dist/lib/node-esm/{chunk-X4DDJIVL.mjs.map → chunk-TXMDLLBR.mjs.map} +1 -1
- package/dist/lib/node-esm/index.mjs +30 -216
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/{intent-resolver-QN2LO5TX.mjs → intent-resolver-WOZKOEBW.mjs} +7 -11
- package/dist/lib/node-esm/intent-resolver-WOZKOEBW.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-PCH6NTVB.mjs → react-surface-7MXUUTAL.mjs} +11 -9
- package/dist/lib/node-esm/react-surface-7MXUUTAL.mjs.map +7 -0
- package/dist/lib/node-esm/transcriber-5WSI6DYK.mjs +57 -0
- package/dist/lib/node-esm/transcriber-5WSI6DYK.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +4 -8
- package/dist/types/src/TranscriptionPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts +8 -10
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +2 -183
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +2 -2
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/transcriber.d.ts +2 -1
- package/dist/types/src/capabilities/transcriber.d.ts.map +1 -1
- package/dist/types/src/components/Transcript/Transcript.d.ts +14 -4
- package/dist/types/src/components/Transcript/Transcript.d.ts.map +1 -1
- package/dist/types/src/components/Transcript/Transcript.stories.d.ts +19 -4
- package/dist/types/src/components/Transcript/Transcript.stories.d.ts.map +1 -1
- package/dist/types/src/components/Transcript/deprecated/OldTranscript.d.ts +27 -0
- package/dist/types/src/components/Transcript/deprecated/OldTranscript.d.ts.map +1 -0
- package/dist/types/src/components/Transcript/transcript-extension.d.ts +19 -0
- package/dist/types/src/components/Transcript/transcript-extension.d.ts.map +1 -0
- package/dist/types/src/components/TranscriptContainer.d.ts.map +1 -1
- package/dist/types/src/components/stories/FileTranscription.stories.d.ts +17 -0
- package/dist/types/src/components/stories/FileTranscription.stories.d.ts.map +1 -0
- package/dist/types/src/components/stories/KeyWordRecognition.stories.d.ts +10 -0
- package/dist/types/src/components/stories/KeyWordRecognition.stories.d.ts.map +1 -0
- package/dist/types/src/components/stories/MicrophoneTranscription.stories.d.ts +19 -0
- package/dist/types/src/components/stories/MicrophoneTranscription.stories.d.ts.map +1 -0
- package/dist/types/src/components/stories/TranscriptionStory.d.ts +11 -0
- package/dist/types/src/components/stories/TranscriptionStory.d.ts.map +1 -0
- package/dist/types/src/components/stories/useIsSpeaking.d.ts +3 -0
- package/dist/types/src/components/stories/useIsSpeaking.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +1 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useAudioFile.d.ts +1 -1
- package/dist/types/src/hooks/useAudioFile.d.ts.map +1 -1
- package/dist/types/src/hooks/useAudioTrack.d.ts +1 -1
- package/dist/types/src/hooks/useAudioTrack.d.ts.map +1 -1
- package/dist/types/src/hooks/useQueueModelAdapter.d.ts +7 -0
- package/dist/types/src/hooks/useQueueModelAdapter.d.ts.map +1 -0
- package/dist/types/src/hooks/useTranscriber.d.ts +1 -1
- package/dist/types/src/hooks/useTranscriber.d.ts.map +1 -1
- package/dist/types/src/hooks/useVoiceInput.d.ts.map +1 -1
- package/dist/types/src/model/index.d.ts +2 -0
- package/dist/types/src/model/index.d.ts.map +1 -0
- package/dist/types/src/model/model.d.ts +68 -0
- package/dist/types/src/model/model.d.ts.map +1 -0
- package/dist/types/src/model/model.test.d.ts +2 -0
- package/dist/types/src/model/model.test.d.ts.map +1 -0
- package/dist/types/src/segments-normalization/index.d.ts +4 -0
- package/dist/types/src/segments-normalization/index.d.ts.map +1 -0
- package/dist/types/src/segments-normalization/message-normalizer.d.ts +26 -0
- package/dist/types/src/segments-normalization/message-normalizer.d.ts.map +1 -0
- package/dist/types/src/segments-normalization/normalization.d.ts +520 -0
- package/dist/types/src/segments-normalization/normalization.d.ts.map +1 -0
- package/dist/types/src/segments-normalization/normalization.test.d.ts +2 -0
- package/dist/types/src/segments-normalization/normalization.test.d.ts.map +1 -0
- package/dist/types/src/segments-normalization/utils.d.ts +3 -0
- package/dist/types/src/segments-normalization/utils.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +2 -0
- package/dist/types/src/testing/index.d.ts.map +1 -0
- package/dist/types/src/testing/testing.d.ts +40 -0
- package/dist/types/src/testing/testing.d.ts.map +1 -0
- package/dist/types/src/transcriber/media-stream-recorder.d.ts +8 -5
- package/dist/types/src/transcriber/media-stream-recorder.d.ts.map +1 -1
- package/dist/types/src/transcriber/transcriber.browser.test.d.ts +2 -0
- package/dist/types/src/transcriber/transcriber.browser.test.d.ts.map +1 -0
- package/dist/types/src/transcriber/transcriber.d.ts +6 -2
- package/dist/types/src/transcriber/transcriber.d.ts.map +1 -1
- package/dist/types/src/transcriber/transcription-manager.d.ts +19 -15
- package/dist/types/src/transcriber/transcription-manager.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +3 -20
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +23 -40
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +15 -8
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util/array.d.ts.map +1 -1
- package/dist/types/src/util/get-time-str.d.ts.map +1 -1
- package/dist/types/src/util/index.d.ts +0 -1
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/src/util/monitor-audio-level.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +62 -41
- package/src/TranscriptionPlugin.tsx +13 -18
- package/src/capabilities/capabilities.ts +15 -8
- package/src/capabilities/index.ts +0 -2
- package/src/capabilities/intent-resolver.ts +7 -8
- package/src/capabilities/react-surface.tsx +5 -4
- package/src/capabilities/transcriber.ts +34 -6
- package/src/components/Transcript/Transcript.stories.tsx +201 -43
- package/src/components/Transcript/Transcript.tsx +83 -208
- package/src/components/Transcript/deprecated/OldTranscript.tsx +260 -0
- package/src/components/Transcript/transcript-extension.ts +236 -0
- package/src/components/TranscriptContainer.tsx +11 -6
- package/src/components/stories/FileTranscription.stories.tsx +240 -0
- package/src/components/stories/KeyWordRecognition.stories.tsx +128 -0
- package/src/components/stories/MicrophoneTranscription.stories.tsx +274 -0
- package/src/components/stories/TranscriptionStory.tsx +41 -0
- package/src/components/stories/useIsSpeaking.tsx +40 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useAudioFile.ts +39 -9
- package/src/hooks/useAudioTrack.ts +2 -2
- package/src/hooks/useQueueModelAdapter.ts +65 -0
- package/src/hooks/useTranscriber.ts +4 -2
- package/src/meta.ts +2 -2
- package/src/model/index.ts +5 -0
- package/src/model/model.test.ts +169 -0
- package/src/model/model.ts +229 -0
- package/src/segments-normalization/index.ts +7 -0
- package/src/segments-normalization/message-normalizer.ts +108 -0
- package/src/segments-normalization/normalization.test.ts +142 -0
- package/src/segments-normalization/normalization.ts +103 -0
- package/src/segments-normalization/utils.ts +9 -0
- package/src/testing/index.ts +5 -0
- package/src/testing/testing.ts +216 -0
- package/src/transcriber/media-stream-recorder.ts +14 -7
- package/src/transcriber/{transcriber.test.ts → transcriber.browser.test.ts} +7 -7
- package/src/transcriber/transcriber.ts +33 -20
- package/src/transcriber/transcription-manager.ts +87 -71
- package/src/translations.ts +2 -3
- package/src/types/schema.ts +11 -33
- package/src/types/types.ts +8 -12
- package/src/util/index.ts +0 -1
- package/dist/lib/browser/TranscriptContainer-JQ3HFHLQ.mjs +0 -10
- package/dist/lib/browser/app-graph-builder-VDQOVX7P.mjs +0 -191
- package/dist/lib/browser/app-graph-builder-VDQOVX7P.mjs.map +0 -7
- package/dist/lib/browser/chunk-G4B6CPC2.mjs +0 -253
- package/dist/lib/browser/chunk-G4B6CPC2.mjs.map +0 -7
- package/dist/lib/browser/chunk-GU2BNYKZ.mjs +0 -35
- package/dist/lib/browser/chunk-GU2BNYKZ.mjs.map +0 -7
- package/dist/lib/browser/chunk-OGNXNGJB.mjs +0 -73
- package/dist/lib/browser/chunk-OGNXNGJB.mjs.map +0 -7
- package/dist/lib/browser/chunk-YCZISX63.mjs.map +0 -7
- package/dist/lib/browser/chunk-YEPT334A.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-4R66ZCKT.mjs.map +0 -7
- package/dist/lib/browser/meeting-transcription-state-DLFHQK72.mjs +0 -18
- package/dist/lib/browser/meeting-transcription-state-DLFHQK72.mjs.map +0 -7
- package/dist/lib/browser/react-surface-FQUHU5G7.mjs.map +0 -7
- package/dist/lib/browser/transcriber-LGMIWDYI.mjs +0 -36
- package/dist/lib/browser/transcriber-LGMIWDYI.mjs.map +0 -7
- package/dist/lib/node/TranscriptContainer-QEYTTT2V.cjs.map +0 -7
- package/dist/lib/node/app-graph-builder-IFSIVNUR.cjs +0 -200
- package/dist/lib/node/app-graph-builder-IFSIVNUR.cjs.map +0 -7
- package/dist/lib/node/chunk-3KHUSQNW.cjs +0 -55
- package/dist/lib/node/chunk-3KHUSQNW.cjs.map +0 -7
- package/dist/lib/node/chunk-CZMLKKWT.cjs.map +0 -7
- package/dist/lib/node/chunk-FCCJALOT.cjs.map +0 -7
- package/dist/lib/node/chunk-P4VVD6ZO.cjs +0 -95
- package/dist/lib/node/chunk-P4VVD6ZO.cjs.map +0 -7
- package/dist/lib/node/chunk-UOFHT4GZ.cjs +0 -280
- package/dist/lib/node/chunk-UOFHT4GZ.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-WMMCOUEH.cjs.map +0 -7
- package/dist/lib/node/meeting-transcription-state-URIYILEQ.cjs +0 -34
- package/dist/lib/node/meeting-transcription-state-URIYILEQ.cjs.map +0 -7
- package/dist/lib/node/react-surface-WI2MGWCC.cjs.map +0 -7
- package/dist/lib/node/transcriber-QG5WPKX4.cjs +0 -49
- package/dist/lib/node/transcriber-QG5WPKX4.cjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-UL6XLIZY.mjs +0 -192
- package/dist/lib/node-esm/app-graph-builder-UL6XLIZY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-6X7X2UZF.mjs +0 -254
- package/dist/lib/node-esm/chunk-6X7X2UZF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-GIO6J6FE.mjs +0 -74
- package/dist/lib/node-esm/chunk-GIO6J6FE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HKATMD34.mjs +0 -37
- package/dist/lib/node-esm/chunk-HKATMD34.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-PTZHDZ36.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YQYBLFNI.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-QN2LO5TX.mjs.map +0 -7
- package/dist/lib/node-esm/meeting-transcription-state-ZYVRAW6Y.mjs +0 -19
- package/dist/lib/node-esm/meeting-transcription-state-ZYVRAW6Y.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-PCH6NTVB.mjs.map +0 -7
- package/dist/lib/node-esm/transcriber-TMPYZ5L4.mjs +0 -37
- package/dist/lib/node-esm/transcriber-TMPYZ5L4.mjs.map +0 -7
- package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -181
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/meeting-transcription-state.d.ts +0 -6
- package/dist/types/src/capabilities/meeting-transcription-state.d.ts.map +0 -1
- package/dist/types/src/components/transcription.stories.d.ts +0 -15
- package/dist/types/src/components/transcription.stories.d.ts.map +0 -1
- package/dist/types/src/transcriber/transcriber.test.d.ts +0 -2
- package/dist/types/src/transcriber/transcriber.test.d.ts.map +0 -1
- package/dist/types/src/util/random-queue-dxn.d.ts +0 -3
- package/dist/types/src/util/random-queue-dxn.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder.ts +0 -152
- package/src/capabilities/meeting-transcription-state.ts +0 -16
- package/src/components/transcription.stories.tsx +0 -196
- package/src/util/random-queue-dxn.ts +0 -9
- /package/dist/lib/browser/{TranscriptContainer-JQ3HFHLQ.mjs.map → TranscriptContainer-PFKLKRPQ.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-K7FOYAXO.mjs.map → chunk-IGEKO7ZU.mjs.map} +0 -0
- /package/dist/lib/node/{chunk-LP4FG423.cjs.map → chunk-5J3FBCON.cjs.map} +0 -0
- /package/dist/lib/node-esm/{TranscriptContainer-ZXUCOWGY.mjs.map → TranscriptContainer-DLNRFVTA.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-J4D2RBBH.mjs.map → chunk-KUWWHMOA.mjs.map} +0 -0
|
@@ -1,37 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
MediaStreamRecorder,
|
|
4
|
-
Transcriber
|
|
5
|
-
} from "./chunk-YQYBLFNI.mjs";
|
|
6
|
-
import "./chunk-HKATMD34.mjs";
|
|
7
|
-
import {
|
|
8
|
-
TranscriptionCapabilities
|
|
9
|
-
} from "./chunk-PTZHDZ36.mjs";
|
|
10
|
-
import "./chunk-GIO6J6FE.mjs";
|
|
11
|
-
import "./chunk-X4DDJIVL.mjs";
|
|
12
|
-
|
|
13
|
-
// packages/plugins/plugin-transcription/src/capabilities/transcriber.ts
|
|
14
|
-
import { contributes } from "@dxos/app-framework";
|
|
15
|
-
var RECORD_INTERVAL = 200;
|
|
16
|
-
var PREFIXED_CHUNKS_AMOUNT = 10;
|
|
17
|
-
var TRANSCRIBE_AFTER_CHUNKS_AMOUNT = 50;
|
|
18
|
-
var transcriber_default = () => {
|
|
19
|
-
const getTranscriber = ({ audioStreamTrack, onSegments }) => {
|
|
20
|
-
return new Transcriber({
|
|
21
|
-
config: {
|
|
22
|
-
transcribeAfterChunksAmount: TRANSCRIBE_AFTER_CHUNKS_AMOUNT,
|
|
23
|
-
prefixBufferChunksAmount: PREFIXED_CHUNKS_AMOUNT
|
|
24
|
-
},
|
|
25
|
-
recorder: new MediaStreamRecorder({
|
|
26
|
-
mediaStreamTrack: audioStreamTrack,
|
|
27
|
-
interval: RECORD_INTERVAL
|
|
28
|
-
}),
|
|
29
|
-
onSegments
|
|
30
|
-
});
|
|
31
|
-
};
|
|
32
|
-
return contributes(TranscriptionCapabilities.Transcriber, getTranscriber);
|
|
33
|
-
};
|
|
34
|
-
export {
|
|
35
|
-
transcriber_default as default
|
|
36
|
-
};
|
|
37
|
-
//# sourceMappingURL=transcriber-TMPYZ5L4.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/transcriber.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { contributes } from '@dxos/app-framework';\n\nimport { TranscriptionCapabilities } from './capabilities';\nimport { MediaStreamRecorder, Transcriber } from '../transcriber';\n\n// TODO(burdon): Move to config?\n\n/**\n * Length of the chunk in ms.\n */\nconst RECORD_INTERVAL = 200;\n\n/**\n * Number of chunks to save before the user starts speaking.\n */\nconst PREFIXED_CHUNKS_AMOUNT = 10;\n\n/**\n * Number of chunks to transcribe automatically after.\n * Combined should be mess than 25MB or whisper would fail.\n */\nconst TRANSCRIBE_AFTER_CHUNKS_AMOUNT = 50;\n\n/**\n * Records audio while user is speaking and transcribes it after user is done speaking.\n */\nexport default () => {\n const getTranscriber: TranscriptionCapabilities.GetTranscriber = ({ audioStreamTrack, onSegments }) => {\n // Initialize audio transcription.\n return new Transcriber({\n config: {\n transcribeAfterChunksAmount: TRANSCRIBE_AFTER_CHUNKS_AMOUNT,\n prefixBufferChunksAmount: PREFIXED_CHUNKS_AMOUNT,\n },\n recorder: new MediaStreamRecorder({\n mediaStreamTrack: audioStreamTrack,\n interval: RECORD_INTERVAL,\n }),\n onSegments,\n });\n };\n\n return contributes(TranscriptionCapabilities.Transcriber, getTranscriber);\n};\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;;;;AAIA,SAASA,mBAAmB;AAU5B,IAAMC,kBAAkB;AAKxB,IAAMC,yBAAyB;AAM/B,IAAMC,iCAAiC;AAKvC,IAAA,sBAAe,MAAA;AACb,QAAMC,iBAA2D,CAAC,EAAEC,kBAAkBC,WAAU,MAAE;AAEhG,WAAO,IAAIC,YAAY;MACrBC,QAAQ;QACNC,6BAA6BN;QAC7BO,0BAA0BR;MAC5B;MACAS,UAAU,IAAIC,oBAAoB;QAChCC,kBAAkBR;QAClBS,UAAUb;MACZ,CAAA;MACAK;IACF,CAAA;EACF;AAEA,SAAOS,YAAYC,0BAA0BT,aAAaH,cAAAA;AAC5D;",
|
|
6
|
-
"names": ["contributes", "RECORD_INTERVAL", "PREFIXED_CHUNKS_AMOUNT", "TRANSCRIBE_AFTER_CHUNKS_AMOUNT", "getTranscriber", "audioStreamTrack", "onSegments", "Transcriber", "config", "transcribeAfterChunksAmount", "prefixBufferChunksAmount", "recorder", "MediaStreamRecorder", "mediaStreamTrack", "interval", "contributes", "TranscriptionCapabilities"]
|
|
7
|
-
}
|
|
@@ -1,181 +0,0 @@
|
|
|
1
|
-
import { type PluginsContext } from '@dxos/app-framework';
|
|
2
|
-
import { type Node } from '@dxos/plugin-graph';
|
|
3
|
-
declare const _default: (context: PluginsContext) => import("@dxos/app-framework").Capability<Readonly<{
|
|
4
|
-
id: string;
|
|
5
|
-
position: import("@dxos/util").Position;
|
|
6
|
-
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
7
|
-
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
8
|
-
relation?: import("@dxos/app-graph").Relation;
|
|
9
|
-
type?: string;
|
|
10
|
-
filter?: (node: import("@dxos/app-graph").Node) => boolean;
|
|
11
|
-
}> | Readonly<{
|
|
12
|
-
id: string;
|
|
13
|
-
position: import("@dxos/util").Position;
|
|
14
|
-
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
15
|
-
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
16
|
-
relation?: import("@dxos/app-graph").Relation;
|
|
17
|
-
type?: string;
|
|
18
|
-
filter?: (node: import("@dxos/app-graph").Node) => boolean;
|
|
19
|
-
}>[] | (Readonly<{
|
|
20
|
-
id: string;
|
|
21
|
-
position: import("@dxos/util").Position;
|
|
22
|
-
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
23
|
-
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
24
|
-
relation?: import("@dxos/app-graph").Relation;
|
|
25
|
-
type?: string;
|
|
26
|
-
filter?: (node: import("@dxos/app-graph").Node) => boolean;
|
|
27
|
-
}> | Readonly<{
|
|
28
|
-
id: string;
|
|
29
|
-
position: import("@dxos/util").Position;
|
|
30
|
-
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
31
|
-
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
32
|
-
relation?: import("@dxos/app-graph").Relation;
|
|
33
|
-
type?: string;
|
|
34
|
-
filter?: (node: import("@dxos/app-graph").Node) => boolean;
|
|
35
|
-
}>[] | (Readonly<{
|
|
36
|
-
id: string;
|
|
37
|
-
position: import("@dxos/util").Position;
|
|
38
|
-
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
39
|
-
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
40
|
-
relation?: import("@dxos/app-graph").Relation;
|
|
41
|
-
type?: string;
|
|
42
|
-
filter?: (node: import("@dxos/app-graph").Node) => boolean;
|
|
43
|
-
}> | Readonly<{
|
|
44
|
-
id: string;
|
|
45
|
-
position: import("@dxos/util").Position;
|
|
46
|
-
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
47
|
-
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
48
|
-
relation?: import("@dxos/app-graph").Relation;
|
|
49
|
-
type?: string;
|
|
50
|
-
filter?: (node: import("@dxos/app-graph").Node) => boolean;
|
|
51
|
-
}>[] | (Readonly<{
|
|
52
|
-
id: string;
|
|
53
|
-
position: import("@dxos/util").Position;
|
|
54
|
-
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
55
|
-
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
56
|
-
relation?: import("@dxos/app-graph").Relation;
|
|
57
|
-
type?: string;
|
|
58
|
-
filter?: (node: import("@dxos/app-graph").Node) => boolean;
|
|
59
|
-
}> | Readonly<{
|
|
60
|
-
id: string;
|
|
61
|
-
position: import("@dxos/util").Position;
|
|
62
|
-
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
63
|
-
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
64
|
-
relation?: import("@dxos/app-graph").Relation;
|
|
65
|
-
type?: string;
|
|
66
|
-
filter?: (node: import("@dxos/app-graph").Node) => boolean;
|
|
67
|
-
}>[] | (Readonly<{
|
|
68
|
-
id: string;
|
|
69
|
-
position: import("@dxos/util").Position;
|
|
70
|
-
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
71
|
-
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
72
|
-
relation?: import("@dxos/app-graph").Relation;
|
|
73
|
-
type?: string;
|
|
74
|
-
filter?: (node: import("@dxos/app-graph").Node) => boolean;
|
|
75
|
-
}> | Readonly<{
|
|
76
|
-
id: string;
|
|
77
|
-
position: import("@dxos/util").Position;
|
|
78
|
-
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
79
|
-
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
80
|
-
relation?: import("@dxos/app-graph").Relation;
|
|
81
|
-
type?: string;
|
|
82
|
-
filter?: (node: import("@dxos/app-graph").Node) => boolean;
|
|
83
|
-
}>[] | (Readonly<{
|
|
84
|
-
id: string;
|
|
85
|
-
position: import("@dxos/util").Position;
|
|
86
|
-
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
87
|
-
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
88
|
-
relation?: import("@dxos/app-graph").Relation;
|
|
89
|
-
type?: string;
|
|
90
|
-
filter?: (node: import("@dxos/app-graph").Node) => boolean;
|
|
91
|
-
}> | Readonly<{
|
|
92
|
-
id: string;
|
|
93
|
-
position: import("@dxos/util").Position;
|
|
94
|
-
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
95
|
-
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
96
|
-
relation?: import("@dxos/app-graph").Relation;
|
|
97
|
-
type?: string;
|
|
98
|
-
filter?: (node: import("@dxos/app-graph").Node) => boolean;
|
|
99
|
-
}>[] | (Readonly<{
|
|
100
|
-
id: string;
|
|
101
|
-
position: import("@dxos/util").Position;
|
|
102
|
-
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
103
|
-
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
104
|
-
relation?: import("@dxos/app-graph").Relation;
|
|
105
|
-
type?: string;
|
|
106
|
-
filter?: (node: import("@dxos/app-graph").Node) => boolean;
|
|
107
|
-
}> | Readonly<{
|
|
108
|
-
id: string;
|
|
109
|
-
position: import("@dxos/util").Position;
|
|
110
|
-
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
111
|
-
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
112
|
-
relation?: import("@dxos/app-graph").Relation;
|
|
113
|
-
type?: string;
|
|
114
|
-
filter?: (node: import("@dxos/app-graph").Node) => boolean;
|
|
115
|
-
}>[] | (Readonly<{
|
|
116
|
-
id: string;
|
|
117
|
-
position: import("@dxos/util").Position;
|
|
118
|
-
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
119
|
-
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
120
|
-
relation?: import("@dxos/app-graph").Relation;
|
|
121
|
-
type?: string;
|
|
122
|
-
filter?: (node: import("@dxos/app-graph").Node) => boolean;
|
|
123
|
-
}> | Readonly<{
|
|
124
|
-
id: string;
|
|
125
|
-
position: import("@dxos/util").Position;
|
|
126
|
-
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
127
|
-
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
128
|
-
relation?: import("@dxos/app-graph").Relation;
|
|
129
|
-
type?: string;
|
|
130
|
-
filter?: (node: import("@dxos/app-graph").Node) => boolean;
|
|
131
|
-
}>[] | (Readonly<{
|
|
132
|
-
id: string;
|
|
133
|
-
position: import("@dxos/util").Position;
|
|
134
|
-
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
135
|
-
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
136
|
-
relation?: import("@dxos/app-graph").Relation;
|
|
137
|
-
type?: string;
|
|
138
|
-
filter?: (node: import("@dxos/app-graph").Node) => boolean;
|
|
139
|
-
}> | Readonly<{
|
|
140
|
-
id: string;
|
|
141
|
-
position: import("@dxos/util").Position;
|
|
142
|
-
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
143
|
-
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
144
|
-
relation?: import("@dxos/app-graph").Relation;
|
|
145
|
-
type?: string;
|
|
146
|
-
filter?: (node: import("@dxos/app-graph").Node) => boolean;
|
|
147
|
-
}>[] | (Readonly<{
|
|
148
|
-
id: string;
|
|
149
|
-
position: import("@dxos/util").Position;
|
|
150
|
-
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
151
|
-
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
152
|
-
relation?: import("@dxos/app-graph").Relation;
|
|
153
|
-
type?: string;
|
|
154
|
-
filter?: (node: import("@dxos/app-graph").Node) => boolean;
|
|
155
|
-
}> | Readonly<{
|
|
156
|
-
id: string;
|
|
157
|
-
position: import("@dxos/util").Position;
|
|
158
|
-
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
159
|
-
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
160
|
-
relation?: import("@dxos/app-graph").Relation;
|
|
161
|
-
type?: string;
|
|
162
|
-
filter?: (node: import("@dxos/app-graph").Node) => boolean;
|
|
163
|
-
}>[] | (any[] | Readonly<{
|
|
164
|
-
id: string;
|
|
165
|
-
position: import("@dxos/util").Position;
|
|
166
|
-
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
167
|
-
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
168
|
-
relation?: import("@dxos/app-graph").Relation;
|
|
169
|
-
type?: string;
|
|
170
|
-
filter?: (node: import("@dxos/app-graph").Node) => boolean;
|
|
171
|
-
}> | Readonly<{
|
|
172
|
-
id: string;
|
|
173
|
-
position: import("@dxos/util").Position;
|
|
174
|
-
resolver?: import("@dxos/app-graph").ResolverExtension;
|
|
175
|
-
connector?: import("@dxos/app-graph").ConnectorExtension;
|
|
176
|
-
relation?: import("@dxos/app-graph").Relation;
|
|
177
|
-
type?: string;
|
|
178
|
-
filter?: (node: import("@dxos/app-graph").Node) => boolean;
|
|
179
|
-
}>[])[])[])[])[])[])[])[])[])[])[]>;
|
|
180
|
-
export default _default;
|
|
181
|
-
//# sourceMappingURL=app-graph-builder.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"app-graph-builder.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/app-graph-builder.ts"],"names":[],"mappings":"AAIA,OAAO,EAA2C,KAAK,cAAc,EAAE,MAAM,qBAAqB,CAAC;AAOnG,OAAO,EAAmB,KAAK,IAAI,EAAE,MAAM,oBAAoB,CAAC;kCA+CvC,cAAc;;qBAmBzB,YAAH;sBAAsC,iBAAiB;uBAEhD,iBAAM;sBACM,iBAAiB;;2BAInC,iBAAI;;;qBAEwB,YAAY;sBACpC,iBAAc;uBAChB,iBAAE;sBACK,iBACrB;;2BAAkE,iBAElE;;;qBAIsB,YAAY;sBACG,iBAAiB;uBAC7B,iBAAiB;sBAAgD,iBAEtF;;2BAEqC,iBAAiB;;;qBAC3B,YAC5B;sBAAsC,iBAAiB;uBAE5C,iBAAE;sBAAgD,iBAAiB;;2BAE/D,iBAAiB;;;qBAEa,YAC9C;sBAAsC,iBAAiB;uBAChC,iBACd;sBAAgD,iBAAiB;;2BAClB,iBAC5C;;;qBAEI,YAAU;sBAAsC,iBAAiB;uBAElE,iBAAiB;sBAClB,iBAAO;;2BACP,iBAAO;;;qBAEP,YAAG;sBAAsC,iBAClD;uBAES,iBAAQ;sBACR,iBAAe;;2BAEjB,iBACZ;;;qBACuB,YAAY;sBACrB,iBAAQ;uBAAgD,iBAAiB;sBAC/C,iBACrC;;2BAGqB,iBAAiB;;;qBAE3B,YAAG;sBAAsC,iBAAiB;uBAC9B,iBAAiB;sBAE9C,iBAAiB;;2BAChB,iBAAS;;;qBACF,YAAY;sBAAsC,iBAC1D;uBAIR,iBAGN;sBAAgD,iBAAiB;;2BAAkE,iBAAiB;;;qBAAwF,YAAY;sBAAsC,iBAAiB;uBAAgD,iBAAiB;sBAAgD,iBAAiB;;2BAAkE,iBAAiB;;;qBAAqF,YAAY;sBAAsC,iBAAiB;uBAAgD,iBAAiB;sBAAgD,iBAAiB;;2BAAkE,iBAAiB;;;qBAAwF,YAAY;sBAAsC,iBAAiB;uBAAgD,iBAAiB;sBAAgD,iBAAiB;;2BAAkE,iBAAiB;;;qBAAqF,YAAY;sBAAsC,iBAAiB;uBAAgD,iBAAiB;sBAAgD,iBAAiB;;2BAAkE,iBAAiB;;;qBAAwF,YAAY;sBAAsC,iBAAiB;uBAAgD,iBAAiB;sBAAgD,iBAAiB;;2BAAkE,iBAAiB;;;qBAAqF,YAAY;sBAAsC,iBAAiB;uBAAgD,iBAAiB;sBAAgD,iBAAiB;;2BAAkE,iBAAiB;;;qBAAwF,YAAY;sBAAsC,iBAAiB;uBAAgD,iBAAiB;sBAAgD,iBAAiB;;2BAAkE,iBAAiB;;;qBAAqF,YAAY;sBAAsC,iBAAiB;uBAAgD,iBAAiB;sBAAgD,iBAAiB;;2BAAkE,iBAAiB;;;qBAAwF,YAAY;sBAAsC,iBAAiB;uBAAgD,iBAAiB;sBAAgD,iBAAiB;;2BAAkE,iBAAiB;;;qBAAqF,YAAY;sBAAsC,iBAAiB;uBAAgD,iBAAiB;sBAAgD,iBAAiB;;2BAAkE,iBAAiB;;;qBAAwF,YAAY;sBAAsC,iBAAiB;uBAAgD,iBAAiB;sBAAgD,iBAAiB;;2BAAkE,iBAAiB;;;qBAAqF,YAAY;sBAAsC,iBAAiB;uBAAgD,iBAAiB;sBAAgD,iBAAiB;;2BAAkE,iBAAiB;;AA9Fn8I,wBA6FK"}
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
declare const _default: () => import("@dxos/app-framework").Capability<import("@dxos/live-object").ReactiveObject<import("@dxos/live-object").ReactiveObject<{
|
|
2
|
-
enabled: boolean;
|
|
3
|
-
transcriptionManager?: import("..").TranscriptionManager;
|
|
4
|
-
}>>>;
|
|
5
|
-
export default _default;
|
|
6
|
-
//# sourceMappingURL=meeting-transcription-state.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"meeting-transcription-state.d.ts","sourceRoot":"","sources":["../../../../src/capabilities/meeting-transcription-state.ts"],"names":[],"mappings":";;;;AASA,wBAME"}
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import '@dxos-theme';
|
|
2
|
-
import { type Meta, type StoryObj } from '@storybook/react';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { type DXN } from '@dxos/keys';
|
|
5
|
-
declare const AudioFile: ({ queueDxn, audioUrl }: {
|
|
6
|
-
queueDxn: DXN;
|
|
7
|
-
audioUrl: string;
|
|
8
|
-
transcriptUrl: string;
|
|
9
|
-
}) => React.JSX.Element;
|
|
10
|
-
declare const meta: Meta<typeof AudioFile>;
|
|
11
|
-
export default meta;
|
|
12
|
-
type Story = StoryObj<typeof AudioFile>;
|
|
13
|
-
export declare const Default: Story;
|
|
14
|
-
export declare const File: Story;
|
|
15
|
-
//# sourceMappingURL=transcription.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transcription.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/transcription.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,KASN,MAAM,OAAO,CAAC;AAGf,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,YAAY,CAAC;AA2EtC,QAAA,MAAM,SAAS,2BAA4B;IAAE,QAAQ,EAAE,GAAG,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,sBA4DpG,CAAC;AAEF,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,SAAS,CAqBhC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,SAAS,CAAC,CAAC;AAExC,eAAO,MAAM,OAAO,EAAE,KAErB,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,KAQlB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transcriber.test.d.ts","sourceRoot":"","sources":["../../../../src/transcriber/transcriber.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"random-queue-dxn.d.ts","sourceRoot":"","sources":["../../../../src/util/random-queue-dxn.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,GAAG,EAAqB,OAAO,EAAE,MAAM,YAAY,CAAC;AAE7D,eAAO,MAAM,cAAc,aAAc,OAAO,QACmD,CAAC"}
|
|
@@ -1,152 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Capabilities, contributes, createIntent, type PluginsContext } from '@dxos/app-framework';
|
|
6
|
-
import { fullyQualifiedId, getSpace, makeRef, type Space } from '@dxos/client/echo';
|
|
7
|
-
import { generateName } from '@dxos/display-name';
|
|
8
|
-
import { getSchemaTypename, isInstanceOf } from '@dxos/echo-schema';
|
|
9
|
-
import { invariant } from '@dxos/invariant';
|
|
10
|
-
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
11
|
-
import { PLANK_COMPANION_TYPE, ATTENDABLE_PATH_SEPARATOR } from '@dxos/plugin-deck/types';
|
|
12
|
-
import { createExtension, type Node } from '@dxos/plugin-graph';
|
|
13
|
-
import { MeetingCapabilities, type CallState, type MediaState } from '@dxos/plugin-meeting';
|
|
14
|
-
import { MeetingType } from '@dxos/plugin-meeting/types';
|
|
15
|
-
import { buf } from '@dxos/protocols/buf';
|
|
16
|
-
import {
|
|
17
|
-
TranscriptionPayloadSchema,
|
|
18
|
-
type TranscriptionPayload as TranscriptionPayloadProto,
|
|
19
|
-
} from '@dxos/protocols/buf/dxos/edge/calls_pb';
|
|
20
|
-
import { keyToFallback } from '@dxos/util';
|
|
21
|
-
|
|
22
|
-
import { TranscriptionCapabilities } from './capabilities';
|
|
23
|
-
import { TRANSCRIPTION_PLUGIN } from '../meta';
|
|
24
|
-
import { TranscriptionManager } from '../transcriber';
|
|
25
|
-
import { TranscriptionAction, TranscriptType } from '../types';
|
|
26
|
-
|
|
27
|
-
// TODO(wittjosiah): Factor out.
|
|
28
|
-
// TODO(wittjosiah): Can we stop using protobuf for this?
|
|
29
|
-
type TranscriptionPayload = buf.MessageInitShape<typeof TranscriptionPayloadSchema>;
|
|
30
|
-
const codec = {
|
|
31
|
-
encode: (message: TranscriptionPayload): Uint8Array => {
|
|
32
|
-
return buf.toBinary(TranscriptionPayloadSchema, buf.create(TranscriptionPayloadSchema, message));
|
|
33
|
-
},
|
|
34
|
-
decode: (message: Uint8Array): TranscriptionPayloadProto => {
|
|
35
|
-
return buf.fromBinary(TranscriptionPayloadSchema, message);
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
const getMeetingTranscript = async (
|
|
40
|
-
context: PluginsContext,
|
|
41
|
-
meeting: MeetingType,
|
|
42
|
-
): Promise<TranscriptType | undefined> => {
|
|
43
|
-
const { dispatchPromise: dispatch } = context.requestCapability(Capabilities.IntentDispatcher);
|
|
44
|
-
|
|
45
|
-
const typename = getSchemaTypename(TranscriptType)!;
|
|
46
|
-
const existing = await meeting.artifacts[typename]?.load();
|
|
47
|
-
if (existing instanceof TranscriptType) {
|
|
48
|
-
return existing;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
const space = getSpace(meeting);
|
|
52
|
-
invariant(space);
|
|
53
|
-
const { data } = await dispatch(createIntent(TranscriptionAction.Create, { spaceId: space.id }));
|
|
54
|
-
meeting.artifacts[typename] = makeRef(data!.object);
|
|
55
|
-
return data?.object;
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
// TODO(wittjosiah): Introduce a sound that plays when transcription is activated/deactivated.
|
|
59
|
-
export default (context: PluginsContext) =>
|
|
60
|
-
contributes(Capabilities.AppGraphBuilder, [
|
|
61
|
-
createExtension({
|
|
62
|
-
id: `${TRANSCRIPTION_PLUGIN}/meeting-transcript`,
|
|
63
|
-
filter: (node): node is Node<MeetingType> =>
|
|
64
|
-
isInstanceOf(MeetingType, node.data) && node.type !== PLANK_COMPANION_TYPE,
|
|
65
|
-
actions: ({ node }) => {
|
|
66
|
-
const meeting = node.data;
|
|
67
|
-
const state = context.requestCapability(TranscriptionCapabilities.MeetingTranscriptionState);
|
|
68
|
-
return [
|
|
69
|
-
{
|
|
70
|
-
id: `${fullyQualifiedId(meeting)}/action/start-stop-transcription`,
|
|
71
|
-
data: async () => {
|
|
72
|
-
const call = context.requestCapability(MeetingCapabilities.CallManager);
|
|
73
|
-
invariant(state.transcriptionManager);
|
|
74
|
-
state.enabled = !state.enabled;
|
|
75
|
-
void state.transcriptionManager.setEnabled(state.enabled);
|
|
76
|
-
const transcript = await getMeetingTranscript(context, meeting);
|
|
77
|
-
invariant(transcript, 'Failed to create transcript');
|
|
78
|
-
call.setActivity(getSchemaTypename(TranscriptType)!, {
|
|
79
|
-
value: codec.encode({
|
|
80
|
-
enabled: state.enabled,
|
|
81
|
-
queueDxn: transcript.queue.dxn.toString(),
|
|
82
|
-
}),
|
|
83
|
-
});
|
|
84
|
-
},
|
|
85
|
-
properties: {
|
|
86
|
-
label: state.enabled
|
|
87
|
-
? ['stop transcription label', { ns: TRANSCRIPTION_PLUGIN }]
|
|
88
|
-
: ['start transcription label', { ns: TRANSCRIPTION_PLUGIN }],
|
|
89
|
-
icon: 'ph--record--regular',
|
|
90
|
-
disposition: 'toolbar',
|
|
91
|
-
classNames: state.enabled ? 'text-activeInCall' : '',
|
|
92
|
-
},
|
|
93
|
-
},
|
|
94
|
-
];
|
|
95
|
-
},
|
|
96
|
-
connector: ({ node }) => {
|
|
97
|
-
const meeting = node.data;
|
|
98
|
-
const client = context.requestCapability(ClientCapabilities.Client);
|
|
99
|
-
const state = context.requestCapability(TranscriptionCapabilities.MeetingTranscriptionState);
|
|
100
|
-
|
|
101
|
-
return [
|
|
102
|
-
{
|
|
103
|
-
id: `${fullyQualifiedId(meeting)}${ATTENDABLE_PATH_SEPARATOR}${getSchemaTypename(TranscriptType)}`,
|
|
104
|
-
type: PLANK_COMPANION_TYPE,
|
|
105
|
-
data: meeting.artifacts[getSchemaTypename(TranscriptType)!]?.target,
|
|
106
|
-
properties: {
|
|
107
|
-
label: ['transcript companion label', { ns: TRANSCRIPTION_PLUGIN }],
|
|
108
|
-
icon: 'ph--subtitles--regular',
|
|
109
|
-
disposition: 'hidden',
|
|
110
|
-
schema: TranscriptType,
|
|
111
|
-
getIntent: ({ space }: { space: Space }) =>
|
|
112
|
-
createIntent(TranscriptionAction.Create, { spaceId: space.id }),
|
|
113
|
-
onJoin: () => {
|
|
114
|
-
const transcriptionManager = new TranscriptionManager(client.edge);
|
|
115
|
-
const identity = client.halo.identity.get();
|
|
116
|
-
invariant(identity);
|
|
117
|
-
transcriptionManager.setName(
|
|
118
|
-
identity.profile?.displayName ?? generateName(identity.identityKey.toHex()),
|
|
119
|
-
);
|
|
120
|
-
const fallbackValue = keyToFallback(identity!.identityKey);
|
|
121
|
-
const userHue = identity!.profile?.data?.hue || fallbackValue.hue;
|
|
122
|
-
transcriptionManager.setHue(userHue);
|
|
123
|
-
void transcriptionManager.open();
|
|
124
|
-
state.transcriptionManager = transcriptionManager;
|
|
125
|
-
},
|
|
126
|
-
onLeave: () => {
|
|
127
|
-
void state.transcriptionManager?.close();
|
|
128
|
-
state.transcriptionManager = undefined;
|
|
129
|
-
state.enabled = false;
|
|
130
|
-
},
|
|
131
|
-
onCallStateUpdated: (callState: CallState) => {
|
|
132
|
-
const typename = getSchemaTypename(TranscriptType);
|
|
133
|
-
const transcription = typename ? callState.activities?.[typename] : undefined;
|
|
134
|
-
if (!transcription?.payload?.value) {
|
|
135
|
-
return;
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
const payload = codec.decode(transcription.payload.value);
|
|
139
|
-
state.enabled = payload.enabled;
|
|
140
|
-
void state.transcriptionManager?.setEnabled(payload.enabled);
|
|
141
|
-
void state.transcriptionManager?.setQueue(payload.queueDxn);
|
|
142
|
-
},
|
|
143
|
-
onMediaStateUpdated: ([mediaState, isSpeaking]: [MediaState, boolean]) => {
|
|
144
|
-
void state.transcriptionManager?.setAudioTrack(mediaState.audioTrack);
|
|
145
|
-
void state.transcriptionManager?.setRecording(isSpeaking);
|
|
146
|
-
},
|
|
147
|
-
},
|
|
148
|
-
},
|
|
149
|
-
];
|
|
150
|
-
},
|
|
151
|
-
}),
|
|
152
|
-
]);
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { contributes } from '@dxos/app-framework';
|
|
6
|
-
import { create } from '@dxos/live-object';
|
|
7
|
-
|
|
8
|
-
import { TranscriptionCapabilities } from './capabilities';
|
|
9
|
-
|
|
10
|
-
export default () => {
|
|
11
|
-
const state = create<TranscriptionCapabilities.MeetingTranscriptionState>({
|
|
12
|
-
enabled: false,
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
return contributes(TranscriptionCapabilities.MeetingTranscriptionState, state);
|
|
16
|
-
};
|
|
@@ -1,196 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
|
-
import { type Meta, type StoryObj } from '@storybook/react';
|
|
8
|
-
import React, {
|
|
9
|
-
type Dispatch,
|
|
10
|
-
type FC,
|
|
11
|
-
type SetStateAction,
|
|
12
|
-
useCallback,
|
|
13
|
-
useEffect,
|
|
14
|
-
useMemo,
|
|
15
|
-
useRef,
|
|
16
|
-
useState,
|
|
17
|
-
} from 'react';
|
|
18
|
-
|
|
19
|
-
import { createStatic } from '@dxos/echo-schema';
|
|
20
|
-
import { type DXN } from '@dxos/keys';
|
|
21
|
-
import { log } from '@dxos/log';
|
|
22
|
-
import { Config } from '@dxos/react-client';
|
|
23
|
-
import { useQueue } from '@dxos/react-client/echo';
|
|
24
|
-
import { withClientProvider } from '@dxos/react-client/testing';
|
|
25
|
-
import { IconButton, Toolbar } from '@dxos/react-ui';
|
|
26
|
-
import { ScrollContainer } from '@dxos/react-ui-components';
|
|
27
|
-
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
28
|
-
|
|
29
|
-
import { Transcript } from './Transcript';
|
|
30
|
-
import { useAudioFile, useAudioTrack, useTranscriber } from '../hooks';
|
|
31
|
-
import { type TranscriberParams } from '../transcriber';
|
|
32
|
-
import { TranscriptBlock } from '../types';
|
|
33
|
-
import { randomQueueDxn } from '../util';
|
|
34
|
-
|
|
35
|
-
const TranscriptionStory: FC<{
|
|
36
|
-
playing: boolean;
|
|
37
|
-
setPlaying: Dispatch<SetStateAction<boolean>>;
|
|
38
|
-
blocks?: TranscriptBlock[];
|
|
39
|
-
}> = ({ playing, setPlaying, blocks }) => {
|
|
40
|
-
return (
|
|
41
|
-
<div className='flex flex-col w-[30rem]'>
|
|
42
|
-
<Toolbar.Root>
|
|
43
|
-
<IconButton
|
|
44
|
-
iconOnly
|
|
45
|
-
icon={playing ? 'ph--pause--regular' : 'ph--play--regular'}
|
|
46
|
-
label={playing ? 'Pause' : 'Play'}
|
|
47
|
-
onClick={() => setPlaying((playing) => !playing)}
|
|
48
|
-
/>
|
|
49
|
-
</Toolbar.Root>
|
|
50
|
-
<ScrollContainer>
|
|
51
|
-
<Transcript blocks={blocks} attendableId='story' />
|
|
52
|
-
</ScrollContainer>
|
|
53
|
-
</div>
|
|
54
|
-
);
|
|
55
|
-
};
|
|
56
|
-
|
|
57
|
-
const Microphone = () => {
|
|
58
|
-
const [playing, setPlaying] = useState(false);
|
|
59
|
-
|
|
60
|
-
// Audio.
|
|
61
|
-
const track = useAudioTrack(playing);
|
|
62
|
-
|
|
63
|
-
// Queue.
|
|
64
|
-
const queueDxn = useMemo(() => randomQueueDxn(), []);
|
|
65
|
-
const queue = useQueue<TranscriptBlock>(queueDxn, { pollInterval: 500 });
|
|
66
|
-
|
|
67
|
-
// Transcriber.
|
|
68
|
-
const handleSegments = useCallback<TranscriberParams['onSegments']>(
|
|
69
|
-
async (segments) => {
|
|
70
|
-
const block = createStatic(TranscriptBlock, { segments });
|
|
71
|
-
queue?.append([block]);
|
|
72
|
-
},
|
|
73
|
-
[queue],
|
|
74
|
-
);
|
|
75
|
-
const transcriber = useTranscriber({ audioStreamTrack: track, onSegments: handleSegments });
|
|
76
|
-
useEffect(() => {
|
|
77
|
-
void transcriber?.open();
|
|
78
|
-
return () => {
|
|
79
|
-
void transcriber?.close();
|
|
80
|
-
};
|
|
81
|
-
}, [transcriber]);
|
|
82
|
-
|
|
83
|
-
// Manage transcription state.
|
|
84
|
-
useEffect(() => {
|
|
85
|
-
if (playing && transcriber?.isOpen) {
|
|
86
|
-
void transcriber?.startChunksRecording();
|
|
87
|
-
} else if (!playing) {
|
|
88
|
-
void transcriber?.stopChunksRecording();
|
|
89
|
-
}
|
|
90
|
-
}, [transcriber, playing, transcriber?.isOpen]);
|
|
91
|
-
|
|
92
|
-
return <TranscriptionStory playing={playing} setPlaying={setPlaying} blocks={queue?.items} />;
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
const AudioFile = ({ queueDxn, audioUrl }: { queueDxn: DXN; audioUrl: string; transcriptUrl: string }) => {
|
|
96
|
-
const [playing, setPlaying] = useState(false);
|
|
97
|
-
|
|
98
|
-
// Audio.
|
|
99
|
-
const audioElement = useRef<HTMLAudioElement>(null);
|
|
100
|
-
const { audio, stream, track } = useAudioFile(audioUrl);
|
|
101
|
-
useEffect(() => {
|
|
102
|
-
if (stream && audioElement.current) {
|
|
103
|
-
audioElement.current.srcObject = stream;
|
|
104
|
-
}
|
|
105
|
-
}, [stream, audioElement.current]);
|
|
106
|
-
|
|
107
|
-
useEffect(() => {
|
|
108
|
-
if (!audio) {
|
|
109
|
-
log.warn('no audio');
|
|
110
|
-
return;
|
|
111
|
-
}
|
|
112
|
-
|
|
113
|
-
if (playing) {
|
|
114
|
-
void audio.play();
|
|
115
|
-
} else {
|
|
116
|
-
void audio.pause();
|
|
117
|
-
}
|
|
118
|
-
}, [audio, playing]);
|
|
119
|
-
|
|
120
|
-
// Transcriber.
|
|
121
|
-
const queue = useQueue<TranscriptBlock>(queueDxn, { pollInterval: 500 });
|
|
122
|
-
const handleSegments = useCallback<TranscriberParams['onSegments']>(
|
|
123
|
-
async (segments) => {
|
|
124
|
-
const block = createStatic(TranscriptBlock, { authorName: 'test', authorHue: 'cyan', segments });
|
|
125
|
-
queue?.append([block]);
|
|
126
|
-
},
|
|
127
|
-
[queue],
|
|
128
|
-
);
|
|
129
|
-
|
|
130
|
-
const transcriber = useTranscriber({
|
|
131
|
-
audioStreamTrack: track,
|
|
132
|
-
onSegments: handleSegments,
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
useEffect(() => {
|
|
136
|
-
if (transcriber && playing) {
|
|
137
|
-
void transcriber.open();
|
|
138
|
-
} else if (!playing) {
|
|
139
|
-
transcriber?.stopChunksRecording();
|
|
140
|
-
void transcriber?.close();
|
|
141
|
-
}
|
|
142
|
-
}, [transcriber, playing]);
|
|
143
|
-
|
|
144
|
-
useEffect(() => {
|
|
145
|
-
if (track?.readyState === 'live' && transcriber?.isOpen) {
|
|
146
|
-
log.info('starting transcription');
|
|
147
|
-
transcriber.startChunksRecording();
|
|
148
|
-
} else if (track?.readyState !== 'live' && transcriber) {
|
|
149
|
-
log.info('stopping transcription');
|
|
150
|
-
transcriber.stopChunksRecording();
|
|
151
|
-
}
|
|
152
|
-
}, [transcriber, track?.readyState, transcriber?.isOpen]);
|
|
153
|
-
|
|
154
|
-
return <TranscriptionStory playing={playing} setPlaying={setPlaying} blocks={queue?.items} />;
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
const meta: Meta<typeof AudioFile> = {
|
|
158
|
-
title: 'plugins/plugin-transcription/transcription',
|
|
159
|
-
decorators: [
|
|
160
|
-
withClientProvider({
|
|
161
|
-
config: new Config({
|
|
162
|
-
runtime: {
|
|
163
|
-
client: { edgeFeatures: { signaling: true } },
|
|
164
|
-
services: {
|
|
165
|
-
edge: { url: 'https://edge.dxos.workers.dev/' },
|
|
166
|
-
iceProviders: [{ urls: 'https://edge.dxos.workers.dev/ice' }],
|
|
167
|
-
},
|
|
168
|
-
},
|
|
169
|
-
}),
|
|
170
|
-
}),
|
|
171
|
-
withTheme,
|
|
172
|
-
withLayout({
|
|
173
|
-
tooltips: true,
|
|
174
|
-
fullscreen: true,
|
|
175
|
-
classNames: 'justify-center',
|
|
176
|
-
}),
|
|
177
|
-
],
|
|
178
|
-
};
|
|
179
|
-
|
|
180
|
-
export default meta;
|
|
181
|
-
|
|
182
|
-
type Story = StoryObj<typeof AudioFile>;
|
|
183
|
-
|
|
184
|
-
export const Default: Story = {
|
|
185
|
-
render: Microphone,
|
|
186
|
-
};
|
|
187
|
-
|
|
188
|
-
export const File: Story = {
|
|
189
|
-
render: AudioFile,
|
|
190
|
-
args: {
|
|
191
|
-
queueDxn: randomQueueDxn(),
|
|
192
|
-
// https://learnenglish.britishcouncil.org/general-english/audio-zone/living-london
|
|
193
|
-
transcriptUrl: 'https://dxos.network/audio-london.txt',
|
|
194
|
-
audioUrl: 'https://dxos.network/audio-london.m4a',
|
|
195
|
-
},
|
|
196
|
-
};
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { ObjectId } from '@dxos/echo-schema';
|
|
6
|
-
import { DXN, QueueSubspaceTags, SpaceId } from '@dxos/keys';
|
|
7
|
-
|
|
8
|
-
export const randomQueueDxn = (spaceId?: SpaceId) =>
|
|
9
|
-
new DXN(DXN.kind.QUEUE, [QueueSubspaceTags.DATA, spaceId ?? SpaceId.random(), ObjectId.random()]);
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|