@dxos/plugin-transcription 0.7.5-main.5ae2ba8
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 +8 -0
- package/README.md +15 -0
- package/dist/lib/browser/TranscriptContainer-SX6PNFEC.mjs +10 -0
- package/dist/lib/browser/TranscriptContainer-SX6PNFEC.mjs.map +7 -0
- package/dist/lib/browser/app-graph-builder-ZSSJIFY7.mjs +7 -0
- package/dist/lib/browser/app-graph-builder-ZSSJIFY7.mjs.map +7 -0
- package/dist/lib/browser/chunk-AS364WZZ.mjs +8 -0
- package/dist/lib/browser/chunk-AS364WZZ.mjs.map +7 -0
- package/dist/lib/browser/chunk-QIHUPVQD.mjs +80 -0
- package/dist/lib/browser/chunk-QIHUPVQD.mjs.map +7 -0
- package/dist/lib/browser/chunk-R4HHS6FA.mjs +241 -0
- package/dist/lib/browser/chunk-R4HHS6FA.mjs.map +7 -0
- package/dist/lib/browser/chunk-ZMES3U2D.mjs +78 -0
- package/dist/lib/browser/chunk-ZMES3U2D.mjs.map +7 -0
- package/dist/lib/browser/index.mjs +652 -0
- package/dist/lib/browser/index.mjs.map +7 -0
- package/dist/lib/browser/intent-resolver-EAR2TFK2.mjs +32 -0
- package/dist/lib/browser/intent-resolver-EAR2TFK2.mjs.map +7 -0
- package/dist/lib/browser/meta.json +1 -0
- package/dist/lib/browser/react-surface-FOEWLLTZ.mjs +26 -0
- package/dist/lib/browser/react-surface-FOEWLLTZ.mjs.map +7 -0
- package/dist/lib/browser/types/index.mjs +17 -0
- package/dist/lib/browser/types/index.mjs.map +7 -0
- package/dist/lib/node/TranscriptContainer-HU763SN3.cjs +31 -0
- package/dist/lib/node/TranscriptContainer-HU763SN3.cjs.map +7 -0
- package/dist/lib/node/app-graph-builder-YFBX3OTP.cjs +26 -0
- package/dist/lib/node/app-graph-builder-YFBX3OTP.cjs.map +7 -0
- package/dist/lib/node/chunk-JBN3P6ZF.cjs +97 -0
- package/dist/lib/node/chunk-JBN3P6ZF.cjs.map +7 -0
- package/dist/lib/node/chunk-QWXLQPP5.cjs +40 -0
- package/dist/lib/node/chunk-QWXLQPP5.cjs.map +7 -0
- package/dist/lib/node/chunk-UIHEGU6Q.cjs +103 -0
- package/dist/lib/node/chunk-UIHEGU6Q.cjs.map +7 -0
- package/dist/lib/node/chunk-YV74Z74I.cjs +267 -0
- package/dist/lib/node/chunk-YV74Z74I.cjs.map +7 -0
- package/dist/lib/node/index.cjs +661 -0
- package/dist/lib/node/index.cjs.map +7 -0
- package/dist/lib/node/intent-resolver-3KJZGGUQ.cjs +44 -0
- package/dist/lib/node/intent-resolver-3KJZGGUQ.cjs.map +7 -0
- package/dist/lib/node/meta.json +1 -0
- package/dist/lib/node/react-surface-AGGGDOUC.cjs +49 -0
- package/dist/lib/node/react-surface-AGGGDOUC.cjs.map +7 -0
- package/dist/lib/node/types/index.cjs +39 -0
- package/dist/lib/node/types/index.cjs.map +7 -0
- package/dist/lib/node-esm/TranscriptContainer-DVBXQIQ4.mjs +11 -0
- package/dist/lib/node-esm/TranscriptContainer-DVBXQIQ4.mjs.map +7 -0
- package/dist/lib/node-esm/app-graph-builder-77GQG6UF.mjs +9 -0
- package/dist/lib/node-esm/app-graph-builder-77GQG6UF.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-36EQXBWR.mjs +242 -0
- package/dist/lib/node-esm/chunk-36EQXBWR.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-KEG3ME4O.mjs +82 -0
- package/dist/lib/node-esm/chunk-KEG3ME4O.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-WEZGRUG6.mjs +10 -0
- package/dist/lib/node-esm/chunk-WEZGRUG6.mjs.map +7 -0
- package/dist/lib/node-esm/chunk-XYU6B73V.mjs +80 -0
- package/dist/lib/node-esm/chunk-XYU6B73V.mjs.map +7 -0
- package/dist/lib/node-esm/index.mjs +653 -0
- package/dist/lib/node-esm/index.mjs.map +7 -0
- package/dist/lib/node-esm/intent-resolver-UGLYRD4X.mjs +33 -0
- package/dist/lib/node-esm/intent-resolver-UGLYRD4X.mjs.map +7 -0
- package/dist/lib/node-esm/meta.json +1 -0
- package/dist/lib/node-esm/react-surface-6AYPLJ2B.mjs +27 -0
- package/dist/lib/node-esm/react-surface-6AYPLJ2B.mjs.map +7 -0
- package/dist/lib/node-esm/types/index.mjs +18 -0
- package/dist/lib/node-esm/types/index.mjs.map +7 -0
- package/dist/types/src/TranscriptionPlugin.d.ts +2 -0
- package/dist/types/src/TranscriptionPlugin.d.ts.map +1 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts +180 -0
- package/dist/types/src/capabilities/app-graph-builder.d.ts.map +1 -0
- package/dist/types/src/capabilities/capabilities.d.ts +4 -0
- package/dist/types/src/capabilities/capabilities.d.ts.map +1 -0
- package/dist/types/src/capabilities/index.d.ts +181 -0
- package/dist/types/src/capabilities/index.d.ts.map +1 -0
- package/dist/types/src/capabilities/intent-resolver.d.ts +4 -0
- package/dist/types/src/capabilities/intent-resolver.d.ts.map +1 -0
- package/dist/types/src/capabilities/react-surface.d.ts +4 -0
- package/dist/types/src/capabilities/react-surface.d.ts.map +1 -0
- package/dist/types/src/components/Transcript/Transcript.d.ts +7 -0
- package/dist/types/src/components/Transcript/Transcript.d.ts.map +1 -0
- package/dist/types/src/components/Transcript/Transcript.stories.d.ts +9 -0
- package/dist/types/src/components/Transcript/Transcript.stories.d.ts.map +1 -0
- package/dist/types/src/components/Transcript/index.d.ts +2 -0
- package/dist/types/src/components/Transcript/index.d.ts.map +1 -0
- package/dist/types/src/components/TranscriptContainer.d.ts +7 -0
- package/dist/types/src/components/TranscriptContainer.d.ts.map +1 -0
- package/dist/types/src/components/index.d.ts +6 -0
- package/dist/types/src/components/index.d.ts.map +1 -0
- package/dist/types/src/components/transcription.stories.d.ts +14 -0
- package/dist/types/src/components/transcription.stories.d.ts.map +1 -0
- package/dist/types/src/hooks/index.d.ts +6 -0
- package/dist/types/src/hooks/index.d.ts.map +1 -0
- package/dist/types/src/hooks/useAudioFile.d.ts +7 -0
- package/dist/types/src/hooks/useAudioFile.d.ts.map +1 -0
- package/dist/types/src/hooks/useAudioTrack.d.ts +5 -0
- package/dist/types/src/hooks/useAudioTrack.d.ts.map +1 -0
- package/dist/types/src/hooks/useIsSpeaking.d.ts +2 -0
- package/dist/types/src/hooks/useIsSpeaking.d.ts.map +1 -0
- package/dist/types/src/hooks/useTranscriber.d.ts +10 -0
- package/dist/types/src/hooks/useTranscriber.d.ts.map +1 -0
- package/dist/types/src/hooks/useVoiceInput.d.ts +11 -0
- package/dist/types/src/hooks/useVoiceInput.d.ts.map +1 -0
- package/dist/types/src/index.d.ts +7 -0
- package/dist/types/src/index.d.ts.map +1 -0
- package/dist/types/src/meta.d.ts +11 -0
- package/dist/types/src/meta.d.ts.map +1 -0
- package/dist/types/src/sanity.test.d.ts +2 -0
- package/dist/types/src/sanity.test.d.ts.map +1 -0
- package/dist/types/src/transcriber/audio-recorder.d.ts +47 -0
- package/dist/types/src/transcriber/audio-recorder.d.ts.map +1 -0
- package/dist/types/src/transcriber/index.d.ts +4 -0
- package/dist/types/src/transcriber/index.d.ts.map +1 -0
- package/dist/types/src/transcriber/media-stream-recorder.d.ts +26 -0
- package/dist/types/src/transcriber/media-stream-recorder.d.ts.map +1 -0
- package/dist/types/src/transcriber/transcriber.d.ts +46 -0
- package/dist/types/src/transcriber/transcriber.d.ts.map +1 -0
- package/dist/types/src/transcriber/transcriber.test.d.ts +2 -0
- package/dist/types/src/transcriber/transcriber.test.d.ts.map +1 -0
- package/dist/types/src/translations.d.ts +40 -0
- package/dist/types/src/translations.d.ts.map +1 -0
- package/dist/types/src/types/index.d.ts +3 -0
- package/dist/types/src/types/index.d.ts.map +1 -0
- package/dist/types/src/types/schema.d.ts +63 -0
- package/dist/types/src/types/schema.d.ts.map +1 -0
- package/dist/types/src/types/types.d.ts +28 -0
- package/dist/types/src/types/types.d.ts.map +1 -0
- package/dist/types/src/util/array.d.ts +2 -0
- package/dist/types/src/util/array.d.ts.map +1 -0
- package/dist/types/src/util/get-time-str.d.ts +2 -0
- package/dist/types/src/util/get-time-str.d.ts.map +1 -0
- package/dist/types/src/util/index.d.ts +5 -0
- package/dist/types/src/util/index.d.ts.map +1 -0
- package/dist/types/src/util/monitor-audio-level.d.ts +6 -0
- package/dist/types/src/util/monitor-audio-level.d.ts.map +1 -0
- package/dist/types/src/util/random-queue-dxn.d.ts +3 -0
- package/dist/types/src/util/random-queue-dxn.d.ts.map +1 -0
- package/dist/types/tsconfig.tsbuildinfo +1 -0
- package/package.json +93 -0
- package/src/TranscriptionPlugin.tsx +57 -0
- package/src/capabilities/app-graph-builder.ts +7 -0
- package/src/capabilities/capabilities.ts +12 -0
- package/src/capabilities/index.ts +11 -0
- package/src/capabilities/intent-resolver.ts +24 -0
- package/src/capabilities/react-surface.tsx +21 -0
- package/src/components/Transcript/Transcript.stories.tsx +65 -0
- package/src/components/Transcript/Transcript.tsx +69 -0
- package/src/components/Transcript/index.ts +5 -0
- package/src/components/TranscriptContainer.tsx +167 -0
- package/src/components/index.ts +10 -0
- package/src/components/transcription.stories.tsx +198 -0
- package/src/hooks/index.ts +9 -0
- package/src/hooks/useAudioFile.ts +62 -0
- package/src/hooks/useAudioTrack.ts +35 -0
- package/src/hooks/useIsSpeaking.ts +77 -0
- package/src/hooks/useTranscriber.ts +62 -0
- package/src/hooks/useVoiceInput.ts +66 -0
- package/src/index.ts +11 -0
- package/src/meta.ts +17 -0
- package/src/sanity.test.ts +11 -0
- package/src/transcriber/audio-recorder.ts +56 -0
- package/src/transcriber/index.ts +7 -0
- package/src/transcriber/media-stream-recorder.ts +109 -0
- package/src/transcriber/transcriber.test.ts +230 -0
- package/src/transcriber/transcriber.ts +247 -0
- package/src/translations.ts +28 -0
- package/src/types/index.ts +6 -0
- package/src/types/schema.ts +60 -0
- package/src/types/types.ts +34 -0
- package/src/util/array.ts +14 -0
- package/src/util/get-time-str.ts +12 -0
- package/src/util/index.ts +8 -0
- package/src/util/monitor-audio-level.ts +58 -0
- package/src/util/random-queue-dxn.ts +9 -0
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { S } from '@dxos/echo-schema';
|
|
2
|
+
/**
|
|
3
|
+
* Root transcript object created when the user starts a transcription.
|
|
4
|
+
*/
|
|
5
|
+
export declare const TranscriptSchema: S.Struct<{
|
|
6
|
+
name: typeof S.String;
|
|
7
|
+
started: S.optional<typeof S.Date>;
|
|
8
|
+
ended: S.optional<typeof S.Date>;
|
|
9
|
+
/**
|
|
10
|
+
* Queue containing TranscriptBlock objects.
|
|
11
|
+
*/
|
|
12
|
+
queue: S.optional<typeof S.String>;
|
|
13
|
+
}>;
|
|
14
|
+
declare const TranscriptType_base: import("@dxos/echo-schema").TypedObjectPrototype<import("@dxos/echo-schema").TypedObjectFields<{
|
|
15
|
+
readonly name: typeof S.String;
|
|
16
|
+
readonly started: S.optional<typeof S.Date>;
|
|
17
|
+
readonly ended: S.optional<typeof S.Date>;
|
|
18
|
+
readonly queue: S.optional<typeof S.String>;
|
|
19
|
+
}, import("@dxos/echo-schema").TypedObjectOptions>, S.Struct.Encoded<{
|
|
20
|
+
readonly name: typeof S.String;
|
|
21
|
+
readonly started: S.optional<typeof S.Date>;
|
|
22
|
+
readonly ended: S.optional<typeof S.Date>;
|
|
23
|
+
readonly queue: S.optional<typeof S.String>;
|
|
24
|
+
}>>;
|
|
25
|
+
export declare class TranscriptType extends TranscriptType_base {
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* First message in queue.
|
|
29
|
+
* Contains metadata for the recording and transcript.
|
|
30
|
+
*/
|
|
31
|
+
declare const TranscriptHeader: S.Struct<{
|
|
32
|
+
started: S.optional<typeof S.Date>;
|
|
33
|
+
}>;
|
|
34
|
+
export type TranscriptHeader = S.Schema.Type<typeof TranscriptHeader>;
|
|
35
|
+
/**
|
|
36
|
+
* Transcription fragment.
|
|
37
|
+
*/
|
|
38
|
+
declare const TranscriptSegment: S.Struct<{
|
|
39
|
+
started: typeof S.Date;
|
|
40
|
+
text: typeof S.String;
|
|
41
|
+
}>;
|
|
42
|
+
export type TranscriptSegment = S.Schema.Type<typeof TranscriptSegment>;
|
|
43
|
+
/**
|
|
44
|
+
* Transcription block (from single speaker).
|
|
45
|
+
*/
|
|
46
|
+
export declare const TranscriptBlock: S.Schema<{
|
|
47
|
+
readonly id: string;
|
|
48
|
+
author?: string | undefined;
|
|
49
|
+
segments: {
|
|
50
|
+
readonly started: Date;
|
|
51
|
+
readonly text: string;
|
|
52
|
+
}[];
|
|
53
|
+
}, {
|
|
54
|
+
readonly id: string;
|
|
55
|
+
author?: string | undefined;
|
|
56
|
+
segments: {
|
|
57
|
+
readonly started: Date;
|
|
58
|
+
readonly text: string;
|
|
59
|
+
}[];
|
|
60
|
+
}, never>;
|
|
61
|
+
export type TranscriptBlock = S.Schema.Type<typeof TranscriptBlock>;
|
|
62
|
+
export {};
|
|
63
|
+
//# sourceMappingURL=schema.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/types/schema.ts"],"names":[],"mappings":"AAIA,OAAO,EAAwB,CAAC,EAAe,MAAM,mBAAmB,CAAC;AAEzE;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;IAO3B;;OAEG;;EAEH,CAAC;;;;;;;;;;;;AAEH,qBAAa,cAAe,SAAQ,mBAGT;CAAG;AAI9B;;;GAGG;AACH,QAAA,MAAM,gBAAgB;;EAEpB,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,gBAAgB,CAAC,CAAC;AAEtE;;GAEG;AACH,QAAA,MAAM,iBAAiB;;;EAIrB,CAAC;AAEH,MAAM,MAAM,iBAAiB,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,iBAAiB,CAAC,CAAC;AAExE;;GAEG;AACH,eAAO,MAAM,eAAe;;;;;;;;;;;;;;SAIiC,CAAC;AAE9D,MAAM,MAAM,eAAe,GAAG,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,eAAe,CAAC,CAAC"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { S } from '@dxos/echo-schema';
|
|
2
|
+
import { TranscriptType } from './schema';
|
|
3
|
+
/**
|
|
4
|
+
* Endpoint to the calls service.
|
|
5
|
+
*/
|
|
6
|
+
export declare const TRANSCRIPTION_URL = "https://calls-service.dxos.workers.dev";
|
|
7
|
+
export declare namespace TranscriptionAction {
|
|
8
|
+
const Create_base: S.TaggedClass<Create, "dxos.org/plugin/transcription/action/create", {
|
|
9
|
+
readonly _tag: S.tag<"dxos.org/plugin/transcription/action/create">;
|
|
10
|
+
} & {
|
|
11
|
+
input: S.Struct<{
|
|
12
|
+
name: S.optional<typeof S.String>;
|
|
13
|
+
}>;
|
|
14
|
+
output: S.Struct<{
|
|
15
|
+
object: S.Struct<{
|
|
16
|
+
name: typeof S.String;
|
|
17
|
+
started: S.optional<typeof S.Date>;
|
|
18
|
+
ended: S.optional<typeof S.Date>;
|
|
19
|
+
queue: S.optional<typeof S.String>;
|
|
20
|
+
}>;
|
|
21
|
+
}>;
|
|
22
|
+
}>;
|
|
23
|
+
export class Create extends Create_base {
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
26
|
+
}
|
|
27
|
+
export declare const isTranscript: (object: unknown) => object is typeof TranscriptType;
|
|
28
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../src/types/types.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,CAAC,EAAgB,MAAM,mBAAmB,CAAC;AAGpD,OAAO,EAAoB,cAAc,EAAE,MAAM,UAAU,CAAC;AAK5D;;GAEG;AAEH,eAAO,MAAM,iBAAiB,2CAA2C,CAAC;AAE1E,yBAAiB,mBAAmB,CAAC;;;;;;;;;;;;;;;;IAGnC,MAAM,OAAO,MAAO,SAAQ,WAO1B;KAAG;;CACN;AAED,eAAO,MAAM,YAAY,WAAY,OAAO,KAAG,MAAM,IAAI,OAAO,cAE/D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"array.d.ts","sourceRoot":"","sources":["../../../../src/util/array.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,kBAAkB,WAAY,YAAY,EAAE,8BASxD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get-time-str.d.ts","sourceRoot":"","sources":["../../../../src/util/get-time-str.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,UAAU,eAAgB,MAAM,WAOzC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/util/index.ts"],"names":[],"mappings":"AAIA,cAAc,SAAS,CAAC;AACxB,cAAc,gBAAgB,CAAC;AAC/B,cAAc,uBAAuB,CAAC;AACtC,cAAc,oBAAoB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"monitor-audio-level.d.ts","sourceRoot":"","sources":["../../../../src/util/monitor-audio-level.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,iBAAiB,iDAI3B;IACD,gBAAgB,EAAE,gBAAgB,CAAC;IACnC,SAAS,EAAE,CAAC,KAAK,EAAE,MAAM,KAAK,IAAI,CAAC;IACnC,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,eA6CA,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"random-queue-dxn.d.ts","sourceRoot":"","sources":["../../../../src/util/random-queue-dxn.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,GAAG,EAA8B,MAAM,YAAY,CAAC;AAE7D,eAAO,MAAM,cAAc,WAC6D,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":"5.7.3"}
|
package/package.json
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@dxos/plugin-transcription",
|
|
3
|
+
"version": "0.7.5-main.5ae2ba8",
|
|
4
|
+
"description": "Voice transcription.",
|
|
5
|
+
"homepage": "https://dxos.org",
|
|
6
|
+
"bugs": "https://github.com/dxos/dxos/issues",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"author": "DXOS.org",
|
|
9
|
+
"type": "module",
|
|
10
|
+
"exports": {
|
|
11
|
+
".": {
|
|
12
|
+
"types": "./dist/types/src/index.d.ts",
|
|
13
|
+
"browser": "./dist/lib/browser/index.mjs",
|
|
14
|
+
"node": "./dist/lib/node-esm/index.mjs"
|
|
15
|
+
},
|
|
16
|
+
"./types": {
|
|
17
|
+
"types": "./dist/types/src/types/index.d.ts",
|
|
18
|
+
"browser": "./dist/lib/browser/types/index.mjs",
|
|
19
|
+
"node": "./dist/lib/node-esm/types/index.mjs"
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
"types": "dist/types/src/index.d.ts",
|
|
23
|
+
"typesVersions": {
|
|
24
|
+
"*": {
|
|
25
|
+
"types": [
|
|
26
|
+
"dist/types/src/types/index.d.ts"
|
|
27
|
+
]
|
|
28
|
+
}
|
|
29
|
+
},
|
|
30
|
+
"files": [
|
|
31
|
+
"dist",
|
|
32
|
+
"src"
|
|
33
|
+
],
|
|
34
|
+
"dependencies": {
|
|
35
|
+
"@preact/signals-core": "^1.6.0",
|
|
36
|
+
"date-fns": "^3.3.1",
|
|
37
|
+
"effect": "^3.12.3",
|
|
38
|
+
"extendable-media-recorder": "^9.2.19",
|
|
39
|
+
"extendable-media-recorder-wav-encoder": "^7.0.123",
|
|
40
|
+
"react-resize-detector": "^12.0.2",
|
|
41
|
+
"react-router-dom": "^6.4.0",
|
|
42
|
+
"react-use": "^17.5.1",
|
|
43
|
+
"wavefile": "^11.0.0",
|
|
44
|
+
"@dxos/app-framework": "0.7.5-main.5ae2ba8",
|
|
45
|
+
"@dxos/artifact": "0.7.5-main.5ae2ba8",
|
|
46
|
+
"@dxos/assistant": "0.7.5-main.5ae2ba8",
|
|
47
|
+
"@dxos/async": "0.7.5-main.5ae2ba8",
|
|
48
|
+
"@dxos/codec-protobuf": "0.7.5-main.5ae2ba8",
|
|
49
|
+
"@dxos/client": "0.7.5-main.5ae2ba8",
|
|
50
|
+
"@dxos/context": "0.7.5-main.5ae2ba8",
|
|
51
|
+
"@dxos/debug": "0.7.5-main.5ae2ba8",
|
|
52
|
+
"@dxos/display-name": "0.7.5-main.5ae2ba8",
|
|
53
|
+
"@dxos/echo-db": "0.7.5-main.5ae2ba8",
|
|
54
|
+
"@dxos/echo-schema": "0.7.5-main.5ae2ba8",
|
|
55
|
+
"@dxos/invariant": "0.7.5-main.5ae2ba8",
|
|
56
|
+
"@dxos/keys": "0.7.5-main.5ae2ba8",
|
|
57
|
+
"@dxos/live-object": "0.7.5-main.5ae2ba8",
|
|
58
|
+
"@dxos/log": "0.7.5-main.5ae2ba8",
|
|
59
|
+
"@dxos/plugin-client": "0.7.5-main.5ae2ba8",
|
|
60
|
+
"@dxos/plugin-graph": "0.7.5-main.5ae2ba8",
|
|
61
|
+
"@dxos/plugin-markdown": "0.7.5-main.5ae2ba8",
|
|
62
|
+
"@dxos/plugin-space": "0.7.5-main.5ae2ba8",
|
|
63
|
+
"@dxos/protocols": "0.7.5-main.5ae2ba8",
|
|
64
|
+
"@dxos/react-edge-client": "0.7.5-main.5ae2ba8",
|
|
65
|
+
"@dxos/react-client": "0.7.5-main.5ae2ba8",
|
|
66
|
+
"@dxos/react-ui-components": "0.7.5-main.5ae2ba8",
|
|
67
|
+
"@dxos/react-ui-sfx": "0.7.5-main.5ae2ba8",
|
|
68
|
+
"@dxos/react-ui-stack": "0.7.5-main.5ae2ba8",
|
|
69
|
+
"@dxos/schema": "0.7.5-main.5ae2ba8",
|
|
70
|
+
"@dxos/tracing": "0.7.5-main.5ae2ba8",
|
|
71
|
+
"@dxos/util": "0.7.5-main.5ae2ba8"
|
|
72
|
+
},
|
|
73
|
+
"devDependencies": {
|
|
74
|
+
"@types/react": "~18.2.0",
|
|
75
|
+
"react": "~18.2.0",
|
|
76
|
+
"react-dom": "~18.2.0",
|
|
77
|
+
"tailwindcss": "~3.4.1",
|
|
78
|
+
"@dxos/random": "0.7.5-main.5ae2ba8",
|
|
79
|
+
"@dxos/react-ui": "0.7.5-main.5ae2ba8",
|
|
80
|
+
"@dxos/react-ui-theme": "0.7.5-main.5ae2ba8",
|
|
81
|
+
"@dxos/storybook-utils": "0.7.5-main.5ae2ba8",
|
|
82
|
+
"@dxos/test-utils": "0.7.5-main.5ae2ba8"
|
|
83
|
+
},
|
|
84
|
+
"optionalDependencies": {
|
|
85
|
+
"react": "~18.2.0",
|
|
86
|
+
"react-dom": "~18.2.0",
|
|
87
|
+
"@dxos/react-ui": "0.7.5-main.5ae2ba8",
|
|
88
|
+
"@dxos/react-ui-theme": "0.7.5-main.5ae2ba8"
|
|
89
|
+
},
|
|
90
|
+
"publishConfig": {
|
|
91
|
+
"access": "public"
|
|
92
|
+
}
|
|
93
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Capabilities, Events, contributes, defineModule, definePlugin } from '@dxos/app-framework';
|
|
6
|
+
import { ClientCapabilities, ClientEvents } from '@dxos/plugin-client';
|
|
7
|
+
|
|
8
|
+
import { AppGraphBuilder, IntentResolver, ReactSurface, TranscriptionCapabilities } from './capabilities';
|
|
9
|
+
import { meta, TRANSCRIPTION_PLUGIN } from './meta';
|
|
10
|
+
import translations from './translations';
|
|
11
|
+
import { TranscriptType } from './types';
|
|
12
|
+
|
|
13
|
+
export const TranscriptionPlugin = () =>
|
|
14
|
+
definePlugin(meta, [
|
|
15
|
+
defineModule({
|
|
16
|
+
id: `${meta.id}/module/translations`,
|
|
17
|
+
activatesOn: Events.SetupTranslations,
|
|
18
|
+
activate: () => contributes(Capabilities.Translations, translations),
|
|
19
|
+
}),
|
|
20
|
+
defineModule({
|
|
21
|
+
id: `${meta.id}/module/transcription`,
|
|
22
|
+
activatesOn: Events.Startup,
|
|
23
|
+
activate: () => contributes(TranscriptionCapabilities.Transcription, null),
|
|
24
|
+
}),
|
|
25
|
+
defineModule({
|
|
26
|
+
id: `${meta.id}/module/metadata`,
|
|
27
|
+
activatesOn: Events.SetupMetadata,
|
|
28
|
+
activate: () =>
|
|
29
|
+
contributes(Capabilities.Metadata, {
|
|
30
|
+
id: TranscriptType.typename,
|
|
31
|
+
metadata: {
|
|
32
|
+
placeholder: ['transcript title placeholder', { ns: TRANSCRIPTION_PLUGIN }],
|
|
33
|
+
icon: 'ph--subtitles--regular',
|
|
34
|
+
},
|
|
35
|
+
}),
|
|
36
|
+
}),
|
|
37
|
+
defineModule({
|
|
38
|
+
id: `${meta.id}/module/schema`,
|
|
39
|
+
activatesOn: ClientEvents.SetupSchema,
|
|
40
|
+
activate: () => [contributes(ClientCapabilities.Schema, [TranscriptType])],
|
|
41
|
+
}),
|
|
42
|
+
defineModule({
|
|
43
|
+
id: `${meta.id}/module/react-surface`,
|
|
44
|
+
activatesOn: Events.SetupReactSurface,
|
|
45
|
+
activate: ReactSurface,
|
|
46
|
+
}),
|
|
47
|
+
defineModule({
|
|
48
|
+
id: `${meta.id}/module/intent-resolver`,
|
|
49
|
+
activatesOn: Events.SetupIntentResolver,
|
|
50
|
+
activate: IntentResolver,
|
|
51
|
+
}),
|
|
52
|
+
defineModule({
|
|
53
|
+
id: `${meta.id}/module/app-graph-builder`,
|
|
54
|
+
activatesOn: Events.SetupAppGraph,
|
|
55
|
+
activate: AppGraphBuilder,
|
|
56
|
+
}),
|
|
57
|
+
]);
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { defineCapability } from '@dxos/app-framework';
|
|
6
|
+
|
|
7
|
+
import { TRANSCRIPTION_PLUGIN } from '../meta';
|
|
8
|
+
|
|
9
|
+
export namespace TranscriptionCapabilities {
|
|
10
|
+
// TODO(burdon): Currently this is just a marker; adapt useVoiceInput to use this.
|
|
11
|
+
export const Transcription = defineCapability<null>(`${TRANSCRIPTION_PLUGIN}/capability/transcription`);
|
|
12
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { lazy } from '@dxos/app-framework';
|
|
6
|
+
|
|
7
|
+
export const AppGraphBuilder = lazy(() => import('./app-graph-builder'));
|
|
8
|
+
export const IntentResolver = lazy(() => import('./intent-resolver'));
|
|
9
|
+
export const ReactSurface = lazy(() => import('./react-surface'));
|
|
10
|
+
|
|
11
|
+
export * from './capabilities';
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { Capabilities, contributes, createResolver, type PluginsContext } from '@dxos/app-framework';
|
|
6
|
+
import { create } from '@dxos/live-object';
|
|
7
|
+
|
|
8
|
+
import { TranscriptionAction, TranscriptType } from '../types';
|
|
9
|
+
import { getTimeStr, randomQueueDxn } from '../util';
|
|
10
|
+
|
|
11
|
+
export default (context: PluginsContext) =>
|
|
12
|
+
contributes(Capabilities.IntentResolver, [
|
|
13
|
+
createResolver({
|
|
14
|
+
intent: TranscriptionAction.Create,
|
|
15
|
+
resolve: ({ name }) => {
|
|
16
|
+
const transcript = create(TranscriptType, {
|
|
17
|
+
queue: randomQueueDxn().toString(), // TODO(burdon): Associate with space.
|
|
18
|
+
name: name ?? `Transcript ${getTimeStr(Date.now())}`,
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
return { data: { object: transcript } };
|
|
22
|
+
},
|
|
23
|
+
}),
|
|
24
|
+
]);
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import React from 'react';
|
|
6
|
+
|
|
7
|
+
import { Capabilities, contributes, createSurface } from '@dxos/app-framework';
|
|
8
|
+
|
|
9
|
+
import { TranscriptionContainer } from '../components';
|
|
10
|
+
import { TRANSCRIPTION_PLUGIN } from '../meta';
|
|
11
|
+
import { isTranscript, type TranscriptType } from '../types';
|
|
12
|
+
|
|
13
|
+
export default () =>
|
|
14
|
+
contributes(Capabilities.ReactSurface, [
|
|
15
|
+
createSurface({
|
|
16
|
+
id: TRANSCRIPTION_PLUGIN,
|
|
17
|
+
role: 'article',
|
|
18
|
+
filter: (data): data is { subject: TranscriptType } => isTranscript(data.subject),
|
|
19
|
+
component: ({ data, role }) => <TranscriptionContainer transcript={data.subject} />,
|
|
20
|
+
}),
|
|
21
|
+
]);
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2025 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import '@dxos-theme';
|
|
6
|
+
|
|
7
|
+
import { type StoryObj, type Meta } from '@storybook/react';
|
|
8
|
+
import React from 'react';
|
|
9
|
+
|
|
10
|
+
import { faker } from '@dxos/random';
|
|
11
|
+
import { ScrollContainer } from '@dxos/react-ui-components';
|
|
12
|
+
import { withTheme, withLayout } from '@dxos/storybook-utils';
|
|
13
|
+
|
|
14
|
+
import { Transcript } from './Transcript';
|
|
15
|
+
import translations from '../../translations';
|
|
16
|
+
|
|
17
|
+
const meta: Meta<typeof Transcript> = {
|
|
18
|
+
title: 'plugins/plugin-transcription/Transcript',
|
|
19
|
+
component: Transcript,
|
|
20
|
+
render: (args) => (
|
|
21
|
+
<div className='flex w-[30rem] p-2'>
|
|
22
|
+
<ScrollContainer>
|
|
23
|
+
<Transcript {...args} />
|
|
24
|
+
</ScrollContainer>
|
|
25
|
+
</div>
|
|
26
|
+
),
|
|
27
|
+
decorators: [
|
|
28
|
+
withTheme,
|
|
29
|
+
withLayout({
|
|
30
|
+
tooltips: true,
|
|
31
|
+
fullscreen: true,
|
|
32
|
+
classNames: 'justify-center',
|
|
33
|
+
}),
|
|
34
|
+
],
|
|
35
|
+
parameters: {
|
|
36
|
+
translations,
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
|
|
40
|
+
export default meta;
|
|
41
|
+
|
|
42
|
+
type Story = StoryObj<typeof Transcript>;
|
|
43
|
+
|
|
44
|
+
let start = new Date();
|
|
45
|
+
const next = () => {
|
|
46
|
+
start = new Date(start.getTime() - Math.random() * 30_000);
|
|
47
|
+
return start;
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const names = Array.from({ length: 3 }, () => faker.person.fullName());
|
|
51
|
+
|
|
52
|
+
export const Default: Story = {
|
|
53
|
+
args: {
|
|
54
|
+
blocks: Array.from({ length: 6 + Math.floor(Math.random()) * 15 }, () => ({
|
|
55
|
+
id: faker.string.uuid(),
|
|
56
|
+
author: faker.helpers.arrayElement(names),
|
|
57
|
+
segments: Array.from({ length: 1 + Math.floor(Math.random() * 3) }, () => ({
|
|
58
|
+
started: next(),
|
|
59
|
+
text: faker.lorem.paragraph(),
|
|
60
|
+
})),
|
|
61
|
+
})).reverse(),
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
|
|
65
|
+
export const Empty: Story = {};
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
//
|
|
2
|
+
// Copyright 2023 DXOS.org
|
|
3
|
+
//
|
|
4
|
+
|
|
5
|
+
import { formatDistanceToNow } from 'date-fns/formatDistanceToNow';
|
|
6
|
+
import React, { type FC } from 'react';
|
|
7
|
+
|
|
8
|
+
import { Icon, IconButton, useTranslation } from '@dxos/react-ui';
|
|
9
|
+
|
|
10
|
+
import { TRANSCRIPTION_PLUGIN } from '../../meta';
|
|
11
|
+
import { type TranscriptBlock } from '../../types';
|
|
12
|
+
|
|
13
|
+
// TODO(burdon): react-ui-list.
|
|
14
|
+
// TODO(burdon): Actions (e.g., mark, summarize, translate, label, delete).
|
|
15
|
+
|
|
16
|
+
export type TranscriptProps = {
|
|
17
|
+
blocks?: TranscriptBlock[];
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
export const Transcript: FC<TranscriptProps> = ({ blocks }) => {
|
|
21
|
+
const { t } = useTranslation(TRANSCRIPTION_PLUGIN);
|
|
22
|
+
const hoverButton = 'p-1 min-bs-1 transition-opacity duration-250 opacity-10 group-hover:opacity-100';
|
|
23
|
+
|
|
24
|
+
return (
|
|
25
|
+
<div role='list' className='flex flex-col grow gap-2 m-1'>
|
|
26
|
+
{blocks?.map((block) => (
|
|
27
|
+
<div
|
|
28
|
+
role='listitem'
|
|
29
|
+
key={block.id}
|
|
30
|
+
className='flex flex-col py-1 border border-transparent hover:border-separator rounded'
|
|
31
|
+
>
|
|
32
|
+
<div className='group flex items-center px-2'>
|
|
33
|
+
<Icon icon='ph--user--regular' />
|
|
34
|
+
<div className='px-2 text-sm text-subdued'>{block.author}</div>
|
|
35
|
+
<div className='grow' />
|
|
36
|
+
<IconButton
|
|
37
|
+
disabled
|
|
38
|
+
icon='ph--x--regular'
|
|
39
|
+
label={t('delete button')}
|
|
40
|
+
iconOnly
|
|
41
|
+
size={4}
|
|
42
|
+
classNames={hoverButton}
|
|
43
|
+
/>
|
|
44
|
+
</div>
|
|
45
|
+
|
|
46
|
+
{block.segments.map((segment, i) => (
|
|
47
|
+
<div key={i} className='group flex flex-col'>
|
|
48
|
+
<div className='px-2'>{segment.text}</div>
|
|
49
|
+
<div className='flex gap-1 items-center justify-between px-2'>
|
|
50
|
+
<div className='grow' />
|
|
51
|
+
<div className='truncate text-xs text-subdued'>
|
|
52
|
+
{formatDistanceToNow(segment.started, { addSuffix: true })}
|
|
53
|
+
</div>
|
|
54
|
+
<IconButton
|
|
55
|
+
disabled
|
|
56
|
+
icon='ph--bookmark-simple--regular'
|
|
57
|
+
label={t('bookmark button')}
|
|
58
|
+
iconOnly
|
|
59
|
+
size={4}
|
|
60
|
+
classNames={hoverButton}
|
|
61
|
+
/>
|
|
62
|
+
</div>
|
|
63
|
+
</div>
|
|
64
|
+
))}
|
|
65
|
+
</div>
|
|
66
|
+
))}
|
|
67
|
+
</div>
|
|
68
|
+
);
|
|
69
|
+
};
|