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
taskIdas failed witherror. -
markRunning(
ExecutionDAG dag, String taskId) → void -
Marks
taskIdas running. -
markSkipped(
ExecutionDAG dag, String taskId, {String? reason}) → void -
Marks
taskIdas skipped. -
markSucceeded(
ExecutionDAG dag, String taskId, TaskResult result) → void -
Marks
taskIdas succeeded withresult. -
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
goalinto an ExecutionDAG of concrete tasks. -
replan(
ExecutionDAG dag, AgentContext context, {required String reason}) → Future< ExecutionDAG> -
Re-plans
dagbecause ofreason. -
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