@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
|
@@ -4,9 +4,10 @@
|
|
|
4
4
|
|
|
5
5
|
import { useEffect, useMemo } from 'react';
|
|
6
6
|
|
|
7
|
-
import { useCapabilities } from '@dxos/app-framework';
|
|
7
|
+
import { useCapabilities } from '@dxos/app-framework/ui';
|
|
8
|
+
|
|
9
|
+
import { TranscriptionCapabilities } from '#types';
|
|
8
10
|
|
|
9
|
-
import { TranscriptionCapabilities } from '../capabilities';
|
|
10
11
|
import { type Transcriber } from '../transcriber';
|
|
11
12
|
|
|
12
13
|
/**
|
|
@@ -17,6 +18,7 @@ export const useTranscriber = ({
|
|
|
17
18
|
recorderConfig,
|
|
18
19
|
transcriberConfig,
|
|
19
20
|
onSegments,
|
|
21
|
+
transcribe,
|
|
20
22
|
}: Partial<TranscriptionCapabilities.GetTranscriberProps>) => {
|
|
21
23
|
const [getTranscriber] = useCapabilities(TranscriptionCapabilities.Transcriber);
|
|
22
24
|
|
|
@@ -26,8 +28,14 @@ export const useTranscriber = ({
|
|
|
26
28
|
return undefined;
|
|
27
29
|
}
|
|
28
30
|
|
|
29
|
-
return getTranscriber({
|
|
30
|
-
|
|
31
|
+
return getTranscriber({
|
|
32
|
+
audioStreamTrack,
|
|
33
|
+
recorderConfig,
|
|
34
|
+
transcriberConfig,
|
|
35
|
+
onSegments,
|
|
36
|
+
transcribe,
|
|
37
|
+
});
|
|
38
|
+
}, [getTranscriber, audioStreamTrack, recorderConfig, transcriberConfig, onSegments, transcribe]);
|
|
31
39
|
|
|
32
40
|
useEffect(() => {
|
|
33
41
|
return () => {
|
|
@@ -9,8 +9,7 @@ import { Context } from '@dxos/context';
|
|
|
9
9
|
import { log } from '@dxos/log';
|
|
10
10
|
import { useSoundEffect } from '@dxos/react-ui-sfx';
|
|
11
11
|
|
|
12
|
-
import { type
|
|
13
|
-
|
|
12
|
+
import { type TranscriberProps } from '../transcriber';
|
|
14
13
|
import { useAudioTrack } from './useAudioTrack';
|
|
15
14
|
import { useTranscriber } from './useTranscriber';
|
|
16
15
|
|
|
@@ -26,7 +25,7 @@ export const useVoiceInput = ({ active, onUpdate }: UseVoiceInputProps) => {
|
|
|
26
25
|
const soundStart = useSoundEffect('StartRecording');
|
|
27
26
|
const soundStop = useSoundEffect('StopRecording');
|
|
28
27
|
|
|
29
|
-
const handleSegments = useCallback<
|
|
28
|
+
const handleSegments = useCallback<TranscriberProps['onSegments']>(async (segments) => {
|
|
30
29
|
const text = segments.map((str) => str.text.trim().replace(/[^\w\s]/g, '')).join(' ');
|
|
31
30
|
onUpdate(text);
|
|
32
31
|
}, []);
|
package/src/index.ts
CHANGED
|
@@ -2,11 +2,10 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
export * from './
|
|
5
|
+
// TODO(wittjosiah): Hooks should not be exported from the plugin package at all.
|
|
6
|
+
// Either refactor callers to not need them or factor them out to a shared package.
|
|
7
|
+
export * from './blueprints';
|
|
8
8
|
export * from './hooks';
|
|
9
9
|
export * from './meta';
|
|
10
10
|
export * from './transcriber';
|
|
11
|
-
|
|
12
|
-
export * from './TranscriptionPlugin';
|
|
11
|
+
export * from './types';
|
package/src/meta.ts
CHANGED
|
@@ -2,15 +2,18 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type
|
|
5
|
+
import { type Plugin } from '@dxos/app-framework';
|
|
6
|
+
import { trim } from '@dxos/util';
|
|
6
7
|
|
|
7
|
-
export const
|
|
8
|
-
|
|
9
|
-
export const meta: PluginMeta = {
|
|
10
|
-
id: TRANSCRIPTION_PLUGIN,
|
|
8
|
+
export const meta: Plugin.Meta = {
|
|
9
|
+
id: 'org.dxos.plugin.transcription',
|
|
11
10
|
name: 'Transcription',
|
|
12
|
-
description:
|
|
11
|
+
description: trim`
|
|
12
|
+
Real-time voice-to-text transcription service for capturing spoken content.
|
|
13
|
+
Convert audio input into searchable text that integrates seamlessly with notes and documents.
|
|
14
|
+
`,
|
|
13
15
|
icon: 'ph--microphone--regular',
|
|
16
|
+
iconHue: 'sky',
|
|
14
17
|
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-transcription',
|
|
15
18
|
tags: ['labs'],
|
|
16
19
|
screenshots: [],
|
package/src/model/model.test.ts
CHANGED
|
@@ -7,12 +7,12 @@ import { describe, test } from 'vitest';
|
|
|
7
7
|
|
|
8
8
|
import { Obj } from '@dxos/echo';
|
|
9
9
|
import type { ObjectId } from '@dxos/keys';
|
|
10
|
-
import {
|
|
10
|
+
import { Message } from '@dxos/types';
|
|
11
11
|
|
|
12
12
|
import { type ChunkRenderer, DocumentAdapter, SerializationModel } from './model';
|
|
13
13
|
|
|
14
|
-
const blockToMarkdown: ChunkRenderer<
|
|
15
|
-
message:
|
|
14
|
+
const blockToMarkdown: ChunkRenderer<Message.Message> = (
|
|
15
|
+
message: Message.Message,
|
|
16
16
|
index: number,
|
|
17
17
|
debug = true,
|
|
18
18
|
): string[] => {
|
|
@@ -27,12 +27,12 @@ const createDate = () => new Date().toISOString();
|
|
|
27
27
|
|
|
28
28
|
describe('SerializationModel', () => {
|
|
29
29
|
test('basic', ({ expect }) => {
|
|
30
|
-
const model = new SerializationModel<
|
|
30
|
+
const model = new SerializationModel<Message.Message>(blockToMarkdown);
|
|
31
31
|
expect(model.chunks.length).to.eq(0);
|
|
32
32
|
expect(model.doc.toString()).to.eq('');
|
|
33
33
|
|
|
34
34
|
// Create message.
|
|
35
|
-
const message = Obj.make(
|
|
35
|
+
const message = Obj.make(Message.Message, {
|
|
36
36
|
created: createDate(),
|
|
37
37
|
sender: { name: 'Alice' },
|
|
38
38
|
blocks: [
|
|
@@ -51,7 +51,9 @@ describe('SerializationModel', () => {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
// Update message.
|
|
54
|
-
|
|
54
|
+
Obj.update(message, (message) => {
|
|
55
|
+
message.blocks.push({ _tag: 'transcript', started: createDate(), text: 'Hello again!' });
|
|
56
|
+
});
|
|
55
57
|
model.updateChunk(message);
|
|
56
58
|
{
|
|
57
59
|
const text = model.doc.toString();
|
|
@@ -62,14 +64,14 @@ describe('SerializationModel', () => {
|
|
|
62
64
|
|
|
63
65
|
test('sync - append', ({ expect }) => {
|
|
64
66
|
const view = new EditorView({ extensions: [], doc: '' });
|
|
65
|
-
const model = new SerializationModel<
|
|
67
|
+
const model = new SerializationModel<Message.Message>(blockToMarkdown);
|
|
66
68
|
const adapter = new DocumentAdapter(view);
|
|
67
69
|
expect(adapter.lineCount()).to.eq(0);
|
|
68
70
|
expect(view.state.doc.toString()).to.eq('');
|
|
69
71
|
|
|
70
72
|
// Append message.
|
|
71
73
|
{
|
|
72
|
-
const message = Obj.make(
|
|
74
|
+
const message = Obj.make(Message.Message, {
|
|
73
75
|
created: createDate(),
|
|
74
76
|
sender: { name: 'Alice' },
|
|
75
77
|
blocks: [
|
|
@@ -87,7 +89,7 @@ describe('SerializationModel', () => {
|
|
|
87
89
|
|
|
88
90
|
// Append message.
|
|
89
91
|
{
|
|
90
|
-
const message = Obj.make(
|
|
92
|
+
const message = Obj.make(Message.Message, {
|
|
91
93
|
created: createDate(),
|
|
92
94
|
sender: { name: 'Bob' },
|
|
93
95
|
blocks: [
|
|
@@ -106,7 +108,7 @@ describe('SerializationModel', () => {
|
|
|
106
108
|
|
|
107
109
|
test('sync - append, update, delete', ({ expect }) => {
|
|
108
110
|
const view = new EditorView({ extensions: [], doc: '' });
|
|
109
|
-
const model = new SerializationModel<
|
|
111
|
+
const model = new SerializationModel<Message.Message>(blockToMarkdown);
|
|
110
112
|
const adapter = new DocumentAdapter(view);
|
|
111
113
|
expect(adapter.lineCount()).to.eq(0);
|
|
112
114
|
|
|
@@ -114,7 +116,7 @@ describe('SerializationModel', () => {
|
|
|
114
116
|
|
|
115
117
|
// Append message.
|
|
116
118
|
{
|
|
117
|
-
const message = Obj.make(
|
|
119
|
+
const message = Obj.make(Message.Message, {
|
|
118
120
|
created: createDate(),
|
|
119
121
|
sender: { name: 'Alice' },
|
|
120
122
|
blocks: [
|
|
@@ -131,13 +133,17 @@ describe('SerializationModel', () => {
|
|
|
131
133
|
expect(view.state.doc.toString()).to.eq('###### Alice\nHello world!\n\n');
|
|
132
134
|
|
|
133
135
|
// Update message (add block).
|
|
134
|
-
|
|
136
|
+
Obj.update(message, (message) => {
|
|
137
|
+
message.blocks.push({ _tag: 'transcript', started: createDate(), text: 'Hello again!' });
|
|
138
|
+
});
|
|
135
139
|
model.updateChunk(message);
|
|
136
140
|
model.sync(adapter);
|
|
137
141
|
expect(view.state.doc.toString()).to.eq('###### Alice\nHello world!\nHello again!\n\n');
|
|
138
142
|
|
|
139
143
|
// Update message (remove block).
|
|
140
|
-
|
|
144
|
+
Obj.update(message, (message) => {
|
|
145
|
+
message.blocks.splice(0, 1);
|
|
146
|
+
});
|
|
141
147
|
model.updateChunk(message);
|
|
142
148
|
model.sync(adapter);
|
|
143
149
|
expect(view.state.doc.toString()).to.eq('###### Alice\nHello again!\n\n');
|
|
@@ -147,7 +153,7 @@ describe('SerializationModel', () => {
|
|
|
147
153
|
|
|
148
154
|
// Append message.
|
|
149
155
|
{
|
|
150
|
-
const message = Obj.make(
|
|
156
|
+
const message = Obj.make(Message.Message, {
|
|
151
157
|
created: createDate(),
|
|
152
158
|
sender: { name: 'Bob' },
|
|
153
159
|
blocks: [{ _tag: 'transcript', started: createDate(), text: 'Hello again!' }],
|
package/src/model/model.ts
CHANGED
|
@@ -80,6 +80,9 @@ type ChunkChange<T extends Chunk> =
|
|
|
80
80
|
* Instead this model tracks changes and syncs them with the ChunkDocument.
|
|
81
81
|
*/
|
|
82
82
|
export class SerializationModel<T extends Chunk> {
|
|
83
|
+
/** Emits when the document is updated. */
|
|
84
|
+
public readonly update = new Event<void>();
|
|
85
|
+
|
|
83
86
|
/** Ordered set of chunks. */
|
|
84
87
|
private readonly _chunks: T[] = [];
|
|
85
88
|
|
|
@@ -92,9 +95,6 @@ export class SerializationModel<T extends Chunk> {
|
|
|
92
95
|
/** Track chunk changes since last sync. */
|
|
93
96
|
private readonly _changes: Array<ChunkChange<T>> = [];
|
|
94
97
|
|
|
95
|
-
/** Emits when the document is updated. */
|
|
96
|
-
public readonly update = new Event<void>();
|
|
97
|
-
|
|
98
98
|
constructor(
|
|
99
99
|
private readonly _renderer: ChunkRenderer<T>,
|
|
100
100
|
initialChunks: T[] = [],
|
|
@@ -2,28 +2,22 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
//
|
|
6
|
-
// Copyright 2025 DXOS.org
|
|
7
|
-
//
|
|
8
|
-
|
|
9
|
-
import { effect } from '@preact/signals-core';
|
|
10
|
-
|
|
11
5
|
import { DeferredTask, asyncTimeout } from '@dxos/async';
|
|
12
6
|
import { LifecycleState, Resource } from '@dxos/context';
|
|
13
7
|
import { type Queue } from '@dxos/echo-db';
|
|
14
|
-
import { type FunctionExecutor } from '@dxos/functions';
|
|
8
|
+
import { type FunctionExecutor } from '@dxos/functions-runtime';
|
|
15
9
|
import { log } from '@dxos/log';
|
|
16
|
-
import { type
|
|
10
|
+
import { type Message } from '@dxos/types';
|
|
17
11
|
|
|
18
|
-
import { type MessageWithRangeId, sentenceNormalization } from './normalization';
|
|
12
|
+
import { type MessageWithRangeId, type NormalizationOutput, sentenceNormalization } from './normalization';
|
|
19
13
|
import { getActorId } from './utils';
|
|
20
14
|
|
|
21
15
|
const PROCESSING_TIMEOUT = 20_000; // ms
|
|
22
16
|
const MAX_RANGE_ID_COUNT = 10;
|
|
23
17
|
|
|
24
|
-
export type
|
|
18
|
+
export type SegmentsNormalizerProps = {
|
|
25
19
|
functionExecutor: FunctionExecutor;
|
|
26
|
-
queue: Queue<
|
|
20
|
+
queue: Queue<Message.Message>;
|
|
27
21
|
startingCursor: QueueCursor;
|
|
28
22
|
};
|
|
29
23
|
|
|
@@ -33,16 +27,16 @@ export type QueueCursor = {
|
|
|
33
27
|
timestamp: string;
|
|
34
28
|
};
|
|
35
29
|
|
|
36
|
-
// TODO(mykola): .
|
|
37
30
|
export class MessageNormalizer extends Resource {
|
|
38
31
|
private readonly _functionExecutor: FunctionExecutor;
|
|
39
|
-
|
|
32
|
+
|
|
33
|
+
private _queue: Queue<Message.Message>;
|
|
40
34
|
private _cursor: QueueCursor;
|
|
41
35
|
private _messagesToProcess: MessageWithRangeId[] = [];
|
|
42
36
|
private _normalizationTask?: DeferredTask;
|
|
43
37
|
private _lastProcessedMessageIds?: string[];
|
|
44
38
|
|
|
45
|
-
constructor({ functionExecutor, queue, startingCursor }:
|
|
39
|
+
constructor({ functionExecutor, queue, startingCursor }: SegmentsNormalizerProps) {
|
|
46
40
|
super();
|
|
47
41
|
this._functionExecutor = functionExecutor;
|
|
48
42
|
this._queue = queue;
|
|
@@ -51,7 +45,8 @@ export class MessageNormalizer extends Resource {
|
|
|
51
45
|
|
|
52
46
|
protected override async _open(): Promise<void> {
|
|
53
47
|
this._normalizationTask = new DeferredTask(this._ctx, () => this._processMessages());
|
|
54
|
-
|
|
48
|
+
|
|
49
|
+
const updateMessages = () => {
|
|
55
50
|
if (this._lifecycleState !== LifecycleState.OPEN) {
|
|
56
51
|
return;
|
|
57
52
|
}
|
|
@@ -62,8 +57,14 @@ export class MessageNormalizer extends Resource {
|
|
|
62
57
|
});
|
|
63
58
|
|
|
64
59
|
this._normalizationTask!.schedule();
|
|
65
|
-
}
|
|
66
|
-
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
// Initial update.
|
|
63
|
+
updateMessages();
|
|
64
|
+
|
|
65
|
+
// Subscribe to queue changes.
|
|
66
|
+
const unsubscribe = this._queue.subscribe(updateMessages);
|
|
67
|
+
this._ctx.onDispose(unsubscribe);
|
|
67
68
|
}
|
|
68
69
|
|
|
69
70
|
// Need to unpack strings from blocks from messages run them through the function and then pack them back into blocks into messages.
|
|
@@ -81,7 +82,7 @@ export class MessageNormalizer extends Resource {
|
|
|
81
82
|
|
|
82
83
|
try {
|
|
83
84
|
// TODO(mykola): Executor should support timeout.
|
|
84
|
-
const response = await asyncTimeout(
|
|
85
|
+
const response: NormalizationOutput = await asyncTimeout(
|
|
85
86
|
this._functionExecutor.invoke(sentenceNormalization, { messages }),
|
|
86
87
|
PROCESSING_TIMEOUT,
|
|
87
88
|
);
|
|
@@ -2,23 +2,22 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { effect } from '@preact/signals-core';
|
|
6
5
|
import { describe, test } from 'vitest';
|
|
7
6
|
|
|
8
7
|
import { scheduleTaskInterval } from '@dxos/async';
|
|
9
8
|
import { Context } from '@dxos/context';
|
|
10
9
|
import { Obj } from '@dxos/echo';
|
|
11
10
|
import { MemoryQueue } from '@dxos/echo-db';
|
|
12
|
-
import { createQueueDXN } from '@dxos/echo
|
|
13
|
-
import { FunctionExecutor, ServiceContainer } from '@dxos/functions';
|
|
11
|
+
import { createQueueDXN } from '@dxos/echo/internal';
|
|
12
|
+
import { FunctionExecutor, ServiceContainer } from '@dxos/functions-runtime';
|
|
14
13
|
import { log } from '@dxos/log';
|
|
15
|
-
import {
|
|
14
|
+
import { type Actor, Message } from '@dxos/types';
|
|
16
15
|
|
|
17
16
|
import { MessageNormalizer } from './message-normalizer';
|
|
18
17
|
import { type MessageWithRangeId, sentenceNormalization } from './normalization';
|
|
19
18
|
import { getActorId } from './utils';
|
|
20
19
|
|
|
21
|
-
const sender:
|
|
20
|
+
const sender: Actor.Actor = {
|
|
22
21
|
identityDid: 'did:key:123',
|
|
23
22
|
};
|
|
24
23
|
|
|
@@ -48,7 +47,7 @@ const messages: MessageWithRangeId[] = [
|
|
|
48
47
|
// No punctuation.
|
|
49
48
|
'in classical physics objects have well-defined properties such as position speed and momentum',
|
|
50
49
|
].map((string, index) =>
|
|
51
|
-
Obj.make(
|
|
50
|
+
Obj.make(Message.Message, {
|
|
52
51
|
created: new Date(Date.now() + 1_000 * index).toISOString(),
|
|
53
52
|
sender,
|
|
54
53
|
blocks: [{ _tag: 'transcript', started: new Date(Date.now() + 1_000 * index).toISOString(), text: string }],
|
|
@@ -99,7 +98,7 @@ describe.skip('SentenceNormalization', () => {
|
|
|
99
98
|
}
|
|
100
99
|
|
|
101
100
|
log.info('sentences', {
|
|
102
|
-
|
|
101
|
+
messages: JSON.stringify(messages, null, 2),
|
|
103
102
|
sentences: JSON.stringify(sentences, null, 2),
|
|
104
103
|
});
|
|
105
104
|
throw new Error('test');
|
|
@@ -108,7 +107,7 @@ describe.skip('SentenceNormalization', () => {
|
|
|
108
107
|
test.only('queue', { timeout: 120_000 }, async () => {
|
|
109
108
|
// Create queue.
|
|
110
109
|
// TODO(dmaretskyi): Use space.queues.create() instead.
|
|
111
|
-
const queue = new MemoryQueue<
|
|
110
|
+
const queue = new MemoryQueue<Message.Message>(createQueueDXN());
|
|
112
111
|
const ctx = new Context();
|
|
113
112
|
let idx = 0;
|
|
114
113
|
scheduleTaskInterval(
|
|
@@ -133,10 +132,6 @@ describe.skip('SentenceNormalization', () => {
|
|
|
133
132
|
|
|
134
133
|
// Start normalizer.
|
|
135
134
|
await normalizer.open();
|
|
136
|
-
effect(() => {
|
|
137
|
-
log.info('normalizer');
|
|
138
|
-
log.info(JSON.stringify(queue.objects, null, 2));
|
|
139
|
-
});
|
|
140
135
|
|
|
141
136
|
await new Promise(() => {});
|
|
142
137
|
});
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import * as Schema from 'effect/Schema';
|
|
7
|
+
|
|
8
|
+
import { Operation } from '@dxos/compute';
|
|
9
|
+
import { log } from '@dxos/log';
|
|
10
|
+
import { trim } from '@dxos/util';
|
|
11
|
+
|
|
12
|
+
import { TranscriptOperation } from '../types';
|
|
13
|
+
|
|
14
|
+
type MessageWithRangeIdType = TranscriptOperation.MessageWithRangeIdType;
|
|
15
|
+
type SentenceNormalizationInputType = TranscriptOperation.SentenceNormalizationInputType;
|
|
16
|
+
const { SentenceNormalization, SentenceNormalizationOutput } = TranscriptOperation;
|
|
17
|
+
|
|
18
|
+
export type MessageWithRangeId = MessageWithRangeIdType;
|
|
19
|
+
|
|
20
|
+
/** @deprecated Use SentenceNormalizationInputType */
|
|
21
|
+
export type NormalizationInput = SentenceNormalizationInputType;
|
|
22
|
+
|
|
23
|
+
/** @deprecated Use SentenceNormalizationOutput */
|
|
24
|
+
export type NormalizationOutput = Schema.Schema.Type<typeof SentenceNormalizationOutput>;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Sentence normalization for transcription.
|
|
28
|
+
* TODO(dmaretskyi): Reimplement using AiRequest.run or LanguageModel.generateObject - runStructured was removed.
|
|
29
|
+
*/
|
|
30
|
+
export const sentenceNormalization = SentenceNormalization.pipe(
|
|
31
|
+
Operation.withHandler(
|
|
32
|
+
Effect.fn(function* ({ messages }) {
|
|
33
|
+
log.info('input', { messages });
|
|
34
|
+
// TODO(dmaretskyi): runStructured was removed from AiRequest. Reimplement using new API.
|
|
35
|
+
return yield* Effect.die(
|
|
36
|
+
new Error(
|
|
37
|
+
'Sentence normalization needs to be reimplemented - runStructured was removed from AiRequest. Use AiRequest.run or LanguageModel.generateObject.',
|
|
38
|
+
),
|
|
39
|
+
);
|
|
40
|
+
}),
|
|
41
|
+
),
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
const _unused = trim`
|
|
45
|
+
You are observing a real-time transcript of a single person speaking.
|
|
46
|
+
The transcription is delivered in chunks of 10 seconds or less. As a result, individual sentences may be split across multiple messages, or multiple sentences may appear within a single message. Additionally, because this is real-time transcription, punctuation and capitalization may be incorrect or missing.
|
|
47
|
+
|
|
48
|
+
# Task Description:
|
|
49
|
+
- Your task is to detect and reconstruct broken or incomplete sentences by merging segments into coherent, grammatically correct sentences where appropriate.
|
|
50
|
+
|
|
51
|
+
# Input Format:
|
|
52
|
+
- The input is an array of messages that contain transcription blocks.
|
|
53
|
+
- Each message is a Message.Message, as described in the output format.
|
|
54
|
+
|
|
55
|
+
# Output Format:
|
|
56
|
+
- You have been provided with the tool that defines the output format; make sure to query it.
|
|
57
|
+
- Do not output anything other than the expected format.
|
|
58
|
+
|
|
59
|
+
# Segment Handling Rules:
|
|
60
|
+
- Sort messages by timestamp.
|
|
61
|
+
- Leave ID of the first message in a sentence.
|
|
62
|
+
- Each divided sentence should be added to the output as a separate message or block within existing messages, preserving the original order.
|
|
63
|
+
- If one message contains multiple sentences, you should not split them.
|
|
64
|
+
- The last sentence may be incomplete; it should still be output as a separate block or message.
|
|
65
|
+
- Keep track of the original timestamps of the messages and blocks and, use the timestamp of the first message/block of a sentence as the 'started' field of the merged message.
|
|
66
|
+
- The 'rangeId' field of the merged message should include 'messageId'-s and 'rangeId'-s of all messages that have been used to construct this message.
|
|
67
|
+
|
|
68
|
+
# Punctuation and Capitalization:
|
|
69
|
+
- Do not rely on the original punctuation and capitalization—they may be incorrect.
|
|
70
|
+
- Use logical reasoning to apply appropriate punctuation (e.g., period, comma, question mark, exclamation mark) and capitalization.
|
|
71
|
+
|
|
72
|
+
# Restrictions:
|
|
73
|
+
- Do not alter the order of the original messages; maintain the natural flow of speech.
|
|
74
|
+
- Do not interpret or infer meaning beyond reconstructing sentences.
|
|
75
|
+
- Do not add or remove any words or phrases.
|
|
76
|
+
`;
|
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type
|
|
5
|
+
import { type Actor } from '@dxos/types';
|
|
6
6
|
|
|
7
|
-
export const getActorId = (actor:
|
|
7
|
+
export const getActorId = (actor: Actor.Actor) => {
|
|
8
8
|
return actor.identityDid || actor.identityKey || actor.email || actor.name || '';
|
|
9
9
|
};
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Operation } from '@dxos/compute';
|
|
8
|
+
import { Feed, Ref } from '@dxos/echo';
|
|
9
|
+
import { Transcript } from '@dxos/types';
|
|
10
|
+
|
|
11
|
+
import { TranscriptOperation } from '../types';
|
|
12
|
+
|
|
13
|
+
const handler: Operation.WithHandler<typeof TranscriptOperation.Create> = TranscriptOperation.Create.pipe(
|
|
14
|
+
Operation.withHandler(
|
|
15
|
+
Effect.fn(function* ({ space }) {
|
|
16
|
+
const feed = space.db.add(Feed.make());
|
|
17
|
+
return {
|
|
18
|
+
object: Transcript.make(Ref.make(feed)),
|
|
19
|
+
};
|
|
20
|
+
}),
|
|
21
|
+
),
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
export default handler;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { OperationHandlerSet } from '@dxos/compute';
|
|
6
|
+
|
|
7
|
+
export const TranscriptionOperationHandlerSet = OperationHandlerSet.lazy(
|
|
8
|
+
() => import('./create'),
|
|
9
|
+
() => import('./open'),
|
|
10
|
+
() => import('./summarize'),
|
|
11
|
+
);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Operation } from '@dxos/compute';
|
|
8
|
+
import { Database, Feed, Filter } from '@dxos/echo';
|
|
9
|
+
import { Message } from '@dxos/types';
|
|
10
|
+
|
|
11
|
+
import { TranscriptOperation } from '../types';
|
|
12
|
+
import { renderByline } from '../util';
|
|
13
|
+
|
|
14
|
+
const handler: Operation.WithHandler<typeof TranscriptOperation.Open> = TranscriptOperation.Open.pipe(
|
|
15
|
+
Operation.withHandler(
|
|
16
|
+
Effect.fn(function* ({ transcript }) {
|
|
17
|
+
const transcriptObj = yield* Database.load(transcript);
|
|
18
|
+
const feed = yield* Database.load(transcriptObj.feed);
|
|
19
|
+
const messages = yield* Feed.runQuery(feed, Filter.type(Message.Message));
|
|
20
|
+
const content = messages
|
|
21
|
+
.flatMap((message: Message.Message, index: number) => renderByline([])(message, index))
|
|
22
|
+
.join('\n\n');
|
|
23
|
+
return { content };
|
|
24
|
+
}),
|
|
25
|
+
),
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
export default handler;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Array from 'effect/Array';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
import * as Function from 'effect/Function';
|
|
8
|
+
import * as Layer from 'effect/Layer';
|
|
9
|
+
import * as Option from 'effect/Option';
|
|
10
|
+
|
|
11
|
+
import { AiService, ConsolePrinter, ToolExecutionService, ToolResolverService } from '@dxos/ai';
|
|
12
|
+
import { AiRequest, GenerationObserver } from '@dxos/assistant';
|
|
13
|
+
import { Trace, Operation, OperationRegistry } from '@dxos/compute';
|
|
14
|
+
import { Database } from '@dxos/echo';
|
|
15
|
+
import { trim } from '@dxos/util';
|
|
16
|
+
|
|
17
|
+
import { TranscriptOperation } from '../types';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Summarize a transcript of a meeting.
|
|
21
|
+
*/
|
|
22
|
+
const handler: Operation.WithHandler<typeof TranscriptOperation.Summarize> = TranscriptOperation.Summarize.pipe(
|
|
23
|
+
Operation.withHandler(
|
|
24
|
+
Effect.fnUntraced(
|
|
25
|
+
function* ({ transcript, notes }) {
|
|
26
|
+
const result = yield* new AiRequest({
|
|
27
|
+
observer: GenerationObserver.fromPrinter(new ConsolePrinter({ tag: 'summarize' })),
|
|
28
|
+
}).run({
|
|
29
|
+
prompt: `Transcript: ${transcript}\n\nNotes: ${notes}`,
|
|
30
|
+
history: [],
|
|
31
|
+
system: systemPrompt,
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const summary = Function.pipe(
|
|
35
|
+
result,
|
|
36
|
+
Array.findLast((msg) => msg.sender.role === 'assistant' && msg.blocks.some((block) => block._tag === 'text')),
|
|
37
|
+
Option.flatMap((msg) =>
|
|
38
|
+
Function.pipe(
|
|
39
|
+
msg.blocks,
|
|
40
|
+
Array.findLast((block) => block._tag === 'text'),
|
|
41
|
+
Option.map((block) => block.text),
|
|
42
|
+
),
|
|
43
|
+
),
|
|
44
|
+
Option.getOrThrowWith(() => new Error('No summary found')),
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
return { summary };
|
|
48
|
+
},
|
|
49
|
+
Effect.provide(
|
|
50
|
+
Layer.mergeAll(
|
|
51
|
+
AiService.model('@anthropic/claude-sonnet-4-0'),
|
|
52
|
+
ToolResolverService.layerEmpty,
|
|
53
|
+
ToolExecutionService.layerEmpty,
|
|
54
|
+
Trace.writerLayerNoop,
|
|
55
|
+
Database.notAvailable,
|
|
56
|
+
Layer.succeed(Operation.Service, {
|
|
57
|
+
invoke: () => Effect.die('Not available.'),
|
|
58
|
+
schedule: () => Effect.die('Not available.'),
|
|
59
|
+
invokePromise: async () => ({ error: new Error('Not available.') }),
|
|
60
|
+
} as any),
|
|
61
|
+
Layer.succeed(OperationRegistry.Service, { resolve: () => Effect.succeed(undefined) } as any),
|
|
62
|
+
),
|
|
63
|
+
),
|
|
64
|
+
),
|
|
65
|
+
),
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
export default handler;
|
|
69
|
+
|
|
70
|
+
const systemPrompt = trim`
|
|
71
|
+
You are a helpful assistant that summarizes transcripts of meetings.
|
|
72
|
+
|
|
73
|
+
# Goal
|
|
74
|
+
Create a markdown summary of the meeting transcript with text notes provided.
|
|
75
|
+
Notes are very important so make sure to include them in the summary if they contain meaningful information.
|
|
76
|
+
|
|
77
|
+
# Formatting
|
|
78
|
+
- Format the summary as a markdown document without extra comments like "Here is the summary of the transcript:".
|
|
79
|
+
- Use markdown formatting for headings and bullet points.
|
|
80
|
+
- Format the summary as a list of key points and takeaways.
|
|
81
|
+
- All names of people should be in bold.
|
|
82
|
+
|
|
83
|
+
# Note Taking
|
|
84
|
+
- Correlate items in the summary with the person of origin to build a coherent narrative.
|
|
85
|
+
- Include short quotes verbatim where appropriate. Especially when concerned with design decisions and problem descriptions.
|
|
86
|
+
|
|
87
|
+
# Tasks
|
|
88
|
+
At the end of the summary include tasks.
|
|
89
|
+
Extract only the tasks that are:
|
|
90
|
+
- Directly actionable.
|
|
91
|
+
- Clearly assigned to a person or team (or can easily be inferred).
|
|
92
|
+
- Strongly implied by the conversation and/or user note (no speculative tasks).
|
|
93
|
+
- Specific enough that someone reading them would know exactly what to do next.
|
|
94
|
+
|
|
95
|
+
Format all tasks as markdown checkboxes using the syntax:
|
|
96
|
+
- [ ] Task description.
|
|
97
|
+
|
|
98
|
+
Additional information can be included (indented).
|
|
99
|
+
|
|
100
|
+
If no actionable tasks are found, omit this tasks section.
|
|
101
|
+
`;
|
package/src/plugin.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
|
|
7
|
+
import { meta } from './meta';
|
|
8
|
+
|
|
9
|
+
export const TranscriptionPlugin = Plugin.lazy(meta, () => import('#plugin'));
|
|
10
|
+
|
|
11
|
+
export { TranscriptionOperationHandlerSet } from './operations';
|