@dxos/plugin-transcription 0.8.4-main.c85a9c8dae → 0.8.4-main.d9fc60f731
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/PLUGIN.mdl +401 -0
- 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 +46 -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/{browser/blueprint-definition-C6XA2SVZ.mjs → neutral/blueprint-definition-HOXDG5QP.mjs} +4 -7
- package/dist/lib/neutral/blueprint-definition-HOXDG5QP.mjs.map +7 -0
- package/dist/lib/{browser → neutral}/blueprints/index.mjs +1 -2
- 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-FHNI26QW.mjs +45 -0
- package/dist/lib/neutral/chunk-FHNI26QW.mjs.map +7 -0
- package/dist/lib/{browser/chunk-EV5ZYKET.mjs → neutral/chunk-ILSA3DU7.mjs} +87 -112
- package/dist/lib/neutral/chunk-ILSA3DU7.mjs.map +7 -0
- package/dist/lib/{browser/chunk-HOOPZ7EM.mjs → neutral/chunk-KAEXRX3Y.mjs} +1 -1
- package/dist/lib/neutral/chunk-KVUT2KYT.mjs +124 -0
- package/dist/lib/neutral/chunk-KVUT2KYT.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-Y4YI44ZD.mjs +8 -0
- package/dist/lib/neutral/chunk-Y4YI44ZD.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 +273 -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-VWFMMAUY.mjs +21 -0
- package/dist/lib/neutral/create-VWFMMAUY.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/open-V772IQYW.mjs +27 -0
- package/dist/lib/neutral/open-V772IQYW.mjs.map +7 -0
- package/dist/lib/neutral/operation-handler-NXMOAXFP.mjs +13 -0
- package/dist/lib/neutral/operation-handler-NXMOAXFP.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +8 -0
- package/dist/lib/neutral/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-YMZRO242.mjs +26 -0
- package/dist/lib/neutral/react-surface-YMZRO242.mjs.map +7 -0
- package/dist/lib/neutral/summarize-6PDRGTKE.mjs +78 -0
- package/dist/lib/neutral/summarize-6PDRGTKE.mjs.map +7 -0
- package/dist/lib/neutral/text-content-KBB37HSM.mjs +30 -0
- package/dist/lib/neutral/text-content-KBB37HSM.mjs.map +7 -0
- package/dist/lib/{browser/transcriber-WCPHHJYY.mjs → neutral/transcriber-ABHATBVH.mjs} +8 -10
- 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 +1 -0
- package/dist/types/src/TranscriptionPlugin.d.ts.map +1 -1
- package/dist/types/src/TranscriptionPlugin.node.d.ts +4 -0
- package/dist/types/src/TranscriptionPlugin.node.d.ts.map +1 -0
- package/dist/types/src/TranscriptionPlugin.test.d.ts +2 -0
- package/dist/types/src/TranscriptionPlugin.test.d.ts.map +1 -0
- package/dist/types/src/TranscriptionPlugin.workerd.d.ts +4 -0
- package/dist/types/src/TranscriptionPlugin.workerd.d.ts.map +1 -0
- package/dist/types/src/blueprints/transcription-blueprint.d.ts +2 -2
- package/dist/types/src/blueprints/transcription-blueprint.d.ts.map +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts +6 -0
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +10 -4
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts +6 -0
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/text-content.d.ts +8 -0
- package/dist/types/src/capabilities/text-content.d.ts.map +1 -0
- package/dist/types/src/capabilities/{transcriber/transcriber.d.ts → transcriber.d.ts} +1 -1
- package/dist/types/src/capabilities/transcriber.d.ts.map +1 -0
- 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 +5 -9
- package/dist/types/src/components/Transcription/Transcription.d.ts.map +1 -1
- package/dist/types/src/components/Transcription/Transcription.stories.d.ts +21 -24
- package/dist/types/src/components/Transcription/Transcription.stories.d.ts.map +1 -1
- package/dist/types/src/components/Transcription/transcription-extension.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -0
- 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 +1 -1
- package/dist/types/src/containers/index.d.ts.map +1 -1
- 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 +1 -1
- 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 +7 -5
- package/dist/types/src/normalization/message-normalizer.d.ts.map +1 -0
- package/dist/types/src/normalization/normalization.d.ts +834 -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.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 +248 -0
- package/dist/types/src/stories/common.d.ts.map +1 -0
- package/dist/types/src/testing/testing.d.ts +5 -6
- package/dist/types/src/testing/testing.d.ts.map +1 -1
- package/dist/types/src/transcriber/index.d.ts +1 -1
- package/dist/types/src/transcriber/index.d.ts.map +1 -1
- package/dist/types/src/transcriber/media-stream-recorder.d.ts.map +1 -1
- package/dist/types/src/transcriber/transcriber.d.ts +58 -3
- 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 +6 -4
- 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 +1670 -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 -4
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/util/array.d.ts.map +1 -1
- package/dist/types/src/util/get-time-str.d.ts.map +1 -1
- package/dist/types/src/util/monitor-audio-level.d.ts.map +1 -1
- package/dist/types/src/util/render-byline.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +140 -86
- package/src/TranscriptionPlugin.node.ts +20 -0
- package/src/TranscriptionPlugin.test.ts +31 -0
- package/src/TranscriptionPlugin.tsx +14 -29
- package/src/TranscriptionPlugin.workerd.ts +18 -0
- package/src/blueprints/transcription-blueprint.ts +5 -9
- package/src/capabilities/{blueprint-definition/blueprint-definition.ts → blueprint-definition.ts} +3 -1
- package/src/capabilities/index.ts +12 -4
- package/src/capabilities/operation-handler.ts +16 -0
- package/src/capabilities/react-surface.tsx +31 -0
- package/src/capabilities/text-content.ts +33 -0
- package/src/capabilities/{transcriber/transcriber.ts → transcriber.ts} +5 -2
- package/src/components/Oracle/Oracle.stories.tsx +147 -0
- package/src/components/Oracle/Oracle.tsx +142 -0
- package/src/components/Oracle/index.ts +5 -0
- package/src/components/Transcription/Transcription.stories.tsx +125 -158
- package/src/components/Transcription/Transcription.tsx +33 -38
- package/src/components/index.ts +1 -0
- 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 +1 -1
- package/src/enrichment/conversation.test.ts +162 -0
- package/src/enrichment/conversation.txt +23 -0
- package/src/enrichment/operations.ts +271 -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 +5 -2
- package/src/hooks/useTranscriptionRecording.ts +87 -0
- package/src/hooks/useVoiceInput.ts +0 -1
- package/src/index.ts +4 -5
- package/src/meta.ts +28 -6
- package/src/model/model.test.ts +8 -8
- package/src/model/model.ts +3 -3
- package/src/{segments-normalization → normalization}/message-normalizer.ts +25 -17
- package/src/{segments-normalization → normalization}/normalization.test.ts +3 -37
- package/src/normalization/normalization.ts +76 -0
- package/src/operations/create.ts +24 -0
- package/src/operations/index.ts +11 -0
- package/src/operations/open.ts +28 -0
- package/src/operations/summarize.ts +101 -0
- package/src/plugin.ts +11 -0
- package/src/stories/FileTranscription.stories.tsx +143 -0
- package/src/{components/stories → stories}/KeyWordRecognition.stories.tsx +38 -38
- 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 +29 -51
- package/src/transcriber/index.ts +1 -1
- package/src/transcriber/transcriber.browser.test.ts +0 -1
- package/src/transcriber/transcriber.test.ts +104 -0
- package/src/transcriber/transcriber.ts +100 -55
- package/src/transcriber/transcription-manager.ts +14 -9
- package/src/translations.ts +10 -7
- package/src/types/TranscriptOperation.ts +106 -0
- package/src/types/TranscriptionCapabilities.ts +39 -0
- package/src/types/index.ts +2 -4
- package/src/vite-env.d.ts +10 -0
- package/dist/lib/browser/TranscriptionContainer-RBFHP2AV.mjs +0 -41
- package/dist/lib/browser/TranscriptionContainer-RBFHP2AV.mjs.map +0 -7
- package/dist/lib/browser/blueprint-definition-C6XA2SVZ.mjs.map +0 -7
- package/dist/lib/browser/chunk-2B74LZZD.mjs +0 -22
- package/dist/lib/browser/chunk-2B74LZZD.mjs.map +0 -7
- package/dist/lib/browser/chunk-EV5ZYKET.mjs.map +0 -7
- package/dist/lib/browser/chunk-GH4IIQ6C.mjs +0 -54
- package/dist/lib/browser/chunk-GH4IIQ6C.mjs.map +0 -7
- package/dist/lib/browser/chunk-O7ILGNBZ.mjs +0 -148
- package/dist/lib/browser/chunk-O7ILGNBZ.mjs.map +0 -7
- package/dist/lib/browser/chunk-XLMRCOQN.mjs +0 -668
- package/dist/lib/browser/chunk-XLMRCOQN.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -114
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/operation-resolver-5BLRH4XE.mjs +0 -23
- package/dist/lib/browser/operation-resolver-5BLRH4XE.mjs.map +0 -7
- package/dist/lib/browser/react-surface-U2SI74JK.mjs +0 -36
- package/dist/lib/browser/react-surface-U2SI74JK.mjs.map +0 -7
- package/dist/lib/browser/transcriber-WCPHHJYY.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -15
- package/dist/lib/node-esm/TranscriptionContainer-3OOID5KH.mjs +0 -42
- package/dist/lib/node-esm/TranscriptionContainer-3OOID5KH.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-TLXDUXIQ.mjs +0 -19
- package/dist/lib/node-esm/blueprint-definition-TLXDUXIQ.mjs.map +0 -7
- package/dist/lib/node-esm/blueprints/index.mjs +0 -10
- package/dist/lib/node-esm/chunk-6GW5NZYG.mjs +0 -55
- package/dist/lib/node-esm/chunk-6GW5NZYG.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-7UE7G6DE.mjs +0 -461
- package/dist/lib/node-esm/chunk-7UE7G6DE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-DYUGYQCB.mjs +0 -669
- package/dist/lib/node-esm/chunk-DYUGYQCB.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-F47HK7GT.mjs +0 -24
- package/dist/lib/node-esm/chunk-F47HK7GT.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-H3MXHMQL.mjs +0 -149
- package/dist/lib/node-esm/chunk-H3MXHMQL.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
- package/dist/lib/node-esm/chunk-NVM2QUMX.mjs +0 -37
- package/dist/lib/node-esm/chunk-NVM2QUMX.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -115
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/operation-resolver-CVZB7BF4.mjs +0 -24
- package/dist/lib/node-esm/operation-resolver-CVZB7BF4.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-2ICJPBPX.mjs +0 -37
- package/dist/lib/node-esm/react-surface-2ICJPBPX.mjs.map +0 -7
- package/dist/lib/node-esm/transcriber-2RIHUEX4.mjs +0 -62
- package/dist/lib/node-esm/transcriber-2RIHUEX4.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -16
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +0 -6
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts +0 -3
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-handler/index.d.ts +0 -3
- package/dist/types/src/capabilities/operation-handler/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-handler/operation-handler.d.ts +0 -5
- package/dist/types/src/capabilities/operation-handler/operation-handler.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +0 -3
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +0 -5
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/index.d.ts +0 -3
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/transcriber/index.d.ts +0 -3
- package/dist/types/src/capabilities/transcriber/index.d.ts.map +0 -1
- package/dist/types/src/capabilities/transcriber/transcriber.d.ts.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/containers/TranscriptionContainer/TranscriptionContainer.d.ts +0 -6
- package/dist/types/src/containers/TranscriptionContainer/TranscriptionContainer.d.ts.map +0 -1
- package/dist/types/src/containers/TranscriptionContainer/index.d.ts +0 -3
- package/dist/types/src/containers/TranscriptionContainer/index.d.ts.map +0 -1
- package/dist/types/src/functions/index.d.ts +0 -18
- package/dist/types/src/functions/index.d.ts.map +0 -1
- package/dist/types/src/functions/open.d.ts +0 -11
- package/dist/types/src/functions/open.d.ts.map +0 -1
- package/dist/types/src/functions/summarize.d.ts +0 -11
- package/dist/types/src/functions/summarize.d.ts.map +0 -1
- package/dist/types/src/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 -534
- package/dist/types/src/segments-normalization/normalization.d.ts.map +0 -1
- package/dist/types/src/segments-normalization/normalization.test.d.ts.map +0 -1
- package/dist/types/src/segments-normalization/utils.d.ts.map +0 -1
- package/dist/types/src/types/TranscriptAction.d.ts +0 -25
- package/dist/types/src/types/TranscriptAction.d.ts.map +0 -1
- package/dist/types/src/types/capabilities.d.ts +0 -18
- package/dist/types/src/types/capabilities.d.ts.map +0 -1
- package/dist/types/src/types/types.d.ts +0 -5
- package/dist/types/src/types/types.d.ts.map +0 -1
- package/src/capabilities/blueprint-definition/index.ts +0 -7
- package/src/capabilities/operation-handler/index.ts +0 -7
- package/src/capabilities/operation-handler/operation-handler.ts +0 -25
- package/src/capabilities/operation-resolver/index.ts +0 -7
- package/src/capabilities/operation-resolver/operation-resolver.ts +0 -25
- package/src/capabilities/react-surface/index.ts +0 -7
- package/src/capabilities/react-surface/react-surface.tsx +0 -28
- package/src/capabilities/transcriber/index.ts +0 -7
- package/src/components/stories/FileTranscription.stories.tsx +0 -252
- package/src/components/stories/MicrophoneTranscription.stories.tsx +0 -282
- package/src/components/stories/TranscriptionStory.tsx +0 -41
- package/src/components/stories/useIsSpeaking.tsx +0 -40
- package/src/containers/TranscriptionContainer/TranscriptionContainer.tsx +0 -33
- package/src/containers/TranscriptionContainer/index.ts +0 -7
- package/src/functions/index.ts +0 -11
- package/src/functions/open.ts +0 -37
- 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/TranscriptAction.ts +0 -32
- package/src/types/capabilities.ts +0 -33
- package/src/types/types.ts +0 -9
- package/dist/lib/{browser → neutral}/blueprints/index.mjs.map +0 -0
- package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs +0 -0
- package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs.map +0 -0
- package/dist/lib/{browser/chunk-HOOPZ7EM.mjs.map → neutral/chunk-KAEXRX3Y.mjs.map} +0 -0
- package/dist/lib/{browser/types → neutral/hooks}/index.mjs.map +0 -0
- package/dist/lib/{node-esm/blueprints → neutral}/index.mjs.map +0 -0
- package/dist/lib/{node-esm/chunk-HSLMI22Q.mjs.map → neutral/meta.mjs.map} +0 -0
- package/dist/lib/{node-esm/types → neutral/operations}/index.mjs.map +0 -0
- package/dist/types/src/capabilities/{react-surface/react-surface.d.ts → react-surface.d.ts} +0 -0
- package/dist/types/src/{segments-normalization → normalization}/normalization.test.d.ts +0 -0
- package/dist/types/src/{segments-normalization → normalization}/utils.d.ts +0 -0
- package/src/{segments-normalization → normalization}/index.ts +1 -1
- /package/src/{segments-normalization → normalization}/utils.ts +0 -0
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,19 +2,41 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
import { DXN } from '@dxos/keys';
|
|
6
7
|
import { trim } from '@dxos/util';
|
|
7
8
|
|
|
8
|
-
export const meta
|
|
9
|
-
|
|
9
|
+
export const meta = Plugin.makeMeta({
|
|
10
|
+
key: DXN.make('org.dxos.plugin.transcription'),
|
|
10
11
|
name: 'Transcription',
|
|
12
|
+
author: 'DXOS',
|
|
11
13
|
description: trim`
|
|
12
|
-
Real-time voice-to-text transcription
|
|
13
|
-
|
|
14
|
+
Real-time voice-to-text transcription for DXOS Composer.
|
|
15
|
+
Captures microphone audio in short PCM chunks, batches them into WAV payloads, and streams
|
|
16
|
+
the results to a Whisper-compatible speech-recognition endpoint.
|
|
17
|
+
Transcribed segments are timestamped, deduplicated across chunk boundaries, and persisted
|
|
18
|
+
as Message objects in an ECHO Feed so that every participant in a shared space sees the
|
|
19
|
+
live transcript without any manual sync step.
|
|
20
|
+
|
|
21
|
+
Each recording session is represented as a Transcript object linked to its Feed.
|
|
22
|
+
The read-only editor renders messages with speaker bylines and wall-clock timestamps,
|
|
23
|
+
supporting markdown decoration and document preview.
|
|
24
|
+
An optional message enricher pipeline lets plugins annotate messages before they are
|
|
25
|
+
committed — for example, to attach speaker identity from a calls service.
|
|
26
|
+
|
|
27
|
+
The plugin ships two blueprint-compatible operations: Open (loads and formats a transcript
|
|
28
|
+
for reading by an AI assistant) and Summarize (sends the transcript text to an LLM and
|
|
29
|
+
returns a structured Markdown summary with key points, verbatim quotes, and actionable
|
|
30
|
+
tasks extracted from the conversation).
|
|
31
|
+
|
|
32
|
+
A sentence-normalization pass merges raw word-level tokens from the recognizer into
|
|
33
|
+
grammatically complete sentences, improving readability of the stored transcript without
|
|
34
|
+
altering the underlying audio timeline.
|
|
14
35
|
`,
|
|
15
36
|
icon: 'ph--microphone--regular',
|
|
16
37
|
iconHue: 'sky',
|
|
17
38
|
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/plugin-transcription',
|
|
39
|
+
spec: 'PLUGIN.mdl',
|
|
18
40
|
tags: ['labs'],
|
|
19
41
|
screenshots: [],
|
|
20
|
-
};
|
|
42
|
+
});
|
package/src/model/model.test.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { EditorView } from '@codemirror/view';
|
|
|
6
6
|
import { describe, test } from 'vitest';
|
|
7
7
|
|
|
8
8
|
import { Obj } from '@dxos/echo';
|
|
9
|
-
import type {
|
|
9
|
+
import type { EntityId } from '@dxos/keys';
|
|
10
10
|
import { Message } from '@dxos/types';
|
|
11
11
|
|
|
12
12
|
import { type ChunkRenderer, DocumentAdapter, SerializationModel } from './model';
|
|
@@ -51,8 +51,8 @@ describe('SerializationModel', () => {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
// Update message.
|
|
54
|
-
Obj.
|
|
55
|
-
|
|
54
|
+
Obj.update(message, (message) => {
|
|
55
|
+
message.blocks.push({ _tag: 'transcript', started: createDate(), text: 'Hello again!' });
|
|
56
56
|
});
|
|
57
57
|
model.updateChunk(message);
|
|
58
58
|
{
|
|
@@ -112,7 +112,7 @@ describe('SerializationModel', () => {
|
|
|
112
112
|
const adapter = new DocumentAdapter(view);
|
|
113
113
|
expect(adapter.lineCount()).to.eq(0);
|
|
114
114
|
|
|
115
|
-
let msgId:
|
|
115
|
+
let msgId: EntityId;
|
|
116
116
|
|
|
117
117
|
// Append message.
|
|
118
118
|
{
|
|
@@ -133,16 +133,16 @@ describe('SerializationModel', () => {
|
|
|
133
133
|
expect(view.state.doc.toString()).to.eq('###### Alice\nHello world!\n\n');
|
|
134
134
|
|
|
135
135
|
// Update message (add block).
|
|
136
|
-
Obj.
|
|
137
|
-
|
|
136
|
+
Obj.update(message, (message) => {
|
|
137
|
+
message.blocks.push({ _tag: 'transcript', started: createDate(), text: 'Hello again!' });
|
|
138
138
|
});
|
|
139
139
|
model.updateChunk(message);
|
|
140
140
|
model.sync(adapter);
|
|
141
141
|
expect(view.state.doc.toString()).to.eq('###### Alice\nHello world!\nHello again!\n\n');
|
|
142
142
|
|
|
143
143
|
// Update message (remove block).
|
|
144
|
-
Obj.
|
|
145
|
-
|
|
144
|
+
Obj.update(message, (message) => {
|
|
145
|
+
message.blocks.splice(0, 1);
|
|
146
146
|
});
|
|
147
147
|
model.updateChunk(message);
|
|
148
148
|
model.sync(adapter);
|
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,16 +2,16 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
//
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import type * as Runtime from 'effect/Runtime';
|
|
8
7
|
|
|
9
8
|
import { DeferredTask, asyncTimeout } from '@dxos/async';
|
|
10
9
|
import { LifecycleState, Resource } from '@dxos/context';
|
|
11
|
-
import {
|
|
10
|
+
import { Feed, Filter } from '@dxos/echo';
|
|
11
|
+
import { runAndForwardErrors } from '@dxos/effect';
|
|
12
12
|
import { type FunctionExecutor } from '@dxos/functions-runtime';
|
|
13
13
|
import { log } from '@dxos/log';
|
|
14
|
-
import {
|
|
14
|
+
import { Message } from '@dxos/types';
|
|
15
15
|
|
|
16
16
|
import { type MessageWithRangeId, type NormalizationOutput, sentenceNormalization } from './normalization';
|
|
17
17
|
import { getActorId } from './utils';
|
|
@@ -21,7 +21,8 @@ const MAX_RANGE_ID_COUNT = 10;
|
|
|
21
21
|
|
|
22
22
|
export type SegmentsNormalizerProps = {
|
|
23
23
|
functionExecutor: FunctionExecutor;
|
|
24
|
-
|
|
24
|
+
feed: Feed.Feed;
|
|
25
|
+
feedRuntime: Runtime.Runtime<Feed.FeedService>;
|
|
25
26
|
startingCursor: QueueCursor;
|
|
26
27
|
};
|
|
27
28
|
|
|
@@ -31,31 +32,38 @@ export type QueueCursor = {
|
|
|
31
32
|
timestamp: string;
|
|
32
33
|
};
|
|
33
34
|
|
|
34
|
-
// TODO(mykola): .
|
|
35
35
|
export class MessageNormalizer extends Resource {
|
|
36
36
|
private readonly _functionExecutor: FunctionExecutor;
|
|
37
|
-
|
|
37
|
+
|
|
38
|
+
private _feed: Feed.Feed;
|
|
39
|
+
private _feedRuntime: Runtime.Runtime<Feed.FeedService>;
|
|
38
40
|
private _cursor: QueueCursor;
|
|
39
41
|
private _messagesToProcess: MessageWithRangeId[] = [];
|
|
40
42
|
private _normalizationTask?: DeferredTask;
|
|
41
43
|
private _lastProcessedMessageIds?: string[];
|
|
42
44
|
|
|
43
|
-
constructor({ functionExecutor,
|
|
45
|
+
constructor({ functionExecutor, feed, feedRuntime, startingCursor }: SegmentsNormalizerProps) {
|
|
44
46
|
super();
|
|
45
47
|
this._functionExecutor = functionExecutor;
|
|
46
|
-
this.
|
|
48
|
+
this._feed = feed;
|
|
49
|
+
this._feedRuntime = feedRuntime;
|
|
47
50
|
this._cursor = startingCursor;
|
|
48
51
|
}
|
|
49
52
|
|
|
50
53
|
protected override async _open(): Promise<void> {
|
|
51
54
|
this._normalizationTask = new DeferredTask(this._ctx, () => this._processMessages());
|
|
52
55
|
|
|
56
|
+
const queryResult = await Feed.query(this._feed, Filter.type(Message.Message)).pipe(
|
|
57
|
+
Effect.provide(this._feedRuntime),
|
|
58
|
+
runAndForwardErrors,
|
|
59
|
+
);
|
|
60
|
+
|
|
53
61
|
const updateMessages = () => {
|
|
54
62
|
if (this._lifecycleState !== LifecycleState.OPEN) {
|
|
55
63
|
return;
|
|
56
64
|
}
|
|
57
65
|
|
|
58
|
-
this._messagesToProcess =
|
|
66
|
+
this._messagesToProcess = (queryResult.results as Message.Message[]).filter((message) => {
|
|
59
67
|
const actorId = getActorId(message.sender);
|
|
60
68
|
return actorId === this._cursor.actorId && message.created >= this._cursor.timestamp;
|
|
61
69
|
});
|
|
@@ -66,8 +74,8 @@ export class MessageNormalizer extends Resource {
|
|
|
66
74
|
// Initial update.
|
|
67
75
|
updateMessages();
|
|
68
76
|
|
|
69
|
-
// Subscribe to
|
|
70
|
-
const unsubscribe =
|
|
77
|
+
// Subscribe to feed changes.
|
|
78
|
+
const unsubscribe = queryResult.subscribe(updateMessages);
|
|
71
79
|
this._ctx.onDispose(unsubscribe);
|
|
72
80
|
}
|
|
73
81
|
|
|
@@ -91,7 +99,7 @@ export class MessageNormalizer extends Resource {
|
|
|
91
99
|
PROCESSING_TIMEOUT,
|
|
92
100
|
);
|
|
93
101
|
|
|
94
|
-
this._writeMessages(response.sentences);
|
|
102
|
+
await this._writeMessages(response.sentences);
|
|
95
103
|
this._lastProcessedMessageIds.push(...response.sentences.map((sentence) => sentence.id));
|
|
96
104
|
if (response.sentences.length === 1 && response.sentences.at(-1)!.rangeId!.length > MAX_RANGE_ID_COUNT) {
|
|
97
105
|
log.warn('Sentence is too long', { messages });
|
|
@@ -100,14 +108,14 @@ export class MessageNormalizer extends Resource {
|
|
|
100
108
|
} catch {
|
|
101
109
|
log.error('Failed to normalize segments', { messages });
|
|
102
110
|
// If processing failed, emit the segments as is.
|
|
103
|
-
this._writeMessages(messages);
|
|
111
|
+
await this._writeMessages(messages);
|
|
104
112
|
}
|
|
105
113
|
}
|
|
106
114
|
|
|
107
|
-
private _writeMessages(messages: MessageWithRangeId[]): void {
|
|
115
|
+
private async _writeMessages(messages: MessageWithRangeId[]): Promise<void> {
|
|
108
116
|
log.info('writing messages', { messages });
|
|
109
117
|
const lastMessage = messages[messages.length - 1];
|
|
110
118
|
this._cursor.timestamp = lastMessage.created;
|
|
111
|
-
|
|
119
|
+
await Feed.append(this._feed, messages).pipe(Effect.provide(this._feedRuntime), runAndForwardErrors);
|
|
112
120
|
}
|
|
113
121
|
}
|
|
@@ -4,18 +4,12 @@
|
|
|
4
4
|
|
|
5
5
|
import { describe, test } from 'vitest';
|
|
6
6
|
|
|
7
|
-
import { scheduleTaskInterval } from '@dxos/async';
|
|
8
|
-
import { Context } from '@dxos/context';
|
|
9
7
|
import { Obj } from '@dxos/echo';
|
|
10
|
-
import { createQueueDXN } from '@dxos/echo/internal';
|
|
11
|
-
import { MemoryQueue } from '@dxos/echo-db';
|
|
12
8
|
import { FunctionExecutor, ServiceContainer } from '@dxos/functions-runtime';
|
|
13
9
|
import { log } from '@dxos/log';
|
|
14
10
|
import { type Actor, Message } from '@dxos/types';
|
|
15
11
|
|
|
16
|
-
import { MessageNormalizer } from './message-normalizer';
|
|
17
12
|
import { type MessageWithRangeId, sentenceNormalization } from './normalization';
|
|
18
|
-
import { getActorId } from './utils';
|
|
19
13
|
|
|
20
14
|
const sender: Actor.Actor = {
|
|
21
15
|
identityDid: 'did:key:123',
|
|
@@ -104,35 +98,7 @@ describe.skip('SentenceNormalization', () => {
|
|
|
104
98
|
throw new Error('test');
|
|
105
99
|
});
|
|
106
100
|
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
const queue = new MemoryQueue<Message.Message>(createQueueDXN());
|
|
111
|
-
const ctx = new Context();
|
|
112
|
-
let idx = 0;
|
|
113
|
-
scheduleTaskInterval(
|
|
114
|
-
ctx,
|
|
115
|
-
async () => {
|
|
116
|
-
if (idx >= messages.length) {
|
|
117
|
-
void ctx.dispose();
|
|
118
|
-
return;
|
|
119
|
-
}
|
|
120
|
-
await queue.append([messages[idx]]);
|
|
121
|
-
idx++;
|
|
122
|
-
},
|
|
123
|
-
2_000,
|
|
124
|
-
);
|
|
125
|
-
|
|
126
|
-
// Create normalizer.
|
|
127
|
-
const normalizer = new MessageNormalizer({
|
|
128
|
-
functionExecutor: getExecutor(),
|
|
129
|
-
queue,
|
|
130
|
-
startingCursor: { actorId: getActorId(sender), timestamp: '0' },
|
|
131
|
-
});
|
|
132
|
-
|
|
133
|
-
// Start normalizer.
|
|
134
|
-
await normalizer.open();
|
|
135
|
-
|
|
136
|
-
await new Promise(() => {});
|
|
137
|
-
});
|
|
101
|
+
// TODO(burdon): Restore a Feed-based version once `MessageNormalizer` has a
|
|
102
|
+
// space-backed test fixture available; the previous `MemoryQueue`-based
|
|
103
|
+
// test was incompatible with the `Feed.Feed` + `FeedService` refactor.
|
|
138
104
|
});
|
|
@@ -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.Request. 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
|
+
`;
|
|
@@ -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.Request({
|
|
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';
|