@dxos/plugin-transcription 0.8.4-main.c85a9c8dae → 0.8.4-main.dfabb4ec29
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/{browser/TranscriptionContainer-RBFHP2AV.mjs → neutral/TranscriptionContainer-XNGXNGPX.mjs} +10 -16
- package/dist/lib/neutral/TranscriptionContainer-XNGXNGPX.mjs.map +7 -0
- package/dist/lib/neutral/TranscriptionPlugin.mjs +34 -0
- package/dist/lib/neutral/TranscriptionPlugin.mjs.map +7 -0
- package/dist/lib/neutral/TranscriptionPlugin.node.mjs +25 -0
- package/dist/lib/neutral/TranscriptionPlugin.node.mjs.map +7 -0
- package/dist/lib/{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/{browser/chunk-2B74LZZD.mjs → neutral/chunk-GL4RS533.mjs} +2 -2
- package/dist/lib/{browser/chunk-2B74LZZD.mjs.map → neutral/chunk-GL4RS533.mjs.map} +3 -3
- package/dist/lib/{browser/chunk-HOOPZ7EM.mjs → neutral/chunk-KAEXRX3Y.mjs} +1 -1
- package/dist/lib/{browser/chunk-EV5ZYKET.mjs → neutral/chunk-LS3R7EQI.mjs} +74 -104
- package/dist/lib/neutral/chunk-LS3R7EQI.mjs.map +7 -0
- package/dist/lib/neutral/chunk-MLRJWAQH.mjs +179 -0
- package/dist/lib/neutral/chunk-MLRJWAQH.mjs.map +7 -0
- package/dist/lib/neutral/chunk-NNR3EYR2.mjs +124 -0
- package/dist/lib/neutral/chunk-NNR3EYR2.mjs.map +7 -0
- package/dist/lib/neutral/chunk-NQQK7UZQ.mjs +244 -0
- package/dist/lib/neutral/chunk-NQQK7UZQ.mjs.map +7 -0
- package/dist/lib/neutral/chunk-WVEZMGBT.mjs +8 -0
- package/dist/lib/neutral/chunk-WVEZMGBT.mjs.map +7 -0
- package/dist/lib/neutral/chunk-ZR4BH4QQ.mjs +30 -0
- package/dist/lib/neutral/chunk-ZR4BH4QQ.mjs.map +7 -0
- package/dist/lib/neutral/components/index.mjs +207 -0
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/containers/index.mjs +9 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/neutral/create-2D6S4IMQ.mjs +21 -0
- package/dist/lib/neutral/create-2D6S4IMQ.mjs.map +7 -0
- package/dist/lib/neutral/hooks/index.mjs +17 -0
- package/dist/lib/neutral/index.mjs +44 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +8 -0
- package/dist/lib/neutral/open-2QB6IIET.mjs +27 -0
- package/dist/lib/neutral/open-2QB6IIET.mjs.map +7 -0
- package/dist/lib/neutral/operation-handler-NXMOAXFP.mjs +13 -0
- package/dist/lib/neutral/operation-handler-NXMOAXFP.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +8 -0
- package/dist/lib/neutral/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-QF4MUMWG.mjs +26 -0
- package/dist/lib/neutral/react-surface-QF4MUMWG.mjs.map +7 -0
- package/dist/lib/neutral/summarize-CJPVKWYZ.mjs +78 -0
- package/dist/lib/neutral/summarize-CJPVKWYZ.mjs.map +7 -0
- package/dist/lib/neutral/text-content-LHSUG2D2.mjs +30 -0
- package/dist/lib/neutral/text-content-LHSUG2D2.mjs.map +7 -0
- package/dist/lib/{browser/transcriber-WCPHHJYY.mjs → neutral/transcriber-M3R6HPTZ.mjs} +8 -10
- package/dist/lib/neutral/transcriber-M3R6HPTZ.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +22 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +12 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/types/src/TranscriptionPlugin.d.ts +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/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/Transcription/Transcription.d.ts +5 -4
- package/dist/types/src/components/Transcription/Transcription.d.ts.map +1 -1
- package/dist/types/src/components/Transcription/Transcription.stories.d.ts +10 -10
- 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/containers/TranscriptionContainer/TranscriptionContainer.d.ts +3 -3
- package/dist/types/src/containers/TranscriptionContainer/TranscriptionContainer.d.ts.map +1 -1
- package/dist/types/src/containers/TranscriptionContainer/index.d.ts +1 -2
- package/dist/types/src/containers/TranscriptionContainer/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/useQueueModelAdapter.d.ts.map +1 -1
- package/dist/types/src/hooks/useTranscriber.d.ts +2 -2
- package/dist/types/src/hooks/useTranscriber.d.ts.map +1 -1
- package/dist/types/src/hooks/useVoiceInput.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +2 -3
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/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/normalization/message-normalizer.d.ts.map +1 -0
- package/dist/types/src/{segments-normalization → normalization}/normalization.d.ts +330 -321
- 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/{components/stories → stories}/FileTranscription.stories.d.ts +3 -3
- 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 → stories}/MicrophoneTranscription.stories.d.ts +3 -3
- package/dist/types/src/stories/MicrophoneTranscription.stories.d.ts.map +1 -0
- package/dist/types/src/stories/TranscriptionStory.d.ts +23 -0
- package/dist/types/src/stories/TranscriptionStory.d.ts.map +1 -0
- package/dist/types/src/stories/useIsSpeaking.d.ts.map +1 -0
- package/dist/types/src/testing/testing.d.ts.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 +57 -2
- 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.map +1 -1
- package/dist/types/src/translations.d.ts +7 -8
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/TranscriptOperation.d.ts +917 -0
- package/dist/types/src/types/TranscriptOperation.d.ts.map +1 -0
- package/dist/types/src/types/TranscriptionCapabilities.d.ts +17 -0
- package/dist/types/src/types/TranscriptionCapabilities.d.ts.map +1 -0
- package/dist/types/src/types/{types.d.ts → defs.d.ts} +1 -1
- package/dist/types/src/types/defs.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +3 -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 +133 -81
- package/src/TranscriptionPlugin.node.ts +20 -0
- package/src/TranscriptionPlugin.test.ts +31 -0
- package/src/TranscriptionPlugin.tsx +8 -29
- 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/Transcription/Transcription.stories.tsx +24 -23
- package/src/components/Transcription/Transcription.tsx +30 -29
- package/src/containers/TranscriptionContainer/TranscriptionContainer.tsx +10 -8
- package/src/containers/TranscriptionContainer/index.ts +1 -3
- package/src/hooks/useTranscriber.ts +5 -2
- package/src/hooks/useVoiceInput.ts +0 -1
- package/src/index.ts +4 -5
- package/src/meta.ts +1 -1
- package/src/model/model.test.ts +6 -6
- package/src/model/model.ts +3 -3
- package/src/{segments-normalization → normalization}/message-normalizer.ts +1 -5
- 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/{components/stories → stories}/FileTranscription.stories.tsx +33 -16
- package/src/{components/stories → stories}/KeyWordRecognition.stories.tsx +32 -30
- package/src/{components/stories → stories}/MicrophoneTranscription.stories.tsx +18 -36
- package/src/stories/TranscriptionStory.tsx +93 -0
- package/src/testing/testing.ts +8 -18
- 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 +94 -53
- package/src/translations.ts +7 -7
- package/src/types/TranscriptOperation.ts +103 -0
- package/src/types/TranscriptionCapabilities.ts +39 -0
- package/src/types/index.ts +4 -4
- 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-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.map +0 -1
- package/dist/types/src/components/stories/KeyWordRecognition.stories.d.ts.map +0 -1
- package/dist/types/src/components/stories/MicrophoneTranscription.stories.d.ts.map +0 -1
- package/dist/types/src/components/stories/TranscriptionStory.d.ts +0 -12
- package/dist/types/src/components/stories/TranscriptionStory.d.ts.map +0 -1
- package/dist/types/src/components/stories/useIsSpeaking.d.ts.map +0 -1
- package/dist/types/src/functions/index.d.ts +0 -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/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.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.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/TranscriptionStory.tsx +0 -41
- package/src/functions/index.ts +0 -11
- package/src/functions/open.ts +0 -37
- package/src/functions/summarize.ts +0 -103
- package/src/segments-normalization/normalization.ts +0 -115
- package/src/types/TranscriptAction.ts +0 -32
- package/src/types/capabilities.ts +0 -33
- 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}/message-normalizer.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/dist/types/src/{components/stories → stories}/useIsSpeaking.d.ts +0 -0
- package/src/{segments-normalization → normalization}/index.ts +1 -1
- package/src/{segments-normalization → normalization}/normalization.test.ts +1 -1
- /package/src/{segments-normalization → normalization}/utils.ts +0 -0
- /package/src/{components/stories → stories}/useIsSpeaking.tsx +0 -0
- /package/src/types/{types.ts → defs.ts} +0 -0
|
@@ -9,31 +9,32 @@ import React, { type FC, useEffect, useMemo, useState } from 'react';
|
|
|
9
9
|
|
|
10
10
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
11
11
|
import { Key } from '@dxos/echo';
|
|
12
|
-
import { ClientPlugin } from '@dxos/plugin-client';
|
|
13
|
-
import {
|
|
12
|
+
import { ClientPlugin } from '@dxos/plugin-client/plugin';
|
|
13
|
+
import { initializeIdentity } from '@dxos/plugin-client/testing';
|
|
14
|
+
import { PreviewPlugin } from '@dxos/plugin-preview/testing';
|
|
14
15
|
import { StorybookPlugin, corePlugins } from '@dxos/plugin-testing';
|
|
15
|
-
import {
|
|
16
|
-
import { useMembers,
|
|
16
|
+
import { random } from '@dxos/random';
|
|
17
|
+
import { useMembers, useSpaces } from '@dxos/react-client/echo';
|
|
17
18
|
import { IconButton, Toolbar } from '@dxos/react-ui';
|
|
18
|
-
import {
|
|
19
|
-
import {
|
|
19
|
+
import { JsonHighlighter } from '@dxos/react-ui-syntax-highlighter';
|
|
20
|
+
import { withLayout } from '@dxos/react-ui/testing';
|
|
20
21
|
import { TestSchema } from '@dxos/schema/testing';
|
|
21
22
|
import { type ContentBlock, type Message, Organization, Person } from '@dxos/types';
|
|
22
23
|
|
|
23
|
-
import { useQueueModelAdapter } from '
|
|
24
|
-
import { SerializationModel } from '../../model';
|
|
24
|
+
import { useQueueModelAdapter } from '#hooks';
|
|
25
25
|
import {
|
|
26
26
|
MessageBuilder,
|
|
27
27
|
TestItem,
|
|
28
28
|
useTestTranscriptionQueue,
|
|
29
29
|
useTestTranscriptionQueueWithEntityExtraction,
|
|
30
|
-
} from '
|
|
31
|
-
import { translations } from '
|
|
32
|
-
import { renderByline } from '../../util';
|
|
30
|
+
} from '#testing';
|
|
31
|
+
import { translations } from '#translations';
|
|
33
32
|
|
|
33
|
+
import { SerializationModel } from '../../model';
|
|
34
|
+
import { renderByline } from '../../util';
|
|
34
35
|
import { Transcription, type TranscriptionProps } from './Transcription';
|
|
35
36
|
|
|
36
|
-
|
|
37
|
+
random.seed(1);
|
|
37
38
|
|
|
38
39
|
/**
|
|
39
40
|
* Story wrapper with test controls.
|
|
@@ -50,9 +51,7 @@ const TranscriptContainer: FC<
|
|
|
50
51
|
<Transcription model={model} />
|
|
51
52
|
<div className='grid grid-cols-[1fr_16rem] overflow-hidden'>
|
|
52
53
|
<div className='flex items-center'>
|
|
53
|
-
<
|
|
54
|
-
{JSON.stringify(model.toJSON())}
|
|
55
|
-
</SyntaxHighlighter>
|
|
54
|
+
<JsonHighlighter data={model.toJSON()} indent={0} classNames='text-sm' />
|
|
56
55
|
</div>
|
|
57
56
|
<Toolbar.Root classNames='justify-end'>
|
|
58
57
|
<IconButton
|
|
@@ -67,12 +66,15 @@ const TranscriptContainer: FC<
|
|
|
67
66
|
);
|
|
68
67
|
};
|
|
69
68
|
|
|
70
|
-
type
|
|
69
|
+
type DefaultStoryProps = { messages?: Message.Message[] } & Pick<
|
|
70
|
+
TranscriptionProps,
|
|
71
|
+
'ignoreAttention' | 'attendableId'
|
|
72
|
+
>;
|
|
71
73
|
|
|
72
74
|
/**
|
|
73
75
|
* Basic story mutates array of messages.
|
|
74
76
|
*/
|
|
75
|
-
const BasicStory = ({ messages: initialMessages = [], ...props }:
|
|
77
|
+
const BasicStory = ({ messages: initialMessages = [], ...props }: DefaultStoryProps) => {
|
|
76
78
|
const [reset, setReset] = useState({});
|
|
77
79
|
const builder = useMemo(() => new MessageBuilder(), []);
|
|
78
80
|
const model = useMemo(
|
|
@@ -134,9 +136,9 @@ const QueueStory = ({
|
|
|
134
136
|
queueId,
|
|
135
137
|
onReset,
|
|
136
138
|
...props
|
|
137
|
-
}:
|
|
139
|
+
}: DefaultStoryProps & { queueId: Key.ObjectId; onReset: () => void }) => {
|
|
138
140
|
const [running, setRunning] = useState(true);
|
|
139
|
-
const space =
|
|
141
|
+
const [space] = useSpaces();
|
|
140
142
|
const members = useMembers(space?.id).map((member) => member.identity);
|
|
141
143
|
const queue = useTestTranscriptionQueue(space, queueId, running, 2_000);
|
|
142
144
|
const model = useQueueModelAdapter(renderByline(members), queue, initialMessages);
|
|
@@ -149,7 +151,7 @@ const QueueStory = ({
|
|
|
149
151
|
// TODO(burdon): Reconcile with QueueStory.
|
|
150
152
|
const EntityExtractionQueueStory = () => {
|
|
151
153
|
const [running, setRunning] = useState(true);
|
|
152
|
-
const space =
|
|
154
|
+
const [space] = useSpaces();
|
|
153
155
|
const members = useMembers(space?.key).map((member) => member.identity);
|
|
154
156
|
const queue = useTestTranscriptionQueueWithEntityExtraction(space, undefined, running, 2_000);
|
|
155
157
|
const model = useQueueModelAdapter(renderByline(members), queue, []);
|
|
@@ -173,7 +175,6 @@ const QueueStoryWrapper = () => {
|
|
|
173
175
|
const meta = {
|
|
174
176
|
title: 'plugins/plugin-transcription/components/Transcription',
|
|
175
177
|
decorators: [
|
|
176
|
-
withTheme(),
|
|
177
178
|
withLayout({ layout: 'fullscreen' }),
|
|
178
179
|
withPluginManager({
|
|
179
180
|
plugins: [
|
|
@@ -183,7 +184,7 @@ const meta = {
|
|
|
183
184
|
types: [TestItem, TestSchema.DocumentType, Person.Person, Organization.Organization],
|
|
184
185
|
onClientInitialized: ({ client }) =>
|
|
185
186
|
Effect.gen(function* () {
|
|
186
|
-
yield*
|
|
187
|
+
yield* initializeIdentity(client);
|
|
187
188
|
}),
|
|
188
189
|
}),
|
|
189
190
|
|
|
@@ -199,7 +200,7 @@ const meta = {
|
|
|
199
200
|
|
|
200
201
|
export default meta;
|
|
201
202
|
|
|
202
|
-
const DefaultStory = (props:
|
|
203
|
+
const DefaultStory = (props: DefaultStoryProps) => {
|
|
203
204
|
const [messages, setMessages] = useState<Message.Message[]>([]);
|
|
204
205
|
useEffect(() => {
|
|
205
206
|
void Promise.all(Array.from({ length: 10 }, () => MessageBuilder.singleton.createMessage())).then(setMessages);
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { useThemeContext } from '@dxos/react-ui';
|
|
8
8
|
import { useTextEditor } from '@dxos/react-ui-editor';
|
|
9
9
|
import { type Message, type Transcript } from '@dxos/types';
|
|
10
10
|
import {
|
|
@@ -13,51 +13,52 @@ import {
|
|
|
13
13
|
createMarkdownExtensions,
|
|
14
14
|
createThemeExtensions,
|
|
15
15
|
decorateMarkdown,
|
|
16
|
-
|
|
16
|
+
documentSlots,
|
|
17
17
|
preview,
|
|
18
18
|
} from '@dxos/ui-editor';
|
|
19
|
-
import {
|
|
19
|
+
import { composable, composableProps } from '@dxos/ui-theme';
|
|
20
20
|
import { isTruthy } from '@dxos/util';
|
|
21
21
|
|
|
22
22
|
import { type SerializationModel } from '../../model';
|
|
23
23
|
import { renderByline } from '../../util';
|
|
24
|
-
|
|
25
24
|
import { transcription } from './transcription-extension';
|
|
26
25
|
|
|
27
26
|
export { renderByline };
|
|
28
27
|
|
|
29
|
-
export type TranscriptionProps =
|
|
28
|
+
export type TranscriptionProps = {
|
|
30
29
|
transcript?: Transcript.Transcript;
|
|
31
30
|
model: SerializationModel<Message.Message>;
|
|
32
31
|
// TODO(burdon): Are these still in use?
|
|
33
32
|
attendableId?: string;
|
|
34
33
|
ignoreAttention?: boolean;
|
|
35
|
-
}
|
|
34
|
+
};
|
|
36
35
|
|
|
37
36
|
/**
|
|
38
37
|
* Transcript component implemented using the editor.
|
|
39
38
|
*/
|
|
40
|
-
export const Transcription =
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
39
|
+
export const Transcription = composable<HTMLDivElement, TranscriptionProps>(
|
|
40
|
+
({ transcript: object, model, children, ...props }, forwardedRef) => {
|
|
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: documentSlots }),
|
|
48
|
+
decorateMarkdown(),
|
|
49
|
+
preview(),
|
|
50
|
+
transcription({ model, started: object?.started ? new Date(object.started) : undefined }),
|
|
51
|
+
autoScroll(),
|
|
52
|
+
].filter(isTruthy),
|
|
53
|
+
};
|
|
54
|
+
}, [model]);
|
|
55
55
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
56
|
+
return (
|
|
57
|
+
<div
|
|
58
|
+
{...composableProps(props, { classNames: 'dx-container' })}
|
|
59
|
+
ref={parentRef}
|
|
60
|
+
data-popover-collision-boundary={true /* TODO(thure): Make this a constant and document it. */}
|
|
61
|
+
/>
|
|
62
|
+
);
|
|
63
|
+
},
|
|
64
|
+
);
|
|
@@ -4,23 +4,25 @@
|
|
|
4
4
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
|
-
import { type
|
|
8
|
-
import { Obj } from '@dxos/echo';
|
|
7
|
+
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
8
|
+
import { Feed, Obj } from '@dxos/echo';
|
|
9
9
|
import { useMembers, useQueue } from '@dxos/react-client/echo';
|
|
10
10
|
import { Panel } from '@dxos/react-ui';
|
|
11
11
|
import { type Message, type Transcript } from '@dxos/types';
|
|
12
12
|
|
|
13
|
-
import { Transcription } from '
|
|
14
|
-
import { useQueueModelAdapter } from '
|
|
13
|
+
import { Transcription } from '#components';
|
|
14
|
+
import { useQueueModelAdapter } from '#hooks';
|
|
15
|
+
|
|
15
16
|
import { renderByline } from '../../util';
|
|
16
17
|
|
|
17
|
-
export type TranscriptionContainerProps =
|
|
18
|
+
export type TranscriptionContainerProps = AppSurface.ObjectArticleProps<Transcript.Transcript>;
|
|
18
19
|
|
|
19
|
-
export const TranscriptionContainer = ({ role, subject: transcript }: TranscriptionContainerProps) => {
|
|
20
|
-
const attendableId = Obj.getDXN(transcript).toString();
|
|
20
|
+
export const TranscriptionContainer = ({ role, subject: transcript, attendableId }: TranscriptionContainerProps) => {
|
|
21
21
|
const db = Obj.getDatabase(transcript);
|
|
22
22
|
const members = useMembers(db?.spaceId).map((member) => member.identity);
|
|
23
|
-
const
|
|
23
|
+
const feed = transcript.feed.target;
|
|
24
|
+
const queueDxn = feed ? Feed.getQueueDxn(feed) : undefined;
|
|
25
|
+
const queue = useQueue<Message.Message>(queueDxn, { pollInterval: 1_000 });
|
|
24
26
|
const model = useQueueModelAdapter(renderByline(members), queue);
|
|
25
27
|
|
|
26
28
|
return (
|
|
@@ -6,8 +6,9 @@ import { useEffect, useMemo } from 'react';
|
|
|
6
6
|
|
|
7
7
|
import { useCapabilities } from '@dxos/app-framework/ui';
|
|
8
8
|
|
|
9
|
+
import { TranscriptionCapabilities } from '#types';
|
|
10
|
+
|
|
9
11
|
import { type Transcriber } from '../transcriber';
|
|
10
|
-
import { TranscriptionCapabilities } from '../types';
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* Records audio while user is speaking and transcribes it after user is done speaking.
|
|
@@ -17,6 +18,7 @@ export const useTranscriber = ({
|
|
|
17
18
|
recorderConfig,
|
|
18
19
|
transcriberConfig,
|
|
19
20
|
onSegments,
|
|
21
|
+
transcribe,
|
|
20
22
|
}: Partial<TranscriptionCapabilities.GetTranscriberProps>) => {
|
|
21
23
|
const [getTranscriber] = useCapabilities(TranscriptionCapabilities.Transcriber);
|
|
22
24
|
|
|
@@ -31,8 +33,9 @@ export const useTranscriber = ({
|
|
|
31
33
|
recorderConfig,
|
|
32
34
|
transcriberConfig,
|
|
33
35
|
onSegments,
|
|
36
|
+
transcribe,
|
|
34
37
|
});
|
|
35
|
-
}, [getTranscriber, audioStreamTrack, recorderConfig, transcriberConfig, onSegments]);
|
|
38
|
+
}, [getTranscriber, audioStreamTrack, recorderConfig, transcriberConfig, onSegments, transcribe]);
|
|
36
39
|
|
|
37
40
|
useEffect(() => {
|
|
38
41
|
return () => {
|
|
@@ -10,7 +10,6 @@ import { log } from '@dxos/log';
|
|
|
10
10
|
import { useSoundEffect } from '@dxos/react-ui-sfx';
|
|
11
11
|
|
|
12
12
|
import { type TranscriberProps } from '../transcriber';
|
|
13
|
-
|
|
14
13
|
import { useAudioTrack } from './useAudioTrack';
|
|
15
14
|
import { useTranscriber } from './useTranscriber';
|
|
16
15
|
|
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
|
@@ -6,7 +6,7 @@ import { type Plugin } from '@dxos/app-framework';
|
|
|
6
6
|
import { trim } from '@dxos/util';
|
|
7
7
|
|
|
8
8
|
export const meta: Plugin.Meta = {
|
|
9
|
-
id: 'dxos.
|
|
9
|
+
id: 'org.dxos.plugin.transcription',
|
|
10
10
|
name: 'Transcription',
|
|
11
11
|
description: trim`
|
|
12
12
|
Real-time voice-to-text transcription service for capturing spoken content.
|
package/src/model/model.test.ts
CHANGED
|
@@ -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
|
{
|
|
@@ -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,10 +2,6 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
//
|
|
6
|
-
// Copyright 2025 DXOS.org
|
|
7
|
-
//
|
|
8
|
-
|
|
9
5
|
import { DeferredTask, asyncTimeout } from '@dxos/async';
|
|
10
6
|
import { LifecycleState, Resource } from '@dxos/context';
|
|
11
7
|
import { type Queue } from '@dxos/echo-db';
|
|
@@ -31,9 +27,9 @@ export type QueueCursor = {
|
|
|
31
27
|
timestamp: string;
|
|
32
28
|
};
|
|
33
29
|
|
|
34
|
-
// TODO(mykola): .
|
|
35
30
|
export class MessageNormalizer extends Resource {
|
|
36
31
|
private readonly _functionExecutor: FunctionExecutor;
|
|
32
|
+
|
|
37
33
|
private _queue: Queue<Message.Message>;
|
|
38
34
|
private _cursor: QueueCursor;
|
|
39
35
|
private _messagesToProcess: MessageWithRangeId[] = [];
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
import * as Schema from 'effect/Schema';
|
|
7
|
+
|
|
8
|
+
import { Operation } from '@dxos/compute';
|
|
9
|
+
import { log } from '@dxos/log';
|
|
10
|
+
import { trim } from '@dxos/util';
|
|
11
|
+
|
|
12
|
+
import { TranscriptOperation } from '../types';
|
|
13
|
+
|
|
14
|
+
type MessageWithRangeIdType = TranscriptOperation.MessageWithRangeIdType;
|
|
15
|
+
type SentenceNormalizationInputType = TranscriptOperation.SentenceNormalizationInputType;
|
|
16
|
+
const { SentenceNormalization, SentenceNormalizationOutput } = TranscriptOperation;
|
|
17
|
+
|
|
18
|
+
export type MessageWithRangeId = MessageWithRangeIdType;
|
|
19
|
+
|
|
20
|
+
/** @deprecated Use SentenceNormalizationInputType */
|
|
21
|
+
export type NormalizationInput = SentenceNormalizationInputType;
|
|
22
|
+
|
|
23
|
+
/** @deprecated Use SentenceNormalizationOutput */
|
|
24
|
+
export type NormalizationOutput = Schema.Schema.Type<typeof SentenceNormalizationOutput>;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Sentence normalization for transcription.
|
|
28
|
+
* TODO(dmaretskyi): Reimplement using AiRequest.run or LanguageModel.generateObject - runStructured was removed.
|
|
29
|
+
*/
|
|
30
|
+
export const sentenceNormalization = SentenceNormalization.pipe(
|
|
31
|
+
Operation.withHandler(
|
|
32
|
+
Effect.fn(function* ({ messages }) {
|
|
33
|
+
log.info('input', { messages });
|
|
34
|
+
// TODO(dmaretskyi): runStructured was removed from AiRequest. Reimplement using new API.
|
|
35
|
+
return yield* Effect.die(
|
|
36
|
+
new Error(
|
|
37
|
+
'Sentence normalization needs to be reimplemented - runStructured was removed from AiRequest. Use AiRequest.run or LanguageModel.generateObject.',
|
|
38
|
+
),
|
|
39
|
+
);
|
|
40
|
+
}),
|
|
41
|
+
),
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
const _unused = trim`
|
|
45
|
+
You are observing a real-time transcript of a single person speaking.
|
|
46
|
+
The transcription is delivered in chunks of 10 seconds or less. As a result, individual sentences may be split across multiple messages, or multiple sentences may appear within a single message. Additionally, because this is real-time transcription, punctuation and capitalization may be incorrect or missing.
|
|
47
|
+
|
|
48
|
+
# Task Description:
|
|
49
|
+
- Your task is to detect and reconstruct broken or incomplete sentences by merging segments into coherent, grammatically correct sentences where appropriate.
|
|
50
|
+
|
|
51
|
+
# Input Format:
|
|
52
|
+
- The input is an array of messages that contain transcription blocks.
|
|
53
|
+
- Each message is a Message.Message, as described in the output format.
|
|
54
|
+
|
|
55
|
+
# Output Format:
|
|
56
|
+
- You have been provided with the tool that defines the output format; make sure to query it.
|
|
57
|
+
- Do not output anything other than the expected format.
|
|
58
|
+
|
|
59
|
+
# Segment Handling Rules:
|
|
60
|
+
- Sort messages by timestamp.
|
|
61
|
+
- Leave ID of the first message in a sentence.
|
|
62
|
+
- Each divided sentence should be added to the output as a separate message or block within existing messages, preserving the original order.
|
|
63
|
+
- If one message contains multiple sentences, you should not split them.
|
|
64
|
+
- The last sentence may be incomplete; it should still be output as a separate block or message.
|
|
65
|
+
- Keep track of the original timestamps of the messages and blocks and, use the timestamp of the first message/block of a sentence as the 'started' field of the merged message.
|
|
66
|
+
- The 'rangeId' field of the merged message should include 'messageId'-s and 'rangeId'-s of all messages that have been used to construct this message.
|
|
67
|
+
|
|
68
|
+
# Punctuation and Capitalization:
|
|
69
|
+
- Do not rely on the original punctuation and capitalization—they may be incorrect.
|
|
70
|
+
- Use logical reasoning to apply appropriate punctuation (e.g., period, comma, question mark, exclamation mark) and capitalization.
|
|
71
|
+
|
|
72
|
+
# Restrictions:
|
|
73
|
+
- Do not alter the order of the original messages; maintain the natural flow of speech.
|
|
74
|
+
- Do not interpret or infer meaning beyond reconstructing sentences.
|
|
75
|
+
- Do not add or remove any words or phrases.
|
|
76
|
+
`;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Operation } from '@dxos/compute';
|
|
8
|
+
import { Feed, Ref } from '@dxos/echo';
|
|
9
|
+
import { Transcript } from '@dxos/types';
|
|
10
|
+
|
|
11
|
+
import { TranscriptOperation } from '../types';
|
|
12
|
+
|
|
13
|
+
const handler: Operation.WithHandler<typeof TranscriptOperation.Create> = TranscriptOperation.Create.pipe(
|
|
14
|
+
Operation.withHandler(
|
|
15
|
+
Effect.fn(function* ({ space }) {
|
|
16
|
+
const feed = space.db.add(Feed.make());
|
|
17
|
+
return {
|
|
18
|
+
object: Transcript.make(Ref.make(feed)),
|
|
19
|
+
};
|
|
20
|
+
}),
|
|
21
|
+
),
|
|
22
|
+
);
|
|
23
|
+
|
|
24
|
+
export default handler;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { OperationHandlerSet } from '@dxos/compute';
|
|
6
|
+
|
|
7
|
+
export const TranscriptionOperationHandlerSet = OperationHandlerSet.lazy(
|
|
8
|
+
() => import('./create'),
|
|
9
|
+
() => import('./open'),
|
|
10
|
+
() => import('./summarize'),
|
|
11
|
+
);
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Effect from 'effect/Effect';
|
|
6
|
+
|
|
7
|
+
import { Operation } from '@dxos/compute';
|
|
8
|
+
import { Database, Feed, Filter } from '@dxos/echo';
|
|
9
|
+
import { Message } from '@dxos/types';
|
|
10
|
+
|
|
11
|
+
import { TranscriptOperation } from '../types';
|
|
12
|
+
import { renderByline } from '../util';
|
|
13
|
+
|
|
14
|
+
const handler: Operation.WithHandler<typeof TranscriptOperation.Open> = TranscriptOperation.Open.pipe(
|
|
15
|
+
Operation.withHandler(
|
|
16
|
+
Effect.fn(function* ({ transcript }) {
|
|
17
|
+
const transcriptObj = yield* Database.load(transcript);
|
|
18
|
+
const feed = yield* Database.load(transcriptObj.feed);
|
|
19
|
+
const messages = yield* Feed.runQuery(feed, Filter.type(Message.Message));
|
|
20
|
+
const content = messages
|
|
21
|
+
.flatMap((message: Message.Message, index: number) => renderByline([])(message, index))
|
|
22
|
+
.join('\n\n');
|
|
23
|
+
return { content };
|
|
24
|
+
}),
|
|
25
|
+
),
|
|
26
|
+
);
|
|
27
|
+
|
|
28
|
+
export default handler;
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import * as Array from 'effect/Array';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
7
|
+
import * as Function from 'effect/Function';
|
|
8
|
+
import * as Layer from 'effect/Layer';
|
|
9
|
+
import * as Option from 'effect/Option';
|
|
10
|
+
|
|
11
|
+
import { AiService, ConsolePrinter, ToolExecutionService, ToolResolverService } from '@dxos/ai';
|
|
12
|
+
import { AiRequest, GenerationObserver } from '@dxos/assistant';
|
|
13
|
+
import { Trace, Operation, OperationRegistry } from '@dxos/compute';
|
|
14
|
+
import { Database } from '@dxos/echo';
|
|
15
|
+
import { trim } from '@dxos/util';
|
|
16
|
+
|
|
17
|
+
import { TranscriptOperation } from '../types';
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Summarize a transcript of a meeting.
|
|
21
|
+
*/
|
|
22
|
+
const handler: Operation.WithHandler<typeof TranscriptOperation.Summarize> = TranscriptOperation.Summarize.pipe(
|
|
23
|
+
Operation.withHandler(
|
|
24
|
+
Effect.fnUntraced(
|
|
25
|
+
function* ({ transcript, notes }) {
|
|
26
|
+
const result = yield* new AiRequest({
|
|
27
|
+
observer: GenerationObserver.fromPrinter(new ConsolePrinter({ tag: 'summarize' })),
|
|
28
|
+
}).run({
|
|
29
|
+
prompt: `Transcript: ${transcript}\n\nNotes: ${notes}`,
|
|
30
|
+
history: [],
|
|
31
|
+
system: systemPrompt,
|
|
32
|
+
});
|
|
33
|
+
|
|
34
|
+
const summary = Function.pipe(
|
|
35
|
+
result,
|
|
36
|
+
Array.findLast((msg) => msg.sender.role === 'assistant' && msg.blocks.some((block) => block._tag === 'text')),
|
|
37
|
+
Option.flatMap((msg) =>
|
|
38
|
+
Function.pipe(
|
|
39
|
+
msg.blocks,
|
|
40
|
+
Array.findLast((block) => block._tag === 'text'),
|
|
41
|
+
Option.map((block) => block.text),
|
|
42
|
+
),
|
|
43
|
+
),
|
|
44
|
+
Option.getOrThrowWith(() => new Error('No summary found')),
|
|
45
|
+
);
|
|
46
|
+
|
|
47
|
+
return { summary };
|
|
48
|
+
},
|
|
49
|
+
Effect.provide(
|
|
50
|
+
Layer.mergeAll(
|
|
51
|
+
AiService.model('@anthropic/claude-sonnet-4-0'),
|
|
52
|
+
ToolResolverService.layerEmpty,
|
|
53
|
+
ToolExecutionService.layerEmpty,
|
|
54
|
+
Trace.writerLayerNoop,
|
|
55
|
+
Database.notAvailable,
|
|
56
|
+
Layer.succeed(Operation.Service, {
|
|
57
|
+
invoke: () => Effect.die('Not available.'),
|
|
58
|
+
schedule: () => Effect.die('Not available.'),
|
|
59
|
+
invokePromise: async () => ({ error: new Error('Not available.') }),
|
|
60
|
+
} as any),
|
|
61
|
+
Layer.succeed(OperationRegistry.Service, { resolve: () => Effect.succeed(undefined) } as any),
|
|
62
|
+
),
|
|
63
|
+
),
|
|
64
|
+
),
|
|
65
|
+
),
|
|
66
|
+
);
|
|
67
|
+
|
|
68
|
+
export default handler;
|
|
69
|
+
|
|
70
|
+
const systemPrompt = trim`
|
|
71
|
+
You are a helpful assistant that summarizes transcripts of meetings.
|
|
72
|
+
|
|
73
|
+
# Goal
|
|
74
|
+
Create a markdown summary of the meeting transcript with text notes provided.
|
|
75
|
+
Notes are very important so make sure to include them in the summary if they contain meaningful information.
|
|
76
|
+
|
|
77
|
+
# Formatting
|
|
78
|
+
- Format the summary as a markdown document without extra comments like "Here is the summary of the transcript:".
|
|
79
|
+
- Use markdown formatting for headings and bullet points.
|
|
80
|
+
- Format the summary as a list of key points and takeaways.
|
|
81
|
+
- All names of people should be in bold.
|
|
82
|
+
|
|
83
|
+
# Note Taking
|
|
84
|
+
- Correlate items in the summary with the person of origin to build a coherent narrative.
|
|
85
|
+
- Include short quotes verbatim where appropriate. Especially when concerned with design decisions and problem descriptions.
|
|
86
|
+
|
|
87
|
+
# Tasks
|
|
88
|
+
At the end of the summary include tasks.
|
|
89
|
+
Extract only the tasks that are:
|
|
90
|
+
- Directly actionable.
|
|
91
|
+
- Clearly assigned to a person or team (or can easily be inferred).
|
|
92
|
+
- Strongly implied by the conversation and/or user note (no speculative tasks).
|
|
93
|
+
- Specific enough that someone reading them would know exactly what to do next.
|
|
94
|
+
|
|
95
|
+
Format all tasks as markdown checkboxes using the syntax:
|
|
96
|
+
- [ ] Task description.
|
|
97
|
+
|
|
98
|
+
Additional information can be included (indented).
|
|
99
|
+
|
|
100
|
+
If no actionable tasks are found, omit this tasks section.
|
|
101
|
+
`;
|
package/src/plugin.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Plugin } from '@dxos/app-framework';
|
|
6
|
+
|
|
7
|
+
import { meta } from './meta';
|
|
8
|
+
|
|
9
|
+
export const TranscriptionPlugin = Plugin.lazy(meta, () => import('#plugin'));
|
|
10
|
+
|
|
11
|
+
export { TranscriptionOperationHandlerSet } from './operations';
|