You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Refactor read-file tool to support XML input format and multiple line ranges
- Updated the `getReadFileDescription` function to reflect new XML structure for file reading requests.
- Modified `readFileTool` to parse XML input, allowing multiple line ranges for each file.
- Removed old parsing logic that handled line ranges as separate parameters.
- Implemented validation for line ranges and ensured proper error handling for file access.
- Adjusted approval messaging to accommodate new line range format.
- Enhanced error handling to provide consistent feedback for file read errors.
`<files>\n<file><path>${testFilePath}</path>\n<content lines="1-3">\n1 | Line 1\n2 | Line 2\n3 | Line 3</content>\n<list_code_definition_names>${sourceCodeDef.trim()}</list_code_definition_names>\n<notice>Showing only 3 of 5 total lines. Use start_line and end_line if you need to read more</notice>\n</file>\n</files>`,
328
+
`<files>\n<file><path>${testFilePath}</path>\n<content lines="1-3">\n1 | Line 1\n2 | Line 2\n3 | Line 3</content>\n<list_code_definition_names>${sourceCodeDef.trim()}</list_code_definition_names>\n<notice>Showing only 3 of 5 total lines. Use line_range if you need to read more lines</notice>\n</file>\n</files>`,
`<files>\n<file><path>${testFilePath}</path>\n<content lines="1-${maxReadFileLine}">\n1 | Line 1\n2 | Line 2\n3 | Line 3</content>\n<list_code_definition_names>${sourceCodeDef.trim()}</list_code_definition_names>\n<notice>Showing only ${maxReadFileLine} of ${totalLines} total lines. Use start_line and end_line if you need to read more</notice>\n</file>\n</files>`,
437
+
`<files>\n<file><path>${testFilePath}</path>\n<content lines="1-${maxReadFileLine}">\n1 | Line 1\n2 | Line 2\n3 | Line 3</content>\n<list_code_definition_names>${sourceCodeDef.trim()}</list_code_definition_names>\n<notice>Showing only ${maxReadFileLine} of ${totalLines} total lines. Use line_range if you need to read more lines</notice>\n</file>\n</files>`,
`<files>\n<file><path>${testFilePath}</path>\n<content lines="1-${maxReadFileLine}">\n${numberedContent}\n</content>\n<notice>Showing only ${maxReadFileLine} of ${totalLines} total lines. Use start_line and end_line if you need to read more</notice>\n</file>\n</files>`,
613
+
`<files>\n<file><path>${testFilePath}</path>\n<content lines="1-${maxReadFileLine}">\n${numberedContent}\n</content>\n<notice>Showing only ${maxReadFileLine} of ${totalLines} total lines. Use line_range if you need to read more lines</notice>\n</file>\n</files>`,
`<files>\n<file><path>${testFilePath}</path>\n<content lines="1-${maxReadFileLine}">\n${numberedLine}\n</content>\n<notice>Showing only ${maxReadFileLine} of 5 total lines. Use start_line and end_line if you need to read more</notice>\n</file>\n</files>`,
635
+
`<files>\n<file><path>${testFilePath}</path>\n<content lines="1-${maxReadFileLine}">\n${numberedLine}\n</content>\n<notice>Showing only ${maxReadFileLine} of 5 total lines. Use line_range if you need to read more lines</notice>\n</file>\n</files>`,
`<files>\n<file><path>largeFile.txt</path>\n<content lines="1-500">\n1 | Test content</content>\n<notice>Showing only 500 of 5000 total lines. Use start_line and end_line if you need to read more</notice>\n</file>\n</files>`,
275
+
`<files>\n<file><path>largeFile.txt</path>\n<content lines="1-500">\n1 | Test content</content>\n<notice>Showing only 500 of 5000 total lines. Use line_range if you need to read more lines</notice>\n</file>\n</files>`,
0 commit comments