pub struct TaskOrchestrator { /* private fields */ }Expand description
The task orchestrator — manages the full lifecycle of task plans.
Fields are pub(crate) so per-action handlers (crate::actions) and
aggregation helpers (crate::aggregation) can split impl across
sibling modules. Outside the orchestrate crate the struct’s surface
is the public methods only.
Implementations§
Source§impl TaskOrchestrator
impl TaskOrchestrator
Sourcepub async fn plan(
&self,
request: &str,
context: DecompositionContext,
) -> Result<(String, String), OrchestrateError>
pub async fn plan( &self, request: &str, context: DecompositionContext, ) -> Result<(String, String), OrchestrateError>
Decompose a user request into a task plan. Returns the task ID and a formatted plan for user review.
Sourcepub async fn get_task(&self, task_id: &str) -> Option<TaskState>
pub async fn get_task(&self, task_id: &str) -> Option<TaskState>
Get the current state of a task.
Sourcepub async fn pending_approvals(&self) -> Vec<String>
pub async fn pending_approvals(&self) -> Vec<String>
Return task IDs currently in the AwaitingApproval phase. Used by
the signal pipeline to resolve bare approve / reject (no id)
to the single pending plan when there’s exactly one.
Sourcepub async fn cancel(&self, task_id: &str) -> Result<(), OrchestrateError>
pub async fn cancel(&self, task_id: &str) -> Result<(), OrchestrateError>
Cancel a task. Flips all non-terminal step states to Cancelled,
transitions the task phase to Cancelled, and (PR-6b) fires the
per-task CancellationToken so any in-flight step future
observing the token aborts within one polling cycle — without
PR-6b, cancellation would have to wait for the current step to
finish on its own.
Source§impl TaskOrchestrator
impl TaskOrchestrator
pub fn new(decomposer: Arc<dyn TaskDecomposer>) -> Self
Sourcepub fn with_available_tools(self, tools: Vec<String>) -> Self
pub fn with_available_tools(self, tools: Vec<String>) -> Self
Cache the sandbox’s binary allowlist so the replan-on-failure loop can include it in its corrective LLM call. Without this the replan call has no allowlist context and may suggest binaries the sandbox would reject.
pub fn with_audit(self, audit: Arc<dyn AuditTrail>) -> Self
pub fn with_confirmation(self, confirm: Arc<dyn ConfirmationEngine>) -> Self
pub fn with_budget(self, budget: Arc<dyn CostBudget>) -> Self
pub fn with_sandbox(self, sandbox: Arc<dyn SandboxExecutor>) -> Self
Sourcepub fn with_agents(self, agents: Arc<AgentRegistry>) -> Self
pub fn with_agents(self, agents: Arc<AgentRegistry>) -> Self
Attach the agent registry — enables StepAction::Implement
dispatch to specialist delegates.
Sourcepub fn with_llm(self, llm: Arc<dyn LlmProvider>) -> Self
pub fn with_llm(self, llm: Arc<dyn LlmProvider>) -> Self
Attach an LLM provider so Research and Review steps actually
run a model call instead of returning a no-op string.
Sourcepub fn with_channel_dispatcher(self, dispatcher: Arc<ChannelDispatcher>) -> Self
pub fn with_channel_dispatcher(self, dispatcher: Arc<ChannelDispatcher>) -> Self
Attach a channel dispatcher so Notify steps actually deliver
the message to the user’s preferred channel.
Sourcepub fn with_episodic(self, store: Arc<EpisodicStore>) -> Self
pub fn with_episodic(self, store: Arc<EpisodicStore>) -> Self
Attach an episodic memory store — delegate outcomes are recorded so they’re searchable in future sessions.
Sourcepub fn with_observer(self, observer: Arc<dyn Observer>) -> Self
pub fn with_observer(self, observer: Arc<dyn Observer>) -> Self
Attach an observer bus so phase transitions emit
observe::BrainEvent::TaskStateChange. Unwired = silent.
Sourcepub fn with_state_pool(self, pool: SqlitePool) -> Self
pub fn with_state_pool(self, pool: SqlitePool) -> Self
Attach a SQLite pool so phase transitions append rows to the
task_states audit table (migration v22). Unwired = in-memory
history only.
Sourcepub fn with_delegation_policy(self, policy: EscalationPolicy) -> Self
pub fn with_delegation_policy(self, policy: EscalationPolicy) -> Self
Override the default delegation escalation policy.
Auto Trait Implementations§
impl !Freeze for TaskOrchestrator
impl !RefUnwindSafe for TaskOrchestrator
impl !UnwindSafe for TaskOrchestrator
impl Send for TaskOrchestrator
impl Sync for TaskOrchestrator
impl Unpin for TaskOrchestrator
impl UnsafeUnpin for TaskOrchestrator
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
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<T> Paint for Twhere
T: ?Sized,
impl<T> Paint for Twhere
T: ?Sized,
Source§fn fg(&self, value: Color) -> Painted<&T>
fn fg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the foreground set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like red() and
green(), which have the same functionality but are
pithier.
§Example
Set foreground color to white using fg():
use yansi::{Paint, Color};
painted.fg(Color::White);Set foreground color to white using white().
use yansi::Paint;
painted.white();Source§fn bright_black(&self) -> Painted<&T>
fn bright_black(&self) -> Painted<&T>
Source§fn bright_red(&self) -> Painted<&T>
fn bright_red(&self) -> Painted<&T>
Source§fn bright_green(&self) -> Painted<&T>
fn bright_green(&self) -> Painted<&T>
Source§fn bright_yellow(&self) -> Painted<&T>
fn bright_yellow(&self) -> Painted<&T>
Source§fn bright_blue(&self) -> Painted<&T>
fn bright_blue(&self) -> Painted<&T>
Source§fn bright_magenta(&self) -> Painted<&T>
fn bright_magenta(&self) -> Painted<&T>
Source§fn bright_cyan(&self) -> Painted<&T>
fn bright_cyan(&self) -> Painted<&T>
Source§fn bright_white(&self) -> Painted<&T>
fn bright_white(&self) -> Painted<&T>
Source§fn bg(&self, value: Color) -> Painted<&T>
fn bg(&self, value: Color) -> Painted<&T>
Returns a styled value derived from self with the background set to
value.
This method should be used rarely. Instead, prefer to use color-specific
builder methods like on_red() and
on_green(), which have the same functionality but
are pithier.
§Example
Set background color to red using fg():
use yansi::{Paint, Color};
painted.bg(Color::Red);Set background color to red using on_red().
use yansi::Paint;
painted.on_red();Source§fn on_primary(&self) -> Painted<&T>
fn on_primary(&self) -> Painted<&T>
Source§fn on_magenta(&self) -> Painted<&T>
fn on_magenta(&self) -> Painted<&T>
Source§fn on_bright_black(&self) -> Painted<&T>
fn on_bright_black(&self) -> Painted<&T>
Source§fn on_bright_red(&self) -> Painted<&T>
fn on_bright_red(&self) -> Painted<&T>
Source§fn on_bright_green(&self) -> Painted<&T>
fn on_bright_green(&self) -> Painted<&T>
Source§fn on_bright_yellow(&self) -> Painted<&T>
fn on_bright_yellow(&self) -> Painted<&T>
Source§fn on_bright_blue(&self) -> Painted<&T>
fn on_bright_blue(&self) -> Painted<&T>
Source§fn on_bright_magenta(&self) -> Painted<&T>
fn on_bright_magenta(&self) -> Painted<&T>
Source§fn on_bright_cyan(&self) -> Painted<&T>
fn on_bright_cyan(&self) -> Painted<&T>
Source§fn on_bright_white(&self) -> Painted<&T>
fn on_bright_white(&self) -> Painted<&T>
Source§fn attr(&self, value: Attribute) -> Painted<&T>
fn attr(&self, value: Attribute) -> Painted<&T>
Enables the styling Attribute value.
This method should be used rarely. Instead, prefer to use
attribute-specific builder methods like bold() and
underline(), which have the same functionality
but are pithier.
§Example
Make text bold using attr():
use yansi::{Paint, Attribute};
painted.attr(Attribute::Bold);Make text bold using using bold().
use yansi::Paint;
painted.bold();Source§fn rapid_blink(&self) -> Painted<&T>
fn rapid_blink(&self) -> Painted<&T>
Source§fn quirk(&self, value: Quirk) -> Painted<&T>
fn quirk(&self, value: Quirk) -> Painted<&T>
Enables the yansi Quirk value.
This method should be used rarely. Instead, prefer to use quirk-specific
builder methods like mask() and
wrap(), which have the same functionality but are
pithier.
§Example
Enable wrapping using .quirk():
use yansi::{Paint, Quirk};
painted.quirk(Quirk::Wrap);Enable wrapping using wrap().
use yansi::Paint;
painted.wrap();Source§fn clear(&self) -> Painted<&T>
👎Deprecated since 1.0.1: renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
fn clear(&self) -> Painted<&T>
renamed to resetting() due to conflicts with Vec::clear().
The clear() method will be removed in a future release.
Source§fn whenever(&self, value: Condition) -> Painted<&T>
fn whenever(&self, value: Condition) -> Painted<&T>
Conditionally enable styling based on whether the Condition value
applies. Replaces any previous condition.
See the crate level docs for more details.
§Example
Enable styling painted only when both stdout and stderr are TTYs:
use yansi::{Paint, Condition};
painted.red().on_yellow().whenever(Condition::STDOUTERR_ARE_TTY);