use anyhow::Result;
use std::path::Path;
use vtcode_core::core::agent::events::SessionStoreSink;
use vtcode_core::exec::events::ThreadEvent;
pub(crate) struct CanonicalEventSink {
inner: SessionStoreSink,
}
impl CanonicalEventSink {
pub(crate) async fn open(workspace: &Path, session_id: &str) -> Result<Self> {
Ok(Self {
inner: SessionStoreSink::open(workspace, session_id).await?,
})
}
pub(crate) fn emit(&self, event: &ThreadEvent) -> Result<()> {
self.inner.emit(event)
}
pub(crate) async fn close(&self) -> Result<()> {
self.inner.close().await
}
}