diff options
| author | Taylor Mullen <[email protected]> | 2025-04-18 14:34:34 -0400 |
|---|---|---|
| committer | N. Taylor Mullen <[email protected]> | 2025-04-18 14:41:36 -0400 |
| commit | abb60a4d1031fb32f6d40e2bbe2b2aca7b1433ee (patch) | |
| tree | 1f76fbf913a6eeaef21b12bfb63feb719746d939 /packages/cli/src/tools/write-file.tool.ts | |
| parent | 328846c6e31a3957ecb625c2a93fa9a1dce9580c (diff) | |
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
Diffstat (limited to 'packages/cli/src/tools/write-file.tool.ts')
| -rw-r--r-- | packages/cli/src/tools/write-file.tool.ts | 11 |
1 files changed, 3 insertions, 8 deletions
diff --git a/packages/cli/src/tools/write-file.tool.ts b/packages/cli/src/tools/write-file.tool.ts index c7dc8641..cc0d5511 100644 --- a/packages/cli/src/tools/write-file.tool.ts +++ b/packages/cli/src/tools/write-file.tool.ts @@ -26,16 +26,11 @@ export interface WriteFileToolParams { } /** - * 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 { |
