pub struct StepSource {
pub source_type: StepSourceType,
pub triggered_by: Option<String>,
pub reason: Option<String>,
pub depth: Option<u32>,
pub spawn_mode: Option<SpawnMode>,
}Expand description
StepSource - Tracks the origin of a step
Every step can optionally track why it was created, enabling:
- Full audit trails for discovered steps
- Replay of agentic discovery sequences
- Understanding step chains and dependencies
@see packages/enact-schemas/src/execution.schemas.ts - stepSourceSchema
Fields§
§source_type: StepSourceTypeType of source (why was this step created)
triggered_by: Option<String>ID of the step/entity that triggered this step (if any)
reason: Option<String>Human-readable reason for step creation
depth: Option<u32>Discovery depth (for discovered steps - how deep in discovery chain)
spawn_mode: Option<SpawnMode>How this step was spawned (for spawned steps)
Implementations§
Source§impl StepSource
impl StepSource
Sourcepub fn new(source_type: StepSourceType) -> Self
pub fn new(source_type: StepSourceType) -> Self
Create a new StepSource
Sourcepub fn initial_plan() -> Self
pub fn initial_plan() -> Self
Create a source for initial plan steps
Sourcepub fn discovered(
triggered_by: &StepId,
reason: impl Into<String>,
depth: u32,
) -> Self
pub fn discovered( triggered_by: &StepId, reason: impl Into<String>, depth: u32, ) -> Self
Create a source for discovered steps
Sourcepub fn user_guidance(
message_id: impl Into<String>,
reason: impl Into<String>,
) -> Self
pub fn user_guidance( message_id: impl Into<String>, reason: impl Into<String>, ) -> Self
Create a source for user guidance steps
Sourcepub fn llm_output(
step_id: &StepId,
reason: impl Into<String>,
depth: u32,
) -> Self
pub fn llm_output( step_id: &StepId, reason: impl Into<String>, depth: u32, ) -> Self
Create a source for LLM output discovery
Sourcepub fn tool_result(
step_id: &StepId,
reason: impl Into<String>,
depth: u32,
) -> Self
pub fn tool_result( step_id: &StepId, reason: impl Into<String>, depth: u32, ) -> Self
Create a source for tool result discovery
Sourcepub fn with_spawn_mode(self, spawn_mode: SpawnMode) -> Self
pub fn with_spawn_mode(self, spawn_mode: SpawnMode) -> Self
Set the spawn_mode field
Sourcepub fn with_triggered_by(self, triggered_by: impl Into<String>) -> Self
pub fn with_triggered_by(self, triggered_by: impl Into<String>) -> Self
Set the triggered_by field
Sourcepub fn with_reason(self, reason: impl Into<String>) -> Self
pub fn with_reason(self, reason: impl Into<String>) -> Self
Set the reason field
Sourcepub fn with_depth(self, depth: u32) -> Self
pub fn with_depth(self, depth: u32) -> Self
Set the depth field
Trait Implementations§
Source§impl Clone for StepSource
impl Clone for StepSource
Source§fn clone(&self) -> StepSource
fn clone(&self) -> StepSource
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for StepSource
impl Debug for StepSource
Source§impl Default for StepSource
impl Default for StepSource
Source§impl<'de> Deserialize<'de> for StepSource
impl<'de> Deserialize<'de> for StepSource
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>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for StepSource
impl PartialEq for StepSource
Source§impl Serialize for StepSource
impl Serialize for StepSource
impl Eq for StepSource
impl StructuralPartialEq for StepSource
Auto Trait Implementations§
impl Freeze for StepSource
impl RefUnwindSafe for StepSource
impl Send for StepSource
impl Sync for StepSource
impl Unpin for StepSource
impl UnsafeUnpin for StepSource
impl UnwindSafe for StepSource
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.