pub struct PiMonoHook { /* private fields */ }Expand description
Pi-Mono hook for extracting memory from pi-mono session execution.
Uses a native TypeScript extension (not SKILL.md) that integrates with pi-mono’s extension API for full lifecycle event coverage.
§Integration Points
- Extension:
~/.pi/agent/extensions/nexus-memory.ts - Transport: CLI (
nexus session start,nexus ingest-hook-event) - Fallback: Process monitoring +
.pi/sessions/file scanning
§Lifecycle Coverage
All five lifecycle events are supported:
session_start— via extensionsession_starteventsession_end— via extensionsession_shutdowneventcheckpoint— via debouncedagent_endand explicit triggerserror_hook— synthetic from failedtool_result/ abnormalagent_endcompact— via extensionsession_compactevent
Implementations§
Source§impl PiMonoHook
impl PiMonoHook
Sourcepub const AGENT_TYPE: &'static str = "pi-mono"
pub const AGENT_TYPE: &'static str = "pi-mono"
Agent type string
Sourcepub const CONFIG_DIR_NAME: &'static str = ".pi"
pub const CONFIG_DIR_NAME: &'static str = ".pi"
Config directory name
Sourcepub const EXTENSIONS_SUBDIR: &'static str = "agent/extensions"
pub const EXTENSIONS_SUBDIR: &'static str = "agent/extensions"
Extensions subdirectory
Sourcepub const SESSIONS_SUBDIR: &'static str = "sessions"
pub const SESSIONS_SUBDIR: &'static str = "sessions"
Sessions subdirectory
Sourcepub const LOGS_SUBDIR: &'static str = "logs"
pub const LOGS_SUBDIR: &'static str = "logs"
Logs subdirectory
Sourcepub fn new_readonly() -> Self
pub fn new_readonly() -> Self
Create a new Pi-Mono hook without mutating user state.
Trait Implementations§
Source§impl AgentHook for PiMonoHook
impl AgentHook for PiMonoHook
fn agent_type(&self) -> &str
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_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_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_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_error_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 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 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 is_hook_installed(&self) -> bool
fn reliability_score(&self) -> f32
fn lifecycle_capabilities(&self) -> LifecycleCapabilities
fn support_tier(&self) -> SupportTier
fn uninstall_hooks<'life0, 'async_trait>(
&'life0 mut self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn record_activity(&self)
Auto Trait Implementations§
impl !Freeze for PiMonoHook
impl !RefUnwindSafe for PiMonoHook
impl Send for PiMonoHook
impl Sync for PiMonoHook
impl Unpin for PiMonoHook
impl UnsafeUnpin for PiMonoHook
impl !UnwindSafe for PiMonoHook
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