pub struct SessionHistoryIntegration;Expand description
Narrow integration surface used by the kcode-session-history facade.
Ordinary callers should create and reopen sessions through
kcode_session_history::SessionHistory. Keeping construction and raw-log
replay here lets that facade retain sole ownership of session lifecycle
while this crate owns Chatend’s mechanical persistence and projection.
Implementations§
Source§impl SessionHistoryIntegration
impl SessionHistoryIntegration
Sourcepub fn create_session(
path: impl AsRef<Path>,
metadata: SessionMetadata,
) -> Result<Session>
pub fn create_session( path: impl AsRef<Path>, metadata: SessionMetadata, ) -> Result<Session>
Creates a durable Chatend session for the history facade.
Sourcepub fn open_session(
path: impl AsRef<Path>,
metadata: SessionMetadata,
default_provider_model: Option<&str>,
estimator: Option<ProviderCostEstimator>,
) -> Result<Session>
pub fn open_session( path: impl AsRef<Path>, metadata: SessionMetadata, default_provider_model: Option<&str>, estimator: Option<ProviderCostEstimator>, ) -> Result<Session>
Reopens a durable Chatend session for the history facade.
When estimator is present, historical provider receipts that predate
stored cost fields are projected using default_provider_model and the
supplied estimator without rewriting durable history.
Sourcepub fn replay(
metadata: SessionMetadata,
log: &SessionLog,
default_provider_model: Option<&str>,
estimator: Option<ProviderCostEstimator>,
) -> Result<Chatend>
pub fn replay( metadata: SessionMetadata, log: &SessionLog, default_provider_model: Option<&str>, estimator: Option<ProviderCostEstimator>, ) -> Result<Chatend>
Replays a raw session log into exact Chatend state for presentation.
Optional compatibility pricing affects only the returned projection and never mutates the supplied log.
Sourcepub fn legacy_provider_cost_summary_for_archive(
archive: &Value,
default_provider_model: Option<&str>,
estimator: ProviderCostEstimator,
) -> Result<ProviderCostSummary>
pub fn legacy_provider_cost_summary_for_archive( archive: &Value, default_provider_model: Option<&str>, estimator: ProviderCostEstimator, ) -> Result<ProviderCostSummary>
Reconstructs compatible cost fields from an immutable session archive.
The archive is not modified.