This commit is contained in:
seb
2026-10-11 12:58:15 +02:00
parent 8262e35e53
commit 1149ffddcb
24 changed files with 575 additions and 261 deletions

View File

@@ -4,6 +4,7 @@ import { defineTool, ToolError } from 'libllmorbiter';
import { isSkillPath, parseSkill, SKILL_EXT } from './skill.js';
import { getApiRouteSkill } from './routes-skills.js';
import { prepareVfs } from './vfs.js';
import { TOOL_DESCRIPTIONS, TOOL_PARAMETER_DESCRIPTIONS } from './prompts.js';
const DEFAULT_LIMIT = 400;
const MAX_LIMIT = 5000;
@@ -61,10 +62,7 @@ function looksBinary(buf) {
export function createReadFileTool({ googleAuthId }) {
return defineTool({
name: 'read_file',
description:
'Read text file from VFS. Root-relative forward-slash paths. ' +
'SKILL files return parsed title and markdown content. ' +
'Windowed via seek/limit (0-indexed lines). Binary files not supported (use analyze_image for images).',
description: TOOL_DESCRIPTIONS.read_file,
strict: false,
parameters: {
type: 'object',
@@ -73,15 +71,15 @@ export function createReadFileTool({ googleAuthId }) {
properties: {
filename: {
type: 'string',
description: 'VFS file path.',
description: TOOL_PARAMETER_DESCRIPTIONS.read_file.filename,
},
seek: {
type: ['number', 'null'],
description: 'Line offset (0-indexed) or null. Default 0.',
description: TOOL_PARAMETER_DESCRIPTIONS.read_file.seek,
},
limit: {
type: ['number', 'null'],
description: `Max lines to return or null. Default ${DEFAULT_LIMIT}, max ${MAX_LIMIT}.`,
description: TOOL_PARAMETER_DESCRIPTIONS.read_file.limit,
},
},
},