pub struct SessionState {Show 28 fields
pub session_id: String,
pub cli_version: Option<String>,
pub base_commit: String,
pub attribution_base_commit: Option<String>,
pub worktree_path: Option<String>,
pub worktree_id: Option<String>,
pub started_at: String,
pub ended_at: Option<String>,
pub phase: Phase,
pub turn_id: Option<String>,
pub turn_checkpoint_ids: Vec<String>,
pub last_interaction_time: Option<String>,
pub step_count: i32,
pub checkpoint_transcript_start: i64,
pub untracked_files_at_start: Vec<String>,
pub files_touched: Vec<String>,
pub last_checkpoint_id: Option<CheckpointID>,
pub agent_type: Option<String>,
pub token_usage: Option<TokenUsage>,
pub transcript_identifier_at_start: Option<String>,
pub transcript_path: Option<String>,
pub first_prompt: Option<String>,
pub prompt_attributions: Vec<PromptAttribution>,
pub pending_prompt_attribution: Option<PromptAttribution>,
pub tools_used: HashSet<String>,
pub tool_calls: i32,
pub commits: Vec<String>,
pub est_cost_usd: Option<f64>,
}Expand description
Session state persisted at .git/entire-sessions/<session-id>.json.
Field names and JSON format match entire.io’s session.State.
Fields§
§session_id: Stringentire.io uses sessionID (camelCase with capital ID).
cli_version: Option<String>§base_commit: String§attribution_base_commit: Option<String>§worktree_path: Option<String>§worktree_id: Option<String>§started_at: String§ended_at: Option<String>§phase: Phase§turn_id: Option<String>§turn_checkpoint_ids: Vec<String>§last_interaction_time: Option<String>§step_count: i32§checkpoint_transcript_start: i64§untracked_files_at_start: Vec<String>§files_touched: Vec<String>§last_checkpoint_id: Option<CheckpointID>§agent_type: Option<String>§token_usage: Option<TokenUsage>§transcript_identifier_at_start: Option<String>§transcript_path: Option<String>§first_prompt: Option<String>§prompt_attributions: Vec<PromptAttribution>§pending_prompt_attribution: Option<PromptAttribution>§tools_used: HashSet<String>§tool_calls: i32§commits: Vec<String>§est_cost_usd: Option<f64>Implementations§
Source§impl SessionState
impl SessionState
Source§impl SessionState
impl SessionState
Sourcepub fn apply_event(&mut self, event: SessionEvent) -> bool
pub fn apply_event(&mut self, event: SessionEvent) -> bool
Apply a state machine event. Returns true if the transition was valid.
Sourcepub fn touch_file(&mut self, path: &str)
pub fn touch_file(&mut self, path: &str)
Add a file to the touched set. Absolute paths are relativized to the project root.
Sourcepub fn add_tokens(&mut self, tokens: &TokenUsage)
pub fn add_tokens(&mut self, tokens: &TokenUsage)
Add token usage from a tool call or response.
Trait Implementations§
Source§impl Clone for SessionState
impl Clone for SessionState
Source§fn clone(&self) -> SessionState
fn clone(&self) -> SessionState
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 SessionState
impl Debug for SessionState
Source§impl<'de> Deserialize<'de> for SessionState
impl<'de> Deserialize<'de> for SessionState
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
Auto Trait Implementations§
impl Freeze for SessionState
impl RefUnwindSafe for SessionState
impl Send for SessionState
impl Sync for SessionState
impl Unpin for SessionState
impl UnsafeUnpin for SessionState
impl UnwindSafe for SessionState
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<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>
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 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>
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