pub struct SubstrateShadowExecutor { /* private fields */ }Expand description
Executor wrapper used only by substrate-bound sessions
(session.bindSubstrate). It is the low-blast-radius “option (a)” from
docs/execution-substrate.md §3: keep the existing
share_with_fallback(ws_executor) composition intact for connector
routes and host tool callbacks, but for the bare substrate-owned
built-in names ([SUBSTRATE_OWNED_TOOLS]) return an "unknown tool: <name>" error so the engine’s dispatch (executor.rs) takes the
fall_through branch and routes those names to the runtime’s bound
substrate (the connector/VM car_engine::McpSubstrate) instead of the WS client.
This preserves every existing contract — GUI/connector/coder sessions
never construct one of these — and is what makes a connector-driven
session coherent: its file/exec built-ins land on the same machine as
its mcp_{slug}_* tools, not split between the WS client and a remote
MCP server.
Implementations§
Source§impl SubstrateShadowExecutor
impl SubstrateShadowExecutor
pub fn new(inner: Arc<dyn ToolExecutor>) -> Self
Trait Implementations§
Source§impl ToolExecutor for SubstrateShadowExecutor
impl ToolExecutor for SubstrateShadowExecutor
fn execute<'life0, 'life1, 'life2, 'async_trait>(
&'life0 self,
tool: &'life1 str,
params: &'life2 Value,
) -> Pin<Box<dyn Future<Output = Result<Value, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
Source§fn execute_with_action<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
tool: &'life1 str,
params: &'life2 Value,
action_id: &'life3 str,
timeout_ms: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<Value, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
fn execute_with_action<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
tool: &'life1 str,
params: &'life2 Value,
action_id: &'life3 str,
timeout_ms: Option<u64>,
) -> Pin<Box<dyn Future<Output = Result<Value, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Source§fn execute_with_action_in_session<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
tool: &'life1 str,
params: &'life2 Value,
action_id: &'life3 str,
timeout_ms: Option<u64>,
session_id: Option<&'life4 str>,
attempt: u32,
) -> Pin<Box<dyn Future<Output = Result<Value, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
fn execute_with_action_in_session<'life0, 'life1, 'life2, 'life3, 'life4, 'async_trait>(
&'life0 self,
tool: &'life1 str,
params: &'life2 Value,
action_id: &'life3 str,
timeout_ms: Option<u64>,
session_id: Option<&'life4 str>,
attempt: u32,
) -> Pin<Box<dyn Future<Output = Result<Value, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
Source§fn execute_with_action_state_in_session<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'life6, 'async_trait>(
&'life0 self,
tool: &'life1 str,
params: &'life2 Value,
action_id: &'life3 str,
timeout_ms: Option<u64>,
session_id: Option<&'life4 str>,
attempt: u32,
expected_effects: &'life5 HashMap<String, Value>,
return_schema: Option<&'life6 Value>,
) -> Pin<Box<dyn Future<Output = Result<ToolExecution, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
'life6: 'async_trait,
fn execute_with_action_state_in_session<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'life6, 'async_trait>(
&'life0 self,
tool: &'life1 str,
params: &'life2 Value,
action_id: &'life3 str,
timeout_ms: Option<u64>,
session_id: Option<&'life4 str>,
attempt: u32,
expected_effects: &'life5 HashMap<String, Value>,
return_schema: Option<&'life6 Value>,
) -> Pin<Box<dyn Future<Output = Result<ToolExecution, String>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
'life6: 'async_trait,
Source§fn execute_classified<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'life6, 'async_trait>(
&'life0 self,
tool: &'life1 str,
params: &'life2 Value,
action_id: &'life3 str,
timeout_ms: Option<u64>,
session_id: Option<&'life4 str>,
attempt: u32,
expected_effects: &'life5 HashMap<String, Value>,
return_schema: Option<&'life6 Value>,
) -> Pin<Box<dyn Future<Output = Result<ToolExecution, ToolFailure>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
'life6: 'async_trait,
fn execute_classified<'life0, 'life1, 'life2, 'life3, 'life4, 'life5, 'life6, 'async_trait>(
&'life0 self,
tool: &'life1 str,
params: &'life2 Value,
action_id: &'life3 str,
timeout_ms: Option<u64>,
session_id: Option<&'life4 str>,
attempt: u32,
expected_effects: &'life5 HashMap<String, Value>,
return_schema: Option<&'life6 Value>,
) -> Pin<Box<dyn Future<Output = Result<ToolExecution, ToolFailure>> + Send + 'async_trait>>where
Self: 'async_trait,
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
'life6: 'async_trait,
Source§fn execute_stream<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
tool: &'life1 str,
_params: &'life2 Value,
_action_id: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<Receiver<ToolStreamChunk>, String>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
fn execute_stream<'life0, 'life1, 'life2, 'life3, 'async_trait>(
&'life0 self,
tool: &'life1 str,
_params: &'life2 Value,
_action_id: &'life3 str,
) -> Pin<Box<dyn Future<Output = Result<Receiver<ToolStreamChunk>, String>> + Send + 'async_trait>>where
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: 'async_trait,
car_ir::ToolStreamChunks; the
runtime drains it into the per-runtime handle registry while the
DAG proceeds. End the stream with a terminal chunk (done /
error); dropping the sender without one is reported as failure.
A cooperative executor should stop work when the receiver returned
here is dropped (that’s what cancellation looks like from its side). Read moreAuto Trait Implementations§
impl !RefUnwindSafe for SubstrateShadowExecutor
impl !UnwindSafe for SubstrateShadowExecutor
impl Freeze for SubstrateShadowExecutor
impl Send for SubstrateShadowExecutor
impl Sync for SubstrateShadowExecutor
impl Unpin for SubstrateShadowExecutor
impl UnsafeUnpin for SubstrateShadowExecutor
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
impl<S, T> Duplex<S> for Twhere
T: FromSample<S> + ToSample<S>,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
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 more