@dxos/plugin-transcription 0.8.4-main.ae835ea → 0.8.4-main.bc2380dfbc
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/LICENSE +102 -5
- package/README.md +1 -1
- package/dist/lib/neutral/TranscriptionArticle-L6XANBH5.mjs +54 -0
- package/dist/lib/neutral/TranscriptionArticle-L6XANBH5.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/TranscriptionPlugin.workerd.mjs +21 -0
- package/dist/lib/neutral/TranscriptionPlugin.workerd.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-2O3ONPRZ.mjs +298 -0
- package/dist/lib/neutral/chunk-2O3ONPRZ.mjs.map +7 -0
- package/dist/lib/neutral/chunk-5FXU36PN.mjs +120 -0
- package/dist/lib/neutral/chunk-5FXU36PN.mjs.map +7 -0
- package/dist/lib/{browser/chunk-VBUIO677.mjs → neutral/chunk-GL4RS533.mjs} +2 -9
- package/dist/lib/neutral/chunk-GL4RS533.mjs.map +7 -0
- package/dist/lib/{browser/chunk-WH36ENNE.mjs → neutral/chunk-ILSA3DU7.mjs} +102 -133
- package/dist/lib/neutral/chunk-ILSA3DU7.mjs.map +7 -0
- package/dist/lib/neutral/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/neutral/chunk-KAEXRX3Y.mjs +35 -0
- package/dist/lib/neutral/chunk-KAEXRX3Y.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-Y5EQAFFR.mjs +8 -0
- package/dist/lib/neutral/chunk-Y5EQAFFR.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 +272 -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-RRWRIUSR.mjs +21 -0
- package/dist/lib/neutral/create-RRWRIUSR.mjs.map +7 -0
- package/dist/lib/neutral/hooks/index.mjs +19 -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/meta.mjs.map +7 -0
- package/dist/lib/neutral/open-CVMX5KXZ.mjs +27 -0
- package/dist/lib/neutral/open-CVMX5KXZ.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/operations/index.mjs.map +7 -0
- package/dist/lib/neutral/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-YMZRO242.mjs +26 -0
- package/dist/lib/neutral/react-surface-YMZRO242.mjs.map +7 -0
- package/dist/lib/neutral/summarize-LA7TRW7A.mjs +78 -0
- package/dist/lib/neutral/summarize-LA7TRW7A.mjs.map +7 -0
- package/dist/lib/neutral/text-content-F4ASMITB.mjs +30 -0
- package/dist/lib/neutral/text-content-F4ASMITB.mjs.map +7 -0
- package/dist/lib/{node-esm/transcriber-UGB7ECX6.mjs → neutral/transcriber-ABHATBVH.mjs} +20 -18
- package/dist/lib/neutral/transcriber-ABHATBVH.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +24 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +10 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/types/src/TranscriptionPlugin.d.ts +3 -1
- 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/TranscriptionPlugin.workerd.d.ts +4 -0
- package/dist/types/src/TranscriptionPlugin.workerd.d.ts.map +1 -0
- package/dist/types/src/blueprints/index.d.ts +2 -0
- package/dist/types/src/blueprints/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/transcription-blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/transcription-blueprint.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition.d.ts +5 -4
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +10 -5
- 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 +3 -2
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- 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 +4 -3
- package/dist/types/src/capabilities/transcriber.d.ts.map +1 -1
- package/dist/types/src/components/Oracle/Oracle.d.ts +24 -0
- package/dist/types/src/components/Oracle/Oracle.d.ts.map +1 -0
- package/dist/types/src/components/Oracle/Oracle.stories.d.ts +32 -0
- package/dist/types/src/components/Oracle/Oracle.stories.d.ts.map +1 -0
- package/dist/types/src/components/Oracle/index.d.ts +2 -0
- package/dist/types/src/components/Oracle/index.d.ts.map +1 -0
- package/dist/types/src/components/Transcription/Transcription.d.ts +13 -0
- package/dist/types/src/components/Transcription/Transcription.d.ts.map +1 -0
- package/dist/types/src/components/Transcription/Transcription.stories.d.ts +37 -0
- 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/Transcription/transcription-extension.d.ts +15 -0
- package/dist/types/src/components/Transcription/transcription-extension.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +2 -3
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/TranscriptionArticle/TranscriptionArticle.d.ts +6 -0
- package/dist/types/src/containers/TranscriptionArticle/TranscriptionArticle.d.ts.map +1 -0
- package/dist/types/src/containers/TranscriptionArticle/TranscriptionArticle.stories.d.ts +28 -0
- package/dist/types/src/containers/TranscriptionArticle/TranscriptionArticle.stories.d.ts.map +1 -0
- package/dist/types/src/containers/TranscriptionArticle/index.d.ts +2 -0
- package/dist/types/src/containers/TranscriptionArticle/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/enrichment/conversation.test.d.ts +2 -0
- package/dist/types/src/enrichment/conversation.test.d.ts.map +1 -0
- package/dist/types/src/enrichment/operations.d.ts +200 -0
- package/dist/types/src/enrichment/operations.d.ts.map +1 -0
- package/dist/types/src/enrichment/parser.d.ts +26 -0
- package/dist/types/src/enrichment/parser.d.ts.map +1 -0
- package/dist/types/src/enrichment/stream-simulator.d.ts +38 -0
- package/dist/types/src/enrichment/stream-simulator.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +2 -1
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- 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/useFeedModelAdapter.d.ts +12 -0
- package/dist/types/src/hooks/useFeedModelAdapter.d.ts.map +1 -0
- 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/useTranscriptionRecording.d.ts +12 -0
- package/dist/types/src/hooks/useTranscriptionRecording.d.ts.map +1 -0
- 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/meta.d.ts +2 -2
- package/dist/types/src/meta.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/{segments-normalization → normalization}/message-normalizer.d.ts +9 -7
- package/dist/types/src/normalization/message-normalizer.d.ts.map +1 -0
- package/dist/types/src/normalization/normalization.d.ts +543 -0
- 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 +3 -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/stories/FileTranscription.stories.d.ts +20 -0
- 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/MicrophoneTranscription.stories.d.ts → stories/LiveTranscription.stories.d.ts} +7 -7
- package/dist/types/src/stories/LiveTranscription.stories.d.ts.map +1 -0
- package/dist/types/src/stories/TranscriptionStory.d.ts +21 -0
- package/dist/types/src/stories/TranscriptionStory.d.ts.map +1 -0
- package/dist/types/src/stories/common.d.ts +46 -0
- package/dist/types/src/stories/common.d.ts.map +1 -0
- package/dist/types/src/testing/testing.d.ts +13 -14
- 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 +2 -2
- package/dist/types/src/transcriber/media-stream-recorder.d.ts.map +1 -1
- package/dist/types/src/transcriber/transcriber.d.ts +61 -6
- 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 +14 -9
- package/dist/types/src/transcriber/transcription-manager.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +9 -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/index.d.ts +2 -3
- 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/index.d.ts +1 -0
- 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/src/util/render-byline.d.ts +4 -0
- package/dist/types/src/util/render-byline.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +157 -82
- package/src/TranscriptionPlugin.node.ts +20 -0
- package/src/TranscriptionPlugin.test.ts +31 -0
- package/src/TranscriptionPlugin.tsx +20 -64
- package/src/TranscriptionPlugin.workerd.ts +18 -0
- package/src/blueprints/index.ts +5 -0
- package/src/blueprints/transcription-blueprint.ts +29 -0
- package/src/capabilities/blueprint-definition.ts +12 -24
- package/src/capabilities/index.ts +11 -7
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-surface.tsx +23 -14
- package/src/capabilities/text-content.ts +33 -0
- package/src/capabilities/transcriber.ts +53 -42
- package/src/components/Oracle/Oracle.stories.tsx +147 -0
- package/src/components/Oracle/Oracle.tsx +141 -0
- package/src/components/Oracle/index.ts +5 -0
- package/src/components/Transcription/Transcription.stories.tsx +213 -0
- package/src/components/Transcription/Transcription.tsx +58 -0
- package/src/components/{Transcript → Transcription}/index.ts +1 -1
- package/src/components/{Transcript/transcript-extension.ts → Transcription/transcription-extension.ts} +13 -9
- package/src/components/index.ts +2 -6
- package/src/containers/TranscriptionArticle/TranscriptionArticle.stories.tsx +61 -0
- package/src/containers/TranscriptionArticle/TranscriptionArticle.tsx +62 -0
- package/src/containers/TranscriptionArticle/index.ts +5 -0
- package/src/containers/index.ts +7 -0
- package/src/enrichment/conversation.test.ts +162 -0
- package/src/enrichment/conversation.txt +23 -0
- package/src/enrichment/operations.ts +268 -0
- package/src/enrichment/parser.ts +101 -0
- package/src/enrichment/stream-simulator.ts +125 -0
- package/src/hooks/index.ts +2 -1
- package/src/hooks/useFeedModelAdapter.ts +46 -0
- package/src/hooks/useTranscriber.ts +12 -4
- package/src/hooks/useTranscriptionRecording.ts +87 -0
- package/src/hooks/useVoiceInput.ts +2 -3
- package/src/index.ts +4 -5
- package/src/meta.ts +3 -3
- package/src/model/model.test.ts +20 -14
- package/src/model/model.ts +3 -3
- package/src/{segments-normalization → normalization}/message-normalizer.ts +37 -24
- package/src/{segments-normalization → normalization}/normalization.test.ts +8 -47
- package/src/normalization/normalization.ts +76 -0
- package/src/{segments-normalization → normalization}/utils.ts +2 -2
- 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/stories/FileTranscription.stories.tsx +143 -0
- package/src/{components/stories → stories}/KeyWordRecognition.stories.tsx +40 -40
- package/src/stories/LiveTranscription.stories.tsx +153 -0
- package/src/stories/TranscriptionStory.tsx +101 -0
- package/src/stories/common.ts +233 -0
- package/src/testing/testing.ts +49 -56
- package/src/transcriber/index.ts +1 -1
- package/src/transcriber/media-stream-recorder.ts +3 -3
- package/src/transcriber/transcriber.browser.test.ts +4 -5
- package/src/transcriber/transcriber.test.ts +104 -0
- package/src/transcriber/transcriber.ts +105 -60
- package/src/transcriber/transcription-manager.ts +33 -22
- package/src/translations.ts +10 -7
- package/src/types/TranscriptOperation.ts +103 -0
- package/src/types/TranscriptionCapabilities.ts +39 -0
- package/src/types/index.ts +2 -3
- package/src/util/index.ts +1 -0
- package/src/util/render-byline.ts +33 -0
- package/dist/lib/browser/TranscriptContainer-2GSL2XB5.mjs +0 -11
- package/dist/lib/browser/blueprint-definition-UAAJYVLZ.mjs +0 -150
- package/dist/lib/browser/blueprint-definition-UAAJYVLZ.mjs.map +0 -7
- package/dist/lib/browser/chunk-3MKZ2MNQ.mjs +0 -16
- package/dist/lib/browser/chunk-3MKZ2MNQ.mjs.map +0 -7
- package/dist/lib/browser/chunk-535OJKFO.mjs +0 -8
- package/dist/lib/browser/chunk-535OJKFO.mjs.map +0 -7
- package/dist/lib/browser/chunk-7DR6HZEF.mjs +0 -732
- package/dist/lib/browser/chunk-7DR6HZEF.mjs.map +0 -7
- package/dist/lib/browser/chunk-VBUIO677.mjs.map +0 -7
- package/dist/lib/browser/chunk-W7WKZTM4.mjs +0 -63
- package/dist/lib/browser/chunk-W7WKZTM4.mjs.map +0 -7
- package/dist/lib/browser/chunk-WH36ENNE.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -130
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-ZTKTEAQX.mjs +0 -25
- package/dist/lib/browser/intent-resolver-ZTKTEAQX.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/react-surface-KA32A72I.mjs +0 -34
- package/dist/lib/browser/react-surface-KA32A72I.mjs.map +0 -7
- package/dist/lib/browser/transcriber-LWOLYQHC.mjs +0 -56
- package/dist/lib/browser/transcriber-LWOLYQHC.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -12
- package/dist/lib/node-esm/TranscriptContainer-GRLDCESB.mjs +0 -12
- package/dist/lib/node-esm/blueprint-definition-Z3LTZ3ID.mjs +0 -151
- package/dist/lib/node-esm/blueprint-definition-Z3LTZ3ID.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-K4AZOB5Y.mjs +0 -733
- package/dist/lib/node-esm/chunk-K4AZOB5Y.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-OLMSTF3M.mjs +0 -64
- package/dist/lib/node-esm/chunk-OLMSTF3M.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-Q6WD7L2J.mjs +0 -10
- package/dist/lib/node-esm/chunk-Q6WD7L2J.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SWUVPFKR.mjs +0 -17
- package/dist/lib/node-esm/chunk-SWUVPFKR.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YFN4FJFK.mjs +0 -467
- package/dist/lib/node-esm/chunk-YFN4FJFK.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YVNQN2J6.mjs +0 -30
- package/dist/lib/node-esm/chunk-YVNQN2J6.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -131
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-55WH2GY6.mjs +0 -26
- package/dist/lib/node-esm/intent-resolver-55WH2GY6.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/react-surface-GU7LW2JO.mjs +0 -35
- package/dist/lib/node-esm/react-surface-GU7LW2JO.mjs.map +0 -7
- package/dist/lib/node-esm/transcriber-UGB7ECX6.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -13
- package/dist/types/src/capabilities/capabilities.d.ts +0 -17
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/components/Transcript/Transcript.d.ts +0 -20
- package/dist/types/src/components/Transcript/Transcript.d.ts.map +0 -1
- package/dist/types/src/components/Transcript/Transcript.stories.d.ts +0 -39
- 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 +0 -15
- package/dist/types/src/components/Transcript/transcript-extension.d.ts.map +0 -1
- package/dist/types/src/components/TranscriptContainer.d.ts +0 -9
- package/dist/types/src/components/TranscriptContainer.d.ts.map +0 -1
- package/dist/types/src/components/stories/FileTranscription.stories.d.ts +0 -18
- 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 +0 -3
- 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 -7
- 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/hooks/useQueueModelAdapter.d.ts +0 -8
- package/dist/types/src/hooks/useQueueModelAdapter.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 +0 -476
- 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 +0 -3
- package/dist/types/src/segments-normalization/utils.d.ts.map +0 -1
- package/dist/types/src/types/Transcript.d.ts +0 -30
- package/dist/types/src/types/Transcript.d.ts.map +0 -1
- package/dist/types/src/types/TranscriptAction.d.ts +0 -23
- package/dist/types/src/types/TranscriptAction.d.ts.map +0 -1
- package/dist/types/src/types/types.d.ts +0 -5
- package/dist/types/src/types/types.d.ts.map +0 -1
- package/src/capabilities/capabilities.ts +0 -33
- package/src/capabilities/intent-resolver.ts +0 -18
- package/src/components/Transcript/Transcript.stories.tsx +0 -245
- package/src/components/Transcript/Transcript.tsx +0 -93
- package/src/components/Transcript/deprecated/OldTranscript.tsx +0 -260
- package/src/components/TranscriptContainer.tsx +0 -36
- package/src/components/stories/FileTranscription.stories.tsx +0 -256
- package/src/components/stories/MicrophoneTranscription.stories.tsx +0 -285
- package/src/components/stories/TranscriptionStory.tsx +0 -45
- package/src/components/stories/useIsSpeaking.tsx +0 -40
- package/src/functions/index.ts +0 -6
- package/src/functions/open.ts +0 -39
- package/src/functions/summarize.ts +0 -103
- package/src/hooks/useQueueModelAdapter.ts +0 -66
- package/src/segments-normalization/normalization.ts +0 -115
- package/src/types/Transcript.ts +0 -44
- package/src/types/TranscriptAction.ts +0 -24
- package/src/types/types.ts +0 -9
- package/dist/lib/{browser/types → neutral/blueprints}/index.mjs.map +0 -0
- package/dist/lib/{browser/TranscriptContainer-2GSL2XB5.mjs.map → neutral/chunk-J5LGTIGS.mjs.map} +0 -0
- package/dist/lib/{node-esm/types → neutral/hooks}/index.mjs.map +0 -0
- package/dist/lib/{node-esm/TranscriptContainer-GRLDCESB.mjs.map → neutral/index.mjs.map} +0 -0
- package/dist/types/src/{segments-normalization → normalization}/normalization.test.d.ts +0 -0
- package/src/{segments-normalization → normalization}/index.ts +1 -1
package/LICENSE
CHANGED
|
@@ -1,8 +1,105 @@
|
|
|
1
|
-
|
|
2
|
-
Copyright (c) 2022 DXOS
|
|
1
|
+
# Functional Source License, Version 1.1, ALv2 Future License
|
|
3
2
|
|
|
4
|
-
|
|
3
|
+
## Abbreviation
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
FSL-1.1-Apache-2.0
|
|
7
6
|
|
|
8
|
-
|
|
7
|
+
## Notice
|
|
8
|
+
|
|
9
|
+
Copyright 2026 DXOS
|
|
10
|
+
|
|
11
|
+
## Terms and Conditions
|
|
12
|
+
|
|
13
|
+
### Licensor ("We")
|
|
14
|
+
|
|
15
|
+
The party offering the Software under these Terms and Conditions.
|
|
16
|
+
|
|
17
|
+
### The Software
|
|
18
|
+
|
|
19
|
+
The "Software" is each version of the software that we make available under
|
|
20
|
+
these Terms and Conditions, as indicated by our inclusion of these Terms and
|
|
21
|
+
Conditions with the Software.
|
|
22
|
+
|
|
23
|
+
### License Grant
|
|
24
|
+
|
|
25
|
+
Subject to your compliance with this License Grant and the Patents,
|
|
26
|
+
Redistribution and Trademark clauses below, we hereby grant you the right to
|
|
27
|
+
use, copy, modify, create derivative works, publicly perform, publicly display
|
|
28
|
+
and redistribute the Software for any Permitted Purpose identified below.
|
|
29
|
+
|
|
30
|
+
### Permitted Purpose
|
|
31
|
+
|
|
32
|
+
A Permitted Purpose is any purpose other than a Competing Use. A Competing Use
|
|
33
|
+
means making the Software available to others in a commercial product or
|
|
34
|
+
service that:
|
|
35
|
+
|
|
36
|
+
1. substitutes for the Software;
|
|
37
|
+
|
|
38
|
+
2. substitutes for any other product or service we offer using the Software
|
|
39
|
+
that exists as of the date we make the Software available; or
|
|
40
|
+
|
|
41
|
+
3. offers the same or substantially similar functionality as the Software.
|
|
42
|
+
|
|
43
|
+
Permitted Purposes specifically include using the Software:
|
|
44
|
+
|
|
45
|
+
1. for your internal use and access;
|
|
46
|
+
|
|
47
|
+
2. for non-commercial education;
|
|
48
|
+
|
|
49
|
+
3. for non-commercial research; and
|
|
50
|
+
|
|
51
|
+
4. in connection with professional services that you provide to a licensee
|
|
52
|
+
using the Software in accordance with these Terms and Conditions.
|
|
53
|
+
|
|
54
|
+
### Patents
|
|
55
|
+
|
|
56
|
+
To the extent your use for a Permitted Purpose would necessarily infringe our
|
|
57
|
+
patents, the license grant above includes a license under our patents. If you
|
|
58
|
+
make a claim against any party that the Software infringes or contributes to
|
|
59
|
+
the infringement of any patent, then your patent license to the Software ends
|
|
60
|
+
immediately.
|
|
61
|
+
|
|
62
|
+
### Redistribution
|
|
63
|
+
|
|
64
|
+
The Terms and Conditions apply to all copies, modifications and derivatives of
|
|
65
|
+
the Software.
|
|
66
|
+
|
|
67
|
+
If you redistribute any copies, modifications or derivatives of the Software,
|
|
68
|
+
you must include a copy of or a link to these Terms and Conditions and not
|
|
69
|
+
remove any copyright notices provided in or with the Software.
|
|
70
|
+
|
|
71
|
+
### Disclaimer
|
|
72
|
+
|
|
73
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND WITHOUT WARRANTIES OF ANY KIND, EXPRESS OR
|
|
74
|
+
IMPLIED, INCLUDING WITHOUT LIMITATION WARRANTIES OF FITNESS FOR A PARTICULAR
|
|
75
|
+
PURPOSE, MERCHANTABILITY, TITLE OR NON-INFRINGEMENT.
|
|
76
|
+
|
|
77
|
+
IN NO EVENT WILL WE HAVE ANY LIABILITY TO YOU ARISING OUT OF OR RELATED TO THE
|
|
78
|
+
SOFTWARE, INCLUDING INDIRECT, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES,
|
|
79
|
+
EVEN IF WE HAVE BEEN INFORMED OF THEIR POSSIBILITY IN ADVANCE.
|
|
80
|
+
|
|
81
|
+
### Trademarks
|
|
82
|
+
|
|
83
|
+
Except for displaying the License Details and identifying us as the origin of
|
|
84
|
+
the Software, you have no right under these Terms and Conditions to use our
|
|
85
|
+
trademarks, trade names, service marks or product names.
|
|
86
|
+
|
|
87
|
+
## Grant of Future License
|
|
88
|
+
|
|
89
|
+
We hereby irrevocably grant you an additional license to use the Software under
|
|
90
|
+
the Apache License, Version 2.0 that is effective on the second anniversary of
|
|
91
|
+
the date we make the Software available. On or after that date, you may use the
|
|
92
|
+
Software under the Apache License, Version 2.0, in which case the following
|
|
93
|
+
will apply:
|
|
94
|
+
|
|
95
|
+
Licensed under the Apache License, Version 2.0 (the "License"); you may not use
|
|
96
|
+
this file except in compliance with the License.
|
|
97
|
+
|
|
98
|
+
You may obtain a copy of the License at
|
|
99
|
+
|
|
100
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
101
|
+
|
|
102
|
+
Unless required by applicable law or agreed to in writing, software distributed
|
|
103
|
+
under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR
|
|
104
|
+
CONDITIONS OF ANY KIND, either express or implied. See the License for the
|
|
105
|
+
specific language governing permissions and limitations under the License.
|
package/README.md
CHANGED
|
@@ -12,4 +12,4 @@ Transcription functionality
|
|
|
12
12
|
|
|
13
13
|
Your ideas, issues, and code are most welcome. Please take a look at our [community code of conduct](https://github.com/dxos/dxos/blob/main/CODE_OF_CONDUCT.md), the [issue guide](https://github.com/dxos/dxos/blob/main/CONTRIBUTING.md#submitting-issues), and the [PR contribution guide](https://github.com/dxos/dxos/blob/main/CONTRIBUTING.md#submitting-prs).
|
|
14
14
|
|
|
15
|
-
License: [
|
|
15
|
+
License: [FSL-1.1-Apache-2.0](./LICENSE) Copyright 2023 © DXOS
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import {
|
|
2
|
+
renderByline
|
|
3
|
+
} from "./chunk-KAEXRX3Y.mjs";
|
|
4
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
5
|
+
|
|
6
|
+
// src/containers/TranscriptionArticle/TranscriptionArticle.tsx
|
|
7
|
+
import React from "react";
|
|
8
|
+
import { Filter, Obj, Query } from "@dxos/echo";
|
|
9
|
+
import { useMembers, useQuery } from "@dxos/react-client/echo";
|
|
10
|
+
import { Panel } from "@dxos/react-ui";
|
|
11
|
+
import { Menu, MenuBuilder, useMenuBuilder } from "@dxos/react-ui-menu";
|
|
12
|
+
import { Message } from "@dxos/types";
|
|
13
|
+
import { Transcription } from "#components";
|
|
14
|
+
import { useFeedModelAdapter, useTranscriptionRecording } from "#hooks";
|
|
15
|
+
import { meta } from "#meta";
|
|
16
|
+
var TranscriptionArticle = ({ role, subject: transcript, attendableId }) => {
|
|
17
|
+
const db = Obj.getDatabase(transcript);
|
|
18
|
+
const members = useMembers(db?.spaceId).map((member) => member.identity);
|
|
19
|
+
const feed = transcript.feed.target;
|
|
20
|
+
const messages = useQuery(db, feed ? Query.select(Filter.type(Message.Message)).from(feed) : Query.select(Filter.nothing()));
|
|
21
|
+
const model = useFeedModelAdapter(renderByline(members), messages);
|
|
22
|
+
const { recording, toggleRecording } = useTranscriptionRecording(transcript);
|
|
23
|
+
const menuActions = useMenuBuilder(() => MenuBuilder.make().action("toggle-recording", {
|
|
24
|
+
label: [
|
|
25
|
+
recording ? "stop-recording.label" : "start-recording.label",
|
|
26
|
+
{
|
|
27
|
+
ns: meta.id
|
|
28
|
+
}
|
|
29
|
+
],
|
|
30
|
+
icon: recording ? "ph--stop-circle--regular" : "ph--microphone--regular",
|
|
31
|
+
disposition: "toolbar",
|
|
32
|
+
testId: "transcription.toggle-recording"
|
|
33
|
+
}, toggleRecording).build(), [
|
|
34
|
+
recording,
|
|
35
|
+
toggleRecording
|
|
36
|
+
]);
|
|
37
|
+
return /* @__PURE__ */ React.createElement(Panel.Root, {
|
|
38
|
+
role
|
|
39
|
+
}, /* @__PURE__ */ React.createElement(Menu.Root, {
|
|
40
|
+
...menuActions,
|
|
41
|
+
attendableId
|
|
42
|
+
}, /* @__PURE__ */ React.createElement(Panel.Toolbar, {
|
|
43
|
+
asChild: true
|
|
44
|
+
}, /* @__PURE__ */ React.createElement(Menu.Toolbar, null))), /* @__PURE__ */ React.createElement(Panel.Content, {
|
|
45
|
+
asChild: true
|
|
46
|
+
}, /* @__PURE__ */ React.createElement(Transcription, {
|
|
47
|
+
model,
|
|
48
|
+
transcript
|
|
49
|
+
})));
|
|
50
|
+
};
|
|
51
|
+
export {
|
|
52
|
+
TranscriptionArticle as default
|
|
53
|
+
};
|
|
54
|
+
//# sourceMappingURL=TranscriptionArticle-L6XANBH5.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/containers/TranscriptionArticle/TranscriptionArticle.tsx"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type AppSurface } from '@dxos/app-toolkit/ui';\nimport { Filter, Obj, Query } from '@dxos/echo';\nimport { useMembers, useQuery } from '@dxos/react-client/echo';\nimport { Panel } from '@dxos/react-ui';\nimport { Menu, MenuBuilder, useMenuBuilder } from '@dxos/react-ui-menu';\nimport { Message, type Transcript } from '@dxos/types';\n\nimport { Transcription } from '#components';\nimport { useFeedModelAdapter, useTranscriptionRecording } from '#hooks';\nimport { meta } from '#meta';\n\nimport { renderByline } from '../../util';\n\nexport type TranscriptionArticleProps = AppSurface.ObjectArticleProps<Transcript.Transcript>;\n\nexport const TranscriptionArticle = ({ role, subject: transcript, attendableId }: TranscriptionArticleProps) => {\n const db = Obj.getDatabase(transcript);\n const members = useMembers(db?.spaceId).map((member) => member.identity);\n const feed = transcript.feed.target;\n const messages = useQuery(\n db,\n feed ? Query.select(Filter.type(Message.Message)).from(feed) : Query.select(Filter.nothing()),\n );\n const model = useFeedModelAdapter(renderByline(members), messages);\n const { recording, toggleRecording } = useTranscriptionRecording(transcript);\n\n const menuActions = useMenuBuilder(\n () =>\n MenuBuilder.make()\n .action(\n 'toggle-recording',\n {\n label: [recording ? 'stop-recording.label' : 'start-recording.label', { ns: meta.id }],\n icon: recording ? 'ph--stop-circle--regular' : 'ph--microphone--regular',\n disposition: 'toolbar',\n testId: 'transcription.toggle-recording',\n },\n toggleRecording,\n )\n .build(),\n [recording, toggleRecording],\n );\n\n return (\n <Panel.Root role={role}>\n <Menu.Root {...menuActions} attendableId={attendableId}>\n <Panel.Toolbar asChild>\n <Menu.Toolbar />\n </Panel.Toolbar>\n </Menu.Root>\n <Panel.Content asChild>\n <Transcription model={model} transcript={transcript} />\n </Panel.Content>\n </Panel.Root>\n );\n};\n"],
|
|
5
|
+
"mappings": ";;;;;;AAIA,OAAOA,WAAW;AAGlB,SAASC,QAAQC,KAAKC,aAAa;AACnC,SAASC,YAAYC,gBAAgB;AACrC,SAASC,aAAa;AACtB,SAASC,MAAMC,aAAaC,sBAAsB;AAClD,SAASC,eAAgC;AAEzC,SAASC,qBAAqB;AAC9B,SAASC,qBAAqBC,iCAAiC;AAC/D,SAASC,YAAY;AAMd,IAAMC,uBAAuB,CAAC,EAAEC,MAAMC,SAASC,YAAYC,aAAY,MAA6B;AACzG,QAAMC,KAAKC,IAAIC,YAAYJ,UAAAA;AAC3B,QAAMK,UAAUC,WAAWJ,IAAIK,OAAAA,EAASC,IAAI,CAACC,WAAWA,OAAOC,QAAQ;AACvE,QAAMC,OAAOX,WAAWW,KAAKC;AAC7B,QAAMC,WAAWC,SACfZ,IACAS,OAAOI,MAAMC,OAAOC,OAAOC,KAAKC,QAAQA,OAAO,CAAA,EAAGC,KAAKT,IAAAA,IAAQI,MAAMC,OAAOC,OAAOI,QAAO,CAAA,CAAA;AAE5F,QAAMC,QAAQC,oBAAoBC,aAAanB,OAAAA,GAAUQ,QAAAA;AACzD,QAAM,EAAEY,WAAWC,gBAAe,IAAKC,0BAA0B3B,UAAAA;AAEjE,QAAM4B,cAAcC,eAClB,MACEC,YAAYC,KAAI,EACbC,OACC,oBACA;IACEC,OAAO;MAACR,YAAY,yBAAyB;MAAyB;QAAES,IAAIC,KAAKC;MAAG;;IACpFC,MAAMZ,YAAY,6BAA6B;IAC/Ca,aAAa;IACbC,QAAQ;EACV,GACAb,eAAAA,EAEDc,MAAK,GACV;IAACf;IAAWC;GAAgB;AAG9B,SACE,sBAAA,cAACe,MAAMC,MAAI;IAAC5C;KACV,sBAAA,cAAC6C,KAAKD,MAAI;IAAE,GAAGd;IAAa3B;KAC1B,sBAAA,cAACwC,MAAMG,SAAO;IAACC,SAAAA;KACb,sBAAA,cAACF,KAAKC,SAAO,IAAA,CAAA,CAAA,GAGjB,sBAAA,cAACH,MAAMK,SAAO;IAACD,SAAAA;KACb,sBAAA,cAACE,eAAAA;IAAczB;IAActB;;AAIrC;",
|
|
6
|
+
"names": ["React", "Filter", "Obj", "Query", "useMembers", "useQuery", "Panel", "Menu", "MenuBuilder", "useMenuBuilder", "Message", "Transcription", "useFeedModelAdapter", "useTranscriptionRecording", "meta", "TranscriptionArticle", "role", "subject", "transcript", "attendableId", "db", "Obj", "getDatabase", "members", "useMembers", "spaceId", "map", "member", "identity", "feed", "target", "messages", "useQuery", "Query", "select", "Filter", "type", "Message", "from", "nothing", "model", "useFeedModelAdapter", "renderByline", "recording", "toggleRecording", "useTranscriptionRecording", "menuActions", "useMenuBuilder", "MenuBuilder", "make", "action", "label", "ns", "meta", "id", "icon", "disposition", "testId", "build", "Panel", "Root", "Menu", "Toolbar", "asChild", "Content", "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,21 @@
|
|
|
1
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
2
|
+
|
|
3
|
+
// src/TranscriptionPlugin.workerd.ts
|
|
4
|
+
import { Plugin } from "@dxos/app-framework";
|
|
5
|
+
import { AppPlugin } from "@dxos/app-toolkit";
|
|
6
|
+
import { Transcript } from "@dxos/types";
|
|
7
|
+
import { OperationHandler } from "#capabilities";
|
|
8
|
+
import { meta } from "#meta";
|
|
9
|
+
var TranscriptionPlugin = Plugin.define(meta).pipe(AppPlugin.addOperationHandlerModule({
|
|
10
|
+
activate: OperationHandler
|
|
11
|
+
}), AppPlugin.addSchemaModule({
|
|
12
|
+
schema: [
|
|
13
|
+
Transcript.Transcript
|
|
14
|
+
]
|
|
15
|
+
}), Plugin.make);
|
|
16
|
+
var TranscriptionPlugin_workerd_default = TranscriptionPlugin;
|
|
17
|
+
export {
|
|
18
|
+
TranscriptionPlugin,
|
|
19
|
+
TranscriptionPlugin_workerd_default as default
|
|
20
|
+
};
|
|
21
|
+
//# sourceMappingURL=TranscriptionPlugin.workerd.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/TranscriptionPlugin.workerd.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 { OperationHandler } from '#capabilities';\nimport { meta } from '#meta';\n\nexport const TranscriptionPlugin = Plugin.define(meta).pipe(\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,wBAAwB;AACjC,SAASC,YAAY;AAEd,IAAMC,sBAAsBL,OAAOM,OAAOF,IAAAA,EAAMG,KACrDN,UAAUO,0BAA0B;EAAEC,UAAUN;AAAiB,CAAA,GACjEF,UAAUS,gBAAgB;EAAEC,QAAQ;IAACT,WAAWA;;AAAY,CAAA,GAC5DF,OAAOY,IAAI;AAGb,IAAA,sCAAeP;",
|
|
6
|
+
"names": ["Plugin", "AppPlugin", "Transcript", "OperationHandler", "meta", "TranscriptionPlugin", "define", "pipe", "addOperationHandlerModule", "activate", "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-F4ASMITB.mjs"));
|
|
7
|
+
var OperationHandler = Capability.lazy("OperationHandler", () => import("../operation-handler-NXMOAXFP.mjs"));
|
|
8
|
+
var ReactSurface = Capability.lazy("ReactSurface", () => import("../react-surface-YMZRO242.mjs"));
|
|
9
|
+
var Transcriber = Capability.lazy("Transcriber", () => import("../transcriber-ABHATBVH.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,298 @@
|
|
|
1
|
+
import {
|
|
2
|
+
SerializationModel
|
|
3
|
+
} from "./chunk-MLRJWAQH.mjs";
|
|
4
|
+
|
|
5
|
+
// src/hooks/useAudioFile.ts
|
|
6
|
+
import { useEffect, useState } from "react";
|
|
7
|
+
import { scheduleTask } from "@dxos/async";
|
|
8
|
+
import { Context } from "@dxos/context";
|
|
9
|
+
import { log } from "@dxos/log";
|
|
10
|
+
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-transcription/src/hooks/useAudioFile.ts";
|
|
11
|
+
var useAudioFile = (audioUrl, constraints) => {
|
|
12
|
+
const [{ audio, stream, track }, setStream] = useState({});
|
|
13
|
+
useEffect(() => {
|
|
14
|
+
const ctx = new Context(void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 11 });
|
|
15
|
+
scheduleTask(ctx, async () => {
|
|
16
|
+
try {
|
|
17
|
+
const response = await fetch(audioUrl);
|
|
18
|
+
const blob = await response.blob();
|
|
19
|
+
const objectUrl = URL.createObjectURL(blob);
|
|
20
|
+
ctx.onDispose(() => {
|
|
21
|
+
URL.revokeObjectURL(objectUrl);
|
|
22
|
+
});
|
|
23
|
+
const audio2 = new Audio();
|
|
24
|
+
audio2.src = objectUrl;
|
|
25
|
+
await new Promise((resolve, reject) => {
|
|
26
|
+
audio2.addEventListener("error", (err) => {
|
|
27
|
+
log.error("error", {
|
|
28
|
+
err
|
|
29
|
+
}, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 25, S: void 0 });
|
|
30
|
+
reject(err);
|
|
31
|
+
}, {
|
|
32
|
+
once: true
|
|
33
|
+
});
|
|
34
|
+
audio2.addEventListener("canplay", async () => {
|
|
35
|
+
resolve();
|
|
36
|
+
}, {
|
|
37
|
+
once: true
|
|
38
|
+
});
|
|
39
|
+
audio2.load();
|
|
40
|
+
});
|
|
41
|
+
const audioCtx = new AudioContext();
|
|
42
|
+
if (audioCtx.state === "suspended") {
|
|
43
|
+
await audioCtx.resume();
|
|
44
|
+
}
|
|
45
|
+
const destination = audioCtx.createMediaStreamDestination();
|
|
46
|
+
destination.channelCount = 1;
|
|
47
|
+
const source = audioCtx.createMediaElementSource(audio2);
|
|
48
|
+
source.connect(destination);
|
|
49
|
+
const track2 = destination.stream.getAudioTracks()[0];
|
|
50
|
+
if (constraints) {
|
|
51
|
+
await track2.applyConstraints(constraints).catch((err) => log.catch(err, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 50, S: void 0 }));
|
|
52
|
+
}
|
|
53
|
+
setStream({
|
|
54
|
+
audio: audio2,
|
|
55
|
+
stream: destination.stream,
|
|
56
|
+
track: destination.stream.getAudioTracks()[0]
|
|
57
|
+
});
|
|
58
|
+
} catch (err) {
|
|
59
|
+
log.catch(err, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file, L: 59, S: void 0 });
|
|
60
|
+
}
|
|
61
|
+
});
|
|
62
|
+
return () => {
|
|
63
|
+
void ctx.dispose();
|
|
64
|
+
};
|
|
65
|
+
}, [
|
|
66
|
+
audioUrl
|
|
67
|
+
]);
|
|
68
|
+
return {
|
|
69
|
+
audio,
|
|
70
|
+
stream,
|
|
71
|
+
track
|
|
72
|
+
};
|
|
73
|
+
};
|
|
74
|
+
|
|
75
|
+
// src/hooks/useAudioTrack.ts
|
|
76
|
+
import { useEffect as useEffect2, useState as useState2 } from "react";
|
|
77
|
+
var useAudioTrack = (active, constraints) => {
|
|
78
|
+
const [track, setTrack] = useState2();
|
|
79
|
+
useEffect2(() => {
|
|
80
|
+
if (!active) {
|
|
81
|
+
track?.stop();
|
|
82
|
+
setTrack(void 0);
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
const initAudio = async () => {
|
|
86
|
+
const audio = new Audio();
|
|
87
|
+
audio.srcObject = await navigator.mediaDevices.getUserMedia({
|
|
88
|
+
audio: constraints ?? true
|
|
89
|
+
});
|
|
90
|
+
const [track2] = audio.srcObject.getAudioTracks();
|
|
91
|
+
if (track2) {
|
|
92
|
+
setTrack(track2);
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
if (active) {
|
|
96
|
+
void initAudio();
|
|
97
|
+
}
|
|
98
|
+
}, [
|
|
99
|
+
active
|
|
100
|
+
]);
|
|
101
|
+
return track;
|
|
102
|
+
};
|
|
103
|
+
|
|
104
|
+
// src/hooks/useFeedModelAdapter.ts
|
|
105
|
+
import { useEffect as useEffect3, useMemo } from "react";
|
|
106
|
+
var useFeedModelAdapter = (renderer, objects, initialChunks = []) => {
|
|
107
|
+
const model = useMemo(() => new SerializationModel(renderer, initialChunks), [
|
|
108
|
+
renderer
|
|
109
|
+
]);
|
|
110
|
+
useEffect3(() => {
|
|
111
|
+
for (const chunk of objects) {
|
|
112
|
+
model.appendChunk(chunk);
|
|
113
|
+
}
|
|
114
|
+
}, [
|
|
115
|
+
model,
|
|
116
|
+
objects
|
|
117
|
+
]);
|
|
118
|
+
useEffect3(() => {
|
|
119
|
+
if (model.chunks.length === objects.length) {
|
|
120
|
+
return;
|
|
121
|
+
}
|
|
122
|
+
const chunk = objects.at(-1);
|
|
123
|
+
if (chunk) {
|
|
124
|
+
model.appendChunk(chunk);
|
|
125
|
+
}
|
|
126
|
+
}, [
|
|
127
|
+
model,
|
|
128
|
+
objects.length
|
|
129
|
+
]);
|
|
130
|
+
return model;
|
|
131
|
+
};
|
|
132
|
+
|
|
133
|
+
// src/hooks/useTranscriber.ts
|
|
134
|
+
import { useEffect as useEffect4, useMemo as useMemo2 } from "react";
|
|
135
|
+
import { useCapabilities } from "@dxos/app-framework/ui";
|
|
136
|
+
import { TranscriptionCapabilities } from "#types";
|
|
137
|
+
var useTranscriber = ({ audioStreamTrack, recorderConfig, transcriberConfig, onSegments, transcribe }) => {
|
|
138
|
+
const [getTranscriber] = useCapabilities(TranscriptionCapabilities.Transcriber);
|
|
139
|
+
const transcriber = useMemo2(() => {
|
|
140
|
+
if (!getTranscriber || !audioStreamTrack || !onSegments) {
|
|
141
|
+
return void 0;
|
|
142
|
+
}
|
|
143
|
+
return getTranscriber({
|
|
144
|
+
audioStreamTrack,
|
|
145
|
+
recorderConfig,
|
|
146
|
+
transcriberConfig,
|
|
147
|
+
onSegments,
|
|
148
|
+
transcribe
|
|
149
|
+
});
|
|
150
|
+
}, [
|
|
151
|
+
getTranscriber,
|
|
152
|
+
audioStreamTrack,
|
|
153
|
+
recorderConfig,
|
|
154
|
+
transcriberConfig,
|
|
155
|
+
onSegments,
|
|
156
|
+
transcribe
|
|
157
|
+
]);
|
|
158
|
+
useEffect4(() => {
|
|
159
|
+
return () => {
|
|
160
|
+
void transcriber?.close();
|
|
161
|
+
};
|
|
162
|
+
}, [
|
|
163
|
+
transcriber
|
|
164
|
+
]);
|
|
165
|
+
return transcriber;
|
|
166
|
+
};
|
|
167
|
+
|
|
168
|
+
// src/hooks/useTranscriptionRecording.ts
|
|
169
|
+
import * as Effect from "effect/Effect";
|
|
170
|
+
import { useCallback, useEffect as useEffect5, useState as useState3 } from "react";
|
|
171
|
+
import { createFeedServiceLayer } from "@dxos/client/echo";
|
|
172
|
+
import { Feed, Obj } from "@dxos/echo";
|
|
173
|
+
import { runAndForwardErrors } from "@dxos/effect";
|
|
174
|
+
import { log as log2 } from "@dxos/log";
|
|
175
|
+
import { getSpace } from "@dxos/react-client/echo";
|
|
176
|
+
import { useIdentity } from "@dxos/react-client/halo";
|
|
177
|
+
import { Message } from "@dxos/types";
|
|
178
|
+
var __dxlog_file2 = "/__w/dxos/dxos/packages/plugins/plugin-transcription/src/hooks/useTranscriptionRecording.ts";
|
|
179
|
+
var useTranscriptionRecording = (transcript) => {
|
|
180
|
+
const space = getSpace(transcript);
|
|
181
|
+
const identity = useIdentity();
|
|
182
|
+
const feed = transcript.feed.target;
|
|
183
|
+
const [recording, setRecording] = useState3(false);
|
|
184
|
+
const track = useAudioTrack(recording);
|
|
185
|
+
const handleSegments = useCallback(async (blocks) => {
|
|
186
|
+
if (!space || !feed || blocks.length === 0) {
|
|
187
|
+
return;
|
|
188
|
+
}
|
|
189
|
+
const sender = identity ? {
|
|
190
|
+
identityDid: identity.did,
|
|
191
|
+
name: identity.profile?.displayName
|
|
192
|
+
} : {};
|
|
193
|
+
const message = Obj.make(Message.Message, {
|
|
194
|
+
sender,
|
|
195
|
+
created: (/* @__PURE__ */ new Date()).toISOString(),
|
|
196
|
+
blocks
|
|
197
|
+
});
|
|
198
|
+
const feedServiceLayer = createFeedServiceLayer(space.queues);
|
|
199
|
+
await Feed.append(feed, [
|
|
200
|
+
message
|
|
201
|
+
]).pipe(Effect.provide(feedServiceLayer), runAndForwardErrors);
|
|
202
|
+
}, [
|
|
203
|
+
space,
|
|
204
|
+
feed,
|
|
205
|
+
identity
|
|
206
|
+
]);
|
|
207
|
+
const transcriber = useTranscriber({
|
|
208
|
+
audioStreamTrack: track,
|
|
209
|
+
onSegments: handleSegments
|
|
210
|
+
});
|
|
211
|
+
useEffect5(() => {
|
|
212
|
+
if (!transcriber) {
|
|
213
|
+
return;
|
|
214
|
+
}
|
|
215
|
+
let cancelled = false;
|
|
216
|
+
void transcriber.open().then(() => {
|
|
217
|
+
if (!cancelled && recording) {
|
|
218
|
+
transcriber.startChunksRecording();
|
|
219
|
+
}
|
|
220
|
+
}, (err) => {
|
|
221
|
+
if (!cancelled) {
|
|
222
|
+
log2.catch(err, void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file2, L: 67, S: void 0 });
|
|
223
|
+
setRecording(false);
|
|
224
|
+
}
|
|
225
|
+
});
|
|
226
|
+
return () => {
|
|
227
|
+
cancelled = true;
|
|
228
|
+
transcriber.stopChunksRecording();
|
|
229
|
+
};
|
|
230
|
+
}, [
|
|
231
|
+
transcriber,
|
|
232
|
+
recording
|
|
233
|
+
]);
|
|
234
|
+
const toggleRecording = useCallback(() => setRecording((value) => !value), []);
|
|
235
|
+
return {
|
|
236
|
+
recording,
|
|
237
|
+
toggleRecording
|
|
238
|
+
};
|
|
239
|
+
};
|
|
240
|
+
|
|
241
|
+
// src/hooks/useVoiceInput.ts
|
|
242
|
+
import { useCallback as useCallback2, useEffect as useEffect6, useState as useState4 } from "react";
|
|
243
|
+
import { scheduleMicroTask } from "@dxos/async";
|
|
244
|
+
import { Context as Context2 } from "@dxos/context";
|
|
245
|
+
import { log as log3 } from "@dxos/log";
|
|
246
|
+
import { useSoundEffect } from "@dxos/react-ui-sfx";
|
|
247
|
+
var __dxlog_file3 = "/__w/dxos/dxos/packages/plugins/plugin-transcription/src/hooks/useVoiceInput.ts";
|
|
248
|
+
var useVoiceInput = ({ active, onUpdate }) => {
|
|
249
|
+
const soundStart = useSoundEffect("StartRecording");
|
|
250
|
+
const soundStop = useSoundEffect("StopRecording");
|
|
251
|
+
const handleSegments = useCallback2(async (segments) => {
|
|
252
|
+
const text = segments.map((str) => str.text.trim().replace(/[^\w\s]/g, "")).join(" ");
|
|
253
|
+
onUpdate(text);
|
|
254
|
+
}, []);
|
|
255
|
+
const [recording, setRecording] = useState4(false);
|
|
256
|
+
const track = useAudioTrack(active);
|
|
257
|
+
const transcriber = useTranscriber({
|
|
258
|
+
audioStreamTrack: track,
|
|
259
|
+
onSegments: handleSegments
|
|
260
|
+
});
|
|
261
|
+
useEffect6(() => {
|
|
262
|
+
const ctx = new Context2(void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L: 29 });
|
|
263
|
+
scheduleMicroTask(ctx, async () => {
|
|
264
|
+
if (active && transcriber) {
|
|
265
|
+
await transcriber.open();
|
|
266
|
+
log3.info("starting...", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L: 33, S: void 0 });
|
|
267
|
+
setRecording(true);
|
|
268
|
+
void soundStart.play();
|
|
269
|
+
transcriber.startChunksRecording();
|
|
270
|
+
} else if (!active && transcriber?.isOpen) {
|
|
271
|
+
transcriber?.stopChunksRecording();
|
|
272
|
+
await transcriber?.close();
|
|
273
|
+
log3.info("stopped", void 0, { "~LogMeta": "~LogMeta", F: __dxlog_file3, L: 40, S: void 0 });
|
|
274
|
+
setRecording(false);
|
|
275
|
+
void soundStop.play();
|
|
276
|
+
}
|
|
277
|
+
});
|
|
278
|
+
return () => {
|
|
279
|
+
void ctx.dispose();
|
|
280
|
+
};
|
|
281
|
+
}, [
|
|
282
|
+
active,
|
|
283
|
+
transcriber
|
|
284
|
+
]);
|
|
285
|
+
return {
|
|
286
|
+
recording
|
|
287
|
+
};
|
|
288
|
+
};
|
|
289
|
+
|
|
290
|
+
export {
|
|
291
|
+
useAudioFile,
|
|
292
|
+
useAudioTrack,
|
|
293
|
+
useFeedModelAdapter,
|
|
294
|
+
useTranscriber,
|
|
295
|
+
useTranscriptionRecording,
|
|
296
|
+
useVoiceInput
|
|
297
|
+
};
|
|
298
|
+
//# sourceMappingURL=chunk-2O3ONPRZ.mjs.map
|