ParsedHookInput

Struct ParsedHookInput 

Source
pub struct ParsedHookInput {
Show 20 fields pub session_id: Option<String>, pub tool_use_id: Option<String>, pub tool_name: Option<String>, pub subagent_type: Option<String>, pub spawned_agent_id: Option<String>, pub permission_mode: Option<String>, pub transcript_path: Option<String>, pub cwd: Option<String>, pub session_source: Option<String>, pub agent_id: Option<String>, pub agent_transcript_path: Option<String>, pub compact_trigger: Option<String>, pub model: Option<String>, pub duration_ms: Option<i64>, pub tokens_input: Option<i64>, pub tokens_output: Option<i64>, pub tokens_cache_read: Option<i64>, pub tokens_cache_write: Option<i64>, pub cost_usd: Option<f64>, pub prompt: Option<String>,
}
Expand description

Parsed hook input with normalized fields.

This struct contains fields extracted from framework-specific hook JSON, normalized to a common format for storage.

Fields§

§session_id: Option<String>

Session identifier

§tool_use_id: Option<String>

Tool use correlation ID

§tool_name: Option<String>

Tool name (Bash, Read, Write, etc.)

§subagent_type: Option<String>

Subagent type for Task tool

§spawned_agent_id: Option<String>

Spawned agent ID from PostToolUse

§permission_mode: Option<String>

Permission mode

§transcript_path: Option<String>

Transcript file path

§cwd: Option<String>

Working directory

§session_source: Option<String>

SessionStart source (startup, resume, clear)

§agent_id: Option<String>

Agent ID from SubagentStop/SubagentStart

§agent_transcript_path: Option<String>

Path to agent’s transcript file (from SubagentStop)

§compact_trigger: Option<String>

PreCompact trigger type (manual, auto)

§model: Option<String>

Model name (e.g., “claude-3-opus”, “gpt-4”)

§duration_ms: Option<i64>

Duration in milliseconds (for tool execution, API calls, etc.)

§tokens_input: Option<i64>

Input tokens used

§tokens_output: Option<i64>

Output tokens generated

§tokens_cache_read: Option<i64>

Tokens read from cache

§tokens_cache_write: Option<i64>

Tokens written to cache

§cost_usd: Option<f64>

Cost in USD

§prompt: Option<String>

User prompt text (for UserPromptSubmit events)

Trait Implementations§

Source§

impl Clone for ParsedHookInput

Source§

fn clone(&self) -> ParsedHookInput

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for ParsedHookInput

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for ParsedHookInput

Source§

fn default() -> ParsedHookInput

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.