@dxos/plugin-transcription 0.8.4-main.c1de068 → 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-FFEPEPCU.mjs → chunk-EV5ZYKET.mjs} +64 -99
- 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/chunk-O7ILGNBZ.mjs +148 -0
- package/dist/lib/browser/chunk-O7ILGNBZ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-5KPYIC3N.mjs → chunk-XLMRCOQN.mjs} +126 -221
- package/dist/lib/browser/chunk-XLMRCOQN.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +62 -73
- 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-PXT4QBFY.mjs → transcriber-WCPHHJYY.mjs} +19 -14
- package/dist/lib/browser/transcriber-WCPHHJYY.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +9 -8
- 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-HT3W7LDP.mjs → chunk-7UE7G6DE.mjs} +64 -99
- package/dist/lib/node-esm/chunk-7UE7G6DE.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-TJKAO7VR.mjs → chunk-DYUGYQCB.mjs} +126 -221
- package/dist/lib/node-esm/chunk-DYUGYQCB.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-F47HK7GT.mjs +24 -0
- package/dist/lib/node-esm/chunk-F47HK7GT.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-H3MXHMQL.mjs +149 -0
- 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 -73
- 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-YUTEVANE.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 +9 -8
- package/dist/types/src/TranscriptionPlugin.d.ts +2 -1
- package/dist/types/src/TranscriptionPlugin.d.ts.map +1 -1
- package/dist/types/src/blueprints/index.d.ts +2 -0
- package/dist/types/src/blueprints/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/transcription-blueprint.d.ts +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 -4
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler/index.d.ts +3 -0
- package/dist/types/src/capabilities/operation-handler/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-handler/operation-handler.d.ts +5 -0
- package/dist/types/src/capabilities/operation-handler/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/transcriber/index.d.ts +3 -0
- package/dist/types/src/capabilities/transcriber/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/transcriber/transcriber.d.ts +9 -0
- package/dist/types/src/capabilities/transcriber/transcriber.d.ts.map +1 -0
- package/dist/types/src/components/Transcription/Transcription.d.ts +17 -0
- package/dist/types/src/components/Transcription/Transcription.d.ts.map +1 -0
- package/dist/types/src/components/Transcription/Transcription.stories.d.ts +40 -0
- 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 +8 -7
- package/dist/types/src/components/stories/FileTranscription.stories.d.ts.map +1 -1
- package/dist/types/src/components/stories/KeyWordRecognition.stories.d.ts +10 -6
- package/dist/types/src/components/stories/KeyWordRecognition.stories.d.ts.map +1 -1
- package/dist/types/src/components/stories/MicrophoneTranscription.stories.d.ts +10 -9
- package/dist/types/src/components/stories/MicrophoneTranscription.stories.d.ts.map +1 -1
- package/dist/types/src/components/stories/TranscriptionStory.d.ts +4 -3
- package/dist/types/src/components/stories/TranscriptionStory.d.ts.map +1 -1
- package/dist/types/src/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 +18 -0
- package/dist/types/src/functions/index.d.ts.map +1 -0
- package/dist/types/src/functions/open.d.ts +11 -0
- package/dist/types/src/functions/open.d.ts.map +1 -0
- package/dist/types/src/functions/summarize.d.ts +11 -0
- package/dist/types/src/functions/summarize.d.ts.map +1 -0
- package/dist/types/src/hooks/useAudioFile.d.ts.map +1 -1
- package/dist/types/src/hooks/useQueueModelAdapter.d.ts +1 -1
- package/dist/types/src/hooks/useQueueModelAdapter.d.ts.map +1 -1
- package/dist/types/src/hooks/useTranscriber.d.ts +1 -1
- package/dist/types/src/hooks/useTranscriber.d.ts.map +1 -1
- package/dist/types/src/hooks/useVoiceInput.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -3
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/segments-normalization/message-normalizer.d.ts +5 -5
- package/dist/types/src/segments-normalization/message-normalizer.d.ts.map +1 -1
- package/dist/types/src/segments-normalization/normalization.d.ts +516 -398
- 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 +11 -11
- package/dist/types/src/testing/testing.d.ts.map +1 -1
- package/dist/types/src/transcriber/media-stream-recorder.d.ts +3 -3
- package/dist/types/src/transcriber/media-stream-recorder.d.ts.map +1 -1
- package/dist/types/src/transcriber/transcriber.d.ts +4 -4
- package/dist/types/src/transcriber/transcriber.d.ts.map +1 -1
- package/dist/types/src/transcriber/transcription-manager.d.ts +12 -13
- package/dist/types/src/transcriber/transcription-manager.d.ts.map +1 -1
- package/dist/types/src/types/TranscriptAction.d.ts +25 -0
- package/dist/types/src/types/TranscriptAction.d.ts.map +1 -0
- package/dist/types/src/types/capabilities.d.ts +18 -0
- package/dist/types/src/types/capabilities.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +3 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/types/types.d.ts +0 -26
- package/dist/types/src/types/types.d.ts.map +1 -1
- package/dist/types/src/util/index.d.ts +1 -0
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/src/util/render-byline.d.ts +4 -0
- package/dist/types/src/util/render-byline.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +88 -72
- package/src/TranscriptionPlugin.tsx +39 -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 -7
- package/src/capabilities/operation-handler/index.ts +7 -0
- package/src/capabilities/operation-handler/operation-handler.ts +25 -0
- package/src/capabilities/operation-resolver/index.ts +7 -0
- package/src/capabilities/operation-resolver/operation-resolver.ts +25 -0
- package/src/capabilities/react-surface/index.ts +7 -0
- package/src/capabilities/react-surface/react-surface.tsx +28 -0
- package/src/capabilities/transcriber/index.ts +7 -0
- package/src/capabilities/transcriber/transcriber.ts +85 -0
- package/src/components/{Transcript/Transcript.stories.tsx → Transcription/Transcription.stories.tsx} +60 -56
- 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 -46
- package/src/components/index.ts +1 -6
- package/src/components/stories/FileTranscription.stories.tsx +66 -59
- package/src/components/stories/KeyWordRecognition.stories.tsx +17 -13
- package/src/components/stories/MicrophoneTranscription.stories.tsx +80 -80
- package/src/components/stories/TranscriptionStory.tsx +13 -13
- 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 +11 -0
- package/src/functions/open.ts +37 -0
- package/src/functions/summarize.ts +103 -0
- package/src/hooks/useAudioFile.ts +49 -53
- package/src/hooks/useQueueModelAdapter.ts +1 -1
- package/src/hooks/useTranscriber.ts +8 -3
- package/src/hooks/useVoiceInput.ts +4 -3
- package/src/index.ts +1 -1
- package/src/meta.ts +9 -6
- package/src/model/model.test.ts +21 -15
- package/src/segments-normalization/message-normalizer.ts +19 -14
- package/src/segments-normalization/normalization.test.ts +11 -16
- package/src/segments-normalization/normalization.ts +43 -42
- package/src/segments-normalization/utils.ts +2 -2
- package/src/testing/testing.ts +35 -25
- package/src/transcriber/media-stream-recorder.ts +4 -4
- package/src/transcriber/transcriber.browser.test.ts +6 -5
- package/src/transcriber/transcriber.ts +8 -7
- package/src/transcriber/transcription-manager.ts +37 -52
- package/src/types/TranscriptAction.ts +32 -0
- package/src/types/capabilities.ts +33 -0
- package/src/types/index.ts +3 -1
- package/src/types/types.ts +0 -23
- package/src/util/index.ts +1 -0
- package/src/util/render-byline.ts +33 -0
- package/dist/lib/browser/TranscriptContainer-6WCKCXQ6.mjs +0 -11
- package/dist/lib/browser/chunk-4FJIYH7T.mjs +0 -8
- package/dist/lib/browser/chunk-4FJIYH7T.mjs.map +0 -7
- package/dist/lib/browser/chunk-5KPYIC3N.mjs.map +0 -7
- package/dist/lib/browser/chunk-5WH45KBY.mjs +0 -19
- package/dist/lib/browser/chunk-5WH45KBY.mjs.map +0 -7
- package/dist/lib/browser/chunk-FFEPEPCU.mjs.map +0 -7
- package/dist/lib/browser/chunk-R7INNNUQ.mjs +0 -55
- package/dist/lib/browser/chunk-R7INNNUQ.mjs.map +0 -7
- package/dist/lib/browser/chunk-U6QBOGTN.mjs +0 -16
- package/dist/lib/browser/chunk-U6QBOGTN.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-3O33MMP5.mjs +0 -30
- package/dist/lib/browser/intent-resolver-3O33MMP5.mjs.map +0 -7
- package/dist/lib/browser/react-surface-E5D5AE3F.mjs +0 -34
- package/dist/lib/browser/react-surface-E5D5AE3F.mjs.map +0 -7
- package/dist/lib/browser/transcriber-PXT4QBFY.mjs.map +0 -7
- package/dist/lib/node-esm/TranscriptContainer-VBAOM5DG.mjs +0 -12
- package/dist/lib/node-esm/chunk-HT3W7LDP.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-RHF2ALML.mjs +0 -17
- package/dist/lib/node-esm/chunk-RHF2ALML.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-TJKAO7VR.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-U65ZWK3L.mjs +0 -56
- package/dist/lib/node-esm/chunk-U65ZWK3L.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-XMUCZBP3.mjs +0 -21
- package/dist/lib/node-esm/chunk-XMUCZBP3.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-Y2B4HWSS.mjs +0 -10
- package/dist/lib/node-esm/chunk-Y2B4HWSS.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-YMN5SXNC.mjs +0 -31
- package/dist/lib/node-esm/intent-resolver-YMN5SXNC.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-QRDJOHN5.mjs +0 -35
- package/dist/lib/node-esm/react-surface-QRDJOHN5.mjs.map +0 -7
- package/dist/lib/node-esm/transcriber-YUTEVANE.mjs.map +0 -7
- package/dist/types/src/capabilities/capabilities.d.ts +0 -17
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface.d.ts +0 -4
- package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/transcriber.d.ts +0 -8
- package/dist/types/src/capabilities/transcriber.d.ts.map +0 -1
- package/dist/types/src/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 +0 -24
- 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 -19
- 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/schema.d.ts +0 -41
- package/dist/types/src/types/schema.d.ts.map +0 -1
- package/src/capabilities/capabilities.ts +0 -33
- package/src/capabilities/intent-resolver.ts +0 -24
- package/src/capabilities/react-surface.tsx +0 -22
- package/src/capabilities/transcriber.ts +0 -76
- package/src/components/Transcript/Transcript.tsx +0 -100
- package/src/components/Transcript/deprecated/OldTranscript.tsx +0 -260
- package/src/components/TranscriptContainer.tsx +0 -35
- package/src/types/schema.ts +0 -41
- /package/dist/lib/browser/{TranscriptContainer-6WCKCXQ6.mjs.map → blueprints/index.mjs.map} +0 -0
- /package/dist/lib/{node-esm/TranscriptContainer-VBAOM5DG.mjs.map → browser/chunk-J5LGTIGS.mjs.map} +0 -0
|
@@ -0,0 +1,148 @@
|
|
|
1
|
+
import {
|
|
2
|
+
renderByline
|
|
3
|
+
} from "./chunk-HOOPZ7EM.mjs";
|
|
4
|
+
|
|
5
|
+
// src/blueprints/transcription-blueprint.ts
|
|
6
|
+
import { Blueprint, Template } from "@dxos/blueprints";
|
|
7
|
+
import { trim as trim2 } from "@dxos/util";
|
|
8
|
+
|
|
9
|
+
// src/functions/open.ts
|
|
10
|
+
import * as Effect from "effect/Effect";
|
|
11
|
+
import * as Schema from "effect/Schema";
|
|
12
|
+
import { Database, Obj, Ref } from "@dxos/echo";
|
|
13
|
+
import { QueueService, defineFunction } from "@dxos/functions";
|
|
14
|
+
import { Message, Transcript } from "@dxos/types";
|
|
15
|
+
var open_default = defineFunction({
|
|
16
|
+
key: "dxos.org/function/transcription/open",
|
|
17
|
+
name: "Open",
|
|
18
|
+
description: "Opens and reads the contents of a transcription object.",
|
|
19
|
+
inputSchema: Schema.Struct({
|
|
20
|
+
transcript: Ref.Ref(Transcript.Transcript).annotations({
|
|
21
|
+
description: "The ID of the transcription object."
|
|
22
|
+
})
|
|
23
|
+
}),
|
|
24
|
+
outputSchema: Schema.Struct({
|
|
25
|
+
content: Schema.String
|
|
26
|
+
}),
|
|
27
|
+
handler: Effect.fn(function* ({ data: { transcript } }) {
|
|
28
|
+
const transcriptObj = yield* Database.load(transcript);
|
|
29
|
+
const { dxn } = yield* Effect.promise(() => transcriptObj.queue.load());
|
|
30
|
+
const queue = yield* QueueService.getQueue(dxn);
|
|
31
|
+
yield* Effect.promise(() => queue?.queryObjects());
|
|
32
|
+
const content = queue?.objects.filter((message) => Obj.instanceOf(Message.Message, message)).flatMap((message, index) => renderByline([])(message, index)).join("\n\n");
|
|
33
|
+
return {
|
|
34
|
+
content
|
|
35
|
+
};
|
|
36
|
+
})
|
|
37
|
+
});
|
|
38
|
+
|
|
39
|
+
// src/functions/summarize.ts
|
|
40
|
+
import * as Array from "effect/Array";
|
|
41
|
+
import * as Effect2 from "effect/Effect";
|
|
42
|
+
import * as Function from "effect/Function";
|
|
43
|
+
import * as Layer from "effect/Layer";
|
|
44
|
+
import * as Option from "effect/Option";
|
|
45
|
+
import * as Schema2 from "effect/Schema";
|
|
46
|
+
import { AiService, ConsolePrinter, ToolExecutionService, ToolResolverService } from "@dxos/ai";
|
|
47
|
+
import { AiSession, GenerationObserver } from "@dxos/assistant";
|
|
48
|
+
import { TracingService, defineFunction as defineFunction2 } from "@dxos/functions";
|
|
49
|
+
import { trim } from "@dxos/util";
|
|
50
|
+
var summarize_default = defineFunction2({
|
|
51
|
+
key: "dxos.org/function/transcription/summarize",
|
|
52
|
+
name: "Summarize",
|
|
53
|
+
description: "Summarize a transcript of a meeting.",
|
|
54
|
+
inputSchema: Schema2.Struct({
|
|
55
|
+
transcript: Schema2.String.annotations({
|
|
56
|
+
description: "The transcript of the meeting."
|
|
57
|
+
}),
|
|
58
|
+
notes: Schema2.optional(Schema2.String).annotations({
|
|
59
|
+
description: "Additional notes from the participants."
|
|
60
|
+
})
|
|
61
|
+
}),
|
|
62
|
+
outputSchema: Schema2.Struct({
|
|
63
|
+
summary: Schema2.String.annotations({
|
|
64
|
+
description: "The summary of the transcript."
|
|
65
|
+
})
|
|
66
|
+
}),
|
|
67
|
+
handler: Effect2.fnUntraced(function* ({ data: { transcript, notes } }) {
|
|
68
|
+
const result = yield* new AiSession().run({
|
|
69
|
+
prompt: `Transcript: ${transcript}
|
|
70
|
+
|
|
71
|
+
Notes: ${notes}`,
|
|
72
|
+
history: [],
|
|
73
|
+
system: systemPrompt,
|
|
74
|
+
observer: GenerationObserver.fromPrinter(new ConsolePrinter({
|
|
75
|
+
tag: "summarize"
|
|
76
|
+
}))
|
|
77
|
+
});
|
|
78
|
+
const summary = Function.pipe(result, Array.findLast((msg) => msg.sender.role === "assistant" && msg.blocks.some((block) => block._tag === "text")), Option.flatMap((msg) => Function.pipe(msg.blocks, Array.findLast((block) => block._tag === "text"), Option.map((block) => block.text))), Option.getOrThrowWith(() => new Error("No summary found")));
|
|
79
|
+
return {
|
|
80
|
+
summary
|
|
81
|
+
};
|
|
82
|
+
}, Effect2.provide(Layer.mergeAll(AiService.model("@anthropic/claude-sonnet-4-0"), ToolResolverService.layerEmpty, ToolExecutionService.layerEmpty, TracingService.layerNoop)))
|
|
83
|
+
});
|
|
84
|
+
var systemPrompt = trim`
|
|
85
|
+
You are a helpful assistant that summarizes transcripts of meetings.
|
|
86
|
+
|
|
87
|
+
# Goal
|
|
88
|
+
Create a markdown summary of the meeting transcript with text notes provided.
|
|
89
|
+
Notes are very important so make sure to include them in the summary if they contain meaningful information.
|
|
90
|
+
|
|
91
|
+
# Formatting
|
|
92
|
+
- Format the summary as a markdown document without extra comments like "Here is the summary of the transcript:".
|
|
93
|
+
- Use markdown formatting for headings and bullet points.
|
|
94
|
+
- Format the summary as a list of key points and takeaways.
|
|
95
|
+
- All names of people should be in bold.
|
|
96
|
+
|
|
97
|
+
# Note Taking
|
|
98
|
+
- Correlate items in the summary with the person of origin to build a coherent narrative.
|
|
99
|
+
- Include short quotes verbatim where appropriate. Especially when concerned with design decisions and problem descriptions.
|
|
100
|
+
|
|
101
|
+
# Tasks
|
|
102
|
+
At the end of the summary include tasks.
|
|
103
|
+
Extract only the tasks that are:
|
|
104
|
+
- Directly actionable.
|
|
105
|
+
- Clearly assigned to a person or team (or can easily be inferred).
|
|
106
|
+
- Strongly implied by the conversation and/or user note (no speculative tasks).
|
|
107
|
+
- Specific enough that someone reading them would know exactly what to do next.
|
|
108
|
+
|
|
109
|
+
Format all tasks as markdown checkboxes using the syntax:
|
|
110
|
+
- [ ] Task description.
|
|
111
|
+
|
|
112
|
+
Additional information can be included (indented).
|
|
113
|
+
|
|
114
|
+
If no actionable tasks are found, omit this tasks section.
|
|
115
|
+
`;
|
|
116
|
+
|
|
117
|
+
// src/functions/index.ts
|
|
118
|
+
var TranscriptionFunctions = {
|
|
119
|
+
Open: open_default,
|
|
120
|
+
Summarize: summarize_default
|
|
121
|
+
};
|
|
122
|
+
|
|
123
|
+
// src/blueprints/transcription-blueprint.ts
|
|
124
|
+
var BLUEPRINT_KEY = "dxos.org/blueprint/transcription";
|
|
125
|
+
var functions = Object.values(TranscriptionFunctions);
|
|
126
|
+
var make = () => Blueprint.make({
|
|
127
|
+
key: BLUEPRINT_KEY,
|
|
128
|
+
name: "Transcription",
|
|
129
|
+
tools: Blueprint.toolDefinitions({
|
|
130
|
+
functions
|
|
131
|
+
}),
|
|
132
|
+
instructions: Template.make({
|
|
133
|
+
source: trim2`
|
|
134
|
+
You can open and summarize a meeting transcript.
|
|
135
|
+
`
|
|
136
|
+
})
|
|
137
|
+
});
|
|
138
|
+
var blueprint = {
|
|
139
|
+
key: BLUEPRINT_KEY,
|
|
140
|
+
functions,
|
|
141
|
+
make
|
|
142
|
+
};
|
|
143
|
+
var transcription_blueprint_default = blueprint;
|
|
144
|
+
|
|
145
|
+
export {
|
|
146
|
+
transcription_blueprint_default
|
|
147
|
+
};
|
|
148
|
+
//# sourceMappingURL=chunk-O7ILGNBZ.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/blueprints/transcription-blueprint.ts", "../../../src/functions/open.ts", "../../../src/functions/summarize.ts", "../../../src/functions/index.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { type AppCapabilities } from '@dxos/app-toolkit';\nimport { Blueprint, Template } from '@dxos/blueprints';\nimport { trim } from '@dxos/util';\n\nimport { TranscriptionFunctions } from '../functions';\n\nconst BLUEPRINT_KEY = 'dxos.org/blueprint/transcription';\n\nconst functions = Object.values(TranscriptionFunctions);\n\nconst make = () =>\n Blueprint.make({\n key: BLUEPRINT_KEY,\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\nconst blueprint: AppCapabilities.BlueprintDefinition = {\n key: BLUEPRINT_KEY,\n functions,\n make,\n};\n\nexport default blueprint;\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport * as Schema from 'effect/Schema';\n\nimport { Database, Obj, Ref } from '@dxos/echo';\nimport { QueueService, defineFunction } from '@dxos/functions';\nimport { Message, Transcript } from '@dxos/types';\n\nimport { renderByline } from '../util';\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 transcript: Ref.Ref(Transcript.Transcript).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: { transcript } }) {\n const transcriptObj = yield* Database.load(transcript);\n const { dxn } = yield* Effect.promise(() => transcriptObj.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", "//\n// Copyright 2024 DXOS.org\n//\n\nimport Open from './open';\nimport Summarize from './summarize';\n\nexport const TranscriptionFunctions = {\n Open,\n Summarize,\n};\n"],
|
|
5
|
+
"mappings": "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",
|
|
6
|
+
"names": ["Blueprint", "Template", "trim", "Effect", "Schema", "Database", "Obj", "Ref", "QueueService", "defineFunction", "Message", "Transcript", "defineFunction", "key", "name", "description", "inputSchema", "Struct", "transcript", "Ref", "Transcript", "annotations", "outputSchema", "content", "String", "handler", "fn", "data", "transcriptObj", "Database", "load", "dxn", "promise", "queue", "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", "TranscriptionFunctions", "Open", "Summarize", "BLUEPRINT_KEY", "functions", "Object", "values", "TranscriptionFunctions", "make", "Blueprint", "key", "name", "tools", "toolDefinitions", "instructions", "Template", "source", "trim", "blueprint"]
|
|
7
|
+
}
|
|
@@ -1,23 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TranscriptionCapabilities
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-GH4IIQ6C.mjs";
|
|
4
4
|
|
|
5
|
-
// src/components/
|
|
6
|
-
import { useSignals as _useSignals2 } from "@preact-signals/safe-react/tracking";
|
|
7
|
-
import React2 from "react";
|
|
8
|
-
import { fullyQualifiedId, getSpace } from "@dxos/client/echo";
|
|
9
|
-
import { useMembers, useQueue } from "@dxos/react-client/echo";
|
|
10
|
-
import { StackItem } from "@dxos/react-ui-stack";
|
|
11
|
-
|
|
12
|
-
// src/components/Transcript/Transcript.tsx
|
|
13
|
-
import { useSignals as _useSignals } from "@preact-signals/safe-react/tracking";
|
|
5
|
+
// src/components/Transcription/Transcription.tsx
|
|
14
6
|
import React from "react";
|
|
15
|
-
import {
|
|
16
|
-
import {
|
|
17
|
-
import {
|
|
18
|
-
import {
|
|
7
|
+
import { useThemeContext } from "@dxos/react-ui";
|
|
8
|
+
import { useTextEditor } from "@dxos/react-ui-editor";
|
|
9
|
+
import { autoScroll, createBasicExtensions, createMarkdownExtensions, createThemeExtensions, decorateMarkdown, editorSlots, preview } from "@dxos/ui-editor";
|
|
10
|
+
import { mx } from "@dxos/ui-theme";
|
|
11
|
+
import { isTruthy } from "@dxos/util";
|
|
19
12
|
|
|
20
|
-
// src/components/
|
|
13
|
+
// src/components/Transcription/transcription-extension.ts
|
|
21
14
|
import { RangeSetBuilder } from "@codemirror/state";
|
|
22
15
|
import { EditorView, GutterMarker, ViewPlugin, gutter } from "@codemirror/view";
|
|
23
16
|
import { format } from "date-fns/format";
|
|
@@ -31,6 +24,7 @@ import { invariant } from "@dxos/invariant";
|
|
|
31
24
|
import { log } from "@dxos/log";
|
|
32
25
|
var __dxlog_file = "/__w/dxos/dxos/packages/plugins/plugin-transcription/src/model/model.ts";
|
|
33
26
|
var DocumentAdapter = class {
|
|
27
|
+
_view;
|
|
34
28
|
constructor(_view) {
|
|
35
29
|
this._view = _view;
|
|
36
30
|
}
|
|
@@ -67,13 +61,19 @@ var DocumentAdapter = class {
|
|
|
67
61
|
}
|
|
68
62
|
};
|
|
69
63
|
var SerializationModel = class {
|
|
64
|
+
_renderer;
|
|
65
|
+
/** Ordered set of chunks. */
|
|
66
|
+
_chunks = [];
|
|
67
|
+
/** Map of chunk IDs to their current line counts. */
|
|
68
|
+
_chunkLineCounts = /* @__PURE__ */ new Map();
|
|
69
|
+
/** Map of line numbers to chunk IDs. */
|
|
70
|
+
_lineToChunk = /* @__PURE__ */ new Map();
|
|
71
|
+
/** Track chunk changes since last sync. */
|
|
72
|
+
_changes = [];
|
|
73
|
+
/** Emits when the document is updated. */
|
|
74
|
+
update = new Event();
|
|
70
75
|
constructor(_renderer, initialChunks = []) {
|
|
71
76
|
this._renderer = _renderer;
|
|
72
|
-
this._chunks = [];
|
|
73
|
-
this._chunkLineCounts = /* @__PURE__ */ new Map();
|
|
74
|
-
this._lineToChunk = /* @__PURE__ */ new Map();
|
|
75
|
-
this._changes = [];
|
|
76
|
-
this.update = new Event();
|
|
77
77
|
initialChunks.forEach((chunk) => {
|
|
78
78
|
this.appendChunk(chunk);
|
|
79
79
|
});
|
|
@@ -217,8 +217,8 @@ var SerializationModel = class {
|
|
|
217
217
|
}
|
|
218
218
|
};
|
|
219
219
|
|
|
220
|
-
// src/components/
|
|
221
|
-
var
|
|
220
|
+
// src/components/Transcription/transcription-extension.ts
|
|
221
|
+
var transcription = ({ model, started }) => {
|
|
222
222
|
return [
|
|
223
223
|
// Show timestamps in the gutter.
|
|
224
224
|
gutter({
|
|
@@ -246,8 +246,11 @@ var transcript = ({ model, started, renderButton }) => {
|
|
|
246
246
|
}),
|
|
247
247
|
// Listen for model updates.
|
|
248
248
|
ViewPlugin.fromClass(class {
|
|
249
|
+
_controls;
|
|
250
|
+
_cleanup;
|
|
251
|
+
_adapter;
|
|
252
|
+
_initialized = false;
|
|
249
253
|
constructor(view) {
|
|
250
|
-
this._initialized = false;
|
|
251
254
|
this._adapter = new DocumentAdapter(view);
|
|
252
255
|
const scroller = view.scrollDOM;
|
|
253
256
|
let isAutoScrolling = false;
|
|
@@ -269,30 +272,20 @@ var transcript = ({ model, started, renderButton }) => {
|
|
|
269
272
|
})
|
|
270
273
|
});
|
|
271
274
|
};
|
|
272
|
-
if (renderButton) {
|
|
273
|
-
this._controls = document.createElement("div");
|
|
274
|
-
this._controls.classList.add("cm-controls", "transition-opacity", "duration-300", "opacity-0");
|
|
275
|
-
view.dom.appendChild(this._controls);
|
|
276
|
-
renderButton(this._controls, {
|
|
277
|
-
onClick: () => {
|
|
278
|
-
scrollToBottom(false);
|
|
279
|
-
}
|
|
280
|
-
}, view);
|
|
281
|
-
}
|
|
282
275
|
this._cleanup = combine(addEventListener(view.scrollDOM, "scroll", () => {
|
|
283
276
|
if (!isAutoScrolling) {
|
|
284
277
|
hasScrolled = true;
|
|
285
278
|
this._controls?.classList.remove("opacity-0");
|
|
286
279
|
}
|
|
287
280
|
}), model.update.on(() => {
|
|
288
|
-
const
|
|
281
|
+
const autoScroll2 = scroller.scrollHeight - scroller.scrollTop - scroller.clientHeight === 0 || !hasScrolled;
|
|
289
282
|
model.sync(this._adapter);
|
|
290
|
-
if (
|
|
283
|
+
if (autoScroll2) {
|
|
291
284
|
scrollToBottom(true);
|
|
292
285
|
}
|
|
293
286
|
}));
|
|
294
287
|
}
|
|
295
|
-
update(
|
|
288
|
+
update(_update) {
|
|
296
289
|
if (!this._initialized) {
|
|
297
290
|
this._initialized = true;
|
|
298
291
|
setTimeout(() => {
|
|
@@ -306,27 +299,12 @@ var transcript = ({ model, started, renderButton }) => {
|
|
|
306
299
|
}
|
|
307
300
|
}),
|
|
308
301
|
EditorView.theme({
|
|
309
|
-
".cm-
|
|
310
|
-
|
|
311
|
-
},
|
|
312
|
-
".cm-hide-scrollbar": {
|
|
313
|
-
scrollbarWidth: "none",
|
|
314
|
-
"-ms-overflow-style": "none"
|
|
315
|
-
},
|
|
316
|
-
".cm-hide-scrollbar::-webkit-scrollbar": {
|
|
317
|
-
display: "none"
|
|
318
|
-
},
|
|
319
|
-
".cm-controls": {
|
|
320
|
-
position: "absolute",
|
|
321
|
-
bottom: "0.5rem",
|
|
322
|
-
right: "0.5rem",
|
|
323
|
-
zIndex: 1e3
|
|
324
|
-
},
|
|
325
|
-
".cm-line": {
|
|
326
|
-
paddingRight: "1rem"
|
|
302
|
+
".cm-gutters": {
|
|
303
|
+
backgroundColor: "var(--color-base-surface)"
|
|
327
304
|
},
|
|
328
305
|
".cm-timestamp-gutter": {
|
|
329
306
|
width: "6rem",
|
|
307
|
+
paddingLeft: "0.5rem",
|
|
330
308
|
paddingRight: "1rem"
|
|
331
309
|
},
|
|
332
310
|
".cm-timestamp-gutter > .cm-gutterElement > div": {
|
|
@@ -338,15 +316,18 @@ var transcript = ({ model, started, renderButton }) => {
|
|
|
338
316
|
];
|
|
339
317
|
};
|
|
340
318
|
var TimestampMarker = class extends GutterMarker {
|
|
319
|
+
_line;
|
|
320
|
+
_timestamp;
|
|
321
|
+
_started;
|
|
341
322
|
constructor(_line, _timestamp, _started) {
|
|
342
323
|
super(), this._line = _line, this._timestamp = _timestamp, this._started = _started;
|
|
343
324
|
}
|
|
344
325
|
eq(other) {
|
|
345
|
-
return
|
|
326
|
+
return this._timestamp === other._timestamp;
|
|
346
327
|
}
|
|
347
328
|
toDOM(view) {
|
|
348
329
|
const el = document.createElement("div");
|
|
349
|
-
el.className = "text-sm text-subdued hover:bg-
|
|
330
|
+
el.className = "text-sm text-subdued hover:bg-hover-surface cursor-pointer";
|
|
350
331
|
el.textContent = formatTimestamp(this._timestamp, this._started);
|
|
351
332
|
el.onclick = () => {
|
|
352
333
|
const pos = view.state.doc.line(this._line).from;
|
|
@@ -381,66 +362,39 @@ var formatTimestamp = (timestamp, relative) => {
|
|
|
381
362
|
}
|
|
382
363
|
};
|
|
383
364
|
|
|
384
|
-
// src/components/
|
|
385
|
-
var
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
}),
|
|
418
|
-
decorateMarkdown(),
|
|
419
|
-
space && preview(),
|
|
420
|
-
transcript({
|
|
421
|
-
model,
|
|
422
|
-
started: object?.started ? new Date(object.started) : void 0,
|
|
423
|
-
renderButton: createRenderer(({ onClick }) => /* @__PURE__ */ React.createElement(IconButton, {
|
|
424
|
-
icon: "ph--arrow-line-down--regular",
|
|
425
|
-
iconOnly: true,
|
|
426
|
-
label: "Scroll to bottom",
|
|
427
|
-
onClick
|
|
428
|
-
}))
|
|
429
|
-
})
|
|
430
|
-
].filter(isNotFalsy)
|
|
431
|
-
};
|
|
432
|
-
}, [
|
|
433
|
-
space,
|
|
434
|
-
model
|
|
435
|
-
]);
|
|
436
|
-
return /* @__PURE__ */ React.createElement("div", {
|
|
437
|
-
ref: parentRef,
|
|
438
|
-
className: mx("flex grow overflow-hidden", editorWidth, classNames),
|
|
439
|
-
"data-popover-collision-boundary": true
|
|
440
|
-
});
|
|
441
|
-
} finally {
|
|
442
|
-
_effect.f();
|
|
443
|
-
}
|
|
365
|
+
// src/components/Transcription/Transcription.tsx
|
|
366
|
+
var Transcription = ({ classNames, transcript: object, model }) => {
|
|
367
|
+
const { themeMode } = useThemeContext();
|
|
368
|
+
const { parentRef } = useTextEditor(() => {
|
|
369
|
+
return {
|
|
370
|
+
extensions: [
|
|
371
|
+
createBasicExtensions({
|
|
372
|
+
readOnly: true,
|
|
373
|
+
lineWrapping: true,
|
|
374
|
+
search: true
|
|
375
|
+
}),
|
|
376
|
+
createMarkdownExtensions(),
|
|
377
|
+
createThemeExtensions({
|
|
378
|
+
themeMode,
|
|
379
|
+
slots: editorSlots
|
|
380
|
+
}),
|
|
381
|
+
decorateMarkdown(),
|
|
382
|
+
preview(),
|
|
383
|
+
transcription({
|
|
384
|
+
model,
|
|
385
|
+
started: object?.started ? new Date(object.started) : void 0
|
|
386
|
+
}),
|
|
387
|
+
autoScroll()
|
|
388
|
+
].filter(isTruthy)
|
|
389
|
+
};
|
|
390
|
+
}, [
|
|
391
|
+
model
|
|
392
|
+
]);
|
|
393
|
+
return /* @__PURE__ */ React.createElement("div", {
|
|
394
|
+
ref: parentRef,
|
|
395
|
+
className: mx("dx-container", classNames),
|
|
396
|
+
"data-popover-collision-boundary": true
|
|
397
|
+
});
|
|
444
398
|
};
|
|
445
399
|
|
|
446
400
|
// src/hooks/useAudioFile.ts
|
|
@@ -457,76 +411,66 @@ var useAudioFile = (audioUrl, constraints) => {
|
|
|
457
411
|
L: 20
|
|
458
412
|
});
|
|
459
413
|
scheduleTask(ctx, async () => {
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
const audio2 = new Audio();
|
|
467
|
-
audio2.src = objectUrl;
|
|
468
|
-
await new Promise((resolve, reject) => {
|
|
469
|
-
audio2.addEventListener("error", (err) => {
|
|
470
|
-
log2.error("error", {
|
|
471
|
-
err
|
|
472
|
-
}, {
|
|
473
|
-
F: __dxlog_file2,
|
|
474
|
-
L: 37,
|
|
475
|
-
S: void 0,
|
|
476
|
-
C: (f, a) => f(...a)
|
|
477
|
-
});
|
|
478
|
-
reject(err);
|
|
479
|
-
}, {
|
|
480
|
-
once: true
|
|
414
|
+
try {
|
|
415
|
+
const response = await fetch(audioUrl);
|
|
416
|
+
const blob = await response.blob();
|
|
417
|
+
const objectUrl = URL.createObjectURL(blob);
|
|
418
|
+
ctx.onDispose(() => {
|
|
419
|
+
URL.revokeObjectURL(objectUrl);
|
|
481
420
|
});
|
|
482
|
-
audio2
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
});
|
|
489
|
-
try {
|
|
490
|
-
await audio2.play();
|
|
491
|
-
resolve();
|
|
492
|
-
} catch (playError) {
|
|
493
|
-
log2.error("Play failed", {
|
|
494
|
-
playError
|
|
421
|
+
const audio2 = new Audio();
|
|
422
|
+
audio2.src = objectUrl;
|
|
423
|
+
await new Promise((resolve, reject) => {
|
|
424
|
+
audio2.addEventListener("error", (err) => {
|
|
425
|
+
log2.error("error", {
|
|
426
|
+
err
|
|
495
427
|
}, {
|
|
496
428
|
F: __dxlog_file2,
|
|
497
|
-
L:
|
|
429
|
+
L: 39,
|
|
498
430
|
S: void 0,
|
|
499
431
|
C: (f, a) => f(...a)
|
|
500
432
|
});
|
|
433
|
+
reject(err);
|
|
434
|
+
}, {
|
|
435
|
+
once: true
|
|
436
|
+
});
|
|
437
|
+
audio2.addEventListener("canplay", async () => {
|
|
501
438
|
resolve();
|
|
502
|
-
}
|
|
503
|
-
|
|
504
|
-
|
|
439
|
+
}, {
|
|
440
|
+
once: true
|
|
441
|
+
});
|
|
442
|
+
audio2.load();
|
|
505
443
|
});
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
444
|
+
const audioCtx = new AudioContext();
|
|
445
|
+
if (audioCtx.state === "suspended") {
|
|
446
|
+
await audioCtx.resume();
|
|
447
|
+
}
|
|
448
|
+
const destination = audioCtx.createMediaStreamDestination();
|
|
449
|
+
destination.channelCount = 1;
|
|
450
|
+
const source = audioCtx.createMediaElementSource(audio2);
|
|
451
|
+
source.connect(destination);
|
|
452
|
+
const track2 = destination.stream.getAudioTracks()[0];
|
|
453
|
+
if (constraints) {
|
|
454
|
+
await track2.applyConstraints(constraints).catch((err) => log2.catch(err, void 0, {
|
|
455
|
+
F: __dxlog_file2,
|
|
456
|
+
L: 68,
|
|
457
|
+
S: void 0,
|
|
458
|
+
C: (f, a) => f(...a)
|
|
459
|
+
}));
|
|
460
|
+
}
|
|
461
|
+
setStream({
|
|
462
|
+
audio: audio2,
|
|
463
|
+
stream: destination.stream,
|
|
464
|
+
track: destination.stream.getAudioTracks()[0]
|
|
465
|
+
});
|
|
466
|
+
} catch (err) {
|
|
467
|
+
log2.catch(err, void 0, {
|
|
519
468
|
F: __dxlog_file2,
|
|
520
|
-
L:
|
|
469
|
+
L: 78,
|
|
521
470
|
S: void 0,
|
|
522
471
|
C: (f, a) => f(...a)
|
|
523
|
-
})
|
|
472
|
+
});
|
|
524
473
|
}
|
|
525
|
-
setStream({
|
|
526
|
-
audio: audio2,
|
|
527
|
-
stream: destination.stream,
|
|
528
|
-
track: destination.stream.getAudioTracks()[0]
|
|
529
|
-
});
|
|
530
474
|
});
|
|
531
475
|
return () => {
|
|
532
476
|
void ctx.dispose();
|
|
@@ -621,15 +565,7 @@ var useQueueModelAdapter = (renderer, queue, initialChunks = []) => {
|
|
|
621
565
|
|
|
622
566
|
// src/hooks/useTranscriber.ts
|
|
623
567
|
import { useEffect as useEffect4, useMemo as useMemo2 } from "react";
|
|
624
|
-
import { useCapabilities } from "@dxos/app-framework";
|
|
625
|
-
|
|
626
|
-
// src/capabilities/index.ts
|
|
627
|
-
import { lazy } from "@dxos/app-framework";
|
|
628
|
-
var IntentResolver = lazy(() => import("./intent-resolver-3O33MMP5.mjs"));
|
|
629
|
-
var ReactSurface = lazy(() => import("./react-surface-E5D5AE3F.mjs"));
|
|
630
|
-
var Transcriber = lazy(() => import("./transcriber-PXT4QBFY.mjs"));
|
|
631
|
-
|
|
632
|
-
// src/hooks/useTranscriber.ts
|
|
568
|
+
import { useCapabilities } from "@dxos/app-framework/ui";
|
|
633
569
|
var useTranscriber = ({ audioStreamTrack, recorderConfig, transcriberConfig, onSegments }) => {
|
|
634
570
|
const [getTranscriber] = useCapabilities(TranscriptionCapabilities.Transcriber);
|
|
635
571
|
const transcriber = useMemo2(() => {
|
|
@@ -660,7 +596,7 @@ var useTranscriber = ({ audioStreamTrack, recorderConfig, transcriberConfig, onS
|
|
|
660
596
|
};
|
|
661
597
|
|
|
662
598
|
// src/hooks/useVoiceInput.ts
|
|
663
|
-
import {
|
|
599
|
+
import { useCallback, useEffect as useEffect5, useState as useState4 } from "react";
|
|
664
600
|
import { scheduleMicroTask } from "@dxos/async";
|
|
665
601
|
import { Context as Context2 } from "@dxos/context";
|
|
666
602
|
import { log as log3 } from "@dxos/log";
|
|
@@ -682,14 +618,14 @@ var useVoiceInput = ({ active, onUpdate }) => {
|
|
|
682
618
|
useEffect5(() => {
|
|
683
619
|
const ctx = new Context2(void 0, {
|
|
684
620
|
F: __dxlog_file3,
|
|
685
|
-
L:
|
|
621
|
+
L: 44
|
|
686
622
|
});
|
|
687
623
|
scheduleMicroTask(ctx, async () => {
|
|
688
624
|
if (active && transcriber) {
|
|
689
625
|
await transcriber.open();
|
|
690
626
|
log3.info("starting...", void 0, {
|
|
691
627
|
F: __dxlog_file3,
|
|
692
|
-
L:
|
|
628
|
+
L: 48,
|
|
693
629
|
S: void 0,
|
|
694
630
|
C: (f, a) => f(...a)
|
|
695
631
|
});
|
|
@@ -701,7 +637,7 @@ var useVoiceInput = ({ active, onUpdate }) => {
|
|
|
701
637
|
await transcriber?.close();
|
|
702
638
|
log3.info("stopped", void 0, {
|
|
703
639
|
F: __dxlog_file3,
|
|
704
|
-
L:
|
|
640
|
+
L: 55,
|
|
705
641
|
S: void 0,
|
|
706
642
|
C: (f, a) => f(...a)
|
|
707
643
|
});
|
|
@@ -721,43 +657,12 @@ var useVoiceInput = ({ active, onUpdate }) => {
|
|
|
721
657
|
};
|
|
722
658
|
};
|
|
723
659
|
|
|
724
|
-
// src/components/TranscriptContainer.tsx
|
|
725
|
-
var TranscriptionContainer = ({ transcript: transcript2 }) => {
|
|
726
|
-
var _effect = _useSignals2();
|
|
727
|
-
try {
|
|
728
|
-
const attendableId = fullyQualifiedId(transcript2);
|
|
729
|
-
const space = getSpace(transcript2);
|
|
730
|
-
const members = useMembers(space?.key).map((member) => member.identity);
|
|
731
|
-
const queue = useQueue(transcript2.queue.dxn, {
|
|
732
|
-
pollInterval: 1e3
|
|
733
|
-
});
|
|
734
|
-
const model = useQueueModelAdapter(renderMarkdown(members), queue);
|
|
735
|
-
return /* @__PURE__ */ React2.createElement(StackItem.Content, {
|
|
736
|
-
classNames: "container-max-width pli-2"
|
|
737
|
-
}, /* @__PURE__ */ React2.createElement(Transcript, {
|
|
738
|
-
attendableId,
|
|
739
|
-
space,
|
|
740
|
-
model,
|
|
741
|
-
transcript: transcript2
|
|
742
|
-
}));
|
|
743
|
-
} finally {
|
|
744
|
-
_effect.f();
|
|
745
|
-
}
|
|
746
|
-
};
|
|
747
|
-
var TranscriptContainer_default = TranscriptionContainer;
|
|
748
|
-
|
|
749
660
|
export {
|
|
750
|
-
|
|
751
|
-
Transcript,
|
|
661
|
+
Transcription,
|
|
752
662
|
useAudioFile,
|
|
753
663
|
useAudioTrack,
|
|
754
664
|
useQueueModelAdapter,
|
|
755
665
|
useTranscriber,
|
|
756
|
-
useVoiceInput
|
|
757
|
-
TranscriptionContainer,
|
|
758
|
-
TranscriptContainer_default,
|
|
759
|
-
IntentResolver,
|
|
760
|
-
ReactSurface,
|
|
761
|
-
Transcriber
|
|
666
|
+
useVoiceInput
|
|
762
667
|
};
|
|
763
|
-
//# sourceMappingURL=chunk-
|
|
668
|
+
//# sourceMappingURL=chunk-XLMRCOQN.mjs.map
|