@dxos/plugin-transcription 0.8.4-main.c4373fc → 0.8.4-main.c85a9c8dae
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/TranscriptionContainer-RBFHP2AV.mjs +41 -0
- package/dist/lib/browser/TranscriptionContainer-RBFHP2AV.mjs.map +7 -0
- package/dist/lib/browser/blueprint-definition-C6XA2SVZ.mjs +18 -0
- package/dist/lib/browser/blueprint-definition-C6XA2SVZ.mjs.map +7 -0
- package/dist/lib/browser/blueprints/index.mjs +9 -0
- package/dist/lib/browser/chunk-2B74LZZD.mjs +22 -0
- package/dist/lib/browser/chunk-2B74LZZD.mjs.map +7 -0
- package/dist/lib/browser/{chunk-COBQIZ6B.mjs → chunk-EV5ZYKET.mjs} +60 -86
- package/dist/lib/browser/chunk-EV5ZYKET.mjs.map +7 -0
- package/dist/lib/browser/chunk-GH4IIQ6C.mjs +54 -0
- package/dist/lib/browser/chunk-GH4IIQ6C.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/{blueprint-definition-GO6GTEBT.mjs → chunk-O7ILGNBZ.mjs} +39 -41
- package/dist/lib/browser/chunk-O7ILGNBZ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-ZS2FXKEF.mjs → chunk-XLMRCOQN.mjs} +383 -470
- package/dist/lib/browser/chunk-XLMRCOQN.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +62 -77
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operation-resolver-5BLRH4XE.mjs +23 -0
- package/dist/lib/browser/operation-resolver-5BLRH4XE.mjs.map +7 -0
- package/dist/lib/browser/react-surface-U2SI74JK.mjs +36 -0
- package/dist/lib/browser/react-surface-U2SI74JK.mjs.map +7 -0
- package/dist/lib/browser/{transcriber-NG5MRCP6.mjs → transcriber-WCPHHJYY.mjs} +19 -14
- package/dist/lib/browser/transcriber-WCPHHJYY.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +8 -5
- package/dist/lib/node-esm/TranscriptionContainer-3OOID5KH.mjs +42 -0
- package/dist/lib/node-esm/TranscriptionContainer-3OOID5KH.mjs.map +7 -0
- package/dist/lib/node-esm/blueprint-definition-TLXDUXIQ.mjs +19 -0
- package/dist/lib/node-esm/blueprint-definition-TLXDUXIQ.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-6GW5NZYG.mjs +55 -0
- package/dist/lib/node-esm/chunk-6GW5NZYG.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-A6SB234F.mjs → chunk-7UE7G6DE.mjs} +60 -86
- package/dist/lib/node-esm/chunk-7UE7G6DE.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-PEZRQYKO.mjs → chunk-DYUGYQCB.mjs} +383 -470
- package/dist/lib/node-esm/chunk-DYUGYQCB.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-KLTPFUKN.mjs → chunk-F47HK7GT.mjs} +7 -8
- package/dist/lib/node-esm/chunk-F47HK7GT.mjs.map +7 -0
- package/dist/lib/node-esm/{blueprint-definition-6SU7GLBR.mjs → chunk-H3MXHMQL.mjs} +39 -41
- package/dist/lib/node-esm/chunk-H3MXHMQL.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/index.mjs +62 -77
- 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-CVZB7BF4.mjs +24 -0
- package/dist/lib/node-esm/operation-resolver-CVZB7BF4.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-2ICJPBPX.mjs +37 -0
- package/dist/lib/node-esm/react-surface-2ICJPBPX.mjs.map +7 -0
- package/dist/lib/node-esm/{transcriber-SMU7HD6F.mjs → transcriber-2RIHUEX4.mjs} +19 -14
- package/dist/lib/node-esm/transcriber-2RIHUEX4.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +8 -5
- 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 +4 -0
- package/dist/types/src/blueprints/transcription-blueprint.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +6 -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 -5
- 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/Transcription/Transcription.d.ts +17 -0
- package/dist/types/src/components/Transcription/Transcription.d.ts.map +1 -0
- package/dist/types/src/components/{Transcript/Transcript.stories.d.ts → Transcription/Transcription.stories.d.ts} +7 -6
- package/dist/types/src/components/Transcription/Transcription.stories.d.ts.map +1 -0
- package/dist/types/src/components/Transcription/index.d.ts +2 -0
- package/dist/types/src/components/Transcription/index.d.ts.map +1 -0
- package/dist/types/src/components/Transcription/transcription-extension.d.ts +15 -0
- package/dist/types/src/components/Transcription/transcription-extension.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +1 -3
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/components/stories/FileTranscription.stories.d.ts +3 -6
- package/dist/types/src/components/stories/FileTranscription.stories.d.ts.map +1 -1
- package/dist/types/src/components/stories/KeyWordRecognition.stories.d.ts +0 -3
- package/dist/types/src/components/stories/KeyWordRecognition.stories.d.ts.map +1 -1
- package/dist/types/src/components/stories/MicrophoneTranscription.stories.d.ts +3 -6
- package/dist/types/src/components/stories/MicrophoneTranscription.stories.d.ts.map +1 -1
- package/dist/types/src/components/stories/TranscriptionStory.d.ts +2 -2
- package/dist/types/src/components/stories/TranscriptionStory.d.ts.map +1 -1
- package/dist/types/src/containers/TranscriptionContainer/TranscriptionContainer.d.ts +6 -0
- package/dist/types/src/containers/TranscriptionContainer/TranscriptionContainer.d.ts.map +1 -0
- package/dist/types/src/containers/TranscriptionContainer/index.d.ts +3 -0
- package/dist/types/src/containers/TranscriptionContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +3 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/functions/index.d.ts +17 -2
- package/dist/types/src/functions/index.d.ts.map +1 -1
- package/dist/types/src/functions/open.d.ts +6 -2
- package/dist/types/src/functions/open.d.ts.map +1 -1
- package/dist/types/src/functions/summarize.d.ts +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 +1 -1
- package/dist/types/src/hooks/useTranscriber.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 -2
- 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 +515 -448
- 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 +9 -9
- package/dist/types/src/testing/testing.d.ts.map +1 -1
- package/dist/types/src/transcriber/media-stream-recorder.d.ts +2 -2
- 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 +9 -6
- package/dist/types/src/transcriber/transcription-manager.d.ts.map +1 -1
- package/dist/types/src/types/TranscriptAction.d.ts +22 -20
- package/dist/types/src/types/TranscriptAction.d.ts.map +1 -1
- 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 +2 -1
- package/dist/types/src/types/index.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 +84 -69
- package/src/TranscriptionPlugin.tsx +35 -57
- package/src/blueprints/index.ts +5 -0
- package/src/blueprints/transcription-blueprint.ts +33 -0
- package/src/capabilities/blueprint-definition/blueprint-definition.ts +17 -0
- package/src/capabilities/blueprint-definition/index.ts +7 -0
- package/src/capabilities/index.ts +4 -8
- 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 → Transcription/Transcription.stories.tsx} +42 -41
- package/src/components/Transcription/Transcription.tsx +63 -0
- package/src/components/{Transcript → Transcription}/index.ts +1 -1
- package/src/components/{Transcript/transcript-extension.ts → Transcription/transcription-extension.ts} +13 -9
- package/src/components/index.ts +1 -6
- package/src/components/stories/FileTranscription.stories.tsx +30 -36
- package/src/components/stories/KeyWordRecognition.stories.tsx +5 -8
- package/src/components/stories/MicrophoneTranscription.stories.tsx +50 -55
- package/src/components/stories/TranscriptionStory.tsx +7 -11
- package/src/containers/TranscriptionContainer/TranscriptionContainer.tsx +33 -0
- package/src/containers/TranscriptionContainer/index.ts +7 -0
- package/src/containers/index.ts +7 -0
- package/src/functions/index.ts +7 -2
- package/src/functions/open.ts +9 -11
- package/src/hooks/useQueueModelAdapter.ts +1 -1
- package/src/hooks/useTranscriber.ts +8 -3
- package/src/hooks/useVoiceInput.ts +2 -2
- package/src/index.ts +1 -1
- package/src/meta.ts +8 -3
- package/src/model/model.test.ts +20 -14
- package/src/segments-normalization/message-normalizer.ts +18 -13
- package/src/segments-normalization/normalization.test.ts +6 -11
- package/src/segments-normalization/normalization.ts +6 -6
- package/src/segments-normalization/utils.ts +2 -2
- package/src/testing/testing.ts +28 -18
- package/src/transcriber/media-stream-recorder.ts +3 -3
- package/src/transcriber/transcriber.browser.test.ts +4 -4
- package/src/transcriber/transcriber.ts +6 -6
- package/src/transcriber/transcription-manager.ts +21 -15
- package/src/types/TranscriptAction.ts +21 -13
- package/src/{capabilities → types}/capabilities.ts +8 -8
- package/src/types/index.ts +2 -1
- package/src/util/index.ts +1 -0
- package/src/util/render-byline.ts +33 -0
- package/dist/lib/browser/TranscriptContainer-QN5WUMWJ.mjs +0 -11
- package/dist/lib/browser/blueprint-definition-GO6GTEBT.mjs.map +0 -7
- package/dist/lib/browser/chunk-77NWYLC6.mjs +0 -8
- package/dist/lib/browser/chunk-77NWYLC6.mjs.map +0 -7
- package/dist/lib/browser/chunk-7LNCQDTT.mjs +0 -24
- package/dist/lib/browser/chunk-7LNCQDTT.mjs.map +0 -7
- package/dist/lib/browser/chunk-COBQIZ6B.mjs.map +0 -7
- package/dist/lib/browser/chunk-GGHMOEKZ.mjs +0 -63
- package/dist/lib/browser/chunk-GGHMOEKZ.mjs.map +0 -7
- package/dist/lib/browser/chunk-LCK3YRQF.mjs +0 -16
- package/dist/lib/browser/chunk-LCK3YRQF.mjs.map +0 -7
- package/dist/lib/browser/chunk-ZS2FXKEF.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-52EPFRMR.mjs +0 -25
- package/dist/lib/browser/intent-resolver-52EPFRMR.mjs.map +0 -7
- package/dist/lib/browser/react-surface-LCP2D2MF.mjs +0 -34
- package/dist/lib/browser/react-surface-LCP2D2MF.mjs.map +0 -7
- package/dist/lib/browser/transcriber-NG5MRCP6.mjs.map +0 -7
- package/dist/lib/node-esm/TranscriptContainer-WCUWVVSD.mjs +0 -12
- package/dist/lib/node-esm/blueprint-definition-6SU7GLBR.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-A6SB234F.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-FTTZ4YSX.mjs +0 -64
- package/dist/lib/node-esm/chunk-FTTZ4YSX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-KLTPFUKN.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-N5Z4SKPH.mjs +0 -10
- package/dist/lib/node-esm/chunk-N5Z4SKPH.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-PEZRQYKO.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-RWRG3S2O.mjs +0 -17
- package/dist/lib/node-esm/chunk-RWRG3S2O.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-DZBQQRHN.mjs +0 -26
- package/dist/lib/node-esm/intent-resolver-DZBQQRHN.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-7UC2YXX2.mjs +0 -35
- package/dist/lib/node-esm/react-surface-7UC2YXX2.mjs.map +0 -7
- package/dist/lib/node-esm/transcriber-SMU7HD6F.mjs.map +0 -7
- package/dist/types/src/capabilities/blueprint-definition.d.ts +0 -5
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +0 -1
- 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/components/Transcript/Transcript.d.ts +0 -20
- package/dist/types/src/components/Transcript/Transcript.d.ts.map +0 -1
- package/dist/types/src/components/Transcript/Transcript.stories.d.ts.map +0 -1
- package/dist/types/src/components/Transcript/deprecated/OldTranscript.d.ts +0 -28
- package/dist/types/src/components/Transcript/deprecated/OldTranscript.d.ts.map +0 -1
- package/dist/types/src/components/Transcript/index.d.ts +0 -2
- package/dist/types/src/components/Transcript/index.d.ts.map +0 -1
- package/dist/types/src/components/Transcript/transcript-extension.d.ts +0 -15
- package/dist/types/src/components/Transcript/transcript-extension.d.ts.map +0 -1
- package/dist/types/src/components/TranscriptContainer.d.ts +0 -9
- package/dist/types/src/components/TranscriptContainer.d.ts.map +0 -1
- package/dist/types/src/types/Transcript.d.ts +0 -30
- package/dist/types/src/types/Transcript.d.ts.map +0 -1
- package/src/capabilities/blueprint-definition.ts +0 -31
- package/src/capabilities/intent-resolver.ts +0 -18
- package/src/capabilities/react-surface.tsx +0 -22
- package/src/capabilities/transcriber.ts +0 -77
- package/src/components/Transcript/Transcript.tsx +0 -93
- package/src/components/Transcript/deprecated/OldTranscript.tsx +0 -260
- package/src/components/TranscriptContainer.tsx +0 -36
- package/src/types/Transcript.ts +0 -44
- /package/dist/lib/browser/{TranscriptContainer-QN5WUMWJ.mjs.map → blueprints/index.mjs.map} +0 -0
- /package/dist/lib/{node-esm/TranscriptContainer-WCUWVVSD.mjs.map → browser/chunk-J5LGTIGS.mjs.map} +0 -0
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transcript-extension.d.ts","sourceRoot":"","sources":["../../../../../src/components/Transcript/transcript-extension.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,KAAK,SAAS,EAAmB,MAAM,mBAAmB,CAAC;AAMpE,OAAO,EAAE,KAAK,QAAQ,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAmB,KAAK,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAEvE;;GAEG;AACH,MAAM,MAAM,iBAAiB,GAAG;IAC9B,KAAK,EAAE,kBAAkB,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC;IAC5C,OAAO,CAAC,EAAE,IAAI,CAAC;CAChB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,UAAU,GAAI,oBAAoB,iBAAiB,KAAG,SAuHlE,CAAC"}
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type Transcript } from '../types';
|
|
3
|
-
export type TranscriptionContainerProps = {
|
|
4
|
-
role: string;
|
|
5
|
-
transcript: Transcript.Transcript;
|
|
6
|
-
};
|
|
7
|
-
export declare const TranscriptionContainer: ({ transcript }: TranscriptionContainerProps) => React.JSX.Element;
|
|
8
|
-
export default TranscriptionContainer;
|
|
9
|
-
//# sourceMappingURL=TranscriptContainer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TranscriptContainer.d.ts","sourceRoot":"","sources":["../../../../src/components/TranscriptContainer.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAQ1B,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,UAAU,CAAC;AAI3C,MAAM,MAAM,2BAA2B,GAAG;IACxC,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,EAAE,UAAU,CAAC,UAAU,CAAC;CACnC,CAAC;AAEF,eAAO,MAAM,sBAAsB,GAAI,gBAAgB,2BAA2B,sBAYjF,CAAC;AAEF,eAAe,sBAAsB,CAAC"}
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import * as Schema from 'effect/Schema';
|
|
2
|
-
import { Queue } from '@dxos/client/echo';
|
|
3
|
-
import { type DXN, Obj, Type } from '@dxos/echo';
|
|
4
|
-
/**
|
|
5
|
-
* Root transcript object created when the user starts a transcription.
|
|
6
|
-
*/
|
|
7
|
-
export declare const Transcript: Type.obj<Schema.Struct<{
|
|
8
|
-
started: Schema.optional<typeof Schema.String>;
|
|
9
|
-
ended: Schema.optional<typeof Schema.String>;
|
|
10
|
-
/**
|
|
11
|
-
* Queue containing TranscriptBlock objects.
|
|
12
|
-
*/
|
|
13
|
-
queue: Type.ref<Schema.Schema<Queue<Obj.Any | import("@dxos/echo/Relation").Any>, Queue<Obj.Any | import("@dxos/echo/Relation").Any>, never>>;
|
|
14
|
-
}>>;
|
|
15
|
-
export type Transcript = Schema.Schema.Type<typeof Transcript>;
|
|
16
|
-
/**
|
|
17
|
-
* First message in queue.
|
|
18
|
-
* Contains metadata for the recording and transcript.
|
|
19
|
-
*/
|
|
20
|
-
declare const TranscriptHeader: Schema.Struct<{
|
|
21
|
-
started: Schema.optional<typeof Schema.String>;
|
|
22
|
-
}>;
|
|
23
|
-
export type TranscriptHeader = Schema.Schema.Type<typeof TranscriptHeader>;
|
|
24
|
-
export declare const makeTranscript: (queueDxn: DXN) => import("@dxos/live-object").Live<Type.OfKind<import("@dxos/echo/internal").EntityKind.Object> & {
|
|
25
|
-
started?: string | undefined;
|
|
26
|
-
ended?: string | undefined;
|
|
27
|
-
queue: import("@dxos/echo/internal").Ref<Queue<Obj.Any | import("@dxos/echo/Relation").Any>>;
|
|
28
|
-
}>;
|
|
29
|
-
export {};
|
|
30
|
-
//# sourceMappingURL=Transcript.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"Transcript.d.ts","sourceRoot":"","sources":["../../../../src/types/Transcript.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,KAAK,GAAG,EAAE,GAAG,EAAO,IAAI,EAAE,MAAM,YAAY,CAAC;AAEtD;;GAEG;AACH,eAAO,MAAM,UAAU;;;IAMrB;;OAEG;;GAOJ,CAAC;AAEF,MAAM,MAAM,UAAU,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,UAAU,CAAC,CAAC;AAI/D;;;GAGG;AACH,QAAA,MAAM,gBAAgB;;EAEpB,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAE3E,eAAO,MAAM,cAAc,GAAI,UAAU,GAAG;;;;EAA2D,CAAC"}
|
|
@@ -1,31 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Capabilities, contributes } from '@dxos/app-framework';
|
|
6
|
-
import { Blueprint, Template } from '@dxos/blueprints';
|
|
7
|
-
import { type FunctionDefinition } from '@dxos/functions';
|
|
8
|
-
import { trim } from '@dxos/util';
|
|
9
|
-
|
|
10
|
-
import { open, summarize } from '../functions';
|
|
11
|
-
|
|
12
|
-
const functions: FunctionDefinition[] = [open, summarize];
|
|
13
|
-
|
|
14
|
-
export default () => {
|
|
15
|
-
return [
|
|
16
|
-
contributes(Capabilities.Functions, functions),
|
|
17
|
-
contributes(
|
|
18
|
-
Capabilities.BlueprintDefinition,
|
|
19
|
-
Blueprint.make({
|
|
20
|
-
key: 'dxos.org/blueprint/transcription',
|
|
21
|
-
name: 'Transcription',
|
|
22
|
-
tools: Blueprint.toolDefinitions({ functions }),
|
|
23
|
-
instructions: Template.make({
|
|
24
|
-
source: trim`
|
|
25
|
-
You can open and summarize a meeting transcript.
|
|
26
|
-
`,
|
|
27
|
-
}),
|
|
28
|
-
}),
|
|
29
|
-
),
|
|
30
|
-
];
|
|
31
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { Capabilities, type PluginContext, contributes, createResolver } from '@dxos/app-framework';
|
|
6
|
-
|
|
7
|
-
import { Transcript, TranscriptAction } from '../types';
|
|
8
|
-
|
|
9
|
-
export default (context: PluginContext) =>
|
|
10
|
-
contributes(Capabilities.IntentResolver, [
|
|
11
|
-
createResolver({
|
|
12
|
-
intent: TranscriptAction.Create,
|
|
13
|
-
resolve: ({ name, space }) => {
|
|
14
|
-
const transcript = Transcript.makeTranscript(space.queues.create().dxn);
|
|
15
|
-
return { data: { object: transcript } };
|
|
16
|
-
},
|
|
17
|
-
}),
|
|
18
|
-
]);
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
import { Capabilities, contributes, createSurface } from '@dxos/app-framework';
|
|
8
|
-
import { Obj } from '@dxos/echo';
|
|
9
|
-
|
|
10
|
-
import { TranscriptionContainer } from '../components';
|
|
11
|
-
import { meta } from '../meta';
|
|
12
|
-
import { Transcript } from '../types';
|
|
13
|
-
|
|
14
|
-
export default () =>
|
|
15
|
-
contributes(Capabilities.ReactSurface, [
|
|
16
|
-
createSurface({
|
|
17
|
-
id: `${meta.id}/article/transcript`,
|
|
18
|
-
role: ['article', 'section'],
|
|
19
|
-
filter: (data): data is { subject: Transcript.Transcript } => Obj.instanceOf(Transcript.Transcript, data.subject),
|
|
20
|
-
component: ({ data, role }) => <TranscriptionContainer transcript={data.subject} role={role} />,
|
|
21
|
-
}),
|
|
22
|
-
]);
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type PluginContext, contributes } from '@dxos/app-framework';
|
|
6
|
-
import { ClientCapabilities } from '@dxos/plugin-client';
|
|
7
|
-
|
|
8
|
-
import { MediaStreamRecorder, Transcriber, TranscriptionManager } from '../transcriber';
|
|
9
|
-
|
|
10
|
-
import { TranscriptionCapabilities } from './capabilities';
|
|
11
|
-
|
|
12
|
-
// TODO(burdon): Move to config?
|
|
13
|
-
|
|
14
|
-
/**
|
|
15
|
-
* Length of the chunk in ms.
|
|
16
|
-
*/
|
|
17
|
-
const RECORD_INTERVAL = 200;
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Number of chunks to save before the user starts speaking.
|
|
21
|
-
*/
|
|
22
|
-
const PREFIXED_CHUNKS_AMOUNT = 10;
|
|
23
|
-
|
|
24
|
-
/**
|
|
25
|
-
* Number of chunks to transcribe automatically after.
|
|
26
|
-
* Combined should be mess than 25MB or whisper would fail.
|
|
27
|
-
*/
|
|
28
|
-
const TRANSCRIBE_AFTER_CHUNKS_AMOUNT = 50;
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* Records audio while user is speaking and transcribes it after user is done speaking.
|
|
32
|
-
*/
|
|
33
|
-
export default (context: PluginContext) => {
|
|
34
|
-
const getTranscriber: TranscriptionCapabilities.GetTranscriber = ({
|
|
35
|
-
audioStreamTrack,
|
|
36
|
-
onSegments,
|
|
37
|
-
transcriberConfig,
|
|
38
|
-
recorderConfig,
|
|
39
|
-
}) => {
|
|
40
|
-
// Initialize audio transcription.
|
|
41
|
-
return new Transcriber({
|
|
42
|
-
config: {
|
|
43
|
-
transcribeAfterChunksAmount: TRANSCRIBE_AFTER_CHUNKS_AMOUNT,
|
|
44
|
-
prefixBufferChunksAmount: PREFIXED_CHUNKS_AMOUNT,
|
|
45
|
-
...transcriberConfig,
|
|
46
|
-
},
|
|
47
|
-
recorder: new MediaStreamRecorder({
|
|
48
|
-
mediaStreamTrack: audioStreamTrack,
|
|
49
|
-
config: {
|
|
50
|
-
interval: RECORD_INTERVAL,
|
|
51
|
-
...recorderConfig,
|
|
52
|
-
},
|
|
53
|
-
}),
|
|
54
|
-
onSegments,
|
|
55
|
-
});
|
|
56
|
-
};
|
|
57
|
-
|
|
58
|
-
const getTranscriptionManager: TranscriptionCapabilities.GetTranscriptionManager = ({ messageEnricher }) => {
|
|
59
|
-
const client = context.getCapability(ClientCapabilities.Client);
|
|
60
|
-
const transcriptionManager = new TranscriptionManager({
|
|
61
|
-
edgeClient: client.edge,
|
|
62
|
-
messageEnricher,
|
|
63
|
-
});
|
|
64
|
-
|
|
65
|
-
const identity = client.halo.identity.get();
|
|
66
|
-
if (identity) {
|
|
67
|
-
transcriptionManager.setIdentityDid(identity.did);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
return transcriptionManager;
|
|
71
|
-
};
|
|
72
|
-
|
|
73
|
-
return [
|
|
74
|
-
contributes(TranscriptionCapabilities.Transcriber, getTranscriber),
|
|
75
|
-
contributes(TranscriptionCapabilities.TranscriptionManager, getTranscriptionManager),
|
|
76
|
-
];
|
|
77
|
-
};
|
|
@@ -1,93 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
import { type Space } from '@dxos/react-client/echo';
|
|
8
|
-
import { type Identity } from '@dxos/react-client/halo';
|
|
9
|
-
import { type ThemedClassName, useThemeContext } from '@dxos/react-ui';
|
|
10
|
-
import {
|
|
11
|
-
autoScroll,
|
|
12
|
-
createBasicExtensions,
|
|
13
|
-
createMarkdownExtensions,
|
|
14
|
-
createThemeExtensions,
|
|
15
|
-
decorateMarkdown,
|
|
16
|
-
preview,
|
|
17
|
-
useTextEditor,
|
|
18
|
-
} from '@dxos/react-ui-editor';
|
|
19
|
-
import { mx } from '@dxos/react-ui-theme';
|
|
20
|
-
import { type DataType } from '@dxos/schema';
|
|
21
|
-
import { isTruthy } from '@dxos/util';
|
|
22
|
-
|
|
23
|
-
import { type SerializationModel } from '../../model';
|
|
24
|
-
import { type Transcript } from '../../types';
|
|
25
|
-
|
|
26
|
-
import { transcript } from './transcript-extension';
|
|
27
|
-
|
|
28
|
-
// TODO(thure): Move this?
|
|
29
|
-
export const renderByline =
|
|
30
|
-
(identities: Identity[]) =>
|
|
31
|
-
(message: DataType.Message, index: number, debug = false): string[] => {
|
|
32
|
-
if (message.sender.role === 'assistant') {
|
|
33
|
-
// Start/stop block.
|
|
34
|
-
return [message.blocks.find((block) => block._tag === 'transcript')?.text ?? '', ''];
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
// TODO(burdon): Use link/reference markup for users (with popover).
|
|
38
|
-
// TODO(burdon): Color and avatar.
|
|
39
|
-
const identity = identities.find((identity) => identity.did === message.sender.identityDid);
|
|
40
|
-
const name =
|
|
41
|
-
identity?.profile?.displayName ??
|
|
42
|
-
message.sender.contact?.target?.fullName ??
|
|
43
|
-
message.sender.name ??
|
|
44
|
-
message.sender.email ??
|
|
45
|
-
message.sender.identityDid;
|
|
46
|
-
const blocks = message.blocks.filter((block) => block._tag === 'transcript');
|
|
47
|
-
return [
|
|
48
|
-
// TODO(thure): Use an XML tag with the bits needed here.
|
|
49
|
-
`###### ${name}` + (debug ? ` [${index}]:${message.id}` : ''),
|
|
50
|
-
blocks.map((block) => block.text.trim()).join(' '),
|
|
51
|
-
'',
|
|
52
|
-
];
|
|
53
|
-
};
|
|
54
|
-
|
|
55
|
-
export type TranscriptViewProps = ThemedClassName<{
|
|
56
|
-
space?: Space;
|
|
57
|
-
transcript?: Transcript.Transcript;
|
|
58
|
-
model: SerializationModel<DataType.Message>;
|
|
59
|
-
// TODO(burdon): Are these still in use?
|
|
60
|
-
attendableId?: string;
|
|
61
|
-
ignoreAttention?: boolean;
|
|
62
|
-
}>;
|
|
63
|
-
|
|
64
|
-
/**
|
|
65
|
-
* Transcript component implemented using the editor.
|
|
66
|
-
*/
|
|
67
|
-
export const TranscriptView = ({ classNames, space, transcript: object, model }: TranscriptViewProps) => {
|
|
68
|
-
const { themeMode } = useThemeContext();
|
|
69
|
-
const { parentRef } = useTextEditor(() => {
|
|
70
|
-
return {
|
|
71
|
-
extensions: [
|
|
72
|
-
createBasicExtensions({ readOnly: true, lineWrapping: true, search: true }),
|
|
73
|
-
createMarkdownExtensions(),
|
|
74
|
-
createThemeExtensions({ themeMode }),
|
|
75
|
-
decorateMarkdown(),
|
|
76
|
-
preview(),
|
|
77
|
-
transcript({
|
|
78
|
-
model,
|
|
79
|
-
started: object?.started ? new Date(object.started) : undefined,
|
|
80
|
-
}),
|
|
81
|
-
autoScroll(),
|
|
82
|
-
].filter(isTruthy),
|
|
83
|
-
};
|
|
84
|
-
}, [space, model]);
|
|
85
|
-
|
|
86
|
-
return (
|
|
87
|
-
<div
|
|
88
|
-
ref={parentRef}
|
|
89
|
-
className={mx('flex grow overflow-hidden container-max-width', classNames)}
|
|
90
|
-
data-popover-collision-boundary={true /* TODO(thure): Make this a constant and document it. */}
|
|
91
|
-
/>
|
|
92
|
-
);
|
|
93
|
-
};
|
|
@@ -1,260 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2023 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { intervalToDuration } from 'date-fns/intervalToDuration';
|
|
6
|
-
import * as Schema from 'effect/Schema';
|
|
7
|
-
import { yieldOrContinue } from 'main-thread-scheduling';
|
|
8
|
-
import React, { type FC, type WheelEvent, useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
9
|
-
import { type OnResizeCallback, useResizeDetector } from 'react-resize-detector';
|
|
10
|
-
|
|
11
|
-
import { Type } from '@dxos/echo';
|
|
12
|
-
import { IconButton, type ThemedClassName, useTranslation } from '@dxos/react-ui';
|
|
13
|
-
import { useAttention } from '@dxos/react-ui-attention';
|
|
14
|
-
import {
|
|
15
|
-
type DxGridAxisMeta,
|
|
16
|
-
type DxGridCellValue,
|
|
17
|
-
type DxGridElement,
|
|
18
|
-
type DxGridPlaneCells,
|
|
19
|
-
Grid,
|
|
20
|
-
toPlaneCellIndex,
|
|
21
|
-
} from '@dxos/react-ui-grid';
|
|
22
|
-
import { mx } from '@dxos/react-ui-theme';
|
|
23
|
-
|
|
24
|
-
import { meta } from '../../../meta';
|
|
25
|
-
|
|
26
|
-
/**
|
|
27
|
-
* Transcription fragment.
|
|
28
|
-
*/
|
|
29
|
-
const TranscriptSegment = Schema.Struct({
|
|
30
|
-
// TODO(burdon): TS from service is not Unix TS (x1000).
|
|
31
|
-
started: Schema.String,
|
|
32
|
-
text: Schema.String,
|
|
33
|
-
});
|
|
34
|
-
|
|
35
|
-
type TranscriptSegment = Schema.Schema.Type<typeof TranscriptSegment>;
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* Transcription block (from single speaker).
|
|
39
|
-
*/
|
|
40
|
-
const TranscriptBlock = Schema.Struct({
|
|
41
|
-
id: Schema.String,
|
|
42
|
-
authorName: Schema.optional(Schema.String), // TODO(burdon): Replace with identityDid.
|
|
43
|
-
authorHue: Schema.optional(Schema.String), // TOOD(burdon): Remove.
|
|
44
|
-
segments: Schema.Array(TranscriptSegment),
|
|
45
|
-
}).pipe(
|
|
46
|
-
Type.Obj({
|
|
47
|
-
typename: 'dxos.org/type/TranscriptBlock',
|
|
48
|
-
version: '0.1.0',
|
|
49
|
-
}),
|
|
50
|
-
);
|
|
51
|
-
|
|
52
|
-
type TranscriptBlock = Schema.Schema.Type<typeof TranscriptBlock>;
|
|
53
|
-
|
|
54
|
-
// TODO(burdon): Actions (e.g., mark, summarize, translate, label, delete).
|
|
55
|
-
|
|
56
|
-
const lineHeight = 20;
|
|
57
|
-
const cellSpacing = 8 + 2;
|
|
58
|
-
const timestampColumnWidth = 68;
|
|
59
|
-
|
|
60
|
-
const authorClasses = 'font-medium text-base leading-[20px]';
|
|
61
|
-
const timestampClasses = 'text-xs leading-[20px] text-description pie-0 tabular-nums';
|
|
62
|
-
const segmentTextClasses = 'text-sm whitespace-normal hyphens-auto';
|
|
63
|
-
const measureClasses = mx(
|
|
64
|
-
// NOTE(thure): The `inline-start` value must equal `timestampColumnWidth` plus grid’s gap (1px)
|
|
65
|
-
'absolute inline-start-[69px] inline-end-0 invisible z-[-1] border',
|
|
66
|
-
'pli-[--dx-grid-cell-padding-inline] plb-[--dx-grid-cell-padding-block] leading-[20px]',
|
|
67
|
-
segmentTextClasses,
|
|
68
|
-
);
|
|
69
|
-
|
|
70
|
-
const rowDefault = {
|
|
71
|
-
grid: { size: lineHeight + cellSpacing },
|
|
72
|
-
};
|
|
73
|
-
|
|
74
|
-
type QueueRows = [number, number][];
|
|
75
|
-
|
|
76
|
-
const mapTranscriptQueue = (blocks?: TranscriptBlock[]): QueueRows => {
|
|
77
|
-
if (!blocks || !Array.isArray(blocks) || blocks.length === 0) {
|
|
78
|
-
return [];
|
|
79
|
-
} else {
|
|
80
|
-
return blocks.flatMap((block, blockIndex) => {
|
|
81
|
-
return [
|
|
82
|
-
[blockIndex, -1],
|
|
83
|
-
...block.segments.map((segment, segmentIndex) => {
|
|
84
|
-
return [blockIndex, segmentIndex] as [number, number];
|
|
85
|
-
}),
|
|
86
|
-
];
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
};
|
|
90
|
-
|
|
91
|
-
const pad = (n = 0) => String(n).padStart(2, '0');
|
|
92
|
-
|
|
93
|
-
const formatTimestamp = (start: Date, end: Date) => {
|
|
94
|
-
const { hours, minutes, seconds } = intervalToDuration({ start, end });
|
|
95
|
-
return `${pad(hours)}:${pad(minutes)}:${pad(seconds)}`;
|
|
96
|
-
};
|
|
97
|
-
|
|
98
|
-
const measureRows = async (
|
|
99
|
-
host: HTMLDivElement,
|
|
100
|
-
blocks: TranscriptBlock[],
|
|
101
|
-
queueMap: QueueRows,
|
|
102
|
-
signal: AbortSignal,
|
|
103
|
-
) => {
|
|
104
|
-
const result: DxGridAxisMeta = { grid: {} };
|
|
105
|
-
for (let row = 0; row < queueMap.length; row++) {
|
|
106
|
-
await yieldOrContinue('smooth', signal);
|
|
107
|
-
const [blockIndex, segmentIndex] = queueMap[row];
|
|
108
|
-
if (segmentIndex < 0) {
|
|
109
|
-
result.grid[row] = { size: lineHeight + cellSpacing };
|
|
110
|
-
} else {
|
|
111
|
-
host.textContent = blocks[blockIndex]!.segments[segmentIndex]!.text;
|
|
112
|
-
result.grid[row] = { size: host.offsetHeight };
|
|
113
|
-
}
|
|
114
|
-
}
|
|
115
|
-
return result;
|
|
116
|
-
};
|
|
117
|
-
|
|
118
|
-
export type TranscriptViewProps = ThemedClassName<{
|
|
119
|
-
blocks?: TranscriptBlock[];
|
|
120
|
-
attendableId?: string;
|
|
121
|
-
ignoreAttention?: boolean;
|
|
122
|
-
}>;
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* @@deprecated
|
|
126
|
-
*/
|
|
127
|
-
export const Transcript: FC<TranscriptViewProps> = ({ classNames, blocks, attendableId, ignoreAttention }) => {
|
|
128
|
-
const { t } = useTranslation(meta.id);
|
|
129
|
-
const [dxGrid, setDxGrid] = useState<DxGridElement | null>(null);
|
|
130
|
-
const [rows, setRows] = useState<DxGridAxisMeta | undefined>(undefined);
|
|
131
|
-
const [columns, setColumns] = useState<DxGridAxisMeta | undefined>(undefined);
|
|
132
|
-
|
|
133
|
-
const queueMap = useMemo(() => mapTranscriptQueue(blocks), [blocks]);
|
|
134
|
-
|
|
135
|
-
const { hasAttention } = useAttention(attendableId);
|
|
136
|
-
const [autoScroll, setAutoScroll] = useState(true);
|
|
137
|
-
const handleWheel = useCallback(
|
|
138
|
-
(event: WheelEvent) => {
|
|
139
|
-
setAutoScroll(false);
|
|
140
|
-
if (!ignoreAttention && !hasAttention) {
|
|
141
|
-
event.stopPropagation();
|
|
142
|
-
}
|
|
143
|
-
},
|
|
144
|
-
[hasAttention, ignoreAttention],
|
|
145
|
-
);
|
|
146
|
-
|
|
147
|
-
const abortControllerRef = useRef<AbortController>(null);
|
|
148
|
-
|
|
149
|
-
const handleResize = useCallback(
|
|
150
|
-
async ({ entry }: { entry: { target: HTMLDivElement } | null }) => {
|
|
151
|
-
if (entry?.target && Array.isArray(blocks) && blocks[0] && queueMap) {
|
|
152
|
-
abortControllerRef.current?.abort();
|
|
153
|
-
abortControllerRef.current = new AbortController();
|
|
154
|
-
setColumns({ grid: { 0: { size: timestampColumnWidth }, 1: { size: entry.target.offsetWidth } } });
|
|
155
|
-
return measureRows(entry.target, blocks, queueMap, abortControllerRef.current.signal)
|
|
156
|
-
.then(setRows)
|
|
157
|
-
.catch(() => {
|
|
158
|
-
// Aborted mid-measurement by new size.
|
|
159
|
-
});
|
|
160
|
-
}
|
|
161
|
-
},
|
|
162
|
-
[blocks, queueMap],
|
|
163
|
-
);
|
|
164
|
-
|
|
165
|
-
const { width, ref: measureRef } = useResizeDetector({
|
|
166
|
-
onResize: handleResize as OnResizeCallback,
|
|
167
|
-
refreshOptions: { leading: true },
|
|
168
|
-
});
|
|
169
|
-
|
|
170
|
-
useEffect(() => {
|
|
171
|
-
if (queueMap.length !== Object.keys(rows?.grid ?? {}).length) {
|
|
172
|
-
void handleResize({ entry: { target: measureRef.current } }).then(() => {
|
|
173
|
-
if (autoScroll) {
|
|
174
|
-
// TODO(thure): Implement a deterministic way to do this when `rows` has fully settled and grid has a new `maxPosBlock`.
|
|
175
|
-
setTimeout(() => dxGrid?.scrollToEndRow(), 50);
|
|
176
|
-
}
|
|
177
|
-
});
|
|
178
|
-
}
|
|
179
|
-
}, [blocks, queueMap, width, autoScroll]);
|
|
180
|
-
|
|
181
|
-
useEffect(() => {
|
|
182
|
-
if (dxGrid && Array.isArray(blocks) && blocks[0]) {
|
|
183
|
-
const transcriptStart = blocks[0]!.segments[0]!.started;
|
|
184
|
-
dxGrid.getCells = (range, plane) => {
|
|
185
|
-
switch (plane) {
|
|
186
|
-
case 'grid': {
|
|
187
|
-
const cells: DxGridPlaneCells = {};
|
|
188
|
-
for (let row = range.start.row; row <= range.end.row && row < queueMap.length; row++) {
|
|
189
|
-
const [blockIndex, segmentIndex] = queueMap[row];
|
|
190
|
-
|
|
191
|
-
cells[toPlaneCellIndex({ col: 0, row })] = {
|
|
192
|
-
readonly: true,
|
|
193
|
-
value:
|
|
194
|
-
segmentIndex < 0
|
|
195
|
-
? formatTimestamp(
|
|
196
|
-
new Date(transcriptStart),
|
|
197
|
-
new Date(blocks[blockIndex]!.segments[Math.max(0, segmentIndex)]!.started),
|
|
198
|
-
)
|
|
199
|
-
: '',
|
|
200
|
-
className: timestampClasses,
|
|
201
|
-
} satisfies DxGridCellValue;
|
|
202
|
-
|
|
203
|
-
cells[toPlaneCellIndex({ col: 1, row })] = (
|
|
204
|
-
segmentIndex < 0
|
|
205
|
-
? {
|
|
206
|
-
readonly: true,
|
|
207
|
-
accessoryHtml: `<span data-hue="${blocks[blockIndex]!.authorHue}" class="dx-text-hue">${blocks[blockIndex]!.authorName}</span>`,
|
|
208
|
-
className: authorClasses,
|
|
209
|
-
}
|
|
210
|
-
: {
|
|
211
|
-
readonly: true,
|
|
212
|
-
value: blocks[blockIndex]!.segments[segmentIndex]!.text,
|
|
213
|
-
className: segmentTextClasses,
|
|
214
|
-
}
|
|
215
|
-
) satisfies DxGridCellValue;
|
|
216
|
-
}
|
|
217
|
-
return cells;
|
|
218
|
-
}
|
|
219
|
-
default:
|
|
220
|
-
return {};
|
|
221
|
-
}
|
|
222
|
-
};
|
|
223
|
-
}
|
|
224
|
-
}, [dxGrid, blocks]);
|
|
225
|
-
|
|
226
|
-
const handleScrollToEnd = useCallback(() => {
|
|
227
|
-
setAutoScroll(true);
|
|
228
|
-
dxGrid?.scrollToEndRow();
|
|
229
|
-
}, [dxGrid, autoScroll]);
|
|
230
|
-
|
|
231
|
-
return (
|
|
232
|
-
<div role='none' className={mx('relative min-bs-0', classNames)}>
|
|
233
|
-
<Grid.Root id={`${attendableId}--transcript`}>
|
|
234
|
-
<Grid.Content
|
|
235
|
-
limitColumns={2}
|
|
236
|
-
limitRows={queueMap.length}
|
|
237
|
-
columns={columns}
|
|
238
|
-
rows={rows}
|
|
239
|
-
rowDefault={rowDefault}
|
|
240
|
-
onWheel={handleWheel}
|
|
241
|
-
className='[--dx-grid-base:var(--dx-baseSurface)] [--dx-grid-lines:var(--dx-baseSurface)] [&_.dx-grid]:min-bs-0 [&_.dx-grid]:min-is-0 [&_.dx-grid]:select-auto'
|
|
242
|
-
ref={setDxGrid}
|
|
243
|
-
/>
|
|
244
|
-
</Grid.Root>
|
|
245
|
-
<div role='none' {...{ inert: true }} aria-hidden className={measureClasses} ref={measureRef} />
|
|
246
|
-
<IconButton
|
|
247
|
-
icon='ph--arrow-line-down--regular'
|
|
248
|
-
iconOnly
|
|
249
|
-
label={t('scroll to end label')}
|
|
250
|
-
tooltipSide='left'
|
|
251
|
-
data-state={autoScroll ? 'invisible' : 'visible'}
|
|
252
|
-
classNames={[
|
|
253
|
-
'absolute inline-end-2 block-end-2 opacity-0 pointer-events-none',
|
|
254
|
-
'data-[state="visible"]:pointer-events-auto data-[state="visible"]:opacity-100 transition-opacity',
|
|
255
|
-
]}
|
|
256
|
-
onClick={handleScrollToEnd}
|
|
257
|
-
/>
|
|
258
|
-
</div>
|
|
259
|
-
);
|
|
260
|
-
};
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2024 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
import { fullyQualifiedId, getSpace } from '@dxos/client/echo';
|
|
8
|
-
import { useMembers, useQueue } from '@dxos/react-client/echo';
|
|
9
|
-
import { StackItem } from '@dxos/react-ui-stack';
|
|
10
|
-
import { type DataType } from '@dxos/schema';
|
|
11
|
-
|
|
12
|
-
import { useQueueModelAdapter } from '../hooks';
|
|
13
|
-
import { type Transcript } from '../types';
|
|
14
|
-
|
|
15
|
-
import { TranscriptView, renderByline } from './Transcript';
|
|
16
|
-
|
|
17
|
-
export type TranscriptionContainerProps = {
|
|
18
|
-
role: string;
|
|
19
|
-
transcript: Transcript.Transcript;
|
|
20
|
-
};
|
|
21
|
-
|
|
22
|
-
export const TranscriptionContainer = ({ transcript }: TranscriptionContainerProps) => {
|
|
23
|
-
const attendableId = fullyQualifiedId(transcript);
|
|
24
|
-
const space = getSpace(transcript);
|
|
25
|
-
const members = useMembers(space?.key).map((member) => member.identity);
|
|
26
|
-
const queue = useQueue<DataType.Message>(transcript.queue.dxn, { pollInterval: 1_000 });
|
|
27
|
-
const model = useQueueModelAdapter(renderByline(members), queue);
|
|
28
|
-
|
|
29
|
-
return (
|
|
30
|
-
<StackItem.Content>
|
|
31
|
-
<TranscriptView attendableId={attendableId} space={space} model={model} transcript={transcript} />
|
|
32
|
-
</StackItem.Content>
|
|
33
|
-
);
|
|
34
|
-
};
|
|
35
|
-
|
|
36
|
-
export default TranscriptionContainer;
|
package/src/types/Transcript.ts
DELETED
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import * as Schema from 'effect/Schema';
|
|
6
|
-
|
|
7
|
-
import { Queue } from '@dxos/client/echo';
|
|
8
|
-
import { type DXN, Obj, Ref, Type } from '@dxos/echo';
|
|
9
|
-
|
|
10
|
-
/**
|
|
11
|
-
* Root transcript object created when the user starts a transcription.
|
|
12
|
-
*/
|
|
13
|
-
export const Transcript = Schema.Struct({
|
|
14
|
-
// TODO(wittjosiah): Remove?
|
|
15
|
-
// TODO(burdon): Use Date or string?
|
|
16
|
-
started: Schema.optional(Schema.String),
|
|
17
|
-
ended: Schema.optional(Schema.String),
|
|
18
|
-
|
|
19
|
-
/**
|
|
20
|
-
* Queue containing TranscriptBlock objects.
|
|
21
|
-
*/
|
|
22
|
-
queue: Type.Ref(Queue),
|
|
23
|
-
}).pipe(
|
|
24
|
-
Type.Obj({
|
|
25
|
-
typename: 'dxos.org/type/Transcript',
|
|
26
|
-
version: '0.1.0',
|
|
27
|
-
}),
|
|
28
|
-
);
|
|
29
|
-
|
|
30
|
-
export type Transcript = Schema.Schema.Type<typeof Transcript>;
|
|
31
|
-
|
|
32
|
-
// TODO(burdon): Do these need to be kept in sync with EDGE?
|
|
33
|
-
|
|
34
|
-
/**
|
|
35
|
-
* First message in queue.
|
|
36
|
-
* Contains metadata for the recording and transcript.
|
|
37
|
-
*/
|
|
38
|
-
const TranscriptHeader = Schema.Struct({
|
|
39
|
-
started: Schema.optional(Schema.String),
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
export type TranscriptHeader = Schema.Schema.Type<typeof TranscriptHeader>;
|
|
43
|
-
|
|
44
|
-
export const makeTranscript = (queueDxn: DXN) => Obj.make(Transcript, { queue: Ref.fromDXN(queueDxn) });
|
|
File without changes
|
/package/dist/lib/{node-esm/TranscriptContainer-WCUWVVSD.mjs.map → browser/chunk-J5LGTIGS.mjs.map}
RENAMED
|
File without changes
|