052591281d
- Complete agent system with planning and execution - Bridge API with FastAPI server - WhatsApp-style mobile dashboard - Enhanced web search with query improvement - Security guards and policy checks - Comprehensive documentation
15 lines
436 B
Python
15 lines
436 B
Python
"""Step selector — picks the next pending step from a plan."""
|
|
from __future__ import annotations
|
|
|
|
from typing import Optional
|
|
|
|
from core.state import Plan, PlanStep, StepStatus
|
|
|
|
|
|
def select_next_step(plan: Plan) -> Optional[PlanStep]:
|
|
"""Return the first step with PENDING status, or None if all steps are done."""
|
|
for step in plan.steps:
|
|
if step.status == StepStatus.PENDING:
|
|
return step
|
|
return None
|