pub enum HookOutput {
Allow(AllowOutput),
AllowWithModifiedCommand(AllowWithModifiedCommandOutput),
Deny(DenyOutput),
}Expand description
Output sent back to Claude Code from PreToolUse hook.
Variants§
Allow(AllowOutput)
Allow the command to proceed (empty object or no output).
AllowWithModifiedCommand(AllowWithModifiedCommandOutput)
Allow with a modified/replaced command (for transparent interception). Used when RCH has already executed the command remotely and wants to replace the original command with a no-op for transparency.
Deny(DenyOutput)
Deny the command with a reason.
Implementations§
Source§impl HookOutput
impl HookOutput
Sourcepub fn allow_with_modified_command(
replacement_command: impl Into<String>,
) -> Self
pub fn allow_with_modified_command( replacement_command: impl Into<String>, ) -> Self
Create an allow output with a modified/replaced command.
This is used for transparent interception: RCH has already executed the command remotely, so we replace it with a no-op to prevent double execution. The agent sees the remote output but thinks the command ran locally.
§Arguments
replacement_command- The command to substitute (typically “true” for a no-op)
Trait Implementations§
Source§impl Clone for HookOutput
impl Clone for HookOutput
Source§fn clone(&self) -> HookOutput
fn clone(&self) -> HookOutput
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for HookOutput
impl Debug for HookOutput
Auto Trait Implementations§
impl Freeze for HookOutput
impl RefUnwindSafe for HookOutput
impl Send for HookOutput
impl Sync for HookOutput
impl Unpin for HookOutput
impl UnsafeUnpin for HookOutput
impl UnwindSafe for HookOutput
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more