pub struct HookInput {Show 20 fields
pub session_id: SessionId,
pub transcript_path: String,
pub cwd: String,
pub permission_mode: String,
pub hook_event_name: String,
pub runtime: Option<Runtime>,
pub tool_name: Option<ToolName>,
pub tool_input: Option<Value>,
pub tool_use_id: Option<String>,
pub tool_response: Option<Value>,
pub prompt: Option<String>,
pub message: Option<String>,
pub notification_type: Option<String>,
pub stop_hook_active: Option<bool>,
pub trigger: Option<String>,
pub custom_instructions: Option<String>,
pub source: Option<String>,
pub reason: Option<String>,
pub prompt_response: Option<String>,
pub timestamp: Option<String>,
}Expand description
Hook event payload received from Claude Code via stdin.
This matches the JSON schema that Claude Code sends to hook commands. Fields vary by hook type - we capture them all and let the Haskell handler pick what it needs.
Fields§
§session_id: SessionIdSession ID from Claude Code.
transcript_path: StringPath to the transcript file.
cwd: StringCurrent working directory.
permission_mode: StringPermission mode (default, plan, acceptEdits, dontAsk, bypassPermissions).
hook_event_name: StringThe hook event name (PreToolUse, PostToolUse, etc.).
runtime: Option<Runtime>Runtime environment (claude, gemini). Injected by Rust before WASM call.
tool_name: Option<ToolName>Tool name for tool-related hooks.
tool_input: Option<Value>Tool input arguments for tool-related hooks.
tool_use_id: Option<String>Tool use ID for tool-related hooks.
tool_response: Option<Value>Tool response (PostToolUse only).
prompt: Option<String>User prompt text (UserPromptSubmit).
message: Option<String>Notification message (Notification).
notification_type: Option<String>Notification type (Notification).
stop_hook_active: Option<bool>Whether stop hook is active (Stop, SubagentStop).
trigger: Option<String>Compact trigger (PreCompact).
custom_instructions: Option<String>Custom instructions (PreCompact).
source: Option<String>Session start source (SessionStart).
reason: Option<String>Session end reason (SessionEnd).
prompt_response: Option<String>Agent’s response text (AfterAgent). Ref: https://geminicli.com/docs/hooks/reference/#afteragent
timestamp: Option<String>Event timestamp. Ref: https://geminicli.com/docs/hooks/reference/#afteragent
Trait Implementations§
Source§impl<'de> Deserialize<'de> for HookInput
impl<'de> Deserialize<'de> for HookInput
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>,
impl StructuralPartialEq for HookInput
Auto Trait Implementations§
impl Freeze for HookInput
impl RefUnwindSafe for HookInput
impl Send for HookInput
impl Sync for HookInput
impl Unpin for HookInput
impl UnwindSafe for HookInput
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FromResponse for Twhere
T: DeserializeOwned,
impl<T> FromResponse for Twhere
T: DeserializeOwned,
Source§impl<T> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
self file descriptor. Read moreSource§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more