mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-18 15:55:59 +01:00
Move hook execution to extension (#294215)
* Refactor hook execution * Fix compilation: add IExtHostHooks import, remove unused IHookResult, inline ChatRequestHooks type * Move hooks property to chatHooks proposal, sync DTS * cleanup * Remove dead hook execution code: proxy, RPC, output channel, progress events All hook execution now happens in the extension via NodeHookExecutor. HooksExecutionService is now a pure registry (registerHooks/getHooksForSession). Removed: - executeHook, setProxy, onDidHookProgress from service - IHooksExecutionProxy, IHookProgressEvent, HookAbortError, formatHookErrorMessage - hooksCommandTypes.ts, hooksTypes.ts (dead type files) - mainThreadHooks proxy setup - extHostHooksNode., extHostHooksWorker. - ExtHostHooksShape. protocol - IExtHostHooks DI registrations - ChatHooksProgressContribution - All associated test files * Remove HooksExecutionService entirely The service was only a registry for session hooks, but hooks are already passed directly on the chat request DTO. The registerHooks/getHooksForSession pattern was redundant. * Restore modelName support in chatSubagentContentPart that was accidentally removed during merge * Revert unrelated tabIndex change on chatSubagentContentPart * Remove empty hooks ext host infrastructure Delete IExtHostHooks, NodeExtHostHooks, WorkerExtHostHooks, MainThreadHooks, ExtHostHooksShape, MainThreadHooksShape - all were empty stubs after hook execution moved to extension. * Remove mainThreadHooks import from extensionHost.contribution * Fix DTS comments: env and timeoutSec are values, not implementation promises
This commit is contained in:
@@ -65,7 +65,6 @@ import { IExtHostConsumerFileSystem } from './extHostFileSystemConsumer.js';
|
||||
import { ExtHostFileSystemEventService, FileSystemWatcherCreateOptions } from './extHostFileSystemEventService.js';
|
||||
import { IExtHostFileSystemInfo } from './extHostFileSystemInfo.js';
|
||||
import { IExtHostInitDataService } from './extHostInitDataService.js';
|
||||
import { IExtHostHooks } from './extHostHooks.js';
|
||||
import { ExtHostInteractive } from './extHostInteractive.js';
|
||||
import { ExtHostLabelService } from './extHostLabelService.js';
|
||||
import { ExtHostLanguageFeatures } from './extHostLanguageFeatures.js';
|
||||
@@ -245,7 +244,6 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
|
||||
const extHostEmbeddings = rpcProtocol.set(ExtHostContext.ExtHostEmbeddings, new ExtHostEmbeddings(rpcProtocol));
|
||||
|
||||
rpcProtocol.set(ExtHostContext.ExtHostMcp, accessor.get(IExtHostMpcService));
|
||||
rpcProtocol.set(ExtHostContext.ExtHostHooks, accessor.get(IExtHostHooks));
|
||||
|
||||
// Check that no named customers are missing
|
||||
const expected = Object.values<ProxyIdentifier<any>>(ExtHostContext);
|
||||
@@ -257,7 +255,6 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
|
||||
const extHostMessageService = new ExtHostMessageService(rpcProtocol, extHostLogService);
|
||||
const extHostDialogs = new ExtHostDialogs(rpcProtocol);
|
||||
const extHostChatStatus = new ExtHostChatStatus(rpcProtocol);
|
||||
const extHostHooks = accessor.get(IExtHostHooks);
|
||||
|
||||
// Register API-ish commands
|
||||
ExtHostApiCommands.register(extHostCommands);
|
||||
@@ -1661,10 +1658,6 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I
|
||||
checkProposedApiEnabled(extension, 'chatPromptFiles');
|
||||
return extHostChatAgents2.registerPromptFileProvider(extension, PromptsType.skill, provider);
|
||||
},
|
||||
async executeHook(hookType: vscode.ChatHookType, options: vscode.ChatHookExecutionOptions, token?: vscode.CancellationToken): Promise<vscode.ChatHookResult[]> {
|
||||
checkProposedApiEnabled(extension, 'chatHooks');
|
||||
return extHostHooks.executeHook(hookType, options, token);
|
||||
},
|
||||
};
|
||||
|
||||
// namespace: lm
|
||||
|
||||
Reference in New Issue
Block a user