OrchestratorService class
Multi-agent orchestrator service for coordinating Spectra agents.
Manages the lifecycle of agents, distributes tasks, and handles error recovery for stuck or failed agents.
Constructors
- OrchestratorService({required Logger logger, OrchestratorConfig config = const OrchestratorConfig(), LLMService? llmService})
- Creates a new orchestrator service.
Properties
- config → OrchestratorConfig
-
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- isRunning → bool
-
Whether the orchestrator is currently running.
no setter
- logger → Logger
-
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
stats
→ Map<
String, dynamic> -
Gets orchestrator statistics.
no setter
Methods
-
addConvoy(
Convoy convoy) → void - Adds a convoy to be processed.
-
getAgentsByRole(
AgentRole role) → List< SpectraAgent> - Gets agents filtered by role.
-
getAllAgents(
) → List< SpectraAgent> - Gets all registered agents.
-
getPendingTasks(
) → List< SpectraTask> - Gets all pending tasks that can be assigned.
-
markTaskCompleted(
String taskId) → void - Marks a task as completed.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
restartAgent(
String agentId) → bool - Restarts a failed agent.
-
start(
{int workerCount = 2}) → Future< void> - Starts the orchestrator with the specified number of workers.
-
stop(
) → void - Stops the orchestrator.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited