summaryrefslogtreecommitdiff
path: root/packages/cli/src/tools/read-file.tool.ts
diff options
context:
space:
mode:
authorTaylor Mullen <[email protected]>2025-04-18 13:37:51 -0400
committerN. Taylor Mullen <[email protected]>2025-04-18 14:02:09 -0400
commit7cd3b95317c4d9263e514f33589cb359766d463b (patch)
treeccca1f6d7e67e91c9a3603dd5251fa2c4c577274 /packages/cli/src/tools/read-file.tool.ts
parent93fd6a9160d4654baf2f10269ce9689c553bb8cf (diff)
Fix linting errors in a number of core and tool files (partial)
- As part of this work I also started building out errors.ts which will be a cumulation of error helpers to better handle the challenging `catch (error: unknown)` requirement. - 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/read-file.tool.ts')
-rw-r--r--packages/cli/src/tools/read-file.tool.ts11
1 files changed, 3 insertions, 8 deletions
diff --git a/packages/cli/src/tools/read-file.tool.ts b/packages/cli/src/tools/read-file.tool.ts
index 98df7c12..9737e75d 100644
--- a/packages/cli/src/tools/read-file.tool.ts
+++ b/packages/cli/src/tools/read-file.tool.ts
@@ -25,16 +25,11 @@ export interface ReadFileToolParams {
}
/**
- * Standardized result from the ReadFile tool
- */
-export interface ReadFileToolResult extends ToolResult {}
-
-/**
* Implementation of the ReadFile tool that reads files from the filesystem
*/
export class ReadFileTool extends BaseTool<
ReadFileToolParams,
- ReadFileToolResult
+ ToolResult
> {
static readonly Name: string = 'read_file';
@@ -166,7 +161,7 @@ export class ReadFileTool extends BaseTool<
// If more than 30% are non-printable, likely binary
return nonPrintableCount / bytesRead > 0.3;
- } catch (error) {
+ } catch {
return false;
}
}
@@ -214,7 +209,7 @@ export class ReadFileTool extends BaseTool<
* @param params Parameters for the file reading
* @returns Result with file contents
*/
- async execute(params: ReadFileToolParams): Promise<ReadFileToolResult> {
+ async execute(params: ReadFileToolParams): Promise<ToolResult> {
const validationError = this.invalidParams(params);
const filePath = params.file_path;
if (validationError) {