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.
BP-1: this is now the default path. Every Config materialized
by crate::configfile::resolve carries
Config::module_registry = true, so a preset’s
[capabilities.*] and [core.tools] enabled actually shape the
registry. [experimental] module_registry = false is the explicit
OPT-OUT that pins a resolved config back to the unfiltered stack,
and a hand-built Config::default (which never went through the
resolver) still has the flag false. In that false state this
returns EXACTLY Self::with_builtins — same 10 tools, same
order, zero behavior change. When it is on,
Config::module_activation/Config::core_tools_enabled
shape 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.