pub struct AgentOrchestrator<M: OrchestratorAgentManager> { /* private fields */ }Expand description
Orchestrator for coordinating subagents and delegated task execution.
The orchestrator is core-owned and does not depend on Tauri. GUI/CLI layers can
attach an OrchestratorObserver to receive lifecycle events.
Implementations§
Source§impl<M: OrchestratorAgentManager> AgentOrchestrator<M>
impl<M: OrchestratorAgentManager> AgentOrchestrator<M>
pub async fn list_environments( &self, run_id: Option<&str>, ) -> Vec<EnvironmentRecord>
pub async fn get_environment( &self, environment_id: &str, ) -> Option<EnvironmentRecord>
pub async fn retry_environment_preparation( &self, environment_id: &str, ) -> Result<EnvironmentRecord, String>
pub async fn cleanup_environment( &self, environment_id: &str, archive_if_dirty: bool, ) -> Result<EnvironmentRecord, String>
Source§impl<M: OrchestratorAgentManager> AgentOrchestrator<M>
impl<M: OrchestratorAgentManager> AgentOrchestrator<M>
pub async fn reconcile_orchestrator_state(&self) -> Result<(), String>
Source§impl<M: OrchestratorAgentManager> AgentOrchestrator<M>
impl<M: OrchestratorAgentManager> AgentOrchestrator<M>
Sourcepub fn new(agent_manager: M, config: AppConfig) -> Self
pub fn new(agent_manager: M, config: AppConfig) -> Self
Create a new orchestrator with the given agent manager and application config.
Sourcepub fn new_with_workspace_root(
agent_manager: M,
config: AppConfig,
default_workspace_dir: Option<PathBuf>,
) -> Self
pub fn new_with_workspace_root( agent_manager: M, config: AppConfig, default_workspace_dir: Option<PathBuf>, ) -> Self
Create a new orchestrator with an explicit workspace root for persisted state.
Sourcepub async fn set_observer(&self, observer: Arc<dyn OrchestratorObserver>)
pub async fn set_observer(&self, observer: Arc<dyn OrchestratorObserver>)
Attach an observer used for adapter-side event emission.
This is intentionally async and uses interior mutability so adapters (GUI/CLI)
can attach observers after construction (e.g., once a Tauri AppHandle exists)
without requiring &mut self.
Sourcepub async fn clear_observer(&self)
pub async fn clear_observer(&self)
Remove any attached observer.
Sourcepub async fn spawn_subagent(&self, id: &str, name: &str) -> Result<(), String>
pub async fn spawn_subagent(&self, id: &str, name: &str) -> Result<(), String>
Spawn and register a new subagent.
Sourcepub async fn spawn_subagent_with_request(
&self,
request: AgentSpawnRequest,
) -> Result<(), String>
pub async fn spawn_subagent_with_request( &self, request: AgentSpawnRequest, ) -> Result<(), String>
Spawn and register a subagent using an explicit specialist configuration.
Sourcepub async fn delegate_task(&self, task: DelegatedTask) -> Result<String, String>
pub async fn delegate_task(&self, task: DelegatedTask) -> Result<String, String>
Delegate a task to a subagent.
- Ensures the target agent exists (spawning a default one if needed)
- Enforces tool permission checks
- Executes the task asynchronously via the unified pipeline
Sourcepub async fn create_child_supervisor_run(
&self,
request: ChildSupervisorRunRequest,
) -> Result<SupervisorRun, String>
pub async fn create_child_supervisor_run( &self, request: ChildSupervisorRunRequest, ) -> Result<SupervisorRun, String>
Create a direct child supervisor run under an existing parent run.
Sourcepub async fn poll_result(&self) -> Option<TaskResult>
pub async fn poll_result(&self) -> Option<TaskResult>
Get the result of a completed task if one is ready.
Sourcepub async fn list_active_tasks(&self) -> Vec<DelegatedTask>
pub async fn list_active_tasks(&self) -> Vec<DelegatedTask>
Get list of currently active tasks.
Sourcepub async fn list_active_task_snapshots(&self) -> Vec<ActiveTaskSnapshot>
pub async fn list_active_task_snapshots(&self) -> Vec<ActiveTaskSnapshot>
Get live active-task snapshots enriched with mirrored execution telemetry.
Sourcepub async fn list_supervisor_runs(&self) -> Vec<SupervisorRun>
pub async fn list_supervisor_runs(&self) -> Vec<SupervisorRun>
List live and persisted supervisor runs known to the orchestrator.
Sourcepub async fn list_root_supervisor_runs(&self) -> Vec<SupervisorRun>
pub async fn list_root_supervisor_runs(&self) -> Vec<SupervisorRun>
List only root supervisor runs (child runs excluded from the top-level list).
Sourcepub async fn list_child_supervisor_runs(
&self,
parent_run_id: &str,
) -> Vec<SupervisorRun>
pub async fn list_child_supervisor_runs( &self, parent_run_id: &str, ) -> Vec<SupervisorRun>
List child supervisor runs for a specific parent run.
Sourcepub async fn get_supervisor_run_ancestry(
&self,
run_id: &str,
) -> Vec<SupervisorRun>
pub async fn get_supervisor_run_ancestry( &self, run_id: &str, ) -> Vec<SupervisorRun>
Return the ancestor chain for a run, ordered from root to immediate parent.
Sourcepub async fn get_supervisor_run_descendants(
&self,
run_id: &str,
) -> Vec<SupervisorRun>
pub async fn get_supervisor_run_descendants( &self, run_id: &str, ) -> Vec<SupervisorRun>
Return all descendants beneath a run (bounded to one level for now).
Sourcepub async fn list_supervisor_leaf_tasks(
&self,
run_id: &str,
) -> Vec<SupervisorTaskRecord>
pub async fn list_supervisor_leaf_tasks( &self, run_id: &str, ) -> Vec<SupervisorTaskRecord>
Return leaf tasks visible beneath a run, including direct children.
Sourcepub async fn get_supervisor_run(&self, run_id: &str) -> Option<SupervisorRun>
pub async fn get_supervisor_run(&self, run_id: &str) -> Option<SupervisorRun>
Fetch a supervisor run by id.
Sourcepub async fn list_team_messages(&self, run_id: &str) -> Vec<TeamMessage>
pub async fn list_team_messages(&self, run_id: &str) -> Vec<TeamMessage>
List team messages for a run.
Sourcepub async fn list_team_threads(&self, run_id: &str) -> Vec<TeamThread>
pub async fn list_team_threads(&self, run_id: &str) -> Vec<TeamThread>
List grouped collaboration threads for a run.
Sourcepub async fn list_team_threads_with_options(
&self,
run_id: &str,
include_archived: bool,
) -> Vec<TeamThread>
pub async fn list_team_threads_with_options( &self, run_id: &str, include_archived: bool, ) -> Vec<TeamThread>
List grouped collaboration threads for a run with archive controls.
Sourcepub async fn list_subagents(&self) -> Vec<AgentInfo>
pub async fn list_subagents(&self) -> Vec<AgentInfo>
List all running subagents.
Sourcepub async fn approve_task(
&self,
task_id: &str,
actor: ApprovalActor,
note: Option<String>,
) -> Result<(), String>
pub async fn approve_task( &self, task_id: &str, actor: ApprovalActor, note: Option<String>, ) -> Result<(), String>
Approve a task before execution or after a review/test gate.
Sourcepub async fn reject_task(
&self,
task_id: &str,
actor: ApprovalActor,
note: Option<String>,
) -> Result<(), String>
pub async fn reject_task( &self, task_id: &str, actor: ApprovalActor, note: Option<String>, ) -> Result<(), String>
Reject or request revision for a delegated task.
Sourcepub async fn retry_task(&self, task_id: &str) -> Result<(), String>
pub async fn retry_task(&self, task_id: &str) -> Result<(), String>
Retry a task that previously failed or was blocked.
Sourcepub async fn resume_task_from_checkpoint(
&self,
task_id: &str,
) -> Result<(), String>
pub async fn resume_task_from_checkpoint( &self, task_id: &str, ) -> Result<(), String>
Resume a blocked workflow task from its latest persisted checkpoint.
Sourcepub async fn restart_task_from_scratch(
&self,
task_id: &str,
) -> Result<(), String>
pub async fn restart_task_from_scratch( &self, task_id: &str, ) -> Result<(), String>
Restart a workflow task from scratch and discard any saved checkpoint resume state.
Sourcepub async fn acknowledge_blocked_task(
&self,
task_id: &str,
note: Option<String>,
) -> Result<(), String>
pub async fn acknowledge_blocked_task( &self, task_id: &str, note: Option<String>, ) -> Result<(), String>
Record that an operator acknowledged a blocked workflow task without resuming it.
Sourcepub async fn claim_task(
&self,
task_id: &str,
agent_id: &str,
) -> Result<(), String>
pub async fn claim_task( &self, task_id: &str, agent_id: &str, ) -> Result<(), String>
Claim ownership of a queued task for an agent.
Sourcepub async fn send_team_message(
&self,
run_id: &str,
task_id: Option<String>,
kind: TeamMessageKind,
sender_agent_id: Option<String>,
recipient_agent_id: Option<String>,
content: impl Into<String>,
) -> Result<TeamMessage, String>
pub async fn send_team_message( &self, run_id: &str, task_id: Option<String>, kind: TeamMessageKind, sender_agent_id: Option<String>, recipient_agent_id: Option<String>, content: impl Into<String>, ) -> Result<TeamMessage, String>
Record a structured team message.
Sourcepub async fn send_team_message_draft(
&self,
run_id: &str,
draft: TeamMessageDraft,
) -> Result<TeamMessage, String>
pub async fn send_team_message_draft( &self, run_id: &str, draft: TeamMessageDraft, ) -> Result<TeamMessage, String>
Record a structured collaboration message using the richer draft payload.
Sourcepub async fn update_team_thread_action(
&self,
run_id: &str,
thread_id: &str,
status: CollaborationActionStatus,
actor_id: Option<String>,
note: Option<String>,
) -> Result<TeamThread, String>
pub async fn update_team_thread_action( &self, run_id: &str, thread_id: &str, status: CollaborationActionStatus, actor_id: Option<String>, note: Option<String>, ) -> Result<TeamThread, String>
Update the latest actionable request in a collaboration thread.
Sourcepub async fn archive_team_thread(
&self,
run_id: &str,
thread_id: &str,
actor_id: Option<String>,
note: Option<String>,
) -> Result<TeamThread, String>
pub async fn archive_team_thread( &self, run_id: &str, thread_id: &str, actor_id: Option<String>, note: Option<String>, ) -> Result<TeamThread, String>
Archive an existing collaboration thread.
Sourcepub async fn pause_task(&self, task_id: &str) -> Result<(), String>
pub async fn pause_task(&self, task_id: &str) -> Result<(), String>
Pause a running local delegated task and preserve resumable checkpoint state.
Sourcepub async fn shutdown_all(&self, grace_secs: u64)
pub async fn shutdown_all(&self, grace_secs: u64)
Shutdown all subagents gracefully.
Trait Implementations§
Source§impl<M: Clone + OrchestratorAgentManager> Clone for AgentOrchestrator<M>
impl<M: Clone + OrchestratorAgentManager> Clone for AgentOrchestrator<M>
Source§fn clone(&self) -> AgentOrchestrator<M>
fn clone(&self) -> AgentOrchestrator<M>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl<M> Freeze for AgentOrchestrator<M>where
M: Freeze,
impl<M> !RefUnwindSafe for AgentOrchestrator<M>
impl<M> Send for AgentOrchestrator<M>
impl<M> Sync for AgentOrchestrator<M>
impl<M> Unpin for AgentOrchestrator<M>where
M: Unpin,
impl<M> !UnwindSafe for AgentOrchestrator<M>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> DowncastSync for T
impl<T> DowncastSync for T
§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> FutureExt for T
impl<T> FutureExt for T
§fn with_context(self, otel_cx: Context) -> WithContext<Self>
fn with_context(self, otel_cx: Context) -> WithContext<Self>
§fn with_current_context(self) -> WithContext<Self>
fn with_current_context(self) -> WithContext<Self>
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§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§impl<T> IntoRequest<T> for T
impl<T> IntoRequest<T> for T
§fn into_request(self) -> Request<T>
fn into_request(self) -> Request<T>
T in a tonic::Request§impl<L> LayerExt<L> for L
impl<L> LayerExt<L> for L
§fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
fn named_layer<S>(&self, service: S) -> Layered<<L as Layer<S>>::Service, S>where
L: Layer<S>,
Layered].