class DroidAgentState(BaseModel):
# Task context
instruction: str = "" # Original task
step_number: int = 0 # Current step
# Device state
formatted_device_state: str = "" # Human-readable state
current_package_name: str = "" # Current app
current_activity_name: str = "" # Current screen
# Action tracking
action_history: List[Dict] = [] # All actions taken
action_outcomes: List[bool] = [] # Success/failure
summary_history: List[str] = [] # Action summaries
# Memory
memory: str = "" # Agent persistent memory
# Planning (Manager)
plan: str = "" # Current plan
current_subgoal: str = "" # Current subgoal
manager_answer: str = "" # Answer-type responses
# Error handling
error_flag_plan: bool = False # Signal error to Manager
error_descriptions: List[str] = [] # Error messages
# Script execution (Scripter)
scripter_history: List[Dict] = [] # Scripter results
last_scripter_success: bool = True # Last execution status
# Custom variables
custom_variables: Dict = {} # User-defined data