pub struct Session {Show 21 fields
pub id: String,
pub created_at: DateTime<Utc>,
pub updated_at: DateTime<Utc>,
pub messages: Vec<ChatMessage>,
pub context_files: Vec<String>,
pub working_directory: Option<String>,
pub metadata: HashMap<String, Value>,
pub playbook: Option<HashMap<String, Value>>,
pub file_changes: Vec<FileChange>,
pub channel: String,
pub chat_type: String,
pub channel_user_id: String,
pub thread_id: Option<String>,
pub delivery_context: HashMap<String, Value>,
pub last_activity: Option<DateTime<Utc>>,
pub workspace_confirmed: bool,
pub owner_id: Option<String>,
pub parent_id: Option<String>,
pub subagent_sessions: HashMap<String, String>,
pub time_archived: Option<DateTime<Utc>>,
pub slug: Option<String>,
}Expand description
Represents a conversation session.
Fields§
§id: String§created_at: DateTime<Utc>§updated_at: DateTime<Utc>§messages: Vec<ChatMessage>§context_files: Vec<String>§working_directory: Option<String>§metadata: HashMap<String, Value>§playbook: Option<HashMap<String, Value>>Serialized ACE Playbook.
file_changes: Vec<FileChange>Track file changes in this session.
channel: String§chat_type: String§channel_user_id: String§thread_id: Option<String>§delivery_context: HashMap<String, Value>§last_activity: Option<DateTime<Utc>>§workspace_confirmed: bool§owner_id: Option<String>§parent_id: Option<String>ID of parent session (if forked).
subagent_sessions: HashMap<String, String>tool_call_id -> child session_id
time_archived: Option<DateTime<Utc>>§slug: Option<String>Implementations§
Source§impl Session
impl Session
Sourcepub fn summary_additions(&self) -> u64
pub fn summary_additions(&self) -> u64
Total lines added across all file changes.
Sourcepub fn summary_deletions(&self) -> u64
pub fn summary_deletions(&self) -> u64
Total lines removed across all file changes.
Sourcepub fn summary_files(&self) -> usize
pub fn summary_files(&self) -> usize
Number of unique files changed.
Sourcepub fn is_archived(&self) -> bool
pub fn is_archived(&self) -> bool
Check if session is archived.
Sourcepub fn generate_slug(&self, title: Option<&str>) -> String
pub fn generate_slug(&self, title: Option<&str>) -> String
Generate URL-friendly slug from title.
Sourcepub fn add_file_change(&mut self, file_change: FileChange)
pub fn add_file_change(&mut self, file_change: FileChange)
Add a file change to the session.
Sourcepub fn get_file_changes_summary(&self) -> FileChangesSummary
pub fn get_file_changes_summary(&self) -> FileChangesSummary
Get a summary of file changes in this session.
Sourcepub fn total_tokens(&self) -> u64
pub fn total_tokens(&self) -> u64
Calculate total token count.
Sourcepub fn get_metadata(&self) -> SessionMetadata
pub fn get_metadata(&self) -> SessionMetadata
Get session metadata.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Session
impl<'de> Deserialize<'de> for Session
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 Session
impl RefUnwindSafe for Session
impl Send for Session
impl Sync for Session
impl Unpin for Session
impl UnsafeUnpin for Session
impl UnwindSafe for Session
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