chore: read_file 默认行数 500→2000

This commit is contained in:
thzxx
2026-06-10 14:12:55 +08:00
parent 751f548b0c
commit da249d43de
2 changed files with 2 additions and 2 deletions
+1 -1
View File
@@ -99,7 +99,7 @@ export async function handleReadFile(params: { path: string; encoding?: string;
// 按行读取 // 按行读取
const content = await fs.readFile(filePath, encoding); const content = await fs.readFile(filePath, encoding);
const lines = content.split('\n'); const lines = content.split('\n');
const defaultLimit = 500; const defaultLimit = 2000;
let resultContent = content; let resultContent = content;
let lineRange: [number, number] = [1, lines.length]; let lineRange: [number, number] = [1, lines.length];
+1 -1
View File
@@ -21,7 +21,7 @@ export const TOOL_DEFINITIONS: ToolDefinition[] = [
path: { type: 'string', description: 'The file path to read. Absolute or relative to workspace.' }, 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.' }, 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.' }, 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.' }, 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.' }, 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).' } limit_bytes: { type: 'integer', description: 'Max bytes to read. Default: 50000 (text) or 102400 (binary).' }