pub fn register_tools_from_cspace(
registry: &ToolRegistry,
kernel: &KernelHandle,
cspace: &CSpace,
search_cache: Arc<SearchCache>,
agent_id: AgentId,
)Expand description
Register tools into registry based on the agent’s CSpace.
First registers the always-on tier (file ops + web search), then walks every capability in the CSpace and conditionally registers the corresponding kernel tools.
§Arguments
registry— The agent’s tool registry to populate.kernel— Handle to the kernel for constructing tool instances.cspace— The agent’s capability space (determines which tools are available).search_cache— Shared search cache for web search tools.agent_id— The agent’s ID (used by A2A tools for routing).
§CSpace → Tool mapping
| ResourceRef | Required rights | Registered tools |
|---|---|---|
Exec { .. } | EXECUTE | ExecTool |
KernelDomain { "memory" } | READ | MemoryReadTool, MemorySearchTool |
KernelDomain { "memory" } | WRITE | MemoryWriteTool |
KernelDomain { "project" } | any | ProjectTool |
KernelDomain { "agent" } | any | KernelAgentTool |
KernelDomain { "a2a" } | any | A2aDelegateTool, A2aSendTool, A2aQueryTool |
KernelDomain { "persona" } | any | PersonaTool |
KernelDomain { "program" } | any | (deprecated — skills via CSpace) |
KernelDomain { "cron" } | any | CronTool |
KernelDomain { "security" } | any | SecurityTool |
KernelDomain { "budget" } | any | BudgetTool |
KernelDomain { "resource" } | any | ResourceTool |
KernelDomain { "mcp" } | any | McpToolWrapper |
Program { .. } | — | (not registered; surfaced via ToolRetriever) |