pitboard-core 0.22.0

The engine behind Pitboard: switches Claude Code, Codex and Claude Desktop between accounts by parking and restoring their logins. Its API serves Pitboard's own front ends.
Documentation
//! Google Antigravity, whose App, CLI `agy` and IDE share one login, on the facts in
//! [`assumptions`].

pub(crate) mod assumptions;
pub(crate) mod document;
pub(crate) mod engine;
pub(crate) mod holders;
pub(crate) mod live;
pub(crate) mod paths;
pub(crate) mod run;

// A program standing in for agy under `home`, which a test runs nothing of: a run of it is
// played, and a sign-in only built.
#[cfg(test)]
pub(crate) fn program_for_a_test(home: &std::path::Path) -> std::path::PathBuf {
    let program = home
        .join("bin")
        .join(format!("agy{}", std::env::consts::EXE_SUFFIX));
    crate::host::fs::create_private_dir(crate::permit::Permit::for_a_test(), &home.join("bin"))
        .expect("bin");
    crate::atomic::write(
        crate::permit::Permit::for_a_test(),
        &program,
        b"#!/bin/sh\nexit 99\n",
        crate::atomic::Perms::Secret,
    )
    .expect("a program");
    crate::host::fs::testing::make_runnable(&program).expect("runnable");
    program
}

// What every test's Antigravity login is made from, in the shape agy stores one.
#[cfg(any(test, feature = "test-support"))]
pub(crate) fn login_for_a_test(email: &str, access: &str, refresh: &str) -> serde_json::Value {
    serde_json::json!({
        "token": {
            "access_token": access,
            "token_type": "Bearer",
            "refresh_token": refresh,
            "expiry": "2026-11-28T12:00:00Z",
        },
        "auth_method": "consumer",
        "id_token_email": email,
        "project_id": "a-project",
        "user_tier": "g1-pro-tier",
        "tier_display_name": "Google AI Pro",
    })
}