pub struct Intent { /* private fields */ }Expand description
The entry point of every AI-assisted workflow.
An Intent captures both the verbatim user input (prompt) and the
AI’s structured understanding of that input (content). It is
created at step ② and completed at step ⑩ of the end-to-end flow.
See module documentation for lifecycle position, status transitions,
and conversational refinement.
Implementations§
Source§impl Intent
impl Intent
Sourcepub fn new(
created_by: ActorRef,
prompt: impl Into<String>,
) -> Result<Self, String>
pub fn new( created_by: ActorRef, prompt: impl Into<String>, ) -> Result<Self, String>
Create a new intent in Draft status from a raw user prompt.
The content field is initially None — call set_content
after the AI has analyzed the prompt.
Sourcepub fn set_content(&mut self, content: Option<String>)
pub fn set_content(&mut self, content: Option<String>)
Sets the AI-analyzed content.
Sourcepub fn parent(&self) -> Option<Uuid>
pub fn parent(&self) -> Option<Uuid>
Returns the parent intent ID, if this is part of a refinement chain.
Sourcepub fn commit(&self) -> Option<&IntegrityHash>
pub fn commit(&self) -> Option<&IntegrityHash>
Returns the result commit SHA, if the intent has been fulfilled.
Sourcepub fn status(&self) -> Option<&IntentStatus>
pub fn status(&self) -> Option<&IntentStatus>
Returns the current lifecycle status (the last entry in the history).
Returns None only if statuses is empty, which should not
happen for objects created via Intent::new (seeds with
Draft), but may occur for malformed deserialized data.
Sourcepub fn statuses(&self) -> &[StatusEntry]
pub fn statuses(&self) -> &[StatusEntry]
Returns the full chronological status history.
Sourcepub fn set_parent(&mut self, parent: Option<Uuid>)
pub fn set_parent(&mut self, parent: Option<Uuid>)
Links this intent to a parent intent for conversational refinement.
Sourcepub fn set_commit(&mut self, sha: Option<IntegrityHash>)
pub fn set_commit(&mut self, sha: Option<IntegrityHash>)
Records the git commit SHA that fulfilled this intent.
Sourcepub fn plan(&self) -> Option<Uuid>
pub fn plan(&self) -> Option<Uuid>
Returns the associated Plan ID, if a Plan has been derived from this intent.
Sourcepub fn set_status(&mut self, status: IntentStatus)
pub fn set_status(&mut self, status: IntentStatus)
Transitions the intent to a new lifecycle status, appending to the history.
Sourcepub fn set_status_with_reason(
&mut self,
status: IntentStatus,
reason: impl Into<String>,
)
pub fn set_status_with_reason( &mut self, status: IntentStatus, reason: impl Into<String>, )
Transitions the intent to a new lifecycle status with a reason.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Intent
impl<'de> Deserialize<'de> for Intent
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl ObjectTrait for Intent
impl ObjectTrait for Intent
Source§fn from_bytes(data: &[u8], _hash: ObjectHash) -> Result<Self, GitError>where
Self: Sized,
fn from_bytes(data: &[u8], _hash: ObjectHash) -> Result<Self, GitError>where
Self: Sized,
Source§fn get_type(&self) -> ObjectType
fn get_type(&self) -> ObjectType
fn get_size(&self) -> usize
fn to_data(&self) -> Result<Vec<u8>, GitError>
Source§fn from_buf_read<R: BufRead>(read: &mut ReadBoxed<R>, size: usize) -> Selfwhere
Self: Sized,
fn from_buf_read<R: BufRead>(read: &mut ReadBoxed<R>, size: usize) -> Selfwhere
Self: Sized,
ReadBoxed<BufRead>.
the input size,is only for new a vec with directive space allocation
the input data stream and output object should be plain base object .Source§fn object_hash(&self) -> Result<ObjectHash, GitError>
fn object_hash(&self) -> Result<ObjectHash, GitError>
Auto Trait Implementations§
impl Freeze for Intent
impl RefUnwindSafe for Intent
impl Send for Intent
impl Sync for Intent
impl Unpin for Intent
impl UnsafeUnpin for Intent
impl UnwindSafe for Intent
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> FileLoadStore for Twhere
T: Serialize + for<'a> Deserialize<'a>,
impl<T> FileLoadStore for Twhere
T: Serialize + for<'a> Deserialize<'a>,
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