@dxos/plugin-transcription 0.8.3 → 0.8.4-main.1068cf700f
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-MV3JBKLS.mjs +12 -0
- package/dist/lib/browser/blueprint-definition-K3E72ZBC.mjs +19 -0
- package/dist/lib/browser/blueprint-definition-K3E72ZBC.mjs.map +7 -0
- package/dist/lib/browser/blueprints/index.mjs +9 -0
- package/dist/lib/browser/chunk-AV44VISC.mjs +148 -0
- package/dist/lib/browser/chunk-AV44VISC.mjs.map +7 -0
- package/dist/lib/browser/chunk-HOOPZ7EM.mjs +35 -0
- package/dist/lib/browser/chunk-HOOPZ7EM.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs.map +7 -0
- package/dist/lib/browser/{chunk-53AXUEIQ.mjs → chunk-K3JJ46VV.mjs} +367 -433
- package/dist/lib/browser/chunk-K3JJ46VV.mjs.map +7 -0
- package/dist/lib/browser/chunk-Q5OC3WVG.mjs +72 -0
- package/dist/lib/browser/chunk-Q5OC3WVG.mjs.map +7 -0
- package/dist/lib/browser/{chunk-UDCCT32F.mjs → chunk-RUKY36XW.mjs} +3 -3
- package/dist/lib/browser/{chunk-IQ5ZRMHZ.mjs → chunk-TKFU53OZ.mjs} +70 -105
- package/dist/lib/browser/chunk-TKFU53OZ.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +68 -75
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operation-resolver-GLEBGPKH.mjs +22 -0
- package/dist/lib/browser/operation-resolver-GLEBGPKH.mjs.map +7 -0
- package/dist/lib/browser/react-surface-AWZ2A5WZ.mjs +35 -0
- package/dist/lib/browser/react-surface-AWZ2A5WZ.mjs.map +7 -0
- package/dist/lib/browser/{transcriber-OYPLZFG5.mjs → transcriber-SLVQP76E.mjs} +17 -13
- package/dist/lib/browser/transcriber-SLVQP76E.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +8 -8
- package/dist/lib/node-esm/{TranscriptContainer-G75LDEO5.mjs → TranscriptContainer-7M43UAZ2.mjs} +5 -4
- package/dist/lib/node-esm/TranscriptContainer-7M43UAZ2.mjs.map +7 -0
- package/dist/lib/node-esm/blueprint-definition-2WIDDA3Y.mjs +20 -0
- package/dist/lib/node-esm/blueprint-definition-2WIDDA3Y.mjs.map +7 -0
- package/dist/lib/node-esm/blueprints/index.mjs +10 -0
- package/dist/lib/node-esm/blueprints/index.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-4BFY6P2D.mjs +73 -0
- package/dist/lib/node-esm/chunk-4BFY6P2D.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-PRL64SRU.mjs → chunk-EPC27WWV.mjs} +70 -105
- package/dist/lib/node-esm/chunk-EPC27WWV.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-NVM2QUMX.mjs +37 -0
- package/dist/lib/node-esm/chunk-NVM2QUMX.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-MFJO7EKD.mjs → chunk-SNZAN34I.mjs} +3 -3
- package/dist/lib/node-esm/{chunk-56QHOX4A.mjs → chunk-TIUYXGQN.mjs} +367 -433
- package/dist/lib/node-esm/chunk-TIUYXGQN.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-TTJBW7CY.mjs +149 -0
- package/dist/lib/node-esm/chunk-TTJBW7CY.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +68 -75
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/operation-resolver-SMCFTUFM.mjs +23 -0
- package/dist/lib/node-esm/operation-resolver-SMCFTUFM.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-YBBXC4W5.mjs +36 -0
- package/dist/lib/node-esm/react-surface-YBBXC4W5.mjs.map +7 -0
- package/dist/lib/node-esm/{transcriber-TVG2MBBN.mjs → transcriber-BO2N3UQ4.mjs} +17 -13
- package/dist/lib/node-esm/transcriber-BO2N3UQ4.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +8 -8
- package/dist/types/src/TranscriptionPlugin.d.ts +2 -1
- package/dist/types/src/TranscriptionPlugin.d.ts.map +1 -1
- package/dist/types/src/blueprints/index.d.ts +2 -0
- package/dist/types/src/blueprints/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/transcription-blueprint.d.ts +21 -0
- package/dist/types/src/blueprints/transcription-blueprint.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +10 -0
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts +3 -0
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +4 -4
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler/index.d.ts +3 -0
- package/dist/types/src/capabilities/operation-handler/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-handler/operation-handler.d.ts +5 -0
- package/dist/types/src/capabilities/operation-handler/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/transcriber/index.d.ts +3 -0
- package/dist/types/src/capabilities/transcriber/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/transcriber/transcriber.d.ts +9 -0
- package/dist/types/src/capabilities/transcriber/transcriber.d.ts.map +1 -0
- package/dist/types/src/components/Transcript/Transcript.d.ts +7 -10
- package/dist/types/src/components/Transcript/Transcript.d.ts.map +1 -1
- package/dist/types/src/components/Transcript/Transcript.stories.d.ts +34 -18
- package/dist/types/src/components/Transcript/Transcript.stories.d.ts.map +1 -1
- package/dist/types/src/components/Transcript/deprecated/OldTranscript.d.ts +12 -12
- package/dist/types/src/components/Transcript/deprecated/OldTranscript.d.ts.map +1 -1
- package/dist/types/src/components/Transcript/transcript-extension.d.ts +3 -7
- package/dist/types/src/components/Transcript/transcript-extension.d.ts.map +1 -1
- package/dist/types/src/components/TranscriptContainer.d.ts +5 -6
- package/dist/types/src/components/TranscriptContainer.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -4
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/components/stories/FileTranscription.stories.d.ts +8 -7
- package/dist/types/src/components/stories/FileTranscription.stories.d.ts.map +1 -1
- package/dist/types/src/components/stories/KeyWordRecognition.stories.d.ts +10 -6
- package/dist/types/src/components/stories/KeyWordRecognition.stories.d.ts.map +1 -1
- package/dist/types/src/components/stories/MicrophoneTranscription.stories.d.ts +10 -9
- package/dist/types/src/components/stories/MicrophoneTranscription.stories.d.ts.map +1 -1
- package/dist/types/src/components/stories/TranscriptionStory.d.ts +4 -3
- package/dist/types/src/components/stories/TranscriptionStory.d.ts.map +1 -1
- package/dist/types/src/functions/index.d.ts +3 -0
- package/dist/types/src/functions/index.d.ts.map +1 -0
- package/dist/types/src/functions/open.d.ts +11 -0
- package/dist/types/src/functions/open.d.ts.map +1 -0
- package/dist/types/src/functions/summarize.d.ts +11 -0
- package/dist/types/src/functions/summarize.d.ts.map +1 -0
- package/dist/types/src/hooks/useAudioFile.d.ts.map +1 -1
- package/dist/types/src/hooks/useQueueModelAdapter.d.ts +1 -1
- package/dist/types/src/hooks/useQueueModelAdapter.d.ts.map +1 -1
- package/dist/types/src/hooks/useTranscriber.d.ts +2 -2
- package/dist/types/src/hooks/useTranscriber.d.ts.map +1 -1
- package/dist/types/src/hooks/useVoiceInput.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -3
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/segments-normalization/message-normalizer.d.ts +5 -5
- package/dist/types/src/segments-normalization/message-normalizer.d.ts.map +1 -1
- package/dist/types/src/segments-normalization/normalization.d.ts +503 -311
- package/dist/types/src/segments-normalization/normalization.d.ts.map +1 -1
- package/dist/types/src/segments-normalization/utils.d.ts +2 -2
- package/dist/types/src/segments-normalization/utils.d.ts.map +1 -1
- package/dist/types/src/testing/testing.d.ts +10 -10
- package/dist/types/src/testing/testing.d.ts.map +1 -1
- package/dist/types/src/transcriber/index.d.ts +1 -1
- package/dist/types/src/transcriber/index.d.ts.map +1 -1
- package/dist/types/src/transcriber/media-stream-recorder.d.ts +3 -3
- package/dist/types/src/transcriber/media-stream-recorder.d.ts.map +1 -1
- package/dist/types/src/transcriber/transcriber.d.ts +4 -4
- package/dist/types/src/transcriber/transcriber.d.ts.map +1 -1
- package/dist/types/src/transcriber/transcription-manager.d.ts +12 -13
- package/dist/types/src/transcriber/transcription-manager.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +11 -11
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/TranscriptAction.d.ts +25 -0
- package/dist/types/src/types/TranscriptAction.d.ts.map +1 -0
- package/dist/types/src/types/capabilities.d.ts +18 -0
- package/dist/types/src/types/capabilities.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +3 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +0 -26
- 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/render-byline.d.ts +4 -0
- package/dist/types/src/util/render-byline.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +88 -72
- package/src/TranscriptionPlugin.tsx +40 -58
- package/src/blueprints/index.ts +5 -0
- package/src/blueprints/transcription-blueprint.ts +25 -0
- package/src/capabilities/blueprint-definition/blueprint-definition.ts +24 -0
- package/src/capabilities/blueprint-definition/index.ts +7 -0
- package/src/capabilities/index.ts +4 -7
- package/src/capabilities/operation-handler/index.ts +7 -0
- package/src/capabilities/operation-handler/operation-handler.ts +25 -0
- package/src/capabilities/operation-resolver/index.ts +7 -0
- package/src/capabilities/operation-resolver/operation-resolver.ts +25 -0
- package/src/capabilities/react-surface/index.ts +7 -0
- package/src/capabilities/react-surface/react-surface.tsx +28 -0
- package/src/capabilities/transcriber/index.ts +7 -0
- package/src/capabilities/transcriber/transcriber.ts +85 -0
- package/src/components/Transcript/Transcript.stories.tsx +61 -57
- package/src/components/Transcript/Transcript.tsx +25 -59
- package/src/components/Transcript/deprecated/OldTranscript.tsx +11 -11
- package/src/components/Transcript/transcript-extension.ts +13 -46
- package/src/components/TranscriptContainer.tsx +19 -15
- package/src/components/stories/FileTranscription.stories.tsx +80 -70
- package/src/components/stories/KeyWordRecognition.stories.tsx +17 -13
- package/src/components/stories/MicrophoneTranscription.stories.tsx +89 -87
- package/src/components/stories/TranscriptionStory.tsx +14 -14
- package/src/functions/index.ts +6 -0
- package/src/functions/open.ts +37 -0
- package/src/functions/summarize.ts +103 -0
- package/src/hooks/useAudioFile.ts +49 -53
- package/src/hooks/useQueueModelAdapter.ts +1 -1
- package/src/hooks/useTranscriber.ts +12 -7
- package/src/hooks/useVoiceInput.ts +4 -3
- package/src/index.ts +1 -1
- package/src/meta.ts +9 -6
- package/src/model/model.test.ts +27 -21
- package/src/segments-normalization/message-normalizer.ts +19 -14
- package/src/segments-normalization/normalization.test.ts +25 -32
- package/src/segments-normalization/normalization.ts +59 -49
- package/src/segments-normalization/utils.ts +2 -2
- package/src/testing/testing.ts +42 -32
- package/src/transcriber/index.ts +1 -1
- package/src/transcriber/media-stream-recorder.ts +4 -4
- package/src/transcriber/transcriber.browser.test.ts +6 -5
- package/src/transcriber/transcriber.ts +9 -11
- package/src/transcriber/transcription-manager.ts +37 -52
- package/src/translations.ts +6 -4
- package/src/types/TranscriptAction.ts +32 -0
- package/src/types/capabilities.ts +33 -0
- package/src/types/index.ts +3 -1
- package/src/types/types.ts +0 -23
- package/src/util/index.ts +1 -0
- package/src/util/render-byline.ts +33 -0
- package/dist/lib/browser/TranscriptContainer-H3AZQ4CQ.mjs +0 -11
- package/dist/lib/browser/chunk-53AXUEIQ.mjs.map +0 -7
- package/dist/lib/browser/chunk-GOF7MJNV.mjs +0 -19
- package/dist/lib/browser/chunk-GOF7MJNV.mjs.map +0 -7
- package/dist/lib/browser/chunk-IQ5ZRMHZ.mjs.map +0 -7
- package/dist/lib/browser/chunk-OSISJM2F.mjs +0 -55
- package/dist/lib/browser/chunk-OSISJM2F.mjs.map +0 -7
- package/dist/lib/browser/chunk-W2KNYJD6.mjs +0 -16
- package/dist/lib/browser/chunk-W2KNYJD6.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-BGADCHVM.mjs +0 -30
- package/dist/lib/browser/intent-resolver-BGADCHVM.mjs.map +0 -7
- package/dist/lib/browser/react-surface-HMJS5FSS.mjs +0 -34
- package/dist/lib/browser/react-surface-HMJS5FSS.mjs.map +0 -7
- package/dist/lib/browser/transcriber-OYPLZFG5.mjs.map +0 -7
- package/dist/lib/node/TranscriptContainer-KIG3GMAB.cjs +0 -32
- package/dist/lib/node/TranscriptContainer-KIG3GMAB.cjs.map +0 -7
- package/dist/lib/node/chunk-3PYT3BDM.cjs +0 -40
- package/dist/lib/node/chunk-3PYT3BDM.cjs.map +0 -7
- package/dist/lib/node/chunk-6LW5RA3K.cjs +0 -75
- package/dist/lib/node/chunk-6LW5RA3K.cjs.map +0 -7
- package/dist/lib/node/chunk-AFUZI63A.cjs +0 -42
- package/dist/lib/node/chunk-AFUZI63A.cjs.map +0 -7
- package/dist/lib/node/chunk-CVUN3UO7.cjs +0 -778
- package/dist/lib/node/chunk-CVUN3UO7.cjs.map +0 -7
- package/dist/lib/node/chunk-FKDJNJ57.cjs +0 -35
- package/dist/lib/node/chunk-FKDJNJ57.cjs.map +0 -7
- package/dist/lib/node/chunk-ZFAUMZXE.cjs +0 -518
- package/dist/lib/node/chunk-ZFAUMZXE.cjs.map +0 -7
- package/dist/lib/node/index.cjs +0 -133
- package/dist/lib/node/index.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-LL3TTI4H.cjs +0 -45
- package/dist/lib/node/intent-resolver-LL3TTI4H.cjs.map +0 -7
- package/dist/lib/node/meta.json +0 -1
- package/dist/lib/node/react-surface-N25TBBG4.cjs +0 -56
- package/dist/lib/node/react-surface-N25TBBG4.cjs.map +0 -7
- package/dist/lib/node/transcriber-6J4FVFSZ.cjs +0 -68
- package/dist/lib/node/transcriber-6J4FVFSZ.cjs.map +0 -7
- package/dist/lib/node/types/index.cjs +0 -36
- package/dist/lib/node/types/index.cjs.map +0 -7
- package/dist/lib/node-esm/chunk-56QHOX4A.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-FH75X4JC.mjs +0 -56
- package/dist/lib/node-esm/chunk-FH75X4JC.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-MFJPEIVB.mjs +0 -17
- package/dist/lib/node-esm/chunk-MFJPEIVB.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-PRL64SRU.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-TXMDLLBR.mjs +0 -21
- package/dist/lib/node-esm/chunk-TXMDLLBR.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-5LVCYSJS.mjs +0 -31
- package/dist/lib/node-esm/intent-resolver-5LVCYSJS.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-JGQSYGRR.mjs +0 -35
- package/dist/lib/node-esm/react-surface-JGQSYGRR.mjs.map +0 -7
- package/dist/lib/node-esm/transcriber-TVG2MBBN.mjs.map +0 -7
- package/dist/types/src/capabilities/capabilities.d.ts +0 -17
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface.d.ts +0 -4
- package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/transcriber.d.ts +0 -8
- package/dist/types/src/capabilities/transcriber.d.ts.map +0 -1
- package/dist/types/src/types/schema.d.ts +0 -41
- package/dist/types/src/types/schema.d.ts.map +0 -1
- package/src/capabilities/capabilities.ts +0 -33
- package/src/capabilities/intent-resolver.ts +0 -24
- package/src/capabilities/react-surface.tsx +0 -22
- package/src/capabilities/transcriber.ts +0 -76
- package/src/types/schema.ts +0 -41
- /package/dist/lib/browser/{TranscriptContainer-H3AZQ4CQ.mjs.map → TranscriptContainer-MV3JBKLS.mjs.map} +0 -0
- /package/dist/lib/{node-esm/TranscriptContainer-G75LDEO5.mjs.map → browser/blueprints/index.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-UDCCT32F.mjs.map → chunk-RUKY36XW.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-MFJO7EKD.mjs.map → chunk-SNZAN34I.mjs.map} +0 -0
|
@@ -2,40 +2,36 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@
|
|
6
|
-
|
|
7
|
-
import { type Meta, type StoryObj } from '@storybook/react';
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
8
7
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
9
8
|
|
|
10
|
-
import { EdgeAiServiceClient } from '@dxos/ai';
|
|
11
|
-
import { AI_SERVICE_ENDPOINT } from '@dxos/ai/testing';
|
|
12
|
-
import { Events, IntentPlugin, SettingsPlugin } from '@dxos/app-framework';
|
|
13
9
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
|
+
import { AppActivationEvents } from '@dxos/app-toolkit';
|
|
14
11
|
import { scheduleTask } from '@dxos/async';
|
|
15
12
|
import { Context } from '@dxos/context';
|
|
16
13
|
import { Obj } from '@dxos/echo';
|
|
14
|
+
import { createQueueDXN } from '@dxos/echo/internal';
|
|
17
15
|
import { MemoryQueue } from '@dxos/echo-db';
|
|
18
|
-
import {
|
|
19
|
-
import { FunctionExecutor, ServiceContainer } from '@dxos/functions';
|
|
16
|
+
import { FunctionExecutor, ServiceContainer } from '@dxos/functions-runtime';
|
|
20
17
|
import { log } from '@dxos/log';
|
|
21
18
|
import { ClientPlugin } from '@dxos/plugin-client';
|
|
22
19
|
import { PreviewPlugin } from '@dxos/plugin-preview';
|
|
23
|
-
import {
|
|
24
|
-
import {
|
|
25
|
-
import {
|
|
26
|
-
import {
|
|
27
|
-
import {
|
|
28
|
-
import { seedTestData, Testing } from '@dxos/schema/testing';
|
|
29
|
-
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
20
|
+
import { StorybookPlugin, corePlugins } from '@dxos/plugin-testing';
|
|
21
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
22
|
+
import { TestSchema } from '@dxos/schema/testing';
|
|
23
|
+
import { type Actor, Message, Organization, Person } from '@dxos/types';
|
|
24
|
+
import { seedTestData } from '@dxos/types/testing';
|
|
30
25
|
|
|
31
|
-
import { TranscriptionStory } from './TranscriptionStory';
|
|
32
|
-
import { useIsSpeaking } from './useIsSpeaking';
|
|
33
|
-
import { TranscriptionPlugin } from '../../TranscriptionPlugin';
|
|
34
26
|
import { useAudioFile, useQueueModelAdapter, useTranscriber } from '../../hooks';
|
|
35
|
-
import {
|
|
27
|
+
import { MessageNormalizer, getActorId } from '../../segments-normalization';
|
|
36
28
|
import { TestItem } from '../../testing';
|
|
37
|
-
import { type
|
|
38
|
-
import {
|
|
29
|
+
import { type MediaStreamRecorderProps, type TranscriberProps } from '../../transcriber';
|
|
30
|
+
import { TranscriptionPlugin } from '../../TranscriptionPlugin';
|
|
31
|
+
import { renderByline } from '../../util';
|
|
32
|
+
|
|
33
|
+
import { TranscriptionStory } from './TranscriptionStory';
|
|
34
|
+
import { useIsSpeaking } from './useIsSpeaking';
|
|
39
35
|
|
|
40
36
|
const AudioFile = ({
|
|
41
37
|
detectSpeaking,
|
|
@@ -48,12 +44,12 @@ const AudioFile = ({
|
|
|
48
44
|
detectSpeaking?: boolean;
|
|
49
45
|
normalizeSentences?: boolean;
|
|
50
46
|
audioUrl: string;
|
|
51
|
-
transcriberConfig?:
|
|
52
|
-
recorderConfig?:
|
|
47
|
+
transcriberConfig?: TranscriberProps['config'];
|
|
48
|
+
recorderConfig?: MediaStreamRecorderProps['config'];
|
|
53
49
|
audioConstraints?: MediaTrackConstraints;
|
|
54
50
|
}) => {
|
|
55
51
|
const [running, setRunning] = useState(false);
|
|
56
|
-
const actor:
|
|
52
|
+
const actor: Actor.Actor = useMemo(() => ({ name: 'You' }), []);
|
|
57
53
|
|
|
58
54
|
// Audio.
|
|
59
55
|
const { audio, track, stream } = useAudioFile(audioUrl, audioConstraints);
|
|
@@ -69,7 +65,6 @@ const AudioFile = ({
|
|
|
69
65
|
|
|
70
66
|
useEffect(() => {
|
|
71
67
|
if (!audio) {
|
|
72
|
-
log.warn('no audio');
|
|
73
68
|
return;
|
|
74
69
|
}
|
|
75
70
|
|
|
@@ -83,13 +78,18 @@ const AudioFile = ({
|
|
|
83
78
|
// Transcriber.
|
|
84
79
|
// TODO(dmaretskyi): Use space.queues.create() instead.
|
|
85
80
|
const queueDxn = useMemo(() => createQueueDXN(), []);
|
|
86
|
-
const queue = useMemo(() => new MemoryQueue<
|
|
81
|
+
const queue = useMemo(() => new MemoryQueue<Message.Message>(queueDxn), [queueDxn]);
|
|
87
82
|
|
|
88
|
-
const model = useQueueModelAdapter(
|
|
89
|
-
const handleSegments = useCallback<
|
|
83
|
+
const model = useQueueModelAdapter(renderByline([]), queue);
|
|
84
|
+
const handleSegments = useCallback<TranscriberProps['onSegments']>(
|
|
90
85
|
async (blocks) => {
|
|
91
|
-
|
|
92
|
-
|
|
86
|
+
void queue?.append([
|
|
87
|
+
Obj.make(Message.Message, {
|
|
88
|
+
created: new Date().toISOString(),
|
|
89
|
+
sender: actor,
|
|
90
|
+
blocks,
|
|
91
|
+
}),
|
|
92
|
+
]);
|
|
93
93
|
},
|
|
94
94
|
[queue],
|
|
95
95
|
);
|
|
@@ -108,14 +108,14 @@ const AudioFile = ({
|
|
|
108
108
|
}
|
|
109
109
|
const executor = new FunctionExecutor(
|
|
110
110
|
new ServiceContainer().setServices({
|
|
111
|
-
ai: {
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
},
|
|
111
|
+
// ai: {
|
|
112
|
+
// client: new Edge AiServiceClient({
|
|
113
|
+
// endpoint: AI_SERVICE_ENDPOINT.REMOTE,
|
|
114
|
+
// defaultGenerationOptions: {
|
|
115
|
+
// model: '@anthropic/claude-3-5-sonnet-20241022',
|
|
116
|
+
// },
|
|
117
|
+
// }),
|
|
118
|
+
// },
|
|
119
119
|
}),
|
|
120
120
|
);
|
|
121
121
|
|
|
@@ -143,10 +143,10 @@ const AudioFile = ({
|
|
|
143
143
|
}, [normalizer]);
|
|
144
144
|
|
|
145
145
|
const manageChunkRecording = () => {
|
|
146
|
-
if (running && isSpeaking) {
|
|
146
|
+
if (running && isSpeaking && transcriber) {
|
|
147
147
|
log.info('starting transcription');
|
|
148
148
|
transcriber?.startChunksRecording();
|
|
149
|
-
} else if (!isSpeaking || !running) {
|
|
149
|
+
} else if ((!isSpeaking || !running) && transcriber) {
|
|
150
150
|
log.info('stopping transcription');
|
|
151
151
|
transcriber?.stopChunksRecording();
|
|
152
152
|
}
|
|
@@ -172,40 +172,49 @@ const AudioFile = ({
|
|
|
172
172
|
manageChunkRecording();
|
|
173
173
|
}, [isSpeaking, stream]);
|
|
174
174
|
|
|
175
|
-
return
|
|
175
|
+
return (
|
|
176
|
+
<TranscriptionStory
|
|
177
|
+
disabled={!stream}
|
|
178
|
+
model={model}
|
|
179
|
+
running={running}
|
|
180
|
+
onRunningChange={setRunning}
|
|
181
|
+
audioRef={ref}
|
|
182
|
+
/>
|
|
183
|
+
);
|
|
176
184
|
};
|
|
177
185
|
|
|
178
|
-
const meta
|
|
186
|
+
const meta = {
|
|
179
187
|
title: 'plugins/plugin-transcription/FileTranscription',
|
|
180
188
|
decorators: [
|
|
189
|
+
withTheme(),
|
|
190
|
+
withLayout({ layout: 'column' }),
|
|
181
191
|
withPluginManager({
|
|
182
192
|
plugins: [
|
|
183
|
-
|
|
184
|
-
|
|
193
|
+
...corePlugins(),
|
|
194
|
+
StorybookPlugin({}),
|
|
185
195
|
ClientPlugin({
|
|
186
|
-
types: [TestItem,
|
|
187
|
-
onClientInitialized:
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
196
|
+
types: [TestItem, Person.Person, Organization.Organization, TestSchema.DocumentType],
|
|
197
|
+
onClientInitialized: ({ client }) =>
|
|
198
|
+
Effect.gen(function* () {
|
|
199
|
+
yield* Effect.promise(() => client.halo.createIdentity());
|
|
200
|
+
yield* Effect.promise(() => client.spaces.waitUntilReady());
|
|
201
|
+
yield* Effect.promise(() => client.spaces.default.waitUntilReady());
|
|
202
|
+
yield* Effect.promise(() => seedTestData(client.spaces.default));
|
|
203
|
+
}),
|
|
193
204
|
}),
|
|
194
|
-
|
|
195
|
-
SettingsPlugin(),
|
|
205
|
+
|
|
196
206
|
PreviewPlugin(),
|
|
197
|
-
IntentPlugin(),
|
|
198
207
|
TranscriptionPlugin(),
|
|
199
208
|
],
|
|
200
|
-
fireEvents: [
|
|
209
|
+
fireEvents: [AppActivationEvents.SetupAppGraph],
|
|
201
210
|
}),
|
|
202
|
-
withTheme,
|
|
203
|
-
withLayout({ fullscreen: true, classNames: 'justify-center' }),
|
|
204
211
|
],
|
|
205
|
-
};
|
|
212
|
+
} satisfies Meta;
|
|
206
213
|
|
|
207
214
|
export default meta;
|
|
208
215
|
|
|
216
|
+
type Story = StoryObj<typeof meta>;
|
|
217
|
+
|
|
209
218
|
const TRANSCRIBER_CONFIG = {
|
|
210
219
|
transcribeAfterChunksAmount: 100,
|
|
211
220
|
prefixBufferChunksAmount: 50,
|
|
@@ -228,15 +237,16 @@ export const Default: StoryObj<typeof AudioFile> = {
|
|
|
228
237
|
},
|
|
229
238
|
};
|
|
230
239
|
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
}
|
|
240
|
+
// TODO(mykola): Fix sentence normalization.
|
|
241
|
+
// export const WithSentenceNormalization: StoryObj<typeof AudioFile> = {
|
|
242
|
+
// render: AudioFile,
|
|
243
|
+
// args: {
|
|
244
|
+
// detectSpeaking: true,
|
|
245
|
+
// normalizeSentences: true,
|
|
246
|
+
// // https://learnenglish.britishcouncil.org/general-english/audio-zone/living-london
|
|
247
|
+
// audioUrl: 'https://dxos.network/audio-london.m4a',
|
|
248
|
+
// // textUrl: 'https://dxos.network/audio-london.txt',
|
|
249
|
+
// transcriberConfig: TRANSCRIBER_CONFIG,
|
|
250
|
+
// recorderConfig: RECORDER_CONFIG,
|
|
251
|
+
// },
|
|
252
|
+
// };
|
|
@@ -2,22 +2,24 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@
|
|
6
|
-
|
|
7
|
-
import { type StoryObj, type Meta } from '@storybook/react';
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
8
6
|
import React, { useEffect, useMemo, useState } from 'react';
|
|
9
7
|
|
|
10
8
|
import { log } from '@dxos/log';
|
|
11
9
|
import { Toolbar } from '@dxos/react-ui';
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
10
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
11
|
+
import { mx } from '@dxos/ui-theme';
|
|
14
12
|
|
|
15
13
|
type Word = {
|
|
16
14
|
text: string;
|
|
17
15
|
matched: boolean;
|
|
18
16
|
};
|
|
19
17
|
|
|
20
|
-
|
|
18
|
+
type StoryProps = {
|
|
19
|
+
keywords: string[];
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const DefaultStory = ({ keywords }: StoryProps) => {
|
|
21
23
|
const [running, setRunning] = useState(false);
|
|
22
24
|
const [matchingWords, setMatchingWords] = useState<Word[]>(keywords.map((word) => ({ text: word, matched: false })));
|
|
23
25
|
|
|
@@ -84,7 +86,7 @@ const SpeechRecognition = ({ keywords }: { keywords: string[] }) => {
|
|
|
84
86
|
}, [running, recognition]);
|
|
85
87
|
|
|
86
88
|
return (
|
|
87
|
-
<div className={mx('flex flex-col gap-2
|
|
89
|
+
<div className={mx('flex flex-col gap-2 is-[30rem]')}>
|
|
88
90
|
<Toolbar.Root>
|
|
89
91
|
<Toolbar.IconButton
|
|
90
92
|
iconOnly
|
|
@@ -99,7 +101,7 @@ const SpeechRecognition = ({ keywords }: { keywords: string[] }) => {
|
|
|
99
101
|
<span
|
|
100
102
|
key={index}
|
|
101
103
|
className={mx(
|
|
102
|
-
'
|
|
104
|
+
'pli-3 plb-1 m-2 rounded border',
|
|
103
105
|
word.matched ? 'bg-red-200 text-red-800 border-red-300' : 'bg-gray-200 text-gray-600 border-gray-300',
|
|
104
106
|
)}
|
|
105
107
|
>
|
|
@@ -113,15 +115,17 @@ const SpeechRecognition = ({ keywords }: { keywords: string[] }) => {
|
|
|
113
115
|
);
|
|
114
116
|
};
|
|
115
117
|
|
|
116
|
-
const meta
|
|
118
|
+
const meta = {
|
|
117
119
|
title: 'plugins/plugin-transcription/KeyWordDetection',
|
|
118
|
-
|
|
119
|
-
}
|
|
120
|
+
render: DefaultStory,
|
|
121
|
+
decorators: [withTheme(), withLayout({ layout: 'column' })],
|
|
122
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
120
123
|
|
|
121
124
|
export default meta;
|
|
122
125
|
|
|
123
|
-
|
|
124
|
-
|
|
126
|
+
type Story = StoryObj<typeof meta>;
|
|
127
|
+
|
|
128
|
+
export const SpeechRecognitionAPI: Story = {
|
|
125
129
|
args: {
|
|
126
130
|
keywords: ['kai', 'computer', 'hello'],
|
|
127
131
|
},
|
|
@@ -2,46 +2,42 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import '@
|
|
6
|
-
|
|
7
|
-
import { type Meta, type StoryObj } from '@storybook/react';
|
|
5
|
+
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
+
import * as Effect from 'effect/Effect';
|
|
8
7
|
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
9
8
|
|
|
10
|
-
import { EdgeAiServiceClient } from '@dxos/ai';
|
|
11
|
-
import { AI_SERVICE_ENDPOINT } from '@dxos/ai/testing';
|
|
12
|
-
import { Events, IntentPlugin, SettingsPlugin } from '@dxos/app-framework';
|
|
13
9
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
|
+
import { AppActivationEvents } from '@dxos/app-toolkit';
|
|
14
11
|
import {
|
|
15
|
-
extractionAnthropicFn,
|
|
16
12
|
type ExtractionFunction,
|
|
17
|
-
|
|
18
|
-
|
|
13
|
+
extractionAnthropicFunction,
|
|
14
|
+
extractionNerFunction,
|
|
19
15
|
getNer,
|
|
20
|
-
|
|
21
|
-
|
|
16
|
+
processTranscriptMessage,
|
|
17
|
+
} from '@dxos/assistant/extraction';
|
|
18
|
+
import { Filter, type Obj } from '@dxos/echo';
|
|
19
|
+
import { createQueueDXN } from '@dxos/echo/internal';
|
|
22
20
|
import { MemoryQueue } from '@dxos/echo-db';
|
|
23
|
-
import {
|
|
24
|
-
import { FunctionExecutor, ServiceContainer } from '@dxos/functions';
|
|
21
|
+
import { FunctionExecutor, ServiceContainer } from '@dxos/functions-runtime';
|
|
25
22
|
import { invariant } from '@dxos/invariant';
|
|
26
23
|
import { log } from '@dxos/log';
|
|
27
24
|
import { ClientPlugin } from '@dxos/plugin-client';
|
|
28
25
|
import { PreviewPlugin } from '@dxos/plugin-preview';
|
|
29
|
-
import {
|
|
30
|
-
import { StorybookLayoutPlugin } from '@dxos/plugin-storybook-layout';
|
|
31
|
-
import { ThemePlugin } from '@dxos/plugin-theme';
|
|
26
|
+
import { StorybookPlugin, corePlugins } from '@dxos/plugin-testing';
|
|
32
27
|
import { IndexKind, useSpace } from '@dxos/react-client/echo';
|
|
33
|
-
import {
|
|
34
|
-
import {
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
28
|
+
import { withLayout, withTheme } from '@dxos/react-ui/testing';
|
|
29
|
+
import { TestSchema } from '@dxos/schema/testing';
|
|
30
|
+
import { Message, Organization, Person } from '@dxos/types';
|
|
31
|
+
import { seedTestData } from '@dxos/types/testing';
|
|
37
32
|
|
|
38
|
-
import { TranscriptionStory } from './TranscriptionStory';
|
|
39
|
-
import { useIsSpeaking } from './useIsSpeaking';
|
|
40
|
-
import { TranscriptionPlugin } from '../../TranscriptionPlugin';
|
|
41
33
|
import { useAudioTrack, useQueueModelAdapter, useTranscriber } from '../../hooks';
|
|
42
34
|
import { TestItem } from '../../testing';
|
|
43
|
-
import { type
|
|
44
|
-
import {
|
|
35
|
+
import { type MediaStreamRecorderProps, type TranscriberProps } from '../../transcriber';
|
|
36
|
+
import { TranscriptionPlugin } from '../../TranscriptionPlugin';
|
|
37
|
+
import { renderByline } from '../../util';
|
|
38
|
+
|
|
39
|
+
import { TranscriptionStory } from './TranscriptionStory';
|
|
40
|
+
import { useIsSpeaking } from './useIsSpeaking';
|
|
45
41
|
|
|
46
42
|
const TRANSCRIBER_CONFIG = {
|
|
47
43
|
transcribeAfterChunksAmount: 50,
|
|
@@ -54,8 +50,8 @@ const RECORDER_CONFIG = {
|
|
|
54
50
|
|
|
55
51
|
type StoryProps = {
|
|
56
52
|
detectSpeaking?: boolean;
|
|
57
|
-
transcriberConfig:
|
|
58
|
-
recorderConfig:
|
|
53
|
+
transcriberConfig: TranscriberProps['config'];
|
|
54
|
+
recorderConfig: MediaStreamRecorderProps['config'];
|
|
59
55
|
audioConstraints?: MediaTrackConstraints;
|
|
60
56
|
entityExtraction: 'none' | 'ner' | 'llm';
|
|
61
57
|
};
|
|
@@ -78,8 +74,8 @@ const DefaultStory = ({
|
|
|
78
74
|
// Queue.
|
|
79
75
|
// TODO(dmaretskyi): Use space.queues.create() instead.
|
|
80
76
|
const queueDxn = useMemo(() => createQueueDXN(), []);
|
|
81
|
-
const queue = useMemo(() => new MemoryQueue<
|
|
82
|
-
const model = useQueueModelAdapter(
|
|
77
|
+
const queue = useMemo(() => new MemoryQueue<Message.Message>(queueDxn), [queueDxn]);
|
|
78
|
+
const model = useQueueModelAdapter(renderByline([]), queue);
|
|
83
79
|
const space = useSpace();
|
|
84
80
|
|
|
85
81
|
useEffect(() => {
|
|
@@ -97,31 +93,34 @@ const DefaultStory = ({
|
|
|
97
93
|
|
|
98
94
|
let executor: FunctionExecutor | undefined;
|
|
99
95
|
let extractionFunction: ExtractionFunction | undefined;
|
|
100
|
-
let objects: Promise<
|
|
96
|
+
let objects: Promise<Obj.Unknown[]> | undefined;
|
|
101
97
|
|
|
102
98
|
if (entityExtraction === 'ner') {
|
|
103
99
|
// Init model loading. Takes time.
|
|
104
100
|
void getNer();
|
|
105
|
-
extractionFunction =
|
|
101
|
+
extractionFunction = extractionNerFunction;
|
|
106
102
|
} else if (entityExtraction === 'llm') {
|
|
107
|
-
extractionFunction =
|
|
103
|
+
extractionFunction = extractionAnthropicFunction;
|
|
108
104
|
objects = space.db
|
|
109
105
|
.query(
|
|
110
106
|
Filter.or(
|
|
111
|
-
Filter.type(
|
|
112
|
-
Filter.type(
|
|
113
|
-
Filter.type(
|
|
107
|
+
Filter.type(Person.Person),
|
|
108
|
+
Filter.type(Organization.Organization),
|
|
109
|
+
Filter.type(TestSchema.DocumentType),
|
|
114
110
|
),
|
|
115
111
|
)
|
|
116
|
-
.run()
|
|
117
|
-
.then((result) => result.objects);
|
|
112
|
+
.run();
|
|
118
113
|
}
|
|
119
114
|
if (entityExtraction !== 'none') {
|
|
120
|
-
const AiService = new EdgeAiServiceClient({
|
|
121
|
-
endpoint: AI_SERVICE_ENDPOINT.REMOTE,
|
|
122
|
-
});
|
|
123
115
|
executor = new FunctionExecutor(
|
|
124
|
-
new ServiceContainer().setServices({
|
|
116
|
+
new ServiceContainer().setServices({
|
|
117
|
+
// ai: {
|
|
118
|
+
// client: new Edge AiServiceClient({
|
|
119
|
+
// endpoint: AI_SERVICE_ENDPOINT.REMOTE,
|
|
120
|
+
// }),
|
|
121
|
+
// },
|
|
122
|
+
// database: { db: space!.db },
|
|
123
|
+
}),
|
|
125
124
|
);
|
|
126
125
|
}
|
|
127
126
|
|
|
@@ -129,9 +128,9 @@ const DefaultStory = ({
|
|
|
129
128
|
}, [entityExtraction, space]);
|
|
130
129
|
|
|
131
130
|
// Transcriber.
|
|
132
|
-
const handleSegments = useCallback<
|
|
131
|
+
const handleSegments = useCallback<TranscriberProps['onSegments']>(
|
|
133
132
|
async (blocks) => {
|
|
134
|
-
const message =
|
|
133
|
+
const message = Message.make({
|
|
135
134
|
sender: { name: 'You' },
|
|
136
135
|
created: new Date().toISOString(),
|
|
137
136
|
blocks,
|
|
@@ -190,52 +189,53 @@ const DefaultStory = ({
|
|
|
190
189
|
return <TranscriptionStory model={model} running={running} onRunningChange={setRunning} />;
|
|
191
190
|
};
|
|
192
191
|
|
|
193
|
-
const meta
|
|
192
|
+
const meta = {
|
|
194
193
|
title: 'plugins/plugin-transcription/MicrophoneTranscription',
|
|
195
194
|
render: DefaultStory,
|
|
196
195
|
decorators: [
|
|
196
|
+
withTheme(),
|
|
197
|
+
withLayout({ layout: 'column' }),
|
|
197
198
|
withPluginManager({
|
|
198
199
|
plugins: [
|
|
199
|
-
|
|
200
|
-
|
|
200
|
+
...corePlugins(),
|
|
201
|
+
StorybookPlugin({}),
|
|
201
202
|
ClientPlugin({
|
|
202
|
-
types: [TestItem,
|
|
203
|
-
onClientInitialized:
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
203
|
+
types: [TestItem, Person.Person, Organization.Organization, TestSchema.DocumentType],
|
|
204
|
+
onClientInitialized: ({ client }) =>
|
|
205
|
+
Effect.gen(function* () {
|
|
206
|
+
yield* Effect.promise(() => client.halo.createIdentity());
|
|
207
|
+
yield* Effect.promise(() => client.spaces.waitUntilReady());
|
|
208
|
+
yield* Effect.promise(() => client.spaces.default.waitUntilReady());
|
|
209
|
+
// TODO(mykola): Make API easier to use.
|
|
210
|
+
// TODO(mykola): Delete after enabling vector indexing by default.
|
|
211
|
+
// Enable vector indexing.
|
|
212
|
+
yield* Effect.promise(() =>
|
|
213
|
+
client.services.services.QueryService!.setConfig({
|
|
214
|
+
enabled: true,
|
|
215
|
+
indexes: [
|
|
216
|
+
//
|
|
217
|
+
{ kind: IndexKind.Kind.SCHEMA_MATCH },
|
|
218
|
+
{ kind: IndexKind.Kind.GRAPH },
|
|
219
|
+
{ kind: IndexKind.Kind.VECTOR },
|
|
220
|
+
],
|
|
221
|
+
}),
|
|
222
|
+
);
|
|
223
|
+
yield* Effect.promise(() => client.services.services.QueryService!.reindex());
|
|
224
|
+
yield* Effect.promise(() => seedTestData(client.spaces.default));
|
|
225
|
+
}),
|
|
222
226
|
}),
|
|
223
|
-
|
|
224
|
-
SettingsPlugin(),
|
|
227
|
+
|
|
225
228
|
PreviewPlugin(),
|
|
226
|
-
IntentPlugin(),
|
|
227
229
|
TranscriptionPlugin(),
|
|
228
230
|
],
|
|
229
|
-
fireEvents: [
|
|
231
|
+
fireEvents: [AppActivationEvents.SetupAppGraph],
|
|
230
232
|
}),
|
|
231
|
-
withTheme,
|
|
232
|
-
withLayout({ fullscreen: true, classNames: 'justify-center' }),
|
|
233
233
|
],
|
|
234
|
-
}
|
|
234
|
+
} satisfies Meta<typeof DefaultStory>;
|
|
235
235
|
|
|
236
236
|
export default meta;
|
|
237
237
|
|
|
238
|
-
type Story = StoryObj<typeof
|
|
238
|
+
type Story = StoryObj<typeof meta>;
|
|
239
239
|
|
|
240
240
|
export const Default: Story = {
|
|
241
241
|
args: {
|
|
@@ -251,19 +251,21 @@ export const Default: Story = {
|
|
|
251
251
|
},
|
|
252
252
|
};
|
|
253
253
|
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
}
|
|
254
|
+
// NOTE: We are running out of free quota on hugging face entity extraction.
|
|
255
|
+
// TODO(mykola): Fix hugging face quota issues.
|
|
256
|
+
// export const EntityExtraction: Story = {
|
|
257
|
+
// args: {
|
|
258
|
+
// detectSpeaking: true,
|
|
259
|
+
// entityExtraction: 'ner',
|
|
260
|
+
// transcriberConfig: TRANSCRIBER_CONFIG,
|
|
261
|
+
// recorderConfig: RECORDER_CONFIG,
|
|
262
|
+
// audioConstraints: {
|
|
263
|
+
// echoCancellation: true,
|
|
264
|
+
// noiseSuppression: true,
|
|
265
|
+
// autoGainControl: true,
|
|
266
|
+
// },
|
|
267
|
+
// },
|
|
268
|
+
// };
|
|
267
269
|
|
|
268
270
|
export const SpeechDetection: Story = {
|
|
269
271
|
args: {
|
|
@@ -6,36 +6,36 @@ import '@dxos-theme';
|
|
|
6
6
|
|
|
7
7
|
import React, { type Dispatch, type FC, type RefObject, type SetStateAction } from 'react';
|
|
8
8
|
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import { ScrollContainer } from '@dxos/react-ui-components';
|
|
12
|
-
import { type DataType } from '@dxos/schema';
|
|
9
|
+
import { IconButton, ScrollContainer, Toolbar } from '@dxos/react-ui';
|
|
10
|
+
import { type Message } from '@dxos/types';
|
|
13
11
|
|
|
14
12
|
import { type SerializationModel } from '../../model';
|
|
15
|
-
import {
|
|
13
|
+
import { TranscriptView } from '../Transcript';
|
|
16
14
|
|
|
17
15
|
export const TranscriptionStory: FC<{
|
|
18
|
-
model: SerializationModel<
|
|
16
|
+
model: SerializationModel<Message.Message>;
|
|
17
|
+
disabled?: boolean;
|
|
19
18
|
running: boolean;
|
|
20
19
|
onRunningChange: Dispatch<SetStateAction<boolean>>;
|
|
21
|
-
audioRef?: RefObject<HTMLAudioElement>;
|
|
22
|
-
}> = ({ model, running, onRunningChange, audioRef }) => {
|
|
23
|
-
const space = useSpace();
|
|
24
|
-
|
|
20
|
+
audioRef?: RefObject<HTMLAudioElement | null>;
|
|
21
|
+
}> = ({ model, running, onRunningChange, audioRef, disabled }) => {
|
|
25
22
|
return (
|
|
26
|
-
<div className='flex flex-col
|
|
23
|
+
<div className='flex flex-col is-[30rem]'>
|
|
27
24
|
{audioRef && <audio ref={audioRef} autoPlay />}
|
|
28
25
|
<Toolbar.Root>
|
|
29
26
|
<IconButton
|
|
30
27
|
iconOnly
|
|
28
|
+
disabled={disabled}
|
|
31
29
|
icon={running ? 'ph--pause--regular' : 'ph--play--regular'}
|
|
32
30
|
label={running ? 'Pause' : 'Play'}
|
|
33
31
|
onClick={() => onRunningChange((running) => !running)}
|
|
34
32
|
/>
|
|
35
33
|
</Toolbar.Root>
|
|
36
|
-
<ScrollContainer>
|
|
37
|
-
<
|
|
38
|
-
|
|
34
|
+
<ScrollContainer.Root pin>
|
|
35
|
+
<ScrollContainer.Viewport>
|
|
36
|
+
<TranscriptView model={model} />
|
|
37
|
+
</ScrollContainer.Viewport>
|
|
38
|
+
</ScrollContainer.Root>
|
|
39
39
|
</div>
|
|
40
40
|
);
|
|
41
41
|
};
|