@dxos/plugin-transcription 0.8.3-main.7f5a14c → 0.8.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/lib/browser/{TranscriptContainer-PDSOWOMY.mjs → TranscriptContainer-H3AZQ4CQ.mjs} +2 -2
- package/dist/lib/browser/{chunk-KMCEHAVR.mjs → chunk-53AXUEIQ.mjs} +4 -4
- package/dist/lib/browser/{chunk-KMCEHAVR.mjs.map → chunk-53AXUEIQ.mjs.map} +3 -3
- package/dist/lib/browser/{chunk-KUO25QLG.mjs → chunk-IQ5ZRMHZ.mjs} +4 -4
- package/dist/lib/browser/{chunk-KUO25QLG.mjs.map → chunk-IQ5ZRMHZ.mjs.map} +2 -2
- package/dist/lib/browser/{chunk-RPMSRXAD.mjs → chunk-UDCCT32F.mjs} +2 -2
- package/dist/lib/browser/index.mjs +3 -7
- package/dist/lib/browser/index.mjs.map +3 -3
- package/dist/lib/browser/meta.json +1 -1
- package/dist/lib/browser/{react-surface-4KQXXK3L.mjs → react-surface-HMJS5FSS.mjs} +3 -3
- package/dist/lib/browser/{transcriber-KKKY7OTA.mjs → transcriber-OYPLZFG5.mjs} +2 -2
- package/dist/lib/node/{TranscriptContainer-74YHORVT.cjs → TranscriptContainer-KIG3GMAB.cjs} +7 -7
- package/dist/lib/node/{TranscriptContainer-74YHORVT.cjs.map → TranscriptContainer-KIG3GMAB.cjs.map} +2 -2
- package/dist/lib/node/{chunk-SZXEXASL.cjs → chunk-3PYT3BDM.cjs} +5 -5
- package/dist/lib/node/{chunk-TH26IEUM.cjs → chunk-CVUN3UO7.cjs} +6 -6
- package/dist/lib/node/{chunk-TH26IEUM.cjs.map → chunk-CVUN3UO7.cjs.map} +2 -2
- package/dist/lib/node/{chunk-C5W34GLS.cjs → chunk-ZFAUMZXE.cjs} +7 -7
- package/dist/lib/node/{chunk-C5W34GLS.cjs.map → chunk-ZFAUMZXE.cjs.map} +2 -2
- package/dist/lib/node/index.cjs +19 -23
- package/dist/lib/node/index.cjs.map +3 -3
- package/dist/lib/node/meta.json +1 -1
- package/dist/lib/node/{react-surface-QVXIHCOA.cjs → react-surface-N25TBBG4.cjs} +7 -7
- package/dist/lib/node/{transcriber-532JRZHY.cjs → transcriber-6J4FVFSZ.cjs} +8 -8
- package/dist/lib/node-esm/{TranscriptContainer-VBUQ7KJJ.mjs → TranscriptContainer-G75LDEO5.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-2U54OZH3.mjs → chunk-56QHOX4A.mjs} +4 -4
- package/dist/lib/node-esm/{chunk-2U54OZH3.mjs.map → chunk-56QHOX4A.mjs.map} +3 -3
- package/dist/lib/node-esm/{chunk-QS4L6XU3.mjs → chunk-MFJO7EKD.mjs} +2 -2
- package/dist/lib/node-esm/{chunk-QSGGTMXE.mjs → chunk-PRL64SRU.mjs} +4 -4
- package/dist/lib/node-esm/{chunk-QSGGTMXE.mjs.map → chunk-PRL64SRU.mjs.map} +2 -2
- package/dist/lib/node-esm/index.mjs +3 -7
- package/dist/lib/node-esm/index.mjs.map +3 -3
- package/dist/lib/node-esm/meta.json +1 -1
- package/dist/lib/node-esm/{react-surface-ZB7Y2YF7.mjs → react-surface-JGQSYGRR.mjs} +3 -3
- package/dist/lib/node-esm/{transcriber-SPV5ZLIJ.mjs → transcriber-TVG2MBBN.mjs} +2 -2
- package/dist/types/src/components/Transcript/deprecated/OldTranscript.d.ts +3 -2
- package/dist/types/src/components/Transcript/deprecated/OldTranscript.d.ts.map +1 -1
- package/dist/types/src/hooks/useQueueModelAdapter.d.ts +3 -2
- package/dist/types/src/hooks/useQueueModelAdapter.d.ts.map +1 -1
- package/dist/types/src/segments-normalization/normalization.d.ts +161 -352
- package/dist/types/src/segments-normalization/normalization.d.ts.map +1 -1
- package/dist/types/src/testing/testing.d.ts +3 -3
- package/dist/types/src/testing/testing.d.ts.map +1 -1
- package/dist/types/src/translations.d.ts +0 -5
- package/dist/types/src/translations.d.ts.map +1 -1
- package/dist/types/src/types/schema.d.ts +4 -3
- package/dist/types/src/types/schema.d.ts.map +1 -1
- package/package.json +51 -51
- package/src/components/stories/FileTranscription.stories.tsx +2 -2
- package/src/components/stories/MicrophoneTranscription.stories.tsx +3 -3
- package/src/hooks/useQueueModelAdapter.ts +4 -3
- package/src/model/model.test.ts +17 -17
- package/src/segments-normalization/message-normalizer.ts +1 -1
- package/src/segments-normalization/normalization.test.ts +13 -12
- package/src/segments-normalization/normalization.ts +8 -6
- package/src/testing/testing.ts +9 -10
- package/src/transcriber/transcription-manager.ts +3 -3
- package/src/translations.ts +0 -5
- /package/dist/lib/browser/{TranscriptContainer-PDSOWOMY.mjs.map → TranscriptContainer-H3AZQ4CQ.mjs.map} +0 -0
- /package/dist/lib/browser/{chunk-RPMSRXAD.mjs.map → chunk-UDCCT32F.mjs.map} +0 -0
- /package/dist/lib/browser/{react-surface-4KQXXK3L.mjs.map → react-surface-HMJS5FSS.mjs.map} +0 -0
- /package/dist/lib/browser/{transcriber-KKKY7OTA.mjs.map → transcriber-OYPLZFG5.mjs.map} +0 -0
- /package/dist/lib/node/{chunk-SZXEXASL.cjs.map → chunk-3PYT3BDM.cjs.map} +0 -0
- /package/dist/lib/node/{react-surface-QVXIHCOA.cjs.map → react-surface-N25TBBG4.cjs.map} +0 -0
- /package/dist/lib/node/{transcriber-532JRZHY.cjs.map → transcriber-6J4FVFSZ.cjs.map} +0 -0
- /package/dist/lib/node-esm/{TranscriptContainer-VBUQ7KJJ.mjs.map → TranscriptContainer-G75LDEO5.mjs.map} +0 -0
- /package/dist/lib/node-esm/{chunk-QS4L6XU3.mjs.map → chunk-MFJO7EKD.mjs.map} +0 -0
- /package/dist/lib/node-esm/{react-surface-ZB7Y2YF7.mjs.map → react-surface-JGQSYGRR.mjs.map} +0 -0
- /package/dist/lib/node-esm/{transcriber-SPV5ZLIJ.mjs.map → transcriber-TVG2MBBN.mjs.map} +0 -0
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { Schema } from 'effect';
|
|
2
2
|
import { type Queue } from '@dxos/client/echo';
|
|
3
|
-
import { Key } from '@dxos/echo';
|
|
3
|
+
import { type Key, Type } from '@dxos/echo';
|
|
4
4
|
import { type Space } from '@dxos/react-client/echo';
|
|
5
5
|
import { DataType } from '@dxos/schema';
|
|
6
|
-
export declare const TestItem:
|
|
6
|
+
export declare const TestItem: Type.obj<Schema.Struct<{
|
|
7
7
|
title: Schema.SchemaClass<string, string, never>;
|
|
8
8
|
description: Schema.SchemaClass<string, string, never>;
|
|
9
|
-
}
|
|
9
|
+
}>>;
|
|
10
10
|
declare abstract class AbstractMessageBuilder {
|
|
11
11
|
abstract createMessage(numSegments?: number): Promise<DataType.Message>;
|
|
12
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../../src/testing/testing.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAOhC,OAAO,EAAU,KAAK,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"testing.d.ts","sourceRoot":"","sources":["../../../../src/testing/testing.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAOhC,OAAO,EAAU,KAAK,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAEvD,OAAO,EAAE,KAAK,GAAG,EAAY,IAAI,EAAE,MAAM,YAAY,CAAC;AAMtD,OAAO,EAAY,KAAK,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAC/D,OAAO,EAAE,QAAQ,EAAE,MAAM,cAAc,CAAC;AAIxC,eAAO,MAAM,QAAQ;;;GAcpB,CAAC;AAGF,uBAAe,sBAAsB;IACnC,QAAQ,CAAC,aAAa,CAAC,WAAW,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;CACxE;AAED;;GAEG;AACH,qBAAa,cAAe,SAAQ,sBAAsB;IAW5C,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAC;IAVpC,MAAM,CAAC,QAAQ,CAAC,SAAS,iBAAwB;IAEjD,KAAK;;;;QAID;IAEJ,KAAK,OAAgD;gBAExB,MAAM,CAAC,EAAE,KAAK,YAAA;IAI5B,aAAa,CAAC,WAAW,SAAI,GAAG,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC;IAQxE,WAAW,IAAI,QAAQ,CAAC,YAAY,CAAC,aAAa;IAkBlD,IAAI,IAAI,IAAI;CAIb;AA8CD,KAAK,yBAAyB,GAAG,CAC/B,KAAK,EAAE,KAAK,GAAG,SAAS,EACxB,OAAO,CAAC,EAAE,GAAG,CAAC,QAAQ,EACtB,OAAO,CAAC,EAAE,OAAO,EACjB,QAAQ,CAAC,EAAE,MAAM,KACd,KAAK,CAAC,QAAQ,CAAC,OAAO,CAAC,GAAG,SAAS,CAAC;AAEzC;;GAEG;AACH,eAAO,MAAM,yBAAyB,EAAE,yBAyBvC,CAAC;AAEF;;GAEG;AAEH,eAAO,MAAM,6CAA6C,EAAE,yBAoC3D,CAAC"}
|
|
@@ -1,10 +1,5 @@
|
|
|
1
|
-
import { TranscriptType } from './types';
|
|
2
1
|
declare const _default: {
|
|
3
2
|
'en-US': {
|
|
4
|
-
[TranscriptType.typename]: {
|
|
5
|
-
'typename label': string;
|
|
6
|
-
'object name placeholder': string;
|
|
7
|
-
};
|
|
8
3
|
"dxos.org/plugin/transcription": {
|
|
9
4
|
'plugin name': string;
|
|
10
5
|
'transcript companion label': string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"translations.d.ts","sourceRoot":"","sources":["../../../src/translations.ts"],"names":[],"mappings":";;;;;;;;;;;;AAMA,wBAeE"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Schema } from 'effect';
|
|
2
2
|
import { Queue } from '@dxos/client/echo';
|
|
3
|
+
import { Type } from '@dxos/echo';
|
|
3
4
|
/**
|
|
4
5
|
* Root transcript object created when the user starts a transcription.
|
|
5
6
|
*/
|
|
@@ -9,7 +10,7 @@ export declare const TranscriptSchema: Schema.Struct<{
|
|
|
9
10
|
/**
|
|
10
11
|
* Queue containing TranscriptBlock objects.
|
|
11
12
|
*/
|
|
12
|
-
queue: import("@dxos/echo
|
|
13
|
+
queue: Type.ref<Schema.Schema<Queue<import("@dxos/echo/Obj").Any | import("@dxos/echo/Relation").Any>, Queue<import("@dxos/echo/Obj").Any | import("@dxos/echo/Relation").Any>, never>>;
|
|
13
14
|
}>;
|
|
14
15
|
declare const TranscriptType_base: import("@dxos/echo-schema").TypedObjectPrototype<import("@dxos/echo-schema").TypedObjectFields<Readonly<{
|
|
15
16
|
started: Schema.optional<typeof Schema.String>;
|
|
@@ -17,14 +18,14 @@ declare const TranscriptType_base: import("@dxos/echo-schema").TypedObjectProtot
|
|
|
17
18
|
/**
|
|
18
19
|
* Queue containing TranscriptBlock objects.
|
|
19
20
|
*/
|
|
20
|
-
queue: import("@dxos/echo
|
|
21
|
+
queue: Type.ref<Schema.Schema<Queue<import("@dxos/echo/Obj").Any | import("@dxos/echo/Relation").Any>, Queue<import("@dxos/echo/Obj").Any | import("@dxos/echo/Relation").Any>, never>>;
|
|
21
22
|
}>, import("@dxos/echo-schema").TypedObjectOptions>, Schema.Struct.Encoded<Readonly<{
|
|
22
23
|
started: Schema.optional<typeof Schema.String>;
|
|
23
24
|
ended: Schema.optional<typeof Schema.String>;
|
|
24
25
|
/**
|
|
25
26
|
* Queue containing TranscriptBlock objects.
|
|
26
27
|
*/
|
|
27
|
-
queue: import("@dxos/echo
|
|
28
|
+
queue: Type.ref<Schema.Schema<Queue<import("@dxos/echo/Obj").Any | import("@dxos/echo/Relation").Any>, Queue<import("@dxos/echo/Obj").Any | import("@dxos/echo/Relation").Any>, never>>;
|
|
28
29
|
}>>>;
|
|
29
30
|
export declare class TranscriptType extends TranscriptType_base {
|
|
30
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/types/schema.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;
|
|
1
|
+
{"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../../src/types/schema.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAEhC,OAAO,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAC;AAC1C,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAGlC;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;IAM3B;;OAEG;;EAEH,CAAC;;;;IAJD;;OAEG;;;;;IAFH;;OAEG;;;AAIL,qBAAa,cAAe,SAAQ,mBAGT;CAAG;AAI9B;;;GAGG;AACH,QAAA,MAAM,gBAAgB;;EAEpB,CAAC;AAEH,MAAM,MAAM,gBAAgB,GAAG,MAAM,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dxos/plugin-transcription",
|
|
3
|
-
"version": "0.8.3
|
|
3
|
+
"version": "0.8.3",
|
|
4
4
|
"description": "Voice transcription.",
|
|
5
5
|
"homepage": "https://dxos.org",
|
|
6
6
|
"bugs": "https://github.com/dxos/dxos/issues",
|
|
@@ -44,44 +44,44 @@
|
|
|
44
44
|
"react-router-dom": "^6.4.0",
|
|
45
45
|
"react-use": "^17.5.1",
|
|
46
46
|
"wavefile": "^11.0.0",
|
|
47
|
-
"@dxos/ai": "0.8.3
|
|
48
|
-
"@dxos/app-framework": "0.8.3
|
|
49
|
-
"@dxos/artifact": "0.8.3
|
|
50
|
-
"@dxos/assistant": "0.8.3
|
|
51
|
-
"@dxos/
|
|
52
|
-
"@dxos/client": "0.8.3
|
|
53
|
-
"@dxos/
|
|
54
|
-
"@dxos/context": "0.8.3
|
|
55
|
-
"@dxos/
|
|
56
|
-
"@dxos/
|
|
57
|
-
"@dxos/echo": "0.8.3
|
|
58
|
-
"@dxos/echo-db": "0.8.3
|
|
59
|
-
"@dxos/echo-schema": "0.8.3
|
|
60
|
-
"@dxos/
|
|
61
|
-
"@dxos/
|
|
62
|
-
"@dxos/
|
|
63
|
-
"@dxos/
|
|
64
|
-
"@dxos/
|
|
65
|
-
"@dxos/log": "0.8.3
|
|
66
|
-
"@dxos/plugin-client": "0.8.3
|
|
67
|
-
"@dxos/plugin-deck": "0.8.3
|
|
68
|
-
"@dxos/plugin-graph": "0.8.3
|
|
69
|
-
"@dxos/plugin-markdown": "0.8.3
|
|
70
|
-
"@dxos/plugin-
|
|
71
|
-
"@dxos/
|
|
72
|
-
"@dxos/
|
|
73
|
-
"@dxos/react-edge-client": "0.8.3
|
|
74
|
-
"@dxos/
|
|
75
|
-
"@dxos/react-ui-
|
|
76
|
-
"@dxos/react-ui-
|
|
77
|
-
"@dxos/react-ui-
|
|
78
|
-
"@dxos/react-ui-
|
|
79
|
-
"@dxos/react-ui-
|
|
80
|
-
"@dxos/
|
|
81
|
-
"@dxos/
|
|
82
|
-
"@dxos/
|
|
83
|
-
"@dxos/
|
|
84
|
-
"@dxos/
|
|
47
|
+
"@dxos/ai": "0.8.3",
|
|
48
|
+
"@dxos/app-framework": "0.8.3",
|
|
49
|
+
"@dxos/artifact": "0.8.3",
|
|
50
|
+
"@dxos/assistant": "0.8.3",
|
|
51
|
+
"@dxos/async": "0.8.3",
|
|
52
|
+
"@dxos/client": "0.8.3",
|
|
53
|
+
"@dxos/codec-protobuf": "0.8.3",
|
|
54
|
+
"@dxos/context": "0.8.3",
|
|
55
|
+
"@dxos/debug": "0.8.3",
|
|
56
|
+
"@dxos/display-name": "0.8.3",
|
|
57
|
+
"@dxos/echo": "0.8.3",
|
|
58
|
+
"@dxos/echo-db": "0.8.3",
|
|
59
|
+
"@dxos/echo-schema": "0.8.3",
|
|
60
|
+
"@dxos/invariant": "0.8.3",
|
|
61
|
+
"@dxos/functions": "0.8.3",
|
|
62
|
+
"@dxos/live-object": "0.8.3",
|
|
63
|
+
"@dxos/keys": "0.8.3",
|
|
64
|
+
"@dxos/local-storage": "0.8.3",
|
|
65
|
+
"@dxos/log": "0.8.3",
|
|
66
|
+
"@dxos/plugin-client": "0.8.3",
|
|
67
|
+
"@dxos/plugin-deck": "0.8.3",
|
|
68
|
+
"@dxos/plugin-graph": "0.8.3",
|
|
69
|
+
"@dxos/plugin-markdown": "0.8.3",
|
|
70
|
+
"@dxos/plugin-thread": "0.8.3",
|
|
71
|
+
"@dxos/protocols": "0.8.3",
|
|
72
|
+
"@dxos/react-client": "0.8.3",
|
|
73
|
+
"@dxos/react-edge-client": "0.8.3",
|
|
74
|
+
"@dxos/plugin-space": "0.8.3",
|
|
75
|
+
"@dxos/react-ui-attention": "0.8.3",
|
|
76
|
+
"@dxos/react-ui-editor": "0.8.3",
|
|
77
|
+
"@dxos/react-ui-components": "0.8.3",
|
|
78
|
+
"@dxos/react-ui-stack": "0.8.3",
|
|
79
|
+
"@dxos/react-ui-grid": "0.8.3",
|
|
80
|
+
"@dxos/schema": "0.8.3",
|
|
81
|
+
"@dxos/tracing": "0.8.3",
|
|
82
|
+
"@dxos/react-ui-sfx": "0.8.3",
|
|
83
|
+
"@dxos/react-ui-form": "0.8.3",
|
|
84
|
+
"@dxos/util": "0.8.3"
|
|
85
85
|
},
|
|
86
86
|
"devDependencies": {
|
|
87
87
|
"@effect-rx/rx-react": "^0.34.1",
|
|
@@ -92,16 +92,16 @@
|
|
|
92
92
|
"react": "~18.2.0",
|
|
93
93
|
"react-dom": "~18.2.0",
|
|
94
94
|
"tailwindcss": "~3.4.1",
|
|
95
|
-
"@dxos/plugin-preview": "0.8.3
|
|
96
|
-
"@dxos/
|
|
97
|
-
"@dxos/random": "0.8.3
|
|
98
|
-
"@dxos/plugin-
|
|
99
|
-
"@dxos/react-ui-form": "0.8.3
|
|
100
|
-
"@dxos/react-ui": "0.8.3
|
|
101
|
-
"@dxos/
|
|
102
|
-
"@dxos/react-ui-theme": "0.8.3
|
|
103
|
-
"@dxos/storybook-utils": "0.8.3
|
|
104
|
-
"@dxos/test-utils": "0.8.3
|
|
95
|
+
"@dxos/plugin-preview": "0.8.3",
|
|
96
|
+
"@dxos/react-ui": "0.8.3",
|
|
97
|
+
"@dxos/random": "0.8.3",
|
|
98
|
+
"@dxos/plugin-storybook-layout": "0.8.3",
|
|
99
|
+
"@dxos/react-ui-form": "0.8.3",
|
|
100
|
+
"@dxos/react-ui-syntax-highlighter": "0.8.3",
|
|
101
|
+
"@dxos/plugin-theme": "0.8.3",
|
|
102
|
+
"@dxos/react-ui-theme": "0.8.3",
|
|
103
|
+
"@dxos/storybook-utils": "0.8.3",
|
|
104
|
+
"@dxos/test-utils": "0.8.3"
|
|
105
105
|
},
|
|
106
106
|
"optionalDependencies": {
|
|
107
107
|
"@effect-rx/rx-react": "^0.34.1",
|
|
@@ -109,8 +109,8 @@
|
|
|
109
109
|
"effect": "^3.13.3",
|
|
110
110
|
"react": "~18.2.0",
|
|
111
111
|
"react-dom": "~18.2.0",
|
|
112
|
-
"@dxos/react-ui": "0.8.3
|
|
113
|
-
"@dxos/react-ui
|
|
112
|
+
"@dxos/react-ui-theme": "0.8.3",
|
|
113
|
+
"@dxos/react-ui": "0.8.3"
|
|
114
114
|
},
|
|
115
115
|
"publishConfig": {
|
|
116
116
|
"access": "public"
|
|
@@ -7,7 +7,7 @@ import '@dxos-theme';
|
|
|
7
7
|
import { type Meta, type StoryObj } from '@storybook/react';
|
|
8
8
|
import React, { useCallback, useEffect, useMemo, useRef, useState } from 'react';
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import { EdgeAiServiceClient } from '@dxos/ai';
|
|
11
11
|
import { AI_SERVICE_ENDPOINT } from '@dxos/ai/testing';
|
|
12
12
|
import { Events, IntentPlugin, SettingsPlugin } from '@dxos/app-framework';
|
|
13
13
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
@@ -109,7 +109,7 @@ const AudioFile = ({
|
|
|
109
109
|
const executor = new FunctionExecutor(
|
|
110
110
|
new ServiceContainer().setServices({
|
|
111
111
|
ai: {
|
|
112
|
-
client: new
|
|
112
|
+
client: new EdgeAiServiceClient({
|
|
113
113
|
endpoint: AI_SERVICE_ENDPOINT.REMOTE,
|
|
114
114
|
defaultGenerationOptions: {
|
|
115
115
|
model: '@anthropic/claude-3-5-sonnet-20241022',
|
|
@@ -7,7 +7,7 @@ import '@dxos-theme';
|
|
|
7
7
|
import { type Meta, type StoryObj } from '@storybook/react';
|
|
8
8
|
import React, { useCallback, useEffect, useMemo, useState } from 'react';
|
|
9
9
|
|
|
10
|
-
import {
|
|
10
|
+
import { EdgeAiServiceClient } from '@dxos/ai';
|
|
11
11
|
import { AI_SERVICE_ENDPOINT } from '@dxos/ai/testing';
|
|
12
12
|
import { Events, IntentPlugin, SettingsPlugin } from '@dxos/app-framework';
|
|
13
13
|
import { withPluginManager } from '@dxos/app-framework/testing';
|
|
@@ -117,11 +117,11 @@ const DefaultStory = ({
|
|
|
117
117
|
.then((result) => result.objects);
|
|
118
118
|
}
|
|
119
119
|
if (entityExtraction !== 'none') {
|
|
120
|
-
const
|
|
120
|
+
const AiService = new EdgeAiServiceClient({
|
|
121
121
|
endpoint: AI_SERVICE_ENDPOINT.REMOTE,
|
|
122
122
|
});
|
|
123
123
|
executor = new FunctionExecutor(
|
|
124
|
-
new ServiceContainer().setServices({ ai: { client:
|
|
124
|
+
new ServiceContainer().setServices({ ai: { client: AiService }, database: { db: space!.db } }),
|
|
125
125
|
);
|
|
126
126
|
}
|
|
127
127
|
|
|
@@ -2,16 +2,17 @@
|
|
|
2
2
|
// Copyright 2025 DXOS.org
|
|
3
3
|
//
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { useEffect, useMemo, useState } from 'react';
|
|
6
6
|
|
|
7
|
+
import type { Obj } from '@dxos/echo';
|
|
7
8
|
import { type Queue } from '@dxos/react-client/echo';
|
|
8
9
|
|
|
9
|
-
import { type
|
|
10
|
+
import { type ChunkRenderer, SerializationModel } from '../model';
|
|
10
11
|
|
|
11
12
|
/**
|
|
12
13
|
* Model adapter for a queue.
|
|
13
14
|
*/
|
|
14
|
-
export const useQueueModelAdapter = <T extends
|
|
15
|
+
export const useQueueModelAdapter = <T extends Obj.Any>(
|
|
15
16
|
renderer: ChunkRenderer<T>,
|
|
16
17
|
queue: Queue<T> | undefined,
|
|
17
18
|
initialChunks: T[] = [],
|
package/src/model/model.test.ts
CHANGED
|
@@ -5,7 +5,9 @@
|
|
|
5
5
|
import { EditorView } from '@codemirror/view';
|
|
6
6
|
import { describe, test } from 'vitest';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { Obj } from '@dxos/echo';
|
|
9
|
+
import type { ObjectId } from '@dxos/keys';
|
|
10
|
+
import { DataType } from '@dxos/schema';
|
|
9
11
|
|
|
10
12
|
import { SerializationModel, DocumentAdapter, type ChunkRenderer } from './model';
|
|
11
13
|
|
|
@@ -30,8 +32,7 @@ describe('SerializationModel', () => {
|
|
|
30
32
|
expect(model.doc.toString()).to.eq('');
|
|
31
33
|
|
|
32
34
|
// Create message.
|
|
33
|
-
const message
|
|
34
|
-
id: '1',
|
|
35
|
+
const message = Obj.make(DataType.Message, {
|
|
35
36
|
created: createDate(),
|
|
36
37
|
sender: { name: 'Alice' },
|
|
37
38
|
blocks: [
|
|
@@ -41,7 +42,7 @@ describe('SerializationModel', () => {
|
|
|
41
42
|
text: 'Hello world!',
|
|
42
43
|
},
|
|
43
44
|
],
|
|
44
|
-
};
|
|
45
|
+
});
|
|
45
46
|
model.appendChunk(message);
|
|
46
47
|
{
|
|
47
48
|
const text = model.doc.toString();
|
|
@@ -68,8 +69,7 @@ describe('SerializationModel', () => {
|
|
|
68
69
|
|
|
69
70
|
// Append message.
|
|
70
71
|
{
|
|
71
|
-
const message
|
|
72
|
-
id: '1',
|
|
72
|
+
const message = Obj.make(DataType.Message, {
|
|
73
73
|
created: createDate(),
|
|
74
74
|
sender: { name: 'Alice' },
|
|
75
75
|
blocks: [
|
|
@@ -79,7 +79,7 @@ describe('SerializationModel', () => {
|
|
|
79
79
|
text: 'Hello world!',
|
|
80
80
|
},
|
|
81
81
|
],
|
|
82
|
-
};
|
|
82
|
+
});
|
|
83
83
|
model.appendChunk(message);
|
|
84
84
|
model.sync(adapter);
|
|
85
85
|
expect(view.state.doc.toString()).to.eq('###### Alice\nHello world!\n\n');
|
|
@@ -87,8 +87,7 @@ describe('SerializationModel', () => {
|
|
|
87
87
|
|
|
88
88
|
// Append message.
|
|
89
89
|
{
|
|
90
|
-
const message
|
|
91
|
-
id: '2',
|
|
90
|
+
const message = Obj.make(DataType.Message, {
|
|
92
91
|
created: createDate(),
|
|
93
92
|
sender: { name: 'Bob' },
|
|
94
93
|
blocks: [
|
|
@@ -98,7 +97,7 @@ describe('SerializationModel', () => {
|
|
|
98
97
|
text: 'Hello world!',
|
|
99
98
|
},
|
|
100
99
|
],
|
|
101
|
-
};
|
|
100
|
+
});
|
|
102
101
|
model.appendChunk(message);
|
|
103
102
|
model.sync(adapter);
|
|
104
103
|
expect(view.state.doc.toString()).to.eq('###### Alice\nHello world!\n\n###### Bob\nHello world!\n\n');
|
|
@@ -111,10 +110,11 @@ describe('SerializationModel', () => {
|
|
|
111
110
|
const adapter = new DocumentAdapter(view);
|
|
112
111
|
expect(adapter.lineCount()).to.eq(0);
|
|
113
112
|
|
|
113
|
+
let msgId: ObjectId;
|
|
114
|
+
|
|
114
115
|
// Append message.
|
|
115
116
|
{
|
|
116
|
-
const message
|
|
117
|
-
id: '1',
|
|
117
|
+
const message = Obj.make(DataType.Message, {
|
|
118
118
|
created: createDate(),
|
|
119
119
|
sender: { name: 'Alice' },
|
|
120
120
|
blocks: [
|
|
@@ -124,7 +124,8 @@ describe('SerializationModel', () => {
|
|
|
124
124
|
text: 'Hello world!',
|
|
125
125
|
},
|
|
126
126
|
],
|
|
127
|
-
};
|
|
127
|
+
});
|
|
128
|
+
msgId = message.id;
|
|
128
129
|
model.appendChunk(message);
|
|
129
130
|
model.sync(adapter);
|
|
130
131
|
expect(view.state.doc.toString()).to.eq('###### Alice\nHello world!\n\n');
|
|
@@ -146,12 +147,11 @@ describe('SerializationModel', () => {
|
|
|
146
147
|
|
|
147
148
|
// Append message.
|
|
148
149
|
{
|
|
149
|
-
const message
|
|
150
|
-
id: '2',
|
|
150
|
+
const message = Obj.make(DataType.Message, {
|
|
151
151
|
created: createDate(),
|
|
152
152
|
sender: { name: 'Bob' },
|
|
153
153
|
blocks: [{ type: 'transcription', started: createDate(), text: 'Hello again!' }],
|
|
154
|
-
};
|
|
154
|
+
});
|
|
155
155
|
model.appendChunk(message);
|
|
156
156
|
model.sync(adapter);
|
|
157
157
|
expect(view.state.doc.toString()).to.eq('###### Alice\nHello again!\n\n###### Bob\nHello again!\n\n');
|
|
@@ -161,7 +161,7 @@ describe('SerializationModel', () => {
|
|
|
161
161
|
|
|
162
162
|
// Delete block.
|
|
163
163
|
{
|
|
164
|
-
model.deleteBlock(
|
|
164
|
+
model.deleteBlock(msgId);
|
|
165
165
|
model.sync(adapter);
|
|
166
166
|
expect(view.state.doc.toString()).to.eq('###### Bob\nHello again!\n\n');
|
|
167
167
|
}
|
|
@@ -103,6 +103,6 @@ export class MessageNormalizer extends Resource {
|
|
|
103
103
|
log.info('writing messages', { messages });
|
|
104
104
|
const lastMessage = messages[messages.length - 1];
|
|
105
105
|
this._cursor.timestamp = lastMessage.created;
|
|
106
|
-
this._queue.append(messages);
|
|
106
|
+
void this._queue.append(messages);
|
|
107
107
|
}
|
|
108
108
|
}
|
|
@@ -5,16 +5,16 @@
|
|
|
5
5
|
import { effect } from '@preact/signals-core';
|
|
6
6
|
import { describe, test } from 'vitest';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { EdgeAiServiceClient, OllamaAiServiceClient } from '@dxos/ai';
|
|
9
9
|
import { AI_SERVICE_ENDPOINT } from '@dxos/ai/testing';
|
|
10
10
|
import { scheduleTaskInterval } from '@dxos/async';
|
|
11
11
|
import { Context } from '@dxos/context';
|
|
12
|
-
import {
|
|
12
|
+
import { Obj } from '@dxos/echo';
|
|
13
13
|
import { MemoryQueue } from '@dxos/echo-db';
|
|
14
14
|
import { createQueueDXN } from '@dxos/echo-schema';
|
|
15
15
|
import { FunctionExecutor, ServiceContainer } from '@dxos/functions';
|
|
16
16
|
import { log } from '@dxos/log';
|
|
17
|
-
import {
|
|
17
|
+
import { DataType } from '@dxos/schema';
|
|
18
18
|
|
|
19
19
|
import { MessageNormalizer } from './message-normalizer';
|
|
20
20
|
import { type MessageWithRangeId, sentenceNormalization } from './normalization';
|
|
@@ -49,13 +49,14 @@ const messages: MessageWithRangeId[] = [
|
|
|
49
49
|
|
|
50
50
|
// No punctuation.
|
|
51
51
|
'in classical physics objects have well-defined properties such as position speed and momentum',
|
|
52
|
-
].map((string, index) =>
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
})
|
|
52
|
+
].map((string, index) =>
|
|
53
|
+
Obj.make(DataType.Message, {
|
|
54
|
+
created: new Date(Date.now() + 1000 * index).toISOString(),
|
|
55
|
+
sender,
|
|
56
|
+
blocks: [{ type: 'transcription', started: new Date(Date.now() + 1000 * index).toISOString(), text: string }],
|
|
57
|
+
rangeId: [],
|
|
58
|
+
} as any),
|
|
59
|
+
);
|
|
59
60
|
|
|
60
61
|
const REMOTE_AI = true;
|
|
61
62
|
|
|
@@ -65,13 +66,13 @@ describe.skip('SentenceNormalization', () => {
|
|
|
65
66
|
new ServiceContainer().setServices({
|
|
66
67
|
ai: {
|
|
67
68
|
client: REMOTE_AI
|
|
68
|
-
? new
|
|
69
|
+
? new EdgeAiServiceClient({
|
|
69
70
|
endpoint: AI_SERVICE_ENDPOINT.REMOTE,
|
|
70
71
|
defaultGenerationOptions: {
|
|
71
72
|
model: '@anthropic/claude-3-5-sonnet-20241022',
|
|
72
73
|
},
|
|
73
74
|
})
|
|
74
|
-
: new
|
|
75
|
+
: new OllamaAiServiceClient({
|
|
75
76
|
overrides: {
|
|
76
77
|
model: 'llama3.1:8b',
|
|
77
78
|
},
|
|
@@ -4,8 +4,9 @@
|
|
|
4
4
|
|
|
5
5
|
import { Schema } from 'effect';
|
|
6
6
|
|
|
7
|
-
import { DEFAULT_EDGE_MODEL } from '@dxos/ai';
|
|
7
|
+
import { DEFAULT_EDGE_MODEL, Message } from '@dxos/ai';
|
|
8
8
|
import { AISession } from '@dxos/assistant';
|
|
9
|
+
import { Obj } from '@dxos/echo';
|
|
9
10
|
import { AiService, defineFunction } from '@dxos/functions';
|
|
10
11
|
import { ObjectId } from '@dxos/keys';
|
|
11
12
|
import { log } from '@dxos/log';
|
|
@@ -29,12 +30,14 @@ export const NormalizationInput = Schema.Struct({
|
|
|
29
30
|
description: 'Messages to normalize into sentences.',
|
|
30
31
|
}),
|
|
31
32
|
});
|
|
33
|
+
export interface NormalizationInput extends Schema.Schema.Type<typeof NormalizationInput> {}
|
|
32
34
|
|
|
33
35
|
export const NormalizationOutput = Schema.Struct({
|
|
34
36
|
sentences: Schema.Array(MessageWithRangeId.pipe(Schema.mutable)).pipe(Schema.mutable).annotations({
|
|
35
37
|
description: 'The sentences of the transcript.',
|
|
36
38
|
}),
|
|
37
39
|
});
|
|
40
|
+
export interface NormalizationOutput extends Schema.Schema.Type<typeof NormalizationOutput> {}
|
|
38
41
|
|
|
39
42
|
const prompt = `
|
|
40
43
|
You are observing a real-time transcript of a single person speaking.
|
|
@@ -70,7 +73,7 @@ The transcription is delivered in chunks of 10 seconds or less. As a result, ind
|
|
|
70
73
|
- Do not add or remove any words or phrases.
|
|
71
74
|
`;
|
|
72
75
|
|
|
73
|
-
export const sentenceNormalization = defineFunction({
|
|
76
|
+
export const sentenceNormalization = defineFunction<NormalizationInput, NormalizationOutput>({
|
|
74
77
|
description: 'Post process of transcription for sentence normalization',
|
|
75
78
|
inputSchema: NormalizationInput,
|
|
76
79
|
outputSchema: NormalizationOutput,
|
|
@@ -85,11 +88,10 @@ export const sentenceNormalization = defineFunction({
|
|
|
85
88
|
tools: [],
|
|
86
89
|
artifacts: [],
|
|
87
90
|
history: [
|
|
88
|
-
{
|
|
89
|
-
id: ObjectId.random(),
|
|
91
|
+
Obj.make(Message, {
|
|
90
92
|
role: 'user',
|
|
91
|
-
content: messages.map((message) => ({ type: 'text', text: JSON.stringify(message) })),
|
|
92
|
-
},
|
|
93
|
+
content: messages.map((message) => ({ type: 'text', text: JSON.stringify(message) }) as const),
|
|
94
|
+
}),
|
|
93
95
|
],
|
|
94
96
|
prompt,
|
|
95
97
|
});
|
package/src/testing/testing.ts
CHANGED
|
@@ -5,13 +5,13 @@
|
|
|
5
5
|
import { Schema } from 'effect';
|
|
6
6
|
import { useEffect, useMemo, useState } from 'react';
|
|
7
7
|
|
|
8
|
-
import {
|
|
8
|
+
import { EdgeAiServiceClient } from '@dxos/ai';
|
|
9
9
|
import { AI_SERVICE_ENDPOINT } from '@dxos/ai/testing';
|
|
10
10
|
import { extractionAnthropicFn, processTranscriptMessage } from '@dxos/assistant';
|
|
11
11
|
import { scheduleTaskInterval } from '@dxos/async';
|
|
12
12
|
import { Filter, type Queue } from '@dxos/client/echo';
|
|
13
13
|
import { Context } from '@dxos/context';
|
|
14
|
-
import { Key, Obj, Ref, Type } from '@dxos/echo';
|
|
14
|
+
import { type Key, Obj, Ref, Type } from '@dxos/echo';
|
|
15
15
|
import { createQueueDXN } from '@dxos/echo-schema';
|
|
16
16
|
import { FunctionExecutor, ServiceContainer } from '@dxos/functions';
|
|
17
17
|
import { IdentityDid } from '@dxos/keys';
|
|
@@ -62,12 +62,11 @@ export class MessageBuilder extends AbstractMessageBuilder {
|
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
override async createMessage(numSegments = 1): Promise<DataType.Message> {
|
|
65
|
-
return {
|
|
66
|
-
id: Key.ObjectId.random().toString(),
|
|
65
|
+
return Obj.make(DataType.Message, {
|
|
67
66
|
created: this.next().toISOString(),
|
|
68
67
|
sender: faker.helpers.arrayElement(this.users),
|
|
69
68
|
blocks: Array.from({ length: numSegments }).map(() => this.createBlock()),
|
|
70
|
-
};
|
|
69
|
+
});
|
|
71
70
|
}
|
|
72
71
|
|
|
73
72
|
createBlock(): DataType.MessageBlock.Transcription {
|
|
@@ -96,11 +95,11 @@ export class MessageBuilder extends AbstractMessageBuilder {
|
|
|
96
95
|
|
|
97
96
|
// TODO(burdon): Reconcile with BlockBuilder.
|
|
98
97
|
class EntityExtractionMessageBuilder extends AbstractMessageBuilder {
|
|
99
|
-
|
|
98
|
+
AiService = new EdgeAiServiceClient({
|
|
100
99
|
endpoint: AI_SERVICE_ENDPOINT.REMOTE,
|
|
101
100
|
});
|
|
102
101
|
|
|
103
|
-
executor = new FunctionExecutor(new ServiceContainer().setServices({ ai: { client: this.
|
|
102
|
+
executor = new FunctionExecutor(new ServiceContainer().setServices({ ai: { client: this.AiService } }));
|
|
104
103
|
|
|
105
104
|
space: Space | undefined;
|
|
106
105
|
currentMessage: number = 0;
|
|
@@ -165,8 +164,8 @@ export const useTestTranscriptionQueue: UseTestTranscriptionQueue = (
|
|
|
165
164
|
}
|
|
166
165
|
|
|
167
166
|
const i = setInterval(() => {
|
|
168
|
-
void builder.createMessage(Math.ceil(Math.random() * 3)).then((message) => {
|
|
169
|
-
queue.append([Obj.make(DataType.Message, message)]);
|
|
167
|
+
void builder.createMessage(Math.ceil(Math.random() * 3)).then(async (message) => {
|
|
168
|
+
await queue.append([Obj.make(DataType.Message, message)]);
|
|
170
169
|
});
|
|
171
170
|
}, interval);
|
|
172
171
|
return () => clearInterval(i);
|
|
@@ -204,7 +203,7 @@ export const useTestTranscriptionQueueWithEntityExtraction: UseTestTranscription
|
|
|
204
203
|
ctx,
|
|
205
204
|
async () => {
|
|
206
205
|
const message = await builder.createMessage();
|
|
207
|
-
queue.append([Obj.make(DataType.Message, message)]);
|
|
206
|
+
void queue.append([Obj.make(DataType.Message, message)]);
|
|
208
207
|
},
|
|
209
208
|
interval,
|
|
210
209
|
);
|
|
@@ -136,7 +136,7 @@ export class TranscriptionManager extends Resource {
|
|
|
136
136
|
blocks: [{ type: 'transcription', text: 'Started', started: new Date().toISOString() }],
|
|
137
137
|
sender: { role: 'assistant' },
|
|
138
138
|
});
|
|
139
|
-
this._queue?.append([block]);
|
|
139
|
+
await this._queue?.append([block]);
|
|
140
140
|
} else {
|
|
141
141
|
await this._transcriber?.close();
|
|
142
142
|
const block = Obj.make(DataType.Message, {
|
|
@@ -144,7 +144,7 @@ export class TranscriptionManager extends Resource {
|
|
|
144
144
|
blocks: [{ type: 'transcription', text: 'Stopped', started: new Date().toISOString() }],
|
|
145
145
|
sender: { role: 'assistant' },
|
|
146
146
|
});
|
|
147
|
-
this._queue?.append([block]);
|
|
147
|
+
await this._queue?.append([block]);
|
|
148
148
|
}
|
|
149
149
|
}
|
|
150
150
|
|
|
@@ -190,6 +190,6 @@ export class TranscriptionManager extends Resource {
|
|
|
190
190
|
block = await this._messageEnricher(block);
|
|
191
191
|
}
|
|
192
192
|
|
|
193
|
-
this._queue.append([block]);
|
|
193
|
+
await this._queue.append([block]);
|
|
194
194
|
}
|
|
195
195
|
}
|
package/src/translations.ts
CHANGED
|
@@ -3,15 +3,10 @@
|
|
|
3
3
|
//
|
|
4
4
|
|
|
5
5
|
import { TRANSCRIPTION_PLUGIN } from './meta';
|
|
6
|
-
import { TranscriptType } from './types';
|
|
7
6
|
|
|
8
7
|
export default [
|
|
9
8
|
{
|
|
10
9
|
'en-US': {
|
|
11
|
-
[TranscriptType.typename]: {
|
|
12
|
-
'typename label': 'Transcript',
|
|
13
|
-
'object name placeholder': 'New transcript',
|
|
14
|
-
},
|
|
15
10
|
[TRANSCRIPTION_PLUGIN]: {
|
|
16
11
|
'plugin name': 'Transcription',
|
|
17
12
|
'transcript companion label': 'Transcript',
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
/package/dist/lib/node-esm/{react-surface-ZB7Y2YF7.mjs.map → react-surface-JGQSYGRR.mjs.map}
RENAMED
|
File without changes
|
|
File without changes
|