Merge documented PreToolUse base into PermissionRequest stack

This commit is contained in:
Abhinav Vedmala
2026-05-06 11:42:23 -07:00
4 changed files with 10 additions and 0 deletions
@@ -325,6 +325,9 @@ impl ToolHandler for ApplyPatchHandler {
})
}
// Hooks expose apply_patch through the stable `{ "command": ... }` shape,
// while the underlying tool stores the patch as either the function
// argument `input` or freeform custom-tool input.
fn with_updated_hook_input(
&self,
mut invocation: ToolInvocation,
+3
View File
@@ -48,6 +48,9 @@ impl ToolHandler for McpHandler {
})
}
// MCP hooks expose the full arguments object, so rewrites replace the
// serialized raw argument payload wholesale rather than patching one
// handler-owned field.
fn with_updated_hook_input(
&self,
mut invocation: ToolInvocation,
@@ -379,6 +379,8 @@ impl ToolHandler for LocalShellHandler {
})
}
// Hooks see a joined shell command string, but local_shell stores argv.
// Split on the way back in to invert the hook-facing representation.
fn with_updated_hook_input(
&self,
mut invocation: ToolInvocation,
@@ -164,6 +164,8 @@ impl ToolHandler for ExecCommandHandler {
})
}
// Hooks normalize Bash-like tools to `{ "command": ... }`, while the
// exec_command wire schema still names the field `cmd`.
fn with_updated_hook_input(
&self,
mut invocation: ToolInvocation,