/** * @license * Copyright 2025 Google LLC * SPDX-License-Identifier: Apache-2.0 */ import { Config } from '../config/config.js'; import { BaseDeclarativeTool, type ToolResult, type ToolInvocation } from './tools.js'; import type { MessageBus } from '../confirmation-bus/message-bus.js'; import { type ModifiableDeclarativeTool, type ModifyContext } from './modifiable-tool.js'; /** * Parameters for the WriteFile tool */ export interface WriteFileToolParams { /** * The absolute path to the file to write to */ absolute_path?: string; /** * Alternative parameter name for absolute_path (for compatibility) * Not shown in schema - internal use only */ file_path?: string; /** * The content to write to the file */ content: string; /** * Whether the proposed content was modified by the user. */ modified_by_user?: boolean; /** * Initially proposed content. */ ai_proposed_content?: string; } interface GetCorrectedFileContentResult { originalContent: string; correctedContent: string; fileExists: boolean; error?: { message: string; code?: string; }; } /** * Gets corrected file content using AI correction services */ export declare function getCorrectedFileContent(filePath: string, proposedContent: string, config: Config, _abortSignal: AbortSignal): Promise; /** * Implementation of the WriteFile tool logic */ export declare class WriteFileTool extends BaseDeclarativeTool implements ModifiableDeclarativeTool { private readonly config; static readonly Name: string; constructor(config: Config, messageBus?: MessageBus); protected validateToolParamValues(params: WriteFileToolParams): string | null; protected createInvocation(params: WriteFileToolParams, messageBus?: MessageBus, toolName?: string, displayName?: string): ToolInvocation; getModifyContext(abortSignal: AbortSignal): ModifyContext; } export {};