pub struct TaskPlanner {
pub task_list: Vec<Task>,
/* private fields */
}Expand description
Task planner: generates and tracks task lists for the agentic loop.
Fields§
§task_list: Vec<Task>Current task list.
Implementations§
Source§impl TaskPlanner
impl TaskPlanner
Sourcepub fn new(
workspace: Option<&Path>,
chat_root: Option<&Path>,
availability: Option<ToolAvailabilityView>,
) -> Self
pub fn new( workspace: Option<&Path>, chat_root: Option<&Path>, availability: Option<ToolAvailabilityView>, ) -> Self
Create a new TaskPlanner.
workspace: per-project override directory.
chat_root: ~/.skilllite/chat/ for loading prompts from the seed system.
Sourcepub async fn generate_task_list(
&mut self,
client: &LlmClient,
model: &str,
user_message: &str,
skills: &[LoadedSkill],
conversation_context: Option<&str>,
goal_boundaries: Option<&GoalBoundaries>,
soul: Option<&Soul>,
) -> Result<Vec<Task>>
pub async fn generate_task_list( &mut self, client: &LlmClient, model: &str, user_message: &str, skills: &[LoadedSkill], conversation_context: Option<&str>, goal_boundaries: Option<&GoalBoundaries>, soul: Option<&Soul>, ) -> Result<Vec<Task>>
Generate task list from user message using LLM.
goal_boundaries: Optional extracted boundaries (scope, exclusions, completion conditions)
to inject into planning. Used in run mode for long-running tasks.
soul: Optional SOUL identity document; when present, Scope & Boundaries are injected (A8).
Sourcepub fn matched_rule_ids(&self) -> &[String]
pub fn matched_rule_ids(&self) -> &[String]
Return planning rule IDs matched for the current user request.
Sourcepub fn sanitize_and_enhance_tasks(
&self,
tasks: &mut Vec<Task>,
skills: &[LoadedSkill],
)
pub fn sanitize_and_enhance_tasks( &self, tasks: &mut Vec<Task>, skills: &[LoadedSkill], )
Apply sanitize_task_hints and auto_enhance_tasks to a task list (e.g. from replan). Use this when accepting a new plan from update_task_plan so replan has the same validation and enhancement as initial planning.
Sourcepub fn build_execution_prompt(&self, skills: &[LoadedSkill]) -> String
pub fn build_execution_prompt(&self, skills: &[LoadedSkill]) -> String
Build the main execution system prompt from the external template. Placeholders: {{TODAY}}, {{YESTERDAY}}, {{SKILLS_LIST}}, {{OUTPUT_DIR}}.
Sourcepub fn build_task_system_prompt(
&self,
skills: &[LoadedSkill],
goal_boundaries: Option<&GoalBoundaries>,
) -> String
pub fn build_task_system_prompt( &self, skills: &[LoadedSkill], goal_boundaries: Option<&GoalBoundaries>, ) -> String
Build system prompt with task list and execution guidance.
goal_boundaries: Optional extracted boundaries to inject (A5, run mode).
Sourcepub fn mark_completed(&mut self, task_id: u32) -> bool
pub fn mark_completed(&mut self, task_id: u32) -> bool
Mark a task as completed and return whether it was found.
Sourcepub fn all_completed(&self) -> bool
pub fn all_completed(&self) -> bool
Check if all tasks are completed.
Returns false when the task list is empty: an empty plan means the LLM
decided no explicit tasks were needed, which is not the same as having
finished a set of tasks. Treating an empty list as “all done” causes
run_with_task_planning to fire the “final summary” branch immediately
after the first batch of tool calls, ending the loop prematurely.
Sourcepub fn current_task(&self) -> Option<&Task>
pub fn current_task(&self) -> Option<&Task>
Get the current (first uncompleted) task.
Sourcepub fn build_nudge_message(&self) -> Option<String>
pub fn build_nudge_message(&self) -> Option<String>
Build a nudge message to push the LLM to continue working on tasks.
Sourcepub fn build_depth_limit_message(&self, max_calls: usize) -> String
pub fn build_depth_limit_message(&self, max_calls: usize) -> String
Build a per-task depth limit message. Suggests complete_task first; if the approach is wrong, suggests update_task_plan.
Auto Trait Implementations§
impl Freeze for TaskPlanner
impl RefUnwindSafe for TaskPlanner
impl Send for TaskPlanner
impl Sync for TaskPlanner
impl Unpin for TaskPlanner
impl UnsafeUnpin for TaskPlanner
impl UnwindSafe for TaskPlanner
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more