feat: implement model-dependent tool definitions architecture and refactor read_file and shell tools

This commit is contained in:
Aishanee Shah
2026-02-04 20:13:57 +00:00
parent 469cbca67f
commit 65232686ee
9 changed files with 244 additions and 10 deletions
+9
View File
@@ -23,6 +23,8 @@ import { logFileOperation } from '../telemetry/loggers.js';
import { FileOperationEvent } from '../telemetry/types.js';
import { READ_FILE_TOOL_NAME } from './tool-names.js';
import { FileDiscoveryService } from '../services/fileDiscoveryService.js';
import { READ_FILE_DEFINITION } from './definitions/coreTools.js';
import { resolveToolDeclaration } from './definitions/resolver.js';
/**
* Parameters for the ReadFile tool
@@ -252,4 +254,11 @@ export class ReadFileTool extends BaseDeclarativeTool<
_toolDisplayName,
);
}
override getSchema(modelId?: string) {
if (!modelId) {
return super.getSchema();
}
return resolveToolDeclaration(READ_FILE_DEFINITION, modelId);
}
}