Skip to main content

DaemonHook

Struct DaemonHook 

Source
pub struct DaemonHook {
    pub skills: SkillHandler,
    pub mcp: McpHandler,
    pub tasks: Arc<Mutex<TaskSet>>,
    pub downloads: Arc<Mutex<DownloadRegistry>>,
    pub permissions: PermissionConfig,
    pub sandboxed: bool,
    pub memory: Option<Memory>,
    /* private fields */
}

Fields§

§skills: SkillHandler§mcp: McpHandler§tasks: Arc<Mutex<TaskSet>>§downloads: Arc<Mutex<DownloadRegistry>>§permissions: PermissionConfig§sandboxed: bool

Whether the daemon is running as the walrus OS user (sandbox active).

§memory: Option<Memory>

Built-in memory.

Implementations§

Source§

impl DaemonHook

Source

pub fn new( skills: SkillHandler, mcp: McpHandler, tasks: Arc<Mutex<TaskSet>>, downloads: Arc<Mutex<DownloadRegistry>>, permissions: PermissionConfig, sandboxed: bool, memory: Option<Memory>, registry: Option<Arc<ServiceRegistry>>, event_tx: DaemonEventSender, ) -> Self

Create a new DaemonHook with the given backends.

Source

pub async fn dispatch_tool( &self, name: &str, args: &str, agent: &str, sender: &str, ) -> String

Route a tool call by name to the appropriate handler.

This is the single dispatch entry point — event.rs calls this and never matches on tool names itself. Unrecognised names are forwarded to the MCP bridge after a warn-level log.

Trait Implementations§

Source§

impl Hook for DaemonHook

Source§

fn on_build_agent(&self, config: AgentConfig) -> AgentConfig

Called by Runtime::add_agent() before building the Agent. Read more
Source§

fn preprocess(&self, agent: &str, content: &str) -> String

Called by Runtime to preprocess user content before it becomes a message. Read more
Source§

fn on_before_run(&self, agent: &str, history: &[Message]) -> Vec<Message>

Called by Runtime before each agent run (send_to / stream_to). Read more
Source§

async fn on_register_tools(&self, tools: &mut ToolRegistry)

Called by Runtime::new() to register tool schemas into the registry. Read more
Source§

fn on_after_compact(&self, agent: &str, summary: &str)

Called when an agent’s context is compacted. Read more
Source§

fn on_event(&self, agent: &str, event: &AgentEvent)

Called by Runtime after each agent step during execution. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more