mirror of
https://github.com/google-gemini/gemini-cli.git
synced 2026-03-18 01:51:20 -07:00
Finish manually fixing linter errors for tools dir (partial).
- More changes are to come, this is truly a partial change in order to not disrupt as many people as possible. Part of https://b.corp.google.com/issues/411384603
This commit is contained in:
committed by
N. Taylor Mullen
parent
328846c6e3
commit
abb60a4d10
@@ -25,17 +25,12 @@ export interface WriteFileToolParams {
|
||||
content: string;
|
||||
}
|
||||
|
||||
/**
|
||||
* Standardized result from the WriteFile tool
|
||||
*/
|
||||
export interface WriteFileToolResult extends ToolResult {}
|
||||
|
||||
/**
|
||||
* Implementation of the WriteFile tool that writes files to the filesystem
|
||||
*/
|
||||
export class WriteFileTool extends BaseTool<
|
||||
WriteFileToolParams,
|
||||
WriteFileToolResult
|
||||
ToolResult
|
||||
> {
|
||||
static readonly Name: string = 'write_file';
|
||||
private shouldAlwaysWrite = false;
|
||||
@@ -143,7 +138,7 @@ export class WriteFileTool extends BaseTool<
|
||||
let currentContent = '';
|
||||
try {
|
||||
currentContent = fs.readFileSync(params.file_path, 'utf8');
|
||||
} catch (error) {
|
||||
} catch {
|
||||
// File may not exist, which is fine
|
||||
}
|
||||
|
||||
@@ -184,7 +179,7 @@ export class WriteFileTool extends BaseTool<
|
||||
* @param params Parameters for the file writing
|
||||
* @returns Result of the file writing operation
|
||||
*/
|
||||
async execute(params: WriteFileToolParams): Promise<WriteFileToolResult> {
|
||||
async execute(params: WriteFileToolParams): Promise<ToolResult> {
|
||||
const validationError = this.validateToolParams(params);
|
||||
if (validationError) {
|
||||
return {
|
||||
|
||||
Reference in New Issue
Block a user