@dxos/plugin-transcription 0.8.4-main.fcfe5033a5 → 0.8.4-staging.60fe92afc8
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/neutral/blueprint-definition-DA4QFRYJ.mjs +15 -0
- package/dist/lib/neutral/blueprint-definition-DA4QFRYJ.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-FHNI26QW.mjs +45 -0
- package/dist/lib/neutral/chunk-FHNI26QW.mjs.map +7 -0
- package/dist/lib/{browser/chunk-HOOPZ7EM.mjs → neutral/chunk-KAEXRX3Y.mjs} +1 -1
- package/dist/lib/{browser/chunk-KOX4WNAR.mjs → neutral/chunk-KMT3BMMQ.mjs} +35 -22
- package/dist/lib/neutral/chunk-KMT3BMMQ.mjs.map +7 -0
- package/dist/lib/neutral/chunk-KXJZEYS7.mjs +8 -0
- package/dist/lib/neutral/chunk-KXJZEYS7.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-TO77KAQK.mjs +298 -0
- package/dist/lib/neutral/chunk-TO77KAQK.mjs.map +7 -0
- package/dist/lib/neutral/chunk-TX3NQISZ.mjs +435 -0
- package/dist/lib/neutral/chunk-TX3NQISZ.mjs.map +7 -0
- package/dist/lib/{browser/blueprints/index.mjs → neutral/chunk-ZR4BH4QQ.mjs} +5 -6
- package/dist/lib/neutral/chunk-ZR4BH4QQ.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +269 -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/{browser/create-BTWYQ6IM.mjs → neutral/create-RVR7VC33.mjs} +5 -5
- package/dist/lib/neutral/create-RVR7VC33.mjs.map +7 -0
- package/dist/lib/neutral/hooks/index.mjs +19 -0
- package/dist/lib/neutral/index.mjs +44 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +8 -0
- package/dist/lib/neutral/meta.mjs.map +7 -0
- package/dist/lib/{browser/open-CYRYIEZI.mjs → neutral/open-A5KXKRH4.mjs} +7 -7
- package/dist/lib/neutral/open-A5KXKRH4.mjs.map +7 -0
- package/dist/lib/neutral/operation-handler-NXMOAXFP.mjs +13 -0
- package/dist/lib/neutral/operation-handler-NXMOAXFP.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +8 -0
- package/dist/lib/neutral/operations/index.mjs.map +7 -0
- package/dist/lib/neutral/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-YMZRO242.mjs +26 -0
- package/dist/lib/neutral/react-surface-YMZRO242.mjs.map +7 -0
- package/dist/lib/{browser/summarize-X2ZYTN7S.mjs → neutral/summarize-5XPPMVTE.mjs} +9 -11
- package/dist/lib/neutral/summarize-5XPPMVTE.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/neutral/transcriber-OGSF3XO5.mjs +59 -0
- package/dist/lib/neutral/transcriber-OGSF3XO5.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 +1 -1
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +8 -3
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts +1 -1
- package/dist/types/src/capabilities/operation-handler.d.ts.map +1 -1
- 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 +1 -1
- package/dist/types/src/capabilities/transcriber.d.ts.map +1 -1
- package/dist/types/src/components/Oracle/Oracle.d.ts +24 -0
- package/dist/types/src/components/Oracle/Oracle.d.ts.map +1 -0
- package/dist/types/src/components/Oracle/Oracle.stories.d.ts +32 -0
- package/dist/types/src/components/Oracle/Oracle.stories.d.ts.map +1 -0
- package/dist/types/src/components/Oracle/index.d.ts +2 -0
- package/dist/types/src/components/Oracle/index.d.ts.map +1 -0
- package/dist/types/src/components/Transcription/Transcription.d.ts +1 -8
- package/dist/types/src/components/Transcription/Transcription.d.ts.map +1 -1
- package/dist/types/src/components/Transcription/Transcription.stories.d.ts +20 -23
- 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 +1 -1
- 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/{operations/definitions.d.ts → normalization/normalization.d.ts} +464 -547
- 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 +3 -3
- package/dist/types/src/operations/create.d.ts.map +1 -1
- package/dist/types/src/operations/index.d.ts +1 -2
- package/dist/types/src/operations/index.d.ts.map +1 -1
- package/dist/types/src/operations/open.d.ts +3 -3
- package/dist/types/src/operations/open.d.ts.map +1 -1
- package/dist/types/src/operations/summarize.d.ts +3 -3
- package/dist/types/src/operations/summarize.d.ts.map +1 -1
- 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/stories/KeyWordRecognition.stories.d.ts.map +1 -0
- package/dist/types/src/{components/stories/MicrophoneTranscription.stories.d.ts → stories/LiveTranscription.stories.d.ts} +5 -5
- 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 -2
- 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 +136 -102
- package/src/TranscriptionPlugin.node.ts +20 -0
- package/src/TranscriptionPlugin.test.ts +31 -0
- package/src/TranscriptionPlugin.tsx +11 -31
- package/src/TranscriptionPlugin.workerd.ts +18 -0
- package/src/blueprints/transcription-blueprint.ts +3 -4
- package/src/capabilities/blueprint-definition.ts +6 -4
- package/src/capabilities/index.ts +9 -2
- package/src/capabilities/operation-handler.ts +1 -1
- package/src/capabilities/react-surface.tsx +2 -2
- package/src/capabilities/text-content.ts +33 -0
- package/src/capabilities/transcriber.ts +9 -5
- 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 +117 -153
- package/src/components/Transcription/Transcription.tsx +8 -17
- 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/useAudioTrack.ts +1 -1
- package/src/hooks/useFeedModelAdapter.ts +46 -0
- package/src/hooks/useTranscriber.ts +7 -5
- package/src/hooks/useTranscriptionRecording.ts +87 -0
- package/src/hooks/useVoiceInput.ts +1 -1
- package/src/index.ts +4 -5
- package/src/meta.ts +28 -6
- package/src/model/model.test.ts +5 -5
- 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 +4 -38
- package/src/{segments-normalization → normalization}/normalization.ts +8 -9
- package/src/operations/create.ts +3 -3
- package/src/operations/index.ts +1 -3
- package/src/operations/open.ts +3 -3
- package/src/operations/summarize.ts +7 -7
- package/src/plugin.ts +11 -0
- package/src/stories/FileTranscription.stories.tsx +143 -0
- package/src/{components/stories → stories}/KeyWordRecognition.stories.tsx +36 -36
- 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 +22 -34
- package/src/transcriber/index.ts +1 -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 +3 -0
- package/src/{operations/definitions.ts → types/TranscriptOperation.ts} +14 -9
- package/src/types/TranscriptionCapabilities.ts +39 -0
- package/src/types/index.ts +2 -2
- package/src/vite-env.d.ts +10 -0
- package/dist/lib/browser/blueprints/index.mjs.map +0 -7
- package/dist/lib/browser/chunk-5LWSJZTZ.mjs +0 -17
- package/dist/lib/browser/chunk-5LWSJZTZ.mjs.map +0 -7
- package/dist/lib/browser/chunk-KOX4WNAR.mjs.map +0 -7
- package/dist/lib/browser/create-BTWYQ6IM.mjs.map +0 -7
- package/dist/lib/browser/index.mjs +0 -1213
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/open-CYRYIEZI.mjs.map +0 -7
- package/dist/lib/browser/operations/index.mjs +0 -13
- package/dist/lib/browser/operations/index.mjs.map +0 -7
- package/dist/lib/browser/summarize-X2ZYTN7S.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -10
- package/dist/lib/node-esm/blueprints/index.mjs +0 -32
- package/dist/lib/node-esm/blueprints/index.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
- package/dist/lib/node-esm/chunk-MT5I4NH5.mjs +0 -112
- package/dist/lib/node-esm/chunk-MT5I4NH5.mjs.map +0 -7
- 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/chunk-X74WYCCE.mjs +0 -19
- package/dist/lib/node-esm/chunk-X74WYCCE.mjs.map +0 -7
- package/dist/lib/node-esm/create-MLUFPST2.mjs +0 -22
- package/dist/lib/node-esm/create-MLUFPST2.mjs.map +0 -7
- package/dist/lib/node-esm/index.mjs +0 -1214
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/open-5IOC2U4Z.mjs +0 -28
- package/dist/lib/node-esm/open-5IOC2U4Z.mjs.map +0 -7
- package/dist/lib/node-esm/operations/index.mjs +0 -14
- package/dist/lib/node-esm/operations/index.mjs.map +0 -7
- package/dist/lib/node-esm/summarize-IORITU7T.mjs +0 -80
- package/dist/lib/node-esm/summarize-IORITU7T.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -11
- 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 -2
- package/dist/types/src/containers/TranscriptionContainer/index.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/operations/definitions.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 -364
- 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/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/components/stories/FileTranscription.stories.tsx +0 -250
- package/src/components/stories/MicrophoneTranscription.stories.tsx +0 -264
- package/src/components/stories/TranscriptionStory.tsx +0 -43
- package/src/components/stories/useIsSpeaking.tsx +0 -40
- package/src/containers/TranscriptionContainer/TranscriptionContainer.tsx +0 -35
- package/src/containers/TranscriptionContainer/index.ts +0 -5
- package/src/hooks/useQueueModelAdapter.ts +0 -66
- package/src/types/capabilities.ts +0 -34
- package/src/types/types.ts +0 -9
- package/dist/lib/{browser/types → 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/{node-esm/types → neutral/hooks}/index.mjs.map +0 -0
- package/dist/lib/{node-esm/chunk-HSLMI22Q.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/{segments-normalization → normalization}/utils.d.ts +0 -0
- package/dist/types/src/{components/stories → stories}/KeyWordRecognition.stories.d.ts +0 -0
- package/src/{segments-normalization → normalization}/index.ts +1 -1
- /package/src/{segments-normalization → normalization}/utils.ts +0 -0
|
@@ -10,12 +10,15 @@ import { log } from '@dxos/log';
|
|
|
10
10
|
import { trace } from '@dxos/tracing';
|
|
11
11
|
import { type ContentBlock } from '@dxos/types';
|
|
12
12
|
|
|
13
|
-
import { TRANSCRIPTION_URL } from '#types';
|
|
14
|
-
|
|
15
13
|
import { mergeFloat64Arrays } from '../util';
|
|
16
14
|
import { type AudioChunk, type AudioRecorder } from './audio-recorder';
|
|
17
15
|
|
|
18
|
-
|
|
16
|
+
/**
|
|
17
|
+
* Endpoint to the calls service.
|
|
18
|
+
*/
|
|
19
|
+
const DEFAULT_TRANSCRIPTION_URL = 'https://calls-service.dxos.workers.dev';
|
|
20
|
+
|
|
21
|
+
export type WhisperWord = {
|
|
19
22
|
word: string;
|
|
20
23
|
|
|
21
24
|
/**
|
|
@@ -29,7 +32,7 @@ type WhisperWord = {
|
|
|
29
32
|
end: number;
|
|
30
33
|
};
|
|
31
34
|
|
|
32
|
-
type WhisperSegment = {
|
|
35
|
+
export type WhisperSegment = {
|
|
33
36
|
text: string;
|
|
34
37
|
|
|
35
38
|
/**
|
|
@@ -61,8 +64,20 @@ export type TranscribeConfig = {
|
|
|
61
64
|
* This is needed to catch the beginning of the user's speech.
|
|
62
65
|
*/
|
|
63
66
|
prefixBufferChunksAmount: number;
|
|
67
|
+
|
|
68
|
+
/**
|
|
69
|
+
* Override the transcription endpoint base URL.
|
|
70
|
+
* Defaults to the DXOS calls service.
|
|
71
|
+
*/
|
|
72
|
+
endpoint?: string;
|
|
64
73
|
};
|
|
65
74
|
|
|
75
|
+
/**
|
|
76
|
+
* Function that converts a base64-encoded WAV payload into Whisper segments.
|
|
77
|
+
* Allows callers to swap in alternative providers or mock the transport.
|
|
78
|
+
*/
|
|
79
|
+
export type TranscribeFn = (audio: string) => Promise<WhisperSegment[]>;
|
|
80
|
+
|
|
66
81
|
export type TranscriberProps = {
|
|
67
82
|
config: TranscribeConfig;
|
|
68
83
|
recorder: AudioRecorder;
|
|
@@ -71,6 +86,10 @@ export type TranscriberProps = {
|
|
|
71
86
|
* @param segments - The transcribed segments.
|
|
72
87
|
*/
|
|
73
88
|
onSegments: (segments: ContentBlock.Transcript[]) => Promise<void>;
|
|
89
|
+
/**
|
|
90
|
+
* Optional override of the transcription transport. When provided, supersedes `config.endpoint`.
|
|
91
|
+
*/
|
|
92
|
+
transcribe?: TranscribeFn;
|
|
74
93
|
};
|
|
75
94
|
|
|
76
95
|
/**
|
|
@@ -80,22 +99,24 @@ export type TranscriberProps = {
|
|
|
80
99
|
*/
|
|
81
100
|
export class Transcriber extends Resource {
|
|
82
101
|
private _audioChunks: AudioChunk[] = [];
|
|
83
|
-
private
|
|
102
|
+
private _lastTimestamp = 0;
|
|
84
103
|
|
|
85
104
|
private readonly _openTrigger = new Trigger({ autoReset: true });
|
|
86
105
|
|
|
87
106
|
private readonly _config: TranscribeConfig;
|
|
88
107
|
private readonly _recorder: AudioRecorder;
|
|
89
108
|
private readonly _onSegments: TranscriberProps['onSegments'];
|
|
109
|
+
private readonly _transcribeFn?: TranscribeFn;
|
|
90
110
|
|
|
91
111
|
private _recording = false;
|
|
92
112
|
private _transcribeTask?: DeferredTask = undefined;
|
|
93
113
|
|
|
94
|
-
constructor({ config, recorder, onSegments }: TranscriberProps) {
|
|
114
|
+
constructor({ config, recorder, onSegments, transcribe }: TranscriberProps) {
|
|
95
115
|
super();
|
|
96
116
|
this._config = config;
|
|
97
117
|
this._recorder = recorder;
|
|
98
118
|
this._onSegments = onSegments;
|
|
119
|
+
this._transcribeFn = transcribe;
|
|
99
120
|
}
|
|
100
121
|
|
|
101
122
|
protected override async _open(ctx: Context): Promise<void> {
|
|
@@ -192,67 +213,91 @@ export class Transcriber extends Resource {
|
|
|
192
213
|
@trace.span({ showInBrowserTimeline: true })
|
|
193
214
|
private async _fetchTranscription(audio: string): Promise<WhisperSegment[]> {
|
|
194
215
|
if (audio.length === 0) {
|
|
195
|
-
this._audioChunks = [];
|
|
196
216
|
throw new Error('No audio to send for transcribing');
|
|
197
217
|
}
|
|
198
218
|
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
219
|
+
let segments: unknown;
|
|
220
|
+
if (this._transcribeFn) {
|
|
221
|
+
segments = await this._transcribeFn(audio);
|
|
222
|
+
} else {
|
|
223
|
+
// TODO(burdon): Create separate endpoint?
|
|
224
|
+
const endpoint = this._config.endpoint ?? DEFAULT_TRANSCRIPTION_URL;
|
|
225
|
+
const response = await fetch(`${endpoint}/transcribe`, {
|
|
226
|
+
method: 'POST',
|
|
227
|
+
body: JSON.stringify({ audio }),
|
|
228
|
+
headers: {
|
|
229
|
+
'Content-Type': 'application/json',
|
|
230
|
+
},
|
|
231
|
+
});
|
|
232
|
+
|
|
233
|
+
if (!response.ok) {
|
|
234
|
+
throw new Error(`Transcription failed: ${response.statusText}`);
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
({ segments } = (await response.json()) as { segments?: unknown });
|
|
210
238
|
}
|
|
211
239
|
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
log.info('transcription response', {
|
|
217
|
-
segments: segments.length,
|
|
218
|
-
string: segments.map((segments) => segments.text).join(' '),
|
|
219
|
-
});
|
|
240
|
+
if (!Array.isArray(segments)) {
|
|
241
|
+
throw new Error('Transcription response payload is invalid');
|
|
242
|
+
}
|
|
220
243
|
|
|
221
|
-
|
|
244
|
+
log.info('transcription response', { segments: segments.length });
|
|
245
|
+
return segments as WhisperSegment[];
|
|
222
246
|
}
|
|
223
247
|
|
|
224
248
|
private _alignSegments(segments: WhisperSegment[], originalChunks: AudioChunk[]): ContentBlock.Transcript[] {
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
const filteredSegments = segments
|
|
229
|
-
// Use segments that end after the last used timestamp.
|
|
230
|
-
// Segments could overlap, so we need to filter words that starts after the last used timestamp.
|
|
231
|
-
.filter((segment) => zeroTimestamp + segment.end * 1_000 >= this._lastUsedTimestamp)
|
|
232
|
-
// Use words that starts after the last used timestamp.
|
|
233
|
-
.map((segment) => {
|
|
234
|
-
const words = segment.words.filter((word) => zeroTimestamp + word.start * 1_000 >= this._lastUsedTimestamp);
|
|
235
|
-
return {
|
|
236
|
-
...segment,
|
|
237
|
-
words,
|
|
238
|
-
text: words.map((word) => word.word).join(''),
|
|
239
|
-
start: words.at(0)?.start ?? segment.end,
|
|
240
|
-
};
|
|
241
|
-
})
|
|
242
|
-
.filter((segment) => segment.words.length > 0);
|
|
243
|
-
|
|
244
|
-
if (filteredSegments.length === 0) {
|
|
245
|
-
return [];
|
|
249
|
+
const result = alignWhisperSegments(segments, originalChunks, this._lastTimestamp);
|
|
250
|
+
if (result.lastTimestamp !== undefined) {
|
|
251
|
+
this._lastTimestamp = result.lastTimestamp;
|
|
246
252
|
}
|
|
247
253
|
|
|
248
|
-
|
|
249
|
-
|
|
254
|
+
return result.transcripts;
|
|
255
|
+
}
|
|
256
|
+
}
|
|
257
|
+
|
|
258
|
+
/**
|
|
259
|
+
* Pure helper that filters and absolute-timestamps Whisper segments against a chunk timeline.
|
|
260
|
+
* Exported for testing.
|
|
261
|
+
*
|
|
262
|
+
* @param segments - Raw segments returned by the Whisper service for `originalChunks`.
|
|
263
|
+
* @param originalChunks - Chunks fed into the transcription request (used for the zero timestamp).
|
|
264
|
+
* @param lastTimestamp - Most recent absolute timestamp already emitted; segments whose end
|
|
265
|
+
* falls strictly before this point are deduped out, as are individual words whose start does.
|
|
266
|
+
*/
|
|
267
|
+
export const alignWhisperSegments = (
|
|
268
|
+
segments: WhisperSegment[],
|
|
269
|
+
originalChunks: AudioChunk[],
|
|
270
|
+
lastTimestamp: number,
|
|
271
|
+
): { transcripts: ContentBlock.Transcript[]; lastTimestamp?: number } => {
|
|
272
|
+
if (originalChunks.length === 0) {
|
|
273
|
+
return { transcripts: [] };
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
const zeroTimestamp = originalChunks[0].timestamp;
|
|
277
|
+
|
|
278
|
+
const filteredSegments = segments
|
|
279
|
+
.filter((segment) => zeroTimestamp + segment.end * 1_000 >= lastTimestamp)
|
|
280
|
+
.map((segment) => {
|
|
281
|
+
const words = segment.words.filter((word) => zeroTimestamp + word.start * 1_000 >= lastTimestamp);
|
|
282
|
+
return {
|
|
283
|
+
...segment,
|
|
284
|
+
words,
|
|
285
|
+
text: words.map((word) => word.word).join(''),
|
|
286
|
+
start: words.at(0)?.start ?? segment.end,
|
|
287
|
+
};
|
|
288
|
+
})
|
|
289
|
+
.filter((segment) => segment.words.length > 0);
|
|
290
|
+
|
|
291
|
+
if (filteredSegments.length === 0) {
|
|
292
|
+
return { transcripts: [] };
|
|
293
|
+
}
|
|
250
294
|
|
|
251
|
-
|
|
252
|
-
|
|
295
|
+
return {
|
|
296
|
+
lastTimestamp: zeroTimestamp + filteredSegments.at(-1)!.end * 1_000,
|
|
297
|
+
transcripts: filteredSegments.map((segment) => ({
|
|
253
298
|
_tag: 'transcript',
|
|
254
299
|
started: new Date(zeroTimestamp + segment.start * 1_000).toISOString(),
|
|
255
300
|
text: segment.text.trim(),
|
|
256
|
-
}))
|
|
257
|
-
}
|
|
258
|
-
}
|
|
301
|
+
})),
|
|
302
|
+
};
|
|
303
|
+
};
|
|
@@ -3,11 +3,14 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { Atom, type Registry } from '@effect-atom/atom-react';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
import * as Layer from 'effect/Layer';
|
|
6
8
|
|
|
7
9
|
import { synchronized } from '@dxos/async';
|
|
10
|
+
import { createFeedServiceLayer, type Space } from '@dxos/client/echo';
|
|
8
11
|
import { Resource } from '@dxos/context';
|
|
9
|
-
import { Obj } from '@dxos/echo';
|
|
10
|
-
import {
|
|
12
|
+
import { Feed, Obj } from '@dxos/echo';
|
|
13
|
+
import { EffectEx } from '@dxos/effect';
|
|
11
14
|
import { type EdgeHttpClient } from '@dxos/react-edge-client';
|
|
12
15
|
import { type ContentBlock, Message } from '@dxos/types';
|
|
13
16
|
|
|
@@ -37,7 +40,7 @@ export type TranscriptionManagerOptions = {
|
|
|
37
40
|
registry: Registry.Registry;
|
|
38
41
|
|
|
39
42
|
/**
|
|
40
|
-
* Enrich the message before it is written to the transcription
|
|
43
|
+
* Enrich the message before it is written to the transcription feed.
|
|
41
44
|
*/
|
|
42
45
|
messageEnricher?: TranscriptMessageEnricher;
|
|
43
46
|
};
|
|
@@ -53,7 +56,8 @@ export class TranscriptionManager extends Resource {
|
|
|
53
56
|
private _identityDid?: string = undefined;
|
|
54
57
|
private _mediaRecorder?: MediaStreamRecorder = undefined;
|
|
55
58
|
private _transcriber?: Transcriber = undefined;
|
|
56
|
-
private
|
|
59
|
+
private _feed?: Feed.Feed = undefined;
|
|
60
|
+
private _feedServiceLayer?: Layer.Layer<Feed.FeedService> = undefined;
|
|
57
61
|
private _enabledAtom = Atom.make(false);
|
|
58
62
|
|
|
59
63
|
constructor(options: TranscriptionManagerOptions) {
|
|
@@ -71,8 +75,9 @@ export class TranscriptionManager extends Resource {
|
|
|
71
75
|
return this._registry.get(this._enabledAtom);
|
|
72
76
|
}
|
|
73
77
|
|
|
74
|
-
|
|
75
|
-
this.
|
|
78
|
+
setFeed(space: Space, feed: Feed.Feed): this {
|
|
79
|
+
this._feed = feed;
|
|
80
|
+
this._feedServiceLayer = createFeedServiceLayer(space.queues);
|
|
76
81
|
return this;
|
|
77
82
|
}
|
|
78
83
|
|
|
@@ -132,7 +137,7 @@ export class TranscriptionManager extends Resource {
|
|
|
132
137
|
return;
|
|
133
138
|
}
|
|
134
139
|
|
|
135
|
-
// Reinitialize transcriber if
|
|
140
|
+
// Reinitialize transcriber if feed or media stream track has changed.
|
|
136
141
|
let needReinit = false;
|
|
137
142
|
if (this._audioStreamTrack !== this._mediaRecorder?.mediaStreamTrack) {
|
|
138
143
|
this._mediaRecorder = new MediaStreamRecorder({
|
|
@@ -161,7 +166,7 @@ export class TranscriptionManager extends Resource {
|
|
|
161
166
|
}
|
|
162
167
|
|
|
163
168
|
private async _onSegments(segments: ContentBlock.Transcript[]): Promise<void> {
|
|
164
|
-
if (!this.isOpen || !this.
|
|
169
|
+
if (!this.isOpen || !this._feed || !this._feedServiceLayer) {
|
|
165
170
|
return;
|
|
166
171
|
}
|
|
167
172
|
|
|
@@ -175,6 +180,6 @@ export class TranscriptionManager extends Resource {
|
|
|
175
180
|
block = await this._messageEnricher(block);
|
|
176
181
|
}
|
|
177
182
|
|
|
178
|
-
await
|
|
183
|
+
await Feed.append(this._feed, [block]).pipe(Effect.provide(this._feedServiceLayer), EffectEx.runAndForwardErrors);
|
|
179
184
|
}
|
|
180
185
|
}
|
package/src/translations.ts
CHANGED
|
@@ -17,6 +17,9 @@ export const translations = [
|
|
|
17
17
|
'bookmark.button': 'Bookmark',
|
|
18
18
|
'scroll-to-end.label': 'Scroll to latest',
|
|
19
19
|
|
|
20
|
+
'start-recording.label': 'Start recording',
|
|
21
|
+
'stop-recording.label': 'Stop recording',
|
|
22
|
+
|
|
20
23
|
'settings.entity-extraction.label': 'Entity extraction',
|
|
21
24
|
},
|
|
22
25
|
},
|
|
@@ -2,31 +2,33 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
// @import-as-namespace
|
|
6
|
+
|
|
5
7
|
import * as Schema from 'effect/Schema';
|
|
6
8
|
|
|
7
9
|
import { AiService } from '@dxos/ai';
|
|
8
10
|
import { SpaceSchema } from '@dxos/client/echo';
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
+
import { Operation } from '@dxos/compute';
|
|
12
|
+
import { Database, Feed, Ref, Type, DXN } from '@dxos/echo';
|
|
11
13
|
import { Message, Transcript } from '@dxos/types';
|
|
12
14
|
|
|
13
15
|
import { meta } from '#meta';
|
|
14
16
|
|
|
15
|
-
const
|
|
17
|
+
const makeKey = (name: string) => DXN.make(`${meta.id}.operation.${name}`);
|
|
16
18
|
|
|
17
19
|
export const Create = Operation.make({
|
|
18
|
-
meta: { key:
|
|
20
|
+
meta: { key: makeKey('create'), name: 'Create Transcript', icon: 'ph--microphone--regular' },
|
|
19
21
|
input: Schema.Struct({
|
|
20
22
|
name: Schema.optional(Schema.String),
|
|
21
23
|
space: SpaceSchema,
|
|
22
24
|
}),
|
|
23
25
|
output: Schema.Struct({
|
|
24
|
-
object: Transcript.Transcript,
|
|
26
|
+
object: Type.getSchema(Transcript.Transcript),
|
|
25
27
|
}),
|
|
26
28
|
});
|
|
27
29
|
|
|
28
30
|
export const MessageWithRangeId = Schema.extend(
|
|
29
|
-
Message.Message,
|
|
31
|
+
Type.getSchema(Message.Message),
|
|
30
32
|
Schema.Struct({
|
|
31
33
|
rangeId: Schema.optional(Schema.Array(Schema.String)).annotations({
|
|
32
34
|
description: 'The IDs of the messages that contain the sentences.',
|
|
@@ -38,9 +40,10 @@ export type MessageWithRangeIdType = Schema.Schema.Type<typeof MessageWithRangeI
|
|
|
38
40
|
|
|
39
41
|
export const Open = Operation.make({
|
|
40
42
|
meta: {
|
|
41
|
-
key: 'org.dxos.function.transcription.open',
|
|
43
|
+
key: DXN.make('org.dxos.function.transcription.open'),
|
|
42
44
|
name: 'Open',
|
|
43
45
|
description: 'Opens and reads the contents of a transcription object.',
|
|
46
|
+
icon: 'ph--folder-open--regular',
|
|
44
47
|
},
|
|
45
48
|
input: Schema.Struct({
|
|
46
49
|
transcript: Ref.Ref(Transcript.Transcript).annotations({
|
|
@@ -55,9 +58,10 @@ export const Open = Operation.make({
|
|
|
55
58
|
|
|
56
59
|
export const Summarize = Operation.make({
|
|
57
60
|
meta: {
|
|
58
|
-
key: 'org.dxos.function.transcription.summarize',
|
|
61
|
+
key: DXN.make('org.dxos.function.transcription.summarize'),
|
|
59
62
|
name: 'Summarize',
|
|
60
63
|
description: 'Summarize a transcript of a meeting.',
|
|
64
|
+
icon: 'ph--text-align-left--regular',
|
|
61
65
|
},
|
|
62
66
|
input: Schema.Struct({
|
|
63
67
|
transcript: Schema.String.annotations({
|
|
@@ -91,9 +95,10 @@ export const SentenceNormalizationOutput = Schema.Struct({
|
|
|
91
95
|
|
|
92
96
|
export const SentenceNormalization = Operation.make({
|
|
93
97
|
meta: {
|
|
94
|
-
key: 'org.dxos.function.transcription.
|
|
98
|
+
key: DXN.make('org.dxos.function.transcription.sentenceNormalization'),
|
|
95
99
|
name: 'Sentence Normalization',
|
|
96
100
|
description: 'Post process of transcription for sentence normalization',
|
|
101
|
+
icon: 'ph--text-t--regular',
|
|
97
102
|
},
|
|
98
103
|
input: SentenceNormalizationInput,
|
|
99
104
|
output: SentenceNormalizationOutput,
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
// @import-as-namespace
|
|
6
|
+
|
|
7
|
+
import { Capability } from '@dxos/app-framework';
|
|
8
|
+
|
|
9
|
+
import { meta } from '#meta';
|
|
10
|
+
|
|
11
|
+
import {
|
|
12
|
+
type MediaStreamRecorderProps,
|
|
13
|
+
type Transcriber as TranscriberType,
|
|
14
|
+
type TranscriberProps,
|
|
15
|
+
type TranscriptMessageEnricher,
|
|
16
|
+
type TranscriptionManager as TranscriptionManagerType,
|
|
17
|
+
} from '../transcriber';
|
|
18
|
+
|
|
19
|
+
export type TranscriberProviderProps = {
|
|
20
|
+
audioStreamTrack: MediaStreamTrack;
|
|
21
|
+
recorderConfig?: Partial<MediaStreamRecorderProps['config']>;
|
|
22
|
+
transcriberConfig?: Partial<TranscriberProps['config']>;
|
|
23
|
+
onSegments: TranscriberProps['onSegments'];
|
|
24
|
+
transcribe?: TranscriberProps['transcribe'];
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export type TranscriberProvider = (props: TranscriberProviderProps) => TranscriberType;
|
|
28
|
+
|
|
29
|
+
export type TranscriptionManagerProviderProps = {
|
|
30
|
+
messageEnricher?: TranscriptMessageEnricher;
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export type TranscriptionManagerProvider = (props: TranscriptionManagerProviderProps) => TranscriptionManagerType;
|
|
34
|
+
|
|
35
|
+
export const TranscriberProvider = Capability.make<TranscriberProvider>(`${meta.id}.capability.transcriber`);
|
|
36
|
+
|
|
37
|
+
export const TranscriptionManagerProvider = Capability.make<TranscriptionManagerProvider>(
|
|
38
|
+
`${meta.id}.capability.transcription-manager`,
|
|
39
|
+
);
|
package/src/types/index.ts
CHANGED
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/blueprints/transcription-blueprint.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type AppCapabilities } from '@dxos/app-toolkit';\nimport { Blueprint, Template } from '@dxos/blueprints';\nimport { trim } from '@dxos/util';\n\nimport { TranscriptOperation } from '#operations';\n\nconst BLUEPRINT_KEY = 'org.dxos.blueprint.transcription';\n\nconst make = () =>\n Blueprint.make({\n key: BLUEPRINT_KEY,\n name: 'Transcription',\n tools: Blueprint.toolDefinitions({ operations: [TranscriptOperation.Open, TranscriptOperation.Summarize] }),\n instructions: Template.make({\n source: trim`\n You can open and summarize a meeting transcript.\n `,\n }),\n });\n\nconst blueprint: AppCapabilities.BlueprintDefinition = {\n key: BLUEPRINT_KEY,\n make,\n};\n\nexport default blueprint;\n"],
|
|
5
|
-
"mappings": ";;;AAKA,SAASA,WAAWC,gBAAgB;AACpC,SAASC,YAAY;AAErB,SAASC,2BAA2B;AAEpC,IAAMC,gBAAgB;AAEtB,IAAMC,OAAO,MACXC,UAAUD,KAAK;EACbE,KAAKH;EACLI,MAAM;EACNC,OAAOH,UAAUI,gBAAgB;IAAEC,YAAY;MAACC,oBAAoBC;MAAMD,oBAAoBE;;EAAW,CAAA;EACzGC,cAAcC,SAASX,KAAK;IAC1BY,QAAQC;;;EAGV,CAAA;AACF,CAAA;AAEF,IAAMC,YAAiD;EACrDZ,KAAKH;EACLC;AACF;AAEA,IAAA,kCAAec;",
|
|
6
|
-
"names": ["Blueprint", "Template", "trim", "TranscriptOperation", "BLUEPRINT_KEY", "make", "Blueprint", "key", "name", "tools", "toolDefinitions", "operations", "TranscriptOperation", "Open", "Summarize", "instructions", "Template", "source", "trim", "blueprint"]
|
|
7
|
-
}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
// src/types/capabilities.ts
|
|
2
|
-
import { Capability } from "@dxos/app-framework";
|
|
3
|
-
import { meta } from "#meta";
|
|
4
|
-
(function(TranscriptionCapabilities2) {
|
|
5
|
-
TranscriptionCapabilities2.Transcriber = Capability.make(`${meta.id}.capability.transcriber`);
|
|
6
|
-
TranscriptionCapabilities2.TranscriptionManager = Capability.make(`${meta.id}.capability.transcription-manager`);
|
|
7
|
-
})(TranscriptionCapabilities || (TranscriptionCapabilities = {}));
|
|
8
|
-
var TranscriptionCapabilities;
|
|
9
|
-
|
|
10
|
-
// src/types/types.ts
|
|
11
|
-
var TRANSCRIPTION_URL = "https://calls-service.dxos.workers.dev";
|
|
12
|
-
|
|
13
|
-
export {
|
|
14
|
-
TranscriptionCapabilities,
|
|
15
|
-
TRANSCRIPTION_URL
|
|
16
|
-
};
|
|
17
|
-
//# sourceMappingURL=chunk-5LWSJZTZ.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/types/capabilities.ts", "../../../src/types/types.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\n\nimport { meta } from '#meta';\n\nimport {\n type MediaStreamRecorderProps,\n type Transcriber,\n type TranscriberProps,\n type TranscriptMessageEnricher,\n type TranscriptionManager,\n} from '../transcriber';\n\nexport namespace TranscriptionCapabilities {\n export type GetTranscriberProps = {\n audioStreamTrack: MediaStreamTrack;\n recorderConfig?: Partial<MediaStreamRecorderProps['config']>;\n transcriberConfig?: Partial<TranscriberProps['config']>;\n onSegments: TranscriberProps['onSegments'];\n };\n export type GetTranscriber = (props: GetTranscriberProps) => Transcriber;\n export const Transcriber = Capability.make<GetTranscriber>(`${meta.id}.capability.transcriber`);\n\n export type GetTranscriptionManagerProps = {\n messageEnricher?: TranscriptMessageEnricher;\n };\n export type GetTranscriptionManager = (props: GetTranscriptionManagerProps) => TranscriptionManager;\n export const TranscriptionManager = Capability.make<GetTranscriptionManager>(\n `${meta.id}.capability.transcription-manager`,\n );\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\n/**\n * Endpoint to the calls service.\n */\n// TODO(burdon): Reconfigure/move.\nexport const TRANSCRIPTION_URL = 'https://calls-service.dxos.workers.dev';\n"],
|
|
5
|
-
"mappings": ";AAIA,SAASA,kBAAkB;AAE3B,SAASC,YAAY;UAUJC,4BAAAA;6BAQFC,cAAcC,WAAWC,KAAqB,GAAGC,KAAKC,EAAE,yBAAyB;6BAMjFC,uBAAuBJ,WAAWC,KAC7C,GAAGC,KAAKC,EAAE,mCAAmC;AAEjD,GAjBiBL,8BAAAA,4BAAAA,CAAAA,EAAAA;;;;ACRV,IAAMO,oBAAoB;",
|
|
6
|
-
"names": ["Capability", "meta", "TranscriptionCapabilities", "Transcriber", "Capability", "make", "meta", "id", "TranscriptionManager", "TRANSCRIPTION_URL"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/operations/definitions.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { AiService } from '@dxos/ai';\nimport { SpaceSchema } from '@dxos/client/echo';\nimport { Database, Feed, Ref } from '@dxos/echo';\nimport { Operation } from '@dxos/operation';\nimport { Message, Transcript } from '@dxos/types';\n\nimport { meta } from '#meta';\n\nconst TRANSCRIPT_OPERATION = `${meta.id}.operation`;\n\nexport const Create = Operation.make({\n meta: { key: `${TRANSCRIPT_OPERATION}.create`, name: 'Create Transcript' },\n input: Schema.Struct({\n name: Schema.optional(Schema.String),\n space: SpaceSchema,\n }),\n output: Schema.Struct({\n object: Transcript.Transcript,\n }),\n});\n\nexport const MessageWithRangeId = Schema.extend(\n Message.Message,\n Schema.Struct({\n rangeId: Schema.optional(Schema.Array(Schema.String)).annotations({\n description: 'The IDs of the messages that contain the sentences.',\n }),\n }),\n);\n\nexport type MessageWithRangeIdType = Schema.Schema.Type<typeof MessageWithRangeId>;\n\nexport const Open = Operation.make({\n meta: {\n key: 'org.dxos.function.transcription.open',\n name: 'Open',\n description: 'Opens and reads the contents of a transcription object.',\n },\n input: Schema.Struct({\n transcript: Ref.Ref(Transcript.Transcript).annotations({\n description: 'The ID of the transcription object.',\n }),\n }),\n output: Schema.Struct({\n content: Schema.String,\n }),\n services: [Database.Service, Feed.FeedService],\n});\n\nexport const Summarize = Operation.make({\n meta: {\n key: 'org.dxos.function.transcription.summarize',\n name: 'Summarize',\n description: 'Summarize a transcript of a meeting.',\n },\n input: Schema.Struct({\n transcript: Schema.String.annotations({\n description: 'The transcript of the meeting.',\n }),\n notes: Schema.optional(Schema.String).annotations({\n description: 'Additional notes from the participants.',\n }),\n }),\n output: Schema.Struct({\n summary: Schema.String.annotations({\n description: 'The summary of the transcript.',\n }),\n }),\n services: [AiService.AiService],\n});\n\nexport const SentenceNormalizationInput = Schema.Struct({\n messages: Schema.Array(MessageWithRangeId).annotations({\n description: 'Messages to normalize into sentences.',\n }),\n});\n\nexport type SentenceNormalizationInputType = Schema.Schema.Type<typeof SentenceNormalizationInput>;\n\nexport const SentenceNormalizationOutput = Schema.Struct({\n sentences: Schema.Array(MessageWithRangeId.pipe(Schema.mutable)).pipe(Schema.mutable).annotations({\n description: 'The sentences of the transcript.',\n }),\n});\n\nexport const SentenceNormalization = Operation.make({\n meta: {\n key: 'org.dxos.function.transcription.sentence-normalization',\n name: 'Sentence Normalization',\n description: 'Post process of transcription for sentence normalization',\n },\n input: SentenceNormalizationInput,\n output: SentenceNormalizationOutput,\n services: [],\n});\n"],
|
|
5
|
-
"mappings": ";;;;;AAAA;;;;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,iBAAiB;AAC1B,SAASC,mBAAmB;AAC5B,SAASC,UAAUC,MAAMC,WAAW;AACpC,SAASC,iBAAiB;AAC1B,SAASC,SAASC,kBAAkB;AAEpC,SAASC,YAAY;AAErB,IAAMC,uBAAuB,GAAGC,KAAKC,EAAE;AAEhC,IAAMC,SAASC,UAAUC,KAAK;EACnCJ,MAAM;IAAEK,KAAK,GAAGN,oBAAAA;IAA+BO,MAAM;EAAoB;EACzEC,OAAcC,cAAO;IACnBF,MAAaG,gBAAgBC,aAAM;IACnCC,OAAOC;EACT,CAAA;EACAC,QAAeL,cAAO;IACpBM,QAAQC,WAAWA;EACrB,CAAA;AACF,CAAA;AAEO,IAAMC,qBAA4BC,cACvCC,QAAQA,SACDV,cAAO;EACZW,SAAgBV,gBAAgBW,aAAaV,aAAM,CAAA,EAAGW,YAAY;IAChEC,aAAa;EACf,CAAA;AACF,CAAA,CAAA;AAKK,IAAMC,OAAOpB,UAAUC,KAAK;EACjCJ,MAAM;IACJK,KAAK;IACLC,MAAM;IACNgB,aAAa;EACf;EACAf,OAAcC,cAAO;IACnBgB,YAAYC,IAAIA,IAAIV,WAAWA,UAAU,EAAEM,YAAY;MACrDC,aAAa;IACf,CAAA;EACF,CAAA;EACAT,QAAeL,cAAO;IACpBkB,SAAgBhB;EAClB,CAAA;EACAiB,UAAU;IAACC,SAASC;IAASC,KAAKC;;AACpC,CAAA;AAEO,IAAMC,YAAY7B,UAAUC,KAAK;EACtCJ,MAAM;IACJK,KAAK;IACLC,MAAM;IACNgB,aAAa;EACf;EACAf,OAAcC,cAAO;IACnBgB,YAAmBd,cAAOW,YAAY;MACpCC,aAAa;IACf,CAAA;IACAW,OAAcxB,gBAAgBC,aAAM,EAAEW,YAAY;MAChDC,aAAa;IACf,CAAA;EACF,CAAA;EACAT,QAAeL,cAAO;IACpB0B,SAAgBxB,cAAOW,YAAY;MACjCC,aAAa;IACf,CAAA;EACF,CAAA;EACAK,UAAU;IAACQ,UAAUA;;AACvB,CAAA;AAEO,IAAMC,6BAAoC5B,cAAO;EACtD6B,UAAiBjB,aAAMJ,kBAAAA,EAAoBK,YAAY;IACrDC,aAAa;EACf,CAAA;AACF,CAAA;AAIO,IAAMgB,8BAAqC9B,cAAO;EACvD+B,WAAkBnB,aAAMJ,mBAAmBwB,KAAYC,cAAO,CAAA,EAAGD,KAAYC,cAAO,EAAEpB,YAAY;IAChGC,aAAa;EACf,CAAA;AACF,CAAA;AAEO,IAAMoB,wBAAwBvC,UAAUC,KAAK;EAClDJ,MAAM;IACJK,KAAK;IACLC,MAAM;IACNgB,aAAa;EACf;EACAf,OAAO6B;EACPvB,QAAQyB;EACRX,UAAU,CAAA;AACZ,CAAA;",
|
|
6
|
-
"names": ["Schema", "AiService", "SpaceSchema", "Database", "Feed", "Ref", "Operation", "Message", "Transcript", "meta", "TRANSCRIPT_OPERATION", "meta", "id", "Create", "Operation", "make", "key", "name", "input", "Struct", "optional", "String", "space", "SpaceSchema", "output", "object", "Transcript", "MessageWithRangeId", "extend", "Message", "rangeId", "Array", "annotations", "description", "Open", "transcript", "Ref", "content", "services", "Database", "Service", "Feed", "FeedService", "Summarize", "notes", "summary", "AiService", "SentenceNormalizationInput", "messages", "SentenceNormalizationOutput", "sentences", "pipe", "mutable", "SentenceNormalization"]
|
|
7
|
-
}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/operations/create.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Feed, Ref } from '@dxos/echo';\nimport { Operation } from '@dxos/operation';\nimport { Transcript } from '@dxos/types';\n\nimport { Create } from './definitions';\n\nconst handler: Operation.WithHandler<typeof Create> = Create.pipe(\n Operation.withHandler(\n Effect.fn(function* ({ space }) {\n const feed = space.db.add(Feed.make());\n return {\n object: Transcript.make(Ref.make(feed)),\n };\n }),\n ),\n);\n\nexport default handler;\n"],
|
|
5
|
-
"mappings": ";;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,MAAMC,WAAW;AAC1B,SAASC,iBAAiB;AAC1B,SAASC,kBAAkB;AAI3B,IAAMC,UAAgDC,OAAOC,KAC3DC,UAAUC,YACDC,UAAG,WAAW,EAAEC,MAAK,GAAE;AAC5B,QAAMC,OAAOD,MAAME,GAAGC,IAAIC,KAAKC,KAAI,CAAA;AACnC,SAAO;IACLC,QAAQC,WAAWF,KAAKG,IAAIH,KAAKJ,IAAAA,CAAAA;EACnC;AACF,CAAA,CAAA,CAAA;AAIJ,IAAA,iBAAeP;",
|
|
6
|
-
"names": ["Effect", "Feed", "Ref", "Operation", "Transcript", "handler", "Create", "pipe", "Operation", "withHandler", "fn", "space", "feed", "db", "add", "Feed", "make", "object", "Transcript", "Ref"]
|
|
7
|
-
}
|