Skip to main content

TaskPlanner

Struct TaskPlanner 

Source
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

Source

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.

Source

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).

Source

pub fn matched_rule_ids(&self) -> &[String]

Return planning rule IDs matched for the current user request.

Source

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.

Source

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}}.

Source

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).

Source

pub fn mark_completed(&mut self, task_id: u32) -> bool

Mark a task as completed and return whether it was found.

Source

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.

Source

pub fn is_empty(&self) -> bool

Check if the task list is empty (LLM decided no tools needed).

Source

pub fn current_task(&self) -> Option<&Task>

Get the current (first uncompleted) task.

Source

pub fn build_nudge_message(&self) -> Option<String>

Build a nudge message to push the LLM to continue working on tasks.

Source

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§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

fn into_either(self, into_left: bool) -> Either<Self, Self>

Converts 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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

Converts 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
Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more