@dxos/plugin-transcription 0.8.2-main.f11618f → 0.8.2-staging.7ac8446
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-D3EH2SLO.mjs → TranscriptContainer-JQ3HFHLQ.mjs} +2 -3
- package/dist/lib/browser/app-graph-builder-VDQOVX7P.mjs +191 -0
- package/dist/lib/browser/app-graph-builder-VDQOVX7P.mjs.map +7 -0
- package/dist/lib/browser/chunk-G4B6CPC2.mjs +253 -0
- package/dist/lib/browser/chunk-G4B6CPC2.mjs.map +7 -0
- package/dist/lib/browser/{chunk-KLD7O5GJ.mjs → chunk-GU2BNYKZ.mjs} +12 -2
- package/dist/lib/browser/chunk-GU2BNYKZ.mjs.map +7 -0
- package/dist/lib/browser/chunk-K7FOYAXO.mjs +8 -0
- package/dist/lib/browser/chunk-K7FOYAXO.mjs.map +7 -0
- package/dist/lib/browser/{chunk-YRWBY6UK.mjs → chunk-OGNXNGJB.mjs} +27 -15
- package/dist/lib/browser/chunk-OGNXNGJB.mjs.map +7 -0
- package/dist/lib/browser/{chunk-KSUYWWIU.mjs → chunk-YCZISX63.mjs} +81 -108
- package/dist/lib/browser/chunk-YCZISX63.mjs.map +7 -0
- package/dist/lib/browser/{chunk-LTIQFX4W.mjs → chunk-YEPT334A.mjs} +1 -1
- package/dist/lib/browser/chunk-YEPT334A.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +209 -46
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/{intent-resolver-ZWKYRFE7.mjs → intent-resolver-4R66ZCKT.mjs} +8 -8
- package/dist/lib/browser/intent-resolver-4R66ZCKT.mjs.map +7 -0
- package/dist/lib/browser/{meeting-transcription-state-MNA2XROE.mjs → meeting-transcription-state-DLFHQK72.mjs} +4 -4
- package/dist/lib/browser/meeting-transcription-state-DLFHQK72.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-F7DBDGHS.mjs → react-surface-FQUHU5G7.mjs} +6 -18
- package/dist/lib/browser/react-surface-FQUHU5G7.mjs.map +7 -0
- package/dist/lib/browser/{transcriber-MSBS4VBI.mjs → transcriber-LGMIWDYI.mjs} +7 -8
- package/dist/lib/browser/{transcriber-MSBS4VBI.mjs.map → transcriber-LGMIWDYI.mjs.map} +3 -3
- package/dist/lib/browser/types/index.mjs +3 -3
- package/dist/lib/node/{TranscriptContainer-WCBZMA5K.cjs → TranscriptContainer-QEYTTT2V.cjs} +7 -8
- package/dist/lib/node/TranscriptContainer-QEYTTT2V.cjs.map +7 -0
- package/dist/lib/node/app-graph-builder-IFSIVNUR.cjs +200 -0
- package/dist/lib/node/app-graph-builder-IFSIVNUR.cjs.map +7 -0
- package/dist/lib/node/{chunk-J72PUQ3C.cjs → chunk-3KHUSQNW.cjs} +15 -6
- package/dist/lib/node/chunk-3KHUSQNW.cjs.map +7 -0
- package/dist/lib/node/{chunk-JUGOXWES.cjs → chunk-CZMLKKWT.cjs} +4 -4
- package/dist/lib/node/chunk-CZMLKKWT.cjs.map +7 -0
- package/dist/lib/node/{chunk-7XIIUVN3.cjs → chunk-FCCJALOT.cjs} +83 -111
- package/dist/lib/node/chunk-FCCJALOT.cjs.map +7 -0
- package/dist/lib/node/{chunk-OCHTKDL7.cjs → chunk-LP4FG423.cjs} +8 -23
- package/dist/lib/node/chunk-LP4FG423.cjs.map +7 -0
- package/dist/lib/node/{chunk-IXU57SCA.cjs → chunk-P4VVD6ZO.cjs} +27 -15
- package/dist/lib/node/chunk-P4VVD6ZO.cjs.map +7 -0
- package/dist/lib/node/chunk-UOFHT4GZ.cjs +280 -0
- package/dist/lib/node/chunk-UOFHT4GZ.cjs.map +7 -0
- package/dist/lib/node/index.cjs +237 -65
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/{intent-resolver-RM4JOCDV.cjs → intent-resolver-WMMCOUEH.cjs} +10 -11
- package/dist/lib/node/intent-resolver-WMMCOUEH.cjs.map +7 -0
- package/dist/lib/node/{meeting-transcription-state-5XLTMWPA.cjs → meeting-transcription-state-URIYILEQ.cjs} +7 -7
- package/dist/lib/node/meeting-transcription-state-URIYILEQ.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-surface-7F37EYZA.cjs → react-surface-WI2MGWCC.cjs} +10 -20
- package/dist/lib/node/react-surface-WI2MGWCC.cjs.map +7 -0
- package/dist/lib/node/{transcriber-55OE4X6I.cjs → transcriber-QG5WPKX4.cjs} +13 -14
- package/dist/lib/node/{transcriber-55OE4X6I.cjs.map → transcriber-QG5WPKX4.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-GBPY6KKA.mjs → TranscriptContainer-ZXUCOWGY.mjs} +2 -3
- package/dist/lib/node-esm/app-graph-builder-UL6XLIZY.mjs +192 -0
- package/dist/lib/node-esm/app-graph-builder-UL6XLIZY.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-6X7X2UZF.mjs +254 -0
- package/dist/lib/node-esm/chunk-6X7X2UZF.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-OS2ITZUL.mjs → chunk-GIO6J6FE.mjs} +27 -15
- package/dist/lib/node-esm/chunk-GIO6J6FE.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-QMHMEKB3.mjs → chunk-HKATMD34.mjs} +12 -2
- package/dist/lib/node-esm/chunk-HKATMD34.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-J4D2RBBH.mjs +10 -0
- package/dist/lib/node-esm/chunk-J4D2RBBH.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-5E2MR5XK.mjs → chunk-PTZHDZ36.mjs} +1 -1
- package/dist/lib/node-esm/chunk-PTZHDZ36.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-UWF6LM27.mjs → chunk-YQYBLFNI.mjs} +81 -108
- package/dist/lib/node-esm/chunk-YQYBLFNI.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +209 -46
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/{intent-resolver-HDRFXMKP.mjs → intent-resolver-QN2LO5TX.mjs} +8 -8
- package/dist/lib/node-esm/intent-resolver-QN2LO5TX.mjs.map +7 -0
- package/dist/lib/node-esm/{meeting-transcription-state-3WOZ52BQ.mjs → meeting-transcription-state-ZYVRAW6Y.mjs} +4 -4
- package/dist/lib/node-esm/meeting-transcription-state-ZYVRAW6Y.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-D3L6VBEV.mjs → react-surface-PCH6NTVB.mjs} +6 -18
- package/dist/lib/node-esm/react-surface-PCH6NTVB.mjs.map +7 -0
- package/dist/lib/node-esm/{transcriber-HH7EMCGH.mjs → transcriber-TMPYZ5L4.mjs} +7 -8
- package/dist/lib/node-esm/{transcriber-HH7EMCGH.mjs.map → transcriber-TMPYZ5L4.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 +7 -5
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +4 -2
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/meeting-transcription-state.d.ts +4 -2
- 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/transcriber.d.ts.map +1 -1
- package/dist/types/src/components/Transcript/Transcript.d.ts +4 -14
- package/dist/types/src/components/Transcript/Transcript.d.ts.map +1 -1
- package/dist/types/src/components/Transcript/Transcript.stories.d.ts +4 -19
- package/dist/types/src/components/Transcript/Transcript.stories.d.ts.map +1 -1
- package/dist/types/src/components/TranscriptContainer.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/transcription.stories.d.ts +3 -6
- package/dist/types/src/components/transcription.stories.d.ts.map +1 -1
- package/dist/types/src/hooks/index.d.ts +0 -1
- package/dist/types/src/hooks/index.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/transcriber/transcriber.d.ts +2 -2
- package/dist/types/src/transcriber/transcriber.d.ts.map +1 -1
- package/dist/types/src/transcriber/transcriber.test.d.ts +2 -0
- package/dist/types/src/transcriber/transcriber.test.d.ts.map +1 -0
- package/dist/types/src/transcriber/transcription-manager.d.ts +15 -17
- package/dist/types/src/transcriber/transcription-manager.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +0 -3
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +28 -7
- 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/dist/types/src/util/index.d.ts +1 -0
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/src/util/random-queue-dxn.d.ts +3 -0
- package/dist/types/src/util/random-queue-dxn.d.ts.map +1 -0
- package/package.json +39 -50
- package/src/TranscriptionPlugin.tsx +12 -29
- package/src/capabilities/app-graph-builder.ts +52 -111
- package/src/capabilities/capabilities.ts +3 -4
- package/src/capabilities/index.ts +0 -1
- package/src/capabilities/intent-resolver.ts +5 -5
- package/src/capabilities/meeting-transcription-state.ts +2 -2
- package/src/capabilities/react-surface.tsx +4 -12
- package/src/capabilities/transcriber.ts +1 -2
- package/src/components/Transcript/Transcript.stories.tsx +43 -201
- package/src/components/Transcript/Transcript.tsx +208 -83
- package/src/components/TranscriptContainer.tsx +6 -11
- package/src/components/index.ts +0 -1
- package/src/components/transcription.stories.tsx +60 -157
- package/src/hooks/index.ts +0 -1
- package/src/hooks/useTranscriber.ts +2 -3
- package/src/transcriber/{transcriber.browser.test.ts → transcriber.test.ts} +3 -3
- package/src/transcriber/transcriber.ts +11 -17
- package/src/transcriber/transcription-manager.ts +58 -67
- package/src/translations.ts +0 -2
- package/src/types/schema.ts +28 -5
- package/src/types/types.ts +5 -13
- package/src/util/index.ts +1 -0
- package/src/util/random-queue-dxn.ts +9 -0
- package/dist/lib/browser/app-graph-builder-7HN3M24G.mjs +0 -349
- package/dist/lib/browser/app-graph-builder-7HN3M24G.mjs.map +0 -7
- package/dist/lib/browser/chunk-BSZSM6KA.mjs +0 -720
- package/dist/lib/browser/chunk-BSZSM6KA.mjs.map +0 -7
- package/dist/lib/browser/chunk-IWZ7C3OA.mjs +0 -27
- package/dist/lib/browser/chunk-IWZ7C3OA.mjs.map +0 -7
- package/dist/lib/browser/chunk-KLD7O5GJ.mjs.map +0 -7
- package/dist/lib/browser/chunk-KSUYWWIU.mjs.map +0 -7
- package/dist/lib/browser/chunk-LTIQFX4W.mjs.map +0 -7
- package/dist/lib/browser/chunk-YRWBY6UK.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-ZWKYRFE7.mjs.map +0 -7
- package/dist/lib/browser/meeting-transcription-state-MNA2XROE.mjs.map +0 -7
- package/dist/lib/browser/react-surface-F7DBDGHS.mjs.map +0 -7
- package/dist/lib/browser/settings-6YAHKVKX.mjs +0 -24
- package/dist/lib/browser/settings-6YAHKVKX.mjs.map +0 -7
- package/dist/lib/node/TranscriptContainer-WCBZMA5K.cjs.map +0 -7
- package/dist/lib/node/app-graph-builder-BVWYUGUO.cjs +0 -350
- package/dist/lib/node/app-graph-builder-BVWYUGUO.cjs.map +0 -7
- package/dist/lib/node/chunk-7XIIUVN3.cjs.map +0 -7
- package/dist/lib/node/chunk-IXU57SCA.cjs.map +0 -7
- package/dist/lib/node/chunk-J72PUQ3C.cjs.map +0 -7
- package/dist/lib/node/chunk-JSCC2AQW.cjs +0 -737
- package/dist/lib/node/chunk-JSCC2AQW.cjs.map +0 -7
- package/dist/lib/node/chunk-JUGOXWES.cjs.map +0 -7
- package/dist/lib/node/chunk-OCHTKDL7.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-RM4JOCDV.cjs.map +0 -7
- package/dist/lib/node/meeting-transcription-state-5XLTMWPA.cjs.map +0 -7
- package/dist/lib/node/react-surface-7F37EYZA.cjs.map +0 -7
- package/dist/lib/node/settings-ZMB4XRWS.cjs +0 -38
- package/dist/lib/node/settings-ZMB4XRWS.cjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-QK25O5K5.mjs +0 -350
- package/dist/lib/node-esm/app-graph-builder-QK25O5K5.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-5E2MR5XK.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-B2BD7S4X.mjs +0 -721
- package/dist/lib/node-esm/chunk-B2BD7S4X.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-DXJN2JWV.mjs +0 -28
- package/dist/lib/node-esm/chunk-DXJN2JWV.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-OS2ITZUL.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-QMHMEKB3.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UWF6LM27.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-HDRFXMKP.mjs.map +0 -7
- package/dist/lib/node-esm/meeting-transcription-state-3WOZ52BQ.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-D3L6VBEV.mjs.map +0 -7
- package/dist/lib/node-esm/settings-I35TVDUG.mjs +0 -25
- package/dist/lib/node-esm/settings-I35TVDUG.mjs.map +0 -7
- 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/Transcript/deprecated/OldTranscript.d.ts +0 -27
- package/dist/types/src/components/Transcript/deprecated/OldTranscript.d.ts.map +0 -1
- package/dist/types/src/components/Transcript/transcript-extension.d.ts +0 -19
- package/dist/types/src/components/Transcript/transcript-extension.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/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/dist/types/src/hooks/useQueueModelAdapter.d.ts +0 -7
- package/dist/types/src/hooks/useQueueModelAdapter.d.ts.map +0 -1
- package/dist/types/src/model/index.d.ts +0 -2
- package/dist/types/src/model/index.d.ts.map +0 -1
- package/dist/types/src/model/model.d.ts +0 -68
- package/dist/types/src/model/model.d.ts.map +0 -1
- package/dist/types/src/model/model.test.d.ts +0 -2
- package/dist/types/src/model/model.test.d.ts.map +0 -1
- package/dist/types/src/testing/index.d.ts +0 -2
- package/dist/types/src/testing/index.d.ts.map +0 -1
- package/dist/types/src/testing/testing.d.ts +0 -39
- package/dist/types/src/testing/testing.d.ts.map +0 -1
- package/dist/types/src/transcriber/transcriber.browser.test.d.ts +0 -2
- package/dist/types/src/transcriber/transcriber.browser.test.d.ts.map +0 -1
- package/src/capabilities/settings.ts +0 -20
- package/src/components/Transcript/deprecated/OldTranscript.tsx +0 -254
- package/src/components/Transcript/transcript-extension.ts +0 -236
- package/src/components/TranscriptionSettings/TranscriptionSettings.tsx +0 -26
- package/src/components/TranscriptionSettings/index.ts +0 -5
- 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/src/hooks/useQueueModelAdapter.ts +0 -63
- package/src/model/index.ts +0 -5
- package/src/model/model.test.ts +0 -165
- package/src/model/model.ts +0 -229
- package/src/testing/index.ts +0 -5
- package/src/testing/testing.ts +0 -208
- /package/dist/lib/browser/{TranscriptContainer-D3EH2SLO.mjs.map → TranscriptContainer-JQ3HFHLQ.mjs.map} +0 -0
- /package/dist/lib/node-esm/{TranscriptContainer-GBPY6KKA.mjs.map → TranscriptContainer-ZXUCOWGY.mjs.map} +0 -0
|
@@ -2,35 +2,39 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import type { Schema } from 'effect';
|
|
6
|
-
|
|
7
5
|
import { Capabilities, contributes, createIntent, type PluginsContext } from '@dxos/app-framework';
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { getSchemaTypename, isInstanceOf, type BaseEchoObject } from '@dxos/echo-schema';
|
|
6
|
+
import { fullyQualifiedId, getSpace, makeRef, type Space } from '@dxos/client/echo';
|
|
7
|
+
import { generateName } from '@dxos/display-name';
|
|
8
|
+
import { getSchemaTypename, isInstanceOf } from '@dxos/echo-schema';
|
|
12
9
|
import { invariant } from '@dxos/invariant';
|
|
13
|
-
import { DXN } from '@dxos/keys';
|
|
14
|
-
import { log } from '@dxos/log';
|
|
15
10
|
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
16
11
|
import { PLANK_COMPANION_TYPE, ATTENDABLE_PATH_SEPARATOR } from '@dxos/plugin-deck/types';
|
|
17
12
|
import { createExtension, type Node } from '@dxos/plugin-graph';
|
|
18
|
-
import { DocumentType } from '@dxos/plugin-markdown/types';
|
|
19
13
|
import { MeetingCapabilities, type CallState, type MediaState } from '@dxos/plugin-meeting';
|
|
20
|
-
import { MeetingType
|
|
21
|
-
import {
|
|
22
|
-
import {
|
|
23
|
-
|
|
14
|
+
import { MeetingType } from '@dxos/plugin-meeting/types';
|
|
15
|
+
import { buf } from '@dxos/protocols/buf';
|
|
16
|
+
import {
|
|
17
|
+
TranscriptionPayloadSchema,
|
|
18
|
+
type TranscriptionPayload as TranscriptionPayloadProto,
|
|
19
|
+
} from '@dxos/protocols/buf/dxos/edge/calls_pb';
|
|
20
|
+
import { keyToFallback } from '@dxos/util';
|
|
24
21
|
|
|
25
22
|
import { TranscriptionCapabilities } from './capabilities';
|
|
26
|
-
import { processTranscriptMessage } from '../entity-extraction';
|
|
27
23
|
import { TRANSCRIPTION_PLUGIN } from '../meta';
|
|
28
24
|
import { TranscriptionManager } from '../transcriber';
|
|
29
|
-
import { TranscriptionAction,
|
|
25
|
+
import { TranscriptionAction, TranscriptType } from '../types';
|
|
30
26
|
|
|
31
27
|
// TODO(wittjosiah): Factor out.
|
|
32
28
|
// TODO(wittjosiah): Can we stop using protobuf for this?
|
|
33
29
|
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
|
+
};
|
|
34
38
|
|
|
35
39
|
const getMeetingTranscript = async (
|
|
36
40
|
context: PluginsContext,
|
|
@@ -56,7 +60,8 @@ export default (context: PluginsContext) =>
|
|
|
56
60
|
contributes(Capabilities.AppGraphBuilder, [
|
|
57
61
|
createExtension({
|
|
58
62
|
id: `${TRANSCRIPTION_PLUGIN}/meeting-transcript`,
|
|
59
|
-
filter: (node): node is Node<MeetingType> =>
|
|
63
|
+
filter: (node): node is Node<MeetingType> =>
|
|
64
|
+
isInstanceOf(MeetingType, node.data) && node.type !== PLANK_COMPANION_TYPE,
|
|
60
65
|
actions: ({ node }) => {
|
|
61
66
|
const meeting = node.data;
|
|
62
67
|
const state = context.requestCapability(TranscriptionCapabilities.MeetingTranscriptionState);
|
|
@@ -64,25 +69,26 @@ export default (context: PluginsContext) =>
|
|
|
64
69
|
{
|
|
65
70
|
id: `${fullyQualifiedId(meeting)}/action/start-stop-transcription`,
|
|
66
71
|
data: async () => {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
72
|
+
const call = context.requestCapability(MeetingCapabilities.CallManager);
|
|
73
|
+
invariant(state.transcriptionManager);
|
|
74
|
+
state.enabled = !state.enabled;
|
|
75
|
+
void state.transcriptionManager.setEnabled(state.enabled);
|
|
70
76
|
const transcript = await getMeetingTranscript(context, meeting);
|
|
71
77
|
invariant(transcript, 'Failed to create transcript');
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
78
|
+
call.setActivity(getSchemaTypename(TranscriptType)!, {
|
|
79
|
+
value: codec.encode({
|
|
80
|
+
enabled: state.enabled,
|
|
81
|
+
queueDxn: transcript.queue.dxn.toString(),
|
|
82
|
+
}),
|
|
77
83
|
});
|
|
78
84
|
},
|
|
79
85
|
properties: {
|
|
80
86
|
label: state.enabled
|
|
81
87
|
? ['stop transcription label', { ns: TRANSCRIPTION_PLUGIN }]
|
|
82
88
|
: ['start transcription label', { ns: TRANSCRIPTION_PLUGIN }],
|
|
83
|
-
icon: 'ph--
|
|
89
|
+
icon: 'ph--record--regular',
|
|
84
90
|
disposition: 'toolbar',
|
|
85
|
-
classNames: state.enabled ? '
|
|
91
|
+
classNames: state.enabled ? 'text-activeInCall' : '',
|
|
86
92
|
},
|
|
87
93
|
},
|
|
88
94
|
];
|
|
@@ -91,14 +97,6 @@ export default (context: PluginsContext) =>
|
|
|
91
97
|
const meeting = node.data;
|
|
92
98
|
const client = context.requestCapability(ClientCapabilities.Client);
|
|
93
99
|
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
|
-
});
|
|
102
100
|
|
|
103
101
|
return [
|
|
104
102
|
{
|
|
@@ -108,104 +106,47 @@ export default (context: PluginsContext) =>
|
|
|
108
106
|
properties: {
|
|
109
107
|
label: ['transcript companion label', { ns: TRANSCRIPTION_PLUGIN }],
|
|
110
108
|
icon: 'ph--subtitles--regular',
|
|
111
|
-
position: 'hoist',
|
|
112
109
|
disposition: 'hidden',
|
|
113
110
|
schema: TranscriptType,
|
|
114
111
|
getIntent: ({ space }: { space: Space }) =>
|
|
115
112
|
createIntent(TranscriptionAction.Create, { spaceId: space.id }),
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
onJoin: async ({ meeting }: { meeting: MeetingType; roomId: string }) => {
|
|
113
|
+
onJoin: () => {
|
|
114
|
+
const transcriptionManager = new TranscriptionManager(client.edge);
|
|
119
115
|
const identity = client.halo.identity.get();
|
|
120
116
|
invariant(identity);
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
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, Contact, 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();
|
|
117
|
+
transcriptionManager.setName(
|
|
118
|
+
identity.profile?.displayName ?? generateName(identity.identityKey.toHex()),
|
|
119
|
+
);
|
|
120
|
+
const fallbackValue = keyToFallback(identity!.identityKey);
|
|
121
|
+
const userHue = identity!.profile?.data?.hue || fallbackValue.hue;
|
|
122
|
+
transcriptionManager.setHue(userHue);
|
|
123
|
+
void transcriptionManager.open();
|
|
124
|
+
state.transcriptionManager = transcriptionManager;
|
|
143
125
|
},
|
|
144
|
-
onLeave:
|
|
145
|
-
|
|
126
|
+
onLeave: () => {
|
|
127
|
+
void state.transcriptionManager?.close();
|
|
146
128
|
state.transcriptionManager = undefined;
|
|
147
129
|
state.enabled = false;
|
|
148
130
|
},
|
|
149
|
-
onCallStateUpdated:
|
|
131
|
+
onCallStateUpdated: (callState: CallState) => {
|
|
150
132
|
const typename = getSchemaTypename(TranscriptType);
|
|
151
133
|
const transcription = typename ? callState.activities?.[typename] : undefined;
|
|
152
|
-
if (!transcription?.payload) {
|
|
134
|
+
if (!transcription?.payload?.value) {
|
|
153
135
|
return;
|
|
154
136
|
}
|
|
155
137
|
|
|
156
|
-
const payload
|
|
157
|
-
state.enabled =
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
state.transcriptionManager?.setQueue(DXN.parse(payload.queueDxn));
|
|
161
|
-
}
|
|
162
|
-
await state.transcriptionManager?.setEnabled(payload.enabled);
|
|
138
|
+
const payload = codec.decode(transcription.payload.value);
|
|
139
|
+
state.enabled = payload.enabled;
|
|
140
|
+
void state.transcriptionManager?.setEnabled(payload.enabled);
|
|
141
|
+
void state.transcriptionManager?.setQueue(payload.queueDxn);
|
|
163
142
|
},
|
|
164
|
-
onMediaStateUpdated:
|
|
143
|
+
onMediaStateUpdated: ([mediaState, isSpeaking]: [MediaState, boolean]) => {
|
|
165
144
|
void state.transcriptionManager?.setAudioTrack(mediaState.audioTrack);
|
|
166
145
|
void state.transcriptionManager?.setRecording(isSpeaking);
|
|
167
146
|
},
|
|
168
|
-
}
|
|
147
|
+
},
|
|
169
148
|
},
|
|
170
149
|
];
|
|
171
150
|
},
|
|
172
151
|
}),
|
|
173
152
|
]);
|
|
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: MessageType) => {
|
|
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 ReactiveObject } 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,14 +12,13 @@ export namespace TranscriptionCapabilities {
|
|
|
12
12
|
export type GetTranscriberProps = {
|
|
13
13
|
audioStreamTrack: MediaStreamTrack;
|
|
14
14
|
onSegments: TranscriberParams['onSegments'];
|
|
15
|
-
config?: TranscriberParams['config'];
|
|
16
15
|
};
|
|
17
16
|
export type GetTranscriber = (props: GetTranscriberProps) => Transcriber;
|
|
18
17
|
export const Transcriber = defineCapability<GetTranscriber>(`${TRANSCRIPTION_PLUGIN}/capability/transcriber`);
|
|
19
18
|
|
|
20
|
-
export type MeetingTranscriptionState =
|
|
19
|
+
export type MeetingTranscriptionState = ReactiveObject<{
|
|
20
|
+
enabled: boolean;
|
|
21
21
|
transcriptionManager?: TranscriptionManager;
|
|
22
|
-
enabled: boolean; // TODO(burdon): Move state into TranscriptionManager.
|
|
23
22
|
}>;
|
|
24
23
|
export const MeetingTranscriptionState = defineCapability<MeetingTranscriptionState>(
|
|
25
24
|
`${TRANSCRIPTION_PLUGIN}/capability/meeting-transcription-state`,
|
|
@@ -9,6 +9,5 @@ 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'));
|
|
13
12
|
|
|
14
13
|
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
|
|
6
|
+
import { create, refFromDXN } from '@dxos/live-object';
|
|
7
|
+
import { type SpaceId } from '@dxos/react-client/echo';
|
|
8
8
|
|
|
9
9
|
import { TranscriptionAction, TranscriptType } from '../types';
|
|
10
|
-
import { getTimeStr } from '../util';
|
|
10
|
+
import { getTimeStr, randomQueueDxn } 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 = create(TranscriptType, {
|
|
18
|
+
queue: refFromDXN(randomQueueDxn(spaceId as SpaceId)),
|
|
19
19
|
name: name ?? `Transcript ${getTimeStr(Date.now())}`,
|
|
20
20
|
});
|
|
21
21
|
|
|
@@ -3,12 +3,12 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { contributes } from '@dxos/app-framework';
|
|
6
|
-
import {
|
|
6
|
+
import { create } from '@dxos/live-object';
|
|
7
7
|
|
|
8
8
|
import { TranscriptionCapabilities } from './capabilities';
|
|
9
9
|
|
|
10
10
|
export default () => {
|
|
11
|
-
const state =
|
|
11
|
+
const state = create<TranscriptionCapabilities.MeetingTranscriptionState>({
|
|
12
12
|
enabled: false,
|
|
13
13
|
});
|
|
14
14
|
|
|
@@ -5,23 +5,15 @@
|
|
|
5
5
|
import React from 'react';
|
|
6
6
|
|
|
7
7
|
import { Capabilities, contributes, createSurface } from '@dxos/app-framework';
|
|
8
|
-
import { SettingsStore } from '@dxos/local-storage';
|
|
9
8
|
|
|
10
|
-
import { TranscriptionContainer
|
|
11
|
-
import {
|
|
12
|
-
import { isTranscript, type
|
|
9
|
+
import { TranscriptionContainer } from '../components';
|
|
10
|
+
import { TRANSCRIPTION_PLUGIN } from '../meta';
|
|
11
|
+
import { isTranscript, type TranscriptType } from '../types';
|
|
13
12
|
|
|
14
13
|
export default () =>
|
|
15
14
|
contributes(Capabilities.ReactSurface, [
|
|
16
15
|
createSurface({
|
|
17
|
-
id: `${
|
|
18
|
-
role: 'article',
|
|
19
|
-
filter: (data): data is { subject: SettingsStore<TranscriptionSettingsProps> } =>
|
|
20
|
-
data.subject instanceof SettingsStore && data.subject.prefix === meta.id,
|
|
21
|
-
component: ({ data: { subject } }) => <TranscriptionSettings settings={subject.value} />,
|
|
22
|
-
}),
|
|
23
|
-
createSurface({
|
|
24
|
-
id: `${meta.id}/article/transcript`,
|
|
16
|
+
id: `${TRANSCRIPTION_PLUGIN}/article/transcript`,
|
|
25
17
|
role: ['article', 'section'],
|
|
26
18
|
filter: (data): data is { subject: TranscriptType } => isTranscript(data.subject),
|
|
27
19
|
component: ({ data, role }) => <TranscriptionContainer transcript={data.subject} role={role} />,
|
|
@@ -29,13 +29,12 @@ const TRANSCRIBE_AFTER_CHUNKS_AMOUNT = 50;
|
|
|
29
29
|
* Records audio while user is speaking and transcribes it after user is done speaking.
|
|
30
30
|
*/
|
|
31
31
|
export default () => {
|
|
32
|
-
const getTranscriber: TranscriptionCapabilities.GetTranscriber = ({ audioStreamTrack, onSegments
|
|
32
|
+
const getTranscriber: TranscriptionCapabilities.GetTranscriber = ({ audioStreamTrack, onSegments }) => {
|
|
33
33
|
// Initialize audio transcription.
|
|
34
34
|
return new Transcriber({
|
|
35
35
|
config: {
|
|
36
36
|
transcribeAfterChunksAmount: TRANSCRIBE_AFTER_CHUNKS_AMOUNT,
|
|
37
37
|
prefixBufferChunksAmount: PREFIXED_CHUNKS_AMOUNT,
|
|
38
|
-
...config,
|
|
39
38
|
},
|
|
40
39
|
recorder: new MediaStreamRecorder({
|
|
41
40
|
mediaStreamTrack: audioStreamTrack,
|
|
@@ -4,200 +4,60 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import { type
|
|
8
|
-
import React, {
|
|
7
|
+
import { type StoryObj, type Meta } from '@storybook/react';
|
|
8
|
+
import React, { useEffect, useState } from 'react';
|
|
9
9
|
|
|
10
|
-
import { IntentPlugin, SettingsPlugin } from '@dxos/app-framework';
|
|
11
|
-
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
12
|
-
import { ObjectId } from '@dxos/echo-schema';
|
|
13
|
-
import { ClientPlugin } from '@dxos/plugin-client';
|
|
14
|
-
import { PreviewPlugin } from '@dxos/plugin-preview';
|
|
15
|
-
import { SpacePlugin } from '@dxos/plugin-space';
|
|
16
|
-
import { StorybookLayoutPlugin } from '@dxos/plugin-storybook-layout';
|
|
17
|
-
import { ThemePlugin } from '@dxos/plugin-theme';
|
|
18
10
|
import { faker } from '@dxos/random';
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
21
|
-
import { SyntaxHighlighter } from '@dxos/react-ui-syntax-highlighter';
|
|
22
|
-
import { defaultTx } from '@dxos/react-ui-theme';
|
|
23
|
-
import { Contact, Organization, type MessageType } from '@dxos/schema';
|
|
24
|
-
import { Testing } from '@dxos/schema/testing';
|
|
25
|
-
import { withLayout } from '@dxos/storybook-utils';
|
|
11
|
+
import { hues } from '@dxos/react-ui-theme';
|
|
12
|
+
import { withTheme, withLayout } from '@dxos/storybook-utils';
|
|
26
13
|
|
|
27
|
-
import {
|
|
28
|
-
import { useQueueModelAdapter } from '../../hooks';
|
|
29
|
-
import { SerializationModel } from '../../model';
|
|
30
|
-
import {
|
|
31
|
-
MessageBuilder,
|
|
32
|
-
TestItem,
|
|
33
|
-
useTestTranscriptionQueue,
|
|
34
|
-
useTestTranscriptionQueueWithEntityExtraction,
|
|
35
|
-
} from '../../testing';
|
|
14
|
+
import { Transcript } from './Transcript';
|
|
36
15
|
import translations from '../../translations';
|
|
37
16
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
*/
|
|
43
|
-
const TranscriptContainer: FC<
|
|
44
|
-
TranscriptProps & {
|
|
45
|
-
running: boolean;
|
|
46
|
-
onRunningChange: (running: boolean) => void;
|
|
47
|
-
onReset?: () => void;
|
|
48
|
-
}
|
|
49
|
-
> = ({ space, model, running, onRunningChange, onReset }) => {
|
|
50
|
-
return (
|
|
51
|
-
<div className='grid grid-rows-[1fr_40px] grow divide-y divide-separator'>
|
|
52
|
-
<Transcript space={space} model={model} />
|
|
53
|
-
<div className='grid grid-cols-[1fr_16rem] overflow-hidden'>
|
|
54
|
-
<div className='flex items-center'>
|
|
55
|
-
<SyntaxHighlighter language='json' className='text-sm'>
|
|
56
|
-
{JSON.stringify(model.toJSON())}
|
|
57
|
-
</SyntaxHighlighter>
|
|
58
|
-
</div>
|
|
59
|
-
<Toolbar.Root classNames='justify-end'>
|
|
60
|
-
<IconButton
|
|
61
|
-
icon={running ? 'ph--pause--regular' : 'ph--play--regular'}
|
|
62
|
-
label={running ? 'Pause' : 'Start'}
|
|
63
|
-
onClick={() => onRunningChange(!running)}
|
|
64
|
-
/>
|
|
65
|
-
{onReset && <IconButton icon='ph--x--regular' label='Reset' onClick={onReset} />}
|
|
66
|
-
</Toolbar.Root>
|
|
67
|
-
</div>
|
|
68
|
-
</div>
|
|
69
|
-
);
|
|
17
|
+
let start = new Date(Date.now() - 24 * 60 * 60 * 10_000);
|
|
18
|
+
const next = () => {
|
|
19
|
+
start = new Date(start.getTime() + Math.random() * 10_000);
|
|
20
|
+
return start;
|
|
70
21
|
};
|
|
71
22
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
const
|
|
78
|
-
const
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
useEffect(() => {
|
|
87
|
-
if (!running) {
|
|
88
|
-
return;
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
if (!currentMessage) {
|
|
92
|
-
void builder.createMessage().then((message) => {
|
|
93
|
-
model.appendChunk(message);
|
|
94
|
-
setCurrentMessage(message);
|
|
95
|
-
});
|
|
96
|
-
return;
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
const i = setInterval(() => {
|
|
100
|
-
if (currentMessage?.blocks.length && currentMessage.blocks.length >= 3) {
|
|
101
|
-
setCurrentMessage(null);
|
|
102
|
-
clearInterval(i);
|
|
103
|
-
return;
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
currentMessage.blocks.push(builder.createBlock());
|
|
107
|
-
model.updateChunk(currentMessage);
|
|
108
|
-
}, 3_000);
|
|
109
|
-
|
|
110
|
-
return () => clearInterval(i);
|
|
111
|
-
}, [model, currentMessage, running]);
|
|
112
|
-
|
|
113
|
-
const handleReset = () => {
|
|
114
|
-
setCurrentMessage(null);
|
|
115
|
-
setRunning(false);
|
|
116
|
-
setReset({});
|
|
23
|
+
const users = Array.from({ length: 5 }, () => ({
|
|
24
|
+
authorName: faker.person.fullName(),
|
|
25
|
+
authorHue: faker.helpers.arrayElement(hues),
|
|
26
|
+
}));
|
|
27
|
+
|
|
28
|
+
const createBlock = () => {
|
|
29
|
+
const author = faker.helpers.arrayElement(users);
|
|
30
|
+
return {
|
|
31
|
+
id: faker.string.uuid(),
|
|
32
|
+
...author,
|
|
33
|
+
segments: Array.from({ length: 1 + Math.floor(Math.random() * 2) }, () => ({
|
|
34
|
+
started: next(),
|
|
35
|
+
text: faker.lorem.paragraph(),
|
|
36
|
+
})),
|
|
117
37
|
};
|
|
118
|
-
|
|
119
|
-
return (
|
|
120
|
-
<TranscriptContainer
|
|
121
|
-
model={model}
|
|
122
|
-
running={running}
|
|
123
|
-
onRunningChange={setRunning}
|
|
124
|
-
onReset={handleReset}
|
|
125
|
-
{...props}
|
|
126
|
-
/>
|
|
127
|
-
);
|
|
128
38
|
};
|
|
129
39
|
|
|
130
|
-
|
|
131
|
-
* Queue story mutates queue with model adapter.
|
|
132
|
-
*/
|
|
133
|
-
const QueueStory = ({
|
|
134
|
-
messages: initialMessages = [],
|
|
135
|
-
queueId,
|
|
136
|
-
onReset,
|
|
137
|
-
...props
|
|
138
|
-
}: StoryProps & { queueId: ObjectId; onReset: () => void }) => {
|
|
139
|
-
const [running, setRunning] = useState(true);
|
|
140
|
-
const space = useSpace();
|
|
141
|
-
const members = useMembers(space?.key).map((member) => member.identity);
|
|
142
|
-
const queue = useTestTranscriptionQueue(space, queueId, running, 2_000);
|
|
143
|
-
const model = useQueueModelAdapter(renderMarkdown(members), queue, initialMessages);
|
|
144
|
-
|
|
145
|
-
return (
|
|
146
|
-
<TranscriptContainer
|
|
147
|
-
space={space}
|
|
148
|
-
model={model}
|
|
149
|
-
running={running}
|
|
150
|
-
onRunningChange={setRunning}
|
|
151
|
-
onReset={onReset}
|
|
152
|
-
{...props}
|
|
153
|
-
/>
|
|
154
|
-
);
|
|
155
|
-
};
|
|
156
|
-
|
|
157
|
-
// TODO(burdon): Reconcile with QueueStory.
|
|
158
|
-
const EntityExtractionQueueStory = () => {
|
|
159
|
-
const [running, setRunning] = useState(true);
|
|
160
|
-
const space = useSpace();
|
|
161
|
-
const members = useMembers(space?.key).map((member) => member.identity);
|
|
162
|
-
const queue = useTestTranscriptionQueueWithEntityExtraction(space, undefined, running, 2_000);
|
|
163
|
-
const model = useQueueModelAdapter(renderMarkdown(members), queue, []);
|
|
164
|
-
|
|
165
|
-
return <TranscriptContainer space={space} model={model} running={running} onRunningChange={setRunning} />;
|
|
166
|
-
};
|
|
167
|
-
|
|
168
|
-
/**
|
|
169
|
-
* Wrapper remounts on refresh to reload queue.
|
|
170
|
-
*/
|
|
171
|
-
const QueueStoryWrapper = () => {
|
|
172
|
-
const [queueId] = useState(ObjectId.random());
|
|
173
|
-
const [key, setKey] = useState(ObjectId.random().toString());
|
|
174
|
-
const handleReset = () => {
|
|
175
|
-
setKey(ObjectId.random().toString());
|
|
176
|
-
};
|
|
177
|
-
|
|
178
|
-
return <QueueStory key={key} queueId={queueId} onReset={handleReset} />;
|
|
179
|
-
};
|
|
180
|
-
|
|
181
|
-
const meta: Meta<typeof QueueStory> = {
|
|
40
|
+
const meta: Meta<typeof Transcript> = {
|
|
182
41
|
title: 'plugins/plugin-transcription/Transcript',
|
|
42
|
+
component: Transcript,
|
|
43
|
+
render: ({ blocks: initialBlocks = [], ...args }) => {
|
|
44
|
+
const [blocks, setBlocks] = useState(initialBlocks);
|
|
45
|
+
useEffect(() => {
|
|
46
|
+
const i = setInterval(() => {
|
|
47
|
+
setBlocks((blocks) => [...blocks, createBlock()]);
|
|
48
|
+
}, 1_000);
|
|
49
|
+
|
|
50
|
+
return () => clearInterval(i);
|
|
51
|
+
}, []);
|
|
52
|
+
|
|
53
|
+
return <Transcript {...args} blocks={blocks} />;
|
|
54
|
+
},
|
|
183
55
|
decorators: [
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
ClientPlugin({
|
|
189
|
-
types: [TestItem, Testing.DocumentType, Contact, Organization],
|
|
190
|
-
onClientInitialized: async (_, client) => {
|
|
191
|
-
await client.halo.createIdentity();
|
|
192
|
-
},
|
|
193
|
-
}),
|
|
194
|
-
PreviewPlugin(),
|
|
195
|
-
SpacePlugin(),
|
|
196
|
-
SettingsPlugin(),
|
|
197
|
-
IntentPlugin(),
|
|
198
|
-
],
|
|
56
|
+
withTheme,
|
|
57
|
+
withLayout({
|
|
58
|
+
tooltips: true,
|
|
59
|
+
fullscreen: true,
|
|
199
60
|
}),
|
|
200
|
-
withLayout({ tooltips: true, fullscreen: true }),
|
|
201
61
|
],
|
|
202
62
|
parameters: {
|
|
203
63
|
translations,
|
|
@@ -206,35 +66,17 @@ const meta: Meta<typeof QueueStory> = {
|
|
|
206
66
|
|
|
207
67
|
export default meta;
|
|
208
68
|
|
|
209
|
-
type Story = StoryObj<typeof
|
|
69
|
+
type Story = StoryObj<typeof Transcript>;
|
|
210
70
|
|
|
211
71
|
export const Default: Story = {
|
|
212
|
-
render: BasicStory,
|
|
213
72
|
args: {
|
|
214
73
|
ignoreAttention: true,
|
|
215
74
|
attendableId: 'story',
|
|
216
|
-
|
|
75
|
+
blocks: Array.from({ length: 10 }, createBlock),
|
|
217
76
|
},
|
|
218
77
|
};
|
|
219
78
|
|
|
220
79
|
export const Empty: Story = {
|
|
221
|
-
render: BasicStory,
|
|
222
|
-
args: {
|
|
223
|
-
ignoreAttention: true,
|
|
224
|
-
attendableId: 'story',
|
|
225
|
-
},
|
|
226
|
-
};
|
|
227
|
-
|
|
228
|
-
export const WithQueue: Story = {
|
|
229
|
-
render: QueueStoryWrapper,
|
|
230
|
-
args: {
|
|
231
|
-
ignoreAttention: true,
|
|
232
|
-
attendableId: 'story',
|
|
233
|
-
},
|
|
234
|
-
};
|
|
235
|
-
|
|
236
|
-
export const WithEntityExtractionQueue: Story = {
|
|
237
|
-
render: EntityExtractionQueueStory,
|
|
238
80
|
args: {
|
|
239
81
|
ignoreAttention: true,
|
|
240
82
|
attendableId: 'story',
|