pub struct ToolRegistry { /* private fields */ }Implementations§
Source§impl ToolRegistry
impl ToolRegistry
Sourcepub async fn suggest_fallback_tool(&self, failed_tool: &str) -> Option<String>
pub async fn suggest_fallback_tool(&self, failed_tool: &str) -> Option<String>
Suggest a fallback tool for a failed invocation using lightweight heuristics.
Sourcepub async fn available_tools(&self) -> Vec<String>
pub async fn available_tools(&self) -> Vec<String>
Get a list of all available tools, including MCP tools.
Sourcepub async fn get_tool_schema(&self, tool_name: &str) -> Option<Value>
pub async fn get_tool_schema(&self, tool_name: &str) -> Option<Value>
Get the schema for a specific tool.
Source§impl ToolRegistry
impl ToolRegistry
pub fn new(workspace_root: PathBuf) -> impl Future<Output = Self>
Sourcepub fn new_with_loaded_config(
workspace_root: PathBuf,
config: &VTCodeConfig,
) -> impl Future<Output = Self>
pub fn new_with_loaded_config( workspace_root: PathBuf, config: &VTCodeConfig, ) -> impl Future<Output = Self>
Build a registry reusing an already-loaded session config snapshot.
Interactive startup already owns the merged VTCodeConfig; passing it
here avoids a second ConfigManager::load_from_workspace file read +
TOML parse on the first-paint path. Falls back to defaults for any
field the snapshot does not carry, matching load_workspace_tool_config
behavior on parse failure.
Sourcepub fn new_for_first_paint_with_loaded_config(
workspace_root: PathBuf,
config: &VTCodeConfig,
) -> impl Future<Output = Self>
pub fn new_for_first_paint_with_loaded_config( workspace_root: PathBuf, config: &VTCodeConfig, ) -> impl Future<Output = Self>
Build a first-paint registry: reuses the loaded session config snapshot and skips workspace policy file I/O.
Policy evaluation fails open to tool metadata defaults until hydration
attaches the manager via ensure_workspace_policy_manager, which runs
before any tool executes.
pub fn new_with_config( workspace_root: PathBuf, pty_config: PtyConfig, ) -> impl Future<Output = Self>
Sourcepub fn new_for_schema(workspace_root: PathBuf) -> impl Future<Output = Self>
pub fn new_for_schema(workspace_root: PathBuf) -> impl Future<Output = Self>
Build a registry for offline metadata without creating a workspace policy file.
pub fn new_with_custom_policy( workspace_root: PathBuf, policy_manager: ToolPolicyManager, ) -> impl Future<Output = Self>
pub fn new_with_custom_policy_and_config( workspace_root: PathBuf, pty_config: PtyConfig, policy_manager: ToolPolicyManager, ) -> impl Future<Output = Self>
Source§impl ToolRegistry
impl ToolRegistry
Sourcepub fn file_cache(&self) -> &'static FileCache
pub fn file_cache(&self) -> &'static FileCache
Access the file cache used by this registry.
Returns the global FileCache instance. In a future phase, this will
return a per-registry cache instance to enable test isolation.
pub async fn cache_stats(&self) -> Value
pub async fn clear_cache(&self)
Source§impl ToolRegistry
impl ToolRegistry
pub async fn public_tool_names( &self, surface: SessionSurface, capability_level: CapabilityLevel, ) -> Vec<String>
pub async fn schema_entries( &self, config: SessionToolsConfig, ) -> Vec<ToolSchemaEntry>
pub async fn function_declarations( &self, config: SessionToolsConfig, ) -> Vec<FunctionDeclaration>
pub async fn model_tools( &self, config: SessionToolsConfig, ) -> Vec<ToolDefinition>
pub async fn schema_for_public_name( &self, name: &str, config: SessionToolsConfig, ) -> Option<ToolSchemaEntry>
Source§impl ToolRegistry
impl ToolRegistry
Sourcepub async fn enable_cgp_pipeline(&self, mode: CgpRuntimeMode)
pub async fn enable_cgp_pipeline(&self, mode: CgpRuntimeMode)
Enable the CGP pipeline for all registered tools.
This replaces each eligible tool’s handler with a CGP ToolFacade
determined by the runtime mode. Registrations that provide a native CGP
factory use that directly; TraitObject handlers are wrapped with
registration-backed metadata before entering the passthrough bridge, and
RegistryFn handlers are projected through a concrete RegistryFnTool.
Sourcepub async fn register_cgp_tool(
&self,
tool: Arc<dyn Tool>,
capability: CapabilityLevel,
mode: CgpRuntimeMode,
) -> Result<()>
pub async fn register_cgp_tool( &self, tool: Arc<dyn Tool>, capability: CapabilityLevel, mode: CgpRuntimeMode, ) -> Result<()>
Wrap a single tool through the CGP pipeline and register it.
This is the preferred path for new tool registrations that should participate in the CGP approval/sandbox/logging/cache/retry pipeline.
Source§impl ToolRegistry
impl ToolRegistry
pub fn apply_commands_config(&self, commands_config: &CommandsConfig)
pub fn commands_config(&self) -> CommandsConfig
Source§impl ToolRegistry
impl ToolRegistry
Sourcepub async fn execute_tool_dual(
&self,
name: &str,
args: Value,
) -> Result<SplitToolResult>
pub async fn execute_tool_dual( &self, name: &str, args: Value, ) -> Result<SplitToolResult>
Execute tool with dual-channel output (Phase 4: Split Tool Results).
This method enables significant token savings by separating:
llm_content: Concise summary sent to LLM context (token-optimized)ui_content: Rich output displayed to user (full details)
For tools with registered summarizers, this can achieve 90-97% token reduction on tool outputs while preserving full details for the UI.
§Example
This snippet is illustrative; registry setup and argument construction are omitted because they depend on the caller’s tool inventory.
let result = registry.execute_tool_dual("grep_file", args).await?;
// result.llm_content: "Found 127 matches in 15 files. Key: src/tools/grep.rs (3)"
// result.ui_content: [Full formatted output with all 127 matches]
// Savings: ~98% token reductionSource§impl ToolRegistry
impl ToolRegistry
pub fn safety_gateway(&self) -> Arc<SafetyGateway> ⓘ
Sourcepub fn execute_public_tool_request(
&self,
request: ToolExecutionRequest,
) -> impl Future<Output = ToolExecutionOutcome> + '_
pub fn execute_public_tool_request( &self, request: ToolExecutionRequest, ) -> impl Future<Output = ToolExecutionOutcome> + '_
Inline-delegating wrapper that returns the inner future directly to avoid an extra coroutine state machine (audit section 16).
pub async fn execute_prepared_public_tool_request( &self, prepared: &PreparedToolCall, policy: ExecutionPolicySnapshot, ) -> ToolExecutionOutcome
pub fn preflight_validate_call( &self, name: &str, args: &Value, ) -> Result<ToolPreflightOutcome>
Sourcepub fn preflight_validate_harness_call(
&self,
name: &str,
args: &Value,
) -> Result<ToolPreflightOutcome>
pub fn preflight_validate_harness_call( &self, name: &str, args: &Value, ) -> Result<ToolPreflightOutcome>
Preflight a tool call from the harness path, allowing dispatch to
internal (model-hidden) tool registrations such as read_file/write_file.
Direct model-originated entry should use preflight_validate_call.
pub fn admit_public_tool_call( &self, name: &str, args: &Value, ) -> Result<PreparedToolCall>
pub async fn execute_tool(&self, name: &str, args: Value) -> Result<Value>
Sourcepub async fn execute_public_tool_ref(
&self,
name: &str,
args: &Value,
) -> Result<Value>
pub async fn execute_public_tool_ref( &self, name: &str, args: &Value, ) -> Result<Value>
Execute a model-originated tool call through the public routing assembly.
Sourcepub async fn execute_tool_ref(&self, name: &str, args: &Value) -> Result<Value>
pub async fn execute_tool_ref(&self, name: &str, args: &Value) -> Result<Value>
Reference-taking version of execute_tool to avoid cloning by callers
that already have access to an existing Value.
Sourcepub async fn execute_tool_ref_prevalidated(
&self,
name: &str,
args: &Value,
) -> Result<Value>
pub async fn execute_tool_ref_prevalidated( &self, name: &str, args: &Value, ) -> Result<Value>
Reference-taking execution entrypoint for calls that were already preflight-validated.
This avoids re-running argument/schema/path/command preflight in hot paths where validation already happened in the runloop.
Sourcepub async fn execute_public_tool_ref_prevalidated(
&self,
name: &str,
args: &Value,
) -> Result<Value>
pub async fn execute_public_tool_ref_prevalidated( &self, name: &str, args: &Value, ) -> Result<Value>
Prevalidated model-originated execution that still routes through the public assembly.
pub async fn execute_prepared_public_tool_ref_with_mode( &self, prepared: &PreparedToolCall, exec_settlement_mode: ExecSettlementMode, ) -> Result<Value>
Source§impl ToolRegistry
impl ToolRegistry
Sourcepub fn resolve_tool_name_with_display(&self, name: &str) -> ResolvedToolName
pub fn resolve_tool_name_with_display(&self, name: &str) -> ResolvedToolName
Resolve a requested tool name to its canonical form.
Handles alias resolution through the inventory’s registration lookup. If the name is not found, it’s used as-is (for MCP tools or error handling).
Sourcepub fn check_circuit_breaker_for(
&self,
tool_name: &str,
display_name: &str,
) -> Option<String>
pub fn check_circuit_breaker_for( &self, tool_name: &str, display_name: &str, ) -> Option<String>
Check if a tool call should be rejected by the circuit breaker.
Returns None if the call is allowed, or Some(error_message) if rejected.
Sourcepub fn resolve_tool_route(&self, tool_name: &str) -> ToolRoute
pub fn resolve_tool_route(&self, tool_name: &str) -> ToolRoute
Resolve whether a tool is standard, MCP, or unknown.
Returns the tool routing information needed for execution.
Source§impl ToolRegistry
impl ToolRegistry
pub fn set_matrix_coordinator(&self, active: bool)
Source§impl ToolRegistry
impl ToolRegistry
Source§impl ToolRegistry
impl ToolRegistry
Sourcepub fn read_file(&self, args: Value) -> impl Future<Output = Result<Value>> + '_
pub fn read_file(&self, args: Value) -> impl Future<Output = Result<Value>> + '_
Inline-delegating wrapper that returns the inner future directly to avoid an extra coroutine state machine (audit section 16).
Sourcepub fn write_file(
&self,
args: Value,
) -> impl Future<Output = Result<Value>> + '_
pub fn write_file( &self, args: Value, ) -> impl Future<Output = Result<Value>> + '_
Inline-delegating wrapper. See Self::read_file.
Sourcepub fn create_file(
&self,
args: Value,
) -> impl Future<Output = Result<Value>> + '_
pub fn create_file( &self, args: Value, ) -> impl Future<Output = Result<Value>> + '_
Inline-delegating wrapper. See Self::read_file.
pub async fn edit_file(&self, args: Value) -> Result<Value>
Sourcepub fn delete_file(
&self,
args: Value,
) -> impl Future<Output = Result<Value>> + '_
pub fn delete_file( &self, args: Value, ) -> impl Future<Output = Result<Value>> + '_
Inline-delegating wrapper. See Self::read_file.
pub async fn grep_file(&self, args: Value) -> Result<Value>
pub fn last_grep_file_result(&self) -> Option<GrepSearchResult>
pub async fn list_files(&self, args: Value) -> Result<Value>
Source§impl ToolRegistry
impl ToolRegistry
pub fn apply_permissions_config(&self, permissions: &PermissionsConfig)
Source§impl ToolRegistry
impl ToolRegistry
Sourcepub fn begin_tracker_request(&self, adopted: bool)
pub fn begin_tracker_request(&self, adopted: bool)
Begin a genuine request, optionally restoring adoption from its persisted history or explicit continuation. Internal turns must not reset this latch.
Sourcepub fn tracker_adopted_for_request(&self) -> bool
pub fn tracker_adopted_for_request(&self) -> bool
Successful current-request adoption is independent of compactable history.
Sourcepub fn set_decision_evidence_validator(
&self,
validator: DecisionEvidenceValidator,
)
pub fn set_decision_evidence_validator( &self, validator: DecisionEvidenceValidator, )
Attach the canonical queue barrier used by public decision recording.
Sourcepub fn set_harness_session(&self, session_id: impl Into<String>)
pub fn set_harness_session(&self, session_id: impl Into<String>)
Update harness session identifier used for structured tool telemetry
Sourcepub fn set_harness_task(&self, task_id: Option<String>)
pub fn set_harness_task(&self, task_id: Option<String>)
Update current task identifier used for structured tool telemetry
Sourcepub fn harness_context_snapshot(&self) -> HarnessContextSnapshot
pub fn harness_context_snapshot(&self) -> HarnessContextSnapshot
Snapshot harness context metadata.
Attach the runloop’s shared per-tool circuit breaker.
Return the shared per-tool circuit breaker when configured.
Sourcepub async fn execute_harness_command_session(
&self,
args: Value,
) -> Result<Value>
pub async fn execute_harness_command_session( &self, args: Value, ) -> Result<Value>
Execute a harness-owned verification command through the same exec/sandbox
runtime used by the public command_session tool while bypassing the
model-facing full-auto allow-list gate.
Sourcepub async fn execute_harness_command_session_terminal_run(
&self,
args: Value,
) -> Result<Value>
pub async fn execute_harness_command_session_terminal_run( &self, args: Value, ) -> Result<Value>
Start a harness-owned PTY command session while retaining the session metadata even when the command exits immediately. ACP terminal sessions use explicit release semantics.
pub async fn read_harness_exec_session_output( &self, session_id: &str, drain: bool, ) -> Result<Option<String>>
Sourcepub fn harness_exec_session_completed<'a>(
&'a self,
session_id: &'a str,
) -> impl Future<Output = Result<Option<i32>>> + 'a
pub fn harness_exec_session_completed<'a>( &'a self, session_id: &'a str, ) -> impl Future<Output = Result<Option<i32>>> + 'a
Inline-delegating wrapper over
Self::harness_exec_session_completed.
Returns the inner future directly (audit section 16).
Sourcepub fn terminate_harness_exec_session<'a>(
&'a self,
session_id: &'a str,
) -> impl Future<Output = Result<()>> + 'a
pub fn terminate_harness_exec_session<'a>( &'a self, session_id: &'a str, ) -> impl Future<Output = Result<()>> + 'a
Inline-delegating wrapper over
Self::terminate_harness_exec_session.
pub async fn close_harness_exec_session(&self, session_id: &str) -> Result<()>
Sourcepub async fn in_progress_exec_sessions(
&self,
cap: usize,
) -> Vec<VTCodeExecSession>
pub async fn in_progress_exec_sessions( &self, cap: usize, ) -> Vec<VTCodeExecSession>
Bounded snapshot of all exec sessions still running for turn-end diagnostics and telemetry. Newest first; capped by the caller.
pub async fn in_progress_foreground_exec_sessions( &self, cap: usize, ) -> Vec<VTCodeExecSession>
Source§impl ToolRegistry
impl ToolRegistry
Sourcepub fn get_recent_tool_records(&self, count: usize) -> Vec<ToolExecutionRecord>
pub fn get_recent_tool_records(&self, count: usize) -> Vec<ToolExecutionRecord>
Get recent tool executions (successes and failures).
Sourcepub fn get_recent_tool_failures(&self, count: usize) -> Vec<ToolExecutionRecord>
pub fn get_recent_tool_failures(&self, count: usize) -> Vec<ToolExecutionRecord>
Get recent tool execution failures.
Sourcepub fn task_tool_telemetry_snapshot(
&self,
task_id: Option<&str>,
task_completed_successfully: Option<bool>,
) -> ToolTaskTelemetrySnapshot
pub fn task_tool_telemetry_snapshot( &self, task_id: Option<&str>, task_completed_successfully: Option<bool>, ) -> ToolTaskTelemetrySnapshot
Aggregate representative task telemetry from recorded tool executions.
Sourcepub fn find_recent_spooled_output(
&self,
tool_name: &str,
args: &Value,
max_age: Duration,
) -> Option<Value>
pub fn find_recent_spooled_output( &self, tool_name: &str, args: &Value, max_age: Duration, ) -> Option<Value>
Find a recent spooled output for a tool call with identical args.
Sourcepub fn find_recent_successful_output(
&self,
tool_name: &str,
args: &Value,
max_age: Duration,
) -> Option<Value>
pub fn find_recent_successful_output( &self, tool_name: &str, args: &Value, max_age: Duration, ) -> Option<Value>
Find a recent successful output for a tool call with identical args.
Sourcepub fn find_recent_successful_by_read_target(
&self,
tool_name: &str,
args: &Value,
max_age: Duration,
) -> Option<Value>
pub fn find_recent_successful_by_read_target( &self, tool_name: &str, args: &Value, max_age: Duration, ) -> Option<Value>
Find the most recent successful output for a read-only tool call that
targets the same file path with a compatible read shape. Returns
None for non-read-only tools or when no path can be extracted.
Sourcepub fn find_recent_read_file_spool_progress(
&self,
path: &str,
max_age: Duration,
) -> Option<(usize, usize)>
pub fn find_recent_read_file_spool_progress( &self, path: &str, max_age: Duration, ) -> Option<(usize, usize)>
Find continuation metadata from a recent chunked file-read result for the same path.
Supports both read_file and file_operation (read action) history records.
Sourcepub fn clear_execution_history(&self)
pub fn clear_execution_history(&self)
Clear the execution history.
Sourcepub fn execution_history_len(&self) -> usize
pub fn execution_history_len(&self) -> usize
Get the current number of stored execution records.
Source§impl ToolRegistry
impl ToolRegistry
Sourcepub fn get_tool(&self, name: &str) -> Option<Arc<dyn Tool>>
pub fn get_tool(&self, name: &str) -> Option<Arc<dyn Tool>>
Get a tool by name from the inventory (with hot cache optimization).
pub fn workspace_root(&self) -> &PathBuf
Sourcepub fn workspace_root_owned(&self) -> PathBuf
pub fn workspace_root_owned(&self) -> PathBuf
Get the workspace root as an owned PathBuf.
pub fn file_ops_tool(&self) -> &FileOpsTool
Sourcepub fn edited_file_monitor_ref(&self) -> &EditedFileMonitor
pub fn edited_file_monitor_ref(&self) -> &EditedFileMonitor
Borrow the edited-file monitor without exposing shared ownership.
Sourcepub fn edited_file_monitor(&self) -> &Arc<EditedFileMonitor> ⓘ
pub fn edited_file_monitor(&self) -> &Arc<EditedFileMonitor> ⓘ
Get the shared edited-file monitor handle for callers that need to clone it.
pub fn grep_file_manager(&self) -> Arc<GrepSearchManager> ⓘ
Source§impl ToolRegistry
impl ToolRegistry
pub async fn initialize_async(&self) -> Result<()>
Source§impl ToolRegistry
impl ToolRegistry
Sourcepub async fn with_mcp_client(self, mcp_client: Arc<McpClient>) -> Self
pub async fn with_mcp_client(self, mcp_client: Arc<McpClient>) -> Self
Set the MCP client for this registry.
Sourcepub async fn set_mcp_client(&self, mcp_client: Arc<McpClient>)
pub async fn set_mcp_client(&self, mcp_client: Arc<McpClient>)
Attach an MCP client without consuming the registry.
Sourcepub async fn clear_mcp_client(&self)
pub async fn clear_mcp_client(&self)
Detach the current MCP client and clear MCP tool indexes.
Also removes MCP proxy registrations from the inventory and rebuilds
the tool assembly so model_tools() no longer advertises MCP tools
that cannot be executed. Without this, a primary-agent switch (which
clears the client pending re-attach) leaves stale mcp__* tools on
the wire that fail with “MCP client not available”.
Sourcepub fn mcp_client(&self) -> Option<Arc<McpClient>>
pub fn mcp_client(&self) -> Option<Arc<McpClient>>
Get the MCP client if available.
Sourcepub async fn list_mcp_tools(&self) -> Result<Vec<McpToolInfo>>
pub async fn list_mcp_tools(&self) -> Result<Vec<McpToolInfo>>
List all MCP tools.
Sourcepub async fn has_mcp_tool(&self, tool_name: &str) -> bool
pub async fn has_mcp_tool(&self, tool_name: &str) -> bool
Check if an MCP tool exists.
Sourcepub async fn execute_mcp_tool(
&self,
tool_name: &str,
args: Value,
) -> Result<Value>
pub async fn execute_mcp_tool( &self, tool_name: &str, args: Value, ) -> Result<Value>
Execute an MCP tool.
Sourcepub async fn refresh_mcp_tools(&self) -> Result<()>
pub async fn refresh_mcp_tools(&self) -> Result<()>
Refresh MCP tools (reconnect to providers and update tool lists).
Source§impl ToolRegistry
impl ToolRegistry
Sourcepub fn begin_turn_preview_window(&self)
pub fn begin_turn_preview_window(&self)
Compatibility turn boundary for existing registry callers. Previews are bounded per result, so there is no aggregate allowance to reset and this boundary never changes output visibility.
Sourcepub fn metrics_collector(&self) -> Arc<MetricsCollector> ⓘ
pub fn metrics_collector(&self) -> Arc<MetricsCollector> ⓘ
Return the shared metrics collector for this registry instance.
Sourcepub fn tool_call_count(&self) -> u64
pub fn tool_call_count(&self) -> u64
Get total tool calls made in current session (for observability).
Sourcepub fn pty_poll_count(&self) -> u64
pub fn pty_poll_count(&self) -> u64
Get total PTY poll iterations (for CPU monitoring).
Source§impl ToolRegistry
impl ToolRegistry
Sourcepub fn has_optimizations_enabled(&self) -> bool
pub fn has_optimizations_enabled(&self) -> bool
Check if optimizations are enabled.
Sourcepub fn memory_pool_ref(&self) -> &MemoryPool
pub fn memory_pool_ref(&self) -> &MemoryPool
Borrow the memory pool for optimized allocations.
Sourcepub fn memory_pool(&self) -> &Arc<MemoryPool> ⓘ
pub fn memory_pool(&self) -> &Arc<MemoryPool> ⓘ
Get the shared memory pool handle for callers that need to clone it.
Sourcepub fn clear_hot_cache(&self)
pub fn clear_hot_cache(&self)
Clear the hot tool cache (useful for testing or memory management).
Sourcepub fn hot_cache_stats(&self) -> (usize, usize)
pub fn hot_cache_stats(&self) -> (usize, usize)
Get hot cache statistics.
Sourcepub fn configure_optimizations(&mut self, config: OptimizationConfig)
pub fn configure_optimizations(&mut self, config: OptimizationConfig)
Configure performance optimizations for this registry.
Sourcepub fn optimization_config(&self) -> &OptimizationConfig
pub fn optimization_config(&self) -> &OptimizationConfig
Get the current optimization configuration.
Source§impl ToolRegistry
impl ToolRegistry
Sourcepub fn begin_patch_recovery_turn(&self)
pub fn begin_patch_recovery_turn(&self)
Start a user/task turn without changing permissions or loop history.
Sourcepub fn has_patch_recovery_read(&self, tool_name: &str, args: &Value) -> bool
pub fn has_patch_recovery_read(&self, tool_name: &str, args: &Value) -> bool
Check admission without consuming the read before other guards run.
Source§impl ToolRegistry
impl ToolRegistry
Sourcepub fn is_mutating_tool(&self, name: &str) -> bool
pub fn is_mutating_tool(&self, name: &str) -> bool
Check if a tool is mutating (modifies files or environment).
Returns true if the tool is mutating or unknown (conservative default).
Sourcepub fn is_planning_active_allowed(&self, tool_name: &str, args: &Value) -> bool
pub fn is_planning_active_allowed(&self, tool_name: &str, args: &Value) -> bool
Check if a tool is allowed to run in planning workflow without switching modes.
Returns true for non-mutating tools and plan-safe exceptions like
writing to active plan storage (/tmp/vtcode-plans/ by default) or read-only unified tool actions.
Sourcepub fn is_retry_safe_call(&self, tool_name: &str, args: &Value) -> bool
pub fn is_retry_safe_call(&self, tool_name: &str, args: &Value) -> bool
Check whether a tool invocation is safe to retry.
Retries are allowed for read-only operations and for unified tools when
their specific action is read-only (file_operation:read, command_session:poll|list).
Source§impl ToolRegistry
impl ToolRegistry
Sourcepub fn enable_planning(&self)
pub fn enable_planning(&self)
Enable planning workflow (read-only enforcement).
When enabled, mutating tools (file_operation writes/edits, apply_patch,
command_session runs, etc.)
are blocked and the agent can only read/analyze the codebase.
PlanningWorkflowState is the single source of truth; this method delegates to it
so that is_planning_active() and planning_workflow_state().is_active() are always in
agreement.
Sourcepub fn disable_planning(&self)
pub fn disable_planning(&self)
Disable planning workflow (allow mutating tools again).
Sourcepub fn is_planning_active(&self) -> bool
pub fn is_planning_active(&self) -> bool
Check if planning workflow is currently enabled.
Reads directly from PlanningWorkflowState — the single authoritative flag.
Sourcepub fn planning_workflow_state(&self) -> PlanningWorkflowState
pub fn planning_workflow_state(&self) -> PlanningWorkflowState
Get the shared Planning workflow state (used by planning workflow tools and pipeline transitions).
Sourcepub async fn apply_planning_mode_policy_overrides(&self)
pub async fn apply_planning_mode_policy_overrides(&self)
Apply policy overrides for plan-mode exploration.
Saves the current policy for each exploration tool and sets it to Allow
so plan mode can read the codebase without requiring manual config edits.
Idempotent: if overrides are already active, does nothing.
Sourcepub async fn restore_post_planning_policies(&self)
pub async fn restore_post_planning_policies(&self)
Restore policies saved by apply_planning_mode_policy_overrides.
Only touches tools whose policies were actually overridden; all other user-configured policies are left untouched.
Source§impl ToolRegistry
impl ToolRegistry
pub async fn enable_full_auto_permission(&self, allowed_tools: &[String])
Sourcepub async fn enable_full_auto_permission_for_session(
&self,
allowed_tools: &[String],
session_tools_config: SessionToolsConfig,
)
pub async fn enable_full_auto_permission_for_session( &self, allowed_tools: &[String], session_tools_config: SessionToolsConfig, )
Enable full-auto mode against the tools visible in a specific session.
pub async fn disable_full_auto_permission(&self)
pub async fn set_enforce_safe_mode_prompts(&self, enabled: bool)
pub async fn current_full_auto_allowlist(&self) -> Option<Vec<String>>
pub async fn is_allowed_in_full_auto(&self, tool_name: &str) -> bool
pub async fn is_denied_in_full_auto(&self, tool_name: &str) -> bool
pub async fn set_policy_manager(&self, manager: ToolPolicyManager)
Sourcepub async fn has_policy_manager(&self) -> bool
pub async fn has_policy_manager(&self) -> bool
Whether the registry owns a workspace policy manager.
First-paint registries skip policy file I/O; hydration attaches the
manager via Self::ensure_workspace_policy_manager before any tool runs.
Sourcepub async fn ensure_workspace_policy_manager(&self, workspace_root: &Path)
pub async fn ensure_workspace_policy_manager(&self, workspace_root: &Path)
Attach the workspace policy manager unless one is already present.
Reads (and may create) the workspace policy file, so it belongs in hydration, not on the paint path. Fail-open: without a manager, evaluation falls back to tool metadata defaults.
pub async fn set_tool_policy( &self, tool_name: &str, policy: ToolPolicy, ) -> Result<()>
pub async fn persist_approval_cache_key(&self, approval_key: &str) -> Result<()>
pub async fn persist_approval_cache_prefix( &self, prefix_entry: &str, ) -> Result<()>
pub async fn has_persisted_approval(&self, approval_key: &str) -> bool
pub async fn find_persisted_shell_approval_prefix( &self, command_words: &[String], scope_signature: &str, ) -> Option<String>
pub async fn get_tool_policy(&self, tool_name: &str) -> ToolPolicy
pub async fn reset_tool_policies(&self) -> Result<()>
pub async fn allow_all_tools(&self) -> Result<()>
pub async fn deny_all_tools(&self) -> Result<()>
pub async fn print_policy_status(&self)
pub async fn apply_config_policies( &self, tools_config: &ToolsConfig, ) -> Result<()>
Sourcepub async fn preflight_tool_permission(&self, name: &str) -> Result<bool>
pub async fn preflight_tool_permission(&self, name: &str) -> Result<bool>
Prompt for permission before starting long-running tool executions to avoid spinner conflicts
pub async fn evaluate_tool_policy( &self, name: &str, ) -> Result<ToolPermissionDecision>
Sourcepub async fn mark_tool_preapproved(&self, name: &str)
pub async fn mark_tool_preapproved(&self, name: &str)
Mark a tool as pre-approved for a single execution after the permission flow already granted it.
pub async fn persist_mcp_tool_policy( &self, name: &str, policy: ToolPolicy, ) -> Result<()>
Source§impl ToolRegistry
impl ToolRegistry
Sourcepub fn replace_progress_callback(
&self,
callback: Option<ToolProgressCallback>,
) -> Option<ToolProgressCallback>
pub fn replace_progress_callback( &self, callback: Option<ToolProgressCallback>, ) -> Option<ToolProgressCallback>
Replace the callback for streaming tool output and progress, returning the previous callback.
Sourcepub fn set_progress_callback(&self, callback: ToolProgressCallback)
pub fn set_progress_callback(&self, callback: ToolProgressCallback)
Set the callback for streaming tool output and progress
Sourcepub fn clear_progress_callback(&self)
pub fn clear_progress_callback(&self)
Clear the progress callback
Sourcepub fn progress_callback(&self) -> Option<ToolProgressCallback>
pub fn progress_callback(&self) -> Option<ToolProgressCallback>
Get the current progress callback if set
Source§impl ToolRegistry
impl ToolRegistry
pub fn pty_manager(&self) -> &PtyManager
pub fn pty_config(&self) -> &PtyConfig
pub fn can_start_pty_session(&self) -> bool
pub fn start_pty_session(&self) -> Result<PtySessionGuard>
pub fn end_pty_session(&self)
pub fn active_pty_sessions(&self) -> usize
pub fn terminate_all_pty_sessions(&self)
Sourcepub fn terminate_all_pty_sessions_async(
&self,
) -> impl Future<Output = Result<()>> + '_
pub fn terminate_all_pty_sessions_async( &self, ) -> impl Future<Output = Result<()>> + '_
Inline-delegating wrapper over pty::PtySessionManager::terminate_all_async.
Returns the inner future directly to avoid an extra coroutine state machine
(per the async-state-machine bloat audit, section 16).
Sourcepub fn terminate_all_exec_sessions_async(
&self,
) -> impl Future<Output = Result<()>> + '_
pub fn terminate_all_exec_sessions_async( &self, ) -> impl Future<Output = Result<()>> + '_
Inline-delegating wrapper over
Self::terminate_all_exec_sessions_async.
Sourcepub fn terminate_all_exec_sessions_for_exit_async(
&self,
) -> impl Future<Output = Result<()>> + '_
pub fn terminate_all_exec_sessions_for_exit_async( &self, ) -> impl Future<Output = Result<()>> + '_
Exit-path variant: terminates every exec session with Immediate PTY
semantics (group SIGKILL, no SIGTERM grace window) so user-initiated
exit is not parked ~600 ms per live PTY session.
Sourcepub fn terminate_active_exec_sessions_async(
&self,
) -> impl Future<Output = Result<()>> + '_
pub fn terminate_active_exec_sessions_async( &self, ) -> impl Future<Output = Result<()>> + '_
Inline-delegating wrapper that terminates only foreground exec sessions after a turn interruption, preserving user-owned background sessions.
Sourcepub fn terminate_active_exec_sessions_for_exit_async(
&self,
) -> impl Future<Output = Result<()>> + '_
pub fn terminate_active_exec_sessions_for_exit_async( &self, ) -> impl Future<Output = Result<()>> + '_
Exit-path variant of Self::terminate_active_exec_sessions_async
using Immediate PTY termination.
pub fn exec_session_manager(&self) -> ExecSessionManager
Sourcepub fn set_active_pty_sessions(&self, counter: Arc<AtomicUsize>)
pub fn set_active_pty_sessions(&self, counter: Arc<AtomicUsize>)
Set the active PTY sessions counter for tracking
Sourcepub fn increment_active_pty_sessions(&self)
pub fn increment_active_pty_sessions(&self)
Increment active PTY sessions count
Sourcepub fn decrement_active_pty_sessions(&self)
pub fn decrement_active_pty_sessions(&self)
Decrement active PTY sessions count
Sourcepub fn active_pty_sessions_count(&self) -> usize
pub fn active_pty_sessions_count(&self) -> usize
Get the current active PTY sessions count
Source§impl ToolRegistry
impl ToolRegistry
Sourcepub fn tool_network_access(&self, name: &str) -> ToolNetworkAccess
pub fn tool_network_access(&self, name: &str) -> ToolNetworkAccess
Resolve trusted network metadata through the same alias inventory as execution.
Sourcepub async fn register_tool(&self, registration: ToolRegistration) -> Result<()>
pub async fn register_tool(&self, registration: ToolRegistration) -> Result<()>
Sourcepub async fn unregister_tool(&self, name: &str) -> Result<bool>
pub async fn unregister_tool(&self, name: &str) -> Result<bool>
Unregister a tool from the registry.
Source§impl ToolRegistry
impl ToolRegistry
pub async fn apply_tool_runtime_config( &self, commands_config: &CommandsConfig, tools_config: &ToolsConfig, ) -> Result<()>
pub async fn apply_session_runtime_config( &self, commands_config: &CommandsConfig, permissions_config: &PermissionsConfig, sandbox_config: &SandboxConfig, timeouts: &TimeoutsConfig, tools_config: &ToolsConfig, ) -> Result<()>
Source§impl ToolRegistry
impl ToolRegistry
pub fn apply_sandbox_config(&self, sandbox_config: &SandboxConfig)
pub fn sandbox_config(&self) -> SandboxConfig
Source§impl ToolRegistry
impl ToolRegistry
pub async fn create_session_prompt_task( &self, name: Option<String>, prompt: String, schedule: ScheduleSpec, created_at: DateTime<Utc>, ) -> Result<ScheduledTaskSummary>
pub async fn list_session_tasks(&self) -> Vec<ScheduledTaskSummary>
pub async fn delete_session_task( &self, query: &str, ) -> Option<ScheduledTaskSummary>
pub async fn collect_due_session_prompts( &self, now: DateTime<Utc>, ) -> Result<Vec<DueSessionPrompt>>
Source§impl ToolRegistry
impl ToolRegistry
Source§impl ToolRegistry
impl ToolRegistry
Sourcepub fn output_spooler(&self) -> &ToolOutputSpooler
pub fn output_spooler(&self) -> &ToolOutputSpooler
Get the output spooler for external access.
Sourcepub async fn spooled_files_count(&self) -> usize
pub async fn spooled_files_count(&self) -> usize
Get the count of currently spooled files (for TUI status).
Source§impl ToolRegistry
impl ToolRegistry
pub fn set_subagent_controller(&self, controller: Arc<SubagentController>)
pub fn subagent_controller(&self) -> Option<Arc<SubagentController>>
pub fn has_subagent_controller(&self) -> bool
Source§impl ToolRegistry
impl ToolRegistry
pub async fn timeout_category_for(&self, name: &str) -> ToolTimeoutCategory
pub async fn timeout_category_for_args( &self, name: &str, args: &Value, ) -> ToolTimeoutCategory
Source§impl ToolRegistry
impl ToolRegistry
pub fn apply_timeout_policy(&self, timeouts: &TimeoutsConfig)
pub fn timeout_policy(&self) -> ToolTimeoutPolicy
pub fn rate_limit_per_minute(&self) -> Option<usize>
Source§impl ToolRegistry
impl ToolRegistry
pub fn tool_catalog_state(&self) -> Arc<SessionToolCatalogState> ⓘ
Sourcepub fn attach_session_model_tools(
&self,
tools: Arc<RwLock<Vec<ToolDefinition>>>,
)
pub fn attach_session_model_tools( &self, tools: Arc<RwLock<Vec<ToolDefinition>>>, )
Attach the session’s live model-facing tool definitions so registry consumers (e.g. local tool search) can read and un-defer them.
The interactive runloop calls this once, right after it builds the
Arc<RwLock<Vec<ToolDefinition>>> it hands to the provider. Headless
paths may never call this; every consumer of session_model_tools()
must treat None as “no session tool list available” and degrade
gracefully rather than error.
Sourcepub fn session_model_tools(&self) -> Option<Arc<RwLock<Vec<ToolDefinition>>>>
pub fn session_model_tools(&self) -> Option<Arc<RwLock<Vec<ToolDefinition>>>>
Fetch the attached session tool list, if any.
Clones the inner Arc out from behind the std RwLock so callers
never hold that lock across an .await.
Source§impl ToolRegistry
impl ToolRegistry
pub fn set_self_ref(&self, registry: Arc<ToolRegistry>)
Trait Implementations§
Source§impl BuiltinToolExecutor for ToolRegistry
impl BuiltinToolExecutor for ToolRegistry
Source§fn execute_builtin_tool<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tool_name: &'life1 str,
args: &'life2 Value,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn execute_builtin_tool<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tool_name: &'life1 str,
args: &'life2 Value,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§fn list_builtin_tools(&self) -> Result<Vec<BuiltinToolInfo>>
fn list_builtin_tools(&self) -> Result<Vec<BuiltinToolInfo>>
Source§impl Clone for ToolRegistry
impl Clone for ToolRegistry
Source§impl McpBridge for ToolRegistry
impl McpBridge for ToolRegistry
Source§fn set_mcp_client<'life0, 'async_trait>(
&'life0 self,
client: Arc<McpClient>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn set_mcp_client<'life0, 'async_trait>(
&'life0 self,
client: Arc<McpClient>,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn clear_mcp_client<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn clear_mcp_client<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn list_mcp_tools<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<McpToolInfo>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn list_mcp_tools<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<Vec<McpToolInfo>>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn has_mcp_tool<'life0, 'life1, 'async_trait>(
&'life0 self,
tool_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn has_mcp_tool<'life0, 'life1, 'async_trait>(
&'life0 self,
tool_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§impl PtySessionControl for ToolRegistry
impl PtySessionControl for ToolRegistry
Source§fn can_start_session(&self) -> bool
fn can_start_session(&self) -> bool
Source§fn active_session_count(&self) -> usize
fn active_session_count(&self) -> usize
Source§fn terminate_all_sessions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn terminate_all_sessions<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn exec_session_manager(&self) -> ExecSessionManager
fn exec_session_manager(&self) -> ExecSessionManager
Source§impl ToolCatalog for ToolRegistry
impl ToolCatalog for ToolRegistry
Source§fn register_tool<'life0, 'async_trait>(
&'life0 self,
registration: ToolRegistration,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn register_tool<'life0, 'async_trait>(
&'life0 self,
registration: ToolRegistration,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn unregister_tool<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn unregister_tool<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<bool>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
true if the tool existed.Source§fn get_tool(&self, name: &str) -> Option<Arc<dyn Tool>>
fn get_tool(&self, name: &str) -> Option<Arc<dyn Tool>>
Source§fn workspace_root(&self) -> PathBuf
fn workspace_root(&self) -> PathBuf
Source§fn public_tool_names<'life0, 'async_trait>(
&'life0 self,
surface: SessionSurface,
capability_level: CapabilityLevel,
) -> Pin<Box<dyn Future<Output = Vec<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn public_tool_names<'life0, 'async_trait>(
&'life0 self,
surface: SessionSurface,
capability_level: CapabilityLevel,
) -> Pin<Box<dyn Future<Output = Vec<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn schema_entries<'life0, 'async_trait>(
&'life0 self,
config: SessionToolsConfig,
) -> Pin<Box<dyn Future<Output = Vec<ToolSchemaEntry>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn schema_entries<'life0, 'async_trait>(
&'life0 self,
config: SessionToolsConfig,
) -> Pin<Box<dyn Future<Output = Vec<ToolSchemaEntry>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn function_declarations<'life0, 'async_trait>(
&'life0 self,
config: SessionToolsConfig,
) -> Pin<Box<dyn Future<Output = Vec<FunctionDeclaration>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn function_declarations<'life0, 'async_trait>(
&'life0 self,
config: SessionToolsConfig,
) -> Pin<Box<dyn Future<Output = Vec<FunctionDeclaration>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn model_tools<'life0, 'async_trait>(
&'life0 self,
config: SessionToolsConfig,
) -> Pin<Box<dyn Future<Output = Vec<ToolDefinition>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn model_tools<'life0, 'async_trait>(
&'life0 self,
config: SessionToolsConfig,
) -> Pin<Box<dyn Future<Output = Vec<ToolDefinition>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn resolve_tool_name(&self, name: &str) -> Result<String, ToolCallError>
fn resolve_tool_name(&self, name: &str) -> Result<String, ToolCallError>
Source§impl ToolExecutor for ToolRegistry
impl ToolExecutor for ToolRegistry
Source§fn execute_tool<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
args: Value,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn execute_tool<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
args: Value,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn execute_tool_ref<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
name: &'life1 str,
args: &'life2 Value,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
fn execute_tool_ref<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
name: &'life1 str,
args: &'life2 Value,
) -> Pin<Box<dyn Future<Output = Result<Value>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§fn available_tools<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Vec<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn available_tools<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = Vec<String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn has_tool<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn has_tool<'life0, 'life1, 'async_trait>(
&'life0 self,
name: &'life1 str,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§impl ToolMetrics for ToolRegistry
impl ToolMetrics for ToolRegistry
Source§fn record_execution(&self, _record: ToolExecutionRecord)
fn record_execution(&self, _record: ToolExecutionRecord)
Source§fn call_count(&self) -> u64
fn call_count(&self) -> u64
Source§fn pty_poll_count(&self) -> u64
fn pty_poll_count(&self) -> u64
Source§fn metrics_collector(&self) -> Arc<MetricsCollector> ⓘ
fn metrics_collector(&self) -> Arc<MetricsCollector> ⓘ
Source§impl ToolResilience for ToolRegistry
impl ToolResilience for ToolRegistry
Source§fn effective_timeout(&self, category: ToolTimeoutCategory) -> Option<Duration>
fn effective_timeout(&self, category: ToolTimeoutCategory) -> Option<Duration>
Source§fn record_failure(&self, category: ToolTimeoutCategory) -> bool
fn record_failure(&self, category: ToolTimeoutCategory) -> bool
true if the circuit breaker tripped.Source§fn reset_failure(&self, category: ToolTimeoutCategory)
fn reset_failure(&self, category: ToolTimeoutCategory)
Source§fn record_latency(&self, category: ToolTimeoutCategory, duration: Duration)
fn record_latency(&self, category: ToolTimeoutCategory, duration: Duration)
Source§fn should_circuit_break(
&self,
category: ToolTimeoutCategory,
) -> Option<Duration>
fn should_circuit_break( &self, category: ToolTimeoutCategory, ) -> Option<Duration>
Source§fn decay_adaptive_timeout(&self, category: ToolTimeoutCategory)
fn decay_adaptive_timeout(&self, category: ToolTimeoutCategory)
Source§impl ToolSecurity for ToolRegistry
impl ToolSecurity for ToolRegistry
Source§fn evaluate_tool_policy<'life0, 'life1, 'async_trait>(
&'life0 self,
tool_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<ToolPermissionDecision>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn evaluate_tool_policy<'life0, 'life1, 'async_trait>(
&'life0 self,
tool_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = Result<ToolPermissionDecision>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn get_tool_policy<'life0, 'life1, 'async_trait>(
&'life0 self,
tool_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = ToolPolicy> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn get_tool_policy<'life0, 'life1, 'async_trait>(
&'life0 self,
tool_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = ToolPolicy> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn set_tool_policy<'life0, 'life1, 'async_trait>(
&'life0 self,
tool_name: &'life1 str,
policy: ToolPolicy,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn set_tool_policy<'life0, 'life1, 'async_trait>(
&'life0 self,
tool_name: &'life1 str,
policy: ToolPolicy,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn mark_tool_preapproved<'life0, 'life1, 'async_trait>(
&'life0 self,
tool_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn mark_tool_preapproved<'life0, 'life1, 'async_trait>(
&'life0 self,
tool_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn enable_full_auto_permission<'life0, 'life1, 'async_trait>(
&'life0 self,
allowed_tools: &'life1 [String],
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn enable_full_auto_permission<'life0, 'life1, 'async_trait>(
&'life0 self,
allowed_tools: &'life1 [String],
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn disable_full_auto_permission<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
fn disable_full_auto_permission<'life0, 'async_trait>(
&'life0 self,
) -> Pin<Box<dyn Future<Output = ()> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
Source§fn is_allowed_in_full_auto<'life0, 'life1, 'async_trait>(
&'life0 self,
tool_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn is_allowed_in_full_auto<'life0, 'life1, 'async_trait>(
&'life0 self,
tool_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn is_denied_in_full_auto<'life0, 'life1, 'async_trait>(
&'life0 self,
tool_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn is_denied_in_full_auto<'life0, 'life1, 'async_trait>(
&'life0 self,
tool_name: &'life1 str,
) -> Pin<Box<dyn Future<Output = bool> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn apply_config_policies<'life0, 'life1, 'async_trait>(
&'life0 self,
tools_config: &'life1 ToolsConfig,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
fn apply_config_policies<'life0, 'life1, 'async_trait>(
&'life0 self,
tools_config: &'life1 ToolsConfig,
) -> Pin<Box<dyn Future<Output = Result<()>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
Source§fn sandbox_config(&self) -> SandboxConfig
fn sandbox_config(&self) -> SandboxConfig
Source§fn apply_sandbox_config(&self, config: &SandboxConfig)
fn apply_sandbox_config(&self, config: &SandboxConfig)
Auto Trait Implementations§
impl !RefUnwindSafe for ToolRegistry
impl !UnwindSafe for ToolRegistry
impl Freeze for ToolRegistry
impl Send for ToolRegistry
impl Sync for ToolRegistry
impl Unpin for ToolRegistry
impl UnsafeUnpin for ToolRegistry
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<T> CacheValue for T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<D> OwoColorize for D
impl<D> OwoColorize for D
Source§fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
fn fg<C>(&self) -> FgColorDisplay<'_, C, Self>where
C: Color,
Source§fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
fn bg<C>(&self) -> BgColorDisplay<'_, C, Self>where
C: Color,
Source§fn black(&self) -> FgColorDisplay<'_, Black, Self>
fn black(&self) -> FgColorDisplay<'_, Black, Self>
Source§fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
fn on_black(&self) -> BgColorDisplay<'_, Black, Self>
Source§fn red(&self) -> FgColorDisplay<'_, Red, Self>
fn red(&self) -> FgColorDisplay<'_, Red, Self>
Source§fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
fn on_red(&self) -> BgColorDisplay<'_, Red, Self>
Source§fn green(&self) -> FgColorDisplay<'_, Green, Self>
fn green(&self) -> FgColorDisplay<'_, Green, Self>
Source§fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
fn on_green(&self) -> BgColorDisplay<'_, Green, Self>
Source§fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
fn yellow(&self) -> FgColorDisplay<'_, Yellow, Self>
Source§fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
fn on_yellow(&self) -> BgColorDisplay<'_, Yellow, Self>
Source§fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
fn blue(&self) -> FgColorDisplay<'_, Blue, Self>
Source§fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
fn on_blue(&self) -> BgColorDisplay<'_, Blue, Self>
Source§fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
fn magenta(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_magenta(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
fn purple(&self) -> FgColorDisplay<'_, Magenta, Self>
Source§fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
fn on_purple(&self) -> BgColorDisplay<'_, Magenta, Self>
Source§fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
fn cyan(&self) -> FgColorDisplay<'_, Cyan, Self>
Source§fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
fn on_cyan(&self) -> BgColorDisplay<'_, Cyan, Self>
Source§fn white(&self) -> FgColorDisplay<'_, White, Self>
fn white(&self) -> FgColorDisplay<'_, White, Self>
Source§fn on_white(&self) -> BgColorDisplay<'_, White, Self>
fn on_white(&self) -> BgColorDisplay<'_, White, Self>
Source§fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
fn default_color(&self) -> FgColorDisplay<'_, Default, Self>
Source§fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
fn on_default_color(&self) -> BgColorDisplay<'_, Default, Self>
Source§fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
fn bright_black(&self) -> FgColorDisplay<'_, BrightBlack, Self>
Source§fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
fn on_bright_black(&self) -> BgColorDisplay<'_, BrightBlack, Self>
Source§fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
fn bright_red(&self) -> FgColorDisplay<'_, BrightRed, Self>
Source§fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
fn on_bright_red(&self) -> BgColorDisplay<'_, BrightRed, Self>
Source§fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
fn bright_green(&self) -> FgColorDisplay<'_, BrightGreen, Self>
Source§fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
fn on_bright_green(&self) -> BgColorDisplay<'_, BrightGreen, Self>
Source§fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
fn bright_yellow(&self) -> FgColorDisplay<'_, BrightYellow, Self>
Source§fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
fn on_bright_yellow(&self) -> BgColorDisplay<'_, BrightYellow, Self>
Source§fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
fn bright_blue(&self) -> FgColorDisplay<'_, BrightBlue, Self>
Source§fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
fn on_bright_blue(&self) -> BgColorDisplay<'_, BrightBlue, Self>
Source§fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_magenta(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_magenta(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
fn bright_purple(&self) -> FgColorDisplay<'_, BrightMagenta, Self>
Source§fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
fn on_bright_purple(&self) -> BgColorDisplay<'_, BrightMagenta, Self>
Source§fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
fn bright_cyan(&self) -> FgColorDisplay<'_, BrightCyan, Self>
Source§fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
fn on_bright_cyan(&self) -> BgColorDisplay<'_, BrightCyan, Self>
Source§fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
fn bright_white(&self) -> FgColorDisplay<'_, BrightWhite, Self>
Source§fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
fn on_bright_white(&self) -> BgColorDisplay<'_, BrightWhite, Self>
Source§fn bold(&self) -> BoldDisplay<'_, Self>
fn bold(&self) -> BoldDisplay<'_, Self>
Source§fn dimmed(&self) -> DimDisplay<'_, Self>
fn dimmed(&self) -> DimDisplay<'_, Self>
Source§fn italic(&self) -> ItalicDisplay<'_, Self>
fn italic(&self) -> ItalicDisplay<'_, Self>
Source§fn underline(&self) -> UnderlineDisplay<'_, Self>
fn underline(&self) -> UnderlineDisplay<'_, Self>
Source§fn blink(&self) -> BlinkDisplay<'_, Self>
fn blink(&self) -> BlinkDisplay<'_, Self>
Source§fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
fn blink_fast(&self) -> BlinkFastDisplay<'_, Self>
Source§fn reversed(&self) -> ReversedDisplay<'_, Self>
fn reversed(&self) -> ReversedDisplay<'_, Self>
Source§fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
fn strikethrough(&self) -> StrikeThroughDisplay<'_, Self>
Source§fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn color<Color>(&self, color: Color) -> FgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::fg or
a color-specific method, such as OwoColorize::green, Read moreSource§fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
fn on_color<Color>(&self, color: Color) -> BgDynColorDisplay<'_, Color, Self>where
Color: DynColor,
OwoColorize::bg or
a color-specific method, such as OwoColorize::on_yellow, Read more