Skip to main content

PlanMetadata

Struct PlanMetadata 

Source
pub struct PlanMetadata {
Show 18 fields pub plan_id: String, pub conversation_id: String, pub title: String, pub task_description: String, pub plan_content: String, pub model_id: Option<String>, pub status: PlanStatus, pub executed: bool, pub iterations_used: u32, pub created_at: i64, pub updated_at: i64, pub file_path: Option<String>, pub embedding: Option<Vec<f32>>, pub parent_plan_id: Option<String>, pub child_plan_ids: Vec<String>, pub branch_name: Option<String>, pub merged: bool, pub depth: u32,
}
Expand description

Metadata for a persisted execution plan

Fields§

§plan_id: String

Unique plan identifier.

§conversation_id: String

Conversation this plan belongs to.

§title: String

Short title derived from the task description.

§task_description: String

Full task description the plan was created for.

§plan_content: String

The plan content (steps, instructions).

§model_id: Option<String>

Model used to generate the plan, if known.

§status: PlanStatus

Current status of the plan.

§executed: bool

Whether the plan has been executed.

§iterations_used: u32

Number of iterations used during execution.

§created_at: i64

Unix timestamp when the plan was created.

§updated_at: i64

Unix timestamp when the plan was last updated.

§file_path: Option<String>

File path if the plan was exported to disk.

§embedding: Option<Vec<f32>>

Optional embedding vector for similarity search.

§parent_plan_id: Option<String>

Parent plan ID for branched plans.

§child_plan_ids: Vec<String>

IDs of child (branched) plans.

§branch_name: Option<String>

Branch name for branched plans.

§merged: bool

Whether this branch has been merged back.

§depth: u32

Nesting depth in the plan tree.

Implementations§

Source§

impl PlanMetadata

Source

pub fn new( conversation_id: String, task_description: String, plan_content: String, ) -> Self

Create a new plan with the given task and content

Source

pub fn create_branch( &self, branch_name: String, task_description: String, plan_content: String, ) -> Self

Create a branch (sub-plan) from this plan

Source

pub fn add_child(&mut self, child_id: String)

Add a child plan ID

Source

pub fn mark_merged(&mut self)

Mark as merged

Source

pub fn is_root(&self) -> bool

Check if this is a root plan

Source

pub fn has_children(&self) -> bool

Check if this plan has children

Source

pub fn with_model(self, model_id: String) -> Self

Set the model used

Source

pub fn with_iterations(self, iterations: u32) -> Self

Set iterations used

Source

pub fn mark_executed(&mut self)

Mark as executed

Source

pub fn set_status(&mut self, status: PlanStatus)

Update status

Source

pub fn set_file_path(&mut self, path: String)

Set file path after export

Source

pub fn created_at_datetime(&self) -> DateTime<Utc>

Get created_at as DateTime

Source

pub fn to_markdown(&self) -> String

Generate markdown export with YAML frontmatter

Trait Implementations§

Source§

impl Clone for PlanMetadata

Source§

fn clone(&self) -> PlanMetadata

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PlanMetadata

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for PlanMetadata

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Serialize for PlanMetadata

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
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> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,