speech - core service and extension API (#195365)

* speech - scaffold a basic core service for registration

* speech - scaffold a basic extension API for speech providers

* cleanup

* speech - improve API to work with events

* simplify

* better api

* cleanup
This commit is contained in:
Benjamin Pasero
2023-10-12 14:53:01 +02:00
committed by GitHub
parent 4dce9d5ad4
commit 7a03774b96
12 changed files with 308 additions and 1 deletions

View File

@@ -104,6 +104,7 @@ import { ExtHostIssueReporter } from 'vs/workbench/api/common/extHostIssueReport
import { IExtHostManagedSockets } from 'vs/workbench/api/common/extHostManagedSockets';
import { ExtHostShare } from 'vs/workbench/api/common/extHostShare';
import { ExtHostChatProvider } from 'vs/workbench/api/common/extHostChatProvider';
import { ExtHostSpeech } from 'vs/workbench/api/common/extHostSpeech';
import { ExtHostChatVariables } from 'vs/workbench/api/common/extHostChatVariables';
import { ExtHostRelatedInformation } from 'vs/workbench/api/common/extHostAiRelatedInformation';
import { ExtHostAiEmbeddingVector } from 'vs/workbench/api/common/extHostEmbeddingVector';
@@ -217,6 +218,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
const extHostAiEmbeddingVector = rpcProtocol.set(ExtHostContext.ExtHostAiEmbeddingVector, new ExtHostAiEmbeddingVector(rpcProtocol));
const extHostIssueReporter = rpcProtocol.set(ExtHostContext.ExtHostIssueReporter, new ExtHostIssueReporter(rpcProtocol));
const extHostStatusBar = rpcProtocol.set(ExtHostContext.ExtHostStatusBar, new ExtHostStatusBar(rpcProtocol, extHostCommands.converter));
const extHostSpeech = rpcProtocol.set(ExtHostContext.ExtHostSpeech, new ExtHostSpeech(rpcProtocol));
// Check that no named customers are missing
const expected = Object.values<ProxyIdentifier<any>>(ExtHostContext);
@@ -1378,6 +1380,14 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
}
};
// namespace: speech
const speech: typeof vscode.speech = {
registerSpeechProvider(id: string, provider: vscode.SpeechProvider) {
checkProposedApiEnabled(extension, 'speech');
return extHostSpeech.registerProvider(extension.identifier, id, provider);
}
};
return <typeof vscode>{
version: initData.version,
// namespaces
@@ -1394,6 +1404,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
languages,
notebooks,
scm,
speech,
tasks,
tests,
window,
@@ -1593,7 +1604,8 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
InteractiveEditorResponseFeedbackKind: extHostTypes.InteractiveEditorResponseFeedbackKind,
StackFrameFocus: extHostTypes.StackFrameFocus,
ThreadFocus: extHostTypes.ThreadFocus,
RelatedInformationType: extHostTypes.RelatedInformationType
RelatedInformationType: extHostTypes.RelatedInformationType,
SpeechToTextStatus: extHostTypes.SpeechToTextStatus
};
};
}