fix: read file tool allow ./ path format

This commit is contained in:
Nate 2025-08-26 14:55:31 -07:00
parent 6f42bd9749
commit ebf8ea8006

View file

@ -33,6 +33,11 @@ export const readFileTool: Tool = {
},
run: async (args: { filepath: string }): Promise<string> => {
try {
let { filepath } = args;
if (filepath.startsWith("./")) {
filepath = filepath.slice(2);
}
if (!fs.existsSync(args.filepath)) {
return `Error: File does not exist: ${args.filepath}`;
}