@dxos/plugin-transcription 0.8.4-main.72ec0f3 → 0.8.4-main.937b3ca
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-6EHKWVS4.mjs +12 -0
- package/dist/lib/browser/blueprint-definition-FTRNMLJZ.mjs +18 -0
- package/dist/lib/browser/blueprint-definition-FTRNMLJZ.mjs.map +7 -0
- package/dist/lib/browser/blueprints/index.mjs +9 -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-EHT3TE6U.mjs → chunk-ICM7JRCO.mjs} +57 -97
- package/dist/lib/browser/chunk-ICM7JRCO.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-Q5OC3WVG.mjs +72 -0
- package/dist/lib/browser/chunk-Q5OC3WVG.mjs.map +7 -0
- package/dist/lib/browser/{chunk-OCI42DWB.mjs → chunk-SYGEFDWO.mjs} +2 -2
- package/dist/lib/browser/{chunk-PVU4XCKI.mjs → chunk-TKFU53OZ.mjs} +17 -23
- package/dist/lib/browser/chunk-TKFU53OZ.mjs.map +7 -0
- package/dist/lib/browser/{blueprint-definition-WBWHO4OH.mjs → chunk-ZZF7ICVM.mjs} +30 -30
- package/dist/lib/browser/chunk-ZZF7ICVM.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +59 -72
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operation-resolver-ZUWTU7C5.mjs +22 -0
- package/dist/lib/browser/operation-resolver-ZUWTU7C5.mjs.map +7 -0
- package/dist/lib/browser/react-surface-ZXH5267I.mjs +34 -0
- package/dist/lib/browser/react-surface-ZXH5267I.mjs.map +7 -0
- package/dist/lib/browser/{transcriber-E2KAOXPS.mjs → transcriber-EZZTUCPE.mjs} +17 -13
- package/dist/lib/browser/transcriber-EZZTUCPE.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +7 -5
- package/dist/lib/node-esm/{TranscriptContainer-WU3EDQR3.mjs → TranscriptContainer-5YT5W73I.mjs} +5 -4
- package/dist/lib/node-esm/TranscriptContainer-5YT5W73I.mjs.map +7 -0
- package/dist/lib/node-esm/blueprint-definition-IOX35YUX.mjs +19 -0
- package/dist/lib/node-esm/blueprint-definition-IOX35YUX.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-7XASA7DX.mjs → chunk-BX2AB7S7.mjs} +57 -97
- package/dist/lib/node-esm/chunk-BX2AB7S7.mjs.map +7 -0
- package/dist/lib/node-esm/{blueprint-definition-WUHZFRWZ.mjs → chunk-CWP22IHV.mjs} +30 -30
- package/dist/lib/node-esm/chunk-CWP22IHV.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-UVOYXXDJ.mjs → chunk-EPC27WWV.mjs} +17 -23
- package/dist/lib/node-esm/chunk-EPC27WWV.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-X5BKN32O.mjs → chunk-GVAVEVZ6.mjs} +2 -2
- 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 +59 -72
- 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-Z72B4H2Q.mjs +23 -0
- package/dist/lib/node-esm/operation-resolver-Z72B4H2Q.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-6GUBZX2V.mjs +35 -0
- package/dist/lib/node-esm/react-surface-6GUBZX2V.mjs.map +7 -0
- package/dist/lib/node-esm/{transcriber-ZPJM4U2W.mjs → transcriber-RGW3YYT4.mjs} +17 -13
- package/dist/lib/node-esm/transcriber-RGW3YYT4.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +7 -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 +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 +9 -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/Transcript/Transcript.d.ts +4 -7
- package/dist/types/src/components/Transcript/Transcript.d.ts.map +1 -1
- package/dist/types/src/components/Transcript/Transcript.stories.d.ts +2 -1
- package/dist/types/src/components/Transcript/Transcript.stories.d.ts.map +1 -1
- package/dist/types/src/components/Transcript/deprecated/OldTranscript.d.ts +9 -9
- package/dist/types/src/components/Transcript/deprecated/OldTranscript.d.ts.map +1 -1
- package/dist/types/src/components/TranscriptContainer.d.ts +4 -6
- package/dist/types/src/components/TranscriptContainer.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -1
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/components/stories/FileTranscription.stories.d.ts +3 -3
- package/dist/types/src/components/stories/FileTranscription.stories.d.ts.map +1 -1
- package/dist/types/src/components/stories/MicrophoneTranscription.stories.d.ts +3 -3
- package/dist/types/src/components/stories/MicrophoneTranscription.stories.d.ts.map +1 -1
- package/dist/types/src/components/stories/TranscriptionStory.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 +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 +2 -2
- package/dist/types/src/segments-normalization/message-normalizer.d.ts.map +1 -1
- package/dist/types/src/segments-normalization/normalization.d.ts +501 -456
- package/dist/types/src/segments-normalization/normalization.d.ts.map +1 -1
- package/dist/types/src/testing/testing.d.ts +4 -4
- 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 +2 -2
- package/dist/types/src/transcriber/transcriber.d.ts.map +1 -1
- package/dist/types/src/transcriber/transcription-manager.d.ts +6 -3
- 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 +83 -71
- package/src/TranscriptionPlugin.tsx +34 -58
- package/src/blueprints/index.ts +5 -0
- package/src/blueprints/transcription-blueprint.ts +25 -0
- package/src/capabilities/blueprint-definition/blueprint-definition.ts +23 -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 +27 -0
- package/src/capabilities/transcriber/index.ts +7 -0
- package/src/capabilities/transcriber/transcriber.ts +85 -0
- package/src/components/Transcript/Transcript.stories.tsx +31 -32
- package/src/components/Transcript/Transcript.tsx +8 -36
- package/src/components/Transcript/deprecated/OldTranscript.tsx +2 -2
- package/src/components/TranscriptContainer.tsx +12 -15
- package/src/components/stories/FileTranscription.stories.tsx +21 -26
- package/src/components/stories/KeyWordRecognition.stories.tsx +2 -2
- package/src/components/stories/MicrophoneTranscription.stories.tsx +41 -45
- package/src/components/stories/TranscriptionStory.tsx +1 -4
- package/src/functions/open.ts +5 -5
- package/src/hooks/useQueueModelAdapter.ts +1 -1
- package/src/hooks/useTranscriber.ts +1 -1
- package/src/hooks/useVoiceInput.ts +2 -2
- package/src/index.ts +1 -1
- package/src/meta.ts +2 -2
- package/src/model/model.test.ts +9 -3
- package/src/segments-normalization/message-normalizer.ts +12 -7
- package/src/segments-normalization/normalization.test.ts +0 -5
- package/src/testing/testing.ts +10 -5
- package/src/transcriber/media-stream-recorder.ts +3 -3
- package/src/transcriber/transcriber.browser.test.ts +1 -1
- package/src/transcriber/transcriber.ts +3 -3
- package/src/transcriber/transcription-manager.ts +15 -9
- 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-EKSP5DQ6.mjs +0 -11
- package/dist/lib/browser/blueprint-definition-WBWHO4OH.mjs.map +0 -7
- package/dist/lib/browser/chunk-3MKZ2MNQ.mjs +0 -16
- package/dist/lib/browser/chunk-3MKZ2MNQ.mjs.map +0 -7
- package/dist/lib/browser/chunk-EHT3TE6U.mjs.map +0 -7
- package/dist/lib/browser/chunk-PVU4XCKI.mjs.map +0 -7
- package/dist/lib/browser/chunk-VBUIO677.mjs +0 -29
- package/dist/lib/browser/chunk-VBUIO677.mjs.map +0 -7
- package/dist/lib/browser/chunk-W7WKZTM4.mjs +0 -63
- package/dist/lib/browser/chunk-W7WKZTM4.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-ZTKTEAQX.mjs +0 -25
- package/dist/lib/browser/intent-resolver-ZTKTEAQX.mjs.map +0 -7
- package/dist/lib/browser/react-surface-NARMYO2O.mjs +0 -34
- package/dist/lib/browser/react-surface-NARMYO2O.mjs.map +0 -7
- package/dist/lib/browser/transcriber-E2KAOXPS.mjs.map +0 -7
- package/dist/lib/node-esm/blueprint-definition-WUHZFRWZ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-7XASA7DX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-OLMSTF3M.mjs +0 -64
- package/dist/lib/node-esm/chunk-OLMSTF3M.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-SWUVPFKR.mjs +0 -17
- package/dist/lib/node-esm/chunk-SWUVPFKR.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-UVOYXXDJ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-YVNQN2J6.mjs +0 -30
- package/dist/lib/node-esm/chunk-YVNQN2J6.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-55WH2GY6.mjs +0 -26
- package/dist/lib/node-esm/intent-resolver-55WH2GY6.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-5MQA3IUS.mjs +0 -35
- package/dist/lib/node-esm/react-surface-5MQA3IUS.mjs.map +0 -7
- package/dist/lib/node-esm/transcriber-ZPJM4U2W.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/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/types/Transcript.ts +0 -44
- /package/dist/lib/browser/{TranscriptContainer-EKSP5DQ6.mjs.map → TranscriptContainer-6EHKWVS4.mjs.map} +0 -0
- /package/dist/lib/{node-esm/TranscriptContainer-WU3EDQR3.mjs.map → browser/blueprints/index.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-OCI42DWB.mjs.map → chunk-SYGEFDWO.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-X5BKN32O.mjs.map → chunk-GVAVEVZ6.mjs.map} +0 -0
package/src/index.ts
CHANGED
package/src/meta.ts
CHANGED
|
@@ -2,10 +2,10 @@
|
|
|
2
2
|
// Copyright 2023 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { type
|
|
5
|
+
import { type Plugin } from '@dxos/app-framework';
|
|
6
6
|
import { trim } from '@dxos/util';
|
|
7
7
|
|
|
8
|
-
export const meta:
|
|
8
|
+
export const meta: Plugin.Meta = {
|
|
9
9
|
id: 'dxos.org/plugin/transcription',
|
|
10
10
|
name: 'Transcription',
|
|
11
11
|
description: trim`
|
package/src/model/model.test.ts
CHANGED
|
@@ -51,7 +51,9 @@ describe('SerializationModel', () => {
|
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
// Update message.
|
|
54
|
-
|
|
54
|
+
Obj.change(message, (m) => {
|
|
55
|
+
m.blocks.push({ _tag: 'transcript', started: createDate(), text: 'Hello again!' });
|
|
56
|
+
});
|
|
55
57
|
model.updateChunk(message);
|
|
56
58
|
{
|
|
57
59
|
const text = model.doc.toString();
|
|
@@ -131,13 +133,17 @@ describe('SerializationModel', () => {
|
|
|
131
133
|
expect(view.state.doc.toString()).to.eq('###### Alice\nHello world!\n\n');
|
|
132
134
|
|
|
133
135
|
// Update message (add block).
|
|
134
|
-
|
|
136
|
+
Obj.change(message, (m) => {
|
|
137
|
+
m.blocks.push({ _tag: 'transcript', started: createDate(), text: 'Hello again!' });
|
|
138
|
+
});
|
|
135
139
|
model.updateChunk(message);
|
|
136
140
|
model.sync(adapter);
|
|
137
141
|
expect(view.state.doc.toString()).to.eq('###### Alice\nHello world!\nHello again!\n\n');
|
|
138
142
|
|
|
139
143
|
// Update message (remove block).
|
|
140
|
-
|
|
144
|
+
Obj.change(message, (m) => {
|
|
145
|
+
m.blocks.splice(0, 1);
|
|
146
|
+
});
|
|
141
147
|
model.updateChunk(message);
|
|
142
148
|
model.sync(adapter);
|
|
143
149
|
expect(view.state.doc.toString()).to.eq('###### Alice\nHello again!\n\n');
|
|
@@ -6,8 +6,6 @@
|
|
|
6
6
|
// Copyright 2025 DXOS.org
|
|
7
7
|
//
|
|
8
8
|
|
|
9
|
-
import { effect } from '@preact/signals-core';
|
|
10
|
-
|
|
11
9
|
import { DeferredTask, asyncTimeout } from '@dxos/async';
|
|
12
10
|
import { LifecycleState, Resource } from '@dxos/context';
|
|
13
11
|
import { type Queue } from '@dxos/echo-db';
|
|
@@ -21,7 +19,7 @@ import { getActorId } from './utils';
|
|
|
21
19
|
const PROCESSING_TIMEOUT = 20_000; // ms
|
|
22
20
|
const MAX_RANGE_ID_COUNT = 10;
|
|
23
21
|
|
|
24
|
-
export type
|
|
22
|
+
export type SegmentsNormalizerProps = {
|
|
25
23
|
functionExecutor: FunctionExecutor;
|
|
26
24
|
queue: Queue<Message.Message>;
|
|
27
25
|
startingCursor: QueueCursor;
|
|
@@ -42,7 +40,7 @@ export class MessageNormalizer extends Resource {
|
|
|
42
40
|
private _normalizationTask?: DeferredTask;
|
|
43
41
|
private _lastProcessedMessageIds?: string[];
|
|
44
42
|
|
|
45
|
-
constructor({ functionExecutor, queue, startingCursor }:
|
|
43
|
+
constructor({ functionExecutor, queue, startingCursor }: SegmentsNormalizerProps) {
|
|
46
44
|
super();
|
|
47
45
|
this._functionExecutor = functionExecutor;
|
|
48
46
|
this._queue = queue;
|
|
@@ -51,7 +49,8 @@ export class MessageNormalizer extends Resource {
|
|
|
51
49
|
|
|
52
50
|
protected override async _open(): Promise<void> {
|
|
53
51
|
this._normalizationTask = new DeferredTask(this._ctx, () => this._processMessages());
|
|
54
|
-
|
|
52
|
+
|
|
53
|
+
const updateMessages = () => {
|
|
55
54
|
if (this._lifecycleState !== LifecycleState.OPEN) {
|
|
56
55
|
return;
|
|
57
56
|
}
|
|
@@ -62,8 +61,14 @@ export class MessageNormalizer extends Resource {
|
|
|
62
61
|
});
|
|
63
62
|
|
|
64
63
|
this._normalizationTask!.schedule();
|
|
65
|
-
}
|
|
66
|
-
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
// Initial update.
|
|
67
|
+
updateMessages();
|
|
68
|
+
|
|
69
|
+
// Subscribe to queue changes.
|
|
70
|
+
const unsubscribe = this._queue.subscribe(updateMessages);
|
|
71
|
+
this._ctx.onDispose(unsubscribe);
|
|
67
72
|
}
|
|
68
73
|
|
|
69
74
|
// Need to unpack strings from blocks from messages run them through the function and then pack them back into blocks into messages.
|
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import { effect } from '@preact/signals-core';
|
|
6
5
|
import { describe, test } from 'vitest';
|
|
7
6
|
|
|
8
7
|
import { scheduleTaskInterval } from '@dxos/async';
|
|
@@ -133,10 +132,6 @@ describe.skip('SentenceNormalization', () => {
|
|
|
133
132
|
|
|
134
133
|
// Start normalizer.
|
|
135
134
|
await normalizer.open();
|
|
136
|
-
effect(() => {
|
|
137
|
-
log.info('normalizer');
|
|
138
|
-
log.info(JSON.stringify(queue.objects, null, 2));
|
|
139
|
-
});
|
|
140
135
|
|
|
141
136
|
await new Promise(() => {});
|
|
142
137
|
});
|
package/src/testing/testing.ts
CHANGED
|
@@ -16,7 +16,7 @@ import { IdentityDid } from '@dxos/keys';
|
|
|
16
16
|
import { log } from '@dxos/log';
|
|
17
17
|
import { faker } from '@dxos/random';
|
|
18
18
|
import { type Space, useQueue } from '@dxos/react-client/echo';
|
|
19
|
-
import {
|
|
19
|
+
import { TestSchema } from '@dxos/schema/testing';
|
|
20
20
|
import { type ContentBlock, Message, Organization, Person } from '@dxos/types';
|
|
21
21
|
import { seedTestData } from '@dxos/types/testing';
|
|
22
22
|
|
|
@@ -31,7 +31,7 @@ export const TestItem = Schema.Struct({
|
|
|
31
31
|
description: 'Product description',
|
|
32
32
|
}),
|
|
33
33
|
}).pipe(
|
|
34
|
-
Type.
|
|
34
|
+
Type.object({
|
|
35
35
|
typename: 'dxos.org/type/Test',
|
|
36
36
|
version: '0.1.0',
|
|
37
37
|
}),
|
|
@@ -72,7 +72,12 @@ export class MessageBuilder extends AbstractMessageBuilder {
|
|
|
72
72
|
let text = faker.lorem.paragraph();
|
|
73
73
|
if (this._space) {
|
|
74
74
|
const label = faker.commerce.productName();
|
|
75
|
-
const obj = this._space.db.add(
|
|
75
|
+
const obj = this._space.db.add(
|
|
76
|
+
Obj.make(TestItem, {
|
|
77
|
+
title: label,
|
|
78
|
+
description: faker.lorem.paragraph(),
|
|
79
|
+
}),
|
|
80
|
+
);
|
|
76
81
|
const dxn = Ref.make(obj).dxn.toString();
|
|
77
82
|
const words = text.split(' ');
|
|
78
83
|
words.splice(Math.floor(Math.random() * words.length), 0, `[${label}](${dxn})`);
|
|
@@ -117,12 +122,12 @@ class EntityExtractionMessageBuilder extends AbstractMessageBuilder {
|
|
|
117
122
|
throw new Error('Space not connected');
|
|
118
123
|
}
|
|
119
124
|
|
|
120
|
-
const
|
|
125
|
+
const objects = await this.space.db
|
|
121
126
|
.query(
|
|
122
127
|
Filter.or(
|
|
123
128
|
Filter.type(Person.Person),
|
|
124
129
|
Filter.type(Organization.Organization),
|
|
125
|
-
Filter.type(
|
|
130
|
+
Filter.type(TestSchema.DocumentType),
|
|
126
131
|
),
|
|
127
132
|
)
|
|
128
133
|
.run();
|
|
@@ -19,7 +19,7 @@ const initializeExtendableMediaRecorder = async () => {
|
|
|
19
19
|
await register(await connect());
|
|
20
20
|
};
|
|
21
21
|
|
|
22
|
-
export type
|
|
22
|
+
export type MediaStreamRecorderProps = {
|
|
23
23
|
mediaStreamTrack: MediaStreamTrack;
|
|
24
24
|
config: {
|
|
25
25
|
interval: number;
|
|
@@ -37,12 +37,12 @@ export class MediaStreamRecorder implements AudioRecorder {
|
|
|
37
37
|
/**
|
|
38
38
|
* Default MediaRecorder implementation do not support wav encoding.
|
|
39
39
|
*/
|
|
40
|
-
private readonly _config:
|
|
40
|
+
private readonly _config: MediaStreamRecorderProps['config'];
|
|
41
41
|
private _mediaRecorder?: IMediaRecorder = undefined;
|
|
42
42
|
private _header?: Uint8Array = undefined;
|
|
43
43
|
private _onChunk?: (chunk: AudioChunk) => void;
|
|
44
44
|
|
|
45
|
-
constructor({ mediaStreamTrack, config }:
|
|
45
|
+
constructor({ mediaStreamTrack, config }: MediaStreamRecorderProps) {
|
|
46
46
|
this._mediaStreamTrack = mediaStreamTrack;
|
|
47
47
|
this._config = config;
|
|
48
48
|
}
|
|
@@ -213,7 +213,7 @@ class MockAudioRecorder implements AudioRecorder {
|
|
|
213
213
|
|
|
214
214
|
@trace.span()
|
|
215
215
|
async start(): Promise<void> {
|
|
216
|
-
log.info('start mock audio recorder', {
|
|
216
|
+
log.info('start mock audio recorder', { wavProps: this.wav.fmt });
|
|
217
217
|
const now = Date.now();
|
|
218
218
|
const samples = this.wav.getSamples();
|
|
219
219
|
const sampleRate = this.wavConfig.sampleRate;
|
|
@@ -63,7 +63,7 @@ export type TranscribeConfig = {
|
|
|
63
63
|
prefixBufferChunksAmount: number;
|
|
64
64
|
};
|
|
65
65
|
|
|
66
|
-
export type
|
|
66
|
+
export type TranscriberProps = {
|
|
67
67
|
config: TranscribeConfig;
|
|
68
68
|
recorder: AudioRecorder;
|
|
69
69
|
/**
|
|
@@ -86,12 +86,12 @@ export class Transcriber extends Resource {
|
|
|
86
86
|
|
|
87
87
|
private readonly _config: TranscribeConfig;
|
|
88
88
|
private readonly _recorder: AudioRecorder;
|
|
89
|
-
private readonly _onSegments:
|
|
89
|
+
private readonly _onSegments: TranscriberProps['onSegments'];
|
|
90
90
|
|
|
91
91
|
private _recording = false;
|
|
92
92
|
private _transcribeTask?: DeferredTask = undefined;
|
|
93
93
|
|
|
94
|
-
constructor({ config, recorder, onSegments }:
|
|
94
|
+
constructor({ config, recorder, onSegments }: TranscriberProps) {
|
|
95
95
|
super();
|
|
96
96
|
this._config = config;
|
|
97
97
|
this._recorder = recorder;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Atom, type Registry } from '@effect-atom/atom-react';
|
|
6
6
|
|
|
7
7
|
import { synchronized } from '@dxos/async';
|
|
8
8
|
import { Resource } from '@dxos/context';
|
|
@@ -34,6 +34,7 @@ export type TranscriptMessageEnricher = (message: Message.Message) => Promise<Me
|
|
|
34
34
|
|
|
35
35
|
export type TranscriptionManagerOptions = {
|
|
36
36
|
edgeClient: EdgeHttpClient;
|
|
37
|
+
registry: Registry.Registry;
|
|
37
38
|
|
|
38
39
|
/**
|
|
39
40
|
* Enrich the message before it is written to the transcription queue.
|
|
@@ -47,22 +48,27 @@ export type TranscriptionManagerOptions = {
|
|
|
47
48
|
export class TranscriptionManager extends Resource {
|
|
48
49
|
private readonly _edgeClient: EdgeHttpClient;
|
|
49
50
|
private readonly _messageEnricher?: TranscriptMessageEnricher;
|
|
51
|
+
private readonly _registry: Registry.Registry;
|
|
50
52
|
private _audioStreamTrack?: MediaStreamTrack = undefined;
|
|
51
53
|
private _identityDid?: string = undefined;
|
|
52
54
|
private _mediaRecorder?: MediaStreamRecorder = undefined;
|
|
53
55
|
private _transcriber?: Transcriber = undefined;
|
|
54
56
|
private _queue?: Queue<Message.Message> = undefined;
|
|
55
|
-
private
|
|
57
|
+
private _enabledAtom = Atom.make(false);
|
|
56
58
|
|
|
57
59
|
constructor(options: TranscriptionManagerOptions) {
|
|
58
60
|
super();
|
|
59
61
|
this._edgeClient = options.edgeClient;
|
|
60
62
|
this._messageEnricher = options.messageEnricher;
|
|
63
|
+
this._registry = options.registry;
|
|
61
64
|
}
|
|
62
65
|
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
+
get enabled(): Atom.Atom<boolean> {
|
|
67
|
+
return this._enabledAtom;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
getEnabled(): boolean {
|
|
71
|
+
return this._registry.get(this._enabledAtom);
|
|
66
72
|
}
|
|
67
73
|
|
|
68
74
|
setQueue(queue: Queue<Message.Message>): this {
|
|
@@ -78,7 +84,7 @@ export class TranscriptionManager extends Resource {
|
|
|
78
84
|
}
|
|
79
85
|
|
|
80
86
|
setRecording(recording?: boolean): this {
|
|
81
|
-
if (!this.isOpen || !this.
|
|
87
|
+
if (!this.isOpen || !this.getEnabled()) {
|
|
82
88
|
return this;
|
|
83
89
|
}
|
|
84
90
|
|
|
@@ -91,11 +97,11 @@ export class TranscriptionManager extends Resource {
|
|
|
91
97
|
}
|
|
92
98
|
|
|
93
99
|
async setEnabled(enabled: boolean): Promise<void> {
|
|
94
|
-
if (this.
|
|
100
|
+
if (this.getEnabled() === enabled) {
|
|
95
101
|
return;
|
|
96
102
|
}
|
|
97
103
|
|
|
98
|
-
this.
|
|
104
|
+
this._registry.set(this._enabledAtom, enabled ?? false);
|
|
99
105
|
if (enabled) {
|
|
100
106
|
await this._maybeRestartTranscriber();
|
|
101
107
|
} else {
|
|
@@ -122,7 +128,7 @@ export class TranscriptionManager extends Resource {
|
|
|
122
128
|
}
|
|
123
129
|
|
|
124
130
|
private async _maybeRestartTranscriber(): Promise<void> {
|
|
125
|
-
if (!this._audioStreamTrack || !this.
|
|
131
|
+
if (!this._audioStreamTrack || !this.getEnabled() || !this.isOpen) {
|
|
126
132
|
return;
|
|
127
133
|
}
|
|
128
134
|
|
|
@@ -5,20 +5,28 @@
|
|
|
5
5
|
import * as Schema from 'effect/Schema';
|
|
6
6
|
|
|
7
7
|
import { SpaceSchema } from '@dxos/client/echo';
|
|
8
|
+
import { Operation } from '@dxos/operation';
|
|
9
|
+
import { Transcript } from '@dxos/types';
|
|
8
10
|
|
|
9
11
|
import { meta } from '../meta';
|
|
10
12
|
|
|
11
|
-
|
|
13
|
+
//
|
|
14
|
+
// Operations
|
|
15
|
+
//
|
|
16
|
+
|
|
17
|
+
const TRANSCRIPT_OPERATION = `${meta.id}/operation`;
|
|
12
18
|
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
}
|
|
19
|
+
export namespace TranscriptOperation {
|
|
20
|
+
export const Create = Operation.make({
|
|
21
|
+
meta: { key: `${TRANSCRIPT_OPERATION}/create`, name: 'Create Transcript' },
|
|
22
|
+
schema: {
|
|
23
|
+
input: Schema.Struct({
|
|
24
|
+
name: Schema.optional(Schema.String),
|
|
25
|
+
space: SpaceSchema,
|
|
26
|
+
}),
|
|
27
|
+
output: Schema.Struct({
|
|
28
|
+
object: Transcript.Transcript,
|
|
29
|
+
}),
|
|
30
|
+
},
|
|
31
|
+
});
|
|
32
|
+
}
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { Capability } from '@dxos/app-framework';
|
|
6
6
|
|
|
7
7
|
import { meta } from '../meta';
|
|
8
8
|
import {
|
|
9
|
-
type
|
|
9
|
+
type MediaStreamRecorderProps,
|
|
10
10
|
type Transcriber,
|
|
11
|
-
type
|
|
11
|
+
type TranscriberProps,
|
|
12
12
|
type TranscriptMessageEnricher,
|
|
13
13
|
type TranscriptionManager,
|
|
14
14
|
} from '../transcriber';
|
|
@@ -16,18 +16,18 @@ import {
|
|
|
16
16
|
export namespace TranscriptionCapabilities {
|
|
17
17
|
export type GetTranscriberProps = {
|
|
18
18
|
audioStreamTrack: MediaStreamTrack;
|
|
19
|
-
recorderConfig?: Partial<
|
|
20
|
-
transcriberConfig?: Partial<
|
|
21
|
-
onSegments:
|
|
19
|
+
recorderConfig?: Partial<MediaStreamRecorderProps['config']>;
|
|
20
|
+
transcriberConfig?: Partial<TranscriberProps['config']>;
|
|
21
|
+
onSegments: TranscriberProps['onSegments'];
|
|
22
22
|
};
|
|
23
23
|
export type GetTranscriber = (props: GetTranscriberProps) => Transcriber;
|
|
24
|
-
export const Transcriber =
|
|
24
|
+
export const Transcriber = Capability.make<GetTranscriber>(`${meta.id}/capability/transcriber`);
|
|
25
25
|
|
|
26
26
|
export type GetTranscriptionManagerProps = {
|
|
27
27
|
messageEnricher?: TranscriptMessageEnricher;
|
|
28
28
|
};
|
|
29
29
|
export type GetTranscriptionManager = (props: GetTranscriptionManagerProps) => TranscriptionManager;
|
|
30
|
-
export const TranscriptionManager =
|
|
30
|
+
export const TranscriptionManager = Capability.make<GetTranscriptionManager>(
|
|
31
31
|
`${meta.id}/capability/transcription-manager`,
|
|
32
32
|
);
|
|
33
33
|
}
|
package/src/types/index.ts
CHANGED
package/src/util/index.ts
CHANGED
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { type Identity } from '@dxos/react-client/halo';
|
|
6
|
+
import { type Message } from '@dxos/types';
|
|
7
|
+
|
|
8
|
+
// TODO(thure): Move this?
|
|
9
|
+
export const renderByline =
|
|
10
|
+
(identities: Identity[]) =>
|
|
11
|
+
(message: Message.Message, index: number, debug = false): string[] => {
|
|
12
|
+
if (message.sender.role === 'assistant') {
|
|
13
|
+
// Start/stop block.
|
|
14
|
+
return [message.blocks.find((block) => block._tag === 'transcript')?.text ?? '', ''];
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
// TODO(burdon): Use link/reference markup for users (with popover).
|
|
18
|
+
// TODO(burdon): Color and avatar.
|
|
19
|
+
const identity = identities.find((identity) => identity.did === message.sender.identityDid);
|
|
20
|
+
const name =
|
|
21
|
+
identity?.profile?.displayName ??
|
|
22
|
+
message.sender.contact?.target?.fullName ??
|
|
23
|
+
message.sender.name ??
|
|
24
|
+
message.sender.email ??
|
|
25
|
+
message.sender.identityDid;
|
|
26
|
+
const blocks = message.blocks.filter((block) => block._tag === 'transcript');
|
|
27
|
+
return [
|
|
28
|
+
// TODO(thure): Use an XML tag with the bits needed here.
|
|
29
|
+
`###### ${name}` + (debug ? ` [${index}]:${message.id}` : ''),
|
|
30
|
+
blocks.map((block) => block.text.trim()).join(' '),
|
|
31
|
+
'',
|
|
32
|
+
];
|
|
33
|
+
};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
TranscriptContainer_default,
|
|
3
|
-
TranscriptionContainer
|
|
4
|
-
} from "./chunk-EHT3TE6U.mjs";
|
|
5
|
-
import "./chunk-3MKZ2MNQ.mjs";
|
|
6
|
-
import "./chunk-VBUIO677.mjs";
|
|
7
|
-
export {
|
|
8
|
-
TranscriptionContainer,
|
|
9
|
-
TranscriptContainer_default as default
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=TranscriptContainer-EKSP5DQ6.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/blueprint-definition.ts", "../../../src/functions/open.ts", "../../../src/functions/summarize.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capabilities, contributes } from '@dxos/app-framework';\nimport { Blueprint, Template } from '@dxos/blueprints';\nimport { type FunctionDefinition } from '@dxos/functions';\nimport { trim } from '@dxos/util';\n\nimport { open, summarize } from '../functions';\n\nconst functions: FunctionDefinition[] = [open, summarize];\n\nexport default () => {\n return [\n contributes(Capabilities.Functions, functions),\n contributes(\n Capabilities.BlueprintDefinition,\n Blueprint.make({\n key: 'dxos.org/blueprint/transcription',\n name: 'Transcription',\n tools: Blueprint.toolDefinitions({ functions }),\n instructions: Template.make({\n source: trim`\n You can open and summarize a meeting transcript.\n `,\n }),\n }),\n ),\n ];\n};\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Schema from 'effect/Schema';\n\nimport { ArtifactId } from '@dxos/assistant';\nimport { Obj } from '@dxos/echo';\nimport { DatabaseService, QueueService, defineFunction } from '@dxos/functions';\nimport { Message } from '@dxos/types';\n\nimport { renderByline } from '../components';\nimport { Transcript } from '../types';\n\nexport default defineFunction({\n key: 'dxos.org/function/transcription/open',\n name: 'Open',\n description: 'Opens and reads the contents of a transcription object.',\n inputSchema: Schema.Struct({\n id: ArtifactId.annotations({\n description: 'The ID of the transcription object.',\n }),\n }),\n outputSchema: Schema.Struct({\n content: Schema.String,\n }),\n handler: Effect.fn(function* ({ data: { id } }) {\n const transcript = yield* DatabaseService.resolve(ArtifactId.toDXN(id), Transcript.Transcript);\n const { dxn } = yield* Effect.promise(() => transcript.queue.load());\n const queue = yield* QueueService.getQueue(dxn);\n yield* Effect.promise(() => queue?.queryObjects());\n const content = queue?.objects\n .filter((message) => Obj.instanceOf(Message.Message, message))\n .flatMap((message, index) => renderByline([])(message, index))\n .join('\\n\\n');\n return { content };\n }),\n});\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Array from 'effect/Array';\nimport * as Effect from 'effect/Effect';\nimport * as Function from 'effect/Function';\nimport * as Layer from 'effect/Layer';\nimport * as Option from 'effect/Option';\nimport * as Schema from 'effect/Schema';\n\nimport { AiService, ConsolePrinter, ToolExecutionService, ToolResolverService } from '@dxos/ai';\nimport { AiSession, GenerationObserver } from '@dxos/assistant';\nimport { TracingService, defineFunction } from '@dxos/functions';\nimport { trim } from '@dxos/util';\n\n/**\n * Summarize a transcript of a meeting.\n */\nexport default defineFunction({\n key: 'dxos.org/function/transcription/summarize',\n name: 'Summarize',\n description: 'Summarize a transcript of a meeting.',\n inputSchema: Schema.Struct({\n transcript: Schema.String.annotations({\n description: 'The transcript of the meeting.',\n }),\n notes: Schema.optional(Schema.String).annotations({\n description: 'Additional notes from the participants.',\n }),\n }),\n outputSchema: Schema.Struct({\n summary: Schema.String.annotations({\n description: 'The summary of the transcript.',\n }),\n }),\n handler: Effect.fnUntraced(\n function* ({ data: { transcript, notes } }) {\n const result = yield* new AiSession().run({\n prompt: `Transcript: ${transcript}\\n\\nNotes: ${notes}`,\n history: [],\n system: systemPrompt,\n observer: GenerationObserver.fromPrinter(new ConsolePrinter({ tag: 'summarize' })),\n });\n\n const summary = Function.pipe(\n result,\n Array.findLast((msg) => msg.sender.role === 'assistant' && msg.blocks.some((block) => block._tag === 'text')),\n Option.flatMap((msg) =>\n Function.pipe(\n msg.blocks,\n Array.findLast((block) => block._tag === 'text'),\n Option.map((block) => block.text),\n ),\n ),\n Option.getOrThrowWith(() => new Error('No summary found')),\n );\n\n return { summary };\n },\n Effect.provide(\n Layer.mergeAll(\n AiService.model('@anthropic/claude-sonnet-4-0'),\n ToolResolverService.layerEmpty,\n ToolExecutionService.layerEmpty,\n TracingService.layerNoop,\n ),\n ),\n ),\n});\n\nconst systemPrompt = trim`\n You are a helpful assistant that summarizes transcripts of meetings.\n\n # Goal\n Create a markdown summary of the meeting transcript with text notes provided.\n Notes are very important so make sure to include them in the summary if they contain meaningful information.\n\n # Formatting\n - Format the summary as a markdown document without extra comments like \"Here is the summary of the transcript:\".\n - Use markdown formatting for headings and bullet points.\n - Format the summary as a list of key points and takeaways.\n - All names of people should be in bold.\n\n # Note Taking\n - Correlate items in the summary with the person of origin to build a coherent narrative.\n - Include short quotes verbatim where appropriate. Especially when concerned with design decisions and problem descriptions.\n\n # Tasks\n At the end of the summary include tasks.\n Extract only the tasks that are:\n - Directly actionable.\n - Clearly assigned to a person or team (or can easily be inferred).\n - Strongly implied by the conversation and/or user note (no speculative tasks).\n - Specific enough that someone reading them would know exactly what to do next.\n\n Format all tasks as markdown checkboxes using the syntax:\n - [ ] Task description.\n\n Additional information can be included (indented).\n\n If no actionable tasks are found, omit this tasks section.\n`;\n"],
|
|
5
|
-
"mappings": "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",
|
|
6
|
-
"names": ["Capabilities", "contributes", "Blueprint", "Template", "trim", "Effect", "Schema", "ArtifactId", "Obj", "DatabaseService", "QueueService", "defineFunction", "Message", "defineFunction", "key", "name", "description", "inputSchema", "Struct", "id", "ArtifactId", "annotations", "outputSchema", "content", "String", "handler", "fn", "data", "transcript", "DatabaseService", "resolve", "toDXN", "Transcript", "dxn", "promise", "queue", "load", "QueueService", "getQueue", "queryObjects", "objects", "filter", "message", "Obj", "instanceOf", "Message", "flatMap", "index", "renderByline", "join", "Array", "Effect", "Function", "Layer", "Option", "Schema", "AiService", "ConsolePrinter", "ToolExecutionService", "ToolResolverService", "AiSession", "GenerationObserver", "TracingService", "defineFunction", "trim", "defineFunction", "key", "name", "description", "inputSchema", "Struct", "transcript", "String", "annotations", "notes", "optional", "outputSchema", "summary", "handler", "fnUntraced", "data", "result", "AiSession", "run", "prompt", "history", "system", "systemPrompt", "observer", "GenerationObserver", "fromPrinter", "ConsolePrinter", "tag", "pipe", "findLast", "msg", "sender", "role", "blocks", "some", "block", "_tag", "flatMap", "map", "text", "getOrThrowWith", "Error", "provide", "mergeAll", "AiService", "model", "ToolResolverService", "layerEmpty", "ToolExecutionService", "TracingService", "layerNoop", "trim", "functions", "open", "summarize", "contributes", "Capabilities", "Functions", "BlueprintDefinition", "Blueprint", "make", "key", "name", "tools", "toolDefinitions", "instructions", "Template", "source", "trim"]
|
|
7
|
-
}
|
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
meta
|
|
3
|
-
} from "./chunk-VBUIO677.mjs";
|
|
4
|
-
|
|
5
|
-
// src/capabilities/capabilities.ts
|
|
6
|
-
import { defineCapability } from "@dxos/app-framework";
|
|
7
|
-
(function(TranscriptionCapabilities2) {
|
|
8
|
-
TranscriptionCapabilities2.Transcriber = defineCapability(`${meta.id}/capability/transcriber`);
|
|
9
|
-
TranscriptionCapabilities2.TranscriptionManager = defineCapability(`${meta.id}/capability/transcription-manager`);
|
|
10
|
-
})(TranscriptionCapabilities || (TranscriptionCapabilities = {}));
|
|
11
|
-
var TranscriptionCapabilities;
|
|
12
|
-
|
|
13
|
-
export {
|
|
14
|
-
TranscriptionCapabilities
|
|
15
|
-
};
|
|
16
|
-
//# sourceMappingURL=chunk-3MKZ2MNQ.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/capabilities/capabilities.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { defineCapability } from '@dxos/app-framework';\n\nimport { meta } from '../meta';\nimport {\n type MediaStreamRecorderParams,\n type Transcriber,\n type TranscriberParams,\n type TranscriptMessageEnricher,\n type TranscriptionManager,\n} from '../transcriber';\n\nexport namespace TranscriptionCapabilities {\n export type GetTranscriberProps = {\n audioStreamTrack: MediaStreamTrack;\n recorderConfig?: Partial<MediaStreamRecorderParams['config']>;\n transcriberConfig?: Partial<TranscriberParams['config']>;\n onSegments: TranscriberParams['onSegments'];\n };\n export type GetTranscriber = (props: GetTranscriberProps) => Transcriber;\n export const Transcriber = defineCapability<GetTranscriber>(`${meta.id}/capability/transcriber`);\n\n export type GetTranscriptionManagerProps = {\n messageEnricher?: TranscriptMessageEnricher;\n };\n export type GetTranscriptionManager = (props: GetTranscriptionManagerProps) => TranscriptionManager;\n export const TranscriptionManager = defineCapability<GetTranscriptionManager>(\n `${meta.id}/capability/transcription-manager`,\n );\n}\n"],
|
|
5
|
-
"mappings": ";;;;;AAIA,SAASA,wBAAwB;UAWhBC,4BAAAA;6BAQFC,cAAcC,iBAAiC,GAAGC,KAAKC,EAAE,yBAAyB;6BAMlFC,uBAAuBH,iBAClC,GAAGC,KAAKC,EAAE,mCAAmC;AAEjD,GAjBiBJ,8BAAAA,4BAAAA,CAAAA,EAAAA;;",
|
|
6
|
-
"names": ["defineCapability", "TranscriptionCapabilities", "Transcriber", "defineCapability", "meta", "id", "TranscriptionManager"]
|
|
7
|
-
}
|