#[non_exhaustive]pub enum HookEvent<'a> {
SessionStart {
goal: &'a str,
},
PreToolCall {
name: &'a str,
args: &'a Value,
},
PostToolCall {
name: &'a str,
args: &'a Value,
result: &'a str,
duration_ms: u64,
},
PreCompact {
transcript_len: usize,
},
PostCompact {
removed: usize,
summary_chars: usize,
},
SessionEnd {
outcome: &'a AgentOutcome,
},
}Expand description
Events emitted at lifecycle points during an agent run.
This enum is #[non_exhaustive] — new variants may be added in future
releases without a breaking change.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
SessionStart
Fired at the start of Agent::run(), before any LLM call.
PreToolCall
Fired before a tool is dispatched (after the permission hook).
Fields
PostToolCall
Fired after a tool returns.
Fields
PreCompact
Fired before compaction is attempted.
PostCompact
Fired after compaction completes.
Fields
SessionEnd
Fired just before returning from Agent::run().
Fields
§
outcome: &'a AgentOutcomeThe outcome that will be returned.
Trait Implementations§
Auto Trait Implementations§
impl<'a> Freeze for HookEvent<'a>
impl<'a> RefUnwindSafe for HookEvent<'a>
impl<'a> Send for HookEvent<'a>
impl<'a> Sync for HookEvent<'a>
impl<'a> Unpin for HookEvent<'a>
impl<'a> UnsafeUnpin for HookEvent<'a>
impl<'a> UnwindSafe for HookEvent<'a>
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