pub struct SidSession { /* private fields */ }Expand description
On-disk representation of a single interactive agent session.
See the module-level documentation for an overview of the session lifecycle.
Implementations§
Source§impl SidSession
impl SidSession
Sourcepub fn create(config_root: &Path<'_>) -> Result<Self, SError>
pub fn create(config_root: &Path<'_>) -> Result<Self, SError>
Create a fresh session under the default sessions root for config_root.
§Errors
Returns an error when the sessions directory cannot be created or a unique session identifier cannot be allocated.
Sourcepub fn create_compacted(
config_root: &Path<'_>,
provenance: CompactionProvenance,
) -> Result<Self, SError>
pub fn create_compacted( config_root: &Path<'_>, provenance: CompactionProvenance, ) -> Result<Self, SError>
Create a compacted continuation session linked to a parent via provenance.
§Errors
Returns an error when the sessions directory cannot be created or a unique session identifier cannot be allocated.
Sourcepub fn resume(config_root: &Path<'_>, spec: &str) -> Result<Self, SError>
pub fn resume(config_root: &Path<'_>, spec: &str) -> Result<Self, SError>
Resume an existing session identified by spec.
spec can be an absolute path to a session directory, a path to its
session.json metadata file, or a bare session name relative to the
default sessions root.
§Errors
Returns an error when the session directory does not exist or its metadata cannot be read.
Sourcepub fn sessions_root(&self) -> &PathBuf
pub fn sessions_root(&self) -> &PathBuf
Return the parent directory that contains all session directories.
Sourcepub fn compaction_provenance(&self) -> Option<&CompactionProvenance>
pub fn compaction_provenance(&self) -> Option<&CompactionProvenance>
Return the compaction provenance if this session was created via compaction.
Sourcepub fn transcript_path(&self) -> PathBuf
pub fn transcript_path(&self) -> PathBuf
Return the path to the transcript JSON file for this session.