pub struct CLIHook { /* private fields */ }Expand description
Generic CLI hook using atexit and signal handling
Used for agents that don’t have native hook support:
- OpenCode
- Codex
- Amp
- Droid
- Hermes
- Other generic agents
Implementations§
Trait Implementations§
Source§impl AgentHook for CLIHook
impl AgentHook for CLIHook
Source§fn agent_type(&self) -> &str
fn agent_type(&self) -> &str
Get the agent type this hook handles
Source§fn install_session_end_hook<'life0, 'async_trait>(
&'life0 mut self,
callback: SessionEndCallback,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn install_session_end_hook<'life0, 'async_trait>(
&'life0 mut self,
callback: SessionEndCallback,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Install the session end hook Read more
Source§fn detect_session_activity<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<SessionActivity>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn detect_session_activity<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<SessionActivity>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Detect if the agent session is currently active Read more
Source§fn extract_session_context<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<SessionContext>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn extract_session_context<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<SessionContext>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Extract session context from the agent Read more
Source§fn is_hook_installed(&self) -> bool
fn is_hook_installed(&self) -> bool
Optional: Check if native hook is installed
Source§fn reliability_score(&self) -> f32
fn reliability_score(&self) -> f32
Optional: Get hook reliability score (0.0-1.0)
Source§fn lifecycle_capabilities(&self) -> LifecycleCapabilities
fn lifecycle_capabilities(&self) -> LifecycleCapabilities
Report which lifecycle events this agent hook supports. Read more
Source§fn support_tier(&self) -> SupportTier
fn support_tier(&self) -> SupportTier
Report the support tier for this agent hook. Read more
Source§fn install_session_start_hook<'life0, 'async_trait>(
&'life0 mut self,
_callback: SessionEndCallback,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn install_session_start_hook<'life0, 'async_trait>(
&'life0 mut self,
_callback: SessionEndCallback,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Optional: Install the session start hook.
Source§fn install_compact_hook<'life0, 'async_trait>(
&'life0 mut self,
_callback: SessionEndCallback,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn install_compact_hook<'life0, 'async_trait>(
&'life0 mut self,
_callback: SessionEndCallback,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Optional: Install a compact/checkpoint hook.
Source§fn install_checkpoint_hook<'life0, 'async_trait>(
&'life0 mut self,
_callback: SessionEndCallback,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn install_checkpoint_hook<'life0, 'async_trait>(
&'life0 mut self,
_callback: SessionEndCallback,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Optional: Install a checkpoint hook Read more
Auto Trait Implementations§
impl Freeze for CLIHook
impl !RefUnwindSafe for CLIHook
impl Send for CLIHook
impl Sync for CLIHook
impl Unpin for CLIHook
impl UnsafeUnpin for CLIHook
impl !UnwindSafe for CLIHook
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
Source§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>
Converts
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>
Converts
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