Skip to main content

atomcode_core/coding_plan/
mod.rs

1// crates/atomcode-core/src/coding_plan/mod.rs
2//
3// CodingPlan integration: claim the free plan, fetch the eligible model
4// list, set up matching provider entries, and pull plan status. Drives
5// both `atomcode codingplan` (CLI subcommand) and `/codingplan` (TUI
6// slash command); they share the orchestrator in `setup` and differ only
7// in how the returned `SetupReport` is rendered.
8//
9// All three REST endpoints live on `api.gitcode.com` (distinct host from
10// `atomgit.com` where the OAuth flow runs; same backend — the token
11// obtained from atomgit OAuth authenticates both). The base URL is
12// configurable via `ATOMCODE_CODINGPLAN_API_BASE`. The shared UA
13// (`ATOMCODE_USER_AGENT`) is honoured by every request so AtomGit's
14// API gateway sees a consistent `atomcode/<ver>` identifier.
15
16pub mod client;
17pub mod crypto;
18pub mod setup;
19pub mod sync_marker;
20pub mod types;
21
22pub use client::{api_base_url, is_auth_expired, AuthExpired, Client};
23pub use crypto::{signer, RequestSigner, SignError, SignInput, SignOutput};
24pub use setup::{run, SetupReport, StepResult};
25pub use sync_marker::{read_last_sync, write_last_sync_now};
26pub use types::{ClaimResponse, ModelEntry, PlanInfo, PlanType, StatusResponse, UsageInfo};