pub struct Orchestrator { /* private fields */ }Expand description
The orchestrator coordinates the full Ouroboros lifecycle.
Implementations§
Source§impl Orchestrator
impl Orchestrator
Sourcepub fn new(
ouroboros: Arc<dyn OuroborosProtocol>,
event_bus: EventBus,
state_store: Arc<StateStore>,
lifecycle: AgentLifecycleManager,
) -> Self
pub fn new( ouroboros: Arc<dyn OuroborosProtocol>, event_bus: EventBus, state_store: Arc<StateStore>, lifecycle: AgentLifecycleManager, ) -> Self
Creates a new orchestrator.
Sourcepub fn with_config(
ouroboros: Arc<dyn OuroborosProtocol>,
event_bus: EventBus,
state_store: Arc<StateStore>,
lifecycle: AgentLifecycleManager,
config: OrchestratorConfig,
) -> Self
pub fn with_config( ouroboros: Arc<dyn OuroborosProtocol>, event_bus: EventBus, state_store: Arc<StateStore>, lifecycle: AgentLifecycleManager, config: OrchestratorConfig, ) -> Self
Creates a new orchestrator with custom config.
Sourcepub fn set_project_manager(&self, manager: Arc<ProjectManager>)
pub fn set_project_manager(&self, manager: Arc<ProjectManager>)
Set the ProjectManager for context partitioning.
Sourcepub fn project_manager(&self) -> Option<Arc<ProjectManager>>
pub fn project_manager(&self) -> Option<Arc<ProjectManager>>
Get a reference to the ProjectManager, if set.
Sourcepub fn detect_project_tag(&self, message: &str) -> Option<String>
pub fn detect_project_tag(&self, message: &str) -> Option<String>
Detect a project from a message, returning tag string.
Sourcepub fn set_a2a(&mut self, a2a: Arc<A2AProtocol>)
pub fn set_a2a(&mut self, a2a: Arc<A2AProtocol>)
Set the A2A protocol for inter-agent task delegation.
Sourcepub fn set_git_layer(&mut self, git_layer: Arc<GitLayer>)
pub fn set_git_layer(&mut self, git_layer: Arc<GitLayer>)
Set the GitLayer for auto-commits after state saves.
Sourcepub fn update_evolution_config(&self, config: OrchestratorConfig)
pub fn update_evolution_config(&self, config: OrchestratorConfig)
Hot-reload evolution config without restart.
Takes effect on the next orchestration run.
Sourcepub async fn restore_sessions(&self)
pub async fn restore_sessions(&self)
Restore sessions from persisted state.
Loads sessions from the StateStore that have an active_seed_id
(meaning they are mid-orchestration) and repopulates the in-memory
interview session map so that follow-up messages can continue
the conversation.
Sourcepub async fn handle_message(
&self,
user_id: &str,
user_message: &str,
session_id: Option<&str>,
project_ids: Option<&str>,
request_id: &str,
) -> Result<OrchestrationResult>
pub async fn handle_message( &self, user_id: &str, user_message: &str, session_id: Option<&str>, project_ids: Option<&str>, request_id: &str, ) -> Result<OrchestrationResult>
Handle a user message through the full Ouroboros loop.
Returns an OrchestrationResult with the response and metadata.
If the interview phase needs clarification (ambiguity > 0.2),
the result will contain the questions and the phase will be
Phase::Interview. The caller should send these questions to
the user and include the session_id in follow-up messages.
Sourcepub async fn delegate_subtasks(
&self,
subtasks: Vec<SubTask>,
parent_seed: &Seed,
) -> Result<Vec<SubTask>>
pub async fn delegate_subtasks( &self, subtasks: Vec<SubTask>, parent_seed: &Seed, ) -> Result<Vec<SubTask>>
Execute multiple subtasks using separate agents in parallel.
When A2A is available, the orchestrator delegates tasks through the A2A protocol with circuit breaker and retry support. Otherwise, falls back to direct lifecycle execution.
Results are collected as they complete using JoinSet.