@dxos/plugin-transcription 0.8.4-main.abd8ff62ef → 0.8.4-main.bc2380dfbc
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/LICENSE +102 -5
- package/README.md +1 -1
- package/dist/lib/neutral/TranscriptionArticle-L6XANBH5.mjs +54 -0
- package/dist/lib/neutral/TranscriptionArticle-L6XANBH5.mjs.map +7 -0
- package/dist/lib/neutral/TranscriptionPlugin.mjs +34 -0
- package/dist/lib/neutral/TranscriptionPlugin.mjs.map +7 -0
- package/dist/lib/neutral/TranscriptionPlugin.node.mjs +25 -0
- package/dist/lib/neutral/TranscriptionPlugin.node.mjs.map +7 -0
- package/dist/lib/neutral/TranscriptionPlugin.workerd.mjs +21 -0
- package/dist/lib/neutral/TranscriptionPlugin.workerd.mjs.map +7 -0
- package/dist/lib/neutral/blueprint-definition-HOXDG5QP.mjs +15 -0
- package/dist/lib/neutral/blueprint-definition-HOXDG5QP.mjs.map +7 -0
- package/dist/lib/neutral/blueprints/index.mjs +8 -0
- package/dist/lib/neutral/capabilities/index.mjs +17 -0
- package/dist/lib/neutral/capabilities/index.mjs.map +7 -0
- package/dist/lib/{browser/chunk-NQQK7UZQ.mjs → neutral/chunk-2O3ONPRZ.mjs} +94 -40
- package/dist/lib/neutral/chunk-2O3ONPRZ.mjs.map +7 -0
- package/dist/lib/{browser/chunk-L4HW35L6.mjs → neutral/chunk-5FXU36PN.mjs} +19 -10
- package/dist/lib/neutral/chunk-5FXU36PN.mjs.map +7 -0
- package/dist/lib/neutral/chunk-GL4RS533.mjs +22 -0
- package/dist/lib/neutral/chunk-GL4RS533.mjs.map +7 -0
- package/dist/lib/{browser/index.mjs → neutral/chunk-ILSA3DU7.mjs} +32 -70
- package/dist/lib/neutral/chunk-ILSA3DU7.mjs.map +7 -0
- package/dist/lib/neutral/chunk-Y5EQAFFR.mjs +8 -0
- package/dist/lib/neutral/chunk-Y5EQAFFR.mjs.map +7 -0
- package/dist/lib/{browser/blueprints/index.mjs → neutral/chunk-ZR4BH4QQ.mjs} +4 -5
- package/dist/lib/neutral/chunk-ZR4BH4QQ.mjs.map +7 -0
- package/dist/lib/{browser → neutral}/components/index.mjs +83 -18
- package/dist/lib/neutral/components/index.mjs.map +7 -0
- package/dist/lib/neutral/containers/index.mjs +9 -0
- package/dist/lib/neutral/containers/index.mjs.map +7 -0
- package/dist/lib/{browser/create-ULR5DPJZ.mjs → neutral/create-RRWRIUSR.mjs} +4 -4
- package/dist/lib/neutral/create-RRWRIUSR.mjs.map +7 -0
- package/dist/lib/{browser → neutral}/hooks/index.mjs +5 -3
- package/dist/lib/neutral/index.mjs +44 -0
- package/dist/lib/neutral/meta.json +1 -0
- package/dist/lib/neutral/meta.mjs +8 -0
- package/dist/lib/{browser/open-SFMPLZVW.mjs → neutral/open-CVMX5KXZ.mjs} +5 -5
- package/dist/lib/neutral/open-CVMX5KXZ.mjs.map +7 -0
- package/dist/lib/neutral/operation-handler-NXMOAXFP.mjs +13 -0
- package/dist/lib/neutral/operation-handler-NXMOAXFP.mjs.map +7 -0
- package/dist/lib/neutral/operations/index.mjs +8 -0
- package/dist/lib/neutral/plugin.mjs +16 -0
- package/dist/lib/neutral/plugin.mjs.map +7 -0
- package/dist/lib/neutral/react-surface-YMZRO242.mjs +26 -0
- package/dist/lib/neutral/react-surface-YMZRO242.mjs.map +7 -0
- package/dist/lib/{browser/summarize-BDFX4APN.mjs → neutral/summarize-LA7TRW7A.mjs} +5 -5
- package/dist/lib/neutral/summarize-LA7TRW7A.mjs.map +7 -0
- package/dist/lib/neutral/text-content-F4ASMITB.mjs +30 -0
- package/dist/lib/neutral/text-content-F4ASMITB.mjs.map +7 -0
- package/dist/lib/neutral/transcriber-ABHATBVH.mjs +59 -0
- package/dist/lib/neutral/transcriber-ABHATBVH.mjs.map +7 -0
- package/dist/lib/neutral/translations.mjs +24 -0
- package/dist/lib/neutral/translations.mjs.map +7 -0
- package/dist/lib/neutral/types/index.mjs +10 -0
- package/dist/lib/neutral/types/index.mjs.map +7 -0
- package/dist/types/src/TranscriptionPlugin.d.ts.map +1 -1
- package/dist/types/src/TranscriptionPlugin.node.d.ts.map +1 -1
- package/dist/types/src/TranscriptionPlugin.workerd.d.ts +4 -0
- package/dist/types/src/TranscriptionPlugin.workerd.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +5 -1
- package/dist/types/src/capabilities/index.d.ts.map +1 -1
- package/dist/types/src/capabilities/text-content.d.ts +8 -0
- package/dist/types/src/capabilities/text-content.d.ts.map +1 -0
- package/dist/types/src/components/Oracle/Oracle.d.ts +24 -0
- package/dist/types/src/components/Oracle/Oracle.d.ts.map +1 -0
- package/dist/types/src/components/Oracle/Oracle.stories.d.ts +32 -0
- package/dist/types/src/components/Oracle/Oracle.stories.d.ts.map +1 -0
- package/dist/types/src/components/Oracle/index.d.ts +2 -0
- package/dist/types/src/components/Oracle/index.d.ts.map +1 -0
- package/dist/types/src/components/Transcription/Transcription.d.ts +0 -5
- package/dist/types/src/components/Transcription/Transcription.d.ts.map +1 -1
- package/dist/types/src/components/Transcription/Transcription.stories.d.ts +13 -16
- package/dist/types/src/components/Transcription/Transcription.stories.d.ts.map +1 -1
- package/dist/types/src/components/index.d.ts +1 -0
- package/dist/types/src/components/index.d.ts.map +1 -1
- package/dist/types/src/containers/TranscriptionArticle/TranscriptionArticle.d.ts +6 -0
- package/dist/types/src/containers/TranscriptionArticle/TranscriptionArticle.d.ts.map +1 -0
- package/dist/types/src/containers/TranscriptionArticle/TranscriptionArticle.stories.d.ts +28 -0
- package/dist/types/src/containers/TranscriptionArticle/TranscriptionArticle.stories.d.ts.map +1 -0
- package/dist/types/src/containers/TranscriptionArticle/index.d.ts +2 -0
- package/dist/types/src/containers/TranscriptionArticle/index.d.ts.map +1 -0
- package/dist/types/src/containers/index.d.ts +1 -1
- package/dist/types/src/containers/index.d.ts.map +1 -1
- package/dist/types/src/enrichment/conversation.test.d.ts +2 -0
- package/dist/types/src/enrichment/conversation.test.d.ts.map +1 -0
- package/dist/types/src/enrichment/operations.d.ts +200 -0
- package/dist/types/src/enrichment/operations.d.ts.map +1 -0
- package/dist/types/src/enrichment/parser.d.ts +26 -0
- package/dist/types/src/enrichment/parser.d.ts.map +1 -0
- package/dist/types/src/enrichment/stream-simulator.d.ts +38 -0
- package/dist/types/src/enrichment/stream-simulator.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +2 -1
- package/dist/types/src/hooks/index.d.ts.map +1 -1
- package/dist/types/src/hooks/useFeedModelAdapter.d.ts +12 -0
- package/dist/types/src/hooks/useFeedModelAdapter.d.ts.map +1 -0
- package/dist/types/src/hooks/useTranscriptionRecording.d.ts +12 -0
- package/dist/types/src/hooks/useTranscriptionRecording.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +3 -4
- package/dist/types/src/index.d.ts.map +1 -1
- package/dist/types/src/normalization/message-normalizer.d.ts +7 -5
- package/dist/types/src/normalization/message-normalizer.d.ts.map +1 -1
- package/dist/types/src/normalization/normalization.d.ts +180 -1
- package/dist/types/src/normalization/normalization.d.ts.map +1 -1
- package/dist/types/src/operations/create.d.ts +2 -2
- package/dist/types/src/operations/create.d.ts.map +1 -1
- package/dist/types/src/operations/index.d.ts +0 -1
- package/dist/types/src/operations/index.d.ts.map +1 -1
- package/dist/types/src/operations/open.d.ts +2 -2
- package/dist/types/src/operations/open.d.ts.map +1 -1
- package/dist/types/src/operations/summarize.d.ts +2 -2
- package/dist/types/src/operations/summarize.d.ts.map +1 -1
- package/dist/types/src/plugin.d.ts +4 -0
- package/dist/types/src/plugin.d.ts.map +1 -0
- package/dist/types/src/stories/FileTranscription.stories.d.ts +5 -3
- package/dist/types/src/stories/FileTranscription.stories.d.ts.map +1 -1
- package/dist/types/src/stories/KeyWordRecognition.stories.d.ts.map +1 -1
- package/dist/types/src/stories/{MicrophoneTranscription.stories.d.ts → LiveTranscription.stories.d.ts} +4 -4
- package/dist/types/src/stories/LiveTranscription.stories.d.ts.map +1 -0
- package/dist/types/src/stories/TranscriptionStory.d.ts +11 -13
- package/dist/types/src/stories/TranscriptionStory.d.ts.map +1 -1
- package/dist/types/src/stories/common.d.ts +46 -0
- package/dist/types/src/stories/common.d.ts.map +1 -0
- package/dist/types/src/testing/testing.d.ts +5 -6
- package/dist/types/src/testing/testing.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 +6 -4
- package/dist/types/src/transcriber/transcription-manager.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +2 -0
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/{operations/definitions.d.ts → types/TranscriptOperation.d.ts} +1 -1
- package/dist/types/src/types/TranscriptOperation.d.ts.map +1 -0
- package/dist/types/src/types/TranscriptionCapabilities.d.ts +17 -0
- package/dist/types/src/types/TranscriptionCapabilities.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +2 -2
- package/dist/types/src/types/index.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +125 -94
- package/src/TranscriptionPlugin.node.ts +3 -31
- package/src/TranscriptionPlugin.test.ts +3 -3
- package/src/TranscriptionPlugin.tsx +3 -31
- package/src/TranscriptionPlugin.workerd.ts +18 -0
- package/src/blueprints/transcription-blueprint.ts +1 -1
- package/src/capabilities/index.ts +1 -0
- package/src/capabilities/react-surface.tsx +2 -2
- package/src/capabilities/text-content.ts +33 -0
- package/src/capabilities/transcriber.ts +1 -1
- package/src/components/Oracle/Oracle.stories.tsx +147 -0
- package/src/components/Oracle/Oracle.tsx +141 -0
- package/src/components/Oracle/index.ts +5 -0
- package/src/components/Transcription/Transcription.stories.tsx +116 -150
- package/src/components/Transcription/Transcription.tsx +7 -13
- package/src/components/index.ts +1 -0
- package/src/containers/TranscriptionArticle/TranscriptionArticle.stories.tsx +61 -0
- package/src/containers/TranscriptionArticle/TranscriptionArticle.tsx +62 -0
- package/src/containers/TranscriptionArticle/index.ts +5 -0
- package/src/containers/index.ts +1 -1
- package/src/enrichment/conversation.test.ts +162 -0
- package/src/enrichment/conversation.txt +23 -0
- package/src/enrichment/operations.ts +268 -0
- package/src/enrichment/parser.ts +101 -0
- package/src/enrichment/stream-simulator.ts +125 -0
- package/src/hooks/index.ts +2 -1
- package/src/hooks/useFeedModelAdapter.ts +46 -0
- package/src/hooks/useTranscriptionRecording.ts +87 -0
- package/src/index.ts +3 -9
- package/src/normalization/message-normalizer.ts +25 -13
- package/src/normalization/normalization.test.ts +3 -37
- package/src/normalization/normalization.ts +6 -7
- package/src/operations/create.ts +2 -2
- package/src/operations/index.ts +0 -2
- package/src/operations/open.ts +2 -2
- package/src/operations/summarize.ts +3 -3
- package/src/plugin.ts +11 -0
- package/src/stories/FileTranscription.stories.tsx +49 -175
- package/src/stories/KeyWordRecognition.stories.tsx +7 -9
- package/src/stories/LiveTranscription.stories.tsx +153 -0
- package/src/stories/TranscriptionStory.tsx +32 -24
- package/src/stories/common.ts +233 -0
- package/src/testing/testing.ts +20 -27
- package/src/transcriber/transcriber.test.ts +9 -9
- package/src/transcriber/transcriber.ts +18 -14
- package/src/transcriber/transcription-manager.ts +14 -9
- package/src/translations.ts +3 -0
- package/src/{operations/definitions.ts → types/TranscriptOperation.ts} +2 -0
- package/src/types/TranscriptionCapabilities.ts +39 -0
- package/src/types/index.ts +2 -2
- package/dist/lib/browser/blueprints/index.mjs.map +0 -7
- package/dist/lib/browser/chunk-3L623EVL.mjs +0 -17
- package/dist/lib/browser/chunk-3L623EVL.mjs.map +0 -7
- package/dist/lib/browser/chunk-L4HW35L6.mjs.map +0 -7
- package/dist/lib/browser/chunk-NQQK7UZQ.mjs.map +0 -7
- package/dist/lib/browser/components/index.mjs.map +0 -7
- package/dist/lib/browser/create-ULR5DPJZ.mjs.map +0 -7
- package/dist/lib/browser/index.mjs.map +0 -7
- package/dist/lib/browser/meta.json +0 -1
- package/dist/lib/browser/open-SFMPLZVW.mjs.map +0 -7
- package/dist/lib/browser/operations/index.mjs +0 -13
- package/dist/lib/browser/operations/index.mjs.map +0 -7
- package/dist/lib/browser/summarize-BDFX4APN.mjs.map +0 -7
- package/dist/lib/browser/types/index.mjs +0 -10
- package/dist/lib/node-esm/blueprints/index.mjs +0 -32
- package/dist/lib/node-esm/blueprints/index.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-7UIZWCD4.mjs +0 -112
- package/dist/lib/node-esm/chunk-7UIZWCD4.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-C3AE2NYJ.mjs +0 -181
- package/dist/lib/node-esm/chunk-C3AE2NYJ.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-HSLMI22Q.mjs +0 -11
- package/dist/lib/node-esm/chunk-KO3IOD2O.mjs +0 -19
- package/dist/lib/node-esm/chunk-KO3IOD2O.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-MQK4R6GT.mjs +0 -245
- package/dist/lib/node-esm/chunk-MQK4R6GT.mjs.map +0 -7
- package/dist/lib/node-esm/chunk-O533NBMK.mjs +0 -37
- package/dist/lib/node-esm/chunk-O533NBMK.mjs.map +0 -7
- package/dist/lib/node-esm/components/index.mjs +0 -208
- package/dist/lib/node-esm/components/index.mjs.map +0 -7
- package/dist/lib/node-esm/create-A5QHNWRF.mjs +0 -22
- package/dist/lib/node-esm/create-A5QHNWRF.mjs.map +0 -7
- package/dist/lib/node-esm/hooks/index.mjs +0 -18
- package/dist/lib/node-esm/index.mjs +0 -474
- package/dist/lib/node-esm/index.mjs.map +0 -7
- package/dist/lib/node-esm/meta.json +0 -1
- package/dist/lib/node-esm/open-OI24QNTO.mjs +0 -28
- package/dist/lib/node-esm/open-OI24QNTO.mjs.map +0 -7
- package/dist/lib/node-esm/operations/index.mjs +0 -14
- package/dist/lib/node-esm/operations/index.mjs.map +0 -7
- package/dist/lib/node-esm/summarize-3UNN24I2.mjs +0 -79
- package/dist/lib/node-esm/summarize-3UNN24I2.mjs.map +0 -7
- package/dist/lib/node-esm/types/index.mjs +0 -11
- package/dist/types/src/containers/TranscriptionContainer/TranscriptionContainer.d.ts +0 -6
- package/dist/types/src/containers/TranscriptionContainer/TranscriptionContainer.d.ts.map +0 -1
- package/dist/types/src/containers/TranscriptionContainer/index.d.ts +0 -2
- package/dist/types/src/containers/TranscriptionContainer/index.d.ts.map +0 -1
- package/dist/types/src/hooks/useQueueModelAdapter.d.ts +0 -8
- package/dist/types/src/hooks/useQueueModelAdapter.d.ts.map +0 -1
- package/dist/types/src/operations/definitions.d.ts.map +0 -1
- package/dist/types/src/stories/MicrophoneTranscription.stories.d.ts.map +0 -1
- package/dist/types/src/stories/useIsSpeaking.d.ts +0 -3
- package/dist/types/src/stories/useIsSpeaking.d.ts.map +0 -1
- package/dist/types/src/types/capabilities.d.ts +0 -19
- package/dist/types/src/types/capabilities.d.ts.map +0 -1
- package/dist/types/src/types/defs.d.ts +0 -5
- package/dist/types/src/types/defs.d.ts.map +0 -1
- package/src/containers/TranscriptionContainer/TranscriptionContainer.tsx +0 -35
- package/src/containers/TranscriptionContainer/index.ts +0 -5
- package/src/hooks/useQueueModelAdapter.ts +0 -66
- package/src/stories/MicrophoneTranscription.stories.tsx +0 -264
- package/src/stories/useIsSpeaking.tsx +0 -40
- package/src/types/capabilities.ts +0 -39
- package/src/types/defs.ts +0 -9
- /package/dist/lib/{browser/hooks → neutral/blueprints}/index.mjs.map +0 -0
- /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs +0 -0
- /package/dist/lib/{browser → neutral}/chunk-J5LGTIGS.mjs.map +0 -0
- /package/dist/lib/{browser → neutral}/chunk-KAEXRX3Y.mjs +0 -0
- /package/dist/lib/{browser → neutral}/chunk-KAEXRX3Y.mjs.map +0 -0
- /package/dist/lib/{browser → neutral}/chunk-MLRJWAQH.mjs +0 -0
- /package/dist/lib/{browser → neutral}/chunk-MLRJWAQH.mjs.map +0 -0
- /package/dist/lib/{browser/types → neutral/hooks}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm/hooks → neutral}/index.mjs.map +0 -0
- /package/dist/lib/{node-esm/chunk-HSLMI22Q.mjs.map → neutral/meta.mjs.map} +0 -0
- /package/dist/lib/{node-esm/types → neutral/operations}/index.mjs.map +0 -0
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
renderByline
|
|
4
|
-
} from "./chunk-O533NBMK.mjs";
|
|
5
|
-
import {
|
|
6
|
-
Open
|
|
7
|
-
} from "./chunk-7UIZWCD4.mjs";
|
|
8
|
-
import "./chunk-HSLMI22Q.mjs";
|
|
9
|
-
|
|
10
|
-
// src/operations/open.ts
|
|
11
|
-
import * as Effect from "effect/Effect";
|
|
12
|
-
import { Operation } from "@dxos/compute";
|
|
13
|
-
import { Database, Feed, Filter } from "@dxos/echo";
|
|
14
|
-
import { Message } from "@dxos/types";
|
|
15
|
-
var handler = Open.pipe(Operation.withHandler(Effect.fn(function* ({ transcript }) {
|
|
16
|
-
const transcriptObj = yield* Database.load(transcript);
|
|
17
|
-
const feed = yield* Database.load(transcriptObj.feed);
|
|
18
|
-
const messages = yield* Feed.runQuery(feed, Filter.type(Message.Message));
|
|
19
|
-
const content = messages.flatMap((message, index) => renderByline([])(message, index)).join("\n\n");
|
|
20
|
-
return {
|
|
21
|
-
content
|
|
22
|
-
};
|
|
23
|
-
})));
|
|
24
|
-
var open_default = handler;
|
|
25
|
-
export {
|
|
26
|
-
open_default as default
|
|
27
|
-
};
|
|
28
|
-
//# sourceMappingURL=open-OI24QNTO.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/operations/open.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport * as Effect from 'effect/Effect';\n\nimport { Operation } from '@dxos/compute';\nimport { Database, Feed, Filter } from '@dxos/echo';\nimport { Message } from '@dxos/types';\n\nimport { renderByline } from '../util';\nimport { Open } from './definitions';\n\nconst handler: Operation.WithHandler<typeof Open> = Open.pipe(\n Operation.withHandler(\n Effect.fn(function* ({ transcript }) {\n const transcriptObj = yield* Database.load(transcript);\n const feed = yield* Database.load(transcriptObj.feed);\n const messages = yield* Feed.runQuery(feed, Filter.type(Message.Message));\n const content = messages\n .flatMap((message: Message.Message, index: number) => renderByline([])(message, index))\n .join('\\n\\n');\n return { content };\n }),\n ),\n);\n\nexport default handler;\n"],
|
|
5
|
-
"mappings": ";;;;;;;;;;AAIA,YAAYA,YAAY;AAExB,SAASC,iBAAiB;AAC1B,SAASC,UAAUC,MAAMC,cAAc;AACvC,SAASC,eAAe;AAKxB,IAAMC,UAA8CC,KAAKC,KACvDC,UAAUC,YACDC,UAAG,WAAW,EAAEC,WAAU,GAAE;AACjC,QAAMC,gBAAgB,OAAOC,SAASC,KAAKH,UAAAA;AAC3C,QAAMI,OAAO,OAAOF,SAASC,KAAKF,cAAcG,IAAI;AACpD,QAAMC,WAAW,OAAOC,KAAKC,SAASH,MAAMI,OAAOC,KAAKC,QAAQA,OAAO,CAAA;AACvE,QAAMC,UAAUN,SACbO,QAAQ,CAACC,SAA0BC,UAAkBC,aAAa,CAAA,CAAE,EAAEF,SAASC,KAAAA,CAAAA,EAC/EE,KAAK,MAAA;AACR,SAAO;IAAEL;EAAQ;AACnB,CAAA,CAAA,CAAA;AAIJ,IAAA,eAAejB;",
|
|
6
|
-
"names": ["Effect", "Operation", "Database", "Feed", "Filter", "Message", "handler", "Open", "pipe", "Operation", "withHandler", "fn", "transcript", "transcriptObj", "Database", "load", "feed", "messages", "Feed", "runQuery", "Filter", "type", "Message", "content", "flatMap", "message", "index", "renderByline", "join"]
|
|
7
|
-
}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
definitions_exports
|
|
4
|
-
} from "../chunk-7UIZWCD4.mjs";
|
|
5
|
-
import "../chunk-HSLMI22Q.mjs";
|
|
6
|
-
|
|
7
|
-
// src/operations/index.ts
|
|
8
|
-
import { OperationHandlerSet } from "@dxos/compute";
|
|
9
|
-
var TranscriptionOperationHandlerSet = OperationHandlerSet.lazy(() => import("../create-A5QHNWRF.mjs"), () => import("../open-OI24QNTO.mjs"), () => import("../summarize-3UNN24I2.mjs"));
|
|
10
|
-
export {
|
|
11
|
-
definitions_exports as TranscriptOperation,
|
|
12
|
-
TranscriptionOperationHandlerSet
|
|
13
|
-
};
|
|
14
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../../src/operations/index.ts"],
|
|
4
|
-
"sourcesContent": ["//\n// Copyright 2025 DXOS.org\n//\n\nimport { OperationHandlerSet } from '@dxos/compute';\n\nexport * as TranscriptOperation from './definitions';\n\nexport const TranscriptionOperationHandlerSet = OperationHandlerSet.lazy(\n () => import('./create'),\n () => import('./open'),\n () => import('./summarize'),\n);\n"],
|
|
5
|
-
"mappings": ";;;;;;;AAIA,SAASA,2BAA2B;AAI7B,IAAMC,mCAAmCD,oBAAoBE,KAClE,MAAM,OAAO,wBAAA,GACb,MAAM,OAAO,sBAAA,GACb,MAAM,OAAO,2BAAA,CAAA;",
|
|
6
|
-
"names": ["OperationHandlerSet", "TranscriptionOperationHandlerSet", "lazy"]
|
|
7
|
-
}
|
|
@@ -1,79 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
Summarize
|
|
4
|
-
} from "./chunk-7UIZWCD4.mjs";
|
|
5
|
-
import "./chunk-HSLMI22Q.mjs";
|
|
6
|
-
|
|
7
|
-
// src/operations/summarize.ts
|
|
8
|
-
import * as Array from "effect/Array";
|
|
9
|
-
import * as Effect from "effect/Effect";
|
|
10
|
-
import * as Function from "effect/Function";
|
|
11
|
-
import * as Layer from "effect/Layer";
|
|
12
|
-
import * as Option from "effect/Option";
|
|
13
|
-
import { AiService, ConsolePrinter, ToolExecutionService, ToolResolverService } from "@dxos/ai";
|
|
14
|
-
import { AiRequest, GenerationObserver } from "@dxos/assistant";
|
|
15
|
-
import { Trace, Operation, OperationRegistry } from "@dxos/compute";
|
|
16
|
-
import { Database } from "@dxos/echo";
|
|
17
|
-
import { trim } from "@dxos/util";
|
|
18
|
-
var handler = Summarize.pipe(Operation.withHandler(Effect.fnUntraced(function* ({ transcript, notes }) {
|
|
19
|
-
const result = yield* new AiRequest({
|
|
20
|
-
observer: GenerationObserver.fromPrinter(new ConsolePrinter({
|
|
21
|
-
tag: "summarize"
|
|
22
|
-
}))
|
|
23
|
-
}).run({
|
|
24
|
-
prompt: `Transcript: ${transcript}
|
|
25
|
-
|
|
26
|
-
Notes: ${notes}`,
|
|
27
|
-
history: [],
|
|
28
|
-
system: systemPrompt
|
|
29
|
-
});
|
|
30
|
-
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")));
|
|
31
|
-
return {
|
|
32
|
-
summary
|
|
33
|
-
};
|
|
34
|
-
}, Effect.provide(Layer.mergeAll(AiService.model("@anthropic/claude-sonnet-4-0"), ToolResolverService.layerEmpty, ToolExecutionService.layerEmpty, Trace.writerLayerNoop, Database.notAvailable, Layer.succeed(Operation.Service, {
|
|
35
|
-
invoke: () => Effect.die("Not available."),
|
|
36
|
-
schedule: () => Effect.die("Not available."),
|
|
37
|
-
invokePromise: async () => ({
|
|
38
|
-
error: new Error("Not available.")
|
|
39
|
-
})
|
|
40
|
-
}), Layer.succeed(OperationRegistry.Service, {
|
|
41
|
-
resolve: () => Effect.succeed(void 0)
|
|
42
|
-
}))))));
|
|
43
|
-
var summarize_default = handler;
|
|
44
|
-
var systemPrompt = trim`
|
|
45
|
-
You are a helpful assistant that summarizes transcripts of meetings.
|
|
46
|
-
|
|
47
|
-
# Goal
|
|
48
|
-
Create a markdown summary of the meeting transcript with text notes provided.
|
|
49
|
-
Notes are very important so make sure to include them in the summary if they contain meaningful information.
|
|
50
|
-
|
|
51
|
-
# Formatting
|
|
52
|
-
- Format the summary as a markdown document without extra comments like "Here is the summary of the transcript:".
|
|
53
|
-
- Use markdown formatting for headings and bullet points.
|
|
54
|
-
- Format the summary as a list of key points and takeaways.
|
|
55
|
-
- All names of people should be in bold.
|
|
56
|
-
|
|
57
|
-
# Note Taking
|
|
58
|
-
- Correlate items in the summary with the person of origin to build a coherent narrative.
|
|
59
|
-
- Include short quotes verbatim where appropriate. Especially when concerned with design decisions and problem descriptions.
|
|
60
|
-
|
|
61
|
-
# Tasks
|
|
62
|
-
At the end of the summary include tasks.
|
|
63
|
-
Extract only the tasks that are:
|
|
64
|
-
- Directly actionable.
|
|
65
|
-
- Clearly assigned to a person or team (or can easily be inferred).
|
|
66
|
-
- Strongly implied by the conversation and/or user note (no speculative tasks).
|
|
67
|
-
- Specific enough that someone reading them would know exactly what to do next.
|
|
68
|
-
|
|
69
|
-
Format all tasks as markdown checkboxes using the syntax:
|
|
70
|
-
- [ ] Task description.
|
|
71
|
-
|
|
72
|
-
Additional information can be included (indented).
|
|
73
|
-
|
|
74
|
-
If no actionable tasks are found, omit this tasks section.
|
|
75
|
-
`;
|
|
76
|
-
export {
|
|
77
|
-
summarize_default as default
|
|
78
|
-
};
|
|
79
|
-
//# sourceMappingURL=summarize-3UNN24I2.mjs.map
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"version": 3,
|
|
3
|
-
"sources": ["../../../src/operations/summarize.ts"],
|
|
4
|
-
"sourcesContent": ["//\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';\n\nimport { AiService, ConsolePrinter, ToolExecutionService, ToolResolverService } from '@dxos/ai';\nimport { AiRequest, GenerationObserver } from '@dxos/assistant';\nimport { Trace, Operation, OperationRegistry } from '@dxos/compute';\nimport { Database } from '@dxos/echo';\nimport { trim } from '@dxos/util';\n\nimport { Summarize } from './definitions';\n\n/**\n * Summarize a transcript of a meeting.\n */\nconst handler: Operation.WithHandler<typeof Summarize> = Summarize.pipe(\n Operation.withHandler(\n Effect.fnUntraced(\n function* ({ transcript, notes }) {\n const result = yield* new AiRequest({\n observer: GenerationObserver.fromPrinter(new ConsolePrinter({ tag: 'summarize' })),\n }).run({\n prompt: `Transcript: ${transcript}\\n\\nNotes: ${notes}`,\n history: [],\n system: systemPrompt,\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 Trace.writerLayerNoop,\n Database.notAvailable,\n Layer.succeed(Operation.Service, {\n invoke: () => Effect.die('Not available.'),\n schedule: () => Effect.die('Not available.'),\n invokePromise: async () => ({ error: new Error('Not available.') }),\n } as any),\n Layer.succeed(OperationRegistry.Service, { resolve: () => Effect.succeed(undefined) } as any),\n ),\n ),\n ),\n ),\n);\n\nexport default handler;\n\nconst systemPrompt = trim`\n You are a helpful assistant that summarizes transcripts of meetings.\n\n # Goal\n Create a markdown summary of the meeting transcript with text notes provided.\n Notes are very important so make sure to include them in the summary if they contain meaningful information.\n\n # Formatting\n - Format the summary as a markdown document without extra comments like \"Here is the summary of the transcript:\".\n - Use markdown formatting for headings and bullet points.\n - Format the summary as a list of key points and takeaways.\n - All names of people should be in bold.\n\n # Note Taking\n - Correlate items in the summary with the person of origin to build a coherent narrative.\n - Include short quotes verbatim where appropriate. Especially when concerned with design decisions and problem descriptions.\n\n # Tasks\n At the end of the summary include tasks.\n Extract only the tasks that are:\n - Directly actionable.\n - Clearly assigned to a person or team (or can easily be inferred).\n - Strongly implied by the conversation and/or user note (no speculative tasks).\n - Specific enough that someone reading them would know exactly what to do next.\n\n Format all tasks as markdown checkboxes using the syntax:\n - [ ] Task description.\n\n Additional information can be included (indented).\n\n If no actionable tasks are found, omit this tasks section.\n`;\n"],
|
|
5
|
-
"mappings": ";;;;;;;AAIA,YAAYA,WAAW;AACvB,YAAYC,YAAY;AACxB,YAAYC,cAAc;AAC1B,YAAYC,WAAW;AACvB,YAAYC,YAAY;AAExB,SAASC,WAAWC,gBAAgBC,sBAAsBC,2BAA2B;AACrF,SAASC,WAAWC,0BAA0B;AAC9C,SAASC,OAAOC,WAAWC,yBAAyB;AACpD,SAASC,gBAAgB;AACzB,SAASC,YAAY;AAOrB,IAAMC,UAAmDC,UAAUC,KACjEC,UAAUC,YACDC,kBACL,WAAW,EAAEC,YAAYC,MAAK,GAAE;AAC9B,QAAMC,SAAS,OAAO,IAAIC,UAAU;IAClCC,UAAUC,mBAAmBC,YAAY,IAAIC,eAAe;MAAEC,KAAK;IAAY,CAAA,CAAA;EACjF,CAAA,EAAGC,IAAI;IACLC,QAAQ,eAAeV,UAAAA;;SAAwBC,KAAAA;IAC/CU,SAAS,CAAA;IACTC,QAAQC;EACV,CAAA;AAEA,QAAMC,UAAmBlB,cACvBM,QACMa,eAAS,CAACC,QAAQA,IAAIC,OAAOC,SAAS,eAAeF,IAAIG,OAAOC,KAAK,CAACC,UAAUA,MAAMC,SAAS,MAAA,CAAA,GAC9FC,eAAQ,CAACP,QACLpB,cACPoB,IAAIG,QACEJ,eAAS,CAACM,UAAUA,MAAMC,SAAS,MAAA,GAClCE,WAAI,CAACH,UAAUA,MAAMI,IAAI,CAAA,CAAA,GAG7BC,sBAAe,MAAM,IAAIC,MAAM,kBAAA,CAAA,CAAA;AAGxC,SAAO;IAAEb;EAAQ;AACnB,GACOc,eACCC,eACJC,UAAUC,MAAM,8BAAA,GAChBC,oBAAoBC,YACpBC,qBAAqBD,YACrBE,MAAMC,iBACNC,SAASC,cACHC,cAAQ1C,UAAU2C,SAAS;EAC/BC,QAAQ,MAAaC,WAAI,gBAAA;EACzBC,UAAU,MAAaD,WAAI,gBAAA;EAC3BE,eAAe,aAAa;IAAEC,OAAO,IAAIlB,MAAM,gBAAA;EAAkB;AACnE,CAAA,GACMY,cAAQO,kBAAkBN,SAAS;EAAEO,SAAS,MAAaR,eAAQS,MAAAA;AAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAO9F,IAAA,oBAAetD;AAEf,IAAMmB,eAAeoC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;",
|
|
6
|
-
"names": ["Array", "Effect", "Function", "Layer", "Option", "AiService", "ConsolePrinter", "ToolExecutionService", "ToolResolverService", "AiRequest", "GenerationObserver", "Trace", "Operation", "OperationRegistry", "Database", "trim", "handler", "Summarize", "pipe", "Operation", "withHandler", "fnUntraced", "transcript", "notes", "result", "AiRequest", "observer", "GenerationObserver", "fromPrinter", "ConsolePrinter", "tag", "run", "prompt", "history", "system", "systemPrompt", "summary", "findLast", "msg", "sender", "role", "blocks", "some", "block", "_tag", "flatMap", "map", "text", "getOrThrowWith", "Error", "provide", "mergeAll", "AiService", "model", "ToolResolverService", "layerEmpty", "ToolExecutionService", "Trace", "writerLayerNoop", "Database", "notAvailable", "succeed", "Service", "invoke", "die", "schedule", "invokePromise", "error", "OperationRegistry", "resolve", "undefined", "trim"]
|
|
7
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
|
|
2
|
-
import {
|
|
3
|
-
TRANSCRIPTION_URL,
|
|
4
|
-
TranscriptionCapabilities
|
|
5
|
-
} from "../chunk-KO3IOD2O.mjs";
|
|
6
|
-
import "../chunk-HSLMI22Q.mjs";
|
|
7
|
-
export {
|
|
8
|
-
TRANSCRIPTION_URL,
|
|
9
|
-
TranscriptionCapabilities
|
|
10
|
-
};
|
|
11
|
-
//# sourceMappingURL=index.mjs.map
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
3
|
-
import { type Transcript } from '@dxos/types';
|
|
4
|
-
export type TranscriptionContainerProps = AppSurface.ObjectArticleProps<Transcript.Transcript>;
|
|
5
|
-
export declare const TranscriptionContainer: ({ role, subject: transcript, attendableId }: TranscriptionContainerProps) => React.JSX.Element;
|
|
6
|
-
//# sourceMappingURL=TranscriptionContainer.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"TranscriptionContainer.d.ts","sourceRoot":"","sources":["../../../../../src/containers/TranscriptionContainer/TranscriptionContainer.tsx"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,OAAO,EAAE,KAAK,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAIvD,OAAO,EAAgB,KAAK,UAAU,EAAE,MAAM,aAAa,CAAC;AAO5D,MAAM,MAAM,2BAA2B,GAAG,UAAU,CAAC,kBAAkB,CAAC,UAAU,CAAC,UAAU,CAAC,CAAC;AAE/F,eAAO,MAAM,sBAAsB,gDAAiD,2BAA2B,sBAe9G,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/containers/TranscriptionContainer/index.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,sBAAsB,IAAI,OAAO,EAAE,MAAM,0BAA0B,CAAC"}
|
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
import type { Obj } from '@dxos/echo';
|
|
2
|
-
import { type Queue } from '@dxos/react-client/echo';
|
|
3
|
-
import { type ChunkRenderer, SerializationModel } from '../model';
|
|
4
|
-
/**
|
|
5
|
-
* Model adapter for a queue.
|
|
6
|
-
*/
|
|
7
|
-
export declare const useQueueModelAdapter: <T extends Obj.Unknown>(renderer: ChunkRenderer<T>, queue: Queue<T> | undefined, initialChunks?: T[]) => SerializationModel<T>;
|
|
8
|
-
//# sourceMappingURL=useQueueModelAdapter.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useQueueModelAdapter.d.ts","sourceRoot":"","sources":["../../../../src/hooks/useQueueModelAdapter.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,YAAY,CAAC;AACtC,OAAO,EAAE,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAErD,OAAO,EAAE,KAAK,aAAa,EAAE,kBAAkB,EAAE,MAAM,UAAU,CAAC;AAElE;;GAEG;AACH,eAAO,MAAM,oBAAoB,GAAI,CAAC,SAAS,GAAG,CAAC,OAAO,YAC9C,aAAa,CAAC,CAAC,CAAC,SACnB,KAAK,CAAC,CAAC,CAAC,GAAG,SAAS,kBACZ,CAAC,EAAE,KACjB,kBAAkB,CAAC,CAAC,CA+CtB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../../../src/operations/definitions.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,MAAM,MAAM,eAAe,CAAC;AAExC,OAAO,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAErC,OAAO,EAAE,SAAS,EAAE,MAAM,eAAe,CAAC;AAC1C,OAAO,EAAE,QAAQ,EAAE,IAAI,EAAO,MAAM,YAAY,CAAC;AAOjD,eAAO,MAAM,MAAM;;;;;;;;;;;;;SASjB,CAAC;AAEH,eAAO,MAAM,kBAAkB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAO9B,CAAC;AAEF,MAAM,MAAM,sBAAsB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,kBAAkB,CAAC,CAAC;AAEnF,eAAO,MAAM,IAAI;;;;;;;;;;;;uCAef,CAAC;AAEH,eAAO,MAAM,SAAS;;;;;uBAoBpB,CAAC;AAEH,eAAO,MAAM,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAIrC,CAAC;AAEH,MAAM,MAAM,8BAA8B,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,0BAA0B,CAAC,CAAC;AAEnG,eAAO,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAItC,CAAC;AAEH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;SAShC,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"MicrophoneTranscription.stories.d.ts","sourceRoot":"","sources":["../../../../src/stories/MicrophoneTranscription.stories.tsx"],"names":[],"mappings":"AAIA,OAAO,EAAa,KAAK,QAAQ,EAAE,MAAM,uBAAuB,CAAC;AAEjE,OAAO,KAAoD,MAAM,OAAO,CAAC;AA6BzE,OAAO,EAAE,KAAK,wBAAwB,EAAE,KAAK,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAetF,KAAK,iBAAiB,GAAG;IACvB,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,iBAAiB,EAAE,gBAAgB,CAAC,QAAQ,CAAC,CAAC;IAC9C,cAAc,EAAE,wBAAwB,CAAC,QAAQ,CAAC,CAAC;IACnD,gBAAgB,CAAC,EAAE,qBAAqB,CAAC;IACzC,gBAAgB,EAAE,MAAM,GAAG,KAAK,GAAG,KAAK,CAAC;CAC1C,CAAC;AAwHF,QAAA,MAAM,IAAI;;yGAhHP,iBAAiB;;CAuJiB,CAAC;eAEvB,IAAI;AAEnB,KAAK,KAAK,GAAG,QAAQ,CAAC,OAAO,IAAI,CAAC,CAAC;AAEnC,eAAO,MAAM,OAAO,EAAE,KAYrB,CAAC;AAkBF,eAAO,MAAM,eAAe,EAAE,KAY7B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"useIsSpeaking.d.ts","sourceRoot":"","sources":["../../../../src/stories/useIsSpeaking.tsx"],"names":[],"mappings":"AAIA,OAAO,aAAa,CAAC;AAQrB,eAAO,MAAM,aAAa,WAAY,gBAAgB,YA2BrD,CAAC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { Capability } from '@dxos/app-framework';
|
|
2
|
-
import { type MediaStreamRecorderProps, type Transcriber, type TranscriberProps, type TranscriptMessageEnricher, type TranscriptionManager } from '../transcriber';
|
|
3
|
-
export declare namespace TranscriptionCapabilities {
|
|
4
|
-
type GetTranscriberProps = {
|
|
5
|
-
audioStreamTrack: MediaStreamTrack;
|
|
6
|
-
recorderConfig?: Partial<MediaStreamRecorderProps['config']>;
|
|
7
|
-
transcriberConfig?: Partial<TranscriberProps['config']>;
|
|
8
|
-
onSegments: TranscriberProps['onSegments'];
|
|
9
|
-
transcribe?: TranscriberProps['transcribe'];
|
|
10
|
-
};
|
|
11
|
-
type GetTranscriber = (props: GetTranscriberProps) => Transcriber;
|
|
12
|
-
type GetTranscriptionManagerProps = {
|
|
13
|
-
messageEnricher?: TranscriptMessageEnricher;
|
|
14
|
-
};
|
|
15
|
-
type GetTranscriptionManager = (props: GetTranscriptionManagerProps) => TranscriptionManager;
|
|
16
|
-
const Transcriber: Capability.InterfaceDef<GetTranscriber>;
|
|
17
|
-
const TranscriptionManager: Capability.InterfaceDef<GetTranscriptionManager>;
|
|
18
|
-
}
|
|
19
|
-
//# sourceMappingURL=capabilities.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"capabilities.d.ts","sourceRoot":"","sources":["../../../../src/types/capabilities.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,UAAU,EAAE,MAAM,qBAAqB,CAAC;AAIjD,OAAO,EACL,KAAK,wBAAwB,EAC7B,KAAK,WAAW,EAChB,KAAK,gBAAgB,EACrB,KAAK,yBAAyB,EAC9B,KAAK,oBAAoB,EAC1B,MAAM,gBAAgB,CAAC;AAExB,yBAAiB,yBAAyB,CAAC,CAAC;IAC1C,KAAY,mBAAmB,GAAG;QAChC,gBAAgB,EAAE,gBAAgB,CAAC;QACnC,cAAc,CAAC,EAAE,OAAO,CAAC,wBAAwB,CAAC,QAAQ,CAAC,CAAC,CAAC;QAC7D,iBAAiB,CAAC,EAAE,OAAO,CAAC,gBAAgB,CAAC,QAAQ,CAAC,CAAC,CAAC;QACxD,UAAU,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;QAC3C,UAAU,CAAC,EAAE,gBAAgB,CAAC,YAAY,CAAC,CAAC;KAC7C,CAAC;IAEF,KAAY,cAAc,GAAG,CAAC,KAAK,EAAE,mBAAmB,KAAK,WAAW,CAAC;IAEzE,KAAY,4BAA4B,GAAG;QACzC,eAAe,CAAC,EAAE,yBAAyB,CAAC;KAC7C,CAAC;IAEF,KAAY,uBAAuB,GAAG,CAAC,KAAK,EAAE,4BAA4B,KAAK,oBAAoB,CAAC;IAE7F,MAAM,WAAW,yCAAuE,CAAC;IAEzF,MAAM,oBAAoB,kDAEhC,CAAC;CACH"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"defs.d.ts","sourceRoot":"","sources":["../../../../src/types/defs.ts"],"names":[],"mappings":"AAIA;;GAEG;AAEH,eAAO,MAAM,iBAAiB,2CAA2C,CAAC"}
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2024 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import React from 'react';
|
|
6
|
-
|
|
7
|
-
import { type AppSurface } from '@dxos/app-toolkit/ui';
|
|
8
|
-
import { Feed, Obj } from '@dxos/echo';
|
|
9
|
-
import { useMembers, useQueue } from '@dxos/react-client/echo';
|
|
10
|
-
import { Panel } from '@dxos/react-ui';
|
|
11
|
-
import { type Message, type Transcript } from '@dxos/types';
|
|
12
|
-
|
|
13
|
-
import { Transcription } from '#components';
|
|
14
|
-
import { useQueueModelAdapter } from '#hooks';
|
|
15
|
-
|
|
16
|
-
import { renderByline } from '../../util';
|
|
17
|
-
|
|
18
|
-
export type TranscriptionContainerProps = AppSurface.ObjectArticleProps<Transcript.Transcript>;
|
|
19
|
-
|
|
20
|
-
export const TranscriptionContainer = ({ role, subject: transcript, attendableId }: TranscriptionContainerProps) => {
|
|
21
|
-
const db = Obj.getDatabase(transcript);
|
|
22
|
-
const members = useMembers(db?.spaceId).map((member) => member.identity);
|
|
23
|
-
const feed = transcript.feed.target;
|
|
24
|
-
const queueDxn = feed ? Feed.getQueueDxn(feed) : undefined;
|
|
25
|
-
const queue = useQueue<Message.Message>(queueDxn, { pollInterval: 1_000 });
|
|
26
|
-
const model = useQueueModelAdapter(renderByline(members), queue);
|
|
27
|
-
|
|
28
|
-
return (
|
|
29
|
-
<Panel.Root role={role}>
|
|
30
|
-
<Panel.Content asChild>
|
|
31
|
-
<Transcription attendableId={attendableId} model={model} transcript={transcript} />
|
|
32
|
-
</Panel.Content>
|
|
33
|
-
</Panel.Root>
|
|
34
|
-
);
|
|
35
|
-
};
|
|
@@ -1,66 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { useEffect, useMemo, useState } from 'react';
|
|
6
|
-
|
|
7
|
-
import type { Obj } from '@dxos/echo';
|
|
8
|
-
import { type Queue } from '@dxos/react-client/echo';
|
|
9
|
-
|
|
10
|
-
import { type ChunkRenderer, SerializationModel } from '../model';
|
|
11
|
-
|
|
12
|
-
/**
|
|
13
|
-
* Model adapter for a queue.
|
|
14
|
-
*/
|
|
15
|
-
export const useQueueModelAdapter = <T extends Obj.Unknown>(
|
|
16
|
-
renderer: ChunkRenderer<T>,
|
|
17
|
-
queue: Queue<T> | undefined,
|
|
18
|
-
initialChunks: T[] = [],
|
|
19
|
-
): SerializationModel<T> => {
|
|
20
|
-
const model = useMemo(() => new SerializationModel<T>(renderer, initialChunks), [queue]);
|
|
21
|
-
const [loaded, setLoaded] = useState(false);
|
|
22
|
-
|
|
23
|
-
// Set initial blocks.
|
|
24
|
-
useEffect(() => {
|
|
25
|
-
if (!queue) {
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
const update = () => {
|
|
30
|
-
for (const block of queue?.objects ?? []) {
|
|
31
|
-
model.appendChunk(block);
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
setLoaded(true);
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
// TODO(burdon): This is a hack to ensure the queue is loaded.
|
|
38
|
-
let i: NodeJS.Timeout | undefined;
|
|
39
|
-
if (queue.isLoading) {
|
|
40
|
-
i = setInterval(() => {
|
|
41
|
-
if (!queue?.isLoading) {
|
|
42
|
-
clearInterval(i);
|
|
43
|
-
update();
|
|
44
|
-
}
|
|
45
|
-
}, 1_000);
|
|
46
|
-
} else {
|
|
47
|
-
update();
|
|
48
|
-
}
|
|
49
|
-
|
|
50
|
-
return () => clearTimeout(i);
|
|
51
|
-
}, [model, queue]);
|
|
52
|
-
|
|
53
|
-
// TODO(burdon): Can we listen for queue events?
|
|
54
|
-
useEffect(() => {
|
|
55
|
-
if (!loaded || !queue || model.chunks.length === queue.objects.length) {
|
|
56
|
-
return;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
const chunk = queue.objects.at(-1);
|
|
60
|
-
if (chunk) {
|
|
61
|
-
model.appendChunk(chunk);
|
|
62
|
-
}
|
|
63
|
-
}, [model, loaded, queue?.objects.length]);
|
|
64
|
-
|
|
65
|
-
return model;
|
|
66
|
-
};
|
|
@@ -1,264 +0,0 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Copyright 2025 DXOS.org
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
import { type Meta, type StoryObj } from '@storybook/react-vite';
|
|
6
|
-
import * as Effect from 'effect/Effect';
|
|
7
|
-
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
8
|
-
|
|
9
|
-
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
10
|
-
import { AppActivationEvents } from '@dxos/app-toolkit';
|
|
11
|
-
import {
|
|
12
|
-
type ExtractionFunction,
|
|
13
|
-
extractionAnthropicFunction,
|
|
14
|
-
extractionNerFunction,
|
|
15
|
-
getNer,
|
|
16
|
-
processTranscriptMessage,
|
|
17
|
-
} from '@dxos/assistant/extraction';
|
|
18
|
-
import { Filter, type Obj } from '@dxos/echo';
|
|
19
|
-
import { MemoryQueue } from '@dxos/echo-db';
|
|
20
|
-
import { createQueueDXN } from '@dxos/echo/internal';
|
|
21
|
-
import { invariant } from '@dxos/invariant';
|
|
22
|
-
import { log } from '@dxos/log';
|
|
23
|
-
import { ClientPlugin } from '@dxos/plugin-client';
|
|
24
|
-
import { initializeIdentity } from '@dxos/plugin-client/testing';
|
|
25
|
-
import { PreviewPlugin } from '@dxos/plugin-preview';
|
|
26
|
-
import { StorybookPlugin, corePlugins } from '@dxos/plugin-testing';
|
|
27
|
-
import { IndexKind, useSpaces } from '@dxos/react-client/echo';
|
|
28
|
-
import { withLayout } from '@dxos/react-ui/testing';
|
|
29
|
-
import { TestSchema } from '@dxos/schema/testing';
|
|
30
|
-
import { Message, Organization, Person } from '@dxos/types';
|
|
31
|
-
import { seedTestData } from '@dxos/types/testing';
|
|
32
|
-
|
|
33
|
-
import { useAudioTrack, useQueueModelAdapter, useTranscriber } from '#hooks';
|
|
34
|
-
import { TestItem } from '#testing';
|
|
35
|
-
|
|
36
|
-
import { type MediaStreamRecorderProps, type TranscriberProps } from '../transcriber';
|
|
37
|
-
import { TranscriptionPlugin } from '../TranscriptionPlugin';
|
|
38
|
-
import { renderByline } from '../util';
|
|
39
|
-
import { TranscriptionStory } from './TranscriptionStory';
|
|
40
|
-
import { useIsSpeaking } from './useIsSpeaking';
|
|
41
|
-
|
|
42
|
-
const TRANSCRIBER_CONFIG = {
|
|
43
|
-
transcribeAfterChunksAmount: 50,
|
|
44
|
-
prefixBufferChunksAmount: 10,
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
const RECORDER_CONFIG = {
|
|
48
|
-
interval: 200,
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
type DefaultStoryProps = {
|
|
52
|
-
detectSpeaking?: boolean;
|
|
53
|
-
transcriberConfig: TranscriberProps['config'];
|
|
54
|
-
recorderConfig: MediaStreamRecorderProps['config'];
|
|
55
|
-
audioConstraints?: MediaTrackConstraints;
|
|
56
|
-
entityExtraction: 'none' | 'ner' | 'llm';
|
|
57
|
-
};
|
|
58
|
-
|
|
59
|
-
const DefaultStory = ({
|
|
60
|
-
detectSpeaking,
|
|
61
|
-
entityExtraction = 'none',
|
|
62
|
-
transcriberConfig,
|
|
63
|
-
recorderConfig,
|
|
64
|
-
audioConstraints,
|
|
65
|
-
}: DefaultStoryProps) => {
|
|
66
|
-
const [running, setRunning] = useState(false);
|
|
67
|
-
|
|
68
|
-
// Audio.
|
|
69
|
-
const track = useAudioTrack(running, audioConstraints);
|
|
70
|
-
|
|
71
|
-
// Speaking.
|
|
72
|
-
const isSpeaking = detectSpeaking ? useIsSpeaking(track) : true;
|
|
73
|
-
|
|
74
|
-
// Queue.
|
|
75
|
-
// TODO(dmaretskyi): Use space.queues.create() instead.
|
|
76
|
-
const queueDxn = useMemo(() => createQueueDXN(), []);
|
|
77
|
-
const queue = useMemo(() => new MemoryQueue<Message.Message>(queueDxn), [queueDxn]);
|
|
78
|
-
const model = useQueueModelAdapter(renderByline([]), queue);
|
|
79
|
-
const [space] = useSpaces();
|
|
80
|
-
|
|
81
|
-
useEffect(() => {
|
|
82
|
-
if (!space) {
|
|
83
|
-
log.warn('no space');
|
|
84
|
-
}
|
|
85
|
-
}, [space]);
|
|
86
|
-
|
|
87
|
-
// Entity extraction.
|
|
88
|
-
const { extractionFunction, objects } = useMemo(() => {
|
|
89
|
-
if (!space) {
|
|
90
|
-
log.warn('no space');
|
|
91
|
-
return {};
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
let extractionFunction: ExtractionFunction | undefined;
|
|
95
|
-
let objects: Promise<Obj.Unknown[]> | undefined;
|
|
96
|
-
|
|
97
|
-
if (entityExtraction === 'ner') {
|
|
98
|
-
// Init model loading. Takes time.
|
|
99
|
-
void getNer();
|
|
100
|
-
extractionFunction = extractionNerFunction;
|
|
101
|
-
} else if (entityExtraction === 'llm') {
|
|
102
|
-
extractionFunction = extractionAnthropicFunction;
|
|
103
|
-
objects = space.db
|
|
104
|
-
.query(
|
|
105
|
-
Filter.or(
|
|
106
|
-
Filter.type(Person.Person),
|
|
107
|
-
Filter.type(Organization.Organization),
|
|
108
|
-
Filter.type(TestSchema.DocumentType),
|
|
109
|
-
),
|
|
110
|
-
)
|
|
111
|
-
.run();
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
return { extractionFunction, objects };
|
|
115
|
-
}, [entityExtraction, space]);
|
|
116
|
-
|
|
117
|
-
// Transcriber.
|
|
118
|
-
const handleSegments = useCallback<TranscriberProps['onSegments']>(
|
|
119
|
-
async (blocks) => {
|
|
120
|
-
const message = Message.make({
|
|
121
|
-
sender: { name: 'You' },
|
|
122
|
-
created: new Date().toISOString(),
|
|
123
|
-
blocks,
|
|
124
|
-
});
|
|
125
|
-
if (!space) {
|
|
126
|
-
void queue.append([message]);
|
|
127
|
-
return;
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
if (entityExtraction !== 'none') {
|
|
131
|
-
invariant(extractionFunction, 'extractionFunction is required');
|
|
132
|
-
const result = await processTranscriptMessage({
|
|
133
|
-
function: extractionFunction,
|
|
134
|
-
input: {
|
|
135
|
-
message,
|
|
136
|
-
objects: await objects,
|
|
137
|
-
},
|
|
138
|
-
options: {
|
|
139
|
-
fallbackToRaw: true,
|
|
140
|
-
timeout: 30_000,
|
|
141
|
-
},
|
|
142
|
-
});
|
|
143
|
-
void queue.append([result.message]);
|
|
144
|
-
} else {
|
|
145
|
-
void queue.append([message]);
|
|
146
|
-
}
|
|
147
|
-
},
|
|
148
|
-
[queue, space],
|
|
149
|
-
);
|
|
150
|
-
|
|
151
|
-
const transcriber = useTranscriber({
|
|
152
|
-
audioStreamTrack: track,
|
|
153
|
-
onSegments: handleSegments,
|
|
154
|
-
transcriberConfig,
|
|
155
|
-
recorderConfig,
|
|
156
|
-
});
|
|
157
|
-
const [isOpen, setIsOpen] = useState(false);
|
|
158
|
-
useEffect(() => {
|
|
159
|
-
void transcriber?.open().then(() => setIsOpen(true));
|
|
160
|
-
return () => {
|
|
161
|
-
void transcriber?.close().then(() => setIsOpen(false));
|
|
162
|
-
};
|
|
163
|
-
}, [transcriber]);
|
|
164
|
-
|
|
165
|
-
// Manage transcription state.
|
|
166
|
-
useEffect(() => {
|
|
167
|
-
if (running && transcriber?.isOpen && isSpeaking) {
|
|
168
|
-
transcriber?.startChunksRecording();
|
|
169
|
-
} else if (!running || !isSpeaking) {
|
|
170
|
-
transcriber?.stopChunksRecording();
|
|
171
|
-
}
|
|
172
|
-
}, [transcriber, running, isOpen, isSpeaking]);
|
|
173
|
-
|
|
174
|
-
return <TranscriptionStory model={model} running={running} onRunningChange={setRunning} />;
|
|
175
|
-
};
|
|
176
|
-
|
|
177
|
-
const meta = {
|
|
178
|
-
title: 'plugins/plugin-transcription/components/MicrophoneTranscription',
|
|
179
|
-
render: DefaultStory,
|
|
180
|
-
decorators: [
|
|
181
|
-
withLayout({ layout: 'column' }),
|
|
182
|
-
withPluginManager({
|
|
183
|
-
plugins: [
|
|
184
|
-
...corePlugins(),
|
|
185
|
-
StorybookPlugin({}),
|
|
186
|
-
ClientPlugin({
|
|
187
|
-
types: [TestItem, Person.Person, Organization.Organization, TestSchema.DocumentType],
|
|
188
|
-
onClientInitialized: ({ client }) =>
|
|
189
|
-
Effect.gen(function* () {
|
|
190
|
-
const { personalSpace } = yield* initializeIdentity(client);
|
|
191
|
-
// TODO(mykola): Make API easier to use.
|
|
192
|
-
// TODO(mykola): Delete after enabling vector indexing by default.
|
|
193
|
-
// Enable vector indexing.
|
|
194
|
-
yield* Effect.promise(() =>
|
|
195
|
-
client.services.services.QueryService!.setConfig({
|
|
196
|
-
enabled: true,
|
|
197
|
-
indexes: [
|
|
198
|
-
//
|
|
199
|
-
{ kind: IndexKind.Kind.SCHEMA_MATCH },
|
|
200
|
-
{ kind: IndexKind.Kind.GRAPH },
|
|
201
|
-
{ kind: IndexKind.Kind.VECTOR },
|
|
202
|
-
],
|
|
203
|
-
}),
|
|
204
|
-
);
|
|
205
|
-
yield* Effect.promise(() => client.services.services.QueryService!.reindex());
|
|
206
|
-
yield* Effect.promise(() => seedTestData(personalSpace));
|
|
207
|
-
}),
|
|
208
|
-
}),
|
|
209
|
-
|
|
210
|
-
PreviewPlugin(),
|
|
211
|
-
TranscriptionPlugin(),
|
|
212
|
-
],
|
|
213
|
-
fireEvents: [AppActivationEvents.SetupAppGraph],
|
|
214
|
-
}),
|
|
215
|
-
],
|
|
216
|
-
} satisfies Meta<typeof DefaultStory>;
|
|
217
|
-
|
|
218
|
-
export default meta;
|
|
219
|
-
|
|
220
|
-
type Story = StoryObj<typeof meta>;
|
|
221
|
-
|
|
222
|
-
export const Default: Story = {
|
|
223
|
-
args: {
|
|
224
|
-
detectSpeaking: false,
|
|
225
|
-
entityExtraction: 'none',
|
|
226
|
-
transcriberConfig: TRANSCRIBER_CONFIG,
|
|
227
|
-
recorderConfig: RECORDER_CONFIG,
|
|
228
|
-
audioConstraints: {
|
|
229
|
-
echoCancellation: false,
|
|
230
|
-
noiseSuppression: false,
|
|
231
|
-
autoGainControl: false,
|
|
232
|
-
},
|
|
233
|
-
},
|
|
234
|
-
};
|
|
235
|
-
|
|
236
|
-
// NOTE: We are running out of free quota on hugging face entity extraction.
|
|
237
|
-
// TODO(mykola): Fix hugging face quota issues.
|
|
238
|
-
// export const EntityExtraction: Story = {
|
|
239
|
-
// args: {
|
|
240
|
-
// detectSpeaking: true,
|
|
241
|
-
// entityExtraction: 'ner',
|
|
242
|
-
// transcriberConfig: TRANSCRIBER_CONFIG,
|
|
243
|
-
// recorderConfig: RECORDER_CONFIG,
|
|
244
|
-
// audioConstraints: {
|
|
245
|
-
// echoCancellation: true,
|
|
246
|
-
// noiseSuppression: true,
|
|
247
|
-
// autoGainControl: true,
|
|
248
|
-
// },
|
|
249
|
-
// },
|
|
250
|
-
// };
|
|
251
|
-
|
|
252
|
-
export const SpeechDetection: Story = {
|
|
253
|
-
args: {
|
|
254
|
-
detectSpeaking: true,
|
|
255
|
-
entityExtraction: 'none',
|
|
256
|
-
transcriberConfig: TRANSCRIBER_CONFIG,
|
|
257
|
-
recorderConfig: RECORDER_CONFIG,
|
|
258
|
-
audioConstraints: {
|
|
259
|
-
echoCancellation: true,
|
|
260
|
-
noiseSuppression: true,
|
|
261
|
-
autoGainControl: true,
|
|
262
|
-
},
|
|
263
|
-
},
|
|
264
|
-
};
|