artifactize-core 0.27.2

The library behind artifactize: Artifacts, evals, reviews, the monitor and review models, and the shared operations every interface calls.
Documentation
//! Adapt the engine's environment and workspace detection to the native eval backend.

use artifactize_foundation::platform::probe::Markers;
use artifactize_harness::claude::{self, Host};
use std::path::Path;
use tokio_util::sync::CancellationToken;

use crate::{agent::error::Failure, llm::models::ListedModel};
pub use artifactize_harness::claude::{MINIMUM_VERSION, Probe, command};

const WORKSPACE_NAMES: [&str; 5] = {
    let [directory, index, config, ignore] = crate::workspace::ARTIFACT_MARKERS;
    [".git", directory, index, config, ignore]
};

pub(crate) fn host<'a>(temporary_parent: &'a Path, workspace: Option<&'a Path>) -> Host<'a> {
    Host {
        temporary_parent,
        workspace,
        environment: crate::platform::environment::for_command(),
        markers: Markers {
            names: &WORKSPACE_NAMES,
            suffixes: &[crate::workspace::ARTIFACT_SUFFIX],
        },
    }
}

pub async fn probe(cancellation: &CancellationToken) -> Result<Probe, Failure> {
    claude::probe(
        host(&crate::platform::temporary_directory(), None),
        cancellation,
    )
    .await
}

pub async fn models() -> Result<Vec<ListedModel>, String> {
    claude::models(host(&crate::platform::temporary_directory(), None)).await
}