mirror of
https://github.com/microsoft/vscode.git
synced 2026-07-07 15:26:49 +01:00
Add languageModelToolsForAgent proposal (#243105)
To have a cleaner proposal to enable the tag for extensions to contribute tools to agent mode
This commit is contained in:
@@ -226,6 +226,9 @@ const _allApiProposals = {
|
||||
languageModelSystem: {
|
||||
proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageModelSystem.d.ts',
|
||||
},
|
||||
languageModelToolsForAgent: {
|
||||
proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageModelToolsForAgent.d.ts',
|
||||
},
|
||||
languageStatusText: {
|
||||
proposal: 'https://raw.githubusercontent.com/microsoft/vscode/main/src/vscode-dts/vscode.proposed.languageStatusText.d.ts',
|
||||
},
|
||||
|
||||
@@ -135,6 +135,8 @@ function toToolKey(extensionIdentifier: ExtensionIdentifier, toolName: string) {
|
||||
return `${extensionIdentifier.value}/${toolName}`;
|
||||
}
|
||||
|
||||
const CopilotAgentModeTag = 'vscode_editing';
|
||||
|
||||
export class LanguageModelToolsExtensionPointHandler implements IWorkbenchContribution {
|
||||
static readonly ID = 'workbench.contrib.toolsExtensionPointHandler';
|
||||
|
||||
@@ -167,7 +169,14 @@ export class LanguageModelToolsExtensionPointHandler implements IWorkbenchContri
|
||||
continue;
|
||||
}
|
||||
|
||||
if (rawTool.tags?.some(tag => tag.startsWith('copilot_') || tag.startsWith('vscode_')) && !isProposedApiEnabled(extension.description, 'chatParticipantPrivate')) {
|
||||
if (rawTool.tags?.includes(CopilotAgentModeTag)) {
|
||||
if (!isProposedApiEnabled(extension.description, 'languageModelToolsForAgent') && !isProposedApiEnabled(extension.description, 'chatParticipantPrivate')) {
|
||||
logService.error(`Extension '${extension.description.identifier.value}' CANNOT register tool with tag "${CopilotAgentModeTag}" without enabling 'languageModelToolsForAgent' proposal`);
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (rawTool.tags?.some(tag => tag !== CopilotAgentModeTag && (tag.startsWith('copilot_') || tag.startsWith('vscode_'))) && !isProposedApiEnabled(extension.description, 'chatParticipantPrivate')) {
|
||||
logService.error(`Extension '${extension.description.identifier.value}' CANNOT register tool with tags starting with "vscode_" or "copilot_"`);
|
||||
continue;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,8 @@
|
||||
/*---------------------------------------------------------------------------------------------
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
* Licensed under the MIT License. See License.txt in the project root for license information.
|
||||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
declare module 'vscode' {
|
||||
// Enables access to providing language model tools to agent mode
|
||||
}
|
||||
Reference in New Issue
Block a user