feat(mcp): Add edit_file tool - native edit replacement that preserves indentation
- New edit_file(path, old_string, new_string, replace_all) function - Reads/writes with newline='' to preserve CRLF and 1-space indentation - Returns error if old_string not found or multiple matches without replace_all - Added to MUTATING_TOOLS for HITL approval routing - Added to TOOL_NAMES and dispatch function - Added MCP_TOOL_SPECS entry for AI tool declaration - Updated agent configs (tier2, tier3, general) with edit_file mapping Note: tier1, tier4, explore agents don't need this (edit: deny - read-only)
This commit is contained in:
@@ -28,9 +28,11 @@ You MUST use Manual Slop's MCP tools. Native OpenCode tools are unreliable.
|
||||
### Edit MCP Tools (USE THESE)
|
||||
| Native Tool | MCP Tool |
|
||||
|-------------|----------|
|
||||
| `edit` | `manual-slop_edit_file` (find/replace, preserves indentation) |
|
||||
| `edit` | `manual-slop_py_update_definition` (replace function/class) |
|
||||
| `edit` | `manual-slop_set_file_slice` (replace line range) |
|
||||
| `edit` | `manual-slop_py_set_signature` (replace signature only) |
|
||||
| `edit` | `manual-slop_py_set_var_declaration` (replace variable) |
|
||||
|
||||
### Shell Commands
|
||||
| Native Tool | MCP Tool |
|
||||
|
||||
@@ -34,6 +34,7 @@ You MUST use Manual Slop's MCP tools. Native OpenCode tools are unreliable.
|
||||
### Edit MCP Tools (USE THESE)
|
||||
| Native Tool | MCP Tool |
|
||||
|-------------|----------|
|
||||
| `edit` | `manual-slop_edit_file` (find/replace, preserves indentation) |
|
||||
| `edit` | `manual-slop_py_update_definition` (replace function/class) |
|
||||
| `edit` | `manual-slop_set_file_slice` (replace line range) |
|
||||
| `edit` | `manual-slop_py_set_signature` (replace signature only) |
|
||||
|
||||
@@ -32,6 +32,7 @@ You MUST use Manual Slop's MCP tools. Native OpenCode tools are unreliable.
|
||||
### Edit MCP Tools (USE THESE - BAN NATIVE EDIT)
|
||||
| Native Tool | MCP Tool |
|
||||
|-------------|----------|
|
||||
| `edit` | `manual-slop_edit_file` (find/replace, preserves indentation) |
|
||||
| `edit` | `manual-slop_py_update_definition` (replace function/class) |
|
||||
| `edit` | `manual-slop_set_file_slice` (replace line range) |
|
||||
| `edit` | `manual-slop_py_set_signature` (replace signature only) |
|
||||
|
||||
Reference in New Issue
Block a user