pub struct ToolExecutor { /* private fields */ }Expand description
Assembles invocation catalogs and processes their newly declared batches.
Registrations affect future bindings; unregistering does not revoke an existing binding. Static names come only from each tool’s definition.
Implementations§
Source§impl ToolExecutor
impl ToolExecutor
Sourcepub async fn bind(
&self,
invocation_id: InvocationId,
control: CallControl,
) -> Result<BoundTools<'_>, ToolCatalogError>
pub async fn bind( &self, invocation_id: InvocationId, control: CallControl, ) -> Result<BoundTools<'_>, ToolCatalogError>
Fixes an ordered catalog, the tools’ declared hints and their concrete
dispatch targets for one invocation. Static tools give
Tool::definition and Tool::hints; dynamic sources give
causa_kernel::DynamicToolSource::describe. Listing failures abort
acquisition rather than using stale definitions or silently omitting a
source.
Source§impl ToolExecutor
impl ToolExecutor
Sourcepub fn new(
tools: Vec<Arc<dyn Tool>>,
options: ToolExecutorOptions,
) -> Result<Self, ToolRegistryError>
pub fn new( tools: Vec<Arc<dyn Tool>>, options: ToolExecutorOptions, ) -> Result<Self, ToolRegistryError>
Constructs the sole executor configuration, rejecting static names that occur twice even when the tools or definitions are identical.
Sourcepub fn register_dynamic(
&self,
source: Arc<dyn DynamicToolSource>,
) -> Result<(), ToolRegistryError>
pub fn register_dynamic( &self, source: Arc<dyn DynamicToolSource>, ) -> Result<(), ToolRegistryError>
Registers a source without listing it. Each registration receives a separate private cache, even if the source Arc was registered before.
Sourcepub fn unregister_dynamic(
&self,
id: &str,
) -> Result<Arc<dyn DynamicToolSource>, ToolRegistryError>
pub fn unregister_dynamic( &self, id: &str, ) -> Result<Arc<dyn DynamicToolSource>, ToolRegistryError>
Removes a source and returns it. Existing bindings and in-flight binds retain the concrete registration they already acquired.
Sourcepub fn dynamic_ids(&self) -> Vec<String>
pub fn dynamic_ids(&self) -> Vec<String>
Returns source identities in registration order.