| 36 | } |
| 37 | |
| 38 | QString EditFileTool::description() const |
| 39 | { |
| 40 | return "Edit a file by replacing old content with new content. " |
| 41 | "Provide the file path (absolute or relative to project root), old_content to find and replace, " |
| 42 | "and new_content to replace it with. Changes are applied immediately if auto-apply " |
| 43 | "is enabled in settings. The user can undo or reapply changes at any time. " |
| 44 | "\n\nIMPORTANT:" |
| 45 | "\n- ALWAYS use read_file to get current file content before editing to ensure accuracy." |
| 46 | "\n- Path can be absolute (e.g., /path/to/file.cpp) or relative to project root (e.g., src/main.cpp)." |
| 47 | "\n- For EMPTY files: use empty old_content (empty string or omit parameter)." |
| 48 | "\n- To append at the END of file: use empty old_content." |
| 49 | "\n- To insert at the BEGINNING of a file (e.g., copyright header), you MUST provide " |
| 50 | "the EXACT first few lines of the file as old_content (at least 3-5 lines), " |
| 51 | "then put those lines + new header in new_content." |
| 52 | "\n- For replacements in the middle, provide EXACT matching text with sufficient " |
| 53 | "context (at least 5-10 lines) to ensure correct placement." |
| 54 | "\n- The system uses fuzzy matching with 85% similarity threshold for first-time edits. " |
| 55 | "Provide accurate old_content to avoid incorrect placement." |
| 56 | "\n- If changes remain 'pending' and file content hasn't changed, the user likely " |
| 57 | "disabled auto-apply. DO NOT retry the same edit - wait for user action."; |
| 58 | } |
| 59 | |
| 60 | QJsonObject EditFileTool::parametersSchema() const |
| 61 | { |
nothing calls this directly
no outgoing calls
no test coverage detected