pub struct Task {Show 15 fields
pub id: String,
pub description: String,
pub status: TaskStatus,
pub plan_id: Option<String>,
pub parent_id: Option<String>,
pub children: Vec<String>,
pub depends_on: Vec<String>,
pub priority: TaskPriority,
pub assigned_to: Option<String>,
pub iterations: u32,
pub summary: Option<String>,
pub created_at: i64,
pub updated_at: i64,
pub started_at: Option<i64>,
pub completed_at: Option<i64>,
}Expand description
A task being executed by an agent (supports tree structure)
Fields§
§id: StringUnique task ID
description: StringTask description
status: TaskStatusCurrent status
plan_id: Option<String>Associated plan ID (links task to a plan)
parent_id: Option<String>Parent task ID (for tree structure)
children: Vec<String>Child task IDs
depends_on: Vec<String>Task IDs this task depends on (must complete before this can start)
priority: TaskPriorityTask priority
assigned_to: Option<String>Assigned agent (if any)
iterations: u32Number of iterations executed
summary: Option<String>Result summary (when completed or failed)
created_at: i64Creation timestamp
updated_at: i64Last update timestamp
started_at: Option<i64>When the task was started (for time tracking)
completed_at: Option<i64>When the task was completed (for time tracking)
Implementations§
Source§impl Task
impl Task
Sourcepub fn new_for_plan<S: Into<String>>(id: S, description: S, plan_id: S) -> Self
pub fn new_for_plan<S: Into<String>>(id: S, description: S, plan_id: S) -> Self
Create a new task associated with a plan
Sourcepub fn new_subtask<S: Into<String>>(id: S, description: S, parent_id: S) -> Self
pub fn new_subtask<S: Into<String>>(id: S, description: S, parent_id: S) -> Self
Create a new task with a parent (subtask)
Sourcepub fn duration_secs(&self) -> Option<i64>
pub fn duration_secs(&self) -> Option<i64>
Get task duration in seconds (if started and completed)
Sourcepub fn elapsed_secs(&self) -> Option<i64>
pub fn elapsed_secs(&self) -> Option<i64>
Get elapsed time since task started (in seconds)
Sourcepub fn increment_iteration(&mut self)
pub fn increment_iteration(&mut self)
Increment iterations
Sourcepub fn add_dependency(&mut self, task_id: String)
pub fn add_dependency(&mut self, task_id: String)
Add a dependency
Sourcepub fn has_dependencies(&self) -> bool
pub fn has_dependencies(&self) -> bool
Check if task has any incomplete dependencies
Sourcepub fn has_children(&self) -> bool
pub fn has_children(&self) -> bool
Check if task has children
Sourcepub fn set_priority(&mut self, priority: TaskPriority)
pub fn set_priority(&mut self, priority: TaskPriority)
Set priority