PlanningEngine class

Decomposes goals into tasks and tracks their execution.

Core usage

final engine = PlanningEngine(llmCore: core);

// Generate initial plan
final dag = await engine.plan(goal, context);

// Pick next task
final task = engine.nextTask(dag);

// Mark progress
engine.markRunning(dag, task.id);
engine.markSucceeded(dag, task.id, result);

// Re-plan when needed
final newDag = await engine.replan(dag, reason: 'API unavailable', context: ctx);

Constructors

PlanningEngine({LLMCore? llmCore, ConsciousnessLogger? logger})

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

markFailed(ExecutionDAG dag, String taskId, String error, {bool retryable = true}) → void
Marks taskId as failed with error.
markRunning(ExecutionDAG dag, String taskId) → void
Marks taskId as running.
markSkipped(ExecutionDAG dag, String taskId, {String? reason}) → void
Marks taskId as skipped.
markSucceeded(ExecutionDAG dag, String taskId, TaskResult result) → void
Marks taskId as succeeded with result.
nextTask(ExecutionDAG dag) → AgentTask?
Returns the highest-priority ready task, or null if none are ready.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
plan(AgentGoal goal, AgentContext context) → Future<ExecutionDAG>
Decomposes goal into an ExecutionDAG of concrete tasks.
replan(ExecutionDAG dag, AgentContext context, {required String reason}) → Future<ExecutionDAG>
Re-plans dag because of reason.
summarise(ExecutionDAG dag) → String
Builds a human-readable plan summary for display or LLM context.
toString() → String
A string representation of this object.
inherited

Operators

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