feat: misc tool alignment (#137)

This commit is contained in:
Charles Packer
2025-11-30 15:38:04 -08:00
committed by GitHub
parent b0291597f3
commit 6089ce1cdd
40 changed files with 1524 additions and 206 deletions

View File

@@ -133,6 +133,11 @@ export async function read(args: ReadArgs): Promise<ReadResult> {
if (await isBinaryFile(file_path))
throw new Error(`Cannot read binary file: ${file_path}`);
const content = await fs.readFile(file_path, "utf-8");
if (content.trim() === "") {
return {
content: `<system-reminder>\nThe file ${file_path} exists but has empty contents.\n</system-reminder>`,
};
}
const formattedContent = formatWithLineNumbers(content, offset, limit);
return { content: formattedContent };
} catch (error) {