@dxos/plugin-transcription 0.8.2-main.fbd8ed0 → 0.8.2-staging.4d6ad0f
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/TranscriptContainer-PFKLKRPQ.mjs +11 -0
- package/dist/lib/browser/{chunk-3TKXI6TQ.mjs → chunk-4KCUYW2F.mjs} +43 -26
- package/dist/lib/browser/chunk-4KCUYW2F.mjs.map +7 -0
- package/dist/lib/browser/{chunk-6ZR5MDK3.mjs → chunk-GOF7MJNV.mjs} +3 -3
- package/dist/lib/browser/{chunk-6ZR5MDK3.mjs.map → chunk-GOF7MJNV.mjs.map} +1 -1
- package/dist/lib/browser/chunk-IGEKO7ZU.mjs +8 -0
- package/dist/lib/browser/chunk-IGEKO7ZU.mjs.map +7 -0
- package/dist/lib/browser/{chunk-JHWEZRWC.mjs → chunk-NODIXNQP.mjs} +6 -15
- package/dist/lib/browser/chunk-NODIXNQP.mjs.map +7 -0
- package/dist/lib/browser/{chunk-K2LS2QOM.mjs → chunk-TJPJBE45.mjs} +136 -92
- package/dist/lib/browser/chunk-TJPJBE45.mjs.map +7 -0
- package/dist/lib/browser/{chunk-LTIQFX4W.mjs → chunk-W2KNYJD6.mjs} +4 -4
- package/dist/lib/browser/chunk-W2KNYJD6.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +8 -31
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-DZ62CJPC.mjs → intent-resolver-I2LJSQDR.mjs} +4 -8
- package/dist/lib/browser/intent-resolver-I2LJSQDR.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/react-surface-ID2MLJHZ.mjs +34 -0
- package/dist/lib/browser/react-surface-ID2MLJHZ.mjs.map +7 -0
- package/dist/lib/browser/transcriber-NA7CIFIT.mjs +56 -0
- package/dist/lib/browser/transcriber-NA7CIFIT.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +4 -8
- package/dist/lib/node/{TranscriptContainer-SSJVLRM6.cjs → TranscriptContainer-LHMC7553.cjs} +9 -9
- package/dist/lib/node/{TranscriptContainer-SSJVLRM6.cjs.map → TranscriptContainer-LHMC7553.cjs.map} +2 -2
- package/dist/lib/node/{chunk-EVE3H46F.cjs → chunk-3GS5UNO5.cjs} +141 -100
- package/dist/lib/node/chunk-3GS5UNO5.cjs.map +7 -0
- package/dist/lib/node/{chunk-L27AK6FQ.cjs → chunk-5J3FBCON.cjs} +8 -23
- package/dist/lib/node/chunk-5J3FBCON.cjs.map +7 -0
- package/dist/lib/node/{chunk-NVZWGFJL.cjs → chunk-AFUZI63A.cjs} +6 -6
- package/dist/lib/node/{chunk-NVZWGFJL.cjs.map → chunk-AFUZI63A.cjs.map} +1 -1
- package/dist/lib/node/{chunk-EJWB53WK.cjs → chunk-EIMUQYCZ.cjs} +10 -21
- package/dist/lib/node/chunk-EIMUQYCZ.cjs.map +7 -0
- package/dist/lib/node/{chunk-JUGOXWES.cjs → chunk-FKDJNJ57.cjs} +8 -8
- package/dist/lib/node/chunk-FKDJNJ57.cjs.map +7 -0
- package/dist/lib/node/{chunk-WKZLGVEJ.cjs → chunk-ZFTXJZXH.cjs} +44 -29
- package/dist/lib/node/chunk-ZFTXJZXH.cjs.map +7 -0
- package/dist/lib/node/index.cjs +36 -56
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/{intent-resolver-TRBKI24D.cjs → intent-resolver-LLMGF5I5.cjs} +9 -11
- package/dist/lib/node/intent-resolver-LLMGF5I5.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-surface-SZAMHCX7.cjs → react-surface-SEQLEL4K.cjs} +13 -21
- package/dist/lib/node/react-surface-SEQLEL4K.cjs.map +7 -0
- package/dist/lib/node/transcriber-RKKN7LDU.cjs +68 -0
- package/dist/lib/node/transcriber-RKKN7LDU.cjs.map +7 -0
- package/dist/lib/node/types/index.cjs +7 -11
- package/dist/lib/node/types/index.cjs.map +2 -2
- package/dist/lib/node-esm/{TranscriptContainer-M53LI2TX.mjs → TranscriptContainer-DLNRFVTA.mjs} +4 -4
- package/dist/lib/node-esm/{chunk-QYG2FOXA.mjs → chunk-BRPFVRAD.mjs} +6 -15
- package/dist/lib/node-esm/chunk-BRPFVRAD.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-V5IWBPYO.mjs → chunk-EFIWBQDF.mjs} +43 -26
- package/dist/lib/node-esm/chunk-EFIWBQDF.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-KUWWHMOA.mjs +10 -0
- package/dist/lib/node-esm/chunk-KUWWHMOA.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-5E2MR5XK.mjs → chunk-MFJPEIVB.mjs} +4 -4
- package/dist/lib/node-esm/chunk-MFJPEIVB.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-4KC3E5T4.mjs → chunk-PR7EYODX.mjs} +136 -92
- package/dist/lib/node-esm/chunk-PR7EYODX.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-X4DDJIVL.mjs → chunk-TXMDLLBR.mjs} +3 -3
- package/dist/lib/node-esm/{chunk-X4DDJIVL.mjs.map → chunk-TXMDLLBR.mjs.map} +1 -1
- package/dist/lib/node-esm/index.mjs +8 -31
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-HFVAL274.mjs → intent-resolver-WOZKOEBW.mjs} +4 -8
- package/dist/lib/node-esm/intent-resolver-WOZKOEBW.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-UEJELL7I.mjs → react-surface-7MXUUTAL.mjs} +9 -19
- package/dist/lib/node-esm/react-surface-7MXUUTAL.mjs.map +7 -0
- package/dist/lib/node-esm/transcriber-5WSI6DYK.mjs +57 -0
- package/dist/lib/node-esm/transcriber-5WSI6DYK.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +4 -8
- package/dist/types/src/TranscriptionPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts +8 -8
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +1 -4
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/transcriber.d.ts +2 -1
- package/dist/types/src/capabilities/transcriber.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +0 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/components/stories/FileTranscription.stories.d.ts +17 -0
- package/dist/types/src/components/stories/FileTranscription.stories.d.ts.map +1 -0
- package/dist/types/src/components/stories/KeyWordRecognition.stories.d.ts +10 -0
- package/dist/types/src/components/stories/KeyWordRecognition.stories.d.ts.map +1 -0
- package/dist/types/src/components/stories/MicrophoneTranscription.stories.d.ts +19 -0
- package/dist/types/src/components/stories/MicrophoneTranscription.stories.d.ts.map +1 -0
- package/dist/types/src/components/stories/TranscriptionStory.d.ts +11 -0
- package/dist/types/src/components/stories/TranscriptionStory.d.ts.map +1 -0
- package/dist/types/src/components/stories/useIsSpeaking.d.ts +3 -0
- package/dist/types/src/components/stories/useIsSpeaking.d.ts.map +1 -0
- package/dist/types/src/hooks/useAudioFile.d.ts +1 -1
- package/dist/types/src/hooks/useAudioFile.d.ts.map +1 -1
- package/dist/types/src/hooks/useAudioTrack.d.ts +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 +1 -1
- package/dist/types/src/hooks/useTranscriber.d.ts.map +1 -1
- package/dist/types/src/model/model.d.ts.map +1 -1
- package/dist/types/src/segments-normalization/index.d.ts +4 -0
- package/dist/types/src/segments-normalization/index.d.ts.map +1 -0
- package/dist/types/src/segments-normalization/message-normalizer.d.ts +26 -0
- package/dist/types/src/segments-normalization/message-normalizer.d.ts.map +1 -0
- package/dist/types/src/segments-normalization/normalization.d.ts +520 -0
- package/dist/types/src/segments-normalization/normalization.d.ts.map +1 -0
- package/dist/types/src/segments-normalization/normalization.test.d.ts +2 -0
- package/dist/types/src/segments-normalization/normalization.test.d.ts.map +1 -0
- package/dist/types/src/segments-normalization/utils.d.ts +3 -0
- package/dist/types/src/segments-normalization/utils.d.ts.map +1 -0
- package/dist/types/src/testing/testing.d.ts.map +1 -1
- package/dist/types/src/transcriber/media-stream-recorder.d.ts +8 -5
- package/dist/types/src/transcriber/media-stream-recorder.d.ts.map +1 -1
- package/dist/types/src/transcriber/transcriber.d.ts +4 -0
- package/dist/types/src/transcriber/transcriber.d.ts.map +1 -1
- package/dist/types/src/transcriber/transcription-manager.d.ts +2 -0
- package/dist/types/src/transcriber/transcription-manager.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +0 -2
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +0 -3
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +1 -5
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/package.json +54 -50
- package/src/TranscriptionPlugin.tsx +2 -24
- package/src/capabilities/capabilities.ts +15 -9
- package/src/capabilities/index.ts +0 -3
- package/src/capabilities/intent-resolver.ts +0 -2
- package/src/capabilities/react-surface.tsx +4 -11
- package/src/capabilities/transcriber.ts +34 -7
- package/src/components/Transcript/deprecated/OldTranscript.tsx +1 -1
- package/src/components/Transcript/transcript-extension.ts +2 -2
- package/src/components/index.ts +0 -1
- package/src/components/stories/FileTranscription.stories.tsx +240 -0
- package/src/components/stories/KeyWordRecognition.stories.tsx +128 -0
- package/src/components/stories/MicrophoneTranscription.stories.tsx +274 -0
- package/src/components/stories/TranscriptionStory.tsx +41 -0
- package/src/components/stories/useIsSpeaking.tsx +40 -0
- package/src/hooks/useAudioFile.ts +39 -9
- package/src/hooks/useAudioTrack.ts +2 -2
- package/src/hooks/useQueueModelAdapter.ts +7 -5
- package/src/hooks/useTranscriber.ts +4 -3
- package/src/meta.ts +2 -2
- package/src/model/model.ts +1 -1
- package/src/segments-normalization/index.ts +7 -0
- package/src/segments-normalization/message-normalizer.ts +108 -0
- package/src/segments-normalization/normalization.test.ts +142 -0
- package/src/segments-normalization/normalization.ts +103 -0
- package/src/segments-normalization/utils.ts +9 -0
- package/src/testing/testing.ts +17 -17
- package/src/transcriber/media-stream-recorder.ts +14 -7
- package/src/transcriber/transcriber.browser.test.ts +4 -4
- package/src/transcriber/transcriber.ts +13 -9
- package/src/transcriber/transcription-manager.ts +21 -14
- package/src/translations.ts +0 -3
- package/src/types/schema.ts +1 -2
- package/src/types/types.ts +1 -15
- package/dist/lib/browser/TranscriptContainer-CXA4ZBHW.mjs +0 -11
- package/dist/lib/browser/app-graph-builder-REQZ5SC5.mjs +0 -351
- package/dist/lib/browser/app-graph-builder-REQZ5SC5.mjs.map +0 -7
- package/dist/lib/browser/chunk-3TKXI6TQ.mjs.map +0 -7
- package/dist/lib/browser/chunk-JHWEZRWC.mjs.map +0 -7
- package/dist/lib/browser/chunk-K2LS2QOM.mjs.map +0 -7
- package/dist/lib/browser/chunk-KLD7O5GJ.mjs +0 -25
- package/dist/lib/browser/chunk-KLD7O5GJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-LCTMCTYY.mjs +0 -27
- package/dist/lib/browser/chunk-LCTMCTYY.mjs.map +0 -7
- package/dist/lib/browser/chunk-LTIQFX4W.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-DZ62CJPC.mjs.map +0 -7
- package/dist/lib/browser/meeting-transcription-state-MNA2XROE.mjs +0 -18
- package/dist/lib/browser/meeting-transcription-state-MNA2XROE.mjs.map +0 -7
- package/dist/lib/browser/react-surface-PUXZNAZL.mjs +0 -44
- package/dist/lib/browser/react-surface-PUXZNAZL.mjs.map +0 -7
- package/dist/lib/browser/settings-JWDS4J3F.mjs +0 -24
- package/dist/lib/browser/settings-JWDS4J3F.mjs.map +0 -7
- package/dist/lib/browser/transcriber-YWWIV6KP.mjs +0 -37
- package/dist/lib/browser/transcriber-YWWIV6KP.mjs.map +0 -7
- package/dist/lib/node/app-graph-builder-OAPU4GDH.cjs +0 -352
- package/dist/lib/node/app-graph-builder-OAPU4GDH.cjs.map +0 -7
- package/dist/lib/node/chunk-EJWB53WK.cjs.map +0 -7
- package/dist/lib/node/chunk-EVE3H46F.cjs.map +0 -7
- package/dist/lib/node/chunk-J72PUQ3C.cjs +0 -46
- package/dist/lib/node/chunk-J72PUQ3C.cjs.map +0 -7
- package/dist/lib/node/chunk-JUGOXWES.cjs.map +0 -7
- package/dist/lib/node/chunk-L27AK6FQ.cjs.map +0 -7
- package/dist/lib/node/chunk-WKZLGVEJ.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-TRBKI24D.cjs.map +0 -7
- package/dist/lib/node/meeting-transcription-state-5XLTMWPA.cjs +0 -34
- package/dist/lib/node/meeting-transcription-state-5XLTMWPA.cjs.map +0 -7
- package/dist/lib/node/react-surface-SZAMHCX7.cjs.map +0 -7
- package/dist/lib/node/settings-AWWMOSCV.cjs +0 -38
- package/dist/lib/node/settings-AWWMOSCV.cjs.map +0 -7
- package/dist/lib/node/transcriber-AFUXFHCR.cjs +0 -50
- package/dist/lib/node/transcriber-AFUXFHCR.cjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-UBP6EOBR.mjs +0 -352
- package/dist/lib/node-esm/app-graph-builder-UBP6EOBR.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-4KC3E5T4.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-5E2MR5XK.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-MHQP2PAF.mjs +0 -28
- package/dist/lib/node-esm/chunk-MHQP2PAF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-QMHMEKB3.mjs +0 -27
- package/dist/lib/node-esm/chunk-QMHMEKB3.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-QYG2FOXA.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-V5IWBPYO.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-HFVAL274.mjs.map +0 -7
- package/dist/lib/node-esm/meeting-transcription-state-3WOZ52BQ.mjs +0 -19
- package/dist/lib/node-esm/meeting-transcription-state-3WOZ52BQ.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-UEJELL7I.mjs.map +0 -7
- package/dist/lib/node-esm/settings-QFNFGFJ5.mjs +0 -25
- package/dist/lib/node-esm/settings-QFNFGFJ5.mjs.map +0 -7
- package/dist/lib/node-esm/transcriber-7RJEFPDI.mjs +0 -38
- package/dist/lib/node-esm/transcriber-7RJEFPDI.mjs.map +0 -7
- package/dist/types/src/capabilities/app-graph-builder.d.ts +0 -4
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +0 -1
- package/dist/types/src/capabilities/meeting-transcription-state.d.ts +0 -4
- package/dist/types/src/capabilities/meeting-transcription-state.d.ts.map +0 -1
- package/dist/types/src/capabilities/settings.d.ts +0 -4
- package/dist/types/src/capabilities/settings.d.ts.map +0 -1
- package/dist/types/src/components/TranscriptionSettings/TranscriptionSettings.d.ts +0 -6
- package/dist/types/src/components/TranscriptionSettings/TranscriptionSettings.d.ts.map +0 -1
- package/dist/types/src/components/TranscriptionSettings/index.d.ts +0 -2
- package/dist/types/src/components/TranscriptionSettings/index.d.ts.map +0 -1
- package/dist/types/src/components/transcription.stories.d.ts +0 -18
- package/dist/types/src/components/transcription.stories.d.ts.map +0 -1
- package/dist/types/src/entity-extraction/entity-extraction.d.ts +0 -42
- package/dist/types/src/entity-extraction/entity-extraction.d.ts.map +0 -1
- package/dist/types/src/entity-extraction/entity-extraction.test.d.ts +0 -2
- package/dist/types/src/entity-extraction/entity-extraction.test.d.ts.map +0 -1
- package/dist/types/src/entity-extraction/index.d.ts +0 -2
- package/dist/types/src/entity-extraction/index.d.ts.map +0 -1
- package/src/capabilities/app-graph-builder.ts +0 -233
- package/src/capabilities/meeting-transcription-state.ts +0 -16
- package/src/capabilities/settings.ts +0 -20
- package/src/components/TranscriptionSettings/TranscriptionSettings.tsx +0 -26
- package/src/components/TranscriptionSettings/index.ts +0 -5
- package/src/components/transcription.stories.tsx +0 -295
- package/src/entity-extraction/entity-extraction.test.ts +0 -97
- package/src/entity-extraction/entity-extraction.ts +0 -149
- package/src/entity-extraction/index.ts +0 -5
- package/src/entity-extraction/system-prompt.tpl +0 -38
- package/src/entity-extraction/types.d.ts +0 -8
- /package/dist/lib/browser/{TranscriptContainer-CXA4ZBHW.mjs.map → TranscriptContainer-PFKLKRPQ.mjs.map} +0 -0
- /package/dist/lib/node-esm/{TranscriptContainer-M53LI2TX.mjs.map → TranscriptContainer-DLNRFVTA.mjs.map} +0 -0
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import '@dxos-theme';
|
|
2
|
-
import { type Meta, type StoryObj } from '@storybook/react';
|
|
3
|
-
import React from 'react';
|
|
4
|
-
import { type DXN } from '@dxos/keys';
|
|
5
|
-
declare const Microphone: ({ entityExtraction }: {
|
|
6
|
-
entityExtraction?: boolean;
|
|
7
|
-
}) => React.JSX.Element;
|
|
8
|
-
declare const AudioFile: ({ queueDxn, audioUrl }: {
|
|
9
|
-
queueDxn: DXN;
|
|
10
|
-
audioUrl: string;
|
|
11
|
-
transcriptUrl: string;
|
|
12
|
-
}) => React.JSX.Element;
|
|
13
|
-
declare const meta: Meta<typeof AudioFile>;
|
|
14
|
-
export default meta;
|
|
15
|
-
export declare const Default: StoryObj<typeof Microphone>;
|
|
16
|
-
export declare const EntityExtraction: StoryObj<typeof Microphone>;
|
|
17
|
-
export declare const File: StoryObj<typeof AudioFile>;
|
|
18
|
-
//# sourceMappingURL=transcription.stories.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transcription.stories.d.ts","sourceRoot":"","sources":["../../../../src/components/transcription.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAErB,OAAO,EAAE,KAAK,IAAI,EAAE,KAAK,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAC5D,OAAO,KASN,MAAM,OAAO,CAAC;AAQf,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,YAAY,CAAC;AAmDtC,QAAA,MAAM,UAAU,GAAI,sBAAsB;IAAE,gBAAgB,CAAC,EAAE,OAAO,CAAA;CAAE,sBAiFvE,CAAC;AAEF,QAAA,MAAM,SAAS,GAAI,wBAAwB;IAAE,QAAQ,EAAE,GAAG,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAC;IAAC,aAAa,EAAE,MAAM,CAAA;CAAE,sBAgEpG,CAAC;AAEF,QAAA,MAAM,IAAI,EAAE,IAAI,CAAC,OAAO,SAAS,CA4ChC,CAAC;AAEF,eAAe,IAAI,CAAC;AAEpB,eAAO,MAAM,OAAO,EAAE,QAAQ,CAAC,OAAO,UAAU,CAK/C,CAAC;AAEF,eAAO,MAAM,gBAAgB,EAAE,QAAQ,CAAC,OAAO,UAAU,CAKxD,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,QAAQ,CAAC,OAAO,SAAS,CAQ3C,CAAC"}
|
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { Schema } from 'effect';
|
|
2
|
-
import type { AIServiceClient } from '@dxos/assistant';
|
|
3
|
-
import { type BaseEchoObject } from '@dxos/echo-schema';
|
|
4
|
-
import { DataType } from '@dxos/schema';
|
|
5
|
-
type ProcessTranscriptMessageParams = {
|
|
6
|
-
message: DataType.Message;
|
|
7
|
-
aiService: AIServiceClient;
|
|
8
|
-
context: {
|
|
9
|
-
objects?: BaseEchoObject[];
|
|
10
|
-
};
|
|
11
|
-
options?: {
|
|
12
|
-
/**
|
|
13
|
-
* Timeout for the entity extraction.
|
|
14
|
-
*/
|
|
15
|
-
timeout?: number;
|
|
16
|
-
/**
|
|
17
|
-
* Fallback to raw text if the entity extraction fails.
|
|
18
|
-
* Otherwise the function will throw an error.
|
|
19
|
-
* @default false
|
|
20
|
-
*/
|
|
21
|
-
fallbackToRaw?: boolean;
|
|
22
|
-
};
|
|
23
|
-
};
|
|
24
|
-
type ProcessTranscriptMessageResult = {
|
|
25
|
-
message: DataType.Message;
|
|
26
|
-
timeElapsed: number;
|
|
27
|
-
};
|
|
28
|
-
declare const ReferencedQuotes: Schema.Struct<{
|
|
29
|
-
references: Schema.Array$<Schema.Struct<{
|
|
30
|
-
quote: typeof Schema.String;
|
|
31
|
-
id: typeof Schema.String;
|
|
32
|
-
}>>;
|
|
33
|
-
}>;
|
|
34
|
-
interface ReferencedQuotes extends Schema.Schema.Type<typeof ReferencedQuotes> {
|
|
35
|
-
}
|
|
36
|
-
export declare const processTranscriptMessage: (params: ProcessTranscriptMessageParams) => Promise<ProcessTranscriptMessageResult>;
|
|
37
|
-
/**
|
|
38
|
-
* Finds and replaces all quotes with DXNs references.
|
|
39
|
-
*/
|
|
40
|
-
export declare const postprocessText: (text: string, quotes: ReferencedQuotes) => string;
|
|
41
|
-
export {};
|
|
42
|
-
//# sourceMappingURL=entity-extraction.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entity-extraction.d.ts","sourceRoot":"","sources":["../../../../src/entity-extraction/entity-extraction.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAGhC,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAGvD,OAAO,EAAE,KAAK,cAAc,EAAoB,MAAM,mBAAmB,CAAC;AAG1E,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAIxC,KAAK,8BAA8B,GAAG;IACpC,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC;IAC1B,SAAS,EAAE,eAAe,CAAC;IAC3B,OAAO,EAAE;QACP,OAAO,CAAC,EAAE,cAAc,EAAE,CAAC;KAC5B,CAAC;IAEF,OAAO,CAAC,EAAE;QACR;;WAEG;QACH,OAAO,CAAC,EAAE,MAAM,CAAC;QAEjB;;;;WAIG;QACH,aAAa,CAAC,EAAE,OAAO,CAAC;KACzB,CAAC;CACH,CAAC;AAEF,KAAK,8BAA8B,GAAG;IACpC,OAAO,EAAE,QAAQ,CAAC,OAAO,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;CACrB,CAAC;AAUF,QAAA,MAAM,gBAAgB;;;;;EAUpB,CAAC;AACH,UAAU,gBAAiB,SAAQ,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,gBAAgB,CAAC;CAAG;AAGjF,eAAO,MAAM,wBAAwB,GACnC,QAAQ,8BAA8B,KACrC,OAAO,CAAC,8BAA8B,CA+DxC,CAAC;AAEF;;GAEG;AAEH,eAAO,MAAM,eAAe,GAAI,MAAM,MAAM,EAAE,QAAQ,gBAAgB,WAWrE,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"entity-extraction.test.d.ts","sourceRoot":"","sources":["../../../../src/entity-extraction/entity-extraction.test.ts"],"names":[],"mappings":""}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/entity-extraction/index.ts"],"names":[],"mappings":"AAIA,cAAc,qBAAqB,CAAC"}
|
|
@@ -1,233 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Rx } from '@effect-rx/rx-react';
|
|
6
|
-
import { Option, pipe, type Schema } from 'effect';
|
|
7
|
-
|
|
8
|
-
import { Capabilities, contributes, createIntent, type PluginContext } from '@dxos/app-framework';
|
|
9
|
-
import { AIServiceEdgeClient, type AIServiceClient } from '@dxos/assistant';
|
|
10
|
-
import { AI_SERVICE_ENDPOINT } from '@dxos/assistant/testing';
|
|
11
|
-
import { Filter, fullyQualifiedId, getSpace, makeRef, Query, type Space } from '@dxos/client/echo';
|
|
12
|
-
import { getSchemaTypename, isInstanceOf, type BaseEchoObject } from '@dxos/echo-schema';
|
|
13
|
-
import { invariant } from '@dxos/invariant';
|
|
14
|
-
import { DXN } from '@dxos/keys';
|
|
15
|
-
import { log } from '@dxos/log';
|
|
16
|
-
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
17
|
-
import { PLANK_COMPANION_TYPE, ATTENDABLE_PATH_SEPARATOR } from '@dxos/plugin-deck/types';
|
|
18
|
-
import { createExtension, rxFromSignal } from '@dxos/plugin-graph';
|
|
19
|
-
import { DocumentType } from '@dxos/plugin-markdown/types';
|
|
20
|
-
import { MeetingCapabilities, type CallState, type MediaState } from '@dxos/plugin-meeting';
|
|
21
|
-
import { MeetingType, type MeetingCallProperties } from '@dxos/plugin-meeting/types';
|
|
22
|
-
import { type buf } from '@dxos/protocols/buf';
|
|
23
|
-
import { type TranscriptionPayloadSchema } from '@dxos/protocols/buf/dxos/edge/calls_pb';
|
|
24
|
-
import { DataType } from '@dxos/schema';
|
|
25
|
-
|
|
26
|
-
import { TranscriptionCapabilities } from './capabilities';
|
|
27
|
-
import { processTranscriptMessage } from '../entity-extraction';
|
|
28
|
-
import { TRANSCRIPTION_PLUGIN } from '../meta';
|
|
29
|
-
import { TranscriptionManager } from '../transcriber';
|
|
30
|
-
import { TranscriptionAction, type TranscriptionSettingsProps, TranscriptType } from '../types';
|
|
31
|
-
|
|
32
|
-
// TODO(wittjosiah): Factor out.
|
|
33
|
-
// TODO(wittjosiah): Can we stop using protobuf for this?
|
|
34
|
-
type TranscriptionPayload = buf.MessageInitShape<typeof TranscriptionPayloadSchema>;
|
|
35
|
-
|
|
36
|
-
const getMeetingTranscript = async (
|
|
37
|
-
context: PluginContext,
|
|
38
|
-
meeting: MeetingType,
|
|
39
|
-
): Promise<TranscriptType | undefined> => {
|
|
40
|
-
const { dispatchPromise: dispatch } = context.getCapability(Capabilities.IntentDispatcher);
|
|
41
|
-
|
|
42
|
-
const typename = getSchemaTypename(TranscriptType)!;
|
|
43
|
-
const existing = await meeting.artifacts[typename]?.load();
|
|
44
|
-
if (existing instanceof TranscriptType) {
|
|
45
|
-
return existing;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
const space = getSpace(meeting);
|
|
49
|
-
invariant(space);
|
|
50
|
-
const { data } = await dispatch(createIntent(TranscriptionAction.Create, { spaceId: space.id }));
|
|
51
|
-
meeting.artifacts[typename] = makeRef(data!.object);
|
|
52
|
-
return data?.object;
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
// TODO(wittjosiah): Introduce a sound that plays when transcription is activated/deactivated.
|
|
56
|
-
export default (context: PluginContext) =>
|
|
57
|
-
contributes(Capabilities.AppGraphBuilder, [
|
|
58
|
-
createExtension({
|
|
59
|
-
id: `${TRANSCRIPTION_PLUGIN}/meeting-transcript`,
|
|
60
|
-
actions: (node) =>
|
|
61
|
-
Rx.make((get) =>
|
|
62
|
-
pipe(
|
|
63
|
-
get(node),
|
|
64
|
-
Option.flatMap((node) => (isInstanceOf(MeetingType, node.data) ? Option.some(node.data) : Option.none())),
|
|
65
|
-
Option.map((meeting) => {
|
|
66
|
-
const state = context.getCapability(TranscriptionCapabilities.MeetingTranscriptionState);
|
|
67
|
-
const enabled = get(rxFromSignal(() => state.enabled));
|
|
68
|
-
return [
|
|
69
|
-
{
|
|
70
|
-
id: `${fullyQualifiedId(meeting)}/action/start-stop-transcription`,
|
|
71
|
-
data: async () => {
|
|
72
|
-
// NOTE: We are not saving the state of the transcription manager here.
|
|
73
|
-
// We expect the state to be updated through `onCallStateUpdated` once it is propagated through Swarm.
|
|
74
|
-
// This is done to avoid race conditions and to not handle optimistic updates.
|
|
75
|
-
const transcript = await getMeetingTranscript(context, meeting);
|
|
76
|
-
invariant(transcript, 'Failed to create transcript');
|
|
77
|
-
|
|
78
|
-
const callManager = context.getCapability(MeetingCapabilities.CallManager);
|
|
79
|
-
callManager.setActivity(getSchemaTypename(TranscriptType)!, {
|
|
80
|
-
queueDxn: transcript.queue.dxn.toString(),
|
|
81
|
-
enabled: !enabled,
|
|
82
|
-
});
|
|
83
|
-
},
|
|
84
|
-
properties: {
|
|
85
|
-
label: enabled
|
|
86
|
-
? ['stop transcription label', { ns: TRANSCRIPTION_PLUGIN }]
|
|
87
|
-
: ['start transcription label', { ns: TRANSCRIPTION_PLUGIN }],
|
|
88
|
-
icon: 'ph--subtitles--regular',
|
|
89
|
-
disposition: 'toolbar',
|
|
90
|
-
classNames: enabled ? 'bg-callAlert' : '',
|
|
91
|
-
},
|
|
92
|
-
},
|
|
93
|
-
];
|
|
94
|
-
}),
|
|
95
|
-
Option.getOrElse(() => []),
|
|
96
|
-
),
|
|
97
|
-
),
|
|
98
|
-
connector: (node) =>
|
|
99
|
-
Rx.make((get) =>
|
|
100
|
-
pipe(
|
|
101
|
-
get(node),
|
|
102
|
-
Option.flatMap((node) => (isInstanceOf(MeetingType, node.data) ? Option.some(node.data) : Option.none())),
|
|
103
|
-
Option.map((meeting) => {
|
|
104
|
-
const client = context.getCapability(ClientCapabilities.Client);
|
|
105
|
-
const state = context.getCapability(TranscriptionCapabilities.MeetingTranscriptionState);
|
|
106
|
-
const settingsStore = get(context.capabilities(Capabilities.SettingsStore))[0];
|
|
107
|
-
const settings = get(
|
|
108
|
-
rxFromSignal(() => settingsStore?.getStore<TranscriptionSettingsProps>(TRANSCRIPTION_PLUGIN)!.value),
|
|
109
|
-
);
|
|
110
|
-
|
|
111
|
-
// TODO(dmaretskyi): Request via capability.
|
|
112
|
-
const aiClient: AIServiceClient | undefined = new AIServiceEdgeClient({
|
|
113
|
-
// TODO(burdon): Get from config.
|
|
114
|
-
endpoint: AI_SERVICE_ENDPOINT.REMOTE,
|
|
115
|
-
});
|
|
116
|
-
|
|
117
|
-
return [
|
|
118
|
-
{
|
|
119
|
-
id: `${fullyQualifiedId(meeting)}${ATTENDABLE_PATH_SEPARATOR}${getSchemaTypename(TranscriptType)}`,
|
|
120
|
-
type: PLANK_COMPANION_TYPE,
|
|
121
|
-
data: get(rxFromSignal(() => meeting.artifacts[getSchemaTypename(TranscriptType)!]?.target)),
|
|
122
|
-
properties: {
|
|
123
|
-
label: ['transcript companion label', { ns: TRANSCRIPTION_PLUGIN }],
|
|
124
|
-
icon: 'ph--subtitles--regular',
|
|
125
|
-
position: 'hoist',
|
|
126
|
-
disposition: 'hidden',
|
|
127
|
-
schema: TranscriptType,
|
|
128
|
-
getIntent: ({ space }: { space: Space }) =>
|
|
129
|
-
createIntent(TranscriptionAction.Create, { spaceId: space.id }),
|
|
130
|
-
|
|
131
|
-
// TODO(burdon): Is this the right place to inisitalize the state? Change to a capability?
|
|
132
|
-
onJoin: async ({ meeting }: { meeting?: MeetingType }) => {
|
|
133
|
-
const identity = client.halo.identity.get();
|
|
134
|
-
invariant(identity);
|
|
135
|
-
const space = getSpace(meeting);
|
|
136
|
-
invariant(space);
|
|
137
|
-
|
|
138
|
-
let messageEnricher;
|
|
139
|
-
if (aiClient && settings.entityExtraction) {
|
|
140
|
-
messageEnricher = createEntityExtractionEnricher({
|
|
141
|
-
aiClient,
|
|
142
|
-
// TODO(dmaretskyi): Have those be discovered from the schema graph or contributed by capabilities?
|
|
143
|
-
// This forced me to add a dependency on markdown plugin.
|
|
144
|
-
// This will be replaced with a vector search index anyway, so its not a big deal.
|
|
145
|
-
contextTypes: [DocumentType, DataType.Person, DataType.Organization],
|
|
146
|
-
space,
|
|
147
|
-
});
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
// TODO(burdon): The TranscriptionManager singleton is part of the state and should just be updated here.
|
|
151
|
-
state.transcriptionManager = await new TranscriptionManager({
|
|
152
|
-
edgeClient: client.edge,
|
|
153
|
-
messageEnricher,
|
|
154
|
-
})
|
|
155
|
-
.setIdentityDid(identity.did)
|
|
156
|
-
.open();
|
|
157
|
-
},
|
|
158
|
-
onLeave: async () => {
|
|
159
|
-
await state.transcriptionManager?.close();
|
|
160
|
-
state.transcriptionManager = undefined;
|
|
161
|
-
state.enabled = false;
|
|
162
|
-
},
|
|
163
|
-
onCallStateUpdated: async (callState: CallState) => {
|
|
164
|
-
const typename = getSchemaTypename(TranscriptType);
|
|
165
|
-
const transcription = typename ? callState.activities?.[typename] : undefined;
|
|
166
|
-
if (!transcription?.payload) {
|
|
167
|
-
return;
|
|
168
|
-
}
|
|
169
|
-
|
|
170
|
-
const payload: TranscriptionPayload = transcription.payload;
|
|
171
|
-
state.enabled = !!payload.enabled;
|
|
172
|
-
if (payload.queueDxn) {
|
|
173
|
-
// NOTE: Must set queue before enabling transcription.
|
|
174
|
-
state.transcriptionManager?.setQueue(DXN.parse(payload.queueDxn));
|
|
175
|
-
}
|
|
176
|
-
await state.transcriptionManager?.setEnabled(payload.enabled);
|
|
177
|
-
},
|
|
178
|
-
onMediaStateUpdated: async ([mediaState, isSpeaking]: [MediaState, boolean]) => {
|
|
179
|
-
void state.transcriptionManager?.setAudioTrack(mediaState.audioTrack);
|
|
180
|
-
void state.transcriptionManager?.setRecording(isSpeaking);
|
|
181
|
-
},
|
|
182
|
-
} satisfies MeetingCallProperties,
|
|
183
|
-
},
|
|
184
|
-
];
|
|
185
|
-
}),
|
|
186
|
-
Option.getOrElse(() => []),
|
|
187
|
-
),
|
|
188
|
-
),
|
|
189
|
-
}),
|
|
190
|
-
]);
|
|
191
|
-
|
|
192
|
-
type EntityExtractionEnricherFactoryOptions = {
|
|
193
|
-
aiClient: AIServiceClient;
|
|
194
|
-
contextTypes: Schema.Schema.AnyNoContext[];
|
|
195
|
-
space: Space;
|
|
196
|
-
};
|
|
197
|
-
|
|
198
|
-
const createEntityExtractionEnricher = ({ aiClient, contextTypes, space }: EntityExtractionEnricherFactoryOptions) => {
|
|
199
|
-
return async (message: DataType.Message) => {
|
|
200
|
-
const { objects } = await space.db
|
|
201
|
-
.query(Query.select(Filter.or(...contextTypes.map((s) => Filter.type(s as Schema.Schema<BaseEchoObject>)))))
|
|
202
|
-
.run();
|
|
203
|
-
log.info('context', { objects });
|
|
204
|
-
|
|
205
|
-
const { message: enhancedMessage, timeElapsed } = await processTranscriptMessage({
|
|
206
|
-
aiService: aiClient,
|
|
207
|
-
message,
|
|
208
|
-
context: {
|
|
209
|
-
objects: await Promise.all(objects.map((o) => processContextObject(o))),
|
|
210
|
-
},
|
|
211
|
-
options: { timeout: ENTITY_EXTRACTOR_TIMEOUT, fallbackToRaw: true },
|
|
212
|
-
});
|
|
213
|
-
|
|
214
|
-
log.info('entity extraction time', { timeElapsed });
|
|
215
|
-
return enhancedMessage;
|
|
216
|
-
};
|
|
217
|
-
};
|
|
218
|
-
|
|
219
|
-
// TODO(dmaretskyi): Use Type.Any
|
|
220
|
-
const processContextObject = async (object: BaseEchoObject): Promise<any> => {
|
|
221
|
-
// TODO(dmaretskyi): Documents need special processing is the content is behind a ref.
|
|
222
|
-
// TODO(dmaretskyi): Think about a way to handle this serialization with a decorator.
|
|
223
|
-
// if (isInstanceOf(DocumentType, object)) {
|
|
224
|
-
// return {
|
|
225
|
-
// ...object,
|
|
226
|
-
// content: await object.content.load(),
|
|
227
|
-
// };
|
|
228
|
-
// }
|
|
229
|
-
|
|
230
|
-
return object;
|
|
231
|
-
};
|
|
232
|
-
|
|
233
|
-
const ENTITY_EXTRACTOR_TIMEOUT = 25_000;
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { contributes } from '@dxos/app-framework';
|
|
6
|
-
import { live } from '@dxos/live-object';
|
|
7
|
-
|
|
8
|
-
import { TranscriptionCapabilities } from './capabilities';
|
|
9
|
-
|
|
10
|
-
export default () => {
|
|
11
|
-
const state = live<TranscriptionCapabilities.MeetingTranscriptionState>({
|
|
12
|
-
enabled: false,
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
return contributes(TranscriptionCapabilities.MeetingTranscriptionState, state);
|
|
16
|
-
};
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Capabilities, contributes } from '@dxos/app-framework';
|
|
6
|
-
import { live } from '@dxos/live-object';
|
|
7
|
-
|
|
8
|
-
import { TRANSCRIPTION_PLUGIN } from '../meta';
|
|
9
|
-
import { TranscriptionSettingsSchema } from '../types';
|
|
10
|
-
|
|
11
|
-
export default () => {
|
|
12
|
-
// TODO(wittjosiah): `live` currently doesn't handle schema default values.
|
|
13
|
-
const settings = live(TranscriptionSettingsSchema, { entityExtraction: true });
|
|
14
|
-
|
|
15
|
-
return contributes(Capabilities.Settings, {
|
|
16
|
-
schema: TranscriptionSettingsSchema,
|
|
17
|
-
prefix: TRANSCRIPTION_PLUGIN,
|
|
18
|
-
value: settings,
|
|
19
|
-
});
|
|
20
|
-
};
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
import { Input, useTranslation } from '@dxos/react-ui';
|
|
8
|
-
import { DeprecatedFormContainer, DeprecatedFormInput } from '@dxos/react-ui-form';
|
|
9
|
-
|
|
10
|
-
import { TRANSCRIPTION_PLUGIN } from '../../meta';
|
|
11
|
-
import { type TranscriptionSettingsProps } from '../../types';
|
|
12
|
-
|
|
13
|
-
export const TranscriptionSettings = ({ settings }: { settings: TranscriptionSettingsProps }) => {
|
|
14
|
-
const { t } = useTranslation(TRANSCRIPTION_PLUGIN);
|
|
15
|
-
|
|
16
|
-
return (
|
|
17
|
-
<DeprecatedFormContainer>
|
|
18
|
-
<DeprecatedFormInput label={t('settings entity extraction label')}>
|
|
19
|
-
<Input.Switch
|
|
20
|
-
checked={!!settings.entityExtraction}
|
|
21
|
-
onCheckedChange={(checked) => (settings.entityExtraction = checked)}
|
|
22
|
-
/>
|
|
23
|
-
</DeprecatedFormInput>
|
|
24
|
-
</DeprecatedFormContainer>
|
|
25
|
-
);
|
|
26
|
-
};
|