@codingame/monaco-vscode-speech-service-override 36.2.7 → 37.0.0
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/index.js +4 -1
- package/package.json +2 -2
- package/vscode/src/vs/workbench/contrib/speech/browser/speechService.js +3 -3
- package/vscode/src/vs/workbench/services/localTranscription/browser/localTranscriptionService.d.ts +21 -0
- package/vscode/src/vs/workbench/services/localTranscription/browser/localTranscriptionService.js +32 -0
package/index.js
CHANGED
|
@@ -2,11 +2,14 @@
|
|
|
2
2
|
import { SyncDescriptor } from '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/descriptors';
|
|
3
3
|
import { ISpeechService } from '@codingame/monaco-vscode-api/vscode/vs/workbench/contrib/speech/common/speechService.service';
|
|
4
4
|
import { SpeechService } from './vscode/src/vs/workbench/contrib/speech/browser/speechService.js';
|
|
5
|
+
import { ILocalTranscriptionService } from '@codingame/monaco-vscode-api/vscode/vs/platform/localTranscription/common/localTranscription.service';
|
|
6
|
+
import { NullLocalTranscriptionService } from './vscode/src/vs/workbench/services/localTranscription/browser/localTranscriptionService.js';
|
|
5
7
|
import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/extensions';
|
|
6
8
|
|
|
7
9
|
function getServiceOverride() {
|
|
8
10
|
return {
|
|
9
|
-
[ISpeechService.toString()]: new SyncDescriptor(SpeechService, [], true)
|
|
11
|
+
[ISpeechService.toString()]: new SyncDescriptor(SpeechService, [], true),
|
|
12
|
+
[ILocalTranscriptionService.toString()]: new SyncDescriptor(NullLocalTranscriptionService, [], true)
|
|
10
13
|
};
|
|
11
14
|
}
|
|
12
15
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@codingame/monaco-vscode-speech-service-override",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "37.0.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"description": "VSCode public API plugged on the monaco editor - speech service-override",
|
|
6
6
|
"keywords": [],
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
},
|
|
16
16
|
"type": "module",
|
|
17
17
|
"dependencies": {
|
|
18
|
-
"@codingame/monaco-vscode-api": "
|
|
18
|
+
"@codingame/monaco-vscode-api": "37.0.0"
|
|
19
19
|
},
|
|
20
20
|
"main": "index.js",
|
|
21
21
|
"module": "index.js",
|
|
@@ -17,7 +17,7 @@ import { IExtensionService } from '@codingame/monaco-vscode-api/vscode/vs/workbe
|
|
|
17
17
|
const speechProvidersExtensionPoint = ExtensionsRegistry.registerExtensionPoint({
|
|
18
18
|
extensionPoint: "speechProviders",
|
|
19
19
|
jsonSchema: {
|
|
20
|
-
description: ( localize(
|
|
20
|
+
description: ( localize(16024, "Contributes a Speech Provider")),
|
|
21
21
|
type: "array",
|
|
22
22
|
items: {
|
|
23
23
|
additionalProperties: false,
|
|
@@ -31,11 +31,11 @@ const speechProvidersExtensionPoint = ExtensionsRegistry.registerExtensionPoint(
|
|
|
31
31
|
required: ["name"],
|
|
32
32
|
properties: {
|
|
33
33
|
name: {
|
|
34
|
-
description: ( localize(
|
|
34
|
+
description: ( localize(16025, "Unique name for this Speech Provider.")),
|
|
35
35
|
type: "string"
|
|
36
36
|
},
|
|
37
37
|
description: {
|
|
38
|
-
description: ( localize(
|
|
38
|
+
description: ( localize(16026, "A description of this Speech Provider, shown in the UI.")),
|
|
39
39
|
type: "string"
|
|
40
40
|
}
|
|
41
41
|
}
|
package/vscode/src/vs/workbench/services/localTranscription/browser/localTranscriptionService.d.ts
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Event } from "@codingame/monaco-vscode-api/vscode/vs/base/common/event";
|
|
2
|
+
import { VSBuffer } from "@codingame/monaco-vscode-api/vscode/vs/base/common/buffer";
|
|
3
|
+
import { ILocalTranscriptionModelStatus, ILocalTranscriptionResult } from "@codingame/monaco-vscode-api/vscode/vs/platform/localTranscription/common/localTranscription";
|
|
4
|
+
import { ILocalTranscriptionService } from "@codingame/monaco-vscode-api/vscode/vs/platform/localTranscription/common/localTranscription.service";
|
|
5
|
+
/**
|
|
6
|
+
* Web/no-op implementation: on-device transcription requires a utility process,
|
|
7
|
+
* which is not available on web. `isSupported` is false, so dictation is simply
|
|
8
|
+
* unavailable there — there is no cloud fallback (that transport was removed).
|
|
9
|
+
*/
|
|
10
|
+
export declare class NullLocalTranscriptionService implements ILocalTranscriptionService {
|
|
11
|
+
readonly _serviceBrand: undefined;
|
|
12
|
+
readonly isSupported = false;
|
|
13
|
+
readonly onDidChangeModelStatus: Event<ILocalTranscriptionModelStatus>;
|
|
14
|
+
readonly onDidTranscribe: Event<ILocalTranscriptionResult>;
|
|
15
|
+
getModelStatus(): Promise<ILocalTranscriptionModelStatus>;
|
|
16
|
+
importModel(): Promise<never>;
|
|
17
|
+
start(): Promise<void>;
|
|
18
|
+
pushAudio(_chunk: VSBuffer): Promise<void>;
|
|
19
|
+
stop(): Promise<string>;
|
|
20
|
+
cancel(): Promise<void>;
|
|
21
|
+
}
|
package/vscode/src/vs/workbench/services/localTranscription/browser/localTranscriptionService.js
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
|
|
2
|
+
import { Event } from '@codingame/monaco-vscode-api/vscode/vs/base/common/event';
|
|
3
|
+
import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/extensions';
|
|
4
|
+
import { LocalTranscriptionModelState } from '@codingame/monaco-vscode-api/vscode/vs/platform/localTranscription/common/localTranscription';
|
|
5
|
+
import '@codingame/monaco-vscode-api/vscode/vs/platform/instantiation/common/instantiation';
|
|
6
|
+
|
|
7
|
+
class NullLocalTranscriptionService {
|
|
8
|
+
constructor() {
|
|
9
|
+
this.isSupported = false;
|
|
10
|
+
this.onDidChangeModelStatus = Event.None;
|
|
11
|
+
this.onDidTranscribe = Event.None;
|
|
12
|
+
}
|
|
13
|
+
async getModelStatus() {
|
|
14
|
+
return {
|
|
15
|
+
state: LocalTranscriptionModelState.Error,
|
|
16
|
+
error: "unsupported"
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
async importModel() {
|
|
20
|
+
throw ( new Error("On-device transcription is not supported in this environment."));
|
|
21
|
+
}
|
|
22
|
+
async start() {
|
|
23
|
+
throw ( new Error("On-device transcription is not supported in this environment."));
|
|
24
|
+
}
|
|
25
|
+
async pushAudio(_chunk) {}
|
|
26
|
+
async stop() {
|
|
27
|
+
return "";
|
|
28
|
+
}
|
|
29
|
+
async cancel() {}
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export { NullLocalTranscriptionService };
|