@dxos/plugin-transcription 0.8.4-main.c4373fc → 0.8.4-main.c85a9c8dae
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/TranscriptionContainer-RBFHP2AV.mjs +41 -0
- package/dist/lib/browser/TranscriptionContainer-RBFHP2AV.mjs.map +7 -0
- package/dist/lib/browser/blueprint-definition-C6XA2SVZ.mjs +18 -0
- package/dist/lib/browser/blueprint-definition-C6XA2SVZ.mjs.map +7 -0
- package/dist/lib/browser/blueprints/index.mjs +9 -0
- package/dist/lib/browser/chunk-2B74LZZD.mjs +22 -0
- package/dist/lib/browser/chunk-2B74LZZD.mjs.map +7 -0
- package/dist/lib/browser/{chunk-COBQIZ6B.mjs → chunk-EV5ZYKET.mjs} +60 -86
- package/dist/lib/browser/chunk-EV5ZYKET.mjs.map +7 -0
- package/dist/lib/browser/chunk-GH4IIQ6C.mjs +54 -0
- package/dist/lib/browser/chunk-GH4IIQ6C.mjs.map +7 -0
- package/dist/lib/browser/chunk-HOOPZ7EM.mjs +35 -0
- package/dist/lib/browser/chunk-HOOPZ7EM.mjs.map +7 -0
- package/dist/lib/browser/chunk-J5LGTIGS.mjs +10 -0
- package/dist/lib/browser/{blueprint-definition-GO6GTEBT.mjs → chunk-O7ILGNBZ.mjs} +39 -41
- package/dist/lib/browser/chunk-O7ILGNBZ.mjs.map +7 -0
- package/dist/lib/browser/{chunk-ZS2FXKEF.mjs → chunk-XLMRCOQN.mjs} +383 -470
- package/dist/lib/browser/chunk-XLMRCOQN.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +62 -77
- package/dist/lib/browser/index.mjs.map +4 -4
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/operation-resolver-5BLRH4XE.mjs +23 -0
- package/dist/lib/browser/operation-resolver-5BLRH4XE.mjs.map +7 -0
- package/dist/lib/browser/react-surface-U2SI74JK.mjs +36 -0
- package/dist/lib/browser/react-surface-U2SI74JK.mjs.map +7 -0
- package/dist/lib/browser/{transcriber-NG5MRCP6.mjs → transcriber-WCPHHJYY.mjs} +19 -14
- package/dist/lib/browser/transcriber-WCPHHJYY.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +8 -5
- package/dist/lib/node-esm/TranscriptionContainer-3OOID5KH.mjs +42 -0
- package/dist/lib/node-esm/TranscriptionContainer-3OOID5KH.mjs.map +7 -0
- package/dist/lib/node-esm/blueprint-definition-TLXDUXIQ.mjs +19 -0
- package/dist/lib/node-esm/blueprint-definition-TLXDUXIQ.mjs.map +7 -0
- package/dist/lib/node-esm/blueprints/index.mjs +10 -0
- package/dist/lib/node-esm/blueprints/index.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-6GW5NZYG.mjs +55 -0
- package/dist/lib/node-esm/chunk-6GW5NZYG.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-A6SB234F.mjs → chunk-7UE7G6DE.mjs} +60 -86
- package/dist/lib/node-esm/chunk-7UE7G6DE.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-PEZRQYKO.mjs → chunk-DYUGYQCB.mjs} +383 -470
- package/dist/lib/node-esm/chunk-DYUGYQCB.mjs.map +7 -0
- package/dist/lib/node-esm/{chunk-KLTPFUKN.mjs → chunk-F47HK7GT.mjs} +7 -8
- package/dist/lib/node-esm/chunk-F47HK7GT.mjs.map +7 -0
- package/dist/lib/node-esm/{blueprint-definition-6SU7GLBR.mjs → chunk-H3MXHMQL.mjs} +39 -41
- package/dist/lib/node-esm/chunk-H3MXHMQL.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +11 -0
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-NVM2QUMX.mjs +37 -0
- package/dist/lib/node-esm/chunk-NVM2QUMX.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +62 -77
- package/dist/lib/node-esm/index.mjs.map +4 -4
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/operation-resolver-CVZB7BF4.mjs +24 -0
- package/dist/lib/node-esm/operation-resolver-CVZB7BF4.mjs.map +7 -0
- package/dist/lib/node-esm/react-surface-2ICJPBPX.mjs +37 -0
- package/dist/lib/node-esm/react-surface-2ICJPBPX.mjs.map +7 -0
- package/dist/lib/node-esm/{transcriber-SMU7HD6F.mjs → transcriber-2RIHUEX4.mjs} +19 -14
- package/dist/lib/node-esm/transcriber-2RIHUEX4.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +8 -5
- package/dist/types/src/TranscriptionPlugin.d.ts +2 -1
- package/dist/types/src/TranscriptionPlugin.d.ts.map +1 -1
- package/dist/types/src/blueprints/index.d.ts +2 -0
- package/dist/types/src/blueprints/index.d.ts.map +1 -0
- package/dist/types/src/blueprints/transcription-blueprint.d.ts +4 -0
- package/dist/types/src/blueprints/transcription-blueprint.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts +6 -0
- package/dist/types/src/capabilities/blueprint-definition/blueprint-definition.d.ts.map +1 -0
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts +3 -0
- package/dist/types/src/capabilities/blueprint-definition/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +4 -5
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/operation-handler/index.d.ts +3 -0
- package/dist/types/src/capabilities/operation-handler/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-handler/operation-handler.d.ts +5 -0
- package/dist/types/src/capabilities/operation-handler/operation-handler.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-resolver/index.d.ts +3 -0
- package/dist/types/src/capabilities/operation-resolver/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts +5 -0
- package/dist/types/src/capabilities/operation-resolver/operation-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts +3 -0
- package/dist/types/src/capabilities/react-surface/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts +5 -0
- package/dist/types/src/capabilities/react-surface/react-surface.d.ts.map +1 -0
- package/dist/types/src/capabilities/transcriber/index.d.ts +3 -0
- package/dist/types/src/capabilities/transcriber/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/transcriber/transcriber.d.ts +9 -0
- package/dist/types/src/capabilities/transcriber/transcriber.d.ts.map +1 -0
- package/dist/types/src/components/Transcription/Transcription.d.ts +17 -0
- package/dist/types/src/components/Transcription/Transcription.d.ts.map +1 -0
- package/dist/types/src/components/{Transcript/Transcript.stories.d.ts → Transcription/Transcription.stories.d.ts} +7 -6
- package/dist/types/src/components/Transcription/Transcription.stories.d.ts.map +1 -0
- package/dist/types/src/components/Transcription/index.d.ts +2 -0
- package/dist/types/src/components/Transcription/index.d.ts.map +1 -0
- package/dist/types/src/components/Transcription/transcription-extension.d.ts +15 -0
- package/dist/types/src/components/Transcription/transcription-extension.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +1 -3
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/components/stories/FileTranscription.stories.d.ts +3 -6
- package/dist/types/src/components/stories/FileTranscription.stories.d.ts.map +1 -1
- package/dist/types/src/components/stories/KeyWordRecognition.stories.d.ts +0 -3
- package/dist/types/src/components/stories/KeyWordRecognition.stories.d.ts.map +1 -1
- package/dist/types/src/components/stories/MicrophoneTranscription.stories.d.ts +3 -6
- package/dist/types/src/components/stories/MicrophoneTranscription.stories.d.ts.map +1 -1
- package/dist/types/src/components/stories/TranscriptionStory.d.ts +2 -2
- package/dist/types/src/components/stories/TranscriptionStory.d.ts.map +1 -1
- package/dist/types/src/containers/TranscriptionContainer/TranscriptionContainer.d.ts +6 -0
- package/dist/types/src/containers/TranscriptionContainer/TranscriptionContainer.d.ts.map +1 -0
- package/dist/types/src/containers/TranscriptionContainer/index.d.ts +3 -0
- package/dist/types/src/containers/TranscriptionContainer/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +3 -0
- package/dist/types/src/containers/index.d.ts.map +1 -0
- package/dist/types/src/functions/index.d.ts +17 -2
- package/dist/types/src/functions/index.d.ts.map +1 -1
- package/dist/types/src/functions/open.d.ts +6 -2
- package/dist/types/src/functions/open.d.ts.map +1 -1
- package/dist/types/src/functions/summarize.d.ts +1 -1
- package/dist/types/src/hooks/useQueueModelAdapter.d.ts +1 -1
- package/dist/types/src/hooks/useQueueModelAdapter.d.ts.map +1 -1
- package/dist/types/src/hooks/useTranscriber.d.ts +1 -1
- package/dist/types/src/hooks/useTranscriber.d.ts.map +1 -1
- package/dist/types/src/index.d.ts +1 -1
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/meta.d.ts +2 -2
- package/dist/types/src/meta.d.ts.map +1 -1
- package/dist/types/src/segments-normalization/message-normalizer.d.ts +5 -5
- package/dist/types/src/segments-normalization/message-normalizer.d.ts.map +1 -1
- package/dist/types/src/segments-normalization/normalization.d.ts +515 -448
- package/dist/types/src/segments-normalization/normalization.d.ts.map +1 -1
- package/dist/types/src/segments-normalization/utils.d.ts +2 -2
- package/dist/types/src/segments-normalization/utils.d.ts.map +1 -1
- package/dist/types/src/testing/testing.d.ts +9 -9
- package/dist/types/src/testing/testing.d.ts.map +1 -1
- package/dist/types/src/transcriber/media-stream-recorder.d.ts +2 -2
- package/dist/types/src/transcriber/media-stream-recorder.d.ts.map +1 -1
- package/dist/types/src/transcriber/transcriber.d.ts +4 -4
- package/dist/types/src/transcriber/transcriber.d.ts.map +1 -1
- package/dist/types/src/transcriber/transcription-manager.d.ts +9 -6
- package/dist/types/src/transcriber/transcription-manager.d.ts.map +1 -1
- package/dist/types/src/types/TranscriptAction.d.ts +22 -20
- package/dist/types/src/types/TranscriptAction.d.ts.map +1 -1
- package/dist/types/src/types/capabilities.d.ts +18 -0
- package/dist/types/src/types/capabilities.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +2 -1
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/src/util/index.d.ts +1 -0
- package/dist/types/src/util/index.d.ts.map +1 -1
- package/dist/types/src/util/render-byline.d.ts +4 -0
- package/dist/types/src/util/render-byline.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +84 -69
- package/src/TranscriptionPlugin.tsx +35 -57
- package/src/blueprints/index.ts +5 -0
- package/src/blueprints/transcription-blueprint.ts +33 -0
- package/src/capabilities/blueprint-definition/blueprint-definition.ts +17 -0
- package/src/capabilities/blueprint-definition/index.ts +7 -0
- package/src/capabilities/index.ts +4 -8
- package/src/capabilities/operation-handler/index.ts +7 -0
- package/src/capabilities/operation-handler/operation-handler.ts +25 -0
- package/src/capabilities/operation-resolver/index.ts +7 -0
- package/src/capabilities/operation-resolver/operation-resolver.ts +25 -0
- package/src/capabilities/react-surface/index.ts +7 -0
- package/src/capabilities/react-surface/react-surface.tsx +28 -0
- package/src/capabilities/transcriber/index.ts +7 -0
- package/src/capabilities/transcriber/transcriber.ts +85 -0
- package/src/components/{Transcript/Transcript.stories.tsx → Transcription/Transcription.stories.tsx} +42 -41
- package/src/components/Transcription/Transcription.tsx +63 -0
- package/src/components/{Transcript → Transcription}/index.ts +1 -1
- package/src/components/{Transcript/transcript-extension.ts → Transcription/transcription-extension.ts} +13 -9
- package/src/components/index.ts +1 -6
- package/src/components/stories/FileTranscription.stories.tsx +30 -36
- package/src/components/stories/KeyWordRecognition.stories.tsx +5 -8
- package/src/components/stories/MicrophoneTranscription.stories.tsx +50 -55
- package/src/components/stories/TranscriptionStory.tsx +7 -11
- package/src/containers/TranscriptionContainer/TranscriptionContainer.tsx +33 -0
- package/src/containers/TranscriptionContainer/index.ts +7 -0
- package/src/containers/index.ts +7 -0
- package/src/functions/index.ts +7 -2
- package/src/functions/open.ts +9 -11
- package/src/hooks/useQueueModelAdapter.ts +1 -1
- package/src/hooks/useTranscriber.ts +8 -3
- package/src/hooks/useVoiceInput.ts +2 -2
- package/src/index.ts +1 -1
- package/src/meta.ts +8 -3
- package/src/model/model.test.ts +20 -14
- package/src/segments-normalization/message-normalizer.ts +18 -13
- package/src/segments-normalization/normalization.test.ts +6 -11
- package/src/segments-normalization/normalization.ts +6 -6
- package/src/segments-normalization/utils.ts +2 -2
- package/src/testing/testing.ts +28 -18
- package/src/transcriber/media-stream-recorder.ts +3 -3
- package/src/transcriber/transcriber.browser.test.ts +4 -4
- package/src/transcriber/transcriber.ts +6 -6
- package/src/transcriber/transcription-manager.ts +21 -15
- package/src/types/TranscriptAction.ts +21 -13
- package/src/{capabilities → types}/capabilities.ts +8 -8
- package/src/types/index.ts +2 -1
- package/src/util/index.ts +1 -0
- package/src/util/render-byline.ts +33 -0
- package/dist/lib/browser/TranscriptContainer-QN5WUMWJ.mjs +0 -11
- package/dist/lib/browser/blueprint-definition-GO6GTEBT.mjs.map +0 -7
- package/dist/lib/browser/chunk-77NWYLC6.mjs +0 -8
- package/dist/lib/browser/chunk-77NWYLC6.mjs.map +0 -7
- package/dist/lib/browser/chunk-7LNCQDTT.mjs +0 -24
- package/dist/lib/browser/chunk-7LNCQDTT.mjs.map +0 -7
- package/dist/lib/browser/chunk-COBQIZ6B.mjs.map +0 -7
- package/dist/lib/browser/chunk-GGHMOEKZ.mjs +0 -63
- package/dist/lib/browser/chunk-GGHMOEKZ.mjs.map +0 -7
- package/dist/lib/browser/chunk-LCK3YRQF.mjs +0 -16
- package/dist/lib/browser/chunk-LCK3YRQF.mjs.map +0 -7
- package/dist/lib/browser/chunk-ZS2FXKEF.mjs.map +0 -7
- package/dist/lib/browser/intent-resolver-52EPFRMR.mjs +0 -25
- package/dist/lib/browser/intent-resolver-52EPFRMR.mjs.map +0 -7
- package/dist/lib/browser/react-surface-LCP2D2MF.mjs +0 -34
- package/dist/lib/browser/react-surface-LCP2D2MF.mjs.map +0 -7
- package/dist/lib/browser/transcriber-NG5MRCP6.mjs.map +0 -7
- package/dist/lib/node-esm/TranscriptContainer-WCUWVVSD.mjs +0 -12
- package/dist/lib/node-esm/blueprint-definition-6SU7GLBR.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-A6SB234F.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-FTTZ4YSX.mjs +0 -64
- package/dist/lib/node-esm/chunk-FTTZ4YSX.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-KLTPFUKN.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-N5Z4SKPH.mjs +0 -10
- package/dist/lib/node-esm/chunk-N5Z4SKPH.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-PEZRQYKO.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-RWRG3S2O.mjs +0 -17
- package/dist/lib/node-esm/chunk-RWRG3S2O.mjs.map +0 -7
- package/dist/lib/node-esm/intent-resolver-DZBQQRHN.mjs +0 -26
- package/dist/lib/node-esm/intent-resolver-DZBQQRHN.mjs.map +0 -7
- package/dist/lib/node-esm/react-surface-7UC2YXX2.mjs +0 -35
- package/dist/lib/node-esm/react-surface-7UC2YXX2.mjs.map +0 -7
- package/dist/lib/node-esm/transcriber-SMU7HD6F.mjs.map +0 -7
- package/dist/types/src/capabilities/blueprint-definition.d.ts +0 -5
- package/dist/types/src/capabilities/blueprint-definition.d.ts.map +0 -1
- package/dist/types/src/capabilities/capabilities.d.ts +0 -17
- package/dist/types/src/capabilities/capabilities.d.ts.map +0 -1
- package/dist/types/src/capabilities/intent-resolver.d.ts +0 -4
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +0 -1
- package/dist/types/src/capabilities/react-surface.d.ts +0 -4
- package/dist/types/src/capabilities/react-surface.d.ts.map +0 -1
- package/dist/types/src/capabilities/transcriber.d.ts +0 -8
- package/dist/types/src/capabilities/transcriber.d.ts.map +0 -1
- package/dist/types/src/components/Transcript/Transcript.d.ts +0 -20
- package/dist/types/src/components/Transcript/Transcript.d.ts.map +0 -1
- package/dist/types/src/components/Transcript/Transcript.stories.d.ts.map +0 -1
- package/dist/types/src/components/Transcript/deprecated/OldTranscript.d.ts +0 -28
- package/dist/types/src/components/Transcript/deprecated/OldTranscript.d.ts.map +0 -1
- package/dist/types/src/components/Transcript/index.d.ts +0 -2
- package/dist/types/src/components/Transcript/index.d.ts.map +0 -1
- package/dist/types/src/components/Transcript/transcript-extension.d.ts +0 -15
- package/dist/types/src/components/Transcript/transcript-extension.d.ts.map +0 -1
- package/dist/types/src/components/TranscriptContainer.d.ts +0 -9
- package/dist/types/src/components/TranscriptContainer.d.ts.map +0 -1
- package/dist/types/src/types/Transcript.d.ts +0 -30
- package/dist/types/src/types/Transcript.d.ts.map +0 -1
- package/src/capabilities/blueprint-definition.ts +0 -31
- package/src/capabilities/intent-resolver.ts +0 -18
- package/src/capabilities/react-surface.tsx +0 -22
- package/src/capabilities/transcriber.ts +0 -77
- package/src/components/Transcript/Transcript.tsx +0 -93
- package/src/components/Transcript/deprecated/OldTranscript.tsx +0 -260
- package/src/components/TranscriptContainer.tsx +0 -36
- package/src/types/Transcript.ts +0 -44
- /package/dist/lib/browser/{TranscriptContainer-QN5WUMWJ.mjs.map → blueprints/index.mjs.map} +0 -0
- /package/dist/lib/{node-esm/TranscriptContainer-WCUWVVSD.mjs.map → browser/chunk-J5LGTIGS.mjs.map} +0 -0
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/operation-resolver/operation-resolver.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { OperationResolver } from '@dxos/operation';\nimport { Transcript } from '@dxos/types';\n\nimport { TranscriptOperation } from '../../types';\n\nexport default Capability.makeModule(() =>\n Effect.succeed(\n Capability.contributes(Capabilities.OperationResolver, [\n OperationResolver.make({\n operation: TranscriptOperation.Create,\n handler: ({ space }) =>\n Effect.succeed({\n object: Transcript.make(space.queues.create().dxn),\n }),\n }),\n ]),\n ),\n);\n"],
|
|
5
|
+
"mappings": ";;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,yBAAyB;AAClC,SAASC,kBAAkB;AAI3B,IAAA,6BAAeC,WAAWC,WAAW,MAC5BC,eACLF,WAAWG,YAAYC,aAAaC,mBAAmB;EACrDA,kBAAkBC,KAAK;IACrBC,WAAWC,oBAAoBC;IAC/BC,SAAS,CAAC,EAAEC,MAAK,MACRT,eAAQ;MACbU,QAAQC,WAAWP,KAAKK,MAAMG,OAAOC,OAAM,EAAGC,GAAG;IACnD,CAAA;EACJ,CAAA;CACD,CAAA,CAAA;",
|
|
6
|
+
"names": ["Effect", "Capabilities", "Capability", "OperationResolver", "Transcript", "Capability", "makeModule", "succeed", "contributes", "Capabilities", "OperationResolver", "make", "operation", "TranscriptOperation", "Create", "handler", "space", "object", "Transcript", "queues", "create", "dxn"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
meta
|
|
3
|
+
} from "./chunk-2B74LZZD.mjs";
|
|
4
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
5
|
+
|
|
6
|
+
// src/capabilities/react-surface/react-surface.tsx
|
|
7
|
+
import * as Effect from "effect/Effect";
|
|
8
|
+
import React from "react";
|
|
9
|
+
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
10
|
+
import { Surface } from "@dxos/app-framework/ui";
|
|
11
|
+
import { Obj } from "@dxos/echo";
|
|
12
|
+
import { Transcript } from "@dxos/types";
|
|
13
|
+
|
|
14
|
+
// src/containers/index.ts
|
|
15
|
+
import { lazy } from "react";
|
|
16
|
+
var TranscriptionContainer = lazy(() => import("./TranscriptionContainer-RBFHP2AV.mjs"));
|
|
17
|
+
|
|
18
|
+
// src/capabilities/react-surface/react-surface.tsx
|
|
19
|
+
var react_surface_default = Capability.makeModule(() => Effect.succeed(Capability.contributes(Capabilities.ReactSurface, [
|
|
20
|
+
Surface.create({
|
|
21
|
+
id: `${meta.id}/article/transcript`,
|
|
22
|
+
role: [
|
|
23
|
+
"article",
|
|
24
|
+
"section"
|
|
25
|
+
],
|
|
26
|
+
filter: (data) => Obj.instanceOf(Transcript.Transcript, data.subject),
|
|
27
|
+
component: ({ data, role }) => /* @__PURE__ */ React.createElement(TranscriptionContainer, {
|
|
28
|
+
role,
|
|
29
|
+
subject: data.subject
|
|
30
|
+
})
|
|
31
|
+
})
|
|
32
|
+
])));
|
|
33
|
+
export {
|
|
34
|
+
react_surface_default as default
|
|
35
|
+
};
|
|
36
|
+
//# sourceMappingURL=react-surface-U2SI74JK.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/react-surface/react-surface.tsx", "../../../src/containers/index.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\nimport React from 'react';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { Surface } from '@dxos/app-framework/ui';\nimport { Obj } from '@dxos/echo';\nimport { Transcript } from '@dxos/types';\n\nimport { TranscriptionContainer } from '../../containers';\nimport { meta } from '../../meta';\n\nexport default Capability.makeModule(() =>\n Effect.succeed(\n Capability.contributes(Capabilities.ReactSurface, [\n Surface.create({\n id: `${meta.id}/article/transcript`,\n role: ['article', 'section'],\n filter: (data): data is { subject: Transcript.Transcript } =>\n Obj.instanceOf(Transcript.Transcript, data.subject),\n component: ({ data, role }) => <TranscriptionContainer role={role} subject={data.subject} />,\n }),\n ]),\n ),\n);\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { type ComponentType, lazy } from 'react';\n\nexport const TranscriptionContainer: ComponentType<any> = lazy(() => import('./TranscriptionContainer'));\n"],
|
|
5
|
+
"mappings": ";;;;;;AAIA,YAAYA,YAAY;AACxB,OAAOC,WAAW;AAElB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,eAAe;AACxB,SAASC,WAAW;AACpB,SAASC,kBAAkB;;;ACN3B,SAA6BC,YAAY;AAElC,IAAMC,yBAA6CC,KAAK,MAAM,OAAO,uCAAA,CAAA;;;ADS5E,IAAA,wBAAeC,WAAWC,WAAW,MAC5BC,eACLF,WAAWG,YAAYC,aAAaC,cAAc;EAChDC,QAAQC,OAAO;IACbC,IAAI,GAAGC,KAAKD,EAAE;IACdE,MAAM;MAAC;MAAW;;IAClBC,QAAQ,CAACC,SACPC,IAAIC,WAAWC,WAAWA,YAAYH,KAAKI,OAAO;IACpDC,WAAW,CAAC,EAAEL,MAAMF,KAAI,MAAO,sBAAA,cAACQ,wBAAAA;MAAuBR;MAAYM,SAASJ,KAAKI;;EACnF,CAAA;CACD,CAAA,CAAA;",
|
|
6
|
+
"names": ["Effect", "React", "Capabilities", "Capability", "Surface", "Obj", "Transcript", "lazy", "TranscriptionContainer", "lazy", "Capability", "makeModule", "succeed", "contributes", "Capabilities", "ReactSurface", "Surface", "create", "id", "meta", "role", "filter", "data", "Obj", "instanceOf", "Transcript", "subject", "component", "TranscriptionContainer"]
|
|
7
|
+
}
|
|
@@ -2,20 +2,24 @@ import {
|
|
|
2
2
|
MediaStreamRecorder,
|
|
3
3
|
Transcriber,
|
|
4
4
|
TranscriptionManager
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-EV5ZYKET.mjs";
|
|
6
|
+
import "./chunk-HOOPZ7EM.mjs";
|
|
6
7
|
import {
|
|
7
8
|
TranscriptionCapabilities
|
|
8
|
-
} from "./chunk-
|
|
9
|
-
import "./chunk-
|
|
10
|
-
import "./chunk-
|
|
9
|
+
} from "./chunk-GH4IIQ6C.mjs";
|
|
10
|
+
import "./chunk-2B74LZZD.mjs";
|
|
11
|
+
import "./chunk-J5LGTIGS.mjs";
|
|
11
12
|
|
|
12
|
-
// src/capabilities/transcriber.ts
|
|
13
|
-
import
|
|
13
|
+
// src/capabilities/transcriber/transcriber.ts
|
|
14
|
+
import * as Effect from "effect/Effect";
|
|
15
|
+
import { Capabilities, Capability } from "@dxos/app-framework";
|
|
14
16
|
import { ClientCapabilities } from "@dxos/plugin-client";
|
|
15
17
|
var RECORD_INTERVAL = 200;
|
|
16
18
|
var PREFIXED_CHUNKS_AMOUNT = 10;
|
|
17
19
|
var TRANSCRIBE_AFTER_CHUNKS_AMOUNT = 50;
|
|
18
|
-
var transcriber_default = ((
|
|
20
|
+
var transcriber_default = Capability.makeModule(Effect.fnUntraced(function* () {
|
|
21
|
+
const capabilities = yield* Capability.Service;
|
|
22
|
+
const registry = yield* Capability.get(Capabilities.AtomRegistry);
|
|
19
23
|
const getTranscriber = ({ audioStreamTrack, onSegments, transcriberConfig, recorderConfig }) => {
|
|
20
24
|
return new Transcriber({
|
|
21
25
|
config: {
|
|
@@ -34,10 +38,11 @@ var transcriber_default = ((context) => {
|
|
|
34
38
|
});
|
|
35
39
|
};
|
|
36
40
|
const getTranscriptionManager = ({ messageEnricher }) => {
|
|
37
|
-
const client =
|
|
41
|
+
const client = capabilities.get(ClientCapabilities.Client);
|
|
38
42
|
const transcriptionManager = new TranscriptionManager({
|
|
39
|
-
edgeClient: client.edge,
|
|
40
|
-
messageEnricher
|
|
43
|
+
edgeClient: client.edge.http,
|
|
44
|
+
messageEnricher,
|
|
45
|
+
registry
|
|
41
46
|
});
|
|
42
47
|
const identity = client.halo.identity.get();
|
|
43
48
|
if (identity) {
|
|
@@ -46,11 +51,11 @@ var transcriber_default = ((context) => {
|
|
|
46
51
|
return transcriptionManager;
|
|
47
52
|
};
|
|
48
53
|
return [
|
|
49
|
-
contributes(TranscriptionCapabilities.Transcriber, getTranscriber),
|
|
50
|
-
contributes(TranscriptionCapabilities.TranscriptionManager, getTranscriptionManager)
|
|
54
|
+
Capability.contributes(TranscriptionCapabilities.Transcriber, getTranscriber),
|
|
55
|
+
Capability.contributes(TranscriptionCapabilities.TranscriptionManager, getTranscriptionManager)
|
|
51
56
|
];
|
|
52
|
-
});
|
|
57
|
+
}));
|
|
53
58
|
export {
|
|
54
59
|
transcriber_default as default
|
|
55
60
|
};
|
|
56
|
-
//# sourceMappingURL=transcriber-
|
|
61
|
+
//# sourceMappingURL=transcriber-WCPHHJYY.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/transcriber/transcriber.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capabilities, Capability } from '@dxos/app-framework';\nimport { ClientCapabilities } from '@dxos/plugin-client';\n\nimport { MediaStreamRecorder, Transcriber, TranscriptionManager } from '../../transcriber';\nimport { TranscriptionCapabilities } from '../../types';\n\n// TODO(burdon): Move to config?\n\n/**\n * Length of the chunk in ms.\n */\nconst RECORD_INTERVAL = 200;\n\n/**\n * Number of chunks to save before the user starts speaking.\n */\nconst PREFIXED_CHUNKS_AMOUNT = 10;\n\n/**\n * Number of chunks to transcribe automatically after.\n * Combined should be mess than 25MB or whisper would fail.\n */\nconst TRANSCRIBE_AFTER_CHUNKS_AMOUNT = 50;\n\n/**\n * Records audio while user is speaking and transcribes it after user is done speaking.\n */\nexport default Capability.makeModule(\n Effect.fnUntraced(function* () {\n // Get context for lazy capability access in callbacks.\n const capabilities = yield* Capability.Service;\n const registry = yield* Capability.get(Capabilities.AtomRegistry);\n\n const getTranscriber: TranscriptionCapabilities.GetTranscriber = ({\n audioStreamTrack,\n onSegments,\n transcriberConfig,\n recorderConfig,\n }) => {\n // Initialize audio transcription.\n return new Transcriber({\n config: {\n transcribeAfterChunksAmount: TRANSCRIBE_AFTER_CHUNKS_AMOUNT,\n prefixBufferChunksAmount: PREFIXED_CHUNKS_AMOUNT,\n ...transcriberConfig,\n },\n recorder: new MediaStreamRecorder({\n mediaStreamTrack: audioStreamTrack,\n config: {\n interval: RECORD_INTERVAL,\n ...recorderConfig,\n },\n }),\n onSegments,\n });\n };\n\n const getTranscriptionManager: TranscriptionCapabilities.GetTranscriptionManager = ({ messageEnricher }) => {\n const client = capabilities.get(ClientCapabilities.Client);\n const transcriptionManager = new TranscriptionManager({\n edgeClient: client.edge.http,\n messageEnricher,\n registry,\n });\n\n const identity = client.halo.identity.get();\n if (identity) {\n transcriptionManager.setIdentityDid(identity.did);\n }\n\n return transcriptionManager;\n };\n\n return [\n Capability.contributes(TranscriptionCapabilities.Transcriber, getTranscriber),\n Capability.contributes(TranscriptionCapabilities.TranscriptionManager, getTranscriptionManager),\n ];\n }),\n);\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,cAAcC,kBAAkB;AACzC,SAASC,0BAA0B;AAUnC,IAAMC,kBAAkB;AAKxB,IAAMC,yBAAyB;AAM/B,IAAMC,iCAAiC;AAKvC,IAAA,sBAAeC,WAAWC,WACjBC,kBAAW,aAAA;AAEhB,QAAMC,eAAe,OAAOH,WAAWI;AACvC,QAAMC,WAAW,OAAOL,WAAWM,IAAIC,aAAaC,YAAY;AAEhE,QAAMC,iBAA2D,CAAC,EAChEC,kBACAC,YACAC,mBACAC,eAAc,MACf;AAEC,WAAO,IAAIC,YAAY;MACrBC,QAAQ;QACNC,6BAA6BjB;QAC7BkB,0BAA0BnB;QAC1B,GAAGc;MACL;MACAM,UAAU,IAAIC,oBAAoB;QAChCC,kBAAkBV;QAClBK,QAAQ;UACNM,UAAUxB;UACV,GAAGgB;QACL;MACF,CAAA;MACAF;IACF,CAAA;EACF;AAEA,QAAMW,0BAA6E,CAAC,EAAEC,gBAAe,MAAE;AACrG,UAAMC,SAASrB,aAAaG,IAAImB,mBAAmBC,MAAM;AACzD,UAAMC,uBAAuB,IAAIC,qBAAqB;MACpDC,YAAYL,OAAOM,KAAKC;MACxBR;MACAlB;IACF,CAAA;AAEA,UAAM2B,WAAWR,OAAOS,KAAKD,SAAS1B,IAAG;AACzC,QAAI0B,UAAU;AACZL,2BAAqBO,eAAeF,SAASG,GAAG;IAClD;AAEA,WAAOR;EACT;AAEA,SAAO;IACL3B,WAAWoC,YAAYC,0BAA0BvB,aAAaL,cAAAA;IAC9DT,WAAWoC,YAAYC,0BAA0BT,sBAAsBN,uBAAAA;;AAE3E,CAAA,CAAA;",
|
|
6
|
+
"names": ["Effect", "Capabilities", "Capability", "ClientCapabilities", "RECORD_INTERVAL", "PREFIXED_CHUNKS_AMOUNT", "TRANSCRIBE_AFTER_CHUNKS_AMOUNT", "Capability", "makeModule", "fnUntraced", "capabilities", "Service", "registry", "get", "Capabilities", "AtomRegistry", "getTranscriber", "audioStreamTrack", "onSegments", "transcriberConfig", "recorderConfig", "Transcriber", "config", "transcribeAfterChunksAmount", "prefixBufferChunksAmount", "recorder", "MediaStreamRecorder", "mediaStreamTrack", "interval", "getTranscriptionManager", "messageEnricher", "client", "ClientCapabilities", "Client", "transcriptionManager", "TranscriptionManager", "edgeClient", "edge", "http", "identity", "halo", "setIdentityDid", "did", "contributes", "TranscriptionCapabilities"]
|
|
7
|
+
}
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
import {
|
|
2
2
|
TRANSCRIPTION_URL,
|
|
3
3
|
TranscriptAction_exports,
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
TranscriptOperation,
|
|
5
|
+
TranscriptionCapabilities
|
|
6
|
+
} from "../chunk-GH4IIQ6C.mjs";
|
|
7
|
+
import "../chunk-2B74LZZD.mjs";
|
|
8
|
+
import "../chunk-J5LGTIGS.mjs";
|
|
7
9
|
export {
|
|
8
10
|
TRANSCRIPTION_URL,
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
TranscriptAction_exports as TranscriptAction,
|
|
12
|
+
TranscriptOperation,
|
|
13
|
+
TranscriptionCapabilities
|
|
11
14
|
};
|
|
12
15
|
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
Transcription,
|
|
4
|
+
useQueueModelAdapter
|
|
5
|
+
} from "./chunk-DYUGYQCB.mjs";
|
|
6
|
+
import {
|
|
7
|
+
renderByline
|
|
8
|
+
} from "./chunk-NVM2QUMX.mjs";
|
|
9
|
+
import "./chunk-6GW5NZYG.mjs";
|
|
10
|
+
import "./chunk-F47HK7GT.mjs";
|
|
11
|
+
import "./chunk-HSLMI22Q.mjs";
|
|
12
|
+
|
|
13
|
+
// src/containers/TranscriptionContainer/TranscriptionContainer.tsx
|
|
14
|
+
import React from "react";
|
|
15
|
+
import { Obj } from "@dxos/echo";
|
|
16
|
+
import { useMembers, useQueue } from "@dxos/react-client/echo";
|
|
17
|
+
import { Panel } from "@dxos/react-ui";
|
|
18
|
+
var TranscriptionContainer = ({ role, subject: transcript }) => {
|
|
19
|
+
const attendableId = Obj.getDXN(transcript).toString();
|
|
20
|
+
const db = Obj.getDatabase(transcript);
|
|
21
|
+
const members = useMembers(db?.spaceId).map((member) => member.identity);
|
|
22
|
+
const queue = useQueue(transcript.queue.dxn, {
|
|
23
|
+
pollInterval: 1e3
|
|
24
|
+
});
|
|
25
|
+
const model = useQueueModelAdapter(renderByline(members), queue);
|
|
26
|
+
return /* @__PURE__ */ React.createElement(Panel.Root, {
|
|
27
|
+
role
|
|
28
|
+
}, /* @__PURE__ */ React.createElement(Panel.Content, {
|
|
29
|
+
asChild: true
|
|
30
|
+
}, /* @__PURE__ */ React.createElement(Transcription, {
|
|
31
|
+
attendableId,
|
|
32
|
+
model,
|
|
33
|
+
transcript
|
|
34
|
+
})));
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
// src/containers/TranscriptionContainer/index.ts
|
|
38
|
+
var TranscriptionContainer_default = TranscriptionContainer;
|
|
39
|
+
export {
|
|
40
|
+
TranscriptionContainer_default as default
|
|
41
|
+
};
|
|
42
|
+
//# sourceMappingURL=TranscriptionContainer-3OOID5KH.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/containers/TranscriptionContainer/TranscriptionContainer.tsx", "../../../src/containers/TranscriptionContainer/index.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2024 DXOS.org\n//\n\nimport React from 'react';\n\nimport { type SurfaceComponentProps } from '@dxos/app-toolkit/ui';\nimport { Obj } from '@dxos/echo';\nimport { useMembers, useQueue } from '@dxos/react-client/echo';\nimport { Panel } from '@dxos/react-ui';\nimport { type Message, type Transcript } from '@dxos/types';\n\nimport { Transcription } from '../../components';\nimport { useQueueModelAdapter } from '../../hooks';\nimport { renderByline } from '../../util';\n\nexport type TranscriptionContainerProps = SurfaceComponentProps<Transcript.Transcript>;\n\nexport const TranscriptionContainer = ({ role, subject: transcript }: TranscriptionContainerProps) => {\n const attendableId = Obj.getDXN(transcript).toString();\n const db = Obj.getDatabase(transcript);\n const members = useMembers(db?.spaceId).map((member) => member.identity);\n const queue = useQueue<Message.Message>(transcript.queue.dxn, { pollInterval: 1_000 });\n const model = useQueueModelAdapter(renderByline(members), queue);\n\n return (\n <Panel.Root role={role}>\n <Panel.Content asChild>\n <Transcription attendableId={attendableId} model={model} transcript={transcript} />\n </Panel.Content>\n </Panel.Root>\n );\n};\n", "//\n// Copyright 2024 DXOS.org\n//\n\nimport { TranscriptionContainer } from './TranscriptionContainer';\n\nexport default TranscriptionContainer;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;;;;;AAIA,OAAOA,WAAW;AAGlB,SAASC,WAAW;AACpB,SAASC,YAAYC,gBAAgB;AACrC,SAASC,aAAa;AASf,IAAMC,yBAAyB,CAAC,EAAEC,MAAMC,SAASC,WAAU,MAA+B;AAC/F,QAAMC,eAAeC,IAAIC,OAAOH,UAAAA,EAAYI,SAAQ;AACpD,QAAMC,KAAKH,IAAII,YAAYN,UAAAA;AAC3B,QAAMO,UAAUC,WAAWH,IAAII,OAAAA,EAASC,IAAI,CAACC,WAAWA,OAAOC,QAAQ;AACvE,QAAMC,QAAQC,SAA0Bd,WAAWa,MAAME,KAAK;IAAEC,cAAc;EAAM,CAAA;AACpF,QAAMC,QAAQC,qBAAqBC,aAAaZ,OAAAA,GAAUM,KAAAA;AAE1D,SACE,sBAAA,cAACO,MAAMC,MAAI;IAACvB;KACV,sBAAA,cAACsB,MAAME,SAAO;IAACC,SAAAA;KACb,sBAAA,cAACC,eAAAA;IAAcvB;IAA4BgB;IAAcjB;;AAIjE;;;AC1BA,IAAA,iCAAeyB;",
|
|
6
|
+
"names": ["React", "Obj", "useMembers", "useQueue", "Panel", "TranscriptionContainer", "role", "subject", "transcript", "attendableId", "Obj", "getDXN", "toString", "db", "getDatabase", "members", "useMembers", "spaceId", "map", "member", "identity", "queue", "useQueue", "dxn", "pollInterval", "model", "useQueueModelAdapter", "renderByline", "Panel", "Root", "Content", "asChild", "Transcription", "TranscriptionContainer"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
transcription_blueprint_default
|
|
4
|
+
} from "./chunk-H3MXHMQL.mjs";
|
|
5
|
+
import "./chunk-NVM2QUMX.mjs";
|
|
6
|
+
import "./chunk-HSLMI22Q.mjs";
|
|
7
|
+
|
|
8
|
+
// src/capabilities/blueprint-definition/blueprint-definition.ts
|
|
9
|
+
import * as Effect from "effect/Effect";
|
|
10
|
+
import { Capability } from "@dxos/app-framework";
|
|
11
|
+
import { AppCapabilities } from "@dxos/app-toolkit";
|
|
12
|
+
var blueprintDefinition = Capability.makeModule(() => Effect.succeed([
|
|
13
|
+
Capability.contributes(AppCapabilities.BlueprintDefinition, transcription_blueprint_default)
|
|
14
|
+
]));
|
|
15
|
+
var blueprint_definition_default = blueprintDefinition;
|
|
16
|
+
export {
|
|
17
|
+
blueprint_definition_default as default
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=blueprint-definition-TLXDUXIQ.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/capabilities/blueprint-definition/blueprint-definition.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Capability } from '@dxos/app-framework';\nimport { AppCapabilities } from '@dxos/app-toolkit';\n\nimport { TranscriptionBlueprint } from '../../blueprints';\n\nconst blueprintDefinition = Capability.makeModule<\n [],\n Capability.Capability<typeof AppCapabilities.BlueprintDefinition>[]\n>(() => Effect.succeed([Capability.contributes(AppCapabilities.BlueprintDefinition, TranscriptionBlueprint)]));\n\nexport default blueprintDefinition;\n"],
|
|
5
|
+
"mappings": ";;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,kBAAkB;AAC3B,SAASC,uBAAuB;AAIhC,IAAMC,sBAAsBC,WAAWC,WAGrC,MAAaC,eAAQ;EAACF,WAAWG,YAAYC,gBAAgBC,qBAAqBC,+BAAAA;CAAwB,CAAA;AAE5G,IAAA,+BAAeP;",
|
|
6
|
+
"names": ["Effect", "Capability", "AppCapabilities", "blueprintDefinition", "Capability", "makeModule", "succeed", "contributes", "AppCapabilities", "BlueprintDefinition", "TranscriptionBlueprint"]
|
|
7
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
transcription_blueprint_default
|
|
4
|
+
} from "../chunk-H3MXHMQL.mjs";
|
|
5
|
+
import "../chunk-NVM2QUMX.mjs";
|
|
6
|
+
import "../chunk-HSLMI22Q.mjs";
|
|
7
|
+
export {
|
|
8
|
+
transcription_blueprint_default as TranscriptionBlueprint
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
meta
|
|
4
|
+
} from "./chunk-F47HK7GT.mjs";
|
|
5
|
+
import {
|
|
6
|
+
__export
|
|
7
|
+
} from "./chunk-HSLMI22Q.mjs";
|
|
8
|
+
|
|
9
|
+
// src/types/capabilities.ts
|
|
10
|
+
import { Capability } from "@dxos/app-framework";
|
|
11
|
+
(function(TranscriptionCapabilities2) {
|
|
12
|
+
TranscriptionCapabilities2.Transcriber = Capability.make(`${meta.id}/capability/transcriber`);
|
|
13
|
+
TranscriptionCapabilities2.TranscriptionManager = Capability.make(`${meta.id}/capability/transcription-manager`);
|
|
14
|
+
})(TranscriptionCapabilities || (TranscriptionCapabilities = {}));
|
|
15
|
+
var TranscriptionCapabilities;
|
|
16
|
+
|
|
17
|
+
// src/types/TranscriptAction.ts
|
|
18
|
+
var TranscriptAction_exports = {};
|
|
19
|
+
__export(TranscriptAction_exports, {
|
|
20
|
+
TranscriptOperation: () => TranscriptOperation
|
|
21
|
+
});
|
|
22
|
+
import * as Schema from "effect/Schema";
|
|
23
|
+
import { SpaceSchema } from "@dxos/client/echo";
|
|
24
|
+
import { Operation } from "@dxos/operation";
|
|
25
|
+
import { Transcript } from "@dxos/types";
|
|
26
|
+
var TRANSCRIPT_OPERATION = `${meta.id}/operation`;
|
|
27
|
+
(function(TranscriptOperation2) {
|
|
28
|
+
TranscriptOperation2.Create = Operation.make({
|
|
29
|
+
meta: {
|
|
30
|
+
key: `${TRANSCRIPT_OPERATION}/create`,
|
|
31
|
+
name: "Create Transcript"
|
|
32
|
+
},
|
|
33
|
+
schema: {
|
|
34
|
+
input: Schema.Struct({
|
|
35
|
+
name: Schema.optional(Schema.String),
|
|
36
|
+
space: SpaceSchema
|
|
37
|
+
}),
|
|
38
|
+
output: Schema.Struct({
|
|
39
|
+
object: Transcript.Transcript
|
|
40
|
+
})
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
})(TranscriptOperation || (TranscriptOperation = {}));
|
|
44
|
+
var TranscriptOperation;
|
|
45
|
+
|
|
46
|
+
// src/types/types.ts
|
|
47
|
+
var TRANSCRIPTION_URL = "https://calls-service.dxos.workers.dev";
|
|
48
|
+
|
|
49
|
+
export {
|
|
50
|
+
TranscriptionCapabilities,
|
|
51
|
+
TranscriptOperation,
|
|
52
|
+
TranscriptAction_exports,
|
|
53
|
+
TRANSCRIPTION_URL
|
|
54
|
+
};
|
|
55
|
+
//# sourceMappingURL=chunk-6GW5NZYG.mjs.map
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/types/capabilities.ts", "../../../src/types/TranscriptAction.ts", "../../../src/types/types.ts"],
|
|
4
|
+
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { Capability } from '@dxos/app-framework';\n\nimport { meta } from '../meta';\nimport {\n type MediaStreamRecorderProps,\n type Transcriber,\n type TranscriberProps,\n type TranscriptMessageEnricher,\n type TranscriptionManager,\n} from '../transcriber';\n\nexport namespace TranscriptionCapabilities {\n export type GetTranscriberProps = {\n audioStreamTrack: MediaStreamTrack;\n recorderConfig?: Partial<MediaStreamRecorderProps['config']>;\n transcriberConfig?: Partial<TranscriberProps['config']>;\n onSegments: TranscriberProps['onSegments'];\n };\n export type GetTranscriber = (props: GetTranscriberProps) => Transcriber;\n export const Transcriber = Capability.make<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 = Capability.make<GetTranscriptionManager>(\n `${meta.id}/capability/transcription-manager`,\n );\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Schema from 'effect/Schema';\n\nimport { SpaceSchema } from '@dxos/client/echo';\nimport { Operation } from '@dxos/operation';\nimport { Transcript } from '@dxos/types';\n\nimport { meta } from '../meta';\n\n//\n// Operations\n//\n\nconst TRANSCRIPT_OPERATION = `${meta.id}/operation`;\n\nexport namespace TranscriptOperation {\n export const Create = Operation.make({\n meta: { key: `${TRANSCRIPT_OPERATION}/create`, name: 'Create Transcript' },\n schema: {\n input: Schema.Struct({\n name: Schema.optional(Schema.String),\n space: SpaceSchema,\n }),\n output: Schema.Struct({\n object: Transcript.Transcript,\n }),\n },\n });\n}\n", "//\n// Copyright 2025 DXOS.org\n//\n\n/**\n * Endpoint to the calls service.\n */\n// TODO(burdon): Reconfigure/move.\nexport const TRANSCRIPTION_URL = 'https://calls-service.dxos.workers.dev';\n"],
|
|
5
|
+
"mappings": ";;;;;;;;;AAIA,SAASA,kBAAkB;UAWVC,4BAAAA;6BAQFC,cAAcC,WAAWC,KAAqB,GAAGC,KAAKC,EAAE,yBAAyB;6BAMjFC,uBAAuBJ,WAAWC,KAC7C,GAAGC,KAAKC,EAAE,mCAAmC;AAEjD,GAjBiBL,8BAAAA,4BAAAA,CAAAA,EAAAA;;;;ACfjB;;;;AAIA,YAAYO,YAAY;AAExB,SAASC,mBAAmB;AAC5B,SAASC,iBAAiB;AAC1B,SAASC,kBAAkB;AAQ3B,IAAMC,uBAAuB,GAAGC,KAAKC,EAAE;UAEtBC,sBAAAA;uBACFC,SAASC,UAAUC,KAAK;IACnCL,MAAM;MAAEM,KAAK,GAAGP,oBAAAA;MAA+BQ,MAAM;IAAoB;IACzEC,QAAQ;MACNC,OAAcC,cAAO;QACnBH,MAAaI,gBAAgBC,aAAM;QACnCC,OAAOC;MACT,CAAA;MACAC,QAAeL,cAAO;QACpBM,QAAQC,WAAWA;MACrB,CAAA;IACF;EACF,CAAA;AACF,GAbiBf,wBAAAA,sBAAAA,CAAAA,EAAAA;;;;ACVV,IAAMgB,oBAAoB;",
|
|
6
|
+
"names": ["Capability", "TranscriptionCapabilities", "Transcriber", "Capability", "make", "meta", "id", "TranscriptionManager", "Schema", "SpaceSchema", "Operation", "Transcript", "TRANSCRIPT_OPERATION", "meta", "id", "TranscriptOperation", "Create", "Operation", "make", "key", "name", "schema", "input", "Struct", "optional", "String", "space", "SpaceSchema", "output", "object", "Transcript", "TRANSCRIPTION_URL"]
|
|
7
|
+
}
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
+
import {
|
|
3
|
+
mergeFloat64Arrays
|
|
4
|
+
} from "./chunk-NVM2QUMX.mjs";
|
|
2
5
|
import {
|
|
3
6
|
TRANSCRIPTION_URL
|
|
4
|
-
} from "./chunk-
|
|
7
|
+
} from "./chunk-6GW5NZYG.mjs";
|
|
5
8
|
|
|
6
9
|
// src/transcriber/media-stream-recorder.ts
|
|
7
10
|
import { MediaRecorder, register } from "extendable-media-recorder";
|
|
@@ -10,19 +13,6 @@ import { synchronized } from "@dxos/async";
|
|
|
10
13
|
import { invariant } from "@dxos/invariant";
|
|
11
14
|
import { log } from "@dxos/log";
|
|
12
15
|
import { trace } from "@dxos/tracing";
|
|
13
|
-
function _define_property(obj, key, value) {
|
|
14
|
-
if (key in obj) {
|
|
15
|
-
Object.defineProperty(obj, key, {
|
|
16
|
-
value,
|
|
17
|
-
enumerable: true,
|
|
18
|
-
configurable: true,
|
|
19
|
-
writable: true
|
|
20
|
-
});
|
|
21
|
-
} else {
|
|
22
|
-
obj[key] = value;
|
|
23
|
-
}
|
|
24
|
-
return obj;
|
|
25
|
-
}
|
|
26
16
|
function _ts_decorate(decorators, target, key, desc) {
|
|
27
17
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
28
18
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -36,6 +26,18 @@ var initializeExtendableMediaRecorder = async () => {
|
|
|
36
26
|
await register(await connect());
|
|
37
27
|
};
|
|
38
28
|
var MediaStreamRecorder = class {
|
|
29
|
+
_mediaStreamTrack;
|
|
30
|
+
/**
|
|
31
|
+
* Default MediaRecorder implementation do not support wav encoding.
|
|
32
|
+
*/
|
|
33
|
+
_config;
|
|
34
|
+
_mediaRecorder = void 0;
|
|
35
|
+
_header = void 0;
|
|
36
|
+
_onChunk;
|
|
37
|
+
constructor({ mediaStreamTrack, config }) {
|
|
38
|
+
this._mediaStreamTrack = mediaStreamTrack;
|
|
39
|
+
this._config = config;
|
|
40
|
+
}
|
|
39
41
|
get wavConfig() {
|
|
40
42
|
const settings = this._mediaStreamTrack.getSettings();
|
|
41
43
|
return {
|
|
@@ -51,7 +53,7 @@ var MediaStreamRecorder = class {
|
|
|
51
53
|
this._onChunk = onChunk;
|
|
52
54
|
}
|
|
53
55
|
async start() {
|
|
54
|
-
await (initializingPromise
|
|
56
|
+
await (initializingPromise ??= initializeExtendableMediaRecorder()).catch((err) => log.info("initializeExtendableMediaRecorder", {
|
|
55
57
|
err
|
|
56
58
|
}, {
|
|
57
59
|
F: __dxlog_file,
|
|
@@ -118,15 +120,6 @@ var MediaStreamRecorder = class {
|
|
|
118
120
|
data: wav.getSamples()
|
|
119
121
|
});
|
|
120
122
|
}
|
|
121
|
-
constructor({ mediaStreamTrack, config }) {
|
|
122
|
-
_define_property(this, "_mediaStreamTrack", void 0);
|
|
123
|
-
_define_property(this, "_config", void 0);
|
|
124
|
-
_define_property(this, "_mediaRecorder", void 0);
|
|
125
|
-
_define_property(this, "_header", void 0);
|
|
126
|
-
_define_property(this, "_onChunk", void 0);
|
|
127
|
-
this._mediaStreamTrack = mediaStreamTrack;
|
|
128
|
-
this._config = config;
|
|
129
|
-
}
|
|
130
123
|
};
|
|
131
124
|
_ts_decorate([
|
|
132
125
|
synchronized
|
|
@@ -141,32 +134,6 @@ import { DeferredTask, Trigger } from "@dxos/async";
|
|
|
141
134
|
import { LifecycleState, Resource } from "@dxos/context";
|
|
142
135
|
import { log as log2 } from "@dxos/log";
|
|
143
136
|
import { trace as trace2 } from "@dxos/tracing";
|
|
144
|
-
|
|
145
|
-
// src/util/array.ts
|
|
146
|
-
var mergeFloat64Arrays = (arrays) => {
|
|
147
|
-
const newArray = new Float64Array(arrays.reduce((acc, array) => array.length + acc, 0));
|
|
148
|
-
let offset = 0;
|
|
149
|
-
for (const array of arrays) {
|
|
150
|
-
newArray.set(array, offset);
|
|
151
|
-
offset += array.length;
|
|
152
|
-
}
|
|
153
|
-
return newArray;
|
|
154
|
-
};
|
|
155
|
-
|
|
156
|
-
// src/transcriber/transcriber.ts
|
|
157
|
-
function _define_property2(obj, key, value) {
|
|
158
|
-
if (key in obj) {
|
|
159
|
-
Object.defineProperty(obj, key, {
|
|
160
|
-
value,
|
|
161
|
-
enumerable: true,
|
|
162
|
-
configurable: true,
|
|
163
|
-
writable: true
|
|
164
|
-
});
|
|
165
|
-
} else {
|
|
166
|
-
obj[key] = value;
|
|
167
|
-
}
|
|
168
|
-
return obj;
|
|
169
|
-
}
|
|
170
137
|
function _ts_decorate2(decorators, target, key, desc) {
|
|
171
138
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
172
139
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -175,6 +142,22 @@ function _ts_decorate2(decorators, target, key, desc) {
|
|
|
175
142
|
}
|
|
176
143
|
var __dxlog_file2 = "/__w/dxos/dxos/packages/plugins/plugin-transcription/src/transcriber/transcriber.ts";
|
|
177
144
|
var Transcriber = class extends Resource {
|
|
145
|
+
_audioChunks = [];
|
|
146
|
+
_lastUsedTimestamp = 0;
|
|
147
|
+
_openTrigger = new Trigger({
|
|
148
|
+
autoReset: true
|
|
149
|
+
});
|
|
150
|
+
_config;
|
|
151
|
+
_recorder;
|
|
152
|
+
_onSegments;
|
|
153
|
+
_recording = false;
|
|
154
|
+
_transcribeTask = void 0;
|
|
155
|
+
constructor({ config, recorder, onSegments }) {
|
|
156
|
+
super();
|
|
157
|
+
this._config = config;
|
|
158
|
+
this._recorder = recorder;
|
|
159
|
+
this._onSegments = onSegments;
|
|
160
|
+
}
|
|
178
161
|
async _open(ctx) {
|
|
179
162
|
log2.info("opening", void 0, {
|
|
180
163
|
F: __dxlog_file2,
|
|
@@ -323,14 +306,6 @@ var Transcriber = class extends Resource {
|
|
|
323
306
|
text: segment.text.trim()
|
|
324
307
|
}));
|
|
325
308
|
}
|
|
326
|
-
constructor({ config, recorder, onSegments }) {
|
|
327
|
-
super(), _define_property2(this, "_audioChunks", []), _define_property2(this, "_lastUsedTimestamp", 0), _define_property2(this, "_openTrigger", new Trigger({
|
|
328
|
-
autoReset: true
|
|
329
|
-
})), _define_property2(this, "_config", void 0), _define_property2(this, "_recorder", void 0), _define_property2(this, "_onSegments", void 0), _define_property2(this, "_recording", false), _define_property2(this, "_transcribeTask", void 0);
|
|
330
|
-
this._config = config;
|
|
331
|
-
this._recorder = recorder;
|
|
332
|
-
this._onSegments = onSegments;
|
|
333
|
-
}
|
|
334
309
|
};
|
|
335
310
|
_ts_decorate2([
|
|
336
311
|
trace2.span({
|
|
@@ -344,24 +319,11 @@ _ts_decorate2([
|
|
|
344
319
|
], Transcriber.prototype, "_fetchTranscription", null);
|
|
345
320
|
|
|
346
321
|
// src/transcriber/transcription-manager.ts
|
|
347
|
-
import {
|
|
322
|
+
import { Atom } from "@effect-atom/atom-react";
|
|
348
323
|
import { synchronized as synchronized2 } from "@dxos/async";
|
|
349
324
|
import { Resource as Resource2 } from "@dxos/context";
|
|
350
325
|
import { Obj } from "@dxos/echo";
|
|
351
|
-
import {
|
|
352
|
-
function _define_property3(obj, key, value) {
|
|
353
|
-
if (key in obj) {
|
|
354
|
-
Object.defineProperty(obj, key, {
|
|
355
|
-
value,
|
|
356
|
-
enumerable: true,
|
|
357
|
-
configurable: true,
|
|
358
|
-
writable: true
|
|
359
|
-
});
|
|
360
|
-
} else {
|
|
361
|
-
obj[key] = value;
|
|
362
|
-
}
|
|
363
|
-
return obj;
|
|
364
|
-
}
|
|
326
|
+
import { Message } from "@dxos/types";
|
|
365
327
|
function _ts_decorate3(decorators, target, key, desc) {
|
|
366
328
|
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
367
329
|
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
@@ -372,9 +334,26 @@ var RECORD_INTERVAL = 200;
|
|
|
372
334
|
var PREFIXED_CHUNKS_AMOUNT = 10;
|
|
373
335
|
var TRANSCRIBE_AFTER_CHUNKS_AMOUNT = 50;
|
|
374
336
|
var TranscriptionManager = class extends Resource2 {
|
|
375
|
-
|
|
337
|
+
_edgeClient;
|
|
338
|
+
_messageEnricher;
|
|
339
|
+
_registry;
|
|
340
|
+
_audioStreamTrack = void 0;
|
|
341
|
+
_identityDid = void 0;
|
|
342
|
+
_mediaRecorder = void 0;
|
|
343
|
+
_transcriber = void 0;
|
|
344
|
+
_queue = void 0;
|
|
345
|
+
_enabledAtom = Atom.make(false);
|
|
346
|
+
constructor(options) {
|
|
347
|
+
super();
|
|
348
|
+
this._edgeClient = options.edgeClient;
|
|
349
|
+
this._messageEnricher = options.messageEnricher;
|
|
350
|
+
this._registry = options.registry;
|
|
351
|
+
}
|
|
376
352
|
get enabled() {
|
|
377
|
-
return this.
|
|
353
|
+
return this._enabledAtom;
|
|
354
|
+
}
|
|
355
|
+
getEnabled() {
|
|
356
|
+
return this._registry.get(this._enabledAtom);
|
|
378
357
|
}
|
|
379
358
|
setQueue(queue) {
|
|
380
359
|
this._queue = queue;
|
|
@@ -387,7 +366,7 @@ var TranscriptionManager = class extends Resource2 {
|
|
|
387
366
|
return this;
|
|
388
367
|
}
|
|
389
368
|
setRecording(recording) {
|
|
390
|
-
if (!this.isOpen || !this.
|
|
369
|
+
if (!this.isOpen || !this.getEnabled()) {
|
|
391
370
|
return this;
|
|
392
371
|
}
|
|
393
372
|
if (recording) {
|
|
@@ -398,10 +377,10 @@ var TranscriptionManager = class extends Resource2 {
|
|
|
398
377
|
return this;
|
|
399
378
|
}
|
|
400
379
|
async setEnabled(enabled) {
|
|
401
|
-
if (this.
|
|
380
|
+
if (this.getEnabled() === enabled) {
|
|
402
381
|
return;
|
|
403
382
|
}
|
|
404
|
-
this.
|
|
383
|
+
this._registry.set(this._enabledAtom, enabled ?? false);
|
|
405
384
|
if (enabled) {
|
|
406
385
|
await this._maybeRestartTranscriber();
|
|
407
386
|
} else {
|
|
@@ -422,7 +401,7 @@ var TranscriptionManager = class extends Resource2 {
|
|
|
422
401
|
await this._stopTranscriber();
|
|
423
402
|
}
|
|
424
403
|
async _maybeRestartTranscriber() {
|
|
425
|
-
if (!this._audioStreamTrack || !this.
|
|
404
|
+
if (!this._audioStreamTrack || !this.getEnabled() || !this.isOpen) {
|
|
426
405
|
return;
|
|
427
406
|
}
|
|
428
407
|
let needReinit = false;
|
|
@@ -455,7 +434,7 @@ var TranscriptionManager = class extends Resource2 {
|
|
|
455
434
|
if (!this.isOpen || !this._queue) {
|
|
456
435
|
return;
|
|
457
436
|
}
|
|
458
|
-
let block = Obj.make(
|
|
437
|
+
let block = Obj.make(Message.Message, {
|
|
459
438
|
created: (/* @__PURE__ */ new Date()).toISOString(),
|
|
460
439
|
blocks: segments,
|
|
461
440
|
sender: {
|
|
@@ -469,11 +448,6 @@ var TranscriptionManager = class extends Resource2 {
|
|
|
469
448
|
block
|
|
470
449
|
]);
|
|
471
450
|
}
|
|
472
|
-
constructor(options) {
|
|
473
|
-
super(), _define_property3(this, "_edgeClient", void 0), _define_property3(this, "_messageEnricher", void 0), _define_property3(this, "_audioStreamTrack", void 0), _define_property3(this, "_identityDid", void 0), _define_property3(this, "_mediaRecorder", void 0), _define_property3(this, "_transcriber", void 0), _define_property3(this, "_queue", void 0), _define_property3(this, "_enabled", signal(false));
|
|
474
|
-
this._edgeClient = options.edgeClient;
|
|
475
|
-
this._messageEnricher = options.messageEnricher;
|
|
476
|
-
}
|
|
477
451
|
};
|
|
478
452
|
_ts_decorate3([
|
|
479
453
|
synchronized2
|
|
@@ -484,4 +458,4 @@ export {
|
|
|
484
458
|
Transcriber,
|
|
485
459
|
TranscriptionManager
|
|
486
460
|
};
|
|
487
|
-
//# sourceMappingURL=chunk-
|
|
461
|
+
//# sourceMappingURL=chunk-7UE7G6DE.mjs.map
|