use nanocodex_oai_api::responses::ResponseItem;
use crate::session::CommittedSession;
#[derive(Clone, Debug)]
pub struct AgentSessionContext {
workspace: String,
history: Vec<ResponseItem>,
}
impl AgentSessionContext {
pub(super) fn new(checkpoint: Option<&CommittedSession>, workspace: String) -> Self {
let history =
checkpoint.map_or_else(Vec::new, |checkpoint| checkpoint.model().snapshot_history());
Self { workspace, history }
}
#[must_use]
pub fn workspace(&self) -> &str {
&self.workspace
}
#[must_use]
pub fn history(&self) -> &[ResponseItem] {
&self.history
}
}