pub struct PlanExecutorAgent { /* private fields */ }Expand description
Plan Executor Agent - coordinates execution of a plan’s tasks
Implementations§
Source§impl PlanExecutorAgent
impl PlanExecutorAgent
Sourcepub fn new(
plan: PlanMetadata,
task_manager: Arc<RwLock<TaskManager>>,
config: PlanExecutionConfig,
) -> Self
pub fn new( plan: PlanMetadata, task_manager: Arc<RwLock<TaskManager>>, config: PlanExecutionConfig, ) -> Self
Create a new plan executor
Sourcepub async fn plan(&self) -> PlanMetadata
pub async fn plan(&self) -> PlanMetadata
Get the plan
Sourcepub async fn status(&self) -> PlanExecutionStatus
pub async fn status(&self) -> PlanExecutionStatus
Get the execution status
Sourcepub async fn current_task_id(&self) -> Option<String>
pub async fn current_task_id(&self) -> Option<String>
Get the current task ID
Sourcepub fn approval_mode(&self) -> ExecutionApprovalMode
pub fn approval_mode(&self) -> ExecutionApprovalMode
Get the approval mode
Sourcepub fn set_approval_mode(&mut self, mode: ExecutionApprovalMode)
pub fn set_approval_mode(&mut self, mode: ExecutionApprovalMode)
Set the approval mode
Sourcepub fn needs_approval(&self, _task: &Task) -> bool
pub fn needs_approval(&self, _task: &Task) -> bool
Check if a task needs approval based on current mode
Sourcepub async fn get_next_task(&self) -> Option<Task>
pub async fn get_next_task(&self) -> Option<Task>
Get the next task to execute
Sourcepub async fn start_task(&self, task_id: &str) -> Result<()>
pub async fn start_task(&self, task_id: &str) -> Result<()>
Start executing a specific task
Sourcepub async fn complete_current_task(
&self,
summary: String,
) -> Result<Option<Task>>
pub async fn complete_current_task( &self, summary: String, ) -> Result<Option<Task>>
Complete the current task
Sourcepub async fn skip_current_task(
&self,
reason: Option<String>,
) -> Result<Option<Task>>
pub async fn skip_current_task( &self, reason: Option<String>, ) -> Result<Option<Task>>
Skip the current task
Sourcepub async fn fail_current_task(&self, error: String) -> Result<()>
pub async fn fail_current_task(&self, error: String) -> Result<()>
Fail the current task
Sourcepub async fn request_approval(&self, task: &Task)
pub async fn request_approval(&self, task: &Task)
Request approval for a task (in Suggest mode)
Sourcepub async fn approve_and_start(&self, task_id: &str) -> Result<()>
pub async fn approve_and_start(&self, task_id: &str) -> Result<()>
Approve and start a task
Sourcepub async fn get_progress(&self) -> ExecutionProgress
pub async fn get_progress(&self) -> ExecutionProgress
Get execution progress
Sourcepub async fn format_progress(&self) -> String
pub async fn format_progress(&self) -> String
Format progress as a string
Auto Trait Implementations§
impl Freeze for PlanExecutorAgent
impl !RefUnwindSafe for PlanExecutorAgent
impl Send for PlanExecutorAgent
impl Sync for PlanExecutorAgent
impl Unpin for PlanExecutorAgent
impl UnsafeUnpin for PlanExecutorAgent
impl !UnwindSafe for PlanExecutorAgent
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more