Skip to main content

ToolCapabilities

Struct ToolCapabilities 

Source
pub struct ToolCapabilities {
Show 22 fields pub session_allow_all: Option<Arc<SessionConfirmLatch>>, pub memory_backend: Option<MemoryBinding>, pub telemetry: Option<WorkerTelemetry>, pub tool_register_tx: Option<UnboundedSender<Vec<Arc<dyn Tool>>>>, pub session_manager: Option<Arc<SessionManager>>, pub subagent_registry: Option<Arc<Mutex<SubagentRegistry>>>, pub launch_cancel: Option<CancellationToken>, pub event_queue: Option<Arc<EventQueue>>, pub delegation_parent: Option<String>, pub codex_parent_plan: Option<CodexExecutionPlan>, pub secret_prompt: Option<SecretPromptHandle>, pub orchestration: Option<Arc<OrchestrationRuntime>>, pub tool_activation: Option<ActivationCapability>, pub mcp_leases: Option<McpLeaseCapability>, pub extension_leases: Option<ExtensionLeaseCapability>, pub cwd: Option<PathBuf>, pub env: Option<ToolEnv>, pub env_stripped: Vec<String>, pub env_warned: Arc<Mutex<HashSet<String>>>, pub session_id: Option<String>, pub hook_bus: Option<Arc<HookBus>>, pub continuation: Option<SharedContinuation>,
}
Expand description

Runtime capability handles — shared services a tool may require.

Fields§

§session_allow_all: Option<Arc<SessionConfirmLatch>>

Parent-session extension Confirm latch: the set of extension ids the user chose “Allow all” for. Workers share the Arc (including live updates and revokes), never a snapshot or host-global approval. This grants no activate_tools authority. None is for contexts without a parent session.

§memory_backend: Option<MemoryBinding>

Host-owned note storage binding. Every context made for a chat has its chat’s: a turn’s (TurnToolContext) and a slash command’s (skills::commands::CommandChat). None is left for a context made for no chat (TurnToolContext::no_chat) and for the ones tests build by hand; there the memory tools refuse (they never derive a project from the process folder).

§telemetry: Option<WorkerTelemetry>

Parent-session telemetry for the subagents this context spawns: they record at the same level through the parent’s session writer. None (manual contexts) leaves workers Off.

§tool_register_tx: Option<UnboundedSender<Vec<Arc<dyn Tool>>>>§session_manager: Option<Arc<SessionManager>>§subagent_registry: Option<Arc<Mutex<SubagentRegistry>>>§launch_cancel: Option<CancellationToken>

Originating turn cancellation, pinned before tool dispatch. A late registration cannot inherit a later user’s renewed launch authority.

§event_queue: Option<Arc<EventQueue>>§delegation_parent: Option<String>

Current worker handle when this context belongs to a delegated runtime. None denotes the foreground root.

§codex_parent_plan: Option<CodexExecutionPlan>

Host-built foreground Codex plan for exact-model Ultra inheritance. Not a model-supplied tool parameter or an authorization grant.

§secret_prompt: Option<SecretPromptHandle>§orchestration: Option<Arc<OrchestrationRuntime>>

Runtime-enforced delegation/lifecycle policy. When present, every spawn path must authorize before creating channels, threads, or provider runtimes.

§tool_activation: Option<ActivationCapability>

Discovery/activation capability context (Task 17): passive catalog snapshot + retained session-set handle + host-supplied activation authority. None (default for manual fixtures and non-stream contexts) means the discovery/activation builtins fail typed and no model-initiated activation is possible.

§mcp_leases: Option<McpLeaseCapability>

Session-scoped exact MCP lease capability (Task 19): exact session identity + shared runtime manager. None (default for non-stream contexts) means deferred MCP tools fail typed and start nothing.

§extension_leases: Option<ExtensionLeaseCapability>

Session-scoped exact EXTENSION lease capability (Task 20): exact session identity + shared extension runtime manager. None (default for non-stream contexts) means deferred extension tools fail typed and start nothing.

§cwd: Option<PathBuf>

Per-session working directory (Phase 2 daemons serve sessions from N directories in one process). None = inherit the process cwd — the only value Phase 1 ever sets, so behaviour is byte-identical.

§env: Option<ToolEnv>

Per-session environment snapshot (session-identity T1). None = inherit process env. When Some, tools call env_clear().envs() so no daemon env leaks into session subprocesses.

§env_stripped: Vec<String>

Names of env vars stripped as secrets (T5). Tools use this for loud notices when a command fails referencing a stripped var.

§env_warned: Arc<Mutex<HashSet<String>>>

Per-name “already warned” guard (T5): prevents duplicate notices within a single session. Shared via Arc<Mutex<…>> so the same set survives across tool calls (caps are rebuilt per call in stream.rs). Poisoned-mutex recovery via into_inner.

§session_id: Option<String>

Owning conversation id of the tool call, as carried on hook events. None for workers/subagents and for host contexts with no conversation. Forwarded to extension tool.call as params.session_id so a daemon-shared plugin knows its caller. Not the lease scope (tool_session_id, a random runtime id).

§hook_bus: Option<Arc<HookBus>>

Extension hook bus, for the notify-only events a builtin tool sends (memory_forget: on_memory_forgotten). A worker carries its own view, which sends nothing. None wherever no bus exists; the tool then works the same and nothing is announced.

§continuation: Option<SharedContinuation>

The calling chat’s rollover state, where context_checkpoint records its phase and note. The tool is one instance shared by every chat on the host and has no state of its own. None for a context with no chat: the tool refuses there. (A worker carries its own state, which is never enabled, and its registry has no such tool.)

Trait Implementations§

Source§

impl Clone for ToolCapabilities

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for ToolCapabilities

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast for T
where T: Any,

Source§

fn into_any(self: Box<T>) -> Box<dyn Any>

Convert 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>

Convert 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)

Convert &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)

Convert &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
where T: Any + Send + Sync,

Source§

fn into_any_arc(self: Arc<T>) -> Arc<dyn Any + Send + Sync> ⓘ

Convert Arc<Trait> (where Trait: Downcast) to Arc<Any>. Arc<Any> can then be further downcast into Arc<ConcreteType> where ConcreteType implements Trait.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FromRef<T> for T
where T: Clone,

Source§

fn from_ref(input: &T) -> T

Converts to this type from a reference to the input type.
Source§

impl<A, B, T> HttpServerConnExec<A, B> for T
where B: Body,

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self> ⓘ

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self> ⓘ

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Sized + Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self> ⓘ
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self> ⓘ

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more