Merge pull request #256378 from microsoft/osortega/session-provider

Chat session provider
This commit is contained in:
Osvaldo Ortega
2025-07-17 14:53:12 -07:00
committed by GitHub
9 changed files with 257 additions and 1 deletions

View File

@@ -112,6 +112,7 @@ import { ExtHostWebviewViews } from './extHostWebviewView.js';
import { IExtHostWindow } from './extHostWindow.js';
import { IExtHostWorkspace } from './extHostWorkspace.js';
import { ExtHostAiSettingsSearch } from './extHostAiSettingsSearch.js';
import { IExtHostChatSessions } from './extHostChatSessions.js';
export interface IExtensionRegistries {
mine: ExtensionDescriptionRegistry;
@@ -153,6 +154,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
const extHostLanguageModels = accessor.get(IExtHostLanguageModels);
const extHostMcp = accessor.get(IExtHostMpcService);
const extHostDataChannels = accessor.get(IExtHostDataChannels);
const extHostChatSessions = accessor.get(IExtHostChatSessions);
// register addressable instances
rpcProtocol.set(ExtHostContext.ExtHostFileSystemInfo, extHostFileSystemInfo);
@@ -172,6 +174,7 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
rpcProtocol.set(ExtHostContext.ExtHostAuthentication, extHostAuthentication);
rpcProtocol.set(ExtHostContext.ExtHostChatProvider, extHostLanguageModels);
rpcProtocol.set(ExtHostContext.ExtHostDataChannels, extHostDataChannels);
rpcProtocol.set(ExtHostContext.ExtHostChatSessions, extHostChatSessions);
// automatically create and register addressable instances
const extHostDecorations = rpcProtocol.set(ExtHostContext.ExtHostDecorations, accessor.get(IExtHostDecorations));
@@ -1501,7 +1504,11 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
onDidDisposeChatSession: (listeners, thisArgs?, disposables?) => {
checkProposedApiEnabled(extension, 'chatParticipantPrivate');
return _asExtensionEvent(extHostChatAgents2.onDidDisposeChatSession)(listeners, thisArgs, disposables);
}
},
registerChatSessionsProvider(provider: vscode.ChatSessionsProvider) {
checkProposedApiEnabled(extension, 'chatSessionsProvider');
return extHostChatSessions.registerChatSessionsProvider(provider);
},
};
// namespace: lm