diff --git a/src/vs/workbench/api/common/extHost.api.impl.ts b/src/vs/workbench/api/common/extHost.api.impl.ts index 5e5d36fb8be..f9d72d68c2a 100644 --- a/src/vs/workbench/api/common/extHost.api.impl.ts +++ b/src/vs/workbench/api/common/extHost.api.impl.ts @@ -1871,7 +1871,6 @@ export function createApiFactoryAndRegisterActors(accessor: ServicesAccessor): I LanguageModelToolExtensionSource: extHostTypes.LanguageModelToolExtensionSource, LanguageModelToolMCPSource: extHostTypes.LanguageModelToolMCPSource, ExtendedLanguageModelToolResult: extHostTypes.ExtendedLanguageModelToolResult, - PreparedTerminalToolInvocation: extHostTypes.PreparedTerminalToolInvocation, LanguageModelChatToolMode: extHostTypes.LanguageModelChatToolMode, LanguageModelPromptTsxPart: extHostTypes.LanguageModelPromptTsxPart, NewSymbolName: extHostTypes.NewSymbolName, diff --git a/src/vs/workbench/api/common/extHostLanguageModelTools.ts b/src/vs/workbench/api/common/extHostLanguageModelTools.ts index 30ad980e881..1646f8ee1b9 100644 --- a/src/vs/workbench/api/common/extHostLanguageModelTools.ts +++ b/src/vs/workbench/api/common/extHostLanguageModelTools.ts @@ -184,10 +184,6 @@ export class ExtHostLanguageModelTools implements ExtHostLanguageModelToolsShape options.chatRequestId = dto.chatRequestId; options.chatInteractionId = dto.chatInteractionId; options.chatSessionId = dto.context?.sessionId; - - if (dto.toolSpecificData?.kind === 'terminal') { - options.terminalCommand = dto.toolSpecificData.command; - } } if (isProposedApiEnabled(item.extension, 'chatParticipantAdditions') && dto.modelId) { @@ -251,25 +247,7 @@ export class ExtHostLanguageModelTools implements ExtHostLanguageModelToolsShape chatSessionId: context.chatSessionId, chatInteractionId: context.chatInteractionId }; - if (isProposedApiEnabled(item.extension, 'chatParticipantPrivate') && item.tool.prepareInvocation2) { - const result = await item.tool.prepareInvocation2(options, token); - if (!result) { - return undefined; - } - - return { - confirmationMessages: result.confirmationMessages ? { - title: typeof result.confirmationMessages.title === 'string' ? result.confirmationMessages.title : typeConvert.MarkdownString.from(result.confirmationMessages.title), - message: typeof result.confirmationMessages.message === 'string' ? result.confirmationMessages.message : typeConvert.MarkdownString.from(result.confirmationMessages.message), - } : undefined, - toolSpecificData: { - kind: 'terminal', - language: result.language, - command: result.command, - }, - presentation: result.presentation - }; - } else if (item.tool.prepareInvocation) { + if (item.tool.prepareInvocation) { const result = await item.tool.prepareInvocation(options, token); if (!result) { return undefined; diff --git a/src/vs/workbench/api/common/extHostTypes.ts b/src/vs/workbench/api/common/extHostTypes.ts index ff7cee016ff..3939490ebe0 100644 --- a/src/vs/workbench/api/common/extHostTypes.ts +++ b/src/vs/workbench/api/common/extHostTypes.ts @@ -4839,15 +4839,6 @@ export class LanguageModelToolResultPart2 implements vscode.LanguageModelToolRes } } -export class PreparedTerminalToolInvocation { - constructor( - public readonly command: string, - public readonly language: string, - public readonly confirmationMessages?: vscode.LanguageModelToolConfirmationMessages, - public readonly presentation?: 'hidden' - ) { } -} - export enum ChatErrorLevel { Info = 0, Warning = 1, diff --git a/src/vs/workbench/contrib/chat/browser/chatAccessibilityProvider.ts b/src/vs/workbench/contrib/chat/browser/chatAccessibilityProvider.ts index 2b825c0efc5..956536dd152 100644 --- a/src/vs/workbench/contrib/chat/browser/chatAccessibilityProvider.ts +++ b/src/vs/workbench/contrib/chat/browser/chatAccessibilityProvider.ts @@ -28,8 +28,6 @@ export const getToolConfirmationAlert = (accessor: ServicesAccessor, toolInvocat let input = ''; if (v.toolSpecificData) { if (v.toolSpecificData.kind === 'terminal') { - input = v.toolSpecificData.command; - } else if (v.toolSpecificData.kind === 'terminal2') { input = v.toolSpecificData.commandLine.toolEdited ?? v.toolSpecificData.commandLine.original; } else if (v.toolSpecificData.kind === 'extensions') { input = JSON.stringify(v.toolSpecificData.extensions); diff --git a/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatTerminalMarkdownProgressPart.ts b/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatTerminalMarkdownProgressPart.ts index 9f3f5357fa4..06aa274a532 100644 --- a/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatTerminalMarkdownProgressPart.ts +++ b/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatTerminalMarkdownProgressPart.ts @@ -8,7 +8,7 @@ import { MarkdownString } from '../../../../../../base/common/htmlContent.js'; import { ThemeIcon } from '../../../../../../base/common/themables.js'; import { MarkdownRenderer } from '../../../../../../editor/browser/widget/markdownRenderer/browser/markdownRenderer.js'; import { IInstantiationService } from '../../../../../../platform/instantiation/common/instantiation.js'; -import { IChatMarkdownContent, IChatTerminalToolInvocationData, IChatToolInvocation, IChatToolInvocationSerialized, type IChatTerminalToolInvocationData2 } from '../../../common/chatService.js'; +import { IChatMarkdownContent, IChatToolInvocation, IChatToolInvocationSerialized, type IChatTerminalToolInvocationData } from '../../../common/chatService.js'; import { CodeBlockModelCollection } from '../../../common/codeBlockModelCollection.js'; import { IChatCodeBlockInfo } from '../../chat.js'; import { ICodeBlockRenderOptions } from '../../codeBlockPart.js'; @@ -27,7 +27,7 @@ export class ChatTerminalMarkdownProgressPart extends BaseChatToolInvocationSubP constructor( toolInvocation: IChatToolInvocation | IChatToolInvocationSerialized, - terminalData: IChatTerminalToolInvocationData | IChatTerminalToolInvocationData2, + terminalData: IChatTerminalToolInvocationData, context: IChatContentPartRenderContext, renderer: MarkdownRenderer, editorPool: EditorPool, @@ -38,9 +38,7 @@ export class ChatTerminalMarkdownProgressPart extends BaseChatToolInvocationSubP ) { super(toolInvocation); - const command = terminalData.kind === 'terminal' - ? terminalData.command - : terminalData.commandLine.userEdited ?? terminalData.commandLine.toolEdited ?? terminalData.commandLine.original; + const command = terminalData.commandLine.userEdited ?? terminalData.commandLine.toolEdited ?? terminalData.commandLine.original; const content = new MarkdownString(`\`\`\`${terminalData.language}\n${command}\n\`\`\``); const chatMarkdownContent: IChatMarkdownContent = { diff --git a/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatTerminalToolSubPart.ts b/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatTerminalToolSubPart.ts index 23a38a4a3e6..81901f92741 100644 --- a/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatTerminalToolSubPart.ts +++ b/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatTerminalToolSubPart.ts @@ -17,7 +17,7 @@ import { IContextKeyService } from '../../../../../../platform/contextkey/common import { IInstantiationService } from '../../../../../../platform/instantiation/common/instantiation.js'; import { IKeybindingService } from '../../../../../../platform/keybinding/common/keybinding.js'; import { ChatContextKeys } from '../../../common/chatContextKeys.js'; -import { IChatTerminalToolInvocationData, IChatToolInvocation, type IChatTerminalToolInvocationData2 } from '../../../common/chatService.js'; +import { IChatToolInvocation, type IChatTerminalToolInvocationData } from '../../../common/chatService.js'; import { CancelChatActionId } from '../../actions/chatExecuteActions.js'; import { AcceptToolConfirmationActionId } from '../../actions/chatToolActions.js'; import { IChatCodeBlockInfo, IChatWidgetService } from '../../chat.js'; @@ -33,7 +33,7 @@ export class TerminalConfirmationWidgetSubPart extends BaseChatToolInvocationSub constructor( toolInvocation: IChatToolInvocation, - terminalData: IChatTerminalToolInvocationData | IChatTerminalToolInvocationData2, + terminalData: IChatTerminalToolInvocationData, private readonly context: IChatContentPartRenderContext, private readonly renderer: MarkdownRenderer, private readonly editorPool: EditorPool, @@ -90,7 +90,7 @@ export class TerminalConfirmationWidgetSubPart extends BaseChatToolInvocationSub }; const langId = this.languageService.getLanguageIdByLanguageName(terminalData.language ?? 'sh') ?? 'shellscript'; const model = this.modelService.createModel( - terminalData.kind === 'terminal' ? terminalData.command : terminalData.commandLine.toolEdited ?? terminalData.commandLine.original, + terminalData.commandLine.toolEdited ?? terminalData.commandLine.original, this.languageService.createById(langId), this._getUniqueCodeBlockUri(), true @@ -122,11 +122,7 @@ export class TerminalConfirmationWidgetSubPart extends BaseChatToolInvocationSub this._onDidChangeHeight.fire(); })); this._register(model.onDidChangeContent(e => { - if (terminalData.kind === 'terminal') { - terminalData.command = model.getValue(); - } else { - terminalData.commandLine.userEdited = model.getValue(); - } + terminalData.commandLine.userEdited = model.getValue(); })); const element = dom.$(''); dom.append(element, editor.object.element); diff --git a/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolInvocationPart.ts b/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolInvocationPart.ts index 07d05bea268..5dd0d53a7a2 100644 --- a/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolInvocationPart.ts +++ b/src/vs/workbench/contrib/chat/browser/chatContentParts/toolInvocationParts/chatToolInvocationPart.ts @@ -89,7 +89,7 @@ export class ChatToolInvocationPart extends Disposable implements IChatContentPa return this.instantiationService.createInstance(ChatTaskListSubPart, this.toolInvocation, this.toolInvocation.toolSpecificData); } if (this.toolInvocation.confirmationMessages) { - if (this.toolInvocation.toolSpecificData?.kind === 'terminal' || this.toolInvocation.toolSpecificData?.kind === 'terminal2') { + if (this.toolInvocation.toolSpecificData?.kind === 'terminal') { return this.instantiationService.createInstance(TerminalConfirmationWidgetSubPart, this.toolInvocation, this.toolInvocation.toolSpecificData, this.context, this.renderer, this.editorPool, this.currentWidthDelegate, this.codeBlockStartIndex); } else { return this.instantiationService.createInstance(ToolConfirmationSubPart, this.toolInvocation, this.context, this.renderer, this.editorPool, this.currentWidthDelegate, this.codeBlockModelCollection, this.codeBlockStartIndex); @@ -97,7 +97,7 @@ export class ChatToolInvocationPart extends Disposable implements IChatContentPa } } - if (this.toolInvocation.toolSpecificData?.kind === 'terminal' || this.toolInvocation.toolSpecificData?.kind === 'terminal2') { + if (this.toolInvocation.toolSpecificData?.kind === 'terminal') { return this.instantiationService.createInstance(ChatTerminalMarkdownProgressPart, this.toolInvocation, this.toolInvocation.toolSpecificData, this.context, this.renderer, this.editorPool, this.currentWidthDelegate, this.codeBlockStartIndex, this.codeBlockModelCollection); } diff --git a/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.ts b/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.ts index 7473752df1f..b3e27d63203 100644 --- a/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.ts +++ b/src/vs/workbench/contrib/chat/browser/chatResponseAccessibleView.ts @@ -75,14 +75,12 @@ class ChatResponseAccessibleProvider extends Disposable implements IAccessibleVi let input = ''; if (toolInvocation.toolSpecificData) { input = toolInvocation.toolSpecificData?.kind === 'terminal' - ? toolInvocation.toolSpecificData.command - : toolInvocation.toolSpecificData?.kind === 'terminal2' - ? toolInvocation.toolSpecificData.commandLine.userEdited ?? toolInvocation.toolSpecificData.commandLine.toolEdited ?? toolInvocation.toolSpecificData.commandLine.original - : toolInvocation.toolSpecificData?.kind === 'extensions' - ? JSON.stringify(toolInvocation.toolSpecificData.extensions) - : toolInvocation.toolSpecificData?.kind === 'tasks' - ? JSON.stringify(toolInvocation.toolSpecificData.tasks) - : JSON.stringify(toolInvocation.toolSpecificData.rawInput); + ? toolInvocation.toolSpecificData.commandLine.userEdited ?? toolInvocation.toolSpecificData.commandLine.toolEdited ?? toolInvocation.toolSpecificData.commandLine.original + : toolInvocation.toolSpecificData?.kind === 'extensions' + ? JSON.stringify(toolInvocation.toolSpecificData.extensions) + : toolInvocation.toolSpecificData?.kind === 'tasks' + ? JSON.stringify(toolInvocation.toolSpecificData.tasks) + : JSON.stringify(toolInvocation.toolSpecificData.rawInput); } responseContent += `${title}`; if (input) { diff --git a/src/vs/workbench/contrib/chat/browser/languageModelToolsService.ts b/src/vs/workbench/contrib/chat/browser/languageModelToolsService.ts index ae32701d859..02a6bbb30c2 100644 --- a/src/vs/workbench/contrib/chat/browser/languageModelToolsService.ts +++ b/src/vs/workbench/contrib/chat/browser/languageModelToolsService.ts @@ -363,7 +363,7 @@ export class LanguageModelToolsService extends Disposable implements ILanguageMo : undefined; if (prepared?.confirmationMessages) { - if (prepared.toolSpecificData?.kind !== 'terminal' && prepared.toolSpecificData?.kind !== 'terminal2' && typeof prepared.confirmationMessages.allowAutoConfirm !== 'boolean') { + if (prepared.toolSpecificData?.kind !== 'terminal' && typeof prepared.confirmationMessages.allowAutoConfirm !== 'boolean') { prepared.confirmationMessages.allowAutoConfirm = true; } diff --git a/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.ts b/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.ts index b4a0ab16af8..59b161a5907 100644 --- a/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.ts +++ b/src/vs/workbench/contrib/chat/common/chatProgressTypes/chatToolInvocation.ts @@ -8,7 +8,7 @@ import { encodeBase64 } from '../../../../../base/common/buffer.js'; import { IMarkdownString } from '../../../../../base/common/htmlContent.js'; import { observableValue } from '../../../../../base/common/observable.js'; import { localize } from '../../../../../nls.js'; -import { IChatExtensionsContent, IChatTerminalToolInvocationData, IChatToolInputInvocationData, IChatTasksContent, IChatToolInvocation, IChatToolInvocationSerialized, type IChatTerminalToolInvocationData2 } from '../chatService.js'; +import { IChatExtensionsContent, IChatToolInputInvocationData, IChatTasksContent, IChatToolInvocation, IChatToolInvocationSerialized, type IChatTerminalToolInvocationData } from '../chatService.js'; import { IPreparedToolInvocation, isToolResultOutputDetails, IToolConfirmationMessages, IToolData, IToolProgressStep, IToolResult } from '../languageModelToolsService.js'; export class ChatToolInvocation implements IChatToolInvocation { @@ -46,7 +46,7 @@ export class ChatToolInvocation implements IChatToolInvocation { public readonly presentation: IPreparedToolInvocation['presentation']; public readonly toolId: string; - public readonly toolSpecificData?: IChatTerminalToolInvocationData | IChatTerminalToolInvocationData2 | IChatToolInputInvocationData | IChatExtensionsContent | IChatTasksContent; + public readonly toolSpecificData?: IChatTerminalToolInvocationData | IChatToolInputInvocationData | IChatExtensionsContent | IChatTasksContent; public readonly progress = observableValue<{ message?: string | IMarkdownString; progress: number }>(this, { progress: 0 }); diff --git a/src/vs/workbench/contrib/chat/common/chatService.ts b/src/vs/workbench/contrib/chat/common/chatService.ts index efeb26f2769..98f439c603d 100644 --- a/src/vs/workbench/contrib/chat/common/chatService.ts +++ b/src/vs/workbench/contrib/chat/common/chatService.ts @@ -242,12 +242,6 @@ export interface IChatElicitationRequest { export interface IChatTerminalToolInvocationData { kind: 'terminal'; - command: string; - language: string; -} - -export interface IChatTerminalToolInvocationData2 { - kind: 'terminal2'; commandLine: { original: string; userEdited?: string; @@ -263,7 +257,7 @@ export interface IChatToolInputInvocationData { export interface IChatToolInvocation { presentation: IPreparedToolInvocation['presentation']; - toolSpecificData?: IChatTerminalToolInvocationData | IChatTerminalToolInvocationData2 | IChatToolInputInvocationData | IChatExtensionsContent | IChatTasksContent; + toolSpecificData?: IChatTerminalToolInvocationData | IChatToolInputInvocationData | IChatExtensionsContent | IChatTasksContent; /** Presence of this property says that confirmation is required */ confirmationMessages?: IToolConfirmationMessages; confirmed: DeferredPromise; @@ -296,7 +290,7 @@ export interface IToolResultOutputDetailsSerialized { */ export interface IChatToolInvocationSerialized { presentation: IPreparedToolInvocation['presentation']; - toolSpecificData?: IChatTerminalToolInvocationData | IChatTerminalToolInvocationData2 | IChatToolInputInvocationData | IChatExtensionsContent | IChatTasksContent; + toolSpecificData?: IChatTerminalToolInvocationData | IChatToolInputInvocationData | IChatExtensionsContent | IChatTasksContent; invocationMessage: string | IMarkdownString; originMessage: string | IMarkdownString | undefined; pastTenseMessage: string | IMarkdownString | undefined; diff --git a/src/vs/workbench/contrib/chat/common/languageModelToolsService.ts b/src/vs/workbench/contrib/chat/common/languageModelToolsService.ts index c66fe8e5eae..4f92e938b75 100644 --- a/src/vs/workbench/contrib/chat/common/languageModelToolsService.ts +++ b/src/vs/workbench/contrib/chat/common/languageModelToolsService.ts @@ -16,7 +16,7 @@ import { ContextKeyExpression } from '../../../../platform/contextkey/common/con import { ExtensionIdentifier } from '../../../../platform/extensions/common/extensions.js'; import { createDecorator } from '../../../../platform/instantiation/common/instantiation.js'; import { IProgress } from '../../../../platform/progress/common/progress.js'; -import { IChatExtensionsContent, IChatTerminalToolInvocationData, IChatToolInputInvocationData, IChatTasksContent, type IChatTerminalToolInvocationData2 } from './chatService.js'; +import { IChatExtensionsContent, IChatToolInputInvocationData, IChatTasksContent, type IChatTerminalToolInvocationData } from './chatService.js'; import { PromptElementJSON, stringifyPromptElementJSON } from './tools/promptTsxTypes.js'; import { VSBuffer } from '../../../../base/common/buffer.js'; import { derived, IObservable, IReader, ITransaction, ObservableSet } from '../../../../base/common/observable.js'; @@ -113,7 +113,7 @@ export interface IToolInvocation { context: IToolInvocationContext | undefined; chatRequestId?: string; chatInteractionId?: string; - toolSpecificData?: IChatTerminalToolInvocationData | IChatTerminalToolInvocationData2 | IChatToolInputInvocationData | IChatExtensionsContent | IChatTasksContent; + toolSpecificData?: IChatTerminalToolInvocationData | IChatToolInputInvocationData | IChatExtensionsContent | IChatTasksContent; modelId?: string; } @@ -214,7 +214,7 @@ export interface IPreparedToolInvocation { originMessage?: string | IMarkdownString; confirmationMessages?: IToolConfirmationMessages; presentation?: 'hidden' | undefined; - toolSpecificData?: IChatTerminalToolInvocationData | IChatTerminalToolInvocationData2 | IChatToolInputInvocationData | IChatExtensionsContent | IChatTasksContent; + toolSpecificData?: IChatTerminalToolInvocationData | IChatToolInputInvocationData | IChatExtensionsContent | IChatTasksContent; } export interface IToolImpl { diff --git a/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalTool.ts b/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalTool.ts index 64f7401a24d..2310d9fd7d7 100644 --- a/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalTool.ts +++ b/src/vs/workbench/contrib/terminalContrib/chatAgentTools/browser/runInTerminalTool.ts @@ -21,7 +21,7 @@ import { TerminalCapability } from '../../../../../platform/terminal/common/capa import { ITerminalLogService } from '../../../../../platform/terminal/common/terminal.js'; import { IWorkspaceContextService } from '../../../../../platform/workspace/common/workspace.js'; import { IRemoteAgentService } from '../../../../services/remote/common/remoteAgentService.js'; -import { IChatService, type IChatTerminalToolInvocationData, type IChatTerminalToolInvocationData2 } from '../../../chat/common/chatService.js'; +import { IChatService, type IChatTerminalToolInvocationData } from '../../../chat/common/chatService.js'; import { CountTokensCallback, ILanguageModelToolsService, IPreparedToolInvocation, IToolData, IToolImpl, IToolInvocation, IToolInvocationPreparationContext, IToolResult, ToolDataSource, ToolProgress, type IToolConfirmationMessages } from '../../../chat/common/languageModelToolsService.js'; import { ITerminalService, type ITerminalInstance } from '../../../terminal/browser/terminal.js'; import type { XtermTerminal } from '../../../terminal/browser/xterm/xtermTerminal.js'; @@ -122,7 +122,6 @@ export class RunInTerminalTool extends Disposable implements IToolImpl { // HACK: Per-tool call state, saved globally // TODO: These should not be part of the state as different sessions could get confused https://github.com/microsoft/vscode/issues/255889 private _alternativeRecommendation?: IToolResult; - private _rewrittenCommand?: string; private static readonly _backgroundExecutions = new Map(); public static getBackgroundOutput(id: string): string { @@ -222,7 +221,7 @@ export class RunInTerminalTool extends Disposable implements IToolImpl { confirmationMessages, presentation, toolSpecificData: { - kind: 'terminal2', + kind: 'terminal', commandLine: { original: args.command, toolEdited: toolEditedCommand @@ -241,7 +240,7 @@ export class RunInTerminalTool extends Disposable implements IToolImpl { this._logService.debug(`RunInTerminalTool: Invoking with options ${JSON.stringify(args)}`); - const toolSpecificData = invocation.toolSpecificData as IChatTerminalToolInvocationData | IChatTerminalToolInvocationData2 | undefined; + const toolSpecificData = invocation.toolSpecificData as IChatTerminalToolInvocationData | undefined; if (!toolSpecificData) { throw new Error('toolSpecificData must be provided for this tool'); } @@ -251,25 +250,16 @@ export class RunInTerminalTool extends Disposable implements IToolImpl { throw new Error('A chat session ID is required for this tool'); } - let command: string | undefined; - let didUserEditCommand: boolean; - let didToolEditCommand: boolean; - if (toolSpecificData.kind === 'terminal') { - command = toolSpecificData.command ?? this._rewrittenCommand ?? args.command; - didUserEditCommand = typeof toolSpecificData?.command === 'string' && toolSpecificData.command !== args.command; - didToolEditCommand = !didUserEditCommand && this._rewrittenCommand !== undefined; - } else { - command = toolSpecificData.commandLine.userEdited ?? toolSpecificData.commandLine.toolEdited ?? toolSpecificData.commandLine.original; - didUserEditCommand = ( - toolSpecificData.commandLine.userEdited !== undefined && - toolSpecificData.commandLine.userEdited !== toolSpecificData.commandLine.original - ); - didToolEditCommand = ( - !didUserEditCommand && - toolSpecificData.commandLine.toolEdited !== undefined && - toolSpecificData.commandLine.toolEdited !== toolSpecificData.commandLine.original - ); - } + const command = toolSpecificData.commandLine.userEdited ?? toolSpecificData.commandLine.toolEdited ?? toolSpecificData.commandLine.original; + const didUserEditCommand = ( + toolSpecificData.commandLine.userEdited !== undefined && + toolSpecificData.commandLine.userEdited !== toolSpecificData.commandLine.original + ); + const didToolEditCommand = ( + !didUserEditCommand && + toolSpecificData.commandLine.toolEdited !== undefined && + toolSpecificData.commandLine.toolEdited !== toolSpecificData.commandLine.original + ); if (token.isCancellationRequested) { throw new CancellationError(); diff --git a/src/vscode-dts/vscode.proposed.chatParticipantPrivate.d.ts b/src/vscode-dts/vscode.proposed.chatParticipantPrivate.d.ts index 470a2ca4cea..d95ae650d94 100644 --- a/src/vscode-dts/vscode.proposed.chatParticipantPrivate.d.ts +++ b/src/vscode-dts/vscode.proposed.chatParticipantPrivate.d.ts @@ -205,24 +205,6 @@ declare module 'vscode' { presentation?: 'hidden' | undefined; } - export interface LanguageModelTool { - prepareInvocation2?(options: LanguageModelToolInvocationPrepareOptions, token: CancellationToken): ProviderResult; - } - - export class PreparedTerminalToolInvocation { - readonly command: string; - readonly language: string; - readonly confirmationMessages?: LanguageModelToolConfirmationMessages; - readonly presentation?: 'hidden' | undefined; - - constructor( - command: string, - language: string, - confirmationMessages?: LanguageModelToolConfirmationMessages, - presentation?: 'hidden' - ); - } - export class ExtendedLanguageModelToolResult extends LanguageModelToolResult { toolResultMessage?: string | MarkdownString; toolResultDetails?: Array;