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
//! OpenAI's Codex CLI, as one provider among several, on the facts in [`assumptions`].

pub(crate) mod api;
pub(crate) mod assumptions;
pub(crate) mod engine;
pub(crate) mod holders;
pub(crate) mod layers;
pub(crate) mod paths;

// What every test's Codex login is made from, in the shape `codex login` writes one.
#[cfg(any(test, feature = "test-support"))]
pub(crate) fn login_for_a_test(
    account: &str,
    email: &str,
    access: &str,
    refresh: &str,
) -> serde_json::Value {
    serde_json::json!({
        "auth_mode": "chatgpt",
        "OPENAI_API_KEY": null,
        "tokens": {
            "id_token": crate::provider::jwt::unsigned(&serde_json::json!({
                "email": email,
                "https://api.openai.com/auth": {
                    "chatgpt_account_id": account,
                    "chatgpt_user_id": format!("user-{account}"),
                    "chatgpt_plan_type": "pro",
                },
            })),
            "access_token": access,
            "refresh_token": refresh,
            "account_id": account,
        },
        "last_refresh": "2025-10-09T08:00:00Z",
    })
}