pub enum HookKind {
BeforeToolCall,
AfterToolCall,
BeforeMessage,
OnMessageComplete,
OnCompaction,
OnSessionStart,
OnSessionEnd,
}Expand description
All hook event kinds in the phase-1 catalog.
Each variant identifies a well-defined extension point in the agent loop. The set is intentionally closed; new kinds are added via a breaking version bump so existing permission grants stay coherent.
Variants§
BeforeToolCall
Fires immediately before a tool is invoked. Handlers may block the call.
AfterToolCall
Fires immediately after a tool returns. Handlers receive the output.
BeforeMessage
Fires before an LLM message is sent. Handlers may inspect or block.
OnMessageComplete
Fires after an assistant response is completed and added to history.
OnCompaction
Fires after conversation compaction creates a replacement session.
OnSessionStart
Fires when a new session is created.
OnSessionEnd
Fires when a session is torn down.
Implementations§
Source§impl HookKind
impl HookKind
Sourcepub fn as_str(&self) -> &'static str
pub fn as_str(&self) -> &'static str
Canonical string identifier for this kind, suitable for serialization keys, log output, and manifest declarations.
Sourcepub fn from_str(s: &str) -> Option<Self>
pub fn from_str(s: &str) -> Option<Self>
Parse from the canonical string representation.
Returns None for unrecognised strings so callers can surface
a manifest validation error rather than silently dropping hooks.
Sourcepub fn allowed_action_names(&self) -> &'static [&'static str]
pub fn allowed_action_names(&self) -> &'static [&'static str]
Supported action names for this hook in the extension contract.
Sourcepub fn allows_tool_filter(&self) -> bool
pub fn allows_tool_filter(&self) -> bool
Whether this hook can be filtered by tool name in a manifest.
Sourcepub fn allows_result(&self, result: &HookResult) -> bool
pub fn allows_result(&self, result: &HookResult) -> bool
Whether this hook accepts a handler result action.
Sourcepub fn required_permission(&self) -> Permission
pub fn required_permission(&self) -> Permission
The Permission an extension must hold to subscribe to this hook.
Called by the permission gate before delivering any event; if the
extension’s PermissionSet
does not include this permission, HookBus::subscribe() returns an error.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for HookKind
impl<'de> Deserialize<'de> for HookKind
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 Copy for HookKind
impl Eq for HookKind
impl StructuralPartialEq for HookKind
Auto Trait Implementations§
impl Freeze for HookKind
impl RefUnwindSafe for HookKind
impl Send for HookKind
impl Sync for HookKind
impl Unpin for HookKind
impl UnsafeUnpin for HookKind
impl UnwindSafe for HookKind
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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.