artifactize-core 0.27.0

The library behind artifactize: Artifacts, evals, reviews, the monitor and review models, and the shared operations every interface calls.
Documentation
use super::*;
use serde_json::Value;

impl Recorder {
    /// A session saved below `state` for no Run.
    pub(crate) fn test(state: &Path, id: &str) -> Self {
        let id: crate::types::SessionId = id.parse().unwrap();
        Self {
            state: Recording::Pending(Box::new(Pending {
                path: path(state, &id),
                reference: SessionRef {
                    producer: "tester@host".parse().unwrap(),
                    state: "state".parse().unwrap(),
                    run_id: "run".parse().unwrap(),
                    request_id: "request".parse().unwrap(),
                    session_id: id.clone(),
                },
                eval_id: None,
                target: None,
            })),
            ..Self::off(&id)
        }
    }
}

impl Conversation {
    pub(crate) fn wire_events(&self) -> Vec<Value> {
        self.original
            .iter()
            .map(|event| serde_json::from_str(event.get()).unwrap())
            .collect()
    }
}