This commit is contained in:
Johannes
2023-07-14 17:36:58 +02:00
parent dc142e4cd1
commit f21001c1fe
15 changed files with 731 additions and 1 deletions

View File

@@ -104,6 +104,8 @@ import { ExtHostSemanticSimilarity } from 'vs/workbench/api/common/extHostSemant
import { ExtHostIssueReporter } from 'vs/workbench/api/common/extHostIssueReporter';
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 { ExtHostChatSlashCommands } from 'vs/workbench/api/common/extHostChatSlashCommand';
export interface IExtensionRegistries {
mine: ExtensionDescriptionRegistry;
@@ -203,6 +205,8 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
const extHostProfileContentHandlers = rpcProtocol.set(ExtHostContext.ExtHostProfileContentHandlers, new ExtHostProfileContentHandlers(rpcProtocol));
rpcProtocol.set(ExtHostContext.ExtHostInteractive, new ExtHostInteractive(rpcProtocol, extHostNotebook, extHostDocumentsAndEditors, extHostCommands, extHostLogService));
const extHostInteractiveEditor = rpcProtocol.set(ExtHostContext.ExtHostInlineChat, new ExtHostInteractiveEditor(rpcProtocol, extHostCommands, extHostDocuments, extHostLogService));
const extHostChatProvider = rpcProtocol.set(ExtHostContext.ExtHostChatProvider, new ExtHostChatProvider(rpcProtocol, extHostLogService));
const extHostChatSlashCommands = rpcProtocol.set(ExtHostContext.ExtHostChatSlashCommands, new ExtHostChatSlashCommands(rpcProtocol, extHostChatProvider, extHostLogService));
const extHostChat = rpcProtocol.set(ExtHostContext.ExtHostChat, new ExtHostChat(rpcProtocol, extHostLogService));
const extHostSemanticSimilarity = rpcProtocol.set(ExtHostContext.ExtHostSemanticSimilarity, new ExtHostSemanticSimilarity(rpcProtocol));
const extHostIssueReporter = rpcProtocol.set(ExtHostContext.ExtHostIssueReporter, new ExtHostIssueReporter(rpcProtocol));
@@ -1324,6 +1328,18 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
}
};
// namespace: llm
const llm: typeof vscode.llm = {
registerChatResponseProvider(provider: vscode.ChatResponseProvider, metadata: vscode.ChatResponseProviderMetadata) {
checkProposedApiEnabled(extension, 'chatProvider');
return extHostChatProvider.registerProvider(extension.identifier, provider, metadata);
},
registerSlashCommand(name: string, command: vscode.SlashCommand) {
checkProposedApiEnabled(extension, 'chatSlashCommands');
return extHostChatSlashCommands.registerCommand(extension.identifier, name, command);
}
};
return <typeof vscode>{
version: initData.version,
// namespaces
@@ -1337,6 +1353,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
interactive,
interactiveSlashCommands,
l10n,
llm,
languages,
notebooks,
scm,
@@ -1347,6 +1364,8 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
// types
Breakpoint: extHostTypes.Breakpoint,
TerminalOutputAnchor: extHostTypes.TerminalOutputAnchor,
ChatMessage: extHostTypes.ChatMessage,
ChatMessageRole: extHostTypes.ChatMessageRole,
CallHierarchyIncomingCall: extHostTypes.CallHierarchyIncomingCall,
CallHierarchyItem: extHostTypes.CallHierarchyItem,
CallHierarchyOutgoingCall: extHostTypes.CallHierarchyOutgoingCall,