diff options
Diffstat (limited to 'packages/core/src/tools/read-file.ts')
| -rw-r--r-- | packages/core/src/tools/read-file.ts | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/packages/core/src/tools/read-file.ts b/packages/core/src/tools/read-file.ts index 7ef9d2b5..4c1d044c 100644 --- a/packages/core/src/tools/read-file.ts +++ b/packages/core/src/tools/read-file.ts @@ -9,6 +9,7 @@ import { SchemaValidator } from '../utils/schemaValidator.js'; import { makeRelative, shortenPath } from '../utils/paths.js'; import { BaseDeclarativeTool, + BaseToolInvocation, Icon, ToolInvocation, ToolLocation, @@ -45,13 +46,16 @@ export interface ReadFileToolParams { limit?: number; } -class ReadFileToolInvocation - implements ToolInvocation<ReadFileToolParams, ToolResult> -{ +class ReadFileToolInvocation extends BaseToolInvocation< + ReadFileToolParams, + ToolResult +> { constructor( private config: Config, - public params: ReadFileToolParams, - ) {} + params: ReadFileToolParams, + ) { + super(params); + } getDescription(): string { const relativePath = makeRelative( @@ -61,14 +65,10 @@ class ReadFileToolInvocation return shortenPath(relativePath); } - toolLocations(): ToolLocation[] { + override toolLocations(): ToolLocation[] { return [{ path: this.params.absolute_path, line: this.params.offset }]; } - shouldConfirmExecute(): Promise<false> { - return Promise.resolve(false); - } - async execute(): Promise<ToolResult> { const result = await processSingleFileContent( this.params.absolute_path, |
