/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { EditorType } from '../utils/editor.js'; import { Tool } from './tools.js'; /** * A tool that supports a modify operation. */ export interface ModifiableTool extends Tool { getModifyContext(abortSignal: AbortSignal): ModifyContext; } export interface ModifyContext { getFilePath: (params: ToolParams) => string; getCurrentContent: (params: ToolParams) => Promise; getProposedContent: (params: ToolParams) => Promise; createUpdatedParams: (oldContent: string, modifiedProposedContent: string, originalParams: ToolParams) => ToolParams; } export interface ModifyResult { updatedParams: ToolParams; updatedDiff: string; } export declare function isModifiableTool(tool: Tool): tool is ModifiableTool; /** * Triggers an external editor for the user to modify the proposed content, * and returns the updated tool parameters and the diff after the user has modified the proposed content. */ export declare function modifyWithEditor(originalParams: ToolParams, modifyContext: ModifyContext, editorType: EditorType, _abortSignal: AbortSignal): Promise>;