pub struct Env<H: Host = NoHost> {
pub host: H,
/* private fields */
}Fields§
§host: HHost providing server-specific functionality.
Implementations§
Source§impl<H: Host> Env<H>
impl<H: Host> Env<H>
Sourcepub fn new(
skills: SkillHandler,
mcp: McpHandler,
cwd: PathBuf,
memory: Option<Memory>,
host: H,
) -> Self
pub fn new( skills: SkillHandler, mcp: McpHandler, cwd: PathBuf, memory: Option<Memory>, host: H, ) -> Self
Create a new Env with the given backends.
Sourcepub fn mcp_servers(&self) -> Vec<(String, Vec<String>)>
pub fn mcp_servers(&self) -> Vec<(String, Vec<String>)>
List connected MCP servers with their tool names.
Sourcepub fn register_scope(&mut self, name: String, config: &AgentConfig)
pub fn register_scope(&mut self, name: String, config: &AgentConfig)
Register an agent’s scope for dispatch enforcement.
Source§impl<H: Host> Env<H>
impl<H: Host> Env<H>
pub async fn dispatch_recall(&self, args: &str) -> Result<String, String>
pub async fn dispatch_remember(&self, args: &str) -> Result<String, String>
pub async fn dispatch_forget(&self, args: &str) -> Result<String, String>
pub async fn dispatch_memory(&self, args: &str) -> Result<String, String>
Source§impl<H: Host> Env<H>
impl<H: Host> Env<H>
Sourcepub async fn dispatch_bash(
&self,
args: &str,
conversation_id: Option<u64>,
) -> Result<String, String>
pub async fn dispatch_bash( &self, args: &str, conversation_id: Option<u64>, ) -> Result<String, String>
Dispatch a bash tool call — run a command directly.
A non-zero exit code is not an Err — the shell ran successfully
and the JSON payload describes the outcome. Only dispatcher-level
failures (spawn error, wait error, timeout) become Err.
Trait Implementations§
Source§impl<H: Host + 'static> Hook for Env<H>
impl<H: Host + 'static> Hook for Env<H>
Source§fn on_build_agent(&self, config: AgentConfig) -> AgentConfig
fn on_build_agent(&self, config: AgentConfig) -> AgentConfig
Source§fn preprocess(&self, agent: &str, content: &str) -> String
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,
conversation_id: u64,
history: &[HistoryEntry],
) -> Vec<HistoryEntry>
fn on_before_run( &self, agent: &str, conversation_id: u64, history: &[HistoryEntry], ) -> Vec<HistoryEntry>
Called by Runtime before each agent run (send_to / stream_to). Read more
Source§async fn on_register_tools(&self, tools: &mut ToolRegistry)
async fn on_register_tools(&self, tools: &mut ToolRegistry)
Called by
Runtime::new() to register tool schemas into the registry. Read moreAuto Trait Implementations§
impl<H = NoHost> !Freeze for Env<H>
impl<H = NoHost> !RefUnwindSafe for Env<H>
impl<H> Send for Env<H>
impl<H> Sync for Env<H>
impl<H> Unpin for Env<H>where
H: Unpin,
impl<H> UnsafeUnpin for Env<H>where
H: UnsafeUnpin,
impl<H = NoHost> !UnwindSafe for Env<H>
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