pub struct WasmHookManager { /* private fields */ }Expand description
Manages hook dispatching to WASM extensions.
Implementations§
Source§impl WasmHookManager
impl WasmHookManager
Sourcepub fn new(extensions: Arc<WasmExtensionManager>) -> Self
pub fn new(extensions: Arc<WasmExtensionManager>) -> Self
Create a new hook manager.
Sourcepub fn fire_tool_call(
&self,
tool_name: &str,
tool_call_id: &str,
input: &Value,
) -> Option<ToolCallHookResult>
pub fn fire_tool_call( &self, tool_name: &str, tool_call_id: &str, input: &Value, ) -> Option<ToolCallHookResult>
Fire on_tool_call for all extensions. Returns first block result.
Sourcepub fn fire_tool_result(
&self,
tool_name: &str,
tool_call_id: &str,
content: &str,
is_error: bool,
) -> Option<ToolResultHookResult>
pub fn fire_tool_result( &self, tool_name: &str, tool_call_id: &str, content: &str, is_error: bool, ) -> Option<ToolResultHookResult>
Fire on_tool_result for all extensions. Returns first modification.
Sourcepub fn fire_session_shutdown(&self, reason: &str)
pub fn fire_session_shutdown(&self, reason: &str)
Fire on_session_shutdown for all extensions.
Sourcepub fn fire_agent_event(&self, event_name: &str, event_data: &Value)
pub fn fire_agent_event(&self, event_name: &str, event_data: &Value)
Fire on_agent_event for all extensions (fire-and-forget).
Sourcepub fn drain_notifications(&self) -> Vec<PendingNotification>
pub fn drain_notifications(&self) -> Vec<PendingNotification>
Drain all pending notifications. Called by TUI.
Sourcepub fn drain_messages(&self) -> Vec<PendingMessage>
pub fn drain_messages(&self) -> Vec<PendingMessage>
Drain all pending messages. Called by agent loop.
Auto Trait Implementations§
impl Freeze for WasmHookManager
impl !RefUnwindSafe for WasmHookManager
impl Send for WasmHookManager
impl Sync for WasmHookManager
impl Unpin for WasmHookManager
impl UnsafeUnpin for WasmHookManager
impl !UnwindSafe for WasmHookManager
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> GetSetFdFlags for T
impl<T> GetSetFdFlags for T
Source§fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
fn get_fd_flags(&self) -> Result<FdFlags, Error>where
T: AsFilelike,
Query the “status” flags for the
self file descriptor.Source§fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
fn new_set_fd_flags(&self, fd_flags: FdFlags) -> Result<SetFdFlags<T>, Error>where
T: AsFilelike,
Source§fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
fn set_fd_flags(&mut self, set_fd_flags: SetFdFlags<T>) -> Result<(), Error>where
T: AsFilelike,
Set the “status” flags for the
self file descriptor. Read moreSource§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