@dxos/plugin-transcription 0.8.2-main.12df754 → 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-4D4BHE7G.mjs → TranscriptContainer-3LU3XBEB.mjs} +3 -3
- 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-DR3NBV6Q.mjs → chunk-GWY2Q2NE.mjs} +105 -78
- package/dist/lib/browser/chunk-GWY2Q2NE.mjs.map +7 -0
- package/dist/lib/browser/{chunk-RHHJZQPM.mjs → chunk-HNIKXVCG.mjs} +135 -117
- 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-5BE6RTNC.mjs → chunk-LTIQFX4W.mjs} +1 -1
- package/dist/lib/browser/{chunk-5BE6RTNC.mjs.map → chunk-LTIQFX4W.mjs.map} +1 -1
- package/dist/lib/browser/{chunk-5Q3R53U3.mjs → chunk-TGOKX32G.mjs} +21 -31
- package/dist/lib/browser/chunk-TGOKX32G.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +29 -17
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/{intent-resolver-ZQQEH27F.mjs → intent-resolver-BBB3DWV4.mjs} +4 -4
- package/dist/lib/browser/{intent-resolver-ZQQEH27F.mjs.map → intent-resolver-BBB3DWV4.mjs.map} +2 -2
- package/dist/lib/browser/{meeting-transcription-state-5D52VTHU.mjs → meeting-transcription-state-MNA2XROE.mjs} +2 -2
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-HETJ5XY6.mjs → react-surface-R277DACJ.mjs} +18 -7
- 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-SMRLU2KY.mjs → transcriber-QRSS6X6S.mjs} +4 -4
- package/dist/lib/browser/types/index.mjs +3 -3
- package/dist/lib/node/{TranscriptContainer-ZWP6UKY6.cjs → TranscriptContainer-DICOMZLM.cjs} +8 -8
- package/dist/lib/node/{TranscriptContainer-ZWP6UKY6.cjs.map → TranscriptContainer-DICOMZLM.cjs.map} +2 -2
- 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-3QEJ5EBO.cjs → chunk-34WFY7M7.cjs} +22 -32
- package/dist/lib/node/chunk-34WFY7M7.cjs.map +7 -0
- package/dist/lib/node/{chunk-KO6MKCED.cjs → chunk-4JOJCZPJ.cjs} +138 -119
- package/dist/lib/node/chunk-4JOJCZPJ.cjs.map +7 -0
- package/dist/lib/node/{chunk-HYGDHS6X.cjs → chunk-JUGOXWES.cjs} +4 -4
- package/dist/lib/node/{chunk-HYGDHS6X.cjs.map → chunk-JUGOXWES.cjs.map} +1 -1
- package/dist/lib/node/{chunk-WXG4Z2EZ.cjs → chunk-K553L7CZ.cjs} +23 -8
- package/dist/lib/node/chunk-K553L7CZ.cjs.map +7 -0
- package/dist/lib/node/{chunk-LA73IHCB.cjs → chunk-RK4BEN5E.cjs} +108 -80
- package/dist/lib/node/chunk-RK4BEN5E.cjs.map +7 -0
- package/dist/lib/node/index.cjs +46 -34
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/{intent-resolver-VY3XWYAA.cjs → intent-resolver-7XY3WITN.cjs} +8 -8
- package/dist/lib/node/{intent-resolver-VY3XWYAA.cjs.map → intent-resolver-7XY3WITN.cjs.map} +2 -2
- package/dist/lib/node/{meeting-transcription-state-OYWCY5XE.cjs → meeting-transcription-state-5XLTMWPA.cjs} +6 -6
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-surface-M2JQIIDY.cjs → react-surface-HUSWAORU.cjs} +20 -11
- 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-E6AAB4SU.cjs → transcriber-UZJMG44C.cjs} +10 -10
- 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-3HJ752CP.mjs → TranscriptContainer-K4E4P5T6.mjs} +3 -3
- 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-YXZOLOFT.mjs → chunk-5E2MR5XK.mjs} +1 -1
- package/dist/lib/node-esm/{chunk-YXZOLOFT.mjs.map → chunk-5E2MR5XK.mjs.map} +1 -1
- package/dist/lib/node-esm/{chunk-SDMGJZLN.mjs → chunk-6C34FO4C.mjs} +135 -117
- package/dist/lib/node-esm/chunk-6C34FO4C.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-K3R3YK3S.mjs → chunk-CKANLRS4.mjs} +105 -78
- package/dist/lib/node-esm/chunk-CKANLRS4.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-54HDN33F.mjs → chunk-KUQ3ZTRX.mjs} +21 -31
- package/dist/lib/node-esm/chunk-KUQ3ZTRX.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +29 -17
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/{intent-resolver-FCTNJPWY.mjs → intent-resolver-ACGAPLDZ.mjs} +4 -4
- package/dist/lib/node-esm/{intent-resolver-FCTNJPWY.mjs.map → intent-resolver-ACGAPLDZ.mjs.map} +2 -2
- package/dist/lib/node-esm/{meeting-transcription-state-XMZJ45P4.mjs → meeting-transcription-state-3WOZ52BQ.mjs} +2 -2
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-PXFSIM6V.mjs → react-surface-G2OY4MWL.mjs} +18 -7
- 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-REAGRCPY.mjs → transcriber-NVVFH7IF.mjs} +4 -4
- 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 +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +1 -0
- package/dist/types/src/capabilities/index.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/components/Transcript/Transcript.d.ts +6 -4
- package/dist/types/src/components/Transcript/Transcript.d.ts.map +1 -1
- package/dist/types/src/components/Transcript/Transcript.stories.d.ts +8 -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 +4 -4
- package/dist/types/src/components/Transcript/transcript-extension.d.ts.map +1 -1
- 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 +33 -7
- package/dist/types/src/entity-extraction/entity-extraction.d.ts.map +1 -1
- package/dist/types/src/hooks/useQueueModelAdapter.d.ts +2 -2
- package/dist/types/src/hooks/useQueueModelAdapter.d.ts.map +1 -1
- package/dist/types/src/model/model.d.ts +23 -23
- package/dist/types/src/model/model.d.ts.map +1 -1
- 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.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/package.json +51 -46
- package/src/TranscriptionPlugin.tsx +29 -12
- package/src/capabilities/app-graph-builder.ts +99 -29
- package/src/capabilities/capabilities.ts +1 -1
- package/src/capabilities/index.ts +1 -0
- package/src/capabilities/intent-resolver.ts +2 -2
- package/src/capabilities/react-surface.tsx +12 -4
- package/src/capabilities/settings.ts +20 -0
- package/src/components/Transcript/Transcript.stories.tsx +71 -35
- package/src/components/Transcript/Transcript.tsx +37 -30
- package/src/components/Transcript/deprecated/{Transcript.tsx → OldTranscript.tsx} +30 -1
- package/src/components/Transcript/transcript-extension.ts +20 -17
- package/src/components/TranscriptContainer.tsx +6 -4
- 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 +83 -29
- package/src/entity-extraction/entity-extraction.test.ts +75 -10
- package/src/entity-extraction/entity-extraction.ts +110 -55
- package/src/entity-extraction/system-prompt.tpl +38 -9
- package/src/hooks/useQueueModelAdapter.ts +44 -11
- package/src/model/model.test.ts +90 -44
- package/src/model/model.ts +59 -59
- package/src/testing/index.ts +5 -0
- package/src/testing/testing.ts +221 -0
- package/src/transcriber/transcriber.browser.test.ts +3 -3
- package/src/transcriber/transcriber.ts +19 -10
- package/src/transcriber/transcription-manager.ts +66 -57
- package/src/translations.ts +2 -0
- package/src/types/schema.ts +10 -31
- package/src/types/types.ts +17 -7
- package/dist/lib/browser/app-graph-builder-I4SSIQMW.mjs +0 -168
- package/dist/lib/browser/app-graph-builder-I4SSIQMW.mjs.map +0 -7
- package/dist/lib/browser/chunk-5Q3R53U3.mjs.map +0 -7
- package/dist/lib/browser/chunk-DR3NBV6Q.mjs.map +0 -7
- package/dist/lib/browser/chunk-GI5LZ4SV.mjs +0 -8
- package/dist/lib/browser/chunk-GI5LZ4SV.mjs.map +0 -7
- package/dist/lib/browser/chunk-RHHJZQPM.mjs.map +0 -7
- package/dist/lib/browser/react-surface-HETJ5XY6.mjs.map +0 -7
- package/dist/lib/node/app-graph-builder-WWC4WNTG.cjs +0 -177
- package/dist/lib/node/app-graph-builder-WWC4WNTG.cjs.map +0 -7
- package/dist/lib/node/chunk-3QEJ5EBO.cjs.map +0 -7
- package/dist/lib/node/chunk-KO6MKCED.cjs.map +0 -7
- package/dist/lib/node/chunk-LA73IHCB.cjs.map +0 -7
- package/dist/lib/node/chunk-WXG4Z2EZ.cjs.map +0 -7
- package/dist/lib/node/react-surface-M2JQIIDY.cjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-PPJQAFSI.mjs +0 -169
- package/dist/lib/node-esm/app-graph-builder-PPJQAFSI.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-54HDN33F.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-K3R3YK3S.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SDMGJZLN.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-XY22OP6H.mjs +0 -10
- package/dist/lib/node-esm/chunk-XY22OP6H.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-PXFSIM6V.mjs.map +0 -7
- package/dist/types/src/components/Transcript/deprecated/Transcript.d.ts +0 -13
- package/dist/types/src/components/Transcript/deprecated/Transcript.d.ts.map +0 -1
- package/dist/types/src/components/Transcript/testings.d.ts +0 -51
- package/dist/types/src/components/Transcript/testings.d.ts.map +0 -1
- package/dist/types/src/testing/test-data.d.ts +0 -73
- package/dist/types/src/testing/test-data.d.ts.map +0 -1
- package/src/components/Transcript/testings.ts +0 -182
- package/src/testing/test-data.ts +0 -314
- /package/dist/lib/browser/{TranscriptContainer-4D4BHE7G.mjs.map → TranscriptContainer-3LU3XBEB.mjs.map} +0 -0
- /package/dist/lib/browser/{meeting-transcription-state-5D52VTHU.mjs.map → meeting-transcription-state-MNA2XROE.mjs.map} +0 -0
- /package/dist/lib/browser/{transcriber-SMRLU2KY.mjs.map → transcriber-QRSS6X6S.mjs.map} +0 -0
- /package/dist/lib/node/{meeting-transcription-state-OYWCY5XE.cjs.map → meeting-transcription-state-5XLTMWPA.cjs.map} +0 -0
- /package/dist/lib/node/{transcriber-E6AAB4SU.cjs.map → transcriber-UZJMG44C.cjs.map} +0 -0
- /package/dist/lib/node-esm/{TranscriptContainer-3HJ752CP.mjs.map → TranscriptContainer-K4E4P5T6.mjs.map} +0 -0
- /package/dist/lib/node-esm/{meeting-transcription-state-XMZJ45P4.mjs.map → meeting-transcription-state-3WOZ52BQ.mjs.map} +0 -0
- /package/dist/lib/node-esm/{transcriber-REAGRCPY.mjs.map → transcriber-NVVFH7IF.mjs.map} +0 -0
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transcriber.d.ts","sourceRoot":"","sources":["../../../../src/transcriber/transcriber.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,OAAO,EAAkB,QAAQ,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"transcriber.d.ts","sourceRoot":"","sources":["../../../../src/transcriber/transcriber.ts"],"names":[],"mappings":"AAOA,OAAO,EAAE,KAAK,OAAO,EAAkB,QAAQ,EAAE,MAAM,eAAe,CAAC;AAEvE,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AAG7C,OAAO,EAAE,KAAK,aAAa,EAAmB,MAAM,kBAAkB,CAAC;AAuCvE,MAAM,MAAM,gBAAgB,GAAG;IAC7B;;OAEG;IACH,2BAA2B,EAAE,MAAM,CAAC;IAEpC;;;OAGG;IACH,wBAAwB,EAAE,MAAM,CAAC;CAClC,CAAC;AAEF,MAAM,MAAM,iBAAiB,GAAG;IAC9B,MAAM,EAAE,gBAAgB,CAAC;IACzB,QAAQ,EAAE,aAAa,CAAC;IACxB,UAAU,EAAE,CAAC,QAAQ,EAAE,QAAQ,CAAC,YAAY,CAAC,aAAa,EAAE,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;CAChF,CAAC;AAEF;;;;GAIG;AACH,qBAAa,WAAY,SAAQ,QAAQ;IACvC,OAAO,CAAC,YAAY,CAAoB;IACxC,OAAO,CAAC,kBAAkB,CAAK;IAE/B,OAAO,CAAC,QAAQ,CAAC,YAAY,CAAoC;IAEjE,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAmB;IAC3C,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAgB;IAC1C,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAkC;IAE9D,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,eAAe,CAAC,CAA2B;gBAEvC,EAAE,MAAM,EAAE,QAAQ,EAAE,UAAU,EAAE,EAAE,iBAAiB;cAOtC,KAAK,CAAC,GAAG,EAAE,OAAO;cAQlB,MAAM;IAO/B,oBAAoB;IASpB,mBAAmB;IAUnB,OAAO,CAAC,eAAe;YAgBT,WAAW;IAoBzB,OAAO,CAAC,cAAc;YAOR,iBAAiB;YAejB,mBAAmB;IA+BjC,OAAO,CAAC,cAAc;CAqCvB"}
|
|
@@ -1,37 +1,39 @@
|
|
|
1
1
|
import { Resource } from '@dxos/context';
|
|
2
|
-
import { type
|
|
2
|
+
import { type DXN } from '@dxos/keys';
|
|
3
3
|
import { type EdgeHttpClient } from '@dxos/react-edge-client';
|
|
4
|
-
import {
|
|
5
|
-
|
|
4
|
+
import { DataType } from '@dxos/schema';
|
|
5
|
+
export type TranscriptMessageEnricher = (message: DataType.Message) => Promise<DataType.Message>;
|
|
6
|
+
export type TranscriptionManagerOptions = {
|
|
7
|
+
edgeClient: EdgeHttpClient;
|
|
8
|
+
/**
|
|
9
|
+
* Enrich the message before it is written to the transcription queue.
|
|
10
|
+
*/
|
|
11
|
+
messageEnricher?: TranscriptMessageEnricher;
|
|
12
|
+
};
|
|
6
13
|
/**
|
|
7
14
|
* Manages transcription state for a meeting.
|
|
8
15
|
*/
|
|
9
16
|
export declare class TranscriptionManager extends Resource {
|
|
10
17
|
private readonly _edgeClient;
|
|
18
|
+
private readonly _messageEnricher?;
|
|
11
19
|
private _audioStreamTrack?;
|
|
12
|
-
private
|
|
13
|
-
private _hue?;
|
|
20
|
+
private _identityDid?;
|
|
14
21
|
private _mediaRecorder?;
|
|
15
22
|
private _transcriber?;
|
|
16
|
-
private _enabled;
|
|
17
23
|
private _queue?;
|
|
18
|
-
|
|
24
|
+
private _enabled;
|
|
25
|
+
constructor(options: TranscriptionManagerOptions);
|
|
19
26
|
protected _open(): Promise<void>;
|
|
20
27
|
protected _close(): Promise<void>;
|
|
21
|
-
|
|
28
|
+
setQueue(queueDxn: DXN): TranscriptionManager;
|
|
29
|
+
setIdentityDid(did: string): TranscriptionManager;
|
|
30
|
+
setRecording(recording?: boolean): TranscriptionManager;
|
|
22
31
|
/**
|
|
23
32
|
* Enable or disable transcription.
|
|
24
33
|
* @param enabled - Whether to enable transcription.
|
|
25
34
|
*/
|
|
26
35
|
setEnabled(enabled?: boolean): Promise<void>;
|
|
27
36
|
setAudioTrack(track?: MediaStreamTrack): Promise<void>;
|
|
28
|
-
/**
|
|
29
|
-
* Set the queue to save the transcription to.
|
|
30
|
-
* @param queue - The queue to save the transcription to or the DXN of the queue.
|
|
31
|
-
*/
|
|
32
|
-
setQueue(queue?: Queue<TranscriptBlock> | string): void;
|
|
33
|
-
setName(name: string): void;
|
|
34
|
-
setHue(hue: HuePalette): void;
|
|
35
37
|
private _toggleTranscriber;
|
|
36
38
|
private _maybeReinitTranscriber;
|
|
37
39
|
private _onSegments;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transcription-manager.d.ts","sourceRoot":"","sources":["../../../../src/transcriber/transcription-manager.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"transcription-manager.d.ts","sourceRoot":"","sources":["../../../../src/transcriber/transcription-manager.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AAGzC,OAAO,EAAE,KAAK,GAAG,EAAE,MAAM,YAAY,CAAC;AAEtC,OAAO,EAAE,KAAK,cAAc,EAAE,MAAM,yBAAyB,CAAC;AAC9D,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAqBxC,MAAM,MAAM,yBAAyB,GAAG,CAAC,OAAO,EAAE,QAAQ,CAAC,OAAO,KAAK,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;AAEjG,MAAM,MAAM,2BAA2B,GAAG;IACxC,UAAU,EAAE,cAAc,CAAC;IAE3B;;OAEG;IACH,eAAe,CAAC,EAAE,yBAAyB,CAAC;CAC7C,CAAC;AAEF;;GAEG;AACH,qBAAa,oBAAqB,SAAQ,QAAQ;IAChD,OAAO,CAAC,QAAQ,CAAC,WAAW,CAAiB;IAC7C,OAAO,CAAC,QAAQ,CAAC,gBAAgB,CAAC,CAA4B;IAC9D,OAAO,CAAC,iBAAiB,CAAC,CAA+B;IACzD,OAAO,CAAC,YAAY,CAAC,CAAqB;IAC1C,OAAO,CAAC,cAAc,CAAC,CAAkC;IACzD,OAAO,CAAC,YAAY,CAAC,CAA0B;IAC/C,OAAO,CAAC,MAAM,CAAC,CAAsC;IACrD,OAAO,CAAC,QAAQ,CAAS;gBAEb,OAAO,EAAE,2BAA2B;cAMvB,KAAK;cAIL,MAAM;IAI/B,QAAQ,CAAC,QAAQ,EAAE,GAAG,GAAG,oBAAoB;IAQ7C,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,oBAAoB;IAOjD,YAAY,CAAC,SAAS,CAAC,EAAE,OAAO,GAAG,oBAAoB;IAavD;;;OAGG;IAEG,UAAU,CAAC,OAAO,CAAC,EAAE,OAAO;IAW5B,aAAa,CAAC,KAAK,CAAC,EAAE,gBAAgB;YAU9B,kBAAkB;YAwBlB,uBAAuB;YA2BvB,WAAW;CAiB1B"}
|
|
@@ -10,6 +10,7 @@ declare const _default: {
|
|
|
10
10
|
'delete button'?: undefined;
|
|
11
11
|
'bookmark button'?: undefined;
|
|
12
12
|
'scroll to end label'?: undefined;
|
|
13
|
+
'settings entity extraction label'?: undefined;
|
|
13
14
|
} | {
|
|
14
15
|
'plugin name': string;
|
|
15
16
|
'transcript companion label': string;
|
|
@@ -18,6 +19,7 @@ declare const _default: {
|
|
|
18
19
|
'delete button': string;
|
|
19
20
|
'bookmark button': string;
|
|
20
21
|
'scroll to end label': string;
|
|
22
|
+
'settings entity extraction label': string;
|
|
21
23
|
'typename label'?: undefined;
|
|
22
24
|
'object name placeholder'?: undefined;
|
|
23
25
|
};
|
|
@@ -29,6 +31,7 @@ declare const _default: {
|
|
|
29
31
|
'delete button': string;
|
|
30
32
|
'bookmark button': string;
|
|
31
33
|
'scroll to end label': string;
|
|
34
|
+
'settings entity extraction label': string;
|
|
32
35
|
};
|
|
33
36
|
};
|
|
34
37
|
}[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAOA,wBAsBE"}
|
|
@@ -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.String;
|
|
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.String;
|
|
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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-transcription",
|
|
3
|
-
"version": "0.8.2-main.
|
|
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",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"@codemirror/view": "^6.34.1",
|
|
37
37
|
"@preact/signals-core": "^1.6.0",
|
|
38
38
|
"date-fns": "^3.3.1",
|
|
39
|
-
"effect": "3.
|
|
39
|
+
"effect": "3.14.21",
|
|
40
40
|
"extendable-media-recorder": "^9.2.19",
|
|
41
41
|
"extendable-media-recorder-wav-encoder": "^7.0.123",
|
|
42
42
|
"main-thread-scheduling": "^14.1.1",
|
|
@@ -44,60 +44,65 @@
|
|
|
44
44
|
"react-router-dom": "^6.4.0",
|
|
45
45
|
"react-use": "^17.5.1",
|
|
46
46
|
"wavefile": "^11.0.0",
|
|
47
|
-
"@dxos/app-framework": "0.8.2-main.
|
|
48
|
-
"@dxos/
|
|
49
|
-
"@dxos/
|
|
50
|
-
"@dxos/async": "0.8.2-main.
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/codec-protobuf": "0.8.2-main.
|
|
53
|
-
"@dxos/context": "0.8.2-main.
|
|
54
|
-
"@dxos/
|
|
55
|
-
"@dxos/
|
|
56
|
-
"@dxos/
|
|
57
|
-
"@dxos/
|
|
58
|
-
"@dxos/echo-schema": "0.8.2-main.
|
|
59
|
-
"@dxos/
|
|
60
|
-
"@dxos/
|
|
61
|
-
"@dxos/
|
|
62
|
-
"@dxos/
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/plugin-
|
|
65
|
-
"@dxos/
|
|
66
|
-
"@dxos/
|
|
67
|
-
"@dxos/plugin-
|
|
68
|
-
"@dxos/
|
|
69
|
-
"@dxos/
|
|
70
|
-
"@dxos/
|
|
71
|
-
"@dxos/react-
|
|
72
|
-
"@dxos/react-
|
|
73
|
-
"@dxos/react-ui-
|
|
74
|
-
"@dxos/react-ui-
|
|
75
|
-
"@dxos/react-ui-
|
|
76
|
-
"@dxos/
|
|
77
|
-
"@dxos/
|
|
78
|
-
"@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"
|
|
79
83
|
},
|
|
80
84
|
"devDependencies": {
|
|
81
85
|
"@types/react": "~18.2.0",
|
|
82
86
|
"react": "~18.2.0",
|
|
83
87
|
"react-dom": "~18.2.0",
|
|
84
88
|
"tailwindcss": "~3.4.1",
|
|
85
|
-
"@dxos/plugin-preview": "0.8.2-main.
|
|
86
|
-
"@dxos/plugin-storybook-layout": "0.8.2-main.
|
|
87
|
-
"@dxos/plugin-theme": "0.8.2-main.
|
|
88
|
-
"@dxos/
|
|
89
|
-
"@dxos/
|
|
90
|
-
"@dxos/react-ui-
|
|
91
|
-
"@dxos/react-ui-
|
|
92
|
-
"@dxos/react-ui-
|
|
93
|
-
"@dxos/test-utils": "0.8.2-main.
|
|
94
|
-
"@dxos/storybook-utils": "0.8.2-main.
|
|
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"
|
|
95
99
|
},
|
|
96
100
|
"optionalDependencies": {
|
|
101
|
+
"effect": "^3.13.3",
|
|
97
102
|
"react": "~18.2.0",
|
|
98
103
|
"react-dom": "~18.2.0",
|
|
99
|
-
"@dxos/react-ui": "0.8.2-main.
|
|
100
|
-
"@dxos/react-ui
|
|
104
|
+
"@dxos/react-ui-theme": "0.8.2-main.2f9c567",
|
|
105
|
+
"@dxos/react-ui": "0.8.2-main.2f9c567"
|
|
101
106
|
},
|
|
102
107
|
"publishConfig": {
|
|
103
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,24 +2,31 @@
|
|
|
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';
|
|
20
|
+
import { MeetingType, type MeetingCallProperties } from '@dxos/plugin-meeting/types';
|
|
15
21
|
import { type buf } from '@dxos/protocols/buf';
|
|
16
22
|
import { type TranscriptionPayloadSchema } from '@dxos/protocols/buf/dxos/edge/calls_pb';
|
|
17
|
-
import {
|
|
23
|
+
import { DataType } from '@dxos/schema';
|
|
18
24
|
|
|
19
25
|
import { TranscriptionCapabilities } from './capabilities';
|
|
26
|
+
import { processTranscriptMessage } from '../entity-extraction';
|
|
20
27
|
import { TRANSCRIPTION_PLUGIN } from '../meta';
|
|
21
28
|
import { TranscriptionManager } from '../transcriber';
|
|
22
|
-
import { TranscriptionAction, TranscriptType } from '../types';
|
|
29
|
+
import { TranscriptionAction, type TranscriptionSettingsProps, TranscriptType } from '../types';
|
|
23
30
|
|
|
24
31
|
// TODO(wittjosiah): Factor out.
|
|
25
32
|
// TODO(wittjosiah): Can we stop using protobuf for this?
|
|
@@ -49,8 +56,7 @@ export default (context: PluginsContext) =>
|
|
|
49
56
|
contributes(Capabilities.AppGraphBuilder, [
|
|
50
57
|
createExtension({
|
|
51
58
|
id: `${TRANSCRIPTION_PLUGIN}/meeting-transcript`,
|
|
52
|
-
filter: (node): node is Node<MeetingType> =>
|
|
53
|
-
isInstanceOf(MeetingType, node.data) && node.type !== PLANK_COMPANION_TYPE,
|
|
59
|
+
filter: (node): node is Node<MeetingType> => isInstanceOf(MeetingType, node.data),
|
|
54
60
|
actions: ({ node }) => {
|
|
55
61
|
const meeting = node.data;
|
|
56
62
|
const state = context.requestCapability(TranscriptionCapabilities.MeetingTranscriptionState);
|
|
@@ -61,14 +67,13 @@ export default (context: PluginsContext) =>
|
|
|
61
67
|
// NOTE: We are not saving the state of the transcription manager here.
|
|
62
68
|
// We expect the state to be updated through `onCallStateUpdated` once it is propagated through Swarm.
|
|
63
69
|
// This is done to avoid race conditions and to not handle optimistic updates.
|
|
64
|
-
|
|
65
70
|
const transcript = await getMeetingTranscript(context, meeting);
|
|
66
71
|
invariant(transcript, 'Failed to create transcript');
|
|
67
72
|
|
|
68
|
-
const
|
|
69
|
-
|
|
70
|
-
enabled: !state.enabled,
|
|
73
|
+
const callManager = context.requestCapability(MeetingCapabilities.CallManager);
|
|
74
|
+
callManager.setActivity(getSchemaTypename(TranscriptType)!, {
|
|
71
75
|
queueDxn: transcript.queue.dxn.toString(),
|
|
76
|
+
enabled: !state.enabled,
|
|
72
77
|
});
|
|
73
78
|
},
|
|
74
79
|
properties: {
|
|
@@ -86,6 +91,14 @@ export default (context: PluginsContext) =>
|
|
|
86
91
|
const meeting = node.data;
|
|
87
92
|
const client = context.requestCapability(ClientCapabilities.Client);
|
|
88
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
|
+
});
|
|
89
102
|
|
|
90
103
|
return [
|
|
91
104
|
{
|
|
@@ -95,29 +108,45 @@ export default (context: PluginsContext) =>
|
|
|
95
108
|
properties: {
|
|
96
109
|
label: ['transcript companion label', { ns: TRANSCRIPTION_PLUGIN }],
|
|
97
110
|
icon: 'ph--subtitles--regular',
|
|
111
|
+
position: 'hoist',
|
|
98
112
|
disposition: 'hidden',
|
|
99
113
|
schema: TranscriptType,
|
|
100
114
|
getIntent: ({ space }: { space: Space }) =>
|
|
101
115
|
createIntent(TranscriptionAction.Create, { spaceId: space.id }),
|
|
102
|
-
|
|
103
|
-
|
|
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 }) => {
|
|
104
119
|
const identity = client.halo.identity.get();
|
|
105
120
|
invariant(identity);
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
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();
|
|
114
143
|
},
|
|
115
|
-
onLeave: () => {
|
|
116
|
-
|
|
144
|
+
onLeave: async () => {
|
|
145
|
+
await state.transcriptionManager?.close();
|
|
117
146
|
state.transcriptionManager = undefined;
|
|
118
147
|
state.enabled = false;
|
|
119
148
|
},
|
|
120
|
-
onCallStateUpdated: (callState: CallState) => {
|
|
149
|
+
onCallStateUpdated: async (callState: CallState) => {
|
|
121
150
|
const typename = getSchemaTypename(TranscriptType);
|
|
122
151
|
const transcription = typename ? callState.activities?.[typename] : undefined;
|
|
123
152
|
if (!transcription?.payload) {
|
|
@@ -126,16 +155,57 @@ export default (context: PluginsContext) =>
|
|
|
126
155
|
|
|
127
156
|
const payload: TranscriptionPayload = transcription.payload;
|
|
128
157
|
state.enabled = !!payload.enabled;
|
|
129
|
-
|
|
130
|
-
|
|
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);
|
|
131
163
|
},
|
|
132
|
-
onMediaStateUpdated: ([mediaState, isSpeaking]: [MediaState, boolean]) => {
|
|
164
|
+
onMediaStateUpdated: async ([mediaState, isSpeaking]: [MediaState, boolean]) => {
|
|
133
165
|
void state.transcriptionManager?.setAudioTrack(mediaState.audioTrack);
|
|
134
166
|
void state.transcriptionManager?.setRecording(isSpeaking);
|
|
135
167
|
},
|
|
136
|
-
},
|
|
168
|
+
} satisfies MeetingCallProperties,
|
|
137
169
|
},
|
|
138
170
|
];
|
|
139
171
|
},
|
|
140
172
|
}),
|
|
141
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;
|