pub trait KernelToolProvider: Send + Sync {
// Required methods
fn tool_names(&self) -> Vec<&str>;
fn register_tools(
&self,
registry: &ToolRegistry,
context: &KernelToolContext,
);
}Expand description
Trait for providing kernel-level tools to the SDK.
oxios-kernel implements this trait to bridge its native tools (exec, memory, browser, persona, etc.) into the oxi agent tool registry.
§Example
ⓘ
use oxi_sdk::{KernelToolProvider, KernelToolContext};
use oxi_agent::ToolRegistry;
struct MyKernelBridge;
impl KernelToolProvider for MyKernelBridge {
fn tool_names(&self) -> Vec<&str> {
vec!["exec", "memory"]
}
fn register_tools(&self, registry: &ToolRegistry, ctx: &KernelToolContext) {
registry.register(ExecTool::new(ctx.agent_id.clone()));
registry.register(MemoryTool::new(ctx.agent_id.clone()));
}
}Required Methods§
Sourcefn tool_names(&self) -> Vec<&str>
fn tool_names(&self) -> Vec<&str>
Return the names of tools this provider will register.
Sourcefn register_tools(&self, registry: &ToolRegistry, context: &KernelToolContext)
fn register_tools(&self, registry: &ToolRegistry, context: &KernelToolContext)
Register tools into the given registry.
The context provides agent-specific metadata (workspace, agent_id,
session, permissions) that tools may need at initialization time.