pub struct GeneralExecutor { /* private fields */ }Implementations§
Source§impl GeneralExecutor
impl GeneralExecutor
Sourcepub fn new(
substrate: Arc<dyn Substrate>,
root: impl Into<PathBuf>,
clamp: bool,
) -> Self
pub fn new( substrate: Arc<dyn Substrate>, root: impl Into<PathBuf>, clamp: bool, ) -> Self
Build an executor bound to substrate, rooted at root. clamp should
be true for the local host (bound file writes to root) and false
for a sandbox/VM whose own root already contains the agent.
Sourcepub fn with_read_clamp(self, read_clamp: bool) -> Self
pub fn with_read_clamp(self, read_clamp: bool) -> Self
Pin the read tools (read_file, list_dir, find_files, grep_files)
inside root as well as the write tools. Scoped opt-in: only the
discussion surface sets it.
Sourcepub fn with_chain(self, chain: InspectorChain) -> Self
pub fn with_chain(self, chain: InspectorChain) -> Self
Replace the inspector chain (tests / callers wanting extra rules).
Sourcepub fn with_delegate(
self,
delegate: Arc<dyn ToolExecutor>,
defs: Vec<Value>,
) -> Self
pub fn with_delegate( self, delegate: Arc<dyn ToolExecutor>, defs: Vec<Value>, ) -> Self
Attach a delegate executor (e.g. the network tools) that owns defs by
name. Delegate tools bypass the file-path clamp/inspector logic.
Delegate defs are an extension boundary, so their model-facing text is
sanitized once, here, at registration — see [sanitize_def].
Sourcepub fn tool_defs() -> Vec<Value>
pub fn tool_defs() -> Vec<Value>
The static built-in tool defs: agent_basics file tools + calculate +
the shell tool. (Unlike the coder, the assistant keeps calculate.)
Sourcepub fn with_event_log(self, log: Arc<Mutex<EventLog>>) -> Self
pub fn with_event_log(self, log: Arc<Mutex<EventLog>>) -> Self
Bind the run’s event log, enabling the events_query tool.
CAR keeps a typed, append-only record of everything that happened in a run, and until now the one participant who could act on it — the model — could not read it. The machinery already existed; only the surface was missing (Parslee-ai/car#815).
Sourcepub fn with_todos(self, todos: Arc<Mutex<TodoList>>) -> Self
pub fn with_todos(self, todos: Arc<Mutex<TodoList>>) -> Self
Bind the run’s task list, enabling todo_write (Parslee-ai/car#814).
Sourcepub fn all_tool_defs(&self) -> Vec<Value>
pub fn all_tool_defs(&self) -> Vec<Value>
All tool defs to advertise: the static built-ins plus any delegate tools. Agent loops should advertise these so delegate tools are allowlistable.
pub fn root(&self) -> &Path
Trait Implementations§
Source§impl ToolExecutor for GeneralExecutor
impl ToolExecutor for GeneralExecutor
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_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<'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
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: '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
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
Self: '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
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
'life6: 'async_trait,
Self: '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
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
'life6: 'async_trait,
Self: '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
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
'life6: 'async_trait,
Self: '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
'life0: 'async_trait,
'life1: 'async_trait,
'life2: 'async_trait,
'life3: 'async_trait,
'life4: 'async_trait,
'life5: 'async_trait,
'life6: 'async_trait,
Self: '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 !Freeze for GeneralExecutor
impl !RefUnwindSafe for GeneralExecutor
impl !UnwindSafe for GeneralExecutor
impl Send for GeneralExecutor
impl Sync for GeneralExecutor
impl Unpin for GeneralExecutor
impl UnsafeUnpin for GeneralExecutor
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