From da249d43de74e69fccebf8b4a93800004c2016f6 Mon Sep 17 00:00:00 2001 From: thzxx Date: Wed, 10 Jun 2026 14:12:55 +0800 Subject: [PATCH] =?UTF-8?q?chore:=20read=5Ffile=20=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E8=A1=8C=E6=95=B0=20500=E2=86=922000?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/main/tool-handlers-fs.ts | 2 +- src/renderer/services/tool-registry.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/main/tool-handlers-fs.ts b/src/main/tool-handlers-fs.ts index a41a3b1..7f8d950 100644 --- a/src/main/tool-handlers-fs.ts +++ b/src/main/tool-handlers-fs.ts @@ -99,7 +99,7 @@ export async function handleReadFile(params: { path: string; encoding?: string; // 按行读取 const content = await fs.readFile(filePath, encoding); const lines = content.split('\n'); - const defaultLimit = 500; + const defaultLimit = 2000; let resultContent = content; let lineRange: [number, number] = [1, lines.length]; diff --git a/src/renderer/services/tool-registry.ts b/src/renderer/services/tool-registry.ts index 13edd2f..9659cca 100644 --- a/src/renderer/services/tool-registry.ts +++ b/src/renderer/services/tool-registry.ts @@ -21,7 +21,7 @@ export const TOOL_DEFINITIONS: ToolDefinition[] = [ path: { type: 'string', description: 'The file path to read. Absolute or relative to workspace.' }, encoding: { type: 'string', enum: ['utf-8', 'latin1', 'base64'], description: 'File encoding. Default: utf-8. Use base64 for binary content.' }, start_line: { type: 'integer', description: 'Start line (1-indexed) for text files. Use with end_line for pagination.' }, - end_line: { type: 'integer', description: 'End line (inclusive). Default: start_line + 500.' }, + end_line: { type: 'integer', description: 'End line (inclusive). Default: start_line + 2000.' }, mode: { type: 'string', enum: ['text', 'binary'], description: 'Read mode. text = decode as string, binary = return base64. Default: text.' }, offset_bytes: { type: 'integer', description: 'Byte offset to start reading from (0-indexed). Use for binary files or large text.' }, limit_bytes: { type: 'integer', description: 'Max bytes to read. Default: 50000 (text) or 102400 (binary).' }