diff options
Diffstat (limited to 'packages/core/src/tools')
| -rw-r--r-- | packages/core/src/tools/edit.ts | 2 | ||||
| -rw-r--r-- | packages/core/src/tools/glob.ts | 2 | ||||
| -rw-r--r-- | packages/core/src/tools/grep.ts | 2 | ||||
| -rw-r--r-- | packages/core/src/tools/ls.ts | 2 | ||||
| -rw-r--r-- | packages/core/src/tools/mcp-tool.ts | 4 | ||||
| -rw-r--r-- | packages/core/src/tools/memoryTool.ts | 4 | ||||
| -rw-r--r-- | packages/core/src/tools/read-file.ts | 4 | ||||
| -rw-r--r-- | packages/core/src/tools/read-many-files.ts | 4 | ||||
| -rw-r--r-- | packages/core/src/tools/shell.ts | 6 | ||||
| -rw-r--r-- | packages/core/src/tools/tool-registry.ts | 4 | ||||
| -rw-r--r-- | packages/core/src/tools/tools.ts | 16 | ||||
| -rw-r--r-- | packages/core/src/tools/web-fetch.ts | 8 | ||||
| -rw-r--r-- | packages/core/src/tools/web-search.ts | 2 | ||||
| -rw-r--r-- | packages/core/src/tools/write-file.ts | 8 |
14 files changed, 39 insertions, 29 deletions
diff --git a/packages/core/src/tools/edit.ts b/packages/core/src/tools/edit.ts index 733c1bf8..8d90dfe4 100644 --- a/packages/core/src/tools/edit.ts +++ b/packages/core/src/tools/edit.ts @@ -471,7 +471,7 @@ Expectation for required parameters: * @param params Parameters to validate * @returns Error message string or null if valid */ - validateToolParams(params: EditToolParams): string | null { + override validateToolParams(params: EditToolParams): string | null { const errors = SchemaValidator.validate( this.schema.parametersJsonSchema, params, diff --git a/packages/core/src/tools/glob.ts b/packages/core/src/tools/glob.ts index 77a7241f..65454232 100644 --- a/packages/core/src/tools/glob.ts +++ b/packages/core/src/tools/glob.ts @@ -281,7 +281,7 @@ export class GlobTool extends BaseDeclarativeTool<GlobToolParams, ToolResult> { /** * Validates the parameters for the tool. */ - validateToolParams(params: GlobToolParams): string | null { + override validateToolParams(params: GlobToolParams): string | null { const errors = SchemaValidator.validate( this.schema.parametersJsonSchema, params, diff --git a/packages/core/src/tools/grep.ts b/packages/core/src/tools/grep.ts index 9d3d638a..4cac389f 100644 --- a/packages/core/src/tools/grep.ts +++ b/packages/core/src/tools/grep.ts @@ -614,7 +614,7 @@ export class GrepTool extends BaseDeclarativeTool<GrepToolParams, ToolResult> { * @param params Parameters to validate * @returns An error message string if invalid, null otherwise */ - validateToolParams(params: GrepToolParams): string | null { + override validateToolParams(params: GrepToolParams): string | null { const errors = SchemaValidator.validate( this.schema.parametersJsonSchema, params, diff --git a/packages/core/src/tools/ls.ts b/packages/core/src/tools/ls.ts index 2618136a..918c0b2b 100644 --- a/packages/core/src/tools/ls.ts +++ b/packages/core/src/tools/ls.ts @@ -314,7 +314,7 @@ export class LSTool extends BaseDeclarativeTool<LSToolParams, ToolResult> { * @param params Parameters to validate * @returns An error message string if invalid, null otherwise */ - validateToolParams(params: LSToolParams): string | null { + override validateToolParams(params: LSToolParams): string | null { const errors = SchemaValidator.validate( this.schema.parametersJsonSchema, params, diff --git a/packages/core/src/tools/mcp-tool.ts b/packages/core/src/tools/mcp-tool.ts index 01a8d75c..fbb104fd 100644 --- a/packages/core/src/tools/mcp-tool.ts +++ b/packages/core/src/tools/mcp-tool.ts @@ -70,7 +70,7 @@ class DiscoveredMCPToolInvocation extends BaseToolInvocation< super(params); } - async shouldConfirmExecute( + override async shouldConfirmExecute( _abortSignal: AbortSignal, ): Promise<ToolCallConfirmationDetails | false> { const serverAllowListKey = this.serverName; @@ -135,7 +135,7 @@ export class DiscoveredMCPTool extends BaseDeclarativeTool< readonly serverName: string, readonly serverToolName: string, description: string, - readonly parameterSchema: unknown, + override readonly parameterSchema: unknown, readonly timeout?: number, readonly trust?: boolean, nameOverride?: string, diff --git a/packages/core/src/tools/memoryTool.ts b/packages/core/src/tools/memoryTool.ts index a9d765c4..73282d60 100644 --- a/packages/core/src/tools/memoryTool.ts +++ b/packages/core/src/tools/memoryTool.ts @@ -180,7 +180,7 @@ class MemoryToolInvocation extends BaseToolInvocation< return `in ${tildeifyPath(memoryFilePath)}`; } - async shouldConfirmExecute( + override async shouldConfirmExecute( _abortSignal: AbortSignal, ): Promise<ToolEditConfirmationDetails | false> { const memoryFilePath = getGlobalMemoryFilePath(); @@ -294,7 +294,7 @@ export class MemoryTool ); } - validateToolParams(params: SaveMemoryParams): string | null { + override validateToolParams(params: SaveMemoryParams): string | null { const errors = SchemaValidator.validate( this.schema.parametersJsonSchema, params, diff --git a/packages/core/src/tools/read-file.ts b/packages/core/src/tools/read-file.ts index d10c73d1..f02db506 100644 --- a/packages/core/src/tools/read-file.ts +++ b/packages/core/src/tools/read-file.ts @@ -198,7 +198,9 @@ export class ReadFileTool extends BaseDeclarativeTool< ); } - protected validateToolParams(params: ReadFileToolParams): string | null { + protected override validateToolParams( + params: ReadFileToolParams, + ): string | null { const errors = SchemaValidator.validate( this.schema.parametersJsonSchema, params, diff --git a/packages/core/src/tools/read-many-files.ts b/packages/core/src/tools/read-many-files.ts index e4e94799..aaf524c4 100644 --- a/packages/core/src/tools/read-many-files.ts +++ b/packages/core/src/tools/read-many-files.ts @@ -626,7 +626,9 @@ Use this tool when the user's query implies needing the content of several files ); } - protected validateToolParams(params: ReadManyFilesParams): string | null { + protected override validateToolParams( + params: ReadManyFilesParams, + ): string | null { const errors = SchemaValidator.validate( this.schema.parametersJsonSchema, params, diff --git a/packages/core/src/tools/shell.ts b/packages/core/src/tools/shell.ts index 0cc727fb..5b01a82f 100644 --- a/packages/core/src/tools/shell.ts +++ b/packages/core/src/tools/shell.ts @@ -67,7 +67,7 @@ class ShellToolInvocation extends BaseToolInvocation< return description; } - async shouldConfirmExecute( + override async shouldConfirmExecute( _abortSignal: AbortSignal, ): Promise<ToolCallConfirmationDetails | false> { const command = stripShellWrapper(this.params.command); @@ -343,7 +343,9 @@ export class ShellTool extends BaseDeclarativeTool< ); } - protected validateToolParams(params: ShellToolParams): string | null { + protected override validateToolParams( + params: ShellToolParams, + ): string | null { const commandCheck = isCommandAllowed(params.command, this.config); if (!commandCheck.allowed) { if (!commandCheck.reason) { diff --git a/packages/core/src/tools/tool-registry.ts b/packages/core/src/tools/tool-registry.ts index b3625285..416ee99e 100644 --- a/packages/core/src/tools/tool-registry.ts +++ b/packages/core/src/tools/tool-registry.ts @@ -19,8 +19,8 @@ export class DiscoveredTool extends BaseTool<ToolParams, ToolResult> { constructor( private readonly config: Config, name: string, - readonly description: string, - readonly parameterSchema: Record<string, unknown>, + override readonly description: string, + override readonly parameterSchema: Record<string, unknown>, ) { const discoveryCmd = config.getToolDiscoveryCommand()!; const callCommand = config.getToolCallCommand()!; diff --git a/packages/core/src/tools/tools.ts b/packages/core/src/tools/tools.ts index 3e7d0647..00f2a842 100644 --- a/packages/core/src/tools/tools.ts +++ b/packages/core/src/tools/tools.ts @@ -284,13 +284,13 @@ export abstract class BaseTool< * @param parameterSchema JSON Schema defining the parameters */ constructor( - readonly name: string, - readonly displayName: string, - readonly description: string, - readonly kind: Kind, - readonly parameterSchema: unknown, - readonly isOutputMarkdown: boolean = true, - readonly canUpdateOutput: boolean = false, + override readonly name: string, + override readonly displayName: string, + override readonly description: string, + override readonly kind: Kind, + override readonly parameterSchema: unknown, + override readonly isOutputMarkdown: boolean = true, + override readonly canUpdateOutput: boolean = false, ) { super( name, @@ -320,7 +320,7 @@ export abstract class BaseTool< * @returns An error message string if invalid, null otherwise */ // eslint-disable-next-line @typescript-eslint/no-unused-vars - validateToolParams(params: TParams): string | null { + override validateToolParams(params: TParams): string | null { // Implementation would typically use a JSON Schema validator // This is a placeholder that should be implemented by derived classes return null; diff --git a/packages/core/src/tools/web-fetch.ts b/packages/core/src/tools/web-fetch.ts index 909fc548..7c80650b 100644 --- a/packages/core/src/tools/web-fetch.ts +++ b/packages/core/src/tools/web-fetch.ts @@ -143,7 +143,9 @@ ${textContent} return `Processing URLs and instructions from prompt: "${displayPrompt}"`; } - async shouldConfirmExecute(): Promise<ToolCallConfirmationDetails | false> { + override async shouldConfirmExecute(): Promise< + ToolCallConfirmationDetails | false + > { if (this.config.getApprovalMode() === ApprovalMode.AUTO_EDIT) { return false; } @@ -337,7 +339,9 @@ export class WebFetchTool extends BaseDeclarativeTool< } } - protected validateToolParams(params: WebFetchToolParams): string | null { + protected override validateToolParams( + params: WebFetchToolParams, + ): string | null { const errors = SchemaValidator.validate( this.schema.parametersJsonSchema, params, diff --git a/packages/core/src/tools/web-search.ts b/packages/core/src/tools/web-search.ts index 54679452..a2306894 100644 --- a/packages/core/src/tools/web-search.ts +++ b/packages/core/src/tools/web-search.ts @@ -103,7 +103,7 @@ export class WebSearchTool extends BaseTool< return null; } - getDescription(params: WebSearchToolParams): string { + override getDescription(params: WebSearchToolParams): string { return `Searching the web for: "${params.query}"`; } diff --git a/packages/core/src/tools/write-file.ts b/packages/core/src/tools/write-file.ts index fa1e1301..01c92865 100644 --- a/packages/core/src/tools/write-file.ts +++ b/packages/core/src/tools/write-file.ts @@ -102,11 +102,11 @@ export class WriteFileTool ); } - toolLocations(params: WriteFileToolParams): ToolLocation[] { + override toolLocations(params: WriteFileToolParams): ToolLocation[] { return [{ path: params.file_path }]; } - validateToolParams(params: WriteFileToolParams): string | null { + override validateToolParams(params: WriteFileToolParams): string | null { const errors = SchemaValidator.validate( this.schema.parametersJsonSchema, params, @@ -144,7 +144,7 @@ export class WriteFileTool return null; } - getDescription(params: WriteFileToolParams): string { + override getDescription(params: WriteFileToolParams): string { if (!params.file_path) { return `Model did not provide valid parameters for write file tool, missing or empty "file_path"`; } @@ -158,7 +158,7 @@ export class WriteFileTool /** * Handles the confirmation prompt for the WriteFile tool. */ - async shouldConfirmExecute( + override async shouldConfirmExecute( params: WriteFileToolParams, abortSignal: AbortSignal, ): Promise<ToolCallConfirmationDetails | false> { |
