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
//! Claude Code sign-in using the engine's unbundled command environment.

use artifactize_harness::claude::auth::{self, Host};
use std::path::Path;
use tokio::sync::oneshot;

pub use auth::{Prompt, Status};

fn host(directory: &Path) -> Host<'_> {
    Host {
        directory,
        environment: crate::platform::environment::for_command(),
    }
}

pub(crate) async fn cli_version() -> Result<Option<semver::Version>, String> {
    auth::cli_version(host(&crate::platform::temporary_directory())).await
}

pub async fn status() -> Status {
    auth::status(host(&crate::platform::temporary_directory())).await
}

pub async fn logout() -> Result<(), String> {
    auth::logout(host(&crate::platform::temporary_directory())).await
}

pub async fn login_with(
    pasted: Option<oneshot::Receiver<String>>,
    show: impl FnOnce(&Prompt),
) -> Result<(), String> {
    auth::login_with(host(&crate::platform::temporary_directory()), pasted, show).await
}

pub async fn login() -> Result<(), String> {
    auth::login(host(&crate::platform::temporary_directory())).await
}