@dxos/plugin-transcription 0.8.1 → 0.8.2-main.2f9c567
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-JQ3HFHLQ.mjs → TranscriptContainer-3LU3XBEB.mjs} +3 -2
- package/dist/lib/browser/app-graph-builder-YXELPN6F.mjs +349 -0
- package/dist/lib/browser/app-graph-builder-YXELPN6F.mjs.map +7 -0
- package/dist/lib/browser/{chunk-YCZISX63.mjs → chunk-GWY2Q2NE.mjs} +108 -81
- package/dist/lib/browser/chunk-GWY2Q2NE.mjs.map +7 -0
- package/dist/lib/browser/chunk-HNIKXVCG.mjs +720 -0
- package/dist/lib/browser/chunk-HNIKXVCG.mjs.map +7 -0
- package/dist/lib/browser/chunk-HRDAILQX.mjs +27 -0
- package/dist/lib/browser/chunk-HRDAILQX.mjs.map +7 -0
- package/dist/lib/browser/{chunk-GU2BNYKZ.mjs → chunk-KLD7O5GJ.mjs} +2 -12
- package/dist/lib/browser/chunk-KLD7O5GJ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-YEPT334A.mjs → chunk-LTIQFX4W.mjs} +1 -1
- package/dist/lib/browser/chunk-LTIQFX4W.mjs.map +7 -0
- package/dist/lib/browser/chunk-TGOKX32G.mjs +63 -0
- package/dist/lib/browser/chunk-TGOKX32G.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +46 -209
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/{intent-resolver-4R66ZCKT.mjs → intent-resolver-BBB3DWV4.mjs} +8 -8
- package/dist/lib/browser/intent-resolver-BBB3DWV4.mjs.map +7 -0
- package/dist/lib/browser/{meeting-transcription-state-DLFHQK72.mjs → meeting-transcription-state-MNA2XROE.mjs} +4 -4
- package/dist/lib/browser/meeting-transcription-state-MNA2XROE.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-FQUHU5G7.mjs → react-surface-R277DACJ.mjs} +18 -6
- package/dist/lib/browser/react-surface-R277DACJ.mjs.map +7 -0
- package/dist/lib/browser/settings-I226DZ27.mjs +24 -0
- package/dist/lib/browser/settings-I226DZ27.mjs.map +7 -0
- package/dist/lib/browser/{transcriber-LGMIWDYI.mjs → transcriber-QRSS6X6S.mjs} +8 -7
- package/dist/lib/browser/{transcriber-LGMIWDYI.mjs.map → transcriber-QRSS6X6S.mjs.map} +3 -3
- package/dist/lib/browser/types/index.mjs +3 -3
- package/dist/lib/node/{TranscriptContainer-QEYTTT2V.cjs → TranscriptContainer-DICOMZLM.cjs} +8 -7
- package/dist/lib/node/TranscriptContainer-DICOMZLM.cjs.map +7 -0
- package/dist/lib/node/app-graph-builder-I6LYVIYY.cjs +350 -0
- package/dist/lib/node/app-graph-builder-I6LYVIYY.cjs.map +7 -0
- package/dist/lib/node/{chunk-P4VVD6ZO.cjs → chunk-34WFY7M7.cjs} +24 -34
- package/dist/lib/node/chunk-34WFY7M7.cjs.map +7 -0
- package/dist/lib/node/chunk-4JOJCZPJ.cjs +737 -0
- package/dist/lib/node/chunk-4JOJCZPJ.cjs.map +7 -0
- package/dist/lib/node/{chunk-3KHUSQNW.cjs → chunk-J72PUQ3C.cjs} +6 -15
- package/dist/lib/node/chunk-J72PUQ3C.cjs.map +7 -0
- package/dist/lib/node/{chunk-CZMLKKWT.cjs → chunk-JUGOXWES.cjs} +4 -4
- package/dist/lib/node/chunk-JUGOXWES.cjs.map +7 -0
- package/dist/lib/node/{chunk-LP4FG423.cjs → chunk-K553L7CZ.cjs} +23 -8
- package/dist/lib/node/chunk-K553L7CZ.cjs.map +7 -0
- package/dist/lib/node/{chunk-FCCJALOT.cjs → chunk-RK4BEN5E.cjs} +111 -83
- package/dist/lib/node/chunk-RK4BEN5E.cjs.map +7 -0
- package/dist/lib/node/index.cjs +65 -237
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/{intent-resolver-WMMCOUEH.cjs → intent-resolver-7XY3WITN.cjs} +11 -10
- package/dist/lib/node/intent-resolver-7XY3WITN.cjs.map +7 -0
- package/dist/lib/node/{meeting-transcription-state-URIYILEQ.cjs → meeting-transcription-state-5XLTMWPA.cjs} +7 -7
- package/dist/lib/node/meeting-transcription-state-5XLTMWPA.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-surface-WI2MGWCC.cjs → react-surface-HUSWAORU.cjs} +20 -10
- package/dist/lib/node/react-surface-HUSWAORU.cjs.map +7 -0
- package/dist/lib/node/settings-NDMU3EWQ.cjs +38 -0
- package/dist/lib/node/settings-NDMU3EWQ.cjs.map +7 -0
- package/dist/lib/node/{transcriber-QG5WPKX4.cjs → transcriber-UZJMG44C.cjs} +14 -13
- package/dist/lib/node/{transcriber-QG5WPKX4.cjs.map → transcriber-UZJMG44C.cjs.map} +3 -3
- package/dist/lib/node/types/index.cjs +8 -8
- package/dist/lib/node/types/index.cjs.map +1 -1
- package/dist/lib/node-esm/{TranscriptContainer-ZXUCOWGY.mjs → TranscriptContainer-K4E4P5T6.mjs} +3 -2
- package/dist/lib/node-esm/app-graph-builder-6FY2UQOH.mjs +350 -0
- package/dist/lib/node-esm/app-graph-builder-6FY2UQOH.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-3I7AC3D3.mjs +28 -0
- package/dist/lib/node-esm/chunk-3I7AC3D3.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-PTZHDZ36.mjs → chunk-5E2MR5XK.mjs} +1 -1
- package/dist/lib/node-esm/chunk-5E2MR5XK.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-6C34FO4C.mjs +721 -0
- package/dist/lib/node-esm/chunk-6C34FO4C.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-YQYBLFNI.mjs → chunk-CKANLRS4.mjs} +108 -81
- package/dist/lib/node-esm/chunk-CKANLRS4.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-KUQ3ZTRX.mjs +64 -0
- package/dist/lib/node-esm/chunk-KUQ3ZTRX.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-HKATMD34.mjs → chunk-QMHMEKB3.mjs} +2 -12
- package/dist/lib/node-esm/chunk-QMHMEKB3.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +46 -209
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/{intent-resolver-QN2LO5TX.mjs → intent-resolver-ACGAPLDZ.mjs} +8 -8
- package/dist/lib/node-esm/intent-resolver-ACGAPLDZ.mjs.map +7 -0
- package/dist/lib/node-esm/{meeting-transcription-state-ZYVRAW6Y.mjs → meeting-transcription-state-3WOZ52BQ.mjs} +4 -4
- package/dist/lib/node-esm/meeting-transcription-state-3WOZ52BQ.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-PCH6NTVB.mjs → react-surface-G2OY4MWL.mjs} +18 -6
- package/dist/lib/node-esm/react-surface-G2OY4MWL.mjs.map +7 -0
- package/dist/lib/node-esm/settings-O7X2UQQG.mjs +25 -0
- package/dist/lib/node-esm/settings-O7X2UQQG.mjs.map +7 -0
- package/dist/lib/node-esm/{transcriber-TMPYZ5L4.mjs → transcriber-NVVFH7IF.mjs} +8 -7
- package/dist/lib/node-esm/{transcriber-TMPYZ5L4.mjs.map → transcriber-NVVFH7IF.mjs.map} +3 -3
- package/dist/lib/node-esm/types/index.mjs +3 -3
- package/dist/types/src/TranscriptionPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts +5 -7
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +2 -4
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/meeting-transcription-state.d.ts +2 -4
- package/dist/types/src/capabilities/meeting-transcription-state.d.ts.map +1 -1
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -1
- package/dist/types/src/capabilities/settings.d.ts +4 -0
- package/dist/types/src/capabilities/settings.d.ts.map +1 -0
- package/dist/types/src/capabilities/transcriber.d.ts.map +1 -1
- package/dist/types/src/components/Transcript/Transcript.d.ts +14 -4
- package/dist/types/src/components/Transcript/Transcript.d.ts.map +1 -1
- package/dist/types/src/components/Transcript/Transcript.stories.d.ts +19 -4
- package/dist/types/src/components/Transcript/Transcript.stories.d.ts.map +1 -1
- package/dist/types/src/components/Transcript/deprecated/OldTranscript.d.ts +27 -0
- package/dist/types/src/components/Transcript/deprecated/OldTranscript.d.ts.map +1 -0
- package/dist/types/src/components/Transcript/transcript-extension.d.ts +19 -0
- package/dist/types/src/components/Transcript/transcript-extension.d.ts.map +1 -0
- package/dist/types/src/components/TranscriptContainer.d.ts.map +1 -1
- package/dist/types/src/components/TranscriptionSettings/TranscriptionSettings.d.ts +6 -0
- package/dist/types/src/components/TranscriptionSettings/TranscriptionSettings.d.ts.map +1 -0
- package/dist/types/src/components/TranscriptionSettings/index.d.ts +2 -0
- package/dist/types/src/components/TranscriptionSettings/index.d.ts.map +1 -0
- 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/components/transcription.stories.d.ts +6 -3
- package/dist/types/src/components/transcription.stories.d.ts.map +1 -1
- package/dist/types/src/entity-extraction/entity-extraction.d.ts +42 -0
- package/dist/types/src/entity-extraction/entity-extraction.d.ts.map +1 -0
- package/dist/types/src/entity-extraction/entity-extraction.test.d.ts +2 -0
- package/dist/types/src/entity-extraction/entity-extraction.test.d.ts.map +1 -0
- package/dist/types/src/entity-extraction/index.d.ts +2 -0
- package/dist/types/src/entity-extraction/index.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +1 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useQueueModelAdapter.d.ts +7 -0
- package/dist/types/src/hooks/useQueueModelAdapter.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/model/index.d.ts +2 -0
- package/dist/types/src/model/index.d.ts.map +1 -0
- package/dist/types/src/model/model.d.ts +68 -0
- package/dist/types/src/model/model.d.ts.map +1 -0
- package/dist/types/src/model/model.test.d.ts +2 -0
- package/dist/types/src/model/model.test.d.ts.map +1 -0
- package/dist/types/src/testing/index.d.ts +2 -0
- package/dist/types/src/testing/index.d.ts.map +1 -0
- package/dist/types/src/testing/testing.d.ts +40 -0
- package/dist/types/src/testing/testing.d.ts.map +1 -0
- package/dist/types/src/transcriber/transcriber.browser.test.d.ts +2 -0
- package/dist/types/src/transcriber/transcriber.browser.test.d.ts.map +1 -0
- package/dist/types/src/transcriber/transcriber.d.ts +2 -2
- package/dist/types/src/transcriber/transcriber.d.ts.map +1 -1
- package/dist/types/src/transcriber/transcription-manager.d.ts +17 -15
- package/dist/types/src/transcriber/transcription-manager.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +3 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +26 -40
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +11 -7
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util/index.d.ts +0 -1
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/package.json +53 -40
- package/src/TranscriptionPlugin.tsx +29 -12
- package/src/capabilities/app-graph-builder.ts +111 -52
- package/src/capabilities/capabilities.ts +4 -3
- package/src/capabilities/index.ts +1 -0
- package/src/capabilities/intent-resolver.ts +5 -5
- package/src/capabilities/meeting-transcription-state.ts +2 -2
- package/src/capabilities/react-surface.tsx +12 -4
- package/src/capabilities/settings.ts +20 -0
- package/src/capabilities/transcriber.ts +2 -1
- package/src/components/Transcript/Transcript.stories.tsx +201 -43
- package/src/components/Transcript/Transcript.tsx +83 -208
- package/src/components/Transcript/deprecated/OldTranscript.tsx +260 -0
- package/src/components/Transcript/transcript-extension.ts +236 -0
- package/src/components/TranscriptContainer.tsx +11 -6
- package/src/components/TranscriptionSettings/TranscriptionSettings.tsx +26 -0
- package/src/components/TranscriptionSettings/index.ts +5 -0
- package/src/components/index.ts +1 -0
- package/src/components/transcription.stories.tsx +163 -60
- package/src/entity-extraction/entity-extraction.test.ts +97 -0
- package/src/entity-extraction/entity-extraction.ts +149 -0
- package/src/entity-extraction/index.ts +5 -0
- package/src/entity-extraction/system-prompt.tpl +38 -0
- package/src/entity-extraction/types.d.ts +8 -0
- package/src/hooks/index.ts +1 -0
- package/src/hooks/useQueueModelAdapter.ts +63 -0
- package/src/hooks/useTranscriber.ts +3 -2
- package/src/model/index.ts +5 -0
- package/src/model/model.test.ts +169 -0
- package/src/model/model.ts +229 -0
- package/src/testing/index.ts +5 -0
- package/src/testing/testing.ts +221 -0
- package/src/transcriber/{transcriber.test.ts → transcriber.browser.test.ts} +3 -3
- package/src/transcriber/transcriber.ts +20 -11
- package/src/transcriber/transcription-manager.ts +67 -58
- package/src/translations.ts +2 -0
- package/src/types/schema.ts +11 -32
- package/src/types/types.ts +19 -9
- package/src/util/index.ts +0 -1
- package/dist/lib/browser/app-graph-builder-VDQOVX7P.mjs +0 -191
- package/dist/lib/browser/app-graph-builder-VDQOVX7P.mjs.map +0 -7
- package/dist/lib/browser/chunk-G4B6CPC2.mjs +0 -253
- package/dist/lib/browser/chunk-G4B6CPC2.mjs.map +0 -7
- package/dist/lib/browser/chunk-GU2BNYKZ.mjs.map +0 -7
- package/dist/lib/browser/chunk-K7FOYAXO.mjs +0 -8
- package/dist/lib/browser/chunk-K7FOYAXO.mjs.map +0 -7
- package/dist/lib/browser/chunk-OGNXNGJB.mjs +0 -73
- package/dist/lib/browser/chunk-OGNXNGJB.mjs.map +0 -7
- package/dist/lib/browser/chunk-YCZISX63.mjs.map +0 -7
- package/dist/lib/browser/chunk-YEPT334A.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-4R66ZCKT.mjs.map +0 -7
- package/dist/lib/browser/meeting-transcription-state-DLFHQK72.mjs.map +0 -7
- package/dist/lib/browser/react-surface-FQUHU5G7.mjs.map +0 -7
- package/dist/lib/node/TranscriptContainer-QEYTTT2V.cjs.map +0 -7
- package/dist/lib/node/app-graph-builder-IFSIVNUR.cjs +0 -200
- package/dist/lib/node/app-graph-builder-IFSIVNUR.cjs.map +0 -7
- package/dist/lib/node/chunk-3KHUSQNW.cjs.map +0 -7
- package/dist/lib/node/chunk-CZMLKKWT.cjs.map +0 -7
- package/dist/lib/node/chunk-FCCJALOT.cjs.map +0 -7
- package/dist/lib/node/chunk-LP4FG423.cjs.map +0 -7
- package/dist/lib/node/chunk-P4VVD6ZO.cjs.map +0 -7
- package/dist/lib/node/chunk-UOFHT4GZ.cjs +0 -280
- package/dist/lib/node/chunk-UOFHT4GZ.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-WMMCOUEH.cjs.map +0 -7
- package/dist/lib/node/meeting-transcription-state-URIYILEQ.cjs.map +0 -7
- package/dist/lib/node/react-surface-WI2MGWCC.cjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-UL6XLIZY.mjs +0 -192
- package/dist/lib/node-esm/app-graph-builder-UL6XLIZY.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-6X7X2UZF.mjs +0 -254
- package/dist/lib/node-esm/chunk-6X7X2UZF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-GIO6J6FE.mjs +0 -74
- package/dist/lib/node-esm/chunk-GIO6J6FE.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HKATMD34.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-J4D2RBBH.mjs +0 -10
- package/dist/lib/node-esm/chunk-J4D2RBBH.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-PTZHDZ36.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YQYBLFNI.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-QN2LO5TX.mjs.map +0 -7
- package/dist/lib/node-esm/meeting-transcription-state-ZYVRAW6Y.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-PCH6NTVB.mjs.map +0 -7
- package/dist/types/src/transcriber/transcriber.test.d.ts +0 -2
- package/dist/types/src/transcriber/transcriber.test.d.ts.map +0 -1
- package/dist/types/src/util/random-queue-dxn.d.ts +0 -3
- package/dist/types/src/util/random-queue-dxn.d.ts.map +0 -1
- package/src/util/random-queue-dxn.ts +0 -9
- /package/dist/lib/browser/{TranscriptContainer-JQ3HFHLQ.mjs.map → TranscriptContainer-3LU3XBEB.mjs.map} +0 -0
- /package/dist/lib/node-esm/{TranscriptContainer-ZXUCOWGY.mjs.map → TranscriptContainer-K4E4P5T6.mjs.map} +0 -0
|
@@ -1,57 +1,43 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Schema } from 'effect';
|
|
2
|
+
import { Expando } from '@dxos/echo-schema';
|
|
2
3
|
/**
|
|
3
4
|
* Root transcript object created when the user starts a transcription.
|
|
4
5
|
*/
|
|
5
|
-
export declare const TranscriptSchema:
|
|
6
|
-
name: typeof
|
|
7
|
-
started:
|
|
8
|
-
ended:
|
|
6
|
+
export declare const TranscriptSchema: Schema.Struct<{
|
|
7
|
+
name: typeof Schema.String;
|
|
8
|
+
started: Schema.optional<typeof Schema.String>;
|
|
9
|
+
ended: Schema.optional<typeof Schema.String>;
|
|
9
10
|
/**
|
|
10
11
|
* Queue containing TranscriptBlock objects.
|
|
11
12
|
*/
|
|
12
13
|
queue: import("@dxos/echo-schema").Ref$<Expando>;
|
|
13
14
|
}>;
|
|
14
|
-
declare const TranscriptType_base: import("@dxos/echo-schema").TypedObjectPrototype<import("@dxos/echo-schema").TypedObjectFields<{
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
15
|
+
declare const TranscriptType_base: import("@dxos/echo-schema").TypedObjectPrototype<import("@dxos/echo-schema").TypedObjectFields<Readonly<{
|
|
16
|
+
name: typeof Schema.String;
|
|
17
|
+
started: Schema.optional<typeof Schema.String>;
|
|
18
|
+
ended: Schema.optional<typeof Schema.String>;
|
|
19
|
+
/**
|
|
20
|
+
* Queue containing TranscriptBlock objects.
|
|
21
|
+
*/
|
|
22
|
+
queue: import("@dxos/echo-schema").Ref$<Expando>;
|
|
23
|
+
}>, import("@dxos/echo-schema").TypedObjectOptions>, Schema.Struct.Encoded<Readonly<{
|
|
24
|
+
name: typeof Schema.String;
|
|
25
|
+
started: Schema.optional<typeof Schema.String>;
|
|
26
|
+
ended: Schema.optional<typeof Schema.String>;
|
|
27
|
+
/**
|
|
28
|
+
* Queue containing TranscriptBlock objects.
|
|
29
|
+
*/
|
|
30
|
+
queue: import("@dxos/echo-schema").Ref$<Expando>;
|
|
31
|
+
}>>>;
|
|
25
32
|
export declare class TranscriptType extends TranscriptType_base {
|
|
26
33
|
}
|
|
27
34
|
/**
|
|
28
35
|
* First message in queue.
|
|
29
36
|
* Contains metadata for the recording and transcript.
|
|
30
37
|
*/
|
|
31
|
-
declare const TranscriptHeader:
|
|
32
|
-
started:
|
|
33
|
-
}>;
|
|
34
|
-
export type TranscriptHeader = S.Schema.Type<typeof TranscriptHeader>;
|
|
35
|
-
/**
|
|
36
|
-
* Transcription fragment.
|
|
37
|
-
*/
|
|
38
|
-
declare const TranscriptSegment: S.Struct<{
|
|
39
|
-
started: typeof S.Date;
|
|
40
|
-
text: typeof S.String;
|
|
38
|
+
declare const TranscriptHeader: Schema.Struct<{
|
|
39
|
+
started: Schema.optional<typeof Schema.String>;
|
|
41
40
|
}>;
|
|
42
|
-
export type
|
|
43
|
-
/**
|
|
44
|
-
* Transcription block (from single speaker).
|
|
45
|
-
*/
|
|
46
|
-
export declare const TranscriptBlock: import("@dxos/echo-schema").EchoObjectSchema<S.Struct<{
|
|
47
|
-
id: typeof S.String;
|
|
48
|
-
authorName: S.optional<typeof S.String>;
|
|
49
|
-
authorHue: S.optional<typeof S.String>;
|
|
50
|
-
segments: S.Array$<S.Struct<{
|
|
51
|
-
started: typeof S.Date;
|
|
52
|
-
text: typeof S.String;
|
|
53
|
-
}>>;
|
|
54
|
-
}>>;
|
|
55
|
-
export type TranscriptBlock = S.Schema.Type<typeof TranscriptBlock>;
|
|
41
|
+
export type TranscriptHeader = Schema.Schema.Type<typeof TranscriptHeader>;
|
|
56
42
|
export {};
|
|
57
43
|
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/types/schema.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/types/schema.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,OAAO,EAAoB,MAAM,mBAAmB,CAAC;AAE9D;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;IAO3B;;OAEG;;EAGH,CAAC;;;;;IALD;;OAEG;;;;;;IAFH;;OAEG;;;AAKL,qBAAa,cAAe,SAAQ,mBAGT;CAAG;AAI9B;;;GAGG;AACH,QAAA,MAAM,gBAAgB;;EAEpB,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
|
@@ -1,18 +1,18 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Schema } from 'effect';
|
|
2
2
|
import { TranscriptType } from './schema';
|
|
3
3
|
/**
|
|
4
4
|
* Endpoint to the calls service.
|
|
5
5
|
*/
|
|
6
6
|
export declare const TRANSCRIPTION_URL = "https://calls-service.dxos.workers.dev";
|
|
7
7
|
export declare namespace TranscriptionAction {
|
|
8
|
-
const Create_base:
|
|
9
|
-
readonly _tag:
|
|
8
|
+
const Create_base: Schema.TaggedClass<Create, "dxos.org/plugin/transcription/action/create", {
|
|
9
|
+
readonly _tag: Schema.tag<"dxos.org/plugin/transcription/action/create">;
|
|
10
10
|
} & {
|
|
11
|
-
input:
|
|
12
|
-
name:
|
|
13
|
-
spaceId:
|
|
11
|
+
input: Schema.Struct<{
|
|
12
|
+
name: Schema.optional<typeof Schema.String>;
|
|
13
|
+
spaceId: Schema.Schema<import("@dxos/keys").SpaceId, string, never>;
|
|
14
14
|
}>;
|
|
15
|
-
output:
|
|
15
|
+
output: Schema.Struct<{
|
|
16
16
|
object: typeof TranscriptType;
|
|
17
17
|
}>;
|
|
18
18
|
}>;
|
|
@@ -21,4 +21,8 @@ export declare namespace TranscriptionAction {
|
|
|
21
21
|
export {};
|
|
22
22
|
}
|
|
23
23
|
export declare const isTranscript: (object: unknown) => object is typeof TranscriptType;
|
|
24
|
+
export declare const TranscriptionSettingsSchema: Schema.mutable<Schema.Struct<{
|
|
25
|
+
entityExtraction: Schema.PropertySignature<"?:", boolean | undefined, never, "?:", boolean | undefined, true, never>;
|
|
26
|
+
}>>;
|
|
27
|
+
export type TranscriptionSettingsProps = Schema.Schema.Type<typeof TranscriptionSettingsSchema>;
|
|
24
28
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAKhC,OAAO,EAAE,cAAc,EAAE,MAAM,UAAU,CAAC;AAK1C;;GAEG;AAEH,eAAO,MAAM,iBAAiB,2CAA2C,CAAC;AAE1E,yBAAiB,mBAAmB,CAAC;;;;;;;;;;;;IAGnC,MAAM,OAAO,MAAO,SAAQ,WAQ1B;KAAG;;CACN;AAED,eAAO,MAAM,YAAY,WAAY,OAAO,KAAG,MAAM,IAAI,OAAO,cAE/D,CAAC;AAGF,eAAO,MAAM,2BAA2B;;GAIvC,CAAC;AAEF,MAAM,MAAM,0BAA0B,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,2BAA2B,CAAC,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/util/index.ts"],"names":[],"mappings":"AAIA,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/util/index.ts"],"names":[],"mappings":"AAIA,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-transcription",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.2-main.2f9c567",
|
|
4
4
|
"description": "Voice transcription.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -32,9 +32,11 @@
|
|
|
32
32
|
"src"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
+
"@codemirror/state": "^6.4.1",
|
|
36
|
+
"@codemirror/view": "^6.34.1",
|
|
35
37
|
"@preact/signals-core": "^1.6.0",
|
|
36
38
|
"date-fns": "^3.3.1",
|
|
37
|
-
"effect": "3.
|
|
39
|
+
"effect": "3.14.21",
|
|
38
40
|
"extendable-media-recorder": "^9.2.19",
|
|
39
41
|
"extendable-media-recorder-wav-encoder": "^7.0.123",
|
|
40
42
|
"main-thread-scheduling": "^14.1.1",
|
|
@@ -42,54 +44,65 @@
|
|
|
42
44
|
"react-router-dom": "^6.4.0",
|
|
43
45
|
"react-use": "^17.5.1",
|
|
44
46
|
"wavefile": "^11.0.0",
|
|
45
|
-
"@dxos/app-framework": "0.8.
|
|
46
|
-
"@dxos/
|
|
47
|
-
"@dxos/
|
|
48
|
-
"@dxos/async": "0.8.
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/echo
|
|
55
|
-
"@dxos/echo-
|
|
56
|
-
"@dxos/
|
|
57
|
-
"@dxos/
|
|
58
|
-
"@dxos/
|
|
59
|
-
"@dxos/
|
|
60
|
-
"@dxos/
|
|
61
|
-
"@dxos/
|
|
62
|
-
"@dxos/plugin-
|
|
63
|
-
"@dxos/plugin-
|
|
64
|
-
"@dxos/
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/plugin-space": "0.8.
|
|
67
|
-
"@dxos/
|
|
68
|
-
"@dxos/
|
|
69
|
-
"@dxos/react-
|
|
70
|
-
"@dxos/react-
|
|
71
|
-
"@dxos/react-ui-
|
|
72
|
-
"@dxos/
|
|
73
|
-
"@dxos/react-
|
|
74
|
-
"@dxos/
|
|
75
|
-
"@dxos/
|
|
47
|
+
"@dxos/app-framework": "0.8.2-main.2f9c567",
|
|
48
|
+
"@dxos/assistant": "0.8.2-main.2f9c567",
|
|
49
|
+
"@dxos/client": "0.8.2-main.2f9c567",
|
|
50
|
+
"@dxos/async": "0.8.2-main.2f9c567",
|
|
51
|
+
"@dxos/artifact": "0.8.2-main.2f9c567",
|
|
52
|
+
"@dxos/codec-protobuf": "0.8.2-main.2f9c567",
|
|
53
|
+
"@dxos/context": "0.8.2-main.2f9c567",
|
|
54
|
+
"@dxos/display-name": "0.8.2-main.2f9c567",
|
|
55
|
+
"@dxos/debug": "0.8.2-main.2f9c567",
|
|
56
|
+
"@dxos/echo": "0.8.2-main.2f9c567",
|
|
57
|
+
"@dxos/echo-db": "0.8.2-main.2f9c567",
|
|
58
|
+
"@dxos/echo-schema": "0.8.2-main.2f9c567",
|
|
59
|
+
"@dxos/local-storage": "0.8.2-main.2f9c567",
|
|
60
|
+
"@dxos/invariant": "0.8.2-main.2f9c567",
|
|
61
|
+
"@dxos/keys": "0.8.2-main.2f9c567",
|
|
62
|
+
"@dxos/live-object": "0.8.2-main.2f9c567",
|
|
63
|
+
"@dxos/log": "0.8.2-main.2f9c567",
|
|
64
|
+
"@dxos/plugin-client": "0.8.2-main.2f9c567",
|
|
65
|
+
"@dxos/plugin-deck": "0.8.2-main.2f9c567",
|
|
66
|
+
"@dxos/plugin-graph": "0.8.2-main.2f9c567",
|
|
67
|
+
"@dxos/plugin-markdown": "0.8.2-main.2f9c567",
|
|
68
|
+
"@dxos/plugin-space": "0.8.2-main.2f9c567",
|
|
69
|
+
"@dxos/plugin-meeting": "0.8.2-main.2f9c567",
|
|
70
|
+
"@dxos/protocols": "0.8.2-main.2f9c567",
|
|
71
|
+
"@dxos/react-client": "0.8.2-main.2f9c567",
|
|
72
|
+
"@dxos/react-edge-client": "0.8.2-main.2f9c567",
|
|
73
|
+
"@dxos/react-ui-components": "0.8.2-main.2f9c567",
|
|
74
|
+
"@dxos/react-ui-form": "0.8.2-main.2f9c567",
|
|
75
|
+
"@dxos/react-ui-attention": "0.8.2-main.2f9c567",
|
|
76
|
+
"@dxos/react-ui-editor": "0.8.2-main.2f9c567",
|
|
77
|
+
"@dxos/react-ui-grid": "0.8.2-main.2f9c567",
|
|
78
|
+
"@dxos/react-ui-sfx": "0.8.2-main.2f9c567",
|
|
79
|
+
"@dxos/react-ui-stack": "0.8.2-main.2f9c567",
|
|
80
|
+
"@dxos/schema": "0.8.2-main.2f9c567",
|
|
81
|
+
"@dxos/tracing": "0.8.2-main.2f9c567",
|
|
82
|
+
"@dxos/util": "0.8.2-main.2f9c567"
|
|
76
83
|
},
|
|
77
84
|
"devDependencies": {
|
|
78
85
|
"@types/react": "~18.2.0",
|
|
79
86
|
"react": "~18.2.0",
|
|
80
87
|
"react-dom": "~18.2.0",
|
|
81
88
|
"tailwindcss": "~3.4.1",
|
|
82
|
-
"@dxos/
|
|
83
|
-
"@dxos/
|
|
84
|
-
"@dxos/
|
|
85
|
-
"@dxos/
|
|
86
|
-
"@dxos/
|
|
89
|
+
"@dxos/plugin-preview": "0.8.2-main.2f9c567",
|
|
90
|
+
"@dxos/plugin-storybook-layout": "0.8.2-main.2f9c567",
|
|
91
|
+
"@dxos/plugin-theme": "0.8.2-main.2f9c567",
|
|
92
|
+
"@dxos/react-ui": "0.8.2-main.2f9c567",
|
|
93
|
+
"@dxos/random": "0.8.2-main.2f9c567",
|
|
94
|
+
"@dxos/react-ui-syntax-highlighter": "0.8.2-main.2f9c567",
|
|
95
|
+
"@dxos/react-ui-theme": "0.8.2-main.2f9c567",
|
|
96
|
+
"@dxos/react-ui-form": "0.8.2-main.2f9c567",
|
|
97
|
+
"@dxos/test-utils": "0.8.2-main.2f9c567",
|
|
98
|
+
"@dxos/storybook-utils": "0.8.2-main.2f9c567"
|
|
87
99
|
},
|
|
88
100
|
"optionalDependencies": {
|
|
101
|
+
"effect": "^3.13.3",
|
|
89
102
|
"react": "~18.2.0",
|
|
90
103
|
"react-dom": "~18.2.0",
|
|
91
|
-
"@dxos/react-ui": "0.8.
|
|
92
|
-
"@dxos/react-ui
|
|
104
|
+
"@dxos/react-ui-theme": "0.8.2-main.2f9c567",
|
|
105
|
+
"@dxos/react-ui": "0.8.2-main.2f9c567"
|
|
93
106
|
},
|
|
94
107
|
"publishConfig": {
|
|
95
108
|
"access": "public"
|
|
@@ -6,11 +6,21 @@ import { Capabilities, Events, contributes, defineModule, definePlugin } from '@
|
|
|
6
6
|
import { QueueImpl } from '@dxos/echo-db';
|
|
7
7
|
import { isInstanceOf } from '@dxos/echo-schema';
|
|
8
8
|
import { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';
|
|
9
|
+
import { getSpace } from '@dxos/react-client/echo';
|
|
10
|
+
import { DataType } from '@dxos/schema';
|
|
9
11
|
|
|
10
|
-
import {
|
|
12
|
+
import {
|
|
13
|
+
AppGraphBuilder,
|
|
14
|
+
IntentResolver,
|
|
15
|
+
MeetingTranscriptionState,
|
|
16
|
+
ReactSurface,
|
|
17
|
+
Transcriber,
|
|
18
|
+
Settings,
|
|
19
|
+
} from './capabilities';
|
|
20
|
+
import { renderMarkdown } from './components';
|
|
11
21
|
import { meta } from './meta';
|
|
12
22
|
import translations from './translations';
|
|
13
|
-
import {
|
|
23
|
+
import { TranscriptType } from './types';
|
|
14
24
|
|
|
15
25
|
export const TranscriptionPlugin = () =>
|
|
16
26
|
definePlugin(meta, [
|
|
@@ -20,14 +30,9 @@ export const TranscriptionPlugin = () =>
|
|
|
20
30
|
activate: () => contributes(Capabilities.Translations, translations),
|
|
21
31
|
}),
|
|
22
32
|
defineModule({
|
|
23
|
-
id: `${meta.id}/module/
|
|
24
|
-
activatesOn: Events.
|
|
25
|
-
activate:
|
|
26
|
-
}),
|
|
27
|
-
defineModule({
|
|
28
|
-
id: `${meta.id}/module/meeting-transcription-state`,
|
|
29
|
-
activatesOn: Events.SetupAppGraph,
|
|
30
|
-
activate: MeetingTranscriptionState,
|
|
33
|
+
id: `${meta.id}/module/settings`,
|
|
34
|
+
activatesOn: Events.SetupSettings,
|
|
35
|
+
activate: Settings,
|
|
31
36
|
}),
|
|
32
37
|
defineModule({
|
|
33
38
|
id: `${meta.id}/module/metadata`,
|
|
@@ -40,11 +45,13 @@ export const TranscriptionPlugin = () =>
|
|
|
40
45
|
// TODO(wittjosiah): Factor out. Artifact? Separate capability?
|
|
41
46
|
getTextContent: async (transcript: TranscriptType) => {
|
|
42
47
|
const client = context.requestCapability(ClientCapabilities.Client);
|
|
48
|
+
const space = getSpace(transcript);
|
|
49
|
+
const members = space?.members.get().map((member) => member.identity) ?? [];
|
|
43
50
|
const queue = new QueueImpl(client.edge, transcript.queue.dxn);
|
|
44
51
|
await queue.refresh();
|
|
45
52
|
const content = queue.items
|
|
46
|
-
.filter((
|
|
47
|
-
.
|
|
53
|
+
.filter((message) => isInstanceOf(DataType.Message, message))
|
|
54
|
+
.flatMap((message, index) => renderMarkdown(members)(message, index))
|
|
48
55
|
.join('\n\n');
|
|
49
56
|
return content;
|
|
50
57
|
},
|
|
@@ -71,4 +78,14 @@ export const TranscriptionPlugin = () =>
|
|
|
71
78
|
activatesOn: Events.SetupAppGraph,
|
|
72
79
|
activate: AppGraphBuilder,
|
|
73
80
|
}),
|
|
81
|
+
defineModule({
|
|
82
|
+
id: `${meta.id}/module/transcription`,
|
|
83
|
+
activatesOn: Events.SetupAppGraph,
|
|
84
|
+
activate: Transcriber,
|
|
85
|
+
}),
|
|
86
|
+
defineModule({
|
|
87
|
+
id: `${meta.id}/module/meeting-transcription-state`,
|
|
88
|
+
activatesOn: Events.SetupAppGraph,
|
|
89
|
+
activate: MeetingTranscriptionState,
|
|
90
|
+
}),
|
|
74
91
|
]);
|
|
@@ -2,39 +2,35 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
+
import type { Schema } from 'effect';
|
|
6
|
+
|
|
5
7
|
import { Capabilities, contributes, createIntent, type PluginsContext } from '@dxos/app-framework';
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
8
|
+
import { AIServiceEdgeClient, type AIServiceClient } from '@dxos/assistant';
|
|
9
|
+
import { AI_SERVICE_ENDPOINT } from '@dxos/assistant/testing';
|
|
10
|
+
import { Filter, fullyQualifiedId, getSpace, makeRef, type Space } from '@dxos/client/echo';
|
|
11
|
+
import { getSchemaTypename, isInstanceOf, type BaseEchoObject } from '@dxos/echo-schema';
|
|
9
12
|
import { invariant } from '@dxos/invariant';
|
|
13
|
+
import { DXN } from '@dxos/keys';
|
|
14
|
+
import { log } from '@dxos/log';
|
|
10
15
|
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
11
16
|
import { PLANK_COMPANION_TYPE, ATTENDABLE_PATH_SEPARATOR } from '@dxos/plugin-deck/types';
|
|
12
17
|
import { createExtension, type Node } from '@dxos/plugin-graph';
|
|
18
|
+
import { DocumentType } from '@dxos/plugin-markdown/types';
|
|
13
19
|
import { MeetingCapabilities, type CallState, type MediaState } from '@dxos/plugin-meeting';
|
|
14
|
-
import { MeetingType } from '@dxos/plugin-meeting/types';
|
|
15
|
-
import { buf } from '@dxos/protocols/buf';
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
type TranscriptionPayload as TranscriptionPayloadProto,
|
|
19
|
-
} from '@dxos/protocols/buf/dxos/edge/calls_pb';
|
|
20
|
-
import { keyToFallback } from '@dxos/util';
|
|
20
|
+
import { MeetingType, type MeetingCallProperties } from '@dxos/plugin-meeting/types';
|
|
21
|
+
import { type buf } from '@dxos/protocols/buf';
|
|
22
|
+
import { type TranscriptionPayloadSchema } from '@dxos/protocols/buf/dxos/edge/calls_pb';
|
|
23
|
+
import { DataType } from '@dxos/schema';
|
|
21
24
|
|
|
22
25
|
import { TranscriptionCapabilities } from './capabilities';
|
|
26
|
+
import { processTranscriptMessage } from '../entity-extraction';
|
|
23
27
|
import { TRANSCRIPTION_PLUGIN } from '../meta';
|
|
24
28
|
import { TranscriptionManager } from '../transcriber';
|
|
25
|
-
import { TranscriptionAction, TranscriptType } from '../types';
|
|
29
|
+
import { TranscriptionAction, type TranscriptionSettingsProps, TranscriptType } from '../types';
|
|
26
30
|
|
|
27
31
|
// TODO(wittjosiah): Factor out.
|
|
28
32
|
// TODO(wittjosiah): Can we stop using protobuf for this?
|
|
29
33
|
type TranscriptionPayload = buf.MessageInitShape<typeof TranscriptionPayloadSchema>;
|
|
30
|
-
const codec = {
|
|
31
|
-
encode: (message: TranscriptionPayload): Uint8Array => {
|
|
32
|
-
return buf.toBinary(TranscriptionPayloadSchema, buf.create(TranscriptionPayloadSchema, message));
|
|
33
|
-
},
|
|
34
|
-
decode: (message: Uint8Array): TranscriptionPayloadProto => {
|
|
35
|
-
return buf.fromBinary(TranscriptionPayloadSchema, message);
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
34
|
|
|
39
35
|
const getMeetingTranscript = async (
|
|
40
36
|
context: PluginsContext,
|
|
@@ -60,8 +56,7 @@ export default (context: PluginsContext) =>
|
|
|
60
56
|
contributes(Capabilities.AppGraphBuilder, [
|
|
61
57
|
createExtension({
|
|
62
58
|
id: `${TRANSCRIPTION_PLUGIN}/meeting-transcript`,
|
|
63
|
-
filter: (node): node is Node<MeetingType> =>
|
|
64
|
-
isInstanceOf(MeetingType, node.data) && node.type !== PLANK_COMPANION_TYPE,
|
|
59
|
+
filter: (node): node is Node<MeetingType> => isInstanceOf(MeetingType, node.data),
|
|
65
60
|
actions: ({ node }) => {
|
|
66
61
|
const meeting = node.data;
|
|
67
62
|
const state = context.requestCapability(TranscriptionCapabilities.MeetingTranscriptionState);
|
|
@@ -69,26 +64,25 @@ export default (context: PluginsContext) =>
|
|
|
69
64
|
{
|
|
70
65
|
id: `${fullyQualifiedId(meeting)}/action/start-stop-transcription`,
|
|
71
66
|
data: async () => {
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
void state.transcriptionManager.setEnabled(state.enabled);
|
|
67
|
+
// NOTE: We are not saving the state of the transcription manager here.
|
|
68
|
+
// We expect the state to be updated through `onCallStateUpdated` once it is propagated through Swarm.
|
|
69
|
+
// This is done to avoid race conditions and to not handle optimistic updates.
|
|
76
70
|
const transcript = await getMeetingTranscript(context, meeting);
|
|
77
71
|
invariant(transcript, 'Failed to create transcript');
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
72
|
+
|
|
73
|
+
const callManager = context.requestCapability(MeetingCapabilities.CallManager);
|
|
74
|
+
callManager.setActivity(getSchemaTypename(TranscriptType)!, {
|
|
75
|
+
queueDxn: transcript.queue.dxn.toString(),
|
|
76
|
+
enabled: !state.enabled,
|
|
83
77
|
});
|
|
84
78
|
},
|
|
85
79
|
properties: {
|
|
86
80
|
label: state.enabled
|
|
87
81
|
? ['stop transcription label', { ns: TRANSCRIPTION_PLUGIN }]
|
|
88
82
|
: ['start transcription label', { ns: TRANSCRIPTION_PLUGIN }],
|
|
89
|
-
icon: 'ph--
|
|
83
|
+
icon: 'ph--subtitles--regular',
|
|
90
84
|
disposition: 'toolbar',
|
|
91
|
-
classNames: state.enabled ? '
|
|
85
|
+
classNames: state.enabled ? 'bg-callAlert' : '',
|
|
92
86
|
},
|
|
93
87
|
},
|
|
94
88
|
];
|
|
@@ -97,6 +91,14 @@ export default (context: PluginsContext) =>
|
|
|
97
91
|
const meeting = node.data;
|
|
98
92
|
const client = context.requestCapability(ClientCapabilities.Client);
|
|
99
93
|
const state = context.requestCapability(TranscriptionCapabilities.MeetingTranscriptionState);
|
|
94
|
+
const settings = context
|
|
95
|
+
.requestCapability(Capabilities.SettingsStore)
|
|
96
|
+
.getStore<TranscriptionSettingsProps>(TRANSCRIPTION_PLUGIN)!.value;
|
|
97
|
+
|
|
98
|
+
// TODO(dmaretskyi): Request via capability.
|
|
99
|
+
const aiClient: AIServiceClient | undefined = new AIServiceEdgeClient({
|
|
100
|
+
endpoint: AI_SERVICE_ENDPOINT.REMOTE,
|
|
101
|
+
});
|
|
100
102
|
|
|
101
103
|
return [
|
|
102
104
|
{
|
|
@@ -106,47 +108,104 @@ export default (context: PluginsContext) =>
|
|
|
106
108
|
properties: {
|
|
107
109
|
label: ['transcript companion label', { ns: TRANSCRIPTION_PLUGIN }],
|
|
108
110
|
icon: 'ph--subtitles--regular',
|
|
111
|
+
position: 'hoist',
|
|
109
112
|
disposition: 'hidden',
|
|
110
113
|
schema: TranscriptType,
|
|
111
114
|
getIntent: ({ space }: { space: Space }) =>
|
|
112
115
|
createIntent(TranscriptionAction.Create, { spaceId: space.id }),
|
|
113
|
-
|
|
114
|
-
|
|
116
|
+
|
|
117
|
+
// TODO(burdon): Is this the right place to inisitalize the state? Change to a capability?
|
|
118
|
+
onJoin: async ({ meeting }: { meeting: MeetingType; roomId: string }) => {
|
|
115
119
|
const identity = client.halo.identity.get();
|
|
116
120
|
invariant(identity);
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
121
|
+
const space = getSpace(meeting);
|
|
122
|
+
invariant(space);
|
|
123
|
+
|
|
124
|
+
let messageEnricher;
|
|
125
|
+
if (aiClient && settings.entityExtraction) {
|
|
126
|
+
messageEnricher = createEntityExtractionEnricher({
|
|
127
|
+
aiClient,
|
|
128
|
+
// TODO(dmaretskyi): Have those be discovered from the schema graph or contributed by capabilities?
|
|
129
|
+
// This forced me to add a dependency on markdown plugin.
|
|
130
|
+
// This will be replaced with a vector search index anyway, so its not a big deal.
|
|
131
|
+
contextTypes: [DocumentType, DataType.Person, DataType.Organization],
|
|
132
|
+
space,
|
|
133
|
+
});
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
// TODO(burdon): The TranscriptionManager singleton is part of the state and should just be updated here.
|
|
137
|
+
state.transcriptionManager = await new TranscriptionManager({
|
|
138
|
+
edgeClient: client.edge,
|
|
139
|
+
messageEnricher,
|
|
140
|
+
})
|
|
141
|
+
.setIdentityDid(identity.did)
|
|
142
|
+
.open();
|
|
125
143
|
},
|
|
126
|
-
onLeave: () => {
|
|
127
|
-
|
|
144
|
+
onLeave: async () => {
|
|
145
|
+
await state.transcriptionManager?.close();
|
|
128
146
|
state.transcriptionManager = undefined;
|
|
129
147
|
state.enabled = false;
|
|
130
148
|
},
|
|
131
|
-
onCallStateUpdated: (callState: CallState) => {
|
|
149
|
+
onCallStateUpdated: async (callState: CallState) => {
|
|
132
150
|
const typename = getSchemaTypename(TranscriptType);
|
|
133
151
|
const transcription = typename ? callState.activities?.[typename] : undefined;
|
|
134
|
-
if (!transcription?.payload
|
|
152
|
+
if (!transcription?.payload) {
|
|
135
153
|
return;
|
|
136
154
|
}
|
|
137
155
|
|
|
138
|
-
const payload =
|
|
139
|
-
state.enabled = payload.enabled;
|
|
140
|
-
|
|
141
|
-
|
|
156
|
+
const payload: TranscriptionPayload = transcription.payload;
|
|
157
|
+
state.enabled = !!payload.enabled;
|
|
158
|
+
if (payload.queueDxn) {
|
|
159
|
+
// NOTE: Must set queue before enabling transcription.
|
|
160
|
+
state.transcriptionManager?.setQueue(DXN.parse(payload.queueDxn));
|
|
161
|
+
}
|
|
162
|
+
await state.transcriptionManager?.setEnabled(payload.enabled);
|
|
142
163
|
},
|
|
143
|
-
onMediaStateUpdated: ([mediaState, isSpeaking]: [MediaState, boolean]) => {
|
|
164
|
+
onMediaStateUpdated: async ([mediaState, isSpeaking]: [MediaState, boolean]) => {
|
|
144
165
|
void state.transcriptionManager?.setAudioTrack(mediaState.audioTrack);
|
|
145
166
|
void state.transcriptionManager?.setRecording(isSpeaking);
|
|
146
167
|
},
|
|
147
|
-
},
|
|
168
|
+
} satisfies MeetingCallProperties,
|
|
148
169
|
},
|
|
149
170
|
];
|
|
150
171
|
},
|
|
151
172
|
}),
|
|
152
173
|
]);
|
|
174
|
+
|
|
175
|
+
type EntityExtractionEnricherFactoryOptions = {
|
|
176
|
+
aiClient: AIServiceClient;
|
|
177
|
+
contextTypes: Schema.Schema.AnyNoContext[];
|
|
178
|
+
space: Space;
|
|
179
|
+
};
|
|
180
|
+
|
|
181
|
+
const createEntityExtractionEnricher = ({ aiClient, contextTypes, space }: EntityExtractionEnricherFactoryOptions) => {
|
|
182
|
+
return async (message: DataType.Message) => {
|
|
183
|
+
const { objects } = await space.db.query(Filter.or(...contextTypes.map((s) => Filter.schema(s)))).run();
|
|
184
|
+
log.info('context', { objects });
|
|
185
|
+
|
|
186
|
+
const { message: enhancedMessage, timeElapsed } = await processTranscriptMessage({
|
|
187
|
+
aiService: aiClient,
|
|
188
|
+
message,
|
|
189
|
+
context: { objects: await Promise.all(objects.map(processContextObject)) },
|
|
190
|
+
options: { timeout: ENTITY_EXTRACTOR_TIMEOUT, fallbackToRaw: true },
|
|
191
|
+
});
|
|
192
|
+
|
|
193
|
+
log.info('entity extraction time', { timeElapsed });
|
|
194
|
+
return enhancedMessage;
|
|
195
|
+
};
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
const processContextObject = async (object: BaseEchoObject): Promise<any> => {
|
|
199
|
+
// TODO(dmaretskyi): Documents need special processing is the content is behind a ref.
|
|
200
|
+
// TODO(dmaretskyi): Think about a way to handle this serialization with a decorator.
|
|
201
|
+
// if (isInstanceOf(DocumentType, object)) {
|
|
202
|
+
// return {
|
|
203
|
+
// ...object,
|
|
204
|
+
// content: await object.content.load(),
|
|
205
|
+
// };
|
|
206
|
+
// }
|
|
207
|
+
|
|
208
|
+
return object;
|
|
209
|
+
};
|
|
210
|
+
|
|
211
|
+
const ENTITY_EXTRACTOR_TIMEOUT = 25_000;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { defineCapability } from '@dxos/app-framework';
|
|
6
|
-
import { type
|
|
6
|
+
import { type Live } from '@dxos/live-object';
|
|
7
7
|
|
|
8
8
|
import { TRANSCRIPTION_PLUGIN } from '../meta';
|
|
9
9
|
import { type TranscriberParams, type Transcriber, type TranscriptionManager } from '../transcriber';
|
|
@@ -12,13 +12,14 @@ export namespace TranscriptionCapabilities {
|
|
|
12
12
|
export type GetTranscriberProps = {
|
|
13
13
|
audioStreamTrack: MediaStreamTrack;
|
|
14
14
|
onSegments: TranscriberParams['onSegments'];
|
|
15
|
+
config?: TranscriberParams['config'];
|
|
15
16
|
};
|
|
16
17
|
export type GetTranscriber = (props: GetTranscriberProps) => Transcriber;
|
|
17
18
|
export const Transcriber = defineCapability<GetTranscriber>(`${TRANSCRIPTION_PLUGIN}/capability/transcriber`);
|
|
18
19
|
|
|
19
|
-
export type MeetingTranscriptionState =
|
|
20
|
-
enabled: boolean;
|
|
20
|
+
export type MeetingTranscriptionState = Live<{
|
|
21
21
|
transcriptionManager?: TranscriptionManager;
|
|
22
|
+
enabled: boolean; // TODO(burdon): Move state into TranscriptionManager.
|
|
22
23
|
}>;
|
|
23
24
|
export const MeetingTranscriptionState = defineCapability<MeetingTranscriptionState>(
|
|
24
25
|
`${TRANSCRIPTION_PLUGIN}/capability/meeting-transcription-state`,
|
|
@@ -9,5 +9,6 @@ export const IntentResolver = lazy(() => import('./intent-resolver'));
|
|
|
9
9
|
export const MeetingTranscriptionState = lazy(() => import('./meeting-transcription-state'));
|
|
10
10
|
export const ReactSurface = lazy(() => import('./react-surface'));
|
|
11
11
|
export const Transcriber = lazy(() => import('./transcriber'));
|
|
12
|
+
export const Settings = lazy(() => import('./settings'));
|
|
12
13
|
|
|
13
14
|
export * from './capabilities';
|
|
@@ -3,19 +3,19 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { Capabilities, contributes, createResolver, type PluginsContext } from '@dxos/app-framework';
|
|
6
|
-
import {
|
|
7
|
-
import { type SpaceId } from '@dxos/react-client/echo';
|
|
6
|
+
import { live, refFromDXN } from '@dxos/live-object';
|
|
7
|
+
import { type SpaceId, createQueueDxn } from '@dxos/react-client/echo';
|
|
8
8
|
|
|
9
9
|
import { TranscriptionAction, TranscriptType } from '../types';
|
|
10
|
-
import { getTimeStr
|
|
10
|
+
import { getTimeStr } from '../util';
|
|
11
11
|
|
|
12
12
|
export default (context: PluginsContext) =>
|
|
13
13
|
contributes(Capabilities.IntentResolver, [
|
|
14
14
|
createResolver({
|
|
15
15
|
intent: TranscriptionAction.Create,
|
|
16
16
|
resolve: ({ name, spaceId }) => {
|
|
17
|
-
const transcript =
|
|
18
|
-
queue: refFromDXN(
|
|
17
|
+
const transcript = live(TranscriptType, {
|
|
18
|
+
queue: refFromDXN(createQueueDxn(spaceId as SpaceId)),
|
|
19
19
|
name: name ?? `Transcript ${getTimeStr(Date.now())}`,
|
|
20
20
|
});
|
|
21
21
|
|