@dxos/plugin-transcription 0.8.4-main.3eb6e50203 → 0.8.4-main.3fbcb4aa9b
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/neutral/TranscriptionContainer-XNGXNGPX.mjs +35 -0
- package/dist/lib/neutral/TranscriptionContainer-XNGXNGPX.mjs.map +7 -0
- package/dist/lib/neutral/TranscriptionPlugin.mjs +34 -0
- package/dist/lib/neutral/TranscriptionPlugin.mjs.map +7 -0
- package/dist/lib/neutral/TranscriptionPlugin.node.mjs +25 -0
- package/dist/lib/neutral/TranscriptionPlugin.node.mjs.map +7 -0
- package/dist/lib/neutral/blueprint-definition-HOXDG5QP.mjs +15 -0
- package/dist/lib/neutral/blueprint-definition-HOXDG5QP.mjs.map +7 -0
- package/dist/lib/neutral/blueprints/index.mjs +8 -0
- package/dist/lib/neutral/capabilities/index.mjs +17 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/neutral/chunk-GL4RS533.mjs +22 -0
- package/dist/lib/neutral/chunk-GL4RS533.mjs.map +7 -0
- package/dist/lib/{browser/chunk-HOOPZ7EM.mjs → neutral/chunk-KAEXRX3Y.mjs} +1 -1
- package/dist/lib/{node-esm/chunk-EPC27WWV.mjs → neutral/chunk-LS3R7EQI.mjs} +74 -105
- package/dist/lib/neutral/chunk-LS3R7EQI.mjs.map +7 -0
- package/dist/lib/neutral/chunk-MLRJWAQH.mjs +179 -0
- package/dist/lib/neutral/chunk-MLRJWAQH.mjs.map +7 -0
- package/dist/lib/neutral/chunk-NNR3EYR2.mjs +124 -0
- package/dist/lib/neutral/chunk-NNR3EYR2.mjs.map +7 -0
- package/dist/lib/neutral/chunk-NQQK7UZQ.mjs +244 -0
- package/dist/lib/neutral/chunk-NQQK7UZQ.mjs.map +7 -0
- package/dist/lib/neutral/chunk-WVEZMGBT.mjs +8 -0
- package/dist/lib/neutral/chunk-WVEZMGBT.mjs.map +7 -0
- package/dist/lib/neutral/chunk-ZR4BH4QQ.mjs +30 -0
- package/dist/lib/neutral/chunk-ZR4BH4QQ.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +207 -0
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/containers/index.mjs +9 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/neutral/create-2D6S4IMQ.mjs +21 -0
- package/dist/lib/neutral/create-2D6S4IMQ.mjs.map +7 -0
- package/dist/lib/neutral/hooks/index.mjs +17 -0
- package/dist/lib/neutral/index.mjs +44 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +8 -0
- package/dist/lib/neutral/open-2QB6IIET.mjs +27 -0
- package/dist/lib/neutral/open-2QB6IIET.mjs.map +7 -0
- package/dist/lib/neutral/operation-handler-NXMOAXFP.mjs +13 -0
- package/dist/lib/neutral/operation-handler-NXMOAXFP.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +8 -0
- package/dist/lib/neutral/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/{browser/react-surface-AWZ2A5WZ.mjs → neutral/react-surface-QF4MUMWG.mjs} +9 -18
- package/dist/lib/neutral/react-surface-QF4MUMWG.mjs.map +7 -0
- package/dist/lib/neutral/summarize-CJPVKWYZ.mjs +78 -0
- package/dist/lib/neutral/summarize-CJPVKWYZ.mjs.map +7 -0
- package/dist/lib/neutral/text-content-LHSUG2D2.mjs +30 -0
- package/dist/lib/neutral/text-content-LHSUG2D2.mjs.map +7 -0
- package/dist/lib/{browser/transcriber-SLVQP76E.mjs → neutral/transcriber-M3R6HPTZ.mjs} +9 -10
- package/dist/lib/neutral/transcriber-M3R6HPTZ.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +22 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +12 -0
- package/dist/types/src/TranscriptionPlugin.d.ts +1 -0
- package/dist/types/src/TranscriptionPlugin.d.ts.map +1 -1
- package/dist/types/src/TranscriptionPlugin.node.d.ts +4 -0
- package/dist/types/src/TranscriptionPlugin.node.d.ts.map +1 -0
- package/dist/types/src/TranscriptionPlugin.test.d.ts +2 -0
- package/dist/types/src/TranscriptionPlugin.test.d.ts.map +1 -0
- package/dist/types/src/blueprints/index.d.ts +1 -1
- package/dist/types/src/blueprints/index.d.ts.map +1 -1
- package/dist/types/src/blueprints/transcription-blueprint.d.ts +3 -20
- package/dist/types/src/blueprints/transcription-blueprint.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +6 -0
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +10 -4
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/text-content.d.ts +8 -0
- package/dist/types/src/capabilities/text-content.d.ts.map +1 -0
- package/dist/types/src/capabilities/transcriber.d.ts +9 -0
- package/dist/types/src/capabilities/transcriber.d.ts.map +1 -0
- package/dist/types/src/components/{Transcript/Transcript.d.ts → Transcription/Transcription.d.ts} +6 -5
- package/dist/types/src/components/Transcription/Transcription.d.ts.map +1 -0
- package/dist/types/src/components/{Transcript/Transcript.stories.d.ts → Transcription/Transcription.stories.d.ts} +13 -13
- package/dist/types/src/components/Transcription/Transcription.stories.d.ts.map +1 -0
- package/dist/types/src/components/Transcription/index.d.ts +2 -0
- package/dist/types/src/components/Transcription/index.d.ts.map +1 -0
- package/dist/types/src/components/{Transcript/transcript-extension.d.ts → Transcription/transcription-extension.d.ts} +3 -3
- package/dist/types/src/components/Transcription/transcription-extension.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +1 -3
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/TranscriptionContainer/TranscriptionContainer.d.ts +6 -0
- package/dist/types/src/containers/TranscriptionContainer/TranscriptionContainer.d.ts.map +1 -0
- package/dist/types/src/containers/TranscriptionContainer/index.d.ts +2 -0
- package/dist/types/src/containers/TranscriptionContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +3 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/hooks/useAudioFile.d.ts.map +1 -1
- package/dist/types/src/hooks/useAudioTrack.d.ts.map +1 -1
- package/dist/types/src/hooks/useQueueModelAdapter.d.ts.map +1 -1
- package/dist/types/src/hooks/useTranscriber.d.ts +2 -2
- 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/index.d.ts +2 -3
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/model/model.d.ts +2 -2
- package/dist/types/src/model/model.d.ts.map +1 -1
- package/dist/types/src/{segments-normalization → normalization}/index.d.ts +1 -1
- package/dist/types/src/normalization/index.d.ts.map +1 -0
- package/dist/types/src/normalization/message-normalizer.d.ts.map +1 -0
- package/dist/types/src/{segments-normalization → normalization}/normalization.d.ts +333 -311
- package/dist/types/src/normalization/normalization.d.ts.map +1 -0
- package/dist/types/src/normalization/normalization.test.d.ts.map +1 -0
- package/dist/types/src/normalization/utils.d.ts.map +1 -0
- package/dist/types/src/operations/create.d.ts +5 -0
- package/dist/types/src/operations/create.d.ts.map +1 -0
- package/dist/types/src/operations/index.d.ts +3 -0
- package/dist/types/src/operations/index.d.ts.map +1 -0
- package/dist/types/src/operations/open.d.ts +5 -0
- package/dist/types/src/operations/open.d.ts.map +1 -0
- package/dist/types/src/operations/summarize.d.ts +8 -0
- package/dist/types/src/operations/summarize.d.ts.map +1 -0
- package/dist/types/src/plugin.d.ts +4 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/{components/stories → stories}/FileTranscription.stories.d.ts +3 -3
- package/dist/types/src/stories/FileTranscription.stories.d.ts.map +1 -0
- package/dist/types/src/{components/stories → stories}/KeyWordRecognition.stories.d.ts +2 -2
- package/dist/types/src/stories/KeyWordRecognition.stories.d.ts.map +1 -0
- package/dist/types/src/{components/stories → stories}/MicrophoneTranscription.stories.d.ts +3 -3
- package/dist/types/src/stories/MicrophoneTranscription.stories.d.ts.map +1 -0
- package/dist/types/src/stories/TranscriptionStory.d.ts +23 -0
- package/dist/types/src/stories/TranscriptionStory.d.ts.map +1 -0
- package/dist/types/src/stories/useIsSpeaking.d.ts.map +1 -0
- 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.map +1 -1
- package/dist/types/src/transcriber/transcriber.d.ts +57 -2
- package/dist/types/src/transcriber/transcriber.d.ts.map +1 -1
- package/dist/types/src/transcriber/transcriber.test.d.ts +2 -0
- package/dist/types/src/transcriber/transcriber.test.d.ts.map +1 -0
- package/dist/types/src/transcriber/transcription-manager.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +7 -8
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/TranscriptOperation.d.ts +917 -0
- package/dist/types/src/types/TranscriptOperation.d.ts.map +1 -0
- package/dist/types/src/types/TranscriptionCapabilities.d.ts +17 -0
- package/dist/types/src/types/TranscriptionCapabilities.d.ts.map +1 -0
- package/dist/types/src/types/{types.d.ts → defs.d.ts} +1 -1
- package/dist/types/src/types/defs.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +3 -4
- package/dist/types/src/types/index.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/monitor-audio-level.d.ts.map +1 -1
- package/dist/types/src/util/render-byline.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +135 -83
- package/src/TranscriptionPlugin.node.ts +20 -0
- package/src/TranscriptionPlugin.test.ts +31 -0
- package/src/TranscriptionPlugin.tsx +8 -29
- package/src/blueprints/index.ts +1 -1
- package/src/blueprints/transcription-blueprint.ts +13 -9
- package/src/capabilities/blueprint-definition.ts +19 -0
- package/src/capabilities/index.ts +12 -4
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-surface.tsx +31 -0
- package/src/capabilities/text-content.ts +33 -0
- package/src/capabilities/{transcriber/transcriber.ts → transcriber.ts} +6 -3
- package/src/components/{Transcript/Transcript.stories.tsx → Transcription/Transcription.stories.tsx} +29 -28
- package/src/components/Transcription/Transcription.tsx +64 -0
- package/src/components/{Transcript → Transcription}/index.ts +1 -1
- package/src/components/{Transcript/transcript-extension.ts → Transcription/transcription-extension.ts} +4 -4
- package/src/components/index.ts +1 -6
- package/src/containers/TranscriptionContainer/TranscriptionContainer.tsx +35 -0
- package/src/containers/TranscriptionContainer/index.ts +5 -0
- package/src/containers/index.ts +7 -0
- package/src/hooks/useTranscriber.ts +5 -2
- package/src/hooks/useVoiceInput.ts +0 -1
- package/src/index.ts +4 -5
- package/src/meta.ts +1 -1
- package/src/model/model.test.ts +6 -6
- package/src/model/model.ts +3 -3
- package/src/{segments-normalization → normalization}/message-normalizer.ts +1 -5
- package/src/{segments-normalization → normalization}/normalization.test.ts +2 -2
- package/src/normalization/normalization.ts +76 -0
- package/src/operations/create.ts +24 -0
- package/src/operations/index.ts +11 -0
- package/src/operations/open.ts +28 -0
- package/src/operations/summarize.ts +101 -0
- package/src/plugin.ts +11 -0
- package/src/{components/stories → stories}/FileTranscription.stories.tsx +34 -17
- package/src/{components/stories → stories}/KeyWordRecognition.stories.tsx +33 -31
- package/src/{components/stories → stories}/MicrophoneTranscription.stories.tsx +19 -37
- package/src/stories/TranscriptionStory.tsx +93 -0
- package/src/testing/testing.ts +8 -18
- package/src/transcriber/index.ts +1 -1
- package/src/transcriber/transcriber.browser.test.ts +0 -1
- package/src/transcriber/transcriber.test.ts +104 -0
- package/src/transcriber/transcriber.ts +94 -53
- package/src/translations.ts +7 -7
- package/src/types/TranscriptOperation.ts +103 -0
- package/src/types/TranscriptionCapabilities.ts +39 -0
- package/src/types/index.ts +4 -4
- package/dist/lib/browser/TranscriptContainer-MV3JBKLS.mjs +0 -12
- package/dist/lib/browser/blueprint-definition-K3E72ZBC.mjs +0 -19
- package/dist/lib/browser/blueprint-definition-K3E72ZBC.mjs.map +0 -7
- package/dist/lib/browser/blueprints/index.mjs +0 -9
- package/dist/lib/browser/chunk-AV44VISC.mjs +0 -148
- package/dist/lib/browser/chunk-AV44VISC.mjs.map +0 -7
- package/dist/lib/browser/chunk-K3JJ46VV.mjs +0 -698
- package/dist/lib/browser/chunk-K3JJ46VV.mjs.map +0 -7
- package/dist/lib/browser/chunk-Q5OC3WVG.mjs +0 -72
- package/dist/lib/browser/chunk-Q5OC3WVG.mjs.map +0 -7
- package/dist/lib/browser/chunk-RUKY36XW.mjs +0 -8
- package/dist/lib/browser/chunk-RUKY36XW.mjs.map +0 -7
- package/dist/lib/browser/chunk-TKFU53OZ.mjs +0 -460
- package/dist/lib/browser/chunk-TKFU53OZ.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -118
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/operation-resolver-GLEBGPKH.mjs +0 -22
- package/dist/lib/browser/operation-resolver-GLEBGPKH.mjs.map +0 -7
- package/dist/lib/browser/react-surface-AWZ2A5WZ.mjs.map +0 -7
- package/dist/lib/browser/transcriber-SLVQP76E.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -14
- package/dist/lib/node-esm/TranscriptContainer-7M43UAZ2.mjs +0 -13
- package/dist/lib/node-esm/blueprint-definition-2WIDDA3Y.mjs +0 -20
- package/dist/lib/node-esm/blueprint-definition-2WIDDA3Y.mjs.map +0 -7
- package/dist/lib/node-esm/blueprints/index.mjs +0 -10
- package/dist/lib/node-esm/chunk-4BFY6P2D.mjs +0 -73
- package/dist/lib/node-esm/chunk-4BFY6P2D.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-EPC27WWV.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-NVM2QUMX.mjs +0 -37
- package/dist/lib/node-esm/chunk-NVM2QUMX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SNZAN34I.mjs +0 -10
- package/dist/lib/node-esm/chunk-SNZAN34I.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-TIUYXGQN.mjs +0 -699
- package/dist/lib/node-esm/chunk-TIUYXGQN.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-TTJBW7CY.mjs +0 -149
- package/dist/lib/node-esm/chunk-TTJBW7CY.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -119
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/operation-resolver-SMCFTUFM.mjs +0 -23
- package/dist/lib/node-esm/operation-resolver-SMCFTUFM.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-YBBXC4W5.mjs +0 -36
- package/dist/lib/node-esm/react-surface-YBBXC4W5.mjs.map +0 -7
- package/dist/lib/node-esm/transcriber-BO2N3UQ4.mjs +0 -61
- package/dist/lib/node-esm/transcriber-BO2N3UQ4.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -15
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +0 -10
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts +0 -3
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-handler/index.d.ts +0 -3
- package/dist/types/src/capabilities/operation-handler/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-handler/operation-handler.d.ts +0 -5
- package/dist/types/src/capabilities/operation-handler/operation-handler.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +0 -5
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/transcriber/index.d.ts +0 -3
- package/dist/types/src/capabilities/transcriber/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/transcriber/transcriber.d.ts +0 -9
- package/dist/types/src/capabilities/transcriber/transcriber.d.ts.map +0 -1
- package/dist/types/src/components/Transcript/Transcript.d.ts.map +0 -1
- package/dist/types/src/components/Transcript/Transcript.stories.d.ts.map +0 -1
- package/dist/types/src/components/Transcript/deprecated/OldTranscript.d.ts +0 -28
- package/dist/types/src/components/Transcript/deprecated/OldTranscript.d.ts.map +0 -1
- package/dist/types/src/components/Transcript/index.d.ts +0 -2
- package/dist/types/src/components/Transcript/index.d.ts.map +0 -1
- package/dist/types/src/components/Transcript/transcript-extension.d.ts.map +0 -1
- package/dist/types/src/components/TranscriptContainer.d.ts +0 -7
- package/dist/types/src/components/TranscriptContainer.d.ts.map +0 -1
- package/dist/types/src/components/stories/FileTranscription.stories.d.ts.map +0 -1
- package/dist/types/src/components/stories/KeyWordRecognition.stories.d.ts.map +0 -1
- package/dist/types/src/components/stories/MicrophoneTranscription.stories.d.ts.map +0 -1
- package/dist/types/src/components/stories/TranscriptionStory.d.ts +0 -12
- package/dist/types/src/components/stories/TranscriptionStory.d.ts.map +0 -1
- package/dist/types/src/components/stories/useIsSpeaking.d.ts.map +0 -1
- package/dist/types/src/functions/index.d.ts +0 -3
- package/dist/types/src/functions/index.d.ts.map +0 -1
- package/dist/types/src/functions/open.d.ts +0 -11
- package/dist/types/src/functions/open.d.ts.map +0 -1
- package/dist/types/src/functions/summarize.d.ts +0 -11
- package/dist/types/src/functions/summarize.d.ts.map +0 -1
- package/dist/types/src/segments-normalization/index.d.ts.map +0 -1
- package/dist/types/src/segments-normalization/message-normalizer.d.ts.map +0 -1
- package/dist/types/src/segments-normalization/normalization.d.ts.map +0 -1
- package/dist/types/src/segments-normalization/normalization.test.d.ts.map +0 -1
- package/dist/types/src/segments-normalization/utils.d.ts.map +0 -1
- package/dist/types/src/types/TranscriptAction.d.ts +0 -25
- package/dist/types/src/types/TranscriptAction.d.ts.map +0 -1
- package/dist/types/src/types/capabilities.d.ts +0 -18
- package/dist/types/src/types/capabilities.d.ts.map +0 -1
- package/dist/types/src/types/types.d.ts.map +0 -1
- package/src/capabilities/blueprint-definition/blueprint-definition.ts +0 -24
- package/src/capabilities/blueprint-definition/index.ts +0 -7
- package/src/capabilities/operation-handler/index.ts +0 -7
- package/src/capabilities/operation-handler/operation-handler.ts +0 -25
- package/src/capabilities/operation-resolver/index.ts +0 -7
- package/src/capabilities/operation-resolver/operation-resolver.ts +0 -25
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/react-surface/react-surface.tsx +0 -28
- package/src/capabilities/transcriber/index.ts +0 -7
- package/src/components/Transcript/Transcript.tsx +0 -66
- package/src/components/Transcript/deprecated/OldTranscript.tsx +0 -260
- package/src/components/TranscriptContainer.tsx +0 -34
- package/src/components/stories/TranscriptionStory.tsx +0 -41
- package/src/functions/index.ts +0 -6
- package/src/functions/open.ts +0 -37
- package/src/functions/summarize.ts +0 -103
- package/src/segments-normalization/normalization.ts +0 -115
- package/src/types/TranscriptAction.ts +0 -32
- package/src/types/capabilities.ts +0 -33
- package/dist/lib/{browser → neutral}/blueprints/index.mjs.map +0 -0
- package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs +0 -0
- package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs.map +0 -0
- package/dist/lib/{browser/chunk-HOOPZ7EM.mjs.map → neutral/chunk-KAEXRX3Y.mjs.map} +0 -0
- package/dist/lib/{browser/types → neutral/hooks}/index.mjs.map +0 -0
- package/dist/lib/{node-esm/blueprints → neutral}/index.mjs.map +0 -0
- package/dist/lib/{browser/TranscriptContainer-MV3JBKLS.mjs.map → neutral/meta.mjs.map} +0 -0
- package/dist/lib/{node-esm/types → neutral/operations}/index.mjs.map +0 -0
- package/dist/lib/{node-esm/TranscriptContainer-7M43UAZ2.mjs.map → neutral/types/index.mjs.map} +0 -0
- package/dist/types/src/{segments-normalization → normalization}/message-normalizer.d.ts +0 -0
- package/dist/types/src/{segments-normalization → normalization}/normalization.test.d.ts +0 -0
- package/dist/types/src/{segments-normalization → normalization}/utils.d.ts +0 -0
- package/dist/types/src/{components/stories → stories}/useIsSpeaking.d.ts +0 -0
- package/src/{segments-normalization → normalization}/index.ts +1 -1
- /package/src/{segments-normalization → normalization}/utils.ts +0 -0
- /package/src/{components/stories → stories}/useIsSpeaking.tsx +0 -0
- /package/src/types/{types.ts → defs.ts} +0 -0
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import {
|
|
2
|
+
renderByline
|
|
3
|
+
} from "./chunk-KAEXRX3Y.mjs";
|
|
4
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
5
|
+
|
|
6
|
+
// src/containers/TranscriptionContainer/TranscriptionContainer.tsx
|
|
7
|
+
import React from "react";
|
|
8
|
+
import { Feed, Obj } from "@dxos/echo";
|
|
9
|
+
import { useMembers, useQueue } from "@dxos/react-client/echo";
|
|
10
|
+
import { Panel } from "@dxos/react-ui";
|
|
11
|
+
import { Transcription } from "#components";
|
|
12
|
+
import { useQueueModelAdapter } from "#hooks";
|
|
13
|
+
var TranscriptionContainer = ({ role, subject: transcript, attendableId }) => {
|
|
14
|
+
const db = Obj.getDatabase(transcript);
|
|
15
|
+
const members = useMembers(db?.spaceId).map((member) => member.identity);
|
|
16
|
+
const feed = transcript.feed.target;
|
|
17
|
+
const queueDxn = feed ? Feed.getQueueDxn(feed) : void 0;
|
|
18
|
+
const queue = useQueue(queueDxn, {
|
|
19
|
+
pollInterval: 1e3
|
|
20
|
+
});
|
|
21
|
+
const model = useQueueModelAdapter(renderByline(members), queue);
|
|
22
|
+
return /* @__PURE__ */ React.createElement(Panel.Root, {
|
|
23
|
+
role
|
|
24
|
+
}, /* @__PURE__ */ React.createElement(Panel.Content, {
|
|
25
|
+
asChild: true
|
|
26
|
+
}, /* @__PURE__ */ React.createElement(Transcription, {
|
|
27
|
+
attendableId,
|
|
28
|
+
model,
|
|
29
|
+
transcript
|
|
30
|
+
})));
|
|
31
|
+
};
|
|
32
|
+
export {
|
|
33
|
+
TranscriptionContainer as default
|
|
34
|
+
};
|
|
35
|
+
//# sourceMappingURL=TranscriptionContainer-XNGXNGPX.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/containers/TranscriptionContainer/TranscriptionContainer.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type AppSurface } from '@dxos/app-toolkit/ui';\nimport { Feed, Obj } from '@dxos/echo';\nimport { useMembers, useQueue } from '@dxos/react-client/echo';\nimport { Panel } from '@dxos/react-ui';\nimport { type Message, type Transcript } from '@dxos/types';\n\nimport { Transcription } from '#components';\nimport { useQueueModelAdapter } from '#hooks';\n\nimport { renderByline } from '../../util';\n\nexport type TranscriptionContainerProps = AppSurface.ObjectArticleProps<Transcript.Transcript>;\n\nexport const TranscriptionContainer = ({ role, subject: transcript, attendableId }: TranscriptionContainerProps) => {\n const db = Obj.getDatabase(transcript);\n const members = useMembers(db?.spaceId).map((member) => member.identity);\n const feed = transcript.feed.target;\n const queueDxn = feed ? Feed.getQueueDxn(feed) : undefined;\n const queue = useQueue<Message.Message>(queueDxn, { pollInterval: 1_000 });\n const model = useQueueModelAdapter(renderByline(members), queue);\n\n return (\n <Panel.Root role={role}>\n <Panel.Content asChild>\n <Transcription attendableId={attendableId} model={model} transcript={transcript} />\n </Panel.Content>\n </Panel.Root>\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;AAIA,OAAOA,WAAW;AAGlB,SAASC,MAAMC,WAAW;AAC1B,SAASC,YAAYC,gBAAgB;AACrC,SAASC,aAAa;AAGtB,SAASC,qBAAqB;AAC9B,SAASC,4BAA4B;AAM9B,IAAMC,yBAAyB,CAAC,EAAEC,MAAMC,SAASC,YAAYC,aAAY,MAA+B;AAC7G,QAAMC,KAAKC,IAAIC,YAAYJ,UAAAA;AAC3B,QAAMK,UAAUC,WAAWJ,IAAIK,OAAAA,EAASC,IAAI,CAACC,WAAWA,OAAOC,QAAQ;AACvE,QAAMC,OAAOX,WAAWW,KAAKC;AAC7B,QAAMC,WAAWF,OAAOG,KAAKC,YAAYJ,IAAAA,IAAQK;AACjD,QAAMC,QAAQC,SAA0BL,UAAU;IAAEM,cAAc;EAAM,CAAA;AACxE,QAAMC,QAAQC,qBAAqBC,aAAajB,OAAAA,GAAUY,KAAAA;AAE1D,SACE,sBAAA,cAACM,MAAMC,MAAI;IAAC1B;KACV,sBAAA,cAACyB,MAAME,SAAO;IAACC,SAAAA;KACb,sBAAA,cAACC,eAAAA;IAAc1B;IAA4BmB;IAAcpB;;AAIjE;",
|
|
6
|
+
"names": ["React", "Feed", "Obj", "useMembers", "useQueue", "Panel", "Transcription", "useQueueModelAdapter", "TranscriptionContainer", "role", "subject", "transcript", "attendableId", "db", "Obj", "getDatabase", "members", "useMembers", "spaceId", "map", "member", "identity", "feed", "target", "queueDxn", "Feed", "getQueueDxn", "undefined", "queue", "useQueue", "pollInterval", "model", "useQueueModelAdapter", "renderByline", "Panel", "Root", "Content", "asChild", "Transcription"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
+
|
|
3
|
+
// src/TranscriptionPlugin.tsx
|
|
4
|
+
import { Plugin } from "@dxos/app-framework";
|
|
5
|
+
import { AppActivationEvents, AppPlugin } from "@dxos/app-toolkit";
|
|
6
|
+
import { Transcript } from "@dxos/types";
|
|
7
|
+
import { BlueprintDefinition, OperationHandler, ReactSurface, TextContent, Transcriber } from "#capabilities";
|
|
8
|
+
import { meta } from "#meta";
|
|
9
|
+
import { translations } from "#translations";
|
|
10
|
+
var TranscriptionPlugin = Plugin.define(meta).pipe(AppPlugin.addBlueprintDefinitionModule({
|
|
11
|
+
activate: BlueprintDefinition
|
|
12
|
+
}), AppPlugin.addTextContentModule({
|
|
13
|
+
activate: TextContent
|
|
14
|
+
}), AppPlugin.addOperationHandlerModule({
|
|
15
|
+
activate: OperationHandler
|
|
16
|
+
}), AppPlugin.addSchemaModule({
|
|
17
|
+
schema: [
|
|
18
|
+
Transcript.Transcript
|
|
19
|
+
]
|
|
20
|
+
}), AppPlugin.addSurfaceModule({
|
|
21
|
+
activate: ReactSurface
|
|
22
|
+
}), AppPlugin.addTranslationsModule({
|
|
23
|
+
translations
|
|
24
|
+
}), Plugin.addModule({
|
|
25
|
+
id: "transcription",
|
|
26
|
+
activatesOn: AppActivationEvents.SetupAppGraph,
|
|
27
|
+
activate: Transcriber
|
|
28
|
+
}), Plugin.make);
|
|
29
|
+
var TranscriptionPlugin_default = TranscriptionPlugin;
|
|
30
|
+
export {
|
|
31
|
+
TranscriptionPlugin,
|
|
32
|
+
TranscriptionPlugin_default as default
|
|
33
|
+
};
|
|
34
|
+
//# sourceMappingURL=TranscriptionPlugin.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/TranscriptionPlugin.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { AppActivationEvents, AppPlugin } from '@dxos/app-toolkit';\nimport { Transcript } from '@dxos/types';\n\nimport { BlueprintDefinition, OperationHandler, ReactSurface, TextContent, Transcriber } from '#capabilities';\nimport { meta } from '#meta';\nimport { translations } from '#translations';\n\nexport const TranscriptionPlugin = Plugin.define(meta).pipe(\n AppPlugin.addBlueprintDefinitionModule({ activate: BlueprintDefinition }),\n AppPlugin.addTextContentModule({ activate: TextContent }),\n AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),\n AppPlugin.addSchemaModule({ schema: [Transcript.Transcript] }),\n AppPlugin.addSurfaceModule({ activate: ReactSurface }),\n AppPlugin.addTranslationsModule({ translations }),\n Plugin.addModule({\n id: 'transcription',\n activatesOn: AppActivationEvents.SetupAppGraph,\n activate: Transcriber,\n }),\n Plugin.make,\n);\n\nexport default TranscriptionPlugin;\n"],
|
|
5
|
+
"mappings": ";;;AAIA,SAASA,cAAc;AACvB,SAASC,qBAAqBC,iBAAiB;AAC/C,SAASC,kBAAkB;AAE3B,SAASC,qBAAqBC,kBAAkBC,cAAcC,aAAaC,mBAAmB;AAC9F,SAASC,YAAY;AACrB,SAASC,oBAAoB;AAEtB,IAAMC,sBAAsBX,OAAOY,OAAOH,IAAAA,EAAMI,KACrDX,UAAUY,6BAA6B;EAAEC,UAAUX;AAAoB,CAAA,GACvEF,UAAUc,qBAAqB;EAAED,UAAUR;AAAY,CAAA,GACvDL,UAAUe,0BAA0B;EAAEF,UAAUV;AAAiB,CAAA,GACjEH,UAAUgB,gBAAgB;EAAEC,QAAQ;IAAChB,WAAWA;;AAAY,CAAA,GAC5DD,UAAUkB,iBAAiB;EAAEL,UAAUT;AAAa,CAAA,GACpDJ,UAAUmB,sBAAsB;EAAEX;AAAa,CAAA,GAC/CV,OAAOsB,UAAU;EACfC,IAAI;EACJC,aAAavB,oBAAoBwB;EACjCV,UAAUP;AACZ,CAAA,GACAR,OAAO0B,IAAI;AAGb,IAAA,8BAAef;",
|
|
6
|
+
"names": ["Plugin", "AppActivationEvents", "AppPlugin", "Transcript", "BlueprintDefinition", "OperationHandler", "ReactSurface", "TextContent", "Transcriber", "meta", "translations", "TranscriptionPlugin", "define", "pipe", "addBlueprintDefinitionModule", "activate", "addTextContentModule", "addOperationHandlerModule", "addSchemaModule", "schema", "addSurfaceModule", "addTranslationsModule", "addModule", "id", "activatesOn", "SetupAppGraph", "make"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
+
|
|
3
|
+
// src/TranscriptionPlugin.node.ts
|
|
4
|
+
import { Plugin } from "@dxos/app-framework";
|
|
5
|
+
import { AppPlugin } from "@dxos/app-toolkit";
|
|
6
|
+
import { Transcript } from "@dxos/types";
|
|
7
|
+
import { BlueprintDefinition, OperationHandler, TextContent } from "#capabilities";
|
|
8
|
+
import { meta } from "#meta";
|
|
9
|
+
var TranscriptionPlugin = Plugin.define(meta).pipe(AppPlugin.addBlueprintDefinitionModule({
|
|
10
|
+
activate: BlueprintDefinition
|
|
11
|
+
}), AppPlugin.addTextContentModule({
|
|
12
|
+
activate: TextContent
|
|
13
|
+
}), AppPlugin.addOperationHandlerModule({
|
|
14
|
+
activate: OperationHandler
|
|
15
|
+
}), AppPlugin.addSchemaModule({
|
|
16
|
+
schema: [
|
|
17
|
+
Transcript.Transcript
|
|
18
|
+
]
|
|
19
|
+
}), Plugin.make);
|
|
20
|
+
var TranscriptionPlugin_node_default = TranscriptionPlugin;
|
|
21
|
+
export {
|
|
22
|
+
TranscriptionPlugin,
|
|
23
|
+
TranscriptionPlugin_node_default as default
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=TranscriptionPlugin.node.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/TranscriptionPlugin.node.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { Plugin } from '@dxos/app-framework';\nimport { AppPlugin } from '@dxos/app-toolkit';\nimport { Transcript } from '@dxos/types';\n\nimport { BlueprintDefinition, OperationHandler, TextContent } from '#capabilities';\nimport { meta } from '#meta';\n\nexport const TranscriptionPlugin = Plugin.define(meta).pipe(\n AppPlugin.addBlueprintDefinitionModule({ activate: BlueprintDefinition }),\n AppPlugin.addTextContentModule({ activate: TextContent }),\n AppPlugin.addOperationHandlerModule({ activate: OperationHandler }),\n AppPlugin.addSchemaModule({ schema: [Transcript.Transcript] }),\n Plugin.make,\n);\n\nexport default TranscriptionPlugin;\n"],
|
|
5
|
+
"mappings": ";;;AAIA,SAASA,cAAc;AACvB,SAASC,iBAAiB;AAC1B,SAASC,kBAAkB;AAE3B,SAASC,qBAAqBC,kBAAkBC,mBAAmB;AACnE,SAASC,YAAY;AAEd,IAAMC,sBAAsBP,OAAOQ,OAAOF,IAAAA,EAAMG,KACrDR,UAAUS,6BAA6B;EAAEC,UAAUR;AAAoB,CAAA,GACvEF,UAAUW,qBAAqB;EAAED,UAAUN;AAAY,CAAA,GACvDJ,UAAUY,0BAA0B;EAAEF,UAAUP;AAAiB,CAAA,GACjEH,UAAUa,gBAAgB;EAAEC,QAAQ;IAACb,WAAWA;;AAAY,CAAA,GAC5DF,OAAOgB,IAAI;AAGb,IAAA,mCAAeT;",
|
|
6
|
+
"names": ["Plugin", "AppPlugin", "Transcript", "BlueprintDefinition", "OperationHandler", "TextContent", "meta", "TranscriptionPlugin", "define", "pipe", "addBlueprintDefinitionModule", "activate", "addTextContentModule", "addOperationHandlerModule", "addSchemaModule", "schema", "make"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
+
|
|
3
|
+
// src/capabilities/blueprint-definition.ts
|
|
4
|
+
import * as Effect from "effect/Effect";
|
|
5
|
+
import { Capability } from "@dxos/app-framework";
|
|
6
|
+
import { AppCapabilities } from "@dxos/app-toolkit";
|
|
7
|
+
import { TranscriptionBlueprint } from "#blueprints";
|
|
8
|
+
var blueprintDefinition = Capability.makeModule(() => Effect.succeed([
|
|
9
|
+
Capability.contributes(AppCapabilities.BlueprintDefinition, TranscriptionBlueprint)
|
|
10
|
+
]));
|
|
11
|
+
var blueprint_definition_default = blueprintDefinition;
|
|
12
|
+
export {
|
|
13
|
+
blueprint_definition_default as default
|
|
14
|
+
};
|
|
15
|
+
//# sourceMappingURL=blueprint-definition-HOXDG5QP.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/blueprint-definition.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { AppCapabilities } from '@dxos/app-toolkit';\n// eslint-disable-next-line unused-imports/no-unused-imports\nimport type { Blueprint } from '@dxos/compute';\n\nimport { TranscriptionBlueprint } from '#blueprints';\n\nconst blueprintDefinition = Capability.makeModule<\n [],\n Capability.Capability<typeof AppCapabilities.BlueprintDefinition>[]\n>(() => Effect.succeed([Capability.contributes(AppCapabilities.BlueprintDefinition, TranscriptionBlueprint)]));\n\nexport default blueprintDefinition;\n"],
|
|
5
|
+
"mappings": ";;;AAIA,YAAYA,YAAY;AAExB,SAASC,kBAAkB;AAC3B,SAASC,uBAAuB;AAIhC,SAASC,8BAA8B;AAEvC,IAAMC,sBAAsBH,WAAWI,WAGrC,MAAaC,eAAQ;EAACL,WAAWM,YAAYL,gBAAgBM,qBAAqBL,sBAAAA;CAAwB,CAAA;AAE5G,IAAA,+BAAeC;",
|
|
6
|
+
"names": ["Effect", "Capability", "AppCapabilities", "TranscriptionBlueprint", "blueprintDefinition", "makeModule", "succeed", "contributes", "BlueprintDefinition"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import "../chunk-J5LGTIGS.mjs";
|
|
2
|
+
|
|
3
|
+
// src/capabilities/index.ts
|
|
4
|
+
import { Capability } from "@dxos/app-framework";
|
|
5
|
+
var BlueprintDefinition = Capability.lazy("BlueprintDefinition", () => import("../blueprint-definition-HOXDG5QP.mjs"));
|
|
6
|
+
var TextContent = Capability.lazy("TextContent", () => import("../text-content-LHSUG2D2.mjs"));
|
|
7
|
+
var OperationHandler = Capability.lazy("OperationHandler", () => import("../operation-handler-NXMOAXFP.mjs"));
|
|
8
|
+
var ReactSurface = Capability.lazy("ReactSurface", () => import("../react-surface-QF4MUMWG.mjs"));
|
|
9
|
+
var Transcriber = Capability.lazy("Transcriber", () => import("../transcriber-M3R6HPTZ.mjs"));
|
|
10
|
+
export {
|
|
11
|
+
BlueprintDefinition,
|
|
12
|
+
OperationHandler,
|
|
13
|
+
ReactSurface,
|
|
14
|
+
TextContent,
|
|
15
|
+
Transcriber
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../../src/capabilities/index.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\n// eslint-disable-next-line unused-imports/no-unused-imports\nimport type { Blueprint, OperationHandlerSet } from '@dxos/compute';\n\nexport const BlueprintDefinition = Capability.lazy('BlueprintDefinition', () => import('./blueprint-definition'));\nexport const TextContent = Capability.lazy('TextContent', () => import('./text-content'));\nexport const OperationHandler = Capability.lazy<OperationHandlerSet.OperationHandlerSet>(\n 'OperationHandler',\n () => import('./operation-handler'),\n);\nexport const ReactSurface = Capability.lazy('ReactSurface', () => import('./react-surface'));\nexport const Transcriber = Capability.lazy('Transcriber', () => import('./transcriber'));\n"],
|
|
5
|
+
"mappings": ";;;AAIA,SAASA,kBAAkB;AAIpB,IAAMC,sBAAsBD,WAAWE,KAAK,uBAAuB,MAAM,OAAO,sCAAA,CAAA;AAChF,IAAMC,cAAcH,WAAWE,KAAK,eAAe,MAAM,OAAO,8BAAA,CAAA;AAChE,IAAME,mBAAmBJ,WAAWE,KACzC,oBACA,MAAM,OAAO,mCAAA,CAAA;AAER,IAAMG,eAAeL,WAAWE,KAAK,gBAAgB,MAAM,OAAO,+BAAA,CAAA;AAClE,IAAMI,cAAcN,WAAWE,KAAK,eAAe,MAAM,OAAO,6BAAA,CAAA;",
|
|
6
|
+
"names": ["Capability", "BlueprintDefinition", "lazy", "TextContent", "OperationHandler", "ReactSurface", "Transcriber"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
// src/meta.ts
|
|
2
|
+
import { trim } from "@dxos/util";
|
|
3
|
+
var meta = {
|
|
4
|
+
id: "org.dxos.plugin.transcription",
|
|
5
|
+
name: "Transcription",
|
|
6
|
+
description: trim`
|
|
7
|
+
Real-time voice-to-text transcription service for capturing spoken content.
|
|
8
|
+
Convert audio input into searchable text that integrates seamlessly with notes and documents.
|
|
9
|
+
`,
|
|
10
|
+
icon: "ph--microphone--regular",
|
|
11
|
+
iconHue: "sky",
|
|
12
|
+
source: "https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-transcription",
|
|
13
|
+
tags: [
|
|
14
|
+
"labs"
|
|
15
|
+
],
|
|
16
|
+
screenshots: []
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
export {
|
|
20
|
+
meta
|
|
21
|
+
};
|
|
22
|
+
//# sourceMappingURL=chunk-GL4RS533.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/meta.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2023 DXOS.org\n//\n\nimport { type Plugin } from '@dxos/app-framework';\nimport { trim } from '@dxos/util';\n\nexport const meta: Plugin.Meta = {\n id: 'org.dxos.plugin.transcription',\n name: 'Transcription',\n description: trim`\n Real-time voice-to-text transcription service for capturing spoken content.\n Convert audio input into searchable text that integrates seamlessly with notes and documents.\n `,\n icon: 'ph--microphone--regular',\n iconHue: 'sky',\n source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-transcription',\n tags: ['labs'],\n screenshots: [],\n};\n"],
|
|
5
|
+
"mappings": ";AAKA,SAASA,YAAY;AAEd,IAAMC,OAAoB;EAC/BC,IAAI;EACJC,MAAM;EACNC,aAAaJ;;;;EAIbK,MAAM;EACNC,SAAS;EACTC,QAAQ;EACRC,MAAM;IAAC;;EACPC,aAAa,CAAA;AACf;",
|
|
6
|
+
"names": ["trim", "meta", "id", "name", "description", "icon", "iconHue", "source", "tags", "screenshots"]
|
|
7
|
+
}
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
1
|
import {
|
|
3
2
|
mergeFloat64Arrays
|
|
4
|
-
} from "./chunk-
|
|
5
|
-
import {
|
|
6
|
-
TRANSCRIPTION_URL
|
|
7
|
-
} from "./chunk-4BFY6P2D.mjs";
|
|
3
|
+
} from "./chunk-KAEXRX3Y.mjs";
|
|
8
4
|
|
|
9
5
|
// src/transcriber/media-stream-recorder.ts
|
|
10
6
|
import { MediaRecorder, register } from "extendable-media-recorder";
|
|
@@ -13,13 +9,13 @@ import { synchronized } from "@dxos/async";
|
|
|
13
9
|
import { invariant } from "@dxos/invariant";
|
|
14
10
|
import { log } from "@dxos/log";
|
|
15
11
|
import { trace } from "@dxos/tracing";
|
|
12
|
+
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-transcription/src/transcriber/media-stream-recorder.ts";
|
|
16
13
|
function _ts_decorate(decorators, target, key, desc) {
|
|
17
14
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
18
15
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
19
16
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
20
17
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
21
18
|
}
|
|
22
|
-
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-transcription/src/transcriber/media-stream-recorder.ts";
|
|
23
19
|
var initializingPromise;
|
|
24
20
|
var initializeExtendableMediaRecorder = async () => {
|
|
25
21
|
const { connect } = await import("extendable-media-recorder-wav-encoder");
|
|
@@ -55,12 +51,7 @@ var MediaStreamRecorder = class {
|
|
|
55
51
|
async start() {
|
|
56
52
|
await (initializingPromise ??= initializeExtendableMediaRecorder()).catch((err) => log.info("initializeExtendableMediaRecorder", {
|
|
57
53
|
err
|
|
58
|
-
}, {
|
|
59
|
-
F: __dxlog_file,
|
|
60
|
-
L: 69,
|
|
61
|
-
S: this,
|
|
62
|
-
C: (f, a) => f(...a)
|
|
63
|
-
}));
|
|
54
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 48, S: this }));
|
|
64
55
|
if (!this._mediaRecorder) {
|
|
65
56
|
const stream = new MediaStream([
|
|
66
57
|
this._mediaStreamTrack
|
|
@@ -72,15 +63,7 @@ var MediaStreamRecorder = class {
|
|
|
72
63
|
if (this._mediaRecorder.state === "recording") {
|
|
73
64
|
return;
|
|
74
65
|
}
|
|
75
|
-
invariant(this._onChunk, "MediaStreamRecorder: onChunk is not set", {
|
|
76
|
-
F: __dxlog_file,
|
|
77
|
-
L: 80,
|
|
78
|
-
S: this,
|
|
79
|
-
A: [
|
|
80
|
-
"this._onChunk",
|
|
81
|
-
"'MediaStreamRecorder: onChunk is not set'"
|
|
82
|
-
]
|
|
83
|
-
});
|
|
66
|
+
invariant(this._onChunk, "MediaStreamRecorder: onChunk is not set", { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 62, S: this, A: ["this._onChunk", "'MediaStreamRecorder: onChunk is not set'"] });
|
|
84
67
|
this._mediaRecorder.ondataavailable = (event) => this._ondataavailable(event);
|
|
85
68
|
this._mediaRecorder.start(this._config.interval);
|
|
86
69
|
}
|
|
@@ -107,12 +90,7 @@ var MediaStreamRecorder = class {
|
|
|
107
90
|
...uint8Array
|
|
108
91
|
]));
|
|
109
92
|
} else {
|
|
110
|
-
log.warn("MediaStreamRecorder: no header", void 0, {
|
|
111
|
-
F: __dxlog_file,
|
|
112
|
-
L: 111,
|
|
113
|
-
S: this,
|
|
114
|
-
C: (f, a) => f(...a)
|
|
115
|
-
});
|
|
93
|
+
log.warn("MediaStreamRecorder: no header", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 90, S: this });
|
|
116
94
|
return;
|
|
117
95
|
}
|
|
118
96
|
this._onChunk({
|
|
@@ -134,13 +112,14 @@ import { DeferredTask, Trigger } from "@dxos/async";
|
|
|
134
112
|
import { LifecycleState, Resource } from "@dxos/context";
|
|
135
113
|
import { log as log2 } from "@dxos/log";
|
|
136
114
|
import { trace as trace2 } from "@dxos/tracing";
|
|
115
|
+
import { TRANSCRIPTION_URL } from "#types";
|
|
116
|
+
var __dxlog_file2 = "/__w/dxos/dxos/packages/plugins/plugin-transcription/src/transcriber/transcriber.ts";
|
|
137
117
|
function _ts_decorate2(decorators, target, key, desc) {
|
|
138
118
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
139
119
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
140
120
|
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
141
121
|
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
142
122
|
}
|
|
143
|
-
var __dxlog_file2 = "/__w/dxos/dxos/packages/plugins/plugin-transcription/src/transcriber/transcriber.ts";
|
|
144
123
|
var Transcriber = class extends Resource {
|
|
145
124
|
_audioChunks = [];
|
|
146
125
|
_lastUsedTimestamp = 0;
|
|
@@ -150,44 +129,31 @@ var Transcriber = class extends Resource {
|
|
|
150
129
|
_config;
|
|
151
130
|
_recorder;
|
|
152
131
|
_onSegments;
|
|
132
|
+
_transcribeFn;
|
|
153
133
|
_recording = false;
|
|
154
134
|
_transcribeTask = void 0;
|
|
155
|
-
constructor({ config, recorder, onSegments }) {
|
|
135
|
+
constructor({ config, recorder, onSegments, transcribe }) {
|
|
156
136
|
super();
|
|
157
137
|
this._config = config;
|
|
158
138
|
this._recorder = recorder;
|
|
159
139
|
this._onSegments = onSegments;
|
|
140
|
+
this._transcribeFn = transcribe;
|
|
160
141
|
}
|
|
161
142
|
async _open(ctx) {
|
|
162
|
-
log2.info("opening", void 0, {
|
|
163
|
-
F: __dxlog_file2,
|
|
164
|
-
L: 102,
|
|
165
|
-
S: this,
|
|
166
|
-
C: (f, a) => f(...a)
|
|
167
|
-
});
|
|
143
|
+
log2.info("opening", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file2, L: 41, S: this });
|
|
168
144
|
this._recorder.setOnChunk((chunk) => this._saveAudioChunk(chunk));
|
|
169
145
|
await this._recorder.start();
|
|
170
146
|
this._transcribeTask = new DeferredTask(ctx, async () => this._transcribe());
|
|
171
147
|
this._openTrigger.wake();
|
|
172
148
|
}
|
|
173
149
|
async _close() {
|
|
174
|
-
log2.info("closing", void 0, {
|
|
175
|
-
F: __dxlog_file2,
|
|
176
|
-
L: 110,
|
|
177
|
-
S: this,
|
|
178
|
-
C: (f, a) => f(...a)
|
|
179
|
-
});
|
|
150
|
+
log2.info("closing", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file2, L: 48, S: this });
|
|
180
151
|
this._recording = false;
|
|
181
152
|
this._transcribeTask = void 0;
|
|
182
153
|
await this._recorder.stop();
|
|
183
154
|
}
|
|
184
155
|
startChunksRecording() {
|
|
185
|
-
log2.info("starting", void 0, {
|
|
186
|
-
F: __dxlog_file2,
|
|
187
|
-
L: 117,
|
|
188
|
-
S: this,
|
|
189
|
-
C: (f, a) => f(...a)
|
|
190
|
-
});
|
|
156
|
+
log2.info("starting", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file2, L: 54, S: this });
|
|
191
157
|
if (this._lifecycleState !== LifecycleState.OPEN) {
|
|
192
158
|
return;
|
|
193
159
|
}
|
|
@@ -199,22 +165,12 @@ var Transcriber = class extends Resource {
|
|
|
199
165
|
}
|
|
200
166
|
this._recording = false;
|
|
201
167
|
this._transcribeTask?.schedule();
|
|
202
|
-
log2.info("stopped", void 0, {
|
|
203
|
-
F: __dxlog_file2,
|
|
204
|
-
L: 132,
|
|
205
|
-
S: this,
|
|
206
|
-
C: (f, a) => f(...a)
|
|
207
|
-
});
|
|
168
|
+
log2.info("stopped", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file2, L: 66, S: this });
|
|
208
169
|
}
|
|
209
170
|
_saveAudioChunk(chunk) {
|
|
210
171
|
log2("saving audio chunk", {
|
|
211
172
|
chunk
|
|
212
|
-
}, {
|
|
213
|
-
F: __dxlog_file2,
|
|
214
|
-
L: 136,
|
|
215
|
-
S: this,
|
|
216
|
-
C: (f, a) => f(...a)
|
|
217
|
-
});
|
|
173
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file2, L: 69, S: this });
|
|
218
174
|
this._audioChunks.push(chunk);
|
|
219
175
|
if (!this._recording && (!this._transcribeTask || !this._transcribeTask.scheduled) && this._audioChunks.length >= this._config.prefixBufferChunksAmount) {
|
|
220
176
|
this._audioChunks = this._dropOldChunks();
|
|
@@ -225,12 +181,7 @@ var Transcriber = class extends Resource {
|
|
|
225
181
|
async _transcribe() {
|
|
226
182
|
log2("transcribing", {
|
|
227
183
|
chunks: this._audioChunks.length
|
|
228
|
-
}, {
|
|
229
|
-
F: __dxlog_file2,
|
|
230
|
-
L: 152,
|
|
231
|
-
S: this,
|
|
232
|
-
C: (f, a) => f(...a)
|
|
233
|
-
});
|
|
184
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file2, L: 81, S: this });
|
|
234
185
|
const chunks = this._audioChunks;
|
|
235
186
|
this._audioChunks = this._dropOldChunks();
|
|
236
187
|
if (chunks.length === 0) {
|
|
@@ -257,54 +208,41 @@ var Transcriber = class extends Resource {
|
|
|
257
208
|
}
|
|
258
209
|
async _fetchTranscription(audio) {
|
|
259
210
|
if (audio.length === 0) {
|
|
260
|
-
this._audioChunks = [];
|
|
261
211
|
throw new Error("No audio to send for transcribing");
|
|
262
212
|
}
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
213
|
+
let segments;
|
|
214
|
+
if (this._transcribeFn) {
|
|
215
|
+
segments = await this._transcribeFn(audio);
|
|
216
|
+
} else {
|
|
217
|
+
const endpoint = this._config.endpoint ?? TRANSCRIPTION_URL;
|
|
218
|
+
const response = await fetch(`${endpoint}/transcribe`, {
|
|
219
|
+
method: "POST",
|
|
220
|
+
body: JSON.stringify({
|
|
221
|
+
audio
|
|
222
|
+
}),
|
|
223
|
+
headers: {
|
|
224
|
+
"Content-Type": "application/json"
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
if (!response.ok) {
|
|
228
|
+
throw new Error(`Transcription failed: ${response.statusText}`);
|
|
270
229
|
}
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
throw new Error(
|
|
230
|
+
({ segments } = await response.json());
|
|
231
|
+
}
|
|
232
|
+
if (!Array.isArray(segments)) {
|
|
233
|
+
throw new Error("Transcription response payload is invalid");
|
|
275
234
|
}
|
|
276
|
-
const { segments } = await response.json();
|
|
277
235
|
log2.info("transcription response", {
|
|
278
|
-
segments: segments.length
|
|
279
|
-
|
|
280
|
-
}, {
|
|
281
|
-
F: __dxlog_file2,
|
|
282
|
-
L: 216,
|
|
283
|
-
S: this,
|
|
284
|
-
C: (f, a) => f(...a)
|
|
285
|
-
});
|
|
236
|
+
segments: segments.length
|
|
237
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file2, L: 134, S: this });
|
|
286
238
|
return segments;
|
|
287
239
|
}
|
|
288
240
|
_alignSegments(segments, originalChunks) {
|
|
289
|
-
const
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
return {
|
|
293
|
-
...segment,
|
|
294
|
-
words,
|
|
295
|
-
text: words.map((word) => word.word).join(""),
|
|
296
|
-
start: words.at(0)?.start ?? segment.end
|
|
297
|
-
};
|
|
298
|
-
}).filter((segment) => segment.words.length > 0);
|
|
299
|
-
if (filteredSegments.length === 0) {
|
|
300
|
-
return [];
|
|
241
|
+
const result = alignWhisperSegments(segments, originalChunks, this._lastUsedTimestamp);
|
|
242
|
+
if (result.lastUsedTimestamp !== void 0) {
|
|
243
|
+
this._lastUsedTimestamp = result.lastUsedTimestamp;
|
|
301
244
|
}
|
|
302
|
-
|
|
303
|
-
return filteredSegments.map((segment) => ({
|
|
304
|
-
_tag: "transcript",
|
|
305
|
-
started: new Date(zeroTimestamp + segment.start * 1e3).toISOString(),
|
|
306
|
-
text: segment.text.trim()
|
|
307
|
-
}));
|
|
245
|
+
return result.transcripts;
|
|
308
246
|
}
|
|
309
247
|
};
|
|
310
248
|
_ts_decorate2([
|
|
@@ -317,6 +255,36 @@ _ts_decorate2([
|
|
|
317
255
|
showInBrowserTimeline: true
|
|
318
256
|
})
|
|
319
257
|
], Transcriber.prototype, "_fetchTranscription", null);
|
|
258
|
+
var alignWhisperSegments = (segments, originalChunks, lastUsedTimestamp) => {
|
|
259
|
+
if (originalChunks.length === 0) {
|
|
260
|
+
return {
|
|
261
|
+
transcripts: []
|
|
262
|
+
};
|
|
263
|
+
}
|
|
264
|
+
const zeroTimestamp = originalChunks[0].timestamp;
|
|
265
|
+
const filteredSegments = segments.filter((segment) => zeroTimestamp + segment.end * 1e3 >= lastUsedTimestamp).map((segment) => {
|
|
266
|
+
const words = segment.words.filter((word) => zeroTimestamp + word.start * 1e3 >= lastUsedTimestamp);
|
|
267
|
+
return {
|
|
268
|
+
...segment,
|
|
269
|
+
words,
|
|
270
|
+
text: words.map((word) => word.word).join(""),
|
|
271
|
+
start: words.at(0)?.start ?? segment.end
|
|
272
|
+
};
|
|
273
|
+
}).filter((segment) => segment.words.length > 0);
|
|
274
|
+
if (filteredSegments.length === 0) {
|
|
275
|
+
return {
|
|
276
|
+
transcripts: []
|
|
277
|
+
};
|
|
278
|
+
}
|
|
279
|
+
return {
|
|
280
|
+
transcripts: filteredSegments.map((segment) => ({
|
|
281
|
+
_tag: "transcript",
|
|
282
|
+
started: new Date(zeroTimestamp + segment.start * 1e3).toISOString(),
|
|
283
|
+
text: segment.text.trim()
|
|
284
|
+
})),
|
|
285
|
+
lastUsedTimestamp: zeroTimestamp + filteredSegments.at(-1).end * 1e3
|
|
286
|
+
};
|
|
287
|
+
};
|
|
320
288
|
|
|
321
289
|
// src/transcriber/transcription-manager.ts
|
|
322
290
|
import { Atom } from "@effect-atom/atom-react";
|
|
@@ -456,6 +424,7 @@ _ts_decorate3([
|
|
|
456
424
|
export {
|
|
457
425
|
MediaStreamRecorder,
|
|
458
426
|
Transcriber,
|
|
427
|
+
alignWhisperSegments,
|
|
459
428
|
TranscriptionManager
|
|
460
429
|
};
|
|
461
|
-
//# sourceMappingURL=chunk-
|
|
430
|
+
//# sourceMappingURL=chunk-LS3R7EQI.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/transcriber/media-stream-recorder.ts", "../../../src/transcriber/transcriber.ts", "../../../src/transcriber/transcription-manager.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type IBlobEvent, type IMediaRecorder, MediaRecorder, register } from 'extendable-media-recorder';\nimport { WaveFile } from 'wavefile';\n\nimport { synchronized } from '@dxos/async';\nimport { invariant } from '@dxos/invariant';\nimport { log } from '@dxos/log';\nimport { trace } from '@dxos/tracing';\n\nimport { type AudioChunk, type AudioRecorder, type WavConfig } from './audio-recorder';\n\nlet initializingPromise: Promise<void> | undefined;\n\nconst initializeExtendableMediaRecorder = async () => {\n const { connect } = await import('extendable-media-recorder-wav-encoder');\n await register(await connect());\n};\n\nexport type MediaStreamRecorderProps = {\n mediaStreamTrack: MediaStreamTrack;\n config: {\n interval: number;\n };\n};\n\n/**\n * Recorder that uses the MediaContext API and AudioNode API to record audio.\n *\n * It records MediaStream using https://www.npmjs.com/package/extendable-media-recorder.\n */\n@trace.resource()\nexport class MediaStreamRecorder implements AudioRecorder {\n private readonly _mediaStreamTrack: MediaStreamTrack;\n /**\n * Default MediaRecorder implementation do not support wav encoding.\n */\n private readonly _config: MediaStreamRecorderProps['config'];\n private _mediaRecorder?: IMediaRecorder = undefined;\n private _header?: Uint8Array = undefined;\n private _onChunk?: (chunk: AudioChunk) => void;\n\n constructor({ mediaStreamTrack, config }: MediaStreamRecorderProps) {\n this._mediaStreamTrack = mediaStreamTrack;\n this._config = config;\n }\n\n get wavConfig(): WavConfig {\n const settings = this._mediaStreamTrack.getSettings();\n return {\n channels: settings.channelCount ?? 1,\n sampleRate: settings.sampleRate ?? 16000,\n bitDepthCode: settings.sampleSize ? String(settings.sampleSize) : '16',\n };\n }\n\n get mediaStreamTrack() {\n return this._mediaStreamTrack;\n }\n\n setOnChunk(onChunk: (chunk: AudioChunk) => void): void {\n this._onChunk = onChunk;\n }\n\n async start(): Promise<void> {\n await (initializingPromise ??= initializeExtendableMediaRecorder()).catch((err) =>\n log.info('initializeExtendableMediaRecorder', { err }),\n );\n\n if (!this._mediaRecorder) {\n const stream = new MediaStream([this._mediaStreamTrack]);\n this._mediaRecorder = new MediaRecorder(stream, { mimeType: 'audio/wav' });\n }\n\n if (this._mediaRecorder.state === 'recording') {\n return;\n }\n invariant(this._onChunk, 'MediaStreamRecorder: onChunk is not set');\n this._mediaRecorder.ondataavailable = (event) => this._ondataavailable(event);\n this._mediaRecorder.start(this._config.interval);\n }\n\n async stop(): Promise<void> {\n if (this._mediaRecorder?.state !== 'recording') {\n return;\n }\n this._mediaRecorder.stop();\n }\n\n @synchronized\n private async _ondataavailable(event: IBlobEvent): Promise<void> {\n const blob = event.data;\n const uint8Array = new Uint8Array(await blob.arrayBuffer());\n\n // First chunk from the MediaRecorder has a header.\n const isHeader =\n uint8Array[0] === 0x52 && // R\n uint8Array[1] === 0x49 && // I\n uint8Array[2] === 0x46 && // F\n uint8Array[3] === 0x46; // F\n let wav: WaveFile;\n\n if (isHeader) {\n wav = new WaveFile(uint8Array);\n this._header = uint8Array.slice(0, 44);\n } else if (this._header) {\n wav = new WaveFile(new Uint8Array([...this._header, ...uint8Array]));\n } else {\n log.warn('MediaStreamRecorder: no header');\n return;\n }\n\n this._onChunk!({\n timestamp: Date.now(),\n data: wav.getSamples(),\n });\n }\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { WaveFile } from 'wavefile';\n\nimport { DeferredTask, Trigger } from '@dxos/async';\nimport { type Context, LifecycleState, Resource } from '@dxos/context';\nimport { log } from '@dxos/log';\nimport { trace } from '@dxos/tracing';\nimport { type ContentBlock } from '@dxos/types';\n\nimport { TRANSCRIPTION_URL } from '#types';\n\nimport { mergeFloat64Arrays } from '../util';\nimport { type AudioChunk, type AudioRecorder } from './audio-recorder';\n\nexport type WhisperWord = {\n word: string;\n\n /**\n * Time in seconds from the start of the audio.\n */\n start: number;\n\n /**\n * Time in seconds from the start of the audio.\n */\n end: number;\n};\n\nexport type WhisperSegment = {\n text: string;\n\n /**\n * Time in seconds from the start of the audio.\n */\n start: number;\n\n /**\n * Time in seconds from the start of the audio.\n */\n end: number;\n\n /**\n * Probability of no speech in the segment.\n */\n no_speech_prob: number;\n\n words: WhisperWord[];\n};\n\nexport type TranscribeConfig = {\n /**\n * Number of chunks to transcribe automatically after.\n */\n transcribeAfterChunksAmount: number;\n\n /**\n * Number of chunks to save before the user starts speaking.\n * This is needed to catch the beginning of the user's speech.\n */\n prefixBufferChunksAmount: number;\n\n /**\n * Override the transcription endpoint base URL.\n * Defaults to the DXOS calls service.\n */\n endpoint?: string;\n};\n\n/**\n * Function that converts a base64-encoded WAV payload into Whisper segments.\n * Allows callers to swap in alternative providers or mock the transport.\n */\nexport type TranscribeFn = (audio: string) => Promise<WhisperSegment[]>;\n\nexport type TranscriberProps = {\n config: TranscribeConfig;\n recorder: AudioRecorder;\n /**\n * Callback to handle the transcribed segments, after all segment transformers are applied.\n * @param segments - The transcribed segments.\n */\n onSegments: (segments: ContentBlock.Transcript[]) => Promise<void>;\n /**\n * Optional override of the transcription transport. When provided, supersedes `config.endpoint`.\n */\n transcribe?: TranscribeFn;\n};\n\n/**\n * Handles transcription of audio chunks.\n * If user is not speaking, the last `minChunksAmount` chunks are saved and transcribed.\n * If user is speaking, the chunks are added to the buffer until the user is done talking.\n */\nexport class Transcriber extends Resource {\n private _audioChunks: AudioChunk[] = [];\n private _lastUsedTimestamp = 0;\n\n private readonly _openTrigger = new Trigger({ autoReset: true });\n\n private readonly _config: TranscribeConfig;\n private readonly _recorder: AudioRecorder;\n private readonly _onSegments: TranscriberProps['onSegments'];\n private readonly _transcribeFn?: TranscribeFn;\n\n private _recording = false;\n private _transcribeTask?: DeferredTask = undefined;\n\n constructor({ config, recorder, onSegments, transcribe }: TranscriberProps) {\n super();\n this._config = config;\n this._recorder = recorder;\n this._onSegments = onSegments;\n this._transcribeFn = transcribe;\n }\n\n protected override async _open(ctx: Context): Promise<void> {\n log.info('opening');\n this._recorder.setOnChunk((chunk) => this._saveAudioChunk(chunk));\n await this._recorder.start();\n this._transcribeTask = new DeferredTask(ctx, async () => this._transcribe());\n this._openTrigger.wake();\n }\n\n protected override async _close(): Promise<void> {\n log.info('closing');\n this._recording = false;\n this._transcribeTask = undefined;\n await this._recorder.stop();\n }\n\n startChunksRecording(): void {\n log.info('starting');\n if (this._lifecycleState !== LifecycleState.OPEN) {\n return;\n }\n\n this._recording = true;\n }\n\n stopChunksRecording(): void {\n if (this._lifecycleState !== LifecycleState.OPEN || !this._recording) {\n return;\n }\n\n this._recording = false;\n this._transcribeTask?.schedule();\n log.info('stopped');\n }\n\n private _saveAudioChunk(chunk: AudioChunk): void {\n log('saving audio chunk', { chunk });\n this._audioChunks.push(chunk);\n\n // Clean the buffer if the user is not speaking and the transcription task is not scheduled.\n if (\n !this._recording &&\n (!this._transcribeTask || !this._transcribeTask.scheduled) &&\n this._audioChunks.length >= this._config.prefixBufferChunksAmount\n ) {\n this._audioChunks = this._dropOldChunks();\n } else if (this._audioChunks.length >= this._config.transcribeAfterChunksAmount && this._recording) {\n this._transcribeTask?.schedule();\n }\n }\n\n private async _transcribe(): Promise<void> {\n log('transcribing', { chunks: this._audioChunks.length });\n const chunks = this._audioChunks;\n this._audioChunks = this._dropOldChunks();\n if (chunks.length === 0) {\n return;\n }\n\n const audio = await this._mergeAudioChunks(chunks);\n const segments = await this._fetchTranscription(audio);\n if (!Array.isArray(segments) || segments.length === 0) {\n return;\n }\n\n const alignedSegments = this._alignSegments(segments, chunks);\n if (alignedSegments.length > 0) {\n await this._onSegments(alignedSegments);\n }\n }\n\n private _dropOldChunks(): AudioChunk[] {\n return this._config.prefixBufferChunksAmount > 0\n ? this._audioChunks.slice(-this._config.prefixBufferChunksAmount)\n : [];\n }\n\n @trace.span({ showInBrowserTimeline: true })\n private async _mergeAudioChunks(chunks: AudioChunk[]): Promise<string> {\n const file = new WaveFile();\n const wavConfig = this._recorder.wavConfig;\n\n file.fromScratch(\n wavConfig.channels,\n wavConfig.sampleRate,\n wavConfig.bitDepthCode,\n mergeFloat64Arrays(chunks.map(({ data }) => data)),\n );\n\n return file.toBase64();\n }\n\n @trace.span({ showInBrowserTimeline: true })\n private async _fetchTranscription(audio: string): Promise<WhisperSegment[]> {\n if (audio.length === 0) {\n throw new Error('No audio to send for transcribing');\n }\n\n let segments: unknown;\n if (this._transcribeFn) {\n segments = await this._transcribeFn(audio);\n } else {\n const endpoint = this._config.endpoint ?? TRANSCRIPTION_URL;\n const response = await fetch(`${endpoint}/transcribe`, {\n method: 'POST',\n body: JSON.stringify({ audio }),\n headers: {\n 'Content-Type': 'application/json',\n },\n });\n\n if (!response.ok) {\n throw new Error(`Transcription failed: ${response.statusText}`);\n }\n\n ({ segments } = (await response.json()) as { segments?: unknown });\n }\n\n if (!Array.isArray(segments)) {\n throw new Error('Transcription response payload is invalid');\n }\n\n log.info('transcription response', { segments: segments.length });\n\n return segments as WhisperSegment[];\n }\n\n private _alignSegments(segments: WhisperSegment[], originalChunks: AudioChunk[]): ContentBlock.Transcript[] {\n const result = alignWhisperSegments(segments, originalChunks, this._lastUsedTimestamp);\n if (result.lastUsedTimestamp !== undefined) {\n this._lastUsedTimestamp = result.lastUsedTimestamp;\n }\n return result.transcripts;\n }\n}\n\n/**\n * Pure helper that filters and absolute-timestamps Whisper segments against a chunk timeline.\n * Exported for testing.\n *\n * @param segments - Raw segments returned by the Whisper service for `originalChunks`.\n * @param originalChunks - Chunks fed into the transcription request (used for the zero timestamp).\n * @param lastUsedTimestamp - Most recent absolute timestamp already emitted; segments whose end\n * falls strictly before this point are deduped out, as are individual words whose start does.\n */\nexport const alignWhisperSegments = (\n segments: WhisperSegment[],\n originalChunks: AudioChunk[],\n lastUsedTimestamp: number,\n): { transcripts: ContentBlock.Transcript[]; lastUsedTimestamp?: number } => {\n if (originalChunks.length === 0) {\n return { transcripts: [] };\n }\n\n const zeroTimestamp = originalChunks[0].timestamp;\n\n const filteredSegments = segments\n .filter((segment) => zeroTimestamp + segment.end * 1_000 >= lastUsedTimestamp)\n .map((segment) => {\n const words = segment.words.filter((word) => zeroTimestamp + word.start * 1_000 >= lastUsedTimestamp);\n return {\n ...segment,\n words,\n text: words.map((word) => word.word).join(''),\n start: words.at(0)?.start ?? segment.end,\n };\n })\n .filter((segment) => segment.words.length > 0);\n\n if (filteredSegments.length === 0) {\n return { transcripts: [] };\n }\n\n return {\n transcripts: filteredSegments.map((segment) => ({\n _tag: 'transcript',\n started: new Date(zeroTimestamp + segment.start * 1_000).toISOString(),\n text: segment.text.trim(),\n })),\n lastUsedTimestamp: zeroTimestamp + filteredSegments.at(-1)!.end * 1_000,\n };\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport { Atom, type Registry } from '@effect-atom/atom-react';\n\nimport { synchronized } from '@dxos/async';\nimport { Resource } from '@dxos/context';\nimport { Obj } from '@dxos/echo';\nimport { type Queue } from '@dxos/echo-db';\nimport { type EdgeHttpClient } from '@dxos/react-edge-client';\nimport { type ContentBlock, Message } from '@dxos/types';\n\nimport { MediaStreamRecorder } from './media-stream-recorder';\nimport { Transcriber } from './transcriber';\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\nexport type TranscriptMessageEnricher = (message: Message.Message) => Promise<Message.Message>;\n\nexport type TranscriptionManagerOptions = {\n edgeClient: EdgeHttpClient;\n registry: Registry.Registry;\n\n /**\n * Enrich the message before it is written to the transcription queue.\n */\n messageEnricher?: TranscriptMessageEnricher;\n};\n\n/**\n * Manages transcription state for a meeting.\n */\nexport class TranscriptionManager extends Resource {\n private readonly _edgeClient: EdgeHttpClient;\n private readonly _messageEnricher?: TranscriptMessageEnricher;\n private readonly _registry: Registry.Registry;\n private _audioStreamTrack?: MediaStreamTrack = undefined;\n private _identityDid?: string = undefined;\n private _mediaRecorder?: MediaStreamRecorder = undefined;\n private _transcriber?: Transcriber = undefined;\n private _queue?: Queue<Message.Message> = undefined;\n private _enabledAtom = Atom.make(false);\n\n constructor(options: TranscriptionManagerOptions) {\n super();\n this._edgeClient = options.edgeClient;\n this._messageEnricher = options.messageEnricher;\n this._registry = options.registry;\n }\n\n get enabled(): Atom.Atom<boolean> {\n return this._enabledAtom;\n }\n\n getEnabled(): boolean {\n return this._registry.get(this._enabledAtom);\n }\n\n setQueue(queue: Queue<Message.Message>): this {\n this._queue = queue;\n return this;\n }\n\n setIdentityDid(did: string): this {\n if (this._identityDid !== did) {\n this._identityDid = did;\n }\n return this;\n }\n\n setRecording(recording?: boolean): this {\n if (!this.isOpen || !this.getEnabled()) {\n return this;\n }\n\n if (recording) {\n this._transcriber?.startChunksRecording();\n } else {\n this._transcriber?.stopChunksRecording();\n }\n return this;\n }\n\n async setEnabled(enabled: boolean): Promise<void> {\n if (this.getEnabled() === enabled) {\n return;\n }\n\n this._registry.set(this._enabledAtom, enabled ?? false);\n if (enabled) {\n await this._maybeRestartTranscriber();\n } else {\n await this._stopTranscriber();\n }\n }\n\n @synchronized\n async setAudioTrack(track?: MediaStreamTrack): Promise<void> {\n if (this._audioStreamTrack === track) {\n return;\n }\n\n this._audioStreamTrack = track;\n await this._maybeRestartTranscriber();\n }\n\n protected override async _open(): Promise<void> {\n await this._maybeRestartTranscriber();\n }\n\n protected override async _close(): Promise<void> {\n await this._stopTranscriber();\n }\n\n private async _maybeRestartTranscriber(): Promise<void> {\n if (!this._audioStreamTrack || !this.getEnabled() || !this.isOpen) {\n return;\n }\n\n // Reinitialize transcriber if queue or media stream track has changed.\n let needReinit = false;\n if (this._audioStreamTrack !== this._mediaRecorder?.mediaStreamTrack) {\n this._mediaRecorder = new MediaStreamRecorder({\n mediaStreamTrack: this._audioStreamTrack,\n config: { interval: RECORD_INTERVAL },\n });\n needReinit = true;\n }\n if (needReinit) {\n await this._transcriber?.close();\n this._transcriber = new Transcriber({\n config: {\n transcribeAfterChunksAmount: TRANSCRIBE_AFTER_CHUNKS_AMOUNT,\n prefixBufferChunksAmount: PREFIXED_CHUNKS_AMOUNT,\n },\n recorder: this._mediaRecorder,\n onSegments: (segments) => this._onSegments(segments),\n });\n\n await this._transcriber?.open();\n }\n }\n\n private async _stopTranscriber(): Promise<void> {\n await this._transcriber?.close();\n }\n\n private async _onSegments(segments: ContentBlock.Transcript[]): Promise<void> {\n if (!this.isOpen || !this._queue) {\n return;\n }\n\n let block = Obj.make(Message.Message, {\n created: new Date().toISOString(),\n blocks: segments,\n sender: { identityDid: this._identityDid },\n });\n\n if (this._messageEnricher) {\n block = await this._messageEnricher(block);\n }\n\n await this._queue.append([block]);\n }\n}\n"],
|
|
5
|
+
"mappings": ";;;;;AAKA,SAASA,eAAQ,gBAAmB;AAEpC,SAASC,gBAAY;AACrB,SAASC,oBAAiB;AAC1B,SAASC,iBAAW;AACpB,SAASC,WAAK;AAId,SAAIC,aAAAA;AAdJ,IAAE,eAAA;;;;;;AAIF;AAYA,IAAA;IACE,oCAAiC,YAAA;AACjC,QAAMC,EAAAA,QAAS,IAAA,MAAMC,OAAAA,uCAAAA;AACvB,QAAA,SAAA,MAAA,QAAA,CAAA;AAeA;AACmBC,IAAAA,sBAAAA,MAAoC;EACrD;;;;EAIQC;EACAC,iBAAuBC;EACvBC,UAAuC;EAE/C;cACOJ,EAAAA,kBAAoBK,OAAAA,GAAAA;AACzB,SAAKC,oBAAUC;AACjB,SAAA,UAAA;EAEA;MACE,YAAMC;AACN,UAAA,WAAO,KAAA,kBAAA,YAAA;WACLC;MACAC,UAAAA,SAAYF,gBAAuB;MACnCG,YAAAA,SAAcH,cAAmB;MACnC,cAAA,SAAA,aAAA,OAAA,SAAA,UAAA,IAAA;IACF;EAEA;MACE,mBAAYR;AACd,WAAA,KAAA;EAEAY;aACOR,SAAWS;AAClB,SAAA,WAAA;EAEA;QACE,QAAOhB;mCAC2CiB,kCAAAA,GAAAA,MAAAA,CAAAA,QAAAA,IAAAA,KAAAA,qCAAAA;MAAI;IAGlD,GAAC,EAAA,YAAKb,YAAgB,GAAA,cAAA,GAAA,IAAA,GAAA,KAAA,CAAA,CAAA;QACxB,CAAA,KAAMc,gBAAaC;YAAa,SAAKhB,IAAAA,YAAiB;QAAC,KAAA;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AKlC,eAAe,IAAImC,YAAY;QAClCH,QAAQ;UACNI,6BAA6B9C;UAC7B+C,0BAA0BhD;QAC5B;QACAiD,UAAU,KAAKvC;QACfwC,YAAY,CAACC,aAAa,KAAKC,YAAYD,QAAAA;MAC7C,CAAA;AAEA,YAAM,KAAKxC,cAAc0C,KAAAA;IAC3B;EACF;EAEA,MAAclB,mBAAkC;AAC9C,UAAM,KAAKxB,cAAckC,MAAAA;EAC3B;EAEA,MAAcO,YAAYD,UAAoD;AAC5E,QAAI,CAAC,KAAKtB,UAAU,CAAC,KAAKjB,QAAQ;AAChC;IACF;AAEA,QAAI0C,QAAQC,IAAIxC,KAAKyC,QAAQA,SAAS;MACpCC,UAAS,oBAAIC,KAAAA,GAAOC,YAAW;MAC/BC,QAAQT;MACRU,QAAQ;QAAEC,aAAa,KAAKrD;MAAa;IAC3C,CAAA;AAEA,QAAI,KAAKJ,kBAAkB;AACzBiD,cAAQ,MAAM,KAAKjD,iBAAiBiD,KAAAA;IACtC;AAEA,UAAM,KAAK1C,OAAOmD,OAAO;MAACT;KAAM;EAClC;AACF;;;;",
|
|
6
|
+
"names": ["WaveFile", "synchronized", "invariant", "log", "trace", "initializingPromise", "register", "connect", "_mediaStreamTrack", "_mediaRecorder", "_header", "undefined", "_onChunk", "mediaStreamTrack", "_config", "config", "settings", "channels", "sampleRate", "bitDepthCode", "setOnChunk", "onChunk", "err", "stream", "MediaStream", "mimeType", "ondataavailable", "_ondataavailable", "event", "start", "interval", "data", "uint8Array", "wav", "isHeader", "slice", "timestamp", "getSamples", "resource", "DeferredTask", "Trigger", "LifecycleState", "log", "trace", "TRANSCRIPTION_URL", "mergeFloat64Arrays", "__dxlog_file", "_audioChunks", "_lastUsedTimestamp", "_openTrigger", "Trigger", "_config", "_recorder", "_onSegments", "_transcribeFn", "_recording", "_transcribeTask", "config", "log", "setOnChunk", "chunk", "_saveAudioChunk", "DeferredTask", "stop", "startChunksRecording", "_lifecycleState", "LifecycleState", "stopChunksRecording", "info", "_dropOldChunks", "length", "schedule", "chunks", "segments", "_fetchTranscription", "audio", "Array", "isArray", "alignedSegments", "WaveFile", "wavConfig", "file", "fromScratch", "channels", "toBase64", "response", "method", "body", "JSON", "headers", "Error", "_alignSegments", "result", "alignWhisperSegments", "lastUsedTimestamp", "undefined", "span", "showInBrowserTimeline", "originalChunks", "transcripts", "filteredSegments", "filter", "segment", "word", "zeroTimestamp", "start", "words", "text", "_tag", "started", "Atom", "synchronized", "Resource", "Obj", "Message", "RECORD_INTERVAL", "PREFIXED_CHUNKS_AMOUNT", "TRANSCRIBE_AFTER_CHUNKS_AMOUNT", "TranscriptionManager", "Resource", "_edgeClient", "_messageEnricher", "_registry", "_audioStreamTrack", "undefined", "_identityDid", "_mediaRecorder", "_transcriber", "_queue", "_enabledAtom", "Atom", "make", "options", "edgeClient", "messageEnricher", "registry", "enabled", "getEnabled", "get", "setQueue", "queue", "setIdentityDid", "did", "setRecording", "recording", "isOpen", "startChunksRecording", "stopChunksRecording", "setEnabled", "set", "_maybeRestartTranscriber", "_stopTranscriber", "setAudioTrack", "track", "_open", "_close", "needReinit", "mediaStreamTrack", "MediaStreamRecorder", "config", "interval", "close", "Transcriber", "transcribeAfterChunksAmount", "prefixBufferChunksAmount", "recorder", "onSegments", "segments", "_onSegments", "open", "block", "Obj", "Message", "created", "Date", "toISOString", "blocks", "sender", "identityDid", "append"]
|
|
7
|
+
}
|