pub struct ToolUseHookInput {
pub session_id: String,
pub transcript_path: String,
pub cwd: String,
pub permission_mode: String,
pub hook_event_name: String,
pub tool_name: String,
pub tool_input: Value,
pub tool_use_id: Option<String>,
pub tool_response: Option<Value>,
pub agent: Option<AgentKind>,
pub original_tool_name: Option<String>,
}Expand description
Hook input for tool-related events (PreToolUse, PostToolUse, PermissionRequest).
The tool_name field carries the internal (Claude-style) name after protocol
normalization. The original agent-native name is preserved in original_tool_name.
Fields§
§session_id: String§transcript_path: String§cwd: String§permission_mode: String§hook_event_name: String§tool_name: String§tool_input: Value§tool_use_id: Option<String>§tool_response: Option<Value>Present in PostToolUse events
agent: Option<AgentKind>Which agent sent this hook input.
original_tool_name: Option<String>The agent’s original tool name before normalization (e.g. “run_shell_command”).
For Claude, this is the same as tool_name.
Implementations§
Source§impl ToolUseHookInput
impl ToolUseHookInput
Sourcepub fn from_reader(reader: impl Read) -> Result<Self>
pub fn from_reader(reader: impl Read) -> Result<Self>
Parse from any reader (for testability).
Trait Implementations§
Source§impl Clone for ToolUseHookInput
impl Clone for ToolUseHookInput
Source§fn clone(&self) -> ToolUseHookInput
fn clone(&self) -> ToolUseHookInput
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 ToolUseHookInput
impl Debug for ToolUseHookInput
Source§impl Default for ToolUseHookInput
impl Default for ToolUseHookInput
Source§fn default() -> ToolUseHookInput
fn default() -> ToolUseHookInput
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ToolUseHookInput
impl<'de> Deserialize<'de> for ToolUseHookInput
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Auto Trait Implementations§
impl Freeze for ToolUseHookInput
impl RefUnwindSafe for ToolUseHookInput
impl Send for ToolUseHookInput
impl Sync for ToolUseHookInput
impl Unpin for ToolUseHookInput
impl UnsafeUnpin for ToolUseHookInput
impl UnwindSafe for ToolUseHookInput
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