Skip to main content

Executor

Struct Executor 

Source
pub struct Executor {
Show 15 fields pub adapters: Arc<AdapterRegistry>, pub sanitizer: Arc<PiiSanitizer>, pub events: Arc<dyn EventSink>, pub cloud_providers: Arc<CloudAiRegistry>, pub credentials: Arc<dyn CredentialResolver>, pub allow_cloud_ai: bool, pub allow_local_ai: bool, pub local_ai_base_url: Option<String>, pub stream_sink: Arc<dyn LlmStreamSink>, pub working_memory: WorkingMemory, pub control: SharedRunControl, pub confirm_destructive: bool, pub review_gate_available: bool, pub edit_staging: Option<StagedEdits>, pub workspace_root: PathBuf,
}

Fields§

§adapters: Arc<AdapterRegistry>§sanitizer: Arc<PiiSanitizer>§events: Arc<dyn EventSink>§cloud_providers: Arc<CloudAiRegistry>§credentials: Arc<dyn CredentialResolver>§allow_cloud_ai: bool§allow_local_ai: bool

Gate for the local provider (on-device OpenAI-compatible server). Separate from allow_cloud_ai because a localhost call is not network egress.

§local_ai_base_url: Option<String>

Endpoint for the local provider, sourced from settings. Passed through as CloudAiRequest.base_url for local-provider nodes.

§stream_sink: Arc<dyn LlmStreamSink>

Fan-out target for streaming LLM tokens. Wired by FlowApp so every AI (local/cloud) and agentic node invocation feeds the header chip ticker via Tauri’s flow:llm_token event. Headless tests use the default NullStreamSink.

§working_memory: WorkingMemory

Session-scoped key→JSON working memory, carried across runs by FlowApp so re-plan iterations see prior results. Succeeded set-variable utility nodes write it; any field (and when conditions) read it via {{memory.<key>}}. Headless tests pass a fresh empty store.

§control: SharedRunControl

Out-of-band pause/resume/cancel signal, polled at node boundaries. Shared with FlowApp so the Tauri pause/resume/stop commands can steer an in-progress run. Headless tests use the default (always Running).

§confirm_destructive: bool

Per-step destructive-action confirmation gate (roadmap E1). When true, the executor pauses before running a node that performs a destructive operation (file delete, rm, git push, …), emits ExecutionEvent::AwaitingConfirmation, and blocks until the user confirms (resume) or cancels (stop). Headless runners leave it false so a destructive node never blocks on a confirmation that can’t arrive.

§review_gate_available: bool

Whether a host capable of resolving an AI review gate is attached. Headless runners (CLI / TUI) set this false: a contract-bound output in the human review band then fails onto its fallback path instead of holding the run on a gate no one can resolve - RAO’s deterministic fallback, never a silent auto-approve.

§edit_staging: Option<StagedEdits>

When Some, AI-node tool calls that mutate the filesystem (fs write/edit/delete) are staged into this buffer - computed but not written - so a coding-agent turn can be reviewed before its edits land. Read-only tools and every shell tool still run for real, and a staged file is visible to later read-file calls in the same turn. [FlowApp::run_agent_turn] installs it; every other run leaves it None.

§workspace_root: PathBuf

Resolved workspace root for this run, forwarded to every adapter via [AdapterCtx::workspace_root]. FlowApp resolves it (per-run override, stored per-flow path, or edition default) before the run starts.

Implementations§

Source§

impl Executor

Source

pub async fn run( &self, graph: &FlowGraph, ) -> Result<ExecutionSummary, ExecutorError>

Source

pub async fn run_with_id( &self, execution_id: String, graph: &FlowGraph, ) -> Result<ExecutionSummary, ExecutorError>

Like Executor::run but uses a caller-supplied execution id. The host provides the id so it can associate the run with a specific tab/flow and steer it (pause / resume / cancel) immediately - before the Started event arrives - which is what makes concurrent multi-tab runs routable.

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> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> Instrument for T

§

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

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

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.

§

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

§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: 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
§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: 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, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

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

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

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.
§

impl<T> WithSubscriber for T

§

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
§

fn with_current_subscriber(self) -> WithDispatch<Self>

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

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