@dxos/plugin-transcription 0.8.1-main.ba2dec9 → 0.8.1-staging.31c3ee1
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-N4KQHMY4.mjs → TranscriptContainer-JQ3HFHLQ.mjs} +3 -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-6ZR5MDK3.mjs +19 -0
- package/dist/lib/browser/chunk-6ZR5MDK3.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-GHTRJTEB.mjs → chunk-GU2BNYKZ.mjs} +6 -6
- package/dist/lib/browser/chunk-GU2BNYKZ.mjs.map +7 -0
- package/dist/lib/browser/chunk-K7FOYAXO.mjs +8 -0
- package/dist/lib/browser/{chunk-QIHUPVQD.mjs → chunk-OGNXNGJB.mjs} +21 -28
- package/dist/lib/browser/chunk-OGNXNGJB.mjs.map +7 -0
- package/dist/lib/browser/chunk-YCZISX63.mjs +464 -0
- package/dist/lib/browser/chunk-YCZISX63.mjs.map +7 -0
- package/dist/lib/browser/chunk-YEPT334A.mjs +16 -0
- package/dist/lib/browser/chunk-YEPT334A.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +69 -512
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/{intent-resolver-RW6DEJC2.mjs → intent-resolver-4R66ZCKT.mjs} +8 -7
- package/dist/lib/browser/intent-resolver-4R66ZCKT.mjs.map +7 -0
- package/dist/lib/browser/meeting-transcription-state-DLFHQK72.mjs +18 -0
- 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-UPTZBHVB.mjs → react-surface-FQUHU5G7.mjs} +15 -9
- package/dist/lib/{node-esm/react-surface-2WJQ67LB.mjs.map → browser/react-surface-FQUHU5G7.mjs.map} +2 -2
- package/dist/lib/browser/transcriber-LGMIWDYI.mjs +36 -0
- package/dist/lib/browser/transcriber-LGMIWDYI.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +2 -1
- package/dist/lib/node/{TranscriptContainer-4BWXOVML.cjs → TranscriptContainer-QEYTTT2V.cjs} +8 -8
- package/dist/lib/node/{TranscriptContainer-4BWXOVML.cjs.map → TranscriptContainer-QEYTTT2V.cjs.map} +2 -2
- 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-HDRXDMK2.cjs → chunk-3KHUSQNW.cjs} +6 -6
- package/dist/lib/node/chunk-3KHUSQNW.cjs.map +7 -0
- package/dist/lib/node/chunk-CZMLKKWT.cjs +35 -0
- package/dist/lib/node/chunk-CZMLKKWT.cjs.map +7 -0
- package/dist/lib/node/chunk-FCCJALOT.cjs +488 -0
- package/dist/lib/node/chunk-FCCJALOT.cjs.map +7 -0
- package/dist/lib/node/{chunk-I35KHI2G.cjs → chunk-LP4FG423.cjs} +5 -5
- package/dist/lib/node/chunk-NVZWGFJL.cjs +42 -0
- package/dist/lib/node/chunk-NVZWGFJL.cjs.map +7 -0
- package/dist/lib/node/{chunk-UIHEGU6Q.cjs → chunk-P4VVD6ZO.cjs} +21 -29
- 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 +75 -513
- package/dist/lib/node/index.cjs.map +4 -4
- package/dist/lib/node/{intent-resolver-KLBZ25XJ.cjs → intent-resolver-WMMCOUEH.cjs} +12 -11
- package/dist/lib/node/intent-resolver-WMMCOUEH.cjs.map +7 -0
- package/dist/lib/node/{app-graph-builder-YFBX3OTP.cjs → meeting-transcription-state-URIYILEQ.cjs} +14 -6
- 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-NCKXB7EQ.cjs → react-surface-WI2MGWCC.cjs} +17 -12
- package/dist/lib/node/{react-surface-NCKXB7EQ.cjs.map → react-surface-WI2MGWCC.cjs.map} +2 -2
- package/dist/lib/node/transcriber-QG5WPKX4.cjs +49 -0
- package/dist/lib/node/transcriber-QG5WPKX4.cjs.map +7 -0
- package/dist/lib/node/types/index.cjs +8 -7
- package/dist/lib/node/types/index.cjs.map +2 -2
- package/dist/lib/node-esm/{TranscriptContainer-6IKRASR6.mjs → TranscriptContainer-ZXUCOWGY.mjs} +3 -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-KEG3ME4O.mjs → chunk-GIO6J6FE.mjs} +20 -28
- package/dist/lib/node-esm/chunk-GIO6J6FE.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-LORUIVS4.mjs → chunk-HKATMD34.mjs} +6 -6
- package/dist/lib/node-esm/chunk-HKATMD34.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-2CPKXRN6.mjs → chunk-J4D2RBBH.mjs} +3 -3
- package/dist/lib/node-esm/chunk-PTZHDZ36.mjs +17 -0
- package/dist/lib/node-esm/chunk-PTZHDZ36.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-X4DDJIVL.mjs +21 -0
- package/dist/lib/node-esm/chunk-X4DDJIVL.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-YQYBLFNI.mjs +465 -0
- package/dist/lib/node-esm/chunk-YQYBLFNI.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +69 -512
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/{intent-resolver-4FMISUPW.mjs → intent-resolver-QN2LO5TX.mjs} +8 -7
- package/dist/lib/node-esm/intent-resolver-QN2LO5TX.mjs.map +7 -0
- package/dist/lib/node-esm/meeting-transcription-state-ZYVRAW6Y.mjs +19 -0
- 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-2WJQ67LB.mjs → react-surface-PCH6NTVB.mjs} +15 -9
- package/dist/lib/{browser/react-surface-UPTZBHVB.mjs.map → node-esm/react-surface-PCH6NTVB.mjs.map} +2 -2
- package/dist/lib/node-esm/transcriber-TMPYZ5L4.mjs +37 -0
- package/dist/lib/node-esm/transcriber-TMPYZ5L4.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +2 -1
- package/dist/types/src/TranscriptionPlugin.d.ts.map +1 -1
- package/dist/types/src/capabilities/app-graph-builder.d.ts +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -1
- package/dist/types/src/capabilities/capabilities.d.ts +16 -1
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -1
- package/dist/types/src/capabilities/index.d.ts +5 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -1
- package/dist/types/src/capabilities/meeting-transcription-state.d.ts +6 -0
- package/dist/types/src/capabilities/meeting-transcription-state.d.ts.map +1 -0
- package/dist/types/src/capabilities/transcriber.d.ts +7 -0
- package/dist/types/src/capabilities/transcriber.d.ts.map +1 -0
- package/dist/types/src/components/Transcript/Transcript.d.ts +5 -2
- package/dist/types/src/components/Transcript/Transcript.d.ts.map +1 -1
- package/dist/types/src/components/Transcript/Transcript.stories.d.ts.map +1 -1
- package/dist/types/src/components/TranscriptContainer.d.ts +1 -0
- package/dist/types/src/components/TranscriptContainer.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -0
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/components/transcription.stories.d.ts +1 -1
- package/dist/types/src/components/transcription.stories.d.ts.map +1 -1
- package/dist/types/src/hooks/useTranscriber.d.ts +3 -6
- package/dist/types/src/hooks/useTranscriber.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -2
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -9
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/transcriber/index.d.ts +1 -0
- package/dist/types/src/transcriber/index.d.ts.map +1 -1
- package/dist/types/src/{transcription-manager.d.ts → transcriber/transcription-manager.d.ts} +5 -2
- package/dist/types/src/transcriber/transcription-manager.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +14 -18
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +13 -19
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +2 -6
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util/random-queue-dxn.d.ts +2 -2
- package/dist/types/src/util/random-queue-dxn.d.ts.map +1 -1
- package/package.json +40 -36
- package/src/TranscriptionPlugin.tsx +24 -7
- package/src/capabilities/app-graph-builder.ts +147 -2
- package/src/capabilities/capabilities.ts +16 -2
- package/src/capabilities/index.ts +2 -0
- package/src/capabilities/intent-resolver.ts +4 -3
- package/src/capabilities/meeting-transcription-state.ts +16 -0
- package/src/capabilities/react-surface.tsx +3 -3
- package/src/capabilities/transcriber.ts +48 -0
- package/src/components/Transcript/Transcript.stories.tsx +46 -27
- package/src/components/Transcript/Transcript.tsx +206 -50
- package/src/components/TranscriptContainer.tsx +9 -147
- package/src/components/transcription.stories.tsx +11 -13
- package/src/hooks/useTranscriber.ts +12 -37
- package/src/index.ts +2 -2
- package/src/meta.ts +2 -2
- package/src/transcriber/index.ts +1 -0
- package/src/{transcription-manager.ts → transcriber/transcription-manager.ts} +16 -5
- package/src/translations.ts +6 -6
- package/src/types/schema.ts +7 -5
- package/src/types/types.ts +4 -2
- package/src/util/random-queue-dxn.ts +2 -2
- package/dist/lib/browser/app-graph-builder-ZSSJIFY7.mjs +0 -7
- package/dist/lib/browser/app-graph-builder-ZSSJIFY7.mjs.map +0 -7
- package/dist/lib/browser/chunk-BDVUIRBP.mjs +0 -8
- package/dist/lib/browser/chunk-GHTRJTEB.mjs.map +0 -7
- package/dist/lib/browser/chunk-QIHUPVQD.mjs.map +0 -7
- package/dist/lib/browser/chunk-YX447BJ4.mjs +0 -241
- package/dist/lib/browser/chunk-YX447BJ4.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-RW6DEJC2.mjs.map +0 -7
- package/dist/lib/node/app-graph-builder-YFBX3OTP.cjs.map +0 -7
- package/dist/lib/node/chunk-ANSWGFMS.cjs +0 -267
- package/dist/lib/node/chunk-ANSWGFMS.cjs.map +0 -7
- package/dist/lib/node/chunk-HDRXDMK2.cjs.map +0 -7
- package/dist/lib/node/chunk-UIHEGU6Q.cjs.map +0 -7
- package/dist/lib/node/intent-resolver-KLBZ25XJ.cjs.map +0 -7
- package/dist/lib/node-esm/app-graph-builder-77GQG6UF.mjs +0 -9
- package/dist/lib/node-esm/app-graph-builder-77GQG6UF.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-KEG3ME4O.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-LORUIVS4.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-ZMK2QLW2.mjs +0 -242
- package/dist/lib/node-esm/chunk-ZMK2QLW2.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-4FMISUPW.mjs.map +0 -7
- package/dist/types/src/transcription-manager.d.ts.map +0 -1
- /package/dist/lib/browser/{TranscriptContainer-N4KQHMY4.mjs.map → TranscriptContainer-JQ3HFHLQ.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-BDVUIRBP.mjs.map → chunk-K7FOYAXO.mjs.map} +0 -0
- /package/dist/lib/node/{chunk-I35KHI2G.cjs.map → chunk-LP4FG423.cjs.map} +0 -0
- /package/dist/lib/node-esm/{TranscriptContainer-6IKRASR6.mjs.map → TranscriptContainer-ZXUCOWGY.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-2CPKXRN6.mjs.map → chunk-J4D2RBBH.mjs.map} +0 -0
|
@@ -2,68 +2,224 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import
|
|
5
|
+
import { intervalToDuration } from 'date-fns/intervalToDuration';
|
|
6
|
+
import { yieldOrContinue } from 'main-thread-scheduling';
|
|
7
|
+
import React, { type FC, useCallback, useEffect, useMemo, useRef, useState, type WheelEvent } from 'react';
|
|
8
|
+
import { type OnResizeCallback, useResizeDetector } from 'react-resize-detector';
|
|
7
9
|
|
|
8
|
-
import {
|
|
10
|
+
import { IconButton, type ThemedClassName, useTranslation } from '@dxos/react-ui';
|
|
11
|
+
import { useAttention } from '@dxos/react-ui-attention';
|
|
12
|
+
import {
|
|
13
|
+
type DxGridCellValue,
|
|
14
|
+
type DxGridElement,
|
|
15
|
+
type DxGridAxisMeta,
|
|
16
|
+
type DxGridPlaneCells,
|
|
17
|
+
Grid,
|
|
18
|
+
toPlaneCellIndex,
|
|
19
|
+
} from '@dxos/react-ui-grid';
|
|
20
|
+
import { mx } from '@dxos/react-ui-theme';
|
|
9
21
|
|
|
10
22
|
import { TRANSCRIPTION_PLUGIN } from '../../meta';
|
|
11
23
|
import { type TranscriptBlock } from '../../types';
|
|
12
24
|
|
|
13
|
-
// TODO(burdon): react-ui-list.
|
|
14
25
|
// TODO(burdon): Actions (e.g., mark, summarize, translate, label, delete).
|
|
15
26
|
|
|
16
|
-
|
|
17
|
-
|
|
27
|
+
const lineHeight = 20;
|
|
28
|
+
const cellSpacing = 8 + 2;
|
|
29
|
+
const timestampColumnWidth = 68;
|
|
30
|
+
|
|
31
|
+
const authorClasses = 'font-medium text-base leading-[20px]';
|
|
32
|
+
const timestampClasses = 'text-xs leading-[20px] text-description pie-0 tabular-nums';
|
|
33
|
+
const segmentTextClasses = 'text-sm whitespace-normal hyphens-auto';
|
|
34
|
+
const measureClasses = mx(
|
|
35
|
+
// NOTE(thure): The `inline-start` value must equal `timestampColumnWidth` plus grid’s gap (1px)
|
|
36
|
+
'absolute inline-start-[69px] inline-end-0 invisible z-[-1] border',
|
|
37
|
+
'pli-[--dx-grid-cell-padding-inline] plb-[--dx-grid-cell-padding-block] leading-[20px]',
|
|
38
|
+
segmentTextClasses,
|
|
39
|
+
);
|
|
40
|
+
|
|
41
|
+
const rowDefault = {
|
|
42
|
+
grid: { size: lineHeight + cellSpacing },
|
|
18
43
|
};
|
|
19
44
|
|
|
20
|
-
|
|
45
|
+
type QueueRows = [number, number][];
|
|
46
|
+
|
|
47
|
+
const mapTranscriptQueue = (blocks?: TranscriptBlock[]): QueueRows => {
|
|
48
|
+
if (!blocks || !Array.isArray(blocks) || blocks.length === 0) {
|
|
49
|
+
return [];
|
|
50
|
+
} else {
|
|
51
|
+
return blocks.flatMap((block, blockIndex) => {
|
|
52
|
+
return [
|
|
53
|
+
[blockIndex, -1],
|
|
54
|
+
...block.segments.map((segment, segmentIndex) => {
|
|
55
|
+
return [blockIndex, segmentIndex] as [number, number];
|
|
56
|
+
}),
|
|
57
|
+
];
|
|
58
|
+
});
|
|
59
|
+
}
|
|
60
|
+
};
|
|
61
|
+
|
|
62
|
+
const pad = (n = 0) => String(n).padStart(2, '0');
|
|
63
|
+
|
|
64
|
+
const formatTimestamp = (start: Date, end: Date) => {
|
|
65
|
+
const { hours, minutes, seconds } = intervalToDuration({ start, end });
|
|
66
|
+
return `${pad(hours)}:${pad(minutes)}:${pad(seconds)}`;
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
const measureRows = async (
|
|
70
|
+
host: HTMLDivElement,
|
|
71
|
+
blocks: TranscriptBlock[],
|
|
72
|
+
queueMap: QueueRows,
|
|
73
|
+
signal: AbortSignal,
|
|
74
|
+
) => {
|
|
75
|
+
const result: DxGridAxisMeta = { grid: {} };
|
|
76
|
+
for (let row = 0; row < queueMap.length; row++) {
|
|
77
|
+
await yieldOrContinue('smooth', signal);
|
|
78
|
+
const [blockIndex, segmentIndex] = queueMap[row];
|
|
79
|
+
if (segmentIndex < 0) {
|
|
80
|
+
result.grid[row] = { size: lineHeight + cellSpacing };
|
|
81
|
+
} else {
|
|
82
|
+
host.textContent = blocks[blockIndex]!.segments[segmentIndex]!.text;
|
|
83
|
+
result.grid[row] = { size: host.offsetHeight };
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return result;
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
export type TranscriptProps = ThemedClassName<{
|
|
90
|
+
blocks?: TranscriptBlock[];
|
|
91
|
+
attendableId?: string;
|
|
92
|
+
ignoreAttention?: boolean;
|
|
93
|
+
}>;
|
|
94
|
+
|
|
95
|
+
export const Transcript: FC<TranscriptProps> = ({ classNames, blocks, attendableId, ignoreAttention }) => {
|
|
21
96
|
const { t } = useTranslation(TRANSCRIPTION_PLUGIN);
|
|
22
|
-
const
|
|
97
|
+
const { hasAttention } = useAttention(attendableId);
|
|
98
|
+
const [dxGrid, setDxGrid] = useState<DxGridElement | null>(null);
|
|
99
|
+
const [rows, setRows] = useState<DxGridAxisMeta | undefined>(undefined);
|
|
100
|
+
const [columns, setColumns] = useState<DxGridAxisMeta | undefined>(undefined);
|
|
101
|
+
const [autoScroll, setAutoScroll] = useState(true);
|
|
102
|
+
|
|
103
|
+
const queueMap = useMemo(() => mapTranscriptQueue(blocks), [blocks]);
|
|
104
|
+
|
|
105
|
+
const handleWheel = useCallback(
|
|
106
|
+
(event: WheelEvent) => {
|
|
107
|
+
setAutoScroll(false);
|
|
108
|
+
if (!ignoreAttention && !hasAttention) {
|
|
109
|
+
event.stopPropagation();
|
|
110
|
+
}
|
|
111
|
+
},
|
|
112
|
+
[hasAttention, ignoreAttention],
|
|
113
|
+
);
|
|
114
|
+
|
|
115
|
+
const abortControllerRef = useRef<AbortController>();
|
|
116
|
+
|
|
117
|
+
const handleResize = useCallback(
|
|
118
|
+
async ({ entry }: { entry: { target: HTMLDivElement } | null }) => {
|
|
119
|
+
if (entry?.target && Array.isArray(blocks) && blocks[0] && queueMap) {
|
|
120
|
+
abortControllerRef.current?.abort();
|
|
121
|
+
abortControllerRef.current = new AbortController();
|
|
122
|
+
setColumns({ grid: { 0: { size: timestampColumnWidth }, 1: { size: entry.target.offsetWidth } } });
|
|
123
|
+
return measureRows(entry.target, blocks, queueMap, abortControllerRef.current.signal)
|
|
124
|
+
.then(setRows)
|
|
125
|
+
.catch(() => {
|
|
126
|
+
// Aborted mid-measurement by new size.
|
|
127
|
+
});
|
|
128
|
+
}
|
|
129
|
+
},
|
|
130
|
+
[blocks, queueMap],
|
|
131
|
+
);
|
|
132
|
+
|
|
133
|
+
const { width, ref: measureRef } = useResizeDetector({
|
|
134
|
+
onResize: handleResize as OnResizeCallback,
|
|
135
|
+
refreshOptions: { leading: true },
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
useEffect(() => {
|
|
139
|
+
if (queueMap.length !== Object.keys(rows?.grid ?? {}).length) {
|
|
140
|
+
void handleResize({ entry: { target: measureRef.current } }).then(() => {
|
|
141
|
+
if (autoScroll) {
|
|
142
|
+
// TODO(thure): Implement a deterministic way to do this when `rows` has fully settled and grid has a new `maxPosBlock`.
|
|
143
|
+
setTimeout(() => dxGrid?.scrollToEndRow(), 50);
|
|
144
|
+
}
|
|
145
|
+
});
|
|
146
|
+
}
|
|
147
|
+
}, [blocks, queueMap, width, autoScroll]);
|
|
148
|
+
|
|
149
|
+
useEffect(() => {
|
|
150
|
+
if (dxGrid && Array.isArray(blocks) && blocks[0]) {
|
|
151
|
+
const transcriptStart = blocks[0]!.segments[0]!.started;
|
|
152
|
+
dxGrid.getCells = (range, plane) => {
|
|
153
|
+
switch (plane) {
|
|
154
|
+
case 'grid': {
|
|
155
|
+
const cells: DxGridPlaneCells = {};
|
|
156
|
+
for (let row = range.start.row; row <= range.end.row && row < queueMap.length; row++) {
|
|
157
|
+
const [blockIndex, segmentIndex] = queueMap[row];
|
|
158
|
+
|
|
159
|
+
cells[toPlaneCellIndex({ col: 0, row })] = {
|
|
160
|
+
readonly: true,
|
|
161
|
+
value:
|
|
162
|
+
segmentIndex < 0
|
|
163
|
+
? formatTimestamp(transcriptStart, blocks[blockIndex]!.segments[Math.max(0, segmentIndex)]!.started)
|
|
164
|
+
: '',
|
|
165
|
+
className: timestampClasses,
|
|
166
|
+
} satisfies DxGridCellValue;
|
|
167
|
+
|
|
168
|
+
cells[toPlaneCellIndex({ col: 1, row })] = (
|
|
169
|
+
segmentIndex < 0
|
|
170
|
+
? {
|
|
171
|
+
readonly: true,
|
|
172
|
+
accessoryHtml: `<span data-hue="${blocks[blockIndex]!.authorHue}" class="dx-text-hue">${blocks[blockIndex]!.authorName}</span>`,
|
|
173
|
+
className: authorClasses,
|
|
174
|
+
}
|
|
175
|
+
: {
|
|
176
|
+
readonly: true,
|
|
177
|
+
value: blocks[blockIndex]!.segments[segmentIndex]!.text,
|
|
178
|
+
className: segmentTextClasses,
|
|
179
|
+
}
|
|
180
|
+
) satisfies DxGridCellValue;
|
|
181
|
+
}
|
|
182
|
+
return cells;
|
|
183
|
+
}
|
|
184
|
+
default:
|
|
185
|
+
return {};
|
|
186
|
+
}
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
}, [dxGrid, blocks]);
|
|
190
|
+
|
|
191
|
+
const handleScrollToEnd = useCallback(() => {
|
|
192
|
+
setAutoScroll(true);
|
|
193
|
+
dxGrid?.scrollToEndRow();
|
|
194
|
+
}, [dxGrid, autoScroll]);
|
|
23
195
|
|
|
24
196
|
return (
|
|
25
|
-
<div role='
|
|
26
|
-
{
|
|
27
|
-
<
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
<div className='truncate text-xs text-subdued'>
|
|
52
|
-
{formatDistanceToNow(segment.started, { addSuffix: true })}
|
|
53
|
-
</div>
|
|
54
|
-
<IconButton
|
|
55
|
-
disabled
|
|
56
|
-
icon='ph--bookmark-simple--regular'
|
|
57
|
-
label={t('bookmark button')}
|
|
58
|
-
iconOnly
|
|
59
|
-
size={4}
|
|
60
|
-
classNames={hoverButton}
|
|
61
|
-
/>
|
|
62
|
-
</div>
|
|
63
|
-
</div>
|
|
64
|
-
))}
|
|
65
|
-
</div>
|
|
66
|
-
))}
|
|
197
|
+
<div role='none' className={mx('relative min-bs-0', classNames)}>
|
|
198
|
+
<Grid.Root id={`${attendableId}--transcript`}>
|
|
199
|
+
<Grid.Content
|
|
200
|
+
limitColumns={2}
|
|
201
|
+
limitRows={queueMap.length}
|
|
202
|
+
columns={columns}
|
|
203
|
+
rows={rows}
|
|
204
|
+
rowDefault={rowDefault}
|
|
205
|
+
onWheel={handleWheel}
|
|
206
|
+
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'
|
|
207
|
+
ref={setDxGrid}
|
|
208
|
+
/>
|
|
209
|
+
</Grid.Root>
|
|
210
|
+
<div role='none' {...{ inert: '' }} aria-hidden className={measureClasses} ref={measureRef} />
|
|
211
|
+
<IconButton
|
|
212
|
+
icon='ph--arrow-line-down--regular'
|
|
213
|
+
iconOnly
|
|
214
|
+
label={t('scroll to end label')}
|
|
215
|
+
tooltipSide='left'
|
|
216
|
+
data-state={autoScroll ? 'invisible' : 'visible'}
|
|
217
|
+
classNames={[
|
|
218
|
+
'absolute inline-end-2 block-end-2 opacity-0 pointer-events-none',
|
|
219
|
+
'data-[state="visible"]:pointer-events-auto data-[state="visible"]:opacity-100 transition-opacity',
|
|
220
|
+
]}
|
|
221
|
+
onClick={handleScrollToEnd}
|
|
222
|
+
/>
|
|
67
223
|
</div>
|
|
68
224
|
);
|
|
69
225
|
};
|
|
@@ -2,162 +2,24 @@
|
|
|
2
2
|
// Copyright 2024 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
6
|
-
import React, { useCallback, useMemo, useState, type FC } from 'react';
|
|
5
|
+
import React, { type FC } from 'react';
|
|
7
6
|
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import { AIServiceEdgeClient, DEFAULT_LLM_MODEL, MixedStreamParser, type AIServiceClient } from '@dxos/assistant';
|
|
11
|
-
import { create, getSpace, makeRef } from '@dxos/client/echo';
|
|
12
|
-
import { QueueImpl } from '@dxos/echo-db';
|
|
13
|
-
import { createStatic, isInstanceOf } from '@dxos/echo-schema';
|
|
14
|
-
import { invariant } from '@dxos/invariant';
|
|
15
|
-
import { DXN } from '@dxos/keys';
|
|
16
|
-
import { log } from '@dxos/log';
|
|
17
|
-
import { DocumentType } from '@dxos/plugin-markdown/types';
|
|
18
|
-
import { CollectionType, SpaceAction } from '@dxos/plugin-space/types';
|
|
19
|
-
import { useConfig } from '@dxos/react-client';
|
|
20
|
-
import { useEdgeClient, useQueue, type EdgeHttpClient } from '@dxos/react-edge-client';
|
|
21
|
-
import { IconButton, Toolbar, useTranslation } from '@dxos/react-ui';
|
|
22
|
-
import { ScrollContainer } from '@dxos/react-ui-components';
|
|
7
|
+
import { fullyQualifiedId } from '@dxos/client/echo';
|
|
8
|
+
import { useQueue } from '@dxos/react-client/echo';
|
|
23
9
|
import { StackItem } from '@dxos/react-ui-stack';
|
|
24
|
-
import { TextType } from '@dxos/schema';
|
|
25
10
|
|
|
26
11
|
import { Transcript } from './Transcript';
|
|
27
|
-
import {
|
|
28
|
-
import { TranscriptBlock, type TranscriptType } from '../types';
|
|
12
|
+
import { type TranscriptBlock, type TranscriptType } from '../types';
|
|
29
13
|
|
|
30
|
-
export const TranscriptionContainer: FC<{ transcript: TranscriptType }> = ({ transcript }) => {
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
const ai = useAiServiceClient();
|
|
34
|
-
const { dispatchPromise: dispatch } = useIntentDispatcher();
|
|
14
|
+
export const TranscriptionContainer: FC<{ role: string; transcript: TranscriptType }> = ({ role, transcript }) => {
|
|
15
|
+
const attendableId = fullyQualifiedId(transcript);
|
|
16
|
+
const queue = useQueue<TranscriptBlock>(transcript.queue.dxn, { pollInterval: 1_000 });
|
|
35
17
|
|
|
36
|
-
const queue = useQueue<TranscriptBlock>(edge, transcript.queue ? DXN.parse(transcript.queue) : undefined, {
|
|
37
|
-
pollInterval: 1_000,
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
// TODO(dmaretskyi): Pending state and errors should be handled by the framework!!!
|
|
41
|
-
const [isSummarizing, setIsSummarizing] = useState(false);
|
|
42
|
-
const handleSummarize = useCallback(async () => {
|
|
43
|
-
setIsSummarizing(true);
|
|
44
|
-
try {
|
|
45
|
-
const document = await summarizeTranscript(edge, ai, transcript);
|
|
46
|
-
const space = getSpace(transcript);
|
|
47
|
-
const target = space?.properties[CollectionType.typename]?.target;
|
|
48
|
-
await dispatch(
|
|
49
|
-
pipe(
|
|
50
|
-
createIntent(SpaceAction.AddObject, { object: document, target }),
|
|
51
|
-
chain(LayoutAction.Open, { part: 'main' }),
|
|
52
|
-
),
|
|
53
|
-
);
|
|
54
|
-
} finally {
|
|
55
|
-
setIsSummarizing(false);
|
|
56
|
-
}
|
|
57
|
-
}, [transcript, edge]);
|
|
58
|
-
|
|
59
|
-
// TODO(dmaretskyi): Move action to menu.
|
|
60
18
|
return (
|
|
61
|
-
<StackItem.Content
|
|
62
|
-
<
|
|
63
|
-
<Toolbar.Root classNames='flex gap-2'>
|
|
64
|
-
<IconButton
|
|
65
|
-
icon='ph--subtitles--regular'
|
|
66
|
-
iconOnly
|
|
67
|
-
size={5}
|
|
68
|
-
disabled={isSummarizing}
|
|
69
|
-
onClick={handleSummarize}
|
|
70
|
-
label={t('summary button')}
|
|
71
|
-
/>
|
|
72
|
-
{isSummarizing && <div className='text-sm'>{t('summarizing label')}</div>}
|
|
73
|
-
</Toolbar.Root>
|
|
74
|
-
</StackItem.Heading>
|
|
75
|
-
<ScrollContainer>
|
|
76
|
-
<Transcript blocks={queue?.items} />
|
|
77
|
-
</ScrollContainer>
|
|
19
|
+
<StackItem.Content role={role} classNames='container-max-width pli-2'>
|
|
20
|
+
<Transcript attendableId={attendableId} blocks={queue?.items} />
|
|
78
21
|
</StackItem.Content>
|
|
79
22
|
);
|
|
80
23
|
};
|
|
81
24
|
|
|
82
25
|
export default TranscriptionContainer;
|
|
83
|
-
|
|
84
|
-
// TODO(dmaretskyi): Extract to the new file once transcript refactoring has settled.
|
|
85
|
-
const summarizeTranscript = async (edge: EdgeHttpClient, ai: AIServiceClient, transcript: TranscriptType) => {
|
|
86
|
-
invariant(transcript.queue, 'No queue found for transcript');
|
|
87
|
-
|
|
88
|
-
const queue = new QueueImpl(edge, DXN.parse(transcript.queue));
|
|
89
|
-
await queue.refresh();
|
|
90
|
-
const content = queue.items
|
|
91
|
-
.filter((block) => isInstanceOf(TranscriptBlock, block))
|
|
92
|
-
.map((block) => `${block.author}: ${block.segments.map((segment) => segment.text).join('\n')}`)
|
|
93
|
-
.join('\n\n');
|
|
94
|
-
|
|
95
|
-
const parser = new MixedStreamParser();
|
|
96
|
-
|
|
97
|
-
log.info('summarizing transcript', { blockCount: queue.items.length });
|
|
98
|
-
const output = await parser.parse(
|
|
99
|
-
await ai.exec({
|
|
100
|
-
model: DEFAULT_LLM_MODEL,
|
|
101
|
-
systemPrompt: SUMMARIZE_PROMPT,
|
|
102
|
-
history: [createStatic(Message, { role: 'user', content: [{ type: 'text', text: content }] })],
|
|
103
|
-
}),
|
|
104
|
-
);
|
|
105
|
-
|
|
106
|
-
log.info('transcript summary', { output });
|
|
107
|
-
invariant(output[0].content[0].type === 'text', 'Expected text content');
|
|
108
|
-
const summary = output[0].content[0].text;
|
|
109
|
-
|
|
110
|
-
// TODO(dmaretskyi): .started is missing.
|
|
111
|
-
const name = `Summary ${(transcript.started ?? new Date()).toLocaleString('en-US', {
|
|
112
|
-
year: 'numeric',
|
|
113
|
-
month: 'long',
|
|
114
|
-
day: 'numeric',
|
|
115
|
-
hour: '2-digit',
|
|
116
|
-
minute: '2-digit',
|
|
117
|
-
})}`;
|
|
118
|
-
|
|
119
|
-
return create(DocumentType, {
|
|
120
|
-
name,
|
|
121
|
-
content: makeRef(create(TextType, { content: summary })),
|
|
122
|
-
threads: [],
|
|
123
|
-
});
|
|
124
|
-
};
|
|
125
|
-
|
|
126
|
-
// TODO(dmaretskyi): Add example to set consistent structure for the summary.
|
|
127
|
-
const SUMMARIZE_PROMPT = `
|
|
128
|
-
# Goal
|
|
129
|
-
Create a markdown summary of the transcript provided.
|
|
130
|
-
|
|
131
|
-
# Formatting
|
|
132
|
-
- Format the summary as a markdown document without extra comments like "Here is the summary of the transcript:".
|
|
133
|
-
- Use markdown formatting for headings and bullet points.
|
|
134
|
-
- Format the summary as a list of key points and takeaways.
|
|
135
|
-
- All names of people should be in bold.
|
|
136
|
-
|
|
137
|
-
# Note Taking
|
|
138
|
-
- Correlate items in the summary with the person of origin to build a coherent narrative.
|
|
139
|
-
- Include short quotes verbatim where appropriate. Especially when concerned with design decisions and problem descriptions.
|
|
140
|
-
|
|
141
|
-
# Tasks
|
|
142
|
-
At the end of the summary include tasks.
|
|
143
|
-
Extract only the tasks that are:
|
|
144
|
-
- Directly actionable.
|
|
145
|
-
- Clearly assigned to a person or team (or can easily be inferred).
|
|
146
|
-
- Strongly implied by the conversation and/or user note (no speculative tasks).
|
|
147
|
-
- Specific enough that someone reading them would know exactly what to do next.
|
|
148
|
-
|
|
149
|
-
Format all tasks as markdown checkboxes using the syntax:
|
|
150
|
-
- [ ] Task description
|
|
151
|
-
|
|
152
|
-
Additional information can be included (indented).
|
|
153
|
-
|
|
154
|
-
If no actionable tasks are found, omit this tasks section.
|
|
155
|
-
`;
|
|
156
|
-
|
|
157
|
-
// TODO(dmaretskyi): Extract?
|
|
158
|
-
// Also this conflicts with plugin automation providing the ai client via a capability. Need to reconcile.
|
|
159
|
-
const useAiServiceClient = (): AIServiceClient => {
|
|
160
|
-
const config = useConfig();
|
|
161
|
-
const endpoint = config.values.runtime?.services?.ai?.server ?? 'http://localhost:8788'; // TOOD(burdon): Standardize consts.
|
|
162
|
-
return useMemo(() => new AIServiceEdgeClient({ endpoint }), [endpoint]);
|
|
163
|
-
};
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
|
|
5
5
|
import '@dxos-theme';
|
|
6
6
|
|
|
7
|
-
import { type
|
|
7
|
+
import { type Meta, type StoryObj } from '@storybook/react';
|
|
8
8
|
import React, {
|
|
9
9
|
type Dispatch,
|
|
10
10
|
type FC,
|
|
@@ -20,19 +20,19 @@ import { createStatic } from '@dxos/echo-schema';
|
|
|
20
20
|
import { type DXN } from '@dxos/keys';
|
|
21
21
|
import { log } from '@dxos/log';
|
|
22
22
|
import { Config } from '@dxos/react-client';
|
|
23
|
+
import { useQueue } from '@dxos/react-client/echo';
|
|
23
24
|
import { withClientProvider } from '@dxos/react-client/testing';
|
|
24
|
-
import { useEdgeClient, useQueue } from '@dxos/react-edge-client';
|
|
25
25
|
import { IconButton, Toolbar } from '@dxos/react-ui';
|
|
26
26
|
import { ScrollContainer } from '@dxos/react-ui-components';
|
|
27
|
-
import {
|
|
27
|
+
import { withLayout, withTheme } from '@dxos/storybook-utils';
|
|
28
28
|
|
|
29
29
|
import { Transcript } from './Transcript';
|
|
30
|
-
import {
|
|
30
|
+
import { useAudioFile, useAudioTrack, useTranscriber } from '../hooks';
|
|
31
31
|
import { type TranscriberParams } from '../transcriber';
|
|
32
32
|
import { TranscriptBlock } from '../types';
|
|
33
33
|
import { randomQueueDxn } from '../util';
|
|
34
34
|
|
|
35
|
-
const
|
|
35
|
+
const TranscriptionStory: FC<{
|
|
36
36
|
playing: boolean;
|
|
37
37
|
setPlaying: Dispatch<SetStateAction<boolean>>;
|
|
38
38
|
blocks?: TranscriptBlock[];
|
|
@@ -48,7 +48,7 @@ const UX: FC<{
|
|
|
48
48
|
/>
|
|
49
49
|
</Toolbar.Root>
|
|
50
50
|
<ScrollContainer>
|
|
51
|
-
<Transcript blocks={blocks} />
|
|
51
|
+
<Transcript blocks={blocks} attendableId='story' />
|
|
52
52
|
</ScrollContainer>
|
|
53
53
|
</div>
|
|
54
54
|
);
|
|
@@ -62,8 +62,7 @@ const Microphone = () => {
|
|
|
62
62
|
|
|
63
63
|
// Queue.
|
|
64
64
|
const queueDxn = useMemo(() => randomQueueDxn(), []);
|
|
65
|
-
const
|
|
66
|
-
const queue = useQueue<TranscriptBlock>(echoClient, queueDxn, { pollInterval: 500 });
|
|
65
|
+
const queue = useQueue<TranscriptBlock>(queueDxn, { pollInterval: 500 });
|
|
67
66
|
|
|
68
67
|
// Transcriber.
|
|
69
68
|
const handleSegments = useCallback<TranscriberParams['onSegments']>(
|
|
@@ -90,7 +89,7 @@ const Microphone = () => {
|
|
|
90
89
|
}
|
|
91
90
|
}, [transcriber, playing, transcriber?.isOpen]);
|
|
92
91
|
|
|
93
|
-
return <
|
|
92
|
+
return <TranscriptionStory playing={playing} setPlaying={setPlaying} blocks={queue?.items} />;
|
|
94
93
|
};
|
|
95
94
|
|
|
96
95
|
const AudioFile = ({ queueDxn, audioUrl }: { queueDxn: DXN; audioUrl: string; transcriptUrl: string }) => {
|
|
@@ -119,11 +118,10 @@ const AudioFile = ({ queueDxn, audioUrl }: { queueDxn: DXN; audioUrl: string; tr
|
|
|
119
118
|
}, [audio, playing]);
|
|
120
119
|
|
|
121
120
|
// Transcriber.
|
|
122
|
-
const
|
|
123
|
-
const queue = useQueue<TranscriptBlock>(echoClient, queueDxn, { pollInterval: 500 });
|
|
121
|
+
const queue = useQueue<TranscriptBlock>(queueDxn, { pollInterval: 500 });
|
|
124
122
|
const handleSegments = useCallback<TranscriberParams['onSegments']>(
|
|
125
123
|
async (segments) => {
|
|
126
|
-
const block = createStatic(TranscriptBlock, {
|
|
124
|
+
const block = createStatic(TranscriptBlock, { authorName: 'test', authorHue: 'cyan', segments });
|
|
127
125
|
queue?.append([block]);
|
|
128
126
|
},
|
|
129
127
|
[queue],
|
|
@@ -153,7 +151,7 @@ const AudioFile = ({ queueDxn, audioUrl }: { queueDxn: DXN; audioUrl: string; tr
|
|
|
153
151
|
}
|
|
154
152
|
}, [transcriber, track?.readyState, transcriber?.isOpen]);
|
|
155
153
|
|
|
156
|
-
return <
|
|
154
|
+
return <TranscriptionStory playing={playing} setPlaying={setPlaying} blocks={queue?.items} />;
|
|
157
155
|
};
|
|
158
156
|
|
|
159
157
|
const meta: Meta<typeof AudioFile> = {
|
|
@@ -4,53 +4,28 @@
|
|
|
4
4
|
|
|
5
5
|
import { useEffect, useMemo } from 'react';
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import { useCapabilities } from '@dxos/app-framework';
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* Length of the chunk in ms.
|
|
13
|
-
*/
|
|
14
|
-
const RECORD_INTERVAL = 200;
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* Number of chunks to save before the user starts speaking.
|
|
18
|
-
*/
|
|
19
|
-
const PREFIXED_CHUNKS_AMOUNT = 10;
|
|
20
|
-
|
|
21
|
-
/**
|
|
22
|
-
* Number of chunks to transcribe automatically after.
|
|
23
|
-
* Combined should be mess than 25MB or whisper would fail.
|
|
24
|
-
*/
|
|
25
|
-
const TRANSCRIBE_AFTER_CHUNKS_AMOUNT = 50;
|
|
26
|
-
|
|
27
|
-
export type UseTranscriberProps = {
|
|
28
|
-
audioStreamTrack?: MediaStreamTrack;
|
|
29
|
-
onSegments?: TranscriberParams['onSegments'];
|
|
30
|
-
};
|
|
9
|
+
import { TranscriptionCapabilities } from '../capabilities';
|
|
10
|
+
import { type Transcriber } from '../transcriber';
|
|
31
11
|
|
|
32
12
|
/**
|
|
33
13
|
* Records audio while user is speaking and transcribes it after user is done speaking.
|
|
34
14
|
*/
|
|
35
|
-
export const useTranscriber = ({
|
|
15
|
+
export const useTranscriber = ({
|
|
16
|
+
audioStreamTrack,
|
|
17
|
+
onSegments,
|
|
18
|
+
}: Partial<TranscriptionCapabilities.GetTranscriberProps>) => {
|
|
19
|
+
const [getTranscriber] = useCapabilities(TranscriptionCapabilities.Transcriber);
|
|
20
|
+
|
|
36
21
|
// Initialize audio transcription.
|
|
37
22
|
const transcriber = useMemo<Transcriber | undefined>(() => {
|
|
38
|
-
if (!onSegments || !audioStreamTrack) {
|
|
23
|
+
if (!onSegments || !audioStreamTrack || !getTranscriber) {
|
|
39
24
|
return undefined;
|
|
40
25
|
}
|
|
41
26
|
|
|
42
|
-
return
|
|
43
|
-
|
|
44
|
-
transcribeAfterChunksAmount: TRANSCRIBE_AFTER_CHUNKS_AMOUNT,
|
|
45
|
-
prefixBufferChunksAmount: PREFIXED_CHUNKS_AMOUNT,
|
|
46
|
-
},
|
|
47
|
-
recorder: new MediaStreamRecorder({
|
|
48
|
-
mediaStreamTrack: audioStreamTrack,
|
|
49
|
-
interval: RECORD_INTERVAL,
|
|
50
|
-
}),
|
|
51
|
-
onSegments,
|
|
52
|
-
});
|
|
53
|
-
}, [audioStreamTrack, onSegments]);
|
|
27
|
+
return getTranscriber({ audioStreamTrack, onSegments });
|
|
28
|
+
}, [audioStreamTrack, onSegments, getTranscriber]);
|
|
54
29
|
|
|
55
30
|
useEffect(() => {
|
|
56
31
|
return () => {
|
package/src/index.ts
CHANGED
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
export
|
|
5
|
+
export { TranscriptionCapabilities } from './capabilities';
|
|
6
|
+
|
|
6
7
|
export * from './components';
|
|
7
8
|
export * from './hooks';
|
|
8
9
|
export * from './meta';
|
|
9
10
|
export * from './transcriber';
|
|
10
|
-
export * from './transcription-manager';
|
|
11
11
|
|
|
12
12
|
export * from './TranscriptionPlugin';
|
package/src/meta.ts
CHANGED
|
@@ -6,7 +6,7 @@ import { type PluginMeta } from '@dxos/app-framework';
|
|
|
6
6
|
|
|
7
7
|
export const TRANSCRIPTION_PLUGIN = 'dxos.org/plugin/transcription';
|
|
8
8
|
|
|
9
|
-
export const meta = {
|
|
9
|
+
export const meta: PluginMeta = {
|
|
10
10
|
id: TRANSCRIPTION_PLUGIN,
|
|
11
11
|
name: 'Transcription',
|
|
12
12
|
description: 'Voice transcription.',
|
|
@@ -14,4 +14,4 @@ export const meta = {
|
|
|
14
14
|
source: 'https://github.com/dxos/dxos/tree/main/packages/plugins/experimental/plugin-transcription',
|
|
15
15
|
tags: ['experimental'],
|
|
16
16
|
screenshots: [],
|
|
17
|
-
}
|
|
17
|
+
};
|
package/src/transcriber/index.ts
CHANGED