pub struct ToolRegistry { /* private fields */ }Expand description
An ordered set of tools offered to the model.
Implementations§
Source§impl ToolRegistry
impl ToolRegistry
Sourcepub fn new() -> ToolRegistry
pub fn new() -> ToolRegistry
An empty registry.
Sourcepub fn with_builtins() -> ToolRegistry
pub fn with_builtins() -> ToolRegistry
A registry pre-populated with all built-in tools.
Sourcepub fn from_config(config: &Config) -> ToolRegistry
pub fn from_config(config: &Config) -> ToolRegistry
P3 (COMPOSABLE-HARNESS-DESIGN.md §5.2 phase P3): build a registry
from a resolved Config’s module-activation set, the intended
replacement for unconditional Self::with_builtins call sites.
Mandatory risk-2 mitigation (§5.3 risk 2 — “land P3 behind
[experimental] module_registry = true”): when
Config::module_registry is false (the default), this returns
EXACTLY Self::with_builtins — same 10 tools, same order, zero
behavior change. Only when the flag is explicitly on does
Config::module_activation/Config::core_tools_enabled start
shaping which tool objects get registered AT ALL: a disabled module
contributes no tool (never registered, so never advertised and never
mentioned anywhere) — e.g. todos off means update_plan is not in
this registry; tools_search off (or its list_dir/glob/
content_search sub-flags off) means the corresponding tool is
absent too.
Sourcepub fn register(&mut self, tool: impl Tool + 'static)
pub fn register(&mut self, tool: impl Tool + 'static)
Add a tool. A later registration with the same name shadows the earlier.