@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
|
@@ -4,60 +4,55 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { useThemeContext } from '@dxos/react-ui';
|
|
8
|
+
import { composable, composableProps } from '@dxos/react-ui';
|
|
8
9
|
import { useTextEditor } from '@dxos/react-ui-editor';
|
|
9
10
|
import { type Message, type Transcript } from '@dxos/types';
|
|
10
11
|
import {
|
|
11
|
-
autoScroll,
|
|
12
12
|
createBasicExtensions,
|
|
13
13
|
createMarkdownExtensions,
|
|
14
14
|
createThemeExtensions,
|
|
15
15
|
decorateMarkdown,
|
|
16
|
-
|
|
16
|
+
documentSlots,
|
|
17
17
|
preview,
|
|
18
|
+
scroller,
|
|
18
19
|
} from '@dxos/ui-editor';
|
|
19
|
-
import { mx } from '@dxos/ui-theme';
|
|
20
|
-
import { isTruthy } from '@dxos/util';
|
|
21
20
|
|
|
22
21
|
import { type SerializationModel } from '../../model';
|
|
23
22
|
import { renderByline } from '../../util';
|
|
24
|
-
|
|
25
23
|
import { transcription } from './transcription-extension';
|
|
26
24
|
|
|
27
25
|
export { renderByline };
|
|
28
26
|
|
|
29
|
-
export type TranscriptionProps =
|
|
27
|
+
export type TranscriptionProps = {
|
|
30
28
|
transcript?: Transcript.Transcript;
|
|
31
29
|
model: SerializationModel<Message.Message>;
|
|
32
|
-
// TODO(burdon): Are these still in use?
|
|
33
|
-
attendableId?: string;
|
|
34
|
-
ignoreAttention?: boolean;
|
|
35
|
-
}>;
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Transcript component implemented using the editor.
|
|
39
|
-
*/
|
|
40
|
-
export const Transcription = ({ classNames, transcript: object, model }: TranscriptionProps) => {
|
|
41
|
-
const { themeMode } = useThemeContext();
|
|
42
|
-
const { parentRef } = useTextEditor(() => {
|
|
43
|
-
return {
|
|
44
|
-
extensions: [
|
|
45
|
-
createBasicExtensions({ readOnly: true, lineWrapping: true, search: true }),
|
|
46
|
-
createMarkdownExtensions(),
|
|
47
|
-
createThemeExtensions({ themeMode, slots: editorSlots }),
|
|
48
|
-
decorateMarkdown(),
|
|
49
|
-
preview(),
|
|
50
|
-
transcription({ model, started: object?.started ? new Date(object.started) : undefined }),
|
|
51
|
-
autoScroll(),
|
|
52
|
-
].filter(isTruthy),
|
|
53
|
-
};
|
|
54
|
-
}, [model]);
|
|
55
|
-
|
|
56
|
-
return (
|
|
57
|
-
<div
|
|
58
|
-
ref={parentRef}
|
|
59
|
-
className={mx('dx-container', classNames)}
|
|
60
|
-
data-popover-collision-boundary={true /* TODO(thure): Make this a constant and document it. */}
|
|
61
|
-
/>
|
|
62
|
-
);
|
|
63
30
|
};
|
|
31
|
+
|
|
32
|
+
// TODO(burdon): Remove forwardedRef/use react-ui-editor.
|
|
33
|
+
export const Transcription = composable<HTMLDivElement, TranscriptionProps>(
|
|
34
|
+
({ transcript: object, model, children, ...props }, forwardedRef) => {
|
|
35
|
+
const { themeMode } = useThemeContext();
|
|
36
|
+
const { parentRef } = useTextEditor(() => {
|
|
37
|
+
return {
|
|
38
|
+
extensions: [
|
|
39
|
+
createBasicExtensions({ readOnly: true, lineWrapping: true, search: true }),
|
|
40
|
+
createThemeExtensions({ themeMode, slots: documentSlots }),
|
|
41
|
+
createMarkdownExtensions(),
|
|
42
|
+
decorateMarkdown(),
|
|
43
|
+
preview(),
|
|
44
|
+
transcription({ model, started: object?.started ? new Date(object.started) : undefined }),
|
|
45
|
+
scroller(),
|
|
46
|
+
],
|
|
47
|
+
};
|
|
48
|
+
}, [model, themeMode]);
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<div
|
|
52
|
+
{...composableProps(props, { classNames: 'dx-container' })}
|
|
53
|
+
data-popover-collision-boundary={true}
|
|
54
|
+
ref={parentRef}
|
|
55
|
+
/>
|
|
56
|
+
);
|
|
57
|
+
},
|
|
58
|
+
);
|
package/src/components/index.ts
CHANGED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2026 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
import React from 'react';
|
|
8
|
+
|
|
9
|
+
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
|
+
import { Feed, Query, Ref } from '@dxos/echo';
|
|
11
|
+
import { ClientPlugin, initializeIdentity } from '@dxos/plugin-client/testing';
|
|
12
|
+
import { corePlugins } from '@dxos/plugin-testing';
|
|
13
|
+
import { useQuery, useSpaces } from '@dxos/react-client/echo';
|
|
14
|
+
import { Loading, withLayout } from '@dxos/react-ui/testing';
|
|
15
|
+
import { Message, Transcript } from '@dxos/types';
|
|
16
|
+
|
|
17
|
+
import { translations } from '#translations';
|
|
18
|
+
|
|
19
|
+
import { TestItem } from '../../testing';
|
|
20
|
+
import { TranscriptionPlugin } from '../../TranscriptionPlugin';
|
|
21
|
+
import { TranscriptionArticle } from './TranscriptionArticle';
|
|
22
|
+
|
|
23
|
+
const DefaultStory = () => {
|
|
24
|
+
const [space] = useSpaces();
|
|
25
|
+
const [transcript] = useQuery(space?.db, Query.type(Transcript.Transcript));
|
|
26
|
+
if (!space || !transcript) {
|
|
27
|
+
return <Loading />;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
return <TranscriptionArticle role='article' attendableId='story' subject={transcript} />;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
const meta = {
|
|
34
|
+
title: 'plugins/plugin-transcription/containers/TranscriptionArticle',
|
|
35
|
+
render: DefaultStory,
|
|
36
|
+
decorators: [
|
|
37
|
+
withLayout({ layout: 'column' }),
|
|
38
|
+
withPluginManager({
|
|
39
|
+
plugins: [
|
|
40
|
+
...corePlugins(),
|
|
41
|
+
ClientPlugin({
|
|
42
|
+
types: [Transcript.Transcript, Feed.Feed, Message.Message, TestItem],
|
|
43
|
+
onClientInitialized: ({ client }) =>
|
|
44
|
+
Effect.gen(function* () {
|
|
45
|
+
const { personalSpace } = yield* initializeIdentity(client);
|
|
46
|
+
const feed = personalSpace.db.add(Feed.make({ name: 'transcription' }));
|
|
47
|
+
personalSpace.db.add(Transcript.make(Ref.make(feed)));
|
|
48
|
+
}),
|
|
49
|
+
}),
|
|
50
|
+
TranscriptionPlugin(),
|
|
51
|
+
],
|
|
52
|
+
}),
|
|
53
|
+
],
|
|
54
|
+
parameters: { layout: 'fullscreen', translations },
|
|
55
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
56
|
+
|
|
57
|
+
export default meta;
|
|
58
|
+
|
|
59
|
+
type Story = StoryObj<typeof meta>;
|
|
60
|
+
|
|
61
|
+
export const Default: Story = {};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
8
|
+
import { Filter, Obj, Query } from '@dxos/echo';
|
|
9
|
+
import { useMembers, useQuery } from '@dxos/react-client/echo';
|
|
10
|
+
import { Panel } from '@dxos/react-ui';
|
|
11
|
+
import { Menu, MenuBuilder, useMenuBuilder } from '@dxos/react-ui-menu';
|
|
12
|
+
import { Message, type Transcript } from '@dxos/types';
|
|
13
|
+
|
|
14
|
+
import { Transcription } from '#components';
|
|
15
|
+
import { useFeedModelAdapter, useTranscriptionRecording } from '#hooks';
|
|
16
|
+
import { meta } from '#meta';
|
|
17
|
+
|
|
18
|
+
import { renderByline } from '../../util';
|
|
19
|
+
|
|
20
|
+
export type TranscriptionArticleProps = AppSurface.ObjectArticleProps<Transcript.Transcript>;
|
|
21
|
+
|
|
22
|
+
export const TranscriptionArticle = ({ role, subject: transcript, attendableId }: TranscriptionArticleProps) => {
|
|
23
|
+
const db = Obj.getDatabase(transcript);
|
|
24
|
+
const members = useMembers(db?.spaceId).map((member) => member.identity);
|
|
25
|
+
const feed = transcript.feed.target;
|
|
26
|
+
const messages = useQuery(
|
|
27
|
+
db,
|
|
28
|
+
feed ? Query.select(Filter.type(Message.Message)).from(feed) : Query.select(Filter.nothing()),
|
|
29
|
+
);
|
|
30
|
+
const model = useFeedModelAdapter(renderByline(members), messages);
|
|
31
|
+
const { recording, toggleRecording } = useTranscriptionRecording(transcript);
|
|
32
|
+
|
|
33
|
+
const menuActions = useMenuBuilder(
|
|
34
|
+
() =>
|
|
35
|
+
MenuBuilder.make()
|
|
36
|
+
.action(
|
|
37
|
+
'toggle-recording',
|
|
38
|
+
{
|
|
39
|
+
label: [recording ? 'stop-recording.label' : 'start-recording.label', { ns: meta.id }],
|
|
40
|
+
icon: recording ? 'ph--stop-circle--regular' : 'ph--microphone--regular',
|
|
41
|
+
disposition: 'toolbar',
|
|
42
|
+
testId: 'transcription.toggle-recording',
|
|
43
|
+
},
|
|
44
|
+
toggleRecording,
|
|
45
|
+
)
|
|
46
|
+
.build(),
|
|
47
|
+
[recording, toggleRecording],
|
|
48
|
+
);
|
|
49
|
+
|
|
50
|
+
return (
|
|
51
|
+
<Panel.Root role={role}>
|
|
52
|
+
<Menu.Root {...menuActions} attendableId={attendableId}>
|
|
53
|
+
<Panel.Toolbar asChild>
|
|
54
|
+
<Menu.Toolbar />
|
|
55
|
+
</Panel.Toolbar>
|
|
56
|
+
</Menu.Root>
|
|
57
|
+
<Panel.Content asChild>
|
|
58
|
+
<Transcription model={model} transcript={transcript} />
|
|
59
|
+
</Panel.Content>
|
|
60
|
+
</Panel.Root>
|
|
61
|
+
);
|
|
62
|
+
};
|
package/src/containers/index.ts
CHANGED
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2024 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
// Headless test that simulates a two-speaker conversation as a pair of Whisper streams and
|
|
6
|
+
// drives them through the (currently stubbed) Pass A enrichment and Pass B summarization
|
|
7
|
+
// operations. The handlers are deterministic placeholders — they don't call an LLM — so the
|
|
8
|
+
// test runs offline; switching to the real LLM-backed handlers later doesn't change the
|
|
9
|
+
// harness, just the assertions.
|
|
10
|
+
//
|
|
11
|
+
// What this verifies today:
|
|
12
|
+
// - Conversation fixture parses to entities + speaker-tagged utterances.
|
|
13
|
+
// - Stream simulator emits per-batch transcript blocks in chronological order.
|
|
14
|
+
// - Pass A's sliding-window enrichment links seeded ECHO entities by name and surfaces
|
|
15
|
+
// remaining capitalised tokens as candidates.
|
|
16
|
+
// - Pass B accumulates a per-speaker summary and resolves "I" → speaker display name.
|
|
17
|
+
|
|
18
|
+
import { describe, it } from '@effect/vitest';
|
|
19
|
+
import * as Effect from 'effect/Effect';
|
|
20
|
+
import * as fs from 'node:fs';
|
|
21
|
+
import * as path from 'node:path';
|
|
22
|
+
import * as url from 'node:url';
|
|
23
|
+
|
|
24
|
+
import { Blueprint, Operation, OperationHandlerSet } from '@dxos/compute';
|
|
25
|
+
import { Database, Feed, Obj, Type } from '@dxos/echo';
|
|
26
|
+
import { TestHelpers } from '@dxos/effect/testing';
|
|
27
|
+
import { AssistantTestLayer } from '@dxos/functions-runtime/testing';
|
|
28
|
+
import { EntityId } from '@dxos/keys';
|
|
29
|
+
import { Organization, Person } from '@dxos/types';
|
|
30
|
+
|
|
31
|
+
import { EnrichTranscript, EnrichmentHandlers, SummarizeConversation } from './operations';
|
|
32
|
+
import { parseConversation } from './parser';
|
|
33
|
+
import { simulateStream } from './stream-simulator';
|
|
34
|
+
|
|
35
|
+
EntityId.dangerouslyDisableRandomness();
|
|
36
|
+
|
|
37
|
+
const TestLayer = AssistantTestLayer({
|
|
38
|
+
operationHandlers: OperationHandlerSet.make(...EnrichmentHandlers),
|
|
39
|
+
types: [Person.Person, Organization.Organization, Blueprint.Blueprint, Feed.Feed],
|
|
40
|
+
disableLlmMemoization: true,
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
describe('Transcript enrichment — conversation simulation', () => {
|
|
44
|
+
it.scoped(
|
|
45
|
+
'streams a two-speaker conversation through Pass A and Pass B (stub handlers)',
|
|
46
|
+
Effect.fnUntraced(
|
|
47
|
+
function* ({ expect }) {
|
|
48
|
+
// 1. Load and parse the fixture.
|
|
49
|
+
const fixturePath = path.join(path.dirname(url.fileURLToPath(import.meta.url)), 'conversation.txt');
|
|
50
|
+
const conversation = parseConversation(fs.readFileSync(fixturePath, 'utf8'));
|
|
51
|
+
expect(conversation.speakers).toEqual(['A', 'B']);
|
|
52
|
+
expect(conversation.utterances.length).toBeGreaterThan(0);
|
|
53
|
+
expect(conversation.entities.length).toBeGreaterThan(0);
|
|
54
|
+
|
|
55
|
+
// 2. Seed the ECHO space with the fixture's entities. Map fixture types → schema types.
|
|
56
|
+
const seeded: { id: string; typename: string; name: string }[] = [];
|
|
57
|
+
for (const entity of conversation.entities) {
|
|
58
|
+
if (entity.kind === 'Person') {
|
|
59
|
+
const fullName = entity.fields.fullName ?? entity.fields.name;
|
|
60
|
+
if (!fullName) {
|
|
61
|
+
continue;
|
|
62
|
+
}
|
|
63
|
+
const person = yield* Database.add(Obj.make(Person.Person, { fullName }));
|
|
64
|
+
seeded.push({ id: person.id, typename: Type.getTypename(Person.Person), name: fullName });
|
|
65
|
+
} else if (entity.kind === 'Organization') {
|
|
66
|
+
const name = entity.fields.name;
|
|
67
|
+
if (!name) {
|
|
68
|
+
continue;
|
|
69
|
+
}
|
|
70
|
+
const org = yield* Database.add(Obj.make(Organization.Organization, { name }));
|
|
71
|
+
seeded.push({ id: org.id, typename: Type.getTypename(Organization.Organization), name });
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
yield* Database.flush();
|
|
75
|
+
expect(seeded.map((s) => s.name)).toContain('Chad');
|
|
76
|
+
expect(seeded.map((s) => s.name)).toContain('Blue Yard');
|
|
77
|
+
|
|
78
|
+
// 3. Generate the per-batch Whisper schedule. Batch by speaker so each batch maps to
|
|
79
|
+
// a single Pass-A invocation, mimicking what the live `useTranscriptEnrichment`
|
|
80
|
+
// hook will receive from the transcriber.
|
|
81
|
+
const batches = simulateStream(conversation, { wordsPerSecond: 2.5, gapSeconds: 0.5 });
|
|
82
|
+
expect(batches.length).toBe(conversation.utterances.length);
|
|
83
|
+
expect(batches[0].offsetMs).toBe(0);
|
|
84
|
+
expect(batches.every((b) => b.blocks.length > 0)).toBe(true);
|
|
85
|
+
|
|
86
|
+
// 4. Run Pass A over each batch — sliding window of the last 4 blocks across speakers.
|
|
87
|
+
const slidingWindow: { speaker: string; text: string; started: string }[] = [];
|
|
88
|
+
const enrichments: {
|
|
89
|
+
speaker: string;
|
|
90
|
+
corrected: string;
|
|
91
|
+
referenceIds: string[];
|
|
92
|
+
candidates: { text: string }[];
|
|
93
|
+
}[] = [];
|
|
94
|
+
for (const batch of batches) {
|
|
95
|
+
for (const block of batch.blocks) {
|
|
96
|
+
slidingWindow.push({ speaker: batch.speaker, text: block.text, started: block.started });
|
|
97
|
+
if (slidingWindow.length > 4) {
|
|
98
|
+
slidingWindow.shift();
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
const result = yield* Operation.invoke(EnrichTranscript, {
|
|
102
|
+
window: slidingWindow,
|
|
103
|
+
knownEntities: seeded,
|
|
104
|
+
});
|
|
105
|
+
// The new batch's entries are the *last* `batch.blocks.length` items in the window.
|
|
106
|
+
const newEntries = result.blocks.slice(-batch.blocks.length);
|
|
107
|
+
for (const block of newEntries) {
|
|
108
|
+
const windowEntry = slidingWindow[block.index];
|
|
109
|
+
enrichments.push({
|
|
110
|
+
speaker: windowEntry.speaker,
|
|
111
|
+
corrected: block.corrected,
|
|
112
|
+
referenceIds: [...block.referenceIds],
|
|
113
|
+
candidates: block.candidates.map((c) => ({ text: c.text })),
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
// 4a. Every block got a terminal-punctuated `corrected` value.
|
|
119
|
+
for (const e of enrichments) {
|
|
120
|
+
expect(e.corrected).toMatch(/[.!?]$/);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
// 4b. The block containing "Chad" links to the seeded Person.
|
|
124
|
+
const chadId = seeded.find((s) => s.name === 'Chad')!.id;
|
|
125
|
+
const chadMention = enrichments.find((e) => /\bChad\b/.test(e.corrected));
|
|
126
|
+
expect(chadMention).toBeDefined();
|
|
127
|
+
expect(chadMention!.referenceIds).toContain(chadId);
|
|
128
|
+
|
|
129
|
+
// 4c. Place names surface as candidates (not in our seed).
|
|
130
|
+
const allCandidates = enrichments.flatMap((e) => e.candidates.map((c) => c.text));
|
|
131
|
+
expect(allCandidates).toContain('Munich');
|
|
132
|
+
expect(allCandidates).toContain('Los Angeles');
|
|
133
|
+
|
|
134
|
+
// 5. Run Pass B once at the end of the conversation (the real pipeline would fire it
|
|
135
|
+
// after silence + interval; here we trigger it manually after the last batch).
|
|
136
|
+
const speakerNames = { A: 'Speaker A', B: 'Speaker B' };
|
|
137
|
+
const summary = yield* Operation.invoke(SummarizeConversation, {
|
|
138
|
+
previousSummary: '',
|
|
139
|
+
newUtterances: enrichments.map((e) => ({ speaker: e.speaker, text: e.corrected })),
|
|
140
|
+
speakerNames,
|
|
141
|
+
recentReferences: seeded.map((s) => ({ id: s.id, name: s.name })),
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
// 5a. Summary is non-empty and mentions both speakers.
|
|
145
|
+
expect(summary.summary.length).toBeGreaterThan(0);
|
|
146
|
+
expect(summary.summary).toContain('Speaker A');
|
|
147
|
+
expect(summary.summary).toContain('Speaker B');
|
|
148
|
+
|
|
149
|
+
// 5b. Resolved referents: every utterance that contains "I" picks up the speaker's name.
|
|
150
|
+
const iUtterances = enrichments.filter((e) => /\bI\b/.test(e.corrected));
|
|
151
|
+
expect(summary.resolvedReferents.length).toBe(iUtterances.length);
|
|
152
|
+
for (const referent of summary.resolvedReferents) {
|
|
153
|
+
expect(referent.surface).toBe('I');
|
|
154
|
+
expect([speakerNames.A, speakerNames.B]).toContain(referent.referent);
|
|
155
|
+
}
|
|
156
|
+
},
|
|
157
|
+
Effect.provide(TestLayer),
|
|
158
|
+
TestHelpers.provideTestContext,
|
|
159
|
+
),
|
|
160
|
+
{ timeout: 30_000 },
|
|
161
|
+
);
|
|
162
|
+
});
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Conversation fixture for transcription enrichment tests.
|
|
2
|
+
# Format:
|
|
3
|
+
# `Entities:` block — declares ECHO objects to seed into the test space.
|
|
4
|
+
# Each entry is `<Type>:` followed by indented `<field>: <value>` lines.
|
|
5
|
+
# `Conversation:` block — one utterance per line, `<speaker>: <text>`.
|
|
6
|
+
# Speakers map to distinct virtual Whisper streams in the simulator.
|
|
7
|
+
# Lines starting with `#` are comments and are ignored by the parser.
|
|
8
|
+
|
|
9
|
+
Entities:
|
|
10
|
+
Person:
|
|
11
|
+
fullName: Chad
|
|
12
|
+
employer: Blue Yard
|
|
13
|
+
Organization:
|
|
14
|
+
name: Blue Yard
|
|
15
|
+
|
|
16
|
+
Conversation:
|
|
17
|
+
A: I think I'm going to go.
|
|
18
|
+
B: Are you meeting with them?
|
|
19
|
+
A: Yes I think so.
|
|
20
|
+
B: But I thought they were in Munich?
|
|
21
|
+
A: They are, but the offsite is in Los Angeles.
|
|
22
|
+
B: Is Chad going to be there?
|
|
23
|
+
A: Yes, the whole team. It's their annual offsite.
|