pub struct Toolset<D = ()>{ /* private fields */ }Expand description
Reusable, append-only collection of tools.
D is the same typed-deps parameter used by Tool and
ToolRegistry. A Toolset<D> may only be installed into a
ToolRegistry<D>, preserving the operator’s dependency boundary
at compile time.
Implementations§
Source§impl<D> Toolset<D>
impl<D> Toolset<D>
Sourcepub fn new(id: impl Into<String>) -> Result<Self>
pub fn new(id: impl Into<String>) -> Result<Self>
Create an empty toolset with a stable id.
The id is operator-facing metadata used by capability manifests, test fixtures, and durable-runtime activity names. It is not sent to the model and does not alter tool names.
Sourcepub fn tool_specs(&self) -> Arc<[ToolSpec]> ⓘ
pub fn tool_specs(&self) -> Arc<[ToolSpec]> ⓘ
Return model-facing tool specs in stable lexical order.
This is an inspection helper for tests and capability
manifests. Agents should still derive their final advertised
tool catalogue from the installed ToolRegistry.
Sourcepub fn register(self, tool: Arc<dyn Tool<D>>) -> Result<Self>
pub fn register(self, tool: Arc<dyn Tool<D>>) -> Result<Self>
Append one tool to the set.
Reach for this when assembling a reusable bundle the operator
installs into multiple ToolRegistry<D> instances —
Toolset::new("support").register(tool_a)?.register(tool_b)? .install_into(registry)? is the canonical capability-bundle
path. Duplicate names are rejected: a toolset with ambiguous
names cannot be installed safely because later restriction
and approval policies address tools by exact name.
Sourcepub fn restricted_to(&self, allowed: &[&str]) -> Result<Self>
pub fn restricted_to(&self, allowed: &[&str]) -> Result<Self>
Produce a strict-name restricted view of this set.
Names absent from the toolset are configuration errors. Empty names and duplicate names are also rejected, keeping the declaration surface deterministic and typo-safe.
Source§impl<D> Toolset<D>
impl<D> Toolset<D>
Sourcepub fn install_into(&self, registry: ToolRegistry<D>) -> Result<ToolRegistry<D>>
pub fn install_into(&self, registry: ToolRegistry<D>) -> Result<ToolRegistry<D>>
Install this set into an existing registry.
The supplied registry’s deps and layer stack are preserved.
Registration remains append-only; name collisions with tools
already present in the registry surface as Error::Config
from ToolRegistry::register.