everruns-local 0.16.2

Local, SQLite-backed runtime backend stores for embedded in-process Everruns hosts
Documentation
// Error type for the local crate. Converts cleanly into the core
// `AgentLoopError` so trait implementations can return `everruns_core::Result`.

use everruns_core::error::AgentLoopError;

#[derive(Debug, thiserror::Error)]
pub enum LocalError {
    #[error("sqlite error: {0}")]
    Sqlite(#[from] rusqlite::Error),

    #[error("serialization error: {0}")]
    Serde(#[from] serde_json::Error),

    #[error("configuration error: {0}")]
    Config(String),

    #[error("{0}")]
    Other(String),
}

pub type LocalResult<T> = std::result::Result<T, LocalError>;

impl From<LocalError> for AgentLoopError {
    fn from(err: LocalError) -> Self {
        match err {
            LocalError::Config(msg) => AgentLoopError::config(msg),
            other => AgentLoopError::store(other.to_string()),
        }
    }
}