@dxos/plugin-transcription 0.8.4-main.dedc0f3 → 0.8.4-main.dfabb4ec29
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/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/{browser/chunk-BA64VLLR.mjs → neutral/chunk-LS3R7EQI.mjs} +129 -185
- 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/meta.mjs.map +7 -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/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-QF4MUMWG.mjs +26 -0
- 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/{node-esm/transcriber-QPS55YP2.mjs → neutral/transcriber-M3R6HPTZ.mjs} +20 -18
- 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/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/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/Transcription/Transcription.d.ts +18 -0
- package/dist/types/src/components/Transcription/Transcription.d.ts.map +1 -0
- package/dist/types/src/components/Transcription/Transcription.stories.d.ts +40 -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 +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 +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/meta.d.ts +2 -3
- 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 +5 -5
- 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/{components/stories → stories}/FileTranscription.stories.d.ts +3 -4
- package/dist/types/src/stories/FileTranscription.stories.d.ts.map +1 -0
- package/dist/types/src/{components/stories → stories}/KeyWordRecognition.stories.d.ts +2 -3
- package/dist/types/src/stories/KeyWordRecognition.stories.d.ts.map +1 -0
- package/dist/types/src/{components/stories → stories}/MicrophoneTranscription.stories.d.ts +5 -6
- 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 +10 -10
- 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 +60 -5
- 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 +9 -6
- 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 -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 +148 -82
- package/src/TranscriptionPlugin.node.ts +20 -0
- package/src/TranscriptionPlugin.test.ts +31 -0
- package/src/TranscriptionPlugin.tsx +22 -66
- 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/{Transcript/Transcript.stories.tsx → Transcription/Transcription.stories.tsx} +62 -59
- 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} +13 -9
- 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/useAudioFile.ts +50 -45
- package/src/hooks/useQueueModelAdapter.ts +1 -1
- package/src/hooks/useTranscriber.ts +12 -4
- package/src/hooks/useVoiceInput.ts +2 -3
- package/src/index.ts +4 -5
- package/src/meta.ts +9 -6
- package/src/model/model.test.ts +20 -14
- package/src/model/model.ts +3 -3
- package/src/{segments-normalization → normalization}/message-normalizer.ts +19 -18
- package/src/{segments-normalization → normalization}/normalization.test.ts +7 -12
- 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/{components/stories → stories}/FileTranscription.stories.tsx +56 -43
- package/src/{components/stories → stories}/KeyWordRecognition.stories.tsx +36 -36
- package/src/{components/stories → stories}/MicrophoneTranscription.stories.tsx +60 -81
- package/src/stories/TranscriptionStory.tsx +93 -0
- package/src/testing/testing.ts +37 -37
- 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 +99 -58
- package/src/transcriber/transcription-manager.ts +21 -15
- 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 -3
- package/src/util/index.ts +1 -0
- package/src/util/render-byline.ts +33 -0
- package/dist/lib/browser/TranscriptContainer-4RBK74JP.mjs +0 -11
- package/dist/lib/browser/blueprint-definition-TJABB43G.mjs +0 -142
- package/dist/lib/browser/blueprint-definition-TJABB43G.mjs.map +0 -7
- package/dist/lib/browser/chunk-3X7HP44M.mjs +0 -26
- package/dist/lib/browser/chunk-3X7HP44M.mjs.map +0 -7
- package/dist/lib/browser/chunk-AGZYQGSP.mjs +0 -8
- package/dist/lib/browser/chunk-AGZYQGSP.mjs.map +0 -7
- package/dist/lib/browser/chunk-BA64VLLR.mjs.map +0 -7
- package/dist/lib/browser/chunk-HXVGV7T6.mjs +0 -63
- package/dist/lib/browser/chunk-HXVGV7T6.mjs.map +0 -7
- package/dist/lib/browser/chunk-TNEQFHIU.mjs +0 -16
- package/dist/lib/browser/chunk-TNEQFHIU.mjs.map +0 -7
- package/dist/lib/browser/chunk-VVXRHJCH.mjs +0 -746
- package/dist/lib/browser/chunk-VVXRHJCH.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -131
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-T3EGLS3L.mjs +0 -25
- package/dist/lib/browser/intent-resolver-T3EGLS3L.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/react-surface-4Y3YISAD.mjs +0 -34
- package/dist/lib/browser/react-surface-4Y3YISAD.mjs.map +0 -7
- package/dist/lib/browser/transcriber-JOOAQVYV.mjs +0 -56
- package/dist/lib/browser/transcriber-JOOAQVYV.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -12
- package/dist/lib/node-esm/TranscriptContainer-EGAAYVOP.mjs +0 -12
- package/dist/lib/node-esm/blueprint-definition-R4UF7YJZ.mjs +0 -143
- package/dist/lib/node-esm/blueprint-definition-R4UF7YJZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-3QAIZGMW.mjs +0 -17
- package/dist/lib/node-esm/chunk-3QAIZGMW.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-CF5Z6FAB.mjs +0 -10
- package/dist/lib/node-esm/chunk-CF5Z6FAB.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-J5GQ3KGX.mjs +0 -487
- package/dist/lib/node-esm/chunk-J5GQ3KGX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-QARUDLHN.mjs +0 -27
- package/dist/lib/node-esm/chunk-QARUDLHN.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SFQNMFHX.mjs +0 -747
- package/dist/lib/node-esm/chunk-SFQNMFHX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-W72HVQMD.mjs +0 -64
- package/dist/lib/node-esm/chunk-W72HVQMD.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -132
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-VDHCUAIO.mjs +0 -26
- package/dist/lib/node-esm/intent-resolver-VDHCUAIO.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/react-surface-ZIXDGJAN.mjs +0 -35
- package/dist/lib/node-esm/react-surface-ZIXDGJAN.mjs.map +0 -7
- package/dist/lib/node-esm/transcriber-QPS55YP2.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.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 -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/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 -461
- 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.map +0 -1
- package/src/capabilities/capabilities.ts +0 -33
- package/src/capabilities/intent-resolver.ts +0 -18
- 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/TranscriptionStory.tsx +0 -45
- package/src/functions/index.ts +0 -6
- package/src/functions/open.ts +0 -37
- package/src/functions/summarize.ts +0 -97
- package/src/segments-normalization/normalization.ts +0 -115
- package/src/types/Transcript.ts +0 -44
- package/src/types/TranscriptAction.ts +0 -24
- package/dist/lib/{browser/types → neutral/blueprints}/index.mjs.map +0 -0
- package/dist/lib/{browser/TranscriptContainer-4RBK74JP.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-EGAAYVOP.mjs.map → neutral/index.mjs.map} +0 -0
- package/dist/types/src/{segments-normalization → normalization}/normalization.test.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/{components/stories → stories}/useIsSpeaking.tsx +0 -0
- /package/src/types/{types.ts → defs.ts} +0 -0
|
@@ -2,37 +2,35 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
8
7
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
9
8
|
|
|
10
|
-
import { Events, IntentPlugin, SettingsPlugin } from '@dxos/app-framework';
|
|
11
9
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
|
+
import { AppActivationEvents } from '@dxos/app-toolkit';
|
|
12
11
|
import { scheduleTask } from '@dxos/async';
|
|
13
12
|
import { Context } from '@dxos/context';
|
|
14
13
|
import { Obj } from '@dxos/echo';
|
|
15
14
|
import { MemoryQueue } from '@dxos/echo-db';
|
|
16
|
-
import { createQueueDXN } from '@dxos/echo
|
|
17
|
-
import { FunctionExecutor, ServiceContainer } from '@dxos/functions';
|
|
15
|
+
import { createQueueDXN } from '@dxos/echo/internal';
|
|
16
|
+
import { FunctionExecutor, ServiceContainer } from '@dxos/functions-runtime';
|
|
18
17
|
import { log } from '@dxos/log';
|
|
19
|
-
import { ClientPlugin } from '@dxos/plugin-client';
|
|
20
|
-
import {
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
18
|
+
import { ClientPlugin } from '@dxos/plugin-client/plugin';
|
|
19
|
+
import { initializeIdentity } from '@dxos/plugin-client/testing';
|
|
20
|
+
import { PreviewPlugin } from '@dxos/plugin-preview/testing';
|
|
21
|
+
import { StorybookPlugin, corePlugins } from '@dxos/plugin-testing';
|
|
22
|
+
import { withLayout } from '@dxos/react-ui/testing';
|
|
23
|
+
import { TestSchema } from '@dxos/schema/testing';
|
|
24
|
+
import { type Actor, Message, Organization, Person } from '@dxos/types';
|
|
25
|
+
import { seedTestData } from '@dxos/types/testing';
|
|
28
26
|
|
|
29
|
-
import { useAudioFile, useQueueModelAdapter, useTranscriber } from '
|
|
30
|
-
import {
|
|
31
|
-
import { TestItem } from '../../testing';
|
|
32
|
-
import { type MediaStreamRecorderParams, type TranscriberParams } from '../../transcriber';
|
|
33
|
-
import { TranscriptionPlugin } from '../../TranscriptionPlugin';
|
|
34
|
-
import { renderByline } from '../Transcript';
|
|
27
|
+
import { useAudioFile, useQueueModelAdapter, useTranscriber } from '#hooks';
|
|
28
|
+
import { TestItem } from '#testing';
|
|
35
29
|
|
|
30
|
+
import { MessageNormalizer, getActorId } from '../normalization';
|
|
31
|
+
import { type MediaStreamRecorderProps, type TranscriberProps } from '../transcriber';
|
|
32
|
+
import { TranscriptionPlugin } from '../TranscriptionPlugin';
|
|
33
|
+
import { renderByline } from '../util';
|
|
36
34
|
import { TranscriptionStory } from './TranscriptionStory';
|
|
37
35
|
import { useIsSpeaking } from './useIsSpeaking';
|
|
38
36
|
|
|
@@ -47,15 +45,33 @@ const AudioFile = ({
|
|
|
47
45
|
detectSpeaking?: boolean;
|
|
48
46
|
normalizeSentences?: boolean;
|
|
49
47
|
audioUrl: string;
|
|
50
|
-
transcriberConfig?:
|
|
51
|
-
recorderConfig?:
|
|
48
|
+
transcriberConfig?: TranscriberProps['config'];
|
|
49
|
+
recorderConfig?: MediaStreamRecorderProps['config'];
|
|
52
50
|
audioConstraints?: MediaTrackConstraints;
|
|
53
51
|
}) => {
|
|
54
52
|
const [running, setRunning] = useState(false);
|
|
55
|
-
const actor:
|
|
53
|
+
const actor: Actor.Actor = useMemo(() => ({ name: 'You' }), []);
|
|
54
|
+
|
|
55
|
+
// Optional uploaded file overrides the default URL.
|
|
56
|
+
// The useEffect below revokes the previous URL whenever it changes (and on unmount).
|
|
57
|
+
const [uploadedUrl, setUploadedUrl] = useState<string>();
|
|
58
|
+
useEffect(() => {
|
|
59
|
+
return () => {
|
|
60
|
+
if (uploadedUrl) {
|
|
61
|
+
URL.revokeObjectURL(uploadedUrl);
|
|
62
|
+
}
|
|
63
|
+
};
|
|
64
|
+
}, [uploadedUrl]);
|
|
65
|
+
|
|
66
|
+
const handleUpload = useCallback((file: File) => {
|
|
67
|
+
setRunning(false);
|
|
68
|
+
setUploadedUrl(URL.createObjectURL(file));
|
|
69
|
+
}, []);
|
|
70
|
+
|
|
71
|
+
const sourceUrl = uploadedUrl ?? audioUrl;
|
|
56
72
|
|
|
57
73
|
// Audio.
|
|
58
|
-
const { audio, track, stream } = useAudioFile(
|
|
74
|
+
const { audio, track, stream } = useAudioFile(sourceUrl, audioConstraints);
|
|
59
75
|
|
|
60
76
|
// Speaking.
|
|
61
77
|
const isSpeaking = detectSpeaking ? useIsSpeaking(track) : true;
|
|
@@ -81,13 +97,13 @@ const AudioFile = ({
|
|
|
81
97
|
// Transcriber.
|
|
82
98
|
// TODO(dmaretskyi): Use space.queues.create() instead.
|
|
83
99
|
const queueDxn = useMemo(() => createQueueDXN(), []);
|
|
84
|
-
const queue = useMemo(() => new MemoryQueue<
|
|
100
|
+
const queue = useMemo(() => new MemoryQueue<Message.Message>(queueDxn), [queueDxn]);
|
|
85
101
|
|
|
86
102
|
const model = useQueueModelAdapter(renderByline([]), queue);
|
|
87
|
-
const handleSegments = useCallback<
|
|
103
|
+
const handleSegments = useCallback<TranscriberProps['onSegments']>(
|
|
88
104
|
async (blocks) => {
|
|
89
105
|
void queue?.append([
|
|
90
|
-
Obj.make(
|
|
106
|
+
Obj.make(Message.Message, {
|
|
91
107
|
created: new Date().toISOString(),
|
|
92
108
|
sender: actor,
|
|
93
109
|
blocks,
|
|
@@ -182,36 +198,33 @@ const AudioFile = ({
|
|
|
182
198
|
running={running}
|
|
183
199
|
onRunningChange={setRunning}
|
|
184
200
|
audioRef={ref}
|
|
201
|
+
onUpload={handleUpload}
|
|
185
202
|
/>
|
|
186
203
|
);
|
|
187
204
|
};
|
|
188
205
|
|
|
189
206
|
const meta = {
|
|
190
|
-
title: 'plugins/plugin-transcription/FileTranscription',
|
|
207
|
+
title: 'plugins/plugin-transcription/components/FileTranscription',
|
|
191
208
|
decorators: [
|
|
209
|
+
withLayout({ layout: 'column' }),
|
|
192
210
|
withPluginManager({
|
|
193
211
|
plugins: [
|
|
194
|
-
|
|
195
|
-
|
|
212
|
+
...corePlugins(),
|
|
213
|
+
StorybookPlugin({}),
|
|
196
214
|
ClientPlugin({
|
|
197
|
-
types: [TestItem,
|
|
198
|
-
onClientInitialized:
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
},
|
|
215
|
+
types: [TestItem, Person.Person, Organization.Organization, TestSchema.DocumentType],
|
|
216
|
+
onClientInitialized: ({ client }) =>
|
|
217
|
+
Effect.gen(function* () {
|
|
218
|
+
const { personalSpace } = yield* initializeIdentity(client);
|
|
219
|
+
yield* Effect.promise(() => seedTestData(personalSpace));
|
|
220
|
+
}),
|
|
204
221
|
}),
|
|
205
|
-
|
|
206
|
-
SettingsPlugin(),
|
|
222
|
+
|
|
207
223
|
PreviewPlugin(),
|
|
208
|
-
IntentPlugin(),
|
|
209
224
|
TranscriptionPlugin(),
|
|
210
225
|
],
|
|
211
|
-
fireEvents: [
|
|
226
|
+
fireEvents: [AppActivationEvents.SetupAppGraph],
|
|
212
227
|
}),
|
|
213
|
-
withTheme,
|
|
214
|
-
withLayout({ fullscreen: true, classNames: 'justify-center' }),
|
|
215
228
|
],
|
|
216
229
|
} satisfies Meta;
|
|
217
230
|
|
|
@@ -2,26 +2,24 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
6
|
import React, { useEffect, useMemo, useState } from 'react';
|
|
9
7
|
|
|
10
8
|
import { log } from '@dxos/log';
|
|
11
|
-
import { Toolbar } from '@dxos/react-ui';
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
9
|
+
import { Panel, Toolbar } from '@dxos/react-ui';
|
|
10
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
11
|
+
import { mx } from '@dxos/ui-theme';
|
|
14
12
|
|
|
15
13
|
type Word = {
|
|
16
14
|
text: string;
|
|
17
15
|
matched: boolean;
|
|
18
16
|
};
|
|
19
17
|
|
|
20
|
-
type
|
|
18
|
+
type DefaultStoryProps = {
|
|
21
19
|
keywords: string[];
|
|
22
20
|
};
|
|
23
21
|
|
|
24
|
-
const DefaultStory = ({ keywords }:
|
|
22
|
+
const DefaultStory = ({ keywords }: DefaultStoryProps) => {
|
|
25
23
|
const [running, setRunning] = useState(false);
|
|
26
24
|
const [matchingWords, setMatchingWords] = useState<Word[]>(keywords.map((word) => ({ text: word, matched: false })));
|
|
27
25
|
|
|
@@ -88,39 +86,41 @@ const DefaultStory = ({ keywords }: StoryProps) => {
|
|
|
88
86
|
}, [running, recognition]);
|
|
89
87
|
|
|
90
88
|
return (
|
|
91
|
-
<
|
|
92
|
-
<Toolbar
|
|
93
|
-
<Toolbar.
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
89
|
+
<Panel.Root>
|
|
90
|
+
<Panel.Toolbar asChild>
|
|
91
|
+
<Toolbar.Root>
|
|
92
|
+
<Toolbar.IconButton
|
|
93
|
+
iconOnly
|
|
94
|
+
icon={running ? 'ph--pause--regular' : 'ph--play--regular'}
|
|
95
|
+
label={running ? 'Pause' : 'Play'}
|
|
96
|
+
onClick={() => setRunning((running) => !running)}
|
|
97
|
+
/>
|
|
98
|
+
</Toolbar.Root>
|
|
99
|
+
</Panel.Toolbar>
|
|
100
|
+
|
|
101
|
+
<Panel.Content>
|
|
102
|
+
<div className='p-4 grid grid-cols-[repeat(auto-fill,minmax(6rem,1fr))] gap-2'>
|
|
103
|
+
{matchingWords.map((word, index) => (
|
|
104
|
+
<span
|
|
105
|
+
key={index}
|
|
106
|
+
className={mx(
|
|
107
|
+
'grid place-items-center p-2 aspect-square rounded-sm border border-separator',
|
|
108
|
+
word.matched && 'border-red-300',
|
|
109
|
+
)}
|
|
110
|
+
>
|
|
111
|
+
{word.text}
|
|
112
|
+
</span>
|
|
113
|
+
))}
|
|
114
|
+
</div>
|
|
115
|
+
</Panel.Content>
|
|
116
|
+
</Panel.Root>
|
|
117
117
|
);
|
|
118
118
|
};
|
|
119
119
|
|
|
120
120
|
const meta = {
|
|
121
|
-
title: 'plugins/plugin-transcription/KeyWordDetection',
|
|
121
|
+
title: 'plugins/plugin-transcription/components/KeyWordDetection',
|
|
122
122
|
render: DefaultStory,
|
|
123
|
-
decorators: [withTheme, withLayout({
|
|
123
|
+
decorators: [withTheme(), withLayout({ layout: 'column' })],
|
|
124
124
|
} satisfies Meta<typeof DefaultStory>;
|
|
125
125
|
|
|
126
126
|
export default meta;
|
|
@@ -129,6 +129,6 @@ type Story = StoryObj<typeof meta>;
|
|
|
129
129
|
|
|
130
130
|
export const SpeechRecognitionAPI: Story = {
|
|
131
131
|
args: {
|
|
132
|
-
keywords: ['kai', 'computer', 'hello'],
|
|
132
|
+
keywords: ['kai', 'computer', 'hello', 'dxos'],
|
|
133
133
|
},
|
|
134
134
|
};
|
|
@@ -2,13 +2,12 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@dxos-theme';
|
|
6
|
-
|
|
7
5
|
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
8
7
|
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
9
8
|
|
|
10
|
-
import { Events, IntentPlugin, SettingsPlugin } from '@dxos/app-framework';
|
|
11
9
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
|
+
import { AppActivationEvents } from '@dxos/app-toolkit';
|
|
12
11
|
import {
|
|
13
12
|
type ExtractionFunction,
|
|
14
13
|
extractionAnthropicFunction,
|
|
@@ -16,29 +15,27 @@ import {
|
|
|
16
15
|
getNer,
|
|
17
16
|
processTranscriptMessage,
|
|
18
17
|
} from '@dxos/assistant/extraction';
|
|
19
|
-
import { Filter,
|
|
18
|
+
import { Filter, type Obj } from '@dxos/echo';
|
|
20
19
|
import { MemoryQueue } from '@dxos/echo-db';
|
|
21
|
-
import { createQueueDXN } from '@dxos/echo
|
|
22
|
-
import { FunctionExecutor, ServiceContainer } from '@dxos/functions';
|
|
20
|
+
import { createQueueDXN } from '@dxos/echo/internal';
|
|
23
21
|
import { invariant } from '@dxos/invariant';
|
|
24
22
|
import { log } from '@dxos/log';
|
|
25
|
-
import { ClientPlugin } from '@dxos/plugin-client';
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
import {
|
|
30
|
-
import {
|
|
31
|
-
import {
|
|
32
|
-
import {
|
|
33
|
-
import {
|
|
34
|
-
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
23
|
+
import { ClientPlugin } from '@dxos/plugin-client/plugin';
|
|
24
|
+
import { initializeIdentity } from '@dxos/plugin-client/testing';
|
|
25
|
+
import { PreviewPlugin } from '@dxos/plugin-preview/testing';
|
|
26
|
+
import { StorybookPlugin, corePlugins } from '@dxos/plugin-testing';
|
|
27
|
+
import { IndexKind, useSpaces } from '@dxos/react-client/echo';
|
|
28
|
+
import { withLayout } from '@dxos/react-ui/testing';
|
|
29
|
+
import { TestSchema } from '@dxos/schema/testing';
|
|
30
|
+
import { Message, Organization, Person } from '@dxos/types';
|
|
31
|
+
import { seedTestData } from '@dxos/types/testing';
|
|
35
32
|
|
|
36
|
-
import { useAudioTrack, useQueueModelAdapter, useTranscriber } from '
|
|
37
|
-
import { TestItem } from '
|
|
38
|
-
import { type MediaStreamRecorderParams, type TranscriberParams } from '../../transcriber';
|
|
39
|
-
import { TranscriptionPlugin } from '../../TranscriptionPlugin';
|
|
40
|
-
import { renderByline } from '../Transcript';
|
|
33
|
+
import { useAudioTrack, useQueueModelAdapter, useTranscriber } from '#hooks';
|
|
34
|
+
import { TestItem } from '#testing';
|
|
41
35
|
|
|
36
|
+
import { type MediaStreamRecorderProps, type TranscriberProps } from '../transcriber';
|
|
37
|
+
import { TranscriptionPlugin } from '../TranscriptionPlugin';
|
|
38
|
+
import { renderByline } from '../util';
|
|
42
39
|
import { TranscriptionStory } from './TranscriptionStory';
|
|
43
40
|
import { useIsSpeaking } from './useIsSpeaking';
|
|
44
41
|
|
|
@@ -51,10 +48,10 @@ const RECORDER_CONFIG = {
|
|
|
51
48
|
interval: 200,
|
|
52
49
|
};
|
|
53
50
|
|
|
54
|
-
type
|
|
51
|
+
type DefaultStoryProps = {
|
|
55
52
|
detectSpeaking?: boolean;
|
|
56
|
-
transcriberConfig:
|
|
57
|
-
recorderConfig:
|
|
53
|
+
transcriberConfig: TranscriberProps['config'];
|
|
54
|
+
recorderConfig: MediaStreamRecorderProps['config'];
|
|
58
55
|
audioConstraints?: MediaTrackConstraints;
|
|
59
56
|
entityExtraction: 'none' | 'ner' | 'llm';
|
|
60
57
|
};
|
|
@@ -65,7 +62,7 @@ const DefaultStory = ({
|
|
|
65
62
|
transcriberConfig,
|
|
66
63
|
recorderConfig,
|
|
67
64
|
audioConstraints,
|
|
68
|
-
}:
|
|
65
|
+
}: DefaultStoryProps) => {
|
|
69
66
|
const [running, setRunning] = useState(false);
|
|
70
67
|
|
|
71
68
|
// Audio.
|
|
@@ -77,9 +74,9 @@ const DefaultStory = ({
|
|
|
77
74
|
// Queue.
|
|
78
75
|
// TODO(dmaretskyi): Use space.queues.create() instead.
|
|
79
76
|
const queueDxn = useMemo(() => createQueueDXN(), []);
|
|
80
|
-
const queue = useMemo(() => new MemoryQueue<
|
|
77
|
+
const queue = useMemo(() => new MemoryQueue<Message.Message>(queueDxn), [queueDxn]);
|
|
81
78
|
const model = useQueueModelAdapter(renderByline([]), queue);
|
|
82
|
-
const space =
|
|
79
|
+
const [space] = useSpaces();
|
|
83
80
|
|
|
84
81
|
useEffect(() => {
|
|
85
82
|
if (!space) {
|
|
@@ -88,15 +85,14 @@ const DefaultStory = ({
|
|
|
88
85
|
}, [space]);
|
|
89
86
|
|
|
90
87
|
// Entity extraction.
|
|
91
|
-
const { extractionFunction,
|
|
88
|
+
const { extractionFunction, objects } = useMemo(() => {
|
|
92
89
|
if (!space) {
|
|
93
90
|
log.warn('no space');
|
|
94
91
|
return {};
|
|
95
92
|
}
|
|
96
93
|
|
|
97
|
-
let executor: FunctionExecutor | undefined;
|
|
98
94
|
let extractionFunction: ExtractionFunction | undefined;
|
|
99
|
-
let objects: Promise<
|
|
95
|
+
let objects: Promise<Obj.Unknown[]> | undefined;
|
|
100
96
|
|
|
101
97
|
if (entityExtraction === 'ner') {
|
|
102
98
|
// Init model loading. Takes time.
|
|
@@ -107,34 +103,21 @@ const DefaultStory = ({
|
|
|
107
103
|
objects = space.db
|
|
108
104
|
.query(
|
|
109
105
|
Filter.or(
|
|
110
|
-
Filter.type(
|
|
111
|
-
Filter.type(
|
|
112
|
-
Filter.type(
|
|
106
|
+
Filter.type(Person.Person),
|
|
107
|
+
Filter.type(Organization.Organization),
|
|
108
|
+
Filter.type(TestSchema.DocumentType),
|
|
113
109
|
),
|
|
114
110
|
)
|
|
115
|
-
.run()
|
|
116
|
-
.then((result) => result.objects);
|
|
117
|
-
}
|
|
118
|
-
if (entityExtraction !== 'none') {
|
|
119
|
-
executor = new FunctionExecutor(
|
|
120
|
-
new ServiceContainer().setServices({
|
|
121
|
-
// ai: {
|
|
122
|
-
// client: new Edge AiServiceClient({
|
|
123
|
-
// endpoint: AI_SERVICE_ENDPOINT.REMOTE,
|
|
124
|
-
// }),
|
|
125
|
-
// },
|
|
126
|
-
// database: { db: space!.db },
|
|
127
|
-
}),
|
|
128
|
-
);
|
|
111
|
+
.run();
|
|
129
112
|
}
|
|
130
113
|
|
|
131
|
-
return { extractionFunction,
|
|
114
|
+
return { extractionFunction, objects };
|
|
132
115
|
}, [entityExtraction, space]);
|
|
133
116
|
|
|
134
117
|
// Transcriber.
|
|
135
|
-
const handleSegments = useCallback<
|
|
118
|
+
const handleSegments = useCallback<TranscriberProps['onSegments']>(
|
|
136
119
|
async (blocks) => {
|
|
137
|
-
const message =
|
|
120
|
+
const message = Message.make({
|
|
138
121
|
sender: { name: 'You' },
|
|
139
122
|
created: new Date().toISOString(),
|
|
140
123
|
blocks,
|
|
@@ -146,9 +129,7 @@ const DefaultStory = ({
|
|
|
146
129
|
|
|
147
130
|
if (entityExtraction !== 'none') {
|
|
148
131
|
invariant(extractionFunction, 'extractionFunction is required');
|
|
149
|
-
invariant(executor, 'executor is required');
|
|
150
132
|
const result = await processTranscriptMessage({
|
|
151
|
-
executor,
|
|
152
133
|
function: extractionFunction,
|
|
153
134
|
input: {
|
|
154
135
|
message,
|
|
@@ -194,45 +175,43 @@ const DefaultStory = ({
|
|
|
194
175
|
};
|
|
195
176
|
|
|
196
177
|
const meta = {
|
|
197
|
-
title: 'plugins/plugin-transcription/MicrophoneTranscription',
|
|
178
|
+
title: 'plugins/plugin-transcription/components/MicrophoneTranscription',
|
|
198
179
|
render: DefaultStory,
|
|
199
180
|
decorators: [
|
|
181
|
+
withLayout({ layout: 'column' }),
|
|
200
182
|
withPluginManager({
|
|
201
183
|
plugins: [
|
|
202
|
-
|
|
203
|
-
|
|
184
|
+
...corePlugins(),
|
|
185
|
+
StorybookPlugin({}),
|
|
204
186
|
ClientPlugin({
|
|
205
|
-
types: [TestItem,
|
|
206
|
-
onClientInitialized:
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
187
|
+
types: [TestItem, Person.Person, Organization.Organization, TestSchema.DocumentType],
|
|
188
|
+
onClientInitialized: ({ client }) =>
|
|
189
|
+
Effect.gen(function* () {
|
|
190
|
+
const { personalSpace } = yield* initializeIdentity(client);
|
|
191
|
+
// TODO(mykola): Make API easier to use.
|
|
192
|
+
// TODO(mykola): Delete after enabling vector indexing by default.
|
|
193
|
+
// Enable vector indexing.
|
|
194
|
+
yield* Effect.promise(() =>
|
|
195
|
+
client.services.services.QueryService!.setConfig({
|
|
196
|
+
enabled: true,
|
|
197
|
+
indexes: [
|
|
198
|
+
//
|
|
199
|
+
{ kind: IndexKind.Kind.SCHEMA_MATCH },
|
|
200
|
+
{ kind: IndexKind.Kind.GRAPH },
|
|
201
|
+
{ kind: IndexKind.Kind.VECTOR },
|
|
202
|
+
],
|
|
203
|
+
}),
|
|
204
|
+
);
|
|
205
|
+
yield* Effect.promise(() => client.services.services.QueryService!.reindex());
|
|
206
|
+
yield* Effect.promise(() => seedTestData(personalSpace));
|
|
207
|
+
}),
|
|
225
208
|
}),
|
|
226
|
-
|
|
227
|
-
SettingsPlugin(),
|
|
209
|
+
|
|
228
210
|
PreviewPlugin(),
|
|
229
|
-
IntentPlugin(),
|
|
230
211
|
TranscriptionPlugin(),
|
|
231
212
|
],
|
|
232
|
-
fireEvents: [
|
|
213
|
+
fireEvents: [AppActivationEvents.SetupAppGraph],
|
|
233
214
|
}),
|
|
234
|
-
withTheme,
|
|
235
|
-
withLayout({ fullscreen: true, classNames: 'justify-center' }),
|
|
236
215
|
],
|
|
237
216
|
} satisfies Meta<typeof DefaultStory>;
|
|
238
217
|
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import '@dxos-theme';
|
|
6
|
+
|
|
7
|
+
import React, {
|
|
8
|
+
type ChangeEvent,
|
|
9
|
+
type Dispatch,
|
|
10
|
+
type FC,
|
|
11
|
+
type ReactNode,
|
|
12
|
+
type RefObject,
|
|
13
|
+
type SetStateAction,
|
|
14
|
+
useRef,
|
|
15
|
+
} from 'react';
|
|
16
|
+
|
|
17
|
+
import { IconButton, ScrollContainer, Toolbar } from '@dxos/react-ui';
|
|
18
|
+
import { type Message } from '@dxos/types';
|
|
19
|
+
|
|
20
|
+
import { Transcription } from '../components';
|
|
21
|
+
import { type SerializationModel } from '../model';
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Story wrapper that renders a transcript with playback controls, an optional audio file
|
|
25
|
+
* upload affordance, and a toolbar slot for additional controls.
|
|
26
|
+
*
|
|
27
|
+
* @param onUpload - Callback fired when the user picks a local audio file via the upload button.
|
|
28
|
+
* @param uploadAccept - HTML `accept` filter for the hidden file input. Defaults to `audio/*`.
|
|
29
|
+
* @param toolbarSlot - Extra content rendered after the upload button inside the toolbar.
|
|
30
|
+
*/
|
|
31
|
+
export const TranscriptionStory: FC<{
|
|
32
|
+
model: SerializationModel<Message.Message>;
|
|
33
|
+
disabled?: boolean;
|
|
34
|
+
running: boolean;
|
|
35
|
+
onRunningChange: Dispatch<SetStateAction<boolean>>;
|
|
36
|
+
audioRef?: RefObject<HTMLAudioElement | null>;
|
|
37
|
+
onUpload?: (file: File) => void;
|
|
38
|
+
uploadAccept?: string;
|
|
39
|
+
toolbarSlot?: ReactNode;
|
|
40
|
+
}> = ({ model, running, onRunningChange, audioRef, disabled, onUpload, uploadAccept = 'audio/*', toolbarSlot }) => {
|
|
41
|
+
const fileInputRef = useRef<HTMLInputElement>(null);
|
|
42
|
+
|
|
43
|
+
const handleFileChange = (event: ChangeEvent<HTMLInputElement>) => {
|
|
44
|
+
const file = event.target.files?.[0];
|
|
45
|
+
if (file && onUpload) {
|
|
46
|
+
onUpload(file);
|
|
47
|
+
}
|
|
48
|
+
// Reset so the same file can be re-selected.
|
|
49
|
+
event.target.value = '';
|
|
50
|
+
};
|
|
51
|
+
|
|
52
|
+
return (
|
|
53
|
+
<>
|
|
54
|
+
{audioRef && <audio ref={audioRef} autoPlay />}
|
|
55
|
+
<Toolbar.Root>
|
|
56
|
+
<IconButton
|
|
57
|
+
iconOnly
|
|
58
|
+
disabled={disabled}
|
|
59
|
+
icon={running ? 'ph--pause--regular' : 'ph--play--regular'}
|
|
60
|
+
label={running ? 'Pause' : 'Play'}
|
|
61
|
+
onClick={() => onRunningChange((running) => !running)}
|
|
62
|
+
/>
|
|
63
|
+
{onUpload && (
|
|
64
|
+
<>
|
|
65
|
+
<input
|
|
66
|
+
ref={fileInputRef}
|
|
67
|
+
type='file'
|
|
68
|
+
accept={uploadAccept}
|
|
69
|
+
disabled={disabled}
|
|
70
|
+
className='hidden'
|
|
71
|
+
onChange={handleFileChange}
|
|
72
|
+
/>
|
|
73
|
+
<IconButton
|
|
74
|
+
iconOnly
|
|
75
|
+
disabled={disabled}
|
|
76
|
+
icon='ph--upload--regular'
|
|
77
|
+
label='Upload audio'
|
|
78
|
+
onClick={() => fileInputRef.current?.click()}
|
|
79
|
+
/>
|
|
80
|
+
</>
|
|
81
|
+
)}
|
|
82
|
+
{toolbarSlot}
|
|
83
|
+
</Toolbar.Root>
|
|
84
|
+
<ScrollContainer.Root pin>
|
|
85
|
+
<ScrollContainer.Content>
|
|
86
|
+
<ScrollContainer.Viewport>
|
|
87
|
+
<Transcription model={model} />
|
|
88
|
+
</ScrollContainer.Viewport>
|
|
89
|
+
</ScrollContainer.Content>
|
|
90
|
+
</ScrollContainer.Root>
|
|
91
|
+
</>
|
|
92
|
+
);
|
|
93
|
+
};
|