mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-19 08:08:39 +01:00
Basic 'chat agent' API (#193152)
* Very basic chat agent API/UX * Add custom name/avatar, and restore them in persisted sessions * Show agent subcommands on the top level * Show editor decorations for subcommands * Fix unit tests * Implement unregister * Revert slash command content widget change, still used by inline editor * Remove content widget reference * Fix leaked disposable
This commit is contained in:
@@ -108,6 +108,7 @@ import { ExtHostChatSlashCommands } from 'vs/workbench/api/common/extHostChatSla
|
||||
import { ExtHostChatVariables } from 'vs/workbench/api/common/extHostChatVariables';
|
||||
import { ExtHostRelatedInformation } from 'vs/workbench/api/common/extHostAiRelatedInformation';
|
||||
import { ExtHostAiEmbeddingVector } from 'vs/workbench/api/common/extHostEmbeddingVector';
|
||||
import { ExtHostChatAgents } from 'vs/workbench/api/common/extHostChatAgents';
|
||||
|
||||
export interface IExtensionRegistries {
|
||||
mine: ExtensionDescriptionRegistry;
|
||||
@@ -209,6 +210,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
|
||||
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 extHostChatAgents = rpcProtocol.set(ExtHostContext.ExtHostChatAgents, new ExtHostChatAgents(rpcProtocol, extHostChatProvider, extHostLogService));
|
||||
const extHostChatVariables = rpcProtocol.set(ExtHostContext.ExtHostChatVariables, new ExtHostChatVariables(rpcProtocol));
|
||||
const extHostChat = rpcProtocol.set(ExtHostContext.ExtHostChat, new ExtHostChat(rpcProtocol, extHostLogService));
|
||||
const extHostAiRelatedInformation = rpcProtocol.set(ExtHostContext.ExtHostAiRelatedInformation, new ExtHostRelatedInformation(rpcProtocol));
|
||||
@@ -1360,7 +1362,12 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
|
||||
registerMappedEditsProvider(selector: vscode.DocumentSelector, provider: vscode.MappedEditsProvider) {
|
||||
checkProposedApiEnabled(extension, 'mappedEditsProvider');
|
||||
return extHostLanguageFeatures.registerMappedEditsProvider(extension, selector, provider);
|
||||
},
|
||||
registerAgent(name: string, agent: vscode.ChatAgent, metadata: vscode.ChatAgentMetadata) {
|
||||
checkProposedApiEnabled(extension, 'chatAgents');
|
||||
return extHostChatAgents.registerAgent(extension.identifier, name, agent, metadata);
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
return <typeof vscode>{
|
||||
|
||||
Reference in New Issue
Block a user