u
This commit is contained in:
@@ -75,12 +75,12 @@ export function createReadFileTool({ googleAuthId }) {
|
||||
description: 'VFS file path.',
|
||||
},
|
||||
seek: {
|
||||
type: 'number',
|
||||
description: 'Line offset (0-indexed). Default 0.',
|
||||
type: ['number', 'null'],
|
||||
description: 'Line offset (0-indexed) or null. Default 0.',
|
||||
},
|
||||
limit: {
|
||||
type: 'number',
|
||||
description: `Max lines to return. Default ${DEFAULT_LIMIT}, max ${MAX_LIMIT}.`,
|
||||
type: ['number', 'null'],
|
||||
description: `Max lines to return or null. Default ${DEFAULT_LIMIT}, max ${MAX_LIMIT}.`,
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -88,9 +88,11 @@ export function createReadFileTool({ googleAuthId }) {
|
||||
if (typeof filename !== 'string' || !filename.trim()) {
|
||||
throw new ToolError('"filename" must be a non-empty string.');
|
||||
}
|
||||
seek = seek != null ? Number(seek) : 0;
|
||||
if (!Number.isInteger(seek) || seek < 0) {
|
||||
throw new ToolError(`"seek" must be a non-negative integer (received ${seek}).`);
|
||||
}
|
||||
limit = limit != null ? Number(limit) : DEFAULT_LIMIT;
|
||||
if (!Number.isInteger(limit) || limit < 1) {
|
||||
throw new ToolError(`"limit" must be a positive integer (received ${limit}).`);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user