SpectraAgent class abstract

Abstract base class for all Spectra agents.

Agents are autonomous units that perform specific roles in the multi-agent orchestration system. Each agent has:

  • A unique id for identification
  • A role defining its responsibilities
  • An LLMProvider for AI-powered decision making
  • Status tracking for coordination

Subclasses must implement step to define the agent's behavior.

Implementers

Constructors

SpectraAgent({required String id, required AgentRole role, required LLMProvider provider, required Logger logger})
Creates a new agent with the specified configuration.

Properties

currentTaskId String?
ID of the task currently being processed, if any.
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
id String
Unique identifier for this agent.
final
lastActivity DateTime
Timestamp of the agent's last activity.
getter/setter pair
logger → Logger
Logger for agent output.
final
provider LLMProvider
The LLM provider used for AI-powered operations.
final
role AgentRole
The role this agent fulfills (mayor, worker, witness).
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
state AgentState
Returns the current state of this agent as an immutable snapshot.
no setter
status AgentStatus
Current operational status of the agent.
getter/setter pair

Methods

markActive() → void
Marks the agent as active (updates lastActivity).
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
step() Future<void>
Executes a single step of the agent's main logic.
toString() String
A string representation of this object.
inherited
updateStatus(AgentStatus newStatus) → void
Updates the agent's status and marks it as active.

Operators

operator ==(Object other) bool
The equality operator.
inherited